diff --git a/CHANGELOG.md b/CHANGELOG.md index 8701c24..63e5307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,21 @@ 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.2.1 (2024-08-05) + +- Add support for Typescript with lower versions ([#37](https://github.com/Topsort/topsort.js/pull/37)) +- Add support for optional timeout on Config ([#11](https://github.com/Topsort/topsort.js/pull/11)) + ## Version 0.2.0 (2024-07-29) -- Adding `userAgent: string` as part of Config for requests ([#21](https://github.com/Topsort/topsort.js/pull/21)) -- Adding `retry: boolean` as part of `reportEvent` response ([#20](https://github.com/Topsort/topsort.js/pull/20)) +- Add `userAgent: string` as part of Config for requests ([#21](https://github.com/Topsort/topsort.js/pull/21)) +- Add `retry: boolean` as part of `reportEvent` response ([#20](https://github.com/Topsort/topsort.js/pull/20)) ## Version 0.1.0 (2024-07-19) ### Added - Initial release of the SDK ([#1](https://github.com/Topsort/topsort.js/pull/1)) -- Pulling `reportEvent` from [Analytics.js](https://github.com/Topsort/analytics.js) -- Added function `createAuction` +- Pull `reportEvent` from [Analytics.js](https://github.com/Topsort/analytics.js) +- Add function `createAuction` diff --git a/README.md b/README.md index 81c8973..e3c3789 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ yarn add @topsort/sdk --save To create an auction, use the `createAuction` function. Example: ```js -import { type TopsortAuction, createAuction } from "@topsort/sdk"; +import { TopsortAuction, createAuction } from "@topsort/sdk"; const auctionDetails: TopsortAuction = { auctions: [ @@ -121,7 +121,7 @@ createAuction(config, auctionDetails) To report an event, use the reportEvent function. Here is an example: ```js -import { type TopsortEvent, reportEvent } from "@topsort/sdk"; +import { TopsortEvent, reportEvent } from "@topsort/sdk"; const event: TopsortEvent = { impressions: [ diff --git a/biome.json b/biome.json index 0509181..15019db 100644 --- a/biome.json +++ b/biome.json @@ -18,7 +18,12 @@ "lineWidth": 100 }, "linter": { - "enabled": true + "enabled": true, + "rules": { + "style": { + "useImportType": "off" + } + } }, "vcs": { "enabled": true, diff --git a/src/functions/auctions.ts b/src/functions/auctions.ts index 90fc395..6bad7e9 100644 --- a/src/functions/auctions.ts +++ b/src/functions/auctions.ts @@ -2,8 +2,8 @@ import { apis, baseURL } from "../constants/apis.constant"; import APIClient from "../lib/api-client"; import AppError from "../lib/app-error"; import { withValidation } from "../lib/with-validation"; -import type { AuctionResult, TopsortAuction } from "../types/auctions"; -import type { Config } from "../types/shared"; +import { AuctionResult, TopsortAuction } from "../types/auctions"; +import { Config } from "../types/shared"; async function handler(config: Config, body: TopsortAuction): Promise { let url: URL; diff --git a/src/functions/events.ts b/src/functions/events.ts index 28ff37a..3fc6361 100644 --- a/src/functions/events.ts +++ b/src/functions/events.ts @@ -2,8 +2,8 @@ import { apis, baseURL } from "../constants/apis.constant"; import APIClient from "../lib/api-client"; import AppError from "../lib/app-error"; import { withValidation } from "../lib/with-validation"; -import type { EventResult, TopsortEvent } from "../types/events"; -import type { Config } from "../types/shared"; +import { EventResult, TopsortEvent } from "../types/events"; +import { Config } from "../types/shared"; /** * Reports an event to the Topsort API. diff --git a/src/lib/api-client.ts b/src/lib/api-client.ts index b3c479e..5f1212a 100644 --- a/src/lib/api-client.ts +++ b/src/lib/api-client.ts @@ -1,6 +1,6 @@ import { version } from "../../package.json"; import { baseURL } from "../constants/apis.constant"; -import type { Config } from "../types/shared"; +import { Config } from "../types/shared"; import AppError from "./app-error"; class APIClient { diff --git a/src/lib/validate-config.ts b/src/lib/validate-config.ts index 9f7d57a..22c63dc 100644 --- a/src/lib/validate-config.ts +++ b/src/lib/validate-config.ts @@ -1,4 +1,4 @@ -import type { Config } from "../types/shared"; +import { Config } from "../types/shared"; import AppError from "./app-error"; export function validateConfig(config: Config): void { diff --git a/src/lib/with-validation.ts b/src/lib/with-validation.ts index fc4f91f..345d508 100644 --- a/src/lib/with-validation.ts +++ b/src/lib/with-validation.ts @@ -1,4 +1,4 @@ -import type { Config } from "../types/shared"; +import { Config } from "../types/shared"; import { validateConfig } from "./validate-config"; export function withValidation( diff --git a/test/auctions.test.ts b/test/auctions.test.ts index 72ca2b8..c56d7fd 100644 --- a/test/auctions.test.ts +++ b/test/auctions.test.ts @@ -8,7 +8,7 @@ import { returnStatus, } from "../src/constants/handlers.constant"; import AppError from "../src/lib/app-error"; -import type { TopsortAuction } from "../src/types/auctions"; +import { TopsortAuction } from "../src/types/auctions"; describe("createAuction", () => { beforeAll(() => mswServer.listen()); diff --git a/test/events.test.ts b/test/events.test.ts index 4d11bea..bea33f3 100644 --- a/test/events.test.ts +++ b/test/events.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeAll, describe, expect, it } from "bun:test"; -import { type TopsortEvent, reportEvent } from "../src"; +import { TopsortEvent, reportEvent } from "../src"; import { apis, baseURL } from "../src/constants/apis.constant"; import { mswServer, returnError, returnStatus } from "../src/constants/handlers.constant"; import AppError from "../src/lib/app-error"; diff --git a/test/validate-config.test.ts b/test/validate-config.test.ts index 7267ebc..ba526d0 100644 --- a/test/validate-config.test.ts +++ b/test/validate-config.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; import AppError from "../src/lib/app-error"; import { validateConfig } from "../src/lib/validate-config"; -import type { Config } from "../src/types/shared"; +import { Config } from "../src/types/shared"; describe("validateConfig", () => { it("should throw an error if apiKey is missing", () => {