@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,104 @@
|
|
|
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, { type AxiosInstance } from 'axios';
|
|
9
|
+
import { createOAuthAxios, type TokenManager } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import {
|
|
12
|
+
CreateCardholderApi,
|
|
13
|
+
GetCardholderApi,
|
|
14
|
+
GetCardsByCardholderIdApi,
|
|
15
|
+
UpdateCardholderApi,
|
|
16
|
+
} from './api';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Fluent entry point for this module. Build one with {@link CardholderClient.builder}:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* const client = CardholderClient.builder()
|
|
23
|
+
* .baseUrl('https://api.example.com/...')
|
|
24
|
+
* .oauth(tokens)
|
|
25
|
+
* .build();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export class CardholderClient {
|
|
29
|
+
|
|
30
|
+
constructor(
|
|
31
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
32
|
+
readonly http: AxiosInstance,
|
|
33
|
+
/** The module configuration — base path applied. */
|
|
34
|
+
readonly configuration: Configuration,
|
|
35
|
+
) {}
|
|
36
|
+
|
|
37
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
38
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
|
|
39
|
+
return factory(this.configuration, this.http);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** {@link CreateCardholderApi} bound to this client. */
|
|
43
|
+
createCardholderApi(): CreateCardholderApi {
|
|
44
|
+
return new CreateCardholderApi(this.configuration, undefined, this.http);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** {@link GetCardholderApi} bound to this client. */
|
|
48
|
+
getCardholderApi(): GetCardholderApi {
|
|
49
|
+
return new GetCardholderApi(this.configuration, undefined, this.http);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** {@link GetCardsByCardholderIdApi} bound to this client. */
|
|
53
|
+
getCardsByCardholderIdApi(): GetCardsByCardholderIdApi {
|
|
54
|
+
return new GetCardsByCardholderIdApi(this.configuration, undefined, this.http);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** {@link UpdateCardholderApi} bound to this client. */
|
|
58
|
+
updateCardholderApi(): UpdateCardholderApi {
|
|
59
|
+
return new UpdateCardholderApi(this.configuration, undefined, this.http);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static builder(): CardholderClientBuilder {
|
|
63
|
+
return new CardholderClientBuilder();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Builds a {@link CardholderClient}: base URL + optional OAuth + transport customization. */
|
|
68
|
+
export class CardholderClientBuilder {
|
|
69
|
+
|
|
70
|
+
private _baseUrl?: string;
|
|
71
|
+
private _tokens?: TokenManager;
|
|
72
|
+
private _customizers: Array<(http: AxiosInstance) => void> = [];
|
|
73
|
+
|
|
74
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
75
|
+
baseUrl(baseUrl: string): this {
|
|
76
|
+
this._baseUrl = baseUrl;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
81
|
+
oauth(tokens: TokenManager): this {
|
|
82
|
+
this._tokens = tokens;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
88
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
89
|
+
* calls run in order.
|
|
90
|
+
*/
|
|
91
|
+
configure(customizer: (http: AxiosInstance) => void): this {
|
|
92
|
+
this._customizers.push(customizer);
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
build(): CardholderClient {
|
|
97
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
98
|
+
for (const customizer of this._customizers) {
|
|
99
|
+
customizer(http);
|
|
100
|
+
}
|
|
101
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
102
|
+
return new CardholderClient(http, configuration);
|
|
103
|
+
}
|
|
104
|
+
}
|
package/src/cardholder/index.ts
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
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, { type AxiosInstance } from 'axios';
|
|
9
|
+
import { createOAuthAxios, type TokenManager } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import {
|
|
12
|
+
CardsApi,
|
|
13
|
+
} from './api';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fluent entry point for this module. Build one with {@link CardsClient.builder}:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* const client = CardsClient.builder()
|
|
20
|
+
* .baseUrl('https://api.example.com/...')
|
|
21
|
+
* .oauth(tokens)
|
|
22
|
+
* .build();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class CardsClient {
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
29
|
+
readonly http: AxiosInstance,
|
|
30
|
+
/** The module configuration — base path applied. */
|
|
31
|
+
readonly configuration: Configuration,
|
|
32
|
+
) {}
|
|
33
|
+
|
|
34
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
35
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
|
|
36
|
+
return factory(this.configuration, this.http);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** {@link CardsApi} bound to this client. */
|
|
40
|
+
cardsApi(): CardsApi {
|
|
41
|
+
return new CardsApi(this.configuration, undefined, this.http);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static builder(): CardsClientBuilder {
|
|
45
|
+
return new CardsClientBuilder();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Builds a {@link CardsClient}: base URL + optional OAuth + transport customization. */
|
|
50
|
+
export class CardsClientBuilder {
|
|
51
|
+
|
|
52
|
+
private _baseUrl?: string;
|
|
53
|
+
private _tokens?: TokenManager;
|
|
54
|
+
private _customizers: Array<(http: AxiosInstance) => void> = [];
|
|
55
|
+
|
|
56
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
57
|
+
baseUrl(baseUrl: string): this {
|
|
58
|
+
this._baseUrl = baseUrl;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
63
|
+
oauth(tokens: TokenManager): this {
|
|
64
|
+
this._tokens = tokens;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
70
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
71
|
+
* calls run in order.
|
|
72
|
+
*/
|
|
73
|
+
configure(customizer: (http: AxiosInstance) => void): this {
|
|
74
|
+
this._customizers.push(customizer);
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
build(): CardsClient {
|
|
79
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
80
|
+
for (const customizer of this._customizers) {
|
|
81
|
+
customizer(http);
|
|
82
|
+
}
|
|
83
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
84
|
+
return new CardsClient(http, configuration);
|
|
85
|
+
}
|
|
86
|
+
}
|
package/src/cards/index.ts
CHANGED
|
@@ -0,0 +1,98 @@
|
|
|
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, { type AxiosInstance } from 'axios';
|
|
9
|
+
import { createOAuthAxios, type TokenManager } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import {
|
|
12
|
+
GetECBExchangeRateApi,
|
|
13
|
+
GetECBSupportedCurrenciesApi,
|
|
14
|
+
GetFXExchangeRatesApi,
|
|
15
|
+
} from './api';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Fluent entry point for this module. Build one with {@link ExchangeRateClient.builder}:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* const client = ExchangeRateClient.builder()
|
|
22
|
+
* .baseUrl('https://api.example.com/...')
|
|
23
|
+
* .oauth(tokens)
|
|
24
|
+
* .build();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export class ExchangeRateClient {
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
31
|
+
readonly http: AxiosInstance,
|
|
32
|
+
/** The module configuration — base path applied. */
|
|
33
|
+
readonly configuration: Configuration,
|
|
34
|
+
) {}
|
|
35
|
+
|
|
36
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
37
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
|
|
38
|
+
return factory(this.configuration, this.http);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** {@link GetECBExchangeRateApi} bound to this client. */
|
|
42
|
+
getECBExchangeRateApi(): GetECBExchangeRateApi {
|
|
43
|
+
return new GetECBExchangeRateApi(this.configuration, undefined, this.http);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** {@link GetECBSupportedCurrenciesApi} bound to this client. */
|
|
47
|
+
getECBSupportedCurrenciesApi(): GetECBSupportedCurrenciesApi {
|
|
48
|
+
return new GetECBSupportedCurrenciesApi(this.configuration, undefined, this.http);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** {@link GetFXExchangeRatesApi} bound to this client. */
|
|
52
|
+
getFXExchangeRatesApi(): GetFXExchangeRatesApi {
|
|
53
|
+
return new GetFXExchangeRatesApi(this.configuration, undefined, this.http);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static builder(): ExchangeRateClientBuilder {
|
|
57
|
+
return new ExchangeRateClientBuilder();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Builds a {@link ExchangeRateClient}: base URL + optional OAuth + transport customization. */
|
|
62
|
+
export class ExchangeRateClientBuilder {
|
|
63
|
+
|
|
64
|
+
private _baseUrl?: string;
|
|
65
|
+
private _tokens?: TokenManager;
|
|
66
|
+
private _customizers: Array<(http: AxiosInstance) => void> = [];
|
|
67
|
+
|
|
68
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
69
|
+
baseUrl(baseUrl: string): this {
|
|
70
|
+
this._baseUrl = baseUrl;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
75
|
+
oauth(tokens: TokenManager): this {
|
|
76
|
+
this._tokens = tokens;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
82
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
83
|
+
* calls run in order.
|
|
84
|
+
*/
|
|
85
|
+
configure(customizer: (http: AxiosInstance) => void): this {
|
|
86
|
+
this._customizers.push(customizer);
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
build(): ExchangeRateClient {
|
|
91
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
92
|
+
for (const customizer of this._customizers) {
|
|
93
|
+
customizer(http);
|
|
94
|
+
}
|
|
95
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
96
|
+
return new ExchangeRateClient(http, configuration);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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, { type AxiosInstance } from 'axios';
|
|
9
|
+
import { createOAuthAxios, type TokenManager } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import {
|
|
12
|
+
IssuerEventWebhooksApi,
|
|
13
|
+
} from './api';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fluent entry point for this module. Build one with {@link IssuerEventsClient.builder}:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* const client = IssuerEventsClient.builder()
|
|
20
|
+
* .baseUrl('https://api.example.com/...')
|
|
21
|
+
* .oauth(tokens)
|
|
22
|
+
* .build();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class IssuerEventsClient {
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
29
|
+
readonly http: AxiosInstance,
|
|
30
|
+
/** The module configuration — base path applied. */
|
|
31
|
+
readonly configuration: Configuration,
|
|
32
|
+
) {}
|
|
33
|
+
|
|
34
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
35
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
|
|
36
|
+
return factory(this.configuration, this.http);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** {@link IssuerEventWebhooksApi} bound to this client. */
|
|
40
|
+
issuerEventWebhooksApi(): IssuerEventWebhooksApi {
|
|
41
|
+
return new IssuerEventWebhooksApi(this.configuration, undefined, this.http);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static builder(): IssuerEventsClientBuilder {
|
|
45
|
+
return new IssuerEventsClientBuilder();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Builds a {@link IssuerEventsClient}: base URL + optional OAuth + transport customization. */
|
|
50
|
+
export class IssuerEventsClientBuilder {
|
|
51
|
+
|
|
52
|
+
private _baseUrl?: string;
|
|
53
|
+
private _tokens?: TokenManager;
|
|
54
|
+
private _customizers: Array<(http: AxiosInstance) => void> = [];
|
|
55
|
+
|
|
56
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
57
|
+
baseUrl(baseUrl: string): this {
|
|
58
|
+
this._baseUrl = baseUrl;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
63
|
+
oauth(tokens: TokenManager): this {
|
|
64
|
+
this._tokens = tokens;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
70
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
71
|
+
* calls run in order.
|
|
72
|
+
*/
|
|
73
|
+
configure(customizer: (http: AxiosInstance) => void): this {
|
|
74
|
+
this._customizers.push(customizer);
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
build(): IssuerEventsClient {
|
|
79
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
80
|
+
for (const customizer of this._customizers) {
|
|
81
|
+
customizer(http);
|
|
82
|
+
}
|
|
83
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
84
|
+
return new IssuerEventsClient(http, configuration);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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, { type AxiosInstance } from 'axios';
|
|
9
|
+
import { createOAuthAxios, type TokenManager } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import {
|
|
12
|
+
PINOperationsUsingPKIApi,
|
|
13
|
+
PINOperationsWithPreSharedKeyApi,
|
|
14
|
+
} from './api';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fluent entry point for this module. Build one with {@link PinClient.builder}:
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* const client = PinClient.builder()
|
|
21
|
+
* .baseUrl('https://api.example.com/...')
|
|
22
|
+
* .oauth(tokens)
|
|
23
|
+
* .build();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export class PinClient {
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
30
|
+
readonly http: AxiosInstance,
|
|
31
|
+
/** The module configuration — base path applied. */
|
|
32
|
+
readonly configuration: Configuration,
|
|
33
|
+
) {}
|
|
34
|
+
|
|
35
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
36
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
|
|
37
|
+
return factory(this.configuration, this.http);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** {@link PINOperationsUsingPKIApi} bound to this client. */
|
|
41
|
+
pINOperationsUsingPKIApi(): PINOperationsUsingPKIApi {
|
|
42
|
+
return new PINOperationsUsingPKIApi(this.configuration, undefined, this.http);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** {@link PINOperationsWithPreSharedKeyApi} bound to this client. */
|
|
46
|
+
pINOperationsWithPreSharedKeyApi(): PINOperationsWithPreSharedKeyApi {
|
|
47
|
+
return new PINOperationsWithPreSharedKeyApi(this.configuration, undefined, this.http);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static builder(): PinClientBuilder {
|
|
51
|
+
return new PinClientBuilder();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Builds a {@link PinClient}: base URL + optional OAuth + transport customization. */
|
|
56
|
+
export class PinClientBuilder {
|
|
57
|
+
|
|
58
|
+
private _baseUrl?: string;
|
|
59
|
+
private _tokens?: TokenManager;
|
|
60
|
+
private _customizers: Array<(http: AxiosInstance) => void> = [];
|
|
61
|
+
|
|
62
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
63
|
+
baseUrl(baseUrl: string): this {
|
|
64
|
+
this._baseUrl = baseUrl;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
69
|
+
oauth(tokens: TokenManager): this {
|
|
70
|
+
this._tokens = tokens;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
76
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
77
|
+
* calls run in order.
|
|
78
|
+
*/
|
|
79
|
+
configure(customizer: (http: AxiosInstance) => void): this {
|
|
80
|
+
this._customizers.push(customizer);
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
build(): PinClient {
|
|
85
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
86
|
+
for (const customizer of this._customizers) {
|
|
87
|
+
customizer(http);
|
|
88
|
+
}
|
|
89
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
90
|
+
return new PinClient(http, configuration);
|
|
91
|
+
}
|
|
92
|
+
}
|
package/src/pin/index.ts
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
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, { type AxiosInstance } from 'axios';
|
|
9
|
+
import { createOAuthAxios, type TokenManager } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import {
|
|
12
|
+
ThreeDSApi,
|
|
13
|
+
} from './api';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fluent entry point for this module. Build one with {@link ThreedsClient.builder}:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* const client = ThreedsClient.builder()
|
|
20
|
+
* .baseUrl('https://api.example.com/...')
|
|
21
|
+
* .oauth(tokens)
|
|
22
|
+
* .build();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class ThreedsClient {
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
29
|
+
readonly http: AxiosInstance,
|
|
30
|
+
/** The module configuration — base path applied. */
|
|
31
|
+
readonly configuration: Configuration,
|
|
32
|
+
) {}
|
|
33
|
+
|
|
34
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
35
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
|
|
36
|
+
return factory(this.configuration, this.http);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** {@link ThreeDSApi} bound to this client. */
|
|
40
|
+
threeDSApi(): ThreeDSApi {
|
|
41
|
+
return new ThreeDSApi(this.configuration, undefined, this.http);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static builder(): ThreedsClientBuilder {
|
|
45
|
+
return new ThreedsClientBuilder();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Builds a {@link ThreedsClient}: base URL + optional OAuth + transport customization. */
|
|
50
|
+
export class ThreedsClientBuilder {
|
|
51
|
+
|
|
52
|
+
private _baseUrl?: string;
|
|
53
|
+
private _tokens?: TokenManager;
|
|
54
|
+
private _customizers: Array<(http: AxiosInstance) => void> = [];
|
|
55
|
+
|
|
56
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
57
|
+
baseUrl(baseUrl: string): this {
|
|
58
|
+
this._baseUrl = baseUrl;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
63
|
+
oauth(tokens: TokenManager): this {
|
|
64
|
+
this._tokens = tokens;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
70
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
71
|
+
* calls run in order.
|
|
72
|
+
*/
|
|
73
|
+
configure(customizer: (http: AxiosInstance) => void): this {
|
|
74
|
+
this._customizers.push(customizer);
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
build(): ThreedsClient {
|
|
79
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
80
|
+
for (const customizer of this._customizers) {
|
|
81
|
+
customizer(http);
|
|
82
|
+
}
|
|
83
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
84
|
+
return new ThreedsClient(http, configuration);
|
|
85
|
+
}
|
|
86
|
+
}
|
package/src/threeds/index.ts
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
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, { type AxiosInstance } from 'axios';
|
|
9
|
+
import { createOAuthAxios, type TokenManager } from '../oauth';
|
|
10
|
+
import { Configuration } from './configuration';
|
|
11
|
+
import {
|
|
12
|
+
OOBAuthenticationChallengeWebhookNotificationApi,
|
|
13
|
+
} from './api';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fluent entry point for this module. Build one with {@link ThreedsOobClient.builder}:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* const client = ThreedsOobClient.builder()
|
|
20
|
+
* .baseUrl('https://api.example.com/...')
|
|
21
|
+
* .oauth(tokens)
|
|
22
|
+
* .build();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class ThreedsOobClient {
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
29
|
+
readonly http: AxiosInstance,
|
|
30
|
+
/** The module configuration — base path applied. */
|
|
31
|
+
readonly configuration: Configuration,
|
|
32
|
+
) {}
|
|
33
|
+
|
|
34
|
+
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
35
|
+
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
|
|
36
|
+
return factory(this.configuration, this.http);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** {@link OOBAuthenticationChallengeWebhookNotificationApi} bound to this client. */
|
|
40
|
+
oOBAuthenticationChallengeWebhookNotificationApi(): OOBAuthenticationChallengeWebhookNotificationApi {
|
|
41
|
+
return new OOBAuthenticationChallengeWebhookNotificationApi(this.configuration, undefined, this.http);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static builder(): ThreedsOobClientBuilder {
|
|
45
|
+
return new ThreedsOobClientBuilder();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Builds a {@link ThreedsOobClient}: base URL + optional OAuth + transport customization. */
|
|
50
|
+
export class ThreedsOobClientBuilder {
|
|
51
|
+
|
|
52
|
+
private _baseUrl?: string;
|
|
53
|
+
private _tokens?: TokenManager;
|
|
54
|
+
private _customizers: Array<(http: AxiosInstance) => void> = [];
|
|
55
|
+
|
|
56
|
+
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
57
|
+
baseUrl(baseUrl: string): this {
|
|
58
|
+
this._baseUrl = baseUrl;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
63
|
+
oauth(tokens: TokenManager): this {
|
|
64
|
+
this._tokens = tokens;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
70
|
+
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
71
|
+
* calls run in order.
|
|
72
|
+
*/
|
|
73
|
+
configure(customizer: (http: AxiosInstance) => void): this {
|
|
74
|
+
this._customizers.push(customizer);
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
build(): ThreedsOobClient {
|
|
79
|
+
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
80
|
+
for (const customizer of this._customizers) {
|
|
81
|
+
customizer(http);
|
|
82
|
+
}
|
|
83
|
+
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
84
|
+
return new ThreedsOobClient(http, configuration);
|
|
85
|
+
}
|
|
86
|
+
}
|