@epilot/document-client 0.16.1 → 1.0.0-rc.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  API Client for epilot Document API.
4
4
 
5
- Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios)
5
+ Uses [`openapi-client-axios`](https://github.com/anttiviljami/openapi-client-axios)
6
6
 
7
7
  ## Getting Started
8
8
 
package/dist/client.d.ts CHANGED
@@ -1 +1,2 @@
1
- export declare const getClient: () => any;
1
+ import { Client } from './openapi';
2
+ export declare const getClient: () => Client;
@@ -1,2 +1,3 @@
1
+ import type { Document } from 'openapi-client-axios';
1
2
  declare const _default: Document;
2
3
  export default _default;
@@ -1,8 +1 @@
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
- var openapi_json_1 = __importDefault(require("./openapi.json"));
7
- exports.default = openapi_json_1.default;
8
- //# sourceMappingURL=definition.js.map
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: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"}}],"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}}},"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"}}},"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},"variable_payload":{"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 CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './client';
2
- export * from './openapi';
2
+ export type { Client, Components, Paths, PathsDictionary, OperationMethods } from './openapi';
3
3
  export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios';
package/dist/index.js CHANGED
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client"), exports);
18
- __exportStar(require("./openapi"), exports);
19
18
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,433 @@
1
+ /* eslint-disable */
2
+ import type {
3
+ OpenAPIClient,
4
+ Parameters,
5
+ UnknownParamsObject,
6
+ OperationResponse,
7
+ AxiosRequestConfig,
8
+ } from 'openapi-client-axios';
9
+
10
+ declare namespace Components {
11
+ namespace Schemas {
12
+ export interface ConvertDocumentRequest {
13
+ /**
14
+ * Input document
15
+ */
16
+ input_document: {
17
+ s3ref: S3Reference;
18
+ };
19
+ /**
20
+ * Output format of the document
21
+ */
22
+ output_format: "pdf";
23
+ /**
24
+ * Filename of the output document (optional)
25
+ * example:
26
+ * converted.pdf
27
+ */
28
+ output_filename?: string;
29
+ }
30
+ export interface ConvertDocumentResponse {
31
+ output_document?: {
32
+ /**
33
+ * Pre-signed URL for the converted document
34
+ * example:
35
+ * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/converted.pdf
36
+ */
37
+ preview_url?: string;
38
+ s3ref?: S3Reference;
39
+ };
40
+ }
41
+ export interface DocumentGenerationV2Request {
42
+ /**
43
+ * Input template document
44
+ */
45
+ template_document: {
46
+ /**
47
+ * Document original filename
48
+ * example:
49
+ * my-template-{{order.order_number}}.docx
50
+ */
51
+ filename?: string;
52
+ s3ref?: S3Reference;
53
+ };
54
+ /**
55
+ * Entity to use for variable context
56
+ * example:
57
+ * bcd0aab9-b544-42b0-8bfb-6d449d02eacc
58
+ */
59
+ context_entity_id?: string; // uuid
60
+ /**
61
+ * User Id for variable context
62
+ * example:
63
+ * 100321
64
+ */
65
+ user_id?: string;
66
+ /**
67
+ * Custom values for variables in the template. Takes the higher precedence than others.
68
+ */
69
+ variable_payload?: {
70
+ additionalProperties?: string;
71
+ };
72
+ template_settings?: /* Template Settings for document generation */ TemplateSettings;
73
+ }
74
+ export interface DocumentGenerationV2Response {
75
+ job_id?: string; // uuid
76
+ /**
77
+ * Status of the job
78
+ */
79
+ job_status?: "STARTED" | "PROCESSING" | "SUCCESS" | "FAILED";
80
+ /**
81
+ * A message explaining the progress
82
+ */
83
+ message?: string;
84
+ pdf_output?: {
85
+ /**
86
+ * Pre-signed S3 GET URL for PDF preview
87
+ * example:
88
+ * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf
89
+ */
90
+ preview_url?: string;
91
+ /**
92
+ * example:
93
+ * {
94
+ * "s3ref": {
95
+ * "bucket": "document-api-preview-prod",
96
+ * "key": "preview/my-template.pdf"
97
+ * }
98
+ * }
99
+ */
100
+ output_document?: {
101
+ /**
102
+ * Generated document filename for PDF
103
+ * example:
104
+ * my-template-OR-001.pdf
105
+ */
106
+ filename?: string;
107
+ s3ref?: S3Reference;
108
+ };
109
+ };
110
+ docx_output?: {
111
+ /**
112
+ * Pre-signed S3 GET URL for DOCX preview
113
+ * example:
114
+ * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx
115
+ */
116
+ preview_url?: string;
117
+ /**
118
+ * example:
119
+ * {
120
+ * "s3ref": {
121
+ * "bucket": "document-api-preview-prod",
122
+ * "key": "preview/my-template.docx"
123
+ * }
124
+ * }
125
+ */
126
+ output_document?: {
127
+ /**
128
+ * Generated document filename for DOCX
129
+ * example:
130
+ * my-template-OR-001.docx
131
+ */
132
+ filename?: string;
133
+ s3ref?: S3Reference;
134
+ };
135
+ };
136
+ error_output?: ErrorOutput;
137
+ /**
138
+ * List of variables and its corresponding replaced values from the document template
139
+ */
140
+ variable_payload?: {
141
+ additionalProperties?: string;
142
+ };
143
+ template_settings?: /* Template Settings for document generation */ TemplateSettings;
144
+ }
145
+ /**
146
+ * DocxTemplater error detail
147
+ */
148
+ export interface DocxTemplaterErrorDetail {
149
+ /**
150
+ * Id of the error
151
+ */
152
+ id?: string;
153
+ /**
154
+ * Context of the error
155
+ */
156
+ context?: string;
157
+ /**
158
+ * Explanation of the error
159
+ */
160
+ explanation?: string;
161
+ }
162
+ /**
163
+ * Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
164
+ * See https://docxtemplater.com/docs/errors/#error-schema for more details.
165
+ *
166
+ */
167
+ export type DocxTemplaterErrorDetails = /* DocxTemplater error detail */ DocxTemplaterErrorDetail[];
168
+ /**
169
+ * Error codes for document generation:
170
+ * - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
171
+ * - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
172
+ * - INTERNAL_ERROR - Internal error. Please contact support.
173
+ * - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
174
+ *
175
+ */
176
+ export type ErrorCode = "PARSE_ERROR" | "DOC_TO_PDF_CONVERT_ERROR" | "INTERNAL_ERROR" | "INVALID_TEMPLATE_FORMAT";
177
+ export interface ErrorOutput {
178
+ /**
179
+ * Error message
180
+ */
181
+ error_message?: string;
182
+ error_code?: /**
183
+ * Error codes for document generation:
184
+ * - PARSE_ERROR - Error while parsing the document. Normally related with a bad template using the wrong DocxTemplater syntax.
185
+ * - DOC_TO_PDF_CONVERT_ERROR - Error while converting the document to PDF. Normally related with a ConvertAPI failure.
186
+ * - INTERNAL_ERROR - Internal error. Please contact support.
187
+ * - INVALID_TEMPLATE_FORMAT - Invalid template format (only .docx is supported). This can happen due to a bad word file or an unsupported file extension.
188
+ *
189
+ */
190
+ ErrorCode;
191
+ 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 | /**
192
+ * Error details for DocxTemplater error. This error will appear under 'PARSE_ERROR' error code.
193
+ * See https://docxtemplater.com/docs/errors/#error-schema for more details.
194
+ *
195
+ */
196
+ DocxTemplaterErrorDetails;
197
+ }
198
+ /**
199
+ * Internal error detail
200
+ */
201
+ export interface InternalErrorDetail {
202
+ /**
203
+ * Name of the error
204
+ */
205
+ name?: string;
206
+ /**
207
+ * Error message
208
+ */
209
+ message?: string;
210
+ /**
211
+ * Stack trace
212
+ */
213
+ stack?: string;
214
+ /**
215
+ * Cause of the error
216
+ */
217
+ cause?: string;
218
+ }
219
+ /**
220
+ * Error details for internal error. This error will appear under 'INTERNAL_ERROR' error code.
221
+ */
222
+ export type InternalErrorDetails = {
223
+ items?: /* Internal error detail */ InternalErrorDetail;
224
+ }[];
225
+ export interface InvalidCustomVariableErrorDetail {
226
+ [name: string]: any;
227
+ /**
228
+ * Explanation for the error
229
+ */
230
+ explanation?: string;
231
+ /**
232
+ * Context for the error
233
+ */
234
+ context?: {
235
+ /**
236
+ * List of invalid variables
237
+ */
238
+ invalid_variables?: {
239
+ /**
240
+ * Variable name
241
+ */
242
+ variable?: string;
243
+ /**
244
+ * Explanation for the error
245
+ */
246
+ error?: string;
247
+ }[];
248
+ };
249
+ }
250
+ /**
251
+ * Error details for invalid custom variables. This error will appear under 'PARSE_ERROR' error code.
252
+ */
253
+ export type InvalidCustomVariableErrorDetails = InvalidCustomVariableErrorDetail[];
254
+ export interface S3Reference {
255
+ /**
256
+ * example:
257
+ * document-api-prod
258
+ */
259
+ bucket: string;
260
+ /**
261
+ * example:
262
+ * uploads/my-template.pdf
263
+ */
264
+ key: string;
265
+ }
266
+ /**
267
+ * Template Settings for document generation
268
+ */
269
+ export interface TemplateSettings {
270
+ /**
271
+ * Custom margins for the document
272
+ */
273
+ custom_margins?: {
274
+ /**
275
+ * Top margin in cm
276
+ * example:
277
+ * 2.54
278
+ */
279
+ top?: number;
280
+ /**
281
+ * Bottom margin in cm
282
+ * example:
283
+ * 2.54
284
+ */
285
+ bottom?: number;
286
+ };
287
+ /**
288
+ * Display margin guidelines (applicable to partial generation only)
289
+ * example:
290
+ * true
291
+ */
292
+ display_margin_guidelines?: boolean;
293
+ /**
294
+ * Enable data table margin autofix
295
+ * example:
296
+ * false
297
+ */
298
+ enable_data_table_margin_autofix?: boolean;
299
+ /**
300
+ * A flag that indicates whether the template has 1 or more data tables in it
301
+ * example:
302
+ * false
303
+ */
304
+ template_with_datatable?: boolean;
305
+ /**
306
+ * Enables the persistance of template settings
307
+ * example:
308
+ * false
309
+ */
310
+ enabled_template_settings_persistence?: boolean;
311
+ /**
312
+ * An indication that the page margins are misconfigured
313
+ * example:
314
+ * false
315
+ */
316
+ misconfigured_margins?: boolean;
317
+ /**
318
+ * The file entity id, used when persisting a new template version with updated settings
319
+ * example:
320
+ * 1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p
321
+ */
322
+ file_entity_id?: string; // uuid
323
+ }
324
+ }
325
+ }
326
+ declare namespace Paths {
327
+ namespace ConvertDocument {
328
+ export type RequestBody = Components.Schemas.ConvertDocumentRequest;
329
+ namespace Responses {
330
+ export type $200 = Components.Schemas.ConvertDocumentResponse;
331
+ }
332
+ }
333
+ namespace GenerateDocumentV2 {
334
+ namespace Parameters {
335
+ export type JobId = string;
336
+ export type Mode = "partial_generation" | "full_generation";
337
+ }
338
+ export interface QueryParameters {
339
+ job_id?: Parameters.JobId;
340
+ mode?: Parameters.Mode;
341
+ }
342
+ export type RequestBody = Components.Schemas.DocumentGenerationV2Request;
343
+ namespace Responses {
344
+ export type $200 = Components.Schemas.DocumentGenerationV2Response;
345
+ }
346
+ }
347
+ }
348
+
349
+ export interface OperationMethods {
350
+ /**
351
+ * generateDocumentV2 - generateDocumentV2
352
+ *
353
+ * Builds document generated from input document with variables.
354
+ *
355
+ * Supported input document types:
356
+ * - .docx
357
+ *
358
+ * Supported output document types:
359
+ * - .pdf
360
+ * - .docx but limited to only text based variables
361
+ *
362
+ * Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
363
+ *
364
+ */
365
+ 'generateDocumentV2'(
366
+ parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
367
+ data?: Paths.GenerateDocumentV2.RequestBody,
368
+ config?: AxiosRequestConfig
369
+ ): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
370
+ /**
371
+ * convertDocument - convertDocument
372
+ *
373
+ * Converts a document to a different format.
374
+ *
375
+ * Supported input document types:
376
+ * - .docx
377
+ *
378
+ * Supported output document types:
379
+ * - .pdf
380
+ *
381
+ */
382
+ 'convertDocument'(
383
+ parameters?: Parameters<UnknownParamsObject> | null,
384
+ data?: Paths.ConvertDocument.RequestBody,
385
+ config?: AxiosRequestConfig
386
+ ): OperationResponse<Paths.ConvertDocument.Responses.$200>
387
+ }
388
+
389
+ export interface PathsDictionary {
390
+ ['/v2/documents:generate']: {
391
+ /**
392
+ * generateDocumentV2 - generateDocumentV2
393
+ *
394
+ * Builds document generated from input document with variables.
395
+ *
396
+ * Supported input document types:
397
+ * - .docx
398
+ *
399
+ * Supported output document types:
400
+ * - .pdf
401
+ * - .docx but limited to only text based variables
402
+ *
403
+ * Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
404
+ *
405
+ */
406
+ 'post'(
407
+ parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
408
+ data?: Paths.GenerateDocumentV2.RequestBody,
409
+ config?: AxiosRequestConfig
410
+ ): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
411
+ }
412
+ ['/v2/documents:convert']: {
413
+ /**
414
+ * convertDocument - convertDocument
415
+ *
416
+ * Converts a document to a different format.
417
+ *
418
+ * Supported input document types:
419
+ * - .docx
420
+ *
421
+ * Supported output document types:
422
+ * - .pdf
423
+ *
424
+ */
425
+ 'post'(
426
+ parameters?: Parameters<UnknownParamsObject> | null,
427
+ data?: Paths.ConvertDocument.RequestBody,
428
+ config?: AxiosRequestConfig
429
+ ): OperationResponse<Paths.ConvertDocument.Responses.$200>
430
+ }
431
+ }
432
+
433
+ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/document-client",
3
- "version": "0.16.1",
3
+ "version": "1.0.0-rc.1",
4
4
  "description": "API Client for epilot document API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,10 +9,8 @@
9
9
  "typescript": "tsc",
10
10
  "bundle-definition": "webpack",
11
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",
12
+ "typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ./src/openapi.json >> src/openapi.d.ts",
13
+ "build": "tsc && npm run bundle-definition",
16
14
  "build:watch": "npm run build && tsc -w",
17
15
  "release-alpha": "npm version prerelease --preid alpha",
18
16
  "lint": "../../node_modules/eslint/bin/eslint.js src"
@@ -48,7 +46,8 @@
48
46
  "copy-webpack-plugin": "^7.0.0",
49
47
  "jest": "^26.6.3",
50
48
  "json-loader": "^0.5.7",
51
- "openapicmd": "^2.6.0",
49
+ "openapi-client-axios-typegen": "^7.4.1",
50
+ "openapicmd": "^2.1.0",
52
51
  "ts-jest": "^26.5.0",
53
52
  "ts-loader": "^8.0.14",
54
53
  "ts-node": "^10.9.1",