@quantform/core 0.7.9 → 0.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/asset/asset.js +2 -2
- package/lib/cli/build.js +1 -1
- package/lib/cli/internal/script.js +7 -17
- package/lib/cli/internal/workspace.js +2 -1
- package/lib/cli/live.js +2 -2
- package/lib/cli/paper.js +2 -2
- package/lib/cli/pull.js +1 -1
- package/lib/cli/replay.js +2 -2
- package/lib/component/distinct-until-timesamp-changed.d.ts.map +1 -1
- package/lib/component/distinct-until-timesamp-changed.js +2 -1
- package/lib/component/ohlc-operator.d.ts.map +1 -1
- package/lib/component/ohlc-operator.js +4 -3
- package/lib/component/ohlc.d.ts.map +1 -1
- package/lib/component/timeframe.js +3 -3
- package/lib/core.js +2 -1
- package/lib/instrument/commission/commission.js +3 -3
- package/lib/instrument/instrument.js +2 -2
- package/lib/make-test-module.d.ts +3 -2
- package/lib/make-test-module.d.ts.map +1 -1
- package/lib/make-test-module.js +4 -4
- package/lib/module.d.ts.map +1 -1
- package/lib/operators.d.ts +1 -1
- package/lib/operators.d.ts.map +1 -1
- package/lib/operators.js +4 -3
- package/lib/replay/replay-guard.js +2 -1
- package/lib/replay/replay.js +2 -1
- package/lib/replay/storage/use-replay-storage-buffer.d.ts.map +1 -1
- package/lib/replay/storage/use-replay-storage-cursor.d.ts.map +1 -1
- package/lib/replay/storage/use-replay-storage.d.ts.map +1 -1
- package/lib/replay/storage/use-replay-storage.js +2 -1
- package/lib/replay/use-replay-lock.js +2 -1
- package/lib/replay/use-replay-manager.d.ts.map +1 -1
- package/lib/replay/use-replay-options.js +2 -2
- package/lib/replay/use-replay.js +2 -1
- package/lib/replay/when-replay-finished.js +2 -1
- package/lib/session/use-session-object.d.ts +12 -3
- package/lib/session/use-session-object.d.ts.map +1 -1
- package/lib/shared/datetime.js +2 -1
- package/lib/shared/decimals.js +2 -2
- package/lib/shared/environment.js +3 -2
- package/lib/simulator/use-simulator.js +2 -1
- package/lib/storage/in-memory/in-memory-storage.factory.js +2 -2
- package/lib/storage/storage.d.ts.map +1 -1
- package/lib/storage/use-cache.d.ts.map +1 -1
- package/lib/storage/use-storage-factory.d.ts.map +1 -1
- package/lib/storage/use-storage-factory.js +2 -1
- package/lib/strategy.js +2 -2
- package/lib/use-execution-mode.d.ts.map +1 -1
- package/lib/use-execution-mode.js +2 -1
- package/lib/use-hash.js +2 -1
- package/lib/use-memo.d.ts.map +1 -1
- package/lib/use-memo.js +2 -2
- package/lib/use-socket.d.ts.map +1 -1
- package/lib/use-socket.js +2 -1
- package/lib/use-timestamp.js +2 -1
- package/lib/when-socket.js +2 -1
- package/lib/with-memo.js +2 -1
- package/lib/with-request.js +3 -3
- package/package.json +1 -1
package/lib/asset/asset.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Asset = exports.AssetSelector = exports.MissingAssetError = exports.AssetSelectorSeparator = void 0;
|
|
4
|
-
exports.assetOf = assetOf;
|
|
3
|
+
exports.Asset = exports.assetOf = exports.AssetSelector = exports.MissingAssetError = exports.AssetSelectorSeparator = void 0;
|
|
5
4
|
const component_1 = require("../component");
|
|
6
5
|
const shared_1 = require("../shared");
|
|
7
6
|
exports.AssetSelectorSeparator = ':';
|
|
@@ -41,6 +40,7 @@ function assetOf(selector) {
|
|
|
41
40
|
}
|
|
42
41
|
return new AssetSelector(name, adapterName);
|
|
43
42
|
}
|
|
43
|
+
exports.assetOf = assetOf;
|
|
44
44
|
/**
|
|
45
45
|
* Represents a security that you can trade or hold in your wallet.
|
|
46
46
|
* For example, you can combine two trading assets to create a trading instrument.
|
package/lib/cli/build.js
CHANGED
|
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.default = default_1;
|
|
13
12
|
const child_process_1 = require("child_process");
|
|
14
13
|
const workspace_1 = require("../cli/internal/workspace");
|
|
15
14
|
function default_1() {
|
|
@@ -24,3 +23,4 @@ function default_1() {
|
|
|
24
23
|
});
|
|
25
24
|
});
|
|
26
25
|
}
|
|
26
|
+
exports.default = default_1;
|
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
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
|
+
};
|
|
35
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildDirectory =
|
|
3
|
+
exports.buildDirectory = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const shared_1 = require("../../shared");
|
|
6
6
|
function buildDirectory() {
|
|
7
7
|
return (0, path_1.join)(process.cwd(), (0, shared_1.workingDirectory)(), 'build');
|
|
8
8
|
}
|
|
9
|
+
exports.buildDirectory = buildDirectory;
|
package/lib/cli/live.js
CHANGED
|
@@ -12,14 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.default = default_1;
|
|
16
15
|
const build_1 = __importDefault(require("../cli/build"));
|
|
17
16
|
const session_1 = require("../session");
|
|
18
17
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
19
18
|
const script_1 = require("./internal/script");
|
|
20
19
|
function default_1(name, options) {
|
|
20
|
+
var _a, _b;
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
var _a, _b;
|
|
23
22
|
if (yield (0, build_1.default)()) {
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
@@ -31,3 +30,4 @@ function default_1(name, options) {
|
|
|
31
30
|
console.log(output);
|
|
32
31
|
});
|
|
33
32
|
}
|
|
33
|
+
exports.default = default_1;
|
package/lib/cli/paper.js
CHANGED
|
@@ -12,14 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.default = default_1;
|
|
16
15
|
const build_1 = __importDefault(require("../cli/build"));
|
|
17
16
|
const session_1 = require("../session");
|
|
18
17
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
19
18
|
const script_1 = require("./internal/script");
|
|
20
19
|
function default_1(name, options) {
|
|
20
|
+
var _a, _b;
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
var _a, _b;
|
|
23
22
|
if (yield (0, build_1.default)()) {
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
@@ -31,3 +30,4 @@ function default_1(name, options) {
|
|
|
31
30
|
console.log(output);
|
|
32
31
|
});
|
|
33
32
|
}
|
|
33
|
+
exports.default = default_1;
|
package/lib/cli/pull.js
CHANGED
|
@@ -12,7 +12,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.default = default_1;
|
|
16
15
|
const build_1 = __importDefault(require("../cli/build"));
|
|
17
16
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
18
17
|
const script_1 = require("./internal/script");
|
|
@@ -26,3 +25,4 @@ function default_1(name, instrument, options) {
|
|
|
26
25
|
//console.log(output);
|
|
27
26
|
});
|
|
28
27
|
}
|
|
28
|
+
exports.default = default_1;
|
package/lib/cli/replay.js
CHANGED
|
@@ -12,15 +12,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.default = default_1;
|
|
16
15
|
const build_1 = __importDefault(require("../cli/build"));
|
|
17
16
|
const replay_1 = require("../replay");
|
|
18
17
|
const session_1 = require("../session");
|
|
19
18
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
20
19
|
const script_1 = require("./internal/script");
|
|
21
20
|
function default_1(name, options) {
|
|
21
|
+
var _a;
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
var _a;
|
|
24
23
|
if (yield (0, build_1.default)()) {
|
|
25
24
|
return;
|
|
26
25
|
}
|
|
@@ -35,3 +34,4 @@ function default_1(name, options) {
|
|
|
35
34
|
console.log(output);
|
|
36
35
|
});
|
|
37
36
|
}
|
|
37
|
+
exports.default = default_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distinct-until-timesamp-changed.d.ts","sourceRoot":"","sources":["../../src/component/distinct-until-timesamp-changed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,UAAU,EAAO,MAAM,MAAM,CAAC;AAE/C,wBAAgB,6BAA6B,CAAC,CAAC,SAAS;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,cAG3D,
|
|
1
|
+
{"version":3,"file":"distinct-until-timesamp-changed.d.ts","sourceRoot":"","sources":["../../src/component/distinct-until-timesamp-changed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,UAAU,EAAO,MAAM,MAAM,CAAC;AAE/C,wBAAgB,6BAA6B,CAAC,CAAC,SAAS;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,cAG3D,WAAW,CAAC,CAAC,mBAK9B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.distinctUntilTimestampChanged =
|
|
3
|
+
exports.distinctUntilTimestampChanged = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
function distinctUntilTimestampChanged() {
|
|
6
6
|
let prevTimestamp;
|
|
7
7
|
return (stream) => stream.pipe((0, rxjs_1.filter)(it => prevTimestamp === undefined || it.timestamp > prevTimestamp), (0, rxjs_1.tap)(it => (prevTimestamp = it.timestamp)));
|
|
8
8
|
}
|
|
9
|
+
exports.distinctUntilTimestampChanged = distinctUntilTimestampChanged;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ohlc-operator.d.ts","sourceRoot":"","sources":["../../src/component/ohlc-operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,UAAU,EAKX,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,IAAI,EAAM,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAsBtC,wBAAgB,IAAI,CAAC,CAAC,SAAS;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,EAClD,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,EACrB,iBAAiB,CAAC,EAAE,IAAI,YAEC,
|
|
1
|
+
{"version":3,"file":"ohlc-operator.d.ts","sourceRoot":"","sources":["../../src/component/ohlc-operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,UAAU,EAKX,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,IAAI,EAAM,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAsBtC,wBAAgB,IAAI,CAAC,CAAC,SAAS;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,EAClD,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,EACrB,iBAAiB,CAAC,EAAE,IAAI,YAEC,WAAW,CAAC,CAAC,KAAG,WAAW,IAAI,CAAC,CAmC1D;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,EACvD,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,EACrB,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,aAEA,WAAW,CAAC,CAAC,KAAG,WAAW,IAAI,CAAC,CAY3D;AAED,wBAAgB,aAAa,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,CAwB9E"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ohlc =
|
|
4
|
-
exports.mergeOhlc = mergeOhlc;
|
|
5
|
-
exports.ohlcCompleted = ohlcCompleted;
|
|
3
|
+
exports.ohlcCompleted = exports.mergeOhlc = exports.ohlc = void 0;
|
|
6
4
|
const rxjs_1 = require("rxjs");
|
|
7
5
|
const component_1 = require("../component");
|
|
8
6
|
function aggregate(candle, timeframe, value, timestamp) {
|
|
@@ -44,11 +42,13 @@ function ohlc(timeframe, fn, candleToStartWith) {
|
|
|
44
42
|
}), (0, rxjs_1.mergeMap)(it => it), (0, rxjs_1.share)());
|
|
45
43
|
};
|
|
46
44
|
}
|
|
45
|
+
exports.ohlc = ohlc;
|
|
47
46
|
function mergeOhlc(timeframe, fn, history$) {
|
|
48
47
|
return function (source$) {
|
|
49
48
|
return (0, rxjs_1.concat)(history$.pipe((0, rxjs_1.skipLast)(1)), history$.pipe((0, rxjs_1.last)(), (0, rxjs_1.switchMap)(lastHistoricalCandle => source$.pipe(ohlc(timeframe, fn, lastHistoricalCandle))), (0, rxjs_1.share)()));
|
|
50
49
|
};
|
|
51
50
|
}
|
|
51
|
+
exports.mergeOhlc = mergeOhlc;
|
|
52
52
|
function ohlcCompleted() {
|
|
53
53
|
let currCandle;
|
|
54
54
|
return (source) => source.pipe((0, rxjs_1.map)(it => {
|
|
@@ -66,3 +66,4 @@ function ohlcCompleted() {
|
|
|
66
66
|
}
|
|
67
67
|
}), (0, rxjs_1.filter)(it => it !== undefined), (0, rxjs_1.share)());
|
|
68
68
|
}
|
|
69
|
+
exports.ohlcCompleted = ohlcCompleted;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ohlc.d.ts","sourceRoot":"","sources":["../../src/component/ohlc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,IAAI;IAEN,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"ohlc.d.ts","sourceRoot":"","sources":["../../src/component/ohlc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,IAAI;IAEN,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,CAAC;gBALP,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,OAAO,EACd,MAAM,CAAC,qBAAS;IAGzB,KAAK,CAAC,KAAK,EAAE,OAAO;CAKrB"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Timeframe = void 0;
|
|
4
|
-
exports.tf = tf;
|
|
3
|
+
exports.tf = exports.Timeframe = void 0;
|
|
5
4
|
class Timeframe {
|
|
6
5
|
}
|
|
7
|
-
exports.Timeframe = Timeframe;
|
|
8
6
|
Timeframe.S1 = 1000;
|
|
9
7
|
Timeframe.M1 = Timeframe.S1 * 60;
|
|
10
8
|
Timeframe.M5 = Timeframe.M1 * 5;
|
|
@@ -16,6 +14,8 @@ Timeframe.H6 = Timeframe.H1 * 6;
|
|
|
16
14
|
Timeframe.H12 = Timeframe.H6 * 2;
|
|
17
15
|
Timeframe.D1 = Timeframe.H12 * 2;
|
|
18
16
|
Timeframe.W1 = Timeframe.D1 * 7;
|
|
17
|
+
exports.Timeframe = Timeframe;
|
|
19
18
|
function tf(timestamp, timeframe) {
|
|
20
19
|
return timestamp - (timestamp % timeframe);
|
|
21
20
|
}
|
|
21
|
+
exports.tf = tf;
|
package/lib/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.core =
|
|
3
|
+
exports.core = void 0;
|
|
4
4
|
const use_memo_1 = require("./use-memo");
|
|
5
5
|
const storage_1 = require("./storage");
|
|
6
6
|
const use_storage_factory_1 = require("./storage/use-storage-factory");
|
|
@@ -12,3 +12,4 @@ function core() {
|
|
|
12
12
|
use_storage_factory_1.useStorageFactory.options(new storage_1.InMemoryStorageFactory())
|
|
13
13
|
];
|
|
14
14
|
}
|
|
15
|
+
exports.core = core;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Commission = void 0;
|
|
4
|
-
exports.commissionPercentOf = commissionPercentOf;
|
|
3
|
+
exports.commissionPercentOf = exports.Commission = void 0;
|
|
5
4
|
const shared_1 = require("../../shared");
|
|
6
5
|
class Commission {
|
|
7
6
|
constructor(makerRate, takerRate) {
|
|
@@ -21,8 +20,9 @@ class Commission {
|
|
|
21
20
|
return value.minus(this.calculateTakerFee(value));
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
|
-
exports.Commission = Commission;
|
|
25
23
|
Commission.Zero = commissionPercentOf({ maker: shared_1.d.Zero, taker: shared_1.d.Zero });
|
|
24
|
+
exports.Commission = Commission;
|
|
26
25
|
function commissionPercentOf(fees) {
|
|
27
26
|
return new Commission(fees.maker.div(100.0), fees.taker.div(100.0));
|
|
28
27
|
}
|
|
28
|
+
exports.commissionPercentOf = commissionPercentOf;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Instrument = exports.InstrumentSelector = exports.MissingInstrumentError = exports.InstrumentSelectorSeparator = void 0;
|
|
4
|
-
exports.instrumentOf = instrumentOf;
|
|
3
|
+
exports.instrumentOf = exports.Instrument = exports.InstrumentSelector = exports.MissingInstrumentError = exports.InstrumentSelectorSeparator = void 0;
|
|
5
4
|
const asset_1 = require("../asset");
|
|
6
5
|
const component_1 = require("../component");
|
|
7
6
|
exports.InstrumentSelectorSeparator = '-';
|
|
@@ -51,3 +50,4 @@ function instrumentOf(selector) {
|
|
|
51
50
|
}
|
|
52
51
|
return new InstrumentSelector(baseAssetName, quoteAssetName, adapterName);
|
|
53
52
|
}
|
|
53
|
+
exports.instrumentOf = instrumentOf;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
1
2
|
import { Observable, Subject } from 'rxjs';
|
|
2
3
|
import { Dependency } from './module';
|
|
3
4
|
export declare function makeTestModule(dependencies: Dependency[]): Promise<{
|
|
4
5
|
act: <T>(func: () => T) => T;
|
|
5
|
-
get: <
|
|
6
|
+
get: <T_1>(token: import("tsyringe/dist/typings/providers/injection-token").default<T_1>) => T_1;
|
|
6
7
|
}>;
|
|
7
8
|
type MockableFunction = (...args: any[]) => any;
|
|
8
|
-
export declare const mockedFunc: <Func extends MockableFunction>(mockedFunc: Func) => jest.MockedFunction<
|
|
9
|
+
export declare const mockedFunc: <Func extends MockableFunction>(mockedFunc: Func) => jest.MockedFunction<Func>;
|
|
9
10
|
export declare function toArray<T>(observable: Observable<T>): (Error | T)[];
|
|
10
11
|
export type InferObservableType<T> = T extends Observable<infer U> ? U : never;
|
|
11
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]>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-test-module.d.ts","sourceRoot":"","sources":["../src/make-test-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAEjD,wBAAsB,cAAc,CAAC,YAAY,EAAE,UAAU,EAAE;;;GAS9D;AAED,KAAK,gBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAEhD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"make-test-module.d.ts","sourceRoot":"","sources":["../src/make-test-module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAEjD,wBAAsB,cAAc,CAAC,YAAY,EAAE,UAAU,EAAE;;;GAS9D;AAED,KAAK,gBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAEhD,eAAO,MAAM,UAAU,gFAC+B,CAAC;AAEvD,wBAAgB,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,iBAyBnD;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE/E,wBAAgB,WAAW,CACzB,CAAC,SAAS,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC9C,CAAC,SAAS,MAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACpD,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,qFAQrB"}
|
package/lib/make-test-module.js
CHANGED
|
@@ -9,10 +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.mockedFunc = void 0;
|
|
13
|
-
exports.makeTestModule = makeTestModule;
|
|
14
|
-
exports.toArray = toArray;
|
|
15
|
-
exports.mockSubject = mockSubject;
|
|
12
|
+
exports.mockSubject = exports.toArray = exports.mockedFunc = exports.makeTestModule = void 0;
|
|
16
13
|
const rxjs_1 = require("rxjs");
|
|
17
14
|
const core_1 = require("./core");
|
|
18
15
|
const module_1 = require("./module");
|
|
@@ -26,6 +23,7 @@ function makeTestModule(dependencies) {
|
|
|
26
23
|
};
|
|
27
24
|
});
|
|
28
25
|
}
|
|
26
|
+
exports.makeTestModule = makeTestModule;
|
|
29
27
|
const mockedFunc = (mockedFunc) => mockedFunc;
|
|
30
28
|
exports.mockedFunc = mockedFunc;
|
|
31
29
|
function toArray(observable) {
|
|
@@ -48,8 +46,10 @@ function toArray(observable) {
|
|
|
48
46
|
});
|
|
49
47
|
return array;
|
|
50
48
|
}
|
|
49
|
+
exports.toArray = toArray;
|
|
51
50
|
function mockSubject(object, method) {
|
|
52
51
|
const subject = new rxjs_1.Subject();
|
|
53
52
|
jest.spyOn(object, method).mockReturnValue(subject.asObservable());
|
|
54
53
|
return subject;
|
|
55
54
|
}
|
|
55
|
+
exports.mockSubject = mockSubject;
|
package/lib/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAEL,mBAAmB,EACnB,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EAEf,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,QAAQ,mBAAa,CAAC;AACnC,eAAO,MAAM,OAAO,eAAS,CAAC;AAC9B,eAAO,MAAM,UAAU,kBAAY,CAAC;AAEpC,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAuBF;;GAEG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAEL,mBAAmB,EACnB,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EAEf,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,QAAQ,mBAAa,CAAC;AACnC,eAAO,MAAM,OAAO,eAAS,CAAC;AAC9B,eAAO,MAAM,UAAU,kBAAY,CAAC;AAEpC,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAuBF;;GAEG;AACH,eAAO,MAAM,UAAU,oCAQtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAI5B,CAAC;AAEF;;;GAGG;AACH,qBAAa,MAAM;IAGL,OAAO,CAAC,QAAQ,CAAC,YAAY;IAFzC,OAAO,CAAC,SAAS,CAAC,CAAsB;gBAEX,YAAY,EAAE,UAAU,EAAE;IAEvD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC;QAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;KAAE,CAAC;IAWxD;;;OAGG;IACH,OAAO;IAQP;;;OAGG;IACH,SAAS,CAAC,cAAc,IAAI,mBAAmB;IAgB/C;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC;IAYnC;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;CAWzC"}
|
package/lib/operators.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
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
|
|
3
|
+
export declare function defined<T>(): (observable: Observable<T | undefined | null>) => Observable<T | null | undefined>;
|
|
4
4
|
export declare function exclude<T, S extends symbol>(s: S): (observable: Observable<T | S>) => Observable<Exclude<T, S>>;
|
|
5
5
|
//# sourceMappingURL=operators.d.ts.map
|
package/lib/operators.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../src/operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,MAAM,CAAC;AAE/C,wBAAgB,UAAU,CAAC,CAAC,aACX,WAAW,CAAC,CAAC,6BAC7B;AAED,wBAAgB,OAAO,CAAC,CAAC,kBACH,WAAW,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,sCAErD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,gBAC3B,WAAW,CAAC,GAAG,CAAC,CAAC,+BAKtC"}
|
package/lib/operators.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.asReadonly =
|
|
4
|
-
exports.defined = defined;
|
|
5
|
-
exports.exclude = exclude;
|
|
3
|
+
exports.exclude = exports.defined = exports.asReadonly = void 0;
|
|
6
4
|
const rxjs_1 = require("rxjs");
|
|
7
5
|
function asReadonly() {
|
|
8
6
|
return (input) => input.pipe((0, rxjs_1.map)(it => it));
|
|
9
7
|
}
|
|
8
|
+
exports.asReadonly = asReadonly;
|
|
10
9
|
function defined() {
|
|
11
10
|
return (observable) => observable.pipe((0, rxjs_1.filter)(it => it !== undefined && it !== null));
|
|
12
11
|
}
|
|
12
|
+
exports.defined = defined;
|
|
13
13
|
function exclude(s) {
|
|
14
14
|
return (observable) => observable.pipe((0, rxjs_1.filter)(it => it !== s), (0, rxjs_1.map)(it => it));
|
|
15
15
|
}
|
|
16
|
+
exports.exclude = exclude;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replayGuard =
|
|
3
|
+
exports.replayGuard = void 0;
|
|
4
4
|
const use_replay_lock_1 = require("./use-replay-lock");
|
|
5
5
|
function replayGuard(fn) {
|
|
6
6
|
return (...args) => (0, use_replay_lock_1.useReplayLock)(fn(...args));
|
|
7
7
|
}
|
|
8
|
+
exports.replayGuard = replayGuard;
|
package/lib/replay/replay.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replay =
|
|
3
|
+
exports.replay = void 0;
|
|
4
4
|
const with_memo_1 = require("../with-memo");
|
|
5
5
|
const use_replay_1 = require("./use-replay");
|
|
6
6
|
function replay(fn, dependencies) {
|
|
7
7
|
return (0, with_memo_1.withMemo)((...args) => (0, use_replay_1.useReplay)(fn(...args), [...dependencies, ...args]));
|
|
8
8
|
}
|
|
9
|
+
exports.replay = replay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-storage-buffer.d.ts","sourceRoot":"","sources":["../../../src/replay/storage/use-replay-storage-buffer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"use-replay-storage-buffer.d.ts","sourceRoot":"","sources":["../../../src/replay/storage/use-replay-storage-buffer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,eAAO,MAAM,sBAAsB;;;mBAMC,MAAM;;;;mBAAN,MAAM;;;;;CAsCxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-storage-cursor.d.ts","sourceRoot":"","sources":["../../../src/replay/storage/use-replay-storage-cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAMpD,eAAO,MAAM,sBAAsB;
|
|
1
|
+
{"version":3,"file":"use-replay-storage-cursor.d.ts","sourceRoot":"","sources":["../../../src/replay/storage/use-replay-storage-cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAMpD,eAAO,MAAM,sBAAsB;yBAKV,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-storage.d.ts","sourceRoot":"","sources":["../../../src/replay/storage/use-replay-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE;iBASvC,
|
|
1
|
+
{"version":3,"file":"use-replay-storage.d.ts","sourceRoot":"","sources":["../../../src/replay/storage/use-replay-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE;iBASvC,MAAM,WAAW,CAAC;;;;kBAMvB;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,CAAA;KAAE,EAAE;EAUpD"}
|
|
@@ -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.useReplayStorage =
|
|
12
|
+
exports.useReplayStorage = void 0;
|
|
13
13
|
const storage_1 = require("../../storage");
|
|
14
14
|
const use_hash_1 = require("../../use-hash");
|
|
15
15
|
function useReplayStorage(dependencies) {
|
|
@@ -36,3 +36,4 @@ function useReplayStorage(dependencies) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
+
exports.useReplayStorage = useReplayStorage;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useReplayLock =
|
|
3
|
+
exports.useReplayLock = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
6
6
|
const use_logger_1 = require("../use-logger");
|
|
@@ -19,3 +19,4 @@ function useReplayLock(input) {
|
|
|
19
19
|
tryContinue();
|
|
20
20
|
}));
|
|
21
21
|
}
|
|
22
|
+
exports.useReplayLock = useReplayLock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-manager.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAW,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;mBAQqC,MAAM;iBAAW,GAAG;;;;;
|
|
1
|
+
{"version":3,"file":"use-replay-manager.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAW,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;mBAQqC,MAAM;iBAAW,GAAG;;;;;2BAoD3D,UAAU,EAAE;mBAA2B,MAAM;;;CAatE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useReplayOptions = void 0;
|
|
4
|
-
exports.replayOptions = replayOptions;
|
|
3
|
+
exports.useReplayOptions = exports.replayOptions = void 0;
|
|
5
4
|
const module_1 = require("../module");
|
|
6
5
|
const injectionToken = Symbol('replay-options');
|
|
7
6
|
/**
|
|
@@ -13,6 +12,7 @@ function replayOptions(options) {
|
|
|
13
12
|
useValue: options
|
|
14
13
|
};
|
|
15
14
|
}
|
|
15
|
+
exports.replayOptions = replayOptions;
|
|
16
16
|
/**
|
|
17
17
|
* Will return current replay execution options.
|
|
18
18
|
*/
|
package/lib/replay/use-replay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useReplay =
|
|
3
|
+
exports.useReplay = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
6
6
|
const use_replay_storage_1 = require("./storage/use-replay-storage");
|
|
@@ -17,3 +17,4 @@ function useReplay(input, dependencies) {
|
|
|
17
17
|
}
|
|
18
18
|
return input;
|
|
19
19
|
}
|
|
20
|
+
exports.useReplay = useReplay;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.whenReplayFinished =
|
|
3
|
+
exports.whenReplayFinished = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
6
6
|
const use_replay_manager_1 = require("./use-replay-manager");
|
|
@@ -12,3 +12,4 @@ function whenReplayFinished() {
|
|
|
12
12
|
const { stream } = (0, use_replay_manager_1.useReplayManager)();
|
|
13
13
|
return (0, rxjs_1.from)(stream).pipe((0, rxjs_1.last)(), (0, rxjs_1.map)(() => true));
|
|
14
14
|
}
|
|
15
|
+
exports.whenReplayFinished = whenReplayFinished;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { InferQueryObject, Query, QueryMappingType, QueryObject, Storage } from '../storage';
|
|
2
|
-
export declare const useSessionObject: <K extends QueryObject, T extends { [key in keyof K]: QueryMappingType; }>(object:
|
|
3
|
-
|
|
2
|
+
export declare const useSessionObject: <K extends QueryObject, T extends { [key in keyof K]: QueryMappingType; }>(object: {
|
|
3
|
+
discriminator: string;
|
|
4
|
+
type: T;
|
|
5
|
+
}) => {
|
|
6
|
+
query: (query: Query<InferQueryObject<{
|
|
7
|
+
discriminator: string;
|
|
8
|
+
type: T;
|
|
9
|
+
}>>) => import("rxjs").Observable<InferQueryObject<{
|
|
4
10
|
discriminator: string;
|
|
5
11
|
type: T;
|
|
6
12
|
}>[]>;
|
|
7
|
-
save: (objects: InferQueryObject<
|
|
13
|
+
save: (objects: InferQueryObject<{
|
|
14
|
+
discriminator: string;
|
|
15
|
+
type: T;
|
|
16
|
+
}>[]) => Promise<void>;
|
|
8
17
|
};
|
|
9
18
|
//# sourceMappingURL=use-session-object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-session-object.d.ts","sourceRoot":"","sources":["../../src/session/use-session-object.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,OAAO,EACR,MAAM,cAAc,CAAC;AAItB,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"use-session-object.d.ts","sourceRoot":"","sources":["../../src/session/use-session-object.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,OAAO,EACR,MAAM,cAAc,CAAC;AAItB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;CAa5B,CAAC"}
|
package/lib/shared/datetime.js
CHANGED
package/lib/shared/decimals.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decimal = void 0;
|
|
4
|
-
exports.d = d;
|
|
3
|
+
exports.d = exports.decimal = void 0;
|
|
5
4
|
const decimal_js_1 = require("decimal.js");
|
|
6
5
|
decimal_js_1.Decimal.prototype.toFloor = function (decimalPlaces) {
|
|
7
6
|
return this.toDecimalPlaces(decimalPlaces, decimal_js_1.Decimal.ROUND_FLOOR);
|
|
@@ -15,4 +14,5 @@ exports.decimal = decimal;
|
|
|
15
14
|
function d(value) {
|
|
16
15
|
return new decimal(value);
|
|
17
16
|
}
|
|
17
|
+
exports.d = d;
|
|
18
18
|
d.Zero = new decimal(0);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.workingDirectory =
|
|
4
|
-
exports.getEnvVar = getEnvVar;
|
|
3
|
+
exports.getEnvVar = exports.workingDirectory = void 0;
|
|
5
4
|
function workingDirectory() {
|
|
6
5
|
return './.quantform/';
|
|
7
6
|
}
|
|
7
|
+
exports.workingDirectory = workingDirectory;
|
|
8
8
|
function getEnvVar(name, optional = false) {
|
|
9
9
|
const value = process.env[name];
|
|
10
10
|
if (!value && !optional) {
|
|
@@ -12,3 +12,4 @@ function getEnvVar(name, optional = false) {
|
|
|
12
12
|
}
|
|
13
13
|
return value !== null && value !== void 0 ? value : '';
|
|
14
14
|
}
|
|
15
|
+
exports.getEnvVar = getEnvVar;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSimulator =
|
|
3
|
+
exports.useSimulator = void 0;
|
|
4
4
|
const use_execution_mode_1 = require("../use-execution-mode");
|
|
5
5
|
function useSimulator(simulator, real) {
|
|
6
6
|
const { isSimulation } = (0, use_execution_mode_1.useExecutionMode)();
|
|
7
7
|
return isSimulation ? simulator : real;
|
|
8
8
|
}
|
|
9
|
+
exports.useSimulator = useSimulator;
|
|
@@ -16,8 +16,8 @@ let InMemoryStorageFactory = InMemoryStorageFactory_1 = class InMemoryStorageFac
|
|
|
16
16
|
return ((_a = InMemoryStorageFactory_1.storage[key]) !== null && _a !== void 0 ? _a : (InMemoryStorageFactory_1.storage[key] = new in_memory_storage_1.InMemoryStorage()));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
exports.InMemoryStorageFactory = InMemoryStorageFactory;
|
|
20
19
|
InMemoryStorageFactory.storage = {};
|
|
21
|
-
|
|
20
|
+
InMemoryStorageFactory = InMemoryStorageFactory_1 = __decorate([
|
|
22
21
|
(0, module_1.provider)()
|
|
23
22
|
], InMemoryStorageFactory);
|
|
23
|
+
exports.InMemoryStorageFactory = InMemoryStorageFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/storage/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvC,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/storage/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvC,eAAO,MAAM,EAAE;;;CAAkE,CAAC;AAClF,eAAO,MAAM,EAAE;;;CAAmE,CAAC;AACnF,eAAO,MAAM,EAAE;;;CAAmE,CAAC;AACnF,eAAO,MAAM,OAAO;;;;CAIlB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE;SACH,GAAG,IAAI,MAAM,CAAC,GAAG,gBAAgB;KACnC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,UAAU,CAAC,OAAO,EAAE,CAAC,GACrB,UAAU,CAAC,OAAO,EAAE,CAAC,GACrB,UAAU,CAAC,OAAO,EAAE,CAAC,GACrB,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAE/B,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,WAAW,IAAI;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;SACb,GAAG,IAAI,MAAM,CAAC,GAAG,UAAU;KAC7B,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC/D,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,MAAM,CAAC,CAAC,GAChE;KACG,GAAG,IAAI,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,QAAQ,GACrD,MAAM,GACN,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,QAAQ,GAC/B,MAAM,GACN,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,SAAS,GAChC,OAAO,GACP,KAAK;CACV,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GACzB,KAAK,CAAC;AAEV,8BAAsB,OAAO;IAC3B,MAAM,CAAC,YAAY,CACjB,CAAC,SAAS,WAAW,EACrB,CAAC,SAAS;SAAG,GAAG,IAAI,MAAM,CAAC,GAAG,gBAAgB;KAAE,EAChD,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;;;IAOhC,QAAQ,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EAC/D,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC;IAChB,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EAChE,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAChC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;CAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cache.d.ts","sourceRoot":"","sources":["../../src/storage/use-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAiB,MAAM,MAAM,CAAC;AAI5D,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAUpD,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"use-cache.d.ts","sourceRoot":"","sources":["../../src/storage/use-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAiB,MAAM,MAAM,CAAC;AAI5D,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAUpD,eAAO,MAAM,QAAQ,mDAEL,UAAU,EAAE,QACrB,MAAM,kBAgCZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-storage-factory.d.ts","sourceRoot":"","sources":["../../src/storage/use-storage-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,mBAEhC;yBAFe,iBAAiB
|
|
1
|
+
{"version":3,"file":"use-storage-factory.d.ts","sourceRoot":"","sources":["../../src/storage/use-storage-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,mBAEhC;yBAFe,iBAAiB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useStorageFactory =
|
|
3
|
+
exports.useStorageFactory = void 0;
|
|
4
4
|
const module_1 = require("../module");
|
|
5
5
|
const token = Symbol('storage-factory-token');
|
|
6
6
|
function useStorageFactory() {
|
|
7
7
|
return (0, module_1.useContext)(token);
|
|
8
8
|
}
|
|
9
|
+
exports.useStorageFactory = useStorageFactory;
|
|
9
10
|
useStorageFactory.options = (factory) => ({
|
|
10
11
|
provide: token,
|
|
11
12
|
useValue: factory
|
package/lib/strategy.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.after = exports.behavior = exports.before = void 0;
|
|
4
|
-
exports.strategy = strategy;
|
|
3
|
+
exports.strategy = exports.after = exports.behavior = exports.before = void 0;
|
|
5
4
|
const rxjs_1 = require("rxjs");
|
|
6
5
|
function strategy(descriptor) {
|
|
7
6
|
const description = {
|
|
@@ -24,3 +23,4 @@ function strategy(descriptor) {
|
|
|
24
23
|
description
|
|
25
24
|
};
|
|
26
25
|
}
|
|
26
|
+
exports.strategy = strategy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-execution-mode.d.ts","sourceRoot":"","sources":["../src/use-execution-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AASrD,wBAAgB,gBAAgB;;;;;;;EAW/B;yBAXe,gBAAgB
|
|
1
|
+
{"version":3,"file":"use-execution-mode.d.ts","sourceRoot":"","sources":["../src/use-execution-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AASrD,wBAAgB,gBAAgB;;;;;;;EAW/B;yBAXe,gBAAgB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useExecutionMode =
|
|
3
|
+
exports.useExecutionMode = void 0;
|
|
4
4
|
const module_1 = require("./module");
|
|
5
5
|
const injectionToken = Symbol('execution-mode');
|
|
6
6
|
function useExecutionMode() {
|
|
@@ -14,6 +14,7 @@ function useExecutionMode() {
|
|
|
14
14
|
recording
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
exports.useExecutionMode = useExecutionMode;
|
|
17
18
|
useExecutionMode.replayOptions = () => ({
|
|
18
19
|
provide: injectionToken,
|
|
19
20
|
useValue: { mode: 'replay', recording: false }
|
package/lib/use-hash.js
CHANGED
package/lib/use-memo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-memo.d.ts","sourceRoot":"","sources":["../src/use-memo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,KAAK,eAAuB,CAAC;AAE1C,wBAAgB,OAAO,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,KAS7E;yBATe,OAAO
|
|
1
|
+
{"version":3,"file":"use-memo.d.ts","sourceRoot":"","sources":["../src/use-memo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,KAAK,eAAuB,CAAC;AAE1C,wBAAgB,OAAO,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,KAS7E;yBATe,OAAO"}
|
package/lib/use-memo.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.token = void 0;
|
|
4
|
-
exports.useMemo = useMemo;
|
|
3
|
+
exports.useMemo = exports.token = void 0;
|
|
5
4
|
const module_1 = require("./module");
|
|
6
5
|
const use_hash_1 = require("./use-hash");
|
|
7
6
|
exports.token = Symbol('memo-token');
|
|
@@ -13,6 +12,7 @@ function useMemo(calculateValue, dependencies) {
|
|
|
13
12
|
}
|
|
14
13
|
return (memory[hash] = calculateValue());
|
|
15
14
|
}
|
|
15
|
+
exports.useMemo = useMemo;
|
|
16
16
|
useMemo.options = () => ({
|
|
17
17
|
provide: exports.token,
|
|
18
18
|
useValue: {}
|
package/lib/use-socket.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-socket.d.ts","sourceRoot":"","sources":["../src/use-socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAqB,MAAM,MAAM,CAAC;AAM5D,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAA2B;IAsBzD;;;OAGG;aACM,
|
|
1
|
+
{"version":3,"file":"use-socket.d.ts","sourceRoot":"","sources":["../src/use-socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAqB,MAAM,MAAM,CAAC;AAM5D,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAA2B;IAsBzD;;;OAGG;aACM,WAAW;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;kBAgD9C;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,WAAW;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;;EAczE"}
|
package/lib/use-socket.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSocket =
|
|
3
|
+
exports.useSocket = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const ws_1 = require("ws");
|
|
6
6
|
const use_logger_1 = require("./use-logger");
|
|
@@ -80,3 +80,4 @@ function useSocket(url, options = { pingInterval: 5000 }) {
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
+
exports.useSocket = useSocket;
|
package/lib/use-timestamp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTimestamp =
|
|
3
|
+
exports.useTimestamp = void 0;
|
|
4
4
|
const replay_1 = require("./replay");
|
|
5
5
|
const use_execution_mode_1 = require("./use-execution-mode");
|
|
6
6
|
function useTimestamp() {
|
|
@@ -10,3 +10,4 @@ function useTimestamp() {
|
|
|
10
10
|
}
|
|
11
11
|
return Date.now();
|
|
12
12
|
}
|
|
13
|
+
exports.useTimestamp = useTimestamp;
|
package/lib/when-socket.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.whenSocket =
|
|
3
|
+
exports.whenSocket = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const ws_1 = require("ws");
|
|
6
6
|
const use_logger_1 = require("./use-logger");
|
|
@@ -50,3 +50,4 @@ function whenSocket(url, options = { pingInterval: 5000 }) {
|
|
|
50
50
|
});
|
|
51
51
|
return [message, (message) => JSON.stringify(message)];
|
|
52
52
|
}
|
|
53
|
+
exports.whenSocket = whenSocket;
|
package/lib/with-memo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withMemo =
|
|
3
|
+
exports.withMemo = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const uuid_1 = require("uuid");
|
|
6
6
|
const module_1 = require("./module");
|
|
@@ -17,3 +17,4 @@ function withMemo(fn) {
|
|
|
17
17
|
return value;
|
|
18
18
|
}, [uniqueId, ...args]);
|
|
19
19
|
}
|
|
20
|
+
exports.withMemo = withMemo;
|
package/lib/with-request.js
CHANGED
|
@@ -9,8 +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.RequestNetworkError = void 0;
|
|
13
|
-
exports.withRequest = withRequest;
|
|
12
|
+
exports.withRequest = exports.RequestNetworkError = void 0;
|
|
14
13
|
const node_crypto_1 = require("node:crypto");
|
|
15
14
|
const rxjs_1 = require("rxjs");
|
|
16
15
|
const undici_1 = require("undici");
|
|
@@ -29,7 +28,7 @@ function withRequest({ method, url, headers, body }) {
|
|
|
29
28
|
const correlationId = (0, node_crypto_1.randomUUID)();
|
|
30
29
|
debug('requesting', { correlationId, method, url, headers, body });
|
|
31
30
|
(0, undici_1.request)(url, { method, headers, body })
|
|
32
|
-
.then((
|
|
31
|
+
.then(({ statusCode, body }) => __awaiter(this, void 0, void 0, function* () {
|
|
33
32
|
const json = yield body.json();
|
|
34
33
|
debug('received', {
|
|
35
34
|
correlationId,
|
|
@@ -66,3 +65,4 @@ function withRequest({ method, url, headers, body }) {
|
|
|
66
65
|
.finally(() => subscriber.complete());
|
|
67
66
|
});
|
|
68
67
|
}
|
|
68
|
+
exports.withRequest = withRequest;
|