groupdocs-parser-cloud 23.10.0 → 26.2.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 (49) hide show
  1. package/LICENSE +1 -1
  2. package/lib/{api_client.d.ts → src/api_client.d.ts} +17 -17
  3. package/lib/{api_client.js → src/api_client.js} +135 -125
  4. package/lib/{api_error.d.ts → src/api_error.d.ts} +56 -56
  5. package/lib/{api_error.js → src/api_error.js} +81 -80
  6. package/lib/{auth.d.ts → src/auth.d.ts} +23 -22
  7. package/lib/{auth.js → src/auth.js} +96 -71
  8. package/lib/{configuration.d.ts → src/configuration.d.ts} +39 -39
  9. package/lib/{configuration.js → src/configuration.js} +56 -55
  10. package/lib/{model.d.ts → src/model.d.ts} +2248 -2206
  11. package/lib/{model.js → src/model.js} +2216 -2169
  12. package/lib/{package_version.d.ts → src/package_version.d.ts} +4 -4
  13. package/lib/{package_version.js → src/package_version.js} +30 -29
  14. package/lib/{parser_api.d.ts → src/parser_api.d.ts} +274 -270
  15. package/lib/{parser_api.js → src/parser_api.js} +930 -893
  16. package/lib/{serializer.d.ts → src/serializer.d.ts} +14 -14
  17. package/lib/{serializer.js → src/serializer.js} +171 -170
  18. package/lib/test/api/test_auth_api.d.ts +1 -0
  19. package/lib/test/api/test_auth_api.js +45 -0
  20. package/lib/test/api/test_barcode_api.d.ts +1 -0
  21. package/lib/test/api/test_barcode_api.js +64 -0
  22. package/lib/test/api/test_file_api.d.ts +1 -0
  23. package/lib/test/api/test_file_api.js +95 -0
  24. package/lib/test/api/test_folder_api.d.ts +1 -0
  25. package/lib/test/api/test_folder_api.js +84 -0
  26. package/lib/test/api/test_formats_api.d.ts +1 -0
  27. package/lib/test/api/test_formats_api.js +60 -0
  28. package/lib/test/api/test_parser_container_api.d.ts +1 -0
  29. package/lib/test/api/test_parser_container_api.js +134 -0
  30. package/lib/test/api/test_parser_image_api.d.ts +1 -0
  31. package/lib/test/api/test_parser_image_api.js +179 -0
  32. package/lib/test/api/test_parser_info_api.d.ts +1 -0
  33. package/lib/test/api/test_parser_info_api.js +112 -0
  34. package/lib/test/api/test_parser_parse_api.d.ts +1 -0
  35. package/lib/test/api/test_parser_parse_api.js +184 -0
  36. package/lib/test/api/test_parser_template_api.d.ts +1 -0
  37. package/lib/test/api/test_parser_template_api.js +168 -0
  38. package/lib/test/api/test_parser_text_api.d.ts +1 -0
  39. package/lib/test/api/test_parser_text_api.js +180 -0
  40. package/lib/test/api/test_storage_api.d.ts +1 -0
  41. package/lib/test/api/test_storage_api.js +76 -0
  42. package/lib/test/test_context.d.ts +30 -0
  43. package/lib/test/test_context.js +156 -0
  44. package/lib/test/test_coverage.d.ts +1 -0
  45. package/lib/test/test_coverage.js +77 -0
  46. package/lib/test/test_file.d.ts +50 -0
  47. package/lib/test/test_file.js +92 -0
  48. package/lib/tsconfig.tsbuildinfo +1 -0
  49. package/package.json +16 -14
