@emilgroup/document-sdk-node 1.22.1-beta.2 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/api/documents-api.ts +10 -26
- package/api/product-documents-api.ts +14 -30
- package/dist/api/documents-api.d.ts +7 -16
- package/dist/api/documents-api.js +9 -17
- package/dist/api/product-documents-api.d.ts +11 -20
- package/dist/api/product-documents-api.js +12 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/document-sdk-node@1.
|
|
20
|
+
npm install @emilgroup/document-sdk-node@1.23.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/document-sdk-node@1.
|
|
24
|
+
yarn add @emilgroup/document-sdk-node@1.23.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `DocumentsApi`.
|
|
@@ -47,6 +47,22 @@ export EMIL_USERNAME=XXXXX@XXXX.XXX
|
|
|
47
47
|
export EMIL_PASSWORD=XXXXXXXXXXXXXX
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
## Base path
|
|
51
|
+
|
|
52
|
+
To select the basic path for using the API, we can use two approaches. The first is to use one of the predefined environments, and the second is to specify the domain as a string.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { DocumentsApi, Environment } from '@emilgroup/document-sdk-node'
|
|
56
|
+
|
|
57
|
+
const documentsApi = new DocumentsApi();
|
|
58
|
+
|
|
59
|
+
// Allows you to simply choose environment. It will usually be Environment.Production.
|
|
60
|
+
documentsApi.selectEnvironment(Environment.Production);
|
|
61
|
+
|
|
62
|
+
// For advanced users, use the custom baseUrl of the website you need to connect to.
|
|
63
|
+
documentsApi.selectBasePath('https://my-custom-domain.com');
|
|
64
|
+
```
|
|
65
|
+
|
|
50
66
|
## Example
|
|
51
67
|
|
|
52
68
|
Here is a basic functionning example:
|
package/api/documents-api.ts
CHANGED
|
@@ -178,17 +178,14 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
178
178
|
/**
|
|
179
179
|
* This will return a presigned URL to download the document.
|
|
180
180
|
* @summary Fetches a document download URL
|
|
181
|
-
* @param {string} code
|
|
182
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
181
|
+
* @param {string} code
|
|
183
182
|
* @param {string} [authorization] Bearer Token
|
|
184
183
|
* @param {*} [options] Override http request option.
|
|
185
184
|
* @throws {RequiredError}
|
|
186
185
|
*/
|
|
187
|
-
getDocumentDownloadUrl: async (code: string,
|
|
186
|
+
getDocumentDownloadUrl: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
188
187
|
// verify required parameter 'code' is not null or undefined
|
|
189
188
|
assertParamExists('getDocumentDownloadUrl', 'code', code)
|
|
190
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
191
|
-
assertParamExists('getDocumentDownloadUrl', 'contentDisposition', contentDisposition)
|
|
192
189
|
const localVarPath = `/documentservice/v1/documents/{code}/download-url`
|
|
193
190
|
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
194
191
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
@@ -208,10 +205,6 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
208
205
|
// http bearer authentication required
|
|
209
206
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
210
207
|
|
|
211
|
-
if (contentDisposition !== undefined) {
|
|
212
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
208
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
216
209
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
217
210
|
}
|
|
@@ -451,14 +444,13 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
|
|
451
444
|
/**
|
|
452
445
|
* This will return a presigned URL to download the document.
|
|
453
446
|
* @summary Fetches a document download URL
|
|
454
|
-
* @param {string} code
|
|
455
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
447
|
+
* @param {string} code
|
|
456
448
|
* @param {string} [authorization] Bearer Token
|
|
457
449
|
* @param {*} [options] Override http request option.
|
|
458
450
|
* @throws {RequiredError}
|
|
459
451
|
*/
|
|
460
|
-
async getDocumentDownloadUrl(code: string,
|
|
461
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.getDocumentDownloadUrl(code,
|
|
452
|
+
async getDocumentDownloadUrl(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
453
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getDocumentDownloadUrl(code, authorization, options);
|
|
462
454
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
463
455
|
},
|
|
464
456
|
/**
|
|
@@ -550,14 +542,13 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
|
|
550
542
|
/**
|
|
551
543
|
* This will return a presigned URL to download the document.
|
|
552
544
|
* @summary Fetches a document download URL
|
|
553
|
-
* @param {string} code
|
|
554
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
545
|
+
* @param {string} code
|
|
555
546
|
* @param {string} [authorization] Bearer Token
|
|
556
547
|
* @param {*} [options] Override http request option.
|
|
557
548
|
* @throws {RequiredError}
|
|
558
549
|
*/
|
|
559
|
-
getDocumentDownloadUrl(code: string,
|
|
560
|
-
return localVarFp.getDocumentDownloadUrl(code,
|
|
550
|
+
getDocumentDownloadUrl(code: string, authorization?: string, options?: any): AxiosPromise<void> {
|
|
551
|
+
return localVarFp.getDocumentDownloadUrl(code, authorization, options).then((request) => request(axios, basePath));
|
|
561
552
|
},
|
|
562
553
|
/**
|
|
563
554
|
* This will return a presigned URL for a random S3 key
|
|
@@ -672,19 +663,12 @@ export interface DocumentsApiDeleteDocumentRequest {
|
|
|
672
663
|
*/
|
|
673
664
|
export interface DocumentsApiGetDocumentDownloadUrlRequest {
|
|
674
665
|
/**
|
|
675
|
-
*
|
|
666
|
+
*
|
|
676
667
|
* @type {string}
|
|
677
668
|
* @memberof DocumentsApiGetDocumentDownloadUrl
|
|
678
669
|
*/
|
|
679
670
|
readonly code: string
|
|
680
671
|
|
|
681
|
-
/**
|
|
682
|
-
* Content disposition override. Default will be depending on the document type.
|
|
683
|
-
* @type {'attachment' | 'inline'}
|
|
684
|
-
* @memberof DocumentsApiGetDocumentDownloadUrl
|
|
685
|
-
*/
|
|
686
|
-
readonly contentDisposition: 'attachment' | 'inline'
|
|
687
|
-
|
|
688
672
|
/**
|
|
689
673
|
* Bearer Token
|
|
690
674
|
* @type {string}
|
|
@@ -857,7 +841,7 @@ export class DocumentsApi extends BaseAPI {
|
|
|
857
841
|
* @memberof DocumentsApi
|
|
858
842
|
*/
|
|
859
843
|
public getDocumentDownloadUrl(requestParameters: DocumentsApiGetDocumentDownloadUrlRequest, options?: AxiosRequestConfig) {
|
|
860
|
-
return DocumentsApiFp(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.
|
|
844
|
+
return DocumentsApiFp(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
861
845
|
}
|
|
862
846
|
|
|
863
847
|
/**
|
|
@@ -84,20 +84,17 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
|
|
|
84
84
|
/**
|
|
85
85
|
* Get a pre-signed download url for the given product document.
|
|
86
86
|
* @summary Get pre-signed url for downloading product document
|
|
87
|
-
* @param {string} productSlug
|
|
88
|
-
* @param {string} code
|
|
89
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
87
|
+
* @param {string} productSlug
|
|
88
|
+
* @param {string} code
|
|
90
89
|
* @param {string} [authorization] Bearer Token
|
|
91
90
|
* @param {*} [options] Override http request option.
|
|
92
91
|
* @throws {RequiredError}
|
|
93
92
|
*/
|
|
94
|
-
downloadProductDocument: async (productSlug: string, code: string,
|
|
93
|
+
downloadProductDocument: async (productSlug: string, code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
95
94
|
// verify required parameter 'productSlug' is not null or undefined
|
|
96
95
|
assertParamExists('downloadProductDocument', 'productSlug', productSlug)
|
|
97
96
|
// verify required parameter 'code' is not null or undefined
|
|
98
97
|
assertParamExists('downloadProductDocument', 'code', code)
|
|
99
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
100
|
-
assertParamExists('downloadProductDocument', 'contentDisposition', contentDisposition)
|
|
101
98
|
const localVarPath = `/documentservice/v1/product-documents/{productSlug}/{code}/download-url`
|
|
102
99
|
.replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)))
|
|
103
100
|
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
@@ -118,10 +115,6 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
|
|
|
118
115
|
// http bearer authentication required
|
|
119
116
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
120
117
|
|
|
121
|
-
if (contentDisposition !== undefined) {
|
|
122
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
118
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
126
119
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
127
120
|
}
|
|
@@ -343,15 +336,14 @@ export const ProductDocumentsApiFp = function(configuration?: Configuration) {
|
|
|
343
336
|
/**
|
|
344
337
|
* Get a pre-signed download url for the given product document.
|
|
345
338
|
* @summary Get pre-signed url for downloading product document
|
|
346
|
-
* @param {string} productSlug
|
|
347
|
-
* @param {string} code
|
|
348
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
339
|
+
* @param {string} productSlug
|
|
340
|
+
* @param {string} code
|
|
349
341
|
* @param {string} [authorization] Bearer Token
|
|
350
342
|
* @param {*} [options] Override http request option.
|
|
351
343
|
* @throws {RequiredError}
|
|
352
344
|
*/
|
|
353
|
-
async downloadProductDocument(productSlug: string, code: string,
|
|
354
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocument(productSlug, code,
|
|
345
|
+
async downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
346
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocument(productSlug, code, authorization, options);
|
|
355
347
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
356
348
|
},
|
|
357
349
|
/**
|
|
@@ -424,15 +416,14 @@ export const ProductDocumentsApiFactory = function (configuration?: Configuratio
|
|
|
424
416
|
/**
|
|
425
417
|
* Get a pre-signed download url for the given product document.
|
|
426
418
|
* @summary Get pre-signed url for downloading product document
|
|
427
|
-
* @param {string} productSlug
|
|
428
|
-
* @param {string} code
|
|
429
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
419
|
+
* @param {string} productSlug
|
|
420
|
+
* @param {string} code
|
|
430
421
|
* @param {string} [authorization] Bearer Token
|
|
431
422
|
* @param {*} [options] Override http request option.
|
|
432
423
|
* @throws {RequiredError}
|
|
433
424
|
*/
|
|
434
|
-
downloadProductDocument(productSlug: string, code: string,
|
|
435
|
-
return localVarFp.downloadProductDocument(productSlug, code,
|
|
425
|
+
downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: any): AxiosPromise<void> {
|
|
426
|
+
return localVarFp.downloadProductDocument(productSlug, code, authorization, options).then((request) => request(axios, basePath));
|
|
436
427
|
},
|
|
437
428
|
/**
|
|
438
429
|
* Get a product document.
|
|
@@ -514,26 +505,19 @@ export interface ProductDocumentsApiDeleteProductDocumentRequest {
|
|
|
514
505
|
*/
|
|
515
506
|
export interface ProductDocumentsApiDownloadProductDocumentRequest {
|
|
516
507
|
/**
|
|
517
|
-
*
|
|
508
|
+
*
|
|
518
509
|
* @type {string}
|
|
519
510
|
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
520
511
|
*/
|
|
521
512
|
readonly productSlug: string
|
|
522
513
|
|
|
523
514
|
/**
|
|
524
|
-
*
|
|
515
|
+
*
|
|
525
516
|
* @type {string}
|
|
526
517
|
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
527
518
|
*/
|
|
528
519
|
readonly code: string
|
|
529
520
|
|
|
530
|
-
/**
|
|
531
|
-
* Content disposition override. Default will be depending on the document type.
|
|
532
|
-
* @type {'attachment' | 'inline'}
|
|
533
|
-
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
534
|
-
*/
|
|
535
|
-
readonly contentDisposition: 'attachment' | 'inline'
|
|
536
|
-
|
|
537
521
|
/**
|
|
538
522
|
* Bearer Token
|
|
539
523
|
* @type {string}
|
|
@@ -696,7 +680,7 @@ export class ProductDocumentsApi extends BaseAPI {
|
|
|
696
680
|
* @memberof ProductDocumentsApi
|
|
697
681
|
*/
|
|
698
682
|
public downloadProductDocument(requestParameters: ProductDocumentsApiDownloadProductDocumentRequest, options?: AxiosRequestConfig) {
|
|
699
|
-
return ProductDocumentsApiFp(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.
|
|
683
|
+
return ProductDocumentsApiFp(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
700
684
|
}
|
|
701
685
|
|
|
702
686
|
/**
|
|
@@ -50,13 +50,12 @@ export declare const DocumentsApiAxiosParamCreator: (configuration?: Configurati
|
|
|
50
50
|
/**
|
|
51
51
|
* This will return a presigned URL to download the document.
|
|
52
52
|
* @summary Fetches a document download URL
|
|
53
|
-
* @param {string} code
|
|
54
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
53
|
+
* @param {string} code
|
|
55
54
|
* @param {string} [authorization] Bearer Token
|
|
56
55
|
* @param {*} [options] Override http request option.
|
|
57
56
|
* @throws {RequiredError}
|
|
58
57
|
*/
|
|
59
|
-
getDocumentDownloadUrl: (code: string,
|
|
58
|
+
getDocumentDownloadUrl: (code: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
60
59
|
/**
|
|
61
60
|
* This will return a presigned URL for a random S3 key
|
|
62
61
|
* @summary Fetches a presigned URL for a S3 key
|
|
@@ -127,13 +126,12 @@ export declare const DocumentsApiFp: (configuration?: Configuration) => {
|
|
|
127
126
|
/**
|
|
128
127
|
* This will return a presigned URL to download the document.
|
|
129
128
|
* @summary Fetches a document download URL
|
|
130
|
-
* @param {string} code
|
|
131
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
129
|
+
* @param {string} code
|
|
132
130
|
* @param {string} [authorization] Bearer Token
|
|
133
131
|
* @param {*} [options] Override http request option.
|
|
134
132
|
* @throws {RequiredError}
|
|
135
133
|
*/
|
|
136
|
-
getDocumentDownloadUrl(code: string,
|
|
134
|
+
getDocumentDownloadUrl(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
137
135
|
/**
|
|
138
136
|
* This will return a presigned URL for a random S3 key
|
|
139
137
|
* @summary Fetches a presigned URL for a S3 key
|
|
@@ -204,13 +202,12 @@ export declare const DocumentsApiFactory: (configuration?: Configuration, basePa
|
|
|
204
202
|
/**
|
|
205
203
|
* This will return a presigned URL to download the document.
|
|
206
204
|
* @summary Fetches a document download URL
|
|
207
|
-
* @param {string} code
|
|
208
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
205
|
+
* @param {string} code
|
|
209
206
|
* @param {string} [authorization] Bearer Token
|
|
210
207
|
* @param {*} [options] Override http request option.
|
|
211
208
|
* @throws {RequiredError}
|
|
212
209
|
*/
|
|
213
|
-
getDocumentDownloadUrl(code: string,
|
|
210
|
+
getDocumentDownloadUrl(code: string, authorization?: string, options?: any): AxiosPromise<void>;
|
|
214
211
|
/**
|
|
215
212
|
* This will return a presigned URL for a random S3 key
|
|
216
213
|
* @summary Fetches a presigned URL for a S3 key
|
|
@@ -310,17 +307,11 @@ export interface DocumentsApiDeleteDocumentRequest {
|
|
|
310
307
|
*/
|
|
311
308
|
export interface DocumentsApiGetDocumentDownloadUrlRequest {
|
|
312
309
|
/**
|
|
313
|
-
*
|
|
310
|
+
*
|
|
314
311
|
* @type {string}
|
|
315
312
|
* @memberof DocumentsApiGetDocumentDownloadUrl
|
|
316
313
|
*/
|
|
317
314
|
readonly code: string;
|
|
318
|
-
/**
|
|
319
|
-
* Content disposition override. Default will be depending on the document type.
|
|
320
|
-
* @type {'attachment' | 'inline'}
|
|
321
|
-
* @memberof DocumentsApiGetDocumentDownloadUrl
|
|
322
|
-
*/
|
|
323
|
-
readonly contentDisposition: 'attachment' | 'inline';
|
|
324
315
|
/**
|
|
325
316
|
* Bearer Token
|
|
326
317
|
* @type {string}
|
|
@@ -245,13 +245,12 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
245
245
|
/**
|
|
246
246
|
* This will return a presigned URL to download the document.
|
|
247
247
|
* @summary Fetches a document download URL
|
|
248
|
-
* @param {string} code
|
|
249
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
248
|
+
* @param {string} code
|
|
250
249
|
* @param {string} [authorization] Bearer Token
|
|
251
250
|
* @param {*} [options] Override http request option.
|
|
252
251
|
* @throws {RequiredError}
|
|
253
252
|
*/
|
|
254
|
-
getDocumentDownloadUrl: function (code,
|
|
253
|
+
getDocumentDownloadUrl: function (code, authorization, options) {
|
|
255
254
|
if (options === void 0) { options = {}; }
|
|
256
255
|
return __awaiter(_this, void 0, void 0, function () {
|
|
257
256
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -260,8 +259,6 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
260
259
|
case 0:
|
|
261
260
|
// verify required parameter 'code' is not null or undefined
|
|
262
261
|
(0, common_1.assertParamExists)('getDocumentDownloadUrl', 'code', code);
|
|
263
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
264
|
-
(0, common_1.assertParamExists)('getDocumentDownloadUrl', 'contentDisposition', contentDisposition);
|
|
265
262
|
localVarPath = "/documentservice/v1/documents/{code}/download-url"
|
|
266
263
|
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
267
264
|
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -279,9 +276,6 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
279
276
|
// authentication bearer required
|
|
280
277
|
// http bearer authentication required
|
|
281
278
|
_a.sent();
|
|
282
|
-
if (contentDisposition !== undefined) {
|
|
283
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
284
|
-
}
|
|
285
279
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
286
280
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
287
281
|
}
|
|
@@ -547,18 +541,17 @@ var DocumentsApiFp = function (configuration) {
|
|
|
547
541
|
/**
|
|
548
542
|
* This will return a presigned URL to download the document.
|
|
549
543
|
* @summary Fetches a document download URL
|
|
550
|
-
* @param {string} code
|
|
551
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
544
|
+
* @param {string} code
|
|
552
545
|
* @param {string} [authorization] Bearer Token
|
|
553
546
|
* @param {*} [options] Override http request option.
|
|
554
547
|
* @throws {RequiredError}
|
|
555
548
|
*/
|
|
556
|
-
getDocumentDownloadUrl: function (code,
|
|
549
|
+
getDocumentDownloadUrl: function (code, authorization, options) {
|
|
557
550
|
return __awaiter(this, void 0, void 0, function () {
|
|
558
551
|
var localVarAxiosArgs;
|
|
559
552
|
return __generator(this, function (_a) {
|
|
560
553
|
switch (_a.label) {
|
|
561
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getDocumentDownloadUrl(code,
|
|
554
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getDocumentDownloadUrl(code, authorization, options)];
|
|
562
555
|
case 1:
|
|
563
556
|
localVarAxiosArgs = _a.sent();
|
|
564
557
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -682,14 +675,13 @@ var DocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
682
675
|
/**
|
|
683
676
|
* This will return a presigned URL to download the document.
|
|
684
677
|
* @summary Fetches a document download URL
|
|
685
|
-
* @param {string} code
|
|
686
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
678
|
+
* @param {string} code
|
|
687
679
|
* @param {string} [authorization] Bearer Token
|
|
688
680
|
* @param {*} [options] Override http request option.
|
|
689
681
|
* @throws {RequiredError}
|
|
690
682
|
*/
|
|
691
|
-
getDocumentDownloadUrl: function (code,
|
|
692
|
-
return localVarFp.getDocumentDownloadUrl(code,
|
|
683
|
+
getDocumentDownloadUrl: function (code, authorization, options) {
|
|
684
|
+
return localVarFp.getDocumentDownloadUrl(code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
693
685
|
},
|
|
694
686
|
/**
|
|
695
687
|
* This will return a presigned URL for a random S3 key
|
|
@@ -791,7 +783,7 @@ var DocumentsApi = /** @class */ (function (_super) {
|
|
|
791
783
|
*/
|
|
792
784
|
DocumentsApi.prototype.getDocumentDownloadUrl = function (requestParameters, options) {
|
|
793
785
|
var _this = this;
|
|
794
|
-
return (0, exports.DocumentsApiFp)(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.
|
|
786
|
+
return (0, exports.DocumentsApiFp)(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
795
787
|
};
|
|
796
788
|
/**
|
|
797
789
|
* This will return a presigned URL for a random S3 key
|
|
@@ -31,14 +31,13 @@ export declare const ProductDocumentsApiAxiosParamCreator: (configuration?: Conf
|
|
|
31
31
|
/**
|
|
32
32
|
* Get a pre-signed download url for the given product document.
|
|
33
33
|
* @summary Get pre-signed url for downloading product document
|
|
34
|
-
* @param {string} productSlug
|
|
35
|
-
* @param {string} code
|
|
36
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
34
|
+
* @param {string} productSlug
|
|
35
|
+
* @param {string} code
|
|
37
36
|
* @param {string} [authorization] Bearer Token
|
|
38
37
|
* @param {*} [options] Override http request option.
|
|
39
38
|
* @throws {RequiredError}
|
|
40
39
|
*/
|
|
41
|
-
downloadProductDocument: (productSlug: string, code: string,
|
|
40
|
+
downloadProductDocument: (productSlug: string, code: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
42
41
|
/**
|
|
43
42
|
* Get a product document.
|
|
44
43
|
* @summary Retrieve the product document
|
|
@@ -94,14 +93,13 @@ export declare const ProductDocumentsApiFp: (configuration?: Configuration) => {
|
|
|
94
93
|
/**
|
|
95
94
|
* Get a pre-signed download url for the given product document.
|
|
96
95
|
* @summary Get pre-signed url for downloading product document
|
|
97
|
-
* @param {string} productSlug
|
|
98
|
-
* @param {string} code
|
|
99
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
96
|
+
* @param {string} productSlug
|
|
97
|
+
* @param {string} code
|
|
100
98
|
* @param {string} [authorization] Bearer Token
|
|
101
99
|
* @param {*} [options] Override http request option.
|
|
102
100
|
* @throws {RequiredError}
|
|
103
101
|
*/
|
|
104
|
-
downloadProductDocument(productSlug: string, code: string,
|
|
102
|
+
downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
105
103
|
/**
|
|
106
104
|
* Get a product document.
|
|
107
105
|
* @summary Retrieve the product document
|
|
@@ -157,14 +155,13 @@ export declare const ProductDocumentsApiFactory: (configuration?: Configuration,
|
|
|
157
155
|
/**
|
|
158
156
|
* Get a pre-signed download url for the given product document.
|
|
159
157
|
* @summary Get pre-signed url for downloading product document
|
|
160
|
-
* @param {string} productSlug
|
|
161
|
-
* @param {string} code
|
|
162
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
158
|
+
* @param {string} productSlug
|
|
159
|
+
* @param {string} code
|
|
163
160
|
* @param {string} [authorization] Bearer Token
|
|
164
161
|
* @param {*} [options] Override http request option.
|
|
165
162
|
* @throws {RequiredError}
|
|
166
163
|
*/
|
|
167
|
-
downloadProductDocument(productSlug: string, code: string,
|
|
164
|
+
downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: any): AxiosPromise<void>;
|
|
168
165
|
/**
|
|
169
166
|
* Get a product document.
|
|
170
167
|
* @summary Retrieve the product document
|
|
@@ -234,23 +231,17 @@ export interface ProductDocumentsApiDeleteProductDocumentRequest {
|
|
|
234
231
|
*/
|
|
235
232
|
export interface ProductDocumentsApiDownloadProductDocumentRequest {
|
|
236
233
|
/**
|
|
237
|
-
*
|
|
234
|
+
*
|
|
238
235
|
* @type {string}
|
|
239
236
|
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
240
237
|
*/
|
|
241
238
|
readonly productSlug: string;
|
|
242
239
|
/**
|
|
243
|
-
*
|
|
240
|
+
*
|
|
244
241
|
* @type {string}
|
|
245
242
|
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
246
243
|
*/
|
|
247
244
|
readonly code: string;
|
|
248
|
-
/**
|
|
249
|
-
* Content disposition override. Default will be depending on the document type.
|
|
250
|
-
* @type {'attachment' | 'inline'}
|
|
251
|
-
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
252
|
-
*/
|
|
253
|
-
readonly contentDisposition: 'attachment' | 'inline';
|
|
254
245
|
/**
|
|
255
246
|
* Bearer Token
|
|
256
247
|
* @type {string}
|
|
@@ -151,14 +151,13 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
151
151
|
/**
|
|
152
152
|
* Get a pre-signed download url for the given product document.
|
|
153
153
|
* @summary Get pre-signed url for downloading product document
|
|
154
|
-
* @param {string} productSlug
|
|
155
|
-
* @param {string} code
|
|
156
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
154
|
+
* @param {string} productSlug
|
|
155
|
+
* @param {string} code
|
|
157
156
|
* @param {string} [authorization] Bearer Token
|
|
158
157
|
* @param {*} [options] Override http request option.
|
|
159
158
|
* @throws {RequiredError}
|
|
160
159
|
*/
|
|
161
|
-
downloadProductDocument: function (productSlug, code,
|
|
160
|
+
downloadProductDocument: function (productSlug, code, authorization, options) {
|
|
162
161
|
if (options === void 0) { options = {}; }
|
|
163
162
|
return __awaiter(_this, void 0, void 0, function () {
|
|
164
163
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -169,8 +168,6 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
169
168
|
(0, common_1.assertParamExists)('downloadProductDocument', 'productSlug', productSlug);
|
|
170
169
|
// verify required parameter 'code' is not null or undefined
|
|
171
170
|
(0, common_1.assertParamExists)('downloadProductDocument', 'code', code);
|
|
172
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
173
|
-
(0, common_1.assertParamExists)('downloadProductDocument', 'contentDisposition', contentDisposition);
|
|
174
171
|
localVarPath = "/documentservice/v1/product-documents/{productSlug}/{code}/download-url"
|
|
175
172
|
.replace("{".concat("productSlug", "}"), encodeURIComponent(String(productSlug)))
|
|
176
173
|
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
@@ -189,9 +186,6 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
189
186
|
// authentication bearer required
|
|
190
187
|
// http bearer authentication required
|
|
191
188
|
_a.sent();
|
|
192
|
-
if (contentDisposition !== undefined) {
|
|
193
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
194
|
-
}
|
|
195
189
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
196
190
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
197
191
|
}
|
|
@@ -422,19 +416,18 @@ var ProductDocumentsApiFp = function (configuration) {
|
|
|
422
416
|
/**
|
|
423
417
|
* Get a pre-signed download url for the given product document.
|
|
424
418
|
* @summary Get pre-signed url for downloading product document
|
|
425
|
-
* @param {string} productSlug
|
|
426
|
-
* @param {string} code
|
|
427
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
419
|
+
* @param {string} productSlug
|
|
420
|
+
* @param {string} code
|
|
428
421
|
* @param {string} [authorization] Bearer Token
|
|
429
422
|
* @param {*} [options] Override http request option.
|
|
430
423
|
* @throws {RequiredError}
|
|
431
424
|
*/
|
|
432
|
-
downloadProductDocument: function (productSlug, code,
|
|
425
|
+
downloadProductDocument: function (productSlug, code, authorization, options) {
|
|
433
426
|
return __awaiter(this, void 0, void 0, function () {
|
|
434
427
|
var localVarAxiosArgs;
|
|
435
428
|
return __generator(this, function (_a) {
|
|
436
429
|
switch (_a.label) {
|
|
437
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocument(productSlug, code,
|
|
430
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocument(productSlug, code, authorization, options)];
|
|
438
431
|
case 1:
|
|
439
432
|
localVarAxiosArgs = _a.sent();
|
|
440
433
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -539,15 +532,14 @@ var ProductDocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
539
532
|
/**
|
|
540
533
|
* Get a pre-signed download url for the given product document.
|
|
541
534
|
* @summary Get pre-signed url for downloading product document
|
|
542
|
-
* @param {string} productSlug
|
|
543
|
-
* @param {string} code
|
|
544
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
535
|
+
* @param {string} productSlug
|
|
536
|
+
* @param {string} code
|
|
545
537
|
* @param {string} [authorization] Bearer Token
|
|
546
538
|
* @param {*} [options] Override http request option.
|
|
547
539
|
* @throws {RequiredError}
|
|
548
540
|
*/
|
|
549
|
-
downloadProductDocument: function (productSlug, code,
|
|
550
|
-
return localVarFp.downloadProductDocument(productSlug, code,
|
|
541
|
+
downloadProductDocument: function (productSlug, code, authorization, options) {
|
|
542
|
+
return localVarFp.downloadProductDocument(productSlug, code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
551
543
|
},
|
|
552
544
|
/**
|
|
553
545
|
* Get a product document.
|
|
@@ -627,7 +619,7 @@ var ProductDocumentsApi = /** @class */ (function (_super) {
|
|
|
627
619
|
*/
|
|
628
620
|
ProductDocumentsApi.prototype.downloadProductDocument = function (requestParameters, options) {
|
|
629
621
|
var _this = this;
|
|
630
|
-
return (0, exports.ProductDocumentsApiFp)(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.
|
|
622
|
+
return (0, exports.ProductDocumentsApiFp)(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
631
623
|
};
|
|
632
624
|
/**
|
|
633
625
|
* Get a product document.
|