@quantform/core 0.7.0-beta.6 → 0.7.0-beta.60
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 -5
- 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 -44
- 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/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/missed.d.ts +0 -2
- package/dist/missed.d.ts.map +0 -1
- package/dist/missed.js +0 -4
- 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/exclude.ts +0 -9
- package/src/missed.ts +0 -1
- 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/dist/cli/pull.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const path_1 = require("path");
|
|
39
|
-
const build_1 = __importDefault(require("../cli/build"));
|
|
40
|
-
const workspace_1 = require("../cli/internal/workspace");
|
|
41
|
-
const core_1 = require("../core");
|
|
42
|
-
const module_1 = require("../module");
|
|
43
|
-
const use_execution_mode_1 = require("../use-execution-mode");
|
|
44
|
-
const use_memo_1 = require("../use-memo");
|
|
45
|
-
function default_1(name, instrument, options) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
if (yield (0, build_1.default)()) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
yield Promise.resolve(`${(0, path_1.join)((0, workspace_1.buildDirectory)(), 'index')}`).then(s => __importStar(require(s)));
|
|
51
|
-
const script = (yield Promise.resolve(`${(0, path_1.join)((0, workspace_1.buildDirectory)(), name)}`).then(s => __importStar(require(s))));
|
|
52
|
-
const module = new module_1.Module([
|
|
53
|
-
...(0, core_1.core)(),
|
|
54
|
-
...script.dependencies,
|
|
55
|
-
(0, use_execution_mode_1.paperExecutionMode)({ recording: false })
|
|
56
|
-
]);
|
|
57
|
-
const { act } = yield module.awake();
|
|
58
|
-
const o = yield act(() => script.fn());
|
|
59
|
-
console.log(module.get(use_memo_1.token));
|
|
60
|
-
/*const builder = new SessionBuilder().useSessionId(
|
|
61
|
-
options.id ? Number(options.id) : now()
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
await spawn(name, builder);
|
|
65
|
-
|
|
66
|
-
const session = builder.paper();
|
|
67
|
-
|
|
68
|
-
console.time('Pulling completed in');
|
|
69
|
-
|
|
70
|
-
await session.awake();
|
|
71
|
-
|
|
72
|
-
const bar = new SingleBar(
|
|
73
|
-
{
|
|
74
|
-
format: `Pulling ${instrument} [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}`
|
|
75
|
-
},
|
|
76
|
-
Presets.rect
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const feed = new Feed(builder.storage('feed'));
|
|
80
|
-
const from = options.from ? Date.parse(options.from) : builder.period.from;
|
|
81
|
-
const to = options.to ? Date.parse(options.to) : builder.period.to;
|
|
82
|
-
|
|
83
|
-
bar.start(100, 0);
|
|
84
|
-
|
|
85
|
-
await session.aggregate.feed(
|
|
86
|
-
instrumentOf(instrument),
|
|
87
|
-
from,
|
|
88
|
-
to,
|
|
89
|
-
async (timestamp, events) => {
|
|
90
|
-
const duration = to - from;
|
|
91
|
-
const completed = timestamp - from;
|
|
92
|
-
|
|
93
|
-
await feed.save(events);
|
|
94
|
-
|
|
95
|
-
bar.update(Math.floor((completed / duration) * 100));
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
bar.update(100);
|
|
100
|
-
bar.stop();
|
|
101
|
-
|
|
102
|
-
await session.dispose();
|
|
103
|
-
|
|
104
|
-
console.timeLog('Pulling completed in');*/
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
exports.default = default_1;
|
package/dist/cli/replay.d.ts
DELETED
package/dist/cli/replay.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/cli/replay.ts"],"names":[],"mappings":"AAUA,yBAA+B,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,iBAoBxD"}
|
package/dist/cli/replay.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const path_1 = require("path");
|
|
39
|
-
const rxjs_1 = require("rxjs");
|
|
40
|
-
const build_1 = __importDefault(require("../cli/build"));
|
|
41
|
-
const workspace_1 = require("../cli/internal/workspace");
|
|
42
|
-
const core_1 = require("../core");
|
|
43
|
-
const module_1 = require("../module");
|
|
44
|
-
const replay_1 = require("../replay");
|
|
45
|
-
const use_execution_mode_1 = require("../use-execution-mode");
|
|
46
|
-
function default_1(name, options) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
if (yield (0, build_1.default)()) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const script = yield Promise.resolve(`${(0, path_1.join)((0, workspace_1.buildDirectory)(), name)}`).then(s => __importStar(require(s)));
|
|
52
|
-
const dependencies = script.module2;
|
|
53
|
-
const module = new module_1.Module([
|
|
54
|
-
...(0, core_1.core)(),
|
|
55
|
-
...dependencies,
|
|
56
|
-
(0, replay_1.replayOptions)({ from: 0, to: Number.MAX_VALUE }),
|
|
57
|
-
(0, use_execution_mode_1.replayExecutionMode)()
|
|
58
|
-
]);
|
|
59
|
-
const { act } = yield module.awake();
|
|
60
|
-
const output = yield act(() => (0, rxjs_1.lastValueFrom)(script.default(options)));
|
|
61
|
-
console.log(output);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
exports.default = default_1;
|
package/dist/cli/run.d.ts
DELETED
package/dist/cli/run.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AASA,yBAA+B,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,iBAmBxD"}
|
package/dist/cli/run.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const path_1 = require("path");
|
|
39
|
-
const rxjs_1 = require("rxjs");
|
|
40
|
-
const build_1 = __importDefault(require("../cli/build"));
|
|
41
|
-
const workspace_1 = require("../cli/internal/workspace");
|
|
42
|
-
const core_1 = require("../core");
|
|
43
|
-
const module_1 = require("../module");
|
|
44
|
-
const use_execution_mode_1 = require("../use-execution-mode");
|
|
45
|
-
function default_1(name, options) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
if (yield (0, build_1.default)()) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const script = yield Promise.resolve(`${(0, path_1.join)((0, workspace_1.buildDirectory)(), name)}`).then(s => __importStar(require(s)));
|
|
51
|
-
const dependencies = script.module2;
|
|
52
|
-
const module = new module_1.Module([
|
|
53
|
-
...(0, core_1.core)(),
|
|
54
|
-
...dependencies,
|
|
55
|
-
(0, use_execution_mode_1.liveExecutionMode)({ recording: true })
|
|
56
|
-
]);
|
|
57
|
-
const { act } = yield module.awake();
|
|
58
|
-
const output = yield act(() => (0, rxjs_1.lastValueFrom)(script.default(options)));
|
|
59
|
-
console.log(output);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
exports.default = default_1;
|
package/dist/defined.d.ts
DELETED
package/dist/defined.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defined.d.ts","sourceRoot":"","sources":["../src/defined.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1C,wBAAgB,OAAO,CAAC,CAAC,kBACH,WAAW,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,sCAErD"}
|
package/dist/defined.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defined = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
function defined() {
|
|
6
|
-
return (observable) => observable.pipe((0, rxjs_1.filter)(it => it !== undefined && it !== null));
|
|
7
|
-
}
|
|
8
|
-
exports.defined = defined;
|
package/dist/exclude.d.ts
DELETED
package/dist/exclude.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exclude.d.ts","sourceRoot":"","sources":["../src/exclude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,MAAM,CAAC;AAE/C,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,gBAC3B,WAAW,CAAC,GAAG,CAAC,CAAC,+BAKtC"}
|
package/dist/exclude.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exclude = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
function exclude(s) {
|
|
6
|
-
return (observable) => observable.pipe((0, rxjs_1.filter)(it => it !== s), (0, rxjs_1.map)(it => it));
|
|
7
|
-
}
|
|
8
|
-
exports.exclude = exclude;
|
package/dist/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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-state';
|
|
11
|
-
export * from './replay/use-replay-coordinator';
|
|
12
|
-
export * from './use-execution-mode';
|
|
13
|
-
export * from './storage/use-storage';
|
|
14
|
-
export * from './storage/use-cache';
|
|
15
|
-
export * from './use-logger';
|
|
16
|
-
export * from './replay';
|
|
17
|
-
export * from './replay/use-replay-coordinator';
|
|
18
|
-
export * from './use-socket';
|
|
19
|
-
export * from './use-request';
|
|
20
|
-
export * from './defined';
|
|
21
|
-
export * from './as-readonly';
|
|
22
|
-
export * from './use';
|
|
23
|
-
export * from './session';
|
|
24
|
-
export * from './exclude';
|
|
25
|
-
export * from './use-lock';
|
|
26
|
-
export * from './strat';
|
|
27
|
-
export * from './missed';
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"make-test-module.d.ts","sourceRoot":"","sources":["../src/make-test-module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAO,MAAM,MAAM,CAAC;AAGvC,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,OAsBnD;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC"}
|
package/dist/missed.d.ts
DELETED
package/dist/missed.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"missed.d.ts","sourceRoot":"","sources":["../src/missed.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,eAAuB,CAAC"}
|
package/dist/missed.js
DELETED
package/dist/replay/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replay/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { dependency } from '../use-hash';
|
|
2
|
-
export declare function useReplayCoordinator(): {
|
|
3
|
-
timestamp: () => number;
|
|
4
|
-
stop: () => number;
|
|
5
|
-
tryContinue: () => void;
|
|
6
|
-
subscribe: (dependencies: dependency[]) => import("rxjs").Observable<{
|
|
7
|
-
timestamp: number;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=use-replay-coordinator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-coordinator.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-coordinator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,wBAAgB,oBAAoB;;;;8BAUC,UAAU,EAAE;mBAFW,MAAM;;EAsFjE"}
|
|
@@ -1,119 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.useReplayCoordinator = void 0;
|
|
13
|
-
const rxjs_1 = require("rxjs");
|
|
14
|
-
const use_memo_1 = require("../use-memo");
|
|
15
|
-
const __1 = require("..");
|
|
16
|
-
const use_replay_options_1 = require("./use-replay-options");
|
|
17
|
-
const use_replay_reader_1 = require("./use-replay-reader");
|
|
18
|
-
function useReplayCoordinator() {
|
|
19
|
-
const options = (0, use_replay_options_1.useReplayOptions)();
|
|
20
|
-
return (0, use_memo_1.useMemo)(() => {
|
|
21
|
-
let timestamp = options.from;
|
|
22
|
-
let stopAcquire = 1;
|
|
23
|
-
let sequence = 0;
|
|
24
|
-
const subscriptions = Array.of();
|
|
25
|
-
const stream$ = new rxjs_1.Subject();
|
|
26
|
-
const subscribe = (dependencies) => {
|
|
27
|
-
const cursor = useSampleCursor(dependencies);
|
|
28
|
-
if (!subscriptions.includes(cursor)) {
|
|
29
|
-
subscriptions.push(cursor);
|
|
30
|
-
}
|
|
31
|
-
return (0, rxjs_1.defer)(() => {
|
|
32
|
-
tryContinue();
|
|
33
|
-
return stream$.pipe((0, rxjs_1.filter)(([cur]) => cur === cursor), (0, rxjs_1.map)(([, it]) => it));
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const current = () => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
let next;
|
|
38
|
-
for (const cursor of subscriptions) {
|
|
39
|
-
if (cursor.size() == 0 && !cursor.completed) {
|
|
40
|
-
yield cursor.fetchNextPage(timestamp, options.to + 1);
|
|
41
|
-
}
|
|
42
|
-
if (cursor.peek()) {
|
|
43
|
-
if (!next || next.peek().timestamp > cursor.peek().timestamp) {
|
|
44
|
-
next = cursor;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return next;
|
|
49
|
-
});
|
|
50
|
-
const processNext = () => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
const cursor = yield current();
|
|
52
|
-
if (!cursor || !cursor.peek()) {
|
|
53
|
-
stream$.complete();
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
const sample = cursor.dequeue();
|
|
57
|
-
timestamp = sample.timestamp;
|
|
58
|
-
sequence++;
|
|
59
|
-
stream$.next([cursor, sample]);
|
|
60
|
-
return true;
|
|
61
|
-
});
|
|
62
|
-
const next = () => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
if (yield processNext()) {
|
|
64
|
-
if (stopAcquire === 0) {
|
|
65
|
-
setImmediate(next);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
const stop = () => stopAcquire++;
|
|
70
|
-
const tryContinue = () => {
|
|
71
|
-
if (stopAcquire == 0) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
stopAcquire = Math.max(0, stopAcquire - 1);
|
|
75
|
-
if (stopAcquire != 0) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
next();
|
|
79
|
-
};
|
|
80
|
-
return {
|
|
81
|
-
timestamp: () => timestamp,
|
|
82
|
-
stop,
|
|
83
|
-
tryContinue,
|
|
84
|
-
subscribe
|
|
85
|
-
};
|
|
86
|
-
}, [useReplayCoordinator.name]);
|
|
87
|
-
}
|
|
88
|
-
exports.useReplayCoordinator = useReplayCoordinator;
|
|
89
|
-
function useSampleCursor(dependencies) {
|
|
90
|
-
return (0, use_memo_1.useMemo)(() => {
|
|
91
|
-
const read = (0, use_replay_reader_1.useReplayReader)(dependencies);
|
|
92
|
-
let page = new Array();
|
|
93
|
-
let index = 0;
|
|
94
|
-
let completed = false;
|
|
95
|
-
const size = () => page.length - index;
|
|
96
|
-
const peek = () => page[index];
|
|
97
|
-
const dequeue = () => page[index++];
|
|
98
|
-
const fetchNextPage = (from, to) => __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
if (completed) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
index = 0;
|
|
103
|
-
page = yield read({
|
|
104
|
-
where: {
|
|
105
|
-
timestamp: (0, __1.between)(from, to)
|
|
106
|
-
},
|
|
107
|
-
limit: 10000
|
|
108
|
-
});
|
|
109
|
-
completed = page.length == 0;
|
|
110
|
-
});
|
|
111
|
-
return {
|
|
112
|
-
size,
|
|
113
|
-
peek,
|
|
114
|
-
dequeue,
|
|
115
|
-
fetchNextPage,
|
|
116
|
-
completed
|
|
117
|
-
};
|
|
118
|
-
}, [useSampleCursor.name, ...dependencies]);
|
|
119
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Query, QueryObject } from '../storage';
|
|
2
|
-
import { dependency } from '../use-hash';
|
|
3
|
-
export declare function useReplayReader<T>(dependencies: dependency[]): (query: Query<QueryObject>) => Promise<{
|
|
4
|
-
timestamp: number;
|
|
5
|
-
payload: T;
|
|
6
|
-
}[]>;
|
|
7
|
-
//# sourceMappingURL=use-replay-reader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-reader.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAIpD,wBAAgB,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,WAItC,MAAM,WAAW,CAAC;;;KAaxC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.useReplayReader = void 0;
|
|
13
|
-
const use_hash_1 = require("../use-hash");
|
|
14
|
-
const use_replay_storage_1 = require("./use-replay-storage");
|
|
15
|
-
function useReplayReader(dependencies) {
|
|
16
|
-
const storage = (0, use_replay_storage_1.useReplayStorage)();
|
|
17
|
-
const key = (0, use_hash_1.useHash)(dependencies);
|
|
18
|
-
return (query) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
var _a;
|
|
20
|
-
return (yield storage.query((0, use_replay_storage_1.replaySerializableObject)(key), {
|
|
21
|
-
where: {
|
|
22
|
-
timestamp: (_a = query.where) === null || _a === void 0 ? void 0 : _a.timestamp
|
|
23
|
-
},
|
|
24
|
-
limit: query.limit,
|
|
25
|
-
orderBy: query.orderBy
|
|
26
|
-
})).map(it => ({
|
|
27
|
-
timestamp: it.timestamp,
|
|
28
|
-
payload: JSON.parse(it.json)
|
|
29
|
-
}));
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
exports.useReplayReader = useReplayReader;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-reader.spec.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-reader.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const make_test_module_1 = require("../make-test-module");
|
|
13
|
-
const storage_1 = require("../storage");
|
|
14
|
-
const use_replay_reader_1 = require("./use-replay-reader");
|
|
15
|
-
const use_replay_storage_1 = require("./use-replay-storage");
|
|
16
|
-
jest.mock('./use-replay-storage', () => (Object.assign(Object.assign({}, jest.requireActual('./use-replay-storage')), { useReplayStorage: jest.fn() })));
|
|
17
|
-
describe(use_replay_reader_1.useReplayReader.name, () => {
|
|
18
|
-
let fixtures;
|
|
19
|
-
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
fixtures = yield getFixtures();
|
|
21
|
-
}));
|
|
22
|
-
test('read sample candle data from storage', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
yield fixtures.givenDataStored(fixtures.sample);
|
|
24
|
-
const data = yield fixtures.whenDataRequested();
|
|
25
|
-
expect(data).toEqual(fixtures.sample);
|
|
26
|
-
}));
|
|
27
|
-
});
|
|
28
|
-
function getFixtures() {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const { act } = yield (0, make_test_module_1.makeTestModule)([]);
|
|
31
|
-
const dependencies = ['binance:btc-usdt', 'candle', 'h1'];
|
|
32
|
-
const query = jest.fn();
|
|
33
|
-
(0, make_test_module_1.mockedFunc)(use_replay_storage_1.useReplayStorage).mockReturnValue({ query });
|
|
34
|
-
return {
|
|
35
|
-
sample: [
|
|
36
|
-
{ timestamp: 1, payload: { o: 1.1, h: 1.1, l: 1.1, c: 1.1 } },
|
|
37
|
-
{ timestamp: 2, payload: { o: 1.1, h: 2.2, l: 1.1, c: 2.2 } },
|
|
38
|
-
{ timestamp: 3, payload: { o: 1.1, h: 3.3, l: 1.1, c: 3.3 } }
|
|
39
|
-
],
|
|
40
|
-
givenDataStored(data) {
|
|
41
|
-
return query.mockReturnValue(Promise.resolve(data.map(it => ({
|
|
42
|
-
kind: 'sample',
|
|
43
|
-
timestamp: it.timestamp,
|
|
44
|
-
json: JSON.stringify(it.payload)
|
|
45
|
-
}))));
|
|
46
|
-
},
|
|
47
|
-
whenDataRequested() {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
return yield act(() => (0, use_replay_reader_1.useReplayReader)(dependencies)({
|
|
50
|
-
where: {
|
|
51
|
-
timestamp: (0, storage_1.gt)(0)
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Storage } from '../storage';
|
|
2
|
-
export declare const replaySerializableObject: (key: string) => {
|
|
3
|
-
discriminator: string;
|
|
4
|
-
type: {
|
|
5
|
-
timestamp: "number";
|
|
6
|
-
json: "string";
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export declare function useReplayStorage(): Storage;
|
|
10
|
-
//# sourceMappingURL=use-replay-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-storage.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,wBAAwB,QAAS,MAAM;;;;;;CACgB,CAAC;AAErE,wBAAgB,gBAAgB,YAE/B"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useReplayStorage = exports.replaySerializableObject = void 0;
|
|
4
|
-
const storage_1 = require("../storage");
|
|
5
|
-
const replaySerializableObject = (key) => storage_1.Storage.createObject(key, { timestamp: 'number', json: 'string' });
|
|
6
|
-
exports.replaySerializableObject = replaySerializableObject;
|
|
7
|
-
function useReplayStorage() {
|
|
8
|
-
return (0, storage_1.useStorage)(['replay']);
|
|
9
|
-
}
|
|
10
|
-
exports.useReplayStorage = useReplayStorage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-writer.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAIpD,wBAAgB,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,aAI1C;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,EAAE,mBAQrD"}
|