@emilgroup/document-sdk-node 1.39.1-beta.1 → 1.39.1-beta.3

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.
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -74,15 +74,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
- if (ar || !(i in from)) {
80
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
- ar[i] = from[i];
82
- }
83
- }
84
- return to.concat(ar || Array.prototype.slice.call(from));
85
- };
86
77
  var __importDefault = (this && this.__importDefault) || function (mod) {
87
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
88
79
  };
@@ -113,14 +104,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
113
104
  * @param {*} [options] Override http request option.
114
105
  * @throws {RequiredError}
115
106
  */
116
- createLayout: function (createLayoutRequestDto_1, authorization_1) {
117
- var args_1 = [];
118
- for (var _i = 2; _i < arguments.length; _i++) {
119
- args_1[_i - 2] = arguments[_i];
120
- }
121
- return __awaiter(_this, __spreadArray([createLayoutRequestDto_1, authorization_1], args_1, true), void 0, function (createLayoutRequestDto, authorization, options) {
107
+ createLayout: function (createLayoutRequestDto, authorization, options) {
108
+ if (options === void 0) { options = {}; }
109
+ return __awaiter(_this, void 0, void 0, function () {
122
110
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
123
- if (options === void 0) { options = {}; }
124
111
  return __generator(this, function (_a) {
125
112
  switch (_a.label) {
126
113
  case 0:
@@ -166,14 +153,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
166
153
  * @param {*} [options] Override http request option.
167
154
  * @throws {RequiredError}
168
155
  */
169
- deleteLayout: function (id_1, authorization_1) {
170
- var args_1 = [];
171
- for (var _i = 2; _i < arguments.length; _i++) {
172
- args_1[_i - 2] = arguments[_i];
173
- }
174
- return __awaiter(_this, __spreadArray([id_1, authorization_1], args_1, true), void 0, function (id, authorization, options) {
156
+ deleteLayout: function (id, authorization, options) {
157
+ if (options === void 0) { options = {}; }
158
+ return __awaiter(_this, void 0, void 0, function () {
175
159
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
176
- if (options === void 0) { options = {}; }
177
160
  return __generator(this, function (_a) {
178
161
  switch (_a.label) {
179
162
  case 0:
@@ -219,14 +202,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
219
202
  * @param {*} [options] Override http request option.
220
203
  * @throws {RequiredError}
221
204
  */
222
- getLayout: function (id_1, id2_1, authorization_1) {
223
- var args_1 = [];
224
- for (var _i = 3; _i < arguments.length; _i++) {
225
- args_1[_i - 3] = arguments[_i];
226
- }
227
- return __awaiter(_this, __spreadArray([id_1, id2_1, authorization_1], args_1, true), void 0, function (id, id2, authorization, options) {
205
+ getLayout: function (id, id2, authorization, options) {
206
+ if (options === void 0) { options = {}; }
207
+ return __awaiter(_this, void 0, void 0, function () {
228
208
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
229
- if (options === void 0) { options = {}; }
230
209
  return __generator(this, function (_a) {
231
210
  switch (_a.label) {
232
211
  case 0:
@@ -282,14 +261,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
282
261
  * @param {*} [options] Override http request option.
283
262
  * @throws {RequiredError}
284
263
  */
285
- listLayouts: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
286
- var args_1 = [];
287
- for (var _i = 8; _i < arguments.length; _i++) {
288
- args_1[_i - 8] = arguments[_i];
289
- }
290
- return __awaiter(_this, __spreadArray([authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1], args_1, true), void 0, function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
264
+ listLayouts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
265
+ if (options === void 0) { options = {}; }
266
+ return __awaiter(_this, void 0, void 0, function () {
291
267
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
292
- if (options === void 0) { options = {}; }
293
268
  return __generator(this, function (_a) {
294
269
  switch (_a.label) {
295
270
  case 0:
@@ -353,14 +328,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
353
328
  * @param {*} [options] Override http request option.
354
329
  * @throws {RequiredError}
355
330
  */
356
- updateLayout: function (id_1, updateLayoutRequestDto_1, authorization_1) {
357
- var args_1 = [];
358
- for (var _i = 3; _i < arguments.length; _i++) {
359
- args_1[_i - 3] = arguments[_i];
360
- }
361
- return __awaiter(_this, __spreadArray([id_1, updateLayoutRequestDto_1, authorization_1], args_1, true), void 0, function (id, updateLayoutRequestDto, authorization, options) {
331
+ updateLayout: function (id, updateLayoutRequestDto, authorization, options) {
332
+ if (options === void 0) { options = {}; }
333
+ return __awaiter(_this, void 0, void 0, function () {
362
334
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
363
- if (options === void 0) { options = {}; }
364
335
  return __generator(this, function (_a) {
365
336
  switch (_a.label) {
366
337
  case 0:
@@ -42,7 +42,7 @@ export declare const ProductDocumentsApiAxiosParamCreator: (configuration?: Conf
42
42
  * @param {*} [options] Override http request option.
43
43
  * @throws {RequiredError}
44
44
  */
45
- downloadProductDocument: (productSlug: string, code: string, authorization?: string, contentDisposition?: "attachment" | "inline", options?: AxiosRequestConfig) => Promise<RequestArgs>;
45
+ downloadProductDocument: (productSlug: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig) => Promise<RequestArgs>;
46
46
  /**
47
47
  * Get a product document. **Required Permissions** \"document-management.documents.view\"
48
48
  * @summary Retrieve the product document
@@ -105,7 +105,7 @@ export declare const ProductDocumentsApiFp: (configuration?: Configuration) => {
105
105
  * @param {*} [options] Override http request option.
106
106
  * @throws {RequiredError}
107
107
  */
108
- downloadProductDocument(productSlug: string, code: string, authorization?: string, contentDisposition?: "attachment" | "inline", options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>>;
108
+ downloadProductDocument(productSlug: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>>;
109
109
  /**
110
110
  * Get a product document. **Required Permissions** \"document-management.documents.view\"
111
111
  * @summary Retrieve the product document
@@ -168,7 +168,7 @@ export declare const ProductDocumentsApiFactory: (configuration?: Configuration,
168
168
  * @param {*} [options] Override http request option.
169
169
  * @throws {RequiredError}
170
170
  */
171
- downloadProductDocument(productSlug: string, code: string, authorization?: string, contentDisposition?: "attachment" | "inline", options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass>;
171
+ downloadProductDocument(productSlug: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass>;
172
172
  /**
173
173
  * Get a product document. **Required Permissions** \"document-management.documents.view\"
174
174
  * @summary Retrieve the product document
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -74,15 +74,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
- if (ar || !(i in from)) {
80
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
- ar[i] = from[i];
82
- }
83
- }
84
- return to.concat(ar || Array.prototype.slice.call(from));
85
- };
86
77
  var __importDefault = (this && this.__importDefault) || function (mod) {
87
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
88
79
  };
@@ -114,14 +105,10 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
114
105
  * @param {*} [options] Override http request option.
115
106
  * @throws {RequiredError}
116
107
  */
117
- deleteProductDocument: function (code_1, productSlug_1, authorization_1) {
118
- var args_1 = [];
119
- for (var _i = 3; _i < arguments.length; _i++) {
120
- args_1[_i - 3] = arguments[_i];
121
- }
122
- return __awaiter(_this, __spreadArray([code_1, productSlug_1, authorization_1], args_1, true), void 0, function (code, productSlug, authorization, options) {
108
+ deleteProductDocument: function (code, productSlug, authorization, options) {
109
+ if (options === void 0) { options = {}; }
110
+ return __awaiter(_this, void 0, void 0, function () {
123
111
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
124
- if (options === void 0) { options = {}; }
125
112
  return __generator(this, function (_a) {
126
113
  switch (_a.label) {
127
114
  case 0:
@@ -171,14 +158,10 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
171
158
  * @param {*} [options] Override http request option.
172
159
  * @throws {RequiredError}
173
160
  */
174
- downloadProductDocument: function (productSlug_1, code_1, authorization_1, contentDisposition_1) {
175
- var args_1 = [];
176
- for (var _i = 4; _i < arguments.length; _i++) {
177
- args_1[_i - 4] = arguments[_i];
178
- }
179
- return __awaiter(_this, __spreadArray([productSlug_1, code_1, authorization_1, contentDisposition_1], args_1, true), void 0, function (productSlug, code, authorization, contentDisposition, options) {
161
+ downloadProductDocument: function (productSlug, code, authorization, contentDisposition, options) {
162
+ if (options === void 0) { options = {}; }
163
+ return __awaiter(_this, void 0, void 0, function () {
180
164
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
181
- if (options === void 0) { options = {}; }
182
165
  return __generator(this, function (_a) {
183
166
  switch (_a.label) {
184
167
  case 0:
@@ -230,14 +213,10 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
230
213
  * @param {*} [options] Override http request option.
231
214
  * @throws {RequiredError}
232
215
  */
233
- getProductDocument: function (productSlug_1, code_1, authorization_1) {
234
- var args_1 = [];
235
- for (var _i = 3; _i < arguments.length; _i++) {
236
- args_1[_i - 3] = arguments[_i];
237
- }
238
- return __awaiter(_this, __spreadArray([productSlug_1, code_1, authorization_1], args_1, true), void 0, function (productSlug, code, authorization, options) {
216
+ getProductDocument: function (productSlug, code, authorization, options) {
217
+ if (options === void 0) { options = {}; }
218
+ return __awaiter(_this, void 0, void 0, function () {
239
219
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
240
- if (options === void 0) { options = {}; }
241
220
  return __generator(this, function (_a) {
242
221
  switch (_a.label) {
243
222
  case 0:
@@ -292,14 +271,10 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
292
271
  * @param {*} [options] Override http request option.
293
272
  * @throws {RequiredError}
294
273
  */
295
- listProductDocuments: function (productSlug_1, authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
296
- var args_1 = [];
297
- for (var _i = 9; _i < arguments.length; _i++) {
298
- args_1[_i - 9] = arguments[_i];
299
- }
300
- return __awaiter(_this, __spreadArray([productSlug_1, authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1], args_1, true), void 0, function (productSlug, authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
274
+ listProductDocuments: function (productSlug, authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
275
+ if (options === void 0) { options = {}; }
276
+ return __awaiter(_this, void 0, void 0, function () {
301
277
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
302
- if (options === void 0) { options = {}; }
303
278
  return __generator(this, function (_a) {
304
279
  switch (_a.label) {
305
280
  case 0:
@@ -366,14 +341,10 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
366
341
  * @param {*} [options] Override http request option.
367
342
  * @throws {RequiredError}
368
343
  */
369
- uploadProductDocument: function (productSlug_1, uploadProductDocumentRequestDto_1, authorization_1) {
370
- var args_1 = [];
371
- for (var _i = 3; _i < arguments.length; _i++) {
372
- args_1[_i - 3] = arguments[_i];
373
- }
374
- return __awaiter(_this, __spreadArray([productSlug_1, uploadProductDocumentRequestDto_1, authorization_1], args_1, true), void 0, function (productSlug, uploadProductDocumentRequestDto, authorization, options) {
344
+ uploadProductDocument: function (productSlug, uploadProductDocumentRequestDto, authorization, options) {
345
+ if (options === void 0) { options = {}; }
346
+ return __awaiter(_this, void 0, void 0, function () {
375
347
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
376
- if (options === void 0) { options = {}; }
377
348
  return __generator(this, function (_a) {
378
349
  switch (_a.label) {
379
350
  case 0:
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -74,15 +74,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
- if (ar || !(i in from)) {
80
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
- ar[i] = from[i];
82
- }
83
- }
84
- return to.concat(ar || Array.prototype.slice.call(from));
85
- };
86
77
  var __importDefault = (this && this.__importDefault) || function (mod) {
87
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
88
79
  };
@@ -113,14 +104,10 @@ var SearchKeywordsApiAxiosParamCreator = function (configuration) {
113
104
  * @param {*} [options] Override http request option.
114
105
  * @throws {RequiredError}
115
106
  */
116
- listSearchKeywords: function (searchText_1, authorization_1) {
117
- var args_1 = [];
118
- for (var _i = 2; _i < arguments.length; _i++) {
119
- args_1[_i - 2] = arguments[_i];
120
- }
121
- return __awaiter(_this, __spreadArray([searchText_1, authorization_1], args_1, true), void 0, function (searchText, authorization, options) {
107
+ listSearchKeywords: function (searchText, authorization, options) {
108
+ if (options === void 0) { options = {}; }
109
+ return __awaiter(_this, void 0, void 0, function () {
122
110
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
123
- if (options === void 0) { options = {}; }
124
111
  return __generator(this, function (_a) {
125
112
  switch (_a.label) {
126
113
  case 0:
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -74,15 +74,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
- if (ar || !(i in from)) {
80
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
- ar[i] = from[i];
82
- }
83
- }
84
- return to.concat(ar || Array.prototype.slice.call(from));
85
- };
86
77
  var __importDefault = (this && this.__importDefault) || function (mod) {
87
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
88
79
  };
@@ -119,14 +110,10 @@ var SearchableDocumentOwnersApiAxiosParamCreator = function (configuration) {
119
110
  * @param {*} [options] Override http request option.
120
111
  * @throws {RequiredError}
121
112
  */
122
- listSearchableDocumentOwners: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
123
- var args_1 = [];
124
- for (var _i = 8; _i < arguments.length; _i++) {
125
- args_1[_i - 8] = arguments[_i];
126
- }
127
- return __awaiter(_this, __spreadArray([authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1], args_1, true), void 0, function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
113
+ listSearchableDocumentOwners: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
114
+ if (options === void 0) { options = {}; }
115
+ return __awaiter(_this, void 0, void 0, function () {
128
116
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
129
- if (options === void 0) { options = {}; }
130
117
  return __generator(this, function (_a) {
131
118
  switch (_a.label) {
132
119
  case 0:
@@ -28,7 +28,7 @@ export declare const SearchableDocumentsApiAxiosParamCreator: (configuration?: C
28
28
  * @param {*} [options] Override http request option.
29
29
  * @throws {RequiredError}
30
30
  */
31
- listSearchableDocuments: (searchText: string, ownerIds: string, authorization?: string, product?: "car" | "homeowner" | "household" | "privateLiability", options?: AxiosRequestConfig) => Promise<RequestArgs>;
31
+ listSearchableDocuments: (searchText: string, ownerIds: string, authorization?: string, product?: 'car' | 'homeowner' | 'household' | 'privateLiability', options?: AxiosRequestConfig) => Promise<RequestArgs>;
32
32
  };
33
33
  /**
34
34
  * SearchableDocumentsApi - functional programming interface
@@ -45,7 +45,7 @@ export declare const SearchableDocumentsApiFp: (configuration?: Configuration) =
45
45
  * @param {*} [options] Override http request option.
46
46
  * @throws {RequiredError}
47
47
  */
48
- listSearchableDocuments(searchText: string, ownerIds: string, authorization?: string, product?: "car" | "homeowner" | "household" | "privateLiability", options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListSearchableDocumentsResponseClass>>;
48
+ listSearchableDocuments(searchText: string, ownerIds: string, authorization?: string, product?: 'car' | 'homeowner' | 'household' | 'privateLiability', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListSearchableDocumentsResponseClass>>;
49
49
  };
50
50
  /**
51
51
  * SearchableDocumentsApi - factory interface
@@ -62,7 +62,7 @@ export declare const SearchableDocumentsApiFactory: (configuration?: Configurati
62
62
  * @param {*} [options] Override http request option.
63
63
  * @throws {RequiredError}
64
64
  */
65
- listSearchableDocuments(searchText: string, ownerIds: string, authorization?: string, product?: "car" | "homeowner" | "household" | "privateLiability", options?: any): AxiosPromise<ListSearchableDocumentsResponseClass>;
65
+ listSearchableDocuments(searchText: string, ownerIds: string, authorization?: string, product?: 'car' | 'homeowner' | 'household' | 'privateLiability', options?: any): AxiosPromise<ListSearchableDocumentsResponseClass>;
66
66
  };
67
67
  /**
68
68
  * Request parameters for listSearchableDocuments operation in SearchableDocumentsApi.
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -74,15 +74,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
- if (ar || !(i in from)) {
80
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
- ar[i] = from[i];
82
- }
83
- }
84
- return to.concat(ar || Array.prototype.slice.call(from));
85
- };
86
77
  var __importDefault = (this && this.__importDefault) || function (mod) {
87
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
88
79
  };
@@ -115,14 +106,10 @@ var SearchableDocumentsApiAxiosParamCreator = function (configuration) {
115
106
  * @param {*} [options] Override http request option.
116
107
  * @throws {RequiredError}
117
108
  */
118
- listSearchableDocuments: function (searchText_1, ownerIds_1, authorization_1, product_1) {
119
- var args_1 = [];
120
- for (var _i = 4; _i < arguments.length; _i++) {
121
- args_1[_i - 4] = arguments[_i];
122
- }
123
- return __awaiter(_this, __spreadArray([searchText_1, ownerIds_1, authorization_1, product_1], args_1, true), void 0, function (searchText, ownerIds, authorization, product, options) {
109
+ listSearchableDocuments: function (searchText, ownerIds, authorization, product, options) {
110
+ if (options === void 0) { options = {}; }
111
+ return __awaiter(_this, void 0, void 0, function () {
124
112
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
125
- if (options === void 0) { options = {}; }
126
113
  return __generator(this, function (_a) {
127
114
  switch (_a.label) {
128
115
  case 0:
package/dist/base.d.ts CHANGED
@@ -26,6 +26,14 @@ export interface LoginClass {
26
26
  accessToken: string;
27
27
  permissions: string;
28
28
  }
29
+ export interface SwitchWorkspaceRequest {
30
+ username: string;
31
+ targetWorkspace: string;
32
+ }
33
+ export interface SwitchWorkspaceResponseClass {
34
+ accessToken: string;
35
+ permissions: string;
36
+ }
29
37
  export declare enum Environment {
30
38
  Production = "https://apiv2.emil.de",
31
39
  Test = "https://apiv2-test.emil.de",
@@ -55,12 +63,13 @@ export declare class BaseAPI {
55
63
  private username?;
56
64
  private password?;
57
65
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
58
- initialize(env?: Environment): Promise<void>;
66
+ initialize(env?: Environment, targetWorkspace?: string): Promise<void>;
59
67
  private loadCredentials;
60
68
  private readConfigFile;
61
69
  private readEnvVariables;
62
70
  selectEnvironment(env: Environment): void;
63
- authorize(username: string, password: string): Promise<void>;
71
+ authorize(username: string, password: string, targetWorkspace?: string): Promise<void>;
72
+ switchWorkspace(targetWorkspace: string): Promise<void>;
64
73
  refreshTokenInternal(): Promise<string>;
65
74
  private extractRefreshToken;
66
75
  getConfiguration(): Configuration;
package/dist/base.js CHANGED
@@ -54,23 +54,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
54
54
  }) : function(o, v) {
55
55
  o["default"] = v;
56
56
  });
57
- var __importStar = (this && this.__importStar) || (function () {
58
- var ownKeys = function(o) {
59
- ownKeys = Object.getOwnPropertyNames || function (o) {
60
- var ar = [];
61
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
62
- return ar;
63
- };
64
- return ownKeys(o);
65
- };
66
- return function (mod) {
67
- if (mod && mod.__esModule) return mod;
68
- var result = {};
69
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
70
- __setModuleDefault(result, mod);
71
- return result;
72
- };
73
- })();
57
+ var __importStar = (this && this.__importStar) || function (mod) {
58
+ if (mod && mod.__esModule) return mod;
59
+ var result = {};
60
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
61
+ __setModuleDefault(result, mod);
62
+ return result;
63
+ };
74
64
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
75
65
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
66
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -81,8 +71,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
81
71
  });
82
72
  };
83
73
  var __generator = (this && this.__generator) || function (thisArg, body) {
84
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
85
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
74
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
75
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
86
76
  function verb(n) { return function (v) { return step([n, v]); }; }
87
77
  function step(op) {
88
78
  if (f) throw new TypeError("Generator is already executing.");
@@ -111,8 +101,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
111
101
  return (mod && mod.__esModule) ? mod : { "default": mod };
112
102
  };
113
103
  Object.defineProperty(exports, "__esModule", { value: true });
114
- exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
115
- exports.resetRetry = resetRetry;
104
+ exports.RequiredError = exports.BaseAPI = exports.resetRetry = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
116
105
  var configuration_1 = require("./configuration");
117
106
  // Some imports not used depending on template conditions
118
107
  // @ts-ignore
@@ -143,12 +132,13 @@ var Environment;
143
132
  Environment["Staging"] = "https://apiv2-staging.emil.de";
144
133
  Environment["Development"] = "https://apiv2-dev.emil.de";
145
134
  Environment["ProductionZurich"] = "https://eu-central-2.apiv2.emil.de";
146
- })(Environment || (exports.Environment = Environment = {}));
135
+ })(Environment = exports.Environment || (exports.Environment = {}));
147
136
  var _retry_count = 0;
148
137
  var _retry = null;
149
138
  function resetRetry() {
150
139
  _retry_count = 0;
151
140
  }
141
+ exports.resetRetry = resetRetry;
152
142
  var NETWORK_ERROR_MESSAGE = "Network Error";
153
143
  /**
154
144
  *
@@ -172,9 +162,9 @@ var BaseAPI = /** @class */ (function () {
172
162
  }
173
163
  this.attachInterceptor(axios);
174
164
  }
175
- BaseAPI.prototype.initialize = function () {
176
- return __awaiter(this, arguments, void 0, function (env) {
177
- if (env === void 0) { env = Environment.Production; }
165
+ BaseAPI.prototype.initialize = function (env, targetWorkspace) {
166
+ if (env === void 0) { env = Environment.Production; }
167
+ return __awaiter(this, void 0, void 0, function () {
178
168
  return __generator(this, function (_a) {
179
169
  switch (_a.label) {
180
170
  case 0:
@@ -183,7 +173,7 @@ var BaseAPI = /** @class */ (function () {
183
173
  case 1:
184
174
  _a.sent();
185
175
  if (!this.username) return [3 /*break*/, 3];
186
- return [4 /*yield*/, this.authorize(this.username, this.password)];
176
+ return [4 /*yield*/, this.authorize(this.username, this.password, targetWorkspace)];
187
177
  case 2:
188
178
  _a.sent();
189
179
  this.password = null; // to avoid keeping password loaded in memory.
@@ -253,7 +243,7 @@ var BaseAPI = /** @class */ (function () {
253
243
  BaseAPI.prototype.selectEnvironment = function (env) {
254
244
  this.configuration.basePath = env;
255
245
  };
256
- BaseAPI.prototype.authorize = function (username, password) {
246
+ BaseAPI.prototype.authorize = function (username, password, targetWorkspace) {
257
247
  return __awaiter(this, void 0, void 0, function () {
258
248
  var options, response, accessToken, refreshToken;
259
249
  return __generator(this, function (_a) {
@@ -277,6 +267,45 @@ var BaseAPI = /** @class */ (function () {
277
267
  this.configuration.accessToken = "Bearer ".concat(accessToken);
278
268
  refreshToken = this.extractRefreshToken(response);
279
269
  this.configuration.refreshToken = refreshToken;
270
+ if (!targetWorkspace) return [3 /*break*/, 3];
271
+ return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
272
+ case 2:
273
+ _a.sent();
274
+ _a.label = 3;
275
+ case 3: return [2 /*return*/];
276
+ }
277
+ });
278
+ });
279
+ };
280
+ BaseAPI.prototype.switchWorkspace = function (targetWorkspace) {
281
+ return __awaiter(this, void 0, void 0, function () {
282
+ var options, response, accessToken, refreshToken;
283
+ return __generator(this, function (_a) {
284
+ switch (_a.label) {
285
+ case 0:
286
+ options = {
287
+ method: 'POST',
288
+ url: "".concat(this.configuration.basePath, "/authservice/v1/workspaces/switch"),
289
+ headers: {
290
+ 'Content-Type': 'application/json',
291
+ 'Authorization': "Bearer ".concat(this.configuration.accessToken),
292
+ 'Cookie': this.configuration.refreshToken,
293
+ },
294
+ data: {
295
+ username: this.configuration.username,
296
+ targetWorkspace: targetWorkspace,
297
+ },
298
+ withCredentials: true,
299
+ };
300
+ return [4 /*yield*/, axios_1.default.request(options)];
301
+ case 1:
302
+ response = _a.sent();
303
+ accessToken = response.data.accessToken;
304
+ this.configuration.accessToken = "Bearer ".concat(accessToken);
305
+ refreshToken = this.extractRefreshToken(response);
306
+ if (refreshToken) {
307
+ this.configuration.refreshToken = refreshToken;
308
+ }
280
309
  return [2 /*return*/];
281
310
  }
282
311
  });
package/dist/common.d.ts CHANGED
@@ -63,7 +63,7 @@ export declare const toPathString: (url: URL) => string;
63
63
  *
64
64
  * @export
65
65
  */
66
- export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
66
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
67
67
  /**
68
68
  * EMIL DocumentService
69
69
  * The EMIL DocumentService API description
package/dist/common.js CHANGED
@@ -33,8 +33,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  });
34
34
  };
35
35
  var __generator = (this && this.__generator) || function (thisArg, body) {
36
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
37
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
38
  function verb(n) { return function (v) { return step([n, v]); }; }
39
39
  function step(op) {
40
40
  if (f) throw new TypeError("Generator is already executing.");