@emilgroup/account-sdk 1.49.1-beta.5 → 1.49.1-beta.6
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 +2 -0
- package/README.md +2 -2
- package/api/accounts-api.ts +120 -0
- package/base.ts +36 -15
- package/configuration.ts +11 -0
- package/dist/api/accounts-api.d.ts +66 -0
- package/dist/api/accounts-api.js +99 -0
- package/dist/base.d.ts +1 -0
- package/dist/base.js +36 -16
- package/dist/configuration.d.ts +9 -0
- package/dist/configuration.js +1 -0
- package/dist/models/create-account-request-dto.d.ts +8 -4
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/register-account-policy-request-dto.d.ts +30 -0
- package/dist/models/register-account-policy-request-dto.js +15 -0
- package/dist/models/register-policy-response-class.d.ts +25 -0
- package/dist/models/register-policy-response-class.js +15 -0
- package/dist/models/update-account-request-dto.d.ts +8 -4
- package/models/create-account-request-dto.ts +4 -4
- package/models/index.ts +2 -0
- package/models/register-account-policy-request-dto.ts +36 -0
- package/models/register-policy-response-class.ts +31 -0
- package/models/update-account-request-dto.ts +4 -4
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -19,6 +19,8 @@ models/inline-response200.ts
|
|
|
19
19
|
models/inline-response503.ts
|
|
20
20
|
models/list-accounts-response-class.ts
|
|
21
21
|
models/policy-class.ts
|
|
22
|
+
models/register-account-policy-request-dto.ts
|
|
23
|
+
models/register-policy-response-class.ts
|
|
22
24
|
models/update-account-request-dto.ts
|
|
23
25
|
models/update-account-response-class.ts
|
|
24
26
|
package.json
|
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/account-sdk@1.49.1-beta.
|
|
20
|
+
npm install @emilgroup/account-sdk@1.49.1-beta.6 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/account-sdk@1.49.1-beta.
|
|
24
|
+
yarn add @emilgroup/account-sdk@1.49.1-beta.6
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `AccountsApi`.
|
package/api/accounts-api.ts
CHANGED
|
@@ -29,6 +29,10 @@ import { GetAccountResponseClass } from '../models';
|
|
|
29
29
|
// @ts-ignore
|
|
30
30
|
import { ListAccountsResponseClass } from '../models';
|
|
31
31
|
// @ts-ignore
|
|
32
|
+
import { RegisterAccountPolicyRequestDto } from '../models';
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
import { RegisterPolicyResponseClass } from '../models';
|
|
35
|
+
// @ts-ignore
|
|
32
36
|
import { UpdateAccountRequestDto } from '../models';
|
|
33
37
|
// @ts-ignore
|
|
34
38
|
import { UpdateAccountResponseClass } from '../models';
|
|
@@ -306,6 +310,57 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
306
310
|
options: localVarRequestOptions,
|
|
307
311
|
};
|
|
308
312
|
},
|
|
313
|
+
/**
|
|
314
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
315
|
+
* @summary Create the account policy
|
|
316
|
+
* @param {string} code Unique identifier for the object.
|
|
317
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
318
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
319
|
+
* @param {*} [options] Override http request option.
|
|
320
|
+
* @throws {RequiredError}
|
|
321
|
+
*/
|
|
322
|
+
registerPolicy: async (code: string, registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
323
|
+
// verify required parameter 'code' is not null or undefined
|
|
324
|
+
assertParamExists('registerPolicy', 'code', code)
|
|
325
|
+
// verify required parameter 'registerAccountPolicyRequestDto' is not null or undefined
|
|
326
|
+
assertParamExists('registerPolicy', 'registerAccountPolicyRequestDto', registerAccountPolicyRequestDto)
|
|
327
|
+
const localVarPath = `/accountservice/v1/accounts/{code}/policies`
|
|
328
|
+
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
329
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
330
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
331
|
+
let baseOptions;
|
|
332
|
+
let baseAccessToken;
|
|
333
|
+
if (configuration) {
|
|
334
|
+
baseOptions = configuration.baseOptions;
|
|
335
|
+
baseAccessToken = configuration.accessToken;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
339
|
+
const localVarHeaderParameter = {} as any;
|
|
340
|
+
const localVarQueryParameter = {} as any;
|
|
341
|
+
|
|
342
|
+
// authentication bearer required
|
|
343
|
+
// http bearer authentication required
|
|
344
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
345
|
+
|
|
346
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
347
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
353
|
+
|
|
354
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
355
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
356
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
357
|
+
localVarRequestOptions.data = serializeDataIfNeeded(registerAccountPolicyRequestDto, localVarRequestOptions, configuration)
|
|
358
|
+
|
|
359
|
+
return {
|
|
360
|
+
url: toPathString(localVarUrlObj),
|
|
361
|
+
options: localVarRequestOptions,
|
|
362
|
+
};
|
|
363
|
+
},
|
|
309
364
|
/**
|
|
310
365
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
311
366
|
* @summary Update the account
|
|
@@ -435,6 +490,19 @@ export const AccountsApiFp = function(configuration?: Configuration) {
|
|
|
435
490
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
436
491
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
437
492
|
},
|
|
493
|
+
/**
|
|
494
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
495
|
+
* @summary Create the account policy
|
|
496
|
+
* @param {string} code Unique identifier for the object.
|
|
497
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
498
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
499
|
+
* @param {*} [options] Override http request option.
|
|
500
|
+
* @throws {RequiredError}
|
|
501
|
+
*/
|
|
502
|
+
async registerPolicy(code: string, registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RegisterPolicyResponseClass>> {
|
|
503
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.registerPolicy(code, registerAccountPolicyRequestDto, authorization, options);
|
|
504
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
505
|
+
},
|
|
438
506
|
/**
|
|
439
507
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
440
508
|
* @summary Update the account
|
|
@@ -521,6 +589,18 @@ export const AccountsApiFactory = function (configuration?: Configuration, baseP
|
|
|
521
589
|
listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode', search?: string, order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber', expand?: 'policies', filters?: string, options?: any): AxiosPromise<ListAccountsResponseClass> {
|
|
522
590
|
return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
523
591
|
},
|
|
592
|
+
/**
|
|
593
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
594
|
+
* @summary Create the account policy
|
|
595
|
+
* @param {string} code Unique identifier for the object.
|
|
596
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
597
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
598
|
+
* @param {*} [options] Override http request option.
|
|
599
|
+
* @throws {RequiredError}
|
|
600
|
+
*/
|
|
601
|
+
registerPolicy(code: string, registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto, authorization?: string, options?: any): AxiosPromise<RegisterPolicyResponseClass> {
|
|
602
|
+
return localVarFp.registerPolicy(code, registerAccountPolicyRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
603
|
+
},
|
|
524
604
|
/**
|
|
525
605
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
526
606
|
* @summary Update the account
|
|
@@ -697,6 +777,34 @@ export interface AccountsApiListAccountsRequest {
|
|
|
697
777
|
readonly filters?: string
|
|
698
778
|
}
|
|
699
779
|
|
|
780
|
+
/**
|
|
781
|
+
* Request parameters for registerPolicy operation in AccountsApi.
|
|
782
|
+
* @export
|
|
783
|
+
* @interface AccountsApiRegisterPolicyRequest
|
|
784
|
+
*/
|
|
785
|
+
export interface AccountsApiRegisterPolicyRequest {
|
|
786
|
+
/**
|
|
787
|
+
* Unique identifier for the object.
|
|
788
|
+
* @type {string}
|
|
789
|
+
* @memberof AccountsApiRegisterPolicy
|
|
790
|
+
*/
|
|
791
|
+
readonly code: string
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
*
|
|
795
|
+
* @type {RegisterAccountPolicyRequestDto}
|
|
796
|
+
* @memberof AccountsApiRegisterPolicy
|
|
797
|
+
*/
|
|
798
|
+
readonly registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
802
|
+
* @type {string}
|
|
803
|
+
* @memberof AccountsApiRegisterPolicy
|
|
804
|
+
*/
|
|
805
|
+
readonly authorization?: string
|
|
806
|
+
}
|
|
807
|
+
|
|
700
808
|
/**
|
|
701
809
|
* Request parameters for updateAccount operation in AccountsApi.
|
|
702
810
|
* @export
|
|
@@ -792,6 +900,18 @@ export class AccountsApi extends BaseAPI {
|
|
|
792
900
|
return AccountsApiFp(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
|
|
793
901
|
}
|
|
794
902
|
|
|
903
|
+
/**
|
|
904
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
905
|
+
* @summary Create the account policy
|
|
906
|
+
* @param {AccountsApiRegisterPolicyRequest} requestParameters Request parameters.
|
|
907
|
+
* @param {*} [options] Override http request option.
|
|
908
|
+
* @throws {RequiredError}
|
|
909
|
+
* @memberof AccountsApi
|
|
910
|
+
*/
|
|
911
|
+
public registerPolicy(requestParameters: AccountsApiRegisterPolicyRequest, options?: AxiosRequestConfig) {
|
|
912
|
+
return AccountsApiFp(this.configuration).registerPolicy(requestParameters.code, requestParameters.registerAccountPolicyRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
913
|
+
}
|
|
914
|
+
|
|
795
915
|
/**
|
|
796
916
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
797
917
|
* @summary Update the account
|
package/base.ts
CHANGED
|
@@ -102,10 +102,14 @@ export class BaseAPI {
|
|
|
102
102
|
this.configuration = configuration;
|
|
103
103
|
this.basePath = configuration.basePath || this.basePath;
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
if (configuration.cookieAuth) {
|
|
106
|
+
this.useCookieAuth();
|
|
107
|
+
} else {
|
|
108
|
+
// Use config token if provided, otherwise use tokenData token
|
|
109
|
+
const configToken = this.configuration.accessToken;
|
|
110
|
+
const storedToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
111
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
112
|
+
}
|
|
109
113
|
} else {
|
|
110
114
|
const { accessToken, username } = this.tokenData;
|
|
111
115
|
|
|
@@ -119,6 +123,12 @@ export class BaseAPI {
|
|
|
119
123
|
this.attachInterceptor(axios);
|
|
120
124
|
}
|
|
121
125
|
|
|
126
|
+
// Cookie mode: the browser sends the HttpOnly access cookie, so no token is read from storage.
|
|
127
|
+
private useCookieAuth() {
|
|
128
|
+
this.configuration.username = this.configuration.username || this.tokenData.username;
|
|
129
|
+
this.configuration.baseOptions = { ...this.configuration.baseOptions, withCredentials: true };
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
selectEnvironment(env: Environment) {
|
|
123
133
|
this.selectBasePath(env);
|
|
124
134
|
}
|
|
@@ -152,10 +162,12 @@ export class BaseAPI {
|
|
|
152
162
|
const { data: { accessToken, permissions } } = response;
|
|
153
163
|
|
|
154
164
|
this.configuration.username = username;
|
|
155
|
-
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
156
165
|
this.tokenData.username = username;
|
|
157
|
-
this.tokenData.accessToken = accessToken;
|
|
158
166
|
this.tokenData.permissions = permissions;
|
|
167
|
+
if (!this.configuration.cookieAuth) {
|
|
168
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
169
|
+
this.tokenData.accessToken = accessToken;
|
|
170
|
+
}
|
|
159
171
|
|
|
160
172
|
// Switch workspace if provided
|
|
161
173
|
if (targetWorkspace) {
|
|
@@ -178,7 +190,7 @@ export class BaseAPI {
|
|
|
178
190
|
url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
|
|
179
191
|
headers: {
|
|
180
192
|
'Content-Type': 'application/json',
|
|
181
|
-
'Authorization': `Bearer ${this.configuration.accessToken}
|
|
193
|
+
...(this.configuration.cookieAuth ? {} : { 'Authorization': `Bearer ${this.configuration.accessToken}` }),
|
|
182
194
|
},
|
|
183
195
|
data: {
|
|
184
196
|
username: this.configuration.username,
|
|
@@ -190,10 +202,12 @@ export class BaseAPI {
|
|
|
190
202
|
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
191
203
|
|
|
192
204
|
const { data: { accessToken, permissions } } = response;
|
|
193
|
-
|
|
194
|
-
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
195
|
-
this.tokenData.accessToken = accessToken;
|
|
205
|
+
|
|
196
206
|
this.tokenData.permissions = permissions;
|
|
207
|
+
if (!this.configuration.cookieAuth) {
|
|
208
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
209
|
+
this.tokenData.accessToken = accessToken;
|
|
210
|
+
}
|
|
197
211
|
|
|
198
212
|
this.storeTokenData({
|
|
199
213
|
...this.tokenData
|
|
@@ -233,6 +247,11 @@ export class BaseAPI {
|
|
|
233
247
|
|
|
234
248
|
private storeTokenData(tokenData?: TokenData) {
|
|
235
249
|
if (typeof window !== 'undefined') {
|
|
250
|
+
if (tokenData && this.configuration?.cookieAuth) {
|
|
251
|
+
// Cookie mode saves who is logged in, never the token; a token saved by apps not yet migrated stays.
|
|
252
|
+
const { username, permissions } = tokenData;
|
|
253
|
+
tokenData = { ...(defaultStorage().get<TokenData>(TOKEN_DATA) || {}), username, permissions };
|
|
254
|
+
}
|
|
236
255
|
defaultStorage().set<TokenData>(TOKEN_DATA, tokenData);
|
|
237
256
|
}
|
|
238
257
|
}
|
|
@@ -263,15 +282,17 @@ export class BaseAPI {
|
|
|
263
282
|
originalConfig._retry = true;
|
|
264
283
|
try {
|
|
265
284
|
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
266
|
-
const accessToken = `Bearer ${tokenString}`;
|
|
267
285
|
this.tokenData.permissions = permissions;
|
|
268
286
|
|
|
269
287
|
delete originalConfig.headers['Authorization']
|
|
270
288
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
289
|
+
// In cookie mode the refresh reply renewed the access cookie, so retry without a header.
|
|
290
|
+
if (!this.configuration.cookieAuth) {
|
|
291
|
+
const accessToken = `Bearer ${tokenString}`;
|
|
292
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
293
|
+
this.configuration.accessToken = accessToken;
|
|
294
|
+
this.tokenData.accessToken = tokenString;
|
|
295
|
+
}
|
|
275
296
|
|
|
276
297
|
this.storeTokenData(this.tokenData);
|
|
277
298
|
|
package/configuration.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface ConfigurationParameters {
|
|
|
21
21
|
basePath?: string;
|
|
22
22
|
baseOptions?: any;
|
|
23
23
|
formDataCtor?: new () => any;
|
|
24
|
+
cookieAuth?: boolean;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export class Configuration {
|
|
@@ -74,6 +75,15 @@ export class Configuration {
|
|
|
74
75
|
*/
|
|
75
76
|
formDataCtor?: new () => any;
|
|
76
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Authenticate with the HttpOnly access cookie instead of a stored token: every call sends credentials.
|
|
80
|
+
* The browser holds one cookie, so use it with one logged-in account; log out through the auth service.
|
|
81
|
+
*
|
|
82
|
+
* @type {boolean}
|
|
83
|
+
* @memberof Configuration
|
|
84
|
+
*/
|
|
85
|
+
cookieAuth?: boolean;
|
|
86
|
+
|
|
77
87
|
constructor(param: ConfigurationParameters = {}) {
|
|
78
88
|
this.apiKey = param.apiKey;
|
|
79
89
|
this.username = param.username;
|
|
@@ -82,6 +92,7 @@ export class Configuration {
|
|
|
82
92
|
this.basePath = param.basePath;
|
|
83
93
|
this.baseOptions = param.baseOptions;
|
|
84
94
|
this.formDataCtor = param.formDataCtor;
|
|
95
|
+
this.cookieAuth = param.cookieAuth;
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
/**
|
|
@@ -16,6 +16,8 @@ import { CreateAccountRequestDto } from '../models';
|
|
|
16
16
|
import { CreateAccountResponseClass } from '../models';
|
|
17
17
|
import { GetAccountResponseClass } from '../models';
|
|
18
18
|
import { ListAccountsResponseClass } from '../models';
|
|
19
|
+
import { RegisterAccountPolicyRequestDto } from '../models';
|
|
20
|
+
import { RegisterPolicyResponseClass } from '../models';
|
|
19
21
|
import { UpdateAccountRequestDto } from '../models';
|
|
20
22
|
import { UpdateAccountResponseClass } from '../models';
|
|
21
23
|
/**
|
|
@@ -76,6 +78,16 @@ export declare const AccountsApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
76
78
|
* @throws {RequiredError}
|
|
77
79
|
*/
|
|
78
80
|
listAccounts: (authorization?: string, pageSize?: number, pageToken?: string, filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode', search?: string, order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber', expand?: 'policies', filters?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
81
|
+
/**
|
|
82
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
83
|
+
* @summary Create the account policy
|
|
84
|
+
* @param {string} code Unique identifier for the object.
|
|
85
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
86
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
87
|
+
* @param {*} [options] Override http request option.
|
|
88
|
+
* @throws {RequiredError}
|
|
89
|
+
*/
|
|
90
|
+
registerPolicy: (code: string, registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
79
91
|
/**
|
|
80
92
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
81
93
|
* @summary Update the account
|
|
@@ -145,6 +157,16 @@ export declare const AccountsApiFp: (configuration?: Configuration) => {
|
|
|
145
157
|
* @throws {RequiredError}
|
|
146
158
|
*/
|
|
147
159
|
listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode', search?: string, order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber', expand?: 'policies', filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListAccountsResponseClass>>;
|
|
160
|
+
/**
|
|
161
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
162
|
+
* @summary Create the account policy
|
|
163
|
+
* @param {string} code Unique identifier for the object.
|
|
164
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
165
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
166
|
+
* @param {*} [options] Override http request option.
|
|
167
|
+
* @throws {RequiredError}
|
|
168
|
+
*/
|
|
169
|
+
registerPolicy(code: string, registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RegisterPolicyResponseClass>>;
|
|
148
170
|
/**
|
|
149
171
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
150
172
|
* @summary Update the account
|
|
@@ -214,6 +236,16 @@ export declare const AccountsApiFactory: (configuration?: Configuration, basePat
|
|
|
214
236
|
* @throws {RequiredError}
|
|
215
237
|
*/
|
|
216
238
|
listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode', search?: string, order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber', expand?: 'policies', filters?: string, options?: any): AxiosPromise<ListAccountsResponseClass>;
|
|
239
|
+
/**
|
|
240
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
241
|
+
* @summary Create the account policy
|
|
242
|
+
* @param {string} code Unique identifier for the object.
|
|
243
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
244
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
245
|
+
* @param {*} [options] Override http request option.
|
|
246
|
+
* @throws {RequiredError}
|
|
247
|
+
*/
|
|
248
|
+
registerPolicy(code: string, registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto, authorization?: string, options?: any): AxiosPromise<RegisterPolicyResponseClass>;
|
|
217
249
|
/**
|
|
218
250
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
219
251
|
* @summary Update the account
|
|
@@ -368,6 +400,31 @@ export interface AccountsApiListAccountsRequest {
|
|
|
368
400
|
*/
|
|
369
401
|
readonly filters?: string;
|
|
370
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Request parameters for registerPolicy operation in AccountsApi.
|
|
405
|
+
* @export
|
|
406
|
+
* @interface AccountsApiRegisterPolicyRequest
|
|
407
|
+
*/
|
|
408
|
+
export interface AccountsApiRegisterPolicyRequest {
|
|
409
|
+
/**
|
|
410
|
+
* Unique identifier for the object.
|
|
411
|
+
* @type {string}
|
|
412
|
+
* @memberof AccountsApiRegisterPolicy
|
|
413
|
+
*/
|
|
414
|
+
readonly code: string;
|
|
415
|
+
/**
|
|
416
|
+
*
|
|
417
|
+
* @type {RegisterAccountPolicyRequestDto}
|
|
418
|
+
* @memberof AccountsApiRegisterPolicy
|
|
419
|
+
*/
|
|
420
|
+
readonly registerAccountPolicyRequestDto: RegisterAccountPolicyRequestDto;
|
|
421
|
+
/**
|
|
422
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
423
|
+
* @type {string}
|
|
424
|
+
* @memberof AccountsApiRegisterPolicy
|
|
425
|
+
*/
|
|
426
|
+
readonly authorization?: string;
|
|
427
|
+
}
|
|
371
428
|
/**
|
|
372
429
|
* Request parameters for updateAccount operation in AccountsApi.
|
|
373
430
|
* @export
|
|
@@ -445,6 +502,15 @@ export declare class AccountsApi extends BaseAPI {
|
|
|
445
502
|
* @memberof AccountsApi
|
|
446
503
|
*/
|
|
447
504
|
listAccounts(requestParameters?: AccountsApiListAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListAccountsResponseClass, any, {}>>;
|
|
505
|
+
/**
|
|
506
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
507
|
+
* @summary Create the account policy
|
|
508
|
+
* @param {AccountsApiRegisterPolicyRequest} requestParameters Request parameters.
|
|
509
|
+
* @param {*} [options] Override http request option.
|
|
510
|
+
* @throws {RequiredError}
|
|
511
|
+
* @memberof AccountsApi
|
|
512
|
+
*/
|
|
513
|
+
registerPolicy(requestParameters: AccountsApiRegisterPolicyRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RegisterPolicyResponseClass, any, {}>>;
|
|
448
514
|
/**
|
|
449
515
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
450
516
|
* @summary Update the account
|
package/dist/api/accounts-api.js
CHANGED
|
@@ -365,6 +365,59 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
365
365
|
});
|
|
366
366
|
});
|
|
367
367
|
},
|
|
368
|
+
/**
|
|
369
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
370
|
+
* @summary Create the account policy
|
|
371
|
+
* @param {string} code Unique identifier for the object.
|
|
372
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
373
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
374
|
+
* @param {*} [options] Override http request option.
|
|
375
|
+
* @throws {RequiredError}
|
|
376
|
+
*/
|
|
377
|
+
registerPolicy: function (code, registerAccountPolicyRequestDto, authorization, options) {
|
|
378
|
+
if (options === void 0) { options = {}; }
|
|
379
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
380
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
381
|
+
return __generator(this, function (_a) {
|
|
382
|
+
switch (_a.label) {
|
|
383
|
+
case 0:
|
|
384
|
+
// verify required parameter 'code' is not null or undefined
|
|
385
|
+
(0, common_1.assertParamExists)('registerPolicy', 'code', code);
|
|
386
|
+
// verify required parameter 'registerAccountPolicyRequestDto' is not null or undefined
|
|
387
|
+
(0, common_1.assertParamExists)('registerPolicy', 'registerAccountPolicyRequestDto', registerAccountPolicyRequestDto);
|
|
388
|
+
localVarPath = "/accountservice/v1/accounts/{code}/policies"
|
|
389
|
+
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
390
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
391
|
+
if (configuration) {
|
|
392
|
+
baseOptions = configuration.baseOptions;
|
|
393
|
+
baseAccessToken = configuration.accessToken;
|
|
394
|
+
}
|
|
395
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
396
|
+
localVarHeaderParameter = {};
|
|
397
|
+
localVarQueryParameter = {};
|
|
398
|
+
// authentication bearer required
|
|
399
|
+
// http bearer authentication required
|
|
400
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
401
|
+
case 1:
|
|
402
|
+
// authentication bearer required
|
|
403
|
+
// http bearer authentication required
|
|
404
|
+
_a.sent();
|
|
405
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
406
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
407
|
+
}
|
|
408
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
409
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
410
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
411
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
412
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(registerAccountPolicyRequestDto, localVarRequestOptions, configuration);
|
|
413
|
+
return [2 /*return*/, {
|
|
414
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
415
|
+
options: localVarRequestOptions,
|
|
416
|
+
}];
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
},
|
|
368
421
|
/**
|
|
369
422
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
370
423
|
* @summary Update the account
|
|
@@ -541,6 +594,28 @@ var AccountsApiFp = function (configuration) {
|
|
|
541
594
|
});
|
|
542
595
|
});
|
|
543
596
|
},
|
|
597
|
+
/**
|
|
598
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
599
|
+
* @summary Create the account policy
|
|
600
|
+
* @param {string} code Unique identifier for the object.
|
|
601
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
602
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
603
|
+
* @param {*} [options] Override http request option.
|
|
604
|
+
* @throws {RequiredError}
|
|
605
|
+
*/
|
|
606
|
+
registerPolicy: function (code, registerAccountPolicyRequestDto, authorization, options) {
|
|
607
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
608
|
+
var localVarAxiosArgs;
|
|
609
|
+
return __generator(this, function (_a) {
|
|
610
|
+
switch (_a.label) {
|
|
611
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.registerPolicy(code, registerAccountPolicyRequestDto, authorization, options)];
|
|
612
|
+
case 1:
|
|
613
|
+
localVarAxiosArgs = _a.sent();
|
|
614
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
},
|
|
544
619
|
/**
|
|
545
620
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
546
621
|
* @summary Update the account
|
|
@@ -636,6 +711,18 @@ var AccountsApiFactory = function (configuration, basePath, axios) {
|
|
|
636
711
|
listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
637
712
|
return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
|
|
638
713
|
},
|
|
714
|
+
/**
|
|
715
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
716
|
+
* @summary Create the account policy
|
|
717
|
+
* @param {string} code Unique identifier for the object.
|
|
718
|
+
* @param {RegisterAccountPolicyRequestDto} registerAccountPolicyRequestDto
|
|
719
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
720
|
+
* @param {*} [options] Override http request option.
|
|
721
|
+
* @throws {RequiredError}
|
|
722
|
+
*/
|
|
723
|
+
registerPolicy: function (code, registerAccountPolicyRequestDto, authorization, options) {
|
|
724
|
+
return localVarFp.registerPolicy(code, registerAccountPolicyRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
725
|
+
},
|
|
639
726
|
/**
|
|
640
727
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
641
728
|
* @summary Update the account
|
|
@@ -723,6 +810,18 @@ var AccountsApi = /** @class */ (function (_super) {
|
|
|
723
810
|
if (requestParameters === void 0) { requestParameters = {}; }
|
|
724
811
|
return (0, exports.AccountsApiFp)(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
725
812
|
};
|
|
813
|
+
/**
|
|
814
|
+
* This will register an already existing policy to the account, so that the policy shows up among the account\'s policies. Both the policy code and the policy number must refer to a policy that was created beforehand. **Required Permissions** \"partner-management.partners.create\"
|
|
815
|
+
* @summary Create the account policy
|
|
816
|
+
* @param {AccountsApiRegisterPolicyRequest} requestParameters Request parameters.
|
|
817
|
+
* @param {*} [options] Override http request option.
|
|
818
|
+
* @throws {RequiredError}
|
|
819
|
+
* @memberof AccountsApi
|
|
820
|
+
*/
|
|
821
|
+
AccountsApi.prototype.registerPolicy = function (requestParameters, options) {
|
|
822
|
+
var _this = this;
|
|
823
|
+
return (0, exports.AccountsApiFp)(this.configuration).registerPolicy(requestParameters.code, requestParameters.registerAccountPolicyRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
824
|
+
};
|
|
726
825
|
/**
|
|
727
826
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
728
827
|
* @summary Update the account
|
package/dist/base.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare class BaseAPI {
|
|
|
63
63
|
protected configuration: Configuration | undefined;
|
|
64
64
|
private tokenData?;
|
|
65
65
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
66
|
+
private useCookieAuth;
|
|
66
67
|
selectEnvironment(env: Environment): void;
|
|
67
68
|
selectBasePath(path: string): void;
|
|
68
69
|
getPermissions(): Array<string>;
|
package/dist/base.js
CHANGED
|
@@ -128,10 +128,15 @@ var BaseAPI = /** @class */ (function () {
|
|
|
128
128
|
var accessToken = this.tokenData.accessToken;
|
|
129
129
|
this.configuration = configuration;
|
|
130
130
|
this.basePath = configuration.basePath || this.basePath;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
if (configuration.cookieAuth) {
|
|
132
|
+
this.useCookieAuth();
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
// Use config token if provided, otherwise use tokenData token
|
|
136
|
+
var configToken = this.configuration.accessToken;
|
|
137
|
+
var storedToken = accessToken ? "Bearer ".concat(accessToken) : '';
|
|
138
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
else {
|
|
137
142
|
var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
|
|
@@ -143,6 +148,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
143
148
|
}
|
|
144
149
|
this.attachInterceptor(axios);
|
|
145
150
|
}
|
|
151
|
+
// Cookie mode: the browser sends the HttpOnly access cookie, so no token is read from storage.
|
|
152
|
+
BaseAPI.prototype.useCookieAuth = function () {
|
|
153
|
+
this.configuration.username = this.configuration.username || this.tokenData.username;
|
|
154
|
+
this.configuration.baseOptions = __assign(__assign({}, this.configuration.baseOptions), { withCredentials: true });
|
|
155
|
+
};
|
|
146
156
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
147
157
|
this.selectBasePath(env);
|
|
148
158
|
};
|
|
@@ -177,10 +187,12 @@ var BaseAPI = /** @class */ (function () {
|
|
|
177
187
|
response = _b.sent();
|
|
178
188
|
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
179
189
|
this.configuration.username = username;
|
|
180
|
-
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
181
190
|
this.tokenData.username = username;
|
|
182
|
-
this.tokenData.accessToken = accessToken;
|
|
183
191
|
this.tokenData.permissions = permissions;
|
|
192
|
+
if (!this.configuration.cookieAuth) {
|
|
193
|
+
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
194
|
+
this.tokenData.accessToken = accessToken;
|
|
195
|
+
}
|
|
184
196
|
if (!targetWorkspace) return [3 /*break*/, 3];
|
|
185
197
|
return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
|
|
186
198
|
case 2:
|
|
@@ -206,10 +218,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
206
218
|
options = {
|
|
207
219
|
method: 'POST',
|
|
208
220
|
url: "".concat(this.configuration.basePath, "/authservice/v1/workspaces/switch"),
|
|
209
|
-
headers: {
|
|
210
|
-
'Content-Type': 'application/json',
|
|
211
|
-
'Authorization': "Bearer ".concat(this.configuration.accessToken),
|
|
212
|
-
},
|
|
221
|
+
headers: __assign({ 'Content-Type': 'application/json' }, (this.configuration.cookieAuth ? {} : { 'Authorization': "Bearer ".concat(this.configuration.accessToken) })),
|
|
213
222
|
data: {
|
|
214
223
|
username: this.configuration.username,
|
|
215
224
|
targetWorkspace: targetWorkspace,
|
|
@@ -220,9 +229,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
220
229
|
case 1:
|
|
221
230
|
response = _b.sent();
|
|
222
231
|
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
223
|
-
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
224
|
-
this.tokenData.accessToken = accessToken;
|
|
225
232
|
this.tokenData.permissions = permissions;
|
|
233
|
+
if (!this.configuration.cookieAuth) {
|
|
234
|
+
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
235
|
+
this.tokenData.accessToken = accessToken;
|
|
236
|
+
}
|
|
226
237
|
this.storeTokenData(__assign({}, this.tokenData));
|
|
227
238
|
return [2 /*return*/];
|
|
228
239
|
}
|
|
@@ -265,7 +276,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
265
276
|
});
|
|
266
277
|
};
|
|
267
278
|
BaseAPI.prototype.storeTokenData = function (tokenData) {
|
|
279
|
+
var _a;
|
|
268
280
|
if (typeof window !== 'undefined') {
|
|
281
|
+
if (tokenData && ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.cookieAuth)) {
|
|
282
|
+
// Cookie mode saves who is logged in, never the token; a token saved by apps not yet migrated stays.
|
|
283
|
+
var username = tokenData.username, permissions = tokenData.permissions;
|
|
284
|
+
tokenData = __assign(__assign({}, ((0, common_1.defaultStorage)().get(TOKEN_DATA) || {})), { username: username, permissions: permissions });
|
|
285
|
+
}
|
|
269
286
|
(0, common_1.defaultStorage)().set(TOKEN_DATA, tokenData);
|
|
270
287
|
}
|
|
271
288
|
};
|
|
@@ -300,12 +317,15 @@ var BaseAPI = /** @class */ (function () {
|
|
|
300
317
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
301
318
|
case 2:
|
|
302
319
|
_a = _c.sent(), tokenString = _a.accessToken, permissions = _a.permissions;
|
|
303
|
-
accessToken = "Bearer ".concat(tokenString);
|
|
304
320
|
this.tokenData.permissions = permissions;
|
|
305
321
|
delete originalConfig.headers['Authorization'];
|
|
306
|
-
|
|
307
|
-
this.configuration.
|
|
308
|
-
|
|
322
|
+
// In cookie mode the refresh reply renewed the access cookie, so retry without a header.
|
|
323
|
+
if (!this.configuration.cookieAuth) {
|
|
324
|
+
accessToken = "Bearer ".concat(tokenString);
|
|
325
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
326
|
+
this.configuration.accessToken = accessToken;
|
|
327
|
+
this.tokenData.accessToken = tokenString;
|
|
328
|
+
}
|
|
309
329
|
this.storeTokenData(this.tokenData);
|
|
310
330
|
return [2 /*return*/, axios(originalConfig)];
|
|
311
331
|
case 3:
|
package/dist/configuration.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface ConfigurationParameters {
|
|
|
17
17
|
basePath?: string;
|
|
18
18
|
baseOptions?: any;
|
|
19
19
|
formDataCtor?: new () => any;
|
|
20
|
+
cookieAuth?: boolean;
|
|
20
21
|
}
|
|
21
22
|
export declare class Configuration {
|
|
22
23
|
/**
|
|
@@ -68,6 +69,14 @@ export declare class Configuration {
|
|
|
68
69
|
* @type {new () => FormData}
|
|
69
70
|
*/
|
|
70
71
|
formDataCtor?: new () => any;
|
|
72
|
+
/**
|
|
73
|
+
* Authenticate with the HttpOnly access cookie instead of a stored token: every call sends credentials.
|
|
74
|
+
* The browser holds one cookie, so use it with one logged-in account; log out through the auth service.
|
|
75
|
+
*
|
|
76
|
+
* @type {boolean}
|
|
77
|
+
* @memberof Configuration
|
|
78
|
+
*/
|
|
79
|
+
cookieAuth?: boolean;
|
|
71
80
|
constructor(param?: ConfigurationParameters);
|
|
72
81
|
/**
|
|
73
82
|
* Check if the given MIME is a JSON MIME.
|
package/dist/configuration.js
CHANGED
|
@@ -24,6 +24,7 @@ var Configuration = /** @class */ (function () {
|
|
|
24
24
|
this.basePath = param.basePath;
|
|
25
25
|
this.baseOptions = param.baseOptions;
|
|
26
26
|
this.formDataCtor = param.formDataCtor;
|
|
27
|
+
this.cookieAuth = param.cookieAuth;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Check if the given MIME is a JSON MIME.
|
|
@@ -89,16 +89,20 @@ export interface CreateAccountRequestDto {
|
|
|
89
89
|
'phone'?: string;
|
|
90
90
|
/**
|
|
91
91
|
* Optional field to enter extra information.
|
|
92
|
-
* @type {object}
|
|
92
|
+
* @type {{ [key: string]: object; }}
|
|
93
93
|
* @memberof CreateAccountRequestDto
|
|
94
94
|
*/
|
|
95
|
-
'metadata'?:
|
|
95
|
+
'metadata'?: {
|
|
96
|
+
[key: string]: object;
|
|
97
|
+
};
|
|
96
98
|
/**
|
|
97
99
|
* Optional field to add predefined custom fields.
|
|
98
|
-
* @type {object}
|
|
100
|
+
* @type {{ [key: string]: object; }}
|
|
99
101
|
* @memberof CreateAccountRequestDto
|
|
100
102
|
*/
|
|
101
|
-
'customFields'?:
|
|
103
|
+
'customFields'?: {
|
|
104
|
+
[key: string]: object;
|
|
105
|
+
};
|
|
102
106
|
/**
|
|
103
107
|
* Optional field to enter the type of the account holder.
|
|
104
108
|
* @type {string}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -6,5 +6,7 @@ export * from './inline-response200';
|
|
|
6
6
|
export * from './inline-response503';
|
|
7
7
|
export * from './list-accounts-response-class';
|
|
8
8
|
export * from './policy-class';
|
|
9
|
+
export * from './register-account-policy-request-dto';
|
|
10
|
+
export * from './register-policy-response-class';
|
|
9
11
|
export * from './update-account-request-dto';
|
|
10
12
|
export * from './update-account-response-class';
|
package/dist/models/index.js
CHANGED
|
@@ -22,5 +22,7 @@ __exportStar(require("./inline-response200"), exports);
|
|
|
22
22
|
__exportStar(require("./inline-response503"), exports);
|
|
23
23
|
__exportStar(require("./list-accounts-response-class"), exports);
|
|
24
24
|
__exportStar(require("./policy-class"), exports);
|
|
25
|
+
__exportStar(require("./register-account-policy-request-dto"), exports);
|
|
26
|
+
__exportStar(require("./register-policy-response-class"), exports);
|
|
25
27
|
__exportStar(require("./update-account-request-dto"), exports);
|
|
26
28
|
__exportStar(require("./update-account-response-class"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL AccountService
|
|
3
|
+
* The EMIL AccountService 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 RegisterAccountPolicyRequestDto
|
|
16
|
+
*/
|
|
17
|
+
export interface RegisterAccountPolicyRequestDto {
|
|
18
|
+
/**
|
|
19
|
+
* The policy code that will be registered to the current account
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof RegisterAccountPolicyRequestDto
|
|
22
|
+
*/
|
|
23
|
+
'policyCode': string;
|
|
24
|
+
/**
|
|
25
|
+
* The policy number that will be registered to the current account
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof RegisterAccountPolicyRequestDto
|
|
28
|
+
*/
|
|
29
|
+
'policyNumber': string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* EMIL AccountService
|
|
6
|
+
* The EMIL AccountService API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL AccountService
|
|
3
|
+
* The EMIL AccountService 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
|
+
import { PolicyClass } from './policy-class';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface RegisterPolicyResponseClass
|
|
17
|
+
*/
|
|
18
|
+
export interface RegisterPolicyResponseClass {
|
|
19
|
+
/**
|
|
20
|
+
* The policy response.
|
|
21
|
+
* @type {PolicyClass}
|
|
22
|
+
* @memberof RegisterPolicyResponseClass
|
|
23
|
+
*/
|
|
24
|
+
'policy': PolicyClass;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* EMIL AccountService
|
|
6
|
+
* The EMIL AccountService API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -89,16 +89,20 @@ export interface UpdateAccountRequestDto {
|
|
|
89
89
|
'phone'?: string;
|
|
90
90
|
/**
|
|
91
91
|
* Optional field to enter extra information.
|
|
92
|
-
* @type {object}
|
|
92
|
+
* @type {{ [key: string]: object; }}
|
|
93
93
|
* @memberof UpdateAccountRequestDto
|
|
94
94
|
*/
|
|
95
|
-
'metadata'?:
|
|
95
|
+
'metadata'?: {
|
|
96
|
+
[key: string]: object;
|
|
97
|
+
};
|
|
96
98
|
/**
|
|
97
99
|
* Optional field to add predefined custom fields.
|
|
98
|
-
* @type {object}
|
|
100
|
+
* @type {{ [key: string]: object; }}
|
|
99
101
|
* @memberof UpdateAccountRequestDto
|
|
100
102
|
*/
|
|
101
|
-
'customFields'?:
|
|
103
|
+
'customFields'?: {
|
|
104
|
+
[key: string]: object;
|
|
105
|
+
};
|
|
102
106
|
/**
|
|
103
107
|
* Optional field to enter the type of the account holder.
|
|
104
108
|
* @type {string}
|
|
@@ -94,16 +94,16 @@ export interface CreateAccountRequestDto {
|
|
|
94
94
|
'phone'?: string;
|
|
95
95
|
/**
|
|
96
96
|
* Optional field to enter extra information.
|
|
97
|
-
* @type {object}
|
|
97
|
+
* @type {{ [key: string]: object; }}
|
|
98
98
|
* @memberof CreateAccountRequestDto
|
|
99
99
|
*/
|
|
100
|
-
'metadata'?: object;
|
|
100
|
+
'metadata'?: { [key: string]: object; };
|
|
101
101
|
/**
|
|
102
102
|
* Optional field to add predefined custom fields.
|
|
103
|
-
* @type {object}
|
|
103
|
+
* @type {{ [key: string]: object; }}
|
|
104
104
|
* @memberof CreateAccountRequestDto
|
|
105
105
|
*/
|
|
106
|
-
'customFields'?: object;
|
|
106
|
+
'customFields'?: { [key: string]: object; };
|
|
107
107
|
/**
|
|
108
108
|
* Optional field to enter the type of the account holder.
|
|
109
109
|
* @type {string}
|
package/models/index.ts
CHANGED
|
@@ -6,5 +6,7 @@ export * from './inline-response200';
|
|
|
6
6
|
export * from './inline-response503';
|
|
7
7
|
export * from './list-accounts-response-class';
|
|
8
8
|
export * from './policy-class';
|
|
9
|
+
export * from './register-account-policy-request-dto';
|
|
10
|
+
export * from './register-policy-response-class';
|
|
9
11
|
export * from './update-account-request-dto';
|
|
10
12
|
export * from './update-account-response-class';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL AccountService
|
|
5
|
+
* The EMIL AccountService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface RegisterAccountPolicyRequestDto
|
|
21
|
+
*/
|
|
22
|
+
export interface RegisterAccountPolicyRequestDto {
|
|
23
|
+
/**
|
|
24
|
+
* The policy code that will be registered to the current account
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof RegisterAccountPolicyRequestDto
|
|
27
|
+
*/
|
|
28
|
+
'policyCode': string;
|
|
29
|
+
/**
|
|
30
|
+
* The policy number that will be registered to the current account
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof RegisterAccountPolicyRequestDto
|
|
33
|
+
*/
|
|
34
|
+
'policyNumber': string;
|
|
35
|
+
}
|
|
36
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL AccountService
|
|
5
|
+
* The EMIL AccountService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import { PolicyClass } from './policy-class';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @interface RegisterPolicyResponseClass
|
|
22
|
+
*/
|
|
23
|
+
export interface RegisterPolicyResponseClass {
|
|
24
|
+
/**
|
|
25
|
+
* The policy response.
|
|
26
|
+
* @type {PolicyClass}
|
|
27
|
+
* @memberof RegisterPolicyResponseClass
|
|
28
|
+
*/
|
|
29
|
+
'policy': PolicyClass;
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -94,16 +94,16 @@ export interface UpdateAccountRequestDto {
|
|
|
94
94
|
'phone'?: string;
|
|
95
95
|
/**
|
|
96
96
|
* Optional field to enter extra information.
|
|
97
|
-
* @type {object}
|
|
97
|
+
* @type {{ [key: string]: object; }}
|
|
98
98
|
* @memberof UpdateAccountRequestDto
|
|
99
99
|
*/
|
|
100
|
-
'metadata'?: object;
|
|
100
|
+
'metadata'?: { [key: string]: object; };
|
|
101
101
|
/**
|
|
102
102
|
* Optional field to add predefined custom fields.
|
|
103
|
-
* @type {object}
|
|
103
|
+
* @type {{ [key: string]: object; }}
|
|
104
104
|
* @memberof UpdateAccountRequestDto
|
|
105
105
|
*/
|
|
106
|
-
'customFields'?: object;
|
|
106
|
+
'customFields'?: { [key: string]: object; };
|
|
107
107
|
/**
|
|
108
108
|
* Optional field to enter the type of the account holder.
|
|
109
109
|
* @type {string}
|