Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
5abc4e7976 | |||
58f4855cb6 | |||
c34846c82f | |||
2656f1a9a9 | |||
e63d24eb13 | |||
f0e27bf7c8 | |||
282d2bdf24 | |||
04cb6f042f | |||
423bd22903 | |||
5295bf272e |
@ -19,23 +19,35 @@ mirror:
|
|||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
audit:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --production --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
@ -50,9 +62,7 @@ testStable:
|
|||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
|
||||||
- docker
|
- docker
|
||||||
- priv
|
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
@ -63,9 +73,7 @@ testBuild:
|
|||||||
- npmci command npm run build
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
@ -85,6 +93,8 @@ release:
|
|||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g tslint typescript
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -15,7 +15,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"projectType": {
|
"projectType": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["website", "element", "service", "npm"]
|
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8485
package-lock.json
generated
8485
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/bunq",
|
"name": "@mojoio/bunq",
|
||||||
"version": "1.0.17",
|
"version": "1.0.22",
|
||||||
"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",
|
||||||
@ -13,12 +13,12 @@
|
|||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tstest": "^1.0.33",
|
"@gitzone/tstest": "^1.0.44",
|
||||||
"@pushrocks/qenv": "^4.0.10",
|
"@pushrocks/qenv": "^4.0.10",
|
||||||
"@pushrocks/tapbundle": "^3.2.1",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^14.0.13",
|
"@types/node": "^14.6.0",
|
||||||
"tslint": "^6.1.2",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -39,5 +39,8 @@
|
|||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ Platform support | [ or [contribute monthly](https://lossless.link/contribute). :)
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
@ -9,7 +9,7 @@ let testBunqAccount: bunq.BunqAccount;
|
|||||||
const testBunqOptions: bunq.IBunqConstructorOptions = {
|
const testBunqOptions: bunq.IBunqConstructorOptions = {
|
||||||
apiKey: testQenv.getEnvVarOnDemand('BUNQ_APIKEY'),
|
apiKey: testQenv.getEnvVarOnDemand('BUNQ_APIKEY'),
|
||||||
deviceName: 'mojoiobunqpackage',
|
deviceName: 'mojoiobunqpackage',
|
||||||
environment: 'SANDBOX'
|
environment: 'SANDBOX',
|
||||||
};
|
};
|
||||||
|
|
||||||
tap.test('should create a valid bunq account', async () => {
|
tap.test('should create a valid bunq account', async () => {
|
||||||
|
@ -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 { MonetaryAccount } from './bunq.classes.monetaryaccount';
|
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||||
|
|
||||||
export interface IBunqConstructorOptions {
|
export interface IBunqConstructorOptions {
|
||||||
deviceName: string;
|
deviceName: string;
|
||||||
@ -87,12 +87,14 @@ export class BunqAccount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async getAccounts() {
|
public async getAccounts() {
|
||||||
const apiMonetaryAccounts = await this.bunqJSClient.api.monetaryAccount.list(this.userId, {}).catch(e => {
|
const apiMonetaryAccounts = await this.bunqJSClient.api.monetaryAccount
|
||||||
|
.list(this.userId, {})
|
||||||
|
.catch((e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
});
|
||||||
const accountsArray: MonetaryAccount[] = [];
|
const accountsArray: BunqMonetaryAccount[] = [];
|
||||||
for (const apiAccount of apiMonetaryAccounts) {
|
for (const apiAccount of apiMonetaryAccounts) {
|
||||||
accountsArray.push(MonetaryAccount.fromAPIObject(this, apiAccount));
|
accountsArray.push(BunqMonetaryAccount.fromAPIObject(this, apiAccount));
|
||||||
}
|
}
|
||||||
return accountsArray;
|
return accountsArray;
|
||||||
}
|
}
|
||||||
|
@ -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 { Transaction } from './bunq.classes.transaction';
|
import { BunqTransaction } from './bunq.classes.transaction';
|
||||||
|
|
||||||
export type TAccountType = 'joint' | 'savings' | 'bank';
|
export type TAccountType = 'joint' | 'savings' | 'bank';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a monetary account
|
* a monetary account
|
||||||
*/
|
*/
|
||||||
export class MonetaryAccount {
|
export class BunqMonetaryAccount {
|
||||||
public static fromAPIObject(bunqAccountRef: BunqAccount, apiObject: any) {
|
public static fromAPIObject(bunqAccountRef: BunqAccount, apiObject: any) {
|
||||||
const newMonetaryAccount = new this(bunqAccountRef);
|
const newMonetaryAccount = new this(bunqAccountRef);
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ export class MonetaryAccount {
|
|||||||
older_id?: number | false;
|
older_id?: number | false;
|
||||||
} = {
|
} = {
|
||||||
count: 200,
|
count: 200,
|
||||||
newer_id: startingIdArg
|
newer_id: startingIdArg,
|
||||||
};
|
};
|
||||||
|
|
||||||
const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(
|
const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(
|
||||||
@ -105,9 +105,9 @@ export class MonetaryAccount {
|
|||||||
this.id,
|
this.id,
|
||||||
paginationOptions
|
paginationOptions
|
||||||
);
|
);
|
||||||
const transactionsArray: Transaction[] = [];
|
const transactionsArray: BunqTransaction[] = [];
|
||||||
for (const apiTransaction of apiTransactions) {
|
for (const apiTransaction of apiTransactions) {
|
||||||
transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));
|
transactionsArray.push(BunqTransaction.fromApiObject(this, apiTransaction));
|
||||||
}
|
}
|
||||||
return transactionsArray;
|
return transactionsArray;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import * as plugins from './bunq.plugins';
|
import * as plugins from './bunq.plugins';
|
||||||
import { MonetaryAccount } from './bunq.classes.monetaryaccount';
|
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||||
|
|
||||||
export class Transaction {
|
export class BunqTransaction {
|
||||||
public static fromApiObject(monetaryAccountRefArg: MonetaryAccount, apiObjectArg: any) {
|
public static fromApiObject(monetaryAccountRefArg: BunqMonetaryAccount, 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,7 +20,31 @@ export class Transaction {
|
|||||||
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: [Object];
|
public counterparty_alias: {
|
||||||
|
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;
|
||||||
@ -35,9 +59,9 @@ export class Transaction {
|
|||||||
value: string;
|
value: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
public monetaryAccountRef: MonetaryAccount;
|
public monetaryAccountRef: BunqMonetaryAccount;
|
||||||
|
|
||||||
constructor(monetaryAccountRefArg: MonetaryAccount) {
|
constructor(monetaryAccountRefArg: BunqMonetaryAccount) {
|
||||||
this.monetaryAccountRef = monetaryAccountRefArg;
|
this.monetaryAccountRef = monetaryAccountRefArg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1,3 @@
|
|||||||
export * from './bunq.classes.account';
|
export * from './bunq.classes.account';
|
||||||
|
export * from './bunq.classes.monetaryaccount';
|
||||||
|
export * from './bunq.classes.transaction';
|
Loading…
x
Reference in New Issue
Block a user