@emilgroup/document-sdk 1.40.1-beta.3 → 1.40.1-beta.4

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.
@@ -17,9 +17,6 @@ common.ts
17
17
  configuration.ts
18
18
  git_push.sh
19
19
  index.ts
20
- models/base64-metadata-class.ts
21
- models/convert-to-base64-request-dto.ts
22
- models/convert-to-base64-response-class.ts
23
20
  models/create-doc-template-request-dto.ts
24
21
  models/create-doc-template-response-class.ts
25
22
  models/create-document-request-dto.ts
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.40.1-beta.3 --save
20
+ npm install @emilgroup/document-sdk@1.40.1-beta.4 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/document-sdk@1.40.1-beta.3
24
+ yarn add @emilgroup/document-sdk@1.40.1-beta.4
25
25
  ```
26
26
 
27
27
  And then you can import `DocumentsApi`.
@@ -21,10 +21,6 @@ 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 { ConvertToBase64RequestDto } from '../models';
25
- // @ts-ignore
26
- import { ConvertToBase64ResponseClass } from '../models';
27
- // @ts-ignore
28
24
  import { CreateDocumentRequestDto } from '../models';
29
25
  // @ts-ignore
30
26
  import { CreateDocumentSyncResponseClass } from '../models';
@@ -50,57 +46,6 @@ import { UpdateDocumentResponseClass } from '../models';
50
46
  */
51
47
  export const DocumentsApiAxiosParamCreator = function (configuration?: Configuration) {
52
48
  return {
53
- /**
54
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
55
- * @summary Convert document to base64
56
- * @param {string} code Document code
57
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
58
- * @param {string} [authorization] Bearer Token
59
- * @param {*} [options] Override http request option.
60
- * @throws {RequiredError}
61
- */
62
- convertToBase64: async (code: string, convertToBase64RequestDto: ConvertToBase64RequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
63
- // verify required parameter 'code' is not null or undefined
64
- assertParamExists('convertToBase64', 'code', code)
65
- // verify required parameter 'convertToBase64RequestDto' is not null or undefined
66
- assertParamExists('convertToBase64', 'convertToBase64RequestDto', convertToBase64RequestDto)
67
- const localVarPath = `/documentservice/v1/documents/{code}/base64`
68
- .replace(`{${"code"}}`, encodeURIComponent(String(code)));
69
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
70
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
71
- let baseOptions;
72
- let baseAccessToken;
73
- if (configuration) {
74
- baseOptions = configuration.baseOptions;
75
- baseAccessToken = configuration.accessToken;
76
- }
77
-
78
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
79
- const localVarHeaderParameter = {} as any;
80
- const localVarQueryParameter = {} as any;
81
-
82
- // authentication bearer required
83
- // http bearer authentication required
84
- await setBearerAuthToObject(localVarHeaderParameter, configuration)
85
-
86
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
87
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
88
- }
89
-
90
-
91
-
92
- localVarHeaderParameter['Content-Type'] = 'application/json';
93
-
94
- setSearchParams(localVarUrlObj, localVarQueryParameter);
95
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
96
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
97
- localVarRequestOptions.data = serializeDataIfNeeded(convertToBase64RequestDto, localVarRequestOptions, configuration)
98
-
99
- return {
100
- url: toPathString(localVarUrlObj),
101
- options: localVarRequestOptions,
102
- };
103
- },
104
49
  /**
105
50
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
106
51
  * @summary Create the document
@@ -420,7 +365,7 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
420
365
  };
421
366
  },
422
367
  /**
423
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
368
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
424
369
  * @summary Save external document
425
370
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
426
371
  * @param {string} [authorization] Bearer Token
@@ -527,19 +472,6 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
527
472
  export const DocumentsApiFp = function(configuration?: Configuration) {
528
473
  const localVarAxiosParamCreator = DocumentsApiAxiosParamCreator(configuration)
529
474
  return {
530
- /**
531
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
532
- * @summary Convert document to base64
533
- * @param {string} code Document code
534
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
535
- * @param {string} [authorization] Bearer Token
536
- * @param {*} [options] Override http request option.
537
- * @throws {RequiredError}
538
- */
539
- async convertToBase64(code: string, convertToBase64RequestDto: ConvertToBase64RequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConvertToBase64ResponseClass>> {
540
- const localVarAxiosArgs = await localVarAxiosParamCreator.convertToBase64(code, convertToBase64RequestDto, authorization, options);
541
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
542
- },
543
475
  /**
544
476
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
545
477
  * @summary Create the document
@@ -621,7 +553,7 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
621
553
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
622
554
  },
623
555
  /**
624
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
556
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
625
557
  * @summary Save external document
626
558
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
627
559
  * @param {string} [authorization] Bearer Token
@@ -655,18 +587,6 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
655
587
  export const DocumentsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
656
588
  const localVarFp = DocumentsApiFp(configuration)
657
589
  return {
658
- /**
659
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
660
- * @summary Convert document to base64
661
- * @param {string} code Document code
662
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
663
- * @param {string} [authorization] Bearer Token
664
- * @param {*} [options] Override http request option.
665
- * @throws {RequiredError}
666
- */
667
- convertToBase64(code: string, convertToBase64RequestDto: ConvertToBase64RequestDto, authorization?: string, options?: any): AxiosPromise<ConvertToBase64ResponseClass> {
668
- return localVarFp.convertToBase64(code, convertToBase64RequestDto, authorization, options).then((request) => request(axios, basePath));
669
- },
670
590
  /**
671
591
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
672
592
  * @summary Create the document
@@ -742,7 +662,7 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
742
662
  return localVarFp.listDocuments(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
743
663
  },
744
664
  /**
745
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
665
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
746
666
  * @summary Save external document
747
667
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
748
668
  * @param {string} [authorization] Bearer Token
@@ -767,34 +687,6 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
767
687
  };
768
688
  };
769
689
 
770
- /**
771
- * Request parameters for convertToBase64 operation in DocumentsApi.
772
- * @export
773
- * @interface DocumentsApiConvertToBase64Request
774
- */
775
- export interface DocumentsApiConvertToBase64Request {
776
- /**
777
- * Document code
778
- * @type {string}
779
- * @memberof DocumentsApiConvertToBase64
780
- */
781
- readonly code: string
782
-
783
- /**
784
- *
785
- * @type {ConvertToBase64RequestDto}
786
- * @memberof DocumentsApiConvertToBase64
787
- */
788
- readonly convertToBase64RequestDto: ConvertToBase64RequestDto
789
-
790
- /**
791
- * Bearer Token
792
- * @type {string}
793
- * @memberof DocumentsApiConvertToBase64
794
- */
795
- readonly authorization?: string
796
- }
797
-
798
690
  /**
799
691
  * Request parameters for createDocument operation in DocumentsApi.
800
692
  * @export
@@ -1033,18 +925,6 @@ export interface DocumentsApiUpdateDocumentRequest {
1033
925
  * @extends {BaseAPI}
1034
926
  */
1035
927
  export class DocumentsApi extends BaseAPI {
1036
- /**
1037
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
1038
- * @summary Convert document to base64
1039
- * @param {DocumentsApiConvertToBase64Request} requestParameters Request parameters.
1040
- * @param {*} [options] Override http request option.
1041
- * @throws {RequiredError}
1042
- * @memberof DocumentsApi
1043
- */
1044
- public convertToBase64(requestParameters: DocumentsApiConvertToBase64Request, options?: AxiosRequestConfig) {
1045
- return DocumentsApiFp(this.configuration).convertToBase64(requestParameters.code, requestParameters.convertToBase64RequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1046
- }
1047
-
1048
928
  /**
1049
929
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
1050
930
  * @summary Create the document
@@ -1118,7 +998,7 @@ export class DocumentsApi extends BaseAPI {
1118
998
  }
1119
999
 
1120
1000
  /**
1121
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
1001
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
1122
1002
  * @summary Save external document
1123
1003
  * @param {DocumentsApiSaveExternalDocumentRequest} requestParameters Request parameters.
1124
1004
  * @param {*} [options] Override http request option.
package/base.ts CHANGED
@@ -97,9 +97,14 @@ export class BaseAPI {
97
97
  this.loadTokenData();
98
98
 
99
99
  if (configuration) {
100
+ const { accessToken } = this.tokenData;
100
101
  this.configuration = configuration;
101
102
  this.basePath = configuration.basePath || this.basePath;
102
- this.configuration.accessToken = this.tokenData.accessToken ? `Bearer ${this.tokenData.accessToken}` : '';
103
+
104
+ // Use config token if provided, otherwise use tokenData token
105
+ const configToken = this.configuration.accessToken;
106
+ const storedToken = accessToken ? `Bearer ${accessToken}` : '';
107
+ this.configuration.accessToken = configToken || storedToken;
103
108
  } else {
104
109
  const { accessToken, username } = this.tokenData;
105
110
 
@@ -12,8 +12,6 @@
12
12
  import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
13
13
  import { Configuration } from '../configuration';
14
14
  import { RequestArgs, BaseAPI } from '../base';
15
- import { ConvertToBase64RequestDto } from '../models';
16
- import { ConvertToBase64ResponseClass } from '../models';
17
15
  import { CreateDocumentRequestDto } from '../models';
18
16
  import { CreateDocumentSyncResponseClass } from '../models';
19
17
  import { CreatePresignedPostRequestDto } from '../models';
@@ -29,16 +27,6 @@ import { UpdateDocumentResponseClass } from '../models';
29
27
  * @export
30
28
  */
31
29
  export declare const DocumentsApiAxiosParamCreator: (configuration?: Configuration) => {
32
- /**
33
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
34
- * @summary Convert document to base64
35
- * @param {string} code Document code
36
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
37
- * @param {string} [authorization] Bearer Token
38
- * @param {*} [options] Override http request option.
39
- * @throws {RequiredError}
40
- */
41
- convertToBase64: (code: string, convertToBase64RequestDto: ConvertToBase64RequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
42
30
  /**
43
31
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
44
32
  * @summary Create the document
@@ -102,7 +90,7 @@ export declare const DocumentsApiAxiosParamCreator: (configuration?: Configurati
102
90
  */
103
91
  listDocuments: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
104
92
  /**
105
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
93
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
106
94
  * @summary Save external document
107
95
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
108
96
  * @param {string} [authorization] Bearer Token
@@ -126,16 +114,6 @@ export declare const DocumentsApiAxiosParamCreator: (configuration?: Configurati
126
114
  * @export
127
115
  */
128
116
  export declare const DocumentsApiFp: (configuration?: Configuration) => {
129
- /**
130
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
131
- * @summary Convert document to base64
132
- * @param {string} code Document code
133
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
134
- * @param {string} [authorization] Bearer Token
135
- * @param {*} [options] Override http request option.
136
- * @throws {RequiredError}
137
- */
138
- convertToBase64(code: string, convertToBase64RequestDto: ConvertToBase64RequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConvertToBase64ResponseClass>>;
139
117
  /**
140
118
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
141
119
  * @summary Create the document
@@ -199,7 +177,7 @@ export declare const DocumentsApiFp: (configuration?: Configuration) => {
199
177
  */
200
178
  listDocuments(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListDocumentsResponseClass>>;
201
179
  /**
202
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
180
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
203
181
  * @summary Save external document
204
182
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
205
183
  * @param {string} [authorization] Bearer Token
@@ -223,16 +201,6 @@ export declare const DocumentsApiFp: (configuration?: Configuration) => {
223
201
  * @export
224
202
  */
225
203
  export declare const DocumentsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
226
- /**
227
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
228
- * @summary Convert document to base64
229
- * @param {string} code Document code
230
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
231
- * @param {string} [authorization] Bearer Token
232
- * @param {*} [options] Override http request option.
233
- * @throws {RequiredError}
234
- */
235
- convertToBase64(code: string, convertToBase64RequestDto: ConvertToBase64RequestDto, authorization?: string, options?: any): AxiosPromise<ConvertToBase64ResponseClass>;
236
204
  /**
237
205
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
238
206
  * @summary Create the document
@@ -296,7 +264,7 @@ export declare const DocumentsApiFactory: (configuration?: Configuration, basePa
296
264
  */
297
265
  listDocuments(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListDocumentsResponseClass>;
298
266
  /**
299
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
267
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
300
268
  * @summary Save external document
301
269
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
302
270
  * @param {string} [authorization] Bearer Token
@@ -315,31 +283,6 @@ export declare const DocumentsApiFactory: (configuration?: Configuration, basePa
315
283
  */
316
284
  updateDocument(code: string, updateDocumentRequestDto: UpdateDocumentRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateDocumentResponseClass>;
317
285
  };
318
- /**
319
- * Request parameters for convertToBase64 operation in DocumentsApi.
320
- * @export
321
- * @interface DocumentsApiConvertToBase64Request
322
- */
323
- export interface DocumentsApiConvertToBase64Request {
324
- /**
325
- * Document code
326
- * @type {string}
327
- * @memberof DocumentsApiConvertToBase64
328
- */
329
- readonly code: string;
330
- /**
331
- *
332
- * @type {ConvertToBase64RequestDto}
333
- * @memberof DocumentsApiConvertToBase64
334
- */
335
- readonly convertToBase64RequestDto: ConvertToBase64RequestDto;
336
- /**
337
- * Bearer Token
338
- * @type {string}
339
- * @memberof DocumentsApiConvertToBase64
340
- */
341
- readonly authorization?: string;
342
- }
343
286
  /**
344
287
  * Request parameters for createDocument operation in DocumentsApi.
345
288
  * @export
@@ -553,15 +496,6 @@ export interface DocumentsApiUpdateDocumentRequest {
553
496
  * @extends {BaseAPI}
554
497
  */
555
498
  export declare class DocumentsApi extends BaseAPI {
556
- /**
557
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
558
- * @summary Convert document to base64
559
- * @param {DocumentsApiConvertToBase64Request} requestParameters Request parameters.
560
- * @param {*} [options] Override http request option.
561
- * @throws {RequiredError}
562
- * @memberof DocumentsApi
563
- */
564
- convertToBase64(requestParameters: DocumentsApiConvertToBase64Request, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ConvertToBase64ResponseClass, any>>;
565
499
  /**
566
500
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
567
501
  * @summary Create the document
@@ -617,7 +551,7 @@ export declare class DocumentsApi extends BaseAPI {
617
551
  */
618
552
  listDocuments(requestParameters?: DocumentsApiListDocumentsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListDocumentsResponseClass, any>>;
619
553
  /**
620
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
554
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
621
555
  * @summary Save external document
622
556
  * @param {DocumentsApiSaveExternalDocumentRequest} requestParameters Request parameters.
623
557
  * @param {*} [options] Override http request option.
@@ -92,59 +92,6 @@ var base_1 = require("../base");
92
92
  var DocumentsApiAxiosParamCreator = function (configuration) {
93
93
  var _this = this;
94
94
  return {
95
- /**
96
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
97
- * @summary Convert document to base64
98
- * @param {string} code Document code
99
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
100
- * @param {string} [authorization] Bearer Token
101
- * @param {*} [options] Override http request option.
102
- * @throws {RequiredError}
103
- */
104
- convertToBase64: function (code, convertToBase64RequestDto, authorization, options) {
105
- if (options === void 0) { options = {}; }
106
- return __awaiter(_this, void 0, void 0, function () {
107
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
108
- return __generator(this, function (_a) {
109
- switch (_a.label) {
110
- case 0:
111
- // verify required parameter 'code' is not null or undefined
112
- (0, common_1.assertParamExists)('convertToBase64', 'code', code);
113
- // verify required parameter 'convertToBase64RequestDto' is not null or undefined
114
- (0, common_1.assertParamExists)('convertToBase64', 'convertToBase64RequestDto', convertToBase64RequestDto);
115
- localVarPath = "/documentservice/v1/documents/{code}/base64"
116
- .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
117
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
118
- if (configuration) {
119
- baseOptions = configuration.baseOptions;
120
- baseAccessToken = configuration.accessToken;
121
- }
122
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
123
- localVarHeaderParameter = {};
124
- localVarQueryParameter = {};
125
- // authentication bearer required
126
- // http bearer authentication required
127
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
128
- case 1:
129
- // authentication bearer required
130
- // http bearer authentication required
131
- _a.sent();
132
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
133
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
134
- }
135
- localVarHeaderParameter['Content-Type'] = 'application/json';
136
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
137
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
138
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
139
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(convertToBase64RequestDto, localVarRequestOptions, configuration);
140
- return [2 /*return*/, {
141
- url: (0, common_1.toPathString)(localVarUrlObj),
142
- options: localVarRequestOptions,
143
- }];
144
- }
145
- });
146
- });
147
- },
148
95
  /**
149
96
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
150
97
  * @summary Create the document
@@ -470,7 +417,7 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
470
417
  });
471
418
  },
472
419
  /**
473
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
420
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
474
421
  * @summary Save external document
475
422
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
476
423
  * @param {string} [authorization] Bearer Token
@@ -581,28 +528,6 @@ exports.DocumentsApiAxiosParamCreator = DocumentsApiAxiosParamCreator;
581
528
  var DocumentsApiFp = function (configuration) {
582
529
  var localVarAxiosParamCreator = (0, exports.DocumentsApiAxiosParamCreator)(configuration);
583
530
  return {
584
- /**
585
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
586
- * @summary Convert document to base64
587
- * @param {string} code Document code
588
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
589
- * @param {string} [authorization] Bearer Token
590
- * @param {*} [options] Override http request option.
591
- * @throws {RequiredError}
592
- */
593
- convertToBase64: function (code, convertToBase64RequestDto, authorization, options) {
594
- return __awaiter(this, void 0, void 0, function () {
595
- var localVarAxiosArgs;
596
- return __generator(this, function (_a) {
597
- switch (_a.label) {
598
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.convertToBase64(code, convertToBase64RequestDto, authorization, options)];
599
- case 1:
600
- localVarAxiosArgs = _a.sent();
601
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
602
- }
603
- });
604
- });
605
- },
606
531
  /**
607
532
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
608
533
  * @summary Create the document
@@ -738,7 +663,7 @@ var DocumentsApiFp = function (configuration) {
738
663
  });
739
664
  },
740
665
  /**
741
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
666
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
742
667
  * @summary Save external document
743
668
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
744
669
  * @param {string} [authorization] Bearer Token
@@ -790,18 +715,6 @@ exports.DocumentsApiFp = DocumentsApiFp;
790
715
  var DocumentsApiFactory = function (configuration, basePath, axios) {
791
716
  var localVarFp = (0, exports.DocumentsApiFp)(configuration);
792
717
  return {
793
- /**
794
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
795
- * @summary Convert document to base64
796
- * @param {string} code Document code
797
- * @param {ConvertToBase64RequestDto} convertToBase64RequestDto
798
- * @param {string} [authorization] Bearer Token
799
- * @param {*} [options] Override http request option.
800
- * @throws {RequiredError}
801
- */
802
- convertToBase64: function (code, convertToBase64RequestDto, authorization, options) {
803
- return localVarFp.convertToBase64(code, convertToBase64RequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
804
- },
805
718
  /**
806
719
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
807
720
  * @summary Create the document
@@ -877,7 +790,7 @@ var DocumentsApiFactory = function (configuration, basePath, axios) {
877
790
  return localVarFp.listDocuments(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
878
791
  },
879
792
  /**
880
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
793
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
881
794
  * @summary Save external document
882
795
  * @param {SaveExternalDocumentRequestDto} saveExternalDocumentRequestDto
883
796
  * @param {string} [authorization] Bearer Token
@@ -913,18 +826,6 @@ var DocumentsApi = /** @class */ (function (_super) {
913
826
  function DocumentsApi() {
914
827
  return _super !== null && _super.apply(this, arguments) || this;
915
828
  }
916
- /**
917
- * Converts a document to base64 format with optional gzip compression for Zurich integration **Required Permissions** \"document-management.documents.view\"
918
- * @summary Convert document to base64
919
- * @param {DocumentsApiConvertToBase64Request} requestParameters Request parameters.
920
- * @param {*} [options] Override http request option.
921
- * @throws {RequiredError}
922
- * @memberof DocumentsApi
923
- */
924
- DocumentsApi.prototype.convertToBase64 = function (requestParameters, options) {
925
- var _this = this;
926
- return (0, exports.DocumentsApiFp)(this.configuration).convertToBase64(requestParameters.code, requestParameters.convertToBase64RequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
927
- };
928
829
  /**
929
830
  * This will create a document in database and upload the file to Amazon Simple Storage Service (S3). **Required Permissions** \"document-management.documents.create\"
930
831
  * @summary Create the document
@@ -999,7 +900,7 @@ var DocumentsApi = /** @class */ (function (_super) {
999
900
  return (0, exports.DocumentsApiFp)(this.configuration).listDocuments(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
1000
901
  };
1001
902
  /**
1002
- * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
903
+ * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
1003
904
  * @summary Save external document
1004
905
  * @param {DocumentsApiSaveExternalDocumentRequest} requestParameters Request parameters.
1005
906
  * @param {*} [options] Override http request option.
package/dist/base.js CHANGED
@@ -124,9 +124,13 @@ var BaseAPI = /** @class */ (function () {
124
124
  this.axios = axios;
125
125
  this.loadTokenData();
126
126
  if (configuration) {
127
+ var accessToken = this.tokenData.accessToken;
127
128
  this.configuration = configuration;
128
129
  this.basePath = configuration.basePath || this.basePath;
129
- this.configuration.accessToken = this.tokenData.accessToken ? "Bearer ".concat(this.tokenData.accessToken) : '';
130
+ // Use config token if provided, otherwise use tokenData token
131
+ var configToken = this.configuration.accessToken;
132
+ var storedToken = accessToken ? "Bearer ".concat(accessToken) : '';
133
+ this.configuration.accessToken = configToken || storedToken;
130
134
  }
131
135
  else {
132
136
  var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
@@ -1,6 +1,3 @@
1
- export * from './base64-metadata-class';
2
- export * from './convert-to-base64-request-dto';
3
- export * from './convert-to-base64-response-class';
4
1
  export * from './create-doc-template-request-dto';
5
2
  export * from './create-doc-template-response-class';
6
3
  export * from './create-document-request-dto';
@@ -14,9 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./base64-metadata-class"), exports);
18
- __exportStar(require("./convert-to-base64-request-dto"), exports);
19
- __exportStar(require("./convert-to-base64-response-class"), exports);
20
17
  __exportStar(require("./create-doc-template-request-dto"), exports);
21
18
  __exportStar(require("./create-doc-template-response-class"), exports);
22
19
  __exportStar(require("./create-document-request-dto"), exports);
package/models/index.ts CHANGED
@@ -1,6 +1,3 @@
1
- export * from './base64-metadata-class';
2
- export * from './convert-to-base64-request-dto';
3
- export * from './convert-to-base64-response-class';
4
1
  export * from './create-doc-template-request-dto';
5
2
  export * from './create-doc-template-response-class';
6
3
  export * from './create-document-request-dto';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emilgroup/document-sdk",
3
- "version": "1.40.1-beta.3",
3
+ "version": "1.40.1-beta.4",
4
4
  "description": "OpenAPI client for @emilgroup/document-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [
@@ -1,48 +0,0 @@
1
- /**
2
- * EMIL DocumentService
3
- * The EMIL DocumentService API description
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- * Contact: kontakt@emil.de
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- /**
13
- *
14
- * @export
15
- * @interface Base64MetadataClass
16
- */
17
- export interface Base64MetadataClass {
18
- /**
19
- * Original file size in bytes
20
- * @type {number}
21
- * @memberof Base64MetadataClass
22
- */
23
- 'originalSize': number;
24
- /**
25
- * Compressed file size in bytes (if compression was applied)
26
- * @type {number}
27
- * @memberof Base64MetadataClass
28
- */
29
- 'compressedSize': number;
30
- /**
31
- * Encoding type applied
32
- * @type {string}
33
- * @memberof Base64MetadataClass
34
- */
35
- 'encoding': string;
36
- /**
37
- * MIME type of the original document
38
- * @type {string}
39
- * @memberof Base64MetadataClass
40
- */
41
- 'mimeType': string;
42
- /**
43
- * Whether compression was applied
44
- * @type {boolean}
45
- * @memberof Base64MetadataClass
46
- */
47
- 'compressed': boolean;
48
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * EMIL DocumentService
6
- * The EMIL DocumentService API description
7
- *
8
- * The version of the OpenAPI document: 1.0
9
- * Contact: kontakt@emil.de
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,30 +0,0 @@
1
- /**
2
- * EMIL DocumentService
3
- * The EMIL DocumentService API description
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- * Contact: kontakt@emil.de
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- /**
13
- *
14
- * @export
15
- * @interface ConvertToBase64RequestDto
16
- */
17
- export interface ConvertToBase64RequestDto {
18
- /**
19
- * Whether to compress the document before base64 encoding
20
- * @type {boolean}
21
- * @memberof ConvertToBase64RequestDto
22
- */
23
- 'compress'?: boolean;
24
- /**
25
- * Whether to use streaming base64 encoding (memory efficient for large files)
26
- * @type {boolean}
27
- * @memberof ConvertToBase64RequestDto
28
- */
29
- 'stream'?: boolean;
30
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * EMIL DocumentService
6
- * The EMIL DocumentService API description
7
- *
8
- * The version of the OpenAPI document: 1.0
9
- * Contact: kontakt@emil.de
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,37 +0,0 @@
1
- /**
2
- * EMIL DocumentService
3
- * The EMIL DocumentService API description
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- * Contact: kontakt@emil.de
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import { Base64MetadataClass } from './base64-metadata-class';
13
- /**
14
- *
15
- * @export
16
- * @interface ConvertToBase64ResponseClass
17
- */
18
- export interface ConvertToBase64ResponseClass {
19
- /**
20
- * Unique document code
21
- * @type {string}
22
- * @memberof ConvertToBase64ResponseClass
23
- */
24
- 'documentCode': string;
25
- /**
26
- * Base64 encoded content of the document
27
- * @type {string}
28
- * @memberof ConvertToBase64ResponseClass
29
- */
30
- 'base64Content': string;
31
- /**
32
- * Metadata about the conversion
33
- * @type {Base64MetadataClass}
34
- * @memberof ConvertToBase64ResponseClass
35
- */
36
- 'metadata': Base64MetadataClass;
37
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * EMIL DocumentService
6
- * The EMIL DocumentService API description
7
- *
8
- * The version of the OpenAPI document: 1.0
9
- * Contact: kontakt@emil.de
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,54 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DocumentService
5
- * The EMIL DocumentService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
-
17
- /**
18
- *
19
- * @export
20
- * @interface Base64MetadataClass
21
- */
22
- export interface Base64MetadataClass {
23
- /**
24
- * Original file size in bytes
25
- * @type {number}
26
- * @memberof Base64MetadataClass
27
- */
28
- 'originalSize': number;
29
- /**
30
- * Compressed file size in bytes (if compression was applied)
31
- * @type {number}
32
- * @memberof Base64MetadataClass
33
- */
34
- 'compressedSize': number;
35
- /**
36
- * Encoding type applied
37
- * @type {string}
38
- * @memberof Base64MetadataClass
39
- */
40
- 'encoding': string;
41
- /**
42
- * MIME type of the original document
43
- * @type {string}
44
- * @memberof Base64MetadataClass
45
- */
46
- 'mimeType': string;
47
- /**
48
- * Whether compression was applied
49
- * @type {boolean}
50
- * @memberof Base64MetadataClass
51
- */
52
- 'compressed': boolean;
53
- }
54
-
@@ -1,36 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DocumentService
5
- * The EMIL DocumentService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
-
17
- /**
18
- *
19
- * @export
20
- * @interface ConvertToBase64RequestDto
21
- */
22
- export interface ConvertToBase64RequestDto {
23
- /**
24
- * Whether to compress the document before base64 encoding
25
- * @type {boolean}
26
- * @memberof ConvertToBase64RequestDto
27
- */
28
- 'compress'?: boolean;
29
- /**
30
- * Whether to use streaming base64 encoding (memory efficient for large files)
31
- * @type {boolean}
32
- * @memberof ConvertToBase64RequestDto
33
- */
34
- 'stream'?: boolean;
35
- }
36
-
@@ -1,43 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DocumentService
5
- * The EMIL DocumentService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import { Base64MetadataClass } from './base64-metadata-class';
17
-
18
- /**
19
- *
20
- * @export
21
- * @interface ConvertToBase64ResponseClass
22
- */
23
- export interface ConvertToBase64ResponseClass {
24
- /**
25
- * Unique document code
26
- * @type {string}
27
- * @memberof ConvertToBase64ResponseClass
28
- */
29
- 'documentCode': string;
30
- /**
31
- * Base64 encoded content of the document
32
- * @type {string}
33
- * @memberof ConvertToBase64ResponseClass
34
- */
35
- 'base64Content': string;
36
- /**
37
- * Metadata about the conversion
38
- * @type {Base64MetadataClass}
39
- * @memberof ConvertToBase64ResponseClass
40
- */
41
- 'metadata': Base64MetadataClass;
42
- }
43
-