@madewithremy/admin 0.1.31 → 0.1.33

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/dist/index.d.ts CHANGED
@@ -1177,12 +1177,11 @@ interface DataLiftFromLiveResult {
1177
1177
 
1178
1178
  interface LiftFromDevParams {
1179
1179
  /**
1180
- * Which dev session to lift from, by dev release id. An app has a dev session per workspace — one
1181
- * per person's box, one per person's CLI — so this is required once more than one is open. The
1182
- * server refuses rather than picking: promoting the wrong workspace's data over live is not
1183
- * recoverable, and nothing in the request would show it had happened.
1184
- *
1185
- * The ids are on the dashboard's `devSessions`, and the `ambiguous_dev_session` error lists them.
1180
+ * Which of YOUR dev sessions to lift from, by dev release id. An app has a dev session per
1181
+ * workspace (one per person's box, one per person's CLI), and a lift only ever touches the
1182
+ * caller's own: without this it takes your newest, and a colleague's id is refused
1183
+ * (`not_your_dev_session`). Name it when you have more than one open. The ids are on the
1184
+ * dashboard's `devSessions`.
1186
1185
  */
1187
1186
  releaseId?: string;
1188
1187
  }
@@ -1197,12 +1196,11 @@ interface LiftFromDevParams {
1197
1196
  *
1198
1197
  * @throws AdminApiError `no_dev_session` (404) — no dev release exists (start a dev session first);
1199
1198
  * `no_live_release` (404) — app has never been published (publish first, then lift);
1200
- * `ambiguous_dev_session` (400) — the app has several dev sessions open, so `releaseId` is
1201
- * required; the error message lists the open ones.
1199
+ * `not_your_dev_session` (403) — `releaseId` names someone else's dev session.
1202
1200
  * @example
1203
1201
  * const result = await admin.data.liftFromDev();
1204
1202
  * console.log(`Lifted ${result.databasesAffected.length} databases to live`);
1205
- * // With more than one dev session open, name the one you mean:
1203
+ * // With more than one of your dev sessions open, name the one you mean:
1206
1204
  * await admin.data.liftFromDev({ releaseId: '8f2c1e04-...' });
1207
1205
  */
1208
1206
  declare function liftFromDev(ctx: AdminContext, params?: LiftFromDevParams): Promise<DataLiftFromDevResult>;
@@ -1213,8 +1211,8 @@ interface LiftFromLiveParams {
1213
1211
  */
1214
1212
  truncate?: boolean;
1215
1213
  /**
1216
- * Which dev session to overwrite, by dev release id. Required once the app has more than one
1217
- * open — see `LiftFromDevParams.releaseId`.
1214
+ * Which of your dev sessions to overwrite, by dev release id; your newest when absent. See
1215
+ * `LiftFromDevParams.releaseId`.
1218
1216
  */
1219
1217
  releaseId?: string;
1220
1218
  }
@@ -1230,7 +1228,7 @@ interface LiftFromLiveParams {
1230
1228
  *
1231
1229
  * @throws AdminApiError `no_dev_session` (404) — no dev release exists (start a dev session first);
1232
1230
  * `no_live_release` (404) — no live release (copy mode only; not thrown when `truncate` is true);
1233
- * `ambiguous_dev_session` (400) — several dev sessions are open, so `releaseId` is required.
1231
+ * `not_your_dev_session` (403) — `releaseId` names someone else's dev session.
1234
1232
  * @example
1235
1233
  * // Pull live data into dev for debugging:
1236
1234
  * await admin.data.liftFromLive();
@@ -1328,6 +1326,13 @@ type DataSourceJobSource = {
1328
1326
  unread: boolean;
1329
1327
  /** Only documents matching this metadata filter. */
1330
1328
  filter: Record<string, unknown> | null;
1329
+ } | {
1330
+ /**
1331
+ * The rest of one file a `datasources add` (or an app's `add()`) took
1332
+ * that maps to more than a thousand documents; `ref` is its filename.
1333
+ */
1334
+ type: 'object';
1335
+ ref: string;
1331
1336
  };
1332
1337
  /**
1333
1338
  * planning → planned → running ⇄ paused → done | failed | cancelled.
@@ -1943,7 +1948,24 @@ interface DataSourceMapTestDocument {
1943
1948
  }
1944
1949
  type DataSourceMapTestOutcome = {
1945
1950
  kind: 'documents';
1951
+ /** The first twenty of them. */
1946
1952
  documents: DataSourceMapTestDocument[];
1953
+ /** Every valid document the object produced. */
1954
+ count: number;
1955
+ /**
1956
+ * Its documents that failed validation, by their index in the mapper's
1957
+ * output: a job leaves them out and quarantines the object for them.
1958
+ * Null when every one passed.
1959
+ */
1960
+ invalid: {
1961
+ count: number;
1962
+ examples: {
1963
+ document: number;
1964
+ reason: string;
1965
+ }[];
1966
+ } | null;
1967
+ /** Parts of the frame's documents that storage did not have. */
1968
+ missingParts?: number;
1947
1969
  } | {
1948
1970
  kind: 'passthrough';
1949
1971
  metadata: Record<string, string | number | boolean> | null;
@@ -2313,8 +2335,10 @@ interface DataSourcesDocumentsResult {
2313
2335
  type DataSourcesUploadTokenResult = {
2314
2336
  alreadyCurrent: true;
2315
2337
  document: DataSourcesDocument;
2316
- /** Mapped sources: every document this mapper version produced from the bytes. */
2338
+ /** Mapped sources: what this mapper version produced from the bytes, the first thousand at most. */
2317
2339
  documents?: DataSourcesDocument[];
2340
+ /** Mapped sources: how many it produced in all. */
2341
+ documentCount?: number;
2318
2342
  } | {
2319
2343
  alreadyCurrent: false;
2320
2344
  contentType: string;
@@ -2328,16 +2352,30 @@ type DataSourcesUploadTokenResult = {
2328
2352
  * POST /datasources/documents — confirm an uploaded object and queue its
2329
2353
  * builds. On a mapped source the object is a raw copy and the mapper decides
2330
2354
  * what it becomes: `documents` holds everything produced, `document` the first
2331
- * of them (null only for a `deletes` outcome).
2355
+ * of them (null only for a `deletes` outcome). An object that maps to more
2356
+ * than a thousand documents returns the first thousand and `job`, which
2357
+ * registers and builds the rest.
2332
2358
  */
2333
2359
  interface DataSourcesDocumentConfirmResult {
2334
2360
  document: DataSourcesDocument | null;
2335
2361
  documents: DataSourcesDocument[];
2362
+ /** Every document the object maps to; `documents.length` unless `job` is set. */
2363
+ documentCount: number;
2336
2364
  /** Whether any document was queued for a build. */
2337
2365
  queued: boolean;
2338
2366
  outcome: 'unmapped' | 'documents' | 'passthrough' | 'deletes';
2339
2367
  /** Documents removed or superseded as a result. */
2340
2368
  removed: number;
2369
+ /** Documents that failed validation and were not registered; null when none did. */
2370
+ invalid: {
2371
+ count: number;
2372
+ examples: {
2373
+ document: number;
2374
+ reason: string;
2375
+ }[];
2376
+ } | null;
2377
+ /** The job taking the rest of an object larger than a thousand documents. */
2378
+ job: DataSourceJob | null;
2341
2379
  }
2342
2380
  /** Build progress counts used in several list and status shapes. */
2343
2381
  interface DataSourcesBuildProgress {
@@ -2399,9 +2437,14 @@ interface DataSourcesDictionaryReport {
2399
2437
  names: number;
2400
2438
  /** Names more than one id claims: each tags every claimant. */
2401
2439
  ambiguousNames: number;
2402
- /** The names (as matched: folded, separators dropped) the most ids claim. */
2440
+ /**
2441
+ * The names the most ids claim: `name` as you pushed it (one of them, when
2442
+ * several fold alike), `key` as the linker matches it (folded, separators
2443
+ * dropped), and how many ids claim it.
2444
+ */
2403
2445
  mostClaimed: {
2404
2446
  key: string;
2447
+ name?: string;
2405
2448
  ids: number;
2406
2449
  }[];
2407
2450
  /** Names that can't match their own text as written, with a few of them. */
@@ -2569,6 +2612,20 @@ interface DataSourcesEntitiesResult {
2569
2612
  pipelineVersion: number;
2570
2613
  latencyMs: number;
2571
2614
  }
2615
+ /** One passage of a listing: a search hit without the ranking. */
2616
+ interface DataSourcesPassage {
2617
+ text: string;
2618
+ entities: string[];
2619
+ citation: DataSourcesSearchCitation;
2620
+ }
2621
+ /** POST /datasources/passages — a page of every passage matching a filter. */
2622
+ interface DataSourcesPassagesResult {
2623
+ passages: DataSourcesPassage[];
2624
+ /** Pass back as `cursor` for the next page; null after the last. */
2625
+ nextCursor: string | null;
2626
+ pipelineVersion: number;
2627
+ latencyMs: number;
2628
+ }
2572
2629
  /**
2573
2630
  * POST /datasources/search.
2574
2631
  *
@@ -2753,6 +2810,11 @@ interface AddDocumentParams {
2753
2810
  * no whitespace or commas). Every passage carries them; `[]` clears them.
2754
2811
  */
2755
2812
  entities?: string[];
2813
+ /**
2814
+ * The budget in dollars of the job that takes the rest of a file mapping
2815
+ * to more than a thousand documents (`AddDocumentResult.job`).
2816
+ */
2817
+ budgetDollars?: number;
2756
2818
  /**
2757
2819
  * Receives the exact progress strings the CLI prints today:
2758
2820
  * - `${filename}: unchanged, skipped`
@@ -2769,10 +2831,28 @@ interface AddDocumentResult {
2769
2831
  * source's mapper answered `deletes` for the file.
2770
2832
  */
2771
2833
  document: DataSourcesDocument | null;
2772
- /** Every document the file became — one on an unmapped source. */
2834
+ /**
2835
+ * Every document the file became — one on an unmapped source — or the
2836
+ * first thousand of a file that maps to more.
2837
+ */
2773
2838
  documents: DataSourcesDocument[];
2839
+ /** How many documents the file maps to in all. */
2840
+ documentCount: number;
2774
2841
  /** How the source took the file; absent when it was already current. */
2775
2842
  outcome?: 'unmapped' | 'documents' | 'passthrough' | 'deletes';
2843
+ /** Documents the mapper produced that failed validation and were not registered. */
2844
+ invalid?: {
2845
+ count: number;
2846
+ examples: {
2847
+ document: number;
2848
+ reason: string;
2849
+ }[];
2850
+ } | null;
2851
+ /**
2852
+ * The job registering and building the rest of a file that maps to more
2853
+ * than a thousand documents; it plans and starts on its own.
2854
+ */
2855
+ job?: DataSourceJob | null;
2776
2856
  }
2777
2857
  /**
2778
2858
  * Add one document to a data source.
@@ -2974,7 +3054,7 @@ interface EntitiesParams {
2974
3054
  slug: string;
2975
3055
  /** Same grammar as search's filter; absent covers the whole corpus. */
2976
3056
  filter?: Record<string, unknown>;
2977
- /** Entities to return, most first (default 20, at most 100). */
3057
+ /** Entities to return, most first (default 20, at most 1,000). */
2978
3058
  limit?: number;
2979
3059
  /** Read the candidate version instead of the live one. */
2980
3060
  candidate?: boolean;
@@ -2993,6 +3073,29 @@ interface EntitiesParams {
2993
3073
  * const { entities } = await admin.dataSources.entities({ slug: 'manuals', filter: { entities: ['P-101A'] } });
2994
3074
  */
2995
3075
  declare function entities(ctx: AdminContext, params: EntitiesParams): Promise<DataSourcesEntitiesResult>;
3076
+ interface PassagesParams {
3077
+ /** Data source slug. */
3078
+ slug: string;
3079
+ /** Same grammar as search's filter; absent lists the whole corpus. */
3080
+ filter?: Record<string, unknown>;
3081
+ /** The previous page's `nextCursor`. */
3082
+ cursor?: string;
3083
+ /** Passages per page (default 50, at most 200). */
3084
+ limit?: number;
3085
+ /** Read the candidate version instead of the live one. */
3086
+ candidate?: boolean;
3087
+ }
3088
+ /**
3089
+ * One page of every passage matching a filter, unranked: all the pages that
3090
+ * mention an entity, rather than search's best few. Passages come document by
3091
+ * document, each document's in order.
3092
+ *
3093
+ * @throws AdminApiError `invalid_filter` (400); `invalid_cursor` (400);
3094
+ * `no_candidate_pipeline` (404); `index_warming` / `index_building` (503).
3095
+ * @example
3096
+ * const { passages, nextCursor } = await admin.dataSources.passages({ slug: 'manuals', filter: { entities: ['P-1004A'] } });
3097
+ */
3098
+ declare function passages(ctx: AdminContext, params: PassagesParams): Promise<DataSourcesPassagesResult>;
2996
3099
  /**
2997
3100
  * Read the full pipeline configuration for one data source.
2998
3101
  *
@@ -3326,6 +3429,7 @@ type dataSources_DropParams = DropParams;
3326
3429
  type dataSources_EntitiesParams = EntitiesParams;
3327
3430
  declare const dataSources_FAILURES_PAGE: typeof FAILURES_PAGE;
3328
3431
  type dataSources_MoveParams = MoveParams;
3432
+ type dataSources_PassagesParams = PassagesParams;
3329
3433
  type dataSources_PromoteParams = PromoteParams;
3330
3434
  type dataSources_RevectorizeParams = RevectorizeParams;
3331
3435
  type dataSources_RmParams = RmParams;
@@ -3350,6 +3454,7 @@ declare const dataSources_drop: typeof drop;
3350
3454
  declare const dataSources_entities: typeof entities;
3351
3455
  declare const dataSources_link: typeof link;
3352
3456
  declare const dataSources_move: typeof move;
3457
+ declare const dataSources_passages: typeof passages;
3353
3458
  declare const dataSources_promote: typeof promote;
3354
3459
  declare const dataSources_pushDictionary: typeof pushDictionary;
3355
3460
  declare const dataSources_revectorize: typeof revectorize;
@@ -3363,7 +3468,7 @@ declare const dataSources_waitForCandidate: typeof waitForCandidate;
3363
3468
  declare const dataSources_waitForIngest: typeof waitForIngest;
3364
3469
  declare const dataSources_waitForMove: typeof waitForMove;
3365
3470
  declare namespace dataSources {
3366
- export { type dataSources_AddDocumentParams as AddDocumentParams, type dataSources_AddDocumentResult as AddDocumentResult, type dataSources_ConfigSetParams as ConfigSetParams, type dataSources_CountParams as CountParams, type dataSources_CreateParams as CreateParams, DEFAULT_WAIT_TIMEOUT_MS$3 as DEFAULT_WAIT_TIMEOUT_MS, dataSources_DOCUMENTS_IDS_MAX as DOCUMENTS_IDS_MAX, type dataSources_DictionaryEntryInput as DictionaryEntryInput, type dataSources_DocumentsParams as DocumentsParams, type dataSources_DropParams as DropParams, type dataSources_EntitiesParams as EntitiesParams, dataSources_FAILURES_PAGE as FAILURES_PAGE, type dataSources_MoveParams as MoveParams, type dataSources_PromoteParams as PromoteParams, type dataSources_RevectorizeParams as RevectorizeParams, type dataSources_RmParams as RmParams, type dataSources_RmWhereParams as RmWhereParams, type dataSources_SearchParams as SearchParams, type dataSources_SummarizedDocument as SummarizedDocument, type dataSources_WaitForCandidateParams as WaitForCandidateParams, type dataSources_WaitForCandidateResult as WaitForCandidateResult, type dataSources_WaitForIngestParams as WaitForIngestParams, type dataSources_WaitForIngestResult as WaitForIngestResult, type dataSources_WaitForMoveParams as WaitForMoveParams, type dataSources_WaitForMoveResult as WaitForMoveResult, dataSources_addDocument as addDocument, dataSources_allDocuments as allDocuments, dataSources_configGet as configGet, dataSources_configSet as configSet, dataSources_count as count, create$1 as create, dataSources_deleteSource as deleteSource, dataSources_dictionary as dictionary, dataSources_documents as documents, dataSources_drop as drop, dataSources_entities as entities, dataSources_link as link, list$8 as list, dataSources_move as move, dataSources_promote as promote, dataSources_pushDictionary as pushDictionary, dataSources_revectorize as revectorize, dataSources_rm as rm, dataSources_rmWhere as rmWhere, dataSources_rmWhereAll as rmWhereAll, dataSources_search as search, dataSources_stopMove as stopMove, dataSources_summarize as summarize, dataSources_waitForCandidate as waitForCandidate, dataSources_waitForIngest as waitForIngest, dataSources_waitForMove as waitForMove };
3471
+ export { type dataSources_AddDocumentParams as AddDocumentParams, type dataSources_AddDocumentResult as AddDocumentResult, type dataSources_ConfigSetParams as ConfigSetParams, type dataSources_CountParams as CountParams, type dataSources_CreateParams as CreateParams, DEFAULT_WAIT_TIMEOUT_MS$3 as DEFAULT_WAIT_TIMEOUT_MS, dataSources_DOCUMENTS_IDS_MAX as DOCUMENTS_IDS_MAX, type dataSources_DictionaryEntryInput as DictionaryEntryInput, type dataSources_DocumentsParams as DocumentsParams, type dataSources_DropParams as DropParams, type dataSources_EntitiesParams as EntitiesParams, dataSources_FAILURES_PAGE as FAILURES_PAGE, type dataSources_MoveParams as MoveParams, type dataSources_PassagesParams as PassagesParams, type dataSources_PromoteParams as PromoteParams, type dataSources_RevectorizeParams as RevectorizeParams, type dataSources_RmParams as RmParams, type dataSources_RmWhereParams as RmWhereParams, type dataSources_SearchParams as SearchParams, type dataSources_SummarizedDocument as SummarizedDocument, type dataSources_WaitForCandidateParams as WaitForCandidateParams, type dataSources_WaitForCandidateResult as WaitForCandidateResult, type dataSources_WaitForIngestParams as WaitForIngestParams, type dataSources_WaitForIngestResult as WaitForIngestResult, type dataSources_WaitForMoveParams as WaitForMoveParams, type dataSources_WaitForMoveResult as WaitForMoveResult, dataSources_addDocument as addDocument, dataSources_allDocuments as allDocuments, dataSources_configGet as configGet, dataSources_configSet as configSet, dataSources_count as count, create$1 as create, dataSources_deleteSource as deleteSource, dataSources_dictionary as dictionary, dataSources_documents as documents, dataSources_drop as drop, dataSources_entities as entities, dataSources_link as link, list$8 as list, dataSources_move as move, dataSources_passages as passages, dataSources_promote as promote, dataSources_pushDictionary as pushDictionary, dataSources_revectorize as revectorize, dataSources_rm as rm, dataSources_rmWhere as rmWhere, dataSources_rmWhereAll as rmWhereAll, dataSources_search as search, dataSources_stopMove as stopMove, dataSources_summarize as summarize, dataSources_waitForCandidate as waitForCandidate, dataSources_waitForIngest as waitForIngest, dataSources_waitForMove as waitForMove };
3367
3472
  }
3368
3473
 
3369
3474
  /**
@@ -3892,6 +3997,11 @@ interface MapTestParams {
3892
3997
  limit?: number;
3893
3998
  /** Run the LOCAL mapper through the app's dev session instead of the live bundle. */
3894
3999
  dev?: boolean;
4000
+ /**
4001
+ * With `dev`, which of your dev sessions: its dev release id. Default your
4002
+ * newest. Only ever your own.
4003
+ */
4004
+ releaseId?: string;
3895
4005
  }
3896
4006
  /**
3897
4007
  * Run the source's mapper over real objects and return the outcomes — nothing
@@ -8279,4 +8389,4 @@ declare class AdminTimeoutError extends Error {
8279
8389
 
8280
8390
  declare const admin: AdminClient;
8281
8391
 
8282
- export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AgentThreadDetail, type AgentThreadListItem, type AgentThreadsGetResult, type AgentThreadsListResult, type AgentToolCall, type AgentTranscriptMessage, type AgentTurnError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourceConnector, type DataSourceConnectorCredentials, type DataSourceConnectorDeletions, type DataSourceConnectorGetResult, type DataSourceConnectorPolicy, type DataSourceConnectorResult, type DataSourceInspectReport, type DataSourceInspectResult, type DataSourceJob, type DataSourceJobGetResult, type DataSourceJobManifestTokenResult, type DataSourceJobPlan, type DataSourceJobResult, type DataSourceJobSource, type DataSourceJobState, type DataSourceJobsListResult, type DataSourceMapDeployResult, type DataSourceMapTestDocument, type DataSourceMapTestOutcome, type DataSourceMapTestResult, type DataSourceMapper, type DataSourceObjectSelection, type DataSourceQuarantineResult, type DataSourceQuarantinedObject, type DataSourceReader, type DataSourceReaderDeliveries, type DataSourceReaderRetryResult, type DataSourceReaderStatusResult, type DataSourceReaderTestDocument, type DataSourceReaderTestResult, type DataSourceRemapResult, type DataSourceRereadResult, type DataSourceSyncResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesChunkingStrategy, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesCountResult, type DataSourcesCreateResult, type DataSourcesDeleteResult, type DataSourcesDictionaryPushResult, type DataSourcesDictionaryReport, type DataSourcesDictionaryStatus, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteManyResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentSelector, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesEntitiesResult, type DataSourcesHydrateResult, type DataSourcesHydration, type DataSourcesIndex, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesLinkResult, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesMigration, type DataSourcesMoveResult, type DataSourcesPlacement, type DataSourcesPromoteResult, type DataSourcesRelink, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSampleResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type EvalAggregates, type EvalCompareResult, type EvalExpectation, type EvalQueriesAddResult, type EvalQueriesListResult, type EvalQuery, type EvalQueryResult, type EvalQueryStyle, type EvalRetrieval, type EvalRun, type EvalRunResult, type EvalRunState, type EvalRunsListResult, type EvalSet, type EvalSetGetResult, type EvalSetResult, type EvalSetState, type EvalSetsListResult, type EventChannelActivity, type EventsChannelsListResult, type EventsPublishResult, type EventsTailFrame, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type IssueRow, type IssueStatus, type IssuesCommentResult, type IssuesCreateResult, type IssuesDeleteResult, type IssuesGetResult, type IssuesListResult, type IssuesUpdateResult, type JewelPairRow, type JewelPairSummaryRow, type JewelVerdict, type JewelsDatasetSummary, type JewelsDryrunResult, type JewelsExportResult, type JewelsGradeResult, type JewelsGrading, type JewelsOverviewResult, type JewelsPairResult, type JewelsPairsResult, type JewelsQueueResult, type JewelsResolveResult, type JewelsRunResult, type JewelsRunsResult, type JewelsTimeseriesBucket, type JewelsTimeseriesResult, type JewelsTrainResult, type LiftedDatabase, type MethodsInvokeResult, type OperationProgress, type OutboundDnsInstructions, type OutboundDnsRecord, type OutboundEmailDomainAddResult, type OutboundEmailDomainCheckResult, type OutboundEmailDomainDeleteResult, type OutboundEmailDomainUiStatus, type OutboundEmailDomainVerifyResult, type OutboundEmailDomainView, type OutboundEmailDomainsListResult, type PlatformSuppression, type PrerenderGetResult, type PrerenderInvalidateResult, type PrerenderPage, type PrerenderPagesResult, type PrerenderViewResult, type ReleaseFailureFields, type ReleaseFragment, type ReleasesByCommitResult, type ReleasesGetResult, type ReleasesListResult, type RequestsGetResult, type RequestsListResult, type RequestsListRow, type RequestsStatsMethodBucket, type RequestsStatsMethodResult, type RequestsStatsSummaryBucket, type RequestsStatsSummaryResult, type SecretsDeleteResult, type SecretsGetResult, type SecretsListResult, type SecretsSetResult, type SettingsResult, type SuppressionSource, type TaskTraceOutcome, type TaskTraceSummary, type TaskTranscriptMessage, type TaskTurnError, type TasksGetResult, type TasksListResult, type TrainingLogEntry, type TrainingRunRow, type TrainingRunStatus, type UserAuthProvider, type UserListItem, type UserRecord, type UsersCreateApiKeyResult, type UsersListResult, type UsersRevokeApiKeyResult, type UsersSetRoleResult, type V2AppSettings, type V2BuildLogEntry, type V2BuildStats, type V2CommitInfo, type V2EmailMessage, type V2ReleaseStatus, type VoiceAvailableNumber, type VoiceNumbersBuyResult, type VoiceNumbersListResult, type VoiceNumbersReleaseResult, type VoiceNumbersSearchResult, type VoiceNumbersSetNameResult, type VoicePhoneNumberStatus, type VoicePhoneNumberView, type VoiceResolvedPolicy, type VoiceSessionChannel, type VoiceSessionCost, type VoiceSessionCostLine, type VoiceSessionDetail, type VoiceSessionGetResult, type VoiceSessionListItem, type VoiceSessionSip, type VoiceSessionSpeechEntry, type VoiceSessionStatus, type VoiceSessionToolEntry, type VoiceSessionTranscriptEntry, type VoiceSessionsListResult, type VoiceSettingsCeilings, type VoiceSettingsGetResult, type VoiceSettingsOverrides, type VoiceSettingsSetResult, admin, createAdminClient, admin as default };
8392
+ export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AgentThreadDetail, type AgentThreadListItem, type AgentThreadsGetResult, type AgentThreadsListResult, type AgentToolCall, type AgentTranscriptMessage, type AgentTurnError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourceConnector, type DataSourceConnectorCredentials, type DataSourceConnectorDeletions, type DataSourceConnectorGetResult, type DataSourceConnectorPolicy, type DataSourceConnectorResult, type DataSourceInspectReport, type DataSourceInspectResult, type DataSourceJob, type DataSourceJobGetResult, type DataSourceJobManifestTokenResult, type DataSourceJobPlan, type DataSourceJobResult, type DataSourceJobSource, type DataSourceJobState, type DataSourceJobsListResult, type DataSourceMapDeployResult, type DataSourceMapTestDocument, type DataSourceMapTestOutcome, type DataSourceMapTestResult, type DataSourceMapper, type DataSourceObjectSelection, type DataSourceQuarantineResult, type DataSourceQuarantinedObject, type DataSourceReader, type DataSourceReaderDeliveries, type DataSourceReaderRetryResult, type DataSourceReaderStatusResult, type DataSourceReaderTestDocument, type DataSourceReaderTestResult, type DataSourceRemapResult, type DataSourceRereadResult, type DataSourceSyncResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesChunkingStrategy, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesCountResult, type DataSourcesCreateResult, type DataSourcesDeleteResult, type DataSourcesDictionaryPushResult, type DataSourcesDictionaryReport, type DataSourcesDictionaryStatus, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteManyResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentSelector, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesEntitiesResult, type DataSourcesHydrateResult, type DataSourcesHydration, type DataSourcesIndex, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesLinkResult, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesMigration, type DataSourcesMoveResult, type DataSourcesPassage, type DataSourcesPassagesResult, type DataSourcesPlacement, type DataSourcesPromoteResult, type DataSourcesRelink, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSampleResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type EvalAggregates, type EvalCompareResult, type EvalExpectation, type EvalQueriesAddResult, type EvalQueriesListResult, type EvalQuery, type EvalQueryResult, type EvalQueryStyle, type EvalRetrieval, type EvalRun, type EvalRunResult, type EvalRunState, type EvalRunsListResult, type EvalSet, type EvalSetGetResult, type EvalSetResult, type EvalSetState, type EvalSetsListResult, type EventChannelActivity, type EventsChannelsListResult, type EventsPublishResult, type EventsTailFrame, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type IssueRow, type IssueStatus, type IssuesCommentResult, type IssuesCreateResult, type IssuesDeleteResult, type IssuesGetResult, type IssuesListResult, type IssuesUpdateResult, type JewelPairRow, type JewelPairSummaryRow, type JewelVerdict, type JewelsDatasetSummary, type JewelsDryrunResult, type JewelsExportResult, type JewelsGradeResult, type JewelsGrading, type JewelsOverviewResult, type JewelsPairResult, type JewelsPairsResult, type JewelsQueueResult, type JewelsResolveResult, type JewelsRunResult, type JewelsRunsResult, type JewelsTimeseriesBucket, type JewelsTimeseriesResult, type JewelsTrainResult, type LiftedDatabase, type MethodsInvokeResult, type OperationProgress, type OutboundDnsInstructions, type OutboundDnsRecord, type OutboundEmailDomainAddResult, type OutboundEmailDomainCheckResult, type OutboundEmailDomainDeleteResult, type OutboundEmailDomainUiStatus, type OutboundEmailDomainVerifyResult, type OutboundEmailDomainView, type OutboundEmailDomainsListResult, type PlatformSuppression, type PrerenderGetResult, type PrerenderInvalidateResult, type PrerenderPage, type PrerenderPagesResult, type PrerenderViewResult, type ReleaseFailureFields, type ReleaseFragment, type ReleasesByCommitResult, type ReleasesGetResult, type ReleasesListResult, type RequestsGetResult, type RequestsListResult, type RequestsListRow, type RequestsStatsMethodBucket, type RequestsStatsMethodResult, type RequestsStatsSummaryBucket, type RequestsStatsSummaryResult, type SecretsDeleteResult, type SecretsGetResult, type SecretsListResult, type SecretsSetResult, type SettingsResult, type SuppressionSource, type TaskTraceOutcome, type TaskTraceSummary, type TaskTranscriptMessage, type TaskTurnError, type TasksGetResult, type TasksListResult, type TrainingLogEntry, type TrainingRunRow, type TrainingRunStatus, type UserAuthProvider, type UserListItem, type UserRecord, type UsersCreateApiKeyResult, type UsersListResult, type UsersRevokeApiKeyResult, type UsersSetRoleResult, type V2AppSettings, type V2BuildLogEntry, type V2BuildStats, type V2CommitInfo, type V2EmailMessage, type V2ReleaseStatus, type VoiceAvailableNumber, type VoiceNumbersBuyResult, type VoiceNumbersListResult, type VoiceNumbersReleaseResult, type VoiceNumbersSearchResult, type VoiceNumbersSetNameResult, type VoicePhoneNumberStatus, type VoicePhoneNumberView, type VoiceResolvedPolicy, type VoiceSessionChannel, type VoiceSessionCost, type VoiceSessionCostLine, type VoiceSessionDetail, type VoiceSessionGetResult, type VoiceSessionListItem, type VoiceSessionSip, type VoiceSessionSpeechEntry, type VoiceSessionStatus, type VoiceSessionToolEntry, type VoiceSessionTranscriptEntry, type VoiceSessionsListResult, type VoiceSettingsCeilings, type VoiceSettingsGetResult, type VoiceSettingsOverrides, type VoiceSettingsSetResult, admin, createAdminClient, admin as default };
package/dist/index.js CHANGED
@@ -411,6 +411,7 @@ __export(dataSources_exports, {
411
411
  link: () => link,
412
412
  list: () => list4,
413
413
  move: () => move,
414
+ passages: () => passages,
414
415
  promote: () => promote,
415
416
  pushDictionary: () => pushDictionary,
416
417
  revectorize: () => revectorize,
@@ -551,6 +552,7 @@ var summarize = (d) => ({
551
552
  });
552
553
  async function addDocument(ctx, params) {
553
554
  const { slug, filename, content, metadata, entities: entities2, onProgress } = params;
555
+ const { budgetDollars } = params;
554
556
  const contentHash = createHash("sha256").update(content).digest("hex");
555
557
  const token = await call(
556
558
  ctx,
@@ -566,11 +568,13 @@ async function addDocument(ctx, params) {
566
568
  );
567
569
  if (token.alreadyCurrent) {
568
570
  onProgress?.(`${filename}: unchanged, skipped`);
571
+ const documents3 = token.documents ?? [token.document];
569
572
  return {
570
573
  filename,
571
574
  skipped: true,
572
575
  document: token.document,
573
- documents: token.documents ?? [token.document]
576
+ documents: documents3,
577
+ documentCount: token.documentCount ?? documents3.length
574
578
  };
575
579
  }
576
580
  onProgress?.(
@@ -588,16 +592,21 @@ async function addDocument(ctx, params) {
588
592
  contentType: token.contentType,
589
593
  size: content.length,
590
594
  ...metadata ? { metadata } : {},
591
- ...entities2 ? { entities: entities2 } : {}
595
+ ...entities2 ? { entities: entities2 } : {},
596
+ ...budgetDollars !== void 0 ? { budgetDollars } : {}
592
597
  }
593
598
  );
599
+ const documents2 = confirmed.documents ?? (confirmed.document ? [confirmed.document] : []);
594
600
  return {
595
601
  filename,
596
602
  skipped: false,
597
603
  queued: confirmed.queued,
598
604
  document: confirmed.document,
599
- documents: confirmed.documents ?? (confirmed.document ? [confirmed.document] : []),
600
- outcome: confirmed.outcome
605
+ documents: documents2,
606
+ documentCount: confirmed.documentCount ?? documents2.length,
607
+ outcome: confirmed.outcome,
608
+ invalid: confirmed.invalid ?? null,
609
+ job: confirmed.job ?? null
601
610
  };
602
611
  }
603
612
  async function waitForIngest(ctx, params) {
@@ -779,6 +788,21 @@ function entities(ctx, params) {
779
788
  }
780
789
  );
781
790
  }
791
+ function passages(ctx, params) {
792
+ const { slug, filter, cursor, limit, candidate } = params;
793
+ return call(
794
+ ctx,
795
+ "POST",
796
+ `${base(ctx.appId)}/passages`,
797
+ {
798
+ slug,
799
+ ...filter ? { filter } : {},
800
+ ...cursor ? { cursor } : {},
801
+ ...limit !== void 0 ? { limit } : {},
802
+ ...candidate ? { candidate: true } : {}
803
+ }
804
+ );
805
+ }
782
806
  function configGet(ctx, slug) {
783
807
  return call(
784
808
  ctx,
@@ -1528,7 +1552,8 @@ function mapTest(ctx, params) {
1528
1552
  ...selectionBody(params.selection),
1529
1553
  ...params.keys ? { keys: params.keys } : {},
1530
1554
  ...params.limit !== void 0 ? { limit: params.limit } : {},
1531
- ...params.dev ? { dev: true } : {}
1555
+ ...params.dev ? { dev: true } : {},
1556
+ ...params.releaseId ? { releaseId: params.releaseId } : {}
1532
1557
  }
1533
1558
  );
1534
1559
  }
@@ -1632,13 +1657,6 @@ async function dashboardLive(ctx) {
1632
1657
  );
1633
1658
  return dashboard.liveRelease;
1634
1659
  }
1635
- function buildFailureReason(release) {
1636
- const log = Array.isArray(release.buildLog) ? release.buildLog : [];
1637
- const errors = log.filter(
1638
- (entry) => entry?.phase === "error" && typeof entry.message === "string"
1639
- );
1640
- return errors.length ? errors[errors.length - 1].message : null;
1641
- }
1642
1660
  function summarizeRelease(release) {
1643
1661
  const summary2 = {
1644
1662
  releaseId: release.id,
@@ -1661,7 +1679,7 @@ function summarizeRelease(release) {
1661
1679
  }
1662
1680
  return {
1663
1681
  ...summary2,
1664
- error: release.failureReason ?? buildFailureReason(release) ?? "Build failed (no error entry in the build log)",
1682
+ error: release.failureReason ?? "Build failed (no error entry in the build log)",
1665
1683
  ...release.failureKind ? { failureKind: release.failureKind } : {},
1666
1684
  ...release.failurePhase ? { failurePhase: release.failurePhase } : {}
1667
1685
  };