@barchart/portfolio-api-common 1.8.0 → 1.9.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.
@@ -0,0 +1,4 @@
1
+ **New Features**
2
+
3
+ * Added `close` field to the `Sell` transaction schema.
4
+ * Added `close` field to the `Buy Short` transaction schema.
@@ -250,6 +250,7 @@ module.exports = (() => {
250
250
  .withField('quantity', DataType.DECIMAL)
251
251
  .withField('fee', DataType.DECIMAL, true)
252
252
  .withField('force', DataType.BOOLEAN, true)
253
+ .withField('close', DataType.BOOLEAN, true)
253
254
  .schema
254
255
  );
255
256
 
@@ -263,6 +264,7 @@ module.exports = (() => {
263
264
  .withField('quantity', DataType.DECIMAL)
264
265
  .withField('fee', DataType.DECIMAL, true)
265
266
  .withField('force', DataType.BOOLEAN, true)
267
+ .withField('close', DataType.BOOLEAN, true)
266
268
  .schema
267
269
  );
268
270
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Common code used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -5459,6 +5459,7 @@ module.exports = (() => {
5459
5459
  .withField('quantity', DataType.DECIMAL)
5460
5460
  .withField('fee', DataType.DECIMAL, true)
5461
5461
  .withField('force', DataType.BOOLEAN, true)
5462
+ .withField('close', DataType.BOOLEAN, true)
5462
5463
  .schema
5463
5464
  );
5464
5465
 
@@ -5472,6 +5473,7 @@ module.exports = (() => {
5472
5473
  .withField('quantity', DataType.DECIMAL)
5473
5474
  .withField('fee', DataType.DECIMAL, true)
5474
5475
  .withField('force', DataType.BOOLEAN, true)
5476
+ .withField('close', DataType.BOOLEAN, true)
5475
5477
  .schema
5476
5478
  );
5477
5479
 
@@ -8203,8 +8205,11 @@ const moment = require('moment-timezone');
8203
8205
 
8204
8206
  module.exports = (() => {
8205
8207
  'use strict';
8208
+
8209
+ const MILLISECONDS_PER_SECOND = 1000;
8206
8210
  /**
8207
- * A data structure encapsulates (and lazy loads) a moment (see https://momentjs.com/).
8211
+ * An immutable data structure that encapsulates (and lazy loads)
8212
+ * a moment (see https://momentjs.com/).
8208
8213
  *
8209
8214
  * @public
8210
8215
  * @param {Number} timestamp
@@ -8220,7 +8225,7 @@ module.exports = (() => {
8220
8225
  this._moment = null;
8221
8226
  }
8222
8227
  /**
8223
- * The timestamp.
8228
+ * The timestamp (milliseconds since epoch).
8224
8229
  *
8225
8230
  * @public
8226
8231
  * @returns {Number}
@@ -8249,6 +8254,34 @@ module.exports = (() => {
8249
8254
 
8250
8255
  return this._moment;
8251
8256
  }
8257
+ /**
8258
+ * Returns a new {@link Timestamp} instance shifted forward (or backward)
8259
+ * by a specific number of seconds.
8260
+ *
8261
+ * @public
8262
+ * @param {Number} milliseconds
8263
+ * @returns {Timestamp}
8264
+ */
8265
+
8266
+
8267
+ add(milliseconds) {
8268
+ assert.argumentIsRequired(milliseconds, 'seconds', Number);
8269
+ return new Timestamp(this._timestamp + milliseconds, this._timezone);
8270
+ }
8271
+ /**
8272
+ * Returns a new {@link Timestamp} instance shifted forward (or backward)
8273
+ * by a specific number of seconds.
8274
+ *
8275
+ * @public
8276
+ * @param {Number} seconds
8277
+ * @returns {Timestamp}
8278
+ */
8279
+
8280
+
8281
+ addSeconds(seconds) {
8282
+ assert.argumentIsRequired(seconds, 'seconds', Number);
8283
+ return this.add(seconds * MILLISECONDS_PER_SECOND);
8284
+ }
8252
8285
  /**
8253
8286
  * Returns the JSON representation.
8254
8287
  *
@@ -8550,7 +8583,8 @@ module.exports = (() => {
8550
8583
  },
8551
8584
 
8552
8585
  /**
8553
- * Set difference operation (using strict equality).
8586
+ * Set difference operation, returning any item in "a" that is not
8587
+ * contained in "b" (using strict equality).
8554
8588
  *
8555
8589
  * @static
8556
8590
  * @param {Array} a
@@ -8562,7 +8596,8 @@ module.exports = (() => {
8562
8596
  },
8563
8597
 
8564
8598
  /**
8565
- * Set difference operation, where the uniqueness is determined by a delegate.
8599
+ * Set difference operation, returning any item in "a" that is not
8600
+ * contained in "b" (where the uniqueness is determined by a delegate).
8566
8601
  *
8567
8602
  * @static
8568
8603
  * @param {Array} a
@@ -9465,6 +9500,7 @@ module.exports = (() => {
9465
9500
  /**
9466
9501
  * An implementation of the observer pattern.
9467
9502
  *
9503
+ * @public
9468
9504
  * @param {*} sender - The object which owns the event.
9469
9505
  * @extends {Disposable}
9470
9506
  */
@@ -9538,6 +9574,7 @@ module.exports = (() => {
9538
9574
  /**
9539
9575
  * Returns true, if no handlers are currently registered.
9540
9576
  *
9577
+ * @public
9541
9578
  * @returns {boolean}
9542
9579
  */
9543
9580