@enfuce/nextgen-sdk 0.0.5 → 0.0.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/README.md +28 -3
- package/dist/authorisation-control/client.d.ts +47 -0
- package/dist/authorisation-control/client.js +80 -0
- package/dist/authorisation-control/index.d.ts +1 -0
- package/dist/authorisation-control/index.js +1 -0
- package/dist/card/client.d.ts +57 -0
- package/dist/card/client.js +100 -0
- package/dist/card/index.d.ts +1 -0
- package/dist/card/index.js +1 -0
- package/dist/cardholder/client.d.ts +53 -0
- package/dist/cardholder/client.js +92 -0
- package/dist/cardholder/index.d.ts +1 -0
- package/dist/cardholder/index.js +1 -0
- package/dist/cards/client.d.ts +47 -0
- package/dist/cards/client.js +80 -0
- package/dist/cards/index.d.ts +1 -0
- package/dist/cards/index.js +1 -0
- package/dist/esm/authorisation-control/client.d.ts +47 -0
- package/dist/esm/authorisation-control/client.js +75 -0
- package/dist/esm/authorisation-control/index.d.ts +1 -0
- package/dist/esm/authorisation-control/index.js +1 -0
- package/dist/esm/card/client.d.ts +57 -0
- package/dist/esm/card/client.js +95 -0
- package/dist/esm/card/index.d.ts +1 -0
- package/dist/esm/card/index.js +1 -0
- package/dist/esm/cardholder/client.d.ts +53 -0
- package/dist/esm/cardholder/client.js +87 -0
- package/dist/esm/cardholder/index.d.ts +1 -0
- package/dist/esm/cardholder/index.js +1 -0
- package/dist/esm/cards/client.d.ts +47 -0
- package/dist/esm/cards/client.js +75 -0
- package/dist/esm/cards/index.d.ts +1 -0
- package/dist/esm/cards/index.js +1 -0
- package/dist/esm/exchange-rate/client.d.ts +51 -0
- package/dist/esm/exchange-rate/client.js +83 -0
- package/dist/esm/exchange-rate/index.d.ts +1 -0
- package/dist/esm/exchange-rate/index.js +1 -0
- package/dist/esm/issuer-events/client.d.ts +47 -0
- package/dist/esm/issuer-events/client.js +75 -0
- package/dist/esm/issuer-events/index.d.ts +1 -0
- package/dist/esm/issuer-events/index.js +1 -0
- package/dist/esm/pin/client.d.ts +49 -0
- package/dist/esm/pin/client.js +79 -0
- package/dist/esm/pin/index.d.ts +1 -0
- package/dist/esm/pin/index.js +1 -0
- package/dist/esm/threeds/client.d.ts +47 -0
- package/dist/esm/threeds/client.js +75 -0
- package/dist/esm/threeds/index.d.ts +1 -0
- package/dist/esm/threeds/index.js +1 -0
- package/dist/esm/threeds-oob/client.d.ts +47 -0
- package/dist/esm/threeds-oob/client.js +75 -0
- package/dist/esm/threeds-oob/index.d.ts +1 -0
- package/dist/esm/threeds-oob/index.js +1 -0
- package/dist/esm/wallet/client.d.ts +61 -0
- package/dist/esm/wallet/client.js +103 -0
- package/dist/esm/wallet/index.d.ts +1 -0
- package/dist/esm/wallet/index.js +1 -0
- package/dist/exchange-rate/client.d.ts +51 -0
- package/dist/exchange-rate/client.js +88 -0
- package/dist/exchange-rate/index.d.ts +1 -0
- package/dist/exchange-rate/index.js +1 -0
- package/dist/issuer-events/client.d.ts +47 -0
- package/dist/issuer-events/client.js +80 -0
- package/dist/issuer-events/index.d.ts +1 -0
- package/dist/issuer-events/index.js +1 -0
- package/dist/pin/client.d.ts +49 -0
- package/dist/pin/client.js +84 -0
- package/dist/pin/index.d.ts +1 -0
- package/dist/pin/index.js +1 -0
- package/dist/threeds/client.d.ts +47 -0
- package/dist/threeds/client.js +80 -0
- package/dist/threeds/index.d.ts +1 -0
- package/dist/threeds/index.js +1 -0
- package/dist/threeds-oob/client.d.ts +47 -0
- package/dist/threeds-oob/client.js +80 -0
- package/dist/threeds-oob/index.d.ts +1 -0
- package/dist/threeds-oob/index.js +1 -0
- package/dist/wallet/client.d.ts +61 -0
- package/dist/wallet/client.js +108 -0
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.js +1 -0
- package/package.json +1 -1
- package/src/authorisation-control/client.ts +86 -0
- package/src/authorisation-control/index.ts +2 -0
- package/src/card/client.ts +116 -0
- package/src/card/index.ts +2 -0
- package/src/cardholder/client.ts +104 -0
- package/src/cardholder/index.ts +2 -0
- package/src/cards/client.ts +86 -0
- package/src/cards/index.ts +2 -0
- package/src/exchange-rate/client.ts +98 -0
- package/src/exchange-rate/index.ts +2 -0
- package/src/issuer-events/client.ts +86 -0
- package/src/issuer-events/index.ts +2 -0
- package/src/pin/client.ts +92 -0
- package/src/pin/index.ts +2 -0
- package/src/threeds/client.ts +86 -0
- package/src/threeds/index.ts +2 -0
- package/src/threeds-oob/client.ts +86 -0
- package/src/threeds-oob/index.ts +2 -0
- package/src/wallet/client.ts +128 -0
- package/src/wallet/index.ts +2 -0
- package/test/exchange-rate-client.test.ts +36 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type AxiosInstance } from 'axios';
|
|
2
|
+
import { type TokenManager } from '../oauth';
|
|
3
|
+
import { Configuration } from './configuration';
|
|
4
|
+
import { AuthorisationRequestAPIApi } from './api';
|
|
5
|
+
/**
|
|
6
|
+
* Fluent entry point for this module. Build one with {@link AuthorisationControlClient.builder}:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const client = AuthorisationControlClient.builder()
|
|
10
|
+
* .baseUrl('https://api.example.com/...')
|
|
11
|
+
* .oauth(tokens)
|
|
12
|
+
* .build();
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class AuthorisationControlClient {
|
|
16
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
17
|
+
readonly http: AxiosInstance;
|
|
18
|
+
/** The module configuration — base path applied. */
|
|
19
|
+
readonly configuration: Configuration;
|
|
20
|
+
constructor(
|
|
21
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
22
|
+
http: AxiosInstance,
|
|
23
|
+
/** The module configuration — base path applied. */
|
|
24
|
+
configuration: Configuration);
|
|
25
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
26
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T;
|
|
27
|
+
/** {@link AuthorisationRequestAPIApi} bound to this client. */
|
|
28
|
+
authorisationRequestAPIApi(): AuthorisationRequestAPIApi;
|
|
29
|
+
static builder(): AuthorisationControlClientBuilder;
|
|
30
|
+
}
|
|
31
|
+
/** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
|
|
32
|
+
export declare class AuthorisationControlClientBuilder {
|
|
33
|
+
private _baseUrl?;
|
|
34
|
+
private _tokens?;
|
|
35
|
+
private _customizers;
|
|
36
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
37
|
+
baseUrl(baseUrl: string): this;
|
|
38
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
39
|
+
oauth(tokens: TokenManager): this;
|
|
40
|
+
/**
|
|
41
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
42
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
43
|
+
* calls run in order.
|
|
44
|
+
*/
|
|
45
|
+
configure(customizer: (http: AxiosInstance) => void): this;
|
|
46
|
+
build(): AuthorisationControlClient;
|
|
47
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Enfuce nextgen SDK — fluent module client.
|
|
3
|
+
*
|
|
4
|
+
* GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
|
|
5
|
+
* API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
|
|
6
|
+
* retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
|
|
7
|
+
*/
|
|
8
|
+
import globalAxios from 'axios';
|
|
9
|
+
import { createOAuthAxios } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import { AuthorisationRequestAPIApi, } from './api';
|
|
12
|
+
/**
|
|
13
|
+
* Fluent entry point for this module. Build one with {@link AuthorisationControlClient.builder}:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const client = AuthorisationControlClient.builder()
|
|
17
|
+
* .baseUrl('https://api.example.com/...')
|
|
18
|
+
* .oauth(tokens)
|
|
19
|
+
* .build();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class AuthorisationControlClient {
|
|
23
|
+
constructor(
|
|
24
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
25
|
+
http,
|
|
26
|
+
/** The module configuration — base path applied. */
|
|
27
|
+
configuration) {
|
|
28
|
+
this.http = http;
|
|
29
|
+
this.configuration = configuration;
|
|
30
|
+
}
|
|
31
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
32
|
+
api(factory) {
|
|
33
|
+
return factory(this.configuration, this.http);
|
|
34
|
+
}
|
|
35
|
+
/** {@link AuthorisationRequestAPIApi} bound to this client. */
|
|
36
|
+
authorisationRequestAPIApi() {
|
|
37
|
+
return new AuthorisationRequestAPIApi(this.configuration, undefined, this.http);
|
|
38
|
+
}
|
|
39
|
+
static builder() {
|
|
40
|
+
return new AuthorisationControlClientBuilder();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
|
|
44
|
+
export class AuthorisationControlClientBuilder {
|
|
45
|
+
constructor() {
|
|
46
|
+
this._customizers = [];
|
|
47
|
+
}
|
|
48
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
49
|
+
baseUrl(baseUrl) {
|
|
50
|
+
this._baseUrl = baseUrl;
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
54
|
+
oauth(tokens) {
|
|
55
|
+
this._tokens = tokens;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
60
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
61
|
+
* calls run in order.
|
|
62
|
+
*/
|
|
63
|
+
configure(customizer) {
|
|
64
|
+
this._customizers.push(customizer);
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
build() {
|
|
68
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
69
|
+
for (const customizer of this._customizers) {
|
|
70
|
+
customizer(http);
|
|
71
|
+
}
|
|
72
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
73
|
+
return new AuthorisationControlClient(http, configuration);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type AxiosInstance } from 'axios';
|
|
2
|
+
import { type TokenManager } from '../oauth';
|
|
3
|
+
import { Configuration } from './configuration';
|
|
4
|
+
import { CreateCardApi, CreatePINControlAccessTokenApi, GetCardApi, GetCardPaymentInfoApi, GetPlasticManufacturingHistoryApi, UpdateCardApi } from './api';
|
|
5
|
+
/**
|
|
6
|
+
* Fluent entry point for this module. Build one with {@link CardClient.builder}:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const client = CardClient.builder()
|
|
10
|
+
* .baseUrl('https://api.example.com/...')
|
|
11
|
+
* .oauth(tokens)
|
|
12
|
+
* .build();
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class CardClient {
|
|
16
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
17
|
+
readonly http: AxiosInstance;
|
|
18
|
+
/** The module configuration — base path applied. */
|
|
19
|
+
readonly configuration: Configuration;
|
|
20
|
+
constructor(
|
|
21
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
22
|
+
http: AxiosInstance,
|
|
23
|
+
/** The module configuration — base path applied. */
|
|
24
|
+
configuration: Configuration);
|
|
25
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
26
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T;
|
|
27
|
+
/** {@link CreateCardApi} bound to this client. */
|
|
28
|
+
createCardApi(): CreateCardApi;
|
|
29
|
+
/** {@link CreatePINControlAccessTokenApi} bound to this client. */
|
|
30
|
+
createPINControlAccessTokenApi(): CreatePINControlAccessTokenApi;
|
|
31
|
+
/** {@link GetCardApi} bound to this client. */
|
|
32
|
+
getCardApi(): GetCardApi;
|
|
33
|
+
/** {@link GetCardPaymentInfoApi} bound to this client. */
|
|
34
|
+
getCardPaymentInfoApi(): GetCardPaymentInfoApi;
|
|
35
|
+
/** {@link GetPlasticManufacturingHistoryApi} bound to this client. */
|
|
36
|
+
getPlasticManufacturingHistoryApi(): GetPlasticManufacturingHistoryApi;
|
|
37
|
+
/** {@link UpdateCardApi} bound to this client. */
|
|
38
|
+
updateCardApi(): UpdateCardApi;
|
|
39
|
+
static builder(): CardClientBuilder;
|
|
40
|
+
}
|
|
41
|
+
/** Builds a {@link CardClient}: base URL + optional OAuth + transport customization. */
|
|
42
|
+
export declare class CardClientBuilder {
|
|
43
|
+
private _baseUrl?;
|
|
44
|
+
private _tokens?;
|
|
45
|
+
private _customizers;
|
|
46
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
47
|
+
baseUrl(baseUrl: string): this;
|
|
48
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
49
|
+
oauth(tokens: TokenManager): this;
|
|
50
|
+
/**
|
|
51
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
52
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
53
|
+
* calls run in order.
|
|
54
|
+
*/
|
|
55
|
+
configure(customizer: (http: AxiosInstance) => void): this;
|
|
56
|
+
build(): CardClient;
|
|
57
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Enfuce nextgen SDK — fluent module client.
|
|
3
|
+
*
|
|
4
|
+
* GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
|
|
5
|
+
* API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
|
|
6
|
+
* retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
|
|
7
|
+
*/
|
|
8
|
+
import globalAxios from 'axios';
|
|
9
|
+
import { createOAuthAxios } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import { CreateCardApi, CreatePINControlAccessTokenApi, GetCardApi, GetCardPaymentInfoApi, GetPlasticManufacturingHistoryApi, UpdateCardApi, } from './api';
|
|
12
|
+
/**
|
|
13
|
+
* Fluent entry point for this module. Build one with {@link CardClient.builder}:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const client = CardClient.builder()
|
|
17
|
+
* .baseUrl('https://api.example.com/...')
|
|
18
|
+
* .oauth(tokens)
|
|
19
|
+
* .build();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class CardClient {
|
|
23
|
+
constructor(
|
|
24
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
25
|
+
http,
|
|
26
|
+
/** The module configuration — base path applied. */
|
|
27
|
+
configuration) {
|
|
28
|
+
this.http = http;
|
|
29
|
+
this.configuration = configuration;
|
|
30
|
+
}
|
|
31
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
32
|
+
api(factory) {
|
|
33
|
+
return factory(this.configuration, this.http);
|
|
34
|
+
}
|
|
35
|
+
/** {@link CreateCardApi} bound to this client. */
|
|
36
|
+
createCardApi() {
|
|
37
|
+
return new CreateCardApi(this.configuration, undefined, this.http);
|
|
38
|
+
}
|
|
39
|
+
/** {@link CreatePINControlAccessTokenApi} bound to this client. */
|
|
40
|
+
createPINControlAccessTokenApi() {
|
|
41
|
+
return new CreatePINControlAccessTokenApi(this.configuration, undefined, this.http);
|
|
42
|
+
}
|
|
43
|
+
/** {@link GetCardApi} bound to this client. */
|
|
44
|
+
getCardApi() {
|
|
45
|
+
return new GetCardApi(this.configuration, undefined, this.http);
|
|
46
|
+
}
|
|
47
|
+
/** {@link GetCardPaymentInfoApi} bound to this client. */
|
|
48
|
+
getCardPaymentInfoApi() {
|
|
49
|
+
return new GetCardPaymentInfoApi(this.configuration, undefined, this.http);
|
|
50
|
+
}
|
|
51
|
+
/** {@link GetPlasticManufacturingHistoryApi} bound to this client. */
|
|
52
|
+
getPlasticManufacturingHistoryApi() {
|
|
53
|
+
return new GetPlasticManufacturingHistoryApi(this.configuration, undefined, this.http);
|
|
54
|
+
}
|
|
55
|
+
/** {@link UpdateCardApi} bound to this client. */
|
|
56
|
+
updateCardApi() {
|
|
57
|
+
return new UpdateCardApi(this.configuration, undefined, this.http);
|
|
58
|
+
}
|
|
59
|
+
static builder() {
|
|
60
|
+
return new CardClientBuilder();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Builds a {@link CardClient}: base URL + optional OAuth + transport customization. */
|
|
64
|
+
export class CardClientBuilder {
|
|
65
|
+
constructor() {
|
|
66
|
+
this._customizers = [];
|
|
67
|
+
}
|
|
68
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
69
|
+
baseUrl(baseUrl) {
|
|
70
|
+
this._baseUrl = baseUrl;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
74
|
+
oauth(tokens) {
|
|
75
|
+
this._tokens = tokens;
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
80
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
81
|
+
* calls run in order.
|
|
82
|
+
*/
|
|
83
|
+
configure(customizer) {
|
|
84
|
+
this._customizers.push(customizer);
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
build() {
|
|
88
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
89
|
+
for (const customizer of this._customizers) {
|
|
90
|
+
customizer(http);
|
|
91
|
+
}
|
|
92
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
93
|
+
return new CardClient(http, configuration);
|
|
94
|
+
}
|
|
95
|
+
}
|
package/dist/esm/card/index.d.ts
CHANGED
package/dist/esm/card/index.js
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type AxiosInstance } from 'axios';
|
|
2
|
+
import { type TokenManager } from '../oauth';
|
|
3
|
+
import { Configuration } from './configuration';
|
|
4
|
+
import { CreateCardholderApi, GetCardholderApi, GetCardsByCardholderIdApi, UpdateCardholderApi } from './api';
|
|
5
|
+
/**
|
|
6
|
+
* Fluent entry point for this module. Build one with {@link CardholderClient.builder}:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const client = CardholderClient.builder()
|
|
10
|
+
* .baseUrl('https://api.example.com/...')
|
|
11
|
+
* .oauth(tokens)
|
|
12
|
+
* .build();
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class CardholderClient {
|
|
16
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
17
|
+
readonly http: AxiosInstance;
|
|
18
|
+
/** The module configuration — base path applied. */
|
|
19
|
+
readonly configuration: Configuration;
|
|
20
|
+
constructor(
|
|
21
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
22
|
+
http: AxiosInstance,
|
|
23
|
+
/** The module configuration — base path applied. */
|
|
24
|
+
configuration: Configuration);
|
|
25
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
26
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T;
|
|
27
|
+
/** {@link CreateCardholderApi} bound to this client. */
|
|
28
|
+
createCardholderApi(): CreateCardholderApi;
|
|
29
|
+
/** {@link GetCardholderApi} bound to this client. */
|
|
30
|
+
getCardholderApi(): GetCardholderApi;
|
|
31
|
+
/** {@link GetCardsByCardholderIdApi} bound to this client. */
|
|
32
|
+
getCardsByCardholderIdApi(): GetCardsByCardholderIdApi;
|
|
33
|
+
/** {@link UpdateCardholderApi} bound to this client. */
|
|
34
|
+
updateCardholderApi(): UpdateCardholderApi;
|
|
35
|
+
static builder(): CardholderClientBuilder;
|
|
36
|
+
}
|
|
37
|
+
/** Builds a {@link CardholderClient}: base URL + optional OAuth + transport customization. */
|
|
38
|
+
export declare class CardholderClientBuilder {
|
|
39
|
+
private _baseUrl?;
|
|
40
|
+
private _tokens?;
|
|
41
|
+
private _customizers;
|
|
42
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
43
|
+
baseUrl(baseUrl: string): this;
|
|
44
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
45
|
+
oauth(tokens: TokenManager): this;
|
|
46
|
+
/**
|
|
47
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
48
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
49
|
+
* calls run in order.
|
|
50
|
+
*/
|
|
51
|
+
configure(customizer: (http: AxiosInstance) => void): this;
|
|
52
|
+
build(): CardholderClient;
|
|
53
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Enfuce nextgen SDK — fluent module client.
|
|
3
|
+
*
|
|
4
|
+
* GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
|
|
5
|
+
* API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
|
|
6
|
+
* retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
|
|
7
|
+
*/
|
|
8
|
+
import globalAxios from 'axios';
|
|
9
|
+
import { createOAuthAxios } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import { CreateCardholderApi, GetCardholderApi, GetCardsByCardholderIdApi, UpdateCardholderApi, } from './api';
|
|
12
|
+
/**
|
|
13
|
+
* Fluent entry point for this module. Build one with {@link CardholderClient.builder}:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const client = CardholderClient.builder()
|
|
17
|
+
* .baseUrl('https://api.example.com/...')
|
|
18
|
+
* .oauth(tokens)
|
|
19
|
+
* .build();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class CardholderClient {
|
|
23
|
+
constructor(
|
|
24
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
25
|
+
http,
|
|
26
|
+
/** The module configuration — base path applied. */
|
|
27
|
+
configuration) {
|
|
28
|
+
this.http = http;
|
|
29
|
+
this.configuration = configuration;
|
|
30
|
+
}
|
|
31
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
32
|
+
api(factory) {
|
|
33
|
+
return factory(this.configuration, this.http);
|
|
34
|
+
}
|
|
35
|
+
/** {@link CreateCardholderApi} bound to this client. */
|
|
36
|
+
createCardholderApi() {
|
|
37
|
+
return new CreateCardholderApi(this.configuration, undefined, this.http);
|
|
38
|
+
}
|
|
39
|
+
/** {@link GetCardholderApi} bound to this client. */
|
|
40
|
+
getCardholderApi() {
|
|
41
|
+
return new GetCardholderApi(this.configuration, undefined, this.http);
|
|
42
|
+
}
|
|
43
|
+
/** {@link GetCardsByCardholderIdApi} bound to this client. */
|
|
44
|
+
getCardsByCardholderIdApi() {
|
|
45
|
+
return new GetCardsByCardholderIdApi(this.configuration, undefined, this.http);
|
|
46
|
+
}
|
|
47
|
+
/** {@link UpdateCardholderApi} bound to this client. */
|
|
48
|
+
updateCardholderApi() {
|
|
49
|
+
return new UpdateCardholderApi(this.configuration, undefined, this.http);
|
|
50
|
+
}
|
|
51
|
+
static builder() {
|
|
52
|
+
return new CardholderClientBuilder();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Builds a {@link CardholderClient}: base URL + optional OAuth + transport customization. */
|
|
56
|
+
export class CardholderClientBuilder {
|
|
57
|
+
constructor() {
|
|
58
|
+
this._customizers = [];
|
|
59
|
+
}
|
|
60
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
61
|
+
baseUrl(baseUrl) {
|
|
62
|
+
this._baseUrl = baseUrl;
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
66
|
+
oauth(tokens) {
|
|
67
|
+
this._tokens = tokens;
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
72
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
73
|
+
* calls run in order.
|
|
74
|
+
*/
|
|
75
|
+
configure(customizer) {
|
|
76
|
+
this._customizers.push(customizer);
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
build() {
|
|
80
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
81
|
+
for (const customizer of this._customizers) {
|
|
82
|
+
customizer(http);
|
|
83
|
+
}
|
|
84
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
85
|
+
return new CardholderClient(http, configuration);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type AxiosInstance } from 'axios';
|
|
2
|
+
import { type TokenManager } from '../oauth';
|
|
3
|
+
import { Configuration } from './configuration';
|
|
4
|
+
import { CardsApi } from './api';
|
|
5
|
+
/**
|
|
6
|
+
* Fluent entry point for this module. Build one with {@link CardsClient.builder}:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const client = CardsClient.builder()
|
|
10
|
+
* .baseUrl('https://api.example.com/...')
|
|
11
|
+
* .oauth(tokens)
|
|
12
|
+
* .build();
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class CardsClient {
|
|
16
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
17
|
+
readonly http: AxiosInstance;
|
|
18
|
+
/** The module configuration — base path applied. */
|
|
19
|
+
readonly configuration: Configuration;
|
|
20
|
+
constructor(
|
|
21
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
22
|
+
http: AxiosInstance,
|
|
23
|
+
/** The module configuration — base path applied. */
|
|
24
|
+
configuration: Configuration);
|
|
25
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
26
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T;
|
|
27
|
+
/** {@link CardsApi} bound to this client. */
|
|
28
|
+
cardsApi(): CardsApi;
|
|
29
|
+
static builder(): CardsClientBuilder;
|
|
30
|
+
}
|
|
31
|
+
/** Builds a {@link CardsClient}: base URL + optional OAuth + transport customization. */
|
|
32
|
+
export declare class CardsClientBuilder {
|
|
33
|
+
private _baseUrl?;
|
|
34
|
+
private _tokens?;
|
|
35
|
+
private _customizers;
|
|
36
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
37
|
+
baseUrl(baseUrl: string): this;
|
|
38
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
39
|
+
oauth(tokens: TokenManager): this;
|
|
40
|
+
/**
|
|
41
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
42
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
43
|
+
* calls run in order.
|
|
44
|
+
*/
|
|
45
|
+
configure(customizer: (http: AxiosInstance) => void): this;
|
|
46
|
+
build(): CardsClient;
|
|
47
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Enfuce nextgen SDK — fluent module client.
|
|
3
|
+
*
|
|
4
|
+
* GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
|
|
5
|
+
* API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
|
|
6
|
+
* retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
|
|
7
|
+
*/
|
|
8
|
+
import globalAxios from 'axios';
|
|
9
|
+
import { createOAuthAxios } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import { CardsApi, } from './api';
|
|
12
|
+
/**
|
|
13
|
+
* Fluent entry point for this module. Build one with {@link CardsClient.builder}:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const client = CardsClient.builder()
|
|
17
|
+
* .baseUrl('https://api.example.com/...')
|
|
18
|
+
* .oauth(tokens)
|
|
19
|
+
* .build();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class CardsClient {
|
|
23
|
+
constructor(
|
|
24
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
25
|
+
http,
|
|
26
|
+
/** The module configuration — base path applied. */
|
|
27
|
+
configuration) {
|
|
28
|
+
this.http = http;
|
|
29
|
+
this.configuration = configuration;
|
|
30
|
+
}
|
|
31
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
32
|
+
api(factory) {
|
|
33
|
+
return factory(this.configuration, this.http);
|
|
34
|
+
}
|
|
35
|
+
/** {@link CardsApi} bound to this client. */
|
|
36
|
+
cardsApi() {
|
|
37
|
+
return new CardsApi(this.configuration, undefined, this.http);
|
|
38
|
+
}
|
|
39
|
+
static builder() {
|
|
40
|
+
return new CardsClientBuilder();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Builds a {@link CardsClient}: base URL + optional OAuth + transport customization. */
|
|
44
|
+
export class CardsClientBuilder {
|
|
45
|
+
constructor() {
|
|
46
|
+
this._customizers = [];
|
|
47
|
+
}
|
|
48
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
49
|
+
baseUrl(baseUrl) {
|
|
50
|
+
this._baseUrl = baseUrl;
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
54
|
+
oauth(tokens) {
|
|
55
|
+
this._tokens = tokens;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
60
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
61
|
+
* calls run in order.
|
|
62
|
+
*/
|
|
63
|
+
configure(customizer) {
|
|
64
|
+
this._customizers.push(customizer);
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
build() {
|
|
68
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
69
|
+
for (const customizer of this._customizers) {
|
|
70
|
+
customizer(http);
|
|
71
|
+
}
|
|
72
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
73
|
+
return new CardsClient(http, configuration);
|
|
74
|
+
}
|
|
75
|
+
}
|
package/dist/esm/cards/index.js
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type AxiosInstance } from 'axios';
|
|
2
|
+
import { type TokenManager } from '../oauth';
|
|
3
|
+
import { Configuration } from './configuration';
|
|
4
|
+
import { GetECBExchangeRateApi, GetECBSupportedCurrenciesApi, GetFXExchangeRatesApi } from './api';
|
|
5
|
+
/**
|
|
6
|
+
* Fluent entry point for this module. Build one with {@link ExchangeRateClient.builder}:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const client = ExchangeRateClient.builder()
|
|
10
|
+
* .baseUrl('https://api.example.com/...')
|
|
11
|
+
* .oauth(tokens)
|
|
12
|
+
* .build();
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class ExchangeRateClient {
|
|
16
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
17
|
+
readonly http: AxiosInstance;
|
|
18
|
+
/** The module configuration — base path applied. */
|
|
19
|
+
readonly configuration: Configuration;
|
|
20
|
+
constructor(
|
|
21
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
22
|
+
http: AxiosInstance,
|
|
23
|
+
/** The module configuration — base path applied. */
|
|
24
|
+
configuration: Configuration);
|
|
25
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
26
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T;
|
|
27
|
+
/** {@link GetECBExchangeRateApi} bound to this client. */
|
|
28
|
+
getECBExchangeRateApi(): GetECBExchangeRateApi;
|
|
29
|
+
/** {@link GetECBSupportedCurrenciesApi} bound to this client. */
|
|
30
|
+
getECBSupportedCurrenciesApi(): GetECBSupportedCurrenciesApi;
|
|
31
|
+
/** {@link GetFXExchangeRatesApi} bound to this client. */
|
|
32
|
+
getFXExchangeRatesApi(): GetFXExchangeRatesApi;
|
|
33
|
+
static builder(): ExchangeRateClientBuilder;
|
|
34
|
+
}
|
|
35
|
+
/** Builds a {@link ExchangeRateClient}: base URL + optional OAuth + transport customization. */
|
|
36
|
+
export declare class ExchangeRateClientBuilder {
|
|
37
|
+
private _baseUrl?;
|
|
38
|
+
private _tokens?;
|
|
39
|
+
private _customizers;
|
|
40
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
41
|
+
baseUrl(baseUrl: string): this;
|
|
42
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
43
|
+
oauth(tokens: TokenManager): this;
|
|
44
|
+
/**
|
|
45
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
46
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
47
|
+
* calls run in order.
|
|
48
|
+
*/
|
|
49
|
+
configure(customizer: (http: AxiosInstance) => void): this;
|
|
50
|
+
build(): ExchangeRateClient;
|
|
51
|
+
}
|