@enfuce/nextgen-sdk 0.0.4 → 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.
Files changed (112) hide show
  1. package/README.md +28 -3
  2. package/dist/authorisation-control/client.d.ts +47 -0
  3. package/dist/authorisation-control/client.js +80 -0
  4. package/dist/authorisation-control/index.d.ts +1 -0
  5. package/dist/authorisation-control/index.js +1 -0
  6. package/dist/card/client.d.ts +57 -0
  7. package/dist/card/client.js +100 -0
  8. package/dist/card/index.d.ts +1 -0
  9. package/dist/card/index.js +1 -0
  10. package/dist/cardholder/client.d.ts +53 -0
  11. package/dist/cardholder/client.js +92 -0
  12. package/dist/cardholder/index.d.ts +1 -0
  13. package/dist/cardholder/index.js +1 -0
  14. package/dist/cards/client.d.ts +47 -0
  15. package/dist/cards/client.js +80 -0
  16. package/dist/cards/index.d.ts +1 -0
  17. package/dist/cards/index.js +1 -0
  18. package/dist/esm/authorisation-control/client.d.ts +47 -0
  19. package/dist/esm/authorisation-control/client.js +75 -0
  20. package/dist/esm/authorisation-control/index.d.ts +1 -0
  21. package/dist/esm/authorisation-control/index.js +1 -0
  22. package/dist/esm/card/client.d.ts +57 -0
  23. package/dist/esm/card/client.js +95 -0
  24. package/dist/esm/card/index.d.ts +1 -0
  25. package/dist/esm/card/index.js +1 -0
  26. package/dist/esm/cardholder/client.d.ts +53 -0
  27. package/dist/esm/cardholder/client.js +87 -0
  28. package/dist/esm/cardholder/index.d.ts +1 -0
  29. package/dist/esm/cardholder/index.js +1 -0
  30. package/dist/esm/cards/client.d.ts +47 -0
  31. package/dist/esm/cards/client.js +75 -0
  32. package/dist/esm/cards/index.d.ts +1 -0
  33. package/dist/esm/cards/index.js +1 -0
  34. package/dist/esm/exchange-rate/client.d.ts +51 -0
  35. package/dist/esm/exchange-rate/client.js +83 -0
  36. package/dist/esm/exchange-rate/index.d.ts +1 -0
  37. package/dist/esm/exchange-rate/index.js +1 -0
  38. package/dist/esm/issuer-events/client.d.ts +47 -0
  39. package/dist/esm/issuer-events/client.js +75 -0
  40. package/dist/esm/issuer-events/index.d.ts +1 -0
  41. package/dist/esm/issuer-events/index.js +1 -0
  42. package/dist/esm/oauth/axios.d.ts +10 -4
  43. package/dist/esm/oauth/axios.js +15 -4
  44. package/dist/esm/oauth/index.js +5 -2
  45. package/dist/esm/pin/client.d.ts +49 -0
  46. package/dist/esm/pin/client.js +79 -0
  47. package/dist/esm/pin/index.d.ts +1 -0
  48. package/dist/esm/pin/index.js +1 -0
  49. package/dist/esm/threeds/client.d.ts +47 -0
  50. package/dist/esm/threeds/client.js +75 -0
  51. package/dist/esm/threeds/index.d.ts +1 -0
  52. package/dist/esm/threeds/index.js +1 -0
  53. package/dist/esm/threeds-oob/client.d.ts +47 -0
  54. package/dist/esm/threeds-oob/client.js +75 -0
  55. package/dist/esm/threeds-oob/index.d.ts +1 -0
  56. package/dist/esm/threeds-oob/index.js +1 -0
  57. package/dist/esm/wallet/client.d.ts +61 -0
  58. package/dist/esm/wallet/client.js +103 -0
  59. package/dist/esm/wallet/index.d.ts +1 -0
  60. package/dist/esm/wallet/index.js +1 -0
  61. package/dist/exchange-rate/client.d.ts +51 -0
  62. package/dist/exchange-rate/client.js +88 -0
  63. package/dist/exchange-rate/index.d.ts +1 -0
  64. package/dist/exchange-rate/index.js +1 -0
  65. package/dist/issuer-events/client.d.ts +47 -0
  66. package/dist/issuer-events/client.js +80 -0
  67. package/dist/issuer-events/index.d.ts +1 -0
  68. package/dist/issuer-events/index.js +1 -0
  69. package/dist/oauth/axios.d.ts +10 -4
  70. package/dist/oauth/axios.js +15 -4
  71. package/dist/oauth/index.js +5 -2
  72. package/dist/pin/client.d.ts +49 -0
  73. package/dist/pin/client.js +84 -0
  74. package/dist/pin/index.d.ts +1 -0
  75. package/dist/pin/index.js +1 -0
  76. package/dist/threeds/client.d.ts +47 -0
  77. package/dist/threeds/client.js +80 -0
  78. package/dist/threeds/index.d.ts +1 -0
  79. package/dist/threeds/index.js +1 -0
  80. package/dist/threeds-oob/client.d.ts +47 -0
  81. package/dist/threeds-oob/client.js +80 -0
  82. package/dist/threeds-oob/index.d.ts +1 -0
  83. package/dist/threeds-oob/index.js +1 -0
  84. package/dist/wallet/client.d.ts +61 -0
  85. package/dist/wallet/client.js +108 -0
  86. package/dist/wallet/index.d.ts +1 -0
  87. package/dist/wallet/index.js +1 -0
  88. package/package.json +1 -1
  89. package/src/authorisation-control/client.ts +86 -0
  90. package/src/authorisation-control/index.ts +2 -0
  91. package/src/card/client.ts +116 -0
  92. package/src/card/index.ts +2 -0
  93. package/src/cardholder/client.ts +104 -0
  94. package/src/cardholder/index.ts +2 -0
  95. package/src/cards/client.ts +86 -0
  96. package/src/cards/index.ts +2 -0
  97. package/src/exchange-rate/client.ts +98 -0
  98. package/src/exchange-rate/index.ts +2 -0
  99. package/src/issuer-events/client.ts +86 -0
  100. package/src/issuer-events/index.ts +2 -0
  101. package/src/oauth/axios.ts +16 -4
  102. package/src/oauth/index.ts +5 -2
  103. package/src/pin/client.ts +92 -0
  104. package/src/pin/index.ts +2 -0
  105. package/src/threeds/client.ts +86 -0
  106. package/src/threeds/index.ts +2 -0
  107. package/src/threeds-oob/client.ts +86 -0
  108. package/src/threeds-oob/index.ts +2 -0
  109. package/src/wallet/client.ts +128 -0
  110. package/src/wallet/index.ts +2 -0
  111. package/test/exchange-rate-client.test.ts +36 -0
  112. package/test/oauth.test.ts +19 -0
