@emilgroup/document-sdk 1.2.0 → 1.6.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 (53) hide show
  1. package/.openapi-generator/FILES +3 -0
  2. package/README.md +5 -22
  3. package/api/document-templates-api.ts +28 -18
  4. package/api/documents-api.ts +0 -4
  5. package/api/layouts-api.ts +0 -4
  6. package/api/product-documents-api.ts +116 -4
  7. package/api/search-keywords-api.ts +0 -4
  8. package/api/searchable-document-owners-api.ts +0 -4
  9. package/api/searchable-documents-api.ts +0 -4
  10. package/api.ts +0 -4
  11. package/base.ts +59 -93
  12. package/common.ts +0 -1
  13. package/configuration.ts +0 -8
  14. package/dist/api/document-templates-api.d.ts +20 -11
  15. package/dist/api/document-templates-api.js +23 -21
  16. package/dist/api/documents-api.js +7 -11
  17. package/dist/api/layouts-api.js +5 -9
  18. package/dist/api/product-documents-api.d.ts +65 -0
  19. package/dist/api/product-documents-api.js +102 -8
  20. package/dist/api/search-keywords-api.js +1 -5
  21. package/dist/api/searchable-document-owners-api.js +1 -5
  22. package/dist/api/searchable-documents-api.js +1 -5
  23. package/dist/base.d.ts +5 -9
  24. package/dist/base.js +40 -136
  25. package/dist/common.d.ts +0 -1
  26. package/dist/common.js +1 -2
  27. package/dist/configuration.d.ts +0 -7
  28. package/dist/models/create-doc-template-request-dto.d.ts +6 -0
  29. package/dist/models/doc-template-class.d.ts +6 -0
  30. package/dist/models/get-product-document-download-url-response-class.d.ts +24 -0
  31. package/dist/models/get-product-document-download-url-response-class.js +15 -0
  32. package/dist/models/grpc-create-doc-template-request-dto.d.ts +55 -0
  33. package/dist/models/grpc-create-doc-template-request-dto.js +15 -0
  34. package/dist/models/grpc-update-doc-template-request-dto.d.ts +61 -0
  35. package/dist/models/grpc-update-doc-template-request-dto.js +15 -0
  36. package/dist/models/index.d.ts +3 -0
  37. package/dist/models/index.js +3 -0
  38. package/dist/models/list-doc-template-request-dto.d.ts +6 -0
  39. package/dist/models/product-document-class.d.ts +17 -0
  40. package/dist/models/product-document-class.js +11 -1
  41. package/dist/models/update-doc-template-request-dto.d.ts +6 -0
  42. package/dist/models/upload-product-document-request-dto.d.ts +6 -0
  43. package/models/create-doc-template-request-dto.ts +6 -0
  44. package/models/doc-template-class.ts +6 -0
  45. package/models/get-product-document-download-url-response-class.ts +30 -0
  46. package/models/grpc-create-doc-template-request-dto.ts +61 -0
  47. package/models/grpc-update-doc-template-request-dto.ts +67 -0
  48. package/models/index.ts +3 -0
  49. package/models/list-doc-template-request-dto.ts +6 -0
  50. package/models/product-document-class.ts +18 -0
  51. package/models/update-doc-template-request-dto.ts +6 -0
  52. package/models/upload-product-document-request-dto.ts +6 -0
  53. package/package.json +3 -5
@@ -36,8 +36,11 @@ models/get-doc-template-response-class.ts
36
36
  models/get-document-download-url-response-class.ts
37
37
  models/get-layout-request-dto.ts
38
38
  models/get-layout-response-class.ts
39
+ models/get-product-document-download-url-response-class.ts
39
40
  models/get-product-document-response-class.ts
40
41
  models/get-signed-s3-key-url-response-class.ts
42
+ models/grpc-create-doc-template-request-dto.ts
43
+ models/grpc-update-doc-template-request-dto.ts
41
44
  models/html-template-class.ts
42
45
  models/index.ts
43
46
  models/layout-class.ts
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Emil Documents SDK
2
2
 
3
- This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated Node module can be used with Nodejs based applications.
3
+ This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated module can be used with client-based applications (i.e. React).
4
4
 
5
5
  Language level
6
6
  * ES5 - you must have a Promises/A+ library installed
