@enfuce/nextgen-sdk 0.0.8 → 0.0.10

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 (74) hide show
  1. package/README.md +196 -27
  2. package/dist/authorisation-control/api.d.ts +0 -56
  3. package/dist/authorisation-control/api.js +1 -115
  4. package/dist/authorisation-control/index.d.ts +0 -1
  5. package/dist/authorisation-control/index.js +0 -1
  6. package/dist/card/api.js +12 -12
  7. package/dist/cardholder/api.js +5 -5
  8. package/dist/esm/authorisation-control/api.d.ts +0 -56
  9. package/dist/esm/authorisation-control/api.js +0 -110
  10. package/dist/esm/authorisation-control/index.d.ts +0 -1
  11. package/dist/esm/authorisation-control/index.js +0 -1
  12. package/dist/esm/card/api.js +12 -12
  13. package/dist/esm/cardholder/api.js +5 -5
  14. package/dist/esm/issuer-events/api.d.ts +0 -120
  15. package/dist/esm/issuer-events/api.js +0 -241
  16. package/dist/esm/issuer-events/index.d.ts +0 -1
  17. package/dist/esm/issuer-events/index.js +0 -1
  18. package/dist/esm/oauth/clientCredentials.d.ts +14 -0
  19. package/dist/esm/oauth/clientCredentials.js +39 -0
  20. package/dist/esm/oauth/index.d.ts +1 -1
  21. package/dist/esm/oauth/index.js +1 -1
  22. package/dist/esm/pin/api.d.ts +52 -0
  23. package/dist/esm/pin/api.js +80 -3
  24. package/dist/esm/threeds-oob/api.d.ts +0 -56
  25. package/dist/esm/threeds-oob/api.js +0 -112
  26. package/dist/esm/threeds-oob/index.d.ts +0 -1
  27. package/dist/esm/threeds-oob/index.js +0 -1
  28. package/dist/esm/wallet/api.js +12 -12
  29. package/dist/issuer-events/api.d.ts +0 -120
  30. package/dist/issuer-events/api.js +1 -246
  31. package/dist/issuer-events/index.d.ts +0 -1
  32. package/dist/issuer-events/index.js +0 -1
  33. package/dist/oauth/clientCredentials.d.ts +14 -0
  34. package/dist/oauth/clientCredentials.js +41 -0
  35. package/dist/oauth/index.d.ts +1 -1
  36. package/dist/oauth/index.js +3 -1
  37. package/dist/pin/api.d.ts +52 -0
  38. package/dist/pin/api.js +80 -3
  39. package/dist/threeds-oob/api.d.ts +0 -56
  40. package/dist/threeds-oob/api.js +1 -117
  41. package/dist/threeds-oob/index.d.ts +0 -1
  42. package/dist/threeds-oob/index.js +0 -1
  43. package/dist/wallet/api.js +12 -12
  44. package/package.json +1 -1
  45. package/src/authorisation-control/api.ts +0 -102
  46. package/src/authorisation-control/index.ts +0 -2
  47. package/src/card/api.ts +12 -12
  48. package/src/cardholder/api.ts +5 -5
  49. package/src/issuer-events/api.ts +0 -237
  50. package/src/issuer-events/index.ts +0 -2
  51. package/src/oauth/clientCredentials.ts +44 -0
  52. package/src/oauth/index.ts +8 -1
  53. package/src/pin/api.ts +99 -3
  54. package/src/threeds-oob/api.ts +0 -105
  55. package/src/threeds-oob/index.ts +0 -2
  56. package/src/wallet/api.ts +12 -12
  57. package/dist/authorisation-control/client.d.ts +0 -47
  58. package/dist/authorisation-control/client.js +0 -80
  59. package/dist/esm/authorisation-control/client.d.ts +0 -47
  60. package/dist/esm/authorisation-control/client.js +0 -75
  61. package/dist/esm/issuer-events/client.d.ts +0 -47
  62. package/dist/esm/issuer-events/client.js +0 -75
  63. package/dist/esm/threeds-oob/client.d.ts +0 -47
  64. package/dist/esm/threeds-oob/client.js +0 -75
  65. package/dist/issuer-events/client.d.ts +0 -47
  66. package/dist/issuer-events/client.js +0 -80
  67. package/dist/threeds-oob/client.d.ts +0 -47
  68. package/dist/threeds-oob/client.js +0 -80
  69. package/src/authorisation-control/client.ts +0 -86
  70. package/src/issuer-events/client.ts +0 -86
  71. package/src/threeds-oob/client.ts +0 -86
  72. package/test/authorisation-control.test.ts +0 -71
  73. package/test/issuer-events.test.ts +0 -55
  74. package/test/threeds-oob.test.ts +0 -90
