@talonic/docs 0.21.3 → 0.21.5

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/seo.js CHANGED
@@ -60,7 +60,7 @@ var openapi_default = {
60
60
  },
61
61
  {
62
62
  name: "Delivery",
63
- description: 'Outbound delivery. Configure destinations (six live connectors: webhook, sftp,\ns3, azure_blob, google_drive, onedrive), create bindings that join signal filters\nto deliverable types + destinations + serializers, and inspect the\nhistory/DLQ/events log. Every delivery is at-least-once with an idempotency key\non the wire.\n\n## Webhook Contract\n\n**Event payload:**\n```json\n{\n "event": {\n "event_type": "document.extracted",\n "event_id": "42",\n "binding_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",\n "idempotency_key": "c9f3a7e1b2d4f6a8e0c2d4f6a8e0c2d4",\n "attempt": 1,\n "delivered_at": "2026-04-25T14:30:00.000Z"\n },\n "payload": { "document_id": "...", "data": { "...extracted fields..." } }\n}\n```\n\n**Event types:** `document.extracted`, `document.extraction_failed`,\n`run.dataspace.completed`, `run.dataspace.failed`, `result.dataspace.completed`,\n`result.dataspace.failed`, `run.structuring.completed`, `run.structuring.failed`,\n`run.resolution.completed`, `run.resolution.failed`, `run.extraction.completed`,\n`run.extraction.failed`, `result.flagged`, `result.approved`, `result.rejected`,\n`delivery.item.completed`, `delivery.item.failed`.\n\n**Signature verification (HMAC-SHA256):**\n\nHeader: `X-Talonic-Signature: t=1714060200000,v1=abc123...`\n\n```javascript\nconst crypto = require(\'crypto\');\nconst [tPart, vPart] = signature.split(\',\');\nconst timestamp = tPart.split(\'=\')[1];\nconst received = vPart.split(\'=\')[1];\nconst expected = crypto.createHmac(\'sha256\', signingSecret)\n .update(timestamp + \'.\' + rawBody).digest(\'hex\');\nconst valid = crypto.timingSafeEqual(\n Buffer.from(received), Buffer.from(expected));\n```\n\n**Retry policy:** Up to 7 attempts \u2014 0s, 30s, 2m, 8m, 30m, 2h, 8h (~10.5h total).\nHTTP 429/5xx are retryable. HTTP 4xx (except 408) goes to DLQ immediately.\n\n**Dead-letter queue recovery:** When all retries are exhausted, the delivery\nlands in the DLQ. List failed deliveries with `GET /v1/delivery/dlq`\n(filterable by `binding_id` and `error_code`). Inspect a single entry with\n`GET /v1/delivery/dlq/{id}`. Replay with `POST /v1/delivery/dlq/{id}/replay`\n\u2014 this deletes the DLQ entry, re-signs the payload with the current\nsigning secret, resets the retry counter to attempt 1, and re-enqueues\nthe delivery through the full backoff ladder.\n'
63
+ description: 'Outbound delivery. Configure destinations (six live connectors: webhook, sftp,\ns3, azure_blob, google_drive, onedrive), create bindings that join signal filters\nto deliverable types + destinations + serializers, and inspect the\nhistory/DLQ/events log. Every delivery is at-least-once with an idempotency key\non the wire.\n\n## Webhook Contract\n\n**Event payload:**\n```json\n{\n "event": {\n "event_type": "document.extracted",\n "event_id": "42",\n "binding_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",\n "idempotency_key": "c9f3a7e1b2d4f6a8e0c2d4f6a8e0c2d4",\n "attempt": 1,\n "delivered_at": "2026-04-25T14:30:00.000Z"\n },\n "payload": { "document_id": "...", "data": { "...extracted fields..." } }\n}\n```\n\n**Event types:** `document.extracted`, `document.extraction_failed`,\n`document.structured` (per-document structured fields from a Spec pipeline / `/v1/run`; deliver with the `pipeline.capture` deliverable),\n`run.dataspace.completed`, `run.dataspace.failed`, `result.dataspace.completed`,\n`result.dataspace.failed`, `run.structuring.completed`, `run.structuring.failed`,\n`run.resolution.completed`, `run.resolution.failed`, `run.extraction.completed`,\n`run.extraction.failed`, `result.flagged`, `result.approved`, `result.rejected`,\n`delivery.item.completed`, `delivery.item.failed`.\n\n**Signature verification (HMAC-SHA256):**\n\nHeader: `X-Talonic-Signature: t=1714060200000,v1=abc123...`\n\n```javascript\nconst crypto = require(\'crypto\');\nconst [tPart, vPart] = signature.split(\',\');\nconst timestamp = tPart.split(\'=\')[1];\nconst received = vPart.split(\'=\')[1];\nconst expected = crypto.createHmac(\'sha256\', signingSecret)\n .update(timestamp + \'.\' + rawBody).digest(\'hex\');\nconst valid = crypto.timingSafeEqual(\n Buffer.from(received), Buffer.from(expected));\n```\n\n**Retry policy:** Up to 7 attempts \u2014 0s, 30s, 2m, 8m, 30m, 2h, 8h (~10.5h total).\nHTTP 429/5xx are retryable. HTTP 4xx (except 408) goes to DLQ immediately.\n\n**Dead-letter queue recovery:** When all retries are exhausted, the delivery\nlands in the DLQ. List failed deliveries with `GET /v1/delivery/dlq`\n(filterable by `binding_id` and `error_code`). Inspect a single entry with\n`GET /v1/delivery/dlq/{id}`. Replay with `POST /v1/delivery/dlq/{id}/replay`\n\u2014 this deletes the DLQ entry, re-signs the payload with the current\nsigning secret, resets the retry counter to attempt 1, and re-enqueues\nthe delivery through the full backoff ladder.\n'
64
64
  },
