@decafhub/decaf-client-extras 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release-please.yml +9 -15
- package/.github/workflows/test.yml +10 -6
- package/.husky/commit-msg +1 -1
- package/.nvmrc +1 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +22 -0
- package/README.md +1 -7
- package/nix/default.nix +0 -1
- package/package.json +28 -27
- package/postinstall.sh +1 -1
- package/src/index.test.ts +4 -3
|
@@ -6,36 +6,30 @@ on:
|
|
|
6
6
|
name: release-please
|
|
7
7
|
jobs:
|
|
8
8
|
release-please:
|
|
9
|
-
runs-on:
|
|
10
|
-
strategy:
|
|
11
|
-
matrix:
|
|
12
|
-
node: [16]
|
|
13
|
-
os: [ubuntu-latest]
|
|
9
|
+
runs-on: ubuntu-latest
|
|
14
10
|
steps:
|
|
15
|
-
- uses: google-github-actions/release-please-action@
|
|
11
|
+
- uses: google-github-actions/release-please-action@v4
|
|
16
12
|
id: release
|
|
17
|
-
with:
|
|
18
|
-
command: manifest
|
|
19
13
|
|
|
20
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@v4
|
|
21
15
|
if: ${{ steps.release.outputs.release_created }}
|
|
22
16
|
|
|
23
|
-
- uses: actions/setup-node@
|
|
17
|
+
- uses: actions/setup-node@v4
|
|
24
18
|
with:
|
|
25
|
-
node-version:
|
|
19
|
+
node-version: 'lts/*'
|
|
26
20
|
registry-url: 'https://registry.npmjs.org'
|
|
27
|
-
cache: '
|
|
21
|
+
cache: 'npm'
|
|
28
22
|
if: ${{ steps.release.outputs.release_created }}
|
|
29
23
|
|
|
30
24
|
- name: Install dependencies
|
|
31
|
-
run:
|
|
25
|
+
run: npm ci
|
|
32
26
|
if: ${{ steps.release.outputs.release_created }}
|
|
33
27
|
env:
|
|
34
28
|
DECAF_JS_SKIP_POSTINSTALL: 1
|
|
35
29
|
HUSKY: 0
|
|
36
30
|
|
|
37
31
|
- name: Build the project and generate docs
|
|
38
|
-
run:
|
|
32
|
+
run: npm run build
|
|
39
33
|
if: ${{ steps.release.outputs.release_created }}
|
|
40
34
|
|
|
41
35
|
- name: Deploy docs to gh-pages
|
|
@@ -45,7 +39,7 @@ jobs:
|
|
|
45
39
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
46
40
|
publish_dir: ./docs
|
|
47
41
|
|
|
48
|
-
- run:
|
|
42
|
+
- run: npm publish --access=public
|
|
49
43
|
env:
|
|
50
44
|
NODE_AUTH_TOKEN: ${{secrets.DECAFHUB_NPM_TOKEN}}
|
|
51
45
|
if: ${{ steps.release.outputs.release_created }}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
name: Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
workflow_dispatch:
|
|
4
5
|
pull_request:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
5
9
|
|
|
6
10
|
jobs:
|
|
7
11
|
test:
|
|
8
12
|
runs-on: ${{ matrix.os }}
|
|
9
13
|
strategy:
|
|
10
14
|
matrix:
|
|
11
|
-
node: [
|
|
15
|
+
node: [18, 20, 21]
|
|
12
16
|
os: [ubuntu-latest]
|
|
13
17
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v4
|
|
15
19
|
|
|
16
|
-
- uses: actions/setup-node@
|
|
20
|
+
- uses: actions/setup-node@v4
|
|
17
21
|
with:
|
|
18
22
|
node-version: ${{ matrix.node }}
|
|
19
23
|
registry-url: 'https://registry.npmjs.org'
|
|
20
|
-
cache: '
|
|
24
|
+
cache: 'npm'
|
|
21
25
|
|
|
22
26
|
- name: Install dependencies
|
|
23
|
-
run:
|
|
27
|
+
run: npm ci
|
|
24
28
|
env:
|
|
25
29
|
DECAF_JS_SKIP_POSTINSTALL: 1
|
|
26
30
|
HUSKY: 0
|
|
27
31
|
|
|
28
32
|
- name: Run Tests
|
|
29
|
-
run:
|
|
33
|
+
run: npm test -- --ci
|
|
30
34
|
env:
|
|
31
35
|
TESTING_API_KEY: ${{ secrets.TESTING_API_KEY }}
|
|
32
36
|
TESTING_API_SECRET: ${{ secrets.TESTING_API_SECRET }}
|
package/.husky/commit-msg
CHANGED
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lts/*
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.2.0...v0.3.0) (2023-12-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* drop support for Node 16
|
|
9
|
+
|
|
10
|
+
### Miscellaneous Chores
|
|
11
|
+
|
|
12
|
+
* drop support for Node 16 ([4ba8384](https://github.com/teloscube/decaf-client-javascript-extras/commit/4ba8384aabf4f48fc7f9ce6ea85c6326057c749d))
|
|
13
|
+
|
|
14
|
+
## [0.2.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.1.1...v0.2.0) (2023-05-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### ⚠ BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* make minimum supported node version 16
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* make minimum supported node version 16 ([ce38994](https://github.com/teloscube/decaf-client-javascript-extras/commit/ce38994cd38868821beb9ad7b2a466c32e8aa50a))
|
|
24
|
+
|
|
3
25
|
## [0.1.1](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.1.0...v0.1.1) (2023-04-02)
|
|
4
26
|
|
|
5
27
|
|
package/README.md
CHANGED
|
@@ -12,13 +12,7 @@ Install @decafhub/decaf-client-extras along with its peer dependency @decafhub/d
|
|
|
12
12
|
npm install --save @decafhub/decaf-client-extras @decafhub/decaf-client
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Or with yarn:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
yarn add @decafhub/decaf-client-extras @decafhub/decaf-client
|
|
19
|
-
```
|
|
20
|
-
|
|
21
15
|
## Testing
|
|
22
16
|
|
|
23
17
|
- Duplicate the `.env.example` file to `.env` and fill in the values.
|
|
24
|
-
- Run `
|
|
18
|
+
- Run `npm test` to run the tests.
|
package/nix/default.nix
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decafhub/decaf-client-extras",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "DECAF Client Extras",
|
|
5
5
|
"author": "Teloscube Pte Ltd",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,45 +17,46 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"start": "tsc --watch",
|
|
19
19
|
"test": "jest",
|
|
20
|
-
"build": "rm -rf lib && tsc && tsc -p tsconfig.es.json &&
|
|
20
|
+
"build": "rm -rf lib && tsc && tsc -p tsconfig.es.json && npm run make:docs",
|
|
21
21
|
"make:docs": "typedoc",
|
|
22
22
|
"deploy:docs": "gh-pages -d ./docs",
|
|
23
|
-
"prepare": "
|
|
23
|
+
"prepare": "npm run build && ./postinstall.sh"
|
|
24
24
|
},
|
|
25
25
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
26
|
+
"node": ">=18"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@decafhub/decaf-client": "^0.
|
|
29
|
+
"@decafhub/decaf-client": "^0.5"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@telostat/prelude": "^0.
|
|
32
|
+
"@telostat/prelude": "^0.5.0",
|
|
33
|
+
"dayjs": "^1.11.10"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@commitlint/cli": "^
|
|
36
|
-
"@commitlint/config-conventional": "^
|
|
37
|
-
"@decafhub/decaf-client": "^0.
|
|
38
|
-
"@types/jest": "^29.5.
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
41
|
-
"@typescript-eslint/parser": "^
|
|
42
|
-
"dotenv": "^16.
|
|
43
|
-
"eslint": "^8.
|
|
44
|
-
"eslint-config-prettier": "^
|
|
45
|
-
"eslint-config-standard": "^17.
|
|
46
|
-
"eslint-plugin-import": "^2.
|
|
47
|
-
"eslint-plugin-n": "^
|
|
48
|
-
"eslint-plugin-prettier": "^
|
|
36
|
+
"@commitlint/cli": "^18.4.3",
|
|
37
|
+
"@commitlint/config-conventional": "^18.4.3",
|
|
38
|
+
"@decafhub/decaf-client": "^0.5.0",
|
|
39
|
+
"@types/jest": "^29.5.10",
|
|
40
|
+
"@types/node": "^20.10.3",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
42
|
+
"@typescript-eslint/parser": "^6.13.2",
|
|
43
|
+
"dotenv": "^16.3.1",
|
|
44
|
+
"eslint": "^8.55.0",
|
|
45
|
+
"eslint-config-prettier": "^9.1.0",
|
|
46
|
+
"eslint-config-standard": "^17.1.0",
|
|
47
|
+
"eslint-plugin-import": "^2.29.0",
|
|
48
|
+
"eslint-plugin-n": "^16.3.1",
|
|
49
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
49
50
|
"eslint-plugin-promise": "^6.1.1",
|
|
50
51
|
"eslint-plugin-standard": "^5.0.0",
|
|
51
|
-
"gh-pages": "^
|
|
52
|
+
"gh-pages": "^6.1.0",
|
|
52
53
|
"husky": "^8.0.3",
|
|
53
|
-
"jest": "^29.
|
|
54
|
-
"lint-staged": "^
|
|
55
|
-
"prettier": "^
|
|
56
|
-
"ts-jest": "^29.
|
|
57
|
-
"typedoc": "^0.
|
|
58
|
-
"typescript": "^5.
|
|
54
|
+
"jest": "^29.7.0",
|
|
55
|
+
"lint-staged": "^15.2.0",
|
|
56
|
+
"prettier": "^3.1.0",
|
|
57
|
+
"ts-jest": "^29.1.1",
|
|
58
|
+
"typedoc": "^0.25.4",
|
|
59
|
+
"typescript": "^5.3.2"
|
|
59
60
|
},
|
|
60
61
|
"lint-staged": {
|
|
61
62
|
"src/**/*.{ts,tsx}": [
|
package/postinstall.sh
CHANGED
package/src/index.test.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { buildDecafClient, DecafClient, gql } from '@decafhub/decaf-client';
|
|
2
|
-
import {
|
|
2
|
+
import { safeDiv, zero } from '@telostat/prelude';
|
|
3
3
|
import { fail } from 'assert';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
4
5
|
import { DecafPortfolioId, mkCurrencyCodeError } from './commons';
|
|
5
6
|
import { makeValuationReportHoldingsTree } from './reports/valuation/';
|
|
6
7
|
import {
|
|
@@ -54,7 +55,7 @@ describe('Main', () => {
|
|
|
54
55
|
test('get a remote portfolio report successfuly', async () => {
|
|
55
56
|
const eValue = await fetchRemotePortfolioValuationReport(client, {
|
|
56
57
|
portfolio: portfolioId,
|
|
57
|
-
date:
|
|
58
|
+
date: dayjs(new Date()).format('YYYY-MM-DD'),
|
|
58
59
|
dateType: 'settlement',
|
|
59
60
|
currency: mkCurrencyCodeError('EUR'),
|
|
60
61
|
});
|
|
@@ -72,7 +73,7 @@ describe('Main', () => {
|
|
|
72
73
|
test('get a portfolio report, check the tree', async () => {
|
|
73
74
|
const eValue = await fetchPortfolioValuationReport(client, {
|
|
74
75
|
portfolio: portfolioId,
|
|
75
|
-
date:
|
|
76
|
+
date: dayjs(new Date()).format('YYYY-MM-DD'),
|
|
76
77
|
dateType: 'settlement',
|
|
77
78
|
currency: mkCurrencyCodeError('EUR'),
|
|
78
79
|
});
|