@gbozee/ultimate 0.0.2-119 → 0.0.2-121
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/frontend-index.js +7 -14
- package/dist/index.cjs +241 -214
- package/dist/index.d.ts +3 -0
- package/dist/index.js +245 -222
- package/dist/mcp-client.cjs +25 -50
- package/dist/mcp-client.js +25 -50
- package/dist/mcp-server.cjs +244 -220
- package/dist/mcp-server.js +248 -228
- package/package.json +1 -1
- package/dist/frontend/frontend-index.js +0 -1318
- package/dist/mcp.d.ts +0 -5
package/dist/index.cjs
CHANGED
|
@@ -580,8 +580,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
580
580
|
let macCheckPassed;
|
|
581
581
|
try {
|
|
582
582
|
macCheckPassed = timing_safe_equal_default(tag, expectedTag);
|
|
583
|
-
} catch {
|
|
584
|
-
}
|
|
583
|
+
} catch {}
|
|
585
584
|
if (!macCheckPassed) {
|
|
586
585
|
throw new JWEDecryptionFailed;
|
|
587
586
|
}
|
|
@@ -589,8 +588,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
589
588
|
try {
|
|
590
589
|
const decipher = import_node_crypto6.createDecipheriv(algorithm, encKey, iv);
|
|
591
590
|
plaintext = concat(decipher.update(ciphertext), decipher.final());
|
|
592
|
-
} catch {
|
|
593
|
-
}
|
|
591
|
+
} catch {}
|
|
594
592
|
if (!plaintext) {
|
|
595
593
|
throw new JWEDecryptionFailed;
|
|
596
594
|
}
|
|
@@ -769,8 +767,7 @@ function isPublicJWK(key) {
|
|
|
769
767
|
function isSecretJWK(key) {
|
|
770
768
|
return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
|
|
771
769
|
}
|
|
772
|
-
var init_is_jwk = () => {
|
|
773
|
-
};
|
|
770
|
+
var init_is_jwk = () => {};
|
|
774
771
|
|
|
775
772
|
// node_modules/jose/dist/node/esm/runtime/get_named_curve.js
|
|
776
773
|
var import_node_crypto8, weakMap, namedCurveToJOSE = (namedCurve) => {
|
|
@@ -952,8 +949,7 @@ var import_node_crypto11, check_key_length_default = (key, alg) => {
|
|
|
952
949
|
} else {
|
|
953
950
|
modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
|
|
954
951
|
}
|
|
955
|
-
} catch {
|
|
956
|
-
}
|
|
952
|
+
} catch {}
|
|
957
953
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
958
954
|
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
959
955
|
}
|
|
@@ -1714,8 +1710,7 @@ async function generalDecrypt(jwe, key, options) {
|
|
|
1714
1710
|
tag: jwe.tag,
|
|
1715
1711
|
unprotected: jwe.unprotected
|
|
1716
1712
|
}, key, options);
|
|
1717
|
-
} catch {
|
|
1718
|
-
}
|
|
1713
|
+
} catch {}
|
|
1719
1714
|
}
|
|
1720
1715
|
throw new JWEDecryptionFailed;
|
|
1721
1716
|
}
|
|
@@ -2601,8 +2596,7 @@ async function generalVerify(jws, key, options) {
|
|
|
2601
2596
|
protected: signature.protected,
|
|
2602
2597
|
signature: signature.signature
|
|
2603
2598
|
}, key, options);
|
|
2604
|
-
} catch {
|
|
2605
|
-
}
|
|
2599
|
+
} catch {}
|
|
2606
2600
|
}
|
|
2607
2601
|
throw new JWSSignatureVerificationFailed;
|
|
2608
2602
|
}
|
|
@@ -2685,8 +2679,7 @@ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, ""),
|
|
|
2685
2679
|
let payload;
|
|
2686
2680
|
try {
|
|
2687
2681
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
2688
|
-
} catch {
|
|
2689
|
-
}
|
|
2682
|
+
} catch {}
|
|
2690
2683
|
if (!isObject(payload)) {
|
|
2691
2684
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
2692
2685
|
}
|
|
@@ -3371,8 +3364,7 @@ class LocalJWKSet {
|
|
|
3371
3364
|
for (const jwk2 of candidates) {
|
|
3372
3365
|
try {
|
|
3373
3366
|
yield await importWithAlgCache(_cached, jwk2, alg);
|
|
3374
|
-
} catch {
|
|
3375
|
-
}
|
|
3367
|
+
} catch {}
|
|
3376
3368
|
}
|
|
3377
3369
|
};
|
|
3378
3370
|
throw error;
|
|
@@ -3919,8 +3911,7 @@ var require_util = __commonJS((exports2) => {
|
|
|
3919
3911
|
var util4;
|
|
3920
3912
|
(function(util5) {
|
|
3921
3913
|
util5.assertEqual = (val) => val;
|
|
3922
|
-
function assertIs(_arg) {
|
|
3923
|
-
}
|
|
3914
|
+
function assertIs(_arg) {}
|
|
3924
3915
|
util5.assertIs = assertIs;
|
|
3925
3916
|
function assertNever(_x) {
|
|
3926
3917
|
throw new Error;
|
|
@@ -6336,8 +6327,7 @@ var require_types = __commonJS((exports2) => {
|
|
|
6336
6327
|
});
|
|
6337
6328
|
status.dirty();
|
|
6338
6329
|
}
|
|
6339
|
-
} else if (unknownKeys === "strip") {
|
|
6340
|
-
} else {
|
|
6330
|
+
} else if (unknownKeys === "strip") {} else {
|
|
6341
6331
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
6342
6332
|
}
|
|
6343
6333
|
} else {
|
|
@@ -8489,8 +8479,7 @@ var require_logLevelLogger = __commonJS((exports2) => {
|
|
|
8489
8479
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
8490
8480
|
return theFunc.bind(logger);
|
|
8491
8481
|
}
|
|
8492
|
-
return function() {
|
|
8493
|
-
};
|
|
8482
|
+
return function() {};
|
|
8494
8483
|
}
|
|
8495
8484
|
return {
|
|
8496
8485
|
error: _filterFunc("error", types_1.DiagLogLevel.ERROR),
|
|
@@ -8715,8 +8704,7 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8715
8704
|
exports2.createNoopMeter = exports2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports2.NOOP_OBSERVABLE_GAUGE_METRIC = exports2.NOOP_OBSERVABLE_COUNTER_METRIC = exports2.NOOP_UP_DOWN_COUNTER_METRIC = exports2.NOOP_HISTOGRAM_METRIC = exports2.NOOP_GAUGE_METRIC = exports2.NOOP_COUNTER_METRIC = exports2.NOOP_METER = exports2.NoopObservableUpDownCounterMetric = exports2.NoopObservableGaugeMetric = exports2.NoopObservableCounterMetric = exports2.NoopObservableMetric = exports2.NoopHistogramMetric = exports2.NoopGaugeMetric = exports2.NoopUpDownCounterMetric = exports2.NoopCounterMetric = exports2.NoopMetric = exports2.NoopMeter = undefined;
|
|
8716
8705
|
|
|
8717
8706
|
class NoopMeter {
|
|
8718
|
-
constructor() {
|
|
8719
|
-
}
|
|
8707
|
+
constructor() {}
|
|
8720
8708
|
createGauge(_name, _options) {
|
|
8721
8709
|
return exports2.NOOP_GAUGE_METRIC;
|
|
8722
8710
|
}
|
|
@@ -8738,10 +8726,8 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8738
8726
|
createObservableUpDownCounter(_name, _options) {
|
|
8739
8727
|
return exports2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
8740
8728
|
}
|
|
8741
|
-
addBatchObservableCallback(_callback, _observables) {
|
|
8742
|
-
}
|
|
8743
|
-
removeBatchObservableCallback(_callback) {
|
|
8744
|
-
}
|
|
8729
|
+
addBatchObservableCallback(_callback, _observables) {}
|
|
8730
|
+
removeBatchObservableCallback(_callback) {}
|
|
8745
8731
|
}
|
|
8746
8732
|
exports2.NoopMeter = NoopMeter;
|
|
8747
8733
|
|
|
@@ -8750,34 +8736,28 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8750
8736
|
exports2.NoopMetric = NoopMetric;
|
|
8751
8737
|
|
|
8752
8738
|
class NoopCounterMetric extends NoopMetric {
|
|
8753
|
-
add(_value, _attributes) {
|
|
8754
|
-
}
|
|
8739
|
+
add(_value, _attributes) {}
|
|
8755
8740
|
}
|
|
8756
8741
|
exports2.NoopCounterMetric = NoopCounterMetric;
|
|
8757
8742
|
|
|
8758
8743
|
class NoopUpDownCounterMetric extends NoopMetric {
|
|
8759
|
-
add(_value, _attributes) {
|
|
8760
|
-
}
|
|
8744
|
+
add(_value, _attributes) {}
|
|
8761
8745
|
}
|
|
8762
8746
|
exports2.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
|
|
8763
8747
|
|
|
8764
8748
|
class NoopGaugeMetric extends NoopMetric {
|
|
8765
|
-
record(_value, _attributes) {
|
|
8766
|
-
}
|
|
8749
|
+
record(_value, _attributes) {}
|
|
8767
8750
|
}
|
|
8768
8751
|
exports2.NoopGaugeMetric = NoopGaugeMetric;
|
|
8769
8752
|
|
|
8770
8753
|
class NoopHistogramMetric extends NoopMetric {
|
|
8771
|
-
record(_value, _attributes) {
|
|
8772
|
-
}
|
|
8754
|
+
record(_value, _attributes) {}
|
|
8773
8755
|
}
|
|
8774
8756
|
exports2.NoopHistogramMetric = NoopHistogramMetric;
|
|
8775
8757
|
|
|
8776
8758
|
class NoopObservableMetric {
|
|
8777
|
-
addCallback(_callback) {
|
|
8778
|
-
}
|
|
8779
|
-
removeCallback(_callback) {
|
|
8780
|
-
}
|
|
8759
|
+
addCallback(_callback) {}
|
|
8760
|
+
removeCallback(_callback) {}
|
|
8781
8761
|
}
|
|
8782
8762
|
exports2.NoopObservableMetric = NoopObservableMetric;
|
|
8783
8763
|
|
|
@@ -8882,8 +8862,7 @@ var require_context2 = __commonJS((exports2) => {
|
|
|
8882
8862
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager;
|
|
8883
8863
|
|
|
8884
8864
|
class ContextAPI {
|
|
8885
|
-
constructor() {
|
|
8886
|
-
}
|
|
8865
|
+
constructor() {}
|
|
8887
8866
|
static getInstance() {
|
|
8888
8867
|
if (!this._instance) {
|
|
8889
8868
|
this._instance = new ContextAPI;
|
|
@@ -8972,13 +8951,11 @@ var require_NonRecordingSpan = __commonJS((exports2) => {
|
|
|
8972
8951
|
updateName(_name) {
|
|
8973
8952
|
return this;
|
|
8974
8953
|
}
|
|
8975
|
-
end(_endTime) {
|
|
8976
|
-
}
|
|
8954
|
+
end(_endTime) {}
|
|
8977
8955
|
isRecording() {
|
|
8978
8956
|
return false;
|
|
8979
8957
|
}
|
|
8980
|
-
recordException(_exception, _time) {
|
|
8981
|
-
}
|
|
8958
|
+
recordException(_exception, _time) {}
|
|
8982
8959
|
}
|
|
8983
8960
|
exports2.NonRecordingSpan = NonRecordingSpan;
|
|
8984
8961
|
});
|
|
@@ -9280,8 +9257,7 @@ var require_tracestate_impl = __commonJS((exports2) => {
|
|
|
9280
9257
|
const value = listMember.slice(i + 1, part.length);
|
|
9281
9258
|
if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
|
|
9282
9259
|
agg.set(key, value);
|
|
9283
|
-
} else {
|
|
9284
|
-
}
|
|
9260
|
+
} else {}
|
|
9285
9261
|
}
|
|
9286
9262
|
return agg;
|
|
9287
9263
|
}, new Map);
|
|
@@ -9353,8 +9329,7 @@ var require_metrics = __commonJS((exports2) => {
|
|
|
9353
9329
|
var API_NAME2 = "metrics";
|
|
9354
9330
|
|
|
9355
9331
|
class MetricsAPI {
|
|
9356
|
-
constructor() {
|
|
9357
|
-
}
|
|
9332
|
+
constructor() {}
|
|
9358
9333
|
static getInstance() {
|
|
9359
9334
|
if (!this._instance) {
|
|
9360
9335
|
this._instance = new MetricsAPI;
|
|
@@ -9391,8 +9366,7 @@ var require_NoopTextMapPropagator = __commonJS((exports2) => {
|
|
|
9391
9366
|
exports2.NoopTextMapPropagator = undefined;
|
|
9392
9367
|
|
|
9393
9368
|
class NoopTextMapPropagator {
|
|
9394
|
-
inject(_context, _carrier) {
|
|
9395
|
-
}
|
|
9369
|
+
inject(_context, _carrier) {}
|
|
9396
9370
|
extract(context, _carrier) {
|
|
9397
9371
|
return context;
|
|
9398
9372
|
}
|
|
@@ -9705,8 +9679,7 @@ class Registry {
|
|
|
9705
9679
|
return this.kv.getByKey(identifier);
|
|
9706
9680
|
}
|
|
9707
9681
|
}
|
|
9708
|
-
var init_registry = () => {
|
|
9709
|
-
};
|
|
9682
|
+
var init_registry = () => {};
|
|
9710
9683
|
|
|
9711
9684
|
// node_modules/superjson/dist/class-registry.js
|
|
9712
9685
|
var ClassRegistry;
|
|
@@ -9791,8 +9764,7 @@ class CustomTransformerRegistry {
|
|
|
9791
9764
|
return this.transfomers[name2];
|
|
9792
9765
|
}
|
|
9793
9766
|
}
|
|
9794
|
-
var init_custom_transformer_registry = () => {
|
|
9795
|
-
};
|
|
9767
|
+
var init_custom_transformer_registry = () => {};
|
|
9796
9768
|
|
|
9797
9769
|
// node_modules/superjson/dist/is.js
|
|
9798
9770
|
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1), isUndefined = (payload) => typeof payload === "undefined", isNull = (payload) => payload === null, isPlainObject = (payload) => {
|
|
@@ -10137,8 +10109,7 @@ var getNthKey = (value, n) => {
|
|
|
10137
10109
|
}
|
|
10138
10110
|
return object;
|
|
10139
10111
|
};
|
|
10140
|
-
var init_accessDeep = () => {
|
|
10141
|
-
};
|
|
10112
|
+
var init_accessDeep = () => {};
|
|
10142
10113
|
|
|
10143
10114
|
// node_modules/superjson/dist/plainer.js
|
|
10144
10115
|
function traverse(tree, walker, origin = []) {
|
|
@@ -10727,8 +10698,7 @@ var require_NoopLogger = __commonJS((exports2) => {
|
|
|
10727
10698
|
exports2.NOOP_LOGGER = exports2.NoopLogger = undefined;
|
|
10728
10699
|
|
|
10729
10700
|
class NoopLogger {
|
|
10730
|
-
emit(_logRecord) {
|
|
10731
|
-
}
|
|
10701
|
+
emit(_logRecord) {}
|
|
10732
10702
|
}
|
|
10733
10703
|
exports2.NoopLogger = NoopLogger;
|
|
10734
10704
|
exports2.NOOP_LOGGER = new NoopLogger;
|
|
@@ -10822,8 +10792,7 @@ var require_logs = __commonJS((exports2) => {
|
|
|
10822
10792
|
var NoopLoggerProvider_1 = require_NoopLoggerProvider();
|
|
10823
10793
|
|
|
10824
10794
|
class LogsAPI {
|
|
10825
|
-
constructor() {
|
|
10826
|
-
}
|
|
10795
|
+
constructor() {}
|
|
10827
10796
|
static getInstance() {
|
|
10828
10797
|
if (!this._instance) {
|
|
10829
10798
|
this._instance = new LogsAPI;
|
|
@@ -11291,8 +11260,7 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11291
11260
|
});
|
|
11292
11261
|
args.splice(lastC, 0, c);
|
|
11293
11262
|
}
|
|
11294
|
-
exports2.log = console.debug || console.log || (() => {
|
|
11295
|
-
});
|
|
11263
|
+
exports2.log = console.debug || console.log || (() => {});
|
|
11296
11264
|
function save(namespaces) {
|
|
11297
11265
|
try {
|
|
11298
11266
|
if (namespaces) {
|
|
@@ -11300,15 +11268,13 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11300
11268
|
} else {
|
|
11301
11269
|
exports2.storage.removeItem("debug");
|
|
11302
11270
|
}
|
|
11303
|
-
} catch (error) {
|
|
11304
|
-
}
|
|
11271
|
+
} catch (error) {}
|
|
11305
11272
|
}
|
|
11306
11273
|
function load() {
|
|
11307
11274
|
let r;
|
|
11308
11275
|
try {
|
|
11309
11276
|
r = exports2.storage.getItem("debug");
|
|
11310
|
-
} catch (error) {
|
|
11311
|
-
}
|
|
11277
|
+
} catch (error) {}
|
|
11312
11278
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
11313
11279
|
r = process.env.DEBUG;
|
|
11314
11280
|
}
|
|
@@ -11317,8 +11283,7 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11317
11283
|
function localstorage() {
|
|
11318
11284
|
try {
|
|
11319
11285
|
return localStorage;
|
|
11320
|
-
} catch (error) {
|
|
11321
|
-
}
|
|
11286
|
+
} catch (error) {}
|
|
11322
11287
|
}
|
|
11323
11288
|
module2.exports = require_common()(exports2);
|
|
11324
11289
|
var { formatters } = module2.exports;
|
|
@@ -11450,8 +11415,7 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11450
11415
|
exports2.save = save;
|
|
11451
11416
|
exports2.load = load;
|
|
11452
11417
|
exports2.useColors = useColors;
|
|
11453
|
-
exports2.destroy = util4.deprecate(() => {
|
|
11454
|
-
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11418
|
+
exports2.destroy = util4.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11455
11419
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
11456
11420
|
try {
|
|
11457
11421
|
const supportsColor = require_supports_color();
|
|
@@ -11535,8 +11499,7 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11535
11499
|
221
|
|
11536
11500
|
];
|
|
11537
11501
|
}
|
|
11538
|
-
} catch (error) {
|
|
11539
|
-
}
|
|
11502
|
+
} catch (error) {}
|
|
11540
11503
|
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
11541
11504
|
return /^debug_/i.test(key);
|
|
11542
11505
|
}).reduce((obj, key) => {
|
|
@@ -13785,8 +13748,7 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
13785
13748
|
++this[w];
|
|
13786
13749
|
}
|
|
13787
13750
|
}
|
|
13788
|
-
function NullExp() {
|
|
13789
|
-
}
|
|
13751
|
+
function NullExp() {}
|
|
13790
13752
|
function nNop(x) {
|
|
13791
13753
|
return x;
|
|
13792
13754
|
}
|
|
@@ -14211,8 +14173,7 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
14211
14173
|
for (i2 = 0;i2 < ba.length; ++i2)
|
|
14212
14174
|
ba[i2] = rng_get_byte();
|
|
14213
14175
|
}
|
|
14214
|
-
function SecureRandom() {
|
|
14215
|
-
}
|
|
14176
|
+
function SecureRandom() {}
|
|
14216
14177
|
SecureRandom.prototype.nextBytes = rng_get_bytes;
|
|
14217
14178
|
function Arcfour() {
|
|
14218
14179
|
this.i = 0;
|
|
@@ -16435,8 +16396,7 @@ var require_delayed_stream = __commonJS((exports2, module2) => {
|
|
|
16435
16396
|
delayedStream._handleEmit(arguments);
|
|
16436
16397
|
return realEmit.apply(source, arguments);
|
|
16437
16398
|
};
|
|
16438
|
-
source.on("error", function() {
|
|
16439
|
-
});
|
|
16399
|
+
source.on("error", function() {});
|
|
16440
16400
|
if (delayedStream.pauseStream) {
|
|
16441
16401
|
source.pause();
|
|
16442
16402
|
}
|
|
@@ -25740,8 +25700,7 @@ var require_implementation = __commonJS((exports2, module2) => {
|
|
|
25740
25700
|
}
|
|
25741
25701
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
25742
25702
|
if (target.prototype) {
|
|
25743
|
-
var Empty = function Empty() {
|
|
25744
|
-
};
|
|
25703
|
+
var Empty = function Empty() {};
|
|
25745
25704
|
Empty.prototype = target.prototype;
|
|
25746
25705
|
bound.prototype = new Empty;
|
|
25747
25706
|
Empty.prototype = null;
|
|
@@ -25861,8 +25820,7 @@ var require_get_intrinsic = __commonJS((exports2, module2) => {
|
|
|
25861
25820
|
var getEvalledConstructor = function(expressionSyntax) {
|
|
25862
25821
|
try {
|
|
25863
25822
|
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
25864
|
-
} catch (e2) {
|
|
25865
|
-
}
|
|
25823
|
+
} catch (e2) {}
|
|
25866
25824
|
};
|
|
25867
25825
|
var $gOPD = require_gopd();
|
|
25868
25826
|
var $defineProperty = require_es_define_property();
|
|
@@ -26601,11 +26559,9 @@ var require_debug = __commonJS((exports2, module2) => {
|
|
|
26601
26559
|
if (!debug) {
|
|
26602
26560
|
try {
|
|
26603
26561
|
debug = require_src4()("follow-redirects");
|
|
26604
|
-
} catch (error) {
|
|
26605
|
-
}
|
|
26562
|
+
} catch (error) {}
|
|
26606
26563
|
if (typeof debug !== "function") {
|
|
26607
|
-
debug = function() {
|
|
26608
|
-
};
|
|
26564
|
+
debug = function() {};
|
|
26609
26565
|
}
|
|
26610
26566
|
}
|
|
26611
26567
|
debug.apply(null, arguments);
|
|
@@ -26980,8 +26936,7 @@ var require_follow_redirects = __commonJS((exports2, module2) => {
|
|
|
26980
26936
|
});
|
|
26981
26937
|
return exports3;
|
|
26982
26938
|
}
|
|
26983
|
-
function noop2() {
|
|
26984
|
-
}
|
|
26939
|
+
function noop2() {}
|
|
26985
26940
|
function parseUrl(input) {
|
|
26986
26941
|
var parsed;
|
|
26987
26942
|
if (useNativeURL) {
|
|
@@ -27364,8 +27319,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
27364
27319
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
27365
27320
|
return obj;
|
|
27366
27321
|
};
|
|
27367
|
-
var noop2 = () => {
|
|
27368
|
-
};
|
|
27322
|
+
var noop2 = () => {};
|
|
27369
27323
|
var toFiniteNumber = (value2, defaultValue) => {
|
|
27370
27324
|
return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
|
|
27371
27325
|
};
|
|
@@ -28818,8 +28772,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
28818
28772
|
try {
|
|
28819
28773
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
28820
28774
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
28821
|
-
} catch (e2) {
|
|
28822
|
-
}
|
|
28775
|
+
} catch (e2) {}
|
|
28823
28776
|
}
|
|
28824
28777
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
28825
28778
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -29093,13 +29046,11 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29093
29046
|
this.write(name2, "", Date.now() - 86400000);
|
|
29094
29047
|
}
|
|
29095
29048
|
} : {
|
|
29096
|
-
write() {
|
|
29097
|
-
},
|
|
29049
|
+
write() {},
|
|
29098
29050
|
read() {
|
|
29099
29051
|
return null;
|
|
29100
29052
|
},
|
|
29101
|
-
remove() {
|
|
29102
|
-
}
|
|
29053
|
+
remove() {}
|
|
29103
29054
|
};
|
|
29104
29055
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
29105
29056
|
function mergeConfig(config1, config2) {
|
|
@@ -29593,8 +29544,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29593
29544
|
if (fn) {
|
|
29594
29545
|
try {
|
|
29595
29546
|
Object.defineProperty(fn, "name", { value: value2 });
|
|
29596
|
-
} catch (e2) {
|
|
29597
|
-
}
|
|
29547
|
+
} catch (e2) {}
|
|
29598
29548
|
Object.defineProperty(fn, "adapterName", { value: value2 });
|
|
29599
29549
|
}
|
|
29600
29550
|
});
|
|
@@ -29744,8 +29694,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29744
29694
|
err.stack += `
|
|
29745
29695
|
` + stack;
|
|
29746
29696
|
}
|
|
29747
|
-
} catch (e2) {
|
|
29748
|
-
}
|
|
29697
|
+
} catch (e2) {}
|
|
29749
29698
|
}
|
|
29750
29699
|
throw err;
|
|
29751
29700
|
}
|
|
@@ -31818,8 +31767,7 @@ var require_logger = __commonJS((exports2) => {
|
|
|
31818
31767
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
31819
31768
|
exports2.DefaultLogger = undefined;
|
|
31820
31769
|
exports2.DefaultLogger = {
|
|
31821
|
-
silly: (...params) => {
|
|
31822
|
-
},
|
|
31770
|
+
silly: (...params) => {},
|
|
31823
31771
|
debug: (...params) => {
|
|
31824
31772
|
console.log(new Date, params);
|
|
31825
31773
|
},
|
|
@@ -34562,8 +34510,7 @@ var require_constants4 = __commonJS((exports2, module2) => {
|
|
|
34562
34510
|
kListener: Symbol("kListener"),
|
|
34563
34511
|
kStatusCode: Symbol("status-code"),
|
|
34564
34512
|
kWebSocket: Symbol("websocket"),
|
|
34565
|
-
NOOP: () => {
|
|
34566
|
-
}
|
|
34513
|
+
NOOP: () => {}
|
|
34567
34514
|
};
|
|
34568
34515
|
});
|
|
34569
34516
|
|
|
@@ -34641,8 +34588,7 @@ var require_buffer_util = __commonJS((exports2, module2) => {
|
|
|
34641
34588
|
else
|
|
34642
34589
|
bufferUtil.unmask(buffer, mask);
|
|
34643
34590
|
};
|
|
34644
|
-
} catch (e2) {
|
|
34645
|
-
}
|
|
34591
|
+
} catch (e2) {}
|
|
34646
34592
|
}
|
|
34647
34593
|
});
|
|
34648
34594
|
|
|
@@ -35121,8 +35067,7 @@ var require_validation = __commonJS((exports2, module2) => {
|
|
|
35121
35067
|
module2.exports.isValidUTF8 = function(buf) {
|
|
35122
35068
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
35123
35069
|
};
|
|
35124
|
-
} catch (e2) {
|
|
35125
|
-
}
|
|
35070
|
+
} catch (e2) {}
|
|
35126
35071
|
}
|
|
35127
35072
|
});
|
|
35128
35073
|
|
|
@@ -37552,8 +37497,7 @@ var require_websocket_client = __commonJS((exports2) => {
|
|
|
37552
37497
|
this.options = Object.assign({ pongTimeout: 7500, pingInterval: 1e4, reconnectTimeout: 500 }, options);
|
|
37553
37498
|
this.listenKeyStateStore = {};
|
|
37554
37499
|
this.wsUrlKeyMap = {};
|
|
37555
|
-
this.on("error", () => {
|
|
37556
|
-
});
|
|
37500
|
+
this.on("error", () => {});
|
|
37557
37501
|
}
|
|
37558
37502
|
getRestClientOptions() {
|
|
37559
37503
|
return Object.assign(Object.assign(Object.assign({}, this.options), this.options.restOptions), { api_key: this.options.api_key, api_secret: this.options.api_secret });
|
|
@@ -38430,6 +38374,63 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
38430
38374
|
__exportStar(require_websocket_client(), exports2);
|
|
38431
38375
|
});
|
|
38432
38376
|
|
|
38377
|
+
// node_modules/p-try/index.js
|
|
38378
|
+
var require_p_try = __commonJS((exports2, module2) => {
|
|
38379
|
+
var pTry = (fn, ...arguments_) => new Promise((resolve) => {
|
|
38380
|
+
resolve(fn(...arguments_));
|
|
38381
|
+
});
|
|
38382
|
+
module2.exports = pTry;
|
|
38383
|
+
module2.exports.default = pTry;
|
|
38384
|
+
});
|
|
38385
|
+
|
|
38386
|
+
// node_modules/p-limit/index.js
|
|
38387
|
+
var require_p_limit = __commonJS((exports2, module2) => {
|
|
38388
|
+
var pTry = require_p_try();
|
|
38389
|
+
var pLimit = (concurrency) => {
|
|
38390
|
+
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
38391
|
+
return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
|
|
38392
|
+
}
|
|
38393
|
+
const queue2 = [];
|
|
38394
|
+
let activeCount = 0;
|
|
38395
|
+
const next = () => {
|
|
38396
|
+
activeCount--;
|
|
38397
|
+
if (queue2.length > 0) {
|
|
38398
|
+
queue2.shift()();
|
|
38399
|
+
}
|
|
38400
|
+
};
|
|
38401
|
+
const run = (fn, resolve, ...args) => {
|
|
38402
|
+
activeCount++;
|
|
38403
|
+
const result = pTry(fn, ...args);
|
|
38404
|
+
resolve(result);
|
|
38405
|
+
result.then(next, next);
|
|
38406
|
+
};
|
|
38407
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
38408
|
+
if (activeCount < concurrency) {
|
|
38409
|
+
run(fn, resolve, ...args);
|
|
38410
|
+
} else {
|
|
38411
|
+
queue2.push(run.bind(null, fn, resolve, ...args));
|
|
38412
|
+
}
|
|
38413
|
+
};
|
|
38414
|
+
const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
|
|
38415
|
+
Object.defineProperties(generator, {
|
|
38416
|
+
activeCount: {
|
|
38417
|
+
get: () => activeCount
|
|
38418
|
+
},
|
|
38419
|
+
pendingCount: {
|
|
38420
|
+
get: () => queue2.length
|
|
38421
|
+
},
|
|
38422
|
+
clearQueue: {
|
|
38423
|
+
value: () => {
|
|
38424
|
+
queue2.length = 0;
|
|
38425
|
+
}
|
|
38426
|
+
}
|
|
38427
|
+
});
|
|
38428
|
+
return generator;
|
|
38429
|
+
};
|
|
38430
|
+
module2.exports = pLimit;
|
|
38431
|
+
module2.exports.default = pLimit;
|
|
38432
|
+
});
|
|
38433
|
+
|
|
38433
38434
|
// node_modules/bybit-api/lib/util/requestUtils.js
|
|
38434
38435
|
var require_requestUtils2 = __commonJS((exports2) => {
|
|
38435
38436
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -38970,8 +38971,7 @@ var require_logger2 = __commonJS((exports2) => {
|
|
|
38970
38971
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
38971
38972
|
exports2.DefaultLogger = undefined;
|
|
38972
38973
|
exports2.DefaultLogger = {
|
|
38973
|
-
trace: (..._params) => {
|
|
38974
|
-
},
|
|
38974
|
+
trace: (..._params) => {},
|
|
38975
38975
|
info: (...params) => {
|
|
38976
38976
|
console.info(params);
|
|
38977
38977
|
},
|
|
@@ -41017,8 +41017,7 @@ var require_BaseWSClient = __commonJS((exports2) => {
|
|
|
41017
41017
|
if (wsState === null || wsState === undefined ? undefined : wsState.activePongTimer) {
|
|
41018
41018
|
clearTimeout(wsState.activePongTimer);
|
|
41019
41019
|
wsState.activePongTimer = undefined;
|
|
41020
|
-
} else {
|
|
41021
|
-
}
|
|
41020
|
+
} else {}
|
|
41022
41021
|
}
|
|
41023
41022
|
clearReconnectTimer(wsKey) {
|
|
41024
41023
|
const wsState = this.wsStore.get(wsKey);
|
|
@@ -41932,8 +41931,7 @@ __export(exports_app, {
|
|
|
41932
41931
|
var util;
|
|
41933
41932
|
(function(util2) {
|
|
41934
41933
|
util2.assertEqual = (val) => val;
|
|
41935
|
-
function assertIs(_arg) {
|
|
41936
|
-
}
|
|
41934
|
+
function assertIs(_arg) {}
|
|
41937
41935
|
util2.assertIs = assertIs;
|
|
41938
41936
|
function assertNever(_x) {
|
|
41939
41937
|
throw new Error;
|
|
@@ -46794,8 +46792,7 @@ var API_NAME = "task-context";
|
|
|
46794
46792
|
|
|
46795
46793
|
class TaskContextAPI {
|
|
46796
46794
|
static _instance;
|
|
46797
|
-
constructor() {
|
|
46798
|
-
}
|
|
46795
|
+
constructor() {}
|
|
46799
46796
|
static getInstance() {
|
|
46800
46797
|
if (!this._instance) {
|
|
46801
46798
|
this._instance = new TaskContextAPI;
|
|
@@ -47215,8 +47212,7 @@ class ParseError extends Error {
|
|
|
47215
47212
|
super(message2), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
47216
47213
|
}
|
|
47217
47214
|
}
|
|
47218
|
-
function noop(_arg) {
|
|
47219
|
-
}
|
|
47215
|
+
function noop(_arg) {}
|
|
47220
47216
|
function createParser(callbacks) {
|
|
47221
47217
|
if (typeof callbacks == "function")
|
|
47222
47218
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
@@ -47419,8 +47415,7 @@ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt
|
|
|
47419
47415
|
if (error instanceof ApiError) {
|
|
47420
47416
|
throw error;
|
|
47421
47417
|
}
|
|
47422
|
-
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
47423
|
-
}
|
|
47418
|
+
if (error instanceof import_zod_validation_error.ValidationError) {}
|
|
47424
47419
|
if (options?.retry) {
|
|
47425
47420
|
const retry = { ...defaultRetryOptions2, ...options.retry };
|
|
47426
47421
|
const delay = calculateNextRetryDelay(retry, attempt);
|
|
@@ -47894,8 +47889,7 @@ class ApiClientMissingError extends Error {
|
|
|
47894
47889
|
|
|
47895
47890
|
class APIClientManagerAPI {
|
|
47896
47891
|
static _instance;
|
|
47897
|
-
constructor() {
|
|
47898
|
-
}
|
|
47892
|
+
constructor() {}
|
|
47899
47893
|
static getInstance() {
|
|
47900
47894
|
if (!this._instance) {
|
|
47901
47895
|
this._instance = new APIClientManagerAPI;
|
|
@@ -48450,8 +48444,7 @@ var PrefetchQueue = class {
|
|
|
48450
48444
|
if (__privateGet(this, _queueTailUrl) && !__privateGet(this, _prefetchQueue).has(__privateGet(this, _queueTailUrl))) {
|
|
48451
48445
|
__privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, __privateGet(this, _queueTailUrl), args[1]);
|
|
48452
48446
|
}
|
|
48453
|
-
}).catch(() => {
|
|
48454
|
-
});
|
|
48447
|
+
}).catch(() => {});
|
|
48455
48448
|
return request;
|
|
48456
48449
|
}
|
|
48457
48450
|
};
|
|
@@ -48482,10 +48475,8 @@ prefetch_fn = function(...args) {
|
|
|
48482
48475
|
}
|
|
48483
48476
|
__privateSet(this, _queueTailUrl, nextUrl);
|
|
48484
48477
|
return __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, nextUrl, args[1]);
|
|
48485
|
-
}).catch(() => {
|
|
48486
|
-
|
|
48487
|
-
} catch (_) {
|
|
48488
|
-
}
|
|
48478
|
+
}).catch(() => {});
|
|
48479
|
+
} catch (_) {}
|
|
48489
48480
|
};
|
|
48490
48481
|
function getNextChunkUrl(url, res) {
|
|
48491
48482
|
const shapeHandle = res.headers.get(SHAPE_HANDLE_HEADER);
|
|
@@ -48588,8 +48579,7 @@ var ShapeStream = class {
|
|
|
48588
48579
|
get lastOffset() {
|
|
48589
48580
|
return __privateGet(this, _lastOffset);
|
|
48590
48581
|
}
|
|
48591
|
-
subscribe(callback, onError = () => {
|
|
48592
|
-
}) {
|
|
48582
|
+
subscribe(callback, onError = () => {}) {
|
|
48593
48583
|
const subscriptionId = Math.random();
|
|
48594
48584
|
__privateGet(this, _subscribers).set(subscriptionId, [callback, onError]);
|
|
48595
48585
|
return () => {
|
|
@@ -49783,8 +49773,7 @@ class SimpleClock {
|
|
|
49783
49773
|
const nowStruct = now.toStruct();
|
|
49784
49774
|
return [nowStruct.seconds, nowStruct.nanos];
|
|
49785
49775
|
}
|
|
49786
|
-
reset() {
|
|
49787
|
-
}
|
|
49776
|
+
reset() {}
|
|
49788
49777
|
}
|
|
49789
49778
|
|
|
49790
49779
|
// node_modules/@trigger.dev/core/dist/esm/v3/clock/index.js
|
|
@@ -49793,8 +49782,7 @@ var SIMPLE_CLOCK = new SimpleClock;
|
|
|
49793
49782
|
|
|
49794
49783
|
class ClockAPI {
|
|
49795
49784
|
static _instance;
|
|
49796
|
-
constructor() {
|
|
49797
|
-
}
|
|
49785
|
+
constructor() {}
|
|
49798
49786
|
static getInstance() {
|
|
49799
49787
|
if (!this._instance) {
|
|
49800
49788
|
this._instance = new ClockAPI;
|
|
@@ -49820,8 +49808,7 @@ var clock = ClockAPI.getInstance();
|
|
|
49820
49808
|
|
|
49821
49809
|
// node_modules/@trigger.dev/core/dist/esm/v3/usage/noopUsageManager.js
|
|
49822
49810
|
class NoopUsageManager {
|
|
49823
|
-
disable() {
|
|
49824
|
-
}
|
|
49811
|
+
disable() {}
|
|
49825
49812
|
start() {
|
|
49826
49813
|
return {
|
|
49827
49814
|
sample: () => ({ cpuTime: 0, wallTime: 0 })
|
|
@@ -49844,8 +49831,7 @@ var NOOP_USAGE_MANAGER = new NoopUsageManager;
|
|
|
49844
49831
|
|
|
49845
49832
|
class UsageAPI {
|
|
49846
49833
|
static _instance;
|
|
49847
|
-
constructor() {
|
|
49848
|
-
}
|
|
49834
|
+
constructor() {}
|
|
49849
49835
|
static getInstance() {
|
|
49850
49836
|
if (!this._instance) {
|
|
49851
49837
|
this._instance = new UsageAPI;
|
|
@@ -49905,8 +49891,7 @@ class NoopRunMetadataManager {
|
|
|
49905
49891
|
refresh(requestOptions) {
|
|
49906
49892
|
throw new Error("Method not implemented.");
|
|
49907
49893
|
}
|
|
49908
|
-
enterWithMetadata(metadata) {
|
|
49909
|
-
}
|
|
49894
|
+
enterWithMetadata(metadata) {}
|
|
49910
49895
|
current() {
|
|
49911
49896
|
throw new Error("Method not implemented.");
|
|
49912
49897
|
}
|
|
@@ -49962,8 +49947,7 @@ var NOOP_MANAGER = new NoopRunMetadataManager;
|
|
|
49962
49947
|
|
|
49963
49948
|
class RunMetadataAPI {
|
|
49964
49949
|
static _instance;
|
|
49965
|
-
constructor() {
|
|
49966
|
-
}
|
|
49950
|
+
constructor() {}
|
|
49967
49951
|
static getInstance() {
|
|
49968
49952
|
if (!this._instance) {
|
|
49969
49953
|
this._instance = new RunMetadataAPI;
|
|
@@ -50048,8 +50032,7 @@ var NOOP_TIMEOUT_MANAGER = new NoopTimeoutManager;
|
|
|
50048
50032
|
|
|
50049
50033
|
class TimeoutAPI {
|
|
50050
50034
|
static _instance;
|
|
50051
|
-
constructor() {
|
|
50052
|
-
}
|
|
50035
|
+
constructor() {}
|
|
50053
50036
|
static getInstance() {
|
|
50054
50037
|
if (!this._instance) {
|
|
50055
50038
|
this._instance = new TimeoutAPI;
|
|
@@ -50455,8 +50438,7 @@ function getTokenPayload(e2) {
|
|
|
50455
50438
|
return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
|
|
50456
50439
|
}).join(""));
|
|
50457
50440
|
return JSON.parse(t2) || {};
|
|
50458
|
-
} catch (e3) {
|
|
50459
|
-
}
|
|
50441
|
+
} catch (e3) {}
|
|
50460
50442
|
return {};
|
|
50461
50443
|
}
|
|
50462
50444
|
function isTokenExpired(e2, t2 = 0) {
|
|
@@ -50510,8 +50492,7 @@ class BaseAuthStore {
|
|
|
50510
50492
|
let n = {};
|
|
50511
50493
|
try {
|
|
50512
50494
|
n = JSON.parse(s2), (typeof n === null || typeof n != "object" || Array.isArray(n)) && (n = {});
|
|
50513
|
-
} catch (e3) {
|
|
50514
|
-
}
|
|
50495
|
+
} catch (e3) {}
|
|
50515
50496
|
this.save(n.token || "", n.record || n.model || null);
|
|
50516
50497
|
}
|
|
50517
50498
|
exportToCookie(e2, t2 = i) {
|
|
@@ -50658,8 +50639,7 @@ class RealtimeService extends BaseService {
|
|
|
50658
50639
|
let i3;
|
|
50659
50640
|
try {
|
|
50660
50641
|
i3 = JSON.parse(s3?.data);
|
|
50661
|
-
} catch {
|
|
50662
|
-
}
|
|
50642
|
+
} catch {}
|
|
50663
50643
|
t2(i3 || {});
|
|
50664
50644
|
};
|
|
50665
50645
|
return this.subscriptions[i2] || (this.subscriptions[i2] = []), this.subscriptions[i2].push(listener), this.isConnected ? this.subscriptions[i2].length === 1 ? await this.submitSubscriptions() : this.eventSource?.addEventListener(i2, listener) : await this.connect(), async () => this.unsubscribeByTopicAndListener(e2, listener);
|
|
@@ -51372,8 +51352,7 @@ class Client {
|
|
|
51372
51352
|
let s3 = {};
|
|
51373
51353
|
try {
|
|
51374
51354
|
s3 = await e3.json();
|
|
51375
|
-
} catch (e4) {
|
|
51376
|
-
}
|
|
51355
|
+
} catch (e4) {}
|
|
51377
51356
|
if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400)
|
|
51378
51357
|
throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
|
|
51379
51358
|
return s3;
|
|
@@ -51559,6 +51538,26 @@ class AppDatabase {
|
|
|
51559
51538
|
});
|
|
51560
51539
|
}
|
|
51561
51540
|
}
|
|
51541
|
+
async changeUserPassword(payload) {
|
|
51542
|
+
const { password } = payload;
|
|
51543
|
+
const credentials = await this.getUserCredentials();
|
|
51544
|
+
if (credentials) {
|
|
51545
|
+
const encryptedCredentials = encryptObject(credentials, password);
|
|
51546
|
+
if (this.salt && this.email) {
|
|
51547
|
+
const user = await this.getUserByEmail();
|
|
51548
|
+
const encryptedPassword = encryptObject(password, this.salt);
|
|
51549
|
+
await this.pb.collection("users").update(user.id, {
|
|
51550
|
+
settings: {
|
|
51551
|
+
...user.settings,
|
|
51552
|
+
password: encryptedPassword,
|
|
51553
|
+
credentials: encryptedCredentials
|
|
51554
|
+
}
|
|
51555
|
+
});
|
|
51556
|
+
return true;
|
|
51557
|
+
}
|
|
51558
|
+
}
|
|
51559
|
+
return false;
|
|
51560
|
+
}
|
|
51562
51561
|
async addNewCredential(params) {
|
|
51563
51562
|
const { password, payload } = params;
|
|
51564
51563
|
let credentials = await this.getCredentials({ password });
|
|
@@ -52850,8 +52849,7 @@ class Signal {
|
|
|
52850
52849
|
support: kind === "long" ? _stop_loss : this.support
|
|
52851
52850
|
};
|
|
52852
52851
|
const instance = new Signal(derivedConfig);
|
|
52853
|
-
if (kind === "short") {
|
|
52854
|
-
}
|
|
52852
|
+
if (kind === "short") {}
|
|
52855
52853
|
let result = instance.get_bulk_trade_zones({ current_price, kind });
|
|
52856
52854
|
return result;
|
|
52857
52855
|
return result?.filter((x) => {
|
|
@@ -53069,8 +53067,7 @@ class Signal {
|
|
|
53069
53067
|
kind = "long",
|
|
53070
53068
|
raw
|
|
53071
53069
|
}) {
|
|
53072
|
-
if (raw) {
|
|
53073
|
-
}
|
|
53070
|
+
if (raw) {}
|
|
53074
53071
|
const margin_range = this.get_margin_range(current_price, kind);
|
|
53075
53072
|
let margin_zones = this.get_margin_zones({ current_price });
|
|
53076
53073
|
let remaining_zones = margin_zones.filter((x) => JSON.stringify(x) != JSON.stringify(margin_range));
|
|
@@ -53281,8 +53278,7 @@ class Signal {
|
|
|
53281
53278
|
return true;
|
|
53282
53279
|
});
|
|
53283
53280
|
let total_orders = limit_trades.concat(market_trades);
|
|
53284
|
-
if (kind === "short") {
|
|
53285
|
-
}
|
|
53281
|
+
if (kind === "short") {}
|
|
53286
53282
|
if (this.minimum_size && total_orders.length > 0) {
|
|
53287
53283
|
let payload = total_orders;
|
|
53288
53284
|
let greater_than_min_size = total_orders.filter((o) => o ? o.quantity >= this.minimum_size : true);
|
|
@@ -53368,8 +53364,7 @@ class Signal {
|
|
|
53368
53364
|
});
|
|
53369
53365
|
const multiplier = start - index;
|
|
53370
53366
|
const incurred_fees = fees.reduce((a, b) => a + b, 0) + previous_risks.reduce((a, b) => a + b, 0);
|
|
53371
|
-
if (index === 0) {
|
|
53372
|
-
}
|
|
53367
|
+
if (index === 0) {}
|
|
53373
53368
|
let quantity = determine_position_size2({
|
|
53374
53369
|
entry,
|
|
53375
53370
|
stop,
|
|
@@ -53467,8 +53462,7 @@ function buildConfig(app_config, {
|
|
|
53467
53462
|
return [];
|
|
53468
53463
|
}
|
|
53469
53464
|
const condition = (kind === "long" ? entry > app_config.support : entry >= app_config.support) && stop >= app_config.support * 0.999;
|
|
53470
|
-
if (kind === "short") {
|
|
53471
|
-
}
|
|
53465
|
+
if (kind === "short") {}
|
|
53472
53466
|
const result = entry === stop ? [] : condition ? instance.build_entry({
|
|
53473
53467
|
current_price: entry,
|
|
53474
53468
|
stop_loss: stop,
|
|
@@ -55098,6 +55092,7 @@ class BaseExchange {
|
|
|
55098
55092
|
}
|
|
55099
55093
|
|
|
55100
55094
|
// src/exchanges/binance.ts
|
|
55095
|
+
var import_p_limit = __toESM(require_p_limit());
|
|
55101
55096
|
var CONSTANTS = {
|
|
55102
55097
|
SPOT_TO_FIAT: "MAIN_C2C",
|
|
55103
55098
|
SPOT_TO_USDT_FUTURE: "MAIN_UMFUTURE",
|
|
@@ -55325,13 +55320,16 @@ async function initClient(credentials, options) {
|
|
|
55325
55320
|
console.log(e2);
|
|
55326
55321
|
}
|
|
55327
55322
|
}
|
|
55328
|
-
|
|
55323
|
+
var ORDERS_PER_MINUTE = 2000;
|
|
55324
|
+
var ORDERS_PER_SECOND = Math.floor(ORDERS_PER_MINUTE / 60);
|
|
55325
|
+
var BATCH_SIZE = 5;
|
|
55326
|
+
var CANCEL_BATCH_SIZE = 10;
|
|
55327
|
+
async function createLimitPurchaseOrdersParallel(client, symbol, priceFormat, quantityFormat, orders, currentPrice, workingType = "last", realClose = false) {
|
|
55329
55328
|
const workingTypeValue = workingType === "mark" ? "MARK_PRICE" : "CONTRACT_PRICE";
|
|
55330
55329
|
const splitOrders = (inputOrders) => {
|
|
55331
55330
|
const result = [];
|
|
55332
55331
|
for (const o of inputOrders) {
|
|
55333
|
-
if (o.take_profit) {
|
|
55334
|
-
}
|
|
55332
|
+
if (o.take_profit) {}
|
|
55335
55333
|
if (o.stop && !o.side) {
|
|
55336
55334
|
result.push({
|
|
55337
55335
|
price: o.price,
|
|
@@ -55377,30 +55375,38 @@ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFo
|
|
|
55377
55375
|
const remaining = orders.filter((x) => x.stop !== true);
|
|
55378
55376
|
const breakOrders = splitOrders(toSplit);
|
|
55379
55377
|
const newOrders = [...breakOrders, ...remaining].map(createOrder);
|
|
55380
|
-
|
|
55381
|
-
for (let i2 = 0;i2 < newOrders.length; i2 +=
|
|
55382
|
-
|
|
55383
|
-
const _res = await client.submitMultipleOrders(batch2.map((k) => {
|
|
55384
|
-
let payload = {
|
|
55385
|
-
symbol: k.symbol,
|
|
55386
|
-
side: k.side,
|
|
55387
|
-
positionSide: k.positionSide,
|
|
55388
|
-
type: k.type,
|
|
55389
|
-
timeInForce: k.timeInForce,
|
|
55390
|
-
quantity: k.quantity?.toString(),
|
|
55391
|
-
price: k.price?.toString(),
|
|
55392
|
-
workingType: k.workingType
|
|
55393
|
-
};
|
|
55394
|
-
if (k.stopPrice) {
|
|
55395
|
-
payload.stopPrice = k.stopPrice.toString();
|
|
55396
|
-
}
|
|
55397
|
-
return payload;
|
|
55398
|
-
}));
|
|
55399
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
55400
|
-
console.log(_res);
|
|
55401
|
-
res.push(_res);
|
|
55378
|
+
const batches = [];
|
|
55379
|
+
for (let i2 = 0;i2 < newOrders.length; i2 += BATCH_SIZE) {
|
|
55380
|
+
batches.push(newOrders.slice(i2, i2 + BATCH_SIZE));
|
|
55402
55381
|
}
|
|
55403
|
-
|
|
55382
|
+
const limit = import_p_limit.default(ORDERS_PER_SECOND);
|
|
55383
|
+
const results = await Promise.all(batches.map((batch2) => limit(async () => {
|
|
55384
|
+
try {
|
|
55385
|
+
const payload = batch2.map((k) => {
|
|
55386
|
+
let orderPayload = {
|
|
55387
|
+
symbol: k.symbol,
|
|
55388
|
+
side: k.side,
|
|
55389
|
+
positionSide: k.positionSide,
|
|
55390
|
+
type: k.type,
|
|
55391
|
+
timeInForce: k.timeInForce,
|
|
55392
|
+
quantity: k.quantity?.toString(),
|
|
55393
|
+
price: k.price?.toString(),
|
|
55394
|
+
workingType: k.workingType
|
|
55395
|
+
};
|
|
55396
|
+
if (k.stopPrice) {
|
|
55397
|
+
orderPayload.stopPrice = k.stopPrice.toString();
|
|
55398
|
+
}
|
|
55399
|
+
return orderPayload;
|
|
55400
|
+
});
|
|
55401
|
+
const result = await client.submitMultipleOrders(payload);
|
|
55402
|
+
console.log("Batch result:", result);
|
|
55403
|
+
return result;
|
|
55404
|
+
} catch (error) {
|
|
55405
|
+
console.error("Error processing batch:", error);
|
|
55406
|
+
throw error;
|
|
55407
|
+
}
|
|
55408
|
+
})));
|
|
55409
|
+
return results;
|
|
55404
55410
|
}
|
|
55405
55411
|
async function getPositionInfo(client, symbol) {
|
|
55406
55412
|
const response = await client.getPositionsV3({
|
|
@@ -55426,6 +55432,11 @@ async function getPositionInfo(client, symbol) {
|
|
|
55426
55432
|
return { long, short };
|
|
55427
55433
|
}
|
|
55428
55434
|
async function cancelOrders(payload) {
|
|
55435
|
+
return await cancelOrdersParallel({
|
|
55436
|
+
symbol: payload.symbol,
|
|
55437
|
+
orders: payload.orders,
|
|
55438
|
+
custom_client: payload.custom_client
|
|
55439
|
+
});
|
|
55429
55440
|
const client = payload.custom_client;
|
|
55430
55441
|
for (let i2 = 0;i2 < payload.orders.length; i2 += 10) {
|
|
55431
55442
|
const batch2 = payload.orders.slice(i2, i2 + 10);
|
|
@@ -55464,7 +55475,7 @@ async function placeLimitOrders(client, payload) {
|
|
|
55464
55475
|
quantity: x.quantity,
|
|
55465
55476
|
kind: payload.kind
|
|
55466
55477
|
}));
|
|
55467
|
-
return await
|
|
55478
|
+
return await createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, orders);
|
|
55468
55479
|
}
|
|
55469
55480
|
}
|
|
55470
55481
|
async function placeTpOrder(client, payload) {
|
|
@@ -55492,7 +55503,7 @@ async function placeTpOrder(client, payload) {
|
|
|
55492
55503
|
price: payload.tp,
|
|
55493
55504
|
quantity: _quantity
|
|
55494
55505
|
};
|
|
55495
|
-
const rr = await
|
|
55506
|
+
const rr = await createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
|
|
55496
55507
|
if (payload.kind == "long") {
|
|
55497
55508
|
console.log("rr", { rr, price_places, decimal_places });
|
|
55498
55509
|
}
|
|
@@ -55538,7 +55549,7 @@ async function placeStopOrder(client, payload) {
|
|
|
55538
55549
|
stop: payload.final_stop,
|
|
55539
55550
|
is_market: !payload.is_limit
|
|
55540
55551
|
};
|
|
55541
|
-
return
|
|
55552
|
+
return createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
|
|
55542
55553
|
}
|
|
55543
55554
|
async function getOpenOrders(client, symbol, type) {
|
|
55544
55555
|
const response = await client.getAllOpenOrders({
|
|
@@ -55898,7 +55909,7 @@ class BinanceExchange extends BaseExchange {
|
|
|
55898
55909
|
return await cancelAllOrders(this.client, symbol, payload);
|
|
55899
55910
|
}
|
|
55900
55911
|
async _createLimitPurchaseOrders(payload) {
|
|
55901
|
-
return await
|
|
55912
|
+
return await createLimitPurchaseOrdersParallel(this.client, payload.symbol, payload.price_places, payload.decimal_places, payload.orders);
|
|
55902
55913
|
}
|
|
55903
55914
|
async analyzeCharts(payload) {
|
|
55904
55915
|
return await analyzeCharts({
|
|
@@ -56122,7 +56133,7 @@ async function forceClosePosition(client, symbol, options) {
|
|
|
56122
56133
|
force_market: true
|
|
56123
56134
|
};
|
|
56124
56135
|
console.log(`Closing ${position2.kind} position for ${symbol}: ${position2.size} units`);
|
|
56125
|
-
const orderResult = await
|
|
56136
|
+
const orderResult = await createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
|
|
56126
56137
|
result.closedPositions.push({
|
|
56127
56138
|
kind: position2.kind,
|
|
56128
56139
|
quantity: position2.size,
|
|
@@ -56159,6 +56170,28 @@ async function forceClosePosition(client, symbol, options) {
|
|
|
56159
56170
|
}
|
|
56160
56171
|
return result;
|
|
56161
56172
|
}
|
|
56173
|
+
async function cancelOrdersParallel(payload) {
|
|
56174
|
+
const client = payload.custom_client;
|
|
56175
|
+
const batches = [];
|
|
56176
|
+
for (let i2 = 0;i2 < payload.orders.length; i2 += CANCEL_BATCH_SIZE) {
|
|
56177
|
+
batches.push(payload.orders.slice(i2, i2 + CANCEL_BATCH_SIZE));
|
|
56178
|
+
}
|
|
56179
|
+
const limit = import_p_limit.default(ORDERS_PER_SECOND);
|
|
56180
|
+
const results = await Promise.all(batches.map((batch2) => limit(async () => {
|
|
56181
|
+
try {
|
|
56182
|
+
const result = await Promise.all(batch2.map((x) => client.cancelOrder({
|
|
56183
|
+
symbol: payload.symbol,
|
|
56184
|
+
orderId: x.orderId
|
|
56185
|
+
})));
|
|
56186
|
+
console.log("Cancel batch result:", result);
|
|
56187
|
+
return result;
|
|
56188
|
+
} catch (error) {
|
|
56189
|
+
console.error("Error processing cancel batch:", error);
|
|
56190
|
+
throw error;
|
|
56191
|
+
}
|
|
56192
|
+
})));
|
|
56193
|
+
return results;
|
|
56194
|
+
}
|
|
56162
56195
|
|
|
56163
56196
|
// src/exchanges/bybit.ts
|
|
56164
56197
|
var import_bybit_api = __toESM(require_lib3());
|
|
@@ -56184,13 +56217,12 @@ function titleCase(str) {
|
|
|
56184
56217
|
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
56185
56218
|
}).join(" ");
|
|
56186
56219
|
}
|
|
56187
|
-
async function
|
|
56220
|
+
async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFormat, orders, currentPrice, workingType = "last", realClose = false) {
|
|
56188
56221
|
const workingTypeValue = workingType === "mark" ? "MarkPrice" : "LastPrice";
|
|
56189
56222
|
const splitOrders = (inputOrders) => {
|
|
56190
56223
|
const result = [];
|
|
56191
56224
|
for (const o of inputOrders) {
|
|
56192
|
-
if (o.take_profit) {
|
|
56193
|
-
}
|
|
56225
|
+
if (o.take_profit) {}
|
|
56194
56226
|
if (o.stop && !o.side) {
|
|
56195
56227
|
result.push({
|
|
56196
56228
|
price: o.price,
|
|
@@ -56306,7 +56338,7 @@ async function placeLimitOrders2(client, payload) {
|
|
|
56306
56338
|
quantity: x.quantity,
|
|
56307
56339
|
kind: payload.kind
|
|
56308
56340
|
}));
|
|
56309
|
-
return await
|
|
56341
|
+
return await createLimitPurchaseOrders(client, symbol, price_places, decimal_places, orders);
|
|
56310
56342
|
}
|
|
56311
56343
|
}
|
|
56312
56344
|
async function placeTpOrder2(client, payload) {
|
|
@@ -56335,7 +56367,7 @@ async function placeTpOrder2(client, payload) {
|
|
|
56335
56367
|
price: payload.tp,
|
|
56336
56368
|
quantity: _quantity
|
|
56337
56369
|
};
|
|
56338
|
-
return
|
|
56370
|
+
return createLimitPurchaseOrders(client, symbol, price_places, decimal_places, [order]);
|
|
56339
56371
|
}
|
|
56340
56372
|
return { error: "No quantity" };
|
|
56341
56373
|
}
|
|
@@ -56356,7 +56388,7 @@ async function placeStopOrder2(client, payload) {
|
|
|
56356
56388
|
stop: payload.final_stop,
|
|
56357
56389
|
is_market: !payload.is_limit
|
|
56358
56390
|
};
|
|
56359
|
-
return
|
|
56391
|
+
return createLimitPurchaseOrders(client, symbol, price_places, decimal_places, [order]);
|
|
56360
56392
|
}
|
|
56361
56393
|
async function getOpenOrders2(client, symbol, type) {
|
|
56362
56394
|
const response = await client.getActiveOrders({
|
|
@@ -56685,7 +56717,7 @@ class BybitExchange extends BaseExchange {
|
|
|
56685
56717
|
return await cancelAllOrders2(this.client, symbol, payload);
|
|
56686
56718
|
}
|
|
56687
56719
|
async _createLimitPurchaseOrders(payload) {
|
|
56688
|
-
return await
|
|
56720
|
+
return await createLimitPurchaseOrders(this.client, payload.symbol, payload.price_places, payload.decimal_places, payload.orders);
|
|
56689
56721
|
}
|
|
56690
56722
|
async getCurrentPrice(symbol) {
|
|
56691
56723
|
return await getCurrentPrice2(this.client, symbol);
|
|
@@ -56732,10 +56764,8 @@ class BybitExchange extends BaseExchange {
|
|
|
56732
56764
|
sellLeverage: payload.leverage.toString()
|
|
56733
56765
|
});
|
|
56734
56766
|
}
|
|
56735
|
-
async generateConfig(payload) {
|
|
56736
|
-
}
|
|
56737
|
-
async checkDelistedMovers(payload) {
|
|
56738
|
-
}
|
|
56767
|
+
async generateConfig(payload) {}
|
|
56768
|
+
async checkDelistedMovers(payload) {}
|
|
56739
56769
|
async getAllOpenOrders() {
|
|
56740
56770
|
const result = await getAllOpenOrders2({ client: this.client });
|
|
56741
56771
|
return result;
|
|
@@ -56746,13 +56776,11 @@ class BybitExchange extends BaseExchange {
|
|
|
56746
56776
|
async getDelistedSpotSymbols() {
|
|
56747
56777
|
return [];
|
|
56748
56778
|
}
|
|
56749
|
-
async crossAccountTransfer(payload) {
|
|
56750
|
-
}
|
|
56779
|
+
async crossAccountTransfer(payload) {}
|
|
56751
56780
|
getOpenOrders(payload) {
|
|
56752
56781
|
return getOpenOrders2(this.client, payload.symbol);
|
|
56753
56782
|
}
|
|
56754
|
-
async placeBadStopEntry(payload) {
|
|
56755
|
-
}
|
|
56783
|
+
async placeBadStopEntry(payload) {}
|
|
56756
56784
|
}
|
|
56757
56785
|
|
|
56758
56786
|
// src/helpers/accounts.ts
|
|
@@ -57706,8 +57734,7 @@ class ExchangeAccount {
|
|
|
57706
57734
|
cancelExchangeOrders: this.cancelExchangeOrders.bind(this)
|
|
57707
57735
|
});
|
|
57708
57736
|
}
|
|
57709
|
-
if (all) {
|
|
57710
|
-
} else {
|
|
57737
|
+
if (all) {} else {
|
|
57711
57738
|
if (!price) {
|
|
57712
57739
|
const position2 = await this.syncAccount({
|
|
57713
57740
|
symbol,
|