65
65
  {
66
66
  name: "Filter",
@@ -166,6 +166,10 @@ var openapi_default = {
166
166
  name: "Pipelines",
167
167
  description: "Run a configured Spec end to end (the One Engine) over a set of documents, poll progress, and produce a data product."
168
168
  },
169
+ {
170
+ name: "Run",
171
+ description: "One-call ingest + Spec-pipeline run. `POST /v1/run` accepts files and/or file URLs directly (no separate ingest step), starts the named Spec's compiled pipeline, and returns a poll target \u2014 unlike `POST /v1/pipelines`, which requires documents to already exist. Poll `GET /v1/run/{id}` or register a webhook (`POST /v1/webhooks`, events `run.completed` / `run.failed`) to be notified on completion.\n"
172
+ },
169
173
  {
170
174
  name: "Webhooks",
171
175
  description: "Outbound HMAC-signed event webhooks \u2014 configure endpoints and read the event catalog, delivery format, signature scheme, and retry policy."
@@ -237,6 +241,15 @@ var openapi_default = {
237
241
  options: {
238
242
  type: "string",
239
243
  description: "JSON string of extraction options.\n- `async` (boolean) \u2014 force async (`true`) or sync (`false`) processing.\n"
244
+ },
245
+ batch_id: {
246
+ type: "string",
247
+ maxLength: 200,
248
+ description: "Optional caller grouping key stamped on the document (documents.client_batch_id)."
249
+ },
250
+ metadata: {
251
+ type: "string",
252
+ description: "Optional JSON string of a FLAT object `{ [key]: string | number | boolean | null }` (nested objects/arrays rejected 400; \u226450 keys, key \u2264128, string value \u22641024), stamped on the document as documents.client_metadata.\n"
240
253
  }
241
254
  }
242
255
  },
@@ -2351,6 +2364,15 @@ var openapi_default = {
2351
2364
  ],
2352
2365
  default: "realtime",
2353
2366
  description: '"realtime" (default) \u2014 processed immediately.\n"batch" \u2014 50% cost discount, results within 48 hours.\n'
2367
+ },
2368
+ batch_id: {
2369
+ type: "string",
2370
+ maxLength: 200,
2371
+ description: "Optional caller grouping key stamped on the document (documents.client_batch_id)."
2372
+ },
2373
+ metadata: {
2374
+ type: "string",
2375
+ description: "Optional JSON string of a FLAT object `{ [key]: string | number | boolean | null }` (nested objects/arrays rejected 400; \u226450 keys, key \u2264128, string value \u22641024), stamped on the document as documents.client_metadata.\n"
2354
2376
  }
2355
2377
  }
2356
2378
  }
@@ -17139,8 +17161,7 @@ var openapi_default = {
17139
17161
  description: "Created pipeline run with links to progress + data-product."
17140
17162
  },
