fix(core): update dependencies

This commit is contained in:
Philipp Kunz 2024-04-08 14:51:50 +02:00
parent 9122fe372d
commit be997344af
9 changed files with 1617 additions and 1499 deletions

View File

@ -1,140 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
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
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -8,11 +8,23 @@
"description": "an unofficial api abstraction for tink.com", "description": "an unofficial api abstraction for tink.com",
"npmPackagename": "@mojoio/tink", "npmPackagename": "@mojoio/tink",
"license": "MIT", "license": "MIT",
"projectDomain": "mojo.io" "projectDomain": "mojo.io",
"keywords": [
"tink.com",
"API abstraction",
"TypeScript",
"financial data",
"transactions",
"accounts",
"banking API"
]
} }
}, },
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public" "npmAccessLevel": "public"
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

View File

@ -13,19 +13,19 @@
"build": "(tsbuild --web)" "build": "(tsbuild --web)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.66", "@git.zone/tsbuild": "^2.1.66",
"@gitzone/tsbundle": "^2.0.8", "@git.zone/tsbundle": "^2.0.8",
"@gitzone/tsrun": "^1.2.42", "@git.zone/tsrun": "^1.2.44",
"@gitzone/tstest": "^1.0.74", "@git.zone/tstest": "^1.0.77",
"@pushrocks/qenv": "^5.0.2", "@push.rocks/qenv": "^6.0.5",
"@pushrocks/tapbundle": "^5.0.4", "@push.rocks/tapbundle": "^5.0.8",
"@types/node": "^20.2.5" "@types/node": "^20.12.5"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartdelay": "^3.0.1", "@push.rocks/smartdelay": "^3.0.1",
"@pushrocks/smartpromise": "^4.0.2", "@push.rocks/smartpromise": "^4.0.2",
"@pushrocks/smartrequest": "^2.0.15", "@push.rocks/smartrequest": "^2.0.15",
"@pushrocks/smarturl": "^3.0.6" "@push.rocks/smarturl": "^3.0.6"
}, },
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
@ -41,5 +41,14 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"keywords": [
"tink.com",
"API abstraction",
"TypeScript",
"financial data",
"transactions",
"accounts",
"banking API"
] ]
} }

2746
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

153
readme.md
View File

