@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
package/src/pin/api.ts
CHANGED
|
@@ -85,6 +85,22 @@ export interface SetPinRequestBody {
|
|
|
85
85
|
*/
|
|
86
86
|
'zpkIndex'?: number;
|
|
87
87
|
}
|
|
88
|
+
export interface SetPinTzpkRequestBody {
|
|
89
|
+
/**
|
|
90
|
+
* 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).
|
|
91
|
+
*/
|
|
92
|
+
'pinControlId': string;
|
|
93
|
+
/**
|
|
94
|
+
* 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.
|
|
95
|
+
*/
|
|
96
|
+
'pubKey': string;
|
|
97
|
+
}
|
|
98
|
+
export interface SetTzpkResponseBody {
|
|
99
|
+
/**
|
|
100
|
+
* Base64 encoded encrypted Terminal Zone PIN Key (TZPK), encrypted with the pubKey passed as input.
|
|
101
|
+
*/
|
|
102
|
+
'tzpk': string;
|
|
103
|
+
}
|
|
88
104
|
export interface ViewPinRequestBody {
|
|
89
105
|
/**
|
|
90
106
|
* 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).
|
|
@@ -111,6 +127,49 @@ export interface ViewPinResponseBody {
|
|
|
111
127
|
*/
|
|
112
128
|
export const PINOperationsUsingPKIApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
113
129
|
return {
|
|
130
|
+
/**
|
|
131
|
+
* 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.
|
|
132
|
+
* @summary Generate Set/Change PIN TZPK
|
|
133
|
+
* @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
|
|
134
|
+
* @param {string} [xAuditUser] Optional audit user header
|
|
135
|
+
* @param {*} [options] Override http request option.
|
|
136
|
+
* @throws {RequiredError}
|
|
137
|
+
*/
|
|
138
|
+
setPinTzpk: async (setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
139
|
+
// verify required parameter 'setPinTzpkRequestBody' is not null or undefined
|
|
140
|
+
assertParamExists('setPinTzpk', 'setPinTzpkRequestBody', setPinTzpkRequestBody)
|
|
141
|
+
const localVarPath = `/v1/pin/pki/set/tzpk`;
|
|
142
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
143
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
144
|
+
let baseOptions;
|
|
145
|
+
if (configuration) {
|
|
146
|
+
baseOptions = configuration.baseOptions;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
150
|
+
const localVarHeaderParameter = {} as any;
|
|
151
|
+
const localVarQueryParameter = {} as any;
|
|
152
|
+
|
|
153
|
+
// authentication bearerAuth required
|
|
154
|
+
// http bearer authentication required
|
|
155
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
156
|
+
|
|
157
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
158
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
159
|
+
|
|
160
|
+
if (xAuditUser != null) {
|
|
161
|
+
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
162
|
+
}
|
|
163
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
164
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
165
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
166
|
+
localVarRequestOptions.data = serializeDataIfNeeded(setPinTzpkRequestBody, localVarRequestOptions, configuration)
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
url: toPathString(localVarUrlObj),
|
|
170
|
+
options: localVarRequestOptions,
|
|
171
|
+
};
|
|
172
|
+
},
|
|
114
173
|
/**
|
|
115
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.
|
|
116
175
|
* @summary Retrieve Encrypted PIN
|
|
@@ -139,7 +198,7 @@ export const PINOperationsUsingPKIApiAxiosParamCreator = function (configuration
|
|
|
139
198
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
140
199
|
|
|
141
200
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
142
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
201
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
143
202
|
|
|
144
203
|
if (xAuditUser != null) {
|
|
145
204
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -163,6 +222,20 @@ export const PINOperationsUsingPKIApiAxiosParamCreator = function (configuration
|
|
|
163
222
|
export const PINOperationsUsingPKIApiFp = function(configuration?: Configuration) {
|
|
164
223
|
const localVarAxiosParamCreator = PINOperationsUsingPKIApiAxiosParamCreator(configuration)
|
|
165
224
|
return {
|
|
225
|
+
/**
|
|
226
|
+
* 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.
|
|
227
|
+
* @summary Generate Set/Change PIN TZPK
|
|
228
|
+
* @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
|
|
229
|
+
* @param {string} [xAuditUser] Optional audit user header
|
|
230
|
+
* @param {*} [options] Override http request option.
|
|
231
|
+
* @throws {RequiredError}
|
|
232
|
+
*/
|
|
233
|
+
async setPinTzpk(setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SetTzpkResponseBody>> {
|
|
234
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.setPinTzpk(setPinTzpkRequestBody, xAuditUser, options);
|
|
235
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
236
|
+
const localVarOperationServerBasePath = operationServerMap['PINOperationsUsingPKIApi.setPinTzpk']?.[localVarOperationServerIndex]?.url;
|
|
237
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
238
|
+
},
|
|
166
239
|
/**
|
|
167
240
|
* 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.
|
|
168
241
|
* @summary Retrieve Encrypted PIN
|
|
@@ -186,6 +259,17 @@ export const PINOperationsUsingPKIApiFp = function(configuration?: Configuration
|
|
|
186
259
|
export const PINOperationsUsingPKIApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
187
260
|
const localVarFp = PINOperationsUsingPKIApiFp(configuration)
|
|
188
261
|
return {
|
|
262
|
+
/**
|
|
263
|
+
* 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.
|
|
264
|
+
* @summary Generate Set/Change PIN TZPK
|
|
265
|
+
* @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
|
|
266
|
+
* @param {string} [xAuditUser] Optional audit user header
|
|
267
|
+
* @param {*} [options] Override http request option.
|
|
268
|
+
* @throws {RequiredError}
|
|
269
|
+
*/
|
|
270
|
+
setPinTzpk(setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options?: RawAxiosRequestConfig): AxiosPromise<SetTzpkResponseBody> {
|
|
271
|
+
return localVarFp.setPinTzpk(setPinTzpkRequestBody, xAuditUser, options).then((request) => request(axios, basePath));
|
|
272
|
+
},
|
|
189
273
|
/**
|
|
190
274
|
* 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.
|
|
191
275
|
* @summary Retrieve Encrypted PIN
|
|
@@ -204,6 +288,18 @@ export const PINOperationsUsingPKIApiFactory = function (configuration?: Configu
|
|
|
204
288
|
* PINOperationsUsingPKIApi - object-oriented interface
|
|
205
289
|
*/
|
|
206
290
|
export class PINOperationsUsingPKIApi extends BaseAPI {
|
|
291
|
+
/**
|
|
292
|
+
* 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.
|
|
293
|
+
* @summary Generate Set/Change PIN TZPK
|
|
294
|
+
* @param {SetPinTzpkRequestBody} setPinTzpkRequestBody Request payload for generating a temporary PIN encryption key.
|
|
295
|
+
* @param {string} [xAuditUser] Optional audit user header
|
|
296
|
+
* @param {*} [options] Override http request option.
|
|
297
|
+
* @throws {RequiredError}
|
|
298
|
+
*/
|
|
299
|
+
public setPinTzpk(setPinTzpkRequestBody: SetPinTzpkRequestBody, xAuditUser?: string, options?: RawAxiosRequestConfig) {
|
|
300
|
+
return PINOperationsUsingPKIApiFp(this.configuration).setPinTzpk(setPinTzpkRequestBody, xAuditUser, options).then((request) => request(this.axios, this.basePath));
|
|
301
|
+
}
|
|
302
|
+
|
|
207
303
|
/**
|
|
208
304
|
* 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.
|
|
209
305
|
* @summary Retrieve Encrypted PIN
|
|
@@ -253,7 +349,7 @@ export const PINOperationsWithPreSharedKeyApiAxiosParamCreator = function (confi
|
|
|
253
349
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
254
350
|
|
|
255
351
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
256
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
352
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
257
353
|
|
|
258
354
|
if (xIdempotencyKey != null) {
|
|
259
355
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -300,7 +396,7 @@ export const PINOperationsWithPreSharedKeyApiAxiosParamCreator = function (confi
|
|
|
300
396
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
301
397
|
|
|
302
398
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
303
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
399
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
304
400
|
|
|
305
401
|
if (xIdempotencyKey != null) {
|
|
306
402
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
package/src/threeds-oob/api.ts
CHANGED
|
@@ -112,108 +112,3 @@ export const ThreeDsTransactionDeviceChannelEnum = {
|
|
|
112
112
|
export type ThreeDsTransactionDeviceChannelEnum = typeof ThreeDsTransactionDeviceChannelEnum[keyof typeof ThreeDsTransactionDeviceChannelEnum];
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
/**
|
|
116
|
-
* OOBAuthenticationChallengeWebhookNotificationApi - axios parameter creator
|
|
117
|
-
*/
|
|
118
|
-
export const OOBAuthenticationChallengeWebhookNotificationApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
119
|
-
return {
|
|
120
|
-
/**
|
|
121
|
-
* In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
|
|
122
|
-
* @summary Initiate OOB Authentication Challenge
|
|
123
|
-
* @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
|
|
124
|
-
* @param {*} [options] Override http request option.
|
|
125
|
-
* @throws {RequiredError}
|
|
126
|
-
*/
|
|
127
|
-
initiateAuthenticationChallenge: async (initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
128
|
-
// verify required parameter 'initiateAuthenticationChallengeBody' is not null or undefined
|
|
129
|
-
assertParamExists('initiateAuthenticationChallenge', 'initiateAuthenticationChallengeBody', initiateAuthenticationChallengeBody)
|
|
130
|
-
const localVarPath = `/v1/3ds/oob/challenge/initiate`;
|
|
131
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
132
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
133
|
-
let baseOptions;
|
|
134
|
-
if (configuration) {
|
|
135
|
-
baseOptions = configuration.baseOptions;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
139
|
-
const localVarHeaderParameter = {} as any;
|
|
140
|
-
const localVarQueryParameter = {} as any;
|
|
141
|
-
|
|
142
|
-
// authentication basicAuth required
|
|
143
|
-
// http basic authentication required
|
|
144
|
-
setBasicAuthToObject(localVarRequestOptions, configuration)
|
|
145
|
-
|
|
146
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
147
|
-
|
|
148
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
149
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
150
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
151
|
-
localVarRequestOptions.data = serializeDataIfNeeded(initiateAuthenticationChallengeBody, localVarRequestOptions, configuration)
|
|
152
|
-
|
|
153
|
-
return {
|
|
154
|
-
url: toPathString(localVarUrlObj),
|
|
155
|
-
options: localVarRequestOptions,
|
|
156
|
-
};
|
|
157
|
-
},
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* OOBAuthenticationChallengeWebhookNotificationApi - functional programming interface
|
|
163
|
-
*/
|
|
164
|
-
export const OOBAuthenticationChallengeWebhookNotificationApiFp = function(configuration?: Configuration) {
|
|
165
|
-
const localVarAxiosParamCreator = OOBAuthenticationChallengeWebhookNotificationApiAxiosParamCreator(configuration)
|
|
166
|
-
return {
|
|
167
|
-
/**
|
|
168
|
-
* In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
|
|
169
|
-
* @summary Initiate OOB Authentication Challenge
|
|
170
|
-
* @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
|
|
171
|
-
* @param {*} [options] Override http request option.
|
|
172
|
-
* @throws {RequiredError}
|
|
173
|
-
*/
|
|
174
|
-
async initiateAuthenticationChallenge(initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
175
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.initiateAuthenticationChallenge(initiateAuthenticationChallengeBody, options);
|
|
176
|
-
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
177
|
-
const localVarOperationServerBasePath = operationServerMap['OOBAuthenticationChallengeWebhookNotificationApi.initiateAuthenticationChallenge']?.[localVarOperationServerIndex]?.url;
|
|
178
|
-
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
179
|
-
},
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* OOBAuthenticationChallengeWebhookNotificationApi - factory interface
|
|
185
|
-
*/
|
|
186
|
-
export const OOBAuthenticationChallengeWebhookNotificationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
187
|
-
const localVarFp = OOBAuthenticationChallengeWebhookNotificationApiFp(configuration)
|
|
188
|
-
return {
|
|
189
|
-
/**
|
|
190
|
-
* In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
|
|
191
|
-
* @summary Initiate OOB Authentication Challenge
|
|
192
|
-
* @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
|
|
193
|
-
* @param {*} [options] Override http request option.
|
|
194
|
-
* @throws {RequiredError}
|
|
195
|
-
*/
|
|
196
|
-
initiateAuthenticationChallenge(initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
197
|
-
return localVarFp.initiateAuthenticationChallenge(initiateAuthenticationChallengeBody, options).then((request) => request(axios, basePath));
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* OOBAuthenticationChallengeWebhookNotificationApi - object-oriented interface
|
|
204
|
-
*/
|
|
205
|
-
export class OOBAuthenticationChallengeWebhookNotificationApi extends BaseAPI {
|
|
206
|
-
/**
|
|
207
|
-
* In Out-of-Band (OOB) authentication flow, Enfuce sends an authentication challenge webhook notification to the issuer\'s registered endpoint for cardholder\'s approval.
|
|
208
|
-
* @summary Initiate OOB Authentication Challenge
|
|
209
|
-
* @param {InitiateAuthenticationChallengeBody} initiateAuthenticationChallengeBody
|
|
210
|
-
* @param {*} [options] Override http request option.
|
|
211
|
-
* @throws {RequiredError}
|
|
212
|
-
*/
|
|
213
|
-
public initiateAuthenticationChallenge(initiateAuthenticationChallengeBody: InitiateAuthenticationChallengeBody, options?: RawAxiosRequestConfig) {
|
|
214
|
-
return OOBAuthenticationChallengeWebhookNotificationApiFp(this.configuration).initiateAuthenticationChallenge(initiateAuthenticationChallengeBody, options).then((request) => request(this.axios, this.basePath));
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
package/src/threeds-oob/index.ts
CHANGED
package/src/wallet/api.ts
CHANGED
|
@@ -475,7 +475,7 @@ export const ActivateTokenApiAxiosParamCreator = function (configuration?: Confi
|
|
|
475
475
|
// http bearer authentication required
|
|
476
476
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
477
477
|
|
|
478
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
478
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
479
479
|
|
|
480
480
|
if (xAuditUser != null) {
|
|
481
481
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -518,7 +518,7 @@ export const ActivateTokenApiAxiosParamCreator = function (configuration?: Confi
|
|
|
518
518
|
// http bearer authentication required
|
|
519
519
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
520
520
|
|
|
521
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
521
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
522
522
|
|
|
523
523
|
if (xIdempotencyKey != null) {
|
|
524
524
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -674,7 +674,7 @@ export const DeactivateTokenApiAxiosParamCreator = function (configuration?: Con
|
|
|
674
674
|
// http bearer authentication required
|
|
675
675
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
676
676
|
|
|
677
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
677
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
678
678
|
|
|
679
679
|
if (xIdempotencyKey != null) {
|
|
680
680
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -790,7 +790,7 @@ export const EligibleTokenRequestorsApiAxiosParamCreator = function (configurati
|
|
|
790
790
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
791
791
|
|
|
792
792
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
793
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
793
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
794
794
|
|
|
795
795
|
if (xAuditUser != null) {
|
|
796
796
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -913,7 +913,7 @@ export const GetTokensApiAxiosParamCreator = function (configuration?: Configura
|
|
|
913
913
|
localVarQueryParameter['includeCardSchemePayload'] = includeCardSchemePayload;
|
|
914
914
|
}
|
|
915
915
|
|
|
916
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
916
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
917
917
|
|
|
918
918
|
if (xAuditUser != null) {
|
|
919
919
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -965,7 +965,7 @@ export const GetTokensApiAxiosParamCreator = function (configuration?: Configura
|
|
|
965
965
|
localVarQueryParameter['includeCardSchemePayload'] = includeCardSchemePayload;
|
|
966
966
|
}
|
|
967
967
|
|
|
968
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
968
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
969
969
|
|
|
970
970
|
if (xAuditUser != null) {
|
|
971
971
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1126,7 +1126,7 @@ export const PushCardsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
1126
1126
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1127
1127
|
|
|
1128
1128
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1129
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1129
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1130
1130
|
|
|
1131
1131
|
if (xAuditUser != null) {
|
|
1132
1132
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1243,7 +1243,7 @@ export const PushProvisionApiAxiosParamCreator = function (configuration?: Confi
|
|
|
1243
1243
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1244
1244
|
|
|
1245
1245
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1246
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1246
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1247
1247
|
|
|
1248
1248
|
if (xAuditUser != null) {
|
|
1249
1249
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1288,7 +1288,7 @@ export const PushProvisionApiAxiosParamCreator = function (configuration?: Confi
|
|
|
1288
1288
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1289
1289
|
|
|
1290
1290
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1291
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1291
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1292
1292
|
|
|
1293
1293
|
if (xAuditUser != null) {
|
|
1294
1294
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1333,7 +1333,7 @@ export const PushProvisionApiAxiosParamCreator = function (configuration?: Confi
|
|
|
1333
1333
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1334
1334
|
|
|
1335
1335
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1336
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1336
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1337
1337
|
|
|
1338
1338
|
if (xAuditUser != null) {
|
|
1339
1339
|
localVarHeaderParameter['x-audit-user'] = String(xAuditUser);
|
|
@@ -1530,7 +1530,7 @@ export const SuspendTokenApiAxiosParamCreator = function (configuration?: Config
|
|
|
1530
1530
|
// http bearer authentication required
|
|
1531
1531
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1532
1532
|
|
|
1533
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1533
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1534
1534
|
|
|
1535
1535
|
if (xIdempotencyKey != null) {
|
|
1536
1536
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -1649,7 +1649,7 @@ export const UnsuspendTokenApiAxiosParamCreator = function (configuration?: Conf
|
|
|
1649
1649
|
// http bearer authentication required
|
|
1650
1650
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
1651
1651
|
|
|
1652
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1652
|
+
localVarHeaderParameter['Accept'] = 'application/json,application/problem+json';
|
|
1653
1653
|
|
|
1654
1654
|
if (xIdempotencyKey != null) {
|
|
1655
1655
|
localVarHeaderParameter['x-idempotency-key'] = String(xIdempotencyKey);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { type AxiosInstance } from 'axios';
|
|
2
|
-
import { type OAuthClientCredentialsManager } from '../oauth';
|
|
3
|
-
import { Configuration } from './configuration';
|
|
4
|
-
import { AuthorisationRequestAPIApi } from './api';
|
|
5
|
-
/**
|
|
6
|
-
* Fluent entry point for this module. Build one with {@link AuthorisationControlClient.builder}:
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* const client = AuthorisationControlClient.builder()
|
|
10
|
-
* .baseUrl('https://api.example.com/...')
|
|
11
|
-
* .oauth(tokens)
|
|
12
|
-
* .build();
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export declare class AuthorisationControlClient {
|
|
16
|
-
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
17
|
-
readonly http: AxiosInstance;
|
|
18
|
-
/** The module configuration — base path applied. */
|
|
19
|
-
readonly configuration: Configuration;
|
|
20
|
-
constructor(
|
|
21
|
-
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
22
|
-
http: AxiosInstance,
|
|
23
|
-
/** The module configuration — base path applied. */
|
|
24
|
-
configuration: Configuration);
|
|
25
|
-
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
26
|
-
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T;
|
|
27
|
-
/** {@link AuthorisationRequestAPIApi} bound to this client. */
|
|
28
|
-
authorisationRequestAPIApi(): AuthorisationRequestAPIApi;
|
|
29
|
-
static builder(): AuthorisationControlClientBuilder;
|
|
30
|
-
}
|
|
31
|
-
/** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
|
|
32
|
-
export declare class AuthorisationControlClientBuilder {
|
|
33
|
-
private _baseUrl?;
|
|
34
|
-
private _tokens?;
|
|
35
|
-
private _customizers;
|
|
36
|
-
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
37
|
-
baseUrl(baseUrl: string): this;
|
|
38
|
-
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
39
|
-
oauth(tokens: OAuthClientCredentialsManager): this;
|
|
40
|
-
/**
|
|
41
|
-
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
42
|
-
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
43
|
-
* calls run in order.
|
|
44
|
-
*/
|
|
45
|
-
configure(customizer: (http: AxiosInstance) => void): this;
|
|
46
|
-
build(): AuthorisationControlClient;
|
|
47
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthorisationControlClientBuilder = exports.AuthorisationControlClient = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Enfuce nextgen SDK — fluent module client.
|
|
6
|
-
*
|
|
7
|
-
* GENERATED by scripts/generate.sh from a custom template (generator-templates/typescript). One per
|
|
8
|
-
* API module: wires an OAuth-enabled axios instance (bearer token on every request + reactive 401
|
|
9
|
-
* retry) to the module's Configuration and exposes each API. Nothing is shared across modules.
|
|
10
|
-
*/
|
|
11
|
-
const axios_1 = require("axios");
|
|
12
|
-
const oauth_1 = require("../oauth");
|
|
13
|
-
const configuration_1 = require("./configuration");
|
|
14
|
-
const api_1 = require("./api");
|
|
15
|
-
/**
|
|
16
|
-
* Fluent entry point for this module. Build one with {@link AuthorisationControlClient.builder}:
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* const client = AuthorisationControlClient.builder()
|
|
20
|
-
* .baseUrl('https://api.example.com/...')
|
|
21
|
-
* .oauth(tokens)
|
|
22
|
-
* .build();
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
class AuthorisationControlClient {
|
|
26
|
-
constructor(
|
|
27
|
-
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
28
|
-
http,
|
|
29
|
-
/** The module configuration — base path applied. */
|
|
30
|
-
configuration) {
|
|
31
|
-
this.http = http;
|
|
32
|
-
this.configuration = configuration;
|
|
33
|
-
}
|
|
34
|
-
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
35
|
-
api(factory) {
|
|
36
|
-
return factory(this.configuration, this.http);
|
|
37
|
-
}
|
|
38
|
-
/** {@link AuthorisationRequestAPIApi} bound to this client. */
|
|
39
|
-
authorisationRequestAPIApi() {
|
|
40
|
-
return new api_1.AuthorisationRequestAPIApi(this.configuration, undefined, this.http);
|
|
41
|
-
}
|
|
42
|
-
static builder() {
|
|
43
|
-
return new AuthorisationControlClientBuilder();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.AuthorisationControlClient = AuthorisationControlClient;
|
|
47
|
-
/** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
|
|
48
|
-
class AuthorisationControlClientBuilder {
|
|
49
|
-
constructor() {
|
|
50
|
-
this._customizers = [];
|
|
51
|
-
}
|
|
52
|
-
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
53
|
-
baseUrl(baseUrl) {
|
|
54
|
-
this._baseUrl = baseUrl;
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
58
|
-
oauth(tokens) {
|
|
59
|
-
this._tokens = tokens;
|
|
60
|
-
return this;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
64
|
-
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
65
|
-
* calls run in order.
|
|
66
|
-
*/
|
|
67
|
-
configure(customizer) {
|
|
68
|
-
this._customizers.push(customizer);
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
build() {
|
|
72
|
-
const http = this._tokens ? (0, oauth_1.createOAuthAxios)(this._tokens) : axios_1.default.create();
|
|
73
|
-
for (const customizer of this._customizers) {
|
|
74
|
-
customizer(http);
|
|
75
|
-
}
|
|
76
|
-
const configuration = new configuration_1.Configuration({ basePath: this._baseUrl });
|
|
77
|
-
return new AuthorisationControlClient(http, configuration);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.AuthorisationControlClientBuilder = AuthorisationControlClientBuilder;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { type AxiosInstance } from 'axios';
|
|
2
|
-
import { type OAuthClientCredentialsManager } from '../oauth';
|
|
3
|
-
import { Configuration } from './configuration';
|
|
4
|
-
import { AuthorisationRequestAPIApi } from './api';
|
|
5
|
-
/**
|
|
6
|
-
* Fluent entry point for this module. Build one with {@link AuthorisationControlClient.builder}:
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* const client = AuthorisationControlClient.builder()
|
|
10
|
-
* .baseUrl('https://api.example.com/...')
|
|
11
|
-
* .oauth(tokens)
|
|
12
|
-
* .build();
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export declare class AuthorisationControlClient {
|
|
16
|
-
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
17
|
-
readonly http: AxiosInstance;
|
|
18
|
-
/** The module configuration — base path applied. */
|
|
19
|
-
readonly configuration: Configuration;
|
|
20
|
-
constructor(
|
|
21
|
-
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
22
|
-
http: AxiosInstance,
|
|
23
|
-
/** The module configuration — base path applied. */
|
|
24
|
-
configuration: Configuration);
|
|
25
|
-
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
26
|
-
api<T>(factory: (configuration: Configuration, http: AxiosInstance) => T): T;
|
|
27
|
-
/** {@link AuthorisationRequestAPIApi} bound to this client. */
|
|
28
|
-
authorisationRequestAPIApi(): AuthorisationRequestAPIApi;
|
|
29
|
-
static builder(): AuthorisationControlClientBuilder;
|
|
30
|
-
}
|
|
31
|
-
/** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
|
|
32
|
-
export declare class AuthorisationControlClientBuilder {
|
|
33
|
-
private _baseUrl?;
|
|
34
|
-
private _tokens?;
|
|
35
|
-
private _customizers;
|
|
36
|
-
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
37
|
-
baseUrl(baseUrl: string): this;
|
|
38
|
-
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
39
|
-
oauth(tokens: OAuthClientCredentialsManager): this;
|
|
40
|
-
/**
|
|
41
|
-
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
42
|
-
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
43
|
-
* calls run in order.
|
|
44
|
-
*/
|
|
45
|
-
configure(customizer: (http: AxiosInstance) => void): this;
|
|
46
|
-
build(): AuthorisationControlClient;
|
|
47
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
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 from 'axios';
|
|
9
|
-
import { createOAuthAxios } from '../oauth';
|
|
10
|
-
import { Configuration } from './configuration';
|
|
11
|
-
import { AuthorisationRequestAPIApi, } from './api';
|
|
12
|
-
/**
|
|
13
|
-
* Fluent entry point for this module. Build one with {@link AuthorisationControlClient.builder}:
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* const client = AuthorisationControlClient.builder()
|
|
17
|
-
* .baseUrl('https://api.example.com/...')
|
|
18
|
-
* .oauth(tokens)
|
|
19
|
-
* .build();
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export class AuthorisationControlClient {
|
|
23
|
-
constructor(
|
|
24
|
-
/** The axios instance — OAuth interceptors and any customizations already applied. */
|
|
25
|
-
http,
|
|
26
|
-
/** The module configuration — base path applied. */
|
|
27
|
-
configuration) {
|
|
28
|
-
this.http = http;
|
|
29
|
-
this.configuration = configuration;
|
|
30
|
-
}
|
|
31
|
-
/** Build any API in this module bound to this client (for APIs without a named getter). */
|
|
32
|
-
api(factory) {
|
|
33
|
-
return factory(this.configuration, this.http);
|
|
34
|
-
}
|
|
35
|
-
/** {@link AuthorisationRequestAPIApi} bound to this client. */
|
|
36
|
-
authorisationRequestAPIApi() {
|
|
37
|
-
return new AuthorisationRequestAPIApi(this.configuration, undefined, this.http);
|
|
38
|
-
}
|
|
39
|
-
static builder() {
|
|
40
|
-
return new AuthorisationControlClientBuilder();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/** Builds a {@link AuthorisationControlClient}: base URL + optional OAuth + transport customization. */
|
|
44
|
-
export class AuthorisationControlClientBuilder {
|
|
45
|
-
constructor() {
|
|
46
|
-
this._customizers = [];
|
|
47
|
-
}
|
|
48
|
-
/** The module's host, e.g. `https://api.<tenant>.../issuer`. */
|
|
49
|
-
baseUrl(baseUrl) {
|
|
50
|
-
this._baseUrl = baseUrl;
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
/** Install OAuth: a fresh bearer token on every request + reactive 401 retry. */
|
|
54
|
-
oauth(tokens) {
|
|
55
|
-
this._tokens = tokens;
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Customize the underlying axios instance — set a timeout (`http.defaults.timeout = ...`), a proxy,
|
|
60
|
-
* default headers, extra interceptors, etc. Runs after OAuth is installed. Composable: multiple
|
|
61
|
-
* calls run in order.
|
|
62
|
-
*/
|
|
63
|
-
configure(customizer) {
|
|
64
|
-
this._customizers.push(customizer);
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
build() {
|
|
68
|
-
const http = this._tokens ? createOAuthAxios(this._tokens) : globalAxios.create();
|
|
69
|
-
for (const customizer of this._customizers) {
|
|
70
|
-
customizer(http);
|
|
71
|
-
}
|
|
72
|
-
const configuration = new Configuration({ basePath: this._baseUrl });
|
|
73
|
-
return new AuthorisationControlClient(http, configuration);
|
|
74
|
-
}
|
|
75
|
-
}
|