@bitbitpress/client 0.1.9 → 0.1.11
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/README.md +37 -10
- package/dist/examples/basic-usage.d.ts.map +1 -1
- package/dist/examples/basic-usage.js +3 -9
- package/dist/examples/basic-usage.js.map +1 -1
- package/dist/generated/openapi.d.ts +113 -29
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/user/index.d.ts +19 -7
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +5 -4
- package/dist/user/index.js.map +1 -1
- package/dist/user/profile.d.ts +12 -2
- package/dist/user/profile.d.ts.map +1 -1
- package/dist/user/profile.js +22 -2
- package/dist/user/profile.js.map +1 -1
- package/dist/user/signal.d.ts +1 -1
- package/dist/user/signal.js +1 -1
- package/dist/user/{batch-manager.d.ts → synthesize-batch-manager.d.ts} +4 -2
- package/dist/user/synthesize-batch-manager.d.ts.map +1 -0
- package/dist/user/{batch-manager.js → synthesize-batch-manager.js} +15 -11
- package/dist/user/synthesize-batch-manager.js.map +1 -0
- package/dist/user/synthesize.d.ts +13 -3
- package/dist/user/synthesize.d.ts.map +1 -1
- package/dist/user/synthesize.js +18 -3
- package/dist/user/synthesize.js.map +1 -1
- package/package.json +1 -1
- package/dist/user/batch-manager.d.ts.map +0 -1
- package/dist/user/batch-manager.js.map +0 -1
package/README.md
CHANGED
|
@@ -411,24 +411,29 @@ console.log('Signal 2 recorded:', response2.recorded);
|
|
|
411
411
|
|
|
412
412
|
#### synthesizeItem
|
|
413
413
|
|
|
414
|
-
Synthesize a single item (batched). Items are automatically batched and sent together after the configured timeout. Returns a promise that resolves with the
|
|
414
|
+
Synthesize a single item (batched). Items are automatically batched and sent together after the configured timeout. Returns a promise that resolves with the final data event for that item's index. Optionally receive streaming data via `onStreamingData` when stream events have `complete: false`.
|
|
415
415
|
|
|
416
416
|
```typescript
|
|
417
|
-
client.user.synthesizeItem(
|
|
417
|
+
client.user.synthesizeItem(
|
|
418
|
+
item: SynthesizeItem,
|
|
419
|
+
onStreamingData?: SynthesizeOnStreamingData
|
|
420
|
+
): Promise<SynthesizeItemResponse>
|
|
418
421
|
```
|
|
419
422
|
|
|
420
423
|
##### Parameters
|
|
421
424
|
|
|
422
425
|
- `item` (required): A single synthesize item (same shape as items in `synthesize`): `inputs`, `output` (schema as JSON string or Zod 4 schema, optional `staleAfter`), optional `configurationKeyName`
|
|
426
|
+
- `onStreamingData` (optional): Callback invoked with streaming data whenever a stream event has `complete: false` for this item. Type: `(data: unknown) => void`.
|
|
423
427
|
|
|
424
428
|
##### Returns
|
|
425
429
|
|
|
426
|
-
- `Promise<SynthesizeItemResponse>`: Resolves with the data event for this item — `data` is the synthesized object (keys match your output schema) when present; `error` is set on failure
|
|
430
|
+
- `Promise<SynthesizeItemResponse>`: Resolves with the final data event for this item — `data` is the synthesized object (keys match your output schema) when present; `error` is set on failure
|
|
427
431
|
|
|
428
432
|
##### Behavior
|
|
429
433
|
|
|
430
434
|
- Items added within the batch timeout window (default: 250ms) are grouped and sent in one request
|
|
431
|
-
- Each item's promise resolves when its data event arrives (by `index`)
|
|
435
|
+
- Each item's promise resolves when its final data event arrives (by `index`, with `complete: true` or `error`)
|
|
436
|
+
- If provided, `onStreamingData` is called for each streaming data update (`complete: false`) for this item's index
|
|
432
437
|
- The batch timeout is configurable via `synthesizeBatchTimeout` when creating the client
|
|
433
438
|
|
|
434
439
|
##### Example
|
|
@@ -463,10 +468,13 @@ const result2 = await client.user.synthesizeItem({
|
|
|
463
468
|
|
|
464
469
|
#### synthesize
|
|
465
470
|
|
|
466
|
-
Synthesize content items personalized to the user (streaming SSE). Returns a stream of connection and data events.
|
|
471
|
+
Synthesize content items personalized to the user (streaming SSE). Returns a stream of connection and data events. Data events may be sent multiple times per index as partial object updates; the final event for an index has `complete: true` and the validated object. Optionally pass `onStreamingData(index, data)` to receive streaming data per item index without consuming the stream.
|
|
467
472
|
|
|
468
473
|
```typescript
|
|
469
|
-
client.user.synthesize(
|
|
474
|
+
client.user.synthesize(
|
|
475
|
+
items: SynthesizeItems,
|
|
476
|
+
options?: { onStreamingData?: (index: number, data: unknown) => void }
|
|
477
|
+
): Promise<AsyncIterable<SynthesizeEvent>>
|
|
470
478
|
```
|
|
471
479
|
|
|
472
480
|
##### Parameters
|
|
@@ -475,6 +483,7 @@ client.user.synthesize(items: SynthesizeItems): Promise<AsyncIterable<Synthesize
|
|
|
475
483
|
- `inputs` (optional): Context for synthesis — array of `{ type: "externalId" | "text" | "excludeExternalIds", value: string }` (article ID, freeform text, or comma-separated external IDs to exclude)
|
|
476
484
|
- `output`: `{ schema: string | ZodType, staleAfter?: string }` — output schema as a JSON string or Zod 4 schema (top-level type must be `"object"`); optional staleness (e.g. `"1h"`, `"30m"`, `"1d"`)
|
|
477
485
|
- `configurationKeyName` (optional): Key name for configuration
|
|
486
|
+
- `options` (optional): `{ onStreamingData?: (index: number, data: unknown) => void }` — if provided, `onStreamingData` is called for each data event with `complete: false`, with the item's index and streaming data
|
|
478
487
|
|
|
479
488
|
##### Returns
|
|
480
489
|
|
|
@@ -484,7 +493,7 @@ client.user.synthesize(items: SynthesizeItems): Promise<AsyncIterable<Synthesize
|
|
|
484
493
|
|
|
485
494
|
- `{ type: "connected" }`: Connection established
|
|
486
495
|
- `{ type: "complete" }`: Stream complete
|
|
487
|
-
- `{ index: number, data?: unknown, error?: string }`: Data event for that item
|
|
496
|
+
- `{ index: number, data?: unknown, complete: boolean, error?: string }`: Data event for that item. Multiple events may be sent per index as partial updates; the final event has `complete: true` and the validated object. When `complete` is false, `data` is streaming data (partial object). `error` is set on failure.
|
|
488
497
|
|
|
489
498
|
##### Example
|
|
490
499
|
|
|
@@ -688,16 +697,16 @@ Same shape as the request items above, but `output.schema` may be a **string or
|
|
|
688
697
|
|
|
689
698
|
#### SynthesizeEvent
|
|
690
699
|
|
|
691
|
-
Stream events (SSE). Connection events use `type`; data events use `index`, optional `data`, and optional `error`.
|
|
700
|
+
Stream events (SSE). Connection events use `type`; data events use `index`, optional `data`, required `complete` (true or false), and optional `error`. Multiple data events may be sent per index as partial object updates; the final event for an index has `complete: true` and the validated object.
|
|
692
701
|
|
|
693
702
|
```typescript
|
|
694
703
|
type SynthesizeEvent =
|
|
695
704
|
| { type: 'connected' }
|
|
696
705
|
| { type: 'complete' }
|
|
697
|
-
| { index: number; data?: unknown; error?: string };
|
|
706
|
+
| { index: number; data?: unknown; complete: boolean; error?: string };
|
|
698
707
|
```
|
|
699
708
|
|
|
700
|
-
`data` is the synthesized object (keys match your output schema)
|
|
709
|
+
When `complete` is true, `data` is the full synthesized object (keys match your output schema). When `complete` is false, `data` is streaming data (partial update). `error` is set on failure.
|
|
701
710
|
|
|
702
711
|
#### SynthesizeItemResponse
|
|
703
712
|
|
|
@@ -709,3 +718,21 @@ type SynthesizeItemResponse = {
|
|
|
709
718
|
error?: string; // set on failure
|
|
710
719
|
};
|
|
711
720
|
```
|
|
721
|
+
|
|
722
|
+
#### SynthesizeOnStreamingData
|
|
723
|
+
|
|
724
|
+
Callback type for receiving streaming data on a single item. Used as the second parameter to `synthesizeItem`. Invoked whenever a stream data event has `complete: false` for that item's index.
|
|
725
|
+
|
|
726
|
+
```typescript
|
|
727
|
+
type SynthesizeOnStreamingData = (data: unknown) => void;
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
#### SynthesizeOptions
|
|
731
|
+
|
|
732
|
+
Options for `synthesize`. Used to receive streaming data per item index without consuming the stream.
|
|
733
|
+
|
|
734
|
+
```typescript
|
|
735
|
+
interface SynthesizeOptions {
|
|
736
|
+
onStreamingData?: (index: number, data: unknown) => void;
|
|
737
|
+
}
|
|
738
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-usage.d.ts","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,iBAAe,YAAY,
|
|
1
|
+
{"version":3,"file":"basic-usage.d.ts","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,iBAAe,YAAY,kBA2B1B;AAGD,iBAAe,gBAAgB,kBAwC9B;AAGD,iBAAe,uBAAuB,kBAiCrC;AAGD,iBAAe,aAAa,kBAgC3B;AAGD,iBAAe,oBAAoB,kBA+BlC;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -21,7 +21,6 @@ async function basicExample() {
|
|
|
21
21
|
signals: [
|
|
22
22
|
{
|
|
23
23
|
signal: 'searched "best restaurants"',
|
|
24
|
-
type: 'active',
|
|
25
24
|
contentContext: {
|
|
26
25
|
contentId: 'article-123',
|
|
27
26
|
contentType: 'article',
|
|
@@ -69,8 +68,10 @@ async function streamingExample() {
|
|
|
69
68
|
else if ('index' in event) {
|
|
70
69
|
if (event.error)
|
|
71
70
|
console.error(`Item ${event.index}:`, event.error);
|
|
72
|
-
else
|
|
71
|
+
else if (event.complete)
|
|
73
72
|
console.log(`Item ${event.index}:`, event.data);
|
|
73
|
+
else
|
|
74
|
+
console.log(`Item ${event.index} (streaming):`, event.data);
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
}
|
|
@@ -115,19 +116,15 @@ async function signalExample() {
|
|
|
115
116
|
// Record multiple signals at once
|
|
116
117
|
await client.user.signal({
|
|
117
118
|
signals: [
|
|
118
|
-
// Active signal (explicit intent like click, search, subscribe)
|
|
119
119
|
{
|
|
120
120
|
signal: 'clicked "Warriors intend to keep Jimmy Butler despite season-ending injury"',
|
|
121
|
-
type: 'active',
|
|
122
121
|
contentContext: {
|
|
123
122
|
contentId: 'article-123',
|
|
124
123
|
contentType: 'article',
|
|
125
124
|
},
|
|
126
125
|
},
|
|
127
|
-
// Passive signal (implicit like read, scroll, dwell)
|
|
128
126
|
{
|
|
129
127
|
signal: 'read about NBA trades',
|
|
130
|
-
type: 'passive',
|
|
131
128
|
contentContext: {
|
|
132
129
|
contentId: 'article-456',
|
|
133
130
|
contentType: 'article',
|
|
@@ -136,7 +133,6 @@ async function signalExample() {
|
|
|
136
133
|
// Negative signal (e.g., dislike, unfollow) - use sparingly
|
|
137
134
|
{
|
|
138
135
|
signal: 'unfollowed topic "Politics"',
|
|
139
|
-
type: 'active',
|
|
140
136
|
negative: true,
|
|
141
137
|
},
|
|
142
138
|
],
|
|
@@ -154,7 +150,6 @@ async function batchedSignalExample() {
|
|
|
154
150
|
// Each promise resolves with the batch response
|
|
155
151
|
const response1 = await client.user.signalItem({
|
|
156
152
|
signal: 'clicked "Warriors intend to keep Jimmy Butler despite season-ending injury"',
|
|
157
|
-
type: 'active',
|
|
158
153
|
contentContext: {
|
|
159
154
|
contentId: 'article-123',
|
|
160
155
|
contentType: 'article',
|
|
@@ -162,7 +157,6 @@ async function batchedSignalExample() {
|
|
|
162
157
|
});
|
|
163
158
|
const response2 = await client.user.signalItem({
|
|
164
159
|
signal: 'read about NBA trades',
|
|
165
|
-
type: 'passive',
|
|
166
160
|
contentContext: {
|
|
167
161
|
contentId: 'article-456',
|
|
168
162
|
contentType: 'article',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-usage.js","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,6CAA6C;AAC7C,KAAK,UAAU,YAAY;IACzB,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC;QACnC,OAAO,EAAE,mDAAmD;KAC7D,CAAC,CAAC;IAEH,gFAAgF;IAChF,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAE7D,sBAAsB;IACtB,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;QACxD,KAAK,EAAE,EAAE;KACV,CAAC,CAAC;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AI,CAAC,UAAU,CAAC;QAC7C,MAAM,EAAE,6EAA6E;QACrF,cAAc,EAAE;YACd,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,SAAS;SACvB;KACF,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC7C,MAAM,EAAE,uBAAuB;QAC/B,cAAc,EAAE;YACd,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,SAAS;SACvB;KACF,CAAC,CAAC;IAEH,2DAA2D;IAC3D,yDAAyD;IACzD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -78,7 +78,7 @@ export interface paths {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
/** @description Unauthorized errors */
|
|
81
|
+
/** @description Unauthorized token exchange errors */
|
|
82
82
|
401: {
|
|
83
83
|
headers: {
|
|
84
84
|
[name: string]: unknown;
|
|
@@ -86,10 +86,10 @@ export interface paths {
|
|
|
86
86
|
content: {
|
|
87
87
|
"application/json": {
|
|
88
88
|
/**
|
|
89
|
-
* @example Unauthorized:
|
|
89
|
+
* @example Unauthorized: Token validation failed
|
|
90
90
|
* @enum {string}
|
|
91
91
|
*/
|
|
92
|
-
error
|
|
92
|
+
error: "Unauthorized: Token validation failed" | "Unauthorized: Failed to create user" | "Unauthorized: Failed to authenticate with BitBitPress";
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
};
|
|
@@ -124,7 +124,7 @@ export interface paths {
|
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
126
|
* Get User Profile
|
|
127
|
-
* @description **GET** `/
|
|
127
|
+
* @description **GET** `/v1/user/profile` Returns the user's profile, including interest tags.
|
|
128
128
|
*/
|
|
129
129
|
get: {
|
|
130
130
|
parameters: {
|
|
@@ -146,9 +146,11 @@ export interface paths {
|
|
|
146
146
|
content: {
|
|
147
147
|
"application/json": {
|
|
148
148
|
/** @example true */
|
|
149
|
-
success
|
|
150
|
-
/** @description User profile
|
|
151
|
-
data
|
|
149
|
+
success: boolean;
|
|
150
|
+
/** @description User profile */
|
|
151
|
+
data: {
|
|
152
|
+
/** @description User-picked interest tags */
|
|
153
|
+
interestTags: string[];
|
|
152
154
|
/**
|
|
153
155
|
* @description Suggested interest topics for the user
|
|
154
156
|
* @example [
|
|
@@ -157,7 +159,96 @@ export interface paths {
|
|
|
157
159
|
* "Business"
|
|
158
160
|
* ]
|
|
159
161
|
*/
|
|
160
|
-
|
|
162
|
+
suggestedInterestTags: string[];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
/** @description Bad request - missing or invalid parameters */
|
|
168
|
+
400: {
|
|
169
|
+
headers: {
|
|
170
|
+
[name: string]: unknown;
|
|
171
|
+
};
|
|
172
|
+
content: {
|
|
173
|
+
"application/json": {
|
|
174
|
+
/** @example Bad request */
|
|
175
|
+
error?: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
/** @description Unauthorized errors */
|
|
180
|
+
401: {
|
|
181
|
+
headers: {
|
|
182
|
+
[name: string]: unknown;
|
|
183
|
+
};
|
|
184
|
+
content: {
|
|
185
|
+
"application/json": {
|
|
186
|
+
/**
|
|
187
|
+
* @example Unauthorized: No authentication token provided
|
|
188
|
+
* @enum {string}
|
|
189
|
+
*/
|
|
190
|
+
error?: "Unauthorized: No authentication token provided" | "Unauthorized: Token has expired" | "Unauthorized: Invalid token" | "Unauthorized: Authentication failed";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
/** @description Internal server error */
|
|
195
|
+
500: {
|
|
196
|
+
headers: {
|
|
197
|
+
[name: string]: unknown;
|
|
198
|
+
};
|
|
199
|
+
content: {
|
|
200
|
+
"application/json": {
|
|
201
|
+
/** @example false */
|
|
202
|
+
success?: boolean;
|
|
203
|
+
/** @example Internal server error: An unknown error occurred */
|
|
204
|
+
error?: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Update User Profile
|
|
212
|
+
* @description **PUT** `/v1/user/profile` Updates the user's interest tags. Supports full replace via `interestTags`, or add/remove via `addInterestTags` and `removeInterestTags` arrays.
|
|
213
|
+
*/
|
|
214
|
+
put: {
|
|
215
|
+
parameters: {
|
|
216
|
+
query?: never;
|
|
217
|
+
header: {
|
|
218
|
+
/** @description Bearer token for authentication */
|
|
219
|
+
authorization: string;
|
|
220
|
+
};
|
|
221
|
+
path?: never;
|
|
222
|
+
cookie?: never;
|
|
223
|
+
};
|
|
224
|
+
requestBody: {
|
|
225
|
+
content: {
|
|
226
|
+
"application/json": {
|
|
227
|
+
/** @description Full replace: set the complete list of interest tags. */
|
|
228
|
+
interestTags?: string[];
|
|
229
|
+
/** @description Add these tags to the current list (ignored if interestTags is provided). */
|
|
230
|
+
addInterestTags?: string[];
|
|
231
|
+
/** @description Remove these tags from the current list (ignored if interestTags is provided). */
|
|
232
|
+
removeInterestTags?: string[];
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
responses: {
|
|
237
|
+
/** @description Successful response */
|
|
238
|
+
200: {
|
|
239
|
+
headers: {
|
|
240
|
+
[name: string]: unknown;
|
|
241
|
+
};
|
|
242
|
+
content: {
|
|
243
|
+
"application/json": {
|
|
244
|
+
/** @example true */
|
|
245
|
+
success: boolean;
|
|
246
|
+
/** @description Updated profile */
|
|
247
|
+
data: {
|
|
248
|
+
/** @description User-picked interest tags */
|
|
249
|
+
interestTags: string[];
|
|
250
|
+
/** @description Suggested interest topics for the user */
|
|
251
|
+
suggestedInterestTags: string[];
|
|
161
252
|
};
|
|
162
253
|
};
|
|
163
254
|
};
|
|
@@ -205,7 +296,6 @@ export interface paths {
|
|
|
205
296
|
};
|
|
206
297
|
};
|
|
207
298
|
};
|
|
208
|
-
put?: never;
|
|
209
299
|
post?: never;
|
|
210
300
|
delete?: never;
|
|
211
301
|
options?: never;
|
|
@@ -250,7 +340,7 @@ export interface paths {
|
|
|
250
340
|
path?: never;
|
|
251
341
|
cookie?: never;
|
|
252
342
|
};
|
|
253
|
-
requestBody
|
|
343
|
+
requestBody: {
|
|
254
344
|
content: {
|
|
255
345
|
"application/json": {
|
|
256
346
|
/** @description Maximum number of recommendations to return */
|
|
@@ -271,15 +361,15 @@ export interface paths {
|
|
|
271
361
|
content: {
|
|
272
362
|
"application/json": {
|
|
273
363
|
/** @example true */
|
|
274
|
-
success
|
|
364
|
+
success: boolean;
|
|
275
365
|
/** @description Recommended articles and pagination */
|
|
276
|
-
data
|
|
366
|
+
data: {
|
|
277
367
|
/** @description List of recommended articles */
|
|
278
|
-
items
|
|
368
|
+
items: {
|
|
279
369
|
/** @example BitBitPress's id */
|
|
280
|
-
assetId
|
|
370
|
+
assetId: string;
|
|
281
371
|
/** @example 0.95 */
|
|
282
|
-
score
|
|
372
|
+
score: number;
|
|
283
373
|
/** @description JSON string of requested asset fields (when `fields` provided in request) */
|
|
284
374
|
fields?: string;
|
|
285
375
|
}[];
|
|
@@ -380,8 +470,8 @@ export interface paths {
|
|
|
380
470
|
content: {
|
|
381
471
|
"application/json": {
|
|
382
472
|
/** @example true */
|
|
383
|
-
success
|
|
384
|
-
data
|
|
473
|
+
success: boolean;
|
|
474
|
+
data: Record<string, never>;
|
|
385
475
|
};
|
|
386
476
|
};
|
|
387
477
|
};
|
|
@@ -464,11 +554,6 @@ export interface paths {
|
|
|
464
554
|
signals: {
|
|
465
555
|
/** @description User action with the text associated with the interaction. (e.g. liked "Warriors intend to keep Jimmy Butler despite season-ending injury") */
|
|
466
556
|
signal: string;
|
|
467
|
-
/**
|
|
468
|
-
* @description `active` = explicit intent (click, search, subscribe). `passive` = implicit (read, scroll, dwell).
|
|
469
|
-
* @enum {string}
|
|
470
|
-
*/
|
|
471
|
-
type: "active" | "passive";
|
|
472
557
|
/** @description When true, indicates the signal is negative (e.g. dislike, unfollow). Use sparingly. Optional; defaults to false. */
|
|
473
558
|
negative?: boolean;
|
|
474
559
|
/** @description Optional context about the content that triggered this signal. */
|
|
@@ -482,8 +567,6 @@ export interface paths {
|
|
|
482
567
|
contentType: "article";
|
|
483
568
|
};
|
|
484
569
|
}[];
|
|
485
|
-
/** @description Whether the request should wait for the signals to be processed. False by default. Use sparingly. */
|
|
486
|
-
isSynchronous?: boolean;
|
|
487
570
|
};
|
|
488
571
|
};
|
|
489
572
|
};
|
|
@@ -499,14 +582,14 @@ export interface paths {
|
|
|
499
582
|
* @description Whether the request succeeded
|
|
500
583
|
* @example true
|
|
501
584
|
*/
|
|
502
|
-
success
|
|
585
|
+
success: boolean;
|
|
503
586
|
/** @description Response payload */
|
|
504
|
-
data
|
|
587
|
+
data: {
|
|
505
588
|
/**
|
|
506
589
|
* @description Whether the signals were recorded (false if no app user or no valid signals)
|
|
507
590
|
* @example true
|
|
508
591
|
*/
|
|
509
|
-
recorded
|
|
592
|
+
recorded: boolean;
|
|
510
593
|
};
|
|
511
594
|
};
|
|
512
595
|
};
|
|
@@ -626,10 +709,11 @@ export interface paths {
|
|
|
626
709
|
* ```json
|
|
627
710
|
* {
|
|
628
711
|
* "index": number,
|
|
629
|
-
* "data": {...}
|
|
712
|
+
* "data": {...},
|
|
713
|
+
* "complete": false | true
|
|
630
714
|
* }
|
|
631
715
|
* ```
|
|
632
|
-
* `data` is the synthesized object (keys match your output schema).
|
|
716
|
+
* `data` is the synthesized object (keys match your output schema). `complete` is `false` for partial streaming updates and `true` for the final validated object for that index.
|
|
633
717
|
*
|
|
634
718
|
* **Data Events (error):**
|
|
635
719
|
* ```json
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,10 @@ export type * from './generated/openapi.js';
|
|
|
11
11
|
export type { UserMethods } from './user/index.js';
|
|
12
12
|
export type { Signal, SignalRequest, SignalResponse } from './user/signal.js';
|
|
13
13
|
export type { RecommendationsRequest, RecommendationsResponse } from './user/recommendations.js';
|
|
14
|
-
export type { ProfileResponse } from './user/profile.js';
|
|
14
|
+
export type { ProfileResponse, ProfileUpdateRequest } from './user/profile.js';
|
|
15
15
|
export type { ReportRequest, ReportResponse } from './user/report.js';
|
|
16
16
|
export type { TokenRequest, TokenResponse } from './user/token.js';
|
|
17
17
|
export type { BitBitPressSynthesizeRequest, RecommendationsRequestBody, SynthesizeInput, SynthesizeItem, SynthesizeItems, SynthesizeOutputSchema, SynthesizeRequest, } from './user/typeDefs.js';
|
|
18
|
-
export type { SynthesizeEvent, SynthesizeItemResponse } from './user/synthesize.js';
|
|
18
|
+
export type { SynthesizeEvent, SynthesizeItemResponse, SynthesizeOptions } from './user/synthesize.js';
|
|
19
|
+
export type { SynthesizeOnStreamingData } from './user/synthesize-batch-manager.js';
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,cAAc,CAAC;AAGtB,mBAAmB,wBAAwB,CAAC;AAG5C,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,cAAc,CAAC;AAGtB,mBAAmB,wBAAwB,CAAC;AAG5C,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,YAAY,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,eAAe,EACf,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACvG,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC"}
|
package/dist/user/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RequestConfig } from '../request.js';
|
|
2
|
+
import { type SynthesizeOnStreamingData } from './synthesize-batch-manager.js';
|
|
2
3
|
import { type RecommendationsRequest, type RecommendationsResponse } from './recommendations.js';
|
|
3
|
-
import { type ProfileResponse } from './profile.js';
|
|
4
|
+
import { type ProfileResponse, type ProfileUpdateRequest } from './profile.js';
|
|
4
5
|
import { type ReportRequest, type ReportResponse } from './report.js';
|
|
5
6
|
import { type Signal, type SignalRequest, type SignalResponse } from './signal.js';
|
|
6
7
|
import { type SynthesizeEvent, type SynthesizeItemResponse } from './synthesize.js';
|
|
@@ -25,11 +26,18 @@ export interface UserMethods {
|
|
|
25
26
|
*/
|
|
26
27
|
token(ssoToken: TokenRequest['ssoToken']): Promise<TokenResponse>;
|
|
27
28
|
/**
|
|
28
|
-
* Get user profile (
|
|
29
|
+
* Get user profile (interest tags and suggested topics).
|
|
29
30
|
*
|
|
30
|
-
* @returns Promise that resolves with profile data (
|
|
31
|
+
* @returns Promise that resolves with profile data (interestTags, suggestedInterestTags)
|
|
31
32
|
*/
|
|
32
33
|
profile(): Promise<NonNullable<ProfileResponse>>;
|
|
34
|
+
/**
|
|
35
|
+
* Update user profile (interest tags). Full replace via interestTags, or add/remove via addInterestTags/removeInterestTags.
|
|
36
|
+
*
|
|
37
|
+
* @param options - interestTags, addInterestTags, or removeInterestTags
|
|
38
|
+
* @returns Promise that resolves with updated profile data
|
|
39
|
+
*/
|
|
40
|
+
updateProfile(options: ProfileUpdateRequest): Promise<NonNullable<ProfileResponse>>;
|
|
33
41
|
/**
|
|
34
42
|
* Retrieve recommended articles for the authenticated user based on their interests.
|
|
35
43
|
*
|
|
@@ -47,7 +55,7 @@ export interface UserMethods {
|
|
|
47
55
|
/**
|
|
48
56
|
* Record user signals (e.g. clicked topic, read article) to inform profile and recommendations.
|
|
49
57
|
*
|
|
50
|
-
* @param options - signals array
|
|
58
|
+
* @param options - signals array (signal, optional negative, optional contentContext)
|
|
51
59
|
* @returns Promise that resolves with response data (recorded: boolean)
|
|
52
60
|
*/
|
|
53
61
|
signal(options: SignalRequest): Promise<NonNullable<SignalResponse>>;
|
|
@@ -62,16 +70,20 @@ export interface UserMethods {
|
|
|
62
70
|
* Synthesize content items personalized to the user (streaming SSE).
|
|
63
71
|
*
|
|
64
72
|
* @param items - Array of items: optional inputs (type: externalId | text | excludeExternalIds, value), output (schema, optional staleAfter), optional configurationKeyName
|
|
65
|
-
* @
|
|
73
|
+
* @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
|
|
74
|
+
* @returns AsyncIterable yielding connection events (connected, complete) and data events (index, data?, complete, error?)
|
|
66
75
|
*/
|
|
67
|
-
synthesize(items: SynthesizeItems
|
|
76
|
+
synthesize(items: SynthesizeItems, options?: {
|
|
77
|
+
onStreamingData?: (index: number, data: unknown) => void;
|
|
78
|
+
}): Promise<AsyncIterable<SynthesizeEvent>>;
|
|
68
79
|
/**
|
|
69
80
|
* Synthesize a single item (batched). Items are sent together after the configured timeout.
|
|
70
81
|
*
|
|
71
82
|
* @param item - Single item to synthesize
|
|
83
|
+
* @param onStreamingData - Optional: called with streaming data when a stream event has complete: false for this item
|
|
72
84
|
* @returns Promise that resolves with the synthesized data for that item's index
|
|
73
85
|
*/
|
|
74
|
-
synthesizeItem(item: SynthesizeItem): Promise<SynthesizeItemResponse>;
|
|
86
|
+
synthesizeItem(item: SynthesizeItem, onStreamingData?: SynthesizeOnStreamingData): Promise<SynthesizeItemResponse>;
|
|
75
87
|
}
|
|
76
88
|
/**
|
|
77
89
|
* User-related API methods
|
package/dist/user/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;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CAAC,CAAC,CAAC;IAErE;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IAErE;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IAEjE;;;;;;OAMG;IACH,UAAU,CACR,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,GACrE,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,cAAc,CACZ,IAAI,EAAE,cAAc,EACpB,eAAe,CAAC,EAAE,yBAAyB,GAC1C,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EACrB,sBAAsB,GAAE,MAAY,EACpC,kBAAkB,GAAE,MAAY,GAC/B,WAAW,CAwFb"}
|
package/dist/user/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createUserMethods = createUserMethods;
|
|
4
|
-
const
|
|
4
|
+
const synthesize_batch_manager_js_1 = require("./synthesize-batch-manager.js");
|
|
5
5
|
const recommendations_js_1 = require("./recommendations.js");
|
|
6
6
|
const profile_js_1 = require("./profile.js");
|
|
7
7
|
const report_js_1 = require("./report.js");
|
|
@@ -50,7 +50,7 @@ function createUserMethods(config, synthesizeBatchTimeout = 250, signalBatchTime
|
|
|
50
50
|
token: userToken,
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
const synthesizeBatchManager = new
|
|
53
|
+
const synthesizeBatchManager = new synthesize_batch_manager_js_1.SynthesizeBatchManager(getConfigWithToken, synthesizeBatchTimeout);
|
|
54
54
|
const signalBatchManager = new signal_batch_manager_js_1.SignalBatchManager(getConfigWithToken, signalBatchTimeout);
|
|
55
55
|
return {
|
|
56
56
|
async authenticate(ssoToken) {
|
|
@@ -62,12 +62,13 @@ function createUserMethods(config, synthesizeBatchTimeout = 250, signalBatchTime
|
|
|
62
62
|
},
|
|
63
63
|
token: (ssoToken) => (0, token_js_1.exchangeToken)(config, ssoToken),
|
|
64
64
|
profile: () => getConfigWithToken().then(profile_js_1.getProfile),
|
|
65
|
+
updateProfile: (options) => getConfigWithToken().then((cfg) => (0, profile_js_1.putProfile)(cfg, options)),
|
|
65
66
|
recommendations: (options) => getConfigWithToken().then((cfg) => (0, recommendations_js_1.getRecommendations)(cfg, options)),
|
|
66
67
|
report: (options) => getConfigWithToken().then((cfg) => (0, report_js_1.reportBit)(cfg, options)),
|
|
67
68
|
signal: (options) => getConfigWithToken().then((cfg) => (0, signal_js_1.recordSignal)(cfg, options)),
|
|
68
69
|
signalItem: (signal) => signalBatchManager.addSignal(signal),
|
|
69
|
-
synthesize: (items) => getConfigWithToken().then((cfg) => (0, synthesize_js_1.synthesize)(cfg, items)),
|
|
70
|
-
synthesizeItem: (item) => synthesizeBatchManager.addItem(item),
|
|
70
|
+
synthesize: (items, options) => getConfigWithToken().then((cfg) => (0, synthesize_js_1.synthesize)(cfg, items, options)),
|
|
71
|
+
synthesizeItem: (item, onStreamingData) => synthesizeBatchManager.addItem(item, onStreamingData),
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
//# sourceMappingURL=index.js.map
|
package/dist/user/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":";;AA8GA,8CA4FC;AAzMD,+EAAuG;AACvG,6DAI8B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EAAE,CACjC,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,wBAAY,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEhE,UAAU,EAAE,CAAC,MAAc,EAAwC,EAAE,CACnE,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC;QAEtC,UAAU,EAAE,CAAC,KAAsB,EAAE,OAAsE,EAAE,EAAE,CAC7G,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,0BAAU,EAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAErE,cAAc,EAAE,CACd,IAAoB,EACpB,eAA2C,EACV,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC;KAC5F,CAAC;AACJ,CAAC"}
|
package/dist/user/profile.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { paths } from '../generated/openapi.js';
|
|
2
2
|
import type { RequestConfig } from '../request.js';
|
|
3
3
|
export type ProfileResponse = paths['/v1/user/profile']['get']['responses'][200]['content']['application/json']['data'];
|
|
4
|
+
export type ProfileUpdateRequest = paths['/v1/user/profile']['put']['requestBody']['content']['application/json'];
|
|
4
5
|
/**
|
|
5
|
-
* Get user profile information (
|
|
6
|
+
* Get user profile information (interest tags and suggested topics).
|
|
6
7
|
*
|
|
7
8
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
8
|
-
* @returns Promise that resolves with profile data (
|
|
9
|
+
* @returns Promise that resolves with profile data (interestTags, suggestedInterestTags per OpenAPI)
|
|
9
10
|
*/
|
|
10
11
|
export declare function getProfile(config: RequestConfig): Promise<NonNullable<ProfileResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Update user profile (interest tags). Supports full replace via interestTags,
|
|
14
|
+
* or add/remove via addInterestTags and removeInterestTags.
|
|
15
|
+
*
|
|
16
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
17
|
+
* @param options - interestTags (full replace), addInterestTags, removeInterestTags
|
|
18
|
+
* @returns Promise that resolves with updated profile data
|
|
19
|
+
*/
|
|
20
|
+
export declare function putProfile(config: RequestConfig, options: ProfileUpdateRequest): Promise<NonNullable<ProfileResponse>>;
|
|
11
21
|
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,MAAM,eAAe,GACzB,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5F;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAWvC"}
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,MAAM,eAAe,GACzB,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5F,MAAM,MAAM,oBAAoB,GAC9B,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAEjF;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAWvC;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAYvC"}
|
package/dist/user/profile.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getProfile = getProfile;
|
|
4
|
+
exports.putProfile = putProfile;
|
|
4
5
|
const request_js_1 = require("../request.js");
|
|
5
6
|
/**
|
|
6
|
-
* Get user profile information (
|
|
7
|
+
* Get user profile information (interest tags and suggested topics).
|
|
7
8
|
*
|
|
8
9
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
9
|
-
* @returns Promise that resolves with profile data (
|
|
10
|
+
* @returns Promise that resolves with profile data (interestTags, suggestedInterestTags per OpenAPI)
|
|
10
11
|
*/
|
|
11
12
|
async function getProfile(config) {
|
|
12
13
|
const response = await (0, request_js_1.makeRequest)(config, {
|
|
@@ -18,4 +19,23 @@ async function getProfile(config) {
|
|
|
18
19
|
}
|
|
19
20
|
return response;
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Update user profile (interest tags). Supports full replace via interestTags,
|
|
24
|
+
* or add/remove via addInterestTags and removeInterestTags.
|
|
25
|
+
*
|
|
26
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
27
|
+
* @param options - interestTags (full replace), addInterestTags, removeInterestTags
|
|
28
|
+
* @returns Promise that resolves with updated profile data
|
|
29
|
+
*/
|
|
30
|
+
async function putProfile(config, options) {
|
|
31
|
+
const response = await (0, request_js_1.makeRequest)(config, {
|
|
32
|
+
method: 'PUT',
|
|
33
|
+
path: '/v1/user/profile',
|
|
34
|
+
body: options,
|
|
35
|
+
});
|
|
36
|
+
if (!response) {
|
|
37
|
+
throw new Error('Failed to update profile: no data in response');
|
|
38
|
+
}
|
|
39
|
+
return response;
|
|
40
|
+
}
|
|
21
41
|
//# sourceMappingURL=profile.js.map
|
package/dist/user/profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":";;AAiBA,gCAaC;AAUD,gCAeC;AArDD,8CAA4C;AAS5C;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAC9B,MAAqB;IAErB,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAkB,MAAM,EAAE;QAC1D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,UAAU,CAC9B,MAAqB,EACrB,OAA6B;IAE7B,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAkB,MAAM,EAAE;QAC1D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/user/signal.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type Signal = SignalRequest['signals'][number];
|
|
|
7
7
|
* Record user signals (e.g. clicked topic, read article) to inform profile interests. Powers recommendations.
|
|
8
8
|
*
|
|
9
9
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
10
|
-
* @param options - signals array (signal text,
|
|
10
|
+
* @param options - signals array (signal text, optional negative, optional contentContext)
|
|
11
11
|
* @returns Promise that resolves with response data (recorded: boolean)
|
|
12
12
|
*/
|
|
13
13
|
export declare function recordSignal(config: RequestConfig, options: SignalRequest): Promise<NonNullable<SignalResponse>>;
|
package/dist/user/signal.js
CHANGED
|
@@ -6,7 +6,7 @@ const request_js_1 = require("../request.js");
|
|
|
6
6
|
* Record user signals (e.g. clicked topic, read article) to inform profile interests. Powers recommendations.
|
|
7
7
|
*
|
|
8
8
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
9
|
-
* @param options - signals array (signal text,
|
|
9
|
+
* @param options - signals array (signal text, optional negative, optional contentContext)
|
|
10
10
|
* @returns Promise that resolves with response data (recorded: boolean)
|
|
11
11
|
*/
|
|
12
12
|
async function recordSignal(config, options) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { RequestConfig } from '../request.js';
|
|
2
2
|
import { SynthesizeItemResponse } from './synthesize.js';
|
|
3
3
|
import type { SynthesizeItem } from './typeDefs.js';
|
|
4
|
+
/** Callback invoked with streaming data for an item when a stream event has complete: false. */
|
|
5
|
+
export type SynthesizeOnStreamingData = (data: unknown) => void;
|
|
4
6
|
/**
|
|
5
7
|
* Batch manager for synthesizeItem
|
|
6
8
|
* Resolves each item individually based on its index in the response
|
|
@@ -15,7 +17,7 @@ export declare class SynthesizeBatchManager {
|
|
|
15
17
|
* Update the config getter (e.g., when token refresh logic changes)
|
|
16
18
|
*/
|
|
17
19
|
updateConfig(config: RequestConfig): void;
|
|
18
|
-
addItem(item: SynthesizeItem): Promise<SynthesizeItemResponse>;
|
|
20
|
+
addItem(item: SynthesizeItem, onStreamingData?: SynthesizeOnStreamingData): Promise<SynthesizeItemResponse>;
|
|
19
21
|
private flush;
|
|
20
22
|
}
|
|
21
|
-
//# sourceMappingURL=batch-manager.d.ts.map
|
|
23
|
+
//# sourceMappingURL=synthesize-batch-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthesize-batch-manager.d.ts","sourceRoot":"","sources":["../../src/user/synthesize-batch-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAwB,sBAAsB,EAAc,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAkBpD,gGAAgG;AAChG,MAAM,MAAM,yBAAyB,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;AAEhE;;;GAGG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,KAAK,CAKL;IACR,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,YAAY,CAAS;gBAEjB,SAAS,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,MAAM;IAKzE;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAIzC,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAe7F,KAAK;CAyBpB"}
|
|
@@ -30,9 +30,9 @@ class SynthesizeBatchManager {
|
|
|
30
30
|
updateConfig(config) {
|
|
31
31
|
this.getConfig = () => Promise.resolve(config);
|
|
32
32
|
}
|
|
33
|
-
addItem(item) {
|
|
33
|
+
addItem(item, onStreamingData) {
|
|
34
34
|
return new Promise((resolve, reject) => {
|
|
35
|
-
this.queue.push({ item, resolve, reject });
|
|
35
|
+
this.queue.push({ item, resolve, reject, onStreamingData });
|
|
36
36
|
// Reset timer
|
|
37
37
|
if (this.timer) {
|
|
38
38
|
clearTimer(this.timer);
|
|
@@ -67,19 +67,18 @@ class SynthesizeBatchManager {
|
|
|
67
67
|
}
|
|
68
68
|
exports.SynthesizeBatchManager = SynthesizeBatchManager;
|
|
69
69
|
/**
|
|
70
|
-
* Routes stream events to indexed promises
|
|
71
|
-
* Resolves each promise
|
|
70
|
+
* Routes stream events to indexed promises.
|
|
71
|
+
* Resolves each promise when complete: true or error; calls onStreamingData for events with complete: false.
|
|
72
72
|
*/
|
|
73
73
|
class StreamRouter {
|
|
74
74
|
resolvers;
|
|
75
75
|
error = null;
|
|
76
76
|
stream = null;
|
|
77
77
|
constructor(batch) {
|
|
78
|
-
// Build resolvers map from batch using array index
|
|
79
78
|
this.resolvers = new Map();
|
|
80
79
|
for (let index = 0; index < batch.length; index++) {
|
|
81
|
-
const { resolve, reject } = batch[index];
|
|
82
|
-
this.resolvers.set(index, { resolve, reject });
|
|
80
|
+
const { resolve, reject, onStreamingData } = batch[index];
|
|
81
|
+
this.resolvers.set(index, { resolve, reject, onStreamingData });
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
/**
|
|
@@ -114,9 +113,14 @@ class StreamRouter {
|
|
|
114
113
|
continue;
|
|
115
114
|
}
|
|
116
115
|
if ('index' in event && typeof event.index === 'number') {
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
|
|
116
|
+
const entry = this.resolvers.get(event.index);
|
|
117
|
+
if (!entry)
|
|
118
|
+
continue;
|
|
119
|
+
if (event.complete === false && event.error == null) {
|
|
120
|
+
entry.onStreamingData?.(event.data);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
entry.resolve({ data: event.data, error: event.error });
|
|
120
124
|
this.resolvers.delete(event.index);
|
|
121
125
|
}
|
|
122
126
|
}
|
|
@@ -134,4 +138,4 @@ class StreamRouter {
|
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
140
|
}
|
|
137
|
-
//# sourceMappingURL=batch-manager.js.map
|
|
141
|
+
//# sourceMappingURL=synthesize-batch-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthesize-batch-manager.js","sourceRoot":"","sources":["../../src/user/synthesize-batch-manager.ts"],"names":[],"mappings":";;;AACA,mDAA2F;AAG3F,mDAAmD;AACnD,SAAS,aAAa;IACpB,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,eAAe;IACtB,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;AACjC,MAAM,UAAU,GAAG,eAAe,EAAE,CAAC;AASrC;;;GAGG;AACH,MAAa,sBAAsB;IACzB,KAAK,GAKR,EAAE,CAAC;IACA,KAAK,GAAiB,IAAI,CAAC;IAC3B,SAAS,CAA+B;IACxC,YAAY,CAAS;IAE7B,YAAY,SAAuC,EAAE,YAAoB;QACvE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,MAAqB;QAChC,IAAI,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,CAAC,IAAoB,EAAE,eAA2C;QACvE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;YAE5D,cAAc;YACd,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;YAED,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE;gBACzB,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,K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,CAAC;oBAC9C,IAAI,CAAC,KAAK;wBAAE,SAAS;oBACrB,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;wBACpD,KAAK,CAAC,eAAe,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBACtC,CAAC;yBAAM,CAAC;wBACN,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;wBACxD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrC,CAAC;gBACH,CAAC;YACH,CAAC;YAED,sEAAsE;YACtE,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;gBACjD,MAAM,CAAC,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC;YACrE,CAAC;YACD,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,+BAA+B;YAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACvE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -7,7 +7,10 @@ export type SynthesizeItemResponse = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Synthesize stream event types (SSE). Per OpenAPI spec:
|
|
9
9
|
* - Connection: `{ type: 'connected' | 'complete' }`
|
|
10
|
-
* - Data: `{ index: number, data?: unknown, error?: string }
|
|
10
|
+
* - Data: `{ index: number, data?: unknown, complete: boolean, error?: string }`.
|
|
11
|
+
* Multiple events may be sent for the same index as partial object updates; the final event
|
|
12
|
+
* for that index has `complete: true` and contains the validated object. When `complete`
|
|
13
|
+
* is false, `data` is a partial update.
|
|
11
14
|
*/
|
|
12
15
|
export type SynthesizeEvent = {
|
|
13
16
|
type: 'connected';
|
|
@@ -16,16 +19,23 @@ export type SynthesizeEvent = {
|
|
|
16
19
|
} | {
|
|
17
20
|
index: number;
|
|
18
21
|
data?: unknown;
|
|
22
|
+
complete: boolean;
|
|
19
23
|
error?: string;
|
|
20
24
|
};
|
|
25
|
+
/** Options for synthesize stream: optional callback for streaming data updates per item index. */
|
|
26
|
+
export interface SynthesizeOptions {
|
|
27
|
+
/** Called for each data event with complete: false, with (index, streaming data). */
|
|
28
|
+
onStreamingData?: (index: number, data: unknown) => void;
|
|
29
|
+
}
|
|
21
30
|
/**
|
|
22
31
|
* Synthesize content items personalized to the user (streaming SSE).
|
|
23
32
|
*
|
|
24
33
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
25
34
|
* @param items - Array of items: each has optional inputs (`type`: externalId | text | excludeExternalIds, `value`), output (schema as JSON string or Zod 4 schema, optional staleAfter), optional configurationKeyName
|
|
26
|
-
* @
|
|
35
|
+
* @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
|
|
36
|
+
* @returns AsyncIterable yielding connection events (connected, complete) and data events (index, data?, complete, error?). Data may be partial until an event with complete: true for that index.
|
|
27
37
|
*/
|
|
28
|
-
export declare function synthesize(config: RequestConfig, items: SynthesizeItems): Promise<AsyncIterable<SynthesizeEvent>>;
|
|
38
|
+
export declare function synthesize(config: RequestConfig, items: SynthesizeItems, options?: SynthesizeOptions): Promise<AsyncIterable<SynthesizeEvent>>;
|
|
29
39
|
/** Event type inferred from synthesize stream (for type-safe usage). */
|
|
30
40
|
export type SynthesizeEventFromReturn = Awaited<ReturnType<typeof synthesize>> extends AsyncIterable<infer T> ? T : never;
|
|
31
41
|
//# sourceMappingURL=synthesize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../src/user/synthesize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAGxE,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../src/user/synthesize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAGxE,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA0BzE,kGAAkG;AAClG,MAAM,WAAW,iBAAiB;IAChC,qFAAqF;IACrF,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAsBzC;AAED,wEAAwE;AACxE,MAAM,MAAM,yBAAyB,GACnC,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC"}
|
package/dist/user/synthesize.js
CHANGED
|
@@ -28,14 +28,29 @@ function normalizeSynthesizeItems(items) {
|
|
|
28
28
|
*
|
|
29
29
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
30
30
|
* @param items - Array of items: each has optional inputs (`type`: externalId | text | excludeExternalIds, `value`), output (schema as JSON string or Zod 4 schema, optional staleAfter), optional configurationKeyName
|
|
31
|
-
* @
|
|
31
|
+
* @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
|
|
32
|
+
* @returns AsyncIterable yielding connection events (connected, complete) and data events (index, data?, complete, error?). Data may be partial until an event with complete: true for that index.
|
|
32
33
|
*/
|
|
33
|
-
async function synthesize(config, items) {
|
|
34
|
+
async function synthesize(config, items, options) {
|
|
34
35
|
const normalizedItems = normalizeSynthesizeItems(items);
|
|
35
|
-
|
|
36
|
+
const stream = await (0, request_js_1.makeRequest)(config, {
|
|
36
37
|
method: 'POST',
|
|
37
38
|
path: '/v1/user/synthesize',
|
|
38
39
|
body: { items: normalizedItems },
|
|
39
40
|
});
|
|
41
|
+
const onStreamingData = options?.onStreamingData;
|
|
42
|
+
if (!onStreamingData)
|
|
43
|
+
return stream;
|
|
44
|
+
return (async function* wrap() {
|
|
45
|
+
for await (const event of stream) {
|
|
46
|
+
if ('index' in event &&
|
|
47
|
+
typeof event.index === 'number' &&
|
|
48
|
+
event.complete === false &&
|
|
49
|
+
event.error == null) {
|
|
50
|
+
onStreamingData(event.index, event.data);
|
|
51
|
+
}
|
|
52
|
+
yield event;
|
|
53
|
+
}
|
|
54
|
+
})();
|
|
40
55
|
}
|
|
41
56
|
//# sourceMappingURL=synthesize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synthesize.js","sourceRoot":"","sources":["../../src/user/synthesize.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"synthesize.js","sourceRoot":"","sources":["../../src/user/synthesize.ts"],"names":[],"mappings":";;AA2DA,gCA0BC;AArFD,6BAAmC;AAEnC,8CAA4C;AAmB5C,gDAAgD;AAChD,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,CAAC;AACxE,CAAC;AAED,oHAAoH;AACpH,SAAS,wBAAwB,CAC/B,KAAsB;IAEtB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAClC,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC;YACtC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAA,kBAAY,EAAC,MAAM,CAAC,CAAC;YACtC,CAAC,CAAC,MAAM,CAAC;QACX,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE;gBACN,GAAG,IAAI,CAAC,MAAM;gBACd,MAAM,EAAE,YAAY;aACrB;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAQD;;;;;;;GAOG;AACI,KAAK,UAAU,UAAU,CAC9B,MAAqB,EACrB,KAAsB,EACtB,OAA2B;IAE3B,MAAM,eAAe,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAW,EAAiC,MAAM,EAAE;QACvE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE;KACjC,CAAC,CAAC;IACH,MAAM,eAAe,GAAG,OAAO,EAAE,eAAe,CAAC;IACjD,IAAI,CAAC,eAAe;QAAE,OAAO,MAAM,CAAC;IACpC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,IAAI;QAC1B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACjC,IACE,OAAO,IAAI,KAAK;gBAChB,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;gBAC/B,KAAK,CAAC,QAAQ,KAAK,KAAK;gBACxB,KAAK,CAAC,KAAK,IAAI,IAAI,EACnB,CAAC;gBACD,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3C,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batch-manager.d.ts","sourceRoot":"","sources":["../../src/user/batch-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAwB,sBAAsB,EAAc,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAkBpD;;;GAGG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,KAAK,CAIL;IACR,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,YAAY,CAAS;gBAEjB,SAAS,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,MAAM;IAKzE;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAIzC,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAehD,KAAK;CAyBpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batch-manager.js","sourceRoot":"","sources":["../../src/user/batch-manager.ts"],"names":[],"mappings":";;;AACA,mDAA2F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