@epilot/document-client 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definition.js +1 -1
- package/dist/openapi.d.ts +21 -17
- package/package.json +1 -1
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={914:function(e,t,
|
|
1
|
+
(()=>{"use strict";var e={914:function(e,t,o){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=r(o(534));t.default=n.default},534:e=>{e.exports=JSON.parse('{"openapi":"3.0.2","info":{"title":"Document API","version":"1.0.0","description":"Generate documents with epilot data\\n\\n[Feature Documentation](https://docs.epilot.io/docs/files/document-generation)\\n"},"tags":[{"name":"Documents","description":"Document Generation"}],"security":[{"EpilotAuth":[]}],"paths":{"/v1/documents:generate":{"post":{"operationId":"generateDocument","summary":"generateDocument","description":"Builds document generated from input document with variables.\\n\\nSupported input document types:\\n- .docx\\n\\nSupported output document types:\\n- .pdf\\n\\nUses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.\\n","tags":["Documents"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string","default":"en","example":"de","description":"Language to use"},"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","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}},"required":["template_document"]}}}},"responses":{"200":{"description":"Generated document output","content":{"application/json":{"schema":{"type":"object","properties":{"preview_url":{"description":"Pre-signed S3 GET URL for 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","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"}}}}}}}}}}},"/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.\\nPartial - Will have a intermediate step for users to validate and replace the variable values before generating the final document.\\nFull - Goes through all the steps for the full generation of final document\\n","schema":{"type":"string","enum":["partial_generation","full_generation"],"default":"automatic"}}],"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"}}}}}}}},"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":{"description":"Error code","type":"string","enum":["PARSE_ERROR","DOC_TO_PDF_CONVERT_ERROR","INTERNAL_ERROR"]},"error_details":{"description":"Error details","type":"array","items":{"type":"object","additionalProperties":true}}}},"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},"misconfigured_margins":{"description":"An indication that the page margins are misconfigured","type":"boolean","example":false}}},"DocumentGenerationV2Request":{"type":"object","properties":{"language":{"type":"string","default":"de","description":"Language to use for variables"},"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","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"}}}}},"servers":[{"url":"https://document.sls.epilot.io"}]}')}},t={},o=function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,o),i.exports}(914),r=exports;for(var n in o)r[n]=o[n];o.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
|
package/dist/openapi.d.ts
CHANGED
|
@@ -165,25 +165,25 @@ declare namespace Components {
|
|
|
165
165
|
* 2.54
|
|
166
166
|
*/
|
|
167
167
|
bottom?: number;
|
|
168
|
-
/**
|
|
169
|
-
* Left margin in cm
|
|
170
|
-
* example:
|
|
171
|
-
* 1.27
|
|
172
|
-
*/
|
|
173
|
-
left?: number;
|
|
174
|
-
/**
|
|
175
|
-
* Right margin in cm
|
|
176
|
-
* example:
|
|
177
|
-
* 1.27
|
|
178
|
-
*/
|
|
179
|
-
right?: number;
|
|
180
168
|
};
|
|
181
169
|
/**
|
|
182
|
-
* Display margin guidelines
|
|
170
|
+
* Display margin guidelines (applicable to partial generation only)
|
|
183
171
|
* example:
|
|
184
172
|
* true
|
|
185
173
|
*/
|
|
186
174
|
display_margin_guidelines?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Enable data table margin autofix
|
|
177
|
+
* example:
|
|
178
|
+
* false
|
|
179
|
+
*/
|
|
180
|
+
enable_data_table_margin_autofix?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* An indication that the page margins are misconfigured
|
|
183
|
+
* example:
|
|
184
|
+
* false
|
|
185
|
+
*/
|
|
186
|
+
misconfigured_margins?: boolean;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
@@ -259,6 +259,10 @@ declare namespace Paths {
|
|
|
259
259
|
job_id?: Parameters.JobId;
|
|
260
260
|
mode?: Parameters.Mode;
|
|
261
261
|
}
|
|
262
|
+
export type RequestBody = Components.Schemas.DocumentGenerationV2Request;
|
|
263
|
+
namespace Responses {
|
|
264
|
+
export type $200 = Components.Schemas.DocumentGenerationV2Response;
|
|
265
|
+
}
|
|
262
266
|
}
|
|
263
267
|
}
|
|
264
268
|
|
|
@@ -299,9 +303,9 @@ export interface OperationMethods {
|
|
|
299
303
|
*/
|
|
300
304
|
'generateDocumentV2'(
|
|
301
305
|
parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
|
|
302
|
-
data?:
|
|
306
|
+
data?: Paths.GenerateDocumentV2.RequestBody,
|
|
303
307
|
config?: AxiosRequestConfig
|
|
304
|
-
): OperationResponse<
|
|
308
|
+
): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
|
|
305
309
|
}
|
|
306
310
|
|
|
307
311
|
export interface PathsDictionary {
|
|
@@ -344,9 +348,9 @@ export interface PathsDictionary {
|
|
|
344
348
|
*/
|
|
345
349
|
'post'(
|
|
346
350
|
parameters?: Parameters<Paths.GenerateDocumentV2.QueryParameters> | null,
|
|
347
|
-
data?:
|
|
351
|
+
data?: Paths.GenerateDocumentV2.RequestBody,
|
|
348
352
|
config?: AxiosRequestConfig
|
|
349
|
-
): OperationResponse<
|
|
353
|
+
): OperationResponse<Paths.GenerateDocumentV2.Responses.$200>
|
|
350
354
|
}
|
|
351
355
|
}
|
|
352
356
|
|