@quantform/core 0.7.0-beta.4 → 0.7.0-beta.41
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/dist/asset/asset.d.ts +3 -0
- package/dist/asset/asset.d.ts.map +1 -1
- package/dist/asset/asset.js +7 -1
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/dev.js +3 -36
- package/dist/cli/internal/script.d.ts +8 -0
- package/dist/cli/internal/script.d.ts.map +1 -0
- package/dist/cli/internal/script.js +58 -0
- package/dist/cli/pull.d.ts.map +1 -1
- package/dist/cli/pull.js +4 -83
- package/dist/cli/replay.d.ts.map +1 -1
- package/dist/cli/replay.js +3 -35
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +3 -37
- package/dist/index.d.ts +5 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -14
- package/dist/instrument/instrument.d.ts +3 -0
- package/dist/instrument/instrument.d.ts.map +1 -1
- package/dist/instrument/instrument.js +7 -1
- package/dist/make-test-module.d.ts +3 -2
- package/dist/make-test-module.d.ts.map +1 -1
- package/dist/make-test-module.js +13 -2
- package/dist/operators.d.ts +5 -0
- package/dist/operators.d.ts.map +1 -0
- package/dist/operators.js +16 -0
- package/dist/replay/index.d.ts +6 -4
- package/dist/replay/index.d.ts.map +1 -1
- package/dist/replay/index.js +6 -4
- package/dist/replay/replay-guard.d.ts +10 -0
- package/dist/replay/replay-guard.d.ts.map +1 -0
- package/dist/replay/replay-guard.js +8 -0
- package/dist/replay/replay.d.ts +10 -0
- package/dist/replay/replay.d.ts.map +1 -0
- package/dist/replay/replay.js +9 -0
- package/dist/replay/use-replay-breakpoint.d.ts +3 -0
- package/dist/replay/use-replay-breakpoint.d.ts.map +1 -0
- package/dist/replay/use-replay-breakpoint.js +22 -0
- package/dist/replay/use-replay-manager.d.ts +12 -0
- package/dist/replay/use-replay-manager.d.ts.map +1 -0
- package/dist/replay/use-replay-manager.js +88 -0
- package/dist/replay/use-replay-storage-buffer.d.ts +15 -0
- package/dist/replay/use-replay-storage-buffer.d.ts.map +1 -0
- package/dist/replay/use-replay-storage-buffer.js +50 -0
- package/dist/replay/use-replay-storage.d.ts +11 -8
- package/dist/replay/use-replay-storage.d.ts.map +1 -1
- package/dist/replay/use-replay-storage.js +34 -5
- package/dist/replay/use-replay-storage.spec.d.ts +2 -0
- package/dist/replay/use-replay-storage.spec.d.ts.map +1 -0
- package/dist/replay/use-replay-storage.spec.js +74 -0
- package/dist/replay/use-replay.d.ts +2 -2
- package/dist/replay/use-replay.d.ts.map +1 -1
- package/dist/replay/use-replay.js +8 -20
- package/dist/replay/use-replay.spec.js +125 -101
- package/dist/session/use-session-storage.js +2 -2
- package/dist/session/use-session.js +2 -2
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +1 -0
- package/dist/storage/use-storage.d.ts.map +1 -1
- package/dist/storage/use-storage.js +2 -2
- package/dist/use-execution-mode.d.ts +6 -1
- package/dist/use-execution-mode.d.ts.map +1 -1
- package/dist/use-execution-mode.js +16 -8
- package/dist/use-logger.js +4 -4
- package/dist/use-memo.d.ts +0 -10
- package/dist/use-memo.d.ts.map +1 -1
- package/dist/use-memo.js +0 -10
- package/dist/use-timestamp.js +2 -2
- package/dist/when-socket.d.ts +8 -0
- package/dist/when-socket.d.ts.map +1 -0
- package/dist/{use-socket.js → when-socket.js} +6 -5
- package/dist/with-memo.d.ts +5 -0
- package/dist/with-memo.d.ts.map +1 -0
- package/dist/{use.js → with-memo.js} +5 -5
- package/dist/with-memo.spec.d.ts +2 -0
- package/dist/with-memo.spec.d.ts.map +1 -0
- package/dist/{use.spec.js → with-memo.spec.js} +3 -3
- package/dist/{use-request.d.ts → with-request.d.ts} +5 -4
- package/dist/with-request.d.ts.map +1 -0
- package/dist/with-request.js +69 -0
- package/package.json +1 -1
- package/src/asset/asset.ts +6 -0
- package/src/cli/dev.ts +4 -20
- package/src/cli/internal/script.ts +49 -0
- package/src/cli/pull.ts +6 -66
- package/src/cli/replay.ts +4 -16
- package/src/cli/run.ts +4 -18
- package/src/index.ts +5 -14
- package/src/instrument/instrument.ts +6 -0
- package/src/make-test-module.ts +24 -4
- package/src/operators.ts +18 -0
- package/src/replay/index.ts +6 -4
- package/src/replay/replay-guard.ts +11 -0
- package/src/replay/replay.ts +13 -0
- package/src/replay/use-replay-breakpoint.ts +29 -0
- package/src/replay/use-replay-manager.ts +106 -0
- package/src/replay/use-replay-storage-buffer.ts +43 -0
- package/src/replay/use-replay-storage.spec.ts +85 -0
- package/src/replay/use-replay-storage.ts +26 -5
- package/src/replay/use-replay.spec.ts +10 -3
- package/src/replay/use-replay.ts +11 -17
- package/src/session/use-session-storage.ts +2 -2
- package/src/session/use-session.ts +2 -2
- package/src/storage/index.ts +1 -0
- package/src/storage/use-storage.ts +2 -2
- package/src/use-execution-mode.ts +16 -8
- package/src/use-logger.ts +4 -4
- package/src/use-memo.ts +0 -10
- package/src/use-timestamp.ts +2 -2
- package/src/{use-socket.ts → when-socket.ts} +6 -4
- 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/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/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/not-found.d.ts +0 -2
- package/dist/not-found.d.ts.map +0 -1
- package/dist/not-found.js +0 -4
- 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-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/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/strat.d.ts +0 -7
- package/dist/strat.d.ts.map +0 -1
- package/dist/strat.js +0 -7
- 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-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/defined.ts +0 -6
- package/src/exclude.ts +0 -9
- package/src/not-found.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-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/asset/asset.d.ts
CHANGED
|
@@ -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
|
*/
|
|
@@ -1 +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;;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
|
+
{"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"}
|
package/dist/asset/asset.js
CHANGED
|
@@ -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
|
*/
|
package/dist/cli/dev.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAKA,yBAA+B,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,iBASxD"}
|
package/dist/cli/dev.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,26 +12,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
13
|
};
|
|
37
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const path_1 = require("path");
|
|
39
|
-
const rxjs_1 = require("rxjs");
|
|
40
15
|
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
16
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
17
|
+
const script_1 = require("./internal/script");
|
|
45
18
|
function default_1(name, options) {
|
|
46
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
20
|
if (yield (0, build_1.default)()) {
|
|
48
21
|
return;
|
|
49
22
|
}
|
|
50
|
-
const script =
|
|
51
|
-
const
|
|
52
|
-
...(0, core_1.core)(),
|
|
53
|
-
...script.dependencies,
|
|
54
|
-
(0, use_execution_mode_1.paperExecutionMode)({ recording: false })
|
|
55
|
-
]);
|
|
56
|
-
const { act } = yield module.awake();
|
|
57
|
-
const output = yield act(() => (0, rxjs_1.lastValueFrom)(script.fn()));
|
|
23
|
+
const script = new script_1.Script(name, [(0, use_execution_mode_1.paperExecutionMode)({ recording: false })]);
|
|
24
|
+
const output = yield script.run();
|
|
58
25
|
console.log(output);
|
|
59
26
|
});
|
|
60
27
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/cli/internal/script.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAIjD,qBAAa,MAAM;IAEf,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,UAAU,EAAE;IAGvC,GAAG;CAyBV"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 workspace_1 = require("./workspace");
|
|
41
|
+
class Script {
|
|
42
|
+
constructor(name, dependencies) {
|
|
43
|
+
this.name = name;
|
|
44
|
+
this.dependencies = dependencies;
|
|
45
|
+
}
|
|
46
|
+
run() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const script = yield Promise.resolve(`${(0, path_1.join)((0, workspace_1.buildDirectory)(), this.name)}`).then(s => __importStar(require(s)));
|
|
49
|
+
const module = new module_1.Module([...(0, core_1.core)(), ...script.onInstall(), ...this.dependencies]);
|
|
50
|
+
const { act } = yield module.awake();
|
|
51
|
+
return yield act(() => {
|
|
52
|
+
process.stdin.resume();
|
|
53
|
+
return (0, rxjs_1.firstValueFrom)((0, rxjs_1.merge)(script.onAwake().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.take)(1), (0, rxjs_1.switchMap)(it => { var _a; return (_a = script.onExit()) !== null && _a !== void 0 ? _a : (0, rxjs_1.of)(it); }), (0, rxjs_1.finalize)(() => process.exit(0))));
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Script = Script;
|
package/dist/cli/pull.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/cli/pull.ts"],"names":[],"mappings":"
|
|
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/dist/cli/pull.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,73 +12,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
13
|
};
|
|
37
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const path_1 = require("path");
|
|
39
15
|
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
16
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
44
|
-
const
|
|
17
|
+
const script_1 = require("./internal/script");
|
|
45
18
|
function default_1(name, instrument, options) {
|
|
46
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
20
|
if (yield (0, build_1.default)()) {
|
|
48
21
|
return;
|
|
49
22
|
}
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
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');*/
|
|
23
|
+
const script = new script_1.Script(name, [(0, use_execution_mode_1.idleExecutionMode)()]);
|
|
24
|
+
//const output = await script.run();
|
|
25
|
+
//console.log(output);
|
|
105
26
|
});
|
|
106
27
|
}
|
|
107
28
|
exports.default = default_1;
|
package/dist/cli/replay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/cli/replay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/cli/replay.ts"],"names":[],"mappings":"AAMA,yBAA+B,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,iBAYxD"}
|
package/dist/cli/replay.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,29 +12,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
13
|
};
|
|
37
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const path_1 = require("path");
|
|
39
|
-
const rxjs_1 = require("rxjs");
|
|
40
15
|
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
16
|
const replay_1 = require("../replay");
|
|
45
17
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
18
|
+
const script_1 = require("./internal/script");
|
|
46
19
|
function default_1(name, options) {
|
|
47
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
21
|
if (yield (0, build_1.default)()) {
|
|
49
22
|
return;
|
|
50
23
|
}
|
|
51
|
-
const script =
|
|
52
|
-
const dependencies = script.module2;
|
|
53
|
-
const module = new module_1.Module([
|
|
54
|
-
...(0, core_1.core)(),
|
|
55
|
-
...dependencies,
|
|
24
|
+
const script = new script_1.Script(name, [
|
|
56
25
|
(0, replay_1.replayOptions)({ from: 0, to: Number.MAX_VALUE }),
|
|
57
26
|
(0, use_execution_mode_1.replayExecutionMode)()
|
|
58
27
|
]);
|
|
59
|
-
const
|
|
60
|
-
const output = yield act(() => (0, rxjs_1.lastValueFrom)(script.default(options)));
|
|
28
|
+
const output = yield script.run();
|
|
61
29
|
console.log(output);
|
|
62
30
|
});
|
|
63
31
|
}
|
package/dist/cli/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAKA,yBAA+B,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,iBASxD"}
|
package/dist/cli/run.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,27 +12,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
13
|
};
|
|
37
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const path_1 = require("path");
|
|
39
|
-
const rxjs_1 = require("rxjs");
|
|
40
15
|
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
16
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
17
|
+
const script_1 = require("./internal/script");
|
|
45
18
|
function default_1(name, options) {
|
|
46
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
20
|
if (yield (0, build_1.default)()) {
|
|
48
21
|
return;
|
|
49
22
|
}
|
|
50
|
-
const script =
|
|
51
|
-
const
|
|
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)));
|
|
23
|
+
const script = new script_1.Script(name, [(0, use_execution_mode_1.liveExecutionMode)({ recording: true })]);
|
|
24
|
+
const output = yield script.run();
|
|
59
25
|
console.log(output);
|
|
60
26
|
});
|
|
61
27
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,22 +7,13 @@ export * from './use-timestamp';
|
|
|
7
7
|
export * from './simulator';
|
|
8
8
|
export * from './make-test-module';
|
|
9
9
|
export * from './core';
|
|
10
|
-
export * from './use-state';
|
|
11
|
-
export * from './replay/use-replay-coordinator';
|
|
12
10
|
export * from './use-execution-mode';
|
|
13
|
-
export * from './storage
|
|
14
|
-
export * from './storage/use-cache';
|
|
11
|
+
export * from './storage';
|
|
15
12
|
export * from './use-logger';
|
|
16
13
|
export * from './replay';
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './defined';
|
|
21
|
-
export * from './as-readonly';
|
|
22
|
-
export * from './use';
|
|
14
|
+
export * from './when-socket';
|
|
15
|
+
export * from './with-request';
|
|
16
|
+
export * from './with-memo';
|
|
23
17
|
export * from './session';
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './use-lock';
|
|
26
|
-
export * from './strat';
|
|
27
|
-
export * from './not-found';
|
|
18
|
+
export * from './operators';
|
|
28
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,21 +23,12 @@ __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("./
|
|
34
|
-
__exportStar(require("./
|
|
35
|
-
__exportStar(require("./
|
|
36
|
-
__exportStar(require("./defined"), exports);
|
|
37
|
-
__exportStar(require("./as-readonly"), exports);
|
|
38
|
-
__exportStar(require("./use"), exports);
|
|
30
|
+
__exportStar(require("./when-socket"), exports);
|
|
31
|
+
__exportStar(require("./with-request"), exports);
|
|
32
|
+
__exportStar(require("./with-memo"), exports);
|
|
39
33
|
__exportStar(require("./session"), exports);
|
|
40
|
-
__exportStar(require("./
|
|
41
|
-
__exportStar(require("./use-lock"), exports);
|
|
42
|
-
__exportStar(require("./strat"), exports);
|
|
43
|
-
__exportStar(require("./not-found"), exports);
|
|
34
|
+
__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;
|
|
@@ -1 +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,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
|
+
{"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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-test-module.d.ts","sourceRoot":"","sources":["../src/make-test-module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,
|
|
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,qFAYrB"}
|
package/dist/make-test-module.js
CHANGED
|
@@ -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,18 @@ 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
|
|
53
|
+
.spyOn(object, method)
|
|
54
|
+
.mockReturnValue(subject.asObservable());
|
|
55
|
+
return subject;
|
|
56
|
+
}
|
|
57
|
+
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"}
|
|
@@ -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;
|
package/dist/replay/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './use-replay';
|
|
2
|
-
export * from './use-replay-
|
|
2
|
+
export * from './use-replay-breakpoint';
|
|
3
3
|
export * from './use-replay-options';
|
|
4
|
-
export * from './use-replay-
|
|
5
|
-
export * from './use-replay-
|
|
6
|
-
export * from './
|
|
4
|
+
export * from './use-replay-storage';
|
|
5
|
+
export * from './use-replay-storage-buffer';
|
|
6
|
+
export * from './use-replay-manager';
|
|
7
|
+
export * from './replay';
|
|
8
|
+
export * from './replay-guard';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replay/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replay/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/dist/replay/index.js
CHANGED
|
@@ -15,8 +15,10 @@ 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-breakpoint"), 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("./use-replay-storage"), exports);
|
|
21
|
+
__exportStar(require("./use-replay-storage-buffer"), exports);
|
|
22
|
+
__exportStar(require("./use-replay-manager"), exports);
|
|
23
|
+
__exportStar(require("./replay"), exports);
|
|
24
|
+
__exportStar(require("./replay-guard"), exports);
|