@tabstack/sdk 2.0.0 → 2.1.0
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/CHANGELOG.md +27 -0
- package/README.md +2 -2
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent.d.mts +83 -3
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +83 -3
- package/resources/agent.d.ts.map +1 -1
- package/resources/agent.js +45 -2
- package/resources/agent.js.map +1 -1
- package/resources/agent.mjs +45 -2
- package/resources/agent.mjs.map +1 -1
- package/resources/extract.d.mts +90 -1
- package/resources/extract.d.mts.map +1 -1
- package/resources/extract.d.ts +90 -1
- package/resources/extract.d.ts.map +1 -1
- package/resources/extract.js +25 -1
- package/resources/extract.js.map +1 -1
- package/resources/extract.mjs +25 -1
- package/resources/extract.mjs.map +1 -1
- package/resources/generate.d.mts +35 -1
- package/resources/generate.d.mts.map +1 -1
- package/resources/generate.d.ts +35 -1
- package/resources/generate.d.ts.map +1 -1
- package/resources/generate.js +19 -1
- package/resources/generate.js.map +1 -1
- package/resources/generate.mjs +19 -1
- package/resources/generate.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +9 -1
- package/src/resources/agent.ts +104 -3
- package/src/resources/extract.ts +102 -1
- package/src/resources/generate.ts +37 -1
- package/src/resources/index.ts +7 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/agent.js
CHANGED
|
@@ -6,14 +6,19 @@ const resource_1 = require("../core/resource.js");
|
|
|
6
6
|
const headers_1 = require("../internal/headers.js");
|
|
7
7
|
class Agent extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Execute AI-powered browser automation tasks using natural language
|
|
10
|
-
* endpoint **always streams** responses using Server-Sent
|
|
9
|
+
* Execute AI-powered browser automation tasks using natural language with optional
|
|
10
|
+
* geotargeting. This endpoint **always streams** responses using Server-Sent
|
|
11
|
+
* Events (SSE).
|
|
11
12
|
*
|
|
12
13
|
* **Streaming Response:**
|
|
13
14
|
*
|
|
14
15
|
* - All responses are streamed using Server-Sent Events (`text/event-stream`)
|
|
15
16
|
* - Real-time progress updates and results as they're generated
|
|
16
17
|
*
|
|
18
|
+
* **Geotargeting:**
|
|
19
|
+
*
|
|
20
|
+
* - Optionally specify a country code for geotargeted browsing
|
|
21
|
+
*
|
|
17
22
|
* **Use Cases:**
|
|
18
23
|
*
|
|
19
24
|
* - Web scraping and data extraction
|
|
@@ -40,6 +45,44 @@ class Agent extends resource_1.APIResource {
|
|
|
40
45
|
stream: true,
|
|
41
46
|
});
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Execute AI-powered research queries that search the web, analyze sources, and
|
|
50
|
+
* synthesize comprehensive answers. This endpoint **always streams** responses
|
|
51
|
+
* using Server-Sent Events (SSE).
|
|
52
|
+
*
|
|
53
|
+
* **Streaming Response:**
|
|
54
|
+
*
|
|
55
|
+
* - All responses are streamed using Server-Sent Events (`text/event-stream`)
|
|
56
|
+
* - Real-time progress updates as research progresses through phases
|
|
57
|
+
*
|
|
58
|
+
* **Research Modes:**
|
|
59
|
+
*
|
|
60
|
+
* - `fast` - Quick answers with minimal web searches
|
|
61
|
+
* - `balanced` - Standard research with multiple iterations (default)
|
|
62
|
+
*
|
|
63
|
+
* **Use Cases:**
|
|
64
|
+
*
|
|
65
|
+
* - Answering complex questions with cited sources
|
|
66
|
+
* - Synthesizing information from multiple web sources
|
|
67
|
+
* - Research reports on specific topics
|
|
68
|
+
* - Fact-checking and verification tasks
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const researchEvent = await client.agent.research({
|
|
73
|
+
* query:
|
|
74
|
+
* 'What are the latest developments in quantum computing?',
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
research(body, options) {
|
|
79
|
+
return this._client.post('/research', {
|
|
80
|
+
body,
|
|
81
|
+
...options,
|
|
82
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
83
|
+
stream: true,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
43
86
|
}
|
|
44
87
|
exports.Agent = Agent;
|
|
45
88
|
//# sourceMappingURL=agent.js.map
|
package/resources/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/resources/agent.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAGnD,MAAa,KAAM,SAAQ,sBAAW;IACpC
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/resources/agent.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAGnD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;YACpC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAsC,CAAC;IAC1C,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;YACpC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAsC,CAAC;IAC1C,CAAC;CACF;AAhFD,sBAgFC"}
|
package/resources/agent.mjs
CHANGED
|
@@ -3,14 +3,19 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
4
|
export class Agent extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* Execute AI-powered browser automation tasks using natural language
|
|
7
|
-
* endpoint **always streams** responses using Server-Sent
|
|
6
|
+
* Execute AI-powered browser automation tasks using natural language with optional
|
|
7
|
+
* geotargeting. This endpoint **always streams** responses using Server-Sent
|
|
8
|
+
* Events (SSE).
|
|
8
9
|
*
|
|
9
10
|
* **Streaming Response:**
|
|
10
11
|
*
|
|
11
12
|
* - All responses are streamed using Server-Sent Events (`text/event-stream`)
|
|
12
13
|
* - Real-time progress updates and results as they're generated
|
|
13
14
|
*
|
|
15
|
+
* **Geotargeting:**
|
|
16
|
+
*
|
|
17
|
+
* - Optionally specify a country code for geotargeted browsing
|
|
18
|
+
*
|
|
14
19
|
* **Use Cases:**
|
|
15
20
|
*
|
|
16
21
|
* - Web scraping and data extraction
|
|
@@ -37,5 +42,43 @@ export class Agent extends APIResource {
|
|
|
37
42
|
stream: true,
|
|
38
43
|
});
|
|
39
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Execute AI-powered research queries that search the web, analyze sources, and
|
|
47
|
+
* synthesize comprehensive answers. This endpoint **always streams** responses
|
|
48
|
+
* using Server-Sent Events (SSE).
|
|
49
|
+
*
|
|
50
|
+
* **Streaming Response:**
|
|
51
|
+
*
|
|
52
|
+
* - All responses are streamed using Server-Sent Events (`text/event-stream`)
|
|
53
|
+
* - Real-time progress updates as research progresses through phases
|
|
54
|
+
*
|
|
55
|
+
* **Research Modes:**
|
|
56
|
+
*
|
|
57
|
+
* - `fast` - Quick answers with minimal web searches
|
|
58
|
+
* - `balanced` - Standard research with multiple iterations (default)
|
|
59
|
+
*
|
|
60
|
+
* **Use Cases:**
|
|
61
|
+
*
|
|
62
|
+
* - Answering complex questions with cited sources
|
|
63
|
+
* - Synthesizing information from multiple web sources
|
|
64
|
+
* - Research reports on specific topics
|
|
65
|
+
* - Fact-checking and verification tasks
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const researchEvent = await client.agent.research({
|
|
70
|
+
* query:
|
|
71
|
+
* 'What are the latest developments in quantum computing?',
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
research(body, options) {
|
|
76
|
+
return this._client.post('/research', {
|
|
77
|
+
body,
|
|
78
|
+
...options,
|
|
79
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
80
|
+
stream: true,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
40
83
|
}
|
|
41
84
|
//# sourceMappingURL=agent.mjs.map
|
package/resources/agent.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.mjs","sourceRoot":"","sources":["../src/resources/agent.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;AAGvB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"agent.mjs","sourceRoot":"","sources":["../src/resources/agent.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;AAGvB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;YACpC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAsC,CAAC;IAC1C,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;YACpC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAsC,CAAC;IAC1C,CAAC;CACF"}
|
package/resources/extract.d.mts
CHANGED
|
@@ -8,7 +8,31 @@ export declare class Extract extends APIResource {
|
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
|
10
10
|
* const response = await client.extract.json({
|
|
11
|
-
* json_schema: {
|
|
11
|
+
* json_schema: {
|
|
12
|
+
* properties: {
|
|
13
|
+
* stories: {
|
|
14
|
+
* items: {
|
|
15
|
+
* properties: {
|
|
16
|
+
* author: {
|
|
17
|
+
* description: 'Author username',
|
|
18
|
+
* type: 'string',
|
|
19
|
+
* },
|
|
20
|
+
* points: {
|
|
21
|
+
* description: 'Story points',
|
|
22
|
+
* type: 'number',
|
|
23
|
+
* },
|
|
24
|
+
* title: {
|
|
25
|
+
* description: 'Story title',
|
|
26
|
+
* type: 'string',
|
|
27
|
+
* },
|
|
28
|
+
* },
|
|
29
|
+
* type: 'object',
|
|
30
|
+
* },
|
|
31
|
+
* type: 'array',
|
|
32
|
+
* },
|
|
33
|
+
* },
|
|
34
|
+
* type: 'object',
|
|
35
|
+
* },
|
|
12
36
|
* url: 'https://news.ycombinator.com',
|
|
13
37
|
* });
|
|
14
38
|
* ```
|
|
@@ -53,6 +77,14 @@ export declare namespace ExtractMarkdownResponse {
|
|
|
53
77
|
* Author information from HTML metadata
|
|
54
78
|
*/
|
|
55
79
|
author?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Document creation date (ISO 8601)
|
|
82
|
+
*/
|
|
83
|
+
created_at?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Creator application (e.g., "Microsoft Word")
|
|
86
|
+
*/
|
|
87
|
+
creator?: string;
|
|
56
88
|
/**
|
|
57
89
|
* Page description from Open Graph or HTML
|
|
58
90
|
*/
|
|
@@ -61,6 +93,26 @@ export declare namespace ExtractMarkdownResponse {
|
|
|
61
93
|
* Featured image URL from Open Graph
|
|
62
94
|
*/
|
|
63
95
|
image?: string;
|
|
96
|
+
/**
|
|
97
|
+
* PDF keywords as array
|
|
98
|
+
*/
|
|
99
|
+
keywords?: Array<string>;
|
|
100
|
+
/**
|
|
101
|
+
* Document modification date (ISO 8601)
|
|
102
|
+
*/
|
|
103
|
+
modified_at?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Number of pages (PDF documents)
|
|
106
|
+
*/
|
|
107
|
+
page_count?: number;
|
|
108
|
+
/**
|
|
109
|
+
* PDF version (e.g., "1.5")
|
|
110
|
+
*/
|
|
111
|
+
pdf_version?: string;
|
|
112
|
+
/**
|
|
113
|
+
* PDF producer software (e.g., "Adobe PDF Library")
|
|
114
|
+
*/
|
|
115
|
+
producer?: string;
|
|
64
116
|
/**
|
|
65
117
|
* Publisher information from Open Graph
|
|
66
118
|
*/
|
|
@@ -69,6 +121,11 @@ export declare namespace ExtractMarkdownResponse {
|
|
|
69
121
|
* Site name from Open Graph
|
|
70
122
|
*/
|
|
71
123
|
site_name?: string;
|
|
124
|
+
/**
|
|
125
|
+
* PDF-specific metadata fields (populated for PDF documents) PDF subject or
|
|
126
|
+
* summary
|
|
127
|
+
*/
|
|
128
|
+
subject?: string;
|
|
72
129
|
/**
|
|
73
130
|
* Page title from Open Graph or HTML
|
|
74
131
|
*/
|
|
@@ -92,16 +149,36 @@ export interface ExtractJsonParams {
|
|
|
92
149
|
* URL to fetch and extract data from
|
|
93
150
|
*/
|
|
94
151
|
url: string;
|
|
152
|
+
/**
|
|
153
|
+
* Optional geotargeting parameters for proxy requests
|
|
154
|
+
*/
|
|
155
|
+
geo_target?: ExtractJsonParams.GeoTarget;
|
|
95
156
|
/**
|
|
96
157
|
* Bypass cache and force fresh data retrieval
|
|
97
158
|
*/
|
|
98
159
|
nocache?: boolean;
|
|
99
160
|
}
|
|
161
|
+
export declare namespace ExtractJsonParams {
|
|
162
|
+
/**
|
|
163
|
+
* Optional geotargeting parameters for proxy requests
|
|
164
|
+
*/
|
|
165
|
+
interface GeoTarget {
|
|
166
|
+
/**
|
|
167
|
+
* Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB",
|
|
168
|
+
* "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
169
|
+
*/
|
|
170
|
+
country?: string;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
100
173
|
export interface ExtractMarkdownParams {
|
|
101
174
|
/**
|
|
102
175
|
* URL to fetch and convert to markdown
|
|
103
176
|
*/
|
|
104
177
|
url: string;
|
|
178
|
+
/**
|
|
179
|
+
* Optional geotargeting parameters for proxy requests
|
|
180
|
+
*/
|
|
181
|
+
geo_target?: ExtractMarkdownParams.GeoTarget;
|
|
105
182
|
/**
|
|
106
183
|
* Include extracted metadata (Open Graph and HTML metadata) as a separate field in
|
|
107
184
|
* the response
|
|
@@ -112,6 +189,18 @@ export interface ExtractMarkdownParams {
|
|
|
112
189
|
*/
|
|
113
190
|
nocache?: boolean;
|
|
114
191
|
}
|
|
192
|
+
export declare namespace ExtractMarkdownParams {
|
|
193
|
+
/**
|
|
194
|
+
* Optional geotargeting parameters for proxy requests
|
|
195
|
+
*/
|
|
196
|
+
interface GeoTarget {
|
|
197
|
+
/**
|
|
198
|
+
* Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB",
|
|
199
|
+
* "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
200
|
+
*/
|
|
201
|
+
country?: string;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
115
204
|
export declare namespace Extract {
|
|
116
205
|
export { type ExtractJsonResponse as ExtractJsonResponse, type ExtractMarkdownResponse as ExtractMarkdownResponse, type ExtractJsonParams as ExtractJsonParams, type ExtractMarkdownParams as ExtractMarkdownParams, };
|
|
117
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.mts","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"extract.d.mts","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAIxF;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGrG;AAED,MAAM,MAAM,mBAAmB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE7D,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,QAAQ,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC;CAC7C;AAED,yBAAiB,uBAAuB,CAAC;IACvC;;OAEG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEzB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yBAAiB,iBAAiB,CAAC;IACjC;;OAEG;IACH,UAAiB,SAAS;QACxB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAE7C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,SAAS;QACxB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
package/resources/extract.d.ts
CHANGED
|
@@ -8,7 +8,31 @@ export declare class Extract extends APIResource {
|
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
|
10
10
|
* const response = await client.extract.json({
|
|
11
|
-
* json_schema: {
|
|
11
|
+
* json_schema: {
|
|
12
|
+
* properties: {
|
|
13
|
+
* stories: {
|
|
14
|
+
* items: {
|
|
15
|
+
* properties: {
|
|
16
|
+
* author: {
|
|
17
|
+
* description: 'Author username',
|
|
18
|
+
* type: 'string',
|
|
19
|
+
* },
|
|
20
|
+
* points: {
|
|
21
|
+
* description: 'Story points',
|
|
22
|
+
* type: 'number',
|
|
23
|
+
* },
|
|
24
|
+
* title: {
|
|
25
|
+
* description: 'Story title',
|
|
26
|
+
* type: 'string',
|
|
27
|
+
* },
|
|
28
|
+
* },
|
|
29
|
+
* type: 'object',
|
|
30
|
+
* },
|
|
31
|
+
* type: 'array',
|
|
32
|
+
* },
|
|
33
|
+
* },
|
|
34
|
+
* type: 'object',
|
|
35
|
+
* },
|
|
12
36
|
* url: 'https://news.ycombinator.com',
|
|
13
37
|
* });
|
|
14
38
|
* ```
|
|
@@ -53,6 +77,14 @@ export declare namespace ExtractMarkdownResponse {
|
|
|
53
77
|
* Author information from HTML metadata
|
|
54
78
|
*/
|
|
55
79
|
author?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Document creation date (ISO 8601)
|
|
82
|
+
*/
|
|
83
|
+
created_at?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Creator application (e.g., "Microsoft Word")
|
|
86
|
+
*/
|
|
87
|
+
creator?: string;
|
|
56
88
|
/**
|
|
57
89
|
* Page description from Open Graph or HTML
|
|
58
90
|
*/
|
|
@@ -61,6 +93,26 @@ export declare namespace ExtractMarkdownResponse {
|
|
|
61
93
|
* Featured image URL from Open Graph
|
|
62
94
|
*/
|
|
63
95
|
image?: string;
|
|
96
|
+
/**
|
|
97
|
+
* PDF keywords as array
|
|
98
|
+
*/
|
|
99
|
+
keywords?: Array<string>;
|
|
100
|
+
/**
|
|
101
|
+
* Document modification date (ISO 8601)
|
|
102
|
+
*/
|
|
103
|
+
modified_at?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Number of pages (PDF documents)
|
|
106
|
+
*/
|
|
107
|
+
page_count?: number;
|
|
108
|
+
/**
|
|
109
|
+
* PDF version (e.g., "1.5")
|
|
110
|
+
*/
|
|
111
|
+
pdf_version?: string;
|
|
112
|
+
/**
|
|
113
|
+
* PDF producer software (e.g., "Adobe PDF Library")
|
|
114
|
+
*/
|
|
115
|
+
producer?: string;
|
|
64
116
|
/**
|
|
65
117
|
* Publisher information from Open Graph
|
|
66
118
|
*/
|
|
@@ -69,6 +121,11 @@ export declare namespace ExtractMarkdownResponse {
|
|
|
69
121
|
* Site name from Open Graph
|
|
70
122
|
*/
|
|
71
123
|
site_name?: string;
|
|
124
|
+
/**
|
|
125
|
+
* PDF-specific metadata fields (populated for PDF documents) PDF subject or
|
|
126
|
+
* summary
|
|
127
|
+
*/
|
|
128
|
+
subject?: string;
|
|
72
129
|
/**
|
|
73
130
|
* Page title from Open Graph or HTML
|
|
74
131
|
*/
|
|
@@ -92,16 +149,36 @@ export interface ExtractJsonParams {
|
|
|
92
149
|
* URL to fetch and extract data from
|
|
93
150
|
*/
|
|
94
151
|
url: string;
|
|
152
|
+
/**
|
|
153
|
+
* Optional geotargeting parameters for proxy requests
|
|
154
|
+
*/
|
|
155
|
+
geo_target?: ExtractJsonParams.GeoTarget;
|
|
95
156
|
/**
|
|
96
157
|
* Bypass cache and force fresh data retrieval
|
|
97
158
|
*/
|
|
98
159
|
nocache?: boolean;
|
|
99
160
|
}
|
|
161
|
+
export declare namespace ExtractJsonParams {
|
|
162
|
+
/**
|
|
163
|
+
* Optional geotargeting parameters for proxy requests
|
|
164
|
+
*/
|
|
165
|
+
interface GeoTarget {
|
|
166
|
+
/**
|
|
167
|
+
* Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB",
|
|
168
|
+
* "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
169
|
+
*/
|
|
170
|
+
country?: string;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
100
173
|
export interface ExtractMarkdownParams {
|
|
101
174
|
/**
|
|
102
175
|
* URL to fetch and convert to markdown
|
|
103
176
|
*/
|
|
104
177
|
url: string;
|
|
178
|
+
/**
|
|
179
|
+
* Optional geotargeting parameters for proxy requests
|
|
180
|
+
*/
|
|
181
|
+
geo_target?: ExtractMarkdownParams.GeoTarget;
|
|
105
182
|
/**
|
|
106
183
|
* Include extracted metadata (Open Graph and HTML metadata) as a separate field in
|
|
107
184
|
* the response
|
|
@@ -112,6 +189,18 @@ export interface ExtractMarkdownParams {
|
|
|
112
189
|
*/
|
|
113
190
|
nocache?: boolean;
|
|
114
191
|
}
|
|
192
|
+
export declare namespace ExtractMarkdownParams {
|
|
193
|
+
/**
|
|
194
|
+
* Optional geotargeting parameters for proxy requests
|
|
195
|
+
*/
|
|
196
|
+
interface GeoTarget {
|
|
197
|
+
/**
|
|
198
|
+
* Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB",
|
|
199
|
+
* "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
200
|
+
*/
|
|
201
|
+
country?: string;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
115
204
|
export declare namespace Extract {
|
|
116
205
|
export { type ExtractJsonResponse as ExtractJsonResponse, type ExtractMarkdownResponse as ExtractMarkdownResponse, type ExtractJsonParams as ExtractJsonParams, type ExtractMarkdownParams as ExtractMarkdownParams, };
|
|
117
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":"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"}
|
package/resources/extract.js
CHANGED
|
@@ -10,7 +10,31 @@ class Extract extends resource_1.APIResource {
|
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts
|
|
12
12
|
* const response = await client.extract.json({
|
|
13
|
-
* json_schema: {
|
|
13
|
+
* json_schema: {
|
|
14
|
+
* properties: {
|
|
15
|
+
* stories: {
|
|
16
|
+
* items: {
|
|
17
|
+
* properties: {
|
|
18
|
+
* author: {
|
|
19
|
+
* description: 'Author username',
|
|
20
|
+
* type: 'string',
|
|
21
|
+
* },
|
|
22
|
+
* points: {
|
|
23
|
+
* description: 'Story points',
|
|
24
|
+
* type: 'number',
|
|
25
|
+
* },
|
|
26
|
+
* title: {
|
|
27
|
+
* description: 'Story title',
|
|
28
|
+
* type: 'string',
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* type: 'object',
|
|
32
|
+
* },
|
|
33
|
+
* type: 'array',
|
|
34
|
+
* },
|
|
35
|
+
* },
|
|
36
|
+
* type: 'object',
|
|
37
|
+
* },
|
|
14
38
|
* url: 'https://news.ycombinator.com',
|
|
15
39
|
* });
|
|
16
40
|
* ```
|
package/resources/extract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,OAAQ,SAAQ,sBAAW;IACtC
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,IAAI,CAAC,IAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAA2B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAtDD,0BAsDC"}
|
package/resources/extract.mjs
CHANGED
|
@@ -7,7 +7,31 @@ export class Extract extends APIResource {
|
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
9
|
* const response = await client.extract.json({
|
|
10
|
-
* json_schema: {
|
|
10
|
+
* json_schema: {
|
|
11
|
+
* properties: {
|
|
12
|
+
* stories: {
|
|
13
|
+
* items: {
|
|
14
|
+
* properties: {
|
|
15
|
+
* author: {
|
|
16
|
+
* description: 'Author username',
|
|
17
|
+
* type: 'string',
|
|
18
|
+
* },
|
|
19
|
+
* points: {
|
|
20
|
+
* description: 'Story points',
|
|
21
|
+
* type: 'number',
|
|
22
|
+
* },
|
|
23
|
+
* title: {
|
|
24
|
+
* description: 'Story title',
|
|
25
|
+
* type: 'string',
|
|
26
|
+
* },
|
|
27
|
+
* },
|
|
28
|
+
* type: 'object',
|
|
29
|
+
* },
|
|
30
|
+
* type: 'array',
|
|
31
|
+
* },
|
|
32
|
+
* },
|
|
33
|
+
* type: 'object',
|
|
34
|
+
* },
|
|
11
35
|
* url: 'https://news.ycombinator.com',
|
|
12
36
|
* });
|
|
13
37
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.mjs","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"extract.mjs","sourceRoot":"","sources":["../src/resources/extract.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,IAAI,CAAC,IAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAA2B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF"}
|
package/resources/generate.d.mts
CHANGED
|
@@ -11,7 +11,25 @@ export declare class Generate extends APIResource {
|
|
|
11
11
|
* const response = await client.generate.json({
|
|
12
12
|
* instructions:
|
|
13
13
|
* "For each story, categorize it (tech/business/science/other) and write a one-sentence summary explaining what it's about in simple terms.",
|
|
14
|
-
* json_schema: {
|
|
14
|
+
* json_schema: {
|
|
15
|
+
* properties: {
|
|
16
|
+
* summaries: {
|
|
17
|
+
* items: {
|
|
18
|
+
* properties: {
|
|
19
|
+
* category: {
|
|
20
|
+
* description: 'Story category (tech/business/science/etc)',
|
|
21
|
+
* type: 'string',
|
|
22
|
+
* },
|
|
23
|
+
* summary: { description: 'One-sentence summary of the story', type: 'string' },
|
|
24
|
+
* title: { description: 'Story title', type: 'string' },
|
|
25
|
+
* },
|
|
26
|
+
* type: 'object',
|
|
27
|
+
* },
|
|
28
|
+
* type: 'array',
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* type: 'object',
|
|
32
|
+
* },
|
|
15
33
|
* url: 'https://news.ycombinator.com',
|
|
16
34
|
* });
|
|
17
35
|
* ```
|
|
@@ -34,11 +52,27 @@ export interface GenerateJsonParams {
|
|
|
34
52
|
* URL to fetch content from
|
|
35
53
|
*/
|
|
36
54
|
url: string;
|
|
55
|
+
/**
|
|
56
|
+
* Optional geotargeting parameters for proxy requests
|
|
57
|
+
*/
|
|
58
|
+
geo_target?: GenerateJsonParams.GeoTarget;
|
|
37
59
|
/**
|
|
38
60
|
* Bypass cache and force fresh data retrieval
|
|
39
61
|
*/
|
|
40
62
|
nocache?: boolean;
|
|
41
63
|
}
|
|
64
|
+
export declare namespace GenerateJsonParams {
|
|
65
|
+
/**
|
|
66
|
+
* Optional geotargeting parameters for proxy requests
|
|
67
|
+
*/
|
|
68
|
+
interface GeoTarget {
|
|
69
|
+
/**
|
|
70
|
+
* Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB",
|
|
71
|
+
* "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
72
|
+
*/
|
|
73
|
+
country?: string;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
42
76
|
export declare namespace Generate {
|
|
43
77
|
export { type GenerateJsonResponse as GenerateJsonResponse, type GenerateJsonParams as GenerateJsonParams };
|
|
44
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.mts","sourceRoot":"","sources":["../src/resources/generate.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"generate.d.mts","sourceRoot":"","sources":["../src/resources/generate.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,IAAI,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAG3F;AAED,MAAM,MAAM,oBAAoB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC;IAE1C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yBAAiB,kBAAkB,CAAC;IAClC;;OAEG;IACH,UAAiB,SAAS;QACxB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;CAC7G"}
|
package/resources/generate.d.ts
CHANGED
|
@@ -11,7 +11,25 @@ export declare class Generate extends APIResource {
|
|
|
11
11
|
* const response = await client.generate.json({
|
|
12
12
|
* instructions:
|
|
13
13
|
* "For each story, categorize it (tech/business/science/other) and write a one-sentence summary explaining what it's about in simple terms.",
|
|
14
|
-
* json_schema: {
|
|
14
|
+
* json_schema: {
|
|
15
|
+
* properties: {
|
|
16
|
+
* summaries: {
|
|
17
|
+
* items: {
|
|
18
|
+
* properties: {
|
|
19
|
+
* category: {
|
|
20
|
+
* description: 'Story category (tech/business/science/etc)',
|
|
21
|
+
* type: 'string',
|
|
22
|
+
* },
|
|
23
|
+
* summary: { description: 'One-sentence summary of the story', type: 'string' },
|
|
24
|
+
* title: { description: 'Story title', type: 'string' },
|
|
25
|
+
* },
|
|
26
|
+
* type: 'object',
|
|
27
|
+
* },
|
|
28
|
+
* type: 'array',
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* type: 'object',
|
|
32
|
+
* },
|
|
15
33
|
* url: 'https://news.ycombinator.com',
|
|
16
34
|
* });
|
|
17
35
|
* ```
|
|
@@ -34,11 +52,27 @@ export interface GenerateJsonParams {
|
|
|
34
52
|
* URL to fetch content from
|
|
35
53
|
*/
|
|
36
54
|
url: string;
|
|
55
|
+
/**
|
|
56
|
+
* Optional geotargeting parameters for proxy requests
|
|
57
|
+
*/
|
|
58
|
+
geo_target?: GenerateJsonParams.GeoTarget;
|
|
37
59
|
/**
|
|
38
60
|
* Bypass cache and force fresh data retrieval
|
|
39
61
|
*/
|
|
40
62
|
nocache?: boolean;
|
|
41
63
|
}
|
|
64
|
+
export declare namespace GenerateJsonParams {
|
|
65
|
+
/**
|
|
66
|
+
* Optional geotargeting parameters for proxy requests
|
|
67
|
+
*/
|
|
68
|
+
interface GeoTarget {
|
|
69
|
+
/**
|
|
70
|
+
* Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB",
|
|
71
|
+
* "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
72
|
+
*/
|
|
73
|
+
country?: string;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
42
76
|
export declare namespace Generate {
|
|
43
77
|
export { type GenerateJsonResponse as GenerateJsonResponse, type GenerateJsonParams as GenerateJsonParams };
|
|
44
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/resources/generate.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/resources/generate.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,IAAI,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAG3F;AAED,MAAM,MAAM,oBAAoB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC;IAE1C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yBAAiB,kBAAkB,CAAC;IAClC;;OAEG;IACH,UAAiB,SAAS;QACxB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;CAC7G"}
|