@@ -11,21 +11,6 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- import globalAxios from 'axios';
24
- // Some imports not used depending on template conditions
25
- // @ts-ignore
26
- import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
27
- // @ts-ignore
28
- import { BASE_PATH, BaseAPI, operationServerMap } from './base';
29
14
  /**
30
15
  * The wallets common name for authorization decision.
31
16
  */
@@ -1178,229 +1163,3 @@ export const TokenStatus = {
1178
1163
  Inactive: 'INACTIVE',
1179
1164
  Suspended: 'SUSPENDED',
1180
1165
  };
1181
- /**
1182
- * IssuerEventWebhooksApi - axios parameter creator
1183
- */
1184
- export const IssuerEventWebhooksApiAxiosParamCreator = function (configuration) {
1185
- return {
1186
- /**
1187
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
1188
- * @summary Outgoing card event webhook endpoint
1189
- * @param {CardEvent} cardEvent Card event
1190
- * @param {*} [options] Override http request option.
1191
- * @throws {RequiredError}
1192
- */
1193
- cardEvent: (cardEvent_1, ...args_1) => __awaiter(this, [cardEvent_1, ...args_1], void 0, function* (cardEvent, options = {}) {
1194
- // verify required parameter 'cardEvent' is not null or undefined
1195
- assertParamExists('cardEvent', 'cardEvent', cardEvent);
1196
- const localVarPath = `/card`;
1197
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1198
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1199
- let baseOptions;
1200
- if (configuration) {
1201
- baseOptions = configuration.baseOptions;
1202
- }
1203
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1204
- const localVarHeaderParameter = {};
1205
- const localVarQueryParameter = {};
1206
- localVarHeaderParameter['Content-Type'] = 'application/json';
1207
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1208
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1209
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1210
- localVarRequestOptions.data = serializeDataIfNeeded(cardEvent, localVarRequestOptions, configuration);
1211
- return {
1212
- url: toPathString(localVarUrlObj),
1213
- options: localVarRequestOptions,
1214
- };
1215
- }),
1216
- /**
1217
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
1218
- * @summary Outgoing cardholder event webhook endpoint
1219
- * @param {CardholderEvent} cardholderEvent Cardholder event
1220
- * @param {*} [options] Override http request option.
1221
- * @throws {RequiredError}
1222
- */
1223
- cardholderEvent: (cardholderEvent_1, ...args_1) => __awaiter(this, [cardholderEvent_1, ...args_1], void 0, function* (cardholderEvent, options = {}) {
1224
- // verify required parameter 'cardholderEvent' is not null or undefined
1225
- assertParamExists('cardholderEvent', 'cardholderEvent', cardholderEvent);
1226
- const localVarPath = `/cardholder`;
1227
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1228
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1229
- let baseOptions;
1230
- if (configuration) {
1231
- baseOptions = configuration.baseOptions;
1232
- }
1233
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1234
- const localVarHeaderParameter = {};
1235
- const localVarQueryParameter = {};
1236
- localVarHeaderParameter['Content-Type'] = 'application/json';
1237
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1238
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1239
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1240
- localVarRequestOptions.data = serializeDataIfNeeded(cardholderEvent, localVarRequestOptions, configuration);
1241
- return {
1242
- url: toPathString(localVarUrlObj),
1243
- options: localVarRequestOptions,
1244
- };
1245
- }),
1246
- /**
1247
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
1248
- * @summary Outgoing token event webhook endpoint
1249
- * @param {TokenEvent} tokenEvent Token event
1250
- * @param {*} [options] Override http request option.
1251
- * @throws {RequiredError}
1252
- */
1253
- tokenEvent: (tokenEvent_1, ...args_1) => __awaiter(this, [tokenEvent_1, ...args_1], void 0, function* (tokenEvent, options = {}) {
1254
- // verify required parameter 'tokenEvent' is not null or undefined
1255
- assertParamExists('tokenEvent', 'tokenEvent', tokenEvent);
1256
- const localVarPath = `/token`;
1257
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1258
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1259
- let baseOptions;
1260
- if (configuration) {
1261
- baseOptions = configuration.baseOptions;
1262
- }
1263
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1264
- const localVarHeaderParameter = {};
1265
- const localVarQueryParameter = {};
1266
- localVarHeaderParameter['Content-Type'] = 'application/json';
1267
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1268
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1269
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1270
- localVarRequestOptions.data = serializeDataIfNeeded(tokenEvent, localVarRequestOptions, configuration);
1271
- return {
1272
- url: toPathString(localVarUrlObj),
1273
- options: localVarRequestOptions,
1274
- };
1275
- }),
1276
- };
1277
- };
1278
- /**
1279
- * IssuerEventWebhooksApi - functional programming interface
1280
- */
1281
- export const IssuerEventWebhooksApiFp = function (configuration) {
1282
- const localVarAxiosParamCreator = IssuerEventWebhooksApiAxiosParamCreator(configuration);
1283
- return {
1284
- /**
1285
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
1286
- * @summary Outgoing card event webhook endpoint
1287
- * @param {CardEvent} cardEvent Card event
1288
- * @param {*} [options] Override http request option.
1289
- * @throws {RequiredError}
1290
- */
1291
- cardEvent(cardEvent, options) {
1292
- return __awaiter(this, void 0, void 0, function* () {
1293
- var _a, _b, _c;
1294
- const localVarAxiosArgs = yield localVarAxiosParamCreator.cardEvent(cardEvent, options);
1295
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1296
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['IssuerEventWebhooksApi.cardEvent']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1297
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1298
- });
1299
- },
1300
- /**
1301
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
1302
- * @summary Outgoing cardholder event webhook endpoint
1303
- * @param {CardholderEvent} cardholderEvent Cardholder event
1304
- * @param {*} [options] Override http request option.
1305
- * @throws {RequiredError}
1306
- */
1307
- cardholderEvent(cardholderEvent, options) {
1308
- return __awaiter(this, void 0, void 0, function* () {
1309
- var _a, _b, _c;
1310
- const localVarAxiosArgs = yield localVarAxiosParamCreator.cardholderEvent(cardholderEvent, options);
1311
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1312
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['IssuerEventWebhooksApi.cardholderEvent']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1313
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1314
- });
1315
- },
1316
- /**
1317
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
1318
- * @summary Outgoing token event webhook endpoint
1319
- * @param {TokenEvent} tokenEvent Token event
1320
- * @param {*} [options] Override http request option.
1321
- * @throws {RequiredError}
1322
- */
1323
- tokenEvent(tokenEvent, options) {
1324
- return __awaiter(this, void 0, void 0, function* () {
1325
- var _a, _b, _c;
1326
- const localVarAxiosArgs = yield localVarAxiosParamCreator.tokenEvent(tokenEvent, options);
1327
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1328
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['IssuerEventWebhooksApi.tokenEvent']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1329
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1330
- });
1331
- },
1332
- };
1333
- };
1334
- /**
1335
- * IssuerEventWebhooksApi - factory interface
1336
- */
1337
- export const IssuerEventWebhooksApiFactory = function (configuration, basePath, axios) {
1338
- const localVarFp = IssuerEventWebhooksApiFp(configuration);
1339
- return {
1340
- /**
1341
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
1342
- * @summary Outgoing card event webhook endpoint
1343
- * @param {CardEvent} cardEvent Card event
1344
- * @param {*} [options] Override http request option.
1345
- * @throws {RequiredError}
1346
- */
1347
- cardEvent(cardEvent, options) {
1348
- return localVarFp.cardEvent(cardEvent, options).then((request) => request(axios, basePath));
1349
- },
1350
- /**
1351
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
1352
- * @summary Outgoing cardholder event webhook endpoint
1353
- * @param {CardholderEvent} cardholderEvent Cardholder event
1354
- * @param {*} [options] Override http request option.
1355
- * @throws {RequiredError}
1356
- */
1357
- cardholderEvent(cardholderEvent, options) {
1358
- return localVarFp.cardholderEvent(cardholderEvent, options).then((request) => request(axios, basePath));
1359
- },
1360
- /**
1361
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
1362
- * @summary Outgoing token event webhook endpoint
1363
- * @param {TokenEvent} tokenEvent Token event
1364
- * @param {*} [options] Override http request option.
1365
- * @throws {RequiredError}
1366
- */
1367
- tokenEvent(tokenEvent, options) {
1368
- return localVarFp.tokenEvent(tokenEvent, options).then((request) => request(axios, basePath));
1369
- },
1370
- };
1371
- };
1372
- /**
1373
- * IssuerEventWebhooksApi - object-oriented interface
1374
- */
1375
- export class IssuerEventWebhooksApi extends BaseAPI {
1376
- /**
1377
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
1378
- * @summary Outgoing card event webhook endpoint
1379
- * @param {CardEvent} cardEvent Card event
1380
- * @param {*} [options] Override http request option.
1381
- * @throws {RequiredError}
1382
- */
1383
- cardEvent(cardEvent, options) {
1384
- return IssuerEventWebhooksApiFp(this.configuration).cardEvent(cardEvent, options).then((request) => request(this.axios, this.basePath));
1385
- }
1386
- /**
1387
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
1388
- * @summary Outgoing cardholder event webhook endpoint
1389
- * @param {CardholderEvent} cardholderEvent Cardholder event
1390
- * @param {*} [options] Override http request option.
1391
- * @throws {RequiredError}
1392
- */
1393
- cardholderEvent(cardholderEvent, options) {
1394
- return IssuerEventWebhooksApiFp(this.configuration).cardholderEvent(cardholderEvent, options).then((request) => request(this.axios, this.basePath));
1395
- }
1396
- /**
1397
- * This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
1398
- * @summary Outgoing token event webhook endpoint
1399
- * @param {TokenEvent} tokenEvent Token event
1400
- * @param {*} [options] Override http request option.
1401
- * @throws {RequiredError}
1402
- */
1403
- tokenEvent(tokenEvent, options) {
1404
- return IssuerEventWebhooksApiFp(this.configuration).tokenEvent(tokenEvent, options).then((request) => request(this.axios, this.basePath));
1405
- }
1406
- }
@@ -11,4 +11,3 @@
11
11
  */
