This is an unofficial node.js module for the comdirect REST API
Important: This is not very much tested
Feel free to clone this and make it a real library, as this is a quick and dirty solution. I won't work on this very much.
Other libs:
This module works only with the photoTAN method!
Use it at your own risk!
If you enter a wrong TAN 3 times your account will be blocked (to unlock you need to do a phone call).
You can reset the error counter by enter a valid TAN via the official website by retrieving your inbox (PostBox).
- Set environment with needed credentials:
cp .env.example .env
Edit .env
- Run the example script
nx run comdirect-rest-examples:start
Have a look into the example main.ts.
The env vars are used in OpenAPI.ts to setup the lib config.
Keep in mind that the lib currently doesn't handle token updates automatically!
Currently, I use the lib in scripts, which are finished before a token update is needed. The downside is, with every run the confirmation with photoTAN is needed.
In an application that could be handled of course by regularly update the token. With scripts the token could be stored on disk to reuse it, which I wouldn't do for security reasons.
The lib code is auto-generated by @hey-api/openapi-ts with comdirect_rest_api_swagger.json:
npx @hey-api/openapi-ts -i comdirect_rest_api_swagger.json -o lib
The generated code was a bit modified and adapted to the real world. Only small parts are tested.
✨ This workspace has been generated by Nx, Smart Monorepos · Fast CI. ✨
Enhance your Nx experience by installing Nx Console for your favorite editor. Nx Console provides an interactive UI to view your projects, run tasks, generate code, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.
Add Nx plugins to leverage their code generators and automated, inferred tasks.
# Add plugin
npx nx add @nx/react
# Use code generator
npx nx generate @nx/react:app demo
# Run development server
npx nx serve demo
# View project details
npx nx show project demo --web
Run npx nx list
to get a list of available plugins and whether they have generators. Then run npx nx list <plugin-name>
to see what generators are available.
Learn more about code generators and inferred tasks in the docs.
To execute tasks with Nx use the following syntax:
npx nx <target> <project> <...options>
You can also run multiple targets:
npx nx run-many -t <target1> <target2>
..or add -p
to filter specific projects
npx nx run-many -t <target1> <target2> -p <proj1> <proj2>
Targets can be defined in the package.json
or projects.json
. Learn more in the docs.