@emilgroup/document-sdk-node 1.0.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.
Files changed (130) hide show
  1. package/.openapi-generator/FILES +45 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +68 -0
  5. package/api/document-templates-api.ts +675 -0
  6. package/api/documents-api.ts +762 -0
  7. package/api/layouts-api.ts +661 -0
  8. package/api/searchable-document-owners-api.ts +232 -0
  9. package/api/searchable-documents-api.ts +180 -0
  10. package/api.ts +44 -0
  11. package/base.ts +255 -0
  12. package/common.ts +138 -0
  13. package/configuration.ts +109 -0
  14. package/dist/api/document-templates-api.d.ts +372 -0
  15. package/dist/api/document-templates-api.js +628 -0
  16. package/dist/api/documents-api.d.ts +424 -0
  17. package/dist/api/documents-api.js +723 -0
  18. package/dist/api/layouts-api.d.ts +363 -0
  19. package/dist/api/layouts-api.js +622 -0
  20. package/dist/api/searchable-document-owners-api.d.ts +137 -0
  21. package/dist/api/searchable-document-owners-api.js +254 -0
  22. package/dist/api/searchable-documents-api.d.ts +101 -0
  23. package/dist/api/searchable-documents-api.js +233 -0
  24. package/dist/api.d.ts +20 -0
  25. package/dist/api.js +40 -0
  26. package/dist/base.d.ts +76 -0
  27. package/dist/base.js +364 -0
  28. package/dist/common.d.ts +66 -0
  29. package/dist/common.js +244 -0
  30. package/dist/configuration.d.ts +90 -0
  31. package/dist/configuration.js +44 -0
  32. package/dist/index.d.ts +15 -0
  33. package/dist/index.js +35 -0
  34. package/dist/models/create-doc-template-request-dto.d.ts +43 -0
  35. package/dist/models/create-doc-template-request-dto.js +15 -0
  36. package/dist/models/create-document-request-dto.d.ts +143 -0
  37. package/dist/models/create-document-request-dto.js +65 -0
  38. package/dist/models/create-html-template-dto.d.ts +24 -0
  39. package/dist/models/create-html-template-dto.js +15 -0
  40. package/dist/models/create-layout-request-dto.d.ts +49 -0
  41. package/dist/models/create-layout-request-dto.js +15 -0
  42. package/dist/models/create-presigned-post-request-dto.d.ts +103 -0
  43. package/dist/models/create-presigned-post-request-dto.js +51 -0
  44. package/dist/models/create-presigned-post-response-class.d.ts +30 -0
  45. package/dist/models/create-presigned-post-response-class.js +15 -0
  46. package/dist/models/delete-layout-request-dto.d.ts +24 -0
  47. package/dist/models/delete-layout-request-dto.js +15 -0
  48. package/dist/models/delete-request-dto.d.ts +24 -0
  49. package/dist/models/delete-request-dto.js +15 -0
  50. package/dist/models/doc-template-class.d.ts +80 -0
  51. package/dist/models/doc-template-class.js +15 -0
  52. package/dist/models/document-class.d.ts +150 -0
  53. package/dist/models/document-class.js +61 -0
  54. package/dist/models/download-document-request-dto.d.ts +30 -0
  55. package/dist/models/download-document-request-dto.js +15 -0
  56. package/dist/models/get-doc-template-request-dto.d.ts +30 -0
  57. package/dist/models/get-doc-template-request-dto.js +15 -0
  58. package/dist/models/get-doc-template-response-class.d.ts +25 -0
  59. package/dist/models/get-doc-template-response-class.js +15 -0
  60. package/dist/models/get-document-download-url-response-class.d.ts +24 -0
  61. package/dist/models/get-document-download-url-response-class.js +15 -0
  62. package/dist/models/get-layout-request-dto.d.ts +24 -0
  63. package/dist/models/get-layout-request-dto.js +15 -0
  64. package/dist/models/get-layout-response-class.d.ts +25 -0
  65. package/dist/models/get-layout-response-class.js +15 -0
  66. package/dist/models/html-template-class.d.ts +66 -0
  67. package/dist/models/html-template-class.js +21 -0
  68. package/dist/models/index.d.ts +28 -0
  69. package/dist/models/index.js +44 -0
  70. package/dist/models/layout-class.d.ts +79 -0
  71. package/dist/models/layout-class.js +15 -0
  72. package/dist/models/list-doc-templates-response-class.d.ts +31 -0
  73. package/dist/models/list-doc-templates-response-class.js +15 -0
  74. package/dist/models/list-documents-response-class.d.ts +31 -0
  75. package/dist/models/list-documents-response-class.js +15 -0
  76. package/dist/models/list-layouts-response-class.d.ts +31 -0
  77. package/dist/models/list-layouts-response-class.js +15 -0
  78. package/dist/models/list-request-dto.d.ts +54 -0
  79. package/dist/models/list-request-dto.js +15 -0
  80. package/dist/models/list-searchable-document-owners-response-class.d.ts +24 -0
  81. package/dist/models/list-searchable-document-owners-response-class.js +15 -0
  82. package/dist/models/list-searchable-documents-request-dto.d.ts +30 -0
  83. package/dist/models/list-searchable-documents-request-dto.js +15 -0
  84. package/dist/models/list-searchable-documents-response-class.d.ts +30 -0
  85. package/dist/models/list-searchable-documents-response-class.js +15 -0
  86. package/dist/models/update-doc-template-request-dto.d.ts +49 -0
  87. package/dist/models/update-doc-template-request-dto.js +15 -0
  88. package/dist/models/update-doc-template-response-class.d.ts +25 -0
  89. package/dist/models/update-doc-template-response-class.js +15 -0
  90. package/dist/models/update-document-request-dto.d.ts +48 -0
  91. package/dist/models/update-document-request-dto.js +15 -0
  92. package/dist/models/update-layout-request-dto.d.ts +55 -0
  93. package/dist/models/update-layout-request-dto.js +15 -0
  94. package/dist/models/update-layout-response-class.d.ts +25 -0
  95. package/dist/models/update-layout-response-class.js +15 -0
  96. package/git_push.sh +57 -0
  97. package/index.ts +19 -0
  98. package/models/create-doc-template-request-dto.ts +49 -0
  99. package/models/create-document-request-dto.ts +155 -0
  100. package/models/create-html-template-dto.ts +30 -0
  101. package/models/create-layout-request-dto.ts +55 -0
  102. package/models/create-presigned-post-request-dto.ts +113 -0
  103. package/models/create-presigned-post-response-class.ts +36 -0
  104. package/models/delete-layout-request-dto.ts +30 -0
  105. package/models/delete-request-dto.ts +30 -0
  106. package/models/doc-template-class.ts +86 -0
  107. package/models/document-class.ts +161 -0
  108. package/models/download-document-request-dto.ts +36 -0
  109. package/models/get-doc-template-request-dto.ts +36 -0
  110. package/models/get-doc-template-response-class.ts +31 -0
  111. package/models/get-document-download-url-response-class.ts +30 -0
  112. package/models/get-layout-request-dto.ts +30 -0
  113. package/models/get-layout-response-class.ts +31 -0
  114. package/models/html-template-class.ts +75 -0
  115. package/models/index.ts +28 -0
  116. package/models/layout-class.ts +85 -0
  117. package/models/list-doc-templates-response-class.ts +37 -0
  118. package/models/list-documents-response-class.ts +37 -0
  119. package/models/list-layouts-response-class.ts +37 -0
  120. package/models/list-request-dto.ts +60 -0
  121. package/models/list-searchable-document-owners-response-class.ts +30 -0
  122. package/models/list-searchable-documents-request-dto.ts +36 -0
  123. package/models/list-searchable-documents-response-class.ts +36 -0
  124. package/models/update-doc-template-request-dto.ts +55 -0
  125. package/models/update-doc-template-response-class.ts +31 -0
  126. package/models/update-document-request-dto.ts +54 -0
  127. package/models/update-layout-request-dto.ts +61 -0
  128. package/models/update-layout-response-class.ts +31 -0
  129. package/package.json +29 -0
  130. package/tsconfig.json +22 -0
