fix(core): update

This commit is contained in:
2020-06-20 01:47:53 +00:00
parent 9fbaac20d3
commit 01dbf842e9
13 changed files with 3861 additions and 618 deletions

View File

@ -37,13 +37,17 @@ export class BunqAccount {
await plugins.smartfile.fs.ensureFile(paths.bunqJsonProductionFile, '{}');
await plugins.smartfile.fs.ensureFile(paths.bunqJsonSandboxFile, '{}');
let apiKey: string;
if (this.options.environment === 'SANDBOX') {
this.bunqJSClient = new plugins.bunqCommunityClient.default(plugins.JSONFileStore(paths.bunqJsonSandboxFile));
this.bunqJSClient = new plugins.bunqCommunityClient.default(
plugins.JSONFileStore(paths.bunqJsonSandboxFile)
);
apiKey = await this.bunqJSClient.api.sandboxUser.post();
console.log(apiKey);
} else {
this.bunqJSClient = new plugins.bunqCommunityClient.default(plugins.JSONFileStore(paths.bunqJsonProductionFile));
this.bunqJSClient = new plugins.bunqCommunityClient.default(
plugins.JSONFileStore(paths.bunqJsonProductionFile)
);
apiKey = this.options.apiKey;
}

View File

@ -32,7 +32,7 @@ export class MonetaryAccount {
throw new Error('unknown accoun type');
}
Object.assign(newMonetaryAccount, apiObject[accessor], {type});
Object.assign(newMonetaryAccount, apiObject[accessor], { type });
return newMonetaryAccount;
}
@ -82,7 +82,6 @@ export class MonetaryAccount {
public auto_save_id: null;
public all_auto_save_id: any[];
public bunqAccountRef: BunqAccount;
constructor(bunqAccountRefArg: BunqAccount) {
this.bunqAccountRef = bunqAccountRefArg;
@ -101,9 +100,11 @@ export class MonetaryAccount {
newer_id: startingIdArg
};
const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(this.bunqAccountRef.userId, this.id, paginationOptions);
const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(
this.bunqAccountRef.userId,
this.id,
paginationOptions
);
const transactionsArray: Transaction[] = [];
for (const apiTransaction of apiTransactions) {
transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));

View File

@ -8,7 +8,6 @@ export class Transaction {
return newTransaction;
}
public id: number;
public created: string;
public updated: string;
@ -41,5 +40,4 @@ export class Transaction {
constructor(monetaryAccountRefArg: MonetaryAccount) {
this.monetaryAccountRef = monetaryAccountRefArg;
}
}
}

View File

@ -4,4 +4,4 @@ export const packageDir = plugins.path.join(__dirname, '../');
export const nogitDir = plugins.path.join(packageDir, './.nogit/');
export const bunqJsonProductionFile = plugins.path.join(nogitDir, 'bunqproduction.json');
export const bunqJsonSandboxFile = plugins.path.join(nogitDir, 'bunqsandbox.json');
export const bunqJsonSandboxFile = plugins.path.join(nogitDir, 'bunqsandbox.json');

View File

@ -1,23 +1,17 @@
// node natice
import * as path from 'path';
export {
path
};
export { path };
// @pushrocks scope
import * as smartcrypto from '@pushrocks/smartcrypto';
import * as smartfile from '@pushrocks/smartfile';
import * as smartpromise from '@pushrocks/smartpromise';
export {
smartcrypto,
smartfile,
smartpromise,
};
export { smartcrypto, smartfile, smartpromise };
// third party
import JSONFileStore from "@bunq-community/bunq-js-client/dist/Stores/JSONFileStore";
import JSONFileStore from '@bunq-community/bunq-js-client/dist/Stores/JSONFileStore';
import * as bunqCommunityClient from '@bunq-community/bunq-js-client';
export { JSONFileStore, bunqCommunityClient };