@enfuce/nextgen-sdk 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +196 -27
- package/dist/authorisation-control/api.d.ts +0 -56
- package/dist/authorisation-control/api.js +1 -115
- package/dist/authorisation-control/index.d.ts +0 -1
- package/dist/authorisation-control/index.js +0 -1
- package/dist/card/api.js +12 -12
- package/dist/cardholder/api.js +5 -5
- package/dist/esm/authorisation-control/api.d.ts +0 -56
- package/dist/esm/authorisation-control/api.js +0 -110
- package/dist/esm/authorisation-control/index.d.ts +0 -1
- package/dist/esm/authorisation-control/index.js +0 -1
- package/dist/esm/card/api.js +12 -12
- package/dist/esm/cardholder/api.js +5 -5
- package/dist/esm/issuer-events/api.d.ts +0 -120
- package/dist/esm/issuer-events/api.js +0 -241
- package/dist/esm/issuer-events/index.d.ts +0 -1
- package/dist/esm/issuer-events/index.js +0 -1
- package/dist/esm/oauth/clientCredentials.d.ts +14 -0
- package/dist/esm/oauth/clientCredentials.js +39 -0
- package/dist/esm/oauth/index.d.ts +1 -1
- package/dist/esm/oauth/index.js +1 -1
- package/dist/esm/pin/api.d.ts +52 -0
- package/dist/esm/pin/api.js +80 -3
- package/dist/esm/threeds-oob/api.d.ts +0 -56
- package/dist/esm/threeds-oob/api.js +0 -112
- package/dist/esm/threeds-oob/index.d.ts +0 -1
- package/dist/esm/threeds-oob/index.js +0 -1
- package/dist/esm/wallet/api.js +12 -12
- package/dist/issuer-events/api.d.ts +0 -120
- package/dist/issuer-events/api.js +1 -246
- package/dist/issuer-events/index.d.ts +0 -1
- package/dist/issuer-events/index.js +0 -1
- package/dist/oauth/clientCredentials.d.ts +14 -0
- package/dist/oauth/clientCredentials.js +41 -0
- package/dist/oauth/index.d.ts +1 -1
- package/dist/oauth/index.js +3 -1
- package/dist/pin/api.d.ts +52 -0
- package/dist/pin/api.js +80 -3
- package/dist/threeds-oob/api.d.ts +0 -56
- package/dist/threeds-oob/api.js +1 -117
- package/dist/threeds-oob/index.d.ts +0 -1
- package/dist/threeds-oob/index.js +0 -1
- package/dist/wallet/api.js +12 -12
- package/package.json +1 -1
- package/src/authorisation-control/api.ts +0 -102
- package/src/authorisation-control/index.ts +0 -2
- package/src/card/api.ts +12 -12
- package/src/cardholder/api.ts +5 -5
- package/src/issuer-events/api.ts +0 -237
- package/src/issuer-events/index.ts +0 -2
- package/src/oauth/clientCredentials.ts +44 -0
- package/src/oauth/index.ts +8 -1
- package/src/pin/api.ts +99 -3
- package/src/threeds-oob/api.ts +0 -105
- package/src/threeds-oob/index.ts +0 -2
- package/src/wallet/api.ts +12 -12
- package/dist/authorisation-control/client.d.ts +0 -47
- package/dist/authorisation-control/client.js +0 -80
- package/dist/esm/authorisation-control/client.d.ts +0 -47
- package/dist/esm/authorisation-control/client.js +0 -75
- package/dist/esm/issuer-events/client.d.ts +0 -47
- package/dist/esm/issuer-events/client.js +0 -75
- package/dist/esm/threeds-oob/client.d.ts +0 -47
- package/dist/esm/threeds-oob/client.js +0 -75
- package/dist/issuer-events/client.d.ts +0 -47
- package/dist/issuer-events/client.js +0 -80
- package/dist/threeds-oob/client.d.ts +0 -47
- package/dist/threeds-oob/client.js +0 -80
- package/src/authorisation-control/client.ts +0 -86
- package/src/issuer-events/client.ts +0 -86
- package/src/threeds-oob/client.ts +0 -86
- package/test/authorisation-control.test.ts +0 -71
- package/test/issuer-events.test.ts +0 -55
- package/test/threeds-oob.test.ts +0 -90
|
@@ -469,105 +469,3 @@ export type TransactionType = typeof TransactionType[keyof typeof TransactionTyp
|
|
|
469
469
|
|
|
470
470
|
|
|
471
471
|
|
|
472
|
-
/**
|
|
473
|
-
* AuthorisationRequestAPIApi - axios parameter creator
|
|
474
|
-
*/
|
|
475
|
-
export const AuthorisationRequestAPIApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
476
|
-
return {
|
|
477
|
-
/**
|
|
478
|
-
* Enfuce sends an authorisation request to the issuer/ledger, when it expects an authorisation decision from the recipient.
|
|
479
|
-
* @summary Authorisation Request API
|
|
480
|
-
* @param {AuthRequestBody} authRequestBody
|
|
481
|
-
* @param {*} [options] Override http request option.
|
|
482
|
-
* @throws {RequiredError}
|
|
483
|
-
*/
|
|
484
|
-
authPost: async (authRequestBody: AuthRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
485
|
-
// verify required parameter 'authRequestBody' is not null or undefined
|
|
486
|
-
assertParamExists('authPost', 'authRequestBody', authRequestBody)
|
|
487
|
-
const localVarPath = `/auth`;
|
|
488
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
489
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
490
|
-
let baseOptions;
|
|
491
|
-
if (configuration) {
|
|
492
|
-
baseOptions = configuration.baseOptions;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
496
|
-
const localVarHeaderParameter = {} as any;
|
|
497
|
-
const localVarQueryParameter = {} as any;
|
|
498
|
-
|
|
499
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
500
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
501
|
-
|
|
502
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
503
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
504
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
505
|
-
localVarRequestOptions.data = serializeDataIfNeeded(authRequestBody, localVarRequestOptions, configuration)
|
|
506
|
-
|
|
507
|
-
return {
|
|
508
|
-
url: toPathString(localVarUrlObj),
|
|
509
|
-
options: localVarRequestOptions,
|
|
510
|
-
};
|
|
511
|
-
},
|
|
512
|
-
}
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* AuthorisationRequestAPIApi - functional programming interface
|
|
517
|
-
*/
|
|
518
|
-
export const AuthorisationRequestAPIApiFp = function(configuration?: Configuration) {
|
|
519
|
-
const localVarAxiosParamCreator = AuthorisationRequestAPIApiAxiosParamCreator(configuration)
|
|
520
|
-
return {
|
|
521
|
-
/**
|
|
522
|
-
* Enfuce sends an authorisation request to the issuer/ledger, when it expects an authorisation decision from the recipient.
|
|
523
|
-
* @summary Authorisation Request API
|
|
524
|
-
* @param {AuthRequestBody} authRequestBody
|
|
525
|
-
* @param {*} [options] Override http request option.
|
|
526
|
-
* @throws {RequiredError}
|
|
527
|
-
*/
|
|
528
|
-
async authPost(authRequestBody: AuthRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthResponseBody>> {
|
|
529
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.authPost(authRequestBody, options);
|
|
530
|
-
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
531
|
-
const localVarOperationServerBasePath = operationServerMap['AuthorisationRequestAPIApi.authPost']?.[localVarOperationServerIndex]?.url;
|
|
532
|
-
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
533
|
-
},
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
/**
|
|
538
|
-
* AuthorisationRequestAPIApi - factory interface
|
|
539
|
-
*/
|
|
540
|
-
export const AuthorisationRequestAPIApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
541
|
-
const localVarFp = AuthorisationRequestAPIApiFp(configuration)
|
|
542
|
-
return {
|
|
543
|
-
/**
|
|
544
|
-
* Enfuce sends an authorisation request to the issuer/ledger, when it expects an authorisation decision from the recipient.
|
|
545
|
-
* @summary Authorisation Request API
|
|
546
|
-
* @param {AuthRequestBody} authRequestBody
|
|
547
|
-
* @param {*} [options] Override http request option.
|
|
548
|
-
* @throws {RequiredError}
|
|
549
|
-
*/
|
|
550
|
-
authPost(authRequestBody: AuthRequestBody, options?: RawAxiosRequestConfig): AxiosPromise<AuthResponseBody> {
|
|
551
|
-
return localVarFp.authPost(authRequestBody, options).then((request) => request(axios, basePath));
|
|
552
|
-
},
|
|
553
|
-
};
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* AuthorisationRequestAPIApi - object-oriented interface
|
|
558
|
-
*/
|
|
559
|
-
export class AuthorisationRequestAPIApi extends BaseAPI {
|
|
560
|
-
/**
|
|
561
|
-
* Enfuce sends an authorisation request to the issuer/ledger, when it expects an authorisation decision from the recipient.
|
|
562
|
-
* @summary Authorisation Request API
|
|
563
|
-
* @param {AuthRequestBody} authRequestBody
|
|
564
|
-
* @param {*} [options] Override http request option.
|
|
565
|
-
* @throws {RequiredError}
|
|
566
|
-
*/
|
|
567
|
-
public authPost(authRequestBody: AuthRequestBody, options?: RawAxiosRequestConfig) {
|
|
568
|
-
return AuthorisationRequestAPIApiFp(this.configuration).authPost(authRequestBody, options).then((request) => request(this.axios, this.basePath));
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
package/src/card/api.ts
CHANGED
|
@@ -891,7 +891,7 @@ export const CreateCardApiAxiosParamCreator = function (configuration?: Configur
|
|
|
891
891
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
892
892
|
|
|
893
893
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
894
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
894
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
895
895
|
|
|
896
896
|
if (xAuditUser != null) {
|
|
897
897
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1014,7 +1014,7 @@ export const CreatePINControlAccessTokenApiAxiosParamCreator = function (configu
|
|
|
1014
1014
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1015
1015
|
|
|
1016
1016
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1017
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1017
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1018
1018
|
|
|
1019
1019
|
if (xAuditUser != null) {
|
|
1020
1020
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1130,7 +1130,7 @@ export const GetCardApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
1130
1130
|
// http bearer authentication required
|
|
1131
1131
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1132
1132
|
|
|
1133
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1133
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1134
1134
|
|
|
1135
1135
|
if (xAuditUser != null) {
|
|
1136
1136
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1174,7 +1174,7 @@ export const GetCardApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
1174
1174
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1175
1175
|
|
|
1176
1176
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1177
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1177
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1178
1178
|
|
|
1179
1179
|
if (xAuditUser != null) {
|
|
1180
1180
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1220,7 +1220,7 @@ export const GetCardApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
1220
1220
|
localVarQueryParameter['mainCardId'] = mainCardId;
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1223
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1224
1224
|
|
|
1225
1225
|
if (xAuditUser != null) {
|
|
1226
1226
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1413,7 +1413,7 @@ export const GetCardPaymentInfoApiAxiosParamCreator = function (configuration?:
|
|
|
1413
1413
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1414
1414
|
|
|
1415
1415
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1416
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1416
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1417
1417
|
|
|
1418
1418
|
if (xAuditUser != null) {
|
|
1419
1419
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1529,7 +1529,7 @@ export const GetPlasticManufacturingHistoryApiAxiosParamCreator = function (conf
|
|
|
1529
1529
|
// http bearer authentication required
|
|
1530
1530
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1531
1531
|
|
|
1532
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1532
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1533
1533
|
|
|
1534
1534
|
if (xAuditUser != null) {
|
|
1535
1535
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1642,7 +1642,7 @@ export const UpdateCardApiAxiosParamCreator = function (configuration?: Configur
|
|
|
1642
1642
|
// http bearer authentication required
|
|
1643
1643
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1644
1644
|
|
|
1645
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1645
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1646
1646
|
|
|
1647
1647
|
if (xIdempotencyKey != null) {
|
|
1648
1648
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -1691,7 +1691,7 @@ export const UpdateCardApiAxiosParamCreator = function (configuration?: Configur
|
|
|
1691
1691
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1692
1692
|
|
|
1693
1693
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1694
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1694
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1695
1695
|
|
|
1696
1696
|
if (xAuditUser != null) {
|
|
1697
1697
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1737,7 +1737,7 @@ export const UpdateCardApiAxiosParamCreator = function (configuration?: Configur
|
|
|
1737
1737
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1738
1738
|
|
|
1739
1739
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1740
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1740
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1741
1741
|
|
|
1742
1742
|
if (xIdempotencyKey != null) {
|
|
1743
1743
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -1784,7 +1784,7 @@ export const UpdateCardApiAxiosParamCreator = function (configuration?: Configur
|
|
|
1784
1784
|
// http bearer authentication required
|
|
1785
1785
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1786
1786
|
|
|
1787
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1787
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1788
1788
|
|
|
1789
1789
|
if (xIdempotencyKey != null) {
|
|
1790
1790
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -1832,7 +1832,7 @@ export const UpdateCardApiAxiosParamCreator = function (configuration?: Configur
|
|
|
1832
1832
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1833
1833
|
|
|
1834
1834
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1835
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1835
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1836
1836
|
|
|
1837
1837
|
if (xIdempotencyKey != null) {
|
|
1838
1838
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
package/src/cardholder/api.ts
CHANGED
|
@@ -1987,7 +1987,7 @@ export const CreateCardholderApiAxiosParamCreator = function (configuration?: Co
|
|
|
1987
1987
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1988
1988
|
|
|
1989
1989
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1990
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1990
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1991
1991
|
|
|
1992
1992
|
if (xIdempotencyKey != null) {
|
|
1993
1993
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -2106,7 +2106,7 @@ export const GetCardholderApiAxiosParamCreator = function (configuration?: Confi
|
|
|
2106
2106
|
// http bearer authentication required
|
|
2107
2107
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2108
2108
|
|
|
2109
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2109
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
2110
2110
|
|
|
2111
2111
|
if (xAuditUser != null) {
|
|
2112
2112
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -2151,7 +2151,7 @@ export const GetCardholderApiAxiosParamCreator = function (configuration?: Confi
|
|
|
2151
2151
|
localVarQueryParameter['customerNumber'] = customerNumber;
|
|
2152
2152
|
}
|
|
2153
2153
|
|
|
2154
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2154
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
2155
2155
|
|
|
2156
2156
|
if (xAuditUser != null) {
|
|
2157
2157
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -2310,7 +2310,7 @@ export const GetCardsByCardholderIdApiAxiosParamCreator = function (configuratio
|
|
|
2310
2310
|
localVarQueryParameter['size'] = size;
|
|
2311
2311
|
}
|
|
2312
2312
|
|
|
2313
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2313
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
2314
2314
|
|
|
2315
2315
|
if (xAuditUser != null) {
|
|
2316
2316
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -2432,7 +2432,7 @@ export const UpdateCardholderApiAxiosParamCreator = function (configuration?: Co
|
|
|
2432
2432
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2433
2433
|
|
|
2434
2434
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
2435
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2435
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
2436
2436
|
|
|
2437
2437
|
if (xAuditUser != null) {
|
|
2438
2438
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
package/src/issuer-events/api.ts
CHANGED
|
@@ -1720,240 +1720,3 @@ export type TokenStatus = typeof TokenStatus[keyof typeof TokenStatus];
|
|
|
1720
1720
|
|
|
1721
1721
|
|
|
1722
1722
|
|
|
1723
|
-
/**
|
|
1724
|
-
* IssuerEventWebhooksApi - axios parameter creator
|
|
1725
|
-
*/
|
|
1726
|
-
export const IssuerEventWebhooksApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
1727
|
-
return {
|
|
1728
|
-
/**
|
|
1729
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
|
|
1730
|
-
* @summary Outgoing card event webhook endpoint
|
|
1731
|
-
* @param {CardEvent} cardEvent Card event
|
|
1732
|
-
* @param {*} [options] Override http request option.
|
|
1733
|
-
* @throws {RequiredError}
|
|
1734
|
-
*/
|
|
1735
|
-
cardEvent: async (cardEvent: CardEvent, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
1736
|
-
// verify required parameter 'cardEvent' is not null or undefined
|
|
1737
|
-
assertParamExists('cardEvent', 'cardEvent', cardEvent)
|
|
1738
|
-
const localVarPath = `/card`;
|
|
1739
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1740
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1741
|
-
let baseOptions;
|
|
1742
|
-
if (configuration) {
|
|
1743
|
-
baseOptions = configuration.baseOptions;
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
1747
|
-
const localVarHeaderParameter = {} as any;
|
|
1748
|
-
const localVarQueryParameter = {} as any;
|
|
1749
|
-
|
|
1750
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1751
|
-
|
|
1752
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1753
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1754
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
1755
|
-
localVarRequestOptions.data = serializeDataIfNeeded(cardEvent, localVarRequestOptions, configuration)
|
|
1756
|
-
|
|
1757
|
-
return {
|
|
1758
|
-
url: toPathString(localVarUrlObj),
|
|
1759
|
-
options: localVarRequestOptions,
|
|
1760
|
-
};
|
|
1761
|
-
},
|
|
1762
|
-
/**
|
|
1763
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
|
|
1764
|
-
* @summary Outgoing cardholder event webhook endpoint
|
|
1765
|
-
* @param {CardholderEvent} cardholderEvent Cardholder event
|
|
1766
|
-
* @param {*} [options] Override http request option.
|
|
1767
|
-
* @throws {RequiredError}
|
|
1768
|
-
*/
|
|
1769
|
-
cardholderEvent: async (cardholderEvent: CardholderEvent, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
1770
|
-
// verify required parameter 'cardholderEvent' is not null or undefined
|
|
1771
|
-
assertParamExists('cardholderEvent', 'cardholderEvent', cardholderEvent)
|
|
1772
|
-
const localVarPath = `/cardholder`;
|
|
1773
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1774
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1775
|
-
let baseOptions;
|
|
1776
|
-
if (configuration) {
|
|
1777
|
-
baseOptions = configuration.baseOptions;
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
1781
|
-
const localVarHeaderParameter = {} as any;
|
|
1782
|
-
const localVarQueryParameter = {} as any;
|
|
1783
|
-
|
|
1784
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1785
|
-
|
|
1786
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1787
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1788
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
1789
|
-
localVarRequestOptions.data = serializeDataIfNeeded(cardholderEvent, localVarRequestOptions, configuration)
|
|
1790
|
-
|
|
1791
|
-
return {
|
|
1792
|
-
url: toPathString(localVarUrlObj),
|
|
1793
|
-
options: localVarRequestOptions,
|
|
1794
|
-
};
|
|
1795
|
-
},
|
|
1796
|
-
/**
|
|
1797
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
|
|
1798
|
-
* @summary Outgoing token event webhook endpoint
|
|
1799
|
-
* @param {TokenEvent} tokenEvent Token event
|
|
1800
|
-
* @param {*} [options] Override http request option.
|
|
1801
|
-
* @throws {RequiredError}
|
|
1802
|
-
*/
|
|
1803
|
-
tokenEvent: async (tokenEvent: TokenEvent, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
1804
|
-
// verify required parameter 'tokenEvent' is not null or undefined
|
|
1805
|
-
assertParamExists('tokenEvent', 'tokenEvent', tokenEvent)
|
|
1806
|
-
const localVarPath = `/token`;
|
|
1807
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1808
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1809
|
-
let baseOptions;
|
|
1810
|
-
if (configuration) {
|
|
1811
|
-
baseOptions = configuration.baseOptions;
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
1815
|
-
const localVarHeaderParameter = {} as any;
|
|
1816
|
-
const localVarQueryParameter = {} as any;
|
|
1817
|
-
|
|
1818
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1819
|
-
|
|
1820
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1821
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1822
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
1823
|
-
localVarRequestOptions.data = serializeDataIfNeeded(tokenEvent, localVarRequestOptions, configuration)
|
|
1824
|
-
|
|
1825
|
-
return {
|
|
1826
|
-
url: toPathString(localVarUrlObj),
|
|
1827
|
-
options: localVarRequestOptions,
|
|
1828
|
-
};
|
|
1829
|
-
},
|
|
1830
|
-
}
|
|
1831
|
-
};
|
|
1832
|
-
|
|
1833
|
-
/**
|
|
1834
|
-
* IssuerEventWebhooksApi - functional programming interface
|
|
1835
|
-
*/
|
|
1836
|
-
export const IssuerEventWebhooksApiFp = function(configuration?: Configuration) {
|
|
1837
|
-
const localVarAxiosParamCreator = IssuerEventWebhooksApiAxiosParamCreator(configuration)
|
|
1838
|
-
return {
|
|
1839
|
-
/**
|
|
1840
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
|
|
1841
|
-
* @summary Outgoing card event webhook endpoint
|
|
1842
|
-
* @param {CardEvent} cardEvent Card event
|
|
1843
|
-
* @param {*} [options] Override http request option.
|
|
1844
|
-
* @throws {RequiredError}
|
|
1845
|
-
*/
|
|
1846
|
-
async cardEvent(cardEvent: CardEvent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
1847
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.cardEvent(cardEvent, options);
|
|
1848
|
-
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1849
|
-
const localVarOperationServerBasePath = operationServerMap['IssuerEventWebhooksApi.cardEvent']?.[localVarOperationServerIndex]?.url;
|
|
1850
|
-
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1851
|
-
},
|
|
1852
|
-
/**
|
|
1853
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
|
|
1854
|
-
* @summary Outgoing cardholder event webhook endpoint
|
|
1855
|
-
* @param {CardholderEvent} cardholderEvent Cardholder event
|
|
1856
|
-
* @param {*} [options] Override http request option.
|
|
1857
|
-
* @throws {RequiredError}
|
|
1858
|
-
*/
|
|
1859
|
-
async cardholderEvent(cardholderEvent: CardholderEvent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
1860
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.cardholderEvent(cardholderEvent, options);
|
|
1861
|
-
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1862
|
-
const localVarOperationServerBasePath = operationServerMap['IssuerEventWebhooksApi.cardholderEvent']?.[localVarOperationServerIndex]?.url;
|
|
1863
|
-
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1864
|
-
},
|
|
1865
|
-
/**
|
|
1866
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
|
|
1867
|
-
* @summary Outgoing token event webhook endpoint
|
|
1868
|
-
* @param {TokenEvent} tokenEvent Token event
|
|
1869
|
-
* @param {*} [options] Override http request option.
|
|
1870
|
-
* @throws {RequiredError}
|
|
1871
|
-
*/
|
|
1872
|
-
async tokenEvent(tokenEvent: TokenEvent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
1873
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.tokenEvent(tokenEvent, options);
|
|
1874
|
-
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1875
|
-
const localVarOperationServerBasePath = operationServerMap['IssuerEventWebhooksApi.tokenEvent']?.[localVarOperationServerIndex]?.url;
|
|
1876
|
-
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1877
|
-
},
|
|
1878
|
-
}
|
|
1879
|
-
};
|
|
1880
|
-
|
|
1881
|
-
/**
|
|
1882
|
-
* IssuerEventWebhooksApi - factory interface
|
|
1883
|
-
*/
|
|
1884
|
-
export const IssuerEventWebhooksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
1885
|
-
const localVarFp = IssuerEventWebhooksApiFp(configuration)
|
|
1886
|
-
return {
|
|
1887
|
-
/**
|
|
1888
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
|
|
1889
|
-
* @summary Outgoing card event webhook endpoint
|
|
1890
|
-
* @param {CardEvent} cardEvent Card event
|
|
1891
|
-
* @param {*} [options] Override http request option.
|
|
1892
|
-
* @throws {RequiredError}
|
|
1893
|
-
*/
|
|
1894
|
-
cardEvent(cardEvent: CardEvent, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
1895
|
-
return localVarFp.cardEvent(cardEvent, options).then((request) => request(axios, basePath));
|
|
1896
|
-
},
|
|
1897
|
-
/**
|
|
1898
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
|
|
1899
|
-
* @summary Outgoing cardholder event webhook endpoint
|
|
1900
|
-
* @param {CardholderEvent} cardholderEvent Cardholder event
|
|
1901
|
-
* @param {*} [options] Override http request option.
|
|
1902
|
-
* @throws {RequiredError}
|
|
1903
|
-
*/
|
|
1904
|
-
cardholderEvent(cardholderEvent: CardholderEvent, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
1905
|
-
return localVarFp.cardholderEvent(cardholderEvent, options).then((request) => request(axios, basePath));
|
|
1906
|
-
},
|
|
1907
|
-
/**
|
|
1908
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
|
|
1909
|
-
* @summary Outgoing token event webhook endpoint
|
|
1910
|
-
* @param {TokenEvent} tokenEvent Token event
|
|
1911
|
-
* @param {*} [options] Override http request option.
|
|
1912
|
-
* @throws {RequiredError}
|
|
1913
|
-
*/
|
|
1914
|
-
tokenEvent(tokenEvent: TokenEvent, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
1915
|
-
return localVarFp.tokenEvent(tokenEvent, options).then((request) => request(axios, basePath));
|
|
1916
|
-
},
|
|
1917
|
-
};
|
|
1918
|
-
};
|
|
1919
|
-
|
|
1920
|
-
/**
|
|
1921
|
-
* IssuerEventWebhooksApi - object-oriented interface
|
|
1922
|
-
*/
|
|
1923
|
-
export class IssuerEventWebhooksApi extends BaseAPI {
|
|
1924
|
-
/**
|
|
1925
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.
|
|
1926
|
-
* @summary Outgoing card event webhook endpoint
|
|
1927
|
-
* @param {CardEvent} cardEvent Card event
|
|
1928
|
-
* @param {*} [options] Override http request option.
|
|
1929
|
-
* @throws {RequiredError}
|
|
1930
|
-
*/
|
|
1931
|
-
public cardEvent(cardEvent: CardEvent, options?: RawAxiosRequestConfig) {
|
|
1932
|
-
return IssuerEventWebhooksApiFp(this.configuration).cardEvent(cardEvent, options).then((request) => request(this.axios, this.basePath));
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
/**
|
|
1936
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon cardholder creation or update.
|
|
1937
|
-
* @summary Outgoing cardholder event webhook endpoint
|
|
1938
|
-
* @param {CardholderEvent} cardholderEvent Cardholder event
|
|
1939
|
-
* @param {*} [options] Override http request option.
|
|
1940
|
-
* @throws {RequiredError}
|
|
1941
|
-
*/
|
|
1942
|
-
public cardholderEvent(cardholderEvent: CardholderEvent, options?: RawAxiosRequestConfig) {
|
|
1943
|
-
return IssuerEventWebhooksApiFp(this.configuration).cardholderEvent(cardholderEvent, options).then((request) => request(this.axios, this.basePath));
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
/**
|
|
1947
|
-
* This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon token creation or update.
|
|
1948
|
-
* @summary Outgoing token event webhook endpoint
|
|
1949
|
-
* @param {TokenEvent} tokenEvent Token event
|
|
1950
|
-
* @param {*} [options] Override http request option.
|
|
1951
|
-
* @throws {RequiredError}
|
|
1952
|
-
*/
|
|
1953
|
-
public tokenEvent(tokenEvent: TokenEvent, options?: RawAxiosRequestConfig) {
|
|
1954
|
-
return IssuerEventWebhooksApiFp(this.configuration).tokenEvent(tokenEvent, options).then((request) => request(this.axios, this.basePath));
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
@@ -109,3 +109,47 @@ export function clientCredentials(
|
|
|
109
109
|
}
|
|
110
110
|
return new OAuthClientCredentialsManager(clientCredentialsFetcher(config), skew);
|
|
111
111
|
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Decodes the granted scopes from a JWT access token's `scope` (space-delimited) or `scp` (array)
|
|
115
|
+
* claim, sorted and de-duplicated. Returns an empty array for an empty, opaque (non-JWT), or
|
|
116
|
+
* undecodable token — never throws. Server-side only (uses Node's `Buffer`).
|
|
117
|
+
*/
|
|
118
|
+
export function scopesOf(accessToken: string): string[] {
|
|
119
|
+
const parts = accessToken ? accessToken.split('.') : [];
|
|
120
|
+
if (parts.length < 2) return [];
|
|
121
|
+
try {
|
|
122
|
+
const b64 = parts[1].replace(/-/g, '+').replace(/_/g, '/'); // base64url -> base64 ('base64' tolerates missing padding)
|
|
123
|
+
const payload = JSON.parse(Buffer.from(b64, 'base64').toString('utf8'));
|
|
124
|
+
const scopes = new Set<string>();
|
|
125
|
+
if (typeof payload.scope === 'string') {
|
|
126
|
+
for (const s of payload.scope.trim().split(/\s+/)) if (s) scopes.add(s);
|
|
127
|
+
}
|
|
128
|
+
if (Array.isArray(payload.scp)) {
|
|
129
|
+
for (const s of payload.scp) if (typeof s === 'string') scopes.add(s);
|
|
130
|
+
}
|
|
131
|
+
return [...scopes].sort();
|
|
132
|
+
} catch {
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Discovers the scopes the client is entitled to. Requests a `client_credentials` token with NO
|
|
139
|
+
* `scope` narrowing (any scopes on the config/credentials are ignored) — most authorization servers
|
|
140
|
+
* then grant the client's full default scope set — and returns the granted scopes decoded from the
|
|
141
|
+
* access token, sorted and de-duplicated. Performs a live token request; does not cache.
|
|
142
|
+
*/
|
|
143
|
+
export function availableScopes(config: OAuthConfig): Promise<string[]>;
|
|
144
|
+
export function availableScopes(tokenUrl: string, credentials: ClientCredentials): Promise<string[]>;
|
|
145
|
+
export async function availableScopes(
|
|
146
|
+
configOrUrl: OAuthConfig | string,
|
|
147
|
+
credentials?: ClientCredentials,
|
|
148
|
+
): Promise<string[]> {
|
|
149
|
+
const config: OAuthConfig =
|
|
150
|
+
typeof configOrUrl === 'string'
|
|
151
|
+
? { tokenUrl: configOrUrl, clientId: credentials!.clientId, clientSecret: credentials!.clientSecret ?? '' }
|
|
152
|
+
: configOrUrl;
|
|
153
|
+
const token = await clientCredentialsFetcher({ ...config, scopes: [] })();
|
|
154
|
+
return scopesOf(token.accessToken);
|
|
155
|
+
}
|
package/src/oauth/index.ts
CHANGED
|
@@ -23,5 +23,12 @@
|
|
|
23
23
|
* Server-side only — a client secret must never ship to a browser.
|
|
24
24
|
*/
|
|
25
25
|
export { AccessToken, TokenFetcher, OAuthClientCredentialsManager } from './tokenManager';
|
|
26
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
ClientCredentials,
|
|
28
|
+
OAuthConfig,
|
|
29
|
+
clientCredentials,
|
|
30
|
+
clientCredentialsFetcher,
|
|
31
|
+
availableScopes,
|
|
32
|
+
scopesOf,
|
|
33
|
+
} from './clientCredentials';
|
|
27
34
|
export { createOAuthAxios } from './axios';
|