Skip to content

Commit

Permalink
chore: @topsort/sdk 0.3.0
Browse files Browse the repository at this point in the history
This PR adds the changelog for 0.3.0 and bumps the SDK version

---------

Co-authored-by: Johan Bergström <[email protected]>
  • Loading branch information
barbmarcio and jbergstroem authored Aug 13, 2024
1 parent 8b42eb6 commit f375926
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 4 deletions.
86 changes: 86 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,92 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
We follow the format used by [Open Telemetry](https://github.com/open-telemetry/opentelemetry-python/blob/main/CHANGELOG.md).

## Version 0.3.0 (2024-08-13)

- Introduce a new way to initialize a client ([#43](https://github.com/Topsort/topsort.js/pull/43))

As part of the new implementation, a Topsort Client that embeds all functions is now initialized by receiving a config. Also, some types have been simplified:
- _TopsortAuction_ > **Auction**
- _TopsortEvents_ > **Event**

Migration steps:

#### Auctions - Before
```js
import { TopsortAuction, Config, reportAuction } from "@topsort/sdk";

const auction: TopsortAuction = {
//...
};

const config: Config = {
apiKey: "API_KEY",
};

createAuction(config, auction)
.then((result) => console.log(result))
.catch((error) => console.error(error));
```

#### Auctions - After
```js
import { Auction, Config, TopsortClient } from "@topsort/sdk";

const auction: Auction = {
//...
};

const config: Config = {
apiKey: "API_KEY",
};

const topsortClient = new TopsortClient(config);

topsortClient.createAuction(auction)
.then((result) => console.log(result))
.catch((error) => console.error(error));
```


#### Events - Before
```js
import { TopsortEvent, Config, reportEvent } from "@topsort/sdk";

const event: TopsortEvent = {
//...
};

const config: Config = {
apiKey: "API_KEY",
};

reportEvent(config, event)
.then((result) => console.log(result))
.catch((error) => console.error(error));
```

#### Events - After
```js
import { Event, Config, TopsortClient } from "@topsort/sdk";

const event: Event = {
//...
};

const config: Config = {
apiKey: "API_KEY",
};

const topsortClient = new TopsortClient(config);

topsortClient.reportEvent(event)
.then((result) => console.log(result))
.catch((error) => console.error(error));
```

- Fix CI/CD for release process ([#38](https://github.com/Topsort/topsort.js/pull/38))
- Convert some parameters to optional ([#36](https://github.com/Topsort/topsort.js/pull/36))

## Version 0.2.1 (2024-08-05)

- Add support for Typescript with lower versions ([#37](https://github.com/Topsort/topsort.js/pull/37))
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const config = {

const topsortClient = new TopsortClient(config)

topsortClient.createAuction(config, auctionDetails)
topsortClient.createAuction(auctionDetails)
.then((result) => console.log(result))
.catch((error) => console.error(error));
```
Expand Down Expand Up @@ -148,7 +148,7 @@ const config = {

const topsortClient = new TopsortClient(config)

topsortClient.reportEvent(config, event)
topsortClient.reportEvent(event)
.then((result) => console.log(result))
.catch((error) => console.error(error));
```
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@topsort/sdk",
"version": "0.2.1",
"description": "",
"version": "0.3.0",
"description": "The official Topsort SDK for TypeScript and JavaScript",
"packageManager": "[email protected]",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down

0 comments on commit f375926

Please sign in to comment.