@xberg-io/sdk 0.4.0 → 0.5.0

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
@@ -224,6 +224,10 @@ interface paths$1 {
224
224
  * opens an ephemeral NATS subscriber, and streams events with a 15s heartbeat.
225
225
  * Stream closes when a `Complete` event is received or the client disconnects.
226
226
  *
227
+ * Each data frame is a default `message` event carrying JSON. The `kind` discriminator is derived from the NATS subject
228
+ * before serialization. A 15-second SSE comment heartbeat keeps the stream alive.
229
+ * <!-- ~keep: public SSE wire contract -->
230
+ *
227
231
  * # Response format
228
232
  * - **200 OK** with `text/event-stream` media type and events in JSON with `kind` field
229
233
  * - **401 Unauthorized** if authentication fails
@@ -307,8 +311,8 @@ interface paths$1 {
307
311
  * `GET /v1/documents/{document_id}/diff`. Answers `202` with a
308
312
  * `DiffAsyncAccepted` body while the computation is still pending, and `200`
309
313
  * with the `DiffResponse` body once it completes. A diff job that itself
310
- * failed (rather than the poll request) surfaces as a `500` with the
311
- * recorded failure message.
314
+ * cannot read a required extraction surfaces as a `409` with an actionable
315
+ * reason; storage transport failures remain pending for retry.
312
316
  */
313
317
  get: operations$2["poll_diff"];
314
318
  put?: never;
@@ -1347,7 +1351,7 @@ interface components$1 {
1347
1351
  * @description The winning tuning profile artifact. The concrete `TuningProfile`
1348
1352
  * shape is defined in `autotune-core`; here it is opaque JSON.
1349
1353
  */
1350
- profile: Record<string, never>;
1354
+ profile: Record<string, unknown>;
1351
1355
  };
1352
1356
  /** @description Search configuration for an auto-tune run. */
1353
1357
  AutoTuneSearchConfig: {
@@ -1368,7 +1372,7 @@ interface components$1 {
1368
1372
  *
1369
1373
  * Power-user escape hatch. Takes precedence over `search_params` when both are set.
1370
1374
  */
1371
- search_space: Record<string, never>;
1375
+ search_space: Record<string, unknown>;
1372
1376
  /**
1373
1377
  * Format: double
1374
1378
  * @description Tolerance band used when ranking near-tied configurations.
@@ -1482,7 +1486,7 @@ interface components$1 {
1482
1486
  */
1483
1487
  BypassRequestOverride: {
1484
1488
  /** @description Reserved vendor credentials; bypass execution is unavailable. */
1485
- credentials?: Record<string, never>;
1489
+ credentials?: Record<string, unknown>;
1486
1490
  /** @description Whether cloud provides vendor credentials (managed) or caller does (byo). */
1487
1491
  mode: components$1["schemas"]["BypassMode"];
1488
1492
  /** @description Reserved vendor identifier; bypass execution is unavailable. */
@@ -2324,14 +2328,16 @@ interface components$1 {
2324
2328
  index_method?: string | null;
2325
2329
  /**
2326
2330
  * Format: float
2327
- * @description Confidence threshold (0.0–1.0) for classify_text. Default 0.5 when
2328
- * None and label_vocabulary is Some.
2331
+ * @description Not available. Sending this field is refused with
2332
+ * `rag.label_classification.unsupported`, for the same reason as
2333
+ * `label_vocabulary`.
2329
2334
  */
2330
2335
  label_classifier_threshold?: number | null;
2331
2336
  /**
2332
- * @description Labels vocabulary for xberg's classify_text. When None, auto-
2333
- * classification is disabled and labels remain pass-through-only.
2334
- * Length cap: 100 strings; each up to 64 chars.
2337
+ * @description Not available. Sending this field is refused with
2338
+ * `rag.label_classification.unsupported`: no build ships an ingest-time
2339
+ * classifier, so a stored vocabulary would never label a document. Supply
2340
+ * labels per document via `enrichment_overrides.labels` instead.
2335
2341
  */
2336
2342
  label_vocabulary?: string[] | null;
2337
2343
  /** @description Collection name (unique per project) */
@@ -2518,7 +2524,7 @@ interface components$1 {
2518
2524
  */
2519
2525
  preferred_call_mode: string;
2520
2526
  /** @description JSON Schema (Draft 2020-12) for the extraction result. */
2521
- schema: Record<string, never>;
2527
+ schema: Record<string, unknown>;
2522
2528
  /** @description Optional custom system prompt override. */
2523
2529
  system_prompt?: string | null;
2524
2530
  };
@@ -2584,7 +2590,7 @@ interface components$1 {
2584
2590
  /** @description OpenAPI schema for [`DeleteDocumentsRequest`]. */
2585
2591
  DeleteDocumentsRequest: {
2586
2592
  /** @description Vectorstore filter expression. */
2587
- filter?: Record<string, never>;
2593
+ filter?: Record<string, unknown>;
2588
2594
  /** @description List of document UUIDs to delete. */
2589
2595
  ids?: string[] | null;
2590
2596
  };
@@ -2658,7 +2664,7 @@ interface components$1 {
2658
2664
  * recursion. SDKs that want a typed surface here should decode the
2659
2665
  * JSON manually against xberg's published schema.
2660
2666
  */
2661
- diff: Record<string, never>;
2667
+ diff: Record<string, unknown>;
2662
2668
  /**
2663
2669
  * Format: uuid
2664
2670
  * @description Document ID being diffed.
@@ -3059,14 +3065,14 @@ interface components$1 {
3059
3065
  * Contains word count, page count, paragraph count, editing time, etc.
3060
3066
  * DOCX-specific variant of Office application properties.
3061
3067
  */
3062
- app_properties?: Record<string, never> | null;
3068
+ app_properties?: Record<string, unknown> | null;
3063
3069
  /**
3064
3070
  * @description Core properties from docProps/core.xml (Dublin Core metadata)
3065
3071
  *
3066
3072
  * Contains title, creator, subject, keywords, dates, etc.
3067
3073
  * Shared format across DOCX/PPTX/XLSX documents.
3068
3074
  */
3069
- core_properties?: Record<string, never> | null;
3075
+ core_properties?: Record<string, unknown> | null;
3070
3076
  /**
3071
3077
  * @description Custom properties from docProps/custom.xml (user-defined properties)
3072
3078
  *
@@ -3160,7 +3166,7 @@ interface components$1 {
3160
3166
  */
3161
3167
  batch_size?: number | null;
3162
3168
  /** @description Model configuration (flexible JSON: {"type":"preset","name":"balanced"}) */
3163
- model?: Record<string, never>;
3169
+ model?: Record<string, unknown>;
3164
3170
  /** @description Normalize embedding vectors. Defaults to true when omitted. */
3165
3171
  normalize?: boolean | null;
3166
3172
  /** @description Show model download progress */
@@ -3206,8 +3212,8 @@ interface components$1 {
3206
3212
  * @description Result of enrichment processing.
3207
3213
  */
3208
3214
  EnrichResult: {
3209
- /** @description Extracted entities (JSON object). */
3210
- entities?: Record<string, never>;
3215
+ /** @description Extracted named entities, or null when entity detection was not requested. */
3216
+ entities?: Record<string, unknown>[] | null;
3211
3217
  /** @description Extracted keywords. */
3212
3218
  keywords?: string[];
3213
3219
  /** @description Assigned labels (JSON value). */
@@ -3303,7 +3309,7 @@ interface components$1 {
3303
3309
  */
3304
3310
  code: string;
3305
3311
  /** @description Optional detailed error information (context-specific) */
3306
- details?: Record<string, never>;
3312
+ details?: Record<string, unknown>;
3307
3313
  /**
3308
3314
  * @description Human-readable error message
3309
3315
  * @example Caller-supplied embedding does not match collection dimension
@@ -3389,7 +3395,7 @@ interface components$1 {
3389
3395
  * Enterprise-only; Pro leaves this unset. Kept as opaque JSON — see
3390
3396
  * [`UrlInput::crawl_config`].
3391
3397
  */
3392
- crawl_config?: Record<string, never>;
3398
+ crawl_config?: Record<string, unknown>;
3393
3399
  /** @description Documents to extract inline or via an integration reference. */
3394
3400
  documents?: components$1["schemas"]["DocumentInput"][];
3395
3401
  /** @description Extraction options shared by every document/URL in this request. */
@@ -3824,7 +3830,7 @@ interface components$1 {
3824
3830
  /** @description Force OCR on specific pages (1-indexed) */
3825
3831
  force_ocr_pages?: number[] | null;
3826
3832
  /** @description HTML extraction options (flexible JSON) */
3827
- html_options?: Record<string, never>;
3833
+ html_options?: Record<string, unknown>;
3828
3834
  /** @description Image extraction configuration */
3829
3835
  images?: components$1["schemas"]["ImageExtractionConfig"];
3830
3836
  /** @description Include structured document tree in output */
@@ -3970,7 +3976,7 @@ interface components$1 {
3970
3976
  * Enterprise, a raw `serde_json::Value` on Pro) is service-local and out
3971
3977
  * of scope for this convergence pass.
3972
3978
  */
3973
- extraction_config?: Record<string, never>;
3979
+ extraction_config?: Record<string, unknown>;
3974
3980
  /**
3975
3981
  * @description Curated preset identifier. Mutually exclusive with `saved_preset_id`
3976
3982
  * and with an inline schema in `extraction_config`.
@@ -3990,7 +3996,9 @@ interface components$1 {
3990
3996
  saved_preset_id?: string | null;
3991
3997
  /**
3992
3998
  * @description When true and a document is a PDF, enable multi-document boundary
3993
- * detection and fan-out orchestration. Enterprise-only; Pro ignores it.
3999
+ * detection and fan-out orchestration. Enterprise-only. Xberg Pro has no
4000
+ * splitter and answers 400 when a request sets it, the way it already
4001
+ * answers 400 for `urls` and `crawl_config`.
3994
4002
  */
3995
4003
  split_documents?: boolean | null;
3996
4004
  };
@@ -4044,7 +4052,7 @@ interface components$1 {
4044
4052
  extraction_timeout_secs?: number | null;
4045
4053
  force_ocr?: boolean | null;
4046
4054
  force_ocr_pages?: number[] | null;
4047
- html_options?: Record<string, never>;
4055
+ html_options?: Record<string, unknown>;
4048
4056
  images?: components$1["schemas"]["ImageExtractionConfig"];
4049
4057
  include_document_structure?: boolean | null;
4050
4058
  keywords?: components$1["schemas"]["KeywordConfig"];
@@ -4707,7 +4715,7 @@ interface components$1 {
4707
4715
  * `structured_extraction.schema`, or `options.saved_preset_id`, which
4708
4716
  * both tiers apply).
4709
4717
  */
4710
- structured_output?: Record<string, never>;
4718
+ structured_output?: Record<string, unknown>;
4711
4719
  /**
4712
4720
  * @description Tables extracted from the document. Opaque here; the engine type is
4713
4721
  * `Table`.
@@ -4775,7 +4783,7 @@ interface components$1 {
4775
4783
  * breaking wire change for existing Pro clients (see ADR-0066).
4776
4784
  * @enum {string}
4777
4785
  */
4778
- JobStatus: "awaiting_upload" | "pending" | "processing" | "chunking" | "aggregating" | "completed" | "partial_success" | "failed" | "cancelled";
4786
+ JobStatus: "awaiting_upload" | "pending" | "processing" | "completed" | "partial_success" | "failed" | "cancelled";
4779
4787
  /** @description Summary of a job, as returned by `GET /v1/jobs` (list). */
4780
4788
  JobSummary: {
4781
4789
  /**
@@ -4956,11 +4964,7 @@ interface components$1 {
4956
4964
  id: string;
4957
4965
  /** @description MIME type of the uploaded file. */
4958
4966
  mime_type: string;
4959
- /**
4960
- * @description The extraction result, when the stored result could be fetched and
4961
- * deserialized; `null` otherwise.
4962
- */
4963
- result?: components$1["schemas"]["ExtractedDocument"];
4967
+ result?: null | components$1["schemas"]["ExtractedDocument"];
4964
4968
  /** @description Job status of the latest version. */
4965
4969
  status: string;
4966
4970
  /**
@@ -5026,12 +5030,12 @@ interface components$1 {
5026
5030
  * scores). The concrete shape is defined in `autotune-core`; here it
5027
5031
  * is opaque JSON.
5028
5032
  */
5029
- breakdown: Record<string, never>;
5033
+ breakdown: Record<string, unknown>;
5030
5034
  /**
5031
5035
  * @description The extraction configuration trialed for this entry. The concrete
5032
5036
  * shape is defined in `autotune-core`; here it is opaque JSON.
5033
5037
  */
5034
- config: Record<string, never>;
5038
+ config: Record<string, unknown>;
5035
5039
  /**
5036
5040
  * Format: double
5037
5041
  * @description Primary aggregate score for this configuration.
@@ -5729,7 +5733,7 @@ interface components$1 {
5729
5733
  /** @description Tesseract-specific configuration */
5730
5734
  tesseract_config?: components$1["schemas"]["TesseractConfig"];
5731
5735
  /** @description VLM (Vision Language Model) configuration */
5732
- vlm_config?: Record<string, never>;
5736
+ vlm_config?: Record<string, unknown>;
5733
5737
  /** @description VLM fallback policy for OCR operations */
5734
5738
  vlm_fallback?: components$1["schemas"]["VlmFallbackPolicy"];
5735
5739
  /** @description Custom Jinja2 prompt template for VLM OCR */
@@ -5852,7 +5856,7 @@ interface components$1 {
5852
5856
  /** @description Tesseract config override for this stage */
5853
5857
  tesseract_config?: components$1["schemas"]["TesseractConfig"];
5854
5858
  /** @description VLM config override for this stage */
5855
- vlm_config?: Record<string, never>;
5859
+ vlm_config?: Record<string, unknown>;
5856
5860
  };
5857
5861
  OcrPoint: {
5858
5862
  x: number;
@@ -6392,7 +6396,7 @@ interface components$1 {
6392
6396
  preferred_call_mode: components$1["schemas"]["PresetCallMode"];
6393
6397
  sample?: components$1["schemas"]["PresetSampleRef"];
6394
6398
  /** @description JSON Schema (Draft 2020-12) describing the structured output shape. */
6395
- schema: Record<string, never>;
6399
+ schema: Record<string, unknown>;
6396
6400
  schema_name: string;
6397
6401
  system_prompt: string;
6398
6402
  tags?: string[];
@@ -6814,7 +6818,7 @@ interface components$1 {
6814
6818
  */
6815
6819
  candidate_multiplier?: number | null;
6816
6820
  /** @description Filter expression (deserialized by the vectorstore Filter IR). */
6817
- filter?: Record<string, never>;
6821
+ filter?: Record<string, unknown>;
6818
6822
  /** @description Collapse to one chunk per document. */
6819
6823
  group_by_document?: boolean;
6820
6824
  /** @description Optional response field mask. */
@@ -7026,7 +7030,7 @@ interface components$1 {
7026
7030
  */
7027
7031
  preferred_call_mode: string;
7028
7032
  /** @description JSON Schema for the extraction result. */
7029
- schema: Record<string, never>;
7033
+ schema: Record<string, unknown>;
7030
7034
  /** @description Optional custom system prompt. */
7031
7035
  system_prompt?: string | null;
7032
7036
  /**
@@ -7229,7 +7233,7 @@ interface components$1 {
7229
7233
  * @description JSON Schema (draft-07) the structured output must conform to. Optional
7230
7234
  * only when `options.preset` or `options.saved_preset_id` supplies it.
7231
7235
  */
7232
- schema?: Record<string, never>;
7236
+ schema?: Record<string, unknown>;
7233
7237
  /** @description Optional human-readable schema description supplied to the LLM. */
7234
7238
  schema_description?: string | null;
7235
7239
  /** @description Schema name passed to the LLM's structured-output mode. Defaults to "extraction". */
@@ -7576,12 +7580,12 @@ interface components$1 {
7576
7580
  * @description The tuning profile artifact. The concrete `TuningProfile` shape is
7577
7581
  * defined in `autotune-core`; here it is opaque JSON.
7578
7582
  */
7579
- profile: Record<string, never>;
7583
+ profile: Record<string, unknown>;
7580
7584
  /**
7581
7585
  * @description Scores recorded for this profile at promotion time. The concrete
7582
7586
  * shape is defined in `autotune-core`; here it is opaque JSON.
7583
7587
  */
7584
- scores: Record<string, never>;
7588
+ scores: Record<string, unknown>;
7585
7589
  };
7586
7590
  /** @description Lightweight projection of a tuning profile (for listings). */
7587
7591
  TuningProfileSummary: {
@@ -7624,7 +7628,7 @@ interface components$1 {
7624
7628
  */
7625
7629
  preferred_call_mode: string;
7626
7630
  /** @description JSON Schema (Draft 2020-12) for the extraction result. */
7627
- schema: Record<string, never>;
7631
+ schema: Record<string, unknown>;
7628
7632
  /** @description Optional custom system prompt override. */
7629
7633
  system_prompt?: string | null;
7630
7634
  };
@@ -7652,7 +7656,7 @@ interface components$1 {
7652
7656
  * (`services/api::rest::types::CrawlConfig`) and is out of scope for
7653
7657
  * this convergence pass.
7654
7658
  */
7655
- crawl_config?: Record<string, never>;
7659
+ crawl_config?: Record<string, unknown>;
7656
7660
  /** @description URL to crawl and extract documents from. */
7657
7661
  url: string;
7658
7662
  };
@@ -7786,7 +7790,7 @@ interface components$1 {
7786
7790
  * @description The extraction result, present only on `job.completed` and only when it
7787
7791
  * fits in the body. The shape is the `result` of `GET /v1/jobs/{id}`.
7788
7792
  */
7789
- results?: Record<string, never>;
7793
+ results?: Record<string, unknown>;
7790
7794
  /**
7791
7795
  * Format: date-time
7792
7796
  * @description RFC 3339 time at which the job reached the terminal status.
@@ -8787,6 +8791,15 @@ interface operations$2 {
8787
8791
  "application/json": components$1["schemas"]["ErrorResponse"];
8788
8792
  };
8789
8793
  };
8794
+ /** @description Version extraction is unavailable */
8795
+ 409: {
8796
+ headers: {
8797
+ [name: string]: unknown;
8798
+ };
8799
+ content: {
8800
+ "application/json": components$1["schemas"]["ErrorResponse"];
8801
+ };
8802
+ };
8790
8803
  /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
8791
8804
  429: {
8792
8805
  headers: {
@@ -8866,6 +8879,15 @@ interface operations$2 {
8866
8879
  "application/json": components$1["schemas"]["ErrorResponse"];
8867
8880
  };
8868
8881
  };
8882
+ /** @description Version extraction is unavailable */
8883
+ 409: {
8884
+ headers: {
8885
+ [name: string]: unknown;
8886
+ };
8887
+ content: {
8888
+ "application/json": components$1["schemas"]["ErrorResponse"];
8889
+ };
8890
+ };
8869
8891
  /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
8870
8892
  429: {
8871
8893
  headers: {
@@ -9619,7 +9641,7 @@ interface operations$2 {
9619
9641
  [name: string]: unknown;
9620
9642
  };
9621
9643
  content: {
9622
- "image/png": unknown;
9644
+ "image/png": string;
9623
9645
  };
9624
9646
  };
9625
9647
  /** @description The request is malformed: a path parameter, a query parameter or the body did not parse */
@@ -9744,12 +9766,14 @@ interface operations$2 {
9744
9766
  };
9745
9767
  requestBody?: never;
9746
9768
  responses: {
9747
- /** @description Sample bytes (octet-stream) */
9769
+ /** @description Sample bytes; Content-Type follows the sample file */
9748
9770
  200: {
9749
9771
  headers: {
9750
9772
  [name: string]: unknown;
9751
9773
  };
9752
- content?: never;
9774
+ content: {
9775
+ "*/*": string;
9776
+ };
9753
9777
  };
9754
9778
  /** @description The request is malformed: a path parameter, a query parameter or the body did not parse */
9755
9779
  400: {
@@ -9872,7 +9896,7 @@ interface operations$2 {
9872
9896
  "application/json": components$1["schemas"]["CreateCollectionResponse"];
9873
9897
  };
9874
9898
  };
9875
- /** @description Invalid request parameters */
9899
+ /** @description Invalid request parameters, or a label classification field was supplied: `rag.label_classification.unsupported` */
9876
9900
  400: {
9877
9901
  headers: {
9878
9902
  [name: string]: unknown;
@@ -11974,13 +11998,13 @@ interface paths$2 {
11974
11998
  };
11975
11999
  /**
11976
12000
  * Check whether the service is ready to serve traffic.
11977
- * @description Probes the primary database, the maintenance database login, and the
11978
- * object store (a HEAD on a key that never exists — any answer, found or
11979
- * refused, proves the store is reachable). Answers `200` with each
11980
- * dependency's status only when all are healthy; any failure answers `503`
11981
- * with the same body shape so the caller can see which check failed.
11982
- * Unauthenticated: intended for a container orchestrator's readiness probe,
11983
- * not for API clients.
12001
+ * @description Probes the primary database, the maintenance database login, the object
12002
+ * store (a HEAD on a key that never exists — any answer, found or refused,
12003
+ * proves the store is reachable) and the embedded vector-index worker.
12004
+ * Answers `200` with each dependency's status only when all are healthy; any
12005
+ * failure answers `503` with the same body shape so the caller can see which
12006
+ * check failed. Unauthenticated: intended for a container orchestrator's
12007
+ * readiness probe, not for API clients.
11984
12008
  */
11985
12009
  get: operations$1["readyz"];
11986
12010
  put?: never;
@@ -12142,6 +12166,70 @@ interface paths$2 {
12142
12166
  patch?: never;
12143
12167
  trace?: never;
12144
12168
  };
12169
+ "/v1/crawl-jobs/{crawl_job_id}/events": {
12170
+ parameters: {
12171
+ query?: never;
12172
+ header?: never;
12173
+ path?: never;
12174
+ cookie?: never;
12175
+ };
12176
+ /**
12177
+ * Stream crawl job lifecycle events over SSE.
12178
+ * @description Not yet implemented on Xberg Pro: every request answers `501`.
12179
+ */
12180
+ get: operations$1["stream_crawl_events"];
12181
+ put?: never;
12182
+ post?: never;
12183
+ delete?: never;
12184
+ options?: never;
12185
+ head?: never;
12186
+ patch?: never;
12187
+ trace?: never;
12188
+ };
12189
+ "/v1/enrich": {
12190
+ parameters: {
12191
+ query?: never;
12192
+ header?: never;
12193
+ path?: never;
12194
+ cookie?: never;
12195
+ };
12196
+ get?: never;
12197
+ put?: never;
12198
+ /**
12199
+ * Submit text for enrichment.
12200
+ * @description Not yet implemented on Xberg Pro: every request answers `501`. The request
12201
+ * and success schemas are declared now so a client generated against this
12202
+ * spec does not change shape once the dispatcher wires the enrichment job
12203
+ * kind (tracked in #1505).
12204
+ */
12205
+ post: operations$1["submit_enrich"];
12206
+ delete?: never;
12207
+ options?: never;
12208
+ head?: never;
12209
+ patch?: never;
12210
+ trace?: never;
12211
+ };
12212
+ "/v1/enrich/{job_id}": {
12213
+ parameters: {
12214
+ query?: never;
12215
+ header?: never;
12216
+ path?: never;
12217
+ cookie?: never;
12218
+ };
12219
+ /**
12220
+ * Poll an enrichment job's status.
12221
+ * @description Not yet implemented on Xberg Pro: every request answers `501`. See
12222
+ * [`submit_enrich`] for the tracking issue.
12223
+ */
12224
+ get: operations$1["get_enrich_status"];
12225
+ put?: never;
12226
+ post?: never;
12227
+ delete?: never;
12228
+ options?: never;
12229
+ head?: never;
12230
+ patch?: never;
12231
+ trace?: never;
12232
+ };
12145
12233
  "/v1/extract": {
12146
12234
  parameters: {
12147
12235
  query?: never;
@@ -12240,6 +12328,27 @@ interface paths$2 {
12240
12328
  patch?: never;
12241
12329
  trace?: never;
12242
12330
  };
12331
+ "/v1/jobs/{job_id}/pages/{page_number}": {
12332
+ parameters: {
12333
+ query?: never;
12334
+ header?: never;
12335
+ path?: never;
12336
+ cookie?: never;
12337
+ };
12338
+ /**
12339
+ * Retrieve a rasterized page PNG from a completed extraction job.
12340
+ * @description Not yet implemented on Xberg Pro: every request answers `501`. Page
12341
+ * numbers are 1-indexed, matching Enterprise's own operation.
12342
+ */
12343
+ get: operations$1["get_job_page"];
12344
+ put?: never;
12345
+ post?: never;
12346
+ delete?: never;
12347
+ options?: never;
12348
+ head?: never;
12349
+ patch?: never;
12350
+ trace?: never;
12351
+ };
12243
12352
  "/v1/oauth/callback": {
12244
12353
  parameters: {
12245
12354
  query?: never;
@@ -12565,8 +12674,8 @@ interface paths$2 {
12565
12674
  };
12566
12675
  /**
12567
12676
  * Fetch one document's raw bytes through a connected source integration.
12568
- * @description Streams the document as `application/octet-stream` with the source's own
12569
- * MIME type in `Content-Type` and a sanitized filename in
12677
+ * @description Streams the document bytes with the source's MIME type in `Content-Type`
12678
+ * and a sanitized filename in
12570
12679
  * `Content-Disposition` — there is no JSON envelope on success. `document_id`
12571
12680
  * is the source's own identifier, not one this service assigns. As with
12572
12681
  * listing, errors distinguish this service's own failures from the
@@ -12936,6 +13045,72 @@ interface paths$2 {
12936
13045
  patch?: never;
12937
13046
  trace?: never;
12938
13047
  };
13048
+ "/v1/uploads/confirm": {
13049
+ parameters: {
13050
+ query?: never;
13051
+ header?: never;
13052
+ path?: never;
13053
+ cookie?: never;
13054
+ };
13055
+ get?: never;
13056
+ put?: never;
13057
+ /**
13058
+ * Confirm uploads are complete and start processing.
13059
+ * @description Not yet implemented on Xberg Pro: every request answers `501`. See
13060
+ * [`presign_upload`] for the tracking issue.
13061
+ */
13062
+ post: operations$1["confirm_upload"];
13063
+ delete?: never;
13064
+ options?: never;
13065
+ head?: never;
13066
+ patch?: never;
13067
+ trace?: never;
13068
+ };
13069
+ "/v1/uploads/presign": {
13070
+ parameters: {
13071
+ query?: never;
13072
+ header?: never;
13073
+ path?: never;
13074
+ cookie?: never;
13075
+ };
13076
+ get?: never;
13077
+ put?: never;
13078
+ /**
13079
+ * Generate presigned upload URLs.
13080
+ * @description Not yet implemented on Xberg Pro: every request answers `501`. See the
13081
+ * module doc comment for the tracking issue and the pending-store design
13082
+ * note.
13083
+ */
13084
+ post: operations$1["presign_upload"];
13085
+ delete?: never;
13086
+ options?: never;
13087
+ head?: never;
13088
+ patch?: never;
13089
+ trace?: never;
13090
+ };
13091
+ "/v1/usage": {
13092
+ parameters: {
13093
+ query?: never;
13094
+ header?: never;
13095
+ path?: never;
13096
+ cookie?: never;
13097
+ };
13098
+ /**
13099
+ * Get usage statistics and quota for the caller's project.
13100
+ * @description Not yet implemented on Xberg Pro: every request answers `501`. The
13101
+ * response schema is the same `UsageResponse` Enterprise already serves, so
13102
+ * a client generated against this spec does not change shape once the
13103
+ * aggregation query lands (#1508).
13104
+ */
13105
+ get: operations$1["get_usage"];
13106
+ put?: never;
13107
+ post?: never;
13108
+ delete?: never;
13109
+ options?: never;
13110
+ head?: never;
13111
+ patch?: never;
13112
+ trace?: never;
13113
+ };
12939
13114
  }
12940
13115
  interface components$2 {
12941
13116
  schemas: {
@@ -13161,7 +13336,7 @@ interface components$2 {
13161
13336
  * @description The winning tuning profile artifact. The concrete `TuningProfile`
13162
13337
  * shape is defined in `autotune-core`; here it is opaque JSON.
13163
13338
  */
13164
- profile: Record<string, never>;
13339
+ profile: Record<string, unknown>;
13165
13340
  };
13166
13341
  /** @description Search configuration for an auto-tune run. */
13167
13342
  AutoTuneSearchConfig: {
@@ -13182,7 +13357,7 @@ interface components$2 {
13182
13357
  *
13183
13358
  * Power-user escape hatch. Takes precedence over `search_params` when both are set.
13184
13359
  */
13185
- search_space: Record<string, never>;
13360
+ search_space: Record<string, unknown>;
13186
13361
  /**
13187
13362
  * Format: double
13188
13363
  * @description Tolerance band used when ranking near-tied configurations.
@@ -13318,6 +13493,21 @@ interface components$2 {
13318
13493
  /** @description Last ingestion timestamp (RFC3339) */
13319
13494
  last_ingested_at?: string | null;
13320
13495
  };
13496
+ /** @description Request body for confirming uploads. */
13497
+ ConfirmUploadRequest: {
13498
+ /**
13499
+ * Format: uuid
13500
+ * @description Batch ID from the presign response.
13501
+ */
13502
+ batch_id: string;
13503
+ };
13504
+ /** @description Response from the confirm endpoint. */
13505
+ ConfirmUploadResponse: {
13506
+ /** @description Job IDs that are now queued for processing */
13507
+ job_ids: string[];
13508
+ /** @description Status of the jobs */
13509
+ status: string;
13510
+ };
13321
13511
  /** @description Content filtering configuration (headers, footers, watermarks). */
13322
13512
  ContentFilterConfig: {
13323
13513
  /** @description Include running footers */
@@ -13329,6 +13519,93 @@ interface components$2 {
13329
13519
  /** @description Strip cross-page repeating text. Defaults to true when omitted. */
13330
13520
  strip_repeating_text?: boolean | null;
13331
13521
  };
13522
+ /**
13523
+ * @description A crawl event published to the SSE stream.
13524
+ *
13525
+ * Tagged union with event kind as the discriminator. Each variant carries
13526
+ * `crawl_job_id` and `ts` (timestamp) for client-side ordering and deduplication.
13527
+ *
13528
+ * Internally tagged on `kind` (`#[serde(tag = "kind")]`): each variant
13529
+ * serializes as a flat JSON object with a `kind` field alongside its other
13530
+ * fields, e.g. `{"kind":"page","crawl_job_id":"...","ts":"...",...}`. utoipa
13531
+ * derives the matching `oneOf` schema straight from that `#[serde(tag = ..)]`
13532
+ * attribute, so no separate `#[schema(...)]` tagging is needed. An explicit
13533
+ * `discriminator` is not applicable here: utoipa only supports OpenAPI
13534
+ * discriminators for `#[serde(untagged)]` enums with single-reference-field
13535
+ * variants, not internally tagged enums like this one.
13536
+ */
13537
+ CrawlEventV1: {
13538
+ /**
13539
+ * Format: uuid
13540
+ * @description Job ID this event belongs to
13541
+ */
13542
+ crawl_job_id: string;
13543
+ /** @description Crawl depth when this page was discovered */
13544
+ depth: number;
13545
+ /** @enum {string} */
13546
+ kind: "page";
13547
+ /**
13548
+ * Format: int32
13549
+ * @description HTTP status code
13550
+ */
13551
+ status_code: number;
13552
+ /**
13553
+ * Format: date-time
13554
+ * @description Event timestamp (UTC)
13555
+ */
13556
+ ts: string;
13557
+ /** @description URL that was crawled */
13558
+ url: string;
13559
+ } | {
13560
+ /**
13561
+ * Format: uuid
13562
+ * @description Job ID this event belongs to
13563
+ */
13564
+ crawl_job_id: string;
13565
+ /** @description Error description */
13566
+ error: string;
13567
+ /** @enum {string} */
13568
+ kind: "error";
13569
+ /**
13570
+ * Format: date-time
13571
+ * @description Event timestamp (UTC)
13572
+ */
13573
+ ts: string;
13574
+ /** @description URL that failed */
13575
+ url: string;
13576
+ } | {
13577
+ /**
13578
+ * Format: uuid
13579
+ * @description Job ID this event belongs to
13580
+ */
13581
+ crawl_job_id: string;
13582
+ /** @description Depth at which this URL was discovered */
13583
+ depth: number;
13584
+ /** @enum {string} */
13585
+ kind: "discovered";
13586
+ /**
13587
+ * Format: date-time
13588
+ * @description Event timestamp (UTC)
13589
+ */
13590
+ ts: string;
13591
+ /** @description URL that was discovered */
13592
+ url: string;
13593
+ } | {
13594
+ /**
13595
+ * Format: uuid
13596
+ * @description Job ID this event belongs to
13597
+ */
13598
+ crawl_job_id: string;
13599
+ /** @enum {string} */
13600
+ kind: "complete";
13601
+ /** @description Total pages successfully crawled */
13602
+ pages_crawled: number;
13603
+ /**
13604
+ * Format: date-time
13605
+ * @description Event timestamp (UTC)
13606
+ */
13607
+ ts: string;
13608
+ };
13332
13609
  /** @description Request to create a new API key. */
13333
13610
  CreateApiKeyRequest: {
13334
13611
  /**
@@ -13437,14 +13714,16 @@ interface components$2 {
13437
13714
  index_method?: string | null;
13438
13715
  /**
13439
13716
  * Format: float
13440
- * @description Confidence threshold (0.0–1.0) for classify_text. Default 0.5 when
13441
- * None and label_vocabulary is Some.
13717
+ * @description Not available. Sending this field is refused with
13718
+ * `rag.label_classification.unsupported`, for the same reason as
13719
+ * `label_vocabulary`.
13442
13720
  */
13443
13721
  label_classifier_threshold?: number | null;
13444
13722
  /**
13445
- * @description Labels vocabulary for xberg's classify_text. When None, auto-
13446
- * classification is disabled and labels remain pass-through-only.
13447
- * Length cap: 100 strings; each up to 64 chars.
13723
+ * @description Not available. Sending this field is refused with
13724
+ * `rag.label_classification.unsupported`: no build ships an ingest-time
13725
+ * classifier, so a stored vocabulary would never label a document. Supply
13726
+ * labels per document via `enrichment_overrides.labels` instead.
13448
13727
  */
13449
13728
  label_vocabulary?: string[] | null;
13450
13729
  /** @description Collection name (unique per project) */
@@ -13613,9 +13892,9 @@ interface components$2 {
13613
13892
  CreateIntegrationRequest: {
13614
13893
  auth_type: string;
13615
13894
  /** @description Additional configuration as a JSON object (optional; mirrors the backend). */
13616
- config?: Record<string, never>;
13895
+ config?: Record<string, unknown>;
13617
13896
  /** @description BYO client credentials (client_id, client_secret for OAuth2/OIDC). */
13618
- credentials: Record<string, never>;
13897
+ credentials: Record<string, unknown>;
13619
13898
  kind: string;
13620
13899
  name: string;
13621
13900
  };
@@ -13685,7 +13964,7 @@ interface components$2 {
13685
13964
  */
13686
13965
  preferred_call_mode: string;
13687
13966
  /** @description JSON Schema (Draft 2020-12) for the extraction result. */
13688
- schema: Record<string, never>;
13967
+ schema: Record<string, unknown>;
13689
13968
  /** @description Optional custom system prompt override. */
13690
13969
  system_prompt?: string | null;
13691
13970
  };
@@ -13706,7 +13985,7 @@ interface components$2 {
13706
13985
  /** @description OpenAPI schema for [`DeleteDocumentsRequest`]. */
13707
13986
  DeleteDocumentsRequest: {
13708
13987
  /** @description Vectorstore filter expression. */
13709
- filter?: Record<string, never>;
13988
+ filter?: Record<string, unknown>;
13710
13989
  /** @description List of document UUIDs to delete. */
13711
13990
  ids?: string[] | null;
13712
13991
  };
@@ -13816,24 +14095,81 @@ interface components$2 {
13816
14095
  */
13817
14096
  batch_size?: number | null;
13818
14097
  /** @description Model configuration (flexible JSON: {"type":"preset","name":"balanced"}) */
13819
- model?: Record<string, never>;
14098
+ model?: Record<string, unknown>;
13820
14099
  /** @description Normalize embedding vectors. Defaults to true when omitted. */
13821
14100
  normalize?: boolean | null;
13822
14101
  /** @description Show model download progress */
13823
14102
  show_download_progress?: boolean | null;
13824
14103
  };
13825
- /**
13826
- * @description Request shape of `enrichment_overrides`.
13827
- *
13828
- * The NATS message type stays lenient so an older publisher's payload still
13829
- * decodes, but the request boundary is strict: an unknown key is a typo the
13830
- * caller must see, and `entities` and `labels` carry typed shapes so a
13831
- * malformed value fails at parse rather than reaching the pipeline as an
13832
- * opaque blob that no later step can reject.
13833
- */
13834
- EnrichmentOverridesRequest: {
13835
- /** @description Pre-computed entities, as a list of objects. */
13836
- entities?: {
14104
+ /** @description Status response for an enrichment job. */
14105
+ EnrichJobStatus: {
14106
+ /** @enum {string} */
14107
+ status: "pending";
14108
+ } | {
14109
+ /** @description Enrichment result. */
14110
+ result: components$2["schemas"]["EnrichResult"];
14111
+ /** @enum {string} */
14112
+ status: "completed";
14113
+ } | {
14114
+ /** @description Error message. */
14115
+ error: string;
14116
+ /** @enum {string} */
14117
+ status: "failed";
14118
+ };
14119
+ /**
14120
+ * EnrichJobSubmitted
14121
+ * @description Response from submitting an enrichment job.
14122
+ */
14123
+ EnrichJobSubmitted: {
14124
+ /** @description Unique job identifier (ULID). */
14125
+ job_id: string;
14126
+ };
14127
+ /**
14128
+ * EnrichRequestOptions
14129
+ * @description Enrichment processing options.
14130
+ */
14131
+ EnrichRequestOptions: {
14132
+ /** @description Extract named entities via NER. */
14133
+ entities?: boolean;
14134
+ /** @description Extract keywords from the text. */
14135
+ keywords?: boolean;
14136
+ /** @description Custom labels to assign (passthrough). */
14137
+ labels?: string[];
14138
+ };
14139
+ /**
14140
+ * EnrichResult
14141
+ * @description Result of enrichment processing.
14142
+ */
14143
+ EnrichResult: {
14144
+ /** @description Extracted named entities, or null when entity detection was not requested. */
14145
+ entities?: Record<string, unknown>[] | null;
14146
+ /** @description Extracted keywords. */
14147
+ keywords?: string[];
14148
+ /** @description Assigned labels (JSON value). */
14149
+ labels?: unknown;
14150
+ };
14151
+ /**
14152
+ * EnrichTextRequest
14153
+ * @description Request to submit text for enrichment.
14154
+ */
14155
+ EnrichTextRequest: {
14156
+ /** @description Enrichment options. */
14157
+ options?: components$2["schemas"]["EnrichRequestOptions"];
14158
+ /** @description Text to enrich (max 1 MB). */
14159
+ text: string;
14160
+ };
14161
+ /**
14162
+ * @description Request shape of `enrichment_overrides`.
14163
+ *
14164
+ * The NATS message type stays lenient so an older publisher's payload still
14165
+ * decodes, but the request boundary is strict: an unknown key is a typo the
14166
+ * caller must see, and `entities` and `labels` carry typed shapes so a
14167
+ * malformed value fails at parse rather than reaching the pipeline as an
14168
+ * opaque blob that no later step can reject.
14169
+ */
14170
+ EnrichmentOverridesRequest: {
14171
+ /** @description Pre-computed entities, as a list of objects. */
14172
+ entities?: {
13837
14173
  [key: string]: unknown;
13838
14174
  }[] | null;
13839
14175
  /** @description Pre-computed keywords. */
@@ -13849,7 +14185,7 @@ interface components$2 {
13849
14185
  */
13850
14186
  code: string;
13851
14187
  /** @description Optional detailed error information (context-specific) */
13852
- details?: Record<string, never>;
14188
+ details?: Record<string, unknown>;
13853
14189
  /**
13854
14190
  * @description Human-readable error message
13855
14191
  * @example Caller-supplied embedding does not match collection dimension
@@ -13910,7 +14246,7 @@ interface components$2 {
13910
14246
  * Enterprise-only; Pro leaves this unset. Kept as opaque JSON — see
13911
14247
  * [`UrlInput::crawl_config`].
13912
14248
  */
13913
- crawl_config?: Record<string, never>;
14249
+ crawl_config?: Record<string, unknown>;
13914
14250
  /** @description Documents to extract inline or via an integration reference. */
13915
14251
  documents?: components$2["schemas"]["DocumentInput"][];
13916
14252
  /** @description Extraction options shared by every document/URL in this request. */
@@ -13977,7 +14313,7 @@ interface components$2 {
13977
14313
  * Enterprise, a raw `serde_json::Value` on Pro) is service-local and out
13978
14314
  * of scope for this convergence pass.
13979
14315
  */
13980
- extraction_config?: Record<string, never>;
14316
+ extraction_config?: Record<string, unknown>;
13981
14317
  /**
13982
14318
  * @description Curated preset identifier. Mutually exclusive with `saved_preset_id`
13983
14319
  * and with an inline schema in `extraction_config`.
@@ -13997,7 +14333,9 @@ interface components$2 {
13997
14333
  saved_preset_id?: string | null;
13998
14334
  /**
13999
14335
  * @description When true and a document is a PDF, enable multi-document boundary
14000
- * detection and fan-out orchestration. Enterprise-only; Pro ignores it.
14336
+ * detection and fan-out orchestration. Enterprise-only. Xberg Pro has no
14337
+ * splitter and answers 400 when a request sets it, the way it already
14338
+ * answers 400 for `urls` and `crawl_config`.
14001
14339
  */
14002
14340
  split_documents?: boolean | null;
14003
14341
  };
@@ -14037,7 +14375,7 @@ interface components$2 {
14037
14375
  extraction_timeout_secs?: number | null;
14038
14376
  force_ocr?: boolean | null;
14039
14377
  force_ocr_pages?: number[] | null;
14040
- html_options?: Record<string, never>;
14378
+ html_options?: Record<string, unknown>;
14041
14379
  images?: components$2["schemas"]["ImageExtractionConfig"];
14042
14380
  include_document_structure?: boolean | null;
14043
14381
  keywords?: components$2["schemas"]["KeywordConfig"];
@@ -14364,7 +14702,7 @@ interface components$2 {
14364
14702
  * `structured_extraction.schema`, or `options.saved_preset_id`, which
14365
14703
  * both tiers apply).
14366
14704
  */
14367
- structured_output?: Record<string, never>;
14705
+ structured_output?: Record<string, unknown>;
14368
14706
  /**
14369
14707
  * @description Tables extracted from the document. Opaque here; the engine type is
14370
14708
  * `Table`.
@@ -14432,7 +14770,7 @@ interface components$2 {
14432
14770
  * breaking wire change for existing Pro clients (see ADR-0066).
14433
14771
  * @enum {string}
14434
14772
  */
14435
- JobStatus: "awaiting_upload" | "pending" | "processing" | "chunking" | "aggregating" | "completed" | "partial_success" | "failed" | "cancelled";
14773
+ JobStatus: "awaiting_upload" | "pending" | "processing" | "completed" | "partial_success" | "failed" | "cancelled";
14436
14774
  /** @description Summary of a job, as returned by `GET /v1/jobs` (list). */
14437
14775
  JobSummary: {
14438
14776
  /**
@@ -14558,12 +14896,12 @@ interface components$2 {
14558
14896
  * scores). The concrete shape is defined in `autotune-core`; here it
14559
14897
  * is opaque JSON.
14560
14898
  */
14561
- breakdown: Record<string, never>;
14899
+ breakdown: Record<string, unknown>;
14562
14900
  /**
14563
14901
  * @description The extraction configuration trialed for this entry. The concrete
14564
14902
  * shape is defined in `autotune-core`; here it is opaque JSON.
14565
14903
  */
14566
- config: Record<string, never>;
14904
+ config: Record<string, unknown>;
14567
14905
  /**
14568
14906
  * Format: double
14569
14907
  * @description Primary aggregate score for this configuration.
@@ -14975,7 +15313,7 @@ interface components$2 {
14975
15313
  /** @description Tesseract-specific configuration */
14976
15314
  tesseract_config?: components$2["schemas"]["TesseractConfig"];
14977
15315
  /** @description VLM (Vision Language Model) configuration */
14978
- vlm_config?: Record<string, never>;
15316
+ vlm_config?: Record<string, unknown>;
14979
15317
  /** @description VLM fallback policy for OCR operations */
14980
15318
  vlm_fallback?: components$2["schemas"]["VlmFallbackPolicy"];
14981
15319
  /** @description Custom Jinja2 prompt template for VLM OCR */
@@ -15021,7 +15359,7 @@ interface components$2 {
15021
15359
  /** @description Tesseract config override for this stage */
15022
15360
  tesseract_config?: components$2["schemas"]["TesseractConfig"];
15023
15361
  /** @description VLM config override for this stage */
15024
- vlm_config?: Record<string, never>;
15362
+ vlm_config?: Record<string, unknown>;
15025
15363
  };
15026
15364
  /** @description Quality thresholds for OCR fallback decisions. */
15027
15365
  OcrQualityThresholds: {
@@ -15142,7 +15480,7 @@ interface components$2 {
15142
15480
  preferred_call_mode: components$2["schemas"]["PresetCallMode"];
15143
15481
  sample?: components$2["schemas"]["PresetSampleRef"];
15144
15482
  /** @description JSON Schema (Draft 2020-12) describing the structured output shape. */
15145
- schema: Record<string, never>;
15483
+ schema: Record<string, unknown>;
15146
15484
  schema_name: string;
15147
15485
  system_prompt: string;
15148
15486
  tags?: string[];
@@ -15169,6 +15507,59 @@ interface components$2 {
15169
15507
  tags?: string[];
15170
15508
  version: string;
15171
15509
  };
15510
+ /** @description Document metadata for presigned upload (no bytes). */
15511
+ PresignDocumentInput: {
15512
+ /**
15513
+ * @description Per-file extraction config override.
15514
+ * Merged with batch-level `config` at confirm time. None = use batch default.
15515
+ */
15516
+ config?: components$2["schemas"]["FileExtractionConfig"];
15517
+ /** @description Original filename */
15518
+ filename: string;
15519
+ /** @description MIME type of the document */
15520
+ mime_type: string;
15521
+ };
15522
+ /** @description Request body for presigning upload URLs. */
15523
+ PresignUploadRequest: {
15524
+ /**
15525
+ * @description Batch-level extraction configuration (applied to all documents).
15526
+ * Opaque JSON — see the module doc comment for why.
15527
+ */
15528
+ config?: Record<string, unknown>;
15529
+ /** @description Document metadata (no file data) */
15530
+ documents: components$2["schemas"]["PresignDocumentInput"][];
15531
+ /** @description Webhook configuration for async result delivery */
15532
+ webhook?: components$2["schemas"]["WebhookConfig"];
15533
+ };
15534
+ /** @description Response from the presign endpoint. */
15535
+ PresignUploadResponse: {
15536
+ /**
15537
+ * Format: uuid
15538
+ * @description Batch ID to pass to the confirm endpoint.
15539
+ */
15540
+ batch_id: string;
15541
+ /** @description Per-document upload URLs */
15542
+ uploads: components$2["schemas"]["PresignedUploadInfo"][];
15543
+ };
15544
+ /** @description Info about a single presigned upload. */
15545
+ PresignedUploadInfo: {
15546
+ /**
15547
+ * Format: int64
15548
+ * @description Seconds until the URL expires
15549
+ */
15550
+ expires_in_secs: number;
15551
+ /**
15552
+ * Format: uuid
15553
+ * @description Job ID for this document
15554
+ */
15555
+ job_id: string;
15556
+ /** @description HTTP method to use (PUT) */
15557
+ method: string;
15558
+ /** @description Storage object key */
15559
+ object_key: string;
15560
+ /** @description Presigned URL to upload the document to */
15561
+ upload_url: string;
15562
+ };
15172
15563
  /** @description JSON-friendly mirror of vectorstore's internal `PrimaryScore`. */
15173
15564
  PrimaryScore: {
15174
15565
  /** @enum {string} */
@@ -15398,6 +15789,12 @@ interface components$2 {
15398
15789
  * credentials.
15399
15790
  */
15400
15791
  storage: string;
15792
+ /**
15793
+ * @description `ok` or `not_ready`: the embedded vector-index worker answered its own
15794
+ * readiness endpoint with success. A worker that answers not ready, or not
15795
+ * at all, is `not_ready`. Absent when the process runs without a worker.
15796
+ */
15797
+ worker?: string | null;
15401
15798
  };
15402
15799
  /** @description Readiness report: the process can serve traffic only when both checks pass. */
15403
15800
  ReadinessResponse: {
@@ -15456,7 +15853,7 @@ interface components$2 {
15456
15853
  */
15457
15854
  candidate_multiplier?: number | null;
15458
15855
  /** @description Filter expression (deserialized by the vectorstore Filter IR). */
15459
- filter?: Record<string, never>;
15856
+ filter?: Record<string, unknown>;
15460
15857
  /** @description Collapse to one chunk per document. */
15461
15858
  group_by_document?: boolean;
15462
15859
  /** @description Optional response field mask. */
@@ -15614,7 +16011,7 @@ interface components$2 {
15614
16011
  */
15615
16012
  preferred_call_mode: string;
15616
16013
  /** @description JSON Schema for the extraction result. */
15617
- schema: Record<string, never>;
16014
+ schema: Record<string, unknown>;
15618
16015
  /** @description Optional custom system prompt. */
15619
16016
  system_prompt?: string | null;
15620
16017
  /**
@@ -15701,7 +16098,7 @@ interface components$2 {
15701
16098
  * @description JSON Schema (draft-07) the structured output must conform to. Optional
15702
16099
  * only when `options.preset` or `options.saved_preset_id` supplies it.
15703
16100
  */
15704
- schema?: Record<string, never>;
16101
+ schema?: Record<string, unknown>;
15705
16102
  /** @description Optional human-readable schema description supplied to the LLM. */
15706
16103
  schema_description?: string | null;
15707
16104
  /** @description Schema name passed to the LLM's structured-output mode. Defaults to "extraction". */
@@ -15896,12 +16293,12 @@ interface components$2 {
15896
16293
  * @description The tuning profile artifact. The concrete `TuningProfile` shape is
15897
16294
  * defined in `autotune-core`; here it is opaque JSON.
15898
16295
  */
15899
- profile: Record<string, never>;
16296
+ profile: Record<string, unknown>;
15900
16297
  /**
15901
16298
  * @description Scores recorded for this profile at promotion time. The concrete
15902
16299
  * shape is defined in `autotune-core`; here it is opaque JSON.
15903
16300
  */
15904
- scores: Record<string, never>;
16301
+ scores: Record<string, unknown>;
15905
16302
  };
15906
16303
  /** @description Lightweight projection of a tuning profile (for listings). */
15907
16304
  TuningProfileSummary: {
@@ -15944,7 +16341,7 @@ interface components$2 {
15944
16341
  */
15945
16342
  preferred_call_mode: string;
15946
16343
  /** @description JSON Schema (Draft 2020-12) for the extraction result. */
15947
- schema: Record<string, never>;
16344
+ schema: Record<string, unknown>;
15948
16345
  /** @description Optional custom system prompt override. */
15949
16346
  system_prompt?: string | null;
15950
16347
  };
@@ -15967,10 +16364,64 @@ interface components$2 {
15967
16364
  * (`services/api::rest::types::CrawlConfig`) and is out of scope for
15968
16365
  * this convergence pass.
15969
16366
  */
15970
- crawl_config?: Record<string, never>;
16367
+ crawl_config?: Record<string, unknown>;
15971
16368
  /** @description URL to crawl and extract documents from. */
15972
16369
  url: string;
15973
16370
  };
16371
+ /** @description Usage statistics broken down by MIME type. */
16372
+ UsageByMimeType: {
16373
+ /**
16374
+ * Format: int32
16375
+ * @description Number of documents of this MIME type processed
16376
+ */
16377
+ documents: number;
16378
+ /**
16379
+ * Format: int32
16380
+ * @description Number of failed extractions for this MIME type
16381
+ */
16382
+ failed: number;
16383
+ /**
16384
+ * Format: int64
16385
+ * @description Total pages extracted from documents of this MIME type
16386
+ */
16387
+ pages: number;
16388
+ };
16389
+ /** @description Current period usage and quota information. */
16390
+ UsageResponse: {
16391
+ /** @description Usage breakdown by MIME type */
16392
+ by_mime_type: {
16393
+ [key: string]: components$2["schemas"]["UsageByMimeType"];
16394
+ };
16395
+ /** @description End of the reporting period (ISO 8601 date) */
16396
+ period_end: string;
16397
+ /** @description Start of the reporting period (ISO 8601 date) */
16398
+ period_start: string;
16399
+ /**
16400
+ * Format: int64
16401
+ * @description Monthly page quota limit (null = unlimited)
16402
+ */
16403
+ quota_limit?: number | null;
16404
+ /**
16405
+ * Format: int64
16406
+ * @description Remaining pages in monthly quota (null = unlimited)
16407
+ */
16408
+ quota_remaining?: number | null;
16409
+ /**
16410
+ * Format: int32
16411
+ * @description Total documents processed in the period
16412
+ */
16413
+ total_documents: number;
16414
+ /**
16415
+ * Format: int32
16416
+ * @description Total failed extractions in the period
16417
+ */
16418
+ total_failed: number;
16419
+ /**
16420
+ * Format: int64
16421
+ * @description Total pages extracted in the period
16422
+ */
16423
+ total_pages: number;
16424
+ };
15974
16425
  /** @description User information in the login response. */
15975
16426
  UserInfo: {
15976
16427
  /**
@@ -16071,7 +16522,7 @@ interface components$2 {
16071
16522
  * @description The extraction result, present only on `job.completed` and only when it
16072
16523
  * fits in the body. The shape is the `result` of `GET /v1/jobs/{id}`.
16073
16524
  */
16074
- results?: Record<string, never>;
16525
+ results?: Record<string, unknown>;
16075
16526
  /**
16076
16527
  * Format: date-time
16077
16528
  * @description RFC 3339 time at which the job reached the terminal status.
@@ -17081,30 +17532,28 @@ interface operations$1 {
17081
17532
  };
17082
17533
  };
17083
17534
  };
17084
- extract: {
17535
+ stream_crawl_events: {
17085
17536
  parameters: {
17086
17537
  query?: never;
17087
17538
  header?: never;
17088
- path?: never;
17089
- cookie?: never;
17090
- };
17091
- requestBody: {
17092
- content: {
17093
- "application/json": components$2["schemas"]["ExtractRequest"];
17094
- "multipart/form-data": components$2["schemas"]["ExtractMultipartForm"];
17539
+ path: {
17540
+ /** @description Crawl job ID (UUID) */
17541
+ crawl_job_id: string;
17095
17542
  };
17543
+ cookie?: never;
17096
17544
  };
17545
+ requestBody?: never;
17097
17546
  responses: {
17098
- /** @description Job(s) accepted */
17099
- 202: {
17547
+ /** @description Crawl events SSE stream */
17548
+ 200: {
17100
17549
  headers: {
17101
17550
  [name: string]: unknown;
17102
17551
  };
17103
17552
  content: {
17104
- "application/json": components$2["schemas"]["ExtractResponse"];
17553
+ "text/event-stream": components$2["schemas"]["CrawlEventV1"];
17105
17554
  };
17106
17555
  };
17107
- /** @description Invalid request */
17556
+ /** @description Invalid crawl job ID */
17108
17557
  400: {
17109
17558
  headers: {
17110
17559
  [name: string]: unknown;
@@ -17122,7 +17571,7 @@ interface operations$1 {
17122
17571
  "application/json": components$2["schemas"]["ErrorResponse"];
17123
17572
  };
17124
17573
  };
17125
- /** @description The API key is read-only and cannot use this method */
17574
+ /** @description Crawl job belongs to a different project */
17126
17575
  403: {
17127
17576
  headers: {
17128
17577
  [name: string]: unknown;
@@ -17131,7 +17580,7 @@ interface operations$1 {
17131
17580
  "application/json": components$2["schemas"]["ErrorResponse"];
17132
17581
  };
17133
17582
  };
17134
- /** @description Integration or project not visible to the caller */
17583
+ /** @description Crawl job not found */
17135
17584
  404: {
17136
17585
  headers: {
17137
17586
  [name: string]: unknown;
@@ -17140,17 +17589,8 @@ interface operations$1 {
17140
17589
  "application/json": components$2["schemas"]["ErrorResponse"];
17141
17590
  };
17142
17591
  };
17143
- /** @description Decoded document exceeds the configured upload limit */
17144
- 413: {
17145
- headers: {
17146
- [name: string]: unknown;
17147
- };
17148
- content: {
17149
- "application/json": components$2["schemas"]["ErrorResponse"];
17150
- };
17151
- };
17152
- /** @description Content-Type is neither application/json nor multipart/form-data (parsed as malformed JSON and answered 400) */
17153
- 415: {
17592
+ /** @description Request fails validation */
17593
+ 422: {
17154
17594
  headers: {
17155
17595
  [name: string]: unknown;
17156
17596
  };
@@ -17158,8 +17598,8 @@ interface operations$1 {
17158
17598
  "application/json": components$2["schemas"]["ErrorResponse"];
17159
17599
  };
17160
17600
  };
17161
- /** @description Request fails validation */
17162
- 422: {
17601
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
17602
+ 429: {
17163
17603
  headers: {
17164
17604
  [name: string]: unknown;
17165
17605
  };
@@ -17167,8 +17607,8 @@ interface operations$1 {
17167
17607
  "application/json": components$2["schemas"]["ErrorResponse"];
17168
17608
  };
17169
17609
  };
17170
- /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
17171
- 429: {
17610
+ /** @description Crawl extraction is not implemented on Xberg Pro yet */
17611
+ 501: {
17172
17612
  headers: {
17173
17613
  [name: string]: unknown;
17174
17614
  };
@@ -17178,32 +17618,29 @@ interface operations$1 {
17178
17618
  };
17179
17619
  };
17180
17620
  };
17181
- list_jobs: {
17621
+ submit_enrich: {
17182
17622
  parameters: {
17183
- query?: {
17184
- /** @description Page size. A value outside 1..=100 is rejected with a 400. */
17185
- limit?: number;
17186
- /** @description Number of items to skip. A negative value is rejected with a 400; a value above 1,000,000 is accepted but clamped to 1,000,000. */
17187
- offset?: number;
17188
- /** @description Project to read. Absent reads the credential's own project. */
17189
- project_id?: string;
17190
- };
17623
+ query?: never;
17191
17624
  header?: never;
17192
17625
  path?: never;
17193
17626
  cookie?: never;
17194
17627
  };
17195
- requestBody?: never;
17628
+ requestBody: {
17629
+ content: {
17630
+ "application/json": components$2["schemas"]["EnrichTextRequest"];
17631
+ };
17632
+ };
17196
17633
  responses: {
17197
- /** @description Jobs for the project */
17198
- 200: {
17634
+ /** @description Enrichment job accepted */
17635
+ 202: {
17199
17636
  headers: {
17200
17637
  [name: string]: unknown;
17201
17638
  };
17202
17639
  content: {
17203
- "application/json": components$2["schemas"]["ListJobsResponse"];
17640
+ "application/json": components$2["schemas"]["EnrichJobSubmitted"];
17204
17641
  };
17205
17642
  };
17206
- /** @description Invalid request */
17643
+ /** @description Text or labels exceed their limits */
17207
17644
  400: {
17208
17645
  headers: {
17209
17646
  [name: string]: unknown;
@@ -17221,8 +17658,17 @@ interface operations$1 {
17221
17658
  "application/json": components$2["schemas"]["ErrorResponse"];
17222
17659
  };
17223
17660
  };
17224
- /** @description Requested project not visible to the caller */
17225
- 404: {
17661
+ /** @description The request body is larger than this deployment accepts */
17662
+ 413: {
17663
+ headers: {
17664
+ [name: string]: unknown;
17665
+ };
17666
+ content: {
17667
+ "application/json": components$2["schemas"]["ErrorResponse"];
17668
+ };
17669
+ };
17670
+ /** @description The request body was not sent with Content-Type: application/json */
17671
+ 415: {
17226
17672
  headers: {
17227
17673
  [name: string]: unknown;
17228
17674
  };
@@ -17248,8 +17694,8 @@ interface operations$1 {
17248
17694
  "application/json": components$2["schemas"]["ErrorResponse"];
17249
17695
  };
17250
17696
  };
17251
- /** @description Persistence error */
17252
- 500: {
17697
+ /** @description Enrichment is not implemented on Xberg Pro yet */
17698
+ 501: {
17253
17699
  headers: {
17254
17700
  [name: string]: unknown;
17255
17701
  };
@@ -17259,31 +17705,28 @@ interface operations$1 {
17259
17705
  };
17260
17706
  };
17261
17707
  };
17262
- get_job: {
17708
+ get_enrich_status: {
17263
17709
  parameters: {
17264
- query?: {
17265
- /** @description Project to read. Absent reads the credential's own project. */
17266
- project_id?: string;
17267
- };
17710
+ query?: never;
17268
17711
  header?: never;
17269
17712
  path: {
17270
- /** @description Job ID (UUID) */
17271
- id: string;
17272
- };
17713
+ /** @description Enrichment job ID (ULID) */
17714
+ job_id: string;
17715
+ };
17273
17716
  cookie?: never;
17274
17717
  };
17275
17718
  requestBody?: never;
17276
17719
  responses: {
17277
- /** @description Job metadata */
17720
+ /** @description Job status, with the result when completed */
17278
17721
  200: {
17279
17722
  headers: {
17280
17723
  [name: string]: unknown;
17281
17724
  };
17282
17725
  content: {
17283
- "application/json": components$2["schemas"]["GetJobResponse"];
17726
+ "application/json": components$2["schemas"]["EnrichJobStatus"];
17284
17727
  };
17285
17728
  };
17286
- /** @description Invalid job ID */
17729
+ /** @description Job ID is not a ULID */
17287
17730
  400: {
17288
17731
  headers: {
17289
17732
  [name: string]: unknown;
@@ -17301,7 +17744,7 @@ interface operations$1 {
17301
17744
  "application/json": components$2["schemas"]["ErrorResponse"];
17302
17745
  };
17303
17746
  };
17304
- /** @description Job or project not visible to the caller */
17747
+ /** @description Job not found */
17305
17748
  404: {
17306
17749
  headers: {
17307
17750
  [name: string]: unknown;
@@ -17328,8 +17771,8 @@ interface operations$1 {
17328
17771
  "application/json": components$2["schemas"]["ErrorResponse"];
17329
17772
  };
17330
17773
  };
17331
- /** @description Persistence error */
17332
- 500: {
17774
+ /** @description Enrichment is not implemented on Xberg Pro yet */
17775
+ 501: {
17333
17776
  headers: {
17334
17777
  [name: string]: unknown;
17335
17778
  };
@@ -17339,29 +17782,30 @@ interface operations$1 {
17339
17782
  };
17340
17783
  };
17341
17784
  };
17342
- cancel_job: {
17785
+ extract: {
17343
17786
  parameters: {
17344
- query?: {
17345
- /** @description Project to mutate. Absent uses the credential's own project. */
17346
- project_id?: string;
17347
- };
17787
+ query?: never;
17348
17788
  header?: never;
17349
- path: {
17350
- /** @description Job ID (UUID) */
17351
- id: string;
17352
- };
17789
+ path?: never;
17353
17790
  cookie?: never;
17354
17791
  };
17355
- requestBody?: never;
17792
+ requestBody: {
17793
+ content: {
17794
+ "application/json": components$2["schemas"]["ExtractRequest"];
17795
+ "multipart/form-data": components$2["schemas"]["ExtractMultipartForm"];
17796
+ };
17797
+ };
17356
17798
  responses: {
17357
- /** @description Job cancelled or already terminal */
17358
- 204: {
17799
+ /** @description Job(s) accepted */
17800
+ 202: {
17359
17801
  headers: {
17360
17802
  [name: string]: unknown;
17361
17803
  };
17362
- content?: never;
17804
+ content: {
17805
+ "application/json": components$2["schemas"]["ExtractResponse"];
17806
+ };
17363
17807
  };
17364
- /** @description Invalid job ID */
17808
+ /** @description Invalid request */
17365
17809
  400: {
17366
17810
  headers: {
17367
17811
  [name: string]: unknown;
@@ -17379,7 +17823,16 @@ interface operations$1 {
17379
17823
  "application/json": components$2["schemas"]["ErrorResponse"];
17380
17824
  };
17381
17825
  };
17382
- /** @description Job or project not visible to the caller */
17826
+ /** @description The API key is read-only and cannot use this method */
17827
+ 403: {
17828
+ headers: {
17829
+ [name: string]: unknown;
17830
+ };
17831
+ content: {
17832
+ "application/json": components$2["schemas"]["ErrorResponse"];
17833
+ };
17834
+ };
17835
+ /** @description Integration or project not visible to the caller */
17383
17836
  404: {
17384
17837
  headers: {
17385
17838
  [name: string]: unknown;
@@ -17388,8 +17841,8 @@ interface operations$1 {
17388
17841
  "application/json": components$2["schemas"]["ErrorResponse"];
17389
17842
  };
17390
17843
  };
17391
- /** @description Request fails validation */
17392
- 422: {
17844
+ /** @description Decoded document exceeds the configured upload limit */
17845
+ 413: {
17393
17846
  headers: {
17394
17847
  [name: string]: unknown;
17395
17848
  };
@@ -17397,8 +17850,8 @@ interface operations$1 {
17397
17850
  "application/json": components$2["schemas"]["ErrorResponse"];
17398
17851
  };
17399
17852
  };
17400
- /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
17401
- 429: {
17853
+ /** @description Content-Type is neither application/json nor multipart/form-data (parsed as malformed JSON and answered 400) */
17854
+ 415: {
17402
17855
  headers: {
17403
17856
  [name: string]: unknown;
17404
17857
  };
@@ -17406,8 +17859,17 @@ interface operations$1 {
17406
17859
  "application/json": components$2["schemas"]["ErrorResponse"];
17407
17860
  };
17408
17861
  };
17409
- /** @description Cancellation failed */
17410
- 500: {
17862
+ /** @description Request fails validation */
17863
+ 422: {
17864
+ headers: {
17865
+ [name: string]: unknown;
17866
+ };
17867
+ content: {
17868
+ "application/json": components$2["schemas"]["ErrorResponse"];
17869
+ };
17870
+ };
17871
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
17872
+ 429: {
17411
17873
  headers: {
17412
17874
  [name: string]: unknown;
17413
17875
  };
@@ -17417,31 +17879,32 @@ interface operations$1 {
17417
17879
  };
17418
17880
  };
17419
17881
  };
17420
- get_job_result: {
17882
+ list_jobs: {
17421
17883
  parameters: {
17422
17884
  query?: {
17885
+ /** @description Page size. A value outside 1..=100 is rejected with a 400. */
17886
+ limit?: number;
17887
+ /** @description Number of items to skip. A negative value is rejected with a 400; a value above 1,000,000 is accepted but clamped to 1,000,000. */
17888
+ offset?: number;
17423
17889
  /** @description Project to read. Absent reads the credential's own project. */
17424
17890
  project_id?: string;
17425
17891
  };
17426
17892
  header?: never;
17427
- path: {
17428
- /** @description Job ID (UUID) */
17429
- id: string;
17430
- };
17893
+ path?: never;
17431
17894
  cookie?: never;
17432
17895
  };
17433
17896
  requestBody?: never;
17434
17897
  responses: {
17435
- /** @description Extraction result */
17898
+ /** @description Jobs for the project */
17436
17899
  200: {
17437
17900
  headers: {
17438
17901
  [name: string]: unknown;
17439
17902
  };
17440
17903
  content: {
17441
- "application/json": components$2["schemas"]["JobResult"];
17904
+ "application/json": components$2["schemas"]["ListJobsResponse"];
17442
17905
  };
17443
17906
  };
17444
- /** @description Invalid job ID */
17907
+ /** @description Invalid request */
17445
17908
  400: {
17446
17909
  headers: {
17447
17910
  [name: string]: unknown;
@@ -17459,7 +17922,7 @@ interface operations$1 {
17459
17922
  "application/json": components$2["schemas"]["ErrorResponse"];
17460
17923
  };
17461
17924
  };
17462
- /** @description Job or project not visible to the caller */
17925
+ /** @description Requested project not visible to the caller */
17463
17926
  404: {
17464
17927
  headers: {
17465
17928
  [name: string]: unknown;
@@ -17468,15 +17931,6 @@ interface operations$1 {
17468
17931
  "application/json": components$2["schemas"]["ErrorResponse"];
17469
17932
  };
17470
17933
  };
17471
- /** @description Job has not reached a terminal successful state */
17472
- 409: {
17473
- headers: {
17474
- [name: string]: unknown;
17475
- };
17476
- content: {
17477
- "application/json": components$2["schemas"]["ErrorResponse"];
17478
- };
17479
- };
17480
17934
  /** @description Request fails validation */
17481
17935
  422: {
17482
17936
  headers: {
@@ -17495,7 +17949,7 @@ interface operations$1 {
17495
17949
  "application/json": components$2["schemas"]["ErrorResponse"];
17496
17950
  };
17497
17951
  };
17498
- /** @description Persistence or storage error */
17952
+ /** @description Persistence error */
17499
17953
  500: {
17500
17954
  headers: {
17501
17955
  [name: string]: unknown;
@@ -17506,30 +17960,31 @@ interface operations$1 {
17506
17960
  };
17507
17961
  };
17508
17962
  };
17509
- oauth_callback: {
17963
+ get_job: {
17510
17964
  parameters: {
17511
17965
  query?: {
17512
- /** @description Authorization code from the provider */
17513
- code?: string;
17514
- /** @description Signed state token issued by the connect call */
17515
- state?: string;
17516
- /** @description Provider error code when the user denied access */
17517
- error?: string;
17966
+ /** @description Project to read. Absent reads the credential's own project. */
17967
+ project_id?: string;
17518
17968
  };
17519
17969
  header?: never;
17520
- path?: never;
17970
+ path: {
17971
+ /** @description Job ID (UUID) */
17972
+ id: string;
17973
+ };
17521
17974
  cookie?: never;
17522
17975
  };
17523
17976
  requestBody?: never;
17524
17977
  responses: {
17525
- /** @description Redirect to the dashboard landing URL, on success and on a provider-reported denial */
17526
- 303: {
17978
+ /** @description Job metadata */
17979
+ 200: {
17527
17980
  headers: {
17528
17981
  [name: string]: unknown;
17529
17982
  };
17530
- content?: never;
17983
+ content: {
17984
+ "application/json": components$2["schemas"]["GetJobResponse"];
17985
+ };
17531
17986
  };
17532
- /** @description Missing code or state */
17987
+ /** @description Invalid job ID */
17533
17988
  400: {
17534
17989
  headers: {
17535
17990
  [name: string]: unknown;
@@ -17538,8 +17993,8 @@ interface operations$1 {
17538
17993
  "application/json": components$2["schemas"]["ErrorResponse"];
17539
17994
  };
17540
17995
  };
17541
- /** @description Request fails validation */
17542
- 422: {
17996
+ /** @description Unauthorized */
17997
+ 401: {
17543
17998
  headers: {
17544
17999
  [name: string]: unknown;
17545
18000
  };
@@ -17547,8 +18002,8 @@ interface operations$1 {
17547
18002
  "application/json": components$2["schemas"]["ErrorResponse"];
17548
18003
  };
17549
18004
  };
17550
- /** @description Callback rate limit exceeded for this client address */
17551
- 429: {
18005
+ /** @description Job or project not visible to the caller */
18006
+ 404: {
17552
18007
  headers: {
17553
18008
  [name: string]: unknown;
17554
18009
  };
@@ -17556,8 +18011,8 @@ interface operations$1 {
17556
18011
  "application/json": components$2["schemas"]["ErrorResponse"];
17557
18012
  };
17558
18013
  };
17559
- /** @description The code exchange failed; the response carries no detail about the flow */
17560
- 500: {
18014
+ /** @description Request fails validation */
18015
+ 422: {
17561
18016
  headers: {
17562
18017
  [name: string]: unknown;
17563
18018
  };
@@ -17565,8 +18020,17 @@ interface operations$1 {
17565
18020
  "application/json": components$2["schemas"]["ErrorResponse"];
17566
18021
  };
17567
18022
  };
17568
- /** @description Integration hub is not configured */
17569
- 503: {
18023
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
18024
+ 429: {
18025
+ headers: {
18026
+ [name: string]: unknown;
18027
+ };
18028
+ content: {
18029
+ "application/json": components$2["schemas"]["ErrorResponse"];
18030
+ };
18031
+ };
18032
+ /** @description Persistence error */
18033
+ 500: {
17570
18034
  headers: {
17571
18035
  [name: string]: unknown;
17572
18036
  };
@@ -17576,25 +18040,29 @@ interface operations$1 {
17576
18040
  };
17577
18041
  };
17578
18042
  };
17579
- list_presets: {
18043
+ cancel_job: {
17580
18044
  parameters: {
17581
- query?: never;
18045
+ query?: {
18046
+ /** @description Project to mutate. Absent uses the credential's own project. */
18047
+ project_id?: string;
18048
+ };
17582
18049
  header?: never;
17583
- path?: never;
18050
+ path: {
18051
+ /** @description Job ID (UUID) */
18052
+ id: string;
18053
+ };
17584
18054
  cookie?: never;
17585
18055
  };
17586
18056
  requestBody?: never;
17587
18057
  responses: {
17588
- /** @description Curated preset library */
17589
- 200: {
18058
+ /** @description Job cancelled or already terminal */
18059
+ 204: {
17590
18060
  headers: {
17591
18061
  [name: string]: unknown;
17592
18062
  };
17593
- content: {
17594
- "application/json": components$2["schemas"]["PresetSummary"][];
17595
- };
18063
+ content?: never;
17596
18064
  };
17597
- /** @description Malformed request */
18065
+ /** @description Invalid job ID */
17598
18066
  400: {
17599
18067
  headers: {
17600
18068
  [name: string]: unknown;
@@ -17603,8 +18071,8 @@ interface operations$1 {
17603
18071
  "application/json": components$2["schemas"]["ErrorResponse"];
17604
18072
  };
17605
18073
  };
17606
- /** @description Request fails validation */
17607
- 422: {
18074
+ /** @description Unauthorized */
18075
+ 401: {
17608
18076
  headers: {
17609
18077
  [name: string]: unknown;
17610
18078
  };
@@ -17612,31 +18080,17 @@ interface operations$1 {
17612
18080
  "application/json": components$2["schemas"]["ErrorResponse"];
17613
18081
  };
17614
18082
  };
17615
- };
17616
- };
17617
- get_preset: {
17618
- parameters: {
17619
- query?: never;
17620
- header?: never;
17621
- path: {
17622
- /** @description Preset identifier */
17623
- id: string;
17624
- };
17625
- cookie?: never;
17626
- };
17627
- requestBody?: never;
17628
- responses: {
17629
- /** @description Preset detail */
17630
- 200: {
18083
+ /** @description Job or project not visible to the caller */
18084
+ 404: {
17631
18085
  headers: {
17632
18086
  [name: string]: unknown;
17633
18087
  };
17634
18088
  content: {
17635
- "application/json": components$2["schemas"]["PresetDetail"];
18089
+ "application/json": components$2["schemas"]["ErrorResponse"];
17636
18090
  };
17637
18091
  };
17638
- /** @description Malformed request */
17639
- 400: {
18092
+ /** @description Request fails validation */
18093
+ 422: {
17640
18094
  headers: {
17641
18095
  [name: string]: unknown;
17642
18096
  };
@@ -17644,8 +18098,8 @@ interface operations$1 {
17644
18098
  "application/json": components$2["schemas"]["ErrorResponse"];
17645
18099
  };
17646
18100
  };
17647
- /** @description Preset not found */
17648
- 404: {
18101
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
18102
+ 429: {
17649
18103
  headers: {
17650
18104
  [name: string]: unknown;
17651
18105
  };
@@ -17653,8 +18107,8 @@ interface operations$1 {
17653
18107
  "application/json": components$2["schemas"]["ErrorResponse"];
17654
18108
  };
17655
18109
  };
17656
- /** @description Request fails validation */
17657
- 422: {
18110
+ /** @description Cancellation failed */
18111
+ 500: {
17658
18112
  headers: {
17659
18113
  [name: string]: unknown;
17660
18114
  };
@@ -17664,28 +18118,31 @@ interface operations$1 {
17664
18118
  };
17665
18119
  };
17666
18120
  };
17667
- get_preset_sample: {
18121
+ get_job_result: {
17668
18122
  parameters: {
17669
- query?: never;
18123
+ query?: {
18124
+ /** @description Project to read. Absent reads the credential's own project. */
18125
+ project_id?: string;
18126
+ };
17670
18127
  header?: never;
17671
18128
  path: {
17672
- /** @description Preset identifier */
18129
+ /** @description Job ID (UUID) */
17673
18130
  id: string;
17674
- /** @description Sample file name */
17675
- name: string;
17676
18131
  };
17677
18132
  cookie?: never;
17678
18133
  };
17679
18134
  requestBody?: never;
17680
18135
  responses: {
17681
- /** @description Sample bytes */
18136
+ /** @description Extraction result */
17682
18137
  200: {
17683
18138
  headers: {
17684
18139
  [name: string]: unknown;
17685
18140
  };
17686
- content?: never;
18141
+ content: {
18142
+ "application/json": components$2["schemas"]["JobResult"];
18143
+ };
17687
18144
  };
17688
- /** @description Malformed request */
18145
+ /** @description Invalid job ID */
17689
18146
  400: {
17690
18147
  headers: {
17691
18148
  [name: string]: unknown;
@@ -17694,7 +18151,16 @@ interface operations$1 {
17694
18151
  "application/json": components$2["schemas"]["ErrorResponse"];
17695
18152
  };
17696
18153
  };
17697
- /** @description Preset or sample not found */
18154
+ /** @description Unauthorized */
18155
+ 401: {
18156
+ headers: {
18157
+ [name: string]: unknown;
18158
+ };
18159
+ content: {
18160
+ "application/json": components$2["schemas"]["ErrorResponse"];
18161
+ };
18162
+ };
18163
+ /** @description Job or project not visible to the caller */
17698
18164
  404: {
17699
18165
  headers: {
17700
18166
  [name: string]: unknown;
@@ -17703,6 +18169,15 @@ interface operations$1 {
17703
18169
  "application/json": components$2["schemas"]["ErrorResponse"];
17704
18170
  };
17705
18171
  };
18172
+ /** @description Job has not reached a terminal successful state */
18173
+ 409: {
18174
+ headers: {
18175
+ [name: string]: unknown;
18176
+ };
18177
+ content: {
18178
+ "application/json": components$2["schemas"]["ErrorResponse"];
18179
+ };
18180
+ };
17706
18181
  /** @description Request fails validation */
17707
18182
  422: {
17708
18183
  headers: {
@@ -17712,41 +18187,50 @@ interface operations$1 {
17712
18187
  "application/json": components$2["schemas"]["ErrorResponse"];
17713
18188
  };
17714
18189
  };
17715
- };
17716
- };
17717
- list_projects: {
17718
- parameters: {
17719
- query?: {
17720
- /**
17721
- * @description Page size. A value outside 1..=1000 is rejected with a 400, on both
17722
- * tiers.
17723
- * @example 100
17724
- */
17725
- limit?: number;
17726
- /**
17727
- * @description Number of items to skip. A negative value is rejected with a 400; a
17728
- * value above 1,000,000 is accepted but clamped to 1,000,000, which
17729
- * selects an empty page rather than erroring.
17730
- * @example 0
17731
- */
17732
- offset?: number;
18190
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
18191
+ 429: {
18192
+ headers: {
18193
+ [name: string]: unknown;
18194
+ };
18195
+ content: {
18196
+ "application/json": components$2["schemas"]["ErrorResponse"];
18197
+ };
18198
+ };
18199
+ /** @description Persistence or storage error */
18200
+ 500: {
18201
+ headers: {
18202
+ [name: string]: unknown;
18203
+ };
18204
+ content: {
18205
+ "application/json": components$2["schemas"]["ErrorResponse"];
18206
+ };
17733
18207
  };
18208
+ };
18209
+ };
18210
+ get_job_page: {
18211
+ parameters: {
18212
+ query?: never;
17734
18213
  header?: never;
17735
- path?: never;
18214
+ path: {
18215
+ /** @description Extraction job ID (UUID) */
18216
+ job_id: string;
18217
+ /** @description 1-indexed page number */
18218
+ page_number: number;
18219
+ };
17736
18220
  cookie?: never;
17737
18221
  };
17738
18222
  requestBody?: never;
17739
18223
  responses: {
17740
- /** @description Projects visible to the caller */
18224
+ /** @description Page PNG image */
17741
18225
  200: {
17742
18226
  headers: {
17743
18227
  [name: string]: unknown;
17744
18228
  };
17745
18229
  content: {
17746
- "application/json": components$2["schemas"]["ListProjectsResponse"];
18230
+ "image/png": unknown;
17747
18231
  };
17748
18232
  };
17749
- /** @description Invalid request */
18233
+ /** @description Invalid job ID or page number */
17750
18234
  400: {
17751
18235
  headers: {
17752
18236
  [name: string]: unknown;
@@ -17764,8 +18248,8 @@ interface operations$1 {
17764
18248
  "application/json": components$2["schemas"]["ErrorResponse"];
17765
18249
  };
17766
18250
  };
17767
- /** @description Forbidden */
17768
- 403: {
18251
+ /** @description Job or page not found */
18252
+ 404: {
17769
18253
  headers: {
17770
18254
  [name: string]: unknown;
17771
18255
  };
@@ -17791,8 +18275,8 @@ interface operations$1 {
17791
18275
  "application/json": components$2["schemas"]["ErrorResponse"];
17792
18276
  };
17793
18277
  };
17794
- /** @description Persistence error */
17795
- 500: {
18278
+ /** @description Page rasters are not implemented on Xberg Pro yet */
18279
+ 501: {
17796
18280
  headers: {
17797
18281
  [name: string]: unknown;
17798
18282
  };
@@ -17802,30 +18286,42 @@ interface operations$1 {
17802
18286
  };
17803
18287
  };
17804
18288
  };
17805
- create_project: {
18289
+ oauth_callback: {
17806
18290
  parameters: {
17807
- query?: never;
18291
+ query?: {
18292
+ /** @description Authorization code from the provider */
18293
+ code?: string;
18294
+ /** @description Signed state token issued by the connect call */
18295
+ state?: string;
18296
+ /** @description Provider error code when the user denied access */
18297
+ error?: string;
18298
+ };
17808
18299
  header?: never;
17809
18300
  path?: never;
17810
18301
  cookie?: never;
17811
18302
  };
17812
- requestBody: {
17813
- content: {
17814
- "application/json": components$2["schemas"]["CreateProjectRequest"];
17815
- };
17816
- };
18303
+ requestBody?: never;
17817
18304
  responses: {
17818
- /** @description Project created */
17819
- 201: {
18305
+ /** @description Redirect to the dashboard landing URL, on success and on a provider-reported denial */
18306
+ 303: {
18307
+ headers: {
18308
+ /** @description Dashboard landing URL */
18309
+ Location?: string;
18310
+ [name: string]: unknown;
18311
+ };
18312
+ content?: never;
18313
+ };
18314
+ /** @description Missing code or state */
18315
+ 400: {
17820
18316
  headers: {
17821
18317
  [name: string]: unknown;
17822
18318
  };
17823
18319
  content: {
17824
- "application/json": components$2["schemas"]["ProjectResponse"];
18320
+ "application/json": components$2["schemas"]["ErrorResponse"];
17825
18321
  };
17826
18322
  };
17827
- /** @description Invalid request */
17828
- 400: {
18323
+ /** @description Request fails validation */
18324
+ 422: {
17829
18325
  headers: {
17830
18326
  [name: string]: unknown;
17831
18327
  };
@@ -17833,8 +18329,8 @@ interface operations$1 {
17833
18329
  "application/json": components$2["schemas"]["ErrorResponse"];
17834
18330
  };
17835
18331
  };
17836
- /** @description Unauthorized */
17837
- 401: {
18332
+ /** @description Callback rate limit exceeded for this client address */
18333
+ 429: {
17838
18334
  headers: {
17839
18335
  [name: string]: unknown;
17840
18336
  };
@@ -17842,8 +18338,8 @@ interface operations$1 {
17842
18338
  "application/json": components$2["schemas"]["ErrorResponse"];
17843
18339
  };
17844
18340
  };
17845
- /** @description Forbidden */
17846
- 403: {
18341
+ /** @description The code exchange failed; the response carries no detail about the flow */
18342
+ 500: {
17847
18343
  headers: {
17848
18344
  [name: string]: unknown;
17849
18345
  };
@@ -17851,8 +18347,8 @@ interface operations$1 {
17851
18347
  "application/json": components$2["schemas"]["ErrorResponse"];
17852
18348
  };
17853
18349
  };
17854
- /** @description Project slug already exists */
17855
- 409: {
18350
+ /** @description Integration hub is not configured */
18351
+ 503: {
17856
18352
  headers: {
17857
18353
  [name: string]: unknown;
17858
18354
  };
@@ -17860,8 +18356,28 @@ interface operations$1 {
17860
18356
  "application/json": components$2["schemas"]["ErrorResponse"];
17861
18357
  };
17862
18358
  };
17863
- /** @description The request body is larger than this deployment accepts */
17864
- 413: {
18359
+ };
18360
+ };
18361
+ list_presets: {
18362
+ parameters: {
18363
+ query?: never;
18364
+ header?: never;
18365
+ path?: never;
18366
+ cookie?: never;
18367
+ };
18368
+ requestBody?: never;
18369
+ responses: {
18370
+ /** @description Curated preset library */
18371
+ 200: {
18372
+ headers: {
18373
+ [name: string]: unknown;
18374
+ };
18375
+ content: {
18376
+ "application/json": components$2["schemas"]["PresetSummary"][];
18377
+ };
18378
+ };
18379
+ /** @description Malformed request */
18380
+ 400: {
17865
18381
  headers: {
17866
18382
  [name: string]: unknown;
17867
18383
  };
@@ -17869,8 +18385,49 @@ interface operations$1 {
17869
18385
  "application/json": components$2["schemas"]["ErrorResponse"];
17870
18386
  };
17871
18387
  };
17872
- /** @description The request body was not sent with Content-Type: application/json */
17873
- 415: {
18388
+ /** @description Request fails validation */
18389
+ 422: {
18390
+ headers: {
18391
+ [name: string]: unknown;
18392
+ };
18393
+ content: {
18394
+ "application/json": components$2["schemas"]["ErrorResponse"];
18395
+ };
18396
+ };
18397
+ };
18398
+ };
18399
+ get_preset: {
18400
+ parameters: {
18401
+ query?: never;
18402
+ header?: never;
18403
+ path: {
18404
+ /** @description Preset identifier */
18405
+ id: string;
18406
+ };
18407
+ cookie?: never;
18408
+ };
18409
+ requestBody?: never;
18410
+ responses: {
18411
+ /** @description Preset detail */
18412
+ 200: {
18413
+ headers: {
18414
+ [name: string]: unknown;
18415
+ };
18416
+ content: {
18417
+ "application/json": components$2["schemas"]["PresetDetail"];
18418
+ };
18419
+ };
18420
+ /** @description Malformed request */
18421
+ 400: {
18422
+ headers: {
18423
+ [name: string]: unknown;
18424
+ };
18425
+ content: {
18426
+ "application/json": components$2["schemas"]["ErrorResponse"];
18427
+ };
18428
+ };
18429
+ /** @description Preset not found */
18430
+ 404: {
17874
18431
  headers: {
17875
18432
  [name: string]: unknown;
17876
18433
  };
@@ -17887,8 +18444,33 @@ interface operations$1 {
17887
18444
  "application/json": components$2["schemas"]["ErrorResponse"];
17888
18445
  };
17889
18446
  };
17890
- /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
17891
- 429: {
18447
+ };
18448
+ };
18449
+ get_preset_sample: {
18450
+ parameters: {
18451
+ query?: never;
18452
+ header?: never;
18453
+ path: {
18454
+ /** @description Preset identifier */
18455
+ id: string;
18456
+ /** @description Sample file name */
18457
+ name: string;
18458
+ };
18459
+ cookie?: never;
18460
+ };
18461
+ requestBody?: never;
18462
+ responses: {
18463
+ /** @description Sample bytes */
18464
+ 200: {
18465
+ headers: {
18466
+ [name: string]: unknown;
18467
+ };
18468
+ content: {
18469
+ "*/*": string;
18470
+ };
18471
+ };
18472
+ /** @description Malformed request */
18473
+ 400: {
17892
18474
  headers: {
17893
18475
  [name: string]: unknown;
17894
18476
  };
@@ -17896,8 +18478,17 @@ interface operations$1 {
17896
18478
  "application/json": components$2["schemas"]["ErrorResponse"];
17897
18479
  };
17898
18480
  };
17899
- /** @description Persistence error */
17900
- 500: {
18481
+ /** @description Preset or sample not found */
18482
+ 404: {
18483
+ headers: {
18484
+ [name: string]: unknown;
18485
+ };
18486
+ content: {
18487
+ "application/json": components$2["schemas"]["ErrorResponse"];
18488
+ };
18489
+ };
18490
+ /** @description Request fails validation */
18491
+ 422: {
17901
18492
  headers: {
17902
18493
  [name: string]: unknown;
17903
18494
  };
@@ -17907,7 +18498,7 @@ interface operations$1 {
17907
18498
  };
17908
18499
  };
17909
18500
  };
17910
- list_api_keys: {
18501
+ list_projects: {
17911
18502
  parameters: {
17912
18503
  query?: {
17913
18504
  /**
@@ -17925,24 +18516,21 @@ interface operations$1 {
17925
18516
  offset?: number;
17926
18517
  };
17927
18518
  header?: never;
17928
- path: {
17929
- /** @description Project ID (UUID) */
17930
- project_id: string;
17931
- };
18519
+ path?: never;
17932
18520
  cookie?: never;
17933
18521
  };
17934
18522
  requestBody?: never;
17935
18523
  responses: {
17936
- /** @description API keys for the project */
18524
+ /** @description Projects visible to the caller */
17937
18525
  200: {
17938
18526
  headers: {
17939
18527
  [name: string]: unknown;
17940
18528
  };
17941
18529
  content: {
17942
- "application/json": components$2["schemas"]["ListApiKeysResponse"];
18530
+ "application/json": components$2["schemas"]["ListProjectsResponse"];
17943
18531
  };
17944
18532
  };
17945
- /** @description Invalid project ID */
18533
+ /** @description Invalid request */
17946
18534
  400: {
17947
18535
  headers: {
17948
18536
  [name: string]: unknown;
@@ -17969,15 +18557,6 @@ interface operations$1 {
17969
18557
  "application/json": components$2["schemas"]["ErrorResponse"];
17970
18558
  };
17971
18559
  };
17972
- /** @description Project not found */
17973
- 404: {
17974
- headers: {
17975
- [name: string]: unknown;
17976
- };
17977
- content: {
17978
- "application/json": components$2["schemas"]["ErrorResponse"];
17979
- };
17980
- };
17981
18560
  /** @description Request fails validation */
17982
18561
  422: {
17983
18562
  headers: {
@@ -18007,32 +18586,29 @@ interface operations$1 {
18007
18586
  };
18008
18587
  };
18009
18588
  };
18010
- create_api_key: {
18589
+ create_project: {
18011
18590
  parameters: {
18012
18591
  query?: never;
18013
18592
  header?: never;
18014
- path: {
18015
- /** @description Project ID (UUID) */
18016
- project_id: string;
18017
- };
18593
+ path?: never;
18018
18594
  cookie?: never;
18019
18595
  };
18020
18596
  requestBody: {
18021
18597
  content: {
18022
- "application/json": components$2["schemas"]["CreateApiKeyRequest"];
18598
+ "application/json": components$2["schemas"]["CreateProjectRequest"];
18023
18599
  };
18024
18600
  };
18025
18601
  responses: {
18026
- /** @description API key created; the plaintext key is returned once */
18602
+ /** @description Project created */
18027
18603
  201: {
18028
18604
  headers: {
18029
18605
  [name: string]: unknown;
18030
18606
  };
18031
18607
  content: {
18032
- "application/json": components$2["schemas"]["CreateApiKeyResponse"];
18608
+ "application/json": components$2["schemas"]["ProjectResponse"];
18033
18609
  };
18034
18610
  };
18035
- /** @description Invalid project ID or request */
18611
+ /** @description Invalid request */
18036
18612
  400: {
18037
18613
  headers: {
18038
18614
  [name: string]: unknown;
@@ -18059,8 +18635,8 @@ interface operations$1 {
18059
18635
  "application/json": components$2["schemas"]["ErrorResponse"];
18060
18636
  };
18061
18637
  };
18062
- /** @description Project not found */
18063
- 404: {
18638
+ /** @description Project slug already exists */
18639
+ 409: {
18064
18640
  headers: {
18065
18641
  [name: string]: unknown;
18066
18642
  };
@@ -18115,11 +18691,219 @@ interface operations$1 {
18115
18691
  };
18116
18692
  };
18117
18693
  };
18118
- revoke_api_key: {
18694
+ list_api_keys: {
18119
18695
  parameters: {
18120
- query?: never;
18121
- header?: never;
18122
- path: {
18696
+ query?: {
18697
+ /**
18698
+ * @description Page size. A value outside 1..=1000 is rejected with a 400, on both
18699
+ * tiers.
18700
+ * @example 100
18701
+ */
18702
+ limit?: number;
18703
+ /**
18704
+ * @description Number of items to skip. A negative value is rejected with a 400; a
18705
+ * value above 1,000,000 is accepted but clamped to 1,000,000, which
18706
+ * selects an empty page rather than erroring.
18707
+ * @example 0
18708
+ */
18709
+ offset?: number;
18710
+ };
18711
+ header?: never;
18712
+ path: {
18713
+ /** @description Project ID (UUID) */
18714
+ project_id: string;
18715
+ };
18716
+ cookie?: never;
18717
+ };
18718
+ requestBody?: never;
18719
+ responses: {
18720
+ /** @description API keys for the project */
18721
+ 200: {
18722
+ headers: {
18723
+ [name: string]: unknown;
18724
+ };
18725
+ content: {
18726
+ "application/json": components$2["schemas"]["ListApiKeysResponse"];
18727
+ };
18728
+ };
18729
+ /** @description Invalid project ID */
18730
+ 400: {
18731
+ headers: {
18732
+ [name: string]: unknown;
18733
+ };
18734
+ content: {
18735
+ "application/json": components$2["schemas"]["ErrorResponse"];
18736
+ };
18737
+ };
18738
+ /** @description Unauthorized */
18739
+ 401: {
18740
+ headers: {
18741
+ [name: string]: unknown;
18742
+ };
18743
+ content: {
18744
+ "application/json": components$2["schemas"]["ErrorResponse"];
18745
+ };
18746
+ };
18747
+ /** @description Forbidden */
18748
+ 403: {
18749
+ headers: {
18750
+ [name: string]: unknown;
18751
+ };
18752
+ content: {
18753
+ "application/json": components$2["schemas"]["ErrorResponse"];
18754
+ };
18755
+ };
18756
+ /** @description Project not found */
18757
+ 404: {
18758
+ headers: {
18759
+ [name: string]: unknown;
18760
+ };
18761
+ content: {
18762
+ "application/json": components$2["schemas"]["ErrorResponse"];
18763
+ };
18764
+ };
18765
+ /** @description Request fails validation */
18766
+ 422: {
18767
+ headers: {
18768
+ [name: string]: unknown;
18769
+ };
18770
+ content: {
18771
+ "application/json": components$2["schemas"]["ErrorResponse"];
18772
+ };
18773
+ };
18774
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
18775
+ 429: {
18776
+ headers: {
18777
+ [name: string]: unknown;
18778
+ };
18779
+ content: {
18780
+ "application/json": components$2["schemas"]["ErrorResponse"];
18781
+ };
18782
+ };
18783
+ /** @description Persistence error */
18784
+ 500: {
18785
+ headers: {
18786
+ [name: string]: unknown;
18787
+ };
18788
+ content: {
18789
+ "application/json": components$2["schemas"]["ErrorResponse"];
18790
+ };
18791
+ };
18792
+ };
18793
+ };
18794
+ create_api_key: {
18795
+ parameters: {
18796
+ query?: never;
18797
+ header?: never;
18798
+ path: {
18799
+ /** @description Project ID (UUID) */
18800
+ project_id: string;
18801
+ };
18802
+ cookie?: never;
18803
+ };
18804
+ requestBody: {
18805
+ content: {
18806
+ "application/json": components$2["schemas"]["CreateApiKeyRequest"];
18807
+ };
18808
+ };
18809
+ responses: {
18810
+ /** @description API key created; the plaintext key is returned once */
18811
+ 201: {
18812
+ headers: {
18813
+ [name: string]: unknown;
18814
+ };
18815
+ content: {
18816
+ "application/json": components$2["schemas"]["CreateApiKeyResponse"];
18817
+ };
18818
+ };
18819
+ /** @description Invalid project ID or request */
18820
+ 400: {
18821
+ headers: {
18822
+ [name: string]: unknown;
18823
+ };
18824
+ content: {
18825
+ "application/json": components$2["schemas"]["ErrorResponse"];
18826
+ };
18827
+ };
18828
+ /** @description Unauthorized */
18829
+ 401: {
18830
+ headers: {
18831
+ [name: string]: unknown;
18832
+ };
18833
+ content: {
18834
+ "application/json": components$2["schemas"]["ErrorResponse"];
18835
+ };
18836
+ };
18837
+ /** @description Forbidden */
18838
+ 403: {
18839
+ headers: {
18840
+ [name: string]: unknown;
18841
+ };
18842
+ content: {
18843
+ "application/json": components$2["schemas"]["ErrorResponse"];
18844
+ };
18845
+ };
18846
+ /** @description Project not found */
18847
+ 404: {
18848
+ headers: {
18849
+ [name: string]: unknown;
18850
+ };
18851
+ content: {
18852
+ "application/json": components$2["schemas"]["ErrorResponse"];
18853
+ };
18854
+ };
18855
+ /** @description The request body is larger than this deployment accepts */
18856
+ 413: {
18857
+ headers: {
18858
+ [name: string]: unknown;
18859
+ };
18860
+ content: {
18861
+ "application/json": components$2["schemas"]["ErrorResponse"];
18862
+ };
18863
+ };
18864
+ /** @description The request body was not sent with Content-Type: application/json */
18865
+ 415: {
18866
+ headers: {
18867
+ [name: string]: unknown;
18868
+ };
18869
+ content: {
18870
+ "application/json": components$2["schemas"]["ErrorResponse"];
18871
+ };
18872
+ };
18873
+ /** @description Request fails validation */
18874
+ 422: {
18875
+ headers: {
18876
+ [name: string]: unknown;
18877
+ };
18878
+ content: {
18879
+ "application/json": components$2["schemas"]["ErrorResponse"];
18880
+ };
18881
+ };
18882
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
18883
+ 429: {
18884
+ headers: {
18885
+ [name: string]: unknown;
18886
+ };
18887
+ content: {
18888
+ "application/json": components$2["schemas"]["ErrorResponse"];
18889
+ };
18890
+ };
18891
+ /** @description Persistence error */
18892
+ 500: {
18893
+ headers: {
18894
+ [name: string]: unknown;
18895
+ };
18896
+ content: {
18897
+ "application/json": components$2["schemas"]["ErrorResponse"];
18898
+ };
18899
+ };
18900
+ };
18901
+ };
18902
+ revoke_api_key: {
18903
+ parameters: {
18904
+ query?: never;
18905
+ header?: never;
18906
+ path: {
18123
18907
  /** @description Project ID (UUID) */
18124
18908
  project_id: string;
18125
18909
  /** @description API key ID (UUID) */
@@ -18901,7 +19685,7 @@ interface operations$1 {
18901
19685
  [name: string]: unknown;
18902
19686
  };
18903
19687
  content: {
18904
- "application/octet-stream": unknown;
19688
+ "*/*": string;
18905
19689
  };
18906
19690
  };
18907
19691
  /** @description Invalid project or integration ID, the integration has no connector for its kind, or the document type cannot be exported */
@@ -19264,7 +20048,7 @@ interface operations$1 {
19264
20048
  "application/json": components$2["schemas"]["CreateCollectionResponse"];
19265
20049
  };
19266
20050
  };
19267
- /** @description Invalid request parameters */
20051
+ /** @description Invalid request parameters, or a label classification field was supplied: `rag.label_classification.unsupported` */
19268
20052
  400: {
19269
20053
  headers: {
19270
20054
  [name: string]: unknown;
@@ -20956,629 +21740,268 @@ interface operations$1 {
20956
21740
  };
20957
21741
  };
20958
21742
  };
20959
- }
20960
- //#endregion
20961
- //#region src/types.d.ts
20962
- type ExtractionOptions = components$1["schemas"]["ExtractionOptions"];
20963
- type ExtractionConfig = components$1["schemas"]["ExtractionConfig"];
20964
- /** A per-file extraction override, carried by `DocumentInput.config` and the `config-<filename>` multipart part. */
20965
- type FileExtractionConfig = components$1["schemas"]["FileExtractionConfig"];
20966
- type ExtractedDocument = components$1["schemas"]["ExtractedDocument"];
20967
- type ExtractionResult = ExtractedDocument;
20968
- type Job = components$1["schemas"]["JobResponse"];
20969
- type JobStatus = components$1["schemas"]["JobStatus"];
20970
- type WebhookConfig = components$1["schemas"]["WebhookConfig"];
20971
- type ExtractResponse = components$1["schemas"]["ExtractResponse"];
20972
- type DocumentInput = components$1["schemas"]["DocumentInput"];
20973
- type ListJobsResponse = components$1["schemas"]["ListJobsResponse"];
20974
- type ListAuditEntriesResponse = components$1["schemas"]["ListAuditEntriesResponse"];
20975
- type PresetSummary = components$1["schemas"]["PresetSummary"];
20976
- type PresetDetail = components$1["schemas"]["PresetDetail"];
20977
- /**
20978
- * The stored result document of a terminal job, returned by
20979
- * `GET /v1/jobs/{id}/result` on both tiers. Distinct from {@link Job}, which is
20980
- * the job's metadata record from `GET /v1/jobs/{id}`.
20981
- */
20982
- type JobResult = components$1["schemas"]["JobResult"];
20983
- /** A non-fatal per-document error attached to a {@link JobResult}. */
20984
- type JobResultError = components$1["schemas"]["JobResultError"];
20985
- type ListSavedPresetsResponse = components$1["schemas"]["ListSavedPresetsResponse"];
20986
- type SavedPresetSummary = components$1["schemas"]["SavedPresetSummary"];
20987
- type SavedPresetDetail = components$1["schemas"]["SavedPresetDetail"];
20988
- type CreateSavedPresetRequest = components$1["schemas"]["CreateSavedPresetRequest"];
20989
- type CreateSavedPresetResponse = components$1["schemas"]["CreateSavedPresetResponse"];
20990
- type UpdateSavedPresetRequest = components$1["schemas"]["UpdateSavedPresetRequest"];
20991
- type UpdateSavedPresetResponse = components$1["schemas"]["UpdateSavedPresetResponse"];
20992
- type ListAutoTuneJobsResponse = components$1["schemas"]["ListAutoTuneJobsResponse"];
20993
- type AutoTuneJobSummary = components$1["schemas"]["AutoTuneJobSummary"];
20994
- type CreateAutoTuneJobRequest = components$1["schemas"]["CreateAutoTuneJobRequest"];
20995
- type CreateAutoTuneJobResponse = components$1["schemas"]["CreateAutoTuneJobResponse"];
20996
- type AutoTuneCapabilitiesResponse = components$1["schemas"]["AutoTuneCapabilitiesResponse"];
20997
- type AutoTuneJobStatus = components$1["schemas"]["AutoTuneJobStatus"];
20998
- type AutoTuneResult = components$1["schemas"]["AutoTuneResult"];
20999
- type PromoteProfileRequest = components$1["schemas"]["PromoteProfileRequest"];
21000
- type ListTuningProfilesResponse = components$1["schemas"]["ListTuningProfilesResponse"];
21001
- type TuningProfileSummary = components$1["schemas"]["TuningProfileSummary"];
21002
- type TuningProfileDetail = components$1["schemas"]["TuningProfileDetail"];
21003
- type UsageResponse = components$1["schemas"]["UsageResponse"];
21004
- type DiffResponse = components$1["schemas"]["DiffResponse"];
21005
- /** The async-pending envelope `diff`/`getDiffJob` return in place of {@link DiffResponse} while a diff is still computing. */
21006
- type DiffAsyncAccepted = components$1["schemas"]["DiffAsyncAccepted"];
21007
- /**
21008
- * Result of {@link XbergClient.diff} and {@link XbergClient.getDiffJob}.
21009
- *
21010
- * Both operations answer `200` with the computed {@link DiffResponse} or
21011
- * `202` with the {@link DiffAsyncAccepted} polling envelope when the server
21012
- * falls back to async computation — the same fallback `getDiffJob` exists to
21013
- * poll. The two schemas share no field to discriminate on, so `status` here
21014
- * is not part of either wire schema: it is the HTTP status code the response
21015
- * actually carried, reattached so callers can narrow with a plain
21016
- * `if (result.status === 200)` / `else` instead of a type assertion.
21017
- */
21018
- type DiffResult = {
21019
- readonly status: 200;
21020
- readonly body: DiffResponse;
21021
- } | {
21022
- readonly status: 202;
21023
- readonly body: DiffAsyncAccepted;
21024
- };
21025
- type DocumentVersionEntry = components$1["schemas"]["DocumentVersionEntry"];
21026
- type PresignUploadRequest = components$1["schemas"]["PresignUploadRequest"];
21027
- type PresignUploadResponse = components$1["schemas"]["PresignUploadResponse"];
21028
- type ConfirmUploadRequest = components$1["schemas"]["ConfirmUploadRequest"];
21029
- type ConfirmUploadResponse = components$1["schemas"]["ConfirmUploadResponse"];
21030
- type EnrichTextRequest = components$1["schemas"]["EnrichTextRequest"];
21031
- type EnrichRequestOptions = components$1["schemas"]["EnrichRequestOptions"];
21032
- type EnrichJobSubmitted = components$1["schemas"]["EnrichJobSubmitted"];
21033
- type EnrichJobStatus = components$1["schemas"]["EnrichJobStatus"];
21034
- type ListExtractionEventsResponse = components$1["schemas"]["ListExtractionEventsResponse"];
21035
- type ExtractionEventSummary = components$1["schemas"]["ExtractionEventSummary"];
21036
- /**
21037
- * One event from {@link XbergClient.streamCrawlEvents}.
21038
- *
21039
- * A tagged union discriminated on `kind`, the same shape {@link DiffResult}
21040
- * uses — except the discriminant here is a real wire field, not a reattached
21041
- * HTTP status. Narrow before touching a variant-specific field:
21042
- *
21043
- * ```ts
21044
- * for await (const event of client.streamCrawlEvents(crawlJobId)) {
21045
- * if (event.kind === "page") {
21046
- * // event.status_code, event.depth, event.url
21047
- * } else if (event.kind === "complete") {
21048
- * break;
21049
- * }
21050
- * }
21051
- * ```
21052
- *
21053
- * `crawl_job_id` and `ts` are carried by every variant, so they read without
21054
- * narrowing.
21055
- */
21056
- type CrawlEvent = components$1["schemas"]["CrawlEventV1"];
21057
- /** The `kind` discriminator of a {@link CrawlEvent}. */
21058
- type CrawlEventKind = CrawlEvent["kind"];
21059
- /** A page was successfully crawled and indexed. */
21060
- type CrawlPageEvent = Extract<CrawlEvent, {
21061
- kind: "page";
21062
- }>;
21063
- /** A new URL was discovered during crawling. */
21064
- type CrawlDiscoveredEvent = Extract<CrawlEvent, {
21065
- kind: "discovered";
21066
- }>;
21067
- /** The crawl job finished; the stream closes after this event. */
21068
- type CrawlCompleteEvent = Extract<CrawlEvent, {
21069
- kind: "complete";
21070
- }>;
21071
- /** A single URL failed. The crawl continues; this is not a stream-level error. */
21072
- type CrawlErrorEvent = Extract<CrawlEvent, {
21073
- kind: "error";
21074
- }>;
21075
- type GetJobResponse = components$2["schemas"]["GetJobResponse"];
21076
- type AuthConfigResponse = components$2["schemas"]["AuthConfigResponse"];
21077
- type LoginRequest = components$2["schemas"]["LoginRequest"];
21078
- type LoginResponse = components$2["schemas"]["LoginResponse"];
21079
- type SetRagConfigRequest = components$2["schemas"]["SetRagConfigRequest"];
21080
- type RagConfigResponse = components$2["schemas"]["RagConfigResponse"];
21081
- type ListProjectsResponse = components$2["schemas"]["ListProjectsResponse"];
21082
- type CreateProjectRequest = components$2["schemas"]["CreateProjectRequest"];
21083
- type ProjectResponse = components$2["schemas"]["ProjectResponse"];
21084
- type ApiKeyResponse = components$2["schemas"]["ApiKeyResponse"];
21085
- type ApiKeyScope = components$2["schemas"]["ApiKeyScope"];
21086
- type ListApiKeysResponse = components$2["schemas"]["ListApiKeysResponse"];
21087
- type CreateApiKeyRequest = components$2["schemas"]["CreateApiKeyRequest"];
21088
- type CreateApiKeyResponse = components$2["schemas"]["CreateApiKeyResponse"];
21089
- type ListIntegrationsResponse = components$2["schemas"]["ListIntegrationsResponse"];
21090
- type CreateIntegrationRequest = components$2["schemas"]["CreateIntegrationRequest"];
21091
- type IntegrationResponse = components$2["schemas"]["IntegrationResponse"];
21092
- type BeginOAuthResponse = components$2["schemas"]["BeginOAuthResponse"];
21093
- type ListDocumentsResponse = components$2["schemas"]["ListDocumentsResponse"];
21094
- type DocumentResponse = components$2["schemas"]["DocumentResponse"];
21095
- /**
21096
- * Terminal job statuses — once observed, polling stops and the job result is
21097
- * returned (or thrown, for `failed`/`cancelled`).
21098
- */
21099
- declare const TERMINAL_JOB_STATUSES: readonly JobStatus[];
21100
- /**
21101
- * Job statuses that indicate a successful extraction. Used to distinguish a
21102
- * "completed but check warnings" result from a hard failure.
21103
- */
21104
- declare const SUCCESS_JOB_STATUSES: readonly JobStatus[];
21105
- //#endregion
21106
- //#region src/client.d.ts
21107
- interface XbergClientOptions {
21108
- apiKey?: string;
21109
- baseUrl?: string;
21110
- /**
21111
- * Origin of the Enterprise control plane, which runs as a second binary
21112
- * alongside the data plane. Defaults to `baseUrl` — Pro serves both planes
21113
- * from one binary, so every Pro call keeps working untouched.
21114
- *
21115
- * No method routes to it yet. The control-plane operations are vendored but
21116
- * unimplemented (xberg-io/sdks#22), and every control-plane method this
21117
- * client does have is Pro-only and tier-gated, so today this option only
21118
- * records an origin that {@link XbergClient.controlPlaneBaseUrl} reads back.
21119
- * It ships ahead of those methods so the constructor does not change shape
21120
- * when they land.
21121
- */
21122
- controlPlaneBaseUrl?: string;
21123
- /**
21124
- * Which product to talk to. When omitted, the tier is discovered lazily from
21125
- * `GET /healthz` before the first tier-specific call. Enterprise defaults
21126
- * `baseUrl`; `target: "pro"` requires an explicit `baseUrl`.
21127
- */
21128
- target?: Target;
21129
- fetch?: typeof fetch;
21130
- headers?: Record<string, string>;
21131
- timeoutMs?: number;
21132
- retries?: number;
21133
- retryOn?: readonly number[];
21134
- retryBackoff?: BackoffStrategy;
21135
- /** Sleep helper, swappable in tests. Defaults to `setTimeout`. */
21136
- sleep?: (ms: number) => Promise<void>;
21137
- }
21138
- interface ExtractParams {
21139
- file: FileLike;
21140
- options?: ExtractionOptions;
21141
- webhook?: WebhookConfig;
21142
- /**
21143
- * Per-file extraction override for this document, sent as the
21144
- * `config-<filename>` part. The server resolves it against
21145
- * `options.extraction_config`, any preset and the project default.
21146
- */
21147
- config?: FileExtractionConfig;
21148
- }
21149
- interface ExtractBatchParams {
21150
- files: readonly FileLike[];
21151
- options?: ExtractionOptions;
21152
- webhook?: WebhookConfig;
21153
- /**
21154
- * One optional per-file override per entry of `files`, in the same order —
21155
- * `null` for no override. Must be the same length as `files` when given.
21156
- *
21157
- * The override travels as a `config-<filename>` part, so two documents sharing
21158
- * a filename cannot carry different overrides; that combination throws rather
21159
- * than dropping one silently.
21160
- */
21161
- configs?: readonly (FileExtractionConfig | null)[];
21162
- }
21163
- interface WaitOptions {
21164
- /** Total time to wait before throwing TimeoutError. Default 5 minutes. */
21165
- timeoutMs?: number;
21166
- /** Initial poll interval. Default 1000ms. */
21167
- pollIntervalMs?: number;
21168
- /** `exponential` doubles the interval each cycle (capped). Default exponential. */
21169
- backoff?: BackoffStrategy;
21170
- }
21171
- interface ExtractAndWaitParams extends ExtractParams, WaitOptions {}
21172
- interface ListJobsParams {
21173
- limit?: number;
21174
- offset?: number;
21175
- }
21176
- interface AuditParams {
21177
- action?: string;
21178
- limit?: number;
21179
- offset?: number;
21180
- }
21181
- /** Offset pagination accepted by the paginated list endpoints. */
21182
- interface PaginationParams {
21183
- limit?: number;
21184
- offset?: number;
21185
- }
21186
- /** Filters accepted by `listExtractionEvents`. */
21187
- interface ListExtractionEventsParams extends PaginationParams {
21188
- /** How many days to look back. Defaults to 30 server-side, clamped to 1..=365. */
21189
- days?: number;
21190
- }
21191
- /** The two multipart parts `submitAutoTune` sends. */
21192
- interface SubmitAutoTuneParams {
21193
- /** JSON-encoded into the required `request` part. */
21194
- request: CreateAutoTuneJobRequest;
21195
- /** One binary `file` part per document referenced by `request.documents[].filename`. */
21196
- files: readonly FileLike[];
21197
- }
21198
- /** Options accepted by `streamCrawlEvents`. */
21199
- interface StreamCrawlEventsOptions {
21200
- /**
21201
- * Aborts the stream from outside the loop. Breaking out of the `for await`
21202
- * already closes the response body, so this is only needed to hang up from
21203
- * somewhere else — a React effect teardown, a shutdown handler.
21204
- */
21205
- signal?: AbortSignal;
21206
- }
21207
- /** Filters accepted by `listIntegrationDocuments`. */
21208
- interface ListIntegrationDocumentsParams {
21209
- /** Comma-separated MIME types to restrict the listing to. */
21210
- mimeTypes?: string;
21211
- /** Source-specific folder to list instead of the connection root. */
21212
- folderId?: string;
21213
- /** Upper bound on the number of documents returned. */
21214
- maxResults?: number;
21215
- }
21216
- /** Underlying `openapi-fetch` client, typed over the Enterprise API schema. */
21217
- type XbergRawClient = Client<paths$1>;
21218
- /**
21219
- * High-level dual-target client. Construct with `new XbergClient({ apiKey })`.
21220
- */
21221
- declare class XbergClient {
21222
- private readonly baseUrl;
21223
- /**
21224
- * Origin the control-plane surface will be addressed at. Same as `baseUrl`
21225
- * unless overridden. No request is routed there yet — see
21226
- * {@link XbergClientOptions.controlPlaneBaseUrl}.
21227
- */
21228
- readonly controlPlaneBaseUrl: string;
21229
- private readonly headers;
21230
- private readonly fetchImpl;
21231
- private readonly timeoutMs;
21232
- private readonly retries;
21233
- private readonly retryOn;
21234
- private readonly retryBackoff;
21235
- private readonly sleep;
21236
- private readonly target?;
21237
- private probedTier;
21238
- /** In-flight `/healthz` probe, memoised so concurrent callers share one request (single-flight). */
21239
- private tierProbe;
21240
- /** Underlying `openapi-fetch` client — exposed for advanced use. */
21241
- readonly raw: XbergRawClient;
21242
- constructor(options?: XbergClientOptions);
21243
- /**
21244
- * Submit a single document for extraction. Returns the initial {@link Job}
21245
- * record (still pending — call `waitForJob` to await completion).
21246
- */
21247
- extract(params: ExtractParams): Promise<Job>;
21248
- /**
21249
- * Submit multiple documents in a single multipart request. Returns one
21250
- * {@link Job} per file, in the same order.
21251
- */
21252
- extractBatch(params: ExtractBatchParams): Promise<Job[]>;
21253
- /** Fetch the current state of a job. */
21254
- getJob(jobId: string): Promise<Job>;
21255
- /**
21256
- * Fetch a job's stored result document (`GET /v1/jobs/{id}/result`).
21257
- *
21258
- * Declared by both tiers with an identical `JobResult` envelope; the
21259
- * extracted documents live in `results`. Distinct from {@link getJob}, which
21260
- * returns the job's metadata record.
21261
- */
21262
- getJobResult(jobId: string): Promise<JobResult>;
21263
- /** List jobs (paginated) via `GET /v1/jobs`. */
21264
- listJobs(params?: ListJobsParams): Promise<ListJobsResponse>;
21265
- /**
21266
- * Cancel a job (`DELETE /v1/jobs/{id}`). Idempotent: both a successful
21267
- * cancellation and a job that already reached a terminal status answer
21268
- * `204`.
21269
- */
21270
- cancelJob(jobId: string): Promise<void>;
21271
- /**
21272
- * Poll {@link getJob} until the job reaches a terminal status. Throws
21273
- * {@link TimeoutError} if the wait exceeds `timeoutMs`. Throws
21274
- * {@link XbergError} if the terminal status is `failed` or `cancelled`.
21275
- */
21276
- waitForJob(jobId: string, options?: WaitOptions): Promise<Job>;
21277
- /** Wait for many jobs in parallel. */
21278
- waitForJobs(jobIds: readonly string[], options?: WaitOptions): Promise<Job[]>;
21279
- /** Convenience: extract one file and await its result. */
21280
- extractAndWait(params: ExtractAndWaitParams): Promise<Job>;
21281
- /** Fetch audit-log entries via `GET /v1/audit`. */
21282
- audit(params?: AuditParams): Promise<ListAuditEntriesResponse>;
21283
- /** List the read-only curated presets (`GET /v1/presets`). */
21284
- presets(): Promise<PresetSummary[]>;
21285
- /** Fetch one curated preset in full (`GET /v1/presets/{id}`). */
21286
- getPreset(presetId: string): Promise<PresetDetail>;
21287
- /**
21288
- * Download a preset's bundled sample file
21289
- * (`GET /v1/presets/{id}/sample/{name}`). The response is raw bytes, not
21290
- * JSON.
21291
- */
21292
- getPresetSample(presetId: string, name: string): Promise<Uint8Array>;
21293
- /** List RAG collections (`GET /v1/rag/collections`). */
21294
- listRagCollections(): Promise<unknown>;
21295
- /** Create a RAG collection (`POST /v1/rag/collections`). */
21296
- createRagCollection(body: Record<string, unknown>): Promise<unknown>;
21297
- /** Fetch a RAG collection (`GET /v1/rag/collections/{name}`). */
21298
- getRagCollection(name: string): Promise<unknown>;
21299
- /** Delete a RAG collection (`DELETE /v1/rag/collections/{name}`). The spec documents a 204 with no content. */
21300
- deleteRagCollection(name: string): Promise<void>;
21301
- /** Add documents to a RAG collection (`POST /v1/rag/collections/{name}/documents`). */
21302
- addRagDocuments(name: string, body: Record<string, unknown>): Promise<unknown>;
21303
- /**
21304
- * Delete documents from a RAG collection, by ID list or metadata filter
21305
- * (`DELETE /v1/rag/collections/{name}/documents`). Unlike
21306
- * {@link deleteRagCollection}, this answers `200` with a body reporting how
21307
- * many documents were removed.
21308
- */
21309
- deleteRagDocuments(name: string, body: Record<string, unknown>): Promise<unknown>;
21310
- /** Reindex a RAG document (`POST /v1/rag/collections/{name}/documents/{id}/reindex`). */
21311
- reindexRagDocument(name: string, documentId: string, body?: Record<string, unknown>): Promise<unknown>;
21312
- /** Retrieve chunks from a RAG collection (`POST /v1/rag/collections/{name}/retrieve`). */
21313
- ragRetrieve(name: string, body: Record<string, unknown>): Promise<unknown>;
21314
- /** Kick off an embedding migration (`POST /v1/rag/collections/{name}/migrate-embeddings`). */
21315
- migrateRagEmbeddings(name: string, body: Record<string, unknown>): Promise<unknown>;
21316
- /** Poll an embedding-migration job (`GET .../migrate-embeddings/{jobId}`). */
21317
- getRagMigrationJob(name: string, jobId: string): Promise<unknown>;
21318
- /** Fetch a RAG job's status (`GET /v1/rag/jobs/{jobId}`). */
21319
- getRagJob(jobId: string): Promise<unknown>;
21320
- /** List the project's saved presets (`GET /v1/saved_presets`, `/v1/saved-presets` on Pro). */
21321
- listSavedPresets(params?: PaginationParams): Promise<ListSavedPresetsResponse>;
21322
- /** Create a saved preset (`POST /v1/saved_presets`, `/v1/saved-presets` on Pro). */
21323
- createSavedPreset(body: CreateSavedPresetRequest): Promise<CreateSavedPresetResponse>;
21324
- /** Fetch one saved preset (`GET /v1/saved_presets/{presetId}`, `/v1/saved-presets/{id}` on Pro). */
21325
- getSavedPreset(presetId: string): Promise<SavedPresetDetail>;
21326
- /** Update a saved preset (`PATCH /v1/saved_presets/{presetId}`, `/v1/saved-presets/{id}` on Pro). */
21327
- updateSavedPreset(presetId: string, body: UpdateSavedPresetRequest): Promise<UpdateSavedPresetResponse>;
21328
- /** Delete a saved preset (`DELETE /v1/saved_presets/{presetId}`, `/v1/saved-presets/{id}` on Pro). */
21329
- deleteSavedPreset(presetId: string): Promise<void>;
21330
- /** List the project's auto-tune jobs (`GET /v1/auto-tune`). */
21331
- listAutoTuneJobs(params?: PaginationParams): Promise<ListAutoTuneJobsResponse>;
21332
- /**
21333
- * Submit an auto-tune job (`POST /v1/auto-tune`). Sent as `multipart/form-data`:
21334
- * a JSON `request` part plus one binary `file` part per document.
21335
- */
21336
- submitAutoTune(params: SubmitAutoTuneParams): Promise<CreateAutoTuneJobResponse>;
21337
- /** Fetch the deployment's tunable knobs and OCR backends (`GET /v1/auto-tune/capabilities`). */
21338
- getAutoTuneCapabilities(): Promise<AutoTuneCapabilitiesResponse>;
21339
- /** Fetch an auto-tune job's status (`GET /v1/auto-tune/{id}`). */
21340
- getAutoTuneStatus(autoTuneJobId: string): Promise<AutoTuneJobStatus>;
21341
- /** Delete an auto-tune job (`DELETE /v1/auto-tune/{id}`). */
21342
- deleteAutoTuneJob(autoTuneJobId: string): Promise<void>;
21343
- /** Promote an auto-tune result to a named tuning profile (`POST /v1/auto-tune/{id}/promote`). */
21344
- promoteAutoTuneProfile(autoTuneJobId: string, body: PromoteProfileRequest): Promise<TuningProfileDetail>;
21345
- /** Fetch a completed auto-tune job's result (`GET /v1/auto-tune/{id}/result`). */
21346
- getAutoTuneResult(autoTuneJobId: string): Promise<AutoTuneResult>;
21347
- /** List the project's tuning profiles (`GET /v1/tuning-profiles`). */
21348
- listTuningProfiles(params?: PaginationParams): Promise<ListTuningProfilesResponse>;
21349
- /** Fetch one tuning profile (`GET /v1/tuning-profiles/{id}`). */
21350
- getTuningProfile(profileId: string): Promise<TuningProfileDetail>;
21351
- /** Delete a tuning profile (`DELETE /v1/tuning-profiles/{id}`). */
21352
- deleteTuningProfile(profileId: string): Promise<void>;
21353
- /** Pro only: fetch the instance's accepted auth methods (`GET /auth/config`). */
21354
- authConfig(): Promise<AuthConfigResponse>;
21355
- /** Pro only: exchange a verified OIDC ID token for a Pro session JWT (`POST /auth/login`). */
21356
- login(body: LoginRequest): Promise<LoginResponse>;
21357
- /** Pro only: fetch a project's RAG config (`GET /v1/projects/{projectId}/rag-config`). */
21358
- getRagConfig(projectId: string): Promise<RagConfigResponse>;
21359
- /** Pro only: update a project's RAG config (`PUT /v1/projects/{projectId}/rag-config`). */
21360
- setRagConfig(projectId: string, body: SetRagConfigRequest): Promise<RagConfigResponse>;
21361
- /** Pro only: list the caller's projects (`GET /v1/projects`). */
21362
- listProjects(params?: PaginationParams): Promise<ListProjectsResponse>;
21363
- /** Pro only: create a project owned by the caller (`POST /v1/projects`). */
21364
- createProject(body: CreateProjectRequest): Promise<ProjectResponse>;
21365
- /** Pro only: list a project's API keys (`GET /v1/projects/{projectId}/api-keys`). */
21366
- listApiKeys(projectId: string, params?: PaginationParams): Promise<ListApiKeysResponse>;
21367
- /** Pro only: mint an API key for a project (`POST /v1/projects/{projectId}/api-keys`). */
21368
- createApiKey(projectId: string, body: CreateApiKeyRequest): Promise<CreateApiKeyResponse>;
21369
- /** Pro only: revoke an API key (`DELETE /v1/projects/{projectId}/api-keys/{keyId}`). */
21370
- revokeApiKey(projectId: string, keyId: string): Promise<void>;
21371
- /** Pro only: list a project's integrations (`GET /v1/projects/{projectId}/integrations`). */
21372
- listIntegrations(projectId: string, params?: PaginationParams): Promise<ListIntegrationsResponse>;
21373
- /** Pro only: create an integration (`POST /v1/projects/{projectId}/integrations`). */
21374
- createIntegration(projectId: string, body: CreateIntegrationRequest): Promise<IntegrationResponse>;
21375
- /** Pro only: fetch one integration (`GET .../integrations/{integrationId}`). */
21376
- getIntegration(projectId: string, integrationId: string): Promise<IntegrationResponse>;
21377
- /** Pro only: delete an integration (`DELETE .../integrations/{integrationId}`). */
21378
- deleteIntegration(projectId: string, integrationId: string): Promise<void>;
21379
- /**
21380
- * Pro only: begin the OAuth flow for an integration
21381
- * (`POST .../integrations/{integrationId}/connect`). Returns the provider
21382
- * authorize URL to redirect the user to.
21383
- */
21384
- connectIntegration(projectId: string, integrationId: string): Promise<BeginOAuthResponse>;
21385
- /** Pro only: revoke an integration's OAuth connection (`POST .../disconnect`). */
21386
- disconnectIntegration(projectId: string, integrationId: string): Promise<void>;
21387
- /** Pro only: list the documents an integration exposes (`GET .../documents`). */
21388
- listIntegrationDocuments(projectId: string, integrationId: string, params?: ListIntegrationDocumentsParams): Promise<ListDocumentsResponse>;
21389
- /**
21390
- * Pro only: download one document from an integration
21391
- * (`GET .../documents/{documentId}`). The response is raw bytes, not JSON.
21392
- */
21393
- fetchIntegrationDocument(projectId: string, integrationId: string, documentId: string): Promise<Uint8Array>;
21394
- /**
21395
- * Enterprise only: fetch a document's latest version with its extraction
21396
- * result (`GET /v1/documents/{documentId}`). The spec declares an inline
21397
- * schema, so the body is returned untyped.
21398
- */
21399
- getDocument(documentId: string): Promise<unknown>;
21400
- /** Enterprise only: list a document's versions (`GET /v1/documents/{id}/versions`). */
21401
- versions(documentId: string): Promise<DocumentVersionEntry[]>;
21402
- /**
21403
- * Enterprise only: diff document versions (`GET /v1/documents/{id}/diff`).
21404
- *
21405
- * Computed inline when the server can afford it (`200`, {@link DiffResponse}
21406
- * in `result.body`), or queued for async computation when it can't (`202`,
21407
- * a {@link DiffAsyncAccepted} job envelope in `result.body`) — the same
21408
- * fallback {@link getDiffJob} polls. Narrow on `result.status`:
21409
- *
21410
- * ```ts
21411
- * const result = await client.diff(documentId);
21412
- * if (result.status === 200) {
21413
- * // result.body: DiffResponse
21414
- * } else {
21415
- * // result.body: DiffAsyncAccepted — poll getDiffJob(documentId, result.body.diff_job_id)
21416
- * }
21417
- * ```
21418
- */
21419
- diff(documentId: string, params?: QueryParams): Promise<DiffResult>;
21420
- /**
21421
- * Enterprise only: poll a diff job (`GET /v1/documents/{id}/diff/{diffJobId}`).
21422
- *
21423
- * Returns the same {@link DiffResult} union as {@link diff}: `200` once the
21424
- * job has finished (`result.body`: {@link DiffResponse}), `202` while it is
21425
- * still pending (`result.body`: {@link DiffAsyncAccepted}). Narrow on
21426
- * `result.status` as shown in {@link diff}'s TSDoc.
21427
- */
21428
- getDiffJob(documentId: string, diffJobId: string): Promise<DiffResult>;
21429
- /** Enterprise only: list the project's extraction events (`GET /v1/extractions`). */
21430
- listExtractionEvents(params?: ListExtractionEventsParams): Promise<ListExtractionEventsResponse>;
21431
- /**
21432
- * Enterprise only: download one rendered page of an extraction job
21433
- * (`GET /v1/jobs/{jobId}/pages/{pageNumber}`). The response is a PNG image —
21434
- * raw bytes, not JSON. `pageNumber` is 1-indexed.
21435
- */
21436
- getJobPage(jobId: string, pageNumber: number): Promise<Uint8Array>;
21437
- /** Enterprise only: submit text for enrichment (`POST /v1/enrich`). */
21438
- submitEnrich(body: EnrichTextRequest): Promise<EnrichJobSubmitted>;
21439
- /** Enterprise only: fetch an enrichment job's status (`GET /v1/enrich/{jobId}`). */
21440
- getEnrichStatus(jobId: string): Promise<EnrichJobStatus>;
21441
- /**
21442
- * Enterprise only: stream a crawl job's events
21443
- * (`GET /v1/crawl-jobs/{crawlJobId}/events`, Server-Sent Events).
21444
- *
21445
- * Returns an `AsyncIterable` of the `kind`-discriminated {@link CrawlEvent}
21446
- * union; the server closes the stream after the `complete` event.
21447
- *
21448
- * ```ts
21449
- * for await (const event of client.streamCrawlEvents(crawlJobId)) {
21450
- * if (event.kind === "page") {
21451
- * console.log(event.url, event.status_code);
21452
- * }
21453
- * }
21454
- * ```
21455
- *
21456
- * Nothing is requested — not even the `/healthz` tier probe — until
21457
- * iteration begins, and the response body is cancelled when iteration ends:
21458
- * on `complete`, on `break`/`return` out of the loop, on a thrown error, or
21459
- * when `options.signal` aborts. A stream is idle between events by design,
21460
- * so unlike every other method here it carries no request timeout and is not
21461
- * routed through the retry engine — a retried subscription would redeliver
21462
- * every event the caller had already handled.
21463
- */
21464
- streamCrawlEvents(crawlJobId: string, options?: StreamCrawlEventsOptions): AsyncIterable<CrawlEvent>;
21465
- /** Enterprise only: request a presigned upload URL (`POST /v1/uploads/presign`). */
21466
- presignUpload(body: PresignUploadRequest): Promise<PresignUploadResponse>;
21467
- /** Enterprise only: confirm a presigned upload (`POST /v1/uploads/confirm`). */
21468
- confirmUpload(body: ConfirmUploadRequest): Promise<ConfirmUploadResponse>;
21469
- /** Enterprise only: fetch usage/metering data (`GET /v1/usage`). */
21470
- usage(params?: QueryParams): Promise<UsageResponse>;
21471
- /** Build `/v1/projects/{projectId}` with the id percent-encoded. */
21472
- private projectPath;
21473
- /** Build `/v1/projects/{projectId}/integrations/{integrationId}`. */
21474
- private integrationPath;
21475
- /** Build `/v1/documents/{documentId}` with the id percent-encoded. */
21476
- private documentPath;
21477
- /** Build `/v1/auto-tune/{id}` with the id percent-encoded. */
21478
- private autoTunePath;
21479
- /** Build `/v1/tuning-profiles/{id}` with the id percent-encoded. */
21480
- private tuningProfilePath;
21481
- /**
21482
- * Resolve the tier and render the saved-preset path in that tier's spelling:
21483
- * `/v1/saved-presets` on Pro, `/v1/saved_presets` everywhere else. Pass a
21484
- * `presetId` for the single-preset routes.
21485
- */
21486
- private savedPresetsPath;
21487
- /**
21488
- * Return the effective tier — an explicit `target` if set, else probed from
21489
- * `/healthz` and cached after the first *successful* probe. A probe that
21490
- * fails (missing, `null`, or unrecognised `tier`) is not cached, so the
21491
- * next call retries instead of being stuck with a poisoned result for the
21492
- * client's lifetime. Concurrent callers share a single in-flight probe.
21493
- */
21494
- private resolveTier;
21495
- /**
21496
- * Issue the `/healthz` capability probe. Only `"enterprise"` and `"pro"` —
21497
- * the tier values the specs actually declare — are accepted; anything else
21498
- * (missing `tier`, `null`, or an unrecognised string) throws instead of
21499
- * being treated as a usable result.
21500
- */
21501
- private probeTier;
21502
- /** Throw a clear error when the connected tier does not match the required one. */
21503
- private requireTier;
21504
- /** Issue a request, raise on non-2xx, and decode the JSON body (undefined for empty bodies). */
21505
- private requestJson;
21506
- /**
21507
- * Like {@link requestJson}, but also returns the response's status code.
21508
- * Used by endpoints whose 2xx responses carry different schemas per status
21509
- * (currently only `diff`/`getDiffJob`'s `200`/`202` split).
21510
- */
21511
- private requestJsonWithStatus;
21512
- /**
21513
- * Open a `text/event-stream` response, deliberately bypassing
21514
- * {@link requestWithRetry}.
21515
- *
21516
- * Two of that method's behaviours are wrong for a subscription. Its retry
21517
- * loop would re-open a partly-consumed stream and redeliver every event the
21518
- * caller already handled — indistinguishable, from the caller's side, from
21519
- * the server sending them twice. And its `AbortSignal.timeout(timeoutMs)`
21520
- * bounds a request/response round trip, while this response stays open for
21521
- * the length of a crawl and is idle between events by design; the caller's
21522
- * own `signal` is the only deadline.
21523
- */
21524
- private openEventStream;
21525
- /** Issue a request, raise on non-2xx, and return the response body as raw bytes. */
21526
- private requestBytes;
21527
- /**
21528
- * Issue a raw HTTP request with auth, timeout, query params, and retry
21529
- * handling. Returns the raw (2xx) {@link Response}; non-2xx responses are
21530
- * mapped to a thrown {@link XbergError} subclass.
21531
- */
21532
- private requestWithRetry;
21533
- }
21534
- /** Backwards-compatible factory returning the low-level `openapi-fetch` client. */
21535
- interface CreateClientOptions {
21536
- baseUrl?: string;
21537
- apiKey?: string;
21538
- headers?: Record<string, string>;
21539
- fetch?: typeof fetch;
21540
- }
21541
- declare function createClient(options?: CreateClientOptions): XbergRawClient;
21542
- //#endregion
21543
- //#region src/errors.d.ts
21544
- /**
21545
- * Error class hierarchy for the Xberg SDK (Enterprise + Pro).
21546
- *
21547
- * Every non-2xx HTTP response is mapped to a subclass of {@link XbergError}.
21548
- * `TimeoutError` is also raised when {@link XbergClient.waitForJob} exceeds its
21549
- * configured deadline (distinct from a network/fetch timeout).
21550
- */
21551
- interface XbergErrorOptions {
21552
- status: number;
21553
- body: unknown;
21554
- cause?: unknown;
21555
- }
21556
- declare class XbergError extends Error {
21557
- readonly status: number;
21558
- readonly body: unknown;
21559
- constructor(message: string, options: XbergErrorOptions);
21560
- }
21561
- declare class AuthError extends XbergError {
21562
- constructor(message: string, options: XbergErrorOptions);
21563
- }
21564
- interface RateLimitErrorOptions extends XbergErrorOptions {
21565
- retryAfter?: number;
21566
- }
21567
- declare class RateLimitError extends XbergError {
21568
- readonly retryAfter?: number;
21569
- constructor(message: string, options: RateLimitErrorOptions);
21570
- }
21571
- declare class ValidationError extends XbergError {
21572
- constructor(message: string, options: XbergErrorOptions);
21573
- }
21574
- declare class NotFoundError extends XbergError {
21575
- constructor(message: string, options: XbergErrorOptions);
21576
- }
21577
- declare class ServerError extends XbergError {
21578
- constructor(message: string, options: XbergErrorOptions);
21579
- }
21580
- declare class TimeoutError extends XbergError {
21581
- constructor(message: string, options: XbergErrorOptions);
21743
+ confirm_upload: {
21744
+ parameters: {
21745
+ query?: never;
21746
+ header?: never;
21747
+ path?: never;
21748
+ cookie?: never;
21749
+ };
21750
+ requestBody: {
21751
+ content: {
21752
+ "application/json": components$2["schemas"]["ConfirmUploadRequest"];
21753
+ };
21754
+ };
21755
+ responses: {
21756
+ /** @description Uploads confirmed, processing started */
21757
+ 202: {
21758
+ headers: {
21759
+ [name: string]: unknown;
21760
+ };
21761
+ content: {
21762
+ "application/json": components$2["schemas"]["ConfirmUploadResponse"];
21763
+ };
21764
+ };
21765
+ /** @description Invalid request */
21766
+ 400: {
21767
+ headers: {
21768
+ [name: string]: unknown;
21769
+ };
21770
+ content: {
21771
+ "application/json": components$2["schemas"]["ErrorResponse"];
21772
+ };
21773
+ };
21774
+ /** @description Unauthorized */
21775
+ 401: {
21776
+ headers: {
21777
+ [name: string]: unknown;
21778
+ };
21779
+ content: {
21780
+ "application/json": components$2["schemas"]["ErrorResponse"];
21781
+ };
21782
+ };
21783
+ /** @description The API key is read-only and cannot use this method */
21784
+ 403: {
21785
+ headers: {
21786
+ [name: string]: unknown;
21787
+ };
21788
+ content: {
21789
+ "application/json": components$2["schemas"]["ErrorResponse"];
21790
+ };
21791
+ };
21792
+ /** @description An uploaded document is larger than the project's configured limit */
21793
+ 413: {
21794
+ headers: {
21795
+ [name: string]: unknown;
21796
+ };
21797
+ content: {
21798
+ "application/json": components$2["schemas"]["ErrorResponse"];
21799
+ };
21800
+ };
21801
+ /** @description The request body was not sent with Content-Type: application/json */
21802
+ 415: {
21803
+ headers: {
21804
+ [name: string]: unknown;
21805
+ };
21806
+ content: {
21807
+ "application/json": components$2["schemas"]["ErrorResponse"];
21808
+ };
21809
+ };
21810
+ /** @description Request fails validation */
21811
+ 422: {
21812
+ headers: {
21813
+ [name: string]: unknown;
21814
+ };
21815
+ content: {
21816
+ "application/json": components$2["schemas"]["ErrorResponse"];
21817
+ };
21818
+ };
21819
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
21820
+ 429: {
21821
+ headers: {
21822
+ [name: string]: unknown;
21823
+ };
21824
+ content: {
21825
+ "application/json": components$2["schemas"]["ErrorResponse"];
21826
+ };
21827
+ };
21828
+ /** @description Presigned uploads are not implemented on Xberg Pro yet */
21829
+ 501: {
21830
+ headers: {
21831
+ [name: string]: unknown;
21832
+ };
21833
+ content: {
21834
+ "application/json": components$2["schemas"]["ErrorResponse"];
21835
+ };
21836
+ };
21837
+ };
21838
+ };
21839
+ presign_upload: {
21840
+ parameters: {
21841
+ query?: never;
21842
+ header?: never;
21843
+ path?: never;
21844
+ cookie?: never;
21845
+ };
21846
+ requestBody: {
21847
+ content: {
21848
+ "application/json": components$2["schemas"]["PresignUploadRequest"];
21849
+ };
21850
+ };
21851
+ responses: {
21852
+ /** @description Presigned upload URLs generated */
21853
+ 200: {
21854
+ headers: {
21855
+ [name: string]: unknown;
21856
+ };
21857
+ content: {
21858
+ "application/json": components$2["schemas"]["PresignUploadResponse"];
21859
+ };
21860
+ };
21861
+ /** @description Invalid request */
21862
+ 400: {
21863
+ headers: {
21864
+ [name: string]: unknown;
21865
+ };
21866
+ content: {
21867
+ "application/json": components$2["schemas"]["ErrorResponse"];
21868
+ };
21869
+ };
21870
+ /** @description Unauthorized */
21871
+ 401: {
21872
+ headers: {
21873
+ [name: string]: unknown;
21874
+ };
21875
+ content: {
21876
+ "application/json": components$2["schemas"]["ErrorResponse"];
21877
+ };
21878
+ };
21879
+ /** @description The API key is read-only and cannot use this method */
21880
+ 403: {
21881
+ headers: {
21882
+ [name: string]: unknown;
21883
+ };
21884
+ content: {
21885
+ "application/json": components$2["schemas"]["ErrorResponse"];
21886
+ };
21887
+ };
21888
+ /** @description The request body is larger than this deployment accepts */
21889
+ 413: {
21890
+ headers: {
21891
+ [name: string]: unknown;
21892
+ };
21893
+ content: {
21894
+ "application/json": components$2["schemas"]["ErrorResponse"];
21895
+ };
21896
+ };
21897
+ /** @description The request body was not sent with Content-Type: application/json */
21898
+ 415: {
21899
+ headers: {
21900
+ [name: string]: unknown;
21901
+ };
21902
+ content: {
21903
+ "application/json": components$2["schemas"]["ErrorResponse"];
21904
+ };
21905
+ };
21906
+ /** @description Request fails validation */
21907
+ 422: {
21908
+ headers: {
21909
+ [name: string]: unknown;
21910
+ };
21911
+ content: {
21912
+ "application/json": components$2["schemas"]["ErrorResponse"];
21913
+ };
21914
+ };
21915
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
21916
+ 429: {
21917
+ headers: {
21918
+ [name: string]: unknown;
21919
+ };
21920
+ content: {
21921
+ "application/json": components$2["schemas"]["ErrorResponse"];
21922
+ };
21923
+ };
21924
+ /** @description Presigned uploads are not implemented on Xberg Pro yet */
21925
+ 501: {
21926
+ headers: {
21927
+ [name: string]: unknown;
21928
+ };
21929
+ content: {
21930
+ "application/json": components$2["schemas"]["ErrorResponse"];
21931
+ };
21932
+ };
21933
+ };
21934
+ };
21935
+ get_usage: {
21936
+ parameters: {
21937
+ query?: {
21938
+ /** @description Start date (ISO 8601, e.g. "2026-03-01"). Defaults to first day of current month. */
21939
+ start?: string;
21940
+ /** @description End date (ISO 8601, e.g. "2026-04-01"). Defaults to first day of next month. */
21941
+ end?: string;
21942
+ };
21943
+ header?: never;
21944
+ path?: never;
21945
+ cookie?: never;
21946
+ };
21947
+ requestBody?: never;
21948
+ responses: {
21949
+ /** @description Usage statistics */
21950
+ 200: {
21951
+ headers: {
21952
+ [name: string]: unknown;
21953
+ };
21954
+ content: {
21955
+ "application/json": components$2["schemas"]["UsageResponse"];
21956
+ };
21957
+ };
21958
+ /** @description Invalid date format */
21959
+ 400: {
21960
+ headers: {
21961
+ [name: string]: unknown;
21962
+ };
21963
+ content: {
21964
+ "application/json": components$2["schemas"]["ErrorResponse"];
21965
+ };
21966
+ };
21967
+ /** @description Unauthorized */
21968
+ 401: {
21969
+ headers: {
21970
+ [name: string]: unknown;
21971
+ };
21972
+ content: {
21973
+ "application/json": components$2["schemas"]["ErrorResponse"];
21974
+ };
21975
+ };
21976
+ /** @description Request fails validation */
21977
+ 422: {
21978
+ headers: {
21979
+ [name: string]: unknown;
21980
+ };
21981
+ content: {
21982
+ "application/json": components$2["schemas"]["ErrorResponse"];
21983
+ };
21984
+ };
21985
+ /** @description Rate limit exceeded for this caller. The body is the shared error envelope with code `rate_limited`; `Retry-After` and the `x-ratelimit-*` headers carry the wait. */
21986
+ 429: {
21987
+ headers: {
21988
+ [name: string]: unknown;
21989
+ };
21990
+ content: {
21991
+ "application/json": components$2["schemas"]["ErrorResponse"];
21992
+ };
21993
+ };
21994
+ /** @description Usage reporting is not implemented on Xberg Pro yet */
21995
+ 501: {
21996
+ headers: {
21997
+ [name: string]: unknown;
21998
+ };
21999
+ content: {
22000
+ "application/json": components$2["schemas"]["ErrorResponse"];
22001
+ };
22002
+ };
22003
+ };
22004
+ };
21582
22005
  }
21583
22006
  //#endregion
21584
22007
  //#region src/_generated/backend.d.ts
@@ -23032,12 +23455,12 @@ interface components {
23032
23455
  /** @description Client secret or password. Enterprise-only submission shape. */
23033
23456
  client_secret?: string | null;
23034
23457
  /** @description Additional configuration as a JSON object. */
23035
- config?: Record<string, never>;
23458
+ config?: Record<string, unknown>;
23036
23459
  /**
23037
23460
  * @description Free-form BYO credentials object (e.g. `client_id`/`client_secret` as
23038
23461
  * object keys). Pro-only submission shape.
23039
23462
  */
23040
- credentials?: Record<string, never>;
23463
+ credentials?: Record<string, unknown>;
23041
23464
  /** @description Integration kind (e.g. `"stripe"`, `"hubspot"`, `"google_drive"`). */
23042
23465
  kind: string;
23043
23466
  /** @description Integration name (user-friendly identifier). */
@@ -23525,14 +23948,14 @@ interface components {
23525
23948
  * Contains word count, page count, paragraph count, editing time, etc.
23526
23949
  * DOCX-specific variant of Office application properties.
23527
23950
  */
23528
- app_properties?: Record<string, never> | null;
23951
+ app_properties?: Record<string, unknown> | null;
23529
23952
  /**
23530
23953
  * @description Core properties from docProps/core.xml (Dublin Core metadata)
23531
23954
  *
23532
23955
  * Contains title, creator, subject, keywords, dates, etc.
23533
23956
  * Shared format across DOCX/PPTX/XLSX documents.
23534
23957
  */
23535
- core_properties?: Record<string, never> | null;
23958
+ core_properties?: Record<string, unknown> | null;
23536
23959
  /**
23537
23960
  * @description Custom properties from docProps/custom.xml (user-defined properties)
23538
23961
  *
@@ -23679,7 +24102,7 @@ interface components {
23679
24102
  */
23680
24103
  code: string;
23681
24104
  /** @description Optional detailed error information (context-specific) */
23682
- details?: Record<string, never>;
24105
+ details?: Record<string, unknown>;
23683
24106
  /**
23684
24107
  * @description Human-readable error message
23685
24108
  * @example Caller-supplied embedding does not match collection dimension
@@ -30302,5 +30725,791 @@ interface operations {
30302
30725
  };
30303
30726
  }
30304
30727
  //#endregion
30305
- export { type ApiKeyResponse, type ApiKeyScope, type AuditParams, type AuthConfigResponse, AuthError, type AutoTuneCapabilitiesResponse, type AutoTuneJobStatus, type AutoTuneJobSummary, type AutoTuneResult, type BackoffStrategy, type BeginOAuthResponse, type ConfirmUploadRequest, type ConfirmUploadResponse, type CrawlCompleteEvent, type CrawlDiscoveredEvent, type CrawlErrorEvent, type CrawlEvent, type CrawlEventKind, type CrawlPageEvent, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateAutoTuneJobRequest, type CreateAutoTuneJobResponse, type CreateClientOptions, type CreateIntegrationRequest, type CreateProjectRequest, type CreateSavedPresetRequest, type CreateSavedPresetResponse, type DiffAsyncAccepted, type DiffResponse, type DiffResult, type DocumentInput, type DocumentResponse, type DocumentVersionEntry, type EnrichJobStatus, type EnrichJobSubmitted, type EnrichRequestOptions, type EnrichTextRequest, type ExtractAndWaitParams, type ExtractBatchParams, type ExtractParams, type ExtractResponse, type ExtractedDocument, type ExtractionConfig, type ExtractionEventSummary, type ExtractionOptions, type ExtractionResult, type FileExtractionConfig, type FileLike, type GetJobResponse, type IntegrationResponse, type Job, type JobResult, type JobResultError, type JobStatus, type ListApiKeysResponse, type ListAuditEntriesResponse, type ListAutoTuneJobsResponse, type ListDocumentsResponse, type ListExtractionEventsParams, type ListExtractionEventsResponse, type ListIntegrationDocumentsParams, type ListIntegrationsResponse, type ListJobsParams, type ListJobsResponse, type ListProjectsResponse, type ListSavedPresetsResponse, type ListTuningProfilesResponse, type LoginRequest, type LoginResponse, NotFoundError, type PaginationParams, type PresetDetail, type PresetSummary, type PresignUploadRequest, type PresignUploadResponse, type ProjectResponse, type PromoteProfileRequest, type RagConfigResponse, RateLimitError, type RateLimitErrorOptions, SUCCESS_JOB_STATUSES, type SavedPresetDetail, type SavedPresetSummary, ServerError, type SetRagConfigRequest, type StreamCrawlEventsOptions, type SubmitAutoTuneParams, TERMINAL_JOB_STATUSES, type Target, TimeoutError, type TuningProfileDetail, type TuningProfileSummary, type UpdateSavedPresetRequest, type UpdateSavedPresetResponse, type UsageResponse, ValidationError, type WaitOptions, type WebhookConfig, XbergClient, type XbergClientOptions, XbergError, type XbergErrorOptions, type XbergRawClient, type components as backendComponents, type paths as backendPaths, type components$1 as components, createClient, type paths$1 as paths, type components$2 as proComponents, type paths$2 as proPaths };
30728
+ //#region src/types.d.ts
30729
+ type ExtractionOptions = components$1["schemas"]["ExtractionOptions"];
30730
+ type ExtractionConfig = components$1["schemas"]["ExtractionConfig"];
30731
+ /** A per-file extraction override, carried by `DocumentInput.config` and the `config-<filename>` multipart part. */
30732
+ type FileExtractionConfig = components$1["schemas"]["FileExtractionConfig"];
30733
+ type ExtractedDocument = components$1["schemas"]["ExtractedDocument"];
30734
+ type ExtractionResult = ExtractedDocument;
30735
+ type Job = components$1["schemas"]["JobResponse"];
30736
+ type JobStatus = components$1["schemas"]["JobStatus"];
30737
+ type WebhookConfig = components$1["schemas"]["WebhookConfig"];
30738
+ type ExtractResponse = components$1["schemas"]["ExtractResponse"];
30739
+ type DocumentInput = components$1["schemas"]["DocumentInput"];
30740
+ type ListJobsResponse = components$1["schemas"]["ListJobsResponse"];
30741
+ type ListAuditEntriesResponse = components$1["schemas"]["ListAuditEntriesResponse"];
30742
+ type PresetSummary = components$1["schemas"]["PresetSummary"];
30743
+ type PresetDetail = components$1["schemas"]["PresetDetail"];
30744
+ /**
30745
+ * The stored result document of a terminal job, returned by
30746
+ * `GET /v1/jobs/{id}/result` on both tiers. Distinct from {@link Job}, which is
30747
+ * the job's metadata record from `GET /v1/jobs/{id}`.
30748
+ */
30749
+ type JobResult = components$1["schemas"]["JobResult"];
30750
+ /** A non-fatal per-document error attached to a {@link JobResult}. */
30751
+ type JobResultError = components$1["schemas"]["JobResultError"];
30752
+ type ListSavedPresetsResponse = components$1["schemas"]["ListSavedPresetsResponse"];
30753
+ type SavedPresetSummary = components$1["schemas"]["SavedPresetSummary"];
30754
+ type SavedPresetDetail = components$1["schemas"]["SavedPresetDetail"];
30755
+ type CreateSavedPresetRequest = components$1["schemas"]["CreateSavedPresetRequest"];
30756
+ type CreateSavedPresetResponse = components$1["schemas"]["CreateSavedPresetResponse"];
30757
+ type UpdateSavedPresetRequest = components$1["schemas"]["UpdateSavedPresetRequest"];
30758
+ type UpdateSavedPresetResponse = components$1["schemas"]["UpdateSavedPresetResponse"];
30759
+ type ListAutoTuneJobsResponse = components$1["schemas"]["ListAutoTuneJobsResponse"];
30760
+ type AutoTuneJobSummary = components$1["schemas"]["AutoTuneJobSummary"];
30761
+ type CreateAutoTuneJobRequest = components$1["schemas"]["CreateAutoTuneJobRequest"];
30762
+ type CreateAutoTuneJobResponse = components$1["schemas"]["CreateAutoTuneJobResponse"];
30763
+ type AutoTuneCapabilitiesResponse = components$1["schemas"]["AutoTuneCapabilitiesResponse"];
30764
+ type AutoTuneJobStatus = components$1["schemas"]["AutoTuneJobStatus"];
30765
+ type AutoTuneResult = components$1["schemas"]["AutoTuneResult"];
30766
+ type PromoteProfileRequest = components$1["schemas"]["PromoteProfileRequest"];
30767
+ type ListTuningProfilesResponse = components$1["schemas"]["ListTuningProfilesResponse"];
30768
+ type TuningProfileSummary = components$1["schemas"]["TuningProfileSummary"];
30769
+ type TuningProfileDetail = components$1["schemas"]["TuningProfileDetail"];
30770
+ type UsageResponse = components$1["schemas"]["UsageResponse"];
30771
+ type DiffResponse = components$1["schemas"]["DiffResponse"];
30772
+ /** The async-pending envelope `diff`/`getDiffJob` return in place of {@link DiffResponse} while a diff is still computing. */
30773
+ type DiffAsyncAccepted = components$1["schemas"]["DiffAsyncAccepted"];
30774
+ /**
30775
+ * Result of {@link XbergClient.diff} and {@link XbergClient.getDiffJob}.
30776
+ *
30777
+ * Both operations answer `200` with the computed {@link DiffResponse} or
30778
+ * `202` with the {@link DiffAsyncAccepted} polling envelope when the server
30779
+ * falls back to async computation — the same fallback `getDiffJob` exists to
30780
+ * poll. The two schemas share no field to discriminate on, so `status` here
30781
+ * is not part of either wire schema: it is the HTTP status code the response
30782
+ * actually carried, reattached so callers can narrow with a plain
30783
+ * `if (result.status === 200)` / `else` instead of a type assertion.
30784
+ */
30785
+ type DiffResult = {
30786
+ readonly status: 200;
30787
+ readonly body: DiffResponse;
30788
+ } | {
30789
+ readonly status: 202;
30790
+ readonly body: DiffAsyncAccepted;
30791
+ };
30792
+ type DocumentVersionEntry = components$1["schemas"]["DocumentVersionEntry"];
30793
+ type PresignUploadRequest = components$1["schemas"]["PresignUploadRequest"];
30794
+ type PresignUploadResponse = components$1["schemas"]["PresignUploadResponse"];
30795
+ type ConfirmUploadRequest = components$1["schemas"]["ConfirmUploadRequest"];
30796
+ type ConfirmUploadResponse = components$1["schemas"]["ConfirmUploadResponse"];
30797
+ type EnrichTextRequest = components$1["schemas"]["EnrichTextRequest"];
30798
+ type EnrichRequestOptions = components$1["schemas"]["EnrichRequestOptions"];
30799
+ type EnrichJobSubmitted = components$1["schemas"]["EnrichJobSubmitted"];
30800
+ type EnrichJobStatus = components$1["schemas"]["EnrichJobStatus"];
30801
+ type ListExtractionEventsResponse = components$1["schemas"]["ListExtractionEventsResponse"];
30802
+ type ExtractionEventSummary = components$1["schemas"]["ExtractionEventSummary"];
30803
+ /**
30804
+ * One event from {@link XbergClient.streamCrawlEvents}.
30805
+ *
30806
+ * A tagged union discriminated on `kind`, the same shape {@link DiffResult}
30807
+ * uses — except the discriminant here is a real wire field, not a reattached
30808
+ * HTTP status. Narrow before touching a variant-specific field:
30809
+ *
30810
+ * ```ts
30811
+ * for await (const event of client.streamCrawlEvents(crawlJobId)) {
30812
+ * if (event.kind === "page") {
30813
+ * // event.status_code, event.depth, event.url
30814
+ * } else if (event.kind === "complete") {
30815
+ * break;
30816
+ * }
30817
+ * }
30818
+ * ```
30819
+ *
30820
+ * `crawl_job_id` and `ts` are carried by every variant, so they read without
30821
+ * narrowing.
30822
+ */
30823
+ type CrawlEvent = components$1["schemas"]["CrawlEventV1"];
30824
+ /** The `kind` discriminator of a {@link CrawlEvent}. */
30825
+ type CrawlEventKind = CrawlEvent["kind"];
30826
+ /** A page was successfully crawled and indexed. */
30827
+ type CrawlPageEvent = Extract<CrawlEvent, {
30828
+ kind: "page";
30829
+ }>;
30830
+ /** A new URL was discovered during crawling. */
30831
+ type CrawlDiscoveredEvent = Extract<CrawlEvent, {
30832
+ kind: "discovered";
30833
+ }>;
30834
+ /** The crawl job finished; the stream closes after this event. */
30835
+ type CrawlCompleteEvent = Extract<CrawlEvent, {
30836
+ kind: "complete";
30837
+ }>;
30838
+ /** A single URL failed. The crawl continues; this is not a stream-level error. */
30839
+ type CrawlErrorEvent = Extract<CrawlEvent, {
30840
+ kind: "error";
30841
+ }>;
30842
+ type GetJobResponse = components$2["schemas"]["GetJobResponse"];
30843
+ type AuthConfigResponse = components$2["schemas"]["AuthConfigResponse"];
30844
+ type LoginRequest = components$2["schemas"]["LoginRequest"];
30845
+ type LoginResponse = components$2["schemas"]["LoginResponse"];
30846
+ type SetRagConfigRequest = components$2["schemas"]["SetRagConfigRequest"];
30847
+ type RagConfigResponse = components$2["schemas"]["RagConfigResponse"];
30848
+ type ListProjectsResponse = components$2["schemas"]["ListProjectsResponse"];
30849
+ type CreateProjectRequest = components$2["schemas"]["CreateProjectRequest"];
30850
+ type ProjectResponse = components$2["schemas"]["ProjectResponse"];
30851
+ type ApiKeyResponse = components$2["schemas"]["ApiKeyResponse"];
30852
+ type ApiKeyScope = components$2["schemas"]["ApiKeyScope"];
30853
+ type ListApiKeysResponse = components$2["schemas"]["ListApiKeysResponse"];
30854
+ type CreateApiKeyRequest = components$2["schemas"]["CreateApiKeyRequest"];
30855
+ type CreateApiKeyResponse = components$2["schemas"]["CreateApiKeyResponse"];
30856
+ type ListIntegrationsResponse = components$2["schemas"]["ListIntegrationsResponse"];
30857
+ type CreateIntegrationRequest = components$2["schemas"]["CreateIntegrationRequest"];
30858
+ type IntegrationResponse = components$2["schemas"]["IntegrationResponse"];
30859
+ type BeginOAuthResponse = components$2["schemas"]["BeginOAuthResponse"];
30860
+ type ListDocumentsResponse = components$2["schemas"]["ListDocumentsResponse"];
30861
+ type DocumentResponse = components$2["schemas"]["DocumentResponse"];
30862
+ /**
30863
+ * Terminal job statuses — once observed, polling stops and the job result is
30864
+ * returned (or thrown, for `failed`/`cancelled`).
30865
+ */
30866
+ declare const TERMINAL_JOB_STATUSES: readonly JobStatus[];
30867
+ /**
30868
+ * Job statuses that indicate a successful extraction. Used to distinguish a
30869
+ * "completed but check warnings" result from a hard failure.
30870
+ */
30871
+ declare const SUCCESS_JOB_STATUSES: readonly JobStatus[];
30872
+ type BackendAcceptInvitationRequest = components["schemas"]["AcceptInvitationRequest"];
30873
+ type BackendAnalyticsResponse = components["schemas"]["AnalyticsResponse"];
30874
+ type BackendAuthConfigResponse = components["schemas"]["AuthConfigResponse"];
30875
+ type BackendBeginConnectResponse = components["schemas"]["BeginConnectResponse"];
30876
+ type BackendBillingResponse = components["schemas"]["BillingResponse"];
30877
+ type BackendCheckoutResponse = components["schemas"]["CheckoutResponse"];
30878
+ type BackendCreateApiKeyRequest = components["schemas"]["CreateApiKeyRequest"];
30879
+ type BackendCreateApiKeyResponse = components["schemas"]["CreateApiKeyResponse"];
30880
+ /** Backend integration configuration accepts arbitrary JSON object properties. */
30881
+ type BackendCreateIntegrationRequest = Omit<components["schemas"]["CreateIntegrationRequest"], "config" | "credentials"> & {
30882
+ config?: Record<string, unknown>;
30883
+ credentials?: Record<string, unknown>;
30884
+ };
30885
+ type BackendCreateInvitationRequest = components["schemas"]["CreateInvitationRequest"];
30886
+ type BackendCreateInvitationResponse = components["schemas"]["CreateInvitationResponse"];
30887
+ type BackendCreateProjectRequest = components["schemas"]["CreateProjectRequest"];
30888
+ type BackendCreateWebhookRequest = components["schemas"]["CreateWebhookRequest"];
30889
+ type BackendHealthResponse = components["schemas"]["HealthResponse"];
30890
+ type BackendIntegrationResponse = components["schemas"]["IntegrationResponse"];
30891
+ type BackendListApiKeysResponse = components["schemas"]["ListApiKeysResponse"];
30892
+ type BackendListAuditEntriesResponse = components["schemas"]["ListAuditEntriesResponse"];
30893
+ type BackendListDocumentsResponse = components["schemas"]["ListDocumentsResponse"];
30894
+ type BackendListIntegrationsResponse = components["schemas"]["ListIntegrationsResponse"];
30895
+ type BackendListInvitationsResponse = components["schemas"]["ListInvitationsResponse"];
30896
+ type BackendListMembersResponse = components["schemas"]["ListMembersResponse"];
30897
+ type BackendListProjectsResponse = components["schemas"]["ListProjectsResponse"];
30898
+ type BackendListWebhookDeliveriesResponse = components["schemas"]["ListWebhookDeliveriesResponse"];
30899
+ type BackendListWebhooksResponse = components["schemas"]["ListWebhooksResponse"];
30900
+ type BackendLoginRequest = components["schemas"]["LoginRequest"];
30901
+ type BackendLoginResponse = components["schemas"]["LoginResponse"];
30902
+ type BackendMemberResponse = components["schemas"]["MemberResponse"];
30903
+ type BackendPortalResponse = components["schemas"]["PortalResponse"];
30904
+ type BackendProjectResponse = components["schemas"]["ProjectResponse"];
30905
+ type BackendRagConfigResponse = components["schemas"]["RagConfigResponse"];
30906
+ type BackendReadinessResponse = components["schemas"]["ReadinessResponse"];
30907
+ type BackendRetryWebhookDeliveryResponse = components["schemas"]["RetryWebhookDeliveryResponse"];
30908
+ type BackendSandboxExtractResponse = components["schemas"]["SandboxExtractResponse"];
30909
+ type BackendSetRagConfigRequest = components["schemas"]["SetRagConfigRequest"];
30910
+ type BackendUpdateMemberRoleRequest = components["schemas"]["UpdateMemberRoleRequest"];
30911
+ type BackendUpdateProjectRequest = components["schemas"]["UpdateProjectRequest"];
30912
+ type BackendUpdateWebhookRequest = components["schemas"]["UpdateWebhookRequest"];
30913
+ type BackendUsageResponse = components["schemas"]["UsageResponse"];
30914
+ type BackendWebhookResponse = components["schemas"]["WebhookResponse"];
30915
+ type BackendWebhookTestResponse = components["schemas"]["WebhookTestResponse"];
30916
+ //#endregion
30917
+ //#region src/client.d.ts
30918
+ interface XbergClientOptions {
30919
+ apiKey?: string;
30920
+ baseUrl?: string;
30921
+ /**
30922
+ * Origin of the Enterprise control plane, which runs as a second binary
30923
+ * alongside the data plane. Defaults to `baseUrl` — Pro serves both planes
30924
+ * from one binary, so every Pro call keeps working untouched.
30925
+ *
30926
+ */
30927
+ controlPlaneBaseUrl?: string;
30928
+ /** Bearer token for protected backend calls; defaults to `apiKey`. */
30929
+ controlPlaneToken?: string;
30930
+ /** Product for tier-specific data-plane methods; discovered lazily when omitted. */
30931
+ target?: Target;
30932
+ fetch?: typeof fetch;
30933
+ headers?: Record<string, string>;
30934
+ timeoutMs?: number;
30935
+ retries?: number;
30936
+ retryOn?: readonly number[];
30937
+ retryBackoff?: BackoffStrategy;
30938
+ /** Sleep helper, swappable in tests. Defaults to `setTimeout`. */
30939
+ sleep?: (ms: number) => Promise<void>;
30940
+ }
30941
+ interface ExtractParams {
30942
+ /** Enterprise document lineage UUID; omitted for a new document. */
30943
+ documentId?: string;
30944
+ file: FileLike;
30945
+ options?: ExtractionOptions;
30946
+ webhook?: WebhookConfig;
30947
+ /**
30948
+ * Per-file extraction override for this document, sent as the
30949
+ * `config-<filename>` part. The server resolves it against
30950
+ * `options.extraction_config`, any preset and the project default.
30951
+ */
30952
+ config?: FileExtractionConfig;
30953
+ }
30954
+ interface ExtractBatchParams {
30955
+ /** Enterprise lineage UUIDs aligned with files; null entries omit lineage. */
30956
+ documentIds?: readonly (string | null)[];
30957
+ files: readonly FileLike[];
30958
+ options?: ExtractionOptions;
30959
+ webhook?: WebhookConfig;
30960
+ /**
30961
+ * One optional per-file override per entry of `files`, in the same order —
30962
+ * `null` for no override. Must be the same length as `files` when given.
30963
+ *
30964
+ * The override travels as a `config-<filename>` part, so two documents sharing
30965
+ * a filename cannot carry different overrides; that combination throws rather
30966
+ * than dropping one silently.
30967
+ */
30968
+ configs?: readonly (FileExtractionConfig | null)[];
30969
+ }
30970
+ interface WaitOptions {
30971
+ /** Total time to wait before throwing TimeoutError. Default 5 minutes. */
30972
+ timeoutMs?: number;
30973
+ /** Initial poll interval. Default 1000ms. */
30974
+ pollIntervalMs?: number;
30975
+ /** `exponential` doubles the interval each cycle (capped). Default exponential. */
30976
+ backoff?: BackoffStrategy;
30977
+ }
30978
+ interface ExtractAndWaitParams extends ExtractParams, WaitOptions {}
30979
+ interface ListJobsParams {
30980
+ limit?: number;
30981
+ offset?: number;
30982
+ }
30983
+ interface AuditParams {
30984
+ action?: string;
30985
+ limit?: number;
30986
+ offset?: number;
30987
+ }
30988
+ /** Offset pagination accepted by the paginated list endpoints. */
30989
+ interface PaginationParams {
30990
+ limit?: number;
30991
+ offset?: number;
30992
+ }
30993
+ /** Filters accepted by `listExtractionEvents`. */
30994
+ interface ListExtractionEventsParams extends PaginationParams {
30995
+ /** How many days to look back. Defaults to 30 server-side, clamped to 1..=365. */
30996
+ days?: number;
30997
+ }
30998
+ /** The two multipart parts `submitAutoTune` sends. */
30999
+ interface SubmitAutoTuneParams {
31000
+ /** JSON-encoded into the required `request` part. */
31001
+ request: CreateAutoTuneJobRequest;
31002
+ /** One binary `file` part per document referenced by `request.documents[].filename`. */
31003
+ files: readonly FileLike[];
31004
+ }
31005
+ /** Options accepted by `streamCrawlEvents`. */
31006
+ interface StreamCrawlEventsOptions {
31007
+ /**
31008
+ * Aborts the stream from outside the loop. Breaking out of the `for await`
31009
+ * already closes the response body, so this is only needed to hang up from
31010
+ * somewhere else — a React effect teardown, a shutdown handler.
31011
+ */
31012
+ signal?: AbortSignal;
31013
+ }
31014
+ /** Filters accepted by `listIntegrationDocuments`. */
31015
+ interface ListIntegrationDocumentsParams {
31016
+ /** Comma-separated MIME types to restrict the listing to. */
31017
+ mimeTypes?: string;
31018
+ /** Source-specific folder to list instead of the connection root. */
31019
+ folderId?: string;
31020
+ /** Upper bound on the number of documents returned. */
31021
+ maxResults?: number;
31022
+ }
31023
+ interface BackendDateRange {
31024
+ startDate: string;
31025
+ endDate: string;
31026
+ }
31027
+ interface BackendOAuthCallbackParams {
31028
+ code: string;
31029
+ state: string;
31030
+ }
31031
+ interface BackendAuditParams {
31032
+ action?: string;
31033
+ limit?: number;
31034
+ offset?: number;
31035
+ }
31036
+ interface BackendSandboxExtractParams {
31037
+ file: FileLike;
31038
+ }
31039
+ interface PublicSandboxExtractParams {
31040
+ file?: FileLike;
31041
+ mode?: string;
31042
+ preset?: string;
31043
+ url?: string;
31044
+ sandboxToken?: string;
31045
+ }
31046
+ /** Underlying `openapi-fetch` client, typed over the Enterprise API schema. */
31047
+ type XbergRawClient = Client<paths$1>;
31048
+ /**
31049
+ * High-level dual-target client. Construct with `new XbergClient({ apiKey })`.
31050
+ */
31051
+ declare class XbergClient {
31052
+ private readonly baseUrl;
31053
+ /**
31054
+ * Origin used by the Enterprise backend methods. Defaults to `baseUrl`.
31055
+ */
31056
+ readonly controlPlaneBaseUrl: string;
31057
+ private readonly controlPlaneToken;
31058
+ private readonly headers;
31059
+ private readonly fetchImpl;
31060
+ private readonly timeoutMs;
31061
+ private readonly retries;
31062
+ private readonly retryOn;
31063
+ private readonly retryBackoff;
31064
+ private readonly sleep;
31065
+ private readonly target?;
31066
+ private probedTier;
31067
+ /** In-flight `/healthz` probe, memoised so concurrent callers share one request (single-flight). */
31068
+ private tierProbe;
31069
+ /** Underlying `openapi-fetch` client — exposed for advanced use. */
31070
+ readonly raw: XbergRawClient;
31071
+ constructor(options?: XbergClientOptions);
31072
+ /** Enterprise backend `DELETE /auth/account`. */
31073
+ deleteAccount(): Promise<void>;
31074
+ /** Enterprise backend `GET /auth/config`. */
31075
+ getAuthConfig(): Promise<BackendAuthConfigResponse>;
31076
+ /** Enterprise backend `POST /auth/login`. */
31077
+ backendLogin(body: BackendLoginRequest): Promise<BackendLoginResponse>;
31078
+ /** Enterprise backend `GET /healthz`. */
31079
+ healthz(): Promise<BackendHealthResponse>;
31080
+ /** Enterprise backend `GET /readyz`. */
31081
+ readyz(): Promise<BackendReadinessResponse>;
31082
+ /** Enterprise backend `POST /v1/invitations/accept`. */
31083
+ acceptInvitation(body: BackendAcceptInvitationRequest): Promise<BackendMemberResponse>;
31084
+ /** Enterprise backend `GET /v1/oauth/callback`. */
31085
+ oauthCallback(params: BackendOAuthCallbackParams): Promise<string>;
31086
+ /** Enterprise backend `GET /v1/projects`. */
31087
+ backendListProjects(params?: PaginationParams): Promise<BackendListProjectsResponse>;
31088
+ /** Enterprise backend `POST /v1/projects`. */
31089
+ backendCreateProject(body: BackendCreateProjectRequest): Promise<BackendProjectResponse>;
31090
+ /** Enterprise backend `GET /v1/projects/{id}`. */
31091
+ getProject(projectId: string): Promise<BackendProjectResponse>;
31092
+ /** Enterprise backend `DELETE /v1/projects/{id}`. */
31093
+ deleteProject(projectId: string, params?: {
31094
+ erase?: boolean;
31095
+ }): Promise<void>;
31096
+ /** Enterprise backend `PATCH /v1/projects/{id}`. */
31097
+ updateProject(projectId: string, body: BackendUpdateProjectRequest): Promise<BackendProjectResponse>;
31098
+ /** Enterprise backend `GET /v1/projects/{id}/analytics`. */
31099
+ getAnalytics(projectId: string, params: BackendDateRange): Promise<BackendAnalyticsResponse>;
31100
+ /** Enterprise backend `GET /v1/projects/{id}/api-keys`. */
31101
+ backendListApiKeys(projectId: string, params?: PaginationParams): Promise<BackendListApiKeysResponse>;
31102
+ /** Enterprise backend `POST /v1/projects/{id}/api-keys`. */
31103
+ backendCreateApiKey(projectId: string, body: BackendCreateApiKeyRequest): Promise<BackendCreateApiKeyResponse>;
31104
+ /** Enterprise backend `DELETE /v1/projects/{id}/api-keys/{key_id}`. */
31105
+ backendRevokeApiKey(projectId: string, apiKeyId: string): Promise<void>;
31106
+ /** Enterprise backend `POST /v1/projects/{id}/api-keys/{key_id}/regenerate`. */
31107
+ regenerateApiKey(projectId: string, apiKeyId: string): Promise<BackendCreateApiKeyResponse>;
31108
+ /** Enterprise backend `GET /v1/projects/{id}/audit`. */
31109
+ listProjectAudit(projectId: string, params?: BackendAuditParams): Promise<BackendListAuditEntriesResponse>;
31110
+ /** Enterprise backend `GET /v1/projects/{id}/billing`. */
31111
+ getBilling(projectId: string): Promise<BackendBillingResponse>;
31112
+ /** Enterprise backend `POST /v1/projects/{id}/billing/checkout`. */
31113
+ createCheckout(projectId: string): Promise<BackendCheckoutResponse>;
31114
+ /** Enterprise backend `POST /v1/projects/{id}/billing/portal`. */
31115
+ createPortal(projectId: string): Promise<BackendPortalResponse>;
31116
+ /** Enterprise backend `GET /v1/projects/{id}/integrations`. */
31117
+ backendListIntegrations(projectId: string, params?: PaginationParams): Promise<BackendListIntegrationsResponse>;
31118
+ /** Enterprise backend `POST /v1/projects/{id}/integrations`. */
31119
+ backendCreateIntegration(projectId: string, body: BackendCreateIntegrationRequest): Promise<BackendIntegrationResponse>;
31120
+ /** Enterprise backend `GET /v1/projects/{id}/integrations/{iid}`. */
31121
+ backendGetIntegration(projectId: string, integrationId: string): Promise<BackendIntegrationResponse>;
31122
+ /** Enterprise backend `DELETE /v1/projects/{id}/integrations/{iid}`. */
31123
+ backendDeleteIntegration(projectId: string, integrationId: string): Promise<void>;
31124
+ /** Enterprise backend `POST /v1/projects/{id}/integrations/{iid}/connect`. */
31125
+ oauthConnect(projectId: string, integrationId: string): Promise<BackendBeginConnectResponse>;
31126
+ /** Enterprise backend `POST /v1/projects/{id}/integrations/{iid}/disconnect`. */
31127
+ backendDisconnectIntegration(projectId: string, integrationId: string): Promise<void>;
31128
+ /** Enterprise backend `GET /v1/projects/{id}/integrations/{iid}/documents`. */
31129
+ backendListIntegrationDocuments(projectId: string, integrationId: string, params?: ListIntegrationDocumentsParams): Promise<BackendListDocumentsResponse>;
31130
+ /** Enterprise backend `GET /v1/projects/{id}/integrations/{iid}/documents/{doc_id}`. */
31131
+ backendFetchIntegrationDocument(projectId: string, integrationId: string, documentId: string): Promise<Uint8Array>;
31132
+ /** Enterprise backend `GET /v1/projects/{id}/invitations`. */
31133
+ listInvitations(projectId: string, params?: PaginationParams): Promise<BackendListInvitationsResponse>;
31134
+ /** Enterprise backend `POST /v1/projects/{id}/invitations`. */
31135
+ inviteUser(projectId: string, body: BackendCreateInvitationRequest): Promise<BackendCreateInvitationResponse>;
31136
+ /** Enterprise backend `DELETE /v1/projects/{id}/invitations/{inv_id}`. */
31137
+ revokeInvitation(projectId: string, invitationId: string): Promise<void>;
31138
+ /** Enterprise backend `POST /v1/projects/{id}/leave`. */
31139
+ leaveProject(projectId: string): Promise<void>;
31140
+ /** Enterprise backend `GET /v1/projects/{id}/members`. */
31141
+ listMembers(projectId: string, params?: PaginationParams): Promise<BackendListMembersResponse>;
31142
+ /** Enterprise backend `DELETE /v1/projects/{id}/members/{user_id}`. */
31143
+ removeMember(projectId: string, userId: string): Promise<void>;
31144
+ /** Enterprise backend `PATCH /v1/projects/{id}/members/{user_id}`. */
31145
+ updateMemberRole(projectId: string, userId: string, body: BackendUpdateMemberRoleRequest): Promise<BackendMemberResponse>;
31146
+ /** Enterprise backend `GET /v1/projects/{id}/rag-config`. */
31147
+ backendGetRagConfig(projectId: string): Promise<BackendRagConfigResponse>;
31148
+ /** Enterprise backend `PUT /v1/projects/{id}/rag-config`. */
31149
+ backendSetRagConfig(projectId: string, body: BackendSetRagConfigRequest): Promise<BackendRagConfigResponse>;
31150
+ /** Enterprise backend `POST /v1/projects/{id}/sandbox/extract`. */
31151
+ sandboxExtract(projectId: string, params: BackendSandboxExtractParams): Promise<BackendSandboxExtractResponse>;
31152
+ /** Enterprise backend `GET /v1/projects/{id}/usage`. */
31153
+ getUsage(projectId: string, params: BackendDateRange): Promise<BackendUsageResponse>;
31154
+ /** Enterprise backend `GET /v1/projects/{id}/webhooks`. */
31155
+ listWebhooks(projectId: string, params?: PaginationParams): Promise<BackendListWebhooksResponse>;
31156
+ /** Enterprise backend `POST /v1/projects/{id}/webhooks`. */
31157
+ createWebhook(projectId: string, body: BackendCreateWebhookRequest): Promise<BackendWebhookResponse>;
31158
+ /** Enterprise backend `DELETE /v1/projects/{id}/webhooks/{wh_id}`. */
31159
+ deleteWebhook(projectId: string, webhookId: string): Promise<void>;
31160
+ /** Enterprise backend `PATCH /v1/projects/{id}/webhooks/{wh_id}`. */
31161
+ updateWebhook(projectId: string, webhookId: string, body: BackendUpdateWebhookRequest): Promise<BackendWebhookResponse>;
31162
+ /** Enterprise backend `GET /v1/projects/{id}/webhooks/{wh_id}/deliveries`. */
31163
+ listWebhookDeliveries(projectId: string, webhookId: string, params?: PaginationParams): Promise<BackendListWebhookDeliveriesResponse>;
31164
+ /** Enterprise backend `POST /v1/projects/{id}/webhooks/{wh_id}/deliveries/{delivery_id}/retry`. */
31165
+ retryWebhookDelivery(projectId: string, webhookId: string, deliveryId: string): Promise<BackendRetryWebhookDeliveryResponse>;
31166
+ /** Enterprise backend `POST /v1/projects/{id}/webhooks/{wh_id}/test`. */
31167
+ testWebhook(projectId: string, webhookId: string): Promise<BackendWebhookTestResponse>;
31168
+ /** Enterprise backend `POST /v1/sandbox/public/extract`. */
31169
+ publicSandboxExtract(params: PublicSandboxExtractParams): Promise<BackendSandboxExtractResponse>;
31170
+ /**
31171
+ * Submit a single document for extraction. Returns the initial {@link Job}
31172
+ * record (still pending — call `waitForJob` to await completion).
31173
+ */
31174
+ extract(params: ExtractParams): Promise<Job>;
31175
+ /**
31176
+ * Submit multiple documents in a single multipart request. Returns one
31177
+ * {@link Job} per file, in the same order.
31178
+ */
31179
+ extractBatch(params: ExtractBatchParams): Promise<Job[]>;
31180
+ /** Fetch the current state of a job. */
31181
+ getJob(jobId: string): Promise<Job>;
31182
+ /**
31183
+ * Fetch a job's stored result document (`GET /v1/jobs/{id}/result`).
31184
+ *
31185
+ * Declared by both tiers with an identical `JobResult` envelope; the
31186
+ * extracted documents live in `results`. Distinct from {@link getJob}, which
31187
+ * returns the job's metadata record.
31188
+ */
31189
+ getJobResult(jobId: string): Promise<JobResult>;
31190
+ /** List jobs (paginated) via `GET /v1/jobs`. */
31191
+ listJobs(params?: ListJobsParams): Promise<ListJobsResponse>;
31192
+ /**
31193
+ * Cancel a job (`DELETE /v1/jobs/{id}`). Idempotent: both a successful
31194
+ * cancellation and a job that already reached a terminal status answer
31195
+ * `204`.
31196
+ */
31197
+ cancelJob(jobId: string): Promise<void>;
31198
+ /**
31199
+ * Poll {@link getJob} until the job reaches a terminal status. Throws
31200
+ * {@link TimeoutError} if the wait exceeds `timeoutMs`. Throws
31201
+ * {@link XbergError} if the terminal status is `failed` or `cancelled`.
31202
+ */
31203
+ waitForJob(jobId: string, options?: WaitOptions): Promise<Job>;
31204
+ /** Wait for many jobs in parallel. */
31205
+ waitForJobs(jobIds: readonly string[], options?: WaitOptions): Promise<Job[]>;
31206
+ /** Convenience: extract one file and await its result. */
31207
+ extractAndWait(params: ExtractAndWaitParams): Promise<Job>;
31208
+ /** Fetch audit-log entries via `GET /v1/audit`. */
31209
+ audit(params?: AuditParams): Promise<ListAuditEntriesResponse>;
31210
+ /** List the read-only curated presets (`GET /v1/presets`). */
31211
+ presets(): Promise<PresetSummary[]>;
31212
+ /** Fetch one curated preset in full (`GET /v1/presets/{id}`). */
31213
+ getPreset(presetId: string): Promise<PresetDetail>;
31214
+ /**
31215
+ * Download a preset's bundled sample file
31216
+ * (`GET /v1/presets/{id}/sample/{name}`). The response is raw bytes, not
31217
+ * JSON.
31218
+ */
31219
+ getPresetSample(presetId: string, name: string): Promise<Uint8Array>;
31220
+ /** List RAG collections (`GET /v1/rag/collections`). */
31221
+ listRagCollections(): Promise<unknown>;
31222
+ /** Create a RAG collection (`POST /v1/rag/collections`). */
31223
+ createRagCollection(body: Record<string, unknown>): Promise<unknown>;
31224
+ /** Fetch a RAG collection (`GET /v1/rag/collections/{name}`). */
31225
+ getRagCollection(name: string): Promise<unknown>;
31226
+ /** Delete a RAG collection (`DELETE /v1/rag/collections/{name}`). The spec documents a 204 with no content. */
31227
+ deleteRagCollection(name: string): Promise<void>;
31228
+ /** Add documents to a RAG collection (`POST /v1/rag/collections/{name}/documents`). */
31229
+ addRagDocuments(name: string, body: Record<string, unknown>): Promise<unknown>;
31230
+ /**
31231
+ * Delete documents from a RAG collection, by ID list or metadata filter
31232
+ * (`DELETE /v1/rag/collections/{name}/documents`). Unlike
31233
+ * {@link deleteRagCollection}, this answers `200` with a body reporting how
31234
+ * many documents were removed.
31235
+ */
31236
+ deleteRagDocuments(name: string, body: Record<string, unknown>): Promise<unknown>;
31237
+ /** Reindex a RAG document (`POST /v1/rag/collections/{name}/documents/{id}/reindex`). */
31238
+ reindexRagDocument(name: string, documentId: string, body?: Record<string, unknown>): Promise<unknown>;
31239
+ /** Retrieve chunks from a RAG collection (`POST /v1/rag/collections/{name}/retrieve`). */
31240
+ ragRetrieve(name: string, body: Record<string, unknown>): Promise<unknown>;
31241
+ /** Kick off an embedding migration (`POST /v1/rag/collections/{name}/migrate-embeddings`). */
31242
+ migrateRagEmbeddings(name: string, body: Record<string, unknown>): Promise<unknown>;
31243
+ /** Poll an embedding-migration job (`GET .../migrate-embeddings/{jobId}`). */
31244
+ getRagMigrationJob(name: string, jobId: string): Promise<unknown>;
31245
+ /** Fetch a RAG job's status (`GET /v1/rag/jobs/{jobId}`). */
31246
+ getRagJob(jobId: string): Promise<unknown>;
31247
+ /** List the project's saved presets (`GET /v1/saved_presets`, `/v1/saved-presets` on Pro). */
31248
+ listSavedPresets(params?: PaginationParams): Promise<ListSavedPresetsResponse>;
31249
+ /** Create a saved preset (`POST /v1/saved_presets`, `/v1/saved-presets` on Pro). */
31250
+ createSavedPreset(body: CreateSavedPresetRequest): Promise<CreateSavedPresetResponse>;
31251
+ /** Fetch one saved preset (`GET /v1/saved_presets/{presetId}`, `/v1/saved-presets/{id}` on Pro). */
31252
+ getSavedPreset(presetId: string): Promise<SavedPresetDetail>;
31253
+ /** Update a saved preset (`PATCH /v1/saved_presets/{presetId}`, `/v1/saved-presets/{id}` on Pro). */
31254
+ updateSavedPreset(presetId: string, body: UpdateSavedPresetRequest): Promise<UpdateSavedPresetResponse>;
31255
+ /** Delete a saved preset (`DELETE /v1/saved_presets/{presetId}`, `/v1/saved-presets/{id}` on Pro). */
31256
+ deleteSavedPreset(presetId: string): Promise<void>;
31257
+ /** List the project's auto-tune jobs (`GET /v1/auto-tune`). */
31258
+ listAutoTuneJobs(params?: PaginationParams): Promise<ListAutoTuneJobsResponse>;
31259
+ /**
31260
+ * Submit an auto-tune job (`POST /v1/auto-tune`). Sent as `multipart/form-data`:
31261
+ * a JSON `request` part plus one binary `file` part per document.
31262
+ */
31263
+ submitAutoTune(params: SubmitAutoTuneParams): Promise<CreateAutoTuneJobResponse>;
31264
+ /** Fetch the deployment's tunable knobs and OCR backends (`GET /v1/auto-tune/capabilities`). */
31265
+ getAutoTuneCapabilities(): Promise<AutoTuneCapabilitiesResponse>;
31266
+ /** Fetch an auto-tune job's status (`GET /v1/auto-tune/{id}`). */
31267
+ getAutoTuneStatus(autoTuneJobId: string): Promise<AutoTuneJobStatus>;
31268
+ /** Delete an auto-tune job (`DELETE /v1/auto-tune/{id}`). */
31269
+ deleteAutoTuneJob(autoTuneJobId: string): Promise<void>;
31270
+ /** Promote an auto-tune result to a named tuning profile (`POST /v1/auto-tune/{id}/promote`). */
31271
+ promoteAutoTuneProfile(autoTuneJobId: string, body: PromoteProfileRequest): Promise<TuningProfileDetail>;
31272
+ /** Fetch a completed auto-tune job's result (`GET /v1/auto-tune/{id}/result`). */
31273
+ getAutoTuneResult(autoTuneJobId: string): Promise<AutoTuneResult>;
31274
+ /** List the project's tuning profiles (`GET /v1/tuning-profiles`). */
31275
+ listTuningProfiles(params?: PaginationParams): Promise<ListTuningProfilesResponse>;
31276
+ /** Fetch one tuning profile (`GET /v1/tuning-profiles/{id}`). */
31277
+ getTuningProfile(profileId: string): Promise<TuningProfileDetail>;
31278
+ /** Delete a tuning profile (`DELETE /v1/tuning-profiles/{id}`). */
31279
+ deleteTuningProfile(profileId: string): Promise<void>;
31280
+ /** Pro only: fetch the instance's accepted auth methods (`GET /auth/config`). */
31281
+ authConfig(): Promise<AuthConfigResponse>;
31282
+ /** Pro only: exchange a verified OIDC ID token for a Pro session JWT (`POST /auth/login`). */
31283
+ login(body: LoginRequest): Promise<LoginResponse>;
31284
+ /** Pro only: fetch a project's RAG config (`GET /v1/projects/{projectId}/rag-config`). */
31285
+ getRagConfig(projectId: string): Promise<RagConfigResponse>;
31286
+ /** Pro only: update a project's RAG config (`PUT /v1/projects/{projectId}/rag-config`). */
31287
+ setRagConfig(projectId: string, body: SetRagConfigRequest): Promise<RagConfigResponse>;
31288
+ /** Pro only: list the caller's projects (`GET /v1/projects`). */
31289
+ listProjects(params?: PaginationParams): Promise<ListProjectsResponse>;
31290
+ /** Pro only: create a project owned by the caller (`POST /v1/projects`). */
31291
+ createProject(body: CreateProjectRequest): Promise<ProjectResponse>;
31292
+ /** Pro only: list a project's API keys (`GET /v1/projects/{projectId}/api-keys`). */
31293
+ listApiKeys(projectId: string, params?: PaginationParams): Promise<ListApiKeysResponse>;
31294
+ /** Pro only: mint an API key for a project (`POST /v1/projects/{projectId}/api-keys`). */
31295
+ createApiKey(projectId: string, body: CreateApiKeyRequest): Promise<CreateApiKeyResponse>;
31296
+ /** Pro only: revoke an API key (`DELETE /v1/projects/{projectId}/api-keys/{keyId}`). */
31297
+ revokeApiKey(projectId: string, keyId: string): Promise<void>;
31298
+ /** Pro only: list a project's integrations (`GET /v1/projects/{projectId}/integrations`). */
31299
+ listIntegrations(projectId: string, params?: PaginationParams): Promise<ListIntegrationsResponse>;
31300
+ /** Pro only: create an integration (`POST /v1/projects/{projectId}/integrations`). */
31301
+ createIntegration(projectId: string, body: CreateIntegrationRequest): Promise<IntegrationResponse>;
31302
+ /** Pro only: fetch one integration (`GET .../integrations/{integrationId}`). */
31303
+ getIntegration(projectId: string, integrationId: string): Promise<IntegrationResponse>;
31304
+ /** Pro only: delete an integration (`DELETE .../integrations/{integrationId}`). */
31305
+ deleteIntegration(projectId: string, integrationId: string): Promise<void>;
31306
+ /**
31307
+ * Pro only: begin the OAuth flow for an integration
31308
+ * (`POST .../integrations/{integrationId}/connect`). Returns the provider
31309
+ * authorize URL to redirect the user to.
31310
+ */
31311
+ connectIntegration(projectId: string, integrationId: string): Promise<BeginOAuthResponse>;
31312
+ /** Pro only: revoke an integration's OAuth connection (`POST .../disconnect`). */
31313
+ disconnectIntegration(projectId: string, integrationId: string): Promise<void>;
31314
+ /** Pro only: list the documents an integration exposes (`GET .../documents`). */
31315
+ listIntegrationDocuments(projectId: string, integrationId: string, params?: ListIntegrationDocumentsParams): Promise<ListDocumentsResponse>;
31316
+ /**
31317
+ * Pro only: download one document from an integration
31318
+ * (`GET .../documents/{documentId}`). The response is raw bytes, not JSON.
31319
+ */
31320
+ fetchIntegrationDocument(projectId: string, integrationId: string, documentId: string): Promise<Uint8Array>;
31321
+ /**
31322
+ * Enterprise only: fetch a document's latest version with its extraction
31323
+ * result (`GET /v1/documents/{documentId}`). The spec declares an inline
31324
+ * schema, so the body is returned untyped.
31325
+ */
31326
+ getDocument(documentId: string): Promise<unknown>;
31327
+ /** Enterprise only: list a document's versions (`GET /v1/documents/{id}/versions`). */
31328
+ versions(documentId: string): Promise<DocumentVersionEntry[]>;
31329
+ /**
31330
+ * Enterprise only: diff document versions (`GET /v1/documents/{id}/diff`).
31331
+ *
31332
+ * Computed inline when the server can afford it (`200`, {@link DiffResponse}
31333
+ * in `result.body`), or queued for async computation when it can't (`202`,
31334
+ * a {@link DiffAsyncAccepted} job envelope in `result.body`) — the same
31335
+ * fallback {@link getDiffJob} polls. Narrow on `result.status`:
31336
+ *
31337
+ * ```ts
31338
+ * const result = await client.diff(documentId);
31339
+ * if (result.status === 200) {
31340
+ * // result.body: DiffResponse
31341
+ * } else {
31342
+ * // result.body: DiffAsyncAccepted — poll getDiffJob(documentId, result.body.diff_job_id)
31343
+ * }
31344
+ * ```
31345
+ */
31346
+ diff(documentId: string, params?: QueryParams): Promise<DiffResult>;
31347
+ /**
31348
+ * Enterprise only: poll a diff job (`GET /v1/documents/{id}/diff/{diffJobId}`).
31349
+ *
31350
+ * Returns the same {@link DiffResult} union as {@link diff}: `200` once the
31351
+ * job has finished (`result.body`: {@link DiffResponse}), `202` while it is
31352
+ * still pending (`result.body`: {@link DiffAsyncAccepted}). Narrow on
31353
+ * `result.status` as shown in {@link diff}'s TSDoc.
31354
+ */
31355
+ getDiffJob(documentId: string, diffJobId: string): Promise<DiffResult>;
31356
+ /** Enterprise only: list the project's extraction events (`GET /v1/extractions`). */
31357
+ listExtractionEvents(params?: ListExtractionEventsParams): Promise<ListExtractionEventsResponse>;
31358
+ /**
31359
+ * Enterprise only: download one rendered page of an extraction job
31360
+ * (`GET /v1/jobs/{jobId}/pages/{pageNumber}`). The response is a PNG image —
31361
+ * raw bytes, not JSON. `pageNumber` is 1-indexed.
31362
+ */
31363
+ getJobPage(jobId: string, pageNumber: number): Promise<Uint8Array>;
31364
+ /** Enterprise only: submit text for enrichment (`POST /v1/enrich`). */
31365
+ submitEnrich(body: EnrichTextRequest): Promise<EnrichJobSubmitted>;
31366
+ /** Enterprise only: fetch an enrichment job's status (`GET /v1/enrich/{jobId}`). */
31367
+ getEnrichStatus(jobId: string): Promise<EnrichJobStatus>;
31368
+ /**
31369
+ * Enterprise only: stream a crawl job's events
31370
+ * (`GET /v1/crawl-jobs/{crawlJobId}/events`, Server-Sent Events).
31371
+ *
31372
+ * Returns an `AsyncIterable` of the `kind`-discriminated {@link CrawlEvent}
31373
+ * union; the server closes the stream after the `complete` event.
31374
+ *
31375
+ * ```ts
31376
+ * for await (const event of client.streamCrawlEvents(crawlJobId)) {
31377
+ * if (event.kind === "page") {
31378
+ * console.log(event.url, event.status_code);
31379
+ * }
31380
+ * }
31381
+ * ```
31382
+ *
31383
+ * Nothing is requested — not even the `/healthz` tier probe — until
31384
+ * iteration begins, and the response body is cancelled when iteration ends:
31385
+ * on `complete`, on `break`/`return` out of the loop, on a thrown error, or
31386
+ * when `options.signal` aborts. A stream is idle between events by design,
31387
+ * so unlike every other method here it carries no request timeout and is not
31388
+ * routed through the retry engine — a retried subscription would redeliver
31389
+ * every event the caller had already handled.
31390
+ */
31391
+ streamCrawlEvents(crawlJobId: string, options?: StreamCrawlEventsOptions): AsyncIterable<CrawlEvent>;
31392
+ /** Enterprise only: request a presigned upload URL (`POST /v1/uploads/presign`). */
31393
+ presignUpload(body: PresignUploadRequest): Promise<PresignUploadResponse>;
31394
+ /** Enterprise only: confirm a presigned upload (`POST /v1/uploads/confirm`). */
31395
+ confirmUpload(body: ConfirmUploadRequest): Promise<ConfirmUploadResponse>;
31396
+ /** Enterprise only: fetch usage/metering data (`GET /v1/usage`). */
31397
+ usage(params?: QueryParams): Promise<UsageResponse>;
31398
+ /** Build `/v1/projects/{projectId}` with the id percent-encoded. */
31399
+ private projectPath;
31400
+ /** Build `/v1/projects/{projectId}/integrations/{integrationId}`. */
31401
+ private integrationPath;
31402
+ /** Build `/v1/documents/{documentId}` with the id percent-encoded. */
31403
+ private documentPath;
31404
+ /** Build `/v1/auto-tune/{id}` with the id percent-encoded. */
31405
+ private autoTunePath;
31406
+ /** Build `/v1/tuning-profiles/{id}` with the id percent-encoded. */
31407
+ private tuningProfilePath;
31408
+ /**
31409
+ * Resolve the tier and render the saved-preset path in that tier's spelling:
31410
+ * `/v1/saved-presets` on Pro, `/v1/saved_presets` everywhere else. Pass a
31411
+ * `presetId` for the single-preset routes.
31412
+ */
31413
+ private savedPresetsPath;
31414
+ /**
31415
+ * Return the effective tier — an explicit `target` if set, else probed from
31416
+ * `/healthz` and cached after the first *successful* probe. A probe that
31417
+ * fails (missing, `null`, or unrecognised `tier`) is not cached, so the
31418
+ * next call retries instead of being stuck with a poisoned result for the
31419
+ * client's lifetime. Concurrent callers share a single in-flight probe.
31420
+ */
31421
+ private resolveTier;
31422
+ /**
31423
+ * Issue the `/healthz` capability probe. Only `"enterprise"` and `"pro"` —
31424
+ * the tier values the specs actually declare — are accepted; anything else
31425
+ * (missing `tier`, `null`, or an unrecognised string) throws instead of
31426
+ * being treated as a usable result.
31427
+ */
31428
+ private probeTier;
31429
+ /** Throw a clear error when the connected tier does not match the required one. */
31430
+ private requireTier;
31431
+ private backendRequest;
31432
+ private backendHeaders;
31433
+ /** Issue a request, raise on non-2xx, and decode the JSON body (undefined for empty bodies). */
31434
+ private requestJson;
31435
+ /**
31436
+ * Like {@link requestJson}, but also returns the response's status code.
31437
+ * Used by endpoints whose 2xx responses carry different schemas per status
31438
+ * (currently only `diff`/`getDiffJob`'s `200`/`202` split).
31439
+ */
31440
+ private requestJsonWithStatus;
31441
+ /**
31442
+ * Open a `text/event-stream` response, deliberately bypassing
31443
+ * {@link requestWithRetry}.
31444
+ *
31445
+ * Two of that method's behaviours are wrong for a subscription. Its retry
31446
+ * loop would re-open a partly-consumed stream and redeliver every event the
31447
+ * caller already handled — indistinguishable, from the caller's side, from
31448
+ * the server sending them twice. And its `AbortSignal.timeout(timeoutMs)`
31449
+ * bounds a request/response round trip, while this response stays open for
31450
+ * the length of a crawl and is idle between events by design; the caller's
31451
+ * own `signal` is the only deadline.
31452
+ */
31453
+ private openEventStream;
31454
+ /** Issue a request, raise on non-2xx, and return the response body as raw bytes. */
31455
+ private requestBytes;
31456
+ /**
31457
+ * Issue a raw HTTP request with auth, timeout, query params, and retry
31458
+ * handling. Returns the raw (2xx) {@link Response}; non-2xx responses are
31459
+ * mapped to a thrown {@link XbergError} subclass.
31460
+ */
31461
+ private prepareRequest;
31462
+ private requestWithRetry;
31463
+ }
31464
+ /** Backwards-compatible factory returning the low-level `openapi-fetch` client. */
31465
+ interface CreateClientOptions {
31466
+ baseUrl?: string;
31467
+ apiKey?: string;
31468
+ headers?: Record<string, string>;
31469
+ fetch?: typeof fetch;
31470
+ }
31471
+ declare function createClient(options?: CreateClientOptions): XbergRawClient;
31472
+ //#endregion
31473
+ //#region src/errors.d.ts
31474
+ /**
31475
+ * Error class hierarchy for the Xberg SDK (Enterprise + Pro).
31476
+ *
31477
+ * Every non-2xx HTTP response is mapped to a subclass of {@link XbergError}.
31478
+ * `TimeoutError` is also raised when {@link XbergClient.waitForJob} exceeds its
31479
+ * configured deadline (distinct from a network/fetch timeout).
31480
+ */
31481
+ interface XbergErrorOptions {
31482
+ status: number;
31483
+ body: unknown;
31484
+ cause?: unknown;
31485
+ }
31486
+ declare class XbergError extends Error {
31487
+ readonly status: number;
31488
+ readonly body: unknown;
31489
+ constructor(message: string, options: XbergErrorOptions);
31490
+ }
31491
+ declare class AuthError extends XbergError {
31492
+ constructor(message: string, options: XbergErrorOptions);
31493
+ }
31494
+ interface RateLimitErrorOptions extends XbergErrorOptions {
31495
+ retryAfter?: number;
31496
+ }
31497
+ declare class RateLimitError extends XbergError {
31498
+ readonly retryAfter?: number;
31499
+ constructor(message: string, options: RateLimitErrorOptions);
31500
+ }
31501
+ declare class ValidationError extends XbergError {
31502
+ constructor(message: string, options: XbergErrorOptions);
31503
+ }
31504
+ declare class NotFoundError extends XbergError {
31505
+ constructor(message: string, options: XbergErrorOptions);
31506
+ }
31507
+ declare class ServerError extends XbergError {
31508
+ constructor(message: string, options: XbergErrorOptions);
31509
+ }
31510
+ declare class TimeoutError extends XbergError {
31511
+ constructor(message: string, options: XbergErrorOptions);
31512
+ }
31513
+ //#endregion
31514
+ export { type ApiKeyResponse, type ApiKeyScope, type AuditParams, type AuthConfigResponse, AuthError, type AutoTuneCapabilitiesResponse, type AutoTuneJobStatus, type AutoTuneJobSummary, type AutoTuneResult, type BackendAcceptInvitationRequest, type BackendAnalyticsResponse, type BackendAuditParams, type BackendAuthConfigResponse, type BackendBeginConnectResponse, type BackendBillingResponse, type BackendCheckoutResponse, type BackendCreateApiKeyRequest, type BackendCreateApiKeyResponse, type BackendCreateIntegrationRequest, type BackendCreateInvitationRequest, type BackendCreateInvitationResponse, type BackendCreateProjectRequest, type BackendCreateWebhookRequest, type BackendDateRange, type BackendHealthResponse, type BackendIntegrationResponse, type BackendListApiKeysResponse, type BackendListAuditEntriesResponse, type BackendListDocumentsResponse, type BackendListIntegrationsResponse, type BackendListInvitationsResponse, type BackendListMembersResponse, type BackendListProjectsResponse, type BackendListWebhookDeliveriesResponse, type BackendListWebhooksResponse, type BackendLoginRequest, type BackendLoginResponse, type BackendMemberResponse, type BackendOAuthCallbackParams, type BackendPortalResponse, type BackendProjectResponse, type BackendRagConfigResponse, type BackendReadinessResponse, type BackendRetryWebhookDeliveryResponse, type BackendSandboxExtractParams, type BackendSandboxExtractResponse, type BackendSetRagConfigRequest, type BackendUpdateMemberRoleRequest, type BackendUpdateProjectRequest, type BackendUpdateWebhookRequest, type BackendUsageResponse, type BackendWebhookResponse, type BackendWebhookTestResponse, type BackoffStrategy, type BeginOAuthResponse, type ConfirmUploadRequest, type ConfirmUploadResponse, type CrawlCompleteEvent, type CrawlDiscoveredEvent, type CrawlErrorEvent, type CrawlEvent, type CrawlEventKind, type CrawlPageEvent, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateAutoTuneJobRequest, type CreateAutoTuneJobResponse, type CreateClientOptions, type CreateIntegrationRequest, type CreateProjectRequest, type CreateSavedPresetRequest, type CreateSavedPresetResponse, type DiffAsyncAccepted, type DiffResponse, type DiffResult, type DocumentInput, type DocumentResponse, type DocumentVersionEntry, type EnrichJobStatus, type EnrichJobSubmitted, type EnrichRequestOptions, type EnrichTextRequest, type ExtractAndWaitParams, type ExtractBatchParams, type ExtractParams, type ExtractResponse, type ExtractedDocument, type ExtractionConfig, type ExtractionEventSummary, type ExtractionOptions, type ExtractionResult, type FileExtractionConfig, type FileLike, type GetJobResponse, type IntegrationResponse, type Job, type JobResult, type JobResultError, type JobStatus, type ListApiKeysResponse, type ListAuditEntriesResponse, type ListAutoTuneJobsResponse, type ListDocumentsResponse, type ListExtractionEventsParams, type ListExtractionEventsResponse, type ListIntegrationDocumentsParams, type ListIntegrationsResponse, type ListJobsParams, type ListJobsResponse, type ListProjectsResponse, type ListSavedPresetsResponse, type ListTuningProfilesResponse, type LoginRequest, type LoginResponse, NotFoundError, type PaginationParams, type PresetDetail, type PresetSummary, type PresignUploadRequest, type PresignUploadResponse, type ProjectResponse, type PromoteProfileRequest, type PublicSandboxExtractParams, type RagConfigResponse, RateLimitError, type RateLimitErrorOptions, SUCCESS_JOB_STATUSES, type SavedPresetDetail, type SavedPresetSummary, ServerError, type SetRagConfigRequest, type StreamCrawlEventsOptions, type SubmitAutoTuneParams, TERMINAL_JOB_STATUSES, type Target, TimeoutError, type TuningProfileDetail, type TuningProfileSummary, type UpdateSavedPresetRequest, type UpdateSavedPresetResponse, type UsageResponse, ValidationError, type WaitOptions, type WebhookConfig, XbergClient, type XbergClientOptions, XbergError, type XbergErrorOptions, type XbergRawClient, type components as backendComponents, type paths as backendPaths, type components$1 as components, createClient, type paths$1 as paths, type components$2 as proComponents, type paths$2 as proPaths };
30306
31515
  //# sourceMappingURL=index.d.ts.map