@emilgroup/document-sdk-node 1.0.0 → 1.1.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 (66) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +2 -2
  3. package/api/document-templates-api.ts +4 -2
  4. package/api/documents-api.ts +213 -4
  5. package/api/search-keywords-api.ts +164 -0
  6. package/api/searchable-document-owners-api.ts +18 -18
  7. package/api.ts +2 -5
  8. package/base.ts +271 -242
  9. package/common.ts +61 -0
  10. package/dist/api/document-templates-api.d.ts +4 -3
  11. package/dist/api/document-templates-api.js +1 -1
  12. package/dist/api/documents-api.d.ts +113 -4
  13. package/dist/api/documents-api.js +188 -5
  14. package/dist/api/layouts-api.js +1 -1
  15. package/dist/api/search-keywords-api.d.ts +92 -0
  16. package/dist/api/search-keywords-api.js +225 -0
  17. package/dist/api/searchable-document-owners-api.d.ts +15 -15
  18. package/dist/api/searchable-document-owners-api.js +9 -9
  19. package/dist/api/searchable-documents-api.js +1 -1
  20. package/dist/api.d.ts +1 -4
  21. package/dist/api.js +1 -6
  22. package/dist/base.d.ts +5 -4
  23. package/dist/base.js +42 -13
  24. package/dist/common.d.ts +26 -0
  25. package/dist/common.js +35 -2
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +2 -1
  28. package/dist/models/create-doc-template-request-dto.d.ts +9 -3
  29. package/dist/models/create-doc-template-response-class.d.ts +25 -0
  30. package/dist/models/create-doc-template-response-class.js +15 -0
  31. package/dist/models/create-document-request-dto.d.ts +16 -4
  32. package/dist/models/create-html-template-dto.d.ts +1 -1
  33. package/dist/models/create-presigned-post-request-dto.d.ts +33 -9
  34. package/dist/models/doc-template-class.d.ts +24 -18
  35. package/dist/models/document-class.d.ts +17 -5
  36. package/dist/models/get-signed-s3-key-url-response-class.d.ts +24 -0
  37. package/dist/models/get-signed-s3-key-url-response-class.js +15 -0
  38. package/dist/models/html-template-class.d.ts +8 -8
  39. package/dist/models/index.d.ts +6 -0
  40. package/dist/models/index.js +6 -0
  41. package/dist/models/layout-class.d.ts +10 -10
  42. package/dist/models/list-search-keywords-request-dto.d.ts +24 -0
  43. package/dist/models/list-search-keywords-request-dto.js +15 -0
  44. package/dist/models/list-search-keywords-response-class.d.ts +24 -0
  45. package/dist/models/list-search-keywords-response-class.js +15 -0
  46. package/dist/models/list-searchable-documents-response-class.d.ts +1 -1
  47. package/dist/models/update-doc-template-request-dto.d.ts +12 -6
  48. package/dist/models/update-document-request-dto.d.ts +6 -0
  49. package/index.ts +1 -1
  50. package/models/create-doc-template-request-dto.ts +9 -3
  51. package/models/create-doc-template-response-class.ts +31 -0
  52. package/models/create-document-request-dto.ts +12 -0
  53. package/models/create-html-template-dto.ts +1 -1
  54. package/models/create-presigned-post-request-dto.ts +31 -7
  55. package/models/doc-template-class.ts +24 -18
  56. package/models/document-class.ts +14 -2
  57. package/models/get-signed-s3-key-url-response-class.ts +30 -0
  58. package/models/html-template-class.ts +7 -7
  59. package/models/index.ts +6 -0
  60. package/models/layout-class.ts +10 -10
  61. package/models/list-search-keywords-request-dto.ts +30 -0
  62. package/models/list-search-keywords-response-class.ts +30 -0
  63. package/models/list-searchable-documents-response-class.ts +1 -1
  64. package/models/update-doc-template-request-dto.ts +12 -6
  65. package/models/update-document-request-dto.ts +6 -0
  66. package/package.json +2 -2