12
12
  export * from "./api";
13
13
  export * from "./configuration";
14
- export * from './client';
@@ -13,4 +13,3 @@
13
13
  */
14
14
  export * from "./api";
15
15
  export * from "./configuration";
16
- export * from './client';
@@ -36,3 +36,17 @@ export declare function clientCredentialsFetcher(config: OAuthConfig): TokenFetc
36
36
  export declare function clientCredentials(config: OAuthConfig, skewSeconds?: number): OAuthClientCredentialsManager;
37
37
  /** Convenience overload pairing a token URL with a {@link ClientCredentials} identity. */
38
38
  export declare function clientCredentials(tokenUrl: string, credentials: ClientCredentials, skewSeconds?: number): OAuthClientCredentialsManager;
39
+ /**
40
+ * Decodes the granted scopes from a JWT access token's `scope` (space-delimited) or `scp` (array)
41
+ * claim, sorted and de-duplicated. Returns an empty array for an empty, opaque (non-JWT), or
42
+ * undecodable token — never throws. Server-side only (uses Node's `Buffer`).
43
+ */
44
+ export declare function scopesOf(accessToken: string): string[];
45
+ /**
46
+ * Discovers the scopes the client is entitled to. Requests a `client_credentials` token with NO
47
+ * `scope` narrowing (any scopes on the config/credentials are ignored) — most authorization servers
48
+ * then grant the client's full default scope set — and returns the granted scopes decoded from the
49
+ * access token, sorted and de-duplicated. Performs a live token request; does not cache.
50
+ */
51
+ export declare function availableScopes(config: OAuthConfig): Promise<string[]>;
52
+ export declare function availableScopes(tokenUrl: string, credentials: ClientCredentials): Promise<string[]>;
@@ -73,3 +73,42 @@ export function clientCredentials(configOrUrl, credsOrSkew, skewSeconds = 60) {
73
73
  }
