@triviumcapital/trivium-ts-sdk
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -64,2 +64,11 @@ import type { Configuration } from './configuration'; | ||
} | ||
export interface CreateOnboardingDocumentRequest { | ||
'taxId': string; | ||
'documentType': OnboardingDocumentType; | ||
'documentName': string; | ||
} | ||
export interface CreateOnboardingDocumentResponse { | ||
'id': string; | ||
'uploadLink': string; | ||
} | ||
export interface Deposit { | ||
@@ -125,2 +134,7 @@ 'accountId': string; | ||
} | ||
export interface IndividualDetails { | ||
'identityNumber': string; | ||
'fullName': string; | ||
'type': string; | ||
} | ||
export type InternationalTransfer = { | ||
@@ -144,2 +158,13 @@ type: 'Swift'; | ||
} | ||
export interface MonthlyStatementMetadata { | ||
'year': number; | ||
'month': number; | ||
'downloadLink': string; | ||
} | ||
export declare const OnboardingDocumentType: { | ||
readonly Address: "PROOF_OF_ADDRESS"; | ||
readonly CompanyRegistration: "PROOF_OF_COMPANY_REGISTRATION"; | ||
readonly Identity: "PROOF_OF_IDENTITY"; | ||
}; | ||
export type OnboardingDocumentType = typeof OnboardingDocumentType[keyof typeof OnboardingDocumentType]; | ||
export interface PaginationResultUserTransaction { | ||
@@ -251,3 +276,5 @@ 'results'?: Array<UserTransaction>; | ||
type: 'CompanyDetails'; | ||
} & CompanyDetails; | ||
} & CompanyDetails | { | ||
type: 'IndividualDetails'; | ||
} & IndividualDetails; | ||
export declare const UserStatus: { | ||
@@ -331,2 +358,14 @@ readonly Active: "ACTIVE"; | ||
} | ||
export declare const StatementApiAxiosParamCreator: (configuration?: Configuration) => { | ||
getApiV1StatementMonthlyUserid: (userId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; | ||
}; | ||
export declare const StatementApiFp: (configuration?: Configuration) => { | ||
getApiV1StatementMonthlyUserid(userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MonthlyStatementMetadata>>>; | ||
}; | ||
export declare const StatementApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { | ||
getApiV1StatementMonthlyUserid(userId: string, options?: any): AxiosPromise<Array<MonthlyStatementMetadata>>; | ||
}; | ||
export declare class StatementApi extends BaseAPI { | ||
getApiV1StatementMonthlyUserid(userId: string, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<MonthlyStatementMetadata[], any>>; | ||
} | ||
export declare const TransactionsApiAxiosParamCreator: (configuration?: Configuration) => { | ||
@@ -347,2 +386,3 @@ getApiV1TransactionsUserid: (userId: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; | ||
postApiV1User: (userDetails: UserDetails, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; | ||
postApiV1UserUseridDocuments: (userId: string, createOnboardingDocumentRequest: CreateOnboardingDocumentRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; | ||
}; | ||
@@ -352,2 +392,3 @@ export declare const UserApiFp: (configuration?: Configuration) => { | ||
postApiV1User(userDetails: UserDetails, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>>; | ||
postApiV1UserUseridDocuments(userId: string, createOnboardingDocumentRequest: CreateOnboardingDocumentRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOnboardingDocumentResponse>>; | ||
}; | ||
@@ -357,2 +398,3 @@ export declare const UserApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { | ||
postApiV1User(userDetails: UserDetails, options?: any): AxiosPromise<User>; | ||
postApiV1UserUseridDocuments(userId: string, createOnboardingDocumentRequest: CreateOnboardingDocumentRequest, options?: any): AxiosPromise<CreateOnboardingDocumentResponse>; | ||
}; | ||
@@ -362,2 +404,3 @@ export declare class UserApi extends BaseAPI { | ||
postApiV1User(userDetails: UserDetails, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<User, any>>; | ||
postApiV1UserUseridDocuments(userId: string, createOnboardingDocumentRequest: CreateOnboardingDocumentRequest, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<CreateOnboardingDocumentResponse, any>>; | ||
} |
104
dist/api.js
@@ -15,3 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = exports.TransactionsApi = exports.TransactionsApiFactory = exports.TransactionsApiFp = exports.TransactionsApiAxiosParamCreator = exports.FixedDepositApi = exports.FixedDepositApiFactory = exports.FixedDepositApiFp = exports.FixedDepositApiAxiosParamCreator = exports.CashApi = exports.CashApiFactory = exports.CashApiFp = exports.CashApiAxiosParamCreator = exports.UserStatus = exports.TransactionStatus = exports.FastParticipant = exports.AccountType = exports.AccountStatus = void 0; | ||
exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = exports.TransactionsApi = exports.TransactionsApiFactory = exports.TransactionsApiFp = exports.TransactionsApiAxiosParamCreator = exports.StatementApi = exports.StatementApiFactory = exports.StatementApiFp = exports.StatementApiAxiosParamCreator = exports.FixedDepositApi = exports.FixedDepositApiFactory = exports.FixedDepositApiFp = exports.FixedDepositApiAxiosParamCreator = exports.CashApi = exports.CashApiFactory = exports.CashApiFp = exports.CashApiAxiosParamCreator = exports.UserStatus = exports.TransactionStatus = exports.OnboardingDocumentType = exports.FastParticipant = exports.AccountType = exports.AccountStatus = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
@@ -32,2 +32,7 @@ const common_1 = require("./common"); | ||
}; | ||
exports.OnboardingDocumentType = { | ||
Address: 'PROOF_OF_ADDRESS', | ||
CompanyRegistration: 'PROOF_OF_COMPANY_REGISTRATION', | ||
Identity: 'PROOF_OF_IDENTITY' | ||
}; | ||
exports.TransactionStatus = { | ||
@@ -540,2 +545,59 @@ Pending: 'PENDING', | ||
exports.FixedDepositApi = FixedDepositApi; | ||
const StatementApiAxiosParamCreator = function (configuration) { | ||
return { | ||
getApiV1StatementMonthlyUserid: (userId, options = {}) => __awaiter(this, void 0, void 0, function* () { | ||
(0, common_1.assertParamExists)('getApiV1StatementMonthlyUserid', 'userId', userId); | ||
const localVarPath = `/api/v1/statement/monthly/{userId}` | ||
.replace(`{${"userId"}}`, encodeURIComponent(String(userId))); | ||
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); | ||
const localVarHeaderParameter = {}; | ||
const localVarQueryParameter = {}; | ||
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration); | ||
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); | ||
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); | ||
return { | ||
url: (0, common_1.toPathString)(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}), | ||
}; | ||
}; | ||
exports.StatementApiAxiosParamCreator = StatementApiAxiosParamCreator; | ||
const StatementApiFp = function (configuration) { | ||
const localVarAxiosParamCreator = (0, exports.StatementApiAxiosParamCreator)(configuration); | ||
return { | ||
getApiV1StatementMonthlyUserid(userId, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const localVarAxiosArgs = yield localVarAxiosParamCreator.getApiV1StatementMonthlyUserid(userId, options); | ||
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; | ||
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['StatementApi.getApiV1StatementMonthlyUserid']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; | ||
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
}); | ||
}, | ||
}; | ||
}; | ||
exports.StatementApiFp = StatementApiFp; | ||
const StatementApiFactory = function (configuration, basePath, axios) { | ||
const localVarFp = (0, exports.StatementApiFp)(configuration); | ||
return { | ||
getApiV1StatementMonthlyUserid(userId, options) { | ||
return localVarFp.getApiV1StatementMonthlyUserid(userId, options).then((request) => request(axios, basePath)); | ||
}, | ||
}; | ||
}; | ||
exports.StatementApiFactory = StatementApiFactory; | ||
class StatementApi extends base_1.BaseAPI { | ||
getApiV1StatementMonthlyUserid(userId, options) { | ||
return (0, exports.StatementApiFp)(this.configuration).getApiV1StatementMonthlyUserid(userId, options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
} | ||
exports.StatementApi = StatementApi; | ||
const TransactionsApiAxiosParamCreator = function (configuration) { | ||
@@ -651,2 +713,27 @@ return { | ||
}), | ||
postApiV1UserUseridDocuments: (userId, createOnboardingDocumentRequest, options = {}) => __awaiter(this, void 0, void 0, function* () { | ||
(0, common_1.assertParamExists)('postApiV1UserUseridDocuments', 'userId', userId); | ||
(0, common_1.assertParamExists)('postApiV1UserUseridDocuments', 'createOnboardingDocumentRequest', createOnboardingDocumentRequest); | ||
const localVarPath = `/api/v1/user/{userId}/documents` | ||
.replace(`{${"userId"}}`, encodeURIComponent(String(userId))); | ||
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); | ||
const localVarHeaderParameter = {}; | ||
const localVarQueryParameter = {}; | ||
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration); | ||
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); | ||
localVarHeaderParameter['Content-Type'] = 'application/json'; | ||
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); | ||
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createOnboardingDocumentRequest, localVarRequestOptions, configuration); | ||
return { | ||
url: (0, common_1.toPathString)(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}), | ||
}; | ||
@@ -676,2 +763,11 @@ }; | ||
}, | ||
postApiV1UserUseridDocuments(userId, createOnboardingDocumentRequest, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const localVarAxiosArgs = yield localVarAxiosParamCreator.postApiV1UserUseridDocuments(userId, createOnboardingDocumentRequest, options); | ||
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; | ||
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.postApiV1UserUseridDocuments']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; | ||
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
}); | ||
}, | ||
}; | ||
@@ -689,2 +785,5 @@ }; | ||
}, | ||
postApiV1UserUseridDocuments(userId, createOnboardingDocumentRequest, options) { | ||
return localVarFp.postApiV1UserUseridDocuments(userId, createOnboardingDocumentRequest, options).then((request) => request(axios, basePath)); | ||
}, | ||
}; | ||
@@ -700,4 +799,7 @@ }; | ||
} | ||
postApiV1UserUseridDocuments(userId, createOnboardingDocumentRequest, options) { | ||
return (0, exports.UserApiFp)(this.configuration).postApiV1UserUseridDocuments(userId, createOnboardingDocumentRequest, options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
} | ||
exports.UserApi = UserApi; | ||
//# sourceMappingURL=api.js.map |
@@ -92,39 +92,6 @@ "use strict"; | ||
return needsSerialization | ||
? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) | ||
? JSON.stringify(value !== undefined ? value : {}) | ||
: (value || ""); | ||
}; | ||
exports.serializeDataIfNeeded = serializeDataIfNeeded; | ||
function convertMapsAndSetsToPlain(value) { | ||
if (typeof Set === "undefined") | ||
return value; | ||
if (typeof Map === "undefined") | ||
return value; | ||
if (typeof value !== "object" || !value) { | ||
return value; | ||
} | ||
if (value instanceof Set) { | ||
return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); | ||
} | ||
if (value instanceof Map) { | ||
const entries = []; | ||
value.forEach((value, key) => { | ||
entries.push([key, convertMapsAndSetsToPlain(value)]); | ||
}); | ||
return objectFromEntries(entries); | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(it => convertMapsAndSetsToPlain(it)); | ||
} | ||
return objectFromEntries(objectEntries(value) | ||
.map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); | ||
} | ||
function objectEntries(object) { | ||
return Object.keys(object).map(key => [key, object[key]]); | ||
} | ||
function objectFromEntries(entries) { | ||
return [...entries].reduce((object, [key, val]) => { | ||
object[key] = val; | ||
return object; | ||
}, {}); | ||
} | ||
const toPathString = function (url) { | ||
@@ -131,0 +98,0 @@ return url.pathname + url.search + url.hash; |
{ | ||
"name": "@triviumcapital/trivium-ts-sdk", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Typescript Axios Client SDK for trivium APIs", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91269
1446