@emilgroup/account-sdk 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @emilgroup/account-sdk@1.0.0
1
+ ## @emilgroup/account-sdk@1.1.0
2
2
 
3
3
  This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -22,27 +22,26 @@ It can be used in both TypeScript and JavaScript. In TypeScript, the definition
22
22
  navigate to the folder of your consuming project and run one of the following commands.
23
23
 
24
24
  ```
25
- npm install @emilgroup/account-sdk@1.0.0 --save
25
+ npm install @emilgroup/account-sdk@1.1.0 --save
26
26
  ```
27
-
28
- And then you can import `EmilApi`.
27
+ And then you can import `AccountsApi`.
29
28
 
30
29
  ```ts
31
- import { EmilApi } from '@emilgroup/typescript-axios-sdk';
30
+ import { AccountsApi } from '@emilgroup/account-sdk'
32
31
 
33
- const emilApi = new EmilApi();
32
+ const accountsApi = new AccountsApi();
34
33
  ```
35
34
 
36
- To use authentication protected endpoints, you have to first authorize. To do so, use the `authorize` function in `EmilApi`:
35
+ To use authentication protected endpoints, you have to first authorize. To do so, use the `authorize` function in `AccountsApi`:
37
36
 
38
37
  ```ts
39
38
  async function listAccounts(): Promise<Void> {
40
39
  try {
41
- const emilApi = new EmilApi();
40
+ const accountsApi = new AccountsApi();
42
41
 
43
- await emilApi.authorize('username', 'password');
42
+ await accountsApi.authorize('username', 'password');
44
43
 
45
- const { data: { items } } = await emilApi.accounts.listAccounts();
44
+ const { data: { items } } = await accountsApi.listAccounts();
46
45
 
47
46
  console.log(items);
48
47
  } catch(error) {
@@ -447,6 +447,153 @@ export const AccountsApiFactory = function (configuration?: Configuration, baseP
447
447
  };
448
448
  };
449
449
 
450
+ /**
451
+ * Request parameters for createAccount operation in AccountsApi.
452
+ * @export
453
+ * @interface AccountsApiCreateAccountRequest
454
+ */
455
+ export interface AccountsApiCreateAccountRequest {
456
+ /**
457
+ *
458
+ * @type {CreateAccountRequestDto}
459
+ * @memberof AccountsApiCreateAccount
460
+ */
461
+ readonly createAccountRequestDto: CreateAccountRequestDto
462
+
463
+ /**
464
+ * Bearer Token: provided by the login endpoint under the name accessToken.
465
+ * @type {string}
466
+ * @memberof AccountsApiCreateAccount
467
+ */
468
+ readonly authorization?: string
469
+ }
470
+
471
+ /**
472
+ * Request parameters for deleteAccount operation in AccountsApi.
473
+ * @export
474
+ * @interface AccountsApiDeleteAccountRequest
475
+ */
476
+ export interface AccountsApiDeleteAccountRequest {
477
+ /**
478
+ * Unique identifier for the object.
479
+ * @type {string}
480
+ * @memberof AccountsApiDeleteAccount
481
+ */
482
+ readonly code: string
483
+
484
+ /**
485
+ * Bearer Token: provided by the login endpoint under the name accessToken.
486
+ * @type {string}
487
+ * @memberof AccountsApiDeleteAccount
488
+ */
489
+ readonly authorization?: string
490
+ }
491
+
492
+ /**
493
+ * Request parameters for getAccount operation in AccountsApi.
494
+ * @export
495
+ * @interface AccountsApiGetAccountRequest
496
+ */
497
+ export interface AccountsApiGetAccountRequest {
498
+ /**
499
+ * Unique identifier for the object.
500
+ * @type {string}
501
+ * @memberof AccountsApiGetAccount
502
+ */
503
+ readonly code: string
504
+
505
+ /**
506
+ * Bearer Token: provided by the login endpoint under the name accessToken.
507
+ * @type {string}
508
+ * @memberof AccountsApiGetAccount
509
+ */
510
+ readonly authorization?: string
511
+
512
+ /**
513
+ * Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
514
+ * @type {string}
515
+ * @memberof AccountsApiGetAccount
516
+ */
517
+ readonly expand?: string
518
+ }
519
+
520
+ /**
521
+ * Request parameters for listAccounts operation in AccountsApi.
522
+ * @export
523
+ * @interface AccountsApiListAccountsRequest
524
+ */
525
+ export interface AccountsApiListAccountsRequest {
526
+ /**
527
+ * Bearer Token: provided by the login endpoint under the name accessToken.
528
+ * @type {string}
529
+ * @memberof AccountsApiListAccounts
530
+ */
531
+ readonly authorization?: string
532
+
533
+ /**
534
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
535
+ * @type {number}
536
+ * @memberof AccountsApiListAccounts
537
+ */
538
+ readonly pageSize?: number
539
+
540
+ /**
541
+ * A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
542
+ * @type {string}
543
+ * @memberof AccountsApiListAccounts
544
+ */
545
+ readonly pageToken?: string
546
+
547
+ /**
548
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
549
+ * @type {string}
550
+ * @memberof AccountsApiListAccounts
551
+ */
552
+ readonly filter?: string
553
+
554
+ /**
555
+ * The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
556
+ * @type {string}
557
+ * @memberof AccountsApiListAccounts
558
+ */
559
+ readonly order?: string
560
+
561
+ /**
562
+ * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
563
+ * @type {string}
564
+ * @memberof AccountsApiListAccounts
565
+ */
566
+ readonly expand?: string
567
+ }
568
+
569
+ /**
570
+ * Request parameters for updateAccount operation in AccountsApi.
571
+ * @export
572
+ * @interface AccountsApiUpdateAccountRequest
573
+ */
574
+ export interface AccountsApiUpdateAccountRequest {
575
+ /**
576
+ * Unique identifier for the object.
577
+ * @type {string}
578
+ * @memberof AccountsApiUpdateAccount
579
+ */
580
+ readonly code: string
581
+
582
+ /**
583
+ *
584
+ * @type {UpdateAccountRequestDto}
585
+ * @memberof AccountsApiUpdateAccount
586
+ */
587
+ readonly updateAccountRequestDto: UpdateAccountRequestDto
588
+
589
+ /**
590
+ * Bearer Token: provided by the login endpoint under the name accessToken.
591
+ * @type {string}
592
+ * @memberof AccountsApiUpdateAccount
593
+ */
594
+ readonly authorization?: string
595
+ }
596
+
450
597
  /**
451
598
  * AccountsApi - object-oriented interface
452
599
  * @export
@@ -457,71 +604,60 @@ export class AccountsApi extends BaseAPI {
457
604
  /**
458
605
  * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
459
606
  * @summary Create the account
460
- * @param {CreateAccountRequestDto} createAccountRequestDto
461
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
607
+ * @param {AccountsApiCreateAccountRequest} requestParameters Request parameters.
462
608
  * @param {*} [options] Override http request option.
463
609
  * @throws {RequiredError}
464
610
  * @memberof AccountsApi
465
611
  */
466
- public createAccount(createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig) {
467
- return AccountsApiFp(this.configuration).createAccount(createAccountRequestDto, authorization, options).then((request) => request(this.axios, this.basePath));
612
+ public createAccount(requestParameters: AccountsApiCreateAccountRequest, options?: AxiosRequestConfig) {
613
+ return AccountsApiFp(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
468
614
  }
469
615
 
470
616
  /**
471
617
  * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
472
618
  * @summary Delete the account
473
- * @param {string} code Unique identifier for the object.
474
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
619
+ * @param {AccountsApiDeleteAccountRequest} requestParameters Request parameters.
475
620
  * @param {*} [options] Override http request option.
476
621
  * @throws {RequiredError}
477
622
  * @memberof AccountsApi
478
623
  */
479
- public deleteAccount(code: string, authorization?: string, options?: AxiosRequestConfig) {
480
- return AccountsApiFp(this.configuration).deleteAccount(code, authorization, options).then((request) => request(this.axios, this.basePath));
624
+ public deleteAccount(requestParameters: AccountsApiDeleteAccountRequest, options?: AxiosRequestConfig) {
625
+ return AccountsApiFp(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
481
626
  }
482
627
 
483
628
  /**
484
629
  * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
485
630
  * @summary Retrieve the account
486
- * @param {string} code Unique identifier for the object.
487
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
488
- * @param {string} [expand] Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
631
+ * @param {AccountsApiGetAccountRequest} requestParameters Request parameters.
489
632
  * @param {*} [options] Override http request option.
490
633
  * @throws {RequiredError}
491
634
  * @memberof AccountsApi
492
635
  */
493
- public getAccount(code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig) {
494
- return AccountsApiFp(this.configuration).getAccount(code, authorization, expand, options).then((request) => request(this.axios, this.basePath));
636
+ public getAccount(requestParameters: AccountsApiGetAccountRequest, options?: AxiosRequestConfig) {
637
+ return AccountsApiFp(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
495
638
  }
496
639
 
497
640
  /**
498
641
  * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
499
642
  * @summary List accounts
500
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
501
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
502
- * @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
503
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
504
- * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
505
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
643
+ * @param {AccountsApiListAccountsRequest} requestParameters Request parameters.
506
644
  * @param {*} [options] Override http request option.
507
645
  * @throws {RequiredError}
508
646
  * @memberof AccountsApi
509
647
  */
510
- public listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig) {
511
- return AccountsApiFp(this.configuration).listAccounts(authorization, pageSize, pageToken, filter, order, expand, options).then((request) => request(this.axios, this.basePath));
648
+ public listAccounts(requestParameters: AccountsApiListAccountsRequest = {}, options?: AxiosRequestConfig) {
649
+ return AccountsApiFp(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
512
650
  }
513
651
 
514
652
  /**
515
653
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
516
654
  * @summary Update the account
517
- * @param {string} code Unique identifier for the object.
518
- * @param {UpdateAccountRequestDto} updateAccountRequestDto
519
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
655
+ * @param {AccountsApiUpdateAccountRequest} requestParameters Request parameters.
520
656
  * @param {*} [options] Override http request option.
521
657
  * @throws {RequiredError}
522
658
  * @memberof AccountsApi
523
659
  */
524
- public updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig) {
525
- return AccountsApiFp(this.configuration).updateAccount(code, updateAccountRequestDto, authorization, options).then((request) => request(this.axios, this.basePath));
660
+ public updateAccount(requestParameters: AccountsApiUpdateAccountRequest, options?: AxiosRequestConfig) {
661
+ return AccountsApiFp(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
526
662
  }
527
663
  }
package/base.ts CHANGED
@@ -58,7 +58,7 @@ export interface RequestArgs {
58
58
  * @class BaseAPI
59
59
  */
60
60
  export class BaseAPI {
61
- protected configuration: Configuration | undefined;
61
+ protected configuration: Configuration;
62
62
 
63
63
  constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
64
64
  if (configuration) {
@@ -111,6 +111,10 @@ export class BaseAPI {
111
111
  );
112
112
  }
113
113
 
114
+ getConfiguration(): Configuration {
115
+ return this.configuration;
116
+ }
117
+
114
118
  selectEnvironment(env: Environment) {
115
119
  this.configuration.basePath = env;
116
120
  }
@@ -118,9 +122,12 @@ export class BaseAPI {
118
122
  async authorize(username: string, password: string): Promise<void> {
119
123
  const options: AxiosRequestConfig = {
120
124
  method: 'POST',
121
- url: `${Environment.Test}/authservice/v1/login`,
125
+ url: `${this.configuration.basePath}/authservice/v1/login`,
122
126
  headers: {'Content-Type': 'application/json'},
123
- data: {username, password, newPassword: null},
127
+ data: {
128
+ username,
129
+ password,
130
+ },
124
131
  withCredentials: true,
125
132
  };
126
133
 
@@ -143,7 +150,7 @@ export class BaseAPI {
143
150
 
144
151
  const options: AxiosRequestConfig = {
145
152
  method: 'POST',
146
- url: `${Environment.Test}/authservice/v1/refresh-token`,
153
+ url: `${this.configuration.basePath}/authservice/v1/refresh-token`,
147
154
  headers: {
148
155
  'Content-Type': 'application/json',
149
156
  Cookie: refreshToken,
package/common.ts CHANGED
@@ -16,7 +16,6 @@
16
16
  import { Configuration } from "./configuration";
17
17
  import { RequiredError, RequestArgs } from "./base";
18
18
  import { AxiosInstance, AxiosResponse } from 'axios';
19
-
20
19
  /**
21
20
  *
22
21
  * @export
@@ -189,6 +189,137 @@ export declare const AccountsApiFactory: (configuration?: Configuration, basePat
189
189
  */
190
190
  updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateAccountResponseClass>;
191
191
  };
192
+ /**
193
+ * Request parameters for createAccount operation in AccountsApi.
194
+ * @export
195
+ * @interface AccountsApiCreateAccountRequest
196
+ */
197
+ export interface AccountsApiCreateAccountRequest {
198
+ /**
199
+ *
200
+ * @type {CreateAccountRequestDto}
201
+ * @memberof AccountsApiCreateAccount
202
+ */
203
+ readonly createAccountRequestDto: CreateAccountRequestDto;
204
+ /**
205
+ * Bearer Token: provided by the login endpoint under the name accessToken.
206
+ * @type {string}
207
+ * @memberof AccountsApiCreateAccount
208
+ */
209
+ readonly authorization?: string;
210
+ }
211
+ /**
212
+ * Request parameters for deleteAccount operation in AccountsApi.
213
+ * @export
214
+ * @interface AccountsApiDeleteAccountRequest
215
+ */
216
+ export interface AccountsApiDeleteAccountRequest {
217
+ /**
218
+ * Unique identifier for the object.
219
+ * @type {string}
220
+ * @memberof AccountsApiDeleteAccount
221
+ */
222
+ readonly code: string;
223
+ /**
224
+ * Bearer Token: provided by the login endpoint under the name accessToken.
225
+ * @type {string}
226
+ * @memberof AccountsApiDeleteAccount
227
+ */
228
+ readonly authorization?: string;
229
+ }
230
+ /**
231
+ * Request parameters for getAccount operation in AccountsApi.
232
+ * @export
233
+ * @interface AccountsApiGetAccountRequest
234
+ */
235
+ export interface AccountsApiGetAccountRequest {
236
+ /**
237
+ * Unique identifier for the object.
238
+ * @type {string}
239
+ * @memberof AccountsApiGetAccount
240
+ */
241
+ readonly code: string;
242
+ /**
243
+ * Bearer Token: provided by the login endpoint under the name accessToken.
244
+ * @type {string}
245
+ * @memberof AccountsApiGetAccount
246
+ */
247
+ readonly authorization?: string;
248
+ /**
249
+ * Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
250
+ * @type {string}
251
+ * @memberof AccountsApiGetAccount
252
+ */
253
+ readonly expand?: string;
254
+ }
255
+ /**
256
+ * Request parameters for listAccounts operation in AccountsApi.
257
+ * @export
258
+ * @interface AccountsApiListAccountsRequest
259
+ */
260
+ export interface AccountsApiListAccountsRequest {
261
+ /**
262
+ * Bearer Token: provided by the login endpoint under the name accessToken.
263
+ * @type {string}
264
+ * @memberof AccountsApiListAccounts
265
+ */
266
+ readonly authorization?: string;
267
+ /**
268
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
269
+ * @type {number}
270
+ * @memberof AccountsApiListAccounts
271
+ */
272
+ readonly pageSize?: number;
273
+ /**
274
+ * A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
275
+ * @type {string}
276
+ * @memberof AccountsApiListAccounts
277
+ */
278
+ readonly pageToken?: string;
279
+ /**
280
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
281
+ * @type {string}
282
+ * @memberof AccountsApiListAccounts
283
+ */
284
+ readonly filter?: string;
285
+ /**
286
+ * The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
287
+ * @type {string}
288
+ * @memberof AccountsApiListAccounts
289
+ */
290
+ readonly order?: string;
291
+ /**
292
+ * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
293
+ * @type {string}
294
+ * @memberof AccountsApiListAccounts
295
+ */
296
+ readonly expand?: string;
297
+ }
298
+ /**
299
+ * Request parameters for updateAccount operation in AccountsApi.
300
+ * @export
301
+ * @interface AccountsApiUpdateAccountRequest
302
+ */
303
+ export interface AccountsApiUpdateAccountRequest {
304
+ /**
305
+ * Unique identifier for the object.
306
+ * @type {string}
307
+ * @memberof AccountsApiUpdateAccount
308
+ */
309
+ readonly code: string;
310
+ /**
311
+ *
312
+ * @type {UpdateAccountRequestDto}
313
+ * @memberof AccountsApiUpdateAccount
314
+ */
315
+ readonly updateAccountRequestDto: UpdateAccountRequestDto;
316
+ /**
317
+ * Bearer Token: provided by the login endpoint under the name accessToken.
318
+ * @type {string}
319
+ * @memberof AccountsApiUpdateAccount
320
+ */
321
+ readonly authorization?: string;
322
+ }
192
323
  /**
193
324
  * AccountsApi - object-oriented interface
194
325
  * @export
@@ -199,57 +330,46 @@ export declare class AccountsApi extends BaseAPI {
199
330
  /**
200
331
  * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
201
332
  * @summary Create the account
202
- * @param {CreateAccountRequestDto} createAccountRequestDto
203
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
333
+ * @param {AccountsApiCreateAccountRequest} requestParameters Request parameters.
204
334
  * @param {*} [options] Override http request option.
205
335
  * @throws {RequiredError}
206
336
  * @memberof AccountsApi
207
337
  */
208
- createAccount(createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateAccountResponseClass, any>>;
338
+ createAccount(requestParameters: AccountsApiCreateAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateAccountResponseClass, any>>;
209
339
  /**
210
340
  * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
211
341
  * @summary Delete the account
212
- * @param {string} code Unique identifier for the object.
213
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
342
+ * @param {AccountsApiDeleteAccountRequest} requestParameters Request parameters.
214
343
  * @param {*} [options] Override http request option.
215
344
  * @throws {RequiredError}
216
345
  * @memberof AccountsApi
217
346
  */
218
- deleteAccount(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<object, any>>;
347
+ deleteAccount(requestParameters: AccountsApiDeleteAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<object, any>>;
219
348
  /**
220
349
  * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
221
350
  * @summary Retrieve the account
222
- * @param {string} code Unique identifier for the object.
223
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
224
- * @param {string} [expand] Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
351
+ * @param {AccountsApiGetAccountRequest} requestParameters Request parameters.
225
352
  * @param {*} [options] Override http request option.
226
353
  * @throws {RequiredError}
227
354
  * @memberof AccountsApi
228
355
  */
229
- getAccount(code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponseClass, any>>;
356
+ getAccount(requestParameters: AccountsApiGetAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponseClass, any>>;
230
357
  /**
231
358
  * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
232
359
  * @summary List accounts
233
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
234
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
235
- * @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
236
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
237
- * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
238
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
360
+ * @param {AccountsApiListAccountsRequest} requestParameters Request parameters.
239
361
  * @param {*} [options] Override http request option.
240
362
  * @throws {RequiredError}
241
363
  * @memberof AccountsApi
242
364
  */
243
- listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListAccountsResponseClass, any>>;
365
+ listAccounts(requestParameters?: AccountsApiListAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListAccountsResponseClass, any>>;
244
366
  /**
245
367
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
246
368
  * @summary Update the account
247
- * @param {string} code Unique identifier for the object.
248
- * @param {UpdateAccountRequestDto} updateAccountRequestDto
249
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
369
+ * @param {AccountsApiUpdateAccountRequest} requestParameters Request parameters.
250
370
  * @param {*} [options] Override http request option.
251
371
  * @throws {RequiredError}
252
372
  * @memberof AccountsApi
253
373
  */
254
- updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateAccountResponseClass, any>>;
374
+ updateAccount(requestParameters: AccountsApiUpdateAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateAccountResponseClass, any>>;
255
375
  }
@@ -74,9 +74,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
77
80
  Object.defineProperty(exports, "__esModule", { value: true });
78
81
  exports.AccountsApi = exports.AccountsApiFactory = exports.AccountsApiFp = exports.AccountsApiAxiosParamCreator = void 0;
79
- var axios_1 = require("axios");
82
+ var axios_1 = __importDefault(require("axios"));
80
83
  // Some imports not used depending on template conditions
81
84
  // @ts-ignore
82
85
  var common_1 = require("../common");
@@ -564,73 +567,63 @@ var AccountsApi = /** @class */ (function (_super) {
564
567
  /**
565
568
  * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
566
569
  * @summary Create the account
567
- * @param {CreateAccountRequestDto} createAccountRequestDto
568
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
570
+ * @param {AccountsApiCreateAccountRequest} requestParameters Request parameters.
569
571
  * @param {*} [options] Override http request option.
570
572
  * @throws {RequiredError}
571
573
  * @memberof AccountsApi
572
574
  */
573
- AccountsApi.prototype.createAccount = function (createAccountRequestDto, authorization, options) {
575
+ AccountsApi.prototype.createAccount = function (requestParameters, options) {
574
576
  var _this = this;
575
- return (0, exports.AccountsApiFp)(this.configuration).createAccount(createAccountRequestDto, authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
577
+ return (0, exports.AccountsApiFp)(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
576
578
  };
577
579
  /**
578
580
  * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
579
581
  * @summary Delete the account
580
- * @param {string} code Unique identifier for the object.
581
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
582
+ * @param {AccountsApiDeleteAccountRequest} requestParameters Request parameters.
582
583
  * @param {*} [options] Override http request option.
583
584
  * @throws {RequiredError}
584
585
  * @memberof AccountsApi
585
586
  */
586
- AccountsApi.prototype.deleteAccount = function (code, authorization, options) {
587
+ AccountsApi.prototype.deleteAccount = function (requestParameters, options) {
587
588
  var _this = this;
588
- return (0, exports.AccountsApiFp)(this.configuration).deleteAccount(code, authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
589
+ return (0, exports.AccountsApiFp)(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
589
590
  };
590
591
  /**
591
592
  * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
592
593
  * @summary Retrieve the account
593
- * @param {string} code Unique identifier for the object.
594
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
595
- * @param {string} [expand] Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
594
+ * @param {AccountsApiGetAccountRequest} requestParameters Request parameters.
596
595
  * @param {*} [options] Override http request option.
597
596
  * @throws {RequiredError}
598
597
  * @memberof AccountsApi
599
598
  */
600
- AccountsApi.prototype.getAccount = function (code, authorization, expand, options) {
599
+ AccountsApi.prototype.getAccount = function (requestParameters, options) {
601
600
  var _this = this;
602
- return (0, exports.AccountsApiFp)(this.configuration).getAccount(code, authorization, expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
601
+ return (0, exports.AccountsApiFp)(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
603
602
  };
604
603
  /**
605
604
  * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
606
605
  * @summary List accounts
607
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
608
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
609
- * @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
610
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
611
- * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
612
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
606
+ * @param {AccountsApiListAccountsRequest} requestParameters Request parameters.
613
607
  * @param {*} [options] Override http request option.
614
608
  * @throws {RequiredError}
615
609
  * @memberof AccountsApi
616
610
  */
617
- AccountsApi.prototype.listAccounts = function (authorization, pageSize, pageToken, filter, order, expand, options) {
611
+ AccountsApi.prototype.listAccounts = function (requestParameters, options) {
618
612
  var _this = this;
619
- return (0, exports.AccountsApiFp)(this.configuration).listAccounts(authorization, pageSize, pageToken, filter, order, expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
613
+ if (requestParameters === void 0) { requestParameters = {}; }
614
+ return (0, exports.AccountsApiFp)(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
620
615
  };
621
616
  /**
622
617
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
623
618
  * @summary Update the account
624
- * @param {string} code Unique identifier for the object.
625
- * @param {UpdateAccountRequestDto} updateAccountRequestDto
626
- * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
619
+ * @param {AccountsApiUpdateAccountRequest} requestParameters Request parameters.
627
620
  * @param {*} [options] Override http request option.
628
621
  * @throws {RequiredError}
629
622
  * @memberof AccountsApi
630
623
  */
631
- AccountsApi.prototype.updateAccount = function (code, updateAccountRequestDto, authorization, options) {
624
+ AccountsApi.prototype.updateAccount = function (requestParameters, options) {
632
625
  var _this = this;
633
- return (0, exports.AccountsApiFp)(this.configuration).updateAccount(code, updateAccountRequestDto, authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
626
+ return (0, exports.AccountsApiFp)(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
634
627
  };
635
628
  return AccountsApi;
636
629
  }(base_1.BaseAPI));
package/dist/base.d.ts CHANGED
@@ -48,8 +48,9 @@ export interface RequestArgs {
48
48
  export declare class BaseAPI {
49
49
  protected basePath: string;
50
50
  protected axios: AxiosInstance;
51
- protected configuration: Configuration | undefined;
51
+ protected configuration: Configuration;
52
52
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
53
+ getConfiguration(): Configuration;
53
54
  selectEnvironment(env: Environment): void;
54
55
  authorize(username: string, password: string): Promise<void>;
55
56
  refreshToken(): Promise<string>;
package/dist/base.js CHANGED
@@ -74,12 +74,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
77
80
  Object.defineProperty(exports, "__esModule", { value: true });
78
81
  exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
79
82
  var configuration_1 = require("./configuration");
80
83
  // Some imports not used depending on template conditions
81
84
  // @ts-ignore
82
- var axios_1 = require("axios");
85
+ var axios_1 = __importDefault(require("axios"));
83
86
  exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
84
87
  /**
85
88
  *
@@ -156,6 +159,9 @@ var BaseAPI = /** @class */ (function () {
156
159
  });
157
160
  }); });
158
161
  }
162
+ BaseAPI.prototype.getConfiguration = function () {
163
+ return this.configuration;
164
+ };
159
165
  BaseAPI.prototype.selectEnvironment = function (env) {
160
166
  this.configuration.basePath = env;
161
167
  };
@@ -167,9 +173,12 @@ var BaseAPI = /** @class */ (function () {
167
173
  case 0:
168
174
  options = {
169
175
  method: 'POST',
170
- url: "".concat(Environment.Test, "/authservice/v1/login"),
176
+ url: "".concat(this.configuration.basePath, "/authservice/v1/login"),
171
177
  headers: { 'Content-Type': 'application/json' },
172
- data: { username: username, password: password, newPassword: null },
178
+ data: {
179
+ username: username,
180
+ password: password,
181
+ },
173
182
  withCredentials: true,
174
183
  };
175
184
  return [4 /*yield*/, axios_1.default.request(options)];
@@ -197,7 +206,7 @@ var BaseAPI = /** @class */ (function () {
197
206
  }
198
207
  options = {
199
208
  method: 'POST',
200
- url: "".concat(Environment.Test, "/authservice/v1/refresh-token"),
209
+ url: "".concat(this.configuration.basePath, "/authservice/v1/refresh-token"),
201
210
  headers: {
202
211
  'Content-Type': 'application/json',
203
212
  Cookie: refreshToken,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emilgroup/account-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "OpenAPI client for @emilgroup/account-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [
package/tsconfig.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "target": "ES5",
5
5
  "module": "CommonJS",
6
6
  "noImplicitAny": true,
7
+ "esModuleInterop": true,
7
8
  "outDir": "dist",
8
9
  "rootDir": ".",
9
10
  "lib": [