@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
@@ -1,4 +1,4 @@
1
- Copyright 2020, Barchart.com, Inc., http://www.barchart.com/
1
+ Copyright 2022, Barchart.com, Inc., http://www.barchart.com/
2
2
 
3
3
  This software consists of voluntary contributions made by many
4
4
  individuals. For exact contribution history, see the revision history
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![AWS CodeBuild](https://codebuild.us-east-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiSXBJTDZKWVFmSGVOSG9XQUgwbzB3Um5BZ0JsN2h1U3NQNWNhZTRHMlJKTVpEVVlVMENPaEFmR0NYS29rSStZWmZ5M1d0YVh2eXErVGhiekFtdHBpVmhJPSIsIml2UGFyYW1ldGVyU3BlYyI6ImROM3ZLMURwaXFyekltdDYiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)](https://github.com/barchart/portfolio-api-common)
4
4
 
5
- A *private* library of shared JavaScript code pertaining to the paper-trading portfolio system.
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 *private* module to NPM as [@barchart/portfolio-api-common](https://www.npmjs.com/package/@barchart/portfolio-api-common).
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
  })();
@@ -27,6 +27,8 @@ module.exports = (() => {
27
27
 
28
28
  const REQUIRED_CURRENCIES = [
29
29
  Currency.CAD,
30
+ Currency.EUR,
31
+ Currency.JPY,
30
32
  Currency.USD
31
33
  ];
32
34
 
@@ -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.11.8",
4
- "description": "Common code used by the Portfolio system",
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": "http://www.barchart.com"
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.9.1",
18
+ "@barchart/common-js": "^4.22.0",
14
19
  "uuid": "^8.3.2"
15
20
  },
16
21
  "devDependencies": {