@epilot/sdk 2.20.26 → 2.20.28
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/definitions/document-runtime.json +1 -1
- package/definitions/document.json +218 -4
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/chat.cjs +6 -6
- package/dist/apis/chat.d.cts +2 -2
- package/dist/apis/chat.d.ts +2 -2
- package/dist/apis/chat.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.d.cts +2 -2
- package/dist/apis/configuration-hub.d.ts +2 -2
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +8 -8
- package/dist/apis/document.d.cts +2 -2
- package/dist/apis/document.d.ts +2 -2
- package/dist/apis/document.js +2 -2
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/{chat.d-CQ5eRtNU.d.cts → chat.d-0w0TaT-a.d.cts} +20 -20
- package/dist/{chat.d-CQ5eRtNU.d.ts → chat.d-0w0TaT-a.d.ts} +20 -20
- package/dist/{chunk-M56QQHVA.cjs → chunk-E2EHXQRP.cjs} +1 -1
- package/dist/{chunk-75EI2Q64.js → chunk-LR7LGGRU.js} +1 -1
- package/dist/{chunk-6CWZ6WAC.cjs → chunk-UM53DB6T.cjs} +2 -2
- package/dist/{chunk-ELW5R5D6.js → chunk-W5PMKQO7.js} +2 -2
- package/dist/{configuration-hub.d-Dv41yC3b.d.cts → configuration-hub.d-DhPrjJkE.d.cts} +142 -142
- package/dist/{configuration-hub.d-Dv41yC3b.d.ts → configuration-hub.d-DhPrjJkE.d.ts} +142 -142
- package/dist/document-UGT6DAXC.cjs +7 -0
- package/dist/document-UR5WWZEA.js +7 -0
- package/dist/{document-runtime-GFEBGNMS.js → document-runtime-LFOBMSE4.js} +1 -1
- package/dist/{document-runtime-RG3F4R6O.cjs → document-runtime-QM4H7DLT.cjs} +2 -2
- package/dist/{document.d-DN37pjdx.d.ts → document.d-B0zC-R8x.d.cts} +235 -7
- package/dist/{document.d-DN37pjdx.d.cts → document.d-B0zC-R8x.d.ts} +235 -7
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/docs/document.md +145 -6
- package/package.json +1 -1
- package/dist/document-CY2A2OE7.js +0 -7
- package/dist/document-RYQ7MF6U.cjs +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
+
|
|
3
|
+
// src/docs/document.json
|
|
4
|
+
var document_default = '# Document API\n\n- **Base URL:** `https://document.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/document](https://docs.epilot.io/api/document)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.document.getTemplateMeta(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/document\'\n\nconst documentClient = getClient()\nauthorize(documentClient, () => \'<token>\')\nconst { data } = await documentClient.getTemplateMeta(...)\n```\n\n## Operations\n\n**Documents**\n- [`getTemplateMeta`](#gettemplatemeta)\n- [`generateDocumentV2`](#generatedocumentv2)\n- [`convertDocument`](#convertdocument)\n- [`validateTemplate`](#validatetemplate)\n\n**Schemas**\n- [`S3Reference`](#s3reference)\n- [`ErrorOutput`](#erroroutput)\n- [`InvalidCustomVariableErrorDetails`](#invalidcustomvariableerrordetails)\n- [`InvalidCustomVariableErrorDetail`](#invalidcustomvariableerrordetail)\n- [`InternalErrorDetails`](#internalerrordetails)\n- [`InternalErrorDetail`](#internalerrordetail)\n- [`DocxTemplaterErrorDetails`](#docxtemplatererrordetails)\n- [`DocxTemplaterErrorDetail`](#docxtemplatererrordetail)\n- [`ErrorCode`](#errorcode)\n- [`TemplateValidationRequest`](#templatevalidationrequest)\n- [`TemplateValidationResponse`](#templatevalidationresponse)\n- [`TemplateIssue`](#templateissue)\n- [`TemplateSettings`](#templatesettings)\n- [`DocumentMetaRequest`](#documentmetarequest)\n- [`DocumentMetaResponse`](#documentmetaresponse)\n- [`DocumentGenerationV2Request`](#documentgenerationv2request)\n- [`DocumentGenerationV2Response`](#documentgenerationv2response)\n- [`ConvertDocumentRequest`](#convertdocumentrequest)\n- [`ConvertDocumentResponse`](#convertdocumentresponse)\n\n### `getTemplateMeta`\n\nGet metadata for a document template\n\n`POST /v2/documents:meta`\n\n```ts\nconst { data } = await client.getTemplateMeta(\n null,\n {\n template_document: {\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "page_margins": {\n "top": 2.54,\n "bottom": 2.54,\n "left": 2.54,\n "right": 2.54,\n "header": 2.54,\n "footer": 2.54\n },\n "variables": ["order.billing_contact.0.salutation", "order.billing_contact.0.title", "order_table", "stayHardStatic", "opportunity[attribute_name]", "opportunity[\\"attribute_name\\"]", "opportunity.[attribute_name]", "attribute_name", "opportunities.0.attribute_name", "opportunities[0].attribute_name", "contact.opportunities[0].attribute_name", "opportunities[Primary].attribute_name"]\n}\n```\n\n</details>\n\n---\n\n### `generateDocumentV2`\n\nGenerates documents from templates with variables.\n\n`POST /v2/documents:generate`\n\n```ts\nconst { data } = await client.generateDocumentV2(\n {\n job_id: \'example\',\n mode: \'example\',\n preview_mode: \'example\',\n },\n {\n template_document: {\n filename: \'my-template-{{order.order_number}}.docx\',\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n },\n context_entity_id: \'bcd0aab9-b544-42b0-8bfb-6d449d02eacc\',\n user_id: \'100321\',\n language: \'de\',\n variable_payload: {\n additionalProperties: \'string\'\n },\n context_data: {\n additionalProperties: \'string\'\n },\n template_settings: {\n custom_margins: {\n top: 2.54,\n bottom: 2.54\n },\n suggested_margins: {\n top: 2.54,\n bottom: 2.54\n },\n display_margin_guidelines: true,\n enable_data_table_margin_autofix: false,\n template_with_datatable: false,\n enabled_template_settings_persistence: false,\n misconfigured_margins: false,\n file_entity_id: \'123e4567-e89b-12d3-a456-426614174000\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "job_status": "STARTED",\n "message": "string",\n "ics_output": {\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-appointment.ics"\n }\n }\n },\n "pdf_output": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf",\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-template.pdf"\n }\n }\n },\n "docx_output": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx",\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-template.docx"\n }\n }\n },\n "xlsx_output": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.xlsx",\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-template.xlsx"\n }\n }\n },\n "error_output": {\n "error_message": "string",\n "error_code": "PARSE_ERROR",\n "error_details": [\n {\n "explanation": "string",\n "context": {\n "invalid_variables": [\n {\n "variable": "string",\n "error": "string"\n }\n ]\n }\n }\n ]\n },\n "variable_payload": {\n "additionalProperties": "string"\n },\n "template_settings": {\n "custom_margins": {\n "top": 2.54,\n "bottom": 2.54\n },\n "suggested_margins": {\n "top": 2.54,\n "bottom": 2.54\n },\n "display_margin_guidelines": true,\n "enable_data_table_margin_autofix": false,\n "template_with_datatable": false,\n "enabled_template_settings_persistence": false,\n "misconfigured_margins": false,\n "file_entity_id": "123e4567-e89b-12d3-a456-426614174000"\n }\n}\n```\n\n</details>\n\n---\n\n### `convertDocument`\n\nConverts a document to a different format.\n\n`POST /v2/documents:convert`\n\n```ts\nconst { data } = await client.convertDocument(\n null,\n {\n language: \'de\',\n input_document: {\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n },\n output_format: \'pdf\',\n output_filename: \'converted.pdf\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "output_document": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/converted.pdf",\n "s3ref": {\n "bucket": "document-api-prod",\n "key": "uploads/my-template.pdf"\n }\n }\n}\n```\n\n</details>\n\n---\n\n### `validateTemplate`\n\nValidates a document template\'s variable syntax and, optionally, proposes a hotfixed copy of it.\n\n`POST /v2/templates:validate`\n\n```ts\nconst { data } = await client.validateTemplate(\n null,\n {\n template_document: {\n filename: \'Umzugsmeldung.xlsx\',\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n },\n fix: true,\n fix_level: \'safe\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "valid": false,\n "fixed": true,\n "issues": [\n {\n "id": "unopened_tag",\n "file": "xl/sharedStrings.xml",\n "location": "Tabelle1!N4",\n "context": "\u2026Datum: {system.date}} Unterschrift\u2026",\n "explanation": "The tag is missing an opening brace.",\n "fixable": true,\n "confidence": "high",\n "rule": "balance_opening_delimiter",\n "before": "{system.date}}",\n "after": "{{system.date}}"\n }\n ],\n "unresolved_errors": [\n {\n "id": "string",\n "context": "string",\n "explanation": "string"\n }\n ],\n "fixed_document": {\n "s3ref": {\n "bucket": "document-api-prod",\n "key": "uploads/my-template.pdf"\n },\n "filename": "Umzugsmeldung (fixed).xlsx",\n "preview_url": "https://example.com/path"\n }\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `S3Reference`\n\n```ts\ntype S3Reference = {\n bucket: string\n key: string\n}\n```\n\n### `ErrorOutput`\n\n```ts\ntype ErrorOutput = {\n error_message?: string\n error_code?: "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT" | "TEMPLATE_NOT_FOUND"\n error_details?: Array<{\n explanation?: string\n context?: {\n invalid_variables?: { ... }\n }\n }> | Array<{\n items?: {\n name?: { ... }\n message?: { ... }\n stack?: { ... }\n cause?: { ... }\n }\n }> | Array<{\n id?: string\n context?: string\n explanation?: string\n }>\n}\n```\n\n### `InvalidCustomVariableErrorDetails`\n\nError details for invalid custom variables. This error will appear under \'PARSE_ERROR\' error code.\n\n```ts\ntype InvalidCustomVariableErrorDetails = Array<{\n explanation?: string\n context?: {\n invalid_variables?: Array<{\n variable?: { ... }\n error?: { ... }\n }>\n }\n}>\n```\n\n### `InvalidCustomVariableErrorDetail`\n\n```ts\ntype InvalidCustomVariableErrorDetail = {\n explanation?: string\n context?: {\n invalid_variables?: Array<{\n variable?: { ... }\n error?: { ... }\n }>\n }\n}\n```\n\n### `InternalErrorDetails`\n\nError details for internal error. This error will appear under \'INTERNAL_ERROR\' error code.\n\n```ts\ntype InternalErrorDetails = Array<{\n items?: {\n name?: string\n message?: string\n stack?: string\n cause?: string\n }\n}>\n```\n\n### `InternalErrorDetail`\n\nInternal error detail\n\n```ts\ntype InternalErrorDetail = {\n name?: string\n message?: string\n stack?: string\n cause?: string\n}\n```\n\n### `DocxTemplaterErrorDetails`\n\nError details for DocxTemplater error. This error will appear under \'PARSE_ERROR\' error code.\nSee https://docxtemplater.com/docs/errors/#error-schema for more details.\n\n\n```ts\ntype DocxTemplaterErrorDetails = Array<{\n id?: string\n context?: string\n explanation?: string\n}>\n```\n\n### `DocxTemplaterErrorDetail`\n\nDocxTemplater error detail\n\n```ts\ntype DocxTemplaterErrorDetail = {\n id?: string\n context?: string\n explanation?: string\n}\n```\n\n### `ErrorCode`\n\nError codes for document generation:\n- PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.\n- DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.\n- INTERNAL_ERROR - In\n\n```ts\ntype ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT" | "TEMPLATE_NOT_FOUND"\n```\n\n### `TemplateValidationRequest`\n\n```ts\ntype TemplateValidationRequest = {\n template_document: {\n filename?: string\n s3ref: {\n bucket: { ... }\n key: { ... }\n }\n }\n fix?: boolean\n fix_level?: "safe" | "aggressive"\n}\n```\n\n### `TemplateValidationResponse`\n\n```ts\ntype TemplateValidationResponse = {\n valid?: boolean\n fixed?: boolean\n issues?: Array<{\n id?: string\n file?: string\n location?: string\n context?: string\n explanation?: string\n fixable?: boolean\n confidence?: "high" | "medium" | "low"\n rule?: string\n before?: string\n after?: string\n }>\n unresolved_errors?: Array<{\n id?: string\n context?: string\n explanation?: string\n }>\n fixed_document?: {\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n filename?: string\n preview_url?: string // uri\n }\n}\n```\n\n### `TemplateIssue`\n\nA single template syntax problem, and the repair proposed for it\n\n```ts\ntype TemplateIssue = {\n id?: string\n file?: string\n location?: string\n context?: string\n explanation?: string\n fixable?: boolean\n confidence?: "high" | "medium" | "low"\n rule?: string\n before?: string\n after?: string\n}\n```\n\n### `TemplateSettings`\n\nTemplate Settings for document generation\n\n```ts\ntype TemplateSettings = {\n custom_margins?: {\n top?: number\n bottom?: number\n }\n suggested_margins?: {\n top?: number\n bottom?: number\n }\n display_margin_guidelines?: boolean\n enable_data_table_margin_autofix?: boolean\n template_with_datatable?: boolean\n enabled_template_settings_persistence?: boolean\n misconfigured_margins?: boolean\n file_entity_id?: string // uuid\n}\n```\n\n### `DocumentMetaRequest`\n\n```ts\ntype DocumentMetaRequest = {\n template_document?: {\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n }\n}\n```\n\n### `DocumentMetaResponse`\n\n```ts\ntype DocumentMetaResponse = {\n page_margins?: {\n top?: number\n bottom?: number\n left?: number\n right?: number\n header?: number\n footer?: number\n }\n variables?: string[]\n}\n```\n\n### `DocumentGenerationV2Request`\n\n```ts\ntype DocumentGenerationV2Request = {\n template_document: {\n filename?: string\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n }\n context_entity_id?: string // uuid\n user_id?: string\n language?: string\n variable_payload?: {\n additionalProperties?: string\n }\n context_data?: {\n additionalProperties?: string\n }\n template_settings?: {\n custom_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n suggested_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n display_margin_guidelines?: boolean\n enable_data_table_margin_autofix?: boolean\n template_with_datatable?: boolean\n enabled_template_settings_persistence?: boolean\n misconfigured_margins?: boolean\n file_entity_id?: string // uuid\n }\n}\n```\n\n### `DocumentGenerationV2Response`\n\n```ts\ntype DocumentGenerationV2Response = {\n job_id?: string // uuid\n job_status?: "STARTED" | "PROCESSING" | "SUCCESS" | "FAILED"\n message?: string\n ics_output?: {\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n pdf_output?: {\n preview_url?: string\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n docx_output?: {\n preview_url?: string\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n xlsx_output?: {\n preview_url?: string\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n error_output?: {\n error_message?: string\n error_code?: "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT" | "TEMPLATE_NOT_FOUND"\n error_details?: Array<{\n explanation?: { ... }\n context?: { ... }\n }> | Array<{\n items?: { ... }\n }> | Array<{\n id?: { ... }\n context?: { ... }\n explanation?: { ... }\n }>\n }\n variable_payload?: {\n additionalProperties?: string\n }\n template_settings?: {\n custom_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n suggested_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n display_margin_guidelines?: boolean\n enable_data_table_margin_autofix?: boolean\n template_with_datatable?: boolean\n enabled_template_settings_persistence?: boolean\n misconfigured_margins?: boolean\n file_entity_id?: string // uuid\n }\n}\n```\n\n### `ConvertDocumentRequest`\n\n```ts\ntype ConvertDocumentRequest = {\n language?: string\n input_document: {\n s3ref: {\n bucket: { ... }\n key: { ... }\n }\n }\n output_format: "pdf"\n output_filename?: string\n}\n```\n\n### `ConvertDocumentResponse`\n\n```ts\ntype ConvertDocumentResponse = {\n output_document?: {\n preview_url?: string\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n }\n}\n```\n';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.default = document_default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./chunk-YPSWSI3M.js";
|
|
2
|
+
|
|
3
|
+
// src/docs/document.json
|
|
4
|
+
var document_default = '# Document API\n\n- **Base URL:** `https://document.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/document](https://docs.epilot.io/api/document)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.document.getTemplateMeta(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/document\'\n\nconst documentClient = getClient()\nauthorize(documentClient, () => \'<token>\')\nconst { data } = await documentClient.getTemplateMeta(...)\n```\n\n## Operations\n\n**Documents**\n- [`getTemplateMeta`](#gettemplatemeta)\n- [`generateDocumentV2`](#generatedocumentv2)\n- [`convertDocument`](#convertdocument)\n- [`validateTemplate`](#validatetemplate)\n\n**Schemas**\n- [`S3Reference`](#s3reference)\n- [`ErrorOutput`](#erroroutput)\n- [`InvalidCustomVariableErrorDetails`](#invalidcustomvariableerrordetails)\n- [`InvalidCustomVariableErrorDetail`](#invalidcustomvariableerrordetail)\n- [`InternalErrorDetails`](#internalerrordetails)\n- [`InternalErrorDetail`](#internalerrordetail)\n- [`DocxTemplaterErrorDetails`](#docxtemplatererrordetails)\n- [`DocxTemplaterErrorDetail`](#docxtemplatererrordetail)\n- [`ErrorCode`](#errorcode)\n- [`TemplateValidationRequest`](#templatevalidationrequest)\n- [`TemplateValidationResponse`](#templatevalidationresponse)\n- [`TemplateIssue`](#templateissue)\n- [`TemplateSettings`](#templatesettings)\n- [`DocumentMetaRequest`](#documentmetarequest)\n- [`DocumentMetaResponse`](#documentmetaresponse)\n- [`DocumentGenerationV2Request`](#documentgenerationv2request)\n- [`DocumentGenerationV2Response`](#documentgenerationv2response)\n- [`ConvertDocumentRequest`](#convertdocumentrequest)\n- [`ConvertDocumentResponse`](#convertdocumentresponse)\n\n### `getTemplateMeta`\n\nGet metadata for a document template\n\n`POST /v2/documents:meta`\n\n```ts\nconst { data } = await client.getTemplateMeta(\n null,\n {\n template_document: {\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "page_margins": {\n "top": 2.54,\n "bottom": 2.54,\n "left": 2.54,\n "right": 2.54,\n "header": 2.54,\n "footer": 2.54\n },\n "variables": ["order.billing_contact.0.salutation", "order.billing_contact.0.title", "order_table", "stayHardStatic", "opportunity[attribute_name]", "opportunity[\\"attribute_name\\"]", "opportunity.[attribute_name]", "attribute_name", "opportunities.0.attribute_name", "opportunities[0].attribute_name", "contact.opportunities[0].attribute_name", "opportunities[Primary].attribute_name"]\n}\n```\n\n</details>\n\n---\n\n### `generateDocumentV2`\n\nGenerates documents from templates with variables.\n\n`POST /v2/documents:generate`\n\n```ts\nconst { data } = await client.generateDocumentV2(\n {\n job_id: \'example\',\n mode: \'example\',\n preview_mode: \'example\',\n },\n {\n template_document: {\n filename: \'my-template-{{order.order_number}}.docx\',\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n },\n context_entity_id: \'bcd0aab9-b544-42b0-8bfb-6d449d02eacc\',\n user_id: \'100321\',\n language: \'de\',\n variable_payload: {\n additionalProperties: \'string\'\n },\n context_data: {\n additionalProperties: \'string\'\n },\n template_settings: {\n custom_margins: {\n top: 2.54,\n bottom: 2.54\n },\n suggested_margins: {\n top: 2.54,\n bottom: 2.54\n },\n display_margin_guidelines: true,\n enable_data_table_margin_autofix: false,\n template_with_datatable: false,\n enabled_template_settings_persistence: false,\n misconfigured_margins: false,\n file_entity_id: \'123e4567-e89b-12d3-a456-426614174000\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "job_status": "STARTED",\n "message": "string",\n "ics_output": {\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-appointment.ics"\n }\n }\n },\n "pdf_output": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf",\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-template.pdf"\n }\n }\n },\n "docx_output": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx",\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-template.docx"\n }\n }\n },\n "xlsx_output": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.xlsx",\n "output_document": {\n "s3ref": {\n "bucket": "document-api-preview-prod",\n "key": "preview/my-template.xlsx"\n }\n }\n },\n "error_output": {\n "error_message": "string",\n "error_code": "PARSE_ERROR",\n "error_details": [\n {\n "explanation": "string",\n "context": {\n "invalid_variables": [\n {\n "variable": "string",\n "error": "string"\n }\n ]\n }\n }\n ]\n },\n "variable_payload": {\n "additionalProperties": "string"\n },\n "template_settings": {\n "custom_margins": {\n "top": 2.54,\n "bottom": 2.54\n },\n "suggested_margins": {\n "top": 2.54,\n "bottom": 2.54\n },\n "display_margin_guidelines": true,\n "enable_data_table_margin_autofix": false,\n "template_with_datatable": false,\n "enabled_template_settings_persistence": false,\n "misconfigured_margins": false,\n "file_entity_id": "123e4567-e89b-12d3-a456-426614174000"\n }\n}\n```\n\n</details>\n\n---\n\n### `convertDocument`\n\nConverts a document to a different format.\n\n`POST /v2/documents:convert`\n\n```ts\nconst { data } = await client.convertDocument(\n null,\n {\n language: \'de\',\n input_document: {\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n },\n output_format: \'pdf\',\n output_filename: \'converted.pdf\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "output_document": {\n "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/converted.pdf",\n "s3ref": {\n "bucket": "document-api-prod",\n "key": "uploads/my-template.pdf"\n }\n }\n}\n```\n\n</details>\n\n---\n\n### `validateTemplate`\n\nValidates a document template\'s variable syntax and, optionally, proposes a hotfixed copy of it.\n\n`POST /v2/templates:validate`\n\n```ts\nconst { data } = await client.validateTemplate(\n null,\n {\n template_document: {\n filename: \'Umzugsmeldung.xlsx\',\n s3ref: {\n bucket: \'document-api-prod\',\n key: \'uploads/my-template.pdf\'\n }\n },\n fix: true,\n fix_level: \'safe\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "valid": false,\n "fixed": true,\n "issues": [\n {\n "id": "unopened_tag",\n "file": "xl/sharedStrings.xml",\n "location": "Tabelle1!N4",\n "context": "\u2026Datum: {system.date}} Unterschrift\u2026",\n "explanation": "The tag is missing an opening brace.",\n "fixable": true,\n "confidence": "high",\n "rule": "balance_opening_delimiter",\n "before": "{system.date}}",\n "after": "{{system.date}}"\n }\n ],\n "unresolved_errors": [\n {\n "id": "string",\n "context": "string",\n "explanation": "string"\n }\n ],\n "fixed_document": {\n "s3ref": {\n "bucket": "document-api-prod",\n "key": "uploads/my-template.pdf"\n },\n "filename": "Umzugsmeldung (fixed).xlsx",\n "preview_url": "https://example.com/path"\n }\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `S3Reference`\n\n```ts\ntype S3Reference = {\n bucket: string\n key: string\n}\n```\n\n### `ErrorOutput`\n\n```ts\ntype ErrorOutput = {\n error_message?: string\n error_code?: "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT" | "TEMPLATE_NOT_FOUND"\n error_details?: Array<{\n explanation?: string\n context?: {\n invalid_variables?: { ... }\n }\n }> | Array<{\n items?: {\n name?: { ... }\n message?: { ... }\n stack?: { ... }\n cause?: { ... }\n }\n }> | Array<{\n id?: string\n context?: string\n explanation?: string\n }>\n}\n```\n\n### `InvalidCustomVariableErrorDetails`\n\nError details for invalid custom variables. This error will appear under \'PARSE_ERROR\' error code.\n\n```ts\ntype InvalidCustomVariableErrorDetails = Array<{\n explanation?: string\n context?: {\n invalid_variables?: Array<{\n variable?: { ... }\n error?: { ... }\n }>\n }\n}>\n```\n\n### `InvalidCustomVariableErrorDetail`\n\n```ts\ntype InvalidCustomVariableErrorDetail = {\n explanation?: string\n context?: {\n invalid_variables?: Array<{\n variable?: { ... }\n error?: { ... }\n }>\n }\n}\n```\n\n### `InternalErrorDetails`\n\nError details for internal error. This error will appear under \'INTERNAL_ERROR\' error code.\n\n```ts\ntype InternalErrorDetails = Array<{\n items?: {\n name?: string\n message?: string\n stack?: string\n cause?: string\n }\n}>\n```\n\n### `InternalErrorDetail`\n\nInternal error detail\n\n```ts\ntype InternalErrorDetail = {\n name?: string\n message?: string\n stack?: string\n cause?: string\n}\n```\n\n### `DocxTemplaterErrorDetails`\n\nError details for DocxTemplater error. This error will appear under \'PARSE_ERROR\' error code.\nSee https://docxtemplater.com/docs/errors/#error-schema for more details.\n\n\n```ts\ntype DocxTemplaterErrorDetails = Array<{\n id?: string\n context?: string\n explanation?: string\n}>\n```\n\n### `DocxTemplaterErrorDetail`\n\nDocxTemplater error detail\n\n```ts\ntype DocxTemplaterErrorDetail = {\n id?: string\n context?: string\n explanation?: string\n}\n```\n\n### `ErrorCode`\n\nError codes for document generation:\n- PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.\n- DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.\n- INTERNAL_ERROR - In\n\n```ts\ntype ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT" | "TEMPLATE_NOT_FOUND"\n```\n\n### `TemplateValidationRequest`\n\n```ts\ntype TemplateValidationRequest = {\n template_document: {\n filename?: string\n s3ref: {\n bucket: { ... }\n key: { ... }\n }\n }\n fix?: boolean\n fix_level?: "safe" | "aggressive"\n}\n```\n\n### `TemplateValidationResponse`\n\n```ts\ntype TemplateValidationResponse = {\n valid?: boolean\n fixed?: boolean\n issues?: Array<{\n id?: string\n file?: string\n location?: string\n context?: string\n explanation?: string\n fixable?: boolean\n confidence?: "high" | "medium" | "low"\n rule?: string\n before?: string\n after?: string\n }>\n unresolved_errors?: Array<{\n id?: string\n context?: string\n explanation?: string\n }>\n fixed_document?: {\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n filename?: string\n preview_url?: string // uri\n }\n}\n```\n\n### `TemplateIssue`\n\nA single template syntax problem, and the repair proposed for it\n\n```ts\ntype TemplateIssue = {\n id?: string\n file?: string\n location?: string\n context?: string\n explanation?: string\n fixable?: boolean\n confidence?: "high" | "medium" | "low"\n rule?: string\n before?: string\n after?: string\n}\n```\n\n### `TemplateSettings`\n\nTemplate Settings for document generation\n\n```ts\ntype TemplateSettings = {\n custom_margins?: {\n top?: number\n bottom?: number\n }\n suggested_margins?: {\n top?: number\n bottom?: number\n }\n display_margin_guidelines?: boolean\n enable_data_table_margin_autofix?: boolean\n template_with_datatable?: boolean\n enabled_template_settings_persistence?: boolean\n misconfigured_margins?: boolean\n file_entity_id?: string // uuid\n}\n```\n\n### `DocumentMetaRequest`\n\n```ts\ntype DocumentMetaRequest = {\n template_document?: {\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n }\n}\n```\n\n### `DocumentMetaResponse`\n\n```ts\ntype DocumentMetaResponse = {\n page_margins?: {\n top?: number\n bottom?: number\n left?: number\n right?: number\n header?: number\n footer?: number\n }\n variables?: string[]\n}\n```\n\n### `DocumentGenerationV2Request`\n\n```ts\ntype DocumentGenerationV2Request = {\n template_document: {\n filename?: string\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n }\n context_entity_id?: string // uuid\n user_id?: string\n language?: string\n variable_payload?: {\n additionalProperties?: string\n }\n context_data?: {\n additionalProperties?: string\n }\n template_settings?: {\n custom_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n suggested_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n display_margin_guidelines?: boolean\n enable_data_table_margin_autofix?: boolean\n template_with_datatable?: boolean\n enabled_template_settings_persistence?: boolean\n misconfigured_margins?: boolean\n file_entity_id?: string // uuid\n }\n}\n```\n\n### `DocumentGenerationV2Response`\n\n```ts\ntype DocumentGenerationV2Response = {\n job_id?: string // uuid\n job_status?: "STARTED" | "PROCESSING" | "SUCCESS" | "FAILED"\n message?: string\n ics_output?: {\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n pdf_output?: {\n preview_url?: string\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n docx_output?: {\n preview_url?: string\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n xlsx_output?: {\n preview_url?: string\n output_document?: {\n filename?: { ... }\n s3ref?: { ... }\n }\n }\n error_output?: {\n error_message?: string\n error_code?: "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT" | "TEMPLATE_NOT_FOUND"\n error_details?: Array<{\n explanation?: { ... }\n context?: { ... }\n }> | Array<{\n items?: { ... }\n }> | Array<{\n id?: { ... }\n context?: { ... }\n explanation?: { ... }\n }>\n }\n variable_payload?: {\n additionalProperties?: string\n }\n template_settings?: {\n custom_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n suggested_margins?: {\n top?: { ... }\n bottom?: { ... }\n }\n display_margin_guidelines?: boolean\n enable_data_table_margin_autofix?: boolean\n template_with_datatable?: boolean\n enabled_template_settings_persistence?: boolean\n misconfigured_margins?: boolean\n file_entity_id?: string // uuid\n }\n}\n```\n\n### `ConvertDocumentRequest`\n\n```ts\ntype ConvertDocumentRequest = {\n language?: string\n input_document: {\n s3ref: {\n bucket: { ... }\n key: { ... }\n }\n }\n output_format: "pdf"\n output_filename?: string\n}\n```\n\n### `ConvertDocumentResponse`\n\n```ts\ntype ConvertDocumentResponse = {\n output_document?: {\n preview_url?: string\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n }\n}\n```\n';
|
|
5
|
+
export {
|
|
6
|
+
document_default as default
|
|
7
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkE2EHXQRPcjs = require('./chunk-E2EHXQRP.cjs');
|
|
4
4
|
require('./chunk-NJK5F5TF.cjs');
|
|
5
|
-
exports. default =
|
|
5
|
+
exports. default = _chunkE2EHXQRPcjs.require_document_runtime.call(void 0, );
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { OpenAPIClient, Parameters, UnknownParamsObject, AxiosRequestConfig, OperationResponse } from 'openapi-client-axios';
|
|
2
2
|
|
|
3
3
|
/* Auto-copied from document-client */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
declare namespace Components {
|
|
@@ -303,9 +301,10 @@ declare namespace Components {
|
|
|
303
301
|
* - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
|
|
304
302
|
* - INTERNAL_ERROR - Internal error. Please contact support.
|
|
305
303
|
* - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
|
|
304
|
+
* - TEMPLATE_NOT_FOUND - Template file was not found in S3. This indicates the template was likely deleted.
|
|
306
305
|
*
|
|
307
306
|
*/
|
|
308
|
-
export type ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT";
|
|
307
|
+
export type ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT" | "TEMPLATE_NOT_FOUND";
|
|
309
308
|
export interface ErrorOutput {
|
|
310
309
|
/**
|
|
311
310
|
* Error message
|
|
@@ -317,6 +316,7 @@ declare namespace Components {
|
|
|
317
316
|
* - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
|
|
318
317
|
* - INTERNAL_ERROR - Internal error. Please contact support.
|
|
319
318
|
* - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
|
|
319
|
+
* - TEMPLATE_NOT_FOUND - Template file was not found in S3. This indicates the template was likely deleted.
|
|
320
320
|
*
|
|
321
321
|
*/
|
|
322
322
|
ErrorCode;
|
|
@@ -395,6 +395,75 @@ declare namespace Components {
|
|
|
395
395
|
*/
|
|
396
396
|
key: string;
|
|
397
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* A single template syntax problem, and the repair proposed for it
|
|
400
|
+
*/
|
|
401
|
+
export interface TemplateIssue {
|
|
402
|
+
/**
|
|
403
|
+
* Problem kind. Reuses docxtemplater's error vocabulary where one exists
|
|
404
|
+
* (`unopened_tag`, `unclosed_tag`, `duplicate_open_tag`, `duplicate_close_tag`), plus
|
|
405
|
+
* `malformed_tag` for single-brace placeholders and `typographic_characters` for
|
|
406
|
+
* editor-substituted characters inside an otherwise valid tag.
|
|
407
|
+
*
|
|
408
|
+
* example:
|
|
409
|
+
* unopened_tag
|
|
410
|
+
*/
|
|
411
|
+
id?: string;
|
|
412
|
+
/**
|
|
413
|
+
* Zip part the problem was found in
|
|
414
|
+
* example:
|
|
415
|
+
* xl/sharedStrings.xml
|
|
416
|
+
*/
|
|
417
|
+
file?: string;
|
|
418
|
+
/**
|
|
419
|
+
* Where the user can find it — a cell reference for spreadsheets, a part label
|
|
420
|
+
* (`Document body`, `Header 1`, `Slide 3`) otherwise.
|
|
421
|
+
*
|
|
422
|
+
* example:
|
|
423
|
+
* Tabelle1!N4
|
|
424
|
+
*/
|
|
425
|
+
location?: string;
|
|
426
|
+
/**
|
|
427
|
+
* The offending text with surrounding context
|
|
428
|
+
* example:
|
|
429
|
+
* …Datum: {system.date}} Unterschrift…
|
|
430
|
+
*/
|
|
431
|
+
context?: string;
|
|
432
|
+
/**
|
|
433
|
+
* Why the template parser rejects it
|
|
434
|
+
* example:
|
|
435
|
+
* The tag is missing an opening brace.
|
|
436
|
+
*/
|
|
437
|
+
explanation?: string;
|
|
438
|
+
/**
|
|
439
|
+
* Whether the proposed repair was applied to the fixed copy
|
|
440
|
+
* example:
|
|
441
|
+
* true
|
|
442
|
+
*/
|
|
443
|
+
fixable?: boolean;
|
|
444
|
+
/**
|
|
445
|
+
* How sure we are that the repair is what the author meant
|
|
446
|
+
*/
|
|
447
|
+
confidence?: "high" | "medium" | "low";
|
|
448
|
+
/**
|
|
449
|
+
* The repair rule that produced `after`
|
|
450
|
+
* example:
|
|
451
|
+
* balance_opening_delimiter
|
|
452
|
+
*/
|
|
453
|
+
rule?: string;
|
|
454
|
+
/**
|
|
455
|
+
* The text as it is in the template
|
|
456
|
+
* example:
|
|
457
|
+
* {system.date}}
|
|
458
|
+
*/
|
|
459
|
+
before?: string;
|
|
460
|
+
/**
|
|
461
|
+
* The text as it would be in the fixed copy
|
|
462
|
+
* example:
|
|
463
|
+
* {{system.date}}
|
|
464
|
+
*/
|
|
465
|
+
after?: string;
|
|
466
|
+
}
|
|
398
467
|
/**
|
|
399
468
|
* Template Settings for document generation
|
|
400
469
|
*/
|
|
@@ -466,10 +535,81 @@ declare namespace Components {
|
|
|
466
535
|
/**
|
|
467
536
|
* The file entity id, used when persisting a new template version with updated settings
|
|
468
537
|
* example:
|
|
469
|
-
*
|
|
538
|
+
* 123e4567-e89b-12d3-a456-426614174000
|
|
470
539
|
*/
|
|
471
540
|
file_entity_id?: string; // uuid
|
|
472
541
|
}
|
|
542
|
+
export interface TemplateValidationRequest {
|
|
543
|
+
/**
|
|
544
|
+
* Input template document
|
|
545
|
+
*/
|
|
546
|
+
template_document: {
|
|
547
|
+
/**
|
|
548
|
+
* Document original filename, used to name the fixed copy
|
|
549
|
+
* example:
|
|
550
|
+
* Umzugsmeldung.xlsx
|
|
551
|
+
*/
|
|
552
|
+
filename?: string;
|
|
553
|
+
s3ref: S3Reference;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Attempt to produce a hotfixed copy of the template. When false, the template is only
|
|
557
|
+
* inspected and no file is written.
|
|
558
|
+
*
|
|
559
|
+
*/
|
|
560
|
+
fix?: boolean;
|
|
561
|
+
/**
|
|
562
|
+
* How far the hotfix may go:
|
|
563
|
+
* - safe - only repairs where the author's intent is unambiguous from the syntax
|
|
564
|
+
* (unbalanced or duplicated braces, editor-substituted characters inside a tag).
|
|
565
|
+
* - aggressive - additionally promotes single-brace placeholders such as `{contact.name}`
|
|
566
|
+
* to `{{contact.name}}`. These are common in customer templates but indistinguishable
|
|
567
|
+
* from prose that uses braces, so they are reported with `confidence: low`.
|
|
568
|
+
*
|
|
569
|
+
*/
|
|
570
|
+
fix_level?: "safe" | "aggressive";
|
|
571
|
+
}
|
|
572
|
+
export interface TemplateValidationResponse {
|
|
573
|
+
/**
|
|
574
|
+
* Whether the template compiled cleanly before any repair was attempted
|
|
575
|
+
* example:
|
|
576
|
+
* false
|
|
577
|
+
*/
|
|
578
|
+
valid?: boolean;
|
|
579
|
+
/**
|
|
580
|
+
* Whether a corrected copy of the template could be produced
|
|
581
|
+
* example:
|
|
582
|
+
* true
|
|
583
|
+
*/
|
|
584
|
+
fixed?: boolean;
|
|
585
|
+
/**
|
|
586
|
+
* Everything found in the template, whether or not it could be repaired
|
|
587
|
+
*/
|
|
588
|
+
issues?: /* A single template syntax problem, and the repair proposed for it */ TemplateIssue[];
|
|
589
|
+
/**
|
|
590
|
+
* Parser errors that remain after the hotfix (or the original errors when nothing was
|
|
591
|
+
* fixed). Empty when the template is valid.
|
|
592
|
+
*
|
|
593
|
+
*/
|
|
594
|
+
unresolved_errors?: /* DocxTemplater error detail */ DocxTemplaterErrorDetail[];
|
|
595
|
+
/**
|
|
596
|
+
* The corrected copy, for the user to review and accept. Absent when no repair was
|
|
597
|
+
* applied. The original template is left untouched.
|
|
598
|
+
*
|
|
599
|
+
*/
|
|
600
|
+
fixed_document?: {
|
|
601
|
+
s3ref?: S3Reference;
|
|
602
|
+
/**
|
|
603
|
+
* example:
|
|
604
|
+
* Umzugsmeldung (fixed).xlsx
|
|
605
|
+
*/
|
|
606
|
+
filename?: string;
|
|
607
|
+
/**
|
|
608
|
+
* Short-lived download link for the corrected copy
|
|
609
|
+
*/
|
|
610
|
+
preview_url?: string; // uri
|
|
611
|
+
};
|
|
612
|
+
}
|
|
473
613
|
}
|
|
474
614
|
}
|
|
475
615
|
declare namespace Paths {
|
|
@@ -482,13 +622,33 @@ declare namespace Paths {
|
|
|
482
622
|
namespace GenerateDocumentV2 {
|
|
483
623
|
namespace Parameters {
|
|
484
624
|
export type JobId = string;
|
|
625
|
+
/**
|
|
626
|
+
* - partial_generation: Generates a partial document for user validation before final generation
|
|
627
|
+
* - full_generation: Completes the entire document generation process in one step
|
|
628
|
+
*
|
|
629
|
+
*/
|
|
485
630
|
export type Mode = "partial_generation" | "full_generation";
|
|
631
|
+
/**
|
|
632
|
+
* - open: Preview URL opens the file directly in browser
|
|
633
|
+
* - download: Preview URL triggers a download of the file
|
|
634
|
+
*
|
|
635
|
+
*/
|
|
486
636
|
export type PreviewMode = "open" | "download";
|
|
487
637
|
}
|
|
488
638
|
export interface QueryParameters {
|
|
489
639
|
job_id?: Parameters.JobId;
|
|
490
|
-
mode?:
|
|
491
|
-
|
|
640
|
+
mode?: /**
|
|
641
|
+
* - partial_generation: Generates a partial document for user validation before final generation
|
|
642
|
+
* - full_generation: Completes the entire document generation process in one step
|
|
643
|
+
*
|
|
644
|
+
*/
|
|
645
|
+
Parameters.Mode;
|
|
646
|
+
preview_mode?: /**
|
|
647
|
+
* - open: Preview URL opens the file directly in browser
|
|
648
|
+
* - download: Preview URL triggers a download of the file
|
|
649
|
+
*
|
|
650
|
+
*/
|
|
651
|
+
Parameters.PreviewMode;
|
|
492
652
|
}
|
|
493
653
|
export type RequestBody = Components.Schemas.DocumentGenerationV2Request;
|
|
494
654
|
namespace Responses {
|
|
@@ -504,6 +664,15 @@ declare namespace Paths {
|
|
|
504
664
|
export type $415 = Components.Schemas.ErrorOutput;
|
|
505
665
|
}
|
|
506
666
|
}
|
|
667
|
+
namespace ValidateTemplate {
|
|
668
|
+
export type RequestBody = Components.Schemas.TemplateValidationRequest;
|
|
669
|
+
namespace Responses {
|
|
670
|
+
export type $200 = Components.Schemas.TemplateValidationResponse;
|
|
671
|
+
export type $403 = Components.Schemas.ErrorOutput;
|
|
672
|
+
export type $413 = Components.Schemas.ErrorOutput;
|
|
673
|
+
export type $415 = Components.Schemas.ErrorOutput;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
507
676
|
}
|
|
508
677
|
|
|
509
678
|
|
|
@@ -561,6 +730,33 @@ interface OperationMethods {
|
|
|
561
730
|
data?: Paths.ConvertDocument.RequestBody,
|
|
562
731
|
config?: AxiosRequestConfig
|
|
563
732
|
): OperationResponse<Paths.ConvertDocument.Responses.$200>
|
|
733
|
+
/**
|
|
734
|
+
* validateTemplate - validateTemplate
|
|
735
|
+
*
|
|
736
|
+
* Validates a document template's variable syntax and, optionally, proposes a hotfixed copy of it.
|
|
737
|
+
*
|
|
738
|
+
* The endpoint compiles the template with docxtemplater's core parser (the xlsx module for
|
|
739
|
+
* spreadsheets), so a delimiter or tag error reported here is one generation would fail on.
|
|
740
|
+
* Failures specific to the image or HTML modules are not covered. Every problem it can repair
|
|
741
|
+
* unambiguously — a missing brace, an extra brace, a smart quote or a non-breaking space that
|
|
742
|
+
* Word substituted inside a tag — is applied to a **copy** of the template, which is uploaded
|
|
743
|
+
* and returned as `fixed_document`.
|
|
744
|
+
*
|
|
745
|
+
* The original template is never modified. Accepting the fix is an explicit, separate step:
|
|
746
|
+
* the caller shows the user `issues` (each with its `before`/`after`), lets them download
|
|
747
|
+
* `fixed_document.preview_url`, and only then replaces the template.
|
|
748
|
+
*
|
|
749
|
+
* Supported input document types:
|
|
750
|
+
* - .docx, .docm, .dotx
|
|
751
|
+
* - .xlsx, .xlsm
|
|
752
|
+
* - .pptx
|
|
753
|
+
*
|
|
754
|
+
*/
|
|
755
|
+
'validateTemplate'(
|
|
756
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
757
|
+
data?: Paths.ValidateTemplate.RequestBody,
|
|
758
|
+
config?: AxiosRequestConfig
|
|
759
|
+
): OperationResponse<Paths.ValidateTemplate.Responses.$200>
|
|
564
760
|
}
|
|
565
761
|
|
|
566
762
|
interface PathsDictionary {
|
|
@@ -623,6 +819,35 @@ interface PathsDictionary {
|
|
|
623
819
|
config?: AxiosRequestConfig
|
|
624
820
|
): OperationResponse<Paths.ConvertDocument.Responses.$200>
|
|
625
821
|
}
|
|
822
|
+
['/v2/templates:validate']: {
|
|
823
|
+
/**
|
|
824
|
+
* validateTemplate - validateTemplate
|
|
825
|
+
*
|
|
826
|
+
* Validates a document template's variable syntax and, optionally, proposes a hotfixed copy of it.
|
|
827
|
+
*
|
|
828
|
+
* The endpoint compiles the template with docxtemplater's core parser (the xlsx module for
|
|
829
|
+
* spreadsheets), so a delimiter or tag error reported here is one generation would fail on.
|
|
830
|
+
* Failures specific to the image or HTML modules are not covered. Every problem it can repair
|
|
831
|
+
* unambiguously — a missing brace, an extra brace, a smart quote or a non-breaking space that
|
|
832
|
+
* Word substituted inside a tag — is applied to a **copy** of the template, which is uploaded
|
|
833
|
+
* and returned as `fixed_document`.
|
|
834
|
+
*
|
|
835
|
+
* The original template is never modified. Accepting the fix is an explicit, separate step:
|
|
836
|
+
* the caller shows the user `issues` (each with its `before`/`after`), lets them download
|
|
837
|
+
* `fixed_document.preview_url`, and only then replaces the template.
|
|
838
|
+
*
|
|
839
|
+
* Supported input document types:
|
|
840
|
+
* - .docx, .docm, .dotx
|
|
841
|
+
* - .xlsx, .xlsm
|
|
842
|
+
* - .pptx
|
|
843
|
+
*
|
|
844
|
+
*/
|
|
845
|
+
'post'(
|
|
846
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
847
|
+
data?: Paths.ValidateTemplate.RequestBody,
|
|
848
|
+
config?: AxiosRequestConfig
|
|
849
|
+
): OperationResponse<Paths.ValidateTemplate.Responses.$200>
|
|
850
|
+
}
|
|
626
851
|
}
|
|
627
852
|
|
|
628
853
|
type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
|
@@ -643,6 +868,9 @@ type InternalErrorDetails = Components.Schemas.InternalErrorDetails;
|
|
|
643
868
|
type InvalidCustomVariableErrorDetail = Components.Schemas.InvalidCustomVariableErrorDetail;
|
|
644
869
|
type InvalidCustomVariableErrorDetails = Components.Schemas.InvalidCustomVariableErrorDetails;
|
|
645
870
|
type S3Reference = Components.Schemas.S3Reference;
|
|
871
|
+
type TemplateIssue = Components.Schemas.TemplateIssue;
|
|
646
872
|
type TemplateSettings = Components.Schemas.TemplateSettings;
|
|
873
|
+
type TemplateValidationRequest = Components.Schemas.TemplateValidationRequest;
|
|
874
|
+
type TemplateValidationResponse = Components.Schemas.TemplateValidationResponse;
|
|
647
875
|
|
|
648
|
-
export { type Client as C, type DocumentGenerationV2Request as D, type ErrorCode as E, type InternalErrorDetail as I, type OperationMethods as O, Paths as P, type S3Reference as S, type
|
|
876
|
+
export { type Client as C, type DocumentGenerationV2Request as D, type ErrorCode as E, type InternalErrorDetail as I, type OperationMethods as O, Paths as P, type S3Reference as S, type TemplateIssue as T, Components as a, type PathsDictionary as b, type ConvertDocumentRequest as c, type ConvertDocumentResponse as d, type DocumentGenerationV2Response as e, type DocumentMetaRequest as f, type DocumentMetaResponse as g, type DocxTemplaterErrorDetail as h, type DocxTemplaterErrorDetails as i, type ErrorOutput as j, type InternalErrorDetails as k, type InvalidCustomVariableErrorDetail as l, type InvalidCustomVariableErrorDetails as m, type TemplateSettings as n, type TemplateValidationRequest as o, type TemplateValidationResponse as p };
|