74
74
  return new OAuthClientCredentialsManager(clientCredentialsFetcher(config), skew);
75
75
  }
76
+ /**
77
+ * Decodes the granted scopes from a JWT access token's `scope` (space-delimited) or `scp` (array)
78
+ * claim, sorted and de-duplicated. Returns an empty array for an empty, opaque (non-JWT), or
79
+ * undecodable token — never throws. Server-side only (uses Node's `Buffer`).
80
+ */
81
+ export function scopesOf(accessToken) {
82
+ const parts = accessToken ? accessToken.split('.') : [];
83
+ if (parts.length < 2)
84
+ return [];
85
+ try {
86
+ const b64 = parts[1].replace(/-/g, '+').replace(/_/g, '/'); // base64url -> base64 ('base64' tolerates missing padding)
87
+ const payload = JSON.parse(Buffer.from(b64, 'base64').toString('utf8'));
88
+ const scopes = new Set();
89
+ if (typeof payload.scope === 'string') {
90
+ for (const s of payload.scope.trim().split(/\s+/))
91
+ if (s)
92
+ scopes.add(s);
93
+ }
94
+ if (Array.isArray(payload.scp)) {
95
+ for (const s of payload.scp)
96
+ if (typeof s === 'string')
97
+ scopes.add(s);
98
+ }
99
+ return [...scopes].sort();
100
+ }
101
+ catch (_a) {
102
+ return [];
103
+ }
104
+ }
105
+ export function availableScopes(configOrUrl, credentials) {
106
+ return __awaiter(this, void 0, void 0, function* () {
107
+ var _a;
108
+ const config = typeof configOrUrl === 'string'
109
+ ? { tokenUrl: configOrUrl, clientId: credentials.clientId, clientSecret: (_a = credentials.clientSecret) !== null && _a !== void 0 ? _a : '' }
110
+ : configOrUrl;
111
+ const token = yield clientCredentialsFetcher(Object.assign(Object.assign({}, config), { scopes: [] }))();
112
+ return scopesOf(token.accessToken);
113
+ });
114
+ }
@@ -1,3 +1,3 @@
1
1
  export { AccessToken, TokenFetcher, OAuthClientCredentialsManager } from './tokenManager';