@@ -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.2.0 --save
20
+ npm install @emilgroup/document-sdk@1.6.0 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/document-sdk@1.2.0
24
+ yarn add @emilgroup/document-sdk@1.6.0
25
25
  ```
26
26
 
27
27
  And then you can import `DocumentsApi`.
@@ -31,32 +31,15 @@ import { DocumentsApi } from '@emilgroup/document-sdk'
31
31
 
32
32
  const documentsApi = new DocumentsApi();
33
33
  ```
34
- ## Credentials
35
34
 
36
- To use authentication protected endpoints, you have to first authorize. To do so, the easiest way is to provide a configuration file under `~/.emil/credentials` with the following content:
37
-
38
- ```shell
39
- emil_username=XXXXX@XXXX.XXX
40
- emil_password=XXXXXXXXXXXXXX
41
- ```
42
-
43
- It is also possible to provide environment variables instead:
44
-
45
- ```shell
46
- export EMIL_USERNAME=XXXXX@XXXX.XXX
47
- export EMIL_PASSWORD=XXXXXXXXXXXXXX
48
- ```
49
-
50
- ## Example
51
-
52
- Here is a basic functionning example:
35
+ To use authentication protected endpoints, you have to first authorize. To do so, use the `authorize` function in `DocumentsApi`:
53
36
 
