@alphapoint/apex-web 5.7.0 → 5.8.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.
Files changed (91) hide show
  1. package/lib/apex.integration.test.js +435 -0
  2. package/lib/apex.js +37 -1
  3. package/lib/apex.test.js +138 -0
  4. package/lib/components/2FA/PasskeyOption.js +126 -0
  5. package/lib/components/2FA/TwoFactorAuthComponent.js +24 -5
  6. package/lib/components/2FA/TwoFactorAuthComponent.test.js +94 -0
  7. package/lib/components/2FA/TwoFactorAuthContainer.js +94 -16
  8. package/lib/components/2FA/TwoFactorAuthContainer.test.js +412 -0
  9. package/lib/components/ConfirmBlockTradeModal/ConfirmBlockTradeModalContainer.js +34 -6
  10. package/lib/components/ConfirmBlockTradeModal/ConfirmBlockTradeModalContainer.test.js +298 -0
  11. package/lib/components/ConfirmOrderModal/ConfirmOrderModalComponent.js +26 -4
  12. package/lib/components/ConfirmOrderModal/ConfirmOrderModalContainer.js +4 -1
  13. package/lib/components/EnableTwoFactorAuth/Disable2FAForm.js +22 -7
  14. package/lib/components/EnableTwoFactorAuth/Disable2FAModal.js +15 -5
  15. package/lib/components/EnableTwoFactorAuth/Disable2FAModal.test.js +460 -0
  16. package/lib/components/EnableTwoFactorAuth/Disable2FAModalContainer.js +108 -16
  17. package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthContainerFactory.js +3 -2
  18. package/lib/components/FusionAuth/UnlinkOAuthIdentityModal.css +13 -0
  19. package/lib/components/FusionAuth/UnlinkOAuthIdentityModal.js +246 -0
  20. package/lib/components/FusionAuth/UnlinkOAuthIdentityModal.test.js +521 -0
  21. package/lib/components/Login/LoginFormComponent.js +1 -1
  22. package/lib/components/OrderEntryComponents/advancedForm/AdvancedOrderFormContainer.js +2 -0
  23. package/lib/components/OrderEntryComponents/common/FormAmountFields.js +5 -0
  24. package/lib/components/OrderEntryComponents/common/TwapScheduleFields.js +98 -0
  25. package/lib/components/OrderEntryComponents/defaultForm/OrderEntryAnchoring.js +86 -39
  26. package/lib/components/OrderEntryComponents/defaultForm/OrderEntryAnchoring.test.js +326 -0
  27. package/lib/components/OrderEntryComponents/defaultForm/OrderEntryContainer.js +10 -2
  28. package/lib/components/OrderHistoryComponents/DepositsStatus/DepositsStatusComponent.js +1 -1
  29. package/lib/components/OrderHistoryComponents/DepositsStatus/DepositsStatusComponent.test.js +99 -0
  30. package/lib/components/OrderHistoryComponents/InactiveOrders/InactiveOrdersComponent.js +1 -1
  31. package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.js +1 -1
  32. package/lib/components/OrderHistoryComponents/WithdrawStatus/WithdrawStatusComponent.js +1 -1
  33. package/lib/components/OrderHistoryComponents/WithdrawStatus/WithdrawStatusComponent.test.js +113 -0
  34. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/PasskeysSettingsCard.css +108 -0
  35. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/PasskeysSettingsCard.test.js +983 -0
  36. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/PasskeysSettingsCardComponent.js +500 -0
  37. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/index.js +9 -0
  38. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.css +4 -0
  39. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.js +29 -17
  40. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.test.js +135 -0
  41. package/lib/components/Settings/ProfileAndSecurity/TwoFactorAuthSettingsCard/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.test.js +23 -1
  42. package/lib/components/TwoFactorAuthForm/TwoFactorAuthForm.test.js +475 -0
  43. package/lib/components/TwoFactorAuthForm/TwoFactorAuthFormComponent.js +26 -5
  44. package/lib/components/TwoFactorAuthForm/TwoFactorAuthFormContainer.js +50 -32
  45. package/lib/components/common/APAutoTabInput/APAutoTabInput.js +5 -2
  46. package/lib/components/common/APSelect/APSelect.js +3 -1
  47. package/lib/config/CONFIG.md +4 -0
  48. package/lib/config/configDefault.json +2 -1
  49. package/lib/constants/sendOrder/orderEntryFormConstants.js +23 -4
  50. package/lib/constants/sendOrder/timeInForceConstants.js +3 -1
  51. package/lib/constants/sendOrder/twapRejectReasons.js +26 -0
  52. package/lib/helpers/orderHistoryHelper.js +13 -1
  53. package/lib/helpers/orderHistoryHelper.test.js +58 -13
  54. package/lib/helpers/passkeyApi.js +228 -0
  55. package/lib/helpers/passkeyApi.test.js +171 -0
  56. package/lib/helpers/placeOrderHelper.js +76 -61
  57. package/lib/helpers/placeOrderHelper.test.js +169 -10
  58. package/lib/helpers/recalculateOrderHelper.js +4 -1
  59. package/lib/helpers/recalculateOrderHelper.test.js +88 -2
  60. package/lib/helpers/twapOrderHelper.js +265 -0
  61. package/lib/helpers/twapOrderHelper.test.js +467 -0
  62. package/lib/helpers/webauthnHelper.js +300 -0
  63. package/lib/helpers/webauthnHelper.test.js +199 -0
  64. package/lib/hocs/withOneSubmission.js +168 -0
  65. package/lib/redux/actions/apiActions.js +52 -1
  66. package/lib/redux/actions/apiActions.test.js +135 -0
  67. package/lib/redux/actions/authActions.js +514 -198
  68. package/lib/redux/actions/authActions.test.js +627 -47
  69. package/lib/redux/actions/depositActions.js +1 -1
  70. package/lib/redux/actions/depositActions.test.js +100 -30
  71. package/lib/redux/actions/fusionAuthActions.test.js +265 -84
  72. package/lib/redux/actions/modalActions.js +1 -0
  73. package/lib/redux/actions/orderEntryActions.blockTrade.test.js +306 -0
  74. package/lib/redux/actions/orderEntryActions.js +74 -22
  75. package/lib/redux/actions/orderEntryActions.test.js +63 -11
  76. package/lib/redux/actions/orderHistoryActions.js +9 -4
  77. package/lib/redux/actions/orderHistoryActions.test.js +63 -0
  78. package/lib/redux/actions/userActions.js +314 -177
  79. package/lib/redux/actions/userActions.test.js +844 -268
  80. package/lib/redux/margin/actions/marginActions.js +6 -3
  81. package/lib/redux/margin/actions/marginActions.test.js +166 -0
  82. package/lib/redux/middlewares/authMiddleware.js +5 -0
  83. package/lib/redux/middlewares/authMiddleware.test.js +88 -29
  84. package/lib/redux/reducers/authReducer.js +1 -0
  85. package/lib/redux/reducers/authReducer.test.js +38 -0
  86. package/lib/redux/selectors/orderEntrySelector.js +19 -8
  87. package/lib/redux/selectors/orderEntrySelector.test.js +209 -0
  88. package/lib/redux/selectors/orderTotalSelector.test.js +40 -1
  89. package/lib/services/fms/fms.js +2 -0
  90. package/lib/services/fms/fms.test.js +35 -0
  91. package/package.json +4 -4
