Skip to content

Commit

Permalink
feat: changelog markdown and minor in readme and contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
barbmarcio committed Jul 17, 2024
1 parent 47fae38 commit beb23f6
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 25 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
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).

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We'd love to accept your patches and contributions to this project. Bellow, you
- [Running Locally](#running-locally)
- [Building the SDK](#building-the-sdk)
- [Tests](#tests)
- [Integration Tests](#integration-tests)
- [Unit Tests](#unit-tests)
- [Code Standards](#code-standards)
- [Submitting contributions](#submitting-contributions)
- [Commit Messages](#commit-messages)
Expand Down Expand Up @@ -80,9 +80,9 @@ This command cleans the `dist` directory and compiles the Typescript files into

## Tests

### Integration Tests
### Unit Tests

To run the integration tests, use the following command:
To run the unit tests, use the following command:

```sh
bun run test
Expand Down
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ yarn add @topsort/topsort.js --save
To create an auction, use the createAuction function. Here is an example:

```js
import { createAuction, TopsortAuction } from '@topsort/topsort.js';
import { createAuction, type TopsortAuction } from '@topsort/topsort.js';

const auctionDetails: TopsortAuction = {
auctions: [
Expand All @@ -54,7 +54,8 @@ const auctionDetails: TopsortAuction = {
};

const config = {
apiKey: "your-api-key",
// generate your api key in the auction manager - it should look some thing like this
apiKey: "TSE_4S6o1g1CB5tyRENfhDMAn6viR7A5cy3j1JAR",
};

createAuction(config, auctionDetails)
Expand All @@ -64,7 +65,7 @@ createAuction(config, auctionDetails)

#### Parameters

`config`: An object containing configuration details including the API key.
`config`: An object containing configuration details including the API key. Please refer to [Auction Manager](https://app.topsort.com/new/en-US/marketplace/account-settings/api-integration)

`auctionDetails`: An object containing the details of the auction to be created, please refer to [Topsort's Auction API doc](https://docs.topsort.com/reference/createauctions) for body specification.

Expand Down Expand Up @@ -95,12 +96,12 @@ createAuction(config, auctionDetails)
400:
```json
{
status: 400,
statusText: "No Content",
body: {
errCode: "bad_request",
docUrl: "https://docs.topsort.com/reference/errors",
message: "The request could not be parsed.",
"status": 400,
"statusText": "No Content",
"body": {
"errCode": "bad_request",
"docUrl": "https://docs.topsort.com/reference/errors",
"message": "The request could not be parsed.",
},
}
```
Expand All @@ -110,7 +111,7 @@ createAuction(config, auctionDetails)
To report an event, use the reportEvent function. Here is an example:

```js
import { reportEvent, TopsortEvent } from 'topsort.js';
import { reportEvent, type TopsortEvent } from 'topsort.js';

const event: TopsortEvent = {
impressions: [
Expand All @@ -128,7 +129,8 @@ const event: TopsortEvent = {
};

const config = {
apiKey: "your-api-key",
// generate your api key in the auction manager - it should look some thing like this
apiKey: "TSE_4S6o1g1CB5tyRENfhDMAn6viR7A5cy3j1JAR",
};

reportEvent(config, event)
Expand All @@ -138,7 +140,7 @@ reportEvent(config, event)

#### Parameters

`config`: An object containing configuration details including the API key.
`config`: An object containing configuration details including the API key. Please refer to [Auction Manager](https://app.topsort.com/new/en-US/marketplace/account-settings/api-integration)

`event`: An object containing the details of the event to be reported, please refer to [Topsort's Event API doc](https://docs.topsort.com/reference/reportevents) for body specification.

Expand All @@ -147,18 +149,18 @@ reportEvent(config, event)
200:
```json
{
ok: true
"ok": true
}
```
400:
```json
{
status: 204,
statusText: "No Content",
body: {
errCode: "bad_request",
docUrl: "https://docs.topsort.com/reference/errors",
message: "The request could not be parsed.",
"status": 204,
"statusText": "No Content",
"body": {
"errCode": "bad_request",
"docUrl": "https://docs.topsort.com/reference/errors",
"message": "The request could not be parsed.",
},
}
```
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "topsort.js",
"version": "1.0.0",
"version": "0.1.0",
"description": "",
"private": true,
"packageManager": "[email protected]",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -15,7 +14,15 @@
"require": "./dist/index.js"
}
},
"files": ["dist/*"],
"files": [
"dist/index.js",
"dist/index.mjs",
"dist/*.d.ts",
"package.json",
"LICENSE",
"CHANGELOG.md",
"README.md"
],
"scripts": {
"build": "rm -rf dist && bun run tsup",
"test": "bun test",
Expand Down

0 comments on commit beb23f6

Please sign in to comment.