@bitbitpress/client 1.1.1 → 1.1.2
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 +39 -19
- package/dist/data/assets.d.ts +11 -3
- package/dist/data/assets.d.ts.map +1 -1
- package/dist/data/assets.js +2 -2
- package/dist/data/assets.js.map +1 -1
- package/dist/data/index.d.ts +2 -2
- package/dist/generated/openapi.d.ts +16 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/user/index.d.ts +4 -4
- package/dist/user/interaction.d.ts +2 -4
- package/dist/user/interaction.d.ts.map +1 -1
- package/dist/user/interaction.js +2 -4
- package/dist/user/interaction.js.map +1 -1
- package/dist/user/synthesize.d.ts +12 -15
- package/dist/user/synthesize.d.ts.map +1 -1
- package/dist/user/synthesize.js +1 -1
- package/dist/user/synthesize.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,8 +56,8 @@ More details can also be found in your control room's API docs @ https://your-co
|
|
|
56
56
|
- [signalItem](#signalitem)
|
|
57
57
|
- [synthesizeItem](#synthesizeitem)
|
|
58
58
|
- [synthesize](#synthesize)
|
|
59
|
-
- [interactions](#interactions)
|
|
60
|
-
- [respondToInteraction](#respondtointeraction)
|
|
59
|
+
- [interactions (deprecated)](#interactions)
|
|
60
|
+
- [respondToInteraction (deprecated)](#respondtointeraction)
|
|
61
61
|
- [Data Methods](#data-methods)
|
|
62
62
|
- [assets](#assets)
|
|
63
63
|
- [Types](#types)
|
|
@@ -450,6 +450,7 @@ client.user.submit(options: SubmitRequest): Promise<SubmitResponse>
|
|
|
450
450
|
|
|
451
451
|
```typescript
|
|
452
452
|
const { synthesisOutputId } = await client.user.synthesizeItem(pollItem);
|
|
453
|
+
if (!synthesisOutputId) throw new Error('Poll output is missing synthesisOutputId');
|
|
453
454
|
await client.user.submit({ synthesisOutputId, data: { response: 'yes' } });
|
|
454
455
|
```
|
|
455
456
|
|
|
@@ -625,12 +626,12 @@ client.user.synthesizeItem(
|
|
|
625
626
|
|
|
626
627
|
##### Parameters
|
|
627
628
|
|
|
628
|
-
- `item` (required): A single synthesize item (same shape as items in `synthesize`): `inputs`, `output` (schema as JSON string or Zod 4 schema), optional `configurationKeyName`, optional `synthesisHistoryLimit` (how many recent stored outputs to expose in `
|
|
629
|
+
- `item` (required): A single synthesize item (same shape as items in `synthesize`): `inputs`, `output` (schema as JSON string or Zod 4 schema), optional `configurationKeyName`, optional `synthesisHistoryLimit` (how many recent stored outputs to expose in `synthesisHistoryEntries`; defaults to `0` — no history emitted), optional `searchOptionsOverrides` (e.g. `{ lookbackMinutes: 1440 }` for 24-hour lookback)
|
|
629
630
|
- `onStreamingData` (optional): Callback invoked with streaming data whenever a stream event has `complete: false` for this item. Type: `(data: unknown) => void`.
|
|
630
631
|
|
|
631
632
|
##### Returns
|
|
632
633
|
|
|
633
|
-
- `Promise<SynthesizeItemResponse>`: Resolves with the final data event for this item — `data` is the synthesized object (keys match your output schema) when present; `
|
|
634
|
+
- `Promise<SynthesizeItemResponse>`: Resolves with the final data event for this item — `data` is the synthesized object (keys match your output schema) when present; `synthesisOutputId` identifies the current output for submissions; `synthesisHistoryEntries` is an array of recent stored `{ synthesisOutputId, data }` entries when `synthesisHistoryLimit > 0` (most-recent first; the first entry is the current synthesis itself); deprecated `synthesisHistory` may also be present as bare payloads; `error` is set on failure
|
|
634
635
|
|
|
635
636
|
##### Behavior
|
|
636
637
|
|
|
@@ -685,7 +686,7 @@ client.user.synthesize(
|
|
|
685
686
|
- `inputs` (optional): Context for synthesis — array of `{ type: "externalId" | "text" | "excludeExternalIds", value: string }` (article ID, freeform text, or comma-separated external IDs to exclude)
|
|
686
687
|
- `output`: `{ schema: string | ZodType }` — output schema as a JSON string or Zod 4 schema (top-level type must be `"object"`; supports object, string, number, boolean, array, and enum)
|
|
687
688
|
- `configurationKeyName` (optional): Key name for configuration
|
|
688
|
-
- `synthesisHistoryLimit` (optional): How many recent stored synthesis outputs to expose in the final data event's `
|
|
689
|
+
- `synthesisHistoryLimit` (optional): How many recent stored synthesis outputs to expose in the final data event's `synthesisHistoryEntries` field. Defaults to `0` (no history emitted). When `> 0`, the final event includes a `synthesisHistoryEntries` array of up to N `{ synthesisOutputId, data }` entries (most-recent first; first entry is the current synthesis itself). A deprecated `synthesisHistory` array of bare payloads may also be present for retrocompatibility.
|
|
689
690
|
- `searchOptionsOverrides` (optional): Per-request overrides, e.g. `{ lookbackMinutes: 1440 }` for 24-hour lookback.
|
|
690
691
|
- `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
|
|
691
692
|
|
|
@@ -697,7 +698,7 @@ client.user.synthesize(
|
|
|
697
698
|
|
|
698
699
|
- `{ type: "connected" }`: Connection established
|
|
699
700
|
- `{ type: "complete" }`: Stream complete
|
|
700
|
-
- `{ index, data?, synthesisHistory?, complete, error? }`: 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). `
|
|
701
|
+
- `{ index, data?, synthesisOutputId?, synthesisHistoryEntries?, synthesisHistory?, complete, error? }`: 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). `synthesisHistoryEntries` (only on the final event, only when `synthesisHistoryLimit > 0`) is an array of recent stored `{ synthesisOutputId, data }` entries, most-recent first. `synthesisHistory` is deprecated and contains the same entries as bare payloads. `error` is set on failure.
|
|
701
702
|
|
|
702
703
|
##### Example
|
|
703
704
|
|
|
@@ -753,6 +754,8 @@ for await (const event of stream) {
|
|
|
753
754
|
|
|
754
755
|
#### interactions
|
|
755
756
|
|
|
757
|
+
**Deprecated:** use `client.user.submissionState({ synthesisOutputId })`, keyed by the poll's synthesis output. This legacy method is kept for retrocompatibility.
|
|
758
|
+
|
|
756
759
|
Batch-resolve interaction state for items from a synthesis output. Returns aggregates and whether the current user has already responded to each.
|
|
757
760
|
|
|
758
761
|
```typescript
|
|
@@ -803,6 +806,8 @@ for (const item of interactions) {
|
|
|
803
806
|
|
|
804
807
|
#### respondToInteraction
|
|
805
808
|
|
|
809
|
+
**Deprecated:** use `client.user.submit({ synthesisOutputId, data })`, keyed by the poll's synthesis output. This legacy method is kept for retrocompatibility.
|
|
810
|
+
|
|
806
811
|
Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
807
812
|
|
|
808
813
|
```typescript
|
|
@@ -849,7 +854,7 @@ Data methods require authentication. Call `client.user.authenticate()` before us
|
|
|
849
854
|
|
|
850
855
|
#### assets
|
|
851
856
|
|
|
852
|
-
Fetch assets by IDs and return requested fields.
|
|
857
|
+
Fetch assets by internal IDs or external IDs, and return requested fields.
|
|
853
858
|
|
|
854
859
|
```typescript
|
|
855
860
|
client.data.assets(options: AssetsRequest): Promise<AssetsResponse>
|
|
@@ -857,7 +862,8 @@ client.data.assets(options: AssetsRequest): Promise<AssetsResponse>
|
|
|
857
862
|
|
|
858
863
|
##### Parameters
|
|
859
864
|
|
|
860
|
-
- `options.assetIds` (required): List of asset IDs to fetch
|
|
865
|
+
- `options.assetIds` (required unless `externalIds` is provided): List of BitBitPress asset IDs to fetch
|
|
866
|
+
- `options.externalIds` (required unless `assetIds` is provided): List of source-system external IDs to fetch
|
|
861
867
|
- `options.assetFields` (required): Asset fields to return (dot or bracket notation, e.g. `tags[0]`, `images[1].src`). Allowed: `assetId`, `title`, `tags`, `images`, `videos`, `audios`, `publishedAt`, `externalId`, `externalData`, `assetType`, `sourceUrl`, `dataSource.name`, and subfields. Empty array returns objects with only `assetId`.
|
|
862
868
|
|
|
863
869
|
##### Returns
|
|
@@ -1072,7 +1078,7 @@ Request body for POST `/v1/user/synthesize` (from OpenAPI). Each item has `input
|
|
|
1072
1078
|
type SynthesizeRequest = {
|
|
1073
1079
|
items: Array<{
|
|
1074
1080
|
configurationKeyName?: string;
|
|
1075
|
-
synthesisHistoryLimit?: number; // how many recent stored outputs to include in
|
|
1081
|
+
synthesisHistoryLimit?: number; // how many recent stored outputs to include in synthesisHistoryEntries; defaults to 0 (no history emitted)
|
|
1076
1082
|
searchOptionsOverrides?: { lookbackMinutes?: number };
|
|
1077
1083
|
inputs?: Array<{ type: 'externalId' | 'text' | 'excludeExternalIds'; value: string }>;
|
|
1078
1084
|
output: {
|
|
@@ -1092,16 +1098,24 @@ Same shape as the request items above, but `output.schema` may be a **string or
|
|
|
1092
1098
|
|
|
1093
1099
|
#### SynthesizeEvent
|
|
1094
1100
|
|
|
1095
|
-
Stream events (SSE). Connection events use `type`; data events use `index`, optional `data`, required `complete`, 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.
|
|
1101
|
+
Stream events (SSE). Connection events use `type`; data events use `index`, optional `data`, optional `synthesisOutputId`, optional history fields, required `complete`, 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.
|
|
1096
1102
|
|
|
1097
1103
|
```typescript
|
|
1098
1104
|
type SynthesizeEvent =
|
|
1099
1105
|
| { type: 'connected' }
|
|
1100
1106
|
| { type: 'complete' }
|
|
1101
|
-
| {
|
|
1107
|
+
| {
|
|
1108
|
+
index: number;
|
|
1109
|
+
data?: unknown;
|
|
1110
|
+
synthesisOutputId?: string;
|
|
1111
|
+
synthesisHistoryEntries?: Array<{ synthesisOutputId: string; data: unknown }>;
|
|
1112
|
+
synthesisHistory?: unknown[]; // deprecated bare-payload history
|
|
1113
|
+
complete: boolean;
|
|
1114
|
+
error?: string;
|
|
1115
|
+
};
|
|
1102
1116
|
```
|
|
1103
1117
|
|
|
1104
|
-
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). When the request set `synthesisHistoryLimit > 0`, the final event also includes `
|
|
1118
|
+
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). `synthesisOutputId` identifies the current output and can be passed to `submit`, `submissionState`, or `submissionFeed`. When the request set `synthesisHistoryLimit > 0`, the final event also includes `synthesisHistoryEntries`: an array of recent stored `{ synthesisOutputId, data }` entries (most-recent first; first entry is the current synthesis itself). Deprecated `synthesisHistory` may also be present as index-aligned bare payloads. `error` is set on failure.
|
|
1105
1119
|
|
|
1106
1120
|
#### SynthesizeItemResponse
|
|
1107
1121
|
|
|
@@ -1109,9 +1123,11 @@ Return type of `synthesizeItem`. Same shape as a data event payload (without `in
|
|
|
1109
1123
|
|
|
1110
1124
|
```typescript
|
|
1111
1125
|
type SynthesizeItemResponse = {
|
|
1112
|
-
data?: unknown;
|
|
1113
|
-
|
|
1114
|
-
|
|
1126
|
+
data?: unknown; // synthesized object when present
|
|
1127
|
+
synthesisOutputId?: string; // current output id for submissions
|
|
1128
|
+
synthesisHistoryEntries?: Array<{ synthesisOutputId: string; data: unknown }>; // preferred history with output ids
|
|
1129
|
+
synthesisHistory?: unknown[]; // deprecated bare-payload history
|
|
1130
|
+
error?: string; // set on failure
|
|
1115
1131
|
};
|
|
1116
1132
|
```
|
|
1117
1133
|
|
|
@@ -1121,9 +1137,13 @@ Request body for POST `/v1/data/assets`.
|
|
|
1121
1137
|
|
|
1122
1138
|
```typescript
|
|
1123
1139
|
type AssetsRequest = {
|
|
1124
|
-
assetIds
|
|
1140
|
+
assetIds?: string[];
|
|
1141
|
+
externalIds?: string[];
|
|
1125
1142
|
assetFields: string[];
|
|
1126
|
-
}
|
|
1143
|
+
} & (
|
|
1144
|
+
| { assetIds: string[]; externalIds?: string[] }
|
|
1145
|
+
| { assetIds?: string[]; externalIds: string[] }
|
|
1146
|
+
);
|
|
1127
1147
|
```
|
|
1128
1148
|
|
|
1129
1149
|
#### AssetsResponse
|
|
@@ -1156,7 +1176,7 @@ interface SynthesizeOptions {
|
|
|
1156
1176
|
|
|
1157
1177
|
#### InteractionsRequest
|
|
1158
1178
|
|
|
1159
|
-
|
|
1179
|
+
Deprecated request body for POST `/v1/user/interactions`. Prefer `submissionState({ synthesisOutputId })`.
|
|
1160
1180
|
|
|
1161
1181
|
```typescript
|
|
1162
1182
|
type InteractionsRequest = {
|
|
@@ -1192,7 +1212,7 @@ type InteractionsResponse = InteractionItem[];
|
|
|
1192
1212
|
|
|
1193
1213
|
#### InteractionResponseRequest
|
|
1194
1214
|
|
|
1195
|
-
|
|
1215
|
+
Deprecated request body for POST `/v1/user/interactions/:interactionId/responses`. Prefer `submit({ synthesisOutputId, data })`.
|
|
1196
1216
|
|
|
1197
1217
|
```typescript
|
|
1198
1218
|
type InteractionResponseRequest = {
|
package/dist/data/assets.d.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type { paths } from '../generated/openapi.js';
|
|
2
2
|
import type { RequestConfig } from '../request.js';
|
|
3
|
-
|
|
3
|
+
type OpenApiAssetsRequest = paths['/v1/data/assets']['post']['requestBody']['content']['application/json'];
|
|
4
|
+
export type AssetsRequest = OpenApiAssetsRequest & ({
|
|
5
|
+
assetIds: string[];
|
|
6
|
+
externalIds?: string[];
|
|
7
|
+
} | {
|
|
8
|
+
assetIds?: string[];
|
|
9
|
+
externalIds: string[];
|
|
10
|
+
});
|
|
4
11
|
export type AssetsResponse = paths['/v1/data/assets']['post']['responses'][200]['content']['application/json']['data'];
|
|
5
12
|
/**
|
|
6
|
-
* Fetch assets by IDs and return requested fields.
|
|
13
|
+
* Fetch assets by internal and/or external IDs and return requested fields.
|
|
7
14
|
*
|
|
8
15
|
* @param config - Request configuration with base URL, timeout, fetch, and token
|
|
9
|
-
* @param options -
|
|
16
|
+
* @param options - assetFields and at least one of assetIds or externalIds
|
|
10
17
|
* @returns Promise that resolves with assets array
|
|
11
18
|
*/
|
|
12
19
|
export declare function assets(config: RequestConfig, options: AssetsRequest): Promise<AssetsResponse>;
|
|
20
|
+
export {};
|
|
13
21
|
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/data/assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/data/assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,KAAK,oBAAoB,GACvB,KAAK,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAEjF,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAC9C,CAAC;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC;AAEpG,MAAM,MAAM,cAAc,GACxB,KAAK,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5F;;;;;;GAMG;AACH,wBAAsB,MAAM,CAC1B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,cAAc,CAAC,CAYzB"}
|
package/dist/data/assets.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.assets = assets;
|
|
4
4
|
const request_js_1 = require("../request.js");
|
|
5
5
|
/**
|
|
6
|
-
* Fetch assets by IDs and return requested fields.
|
|
6
|
+
* Fetch assets by internal and/or external IDs and return requested fields.
|
|
7
7
|
*
|
|
8
8
|
* @param config - Request configuration with base URL, timeout, fetch, and token
|
|
9
|
-
* @param options -
|
|
9
|
+
* @param options - assetFields and at least one of assetIds or externalIds
|
|
10
10
|
* @returns Promise that resolves with assets array
|
|
11
11
|
*/
|
|
12
12
|
async function assets(config, options) {
|
package/dist/data/assets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/data/assets.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/data/assets.ts"],"names":[],"mappings":";;AAoBA,wBAeC;AAjCD,8CAA4C;AAW5C;;;;;;GAMG;AACI,KAAK,UAAU,MAAM,CAC1B,MAAqB,EACrB,OAAsB;IAEtB,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAiB,MAAM,EAAE;QACzD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/data/index.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { type AssetsRequest, type AssetsResponse } from './assets.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface DataMethods {
|
|
7
7
|
/**
|
|
8
|
-
* Fetch assets by IDs and return requested fields.
|
|
8
|
+
* Fetch assets by internal and/or external IDs and return requested fields.
|
|
9
9
|
*
|
|
10
|
-
* @param options -
|
|
10
|
+
* @param options - assetFields and at least one of assetIds or externalIds
|
|
11
11
|
* @returns Promise that resolves with assets array
|
|
12
12
|
*/
|
|
13
13
|
assets(options: AssetsRequest): Promise<AssetsResponse>;
|
|
@@ -799,7 +799,7 @@ export interface paths {
|
|
|
799
799
|
items: {
|
|
800
800
|
/** @description Optional configuration key name. Loads an existing synthesis config by this name; omit for default configuration. */
|
|
801
801
|
configurationKeyName?: string;
|
|
802
|
-
/** @description How many recent stored synthesis outputs to expose in the streamed `synthesisHistory`
|
|
802
|
+
/** @description How many recent stored synthesis outputs to expose in the streamed `synthesisHistory` / `synthesisHistoryEntries` fields. Defaults to 0 (no history emitted). When > 0, the final data event includes a `synthesisHistoryEntries` array of up to N `{ synthesisOutputId, data }` (most-recent first; each row's payload paired with its output id, so submissions can attach to a specific historical output), and — DEPRECATED, for retrocompatibility — an index-aligned `synthesisHistory` array of the same bare `data` payloads. The first entry is the current synthesis itself — the same payload `data` is derived from — and the remaining entries are older stored rows. */
|
|
803
803
|
synthesisHistoryLimit?: number;
|
|
804
804
|
/** @description Per-request overrides for search options. */
|
|
805
805
|
searchOptionsOverrides?: {
|
|
@@ -845,7 +845,7 @@ export interface paths {
|
|
|
845
845
|
* ```
|
|
846
846
|
* `data` is always a single synthesized object (keys match your output schema). `complete` is `false` for partial streaming updates and `true` for the final validated payload.
|
|
847
847
|
*
|
|
848
|
-
* When `synthesisHistoryLimit > 0`, the final event additionally includes `
|
|
848
|
+
* When `synthesisHistoryLimit > 0`, the final event additionally includes `synthesisHistoryEntries`: an array of up to N entries (most-recent first), each `{ synthesisOutputId, data }`, so a client can attach submissions (e.g. poll votes) to a specific historical output. The first entry is the current synthesis itself — the raw payload `data` is derived from (identical to `data` when reranking isn't configured; the unreranked source when it is) — and the remaining entries are older stored rows. A DEPRECATED `synthesisHistory` field (index-aligned bare `data` payloads) is also included for retrocompatibility. The primary `data` field stays a single object — when user reranking is configured, it is built by pooling items at the reranking field across the fetched rows and scoring against the user profile.
|
|
849
849
|
*
|
|
850
850
|
* **Data Events (error):**
|
|
851
851
|
* ```json
|
|
@@ -1053,8 +1053,10 @@ export interface paths {
|
|
|
1053
1053
|
get?: never;
|
|
1054
1054
|
put?: never;
|
|
1055
1055
|
/**
|
|
1056
|
-
* Synthesis - Get User Interactions
|
|
1057
|
-
* @description **
|
|
1056
|
+
* Synthesis - Get User Interactions (DEPRECATED)
|
|
1057
|
+
* @description **DEPRECATED** — use `GET /v1/user/submissions` (submission state), keyed by the poll's `synthesisOutputId`. Kept for retrocompatibility.
|
|
1058
|
+
*
|
|
1059
|
+
* **POST** `/v1/user/interactions`
|
|
1058
1060
|
*
|
|
1059
1061
|
* Batch-resolve interaction state for items from a synthesis output. Returns aggregates and whether the current user has already responded to each.
|
|
1060
1062
|
*/
|
|
@@ -1165,8 +1167,10 @@ export interface paths {
|
|
|
1165
1167
|
get?: never;
|
|
1166
1168
|
put?: never;
|
|
1167
1169
|
/**
|
|
1168
|
-
* Synthesis - Create User Interaction Response
|
|
1169
|
-
* @description **
|
|
1170
|
+
* Synthesis - Create User Interaction Response (DEPRECATED)
|
|
1171
|
+
* @description **DEPRECATED** — use `POST /v1/user/submissions` (submit), keyed by the poll's `synthesisOutputId`. Kept for retrocompatibility.
|
|
1172
|
+
*
|
|
1173
|
+
* **POST** `/v1/user/interactions/:interactionId/responses`
|
|
1170
1174
|
*
|
|
1171
1175
|
* Submit or update a response to an interaction. Returns updated aggregates.
|
|
1172
1176
|
*/
|
|
@@ -1501,13 +1505,14 @@ export interface paths {
|
|
|
1501
1505
|
put?: never;
|
|
1502
1506
|
/**
|
|
1503
1507
|
* Data - Get Assets
|
|
1504
|
-
* @description **POST** `/v1/data/assets` Fetches assets by IDs and returns requested fields.
|
|
1508
|
+
* @description **POST** `/v1/data/assets` Fetches assets by internal or external IDs and returns requested fields.
|
|
1505
1509
|
*
|
|
1506
1510
|
* #### Request body
|
|
1507
1511
|
*
|
|
1508
1512
|
* | Field | Type | Required | Description |
|
|
1509
1513
|
* |-------|------|----------|-------------|
|
|
1510
|
-
* | `assetIds` | string[] | yes | List of asset IDs to fetch |
|
|
1514
|
+
* | `assetIds` | string[] | yes, unless `externalIds` is provided | List of internal asset IDs to fetch |
|
|
1515
|
+
* | `externalIds` | string[] | yes, unless `assetIds` is provided | List of external IDs to fetch |
|
|
1511
1516
|
* | `assetFields` | string[] | yes | Fields to return (dot or bracket notation, e.g. tags[0], images[1].src). Allowed: assetId, title, tags, images, videos, publishedAt, externalId, externalData, sourceUrl, dataSource.name, and subfields. Empty array returns objects with only `assetId`. `externalData`'s subfields are unique to your source data. |
|
|
1512
1517
|
*/
|
|
1513
1518
|
post: {
|
|
@@ -1524,7 +1529,9 @@ export interface paths {
|
|
|
1524
1529
|
content: {
|
|
1525
1530
|
"application/json": {
|
|
1526
1531
|
/** @description List of asset IDs to fetch */
|
|
1527
|
-
assetIds
|
|
1532
|
+
assetIds?: string[];
|
|
1533
|
+
/** @description List of external IDs to fetch */
|
|
1534
|
+
externalIds?: string[];
|
|
1528
1535
|
/** @description Asset fields to return (dot or bracket notation). Allowed: assetId, title, tags, images, videos, publishedAt, externalId, externalData, assetType, sourceUrl, dataSource.name, and subfields. Empty array returns objects with only assetId. */
|
|
1529
1536
|
assetFields: string[];
|
|
1530
1537
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type { RecommendationsRequest, RecommendationsResponse } from './user/rec
|
|
|
17
17
|
export type { ReportRequest, ReportResponse } from './user/report.js';
|
|
18
18
|
export type { Signal, SignalRequest, SignalResponse } from './user/signal.js';
|
|
19
19
|
export type { CreateUserSubmissionRequest, CreateUserSubmissionResponse, ListUserSubmissionsRequest, ListUserSubmissionsResponse, PublicSubmission, SubmissionAggregate, SubmissionFeed, SubmissionFile, SubmissionState, SubmitRequest, SubmitResponse, } from './user/submissions.js';
|
|
20
|
-
export type { SynthesizeEvent, SynthesizeItemResponse, SynthesizeOptions, } from './user/synthesize.js';
|
|
20
|
+
export type { SynthesisHistoryEntry, SynthesizeEvent, SynthesizeItemResponse, SynthesizeOptions, } from './user/synthesize.js';
|
|
21
21
|
export type { SynthesizeOnStreamingData } from './user/synthesize-batch-manager.js';
|
|
22
22
|
export type { TokenRequest, TokenResponse } from './user/token.js';
|
|
23
23
|
export type { BitBitPressSynthesizeRequest, RecommendationsRequestBody, SynthesizeInput, SynthesizeItem, SynthesizeItems, SynthesizeOutputSchema, SynthesizeRequest, } from './user/typeDefs.js';
|
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,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,mBAAmB,wBAAwB,CAAC;AAC5C,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EACV,eAAe,EACf,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,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"}
|
|
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,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,mBAAmB,wBAAwB,CAAC;AAC5C,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EACV,eAAe,EACf,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,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"}
|
package/dist/user/index.d.ts
CHANGED
|
@@ -132,9 +132,9 @@ export interface UserMethods {
|
|
|
132
132
|
/**
|
|
133
133
|
* Synthesize content items personalized to the user (streaming SSE).
|
|
134
134
|
*
|
|
135
|
-
* @param items - Array of items: optional inputs (type: externalId | text | excludeExternalIds, value), output (schema), optional configurationKeyName, optional
|
|
135
|
+
* @param items - Array of items: optional inputs (type: externalId | text | excludeExternalIds, value), output (schema), optional configurationKeyName, optional synthesisHistoryLimit, optional searchOptionsOverrides (e.g. lookbackMinutes)
|
|
136
136
|
* @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
|
|
137
|
-
* @returns AsyncIterable yielding connection events (connected, complete) and data events (index, data?, complete, error?)
|
|
137
|
+
* @returns AsyncIterable yielding connection events (connected, complete) and data events (index, data?, synthesisOutputId?, synthesisHistoryEntries?, complete, error?)
|
|
138
138
|
*/
|
|
139
139
|
synthesize(items: SynthesizeItems, options?: {
|
|
140
140
|
onStreamingData?: (index: number, data: unknown) => void;
|
|
@@ -149,7 +149,7 @@ export interface UserMethods {
|
|
|
149
149
|
synthesizeItem(item: SynthesizeItem, onStreamingData?: SynthesizeOnStreamingData): Promise<SynthesizeItemResponse>;
|
|
150
150
|
/**
|
|
151
151
|
* @deprecated Use `submissionState` keyed by the poll's `synthesisOutputId`.
|
|
152
|
-
* Kept for
|
|
152
|
+
* Kept for retrocompatibility.
|
|
153
153
|
*
|
|
154
154
|
* Batch-resolve interaction state for items from a synthesis output.
|
|
155
155
|
* Returns aggregates and whether the current user has already responded to each.
|
|
@@ -160,7 +160,7 @@ export interface UserMethods {
|
|
|
160
160
|
interactions(options: InteractionsRequest): Promise<NonNullable<InteractionsResponse>>;
|
|
161
161
|
/**
|
|
162
162
|
* @deprecated Use `submit` keyed by the poll's `synthesisOutputId`. Kept for
|
|
163
|
-
*
|
|
163
|
+
* retrocompatibility.
|
|
164
164
|
*
|
|
165
165
|
* Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
166
166
|
*
|
|
@@ -8,8 +8,7 @@ export type InteractionResponseResponse = paths['/v1/user/interactions/{interact
|
|
|
8
8
|
export type InteractionItem = InteractionsResponse[number];
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated Use the submission methods (`submissionState`) keyed by the
|
|
11
|
-
* poll's `synthesisOutputId`. Kept for
|
|
12
|
-
* `/v1/user/interactions` endpoint is.
|
|
11
|
+
* poll's `synthesisOutputId`. Kept for retrocompatibility.
|
|
13
12
|
*
|
|
14
13
|
* Batch-resolve interaction state for items from a synthesis output.
|
|
15
14
|
* Returns aggregates and whether the current user has already responded to each.
|
|
@@ -20,8 +19,7 @@ export type InteractionItem = InteractionsResponse[number];
|
|
|
20
19
|
*/
|
|
21
20
|
export declare function getInteractions(config: RequestConfig, options: InteractionsRequest): Promise<NonNullable<InteractionsResponse>>;
|
|
22
21
|
/**
|
|
23
|
-
* @deprecated Use `submit` keyed by the poll's `synthesisOutputId`. Kept for
|
|
24
|
-
* older app builds; removed once the `/v1/user/interactions` endpoint is.
|
|
22
|
+
* @deprecated Use `submit` keyed by the poll's `synthesisOutputId`. Kept for retrocompatibility.
|
|
25
23
|
*
|
|
26
24
|
* Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
27
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../src/user/interaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,MAAM,mBAAmB,GAC7B,KAAK,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAC9B,KAAK,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElG,MAAM,MAAM,0BAA0B,GACpC,KAAK,CAAC,iDAAiD,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACjH,MAAM,MAAM,2BAA2B,GACrC,KAAK,CAAC,iDAAiD,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5H,sFAAsF;AACtF,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../src/user/interaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,MAAM,mBAAmB,GAC7B,KAAK,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAC9B,KAAK,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElG,MAAM,MAAM,0BAA0B,GACpC,KAAK,CAAC,iDAAiD,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACjH,MAAM,MAAM,2BAA2B,GACrC,KAAK,CAAC,iDAAiD,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5H,sFAAsF;AACtF,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAY5C;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAYnD"}
|
package/dist/user/interaction.js
CHANGED
|
@@ -5,8 +5,7 @@ exports.respondToInteraction = respondToInteraction;
|
|
|
5
5
|
const request_js_1 = require("../request.js");
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use the submission methods (`submissionState`) keyed by the
|
|
8
|
-
* poll's `synthesisOutputId`. Kept for
|
|
9
|
-
* `/v1/user/interactions` endpoint is.
|
|
8
|
+
* poll's `synthesisOutputId`. Kept for retrocompatibility.
|
|
10
9
|
*
|
|
11
10
|
* Batch-resolve interaction state for items from a synthesis output.
|
|
12
11
|
* Returns aggregates and whether the current user has already responded to each.
|
|
@@ -27,8 +26,7 @@ async function getInteractions(config, options) {
|
|
|
27
26
|
return response;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
|
-
* @deprecated Use `submit` keyed by the poll's `synthesisOutputId`. Kept for
|
|
31
|
-
* older app builds; removed once the `/v1/user/interactions` endpoint is.
|
|
29
|
+
* @deprecated Use `submit` keyed by the poll's `synthesisOutputId`. Kept for retrocompatibility.
|
|
32
30
|
*
|
|
33
31
|
* Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
34
32
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/user/interaction.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/user/interaction.ts"],"names":[],"mappings":";;AA4BA,0CAeC;AAYD,oDAgBC;AArED,8CAA4C;AAe5C;;;;;;;;;;GAUG;AACI,KAAK,UAAU,eAAe,CACnC,MAAqB,EACrB,OAA4B;IAE5B,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAuB,MAAM,EAAE;QAC/D,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAqB,EACrB,aAAqB,EACrB,OAAmC;IAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAA8B,MAAM,EAAE;QACtE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,yBAAyB,aAAa,YAAY;QACxD,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { RequestConfig } from '../request.js';
|
|
2
2
|
import type { SynthesizeItems } from './typeDefs.js';
|
|
3
|
+
export type SynthesisHistoryEntry = {
|
|
4
|
+
synthesisOutputId: string;
|
|
5
|
+
data: unknown;
|
|
6
|
+
};
|
|
3
7
|
export type SynthesizeItemResponse = {
|
|
4
8
|
data?: unknown;
|
|
5
9
|
/**
|
|
@@ -13,7 +17,7 @@ export type SynthesizeItemResponse = {
|
|
|
13
17
|
* ordered most-recent first. The first entry is the current synthesis itself
|
|
14
18
|
* (identical to `data` unless user reranking is configured server-side).
|
|
15
19
|
*
|
|
16
|
-
* @deprecated Legacy bare-payload form, kept for
|
|
20
|
+
* @deprecated Legacy bare-payload form, kept for retrocompatibility. Prefer
|
|
17
21
|
* `synthesisHistoryEntries`, which also carries each entry's
|
|
18
22
|
* `synthesisOutputId`.
|
|
19
23
|
*/
|
|
@@ -24,22 +28,18 @@ export type SynthesizeItemResponse = {
|
|
|
24
28
|
* it to the submission methods to attach a vote/entry to that specific
|
|
25
29
|
* historical output).
|
|
26
30
|
*/
|
|
27
|
-
synthesisHistoryEntries?:
|
|
28
|
-
synthesisOutputId?: string;
|
|
29
|
-
data: unknown;
|
|
30
|
-
}[];
|
|
31
|
+
synthesisHistoryEntries?: SynthesisHistoryEntry[];
|
|
31
32
|
error?: string;
|
|
32
33
|
};
|
|
33
34
|
/**
|
|
34
35
|
* Synthesize stream event types (SSE). Per OpenAPI spec:
|
|
35
36
|
* - Connection: `{ type: 'connected' | 'complete' }`
|
|
36
|
-
* - Data: `{ index, data?, synthesisHistory?, complete, error? }`.
|
|
37
|
+
* - Data: `{ index, data?, synthesisOutputId?, synthesisHistoryEntries?, synthesisHistory?, complete, error? }`.
|
|
37
38
|
* Multiple events may be sent for the same index as partial object updates; the final event
|
|
38
39
|
* for that index has `complete: true` and contains the validated object. When the request
|
|
39
|
-
* set `synthesisHistoryLimit > 0`, the final event
|
|
40
|
-
* array of recent stored `
|
|
41
|
-
*
|
|
42
|
-
* it is the unreranked source).
|
|
40
|
+
* set `synthesisHistoryLimit > 0`, the final event includes `synthesisHistoryEntries`: an
|
|
41
|
+
* array of recent stored outputs paired with their `synthesisOutputId` (most-recent first).
|
|
42
|
+
* A deprecated `synthesisHistory` array of bare data payloads may also be present for retrocompatibility.
|
|
43
43
|
*/
|
|
44
44
|
export type SynthesizeEvent = {
|
|
45
45
|
type: 'connected';
|
|
@@ -51,10 +51,7 @@ export type SynthesizeEvent = {
|
|
|
51
51
|
synthesisOutputId?: string;
|
|
52
52
|
/** @deprecated Legacy bare-payload form; prefer `synthesisHistoryEntries`. */
|
|
53
53
|
synthesisHistory?: unknown[];
|
|
54
|
-
synthesisHistoryEntries?:
|
|
55
|
-
synthesisOutputId?: string;
|
|
56
|
-
data: unknown;
|
|
57
|
-
}[];
|
|
54
|
+
synthesisHistoryEntries?: SynthesisHistoryEntry[];
|
|
58
55
|
complete: boolean;
|
|
59
56
|
error?: string;
|
|
60
57
|
};
|
|
@@ -67,7 +64,7 @@ export interface SynthesizeOptions {
|
|
|
67
64
|
* Synthesize content items personalized to the user (streaming SSE).
|
|
68
65
|
*
|
|
69
66
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
70
|
-
* @param items - Array of items: each has optional inputs (`type`: externalId | text | excludeExternalIds, `value`), output (schema as JSON string or Zod 4 schema), optional configurationKeyName, optional synthesisHistoryLimit (how many recent stored outputs to expose in the final event's `
|
|
67
|
+
* @param items - Array of items: each has optional inputs (`type`: externalId | text | excludeExternalIds, `value`), output (schema as JSON string or Zod 4 schema), optional configurationKeyName, optional synthesisHistoryLimit (how many recent stored outputs to expose in the final event's `synthesisHistoryEntries` array; defaults to 0 — no history emitted), optional searchOptionsOverrides (e.g. lookbackMinutes)
|
|
71
68
|
* @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
|
|
72
69
|
* @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.
|
|
73
70
|
*/
|
|
@@ -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;AAExE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE
|
|
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;AAExE,MAAM,MAAM,qBAAqB,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEjF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;GASG;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,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC7B,uBAAuB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA+BN,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
|
@@ -34,7 +34,7 @@ function normalizeSynthesizeItems(items) {
|
|
|
34
34
|
* Synthesize content items personalized to the user (streaming SSE).
|
|
35
35
|
*
|
|
36
36
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
37
|
-
* @param items - Array of items: each has optional inputs (`type`: externalId | text | excludeExternalIds, `value`), output (schema as JSON string or Zod 4 schema), optional configurationKeyName, optional synthesisHistoryLimit (how many recent stored outputs to expose in the final event's `
|
|
37
|
+
* @param items - Array of items: each has optional inputs (`type`: externalId | text | excludeExternalIds, `value`), output (schema as JSON string or Zod 4 schema), optional configurationKeyName, optional synthesisHistoryLimit (how many recent stored outputs to expose in the final event's `synthesisHistoryEntries` array; defaults to 0 — no history emitted), optional searchOptionsOverrides (e.g. lookbackMinutes)
|
|
38
38
|
* @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
|
|
39
39
|
* @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.
|
|
40
40
|
*/
|
|
@@ -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":";;AAsGA,gCA0BC;AAhID,6BAAmC;AAEnC,8CAA4C;AAyD5C,gDAAgD;AAChD,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,CAAC;AACxE,CAAC;AAED;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,KAAsB;IACtD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAsC,EAAE;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;QACnC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAA,kBAAY,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACzF,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"}
|