@epilot/document-client 0.2.0 → 0.4.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/client.d.ts +2 -1
- package/dist/definition.js +1 -1
- package/dist/index.js +5 -1
- package/dist/openapi.d.ts +63 -57
- package/package.json +6 -6
- package/src/openapi.d.ts +0 -119
package/dist/client.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Client } from './openapi';
|
|
2
|
+
export declare const getClient: () => Client;
|
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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.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":{"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.pdf"},"output_document":{"type":"object","properties":{"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(r){var n=t[r];if(void 0!==n)return n.exports;var p=t[r]={exports:{}};return e[r].call(p.exports,p,p.exports,o),p.exports}(914),r=exports;for(var n in o)r[n]=o[n];o.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/openapi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import {
|
|
2
|
+
import type {
|
|
3
3
|
OpenAPIClient,
|
|
4
4
|
Parameters,
|
|
5
5
|
UnknownParamsObject,
|
|
@@ -8,66 +8,72 @@ import {
|
|
|
8
8
|
} from 'openapi-client-axios';
|
|
9
9
|
|
|
10
10
|
declare namespace Components {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
|
23
24
|
}
|
|
24
|
-
}
|
|
25
25
|
}
|
|
26
26
|
declare namespace Paths {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
* User Id for variable context
|
|
49
|
+
* example:
|
|
50
|
+
* 100321
|
|
51
|
+
*/
|
|
52
|
+
user_id?: string;
|
|
53
|
+
}
|
|
54
|
+
namespace Responses {
|
|
55
|
+
export interface $200 {
|
|
56
|
+
/**
|
|
57
|
+
* Pre-signed S3 GET URL for preview
|
|
58
|
+
* example:
|
|
59
|
+
* https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template.pdf
|
|
60
|
+
*/
|
|
61
|
+
preview_url?: string;
|
|
62
|
+
/**
|
|
63
|
+
* example:
|
|
64
|
+
* {
|
|
65
|
+
* "s3ref": {
|
|
66
|
+
* "bucket": "document-api-preview-prod",
|
|
67
|
+
* "key": "preview/my-template.pdf"
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
*/
|
|
71
|
+
output_document?: {
|
|
72
|
+
s3ref?: Components.Schemas.S3Reference;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
69
76
|
}
|
|
70
|
-
}
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
export interface OperationMethods {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/document-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "API Client for epilot document API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"buffer": "^6.0.3",
|
|
36
36
|
"https-browserify": "^1.0.0",
|
|
37
|
-
"openapi-client-axios": "^
|
|
37
|
+
"openapi-client-axios": "^5.1.2",
|
|
38
38
|
"stream-http": "^3.1.1",
|
|
39
39
|
"url": "^0.11.0",
|
|
40
40
|
"util": "^0.12.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/jest": "^26.0.20",
|
|
44
|
-
"axios": "^0.
|
|
44
|
+
"axios": "^0.25.0",
|
|
45
45
|
"copy-webpack-plugin": "^7.0.0",
|
|
46
46
|
"jest": "^26.6.3",
|
|
47
47
|
"json-loader": "^0.5.7",
|
|
48
|
-
"openapi-client-axios-typegen": "^
|
|
48
|
+
"openapi-client-axios-typegen": "^5.0.2",
|
|
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 {
|
|
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>
|