@finverse/sdk-typescript 0.0.18 → 0.0.21
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/api.d.ts +3925 -0
- package/dist/api.js +2349 -0
- package/dist/base.d.ts +55 -0
- package/dist/base.js +60 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +141 -0
- package/dist/configuration.d.ts +83 -0
- package/dist/configuration.js +42 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +27 -0
- package/dist/test/accounts.spec.d.ts +1 -0
- package/dist/test/accounts.spec.js +38 -0
- package/dist/test/authenticate.spec.d.ts +1 -0
- package/dist/test/authenticate.spec.js +46 -0
- package/dist/test/config.d.ts +10 -0
- package/dist/test/config.js +15 -0
- package/dist/test/link.spec.d.ts +1 -0
- package/dist/test/link.spec.js +75 -0
- package/dist/test/loginIdentity.spec.d.ts +1 -0
- package/dist/test/loginIdentity.spec.js +69 -0
- package/dist/test/responses/account.d.ts +2 -0
- package/dist/test/responses/account.js +104 -0
- package/dist/test/responses/accountNumber.d.ts +2 -0
- package/dist/test/responses/accountNumber.js +19 -0
- package/dist/test/responses/balanceHistory.d.ts +2 -0
- package/dist/test/responses/balanceHistory.js +21 -0
- package/dist/test/responses/customerToken.d.ts +5 -0
- package/dist/test/responses/customerToken.js +8 -0
- package/dist/test/responses/identity.d.ts +2 -0
- package/dist/test/responses/identity.js +54 -0
- package/dist/test/responses/linkToken.d.ts +6 -0
- package/dist/test/responses/linkToken.js +9 -0
- package/dist/test/responses/loginIdentity.d.ts +2 -0
- package/dist/test/responses/loginIdentity.js +85 -0
- package/dist/test/responses/loginIdentityHistory.d.ts +2 -0
- package/dist/test/responses/loginIdentityHistory.js +37 -0
- package/dist/test/responses/loginIdentityToken.d.ts +7 -0
- package/dist/test/responses/loginIdentityToken.js +10 -0
- package/dist/test/responses/statement.d.ts +2 -0
- package/dist/test/responses/statement.js +20 -0
- package/dist/test/responses/statementLink.d.ts +2 -0
- package/dist/test/responses/statementLink.js +15 -0
- package/dist/test/responses/transaction.d.ts +2 -0
- package/dist/test/responses/transaction.js +280 -0
- package/dist/test/statements.spec.d.ts +1 -0
- package/dist/test/statements.spec.js +44 -0
- package/dist/test/transactions.spec.d.ts +1 -0
- package/dist/test/transactions.spec.js +38 -0
- package/package.json +4 -3
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finverse Public
|
|
3
|
+
* Documentation of the early finverse services
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.1
|
|
6
|
+
* Contact: devs@finverse.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { Configuration } from './configuration';
|
|
13
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
14
|
+
export declare const BASE_PATH: string;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const COLLECTION_FORMATS: {
|
|
20
|
+
csv: string;
|
|
21
|
+
ssv: string;
|
|
22
|
+
tsv: string;
|
|
23
|
+
pipes: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @interface RequestArgs
|
|
29
|
+
*/
|
|
30
|
+
export interface RequestArgs {
|
|
31
|
+
url: string;
|
|
32
|
+
options: AxiosRequestConfig;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
* @class BaseAPI
|
|
38
|
+
*/
|
|
39
|
+
export declare class BaseAPI {
|
|
40
|
+
protected basePath: string;
|
|
41
|
+
protected axios: AxiosInstance;
|
|
42
|
+
protected configuration: Configuration | undefined;
|
|
43
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @class RequiredError
|
|
49
|
+
* @extends {Error}
|
|
50
|
+
*/
|
|
51
|
+
export declare class RequiredError extends Error {
|
|
52
|
+
field: string;
|
|
53
|
+
name: 'RequiredError';
|
|
54
|
+
constructor(field: string, msg?: string);
|
|
55
|
+
}
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Finverse Public
|
|
6
|
+
* Documentation of the early finverse services
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.1
|
|
9
|
+
* Contact: devs@finverse.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
17
|
+
// Some imports not used depending on template conditions
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
const axios_1 = require("axios");
|
|
20
|
+
exports.BASE_PATH = 'https://api.sandbox.finverse.net'.replace(/\/+$/, '');
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.COLLECTION_FORMATS = {
|
|
26
|
+
csv: ',',
|
|
27
|
+
ssv: ' ',
|
|
28
|
+
tsv: '\t',
|
|
29
|
+
pipes: '|',
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @class BaseAPI
|
|
35
|
+
*/
|
|
36
|
+
class BaseAPI {
|
|
37
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
38
|
+
this.basePath = basePath;
|
|
39
|
+
this.axios = axios;
|
|
40
|
+
if (configuration) {
|
|
41
|
+
this.configuration = configuration;
|
|
42
|
+
this.basePath = configuration.basePath || this.basePath;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.BaseAPI = BaseAPI;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @export
|
|
50
|
+
* @class RequiredError
|
|
51
|
+
* @extends {Error}
|
|
52
|
+
*/
|
|
53
|
+
class RequiredError extends Error {
|
|
54
|
+
constructor(field, msg) {
|
|
55
|
+
super(msg);
|
|
56
|
+
this.field = field;
|
|
57
|
+
this.name = 'RequiredError';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.RequiredError = RequiredError;
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finverse Public
|
|
3
|
+
* Documentation of the early finverse services
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.1
|
|
6
|
+
* Contact: devs@finverse.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { Configuration } from './configuration';
|
|
13
|
+
import { RequestArgs } from './base';
|
|
14
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
*/
|
|
50
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
export declare const toPathString: (url: URL) => string;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Finverse Public
|
|
6
|
+
* Documentation of the early finverse services
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.1
|
|
9
|
+
* Contact: devs@finverse.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
26
|
+
const base_1 = require("./base");
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @throws {RequiredError}
|
|
35
|
+
* @export
|
|
36
|
+
*/
|
|
37
|
+
exports.assertParamExists = function (functionName, paramName, paramValue) {
|
|
38
|
+
if (paramValue === null || paramValue === undefined) {
|
|
39
|
+
throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
exports.setApiKeyToObject = function (object, keyParamName, configuration) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
if (configuration && configuration.apiKey) {
|
|
49
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
50
|
+
? yield configuration.apiKey(keyParamName)
|
|
51
|
+
: yield configuration.apiKey;
|
|
52
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
exports.setBasicAuthToObject = function (object, configuration) {
|
|
61
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
62
|
+
object['auth'] = { username: configuration.username, password: configuration.password };
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @export
|
|
68
|
+
*/
|
|
69
|
+
exports.setBearerAuthToObject = function (object, configuration) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
if (configuration && configuration.accessToken) {
|
|
72
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
73
|
+
? yield configuration.accessToken()
|
|
74
|
+
: yield configuration.accessToken;
|
|
75
|
+
object['Authorization'] = 'Bearer ' + accessToken;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @export
|
|
82
|
+
*/
|
|
83
|
+
exports.setOAuthToObject = function (object, name, scopes, configuration) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
if (configuration && configuration.accessToken) {
|
|
86
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
87
|
+
? yield configuration.accessToken(name, scopes)
|
|
88
|
+
: yield configuration.accessToken;
|
|
89
|
+
object['Authorization'] = 'Bearer ' + localVarAccessTokenValue;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @export
|
|
96
|
+
*/
|
|
97
|
+
exports.setSearchParams = function (url, ...objects) {
|
|
98
|
+
const searchParams = new URLSearchParams(url.search);
|
|
99
|
+
for (const object of objects) {
|
|
100
|
+
for (const key in object) {
|
|
101
|
+
if (Array.isArray(object[key])) {
|
|
102
|
+
searchParams.delete(key);
|
|
103
|
+
for (const item of object[key]) {
|
|
104
|
+
searchParams.append(key, item);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
searchParams.set(key, object[key]);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
url.search = searchParams.toString();
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* @export
|
|
117
|
+
*/
|
|
118
|
+
exports.serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
119
|
+
const nonString = typeof value !== 'string';
|
|
120
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
121
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
122
|
+
: nonString;
|
|
123
|
+
return needsSerialization ? JSON.stringify(value !== undefined ? value : {}) : value || '';
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* @export
|
|
128
|
+
*/
|
|
129
|
+
exports.toPathString = function (url) {
|
|
130
|
+
return url.pathname + url.search + url.hash;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* @export
|
|
135
|
+
*/
|
|
136
|
+
exports.createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
137
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
138
|
+
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
|
|
139
|
+
return axios.request(axiosRequestArgs);
|
|
140
|
+
};
|
|
141
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finverse Public
|
|
3
|
+
* Documentation of the early finverse services
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.1
|
|
6
|
+
* Contact: devs@finverse.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export interface ConfigurationParameters {
|
|
13
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
14
|
+
username?: string;
|
|
15
|
+
password?: string;
|
|
16
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
17
|
+
basePath?: string;
|
|
18
|
+
baseOptions?: any;
|
|
19
|
+
formDataCtor?: new () => any;
|
|
20
|
+
}
|
|
21
|
+
export declare class Configuration {
|
|
22
|
+
/**
|
|
23
|
+
* parameter for apiKey security
|
|
24
|
+
* @param name security name
|
|
25
|
+
* @memberof Configuration
|
|
26
|
+
*/
|
|
27
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
28
|
+
/**
|
|
29
|
+
* parameter for basic security
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof Configuration
|
|
33
|
+
*/
|
|
34
|
+
username?: string;
|
|
35
|
+
/**
|
|
36
|
+
* parameter for basic security
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof Configuration
|
|
40
|
+
*/
|
|
41
|
+
password?: string;
|
|
42
|
+
/**
|
|
43
|
+
* parameter for oauth2 security
|
|
44
|
+
* @param name security name
|
|
45
|
+
* @param scopes oauth2 scope
|
|
46
|
+
* @memberof Configuration
|
|
47
|
+
*/
|
|
48
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
49
|
+
/**
|
|
50
|
+
* override base path
|
|
51
|
+
*
|
|
52
|
+
* @type {string}
|
|
53
|
+
* @memberof Configuration
|
|
54
|
+
*/
|
|
55
|
+
basePath?: string;
|
|
56
|
+
/**
|
|
57
|
+
* base options for axios calls
|
|
58
|
+
*
|
|
59
|
+
* @type {any}
|
|
60
|
+
* @memberof Configuration
|
|
61
|
+
*/
|
|
62
|
+
baseOptions?: any;
|
|
63
|
+
/**
|
|
64
|
+
* The FormData constructor that will be used to create multipart form data
|
|
65
|
+
* requests. You can inject this here so that execution environments that
|
|
66
|
+
* do not support the FormData class can still run the generated client.
|
|
67
|
+
*
|
|
68
|
+
* @type {new () => FormData}
|
|
69
|
+
*/
|
|
70
|
+
formDataCtor?: new () => any;
|
|
71
|
+
constructor(param?: ConfigurationParameters);
|
|
72
|
+
/**
|
|
73
|
+
* Check if the given MIME is a JSON MIME.
|
|
74
|
+
* JSON MIME examples:
|
|
75
|
+
* application/json
|
|
76
|
+
* application/json; charset=UTF8
|
|
77
|
+
* APPLICATION/JSON
|
|
78
|
+
* application/vnd.company+json
|
|
79
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
80
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
81
|
+
*/
|
|
82
|
+
isJsonMime(mime: string): boolean;
|
|
83
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Finverse Public
|
|
6
|
+
* Documentation of the early finverse services
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.1
|
|
9
|
+
* Contact: devs@finverse.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Configuration = void 0;
|
|
17
|
+
class Configuration {
|
|
18
|
+
constructor(param = {}) {
|
|
19
|
+
this.apiKey = param.apiKey;
|
|
20
|
+
this.username = param.username;
|
|
21
|
+
this.password = param.password;
|
|
22
|
+
this.accessToken = param.accessToken;
|
|
23
|
+
this.basePath = param.basePath;
|
|
24
|
+
this.baseOptions = param.baseOptions;
|
|
25
|
+
this.formDataCtor = param.formDataCtor;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if the given MIME is a JSON MIME.
|
|
29
|
+
* JSON MIME examples:
|
|
30
|
+
* application/json
|
|
31
|
+
* application/json; charset=UTF8
|
|
32
|
+
* APPLICATION/JSON
|
|
33
|
+
* application/vnd.company+json
|
|
34
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
35
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
36
|
+
*/
|
|
37
|
+
isJsonMime(mime) {
|
|
38
|
+
const jsonMime = new RegExp('^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
39
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.Configuration = Configuration;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finverse Public
|
|
3
|
+
* Documentation of the early finverse services
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.1
|
|
6
|
+
* Contact: devs@finverse.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export * from './api';
|
|
13
|
+
export * from './configuration';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Finverse Public
|
|
6
|
+
* Documentation of the early finverse services
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.1
|
|
9
|
+
* Contact: devs@finverse.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
__exportStar(require("./api"), exports);
|
|
27
|
+
__exportStar(require("./configuration"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const axios_mock_adapter_1 = require("axios-mock-adapter");
|
|
13
|
+
const axios_1 = require("axios");
|
|
14
|
+
const config_1 = require("./config");
|
|
15
|
+
const __1 = require("..");
|
|
16
|
+
const api_1 = require("../api");
|
|
17
|
+
const account_1 = require("./responses/account");
|
|
18
|
+
const loginIdentityToken_1 = require("./responses/loginIdentityToken");
|
|
19
|
+
const chai_1 = require("chai");
|
|
20
|
+
describe('Accounts', function () {
|
|
21
|
+
let mock;
|
|
22
|
+
before(() => {
|
|
23
|
+
mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
24
|
+
mock.onGet(`${config_1.config.apiHost}/accounts`).reply(200, account_1.getAccounts());
|
|
25
|
+
});
|
|
26
|
+
it('Get accounts', function () {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
// Make Request
|
|
29
|
+
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost, accessToken: loginIdentityToken_1.loginIdentityToken.access_token });
|
|
30
|
+
const got = yield new api_1.LoginIdentityApi(configuration).listAccounts();
|
|
31
|
+
// Expect
|
|
32
|
+
chai_1.expect(got.data.accounts).to.be.ok;
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
after(() => {
|
|
36
|
+
mock.restore();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const axios_mock_adapter_1 = require("axios-mock-adapter");
|
|
13
|
+
const axios_1 = require("axios");
|
|
14
|
+
const config_1 = require("./config");
|
|
15
|
+
const __1 = require("..");
|
|
16
|
+
const customerToken_1 = require("./responses/customerToken");
|
|
17
|
+
const chai_1 = require("chai");
|
|
18
|
+
describe('Authenticate', function () {
|
|
19
|
+
let mock;
|
|
20
|
+
before(() => {
|
|
21
|
+
mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
22
|
+
mock
|
|
23
|
+
.onPost(`${config_1.config.apiHost}/auth/customer/token`, {
|
|
24
|
+
client_id: config_1.config.clientId,
|
|
25
|
+
client_secret: config_1.config.clientSecret,
|
|
26
|
+
grant_type: config_1.grantType.CLIENT_CREDENTIALS,
|
|
27
|
+
})
|
|
28
|
+
.reply(200, customerToken_1.customerToken);
|
|
29
|
+
});
|
|
30
|
+
it('Get customer access token', function () {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
// Make Request
|
|
33
|
+
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost });
|
|
34
|
+
const got = yield new __1.PublicApi(configuration).generateCustomerAccessToken({
|
|
35
|
+
client_id: config_1.config.clientId,
|
|
36
|
+
client_secret: config_1.config.clientSecret,
|
|
37
|
+
grant_type: config_1.grantType.CLIENT_CREDENTIALS,
|
|
38
|
+
});
|
|
39
|
+
// Expect
|
|
40
|
+
chai_1.expect(got.data.access_token).to.equal(customerToken_1.customerToken.access_token);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
after(() => {
|
|
44
|
+
mock.restore();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.grantType = exports.config = void 0;
|
|
4
|
+
// These are being hardcoded for the test.
|
|
5
|
+
// Obtain these from https://dashboard.finverse.com
|
|
6
|
+
exports.config = {
|
|
7
|
+
apiHost: 'https://example.com',
|
|
8
|
+
redirectURI: 'https://example.com/callback',
|
|
9
|
+
clientId: 'clientId',
|
|
10
|
+
clientSecret: 'clientSecret',
|
|
11
|
+
};
|
|
12
|
+
exports.grantType = {
|
|
13
|
+
AUTHORIZATION_CODE: 'authorization_code',
|
|
14
|
+
CLIENT_CREDENTIALS: 'client_credentials',
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|