@epilot/document-client 0.18.0 → 0.18.1
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/LICENSE +21 -0
- package/package.json +15 -15
- package/src/openapi.d.ts +615 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 epilot GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/document-client",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "API Client for epilot document API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "jest",
|
|
9
|
-
"typescript": "tsc",
|
|
10
|
-
"bundle-definition": "webpack",
|
|
11
|
-
"openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/document.yaml",
|
|
12
|
-
"openapi:local": "node ../../scripts/update-openapi.js ../../../document-api/lambda/ApiHandlerFunction/openapi.yml",
|
|
13
|
-
"typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
|
|
14
|
-
"build": "tsc && npm run build:patch && npm run bundle-definition",
|
|
15
|
-
"build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
|
|
16
|
-
"build:watch": "npm run build && tsc -w",
|
|
17
|
-
"release-alpha": "npm version prerelease --preid alpha",
|
|
18
|
-
"lint": "pnpm exec eslint src"
|
|
19
|
-
},
|
|
20
7
|
"files": [
|
|
21
8
|
"*.js",
|
|
22
9
|
"*.d.ts",
|
|
@@ -56,5 +43,18 @@
|
|
|
56
43
|
"typescript": "^4.1.3",
|
|
57
44
|
"webpack": "^5.18.0",
|
|
58
45
|
"webpack-cli": "^4.4.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"test": "jest",
|
|
49
|
+
"typescript": "tsc",
|
|
50
|
+
"bundle-definition": "webpack",
|
|
51
|
+
"openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/document.yaml",
|
|
52
|
+
"openapi:local": "node ../../scripts/update-openapi.js ../../../document-api/lambda/ApiHandlerFunction/openapi.yml",
|
|
53
|
+
"typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
|
|
54
|
+
"build": "tsc && npm run build:patch && npm run bundle-definition",
|
|
55
|
+
"build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
|
|
56
|
+
"build:watch": "npm run build && tsc -w",
|
|
57
|
+
"release-alpha": "npm version prerelease --preid alpha",
|
|
58
|
+
"lint": "pnpm exec eslint src"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
package/src/openapi.d.ts
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
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
|
+
ics_output?: {
|
|
98
|
+
/**
|
|
99
|
+
* example:
|
|
100
|
+
* {
|
|
101
|
+
* "s3ref": {
|
|
102
|
+
* "bucket": "document-api-preview-prod",
|
|
103
|
+
* "key": "preview/my-appointment.ics"
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
*/
|
|
107
|
+
output_document?: {
|
|
108
|
+
/**
|
|
109
|
+
* Generated document filename for ICS
|
|
110
|
+
* example:
|
|
111
|
+
* my-appointment-OR-001.ics
|
|
112
|
+
*/
|
|
113
|
+
filename?: string;
|
|
114
|
+
s3ref?: S3Reference;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
pdf_output?: {
|
|
118
|
+
/**
|
|
119
|
+
* Pre-signed S3 GET URL for PDF preview
|
|
120
|
+
* example:
|
|
121
|
+
* https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf
|
|
122
|
+
*/
|
|
123
|
+
preview_url?: string;
|
|
124
|
+
/**
|
|
125
|
+
* example:
|
|
126
|
+
* {
|
|
127
|
+
* "s3ref": {
|
|
128
|
+
* "bucket": "document-api-preview-prod",
|
|
129
|
+
* "key": "preview/my-template.pdf"
|
|
130
|
+
* }
|
|
131
|
+
* }
|
|
132
|
+
*/
|
|
133
|
+
output_document?: {
|
|
134
|
+
/**
|
|
135
|
+
* Generated document filename for PDF
|
|
136
|
+
* example:
|
|
137
|
+
* my-template-OR-001.pdf
|
|
138
|
+
*/
|
|
139
|
+
filename?: string;
|
|
140
|
+
s3ref?: S3Reference;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
docx_output?: {
|
|
144
|
+
/**
|
|
145
|
+
* Pre-signed S3 GET URL for DOCX preview
|
|
146
|
+
* example:
|
|
147
|
+
* https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx
|
|
148
|
+
*/
|
|
149
|
+
preview_url?: string;
|
|
150
|
+
/**
|
|
151
|
+
* example:
|
|
152
|
+
* {
|
|
153
|
+
* "s3ref": {
|
|
154
|
+
* "bucket": "document-api-preview-prod",
|
|
155
|
+
* "key": "preview/my-template.docx"
|
|
156
|
+
* }
|
|
157
|
+
* }
|
|
158
|
+
*/
|
|
159
|
+
output_document?: {
|
|
160
|
+
/**
|
|
161
|
+
* Generated document filename for DOCX
|
|
162
|
+
* example:
|
|
163
|
+
* my-template-OR-001.docx
|
|
164
|
+
*/
|
|
165
|
+
filename?: string;
|
|
166
|
+
s3ref?: S3Reference;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
error_output?: ErrorOutput;
|
|
170
|
+
/**
|
|
171
|
+
* List of variables and its corresponding replaced values from the document template
|
|
172
|
+
*/
|
|
173
|
+
variable_payload?: {
|
|
174
|
+
additionalProperties?: string;
|
|
175
|
+
};
|
|
176
|
+
template_settings?: /* Template Settings for document generation */ TemplateSettings;
|
|
177
|
+
}
|
|
178
|
+
export interface DocumentMetaRequest {
|
|
179
|
+
/**
|
|
180
|
+
* Input template document
|
|
181
|
+
*/
|
|
182
|
+
template_document?: {
|
|
183
|
+
s3ref?: S3Reference;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
export interface DocumentMetaResponse {
|
|
187
|
+
/**
|
|
188
|
+
* Page margins for the document
|
|
189
|
+
*/
|
|
190
|
+
page_margins?: {
|
|
191
|
+
/**
|
|
192
|
+
* Top margin in cm
|
|
193
|
+
* example:
|
|
194
|
+
* 2.54
|
|
195
|
+
*/
|
|
196
|
+
top?: number;
|
|
197
|
+
/**
|
|
198
|
+
* Bottom margin in cm
|
|
199
|
+
* example:
|
|
200
|
+
* 2.54
|
|
201
|
+
*/
|
|
202
|
+
bottom?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Left margin in cm
|
|
205
|
+
* example:
|
|
206
|
+
* 2.54
|
|
207
|
+
*/
|
|
208
|
+
left?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Right margin in cm
|
|
211
|
+
* example:
|
|
212
|
+
* 2.54
|
|
213
|
+
*/
|
|
214
|
+
right?: number;
|
|
215
|
+
/**
|
|
216
|
+
* Header margin in cm
|
|
217
|
+
* example:
|
|
218
|
+
* 2.54
|
|
219
|
+
*/
|
|
220
|
+
header?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Footer margin in cm
|
|
223
|
+
* example:
|
|
224
|
+
* 2.54
|
|
225
|
+
*/
|
|
226
|
+
footer?: number;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* List of variables in the document
|
|
230
|
+
* example:
|
|
231
|
+
* [
|
|
232
|
+
* "order.billing_contact.0.salutation",
|
|
233
|
+
* "order.billing_contact.0.title",
|
|
234
|
+
* "order_table",
|
|
235
|
+
* "stayHardStatic",
|
|
236
|
+
* "opportunity[attribute_name]",
|
|
237
|
+
* "opportunity[\"attribute_name\"]",
|
|
238
|
+
* "opportunity.[attribute_name]",
|
|
239
|
+
* "attribute_name",
|
|
240
|
+
* "opportunities.0.attribute_name",
|
|
241
|
+
* "opportunities[0].attribute_name",
|
|
242
|
+
* "contact.opportunities[0].attribute_name",
|
|
243
|
+
* "opportunities[Primary].attribute_name"
|
|
244
|
+
* ]
|
|
245
|
+
*/
|
|
246
|
+
variables?: string[];
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* DocxTemplater error detail
|
|
250
|
+
*/
|
|
251
|
+
export interface DocxTemplaterErrorDetail {
|
|
252
|
+
/**
|
|
253
|
+
* Id of the error
|
|
254
|
+
*/
|
|
255
|
+
id?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Context of the error
|
|
258
|
+
*/
|
|
259
|
+
context?: string;
|
|
260
|
+
/**
|
|
261
|
+
* Explanation of the error
|
|
262
|
+
*/
|
|
263
|
+
explanation?: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
|
|
267
|
+
* See https://docxtemplater.com/docs/errors/#error-schema for more details.
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
270
|
+
export type DocxTemplaterErrorDetails = /* DocxTemplater error detail */ DocxTemplaterErrorDetail[];
|
|
271
|
+
/**
|
|
272
|
+
* Error codes for document generation:
|
|
273
|
+
* - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
|
|
274
|
+
* - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
|
|
275
|
+
* - INTERNAL_ERROR - Internal error. Please contact support.
|
|
276
|
+
* - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
|
|
277
|
+
*
|
|
278
|
+
*/
|
|
279
|
+
export type ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT";
|
|
280
|
+
export interface ErrorOutput {
|
|
281
|
+
/**
|
|
282
|
+
* Error message
|
|
283
|
+
*/
|
|
284
|
+
error_message?: string;
|
|
285
|
+
error_code?: /**
|
|
286
|
+
* Error codes for document generation:
|
|
287
|
+
* - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
|
|
288
|
+
* - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
|
|
289
|
+
* - INTERNAL_ERROR - Internal error. Please contact support.
|
|
290
|
+
* - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
|
|
291
|
+
*
|
|
292
|
+
*/
|
|
293
|
+
ErrorCode;
|
|
294
|
+
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 | /**
|
|
295
|
+
* Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
|
|
296
|
+
* See https://docxtemplater.com/docs/errors/#error-schema for more details.
|
|
297
|
+
*
|
|
298
|
+
*/
|
|
299
|
+
DocxTemplaterErrorDetails;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Internal error detail
|
|
303
|
+
*/
|
|
304
|
+
export interface InternalErrorDetail {
|
|
305
|
+
/**
|
|
306
|
+
* Name of the error
|
|
307
|
+
*/
|
|
308
|
+
name?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Error message
|
|
311
|
+
*/
|
|
312
|
+
message?: string;
|
|
313
|
+
/**
|
|
314
|
+
* Stack trace
|
|
315
|
+
*/
|
|
316
|
+
stack?: string;
|
|
317
|
+
/**
|
|
318
|
+
* Cause of the error
|
|
319
|
+
*/
|
|
320
|
+
cause?: string;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Error details for internal error. This error will appear under 'INTERNAL_ERROR' error code.
|
|
324
|
+
*/
|
|
325
|
+
export type InternalErrorDetails = {
|
|
326
|
+
items?: /* Internal error detail */ InternalErrorDetail;
|
|
327
|
+
}[];
|
|
328
|
+
export interface InvalidCustomVariableErrorDetail {
|
|
329
|
+
[name: string]: any;
|
|
330
|
+
/**
|
|
331
|
+
* Explanation for the error
|
|
332
|
+
*/
|
|
333
|
+
explanation?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Context for the error
|
|
336
|
+
*/
|
|
337
|
+
context?: {
|
|
338
|
+
/**
|
|
339
|
+
* List of invalid variables
|
|
340
|
+
*/
|
|
341
|
+
invalid_variables?: {
|
|
342
|
+
/**
|
|
343
|
+
* Variable name
|
|
344
|
+
*/
|
|
345
|
+
variable?: string;
|
|
346
|
+
/**
|
|
347
|
+
* Explanation for the error
|
|
348
|
+
*/
|
|
349
|
+
error?: string;
|
|
350
|
+
}[];
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Error details for invalid custom variables. This error will appear under 'PARSE_ERROR' error code.
|
|
355
|
+
*/
|
|
356
|
+
export type InvalidCustomVariableErrorDetails = InvalidCustomVariableErrorDetail[];
|
|
357
|
+
export interface S3Reference {
|
|
358
|
+
/**
|
|
359
|
+
* example:
|
|
360
|
+
* document-api-prod
|
|
361
|
+
*/
|
|
362
|
+
bucket: string;
|
|
363
|
+
/**
|
|
364
|
+
* example:
|
|
365
|
+
* uploads/my-template.pdf
|
|
366
|
+
*/
|
|
367
|
+
key: string;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Template Settings for document generation
|
|
371
|
+
*/
|
|
372
|
+
export interface TemplateSettings {
|
|
373
|
+
/**
|
|
374
|
+
* Custom margins for the document
|
|
375
|
+
*/
|
|
376
|
+
custom_margins?: {
|
|
377
|
+
/**
|
|
378
|
+
* Top margin in cm
|
|
379
|
+
* example:
|
|
380
|
+
* 2.54
|
|
381
|
+
*/
|
|
382
|
+
top?: number;
|
|
383
|
+
/**
|
|
384
|
+
* Bottom margin in cm
|
|
385
|
+
* example:
|
|
386
|
+
* 2.54
|
|
387
|
+
*/
|
|
388
|
+
bottom?: number;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Suggested margins for the document
|
|
392
|
+
*/
|
|
393
|
+
suggested_margins?: {
|
|
394
|
+
/**
|
|
395
|
+
* Top margin in cm
|
|
396
|
+
* example:
|
|
397
|
+
* 2.54
|
|
398
|
+
*/
|
|
399
|
+
top?: number;
|
|
400
|
+
/**
|
|
401
|
+
* Bottom margin in cm
|
|
402
|
+
* example:
|
|
403
|
+
* 2.54
|
|
404
|
+
*/
|
|
405
|
+
bottom?: number;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Display margin guidelines (applicable to partial generation only)
|
|
409
|
+
* example:
|
|
410
|
+
* true
|
|
411
|
+
*/
|
|
412
|
+
display_margin_guidelines?: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* Enable data table margin autofix
|
|
415
|
+
* example:
|
|
416
|
+
* false
|
|
417
|
+
*/
|
|
418
|
+
enable_data_table_margin_autofix?: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* A flag that indicates whether the template has 1 or more data tables in it
|
|
421
|
+
* example:
|
|
422
|
+
* false
|
|
423
|
+
*/
|
|
424
|
+
template_with_datatable?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Enables the persistance of template settings
|
|
427
|
+
* example:
|
|
428
|
+
* false
|
|
429
|
+
*/
|
|
430
|
+
enabled_template_settings_persistence?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* An indication that the page margins are misconfigured
|
|
433
|
+
* example:
|
|
434
|
+
* false
|
|
435
|
+
*/
|
|
436
|
+
misconfigured_margins?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
* The file entity id, used when persisting a new template version with updated settings
|
|
439
|
+
* example:
|
|
440
|
+
* 1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p
|
|
441
|
+
*/
|
|
442
|
+
file_entity_id?: string; // uuid
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
declare namespace Paths {
|
|
447
|
+
namespace ConvertDocument {
|
|
448
|
+
export type RequestBody = Components.Schemas.ConvertDocumentRequest;
|
|
449
|
+
namespace Responses {
|
|
450
|
+
export type $200 = Components.Schemas.ConvertDocumentResponse;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
namespace GenerateDocumentV2 {
|
|
454
|
+
namespace Parameters {
|
|
455
|
+
export type JobId = string;
|
|
456
|
+
export type Mode = "partial_generation" | "full_generation";
|
|
457
|
+
export type PreviewMode = "open" | "download";
|
|
458
|
+
}
|
|
459
|
+
export interface QueryParameters {
|
|
460
|
+
job_id?: Parameters.JobId;
|
|
461
|
+
mode?: Parameters.Mode;
|
|
462
|
+
preview_mode?: Parameters.PreviewMode;
|
|
463
|
+
}
|
|
464
|
+
export type RequestBody = Components.Schemas.DocumentGenerationV2Request;
|
|
465
|
+
namespace Responses {
|
|
466
|
+
export type $200 = Components.Schemas.DocumentGenerationV2Response;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
namespace GetTemplateMeta {
|
|
470
|
+
export type RequestBody = Components.Schemas.DocumentMetaRequest;
|
|
471
|
+
namespace Responses {
|
|
472
|
+
export type $200 = Components.Schemas.DocumentMetaResponse;
|
|
473
|
+
export type $400 = Components.Schemas.ErrorOutput;
|
|
474
|
+
export type $403 = Components.Schemas.ErrorOutput;
|
|
475
|
+
export type $415 = Components.Schemas.ErrorOutput;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export interface OperationMethods {
|
|
481
|
+
/**
|
|
482
|
+
* getTemplateMeta - getTemplateMeta
|
|
483
|
+
*
|
|
484
|
+
* Get metadata for a document template
|
|
485
|
+
*
|
|
486
|
+
* Supported input document types:
|
|
487
|
+
* - .docx
|
|
488
|
+
*
|
|
489
|
+
*/
|
|
490
|
+
'getTemplateMeta'(
|
|
491
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
492
|
+
data?: Paths.GetTemplateMeta.RequestBody,
|
|
493
|
+
config?: AxiosRequestConfig
|
|
494
|
+
): OperationResponse<Paths.GetTemplateMeta.Responses.$200>
|
|
495
|
+
/**
|
|
496
|
+
* generateDocumentV2 - generateDocumentV2
|
|
497
|
+
*
|
|
498
|
+
* Generates documents from templates with variables.
|
|
499
|
+
*
|
|
500
|
+
* Supported document types as input:
|
|
501
|
+
* - .docx
|
|
502
|
+
* - .ics
|
|
503
|
+
*
|
|
504
|
+
* Supported document types as output:
|
|
505
|
+
* - .pdf
|
|
506
|
+
* - .docx but limited to only text based variables
|
|
507
|
+
* - .ics
|
|
508
|
+
*
|
|
509
|
+
* Uses [Template Variable API](https://docs.epilot.io/api/template-variables) to replace variables in the input document.
|
|
510
|
+
*
|
|
511
|
+
*/
|
|
512
|
+
'generateDocumentV2'(
|
|
513
|
+
parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
|
|
514
|
+
data?: Paths.GenerateDocumentV2.RequestBody,
|
|
515
|
+
config?: AxiosRequestConfig
|
|
516
|
+
): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
|
|
517
|
+
/**
|
|
518
|
+
* convertDocument - convertDocument
|
|
519
|
+
*
|
|
520
|
+
* Converts a document to a different format.
|
|
521
|
+
*
|
|
522
|
+
* Supported input document types:
|
|
523
|
+
* - .docx
|
|
524
|
+
*
|
|
525
|
+
* Supported output document types:
|
|
526
|
+
* - .pdf
|
|
527
|
+
*
|
|
528
|
+
*/
|
|
529
|
+
'convertDocument'(
|
|
530
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
531
|
+
data?: Paths.ConvertDocument.RequestBody,
|
|
532
|
+
config?: AxiosRequestConfig
|
|
533
|
+
): OperationResponse<Paths.ConvertDocument.Responses.$200>
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export interface PathsDictionary {
|
|
537
|
+
['/v2/documents:meta']: {
|
|
538
|
+
/**
|
|
539
|
+
* getTemplateMeta - getTemplateMeta
|
|
540
|
+
*
|
|
541
|
+
* Get metadata for a document template
|
|
542
|
+
*
|
|
543
|
+
* Supported input document types:
|
|
544
|
+
* - .docx
|
|
545
|
+
*
|
|
546
|
+
*/
|
|
547
|
+
'post'(
|
|
548
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
549
|
+
data?: Paths.GetTemplateMeta.RequestBody,
|
|
550
|
+
config?: AxiosRequestConfig
|
|
551
|
+
): OperationResponse<Paths.GetTemplateMeta.Responses.$200>
|
|
552
|
+
}
|
|
553
|
+
['/v2/documents:generate']: {
|
|
554
|
+
/**
|
|
555
|
+
* generateDocumentV2 - generateDocumentV2
|
|
556
|
+
*
|
|
557
|
+
* Generates documents from templates with variables.
|
|
558
|
+
*
|
|
559
|
+
* Supported document types as input:
|
|
560
|
+
* - .docx
|
|
561
|
+
* - .ics
|
|
562
|
+
*
|
|
563
|
+
* Supported document types as output:
|
|
564
|
+
* - .pdf
|
|
565
|
+
* - .docx but limited to only text based variables
|
|
566
|
+
* - .ics
|
|
567
|
+
*
|
|
568
|
+
* Uses [Template Variable API](https://docs.epilot.io/api/template-variables) to replace variables in the input document.
|
|
569
|
+
*
|
|
570
|
+
*/
|
|
571
|
+
'post'(
|
|
572
|
+
parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
|
|
573
|
+
data?: Paths.GenerateDocumentV2.RequestBody,
|
|
574
|
+
config?: AxiosRequestConfig
|
|
575
|
+
): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
|
|
576
|
+
}
|
|
577
|
+
['/v2/documents:convert']: {
|
|
578
|
+
/**
|
|
579
|
+
* convertDocument - convertDocument
|
|
580
|
+
*
|
|
581
|
+
* Converts a document to a different format.
|
|
582
|
+
*
|
|
583
|
+
* Supported input document types:
|
|
584
|
+
* - .docx
|
|
585
|
+
*
|
|
586
|
+
* Supported output document types:
|
|
587
|
+
* - .pdf
|
|
588
|
+
*
|
|
589
|
+
*/
|
|
590
|
+
'post'(
|
|
591
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
592
|
+
data?: Paths.ConvertDocument.RequestBody,
|
|
593
|
+
config?: AxiosRequestConfig
|
|
594
|
+
): OperationResponse<Paths.ConvertDocument.Responses.$200>
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
|
599
|
+
|
|
600
|
+
export type ConvertDocumentRequest = Components.Schemas.ConvertDocumentRequest;
|
|
601
|
+
export type ConvertDocumentResponse = Components.Schemas.ConvertDocumentResponse;
|
|
602
|
+
export type DocumentGenerationV2Request = Components.Schemas.DocumentGenerationV2Request;
|
|
603
|
+
export type DocumentGenerationV2Response = Components.Schemas.DocumentGenerationV2Response;
|
|
604
|
+
export type DocumentMetaRequest = Components.Schemas.DocumentMetaRequest;
|
|
605
|
+
export type DocumentMetaResponse = Components.Schemas.DocumentMetaResponse;
|
|
606
|
+
export type DocxTemplaterErrorDetail = Components.Schemas.DocxTemplaterErrorDetail;
|
|
607
|
+
export type DocxTemplaterErrorDetails = Components.Schemas.DocxTemplaterErrorDetails;
|
|
608
|
+
export type ErrorCode = Components.Schemas.ErrorCode;
|
|
609
|
+
export type ErrorOutput = Components.Schemas.ErrorOutput;
|
|
610
|
+
export type InternalErrorDetail = Components.Schemas.InternalErrorDetail;
|
|
611
|
+
export type InternalErrorDetails = Components.Schemas.InternalErrorDetails;
|
|
612
|
+
export type InvalidCustomVariableErrorDetail = Components.Schemas.InvalidCustomVariableErrorDetail;
|
|
613
|
+
export type InvalidCustomVariableErrorDetails = Components.Schemas.InvalidCustomVariableErrorDetails;
|
|
614
|
+
export type S3Reference = Components.Schemas.S3Reference;
|
|
615
|
+
export type TemplateSettings = Components.Schemas.TemplateSettings;
|