@emilgroup/insurance-sdk-node 1.8.0 → 1.9.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.
- package/README.md +2 -2
- package/base.ts +3 -3
- package/dist/base.d.ts +1 -1
- package/dist/base.js +3 -3
- package/dist/models/create-product-field-request-dto.d.ts +12 -0
- package/dist/models/product-field-class.d.ts +12 -0
- package/dist/models/shared-product-field-class.d.ts +12 -0
- package/dist/models/update-product-field-request-dto.d.ts +12 -0
- package/models/create-product-field-request-dto.ts +12 -0
- package/models/product-field-class.ts +12 -0
- package/models/shared-product-field-class.ts +12 -0
- package/models/update-product-field-request-dto.ts +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/insurance-sdk-node@1.
|
|
20
|
+
npm install @emilgroup/insurance-sdk-node@1.9.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/insurance-sdk-node@1.
|
|
24
|
+
yarn add @emilgroup/insurance-sdk-node@1.9.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `PoliciesApi`.
|
package/base.ts
CHANGED
|
@@ -170,7 +170,7 @@ export class BaseAPI {
|
|
|
170
170
|
this.configuration.refreshToken = refreshToken;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
async
|
|
173
|
+
async refreshTokenIntenal(): Promise<string> {
|
|
174
174
|
const { username, refreshToken } = this.configuration;
|
|
175
175
|
|
|
176
176
|
|
|
@@ -220,7 +220,7 @@ export class BaseAPI {
|
|
|
220
220
|
if (err.response.status === 401 && !originalConfig._retry) {
|
|
221
221
|
originalConfig._retry = true;
|
|
222
222
|
try {
|
|
223
|
-
const tokenString = await this.
|
|
223
|
+
const tokenString = await this.refreshTokenIntenal();
|
|
224
224
|
const accessToken = `Bearer ${tokenString}`;
|
|
225
225
|
|
|
226
226
|
originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
|
|
@@ -245,7 +245,7 @@ export class BaseAPI {
|
|
|
245
245
|
){
|
|
246
246
|
_retry_count++;
|
|
247
247
|
try {
|
|
248
|
-
const tokenString = await this.
|
|
248
|
+
const tokenString = await this.refreshTokenIntenal();
|
|
249
249
|
const accessToken = `Bearer ${tokenString}`;
|
|
250
250
|
|
|
251
251
|
_retry = true;
|
package/dist/base.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare class BaseAPI {
|
|
|
59
59
|
private readEnvVariables;
|
|
60
60
|
selectEnvironment(env: Environment): void;
|
|
61
61
|
authorize(username: string, password: string): Promise<void>;
|
|
62
|
-
|
|
62
|
+
refreshTokenIntenal(): Promise<string>;
|
|
63
63
|
private extractRefreshToken;
|
|
64
64
|
getConfiguration(): Configuration;
|
|
65
65
|
private attachInterceptor;
|
package/dist/base.js
CHANGED
|
@@ -270,7 +270,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
270
270
|
});
|
|
271
271
|
});
|
|
272
272
|
};
|
|
273
|
-
BaseAPI.prototype.
|
|
273
|
+
BaseAPI.prototype.refreshTokenIntenal = function () {
|
|
274
274
|
return __awaiter(this, void 0, void 0, function () {
|
|
275
275
|
var _a, username, refreshToken, options, accessToken;
|
|
276
276
|
return __generator(this, function (_b) {
|
|
@@ -324,7 +324,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
324
324
|
_a.label = 1;
|
|
325
325
|
case 1:
|
|
326
326
|
_a.trys.push([1, 3, , 4]);
|
|
327
|
-
return [4 /*yield*/, this.
|
|
327
|
+
return [4 /*yield*/, this.refreshTokenIntenal()];
|
|
328
328
|
case 2:
|
|
329
329
|
tokenString = _a.sent();
|
|
330
330
|
accessToken = "Bearer ".concat(tokenString);
|
|
@@ -351,7 +351,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
351
351
|
_a.label = 6;
|
|
352
352
|
case 6:
|
|
353
353
|
_a.trys.push([6, 8, , 9]);
|
|
354
|
-
return [4 /*yield*/, this.
|
|
354
|
+
return [4 /*yield*/, this.refreshTokenIntenal()];
|
|
355
355
|
case 7:
|
|
356
356
|
tokenString = _a.sent();
|
|
357
357
|
accessToken = "Bearer ".concat(tokenString);
|
|
@@ -69,6 +69,18 @@ export interface CreateProductFieldRequestDto {
|
|
|
69
69
|
* @memberof CreateProductFieldRequestDto
|
|
70
70
|
*/
|
|
71
71
|
'isUnique': boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Should the field be hidden on customer portal?
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
* @memberof CreateProductFieldRequestDto
|
|
76
|
+
*/
|
|
77
|
+
'isHiddenCustomerPortal': boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Should the field be editable on customer portal?
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
* @memberof CreateProductFieldRequestDto
|
|
82
|
+
*/
|
|
83
|
+
'isEditableCustomerPortal': boolean;
|
|
72
84
|
/**
|
|
73
85
|
* Default value of the field. For the field type date-time, it should be { \"templated\" : \"{{today}}\" }
|
|
74
86
|
* @type {object}
|
|
@@ -69,6 +69,18 @@ export interface ProductFieldClass {
|
|
|
69
69
|
* @memberof ProductFieldClass
|
|
70
70
|
*/
|
|
71
71
|
'isHidden': boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Is field hidden on the customer portal?
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
* @memberof ProductFieldClass
|
|
76
|
+
*/
|
|
77
|
+
'isHiddenCustomerPortal': boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Is field editable on the customer portal?
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
* @memberof ProductFieldClass
|
|
82
|
+
*/
|
|
83
|
+
'isEditableCustomerPortal': boolean;
|
|
72
84
|
/**
|
|
73
85
|
* Is this a system field? - System fields can neither be deleted nor modified
|
|
74
86
|
* @type {boolean}
|
|
@@ -69,6 +69,18 @@ export interface SharedProductFieldClass {
|
|
|
69
69
|
* @memberof SharedProductFieldClass
|
|
70
70
|
*/
|
|
71
71
|
'isHidden': boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Is field hidden on the customer portal?
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
* @memberof SharedProductFieldClass
|
|
76
|
+
*/
|
|
77
|
+
'isHiddenCustomerPortal': boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Is field editable on the customer portal?
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
* @memberof SharedProductFieldClass
|
|
82
|
+
*/
|
|
83
|
+
'isEditableCustomerPortal': boolean;
|
|
72
84
|
/**
|
|
73
85
|
* Is this a system field? - System fields can neither be deleted nor modified
|
|
74
86
|
* @type {boolean}
|
|
@@ -69,6 +69,18 @@ export interface UpdateProductFieldRequestDto {
|
|
|
69
69
|
* @memberof UpdateProductFieldRequestDto
|
|
70
70
|
*/
|
|
71
71
|
'isHidden': boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Should the field be hidden on customer portal?
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
* @memberof UpdateProductFieldRequestDto
|
|
76
|
+
*/
|
|
77
|
+
'isHiddenCustomerPortal': boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Should the field be editable on customer portal?
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
* @memberof UpdateProductFieldRequestDto
|
|
82
|
+
*/
|
|
83
|
+
'isEditableCustomerPortal': boolean;
|
|
72
84
|
/**
|
|
73
85
|
* Should the field value be unique across policies?
|
|
74
86
|
* @type {boolean}
|
|
@@ -74,6 +74,18 @@ export interface CreateProductFieldRequestDto {
|
|
|
74
74
|
* @memberof CreateProductFieldRequestDto
|
|
75
75
|
*/
|
|
76
76
|
'isUnique': boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Should the field be hidden on customer portal?
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @memberof CreateProductFieldRequestDto
|
|
81
|
+
*/
|
|
82
|
+
'isHiddenCustomerPortal': boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Should the field be editable on customer portal?
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @memberof CreateProductFieldRequestDto
|
|
87
|
+
*/
|
|
88
|
+
'isEditableCustomerPortal': boolean;
|
|
77
89
|
/**
|
|
78
90
|
* Default value of the field. For the field type date-time, it should be { \"templated\" : \"{{today}}\" }
|
|
79
91
|
* @type {object}
|
|
@@ -74,6 +74,18 @@ export interface ProductFieldClass {
|
|
|
74
74
|
* @memberof ProductFieldClass
|
|
75
75
|
*/
|
|
76
76
|
'isHidden': boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Is field hidden on the customer portal?
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @memberof ProductFieldClass
|
|
81
|
+
*/
|
|
82
|
+
'isHiddenCustomerPortal': boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Is field editable on the customer portal?
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @memberof ProductFieldClass
|
|
87
|
+
*/
|
|
88
|
+
'isEditableCustomerPortal': boolean;
|
|
77
89
|
/**
|
|
78
90
|
* Is this a system field? - System fields can neither be deleted nor modified
|
|
79
91
|
* @type {boolean}
|
|
@@ -74,6 +74,18 @@ export interface SharedProductFieldClass {
|
|
|
74
74
|
* @memberof SharedProductFieldClass
|
|
75
75
|
*/
|
|
76
76
|
'isHidden': boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Is field hidden on the customer portal?
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @memberof SharedProductFieldClass
|
|
81
|
+
*/
|
|
82
|
+
'isHiddenCustomerPortal': boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Is field editable on the customer portal?
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @memberof SharedProductFieldClass
|
|
87
|
+
*/
|
|
88
|
+
'isEditableCustomerPortal': boolean;
|
|
77
89
|
/**
|
|
78
90
|
* Is this a system field? - System fields can neither be deleted nor modified
|
|
79
91
|
* @type {boolean}
|
|
@@ -74,6 +74,18 @@ export interface UpdateProductFieldRequestDto {
|
|
|
74
74
|
* @memberof UpdateProductFieldRequestDto
|
|
75
75
|
*/
|
|
76
76
|
'isHidden': boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Should the field be hidden on customer portal?
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @memberof UpdateProductFieldRequestDto
|
|
81
|
+
*/
|
|
82
|
+
'isHiddenCustomerPortal': boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Should the field be editable on customer portal?
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @memberof UpdateProductFieldRequestDto
|
|
87
|
+
*/
|
|
88
|
+
'isEditableCustomerPortal': boolean;
|
|
77
89
|
/**
|
|
78
90
|
* Should the field value be unique across policies?
|
|
79
91
|
* @type {boolean}
|