17141
17163
  "400": {
17142
- description: "The Spec has no composed rail",
17143
- "or the body failed validation.": null
17164
+ description: "The Spec has no composed rail, or the body failed validation."
17144
17165
  }
17145
17166
  }
17146
17167
  }
@@ -17339,6 +17360,226 @@ var openapi_default = {
17339
17360
  }
17340
17361
  }
17341
17362
  },
17363
+ "/v1/run": {
17364
+ post: {
17365
+ tags: [
17366
+ "Run"
17367
+ ],
17368
+ summary: "Ingest documents and run a Spec's pipeline in one call",
17369
+ description: 'Accepts one or more files, one or more `file_urls`, or a mix of both \u2014 at least one input is required. Ingests every input (metering each ingest leg), waits for OCR to finish, then compiles the named Spec\'s saved rail into a pipeline and starts it \u2014 the same compile step `POST /v1/pipelines` uses, minus the separate "upload documents first" step. Always returns 202; poll `GET /v1/run/{id}` or listen for the `run.completed` / `run.failed` webhook (`POST /v1/webhooks`). Requires write scope. Unlike `POST /v1/process`, this endpoint does not dedup \u2014 every call starts a fresh run.\n',
17370
+ operationId: "createRun",
17371
+ security: [
17372
+ {
17373
+ BearerAuth: []
17374
+ }
17375
+ ],
17376
+ requestBody: {
17377
+ required: true,
17378
+ content: {
17379
+ "multipart/form-data": {
17380
+ schema: {
17381
+ type: "object",
17382
+ required: [
17383
+ "spec_id"
17384
+ ],
17385
+ properties: {
17386
+ spec_id: {
17387
+ type: "string",
17388
+ format: "uuid",
17389
+ description: "The Spec (user_schema) whose saved rail runs."
17390
+ },
17391
+ files: {
17392
+ type: "array",
17393
+ items: {
17394
+ type: "string",
17395
+ format: "binary"
17396
+ },
17397
+ description: "Zero or more document files (max 20 per call, 500 MB each). At least one of files/file_urls is required."
17398
+ },
17399
+ file_urls: {
17400
+ type: "array",
17401
+ items: {
17402
+ type: "string",
17403
+ format: "uri"
17404
+ },
17405
+ description: "Zero or more remote document URLs (SSRF-guarded downstream)."
17406
+ },
17407
+ name: {
17408
+ type: "string",
17409
+ maxLength: 200,
17410
+ description: "Optional display name for the run."
17411
+ },
17412
+ batch_id: {
17413
+ type: "string",
17414
+ maxLength: 200,
17415
+ description: "Optional caller grouping key stamped on every document ingested by this call (documents.client_batch_id) and echoed by GET /v1/run/{id}. Opaque to the platform \u2014 an external job/batch id for grouping.\n"
17416
+ },
17417
+ metadata: {
17418
+ type: "string",
17419
+ description: "Optional JSON string of a FLAT object `{ [key]: string | number | boolean | null }` (nested objects/arrays are rejected 400; limits: \u226450 keys, key \u2264128 chars, string value \u22641024 chars). The validated object is persisted on the run request (echoed by GET /v1/run/{id}) AND stamped on every ingested document as documents.client_metadata.\n"
17420
+ }
17421
+ }
17422
+ }
17423
+ }
17424
+ }
17425
+ },
17426
+ responses: {
17427
+ "202": {
17428
+ description: "Ingest + run accepted.",
17429
+ content: {
17430
+ "application/json": {
17431
+ schema: {
17432
+ type: "object",
17433
+ properties: {
17434
+ run_id: {
17435
+ type: "string",
17436
+ format: "uuid"
17437
+ },
17438
+ spec_id: {
17439
+ type: "string",
17440
+ format: "uuid"
17441
+ },
17442
+ status: {
17443
+ type: "string",
17444
+ enum: [
17445
+ "processing"
17446
+ ]
17447
+ },
17448
+ input_count: {
17449
+ type: "integer",
17450
+ description: "Total files + file_urls accepted."
17451
+ },
17452
+ poll_url: {
17453
+ type: "string",
17454
+ example: "/v1/run/3d44a4dc-e3e4-4bca-b079-a9c85bf75026"
17455
+ }
17456
+ }
17457
+ }
17458
+ }
17459
+ }
17460
+ },
17461
+ "400": {
17462
+ description: "Missing spec_id, no input provided (both files and file_urls empty), or metadata is not a valid flat JSON object."
17463
+ },
17464
+ "402": {
17465
+ description: "Insufficient credits for an ingest leg."
17466
+ },
17467
+ "413": {
17468
+ description: "A file exceeds the tier's per-file size cap."
17469
+ },
17470
+ "429": {
17471
+ $ref: "#/components/responses/RateLimitExceeded"
17472
+ }
17473
+ }
17474
+ }
17475
+ },
17476
+ "/v1/run/{id}": {
17477
+ get: {
17478
+ tags: [
17479
+ "Run"
17480
+ ],
17481
+ summary: "Poll a /v1/run request",
17482
+ description: "Row status, folded with the compiled pipeline's live progress once one exists (`pipeline_id` set). `status` is `processing` (ingest/OCR wait still running, no pipeline yet), `running` (pipeline active), `completed`, or `failed`. Requires read scope.\n",
17483
+ operationId: "pollRunRequest",
17484
+ security: [
17485
+ {
17486
+ BearerAuth: []
17487
+ }
17488
+ ],
17489
+ parameters: [
17490
+ {
17491
+ name: "id",
17492
+ in: "path",
17493
+ required: true,
17494
+ schema: {
17495
+ type: "string",
17496
+ format: "uuid"
17497
+ }
17498
+ }
17499
+ ],
17500
+ responses: {
17501
+ "200": {
17502
+ description: "Run request status.",
17503
+ content: {
17504
+ "application/json": {
17505
+ schema: {
17506
+ type: "object",
17507
+ properties: {
17508
+ run_id: {
17509
+ type: "string",
17510
+ format: "uuid"
17511
+ },
17512
+ spec_id: {
17513
+ type: "string",
17514
+ format: "uuid"
17515
+ },
17516
+ status: {
17517
+ type: "string",
17518
+ enum: [
17519
+ "processing",
17520
+ "running",
17521
+ "completed",
17522
+ "failed"
17523
+ ]
17524
+ },
17525
+ pipeline_id: {
17526
+ type: "string",
17527
+ format: "uuid",
17528
+ nullable: true
17529
+ },
17530
+ input_count: {
17531
+ type: "integer"
17532
+ },
17533
+ error_message: {
17534
+ type: "string",
17535
+ nullable: true
17536
+ },
17537
+ metadata: {
17538
+ type: "object",
17539
+ nullable: true,
17540
+ additionalProperties: true,
17541
+ description: "The validated flat metadata object supplied on POST /v1/run, echoed back here."
17542
+ },
17543
+ batch_id: {
17544
+ type: "string",
17545
+ nullable: true,
17546
+ description: "The caller grouping key supplied on POST /v1/run, echoed back here."
17547
+ },
17548
+ created_at: {
17549
+ type: "string",
17550
+ format: "date-time"
17551
+ },
17552
+ updated_at: {
17553
+ type: "string",
17554
+ format: "date-time"
17555
+ },
17556
+ progress: {
17557
+ type: "object",
17558
+ nullable: true,
17559
+ description: "Present once the pipeline has started.",
17560
+ properties: {
17561
+ total_documents: {
17562
+ type: "integer"
17563
+ },
17564
+ completed_documents: {
17565
+ type: "integer"
17566
+ },
17567
+ error_documents: {
17568
+ type: "integer"
17569
+ }
17570
+ }
17571
+ }
17572
+ }
17573
+ }
17574
+ }
17575
+ }
17576
+ },
17577
+ "404": {
17578
+ description: "Run request not found."
17579
+ }
17580
+ }
17581
+ }
17582
+ },
17342
17583
  "/v1/webhooks": {
17343
17584
  get: {
17344
17585
  tags: [
@@ -17391,7 +17632,7 @@ var openapi_default = {
17391
17632
  items: {
17392
17633
  type: "string"
17393
17634
  },
17394
- description: "Event types to subscribe to (default: extraction.complete, extraction.failed)."
17635
+ description: "Event types to subscribe to (default: extraction.complete, extraction.failed). Includes run.completed / run.failed \u2014 fired on POST /v1/run pipeline completion (see GET /v1/webhooks/events for the full, current catalog)."
17395
17636
  },
17396
17637
  source_connection_id: {
17397
17638
  type: "string",
@@ -17633,6 +17874,7 @@ var openapi_default = {
17633
17874
  "Webhooks"
17634
17875
  ],
17635
17876
  summary: "List supported webhook event types",
17877
+ description: 'Live catalog served from code (not a static enum) \u2014 includes run.completed ("A /v1/run pipeline finished; structured output is available, review-held fields null") and run.failed ("A /v1/run pipeline failed \u2014 all documents errored during ingest or extraction") alongside the document/extraction/job/delivery/process event families.\n',
17636
17878
  operationId: "listWebhookEvents",
17637
17879
  security: [
17638
17880
  {
@@ -19619,6 +19861,27 @@ var openapi_default = {
19619
19861
  }
19620
19862
  }
19621
19863
  },
19864
+ batch_id: {
19865
+ type: "string",
19866
+ description: "Caller grouping key supplied at ingest (batch_id). Present ONLY when the document was tagged; omitted otherwise (backwards-compatible).\n",
19867
+ example: "2026-07-14-run-042"
19868
+ },
19869
+ metadata: {
19870
+ type: "object",
19871
+ additionalProperties: {
19872
+ type: [
19873
+ "string",
19874
+ "number",
19875
+ "boolean",
19876
+ "null"
19877
+ ]
19878
+ },
19879
+ description: "Caller flat metadata supplied at ingest. Present ONLY when the document was tagged; omitted otherwise (backwards-compatible).\n",
19880
+ example: {
19881
+ customer: "bridgeway",
19882
+ source: "sftp"
19883
+ }
19884
+ },
19622
19885
  extraction_count: {
19623
19886
  type: "integer",
19624
19887
  example: 1
@@ -21645,6 +21908,14 @@ var openapi_default = {
21645
21908
  type: "object",
21646
21909
  additionalProperties: true
21647
21910
  },
21911
+ resolver_config: {
21912
+ type: [
21913
+ "object",
21914
+ "null"
21915
+ ],
21916
+ additionalProperties: true,
21917
+ description: "Per-binding resolver options threaded into the deliverable resolver. First consumer: `null_handling` on the `pipeline.capture` deliverable \u2014 `always_null` (default: every declared schema field present, missing values as null), `omit_absent` (valued fields only), or `distinguish` (null = deliberately cleared by resolution; never-captured keys omitted). The sparse modes require a json or ndjson serializer (compatibility validated on create/update).\n"
21918
+ },
21648
21919
  delivery_policy: {
21649
21920
  $ref: "#/components/schemas/DeliveryPolicy"
21650
21921
  },
@@ -21703,6 +21974,11 @@ var openapi_default = {
21703
21974
  type: "object",
21704
21975
  additionalProperties: true
21705
21976
  },
21977
+ resolver_config: {
21978
+ type: "object",
21979
+ additionalProperties: true,
21980
+ description: 'Per-binding resolver options \u2014 e.g. `{"null_handling": "distinguish"}` on a `pipeline.capture` binding. Sparse modes (`omit_absent`, `distinguish`) require a json/ndjson serializer (400 otherwise).\n'
21981
+ },
21706
21982
  delivery_policy: {
21707
21983
  $ref: "#/components/schemas/DeliveryPolicy"
21708
21984
  },
@@ -21739,6 +22015,11 @@ var openapi_default = {
21739
22015
  type: "object",
21740
22016
  additionalProperties: true
21741
22017
  },
22018
+ resolver_config: {
22019
+ type: "object",
22020
+ additionalProperties: true,
22021
+ description: 'Per-binding resolver options \u2014 e.g. `{"null_handling": "distinguish"}` on a `pipeline.capture` binding. Sparse modes (`omit_absent`, `distinguish`) require a json/ndjson serializer (400 otherwise).\n'
22022
+ },
21742
22023
  delivery_policy: {
21743
22024
  $ref: "#/components/schemas/DeliveryPolicy"
21744
22025
  },
@@ -25197,6 +25478,10 @@ var API_NAV_SECTIONS = [
25197
25478
  { id: "error-codes", label: "Error Codes" },
25198
25479
  { id: "rate-limits", label: "Rate Limits" }
25199
25480
  ] },
25481
+ { id: "run", label: "Run", children: [
25482
+ { id: "run-spec", label: "Run a Spec" },
25483
+ { id: "poll-spec-run", label: "Poll a Run" }
25484
+ ] },
25200
25485
  { id: "pipelines", label: "Pipelines", children: [
25201
25486
  { id: "run-pipeline", label: "Run Pipeline" },
25202
25487
  { id: "list-pipelines", label: "List Pipelines" },