@chat-ads/chatads-sdk 0.1.14 → 0.1.16

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/dist/client.js CHANGED
@@ -184,6 +184,7 @@ async function parseResponse(response) {
184
184
  },
185
185
  error: raw.error,
186
186
  meta: raw.meta ?? { request_id: "unknown" },
187
+ metadata: raw.metadata,
187
188
  };
188
189
  }
189
190
  catch (error) {
package/dist/models.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export type ExtractionMode = "none" | "fast" | "standard";
2
- export type ResolutionMode = "none" | "fast" | "standard";
2
+ export type ResolutionMode = "none" | "standard";
3
3
  /** Top-level response status indicating the outcome of the request */
4
- export type ResponseStatus = "filled" | "partial_fill" | "no_offer" | "message_too_short" | "message_too_long" | "country_not_allowed" | "blocked_keyword" | "language_not_allowed" | "ip_country_not_allowed";
4
+ export type ResponseStatus = "filled" | "partial_fill" | "no_offer" | "no_brand_found" | "message_too_short" | "message_too_long" | "country_not_allowed" | "blocked_keyword" | "language_not_allowed" | "ip_country_not_allowed";
5
5
  /**
6
6
  * Optional fields for ChatAds API requests.
7
7
  */
@@ -14,10 +14,12 @@ export type FunctionItemOptionalFields = {
14
14
  input_type?: "text" | "image_url" | "image_file";
15
15
  /** Extraction control: "none" (bring your own product), "fast" (NLP only), "standard" (default). Default: "standard" */
16
16
  extraction_mode?: ExtractionMode;
17
- /** Resolution control: "none" (extraction only), "fast" (vector only), "standard" (default). Default: "standard" */
17
+ /** Resolution control: "none" (extraction only), "standard" (default). Default: "standard" */
18
18
  resolution_mode?: ResolutionMode;
19
19
  /** Filter image search results by title keyword (image input_type only) */
20
20
  image_title_filter?: string;
21
+ /** Arbitrary JSON metadata passed through to the response (max 10KB, must be a JSON object) */
22
+ metadata?: Record<string, unknown>;
21
23
  };
22
24
  export type FunctionItemPayload = {
23
25
  message: string;
@@ -29,14 +31,18 @@ export type FunctionItemPayload = {
29
31
  export interface Product {
30
32
  /** Product title from search result */
31
33
  title?: string;
32
- /** Product description/snippet from search result */
33
- description?: string;
34
34
  /** Product rating (e.g., 4.5 out of 5) */
35
35
  stars?: number;
36
36
  /** Number of product reviews */
37
37
  reviews?: number;
38
- /** Product image URL (image input_type only) */
38
+ /** Product image URL */
39
39
  image?: string;
40
+ /** Product price in USD, when available */
41
+ price?: number;
42
+ /** Brand name (not always available) */
43
+ brand_name?: string;
44
+ /** Whether the product is Amazon Prime eligible */
45
+ is_prime?: boolean;
40
46
  }
41
47
  /**
42
48
  * Single affiliate offer returned by the API.
@@ -47,13 +53,13 @@ export interface Offer {
47
53
  link_text: string;
48
54
  /** Product search term used (verbose mode only) */
49
55
  search_term?: string;
50
- /** Confidence score (0.0-1.0) (verbose mode only) */
56
+ /** Unified intent score (verbose mode only) */
51
57
  confidence_score?: number | null;
52
58
  /** Confidence level classification (verbose mode only) */
53
59
  confidence_level?: string;
54
60
  /** Affiliate URL — empty when resolution_mode=none */
55
61
  url?: string;
56
- /** Source of the URL resolution (e.g., amazon, serper, vector) (verbose mode only) */
62
+ /** Source of the URL resolution (e.g., vector, serper_lens) (verbose mode only) */
57
63
  resolution_source?: string;
58
64
  /** Product metadata from resolution */
59
65
  product?: Product;
@@ -109,6 +115,7 @@ export interface ChatAdsResponseEnvelope {
109
115
  data: AnalyzeData;
110
116
  error?: ChatAdsError | null;
111
117
  meta: ChatAdsMeta;
118
+ metadata?: Record<string, unknown>;
112
119
  [key: string]: unknown;
113
120
  }
114
121
  /**
package/dist/models.js CHANGED
@@ -10,4 +10,5 @@ export const RESERVED_PAYLOAD_KEYS = new Set([
10
10
  "extraction_mode",
11
11
  "resolution_mode",
12
12
  "image_title_filter",
13
+ "metadata",
13
14
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat-ads/chatads-sdk",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "TypeScript/JavaScript client for the ChatAds prospect scoring API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,14 +32,7 @@
32
32
  "ads"
33
33
  ],
34
34
  "author": "ChatAds",
35
- "repository": {
36
- "type": "git",
37
- "url": "https://github.com/Chat-Ads/chatads-typescript-sdk"
38
- },
39
- "bugs": {
40
- "url": "https://github.com/Chat-Ads/chatads-typescript-sdk/issues"
41
- },
42
- "homepage": "https://github.com/Chat-Ads/chatads-typescript-sdk",
35
+ "homepage": "https://docs.getchatads.com",
43
36
  "devDependencies": {
44
37
  "@types/node": "22.5.0",
45
38
  "@typescript-eslint/eslint-plugin": "^7.17.0",