@tasenor/common-plugins 1.13.18 → 1.13.20
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-ci.log +2 -2
- package/dist/CoinbaseImport/backend/CoinbaseHandler.js +13 -5
- package/dist/CoinbaseImport/backend/CoinbaseHandler.js.map +1 -1
- package/dist/CoinbaseImport/backend/index.js +1 -1
- package/dist/DocumentCleaner/ui/index.d.ts +0 -1
- package/dist/GitBackup/ui/index.d.ts +0 -1
- package/dist/TagEditor/ui/index.d.ts +0 -1
- package/dist/VAT/ui/index.d.ts +0 -1
- package/package.json +5 -5
- package/src/CoinbaseImport/backend/CoinbaseHandler.ts +14 -5
- package/src/CoinbaseImport/backend/index.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-ci.log
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @tasenor/common-plugins@1.13.
|
|
2
|
+
> @tasenor/common-plugins@1.13.19 ci /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
3
3
|
> pnpm run lint
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @tasenor/common-plugins@1.13.
|
|
6
|
+
> @tasenor/common-plugins@1.13.19 lint /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
7
7
|
> eslint 'src/**/*.{ts,tsx}' 'data/**/*.mjs'
|
|
8
8
|
|
|
@@ -21,7 +21,10 @@ export class CoinbaseHandler extends TransactionImportHandler {
|
|
|
21
21
|
'Spot Price Currency': 'Currency',
|
|
22
22
|
'Spot Price at Transaction': 'Price',
|
|
23
23
|
'Total (inclusive of fees and/or spread)': 'Total',
|
|
24
|
-
'Fees and/or Spread': 'Fees'
|
|
24
|
+
'Fees and/or Spread': 'Fees',
|
|
25
|
+
// V4
|
|
26
|
+
'Price at Transaction': 'Price',
|
|
27
|
+
'Price Currency': 'Currency',
|
|
25
28
|
}
|
|
26
29
|
};
|
|
27
30
|
}
|
|
@@ -36,7 +39,15 @@ export class CoinbaseHandler extends TransactionImportHandler {
|
|
|
36
39
|
return 2;
|
|
37
40
|
}
|
|
38
41
|
if (file.firstLineMatch(/^$/) && file.secondLineMatch(/^Transactions$/)) {
|
|
39
|
-
|
|
42
|
+
const data = file.decode();
|
|
43
|
+
const lines = data.split('\n').splice(3);
|
|
44
|
+
if (!/^Timestamp,Transaction Type,Asset,Quantity Transacted,Spot Price Currency,Spot Price at Transaction,Subtotal,Total/.test(lines[0])) {
|
|
45
|
+
return 3;
|
|
46
|
+
}
|
|
47
|
+
if (!/^ID,Timestamp,Transaction Type,Asset,Quantity Transacted,Price Currency,Price at Transaction,Subtotal,Total (inclusive of fees and\/or spread),Fees and\/or Spread,Notes/.test(lines[0])) {
|
|
48
|
+
return 4;
|
|
49
|
+
}
|
|
50
|
+
throw new Error('Coinbase parser is not able to understand the column format.');
|
|
40
51
|
}
|
|
41
52
|
return 0;
|
|
42
53
|
}
|
|
@@ -50,9 +61,6 @@ export class CoinbaseHandler extends TransactionImportHandler {
|
|
|
50
61
|
for (const file of files) {
|
|
51
62
|
const data = file.decode();
|
|
52
63
|
const lines = data.split('\n').splice(this.version === 2 ? 7 : 3);
|
|
53
|
-
if (!/^Timestamp,Transaction Type,Asset,Quantity Transacted,Spot Price Currency,Spot Price at Transaction,Subtotal,Total/.test(lines[0])) {
|
|
54
|
-
throw new Error('Coinbase parser is not able to understand the format.');
|
|
55
|
-
}
|
|
56
64
|
file.set(lines.join('\n'));
|
|
57
65
|
}
|
|
58
66
|
return files;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinbaseHandler.js","sourceRoot":"","sources":["../../../src/CoinbaseImport/backend/CoinbaseHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAE5E;;GAEG;AACH,MAAM,OAAO,eAA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G,KAAK,CAAC,CAAC,CAAC,CAAA;aAC7B;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF"}
|
|
@@ -5,7 +5,7 @@ class CoinbaseImportPlugin extends ImportPlugin {
|
|
|
5
5
|
super(new CoinbaseHandler());
|
|
6
6
|
this.code = 'CoinbaseImport';
|
|
7
7
|
this.title = 'Import for Coinbase';
|
|
8
|
-
this.version = '1.0.
|
|
8
|
+
this.version = '1.0.26';
|
|
9
9
|
this.icon = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M5 6.99h3V14h2V6.99h3L9 3zM14 10v7.01h-3L15 21l4-3.99h-3V10z"/></svg>';
|
|
10
10
|
this.releaseDate = '2022-10-24';
|
|
11
11
|
this.use = 'backend';
|
package/dist/VAT/ui/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tasenor/common-plugins",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.20",
|
|
4
4
|
"description": "Shared common plugins of Tasenor project",
|
|
5
5
|
"repository": "git@github.com:dataplugoy/tasenor-bookkeeper.git",
|
|
6
6
|
"author": "Tommi Ronkainen <tommi.ronkainen@gmail.com>",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"dayjs": "1.10.8",
|
|
14
14
|
"sprintf-js": "^1.1.2",
|
|
15
15
|
"tsx": "^4.7.0",
|
|
16
|
-
"@tasenor/common
|
|
17
|
-
"@tasenor/common-
|
|
18
|
-
"@tasenor/common": "1.13.
|
|
16
|
+
"@tasenor/common": "1.13.20",
|
|
17
|
+
"@tasenor/common-ui": "1.13.20",
|
|
18
|
+
"@tasenor/common-node": "1.13.20"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@mui/icons-material": "^5.14.1",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-i18next": "^14.0.5",
|
|
32
32
|
"react-router-dom": "^6.14.1",
|
|
33
33
|
"typescript": "^5.1.6",
|
|
34
|
-
"@tasenor/config": "1.13.
|
|
34
|
+
"@tasenor/config": "1.13.20",
|
|
35
35
|
"eslint-config-tasenor": "0.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -24,7 +24,10 @@ export class CoinbaseHandler extends TransactionImportHandler {
|
|
|
24
24
|
'Spot Price Currency': 'Currency',
|
|
25
25
|
'Spot Price at Transaction': 'Price',
|
|
26
26
|
'Total (inclusive of fees and/or spread)': 'Total',
|
|
27
|
-
'Fees and/or Spread': 'Fees'
|
|
27
|
+
'Fees and/or Spread': 'Fees',
|
|
28
|
+
// V4
|
|
29
|
+
'Price at Transaction': 'Price',
|
|
30
|
+
'Price Currency': 'Currency',
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -41,7 +44,16 @@ export class CoinbaseHandler extends TransactionImportHandler {
|
|
|
41
44
|
return 2
|
|
42
45
|
}
|
|
43
46
|
if (file.firstLineMatch(/^$/) && file.secondLineMatch(/^Transactions$/)) {
|
|
44
|
-
|
|
47
|
+
const data = file.decode()
|
|
48
|
+
const lines = data.split('\n').splice(3)
|
|
49
|
+
if (!/^Timestamp,Transaction Type,Asset,Quantity Transacted,Spot Price Currency,Spot Price at Transaction,Subtotal,Total/.test(lines[0])) {
|
|
50
|
+
return 3
|
|
51
|
+
}
|
|
52
|
+
if (!/^ID,Timestamp,Transaction Type,Asset,Quantity Transacted,Price Currency,Price at Transaction,Subtotal,Total (inclusive of fees and\/or spread),Fees and\/or Spread,Notes/.test(lines[0])) {
|
|
53
|
+
return 4
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
throw new Error('Coinbase parser is not able to understand the column format.')
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
return 0
|
|
@@ -57,9 +69,6 @@ export class CoinbaseHandler extends TransactionImportHandler {
|
|
|
57
69
|
for (const file of files) {
|
|
58
70
|
const data = file.decode()
|
|
59
71
|
const lines = data.split('\n').splice(this.version === 2 ? 7 : 3)
|
|
60
|
-
if (!/^Timestamp,Transaction Type,Asset,Quantity Transacted,Spot Price Currency,Spot Price at Transaction,Subtotal,Total/.test(lines[0])) {
|
|
61
|
-
throw new Error('Coinbase parser is not able to understand the format.')
|
|
62
|
-
}
|
|
63
72
|
file.set(lines.join('\n'))
|
|
64
73
|
}
|
|
65
74
|
return files
|
|
@@ -9,7 +9,7 @@ class CoinbaseImportPlugin extends ImportPlugin {
|
|
|
9
9
|
|
|
10
10
|
this.code = 'CoinbaseImport' as PluginCode
|
|
11
11
|
this.title = 'Import for Coinbase'
|
|
12
|
-
this.version = '1.0.
|
|
12
|
+
this.version = '1.0.26' as Version
|
|
13
13
|
this.icon = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M5 6.99h3V14h2V6.99h3L9 3zM14 10v7.01h-3L15 21l4-3.99h-3V10z"/></svg>'
|
|
14
14
|
this.releaseDate = '2022-10-24'
|
|
15
15
|
this.use = 'backend'
|