@epilot/document-client 0.15.1 → 0.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/document-client",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "description": "API Client for epilot document API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/dist/client.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Client } from './openapi';
2
- export declare const getClient: () => Client;
package/dist/client.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getClient = void 0;
7
- var openapi_client_axios_1 = __importDefault(require("openapi-client-axios"));
8
- var definition_1 = __importDefault(require("./definition"));
9
- var getClient = function () {
10
- var api = new openapi_client_axios_1.default({ definition: definition_1.default, quick: true });
11
- return api.initSync();
12
- };
13
- exports.getClient = getClient;
14
- //# sourceMappingURL=client.js.map
@@ -1,3 +0,0 @@
1
- import type { Document } from 'openapi-client-axios';
2
- declare const _default: Document;
3
- export default _default;
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e={914:function(e,t,r){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(534));t.default=n.default},534:e=>{e.exports=JSON.parse('{"openapi":"3.0.2","info":{"title":"Document API","version":"1.0.0","description":"A document generation API that allows you to generate documents from templates with variables.\\n\\n[Feature Documentation](https://docs.epilot.io/docs/files/document-generation)\\n"},"tags":[{"name":"Documents","description":"Document Generation"}],"security":[{"EpilotAuth":[]}],"paths":{"/v2/documents:meta":{"post":{"operationId":"getTemplateMeta","summary":"getTemplateMeta","description":"Get metadata for a document template\\n\\nSupported input document types:\\n- .docx\\n","tags":["Documents"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentMetaRequest"}}}},"responses":{"200":{"description":"Document metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentMetaResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOutput"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOutput"}}}},"415":{"description":"Unsupported media type","content":null}}}},"/v2/documents:generate":{"post":{"operationId":"generateDocumentV2","summary":"generateDocumentV2","description":"Builds document generated from input document with variables.\\n\\nSupported input document types:\\n- .docx\\n\\nSupported output document types:\\n- .pdf\\n- .docx but limited to only text based variables\\n\\nUses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.\\n","parameters":[{"in":"query","name":"job_id","description":"Job ID for tracking the status of document generation action","schema":{"type":"string"}},{"in":"query","name":"mode","description":"Type of mode used for document generation flow:\\n- partial_generation will have a intermediate step for users to validate and replace the variable values before generating the final document.\\n- full_generation, goes through all the steps for the full generation of final document\\n","schema":{"type":"string","enum":["partial_generation","full_generation"],"default":"full_generation"}},{"in":"query","name":"preview_mode","description":"Type of mode used for document generation preview:\\n- open - preview_url provides a link to open the file in a browser\\n- download - preview_url provides a link to download the file\\n","schema":{"type":"string","enum":["open","download"],"default":"open"}}],"tags":["Documents"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentGenerationV2Request"}}}},"responses":{"200":{"description":"Generated document output","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentGenerationV2Response"}}}}}}},"/v2/documents:convert":{"post":{"operationId":"convertDocument","summary":"convertDocument","description":"Converts a document to a different format.\\n\\nSupported input document types:\\n- .docx\\n\\nSupported output document types:\\n- .pdf\\n","tags":["Documents"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentRequest"}}}},"responses":{"200":{"description":"Conversion job output","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentResponse"}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Authorization header with epilot OAuth2 bearer token","bearerFormat":"JWT"}},"schemas":{"S3Reference":{"type":"object","properties":{"bucket":{"type":"string","example":"document-api-prod"},"key":{"type":"string","example":"uploads/my-template.pdf"}},"required":["bucket","key"]},"ErrorOutput":{"type":"object","properties":{"error_message":{"description":"Error message","type":"string"},"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_details":{"anyOf":[{"$ref":"#/components/schemas/InvalidCustomVariableErrorDetails"},{"$ref":"#/components/schemas/InternalErrorDetails"},{"$ref":"#/components/schemas/DocxTemplaterErrorDetails"}]}}},"InvalidCustomVariableErrorDetails":{"description":"Error details for invalid custom variables. This error will appear under \'PARSE_ERROR\' error code.","type":"array","items":{"$ref":"#/components/schemas/InvalidCustomVariableErrorDetail"}},"InvalidCustomVariableErrorDetail":{"type":"object","additionalProperties":true,"properties":{"explanation":{"description":"Explanation for the error","type":"string"},"context":{"description":"Context for the error","type":"object","properties":{"invalid_variables":{"description":"List of invalid variables","type":"array","items":{"type":"object","description":"Invalid variable","properties":{"variable":{"description":"Variable name","type":"string"},"error":{"description":"Explanation for the error","type":"string"}}}}}}}},"InternalErrorDetails":{"description":"Error details for internal error. This error will appear under \'INTERNAL_ERROR\' error code.","type":"array","items":{"type":"object","properties":{"items":{"$ref":"#/components/schemas/InternalErrorDetail"}}}},"InternalErrorDetail":{"type":"object","description":"Internal error detail","properties":{"name":{"description":"Name of the error","type":"string"},"message":{"description":"Error message","type":"string"},"stack":{"description":"Stack trace","type":"string"},"cause":{"description":"Cause of the error","type":"string"}}},"DocxTemplaterErrorDetails":{"description":"Error 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","type":"array","items":{"$ref":"#/components/schemas/DocxTemplaterErrorDetail"}},"DocxTemplaterErrorDetail":{"type":"object","description":"DocxTemplater error detail","properties":{"id":{"description":"Id of the error","type":"string"},"context":{"description":"Context of the error","type":"string"},"explanation":{"description":"Explanation of the error","type":"string"}}},"ErrorCode":{"description":"Error 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 - Internal error. Please contact support.\\n- INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.\\n","type":"string","enum":["PARSE_ERROR","DOC_TO_PDF_CONVERT_ERROR","INTERNAL_ERROR","INVALID_TEMPLATE_FORMAT"]},"TemplateSettings":{"type":"object","description":"Template Settings for document generation","properties":{"custom_margins":{"description":"Custom margins for the document","type":"object","properties":{"top":{"description":"Top margin in cm","type":"number","example":2.54},"bottom":{"description":"Bottom margin in cm","type":"number","example":2.54}}},"suggested_margins":{"description":"Suggested margins for the document","type":"object","properties":{"top":{"description":"Top margin in cm","type":"number","example":2.54},"bottom":{"description":"Bottom margin in cm","type":"number","example":2.54}}},"display_margin_guidelines":{"description":"Display margin guidelines (applicable to partial generation only)","type":"boolean","example":true},"enable_data_table_margin_autofix":{"description":"Enable data table margin autofix","type":"boolean","example":false},"template_with_datatable":{"description":"A flag that indicates whether the template has 1 or more data tables in it","type":"boolean","example":false},"enabled_template_settings_persistence":{"description":"Enables the persistance of template settings","type":"boolean","example":false},"misconfigured_margins":{"description":"An indication that the page margins are misconfigured","type":"boolean","example":false},"file_entity_id":{"description":"The file entity id, used when persisting a new template version with updated settings","type":"string","format":"uuid","example":"1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p"}}},"DocumentMetaRequest":{"type":"object","properties":{"template_document":{"description":"Input template document","type":"object","properties":{"s3ref":{"$ref":"#/components/schemas/S3Reference"}}}}},"DocumentMetaResponse":{"type":"object","properties":{"page_margins":{"description":"Page margins for the document","type":"object","properties":{"top":{"description":"Top margin in cm","type":"number","example":2.54},"bottom":{"description":"Bottom margin in cm","type":"number","example":2.54},"left":{"description":"Left margin in cm","type":"number","example":2.54},"right":{"description":"Right margin in cm","type":"number","example":2.54},"header":{"description":"Header margin in cm","type":"number","example":2.54},"footer":{"description":"Footer margin in cm","type":"number","example":2.54}}},"variables":{"description":"List of variables in the document","type":"array","items":{"type":"string"},"example":["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"]}}},"DocumentGenerationV2Request":{"type":"object","properties":{"template_document":{"description":"Input template document","type":"object","properties":{"filename":{"type":"string","description":"Document original filename","example":"my-template-{{order.order_number}}.docx"},"s3ref":{"$ref":"#/components/schemas/S3Reference"}}},"context_entity_id":{"type":"string","format":"uuid","description":"Entity to use for variable context","example":"bcd0aab9-b544-42b0-8bfb-6d449d02eacc"},"user_id":{"type":"string","description":"User Id for variable context","example":100321},"language":{"type":"string","description":"Language","example":"en"},"variable_payload":{"description":"Custom values for variables in the template. Takes the higher precedence than others.","type":"object","properties":{"additionalProperties":{"type":"string"}}},"context_data":{"description":"Custom values for variables in the template. Takes the higher precedence than others.","type":"object","properties":{"additionalProperties":{"type":"string"}}},"template_settings":{"$ref":"#/components/schemas/TemplateSettings"}},"required":["template_document"]},"DocumentGenerationV2Response":{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"job_status":{"description":"Status of the job","type":"string","enum":["STARTED","PROCESSING","SUCCESS","FAILED"]},"message":{"description":"A message explaining the progress","type":"string"},"pdf_output":{"type":"object","properties":{"preview_url":{"description":"Pre-signed S3 GET URL for PDF preview","type":"string","example":"https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf"},"output_document":{"type":"object","properties":{"filename":{"description":"Generated document filename for PDF","type":"string","example":"my-template-OR-001.pdf"},"s3ref":{"$ref":"#/components/schemas/S3Reference"}},"example":{"s3ref":{"bucket":"document-api-preview-prod","key":"preview/my-template.pdf"}}}}},"docx_output":{"type":"object","properties":{"preview_url":{"description":"Pre-signed S3 GET URL for DOCX preview","type":"string","example":"https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx"},"output_document":{"type":"object","properties":{"filename":{"description":"Generated document filename for DOCX","type":"string","example":"my-template-OR-001.docx"},"s3ref":{"$ref":"#/components/schemas/S3Reference"}},"example":{"s3ref":{"bucket":"document-api-preview-prod","key":"preview/my-template.docx"}}}}},"error_output":{"$ref":"#/components/schemas/ErrorOutput"},"variable_payload":{"description":"List of variables and its corresponding replaced values from the document template","type":"object","properties":{"additionalProperties":{"type":"string"}}},"template_settings":{"$ref":"#/components/schemas/TemplateSettings"}}},"ConvertDocumentRequest":{"type":"object","properties":{"input_document":{"description":"Input document","type":"object","properties":{"s3ref":{"$ref":"#/components/schemas/S3Reference"}},"required":["s3ref"]},"output_format":{"description":"Output format of the document","type":"string","enum":["pdf"]},"output_filename":{"description":"Filename of the output document (optional)","type":"string","example":"converted.pdf"}},"required":["input_document","output_format"]},"ConvertDocumentResponse":{"type":"object","properties":{"output_document":{"type":"object","properties":{"preview_url":{"description":"Pre-signed URL for the converted document","type":"string","example":"https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/converted.pdf"},"s3ref":{"$ref":"#/components/schemas/S3Reference"}}}}}}},"servers":[{"url":"https://document.sls.epilot.io"}]}')}},t={},r=function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,r),i.exports}(914),o=exports;for(var n in r)o[n]=r[n];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './client';
2
- export * from './openapi';
3
- export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios';
package/dist/index.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client"), exports);
18
- //# sourceMappingURL=index.js.map
package/dist/openapi.d.ts DELETED
@@ -1,590 +0,0 @@
1
- /* eslint-disable */
2
-
3
- import type {
4
- OpenAPIClient,
5
- Parameters,
6
- UnknownParamsObject,
7
- OperationResponse,
8
- AxiosRequestConfig,
9
- } from 'openapi-client-axios';
10
-
11
- declare namespace Components {
12
- namespace Schemas {
13
- export interface ConvertDocumentRequest {
14
- /**
15
- * Input document
16
- */
17
- input_document: {
18
- s3ref: S3Reference;
19
- };
20
- /**
21
- * Output format of the document
22
- */
23
- output_format: "pdf";
24
- /**
25
- * Filename of the output document (optional)
26
- * example:
27
- * converted.pdf
28
- */
29
- output_filename?: string;
30
- }
31
- export interface ConvertDocumentResponse {
32
- output_document?: {
33
- /**
34
- * Pre-signed URL for the converted document
35
- * example:
36
- * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/converted.pdf
37
- */
38
- preview_url?: string;
39
- s3ref?: S3Reference;
40
- };
41
- }
42
- export interface DocumentGenerationV2Request {
43
- /**
44
- * Input template document
45
- */
46
- template_document: {
47
- /**
48
- * Document original filename
49
- * example:
50
- * my-template-{{order.order_number}}.docx
51
- */
52
- filename?: string;
53
- s3ref?: S3Reference;
54
- };
55
- /**
56
- * Entity to use for variable context
57
- * example:
58
- * bcd0aab9-b544-42b0-8bfb-6d449d02eacc
59
- */
60
- context_entity_id?: string; // uuid
61
- /**
62
- * User Id for variable context
63
- * example:
64
- * 100321
65
- */
66
- user_id?: string;
67
- /**
68
- * Language
69
- * example:
70
- * en
71
- */
72
- language?: string;
73
- /**
74
- * Custom values for variables in the template. Takes the higher precedence than others.
75
- */
76
- variable_payload?: {
77
- additionalProperties?: string;
78
- };
79
- /**
80
- * Custom values for variables in the template. Takes the higher precedence than others.
81
- */
82
- context_data?: {
83
- additionalProperties?: string;
84
- };
85
- template_settings?: /* Template Settings for document generation */ TemplateSettings;
86
- }
87
- export interface DocumentGenerationV2Response {
88
- job_id?: string; // uuid
89
- /**
90
- * Status of the job
91
- */
92
- job_status?: "STARTED" | "PROCESSING" | "SUCCESS" | "FAILED";
93
- /**
94
- * A message explaining the progress
95
- */
96
- message?: string;
97
- pdf_output?: {
98
- /**
99
- * Pre-signed S3 GET URL for PDF preview
100
- * example:
101
- * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf
102
- */
103
- preview_url?: string;
104
- /**
105
- * example:
106
- * {
107
- * "s3ref": {
108
- * "bucket": "document-api-preview-prod",
109
- * "key": "preview/my-template.pdf"
110
- * }
111
- * }
112
- */
113
- output_document?: {
114
- /**
115
- * Generated document filename for PDF
116
- * example:
117
- * my-template-OR-001.pdf
118
- */
119
- filename?: string;
120
- s3ref?: S3Reference;
121
- };
122
- };
123
- docx_output?: {
124
- /**
125
- * Pre-signed S3 GET URL for DOCX preview
126
- * example:
127
- * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx
128
- */
129
- preview_url?: string;
130
- /**
131
- * example:
132
- * {
133
- * "s3ref": {
134
- * "bucket": "document-api-preview-prod",
135
- * "key": "preview/my-template.docx"
136
- * }
137
- * }
138
- */
139
- output_document?: {
140
- /**
141
- * Generated document filename for DOCX
142
- * example:
143
- * my-template-OR-001.docx
144
- */
145
- filename?: string;
146
- s3ref?: S3Reference;
147
- };
148
- };
149
- error_output?: ErrorOutput;
150
- /**
151
- * List of variables and its corresponding replaced values from the document template
152
- */
153
- variable_payload?: {
154
- additionalProperties?: string;
155
- };
156
- template_settings?: /* Template Settings for document generation */ TemplateSettings;
157
- }
158
- export interface DocumentMetaRequest {
159
- /**
160
- * Input template document
161
- */
162
- template_document?: {
163
- s3ref?: S3Reference;
164
- };
165
- }
166
- export interface DocumentMetaResponse {
167
- /**
168
- * Page margins for the document
169
- */
170
- page_margins?: {
171
- /**
172
- * Top margin in cm
173
- * example:
174
- * 2.54
175
- */
176
- top?: number;
177
- /**
178
- * Bottom margin in cm
179
- * example:
180
- * 2.54
181
- */
182
- bottom?: number;
183
- /**
184
- * Left margin in cm
185
- * example:
186
- * 2.54
187
- */
188
- left?: number;
189
- /**
190
- * Right margin in cm
191
- * example:
192
- * 2.54
193
- */
194
- right?: number;
195
- /**
196
- * Header margin in cm
197
- * example:
198
- * 2.54
199
- */
200
- header?: number;
201
- /**
202
- * Footer margin in cm
203
- * example:
204
- * 2.54
205
- */
206
- footer?: number;
207
- };
208
- /**
209
- * List of variables in the document
210
- * example:
211
- * [
212
- * "order.billing_contact.0.salutation",
213
- * "order.billing_contact.0.title",
214
- * "order_table",
215
- * "stayHardStatic",
216
- * "opportunity[attribute_name]",
217
- * "opportunity[\"attribute_name\"]",
218
- * "opportunity.[attribute_name]",
219
- * "attribute_name",
220
- * "opportunities.0.attribute_name",
221
- * "opportunities[0].attribute_name",
222
- * "contact.opportunities[0].attribute_name",
223
- * "opportunities[Primary].attribute_name"
224
- * ]
225
- */
226
- variables?: string[];
227
- }
228
- /**
229
- * DocxTemplater error detail
230
- */
231
- export interface DocxTemplaterErrorDetail {
232
- /**
233
- * Id of the error
234
- */
235
- id?: string;
236
- /**
237
- * Context of the error
238
- */
239
- context?: string;
240
- /**
241
- * Explanation of the error
242
- */
243
- explanation?: string;
244
- }
245
- /**
246
- * Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
247
- * See https://docxtemplater.com/docs/errors/#error-schema for more details.
248
- *
249
- */
250
- export type DocxTemplaterErrorDetails = /* DocxTemplater error detail */ DocxTemplaterErrorDetail[];
251
- /**
252
- * Error codes for document generation:
253
- * - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
254
- * - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
255
- * - INTERNAL_ERROR - Internal error. Please contact support.
256
- * - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
257
- *
258
- */
259
- export type ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT";
260
- export interface ErrorOutput {
261
- /**
262
- * Error message
263
- */
264
- error_message?: string;
265
- error_code?: /**
266
- * Error codes for document generation:
267
- * - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
268
- * - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
269
- * - INTERNAL_ERROR - Internal error. Please contact support.
270
- * - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
271
- *
272
- */
273
- ErrorCode;
274
- error_details?: /* Error details for invalid custom variables. This error will appear under 'PARSE_ERROR' error code. */ InvalidCustomVariableErrorDetails | /* Error details for internal error. This error will appear under 'INTERNAL_ERROR' error code. */ InternalErrorDetails | /**
275
- * Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
276
- * See https://docxtemplater.com/docs/errors/#error-schema for more details.
277
- *
278
- */
279
- DocxTemplaterErrorDetails;
280
- }
281
- /**
282
- * Internal error detail
283
- */
284
- export interface InternalErrorDetail {
285
- /**
286
- * Name of the error
287
- */
288
- name?: string;
289
- /**
290
- * Error message
291
- */
292
- message?: string;
293
- /**
294
- * Stack trace
295
- */
296
- stack?: string;
297
- /**
298
- * Cause of the error
299
- */
300
- cause?: string;
301
- }
302
- /**
303
- * Error details for internal error. This error will appear under 'INTERNAL_ERROR' error code.
304
- */
305
- export type InternalErrorDetails = {
306
- items?: /* Internal error detail */ InternalErrorDetail;
307
- }[];
308
- export interface InvalidCustomVariableErrorDetail {
309
- [name: string]: any;
310
- /**
311
- * Explanation for the error
312
- */
313
- explanation?: string;
314
- /**
315
- * Context for the error
316
- */
317
- context?: {
318
- /**
319
- * List of invalid variables
320
- */
321
- invalid_variables?: {
322
- /**
323
- * Variable name
324
- */
325
- variable?: string;
326
- /**
327
- * Explanation for the error
328
- */
329
- error?: string;
330
- }[];
331
- };
332
- }
333
- /**
334
- * Error details for invalid custom variables. This error will appear under 'PARSE_ERROR' error code.
335
- */
336
- export type InvalidCustomVariableErrorDetails = InvalidCustomVariableErrorDetail[];
337
- export interface S3Reference {
338
- /**
339
- * example:
340
- * document-api-prod
341
- */
342
- bucket: string;
343
- /**
344
- * example:
345
- * uploads/my-template.pdf
346
- */
347
- key: string;
348
- }
349
- /**
350
- * Template Settings for document generation
351
- */
352
- export interface TemplateSettings {
353
- /**
354
- * Custom margins for the document
355
- */
356
- custom_margins?: {
357
- /**
358
- * Top margin in cm
359
- * example:
360
- * 2.54
361
- */
362
- top?: number;
363
- /**
364
- * Bottom margin in cm
365
- * example:
366
- * 2.54
367
- */
368
- bottom?: number;
369
- };
370
- /**
371
- * Suggested margins for the document
372
- */
373
- suggested_margins?: {
374
- /**
375
- * Top margin in cm
376
- * example:
377
- * 2.54
378
- */
379
- top?: number;
380
- /**
381
- * Bottom margin in cm
382
- * example:
383
- * 2.54
384
- */
385
- bottom?: number;
386
- };
387
- /**
388
- * Display margin guidelines (applicable to partial generation only)
389
- * example:
390
- * true
391
- */
392
- display_margin_guidelines?: boolean;
393
- /**
394
- * Enable data table margin autofix
395
- * example:
396
- * false
397
- */
398
- enable_data_table_margin_autofix?: boolean;
399
- /**
400
- * A flag that indicates whether the template has 1 or more data tables in it
401
- * example:
402
- * false
403
- */
404
- template_with_datatable?: boolean;
405
- /**
406
- * Enables the persistance of template settings
407
- * example:
408
- * false
409
- */
410
- enabled_template_settings_persistence?: boolean;
411
- /**
412
- * An indication that the page margins are misconfigured
413
- * example:
414
- * false
415
- */
416
- misconfigured_margins?: boolean;
417
- /**
418
- * The file entity id, used when persisting a new template version with updated settings
419
- * example:
420
- * 1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p
421
- */
422
- file_entity_id?: string; // uuid
423
- }
424
- }
425
- }
426
- declare namespace Paths {
427
- namespace ConvertDocument {
428
- export type RequestBody = Components.Schemas.ConvertDocumentRequest;
429
- namespace Responses {
430
- export type $200 = Components.Schemas.ConvertDocumentResponse;
431
- }
432
- }
433
- namespace GenerateDocumentV2 {
434
- namespace Parameters {
435
- export type JobId = string;
436
- export type Mode = "partial_generation" | "full_generation";
437
- export type PreviewMode = "open" | "download";
438
- }
439
- export interface QueryParameters {
440
- job_id?: Parameters.JobId;
441
- mode?: Parameters.Mode;
442
- preview_mode?: Parameters.PreviewMode;
443
- }
444
- export type RequestBody = Components.Schemas.DocumentGenerationV2Request;
445
- namespace Responses {
446
- export type $200 = Components.Schemas.DocumentGenerationV2Response;
447
- }
448
- }
449
- namespace GetTemplateMeta {
450
- export type RequestBody = Components.Schemas.DocumentMetaRequest;
451
- namespace Responses {
452
- export type $200 = Components.Schemas.DocumentMetaResponse;
453
- export type $400 = Components.Schemas.ErrorOutput;
454
- export type $403 = Components.Schemas.ErrorOutput;
455
- }
456
- }
457
- }
458
-
459
- export interface OperationMethods {
460
- /**
461
- * getTemplateMeta - getTemplateMeta
462
- *
463
- * Get metadata for a document template
464
- *
465
- * Supported input document types:
466
- * - .docx
467
- *
468
- */
469
- 'getTemplateMeta'(
470
- parameters?: Parameters<UnknownParamsObject> | null,
471
- data?: Paths.GetTemplateMeta.RequestBody,
472
- config?: AxiosRequestConfig
473
- ): OperationResponse<Paths.GetTemplateMeta.Responses.$200>
474
- /**
475
- * generateDocumentV2 - generateDocumentV2
476
- *
477
- * Builds document generated from input document with variables.
478
- *
479
- * Supported input document types:
480
- * - .docx
481
- *
482
- * Supported output document types:
483
- * - .pdf
484
- * - .docx but limited to only text based variables
485
- *
486
- * Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
487
- *
488
- */
489
- 'generateDocumentV2'(
490
- parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
491
- data?: Paths.GenerateDocumentV2.RequestBody,
492
- config?: AxiosRequestConfig
493
- ): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
494
- /**
495
- * convertDocument - convertDocument
496
- *
497
- * Converts a document to a different format.
498
- *
499
- * Supported input document types:
500
- * - .docx
501
- *
502
- * Supported output document types:
503
- * - .pdf
504
- *
505
- */
506
- 'convertDocument'(
507
- parameters?: Parameters<UnknownParamsObject> | null,
508
- data?: Paths.ConvertDocument.RequestBody,
509
- config?: AxiosRequestConfig
510
- ): OperationResponse<Paths.ConvertDocument.Responses.$200>
511
- }
512
-
513
- export interface PathsDictionary {
514
- ['/v2/documents:meta']: {
515
- /**
516
- * getTemplateMeta - getTemplateMeta
517
- *
518
- * Get metadata for a document template
519
- *
520
- * Supported input document types:
521
- * - .docx
522
- *
523
- */
524
- 'post'(
525
- parameters?: Parameters<UnknownParamsObject> | null,
526
- data?: Paths.GetTemplateMeta.RequestBody,
527
- config?: AxiosRequestConfig
528
- ): OperationResponse<Paths.GetTemplateMeta.Responses.$200>
529
- }
530
- ['/v2/documents:generate']: {
531
- /**
532
- * generateDocumentV2 - generateDocumentV2
533
- *
534
- * Builds document generated from input document with variables.
535
- *
536
- * Supported input document types:
537
- * - .docx
538
- *
539
- * Supported output document types:
540
- * - .pdf
541
- * - .docx but limited to only text based variables
542
- *
543
- * Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
544
- *
545
- */
546
- 'post'(
547
- parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
548
- data?: Paths.GenerateDocumentV2.RequestBody,
549
- config?: AxiosRequestConfig
550
- ): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
551
- }
552
- ['/v2/documents:convert']: {
553
- /**
554
- * convertDocument - convertDocument
555
- *
556
- * Converts a document to a different format.
557
- *
558
- * Supported input document types:
559
- * - .docx
560
- *
561
- * Supported output document types:
562
- * - .pdf
563
- *
564
- */
565
- 'post'(
566
- parameters?: Parameters<UnknownParamsObject> | null,
567
- data?: Paths.ConvertDocument.RequestBody,
568
- config?: AxiosRequestConfig
569
- ): OperationResponse<Paths.ConvertDocument.Responses.$200>
570
- }
571
- }
572
-
573
- export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
574
-
575
- export type ConvertDocumentRequest = Components.Schemas.ConvertDocumentRequest;
576
- export type ConvertDocumentResponse = Components.Schemas.ConvertDocumentResponse;
577
- export type DocumentGenerationV2Request = Components.Schemas.DocumentGenerationV2Request;
578
- export type DocumentGenerationV2Response = Components.Schemas.DocumentGenerationV2Response;
579
- export type DocumentMetaRequest = Components.Schemas.DocumentMetaRequest;
580
- export type DocumentMetaResponse = Components.Schemas.DocumentMetaResponse;
581
- export type DocxTemplaterErrorDetail = Components.Schemas.DocxTemplaterErrorDetail;
582
- export type DocxTemplaterErrorDetails = Components.Schemas.DocxTemplaterErrorDetails;
583
- export type ErrorCode = Components.Schemas.ErrorCode;
584
- export type ErrorOutput = Components.Schemas.ErrorOutput;
585
- export type InternalErrorDetail = Components.Schemas.InternalErrorDetail;
586
- export type InternalErrorDetails = Components.Schemas.InternalErrorDetails;
587
- export type InvalidCustomVariableErrorDetail = Components.Schemas.InvalidCustomVariableErrorDetail;
588
- export type InvalidCustomVariableErrorDetails = Components.Schemas.InvalidCustomVariableErrorDetails;
589
- export type S3Reference = Components.Schemas.S3Reference;
590
- export type TemplateSettings = Components.Schemas.TemplateSettings;
package/src/openapi.d.ts DELETED
@@ -1,590 +0,0 @@
1
- /* eslint-disable */
2
-
3
- import type {
4
- OpenAPIClient,
5
- Parameters,
6
- UnknownParamsObject,
7
- OperationResponse,
8
- AxiosRequestConfig,
9
- } from 'openapi-client-axios';
10
-
11
- declare namespace Components {
12
- namespace Schemas {
13
- export interface ConvertDocumentRequest {
14
- /**
15
- * Input document
16
- */
17
- input_document: {
18
- s3ref: S3Reference;
19
- };
20
- /**
21
- * Output format of the document
22
- */
23
- output_format: "pdf";
24
- /**
25
- * Filename of the output document (optional)
26
- * example:
27
- * converted.pdf
28
- */
29
- output_filename?: string;
30
- }
31
- export interface ConvertDocumentResponse {
32
- output_document?: {
33
- /**
34
- * Pre-signed URL for the converted document
35
- * example:
36
- * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/converted.pdf
37
- */
38
- preview_url?: string;
39
- s3ref?: S3Reference;
40
- };
41
- }
42
- export interface DocumentGenerationV2Request {
43
- /**
44
- * Input template document
45
- */
46
- template_document: {
47
- /**
48
- * Document original filename
49
- * example:
50
- * my-template-{{order.order_number}}.docx
51
- */
52
- filename?: string;
53
- s3ref?: S3Reference;
54
- };
55
- /**
56
- * Entity to use for variable context
57
- * example:
58
- * bcd0aab9-b544-42b0-8bfb-6d449d02eacc
59
- */
60
- context_entity_id?: string; // uuid
61
- /**
62
- * User Id for variable context
63
- * example:
64
- * 100321
65
- */
66
- user_id?: string;
67
- /**
68
- * Language
69
- * example:
70
- * en
71
- */
72
- language?: string;
73
- /**
74
- * Custom values for variables in the template. Takes the higher precedence than others.
75
- */
76
- variable_payload?: {
77
- additionalProperties?: string;
78
- };
79
- /**
80
- * Custom values for variables in the template. Takes the higher precedence than others.
81
- */
82
- context_data?: {
83
- additionalProperties?: string;
84
- };
85
- template_settings?: /* Template Settings for document generation */ TemplateSettings;
86
- }
87
- export interface DocumentGenerationV2Response {
88
- job_id?: string; // uuid
89
- /**
90
- * Status of the job
91
- */
92
- job_status?: "STARTED" | "PROCESSING" | "SUCCESS" | "FAILED";
93
- /**
94
- * A message explaining the progress
95
- */
96
- message?: string;
97
- pdf_output?: {
98
- /**
99
- * Pre-signed S3 GET URL for PDF preview
100
- * example:
101
- * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf
102
- */
103
- preview_url?: string;
104
- /**
105
- * example:
106
- * {
107
- * "s3ref": {
108
- * "bucket": "document-api-preview-prod",
109
- * "key": "preview/my-template.pdf"
110
- * }
111
- * }
112
- */
113
- output_document?: {
114
- /**
115
- * Generated document filename for PDF
116
- * example:
117
- * my-template-OR-001.pdf
118
- */
119
- filename?: string;
120
- s3ref?: S3Reference;
121
- };
122
- };
123
- docx_output?: {
124
- /**
125
- * Pre-signed S3 GET URL for DOCX preview
126
- * example:
127
- * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx
128
- */
129
- preview_url?: string;
130
- /**
131
- * example:
132
- * {
133
- * "s3ref": {
134
- * "bucket": "document-api-preview-prod",
135
- * "key": "preview/my-template.docx"
136
- * }
137
- * }
138
- */
139
- output_document?: {
140
- /**
141
- * Generated document filename for DOCX
142
- * example:
143
- * my-template-OR-001.docx
144
- */
145
- filename?: string;
146
- s3ref?: S3Reference;
147
- };
148
- };
149
- error_output?: ErrorOutput;
150
- /**
151
- * List of variables and its corresponding replaced values from the document template
152
- */
153
- variable_payload?: {
154
- additionalProperties?: string;
155
- };
156
- template_settings?: /* Template Settings for document generation */ TemplateSettings;
157
- }
158
- export interface DocumentMetaRequest {
159
- /**
160
- * Input template document
161
- */
162
- template_document?: {
163
- s3ref?: S3Reference;
164
- };
165
- }
166
- export interface DocumentMetaResponse {
167
- /**
168
- * Page margins for the document
169
- */
170
- page_margins?: {
171
- /**
172
- * Top margin in cm
173
- * example:
174
- * 2.54
175
- */
176
- top?: number;
177
- /**
178
- * Bottom margin in cm
179
- * example:
180
- * 2.54
181
- */
182
- bottom?: number;
183
- /**
184
- * Left margin in cm
185
- * example:
186
- * 2.54
187
- */
188
- left?: number;
189
- /**
190
- * Right margin in cm
191
- * example:
192
- * 2.54
193
- */
194
- right?: number;
195
- /**
196
- * Header margin in cm
197
- * example:
198
- * 2.54
199
- */
200
- header?: number;
201
- /**
202
- * Footer margin in cm
203
- * example:
204
- * 2.54
205
- */
206
- footer?: number;
207
- };
208
- /**
209
- * List of variables in the document
210
- * example:
211
- * [
212
- * "order.billing_contact.0.salutation",
213
- * "order.billing_contact.0.title",
214
- * "order_table",
215
- * "stayHardStatic",
216
- * "opportunity[attribute_name]",
217
- * "opportunity[\"attribute_name\"]",
218
- * "opportunity.[attribute_name]",
219
- * "attribute_name",
220
- * "opportunities.0.attribute_name",
221
- * "opportunities[0].attribute_name",
222
- * "contact.opportunities[0].attribute_name",
223
- * "opportunities[Primary].attribute_name"
224
- * ]
225
- */
226
- variables?: string[];
227
- }
228
- /**
229
- * DocxTemplater error detail
230
- */
231
- export interface DocxTemplaterErrorDetail {
232
- /**
233
- * Id of the error
234
- */
235
- id?: string;
236
- /**
237
- * Context of the error
238
- */
239
- context?: string;
240
- /**
241
- * Explanation of the error
242
- */
243
- explanation?: string;
244
- }
245
- /**
246
- * Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
247
- * See https://docxtemplater.com/docs/errors/#error-schema for more details.
248
- *
249
- */
250
- export type DocxTemplaterErrorDetails = /* DocxTemplater error detail */ DocxTemplaterErrorDetail[];
251
- /**
252
- * Error codes for document generation:
253
- * - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
254
- * - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
255
- * - INTERNAL_ERROR - Internal error. Please contact support.
256
- * - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
257
- *
258
- */
259
- export type ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT";
260
- export interface ErrorOutput {
261
- /**
262
- * Error message
263
- */
264
- error_message?: string;
265
- error_code?: /**
266
- * Error codes for document generation:
267
- * - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
268
- * - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
269
- * - INTERNAL_ERROR - Internal error. Please contact support.
270
- * - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
271
- *
272
- */
273
- ErrorCode;
274
- error_details?: /* Error details for invalid custom variables. This error will appear under 'PARSE_ERROR' error code. */ InvalidCustomVariableErrorDetails | /* Error details for internal error. This error will appear under 'INTERNAL_ERROR' error code. */ InternalErrorDetails | /**
275
- * Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
276
- * See https://docxtemplater.com/docs/errors/#error-schema for more details.
277
- *
278
- */
279
- DocxTemplaterErrorDetails;
280
- }
281
- /**
282
- * Internal error detail
283
- */
284
- export interface InternalErrorDetail {
285
- /**
286
- * Name of the error
287
- */
288
- name?: string;
289
- /**
290
- * Error message
291
- */
292
- message?: string;
293
- /**
294
- * Stack trace
295
- */
296
- stack?: string;
297
- /**
298
- * Cause of the error
299
- */
300
- cause?: string;
301
- }
302
- /**
303
- * Error details for internal error. This error will appear under 'INTERNAL_ERROR' error code.
304
- */
305
- export type InternalErrorDetails = {
306
- items?: /* Internal error detail */ InternalErrorDetail;
307
- }[];
308
- export interface InvalidCustomVariableErrorDetail {
309
- [name: string]: any;
310
- /**
311
- * Explanation for the error
312
- */
313
- explanation?: string;
314
- /**
315
- * Context for the error
316
- */
317
- context?: {
318
- /**
319
- * List of invalid variables
320
- */
321
- invalid_variables?: {
322
- /**
323
- * Variable name
324
- */
325
- variable?: string;
326
- /**
327
- * Explanation for the error
328
- */
329
- error?: string;
330
- }[];
331
- };
332
- }
333
- /**
334
- * Error details for invalid custom variables. This error will appear under 'PARSE_ERROR' error code.
335
- */
336
- export type InvalidCustomVariableErrorDetails = InvalidCustomVariableErrorDetail[];
337
- export interface S3Reference {
338
- /**
339
- * example:
340
- * document-api-prod
341
- */
342
- bucket: string;
343
- /**
344
- * example:
345
- * uploads/my-template.pdf
346
- */
347
- key: string;
348
- }
349
- /**
350
- * Template Settings for document generation
351
- */
352
- export interface TemplateSettings {
353
- /**
354
- * Custom margins for the document
355
- */
356
- custom_margins?: {
357
- /**
358
- * Top margin in cm
359
- * example:
360
- * 2.54
361
- */
362
- top?: number;
363
- /**
364
- * Bottom margin in cm
365
- * example:
366
- * 2.54
367
- */
368
- bottom?: number;
369
- };
370
- /**
371
- * Suggested margins for the document
372
- */
373
- suggested_margins?: {
374
- /**
375
- * Top margin in cm
376
- * example:
377
- * 2.54
378
- */
379
- top?: number;
380
- /**
381
- * Bottom margin in cm
382
- * example:
383
- * 2.54
384
- */
385
- bottom?: number;
386
- };
387
- /**
388
- * Display margin guidelines (applicable to partial generation only)
389
- * example:
390
- * true
391
- */
392
- display_margin_guidelines?: boolean;
393
- /**
394
- * Enable data table margin autofix
395
- * example:
396
- * false
397
- */
398
- enable_data_table_margin_autofix?: boolean;
399
- /**
400
- * A flag that indicates whether the template has 1 or more data tables in it
401
- * example:
402
- * false
403
- */
404
- template_with_datatable?: boolean;
405
- /**
406
- * Enables the persistance of template settings
407
- * example:
408
- * false
409
- */
410
- enabled_template_settings_persistence?: boolean;
411
- /**
412
- * An indication that the page margins are misconfigured
413
- * example:
414
- * false
415
- */
416
- misconfigured_margins?: boolean;
417
- /**
418
- * The file entity id, used when persisting a new template version with updated settings
419
- * example:
420
- * 1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p
421
- */
422
- file_entity_id?: string; // uuid
423
- }
424
- }
425
- }
426
- declare namespace Paths {
427
- namespace ConvertDocument {
428
- export type RequestBody = Components.Schemas.ConvertDocumentRequest;
429
- namespace Responses {
430
- export type $200 = Components.Schemas.ConvertDocumentResponse;
431
- }
432
- }
433
- namespace GenerateDocumentV2 {
434
- namespace Parameters {
435
- export type JobId = string;
436
- export type Mode = "partial_generation" | "full_generation";
437
- export type PreviewMode = "open" | "download";
438
- }
439
- export interface QueryParameters {
440
- job_id?: Parameters.JobId;
441
- mode?: Parameters.Mode;
442
- preview_mode?: Parameters.PreviewMode;
443
- }
444
- export type RequestBody = Components.Schemas.DocumentGenerationV2Request;
445
- namespace Responses {
446
- export type $200 = Components.Schemas.DocumentGenerationV2Response;
447
- }
448
- }
449
- namespace GetTemplateMeta {
450
- export type RequestBody = Components.Schemas.DocumentMetaRequest;
451
- namespace Responses {
452
- export type $200 = Components.Schemas.DocumentMetaResponse;
453
- export type $400 = Components.Schemas.ErrorOutput;
454
- export type $403 = Components.Schemas.ErrorOutput;
455
- }
456
- }
457
- }
458
-
459
- export interface OperationMethods {
460
- /**
461
- * getTemplateMeta - getTemplateMeta
462
- *
463
- * Get metadata for a document template
464
- *
465
- * Supported input document types:
466
- * - .docx
467
- *
468
- */
469
- 'getTemplateMeta'(
470
- parameters?: Parameters<UnknownParamsObject> | null,
471
- data?: Paths.GetTemplateMeta.RequestBody,
472
- config?: AxiosRequestConfig
473
- ): OperationResponse<Paths.GetTemplateMeta.Responses.$200>
474
- /**
475
- * generateDocumentV2 - generateDocumentV2
476
- *
477
- * Builds document generated from input document with variables.
478
- *
479
- * Supported input document types:
480
- * - .docx
481
- *
482
- * Supported output document types:
483
- * - .pdf
484
- * - .docx but limited to only text based variables
485
- *
486
- * Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
487
- *
488
- */
489
- 'generateDocumentV2'(
490
- parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
491
- data?: Paths.GenerateDocumentV2.RequestBody,
492
- config?: AxiosRequestConfig
493
- ): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
494
- /**
495
- * convertDocument - convertDocument
496
- *
497
- * Converts a document to a different format.
498
- *
499
- * Supported input document types:
500
- * - .docx
501
- *
502
- * Supported output document types:
503
- * - .pdf
504
- *
505
- */
506
- 'convertDocument'(
507
- parameters?: Parameters<UnknownParamsObject> | null,
508
- data?: Paths.ConvertDocument.RequestBody,
509
- config?: AxiosRequestConfig
510
- ): OperationResponse<Paths.ConvertDocument.Responses.$200>
511
- }
512
-
513
- export interface PathsDictionary {
514
- ['/v2/documents:meta']: {
515
- /**
516
- * getTemplateMeta - getTemplateMeta
517
- *
518
- * Get metadata for a document template
519
- *
520
- * Supported input document types:
521
- * - .docx
522
- *
523
- */
524
- 'post'(
525
- parameters?: Parameters<UnknownParamsObject> | null,
526
- data?: Paths.GetTemplateMeta.RequestBody,
527
- config?: AxiosRequestConfig
528
- ): OperationResponse<Paths.GetTemplateMeta.Responses.$200>
529
- }
530
- ['/v2/documents:generate']: {
531
- /**
532
- * generateDocumentV2 - generateDocumentV2
533
- *
534
- * Builds document generated from input document with variables.
535
- *
536
- * Supported input document types:
537
- * - .docx
538
- *
539
- * Supported output document types:
540
- * - .pdf
541
- * - .docx but limited to only text based variables
542
- *
543
- * Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
544
- *
545
- */
546
- 'post'(
547
- parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
548
- data?: Paths.GenerateDocumentV2.RequestBody,
549
- config?: AxiosRequestConfig
550
- ): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
551
- }
552
- ['/v2/documents:convert']: {
553
- /**
554
- * convertDocument - convertDocument
555
- *
556
- * Converts a document to a different format.
557
- *
558
- * Supported input document types:
559
- * - .docx
560
- *
561
- * Supported output document types:
562
- * - .pdf
563
- *
564
- */
565
- 'post'(
566
- parameters?: Parameters<UnknownParamsObject> | null,
567
- data?: Paths.ConvertDocument.RequestBody,
568
- config?: AxiosRequestConfig
569
- ): OperationResponse<Paths.ConvertDocument.Responses.$200>
570
- }
571
- }
572
-
573
- export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
574
-
575
- export type ConvertDocumentRequest = Components.Schemas.ConvertDocumentRequest;
576
- export type ConvertDocumentResponse = Components.Schemas.ConvertDocumentResponse;
577
- export type DocumentGenerationV2Request = Components.Schemas.DocumentGenerationV2Request;
578
- export type DocumentGenerationV2Response = Components.Schemas.DocumentGenerationV2Response;
579
- export type DocumentMetaRequest = Components.Schemas.DocumentMetaRequest;
580
- export type DocumentMetaResponse = Components.Schemas.DocumentMetaResponse;
581
- export type DocxTemplaterErrorDetail = Components.Schemas.DocxTemplaterErrorDetail;
582
- export type DocxTemplaterErrorDetails = Components.Schemas.DocxTemplaterErrorDetails;
583
- export type ErrorCode = Components.Schemas.ErrorCode;
584
- export type ErrorOutput = Components.Schemas.ErrorOutput;
585
- export type InternalErrorDetail = Components.Schemas.InternalErrorDetail;
586
- export type InternalErrorDetails = Components.Schemas.InternalErrorDetails;
587
- export type InvalidCustomVariableErrorDetail = Components.Schemas.InvalidCustomVariableErrorDetail;
588
- export type InvalidCustomVariableErrorDetails = Components.Schemas.InvalidCustomVariableErrorDetails;
589
- export type S3Reference = Components.Schemas.S3Reference;
590
- export type TemplateSettings = Components.Schemas.TemplateSettings;