@barchart/portfolio-api-common 1.4.4 → 1.5.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,3 @@
1
+ **New Features**
2
+
3
+ * Added new ```Schema``` for results of a query by symbol.
@@ -67,6 +67,17 @@ module.exports = (() => {
67
67
  return update;
68
68
  }
69
69
 
70
+ /**
71
+ * Result item for query of positions by symbol.
72
+ *
73
+ * @static
74
+ * @public
75
+ * @returns {PositionSchema}
76
+ */
77
+ static get SIMPLE() {
78
+ return simple;
79
+ }
80
+
70
81
  toString() {
71
82
  return '[PositionSchema]';
72
83
  }
@@ -152,5 +163,17 @@ module.exports = (() => {
152
163
  .schema
153
164
  );
154
165
 
166
+ const simple = new PositionSchema(SchemaBuilder.withName('simple')
167
+ .withField('user', DataType.STRING)
168
+ .withField('portfolio', DataType.STRING)
169
+ .withField('instrument.id', DataType.STRING)
170
+ .withField('instrument.name', DataType.STRING)
171
+ .withField('instrument.symbol.barchart', DataType.STRING, true)
172
+ .withField('instrument.symbol.display', DataType.STRING, true)
173
+ .withField('position', DataType.STRING)
174
+ .withField('open', DataType.BOOLEAN, true)
175
+ .schema
176
+ );
177
+
155
178
  return PositionSchema;
156
179
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.4.4",
3
+ "version": "1.5.0",
4
4
  "description": "Common code used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -5094,6 +5094,17 @@ module.exports = (() => {
5094
5094
  return update;
5095
5095
  }
5096
5096
 
5097
+ /**
5098
+ * Result item for query of positions by symbol.
5099
+ *
5100
+ * @static
5101
+ * @public
5102
+ * @returns {PositionSchema}
5103
+ */
5104
+ static get SIMPLE() {
5105
+ return simple;
5106
+ }
5107
+
5097
5108
  toString() {
5098
5109
  return '[PositionSchema]';
5099
5110
  }
@@ -5179,6 +5190,18 @@ module.exports = (() => {
5179
5190
  .schema
5180
5191
  );
5181
5192
 
5193
+ const simple = new PositionSchema(SchemaBuilder.withName('simple')
5194
+ .withField('user', DataType.STRING)
5195
+ .withField('portfolio', DataType.STRING)
5196
+ .withField('instrument.id', DataType.STRING)
5197
+ .withField('instrument.name', DataType.STRING)
5198
+ .withField('instrument.symbol.barchart', DataType.STRING, true)
5199
+ .withField('instrument.symbol.display', DataType.STRING, true)
5200
+ .withField('position', DataType.STRING)
5201
+ .withField('open', DataType.BOOLEAN, true)
5202
+ .schema
5203
+ );
5204
+
5182
5205
  return PositionSchema;
5183
5206
  })();
5184
5207