@quantform/core 0.7.0-beta.9 → 0.7.10
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/jest.config.ts +1 -1
- package/{dist → lib}/asset/asset.d.ts +3 -0
- package/lib/asset/asset.d.ts.map +1 -0
- package/{dist → lib}/asset/asset.js +7 -1
- package/{dist → lib}/cli/index.js +9 -6
- package/lib/cli/internal/script.d.ts +8 -0
- package/lib/cli/internal/script.d.ts.map +1 -0
- package/lib/cli/internal/script.js +65 -0
- package/lib/cli/live.d.ts +5 -0
- package/lib/cli/live.d.ts.map +1 -0
- package/lib/cli/live.js +33 -0
- package/lib/cli/paper.d.ts +5 -0
- package/lib/cli/paper.d.ts.map +1 -0
- package/lib/cli/paper.js +33 -0
- package/lib/cli/pull.d.ts.map +1 -0
- package/lib/cli/pull.js +28 -0
- package/lib/cli/replay.d.ts +6 -0
- package/lib/cli/replay.d.ts.map +1 -0
- package/lib/cli/replay.js +37 -0
- package/{dist → lib}/core.js +3 -3
- package/lib/index.d.ts +21 -0
- package/lib/index.d.ts.map +1 -0
- package/{dist → lib}/index.js +6 -13
- package/{dist → lib}/instrument/instrument.d.ts +3 -0
- package/lib/instrument/instrument.d.ts.map +1 -0
- package/{dist → lib}/instrument/instrument.js +7 -1
- package/{dist → lib}/make-test-module.d.ts +3 -2
- package/lib/make-test-module.d.ts.map +1 -0
- package/{dist → lib}/make-test-module.js +11 -2
- package/lib/operators.d.ts +5 -0
- package/lib/operators.d.ts.map +1 -0
- package/lib/operators.js +16 -0
- package/lib/replay/index.d.ts +10 -0
- package/lib/replay/index.d.ts.map +1 -0
- package/{dist → lib}/replay/index.js +7 -4
- package/lib/replay/replay-guard.d.ts +10 -0
- package/lib/replay/replay-guard.d.ts.map +1 -0
- package/lib/replay/replay-guard.js +8 -0
- package/lib/replay/replay.d.ts +10 -0
- package/lib/replay/replay.d.ts.map +1 -0
- package/lib/replay/replay.js +9 -0
- package/lib/replay/storage/use-replay-storage-buffer.d.ts +15 -0
- package/lib/replay/storage/use-replay-storage-buffer.d.ts.map +1 -0
- package/lib/replay/storage/use-replay-storage-buffer.js +57 -0
- package/lib/replay/storage/use-replay-storage-cursor.d.ts +30 -0
- package/lib/replay/storage/use-replay-storage-cursor.d.ts.map +1 -0
- package/lib/replay/storage/use-replay-storage-cursor.js +49 -0
- package/lib/replay/storage/use-replay-storage.d.ts +13 -0
- package/lib/replay/storage/use-replay-storage.d.ts.map +1 -0
- package/lib/replay/storage/use-replay-storage.js +39 -0
- package/lib/replay/storage/use-replay-storage.spec.d.ts +2 -0
- package/lib/replay/storage/use-replay-storage.spec.d.ts.map +1 -0
- package/lib/replay/storage/use-replay-storage.spec.js +74 -0
- package/lib/replay/use-replay-lock.d.ts +3 -0
- package/lib/replay/use-replay-lock.d.ts.map +1 -0
- package/lib/replay/use-replay-lock.js +22 -0
- package/lib/replay/use-replay-manager.d.ts +28 -0
- package/lib/replay/use-replay-manager.d.ts.map +1 -0
- package/lib/replay/use-replay-manager.js +68 -0
- package/{dist → lib}/replay/use-replay.d.ts +2 -2
- package/lib/replay/use-replay.d.ts.map +1 -0
- package/lib/replay/use-replay.js +20 -0
- package/lib/replay/use-replay.spec.js +130 -0
- package/lib/replay/when-replay-finished.d.ts +2 -0
- package/lib/replay/when-replay-finished.d.ts.map +1 -0
- package/lib/replay/when-replay-finished.js +15 -0
- package/{dist → lib}/session/use-session-storage.js +2 -2
- package/lib/session/use-session.d.ts +13 -0
- package/lib/session/use-session.d.ts.map +1 -0
- package/lib/session/use-session.js +14 -0
- package/lib/shared/decimals.d.ts +14 -0
- package/lib/shared/decimals.d.ts.map +1 -0
- package/lib/shared/decimals.js +18 -0
- package/{dist → lib}/simulator/use-simulator.spec.js +12 -18
- package/{dist → lib}/storage/index.d.ts +1 -0
- package/{dist → lib}/storage/index.d.ts.map +1 -1
- package/{dist → lib}/storage/index.js +1 -0
- package/lib/storage/use-storage-factory.d.ts +10 -0
- package/lib/storage/use-storage-factory.d.ts.map +1 -0
- package/lib/storage/use-storage-factory.js +13 -0
- package/lib/storage/use-storage.d.ts.map +1 -0
- package/{dist → lib}/storage/use-storage.js +2 -2
- package/lib/strategy.d.ts +15 -0
- package/lib/strategy.d.ts.map +1 -0
- package/lib/strategy.js +26 -0
- package/lib/strategy.spec.d.ts +2 -0
- package/lib/strategy.spec.d.ts.map +1 -0
- package/lib/strategy.spec.js +34 -0
- package/lib/use-execution-mode.d.ts +20 -0
- package/lib/use-execution-mode.d.ts.map +1 -0
- package/lib/use-execution-mode.js +33 -0
- package/{dist → lib}/use-logger.js +5 -5
- package/lib/use-memo.d.ts +8 -0
- package/lib/use-memo.d.ts.map +1 -0
- package/lib/use-memo.js +19 -0
- package/lib/use-socket.d.ts +20 -0
- package/lib/use-socket.d.ts.map +1 -0
- package/lib/use-socket.js +83 -0
- package/{dist → lib}/use-timestamp.js +2 -2
- package/lib/when-socket.d.ts +8 -0
- package/lib/when-socket.d.ts.map +1 -0
- package/{dist/use-socket.js → lib/when-socket.js} +6 -6
- package/lib/with-memo.d.ts +5 -0
- package/lib/with-memo.d.ts.map +1 -0
- package/{dist/use.js → lib/with-memo.js} +5 -5
- package/lib/with-memo.spec.d.ts +2 -0
- package/lib/with-memo.spec.d.ts.map +1 -0
- package/{dist/use.spec.js → lib/with-memo.spec.js} +3 -3
- package/{dist/use-request.d.ts → lib/with-request.d.ts} +6 -6
- package/lib/with-request.d.ts.map +1 -0
- package/lib/with-request.js +68 -0
- package/package.json +5 -5
- package/src/asset/asset.ts +6 -0
- package/src/cli/index.ts +11 -8
- package/src/cli/internal/script.ts +70 -0
- package/src/cli/live.ts +22 -0
- package/src/cli/paper.ts +22 -0
- package/src/cli/pull.ts +6 -66
- package/src/cli/replay.ts +15 -19
- package/src/core.ts +6 -6
- package/src/index.ts +6 -13
- package/src/instrument/instrument.ts +6 -0
- package/src/make-test-module.ts +20 -4
- package/src/operators.ts +18 -0
- package/src/replay/index.ts +7 -4
- package/src/replay/replay-guard.ts +11 -0
- package/src/replay/replay.ts +13 -0
- package/src/replay/storage/use-replay-storage-buffer.ts +52 -0
- package/src/replay/storage/use-replay-storage-cursor.ts +44 -0
- package/src/replay/storage/use-replay-storage.spec.ts +84 -0
- package/src/replay/storage/use-replay-storage.ts +29 -0
- package/src/replay/use-replay-lock.ts +29 -0
- package/src/replay/use-replay-manager.ts +83 -0
- package/src/replay/use-replay.spec.ts +10 -4
- package/src/replay/use-replay.ts +11 -17
- package/src/replay/when-replay-finished.ts +20 -0
- package/src/session/use-session-storage.ts +2 -2
- package/src/session/use-session.ts +16 -4
- package/src/shared/decimals.ts +0 -45
- package/src/simulator/use-simulator.spec.ts +10 -26
- package/src/storage/index.ts +1 -0
- package/src/storage/use-storage-factory.ts +7 -7
- package/src/storage/use-storage.ts +2 -2
- package/src/strategy.spec.ts +42 -0
- package/src/strategy.ts +36 -0
- package/src/use-execution-mode.ts +27 -27
- package/src/use-logger.ts +7 -7
- package/src/use-memo.ts +6 -21
- package/src/use-socket.ts +82 -45
- package/src/use-timestamp.ts +2 -2
- package/src/when-socket.ts +61 -0
- package/src/{use.spec.ts → with-memo.spec.ts} +3 -3
- package/src/{use.ts → with-memo.ts} +4 -4
- package/src/with-request.ts +83 -0
- package/tsconfig.json +2 -2
- package/dist/as-readonly.d.ts +0 -3
- package/dist/as-readonly.d.ts.map +0 -1
- package/dist/as-readonly.js +0 -8
- package/dist/asset/asset.d.ts.map +0 -1
- package/dist/cli/dev.d.ts +0 -2
- package/dist/cli/dev.d.ts.map +0 -1
- package/dist/cli/dev.js +0 -61
- package/dist/cli/pull.d.ts.map +0 -1
- package/dist/cli/pull.js +0 -107
- package/dist/cli/replay.d.ts +0 -2
- package/dist/cli/replay.d.ts.map +0 -1
- package/dist/cli/replay.js +0 -64
- package/dist/cli/run.d.ts +0 -2
- package/dist/cli/run.d.ts.map +0 -1
- package/dist/cli/run.js +0 -62
- package/dist/defined.d.ts +0 -3
- package/dist/defined.d.ts.map +0 -1
- package/dist/defined.js +0 -8
- package/dist/errored.d.ts +0 -2
- package/dist/errored.d.ts.map +0 -1
- package/dist/errored.js +0 -4
- package/dist/exclude.d.ts +0 -3
- package/dist/exclude.d.ts.map +0 -1
- package/dist/exclude.js +0 -8
- package/dist/index.d.ts +0 -28
- package/dist/index.d.ts.map +0 -1
- package/dist/instrument/instrument.d.ts.map +0 -1
- package/dist/make-test-module.d.ts.map +0 -1
- package/dist/replay/index.d.ts +0 -7
- package/dist/replay/index.d.ts.map +0 -1
- package/dist/replay/use-replay-coordinator.d.ts +0 -10
- package/dist/replay/use-replay-coordinator.d.ts.map +0 -1
- package/dist/replay/use-replay-coordinator.js +0 -119
- package/dist/replay/use-replay-reader.d.ts +0 -7
- package/dist/replay/use-replay-reader.d.ts.map +0 -1
- package/dist/replay/use-replay-reader.js +0 -32
- package/dist/replay/use-replay-reader.spec.d.ts +0 -2
- package/dist/replay/use-replay-reader.spec.d.ts.map +0 -1
- package/dist/replay/use-replay-reader.spec.js +0 -58
- package/dist/replay/use-replay-storage.d.ts +0 -10
- package/dist/replay/use-replay-storage.d.ts.map +0 -1
- package/dist/replay/use-replay-storage.js +0 -10
- package/dist/replay/use-replay-writer.d.ts +0 -6
- package/dist/replay/use-replay-writer.d.ts.map +0 -1
- package/dist/replay/use-replay-writer.js +0 -14
- package/dist/replay/use-replay-writer.spec.d.ts +0 -2
- package/dist/replay/use-replay-writer.spec.d.ts.map +0 -1
- package/dist/replay/use-replay-writer.spec.js +0 -53
- package/dist/replay/use-replay.d.ts.map +0 -1
- package/dist/replay/use-replay.js +0 -32
- package/dist/replay/use-replay.spec.js +0 -106
- package/dist/replay/with-replay.d.ts +0 -4
- package/dist/replay/with-replay.d.ts.map +0 -1
- package/dist/replay/with-replay.js +0 -8
- package/dist/session/use-session.d.ts +0 -4
- package/dist/session/use-session.d.ts.map +0 -1
- package/dist/session/use-session.js +0 -7
- package/dist/shared/decimals.d.ts +0 -30
- package/dist/shared/decimals.d.ts.map +0 -1
- package/dist/shared/decimals.js +0 -61
- package/dist/storage/use-storage-factory.d.ts +0 -10
- package/dist/storage/use-storage-factory.d.ts.map +0 -1
- package/dist/storage/use-storage-factory.js +0 -14
- package/dist/storage/use-storage.d.ts.map +0 -1
- package/dist/strat.d.ts +0 -7
- package/dist/strat.d.ts.map +0 -1
- package/dist/strat.js +0 -7
- package/dist/use-execution-mode.d.ts +0 -29
- package/dist/use-execution-mode.d.ts.map +0 -1
- package/dist/use-execution-mode.js +0 -37
- package/dist/use-lock.d.ts +0 -9
- package/dist/use-lock.d.ts.map +0 -1
- package/dist/use-lock.js +0 -40
- package/dist/use-memo.d.ts +0 -21
- package/dist/use-memo.d.ts.map +0 -1
- package/dist/use-memo.js +0 -35
- package/dist/use-request.d.ts.map +0 -1
- package/dist/use-request.js +0 -27
- package/dist/use-socket.d.ts +0 -6
- package/dist/use-socket.d.ts.map +0 -1
- package/dist/use-state.d.ts +0 -4
- package/dist/use-state.d.ts.map +0 -1
- package/dist/use-state.js +0 -24
- package/dist/use-state.spec.d.ts +0 -2
- package/dist/use-state.spec.d.ts.map +0 -1
- package/dist/use-state.spec.js +0 -36
- package/dist/use.d.ts +0 -5
- package/dist/use.d.ts.map +0 -1
- package/dist/use.spec.d.ts +0 -2
- package/dist/use.spec.d.ts.map +0 -1
- package/src/as-readonly.ts +0 -5
- package/src/cli/dev.ts +0 -31
- package/src/cli/run.ts +0 -29
- package/src/defined.ts +0 -6
- package/src/errored.ts +0 -1
- package/src/exclude.ts +0 -9
- package/src/replay/use-replay-coordinator.ts +0 -142
- package/src/replay/use-replay-reader.spec.ts +0 -64
- package/src/replay/use-replay-reader.ts +0 -23
- package/src/replay/use-replay-storage.ts +0 -8
- package/src/replay/use-replay-writer.spec.ts +0 -56
- package/src/replay/use-replay-writer.ts +0 -17
- package/src/replay/with-replay.ts +0 -10
- package/src/strat.ts +0 -7
- package/src/use-lock.ts +0 -52
- package/src/use-request.ts +0 -47
- package/src/use-state.spec.ts +0 -31
- package/src/use-state.ts +0 -30
- /package/{dist → lib}/asset/asset.spec.d.ts +0 -0
- /package/{dist → lib}/asset/asset.spec.d.ts.map +0 -0
- /package/{dist → lib}/asset/asset.spec.js +0 -0
- /package/{dist → lib}/asset/index.d.ts +0 -0
- /package/{dist → lib}/asset/index.d.ts.map +0 -0
- /package/{dist → lib}/asset/index.js +0 -0
- /package/{dist → lib}/cli/build.d.ts +0 -0
- /package/{dist → lib}/cli/build.d.ts.map +0 -0
- /package/{dist → lib}/cli/build.js +0 -0
- /package/{dist → lib}/cli/index.d.ts +0 -0
- /package/{dist → lib}/cli/index.d.ts.map +0 -0
- /package/{dist → lib}/cli/internal/workspace.d.ts +0 -0
- /package/{dist → lib}/cli/internal/workspace.d.ts.map +0 -0
- /package/{dist → lib}/cli/internal/workspace.js +0 -0
- /package/{dist → lib}/cli/pull.d.ts +0 -0
- /package/{dist → lib}/component/distinct-until-timesamp-changed.d.ts +0 -0
- /package/{dist → lib}/component/distinct-until-timesamp-changed.d.ts.map +0 -0
- /package/{dist → lib}/component/distinct-until-timesamp-changed.js +0 -0
- /package/{dist → lib}/component/error.d.ts +0 -0
- /package/{dist → lib}/component/error.d.ts.map +0 -0
- /package/{dist → lib}/component/error.js +0 -0
- /package/{dist → lib}/component/index.d.ts +0 -0
- /package/{dist → lib}/component/index.d.ts.map +0 -0
- /package/{dist → lib}/component/index.js +0 -0
- /package/{dist → lib}/component/ohlc-operator.d.ts +0 -0
- /package/{dist → lib}/component/ohlc-operator.d.ts.map +0 -0
- /package/{dist → lib}/component/ohlc-operator.js +0 -0
- /package/{dist → lib}/component/ohlc-operator.spec.d.ts +0 -0
- /package/{dist → lib}/component/ohlc-operator.spec.d.ts.map +0 -0
- /package/{dist → lib}/component/ohlc-operator.spec.js +0 -0
- /package/{dist → lib}/component/ohlc.d.ts +0 -0
- /package/{dist → lib}/component/ohlc.d.ts.map +0 -0
- /package/{dist → lib}/component/ohlc.js +0 -0
- /package/{dist → lib}/component/ohlc.spec.d.ts +0 -0
- /package/{dist → lib}/component/ohlc.spec.d.ts.map +0 -0
- /package/{dist → lib}/component/ohlc.spec.js +0 -0
- /package/{dist → lib}/component/timeframe.d.ts +0 -0
- /package/{dist → lib}/component/timeframe.d.ts.map +0 -0
- /package/{dist → lib}/component/timeframe.js +0 -0
- /package/{dist → lib}/core.d.ts +0 -0
- /package/{dist → lib}/core.d.ts.map +0 -0
- /package/{dist → lib}/instrument/commission/commission.d.ts +0 -0
- /package/{dist → lib}/instrument/commission/commission.d.ts.map +0 -0
- /package/{dist → lib}/instrument/commission/commission.js +0 -0
- /package/{dist → lib}/instrument/commission/commission.spec.d.ts +0 -0
- /package/{dist → lib}/instrument/commission/commission.spec.d.ts.map +0 -0
- /package/{dist → lib}/instrument/commission/commission.spec.js +0 -0
- /package/{dist → lib}/instrument/index.d.ts +0 -0
- /package/{dist → lib}/instrument/index.d.ts.map +0 -0
- /package/{dist → lib}/instrument/index.js +0 -0
- /package/{dist → lib}/instrument/instrument.spec.d.ts +0 -0
- /package/{dist → lib}/instrument/instrument.spec.d.ts.map +0 -0
- /package/{dist → lib}/instrument/instrument.spec.js +0 -0
- /package/{dist → lib}/module.d.ts +0 -0
- /package/{dist → lib}/module.d.ts.map +0 -0
- /package/{dist → lib}/module.js +0 -0
- /package/{dist → lib}/module.spec.d.ts +0 -0
- /package/{dist → lib}/module.spec.d.ts.map +0 -0
- /package/{dist → lib}/module.spec.js +0 -0
- /package/{dist → lib}/replay/use-replay-options.d.ts +0 -0
- /package/{dist → lib}/replay/use-replay-options.d.ts.map +0 -0
- /package/{dist → lib}/replay/use-replay-options.js +0 -0
- /package/{dist → lib}/replay/use-replay.spec.d.ts +0 -0
- /package/{dist → lib}/replay/use-replay.spec.d.ts.map +0 -0
- /package/{dist → lib}/session/index.d.ts +0 -0
- /package/{dist → lib}/session/index.d.ts.map +0 -0
- /package/{dist → lib}/session/index.js +0 -0
- /package/{dist → lib}/session/use-session-object.d.ts +0 -0
- /package/{dist → lib}/session/use-session-object.d.ts.map +0 -0
- /package/{dist → lib}/session/use-session-object.js +0 -0
- /package/{dist → lib}/session/use-session-storage.d.ts +0 -0
- /package/{dist → lib}/session/use-session-storage.d.ts.map +0 -0
- /package/{dist → lib}/shared/datetime.d.ts +0 -0
- /package/{dist → lib}/shared/datetime.d.ts.map +0 -0
- /package/{dist → lib}/shared/datetime.js +0 -0
- /package/{dist → lib}/shared/decimals.spec.d.ts +0 -0
- /package/{dist → lib}/shared/decimals.spec.d.ts.map +0 -0
- /package/{dist → lib}/shared/decimals.spec.js +0 -0
- /package/{dist → lib}/shared/environment.d.ts +0 -0
- /package/{dist → lib}/shared/environment.d.ts.map +0 -0
- /package/{dist → lib}/shared/environment.js +0 -0
- /package/{dist → lib}/shared/index.d.ts +0 -0
- /package/{dist → lib}/shared/index.d.ts.map +0 -0
- /package/{dist → lib}/shared/index.js +0 -0
- /package/{dist → lib}/simulator/index.d.ts +0 -0
- /package/{dist → lib}/simulator/index.d.ts.map +0 -0
- /package/{dist → lib}/simulator/index.js +0 -0
- /package/{dist → lib}/simulator/use-simulator.d.ts +0 -0
- /package/{dist → lib}/simulator/use-simulator.d.ts.map +0 -0
- /package/{dist → lib}/simulator/use-simulator.js +0 -0
- /package/{dist → lib}/simulator/use-simulator.spec.d.ts +0 -0
- /package/{dist → lib}/simulator/use-simulator.spec.d.ts.map +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.d.ts +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.d.ts.map +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.factory.d.ts +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.factory.d.ts.map +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.factory.js +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.js +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.spec.d.ts +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.spec.d.ts.map +0 -0
- /package/{dist → lib}/storage/in-memory/in-memory-storage.spec.js +0 -0
- /package/{dist → lib}/storage/in-memory/index.d.ts +0 -0
- /package/{dist → lib}/storage/in-memory/index.d.ts.map +0 -0
- /package/{dist → lib}/storage/in-memory/index.js +0 -0
- /package/{dist → lib}/storage/storage.d.ts +0 -0
- /package/{dist → lib}/storage/storage.d.ts.map +0 -0
- /package/{dist → lib}/storage/storage.js +0 -0
- /package/{dist → lib}/storage/use-cache.d.ts +0 -0
- /package/{dist → lib}/storage/use-cache.d.ts.map +0 -0
- /package/{dist → lib}/storage/use-cache.js +0 -0
- /package/{dist → lib}/storage/use-cache.spec.d.ts +0 -0
- /package/{dist → lib}/storage/use-cache.spec.d.ts.map +0 -0
- /package/{dist → lib}/storage/use-cache.spec.js +0 -0
- /package/{dist → lib}/storage/use-storage.d.ts +0 -0
- /package/{dist → lib}/use-hash.d.ts +0 -0
- /package/{dist → lib}/use-hash.d.ts.map +0 -0
- /package/{dist → lib}/use-hash.js +0 -0
- /package/{dist → lib}/use-hash.spec.d.ts +0 -0
- /package/{dist → lib}/use-hash.spec.d.ts.map +0 -0
- /package/{dist → lib}/use-hash.spec.js +0 -0
- /package/{dist → lib}/use-logger.d.ts +0 -0
- /package/{dist → lib}/use-logger.d.ts.map +0 -0
- /package/{dist → lib}/use-memo.spec.d.ts +0 -0
- /package/{dist → lib}/use-memo.spec.d.ts.map +0 -0
- /package/{dist → lib}/use-memo.spec.js +0 -0
- /package/{dist → lib}/use-timestamp.d.ts +0 -0
- /package/{dist → lib}/use-timestamp.d.ts.map +0 -0
package/jest.config.ts
CHANGED
|
@@ -23,7 +23,7 @@ const config: Config = {
|
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
|
-
testPathIgnorePatterns: ['<rootDir>/
|
|
26
|
+
testPathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/src/cli/test.ts'],
|
|
27
27
|
roots: ['<rootDir>'],
|
|
28
28
|
modulePaths: [compilerOptions.baseUrl],
|
|
29
29
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { decimal } from '../shared';
|
|
2
2
|
export declare const AssetSelectorSeparator = ":";
|
|
3
|
+
export declare class MissingAssetError extends Error {
|
|
4
|
+
constructor(asset: AssetSelector);
|
|
5
|
+
}
|
|
3
6
|
/**
|
|
4
7
|
* Supposed to query specific @see Asset based on string notation.
|
|
5
8
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/asset/asset.ts"],"names":[],"mappings":"AACA,OAAO,EAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,KAAK,EAAE,aAAa;CAGjC;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAc7C,QAAQ;CAGT;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAQvD;AAED;;;GAGG;AACH,qBAAa,KAAM,SAAQ,aAAa;aAGyB,KAAK,EAAE,MAAM;IAF5E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;gBAEf,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAkB,KAAK,EAAE,MAAM;IAU5E;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM;IAI9B;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IAI/B;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;CAG/B"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Asset = exports.assetOf = exports.AssetSelector = exports.AssetSelectorSeparator = void 0;
|
|
3
|
+
exports.Asset = exports.assetOf = exports.AssetSelector = exports.MissingAssetError = exports.AssetSelectorSeparator = void 0;
|
|
4
4
|
const component_1 = require("../component");
|
|
5
5
|
const shared_1 = require("../shared");
|
|
6
6
|
exports.AssetSelectorSeparator = ':';
|
|
7
|
+
class MissingAssetError extends Error {
|
|
8
|
+
constructor(asset) {
|
|
9
|
+
super(`Missing asset: ${asset}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.MissingAssetError = MissingAssetError;
|
|
7
13
|
/**
|
|
8
14
|
* Supposed to query specific @see Asset based on string notation.
|
|
9
15
|
*/
|
|
@@ -17,10 +17,10 @@ const child_process_1 = require("child_process");
|
|
|
17
17
|
const commander_1 = require("commander");
|
|
18
18
|
const node_watch_1 = __importDefault(require("node-watch"));
|
|
19
19
|
const build_1 = __importDefault(require("../cli/build"));
|
|
20
|
-
const
|
|
20
|
+
const live_1 = __importDefault(require("../cli/live"));
|
|
21
|
+
const paper_1 = __importDefault(require("../cli/paper"));
|
|
21
22
|
const pull_1 = __importDefault(require("../cli/pull"));
|
|
22
23
|
const replay_1 = __importDefault(require("../cli/replay"));
|
|
23
|
-
const run_1 = __importDefault(require("../cli/run"));
|
|
24
24
|
commander_1.program
|
|
25
25
|
.command('build')
|
|
26
26
|
.description('builds a production version of the app')
|
|
@@ -28,23 +28,26 @@ commander_1.program
|
|
|
28
28
|
yield (0, build_1.default)();
|
|
29
29
|
}));
|
|
30
30
|
commander_1.program
|
|
31
|
-
.command('
|
|
31
|
+
.command('live')
|
|
32
32
|
.argument('<name>', 'strategy to execute')
|
|
33
33
|
.option('-i, --id <id>', 'session identifier')
|
|
34
|
+
.option('-r, --recording', 'recording mode for replay purposes')
|
|
34
35
|
.option('-w', 'watch mode')
|
|
35
36
|
.description('executes strategy in live trading mode')
|
|
36
|
-
.action(
|
|
37
|
+
.action(live_1.default);
|
|
37
38
|
commander_1.program
|
|
38
|
-
.command('
|
|
39
|
+
.command('paper')
|
|
39
40
|
.argument('<name>', 'strategy to execute')
|
|
40
41
|
.option('-i, --id <id>', 'session identifier')
|
|
42
|
+
.option('-r, --recording', 'recording mode for replay purposes')
|
|
41
43
|
.option('-w', 'watch mode')
|
|
42
44
|
.description('executes strategy in paper e.g. simulation mode')
|
|
43
|
-
.action(
|
|
45
|
+
.action(paper_1.default);
|
|
44
46
|
commander_1.program
|
|
45
47
|
.command('replay')
|
|
46
48
|
.description('executes strategy in backtesting mode for specified period')
|
|
47
49
|
.argument('<name>', 'strategy to execute')
|
|
50
|
+
.option('-i, --id <id>', 'session identifier')
|
|
48
51
|
.option('-f, --from <from>', 'date from')
|
|
49
52
|
.option('-t, --to <to>', 'date to')
|
|
50
53
|
.option('-w', 'watch mode')
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Dependency } from '../../module';
|
|
2
|
+
export declare class Script {
|
|
3
|
+
private readonly filename;
|
|
4
|
+
private readonly dependencies;
|
|
5
|
+
constructor(filename: string, dependencies: Dependency[]);
|
|
6
|
+
run(): Promise<unknown[]>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/cli/internal/script.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAMjD,qBAAa,MAAM;IAEf,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,UAAU,EAAE;IAGvC,GAAG;CA0CV"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.Script = void 0;
|
|
36
|
+
const path_1 = require("path");
|
|
37
|
+
const rxjs_1 = require("rxjs");
|
|
38
|
+
const core_1 = require("../../core");
|
|
39
|
+
const module_1 = require("../../module");
|
|
40
|
+
const replay_1 = require("../../replay");
|
|
41
|
+
const workspace_1 = require("./workspace");
|
|
42
|
+
class Script {
|
|
43
|
+
constructor(filename, dependencies) {
|
|
44
|
+
this.filename = filename;
|
|
45
|
+
this.dependencies = dependencies;
|
|
46
|
+
}
|
|
47
|
+
run() {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const script = yield Promise.resolve(`${(0, path_1.join)((0, workspace_1.buildDirectory)(), this.filename)}`).then(s => __importStar(require(s)));
|
|
50
|
+
const { dependencies, description } = script.default;
|
|
51
|
+
const module = new module_1.Module([...(0, core_1.core)(), ...dependencies, ...this.dependencies]);
|
|
52
|
+
const { act } = yield module.awake();
|
|
53
|
+
return yield act(() => {
|
|
54
|
+
process.stdin.resume();
|
|
55
|
+
return (0, rxjs_1.firstValueFrom)((0, rxjs_1.merge)((0, rxjs_1.forkJoin)(description.before.map(before => before()))
|
|
56
|
+
.pipe((0, rxjs_1.switchMap)(() => (0, rxjs_1.forkJoin)(description.behavior.map(behavior => behavior())).pipe((0, rxjs_1.last)())))
|
|
57
|
+
.pipe((0, rxjs_1.last)()), (0, replay_1.whenReplayFinished)().pipe((0, rxjs_1.last)()), (0, rxjs_1.fromEvent)(process, 'exit'), (0, rxjs_1.fromEvent)(process, 'SIGINT'), (0, rxjs_1.fromEvent)(process, 'SIGUSR1'), (0, rxjs_1.fromEvent)(process, 'SIGUSR2'), (0, rxjs_1.fromEvent)(process, 'uncaughtException')).pipe((0, rxjs_1.catchError)(e => {
|
|
58
|
+
console.error(e);
|
|
59
|
+
return (0, rxjs_1.of)(e);
|
|
60
|
+
}), (0, rxjs_1.take)(1), (0, rxjs_1.switchMap)(it => { var _a; return (_a = (0, rxjs_1.forkJoin)(description.after.map(after => after())).pipe((0, rxjs_1.last)())) !== null && _a !== void 0 ? _a : (0, rxjs_1.of)(it); }), (0, rxjs_1.finalize)(() => process.exit(0))));
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Script = Script;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../src/cli/live.ts"],"names":[],"mappings":"AAMA,yBACE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,iBAa9C"}
|
package/lib/cli/live.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const build_1 = __importDefault(require("../cli/build"));
|
|
16
|
+
const session_1 = require("../session");
|
|
17
|
+
const use_execution_mode_1 = require("../use-execution-mode");
|
|
18
|
+
const script_1 = require("./internal/script");
|
|
19
|
+
function default_1(name, options) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
if (yield (0, build_1.default)()) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const script = new script_1.Script(name, [
|
|
26
|
+
session_1.useSession.options({ id: (_a = options.id) !== null && _a !== void 0 ? _a : Date.now().toString() }),
|
|
27
|
+
use_execution_mode_1.useExecutionMode.liveOptions({ recording: (_b = options.recording) !== null && _b !== void 0 ? _b : false })
|
|
28
|
+
]);
|
|
29
|
+
const output = yield script.run();
|
|
30
|
+
console.log(output);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.default = default_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paper.d.ts","sourceRoot":"","sources":["../../src/cli/paper.ts"],"names":[],"mappings":"AAMA,yBACE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,iBAa9C"}
|
package/lib/cli/paper.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const build_1 = __importDefault(require("../cli/build"));
|
|
16
|
+
const session_1 = require("../session");
|
|
17
|
+
const use_execution_mode_1 = require("../use-execution-mode");
|
|
18
|
+
const script_1 = require("./internal/script");
|
|
19
|
+
function default_1(name, options) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
if (yield (0, build_1.default)()) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const script = new script_1.Script(name, [
|
|
26
|
+
session_1.useSession.options({ id: (_a = options.id) !== null && _a !== void 0 ? _a : Date.now().toString() }),
|
|
27
|
+
use_execution_mode_1.useExecutionMode.paperOptions({ recording: (_b = options.recording) !== null && _b !== void 0 ? _b : false })
|
|
28
|
+
]);
|
|
29
|
+
const output = yield script.run();
|
|
30
|
+
console.log(output);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.default = default_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/cli/pull.ts"],"names":[],"mappings":"AAKA,yBAA+B,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,iBAS5E"}
|
package/lib/cli/pull.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const build_1 = __importDefault(require("../cli/build"));
|
|
16
|
+
const use_execution_mode_1 = require("../use-execution-mode");
|
|
17
|
+
const script_1 = require("./internal/script");
|
|
18
|
+
function default_1(name, instrument, options) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
if (yield (0, build_1.default)()) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const script = new script_1.Script(name, [use_execution_mode_1.useExecutionMode.idleOptions()]);
|
|
24
|
+
//const output = await script.run();
|
|
25
|
+
//console.log(output);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.default = default_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/cli/replay.ts"],"names":[],"mappings":"AAOA,yBACE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,iBAiBrD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const build_1 = __importDefault(require("../cli/build"));
|
|
16
|
+
const replay_1 = require("../replay");
|
|
17
|
+
const session_1 = require("../session");
|
|
18
|
+
const use_execution_mode_1 = require("../use-execution-mode");
|
|
19
|
+
const script_1 = require("./internal/script");
|
|
20
|
+
function default_1(name, options) {
|
|
21
|
+
var _a;
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
if (yield (0, build_1.default)()) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const from = options.from ? new Date(options.from).getTime() : 0;
|
|
27
|
+
const to = options.to ? new Date(options.to).getTime() : Number.MAX_VALUE;
|
|
28
|
+
const script = new script_1.Script(name, [
|
|
29
|
+
session_1.useSession.options({ id: (_a = options.id) !== null && _a !== void 0 ? _a : Date.now().toString() }),
|
|
30
|
+
(0, replay_1.replayOptions)({ from, to }),
|
|
31
|
+
use_execution_mode_1.useExecutionMode.replayOptions()
|
|
32
|
+
]);
|
|
33
|
+
const output = yield script.run();
|
|
34
|
+
console.log(output);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.default = default_1;
|
package/{dist → lib}/core.js
RENAMED
|
@@ -7,9 +7,9 @@ const use_storage_factory_1 = require("./storage/use-storage-factory");
|
|
|
7
7
|
const use_execution_mode_1 = require("./use-execution-mode");
|
|
8
8
|
function core() {
|
|
9
9
|
return [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
use_memo_1.useMemo.options(),
|
|
11
|
+
use_execution_mode_1.useExecutionMode.paperOptions({ recording: false }),
|
|
12
|
+
use_storage_factory_1.useStorageFactory.options(new storage_1.InMemoryStorageFactory())
|
|
13
13
|
];
|
|
14
14
|
}
|
|
15
15
|
exports.core = core;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './component';
|
|
2
|
+
export * from './shared';
|
|
3
|
+
export * from './storage';
|
|
4
|
+
export * from './module';
|
|
5
|
+
export * from './use-memo';
|
|
6
|
+
export * from './use-timestamp';
|
|
7
|
+
export * from './simulator';
|
|
8
|
+
export * from './make-test-module';
|
|
9
|
+
export * from './core';
|
|
10
|
+
export * from './use-execution-mode';
|
|
11
|
+
export * from './storage';
|
|
12
|
+
export * from './use-logger';
|
|
13
|
+
export * from './replay';
|
|
14
|
+
export * from './use-socket';
|
|
15
|
+
export * from './when-socket';
|
|
16
|
+
export * from './with-request';
|
|
17
|
+
export * from './with-memo';
|
|
18
|
+
export * from './session';
|
|
19
|
+
export * from './strategy';
|
|
20
|
+
export * from './operators';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
package/{dist → lib}/index.js
RENAMED
|
@@ -23,21 +23,14 @@ __exportStar(require("./use-timestamp"), exports);
|
|
|
23
23
|
__exportStar(require("./simulator"), exports);
|
|
24
24
|
__exportStar(require("./make-test-module"), exports);
|
|
25
25
|
__exportStar(require("./core"), exports);
|
|
26
|
-
__exportStar(require("./use-state"), exports);
|
|
27
|
-
__exportStar(require("./replay/use-replay-coordinator"), exports);
|
|
28
26
|
__exportStar(require("./use-execution-mode"), exports);
|
|
29
|
-
__exportStar(require("./storage
|
|
30
|
-
__exportStar(require("./storage/use-cache"), exports);
|
|
27
|
+
__exportStar(require("./storage"), exports);
|
|
31
28
|
__exportStar(require("./use-logger"), exports);
|
|
32
29
|
__exportStar(require("./replay"), exports);
|
|
33
|
-
__exportStar(require("./replay/use-replay-coordinator"), exports);
|
|
34
30
|
__exportStar(require("./use-socket"), exports);
|
|
35
|
-
__exportStar(require("./
|
|
36
|
-
__exportStar(require("./
|
|
37
|
-
__exportStar(require("./
|
|
38
|
-
__exportStar(require("./use"), exports);
|
|
31
|
+
__exportStar(require("./when-socket"), exports);
|
|
32
|
+
__exportStar(require("./with-request"), exports);
|
|
33
|
+
__exportStar(require("./with-memo"), exports);
|
|
39
34
|
__exportStar(require("./session"), exports);
|
|
40
|
-
__exportStar(require("./
|
|
41
|
-
__exportStar(require("./
|
|
42
|
-
__exportStar(require("./strat"), exports);
|
|
43
|
-
__exportStar(require("./errored"), exports);
|
|
35
|
+
__exportStar(require("./strategy"), exports);
|
|
36
|
+
__exportStar(require("./operators"), exports);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Asset, AssetSelector } from '../asset';
|
|
2
2
|
import { Commission } from './commission/commission';
|
|
3
3
|
export declare const InstrumentSelectorSeparator = "-";
|
|
4
|
+
export declare class MissingInstrumentError extends Error {
|
|
5
|
+
constructor(instrument: InstrumentSelector);
|
|
6
|
+
}
|
|
4
7
|
export declare class InstrumentSelector {
|
|
5
8
|
readonly id: string;
|
|
6
9
|
readonly base: AssetSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../../src/instrument/instrument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAA0B,MAAM,YAAY,CAAC;AAG1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,UAAU,EAAE,kBAAkB;CAG3C;AAED,qBAAa,kBAAkB;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;gBAElB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAOxD,QAAQ;CAGT;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,kBAAkB;IAKvC,SAAS,EAAE,MAAM;aACN,IAAI,EAAE,KAAK;aACX,KAAK,EAAE,KAAK;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM;IACb,UAAU,EAAE,UAAU;IAR/B,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;IACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAa;gBAGhC,SAAS,EAAE,MAAM,EACN,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,KAAK,EACrB,GAAG,EAAE,MAAM,EACb,UAAU,EAAE,UAAU;CAQhC;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAYjE"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.instrumentOf = exports.Instrument = exports.InstrumentSelector = exports.InstrumentSelectorSeparator = void 0;
|
|
3
|
+
exports.instrumentOf = exports.Instrument = exports.InstrumentSelector = exports.MissingInstrumentError = exports.InstrumentSelectorSeparator = void 0;
|
|
4
4
|
const asset_1 = require("../asset");
|
|
5
5
|
const component_1 = require("../component");
|
|
6
6
|
exports.InstrumentSelectorSeparator = '-';
|
|
7
|
+
class MissingInstrumentError extends Error {
|
|
8
|
+
constructor(instrument) {
|
|
9
|
+
super(`Missing instrument: ${instrument}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.MissingInstrumentError = MissingInstrumentError;
|
|
7
13
|
class InstrumentSelector {
|
|
8
14
|
constructor(base, quote, adapter) {
|
|
9
15
|
this.base = new asset_1.AssetSelector(base.toLowerCase(), adapter.toLowerCase());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
3
|
import { Dependency } from './module';
|
|
4
4
|
export declare function makeTestModule(dependencies: Dependency[]): Promise<{
|
|
5
5
|
act: <T>(func: () => T) => T;
|
|
@@ -7,7 +7,8 @@ export declare function makeTestModule(dependencies: Dependency[]): Promise<{
|
|
|
7
7
|
}>;
|
|
8
8
|
type MockableFunction = (...args: any[]) => any;
|
|
9
9
|
export declare const mockedFunc: <Func extends MockableFunction>(mockedFunc: Func) => jest.MockedFunction<Func>;
|
|
10
|
-
export declare function toArray<T>(observable: Observable<T>): T[];
|
|
10
|
+
export declare function toArray<T>(observable: Observable<T>): (Error | T)[];
|
|
11
11
|
export type InferObservableType<T> = T extends Observable<infer U> ? U : never;
|
|
12
|
+
export declare function mockSubject<T extends jest.FunctionProperties<Required<T>>, M extends keyof jest.FunctionProperties<Required<T>>>(object: T, method: M): Subject<InferObservableType<ReturnType<jest.FunctionProperties<Required<T>>[M]>>>;
|
|
12
13
|
export {};
|
|
13
14
|
//# sourceMappingURL=make-test-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-test-module.d.ts","sourceRoot":"","sources":["../src/make-test-module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAEjD,wBAAsB,cAAc,CAAC,YAAY,EAAE,UAAU,EAAE;;;GAS9D;AAED,KAAK,gBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAEhD,eAAO,MAAM,UAAU,gFAC+B,CAAC;AAEvD,wBAAgB,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,iBAyBnD;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE/E,wBAAgB,WAAW,CACzB,CAAC,SAAS,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC9C,CAAC,SAAS,MAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACpD,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,qFAQrB"}
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.toArray = exports.mockedFunc = exports.makeTestModule = void 0;
|
|
12
|
+
exports.mockSubject = exports.toArray = exports.mockedFunc = exports.makeTestModule = void 0;
|
|
13
13
|
const rxjs_1 = require("rxjs");
|
|
14
14
|
const core_1 = require("./core");
|
|
15
15
|
const module_1 = require("./module");
|
|
@@ -40,7 +40,16 @@ function toArray(observable) {
|
|
|
40
40
|
}
|
|
41
41
|
return it;
|
|
42
42
|
};
|
|
43
|
-
observable.
|
|
43
|
+
observable.subscribe({
|
|
44
|
+
next: it => array.push(clone(it)),
|
|
45
|
+
error: it => array.push(it)
|
|
46
|
+
});
|
|
44
47
|
return array;
|
|
45
48
|
}
|
|
46
49
|
exports.toArray = toArray;
|
|
50
|
+
function mockSubject(object, method) {
|
|
51
|
+
const subject = new rxjs_1.Subject();
|
|
52
|
+
jest.spyOn(object, method).mockReturnValue(subject.asObservable());
|
|
53
|
+
return subject;
|
|
54
|
+
}
|
|
55
|
+
exports.mockSubject = mockSubject;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare function asReadonly<T>(): (input: Observable<T>) => Observable<Readonly<T>>;
|
|
3
|
+
export declare function defined<T>(): (observable: Observable<T | undefined | null>) => Observable<T | null | undefined>;
|
|
4
|
+
export declare function exclude<T, S extends symbol>(s: S): (observable: Observable<T | S>) => Observable<Exclude<T, S>>;
|
|
5
|
+
//# sourceMappingURL=operators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../src/operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,MAAM,CAAC;AAE/C,wBAAgB,UAAU,CAAC,CAAC,aACX,WAAW,CAAC,CAAC,6BAC7B;AAED,wBAAgB,OAAO,CAAC,CAAC,kBACH,WAAW,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,sCAErD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,gBAC3B,WAAW,CAAC,GAAG,CAAC,CAAC,+BAKtC"}
|
package/lib/operators.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exclude = exports.defined = exports.asReadonly = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
function asReadonly() {
|
|
6
|
+
return (input) => input.pipe((0, rxjs_1.map)(it => it));
|
|
7
|
+
}
|
|
8
|
+
exports.asReadonly = asReadonly;
|
|
9
|
+
function defined() {
|
|
10
|
+
return (observable) => observable.pipe((0, rxjs_1.filter)(it => it !== undefined && it !== null));
|
|
11
|
+
}
|
|
12
|
+
exports.defined = defined;
|
|
13
|
+
function exclude(s) {
|
|
14
|
+
return (observable) => observable.pipe((0, rxjs_1.filter)(it => it !== s), (0, rxjs_1.map)(it => it));
|
|
15
|
+
}
|
|
16
|
+
exports.exclude = exclude;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './use-replay';
|
|
2
|
+
export * from './use-replay-lock';
|
|
3
|
+
export * from './use-replay-options';
|
|
4
|
+
export * from './storage/use-replay-storage';
|
|
5
|
+
export * from './storage/use-replay-storage-buffer';
|
|
6
|
+
export * from './use-replay-manager';
|
|
7
|
+
export * from './when-replay-finished';
|
|
8
|
+
export * from './replay';
|
|
9
|
+
export * from './replay-guard';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replay/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -15,8 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./use-replay"), exports);
|
|
18
|
-
__exportStar(require("./use-replay-
|
|
18
|
+
__exportStar(require("./use-replay-lock"), exports);
|
|
19
19
|
__exportStar(require("./use-replay-options"), exports);
|
|
20
|
-
__exportStar(require("./use-replay-
|
|
21
|
-
__exportStar(require("./use-replay-
|
|
22
|
-
__exportStar(require("./
|
|
20
|
+
__exportStar(require("./storage/use-replay-storage"), exports);
|
|
21
|
+
__exportStar(require("./storage/use-replay-storage-buffer"), exports);
|
|
22
|
+
__exportStar(require("./use-replay-manager"), exports);
|
|
23
|
+
__exportStar(require("./when-replay-finished"), exports);
|
|
24
|
+
__exportStar(require("./replay"), exports);
|
|
25
|
+
__exportStar(require("./replay-guard"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { dependency } from '../use-hash';
|
|
3
|
+
export declare function replayGuard<T extends Array<dependency>, K>(fn: (...args: T) => Observable<{
|
|
4
|
+
timestamp: number;
|
|
5
|
+
payload: K;
|
|
6
|
+
}>): (...args: T) => Observable<{
|
|
7
|
+
timestamp: number;
|
|
8
|
+
payload: K;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=replay-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-guard.d.ts","sourceRoot":"","sources":["../../src/replay/replay-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,wBAAgB,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,EACxD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,UAAU,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,GAChE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,UAAU,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,CAE/D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replayGuard = void 0;
|
|
4
|
+
const use_replay_lock_1 = require("./use-replay-lock");
|
|
5
|
+
function replayGuard(fn) {
|
|
6
|
+
return (...args) => (0, use_replay_lock_1.useReplayLock)(fn(...args));
|
|
7
|
+
}
|
|
8
|
+
exports.replayGuard = replayGuard;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { dependency } from '../use-hash';
|
|
3
|
+
export declare function replay<T extends Array<dependency>, K>(fn: (...args: T) => Observable<{
|
|
4
|
+
timestamp: number;
|
|
5
|
+
payload: K;
|
|
6
|
+
}>, dependencies: dependency[]): (...args: T) => Observable<{
|
|
7
|
+
timestamp: number;
|
|
8
|
+
payload: K;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/replay/replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,EACnD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,UAAU,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,EACjE,YAAY,EAAE,UAAU,EAAE,GACzB,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,UAAU,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,CAE/D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replay = void 0;
|
|
4
|
+
const with_memo_1 = require("../with-memo");
|
|
5
|
+
const use_replay_1 = require("./use-replay");
|
|
6
|
+
function replay(fn, dependencies) {
|
|
7
|
+
return (0, with_memo_1.withMemo)((...args) => (0, use_replay_1.useReplay)(fn(...args), [...dependencies, ...args]));
|
|
8
|
+
}
|
|
9
|
+
exports.replay = replay;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { dependency } from '../../use-hash';
|
|
2
|
+
export declare const useReplayStorageBuffer: <T>(dependencies: dependency[]) => {
|
|
3
|
+
size(): number;
|
|
4
|
+
peek(): {
|
|
5
|
+
timestamp: number;
|
|
6
|
+
payload: T;
|
|
7
|
+
};
|
|
8
|
+
dequeue(): {
|
|
9
|
+
timestamp: number;
|
|
10
|
+
payload: T;
|
|
11
|
+
};
|
|
12
|
+
completed(): boolean;
|
|
13
|
+
fetchNextPage(): Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=use-replay-storage-buffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-replay-storage-buffer.d.ts","sourceRoot":"","sources":["../../../src/replay/storage/use-replay-storage-buffer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,eAAO,MAAM,sBAAsB;;;mBAMC,MAAM;;;;mBAAN,MAAM;;;;;CAsCxC,CAAC"}
|