@@ -8,6 +8,7 @@ var apiActions = _interopRequireWildcard(require("./apiActions"));
8
8
  var _orderStateSubscriptionService = _interopRequireDefault(require("../../services/subscriptions/orderStateSubscriptionService"));
9
9
  var _orderTradesSuscriptionService = _interopRequireDefault(require("../../services/subscriptions/orderTradesSuscriptionService"));
10
10
  var _orderEntryActions = require("./orderEntryActions");
11
+ var _snackbarActions = require("./snackbarActions");
11
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
14
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
@@ -209,6 +210,68 @@ describe('order history actions', function () {
209
210
  store.dispatch(actions.subscribeToOrderHistory());
210
211
  expect(_orderEntryActions.showBuySellFailMessage).toHaveBeenCalled();
211
212
  });
213
+ it('should announce a TWAP being accepted', function () {
214
+ _orderStateSubscriptionService["default"].setUpdateValue({
215
+ OrderType: 'TWAP',
216
+ OrderState: 'Working',
217
+ CancelReason: 'NewInputAccepted'
218
+ });
219
+ store.dispatch(actions.subscribeToOrderHistory());
220
+ expect(_snackbarActions.showSnack).toHaveBeenCalledWith(expect.objectContaining({
221
+ text: 'Your order has been successfully added',
222
+ id: 'OrderStateEventSnackbar'
223
+ }));
224
+ });
225
+ it('should stay silent when the engine releases the next TWAP slice', function () {
226
+ _orderStateSubscriptionService["default"].setUpdateValue({
227
+ OrderType: 'TWAP',
228
+ OrderState: 'Working',
229
+ CancelReason: 'SystemModified_TwapRelease'
230
+ });
231
+ store.dispatch(actions.subscribeToOrderHistory());
232
+ expect(store.getActions().find(function (a) {
233
+ return a.type === actions.ADD_OPEN_ORDER;
234
+ })).toBeDefined();
235
+ expect(_snackbarActions.showSnack).not.toHaveBeenCalled();
236
+ });
237
+ it('should stay silent when a TWAP slice fills', function () {
238
+ _orderStateSubscriptionService["default"].setUpdateValue({
239
+ OrderType: 'TWAP',
240
+ OrderState: 'Working',
241
+ CancelReason: 'Trade'
242
+ });
243
+ store.dispatch(actions.subscribeToOrderHistory());
244
+ expect(store.getActions().find(function (a) {
245
+ return a.type === actions.ADD_OPEN_ORDER;
246
+ })).toBeDefined();
247
+ expect(_snackbarActions.showSnack).not.toHaveBeenCalled();
248
+ });
249
+ it('should say a TWAP has fully executed when its last slice fills', function () {
250
+ _orderStateSubscriptionService["default"].setUpdateValue({
251
+ OrderType: 'TWAP',
252
+ OrderState: 'FullyExecuted',
253
+ CancelReason: 'Trade'
254
+ });
255
+ store.dispatch(actions.subscribeToOrderHistory());
256
+ expect(store.getActions().find(function (a) {
257
+ return a.type === actions.ADD_INACTIVE_ORDER;
258
+ })).toBeDefined();
259
+ expect(_snackbarActions.showSnack).toHaveBeenCalledWith(expect.objectContaining({
260
+ text: 'Your TWAP order has fully executed'
261
+ }));
262
+ });
263
+ it('should translate a TWAP reject the engine reports asynchronously', function () {
264
+ _orderStateSubscriptionService["default"].setUpdateValue({
265
+ OrderType: 'TWAP',
266
+ OrderState: 'Rejected',
267
+ RejectReason: 'Twap_Slice_Below_Minimum'
268
+ });
269
+ store.dispatch(actions.subscribeToOrderHistory());
270
+ expect(_snackbarActions.showSnack).toHaveBeenCalledWith(expect.objectContaining({
271
+ type: 'warning',
272
+ text: "The TWAP slice is below the instrument's minimum quantity. Increase the amount or use fewer slices"
273
+ }));
274
+ });
212
275
  it('should subscribe to order trades updates', function () {
213
276
  store.dispatch(actions.subscribeToOrderHistory());
214
277
  expect(_orderTradesSuscriptionService["default"].subscribe).toHaveBeenCalled();