package/README.md CHANGED
@@ -11,14 +11,39 @@ npm install @enfuce/nextgen-sdk
11
11
 
12
12
  ## Usage
13
13
 
14
- Each API is exposed under its own namespace:
14
+ Each API is exposed under its own namespace, and every module ships a fluent `<Module>Client`
15
+ (e.g. `card.CardClient`, `exchangeRate.ExchangeRateClient`) that wires an OAuth-enabled axios
16
+ instance to the module's configuration and exposes each API:
15
17
 
16
18
  ```typescript
17
- import { card } from '@enfuce/nextgen-sdk';
19
+ import { oauth, card } from '@enfuce/nextgen-sdk';
18
20
 
19
- const config = new card.Configuration({ basePath: 'https://api.example.com' });
21
+ // One token manager (cached client-credentials grant) — reuse it across every module.
22
+ const tokens = oauth.clientCredentials({
23
+ tokenUrl: 'https://auth.<tenant>.enfuce.com/oauth2/token',
24
+ clientId: '<client-id>',
25
+ clientSecret: '<client-secret>',
26
+ scopes: ['issuer/admin.read'],
27
+ });
28
+
29
+ const client = card.CardClient.builder()
30
+ .baseUrl('https://api.<tenant>.eu.live.prod.mycore.enfuce.com/issuer')
31
+ .oauth(tokens) // token on every request + reactive 401 retry
32
+ .configure((http) => { http.defaults.timeout = 10_000; }) // optional: timeout, proxy, headers …
33
+ .build();
34
+
35
+ const { data } = await client.getCardApi().getCard(cardId, 'you@example.com');
20
36
  ```
21
37
 
38
+ `build()` works without `.oauth(...)` (unauthenticated), and `configure((http) => …)` hands you the
39
+ underlying axios instance for full transport control (timeout, proxy, interceptors). The same builder
40
+ is available for every module, including ones whose spec declares no security scheme
41
+ (e.g. `exchangeRate.ExchangeRateClient`).
42
+
43
+ Prefer the lower level? Build your own axios and pass it through:
44
+ `oauth.createOAuthAxios(tokens, axios.create({ timeout: 10_000 }))`, then
45
+ `new card.GetCardApi(new card.Configuration({ basePath }), undefined, http)`.
46
+
22
47
  ## Available APIs
23
48
 
24
49
  - `oauth` — OAuth2 `client_credentials` token-management helper