@@ -0,0 +1,225 @@
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
+ *
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
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
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;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.SearchKeywordsApi = exports.SearchKeywordsApiFactory = exports.SearchKeywordsApiFp = exports.SearchKeywordsApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
92
+ /**
93
+ * SearchKeywordsApi - axios parameter creator
94
+ * @export
95
+ */
96
+ var SearchKeywordsApiAxiosParamCreator = function (configuration) {
97
+ var _this = this;
98
+ return {
99
+ /**
100
+ *
101
+ * @param {string} searchText Text to search in the documents
102
+ * @param {string} [authorization] Bearer Token
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ listSearchKeywords: function (searchText, authorization, options) {
107
+ if (options === void 0) { options = {}; }
108
+ return __awaiter(_this, void 0, void 0, function () {
109
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0:
113
+ // verify required parameter 'searchText' is not null or undefined
114
+ (0, common_1.assertParamExists)('listSearchKeywords', 'searchText', searchText);
115
+ localVarPath = "/documentservice/v1/search-keywords";
116
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
117
+ if (configuration) {
118
+ baseOptions = configuration.baseOptions;
119
+ baseAccessToken = configuration.accessToken;
120
+ }
121
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
122
+ localVarHeaderParameter = {};
123
+ localVarQueryParameter = {};
124
+ // authentication bearer required
125
+ // http bearer authentication required
126
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
127
+ case 1:
128
+ // authentication bearer required
129
+ // http bearer authentication required
130
+ _a.sent();
131
+ if (searchText !== undefined) {
132
+ localVarQueryParameter['searchText'] = searchText;
133
+ }
134
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
135
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
136
+ }
137
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
138
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
139
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
140
+ return [2 /*return*/, {
141
+ url: (0, common_1.toPathString)(localVarUrlObj),
142
+ options: localVarRequestOptions,
143
+ }];
144
+ }
145
+ });
146
+ });
147
+ },
148
+ };
149
+ };
150
+ exports.SearchKeywordsApiAxiosParamCreator = SearchKeywordsApiAxiosParamCreator;
151
+ /**
152
+ * SearchKeywordsApi - functional programming interface
153
+ * @export
154
+ */
155
+ var SearchKeywordsApiFp = function (configuration) {
156
+ var localVarAxiosParamCreator = (0, exports.SearchKeywordsApiAxiosParamCreator)(configuration);
157
+ return {
158
+ /**
159
+ *
160
+ * @param {string} searchText Text to search in the documents
161
+ * @param {string} [authorization] Bearer Token
162
+ * @param {*} [options] Override http request option.
163
+ * @throws {RequiredError}
164
+ */
165
+ listSearchKeywords: function (searchText, authorization, options) {
166
+ return __awaiter(this, void 0, void 0, function () {
167
+ var localVarAxiosArgs;
168
+ return __generator(this, function (_a) {
169
+ switch (_a.label) {
170
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listSearchKeywords(searchText, authorization, options)];
171
+ case 1:
172
+ localVarAxiosArgs = _a.sent();
173
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
174
+ }
175
+ });
176
+ });
177
+ },
178
+ };
179
+ };
180
+ exports.SearchKeywordsApiFp = SearchKeywordsApiFp;
181
+ /**
182
+ * SearchKeywordsApi - factory interface
183
+ * @export
184
+ */
185
+ var SearchKeywordsApiFactory = function (configuration, basePath, axios) {
186
+ var localVarFp = (0, exports.SearchKeywordsApiFp)(configuration);
187
+ return {
188
+ /**
189
+ *
190
+ * @param {string} searchText Text to search in the documents
191
+ * @param {string} [authorization] Bearer Token
192
+ * @param {*} [options] Override http request option.
193
+ * @throws {RequiredError}
194
+ */
195
+ listSearchKeywords: function (searchText, authorization, options) {
196
+ return localVarFp.listSearchKeywords(searchText, authorization, options).then(function (request) { return request(axios, basePath); });
197
+ },
198
+ };
199
+ };
200
+ exports.SearchKeywordsApiFactory = SearchKeywordsApiFactory;
201
+ /**
202
+ * SearchKeywordsApi - object-oriented interface
203
+ * @export
204
+ * @class SearchKeywordsApi
205
+ * @extends {BaseAPI}
206
+ */
207
+ var SearchKeywordsApi = /** @class */ (function (_super) {
208
+ __extends(SearchKeywordsApi, _super);
209
+ function SearchKeywordsApi() {
210
+ return _super !== null && _super.apply(this, arguments) || this;
211
+ }
212
+ /**
213
+ *
214
+ * @param {SearchKeywordsApiListSearchKeywordsRequest} requestParameters Request parameters.
215
+ * @param {*} [options] Override http request option.
216
+ * @throws {RequiredError}
217
+ * @memberof SearchKeywordsApi
218
+ */
219
+ SearchKeywordsApi.prototype.listSearchKeywords = function (requestParameters, options) {
220
+ var _this = this;
221
+ return (0, exports.SearchKeywordsApiFp)(this.configuration).listSearchKeywords(requestParameters.searchText, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
222
+ };
223
+ return SearchKeywordsApi;
224
+ }(base_1.BaseAPI));
225
+ exports.SearchKeywordsApi = SearchKeywordsApi;
@@ -30,7 +30,7 @@ export declare const SearchableDocumentOwnersApiAxiosParamCreator: (configuratio
30
30
  * @param {*} [options] Override http request option.
31
31
  * @throws {RequiredError}
32
32
  */
33
- listSearchableDocuments: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
33
+ listSearchableDocumentOwners: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
34
34
  };
35
35
  /**
36
36
  * SearchableDocumentOwnersApi - functional programming interface
@@ -49,7 +49,7 @@ export declare const SearchableDocumentOwnersApiFp: (configuration?: Configurati
49
49
  * @param {*} [options] Override http request option.
50
50
  * @throws {RequiredError}
51
51
  */
52
- listSearchableDocuments(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListSearchableDocumentOwnersResponseClass>>;
52
+ listSearchableDocumentOwners(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListSearchableDocumentOwnersResponseClass>>;
53
53
  };
54
54
  /**
55
55
  * SearchableDocumentOwnersApi - factory interface
@@ -68,54 +68,54 @@ export declare const SearchableDocumentOwnersApiFactory: (configuration?: Config
68
68
  * @param {*} [options] Override http request option.
69
69
  * @throws {RequiredError}
70
70
  */
71
- listSearchableDocuments(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListSearchableDocumentOwnersResponseClass>;
71
+ listSearchableDocumentOwners(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListSearchableDocumentOwnersResponseClass>;
72
72
  };
73
73
  /**
74
- * Request parameters for listSearchableDocuments operation in SearchableDocumentOwnersApi.
74
+ * Request parameters for listSearchableDocumentOwners operation in SearchableDocumentOwnersApi.
75
75
  * @export
76
- * @interface SearchableDocumentOwnersApiListSearchableDocumentsRequest
76
+ * @interface SearchableDocumentOwnersApiListSearchableDocumentOwnersRequest
77
77
  */
78
- export interface SearchableDocumentOwnersApiListSearchableDocumentsRequest {
78
+ export interface SearchableDocumentOwnersApiListSearchableDocumentOwnersRequest {
79
79
  /**
80
80
  * Bearer Token
81
81
  * @type {string}
82
- * @memberof SearchableDocumentOwnersApiListSearchableDocuments
82
+ * @memberof SearchableDocumentOwnersApiListSearchableDocumentOwners
83
83
  */
84
84
  readonly authorization?: string;
85
85
  /**
86
86
  * Page size
87
87
  * @type {number}
88
- * @memberof SearchableDocumentOwnersApiListSearchableDocuments
88
+ * @memberof SearchableDocumentOwnersApiListSearchableDocumentOwners
89
89
  */
90
90
  readonly pageSize?: number;
91
91
  /**
92
92
  * Page token
93
93
  * @type {string}
94
- * @memberof SearchableDocumentOwnersApiListSearchableDocuments
94
+ * @memberof SearchableDocumentOwnersApiListSearchableDocumentOwners
95
95
  */
96
96
  readonly pageToken?: string;
97
97
  /**
98
98
  * List filter
99
99
  * @type {string}
100
- * @memberof SearchableDocumentOwnersApiListSearchableDocuments
100
+ * @memberof SearchableDocumentOwnersApiListSearchableDocumentOwners
101
101
  */
102
102
  readonly filter?: string;
103
103
  /**
104
104
  * Search query
105
105
  * @type {string}
106
- * @memberof SearchableDocumentOwnersApiListSearchableDocuments
106
+ * @memberof SearchableDocumentOwnersApiListSearchableDocumentOwners
107
107
  */
108
108
  readonly search?: string;
109
109
  /**
110
110
  * Ordering criteria
111
111
  * @type {string}
112
- * @memberof SearchableDocumentOwnersApiListSearchableDocuments
112
+ * @memberof SearchableDocumentOwnersApiListSearchableDocumentOwners
113
113
  */
114
114
  readonly order?: string;
115
115
  /**
116
116
  * Extra fields to fetch
117
117
  * @type {string}
118
- * @memberof SearchableDocumentOwnersApiListSearchableDocuments
118
+ * @memberof SearchableDocumentOwnersApiListSearchableDocumentOwners
119
119
  */
120
120
  readonly expand?: string;
121
121
  }
@@ -128,10 +128,10 @@ export interface SearchableDocumentOwnersApiListSearchableDocumentsRequest {
128
128
  export declare class SearchableDocumentOwnersApi extends BaseAPI {
129
129
  /**
130
130
  *
131
- * @param {SearchableDocumentOwnersApiListSearchableDocumentsRequest} requestParameters Request parameters.
131
+ * @param {SearchableDocumentOwnersApiListSearchableDocumentOwnersRequest} requestParameters Request parameters.
132
132
  * @param {*} [options] Override http request option.
133
133
  * @throws {RequiredError}
134
134
  * @memberof SearchableDocumentOwnersApi
135
135
  */
136
- listSearchableDocuments(requestParameters?: SearchableDocumentOwnersApiListSearchableDocumentsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListSearchableDocumentOwnersResponseClass, any>>;
136
+ listSearchableDocumentOwners(requestParameters?: SearchableDocumentOwnersApiListSearchableDocumentOwnersRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListSearchableDocumentOwnersResponseClass, any>>;
137
137
  }
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
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.");
56
- while (_) try {
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
57
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
58
  if (y = 0, t) op = [op[0] & 2, t.value];
59
59
  switch (op[0]) {
@@ -108,7 +108,7 @@ var SearchableDocumentOwnersApiAxiosParamCreator = function (configuration) {
108
108
  * @param {*} [options] Override http request option.
109
109
  * @throws {RequiredError}
110
110
  */
111
- listSearchableDocuments: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
111
+ listSearchableDocumentOwners: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
112
112
  if (options === void 0) { options = {}; }
113
113
  return __awaiter(_this, void 0, void 0, function () {
114
114
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
@@ -185,12 +185,12 @@ var SearchableDocumentOwnersApiFp = function (configuration) {
185
185
  * @param {*} [options] Override http request option.
186
186
  * @throws {RequiredError}
187
187
  */
188
- listSearchableDocuments: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
188
+ listSearchableDocumentOwners: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
189
189
  return __awaiter(this, void 0, void 0, function () {
190
190
  var localVarAxiosArgs;
191
191
  return __generator(this, function (_a) {
192
192
  switch (_a.label) {
193
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listSearchableDocuments(authorization, pageSize, pageToken, filter, search, order, expand, options)];
193
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listSearchableDocumentOwners(authorization, pageSize, pageToken, filter, search, order, expand, options)];
194
194
  case 1:
195
195
  localVarAxiosArgs = _a.sent();
196
196
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -220,8 +220,8 @@ var SearchableDocumentOwnersApiFactory = function (configuration, basePath, axio
220
220
  * @param {*} [options] Override http request option.
221
221
  * @throws {RequiredError}
222
222
  */
223
- listSearchableDocuments: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
224
- return localVarFp.listSearchableDocuments(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
223
+ listSearchableDocumentOwners: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
224
+ return localVarFp.listSearchableDocumentOwners(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
225
225
  },
226
226
  };
227
227
  };
@@ -239,15 +239,15 @@ var SearchableDocumentOwnersApi = /** @class */ (function (_super) {
239
239
  }
240
240
  /**
241
241
  *
242
- * @param {SearchableDocumentOwnersApiListSearchableDocumentsRequest} requestParameters Request parameters.
242
+ * @param {SearchableDocumentOwnersApiListSearchableDocumentOwnersRequest} requestParameters Request parameters.
243
243
  * @param {*} [options] Override http request option.
244
244
  * @throws {RequiredError}
245
245
  * @memberof SearchableDocumentOwnersApi
246
246
  */
247
- SearchableDocumentOwnersApi.prototype.listSearchableDocuments = function (requestParameters, options) {
247
+ SearchableDocumentOwnersApi.prototype.listSearchableDocumentOwners = function (requestParameters, options) {
248
248
  var _this = this;
249
249
  if (requestParameters === void 0) { requestParameters = {}; }
250
- return (0, exports.SearchableDocumentOwnersApiFp)(this.configuration).listSearchableDocuments(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
250
+ return (0, exports.SearchableDocumentOwnersApiFp)(this.configuration).listSearchableDocumentOwners(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
251
251
  };
252
252
  return SearchableDocumentOwnersApi;
253
253
  }(base_1.BaseAPI));
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
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.");
56
- while (_) try {
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
57
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
58
  if (y = 0, t) op = [op[0] & 2, t.value];
59
59
  switch (op[0]) {
package/dist/api.d.ts CHANGED
@@ -12,9 +12,6 @@
12
12
  export * from './api/document-templates-api';
13
13
  export * from './api/documents-api';
14
14
  export * from './api/layouts-api';
15
+ export * from './api/search-keywords-api';
15
16
  export * from './api/searchable-document-owners-api';
16
17
  export * from './api/searchable-documents-api';
17
- export declare enum Environment {
18
- Production = "https://apiv2.emil.de",
19
- Test = "https://apiv2-test.emil.de"
20
- }
package/dist/api.js CHANGED
@@ -27,14 +27,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
27
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.Environment = void 0;
31
30
  __exportStar(require("./api/document-templates-api"), exports);
32
31
  __exportStar(require("./api/documents-api"), exports);
33
32
  __exportStar(require("./api/layouts-api"), exports);
33
+ __exportStar(require("./api/search-keywords-api"), exports);
34
34
  __exportStar(require("./api/searchable-document-owners-api"), exports);
35
35
  __exportStar(require("./api/searchable-documents-api"), exports);
36
- var Environment;
37
- (function (Environment) {
38
- Environment["Production"] = "https://apiv2.emil.de";
39
- Environment["Test"] = "https://apiv2-test.emil.de";
40
- })(Environment = exports.Environment || (exports.Environment = {}));
package/dist/base.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * EMIL AccountService
3
- * The EMIL AccountService API description
2
+ * EMIL DocumentService
3
+ * The EMIL DocumentService API description
4
4
  *
5
5
  * The version of the OpenAPI document: 1.0
6
6
  *
@@ -25,12 +25,13 @@ export declare const COLLECTION_FORMATS: {
25
25
  export interface LoginClass {
26
26
  accessToken: string;
27
27
  permissions: Array<string>;
28
- newPasswordRequired: boolean;
29
28
  }
30
29
  export declare enum Environment {
31
30
  Production = "https://apiv2.emil.de",
32
- Test = "https://apiv2-test.emil.de"
31
+ Test = "https://apiv2-test.emil.de",
32
+ Development = "https://apiv2-dev.emil.de"
33
33
  }
34
+ export declare function resetRetry(): void;
34
35
  /**
35
36
  *
36
37
  * @export
package/dist/base.js CHANGED
@@ -2,8 +2,8 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  /**
5
- * EMIL AccountService
6
- * The EMIL AccountService API description
5
+ * EMIL DocumentService
6
+ * The EMIL DocumentService API description
7
7
  *
8
8
  * The version of the OpenAPI document: 1.0
9
9
  *
@@ -76,7 +76,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
76
76
  function verb(n) { return function (v) { return step([n, v]); }; }
77
77
  function step(op) {
78
78
  if (f) throw new TypeError("Generator is already executing.");
79
- while (_) try {
79
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
80
80
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
81
81
  if (y = 0, t) op = [op[0] & 2, t.value];
82
82
  switch (op[0]) {
@@ -101,7 +101,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
101
101
  return (mod && mod.__esModule) ? mod : { "default": mod };
102
102
  };
103
103
  Object.defineProperty(exports, "__esModule", { value: true });
104
- exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
104
+ exports.RequiredError = exports.BaseAPI = exports.resetRetry = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
105
105
  var configuration_1 = require("./configuration");
106
106
  // Some imports not used depending on template conditions
107
107
  // @ts-ignore
@@ -129,7 +129,15 @@ var Environment;
129
129
  (function (Environment) {
130
130
  Environment["Production"] = "https://apiv2.emil.de";
131
131
  Environment["Test"] = "https://apiv2-test.emil.de";
132
+ Environment["Development"] = "https://apiv2-dev.emil.de";
132
133
  })(Environment = exports.Environment || (exports.Environment = {}));
134
+ var _retry_count = 0;
135
+ var _retry = null;
136
+ function resetRetry() {
137
+ _retry_count = 0;
138
+ }
139
+ exports.resetRetry = resetRetry;
140
+ var NETWORK_ERROR_MESSAGE = "Network Error";
133
141
  /**
134
142
  *
135
143
  * @export
@@ -191,7 +199,7 @@ var BaseAPI = /** @class */ (function () {
191
199
  case 3:
192
200
  this.readEnvVariables();
193
201
  if (!this.username) {
194
- console.info("No credentials found in credentials file or environment variables. Either provide some or use \n authorize() function.");
202
+ console.info("No credentials found in credentials file or environment variables. Either provide some or use \n authorize() function.");
195
203
  }
196
204
  return [2 /*return*/];
197
205
  }
@@ -253,9 +261,9 @@ var BaseAPI = /** @class */ (function () {
253
261
  case 1:
254
262
  response = _a.sent();
255
263
  accessToken = response.data.accessToken;
256
- refreshToken = this.extractRefreshToken(response);
257
264
  this.configuration.username = username;
258
265
  this.configuration.accessToken = "Bearer ".concat(accessToken);
266
+ refreshToken = this.extractRefreshToken(response);
259
267
  this.configuration.refreshToken = refreshToken;
260
268
  return [2 /*return*/];
261
269
  }
@@ -305,7 +313,7 @@ var BaseAPI = /** @class */ (function () {
305
313
  axios.interceptors.response.use(function (res) {
306
314
  return res;
307
315
  }, function (err) { return __awaiter(_this, void 0, void 0, function () {
308
- var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1;
316
+ var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
309
317
  return __generator(this, function (_a) {
310
318
  switch (_a.label) {
311
319
  case 0:
@@ -320,11 +328,9 @@ var BaseAPI = /** @class */ (function () {
320
328
  case 2:
321
329
  tokenString = _a.sent();
322
330
  accessToken = "Bearer ".concat(tokenString);
323
- localVarHeaderParameter = {};
324
- localVarHeaderParameter['Authorization'] = accessToken;
325
- originalConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
331
+ originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
326
332
  this.configuration.accessToken = accessToken;
327
- return [2 /*return*/, axios(originalConfig)];
333
+ return [2 /*return*/, axios.request(originalConfig)];
328
334
  case 3:
329
335
  _error_1 = _a.sent();
330
336
  if (_error_1.response && _error_1.response.data) {
@@ -335,8 +341,31 @@ var BaseAPI = /** @class */ (function () {
335
341
  if (err.response.status === 403 && err.response.data) {
336
342
  return [2 /*return*/, Promise.reject(err.response.data)];
337
343
  }
338
- _a.label = 5;
339
- case 5: return [2 /*return*/, Promise.reject(err)];
344
+ return [3 /*break*/, 9];
345
+ case 5:
346
+ if (!(err.message === NETWORK_ERROR_MESSAGE
347
+ && err.isAxiosError
348
+ && originalConfig.headers.hasOwnProperty('Authorization')
349
+ && _retry_count < 4)) return [3 /*break*/, 9];
350
+ _retry_count++;
351
+ _a.label = 6;
352
+ case 6:
353
+ _a.trys.push([6, 8, , 9]);
354
+ return [4 /*yield*/, this.refreshToken()];
355
+ case 7:
356
+ tokenString = _a.sent();
357
+ accessToken = "Bearer ".concat(tokenString);
358
+ _retry = true;
359
+ originalConfig.headers['Authorization'] = accessToken;
360
+ this.configuration.accessToken = accessToken;
361
+ return [2 /*return*/, axios.request(__assign({}, originalConfig))];
362
+ case 8:
363
+ _error_2 = _a.sent();
364
+ if (_error_2.response && _error_2.response.data) {
365
+ return [2 /*return*/, Promise.reject(_error_2.response.data)];
366
+ }
367
+ return [2 /*return*/, Promise.reject(_error_2)];
368
+ case 9: return [2 /*return*/, Promise.reject(err)];
340
369
  }
341
370
  });
342
371
  }); });
package/dist/common.d.ts CHANGED
@@ -64,3 +64,29 @@ export declare const toPathString: (url: URL) => string;
64
64
  * @export
65
65
  */
66
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
+ /**
68
+ * EMIL DocumentService
69
+ * The EMIL DocumentService API description
70
+ *
71
+ * The version of the OpenAPI document: 1.0
72
+ *
73
+ *
74
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
75
+ * https://openapi-generator.tech
76
+ * Do not edit the class manually.
77
+ */
78
+ export interface IStorageConverter<D, SD> {
79
+ toStorageData(data: D): SD;
80
+ fromStorageData(storageData: SD): D;
81
+ }
82
+ export interface IStorage {
83
+ get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
84
+ set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
85
+ }
86
+ export declare class LocalStorage implements IStorage {
87
+ readonly storage: Storage;
88
+ constructor();
89
+ get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
90
+ set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
91
+ }
92
+ export declare const defaultStorage: () => IStorage;
package/dist/common.js CHANGED
@@ -38,7 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
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.");
41
- while (_) try {
41
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
42
42
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
43
  if (y = 0, t) op = [op[0] & 2, t.value];
44
44
  switch (op[0]) {
@@ -60,7 +60,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
60
60
  }
61
61
  };
62
62
  Object.defineProperty(exports, "__esModule", { value: true });
63
- exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
63
+ exports.defaultStorage = exports.LocalStorage = exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
64
64
  var base_1 = require("./base");
65
65
  var url_1 = require("url");
66
66
  /**
@@ -242,3 +242,36 @@ var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configu
242
242
  };
243
243
  };
244
244
  exports.createRequestFunction = createRequestFunction;
245
+ var LocalStorage = /** @class */ (function () {
246
+ function LocalStorage() {
247
+ this.storage = localStorage;
248
+ }
249
+ LocalStorage.prototype.get = function (key, converter) {
250
+ var jsonValue = this.storage.getItem(key);
251
+ if (jsonValue === null) {
252
+ return null;
253
+ }
254
+ var value = JSON.parse(jsonValue);
255
+ if (converter !== undefined) {
256
+ return converter.fromStorageData(value);
257
+ }
258
+ else {
259
+ return value;
260
+ }
261
+ };
262
+ LocalStorage.prototype.set = function (key, value, converter) {
263
+ var valueToStore = value;
264
+ if (converter !== undefined) {
265
+ valueToStore = converter.toStorageData(value);
266
+ }
267
+ var jsonValue = JSON.stringify(valueToStore);
268
+ this.storage.setItem(key, jsonValue);
269
+ };
270
+ return LocalStorage;
271
+ }());
272
+ exports.LocalStorage = LocalStorage;
273
+ var _defaultStorage = null;
274
+ var defaultStorage = function () {
275
+ return _defaultStorage || (_defaultStorage = new LocalStorage());
276
+ };
277
+ exports.defaultStorage = defaultStorage;