2
- export { ClientCredentials, OAuthConfig, clientCredentials, clientCredentialsFetcher } from './clientCredentials';
2
+ export { ClientCredentials, OAuthConfig, clientCredentials, clientCredentialsFetcher, availableScopes, scopesOf, } from './clientCredentials';
3
3
  export { createOAuthAxios } from './axios';
@@ -23,5 +23,5 @@
23
23
  * Server-side only — a client secret must never ship to a browser.
24
24
  */
25
25
  export { OAuthClientCredentialsManager } from './tokenManager';
26
- export { clientCredentials, clientCredentialsFetcher } from './clientCredentials';
26
+ export { clientCredentials, clientCredentialsFetcher, availableScopes, scopesOf, } from './clientCredentials';
27
27
  export { createOAuthAxios } from './axios';
@@ -75,6 +75,22 @@ export interface SetPinRequestBody {
75
75
  */
76
76
  'zpkIndex'?: number;
77
77
  }
78
+ export interface SetPinTzpkRequestBody {
79
+ /**
80
+ * Control ID that was returned in the [Request PIN Control Access Token Endpoint](https://nextgen-docs.enfuce.com/api/cards/post-card/create-pin-control-access-token).
81
+ */
82
+ 'pinControlId': string;
83
+ /**
84
+ * RSA 2048 public key in PEM format (X.509 SubjectPublicKeyInfo). The key may contain: - new lines, - the PEM headers (\"-----BEGIN PUBLIC KEY-----\" and \"-----END PUBLIC KEY-----\") The key must not contain any spaces.
85
+ */
86
+ 'pubKey': string;
87
+ }
88
+ export interface SetTzpkResponseBody {
89
+ /**
90
+ * Base64 encoded encrypted Terminal Zone PIN Key (TZPK), encrypted with the pubKey passed as input.
91
+ */
92
+ 'tzpk': string;
93
+ }
78
94
  export interface ViewPinRequestBody {
79
95
  /**
80
96
  * Control ID that was returned in the [Request PIN Control Access Token Endpoint](https://nextgen-docs.enfuce.com/api/cards/post-card/create-pin-control-access-token).
@@ -99,6 +115,15 @@ export interface ViewPinResponseBody {
99
115
  * PINOperationsUsingPKIApi - axios parameter creator
100
116
  */
101
117
  export declare const PINOperationsUsingPKIApiAxiosParamCreator: (configuration?: Configuration) => {
118
+ /**
119
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
120
+ * @summary Generate Set/Change PIN TZPK
121
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
122
+ * @param {string} [xAuditUser] Optional audit user header
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ setPinTzpk: (setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
102
127
  /**
103
128
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
104
129
  * @summary Retrieve Encrypted PIN
@@ -113,6 +138,15 @@ export declare const PINOperationsUsingPKIApiAxiosParamCreator: (configuration?:
113
138
  * PINOperationsUsingPKIApi - functional programming interface
114
139
  */
115
140
  export declare const PINOperationsUsingPKIApiFp: (configuration?: Configuration) => {
141
+ /**
142
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
143
+ * @summary Generate Set/Change PIN TZPK
144
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
145
+ * @param {string} [xAuditUser] Optional audit user header
146
+ * @param {*} [options] Override http request option.
147
+ * @throws {RequiredError}
148
+ */
149
+ setPinTzpk(setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SetTzpkResponseBody>>;
116
150
  /**
117
151
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
118
152
  * @summary Retrieve Encrypted PIN
@@ -127,6 +161,15 @@ export declare const PINOperationsUsingPKIApiFp: (configuration?: Configuration)
127
161
  * PINOperationsUsingPKIApi - factory interface
128
162
  */
129
163
  export declare const PINOperationsUsingPKIApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
164
+ /**
165
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
166
+ * @summary Generate Set/Change PIN TZPK
167
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
168
+ * @param {string} [xAuditUser] Optional audit user header
169
+ * @param {*} [options] Override http request option.
170
+ * @throws {RequiredError}
171
+ */
172
+ setPinTzpk(setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options?: RawAxiosRequestConfig): AxiosPromise<SetTzpkResponseBody>;
130
173
  /**
131
174
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
132
175
  * @summary Retrieve Encrypted PIN
@@ -141,6 +184,15 @@ export declare const PINOperationsUsingPKIApiFactory: (configuration?: Configura
141
184
  * PINOperationsUsingPKIApi - object-oriented interface
142
185
  */
143
186
  export declare class PINOperationsUsingPKIApi extends BaseAPI {
187
+ /**
188
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
189
+ * @summary Generate Set/Change PIN TZPK
190
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
191
+ * @param {string} [xAuditUser] Optional audit user header
192
+ * @param {*} [options] Override http request option.
193
+ * @throws {RequiredError}
194
+ */
195
+ setPinTzpk(setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<SetTzpkResponseBody, any, {}>>;
144
196
  /**
145
197
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
146
198
  * @summary Retrieve Encrypted PIN
@@ -31,6 +31,44 @@ import { BASE_PATH, BaseAPI, operationServerMap } from './base';
31
31
  */
32
32
  export const PINOperationsUsingPKIApiAxiosParamCreator = function (configuration) {
33
33
  return {
34
+ /**
35
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
36
+ * @summary Generate Set/Change PIN TZPK
37
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
38
+ * @param {string} [xAuditUser] Optional audit user header
39
+ * @param {*} [options] Override http request option.
40
+ * @throws {RequiredError}
41
+ */
42
+ setPinTzpk: (setPinTzpkRequestBody_1, xAuditUser_1, ...args_1) => __awaiter(this, [setPinTzpkRequestBody_1, xAuditUser_1, ...args_1], void 0, function* (setPinTzpkRequestBody, xAuditUser, options = {}) {
43
+ // verify required parameter 'setPinTzpkRequestBody' is not null or undefined
44
+ assertParamExists('setPinTzpk', 'setPinTzpkRequestBody', setPinTzpkRequestBody);
45
+ const localVarPath = `/v1/pin/pki/set/tzpk`;
46
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
47
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
48
+ let baseOptions;
49
+ if (configuration) {
50
+ baseOptions = configuration.baseOptions;
51
+ }
52
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
53
+ const localVarHeaderParameter = {};
54
+ const localVarQueryParameter = {};
55
+ // authentication bearerAuth required
56
+ // http bearer authentication required
57
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
58
+ localVarHeaderParameter['Content-Type'] = 'application/json';
59
+ localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
60
+ if (xAuditUser != null) {
61
+ localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
62
+ }
63
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
64
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
65
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
66
+ localVarRequestOptions.data = serializeDataIfNeeded(setPinTzpkRequestBody, localVarRequestOptions, configuration);
67
+ return {
68
+ url: toPathString(localVarUrlObj),
69
+ options: localVarRequestOptions,
70
+ };
71
+ }),
34
72
  /**
35
73
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
36
74
  * @summary Retrieve Encrypted PIN
@@ -56,7 +94,7 @@ export const PINOperationsUsingPKIApiAxiosParamCreator = function (configuration
56
94
  // http bearer authentication required
57
95
  yield setBearerAuthToObject(localVarHeaderParameter, configuration);
58
96
  localVarHeaderParameter['Content-Type'] = 'application/json';
59
- localVarHeaderParameter['Accept'] = 'application/json';
97
+ localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
60
98
  if (xAuditUser != null) {
61
99
  localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
62
100
  }
@@ -77,6 +115,23 @@ export const PINOperationsUsingPKIApiAxiosParamCreator = function (configuration
77
115
  export const PINOperationsUsingPKIApiFp = function (configuration) {
78
116
  const localVarAxiosParamCreator = PINOperationsUsingPKIApiAxiosParamCreator(configuration);
79
117
  return {
118
+ /**
119
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
120
+ * @summary Generate Set/Change PIN TZPK
121
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
122
+ * @param {string} [xAuditUser] Optional audit user header
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ setPinTzpk(setPinTzpkRequestBody, xAuditUser, options) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ var _a, _b, _c;
129
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.setPinTzpk(setPinTzpkRequestBody, xAuditUser, options);
130
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
131
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PINOperationsUsingPKIApi.setPinTzpk']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
132
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
133
+ });
134
+ },
80
135
  /**
81
136
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
82
137
  * @summary Retrieve Encrypted PIN
@@ -102,6 +157,17 @@ export const PINOperationsUsingPKIApiFp = function (configuration) {
102
157
  export const PINOperationsUsingPKIApiFactory = function (configuration, basePath, axios) {
103
158
  const localVarFp = PINOperationsUsingPKIApiFp(configuration);
104
159
  return {
160
+ /**
161
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
162
+ * @summary Generate Set/Change PIN TZPK
163
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
164
+ * @param {string} [xAuditUser] Optional audit user header
165
+ * @param {*} [options] Override http request option.
166
+ * @throws {RequiredError}
167
+ */
168
+ setPinTzpk(setPinTzpkRequestBody, xAuditUser, options) {
169
+ return localVarFp.setPinTzpk(setPinTzpkRequestBody, xAuditUser, options).then((request) => request(axios, basePath));
170
+ },
105
171
  /**
106
172
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
107
173
  * @summary Retrieve Encrypted PIN
@@ -119,6 +185,17 @@ export const PINOperationsUsingPKIApiFactory = function (configuration, basePath
119
185
  * PINOperationsUsingPKIApi - object-oriented interface
120
186
  */
121
187
  export class PINOperationsUsingPKIApi extends BaseAPI {
188
+ /**
189
+ * Send a request to this endpoint to generate a temporary Terminal Zone PIN Key (TZPK) for Set PIN or Change PIN flows. The TZPK is encrypted with the provided ephemeral RSA 2048 bit public key and returned as a base64 encoded value.
190
+ * @summary Generate Set/Change PIN TZPK
191
+ * @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
192
+ * @param {string} [xAuditUser] Optional audit user header
193
+ * @param {*} [options] Override http request option.
194
+ * @throws {RequiredError}
195
+ */
196
+ setPinTzpk(setPinTzpkRequestBody, xAuditUser, options) {
197
+ return PINOperationsUsingPKIApiFp(this.configuration).setPinTzpk(setPinTzpkRequestBody, xAuditUser, options).then((request) => request(this.axios, this.basePath));
198
+ }
122
199
  /**
123
200
  * Send a request to this endpoint to retrieve the card PIN (ISO PIN Block Format 1) encrypted with temporary PIN encryption key (tzpk). The tzpk is encrypted with the provided ephemeral RSA 2048 bit public key. Steps for retrieving the ISO PIN Block Format 1: - Decrypt the tzpk with the RSA private key. Now you have the decrypted 3DES double length key. - Decrypt the PIN block with the decrypted tzpk using 3DES decryption.
124
201
  * @summary Retrieve Encrypted PIN
@@ -162,7 +239,7 @@ export const PINOperationsWithPreSharedKeyApiAxiosParamCreator = function (confi
162
239
  // http bearer authentication required
163
240
  yield setBearerAuthToObject(localVarHeaderParameter, configuration);
164
241
  localVarHeaderParameter['Content-Type'] = 'application/json';
165
- localVarHeaderParameter['Accept'] = 'application/json';
242
+ localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
166
243
  if (xIdempotencyKey != null) {
167
244
  localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
168
245
  }
@@ -204,7 +281,7 @@ export const PINOperationsWithPreSharedKeyApiAxiosParamCreator = function (confi
204
281
  // http bearer authentication required
205
282
  yield setBearerAuthToObject(localVarHeaderParameter, configuration);
206
283
  localVarHeaderParameter['Content-Type'] = 'application/json';
207
- localVarHeaderParameter['Accept'] = 'application/json';
284
+ localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
208
285
  if (xIdempotencyKey != null) {
209
286
  localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
210
287
  }
@@ -9,10 +9,6 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { Configuration } from './configuration';
13
- import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
- import type { RequestArgs } from './base';
15
- import { BaseAPI } from './base';
16
12
  export interface InitiateAuthenticationChallengeBody {
17
13
  /**
18
14
  * Unique identifier of the authentication request.
@@ -97,55 +93,3 @@ export declare const ThreeDsTransactionDeviceChannelEnum: {
97
93
  readonly RequestorInitiated: "REQUESTOR_INITIATED";
98
94
  };
99
95
  export type ThreeDsTransactionDeviceChannelEnum = typeof ThreeDsTransactionDeviceChannelEnum[keyof typeof ThreeDsTransactionDeviceChannelEnum];
100
- /**
101
- * OOBAuthenticationChallengeWebhookNotificationApi - axios parameter creator
102
- */
103
- export declare const OOBAuthenticationChallengeWebhookNotificationApiAxiosParamCreator: (configuration?: Configuration) => {
104
- /**
105
- * In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
106
- * @summary Initiate OOB Authentication Challenge
107
- * @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
108
- * @param {*} [options] Override http request option.
109
- * @throws {RequiredError}
110
- */
111
- initiateAuthenticationChallenge: (initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
112
- };
113
- /**
114
- * OOBAuthenticationChallengeWebhookNotificationApi - functional programming interface
115
- */
116
- export declare const OOBAuthenticationChallengeWebhookNotificationApiFp: (configuration?: Configuration) => {
117
- /**
118
- * In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
119
- * @summary Initiate OOB Authentication Challenge
120
- * @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
121
- * @param {*} [options] Override http request option.
122
- * @throws {RequiredError}
123
- */
124
- initiateAuthenticationChallenge(initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
125
- };
126
- /**
127
- * OOBAuthenticationChallengeWebhookNotificationApi - factory interface
128
- */
129
- export declare const OOBAuthenticationChallengeWebhookNotificationApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
130
- /**
131
- * In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
132
- * @summary Initiate OOB Authentication Challenge
133
- * @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
134
- * @param {*} [options] Override http request option.
135
- * @throws {RequiredError}
136
- */
137
- initiateAuthenticationChallenge(initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options?: RawAxiosRequestConfig): AxiosPromise<void>;
138
- };
139
- /**
140
- * OOBAuthenticationChallengeWebhookNotificationApi - object-oriented interface
141
- */
142
- export declare class OOBAuthenticationChallengeWebhookNotificationApi extends BaseAPI {
143
- /**
144
- * In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
145
- * @summary Initiate OOB Authentication Challenge
146
- * @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
147
- * @param {*} [options] Override http request option.
148
- * @throws {RequiredError}
149
- */
150
- initiateAuthenticationChallenge(initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
151
- }