Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"files": [
"dist"
],
"types": "types/index.d.ts",
"scripts": {
"test": "mocha --recursive --timeout 100000",
"test-nodes": "mocha --recursive test/nodesTests/*.js --timeout 100000",
Expand Down
26 changes: 26 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es6",
"downlevelIteration": true,
"module": "commonjs",
"declaration": true,
"declarationDir": "./types",
"outDir": "./dist",
"allowSyntheticDefaultImports": true,
"strict": true,
"resolveJsonModule": true,
"removeComments": false,
"esModuleInterop": true,
"noImplicitAny": false,
"allowJs": true
},
"include": [
"src"
],
"exclude": [
"node_modules"
],
"lib": [
"ESNext"
]
}
1 change: 1 addition & 0 deletions types/apiReqs/apiReqsClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions types/apiReqs/apiReqsUser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
2 changes: 2 additions & 0 deletions types/apiReqs/apiRequests.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const client: typeof import("./apiReqsClient");
export const user: typeof import("./apiReqsUser");
61 changes: 61 additions & 0 deletions types/constants/apiReqNames.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export const createUser: string;
export const getAllUsers: string;
export const getUser: string;
export const getPlatformTransactions: string;
export const getUserTransactions: string;
export const getPlatformNodes: string;
export const getInstitutions: string;
export const triggerDummyTransactions: string;
export const issuePublicKey: string;
export const createSubscription: string;
export const getAllSubscriptions: string;
export const getSubscription: string;
export const updateSubscription: string;
export const addUserKyc: string;
export const deleteExistingDocument: string;
export const updateUser: string;
export const getUserDuplicates: string;
export const swapDuplicateUsers: string;
export const _grabRefreshToken: string;
export const _oauthUser: string;
export const createNode: string;
export const verifyAchMfa: string;
export const getAllUserNodes: string;
export const getNode: string;
export const generateUboForm: string;
export const getStatementsByUser: string;
export const getStatementsByNode: string;
export const shipCardNode: string;
export const resetCardNode: string;
export const verifyMicroDeposits: string;
export const reinitiateMicroDeposits: string;
export const updateNode: string;
export const deleteNode: string;
export const generateApplePayToken: string;
export const createTransaction: string;
export const getTransaction: string;
export const getAllNodeTransactions: string;
export const deleteTransaction: string;
export const commentOnStatus: string;
export const disputeCardTransaction: string;
export const getAllSubnets: string;
export const getSubnet: string;
export const createSubnet: string;
export const updateSubnet: string;
export const pushToMobileWallet: string;
export const registerNewFingerprint: string;
export const supplyDevice2FA: string;
export const verifyFingerprint2FA: string;
export const locateAtms: string;
export const verifyAddress: string;
export const getCryptoQuotes: string;
export const getCryptoMarketData: string;
export const getWebhookLogs: string;
export const shipCard: string;
export const updateIpAddress: string;
export const getTradeMarketData: string;
export const verifyRoutingNumber: string;
export const createBatchTransactions: string;
export const getAllCardShipments: string;
export const getCardShipment: string;
export const deleteCardShipment: string;
12 changes: 12 additions & 0 deletions types/helpers/buildHeaders.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
declare function _exports({ client_id, client_secret, oauth_key, fingerprint, ip_address, idempotency_key }: {
client_id: any;
client_secret: any;
oauth_key: any;
fingerprint: any;
ip_address: any;
idempotency_key: any;
}): {
'Content-Type': string;
'X-SP-USER-IP': any;
};
export = _exports;
29 changes: 29 additions & 0 deletions types/helpers/buildUrls.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
export function addQueryParams({ originalUrl, amount, query, page, per_page, filter, show_refresh_tokens, full_dehydrate, force_refresh, type, zip, lat, lon, radius, limit, currency, foreign_transaction, is_credit, subnet_id, ticker }: {
originalUrl: any;
amount: any;
query: any;
page: any;
per_page: any;
filter: any;
show_refresh_tokens: any;
full_dehydrate: any;
force_refresh: any;
type: any;
zip: any;
lat: any;
lon: any;
radius: any;
limit: any;
currency: any;
foreign_transaction: any;
is_credit: any;
subnet_id: any;
ticker: any;
}): any;
export function replacePathParams({ originalUrl, user_id, node_id, trans_id, subnet_id }: {
originalUrl: any;
user_id: any;
node_id: any;
trans_id: any;
subnet_id: any;
}): any;
7 changes: 7 additions & 0 deletions types/helpers/clientHelpers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function checkOptions(headerObj: any, options: any): any;
export function instantiateUser({ data, headerObj, client }: {
data: any;
headerObj: any;
client: any;
}): Promise<User>;
import User = require("../lib/User");
3 changes: 3 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Client = require("./lib/Client");
import User = require("./lib/User");
export { Client, User };
39 changes: 39 additions & 0 deletions types/lib/Client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
export = Client;
declare class Client {
constructor({ client_id, client_secret, fingerprint, ip_address, isProduction }: {
client_id: any;
client_secret: any;
fingerprint: any;
ip_address: any;
isProduction: any;
});
client_id: any;
client_secret: any;
fingerprint: any;
ip_address: any;
isProduction: any;
host: string;
headers: {
'Content-Type': string;
'X-SP-USER-IP': any;
};
createUser(bodyParams: any, ip_address: any, options?: null): Promise<User>;
getAllUsers(queryParams?: {}): any;
getUser(user_id: any, options?: null): Promise<User>;
getPlatformTransactions(queryParams?: {}): any;
getPlatformNodes(queryParams?: {}): any;
getInstitutions(): any;
issuePublicKey(scope?: string[], userId?: null): any;
createSubscription(url: any, scope?: string[], idempotency_key?: null): any;
getAllSubscriptions(queryParams?: {}): any;
getSubscription(subscription_id: any): any;
updateSubscription(subscription_id: any, bodyParams?: {}): any;
locateAtms(queryParams?: {}): any;
verifyAddress(queryParams?: {}): any;
verifyRoutingNumber(queryParams?: {}): any;
getCryptoQuotes(): any;
getCryptoMarketData(queryParams?: {}): any;
getWebhookLogs(): any;
getTradeMarketData(queryParams?: {}): any;
}
import User = require("./User");
130 changes: 130 additions & 0 deletions types/lib/User.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
export = User;
declare class User {
constructor({ data, headerObj, client }: {
data: any;
headerObj: any;
client: any;
});
id: any;
body: any;
host: any;
fingerprint: any;
ip_address: any;
oauth_key: string;
client: any;
headers: {
'Content-Type': string;
'X-SP-USER-IP': any;
};
addUserKyc(bodyParams?: {}): any;
deleteExistingDocument(bodyParams?: {}): any;
updateUser(bodyParams?: {}): any;
/**
* GET ALL USER DUPLICATES
*
* @returns Promise
*
* [Get User Duplicates Docs]{@link https://docs.synapsefi.com/api-references/users/manage-duplicates#example-request}
*/
getUserDuplicates(): any;
/**
* SWAP DUPLICATE USER
* @param {String} swap_to_user_id required: User ID you'd like to swap the open status with
*
* @returns Promise
*
* [Swap Duplicate User Docs]{@link https://docs.synapsefi.com/api-references/users/manage-duplicates#example-request-1}
*/
swapDuplicateUsers(swap_to_user_id: string): any;
_grabRefreshToken(): any;
_oauthUser(bodyParams?: {}): any;
createNode(bodyParams?: {}, idempotency_key?: null): any;
verifyAchMfa(access_token: any, mfa_answer: any, idempotency_key?: null): any;
getAllUserNodes(queryParams?: {}): any;
getNode(node_id: any, queryParams?: {}): any;
getUserTransactions(queryParams?: {}): any;
triggerDummyTransactions(node_id: any, queryParams?: {}): any;
generateUboForm(bodyParams: any): any;
getStatementsByUser(queryParams?: {}): any;
getStatementsByNode(node_id: any, queryParams?: {}): any;
shipCardNode(node_id: any, bodyParams: any): any;
resetCardNode(node_id: any): any;
verifyMicroDeposits(node_id: any, bodyParams: any): any;
reinitiateMicroDeposits(node_id: any): any;
updateNode(node_id: any, bodyParams: any): any;
deleteNode(node_id: any): any;
generateApplePayToken(node_id: any, bodyParams: any): any;
createTransaction(node_id: any, bodyParams: any, idempotency_key?: null): any;
/**
*
* @param {String} node_id required: id of node on which to create bulk transactions
* @param {Object} bodyParams required: body of post request, must have transactions key, which is an array of transaction objects
* @param {Array} bodyParams.transactions
*
* @returns Promise
*
* Idempotency keys can be provided for each transaction, inside each transaction object's `extra` key.
*
* e.g. `{ transactions: [{ extra: { idempotency_key: 'idemPotKeyStr' } }] }`
*
* [Batch Transaction Docs]{@link https://docs.synapsefi.com/api-references/transactions/create-batch-transactions}
* [Trans Object Details]{@link https://docs.synapsefi.com/api-references/transactions/transaction-object-details}
*/
createBatchTransactions(node_id: string, bodyParams: {
transactions: any[];
}): any;
getTransaction(node_id: any, trans_id: any): any;
getAllNodeTransactions(node_id: any, queryParams?: {}): any;
deleteTransaction(node_id: any, trans_id: any): any;
commentOnStatus(node_id: any, trans_id: any, bodyParams: any): any;
disputeCardTransaction(node_id: any, trans_id: any, bodyParams: any): any;
getAllSubnets(node_id: any, queryParams?: {}): any;
getSubnet(node_id: any, subnet_id: any, queryParams?: {}): any;
createSubnet(node_id: any, bodyParams: any, idempotency_key?: null): any;
updateSubnet(node_id: any, subnet_id: any, bodyParams?: {}): any;
pushToMobileWallet(node_id: any, subnet_id: any, bodyParams?: {}): any;
shipCard(node_id: any, subnet_id: any, bodyParams?: {}): any;
/**
* GET ALL CARD SHIPMENTS
* @param {String} node_id required: id of node belonging to the subnet
* @param {String} subnet_id required: id of card subnet for the card shipments
* @param {Object} queryParams optional: body of post request, can contain page and per_page keys indicating the amount of card shipments returned
*
* @returns Promise
*
*
* [Get Card Shipment Docs]{@link https://docs.synapsefi.com/api-references/shipments/view-all-subnet-shipments}
*/
getAllCardShipments(node_id: string, subnet_id: string, queryParams?: any): any;
/**
* GET A SINGLE CARD SHIPMENT
* @param {String} node_id required: id of node belonging to the subnet
* @param {String} subnet_id required: id of card subnet for the card shipments
* @param {Object} shipment_id requred: id of card shipment
*
* @returns Promise
*
*
* [Get Card Shipment Docs]{@link https://docs.synapsefi.com/api-references/shipments/view-shipment}
*/
getCardShipment(node_id: string, subnet_id: string, shipment_id: any): any;
/**
* DELETE A SINGLE CARD SHIPMENT
* @param {String} node_id required: id of node belonging to the subnet
* @param {String} subnet_id required: id of card subnet for the card shipments
* @param {Object} shipment_id requred: id of card shipment
*
* @returns Promise
*
*
* [Get Card Shipment Docs]{@link https://docs.synapsefi.com/api-references/shipments/cancel-shipment}
*/
deleteCardShipment(node_id: string, subnet_id: string, shipment_id: any): any;
registerNewFingerprint(fp: any): Promise<any>;
supplyDevice2FA(fp: any, device: any): Promise<any>;
verifyFingerprint2FA(fp: any, validation_pin: any): Promise<any>;
updateIpAddress(ip: any): {
'Content-Type': string;
'X-SP-USER-IP': any;
};
}