@epilot/document-client 0.1.1 → 0.3.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 CHANGED
@@ -1 +1,2 @@
1
- export declare const getClient: () => import("openapi-client-axios").OpenAPIClient<import("./openapi").OperationMethods, import("./openapi").PathsDictionary>;
1
+ import { Client } from './openapi';
2
+ export declare const getClient: () => Client;
@@ -1 +1 @@
1
- !function(e,t){for(var n in t)e[n]=t[n];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var p=o(n(279));t.default=p.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Document API","version":"0.1.0"},"tags":[{"name":"documents","description":"Documents"}],"security":[{"EpilotAuth":[]}],"paths":{"/v1/documents:generate":{"post":{"operationId":"generateDocument","summary":"generateDocument","description":"Generates document using given context entity and document template.\\n\\nUses [Template Variable API](https://docs.api.staging.epilot.io/template-variables) to replace variables in the document\\n","tags":["documents"],"requestBody":{"description":"Document template and context entity","content":{"application/json":{"schema":{"type":"object","properties":{"template_document":{"type":"object","properties":{"s3ref":{"$ref":"#/components/schemas/S3Reference"}}},"context_entity_id":{"type":"string","example":"bcd0aab9-b544-42b0-8bfb-6d449d02eacc"},"language":{"type":"string","enum":["en","de"],"example":"en"}}}}}},"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":"Epilot Bearer Token"}},"schemas":{"S3Reference":{"type":"object","properties":{"bucket":{"type":"string","example":"document-api-prod"},"key":{"type":"string","example":"uploads/my-template.pdf"}},"required":["bucket","key"]}}}}')}},t={};return function n(o){if(t[o])return t[o].exports;var p=t[o]={exports:{}};return e[o].call(p.exports,p,p.exports,n),p.exports}(914)})());
1
+ !function(e,t){for(var o in t)e[o]=t[o];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"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(279));t.default=r.default},279: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"}},"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={};return function o(n){if(t[n])return t[n].exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,o),r.exports}(914)})());
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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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,70 +8,81 @@ import {
8
8
  } from 'openapi-client-axios';
9
9
 
10
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;
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
- namespace GenerateDocument {
28
- export interface RequestBody {
29
- template_document?: {
30
- s3ref?: Components.Schemas.S3Reference;
31
- };
32
- /**
33
- * example:
34
- * bcd0aab9-b544-42b0-8bfb-6d449d02eacc
35
- */
36
- context_entity_id?: string;
37
- /**
38
- * example:
39
- * en
40
- */
41
- language?: "en" | "de";
42
- }
43
- namespace Responses {
44
- export interface $200 {
45
- /**
46
- * Pre-signed S3 GET URL for preview
47
- * example:
48
- * https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template.pdf
49
- */
50
- preview_url?: string;
51
- /**
52
- * example:
53
- * {
54
- * "s3ref": {
55
- * "bucket": "document-api-preview-prod",
56
- * "key": "preview/my-template.pdf"
57
- * }
58
- * }
59
- */
60
- output_document?: {
61
- s3ref?: Components.Schemas.S3Reference;
62
- };
63
- }
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
+ }
64
70
  }
65
- }
66
71
  }
67
72
 
68
73
  export interface OperationMethods {
69
74
  /**
70
75
  * generateDocument - generateDocument
71
76
  *
72
- * Generates document using given context entity and document template.
77
+ * Builds document generated from input document with variables.
78
+ *
79
+ * Supported input document types:
80
+ * - .docx
73
81
  *
74
- * Uses [Template Variable API](https://docs.api.staging.epilot.io/template-variables) to replace variables in the document
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.
75
86
  *
76
87
  */
77
88
  'generateDocument'(
@@ -86,9 +97,15 @@ export interface PathsDictionary {
86
97
  /**
87
98
  * generateDocument - generateDocument
88
99
  *
89
- * Generates document using given context entity and document template.
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
90
107
  *
91
- * Uses [Template Variable API](https://docs.api.staging.epilot.io/template-variables) to replace variables in the document
108
+ * Uses [Template Variables API](https://docs.epilot.io/api/template-variables) to replace variables in the document.
92
109
  *
93
110
  */
94
111
  'post'(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/document-client",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "API Client for epilot document API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,23 +29,23 @@
29
29
  "author": "epilot GmbH",
30
30
  "license": "UNLICENSED",
31
31
  "peerDependencies": {
32
- "axios": "^0.21.1"
32
+ "axios": "^0.25.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "buffer": "^6.0.3",
36
36
  "https-browserify": "^1.0.0",
37
- "openapi-client-axios": "^3.13.1",
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.21.1",
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": "^3.13.1",
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",
@@ -0,0 +1,119 @@
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>