@chat-ads/chatads-sdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat-ads/chatads-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "TypeScript/JavaScript client for the ChatAds prospect scoring API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  "scripts": {
19
19
  "build": "tsc -p tsconfig.json",
20
20
  "clean": "rm -rf dist",
21
- "lint": "tsc --noEmit && eslint 'src/**/*.ts' 'tests/**/*.ts'",
21
+ "lint": "tsc -p tsconfig.dev.json --noEmit && eslint 'src/**/*.ts' 'tests/**/*.ts'",
22
22
  "test": "vitest run"
23
23
  },
24
24
  "engines": {
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { ChatAdsClient } from "../src/index.js";
2
- async function main() {
3
- const apiKey = process.env.CHATADS_API_KEY;
4
- if (!apiKey) {
5
- throw new Error("CHATADS_API_KEY env var is required");
6
- }
7
- const client = new ChatAdsClient({
8
- apiKey,
9
- baseUrl: process.env.CHATADS_BASE_URL ?? "https://chatads--chatads-api-fastapiserver-serve.modal.run",
10
- maxRetries: 1,
11
- raiseOnFailure: true,
12
- });
13
- const response = await client.analyze({
14
- message: "A great home gym always includes a yoga mat",
15
- ip: "",
16
- });
17
- console.log(JSON.stringify(response, null, 2));
18
- }
19
- main().catch((error) => {
20
- console.error(error);
21
- process.exit(1);
22
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import { describe, expect, test } from "vitest";
2
- import { ChatAdsClient } from "../src/client.js";
3
- describe("ChatAdsClient", () => {
4
- test("throws when baseUrl is missing", () => {
5
- expect(() => new ChatAdsClient({ apiKey: "abc", baseUrl: "" })).toThrowError();
6
- });
7
- });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes