@emilgroup/account-sdk 1.0.2 → 1.4.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 (38) hide show
  1. package/.openapi-generator/FILES +1 -1
  2. package/README.md +11 -11
  3. package/api/accounts-api.ts +54 -44
  4. package/api.ts +0 -9
  5. package/base.ts +124 -65
  6. package/common.ts +61 -2
  7. package/configuration.ts +0 -8
  8. package/dist/api/accounts-api.d.ts +54 -45
  9. package/dist/api/accounts-api.js +76 -80
  10. package/dist/api.d.ts +0 -4
  11. package/dist/api.js +4 -21
  12. package/dist/base.d.ts +10 -6
  13. package/dist/base.js +105 -66
  14. package/dist/common.d.ts +26 -1
  15. package/dist/common.js +43 -22
  16. package/dist/configuration.d.ts +0 -7
  17. package/dist/configuration.js +0 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +8 -19
  20. package/dist/models/account-class.d.ts +31 -5
  21. package/dist/models/account-class.js +6 -0
  22. package/dist/models/create-account-request-dto.d.ts +40 -10
  23. package/dist/models/create-account-request-dto.js +10 -1
  24. package/dist/models/index.d.ts +1 -1
  25. package/dist/models/index.js +6 -24
  26. package/dist/models/policy-class.d.ts +30 -0
  27. package/dist/models/update-account-request-dto.d.ts +41 -17
  28. package/dist/models/update-account-request-dto.js +10 -1
  29. package/index.ts +1 -1
  30. package/models/account-class.ts +34 -5
  31. package/models/create-account-request-dto.ts +42 -10
  32. package/models/index.ts +1 -1
  33. package/models/policy-class.ts +36 -0
  34. package/models/update-account-request-dto.ts +43 -17
  35. package/package.json +3 -5
  36. package/dist/models/get-account-request-dto.d.ts +0 -30
  37. package/models/get-account-request-dto.ts +0 -36
  38. /package/dist/models/{get-account-request-dto.js → policy-class.js} +0 -0
package/dist/base.js CHANGED
@@ -16,12 +16,10 @@ var __extends = (this && this.__extends) || (function () {
16
16
  var extendStatics = function (d, b) {
17
17
  extendStatics = Object.setPrototypeOf ||
18
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]; };
19
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
20
20
  return extendStatics(d, b);
21
21
  };
22
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
23
  extendStatics(d, b);
26
24
  function __() { this.constructor = d; }
27
25
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -78,12 +76,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
78
76
  return (mod && mod.__esModule) ? mod : { "default": mod };
79
77
  };
80
78
  Object.defineProperty(exports, "__esModule", { value: true });
81
- exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
82
79
  var configuration_1 = require("./configuration");
80
+ var common_1 = require("./common");
83
81
  // Some imports not used depending on template conditions
84
82
  // @ts-ignore
85
83
  var axios_1 = __importDefault(require("axios"));
86
- exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
84
+ exports.BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
87
85
  /**
88
86
  *
89
87
  * @export
@@ -98,7 +96,16 @@ var Environment;
98
96
  (function (Environment) {
99
97
  Environment["Production"] = "https://apiv2.emil.de";
100
98
  Environment["Test"] = "https://apiv2-test.emil.de";
99
+ Environment["Development"] = "https://apiv2-dev.emil.de";
101
100
  })(Environment = exports.Environment || (exports.Environment = {}));
101
+ var _retry_count = 0;
102
+ var _retry = null;
103
+ function resetRetry() {
104
+ _retry_count = 0;
105
+ }
106
+ exports.resetRetry = resetRetry;
107
+ var NETWORK_ERROR_MESSAGE = "Network Error";
108
+ var TOKEN_DATA = 'APP_TOKEN';
102
109
  /**
103
110
  *
104
111
  * @export
@@ -108,72 +115,35 @@ var BaseAPI = /** @class */ (function () {
108
115
  function BaseAPI(configuration, basePath, axios) {
109
116
  if (basePath === void 0) { basePath = exports.BASE_PATH; }
110
117
  if (axios === void 0) { axios = axios_1.default; }
111
- var _this = this;
112
118
  this.basePath = basePath;
113
119
  this.axios = axios;
120
+ this.loadTokenData();
114
121
  if (configuration) {
115
122
  this.configuration = configuration;
116
123
  this.basePath = configuration.basePath || this.basePath;
117
124
  }
118
125
  else {
126
+ var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
119
127
  this.configuration = new configuration_1.Configuration({
120
128
  basePath: this.basePath,
129
+ accessToken: accessToken ? "Bearer " + accessToken : '',
130
+ username: username,
121
131
  });
122
132
  }
123
- axios.interceptors.response.use(function (res) {
124
- return res;
125
- }, function (err) { return __awaiter(_this, void 0, void 0, function () {
126
- var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1;
127
- return __generator(this, function (_a) {
128
- switch (_a.label) {
129
- case 0:
130
- originalConfig = err.config;
131
- if (!err.response) return [3 /*break*/, 5];
132
- if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
133
- originalConfig._retry = true;
134
- _a.label = 1;
135
- case 1:
136
- _a.trys.push([1, 3, , 4]);
137
- return [4 /*yield*/, this.refreshToken()];
138
- case 2:
139
- tokenString = _a.sent();
140
- accessToken = "Bearer ".concat(tokenString);
141
- localVarHeaderParameter = {};
142
- localVarHeaderParameter['Authorization'] = accessToken;
143
- originalConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
144
- this.configuration.accessToken = accessToken;
145
- return [2 /*return*/, axios(originalConfig)];
146
- case 3:
147
- _error_1 = _a.sent();
148
- if (_error_1.response && _error_1.response.data) {
149
- return [2 /*return*/, Promise.reject(_error_1.response.data)];
150
- }
151
- return [2 /*return*/, Promise.reject(_error_1)];
152
- case 4:
153
- if (err.response.status === 403 && err.response.data) {
154
- return [2 /*return*/, Promise.reject(err.response.data)];
155
- }
156
- _a.label = 5;
157
- case 5: return [2 /*return*/, Promise.reject(err)];
158
- }
159
- });
160
- }); });
133
+ this.attachInterceptor(axios);
161
134
  }
162
- BaseAPI.prototype.getConfiguration = function () {
163
- return this.configuration;
164
- };
165
135
  BaseAPI.prototype.selectEnvironment = function (env) {
166
136
  this.configuration.basePath = env;
167
137
  };
168
138
  BaseAPI.prototype.authorize = function (username, password) {
169
139
  return __awaiter(this, void 0, void 0, function () {
170
- var options, response, accessToken, refreshToken;
140
+ var options, response, accessToken;
171
141
  return __generator(this, function (_a) {
172
142
  switch (_a.label) {
173
143
  case 0:
174
144
  options = {
175
145
  method: 'POST',
176
- url: "".concat(Environment.Test, "/authservice/v1/login"),
146
+ url: this.configuration.basePath + "/authservice/v1/login",
177
147
  headers: { 'Content-Type': 'application/json' },
178
148
  data: {
179
149
  username: username,
@@ -185,49 +155,118 @@ var BaseAPI = /** @class */ (function () {
185
155
  case 1:
186
156
  response = _a.sent();
187
157
  accessToken = response.data.accessToken;
188
- refreshToken = this.extractRefreshToken(response);
189
158
  this.configuration.username = username;
190
- this.configuration.accessToken = "Bearer ".concat(accessToken);
191
- this.configuration.refreshToken = refreshToken;
159
+ this.configuration.accessToken = "Bearer " + accessToken;
160
+ this.tokenData.username = username;
161
+ this.tokenData.accessToken = accessToken;
162
+ this.storeTokenData(__assign({}, this.tokenData));
192
163
  return [2 /*return*/];
193
164
  }
194
165
  });
195
166
  });
196
167
  };
197
- BaseAPI.prototype.refreshToken = function () {
168
+ BaseAPI.prototype.refreshTokenInternal = function () {
198
169
  return __awaiter(this, void 0, void 0, function () {
199
- var _a, username, refreshToken, options, accessToken;
200
- return __generator(this, function (_b) {
201
- switch (_b.label) {
170
+ var username, options, accessToken;
171
+ return __generator(this, function (_a) {
172
+ switch (_a.label) {
202
173
  case 0:
203
- _a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
204
- if (!username || !refreshToken) {
174
+ username = this.configuration.username;
175
+ if (!username) {
205
176
  return [2 /*return*/, ''];
206
177
  }
207
178
  options = {
208
179
  method: 'POST',
209
- url: "".concat(Environment.Test, "/authservice/v1/refresh-token"),
180
+ url: this.configuration.basePath + "/authservice/v1/refresh-token",
210
181
  headers: {
211
182
  'Content-Type': 'application/json',
212
- Cookie: refreshToken,
213
183
  },
214
184
  data: { username: username },
215
185
  withCredentials: true,
216
186
  };
217
187
  return [4 /*yield*/, axios_1.default.request(options)];
218
188
  case 1:
219
- accessToken = (_b.sent()).data.accessToken;
189
+ accessToken = (_a.sent()).data.accessToken;
220
190
  return [2 /*return*/, accessToken];
221
191
  }
222
192
  });
223
193
  });
224
194
  };
225
- BaseAPI.prototype.extractRefreshToken = function (response) {
226
- if (response.headers && response.headers['set-cookie']
227
- && response.headers['set-cookie'].length > 0) {
228
- return "".concat(response.headers['set-cookie'][0].split(';')[0], ";");
195
+ BaseAPI.prototype.storeTokenData = function (tokenData) {
196
+ if (typeof window !== 'undefined') {
197
+ common_1.defaultStorage().set(TOKEN_DATA, tokenData);
198
+ }
199
+ };
200
+ BaseAPI.prototype.loadTokenData = function () {
201
+ if (typeof window !== 'undefined') {
202
+ this.tokenData = common_1.defaultStorage().get(TOKEN_DATA) || {};
229
203
  }
230
- return '';
204
+ };
205
+ BaseAPI.prototype.cleanTokenData = function () {
206
+ this.storeTokenData(null);
207
+ };
208
+ BaseAPI.prototype.attachInterceptor = function (axios) {
209
+ var _this = this;
210
+ axios.interceptors.response.use(function (res) {
211
+ return res;
212
+ }, function (err) { return __awaiter(_this, void 0, void 0, function () {
213
+ var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
214
+ return __generator(this, function (_a) {
215
+ switch (_a.label) {
216
+ case 0:
217
+ originalConfig = err.config;
218
+ if (!(err.response && !(err.response instanceof XMLHttpRequest))) return [3 /*break*/, 5];
219
+ if (!((err.response.status === 401 || err.response.status === 403)
220
+ && !originalConfig._retry)) return [3 /*break*/, 4];
221
+ originalConfig._retry = true;
222
+ _a.label = 1;
223
+ case 1:
224
+ _a.trys.push([1, 3, , 4]);
225
+ return [4 /*yield*/, this.refreshTokenInternal()];
226
+ case 2:
227
+ tokenString = _a.sent();
228
+ accessToken = "Bearer " + tokenString;
229
+ delete originalConfig.headers['Authorization'];
230
+ originalConfig.headers['Authorization'] = accessToken;
231
+ this.configuration.accessToken = accessToken;
232
+ this.tokenData.accessToken = tokenString;
233
+ this.storeTokenData(this.tokenData);
234
+ return [2 /*return*/, axios(originalConfig)];
235
+ case 3:
236
+ _error_1 = _a.sent();
237
+ if (_error_1.response && _error_1.response.data) {
238
+ return [2 /*return*/, Promise.reject(_error_1.response.data)];
239
+ }
240
+ return [2 /*return*/, Promise.reject(_error_1)];
241
+ case 4: return [3 /*break*/, 9];
242
+ case 5:
243
+ if (!(err.message === NETWORK_ERROR_MESSAGE
244
+ && originalConfig.headers.hasOwnProperty('Authorization')
245
+ && _retry_count < 4)) return [3 /*break*/, 9];
246
+ _retry_count++;
247
+ _a.label = 6;
248
+ case 6:
249
+ _a.trys.push([6, 8, , 9]);
250
+ return [4 /*yield*/, this.refreshTokenInternal()];
251
+ case 7:
252
+ tokenString = _a.sent();
253
+ accessToken = "Bearer " + tokenString;
254
+ _retry = true;
255
+ originalConfig.headers['Authorization'] = accessToken;
256
+ this.configuration.accessToken = accessToken;
257
+ this.tokenData.accessToken = tokenString;
258
+ this.storeTokenData(this.tokenData);
259
+ return [2 /*return*/, axios.request(__assign({}, originalConfig))];
260
+ case 8:
261
+ _error_2 = _a.sent();
262
+ if (_error_2.response && _error_2.response.data) {
263
+ return [2 /*return*/, Promise.reject(_error_2.response.data)];
264
+ }
265
+ return [2 /*return*/, Promise.reject(_error_2)];
266
+ case 9: return [2 /*return*/, Promise.reject(err)];
267
+ }
268
+ });
269
+ }); });
231
270
  };
232
271
  return BaseAPI;
233
272
  }());
package/dist/common.d.ts CHANGED
@@ -12,7 +12,6 @@
12
12
  import { Configuration } from "./configuration";
13
13
  import { RequestArgs } from "./base";
14
14
  import { AxiosInstance, AxiosResponse } from 'axios';
15
- import { URL } from 'url';
16
15
  /**
17
16
  *
18
17
  * @export
@@ -64,3 +63,29 @@ export declare const toPathString: (url: URL) => string;
64
63
  * @export
65
64
  */
66
65
  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>;
66
+ /**
67
+ * EMIL AccountService
68
+ * The EMIL AccountService API description
69
+ *
70
+ * The version of the OpenAPI document: 1.0
71
+ *
72
+ *
73
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
74
+ * https://openapi-generator.tech
75
+ * Do not edit the class manually.
76
+ */
77
+ export interface IStorageConverter<D, SD> {
78
+ toStorageData(data: D): SD;
79
+ fromStorageData(storageData: SD): D;
80
+ }
81
+ export interface IStorage {
82
+ get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
83
+ set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
84
+ }
85
+ export declare class LocalStorage implements IStorage {
86
+ readonly storage: Storage;
87
+ constructor();
88
+ get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
89
+ set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
90
+ }
91
+ export declare const defaultStorage: () => IStorage;
package/dist/common.js CHANGED
@@ -60,9 +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;
64
63
  var base_1 = require("./base");
65
- var url_1 = require("url");
66
64
  /**
67
65
  *
68
66
  * @export
@@ -73,17 +71,16 @@ exports.DUMMY_BASE_URL = 'https://example.com';
73
71
  * @throws {RequiredError}
74
72
  * @export
75
73
  */
76
- var assertParamExists = function (functionName, paramName, paramValue) {
74
+ exports.assertParamExists = function (functionName, paramName, paramValue) {
77
75
  if (paramValue === null || paramValue === undefined) {
78
- throw new base_1.RequiredError(paramName, "Required parameter ".concat(paramName, " was null or undefined when calling ").concat(functionName, "."));
76
+ throw new base_1.RequiredError(paramName, "Required parameter " + paramName + " was null or undefined when calling " + functionName + ".");
79
77
  }
80
78
  };
81
- exports.assertParamExists = assertParamExists;
82
79
  /**
83
80
  *
84
81
  * @export
85
82
  */
86
- var setApiKeyToObject = function (object, keyParamName, configuration) {
83
+ exports.setApiKeyToObject = function (object, keyParamName, configuration) {
87
84
  return __awaiter(this, void 0, void 0, function () {
88
85
  var localVarApiKeyValue, _a;
89
86
  return __generator(this, function (_b) {
@@ -108,22 +105,20 @@ var setApiKeyToObject = function (object, keyParamName, configuration) {
108
105
  });
109
106
  });
110
107
  };
111
- exports.setApiKeyToObject = setApiKeyToObject;
112
108
  /**
113
109
  *
114
110
  * @export
115
111
  */
116
- var setBasicAuthToObject = function (object, configuration) {
112
+ exports.setBasicAuthToObject = function (object, configuration) {
117
113
  if (configuration && (configuration.username || configuration.password)) {
118
114
  object["auth"] = { username: configuration.username, password: configuration.password };
119
115
  }
120
116
  };
121
- exports.setBasicAuthToObject = setBasicAuthToObject;
122
117
  /**
123
118
  *
124
119
  * @export
125
120
  */
126
- var setBearerAuthToObject = function (object, configuration) {
121
+ exports.setBearerAuthToObject = function (object, configuration) {
127
122
  return __awaiter(this, void 0, void 0, function () {
128
123
  var accessToken, _a;
129
124
  return __generator(this, function (_b) {
@@ -148,12 +143,11 @@ var setBearerAuthToObject = function (object, configuration) {
148
143
  });
149
144
  });
150
145
  };
151
- exports.setBearerAuthToObject = setBearerAuthToObject;
152
146
  /**
153
147
  *
154
148
  * @export
155
149
  */
156
- var setOAuthToObject = function (object, name, scopes, configuration) {
150
+ exports.setOAuthToObject = function (object, name, scopes, configuration) {
157
151
  return __awaiter(this, void 0, void 0, function () {
158
152
  var localVarAccessTokenValue, _a;
159
153
  return __generator(this, function (_b) {
@@ -178,17 +172,16 @@ var setOAuthToObject = function (object, name, scopes, configuration) {
178
172
  });
179
173
  });
180
174
  };
181
- exports.setOAuthToObject = setOAuthToObject;
182
175
  /**
183
176
  *
184
177
  * @export
185
178
  */
186
- var setSearchParams = function (url) {
179
+ exports.setSearchParams = function (url) {
187
180
  var objects = [];
188
181
  for (var _i = 1; _i < arguments.length; _i++) {
189
182
  objects[_i - 1] = arguments[_i];
190
183
  }
191
- var searchParams = new url_1.URLSearchParams(url.search);
184
+ var searchParams = new URLSearchParams(url.search);
192
185
  for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {
193
186
  var object = objects_1[_a];
194
187
  for (var key in object) {
@@ -206,12 +199,11 @@ var setSearchParams = function (url) {
206
199
  }
207
200
  url.search = searchParams.toString();
208
201
  };
209
- exports.setSearchParams = setSearchParams;
210
202
  /**
211
203
  *
212
204
  * @export
213
205
  */
214
- var serializeDataIfNeeded = function (value, requestOptions, configuration) {
206
+ exports.serializeDataIfNeeded = function (value, requestOptions, configuration) {
215
207
  var nonString = typeof value !== 'string';
216
208
  var needsSerialization = nonString && configuration && configuration.isJsonMime
217
209
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
@@ -220,20 +212,18 @@ var serializeDataIfNeeded = function (value, requestOptions, configuration) {
220
212
  ? JSON.stringify(value !== undefined ? value : {})
221
213
  : (value || "");
222
214
  };
223
- exports.serializeDataIfNeeded = serializeDataIfNeeded;
224
215
  /**
225
216
  *
226
217
  * @export
227
218
  */
228
- var toPathString = function (url) {
219
+ exports.toPathString = function (url) {
229
220
  return url.pathname + url.search + url.hash;
230
221
  };
231
- exports.toPathString = toPathString;
232
222
  /**
233
223
  *
234
224
  * @export
235
225
  */
236
- var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
226
+ exports.createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
237
227
  return function (axios, basePath) {
238
228
  if (axios === void 0) { axios = globalAxios; }
239
229
  if (basePath === void 0) { basePath = BASE_PATH; }
@@ -241,4 +231,35 @@ var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configu
241
231
  return axios.request(axiosRequestArgs);
242
232
  };
243
233
  };
244
- exports.createRequestFunction = createRequestFunction;
234
+ var LocalStorage = /** @class */ (function () {
235
+ function LocalStorage() {
236
+ this.storage = localStorage;
237
+ }
238
+ LocalStorage.prototype.get = function (key, converter) {
239
+ var jsonValue = this.storage.getItem(key);
240
+ if (jsonValue === null) {
241
+ return null;
242
+ }
243
+ var value = JSON.parse(jsonValue);
244
+ if (converter !== undefined) {
245
+ return converter.fromStorageData(value);
246
+ }
247
+ else {
248
+ return value;
249
+ }
250
+ };
251
+ LocalStorage.prototype.set = function (key, value, converter) {
252
+ var valueToStore = value;
253
+ if (converter !== undefined) {
254
+ valueToStore = converter.toStorageData(value);
255
+ }
256
+ var jsonValue = JSON.stringify(valueToStore);
257
+ this.storage.setItem(key, jsonValue);
258
+ };
259
+ return LocalStorage;
260
+ }());
261
+ exports.LocalStorage = LocalStorage;
262
+ var _defaultStorage = null;
263
+ exports.defaultStorage = function () {
264
+ return _defaultStorage || (_defaultStorage = new LocalStorage());
265
+ };
@@ -68,13 +68,6 @@ export declare class Configuration {
68
68
  * @type {new () => FormData}
69
69
  */
70
70
  formDataCtor?: new () => any;
71
- /**
72
- * parameter for automatically refreshing access token for oauth2 security
73
- *
74
- * @type {string}
75
- * @memberof Configuration
76
- */
77
- refreshToken?: string;
78
71
  constructor(param?: ConfigurationParameters);
79
72
  /**
80
73
  * Check if the given MIME is a JSON MIME.
@@ -13,7 +13,6 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.Configuration = void 0;
17
16
  var Configuration = /** @class */ (function () {
18
17
  function Configuration(param) {
19
18
  if (param === void 0) { param = {}; }
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- export { BaseAPI } from "./base";
12
+ export { Environment, BaseAPI } from "./base";
13
13
  export * from "./api";
14
14
  export * from "./configuration";
15
15
  export * from "./models";
package/dist/index.js CHANGED
@@ -12,24 +12,13 @@
12
12
  * https://openapi-generator.tech
13
13
  * Do not edit the class manually.
14
14
  */
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- var desc = Object.getOwnPropertyDescriptor(m, k);
18
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
- desc = { enumerable: true, get: function() { return m[k]; } };
20
- }
21
- Object.defineProperty(o, k2, desc);
22
- }) : (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- o[k2] = m[k];
25
- }));
26
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
- };
15
+ function __export(m) {
16
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
17
+ }
29
18
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.BaseAPI = void 0;
31
19
  var base_1 = require("./base");
32
- Object.defineProperty(exports, "BaseAPI", { enumerable: true, get: function () { return base_1.BaseAPI; } });
33
- __exportStar(require("./api"), exports);
34
- __exportStar(require("./configuration"), exports);
35
- __exportStar(require("./models"), exports);
20
+ exports.Environment = base_1.Environment;
21
+ exports.BaseAPI = base_1.BaseAPI;
22
+ __export(require("./api"));
23
+ __export(require("./configuration"));
24
+ __export(require("./models"));
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { PolicyClass } from './policy-class';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -33,6 +34,12 @@ export interface AccountClass {
33
34
  * @memberof AccountClass
34
35
  */
35
36
  'accountNumber': string;
37
+ /**
38
+ * The account\'s title.
39
+ * @type {string}
40
+ * @memberof AccountClass
41
+ */
42
+ 'title'?: AccountClassTitleEnum;
36
43
  /**
37
44
  * The account\'s first name.
38
45
  * @type {string}
@@ -86,13 +93,25 @@ export interface AccountClass {
86
93
  * @type {string}
87
94
  * @memberof AccountClass
88
95
  */
89
- 'birthDate': string;
96
+ 'birthDate'?: string;
90
97
  /**
91
98
  * The account\'s phone number.
92
99
  * @type {string}
93
100
  * @memberof AccountClass
94
101
  */
95
102
  'phone': string;
103
+ /**
104
+ * The type of account, default to person
105
+ * @type {string}
106
+ * @memberof AccountClass
107
+ */
108
+ 'type': string;
109
+ /**
110
+ * The company name of account, required for account type org
111
+ * @type {string}
112
+ * @memberof AccountClass
113
+ */
114
+ 'companyName'?: string;
96
115
  /**
97
116
  * The account\'s version.
98
117
  * @type {number}
@@ -113,20 +132,27 @@ export interface AccountClass {
113
132
  'updatedAt': string;
114
133
  /**
115
134
  * Policies linked to the account.
116
- * @type {Array<string>}
135
+ * @type {Array<PolicyClass>}
117
136
  * @memberof AccountClass
118
137
  */
119
- 'policies': Array<string>;
138
+ 'policies': Array<PolicyClass>;
120
139
  /**
121
140
  * Optional field contain extra information
122
141
  * @type {object}
123
142
  * @memberof AccountClass
124
143
  */
125
- 'metadata': object;
144
+ 'metadata'?: object;
126
145
  /**
127
146
  * Optional field contain custom fields
128
147
  * @type {object}
129
148
  * @memberof AccountClass
130
149
  */
131
- 'customFields': object;
150
+ 'customFields'?: object;
132
151
  }
152
+ export declare const AccountClassTitleEnum: {
153
+ readonly Empty: "";
154
+ readonly Dr: "Dr.";
155
+ readonly DrMed: "Dr. med.";
156
+ readonly ProfDrMed: "Prof. Dr. med.";
157
+ };
158
+ export declare type AccountClassTitleEnum = typeof AccountClassTitleEnum[keyof typeof AccountClassTitleEnum];
@@ -13,3 +13,9 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AccountClassTitleEnum = {
17
+ Empty: '',
18
+ Dr: 'Dr.',
19
+ DrMed: 'Dr. med.',
20
+ ProfDrMed: 'Prof. Dr. med.'
21
+ };