@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.
Files changed (103) 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/pin/client.d.ts +49 -0
  43. package/dist/esm/pin/client.js +79 -0
  44. package/dist/esm/pin/index.d.ts +1 -0
  45. package/dist/esm/pin/index.js +1 -0
  46. package/dist/esm/threeds/client.d.ts +47 -0
  47. package/dist/esm/threeds/client.js +75 -0
  48. package/dist/esm/threeds/index.d.ts +1 -0
  49. package/dist/esm/threeds/index.js +1 -0
  50. package/dist/esm/threeds-oob/client.d.ts +47 -0
  51. package/dist/esm/threeds-oob/client.js +75 -0
  52. package/dist/esm/threeds-oob/index.d.ts +1 -0
  53. package/dist/esm/threeds-oob/index.js +1 -0
  54. package/dist/esm/wallet/client.d.ts +61 -0
  55. package/dist/esm/wallet/client.js +103 -0
  56. package/dist/esm/wallet/index.d.ts +1 -0
  57. package/dist/esm/wallet/index.js +1 -0
  58. package/dist/exchange-rate/client.d.ts +51 -0
  59. package/dist/exchange-rate/client.js +88 -0
  60. package/dist/exchange-rate/index.d.ts +1 -0
  61. package/dist/exchange-rate/index.js +1 -0
  62. package/dist/issuer-events/client.d.ts +47 -0
  63. package/dist/issuer-events/client.js +80 -0
  64. package/dist/issuer-events/index.d.ts +1 -0
  65. package/dist/issuer-events/index.js +1 -0
  66. package/dist/pin/client.d.ts +49 -0
  67. package/dist/pin/client.js +84 -0
  68. package/dist/pin/index.d.ts +1 -0
  69. package/dist/pin/index.js +1 -0
  70. package/dist/threeds/client.d.ts +47 -0
  71. package/dist/threeds/client.js +80 -0
  72. package/dist/threeds/index.d.ts +1 -0
  73. package/dist/threeds/index.js +1 -0
  74. package/dist/threeds-oob/client.d.ts +47 -0
  75. package/dist/threeds-oob/client.js +80 -0
  76. package/dist/threeds-oob/index.d.ts +1 -0
  77. package/dist/threeds-oob/index.js +1 -0
  78. package/dist/wallet/client.d.ts +61 -0
  79. package/dist/wallet/client.js +108 -0
  80. package/dist/wallet/index.d.ts +1 -0
  81. package/dist/wallet/index.js +1 -0
  82. package/package.json +1 -1
  83. package/src/authorisation-control/client.ts +86 -0
  84. package/src/authorisation-control/index.ts +2 -0
  85. package/src/card/client.ts +116 -0
  86. package/src/card/index.ts +2 -0
  87. package/src/cardholder/client.ts +104 -0
  88. package/src/cardholder/index.ts +2 -0
  89. package/src/cards/client.ts +86 -0
  90. package/src/cards/index.ts +2 -0
  91. package/src/exchange-rate/client.ts +98 -0
  92. package/src/exchange-rate/index.ts +2 -0
  93. package/src/issuer-events/client.ts +86 -0
  94. package/src/issuer-events/index.ts +2 -0
  95. package/src/pin/client.ts +92 -0
  96. package/src/pin/index.ts +2 -0
  97. package/src/threeds/client.ts +86 -0
  98. package/src/threeds/index.ts +2 -0
  99. package/src/threeds-oob/client.ts +86 -0
  100. package/src/threeds-oob/index.ts +2 -0
  101. package/src/wallet/client.ts +128 -0
  102. package/src/wallet/index.ts +2 -0
  103. package/test/exchange-rate-client.test.ts +36 -0
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThreedsClientBuilder = exports.ThreedsClient = 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 ThreedsClient.builder}:
17
+ *
18
+ * ```ts
19
+ * const client = ThreedsClient.builder()
20
+ * .baseUrl('https://api.example.com/...')
21
+ * .oauth(tokens)
22
+ * .build();
23
+ * ```
24
+ */
25
+ class ThreedsClient {
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 ThreeDSApi} bound to this client. */
39
+ threeDSApi() {
40
+ return new api_1.ThreeDSApi(this.configuration, undefined, this.http);
41
+ }
42
+ static builder() {
43
+ return new ThreedsClientBuilder();
44
+ }
45
+ }
46
+ exports.ThreedsClient = ThreedsClient;
47
+ /** Builds a {@link ThreedsClient}: base URL + optional OAuth + transport customization. */
48
+ class ThreedsClientBuilder {
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 ThreedsClient(http, configuration);
78
+ }
79
+ }
80
+ exports.ThreedsClientBuilder = ThreedsClientBuilder;
@@ -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 { OOBAuthenticationChallengeWebhookNotificationApi } from './api';
5
+ /**
6
+ * Fluent entry point for this module. Build one with {@link ThreedsOobClient.builder}:
7
+ *
8
+ * ```ts
9
+ * const client = ThreedsOobClient.builder()
10
+ * .baseUrl('https://api.example.com/...')
11
+ * .oauth(tokens)
12
+ * .build();
13
+ * ```
14
+ */
15
+ export declare class ThreedsOobClient {
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 OOBAuthenticationChallengeWebhookNotificationApi} bound to this client. */
28
+ oOBAuthenticationChallengeWebhookNotificationApi(): OOBAuthenticationChallengeWebhookNotificationApi;
29
+ static builder(): ThreedsOobClientBuilder;
30
+ }
31
+ /** Builds a {@link ThreedsOobClient}: base URL + optional OAuth + transport customization. */
32
+ export declare class ThreedsOobClientBuilder {
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(): ThreedsOobClient;
47
+ }
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThreedsOobClientBuilder = exports.ThreedsOobClient = 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 ThreedsOobClient.builder}:
17
+ *
18
+ * ```ts
19
+ * const client = ThreedsOobClient.builder()
20
+ * .baseUrl('https://api.example.com/...')
21
+ * .oauth(tokens)
22
+ * .build();
23
+ * ```
24
+ */
25
+ class ThreedsOobClient {
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 OOBAuthenticationChallengeWebhookNotificationApi} bound to this client. */
39
+ oOBAuthenticationChallengeWebhookNotificationApi() {
40
+ return new api_1.OOBAuthenticationChallengeWebhookNotificationApi(this.configuration, undefined, this.http);
41
+ }
42
+ static builder() {
43
+ return new ThreedsOobClientBuilder();
44
+ }
45
+ }
46
+ exports.ThreedsOobClient = ThreedsOobClient;
47
+ /** Builds a {@link ThreedsOobClient}: base URL + optional OAuth + transport customization. */
48
+ class ThreedsOobClientBuilder {
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 ThreedsOobClient(http, configuration);
78
+ }
79
+ }
80
+ exports.ThreedsOobClientBuilder = ThreedsOobClientBuilder;
@@ -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,61 @@
1
+ import { type AxiosInstance } from 'axios';
2
+ import { type TokenManager } from '../oauth';
3
+ import { Configuration } from './configuration';
4
+ import { ActivateTokenApi, DeactivateTokenApi, EligibleTokenRequestorsApi, GetTokensApi, PushCardsApi, PushProvisionApi, SuspendTokenApi, UnsuspendTokenApi } from './api';
5
+ /**
6
+ * Fluent entry point for this module. Build one with {@link WalletClient.builder}:
7
+ *
8
+ * ```ts
9
+ * const client = WalletClient.builder()
10
+ * .baseUrl('https://api.example.com/...')
11
+ * .oauth(tokens)
12
+ * .build();
13
+ * ```
14
+ */
15
+ export declare class WalletClient {
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 ActivateTokenApi} bound to this client. */
28
+ activateTokenApi(): ActivateTokenApi;
29
+ /** {@link DeactivateTokenApi} bound to this client. */
30
+ deactivateTokenApi(): DeactivateTokenApi;
31
+ /** {@link EligibleTokenRequestorsApi} bound to this client. */
32
+ eligibleTokenRequestorsApi(): EligibleTokenRequestorsApi;
33
+ /** {@link GetTokensApi} bound to this client. */
34
+ getTokensApi(): GetTokensApi;
35
+ /** {@link PushCardsApi} bound to this client. */
36
+ pushCardsApi(): PushCardsApi;
37
+ /** {@link PushProvisionApi} bound to this client. */
38
+ pushProvisionApi(): PushProvisionApi;
39
+ /** {@link SuspendTokenApi} bound to this client. */
40
+ suspendTokenApi(): SuspendTokenApi;
41
+ /** {@link UnsuspendTokenApi} bound to this client. */
42
+ unsuspendTokenApi(): UnsuspendTokenApi;
43
+ static builder(): WalletClientBuilder;
44
+ }
45
+ /** Builds a {@link WalletClient}: base URL + optional OAuth + transport customization. */
46
+ export declare class WalletClientBuilder {
47
+ private _baseUrl?;
48
+ private _tokens?;
49
+ private _customizers;
50
+ /** The module's host, e.g. `https://api.<tenant>.../issuer`. */
51
+ baseUrl(baseUrl: string): this;
52
+ /** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
53
+ oauth(tokens: TokenManager): this;
54
+ /**
55
+ * Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
56
+ * default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
57
+ * calls run in order.
58
+ */
59
+ configure(customizer: (http: AxiosInstance) => void): this;
60
+ build(): WalletClient;
61
+ }
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletClientBuilder = exports.WalletClient = 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 WalletClient.builder}:
17
+ *
18
+ * ```ts
19
+ * const client = WalletClient.builder()
20
+ * .baseUrl('https://api.example.com/...')
21
+ * .oauth(tokens)
22
+ * .build();
23
+ * ```
24
+ */
25
+ class WalletClient {
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 ActivateTokenApi} bound to this client. */
39
+ activateTokenApi() {
40
+ return new api_1.ActivateTokenApi(this.configuration, undefined, this.http);
41
+ }
42
+ /** {@link DeactivateTokenApi} bound to this client. */
43
+ deactivateTokenApi() {
44
+ return new api_1.DeactivateTokenApi(this.configuration, undefined, this.http);
45
+ }
46
+ /** {@link EligibleTokenRequestorsApi} bound to this client. */
47
+ eligibleTokenRequestorsApi() {
48
+ return new api_1.EligibleTokenRequestorsApi(this.configuration, undefined, this.http);
49
+ }
50
+ /** {@link GetTokensApi} bound to this client. */
51
+ getTokensApi() {
52
+ return new api_1.GetTokensApi(this.configuration, undefined, this.http);
53
+ }
54
+ /** {@link PushCardsApi} bound to this client. */
55
+ pushCardsApi() {
56
+ return new api_1.PushCardsApi(this.configuration, undefined, this.http);
57
+ }
58
+ /** {@link PushProvisionApi} bound to this client. */
59
+ pushProvisionApi() {
60
+ return new api_1.PushProvisionApi(this.configuration, undefined, this.http);
61
+ }
62
+ /** {@link SuspendTokenApi} bound to this client. */
63
+ suspendTokenApi() {
64
+ return new api_1.SuspendTokenApi(this.configuration, undefined, this.http);
65
+ }
66
+ /** {@link UnsuspendTokenApi} bound to this client. */
67
+ unsuspendTokenApi() {
68
+ return new api_1.UnsuspendTokenApi(this.configuration, undefined, this.http);
69
+ }
70
+ static builder() {
71
+ return new WalletClientBuilder();
72
+ }
73
+ }
74
+ exports.WalletClient = WalletClient;
75
+ /** Builds a {@link WalletClient}: base URL + optional OAuth + transport customization. */
76
+ class WalletClientBuilder {
77
+ constructor() {
78
+ this._customizers = [];
79
+ }
80
+ /** The module's host, e.g. `https://api.<tenant>.../issuer`. */
81
+ baseUrl(baseUrl) {
82
+ this._baseUrl = baseUrl;
83
+ return this;
84
+ }
85
+ /** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
86
+ oauth(tokens) {
87
+ this._tokens = tokens;
88
+ return this;
89
+ }
90
+ /**
91
+ * Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
92
+ * default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
93
+ * calls run in order.
94
+ */
95
+ configure(customizer) {
96
+ this._customizers.push(customizer);
97
+ return this;
98
+ }
99
+ build() {
100
+ const http = this._tokens ? (0, oauth_1.createOAuthAxios)(this._tokens) : axios_1.default.create();
101
+ for (const customizer of this._customizers) {
102
+ customizer(http);
103
+ }
104
+ const configuration = new configuration_1.Configuration({ basePath: this._baseUrl });
105
+ return new WalletClient(http, configuration);
106
+ }
107
+ }
108
+ exports.WalletClientBuilder = WalletClientBuilder;
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enfuce/nextgen-sdk",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Enfuce nextgen client SDK (TypeScript). One namespaced export per API.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -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
+ AuthorisationRequestAPIApi,
13
+ } from './api';
14
+
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
+ export class AuthorisationControlClient {
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 AuthorisationRequestAPIApi} bound to this client. */
40
+ authorisationRequestAPIApi(): AuthorisationRequestAPIApi {
41
+ return new AuthorisationRequestAPIApi(this.configuration, undefined, this.http);
42
+ }
43
+
44
+ static builder(): AuthorisationControlClientBuilder {
45
+ return new AuthorisationControlClientBuilder();
46
+ }
47
+ }
48
+
49
+ /** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
50
+ export class AuthorisationControlClientBuilder {
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(): AuthorisationControlClient {
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 AuthorisationControlClient(http, configuration);
85
+ }
86
+ }
@@ -16,3 +16,5 @@
16
16
  export * from "./api";
17
17
  export * from "./configuration";
18
18
 
19
+
20
+ export * from './client';
@@ -0,0 +1,116 @@
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
+ CreateCardApi,
13
+ CreatePINControlAccessTokenApi,
14
+ GetCardApi,
15
+ GetCardPaymentInfoApi,
16
+ GetPlasticManufacturingHistoryApi,
17
+ UpdateCardApi,
18
+ } from './api';
19
+
20
+ /**
21
+ * Fluent entry point for this module. Build one with {@link CardClient.builder}:
22
+ *
23
+ * ```ts
24
+ * const client = CardClient.builder()
25
+ * .baseUrl('https://api.example.com/...')
26
+ * .oauth(tokens)
27
+ * .build();
28
+ * ```
29
+ */
30
+ export class CardClient {
31
+
32
+ constructor(
33
+ /** The axios instance — OAuth interceptors and any customizations already applied. */
34
+ readonly http: AxiosInstance,
35
+ /** The module configuration — base path applied. */
36
+ readonly configuration: Configuration,
37
+ ) {}
38
+
39
+ /** Build any API in this module bound to this client (for APIs without a named getter). */
40
+ api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T {
41
+ return factory(this.configuration, this.http);
42
+ }
43
+
44
+ /** {@link CreateCardApi} bound to this client. */
45
+ createCardApi(): CreateCardApi {
46
+ return new CreateCardApi(this.configuration, undefined, this.http);
47
+ }
48
+
49
+ /** {@link CreatePINControlAccessTokenApi} bound to this client. */
50
+ createPINControlAccessTokenApi(): CreatePINControlAccessTokenApi {
51
+ return new CreatePINControlAccessTokenApi(this.configuration, undefined, this.http);
52
+ }
53
+
54
+ /** {@link GetCardApi} bound to this client. */
55
+ getCardApi(): GetCardApi {
56
+ return new GetCardApi(this.configuration, undefined, this.http);
57
+ }
58
+
59
+ /** {@link GetCardPaymentInfoApi} bound to this client. */
60
+ getCardPaymentInfoApi(): GetCardPaymentInfoApi {
61
+ return new GetCardPaymentInfoApi(this.configuration, undefined, this.http);
62
+ }
63
+
64
+ /** {@link GetPlasticManufacturingHistoryApi} bound to this client. */
65
+ getPlasticManufacturingHistoryApi(): GetPlasticManufacturingHistoryApi {
66
+ return new GetPlasticManufacturingHistoryApi(this.configuration, undefined, this.http);
67
+ }
68
+
69
+ /** {@link UpdateCardApi} bound to this client. */
70
+ updateCardApi(): UpdateCardApi {
71
+ return new UpdateCardApi(this.configuration, undefined, this.http);
72
+ }
73
+
74
+ static builder(): CardClientBuilder {
75
+ return new CardClientBuilder();
76
+ }
77
+ }
78
+
79
+ /** Builds a {@link CardClient}: base URL + optional OAuth + transport customization. */
80
+ export class CardClientBuilder {
81
+
82
+ private _baseUrl?: string;
83
+ private _tokens?: TokenManager;
84
+ private _customizers: Array<(http: AxiosInstance) => void> = [];
85
+
86
+ /** The module's host, e.g. `https://api.<tenant>.../issuer`. */
87
+ baseUrl(baseUrl: string): this {
88
+ this._baseUrl = baseUrl;
89
+ return this;
90
+ }
91
+
92
+ /** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
93
+ oauth(tokens: TokenManager): this {
94
+ this._tokens = tokens;
95
+ return this;
96
+ }
97
+
98
+ /**
99
+ * Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
100
+ * default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
101
+ * calls run in order.
102
+ */
103
+ configure(customizer: (http: AxiosInstance) => void): this {
104
+ this._customizers.push(customizer);
105
+ return this;
106
+ }
107
+
108
+ build(): CardClient {
109
+ const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
110
+ for (const customizer of this._customizers) {
111
+ customizer(http);
112
+ }
113
+ const configuration = new Configuration({ basePath: this._baseUrl });
114
+ return new CardClient(http, configuration);
115
+ }
116
+ }
package/src/card/index.ts CHANGED
@@ -16,3 +16,5 @@
16
16
  export * from "./api";
17
17
  export * from "./configuration";
18
18
 
19
+
20
+ export * from './client';