@emilgroup/customer-sdk-node 1.0.0 → 1.1.1
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 +8 -4
- package/README.md +12 -12
- package/api/customers-api.ts +304 -114
- package/base.ts +57 -43
- package/dist/api/customers-api.d.ts +180 -76
- package/dist/api/customers-api.js +249 -89
- package/dist/base.d.ts +3 -0
- package/dist/base.js +75 -42
- package/dist/models/{login-request-dto.d.ts → authentication-result-class.d.ts} +8 -14
- package/dist/models/{invite-customer-request-dto.js → authentication-result-class.js} +0 -0
- package/dist/models/index.d.ts +8 -4
- package/dist/models/index.js +8 -4
- package/dist/models/initiate-auth-request-dto.d.ts +36 -0
- package/dist/models/{invite-customer-response-class.js → initiate-auth-request-dto.js} +0 -0
- package/dist/models/initiate-auth-response-class.d.ts +43 -0
- package/dist/models/{login-request-dto.js → initiate-auth-response-class.js} +0 -0
- package/dist/models/{invite-customer-request-dto.d.ts → invite-by-customer-request-dto.d.ts} +6 -6
- package/dist/models/{login-response-class.js → invite-by-customer-request-dto.js} +0 -0
- package/dist/models/invite-by-customer-response-class.d.ts +25 -0
- package/dist/models/invite-by-customer-response-class.js +15 -0
- package/dist/models/{invite-customer-response-class.d.ts → invite-by-tenant-response-class.d.ts} +3 -3
- package/dist/models/invite-by-tenant-response-class.js +15 -0
- package/dist/models/respond-to-auth-challenge-class.d.ts +43 -0
- package/dist/models/respond-to-auth-challenge-class.js +15 -0
- package/dist/models/respond-to-auth-challenge-request-dto.d.ts +42 -0
- package/dist/models/respond-to-auth-challenge-request-dto.js +15 -0
- package/models/{login-request-dto.ts → authentication-result-class.ts} +8 -14
- package/models/index.ts +8 -4
- package/models/initiate-auth-request-dto.ts +42 -0
- package/models/initiate-auth-response-class.ts +49 -0
- package/models/{invite-customer-request-dto.ts → invite-by-customer-request-dto.ts} +6 -6
- package/models/invite-by-customer-response-class.ts +31 -0
- package/models/{invite-customer-response-class.ts → invite-by-tenant-response-class.ts} +3 -3
- package/models/respond-to-auth-challenge-class.ts +49 -0
- package/models/respond-to-auth-challenge-request-dto.ts +48 -0
- package/package.json +1 -1
- package/dist/models/login-response-class.d.ts +0 -30
- package/models/login-response-class.ts +0 -36
package/base.ts
CHANGED
|
@@ -17,9 +17,17 @@ import { Configuration } from "./configuration";
|
|
|
17
17
|
// Some imports not used depending on template conditions
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
20
|
+
import * as fs from 'fs';
|
|
21
|
+
import * as path from 'path';
|
|
22
|
+
import * as os from 'os';
|
|
20
23
|
|
|
21
|
-
export const BASE_PATH = "
|
|
24
|
+
export const BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
|
|
25
|
+
const CONFIG_DIRECTORY = '.emil';
|
|
26
|
+
const CONFIG_FILENAME = 'credentials';
|
|
27
|
+
const KEY_USERNAME = 'emil_username';
|
|
28
|
+
const KEY_PASSWORD = 'emil_password';
|
|
22
29
|
|
|
30
|
+
const filePath = os.homedir() + path.sep + CONFIG_DIRECTORY + path.sep + CONFIG_FILENAME;
|
|
23
31
|
/**
|
|
24
32
|
*
|
|
25
33
|
* @export
|
|
@@ -59,6 +67,8 @@ export interface RequestArgs {
|
|
|
59
67
|
*/
|
|
60
68
|
export class BaseAPI {
|
|
61
69
|
protected configuration: Configuration | undefined;
|
|
70
|
+
private username?: string;
|
|
71
|
+
private password?: string;
|
|
62
72
|
|
|
63
73
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
64
74
|
if (configuration) {
|
|
@@ -69,46 +79,8 @@ export class BaseAPI {
|
|
|
69
79
|
basePath: this.basePath,
|
|
70
80
|
});
|
|
71
81
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(res) => {
|
|
75
|
-
return res;
|
|
76
|
-
},
|
|
77
|
-
async (err) => {
|
|
78
|
-
const originalConfig = err.config;
|
|
79
|
-
if (err.response) {
|
|
80
|
-
// Access Token was expired
|
|
81
|
-
if (err.response.status === 401 && !originalConfig._retry) {
|
|
82
|
-
originalConfig._retry = true;
|
|
83
|
-
try {
|
|
84
|
-
const tokenString = await this.refreshTokenInternal();
|
|
85
|
-
const accessToken = `Bearer ${tokenString}`;
|
|
86
|
-
|
|
87
|
-
const localVarHeaderParameter = {} as any;
|
|
88
|
-
localVarHeaderParameter['Authorization'] = accessToken;
|
|
89
|
-
|
|
90
|
-
originalConfig.headers = {
|
|
91
|
-
...originalConfig.headers,
|
|
92
|
-
...localVarHeaderParameter,
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
this.configuration.accessToken = accessToken;
|
|
96
|
-
|
|
97
|
-
return axios(originalConfig);
|
|
98
|
-
} catch (_error) {
|
|
99
|
-
if (_error.response && _error.response.data) {
|
|
100
|
-
return Promise.reject(_error.response.data);
|
|
101
|
-
}
|
|
102
|
-
return Promise.reject(_error);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (err.response.status === 403 && err.response.data) {
|
|
106
|
-
return Promise.reject(err.response.data);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return Promise.reject(err);
|
|
110
|
-
}
|
|
111
|
-
);
|
|
82
|
+
|
|
83
|
+
this.attachInterceptor(axios);
|
|
112
84
|
}
|
|
113
85
|
|
|
114
86
|
selectEnvironment(env: Environment) {
|
|
@@ -118,7 +90,7 @@ export class BaseAPI {
|
|
|
118
90
|
async authorize(username: string, password: string, tenantSlug: string): Promise<void> {
|
|
119
91
|
const options: AxiosRequestConfig = {
|
|
120
92
|
method: 'POST',
|
|
121
|
-
url: `${
|
|
93
|
+
url: `${this.configuration.basePath}/v1/customers/login`,
|
|
122
94
|
headers: {'Content-Type': 'application/json'},
|
|
123
95
|
data: {
|
|
124
96
|
username,
|
|
@@ -148,7 +120,7 @@ export class BaseAPI {
|
|
|
148
120
|
|
|
149
121
|
const options: AxiosRequestConfig = {
|
|
150
122
|
method: 'POST',
|
|
151
|
-
url: `${
|
|
123
|
+
url: `${this.configuration.basePath}/v1/customers/refresh-token`,
|
|
152
124
|
headers: {
|
|
153
125
|
'Content-Type': 'application/json',
|
|
154
126
|
Cookie: refreshToken,
|
|
@@ -171,6 +143,48 @@ export class BaseAPI {
|
|
|
171
143
|
|
|
172
144
|
return '';
|
|
173
145
|
}
|
|
146
|
+
|
|
147
|
+
private attachInterceptor(axios: AxiosInstance) {
|
|
148
|
+
axios.interceptors.response.use(
|
|
149
|
+
(res) => {
|
|
150
|
+
return res;
|
|
151
|
+
},
|
|
152
|
+
async (err) => {
|
|
153
|
+
const originalConfig = err.config;
|
|
154
|
+
if (err.response) {
|
|
155
|
+
// Access Token was expired
|
|
156
|
+
if (err.response.status === 401 && !originalConfig._retry) {
|
|
157
|
+
originalConfig._retry = true;
|
|
158
|
+
try {
|
|
159
|
+
const tokenString = await this.refreshTokenInternal();
|
|
160
|
+
const accessToken = `Bearer ${tokenString}`;
|
|
161
|
+
|
|
162
|
+
const localVarHeaderParameter = {} as any;
|
|
163
|
+
localVarHeaderParameter['Authorization'] = accessToken;
|
|
164
|
+
|
|
165
|
+
originalConfig.headers = {
|
|
166
|
+
...originalConfig.headers,
|
|
167
|
+
...localVarHeaderParameter,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
this.configuration.accessToken = accessToken;
|
|
171
|
+
|
|
172
|
+
return axios(originalConfig);
|
|
173
|
+
} catch (_error) {
|
|
174
|
+
if (_error.response && _error.response.data) {
|
|
175
|
+
return Promise.reject(_error.response.data);
|
|
176
|
+
}
|
|
177
|
+
return Promise.reject(_error);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (err.response.status === 403 && err.response.data) {
|
|
181
|
+
return Promise.reject(err.response.data);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return Promise.reject(err);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
174
188
|
};
|
|
175
189
|
|
|
176
190
|
/**
|
|
@@ -16,14 +16,17 @@ import { CreateCustomerRequestDto } from '../models';
|
|
|
16
16
|
import { CreateCustomerResponseClass } from '../models';
|
|
17
17
|
import { ForgotPasswordRequestDto } from '../models';
|
|
18
18
|
import { GetPolicyResponseClass } from '../models';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { InitiateAuthRequestDto } from '../models';
|
|
20
|
+
import { InitiateAuthResponseClass } from '../models';
|
|
21
|
+
import { InviteByCustomerRequestDto } from '../models';
|
|
22
|
+
import { InviteByCustomerResponseClass } from '../models';
|
|
23
|
+
import { InviteByTenantResponseClass } from '../models';
|
|
21
24
|
import { ListInvoicesResponseClass } from '../models';
|
|
22
25
|
import { ListPoliciesResponseClass } from '../models';
|
|
23
|
-
import { LoginRequestDto } from '../models';
|
|
24
|
-
import { LoginResponseClass } from '../models';
|
|
25
26
|
import { RefreshTokenDto } from '../models';
|
|
26
27
|
import { ResetPasswordByCustomerRequestDto } from '../models';
|
|
28
|
+
import { RespondToAuthChallengeClass } from '../models';
|
|
29
|
+
import { RespondToAuthChallengeRequestDto } from '../models';
|
|
27
30
|
import { VerifyCustomerInviteResponseClass } from '../models';
|
|
28
31
|
/**
|
|
29
32
|
* CustomersApi - axios parameter creator
|
|
@@ -47,7 +50,7 @@ export declare const CustomersApiAxiosParamCreator: (configuration?: Configurati
|
|
|
47
50
|
*/
|
|
48
51
|
forgotPassword: (forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
49
52
|
/**
|
|
50
|
-
* Get detailed policy that belongs to a customer
|
|
53
|
+
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
51
54
|
* @summary Get policy details
|
|
52
55
|
* @param {string} policyCode The policy code
|
|
53
56
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
@@ -57,15 +60,32 @@ export declare const CustomersApiAxiosParamCreator: (configuration?: Configurati
|
|
|
57
60
|
* @throws {RequiredError}
|
|
58
61
|
*/
|
|
59
62
|
getPolicy: (policyCode: string, customerCode: string, expand?: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
63
|
+
/**
|
|
64
|
+
* Start auth process to get new access token, refresh token after successful login.
|
|
65
|
+
* @summary Initiate auth by customer
|
|
66
|
+
* @param {InitiateAuthRequestDto} initiateAuthRequestDto
|
|
67
|
+
* @param {*} [options] Override http request option.
|
|
68
|
+
* @throws {RequiredError}
|
|
69
|
+
*/
|
|
70
|
+
initiateAuth: (initiateAuthRequestDto: InitiateAuthRequestDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
71
|
+
/**
|
|
72
|
+
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
73
|
+
* @summary Invite by customer
|
|
74
|
+
* @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
|
|
75
|
+
* @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
76
|
+
* @param {*} [options] Override http request option.
|
|
77
|
+
* @throws {RequiredError}
|
|
78
|
+
*/
|
|
79
|
+
inviteByCustomer: (inviteByCustomerRequestDto: InviteByCustomerRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
60
80
|
/**
|
|
61
81
|
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
62
|
-
* @summary Invite
|
|
63
|
-
* @param {
|
|
82
|
+
* @summary Invite by tenant
|
|
83
|
+
* @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
|
|
64
84
|
* @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
65
85
|
* @param {*} [options] Override http request option.
|
|
66
86
|
* @throws {RequiredError}
|
|
67
87
|
*/
|
|
68
|
-
|
|
88
|
+
inviteByTenant: (inviteByCustomerRequestDto: InviteByCustomerRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
69
89
|
/**
|
|
70
90
|
* List all the invoices of a customer
|
|
71
91
|
* @summary List invoices of a customer
|
|
@@ -96,14 +116,6 @@ export declare const CustomersApiAxiosParamCreator: (configuration?: Configurati
|
|
|
96
116
|
* @throws {RequiredError}
|
|
97
117
|
*/
|
|
98
118
|
listPolicies: (customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
99
|
-
/**
|
|
100
|
-
* Get new access token, refresh token after successful login.
|
|
101
|
-
* @summary Login by customer
|
|
102
|
-
* @param {LoginRequestDto} loginRequestDto
|
|
103
|
-
* @param {*} [options] Override http request option.
|
|
104
|
-
* @throws {RequiredError}
|
|
105
|
-
*/
|
|
106
|
-
login: (loginRequestDto: LoginRequestDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
107
119
|
/**
|
|
108
120
|
* Get new access token, new refresh token.
|
|
109
121
|
* @summary Refresh token by customer
|
|
@@ -121,6 +133,14 @@ export declare const CustomersApiAxiosParamCreator: (configuration?: Configurati
|
|
|
121
133
|
* @throws {RequiredError}
|
|
122
134
|
*/
|
|
123
135
|
resetPassword: (resetPasswordByCustomerRequestDto: ResetPasswordByCustomerRequestDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
136
|
+
/**
|
|
137
|
+
* Respond to the auth challenge to get new access token, refresh token after successful login.
|
|
138
|
+
* @summary Respond to auth challenge by customer
|
|
139
|
+
* @param {RespondToAuthChallengeRequestDto} respondToAuthChallengeRequestDto
|
|
140
|
+
* @param {*} [options] Override http request option.
|
|
141
|
+
* @throws {RequiredError}
|
|
142
|
+
*/
|
|
143
|
+
respondToAuthChallenge: (respondToAuthChallengeRequestDto: RespondToAuthChallengeRequestDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
124
144
|
/**
|
|
125
145
|
* Verify the invite sent to the customer via email.
|
|
126
146
|
* @summary Verify customer\'s invite token
|
|
@@ -160,7 +180,7 @@ export declare const CustomersApiFp: (configuration?: Configuration) => {
|
|
|
160
180
|
*/
|
|
161
181
|
forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
162
182
|
/**
|
|
163
|
-
* Get detailed policy that belongs to a customer
|
|
183
|
+
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
164
184
|
* @summary Get policy details
|
|
165
185
|
* @param {string} policyCode The policy code
|
|
166
186
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
@@ -170,15 +190,32 @@ export declare const CustomersApiFp: (configuration?: Configuration) => {
|
|
|
170
190
|
* @throws {RequiredError}
|
|
171
191
|
*/
|
|
172
192
|
getPolicy(policyCode: string, customerCode: string, expand?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPolicyResponseClass>>;
|
|
193
|
+
/**
|
|
194
|
+
* Start auth process to get new access token, refresh token after successful login.
|
|
195
|
+
* @summary Initiate auth by customer
|
|
196
|
+
* @param {InitiateAuthRequestDto} initiateAuthRequestDto
|
|
197
|
+
* @param {*} [options] Override http request option.
|
|
198
|
+
* @throws {RequiredError}
|
|
199
|
+
*/
|
|
200
|
+
initiateAuth(initiateAuthRequestDto: InitiateAuthRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateAuthResponseClass>>;
|
|
201
|
+
/**
|
|
202
|
+
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
203
|
+
* @summary Invite by customer
|
|
204
|
+
* @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
|
|
205
|
+
* @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
206
|
+
* @param {*} [options] Override http request option.
|
|
207
|
+
* @throws {RequiredError}
|
|
208
|
+
*/
|
|
209
|
+
inviteByCustomer(inviteByCustomerRequestDto: InviteByCustomerRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InviteByCustomerResponseClass>>;
|
|
173
210
|
/**
|
|
174
211
|
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
175
|
-
* @summary Invite
|
|
176
|
-
* @param {
|
|
212
|
+
* @summary Invite by tenant
|
|
213
|
+
* @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
|
|
177
214
|
* @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
178
215
|
* @param {*} [options] Override http request option.
|
|
179
216
|
* @throws {RequiredError}
|
|
180
217
|
*/
|
|
181
|
-
|
|
218
|
+
inviteByTenant(inviteByCustomerRequestDto: InviteByCustomerRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InviteByTenantResponseClass>>;
|
|
182
219
|
/**
|
|
183
220
|
* List all the invoices of a customer
|
|
184
221
|
* @summary List invoices of a customer
|
|
@@ -209,14 +246,6 @@ export declare const CustomersApiFp: (configuration?: Configuration) => {
|
|
|
209
246
|
* @throws {RequiredError}
|
|
210
247
|
*/
|
|
211
248
|
listPolicies(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesResponseClass>>;
|
|
212
|
-
/**
|
|
213
|
-
* Get new access token, refresh token after successful login.
|
|
214
|
-
* @summary Login by customer
|
|
215
|
-
* @param {LoginRequestDto} loginRequestDto
|
|
216
|
-
* @param {*} [options] Override http request option.
|
|
217
|
-
* @throws {RequiredError}
|
|
218
|
-
*/
|
|
219
|
-
login(loginRequestDto: LoginRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LoginResponseClass>>;
|
|
220
249
|
/**
|
|
221
250
|
* Get new access token, new refresh token.
|
|
222
251
|
* @summary Refresh token by customer
|
|
@@ -225,7 +254,7 @@ export declare const CustomersApiFp: (configuration?: Configuration) => {
|
|
|
225
254
|
* @param {*} [options] Override http request option.
|
|
226
255
|
* @throws {RequiredError}
|
|
227
256
|
*/
|
|
228
|
-
refreshToken(refreshTokenDto: RefreshTokenDto, cookie?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<
|
|
257
|
+
refreshToken(refreshTokenDto: RefreshTokenDto, cookie?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
229
258
|
/**
|
|
230
259
|
* Change customer\'s password using the token provided by the reset password endpoint.
|
|
231
260
|
* @summary Change password by customer
|
|
@@ -234,6 +263,14 @@ export declare const CustomersApiFp: (configuration?: Configuration) => {
|
|
|
234
263
|
* @throws {RequiredError}
|
|
235
264
|
*/
|
|
236
265
|
resetPassword(resetPasswordByCustomerRequestDto: ResetPasswordByCustomerRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
266
|
+
/**
|
|
267
|
+
* Respond to the auth challenge to get new access token, refresh token after successful login.
|
|
268
|
+
* @summary Respond to auth challenge by customer
|
|
269
|
+
* @param {RespondToAuthChallengeRequestDto} respondToAuthChallengeRequestDto
|
|
270
|
+
* @param {*} [options] Override http request option.
|
|
271
|
+
* @throws {RequiredError}
|
|
272
|
+
*/
|
|
273
|
+
respondToAuthChallenge(respondToAuthChallengeRequestDto: RespondToAuthChallengeRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RespondToAuthChallengeClass>>;
|
|
237
274
|
/**
|
|
238
275
|
* Verify the invite sent to the customer via email.
|
|
239
276
|
* @summary Verify customer\'s invite token
|
|
@@ -273,7 +310,7 @@ export declare const CustomersApiFactory: (configuration?: Configuration, basePa
|
|
|
273
310
|
*/
|
|
274
311
|
forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: any): AxiosPromise<void>;
|
|
275
312
|
/**
|
|
276
|
-
* Get detailed policy that belongs to a customer
|
|
313
|
+
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
277
314
|
* @summary Get policy details
|
|
278
315
|
* @param {string} policyCode The policy code
|
|
279
316
|
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
@@ -283,15 +320,32 @@ export declare const CustomersApiFactory: (configuration?: Configuration, basePa
|
|
|
283
320
|
* @throws {RequiredError}
|
|
284
321
|
*/
|
|
285
322
|
getPolicy(policyCode: string, customerCode: string, expand?: string, authorization?: string, options?: any): AxiosPromise<GetPolicyResponseClass>;
|
|
323
|
+
/**
|
|
324
|
+
* Start auth process to get new access token, refresh token after successful login.
|
|
325
|
+
* @summary Initiate auth by customer
|
|
326
|
+
* @param {InitiateAuthRequestDto} initiateAuthRequestDto
|
|
327
|
+
* @param {*} [options] Override http request option.
|
|
328
|
+
* @throws {RequiredError}
|
|
329
|
+
*/
|
|
330
|
+
initiateAuth(initiateAuthRequestDto: InitiateAuthRequestDto, options?: any): AxiosPromise<InitiateAuthResponseClass>;
|
|
286
331
|
/**
|
|
287
332
|
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
288
|
-
* @summary Invite
|
|
289
|
-
* @param {
|
|
333
|
+
* @summary Invite by customer
|
|
334
|
+
* @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
|
|
290
335
|
* @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
291
336
|
* @param {*} [options] Override http request option.
|
|
292
337
|
* @throws {RequiredError}
|
|
293
338
|
*/
|
|
294
|
-
|
|
339
|
+
inviteByCustomer(inviteByCustomerRequestDto: InviteByCustomerRequestDto, authorization?: string, options?: any): AxiosPromise<InviteByCustomerResponseClass>;
|
|
340
|
+
/**
|
|
341
|
+
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
342
|
+
* @summary Invite by tenant
|
|
343
|
+
* @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
|
|
344
|
+
* @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
345
|
+
* @param {*} [options] Override http request option.
|
|
346
|
+
* @throws {RequiredError}
|
|
347
|
+
*/
|
|
348
|
+
inviteByTenant(inviteByCustomerRequestDto: InviteByCustomerRequestDto, authorization?: string, options?: any): AxiosPromise<InviteByTenantResponseClass>;
|
|
295
349
|
/**
|
|
296
350
|
* List all the invoices of a customer
|
|
297
351
|
* @summary List invoices of a customer
|
|
@@ -322,14 +376,6 @@ export declare const CustomersApiFactory: (configuration?: Configuration, basePa
|
|
|
322
376
|
* @throws {RequiredError}
|
|
323
377
|
*/
|
|
324
378
|
listPolicies(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: any): AxiosPromise<ListPoliciesResponseClass>;
|
|
325
|
-
/**
|
|
326
|
-
* Get new access token, refresh token after successful login.
|
|
327
|
-
* @summary Login by customer
|
|
328
|
-
* @param {LoginRequestDto} loginRequestDto
|
|
329
|
-
* @param {*} [options] Override http request option.
|
|
330
|
-
* @throws {RequiredError}
|
|
331
|
-
*/
|
|
332
|
-
login(loginRequestDto: LoginRequestDto, options?: any): AxiosPromise<LoginResponseClass>;
|
|
333
379
|
/**
|
|
334
380
|
* Get new access token, new refresh token.
|
|
335
381
|
* @summary Refresh token by customer
|
|
@@ -338,7 +384,7 @@ export declare const CustomersApiFactory: (configuration?: Configuration, basePa
|
|
|
338
384
|
* @param {*} [options] Override http request option.
|
|
339
385
|
* @throws {RequiredError}
|
|
340
386
|
*/
|
|
341
|
-
refreshToken(refreshTokenDto: RefreshTokenDto, cookie?: string, options?: any): AxiosPromise<
|
|
387
|
+
refreshToken(refreshTokenDto: RefreshTokenDto, cookie?: string, options?: any): AxiosPromise<void>;
|
|
342
388
|
/**
|
|
343
389
|
* Change customer\'s password using the token provided by the reset password endpoint.
|
|
344
390
|
* @summary Change password by customer
|
|
@@ -347,6 +393,14 @@ export declare const CustomersApiFactory: (configuration?: Configuration, basePa
|
|
|
347
393
|
* @throws {RequiredError}
|
|
348
394
|
*/
|
|
349
395
|
resetPassword(resetPasswordByCustomerRequestDto: ResetPasswordByCustomerRequestDto, options?: any): AxiosPromise<void>;
|
|
396
|
+
/**
|
|
397
|
+
* Respond to the auth challenge to get new access token, refresh token after successful login.
|
|
398
|
+
* @summary Respond to auth challenge by customer
|
|
399
|
+
* @param {RespondToAuthChallengeRequestDto} respondToAuthChallengeRequestDto
|
|
400
|
+
* @param {*} [options] Override http request option.
|
|
401
|
+
* @throws {RequiredError}
|
|
402
|
+
*/
|
|
403
|
+
respondToAuthChallenge(respondToAuthChallengeRequestDto: RespondToAuthChallengeRequestDto, options?: any): AxiosPromise<RespondToAuthChallengeClass>;
|
|
350
404
|
/**
|
|
351
405
|
* Verify the invite sent to the customer via email.
|
|
352
406
|
* @summary Verify customer\'s invite token
|
|
@@ -422,21 +476,53 @@ export interface CustomersApiGetPolicyRequest {
|
|
|
422
476
|
readonly authorization?: string;
|
|
423
477
|
}
|
|
424
478
|
/**
|
|
425
|
-
* Request parameters for
|
|
479
|
+
* Request parameters for initiateAuth operation in CustomersApi.
|
|
426
480
|
* @export
|
|
427
|
-
* @interface
|
|
481
|
+
* @interface CustomersApiInitiateAuthRequest
|
|
428
482
|
*/
|
|
429
|
-
export interface
|
|
483
|
+
export interface CustomersApiInitiateAuthRequest {
|
|
430
484
|
/**
|
|
431
485
|
*
|
|
432
|
-
* @type {
|
|
433
|
-
* @memberof
|
|
486
|
+
* @type {InitiateAuthRequestDto}
|
|
487
|
+
* @memberof CustomersApiInitiateAuth
|
|
434
488
|
*/
|
|
435
|
-
readonly
|
|
489
|
+
readonly initiateAuthRequestDto: InitiateAuthRequestDto;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Request parameters for inviteByCustomer operation in CustomersApi.
|
|
493
|
+
* @export
|
|
494
|
+
* @interface CustomersApiInviteByCustomerRequest
|
|
495
|
+
*/
|
|
496
|
+
export interface CustomersApiInviteByCustomerRequest {
|
|
497
|
+
/**
|
|
498
|
+
*
|
|
499
|
+
* @type {InviteByCustomerRequestDto}
|
|
500
|
+
* @memberof CustomersApiInviteByCustomer
|
|
501
|
+
*/
|
|
502
|
+
readonly inviteByCustomerRequestDto: InviteByCustomerRequestDto;
|
|
436
503
|
/**
|
|
437
504
|
* Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
438
505
|
* @type {string}
|
|
439
|
-
* @memberof
|
|
506
|
+
* @memberof CustomersApiInviteByCustomer
|
|
507
|
+
*/
|
|
508
|
+
readonly authorization?: string;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Request parameters for inviteByTenant operation in CustomersApi.
|
|
512
|
+
* @export
|
|
513
|
+
* @interface CustomersApiInviteByTenantRequest
|
|
514
|
+
*/
|
|
515
|
+
export interface CustomersApiInviteByTenantRequest {
|
|
516
|
+
/**
|
|
517
|
+
*
|
|
518
|
+
* @type {InviteByCustomerRequestDto}
|
|
519
|
+
* @memberof CustomersApiInviteByTenant
|
|
520
|
+
*/
|
|
521
|
+
readonly inviteByCustomerRequestDto: InviteByCustomerRequestDto;
|
|
522
|
+
/**
|
|
523
|
+
* Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
|
|
524
|
+
* @type {string}
|
|
525
|
+
* @memberof CustomersApiInviteByTenant
|
|
440
526
|
*/
|
|
441
527
|
readonly authorization?: string;
|
|
442
528
|
}
|
|
@@ -550,19 +636,6 @@ export interface CustomersApiListPoliciesRequest {
|
|
|
550
636
|
*/
|
|
551
637
|
readonly authorization?: string;
|
|
552
638
|
}
|
|
553
|
-
/**
|
|
554
|
-
* Request parameters for login operation in CustomersApi.
|
|
555
|
-
* @export
|
|
556
|
-
* @interface CustomersApiLoginRequest
|
|
557
|
-
*/
|
|
558
|
-
export interface CustomersApiLoginRequest {
|
|
559
|
-
/**
|
|
560
|
-
*
|
|
561
|
-
* @type {LoginRequestDto}
|
|
562
|
-
* @memberof CustomersApiLogin
|
|
563
|
-
*/
|
|
564
|
-
readonly loginRequestDto: LoginRequestDto;
|
|
565
|
-
}
|
|
566
639
|
/**
|
|
567
640
|
* Request parameters for refreshToken operation in CustomersApi.
|
|
568
641
|
* @export
|
|
@@ -595,6 +668,19 @@ export interface CustomersApiResetPasswordRequest {
|
|
|
595
668
|
*/
|
|
596
669
|
readonly resetPasswordByCustomerRequestDto: ResetPasswordByCustomerRequestDto;
|
|
597
670
|
}
|
|
671
|
+
/**
|
|
672
|
+
* Request parameters for respondToAuthChallenge operation in CustomersApi.
|
|
673
|
+
* @export
|
|
674
|
+
* @interface CustomersApiRespondToAuthChallengeRequest
|
|
675
|
+
*/
|
|
676
|
+
export interface CustomersApiRespondToAuthChallengeRequest {
|
|
677
|
+
/**
|
|
678
|
+
*
|
|
679
|
+
* @type {RespondToAuthChallengeRequestDto}
|
|
680
|
+
* @memberof CustomersApiRespondToAuthChallenge
|
|
681
|
+
*/
|
|
682
|
+
readonly respondToAuthChallengeRequestDto: RespondToAuthChallengeRequestDto;
|
|
683
|
+
}
|
|
598
684
|
/**
|
|
599
685
|
* Request parameters for verifyInvite operation in CustomersApi.
|
|
600
686
|
* @export
|
|
@@ -647,7 +733,7 @@ export declare class CustomersApi extends BaseAPI {
|
|
|
647
733
|
*/
|
|
648
734
|
forgotPassword(requestParameters: CustomersApiForgotPasswordRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
649
735
|
/**
|
|
650
|
-
* Get detailed policy that belongs to a customer
|
|
736
|
+
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
651
737
|
* @summary Get policy details
|
|
652
738
|
* @param {CustomersApiGetPolicyRequest} requestParameters Request parameters.
|
|
653
739
|
* @param {*} [options] Override http request option.
|
|
@@ -655,15 +741,33 @@ export declare class CustomersApi extends BaseAPI {
|
|
|
655
741
|
* @memberof CustomersApi
|
|
656
742
|
*/
|
|
657
743
|
getPolicy(requestParameters: CustomersApiGetPolicyRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetPolicyResponseClass, any>>;
|
|
744
|
+
/**
|
|
745
|
+
* Start auth process to get new access token, refresh token after successful login.
|
|
746
|
+
* @summary Initiate auth by customer
|
|
747
|
+
* @param {CustomersApiInitiateAuthRequest} requestParameters Request parameters.
|
|
748
|
+
* @param {*} [options] Override http request option.
|
|
749
|
+
* @throws {RequiredError}
|
|
750
|
+
* @memberof CustomersApi
|
|
751
|
+
*/
|
|
752
|
+
initiateAuth(requestParameters: CustomersApiInitiateAuthRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InitiateAuthResponseClass, any>>;
|
|
658
753
|
/**
|
|
659
754
|
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
660
|
-
* @summary Invite
|
|
661
|
-
* @param {
|
|
755
|
+
* @summary Invite by customer
|
|
756
|
+
* @param {CustomersApiInviteByCustomerRequest} requestParameters Request parameters.
|
|
662
757
|
* @param {*} [options] Override http request option.
|
|
663
758
|
* @throws {RequiredError}
|
|
664
759
|
* @memberof CustomersApi
|
|
665
760
|
*/
|
|
666
|
-
|
|
761
|
+
inviteByCustomer(requestParameters: CustomersApiInviteByCustomerRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InviteByCustomerResponseClass, any>>;
|
|
762
|
+
/**
|
|
763
|
+
* Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
|
|
764
|
+
* @summary Invite by tenant
|
|
765
|
+
* @param {CustomersApiInviteByTenantRequest} requestParameters Request parameters.
|
|
766
|
+
* @param {*} [options] Override http request option.
|
|
767
|
+
* @throws {RequiredError}
|
|
768
|
+
* @memberof CustomersApi
|
|
769
|
+
*/
|
|
770
|
+
inviteByTenant(requestParameters: CustomersApiInviteByTenantRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InviteByTenantResponseClass, any>>;
|
|
667
771
|
/**
|
|
668
772
|
* List all the invoices of a customer
|
|
669
773
|
* @summary List invoices of a customer
|
|
@@ -682,15 +786,6 @@ export declare class CustomersApi extends BaseAPI {
|
|
|
682
786
|
* @memberof CustomersApi
|
|
683
787
|
*/
|
|
684
788
|
listPolicies(requestParameters: CustomersApiListPoliciesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListPoliciesResponseClass, any>>;
|
|
685
|
-
/**
|
|
686
|
-
* Get new access token, refresh token after successful login.
|
|
687
|
-
* @summary Login by customer
|
|
688
|
-
* @param {CustomersApiLoginRequest} requestParameters Request parameters.
|
|
689
|
-
* @param {*} [options] Override http request option.
|
|
690
|
-
* @throws {RequiredError}
|
|
691
|
-
* @memberof CustomersApi
|
|
692
|
-
*/
|
|
693
|
-
login(requestParameters: CustomersApiLoginRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<LoginResponseClass, any>>;
|
|
694
789
|
/**
|
|
695
790
|
* Get new access token, new refresh token.
|
|
696
791
|
* @summary Refresh token by customer
|
|
@@ -699,7 +794,7 @@ export declare class CustomersApi extends BaseAPI {
|
|
|
699
794
|
* @throws {RequiredError}
|
|
700
795
|
* @memberof CustomersApi
|
|
701
796
|
*/
|
|
702
|
-
refreshToken(requestParameters: CustomersApiRefreshTokenRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<
|
|
797
|
+
refreshToken(requestParameters: CustomersApiRefreshTokenRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
703
798
|
/**
|
|
704
799
|
* Change customer\'s password using the token provided by the reset password endpoint.
|
|
705
800
|
* @summary Change password by customer
|
|
@@ -709,6 +804,15 @@ export declare class CustomersApi extends BaseAPI {
|
|
|
709
804
|
* @memberof CustomersApi
|
|
710
805
|
*/
|
|
711
806
|
resetPassword(requestParameters: CustomersApiResetPasswordRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
807
|
+
/**
|
|
808
|
+
* Respond to the auth challenge to get new access token, refresh token after successful login.
|
|
809
|
+
* @summary Respond to auth challenge by customer
|
|
810
|
+
* @param {CustomersApiRespondToAuthChallengeRequest} requestParameters Request parameters.
|
|
811
|
+
* @param {*} [options] Override http request option.
|
|
812
|
+
* @throws {RequiredError}
|
|
813
|
+
* @memberof CustomersApi
|
|
814
|
+
*/
|
|
815
|
+
respondToAuthChallenge(requestParameters: CustomersApiRespondToAuthChallengeRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RespondToAuthChallengeClass, any>>;
|
|
712
816
|
/**
|
|
713
817
|
* Verify the invite sent to the customer via email.
|
|
714
818
|
* @summary Verify customer\'s invite token
|