54
37
  ```ts
55
38
  async function listDocuments(): Promise<Void> {
56
39
  try {
57
40
  const documentsApi = new DocumentsApi();
58
41
 
59
- await documentsApi.initialize(); // should be called only once per Api.
42
+ await documentsApi.authorize('username', 'password');
60
43
 
61
44
  const { data: { items } } = await documentsApi.listDocuments();
62
45
 
@@ -34,10 +34,6 @@ import { ListDocTemplatesResponseClass } from '../models';
34
34
  import { UpdateDocTemplateRequestDto } from '../models';
35
35
  // @ts-ignore
36
36
  import { UpdateDocTemplateResponseClass } from '../models';
37
- // URLSearchParams not necessarily used
38
- // @ts-ignore
39
- import { URL, URLSearchParams } from 'url';
40
- const FormData = require('form-data');
41
37
  /**
42
38
  * DocumentTemplatesApi - axios parameter creator
43
39
  * @export
@@ -141,7 +137,7 @@ export const DocumentTemplatesApiAxiosParamCreator = function (configuration?: C
141
137
  * @summary Retrieve the document template
142
138
  * @param {number} id
143
139
  * @param {string} [authorization] Bearer Token
144
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
140
+ * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
145
141
  * @param {*} [options] Override http request option.
146
142
  * @throws {RequiredError}
147
143
  */
@@ -191,14 +187,15 @@ export const DocumentTemplatesApiAxiosParamCreator = function (configuration?: C
191
187
  * @summary List document templates
192
188
  * @param {string} [authorization] Bearer Token
193
189
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
194
- * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
190
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
195
191
  * @param {string} [filter] Filter response by productSlug, slug and name.
192
+ * @param {string} [search] Search document templates by name | slug
196
193
  * @param {string} [order] Order response by createdAt.
197
194
  * @param {string} [expand] Expand response by bodyTemplate.
198
195
  * @param {*} [options] Override http request option.
199
196
  * @throws {RequiredError}
200
197
  */
201
- listDocTemplates: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
198
+ listDocTemplates: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
202
199
  const localVarPath = `/documentservice/v1/doc-templates`;
203
200
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
204
201
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -229,6 +226,10 @@ export const DocumentTemplatesApiAxiosParamCreator = function (configuration?: C
229
226
  localVarQueryParameter['filter'] = filter;
230
227
  }
231
228
 
229
+ if (search !== undefined) {
230
+ localVarQueryParameter['search'] = search;
231
+ }
232
+
232
233
  if (order !== undefined) {
233
234
  localVarQueryParameter['order'] = order;
234
235
  }
@@ -342,7 +343,7 @@ export const DocumentTemplatesApiFp = function(configuration?: Configuration) {
342
343
  * @summary Retrieve the document template
343
344
  * @param {number} id
344
345
  * @param {string} [authorization] Bearer Token
345
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
346
+ * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
346
347
  * @param {*} [options] Override http request option.
347
348
  * @throws {RequiredError}
348
349
  */
@@ -355,15 +356,16 @@ export const DocumentTemplatesApiFp = function(configuration?: Configuration) {
355
356
  * @summary List document templates
356
357
  * @param {string} [authorization] Bearer Token
357
358
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
358
- * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
359
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
359
360
  * @param {string} [filter] Filter response by productSlug, slug and name.
361
+ * @param {string} [search] Search document templates by name | slug
360
362
  * @param {string} [order] Order response by createdAt.
361
363
  * @param {string} [expand] Expand response by bodyTemplate.
362
364
  * @param {*} [options] Override http request option.
363
365
  * @throws {RequiredError}
364
366
  */
365
- async listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListDocTemplatesResponseClass>> {
366
- const localVarAxiosArgs = await localVarAxiosParamCreator.listDocTemplates(authorization, pageSize, pageToken, filter, order, expand, options);
367
+ async listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListDocTemplatesResponseClass>> {
368
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listDocTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options);
367
369
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
368
370
  },
369
371
  /**
@@ -416,7 +418,7 @@ export const DocumentTemplatesApiFactory = function (configuration?: Configurati
416
418
  * @summary Retrieve the document template
417
419
  * @param {number} id
418
420
  * @param {string} [authorization] Bearer Token
419
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
421
+ * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
420
422
  * @param {*} [options] Override http request option.
421
423
  * @throws {RequiredError}
422
424
  */
@@ -428,15 +430,16 @@ export const DocumentTemplatesApiFactory = function (configuration?: Configurati
428
430
  * @summary List document templates
429
431
  * @param {string} [authorization] Bearer Token
430
432
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
431
- * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
433
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
432
434
  * @param {string} [filter] Filter response by productSlug, slug and name.
435
+ * @param {string} [search] Search document templates by name | slug
433
436
  * @param {string} [order] Order response by createdAt.
434
437
  * @param {string} [expand] Expand response by bodyTemplate.
435
438
  * @param {*} [options] Override http request option.
436
439
  * @throws {RequiredError}
437
440
  */
438
- listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListDocTemplatesResponseClass> {
439
- return localVarFp.listDocTemplates(authorization, pageSize, pageToken, filter, order, expand, options).then((request) => request(axios, basePath));
441
+ listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListDocTemplatesResponseClass> {
442
+ return localVarFp.listDocTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
440
443
  },
441
444
  /**
442
445
  * Updates the specified document template by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
@@ -516,7 +519,7 @@ export interface DocumentTemplatesApiGetDocTemplateRequest {
516
519
  readonly authorization?: string
517
520
 
518
521
  /**
519
- * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
522
+ * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
520
523
  * @type {string}
521
524
  * @memberof DocumentTemplatesApiGetDocTemplate
522
525
  */
@@ -544,7 +547,7 @@ export interface DocumentTemplatesApiListDocTemplatesRequest {
544
547
  readonly pageSize?: number
545
548
 
546
549
  /**
547
- * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
550
+ * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
548
551
  * @type {string}
549
552
  * @memberof DocumentTemplatesApiListDocTemplates
550
553
  */
@@ -557,6 +560,13 @@ export interface DocumentTemplatesApiListDocTemplatesRequest {
557
560
  */
558
561
  readonly filter?: string
559
562
 
563
+ /**
564
+ * Search document templates by name | slug
565
+ * @type {string}
566
+ * @memberof DocumentTemplatesApiListDocTemplates
567
+ */
568
+ readonly search?: string
569
+
560
570
  /**
561
571
  * Order response by createdAt.
562
572
  * @type {string}
@@ -652,7 +662,7 @@ export class DocumentTemplatesApi extends BaseAPI {
652
662
  * @memberof DocumentTemplatesApi
653
663
  */
654
664
  public listDocTemplates(requestParameters: DocumentTemplatesApiListDocTemplatesRequest = {}, options?: AxiosRequestConfig) {
655
- return DocumentTemplatesApiFp(this.configuration).listDocTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
665
+ return DocumentTemplatesApiFp(this.configuration).listDocTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
656
666
  }
657
667
 
658
668
  /**
@@ -38,10 +38,6 @@ import { ListDocumentsResponseClass } from '../models';
38
38
  import { UpdateDocumentRequestDto } from '../models';
39
39
  // @ts-ignore
40
40
  import { UpdateDocumentResponseClass } from '../models';
41
- // URLSearchParams not necessarily used
42
- // @ts-ignore
43
- import { URL, URLSearchParams } from 'url';
44
- const FormData = require('form-data');
45
41
  /**
46
42
  * DocumentsApi - axios parameter creator
47
43
  * @export
@@ -34,10 +34,6 @@ import { ListLayoutsResponseClass } from '../models';
34
34
  import { UpdateLayoutRequestDto } from '../models';
35
35
  // @ts-ignore
36
36
  import { UpdateLayoutResponseClass } from '../models';
37
- // URLSearchParams not necessarily used
38
- // @ts-ignore
39
- import { URL, URLSearchParams } from 'url';
40
- const FormData = require('form-data');
41
37
  /**
42
38
  * LayoutsApi - axios parameter creator
43
39
  * @export
@@ -21,6 +21,8 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
21
21
  // @ts-ignore
22
22
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
23
  // @ts-ignore
24
+ import { GetProductDocumentDownloadUrlResponseClass } from '../models';
25
+ // @ts-ignore
24
26
  import { GetProductDocumentResponseClass } from '../models';
25
27
  // @ts-ignore
26
28
  import { ListProductDocumentsResponseClass } from '../models';
@@ -28,10 +30,6 @@ import { ListProductDocumentsResponseClass } from '../models';
28
30
  import { ProductDocumentClass } from '../models';
29
31
  // @ts-ignore
30
32
  import { UploadProductDocumentRequestDto } from '../models';
31
- // URLSearchParams not necessarily used
32
- // @ts-ignore
33
- import { URL, URLSearchParams } from 'url';
34
- const FormData = require('form-data');
35
33
  /**
36
34
  * ProductDocumentsApi - axios parameter creator
37
35
  * @export
@@ -78,6 +76,55 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
78
76
 
79
77
 
80
78
 
79
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
80
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
81
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
82
+
83
+ return {
84
+ url: toPathString(localVarUrlObj),
85
+ options: localVarRequestOptions,
86
+ };
87
+ },
88
+ /**
89
+ * Get a pre-signed download url for the given product document.
90
+ * @summary Get pre-signed url for downloading product document
91
+ * @param {string} productSlug
92
+ * @param {string} code
93
+ * @param {string} [authorization] Bearer Token
94
+ * @param {*} [options] Override http request option.
95
+ * @throws {RequiredError}
96
+ */
97
+ downloadProductDocument: async (productSlug: string, code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
98
+ // verify required parameter 'productSlug' is not null or undefined
99
+ assertParamExists('downloadProductDocument', 'productSlug', productSlug)
100
+ // verify required parameter 'code' is not null or undefined
101
+ assertParamExists('downloadProductDocument', 'code', code)
102
+ const localVarPath = `/documentservice/v1/documents/product/{productSlug}/{code}/download-url`
103
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)))
104
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
105
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
106
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
107
+ let baseOptions;
108
+ let baseAccessToken;
109
+ if (configuration) {
110
+ baseOptions = configuration.baseOptions;
111
+ baseAccessToken = configuration.accessToken;
112
+ }
113
+
114
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
115
+ const localVarHeaderParameter = {} as any;
116
+ const localVarQueryParameter = {} as any;
117
+
118
+ // authentication bearer required
119
+ // http bearer authentication required
120
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
121
+
122
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
123
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
124
+ }
125
+
126
+
127
+
81
128
  setSearchParams(localVarUrlObj, localVarQueryParameter);
82
129
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
83
130
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -285,6 +332,19 @@ export const ProductDocumentsApiFp = function(configuration?: Configuration) {
285
332
  const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductDocument(code, productSlug, authorization, options);
286
333
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
287
334
  },
335
+ /**
336
+ * Get a pre-signed download url for the given product document.
337
+ * @summary Get pre-signed url for downloading product document
338
+ * @param {string} productSlug
339
+ * @param {string} code
340
+ * @param {string} [authorization] Bearer Token
341
+ * @param {*} [options] Override http request option.
342
+ * @throws {RequiredError}
343
+ */
344
+ async downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>> {
345
+ const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocument(productSlug, code, authorization, options);
346
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
347
+ },
288
348
  /**
289
349
  * Get a product document.
290
350
  * @summary Retrieve the product document
@@ -351,6 +411,18 @@ export const ProductDocumentsApiFactory = function (configuration?: Configuratio
351
411
  deleteProductDocument(code: string, productSlug: string, authorization?: string, options?: any): AxiosPromise<object> {
352
412
  return localVarFp.deleteProductDocument(code, productSlug, authorization, options).then((request) => request(axios, basePath));
353
413
  },
414
+ /**
415
+ * Get a pre-signed download url for the given product document.
416
+ * @summary Get pre-signed url for downloading product document
417
+ * @param {string} productSlug
418
+ * @param {string} code
419
+ * @param {string} [authorization] Bearer Token
420
+ * @param {*} [options] Override http request option.
421
+ * @throws {RequiredError}
422
+ */
423
+ downloadProductDocument(productSlug: string, code: string, authorization?: string, options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass> {
424
+ return localVarFp.downloadProductDocument(productSlug, code, authorization, options).then((request) => request(axios, basePath));
425
+ },
354
426
  /**
355
427
  * Get a product document.
356
428
  * @summary Retrieve the product document
@@ -423,6 +495,34 @@ export interface ProductDocumentsApiDeleteProductDocumentRequest {
423
495
  readonly authorization?: string
424
496
  }
425
497
 
498
+ /**
499
+ * Request parameters for downloadProductDocument operation in ProductDocumentsApi.
500
+ * @export
501
+ * @interface ProductDocumentsApiDownloadProductDocumentRequest
502
+ */
503
+ export interface ProductDocumentsApiDownloadProductDocumentRequest {
504
+ /**
505
+ *
506
+ * @type {string}
507
+ * @memberof ProductDocumentsApiDownloadProductDocument
508
+ */
509
+ readonly productSlug: string
510
+
511
+ /**
512
+ *
513
+ * @type {string}
514
+ * @memberof ProductDocumentsApiDownloadProductDocument
515
+ */
516
+ readonly code: string
517
+
518
+ /**
519
+ * Bearer Token
520
+ * @type {string}
521
+ * @memberof ProductDocumentsApiDownloadProductDocument
522
+ */
523
+ readonly authorization?: string
524
+ }
525
+
426
526
  /**
427
527
  * Request parameters for getProductDocument operation in ProductDocumentsApi.
428
528
  * @export
@@ -561,6 +661,18 @@ export class ProductDocumentsApi extends BaseAPI {
561
661
  return ProductDocumentsApiFp(this.configuration).deleteProductDocument(requestParameters.code, requestParameters.productSlug, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
562
662
  }
563
663
 
664
+ /**
665
+ * Get a pre-signed download url for the given product document.
666
+ * @summary Get pre-signed url for downloading product document
667
+ * @param {ProductDocumentsApiDownloadProductDocumentRequest} requestParameters Request parameters.
668
+ * @param {*} [options] Override http request option.
669
+ * @throws {RequiredError}
670
+ * @memberof ProductDocumentsApi
671
+ */
672
+ public downloadProductDocument(requestParameters: ProductDocumentsApiDownloadProductDocumentRequest, options?: AxiosRequestConfig) {
673
+ return ProductDocumentsApiFp(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
674
+ }
675
+
564
676
  /**
565
677
  * Get a product document.
566
678
  * @summary Retrieve the product document
@@ -22,10 +22,6 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
22
22
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
23
  // @ts-ignore
24
24
  import { ListSearchKeywordsResponseClass } from '../models';
25
- // URLSearchParams not necessarily used
26
- // @ts-ignore
27
- import { URL, URLSearchParams } from 'url';
28
- const FormData = require('form-data');
29
25
  /**
30
26
  * SearchKeywordsApi - axios parameter creator
31
27
  * @export
@@ -22,10 +22,6 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
22
22
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
23
  // @ts-ignore
24
24
  import { ListSearchableDocumentOwnersResponseClass } from '../models';
25
- // URLSearchParams not necessarily used
26
- // @ts-ignore
27
- import { URL, URLSearchParams } from 'url';
28
- const FormData = require('form-data');
29
25
  /**
30
26
  * SearchableDocumentOwnersApi - axios parameter creator
31
27
  * @export
@@ -22,10 +22,6 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
22
22
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
23
  // @ts-ignore
24
24
  import { ListSearchableDocumentsResponseClass } from '../models';
25
- // URLSearchParams not necessarily used
26
- // @ts-ignore
27
- import { URL, URLSearchParams } from 'url';
28
- const FormData = require('form-data');
29
25
  /**
30
26
  * SearchableDocumentsApi - axios parameter creator
31
27
  * @export
package/api.ts CHANGED
@@ -15,10 +15,6 @@
15
15
 
16
16
  import { Configuration } from './configuration';
17
17
  import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
18
- // URLSearchParams not necessarily used
19
- // @ts-ignore
20
- import { URL, URLSearchParams } from 'url';
21
- import FormData from 'form-data'
22
18
  // Some imports not used depending on template conditions
23
19
  // @ts-ignore
24
20
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';