@@ -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,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthorisationControlClientBuilder = exports.AuthorisationControlClient = void 0;
4
+ /*
5
+ * Enfuce nextgen SDK — fluent module client.
6
+ *
7
+ * GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
8
+ * API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
9
+ * retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
10
+ */
11
+ const axios_1 = require("axios");
12
+ const oauth_1 = require("../oauth");
13
+ const configuration_1 = require("./configuration");
14
+ const api_1 = require("./api");
15
+ /**
16
+ * Fluent entry point for this module. Build one with {@link AuthorisationControlClient.builder}:
17
+ *
18
+ * ```ts
19
+ * const client = AuthorisationControlClient.builder()
20
+ * .baseUrl('https://api.example.com/...')
21
+ * .oauth(tokens)
22
+ * .build();
23
+ * ```
24
+ */
25
+ class AuthorisationControlClient {
26
+ constructor(
27
+ /** The axios instance — OAuth interceptors and any customizations already applied. */
28
+ http,
29
+ /** The module configuration — base path applied. */
30
+ configuration) {
31
+ this.http = http;
32
+ this.configuration = configuration;
33
+ }
34
+ /** Build any API in this module bound to this client (for APIs without a named getter). */
35
+ api(factory) {
36
+ return factory(this.configuration, this.http);
37
+ }
38
+ /** {@link AuthorisationRequestAPIApi} bound to this client. */
39
+ authorisationRequestAPIApi() {
40
+ return new api_1.AuthorisationRequestAPIApi(this.configuration, undefined, this.http);
41
+ }
42
+ static builder() {
43
+ return new AuthorisationControlClientBuilder();
44
+ }
45
+ }
46
+ exports.AuthorisationControlClient = AuthorisationControlClient;
47
+ /** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
48
+ class AuthorisationControlClientBuilder {
49
+ constructor() {
50
+ this._customizers = [];
51
+ }
52
+ /** The module's host, e.g. `https://api.<tenant>.../issuer`. */
53
+ baseUrl(baseUrl) {
54
+ this._baseUrl = baseUrl;
55
+ return this;
56
+ }
57
+ /** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
58
+ oauth(tokens) {
59
+ this._tokens = tokens;
60
+ return this;
61
+ }
62
+ /**
63
+ * Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
64
+ * default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
65
+ * calls run in order.
66
+ */
67
+ configure(customizer) {
68
+ this._customizers.push(customizer);
69
+ return this;
70
+ }
71
+ build() {
72
+ const http = this._tokens ? (0, oauth_1.createOAuthAxios)(this._tokens) : axios_1.default.create();
73
+ for (const customizer of this._customizers) {
74
+ customizer(http);
75
+ }
76
+ const configuration = new configuration_1.Configuration({ basePath: this._baseUrl });
77
+ return new AuthorisationControlClient(http, configuration);
78
+ }
79
+ }
80
+ exports.AuthorisationControlClientBuilder = AuthorisationControlClientBuilder;
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export * from "./api";
13
13
  export * from "./configuration";
14
+ export * from './client';
@@ -29,3 +29,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  __exportStar(require("./api"), exports);
31
31
  __exportStar(require("./configuration"), exports);
