connect-react-native
Advanced tools
Comparing version 1.0.0 to 1.0.2
@@ -30,2 +30,8 @@ "use strict"; | ||
class DapiConnect { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
present(beneficiaryInfo) { | ||
@@ -35,3 +41,3 @@ const isFunction = typeof beneficiaryInfo === 'function'; | ||
if (beneficiaryInfo && isFunction) { | ||
_nativeInterface.default.presentConnect("(".concat(beneficiaryInfo.toString(), ")")); | ||
_nativeInterface.default.presentConnect("(".concat(beneficiaryInfo.toString(), ")"), this._client.configurations); | ||
} else if (!beneficiaryInfo) { | ||
@@ -47,7 +53,7 @@ throw Error('Missing required param: beneficiaryInfo'); | ||
dismiss() { | ||
_nativeInterface.default.dismissConnect(); | ||
_nativeInterface.default.dismissConnect(this._client.configurations); | ||
} | ||
getConnections(callback) { | ||
_nativeInterface.default.getConnections(callback); | ||
_nativeInterface.default.getConnections(this._client.configurations, callback); | ||
} | ||
@@ -58,2 +64,8 @@ | ||
class DapiAutoFlow { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
present(beneficiaryInfo) { | ||
@@ -63,3 +75,3 @@ const isFunction = typeof beneficiaryInfo === 'function'; | ||
if (beneficiaryInfo && isFunction) { | ||
_nativeInterface.default.presentAutoFlow("(".concat(beneficiaryInfo.toString(), ")")); | ||
_nativeInterface.default.presentAutoFlow("(".concat(beneficiaryInfo.toString(), ")"), this._client.configurations); | ||
} else if (!beneficiaryInfo) { | ||
@@ -75,3 +87,3 @@ throw Error('Missing required param: beneficiaryInfo'); | ||
dismiss() { | ||
_nativeInterface.default.dismissAutoFlow(); | ||
_nativeInterface.default.dismissAutoFlow(this._client.configurations); | ||
} | ||
@@ -82,16 +94,22 @@ | ||
class DapiData { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
getIdentity() { | ||
return _nativeInterface.default.getIdentity(); | ||
return _nativeInterface.default.getIdentity(this._client.configurations); | ||
} | ||
getAccounts() { | ||
return _nativeInterface.default.getAccounts(); | ||
return _nativeInterface.default.getAccounts(this._client.configurations); | ||
} | ||
getBalance(accountID) { | ||
return _nativeInterface.default.getBalance(accountID); | ||
return _nativeInterface.default.getBalance(accountID, this._client.configurations); | ||
} | ||
getTransactions(accountID, startDate, endDate) { | ||
return _nativeInterface.default.getTransactions(accountID, startDate.getTime(), endDate.getTime()); | ||
return _nativeInterface.default.getTransactions(accountID, startDate.getTime(), endDate.getTime(), this._client.configurations); | ||
} | ||
@@ -102,4 +120,10 @@ | ||
class DapiAuth { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
delinkUser() { | ||
return _nativeInterface.default.delinkUser(); | ||
return _nativeInterface.default.delinkUser(this._client.configurations); | ||
} | ||
@@ -110,4 +134,10 @@ | ||
class DapiMetadata { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
getAccountsMetadata() { | ||
return _nativeInterface.default.getAccountsMetadata(); | ||
return _nativeInterface.default.getAccountsMetadata(this._client.configurations); | ||
} | ||
@@ -118,20 +148,26 @@ | ||
class DapiPayment { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
getBeneficiaries() { | ||
return _nativeInterface.default.getBeneficiaries(); | ||
return _nativeInterface.default.getBeneficiaries(this._client.configurations); | ||
} | ||
createBeneficiary(beneficiaryRequestData) { | ||
return _nativeInterface.default.createBeneficiary(beneficiaryRequestData); | ||
return _nativeInterface.default.createBeneficiary(beneficiaryRequestData, this._client.configurations); | ||
} | ||
createTransferToIban(iban, name, senderID, amount, remark) { | ||
return _nativeInterface.default.createTransferToIban(iban, name, senderID, amount, remark); | ||
return _nativeInterface.default.createTransferToIban(iban, name, senderID, amount, remark, this._client.configurations); | ||
} | ||
createTransferToReceiverID(receiverID, senderID, amount, remark) { | ||
return _nativeInterface.default.createTransferToReceiverID(receiverID, senderID, amount, remark); | ||
return _nativeInterface.default.createTransferToReceiverID(receiverID, senderID, amount, remark, this._client.configurations); | ||
} | ||
createTransferToAccountNumber(accountNumber, name, senderID, amount, remark) { | ||
return _nativeInterface.default.createTransferToAccountNumber(accountNumber, name, senderID, amount, remark); | ||
return _nativeInterface.default.createTransferToAccountNumber(accountNumber, name, senderID, amount, remark, this._client.configurations); | ||
} | ||
@@ -142,6 +178,2 @@ | ||
class DapiClient { | ||
static get allConfigurations() { | ||
return DapiClient._allConfigurations; | ||
} | ||
get connect() { | ||
@@ -176,13 +208,13 @@ return this._connect; | ||
constructor(configurations) { | ||
_defineProperty(this, "_connect", new DapiConnect()); | ||
_defineProperty(this, "_connect", new DapiConnect(this)); | ||
_defineProperty(this, "_autoFlow", new DapiAutoFlow()); | ||
_defineProperty(this, "_autoFlow", new DapiAutoFlow(this)); | ||
_defineProperty(this, "_data", new DapiData()); | ||
_defineProperty(this, "_data", new DapiData(this)); | ||
_defineProperty(this, "_auth", new DapiAuth()); | ||
_defineProperty(this, "_auth", new DapiAuth(this)); | ||
_defineProperty(this, "_metadata", new DapiMetadata()); | ||
_defineProperty(this, "_metadata", new DapiMetadata(this)); | ||
_defineProperty(this, "_payment", new DapiPayment()); | ||
_defineProperty(this, "_payment", new DapiPayment(this)); | ||
@@ -200,4 +232,2 @@ _defineProperty(this, "_configurations", void 0); | ||
_nativeInterface.default.newClientWithConfigurations(configurations); | ||
DapiClient._allConfigurations.push(configurations); | ||
} | ||
@@ -221,15 +251,15 @@ | ||
setUserID(userID) { | ||
_nativeInterface.default.setUserID(userID); | ||
_nativeInterface.default.setUserID(userID, this._configurations); | ||
} | ||
userID(callback) { | ||
_nativeInterface.default.userID(callback); | ||
_nativeInterface.default.userID(this._configurations, callback); | ||
} | ||
setClientUserID(clientUserID) { | ||
_nativeInterface.default.setClientUserID(clientUserID); | ||
_nativeInterface.default.setClientUserID(clientUserID, this._configurations); | ||
} | ||
clientUserID(callback) { | ||
_nativeInterface.default.clientUserID(callback); | ||
_nativeInterface.default.clientUserID(this._configurations, callback); | ||
} | ||
@@ -239,6 +269,4 @@ | ||
_defineProperty(DapiClient, "_allConfigurations", []); | ||
var _default = DapiClient; | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
@@ -14,2 +14,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
class DapiConnect { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
present(beneficiaryInfo) { | ||
@@ -19,3 +25,3 @@ const isFunction = typeof beneficiaryInfo === 'function'; | ||
if (beneficiaryInfo && isFunction) { | ||
NativeInterface.presentConnect("(".concat(beneficiaryInfo.toString(), ")")); | ||
NativeInterface.presentConnect("(".concat(beneficiaryInfo.toString(), ")"), this._client.configurations); | ||
} else if (!beneficiaryInfo) { | ||
@@ -31,7 +37,7 @@ throw Error('Missing required param: beneficiaryInfo'); | ||
dismiss() { | ||
NativeInterface.dismissConnect(); | ||
NativeInterface.dismissConnect(this._client.configurations); | ||
} | ||
getConnections(callback) { | ||
NativeInterface.getConnections(callback); | ||
NativeInterface.getConnections(this._client.configurations, callback); | ||
} | ||
@@ -42,2 +48,8 @@ | ||
class DapiAutoFlow { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
present(beneficiaryInfo) { | ||
@@ -47,3 +59,3 @@ const isFunction = typeof beneficiaryInfo === 'function'; | ||
if (beneficiaryInfo && isFunction) { | ||
NativeInterface.presentAutoFlow("(".concat(beneficiaryInfo.toString(), ")")); | ||
NativeInterface.presentAutoFlow("(".concat(beneficiaryInfo.toString(), ")"), this._client.configurations); | ||
} else if (!beneficiaryInfo) { | ||
@@ -59,3 +71,3 @@ throw Error('Missing required param: beneficiaryInfo'); | ||
dismiss() { | ||
NativeInterface.dismissAutoFlow(); | ||
NativeInterface.dismissAutoFlow(this._client.configurations); | ||
} | ||
@@ -66,16 +78,22 @@ | ||
class DapiData { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
getIdentity() { | ||
return NativeInterface.getIdentity(); | ||
return NativeInterface.getIdentity(this._client.configurations); | ||
} | ||
getAccounts() { | ||
return NativeInterface.getAccounts(); | ||
return NativeInterface.getAccounts(this._client.configurations); | ||
} | ||
getBalance(accountID) { | ||
return NativeInterface.getBalance(accountID); | ||
return NativeInterface.getBalance(accountID, this._client.configurations); | ||
} | ||
getTransactions(accountID, startDate, endDate) { | ||
return NativeInterface.getTransactions(accountID, startDate.getTime(), endDate.getTime()); | ||
return NativeInterface.getTransactions(accountID, startDate.getTime(), endDate.getTime(), this._client.configurations); | ||
} | ||
@@ -86,4 +104,10 @@ | ||
class DapiAuth { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
delinkUser() { | ||
return NativeInterface.delinkUser(); | ||
return NativeInterface.delinkUser(this._client.configurations); | ||
} | ||
@@ -94,4 +118,10 @@ | ||
class DapiMetadata { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
getAccountsMetadata() { | ||
return NativeInterface.getAccountsMetadata(); | ||
return NativeInterface.getAccountsMetadata(this._client.configurations); | ||
} | ||
@@ -102,20 +132,26 @@ | ||
class DapiPayment { | ||
constructor(client) { | ||
_defineProperty(this, "_client", void 0); | ||
this._client = client; | ||
} | ||
getBeneficiaries() { | ||
return NativeInterface.getBeneficiaries(); | ||
return NativeInterface.getBeneficiaries(this._client.configurations); | ||
} | ||
createBeneficiary(beneficiaryRequestData) { | ||
return NativeInterface.createBeneficiary(beneficiaryRequestData); | ||
return NativeInterface.createBeneficiary(beneficiaryRequestData, this._client.configurations); | ||
} | ||
createTransferToIban(iban, name, senderID, amount, remark) { | ||
return NativeInterface.createTransferToIban(iban, name, senderID, amount, remark); | ||
return NativeInterface.createTransferToIban(iban, name, senderID, amount, remark, this._client.configurations); | ||
} | ||
createTransferToReceiverID(receiverID, senderID, amount, remark) { | ||
return NativeInterface.createTransferToReceiverID(receiverID, senderID, amount, remark); | ||
return NativeInterface.createTransferToReceiverID(receiverID, senderID, amount, remark, this._client.configurations); | ||
} | ||
createTransferToAccountNumber(accountNumber, name, senderID, amount, remark) { | ||
return NativeInterface.createTransferToAccountNumber(accountNumber, name, senderID, amount, remark); | ||
return NativeInterface.createTransferToAccountNumber(accountNumber, name, senderID, amount, remark, this._client.configurations); | ||
} | ||
@@ -126,6 +162,2 @@ | ||
class DapiClient { | ||
static get allConfigurations() { | ||
return DapiClient._allConfigurations; | ||
} | ||
get connect() { | ||
@@ -160,13 +192,13 @@ return this._connect; | ||
constructor(configurations) { | ||
_defineProperty(this, "_connect", new DapiConnect()); | ||
_defineProperty(this, "_connect", new DapiConnect(this)); | ||
_defineProperty(this, "_autoFlow", new DapiAutoFlow()); | ||
_defineProperty(this, "_autoFlow", new DapiAutoFlow(this)); | ||
_defineProperty(this, "_data", new DapiData()); | ||
_defineProperty(this, "_data", new DapiData(this)); | ||
_defineProperty(this, "_auth", new DapiAuth()); | ||
_defineProperty(this, "_auth", new DapiAuth(this)); | ||
_defineProperty(this, "_metadata", new DapiMetadata()); | ||
_defineProperty(this, "_metadata", new DapiMetadata(this)); | ||
_defineProperty(this, "_payment", new DapiPayment()); | ||
_defineProperty(this, "_payment", new DapiPayment(this)); | ||
@@ -183,4 +215,2 @@ _defineProperty(this, "_configurations", void 0); | ||
NativeInterface.newClientWithConfigurations(configurations); | ||
DapiClient._allConfigurations.push(configurations); | ||
} | ||
@@ -204,15 +234,15 @@ | ||
setUserID(userID) { | ||
NativeInterface.setUserID(userID); | ||
NativeInterface.setUserID(userID, this._configurations); | ||
} | ||
userID(callback) { | ||
NativeInterface.userID(callback); | ||
NativeInterface.userID(this._configurations, callback); | ||
} | ||
setClientUserID(clientUserID) { | ||
NativeInterface.setClientUserID(clientUserID); | ||
NativeInterface.setClientUserID(clientUserID, this._configurations); | ||
} | ||
clientUserID(callback) { | ||
NativeInterface.clientUserID(callback); | ||
NativeInterface.clientUserID(this._configurations, callback); | ||
} | ||
@@ -222,6 +252,4 @@ | ||
_defineProperty(DapiClient, "_allConfigurations", []); | ||
export default DapiClient; | ||
export * from './internal/types'; | ||
//# sourceMappingURL=index.js.map |
@@ -11,2 +11,4 @@ /** | ||
declare class DapiConnect { | ||
private _client; | ||
constructor(client: DapiClient); | ||
present(beneficiaryInfo: BeneficiaryInfoCallback): void; | ||
@@ -17,2 +19,4 @@ dismiss(): void; | ||
declare class DapiAutoFlow { | ||
private _client; | ||
constructor(client: DapiClient); | ||
present(beneficiaryInfo: BeneficiaryInfoCallback): void; | ||
@@ -22,2 +26,4 @@ dismiss(): void; | ||
declare class DapiData { | ||
private _client; | ||
constructor(client: DapiClient); | ||
getIdentity(): Promise<IIdentity>; | ||
@@ -29,8 +35,14 @@ getAccounts(): Promise<IAccount[]>; | ||
declare class DapiAuth { | ||
private _client; | ||
constructor(client: DapiClient); | ||
delinkUser(): Promise<any>; | ||
} | ||
declare class DapiMetadata { | ||
private _client; | ||
constructor(client: DapiClient); | ||
getAccountsMetadata(): Promise<IAccountsMetadata>; | ||
} | ||
declare class DapiPayment { | ||
private _client; | ||
constructor(client: DapiClient); | ||
getBeneficiaries(): Promise<IBeneficiary[]>; | ||
@@ -43,4 +55,2 @@ createBeneficiary(beneficiaryRequestData: ICreateBeneficiaryRequestData): Promise<IBeneficiary>; | ||
declare class DapiClient { | ||
private static _allConfigurations; | ||
static get allConfigurations(): IDapiConfigurations[]; | ||
private _connect; | ||
@@ -47,0 +57,0 @@ private _autoFlow; |
@@ -12,22 +12,22 @@ /** | ||
newClientWithConfigurations(configs: IDapiConfigurations): void; | ||
setUserID(userID: string): void; | ||
userID(callback: any): void; | ||
setClientUserID(clientUserID: string): void; | ||
clientUserID(callback: any): void; | ||
presentConnect(beneficiaryInfo: string): void; | ||
dismissConnect(): void; | ||
getConnections(callback: any): void; | ||
presentAutoFlow(beneficiaryInfo: string): void; | ||
dismissAutoFlow(): void; | ||
getIdentity(): Promise<IIdentity>; | ||
getAccounts(): Promise<IAccount[]>; | ||
getBalance(accountID: string): Promise<IBalance>; | ||
getTransactions(accountID: string, startDateMilliseconds: number, endDateMilliseconds: number): Promise<ITransaction[]>; | ||
delinkUser(): Promise<any>; | ||
getAccountsMetadata(): Promise<IAccountsMetadata>; | ||
getBeneficiaries(): Promise<IBeneficiary[]>; | ||
createBeneficiary(beneficiaryRequestData: ICreateBeneficiaryRequestData): Promise<IBeneficiary>; | ||
createTransferToIban(iban: string, name: string, senderID: string, amount: number, remark: string): Promise<any>; | ||
createTransferToReceiverID(receiverID: string, senderID: string, amount: number, remark: string): Promise<any>; | ||
createTransferToAccountNumber(accountNumber: string, name: string, senderID: string, amount: number, remark: string): Promise<any>; | ||
setUserID(userID: string, configs: IDapiConfigurations): void; | ||
userID(configs: IDapiConfigurations, callback: any): void; | ||
setClientUserID(clientUserID: string, configs: IDapiConfigurations): void; | ||
clientUserID(configs: IDapiConfigurations, callback: any): void; | ||
presentConnect(beneficiaryInfo: string, configs: IDapiConfigurations): void; | ||
dismissConnect(configs: IDapiConfigurations): void; | ||
getConnections(configs: IDapiConfigurations, callback: any): void; | ||
presentAutoFlow(beneficiaryInfo: string, configs: IDapiConfigurations): void; | ||
dismissAutoFlow(configs: IDapiConfigurations): void; | ||
getIdentity(configs: IDapiConfigurations): Promise<IIdentity>; | ||
getAccounts(configs: IDapiConfigurations): Promise<IAccount[]>; | ||
getBalance(accountID: string, configs: IDapiConfigurations): Promise<IBalance>; | ||
getTransactions(accountID: string, startDateMilliseconds: number, endDateMilliseconds: number, configs: IDapiConfigurations): Promise<ITransaction[]>; | ||
delinkUser(configs: IDapiConfigurations): Promise<any>; | ||
getAccountsMetadata(configs: IDapiConfigurations): Promise<IAccountsMetadata>; | ||
getBeneficiaries(configs: IDapiConfigurations): Promise<IBeneficiary[]>; | ||
createBeneficiary(beneficiaryRequestData: ICreateBeneficiaryRequestData, configs: IDapiConfigurations): Promise<IBeneficiary>; | ||
createTransferToIban(iban: string, name: string, senderID: string, amount: number, remark: string, configs: IDapiConfigurations): Promise<any>; | ||
createTransferToReceiverID(receiverID: string, senderID: string, amount: number, remark: string, configs: IDapiConfigurations): Promise<any>; | ||
createTransferToAccountNumber(accountNumber: string, name: string, senderID: string, amount: number, remark: string, configs: IDapiConfigurations): Promise<any>; | ||
} |
@@ -45,3 +45,3 @@ /** | ||
export interface IBeneficiaryInfo { | ||
lineAddress: ILineAddress; | ||
linesAddress: ILineAddress; | ||
accountNumber: string; | ||
@@ -111,7 +111,7 @@ name: string; | ||
dateOfBirth: Date; | ||
numbers: Array<IPhoneNumber>; | ||
numbers: IPhoneNumber[]; | ||
emailAddress: string; | ||
name: string; | ||
address: IAddress; | ||
identification: Array<IIdentification>; | ||
identification: IIdentification[]; | ||
} | ||
@@ -156,3 +156,3 @@ export interface IBalance { | ||
address: ILineAddress; | ||
transferBounds: Array<ITransferBounds>; | ||
transferBounds: ITransferBounds[]; | ||
beneficiaryCoolDownPeriod: { | ||
@@ -159,0 +159,0 @@ value: number; |
{ | ||
"name": "connect-react-native", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"description": "Financial APIs to connect users' bank accounts", | ||
@@ -40,3 +40,2 @@ "react-native": "src/index.ts", | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -43,0 +42,0 @@ "@babel/core": "^7.4.5", |
@@ -24,6 +24,11 @@ /** | ||
class DapiConnect { | ||
private _client : DapiClient; | ||
constructor(client : DapiClient){ | ||
this._client = client; | ||
} | ||
present(beneficiaryInfo: BeneficiaryInfoCallback): void { | ||
const isFunction = typeof beneficiaryInfo === 'function'; | ||
if (beneficiaryInfo && isFunction) { | ||
NativeInterface.presentConnect(`(${beneficiaryInfo.toString()})`); | ||
NativeInterface.presentConnect(`(${beneficiaryInfo.toString()})`, this._client.configurations); | ||
} else if (!beneficiaryInfo) { | ||
@@ -41,7 +46,7 @@ throw Error('Missing required param: beneficiaryInfo'); | ||
dismiss(): void { | ||
NativeInterface.dismissConnect(); | ||
NativeInterface.dismissConnect(this._client.configurations); | ||
} | ||
getConnections(callback: any): void { | ||
NativeInterface.getConnections(callback); | ||
NativeInterface.getConnections(this._client.configurations, callback); | ||
} | ||
@@ -51,6 +56,11 @@ } | ||
class DapiAutoFlow { | ||
private _client : DapiClient; | ||
constructor(client : DapiClient){ | ||
this._client = client; | ||
} | ||
present(beneficiaryInfo: BeneficiaryInfoCallback): void { | ||
const isFunction = typeof beneficiaryInfo === 'function'; | ||
if (beneficiaryInfo && isFunction) { | ||
NativeInterface.presentAutoFlow(`(${beneficiaryInfo.toString()})`); | ||
NativeInterface.presentAutoFlow(`(${beneficiaryInfo.toString()})`, this._client.configurations); | ||
} else if (!beneficiaryInfo) { | ||
@@ -68,3 +78,3 @@ throw Error('Missing required param: beneficiaryInfo'); | ||
dismiss(): void { | ||
NativeInterface.dismissAutoFlow(); | ||
NativeInterface.dismissAutoFlow(this._client.configurations); | ||
} | ||
@@ -74,12 +84,17 @@ } | ||
class DapiData { | ||
private _client : DapiClient; | ||
constructor(client : DapiClient){ | ||
this._client = client; | ||
} | ||
getIdentity(): Promise<IIdentity> { | ||
return NativeInterface.getIdentity(); | ||
return NativeInterface.getIdentity(this._client.configurations); | ||
} | ||
getAccounts(): Promise<IAccount[]> { | ||
return NativeInterface.getAccounts(); | ||
return NativeInterface.getAccounts(this._client.configurations); | ||
} | ||
getBalance(accountID: string): Promise<IBalance> { | ||
return NativeInterface.getBalance(accountID); | ||
return NativeInterface.getBalance(accountID, this._client.configurations); | ||
} | ||
@@ -96,2 +111,3 @@ | ||
endDate.getTime(), | ||
this._client.configurations | ||
); | ||
@@ -102,4 +118,9 @@ } | ||
class DapiAuth { | ||
private _client : DapiClient; | ||
constructor(client : DapiClient){ | ||
this._client = client; | ||
} | ||
delinkUser(): Promise<any> { | ||
return NativeInterface.delinkUser(); | ||
return NativeInterface.delinkUser(this._client.configurations); | ||
} | ||
@@ -109,4 +130,9 @@ } | ||
class DapiMetadata { | ||
private _client : DapiClient; | ||
constructor(client : DapiClient){ | ||
this._client = client; | ||
} | ||
getAccountsMetadata(): Promise<IAccountsMetadata> { | ||
return NativeInterface.getAccountsMetadata(); | ||
return NativeInterface.getAccountsMetadata(this._client.configurations); | ||
} | ||
@@ -116,4 +142,9 @@ } | ||
class DapiPayment { | ||
private _client : DapiClient; | ||
constructor(client : DapiClient){ | ||
this._client = client; | ||
} | ||
getBeneficiaries(): Promise<IBeneficiary[]> { | ||
return NativeInterface.getBeneficiaries(); | ||
return NativeInterface.getBeneficiaries(this._client.configurations); | ||
} | ||
@@ -124,3 +155,3 @@ | ||
): Promise<IBeneficiary> { | ||
return NativeInterface.createBeneficiary(beneficiaryRequestData); | ||
return NativeInterface.createBeneficiary(beneficiaryRequestData, this._client.configurations); | ||
} | ||
@@ -141,2 +172,3 @@ | ||
remark, | ||
this._client.configurations | ||
); | ||
@@ -155,2 +187,3 @@ } | ||
remark, | ||
this._client.configurations | ||
); | ||
@@ -172,2 +205,3 @@ } | ||
remark, | ||
this._client.configurations | ||
); | ||
@@ -178,14 +212,8 @@ } | ||
class DapiClient { | ||
private static _allConfigurations: IDapiConfigurations[] = []; | ||
static get allConfigurations() { | ||
return DapiClient._allConfigurations; | ||
} | ||
private _connect = new DapiConnect(); | ||
private _autoFlow = new DapiAutoFlow(); | ||
private _data = new DapiData(); | ||
private _auth = new DapiAuth(); | ||
private _metadata = new DapiMetadata(); | ||
private _payment = new DapiPayment(); | ||
private _connect = new DapiConnect(this); | ||
private _autoFlow = new DapiAutoFlow(this); | ||
private _data = new DapiData(this); | ||
private _auth = new DapiAuth(this); | ||
private _metadata = new DapiMetadata(this); | ||
private _payment = new DapiPayment(this); | ||
private _configurations: IDapiConfigurations; | ||
@@ -222,3 +250,2 @@ | ||
NativeInterface.newClientWithConfigurations(configurations); | ||
DapiClient._allConfigurations.push(configurations); | ||
} | ||
@@ -251,15 +278,15 @@ | ||
setUserID(userID: string): void { | ||
NativeInterface.setUserID(userID); | ||
NativeInterface.setUserID(userID, this._configurations); | ||
} | ||
userID(callback: any): void { | ||
NativeInterface.userID(callback); | ||
NativeInterface.userID(this._configurations, callback); | ||
} | ||
setClientUserID(clientUserID: string): void { | ||
NativeInterface.setClientUserID(clientUserID); | ||
NativeInterface.setClientUserID(clientUserID, this._configurations); | ||
} | ||
clientUserID(callback: any): void { | ||
NativeInterface.clientUserID(callback); | ||
NativeInterface.clientUserID(this._configurations, callback); | ||
} | ||
@@ -266,0 +293,0 @@ } |
@@ -23,17 +23,17 @@ /** | ||
newClientWithConfigurations(configs: IDapiConfigurations): void; | ||
setUserID(userID: string): void; | ||
userID(callback: any): void; | ||
setClientUserID(clientUserID: string): void; | ||
clientUserID(callback: any): void; | ||
setUserID(userID: string, configs: IDapiConfigurations): void; | ||
userID(configs: IDapiConfigurations, callback: any): void; | ||
setClientUserID(clientUserID: string, configs: IDapiConfigurations): void; | ||
clientUserID(configs: IDapiConfigurations, callback: any): void; | ||
// connect | ||
presentConnect(beneficiaryInfo: string): void; // caller needs to convert the callback function to string, so we can pass it to native components | ||
dismissConnect(): void; | ||
getConnections(callback: any): void; | ||
presentConnect(beneficiaryInfo: string, configs: IDapiConfigurations): void; // caller needs to convert the callback function to string, so we can pass it to native components | ||
dismissConnect(configs: IDapiConfigurations): void; | ||
getConnections(configs: IDapiConfigurations, callback: any): void; | ||
// autoflow | ||
presentAutoFlow(beneficiaryInfo: string): void; // caller needs to convert the callback function to string, so we can pass it to native components | ||
dismissAutoFlow(): void; | ||
presentAutoFlow(beneficiaryInfo: string, configs: IDapiConfigurations): void; // caller needs to convert the callback function to string, so we can pass it to native components | ||
dismissAutoFlow(configs: IDapiConfigurations): void; | ||
// data | ||
getIdentity(): Promise<IIdentity>; | ||
getAccounts(): Promise<IAccount[]>; | ||
getBalance(accountID: string): Promise<IBalance>; | ||
getIdentity(configs: IDapiConfigurations): Promise<IIdentity>; | ||
getAccounts(configs: IDapiConfigurations): Promise<IAccount[]>; | ||
getBalance(accountID: string, configs: IDapiConfigurations): Promise<IBalance>; | ||
getTransactions( | ||
@@ -43,11 +43,13 @@ accountID: string, | ||
endDateMilliseconds: number, | ||
configs: IDapiConfigurations | ||
): Promise<ITransaction[]>; | ||
// auth | ||
delinkUser(): Promise<any>; | ||
delinkUser(configs: IDapiConfigurations): Promise<any>; | ||
// metadata | ||
getAccountsMetadata(): Promise<IAccountsMetadata>; | ||
getAccountsMetadata(configs: IDapiConfigurations): Promise<IAccountsMetadata>; | ||
// payment | ||
getBeneficiaries(): Promise<IBeneficiary[]>; | ||
getBeneficiaries(configs: IDapiConfigurations): Promise<IBeneficiary[]>; | ||
createBeneficiary( | ||
beneficiaryRequestData: ICreateBeneficiaryRequestData, | ||
configs: IDapiConfigurations | ||
): Promise<IBeneficiary>; | ||
@@ -60,2 +62,3 @@ createTransferToIban( | ||
remark: string, | ||
configs: IDapiConfigurations | ||
): Promise<any>; | ||
@@ -67,2 +70,3 @@ createTransferToReceiverID( | ||
remark: string, | ||
configs: IDapiConfigurations | ||
): Promise<any>; | ||
@@ -76,3 +80,4 @@ | ||
remark: string, | ||
configs: IDapiConfigurations | ||
): Promise<any>; | ||
} |
@@ -50,3 +50,3 @@ /** | ||
export interface IBeneficiaryInfo { | ||
lineAddress: ILineAddress; | ||
linesAddress: ILineAddress; | ||
accountNumber: string; | ||
@@ -74,14 +74,14 @@ name: string; | ||
interface IPair { | ||
code: string | ||
name: string | ||
code: string; | ||
name: string; | ||
} | ||
export interface IAccount { | ||
iban: string | null | ||
number: string | null | ||
currency: IPair | ||
type: AccountType | ||
id: string | ||
isFavourite: boolean | null | ||
name: string | ||
iban: string | null; | ||
number: string | null; | ||
currency: IPair; | ||
type: AccountType; | ||
id: string; | ||
isFavourite: boolean | null; | ||
name: string; | ||
} | ||
@@ -96,4 +96,4 @@ | ||
interface IIdentification { | ||
type: IDType | ||
value: string | ||
type: IDType; | ||
value: string; | ||
} | ||
@@ -105,36 +105,35 @@ | ||
OFFICE = 'office', | ||
FAX = 'fax' | ||
FAX = 'fax', | ||
} | ||
interface IPhoneNumber { | ||
type: PhoneNumberType | ||
value: string //Change to Mobile Value string ie IPhoneNumberValue | ||
type: PhoneNumberType; | ||
value: string; //Change to Mobile Value string ie IPhoneNumberValue | ||
} | ||
interface IAddressGeneral { | ||
flat: string | ||
building: string | ||
full: string | ||
area: string | ||
poBox: string | ||
city: string | ||
state: string | ||
country: string | ||
flat: string; | ||
building: string; | ||
full: string; | ||
area: string; | ||
poBox: string; | ||
city: string; | ||
state: string; | ||
country: string; | ||
} | ||
export interface IIdentity { | ||
nationality: string | ||
dateOfBirth: Date | ||
numbers: Array<IPhoneNumber> | ||
emailAddress: string | ||
name: string | ||
address: IAddress | ||
identification: Array<IIdentification> | ||
nationality: string; | ||
dateOfBirth: Date; | ||
numbers: IPhoneNumber[]; | ||
emailAddress: string; | ||
name: string; | ||
address: IAddress; | ||
identification: IIdentification[]; | ||
} | ||
export interface IBalance { | ||
amount: number | ||
currency: IPair | ||
accountNumber: string | ||
amount: number; | ||
currency: IPair; | ||
accountNumber: string; | ||
} | ||
@@ -148,11 +147,11 @@ | ||
export interface ITransaction { | ||
amount: number | ||
date: Date | ||
type: TransactionType | ||
description: string | null | ||
details: string | null | ||
currency: IPair | ||
beforeAmount: number | null | ||
afterAmount: number | null | ||
reference?: string | null | ||
amount: number; | ||
date: Date; | ||
type: TransactionType; | ||
description: string | null; | ||
details: string | null; | ||
currency: IPair; | ||
beforeAmount: number | null; | ||
afterAmount: number | null; | ||
reference?: string | null; | ||
} | ||
@@ -168,27 +167,27 @@ | ||
interface ITransferBounds { | ||
minimum: number | ||
currency: IPair | ||
type: BeneficiaryType | ||
minimum: number; | ||
currency: IPair; | ||
type: BeneficiaryType; | ||
} | ||
export interface IAccountsMetadata { | ||
swiftCode: string | ||
sortCode: string | null | ||
bankName: string | ||
branchName: string | ||
branchAddress: string | ||
address: ILineAddress | ||
transferBounds: Array<ITransferBounds> | ||
swiftCode: string; | ||
sortCode: string | null; | ||
bankName: string; | ||
branchName: string; | ||
branchAddress: string; | ||
address: ILineAddress; | ||
transferBounds: ITransferBounds[]; | ||
beneficiaryCoolDownPeriod: { | ||
value: number | ||
unit: 'hrs' | ||
} | ||
value: number; | ||
unit: 'hrs'; | ||
}; | ||
transactionRange: { | ||
unit: 'days' | ||
value: number | ||
} | ||
country: IPair | ||
isCreateBeneficiaryEndpointRequired: boolean | ||
willNewlyAddedBeneficiaryExistBeforeCoolDownPeriod: boolean | ||
routingNumber?: string // for US | ||
unit: 'days'; | ||
value: number; | ||
}; | ||
country: IPair; | ||
isCreateBeneficiaryEndpointRequired: boolean; | ||
willNewlyAddedBeneficiaryExistBeforeCoolDownPeriod: boolean; | ||
routingNumber?: string; // for US | ||
} | ||
@@ -205,25 +204,25 @@ | ||
export interface IBeneficiary { | ||
name: string | ||
iban: string | ||
accountNumber: string | ||
status: BeneficiaryStatus | ||
type: BeneficiaryType | ||
id: string | ||
name: string; | ||
iban: string; | ||
accountNumber: string; | ||
status: BeneficiaryStatus; | ||
type: BeneficiaryType; | ||
id: string; | ||
} | ||
export interface ICreateBeneficiaryRequestData { | ||
address: ILineAddress | ||
country: string | ||
branchAddress: string | ||
branchName: string | ||
phoneNumber: string | ||
iban: string | ||
swiftCode: string | ||
bankName: string | ||
name: string | ||
accountNumber: string | ||
address: ILineAddress; | ||
country: string; | ||
branchAddress: string; | ||
branchName: string; | ||
phoneNumber: string; | ||
iban: string; | ||
swiftCode: string; | ||
bankName: string; | ||
name: string; | ||
accountNumber: string; | ||
} | ||
export type IAddress = IAddressGeneral | ||
export type IAddress = IAddressGeneral; | ||
export type BeneficiaryInfoCallback = (bankID: string) => IBeneficiaryInfo; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2668341
123
2255
1