Compare commits

..

No commits in common. "master" and "v1.0.18" have entirely different histories.

6 changed files with 3003 additions and 1405 deletions

4018
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@mojoio/bunq", "name": "@mojoio/bunq",
"version": "1.0.22", "version": "1.0.18",
"private": false, "private": false,
"description": "a bunq api abstraction package", "description": "a bunq api abstraction package",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -1,6 +1,6 @@
import * as plugins from './bunq.plugins'; import * as plugins from './bunq.plugins';
import * as paths from './bunq.paths'; import * as paths from './bunq.paths';
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount'; import { MonetaryAccount } from './bunq.classes.monetaryaccount';
export interface IBunqConstructorOptions { export interface IBunqConstructorOptions {
deviceName: string; deviceName: string;
@ -92,9 +92,9 @@ export class BunqAccount {
.catch((e) => { .catch((e) => {
console.log(e); console.log(e);
}); });
const accountsArray: BunqMonetaryAccount[] = []; const accountsArray: MonetaryAccount[] = [];
for (const apiAccount of apiMonetaryAccounts) { for (const apiAccount of apiMonetaryAccounts) {
accountsArray.push(BunqMonetaryAccount.fromAPIObject(this, apiAccount)); accountsArray.push(MonetaryAccount.fromAPIObject(this, apiAccount));
} }
return accountsArray; return accountsArray;
} }

View File

@ -1,13 +1,13 @@
import * as plugins from './bunq.plugins'; import * as plugins from './bunq.plugins';
import { BunqAccount } from './bunq.classes.account'; import { BunqAccount } from './bunq.classes.account';
import { BunqTransaction } from './bunq.classes.transaction'; import { Transaction } from './bunq.classes.transaction';
export type TAccountType = 'joint' | 'savings' | 'bank'; export type TAccountType = 'joint' | 'savings' | 'bank';
/** /**
* a monetary account * a monetary account
*/ */
export class BunqMonetaryAccount { export class MonetaryAccount {
public static fromAPIObject(bunqAccountRef: BunqAccount, apiObject: any) { public static fromAPIObject(bunqAccountRef: BunqAccount, apiObject: any) {
const newMonetaryAccount = new this(bunqAccountRef); const newMonetaryAccount = new this(bunqAccountRef);
@ -105,9 +105,9 @@ export class BunqMonetaryAccount {
this.id, this.id,
paginationOptions paginationOptions
); );
const transactionsArray: BunqTransaction[] = []; const transactionsArray: Transaction[] = [];
for (const apiTransaction of apiTransactions) { for (const apiTransaction of apiTransactions) {
transactionsArray.push(BunqTransaction.fromApiObject(this, apiTransaction)); transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));
} }
return transactionsArray; return transactionsArray;
} }

View File

@ -1,8 +1,8 @@
import * as plugins from './bunq.plugins'; import * as plugins from './bunq.plugins';
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount'; import { MonetaryAccount } from './bunq.classes.monetaryaccount';
export class BunqTransaction { export class Transaction {
public static fromApiObject(monetaryAccountRefArg: BunqMonetaryAccount, apiObjectArg: any) { public static fromApiObject(monetaryAccountRefArg: MonetaryAccount, apiObjectArg: any) {
const newTransaction = new this(monetaryAccountRefArg); const newTransaction = new this(monetaryAccountRefArg);
Object.assign(newTransaction, apiObjectArg.Payment); Object.assign(newTransaction, apiObjectArg.Payment);
return newTransaction; return newTransaction;
@ -20,31 +20,7 @@ export class BunqTransaction {
public type: 'MASTERCARD' | 'BUNQ'; public type: 'MASTERCARD' | 'BUNQ';
public merchant_reference: null; public merchant_reference: null;
public alias: [Object]; public alias: [Object];
public counterparty_alias: { public counterparty_alias: [Object];
iban: string,
is_light: any,
display_name: string,
avatar: {
uuid: string,
image: [
{
attachment_public_uuid: string,
height: number,
width: number,
content_type: string,
},
],
anchor_uuid: null,
},
label_user: {
uuid: null,
display_name: string,
country: string,
avatar: null,
public_nick_name: string,
},
country: string,
};
public attachment: []; public attachment: [];
public geolocation: null; public geolocation: null;
public batch_id: null; public batch_id: null;
@ -59,9 +35,9 @@ export class BunqTransaction {
value: string; value: string;
}; };
public monetaryAccountRef: BunqMonetaryAccount; public monetaryAccountRef: MonetaryAccount;
constructor(monetaryAccountRefArg: BunqMonetaryAccount) { constructor(monetaryAccountRefArg: MonetaryAccount) {
this.monetaryAccountRef = monetaryAccountRefArg; this.monetaryAccountRef = monetaryAccountRefArg;
} }
} }

View File

@ -1,3 +1 @@
export * from './bunq.classes.account'; export * from './bunq.classes.account';
export * from './bunq.classes.monetaryaccount';
export * from './bunq.classes.transaction';