@factiii/runner 0.44.0 → 0.45.0
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/cli.js +2031 -1141
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -3779,10 +3779,10 @@ var require_packer_sync = __commonJS({
|
|
|
3779
3779
|
var require_png_sync = __commonJS({
|
|
3780
3780
|
"../../node_modules/qrcode/node_modules/pngjs/lib/png-sync.js"(exports2) {
|
|
3781
3781
|
"use strict";
|
|
3782
|
-
var
|
|
3782
|
+
var parse7 = require_parser_sync();
|
|
3783
3783
|
var pack = require_packer_sync();
|
|
3784
3784
|
exports2.read = function(buffer, options) {
|
|
3785
|
-
return
|
|
3785
|
+
return parse7(buffer, options || {});
|
|
3786
3786
|
};
|
|
3787
3787
|
exports2.write = function(png, options) {
|
|
3788
3788
|
return pack(png, options);
|
|
@@ -5056,7 +5056,7 @@ var require_ms = __commonJS({
|
|
|
5056
5056
|
options = options || {};
|
|
5057
5057
|
var type = typeof val;
|
|
5058
5058
|
if (type === "string" && val.length > 0) {
|
|
5059
|
-
return
|
|
5059
|
+
return parse7(val);
|
|
5060
5060
|
} else if (type === "number" && isFinite(val)) {
|
|
5061
5061
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
5062
5062
|
}
|
|
@@ -5064,7 +5064,7 @@ var require_ms = __commonJS({
|
|
|
5064
5064
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
5065
5065
|
);
|
|
5066
5066
|
};
|
|
5067
|
-
function
|
|
5067
|
+
function parse7(str5) {
|
|
5068
5068
|
str5 = String(str5);
|
|
5069
5069
|
if (str5.length > 100) {
|
|
5070
5070
|
return;
|
|
@@ -7886,7 +7886,7 @@ var require_extension = __commonJS({
|
|
|
7886
7886
|
if (dest[name] === void 0) dest[name] = [elem];
|
|
7887
7887
|
else dest[name].push(elem);
|
|
7888
7888
|
}
|
|
7889
|
-
function
|
|
7889
|
+
function parse7(header2) {
|
|
7890
7890
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
7891
7891
|
let params = /* @__PURE__ */ Object.create(null);
|
|
7892
7892
|
let mustUnescape = false;
|
|
@@ -8026,7 +8026,7 @@ var require_extension = __commonJS({
|
|
|
8026
8026
|
}).join(", ");
|
|
8027
8027
|
}).join(", ");
|
|
8028
8028
|
}
|
|
8029
|
-
module2.exports = { format, parse:
|
|
8029
|
+
module2.exports = { format, parse: parse7 };
|
|
8030
8030
|
}
|
|
8031
8031
|
});
|
|
8032
8032
|
|
|
@@ -8060,7 +8060,7 @@ var require_websocket = __commonJS({
|
|
|
8060
8060
|
var {
|
|
8061
8061
|
EventTarget: { addEventListener: addEventListener2, removeEventListener: removeEventListener2 }
|
|
8062
8062
|
} = require_event_target();
|
|
8063
|
-
var { format, parse:
|
|
8063
|
+
var { format, parse: parse7 } = require_extension();
|
|
8064
8064
|
var { toBuffer: toBuffer2 } = require_buffer_util();
|
|
8065
8065
|
var kAborted = Symbol("kAborted");
|
|
8066
8066
|
var protocolVersions = [8, 13];
|
|
@@ -8737,7 +8737,7 @@ var require_websocket = __commonJS({
|
|
|
8737
8737
|
}
|
|
8738
8738
|
let extensions;
|
|
8739
8739
|
try {
|
|
8740
|
-
extensions =
|
|
8740
|
+
extensions = parse7(secWebSocketExtensions);
|
|
8741
8741
|
} catch (err2) {
|
|
8742
8742
|
const message3 = "Invalid Sec-WebSocket-Extensions header";
|
|
8743
8743
|
abortHandshake(websocket, socket, message3);
|
|
@@ -9029,7 +9029,7 @@ var require_subprotocol = __commonJS({
|
|
|
9029
9029
|
"../../node_modules/ws/lib/subprotocol.js"(exports2, module2) {
|
|
9030
9030
|
"use strict";
|
|
9031
9031
|
var { tokenChars } = require_validation();
|
|
9032
|
-
function
|
|
9032
|
+
function parse7(header2) {
|
|
9033
9033
|
const protocols = /* @__PURE__ */ new Set();
|
|
9034
9034
|
let start = -1;
|
|
9035
9035
|
let end = -1;
|
|
@@ -9065,7 +9065,7 @@ var require_subprotocol = __commonJS({
|
|
|
9065
9065
|
protocols.add(protocol4);
|
|
9066
9066
|
return protocols;
|
|
9067
9067
|
}
|
|
9068
|
-
module2.exports = { parse:
|
|
9068
|
+
module2.exports = { parse: parse7 };
|
|
9069
9069
|
}
|
|
9070
9070
|
});
|
|
9071
9071
|
|
|
@@ -9470,6 +9470,1338 @@ var require_websocket_server = __commonJS({
|
|
|
9470
9470
|
}
|
|
9471
9471
|
});
|
|
9472
9472
|
|
|
9473
|
+
// ../../node_modules/superjson/dist/double-indexed-kv.js
|
|
9474
|
+
var require_double_indexed_kv = __commonJS({
|
|
9475
|
+
"../../node_modules/superjson/dist/double-indexed-kv.js"(exports2) {
|
|
9476
|
+
"use strict";
|
|
9477
|
+
exports2.__esModule = true;
|
|
9478
|
+
exports2.DoubleIndexedKV = void 0;
|
|
9479
|
+
var DoubleIndexedKV = (
|
|
9480
|
+
/** @class */
|
|
9481
|
+
(function() {
|
|
9482
|
+
function DoubleIndexedKV2() {
|
|
9483
|
+
this.keyToValue = /* @__PURE__ */ new Map();
|
|
9484
|
+
this.valueToKey = /* @__PURE__ */ new Map();
|
|
9485
|
+
}
|
|
9486
|
+
DoubleIndexedKV2.prototype.set = function(key, value2) {
|
|
9487
|
+
this.keyToValue.set(key, value2);
|
|
9488
|
+
this.valueToKey.set(value2, key);
|
|
9489
|
+
};
|
|
9490
|
+
DoubleIndexedKV2.prototype.getByKey = function(key) {
|
|
9491
|
+
return this.keyToValue.get(key);
|
|
9492
|
+
};
|
|
9493
|
+
DoubleIndexedKV2.prototype.getByValue = function(value2) {
|
|
9494
|
+
return this.valueToKey.get(value2);
|
|
9495
|
+
};
|
|
9496
|
+
DoubleIndexedKV2.prototype.clear = function() {
|
|
9497
|
+
this.keyToValue.clear();
|
|
9498
|
+
this.valueToKey.clear();
|
|
9499
|
+
};
|
|
9500
|
+
return DoubleIndexedKV2;
|
|
9501
|
+
})()
|
|
9502
|
+
);
|
|
9503
|
+
exports2.DoubleIndexedKV = DoubleIndexedKV;
|
|
9504
|
+
}
|
|
9505
|
+
});
|
|
9506
|
+
|
|
9507
|
+
// ../../node_modules/superjson/dist/registry.js
|
|
9508
|
+
var require_registry = __commonJS({
|
|
9509
|
+
"../../node_modules/superjson/dist/registry.js"(exports2) {
|
|
9510
|
+
"use strict";
|
|
9511
|
+
exports2.__esModule = true;
|
|
9512
|
+
exports2.Registry = void 0;
|
|
9513
|
+
var double_indexed_kv_1 = require_double_indexed_kv();
|
|
9514
|
+
var Registry = (
|
|
9515
|
+
/** @class */
|
|
9516
|
+
(function() {
|
|
9517
|
+
function Registry2(generateIdentifier) {
|
|
9518
|
+
this.generateIdentifier = generateIdentifier;
|
|
9519
|
+
this.kv = new double_indexed_kv_1.DoubleIndexedKV();
|
|
9520
|
+
}
|
|
9521
|
+
Registry2.prototype.register = function(value2, identifier) {
|
|
9522
|
+
if (this.kv.getByValue(value2)) {
|
|
9523
|
+
return;
|
|
9524
|
+
}
|
|
9525
|
+
if (!identifier) {
|
|
9526
|
+
identifier = this.generateIdentifier(value2);
|
|
9527
|
+
}
|
|
9528
|
+
this.kv.set(identifier, value2);
|
|
9529
|
+
};
|
|
9530
|
+
Registry2.prototype.clear = function() {
|
|
9531
|
+
this.kv.clear();
|
|
9532
|
+
};
|
|
9533
|
+
Registry2.prototype.getIdentifier = function(value2) {
|
|
9534
|
+
return this.kv.getByValue(value2);
|
|
9535
|
+
};
|
|
9536
|
+
Registry2.prototype.getValue = function(identifier) {
|
|
9537
|
+
return this.kv.getByKey(identifier);
|
|
9538
|
+
};
|
|
9539
|
+
return Registry2;
|
|
9540
|
+
})()
|
|
9541
|
+
);
|
|
9542
|
+
exports2.Registry = Registry;
|
|
9543
|
+
}
|
|
9544
|
+
});
|
|
9545
|
+
|
|
9546
|
+
// ../../node_modules/superjson/dist/class-registry.js
|
|
9547
|
+
var require_class_registry = __commonJS({
|
|
9548
|
+
"../../node_modules/superjson/dist/class-registry.js"(exports2) {
|
|
9549
|
+
"use strict";
|
|
9550
|
+
var __extends = exports2 && exports2.__extends || /* @__PURE__ */ (function() {
|
|
9551
|
+
var extendStatics = function(d, b) {
|
|
9552
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
9553
|
+
d2.__proto__ = b2;
|
|
9554
|
+
} || function(d2, b2) {
|
|
9555
|
+
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
|
|
9556
|
+
};
|
|
9557
|
+
return extendStatics(d, b);
|
|
9558
|
+
};
|
|
9559
|
+
return function(d, b) {
|
|
9560
|
+
if (typeof b !== "function" && b !== null)
|
|
9561
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9562
|
+
extendStatics(d, b);
|
|
9563
|
+
function __() {
|
|
9564
|
+
this.constructor = d;
|
|
9565
|
+
}
|
|
9566
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
9567
|
+
};
|
|
9568
|
+
})();
|
|
9569
|
+
exports2.__esModule = true;
|
|
9570
|
+
exports2.ClassRegistry = void 0;
|
|
9571
|
+
var registry_1 = require_registry();
|
|
9572
|
+
var ClassRegistry = (
|
|
9573
|
+
/** @class */
|
|
9574
|
+
(function(_super) {
|
|
9575
|
+
__extends(ClassRegistry2, _super);
|
|
9576
|
+
function ClassRegistry2() {
|
|
9577
|
+
var _this = _super.call(this, function(c) {
|
|
9578
|
+
return c.name;
|
|
9579
|
+
}) || this;
|
|
9580
|
+
_this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
9581
|
+
return _this;
|
|
9582
|
+
}
|
|
9583
|
+
ClassRegistry2.prototype.register = function(value2, options) {
|
|
9584
|
+
if (typeof options === "object") {
|
|
9585
|
+
if (options.allowProps) {
|
|
9586
|
+
this.classToAllowedProps.set(value2, options.allowProps);
|
|
9587
|
+
}
|
|
9588
|
+
_super.prototype.register.call(this, value2, options.identifier);
|
|
9589
|
+
} else {
|
|
9590
|
+
_super.prototype.register.call(this, value2, options);
|
|
9591
|
+
}
|
|
9592
|
+
};
|
|
9593
|
+
ClassRegistry2.prototype.getAllowedProps = function(value2) {
|
|
9594
|
+
return this.classToAllowedProps.get(value2);
|
|
9595
|
+
};
|
|
9596
|
+
return ClassRegistry2;
|
|
9597
|
+
})(registry_1.Registry)
|
|
9598
|
+
);
|
|
9599
|
+
exports2.ClassRegistry = ClassRegistry;
|
|
9600
|
+
}
|
|
9601
|
+
});
|
|
9602
|
+
|
|
9603
|
+
// ../../node_modules/superjson/dist/util.js
|
|
9604
|
+
var require_util = __commonJS({
|
|
9605
|
+
"../../node_modules/superjson/dist/util.js"(exports2) {
|
|
9606
|
+
"use strict";
|
|
9607
|
+
var __read = exports2 && exports2.__read || function(o, n) {
|
|
9608
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
9609
|
+
if (!m) return o;
|
|
9610
|
+
var i = m.call(o), r, ar = [], e;
|
|
9611
|
+
try {
|
|
9612
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
9613
|
+
} catch (error62) {
|
|
9614
|
+
e = { error: error62 };
|
|
9615
|
+
} finally {
|
|
9616
|
+
try {
|
|
9617
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
9618
|
+
} finally {
|
|
9619
|
+
if (e) throw e.error;
|
|
9620
|
+
}
|
|
9621
|
+
}
|
|
9622
|
+
return ar;
|
|
9623
|
+
};
|
|
9624
|
+
exports2.__esModule = true;
|
|
9625
|
+
exports2.findArr = exports2.includes = exports2.forEach = exports2.find = void 0;
|
|
9626
|
+
function valuesOfObj(record2) {
|
|
9627
|
+
if ("values" in Object) {
|
|
9628
|
+
return Object.values(record2);
|
|
9629
|
+
}
|
|
9630
|
+
var values = [];
|
|
9631
|
+
for (var key in record2) {
|
|
9632
|
+
if (record2.hasOwnProperty(key)) {
|
|
9633
|
+
values.push(record2[key]);
|
|
9634
|
+
}
|
|
9635
|
+
}
|
|
9636
|
+
return values;
|
|
9637
|
+
}
|
|
9638
|
+
function find(record2, predicate) {
|
|
9639
|
+
var values = valuesOfObj(record2);
|
|
9640
|
+
if ("find" in values) {
|
|
9641
|
+
return values.find(predicate);
|
|
9642
|
+
}
|
|
9643
|
+
var valuesNotNever = values;
|
|
9644
|
+
for (var i = 0; i < valuesNotNever.length; i++) {
|
|
9645
|
+
var value2 = valuesNotNever[i];
|
|
9646
|
+
if (predicate(value2)) {
|
|
9647
|
+
return value2;
|
|
9648
|
+
}
|
|
9649
|
+
}
|
|
9650
|
+
return void 0;
|
|
9651
|
+
}
|
|
9652
|
+
exports2.find = find;
|
|
9653
|
+
function forEach(record2, run8) {
|
|
9654
|
+
Object.entries(record2).forEach(function(_a3) {
|
|
9655
|
+
var _b = __read(_a3, 2), key = _b[0], value2 = _b[1];
|
|
9656
|
+
return run8(value2, key);
|
|
9657
|
+
});
|
|
9658
|
+
}
|
|
9659
|
+
exports2.forEach = forEach;
|
|
9660
|
+
function includes(arr, value2) {
|
|
9661
|
+
return arr.indexOf(value2) !== -1;
|
|
9662
|
+
}
|
|
9663
|
+
exports2.includes = includes;
|
|
9664
|
+
function findArr(record2, predicate) {
|
|
9665
|
+
for (var i = 0; i < record2.length; i++) {
|
|
9666
|
+
var value2 = record2[i];
|
|
9667
|
+
if (predicate(value2)) {
|
|
9668
|
+
return value2;
|
|
9669
|
+
}
|
|
9670
|
+
}
|
|
9671
|
+
return void 0;
|
|
9672
|
+
}
|
|
9673
|
+
exports2.findArr = findArr;
|
|
9674
|
+
}
|
|
9675
|
+
});
|
|
9676
|
+
|
|
9677
|
+
// ../../node_modules/superjson/dist/custom-transformer-registry.js
|
|
9678
|
+
var require_custom_transformer_registry = __commonJS({
|
|
9679
|
+
"../../node_modules/superjson/dist/custom-transformer-registry.js"(exports2) {
|
|
9680
|
+
"use strict";
|
|
9681
|
+
exports2.__esModule = true;
|
|
9682
|
+
exports2.CustomTransformerRegistry = void 0;
|
|
9683
|
+
var util_1 = require_util();
|
|
9684
|
+
var CustomTransformerRegistry = (
|
|
9685
|
+
/** @class */
|
|
9686
|
+
(function() {
|
|
9687
|
+
function CustomTransformerRegistry2() {
|
|
9688
|
+
this.transfomers = {};
|
|
9689
|
+
}
|
|
9690
|
+
CustomTransformerRegistry2.prototype.register = function(transformer) {
|
|
9691
|
+
this.transfomers[transformer.name] = transformer;
|
|
9692
|
+
};
|
|
9693
|
+
CustomTransformerRegistry2.prototype.findApplicable = function(v) {
|
|
9694
|
+
return util_1.find(this.transfomers, function(transformer) {
|
|
9695
|
+
return transformer.isApplicable(v);
|
|
9696
|
+
});
|
|
9697
|
+
};
|
|
9698
|
+
CustomTransformerRegistry2.prototype.findByName = function(name) {
|
|
9699
|
+
return this.transfomers[name];
|
|
9700
|
+
};
|
|
9701
|
+
return CustomTransformerRegistry2;
|
|
9702
|
+
})()
|
|
9703
|
+
);
|
|
9704
|
+
exports2.CustomTransformerRegistry = CustomTransformerRegistry;
|
|
9705
|
+
}
|
|
9706
|
+
});
|
|
9707
|
+
|
|
9708
|
+
// ../../node_modules/superjson/dist/is.js
|
|
9709
|
+
var require_is = __commonJS({
|
|
9710
|
+
"../../node_modules/superjson/dist/is.js"(exports2) {
|
|
9711
|
+
"use strict";
|
|
9712
|
+
exports2.__esModule = true;
|
|
9713
|
+
exports2.isURL = exports2.isTypedArray = exports2.isInfinite = exports2.isBigint = exports2.isPrimitive = exports2.isNaNValue = exports2.isError = exports2.isDate = exports2.isSymbol = exports2.isSet = exports2.isMap = exports2.isRegExp = exports2.isBoolean = exports2.isNumber = exports2.isString = exports2.isArray = exports2.isEmptyObject = exports2.isPlainObject = exports2.isNull = exports2.isUndefined = void 0;
|
|
9714
|
+
var getType = function(payload) {
|
|
9715
|
+
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
9716
|
+
};
|
|
9717
|
+
var isUndefined = function(payload) {
|
|
9718
|
+
return typeof payload === "undefined";
|
|
9719
|
+
};
|
|
9720
|
+
exports2.isUndefined = isUndefined;
|
|
9721
|
+
var isNull = function(payload) {
|
|
9722
|
+
return payload === null;
|
|
9723
|
+
};
|
|
9724
|
+
exports2.isNull = isNull;
|
|
9725
|
+
var isPlainObject2 = function(payload) {
|
|
9726
|
+
if (typeof payload !== "object" || payload === null)
|
|
9727
|
+
return false;
|
|
9728
|
+
if (payload === Object.prototype)
|
|
9729
|
+
return false;
|
|
9730
|
+
if (Object.getPrototypeOf(payload) === null)
|
|
9731
|
+
return true;
|
|
9732
|
+
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
9733
|
+
};
|
|
9734
|
+
exports2.isPlainObject = isPlainObject2;
|
|
9735
|
+
var isEmptyObject = function(payload) {
|
|
9736
|
+
return exports2.isPlainObject(payload) && Object.keys(payload).length === 0;
|
|
9737
|
+
};
|
|
9738
|
+
exports2.isEmptyObject = isEmptyObject;
|
|
9739
|
+
var isArray = function(payload) {
|
|
9740
|
+
return Array.isArray(payload);
|
|
9741
|
+
};
|
|
9742
|
+
exports2.isArray = isArray;
|
|
9743
|
+
var isString = function(payload) {
|
|
9744
|
+
return typeof payload === "string";
|
|
9745
|
+
};
|
|
9746
|
+
exports2.isString = isString;
|
|
9747
|
+
var isNumber = function(payload) {
|
|
9748
|
+
return typeof payload === "number" && !isNaN(payload);
|
|
9749
|
+
};
|
|
9750
|
+
exports2.isNumber = isNumber;
|
|
9751
|
+
var isBoolean = function(payload) {
|
|
9752
|
+
return typeof payload === "boolean";
|
|
9753
|
+
};
|
|
9754
|
+
exports2.isBoolean = isBoolean;
|
|
9755
|
+
var isRegExp = function(payload) {
|
|
9756
|
+
return payload instanceof RegExp;
|
|
9757
|
+
};
|
|
9758
|
+
exports2.isRegExp = isRegExp;
|
|
9759
|
+
var isMap = function(payload) {
|
|
9760
|
+
return payload instanceof Map;
|
|
9761
|
+
};
|
|
9762
|
+
exports2.isMap = isMap;
|
|
9763
|
+
var isSet = function(payload) {
|
|
9764
|
+
return payload instanceof Set;
|
|
9765
|
+
};
|
|
9766
|
+
exports2.isSet = isSet;
|
|
9767
|
+
var isSymbol = function(payload) {
|
|
9768
|
+
return getType(payload) === "Symbol";
|
|
9769
|
+
};
|
|
9770
|
+
exports2.isSymbol = isSymbol;
|
|
9771
|
+
var isDate = function(payload) {
|
|
9772
|
+
return payload instanceof Date && !isNaN(payload.valueOf());
|
|
9773
|
+
};
|
|
9774
|
+
exports2.isDate = isDate;
|
|
9775
|
+
var isError = function(payload) {
|
|
9776
|
+
return payload instanceof Error;
|
|
9777
|
+
};
|
|
9778
|
+
exports2.isError = isError;
|
|
9779
|
+
var isNaNValue = function(payload) {
|
|
9780
|
+
return typeof payload === "number" && isNaN(payload);
|
|
9781
|
+
};
|
|
9782
|
+
exports2.isNaNValue = isNaNValue;
|
|
9783
|
+
var isPrimitive = function(payload) {
|
|
9784
|
+
return exports2.isBoolean(payload) || exports2.isNull(payload) || exports2.isUndefined(payload) || exports2.isNumber(payload) || exports2.isString(payload) || exports2.isSymbol(payload);
|
|
9785
|
+
};
|
|
9786
|
+
exports2.isPrimitive = isPrimitive;
|
|
9787
|
+
var isBigint = function(payload) {
|
|
9788
|
+
return typeof payload === "bigint";
|
|
9789
|
+
};
|
|
9790
|
+
exports2.isBigint = isBigint;
|
|
9791
|
+
var isInfinite = function(payload) {
|
|
9792
|
+
return payload === Infinity || payload === -Infinity;
|
|
9793
|
+
};
|
|
9794
|
+
exports2.isInfinite = isInfinite;
|
|
9795
|
+
var isTypedArray = function(payload) {
|
|
9796
|
+
return ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
9797
|
+
};
|
|
9798
|
+
exports2.isTypedArray = isTypedArray;
|
|
9799
|
+
var isURL = function(payload) {
|
|
9800
|
+
return payload instanceof URL;
|
|
9801
|
+
};
|
|
9802
|
+
exports2.isURL = isURL;
|
|
9803
|
+
}
|
|
9804
|
+
});
|
|
9805
|
+
|
|
9806
|
+
// ../../node_modules/superjson/dist/pathstringifier.js
|
|
9807
|
+
var require_pathstringifier = __commonJS({
|
|
9808
|
+
"../../node_modules/superjson/dist/pathstringifier.js"(exports2) {
|
|
9809
|
+
"use strict";
|
|
9810
|
+
exports2.__esModule = true;
|
|
9811
|
+
exports2.parsePath = exports2.stringifyPath = exports2.escapeKey = void 0;
|
|
9812
|
+
var escapeKey = function(key) {
|
|
9813
|
+
return key.replace(/\./g, "\\.");
|
|
9814
|
+
};
|
|
9815
|
+
exports2.escapeKey = escapeKey;
|
|
9816
|
+
var stringifyPath = function(path94) {
|
|
9817
|
+
return path94.map(String).map(exports2.escapeKey).join(".");
|
|
9818
|
+
};
|
|
9819
|
+
exports2.stringifyPath = stringifyPath;
|
|
9820
|
+
var parsePath = function(string4) {
|
|
9821
|
+
var result = [];
|
|
9822
|
+
var segment = "";
|
|
9823
|
+
for (var i = 0; i < string4.length; i++) {
|
|
9824
|
+
var char = string4.charAt(i);
|
|
9825
|
+
var isEscapedDot = char === "\\" && string4.charAt(i + 1) === ".";
|
|
9826
|
+
if (isEscapedDot) {
|
|
9827
|
+
segment += ".";
|
|
9828
|
+
i++;
|
|
9829
|
+
continue;
|
|
9830
|
+
}
|
|
9831
|
+
var isEndOfSegment = char === ".";
|
|
9832
|
+
if (isEndOfSegment) {
|
|
9833
|
+
result.push(segment);
|
|
9834
|
+
segment = "";
|
|
9835
|
+
continue;
|
|
9836
|
+
}
|
|
9837
|
+
segment += char;
|
|
9838
|
+
}
|
|
9839
|
+
var lastSegment = segment;
|
|
9840
|
+
result.push(lastSegment);
|
|
9841
|
+
return result;
|
|
9842
|
+
};
|
|
9843
|
+
exports2.parsePath = parsePath;
|
|
9844
|
+
}
|
|
9845
|
+
});
|
|
9846
|
+
|
|
9847
|
+
// ../../node_modules/superjson/dist/transformer.js
|
|
9848
|
+
var require_transformer = __commonJS({
|
|
9849
|
+
"../../node_modules/superjson/dist/transformer.js"(exports2) {
|
|
9850
|
+
"use strict";
|
|
9851
|
+
var __assign = exports2 && exports2.__assign || function() {
|
|
9852
|
+
__assign = Object.assign || function(t) {
|
|
9853
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9854
|
+
s = arguments[i];
|
|
9855
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
9856
|
+
t[p] = s[p];
|
|
9857
|
+
}
|
|
9858
|
+
return t;
|
|
9859
|
+
};
|
|
9860
|
+
return __assign.apply(this, arguments);
|
|
9861
|
+
};
|
|
9862
|
+
var __read = exports2 && exports2.__read || function(o, n) {
|
|
9863
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
9864
|
+
if (!m) return o;
|
|
9865
|
+
var i = m.call(o), r, ar = [], e;
|
|
9866
|
+
try {
|
|
9867
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
9868
|
+
} catch (error62) {
|
|
9869
|
+
e = { error: error62 };
|
|
9870
|
+
} finally {
|
|
9871
|
+
try {
|
|
9872
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
9873
|
+
} finally {
|
|
9874
|
+
if (e) throw e.error;
|
|
9875
|
+
}
|
|
9876
|
+
}
|
|
9877
|
+
return ar;
|
|
9878
|
+
};
|
|
9879
|
+
var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
|
|
9880
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
9881
|
+
to[j] = from[i];
|
|
9882
|
+
return to;
|
|
9883
|
+
};
|
|
9884
|
+
exports2.__esModule = true;
|
|
9885
|
+
exports2.untransformValue = exports2.transformValue = exports2.isInstanceOfRegisteredClass = void 0;
|
|
9886
|
+
var is_1 = require_is();
|
|
9887
|
+
var util_1 = require_util();
|
|
9888
|
+
function simpleTransformation(isApplicable, annotation, transform2, untransform) {
|
|
9889
|
+
return {
|
|
9890
|
+
isApplicable,
|
|
9891
|
+
annotation,
|
|
9892
|
+
transform: transform2,
|
|
9893
|
+
untransform
|
|
9894
|
+
};
|
|
9895
|
+
}
|
|
9896
|
+
var simpleRules = [
|
|
9897
|
+
simpleTransformation(is_1.isUndefined, "undefined", function() {
|
|
9898
|
+
return null;
|
|
9899
|
+
}, function() {
|
|
9900
|
+
return void 0;
|
|
9901
|
+
}),
|
|
9902
|
+
simpleTransformation(is_1.isBigint, "bigint", function(v) {
|
|
9903
|
+
return v.toString();
|
|
9904
|
+
}, function(v) {
|
|
9905
|
+
if (typeof BigInt !== "undefined") {
|
|
9906
|
+
return BigInt(v);
|
|
9907
|
+
}
|
|
9908
|
+
console.error("Please add a BigInt polyfill.");
|
|
9909
|
+
return v;
|
|
9910
|
+
}),
|
|
9911
|
+
simpleTransformation(is_1.isDate, "Date", function(v) {
|
|
9912
|
+
return v.toISOString();
|
|
9913
|
+
}, function(v) {
|
|
9914
|
+
return new Date(v);
|
|
9915
|
+
}),
|
|
9916
|
+
simpleTransformation(is_1.isError, "Error", function(v, superJson) {
|
|
9917
|
+
var baseError = {
|
|
9918
|
+
name: v.name,
|
|
9919
|
+
message: v.message
|
|
9920
|
+
};
|
|
9921
|
+
superJson.allowedErrorProps.forEach(function(prop) {
|
|
9922
|
+
baseError[prop] = v[prop];
|
|
9923
|
+
});
|
|
9924
|
+
return baseError;
|
|
9925
|
+
}, function(v, superJson) {
|
|
9926
|
+
var e = new Error(v.message);
|
|
9927
|
+
e.name = v.name;
|
|
9928
|
+
e.stack = v.stack;
|
|
9929
|
+
superJson.allowedErrorProps.forEach(function(prop) {
|
|
9930
|
+
e[prop] = v[prop];
|
|
9931
|
+
});
|
|
9932
|
+
return e;
|
|
9933
|
+
}),
|
|
9934
|
+
simpleTransformation(is_1.isRegExp, "regexp", function(v) {
|
|
9935
|
+
return "" + v;
|
|
9936
|
+
}, function(regex) {
|
|
9937
|
+
var body2 = regex.slice(1, regex.lastIndexOf("/"));
|
|
9938
|
+
var flags = regex.slice(regex.lastIndexOf("/") + 1);
|
|
9939
|
+
return new RegExp(body2, flags);
|
|
9940
|
+
}),
|
|
9941
|
+
simpleTransformation(
|
|
9942
|
+
is_1.isSet,
|
|
9943
|
+
"set",
|
|
9944
|
+
// (sets only exist in es6+)
|
|
9945
|
+
// eslint-disable-next-line es5/no-es6-methods
|
|
9946
|
+
function(v) {
|
|
9947
|
+
return __spreadArray([], __read(v.values()));
|
|
9948
|
+
},
|
|
9949
|
+
function(v) {
|
|
9950
|
+
return new Set(v);
|
|
9951
|
+
}
|
|
9952
|
+
),
|
|
9953
|
+
simpleTransformation(is_1.isMap, "map", function(v) {
|
|
9954
|
+
return __spreadArray([], __read(v.entries()));
|
|
9955
|
+
}, function(v) {
|
|
9956
|
+
return new Map(v);
|
|
9957
|
+
}),
|
|
9958
|
+
simpleTransformation(function(v) {
|
|
9959
|
+
return is_1.isNaNValue(v) || is_1.isInfinite(v);
|
|
9960
|
+
}, "number", function(v) {
|
|
9961
|
+
if (is_1.isNaNValue(v)) {
|
|
9962
|
+
return "NaN";
|
|
9963
|
+
}
|
|
9964
|
+
if (v > 0) {
|
|
9965
|
+
return "Infinity";
|
|
9966
|
+
} else {
|
|
9967
|
+
return "-Infinity";
|
|
9968
|
+
}
|
|
9969
|
+
}, Number),
|
|
9970
|
+
simpleTransformation(function(v) {
|
|
9971
|
+
return v === 0 && 1 / v === -Infinity;
|
|
9972
|
+
}, "number", function() {
|
|
9973
|
+
return "-0";
|
|
9974
|
+
}, Number),
|
|
9975
|
+
simpleTransformation(is_1.isURL, "URL", function(v) {
|
|
9976
|
+
return v.toString();
|
|
9977
|
+
}, function(v) {
|
|
9978
|
+
return new URL(v);
|
|
9979
|
+
})
|
|
9980
|
+
];
|
|
9981
|
+
function compositeTransformation(isApplicable, annotation, transform2, untransform) {
|
|
9982
|
+
return {
|
|
9983
|
+
isApplicable,
|
|
9984
|
+
annotation,
|
|
9985
|
+
transform: transform2,
|
|
9986
|
+
untransform
|
|
9987
|
+
};
|
|
9988
|
+
}
|
|
9989
|
+
var symbolRule = compositeTransformation(function(s, superJson) {
|
|
9990
|
+
if (is_1.isSymbol(s)) {
|
|
9991
|
+
var isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
|
|
9992
|
+
return isRegistered;
|
|
9993
|
+
}
|
|
9994
|
+
return false;
|
|
9995
|
+
}, function(s, superJson) {
|
|
9996
|
+
var identifier = superJson.symbolRegistry.getIdentifier(s);
|
|
9997
|
+
return ["symbol", identifier];
|
|
9998
|
+
}, function(v) {
|
|
9999
|
+
return v.description;
|
|
10000
|
+
}, function(_, a, superJson) {
|
|
10001
|
+
var value2 = superJson.symbolRegistry.getValue(a[1]);
|
|
10002
|
+
if (!value2) {
|
|
10003
|
+
throw new Error("Trying to deserialize unknown symbol");
|
|
10004
|
+
}
|
|
10005
|
+
return value2;
|
|
10006
|
+
});
|
|
10007
|
+
var constructorToName = [
|
|
10008
|
+
Int8Array,
|
|
10009
|
+
Uint8Array,
|
|
10010
|
+
Int16Array,
|
|
10011
|
+
Uint16Array,
|
|
10012
|
+
Int32Array,
|
|
10013
|
+
Uint32Array,
|
|
10014
|
+
Float32Array,
|
|
10015
|
+
Float64Array,
|
|
10016
|
+
Uint8ClampedArray
|
|
10017
|
+
].reduce(function(obj, ctor) {
|
|
10018
|
+
obj[ctor.name] = ctor;
|
|
10019
|
+
return obj;
|
|
10020
|
+
}, {});
|
|
10021
|
+
var typedArrayRule = compositeTransformation(is_1.isTypedArray, function(v) {
|
|
10022
|
+
return ["typed-array", v.constructor.name];
|
|
10023
|
+
}, function(v) {
|
|
10024
|
+
return __spreadArray([], __read(v));
|
|
10025
|
+
}, function(v, a) {
|
|
10026
|
+
var ctor = constructorToName[a[1]];
|
|
10027
|
+
if (!ctor) {
|
|
10028
|
+
throw new Error("Trying to deserialize unknown typed array");
|
|
10029
|
+
}
|
|
10030
|
+
return new ctor(v);
|
|
10031
|
+
});
|
|
10032
|
+
function isInstanceOfRegisteredClass(potentialClass, superJson) {
|
|
10033
|
+
if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) {
|
|
10034
|
+
var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
|
|
10035
|
+
return isRegistered;
|
|
10036
|
+
}
|
|
10037
|
+
return false;
|
|
10038
|
+
}
|
|
10039
|
+
exports2.isInstanceOfRegisteredClass = isInstanceOfRegisteredClass;
|
|
10040
|
+
var classRule = compositeTransformation(isInstanceOfRegisteredClass, function(clazz, superJson) {
|
|
10041
|
+
var identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
|
|
10042
|
+
return ["class", identifier];
|
|
10043
|
+
}, function(clazz, superJson) {
|
|
10044
|
+
var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
|
|
10045
|
+
if (!allowedProps) {
|
|
10046
|
+
return __assign({}, clazz);
|
|
10047
|
+
}
|
|
10048
|
+
var result = {};
|
|
10049
|
+
allowedProps.forEach(function(prop) {
|
|
10050
|
+
result[prop] = clazz[prop];
|
|
10051
|
+
});
|
|
10052
|
+
return result;
|
|
10053
|
+
}, function(v, a, superJson) {
|
|
10054
|
+
var clazz = superJson.classRegistry.getValue(a[1]);
|
|
10055
|
+
if (!clazz) {
|
|
10056
|
+
throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
|
|
10057
|
+
}
|
|
10058
|
+
return Object.assign(Object.create(clazz.prototype), v);
|
|
10059
|
+
});
|
|
10060
|
+
var customRule = compositeTransformation(function(value2, superJson) {
|
|
10061
|
+
return !!superJson.customTransformerRegistry.findApplicable(value2);
|
|
10062
|
+
}, function(value2, superJson) {
|
|
10063
|
+
var transformer = superJson.customTransformerRegistry.findApplicable(value2);
|
|
10064
|
+
return ["custom", transformer.name];
|
|
10065
|
+
}, function(value2, superJson) {
|
|
10066
|
+
var transformer = superJson.customTransformerRegistry.findApplicable(value2);
|
|
10067
|
+
return transformer.serialize(value2);
|
|
10068
|
+
}, function(v, a, superJson) {
|
|
10069
|
+
var transformer = superJson.customTransformerRegistry.findByName(a[1]);
|
|
10070
|
+
if (!transformer) {
|
|
10071
|
+
throw new Error("Trying to deserialize unknown custom value");
|
|
10072
|
+
}
|
|
10073
|
+
return transformer.deserialize(v);
|
|
10074
|
+
});
|
|
10075
|
+
var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
|
|
10076
|
+
var transformValue = function(value2, superJson) {
|
|
10077
|
+
var applicableCompositeRule = util_1.findArr(compositeRules, function(rule) {
|
|
10078
|
+
return rule.isApplicable(value2, superJson);
|
|
10079
|
+
});
|
|
10080
|
+
if (applicableCompositeRule) {
|
|
10081
|
+
return {
|
|
10082
|
+
value: applicableCompositeRule.transform(value2, superJson),
|
|
10083
|
+
type: applicableCompositeRule.annotation(value2, superJson)
|
|
10084
|
+
};
|
|
10085
|
+
}
|
|
10086
|
+
var applicableSimpleRule = util_1.findArr(simpleRules, function(rule) {
|
|
10087
|
+
return rule.isApplicable(value2, superJson);
|
|
10088
|
+
});
|
|
10089
|
+
if (applicableSimpleRule) {
|
|
10090
|
+
return {
|
|
10091
|
+
value: applicableSimpleRule.transform(value2, superJson),
|
|
10092
|
+
type: applicableSimpleRule.annotation
|
|
10093
|
+
};
|
|
10094
|
+
}
|
|
10095
|
+
return void 0;
|
|
10096
|
+
};
|
|
10097
|
+
exports2.transformValue = transformValue;
|
|
10098
|
+
var simpleRulesByAnnotation = {};
|
|
10099
|
+
simpleRules.forEach(function(rule) {
|
|
10100
|
+
simpleRulesByAnnotation[rule.annotation] = rule;
|
|
10101
|
+
});
|
|
10102
|
+
var untransformValue = function(json3, type, superJson) {
|
|
10103
|
+
if (is_1.isArray(type)) {
|
|
10104
|
+
switch (type[0]) {
|
|
10105
|
+
case "symbol":
|
|
10106
|
+
return symbolRule.untransform(json3, type, superJson);
|
|
10107
|
+
case "class":
|
|
10108
|
+
return classRule.untransform(json3, type, superJson);
|
|
10109
|
+
case "custom":
|
|
10110
|
+
return customRule.untransform(json3, type, superJson);
|
|
10111
|
+
case "typed-array":
|
|
10112
|
+
return typedArrayRule.untransform(json3, type, superJson);
|
|
10113
|
+
default:
|
|
10114
|
+
throw new Error("Unknown transformation: " + type);
|
|
10115
|
+
}
|
|
10116
|
+
} else {
|
|
10117
|
+
var transformation = simpleRulesByAnnotation[type];
|
|
10118
|
+
if (!transformation) {
|
|
10119
|
+
throw new Error("Unknown transformation: " + type);
|
|
10120
|
+
}
|
|
10121
|
+
return transformation.untransform(json3, superJson);
|
|
10122
|
+
}
|
|
10123
|
+
};
|
|
10124
|
+
exports2.untransformValue = untransformValue;
|
|
10125
|
+
}
|
|
10126
|
+
});
|
|
10127
|
+
|
|
10128
|
+
// ../../node_modules/superjson/dist/accessDeep.js
|
|
10129
|
+
var require_accessDeep = __commonJS({
|
|
10130
|
+
"../../node_modules/superjson/dist/accessDeep.js"(exports2) {
|
|
10131
|
+
"use strict";
|
|
10132
|
+
exports2.__esModule = true;
|
|
10133
|
+
exports2.setDeep = exports2.getDeep = void 0;
|
|
10134
|
+
var is_1 = require_is();
|
|
10135
|
+
var util_1 = require_util();
|
|
10136
|
+
var getNthKey = function(value2, n) {
|
|
10137
|
+
var keys = value2.keys();
|
|
10138
|
+
while (n > 0) {
|
|
10139
|
+
keys.next();
|
|
10140
|
+
n--;
|
|
10141
|
+
}
|
|
10142
|
+
return keys.next().value;
|
|
10143
|
+
};
|
|
10144
|
+
function validatePath(path94) {
|
|
10145
|
+
if (util_1.includes(path94, "__proto__")) {
|
|
10146
|
+
throw new Error("__proto__ is not allowed as a property");
|
|
10147
|
+
}
|
|
10148
|
+
if (util_1.includes(path94, "prototype")) {
|
|
10149
|
+
throw new Error("prototype is not allowed as a property");
|
|
10150
|
+
}
|
|
10151
|
+
if (util_1.includes(path94, "constructor")) {
|
|
10152
|
+
throw new Error("constructor is not allowed as a property");
|
|
10153
|
+
}
|
|
10154
|
+
}
|
|
10155
|
+
var getDeep = function(object2, path94) {
|
|
10156
|
+
validatePath(path94);
|
|
10157
|
+
for (var i = 0; i < path94.length; i++) {
|
|
10158
|
+
var key = path94[i];
|
|
10159
|
+
if (is_1.isSet(object2)) {
|
|
10160
|
+
object2 = getNthKey(object2, +key);
|
|
10161
|
+
} else if (is_1.isMap(object2)) {
|
|
10162
|
+
var row = +key;
|
|
10163
|
+
var type = +path94[++i] === 0 ? "key" : "value";
|
|
10164
|
+
var keyOfRow = getNthKey(object2, row);
|
|
10165
|
+
switch (type) {
|
|
10166
|
+
case "key":
|
|
10167
|
+
object2 = keyOfRow;
|
|
10168
|
+
break;
|
|
10169
|
+
case "value":
|
|
10170
|
+
object2 = object2.get(keyOfRow);
|
|
10171
|
+
break;
|
|
10172
|
+
}
|
|
10173
|
+
} else {
|
|
10174
|
+
object2 = object2[key];
|
|
10175
|
+
}
|
|
10176
|
+
}
|
|
10177
|
+
return object2;
|
|
10178
|
+
};
|
|
10179
|
+
exports2.getDeep = getDeep;
|
|
10180
|
+
var setDeep = function(object2, path94, mapper) {
|
|
10181
|
+
validatePath(path94);
|
|
10182
|
+
if (path94.length === 0) {
|
|
10183
|
+
return mapper(object2);
|
|
10184
|
+
}
|
|
10185
|
+
var parent = object2;
|
|
10186
|
+
for (var i = 0; i < path94.length - 1; i++) {
|
|
10187
|
+
var key = path94[i];
|
|
10188
|
+
if (is_1.isArray(parent)) {
|
|
10189
|
+
var index = +key;
|
|
10190
|
+
parent = parent[index];
|
|
10191
|
+
} else if (is_1.isPlainObject(parent)) {
|
|
10192
|
+
parent = parent[key];
|
|
10193
|
+
} else if (is_1.isSet(parent)) {
|
|
10194
|
+
var row = +key;
|
|
10195
|
+
parent = getNthKey(parent, row);
|
|
10196
|
+
} else if (is_1.isMap(parent)) {
|
|
10197
|
+
var isEnd = i === path94.length - 2;
|
|
10198
|
+
if (isEnd) {
|
|
10199
|
+
break;
|
|
10200
|
+
}
|
|
10201
|
+
var row = +key;
|
|
10202
|
+
var type = +path94[++i] === 0 ? "key" : "value";
|
|
10203
|
+
var keyOfRow = getNthKey(parent, row);
|
|
10204
|
+
switch (type) {
|
|
10205
|
+
case "key":
|
|
10206
|
+
parent = keyOfRow;
|
|
10207
|
+
break;
|
|
10208
|
+
case "value":
|
|
10209
|
+
parent = parent.get(keyOfRow);
|
|
10210
|
+
break;
|
|
10211
|
+
}
|
|
10212
|
+
}
|
|
10213
|
+
}
|
|
10214
|
+
var lastKey = path94[path94.length - 1];
|
|
10215
|
+
if (is_1.isArray(parent)) {
|
|
10216
|
+
parent[+lastKey] = mapper(parent[+lastKey]);
|
|
10217
|
+
} else if (is_1.isPlainObject(parent)) {
|
|
10218
|
+
parent[lastKey] = mapper(parent[lastKey]);
|
|
10219
|
+
}
|
|
10220
|
+
if (is_1.isSet(parent)) {
|
|
10221
|
+
var oldValue = getNthKey(parent, +lastKey);
|
|
10222
|
+
var newValue = mapper(oldValue);
|
|
10223
|
+
if (oldValue !== newValue) {
|
|
10224
|
+
parent["delete"](oldValue);
|
|
10225
|
+
parent.add(newValue);
|
|
10226
|
+
}
|
|
10227
|
+
}
|
|
10228
|
+
if (is_1.isMap(parent)) {
|
|
10229
|
+
var row = +path94[path94.length - 2];
|
|
10230
|
+
var keyToRow = getNthKey(parent, row);
|
|
10231
|
+
var type = +lastKey === 0 ? "key" : "value";
|
|
10232
|
+
switch (type) {
|
|
10233
|
+
case "key": {
|
|
10234
|
+
var newKey = mapper(keyToRow);
|
|
10235
|
+
parent.set(newKey, parent.get(keyToRow));
|
|
10236
|
+
if (newKey !== keyToRow) {
|
|
10237
|
+
parent["delete"](keyToRow);
|
|
10238
|
+
}
|
|
10239
|
+
break;
|
|
10240
|
+
}
|
|
10241
|
+
case "value": {
|
|
10242
|
+
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
10243
|
+
break;
|
|
10244
|
+
}
|
|
10245
|
+
}
|
|
10246
|
+
}
|
|
10247
|
+
return object2;
|
|
10248
|
+
};
|
|
10249
|
+
exports2.setDeep = setDeep;
|
|
10250
|
+
}
|
|
10251
|
+
});
|
|
10252
|
+
|
|
10253
|
+
// ../../node_modules/superjson/dist/plainer.js
|
|
10254
|
+
var require_plainer = __commonJS({
|
|
10255
|
+
"../../node_modules/superjson/dist/plainer.js"(exports2) {
|
|
10256
|
+
"use strict";
|
|
10257
|
+
var __read = exports2 && exports2.__read || function(o, n) {
|
|
10258
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
10259
|
+
if (!m) return o;
|
|
10260
|
+
var i = m.call(o), r, ar = [], e;
|
|
10261
|
+
try {
|
|
10262
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
10263
|
+
} catch (error62) {
|
|
10264
|
+
e = { error: error62 };
|
|
10265
|
+
} finally {
|
|
10266
|
+
try {
|
|
10267
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
10268
|
+
} finally {
|
|
10269
|
+
if (e) throw e.error;
|
|
10270
|
+
}
|
|
10271
|
+
}
|
|
10272
|
+
return ar;
|
|
10273
|
+
};
|
|
10274
|
+
var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
|
|
10275
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
10276
|
+
to[j] = from[i];
|
|
10277
|
+
return to;
|
|
10278
|
+
};
|
|
10279
|
+
exports2.__esModule = true;
|
|
10280
|
+
exports2.walker = exports2.generateReferentialEqualityAnnotations = exports2.applyReferentialEqualityAnnotations = exports2.applyValueAnnotations = void 0;
|
|
10281
|
+
var is_1 = require_is();
|
|
10282
|
+
var pathstringifier_1 = require_pathstringifier();
|
|
10283
|
+
var transformer_1 = require_transformer();
|
|
10284
|
+
var util_1 = require_util();
|
|
10285
|
+
var pathstringifier_2 = require_pathstringifier();
|
|
10286
|
+
var accessDeep_1 = require_accessDeep();
|
|
10287
|
+
function traverse(tree, walker2, origin2) {
|
|
10288
|
+
if (origin2 === void 0) {
|
|
10289
|
+
origin2 = [];
|
|
10290
|
+
}
|
|
10291
|
+
if (!tree) {
|
|
10292
|
+
return;
|
|
10293
|
+
}
|
|
10294
|
+
if (!is_1.isArray(tree)) {
|
|
10295
|
+
util_1.forEach(tree, function(subtree, key) {
|
|
10296
|
+
return traverse(subtree, walker2, __spreadArray(__spreadArray([], __read(origin2)), __read(pathstringifier_2.parsePath(key))));
|
|
10297
|
+
});
|
|
10298
|
+
return;
|
|
10299
|
+
}
|
|
10300
|
+
var _a3 = __read(tree, 2), nodeValue = _a3[0], children = _a3[1];
|
|
10301
|
+
if (children) {
|
|
10302
|
+
util_1.forEach(children, function(child, key) {
|
|
10303
|
+
traverse(child, walker2, __spreadArray(__spreadArray([], __read(origin2)), __read(pathstringifier_2.parsePath(key))));
|
|
10304
|
+
});
|
|
10305
|
+
}
|
|
10306
|
+
walker2(nodeValue, origin2);
|
|
10307
|
+
}
|
|
10308
|
+
function applyValueAnnotations(plain2, annotations, superJson) {
|
|
10309
|
+
traverse(annotations, function(type, path94) {
|
|
10310
|
+
plain2 = accessDeep_1.setDeep(plain2, path94, function(v) {
|
|
10311
|
+
return transformer_1.untransformValue(v, type, superJson);
|
|
10312
|
+
});
|
|
10313
|
+
});
|
|
10314
|
+
return plain2;
|
|
10315
|
+
}
|
|
10316
|
+
exports2.applyValueAnnotations = applyValueAnnotations;
|
|
10317
|
+
function applyReferentialEqualityAnnotations(plain2, annotations) {
|
|
10318
|
+
function apply(identicalPaths, path94) {
|
|
10319
|
+
var object2 = accessDeep_1.getDeep(plain2, pathstringifier_2.parsePath(path94));
|
|
10320
|
+
identicalPaths.map(pathstringifier_2.parsePath).forEach(function(identicalObjectPath) {
|
|
10321
|
+
plain2 = accessDeep_1.setDeep(plain2, identicalObjectPath, function() {
|
|
10322
|
+
return object2;
|
|
10323
|
+
});
|
|
10324
|
+
});
|
|
10325
|
+
}
|
|
10326
|
+
if (is_1.isArray(annotations)) {
|
|
10327
|
+
var _a3 = __read(annotations, 2), root = _a3[0], other = _a3[1];
|
|
10328
|
+
root.forEach(function(identicalPath) {
|
|
10329
|
+
plain2 = accessDeep_1.setDeep(plain2, pathstringifier_2.parsePath(identicalPath), function() {
|
|
10330
|
+
return plain2;
|
|
10331
|
+
});
|
|
10332
|
+
});
|
|
10333
|
+
if (other) {
|
|
10334
|
+
util_1.forEach(other, apply);
|
|
10335
|
+
}
|
|
10336
|
+
} else {
|
|
10337
|
+
util_1.forEach(annotations, apply);
|
|
10338
|
+
}
|
|
10339
|
+
return plain2;
|
|
10340
|
+
}
|
|
10341
|
+
exports2.applyReferentialEqualityAnnotations = applyReferentialEqualityAnnotations;
|
|
10342
|
+
var isDeep = function(object2, superJson) {
|
|
10343
|
+
return is_1.isPlainObject(object2) || is_1.isArray(object2) || is_1.isMap(object2) || is_1.isSet(object2) || transformer_1.isInstanceOfRegisteredClass(object2, superJson);
|
|
10344
|
+
};
|
|
10345
|
+
function addIdentity(object2, path94, identities) {
|
|
10346
|
+
var existingSet = identities.get(object2);
|
|
10347
|
+
if (existingSet) {
|
|
10348
|
+
existingSet.push(path94);
|
|
10349
|
+
} else {
|
|
10350
|
+
identities.set(object2, [path94]);
|
|
10351
|
+
}
|
|
10352
|
+
}
|
|
10353
|
+
function generateReferentialEqualityAnnotations(identitites, dedupe) {
|
|
10354
|
+
var result = {};
|
|
10355
|
+
var rootEqualityPaths = void 0;
|
|
10356
|
+
identitites.forEach(function(paths2) {
|
|
10357
|
+
if (paths2.length <= 1) {
|
|
10358
|
+
return;
|
|
10359
|
+
}
|
|
10360
|
+
if (!dedupe) {
|
|
10361
|
+
paths2 = paths2.map(function(path94) {
|
|
10362
|
+
return path94.map(String);
|
|
10363
|
+
}).sort(function(a, b) {
|
|
10364
|
+
return a.length - b.length;
|
|
10365
|
+
});
|
|
10366
|
+
}
|
|
10367
|
+
var _a3 = __read(paths2), representativePath = _a3[0], identicalPaths = _a3.slice(1);
|
|
10368
|
+
if (representativePath.length === 0) {
|
|
10369
|
+
rootEqualityPaths = identicalPaths.map(pathstringifier_1.stringifyPath);
|
|
10370
|
+
} else {
|
|
10371
|
+
result[pathstringifier_1.stringifyPath(representativePath)] = identicalPaths.map(pathstringifier_1.stringifyPath);
|
|
10372
|
+
}
|
|
10373
|
+
});
|
|
10374
|
+
if (rootEqualityPaths) {
|
|
10375
|
+
if (is_1.isEmptyObject(result)) {
|
|
10376
|
+
return [rootEqualityPaths];
|
|
10377
|
+
} else {
|
|
10378
|
+
return [rootEqualityPaths, result];
|
|
10379
|
+
}
|
|
10380
|
+
} else {
|
|
10381
|
+
return is_1.isEmptyObject(result) ? void 0 : result;
|
|
10382
|
+
}
|
|
10383
|
+
}
|
|
10384
|
+
exports2.generateReferentialEqualityAnnotations = generateReferentialEqualityAnnotations;
|
|
10385
|
+
var walker = function(object2, identities, superJson, dedupe, path94, objectsInThisPath, seenObjects) {
|
|
10386
|
+
var _a3;
|
|
10387
|
+
if (path94 === void 0) {
|
|
10388
|
+
path94 = [];
|
|
10389
|
+
}
|
|
10390
|
+
if (objectsInThisPath === void 0) {
|
|
10391
|
+
objectsInThisPath = [];
|
|
10392
|
+
}
|
|
10393
|
+
if (seenObjects === void 0) {
|
|
10394
|
+
seenObjects = /* @__PURE__ */ new Map();
|
|
10395
|
+
}
|
|
10396
|
+
var primitive = is_1.isPrimitive(object2);
|
|
10397
|
+
if (!primitive) {
|
|
10398
|
+
addIdentity(object2, path94, identities);
|
|
10399
|
+
var seen = seenObjects.get(object2);
|
|
10400
|
+
if (seen) {
|
|
10401
|
+
return dedupe ? {
|
|
10402
|
+
transformedValue: null
|
|
10403
|
+
} : seen;
|
|
10404
|
+
}
|
|
10405
|
+
}
|
|
10406
|
+
if (!isDeep(object2, superJson)) {
|
|
10407
|
+
var transformed_1 = transformer_1.transformValue(object2, superJson);
|
|
10408
|
+
var result_1 = transformed_1 ? {
|
|
10409
|
+
transformedValue: transformed_1.value,
|
|
10410
|
+
annotations: [transformed_1.type]
|
|
10411
|
+
} : {
|
|
10412
|
+
transformedValue: object2
|
|
10413
|
+
};
|
|
10414
|
+
if (!primitive) {
|
|
10415
|
+
seenObjects.set(object2, result_1);
|
|
10416
|
+
}
|
|
10417
|
+
return result_1;
|
|
10418
|
+
}
|
|
10419
|
+
if (util_1.includes(objectsInThisPath, object2)) {
|
|
10420
|
+
return {
|
|
10421
|
+
transformedValue: null
|
|
10422
|
+
};
|
|
10423
|
+
}
|
|
10424
|
+
var transformationResult = transformer_1.transformValue(object2, superJson);
|
|
10425
|
+
var transformed = (_a3 = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a3 !== void 0 ? _a3 : object2;
|
|
10426
|
+
var transformedValue = is_1.isArray(transformed) ? [] : {};
|
|
10427
|
+
var innerAnnotations = {};
|
|
10428
|
+
util_1.forEach(transformed, function(value2, index) {
|
|
10429
|
+
var recursiveResult = exports2.walker(value2, identities, superJson, dedupe, __spreadArray(__spreadArray([], __read(path94)), [index]), __spreadArray(__spreadArray([], __read(objectsInThisPath)), [object2]), seenObjects);
|
|
10430
|
+
transformedValue[index] = recursiveResult.transformedValue;
|
|
10431
|
+
if (is_1.isArray(recursiveResult.annotations)) {
|
|
10432
|
+
innerAnnotations[index] = recursiveResult.annotations;
|
|
10433
|
+
} else if (is_1.isPlainObject(recursiveResult.annotations)) {
|
|
10434
|
+
util_1.forEach(recursiveResult.annotations, function(tree, key) {
|
|
10435
|
+
innerAnnotations[pathstringifier_1.escapeKey(index) + "." + key] = tree;
|
|
10436
|
+
});
|
|
10437
|
+
}
|
|
10438
|
+
});
|
|
10439
|
+
var result = is_1.isEmptyObject(innerAnnotations) ? {
|
|
10440
|
+
transformedValue,
|
|
10441
|
+
annotations: !!transformationResult ? [transformationResult.type] : void 0
|
|
10442
|
+
} : {
|
|
10443
|
+
transformedValue,
|
|
10444
|
+
annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
|
|
10445
|
+
};
|
|
10446
|
+
if (!primitive) {
|
|
10447
|
+
seenObjects.set(object2, result);
|
|
10448
|
+
}
|
|
10449
|
+
return result;
|
|
10450
|
+
};
|
|
10451
|
+
exports2.walker = walker;
|
|
10452
|
+
}
|
|
10453
|
+
});
|
|
10454
|
+
|
|
10455
|
+
// ../../node_modules/is-what/dist/cjs/index.cjs
|
|
10456
|
+
var require_cjs2 = __commonJS({
|
|
10457
|
+
"../../node_modules/is-what/dist/cjs/index.cjs"(exports2) {
|
|
10458
|
+
"use strict";
|
|
10459
|
+
function getType(payload) {
|
|
10460
|
+
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
10461
|
+
}
|
|
10462
|
+
function isAnyObject(payload) {
|
|
10463
|
+
return getType(payload) === "Object";
|
|
10464
|
+
}
|
|
10465
|
+
function isArray(payload) {
|
|
10466
|
+
return getType(payload) === "Array";
|
|
10467
|
+
}
|
|
10468
|
+
function isBlob(payload) {
|
|
10469
|
+
return getType(payload) === "Blob";
|
|
10470
|
+
}
|
|
10471
|
+
function isBoolean(payload) {
|
|
10472
|
+
return getType(payload) === "Boolean";
|
|
10473
|
+
}
|
|
10474
|
+
function isDate(payload) {
|
|
10475
|
+
return getType(payload) === "Date" && !isNaN(payload);
|
|
10476
|
+
}
|
|
10477
|
+
function isEmptyArray(payload) {
|
|
10478
|
+
return isArray(payload) && payload.length === 0;
|
|
10479
|
+
}
|
|
10480
|
+
function isPlainObject2(payload) {
|
|
10481
|
+
if (getType(payload) !== "Object")
|
|
10482
|
+
return false;
|
|
10483
|
+
const prototype = Object.getPrototypeOf(payload);
|
|
10484
|
+
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
|
10485
|
+
}
|
|
10486
|
+
function isEmptyObject(payload) {
|
|
10487
|
+
return isPlainObject2(payload) && Object.keys(payload).length === 0;
|
|
10488
|
+
}
|
|
10489
|
+
function isEmptyString(payload) {
|
|
10490
|
+
return payload === "";
|
|
10491
|
+
}
|
|
10492
|
+
function isError(payload) {
|
|
10493
|
+
return getType(payload) === "Error" || payload instanceof Error;
|
|
10494
|
+
}
|
|
10495
|
+
function isFile(payload) {
|
|
10496
|
+
return getType(payload) === "File";
|
|
10497
|
+
}
|
|
10498
|
+
function isFullArray(payload) {
|
|
10499
|
+
return isArray(payload) && payload.length > 0;
|
|
10500
|
+
}
|
|
10501
|
+
function isFullObject(payload) {
|
|
10502
|
+
return isPlainObject2(payload) && Object.keys(payload).length > 0;
|
|
10503
|
+
}
|
|
10504
|
+
function isString(payload) {
|
|
10505
|
+
return getType(payload) === "String";
|
|
10506
|
+
}
|
|
10507
|
+
function isFullString(payload) {
|
|
10508
|
+
return isString(payload) && payload !== "";
|
|
10509
|
+
}
|
|
10510
|
+
function isFunction2(payload) {
|
|
10511
|
+
return typeof payload === "function";
|
|
10512
|
+
}
|
|
10513
|
+
function isType(payload, type) {
|
|
10514
|
+
if (!(type instanceof Function)) {
|
|
10515
|
+
throw new TypeError("Type must be a function");
|
|
10516
|
+
}
|
|
10517
|
+
if (!Object.prototype.hasOwnProperty.call(type, "prototype")) {
|
|
10518
|
+
throw new TypeError("Type is not a class");
|
|
10519
|
+
}
|
|
10520
|
+
const name = type.name;
|
|
10521
|
+
return getType(payload) === name || Boolean(payload && payload.constructor === type);
|
|
10522
|
+
}
|
|
10523
|
+
function isInstanceOf(value2, classOrClassName) {
|
|
10524
|
+
if (typeof classOrClassName === "function") {
|
|
10525
|
+
for (let p = value2; p; p = Object.getPrototypeOf(p)) {
|
|
10526
|
+
if (isType(p, classOrClassName)) {
|
|
10527
|
+
return true;
|
|
10528
|
+
}
|
|
10529
|
+
}
|
|
10530
|
+
return false;
|
|
10531
|
+
} else {
|
|
10532
|
+
for (let p = value2; p; p = Object.getPrototypeOf(p)) {
|
|
10533
|
+
if (getType(p) === classOrClassName) {
|
|
10534
|
+
return true;
|
|
10535
|
+
}
|
|
10536
|
+
}
|
|
10537
|
+
return false;
|
|
10538
|
+
}
|
|
10539
|
+
}
|
|
10540
|
+
function isMap(payload) {
|
|
10541
|
+
return getType(payload) === "Map";
|
|
10542
|
+
}
|
|
10543
|
+
function isNaNValue(payload) {
|
|
10544
|
+
return getType(payload) === "Number" && isNaN(payload);
|
|
10545
|
+
}
|
|
10546
|
+
function isNumber(payload) {
|
|
10547
|
+
return getType(payload) === "Number" && !isNaN(payload);
|
|
10548
|
+
}
|
|
10549
|
+
function isNegativeNumber(payload) {
|
|
10550
|
+
return isNumber(payload) && payload < 0;
|
|
10551
|
+
}
|
|
10552
|
+
function isNull(payload) {
|
|
10553
|
+
return getType(payload) === "Null";
|
|
10554
|
+
}
|
|
10555
|
+
function isOneOf(a, b, c, d, e) {
|
|
10556
|
+
return (value2) => a(value2) || b(value2) || !!c && c(value2) || !!d && d(value2) || !!e && e(value2);
|
|
10557
|
+
}
|
|
10558
|
+
function isUndefined(payload) {
|
|
10559
|
+
return getType(payload) === "Undefined";
|
|
10560
|
+
}
|
|
10561
|
+
var isNullOrUndefined = isOneOf(isNull, isUndefined);
|
|
10562
|
+
function isObject8(payload) {
|
|
10563
|
+
return isPlainObject2(payload);
|
|
10564
|
+
}
|
|
10565
|
+
function isObjectLike(payload) {
|
|
10566
|
+
return isAnyObject(payload);
|
|
10567
|
+
}
|
|
10568
|
+
function isPositiveNumber(payload) {
|
|
10569
|
+
return isNumber(payload) && payload > 0;
|
|
10570
|
+
}
|
|
10571
|
+
function isSymbol(payload) {
|
|
10572
|
+
return getType(payload) === "Symbol";
|
|
10573
|
+
}
|
|
10574
|
+
function isPrimitive(payload) {
|
|
10575
|
+
return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
|
10576
|
+
}
|
|
10577
|
+
function isPromise(payload) {
|
|
10578
|
+
return getType(payload) === "Promise";
|
|
10579
|
+
}
|
|
10580
|
+
function isRegExp(payload) {
|
|
10581
|
+
return getType(payload) === "RegExp";
|
|
10582
|
+
}
|
|
10583
|
+
function isSet(payload) {
|
|
10584
|
+
return getType(payload) === "Set";
|
|
10585
|
+
}
|
|
10586
|
+
function isWeakMap(payload) {
|
|
10587
|
+
return getType(payload) === "WeakMap";
|
|
10588
|
+
}
|
|
10589
|
+
function isWeakSet(payload) {
|
|
10590
|
+
return getType(payload) === "WeakSet";
|
|
10591
|
+
}
|
|
10592
|
+
exports2.getType = getType;
|
|
10593
|
+
exports2.isAnyObject = isAnyObject;
|
|
10594
|
+
exports2.isArray = isArray;
|
|
10595
|
+
exports2.isBlob = isBlob;
|
|
10596
|
+
exports2.isBoolean = isBoolean;
|
|
10597
|
+
exports2.isDate = isDate;
|
|
10598
|
+
exports2.isEmptyArray = isEmptyArray;
|
|
10599
|
+
exports2.isEmptyObject = isEmptyObject;
|
|
10600
|
+
exports2.isEmptyString = isEmptyString;
|
|
10601
|
+
exports2.isError = isError;
|
|
10602
|
+
exports2.isFile = isFile;
|
|
10603
|
+
exports2.isFullArray = isFullArray;
|
|
10604
|
+
exports2.isFullObject = isFullObject;
|
|
10605
|
+
exports2.isFullString = isFullString;
|
|
10606
|
+
exports2.isFunction = isFunction2;
|
|
10607
|
+
exports2.isInstanceOf = isInstanceOf;
|
|
10608
|
+
exports2.isMap = isMap;
|
|
10609
|
+
exports2.isNaNValue = isNaNValue;
|
|
10610
|
+
exports2.isNegativeNumber = isNegativeNumber;
|
|
10611
|
+
exports2.isNull = isNull;
|
|
10612
|
+
exports2.isNullOrUndefined = isNullOrUndefined;
|
|
10613
|
+
exports2.isNumber = isNumber;
|
|
10614
|
+
exports2.isObject = isObject8;
|
|
10615
|
+
exports2.isObjectLike = isObjectLike;
|
|
10616
|
+
exports2.isOneOf = isOneOf;
|
|
10617
|
+
exports2.isPlainObject = isPlainObject2;
|
|
10618
|
+
exports2.isPositiveNumber = isPositiveNumber;
|
|
10619
|
+
exports2.isPrimitive = isPrimitive;
|
|
10620
|
+
exports2.isPromise = isPromise;
|
|
10621
|
+
exports2.isRegExp = isRegExp;
|
|
10622
|
+
exports2.isSet = isSet;
|
|
10623
|
+
exports2.isString = isString;
|
|
10624
|
+
exports2.isSymbol = isSymbol;
|
|
10625
|
+
exports2.isType = isType;
|
|
10626
|
+
exports2.isUndefined = isUndefined;
|
|
10627
|
+
exports2.isWeakMap = isWeakMap;
|
|
10628
|
+
exports2.isWeakSet = isWeakSet;
|
|
10629
|
+
}
|
|
10630
|
+
});
|
|
10631
|
+
|
|
10632
|
+
// ../../node_modules/copy-anything/dist/cjs/index.cjs
|
|
10633
|
+
var require_cjs3 = __commonJS({
|
|
10634
|
+
"../../node_modules/copy-anything/dist/cjs/index.cjs"(exports2) {
|
|
10635
|
+
"use strict";
|
|
10636
|
+
var isWhat = require_cjs2();
|
|
10637
|
+
function assignProp2(carry, key, newVal, originalObject, includeNonenumerable) {
|
|
10638
|
+
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
10639
|
+
if (propType === "enumerable")
|
|
10640
|
+
carry[key] = newVal;
|
|
10641
|
+
if (includeNonenumerable && propType === "nonenumerable") {
|
|
10642
|
+
Object.defineProperty(carry, key, {
|
|
10643
|
+
value: newVal,
|
|
10644
|
+
enumerable: false,
|
|
10645
|
+
writable: true,
|
|
10646
|
+
configurable: true
|
|
10647
|
+
});
|
|
10648
|
+
}
|
|
10649
|
+
}
|
|
10650
|
+
function copy(target2, options = {}) {
|
|
10651
|
+
if (isWhat.isArray(target2)) {
|
|
10652
|
+
return target2.map((item) => copy(item, options));
|
|
10653
|
+
}
|
|
10654
|
+
if (!isWhat.isPlainObject(target2)) {
|
|
10655
|
+
return target2;
|
|
10656
|
+
}
|
|
10657
|
+
const props = Object.getOwnPropertyNames(target2);
|
|
10658
|
+
const symbols = Object.getOwnPropertySymbols(target2);
|
|
10659
|
+
return [...props, ...symbols].reduce((carry, key) => {
|
|
10660
|
+
if (isWhat.isArray(options.props) && !options.props.includes(key)) {
|
|
10661
|
+
return carry;
|
|
10662
|
+
}
|
|
10663
|
+
const val = target2[key];
|
|
10664
|
+
const newVal = copy(val, options);
|
|
10665
|
+
assignProp2(carry, key, newVal, target2, options.nonenumerable);
|
|
10666
|
+
return carry;
|
|
10667
|
+
}, {});
|
|
10668
|
+
}
|
|
10669
|
+
exports2.copy = copy;
|
|
10670
|
+
}
|
|
10671
|
+
});
|
|
10672
|
+
|
|
10673
|
+
// ../../node_modules/superjson/dist/index.js
|
|
10674
|
+
var require_dist = __commonJS({
|
|
10675
|
+
"../../node_modules/superjson/dist/index.js"(exports2) {
|
|
10676
|
+
"use strict";
|
|
10677
|
+
var __assign = exports2 && exports2.__assign || function() {
|
|
10678
|
+
__assign = Object.assign || function(t) {
|
|
10679
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10680
|
+
s = arguments[i];
|
|
10681
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10682
|
+
t[p] = s[p];
|
|
10683
|
+
}
|
|
10684
|
+
return t;
|
|
10685
|
+
};
|
|
10686
|
+
return __assign.apply(this, arguments);
|
|
10687
|
+
};
|
|
10688
|
+
var __read = exports2 && exports2.__read || function(o, n) {
|
|
10689
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
10690
|
+
if (!m) return o;
|
|
10691
|
+
var i = m.call(o), r, ar = [], e;
|
|
10692
|
+
try {
|
|
10693
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
10694
|
+
} catch (error62) {
|
|
10695
|
+
e = { error: error62 };
|
|
10696
|
+
} finally {
|
|
10697
|
+
try {
|
|
10698
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
10699
|
+
} finally {
|
|
10700
|
+
if (e) throw e.error;
|
|
10701
|
+
}
|
|
10702
|
+
}
|
|
10703
|
+
return ar;
|
|
10704
|
+
};
|
|
10705
|
+
var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
|
|
10706
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
10707
|
+
to[j] = from[i];
|
|
10708
|
+
return to;
|
|
10709
|
+
};
|
|
10710
|
+
exports2.__esModule = true;
|
|
10711
|
+
exports2.allowErrorProps = exports2.registerSymbol = exports2.registerCustom = exports2.registerClass = exports2.parse = exports2.stringify = exports2.deserialize = exports2.serialize = exports2.SuperJSON = void 0;
|
|
10712
|
+
var class_registry_1 = require_class_registry();
|
|
10713
|
+
var registry_1 = require_registry();
|
|
10714
|
+
var custom_transformer_registry_1 = require_custom_transformer_registry();
|
|
10715
|
+
var plainer_1 = require_plainer();
|
|
10716
|
+
var copy_anything_1 = require_cjs3();
|
|
10717
|
+
var SuperJSON2 = (
|
|
10718
|
+
/** @class */
|
|
10719
|
+
(function() {
|
|
10720
|
+
function SuperJSON3(_a3) {
|
|
10721
|
+
var _b = _a3 === void 0 ? {} : _a3, _c = _b.dedupe, dedupe = _c === void 0 ? false : _c;
|
|
10722
|
+
this.classRegistry = new class_registry_1.ClassRegistry();
|
|
10723
|
+
this.symbolRegistry = new registry_1.Registry(function(s) {
|
|
10724
|
+
var _a4;
|
|
10725
|
+
return (_a4 = s.description) !== null && _a4 !== void 0 ? _a4 : "";
|
|
10726
|
+
});
|
|
10727
|
+
this.customTransformerRegistry = new custom_transformer_registry_1.CustomTransformerRegistry();
|
|
10728
|
+
this.allowedErrorProps = [];
|
|
10729
|
+
this.dedupe = dedupe;
|
|
10730
|
+
}
|
|
10731
|
+
SuperJSON3.prototype.serialize = function(object2) {
|
|
10732
|
+
var identities = /* @__PURE__ */ new Map();
|
|
10733
|
+
var output2 = plainer_1.walker(object2, identities, this, this.dedupe);
|
|
10734
|
+
var res = {
|
|
10735
|
+
json: output2.transformedValue
|
|
10736
|
+
};
|
|
10737
|
+
if (output2.annotations) {
|
|
10738
|
+
res.meta = __assign(__assign({}, res.meta), { values: output2.annotations });
|
|
10739
|
+
}
|
|
10740
|
+
var equalityAnnotations = plainer_1.generateReferentialEqualityAnnotations(identities, this.dedupe);
|
|
10741
|
+
if (equalityAnnotations) {
|
|
10742
|
+
res.meta = __assign(__assign({}, res.meta), { referentialEqualities: equalityAnnotations });
|
|
10743
|
+
}
|
|
10744
|
+
return res;
|
|
10745
|
+
};
|
|
10746
|
+
SuperJSON3.prototype.deserialize = function(payload) {
|
|
10747
|
+
var json3 = payload.json, meta3 = payload.meta;
|
|
10748
|
+
var result = copy_anything_1.copy(json3);
|
|
10749
|
+
if (meta3 === null || meta3 === void 0 ? void 0 : meta3.values) {
|
|
10750
|
+
result = plainer_1.applyValueAnnotations(result, meta3.values, this);
|
|
10751
|
+
}
|
|
10752
|
+
if (meta3 === null || meta3 === void 0 ? void 0 : meta3.referentialEqualities) {
|
|
10753
|
+
result = plainer_1.applyReferentialEqualityAnnotations(result, meta3.referentialEqualities);
|
|
10754
|
+
}
|
|
10755
|
+
return result;
|
|
10756
|
+
};
|
|
10757
|
+
SuperJSON3.prototype.stringify = function(object2) {
|
|
10758
|
+
return JSON.stringify(this.serialize(object2));
|
|
10759
|
+
};
|
|
10760
|
+
SuperJSON3.prototype.parse = function(string4) {
|
|
10761
|
+
return this.deserialize(JSON.parse(string4));
|
|
10762
|
+
};
|
|
10763
|
+
SuperJSON3.prototype.registerClass = function(v, options) {
|
|
10764
|
+
this.classRegistry.register(v, options);
|
|
10765
|
+
};
|
|
10766
|
+
SuperJSON3.prototype.registerSymbol = function(v, identifier) {
|
|
10767
|
+
this.symbolRegistry.register(v, identifier);
|
|
10768
|
+
};
|
|
10769
|
+
SuperJSON3.prototype.registerCustom = function(transformer, name) {
|
|
10770
|
+
this.customTransformerRegistry.register(__assign({ name }, transformer));
|
|
10771
|
+
};
|
|
10772
|
+
SuperJSON3.prototype.allowErrorProps = function() {
|
|
10773
|
+
var _a3;
|
|
10774
|
+
var props = [];
|
|
10775
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10776
|
+
props[_i] = arguments[_i];
|
|
10777
|
+
}
|
|
10778
|
+
(_a3 = this.allowedErrorProps).push.apply(_a3, __spreadArray([], __read(props)));
|
|
10779
|
+
};
|
|
10780
|
+
SuperJSON3.defaultInstance = new SuperJSON3();
|
|
10781
|
+
SuperJSON3.serialize = SuperJSON3.defaultInstance.serialize.bind(SuperJSON3.defaultInstance);
|
|
10782
|
+
SuperJSON3.deserialize = SuperJSON3.defaultInstance.deserialize.bind(SuperJSON3.defaultInstance);
|
|
10783
|
+
SuperJSON3.stringify = SuperJSON3.defaultInstance.stringify.bind(SuperJSON3.defaultInstance);
|
|
10784
|
+
SuperJSON3.parse = SuperJSON3.defaultInstance.parse.bind(SuperJSON3.defaultInstance);
|
|
10785
|
+
SuperJSON3.registerClass = SuperJSON3.defaultInstance.registerClass.bind(SuperJSON3.defaultInstance);
|
|
10786
|
+
SuperJSON3.registerSymbol = SuperJSON3.defaultInstance.registerSymbol.bind(SuperJSON3.defaultInstance);
|
|
10787
|
+
SuperJSON3.registerCustom = SuperJSON3.defaultInstance.registerCustom.bind(SuperJSON3.defaultInstance);
|
|
10788
|
+
SuperJSON3.allowErrorProps = SuperJSON3.defaultInstance.allowErrorProps.bind(SuperJSON3.defaultInstance);
|
|
10789
|
+
return SuperJSON3;
|
|
10790
|
+
})()
|
|
10791
|
+
);
|
|
10792
|
+
exports2.SuperJSON = SuperJSON2;
|
|
10793
|
+
exports2["default"] = SuperJSON2;
|
|
10794
|
+
exports2.serialize = SuperJSON2.serialize;
|
|
10795
|
+
exports2.deserialize = SuperJSON2.deserialize;
|
|
10796
|
+
exports2.stringify = SuperJSON2.stringify;
|
|
10797
|
+
exports2.parse = SuperJSON2.parse;
|
|
10798
|
+
exports2.registerClass = SuperJSON2.registerClass;
|
|
10799
|
+
exports2.registerCustom = SuperJSON2.registerCustom;
|
|
10800
|
+
exports2.registerSymbol = SuperJSON2.registerSymbol;
|
|
10801
|
+
exports2.allowErrorProps = SuperJSON2.allowErrorProps;
|
|
10802
|
+
}
|
|
10803
|
+
});
|
|
10804
|
+
|
|
9473
10805
|
// src/cli.ts
|
|
9474
10806
|
var import_node_dns = __toESM(require("node:dns"));
|
|
9475
10807
|
var import_promises27 = __toESM(require("node:fs/promises"));
|
|
@@ -16918,18 +18250,18 @@ var validateAsync = async (schema, value2, _ctx) => {
|
|
|
16918
18250
|
return result.issues.length === 0;
|
|
16919
18251
|
};
|
|
16920
18252
|
var _encode = (_Err) => {
|
|
16921
|
-
const
|
|
18253
|
+
const parse7 = _parse(_Err);
|
|
16922
18254
|
const fn = (schema, value2, _ctx, _params) => {
|
|
16923
18255
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
16924
|
-
return
|
|
18256
|
+
return parse7(schema, value2, ctx, finalizeParams(fn, _params));
|
|
16925
18257
|
};
|
|
16926
18258
|
return fn;
|
|
16927
18259
|
};
|
|
16928
18260
|
var encode = /* @__PURE__ */ _encode($ZodRealError);
|
|
16929
18261
|
var _decode = (_Err) => {
|
|
16930
|
-
const
|
|
18262
|
+
const parse7 = _parse(_Err);
|
|
16931
18263
|
const fn = (schema, value2, _ctx, _params) => {
|
|
16932
|
-
return
|
|
18264
|
+
return parse7(schema, value2, _ctx, finalizeParams(fn, _params));
|
|
16933
18265
|
};
|
|
16934
18266
|
return fn;
|
|
16935
18267
|
};
|
|
@@ -18405,15 +19737,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
18405
19737
|
}
|
|
18406
19738
|
}
|
|
18407
19739
|
const input2 = payload.value;
|
|
18408
|
-
const
|
|
18409
|
-
const isValidDate =
|
|
19740
|
+
const isDate = input2 instanceof Date;
|
|
19741
|
+
const isValidDate = isDate && !Number.isNaN(input2.getTime());
|
|
18410
19742
|
if (isValidDate)
|
|
18411
19743
|
return payload;
|
|
18412
19744
|
payload.issues.push({
|
|
18413
19745
|
expected: "date",
|
|
18414
19746
|
code: "invalid_type",
|
|
18415
19747
|
input: input2,
|
|
18416
|
-
...
|
|
19748
|
+
...isDate ? { received: "Invalid Date" } : {},
|
|
18417
19749
|
inst
|
|
18418
19750
|
});
|
|
18419
19751
|
return payload;
|
|
@@ -18424,7 +19756,7 @@ function capSize(inst, size2) {
|
|
|
18424
19756
|
if (!caps.length)
|
|
18425
19757
|
return;
|
|
18426
19758
|
const cap = Math.min(...caps.map((c) => c[0]));
|
|
18427
|
-
const
|
|
19759
|
+
const parse7 = inst._zod.parse;
|
|
18428
19760
|
inst._zod.parse = (payload, ctx) => {
|
|
18429
19761
|
const n = size2(payload.value);
|
|
18430
19762
|
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
@@ -18438,7 +19770,7 @@ function capSize(inst, size2) {
|
|
|
18438
19770
|
}
|
|
18439
19771
|
}
|
|
18440
19772
|
}
|
|
18441
|
-
return
|
|
19773
|
+
return parse7(payload, ctx);
|
|
18442
19774
|
};
|
|
18443
19775
|
}
|
|
18444
19776
|
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
@@ -30238,12 +31570,12 @@ function _uppercase(params) {
|
|
|
30238
31570
|
});
|
|
30239
31571
|
}
|
|
30240
31572
|
// @__NO_SIDE_EFFECTS__
|
|
30241
|
-
function _includes(
|
|
31573
|
+
function _includes(includes, params) {
|
|
30242
31574
|
return new $ZodCheckIncludes({
|
|
30243
31575
|
check: "string_format",
|
|
30244
31576
|
format: "includes",
|
|
30245
31577
|
...normalizeParams(params),
|
|
30246
|
-
includes
|
|
31578
|
+
includes
|
|
30247
31579
|
});
|
|
30248
31580
|
}
|
|
30249
31581
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -35187,12 +36519,12 @@ ${item.text}` : item.text;
|
|
|
35187
36519
|
return;
|
|
35188
36520
|
case "command_execution": {
|
|
35189
36521
|
const output2 = item.aggregated_output || "";
|
|
35190
|
-
const
|
|
35191
|
-
cb.onToolResult?.({ toolUseId: item.id, content: output2, isError
|
|
36522
|
+
const isError = item.status === "failed" || (item.exit_code ?? 0) !== 0;
|
|
36523
|
+
cb.onToolResult?.({ toolUseId: item.id, content: output2, isError });
|
|
35192
36524
|
if (output2) {
|
|
35193
36525
|
cb.onLog?.({
|
|
35194
|
-
type:
|
|
35195
|
-
content:
|
|
36526
|
+
type: isError ? "tool" : "text",
|
|
36527
|
+
content: isError ? truncate2(`Tool error: ${output2}`, 2e3) : truncate2(output2, 2e3)
|
|
35196
36528
|
});
|
|
35197
36529
|
}
|
|
35198
36530
|
return;
|
|
@@ -37114,7 +38446,7 @@ async function ensureStateStore(target2) {
|
|
|
37114
38446
|
return;
|
|
37115
38447
|
}
|
|
37116
38448
|
try {
|
|
37117
|
-
const
|
|
38449
|
+
const copy = async (kind, index) => {
|
|
37118
38450
|
const ids = (await redisCli(target2, `SMEMBERS ${index}`)).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
37119
38451
|
for (const id of ids) {
|
|
37120
38452
|
const file2 = recordPath(target2, kind, id);
|
|
@@ -37123,8 +38455,8 @@ async function ensureStateStore(target2) {
|
|
|
37123
38455
|
if (raw) await writeAtomic(file2, raw);
|
|
37124
38456
|
}
|
|
37125
38457
|
};
|
|
37126
|
-
await
|
|
37127
|
-
await
|
|
38458
|
+
await copy("card", "cards");
|
|
38459
|
+
await copy("ask", "asks");
|
|
37128
38460
|
const ackFile = import_path8.default.join(dir, TERMINAL_ACK_FILE);
|
|
37129
38461
|
const ack = await redisCli(target2, "GET terminal:ack");
|
|
37130
38462
|
if (ack && await readText(ackFile) === null) {
|
|
@@ -38454,6 +39786,7 @@ var ROUTE_SEGMENTS = [
|
|
|
38454
39786
|
"dmca",
|
|
38455
39787
|
"download",
|
|
38456
39788
|
"dsar",
|
|
39789
|
+
"e2ee-chat",
|
|
38457
39790
|
"eula",
|
|
38458
39791
|
"explore",
|
|
38459
39792
|
"f",
|
|
@@ -45080,7 +46413,7 @@ function argsSummary(raw) {
|
|
|
45080
46413
|
var SCRIPT_HEADER_RE = /^Script (completed|failed|running[^\n]*)\n(?:Wall time[^\n]*\n)?(?:Output:\n)?/;
|
|
45081
46414
|
function codexOutput(output2) {
|
|
45082
46415
|
let text2 = "";
|
|
45083
|
-
let
|
|
46416
|
+
let isError = false;
|
|
45084
46417
|
if (typeof output2 === "string") {
|
|
45085
46418
|
text2 = output2;
|
|
45086
46419
|
if (output2.startsWith("{")) {
|
|
@@ -45089,7 +46422,7 @@ function codexOutput(output2) {
|
|
|
45089
46422
|
if (typeof o.output === "string") {
|
|
45090
46423
|
text2 = o.output;
|
|
45091
46424
|
const code = o.metadata?.exit_code;
|
|
45092
|
-
|
|
46425
|
+
isError = typeof code === "number" && code !== 0;
|
|
45093
46426
|
}
|
|
45094
46427
|
} catch {
|
|
45095
46428
|
}
|
|
@@ -45101,14 +46434,14 @@ function codexOutput(output2) {
|
|
|
45101
46434
|
} else if (output2 && typeof output2 === "object") {
|
|
45102
46435
|
const o = output2;
|
|
45103
46436
|
text2 = str3(o.content) || str3(o.output);
|
|
45104
|
-
if (o.success === false)
|
|
46437
|
+
if (o.success === false) isError = true;
|
|
45105
46438
|
}
|
|
45106
46439
|
const header2 = SCRIPT_HEADER_RE.exec(text2);
|
|
45107
46440
|
if (header2) {
|
|
45108
|
-
if (header2[1] === "failed")
|
|
46441
|
+
if (header2[1] === "failed") isError = true;
|
|
45109
46442
|
text2 = text2.slice(header2[0].length);
|
|
45110
46443
|
}
|
|
45111
|
-
return { isError
|
|
46444
|
+
return { isError, preview: preview(text2.trim()) };
|
|
45112
46445
|
}
|
|
45113
46446
|
function parseCodexLine(line) {
|
|
45114
46447
|
let row;
|
|
@@ -49517,8 +50850,8 @@ var currentPath = (skill, workspace) => import_path17.default.join(
|
|
|
49517
50850
|
async function prepareSkillUpdate(opts) {
|
|
49518
50851
|
const { skill, update: update2 } = opts;
|
|
49519
50852
|
const current = currentPath(skill, opts.workspace);
|
|
49520
|
-
const
|
|
49521
|
-
const origin2 = libraryOriginOf(
|
|
50853
|
+
const copy = await import_promises11.default.readFile(current, "utf-8");
|
|
50854
|
+
const origin2 = libraryOriginOf(copy);
|
|
49522
50855
|
const latestOrigin = libraryOriginOf(update2.latest);
|
|
49523
50856
|
if (!origin2 || latestOrigin?.uuid !== origin2.uuid) {
|
|
49524
50857
|
throw new Error(`${skill.name} is not a copy of this library skill.`);
|
|
@@ -53970,10 +55303,10 @@ function withSessionCardTools(opts) {
|
|
|
53970
55303
|
text: err2 instanceof Error ? err2.message : String(err2),
|
|
53971
55304
|
isError: true
|
|
53972
55305
|
})).then(
|
|
53973
|
-
({ text: text2, isError
|
|
55306
|
+
({ text: text2, isError }) => channel.send({
|
|
53974
55307
|
jsonrpc: "2.0",
|
|
53975
55308
|
id,
|
|
53976
|
-
result: { content: [{ type: "text", text: text2 }], isError
|
|
55309
|
+
result: { content: [{ type: "text", text: text2 }], isError }
|
|
53977
55310
|
})
|
|
53978
55311
|
);
|
|
53979
55312
|
return;
|
|
@@ -74569,6 +75902,16 @@ function ollamaModelsOnDisk(modelsDir) {
|
|
|
74569
75902
|
}
|
|
74570
75903
|
return ids.sort();
|
|
74571
75904
|
}
|
|
75905
|
+
var MIN_TOOL_PARAMS_B = 3;
|
|
75906
|
+
function parameterBillions(size2) {
|
|
75907
|
+
if (typeof size2 !== "string") return null;
|
|
75908
|
+
const match = /^\s*([\d.]+)\s*([KMBT])\s*$/i.exec(size2);
|
|
75909
|
+
if (!match) return null;
|
|
75910
|
+
const n = Number(match[1]);
|
|
75911
|
+
if (!Number.isFinite(n)) return null;
|
|
75912
|
+
const scale = { K: 1e-6, M: 1e-3, B: 1, T: 1e3 }[match[2].toUpperCase()];
|
|
75913
|
+
return n * scale;
|
|
75914
|
+
}
|
|
74572
75915
|
async function ollamaTakesTools(baseUrl, model, fetchImpl = fetch) {
|
|
74573
75916
|
try {
|
|
74574
75917
|
const res = await fetchImpl(`${baseUrl}/api/show`, {
|
|
@@ -74577,8 +75920,10 @@ async function ollamaTakesTools(baseUrl, model, fetchImpl = fetch) {
|
|
|
74577
75920
|
body: JSON.stringify({ model })
|
|
74578
75921
|
});
|
|
74579
75922
|
if (!res.ok) return false;
|
|
74580
|
-
const { capabilities } = await res.json();
|
|
74581
|
-
|
|
75923
|
+
const { capabilities, details } = await res.json();
|
|
75924
|
+
if (!Array.isArray(capabilities) || !capabilities.includes("tools")) return false;
|
|
75925
|
+
const size2 = parameterBillions(details?.parameter_size);
|
|
75926
|
+
return size2 === null || size2 >= MIN_TOOL_PARAMS_B;
|
|
74582
75927
|
} catch {
|
|
74583
75928
|
return false;
|
|
74584
75929
|
}
|
|
@@ -78016,15 +79361,15 @@ var listDir = async (dir) => {
|
|
|
78016
79361
|
async function withCopy(file2, read) {
|
|
78017
79362
|
const dir = await import_promises26.default.mkdtemp(import_node_path40.default.join(import_node_os17.default.tmpdir(), "factiii-scan-"));
|
|
78018
79363
|
try {
|
|
78019
|
-
const
|
|
78020
|
-
await import_promises26.default.copyFile(file2,
|
|
79364
|
+
const copy = import_node_path40.default.join(dir, import_node_path40.default.basename(file2));
|
|
79365
|
+
await import_promises26.default.copyFile(file2, copy);
|
|
78021
79366
|
for (const suffix of ["-wal", "-shm"]) {
|
|
78022
79367
|
try {
|
|
78023
|
-
await import_promises26.default.copyFile(file2 + suffix,
|
|
79368
|
+
await import_promises26.default.copyFile(file2 + suffix, copy + suffix);
|
|
78024
79369
|
} catch {
|
|
78025
79370
|
}
|
|
78026
79371
|
}
|
|
78027
|
-
return await read(
|
|
79372
|
+
return await read(copy);
|
|
78028
79373
|
} finally {
|
|
78029
79374
|
await import_promises26.default.rm(dir, { recursive: true, force: true });
|
|
78030
79375
|
}
|
|
@@ -78081,7 +79426,7 @@ async function chromiumCookies(deps, notes) {
|
|
|
78081
79426
|
try {
|
|
78082
79427
|
const rows = await withCopy(
|
|
78083
79428
|
file2,
|
|
78084
|
-
(
|
|
79429
|
+
(copy) => deps.querySqlite(copy, "SELECT host_key, COUNT(*) FROM cookies GROUP BY host_key")
|
|
78085
79430
|
);
|
|
78086
79431
|
found.push({
|
|
78087
79432
|
browser: browser.name,
|
|
@@ -78108,7 +79453,7 @@ async function firefoxCookies(deps, notes) {
|
|
|
78108
79453
|
try {
|
|
78109
79454
|
const rows = await withCopy(
|
|
78110
79455
|
file2,
|
|
78111
|
-
(
|
|
79456
|
+
(copy) => deps.querySqlite(copy, "SELECT host, COUNT(*) FROM moz_cookies GROUP BY host")
|
|
78112
79457
|
);
|
|
78113
79458
|
found.push({
|
|
78114
79459
|
browser: "Firefox",
|
|
@@ -78345,7 +79690,7 @@ async function permissions(deps, notes) {
|
|
|
78345
79690
|
try {
|
|
78346
79691
|
const rows = await withCopy(
|
|
78347
79692
|
db,
|
|
78348
|
-
(
|
|
79693
|
+
(copy) => deps.querySqlite(copy, `SELECT service, client, auth_value FROM access WHERE service IN (${services})`)
|
|
78349
79694
|
);
|
|
78350
79695
|
for (const [service2, client, auth] of rows) {
|
|
78351
79696
|
const known = service2 ? TCC_SERVICES[service2] : void 0;
|
|
@@ -81525,6 +82870,7 @@ var FINDINGS_BOOTSTRAP_RESAMPLES = 1e3;
|
|
|
81525
82870
|
var FINDINGS_FDR_Q = 0.1;
|
|
81526
82871
|
var FINDINGS_CI_LEVEL = 0.95;
|
|
81527
82872
|
var FINDINGS_MIN_ABS_RHO = 0.3;
|
|
82873
|
+
var FINDINGS_MAX_PAIR_OVERLAP = 0.25;
|
|
81528
82874
|
var FINDINGS_MIN_LIFT = 1.5;
|
|
81529
82875
|
var FINDINGS_MIN_TONE_SHIFT = 0.25;
|
|
81530
82876
|
var FINDINGS_MIN_SEQUENCE_COUNT = 5;
|
|
@@ -81639,17 +82985,45 @@ var dotCorr = (a, b) => {
|
|
|
81639
82985
|
for (let i = 0; i < a.r.length; i++) dot += a.r[i] * b.r[i];
|
|
81640
82986
|
return dot / (a.norm * b.norm);
|
|
81641
82987
|
};
|
|
81642
|
-
function
|
|
82988
|
+
function pairOverlap(intervals, table, index, timeZone) {
|
|
82989
|
+
const parts2 = index.size;
|
|
82990
|
+
const both = new Float64Array(parts2 * parts2);
|
|
82991
|
+
const active = new Set(table.days);
|
|
82992
|
+
for (const interval of intervals) {
|
|
82993
|
+
const minutes = intervalMinutes(interval);
|
|
82994
|
+
if (minutes <= 0) continue;
|
|
82995
|
+
if (!active.has(localDayKey(interval.startedAt, timeZone))) continue;
|
|
82996
|
+
const carried = [...new Set(interval.factiiiIds)].map((id) => index.get(id)).filter((f) => f !== void 0);
|
|
82997
|
+
for (const a of carried) {
|
|
82998
|
+
for (const b of carried) if (a !== b) both[a * parts2 + b] += minutes;
|
|
82999
|
+
}
|
|
83000
|
+
}
|
|
83001
|
+
const totals = [...index.keys()].map(
|
|
83002
|
+
(id) => table.minutes.get(id).reduce((sum, value2) => sum + value2, 0)
|
|
83003
|
+
);
|
|
83004
|
+
for (let a = 0; a < parts2; a++) {
|
|
83005
|
+
for (let b = 0; b < parts2; b++) {
|
|
83006
|
+
const smaller = Math.min(totals[a], totals[b]);
|
|
83007
|
+
both[a * parts2 + b] = smaller > 0 ? both[a * parts2 + b] / smaller : 0;
|
|
83008
|
+
}
|
|
83009
|
+
}
|
|
83010
|
+
return both;
|
|
83011
|
+
}
|
|
83012
|
+
function shareTests(table, tested, overlap, name, seed) {
|
|
81643
83013
|
const parts2 = tested.length;
|
|
81644
83014
|
const n = table.days.length;
|
|
81645
|
-
if (parts2 < FINDINGS_MIN_SHARE_PARTS) return [];
|
|
83015
|
+
if (parts2 < FINDINGS_MIN_SHARE_PARTS) return { candidates: [], untested: 0 };
|
|
81646
83016
|
const columns = tested.map((id) => table.minutes.get(id));
|
|
81647
83017
|
const clr = tested.map(() => new Float64Array(n));
|
|
81648
83018
|
clrInto(columns, n, clr, (_f, d) => d);
|
|
81649
83019
|
const observed = clr.map((c) => centredRanks(c));
|
|
81650
83020
|
const pairs = [];
|
|
83021
|
+
let untested = 0;
|
|
81651
83022
|
for (let a = 0; a < parts2; a++) {
|
|
81652
|
-
for (let b = a + 1; b < parts2; b++)
|
|
83023
|
+
for (let b = a + 1; b < parts2; b++) {
|
|
83024
|
+
if (overlap[a * parts2 + b] >= FINDINGS_MAX_PAIR_OVERLAP) untested++;
|
|
83025
|
+
else pairs.push([a, b]);
|
|
83026
|
+
}
|
|
81653
83027
|
}
|
|
81654
83028
|
const rng = mulberry32(seed ^ SALT_SHARES);
|
|
81655
83029
|
const groups = makeGroups(table.week);
|
|
@@ -81667,7 +83041,7 @@ function shareTests(table, tested, name, seed) {
|
|
|
81667
83041
|
nulls[i * FINDINGS_DAY_PERMUTATIONS + k] = dotCorr(ranks[a], ranks[b]);
|
|
81668
83042
|
});
|
|
81669
83043
|
}
|
|
81670
|
-
|
|
83044
|
+
const candidates2 = pairs.map(([a, b], i) => {
|
|
81671
83045
|
const raw = dotCorr(observed[a], observed[b]);
|
|
81672
83046
|
const { p, mean } = twoSided(
|
|
81673
83047
|
raw,
|
|
@@ -81703,6 +83077,7 @@ function shareTests(table, tested, name, seed) {
|
|
|
81703
83077
|
text: (ci) => `More time on ${name(idA)} was associated with ${rho >= 0 ? "more" : "less"} time on ${name(idB)} (\u03C1 ${fmt(rho)}, ${ciText(ci)}, n = ${n} days).`
|
|
81704
83078
|
};
|
|
81705
83079
|
});
|
|
83080
|
+
return { candidates: candidates2, untested };
|
|
81706
83081
|
}
|
|
81707
83082
|
function buildSessions(intervals, index) {
|
|
81708
83083
|
const sorted = intervals.filter((i) => intervalMinutes(i) > 0).sort((a, b) => a.startedAt - b.startedAt);
|
|
@@ -82073,16 +83448,18 @@ function computeFindings(input2) {
|
|
|
82073
83448
|
const name = (id) => input2.factiiiNames[id] ?? `Factiii ${id}`;
|
|
82074
83449
|
const index = new Map(tested.map((id, f) => [id, f]));
|
|
82075
83450
|
const sessions = buildSessions(input2.intervals, index);
|
|
83451
|
+
const overlap = pairOverlap(input2.intervals, table, index, input2.timeZone);
|
|
83452
|
+
const shares = shareTests(table, tested, overlap, name, seed);
|
|
82076
83453
|
const sequences = sequenceTests(sessions, tested, name, seed);
|
|
82077
83454
|
const candidates2 = [
|
|
82078
|
-
...
|
|
83455
|
+
...shares.candidates,
|
|
82079
83456
|
...sequences.candidates
|
|
82080
83457
|
];
|
|
82081
83458
|
const tone = toneTests(input2, table, sessions, tested, name, seed);
|
|
82082
83459
|
candidates2.push(...tone.candidates);
|
|
82083
83460
|
const qs = benjaminiHochberg([
|
|
82084
83461
|
...candidates2.map((c) => c.p),
|
|
82085
|
-
...Array.from({ length: sequences.untested }, () => 1)
|
|
83462
|
+
...Array.from({ length: shares.untested + sequences.untested }, () => 1)
|
|
82086
83463
|
]);
|
|
82087
83464
|
const findings = [];
|
|
82088
83465
|
candidates2.forEach((c, i) => {
|
|
@@ -83871,7 +85248,7 @@ var FILES_GIVEN = "- The files are given below.";
|
|
|
83871
85248
|
var FILES_BY_TOOL = "- Find the files with your tools (search_my_files, list_my_files and the rest) and read each one you cite with read_my_file before you answer. Use no other tool.";
|
|
83872
85249
|
var FILES_TOO = "- If they are not enough, search and read more with your tools (search_my_files, read_my_file).";
|
|
83873
85250
|
var SAVE_BY_TOOL = "- When what you have put together is worth keeping \u2014 a finding drawn across several documents, something they asked you to remember \u2014 call save_research, then say so in your reply. Do not save a restatement of one file they already hold.";
|
|
83874
|
-
var SAVE_NONE = "- You cannot keep notes. If they ask you to keep, save or remember something, say that this model cannot keep notes on this runner, and that a model with tools, such as Llama 3.2, can.";
|
|
85251
|
+
var SAVE_NONE = "- You cannot keep notes. If they ask you to keep, save or remember something, say that this model cannot keep notes on this runner, and that a model with tools, such as Llama 3.2 3B or larger, can.";
|
|
83875
85252
|
var SAVE_NOT_OWNER = "- You cannot keep notes. If they ask you to keep, save or remember something, say that only the owner of this runner keeps notes on it.";
|
|
83876
85253
|
var NOTHING_FOUND = "No file in the vault matched the question.";
|
|
83877
85254
|
var ATTACHED_CHARS = 24e3;
|
|
@@ -87246,9 +88623,37 @@ var downloadUrlInput = external_exports.object({
|
|
|
87246
88623
|
download: external_exports.boolean().optional()
|
|
87247
88624
|
});
|
|
87248
88625
|
|
|
87249
|
-
// ../../node_modules/@trpc/server/dist/
|
|
88626
|
+
// ../../node_modules/@trpc/server/dist/codes-nbrm_zWY.mjs
|
|
88627
|
+
function mergeWithoutOverrides(obj1, ...objs) {
|
|
88628
|
+
const newObj = Object.assign(emptyObject(), obj1);
|
|
88629
|
+
for (const overrides of objs) for (const key in overrides) {
|
|
88630
|
+
if (key in newObj && newObj[key] !== overrides[key]) throw new Error(`Duplicate key ${key}`);
|
|
88631
|
+
newObj[key] = overrides[key];
|
|
88632
|
+
}
|
|
88633
|
+
return newObj;
|
|
88634
|
+
}
|
|
88635
|
+
function isObject7(value2) {
|
|
88636
|
+
return !!value2 && !Array.isArray(value2) && typeof value2 === "object";
|
|
88637
|
+
}
|
|
88638
|
+
function isFunction(fn) {
|
|
88639
|
+
return typeof fn === "function";
|
|
88640
|
+
}
|
|
88641
|
+
function emptyObject() {
|
|
88642
|
+
return /* @__PURE__ */ Object.create(null);
|
|
88643
|
+
}
|
|
88644
|
+
var asyncIteratorsSupported = typeof Symbol === "function" && !!Symbol.asyncIterator;
|
|
88645
|
+
function isAsyncIterable(value2) {
|
|
88646
|
+
return asyncIteratorsSupported && isObject7(value2) && Symbol.asyncIterator in value2;
|
|
88647
|
+
}
|
|
87250
88648
|
var TRPC_ERROR_CODES_BY_KEY = {
|
|
88649
|
+
/**
|
|
88650
|
+
* Invalid JSON was received by the server.
|
|
88651
|
+
* An error occurred on the server while parsing the JSON text.
|
|
88652
|
+
*/
|
|
87251
88653
|
PARSE_ERROR: -32700,
|
|
88654
|
+
/**
|
|
88655
|
+
* The JSON sent is not a valid Request object.
|
|
88656
|
+
*/
|
|
87252
88657
|
BAD_REQUEST: -32600,
|
|
87253
88658
|
INTERNAL_SERVER_ERROR: -32603,
|
|
87254
88659
|
NOT_IMPLEMENTED: -32603,
|
|
@@ -87276,48 +88681,8 @@ var retryableRpcCodes = [
|
|
|
87276
88681
|
TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,
|
|
87277
88682
|
TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR
|
|
87278
88683
|
];
|
|
87279
|
-
function mergeWithoutOverrides(obj1, ...objs) {
|
|
87280
|
-
const newObj = Object.assign(/* @__PURE__ */ Object.create(null), obj1);
|
|
87281
|
-
for (const overrides of objs) for (const key in overrides) {
|
|
87282
|
-
if (key in newObj && newObj[key] !== overrides[key]) throw new Error(`Duplicate key ${key}`);
|
|
87283
|
-
newObj[key] = overrides[key];
|
|
87284
|
-
}
|
|
87285
|
-
return newObj;
|
|
87286
|
-
}
|
|
87287
|
-
function isObject7(value2) {
|
|
87288
|
-
return !!value2 && !Array.isArray(value2) && typeof value2 === "object";
|
|
87289
|
-
}
|
|
87290
|
-
function isFunction(fn) {
|
|
87291
|
-
return typeof fn === "function";
|
|
87292
|
-
}
|
|
87293
|
-
function omitPrototype(obj) {
|
|
87294
|
-
return Object.assign(/* @__PURE__ */ Object.create(null), obj);
|
|
87295
|
-
}
|
|
87296
88684
|
|
|
87297
|
-
// ../../node_modules/@trpc/server/dist/getErrorShape-
|
|
87298
|
-
var __create2 = Object.create;
|
|
87299
|
-
var __defProp2 = Object.defineProperty;
|
|
87300
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
87301
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
87302
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
87303
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
87304
|
-
var __commonJS2 = (cb, mod) => function() {
|
|
87305
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
87306
|
-
};
|
|
87307
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
87308
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames2(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
87309
|
-
key = keys[i];
|
|
87310
|
-
if (!__hasOwnProp2.call(to, key) && key !== except) __defProp2(to, key, {
|
|
87311
|
-
get: ((k) => from[k]).bind(null, key),
|
|
87312
|
-
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
87313
|
-
});
|
|
87314
|
-
}
|
|
87315
|
-
return to;
|
|
87316
|
-
};
|
|
87317
|
-
var __toESM2 = (mod, isNodeMode, target2) => (target2 = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target2, "default", {
|
|
87318
|
-
value: mod,
|
|
87319
|
-
enumerable: true
|
|
87320
|
-
}) : target2, mod));
|
|
88685
|
+
// ../../node_modules/@trpc/server/dist/getErrorShape-B5jPKHJ3.mjs
|
|
87321
88686
|
var noop = () => {
|
|
87322
88687
|
};
|
|
87323
88688
|
var freezeIfAvailable = (obj) => {
|
|
@@ -87328,11 +88693,12 @@ function createInnerProxy(callback, path94, memo2) {
|
|
|
87328
88693
|
const cacheKey = path94.join(".");
|
|
87329
88694
|
(_memo$cacheKey = memo2[cacheKey]) !== null && _memo$cacheKey !== void 0 || (memo2[cacheKey] = new Proxy(noop, {
|
|
87330
88695
|
get(_obj, key) {
|
|
87331
|
-
if (typeof key !== "string" || key === "then") return
|
|
88696
|
+
if (typeof key !== "string" || key === "then") return;
|
|
87332
88697
|
return createInnerProxy(callback, [...path94, key], memo2);
|
|
87333
88698
|
},
|
|
87334
88699
|
apply(_1, _2, args) {
|
|
87335
88700
|
const lastOfPath = path94[path94.length - 1];
|
|
88701
|
+
if (lastOfPath === "valueOf" || lastOfPath === "toString" || lastOfPath === "toJSON") return `tRPC.proxy(${path94.slice(0, -1).join(".")})`;
|
|
87336
88702
|
let opts = {
|
|
87337
88703
|
args,
|
|
87338
88704
|
path: path94
|
|
@@ -87352,94 +88718,140 @@ function createInnerProxy(callback, path94, memo2) {
|
|
|
87352
88718
|
}));
|
|
87353
88719
|
return memo2[cacheKey];
|
|
87354
88720
|
}
|
|
87355
|
-
var createRecursiveProxy = (callback) => createInnerProxy(callback, [],
|
|
87356
|
-
var
|
|
87357
|
-
|
|
87358
|
-
|
|
87359
|
-
|
|
87360
|
-
|
|
87361
|
-
|
|
87362
|
-
|
|
87363
|
-
|
|
87364
|
-
|
|
87365
|
-
|
|
87366
|
-
|
|
87367
|
-
|
|
87368
|
-
|
|
87369
|
-
|
|
87370
|
-
|
|
87371
|
-
|
|
87372
|
-
|
|
87373
|
-
|
|
87374
|
-
|
|
87375
|
-
|
|
87376
|
-
|
|
87377
|
-
|
|
87378
|
-
|
|
87379
|
-
|
|
87380
|
-
|
|
87381
|
-
|
|
87382
|
-
|
|
87383
|
-
|
|
87384
|
-
|
|
87385
|
-
|
|
87386
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
87387
|
-
}
|
|
87388
|
-
module2.exports = toPropertyKey$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
87389
|
-
} });
|
|
87390
|
-
var require_defineProperty = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports2, module2) {
|
|
87391
|
-
var toPropertyKey = require_toPropertyKey();
|
|
87392
|
-
function _defineProperty(e, r, t) {
|
|
87393
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
87394
|
-
value: t,
|
|
87395
|
-
enumerable: true,
|
|
87396
|
-
configurable: true,
|
|
87397
|
-
writable: true
|
|
87398
|
-
}) : e[r] = t, e;
|
|
87399
|
-
}
|
|
87400
|
-
module2.exports = _defineProperty, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
87401
|
-
} });
|
|
87402
|
-
var require_objectSpread2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports2, module2) {
|
|
87403
|
-
var defineProperty = require_defineProperty();
|
|
87404
|
-
function ownKeys(e, r) {
|
|
87405
|
-
var t = Object.keys(e);
|
|
87406
|
-
if (Object.getOwnPropertySymbols) {
|
|
87407
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
87408
|
-
r && (o = o.filter(function(r$1) {
|
|
87409
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
87410
|
-
})), t.push.apply(t, o);
|
|
87411
|
-
}
|
|
87412
|
-
return t;
|
|
87413
|
-
}
|
|
87414
|
-
function _objectSpread2(e) {
|
|
87415
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
87416
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
87417
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) {
|
|
87418
|
-
defineProperty(e, r$1, t[r$1]);
|
|
87419
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
87420
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
87421
|
-
});
|
|
87422
|
-
}
|
|
87423
|
-
return e;
|
|
87424
|
-
}
|
|
87425
|
-
module2.exports = _objectSpread2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
87426
|
-
} });
|
|
87427
|
-
var import_objectSpread2 = __toESM2(require_objectSpread2(), 1);
|
|
87428
|
-
|
|
87429
|
-
// ../../node_modules/@trpc/server/dist/tracked-DBSMdVzR.mjs
|
|
88721
|
+
var createRecursiveProxy = (callback) => createInnerProxy(callback, [], emptyObject());
|
|
88722
|
+
var JSONRPC2_TO_HTTP_CODE = {
|
|
88723
|
+
PARSE_ERROR: 400,
|
|
88724
|
+
BAD_REQUEST: 400,
|
|
88725
|
+
UNAUTHORIZED: 401,
|
|
88726
|
+
PAYMENT_REQUIRED: 402,
|
|
88727
|
+
FORBIDDEN: 403,
|
|
88728
|
+
NOT_FOUND: 404,
|
|
88729
|
+
METHOD_NOT_SUPPORTED: 405,
|
|
88730
|
+
TIMEOUT: 408,
|
|
88731
|
+
CONFLICT: 409,
|
|
88732
|
+
PRECONDITION_FAILED: 412,
|
|
88733
|
+
PAYLOAD_TOO_LARGE: 413,
|
|
88734
|
+
UNSUPPORTED_MEDIA_TYPE: 415,
|
|
88735
|
+
UNPROCESSABLE_CONTENT: 422,
|
|
88736
|
+
PRECONDITION_REQUIRED: 428,
|
|
88737
|
+
TOO_MANY_REQUESTS: 429,
|
|
88738
|
+
CLIENT_CLOSED_REQUEST: 499,
|
|
88739
|
+
INTERNAL_SERVER_ERROR: 500,
|
|
88740
|
+
NOT_IMPLEMENTED: 501,
|
|
88741
|
+
BAD_GATEWAY: 502,
|
|
88742
|
+
SERVICE_UNAVAILABLE: 503,
|
|
88743
|
+
GATEWAY_TIMEOUT: 504
|
|
88744
|
+
};
|
|
88745
|
+
function getStatusCodeFromKey(code) {
|
|
88746
|
+
var _JSONRPC2_TO_HTTP_COD;
|
|
88747
|
+
return (_JSONRPC2_TO_HTTP_COD = JSONRPC2_TO_HTTP_CODE[code]) !== null && _JSONRPC2_TO_HTTP_COD !== void 0 ? _JSONRPC2_TO_HTTP_COD : 500;
|
|
88748
|
+
}
|
|
88749
|
+
function getHTTPStatusCodeFromError(error62) {
|
|
88750
|
+
return getStatusCodeFromKey(error62.code);
|
|
88751
|
+
}
|
|
87430
88752
|
var defaultFormatter = ({ shape }) => {
|
|
87431
88753
|
return shape;
|
|
87432
88754
|
};
|
|
87433
|
-
|
|
88755
|
+
function getDefaultErrorShape(opts) {
|
|
88756
|
+
const shape = {
|
|
88757
|
+
message: opts.error.message,
|
|
88758
|
+
code: TRPC_ERROR_CODES_BY_KEY[opts.error.code],
|
|
88759
|
+
data: {
|
|
88760
|
+
code: opts.error.code,
|
|
88761
|
+
httpStatus: getHTTPStatusCodeFromError(opts.error)
|
|
88762
|
+
}
|
|
88763
|
+
};
|
|
88764
|
+
if (opts.isDev && typeof opts.error.stack === "string") shape.data.stack = opts.error.stack;
|
|
88765
|
+
if (typeof opts.path === "string") shape.data.path = opts.path;
|
|
88766
|
+
return shape;
|
|
88767
|
+
}
|
|
88768
|
+
var formattedShapeSymbol = Symbol("trpc_formattedErrorShape");
|
|
88769
|
+
function setFormattedErrorShape(error62, shape) {
|
|
88770
|
+
Object.defineProperty(error62, formattedShapeSymbol, {
|
|
88771
|
+
value: shape,
|
|
88772
|
+
enumerable: false,
|
|
88773
|
+
configurable: true,
|
|
88774
|
+
writable: true
|
|
88775
|
+
});
|
|
88776
|
+
}
|
|
88777
|
+
function isFormattedErrorShape(error62) {
|
|
88778
|
+
return formattedShapeSymbol in error62;
|
|
88779
|
+
}
|
|
88780
|
+
function _typeof(o) {
|
|
88781
|
+
"@babel/helpers - typeof";
|
|
88782
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
88783
|
+
return typeof o2;
|
|
88784
|
+
} : function(o2) {
|
|
88785
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
88786
|
+
}, _typeof(o);
|
|
88787
|
+
}
|
|
88788
|
+
function toPrimitive(t, r) {
|
|
88789
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
88790
|
+
var e = t[Symbol.toPrimitive];
|
|
88791
|
+
if (void 0 !== e) {
|
|
88792
|
+
var i = e.call(t, r || "default");
|
|
88793
|
+
if ("object" != _typeof(i)) return i;
|
|
88794
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
88795
|
+
}
|
|
88796
|
+
return ("string" === r ? String : Number)(t);
|
|
88797
|
+
}
|
|
88798
|
+
function toPropertyKey(t) {
|
|
88799
|
+
var i = toPrimitive(t, "string");
|
|
88800
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
88801
|
+
}
|
|
88802
|
+
function _defineProperty(e, r, t) {
|
|
88803
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
88804
|
+
value: t,
|
|
88805
|
+
enumerable: true,
|
|
88806
|
+
configurable: true,
|
|
88807
|
+
writable: true
|
|
88808
|
+
}) : e[r] = t, e;
|
|
88809
|
+
}
|
|
88810
|
+
function ownKeys(e, r) {
|
|
88811
|
+
var t = Object.keys(e);
|
|
88812
|
+
if (Object.getOwnPropertySymbols) {
|
|
88813
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
88814
|
+
r && (o = o.filter(function(r2) {
|
|
88815
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
88816
|
+
})), t.push.apply(t, o);
|
|
88817
|
+
}
|
|
88818
|
+
return t;
|
|
88819
|
+
}
|
|
88820
|
+
function _objectSpread2(e) {
|
|
88821
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
88822
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
88823
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
88824
|
+
_defineProperty(e, r2, t[r2]);
|
|
88825
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
88826
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
88827
|
+
});
|
|
88828
|
+
}
|
|
88829
|
+
return e;
|
|
88830
|
+
}
|
|
88831
|
+
|
|
88832
|
+
// ../../node_modules/@trpc/server/dist/asyncGeneratorDelegate-JWx0LJUD.mjs
|
|
87434
88833
|
var UnknownCauseError = class extends Error {
|
|
88834
|
+
constructor(cause) {
|
|
88835
|
+
super(getMessage(cause));
|
|
88836
|
+
Object.assign(this, cause);
|
|
88837
|
+
if (isErrorLike(cause)) {
|
|
88838
|
+
if (typeof cause.name === "string") this.name = cause.name;
|
|
88839
|
+
if (typeof cause.stack === "string") this.stack = cause.stack;
|
|
88840
|
+
}
|
|
88841
|
+
}
|
|
87435
88842
|
};
|
|
88843
|
+
function getMessage(cause) {
|
|
88844
|
+
if ("message" in cause) return String(cause.message);
|
|
88845
|
+
}
|
|
88846
|
+
function isErrorLike(value2) {
|
|
88847
|
+
return value2 instanceof Error || Object.prototype.toString.call(value2) === "[object Error]";
|
|
88848
|
+
}
|
|
87436
88849
|
function getCauseFromUnknown(cause) {
|
|
87437
88850
|
if (cause instanceof Error) return cause;
|
|
87438
88851
|
const type = typeof cause;
|
|
87439
|
-
if (type === "undefined" || type === "function" || cause === null) return
|
|
88852
|
+
if (type === "undefined" || type === "function" || cause === null) return;
|
|
87440
88853
|
if (type !== "object") return new Error(String(cause));
|
|
87441
|
-
if (isObject7(cause)) return
|
|
87442
|
-
return void 0;
|
|
88854
|
+
if (isObject7(cause)) return new UnknownCauseError(cause);
|
|
87443
88855
|
}
|
|
87444
88856
|
function getTRPCErrorFromUnknown(cause) {
|
|
87445
88857
|
if (cause instanceof TRPCError) return cause;
|
|
@@ -87448,7 +88860,7 @@ function getTRPCErrorFromUnknown(cause) {
|
|
|
87448
88860
|
code: "INTERNAL_SERVER_ERROR",
|
|
87449
88861
|
cause
|
|
87450
88862
|
});
|
|
87451
|
-
if (cause
|
|
88863
|
+
if (isErrorLike(cause) && cause.stack) trpcError.stack = cause.stack;
|
|
87452
88864
|
return trpcError;
|
|
87453
88865
|
}
|
|
87454
88866
|
var TRPCError = class extends Error {
|
|
@@ -87457,14 +88869,13 @@ var TRPCError = class extends Error {
|
|
|
87457
88869
|
const cause = getCauseFromUnknown(opts.cause);
|
|
87458
88870
|
const message3 = (_ref = (_opts$message = opts.message) !== null && _opts$message !== void 0 ? _opts$message : cause === null || cause === void 0 ? void 0 : cause.message) !== null && _ref !== void 0 ? _ref : opts.code;
|
|
87459
88871
|
super(message3, { cause });
|
|
87460
|
-
(
|
|
87461
|
-
(
|
|
88872
|
+
_defineProperty(this, "cause", void 0);
|
|
88873
|
+
_defineProperty(this, "code", void 0);
|
|
87462
88874
|
this.code = opts.code;
|
|
87463
88875
|
this.name = "TRPCError";
|
|
87464
88876
|
(_this$cause = this.cause) !== null && _this$cause !== void 0 || (this.cause = cause);
|
|
87465
88877
|
}
|
|
87466
88878
|
};
|
|
87467
|
-
var import_objectSpread2$1 = __toESM2(require_objectSpread2(), 1);
|
|
87468
88879
|
function getDataTransformer(transformer) {
|
|
87469
88880
|
if ("input" in transformer) return transformer;
|
|
87470
88881
|
return {
|
|
@@ -87482,7 +88893,6 @@ var defaultTransformer = {
|
|
|
87482
88893
|
deserialize: (obj) => obj
|
|
87483
88894
|
}
|
|
87484
88895
|
};
|
|
87485
|
-
var import_objectSpread22 = __toESM2(require_objectSpread2(), 1);
|
|
87486
88896
|
var lazyMarker = "lazyMarker";
|
|
87487
88897
|
function once(fn) {
|
|
87488
88898
|
const uncalled = Symbol();
|
|
@@ -87513,38 +88923,42 @@ var reservedWords = [
|
|
|
87513
88923
|
"call",
|
|
87514
88924
|
"apply"
|
|
87515
88925
|
];
|
|
88926
|
+
function getRouterInput(router) {
|
|
88927
|
+
const input2 = Object.assign(emptyObject(), router._def.record);
|
|
88928
|
+
for (const loader of Object.values(router._def.lazy)) {
|
|
88929
|
+
let record2 = input2;
|
|
88930
|
+
for (const key of loader.path) record2 = record2[key] = Object.assign(emptyObject(), record2[key]);
|
|
88931
|
+
record2[loader.key] = loader.ref;
|
|
88932
|
+
}
|
|
88933
|
+
return input2;
|
|
88934
|
+
}
|
|
87516
88935
|
function createRouterFactory(config2) {
|
|
87517
88936
|
function createRouterInner(input2) {
|
|
87518
88937
|
const reservedWordsUsed = new Set(Object.keys(input2).filter((v) => reservedWords.includes(v)));
|
|
87519
88938
|
if (reservedWordsUsed.size > 0) throw new Error("Reserved words used in `router({})` call: " + Array.from(reservedWordsUsed).join(", "));
|
|
87520
|
-
const procedures =
|
|
87521
|
-
const
|
|
88939
|
+
const procedures = emptyObject();
|
|
88940
|
+
const lazy3 = emptyObject();
|
|
87522
88941
|
function createLazyLoader(opts) {
|
|
87523
88942
|
return {
|
|
87524
88943
|
ref: opts.ref,
|
|
88944
|
+
path: opts.path,
|
|
88945
|
+
key: opts.key,
|
|
87525
88946
|
load: once(async () => {
|
|
87526
|
-
const router
|
|
88947
|
+
const router = await opts.ref();
|
|
87527
88948
|
const lazyPath = [...opts.path, opts.key];
|
|
87528
88949
|
const lazyKey = lazyPath.join(".");
|
|
87529
|
-
opts.aggregate[opts.key] = step(router
|
|
87530
|
-
delete
|
|
87531
|
-
for (const [nestedKey, nestedItem] of Object.entries(router$1._def.lazy)) {
|
|
87532
|
-
const nestedRouterKey = [...lazyPath, nestedKey].join(".");
|
|
87533
|
-
lazy$1[nestedRouterKey] = createLazyLoader({
|
|
87534
|
-
ref: nestedItem.ref,
|
|
87535
|
-
path: lazyPath,
|
|
87536
|
-
key: nestedKey,
|
|
87537
|
-
aggregate: opts.aggregate[opts.key]
|
|
87538
|
-
});
|
|
87539
|
-
}
|
|
88950
|
+
opts.aggregate[opts.key] = step(getRouterInput(router), lazyPath);
|
|
88951
|
+
delete lazy3[lazyKey];
|
|
87540
88952
|
})
|
|
87541
88953
|
};
|
|
87542
88954
|
}
|
|
88955
|
+
const separator = config2.pathSeparator;
|
|
87543
88956
|
function step(from, path94 = []) {
|
|
87544
|
-
const aggregate =
|
|
88957
|
+
const aggregate = emptyObject();
|
|
87545
88958
|
for (const [key, item] of Object.entries(from !== null && from !== void 0 ? from : {})) {
|
|
88959
|
+
if (separator !== "." && key.includes(separator)) throw new Error(`Key "${[...path94, key].join(".")}" contains the pathSeparator ${JSON.stringify(separator)}, so its URL would be ambiguous. Rename it or pick another pathSeparator.`);
|
|
87546
88960
|
if (isLazy(item)) {
|
|
87547
|
-
|
|
88961
|
+
lazy3[[...path94, key].join(".")] = createLazyLoader({
|
|
87548
88962
|
path: path94,
|
|
87549
88963
|
ref: item,
|
|
87550
88964
|
key,
|
|
@@ -87553,7 +88967,7 @@ function createRouterFactory(config2) {
|
|
|
87553
88967
|
continue;
|
|
87554
88968
|
}
|
|
87555
88969
|
if (isRouter(item)) {
|
|
87556
|
-
aggregate[key] = step(item
|
|
88970
|
+
aggregate[key] = step(getRouterInput(item), [...path94, key]);
|
|
87557
88971
|
continue;
|
|
87558
88972
|
}
|
|
87559
88973
|
if (!isProcedure(item)) {
|
|
@@ -87568,17 +88982,16 @@ function createRouterFactory(config2) {
|
|
|
87568
88982
|
return aggregate;
|
|
87569
88983
|
}
|
|
87570
88984
|
const record2 = step(input2);
|
|
87571
|
-
const _def = (
|
|
88985
|
+
const _def = _objectSpread2(_objectSpread2({
|
|
87572
88986
|
_config: config2,
|
|
87573
88987
|
router: true,
|
|
87574
88988
|
procedures,
|
|
87575
|
-
lazy:
|
|
88989
|
+
lazy: lazy3
|
|
87576
88990
|
}, emptyRouter), {}, { record: record2 });
|
|
87577
|
-
|
|
88991
|
+
return _objectSpread2(_objectSpread2({}, record2), {}, {
|
|
87578
88992
|
_def,
|
|
87579
88993
|
createCaller: createCallerFactory()({ _def })
|
|
87580
88994
|
});
|
|
87581
|
-
return router;
|
|
87582
88995
|
}
|
|
87583
88996
|
return createRouterInner;
|
|
87584
88997
|
}
|
|
@@ -87589,10 +89002,9 @@ async function getProcedureAtPath(router, path94) {
|
|
|
87589
89002
|
const { _def } = router;
|
|
87590
89003
|
let procedure = _def.procedures[path94];
|
|
87591
89004
|
while (!procedure) {
|
|
87592
|
-
const key = Object.keys(_def.lazy).find((
|
|
89005
|
+
const key = Object.keys(_def.lazy).find((key2) => path94 === key2 || path94.startsWith(key2 + "."));
|
|
87593
89006
|
if (!key) return null;
|
|
87594
|
-
|
|
87595
|
-
await lazyRouter.load();
|
|
89007
|
+
await _def.lazy[key].load();
|
|
87596
89008
|
procedure = _def.procedures[path94];
|
|
87597
89009
|
}
|
|
87598
89010
|
return procedure;
|
|
@@ -87618,7 +89030,8 @@ function createCallerFactory() {
|
|
|
87618
89030
|
getRawInput: async () => args[0],
|
|
87619
89031
|
ctx,
|
|
87620
89032
|
type: procedure._def.type,
|
|
87621
|
-
signal: opts === null || opts === void 0 ? void 0 : opts.signal
|
|
89033
|
+
signal: opts === null || opts === void 0 ? void 0 : opts.signal,
|
|
89034
|
+
batchIndex: 0
|
|
87622
89035
|
});
|
|
87623
89036
|
} catch (cause) {
|
|
87624
89037
|
var _opts$onError, _procedure$_def$type;
|
|
@@ -87637,36 +89050,243 @@ function createCallerFactory() {
|
|
|
87637
89050
|
}
|
|
87638
89051
|
function mergeRouters(...routerList) {
|
|
87639
89052
|
var _routerList$, _routerList$2;
|
|
87640
|
-
const record2 = mergeWithoutOverrides({}, ...routerList.map((r) => r
|
|
87641
|
-
|
|
87642
|
-
|
|
87643
|
-
if (
|
|
87644
|
-
|
|
87645
|
-
|
|
87646
|
-
|
|
87647
|
-
|
|
87648
|
-
|
|
87649
|
-
|
|
87650
|
-
if (
|
|
87651
|
-
|
|
87652
|
-
|
|
87653
|
-
|
|
87654
|
-
|
|
87655
|
-
|
|
87656
|
-
|
|
87657
|
-
|
|
89053
|
+
const record2 = mergeWithoutOverrides({}, ...[...new Set(routerList)].map((r) => getRouterInput(r)));
|
|
89054
|
+
return createRouterFactory({
|
|
89055
|
+
errorFormatter: routerList.reduce((currentErrorFormatter, nextRouter) => {
|
|
89056
|
+
if (nextRouter._def._config.errorFormatter && nextRouter._def._config.errorFormatter !== defaultFormatter) {
|
|
89057
|
+
if (currentErrorFormatter !== defaultFormatter && currentErrorFormatter !== nextRouter._def._config.errorFormatter) throw new Error("You seem to have several error formatters");
|
|
89058
|
+
return nextRouter._def._config.errorFormatter;
|
|
89059
|
+
}
|
|
89060
|
+
return currentErrorFormatter;
|
|
89061
|
+
}, defaultFormatter),
|
|
89062
|
+
transformer: routerList.reduce((prev, current) => {
|
|
89063
|
+
if (current._def._config.transformer && current._def._config.transformer !== defaultTransformer) {
|
|
89064
|
+
if (prev !== defaultTransformer && prev !== current._def._config.transformer) throw new Error("You seem to have several transformers");
|
|
89065
|
+
return current._def._config.transformer;
|
|
89066
|
+
}
|
|
89067
|
+
return prev;
|
|
89068
|
+
}, defaultTransformer),
|
|
89069
|
+
pathSeparator: routerList.reduce((prev, current) => {
|
|
89070
|
+
const next = current._def._config.pathSeparator;
|
|
89071
|
+
if (next === ".") return prev;
|
|
89072
|
+
if (prev !== "." && prev !== next) throw new Error("You seem to have several pathSeparators");
|
|
89073
|
+
return next;
|
|
89074
|
+
}, "."),
|
|
87658
89075
|
isDev: routerList.every((r) => r._def._config.isDev),
|
|
87659
89076
|
allowOutsideOfServer: routerList.every((r) => r._def._config.allowOutsideOfServer),
|
|
87660
89077
|
isServer: routerList.every((r) => r._def._config.isServer),
|
|
87661
89078
|
$types: (_routerList$ = routerList[0]) === null || _routerList$ === void 0 ? void 0 : _routerList$._def._config.$types,
|
|
87662
89079
|
sse: (_routerList$2 = routerList[0]) === null || _routerList$2 === void 0 ? void 0 : _routerList$2._def._config.sse
|
|
87663
89080
|
})(record2);
|
|
87664
|
-
|
|
89081
|
+
}
|
|
89082
|
+
function resolvePathSeparator(value2) {
|
|
89083
|
+
return value2 !== null && value2 !== void 0 ? value2 : ".";
|
|
89084
|
+
}
|
|
89085
|
+
function _OverloadYield(e, d) {
|
|
89086
|
+
this.v = e, this.k = d;
|
|
89087
|
+
}
|
|
89088
|
+
function _wrapAsyncGenerator(e) {
|
|
89089
|
+
return function() {
|
|
89090
|
+
return new AsyncGenerator(e.apply(this, arguments));
|
|
89091
|
+
};
|
|
89092
|
+
}
|
|
89093
|
+
function AsyncGenerator(e) {
|
|
89094
|
+
var r, t;
|
|
89095
|
+
function resume(r2, t2) {
|
|
89096
|
+
try {
|
|
89097
|
+
var n = e[r2](t2), o = n.value, u = o instanceof _OverloadYield;
|
|
89098
|
+
Promise.resolve(u ? o.v : o).then(function(t3) {
|
|
89099
|
+
if (u) {
|
|
89100
|
+
var i = "return" === r2 ? "return" : "next";
|
|
89101
|
+
if (!o.k || t3.done) return resume(i, t3);
|
|
89102
|
+
t3 = e[i](t3).value;
|
|
89103
|
+
}
|
|
89104
|
+
settle2(n.done ? "return" : "normal", t3);
|
|
89105
|
+
}, function(e2) {
|
|
89106
|
+
resume("throw", e2);
|
|
89107
|
+
});
|
|
89108
|
+
} catch (e2) {
|
|
89109
|
+
settle2("throw", e2);
|
|
89110
|
+
}
|
|
89111
|
+
}
|
|
89112
|
+
function settle2(e2, n) {
|
|
89113
|
+
switch (e2) {
|
|
89114
|
+
case "return":
|
|
89115
|
+
r.resolve({
|
|
89116
|
+
value: n,
|
|
89117
|
+
done: true
|
|
89118
|
+
});
|
|
89119
|
+
break;
|
|
89120
|
+
case "throw":
|
|
89121
|
+
r.reject(n);
|
|
89122
|
+
break;
|
|
89123
|
+
default:
|
|
89124
|
+
r.resolve({
|
|
89125
|
+
value: n,
|
|
89126
|
+
done: false
|
|
89127
|
+
});
|
|
89128
|
+
}
|
|
89129
|
+
(r = r.next) ? resume(r.key, r.arg) : t = null;
|
|
89130
|
+
}
|
|
89131
|
+
this._invoke = function(e2, n) {
|
|
89132
|
+
return new Promise(function(o, u) {
|
|
89133
|
+
var i = {
|
|
89134
|
+
key: e2,
|
|
89135
|
+
arg: n,
|
|
89136
|
+
resolve: o,
|
|
89137
|
+
reject: u,
|
|
89138
|
+
next: null
|
|
89139
|
+
};
|
|
89140
|
+
t ? t = t.next = i : (r = t = i, resume(e2, n));
|
|
89141
|
+
});
|
|
89142
|
+
}, "function" != typeof e["return"] && (this["return"] = void 0);
|
|
89143
|
+
}
|
|
89144
|
+
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
89145
|
+
return this;
|
|
89146
|
+
}, AsyncGenerator.prototype.next = function(e) {
|
|
89147
|
+
return this._invoke("next", e);
|
|
89148
|
+
}, AsyncGenerator.prototype["throw"] = function(e) {
|
|
89149
|
+
return this._invoke("throw", e);
|
|
89150
|
+
}, AsyncGenerator.prototype["return"] = function(e) {
|
|
89151
|
+
return this._invoke("return", e);
|
|
89152
|
+
};
|
|
89153
|
+
function _asyncIterator(r) {
|
|
89154
|
+
var n, t, o, e = 2;
|
|
89155
|
+
for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--; ) {
|
|
89156
|
+
if (t && null != (n = r[t])) return n.call(r);
|
|
89157
|
+
if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));
|
|
89158
|
+
t = "@@asyncIterator", o = "@@iterator";
|
|
89159
|
+
}
|
|
89160
|
+
throw new TypeError("Object is not async iterable");
|
|
89161
|
+
}
|
|
89162
|
+
function AsyncFromSyncIterator(r) {
|
|
89163
|
+
function AsyncFromSyncIteratorContinuation(r2) {
|
|
89164
|
+
if (Object(r2) !== r2) return Promise.reject(/* @__PURE__ */ new TypeError(r2 + " is not an object."));
|
|
89165
|
+
var n = r2.done;
|
|
89166
|
+
return Promise.resolve(r2.value).then(function(r3) {
|
|
89167
|
+
return {
|
|
89168
|
+
value: r3,
|
|
89169
|
+
done: n
|
|
89170
|
+
};
|
|
89171
|
+
});
|
|
89172
|
+
}
|
|
89173
|
+
return AsyncFromSyncIterator = function AsyncFromSyncIterator2(r2) {
|
|
89174
|
+
this.s = r2, this.n = r2.next;
|
|
89175
|
+
}, AsyncFromSyncIterator.prototype = {
|
|
89176
|
+
s: null,
|
|
89177
|
+
n: null,
|
|
89178
|
+
next: function next() {
|
|
89179
|
+
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
89180
|
+
},
|
|
89181
|
+
"return": function _return(r2) {
|
|
89182
|
+
var n = this.s["return"];
|
|
89183
|
+
return void 0 === n ? Promise.resolve({
|
|
89184
|
+
value: r2,
|
|
89185
|
+
done: true
|
|
89186
|
+
}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
89187
|
+
},
|
|
89188
|
+
"throw": function _throw(r2) {
|
|
89189
|
+
var n = this.s["return"];
|
|
89190
|
+
return void 0 === n ? Promise.reject(r2) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
89191
|
+
}
|
|
89192
|
+
}, new AsyncFromSyncIterator(r);
|
|
87665
89193
|
}
|
|
87666
89194
|
var trackedSymbol = Symbol();
|
|
89195
|
+
function _asyncGeneratorDelegate(t) {
|
|
89196
|
+
var e = {}, n = false;
|
|
89197
|
+
function pump(e2, r) {
|
|
89198
|
+
return n = true, r = new Promise(function(n2) {
|
|
89199
|
+
n2(t[e2](r));
|
|
89200
|
+
}), {
|
|
89201
|
+
done: false,
|
|
89202
|
+
value: new _OverloadYield(r, 1)
|
|
89203
|
+
};
|
|
89204
|
+
}
|
|
89205
|
+
return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function() {
|
|
89206
|
+
return this;
|
|
89207
|
+
}, e.next = function(t2) {
|
|
89208
|
+
return n ? (n = false, t2) : pump("next", t2);
|
|
89209
|
+
}, "function" == typeof t["throw"] && (e["throw"] = function(t2) {
|
|
89210
|
+
if (n) throw n = false, t2;
|
|
89211
|
+
return pump("throw", t2);
|
|
89212
|
+
}), "function" == typeof t["return"] && (e["return"] = function(t2) {
|
|
89213
|
+
return n ? (n = false, t2) : pump("return", t2);
|
|
89214
|
+
}), e;
|
|
89215
|
+
}
|
|
89216
|
+
|
|
89217
|
+
// ../../node_modules/@trpc/server/dist/observable-kpFFzvou.mjs
|
|
89218
|
+
function isObservable(x) {
|
|
89219
|
+
return typeof x === "object" && x !== null && "subscribe" in x;
|
|
89220
|
+
}
|
|
89221
|
+
function observable(subscribe) {
|
|
89222
|
+
const self = {
|
|
89223
|
+
subscribe(observer) {
|
|
89224
|
+
let teardownRef = null;
|
|
89225
|
+
let isDone = false;
|
|
89226
|
+
let unsubscribed = false;
|
|
89227
|
+
let teardownImmediately = false;
|
|
89228
|
+
let subscribing = true;
|
|
89229
|
+
let thrownWhileSubscribing = null;
|
|
89230
|
+
function end(notify) {
|
|
89231
|
+
try {
|
|
89232
|
+
notify();
|
|
89233
|
+
} catch (cause) {
|
|
89234
|
+
var _thrownWhileSubscribi;
|
|
89235
|
+
if (!subscribing) throw cause;
|
|
89236
|
+
(_thrownWhileSubscribi = thrownWhileSubscribing) !== null && _thrownWhileSubscribi !== void 0 || (thrownWhileSubscribing = { cause });
|
|
89237
|
+
} finally {
|
|
89238
|
+
unsubscribe();
|
|
89239
|
+
}
|
|
89240
|
+
}
|
|
89241
|
+
function unsubscribe() {
|
|
89242
|
+
if (teardownRef === null) {
|
|
89243
|
+
teardownImmediately = true;
|
|
89244
|
+
return;
|
|
89245
|
+
}
|
|
89246
|
+
if (unsubscribed) return;
|
|
89247
|
+
unsubscribed = true;
|
|
89248
|
+
if (typeof teardownRef === "function") teardownRef();
|
|
89249
|
+
else if (teardownRef) teardownRef.unsubscribe();
|
|
89250
|
+
}
|
|
89251
|
+
teardownRef = subscribe({
|
|
89252
|
+
next(value2) {
|
|
89253
|
+
var _observer$next;
|
|
89254
|
+
if (isDone) return;
|
|
89255
|
+
(_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value2);
|
|
89256
|
+
},
|
|
89257
|
+
error(err2) {
|
|
89258
|
+
if (isDone) return;
|
|
89259
|
+
isDone = true;
|
|
89260
|
+
end(() => {
|
|
89261
|
+
var _observer$error;
|
|
89262
|
+
return (_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, err2);
|
|
89263
|
+
});
|
|
89264
|
+
},
|
|
89265
|
+
complete() {
|
|
89266
|
+
if (isDone) return;
|
|
89267
|
+
isDone = true;
|
|
89268
|
+
end(() => {
|
|
89269
|
+
var _observer$complete;
|
|
89270
|
+
return (_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
89271
|
+
});
|
|
89272
|
+
}
|
|
89273
|
+
});
|
|
89274
|
+
subscribing = false;
|
|
89275
|
+
if (teardownImmediately) unsubscribe();
|
|
89276
|
+
if (thrownWhileSubscribing) throw thrownWhileSubscribing.cause;
|
|
89277
|
+
return { unsubscribe };
|
|
89278
|
+
},
|
|
89279
|
+
pipe(...operations) {
|
|
89280
|
+
return operations.reduce(pipeReducer, self);
|
|
89281
|
+
}
|
|
89282
|
+
};
|
|
89283
|
+
return self;
|
|
89284
|
+
}
|
|
89285
|
+
function pipeReducer(prev, fn) {
|
|
89286
|
+
return fn(prev);
|
|
89287
|
+
}
|
|
87667
89288
|
|
|
87668
|
-
// ../../node_modules/@trpc/server/dist/initTRPC-
|
|
87669
|
-
var import_objectSpread2$2 = __toESM2(require_objectSpread2(), 1);
|
|
89289
|
+
// ../../node_modules/@trpc/server/dist/initTRPC-DPoVGUwX.mjs
|
|
87670
89290
|
var middlewareMarker = "middlewareMarker";
|
|
87671
89291
|
function createMiddlewareFactory() {
|
|
87672
89292
|
function createMiddlewareInner(middlewares) {
|
|
@@ -87683,31 +89303,86 @@ function createMiddlewareFactory() {
|
|
|
87683
89303
|
}
|
|
87684
89304
|
return createMiddleware;
|
|
87685
89305
|
}
|
|
87686
|
-
function createInputMiddleware(
|
|
89306
|
+
function createInputMiddleware(parse7) {
|
|
87687
89307
|
const inputMiddleware = async function inputValidatorMiddleware(opts) {
|
|
87688
89308
|
let parsedInput;
|
|
87689
89309
|
const rawInput = await opts.getRawInput();
|
|
87690
89310
|
try {
|
|
87691
|
-
parsedInput = await
|
|
89311
|
+
parsedInput = await parse7(rawInput);
|
|
87692
89312
|
} catch (cause) {
|
|
87693
89313
|
throw new TRPCError({
|
|
87694
89314
|
code: "BAD_REQUEST",
|
|
87695
89315
|
cause
|
|
87696
89316
|
});
|
|
87697
89317
|
}
|
|
87698
|
-
const combinedInput = isObject7(opts.input) && isObject7(parsedInput) ? (
|
|
89318
|
+
const combinedInput = isObject7(opts.input) && isObject7(parsedInput) ? _objectSpread2(_objectSpread2({}, opts.input), parsedInput) : parsedInput;
|
|
87699
89319
|
return opts.next({ input: combinedInput });
|
|
87700
89320
|
};
|
|
87701
89321
|
inputMiddleware._type = "input";
|
|
87702
89322
|
return inputMiddleware;
|
|
87703
89323
|
}
|
|
87704
|
-
function
|
|
89324
|
+
function createErrorFormatterMiddleware(formatter, isDev) {
|
|
89325
|
+
const errorMiddleware = async function errorFormatterMiddleware(opts) {
|
|
89326
|
+
const tryFormat = (error62) => {
|
|
89327
|
+
if (isFormattedErrorShape(error62)) return error62;
|
|
89328
|
+
const shape = formatter({
|
|
89329
|
+
error: error62,
|
|
89330
|
+
type: opts.type,
|
|
89331
|
+
path: opts.path,
|
|
89332
|
+
input: opts.input,
|
|
89333
|
+
ctx: opts.ctx,
|
|
89334
|
+
shape: getDefaultErrorShape({
|
|
89335
|
+
error: error62,
|
|
89336
|
+
path: opts.path,
|
|
89337
|
+
isDev
|
|
89338
|
+
})
|
|
89339
|
+
});
|
|
89340
|
+
if (shape !== void 0) setFormattedErrorShape(error62, shape);
|
|
89341
|
+
return error62;
|
|
89342
|
+
};
|
|
89343
|
+
const tryFormatThrown = (cause) => {
|
|
89344
|
+
const formatted = tryFormat(getTRPCErrorFromUnknown(cause));
|
|
89345
|
+
return isFormattedErrorShape(formatted) ? formatted : cause;
|
|
89346
|
+
};
|
|
89347
|
+
function wrapIterable(_x) {
|
|
89348
|
+
return _wrapIterable.apply(this, arguments);
|
|
89349
|
+
}
|
|
89350
|
+
function _wrapIterable() {
|
|
89351
|
+
_wrapIterable = _wrapAsyncGenerator(function* (iterable) {
|
|
89352
|
+
try {
|
|
89353
|
+
return yield* _asyncGeneratorDelegate(_asyncIterator(iterable));
|
|
89354
|
+
} catch (cause) {
|
|
89355
|
+
throw tryFormatThrown(cause);
|
|
89356
|
+
}
|
|
89357
|
+
});
|
|
89358
|
+
return _wrapIterable.apply(this, arguments);
|
|
89359
|
+
}
|
|
89360
|
+
function wrapObservable(source) {
|
|
89361
|
+
return observable((observer) => source.subscribe({
|
|
89362
|
+
next: (value2) => observer.next(value2),
|
|
89363
|
+
error: (cause) => observer.error(tryFormatThrown(cause)),
|
|
89364
|
+
complete: () => observer.complete()
|
|
89365
|
+
}));
|
|
89366
|
+
}
|
|
89367
|
+
const result = await opts.next();
|
|
89368
|
+
if (!result.ok) {
|
|
89369
|
+
tryFormat(result.error);
|
|
89370
|
+
return result;
|
|
89371
|
+
}
|
|
89372
|
+
if (isAsyncIterable(result.data)) return _objectSpread2(_objectSpread2({}, result), {}, { data: wrapIterable(result.data) });
|
|
89373
|
+
if (opts.type === "subscription" && isObservable(result.data)) return _objectSpread2(_objectSpread2({}, result), {}, { data: wrapObservable(result.data) });
|
|
89374
|
+
return result;
|
|
89375
|
+
};
|
|
89376
|
+
errorMiddleware._type = "errors";
|
|
89377
|
+
return errorMiddleware;
|
|
89378
|
+
}
|
|
89379
|
+
function createOutputMiddleware(parse7) {
|
|
87705
89380
|
const outputMiddleware = async function outputValidatorMiddleware({ next }) {
|
|
87706
89381
|
const result = await next();
|
|
87707
89382
|
if (!result.ok) return result;
|
|
87708
89383
|
try {
|
|
87709
|
-
const data = await
|
|
87710
|
-
return (
|
|
89384
|
+
const data = await parse7(result.data);
|
|
89385
|
+
return _objectSpread2(_objectSpread2({}, result), {}, { data });
|
|
87711
89386
|
} catch (cause) {
|
|
87712
89387
|
throw new TRPCError({
|
|
87713
89388
|
message: "Output validation failed",
|
|
@@ -87719,7 +89394,6 @@ function createOutputMiddleware(parse8) {
|
|
|
87719
89394
|
outputMiddleware._type = "output";
|
|
87720
89395
|
return outputMiddleware;
|
|
87721
89396
|
}
|
|
87722
|
-
var import_defineProperty2 = __toESM2(require_defineProperty(), 1);
|
|
87723
89397
|
var StandardSchemaV1Error = class extends Error {
|
|
87724
89398
|
/**
|
|
87725
89399
|
* Creates a schema error with useful information.
|
|
@@ -87729,7 +89403,7 @@ var StandardSchemaV1Error = class extends Error {
|
|
|
87729
89403
|
constructor(issues) {
|
|
87730
89404
|
var _issues$;
|
|
87731
89405
|
super((_issues$ = issues[0]) === null || _issues$ === void 0 ? void 0 : _issues$.message);
|
|
87732
|
-
(
|
|
89406
|
+
_defineProperty(this, "issues", void 0);
|
|
87733
89407
|
this.name = "SchemaError";
|
|
87734
89408
|
this.issues = issues;
|
|
87735
89409
|
}
|
|
@@ -87739,7 +89413,21 @@ function getParseFn(procedureParser) {
|
|
|
87739
89413
|
const isStandardSchema = "~standard" in parser;
|
|
87740
89414
|
if (typeof parser === "function" && typeof parser.assert === "function") return parser.assert.bind(parser);
|
|
87741
89415
|
if (typeof parser === "function" && !isStandardSchema) return parser;
|
|
87742
|
-
if (typeof parser.parseAsync === "function")
|
|
89416
|
+
if (typeof parser.parseAsync === "function") {
|
|
89417
|
+
if (typeof parser.parse !== "function") return parser.parseAsync.bind(parser);
|
|
89418
|
+
const parse7 = parser.parse.bind(parser);
|
|
89419
|
+
const parseAsync3 = parser.parseAsync.bind(parser);
|
|
89420
|
+
let isAsync = false;
|
|
89421
|
+
return (value2) => {
|
|
89422
|
+
if (!isAsync) try {
|
|
89423
|
+
return parse7(value2);
|
|
89424
|
+
} catch (cause) {
|
|
89425
|
+
if (Array.isArray(cause === null || cause === void 0 ? void 0 : cause.issues)) throw cause;
|
|
89426
|
+
isAsync = true;
|
|
89427
|
+
}
|
|
89428
|
+
return parseAsync3(value2);
|
|
89429
|
+
};
|
|
89430
|
+
}
|
|
87743
89431
|
if (typeof parser.parse === "function") return parser.parse.bind(parser);
|
|
87744
89432
|
if (typeof parser.validateSync === "function") return parser.validateSync.bind(parser);
|
|
87745
89433
|
if (typeof parser.create === "function") return parser.create.bind(parser);
|
|
@@ -87754,53 +89442,55 @@ function getParseFn(procedureParser) {
|
|
|
87754
89442
|
};
|
|
87755
89443
|
throw new Error("Could not find a validator fn");
|
|
87756
89444
|
}
|
|
87757
|
-
var
|
|
87758
|
-
|
|
87759
|
-
|
|
87760
|
-
|
|
87761
|
-
|
|
87762
|
-
|
|
87763
|
-
|
|
87764
|
-
|
|
87765
|
-
|
|
87766
|
-
}
|
|
87767
|
-
|
|
87768
|
-
}
|
|
87769
|
-
|
|
87770
|
-
|
|
87771
|
-
|
|
87772
|
-
|
|
87773
|
-
|
|
87774
|
-
|
|
87775
|
-
|
|
87776
|
-
|
|
87777
|
-
|
|
87778
|
-
|
|
87779
|
-
|
|
87780
|
-
|
|
87781
|
-
|
|
87782
|
-
|
|
87783
|
-
var import_objectSpread2$12 = __toESM2(require_objectSpread2(), 1);
|
|
89445
|
+
var _globalThis$process;
|
|
89446
|
+
var _globalThis$process2;
|
|
89447
|
+
var _globalThis$process3;
|
|
89448
|
+
var isServerDefault = typeof window === "undefined" || "Deno" in window || ((_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.env) === null || _globalThis$process === void 0 ? void 0 : _globalThis$process["NODE_ENV"]) === "test" || !!((_globalThis$process2 = globalThis.process) === null || _globalThis$process2 === void 0 || (_globalThis$process2 = _globalThis$process2.env) === null || _globalThis$process2 === void 0 ? void 0 : _globalThis$process2["JEST_WORKER_ID"]) || !!((_globalThis$process3 = globalThis.process) === null || _globalThis$process3 === void 0 || (_globalThis$process3 = _globalThis$process3.env) === null || _globalThis$process3 === void 0 ? void 0 : _globalThis$process3["VITEST_WORKER_ID"]);
|
|
89449
|
+
function isDevDefault() {
|
|
89450
|
+
var _globalThis$process4;
|
|
89451
|
+
return ((_globalThis$process4 = globalThis.process) === null || _globalThis$process4 === void 0 ? void 0 : _globalThis$process4.env["NODE_ENV"]) !== "production";
|
|
89452
|
+
}
|
|
89453
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
89454
|
+
if (null == r) return {};
|
|
89455
|
+
var t = {};
|
|
89456
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
89457
|
+
if (e.includes(n)) continue;
|
|
89458
|
+
t[n] = r[n];
|
|
89459
|
+
}
|
|
89460
|
+
return t;
|
|
89461
|
+
}
|
|
89462
|
+
function _objectWithoutProperties(e, t) {
|
|
89463
|
+
if (null == e) return {};
|
|
89464
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
89465
|
+
if (Object.getOwnPropertySymbols) {
|
|
89466
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
89467
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
89468
|
+
}
|
|
89469
|
+
return i;
|
|
89470
|
+
}
|
|
87784
89471
|
var _excluded = [
|
|
87785
89472
|
"middlewares",
|
|
87786
89473
|
"inputs",
|
|
87787
|
-
"meta"
|
|
89474
|
+
"meta",
|
|
89475
|
+
"config"
|
|
87788
89476
|
];
|
|
87789
89477
|
function createNewBuilder(def1, def2) {
|
|
87790
|
-
|
|
87791
|
-
|
|
89478
|
+
var _def1$config;
|
|
89479
|
+
const { middlewares = [], inputs, meta: meta3, config: config2 } = def2, rest = _objectWithoutProperties(def2, _excluded);
|
|
89480
|
+
return createBuilder(_objectSpread2(_objectSpread2({}, mergeWithoutOverrides(def1, rest)), {}, {
|
|
89481
|
+
config: (_def1$config = def1.config) !== null && _def1$config !== void 0 ? _def1$config : config2,
|
|
87792
89482
|
inputs: [...def1.inputs, ...inputs !== null && inputs !== void 0 ? inputs : []],
|
|
87793
89483
|
middlewares: [...def1.middlewares, ...middlewares],
|
|
87794
|
-
meta: def1.meta && meta3 ? (
|
|
89484
|
+
meta: def1.meta && meta3 ? _objectSpread2(_objectSpread2({}, def1.meta), meta3) : meta3 !== null && meta3 !== void 0 ? meta3 : def1.meta
|
|
87795
89485
|
}));
|
|
87796
89486
|
}
|
|
87797
89487
|
function createBuilder(initDef = {}) {
|
|
87798
|
-
const _def = (
|
|
89488
|
+
const _def = _objectSpread2({
|
|
87799
89489
|
procedure: true,
|
|
87800
89490
|
inputs: [],
|
|
87801
89491
|
middlewares: []
|
|
87802
89492
|
}, initDef);
|
|
87803
|
-
|
|
89493
|
+
return {
|
|
87804
89494
|
_def,
|
|
87805
89495
|
input(input2) {
|
|
87806
89496
|
const parser = getParseFn(input2);
|
|
@@ -87819,30 +89509,33 @@ function createBuilder(initDef = {}) {
|
|
|
87819
89509
|
meta(meta3) {
|
|
87820
89510
|
return createNewBuilder(_def, { meta: meta3 });
|
|
87821
89511
|
},
|
|
89512
|
+
errors(formatter) {
|
|
89513
|
+
var _def$config$isDev, _def$config;
|
|
89514
|
+
return createNewBuilder(_def, { middlewares: [createErrorFormatterMiddleware(formatter, (_def$config$isDev = (_def$config = _def.config) === null || _def$config === void 0 ? void 0 : _def$config.isDev) !== null && _def$config$isDev !== void 0 ? _def$config$isDev : isDevDefault())] });
|
|
89515
|
+
},
|
|
87822
89516
|
use(middlewareBuilderOrFn) {
|
|
87823
89517
|
const middlewares = "_middlewares" in middlewareBuilderOrFn ? middlewareBuilderOrFn._middlewares : [middlewareBuilderOrFn];
|
|
87824
89518
|
return createNewBuilder(_def, { middlewares });
|
|
87825
89519
|
},
|
|
87826
|
-
unstable_concat(builder
|
|
87827
|
-
return createNewBuilder(_def, builder
|
|
89520
|
+
unstable_concat(builder) {
|
|
89521
|
+
return createNewBuilder(_def, builder._def);
|
|
87828
89522
|
},
|
|
87829
|
-
concat(builder
|
|
87830
|
-
return createNewBuilder(_def, builder
|
|
89523
|
+
concat(builder) {
|
|
89524
|
+
return createNewBuilder(_def, builder._def);
|
|
87831
89525
|
},
|
|
87832
89526
|
query(resolver) {
|
|
87833
|
-
return createResolver((
|
|
89527
|
+
return createResolver(_objectSpread2(_objectSpread2({}, _def), {}, { type: "query" }), resolver);
|
|
87834
89528
|
},
|
|
87835
89529
|
mutation(resolver) {
|
|
87836
|
-
return createResolver((
|
|
89530
|
+
return createResolver(_objectSpread2(_objectSpread2({}, _def), {}, { type: "mutation" }), resolver);
|
|
87837
89531
|
},
|
|
87838
89532
|
subscription(resolver) {
|
|
87839
|
-
return createResolver((
|
|
89533
|
+
return createResolver(_objectSpread2(_objectSpread2({}, _def), {}, { type: "subscription" }), resolver);
|
|
87840
89534
|
},
|
|
87841
89535
|
experimental_caller(caller) {
|
|
87842
89536
|
return createNewBuilder(_def, { caller });
|
|
87843
89537
|
}
|
|
87844
89538
|
};
|
|
87845
|
-
return builder;
|
|
87846
89539
|
}
|
|
87847
89540
|
function createResolver(_defIn, resolver) {
|
|
87848
89541
|
const finalBuilder = createNewBuilder(_defIn, {
|
|
@@ -87857,7 +89550,7 @@ function createResolver(_defIn, resolver) {
|
|
|
87857
89550
|
};
|
|
87858
89551
|
}]
|
|
87859
89552
|
});
|
|
87860
|
-
const _def = (
|
|
89553
|
+
const _def = _objectSpread2(_objectSpread2({}, finalBuilder._def), {}, {
|
|
87861
89554
|
type: _defIn.type,
|
|
87862
89555
|
experimental_caller: Boolean(finalBuilder._def.caller),
|
|
87863
89556
|
meta: finalBuilder._def.meta,
|
|
@@ -87878,25 +89571,24 @@ function createResolver(_defIn, resolver) {
|
|
|
87878
89571
|
}
|
|
87879
89572
|
var codeblock = `
|
|
87880
89573
|
This is a client-only function.
|
|
87881
|
-
If you want to call this function on the server, see https://trpc.io/docs/
|
|
89574
|
+
If you want to call this function on the server, see https://trpc.io/docs/server/server-side-calls
|
|
87882
89575
|
`.trim();
|
|
87883
89576
|
async function callRecursive(index, _def, opts) {
|
|
87884
89577
|
try {
|
|
87885
89578
|
const middleware = _def.middlewares[index];
|
|
87886
|
-
|
|
89579
|
+
return await middleware(_objectSpread2(_objectSpread2({}, opts), {}, {
|
|
87887
89580
|
meta: _def.meta,
|
|
87888
89581
|
input: opts.input,
|
|
87889
89582
|
next(_nextOpts) {
|
|
87890
89583
|
var _nextOpts$getRawInput;
|
|
87891
89584
|
const nextOpts = _nextOpts;
|
|
87892
|
-
return callRecursive(index + 1, _def, (
|
|
87893
|
-
ctx: (nextOpts === null || nextOpts === void 0 ? void 0 : nextOpts.ctx) ? (
|
|
89585
|
+
return callRecursive(index + 1, _def, _objectSpread2(_objectSpread2({}, opts), {}, {
|
|
89586
|
+
ctx: (nextOpts === null || nextOpts === void 0 ? void 0 : nextOpts.ctx) ? _objectSpread2(_objectSpread2({}, opts.ctx), nextOpts.ctx) : opts.ctx,
|
|
87894
89587
|
input: nextOpts && "input" in nextOpts ? nextOpts.input : opts.input,
|
|
87895
89588
|
getRawInput: (_nextOpts$getRawInput = nextOpts === null || nextOpts === void 0 ? void 0 : nextOpts.getRawInput) !== null && _nextOpts$getRawInput !== void 0 ? _nextOpts$getRawInput : opts.getRawInput
|
|
87896
89589
|
}));
|
|
87897
89590
|
}
|
|
87898
89591
|
}));
|
|
87899
|
-
return result;
|
|
87900
89592
|
} catch (cause) {
|
|
87901
89593
|
return {
|
|
87902
89594
|
ok: false,
|
|
@@ -87921,56 +89613,81 @@ function createProcedureCaller(_def) {
|
|
|
87921
89613
|
procedure.meta = _def.meta;
|
|
87922
89614
|
return procedure;
|
|
87923
89615
|
}
|
|
87924
|
-
var
|
|
87925
|
-
var _globalThis$process2;
|
|
87926
|
-
var _globalThis$process3;
|
|
87927
|
-
var isServerDefault = typeof window === "undefined" || "Deno" in window || ((_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.env) === null || _globalThis$process === void 0 ? void 0 : _globalThis$process["NODE_ENV"]) === "test" || !!((_globalThis$process2 = globalThis.process) === null || _globalThis$process2 === void 0 || (_globalThis$process2 = _globalThis$process2.env) === null || _globalThis$process2 === void 0 ? void 0 : _globalThis$process2["JEST_WORKER_ID"]) || !!((_globalThis$process3 = globalThis.process) === null || _globalThis$process3 === void 0 || (_globalThis$process3 = _globalThis$process3.env) === null || _globalThis$process3 === void 0 ? void 0 : _globalThis$process3["VITEST_WORKER_ID"]);
|
|
87928
|
-
var import_objectSpread23 = __toESM2(require_objectSpread2(), 1);
|
|
87929
|
-
var TRPCBuilder = class TRPCBuilder2 {
|
|
89616
|
+
var initTRPC = new class TRPCBuilder {
|
|
87930
89617
|
/**
|
|
87931
|
-
*
|
|
87932
|
-
*
|
|
89618
|
+
* Sets the type of the context every procedure gets. Pass the type, or
|
|
89619
|
+
* the type of your `createContext` function.
|
|
89620
|
+
* @see https://trpc.io/docs/server/context#defining-the-context-type
|
|
87933
89621
|
*/
|
|
87934
89622
|
context() {
|
|
87935
|
-
return new
|
|
89623
|
+
return new TRPCBuilder();
|
|
87936
89624
|
}
|
|
87937
89625
|
/**
|
|
87938
|
-
*
|
|
87939
|
-
* @see https://trpc.io/docs/
|
|
89626
|
+
* Sets the type of the metadata procedures can set with `.meta()`.
|
|
89627
|
+
* @see https://trpc.io/docs/server/metadata
|
|
87940
89628
|
*/
|
|
87941
89629
|
meta() {
|
|
87942
|
-
return new
|
|
89630
|
+
return new TRPCBuilder();
|
|
87943
89631
|
}
|
|
87944
89632
|
/**
|
|
87945
|
-
*
|
|
87946
|
-
*
|
|
89633
|
+
* Creates the root object, which holds the builders for your procedures,
|
|
89634
|
+
* middlewares and routers.
|
|
89635
|
+
* @see https://trpc.io/docs/server/routers#initialize-trpc
|
|
87947
89636
|
*/
|
|
87948
89637
|
create(opts) {
|
|
87949
|
-
var _opts$transformer, _opts$isDev,
|
|
87950
|
-
const config2 = (
|
|
89638
|
+
var _opts$transformer, _opts$isDev, _opts$allowOutsideOfS, _opts$errorFormatter, _opts$isServer;
|
|
89639
|
+
const config2 = _objectSpread2(_objectSpread2({}, opts), {}, {
|
|
87951
89640
|
transformer: getDataTransformer((_opts$transformer = opts === null || opts === void 0 ? void 0 : opts.transformer) !== null && _opts$transformer !== void 0 ? _opts$transformer : defaultTransformer),
|
|
87952
|
-
isDev: (_opts$isDev = opts === null || opts === void 0 ? void 0 : opts.isDev) !== null && _opts$isDev !== void 0 ? _opts$isDev : (
|
|
89641
|
+
isDev: (_opts$isDev = opts === null || opts === void 0 ? void 0 : opts.isDev) !== null && _opts$isDev !== void 0 ? _opts$isDev : isDevDefault(),
|
|
87953
89642
|
allowOutsideOfServer: (_opts$allowOutsideOfS = opts === null || opts === void 0 ? void 0 : opts.allowOutsideOfServer) !== null && _opts$allowOutsideOfS !== void 0 ? _opts$allowOutsideOfS : false,
|
|
87954
89643
|
errorFormatter: (_opts$errorFormatter = opts === null || opts === void 0 ? void 0 : opts.errorFormatter) !== null && _opts$errorFormatter !== void 0 ? _opts$errorFormatter : defaultFormatter,
|
|
87955
89644
|
isServer: (_opts$isServer = opts === null || opts === void 0 ? void 0 : opts.isServer) !== null && _opts$isServer !== void 0 ? _opts$isServer : isServerDefault,
|
|
89645
|
+
pathSeparator: resolvePathSeparator(opts === null || opts === void 0 ? void 0 : opts.pathSeparator),
|
|
89646
|
+
/**
|
|
89647
|
+
* These are just types, they can't be used at runtime
|
|
89648
|
+
* @internal
|
|
89649
|
+
*/
|
|
87956
89650
|
$types: null
|
|
87957
89651
|
});
|
|
87958
|
-
|
|
87959
|
-
|
|
87960
|
-
const isServer = (_opts$isServer2 = opts === null || opts === void 0 ? void 0 : opts.isServer) !== null && _opts$isServer2 !== void 0 ? _opts$isServer2 : isServerDefault;
|
|
87961
|
-
if (!isServer && (opts === null || opts === void 0 ? void 0 : opts.allowOutsideOfServer) !== true) throw new Error(`You're trying to use @trpc/server in a non-server environment. This is not supported by default.`);
|
|
87962
|
-
}
|
|
89652
|
+
var _opts$isServer2;
|
|
89653
|
+
if (!((_opts$isServer2 = opts === null || opts === void 0 ? void 0 : opts.isServer) !== null && _opts$isServer2 !== void 0 ? _opts$isServer2 : isServerDefault) && (opts === null || opts === void 0 ? void 0 : opts.allowOutsideOfServer) !== true) throw new Error(`You're trying to use @trpc/server in a non-server environment. This is not supported by default.`);
|
|
87963
89654
|
return {
|
|
89655
|
+
/**
|
|
89656
|
+
* Your router config
|
|
89657
|
+
* @internal
|
|
89658
|
+
*/
|
|
87964
89659
|
_config: config2,
|
|
87965
|
-
|
|
89660
|
+
/**
|
|
89661
|
+
* Builder object for creating procedures
|
|
89662
|
+
* @see https://trpc.io/docs/server/procedures
|
|
89663
|
+
*/
|
|
89664
|
+
procedure: createBuilder({
|
|
89665
|
+
meta: opts === null || opts === void 0 ? void 0 : opts.defaultMeta,
|
|
89666
|
+
config: config2
|
|
89667
|
+
}),
|
|
89668
|
+
/**
|
|
89669
|
+
* Create reusable middlewares
|
|
89670
|
+
* @see https://trpc.io/docs/server/middlewares
|
|
89671
|
+
*/
|
|
87966
89672
|
middleware: createMiddlewareFactory(),
|
|
89673
|
+
/**
|
|
89674
|
+
* Create a router
|
|
89675
|
+
* @see https://trpc.io/docs/server/routers
|
|
89676
|
+
*/
|
|
87967
89677
|
router: createRouterFactory(config2),
|
|
89678
|
+
/**
|
|
89679
|
+
* Merge Routers
|
|
89680
|
+
* @see https://trpc.io/docs/server/merging-routers
|
|
89681
|
+
*/
|
|
87968
89682
|
mergeRouters,
|
|
89683
|
+
/**
|
|
89684
|
+
* Create a server-side caller for a router
|
|
89685
|
+
* @see https://trpc.io/docs/server/server-side-calls
|
|
89686
|
+
*/
|
|
87969
89687
|
createCallerFactory: createCallerFactory()
|
|
87970
89688
|
};
|
|
87971
89689
|
}
|
|
87972
|
-
};
|
|
87973
|
-
var initTRPC = new TRPCBuilder();
|
|
89690
|
+
}();
|
|
87974
89691
|
|
|
87975
89692
|
// ../../shared/vault-core/skippedFolders.ts
|
|
87976
89693
|
var skipCovering = (marks, folder) => marks.find((mark) => folder === mark || folder.startsWith(`${mark}/`)) ?? null;
|
|
@@ -88419,841 +90136,14 @@ var deleteFiles = async (options, userId, {
|
|
|
88419
90136
|
return { deleted, kept, matched: matched.length, published };
|
|
88420
90137
|
};
|
|
88421
90138
|
|
|
88422
|
-
//
|
|
88423
|
-
var
|
|
88424
|
-
constructor() {
|
|
88425
|
-
this.keyToValue = /* @__PURE__ */ new Map();
|
|
88426
|
-
this.valueToKey = /* @__PURE__ */ new Map();
|
|
88427
|
-
}
|
|
88428
|
-
set(key, value2) {
|
|
88429
|
-
this.keyToValue.set(key, value2);
|
|
88430
|
-
this.valueToKey.set(value2, key);
|
|
88431
|
-
}
|
|
88432
|
-
getByKey(key) {
|
|
88433
|
-
return this.keyToValue.get(key);
|
|
88434
|
-
}
|
|
88435
|
-
getByValue(value2) {
|
|
88436
|
-
return this.valueToKey.get(value2);
|
|
88437
|
-
}
|
|
88438
|
-
clear() {
|
|
88439
|
-
this.keyToValue.clear();
|
|
88440
|
-
this.valueToKey.clear();
|
|
88441
|
-
}
|
|
88442
|
-
};
|
|
88443
|
-
|
|
88444
|
-
// node_modules/superjson/dist/registry.js
|
|
88445
|
-
var Registry = class {
|
|
88446
|
-
constructor(generateIdentifier) {
|
|
88447
|
-
this.generateIdentifier = generateIdentifier;
|
|
88448
|
-
this.kv = new DoubleIndexedKV();
|
|
88449
|
-
}
|
|
88450
|
-
register(value2, identifier) {
|
|
88451
|
-
if (this.kv.getByValue(value2)) {
|
|
88452
|
-
return;
|
|
88453
|
-
}
|
|
88454
|
-
if (!identifier) {
|
|
88455
|
-
identifier = this.generateIdentifier(value2);
|
|
88456
|
-
}
|
|
88457
|
-
this.kv.set(identifier, value2);
|
|
88458
|
-
}
|
|
88459
|
-
clear() {
|
|
88460
|
-
this.kv.clear();
|
|
88461
|
-
}
|
|
88462
|
-
getIdentifier(value2) {
|
|
88463
|
-
return this.kv.getByValue(value2);
|
|
88464
|
-
}
|
|
88465
|
-
getValue(identifier) {
|
|
88466
|
-
return this.kv.getByKey(identifier);
|
|
88467
|
-
}
|
|
88468
|
-
};
|
|
88469
|
-
|
|
88470
|
-
// node_modules/superjson/dist/class-registry.js
|
|
88471
|
-
var ClassRegistry = class extends Registry {
|
|
88472
|
-
constructor() {
|
|
88473
|
-
super((c) => c.name);
|
|
88474
|
-
this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
88475
|
-
}
|
|
88476
|
-
register(value2, options) {
|
|
88477
|
-
if (typeof options === "object") {
|
|
88478
|
-
if (options.allowProps) {
|
|
88479
|
-
this.classToAllowedProps.set(value2, options.allowProps);
|
|
88480
|
-
}
|
|
88481
|
-
super.register(value2, options.identifier);
|
|
88482
|
-
} else {
|
|
88483
|
-
super.register(value2, options);
|
|
88484
|
-
}
|
|
88485
|
-
}
|
|
88486
|
-
getAllowedProps(value2) {
|
|
88487
|
-
return this.classToAllowedProps.get(value2);
|
|
88488
|
-
}
|
|
88489
|
-
};
|
|
88490
|
-
|
|
88491
|
-
// node_modules/superjson/dist/util.js
|
|
88492
|
-
function valuesOfObj(record2) {
|
|
88493
|
-
if ("values" in Object) {
|
|
88494
|
-
return Object.values(record2);
|
|
88495
|
-
}
|
|
88496
|
-
const values = [];
|
|
88497
|
-
for (const key in record2) {
|
|
88498
|
-
if (record2.hasOwnProperty(key)) {
|
|
88499
|
-
values.push(record2[key]);
|
|
88500
|
-
}
|
|
88501
|
-
}
|
|
88502
|
-
return values;
|
|
88503
|
-
}
|
|
88504
|
-
function find(record2, predicate) {
|
|
88505
|
-
const values = valuesOfObj(record2);
|
|
88506
|
-
if ("find" in values) {
|
|
88507
|
-
return values.find(predicate);
|
|
88508
|
-
}
|
|
88509
|
-
const valuesNotNever = values;
|
|
88510
|
-
for (let i = 0; i < valuesNotNever.length; i++) {
|
|
88511
|
-
const value2 = valuesNotNever[i];
|
|
88512
|
-
if (predicate(value2)) {
|
|
88513
|
-
return value2;
|
|
88514
|
-
}
|
|
88515
|
-
}
|
|
88516
|
-
return void 0;
|
|
88517
|
-
}
|
|
88518
|
-
function forEach(record2, run8) {
|
|
88519
|
-
Object.entries(record2).forEach(([key, value2]) => run8(value2, key));
|
|
88520
|
-
}
|
|
88521
|
-
function includes(arr, value2) {
|
|
88522
|
-
return arr.indexOf(value2) !== -1;
|
|
88523
|
-
}
|
|
88524
|
-
function findArr(record2, predicate) {
|
|
88525
|
-
for (let i = 0; i < record2.length; i++) {
|
|
88526
|
-
const value2 = record2[i];
|
|
88527
|
-
if (predicate(value2)) {
|
|
88528
|
-
return value2;
|
|
88529
|
-
}
|
|
88530
|
-
}
|
|
88531
|
-
return void 0;
|
|
88532
|
-
}
|
|
88533
|
-
|
|
88534
|
-
// node_modules/superjson/dist/custom-transformer-registry.js
|
|
88535
|
-
var CustomTransformerRegistry = class {
|
|
88536
|
-
constructor() {
|
|
88537
|
-
this.transfomers = {};
|
|
88538
|
-
}
|
|
88539
|
-
register(transformer) {
|
|
88540
|
-
this.transfomers[transformer.name] = transformer;
|
|
88541
|
-
}
|
|
88542
|
-
findApplicable(v) {
|
|
88543
|
-
return find(this.transfomers, (transformer) => transformer.isApplicable(v));
|
|
88544
|
-
}
|
|
88545
|
-
findByName(name) {
|
|
88546
|
-
return this.transfomers[name];
|
|
88547
|
-
}
|
|
88548
|
-
};
|
|
88549
|
-
|
|
88550
|
-
// node_modules/superjson/dist/is.js
|
|
88551
|
-
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
|
|
88552
|
-
var isUndefined = (payload) => typeof payload === "undefined";
|
|
88553
|
-
var isNull = (payload) => payload === null;
|
|
88554
|
-
var isPlainObject2 = (payload) => {
|
|
88555
|
-
if (typeof payload !== "object" || payload === null)
|
|
88556
|
-
return false;
|
|
88557
|
-
if (payload === Object.prototype)
|
|
88558
|
-
return false;
|
|
88559
|
-
if (Object.getPrototypeOf(payload) === null)
|
|
88560
|
-
return true;
|
|
88561
|
-
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
88562
|
-
};
|
|
88563
|
-
var isEmptyObject = (payload) => isPlainObject2(payload) && Object.keys(payload).length === 0;
|
|
88564
|
-
var isArray = (payload) => Array.isArray(payload);
|
|
88565
|
-
var isString = (payload) => typeof payload === "string";
|
|
88566
|
-
var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
|
|
88567
|
-
var isBoolean = (payload) => typeof payload === "boolean";
|
|
88568
|
-
var isRegExp = (payload) => payload instanceof RegExp;
|
|
88569
|
-
var isMap = (payload) => payload instanceof Map;
|
|
88570
|
-
var isSet = (payload) => payload instanceof Set;
|
|
88571
|
-
var isSymbol = (payload) => getType(payload) === "Symbol";
|
|
88572
|
-
var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
|
|
88573
|
-
var isError = (payload) => payload instanceof Error;
|
|
88574
|
-
var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
|
|
88575
|
-
var isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
|
88576
|
-
var isBigint = (payload) => typeof payload === "bigint";
|
|
88577
|
-
var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
|
|
88578
|
-
var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
88579
|
-
var isURL = (payload) => payload instanceof URL;
|
|
88580
|
-
|
|
88581
|
-
// node_modules/superjson/dist/pathstringifier.js
|
|
88582
|
-
var escapeKey = (key) => key.replace(/\\/g, "\\\\").replace(/\./g, "\\.");
|
|
88583
|
-
var stringifyPath = (path94) => path94.map(String).map(escapeKey).join(".");
|
|
88584
|
-
var parsePath = (string4, legacyPaths) => {
|
|
88585
|
-
const result = [];
|
|
88586
|
-
let segment = "";
|
|
88587
|
-
for (let i = 0; i < string4.length; i++) {
|
|
88588
|
-
let char = string4.charAt(i);
|
|
88589
|
-
if (!legacyPaths && char === "\\") {
|
|
88590
|
-
const escaped = string4.charAt(i + 1);
|
|
88591
|
-
if (escaped === "\\") {
|
|
88592
|
-
segment += "\\";
|
|
88593
|
-
i++;
|
|
88594
|
-
continue;
|
|
88595
|
-
} else if (escaped !== ".") {
|
|
88596
|
-
throw Error("invalid path");
|
|
88597
|
-
}
|
|
88598
|
-
}
|
|
88599
|
-
const isEscapedDot = char === "\\" && string4.charAt(i + 1) === ".";
|
|
88600
|
-
if (isEscapedDot) {
|
|
88601
|
-
segment += ".";
|
|
88602
|
-
i++;
|
|
88603
|
-
continue;
|
|
88604
|
-
}
|
|
88605
|
-
const isEndOfSegment = char === ".";
|
|
88606
|
-
if (isEndOfSegment) {
|
|
88607
|
-
result.push(segment);
|
|
88608
|
-
segment = "";
|
|
88609
|
-
continue;
|
|
88610
|
-
}
|
|
88611
|
-
segment += char;
|
|
88612
|
-
}
|
|
88613
|
-
const lastSegment = segment;
|
|
88614
|
-
result.push(lastSegment);
|
|
88615
|
-
return result;
|
|
88616
|
-
};
|
|
88617
|
-
|
|
88618
|
-
// node_modules/superjson/dist/transformer.js
|
|
88619
|
-
function simpleTransformation(isApplicable, annotation, transform2, untransform) {
|
|
88620
|
-
return {
|
|
88621
|
-
isApplicable,
|
|
88622
|
-
annotation,
|
|
88623
|
-
transform: transform2,
|
|
88624
|
-
untransform
|
|
88625
|
-
};
|
|
88626
|
-
}
|
|
88627
|
-
var simpleRules = [
|
|
88628
|
-
simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
|
|
88629
|
-
simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
|
|
88630
|
-
if (typeof BigInt !== "undefined") {
|
|
88631
|
-
return BigInt(v);
|
|
88632
|
-
}
|
|
88633
|
-
console.error("Please add a BigInt polyfill.");
|
|
88634
|
-
return v;
|
|
88635
|
-
}),
|
|
88636
|
-
simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
|
|
88637
|
-
simpleTransformation(isError, "Error", (v, superJson) => {
|
|
88638
|
-
const baseError = {
|
|
88639
|
-
name: v.name,
|
|
88640
|
-
message: v.message
|
|
88641
|
-
};
|
|
88642
|
-
if ("cause" in v) {
|
|
88643
|
-
baseError.cause = v.cause;
|
|
88644
|
-
}
|
|
88645
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
88646
|
-
baseError[prop] = v[prop];
|
|
88647
|
-
});
|
|
88648
|
-
return baseError;
|
|
88649
|
-
}, (v, superJson) => {
|
|
88650
|
-
const e = new Error(v.message, { cause: v.cause });
|
|
88651
|
-
e.name = v.name;
|
|
88652
|
-
e.stack = v.stack;
|
|
88653
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
88654
|
-
e[prop] = v[prop];
|
|
88655
|
-
});
|
|
88656
|
-
return e;
|
|
88657
|
-
}),
|
|
88658
|
-
simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
|
|
88659
|
-
const body2 = regex.slice(1, regex.lastIndexOf("/"));
|
|
88660
|
-
const flags = regex.slice(regex.lastIndexOf("/") + 1);
|
|
88661
|
-
return new RegExp(body2, flags);
|
|
88662
|
-
}),
|
|
88663
|
-
simpleTransformation(
|
|
88664
|
-
isSet,
|
|
88665
|
-
"set",
|
|
88666
|
-
// (sets only exist in es6+)
|
|
88667
|
-
// eslint-disable-next-line es5/no-es6-methods
|
|
88668
|
-
(v) => [...v.values()],
|
|
88669
|
-
(v) => new Set(v)
|
|
88670
|
-
),
|
|
88671
|
-
simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
|
|
88672
|
-
simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
|
|
88673
|
-
if (isNaNValue(v)) {
|
|
88674
|
-
return "NaN";
|
|
88675
|
-
}
|
|
88676
|
-
if (v > 0) {
|
|
88677
|
-
return "Infinity";
|
|
88678
|
-
} else {
|
|
88679
|
-
return "-Infinity";
|
|
88680
|
-
}
|
|
88681
|
-
}, Number),
|
|
88682
|
-
simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
|
|
88683
|
-
return "-0";
|
|
88684
|
-
}, Number),
|
|
88685
|
-
simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
|
|
88686
|
-
];
|
|
88687
|
-
function compositeTransformation(isApplicable, annotation, transform2, untransform) {
|
|
88688
|
-
return {
|
|
88689
|
-
isApplicable,
|
|
88690
|
-
annotation,
|
|
88691
|
-
transform: transform2,
|
|
88692
|
-
untransform
|
|
88693
|
-
};
|
|
88694
|
-
}
|
|
88695
|
-
var symbolRule = compositeTransformation((s, superJson) => {
|
|
88696
|
-
if (isSymbol(s)) {
|
|
88697
|
-
const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
|
|
88698
|
-
return isRegistered;
|
|
88699
|
-
}
|
|
88700
|
-
return false;
|
|
88701
|
-
}, (s, superJson) => {
|
|
88702
|
-
const identifier = superJson.symbolRegistry.getIdentifier(s);
|
|
88703
|
-
return ["symbol", identifier];
|
|
88704
|
-
}, (v) => v.description, (_, a, superJson) => {
|
|
88705
|
-
const value2 = superJson.symbolRegistry.getValue(a[1]);
|
|
88706
|
-
if (!value2) {
|
|
88707
|
-
throw new Error("Trying to deserialize unknown symbol");
|
|
88708
|
-
}
|
|
88709
|
-
return value2;
|
|
88710
|
-
});
|
|
88711
|
-
var constructorToName = [
|
|
88712
|
-
Int8Array,
|
|
88713
|
-
Uint8Array,
|
|
88714
|
-
Int16Array,
|
|
88715
|
-
Uint16Array,
|
|
88716
|
-
Int32Array,
|
|
88717
|
-
Uint32Array,
|
|
88718
|
-
Float32Array,
|
|
88719
|
-
Float64Array,
|
|
88720
|
-
Uint8ClampedArray
|
|
88721
|
-
].reduce((obj, ctor) => {
|
|
88722
|
-
obj[ctor.name] = ctor;
|
|
88723
|
-
return obj;
|
|
88724
|
-
}, {});
|
|
88725
|
-
var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
|
|
88726
|
-
const ctor = constructorToName[a[1]];
|
|
88727
|
-
if (!ctor) {
|
|
88728
|
-
throw new Error("Trying to deserialize unknown typed array");
|
|
88729
|
-
}
|
|
88730
|
-
return new ctor(v);
|
|
88731
|
-
});
|
|
88732
|
-
function isInstanceOfRegisteredClass(potentialClass, superJson) {
|
|
88733
|
-
if (potentialClass?.constructor) {
|
|
88734
|
-
const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
|
|
88735
|
-
return isRegistered;
|
|
88736
|
-
}
|
|
88737
|
-
return false;
|
|
88738
|
-
}
|
|
88739
|
-
var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
|
|
88740
|
-
const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
|
|
88741
|
-
return ["class", identifier];
|
|
88742
|
-
}, (clazz, superJson) => {
|
|
88743
|
-
const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
|
|
88744
|
-
if (!allowedProps) {
|
|
88745
|
-
return { ...clazz };
|
|
88746
|
-
}
|
|
88747
|
-
const result = {};
|
|
88748
|
-
allowedProps.forEach((prop) => {
|
|
88749
|
-
result[prop] = clazz[prop];
|
|
88750
|
-
});
|
|
88751
|
-
return result;
|
|
88752
|
-
}, (v, a, superJson) => {
|
|
88753
|
-
const clazz = superJson.classRegistry.getValue(a[1]);
|
|
88754
|
-
if (!clazz) {
|
|
88755
|
-
throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
88756
|
-
}
|
|
88757
|
-
return Object.assign(Object.create(clazz.prototype), v);
|
|
88758
|
-
});
|
|
88759
|
-
var customRule = compositeTransformation((value2, superJson) => {
|
|
88760
|
-
return !!superJson.customTransformerRegistry.findApplicable(value2);
|
|
88761
|
-
}, (value2, superJson) => {
|
|
88762
|
-
const transformer = superJson.customTransformerRegistry.findApplicable(value2);
|
|
88763
|
-
return ["custom", transformer.name];
|
|
88764
|
-
}, (value2, superJson) => {
|
|
88765
|
-
const transformer = superJson.customTransformerRegistry.findApplicable(value2);
|
|
88766
|
-
return transformer.serialize(value2);
|
|
88767
|
-
}, (v, a, superJson) => {
|
|
88768
|
-
const transformer = superJson.customTransformerRegistry.findByName(a[1]);
|
|
88769
|
-
if (!transformer) {
|
|
88770
|
-
throw new Error("Trying to deserialize unknown custom value");
|
|
88771
|
-
}
|
|
88772
|
-
return transformer.deserialize(v);
|
|
88773
|
-
});
|
|
88774
|
-
var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
|
|
88775
|
-
var transformValue = (value2, superJson) => {
|
|
88776
|
-
const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value2, superJson));
|
|
88777
|
-
if (applicableCompositeRule) {
|
|
88778
|
-
return {
|
|
88779
|
-
value: applicableCompositeRule.transform(value2, superJson),
|
|
88780
|
-
type: applicableCompositeRule.annotation(value2, superJson)
|
|
88781
|
-
};
|
|
88782
|
-
}
|
|
88783
|
-
const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value2, superJson));
|
|
88784
|
-
if (applicableSimpleRule) {
|
|
88785
|
-
return {
|
|
88786
|
-
value: applicableSimpleRule.transform(value2, superJson),
|
|
88787
|
-
type: applicableSimpleRule.annotation
|
|
88788
|
-
};
|
|
88789
|
-
}
|
|
88790
|
-
return void 0;
|
|
88791
|
-
};
|
|
88792
|
-
var simpleRulesByAnnotation = {};
|
|
88793
|
-
simpleRules.forEach((rule) => {
|
|
88794
|
-
simpleRulesByAnnotation[rule.annotation] = rule;
|
|
88795
|
-
});
|
|
88796
|
-
var untransformValue = (json3, type, superJson) => {
|
|
88797
|
-
if (isArray(type)) {
|
|
88798
|
-
switch (type[0]) {
|
|
88799
|
-
case "symbol":
|
|
88800
|
-
return symbolRule.untransform(json3, type, superJson);
|
|
88801
|
-
case "class":
|
|
88802
|
-
return classRule.untransform(json3, type, superJson);
|
|
88803
|
-
case "custom":
|
|
88804
|
-
return customRule.untransform(json3, type, superJson);
|
|
88805
|
-
case "typed-array":
|
|
88806
|
-
return typedArrayRule.untransform(json3, type, superJson);
|
|
88807
|
-
default:
|
|
88808
|
-
throw new Error("Unknown transformation: " + type);
|
|
88809
|
-
}
|
|
88810
|
-
} else {
|
|
88811
|
-
const transformation = simpleRulesByAnnotation[type];
|
|
88812
|
-
if (!transformation) {
|
|
88813
|
-
throw new Error("Unknown transformation: " + type);
|
|
88814
|
-
}
|
|
88815
|
-
return transformation.untransform(json3, superJson);
|
|
88816
|
-
}
|
|
88817
|
-
};
|
|
88818
|
-
|
|
88819
|
-
// node_modules/superjson/dist/accessDeep.js
|
|
88820
|
-
var getNthKey = (value2, n) => {
|
|
88821
|
-
if (n > value2.size)
|
|
88822
|
-
throw new Error("index out of bounds");
|
|
88823
|
-
const keys = value2.keys();
|
|
88824
|
-
while (n > 0) {
|
|
88825
|
-
keys.next();
|
|
88826
|
-
n--;
|
|
88827
|
-
}
|
|
88828
|
-
return keys.next().value;
|
|
88829
|
-
};
|
|
88830
|
-
function validatePath(path94) {
|
|
88831
|
-
if (includes(path94, "__proto__")) {
|
|
88832
|
-
throw new Error("__proto__ is not allowed as a property");
|
|
88833
|
-
}
|
|
88834
|
-
if (includes(path94, "prototype")) {
|
|
88835
|
-
throw new Error("prototype is not allowed as a property");
|
|
88836
|
-
}
|
|
88837
|
-
if (includes(path94, "constructor")) {
|
|
88838
|
-
throw new Error("constructor is not allowed as a property");
|
|
88839
|
-
}
|
|
88840
|
-
}
|
|
88841
|
-
var getDeep = (object2, path94) => {
|
|
88842
|
-
validatePath(path94);
|
|
88843
|
-
for (let i = 0; i < path94.length; i++) {
|
|
88844
|
-
const key = path94[i];
|
|
88845
|
-
if (isSet(object2)) {
|
|
88846
|
-
object2 = getNthKey(object2, +key);
|
|
88847
|
-
} else if (isMap(object2)) {
|
|
88848
|
-
const row = +key;
|
|
88849
|
-
const type = +path94[++i] === 0 ? "key" : "value";
|
|
88850
|
-
const keyOfRow = getNthKey(object2, row);
|
|
88851
|
-
switch (type) {
|
|
88852
|
-
case "key":
|
|
88853
|
-
object2 = keyOfRow;
|
|
88854
|
-
break;
|
|
88855
|
-
case "value":
|
|
88856
|
-
object2 = object2.get(keyOfRow);
|
|
88857
|
-
break;
|
|
88858
|
-
}
|
|
88859
|
-
} else {
|
|
88860
|
-
object2 = object2[key];
|
|
88861
|
-
}
|
|
88862
|
-
}
|
|
88863
|
-
return object2;
|
|
88864
|
-
};
|
|
88865
|
-
var setDeep = (object2, path94, mapper) => {
|
|
88866
|
-
validatePath(path94);
|
|
88867
|
-
if (path94.length === 0) {
|
|
88868
|
-
return mapper(object2);
|
|
88869
|
-
}
|
|
88870
|
-
let parent = object2;
|
|
88871
|
-
for (let i = 0; i < path94.length - 1; i++) {
|
|
88872
|
-
const key = path94[i];
|
|
88873
|
-
if (isArray(parent)) {
|
|
88874
|
-
const index = +key;
|
|
88875
|
-
parent = parent[index];
|
|
88876
|
-
} else if (isPlainObject2(parent)) {
|
|
88877
|
-
parent = parent[key];
|
|
88878
|
-
} else if (isSet(parent)) {
|
|
88879
|
-
const row = +key;
|
|
88880
|
-
parent = getNthKey(parent, row);
|
|
88881
|
-
} else if (isMap(parent)) {
|
|
88882
|
-
const isEnd = i === path94.length - 2;
|
|
88883
|
-
if (isEnd) {
|
|
88884
|
-
break;
|
|
88885
|
-
}
|
|
88886
|
-
const row = +key;
|
|
88887
|
-
const type = +path94[++i] === 0 ? "key" : "value";
|
|
88888
|
-
const keyOfRow = getNthKey(parent, row);
|
|
88889
|
-
switch (type) {
|
|
88890
|
-
case "key":
|
|
88891
|
-
parent = keyOfRow;
|
|
88892
|
-
break;
|
|
88893
|
-
case "value":
|
|
88894
|
-
parent = parent.get(keyOfRow);
|
|
88895
|
-
break;
|
|
88896
|
-
}
|
|
88897
|
-
}
|
|
88898
|
-
}
|
|
88899
|
-
const lastKey = path94[path94.length - 1];
|
|
88900
|
-
if (isArray(parent)) {
|
|
88901
|
-
parent[+lastKey] = mapper(parent[+lastKey]);
|
|
88902
|
-
} else if (isPlainObject2(parent)) {
|
|
88903
|
-
parent[lastKey] = mapper(parent[lastKey]);
|
|
88904
|
-
}
|
|
88905
|
-
if (isSet(parent)) {
|
|
88906
|
-
const oldValue = getNthKey(parent, +lastKey);
|
|
88907
|
-
const newValue = mapper(oldValue);
|
|
88908
|
-
if (oldValue !== newValue) {
|
|
88909
|
-
parent.delete(oldValue);
|
|
88910
|
-
parent.add(newValue);
|
|
88911
|
-
}
|
|
88912
|
-
}
|
|
88913
|
-
if (isMap(parent)) {
|
|
88914
|
-
const row = +path94[path94.length - 2];
|
|
88915
|
-
const keyToRow = getNthKey(parent, row);
|
|
88916
|
-
const type = +lastKey === 0 ? "key" : "value";
|
|
88917
|
-
switch (type) {
|
|
88918
|
-
case "key": {
|
|
88919
|
-
const newKey = mapper(keyToRow);
|
|
88920
|
-
parent.set(newKey, parent.get(keyToRow));
|
|
88921
|
-
if (newKey !== keyToRow) {
|
|
88922
|
-
parent.delete(keyToRow);
|
|
88923
|
-
}
|
|
88924
|
-
break;
|
|
88925
|
-
}
|
|
88926
|
-
case "value": {
|
|
88927
|
-
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
88928
|
-
break;
|
|
88929
|
-
}
|
|
88930
|
-
}
|
|
88931
|
-
}
|
|
88932
|
-
return object2;
|
|
88933
|
-
};
|
|
88934
|
-
|
|
88935
|
-
// node_modules/superjson/dist/plainer.js
|
|
88936
|
-
var enableLegacyPaths = (version2) => version2 < 1;
|
|
88937
|
-
function traverse(tree, walker2, version2, origin2 = []) {
|
|
88938
|
-
if (!tree) {
|
|
88939
|
-
return;
|
|
88940
|
-
}
|
|
88941
|
-
const legacyPaths = enableLegacyPaths(version2);
|
|
88942
|
-
if (!isArray(tree)) {
|
|
88943
|
-
forEach(tree, (subtree, key) => traverse(subtree, walker2, version2, [
|
|
88944
|
-
...origin2,
|
|
88945
|
-
...parsePath(key, legacyPaths)
|
|
88946
|
-
]));
|
|
88947
|
-
return;
|
|
88948
|
-
}
|
|
88949
|
-
const [nodeValue, children] = tree;
|
|
88950
|
-
if (children) {
|
|
88951
|
-
forEach(children, (child, key) => {
|
|
88952
|
-
traverse(child, walker2, version2, [
|
|
88953
|
-
...origin2,
|
|
88954
|
-
...parsePath(key, legacyPaths)
|
|
88955
|
-
]);
|
|
88956
|
-
});
|
|
88957
|
-
}
|
|
88958
|
-
walker2(nodeValue, origin2);
|
|
88959
|
-
}
|
|
88960
|
-
function applyValueAnnotations(plain2, annotations, version2, superJson) {
|
|
88961
|
-
traverse(annotations, (type, path94) => {
|
|
88962
|
-
plain2 = setDeep(plain2, path94, (v) => untransformValue(v, type, superJson));
|
|
88963
|
-
}, version2);
|
|
88964
|
-
return plain2;
|
|
88965
|
-
}
|
|
88966
|
-
function applyReferentialEqualityAnnotations(plain2, annotations, version2) {
|
|
88967
|
-
const legacyPaths = enableLegacyPaths(version2);
|
|
88968
|
-
function apply(identicalPaths, path94) {
|
|
88969
|
-
const object2 = getDeep(plain2, parsePath(path94, legacyPaths));
|
|
88970
|
-
identicalPaths.map((path95) => parsePath(path95, legacyPaths)).forEach((identicalObjectPath) => {
|
|
88971
|
-
plain2 = setDeep(plain2, identicalObjectPath, () => object2);
|
|
88972
|
-
});
|
|
88973
|
-
}
|
|
88974
|
-
if (isArray(annotations)) {
|
|
88975
|
-
const [root, other] = annotations;
|
|
88976
|
-
root.forEach((identicalPath) => {
|
|
88977
|
-
plain2 = setDeep(plain2, parsePath(identicalPath, legacyPaths), () => plain2);
|
|
88978
|
-
});
|
|
88979
|
-
if (other) {
|
|
88980
|
-
forEach(other, apply);
|
|
88981
|
-
}
|
|
88982
|
-
} else {
|
|
88983
|
-
forEach(annotations, apply);
|
|
88984
|
-
}
|
|
88985
|
-
return plain2;
|
|
88986
|
-
}
|
|
88987
|
-
var isDeep = (object2, superJson) => isPlainObject2(object2) || isArray(object2) || isMap(object2) || isSet(object2) || isError(object2) || isInstanceOfRegisteredClass(object2, superJson);
|
|
88988
|
-
function addIdentity(object2, path94, identities) {
|
|
88989
|
-
const existingSet = identities.get(object2);
|
|
88990
|
-
if (existingSet) {
|
|
88991
|
-
existingSet.push(path94);
|
|
88992
|
-
} else {
|
|
88993
|
-
identities.set(object2, [path94]);
|
|
88994
|
-
}
|
|
88995
|
-
}
|
|
88996
|
-
function generateReferentialEqualityAnnotations(identitites, dedupe) {
|
|
88997
|
-
const result = {};
|
|
88998
|
-
let rootEqualityPaths = void 0;
|
|
88999
|
-
identitites.forEach((paths2) => {
|
|
89000
|
-
if (paths2.length <= 1) {
|
|
89001
|
-
return;
|
|
89002
|
-
}
|
|
89003
|
-
if (!dedupe) {
|
|
89004
|
-
paths2 = paths2.map((path94) => path94.map(String)).sort((a, b) => a.length - b.length);
|
|
89005
|
-
}
|
|
89006
|
-
const [representativePath, ...identicalPaths] = paths2;
|
|
89007
|
-
if (representativePath.length === 0) {
|
|
89008
|
-
rootEqualityPaths = identicalPaths.map(stringifyPath);
|
|
89009
|
-
} else {
|
|
89010
|
-
result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
|
|
89011
|
-
}
|
|
89012
|
-
});
|
|
89013
|
-
if (rootEqualityPaths) {
|
|
89014
|
-
if (isEmptyObject(result)) {
|
|
89015
|
-
return [rootEqualityPaths];
|
|
89016
|
-
} else {
|
|
89017
|
-
return [rootEqualityPaths, result];
|
|
89018
|
-
}
|
|
89019
|
-
} else {
|
|
89020
|
-
return isEmptyObject(result) ? void 0 : result;
|
|
89021
|
-
}
|
|
89022
|
-
}
|
|
89023
|
-
var walker = (object2, identities, superJson, dedupe, path94 = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
|
|
89024
|
-
const primitive = isPrimitive(object2);
|
|
89025
|
-
if (!primitive) {
|
|
89026
|
-
addIdentity(object2, path94, identities);
|
|
89027
|
-
const seen = seenObjects.get(object2);
|
|
89028
|
-
if (seen) {
|
|
89029
|
-
return dedupe ? {
|
|
89030
|
-
transformedValue: null
|
|
89031
|
-
} : seen;
|
|
89032
|
-
}
|
|
89033
|
-
}
|
|
89034
|
-
if (!isDeep(object2, superJson)) {
|
|
89035
|
-
const transformed2 = transformValue(object2, superJson);
|
|
89036
|
-
const result2 = transformed2 ? {
|
|
89037
|
-
transformedValue: transformed2.value,
|
|
89038
|
-
annotations: [transformed2.type]
|
|
89039
|
-
} : {
|
|
89040
|
-
transformedValue: object2
|
|
89041
|
-
};
|
|
89042
|
-
if (!primitive) {
|
|
89043
|
-
seenObjects.set(object2, result2);
|
|
89044
|
-
}
|
|
89045
|
-
return result2;
|
|
89046
|
-
}
|
|
89047
|
-
if (includes(objectsInThisPath, object2)) {
|
|
89048
|
-
return {
|
|
89049
|
-
transformedValue: null
|
|
89050
|
-
};
|
|
89051
|
-
}
|
|
89052
|
-
const transformationResult = transformValue(object2, superJson);
|
|
89053
|
-
const transformed = transformationResult?.value ?? object2;
|
|
89054
|
-
const transformedValue = isArray(transformed) ? [] : {};
|
|
89055
|
-
const innerAnnotations = {};
|
|
89056
|
-
forEach(transformed, (value2, index) => {
|
|
89057
|
-
if (index === "__proto__" || index === "constructor" || index === "prototype") {
|
|
89058
|
-
throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
|
|
89059
|
-
}
|
|
89060
|
-
const recursiveResult = walker(value2, identities, superJson, dedupe, [...path94, index], [...objectsInThisPath, object2], seenObjects);
|
|
89061
|
-
transformedValue[index] = recursiveResult.transformedValue;
|
|
89062
|
-
if (isArray(recursiveResult.annotations)) {
|
|
89063
|
-
innerAnnotations[escapeKey(index)] = recursiveResult.annotations;
|
|
89064
|
-
} else if (isPlainObject2(recursiveResult.annotations)) {
|
|
89065
|
-
forEach(recursiveResult.annotations, (tree, key) => {
|
|
89066
|
-
innerAnnotations[escapeKey(index) + "." + key] = tree;
|
|
89067
|
-
});
|
|
89068
|
-
}
|
|
89069
|
-
});
|
|
89070
|
-
const result = isEmptyObject(innerAnnotations) ? {
|
|
89071
|
-
transformedValue,
|
|
89072
|
-
annotations: !!transformationResult ? [transformationResult.type] : void 0
|
|
89073
|
-
} : {
|
|
89074
|
-
transformedValue,
|
|
89075
|
-
annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
|
|
89076
|
-
};
|
|
89077
|
-
if (!primitive) {
|
|
89078
|
-
seenObjects.set(object2, result);
|
|
89079
|
-
}
|
|
89080
|
-
return result;
|
|
89081
|
-
};
|
|
89082
|
-
|
|
89083
|
-
// node_modules/copy-anything/dist/index.js
|
|
89084
|
-
function assignProp2(carry, key, newVal, originalObject) {
|
|
89085
|
-
if (Object.prototype.propertyIsEnumerable.call(originalObject, key)) {
|
|
89086
|
-
carry[key] = newVal;
|
|
89087
|
-
return;
|
|
89088
|
-
}
|
|
89089
|
-
Object.defineProperty(carry, key, {
|
|
89090
|
-
value: newVal,
|
|
89091
|
-
enumerable: false,
|
|
89092
|
-
writable: true,
|
|
89093
|
-
configurable: true
|
|
89094
|
-
});
|
|
89095
|
-
}
|
|
89096
|
-
function isPlainObject3(value2) {
|
|
89097
|
-
return Object.getPrototypeOf(value2) === Object.prototype && Object.prototype.toString.call(value2) === "[object Object]";
|
|
89098
|
-
}
|
|
89099
|
-
function cloneRef(value2, clones, sources, dests) {
|
|
89100
|
-
if (typeof value2 !== "object" || value2 === null)
|
|
89101
|
-
return value2;
|
|
89102
|
-
const array2 = Array.isArray(value2);
|
|
89103
|
-
if (!array2 && !isPlainObject3(value2))
|
|
89104
|
-
return value2;
|
|
89105
|
-
const existing = clones.get(value2);
|
|
89106
|
-
if (existing !== void 0)
|
|
89107
|
-
return existing;
|
|
89108
|
-
const clone2 = array2 ? new Array(value2.length) : {};
|
|
89109
|
-
clones.set(value2, clone2);
|
|
89110
|
-
sources.push(value2);
|
|
89111
|
-
dests.push(clone2);
|
|
89112
|
-
return clone2;
|
|
89113
|
-
}
|
|
89114
|
-
function copy(target2, options = {}) {
|
|
89115
|
-
if (typeof target2 !== "object" || target2 === null)
|
|
89116
|
-
return target2;
|
|
89117
|
-
const clones = /* @__PURE__ */ new Map();
|
|
89118
|
-
const sources = [];
|
|
89119
|
-
const dests = [];
|
|
89120
|
-
const result = cloneRef(target2, clones, sources, dests);
|
|
89121
|
-
const onlyProps = Array.isArray(options.props) ? options.props : void 0;
|
|
89122
|
-
const nonenumerable = options.nonenumerable === true;
|
|
89123
|
-
while (sources.length) {
|
|
89124
|
-
const source = sources.pop();
|
|
89125
|
-
const dest = dests.pop();
|
|
89126
|
-
if (Array.isArray(source)) {
|
|
89127
|
-
for (let i = 0; i < source.length; i++) {
|
|
89128
|
-
if (i in source)
|
|
89129
|
-
dest[i] = cloneRef(source[i], clones, sources, dests);
|
|
89130
|
-
}
|
|
89131
|
-
continue;
|
|
89132
|
-
}
|
|
89133
|
-
if (nonenumerable) {
|
|
89134
|
-
for (const key of Object.getOwnPropertyNames(source)) {
|
|
89135
|
-
if (key === "__proto__")
|
|
89136
|
-
continue;
|
|
89137
|
-
if (onlyProps && !onlyProps.includes(key))
|
|
89138
|
-
continue;
|
|
89139
|
-
const newVal = cloneRef(source[key], clones, sources, dests);
|
|
89140
|
-
assignProp2(dest, key, newVal, source);
|
|
89141
|
-
}
|
|
89142
|
-
} else {
|
|
89143
|
-
for (const key in source) {
|
|
89144
|
-
if (!Object.prototype.hasOwnProperty.call(source, key))
|
|
89145
|
-
continue;
|
|
89146
|
-
if (key === "__proto__")
|
|
89147
|
-
continue;
|
|
89148
|
-
if (onlyProps && !onlyProps.includes(key))
|
|
89149
|
-
continue;
|
|
89150
|
-
dest[key] = cloneRef(source[key], clones, sources, dests);
|
|
89151
|
-
}
|
|
89152
|
-
}
|
|
89153
|
-
for (const key of Object.getOwnPropertySymbols(source)) {
|
|
89154
|
-
if (onlyProps && !onlyProps.includes(key))
|
|
89155
|
-
continue;
|
|
89156
|
-
if (!nonenumerable && !Object.prototype.propertyIsEnumerable.call(source, key))
|
|
89157
|
-
continue;
|
|
89158
|
-
const newVal = cloneRef(source[key], clones, sources, dests);
|
|
89159
|
-
assignProp2(dest, key, newVal, source);
|
|
89160
|
-
}
|
|
89161
|
-
}
|
|
89162
|
-
return result;
|
|
89163
|
-
}
|
|
89164
|
-
|
|
89165
|
-
// node_modules/superjson/dist/index.js
|
|
89166
|
-
var SuperJSON = class {
|
|
89167
|
-
/**
|
|
89168
|
-
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
89169
|
-
*/
|
|
89170
|
-
constructor({ dedupe = false } = {}) {
|
|
89171
|
-
this.classRegistry = new ClassRegistry();
|
|
89172
|
-
this.symbolRegistry = new Registry((s) => s.description ?? "");
|
|
89173
|
-
this.customTransformerRegistry = new CustomTransformerRegistry();
|
|
89174
|
-
this.allowedErrorProps = [];
|
|
89175
|
-
this.dedupe = dedupe;
|
|
89176
|
-
}
|
|
89177
|
-
serialize(object2) {
|
|
89178
|
-
const identities = /* @__PURE__ */ new Map();
|
|
89179
|
-
const output2 = walker(object2, identities, this, this.dedupe);
|
|
89180
|
-
const res = {
|
|
89181
|
-
json: output2.transformedValue
|
|
89182
|
-
};
|
|
89183
|
-
if (output2.annotations) {
|
|
89184
|
-
res.meta = {
|
|
89185
|
-
...res.meta,
|
|
89186
|
-
values: output2.annotations
|
|
89187
|
-
};
|
|
89188
|
-
}
|
|
89189
|
-
const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
|
|
89190
|
-
if (equalityAnnotations) {
|
|
89191
|
-
res.meta = {
|
|
89192
|
-
...res.meta,
|
|
89193
|
-
referentialEqualities: equalityAnnotations
|
|
89194
|
-
};
|
|
89195
|
-
}
|
|
89196
|
-
if (res.meta)
|
|
89197
|
-
res.meta.v = 1;
|
|
89198
|
-
return res;
|
|
89199
|
-
}
|
|
89200
|
-
deserialize(payload, options) {
|
|
89201
|
-
const { json: json3, meta: meta3 } = payload;
|
|
89202
|
-
let result = options?.inPlace ? json3 : copy(json3);
|
|
89203
|
-
if (meta3?.values) {
|
|
89204
|
-
result = applyValueAnnotations(result, meta3.values, meta3.v ?? 0, this);
|
|
89205
|
-
}
|
|
89206
|
-
if (meta3?.referentialEqualities) {
|
|
89207
|
-
result = applyReferentialEqualityAnnotations(result, meta3.referentialEqualities, meta3.v ?? 0);
|
|
89208
|
-
}
|
|
89209
|
-
return result;
|
|
89210
|
-
}
|
|
89211
|
-
stringify(object2) {
|
|
89212
|
-
return JSON.stringify(this.serialize(object2));
|
|
89213
|
-
}
|
|
89214
|
-
parse(string4) {
|
|
89215
|
-
return this.deserialize(JSON.parse(string4), { inPlace: true });
|
|
89216
|
-
}
|
|
89217
|
-
registerClass(v, options) {
|
|
89218
|
-
this.classRegistry.register(v, options);
|
|
89219
|
-
}
|
|
89220
|
-
registerSymbol(v, identifier) {
|
|
89221
|
-
this.symbolRegistry.register(v, identifier);
|
|
89222
|
-
}
|
|
89223
|
-
registerCustom(transformer, name) {
|
|
89224
|
-
this.customTransformerRegistry.register({
|
|
89225
|
-
name,
|
|
89226
|
-
...transformer
|
|
89227
|
-
});
|
|
89228
|
-
}
|
|
89229
|
-
allowErrorProps(...props) {
|
|
89230
|
-
this.allowedErrorProps.push(...props);
|
|
89231
|
-
}
|
|
89232
|
-
};
|
|
89233
|
-
SuperJSON.defaultInstance = new SuperJSON();
|
|
89234
|
-
SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
|
|
89235
|
-
SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
|
|
89236
|
-
SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
|
|
89237
|
-
SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
|
|
89238
|
-
SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
|
|
89239
|
-
SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
|
|
89240
|
-
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
|
89241
|
-
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
89242
|
-
var dist_default = SuperJSON;
|
|
89243
|
-
var serialize = SuperJSON.serialize;
|
|
89244
|
-
var deserialize = SuperJSON.deserialize;
|
|
89245
|
-
var stringify = SuperJSON.stringify;
|
|
89246
|
-
var parse7 = SuperJSON.parse;
|
|
89247
|
-
var registerClass = SuperJSON.registerClass;
|
|
89248
|
-
var registerCustom = SuperJSON.registerCustom;
|
|
89249
|
-
var registerSymbol = SuperJSON.registerSymbol;
|
|
89250
|
-
var allowErrorProps = SuperJSON.allowErrorProps;
|
|
90139
|
+
// src/vault/vaultRouter.ts
|
|
90140
|
+
var import_superjson = __toESM(require_dist());
|
|
89251
90141
|
|
|
89252
90142
|
// ../../node_modules/@prisma/debug/dist/index.mjs
|
|
89253
|
-
var
|
|
90143
|
+
var __defProp2 = Object.defineProperty;
|
|
89254
90144
|
var __export2 = (target2, all) => {
|
|
89255
90145
|
for (var name in all)
|
|
89256
|
-
|
|
90146
|
+
__defProp2(target2, name, { get: all[name], enumerable: true });
|
|
89257
90147
|
};
|
|
89258
90148
|
var colors_exports = {};
|
|
89259
90149
|
__export2(colors_exports, {
|
|
@@ -89588,7 +90478,7 @@ var RunnerVaultRouter = class {
|
|
|
89588
90478
|
async call(caller, path94, input2) {
|
|
89589
90479
|
const procedures = vaultRouter.createCaller({ caller, ports: this.portsFor() });
|
|
89590
90480
|
const result = await procedures[path94](input2);
|
|
89591
|
-
return
|
|
90481
|
+
return import_superjson.default.serialize(result);
|
|
89592
90482
|
}
|
|
89593
90483
|
};
|
|
89594
90484
|
|
|
@@ -90045,8 +90935,8 @@ function createDaemonVault(runnerDir2, ownerUserId, onMembers, embedder, engines
|
|
|
90045
90935
|
if (!file2) throw new Error("The copy did not land.");
|
|
90046
90936
|
const { deleted } = await source.handle("vaultDelete", { uploadIds: [uploadId2] }, scope);
|
|
90047
90937
|
if (deleted !== 1) {
|
|
90048
|
-
const
|
|
90049
|
-
await target2.handle("vaultDelete", { uploadIds: [
|
|
90938
|
+
const copy = file2.id;
|
|
90939
|
+
await target2.handle("vaultDelete", { uploadIds: [copy] }, scope).catch(() => void 0);
|
|
90050
90940
|
throw new Error("The original could not be removed, so it stays where it was.");
|
|
90051
90941
|
}
|
|
90052
90942
|
result.moved.push({ from: uploadId2, file: file2 });
|