@bitbitpress/client 0.1.12 → 0.1.13

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 CHANGED
@@ -447,7 +447,7 @@ client.user.synthesizeItem(
447
447
 
448
448
  ##### Parameters
449
449
 
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`
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`, optional `searchOptionsOverrides` (e.g. `{ lookbackMinutes: 1440 }` for 24-hour lookback)
451
451
  - `onStreamingData` (optional): Callback invoked with streaming data whenever a stream event has `complete: false` for this item. Type: `(data: unknown) => void`.
452
452
 
453
453
  ##### Returns
@@ -506,10 +506,11 @@ client.user.synthesize(
506
506
 
507
507
  - `items` (required): Array of items. Each item has:
508
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)
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"`)
509
+ - `output`: `{ schema: string | ZodType, staleAfter?: string }` — output schema as a JSON string or Zod 4 schema (top-level type must be `"object"`; supports object, string, number, boolean, array, and enum); optional staleness (e.g. `"1h"`, `"30m"`, `"1d"`)
510
510
  - `configurationKeyName` (optional): Key name for configuration
511
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
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`.
513
+ - `searchOptionsOverrides` (optional): Per-request overrides, e.g. `{ lookbackMinutes: 1440 }` for 24-hour lookback.
513
514
  - `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
514
515
 
515
516
  ##### Returns
@@ -706,7 +707,7 @@ type SignalResponse = {
706
707
 
707
708
  #### SynthesizeRequest
708
709
 
709
- Request body for POST `/v1/user/synthesize` (from OpenAPI). Each item has `inputs`, `output`, optional `configurationKeyName`, optional `sourceAssetFields`, and optional `sourceBitFields`.
710
+ Request body for POST `/v1/user/synthesize` (from OpenAPI). Each item has `inputs`, `output`, optional `configurationKeyName`, optional `sourceAssetFields`, optional `sourceBitFields`, and optional `searchOptionsOverrides`.
710
711
 
711
712
  ```typescript
712
713
  type SynthesizeRequest = {
@@ -714,9 +715,10 @@ type SynthesizeRequest = {
714
715
  configurationKeyName?: string;
715
716
  sourceAssetFields?: string[];
716
717
  sourceBitFields?: string[];
718
+ searchOptionsOverrides?: { lookbackMinutes?: number };
717
719
  inputs?: Array<{ type: 'externalId' | 'text' | 'excludeExternalIds'; value: string }>;
718
720
  output: {
719
- schema: string; // JSON schema string; top-level type must be "object"
721
+ schema: string; // JSON schema string; top-level type must be "object"; supports object, string, number, boolean, array, enum
720
722
  staleAfter?: string;
721
723
  };
722
724
  }>;
@@ -679,6 +679,11 @@ export interface paths {
679
679
  sourceBitFields?: string[];
680
680
  /** @description Optional configuration key name. Loads an existing synthesis config by this name; omit for default configuration. */
681
681
  configurationKeyName?: string;
682
+ /** @description Per-request overrides for search options. */
683
+ searchOptionsOverrides?: {
684
+ /** @description Override for search lookback window in minutes (e.g. 1440 for last 24 hours). */
685
+ lookbackMinutes?: number;
686
+ };
682
687
  /** @description Inputs used as context for the synthesis: externalId (article ID), or text (freeform text). */
683
688
  inputs?: {
684
689
  /**
@@ -691,7 +696,7 @@ export interface paths {
691
696
  }[];
692
697
  /** @description Output definition: schema and optional staleness. */
693
698
  output: {
694
- /** @description Output schema as a JSON string. Top-level type must be "object". Example: {"type":"object","properties":{"title":{"type":"string","description":"title"}}} */
699
+ /** @description Output schema as a JSON string. Top-level type must be "object". Supports object, string, number, boolean, array, and enum. Example: {"type":"object","properties":{"title":{"type":"string","description":"title"},"status":{"type":"string","enum":["draft","published"]}}} */
695
700
  schema: string;
696
701
  /** @description Time after which the result is considered stale and will be regenerated again. Examples: "1h", "30m", "1d", "3600" (seconds). */
697
702
  staleAfter?: string;
@@ -69,7 +69,7 @@ export interface UserMethods {
69
69
  /**
70
70
  * Synthesize content items personalized to the user (streaming SSE).
71
71
  *
72
- * @param items - Array of items: optional inputs (type: externalId | text | excludeExternalIds, value), output (schema, optional staleAfter), optional configurationKeyName
72
+ * @param items - Array of items: optional inputs (type: externalId | text | excludeExternalIds, value), output (schema, optional staleAfter), optional configurationKeyName, optional searchOptionsOverrides (e.g. lookbackMinutes)
73
73
  * @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
74
74
  * @returns AsyncIterable yielding connection events (connected, complete) and data events (index, data?, complete, error?)
75
75
  */
@@ -38,7 +38,7 @@ export interface SynthesizeOptions {
38
38
  * Synthesize content items personalized to the user (streaming SSE).
39
39
  *
40
40
  * @param config - Request configuration with base URL, timeout, fetch, and optional token
41
- * @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
41
+ * @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, optional searchOptionsOverrides (e.g. lookbackMinutes)
42
42
  * @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
43
43
  * @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.
44
44
  */
@@ -27,7 +27,7 @@ function normalizeSynthesizeItems(items) {
27
27
  * Synthesize content items personalized to the user (streaming SSE).
28
28
  *
29
29
  * @param config - Request configuration with base URL, timeout, fetch, and optional token
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
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, optional searchOptionsOverrides (e.g. lookbackMinutes)
31
31
  * @param options - Optional: onStreamingData(index, data) called for each streaming data update per item index
32
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.
33
33
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitbitpress/client",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "BitBitPress TypeScript client library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",