@ -1,63 +1,108 @@
# @mojoio/tink # @apiclient.xyz/tink
an unofficial api abstraction for tink.com an unofficial api abstraction for tink.com
## Availabililty and Links ## Install
* [npmjs.org (npm package)](https://www.npmjs.com/package/@mojoio/tink) To install @apiclient.xyz/tink, use either `npm` or `yarn` as per your preference. Run the following command in your project directory:
* [gitlab.com (source)](https://gitlab.com/mojoio/tink)
* [github.com (source mirror)](https://github.com/mojoio/tink)
* [docs (typedoc)](https://mojoio.gitlab.io/tink/)
## Status for master ```bash
npm install @apiclient.xyz/tink --save
Status Category | Status Badge ```
-- | -- Or if you prefer yarn, use:
GitLab Pipelines | [![pipeline status](https://gitlab.com/mojoio/tink/badges/master/pipeline.svg)](https://lossless.cloud) ```bash
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/mojoio/tink/badges/master/coverage.svg)](https://lossless.cloud) yarn add @apiclient.xyz/tink
npm | [![npm downloads per month](https://badgen.net/npm/dy/@mojoio/tink)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/mojoio/tink)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@mojoio/tink)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@mojoio/tink)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@mojoio/tink)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage
Use TypeScript for best inclass intellisense
```typescript
// this example assumes toplevel await
import * as tink from '@mojoio/tink';
const tinkAccount = new TinkAccount('<clientId>', '<clientSecret>');
const tinkUser = await tinkAccount.createTinkUser('<YourOwnUniqueUserId/externalUserId>');
const tinkLinkUrl = await tinkUser.getTinkLink('<marketCode like DE>');
// present the link to your user to connect their bank accounts to the tink platform.
const tinkProviderConsents = await tinkUser.getProviderConsents();
for (const providerConsent of tinkProviderConsents) {
const bankAccounts = await providerConsent.getBankAccounts();
for (const bankAccount of bankAccounts) {
const transactions = bankAccount.getTransactions();
}
}
// additional stuff
const existingTinkUser = await tinkAccount.getUser('<YourOwnUniqueUserId/externalUserId>');
await existingTinkuser.delete(); // delete the user on the tink platform
``` ```
## Contribution This will add the package to your project's dependencies.
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). :) ## Usage
The `@apiclient.xyz/tink` library provides an unofficial TypeScript API abstraction for interacting with tink.com. To make the most out of this library, it's recommended to have a basic understanding of TypeScript and asynchronous programming in JavaScript.
For further information read the linked docs at the top of this readme. ### Getting Started
First, you need to import the necessary classes from the `@apiclient.xyz/tink` package. Heres how you can get started with creating a `TinkAccount` instance and utilizing it to perform operations:
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) ```typescript
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) import { TinkAccount, TinkUser, TinkProviderConsent } from '@apiclient.xyz/tink';
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) // Initialize a new TinkAccount with your clientId and clientSecret
const myTinkAccount = new TinkAccount('<YOUR_CLIENT_ID>', '<YOUR_CLIENT_SECRET>');
```
### Creating and Managing Tink Users
To interact with user-specific APIs, create a `TinkUser` object. You can also retrieve an already existing user or create a new one as follows:
```typescript
// Creating a new Tink User
const newUser = await myTinkAccount.createTinkUser('unique_external_user_id');
console.log('New TinkUser created:', newUser);
// Retrieving an existing Tink User
const existingUser = await myTinkAccount.getTinkUser('existing_unique_external_user_id');
console.log('Existing TinkUser retrieved:', existingUser);
```
### Generating Tink Link for Account Connection
To connect bank accounts to the Tink platform, you will need to generate a Tink Link URL and present it to your users. Here's how you can obtain it:
```typescript
const tinkLinkUrl = await existingUser.getTinkLinkForMarket({
countryId: 'SE', // Specify the market code, e.g., SE for Sweden
redirectUrl: 'https://yourapplication.com/callback', // Redirect URL after account connection
customState: 'your_custom_state', // Optional custom state to be included in the callback
testProviderBool: true // Set to true if using test providers
});
console.log('Tink Link URL:', tinkLinkUrl);
```
### Fetching Bank Accounts and Transactions
After the user has connected their bank accounts through the Tink Link, you can retrieve the connected accounts and their transactions:
```typescript
// Fetching provider consents to get bank accounts
const providerConsents = await existingUser.getProviderConsents();
for (const consent of providerConsents) {
console.log('Provider consent:', consent);
// For each consent, get associated bank accounts
const bankAccounts = await consent.getBankAccounts();
for (const account of bankAccounts) {
console.log('Bank account:', account);
// Fetch transactions for each bank account
const transactions = await account.getTransactions();
for (const transaction of transactions) {
console.log('Transaction:', transaction);
}
}
}
```
### Advanced Usage
The library offers advanced features like handling provider consents, refreshing data, and managing users. For instance, you can delete a user as follows:
```typescript
await existingUser.delete();
console.log('User deleted successfully.');
```
To explore more about the library, including handling errors, refreshing tokens, and more nuanced data retrieval, consult the official API documentation provided by Tink.com and refer to the TypeScript definitions in this package.
Remember to secure your credentials and tokens appropriately and follow Tink's guidelines for data handling and user privacy.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@ -1,5 +1,5 @@
import { expect, expectAsync, tap } from '@pushrocks/tapbundle'; import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import * as qenv from '@pushrocks/qenv'; import * as qenv from '@push.rocks/qenv';
const testQenv = new qenv.Qenv('./', './.nogit/'); const testQenv = new qenv.Qenv('./', './.nogit/');
@ -9,8 +9,8 @@ let tinkTestAccount: tink.TinkAccount;
tap.test('should create a valid tink account', async () => { tap.test('should create a valid tink account', async () => {
tinkTestAccount = new tink.TinkAccount( tinkTestAccount = new tink.TinkAccount(
testQenv.getEnvVarOnDemand('TINK_CLIENT_ID'), await testQenv.getEnvVarOnDemand('TINK_CLIENT_ID'),
testQenv.getEnvVarOnDemand('TINK_CLIENT_SECRET') await testQenv.getEnvVarOnDemand('TINK_CLIENT_SECRET')
); );
expect(tinkTestAccount).toBeInstanceOf(tink.TinkAccount); expect(tinkTestAccount).toBeInstanceOf(tink.TinkAccount);
}); });

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@apiclient.xyz/tink', name: '@apiclient.xyz/tink',
version: '3.1.10', version: '3.1.11',
description: 'an unofficial api abstraction for tink.com' description: 'an unofficial api abstraction for tink.com'
} }

View File

@ -1,7 +1,7 @@
// @pushrocks scope // @pushrocks scope
import * as smartdelay from '@pushrocks/smartdelay'; import * as smartdelay from '@push.rocks/smartdelay';
import * as smartrequest from '@pushrocks/smartrequest'; import * as smartrequest from '@push.rocks/smartrequest';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@push.rocks/smartpromise';
import * as smarturl from '@pushrocks/smarturl'; import * as smarturl from '@push.rocks/smarturl';
export { smartdelay, smartrequest, smartpromise, smarturl }; export { smartdelay, smartrequest, smartpromise, smarturl };

View File

@ -3,8 +3,12 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"useDefineForClassFields": false, "useDefineForClassFields": false,
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "NodeNext",
"moduleResolution": "nodenext", "moduleResolution": "NodeNext",
"esModuleInterop": true "esModuleInterop": true,
} "verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
} }