32
+ __exportStar(require("./client"), exports);
@@ -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,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CardClientBuilder = exports.CardClient = void 0;
4
+ /*
5
+ * Enfuce nextgen SDK — fluent module client.
6
+ *
7
+ * GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
8
+ * API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
9
+ * retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
10
+ */
11
+ const axios_1 = require("axios");
12
+ const oauth_1 = require("../oauth");
13
+ const configuration_1 = require("./configuration");
14
+ const api_1 = require("./api");
15
+ /**
16
+ * Fluent entry point for this module. Build one with {@link CardClient.builder}:
17
+ *
18
+ * ```ts
19
+ * const client = CardClient.builder()
20
+ * .baseUrl('https://api.example.com/...')
21
+ * .oauth(tokens)
22
+ * .build();
23
+ * ```
24
+ */
25
+ class CardClient {
26
+ constructor(
27
+ /** The axios instance — OAuth interceptors and any customizations already applied. */
28
+ http,
29
+ /** The module configuration — base path applied. */
30
+ configuration) {
31
+ this.http = http;
32
+ this.configuration = configuration;
33
+ }
34
+ /** Build any API in this module bound to this client (for APIs without a named getter). */
35
+ api(factory) {
36
+ return factory(this.configuration, this.http);
37
+ }
38
+ /** {@link CreateCardApi} bound to this client. */
39
+ createCardApi() {
40
+ return new api_1.CreateCardApi(this.configuration, undefined, this.http);
41
+ }
42
+ /** {@link CreatePINControlAccessTokenApi} bound to this client. */
43
+ createPINControlAccessTokenApi() {
44
+ return new api_1.CreatePINControlAccessTokenApi(this.configuration, undefined, this.http);
45
+ }
46
+ /** {@link GetCardApi} bound to this client. */
47
+ getCardApi() {
48
+ return new api_1.GetCardApi(this.configuration, undefined, this.http);
49
+ }
50
+ /** {@link GetCardPaymentInfoApi} bound to this client. */
51
+ getCardPaymentInfoApi() {
52
+ return new api_1.GetCardPaymentInfoApi(this.configuration, undefined, this.http);
53
+ }
54
+ /** {@link GetPlasticManufacturingHistoryApi} bound to this client. */
55
+ getPlasticManufacturingHistoryApi() {
56
+ return new api_1.GetPlasticManufacturingHistoryApi(this.configuration, undefined, this.http);
57
+ }
58
+ /** {@link UpdateCardApi} bound to this client. */
59
+ updateCardApi() {
60
+ return new api_1.UpdateCardApi(this.configuration, undefined, this.http);
61
+ }
62
+ static builder() {
63
+ return new CardClientBuilder();
64
+ }
65
+ }
66
+ exports.CardClient = CardClient;
67
+ /** Builds a {@link CardClient}: base URL + optional OAuth + transport customization. */
68
+ class CardClientBuilder {
69
+ constructor() {
70
+ this._customizers = [];
71
+ }
72
+ /** The module's host, e.g. `https://api.<tenant>.../issuer`. */
73
+ baseUrl(baseUrl) {
74
+ this._baseUrl = baseUrl;
75
+ return this;
76
+ }
77
+ /** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
78
+ oauth(tokens) {
79
+ this._tokens = tokens;
80
+ return this;
81
+ }
82
+ /**
83
+ * Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
84
+ * default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
85
+ * calls run in order.
86
+ */
87
+ configure(customizer) {
88
+ this._customizers.push(customizer);
89
+ return this;
90
+ }
91
+ build() {
92
+ const http = this._tokens ? (0, oauth_1.createOAuthAxios)(this._tokens) : axios_1.default.create();
93
+ for (const customizer of this._customizers) {
94
+ customizer(http);
95
+ }
96
+ const configuration = new configuration_1.Configuration({ basePath: this._baseUrl });
97
+ return new CardClient(http, configuration);
98
+ }
99
+ }
100
+ exports.CardClientBuilder = CardClientBuilder;
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export * from "./api";
13
13
  export * from "./configuration";
14
+ export * from './client';
@@ -29,3 +29,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  __exportStar(require("./api"), exports);
31
31
  __exportStar(require("./configuration"), exports);
