@barchart/portfolio-client-js 5.2.0 → 5.3.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.
@@ -1 +1 @@
1
- {"portfolio/_coverpage.md":"\"f957831627399d4be57ceda0fed32e20\"","portfolio/_sidebar.md":"\"a854b0dcd2d5c0eb4de979a93a232b45\"","portfolio/index.html":"\"9966477f3d373643c1cdff2dfde919d4\"","portfolio/content/_sidebar.md":"\"a854b0dcd2d5c0eb4de979a93a232b45\"","portfolio/content/api_reference.md":"\"d554e76f82877a86c6edfadb6c8ee9fc\"","portfolio/content/product_overview.md":"\"fde131b3a4a7c574a8f41ecfd7f202eb\"","portfolio/content/quick_start.md":"\"2e0d8de7247ebc847ad8a56619ef51d3\"","portfolio/content/release_notes.md":"\"1bd7efe30b675a8e3945070c7e9baf49\"","portfolio/content/sdk_reference.md":"\"a9c9669ce7a6478281ada65009738555\"","portfolio/styles/override.css":"\"9445e9c6a2bb7c2e435a09f22142a073\"","portfolio/static/openapi.yaml":"\"835322160925f1cf7e1e8534dec6fd12\"","portfolio/content/api/_sidebar.md":"\"60cdc1db76e58b2631a95a81411c6963\"","portfolio/content/api/components.md":"\"433f10a6c68ffce3920ece1db1de6b4a\"","portfolio/content/api/paths.md":"\"e11c608cde2a5ad94abe70d01bb43b95\"","portfolio/content/concepts/_sidebar.md":"\"a854b0dcd2d5c0eb4de979a93a232b45\"","portfolio/content/concepts/connecting_to_barchart.md":"\"ebbe0644caea27269ca2d553e9507bbc\"","portfolio/content/concepts/interaction_basics.md":"\"9fd648c53f183143f352e5d117739cdc\"","portfolio/content/concepts/understanding_corporate_actions.md":"\"d41d8cd98f00b204e9800998ecf8427e\"","portfolio/content/concepts/working_with_portfolios.md":"\"520310bbc64c34c82cb3fd9c28321eff\"","portfolio/content/concepts/working_with_positions.md":"\"fa78dc740b9c46b0c2c06e8d810f1a60\"","portfolio/content/concepts/working_with_summaries.md":"\"d41d8cd98f00b204e9800998ecf8427e\"","portfolio/content/concepts/working_with_transactions.md":"\"49f7be257a872ff55c08075ce8c376d0\"","portfolio/content/concepts/working_with_valuations.md":"\"63cd4b5926aae46d91e958d2532a4abd\"","portfolio/content/appendices/data_model_enumerations.md":"\"5180ae3da33e24780eaad020a5443f30\"","portfolio/content/appendices/data_model_structures.md":"\"0fa41f49c618a12c3adb83e496b77763\"","portfolio/content/appendices/demo_applications.md":"\"c26aef709b5c75f0f805f4904e9572a5\"","portfolio/content/appendices/other_services.md":"\"a078a70e4228b093c04329577dd1ad8e\"","portfolio/content/appendices/sample_code.md":"\"e41296a9fbaaab0f7e1355e10dc55493\"","portfolio/content/images/portfolio_ui_web.png":"\"d04afe475e03c1f2121f2a70130e7c42\"","portfolio/content/releases/3.0.0.md":"\"1484919526d7d08694b2ed5afbd84365\"","portfolio/content/releases/3.1.0.md":"\"f28a0be6fbeb32f59ca9ec6c2f9011b4\"","portfolio/content/releases/3.2.0.md":"\"b3b0c996fb4fc094459629a104c24ffb\"","portfolio/content/releases/3.3.0.md":"\"3bbcfedbeb75d5a3206000f85d095a88\"","portfolio/content/releases/3.4.0.md":"\"3a2ad68ebcf001714a163c0b7da74305\"","portfolio/content/releases/3.4.1.md":"\"2dcbc977a354c88cf359ff17b59a4008\"","portfolio/content/releases/4.0.0.md":"\"3e6acdcc34335a3b900a5a1df8b671f1\"","portfolio/content/releases/4.1.0.md":"\"e6f85264ab0ff56d17074c7c0e4d90c5\"","portfolio/content/releases/5.0.1.md":"\"14e442b964a30dab5f1e14edaf9674e9\"","portfolio/content/releases/5.1.0.md":"\"a5a7b4b37328cb60f1cade7ecd779a28\"","portfolio/content/releases/5.1.1.md":"\"4edc2e50d9d8bdd6b5d543f15c1365ea\"","portfolio/content/releases/5.1.2.md":"\"04fc554763d1d664610094d6e2145411\"","portfolio/content/releases/5.2.0.md":"\"08356e1c1d6c068c3aae73876ad941aa\"","portfolio/content/sdk/_sidebar.md":"\"d813bcd5bbfc603368856ca6f71dbee6\"","portfolio/content/sdk/lib-common.md":"\"bd35e956a85e420e62895442fd873d2a\"","portfolio/content/sdk/lib-data.md":"\"1b6feb7043f5f630d2ba744100814a14\"","portfolio/content/sdk/lib-gateway.md":"\"44d4c09ef9020129dfe472061d26359b\"","portfolio/content/sdk/lib-security.md":"\"d8f8c087202e9c2e34e509d5c352c51a\""}
1
+ {"portfolio/_coverpage.md":"\"f957831627399d4be57ceda0fed32e20\"","portfolio/_sidebar.md":"\"a854b0dcd2d5c0eb4de979a93a232b45\"","portfolio/index.html":"\"9966477f3d373643c1cdff2dfde919d4\"","portfolio/content/_sidebar.md":"\"a854b0dcd2d5c0eb4de979a93a232b45\"","portfolio/content/api_reference.md":"\"d554e76f82877a86c6edfadb6c8ee9fc\"","portfolio/content/product_overview.md":"\"fde131b3a4a7c574a8f41ecfd7f202eb\"","portfolio/content/quick_start.md":"\"2e0d8de7247ebc847ad8a56619ef51d3\"","portfolio/content/release_notes.md":"\"1bd7efe30b675a8e3945070c7e9baf49\"","portfolio/content/sdk_reference.md":"\"a9c9669ce7a6478281ada65009738555\"","portfolio/styles/override.css":"\"9445e9c6a2bb7c2e435a09f22142a073\"","portfolio/static/openapi.yaml":"\"835322160925f1cf7e1e8534dec6fd12\"","portfolio/content/api/_sidebar.md":"\"60cdc1db76e58b2631a95a81411c6963\"","portfolio/content/api/components.md":"\"433f10a6c68ffce3920ece1db1de6b4a\"","portfolio/content/api/paths.md":"\"e11c608cde2a5ad94abe70d01bb43b95\"","portfolio/content/concepts/_sidebar.md":"\"a854b0dcd2d5c0eb4de979a93a232b45\"","portfolio/content/concepts/connecting_to_barchart.md":"\"ebbe0644caea27269ca2d553e9507bbc\"","portfolio/content/concepts/interaction_basics.md":"\"9fd648c53f183143f352e5d117739cdc\"","portfolio/content/concepts/understanding_corporate_actions.md":"\"d41d8cd98f00b204e9800998ecf8427e\"","portfolio/content/concepts/working_with_portfolios.md":"\"520310bbc64c34c82cb3fd9c28321eff\"","portfolio/content/concepts/working_with_positions.md":"\"fa78dc740b9c46b0c2c06e8d810f1a60\"","portfolio/content/concepts/working_with_summaries.md":"\"d41d8cd98f00b204e9800998ecf8427e\"","portfolio/content/concepts/working_with_transactions.md":"\"49f7be257a872ff55c08075ce8c376d0\"","portfolio/content/concepts/working_with_valuations.md":"\"63cd4b5926aae46d91e958d2532a4abd\"","portfolio/content/appendices/data_model_enumerations.md":"\"5180ae3da33e24780eaad020a5443f30\"","portfolio/content/appendices/data_model_structures.md":"\"0fa41f49c618a12c3adb83e496b77763\"","portfolio/content/appendices/demo_applications.md":"\"c26aef709b5c75f0f805f4904e9572a5\"","portfolio/content/appendices/other_services.md":"\"a078a70e4228b093c04329577dd1ad8e\"","portfolio/content/appendices/sample_code.md":"\"e41296a9fbaaab0f7e1355e10dc55493\"","portfolio/content/images/portfolio_ui_web.png":"\"d04afe475e03c1f2121f2a70130e7c42\"","portfolio/content/releases/3.0.0.md":"\"1484919526d7d08694b2ed5afbd84365\"","portfolio/content/releases/3.1.0.md":"\"f28a0be6fbeb32f59ca9ec6c2f9011b4\"","portfolio/content/releases/3.2.0.md":"\"b3b0c996fb4fc094459629a104c24ffb\"","portfolio/content/releases/3.3.0.md":"\"3bbcfedbeb75d5a3206000f85d095a88\"","portfolio/content/releases/3.4.0.md":"\"3a2ad68ebcf001714a163c0b7da74305\"","portfolio/content/releases/3.4.1.md":"\"2dcbc977a354c88cf359ff17b59a4008\"","portfolio/content/releases/4.0.0.md":"\"3e6acdcc34335a3b900a5a1df8b671f1\"","portfolio/content/releases/4.1.0.md":"\"e6f85264ab0ff56d17074c7c0e4d90c5\"","portfolio/content/releases/5.0.1.md":"\"14e442b964a30dab5f1e14edaf9674e9\"","portfolio/content/releases/5.1.0.md":"\"a5a7b4b37328cb60f1cade7ecd779a28\"","portfolio/content/releases/5.1.1.md":"\"4edc2e50d9d8bdd6b5d543f15c1365ea\"","portfolio/content/releases/5.1.2.md":"\"04fc554763d1d664610094d6e2145411\"","portfolio/content/releases/5.2.0.md":"\"08356e1c1d6c068c3aae73876ad941aa\"","portfolio/content/sdk/_sidebar.md":"\"d813bcd5bbfc603368856ca6f71dbee6\"","portfolio/content/sdk/lib-common.md":"\"bd35e956a85e420e62895442fd873d2a\"","portfolio/content/sdk/lib-data.md":"\"1b6feb7043f5f630d2ba744100814a14\"","portfolio/content/sdk/lib-gateway.md":"\"44d4c09ef9020129dfe472061d26359b\"","portfolio/content/sdk/lib-security.md":"\"d8f8c087202e9c2e34e509d5c352c51a\"","portfolio/content/releases/5.3.0.md":"\"7edf2fbbacef8befdeaf589d4fb190ce\""}
@@ -314,15 +314,18 @@ module.exports = (() => {
314
314
  .withPathBuilder((pb) => {
315
315
  pb.withLiteralParameter('version', REST_API_VERSION)
316
316
  .withLiteralParameter('portfolios', 'portfolios')
317
- .withVariableParameter('portfolio', 'portfolio', 'portfolio', false)
317
+ .withVariableParameter('portfolio', 'portfolio', 'transaction.portfolio', false)
318
318
  .withLiteralParameter('positions', 'positions')
319
- .withVariableParameter('position', 'position', 'position', false)
319
+ .withVariableParameter('position', 'position', 'transaction.position', false)
320
320
  .withLiteralParameter('transactions', 'transactions');
321
321
  })
322
322
  .withQueryBuilder((qb) => {
323
- qb.withVariableParameter('type', 'type', 'type', false, x => x.code);
323
+ qb.withVariableParameter('type', 'type', 'transaction.type', false, x => x.code)
324
+ .withVariableParameter('suppressCorporateActions', 'suppressCorporateActions', 'options.suppressCorporateActions', true, x => is.boolean(x) && x ? 'true' : x);
325
+ })
326
+ .withBodyBuilder((bb) => {
327
+ bb.withVariableParameter('body', 'body', 'transaction', false);
324
328
  })
325
- .withBody('transaction')
326
329
  .withRequestInterceptor(requestInterceptor)
327
330
  .withResponseInterceptor(responseInterceptorForPositionMutateDeserialization)
328
331
  .withErrorInterceptor(ErrorInterceptor.GENERAL)
@@ -895,9 +898,10 @@ module.exports = (() => {
895
898
  *
896
899
  * @public
897
900
  * @param {Schema.TransactionCreate} transaction
901
+ * @param {Object} options
898
902
  * @returns {Promise<Schema.TransactionMutateResult>}
899
903
  */
900
- createTransaction(transaction) {
904
+ createTransaction(transaction, options) {
901
905
  return Promise.resolve()
902
906
  .then(() => {
903
907
  checkStart.call(this);
@@ -905,6 +909,7 @@ module.exports = (() => {
905
909
  assert.argumentIsRequired(transaction, 'transaction', Object);
906
910
  assert.argumentIsRequired(transaction.portfolio, 'transaction.portfolio', String);
907
911
  assert.argumentIsOptional(transaction.position, 'transaction.position', String);
912
+ assert.argumentIsOptional(options, 'options', Object);
908
913
 
909
914
  if (!transaction.position) {
910
915
  transaction.position = 'new';
@@ -912,7 +917,12 @@ module.exports = (() => {
912
917
 
913
918
  const schema = getTransactionSchema(transaction);
914
919
 
915
- return Gateway.invoke(this._createTransactionEndpoint, schema.schema.format(transaction));
920
+ const payload = { };
921
+
922
+ payload.transaction = schema.schema.format(transaction);
923
+ payload.options = options || { };
924
+
925
+ return Gateway.invoke(this._createTransactionEndpoint, payload);
916
926
  });
917
927
  }
918
928
 
package/lib/index.js CHANGED
@@ -7,6 +7,6 @@ module.exports = (() => {
7
7
  return {
8
8
  JwtProvider: JwtProvider,
9
9
  PortfolioGateway: PortfolioGateway,
10
- version: '5.2.0'
10
+ version: '5.3.0'
11
11
  };
12
12
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-client-js",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "JavaScript SDK for Barchart's Portfolio Service",
5
5
  "homepage": "https://docs.barchart.com/portfolio/#/",
6
6
  "author": {