@emilgroup/customer-sdk-node 1.35.0 → 1.36.1-beta.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/.openapi-generator/FILES +1 -1
- package/README.md +2 -2
- package/api/leads-api.ts +38 -38
- package/base.ts +23 -13
- package/dist/api/leads-api.d.ts +24 -24
- package/dist/api/leads-api.js +34 -34
- package/dist/base.d.ts +4 -2
- package/dist/base.js +38 -28
- package/dist/models/create-customer-request-dto.d.ts +6 -0
- package/dist/models/create-lead-request-dto.d.ts +4 -9
- package/dist/models/forgot-password-request-dto.d.ts +6 -0
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/invite-by-customer-request-dto.d.ts +6 -0
- package/dist/models/invite-by-tenant-request-dto.d.ts +6 -0
- package/dist/models/lead-class.d.ts +13 -1
- package/dist/models/link-lead-partner-request-dto.d.ts +36 -0
- package/dist/models/partner-link-class.d.ts +12 -0
- package/dist/models/reset-password-by-customer-request-dto.d.ts +6 -0
- package/dist/models/update-lead-request-dto.d.ts +6 -0
- package/models/create-customer-request-dto.ts +6 -0
- package/models/create-lead-request-dto.ts +4 -9
- package/models/forgot-password-request-dto.ts +6 -0
- package/models/index.ts +1 -1
- package/models/invite-by-customer-request-dto.ts +6 -0
- package/models/invite-by-tenant-request-dto.ts +6 -0
- package/models/lead-class.ts +13 -1
- package/models/link-lead-partner-request-dto.ts +42 -0
- package/models/partner-link-class.ts +12 -0
- package/models/reset-password-by-customer-request-dto.ts +6 -0
- package/models/update-lead-request-dto.ts +6 -0
- package/package.json +1 -1
- package/dist/models/grpc-update-lead-request-dto.d.ts +0 -50
- package/models/grpc-update-lead-request-dto.ts +0 -56
- /package/dist/models/{grpc-update-lead-request-dto.js → link-lead-partner-request-dto.js} +0 -0
package/dist/api/leads-api.js
CHANGED
|
@@ -150,28 +150,28 @@ var LeadsApiAxiosParamCreator = function (configuration) {
|
|
|
150
150
|
});
|
|
151
151
|
},
|
|
152
152
|
/**
|
|
153
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
153
|
+
* Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
|
|
154
154
|
* @summary Retrieve the lead
|
|
155
|
-
* @param {string}
|
|
155
|
+
* @param {string} leadCode The unique identification code of the lead.
|
|
156
156
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
157
157
|
* @param {string} [authorization] Bearer Token
|
|
158
158
|
* @param {string} [expand]
|
|
159
159
|
* @param {*} [options] Override http request option.
|
|
160
160
|
* @throws {RequiredError}
|
|
161
161
|
*/
|
|
162
|
-
getLead: function (
|
|
162
|
+
getLead: function (leadCode, customerCode, authorization, expand, options) {
|
|
163
163
|
if (options === void 0) { options = {}; }
|
|
164
164
|
return __awaiter(_this, void 0, void 0, function () {
|
|
165
165
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
166
166
|
return __generator(this, function (_a) {
|
|
167
167
|
switch (_a.label) {
|
|
168
168
|
case 0:
|
|
169
|
-
// verify required parameter '
|
|
170
|
-
(0, common_1.assertParamExists)('getLead', '
|
|
169
|
+
// verify required parameter 'leadCode' is not null or undefined
|
|
170
|
+
(0, common_1.assertParamExists)('getLead', 'leadCode', leadCode);
|
|
171
171
|
// verify required parameter 'customerCode' is not null or undefined
|
|
172
172
|
(0, common_1.assertParamExists)('getLead', 'customerCode', customerCode);
|
|
173
|
-
localVarPath = "/v1/customers/{customerCode}/leads/{
|
|
174
|
-
.replace("{".concat("
|
|
173
|
+
localVarPath = "/v1/customers/{customerCode}/leads/{leadCode}"
|
|
174
|
+
.replace("{".concat("leadCode", "}"), encodeURIComponent(String(leadCode)))
|
|
175
175
|
.replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
|
|
176
176
|
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
177
177
|
if (configuration) {
|
|
@@ -206,7 +206,7 @@ var LeadsApiAxiosParamCreator = function (configuration) {
|
|
|
206
206
|
});
|
|
207
207
|
},
|
|
208
208
|
/**
|
|
209
|
-
* Returns a list of leads you have previously created.
|
|
209
|
+
* Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
210
210
|
* @summary List leads
|
|
211
211
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
212
212
|
* @param {string} [authorization] Bearer Token
|
|
@@ -284,28 +284,28 @@ var LeadsApiAxiosParamCreator = function (configuration) {
|
|
|
284
284
|
/**
|
|
285
285
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
286
286
|
* @summary Update the lead
|
|
287
|
-
* @param {string}
|
|
287
|
+
* @param {string} leadCode The unique identification code of the lead.
|
|
288
288
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
289
289
|
* @param {UpdateLeadRequestDto} updateLeadRequestDto
|
|
290
290
|
* @param {string} [authorization] Bearer Token
|
|
291
291
|
* @param {*} [options] Override http request option.
|
|
292
292
|
* @throws {RequiredError}
|
|
293
293
|
*/
|
|
294
|
-
updateLead: function (
|
|
294
|
+
updateLead: function (leadCode, customerCode, updateLeadRequestDto, authorization, options) {
|
|
295
295
|
if (options === void 0) { options = {}; }
|
|
296
296
|
return __awaiter(_this, void 0, void 0, function () {
|
|
297
297
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
298
298
|
return __generator(this, function (_a) {
|
|
299
299
|
switch (_a.label) {
|
|
300
300
|
case 0:
|
|
301
|
-
// verify required parameter '
|
|
302
|
-
(0, common_1.assertParamExists)('updateLead', '
|
|
301
|
+
// verify required parameter 'leadCode' is not null or undefined
|
|
302
|
+
(0, common_1.assertParamExists)('updateLead', 'leadCode', leadCode);
|
|
303
303
|
// verify required parameter 'customerCode' is not null or undefined
|
|
304
304
|
(0, common_1.assertParamExists)('updateLead', 'customerCode', customerCode);
|
|
305
305
|
// verify required parameter 'updateLeadRequestDto' is not null or undefined
|
|
306
306
|
(0, common_1.assertParamExists)('updateLead', 'updateLeadRequestDto', updateLeadRequestDto);
|
|
307
|
-
localVarPath = "/v1/customers/{customerCode}/leads/{
|
|
308
|
-
.replace("{".concat("
|
|
307
|
+
localVarPath = "/v1/customers/{customerCode}/leads/{leadCode}"
|
|
308
|
+
.replace("{".concat("leadCode", "}"), encodeURIComponent(String(leadCode)))
|
|
309
309
|
.replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
|
|
310
310
|
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
311
311
|
if (configuration) {
|
|
@@ -371,21 +371,21 @@ var LeadsApiFp = function (configuration) {
|
|
|
371
371
|
});
|
|
372
372
|
},
|
|
373
373
|
/**
|
|
374
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
374
|
+
* Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
|
|
375
375
|
* @summary Retrieve the lead
|
|
376
|
-
* @param {string}
|
|
376
|
+
* @param {string} leadCode The unique identification code of the lead.
|
|
377
377
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
378
378
|
* @param {string} [authorization] Bearer Token
|
|
379
379
|
* @param {string} [expand]
|
|
380
380
|
* @param {*} [options] Override http request option.
|
|
381
381
|
* @throws {RequiredError}
|
|
382
382
|
*/
|
|
383
|
-
getLead: function (
|
|
383
|
+
getLead: function (leadCode, customerCode, authorization, expand, options) {
|
|
384
384
|
return __awaiter(this, void 0, void 0, function () {
|
|
385
385
|
var localVarAxiosArgs;
|
|
386
386
|
return __generator(this, function (_a) {
|
|
387
387
|
switch (_a.label) {
|
|
388
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getLead(
|
|
388
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getLead(leadCode, customerCode, authorization, expand, options)];
|
|
389
389
|
case 1:
|
|
390
390
|
localVarAxiosArgs = _a.sent();
|
|
391
391
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -394,7 +394,7 @@ var LeadsApiFp = function (configuration) {
|
|
|
394
394
|
});
|
|
395
395
|
},
|
|
396
396
|
/**
|
|
397
|
-
* Returns a list of leads you have previously created.
|
|
397
|
+
* Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
398
398
|
* @summary List leads
|
|
399
399
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
400
400
|
* @param {string} [authorization] Bearer Token
|
|
@@ -424,19 +424,19 @@ var LeadsApiFp = function (configuration) {
|
|
|
424
424
|
/**
|
|
425
425
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
426
426
|
* @summary Update the lead
|
|
427
|
-
* @param {string}
|
|
427
|
+
* @param {string} leadCode The unique identification code of the lead.
|
|
428
428
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
429
429
|
* @param {UpdateLeadRequestDto} updateLeadRequestDto
|
|
430
430
|
* @param {string} [authorization] Bearer Token
|
|
431
431
|
* @param {*} [options] Override http request option.
|
|
432
432
|
* @throws {RequiredError}
|
|
433
433
|
*/
|
|
434
|
-
updateLead: function (
|
|
434
|
+
updateLead: function (leadCode, customerCode, updateLeadRequestDto, authorization, options) {
|
|
435
435
|
return __awaiter(this, void 0, void 0, function () {
|
|
436
436
|
var localVarAxiosArgs;
|
|
437
437
|
return __generator(this, function (_a) {
|
|
438
438
|
switch (_a.label) {
|
|
439
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateLead(
|
|
439
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateLead(leadCode, customerCode, updateLeadRequestDto, authorization, options)];
|
|
440
440
|
case 1:
|
|
441
441
|
localVarAxiosArgs = _a.sent();
|
|
442
442
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -467,20 +467,20 @@ var LeadsApiFactory = function (configuration, basePath, axios) {
|
|
|
467
467
|
return localVarFp.createLead(customerCode, createLeadRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
468
468
|
},
|
|
469
469
|
/**
|
|
470
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
470
|
+
* Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
|
|
471
471
|
* @summary Retrieve the lead
|
|
472
|
-
* @param {string}
|
|
472
|
+
* @param {string} leadCode The unique identification code of the lead.
|
|
473
473
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
474
474
|
* @param {string} [authorization] Bearer Token
|
|
475
475
|
* @param {string} [expand]
|
|
476
476
|
* @param {*} [options] Override http request option.
|
|
477
477
|
* @throws {RequiredError}
|
|
478
478
|
*/
|
|
479
|
-
getLead: function (
|
|
480
|
-
return localVarFp.getLead(
|
|
479
|
+
getLead: function (leadCode, customerCode, authorization, expand, options) {
|
|
480
|
+
return localVarFp.getLead(leadCode, customerCode, authorization, expand, options).then(function (request) { return request(axios, basePath); });
|
|
481
481
|
},
|
|
482
482
|
/**
|
|
483
|
-
* Returns a list of leads you have previously created.
|
|
483
|
+
* Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
484
484
|
* @summary List leads
|
|
485
485
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
486
486
|
* @param {string} [authorization] Bearer Token
|
|
@@ -500,15 +500,15 @@ var LeadsApiFactory = function (configuration, basePath, axios) {
|
|
|
500
500
|
/**
|
|
501
501
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
502
502
|
* @summary Update the lead
|
|
503
|
-
* @param {string}
|
|
503
|
+
* @param {string} leadCode The unique identification code of the lead.
|
|
504
504
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
|
|
505
505
|
* @param {UpdateLeadRequestDto} updateLeadRequestDto
|
|
506
506
|
* @param {string} [authorization] Bearer Token
|
|
507
507
|
* @param {*} [options] Override http request option.
|
|
508
508
|
* @throws {RequiredError}
|
|
509
509
|
*/
|
|
510
|
-
updateLead: function (
|
|
511
|
-
return localVarFp.updateLead(
|
|
510
|
+
updateLead: function (leadCode, customerCode, updateLeadRequestDto, authorization, options) {
|
|
511
|
+
return localVarFp.updateLead(leadCode, customerCode, updateLeadRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
512
512
|
},
|
|
513
513
|
};
|
|
514
514
|
};
|
|
@@ -537,7 +537,7 @@ var LeadsApi = /** @class */ (function (_super) {
|
|
|
537
537
|
return (0, exports.LeadsApiFp)(this.configuration).createLead(requestParameters.customerCode, requestParameters.createLeadRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
538
538
|
};
|
|
539
539
|
/**
|
|
540
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
540
|
+
* Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
|
|
541
541
|
* @summary Retrieve the lead
|
|
542
542
|
* @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
|
|
543
543
|
* @param {*} [options] Override http request option.
|
|
@@ -546,10 +546,10 @@ var LeadsApi = /** @class */ (function (_super) {
|
|
|
546
546
|
*/
|
|
547
547
|
LeadsApi.prototype.getLead = function (requestParameters, options) {
|
|
548
548
|
var _this = this;
|
|
549
|
-
return (0, exports.LeadsApiFp)(this.configuration).getLead(requestParameters.
|
|
549
|
+
return (0, exports.LeadsApiFp)(this.configuration).getLead(requestParameters.leadCode, requestParameters.customerCode, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
550
550
|
};
|
|
551
551
|
/**
|
|
552
|
-
* Returns a list of leads you have previously created.
|
|
552
|
+
* Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
553
553
|
* @summary List leads
|
|
554
554
|
* @param {LeadsApiListLeadsRequest} requestParameters Request parameters.
|
|
555
555
|
* @param {*} [options] Override http request option.
|
|
@@ -570,7 +570,7 @@ var LeadsApi = /** @class */ (function (_super) {
|
|
|
570
570
|
*/
|
|
571
571
|
LeadsApi.prototype.updateLead = function (requestParameters, options) {
|
|
572
572
|
var _this = this;
|
|
573
|
-
return (0, exports.LeadsApiFp)(this.configuration).updateLead(requestParameters.
|
|
573
|
+
return (0, exports.LeadsApiFp)(this.configuration).updateLead(requestParameters.leadCode, requestParameters.customerCode, requestParameters.updateLeadRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
574
574
|
};
|
|
575
575
|
return LeadsApi;
|
|
576
576
|
}(base_1.BaseAPI));
|
package/dist/base.d.ts
CHANGED
|
@@ -55,17 +55,19 @@ export declare class BaseAPI {
|
|
|
55
55
|
private username?;
|
|
56
56
|
private password?;
|
|
57
57
|
private isCustomerToken;
|
|
58
|
+
private permissions;
|
|
58
59
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
59
60
|
initialize(env?: Environment): Promise<void>;
|
|
60
61
|
private loadCredentials;
|
|
61
62
|
private readConfigFile;
|
|
62
63
|
private readEnvVariables;
|
|
63
64
|
selectEnvironment(env: Environment): void;
|
|
65
|
+
getPermissions(): Array<string>;
|
|
64
66
|
authorize(username: string, password: string): Promise<void>;
|
|
65
67
|
initiateAuthorization(username: string, password: string, tenantSlug: string): Promise<AxiosResponse<InitiateAuthResponseClass>>;
|
|
66
68
|
respondToAuthorizationChallenge(respondToAuthChallengeRequestDto: RespondToAuthChallengeRequestDto): Promise<AxiosResponse<RespondToAuthChallengeClass>>;
|
|
67
|
-
refreshTokenTenant(): Promise<
|
|
68
|
-
refreshTokenCustomer(): Promise<
|
|
69
|
+
refreshTokenTenant(): Promise<LoginClass>;
|
|
70
|
+
refreshTokenCustomer(): Promise<LoginClass>;
|
|
69
71
|
private extractRefreshToken;
|
|
70
72
|
private attachInterceptor;
|
|
71
73
|
}
|
package/dist/base.js
CHANGED
|
@@ -151,6 +151,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
151
151
|
this.basePath = basePath;
|
|
152
152
|
this.axios = axios;
|
|
153
153
|
this.isCustomerToken = false;
|
|
154
|
+
this.permissions = [];
|
|
154
155
|
if (configuration) {
|
|
155
156
|
this.configuration = configuration;
|
|
156
157
|
this.basePath = configuration.basePath || this.basePath;
|
|
@@ -243,11 +244,14 @@ var BaseAPI = /** @class */ (function () {
|
|
|
243
244
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
244
245
|
this.configuration.basePath = env;
|
|
245
246
|
};
|
|
247
|
+
BaseAPI.prototype.getPermissions = function () {
|
|
248
|
+
return this.permissions;
|
|
249
|
+
};
|
|
246
250
|
BaseAPI.prototype.authorize = function (username, password) {
|
|
247
251
|
return __awaiter(this, void 0, void 0, function () {
|
|
248
|
-
var options, response, accessToken, refreshToken;
|
|
249
|
-
return __generator(this, function (
|
|
250
|
-
switch (
|
|
252
|
+
var options, response, _a, accessToken, permissions, refreshToken;
|
|
253
|
+
return __generator(this, function (_b) {
|
|
254
|
+
switch (_b.label) {
|
|
251
255
|
case 0:
|
|
252
256
|
options = {
|
|
253
257
|
method: 'POST',
|
|
@@ -261,10 +265,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
261
265
|
};
|
|
262
266
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
263
267
|
case 1:
|
|
264
|
-
response =
|
|
265
|
-
|
|
268
|
+
response = _b.sent();
|
|
269
|
+
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
266
270
|
this.configuration.username = username;
|
|
267
271
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
272
|
+
this.permissions = permissions;
|
|
268
273
|
refreshToken = this.extractRefreshToken(response);
|
|
269
274
|
this.configuration.refreshToken = refreshToken;
|
|
270
275
|
return [2 /*return*/];
|
|
@@ -339,13 +344,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
339
344
|
};
|
|
340
345
|
BaseAPI.prototype.refreshTokenTenant = function () {
|
|
341
346
|
return __awaiter(this, void 0, void 0, function () {
|
|
342
|
-
var _a, username, refreshToken, options,
|
|
347
|
+
var _a, username, refreshToken, options, response;
|
|
343
348
|
return __generator(this, function (_b) {
|
|
344
349
|
switch (_b.label) {
|
|
345
350
|
case 0:
|
|
346
351
|
_a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
|
|
347
352
|
if (!username || !refreshToken) {
|
|
348
|
-
|
|
353
|
+
throw new Error('Failed to refresh token.');
|
|
349
354
|
}
|
|
350
355
|
options = {
|
|
351
356
|
method: 'POST',
|
|
@@ -359,21 +364,21 @@ var BaseAPI = /** @class */ (function () {
|
|
|
359
364
|
};
|
|
360
365
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
361
366
|
case 1:
|
|
362
|
-
|
|
363
|
-
return [2 /*return*/,
|
|
367
|
+
response = _b.sent();
|
|
368
|
+
return [2 /*return*/, response.data];
|
|
364
369
|
}
|
|
365
370
|
});
|
|
366
371
|
});
|
|
367
372
|
};
|
|
368
373
|
BaseAPI.prototype.refreshTokenCustomer = function () {
|
|
369
374
|
return __awaiter(this, void 0, void 0, function () {
|
|
370
|
-
var _a, username, refreshToken, tenantSlug, options,
|
|
375
|
+
var _a, username, refreshToken, tenantSlug, options, response;
|
|
371
376
|
return __generator(this, function (_b) {
|
|
372
377
|
switch (_b.label) {
|
|
373
378
|
case 0:
|
|
374
379
|
_a = this.configuration, username = _a.username, refreshToken = _a.refreshToken, tenantSlug = _a.tenantSlug;
|
|
375
380
|
if (!username || !refreshToken) {
|
|
376
|
-
|
|
381
|
+
throw new Error('Failed to refresh token.');
|
|
377
382
|
}
|
|
378
383
|
options = {
|
|
379
384
|
method: 'POST',
|
|
@@ -387,8 +392,8 @@ var BaseAPI = /** @class */ (function () {
|
|
|
387
392
|
};
|
|
388
393
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
389
394
|
case 1:
|
|
390
|
-
|
|
391
|
-
return [2 /*return*/,
|
|
395
|
+
response = _b.sent();
|
|
396
|
+
return [2 /*return*/, response.data];
|
|
392
397
|
}
|
|
393
398
|
});
|
|
394
399
|
});
|
|
@@ -405,35 +410,38 @@ var BaseAPI = /** @class */ (function () {
|
|
|
405
410
|
axios.interceptors.response.use(function (res) {
|
|
406
411
|
return res;
|
|
407
412
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
408
|
-
var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
|
|
409
|
-
|
|
410
|
-
|
|
413
|
+
var originalConfig, tokenString, permissions, accessToken, _error_1, tokenString, permissions, accessToken, _error_2;
|
|
414
|
+
var _a, _b, _c, _d;
|
|
415
|
+
return __generator(this, function (_e) {
|
|
416
|
+
switch (_e.label) {
|
|
411
417
|
case 0:
|
|
412
418
|
originalConfig = err.config;
|
|
413
419
|
if (!err.response) return [3 /*break*/, 8];
|
|
414
420
|
if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 7];
|
|
415
421
|
originalConfig._retry = true;
|
|
416
|
-
|
|
422
|
+
_e.label = 1;
|
|
417
423
|
case 1:
|
|
418
|
-
|
|
424
|
+
_e.trys.push([1, 6, , 7]);
|
|
419
425
|
tokenString = void 0;
|
|
426
|
+
permissions = void 0;
|
|
420
427
|
if (!this.isCustomerToken) return [3 /*break*/, 3];
|
|
421
428
|
return [4 /*yield*/, this.refreshTokenCustomer()];
|
|
422
429
|
case 2:
|
|
423
|
-
|
|
430
|
+
(_a = _e.sent(), tokenString = _a.accessToken, permissions = _a.permissions);
|
|
424
431
|
return [3 /*break*/, 5];
|
|
425
432
|
case 3: return [4 /*yield*/, this.refreshTokenTenant()];
|
|
426
433
|
case 4:
|
|
427
|
-
|
|
428
|
-
|
|
434
|
+
(_b = _e.sent(), tokenString = _b.accessToken, permissions = _b.permissions);
|
|
435
|
+
_e.label = 5;
|
|
429
436
|
case 5:
|
|
430
437
|
accessToken = "Bearer ".concat(tokenString);
|
|
438
|
+
this.permissions = permissions;
|
|
431
439
|
delete originalConfig.headers['Authorization'];
|
|
432
440
|
originalConfig.headers['Authorization'] = accessToken;
|
|
433
441
|
this.configuration.accessToken = accessToken;
|
|
434
442
|
return [2 /*return*/, axios(originalConfig)];
|
|
435
443
|
case 6:
|
|
436
|
-
_error_1 =
|
|
444
|
+
_error_1 = _e.sent();
|
|
437
445
|
if (_error_1.response && _error_1.response.data) {
|
|
438
446
|
return [2 /*return*/, Promise.reject(_error_1.response.data)];
|
|
439
447
|
}
|
|
@@ -449,27 +457,29 @@ var BaseAPI = /** @class */ (function () {
|
|
|
449
457
|
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
450
458
|
&& _retry_count < 4)) return [3 /*break*/, 15];
|
|
451
459
|
_retry_count++;
|
|
452
|
-
|
|
460
|
+
_e.label = 9;
|
|
453
461
|
case 9:
|
|
454
|
-
|
|
462
|
+
_e.trys.push([9, 14, , 15]);
|
|
455
463
|
tokenString = void 0;
|
|
464
|
+
permissions = void 0;
|
|
456
465
|
if (!this.isCustomerToken) return [3 /*break*/, 11];
|
|
457
466
|
return [4 /*yield*/, this.refreshTokenCustomer()];
|
|
458
467
|
case 10:
|
|
459
|
-
|
|
468
|
+
(_c = _e.sent(), tokenString = _c.accessToken, permissions = _c.permissions);
|
|
460
469
|
return [3 /*break*/, 13];
|
|
461
470
|
case 11: return [4 /*yield*/, this.refreshTokenTenant()];
|
|
462
471
|
case 12:
|
|
463
|
-
|
|
464
|
-
|
|
472
|
+
(_d = _e.sent(), tokenString = _d.accessToken, permissions = _d.permissions);
|
|
473
|
+
_e.label = 13;
|
|
465
474
|
case 13:
|
|
466
475
|
accessToken = "Bearer ".concat(tokenString);
|
|
476
|
+
this.permissions = permissions;
|
|
467
477
|
_retry = true;
|
|
468
478
|
originalConfig.headers['Authorization'] = accessToken;
|
|
469
479
|
this.configuration.accessToken = accessToken;
|
|
470
480
|
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
471
481
|
case 14:
|
|
472
|
-
_error_2 =
|
|
482
|
+
_error_2 = _e.sent();
|
|
473
483
|
if (_error_2.response && _error_2.response.data) {
|
|
474
484
|
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
475
485
|
}
|
|
@@ -34,6 +34,12 @@ export interface CreateCustomerRequestDto {
|
|
|
34
34
|
* @memberof CreateCustomerRequestDto
|
|
35
35
|
*/
|
|
36
36
|
'isEulaAccepted': boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Another variant used for the template from the customer settings.
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof CreateCustomerRequestDto
|
|
41
|
+
*/
|
|
42
|
+
'configVariant'?: string;
|
|
37
43
|
/**
|
|
38
44
|
* If the account does not exist yet, it will be created in the database.
|
|
39
45
|
* @type {CreateAccountRequestDto}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { CreateBankAccountRequestDto } from './create-bank-account-request-dto';
|
|
13
13
|
import { CreatePaymentMethodRequestDto } from './create-payment-method-request-dto';
|
|
14
|
+
import { LinkLeadPartnerRequestDto } from './link-lead-partner-request-dto';
|
|
14
15
|
import { PolicyObjectDto } from './policy-object-dto';
|
|
15
16
|
import { PremiumOverrideRequestDto } from './premium-override-request-dto';
|
|
16
17
|
import { UploadedDocumentDto } from './uploaded-document-dto';
|
|
@@ -81,15 +82,9 @@ export interface CreateLeadRequestDto {
|
|
|
81
82
|
*/
|
|
82
83
|
'paymentMethod': CreatePaymentMethodRequestDto;
|
|
83
84
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @type {
|
|
86
|
-
* @memberof CreateLeadRequestDto
|
|
87
|
-
*/
|
|
88
|
-
'partnerCode'?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Unique identifier of the partner role that this object belongs to.
|
|
91
|
-
* @type {string}
|
|
85
|
+
* Optional partner object contains necessary information to link a partner to the policy.
|
|
86
|
+
* @type {LinkLeadPartnerRequestDto}
|
|
92
87
|
* @memberof CreateLeadRequestDto
|
|
93
88
|
*/
|
|
94
|
-
'
|
|
89
|
+
'partner'?: LinkLeadPartnerRequestDto;
|
|
95
90
|
}
|
|
@@ -27,4 +27,10 @@ export interface ForgotPasswordRequestDto {
|
|
|
27
27
|
* @memberof ForgotPasswordRequestDto
|
|
28
28
|
*/
|
|
29
29
|
'tenantSlug': string;
|
|
30
|
+
/**
|
|
31
|
+
* Another variant used for the template from the customer settings.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof ForgotPasswordRequestDto
|
|
34
|
+
*/
|
|
35
|
+
'configVariant'?: string;
|
|
30
36
|
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ export * from './get-customer-response-class';
|
|
|
27
27
|
export * from './get-lead-response-class';
|
|
28
28
|
export * from './get-policy-response-class';
|
|
29
29
|
export * from './get-product-response-class';
|
|
30
|
-
export * from './grpc-update-lead-request-dto';
|
|
31
30
|
export * from './initiate-auth-request-dto';
|
|
32
31
|
export * from './initiate-auth-response-class';
|
|
33
32
|
export * from './initiate-braintree-payment-setup-response-class';
|
|
@@ -43,6 +42,7 @@ export * from './invite-class';
|
|
|
43
42
|
export * from './invoice-class';
|
|
44
43
|
export * from './lead-bank-account-class';
|
|
45
44
|
export * from './lead-class';
|
|
45
|
+
export * from './link-lead-partner-request-dto';
|
|
46
46
|
export * from './list-customer-claims-response-class';
|
|
47
47
|
export * from './list-documents-response-class';
|
|
48
48
|
export * from './list-invoices-response-class';
|
package/dist/models/index.js
CHANGED
|
@@ -43,7 +43,6 @@ __exportStar(require("./get-customer-response-class"), exports);
|
|
|
43
43
|
__exportStar(require("./get-lead-response-class"), exports);
|
|
44
44
|
__exportStar(require("./get-policy-response-class"), exports);
|
|
45
45
|
__exportStar(require("./get-product-response-class"), exports);
|
|
46
|
-
__exportStar(require("./grpc-update-lead-request-dto"), exports);
|
|
47
46
|
__exportStar(require("./initiate-auth-request-dto"), exports);
|
|
48
47
|
__exportStar(require("./initiate-auth-response-class"), exports);
|
|
49
48
|
__exportStar(require("./initiate-braintree-payment-setup-response-class"), exports);
|
|
@@ -59,6 +58,7 @@ __exportStar(require("./invite-class"), exports);
|
|
|
59
58
|
__exportStar(require("./invoice-class"), exports);
|
|
60
59
|
__exportStar(require("./lead-bank-account-class"), exports);
|
|
61
60
|
__exportStar(require("./lead-class"), exports);
|
|
61
|
+
__exportStar(require("./link-lead-partner-request-dto"), exports);
|
|
62
62
|
__exportStar(require("./list-customer-claims-response-class"), exports);
|
|
63
63
|
__exportStar(require("./list-documents-response-class"), exports);
|
|
64
64
|
__exportStar(require("./list-invoices-response-class"), exports);
|
|
@@ -27,4 +27,10 @@ export interface InviteByCustomerRequestDto {
|
|
|
27
27
|
* @memberof InviteByCustomerRequestDto
|
|
28
28
|
*/
|
|
29
29
|
'tenantSlug': string;
|
|
30
|
+
/**
|
|
31
|
+
* Another variant used for the template from the customer settings.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof InviteByCustomerRequestDto
|
|
34
|
+
*/
|
|
35
|
+
'configVariant'?: string;
|
|
30
36
|
}
|
|
@@ -21,4 +21,10 @@ export interface InviteByTenantRequestDto {
|
|
|
21
21
|
* @memberof InviteByTenantRequestDto
|
|
22
22
|
*/
|
|
23
23
|
'email': string;
|
|
24
|
+
/**
|
|
25
|
+
* Another variant used for the template from the customer settings.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof InviteByTenantRequestDto
|
|
28
|
+
*/
|
|
29
|
+
'configVariant'?: string;
|
|
24
30
|
}
|
|
@@ -84,7 +84,7 @@ export interface LeadClass {
|
|
|
84
84
|
*/
|
|
85
85
|
'premiumOverride'?: PremiumOverrideRequestClass;
|
|
86
86
|
/**
|
|
87
|
-
* A slug is a human-readable, unique identifier, used to identify a resource
|
|
87
|
+
* A slug is a human-readable, unique identifier, used to identify a resource instead of a less human-readable identifier like an id.
|
|
88
88
|
* @type {string}
|
|
89
89
|
* @memberof LeadClass
|
|
90
90
|
*/
|
|
@@ -125,6 +125,18 @@ export interface LeadClass {
|
|
|
125
125
|
* @memberof LeadClass
|
|
126
126
|
*/
|
|
127
127
|
'partnerLinks': Array<PartnerLinkClass>;
|
|
128
|
+
/**
|
|
129
|
+
* Identifier of the user who created the record.
|
|
130
|
+
* @type {string}
|
|
131
|
+
* @memberof LeadClass
|
|
132
|
+
*/
|
|
133
|
+
'createdBy': string;
|
|
134
|
+
/**
|
|
135
|
+
* Identifier of the user who last updated the record.
|
|
136
|
+
* @type {string}
|
|
137
|
+
* @memberof LeadClass
|
|
138
|
+
*/
|
|
139
|
+
'updatedBy': string;
|
|
128
140
|
/**
|
|
129
141
|
* Organization name.
|
|
130
142
|
* @type {string}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL CustomerService
|
|
3
|
+
* The EMIL CustomerService API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface LinkLeadPartnerRequestDto
|
|
16
|
+
*/
|
|
17
|
+
export interface LinkLeadPartnerRequestDto {
|
|
18
|
+
/**
|
|
19
|
+
* The code of the partner with which the lead will be linked.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
22
|
+
*/
|
|
23
|
+
'partnerCode': string;
|
|
24
|
+
/**
|
|
25
|
+
* The code of role that the partner will have in the established link between the lead and the partner.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
28
|
+
*/
|
|
29
|
+
'partnerRoleCode': string;
|
|
30
|
+
/**
|
|
31
|
+
* The date of the start of linking with a partner.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
34
|
+
*/
|
|
35
|
+
'startDate': string;
|
|
36
|
+
}
|
|
@@ -69,4 +69,16 @@ export interface PartnerLinkClass {
|
|
|
69
69
|
* @memberof PartnerLinkClass
|
|
70
70
|
*/
|
|
71
71
|
'updatedAt': string;
|
|
72
|
+
/**
|
|
73
|
+
* Identifier of the user who created the record.
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @memberof PartnerLinkClass
|
|
76
|
+
*/
|
|
77
|
+
'createdBy': string;
|
|
78
|
+
/**
|
|
79
|
+
* Identifier of the user who last updated the record.
|
|
80
|
+
* @type {string}
|
|
81
|
+
* @memberof PartnerLinkClass
|
|
82
|
+
*/
|
|
83
|
+
'updatedBy': string;
|
|
72
84
|
}
|
|
@@ -33,4 +33,10 @@ export interface ResetPasswordByCustomerRequestDto {
|
|
|
33
33
|
* @memberof ResetPasswordByCustomerRequestDto
|
|
34
34
|
*/
|
|
35
35
|
'newPassword': string;
|
|
36
|
+
/**
|
|
37
|
+
* Another variant used for the template from the customer settings.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof ResetPasswordByCustomerRequestDto
|
|
40
|
+
*/
|
|
41
|
+
'configVariant'?: string;
|
|
36
42
|
}
|