@bitbitpress/client 0.1.11 → 0.1.12
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 +66 -28
- package/dist/generated/openapi.d.ts +8 -2
- package/dist/user/synthesize-batch-manager.js +6 -1
- package/dist/user/synthesize-batch-manager.js.map +1 -1
- package/dist/user/synthesize.d.ts +9 -2
- package/dist/user/synthesize.d.ts.map +1 -1
- package/dist/user/synthesize.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ More details can also be found in your control room's API docs @ https://your-co
|
|
|
44
44
|
- [authenticate](#authenticate)
|
|
45
45
|
- [token](#token)
|
|
46
46
|
- [profile](#profile)
|
|
47
|
+
- [updateProfile](#updateprofile)
|
|
47
48
|
- [recommendations](#recommendations)
|
|
48
49
|
- [report](#report)
|
|
49
50
|
- [signal](#signal)
|
|
@@ -161,7 +162,7 @@ console.log('Access token:', tokenResponse.accessToken);
|
|
|
161
162
|
|
|
162
163
|
#### profile
|
|
163
164
|
|
|
164
|
-
Get user profile information, including suggested
|
|
165
|
+
Get user profile information, including interest tags and suggested topics.
|
|
165
166
|
|
|
166
167
|
```typescript
|
|
167
168
|
client.user.profile(): Promise<ProfileResponse>
|
|
@@ -170,13 +171,15 @@ client.user.profile(): Promise<ProfileResponse>
|
|
|
170
171
|
##### Returns
|
|
171
172
|
|
|
172
173
|
- `Promise<ProfileResponse>`: Response containing:
|
|
173
|
-
- `
|
|
174
|
+
- `interestTags: string[]`: User-picked interest tags
|
|
175
|
+
- `suggestedInterestTags: string[]`: Suggested interest topics for the user
|
|
174
176
|
|
|
175
177
|
##### Example
|
|
176
178
|
|
|
177
179
|
```typescript
|
|
178
180
|
const profile = await client.user.profile();
|
|
179
|
-
console.log('
|
|
181
|
+
console.log('Interest tags:', profile.interestTags);
|
|
182
|
+
console.log('Suggested topics:', profile.suggestedInterestTags);
|
|
180
183
|
```
|
|
181
184
|
|
|
182
185
|
##### Throws
|
|
@@ -185,6 +188,37 @@ console.log('Suggested topics:', profile.suggestedInterestTopics);
|
|
|
185
188
|
|
|
186
189
|
---
|
|
187
190
|
|
|
191
|
+
#### updateProfile
|
|
192
|
+
|
|
193
|
+
Update user profile interest tags. Supports full replace via `interestTags`, or add/remove via `addInterestTags` and `removeInterestTags`.
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
client.user.updateProfile(options: ProfileUpdateRequest): Promise<ProfileResponse>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
##### Parameters
|
|
200
|
+
|
|
201
|
+
- `options.interestTags` (optional): Full replace — set the complete list of interest tags
|
|
202
|
+
- `options.addInterestTags` (optional): Add these tags (ignored if `interestTags` is provided)
|
|
203
|
+
- `options.removeInterestTags` (optional): Remove these tags (ignored if `interestTags` is provided)
|
|
204
|
+
|
|
205
|
+
##### Returns
|
|
206
|
+
|
|
207
|
+
- `Promise<ProfileResponse>`: Updated profile with `interestTags` and `suggestedInterestTags`
|
|
208
|
+
|
|
209
|
+
##### Example
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
await client.user.updateProfile({ interestTags: ['Technology', 'Science'] });
|
|
213
|
+
// Or add/remove:
|
|
214
|
+
await client.user.updateProfile({
|
|
215
|
+
addInterestTags: ['Business'],
|
|
216
|
+
removeInterestTags: ['Politics'],
|
|
217
|
+
});
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
188
222
|
#### recommendations
|
|
189
223
|
|
|
190
224
|
Get recommended articles for the authenticated user.
|
|
@@ -298,15 +332,11 @@ client.user.signal(options: SignalRequest): Promise<SignalResponse>
|
|
|
298
332
|
##### Parameters
|
|
299
333
|
|
|
300
334
|
- `options.signals` (required): Array of signals to record. Each signal object contains:
|
|
301
|
-
- `signal` (required): User action with the text associated with the interaction (e.g., `'
|
|
302
|
-
- `type` (required): Signal type - `"active"` or `"passive"`
|
|
303
|
-
- `"active"`: Explicit intent (click, search, subscribe)
|
|
304
|
-
- `"passive"`: Implicit intent (read, scroll, dwell)
|
|
335
|
+
- `signal` (required): User action with the text associated with the interaction (e.g., `'liked "Warriors intend to keep Jimmy Butler despite season-ending injury"'`)
|
|
305
336
|
- `negative` (optional): When `true`, indicates the signal is negative (e.g., dislike, unfollow). Defaults to `false`. Use sparingly.
|
|
306
337
|
- `contentContext` (optional): Context about the content that triggered this signal
|
|
307
338
|
- `contentId` (required): The ID of the content (e.g., your article ID)
|
|
308
339
|
- `contentType` (required): The type of content (currently only `"article"`)
|
|
309
|
-
- `options.isSynchronous` (optional): When `true`, the request waits for signals to be processed. Defaults to `false`. Use sparingly.
|
|
310
340
|
|
|
311
341
|
##### Returns
|
|
312
342
|
|
|
@@ -321,7 +351,6 @@ await client.user.signal({
|
|
|
321
351
|
signals: [
|
|
322
352
|
{
|
|
323
353
|
signal: 'searched "best restaurants"',
|
|
324
|
-
type: 'active',
|
|
325
354
|
contentContext: {
|
|
326
355
|
contentId: 'article-123',
|
|
327
356
|
contentType: 'article',
|
|
@@ -329,7 +358,6 @@ await client.user.signal({
|
|
|
329
358
|
},
|
|
330
359
|
{
|
|
331
360
|
signal: 'read article about NBA trades',
|
|
332
|
-
type: 'passive',
|
|
333
361
|
contentContext: {
|
|
334
362
|
contentId: 'article-456',
|
|
335
363
|
contentType: 'article',
|
|
@@ -337,7 +365,6 @@ await client.user.signal({
|
|
|
337
365
|
},
|
|
338
366
|
{
|
|
339
367
|
signal: 'unfollowed topic "Politics"',
|
|
340
|
-
type: 'active',
|
|
341
368
|
negative: true,
|
|
342
369
|
},
|
|
343
370
|
],
|
|
@@ -381,7 +408,6 @@ client.user.signalItem(signal: Signal): Promise<SignalResponse>
|
|
|
381
408
|
// Each promise resolves with the batch response
|
|
382
409
|
const response1 = await client.user.signalItem({
|
|
383
410
|
signal: 'searched "best restaurants"',
|
|
384
|
-
type: 'active',
|
|
385
411
|
contentContext: {
|
|
386
412
|
contentId: 'article-123',
|
|
387
413
|
contentType: 'article',
|
|
@@ -390,7 +416,6 @@ const response1 = await client.user.signalItem({
|
|
|
390
416
|
|
|
391
417
|
const response2 = await client.user.signalItem({
|
|
392
418
|
signal: 'read article about NBA trades',
|
|
393
|
-
type: 'passive',
|
|
394
419
|
contentContext: {
|
|
395
420
|
contentId: 'article-456',
|
|
396
421
|
contentType: 'article',
|
|
@@ -422,12 +447,12 @@ client.user.synthesizeItem(
|
|
|
422
447
|
|
|
423
448
|
##### Parameters
|
|
424
449
|
|
|
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`
|
|
450
|
+
- `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`, optional `sourceAssetFields`, optional `sourceBitFields`
|
|
426
451
|
- `onStreamingData` (optional): Callback invoked with streaming data whenever a stream event has `complete: false` for this item. Type: `(data: unknown) => void`.
|
|
427
452
|
|
|
428
453
|
##### Returns
|
|
429
454
|
|
|
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
|
|
455
|
+
- `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; `sourceAssets` and `sourceBits` (JSON strings) are included when `sourceAssetFields`/`sourceBitFields` were requested
|
|
431
456
|
|
|
432
457
|
##### Behavior
|
|
433
458
|
|
|
@@ -483,6 +508,8 @@ client.user.synthesize(
|
|
|
483
508
|
- `inputs` (optional): Context for synthesis — array of `{ type: "externalId" | "text" | "excludeExternalIds", value: string }` (article ID, freeform text, or comma-separated external IDs to exclude)
|
|
484
509
|
- `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"`)
|
|
485
510
|
- `configurationKeyName` (optional): Key name for configuration
|
|
511
|
+
- `sourceAssetFields` (optional): Asset fields to return for sources used for generation (dot or bracket notation). Allowed: `title`, `tags`, `images`, `videos`, `publishedAt`, `externalId`, `externalData`, and subfields. Returned as JSON string of an array of objects in `sourceAssets`.
|
|
512
|
+
- `sourceBitFields` (optional): Bit fields to return for sources used for generation. Allowed: `text`. Returned as JSON string of an array of objects in `sourceBits`.
|
|
486
513
|
- `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
|
|
487
514
|
|
|
488
515
|
##### Returns
|
|
@@ -493,7 +520,7 @@ client.user.synthesize(
|
|
|
493
520
|
|
|
494
521
|
- `{ type: "connected" }`: Connection established
|
|
495
522
|
- `{ type: "complete" }`: Stream complete
|
|
496
|
-
- `{ index
|
|
523
|
+
- `{ index, data?, complete, error?, sourceAssets?, sourceBits? }`: 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 true and `sourceAssetFields`/`sourceBitFields` were requested, `sourceAssets` and/or `sourceBits` (JSON strings) are included. When `complete` is false, `data` is streaming data (partial object). `error` is set on failure.
|
|
497
524
|
|
|
498
525
|
##### Example
|
|
499
526
|
|
|
@@ -598,7 +625,18 @@ type RecommendationsRequest = {
|
|
|
598
625
|
|
|
599
626
|
```typescript
|
|
600
627
|
type ProfileResponse = {
|
|
601
|
-
|
|
628
|
+
interestTags: string[];
|
|
629
|
+
suggestedInterestTags: string[];
|
|
630
|
+
}
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
#### ProfileUpdateRequest
|
|
634
|
+
|
|
635
|
+
```typescript
|
|
636
|
+
type ProfileUpdateRequest = {
|
|
637
|
+
interestTags?: string[]; // Full replace: set the complete list
|
|
638
|
+
addInterestTags?: string[]; // Add tags (ignored if interestTags is provided)
|
|
639
|
+
removeInterestTags?: string[]; // Remove tags (ignored if interestTags is provided)
|
|
602
640
|
}
|
|
603
641
|
```
|
|
604
642
|
|
|
@@ -636,15 +674,12 @@ type ReportResponse = unknown;
|
|
|
636
674
|
type SignalRequest = {
|
|
637
675
|
signals: Array<{
|
|
638
676
|
signal: string;
|
|
639
|
-
type: 'active' | 'passive';
|
|
640
677
|
negative?: boolean;
|
|
641
678
|
contentContext?: {
|
|
642
679
|
contentId: string;
|
|
643
680
|
contentType: 'article';
|
|
644
681
|
};
|
|
645
682
|
}>;
|
|
646
|
-
/** When true, wait for signals to be processed. Default false. Use sparingly. */
|
|
647
|
-
isSynchronous?: boolean;
|
|
648
683
|
}
|
|
649
684
|
```
|
|
650
685
|
|
|
@@ -653,7 +688,6 @@ type SignalRequest = {
|
|
|
653
688
|
```typescript
|
|
654
689
|
type Signal = {
|
|
655
690
|
signal: string;
|
|
656
|
-
type: 'active' | 'passive';
|
|
657
691
|
negative?: boolean;
|
|
658
692
|
contentContext?: {
|
|
659
693
|
contentId: string;
|
|
@@ -672,12 +706,14 @@ type SignalResponse = {
|
|
|
672
706
|
|
|
673
707
|
#### SynthesizeRequest
|
|
674
708
|
|
|
675
|
-
Request body for POST `/v1/user/synthesize` (from OpenAPI). Each item has `inputs`, `output`, and optional `
|
|
709
|
+
Request body for POST `/v1/user/synthesize` (from OpenAPI). Each item has `inputs`, `output`, optional `configurationKeyName`, optional `sourceAssetFields`, and optional `sourceBitFields`.
|
|
676
710
|
|
|
677
711
|
```typescript
|
|
678
712
|
type SynthesizeRequest = {
|
|
679
713
|
items: Array<{
|
|
680
714
|
configurationKeyName?: string;
|
|
715
|
+
sourceAssetFields?: string[];
|
|
716
|
+
sourceBitFields?: string[];
|
|
681
717
|
inputs?: Array<{ type: 'externalId' | 'text' | 'excludeExternalIds'; value: string }>;
|
|
682
718
|
output: {
|
|
683
719
|
schema: string; // JSON schema string; top-level type must be "object"
|
|
@@ -697,25 +733,27 @@ Same shape as the request items above, but `output.schema` may be a **string or
|
|
|
697
733
|
|
|
698
734
|
#### SynthesizeEvent
|
|
699
735
|
|
|
700
|
-
Stream events (SSE). Connection events use `type`; data events use `index`, optional `data`, required `complete
|
|
736
|
+
Stream events (SSE). Connection events use `type`; data events use `index`, optional `data`, required `complete`, optional `error`, and optional `sourceAssets`/`sourceBits` (when complete and requested). 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.
|
|
701
737
|
|
|
702
738
|
```typescript
|
|
703
739
|
type SynthesizeEvent =
|
|
704
740
|
| { type: 'connected' }
|
|
705
741
|
| { type: 'complete' }
|
|
706
|
-
| { index: number; data?: unknown; complete: boolean; error?: string };
|
|
742
|
+
| { index: number; data?: unknown; complete: boolean; error?: string; sourceAssets?: string; sourceBits?: string };
|
|
707
743
|
```
|
|
708
744
|
|
|
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.
|
|
745
|
+
When `complete` is true, `data` is the full synthesized object (keys match your output schema). When `complete` is true and `sourceAssetFields`/`sourceBitFields` were requested, `sourceAssets` and/or `sourceBits` are included as JSON strings. When `complete` is false, `data` is streaming data (partial update). `error` is set on failure.
|
|
710
746
|
|
|
711
747
|
#### SynthesizeItemResponse
|
|
712
748
|
|
|
713
|
-
Return type of `synthesizeItem`. Same shape as a data event payload (without `index`).
|
|
749
|
+
Return type of `synthesizeItem`. Same shape as a data event payload (without `index`). When `complete` is true and `sourceAssetFields` or `sourceBitFields` were requested, `sourceAssets` and/or `sourceBits` are included.
|
|
714
750
|
|
|
715
751
|
```typescript
|
|
716
752
|
type SynthesizeItemResponse = {
|
|
717
|
-
data?: unknown;
|
|
718
|
-
error?: string;
|
|
753
|
+
data?: unknown; // synthesized object when present
|
|
754
|
+
error?: string; // set on failure
|
|
755
|
+
sourceAssets?: string; // JSON string of array of source asset objects (when sourceAssetFields requested)
|
|
756
|
+
sourceBits?: string; // JSON string of array of source bit objects (when sourceBitFields requested)
|
|
719
757
|
};
|
|
720
758
|
```
|
|
721
759
|
|
|
@@ -673,6 +673,10 @@ export interface paths {
|
|
|
673
673
|
"application/json": {
|
|
674
674
|
/** @description Array of items to synthesize. Each item has inputs and output; optional configurationKeyName to use a named config (omit for default). */
|
|
675
675
|
items: {
|
|
676
|
+
/** @description Source asset (assets used for generation) fields to return, (dot or bracket notation, e.g. tags[0], images[1].src). Allowed: title, tags, images, videos, publishedAt, externalId (your content id), externalData, and subfields. Returned as JSON string of an array of objects in `sourceAssets`. */
|
|
677
|
+
sourceAssetFields?: string[];
|
|
678
|
+
/** @description Source bit (bits used for generation) fields to return. Allowed: text. Returned as JSON string of an array of objects in `sourceBits`. */
|
|
679
|
+
sourceBitFields?: string[];
|
|
676
680
|
/** @description Optional configuration key name. Loads an existing synthesis config by this name; omit for default configuration. */
|
|
677
681
|
configurationKeyName?: string;
|
|
678
682
|
/** @description Inputs used as context for the synthesis: externalId (article ID), or text (freeform text). */
|
|
@@ -710,10 +714,12 @@ export interface paths {
|
|
|
710
714
|
* {
|
|
711
715
|
* "index": number,
|
|
712
716
|
* "data": {...},
|
|
713
|
-
* "complete": false | true
|
|
717
|
+
* "complete": false | true,
|
|
718
|
+
* "sourceAssets": "[{...}]",
|
|
719
|
+
* "sourceBits": "[{...}]"
|
|
714
720
|
* }
|
|
715
721
|
* ```
|
|
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.
|
|
722
|
+
* `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. When `complete` is `true` and you requested `sourceAssetFields` or `sourceBitFields`, `sourceAssets` and/or `sourceBits` are included as JSON strings of arrays of objects with the plucked fields (one object per source asset/bit used in generation).
|
|
717
723
|
*
|
|
718
724
|
* **Data Events (error):**
|
|
719
725
|
* ```json
|
|
@@ -120,7 +120,12 @@ class StreamRouter {
|
|
|
120
120
|
entry.onStreamingData?.(event.data);
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
entry.resolve({
|
|
123
|
+
entry.resolve({
|
|
124
|
+
data: event.data,
|
|
125
|
+
error: event.error,
|
|
126
|
+
sourceAssets: event.sourceAssets,
|
|
127
|
+
sourceBits: event.sourceBits,
|
|
128
|
+
});
|
|
124
129
|
this.resolvers.delete(event.index);
|
|
125
130
|
}
|
|
126
131
|
}
|
|
@@ -1 +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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,CAAC;gBACD,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;oBACxD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,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,
|
|
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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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"}
|
|
@@ -3,14 +3,19 @@ import type { SynthesizeItems } from './typeDefs.js';
|
|
|
3
3
|
export type SynthesizeItemResponse = {
|
|
4
4
|
data?: unknown;
|
|
5
5
|
error?: string;
|
|
6
|
+
/** JSON string of array of source asset objects (when sourceAssetFields requested); present when complete. */
|
|
7
|
+
sourceAssets?: string;
|
|
8
|
+
/** JSON string of array of source bit objects (when sourceBitFields requested); present when complete. */
|
|
9
|
+
sourceBits?: string;
|
|
6
10
|
};
|
|
7
11
|
/**
|
|
8
12
|
* Synthesize stream event types (SSE). Per OpenAPI spec:
|
|
9
13
|
* - Connection: `{ type: 'connected' | 'complete' }`
|
|
10
|
-
* - Data: `{ index
|
|
14
|
+
* - Data: `{ index, data?, complete, error?, sourceAssets?, sourceBits? }`.
|
|
11
15
|
* Multiple events may be sent for the same index as partial object updates; the final event
|
|
12
16
|
* for that index has `complete: true` and contains the validated object. When `complete`
|
|
13
|
-
* is
|
|
17
|
+
* is true and sourceAssetFields/sourceBitFields were requested, sourceAssets and sourceBits
|
|
18
|
+
* are included as JSON strings.
|
|
14
19
|
*/
|
|
15
20
|
export type SynthesizeEvent = {
|
|
16
21
|
type: 'connected';
|
|
@@ -21,6 +26,8 @@ export type SynthesizeEvent = {
|
|
|
21
26
|
data?: unknown;
|
|
22
27
|
complete: boolean;
|
|
23
28
|
error?: string;
|
|
29
|
+
sourceAssets?: string;
|
|
30
|
+
sourceBits?: string;
|
|
24
31
|
};
|
|
25
32
|
/** Options for synthesize stream: optional callback for streaming data updates per item index. */
|
|
26
33
|
export interface SynthesizeOptions {
|
|
@@ -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;
|
|
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;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8GAA8G;IAC9G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0GAA0G;IAC1G,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IACE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AA0BN,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"}
|
|
@@ -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":";;AA0EA,gCA0BC;AApGD,6BAAmC;AAEnC,8CAA4C;AAkC5C,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,M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