@emilgroup/public-api-sdk-node 1.28.0 → 1.29.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 +20 -6
- package/dist/api/documents-api.d.ts +12 -3
- package/dist/api/documents-api.js +12 -6
- 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/public-api-sdk-node@1.
|
|
20
|
+
npm install @emilgroup/public-api-sdk-node@1.29.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/public-api-sdk-node@1.
|
|
24
|
+
yarn add @emilgroup/public-api-sdk-node@1.29.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `PublicApi`.
|
|
@@ -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 { PublicApi, Environment } from '@emilgroup/public-api-sdk-node'
|
|
56
|
+
|
|
57
|
+
const publicApi = new PublicApi();
|
|
58
|
+
|
|
59
|
+
// Allows you to simply choose environment. It will usually be Environment.Production.
|
|
60
|
+
publicApi.selectEnvironment(Environment.Production);
|
|
61
|
+
|
|
62
|
+
// For advanced users, use the custom baseUrl of the website you need to connect to.
|
|
63
|
+
publicApi.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
|
@@ -189,10 +189,11 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
189
189
|
* @param {string} productCode
|
|
190
190
|
* @param {string} code
|
|
191
191
|
* @param {string} [authorization] Bearer Token
|
|
192
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
192
193
|
* @param {*} [options] Override http request option.
|
|
193
194
|
* @throws {RequiredError}
|
|
194
195
|
*/
|
|
195
|
-
downloadProductDocumentUrl: async (productCode: string, code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
196
|
+
downloadProductDocumentUrl: async (productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
196
197
|
// verify required parameter 'productCode' is not null or undefined
|
|
197
198
|
assertParamExists('downloadProductDocumentUrl', 'productCode', productCode)
|
|
198
199
|
// verify required parameter 'code' is not null or undefined
|
|
@@ -217,6 +218,10 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
217
218
|
// http bearer authentication required
|
|
218
219
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
219
220
|
|
|
221
|
+
if (contentDisposition !== undefined) {
|
|
222
|
+
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
223
|
+
}
|
|
224
|
+
|
|
220
225
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
221
226
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
222
227
|
}
|
|
@@ -480,11 +485,12 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
|
|
480
485
|
* @param {string} productCode
|
|
481
486
|
* @param {string} code
|
|
482
487
|
* @param {string} [authorization] Bearer Token
|
|
488
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
483
489
|
* @param {*} [options] Override http request option.
|
|
484
490
|
* @throws {RequiredError}
|
|
485
491
|
*/
|
|
486
|
-
async downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>> {
|
|
487
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, options);
|
|
492
|
+
async downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>> {
|
|
493
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options);
|
|
488
494
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
489
495
|
},
|
|
490
496
|
/**
|
|
@@ -584,11 +590,12 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
|
|
584
590
|
* @param {string} productCode
|
|
585
591
|
* @param {string} code
|
|
586
592
|
* @param {string} [authorization] Bearer Token
|
|
593
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
587
594
|
* @param {*} [options] Override http request option.
|
|
588
595
|
* @throws {RequiredError}
|
|
589
596
|
*/
|
|
590
|
-
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass> {
|
|
591
|
-
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, options).then((request) => request(axios, basePath));
|
|
597
|
+
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass> {
|
|
598
|
+
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options).then((request) => request(axios, basePath));
|
|
592
599
|
},
|
|
593
600
|
/**
|
|
594
601
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
@@ -733,6 +740,13 @@ export interface DocumentsApiDownloadProductDocumentUrlRequest {
|
|
|
733
740
|
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
734
741
|
*/
|
|
735
742
|
readonly authorization?: string
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Content disposition override. Default will be depending on the document type.
|
|
746
|
+
* @type {'attachment' | 'inline'}
|
|
747
|
+
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
748
|
+
*/
|
|
749
|
+
readonly contentDisposition?: 'attachment' | 'inline'
|
|
736
750
|
}
|
|
737
751
|
|
|
738
752
|
/**
|
|
@@ -927,7 +941,7 @@ export class DocumentsApi extends BaseAPI {
|
|
|
927
941
|
* @memberof DocumentsApi
|
|
928
942
|
*/
|
|
929
943
|
public downloadProductDocumentUrl(requestParameters: DocumentsApiDownloadProductDocumentUrlRequest, options?: AxiosRequestConfig) {
|
|
930
|
-
return DocumentsApiFp(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
944
|
+
return DocumentsApiFp(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, options).then((request) => request(this.axios, this.basePath));
|
|
931
945
|
}
|
|
932
946
|
|
|
933
947
|
/**
|
|
@@ -57,10 +57,11 @@ export declare const DocumentsApiAxiosParamCreator: (configuration?: Configurati
|
|
|
57
57
|
* @param {string} productCode
|
|
58
58
|
* @param {string} code
|
|
59
59
|
* @param {string} [authorization] Bearer Token
|
|
60
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
60
61
|
* @param {*} [options] Override http request option.
|
|
61
62
|
* @throws {RequiredError}
|
|
62
63
|
*/
|
|
63
|
-
downloadProductDocumentUrl: (productCode: string, code: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
64
|
+
downloadProductDocumentUrl: (productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
64
65
|
/**
|
|
65
66
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
66
67
|
* @summary List documents
|
|
@@ -139,10 +140,11 @@ export declare const DocumentsApiFp: (configuration?: Configuration) => {
|
|
|
139
140
|
* @param {string} productCode
|
|
140
141
|
* @param {string} code
|
|
141
142
|
* @param {string} [authorization] Bearer Token
|
|
143
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
142
144
|
* @param {*} [options] Override http request option.
|
|
143
145
|
* @throws {RequiredError}
|
|
144
146
|
*/
|
|
145
|
-
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>>;
|
|
147
|
+
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>>;
|
|
146
148
|
/**
|
|
147
149
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
148
150
|
* @summary List documents
|
|
@@ -221,10 +223,11 @@ export declare const DocumentsApiFactory: (configuration?: Configuration, basePa
|
|
|
221
223
|
* @param {string} productCode
|
|
222
224
|
* @param {string} code
|
|
223
225
|
* @param {string} [authorization] Bearer Token
|
|
226
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
224
227
|
* @param {*} [options] Override http request option.
|
|
225
228
|
* @throws {RequiredError}
|
|
226
229
|
*/
|
|
227
|
-
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass>;
|
|
230
|
+
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass>;
|
|
228
231
|
/**
|
|
229
232
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
230
233
|
* @summary List documents
|
|
@@ -351,6 +354,12 @@ export interface DocumentsApiDownloadProductDocumentUrlRequest {
|
|
|
351
354
|
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
352
355
|
*/
|
|
353
356
|
readonly authorization?: string;
|
|
357
|
+
/**
|
|
358
|
+
* Content disposition override. Default will be depending on the document type.
|
|
359
|
+
* @type {'attachment' | 'inline'}
|
|
360
|
+
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
361
|
+
*/
|
|
362
|
+
readonly contentDisposition?: 'attachment' | 'inline';
|
|
354
363
|
}
|
|
355
364
|
/**
|
|
356
365
|
* Request parameters for listDocuments operation in DocumentsApi.
|
|
@@ -251,10 +251,11 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
251
251
|
* @param {string} productCode
|
|
252
252
|
* @param {string} code
|
|
253
253
|
* @param {string} [authorization] Bearer Token
|
|
254
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
254
255
|
* @param {*} [options] Override http request option.
|
|
255
256
|
* @throws {RequiredError}
|
|
256
257
|
*/
|
|
257
|
-
downloadProductDocumentUrl: function (productCode, code, authorization, options) {
|
|
258
|
+
downloadProductDocumentUrl: function (productCode, code, authorization, contentDisposition, options) {
|
|
258
259
|
if (options === void 0) { options = {}; }
|
|
259
260
|
return __awaiter(_this, void 0, void 0, function () {
|
|
260
261
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -283,6 +284,9 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
283
284
|
// authentication bearer required
|
|
284
285
|
// http bearer authentication required
|
|
285
286
|
_a.sent();
|
|
287
|
+
if (contentDisposition !== undefined) {
|
|
288
|
+
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
289
|
+
}
|
|
286
290
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
287
291
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
288
292
|
}
|
|
@@ -568,15 +572,16 @@ var DocumentsApiFp = function (configuration) {
|
|
|
568
572
|
* @param {string} productCode
|
|
569
573
|
* @param {string} code
|
|
570
574
|
* @param {string} [authorization] Bearer Token
|
|
575
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
571
576
|
* @param {*} [options] Override http request option.
|
|
572
577
|
* @throws {RequiredError}
|
|
573
578
|
*/
|
|
574
|
-
downloadProductDocumentUrl: function (productCode, code, authorization, options) {
|
|
579
|
+
downloadProductDocumentUrl: function (productCode, code, authorization, contentDisposition, options) {
|
|
575
580
|
return __awaiter(this, void 0, void 0, function () {
|
|
576
581
|
var localVarAxiosArgs;
|
|
577
582
|
return __generator(this, function (_a) {
|
|
578
583
|
switch (_a.label) {
|
|
579
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, options)];
|
|
584
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options)];
|
|
580
585
|
case 1:
|
|
581
586
|
localVarAxiosArgs = _a.sent();
|
|
582
587
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -708,11 +713,12 @@ var DocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
708
713
|
* @param {string} productCode
|
|
709
714
|
* @param {string} code
|
|
710
715
|
* @param {string} [authorization] Bearer Token
|
|
716
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
711
717
|
* @param {*} [options] Override http request option.
|
|
712
718
|
* @throws {RequiredError}
|
|
713
719
|
*/
|
|
714
|
-
downloadProductDocumentUrl: function (productCode, code, authorization, options) {
|
|
715
|
-
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
720
|
+
downloadProductDocumentUrl: function (productCode, code, authorization, contentDisposition, options) {
|
|
721
|
+
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options).then(function (request) { return request(axios, basePath); });
|
|
716
722
|
},
|
|
717
723
|
/**
|
|
718
724
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
@@ -818,7 +824,7 @@ var DocumentsApi = /** @class */ (function (_super) {
|
|
|
818
824
|
*/
|
|
819
825
|
DocumentsApi.prototype.downloadProductDocumentUrl = function (requestParameters, options) {
|
|
820
826
|
var _this = this;
|
|
821
|
-
return (0, exports.DocumentsApiFp)(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
827
|
+
return (0, exports.DocumentsApiFp)(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
822
828
|
};
|
|
823
829
|
/**
|
|
824
830
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|