@epilot/document-client 0.3.0 → 0.5.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/dist/definition.js +1 -1
- package/dist/openapi.d.ts +19 -1
- package/package.json +3 -3
- package/src/openapi.d.ts +0 -119
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(()=>{"use strict";var e={914:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(o(534));t.default=r.default},534:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","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"}}}}}}}}}}}},"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"]}}}}')}},t={},o=function o(n){var r=t[n];if(void 0!==r)return r.exports;var p=t[n]={exports:{}};return e[n].call(p.exports,p,p.exports,o),p.exports}(914),n=exports;for(var r in o)n[r]=o[r];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
|
package/dist/openapi.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ declare namespace Paths {
|
|
|
36
36
|
* Input template document
|
|
37
37
|
*/
|
|
38
38
|
template_document: {
|
|
39
|
+
/**
|
|
40
|
+
* Document original filename
|
|
41
|
+
* example:
|
|
42
|
+
* my-template-{{order.order_number}}.docx
|
|
43
|
+
*/
|
|
44
|
+
filename?: string;
|
|
39
45
|
s3ref?: Components.Schemas.S3Reference;
|
|
40
46
|
};
|
|
41
47
|
/**
|
|
@@ -44,13 +50,19 @@ declare namespace Paths {
|
|
|
44
50
|
* bcd0aab9-b544-42b0-8bfb-6d449d02eacc
|
|
45
51
|
*/
|
|
46
52
|
context_entity_id?: string;
|
|
53
|
+
/**
|
|
54
|
+
* User Id for variable context
|
|
55
|
+
* example:
|
|
56
|
+
* 100321
|
|
57
|
+
*/
|
|
58
|
+
user_id?: string;
|
|
47
59
|
}
|
|
48
60
|
namespace Responses {
|
|
49
61
|
export interface $200 {
|
|
50
62
|
/**
|
|
51
63
|
* Pre-signed S3 GET URL for preview
|
|
52
64
|
* example:
|
|
53
|
-
* https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template.pdf
|
|
65
|
+
* https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf
|
|
54
66
|
*/
|
|
55
67
|
preview_url?: string;
|
|
56
68
|
/**
|
|
@@ -63,6 +75,12 @@ declare namespace Paths {
|
|
|
63
75
|
* }
|
|
64
76
|
*/
|
|
65
77
|
output_document?: {
|
|
78
|
+
/**
|
|
79
|
+
* Generated document filename
|
|
80
|
+
* example:
|
|
81
|
+
* my-template-OR-001.pdf
|
|
82
|
+
*/
|
|
83
|
+
filename?: string;
|
|
66
84
|
s3ref?: Components.Schemas.S3Reference;
|
|
67
85
|
};
|
|
68
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/document-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "API Client for epilot document API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"openapicmd": "^1.6.2",
|
|
50
50
|
"ts-jest": "^26.5.0",
|
|
51
51
|
"ts-loader": "^8.0.14",
|
|
52
|
-
"ts-node": "^
|
|
53
|
-
"typescript": "^4.
|
|
52
|
+
"ts-node": "^10.8.2",
|
|
53
|
+
"typescript": "^4.7.4",
|
|
54
54
|
"webpack": "^5.18.0",
|
|
55
55
|
"webpack-cli": "^4.4.0"
|
|
56
56
|
}
|
package/src/openapi.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
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 S3Reference {
|
|
13
|
-
/**
|
|
14
|
-
* example:
|
|
15
|
-
* document-api-prod
|
|
16
|
-
*/
|
|
17
|
-
bucket: string;
|
|
18
|
-
/**
|
|
19
|
-
* example:
|
|
20
|
-
* uploads/my-template.pdf
|
|
21
|
-
*/
|
|
22
|
-
key: string;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
declare namespace Paths {
|
|
27
|
-
namespace GenerateDocument {
|
|
28
|
-
export interface RequestBody {
|
|
29
|
-
/**
|
|
30
|
-
* Language to use
|
|
31
|
-
* example:
|
|
32
|
-
* de
|
|
33
|
-
*/
|
|
34
|
-
language?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Input template document
|
|
37
|
-
*/
|
|
38
|
-
template_document: {
|
|
39
|
-
s3ref?: Components.Schemas.S3Reference;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Entity to use for variable context
|
|
43
|
-
* example:
|
|
44
|
-
* bcd0aab9-b544-42b0-8bfb-6d449d02eacc
|
|
45
|
-
*/
|
|
46
|
-
context_entity_id?: string;
|
|
47
|
-
}
|
|
48
|
-
namespace Responses {
|
|
49
|
-
export interface $200 {
|
|
50
|
-
/**
|
|
51
|
-
* Pre-signed S3 GET URL for preview
|
|
52
|
-
* example:
|
|
53
|
-
* https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template.pdf
|
|
54
|
-
*/
|
|
55
|
-
preview_url?: string;
|
|
56
|
-
/**
|
|
57
|
-
* example:
|
|
58
|
-
* {
|
|
59
|
-
* "s3ref": {
|
|
60
|
-
* "bucket": "document-api-preview-prod",
|
|
61
|
-
* "key": "preview/my-template.pdf"
|
|
62
|
-
* }
|
|
63
|
-
* }
|
|
64
|
-
*/
|
|
65
|
-
output_document?: {
|
|
66
|
-
s3ref?: Components.Schemas.S3Reference;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface OperationMethods {
|
|
74
|
-
/**
|
|
75
|
-
* generateDocument - generateDocument
|
|
76
|
-
*
|
|
77
|
-
* Builds document generated from input document with variables.
|
|
78
|
-
*
|
|
79
|
-
* Supported input document types:
|
|
80
|
-
* - .docx
|
|
81
|
-
*
|
|
82
|
-
* Supported output document types:
|
|
83
|
-
* - .pdf
|
|
84
|
-
*
|
|
85
|
-
* Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
|
|
86
|
-
*
|
|
87
|
-
*/
|
|
88
|
-
'generateDocument'(
|
|
89
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
90
|
-
data?: Paths.GenerateDocument.RequestBody,
|
|
91
|
-
config?: AxiosRequestConfig
|
|
92
|
-
): OperationResponse<Paths.GenerateDocument.Responses.$200>
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface PathsDictionary {
|
|
96
|
-
['/v1/documents:generate']: {
|
|
97
|
-
/**
|
|
98
|
-
* generateDocument - generateDocument
|
|
99
|
-
*
|
|
100
|
-
* Builds document generated from input document with variables.
|
|
101
|
-
*
|
|
102
|
-
* Supported input document types:
|
|
103
|
-
* - .docx
|
|
104
|
-
*
|
|
105
|
-
* Supported output document types:
|
|
106
|
-
* - .pdf
|
|
107
|
-
*
|
|
108
|
-
* Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
|
|
109
|
-
*
|
|
110
|
-
*/
|
|
111
|
-
'post'(
|
|
112
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
113
|
-
data?: Paths.GenerateDocument.RequestBody,
|
|
114
|
-
config?: AxiosRequestConfig
|
|
115
|
-
): OperationResponse<Paths.GenerateDocument.Responses.$200>
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|