@enfuce/nextgen-sdk 0.0.3 → 0.0.4
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/dist/esm/exchange-rate/api.d.ts +409 -0
- package/dist/esm/exchange-rate/api.js +403 -0
- package/dist/esm/exchange-rate/base.d.ts +42 -0
- package/dist/esm/exchange-rate/base.js +41 -0
- package/dist/esm/exchange-rate/common.d.ts +34 -0
- package/dist/esm/exchange-rate/common.js +126 -0
- package/dist/esm/exchange-rate/configuration.d.ts +98 -0
- package/dist/esm/exchange-rate/configuration.js +40 -0
- package/dist/esm/exchange-rate/index.d.ts +13 -0
- package/dist/esm/exchange-rate/index.js +15 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/exchange-rate/api.d.ts +409 -0
- package/dist/exchange-rate/api.js +418 -0
- package/dist/exchange-rate/base.d.ts +42 -0
- package/dist/exchange-rate/base.js +46 -0
- package/dist/exchange-rate/common.d.ts +34 -0
- package/dist/exchange-rate/common.js +139 -0
- package/dist/exchange-rate/configuration.d.ts +98 -0
- package/dist/exchange-rate/configuration.js +44 -0
- package/dist/exchange-rate/index.d.ts +13 -0
- package/dist/exchange-rate/index.js +31 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/src/exchange-rate/api.ts +615 -0
- package/src/exchange-rate/base.ts +62 -0
- package/src/exchange-rate/common.ts +127 -0
- package/src/exchange-rate/configuration.ts +121 -0
- package/src/exchange-rate/index.ts +18 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Exchange Rates API
|
|
5
|
+
* Endpoint for querying FX rates of payment scheme (including benchmark to ECB FX rates). API enables the issuer to comply with regulation (EU) 2019/518) and provide the cardholder with a better user experience by providing real-time visibility to scheme FX rates that are used for card transactions.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1
|
|
8
|
+
* Contact: info@enfuce.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { Configuration } from "./configuration";
|
|
16
|
+
import type { RequestArgs } from "./base";
|
|
17
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
18
|
+
import { RequiredError } from "./base";
|
|
19
|
+
|
|
20
|
+
export const DUMMY_BASE_URL = 'https://example.com'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @throws {RequiredError}
|
|
25
|
+
*/
|
|
26
|
+
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
|
|
27
|
+
if (paramValue === null || paramValue === undefined) {
|
|
28
|
+
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
|
|
33
|
+
if (configuration && configuration.apiKey) {
|
|
34
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
35
|
+
? await configuration.apiKey(keyParamName)
|
|
36
|
+
: await configuration.apiKey;
|
|
37
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
|
42
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
43
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
|
48
|
+
if (configuration && configuration.accessToken) {
|
|
49
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
50
|
+
? await configuration.accessToken()
|
|
51
|
+
: await configuration.accessToken;
|
|
52
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
|
57
|
+
if (configuration && configuration.accessToken) {
|
|
58
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
59
|
+
? await configuration.accessToken(name, scopes)
|
|
60
|
+
: await configuration.accessToken;
|
|
61
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
|
67
|
+
if (parameter == null) return;
|
|
68
|
+
if (typeof parameter === "object") {
|
|
69
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
70
|
+
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
Object.keys(parameter).forEach(currentKey =>
|
|
74
|
+
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
if (urlSearchParams.has(key)) {
|
|
80
|
+
urlSearchParams.append(key, parameter);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
urlSearchParams.set(key, parameter);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
|
89
|
+
const searchParams = new URLSearchParams(url.search);
|
|
90
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
91
|
+
url.search = searchParams.toString();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
96
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
97
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
98
|
+
*/
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
|
|
101
|
+
if (value instanceof Set) {
|
|
102
|
+
return Array.from(value);
|
|
103
|
+
} else {
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
|
109
|
+
const nonString = typeof value !== 'string';
|
|
110
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
111
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
112
|
+
: nonString;
|
|
113
|
+
return needsSerialization
|
|
114
|
+
? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
|
|
115
|
+
: (value || "");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const toPathString = function (url: URL) {
|
|
119
|
+
return url.pathname + url.search + url.hash
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
123
|
+
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
124
|
+
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
|
125
|
+
return axios.request<T, R>(axiosRequestArgs);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* Exchange Rates API
|
|
4
|
+
* Endpoint for querying FX rates of payment scheme (including benchmark to ECB FX rates). API enables the issuer to comply with regulation (EU) 2019/518) and provide the cardholder with a better user experience by providing real-time visibility to scheme FX rates that are used for card transactions.
|
|
5
|
+
*
|
|
6
|
+
* The version of the OpenAPI document: 1
|
|
7
|
+
* Contact: info@enfuce.com
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
interface AWSv4Configuration {
|
|
15
|
+
options?: {
|
|
16
|
+
region?: string
|
|
17
|
+
service?: string
|
|
18
|
+
}
|
|
19
|
+
credentials?: {
|
|
20
|
+
accessKeyId?: string
|
|
21
|
+
secretAccessKey?: string,
|
|
22
|
+
sessionToken?: string
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ConfigurationParameters {
|
|
27
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
28
|
+
username?: string;
|
|
29
|
+
password?: string;
|
|
30
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
31
|
+
awsv4?: AWSv4Configuration;
|
|
32
|
+
basePath?: string;
|
|
33
|
+
serverIndex?: number;
|
|
34
|
+
baseOptions?: any;
|
|
35
|
+
formDataCtor?: new () => any;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class Configuration {
|
|
39
|
+
/**
|
|
40
|
+
* parameter for apiKey security
|
|
41
|
+
* @param name security name
|
|
42
|
+
*/
|
|
43
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
44
|
+
/**
|
|
45
|
+
* parameter for basic security
|
|
46
|
+
*/
|
|
47
|
+
username?: string;
|
|
48
|
+
/**
|
|
49
|
+
* parameter for basic security
|
|
50
|
+
*/
|
|
51
|
+
password?: string;
|
|
52
|
+
/**
|
|
53
|
+
* parameter for oauth2 security
|
|
54
|
+
* @param name security name
|
|
55
|
+
* @param scopes oauth2 scope
|
|
56
|
+
*/
|
|
57
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
58
|
+
/**
|
|
59
|
+
* parameter for aws4 signature security
|
|
60
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
61
|
+
* @param {string} options.region - aws region
|
|
62
|
+
* @param {string} options.service - name of the service.
|
|
63
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
64
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
65
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
66
|
+
* @memberof Configuration
|
|
67
|
+
*/
|
|
68
|
+
awsv4?: AWSv4Configuration;
|
|
69
|
+
/**
|
|
70
|
+
* override base path
|
|
71
|
+
*/
|
|
72
|
+
basePath?: string;
|
|
73
|
+
/**
|
|
74
|
+
* override server index
|
|
75
|
+
*/
|
|
76
|
+
serverIndex?: number;
|
|
77
|
+
/**
|
|
78
|
+
* base options for axios calls
|
|
79
|
+
*/
|
|
80
|
+
baseOptions?: any;
|
|
81
|
+
/**
|
|
82
|
+
* The FormData constructor that will be used to create multipart form data
|
|
83
|
+
* requests. You can inject this here so that execution environments that
|
|
84
|
+
* do not support the FormData class can still run the generated client.
|
|
85
|
+
*
|
|
86
|
+
* @type {new () => FormData}
|
|
87
|
+
*/
|
|
88
|
+
formDataCtor?: new () => any;
|
|
89
|
+
|
|
90
|
+
constructor(param: ConfigurationParameters = {}) {
|
|
91
|
+
this.apiKey = param.apiKey;
|
|
92
|
+
this.username = param.username;
|
|
93
|
+
this.password = param.password;
|
|
94
|
+
this.accessToken = param.accessToken;
|
|
95
|
+
this.awsv4 = param.awsv4;
|
|
96
|
+
this.basePath = param.basePath;
|
|
97
|
+
this.serverIndex = param.serverIndex;
|
|
98
|
+
this.baseOptions = {
|
|
99
|
+
...param.baseOptions,
|
|
100
|
+
headers: {
|
|
101
|
+
...param.baseOptions?.headers,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
this.formDataCtor = param.formDataCtor;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Check if the given MIME is a JSON MIME.
|
|
109
|
+
* JSON MIME examples:
|
|
110
|
+
* application/json
|
|
111
|
+
* application/json; charset=UTF8
|
|
112
|
+
* APPLICATION/JSON
|
|
113
|
+
* application/vnd.company+json
|
|
114
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
115
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
116
|
+
*/
|
|
117
|
+
public isJsonMime(mime: string): boolean {
|
|
118
|
+
const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
|
|
119
|
+
return mime !== null && jsonMime.test(mime);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Exchange Rates API
|
|
5
|
+
* Endpoint for querying FX rates of payment scheme (including benchmark to ECB FX rates). API enables the issuer to comply with regulation (EU) 2019/518) and provide the cardholder with a better user experience by providing real-time visibility to scheme FX rates that are used for card transactions.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1
|
|
8
|
+
* Contact: info@enfuce.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export * from "./api";
|
|
17
|
+
export * from "./configuration";
|
|
18
|
+
|
package/src/index.ts
CHANGED