@emilgroup/document-sdk 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 +2 -2
- package/api/documents-api.ts +10 -26
- package/api/product-documents-api.ts +14 -30
- package/base.ts +5 -1
- 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/dist/base.d.ts +1 -0
- package/dist/base.js +4 -1
- 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@1.
|
|
20
|
+
npm install @emilgroup/document-sdk@1.23.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/document-sdk@1.
|
|
24
|
+
yarn add @emilgroup/document-sdk@1.23.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `DocumentsApi`.
|
package/api/documents-api.ts
CHANGED
|
@@ -174,17 +174,14 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
174
174
|
/**
|
|
175
175
|
* This will return a presigned URL to download the document.
|
|
176
176
|
* @summary Fetches a document download URL
|
|
177
|
-
* @param {string} code
|
|
178
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
177
|
+
* @param {string} code
|
|
179
178
|
* @param {string} [authorization] Bearer Token
|
|
180
179
|
* @param {*} [options] Override http request option.
|
|
181
180
|
* @throws {RequiredError}
|
|
182
181
|
*/
|
|
183
|
-
getDocumentDownloadUrl: async (code: string,
|
|
182
|
+
getDocumentDownloadUrl: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
184
183
|
// verify required parameter 'code' is not null or undefined
|
|
185
184
|
assertParamExists('getDocumentDownloadUrl', 'code', code)
|
|
186
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
187
|
-
assertParamExists('getDocumentDownloadUrl', 'contentDisposition', contentDisposition)
|
|
188
185
|
const localVarPath = `/documentservice/v1/documents/{code}/download-url`
|
|
189
186
|
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
190
187
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
@@ -204,10 +201,6 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
204
201
|
// http bearer authentication required
|
|
205
202
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
206
203
|
|
|
207
|
-
if (contentDisposition !== undefined) {
|
|
208
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
204
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
212
205
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
213
206
|
}
|
|
@@ -447,14 +440,13 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
|
|
447
440
|
/**
|
|
448
441
|
* This will return a presigned URL to download the document.
|
|
449
442
|
* @summary Fetches a document download URL
|
|
450
|
-
* @param {string} code
|
|
451
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
443
|
+
* @param {string} code
|
|
452
444
|
* @param {string} [authorization] Bearer Token
|
|
453
445
|
* @param {*} [options] Override http request option.
|
|
454
446
|
* @throws {RequiredError}
|
|
455
447
|
*/
|
|
456
|
-
async getDocumentDownloadUrl(code: string,
|
|
457
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.getDocumentDownloadUrl(code,
|
|
448
|
+
async getDocumentDownloadUrl(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
449
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getDocumentDownloadUrl(code, authorization, options);
|
|
458
450
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
459
451
|
},
|
|
460
452
|
/**
|
|
@@ -546,14 +538,13 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
|
|
546
538
|
/**
|
|
547
539
|
* This will return a presigned URL to download the document.
|
|
548
540
|
* @summary Fetches a document download URL
|
|
549
|
-
* @param {string} code
|
|
550
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
541
|
+
* @param {string} code
|
|
551
542
|
* @param {string} [authorization] Bearer Token
|
|
552
543
|
* @param {*} [options] Override http request option.
|
|
553
544
|
* @throws {RequiredError}
|
|
554
545
|
*/
|
|
555
|
-
getDocumentDownloadUrl(code: string,
|
|
556
|
-
return localVarFp.getDocumentDownloadUrl(code,
|
|
546
|
+
getDocumentDownloadUrl(code: string, authorization?: string, options?: any): AxiosPromise<void> {
|
|
547
|
+
return localVarFp.getDocumentDownloadUrl(code, authorization, options).then((request) => request(axios, basePath));
|
|
557
548
|
},
|
|
558
549
|
/**
|
|
559
550
|
* This will return a presigned URL for a random S3 key
|
|
@@ -668,19 +659,12 @@ export interface DocumentsApiDeleteDocumentRequest {
|
|
|
668
659
|
*/
|
|
669
660
|
export interface DocumentsApiGetDocumentDownloadUrlRequest {
|
|
670
661
|
/**
|
|
671
|
-
*
|
|
662
|
+
*
|
|
672
663
|
* @type {string}
|
|
673
664
|
* @memberof DocumentsApiGetDocumentDownloadUrl
|
|
674
665
|
*/
|
|
675
666
|
readonly code: string
|
|
676
667
|
|
|
677
|
-
/**
|
|
678
|
-
* Content disposition override. Default will be depending on the document type.
|
|
679
|
-
* @type {'attachment' | 'inline'}
|
|
680
|
-
* @memberof DocumentsApiGetDocumentDownloadUrl
|
|
681
|
-
*/
|
|
682
|
-
readonly contentDisposition: 'attachment' | 'inline'
|
|
683
|
-
|
|
684
668
|
/**
|
|
685
669
|
* Bearer Token
|
|
686
670
|
* @type {string}
|
|
@@ -853,7 +837,7 @@ export class DocumentsApi extends BaseAPI {
|
|
|
853
837
|
* @memberof DocumentsApi
|
|
854
838
|
*/
|
|
855
839
|
public getDocumentDownloadUrl(requestParameters: DocumentsApiGetDocumentDownloadUrlRequest, options?: AxiosRequestConfig) {
|
|
856
|
-
return DocumentsApiFp(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.
|
|
840
|
+
return DocumentsApiFp(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
857
841
|
}
|
|
858
842
|
|
|
859
843
|
/**
|
|
@@ -80,20 +80,17 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
|
|
|
80
80
|
/**
|
|
81
81
|
* Get a pre-signed download url for the given product document.
|
|
82
82
|
* @summary Get pre-signed url for downloading product document
|
|
83
|
-
* @param {string} productSlug
|
|
84
|
-
* @param {string} code
|
|
85
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
83
|
+
* @param {string} productSlug
|
|
84
|
+
* @param {string} code
|
|
86
85
|
* @param {string} [authorization] Bearer Token
|
|
87
86
|
* @param {*} [options] Override http request option.
|
|
88
87
|
* @throws {RequiredError}
|
|
89
88
|
*/
|
|
90
|
-
downloadProductDocument: async (productSlug: string, code: string,
|
|
89
|
+
downloadProductDocument: async (productSlug: string, code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
91
90
|
// verify required parameter 'productSlug' is not null or undefined
|
|
92
91
|
assertParamExists('downloadProductDocument', 'productSlug', productSlug)
|
|
93
92
|
// verify required parameter 'code' is not null or undefined
|
|
94
93
|
assertParamExists('downloadProductDocument', 'code', code)
|
|
95
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
96
|
-
assertParamExists('downloadProductDocument', 'contentDisposition', contentDisposition)
|
|
97
94
|
const localVarPath = `/documentservice/v1/product-documents/{productSlug}/{code}/download-url`
|
|
98
95
|
.replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)))
|
|
99
96
|
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
@@ -114,10 +111,6 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
|
|
|
114
111
|
// http bearer authentication required
|
|
115
112
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
116
113
|
|
|
117
|
-
if (contentDisposition !== undefined) {
|
|
118
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
114
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
122
115
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
123
116
|
}
|
|
@@ -339,15 +332,14 @@ export const ProductDocumentsApiFp = function(configuration?: Configuration) {
|
|
|
339
332
|
/**
|
|
340
333
|
* Get a pre-signed download url for the given product document.
|
|
341
334
|
* @summary Get pre-signed url for downloading product document
|
|
342
|
-
* @param {string} productSlug
|
|
343
|
-
* @param {string} code
|
|
344
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
335
|
+
* @param {string} productSlug
|
|
336
|
+
* @param {string} code
|
|
345
337
|
* @param {string} [authorization] Bearer Token
|
|
346
338
|
* @param {*} [options] Override http request option.
|
|
347
339
|
* @throws {RequiredError}
|
|
348
340
|
*/
|
|
349
|
-
async downloadProductDocument(productSlug: string, code: string,
|
|
350
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocument(productSlug, code,
|
|
341
|
+
async downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
342
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocument(productSlug, code, authorization, options);
|
|
351
343
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
352
344
|
},
|
|
353
345
|
/**
|
|
@@ -420,15 +412,14 @@ export const ProductDocumentsApiFactory = function (configuration?: Configuratio
|
|
|
420
412
|
/**
|
|
421
413
|
* Get a pre-signed download url for the given product document.
|
|
422
414
|
* @summary Get pre-signed url for downloading product document
|
|
423
|
-
* @param {string} productSlug
|
|
424
|
-
* @param {string} code
|
|
425
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
415
|
+
* @param {string} productSlug
|
|
416
|
+
* @param {string} code
|
|
426
417
|
* @param {string} [authorization] Bearer Token
|
|
427
418
|
* @param {*} [options] Override http request option.
|
|
428
419
|
* @throws {RequiredError}
|
|
429
420
|
*/
|
|
430
|
-
downloadProductDocument(productSlug: string, code: string,
|
|
431
|
-
return localVarFp.downloadProductDocument(productSlug, code,
|
|
421
|
+
downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: any): AxiosPromise<void> {
|
|
422
|
+
return localVarFp.downloadProductDocument(productSlug, code, authorization, options).then((request) => request(axios, basePath));
|
|
432
423
|
},
|
|
433
424
|
/**
|
|
434
425
|
* Get a product document.
|
|
@@ -510,26 +501,19 @@ export interface ProductDocumentsApiDeleteProductDocumentRequest {
|
|
|
510
501
|
*/
|
|
511
502
|
export interface ProductDocumentsApiDownloadProductDocumentRequest {
|
|
512
503
|
/**
|
|
513
|
-
*
|
|
504
|
+
*
|
|
514
505
|
* @type {string}
|
|
515
506
|
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
516
507
|
*/
|
|
517
508
|
readonly productSlug: string
|
|
518
509
|
|
|
519
510
|
/**
|
|
520
|
-
*
|
|
511
|
+
*
|
|
521
512
|
* @type {string}
|
|
522
513
|
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
523
514
|
*/
|
|
524
515
|
readonly code: string
|
|
525
516
|
|
|
526
|
-
/**
|
|
527
|
-
* Content disposition override. Default will be depending on the document type.
|
|
528
|
-
* @type {'attachment' | 'inline'}
|
|
529
|
-
* @memberof ProductDocumentsApiDownloadProductDocument
|
|
530
|
-
*/
|
|
531
|
-
readonly contentDisposition: 'attachment' | 'inline'
|
|
532
|
-
|
|
533
517
|
/**
|
|
534
518
|
* Bearer Token
|
|
535
519
|
* @type {string}
|
|
@@ -692,7 +676,7 @@ export class ProductDocumentsApi extends BaseAPI {
|
|
|
692
676
|
* @memberof ProductDocumentsApi
|
|
693
677
|
*/
|
|
694
678
|
public downloadProductDocument(requestParameters: ProductDocumentsApiDownloadProductDocumentRequest, options?: AxiosRequestConfig) {
|
|
695
|
-
return ProductDocumentsApiFp(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.
|
|
679
|
+
return ProductDocumentsApiFp(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
696
680
|
}
|
|
697
681
|
|
|
698
682
|
/**
|
package/base.ts
CHANGED
|
@@ -102,7 +102,11 @@ export class BaseAPI {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
selectEnvironment(env: Environment) {
|
|
105
|
-
this.
|
|
105
|
+
this.selectBasePath(env);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
selectBasePath(path: string) {
|
|
109
|
+
this.configuration.basePath = path;
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
async authorize(username: string, password: string): Promise<void> {
|
|
@@ -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}
|
|
@@ -241,13 +241,12 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
241
241
|
/**
|
|
242
242
|
* This will return a presigned URL to download the document.
|
|
243
243
|
* @summary Fetches a document download URL
|
|
244
|
-
* @param {string} code
|
|
245
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
244
|
+
* @param {string} code
|
|
246
245
|
* @param {string} [authorization] Bearer Token
|
|
247
246
|
* @param {*} [options] Override http request option.
|
|
248
247
|
* @throws {RequiredError}
|
|
249
248
|
*/
|
|
250
|
-
getDocumentDownloadUrl: function (code,
|
|
249
|
+
getDocumentDownloadUrl: function (code, authorization, options) {
|
|
251
250
|
if (options === void 0) { options = {}; }
|
|
252
251
|
return __awaiter(_this, void 0, void 0, function () {
|
|
253
252
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -256,8 +255,6 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
256
255
|
case 0:
|
|
257
256
|
// verify required parameter 'code' is not null or undefined
|
|
258
257
|
(0, common_1.assertParamExists)('getDocumentDownloadUrl', 'code', code);
|
|
259
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
260
|
-
(0, common_1.assertParamExists)('getDocumentDownloadUrl', 'contentDisposition', contentDisposition);
|
|
261
258
|
localVarPath = "/documentservice/v1/documents/{code}/download-url"
|
|
262
259
|
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
263
260
|
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -275,9 +272,6 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
275
272
|
// authentication bearer required
|
|
276
273
|
// http bearer authentication required
|
|
277
274
|
_a.sent();
|
|
278
|
-
if (contentDisposition !== undefined) {
|
|
279
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
280
|
-
}
|
|
281
275
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
282
276
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
283
277
|
}
|
|
@@ -543,18 +537,17 @@ var DocumentsApiFp = function (configuration) {
|
|
|
543
537
|
/**
|
|
544
538
|
* This will return a presigned URL to download the document.
|
|
545
539
|
* @summary Fetches a document download URL
|
|
546
|
-
* @param {string} code
|
|
547
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
540
|
+
* @param {string} code
|
|
548
541
|
* @param {string} [authorization] Bearer Token
|
|
549
542
|
* @param {*} [options] Override http request option.
|
|
550
543
|
* @throws {RequiredError}
|
|
551
544
|
*/
|
|
552
|
-
getDocumentDownloadUrl: function (code,
|
|
545
|
+
getDocumentDownloadUrl: function (code, authorization, options) {
|
|
553
546
|
return __awaiter(this, void 0, void 0, function () {
|
|
554
547
|
var localVarAxiosArgs;
|
|
555
548
|
return __generator(this, function (_a) {
|
|
556
549
|
switch (_a.label) {
|
|
557
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getDocumentDownloadUrl(code,
|
|
550
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getDocumentDownloadUrl(code, authorization, options)];
|
|
558
551
|
case 1:
|
|
559
552
|
localVarAxiosArgs = _a.sent();
|
|
560
553
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -678,14 +671,13 @@ var DocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
678
671
|
/**
|
|
679
672
|
* This will return a presigned URL to download the document.
|
|
680
673
|
* @summary Fetches a document download URL
|
|
681
|
-
* @param {string} code
|
|
682
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
674
|
+
* @param {string} code
|
|
683
675
|
* @param {string} [authorization] Bearer Token
|
|
684
676
|
* @param {*} [options] Override http request option.
|
|
685
677
|
* @throws {RequiredError}
|
|
686
678
|
*/
|
|
687
|
-
getDocumentDownloadUrl: function (code,
|
|
688
|
-
return localVarFp.getDocumentDownloadUrl(code,
|
|
679
|
+
getDocumentDownloadUrl: function (code, authorization, options) {
|
|
680
|
+
return localVarFp.getDocumentDownloadUrl(code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
689
681
|
},
|
|
690
682
|
/**
|
|
691
683
|
* This will return a presigned URL for a random S3 key
|
|
@@ -787,7 +779,7 @@ var DocumentsApi = /** @class */ (function (_super) {
|
|
|
787
779
|
*/
|
|
788
780
|
DocumentsApi.prototype.getDocumentDownloadUrl = function (requestParameters, options) {
|
|
789
781
|
var _this = this;
|
|
790
|
-
return (0, exports.DocumentsApiFp)(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.
|
|
782
|
+
return (0, exports.DocumentsApiFp)(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
791
783
|
};
|
|
792
784
|
/**
|
|
793
785
|
* 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}
|
|
@@ -147,14 +147,13 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
147
147
|
/**
|
|
148
148
|
* Get a pre-signed download url for the given product document.
|
|
149
149
|
* @summary Get pre-signed url for downloading product document
|
|
150
|
-
* @param {string} productSlug
|
|
151
|
-
* @param {string} code
|
|
152
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
150
|
+
* @param {string} productSlug
|
|
151
|
+
* @param {string} code
|
|
153
152
|
* @param {string} [authorization] Bearer Token
|
|
154
153
|
* @param {*} [options] Override http request option.
|
|
155
154
|
* @throws {RequiredError}
|
|
156
155
|
*/
|
|
157
|
-
downloadProductDocument: function (productSlug, code,
|
|
156
|
+
downloadProductDocument: function (productSlug, code, authorization, options) {
|
|
158
157
|
if (options === void 0) { options = {}; }
|
|
159
158
|
return __awaiter(_this, void 0, void 0, function () {
|
|
160
159
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -165,8 +164,6 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
165
164
|
(0, common_1.assertParamExists)('downloadProductDocument', 'productSlug', productSlug);
|
|
166
165
|
// verify required parameter 'code' is not null or undefined
|
|
167
166
|
(0, common_1.assertParamExists)('downloadProductDocument', 'code', code);
|
|
168
|
-
// verify required parameter 'contentDisposition' is not null or undefined
|
|
169
|
-
(0, common_1.assertParamExists)('downloadProductDocument', 'contentDisposition', contentDisposition);
|
|
170
167
|
localVarPath = "/documentservice/v1/product-documents/{productSlug}/{code}/download-url"
|
|
171
168
|
.replace("{".concat("productSlug", "}"), encodeURIComponent(String(productSlug)))
|
|
172
169
|
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
@@ -185,9 +182,6 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
185
182
|
// authentication bearer required
|
|
186
183
|
// http bearer authentication required
|
|
187
184
|
_a.sent();
|
|
188
|
-
if (contentDisposition !== undefined) {
|
|
189
|
-
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
190
|
-
}
|
|
191
185
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
192
186
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
193
187
|
}
|
|
@@ -418,19 +412,18 @@ var ProductDocumentsApiFp = function (configuration) {
|
|
|
418
412
|
/**
|
|
419
413
|
* Get a pre-signed download url for the given product document.
|
|
420
414
|
* @summary Get pre-signed url for downloading product document
|
|
421
|
-
* @param {string} productSlug
|
|
422
|
-
* @param {string} code
|
|
423
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
415
|
+
* @param {string} productSlug
|
|
416
|
+
* @param {string} code
|
|
424
417
|
* @param {string} [authorization] Bearer Token
|
|
425
418
|
* @param {*} [options] Override http request option.
|
|
426
419
|
* @throws {RequiredError}
|
|
427
420
|
*/
|
|
428
|
-
downloadProductDocument: function (productSlug, code,
|
|
421
|
+
downloadProductDocument: function (productSlug, code, authorization, options) {
|
|
429
422
|
return __awaiter(this, void 0, void 0, function () {
|
|
430
423
|
var localVarAxiosArgs;
|
|
431
424
|
return __generator(this, function (_a) {
|
|
432
425
|
switch (_a.label) {
|
|
433
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocument(productSlug, code,
|
|
426
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocument(productSlug, code, authorization, options)];
|
|
434
427
|
case 1:
|
|
435
428
|
localVarAxiosArgs = _a.sent();
|
|
436
429
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -535,15 +528,14 @@ var ProductDocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
535
528
|
/**
|
|
536
529
|
* Get a pre-signed download url for the given product document.
|
|
537
530
|
* @summary Get pre-signed url for downloading product document
|
|
538
|
-
* @param {string} productSlug
|
|
539
|
-
* @param {string} code
|
|
540
|
-
* @param {'attachment' | 'inline'} contentDisposition Content disposition override. Default will be depending on the document type.
|
|
531
|
+
* @param {string} productSlug
|
|
532
|
+
* @param {string} code
|
|
541
533
|
* @param {string} [authorization] Bearer Token
|
|
542
534
|
* @param {*} [options] Override http request option.
|
|
543
535
|
* @throws {RequiredError}
|
|
544
536
|
*/
|
|
545
|
-
downloadProductDocument: function (productSlug, code,
|
|
546
|
-
return localVarFp.downloadProductDocument(productSlug, code,
|
|
537
|
+
downloadProductDocument: function (productSlug, code, authorization, options) {
|
|
538
|
+
return localVarFp.downloadProductDocument(productSlug, code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
547
539
|
},
|
|
548
540
|
/**
|
|
549
541
|
* Get a product document.
|
|
@@ -623,7 +615,7 @@ var ProductDocumentsApi = /** @class */ (function (_super) {
|
|
|
623
615
|
*/
|
|
624
616
|
ProductDocumentsApi.prototype.downloadProductDocument = function (requestParameters, options) {
|
|
625
617
|
var _this = this;
|
|
626
|
-
return (0, exports.ProductDocumentsApiFp)(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.
|
|
618
|
+
return (0, exports.ProductDocumentsApiFp)(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
627
619
|
};
|
|
628
620
|
/**
|
|
629
621
|
* Get a product document.
|
package/dist/base.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare class BaseAPI {
|
|
|
54
54
|
private tokenData?;
|
|
55
55
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
56
56
|
selectEnvironment(env: Environment): void;
|
|
57
|
+
selectBasePath(path: string): void;
|
|
57
58
|
authorize(username: string, password: string): Promise<void>;
|
|
58
59
|
refreshTokenInternal(): Promise<string>;
|
|
59
60
|
private storeTokenData;
|
package/dist/base.js
CHANGED
|
@@ -138,7 +138,10 @@ var BaseAPI = /** @class */ (function () {
|
|
|
138
138
|
this.attachInterceptor(axios);
|
|
139
139
|
}
|
|
140
140
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
141
|
-
this.
|
|
141
|
+
this.selectBasePath(env);
|
|
142
|
+
};
|
|
143
|
+
BaseAPI.prototype.selectBasePath = function (path) {
|
|
144
|
+
this.configuration.basePath = path;
|
|
142
145
|
};
|
|
143
146
|
BaseAPI.prototype.authorize = function (username, password) {
|
|
144
147
|
return __awaiter(this, void 0, void 0, function () {
|