@enfuce/nextgen-sdk 0.0.9 → 0.0.11

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 (2) hide show
  1. package/README.md +25 -25
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -19,8 +19,8 @@ OAuth2 `client_credentials` bearer token:
19
19
  ```typescript
20
20
  import { oauth, card, config } from '@enfuce/nextgen-sdk';
21
21
 
22
- // Identify the host by tenant + environment; the config helper derives every URL from it.
23
- const te = { tenant: '<tenant>', environment: 'eu.live.prod' };
22
+ // Set the tenant + environment once; the config helper derives every base URL (and the token URL) from it.
23
+ const te = { tenant: '<tenant>', environment: '<environment>' };
24
24
 
25
25
  // One token manager (cached client-credentials grant) — reuse it across every module.
26
26
  const clientCredentialsManager = oauth.clientCredentials({
@@ -39,10 +39,10 @@ const client = card.CardClient.builder()
39
39
  const { data } = await client.getCardApi().getCard(cardId, 'you@example.com');
40
40
  ```
41
41
 
42
- `.oauth(clientCredentialsManager)` attaches the token at the transport layer, so it works uniformly
43
- for every module including ones whose spec declares no security scheme
44
- (e.g. `exchangeRate.ExchangeRateClient`). See [Client customization](#client-customization) for
45
- transport tuning (timeouts, proxy, interceptors).
42
+ `environment` is the target platform e.g. `ext-uat1-sandbox` (sandbox) or `eu.live.prod`
43
+ (production). One `clientCredentialsManager` authenticates every module, so build it once and reuse it
44
+ across all your clients. See [Client customization](#client-customization) for transport tuning
45
+ (timeouts, proxy, interceptors).
46
46
 
47
47
  Keeping the token URL separate from the client identity? Pass a `ClientCredentials` — e.g. with the
48
48
  `config` helper deriving the URL:
@@ -110,12 +110,12 @@ const client = card.CardClient.builder()
110
110
 
111
111
  ## API modules
112
112
 
113
- Each module builds the same way — pick the base URL for the module's host
113
+ Each module builds the same way — set its base URL with the matching accessor
114
114
  (`config.issuerBaseUrl`, `config.processorBaseUrl`, or `config.exchangeRateBaseUrl`) and reuse the
115
- shared `clientCredentialsManager`. Every call resolves to an axios response, so read `.data`. The
116
- snippets below assume `te` and `clientCredentialsManager` are in scope.
115
+ shared `clientCredentialsManager`. Every call resolves to an axios response, so read `.data`.
116
+ Snippets assume `te` and `clientCredentialsManager` are in scope.
117
117
 
118
- ### `cardholder` — issuer host
118
+ ### `cardholder` — `issuerBaseUrl`
119
119
 
120
120
  ```typescript
121
121
  import { cardholder, config } from '@enfuce/nextgen-sdk';
@@ -127,7 +127,7 @@ const { data: cards } = await client.getCardsByCardholderIdApi()
127
127
  .getCardsByCardholderId(cardholderId, undefined, undefined, 'you@example.com');
128
128
  ```
129
129
 
130
- ### `card` — issuer host
130
+ ### `card` — `issuerBaseUrl`
131
131
 
132
132
  ```typescript
133
133
  import { card, config } from '@enfuce/nextgen-sdk';
@@ -138,7 +138,7 @@ const { data } = await client.getCardApi().getCard(cardId, 'you@example.com');
138
138
  await client.updateCardApi().activateCard(cardId, undefined, 'you@example.com'); // (id, idempotencyKey, auditUser)
139
139
  ```
140
140
 
141
- ### `wallet` — issuer host
141
+ ### `wallet` — `issuerBaseUrl`
142
142
 
143
143
  ```typescript
144
144
  import { wallet, config } from '@enfuce/nextgen-sdk';
@@ -148,7 +148,7 @@ const client = wallet.WalletClient.builder().baseUrl(config.issuerBaseUrl(te)).o
148
148
  const { data: tokens } = await client.getTokensApi().getTokens(cardId, false, undefined, 'you@example.com');
149
149
  ```
150
150
 
151
- ### `pin` — issuer host
151
+ ### `pin` — `issuerBaseUrl`
152
152
 
153
153
  ```typescript
154
154
  import { pin, config } from '@enfuce/nextgen-sdk';
@@ -158,7 +158,7 @@ const client = pin.PinClient.builder().baseUrl(config.issuerBaseUrl(te)).oauth(c
158
158
  const { data } = await client.pINOperationsUsingPKIApi().viewPin(viewPinRequestBody, 'you@example.com');
159
159
  ```
160
160
 
161
- ### `exchangeRate` — exchange-rate host
161
+ ### `exchangeRate` — `exchangeRateBaseUrl`
162
162
 
163
163
  ```typescript
164
164
  import { exchangeRate, config } from '@enfuce/nextgen-sdk';
@@ -169,7 +169,7 @@ const { data: currencies } = await client.getECBSupportedCurrenciesApi().getEcbS
169
169
  const { data: rate } = await client.getECBExchangeRateApi().getEcbRateV1('EUR', 'USD');
170
170
  ```
171
171
 
172
- ### `threeds` — processor host
172
+ ### `threeds` — `processorBaseUrl`
173
173
 
174
174
  ```typescript
175
175
  import { threeds, config } from '@enfuce/nextgen-sdk';
@@ -179,7 +179,7 @@ const client = threeds.ThreedsClient.builder().baseUrl(config.processorBaseUrl(t
179
179
  await client.threeDSApi().handleAuthenticationChallengeResult(challengeResultBody);
180
180
  ```
181
181
 
182
- ### `cards` — processor host
182
+ ### `cards` — `processorBaseUrl`
183
183
 
184
184
  ```typescript
185
185
  import { cards, config } from '@enfuce/nextgen-sdk';
@@ -189,11 +189,11 @@ const client = cards.CardsClient.builder().baseUrl(config.processorBaseUrl(te)).
189
189
  await client.cardsApi().resetPinCounter(cardId, sequenceNumber);
190
190
  ```
191
191
 
192
- ## Webhooks (model-only modules)
192
+ ## Webhooks
193
193
 
194
- Some APIs describe payloads Enfuce sends **to you** you implement the endpoint, Enfuce POSTs to it.
195
- These specs are shipped **model-only**: the namespace exports just the payload types (no
196
- `<Module>Client`, no API classes). Use the types to type the inbound request body:
194
+ These are the calls Enfuce makes **to you**: you host the endpoint and Enfuce POSTs to it. Such
195
+ modules export only the payload types there is no client to call, since your app receives these
196
+ rather than requesting them. Use the types to type the inbound request body:
197
197
 
198
198
  ```typescript
199
199
  import type { issuerEvents } from '@enfuce/nextgen-sdk';
@@ -222,13 +222,13 @@ const decision: authorisationControl.AuthResponseBody = {
222
222
  | `transactionEvent` | `TransactionEvent` |
223
223
 
224
224
  > A runnable Express example of all of the above (both the API modules and the webhook receivers)
225
- > lives in [`examples/backends/typescript`](../../examples/backends/typescript).
225
+ > lives in [`examples/backends/typescript`](https://gitlab.com/enfuce/mycore/client-sdks/-/tree/master/examples/backends/typescript).
226
226
 
227
- ## File Parsing (model-only module)
227
+ ## File parsing
228
228
 
229
- Some specs describe a **file** Enfuce produces for you to ingest (not an HTTP API). These are shipped
230
- **model-only** too the namespace exports just the types, and you parse the file's JSON into them.
231
- `clearingFileCopy` is a clearing (settlement) file: a `FileData` header plus a list of records.
229
+ Enfuce delivers some data as a **file** rather than an HTTP API. These modules export only the
230
+ types — parse the file's JSON into them. `clearingFileCopy` is a clearing (settlement) file: a
231
+ `FileData` header plus a list of records.
232
232
 
233
233
  ```typescript
234
234
  import type { clearingFileCopy } from '@enfuce/nextgen-sdk';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enfuce/nextgen-sdk",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Enfuce nextgen client SDK (TypeScript). One namespaced export per API.",
5
5
  "publishConfig": {
6
6
  "access": "public"