@@ -0,0 +1,723 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL DocumentService
6
+ * The EMIL DocumentService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (_) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.DocumentsApi = exports.DocumentsApiFactory = exports.DocumentsApiFp = exports.DocumentsApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
92
+ /**
93
+ * DocumentsApi - axios parameter creator
94
+ * @export
95
+ */
96
+ var DocumentsApiAxiosParamCreator = function (configuration) {
97
+ var _this = this;
98
+ return {
99
+ /**
100
+ * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). Document can then be downloaded with
101
+ * @summary Create the document
102
+ * @param {CreateDocumentRequestDto} createDocumentRequestDto
103
+ * @param {string} [authorization] Bearer Token
104
+ * @param {*} [options] Override http request option.
105
+ * @throws {RequiredError}
106
+ */
107
+ createDocument: function (createDocumentRequestDto, authorization, options) {
108
+ if (options === void 0) { options = {}; }
109
+ return __awaiter(_this, void 0, void 0, function () {
110
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
111
+ return __generator(this, function (_a) {
112
+ switch (_a.label) {
113
+ case 0:
114
+ // verify required parameter 'createDocumentRequestDto' is not null or undefined
115
+ (0, common_1.assertParamExists)('createDocument', 'createDocumentRequestDto', createDocumentRequestDto);
116
+ localVarPath = "/documentservice/v1/documents";
117
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
118
+ if (configuration) {
119
+ baseOptions = configuration.baseOptions;
120
+ baseAccessToken = configuration.accessToken;
121
+ }
122
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
123
+ localVarHeaderParameter = {};
124
+ localVarQueryParameter = {};
125
+ // authentication bearer required
126
+ // http bearer authentication required
127
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
128
+ case 1:
129
+ // authentication bearer required
130
+ // http bearer authentication required
131
+ _a.sent();
132
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
133
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
134
+ }
135
+ localVarHeaderParameter['Content-Type'] = 'application/json';
136
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
137
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
138
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
139
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createDocumentRequestDto, localVarRequestOptions, configuration);
140
+ return [2 /*return*/, {
141
+ url: (0, common_1.toPathString)(localVarUrlObj),
142
+ options: localVarRequestOptions,
143
+ }];
144
+ }
145
+ });
146
+ });
147
+ },
148
+ /**
149
+ *
150
+ * @param {CreateDocumentRequestDto} createDocumentRequestDto
151
+ * @param {string} [authorization] Bearer Token
152
+ * @param {*} [options] Override http request option.
153
+ * @throws {RequiredError}
154
+ */
155
+ createTemporaryDocument: function (createDocumentRequestDto, authorization, options) {
156
+ if (options === void 0) { options = {}; }
157
+ return __awaiter(_this, void 0, void 0, function () {
158
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
159
+ return __generator(this, function (_a) {
160
+ switch (_a.label) {
161
+ case 0:
162
+ // verify required parameter 'createDocumentRequestDto' is not null or undefined
163
+ (0, common_1.assertParamExists)('createTemporaryDocument', 'createDocumentRequestDto', createDocumentRequestDto);
164
+ localVarPath = "/documentservice/v1/documents/temporary";
165
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
166
+ if (configuration) {
167
+ baseOptions = configuration.baseOptions;
168
+ baseAccessToken = configuration.accessToken;
169
+ }
170
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
171
+ localVarHeaderParameter = {};
172
+ localVarQueryParameter = {};
173
+ // authentication bearer required
174
+ // http bearer authentication required
175
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
176
+ case 1:
177
+ // authentication bearer required
178
+ // http bearer authentication required
179
+ _a.sent();
180
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
181
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
182
+ }
183
+ localVarHeaderParameter['Content-Type'] = 'application/json';
184
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
185
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
186
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
187
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createDocumentRequestDto, localVarRequestOptions, configuration);
188
+ return [2 /*return*/, {
189
+ url: (0, common_1.toPathString)(localVarUrlObj),
190
+ options: localVarRequestOptions,
191
+ }];
192
+ }
193
+ });
194
+ });
195
+ },
196
+ /**
197
+ * Permanently deletes the document. Supply the unique code that was returned when you created the document and this will delete it.
198
+ * @summary Delete the document
199
+ * @param {string} code
200
+ * @param {string} [authorization] Bearer Token
201
+ * @param {*} [options] Override http request option.
202
+ * @throws {RequiredError}
203
+ */
204
+ deleteDocument: function (code, authorization, options) {
205
+ if (options === void 0) { options = {}; }
206
+ return __awaiter(_this, void 0, void 0, function () {
207
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
208
+ return __generator(this, function (_a) {
209
+ switch (_a.label) {
210
+ case 0:
211
+ // verify required parameter 'code' is not null or undefined
212
+ (0, common_1.assertParamExists)('deleteDocument', 'code', code);
213
+ localVarPath = "/documentservice/v1/documents/{code}"
214
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
215
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
216
+ if (configuration) {
217
+ baseOptions = configuration.baseOptions;
218
+ baseAccessToken = configuration.accessToken;
219
+ }
220
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
221
+ localVarHeaderParameter = {};
222
+ localVarQueryParameter = {};
223
+ // authentication bearer required
224
+ // http bearer authentication required
225
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
226
+ case 1:
227
+ // authentication bearer required
228
+ // http bearer authentication required
229
+ _a.sent();
230
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
231
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
232
+ }
233
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
234
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
235
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
236
+ return [2 /*return*/, {
237
+ url: (0, common_1.toPathString)(localVarUrlObj),
238
+ options: localVarRequestOptions,
239
+ }];
240
+ }
241
+ });
242
+ });
243
+ },
244
+ /**
245
+ * This will return a presigned URL to download the document.
246
+ * @summary Fetches a document download URL
247
+ * @param {string} code
248
+ * @param {string} [authorization] Bearer Token
249
+ * @param {*} [options] Override http request option.
250
+ * @throws {RequiredError}
251
+ */
252
+ getDocumentDownloadUrl: function (code, authorization, options) {
253
+ if (options === void 0) { options = {}; }
254
+ return __awaiter(_this, void 0, void 0, function () {
255
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
256
+ return __generator(this, function (_a) {
257
+ switch (_a.label) {
258
+ case 0:
259
+ // verify required parameter 'code' is not null or undefined
260
+ (0, common_1.assertParamExists)('getDocumentDownloadUrl', 'code', code);
261
+ localVarPath = "/documentservice/v1/documents/{code}/download-url"
262
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
263
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
264
+ if (configuration) {
265
+ baseOptions = configuration.baseOptions;
266
+ baseAccessToken = configuration.accessToken;
267
+ }
268
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
269
+ localVarHeaderParameter = {};
270
+ localVarQueryParameter = {};
271
+ // authentication bearer required
272
+ // http bearer authentication required
273
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
274
+ case 1:
275
+ // authentication bearer required
276
+ // http bearer authentication required
277
+ _a.sent();
278
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
279
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
280
+ }
281
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
282
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
283
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
284
+ return [2 /*return*/, {
285
+ url: (0, common_1.toPathString)(localVarUrlObj),
286
+ options: localVarRequestOptions,
287
+ }];
288
+ }
289
+ });
290
+ });
291
+ },
292
+ /**
293
+ * Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
294
+ * @summary List documents
295
+ * @param {string} [authorization] Bearer Token
296
+ * @param {number} [pageSize] Page size
297
+ * @param {string} [pageToken] Page token
298
+ * @param {string} [filter] List filter
299
+ * @param {string} [search] Search query
300
+ * @param {string} [order] Ordering criteria
301
+ * @param {string} [expand] Extra fields to fetch
302
+ * @param {*} [options] Override http request option.
303
+ * @throws {RequiredError}
304
+ */
305
+ listDocuments: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
306
+ if (options === void 0) { options = {}; }
307
+ return __awaiter(_this, void 0, void 0, function () {
308
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
309
+ return __generator(this, function (_a) {
310
+ switch (_a.label) {
311
+ case 0:
312
+ localVarPath = "/documentservice/v1/documents";
313
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
314
+ if (configuration) {
315
+ baseOptions = configuration.baseOptions;
316
+ baseAccessToken = configuration.accessToken;
317
+ }
318
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
319
+ localVarHeaderParameter = {};
320
+ localVarQueryParameter = {};
321
+ // authentication bearer required
322
+ // http bearer authentication required
323
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
324
+ case 1:
325
+ // authentication bearer required
326
+ // http bearer authentication required
327
+ _a.sent();
328
+ if (pageSize !== undefined) {
329
+ localVarQueryParameter['pageSize'] = pageSize;
330
+ }
331
+ if (pageToken !== undefined) {
332
+ localVarQueryParameter['pageToken'] = pageToken;
333
+ }
334
+ if (filter !== undefined) {
335
+ localVarQueryParameter['filter'] = filter;
336
+ }
337
+ if (search !== undefined) {
338
+ localVarQueryParameter['search'] = search;
339
+ }
340
+ if (order !== undefined) {
341
+ localVarQueryParameter['order'] = order;
342
+ }
343
+ if (expand !== undefined) {
344
+ localVarQueryParameter['expand'] = expand;
345
+ }
346
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
347
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
348
+ }
349
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
350
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
351
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
352
+ return [2 /*return*/, {
353
+ url: (0, common_1.toPathString)(localVarUrlObj),
354
+ options: localVarRequestOptions,
355
+ }];
356
+ }
357
+ });
358
+ });
359
+ },
360
+ /**
361
+ * Updates the specified document by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
362
+ * @summary Update the document
363
+ * @param {string} code
364
+ * @param {UpdateDocumentRequestDto} updateDocumentRequestDto
365
+ * @param {string} [authorization] Bearer Token
366
+ * @param {*} [options] Override http request option.
367
+ * @throws {RequiredError}
368
+ */
369
+ updateDocument: function (code, updateDocumentRequestDto, authorization, options) {
370
+ if (options === void 0) { options = {}; }
371
+ return __awaiter(_this, void 0, void 0, function () {
372
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
373
+ return __generator(this, function (_a) {
374
+ switch (_a.label) {
375
+ case 0:
376
+ // verify required parameter 'code' is not null or undefined
377
+ (0, common_1.assertParamExists)('updateDocument', 'code', code);
378
+ // verify required parameter 'updateDocumentRequestDto' is not null or undefined
379
+ (0, common_1.assertParamExists)('updateDocument', 'updateDocumentRequestDto', updateDocumentRequestDto);
380
+ localVarPath = "/documentservice/v1/documents/{code}"
381
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
382
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
383
+ if (configuration) {
384
+ baseOptions = configuration.baseOptions;
385
+ baseAccessToken = configuration.accessToken;
386
+ }
387
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
388
+ localVarHeaderParameter = {};
389
+ localVarQueryParameter = {};
390
+ // authentication bearer required
391
+ // http bearer authentication required
392
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
393
+ case 1:
394
+ // authentication bearer required
395
+ // http bearer authentication required
396
+ _a.sent();
397
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
398
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
399
+ }
400
+ localVarHeaderParameter['Content-Type'] = 'application/json';
401
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
402
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
403
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
404
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateDocumentRequestDto, localVarRequestOptions, configuration);
405
+ return [2 /*return*/, {
406
+ url: (0, common_1.toPathString)(localVarUrlObj),
407
+ options: localVarRequestOptions,
408
+ }];
409
+ }
410
+ });
411
+ });
412
+ },
413
+ };
414
+ };
415
+ exports.DocumentsApiAxiosParamCreator = DocumentsApiAxiosParamCreator;
416
+ /**
417
+ * DocumentsApi - functional programming interface
418
+ * @export
419
+ */
420
+ var DocumentsApiFp = function (configuration) {
421
+ var localVarAxiosParamCreator = (0, exports.DocumentsApiAxiosParamCreator)(configuration);
422
+ return {
423
+ /**
424
+ * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). Document can then be downloaded with
425
+ * @summary Create the document
426
+ * @param {CreateDocumentRequestDto} createDocumentRequestDto
427
+ * @param {string} [authorization] Bearer Token
428
+ * @param {*} [options] Override http request option.
429
+ * @throws {RequiredError}
430
+ */
431
+ createDocument: function (createDocumentRequestDto, authorization, options) {
432
+ return __awaiter(this, void 0, void 0, function () {
433
+ var localVarAxiosArgs;
434
+ return __generator(this, function (_a) {
435
+ switch (_a.label) {
436
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createDocument(createDocumentRequestDto, authorization, options)];
437
+ case 1:
438
+ localVarAxiosArgs = _a.sent();
439
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
440
+ }
441
+ });
442
+ });
443
+ },
444
+ /**
445
+ *
446
+ * @param {CreateDocumentRequestDto} createDocumentRequestDto
447
+ * @param {string} [authorization] Bearer Token
448
+ * @param {*} [options] Override http request option.
449
+ * @throws {RequiredError}
450
+ */
451
+ createTemporaryDocument: function (createDocumentRequestDto, authorization, options) {
452
+ return __awaiter(this, void 0, void 0, function () {
453
+ var localVarAxiosArgs;
454
+ return __generator(this, function (_a) {
455
+ switch (_a.label) {
456
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createTemporaryDocument(createDocumentRequestDto, authorization, options)];
457
+ case 1:
458
+ localVarAxiosArgs = _a.sent();
459
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
460
+ }
461
+ });
462
+ });
463
+ },
464
+ /**
465
+ * Permanently deletes the document. Supply the unique code that was returned when you created the document and this will delete it.
466
+ * @summary Delete the document
467
+ * @param {string} code
468
+ * @param {string} [authorization] Bearer Token
469
+ * @param {*} [options] Override http request option.
470
+ * @throws {RequiredError}
471
+ */
472
+ deleteDocument: function (code, authorization, options) {
473
+ return __awaiter(this, void 0, void 0, function () {
474
+ var localVarAxiosArgs;
475
+ return __generator(this, function (_a) {
476
+ switch (_a.label) {
477
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteDocument(code, authorization, options)];
478
+ case 1:
479
+ localVarAxiosArgs = _a.sent();
480
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
481
+ }
482
+ });
483
+ });
484
+ },
485
+ /**
486
+ * This will return a presigned URL to download the document.
487
+ * @summary Fetches a document download URL
488
+ * @param {string} code
489
+ * @param {string} [authorization] Bearer Token
490
+ * @param {*} [options] Override http request option.
491
+ * @throws {RequiredError}
492
+ */
493
+ getDocumentDownloadUrl: function (code, authorization, options) {
494
+ return __awaiter(this, void 0, void 0, function () {
495
+ var localVarAxiosArgs;
496
+ return __generator(this, function (_a) {
497
+ switch (_a.label) {
498
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getDocumentDownloadUrl(code, authorization, options)];
499
+ case 1:
500
+ localVarAxiosArgs = _a.sent();
501
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
502
+ }
503
+ });
504
+ });
505
+ },
506
+ /**
507
+ * Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
508
+ * @summary List documents
509
+ * @param {string} [authorization] Bearer Token
510
+ * @param {number} [pageSize] Page size
511
+ * @param {string} [pageToken] Page token
512
+ * @param {string} [filter] List filter
513
+ * @param {string} [search] Search query
514
+ * @param {string} [order] Ordering criteria
515
+ * @param {string} [expand] Extra fields to fetch
516
+ * @param {*} [options] Override http request option.
517
+ * @throws {RequiredError}
518
+ */
519
+ listDocuments: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
520
+ return __awaiter(this, void 0, void 0, function () {
521
+ var localVarAxiosArgs;
522
+ return __generator(this, function (_a) {
523
+ switch (_a.label) {
524
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listDocuments(authorization, pageSize, pageToken, filter, search, order, expand, options)];
525
+ case 1:
526
+ localVarAxiosArgs = _a.sent();
527
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
528
+ }
529
+ });
530
+ });
531
+ },
532
+ /**
533
+ * Updates the specified document by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
534
+ * @summary Update the document
535
+ * @param {string} code
536
+ * @param {UpdateDocumentRequestDto} updateDocumentRequestDto
537
+ * @param {string} [authorization] Bearer Token
538
+ * @param {*} [options] Override http request option.
539
+ * @throws {RequiredError}
540
+ */
541
+ updateDocument: function (code, updateDocumentRequestDto, authorization, options) {
542
+ return __awaiter(this, void 0, void 0, function () {
543
+ var localVarAxiosArgs;
544
+ return __generator(this, function (_a) {
545
+ switch (_a.label) {
546
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateDocument(code, updateDocumentRequestDto, authorization, options)];
547
+ case 1:
548
+ localVarAxiosArgs = _a.sent();
549
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
550
+ }
551
+ });
552
+ });
553
+ },
554
+ };
555
+ };
556
+ exports.DocumentsApiFp = DocumentsApiFp;
557
+ /**
558
+ * DocumentsApi - factory interface
559
+ * @export
560
+ */
561
+ var DocumentsApiFactory = function (configuration, basePath, axios) {
562
+ var localVarFp = (0, exports.DocumentsApiFp)(configuration);
563
+ return {
564
+ /**
565
+ * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). Document can then be downloaded with
566
+ * @summary Create the document
567
+ * @param {CreateDocumentRequestDto} createDocumentRequestDto
568
+ * @param {string} [authorization] Bearer Token
569
+ * @param {*} [options] Override http request option.
570
+ * @throws {RequiredError}
571
+ */
572
+ createDocument: function (createDocumentRequestDto, authorization, options) {
573
+ return localVarFp.createDocument(createDocumentRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
574
+ },
575
+ /**
576
+ *
577
+ * @param {CreateDocumentRequestDto} createDocumentRequestDto
578
+ * @param {string} [authorization] Bearer Token
579
+ * @param {*} [options] Override http request option.
580
+ * @throws {RequiredError}
581
+ */
582
+ createTemporaryDocument: function (createDocumentRequestDto, authorization, options) {
583
+ return localVarFp.createTemporaryDocument(createDocumentRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
584
+ },
585
+ /**
586
+ * Permanently deletes the document. Supply the unique code that was returned when you created the document and this will delete it.
587
+ * @summary Delete the document
588
+ * @param {string} code
589
+ * @param {string} [authorization] Bearer Token
590
+ * @param {*} [options] Override http request option.
591
+ * @throws {RequiredError}
592
+ */
593
+ deleteDocument: function (code, authorization, options) {
594
+ return localVarFp.deleteDocument(code, authorization, options).then(function (request) { return request(axios, basePath); });
595
+ },
596
+ /**
597
+ * This will return a presigned URL to download the document.
598
+ * @summary Fetches a document download URL
599
+ * @param {string} code
600
+ * @param {string} [authorization] Bearer Token
601
+ * @param {*} [options] Override http request option.
602
+ * @throws {RequiredError}
603
+ */
604
+ getDocumentDownloadUrl: function (code, authorization, options) {
605
+ return localVarFp.getDocumentDownloadUrl(code, authorization, options).then(function (request) { return request(axios, basePath); });
606
+ },
607
+ /**
608
+ * Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
609
+ * @summary List documents
610
+ * @param {string} [authorization] Bearer Token
611
+ * @param {number} [pageSize] Page size
612
+ * @param {string} [pageToken] Page token
613
+ * @param {string} [filter] List filter
614
+ * @param {string} [search] Search query
615
+ * @param {string} [order] Ordering criteria
616
+ * @param {string} [expand] Extra fields to fetch
617
+ * @param {*} [options] Override http request option.
618
+ * @throws {RequiredError}
619
+ */
620
+ listDocuments: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
621
+ return localVarFp.listDocuments(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
622
+ },
623
+ /**
624
+ * Updates the specified document by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
625
+ * @summary Update the document
626
+ * @param {string} code
627
+ * @param {UpdateDocumentRequestDto} updateDocumentRequestDto
628
+ * @param {string} [authorization] Bearer Token
629
+ * @param {*} [options] Override http request option.
630
+ * @throws {RequiredError}
631
+ */
632
+ updateDocument: function (code, updateDocumentRequestDto, authorization, options) {
633
+ return localVarFp.updateDocument(code, updateDocumentRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
634
+ },
635
+ };
636
+ };
637
+ exports.DocumentsApiFactory = DocumentsApiFactory;
638
+ /**
639
+ * DocumentsApi - object-oriented interface
640
+ * @export
641
+ * @class DocumentsApi
642
+ * @extends {BaseAPI}
643
+ */
644
+ var DocumentsApi = /** @class */ (function (_super) {
645
+ __extends(DocumentsApi, _super);
646
+ function DocumentsApi() {
647
+ return _super !== null && _super.apply(this, arguments) || this;
648
+ }
649
+ /**
650
+ * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). Document can then be downloaded with
651
+ * @summary Create the document
652
+ * @param {DocumentsApiCreateDocumentRequest} requestParameters Request parameters.
653
+ * @param {*} [options] Override http request option.
654
+ * @throws {RequiredError}
655
+ * @memberof DocumentsApi
656
+ */
657
+ DocumentsApi.prototype.createDocument = function (requestParameters, options) {
658
+ var _this = this;
659
+ return (0, exports.DocumentsApiFp)(this.configuration).createDocument(requestParameters.createDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
660
+ };
661
+ /**
662
+ *
663
+ * @param {DocumentsApiCreateTemporaryDocumentRequest} requestParameters Request parameters.
664
+ * @param {*} [options] Override http request option.
665
+ * @throws {RequiredError}
666
+ * @memberof DocumentsApi
667
+ */
668
+ DocumentsApi.prototype.createTemporaryDocument = function (requestParameters, options) {
669
+ var _this = this;
670
+ return (0, exports.DocumentsApiFp)(this.configuration).createTemporaryDocument(requestParameters.createDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
671
+ };
672
+ /**
673
+ * Permanently deletes the document. Supply the unique code that was returned when you created the document and this will delete it.
674
+ * @summary Delete the document
675
+ * @param {DocumentsApiDeleteDocumentRequest} requestParameters Request parameters.
676
+ * @param {*} [options] Override http request option.
677
+ * @throws {RequiredError}
678
+ * @memberof DocumentsApi
679
+ */
680
+ DocumentsApi.prototype.deleteDocument = function (requestParameters, options) {
681
+ var _this = this;
682
+ return (0, exports.DocumentsApiFp)(this.configuration).deleteDocument(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
683
+ };
684
+ /**
685
+ * This will return a presigned URL to download the document.
686
+ * @summary Fetches a document download URL
687
+ * @param {DocumentsApiGetDocumentDownloadUrlRequest} requestParameters Request parameters.
688
+ * @param {*} [options] Override http request option.
689
+ * @throws {RequiredError}
690
+ * @memberof DocumentsApi
691
+ */
692
+ DocumentsApi.prototype.getDocumentDownloadUrl = function (requestParameters, options) {
693
+ var _this = this;
694
+ return (0, exports.DocumentsApiFp)(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
695
+ };
696
+ /**
697
+ * Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
698
+ * @summary List documents
699
+ * @param {DocumentsApiListDocumentsRequest} requestParameters Request parameters.
700
+ * @param {*} [options] Override http request option.
701
+ * @throws {RequiredError}
702
+ * @memberof DocumentsApi
703
+ */
704
+ DocumentsApi.prototype.listDocuments = function (requestParameters, options) {
705
+ var _this = this;
706
+ if (requestParameters === void 0) { requestParameters = {}; }
707
+ return (0, exports.DocumentsApiFp)(this.configuration).listDocuments(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
708
+ };
709
+ /**
710
+ * Updates the specified document by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
711
+ * @summary Update the document
712
+ * @param {DocumentsApiUpdateDocumentRequest} requestParameters Request parameters.
713
+ * @param {*} [options] Override http request option.
714
+ * @throws {RequiredError}
715
+ * @memberof DocumentsApi
716
+ */
717
+ DocumentsApi.prototype.updateDocument = function (requestParameters, options) {
718
+ var _this = this;
719
+ return (0, exports.DocumentsApiFp)(this.configuration).updateDocument(requestParameters.code, requestParameters.updateDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
720
+ };
721
+ return DocumentsApi;
722
+ }(base_1.BaseAPI));
723
+ exports.DocumentsApi = DocumentsApi;