@barchart/portfolio-api-common 1.11.8 → 1.14.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/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/barchart/portfolio-api-common)
|
|
4
4
|
|
|
5
|
-
A *
|
|
5
|
+
A *public* library of shared JavaScript code used by Barchart's paper-trading portfolio system.
|
|
6
6
|
|
|
7
7
|
### Overview
|
|
8
8
|
|
|
@@ -25,9 +25,8 @@ For reporting and display purposes, positions can be grouped together (by asset
|
|
|
25
25
|
|
|
26
26
|
### Package Managers
|
|
27
27
|
|
|
28
|
-
This library has been published as a *
|
|
28
|
+
This library has been published as a *public* module to NPM as [@barchart/portfolio-api-common](https://www.npmjs.com/package/@barchart/portfolio-api-common).
|
|
29
29
|
|
|
30
30
|
```shell
|
|
31
|
-
npm login
|
|
32
31
|
npm install @barchart/portfolio-api-common -S
|
|
33
32
|
```
|
|
@@ -382,6 +382,17 @@ module.exports = (() => {
|
|
|
382
382
|
static get TRANSACTION_SWITCH_FAILED_INVALID_REINVEST() {
|
|
383
383
|
return transactionSwitchFailedInvalidReinvest;
|
|
384
384
|
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Unable to generate analytics report. The portfolio does not exist.
|
|
388
|
+
*
|
|
389
|
+
* @public
|
|
390
|
+
* @static
|
|
391
|
+
* @returns {FailureType}
|
|
392
|
+
*/
|
|
393
|
+
static get WEALTHSCOPE_TOKEN_CREATE_FAIL_NO_PORTFOLIO() {
|
|
394
|
+
return wealthscopeTokenCreateFailNoPortfolio;
|
|
395
|
+
}
|
|
385
396
|
|
|
386
397
|
toString() {
|
|
387
398
|
return '[PortfolioFailureType]';
|
|
@@ -428,5 +439,7 @@ module.exports = (() => {
|
|
|
428
439
|
const transactionSwitchFailedInvalidConversion = new FailureType('TRANSACTION_SWITCH_FAILED_INVALID_CONVERSION', 'Unable to convert transaction from {U|existing.description} to {U|desired.description}. This conversion is not supported.');
|
|
429
440
|
const transactionSwitchFailedInvalidReinvest = new FailureType('TRANSACTION_SWITCH_FAILED_INVALID_REINVEST', 'Unable to convert transaction from {U|existing.description} to {U|desired.description}. Reinvestment is not supported for short positions.');
|
|
430
441
|
|
|
442
|
+
const wealthscopeTokenCreateFailNoPortfolio = new FailureType('WEALTHSCOPE_TOKEN_CREATE_FAIL_NO_PORTFOLIO', 'Unable to generate analytics report. The portfolio does not exist, has it been deleted?', false);
|
|
443
|
+
|
|
431
444
|
return PortfolioFailureType;
|
|
432
445
|
})();
|
|
@@ -361,22 +361,5 @@ module.exports = (() => {
|
|
|
361
361
|
.schema
|
|
362
362
|
);
|
|
363
363
|
|
|
364
|
-
const map = { };
|
|
365
|
-
|
|
366
|
-
function addSchemaToMap(type, schema) {
|
|
367
|
-
map[type.code] = schema;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
addSchemaToMap(TransactionType.BUY, buy);
|
|
371
|
-
addSchemaToMap(TransactionType.SELL, sell);
|
|
372
|
-
addSchemaToMap(TransactionType.BUY_SHORT, buyShort);
|
|
373
|
-
addSchemaToMap(TransactionType.SELL_SHORT, sellShort);
|
|
374
|
-
addSchemaToMap(TransactionType.FEE, fee);
|
|
375
|
-
addSchemaToMap(TransactionType.DEPOSIT, deposit);
|
|
376
|
-
addSchemaToMap(TransactionType.WITHDRAWAL, withdrawal);
|
|
377
|
-
addSchemaToMap(TransactionType.VALUATION, valuation);
|
|
378
|
-
addSchemaToMap(TransactionType.DELIST, delist);
|
|
379
|
-
addSchemaToMap(TransactionType.INCOME, income);
|
|
380
|
-
|
|
381
364
|
return TransactionSchema;
|
|
382
365
|
})();
|
package/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barchart/portfolio-api-common",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Common code used by
|
|
3
|
+
"version": "1.14.0",
|
|
4
|
+
"description": "Common JavaScript code used by Barchart's Portfolio Service",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bryan Ingle",
|
|
7
7
|
"email": "bryan.ingle@barchart.com",
|
|
8
|
-
"url": "
|
|
8
|
+
"url": "https://www.barchart.com"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: Please use gulp to run tests\" && exit 1"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+ssh://git@github.com/barchart/portfolio-api-common.git"
|
|
9
16
|
},
|
|
10
|
-
"homepage": "https://github.com/barchart/portfolio-api-common#readme",
|
|
11
|
-
"scripts": {},
|
|
12
17
|
"dependencies": {
|
|
13
|
-
"@barchart/common-js": "^4.
|
|
18
|
+
"@barchart/common-js": "^4.22.0",
|
|
14
19
|
"uuid": "^8.3.2"
|
|
15
20
|
},
|
|
16
21
|
"devDependencies": {
|