32
+ __exportStar(require("./client"), exports);
@@ -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,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CardholderClientBuilder = exports.CardholderClient = void 0;
4
+ /*
5
+ * Enfuce nextgen SDK — fluent module client.
6
+ *
7
+ * GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
8
+ * API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
9
+ * retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
10
+ */
11
+ const axios_1 = require("axios");
12
+ const oauth_1 = require("../oauth");
13
+ const configuration_1 = require("./configuration");
14
+ const api_1 = require("./api");
15
+ /**
16
+ * Fluent entry point for this module. Build one with {@link CardholderClient.builder}:
17
+ *
18
+ * ```ts
19
+ * const client = CardholderClient.builder()
20
+ * .baseUrl('https://api.example.com/...')
21
+ * .oauth(tokens)
22
+ * .build();
23
+ * ```
24
+ */
25
+ class CardholderClient {
26
+ constructor(
27
+ /** The axios instance — OAuth interceptors and any customizations already applied. */
28
+ http,
29
+ /** The module configuration — base path applied. */
30
+ configuration) {
31
+ this.http = http;
32
+ this.configuration = configuration;
33
+ }
34
+ /** Build any API in this module bound to this client (for APIs without a named getter). */
35
+ api(factory) {
36
+ return factory(this.configuration, this.http);
37
+ }
38
+ /** {@link CreateCardholderApi} bound to this client. */
39
+ createCardholderApi() {
40
+ return new api_1.CreateCardholderApi(this.configuration, undefined, this.http);
41
+ }
42
+ /** {@link GetCardholderApi} bound to this client. */
43
+ getCardholderApi() {
44
+ return new api_1.GetCardholderApi(this.configuration, undefined, this.http);
45
+ }
46
+ /** {@link GetCardsByCardholderIdApi} bound to this client. */
47
+ getCardsByCardholderIdApi() {
48
+ return new api_1.GetCardsByCardholderIdApi(this.configuration, undefined, this.http);
49
+ }
50
+ /** {@link UpdateCardholderApi} bound to this client. */
51
+ updateCardholderApi() {
52
+ return new api_1.UpdateCardholderApi(this.configuration, undefined, this.http);
53
+ }
54
+ static builder() {
55
+ return new CardholderClientBuilder();
56
+ }
57
+ }
58
+ exports.CardholderClient = CardholderClient;
59
+ /** Builds a {@link CardholderClient}: base URL + optional OAuth + transport customization. */
60
+ class CardholderClientBuilder {
61
+ constructor() {
62
+ this._customizers = [];
63
+ }
64
+ /** The module's host, e.g. `https://api.<tenant>.../issuer`. */
65
+ baseUrl(baseUrl) {
66
+ this._baseUrl = baseUrl;
67
+ return this;
68
+ }
69
+ /** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
70
+ oauth(tokens) {
71
+ this._tokens = tokens;
72
+ return this;
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) {
80
+ this._customizers.push(customizer);
81
+ return this;
82
+ }
83
+ build() {
84
+ const http = this._tokens ? (0, oauth_1.createOAuthAxios)(this._tokens) : axios_1.default.create();
85
+ for (const customizer of this._customizers) {
86
+ customizer(http);
87
+ }
88
+ const configuration = new configuration_1.Configuration({ basePath: this._baseUrl });
89
+ return new CardholderClient(http, configuration);
90
+ }
91
+ }
92
+ exports.CardholderClientBuilder = CardholderClientBuilder;
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export * from "./api";
13
13
  export * from "./configuration";
14
+ export * from './client';
@@ -29,3 +29,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  __exportStar(require("./api"), exports);
31
31
  __exportStar(require("./configuration"), exports);
32
+ __exportStar(require("./client"), exports);
@@ -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,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CardsClientBuilder = exports.CardsClient = void 0;
4
+ /*
5
+ * Enfuce nextgen SDK — fluent module client.
6
+ *
7
+ * GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
8
+ * API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
9
+ * retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
10
+ */
11
+ const axios_1 = require("axios");
12
+ const oauth_1 = require("../oauth");
13
+ const configuration_1 = require("./configuration");
14
+ const api_1 = require("./api");
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
+ class CardsClient {
26
+ constructor(
27
+ /** The axios instance — OAuth interceptors and any customizations already applied. */
28
+ http,
29
+ /** The module configuration — base path applied. */
30
+ configuration) {
31
+ this.http = http;
32
+ this.configuration = configuration;
33
+ }
34
+ /** Build any API in this module bound to this client (for APIs without a named getter). */
35
+ api(factory) {
36
+ return factory(this.configuration, this.http);
37
+ }
38
+ /** {@link CardsApi} bound to this client. */
39
+ cardsApi() {
40
+ return new api_1.CardsApi(this.configuration, undefined, this.http);
41
+ }
42
+ static builder() {
43
+ return new CardsClientBuilder();
44
+ }
45
+ }
46
+ exports.CardsClient = CardsClient;
47
+ /** Builds a {@link CardsClient}: base URL + optional OAuth + transport customization. */
48
+ class CardsClientBuilder {
49
+ constructor() {
50
+ this._customizers = [];
51
+ }
52
+ /** The module's host, e.g. `https://api.<tenant>.../issuer`. */
53
+ baseUrl(baseUrl) {
54
+ this._baseUrl = baseUrl;
55
+ return this;
56
+ }
57
+ /** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
58
+ oauth(tokens) {
59
+ this._tokens = tokens;
60
+ return this;
61
+ }
62
+ /**
63
+ * Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
64
+ * default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
65
+ * calls run in order.
66
+ */
67
+ configure(customizer) {
68
+ this._customizers.push(customizer);
69
+ return this;
70
+ }
71
+ build() {
72
+ const http = this._tokens ? (0, oauth_1.createOAuthAxios)(this._tokens) : axios_1.default.create();
73
+ for (const customizer of this._customizers) {
74
+ customizer(http);
75
+ }
76
+ const configuration = new configuration_1.Configuration({ basePath: this._baseUrl });
77
+ return new CardsClient(http, configuration);
78
+ }
79
+ }
80
+ exports.CardsClientBuilder = CardsClientBuilder;
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export * from "./api";
13
13
  export * from "./configuration";
14
+ export * from './client';
@@ -29,3 +29,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  __exportStar(require("./api"), exports);
31
31
  __exportStar(require("./configuration"), exports);
32
+ __exportStar(require("./client"), exports);