@@ -1,893 +1,930 @@
1
- "use strict";
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2003-2023 Aspose Pty Ltd
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- return new (P || (P = Promise))(function (resolve, reject) {
27
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
30
- step((generator = generator.apply(thisArg, _arguments || [])).next());
31
- });
32
- };
33
- function __export(m) {
34
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
35
- }
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- const api_client_1 = require("./api_client");
38
- const configuration_1 = require("./configuration");
39
- const serializer_1 = require("./serializer");
40
- __export(require("./model"));
41
- __export(require("./configuration"));
42
- /**
43
- * GroupDocs.Parser Cloud API
44
- */
45
- class FileApi {
46
- /**
47
- * Creates new instance of FileApi
48
- * @param appSid Application identifier (App SID).
49
- * @param appKey Application private key (App Key).
50
- */
51
- static fromKeys(appSid, appKey) {
52
- const config = new configuration_1.Configuration(appSid, appKey);
53
- return new FileApi(config);
54
- }
55
- /**
56
- * Creates new instance of FileApi
57
- * @param config API configuration.
58
- */
59
- static fromConfig(config) {
60
- return new FileApi(config);
61
- }
62
- /**
63
- * @param config Configuration.
64
- */
65
- constructor(config) {
66
- this.configuration = config;
67
- }
68
- /**
69
- * Copy file
70
- * @param requestObj contains request parameters
71
- */
72
- copyFile(requestObj) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- if (requestObj === null || requestObj === undefined) {
75
- throw new Error('Required parameter "requestObj" was null or undefined when calling copyFile.');
76
- }
77
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/copy/{srcPath}"
78
- .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
79
- const queryParameters = {};
80
- // verify required parameter 'requestObj.srcPath' is not null or undefined
81
- if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
82
- throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling copyFile.');
83
- }
84
- // verify required parameter 'requestObj.destPath' is not null or undefined
85
- if (requestObj.destPath === null || requestObj.destPath === undefined) {
86
- throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling copyFile.');
87
- }
88
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destPath", requestObj.destPath);
89
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
90
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
91
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "versionId", requestObj.versionId);
92
- const requestOptions = {
93
- method: "PUT",
94
- qs: queryParameters,
95
- uri: localVarPath,
96
- json: true,
97
- };
98
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
99
- return Promise.resolve(response);
100
- });
101
- }
102
- /**
103
- * Delete file
104
- * @param requestObj contains request parameters
105
- */
106
- deleteFile(requestObj) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- if (requestObj === null || requestObj === undefined) {
109
- throw new Error('Required parameter "requestObj" was null or undefined when calling deleteFile.');
110
- }
111
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/{path}"
112
- .replace("{" + "path" + "}", String(requestObj.path));
113
- const queryParameters = {};
114
- // verify required parameter 'requestObj.path' is not null or undefined
115
- if (requestObj.path === null || requestObj.path === undefined) {
116
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling deleteFile.');
117
- }
118
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
119
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "versionId", requestObj.versionId);
120
- const requestOptions = {
121
- method: "DELETE",
122
- qs: queryParameters,
123
- uri: localVarPath,
124
- json: true,
125
- };
126
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
127
- return Promise.resolve(response);
128
- });
129
- }
130
- /**
131
- * Download file
132
- * @param requestObj contains request parameters
133
- */
134
- downloadFile(requestObj) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- if (requestObj === null || requestObj === undefined) {
137
- throw new Error('Required parameter "requestObj" was null or undefined when calling downloadFile.');
138
- }
139
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/{path}"
140
- .replace("{" + "path" + "}", String(requestObj.path));
141
- const queryParameters = {};
142
- // verify required parameter 'requestObj.path' is not null or undefined
143
- if (requestObj.path === null || requestObj.path === undefined) {
144
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling downloadFile.');
145
- }
146
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
147
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "versionId", requestObj.versionId);
148
- const requestOptions = {
149
- method: "GET",
150
- qs: queryParameters,
151
- uri: localVarPath,
152
- encoding: null,
153
- };
154
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
155
- const result = serializer_1.Serializer.deserialize(response.body, "Buffer");
156
- return Promise.resolve(result);
157
- });
158
- }
159
- /**
160
- * Move file
161
- * @param requestObj contains request parameters
162
- */
163
- moveFile(requestObj) {
164
- return __awaiter(this, void 0, void 0, function* () {
165
- if (requestObj === null || requestObj === undefined) {
166
- throw new Error('Required parameter "requestObj" was null or undefined when calling moveFile.');
167
- }
168
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/move/{srcPath}"
169
- .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
170
- const queryParameters = {};
171
- // verify required parameter 'requestObj.srcPath' is not null or undefined
172
- if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
173
- throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling moveFile.');
174
- }
175
- // verify required parameter 'requestObj.destPath' is not null or undefined
176
- if (requestObj.destPath === null || requestObj.destPath === undefined) {
177
- throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling moveFile.');
178
- }
179
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destPath", requestObj.destPath);
180
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
181
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
182
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "versionId", requestObj.versionId);
183
- const requestOptions = {
184
- method: "PUT",
185
- qs: queryParameters,
186
- uri: localVarPath,
187
- json: true,
188
- };
189
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
190
- return Promise.resolve(response);
191
- });
192
- }
193
- /**
194
- * Upload file
195
- * @param requestObj contains request parameters
196
- */
197
- uploadFile(requestObj) {
198
- return __awaiter(this, void 0, void 0, function* () {
199
- if (requestObj === null || requestObj === undefined) {
200
- throw new Error('Required parameter "requestObj" was null or undefined when calling uploadFile.');
201
- }
202
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/{path}"
203
- .replace("{" + "path" + "}", String(requestObj.path));
204
- const queryParameters = {};
205
- const formParams = {};
206
- // verify required parameter 'requestObj.path' is not null or undefined
207
- if (requestObj.path === null || requestObj.path === undefined) {
208
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling uploadFile.');
209
- }
210
- // verify required parameter 'requestObj.file' is not null or undefined
211
- if (requestObj.file === null || requestObj.file === undefined) {
212
- throw new Error('Required parameter "requestObj.file" was null or undefined when calling uploadFile.');
213
- }
214
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
215
- if (requestObj.file !== undefined) {
216
- formParams.File = {
217
- value: requestObj.file,
218
- options: {
219
- filename: "file.name",
220
- },
221
- };
222
- }
223
- const requestOptions = {
224
- method: "PUT",
225
- qs: queryParameters,
226
- uri: localVarPath,
227
- json: true,
228
- };
229
- requestOptions.formData = formParams;
230
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
231
- const result = serializer_1.Serializer.deserialize(response.body, "FilesUploadResult");
232
- return Promise.resolve(result);
233
- });
234
- }
235
- }
236
- exports.FileApi = FileApi;
237
- /**
238
- * GroupDocs.Parser Cloud API
239
- */
240
- class FolderApi {
241
- /**
242
- * Creates new instance of FolderApi
243
- * @param appSid Application identifier (App SID).
244
- * @param appKey Application private key (App Key).
245
- */
246
- static fromKeys(appSid, appKey) {
247
- const config = new configuration_1.Configuration(appSid, appKey);
248
- return new FolderApi(config);
249
- }
250
- /**
251
- * Creates new instance of FolderApi
252
- * @param config API configuration.
253
- */
254
- static fromConfig(config) {
255
- return new FolderApi(config);
256
- }
257
- /**
258
- * @param config Configuration.
259
- */
260
- constructor(config) {
261
- this.configuration = config;
262
- }
263
- /**
264
- * Copy folder
265
- * @param requestObj contains request parameters
266
- */
267
- copyFolder(requestObj) {
268
- return __awaiter(this, void 0, void 0, function* () {
269
- if (requestObj === null || requestObj === undefined) {
270
- throw new Error('Required parameter "requestObj" was null or undefined when calling copyFolder.');
271
- }
272
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/copy/{srcPath}"
273
- .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
274
- const queryParameters = {};
275
- // verify required parameter 'requestObj.srcPath' is not null or undefined
276
- if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
277
- throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling copyFolder.');
278
- }
279
- // verify required parameter 'requestObj.destPath' is not null or undefined
280
- if (requestObj.destPath === null || requestObj.destPath === undefined) {
281
- throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling copyFolder.');
282
- }
283
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destPath", requestObj.destPath);
284
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
285
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
286
- const requestOptions = {
287
- method: "PUT",
288
- qs: queryParameters,
289
- uri: localVarPath,
290
- json: true,
291
- };
292
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
293
- return Promise.resolve(response);
294
- });
295
- }
296
- /**
297
- * Create the folder
298
- * @param requestObj contains request parameters
299
- */
300
- createFolder(requestObj) {
301
- return __awaiter(this, void 0, void 0, function* () {
302
- if (requestObj === null || requestObj === undefined) {
303
- throw new Error('Required parameter "requestObj" was null or undefined when calling createFolder.');
304
- }
305
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/{path}"
306
- .replace("{" + "path" + "}", String(requestObj.path));
307
- const queryParameters = {};
308
- // verify required parameter 'requestObj.path' is not null or undefined
309
- if (requestObj.path === null || requestObj.path === undefined) {
310
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling createFolder.');
311
- }
312
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
313
- const requestOptions = {
314
- method: "PUT",
315
- qs: queryParameters,
316
- uri: localVarPath,
317
- json: true,
318
- };
319
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
320
- return Promise.resolve(response);
321
- });
322
- }
323
- /**
324
- * Delete folder
325
- * @param requestObj contains request parameters
326
- */
327
- deleteFolder(requestObj) {
328
- return __awaiter(this, void 0, void 0, function* () {
329
- if (requestObj === null || requestObj === undefined) {
330
- throw new Error('Required parameter "requestObj" was null or undefined when calling deleteFolder.');
331
- }
332
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/{path}"
333
- .replace("{" + "path" + "}", String(requestObj.path));
334
- const queryParameters = {};
335
- // verify required parameter 'requestObj.path' is not null or undefined
336
- if (requestObj.path === null || requestObj.path === undefined) {
337
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling deleteFolder.');
338
- }
339
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
340
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "recursive", requestObj.recursive);
341
- const requestOptions = {
342
- method: "DELETE",
343
- qs: queryParameters,
344
- uri: localVarPath,
345
- json: true,
346
- };
347
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
348
- return Promise.resolve(response);
349
- });
350
- }
351
- /**
352
- * Get all files and folders within a folder
353
- * @param requestObj contains request parameters
354
- */
355
- getFilesList(requestObj) {
356
- return __awaiter(this, void 0, void 0, function* () {
357
- if (requestObj === null || requestObj === undefined) {
358
- throw new Error('Required parameter "requestObj" was null or undefined when calling getFilesList.');
359
- }
360
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/{path}"
361
- .replace("{" + "path" + "}", String(requestObj.path));
362
- const queryParameters = {};
363
- // verify required parameter 'requestObj.path' is not null or undefined
364
- if (requestObj.path === null || requestObj.path === undefined) {
365
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling getFilesList.');
366
- }
367
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
368
- const requestOptions = {
369
- method: "GET",
370
- qs: queryParameters,
371
- uri: localVarPath,
372
- json: true,
373
- };
374
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
375
- const result = serializer_1.Serializer.deserialize(response.body, "FilesList");
376
- return Promise.resolve(result);
377
- });
378
- }
379
- /**
380
- * Move folder
381
- * @param requestObj contains request parameters
382
- */
383
- moveFolder(requestObj) {
384
- return __awaiter(this, void 0, void 0, function* () {
385
- if (requestObj === null || requestObj === undefined) {
386
- throw new Error('Required parameter "requestObj" was null or undefined when calling moveFolder.');
387
- }
388
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/move/{srcPath}"
389
- .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
390
- const queryParameters = {};
391
- // verify required parameter 'requestObj.srcPath' is not null or undefined
392
- if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
393
- throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling moveFolder.');
394
- }
395
- // verify required parameter 'requestObj.destPath' is not null or undefined
396
- if (requestObj.destPath === null || requestObj.destPath === undefined) {
397
- throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling moveFolder.');
398
- }
399
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destPath", requestObj.destPath);
400
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
401
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
402
- const requestOptions = {
403
- method: "PUT",
404
- qs: queryParameters,
405
- uri: localVarPath,
406
- json: true,
407
- };
408
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
409
- return Promise.resolve(response);
410
- });
411
- }
412
- }
413
- exports.FolderApi = FolderApi;
414
- /**
415
- * GroupDocs.Parser Cloud API
416
- */
417
- class InfoApi {
418
- /**
419
- * Creates new instance of InfoApi
420
- * @param appSid Application identifier (App SID).
421
- * @param appKey Application private key (App Key).
422
- */
423
- static fromKeys(appSid, appKey) {
424
- const config = new configuration_1.Configuration(appSid, appKey);
425
- return new InfoApi(config);
426
- }
427
- /**
428
- * Creates new instance of InfoApi
429
- * @param config API configuration.
430
- */
431
- static fromConfig(config) {
432
- return new InfoApi(config);
433
- }
434
- /**
435
- * @param config Configuration.
436
- */
437
- constructor(config) {
438
- this.configuration = config;
439
- }
440
- /**
441
- * Retrieve a container items (relative paths) from document to work with formats that contain attachments, ZIP archives etc.
442
- * @param requestObj contains request parameters
443
- */
444
- container(requestObj) {
445
- return __awaiter(this, void 0, void 0, function* () {
446
- if (requestObj === null || requestObj === undefined) {
447
- throw new Error('Required parameter "requestObj" was null or undefined when calling container.');
448
- }
449
- const localVarPath = this.configuration.getServerUrl() + "/parser/container";
450
- const queryParameters = {};
451
- // verify required parameter 'requestObj.options' is not null or undefined
452
- if (requestObj.options === null || requestObj.options === undefined) {
453
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling container.');
454
- }
455
- const requestOptions = {
456
- method: "POST",
457
- qs: queryParameters,
458
- uri: localVarPath,
459
- json: true,
460
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "ContainerOptions" : requestObj.options.constructor.name),
461
- };
462
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
463
- const result = serializer_1.Serializer.deserialize(response.body, "ContainerResult");
464
- return Promise.resolve(result);
465
- });
466
- }
467
- /**
468
- * Retrieve information about document.
469
- * @param requestObj contains request parameters
470
- */
471
- getInfo(requestObj) {
472
- return __awaiter(this, void 0, void 0, function* () {
473
- if (requestObj === null || requestObj === undefined) {
474
- throw new Error('Required parameter "requestObj" was null or undefined when calling getInfo.');
475
- }
476
- const localVarPath = this.configuration.getServerUrl() + "/parser/info";
477
- const queryParameters = {};
478
- // verify required parameter 'requestObj.options' is not null or undefined
479
- if (requestObj.options === null || requestObj.options === undefined) {
480
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling getInfo.');
481
- }
482
- const requestOptions = {
483
- method: "POST",
484
- qs: queryParameters,
485
- uri: localVarPath,
486
- json: true,
487
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "InfoOptions" : requestObj.options.constructor.name),
488
- };
489
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
490
- const result = serializer_1.Serializer.deserialize(response.body, "InfoResult");
491
- return Promise.resolve(result);
492
- });
493
- }
494
- /**
495
- * List supported file formats.
496
- * @param requestObj contains request parameters
497
- */
498
- getSupportedFileFormats() {
499
- return __awaiter(this, void 0, void 0, function* () {
500
- const localVarPath = this.configuration.getServerUrl() + "/parser/formats";
501
- const queryParameters = {};
502
- const requestOptions = {
503
- method: "GET",
504
- qs: queryParameters,
505
- uri: localVarPath,
506
- json: true,
507
- };
508
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
509
- const result = serializer_1.Serializer.deserialize(response.body, "FormatsResult");
510
- return Promise.resolve(result);
511
- });
512
- }
513
- }
514
- exports.InfoApi = InfoApi;
515
- /**
516
- * GroupDocs.Parser Cloud API
517
- */
518
- class ParseApi {
519
- /**
520
- * Creates new instance of ParseApi
521
- * @param appSid Application identifier (App SID).
522
- * @param appKey Application private key (App Key).
523
- */
524
- static fromKeys(appSid, appKey) {
525
- const config = new configuration_1.Configuration(appSid, appKey);
526
- return new ParseApi(config);
527
- }
528
- /**
529
- * Creates new instance of ParseApi
530
- * @param config API configuration.
531
- */
532
- static fromConfig(config) {
533
- return new ParseApi(config);
534
- }
535
- /**
536
- * @param config Configuration.
537
- */
538
- constructor(config) {
539
- this.configuration = config;
540
- }
541
- /**
542
- * Extract barcodes from document.
543
- * @param requestObj contains request parameters
544
- */
545
- barcodes(requestObj) {
546
- return __awaiter(this, void 0, void 0, function* () {
547
- if (requestObj === null || requestObj === undefined) {
548
- throw new Error('Required parameter "requestObj" was null or undefined when calling barcodes.');
549
- }
550
- const localVarPath = this.configuration.getServerUrl() + "/parser/barcodes";
551
- const queryParameters = {};
552
- // verify required parameter 'requestObj.options' is not null or undefined
553
- if (requestObj.options === null || requestObj.options === undefined) {
554
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling barcodes.');
555
- }
556
- const requestOptions = {
557
- method: "POST",
558
- qs: queryParameters,
559
- uri: localVarPath,
560
- json: true,
561
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "BarcodesOptions" : requestObj.options.constructor.name),
562
- };
563
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
564
- const result = serializer_1.Serializer.deserialize(response.body, "BarcodesResult");
565
- return Promise.resolve(result);
566
- });
567
- }
568
- /**
569
- * Extract images from document.
570
- * @param requestObj contains request parameters
571
- */
572
- images(requestObj) {
573
- return __awaiter(this, void 0, void 0, function* () {
574
- if (requestObj === null || requestObj === undefined) {
575
- throw new Error('Required parameter "requestObj" was null or undefined when calling images.');
576
- }
577
- const localVarPath = this.configuration.getServerUrl() + "/parser/images";
578
- const queryParameters = {};
579
- // verify required parameter 'requestObj.options' is not null or undefined
580
- if (requestObj.options === null || requestObj.options === undefined) {
581
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling images.');
582
- }
583
- const requestOptions = {
584
- method: "POST",
585
- qs: queryParameters,
586
- uri: localVarPath,
587
- json: true,
588
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "ImagesOptions" : requestObj.options.constructor.name),
589
- };
590
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
591
- const result = serializer_1.Serializer.deserialize(response.body, "ImagesResult");
592
- return Promise.resolve(result);
593
- });
594
- }
595
- /**
596
- * Extract document data by a predefined template.
597
- * @param requestObj contains request parameters
598
- */
599
- parse(requestObj) {
600
- return __awaiter(this, void 0, void 0, function* () {
601
- if (requestObj === null || requestObj === undefined) {
602
- throw new Error('Required parameter "requestObj" was null or undefined when calling parse.');
603
- }
604
- const localVarPath = this.configuration.getServerUrl() + "/parser/parse";
605
- const queryParameters = {};
606
- // verify required parameter 'requestObj.options' is not null or undefined
607
- if (requestObj.options === null || requestObj.options === undefined) {
608
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling parse.');
609
- }
610
- const requestOptions = {
611
- method: "POST",
612
- qs: queryParameters,
613
- uri: localVarPath,
614
- json: true,
615
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "ParseOptions" : requestObj.options.constructor.name),
616
- };
617
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
618
- const result = serializer_1.Serializer.deserialize(response.body, "ParseResult");
619
- return Promise.resolve(result);
620
- });
621
- }
622
- /**
623
- * Extract text from document.
624
- * @param requestObj contains request parameters
625
- */
626
- text(requestObj) {
627
- return __awaiter(this, void 0, void 0, function* () {
628
- if (requestObj === null || requestObj === undefined) {
629
- throw new Error('Required parameter "requestObj" was null or undefined when calling text.');
630
- }
631
- const localVarPath = this.configuration.getServerUrl() + "/parser/text";
632
- const queryParameters = {};
633
- // verify required parameter 'requestObj.options' is not null or undefined
634
- if (requestObj.options === null || requestObj.options === undefined) {
635
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling text.');
636
- }
637
- const requestOptions = {
638
- method: "POST",
639
- qs: queryParameters,
640
- uri: localVarPath,
641
- json: true,
642
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "TextOptions" : requestObj.options.constructor.name),
643
- };
644
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
645
- const result = serializer_1.Serializer.deserialize(response.body, "TextResult");
646
- return Promise.resolve(result);
647
- });
648
- }
649
- }
650
- exports.ParseApi = ParseApi;
651
- /**
652
- * GroupDocs.Parser Cloud API
653
- */
654
- class StorageApi {
655
- /**
656
- * Creates new instance of StorageApi
657
- * @param appSid Application identifier (App SID).
658
- * @param appKey Application private key (App Key).
659
- */
660
- static fromKeys(appSid, appKey) {
661
- const config = new configuration_1.Configuration(appSid, appKey);
662
- return new StorageApi(config);
663
- }
664
- /**
665
- * Creates new instance of StorageApi
666
- * @param config API configuration.
667
- */
668
- static fromConfig(config) {
669
- return new StorageApi(config);
670
- }
671
- /**
672
- * @param config Configuration.
673
- */
674
- constructor(config) {
675
- this.configuration = config;
676
- }
677
- /**
678
- * Get disc usage
679
- * @param requestObj contains request parameters
680
- */
681
- getDiscUsage(requestObj) {
682
- return __awaiter(this, void 0, void 0, function* () {
683
- if (requestObj === null || requestObj === undefined) {
684
- throw new Error('Required parameter "requestObj" was null or undefined when calling getDiscUsage.');
685
- }
686
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/disc";
687
- const queryParameters = {};
688
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
689
- const requestOptions = {
690
- method: "GET",
691
- qs: queryParameters,
692
- uri: localVarPath,
693
- json: true,
694
- };
695
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
696
- const result = serializer_1.Serializer.deserialize(response.body, "DiscUsage");
697
- return Promise.resolve(result);
698
- });
699
- }
700
- /**
701
- * Get file versions
702
- * @param requestObj contains request parameters
703
- */
704
- getFileVersions(requestObj) {
705
- return __awaiter(this, void 0, void 0, function* () {
706
- if (requestObj === null || requestObj === undefined) {
707
- throw new Error('Required parameter "requestObj" was null or undefined when calling getFileVersions.');
708
- }
709
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/version/{path}"
710
- .replace("{" + "path" + "}", String(requestObj.path));
711
- const queryParameters = {};
712
- // verify required parameter 'requestObj.path' is not null or undefined
713
- if (requestObj.path === null || requestObj.path === undefined) {
714
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling getFileVersions.');
715
- }
716
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
717
- const requestOptions = {
718
- method: "GET",
719
- qs: queryParameters,
720
- uri: localVarPath,
721
- json: true,
722
- };
723
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
724
- const result = serializer_1.Serializer.deserialize(response.body, "FileVersions");
725
- return Promise.resolve(result);
726
- });
727
- }
728
- /**
729
- * Check if file or folder exists
730
- * @param requestObj contains request parameters
731
- */
732
- objectExists(requestObj) {
733
- return __awaiter(this, void 0, void 0, function* () {
734
- if (requestObj === null || requestObj === undefined) {
735
- throw new Error('Required parameter "requestObj" was null or undefined when calling objectExists.');
736
- }
737
- let localVarPath = this.configuration.getServerUrl() + "/parser/storage/exist/{path}"
738
- .replace("{" + "path" + "}", String(requestObj.path));
739
- const queryParameters = {};
740
- // verify required parameter 'requestObj.path' is not null or undefined
741
- if (requestObj.path === null || requestObj.path === undefined) {
742
- throw new Error('Required parameter "requestObj.path" was null or undefined when calling objectExists.');
743
- }
744
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
745
- localVarPath = api_client_1.addQueryParameterToUrl(localVarPath, queryParameters, "versionId", requestObj.versionId);
746
- const requestOptions = {
747
- method: "GET",
748
- qs: queryParameters,
749
- uri: localVarPath,
750
- json: true,
751
- };
752
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
753
- const result = serializer_1.Serializer.deserialize(response.body, "ObjectExist");
754
- return Promise.resolve(result);
755
- });
756
- }
757
- /**
758
- * Check if storage exists
759
- * @param requestObj contains request parameters
760
- */
761
- storageExists(requestObj) {
762
- return __awaiter(this, void 0, void 0, function* () {
763
- if (requestObj === null || requestObj === undefined) {
764
- throw new Error('Required parameter "requestObj" was null or undefined when calling storageExists.');
765
- }
766
- const localVarPath = this.configuration.getServerUrl() + "/parser/storage/{storageName}/exist"
767
- .replace("{" + "storageName" + "}", String(requestObj.storageName));
768
- const queryParameters = {};
769
- // verify required parameter 'requestObj.storageName' is not null or undefined
770
- if (requestObj.storageName === null || requestObj.storageName === undefined) {
771
- throw new Error('Required parameter "requestObj.storageName" was null or undefined when calling storageExists.');
772
- }
773
- const requestOptions = {
774
- method: "GET",
775
- qs: queryParameters,
776
- uri: localVarPath,
777
- json: true,
778
- };
779
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
780
- const result = serializer_1.Serializer.deserialize(response.body, "StorageExist");
781
- return Promise.resolve(result);
782
- });
783
- }
784
- }
785
- exports.StorageApi = StorageApi;
786
- /**
787
- * GroupDocs.Parser Cloud API
788
- */
789
- class TemplateApi {
790
- /**
791
- * Creates new instance of TemplateApi
792
- * @param appSid Application identifier (App SID).
793
- * @param appKey Application private key (App Key).
794
- */
795
- static fromKeys(appSid, appKey) {
796
- const config = new configuration_1.Configuration(appSid, appKey);
797
- return new TemplateApi(config);
798
- }
799
- /**
800
- * Creates new instance of TemplateApi
801
- * @param config API configuration.
802
- */
803
- static fromConfig(config) {
804
- return new TemplateApi(config);
805
- }
806
- /**
807
- * @param config Configuration.
808
- */
809
- constructor(config) {
810
- this.configuration = config;
811
- }
812
- /**
813
- * Create or update document template.
814
- * @param requestObj contains request parameters
815
- */
816
- createTemplate(requestObj) {
817
- return __awaiter(this, void 0, void 0, function* () {
818
- if (requestObj === null || requestObj === undefined) {
819
- throw new Error('Required parameter "requestObj" was null or undefined when calling createTemplate.');
820
- }
821
- const localVarPath = this.configuration.getServerUrl() + "/parser/template";
822
- const queryParameters = {};
823
- // verify required parameter 'requestObj.options' is not null or undefined
824
- if (requestObj.options === null || requestObj.options === undefined) {
825
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling createTemplate.');
826
- }
827
- const requestOptions = {
828
- method: "PUT",
829
- qs: queryParameters,
830
- uri: localVarPath,
831
- json: true,
832
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "CreateTemplateOptions" : requestObj.options.constructor.name),
833
- };
834
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
835
- const result = serializer_1.Serializer.deserialize(response.body, "TemplateResult");
836
- return Promise.resolve(result);
837
- });
838
- }
839
- /**
840
- * Delete document template.
841
- * @param requestObj contains request parameters
842
- */
843
- deleteTemplate(requestObj) {
844
- return __awaiter(this, void 0, void 0, function* () {
845
- if (requestObj === null || requestObj === undefined) {
846
- throw new Error('Required parameter "requestObj" was null or undefined when calling deleteTemplate.');
847
- }
848
- const localVarPath = this.configuration.getServerUrl() + "/parser/template";
849
- const queryParameters = {};
850
- // verify required parameter 'requestObj.options' is not null or undefined
851
- if (requestObj.options === null || requestObj.options === undefined) {
852
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling deleteTemplate.');
853
- }
854
- const requestOptions = {
855
- method: "DELETE",
856
- qs: queryParameters,
857
- uri: localVarPath,
858
- json: true,
859
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "TemplateOptions" : requestObj.options.constructor.name),
860
- };
861
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
862
- return Promise.resolve(response);
863
- });
864
- }
865
- /**
866
- * Retrieve document template.
867
- * @param requestObj contains request parameters
868
- */
869
- getTemplate(requestObj) {
870
- return __awaiter(this, void 0, void 0, function* () {
871
- if (requestObj === null || requestObj === undefined) {
872
- throw new Error('Required parameter "requestObj" was null or undefined when calling getTemplate.');
873
- }
874
- const localVarPath = this.configuration.getServerUrl() + "/parser/template";
875
- const queryParameters = {};
876
- // verify required parameter 'requestObj.options' is not null or undefined
877
- if (requestObj.options === null || requestObj.options === undefined) {
878
- throw new Error('Required parameter "requestObj.options" was null or undefined when calling getTemplate.');
879
- }
880
- const requestOptions = {
881
- method: "POST",
882
- qs: queryParameters,
883
- uri: localVarPath,
884
- json: true,
885
- body: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "TemplateOptions" : requestObj.options.constructor.name),
886
- };
887
- const response = yield api_client_1.invokeApiMethod(requestOptions, this.configuration);
888
- const result = serializer_1.Serializer.deserialize(response.body, "Template");
889
- return Promise.resolve(result);
890
- });
891
- }
892
- }
893
- exports.TemplateApi = TemplateApi;
1
+ "use strict";
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) Aspose Pty Ltd
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ var desc = Object.getOwnPropertyDescriptor(m, k);
28
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
29
+ desc = { enumerable: true, get: function() { return m[k]; } };
30
+ }
31
+ Object.defineProperty(o, k2, desc);
32
+ }) : (function(o, m, k, k2) {
33
+ if (k2 === undefined) k2 = k;
34
+ o[k2] = m[k];
35
+ }));
36
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
37
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
38
+ };
39
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
40
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
41
+ return new (P || (P = Promise))(function (resolve, reject) {
42
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
43
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
44
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
45
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
46
+ });
47
+ };
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.TemplateApi = exports.StorageApi = exports.ParseApi = exports.InfoApi = exports.FolderApi = exports.FileApi = void 0;
50
+ const FormData = require("form-data");
51
+ const api_client_1 = require("./api_client");
52
+ const configuration_1 = require("./configuration");
53
+ const serializer_1 = require("./serializer");
54
+ __exportStar(require("./model"), exports);
55
+ __exportStar(require("./configuration"), exports);
56
+ /**
57
+ * GroupDocs.Parser Cloud API
58
+ */
59
+ class FileApi {
60
+ /**
61
+ * Creates new instance of FileApi
62
+ * @param appSid Application identifier (App SID).
63
+ * @param appKey Application private key (App Key).
64
+ */
65
+ static fromKeys(appSid, appKey) {
66
+ const config = new configuration_1.Configuration(appSid, appKey);
67
+ return new FileApi(config);
68
+ }
69
+ /**
70
+ * Creates new instance of FileApi
71
+ * @param config API configuration.
72
+ */
73
+ static fromConfig(config) {
74
+ return new FileApi(config);
75
+ }
76
+ /**
77
+ * @param config Configuration.
78
+ */
79
+ constructor(config) {
80
+ this.configuration = config;
81
+ }
82
+ /**
83
+ * Copy file
84
+ * @param requestObj contains request parameters
85
+ */
86
+ copyFile(requestObj) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ if (requestObj === null || requestObj === undefined) {
89
+ throw new Error('Required parameter "requestObj" was null or undefined when calling copyFile.');
90
+ }
91
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/copy/{srcPath}"
92
+ .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
93
+ const queryParameters = {};
94
+ // verify required parameter 'requestObj.srcPath' is not null or undefined
95
+ if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
96
+ throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling copyFile.');
97
+ }
98
+ // verify required parameter 'requestObj.destPath' is not null or undefined
99
+ if (requestObj.destPath === null || requestObj.destPath === undefined) {
100
+ throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling copyFile.');
101
+ }
102
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destPath", requestObj.destPath);
103
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
104
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
105
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "versionId", requestObj.versionId);
106
+ const requestOptions = {
107
+ method: "PUT",
108
+ params: queryParameters,
109
+ url: localVarPath,
110
+ responseType: "json",
111
+ };
112
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
113
+ return Promise.resolve(response);
114
+ });
115
+ }
116
+ /**
117
+ * Delete file
118
+ * @param requestObj contains request parameters
119
+ */
120
+ deleteFile(requestObj) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ if (requestObj === null || requestObj === undefined) {
123
+ throw new Error('Required parameter "requestObj" was null or undefined when calling deleteFile.');
124
+ }
125
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/{path}"
126
+ .replace("{" + "path" + "}", String(requestObj.path));
127
+ const queryParameters = {};
128
+ // verify required parameter 'requestObj.path' is not null or undefined
129
+ if (requestObj.path === null || requestObj.path === undefined) {
130
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling deleteFile.');
131
+ }
132
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
133
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "versionId", requestObj.versionId);
134
+ const requestOptions = {
135
+ method: "DELETE",
136
+ params: queryParameters,
137
+ url: localVarPath,
138
+ responseType: "json",
139
+ };
140
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
141
+ return Promise.resolve(response);
142
+ });
143
+ }
144
+ /**
145
+ * Download file
146
+ * @param requestObj contains request parameters
147
+ */
148
+ downloadFile(requestObj) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ if (requestObj === null || requestObj === undefined) {
151
+ throw new Error('Required parameter "requestObj" was null or undefined when calling downloadFile.');
152
+ }
153
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/{path}"
154
+ .replace("{" + "path" + "}", String(requestObj.path));
155
+ const queryParameters = {};
156
+ // verify required parameter 'requestObj.path' is not null or undefined
157
+ if (requestObj.path === null || requestObj.path === undefined) {
158
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling downloadFile.');
159
+ }
160
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
161
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "versionId", requestObj.versionId);
162
+ const requestOptions = {
163
+ method: "GET",
164
+ params: queryParameters,
165
+ url: localVarPath,
166
+ responseType: "arraybuffer",
167
+ responseEncoding: null,
168
+ };
169
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
170
+ const result = serializer_1.Serializer.deserialize(response.data, "Buffer");
171
+ return Promise.resolve(result);
172
+ });
173
+ }
174
+ /**
175
+ * Move file
176
+ * @param requestObj contains request parameters
177
+ */
178
+ moveFile(requestObj) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ if (requestObj === null || requestObj === undefined) {
181
+ throw new Error('Required parameter "requestObj" was null or undefined when calling moveFile.');
182
+ }
183
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/move/{srcPath}"
184
+ .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
185
+ const queryParameters = {};
186
+ // verify required parameter 'requestObj.srcPath' is not null or undefined
187
+ if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
188
+ throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling moveFile.');
189
+ }
190
+ // verify required parameter 'requestObj.destPath' is not null or undefined
191
+ if (requestObj.destPath === null || requestObj.destPath === undefined) {
192
+ throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling moveFile.');
193
+ }
194
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destPath", requestObj.destPath);
195
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
196
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
197
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "versionId", requestObj.versionId);
198
+ const requestOptions = {
199
+ method: "PUT",
200
+ params: queryParameters,
201
+ url: localVarPath,
202
+ responseType: "json",
203
+ };
204
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
205
+ return Promise.resolve(response);
206
+ });
207
+ }
208
+ /**
209
+ * Upload file
210
+ * @param requestObj contains request parameters
211
+ */
212
+ uploadFile(requestObj) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ if (requestObj === null || requestObj === undefined) {
215
+ throw new Error('Required parameter "requestObj" was null or undefined when calling uploadFile.');
216
+ }
217
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/file/{path}"
218
+ .replace("{" + "path" + "}", String(requestObj.path));
219
+ const queryParameters = {};
220
+ const formParams = new FormData();
221
+ // verify required parameter 'requestObj.path' is not null or undefined
222
+ if (requestObj.path === null || requestObj.path === undefined) {
223
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling uploadFile.');
224
+ }
225
+ // verify required parameter 'requestObj.file' is not null or undefined
226
+ if (requestObj.file === null || requestObj.file === undefined) {
227
+ throw new Error('Required parameter "requestObj.file" was null or undefined when calling uploadFile.');
228
+ }
229
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
230
+ if (requestObj.file !== undefined) {
231
+ formParams.append("File", requestObj.file, { filename: "file.name" });
232
+ }
233
+ const requestOptions = {
234
+ method: "PUT",
235
+ params: queryParameters,
236
+ url: localVarPath,
237
+ responseType: "json",
238
+ data: formParams,
239
+ };
240
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
241
+ const result = serializer_1.Serializer.deserialize(response.data, "FilesUploadResult");
242
+ return Promise.resolve(result);
243
+ });
244
+ }
245
+ }
246
+ exports.FileApi = FileApi;
247
+ /**
248
+ * GroupDocs.Parser Cloud API
249
+ */
250
+ class FolderApi {
251
+ /**
252
+ * Creates new instance of FolderApi
253
+ * @param appSid Application identifier (App SID).
254
+ * @param appKey Application private key (App Key).
255
+ */
256
+ static fromKeys(appSid, appKey) {
257
+ const config = new configuration_1.Configuration(appSid, appKey);
258
+ return new FolderApi(config);
259
+ }
260
+ /**
261
+ * Creates new instance of FolderApi
262
+ * @param config API configuration.
263
+ */
264
+ static fromConfig(config) {
265
+ return new FolderApi(config);
266
+ }
267
+ /**
268
+ * @param config Configuration.
269
+ */
270
+ constructor(config) {
271
+ this.configuration = config;
272
+ }
273
+ /**
274
+ * Copy folder
275
+ * @param requestObj contains request parameters
276
+ */
277
+ copyFolder(requestObj) {
278
+ return __awaiter(this, void 0, void 0, function* () {
279
+ if (requestObj === null || requestObj === undefined) {
280
+ throw new Error('Required parameter "requestObj" was null or undefined when calling copyFolder.');
281
+ }
282
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/copy/{srcPath}"
283
+ .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
284
+ const queryParameters = {};
285
+ // verify required parameter 'requestObj.srcPath' is not null or undefined
286
+ if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
287
+ throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling copyFolder.');
288
+ }
289
+ // verify required parameter 'requestObj.destPath' is not null or undefined
290
+ if (requestObj.destPath === null || requestObj.destPath === undefined) {
291
+ throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling copyFolder.');
292
+ }
293
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destPath", requestObj.destPath);
294
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
295
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
296
+ const requestOptions = {
297
+ method: "PUT",
298
+ params: queryParameters,
299
+ url: localVarPath,
300
+ responseType: "json",
301
+ };
302
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
303
+ return Promise.resolve(response);
304
+ });
305
+ }
306
+ /**
307
+ * Create the folder
308
+ * @param requestObj contains request parameters
309
+ */
310
+ createFolder(requestObj) {
311
+ return __awaiter(this, void 0, void 0, function* () {
312
+ if (requestObj === null || requestObj === undefined) {
313
+ throw new Error('Required parameter "requestObj" was null or undefined when calling createFolder.');
314
+ }
315
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/{path}"
316
+ .replace("{" + "path" + "}", String(requestObj.path));
317
+ const queryParameters = {};
318
+ // verify required parameter 'requestObj.path' is not null or undefined
319
+ if (requestObj.path === null || requestObj.path === undefined) {
320
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling createFolder.');
321
+ }
322
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
323
+ const requestOptions = {
324
+ method: "PUT",
325
+ params: queryParameters,
326
+ url: localVarPath,
327
+ responseType: "json",
328
+ };
329
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
330
+ return Promise.resolve(response);
331
+ });
332
+ }
333
+ /**
334
+ * Delete folder
335
+ * @param requestObj contains request parameters
336
+ */
337
+ deleteFolder(requestObj) {
338
+ return __awaiter(this, void 0, void 0, function* () {
339
+ if (requestObj === null || requestObj === undefined) {
340
+ throw new Error('Required parameter "requestObj" was null or undefined when calling deleteFolder.');
341
+ }
342
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/{path}"
343
+ .replace("{" + "path" + "}", String(requestObj.path));
344
+ const queryParameters = {};
345
+ // verify required parameter 'requestObj.path' is not null or undefined
346
+ if (requestObj.path === null || requestObj.path === undefined) {
347
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling deleteFolder.');
348
+ }
349
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
350
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "recursive", requestObj.recursive);
351
+ const requestOptions = {
352
+ method: "DELETE",
353
+ params: queryParameters,
354
+ url: localVarPath,
355
+ responseType: "json",
356
+ };
357
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
358
+ return Promise.resolve(response);
359
+ });
360
+ }
361
+ /**
362
+ * Get all files and folders within a folder
363
+ * @param requestObj contains request parameters
364
+ */
365
+ getFilesList(requestObj) {
366
+ return __awaiter(this, void 0, void 0, function* () {
367
+ if (requestObj === null || requestObj === undefined) {
368
+ throw new Error('Required parameter "requestObj" was null or undefined when calling getFilesList.');
369
+ }
370
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/{path}"
371
+ .replace("{" + "path" + "}", String(requestObj.path));
372
+ const queryParameters = {};
373
+ // verify required parameter 'requestObj.path' is not null or undefined
374
+ if (requestObj.path === null || requestObj.path === undefined) {
375
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling getFilesList.');
376
+ }
377
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
378
+ const requestOptions = {
379
+ method: "GET",
380
+ params: queryParameters,
381
+ url: localVarPath,
382
+ responseType: "json",
383
+ };
384
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
385
+ const result = serializer_1.Serializer.deserialize(response.data, "FilesList");
386
+ return Promise.resolve(result);
387
+ });
388
+ }
389
+ /**
390
+ * Move folder
391
+ * @param requestObj contains request parameters
392
+ */
393
+ moveFolder(requestObj) {
394
+ return __awaiter(this, void 0, void 0, function* () {
395
+ if (requestObj === null || requestObj === undefined) {
396
+ throw new Error('Required parameter "requestObj" was null or undefined when calling moveFolder.');
397
+ }
398
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/folder/move/{srcPath}"
399
+ .replace("{" + "srcPath" + "}", String(requestObj.srcPath));
400
+ const queryParameters = {};
401
+ // verify required parameter 'requestObj.srcPath' is not null or undefined
402
+ if (requestObj.srcPath === null || requestObj.srcPath === undefined) {
403
+ throw new Error('Required parameter "requestObj.srcPath" was null or undefined when calling moveFolder.');
404
+ }
405
+ // verify required parameter 'requestObj.destPath' is not null or undefined
406
+ if (requestObj.destPath === null || requestObj.destPath === undefined) {
407
+ throw new Error('Required parameter "requestObj.destPath" was null or undefined when calling moveFolder.');
408
+ }
409
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destPath", requestObj.destPath);
410
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "srcStorageName", requestObj.srcStorageName);
411
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "destStorageName", requestObj.destStorageName);
412
+ const requestOptions = {
413
+ method: "PUT",
414
+ params: queryParameters,
415
+ url: localVarPath,
416
+ responseType: "json",
417
+ };
418
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
419
+ return Promise.resolve(response);
420
+ });
421
+ }
422
+ }
423
+ exports.FolderApi = FolderApi;
424
+ /**
425
+ * GroupDocs.Parser Cloud API
426
+ */
427
+ class InfoApi {
428
+ /**
429
+ * Creates new instance of InfoApi
430
+ * @param appSid Application identifier (App SID).
431
+ * @param appKey Application private key (App Key).
432
+ */
433
+ static fromKeys(appSid, appKey) {
434
+ const config = new configuration_1.Configuration(appSid, appKey);
435
+ return new InfoApi(config);
436
+ }
437
+ /**
438
+ * Creates new instance of InfoApi
439
+ * @param config API configuration.
440
+ */
441
+ static fromConfig(config) {
442
+ return new InfoApi(config);
443
+ }
444
+ /**
445
+ * @param config Configuration.
446
+ */
447
+ constructor(config) {
448
+ this.configuration = config;
449
+ }
450
+ /**
451
+ * Retrieve a container items (relative paths) from document to work with formats that contain attachments, ZIP archives etc.
452
+ * @param requestObj contains request parameters
453
+ */
454
+ container(requestObj) {
455
+ return __awaiter(this, void 0, void 0, function* () {
456
+ if (requestObj === null || requestObj === undefined) {
457
+ throw new Error('Required parameter "requestObj" was null or undefined when calling container.');
458
+ }
459
+ const localVarPath = this.configuration.getServerUrl() + "/parser/container";
460
+ const queryParameters = {};
461
+ // verify required parameter 'requestObj.options' is not null or undefined
462
+ if (requestObj.options === null || requestObj.options === undefined) {
463
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling container.');
464
+ }
465
+ const requestOptions = {
466
+ method: "POST",
467
+ params: queryParameters,
468
+ url: localVarPath,
469
+ responseType: "json",
470
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "ContainerOptions" : requestObj.options.constructor.name),
471
+ };
472
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
473
+ const result = serializer_1.Serializer.deserialize(response.data, "ContainerResult");
474
+ return Promise.resolve(result);
475
+ });
476
+ }
477
+ /**
478
+ * Retrieve information about document.
479
+ * @param requestObj contains request parameters
480
+ */
481
+ getInfo(requestObj) {
482
+ return __awaiter(this, void 0, void 0, function* () {
483
+ if (requestObj === null || requestObj === undefined) {
484
+ throw new Error('Required parameter "requestObj" was null or undefined when calling getInfo.');
485
+ }
486
+ const localVarPath = this.configuration.getServerUrl() + "/parser/info";
487
+ const queryParameters = {};
488
+ // verify required parameter 'requestObj.options' is not null or undefined
489
+ if (requestObj.options === null || requestObj.options === undefined) {
490
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling getInfo.');
491
+ }
492
+ const requestOptions = {
493
+ method: "POST",
494
+ params: queryParameters,
495
+ url: localVarPath,
496
+ responseType: "json",
497
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "InfoOptions" : requestObj.options.constructor.name),
498
+ };
499
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
500
+ const result = serializer_1.Serializer.deserialize(response.data, "InfoResult");
501
+ return Promise.resolve(result);
502
+ });
503
+ }
504
+ /**
505
+ * List supported file formats.
506
+ * @param requestObj contains request parameters
507
+ */
508
+ getSupportedFileFormats() {
509
+ return __awaiter(this, void 0, void 0, function* () {
510
+ const localVarPath = this.configuration.getServerUrl() + "/parser/formats";
511
+ const queryParameters = {};
512
+ const requestOptions = {
513
+ method: "GET",
514
+ params: queryParameters,
515
+ url: localVarPath,
516
+ responseType: "json",
517
+ };
518
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
519
+ const result = serializer_1.Serializer.deserialize(response.data, "FormatsResult");
520
+ return Promise.resolve(result);
521
+ });
522
+ }
523
+ }
524
+ exports.InfoApi = InfoApi;
525
+ /**
526
+ * GroupDocs.Parser Cloud API
527
+ */
528
+ class ParseApi {
529
+ /**
530
+ * Creates new instance of ParseApi
531
+ * @param appSid Application identifier (App SID).
532
+ * @param appKey Application private key (App Key).
533
+ */
534
+ static fromKeys(appSid, appKey) {
535
+ const config = new configuration_1.Configuration(appSid, appKey);
536
+ return new ParseApi(config);
537
+ }
538
+ /**
539
+ * Creates new instance of ParseApi
540
+ * @param config API configuration.
541
+ */
542
+ static fromConfig(config) {
543
+ return new ParseApi(config);
544
+ }
545
+ /**
546
+ * @param config Configuration.
547
+ */
548
+ constructor(config) {
549
+ this.configuration = config;
550
+ }
551
+ /**
552
+ * Extract document data using AI and given template.
553
+ * @param requestObj contains request parameters
554
+ */
555
+ aIParse(requestObj) {
556
+ return __awaiter(this, void 0, void 0, function* () {
557
+ if (requestObj === null || requestObj === undefined) {
558
+ throw new Error('Required parameter "requestObj" was null or undefined when calling aIParse.');
559
+ }
560
+ const localVarPath = this.configuration.getServerUrl() + "/parser/aiparse";
561
+ const queryParameters = {};
562
+ // verify required parameter 'requestObj.options' is not null or undefined
563
+ if (requestObj.options === null || requestObj.options === undefined) {
564
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling aIParse.');
565
+ }
566
+ const requestOptions = {
567
+ method: "POST",
568
+ params: queryParameters,
569
+ url: localVarPath,
570
+ responseType: "json",
571
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "AIParseOptions" : requestObj.options.constructor.name),
572
+ };
573
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
574
+ const result = serializer_1.Serializer.deserialize(response.data, "any");
575
+ return Promise.resolve(result);
576
+ });
577
+ }
578
+ /**
579
+ * Extract barcodes from document.
580
+ * @param requestObj contains request parameters
581
+ */
582
+ barcodes(requestObj) {
583
+ return __awaiter(this, void 0, void 0, function* () {
584
+ if (requestObj === null || requestObj === undefined) {
585
+ throw new Error('Required parameter "requestObj" was null or undefined when calling barcodes.');
586
+ }
587
+ const localVarPath = this.configuration.getServerUrl() + "/parser/barcodes";
588
+ const queryParameters = {};
589
+ // verify required parameter 'requestObj.options' is not null or undefined
590
+ if (requestObj.options === null || requestObj.options === undefined) {
591
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling barcodes.');
592
+ }
593
+ const requestOptions = {
594
+ method: "POST",
595
+ params: queryParameters,
596
+ url: localVarPath,
597
+ responseType: "json",
598
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "BarcodesOptions" : requestObj.options.constructor.name),
599
+ };
600
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
601
+ const result = serializer_1.Serializer.deserialize(response.data, "BarcodesResult");
602
+ return Promise.resolve(result);
603
+ });
604
+ }
605
+ /**
606
+ * Extract images from document.
607
+ * @param requestObj contains request parameters
608
+ */
609
+ images(requestObj) {
610
+ return __awaiter(this, void 0, void 0, function* () {
611
+ if (requestObj === null || requestObj === undefined) {
612
+ throw new Error('Required parameter "requestObj" was null or undefined when calling images.');
613
+ }
614
+ const localVarPath = this.configuration.getServerUrl() + "/parser/images";
615
+ const queryParameters = {};
616
+ // verify required parameter 'requestObj.options' is not null or undefined
617
+ if (requestObj.options === null || requestObj.options === undefined) {
618
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling images.');
619
+ }
620
+ const requestOptions = {
621
+ method: "POST",
622
+ params: queryParameters,
623
+ url: localVarPath,
624
+ responseType: "json",
625
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "ImagesOptions" : requestObj.options.constructor.name),
626
+ };
627
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
628
+ const result = serializer_1.Serializer.deserialize(response.data, "ImagesResult");
629
+ return Promise.resolve(result);
630
+ });
631
+ }
632
+ /**
633
+ * Extract document data by a predefined template.
634
+ * @param requestObj contains request parameters
635
+ */
636
+ parse(requestObj) {
637
+ return __awaiter(this, void 0, void 0, function* () {
638
+ if (requestObj === null || requestObj === undefined) {
639
+ throw new Error('Required parameter "requestObj" was null or undefined when calling parse.');
640
+ }
641
+ const localVarPath = this.configuration.getServerUrl() + "/parser/parse";
642
+ const queryParameters = {};
643
+ // verify required parameter 'requestObj.options' is not null or undefined
644
+ if (requestObj.options === null || requestObj.options === undefined) {
645
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling parse.');
646
+ }
647
+ const requestOptions = {
648
+ method: "POST",
649
+ params: queryParameters,
650
+ url: localVarPath,
651
+ responseType: "json",
652
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "ParseOptions" : requestObj.options.constructor.name),
653
+ };
654
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
655
+ const result = serializer_1.Serializer.deserialize(response.data, "ParseResult");
656
+ return Promise.resolve(result);
657
+ });
658
+ }
659
+ /**
660
+ * Extract text from document.
661
+ * @param requestObj contains request parameters
662
+ */
663
+ text(requestObj) {
664
+ return __awaiter(this, void 0, void 0, function* () {
665
+ if (requestObj === null || requestObj === undefined) {
666
+ throw new Error('Required parameter "requestObj" was null or undefined when calling text.');
667
+ }
668
+ const localVarPath = this.configuration.getServerUrl() + "/parser/text";
669
+ const queryParameters = {};
670
+ // verify required parameter 'requestObj.options' is not null or undefined
671
+ if (requestObj.options === null || requestObj.options === undefined) {
672
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling text.');
673
+ }
674
+ const requestOptions = {
675
+ method: "POST",
676
+ params: queryParameters,
677
+ url: localVarPath,
678
+ responseType: "json",
679
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "TextOptions" : requestObj.options.constructor.name),
680
+ };
681
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
682
+ const result = serializer_1.Serializer.deserialize(response.data, "TextResult");
683
+ return Promise.resolve(result);
684
+ });
685
+ }
686
+ }
687
+ exports.ParseApi = ParseApi;
688
+ /**
689
+ * GroupDocs.Parser Cloud API
690
+ */
691
+ class StorageApi {
692
+ /**
693
+ * Creates new instance of StorageApi
694
+ * @param appSid Application identifier (App SID).
695
+ * @param appKey Application private key (App Key).
696
+ */
697
+ static fromKeys(appSid, appKey) {
698
+ const config = new configuration_1.Configuration(appSid, appKey);
699
+ return new StorageApi(config);
700
+ }
701
+ /**
702
+ * Creates new instance of StorageApi
703
+ * @param config API configuration.
704
+ */
705
+ static fromConfig(config) {
706
+ return new StorageApi(config);
707
+ }
708
+ /**
709
+ * @param config Configuration.
710
+ */
711
+ constructor(config) {
712
+ this.configuration = config;
713
+ }
714
+ /**
715
+ * Get disc usage
716
+ * @param requestObj contains request parameters
717
+ */
718
+ getDiscUsage(requestObj) {
719
+ return __awaiter(this, void 0, void 0, function* () {
720
+ if (requestObj === null || requestObj === undefined) {
721
+ throw new Error('Required parameter "requestObj" was null or undefined when calling getDiscUsage.');
722
+ }
723
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/disc";
724
+ const queryParameters = {};
725
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
726
+ const requestOptions = {
727
+ method: "GET",
728
+ params: queryParameters,
729
+ url: localVarPath,
730
+ responseType: "json",
731
+ };
732
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
733
+ const result = serializer_1.Serializer.deserialize(response.data, "DiscUsage");
734
+ return Promise.resolve(result);
735
+ });
736
+ }
737
+ /**
738
+ * Get file versions
739
+ * @param requestObj contains request parameters
740
+ */
741
+ getFileVersions(requestObj) {
742
+ return __awaiter(this, void 0, void 0, function* () {
743
+ if (requestObj === null || requestObj === undefined) {
744
+ throw new Error('Required parameter "requestObj" was null or undefined when calling getFileVersions.');
745
+ }
746
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/version/{path}"
747
+ .replace("{" + "path" + "}", String(requestObj.path));
748
+ const queryParameters = {};
749
+ // verify required parameter 'requestObj.path' is not null or undefined
750
+ if (requestObj.path === null || requestObj.path === undefined) {
751
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling getFileVersions.');
752
+ }
753
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
754
+ const requestOptions = {
755
+ method: "GET",
756
+ params: queryParameters,
757
+ url: localVarPath,
758
+ responseType: "json",
759
+ };
760
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
761
+ const result = serializer_1.Serializer.deserialize(response.data, "FileVersions");
762
+ return Promise.resolve(result);
763
+ });
764
+ }
765
+ /**
766
+ * Check if file or folder exists
767
+ * @param requestObj contains request parameters
768
+ */
769
+ objectExists(requestObj) {
770
+ return __awaiter(this, void 0, void 0, function* () {
771
+ if (requestObj === null || requestObj === undefined) {
772
+ throw new Error('Required parameter "requestObj" was null or undefined when calling objectExists.');
773
+ }
774
+ let localVarPath = this.configuration.getServerUrl() + "/parser/storage/exist/{path}"
775
+ .replace("{" + "path" + "}", String(requestObj.path));
776
+ const queryParameters = {};
777
+ // verify required parameter 'requestObj.path' is not null or undefined
778
+ if (requestObj.path === null || requestObj.path === undefined) {
779
+ throw new Error('Required parameter "requestObj.path" was null or undefined when calling objectExists.');
780
+ }
781
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "storageName", requestObj.storageName);
782
+ localVarPath = (0, api_client_1.addQueryParameterToUrl)(localVarPath, queryParameters, "versionId", requestObj.versionId);
783
+ const requestOptions = {
784
+ method: "GET",
785
+ params: queryParameters,
786
+ url: localVarPath,
787
+ responseType: "json",
788
+ };
789
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
790
+ const result = serializer_1.Serializer.deserialize(response.data, "ObjectExist");
791
+ return Promise.resolve(result);
792
+ });
793
+ }
794
+ /**
795
+ * Check if storage exists
796
+ * @param requestObj contains request parameters
797
+ */
798
+ storageExists(requestObj) {
799
+ return __awaiter(this, void 0, void 0, function* () {
800
+ if (requestObj === null || requestObj === undefined) {
801
+ throw new Error('Required parameter "requestObj" was null or undefined when calling storageExists.');
802
+ }
803
+ const localVarPath = this.configuration.getServerUrl() + "/parser/storage/{storageName}/exist"
804
+ .replace("{" + "storageName" + "}", String(requestObj.storageName));
805
+ const queryParameters = {};
806
+ // verify required parameter 'requestObj.storageName' is not null or undefined
807
+ if (requestObj.storageName === null || requestObj.storageName === undefined) {
808
+ throw new Error('Required parameter "requestObj.storageName" was null or undefined when calling storageExists.');
809
+ }
810
+ const requestOptions = {
811
+ method: "GET",
812
+ params: queryParameters,
813
+ url: localVarPath,
814
+ responseType: "json",
815
+ };
816
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
817
+ const result = serializer_1.Serializer.deserialize(response.data, "StorageExist");
818
+ return Promise.resolve(result);
819
+ });
820
+ }
821
+ }
822
+ exports.StorageApi = StorageApi;
823
+ /**
824
+ * GroupDocs.Parser Cloud API
825
+ */
826
+ class TemplateApi {
827
+ /**
828
+ * Creates new instance of TemplateApi
829
+ * @param appSid Application identifier (App SID).
830
+ * @param appKey Application private key (App Key).
831
+ */
832
+ static fromKeys(appSid, appKey) {
833
+ const config = new configuration_1.Configuration(appSid, appKey);
834
+ return new TemplateApi(config);
835
+ }
836
+ /**
837
+ * Creates new instance of TemplateApi
838
+ * @param config API configuration.
839
+ */
840
+ static fromConfig(config) {
841
+ return new TemplateApi(config);
842
+ }
843
+ /**
844
+ * @param config Configuration.
845
+ */
846
+ constructor(config) {
847
+ this.configuration = config;
848
+ }
849
+ /**
850
+ * Create or update document template.
851
+ * @param requestObj contains request parameters
852
+ */
853
+ createTemplate(requestObj) {
854
+ return __awaiter(this, void 0, void 0, function* () {
855
+ if (requestObj === null || requestObj === undefined) {
856
+ throw new Error('Required parameter "requestObj" was null or undefined when calling createTemplate.');
857
+ }
858
+ const localVarPath = this.configuration.getServerUrl() + "/parser/template";
859
+ const queryParameters = {};
860
+ // verify required parameter 'requestObj.options' is not null or undefined
861
+ if (requestObj.options === null || requestObj.options === undefined) {
862
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling createTemplate.');
863
+ }
864
+ const requestOptions = {
865
+ method: "PUT",
866
+ params: queryParameters,
867
+ url: localVarPath,
868
+ responseType: "json",
869
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "CreateTemplateOptions" : requestObj.options.constructor.name),
870
+ };
871
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
872
+ const result = serializer_1.Serializer.deserialize(response.data, "TemplateResult");
873
+ return Promise.resolve(result);
874
+ });
875
+ }
876
+ /**
877
+ * Delete document template.
878
+ * @param requestObj contains request parameters
879
+ */
880
+ deleteTemplate(requestObj) {
881
+ return __awaiter(this, void 0, void 0, function* () {
882
+ if (requestObj === null || requestObj === undefined) {
883
+ throw new Error('Required parameter "requestObj" was null or undefined when calling deleteTemplate.');
884
+ }
885
+ const localVarPath = this.configuration.getServerUrl() + "/parser/template";
886
+ const queryParameters = {};
887
+ // verify required parameter 'requestObj.options' is not null or undefined
888
+ if (requestObj.options === null || requestObj.options === undefined) {
889
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling deleteTemplate.');
890
+ }
891
+ const requestOptions = {
892
+ method: "DELETE",
893
+ params: queryParameters,
894
+ url: localVarPath,
895
+ responseType: "json",
896
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "TemplateOptions" : requestObj.options.constructor.name),
897
+ };
898
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
899
+ return Promise.resolve(response);
900
+ });
901
+ }
902
+ /**
903
+ * Retrieve document template.
904
+ * @param requestObj contains request parameters
905
+ */
906
+ getTemplate(requestObj) {
907
+ return __awaiter(this, void 0, void 0, function* () {
908
+ if (requestObj === null || requestObj === undefined) {
909
+ throw new Error('Required parameter "requestObj" was null or undefined when calling getTemplate.');
910
+ }
911
+ const localVarPath = this.configuration.getServerUrl() + "/parser/template";
912
+ const queryParameters = {};
913
+ // verify required parameter 'requestObj.options' is not null or undefined
914
+ if (requestObj.options === null || requestObj.options === undefined) {
915
+ throw new Error('Required parameter "requestObj.options" was null or undefined when calling getTemplate.');
916
+ }
917
+ const requestOptions = {
918
+ method: "POST",
919
+ params: queryParameters,
920
+ url: localVarPath,
921
+ responseType: "json",
922
+ data: serializer_1.Serializer.serialize(requestObj.options, requestObj.options.constructor.name === "Object" ? "TemplateOptions" : requestObj.options.constructor.name),
923
+ };
924
+ const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, this.configuration);
925
+ const result = serializer_1.Serializer.deserialize(response.data, "Template");
926
+ return Promise.resolve(result);
927
+ });
928
+ }
929
+ }
930
+ exports.TemplateApi = TemplateApi;