nordigen / nordigen-node Goto Github PK
View Code? Open in Web Editor NEWNode.js library for the Nordigen API.
License: MIT License
Node.js library for the Nordigen API.
License: MIT License
Is your feature request related to a problem? Please describe.
Migrate the repo to TypeScript and benefits of all its advantages (I noticed the types are currently wrong)
Describe the solution you'd like
Migrate the repo to TypeScript
Describe alternatives you've considered
None
Additional context
I'm opened to do that migration
Describe the bug
Transactions are not ordered in the correct order on the same day when compared to the bank statement list.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Transactions should always be ordered in the exact same order as in the bank statement list.
The optional parameters dateFrom and dateTo have no effect in account.getTransactions function.
Steps to reproduce the behavior:
The response should return only the transactions which match the defined date range.
I will open a pull request, it was due to a misspelled variable.
Describe the bug
While trying around with the module, I found out that compiling from typescript is throwing an error with the code from the examples.
Errors:
$ npx tsc
node_modules/nordigen-node/dist/types/api/account.d.ts:53:48 - error TS2339: Property 'country' does not exist on type '{ dateFrom: string; dateTo: string; }'.
53 getPremiumTransactions({ dateFrom, dateTo, country }?: {
~~~~~~~
node_modules/nordigen-node/dist/types/index.d.ts:8:40 - error TS2339: Property 'baseUrl' does not exist on type '{ secretId: string; secretKey: string; }'.
8 constructor({ secretId, secretKey, baseUrl, }: {
~~~~~~~
Found 2 errors in 2 files.
Errors Files
1 node_modules/nordigen-node/dist/types/api/account.d.ts:53
1 node_modules/nordigen-node/dist/types/index.d.ts:8
To Reproduce
Implement that code in your app:
let client = new NordigenClient({
secretId: 'censored',
secretKey: 'censored'
});
await client.generateToken();
let inst = await client.institution.getInstitutions({ country: 'LV' });
console.log(inst);
Then let typescript compile.
tsconfig.json:
{
"compilerOptions": {
"module": "ES6",
"esModuleInterop": true,
"target": "ES6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"strict": true,
"typeRoots": [
"node_modules/@types"
],
"forceConsistentCasingInFileNames": true
},
"lib": [ "esnext", "dom", "dom.iterable" ]
}
Expected behavior
Building should be successful.
Additional context
Running with nodemon and ts-node is working as expected.
Describe the bug
A clear and concise description of what the bug is.
In v1.1.1 -->
const init = await client.initSession({
redirectUrl: REDIRECT_URI,
institutionId: institutionId,
referenceId: randomUUID()
})
this would work
but not in v.1.2.4
because we do have not the following required params:
initSession({ redirectUrl, institutionId, maxHistoricalDays, accessValidForDays, userLanguage, referenceId, ssn, redirectImmediate, accountSelection, }: {
redirectUrl: string;
institutionId: string;
referenceId: string;
maxHistoricalDays: number;
accessValidForDays: number;
userLanguage: string;
ssn: string;
redirectImmediate: boolean;
accountSelection: boolean;
}): Promise<any>;
so please either update the docs or tell us how to integrate that with the new nordigen version... <3
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
If you're having general trouble with your Nordigen integration or bank related issue, please reach out to our support via email [email protected]
Right now, you can get account balance only for the current day AFAIK.
Ok solution would be to add date
parameter to API call.
The best solution would be to add date-range like dateFrom
and dateTo
for which the API would return balances for each day.
The only workaround I can think of is to get todays balance + transactions from today to that specific day and add/subtract each transaction from the current balance however that's not really a great solution, especially if the specific day is far from today.
Describe the bug
When calling the createRequisition()
method, the server returns status 400 with the following error: Unknown fields {'accountSelection'} in payload
To Reproduce
Steps to reproduce the behavior:
createRequisition()
and specify accountSelection: true
in the input{
summary: 'Unknown fields',
detail: "Unknown fields {'accountSelection'} in payload",
status_code: 400
}
Expected behavior
Server returns status code 200 and creates a new requisition
Additional context
This might be a typo in the client source code as it sends the parameter as accountSelection
but according to the API documentation, the parameter is defined as account_selection
.
redirectImmediate
might be susceptible to the same error (untested).
Is it possible to subscribe to new bank accounts and transactions as they are created? I'm making a budgeting app and I think it would be nice if my budget could update in realtime according to transactions/accounts as they happen.
I am using latest stable node version i.e 16.14.2, I get below mentioned error on compiling the code.
const nordigen_node_1 = require("nordigen-node");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/polyscripts/polyscripts/payments-backend/node_modules/nordigen-node/lib/index.js from /home/../dist/nordigen/nordigen.controller.js not supported.
Instead change the require of index.js in /home/../dist/nordigen/nordigen.controller.js to a dynamic import() which is available in all CommonJS modules.
In a SPA that ideally would run without api backend for interacting with Nordigen, would it be ok to expose the access token to the client?
I'm thinking that a standalone script that periodically fetches the access token from Nordigen could be saved in a database where the client could retrieve it (using Pocketbase for database and auth to the app itself) and use it to directly fetch data from Nordigen.
Describe the bug
When testing with jest it displays "Cannot use import statement outside a module"
To Reproduce
Steps to reproduce the behavior:
I added the library with npm install nordigen-node --save, wrote code to substitute direct API calls with the methods in the library as the quickstart guide showed, called them in my code and then proceeded in testing the files.
Expected behavior
I expected to solve this error by either adding type:module to package.json, installing babel/nodemon, or in general by specifying that the library must not be executed as a commonjs, but nothing solves the error
Is your feature request related to a problem? Please describe.
I am storing the end-user's transactions to a database. When I get new transactions, it would be convenient to filter them so that those transactions that I already have, would not be retrieved from Nordigen. At this time, I have to retrieve all the transactions, and do the filtering myself, which means that there is unnecessary network traffic and filtering processes done in our server.
Describe the solution you'd like
It would be great to be able to provide a date range for the getTransactions request, so that only the transactions matching the filter would be fetched. I believe that these filters exist in the API endpoints already, as date_from and date_to parameters.
Describe alternatives you've considered
Other possible filter could be from_transaction_id filter, which would return all transactions after the id provided as parameter. This would be very easy to use in our application, since we would be able to provide the id of the latest transaction that we have fetched, and it would return all the ones we are missing.
Additional context
Describe the bug
JSDoc and Typescript types are incorrect, which provoques compilation issues when is used in a Typescript project.
To Reproduce
As example, lets take a look to this fragment in JS:
nordigen-node/lib/api/account.js
Lines 7 to 15 in 015ecf5
...and its generated Typescript:
nordigen-node/types/api/account.d.ts
Lines 2 to 7 in 015ecf5
As you can see, those types are incorrect. Also there are a lot more definitions in JS that does not produce the correct Typescript types.
Expected behavior
As an example of the correct type for JSDoc:
/**
* Account api class
* @param {Object} params
* @param {NordigenClient} params.client
* @param {string} params.accountId
*/
constructor({client, accountId}) {
this.#client = client;
this.#accountId = accountId
}
...will generate the proper Typescript types:
/**
* Account api class
* @param {Object} params
* @param {NordigenClient} params.client
* @param {string} params.accountId
*/
constructor({ client, accountId }: {
client: NordigenClient;
accountId: string;
});
I forked the repository and made a fix, I will link it to this issue.
Is your feature request related to a problem? Please describe.
-
Describe the solution you'd like
I saw that you merged my addition of Typescript types 😄. I was wandering when you would publish these to npm so that I can start using them in my project.
Describe alternatives you've considered
-
Additional context
Btw I've also added the command: npm run gen:types
to generate the types from the source code. So whenever you make a change to the project in the future, please make sure to run this command before you commit the changes 🙂.
Describe the bug
The setToken
function doesn't seems to work for me. I'm running into the following error:
TypeError: client.setToken is not a function
.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the function to work.
Screenshots
-
Additional context
No fancy things, just a clean Node.js project. The other functions do work for me.
Describe the bug
I've tried using the package in my Remix Run project and the typings are not working correctly. https://publint.dev/[email protected] says that there's a problem with exporting types.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Importing the library should work as usual and it should be typed.
Is your feature request related to a problem? Please describe.
I see from the source code that it is possible to provide a maxHistoricalDays parameter to the nordigenClient.initSession() function, but it has no effect on the requisition. The returned value is always 90 days.
Describe the solution you'd like
It would be great to support that parameter in the node library. I believe that it is already supported in your API endpoints.
Describe alternatives you've considered
Additional context
initSession
method is now missing the userLanguage
argument, but it should be there.
Describe the bug
A clear and concise description of what the bug is.
I am trying to integration nordigen-node v1.1.1 into my firebase cloud function
my package is using
"compilerOptions": {
"module": "commonjs",
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Whenever I try to upload my functions, the deploy will exit with the code shown in the above screeshot
Describe the bug
In the type declaration for createRequisition()
method input, the reference
, ssn
, redirectImmediate
and accountSelection
parameters are all required although the API does not enforce them.
To Reproduce
Steps to reproduce the behavior:
createRequisition()
method call, type checker will emit a warningPOST /api/v2/agreements/enduser/
directly via curl without these parameters, the API returns a successful responseExpected behavior
reference
, ssn
, redirectImmediate
, accountSelection
should either be marked optional in the type declaration or the API should enforce these parameters.
👋
Hi! Not exactly sure if this is a feature request or bug report.
Given that Nordigen was acquired by GoCardLess and is now fully moving under their umbrella - is there a migration path/guide for existing nordigen-node
customers?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.