haansi 0.1.134 → 0.1.135
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/haansi.js +1130 -1109
- package/package.json +1 -1
package/dist/haansi.js
CHANGED
|
@@ -18,9 +18,9 @@ var __export = (target, all) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __copyProps = (to, from, except, desc) => {
|
|
20
20
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let
|
|
22
|
-
if (!__hasOwnProp.call(to,
|
|
23
|
-
__defProp(to,
|
|
21
|
+
for (let key2 of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
23
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
24
24
|
}
|
|
25
25
|
return to;
|
|
26
26
|
};
|
|
@@ -95,7 +95,7 @@ var require_package = __commonJS({
|
|
|
95
95
|
"package.json"(exports2, module2) {
|
|
96
96
|
module2.exports = {
|
|
97
97
|
name: "haansi",
|
|
98
|
-
version: "0.1.
|
|
98
|
+
version: "0.1.135",
|
|
99
99
|
description: "Haansi CLI - Session collector and MCP server for Claude Code & OpenAI Codex",
|
|
100
100
|
bin: {
|
|
101
101
|
haansi: "./dist/haansi.js"
|
|
@@ -1105,7 +1105,7 @@ var require_main = __commonJS({
|
|
|
1105
1105
|
lines = lines.replace(/\r\n?/mg, "\n");
|
|
1106
1106
|
let match;
|
|
1107
1107
|
while ((match = LINE.exec(lines)) != null) {
|
|
1108
|
-
const
|
|
1108
|
+
const key2 = match[1];
|
|
1109
1109
|
let value = match[2] || "";
|
|
1110
1110
|
value = value.trim();
|
|
1111
1111
|
const maybeQuote = value[0];
|
|
@@ -1114,7 +1114,7 @@ var require_main = __commonJS({
|
|
|
1114
1114
|
value = value.replace(/\\n/g, "\n");
|
|
1115
1115
|
value = value.replace(/\\r/g, "\r");
|
|
1116
1116
|
}
|
|
1117
|
-
obj[
|
|
1117
|
+
obj[key2] = value;
|
|
1118
1118
|
}
|
|
1119
1119
|
return obj;
|
|
1120
1120
|
}
|
|
@@ -1133,8 +1133,8 @@ var require_main = __commonJS({
|
|
|
1133
1133
|
let decrypted;
|
|
1134
1134
|
for (let i = 0; i < length; i++) {
|
|
1135
1135
|
try {
|
|
1136
|
-
const
|
|
1137
|
-
const attrs = _instructions(result,
|
|
1136
|
+
const key2 = keys[i].trim();
|
|
1137
|
+
const attrs = _instructions(result, key2);
|
|
1138
1138
|
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
1139
1139
|
break;
|
|
1140
1140
|
} catch (error2) {
|
|
@@ -1175,8 +1175,8 @@ var require_main = __commonJS({
|
|
|
1175
1175
|
}
|
|
1176
1176
|
throw error2;
|
|
1177
1177
|
}
|
|
1178
|
-
const
|
|
1179
|
-
if (!
|
|
1178
|
+
const key2 = uri.password;
|
|
1179
|
+
if (!key2) {
|
|
1180
1180
|
const err2 = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
1181
1181
|
err2.code = "INVALID_DOTENV_KEY";
|
|
1182
1182
|
throw err2;
|
|
@@ -1194,7 +1194,7 @@ var require_main = __commonJS({
|
|
|
1194
1194
|
err2.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
1195
1195
|
throw err2;
|
|
1196
1196
|
}
|
|
1197
|
-
return { ciphertext, key };
|
|
1197
|
+
return { ciphertext, key: key2 };
|
|
1198
1198
|
}
|
|
1199
1199
|
function _vaultPath(options) {
|
|
1200
1200
|
let possibleVaultPath = null;
|
|
@@ -1308,13 +1308,13 @@ var require_main = __commonJS({
|
|
|
1308
1308
|
return DotenvModule._configVault(options);
|
|
1309
1309
|
}
|
|
1310
1310
|
function decrypt(encrypted, keyStr) {
|
|
1311
|
-
const
|
|
1311
|
+
const key2 = Buffer.from(keyStr.slice(-64), "hex");
|
|
1312
1312
|
let ciphertext = Buffer.from(encrypted, "base64");
|
|
1313
1313
|
const nonce = ciphertext.subarray(0, 12);
|
|
1314
1314
|
const authTag = ciphertext.subarray(-16);
|
|
1315
1315
|
ciphertext = ciphertext.subarray(12, -16);
|
|
1316
1316
|
try {
|
|
1317
|
-
const aesgcm = crypto8.createDecipheriv("aes-256-gcm",
|
|
1317
|
+
const aesgcm = crypto8.createDecipheriv("aes-256-gcm", key2, nonce);
|
|
1318
1318
|
aesgcm.setAuthTag(authTag);
|
|
1319
1319
|
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
1320
1320
|
} catch (error2) {
|
|
@@ -1342,20 +1342,20 @@ var require_main = __commonJS({
|
|
|
1342
1342
|
err2.code = "OBJECT_REQUIRED";
|
|
1343
1343
|
throw err2;
|
|
1344
1344
|
}
|
|
1345
|
-
for (const
|
|
1346
|
-
if (Object.prototype.hasOwnProperty.call(processEnv,
|
|
1345
|
+
for (const key2 of Object.keys(parsed)) {
|
|
1346
|
+
if (Object.prototype.hasOwnProperty.call(processEnv, key2)) {
|
|
1347
1347
|
if (override === true) {
|
|
1348
|
-
processEnv[
|
|
1348
|
+
processEnv[key2] = parsed[key2];
|
|
1349
1349
|
}
|
|
1350
1350
|
if (debug) {
|
|
1351
1351
|
if (override === true) {
|
|
1352
|
-
_debug(`"${
|
|
1352
|
+
_debug(`"${key2}" is already defined and WAS overwritten`);
|
|
1353
1353
|
} else {
|
|
1354
|
-
_debug(`"${
|
|
1354
|
+
_debug(`"${key2}" is already defined and was NOT overwritten`);
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
1357
|
} else {
|
|
1358
|
-
processEnv[
|
|
1358
|
+
processEnv[key2] = parsed[key2];
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
@@ -1645,14 +1645,14 @@ function getCloudBackend() {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
return _cloudBackend;
|
|
1647
1647
|
}
|
|
1648
|
-
function normKey(
|
|
1649
|
-
return
|
|
1648
|
+
function normKey(key2) {
|
|
1649
|
+
return key2.toLowerCase().replace(/[_\-]/g, "");
|
|
1650
1650
|
}
|
|
1651
|
-
function isSensitiveKey(
|
|
1652
|
-
return SENSITIVE_KEY_RE.test(normKey(
|
|
1651
|
+
function isSensitiveKey(key2) {
|
|
1652
|
+
return SENSITIVE_KEY_RE.test(normKey(key2));
|
|
1653
1653
|
}
|
|
1654
|
-
function isUserContentKey(
|
|
1655
|
-
return USER_CONTENT_KEY_RE.test(normKey(
|
|
1654
|
+
function isUserContentKey(key2) {
|
|
1655
|
+
return USER_CONTENT_KEY_RE.test(normKey(key2));
|
|
1656
1656
|
}
|
|
1657
1657
|
function redactUserContent(value) {
|
|
1658
1658
|
if (typeof value === "string") return `[REDACTED ${value.length} chars]`;
|
|
@@ -3138,8 +3138,8 @@ var require_safe_buffer = __commonJS({
|
|
|
3138
3138
|
var buffer = require("buffer");
|
|
3139
3139
|
var Buffer2 = buffer.Buffer;
|
|
3140
3140
|
function copyProps(src, dst) {
|
|
3141
|
-
for (var
|
|
3142
|
-
dst[
|
|
3141
|
+
for (var key2 in src) {
|
|
3142
|
+
dst[key2] = src[key2];
|
|
3143
3143
|
}
|
|
3144
3144
|
}
|
|
3145
3145
|
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
@@ -3452,58 +3452,58 @@ var require_jwa = __commonJS({
|
|
|
3452
3452
|
MSG_INVALID_VERIFIER_KEY += " or a KeyObject";
|
|
3453
3453
|
MSG_INVALID_SECRET += "or a KeyObject";
|
|
3454
3454
|
}
|
|
3455
|
-
function checkIsPublicKey(
|
|
3456
|
-
if (Buffer2.isBuffer(
|
|
3455
|
+
function checkIsPublicKey(key2) {
|
|
3456
|
+
if (Buffer2.isBuffer(key2)) {
|
|
3457
3457
|
return;
|
|
3458
3458
|
}
|
|
3459
|
-
if (typeof
|
|
3459
|
+
if (typeof key2 === "string") {
|
|
3460
3460
|
return;
|
|
3461
3461
|
}
|
|
3462
3462
|
if (!supportsKeyObjects) {
|
|
3463
3463
|
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
3464
3464
|
}
|
|
3465
|
-
if (typeof
|
|
3465
|
+
if (typeof key2 !== "object") {
|
|
3466
3466
|
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
3467
3467
|
}
|
|
3468
|
-
if (typeof
|
|
3468
|
+
if (typeof key2.type !== "string") {
|
|
3469
3469
|
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
3470
3470
|
}
|
|
3471
|
-
if (typeof
|
|
3471
|
+
if (typeof key2.asymmetricKeyType !== "string") {
|
|
3472
3472
|
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
3473
3473
|
}
|
|
3474
|
-
if (typeof
|
|
3474
|
+
if (typeof key2.export !== "function") {
|
|
3475
3475
|
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
|
-
function checkIsPrivateKey(
|
|
3479
|
-
if (Buffer2.isBuffer(
|
|
3478
|
+
function checkIsPrivateKey(key2) {
|
|
3479
|
+
if (Buffer2.isBuffer(key2)) {
|
|
3480
3480
|
return;
|
|
3481
3481
|
}
|
|
3482
|
-
if (typeof
|
|
3482
|
+
if (typeof key2 === "string") {
|
|
3483
3483
|
return;
|
|
3484
3484
|
}
|
|
3485
|
-
if (typeof
|
|
3485
|
+
if (typeof key2 === "object") {
|
|
3486
3486
|
return;
|
|
3487
3487
|
}
|
|
3488
3488
|
throw typeError(MSG_INVALID_SIGNER_KEY);
|
|
3489
3489
|
}
|
|
3490
|
-
function checkIsSecretKey(
|
|
3491
|
-
if (Buffer2.isBuffer(
|
|
3490
|
+
function checkIsSecretKey(key2) {
|
|
3491
|
+
if (Buffer2.isBuffer(key2)) {
|
|
3492
3492
|
return;
|
|
3493
3493
|
}
|
|
3494
|
-
if (typeof
|
|
3495
|
-
return
|
|
3494
|
+
if (typeof key2 === "string") {
|
|
3495
|
+
return key2;
|
|
3496
3496
|
}
|
|
3497
3497
|
if (!supportsKeyObjects) {
|
|
3498
3498
|
throw typeError(MSG_INVALID_SECRET);
|
|
3499
3499
|
}
|
|
3500
|
-
if (typeof
|
|
3500
|
+
if (typeof key2 !== "object") {
|
|
3501
3501
|
throw typeError(MSG_INVALID_SECRET);
|
|
3502
3502
|
}
|
|
3503
|
-
if (
|
|
3503
|
+
if (key2.type !== "secret") {
|
|
3504
3504
|
throw typeError(MSG_INVALID_SECRET);
|
|
3505
3505
|
}
|
|
3506
|
-
if (typeof
|
|
3506
|
+
if (typeof key2.export !== "function") {
|
|
3507
3507
|
throw typeError(MSG_INVALID_SECRET);
|
|
3508
3508
|
}
|
|
3509
3509
|
}
|
|
@@ -4955,27 +4955,27 @@ var require_lrucache = __commonJS({
|
|
|
4955
4955
|
this.max = 1e3;
|
|
4956
4956
|
this.map = /* @__PURE__ */ new Map();
|
|
4957
4957
|
}
|
|
4958
|
-
get(
|
|
4959
|
-
const value = this.map.get(
|
|
4958
|
+
get(key2) {
|
|
4959
|
+
const value = this.map.get(key2);
|
|
4960
4960
|
if (value === void 0) {
|
|
4961
4961
|
return void 0;
|
|
4962
4962
|
} else {
|
|
4963
|
-
this.map.delete(
|
|
4964
|
-
this.map.set(
|
|
4963
|
+
this.map.delete(key2);
|
|
4964
|
+
this.map.set(key2, value);
|
|
4965
4965
|
return value;
|
|
4966
4966
|
}
|
|
4967
4967
|
}
|
|
4968
|
-
delete(
|
|
4969
|
-
return this.map.delete(
|
|
4968
|
+
delete(key2) {
|
|
4969
|
+
return this.map.delete(key2);
|
|
4970
4970
|
}
|
|
4971
|
-
set(
|
|
4972
|
-
const deleted = this.delete(
|
|
4971
|
+
set(key2, value) {
|
|
4972
|
+
const deleted = this.delete(key2);
|
|
4973
4973
|
if (!deleted && value !== void 0) {
|
|
4974
4974
|
if (this.map.size >= this.max) {
|
|
4975
4975
|
const firstKey = this.map.keys().next().value;
|
|
4976
4976
|
this.delete(firstKey);
|
|
4977
4977
|
}
|
|
4978
|
-
this.map.set(
|
|
4978
|
+
this.map.set(key2, value);
|
|
4979
4979
|
}
|
|
4980
4980
|
return this;
|
|
4981
4981
|
}
|
|
@@ -6075,9 +6075,9 @@ var require_validateAsymmetricKey = __commonJS({
|
|
|
6075
6075
|
ES384: "secp384r1",
|
|
6076
6076
|
ES512: "secp521r1"
|
|
6077
6077
|
};
|
|
6078
|
-
module2.exports = function(algorithm,
|
|
6079
|
-
if (!algorithm || !
|
|
6080
|
-
const keyType =
|
|
6078
|
+
module2.exports = function(algorithm, key2) {
|
|
6079
|
+
if (!algorithm || !key2) return;
|
|
6080
|
+
const keyType = key2.asymmetricKeyType;
|
|
6081
6081
|
if (!keyType) return;
|
|
6082
6082
|
const allowedAlgorithms = allowedAlgorithmsForKeys[keyType];
|
|
6083
6083
|
if (!allowedAlgorithms) {
|
|
@@ -6089,7 +6089,7 @@ var require_validateAsymmetricKey = __commonJS({
|
|
|
6089
6089
|
if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) {
|
|
6090
6090
|
switch (keyType) {
|
|
6091
6091
|
case "ec":
|
|
6092
|
-
const keyCurve =
|
|
6092
|
+
const keyCurve = key2.asymmetricKeyDetails.namedCurve;
|
|
6093
6093
|
const allowedCurve = allowedCurves[algorithm];
|
|
6094
6094
|
if (keyCurve !== allowedCurve) {
|
|
6095
6095
|
throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`);
|
|
@@ -6098,7 +6098,7 @@ var require_validateAsymmetricKey = __commonJS({
|
|
|
6098
6098
|
case "rsa-pss":
|
|
6099
6099
|
if (RSA_PSS_KEY_DETAILS_SUPPORTED) {
|
|
6100
6100
|
const length = parseInt(algorithm.slice(-3), 10);
|
|
6101
|
-
const { hashAlgorithm, mgf1HashAlgorithm, saltLength } =
|
|
6101
|
+
const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key2.asymmetricKeyDetails;
|
|
6102
6102
|
if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) {
|
|
6103
6103
|
throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`);
|
|
6104
6104
|
}
|
|
@@ -6393,8 +6393,8 @@ var require_lodash = __commonJS({
|
|
|
6393
6393
|
return result;
|
|
6394
6394
|
}
|
|
6395
6395
|
function baseValues(object3, props) {
|
|
6396
|
-
return arrayMap(props, function(
|
|
6397
|
-
return object3[
|
|
6396
|
+
return arrayMap(props, function(key2) {
|
|
6397
|
+
return object3[key2];
|
|
6398
6398
|
});
|
|
6399
6399
|
}
|
|
6400
6400
|
function overArg(func, transform2) {
|
|
@@ -6411,9 +6411,9 @@ var require_lodash = __commonJS({
|
|
|
6411
6411
|
function arrayLikeKeys(value, inherited) {
|
|
6412
6412
|
var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
|
|
6413
6413
|
var length = result.length, skipIndexes = !!length;
|
|
6414
|
-
for (var
|
|
6415
|
-
if ((inherited || hasOwnProperty.call(value,
|
|
6416
|
-
result.push(
|
|
6414
|
+
for (var key2 in value) {
|
|
6415
|
+
if ((inherited || hasOwnProperty.call(value, key2)) && !(skipIndexes && (key2 == "length" || isIndex(key2, length)))) {
|
|
6416
|
+
result.push(key2);
|
|
6417
6417
|
}
|
|
6418
6418
|
}
|
|
6419
6419
|
return result;
|
|
@@ -6423,9 +6423,9 @@ var require_lodash = __commonJS({
|
|
|
6423
6423
|
return nativeKeys(object3);
|
|
6424
6424
|
}
|
|
6425
6425
|
var result = [];
|
|
6426
|
-
for (var
|
|
6427
|
-
if (hasOwnProperty.call(object3,
|
|
6428
|
-
result.push(
|
|
6426
|
+
for (var key2 in Object(object3)) {
|
|
6427
|
+
if (hasOwnProperty.call(object3, key2) && key2 != "constructor") {
|
|
6428
|
+
result.push(key2);
|
|
6429
6429
|
}
|
|
6430
6430
|
}
|
|
6431
6431
|
return result;
|
|
@@ -6808,15 +6808,15 @@ var require_sign = __commonJS({
|
|
|
6808
6808
|
if (!isPlainObject3(object3)) {
|
|
6809
6809
|
throw new Error('Expected "' + parameterName + '" to be a plain object.');
|
|
6810
6810
|
}
|
|
6811
|
-
Object.keys(object3).forEach(function(
|
|
6812
|
-
const validator = schema[
|
|
6811
|
+
Object.keys(object3).forEach(function(key2) {
|
|
6812
|
+
const validator = schema[key2];
|
|
6813
6813
|
if (!validator) {
|
|
6814
6814
|
if (!allowUnknown) {
|
|
6815
|
-
throw new Error('"' +
|
|
6815
|
+
throw new Error('"' + key2 + '" is not allowed in "' + parameterName + '"');
|
|
6816
6816
|
}
|
|
6817
6817
|
return;
|
|
6818
6818
|
}
|
|
6819
|
-
if (!validator.isValid(object3[
|
|
6819
|
+
if (!validator.isValid(object3[key2])) {
|
|
6820
6820
|
throw new Error(validator.message);
|
|
6821
6821
|
}
|
|
6822
6822
|
});
|
|
@@ -6949,13 +6949,13 @@ var require_sign = __commonJS({
|
|
|
6949
6949
|
return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));
|
|
6950
6950
|
}
|
|
6951
6951
|
}
|
|
6952
|
-
Object.keys(options_to_payload).forEach(function(
|
|
6953
|
-
const claim = options_to_payload[
|
|
6954
|
-
if (typeof options[
|
|
6952
|
+
Object.keys(options_to_payload).forEach(function(key2) {
|
|
6953
|
+
const claim = options_to_payload[key2];
|
|
6954
|
+
if (typeof options[key2] !== "undefined") {
|
|
6955
6955
|
if (typeof payload[claim] !== "undefined") {
|
|
6956
|
-
return failure(new Error('Bad "options.' +
|
|
6956
|
+
return failure(new Error('Bad "options.' + key2 + '" option. The payload already has an "' + claim + '" property.'));
|
|
6957
6957
|
}
|
|
6958
|
-
payload[claim] = options[
|
|
6958
|
+
payload[claim] = options[key2];
|
|
6959
6959
|
}
|
|
6960
6960
|
});
|
|
6961
6961
|
const encoding = options.encoding || "utf8";
|
|
@@ -9697,12 +9697,12 @@ var require_built = __commonJS({
|
|
|
9697
9697
|
return keys;
|
|
9698
9698
|
}
|
|
9699
9699
|
exports2.getKeyIndexes = getKeyIndexes;
|
|
9700
|
-
function getExternalKeyNameLength(
|
|
9701
|
-
if (typeof
|
|
9702
|
-
|
|
9700
|
+
function getExternalKeyNameLength(key2) {
|
|
9701
|
+
if (typeof key2 !== "string") {
|
|
9702
|
+
key2 = String(key2);
|
|
9703
9703
|
}
|
|
9704
|
-
const hashPos =
|
|
9705
|
-
return hashPos === -1 ?
|
|
9704
|
+
const hashPos = key2.indexOf("->");
|
|
9705
|
+
return hashPos === -1 ? key2.length : hashPos;
|
|
9706
9706
|
}
|
|
9707
9707
|
}
|
|
9708
9708
|
});
|
|
@@ -10294,23 +10294,23 @@ var require_lodash8 = __commonJS({
|
|
|
10294
10294
|
function arrayLikeKeys(value, inherited) {
|
|
10295
10295
|
var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
|
|
10296
10296
|
var length = result.length, skipIndexes = !!length;
|
|
10297
|
-
for (var
|
|
10298
|
-
if ((inherited || hasOwnProperty.call(value,
|
|
10299
|
-
result.push(
|
|
10297
|
+
for (var key2 in value) {
|
|
10298
|
+
if ((inherited || hasOwnProperty.call(value, key2)) && !(skipIndexes && (key2 == "length" || isIndex(key2, length)))) {
|
|
10299
|
+
result.push(key2);
|
|
10300
10300
|
}
|
|
10301
10301
|
}
|
|
10302
10302
|
return result;
|
|
10303
10303
|
}
|
|
10304
|
-
function assignInDefaults(objValue, srcValue,
|
|
10305
|
-
if (objValue === void 0 || eq(objValue, objectProto[
|
|
10304
|
+
function assignInDefaults(objValue, srcValue, key2, object3) {
|
|
10305
|
+
if (objValue === void 0 || eq(objValue, objectProto[key2]) && !hasOwnProperty.call(object3, key2)) {
|
|
10306
10306
|
return srcValue;
|
|
10307
10307
|
}
|
|
10308
10308
|
return objValue;
|
|
10309
10309
|
}
|
|
10310
|
-
function assignValue(object3,
|
|
10311
|
-
var objValue = object3[
|
|
10312
|
-
if (!(hasOwnProperty.call(object3,
|
|
10313
|
-
object3[
|
|
10310
|
+
function assignValue(object3, key2, value) {
|
|
10311
|
+
var objValue = object3[key2];
|
|
10312
|
+
if (!(hasOwnProperty.call(object3, key2) && eq(objValue, value)) || value === void 0 && !(key2 in object3)) {
|
|
10313
|
+
object3[key2] = value;
|
|
10314
10314
|
}
|
|
10315
10315
|
}
|
|
10316
10316
|
function baseKeysIn(object3) {
|
|
@@ -10318,9 +10318,9 @@ var require_lodash8 = __commonJS({
|
|
|
10318
10318
|
return nativeKeysIn(object3);
|
|
10319
10319
|
}
|
|
10320
10320
|
var isProto = isPrototype(object3), result = [];
|
|
10321
|
-
for (var
|
|
10322
|
-
if (!(
|
|
10323
|
-
result.push(
|
|
10321
|
+
for (var key2 in object3) {
|
|
10322
|
+
if (!(key2 == "constructor" && (isProto || !hasOwnProperty.call(object3, key2)))) {
|
|
10323
|
+
result.push(key2);
|
|
10324
10324
|
}
|
|
10325
10325
|
}
|
|
10326
10326
|
return result;
|
|
@@ -10345,9 +10345,9 @@ var require_lodash8 = __commonJS({
|
|
|
10345
10345
|
object3 || (object3 = {});
|
|
10346
10346
|
var index = -1, length = props.length;
|
|
10347
10347
|
while (++index < length) {
|
|
10348
|
-
var
|
|
10349
|
-
var newValue = customizer ? customizer(object3[
|
|
10350
|
-
assignValue(object3,
|
|
10348
|
+
var key2 = props[index];
|
|
10349
|
+
var newValue = customizer ? customizer(object3[key2], source[key2], key2, object3, source) : void 0;
|
|
10350
|
+
assignValue(object3, key2, newValue === void 0 ? source[key2] : newValue);
|
|
10351
10351
|
}
|
|
10352
10352
|
return object3;
|
|
10353
10353
|
}
|
|
@@ -10390,8 +10390,8 @@ var require_lodash8 = __commonJS({
|
|
|
10390
10390
|
function nativeKeysIn(object3) {
|
|
10391
10391
|
var result = [];
|
|
10392
10392
|
if (object3 != null) {
|
|
10393
|
-
for (var
|
|
10394
|
-
result.push(
|
|
10393
|
+
for (var key2 in Object(object3)) {
|
|
10394
|
+
result.push(key2);
|
|
10395
10395
|
}
|
|
10396
10396
|
}
|
|
10397
10397
|
return result;
|
|
@@ -10503,8 +10503,8 @@ var require_common = __commonJS({
|
|
|
10503
10503
|
createDebug.enabled = enabled;
|
|
10504
10504
|
createDebug.humanize = require_ms();
|
|
10505
10505
|
createDebug.destroy = destroy;
|
|
10506
|
-
Object.keys(env).forEach((
|
|
10507
|
-
createDebug[
|
|
10506
|
+
Object.keys(env).forEach((key2) => {
|
|
10507
|
+
createDebug[key2] = env[key2];
|
|
10508
10508
|
});
|
|
10509
10509
|
createDebug.names = [];
|
|
10510
10510
|
createDebug.skips = [];
|
|
@@ -11054,13 +11054,13 @@ var require_node = __commonJS({
|
|
|
11054
11054
|
}
|
|
11055
11055
|
} catch (error2) {
|
|
11056
11056
|
}
|
|
11057
|
-
exports2.inspectOpts = Object.keys(process.env).filter((
|
|
11058
|
-
return /^debug_/i.test(
|
|
11059
|
-
}).reduce((obj,
|
|
11060
|
-
const prop =
|
|
11057
|
+
exports2.inspectOpts = Object.keys(process.env).filter((key2) => {
|
|
11058
|
+
return /^debug_/i.test(key2);
|
|
11059
|
+
}).reduce((obj, key2) => {
|
|
11060
|
+
const prop = key2.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
11061
11061
|
return k.toUpperCase();
|
|
11062
11062
|
});
|
|
11063
|
-
let val = process.env[
|
|
11063
|
+
let val = process.env[key2];
|
|
11064
11064
|
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
11065
11065
|
val = true;
|
|
11066
11066
|
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
@@ -11466,8 +11466,8 @@ var require_utils2 = __commonJS({
|
|
|
11466
11466
|
function convertMapToArray(map2) {
|
|
11467
11467
|
const result = [];
|
|
11468
11468
|
let pos = 0;
|
|
11469
|
-
map2.forEach(function(value,
|
|
11470
|
-
result[pos] =
|
|
11469
|
+
map2.forEach(function(value, key2) {
|
|
11470
|
+
result[pos] = key2;
|
|
11471
11471
|
result[pos + 1] = value;
|
|
11472
11472
|
pos += 2;
|
|
11473
11473
|
});
|
|
@@ -11575,8 +11575,8 @@ var require_utils2 = __commonJS({
|
|
|
11575
11575
|
exports2.CONNECTION_CLOSED_ERROR_MSG = "Connection is closed.";
|
|
11576
11576
|
function zipMap(keys, values) {
|
|
11577
11577
|
const map2 = /* @__PURE__ */ new Map();
|
|
11578
|
-
keys.forEach((
|
|
11579
|
-
map2.set(
|
|
11578
|
+
keys.forEach((key2, index) => {
|
|
11579
|
+
map2.set(key2, values[index]);
|
|
11580
11580
|
});
|
|
11581
11581
|
return map2;
|
|
11582
11582
|
}
|
|
@@ -11696,16 +11696,16 @@ var require_Command = __commonJS({
|
|
|
11696
11696
|
if (options.keyPrefix) {
|
|
11697
11697
|
const isBufferKeyPrefix = options.keyPrefix instanceof Buffer;
|
|
11698
11698
|
let keyPrefixBuffer = isBufferKeyPrefix ? options.keyPrefix : null;
|
|
11699
|
-
this._iterateKeys((
|
|
11700
|
-
if (
|
|
11699
|
+
this._iterateKeys((key2) => {
|
|
11700
|
+
if (key2 instanceof Buffer) {
|
|
11701
11701
|
if (keyPrefixBuffer === null) {
|
|
11702
11702
|
keyPrefixBuffer = Buffer.from(options.keyPrefix);
|
|
11703
11703
|
}
|
|
11704
|
-
return Buffer.concat([keyPrefixBuffer,
|
|
11704
|
+
return Buffer.concat([keyPrefixBuffer, key2]);
|
|
11705
11705
|
} else if (isBufferKeyPrefix) {
|
|
11706
|
-
return Buffer.concat([options.keyPrefix, Buffer.from(String(
|
|
11706
|
+
return Buffer.concat([options.keyPrefix, Buffer.from(String(key2))]);
|
|
11707
11707
|
}
|
|
11708
|
-
return options.keyPrefix +
|
|
11708
|
+
return options.keyPrefix + key2;
|
|
11709
11709
|
});
|
|
11710
11710
|
}
|
|
11711
11711
|
if (options.readOnly) {
|
|
@@ -11739,8 +11739,8 @@ var require_Command = __commonJS({
|
|
|
11739
11739
|
}
|
|
11740
11740
|
getSlot() {
|
|
11741
11741
|
if (typeof this.slot === "undefined") {
|
|
11742
|
-
const
|
|
11743
|
-
this.slot =
|
|
11742
|
+
const key2 = this.getKeys()[0];
|
|
11743
|
+
this.slot = key2 == null ? null : calculateSlot(key2);
|
|
11744
11744
|
}
|
|
11745
11745
|
return this.slot;
|
|
11746
11746
|
}
|
|
@@ -11913,7 +11913,7 @@ var require_Command = __commonJS({
|
|
|
11913
11913
|
/**
|
|
11914
11914
|
* Iterate through the command arguments that are considered keys.
|
|
11915
11915
|
*/
|
|
11916
|
-
_iterateKeys(transform2 = (
|
|
11916
|
+
_iterateKeys(transform2 = (key2) => key2) {
|
|
11917
11917
|
if (typeof this.keys === "undefined") {
|
|
11918
11918
|
this.keys = [];
|
|
11919
11919
|
if ((0, commands_1.exists)(this.name, { caseInsensitive: true })) {
|
|
@@ -12019,17 +12019,17 @@ var require_Command = __commonJS({
|
|
|
12019
12019
|
if (Array.isArray(result)) {
|
|
12020
12020
|
const obj = {};
|
|
12021
12021
|
for (let i = 0; i < result.length; i += 2) {
|
|
12022
|
-
const
|
|
12022
|
+
const key2 = result[i];
|
|
12023
12023
|
const value = result[i + 1];
|
|
12024
|
-
if (
|
|
12025
|
-
Object.defineProperty(obj,
|
|
12024
|
+
if (key2 in obj) {
|
|
12025
|
+
Object.defineProperty(obj, key2, {
|
|
12026
12026
|
value,
|
|
12027
12027
|
configurable: true,
|
|
12028
12028
|
enumerable: true,
|
|
12029
12029
|
writable: true
|
|
12030
12030
|
});
|
|
12031
12031
|
} else {
|
|
12032
|
-
obj[
|
|
12032
|
+
obj[key2] = value;
|
|
12033
12033
|
}
|
|
12034
12034
|
}
|
|
12035
12035
|
return obj;
|
|
@@ -12564,15 +12564,15 @@ var require_Pipeline = __commonJS({
|
|
|
12564
12564
|
};
|
|
12565
12565
|
const cluster = this.redis;
|
|
12566
12566
|
cluster.handleError(commonError, this.leftRedirections, {
|
|
12567
|
-
moved: function(_slot,
|
|
12568
|
-
_this.preferKey =
|
|
12569
|
-
cluster.slots[errv[1]] = [
|
|
12567
|
+
moved: function(_slot, key2) {
|
|
12568
|
+
_this.preferKey = key2;
|
|
12569
|
+
cluster.slots[errv[1]] = [key2];
|
|
12570
12570
|
cluster._groupsBySlot[errv[1]] = cluster._groupsIds[cluster.slots[errv[1]].join(";")];
|
|
12571
12571
|
cluster.refreshSlotsCache();
|
|
12572
12572
|
_this.exec();
|
|
12573
12573
|
},
|
|
12574
|
-
ask: function(_slot,
|
|
12575
|
-
_this.preferKey =
|
|
12574
|
+
ask: function(_slot, key2) {
|
|
12575
|
+
_this.preferKey = key2;
|
|
12576
12576
|
_this.exec();
|
|
12577
12577
|
},
|
|
12578
12578
|
tryagain: exec2,
|
|
@@ -13002,11 +13002,11 @@ var require_ClusterSubscriber = __commonJS({
|
|
|
13002
13002
|
debug("subscriber has disconnected, selecting a new one...");
|
|
13003
13003
|
this.selectSubscriber();
|
|
13004
13004
|
};
|
|
13005
|
-
this.connectionPool.on("-node", (_,
|
|
13005
|
+
this.connectionPool.on("-node", (_, key2) => {
|
|
13006
13006
|
if (!this.started || !this.subscriber) {
|
|
13007
13007
|
return;
|
|
13008
13008
|
}
|
|
13009
|
-
if ((0, util_1.getNodeKey)(this.subscriber.options) ===
|
|
13009
|
+
if ((0, util_1.getNodeKey)(this.subscriber.options) === key2) {
|
|
13010
13010
|
debug("subscriber has left, selecting a new one...");
|
|
13011
13011
|
this.selectSubscriber();
|
|
13012
13012
|
}
|
|
@@ -13186,10 +13186,10 @@ var require_ConnectionPool = __commonJS({
|
|
|
13186
13186
|
}
|
|
13187
13187
|
getNodes(role = "all") {
|
|
13188
13188
|
const nodes = this.nodes[role];
|
|
13189
|
-
return Object.keys(nodes).map((
|
|
13189
|
+
return Object.keys(nodes).map((key2) => nodes[key2]);
|
|
13190
13190
|
}
|
|
13191
|
-
getInstanceByKey(
|
|
13192
|
-
return this.nodes.all[
|
|
13191
|
+
getInstanceByKey(key2) {
|
|
13192
|
+
return this.nodes.all[key2];
|
|
13193
13193
|
}
|
|
13194
13194
|
getSampleInstance(role) {
|
|
13195
13195
|
const keys = Object.keys(this.nodes[role]);
|
|
@@ -13201,11 +13201,11 @@ var require_ConnectionPool = __commonJS({
|
|
|
13201
13201
|
* @param node
|
|
13202
13202
|
*/
|
|
13203
13203
|
addMasterNode(node) {
|
|
13204
|
-
const
|
|
13204
|
+
const key2 = (0, util_1.getNodeKey)(node.options);
|
|
13205
13205
|
const redis = this.createRedisFromOptions(node, node.options.readOnly);
|
|
13206
13206
|
if (!node.options.readOnly) {
|
|
13207
|
-
this.nodes.all[
|
|
13208
|
-
this.nodes.master[
|
|
13207
|
+
this.nodes.all[key2] = redis;
|
|
13208
|
+
this.nodes.master[key2] = redis;
|
|
13209
13209
|
return true;
|
|
13210
13210
|
}
|
|
13211
13211
|
return false;
|
|
@@ -13233,43 +13233,43 @@ var require_ConnectionPool = __commonJS({
|
|
|
13233
13233
|
* Find or create a connection to the node
|
|
13234
13234
|
*/
|
|
13235
13235
|
findOrCreate(node, readOnly = false) {
|
|
13236
|
-
const
|
|
13236
|
+
const key2 = (0, util_1.getNodeKey)(node);
|
|
13237
13237
|
readOnly = Boolean(readOnly);
|
|
13238
|
-
if (this.specifiedOptions[
|
|
13239
|
-
Object.assign(node, this.specifiedOptions[
|
|
13238
|
+
if (this.specifiedOptions[key2]) {
|
|
13239
|
+
Object.assign(node, this.specifiedOptions[key2]);
|
|
13240
13240
|
} else {
|
|
13241
|
-
this.specifiedOptions[
|
|
13241
|
+
this.specifiedOptions[key2] = node;
|
|
13242
13242
|
}
|
|
13243
13243
|
let redis;
|
|
13244
|
-
if (this.nodes.all[
|
|
13245
|
-
redis = this.nodes.all[
|
|
13244
|
+
if (this.nodes.all[key2]) {
|
|
13245
|
+
redis = this.nodes.all[key2];
|
|
13246
13246
|
if (redis.options.readOnly !== readOnly) {
|
|
13247
13247
|
redis.options.readOnly = readOnly;
|
|
13248
|
-
debug("Change role of %s to %s",
|
|
13248
|
+
debug("Change role of %s to %s", key2, readOnly ? "slave" : "master");
|
|
13249
13249
|
redis[readOnly ? "readonly" : "readwrite"]().catch(utils_1.noop);
|
|
13250
13250
|
if (readOnly) {
|
|
13251
|
-
delete this.nodes.master[
|
|
13252
|
-
this.nodes.slave[
|
|
13251
|
+
delete this.nodes.master[key2];
|
|
13252
|
+
this.nodes.slave[key2] = redis;
|
|
13253
13253
|
} else {
|
|
13254
|
-
delete this.nodes.slave[
|
|
13255
|
-
this.nodes.master[
|
|
13254
|
+
delete this.nodes.slave[key2];
|
|
13255
|
+
this.nodes.master[key2] = redis;
|
|
13256
13256
|
}
|
|
13257
13257
|
}
|
|
13258
13258
|
} else {
|
|
13259
|
-
debug("Connecting to %s as %s",
|
|
13259
|
+
debug("Connecting to %s as %s", key2, readOnly ? "slave" : "master");
|
|
13260
13260
|
redis = this.createRedisFromOptions(node, readOnly);
|
|
13261
|
-
this.nodes.all[
|
|
13262
|
-
this.nodes[readOnly ? "slave" : "master"][
|
|
13261
|
+
this.nodes.all[key2] = redis;
|
|
13262
|
+
this.nodes[readOnly ? "slave" : "master"][key2] = redis;
|
|
13263
13263
|
redis.once("end", () => {
|
|
13264
|
-
this.removeNode(
|
|
13265
|
-
this.emit("-node", redis,
|
|
13264
|
+
this.removeNode(key2);
|
|
13265
|
+
this.emit("-node", redis, key2);
|
|
13266
13266
|
if (!Object.keys(this.nodes.all).length) {
|
|
13267
13267
|
this.emit("drain");
|
|
13268
13268
|
}
|
|
13269
13269
|
});
|
|
13270
|
-
this.emit("+node", redis,
|
|
13270
|
+
this.emit("+node", redis, key2);
|
|
13271
13271
|
redis.on("error", function(error2) {
|
|
13272
|
-
this.emit("nodeError", error2,
|
|
13272
|
+
this.emit("nodeError", error2, key2);
|
|
13273
13273
|
});
|
|
13274
13274
|
}
|
|
13275
13275
|
return redis;
|
|
@@ -13282,34 +13282,34 @@ var require_ConnectionPool = __commonJS({
|
|
|
13282
13282
|
debug("Reset with %O", nodes);
|
|
13283
13283
|
const newNodes = {};
|
|
13284
13284
|
nodes.forEach((node) => {
|
|
13285
|
-
const
|
|
13286
|
-
if (!(node.readOnly && newNodes[
|
|
13287
|
-
newNodes[
|
|
13285
|
+
const key2 = (0, util_1.getNodeKey)(node);
|
|
13286
|
+
if (!(node.readOnly && newNodes[key2])) {
|
|
13287
|
+
newNodes[key2] = node;
|
|
13288
13288
|
}
|
|
13289
13289
|
});
|
|
13290
|
-
Object.keys(this.nodes.all).forEach((
|
|
13291
|
-
if (!newNodes[
|
|
13292
|
-
debug("Disconnect %s because the node does not hold any slot",
|
|
13293
|
-
this.nodes.all[
|
|
13294
|
-
this.removeNode(
|
|
13290
|
+
Object.keys(this.nodes.all).forEach((key2) => {
|
|
13291
|
+
if (!newNodes[key2]) {
|
|
13292
|
+
debug("Disconnect %s because the node does not hold any slot", key2);
|
|
13293
|
+
this.nodes.all[key2].disconnect();
|
|
13294
|
+
this.removeNode(key2);
|
|
13295
13295
|
}
|
|
13296
13296
|
});
|
|
13297
|
-
Object.keys(newNodes).forEach((
|
|
13298
|
-
const node = newNodes[
|
|
13297
|
+
Object.keys(newNodes).forEach((key2) => {
|
|
13298
|
+
const node = newNodes[key2];
|
|
13299
13299
|
this.findOrCreate(node, node.readOnly);
|
|
13300
13300
|
});
|
|
13301
13301
|
}
|
|
13302
13302
|
/**
|
|
13303
13303
|
* Remove a node from the pool.
|
|
13304
13304
|
*/
|
|
13305
|
-
removeNode(
|
|
13305
|
+
removeNode(key2) {
|
|
13306
13306
|
const { nodes } = this;
|
|
13307
|
-
if (nodes.all[
|
|
13308
|
-
debug("Remove %s from the pool",
|
|
13309
|
-
delete nodes.all[
|
|
13307
|
+
if (nodes.all[key2]) {
|
|
13308
|
+
debug("Remove %s from the pool", key2);
|
|
13309
|
+
delete nodes.all[key2];
|
|
13310
13310
|
}
|
|
13311
|
-
delete nodes.master[
|
|
13312
|
-
delete nodes.slave[
|
|
13311
|
+
delete nodes.master[key2];
|
|
13312
|
+
delete nodes.slave[key2];
|
|
13313
13313
|
}
|
|
13314
13314
|
};
|
|
13315
13315
|
exports2.default = ConnectionPool;
|
|
@@ -14109,7 +14109,7 @@ var require_cluster = __commonJS({
|
|
|
14109
14109
|
throw new Error('Invalid option scaleReads "' + this.options.scaleReads + '". Expected "all", "master", "slave" or a custom function');
|
|
14110
14110
|
}
|
|
14111
14111
|
this.connectionPool = new ConnectionPool_1.default(this.options.redisOptions);
|
|
14112
|
-
this.connectionPool.on("-node", (redis,
|
|
14112
|
+
this.connectionPool.on("-node", (redis, key2) => {
|
|
14113
14113
|
this.emit("-node", redis);
|
|
14114
14114
|
});
|
|
14115
14115
|
this.connectionPool.on("+node", (redis) => {
|
|
@@ -14118,8 +14118,8 @@ var require_cluster = __commonJS({
|
|
|
14118
14118
|
this.connectionPool.on("drain", () => {
|
|
14119
14119
|
this.setStatus("close");
|
|
14120
14120
|
});
|
|
14121
|
-
this.connectionPool.on("nodeError", (error2,
|
|
14122
|
-
this.emit("node error", error2,
|
|
14121
|
+
this.connectionPool.on("nodeError", (error2, key2) => {
|
|
14122
|
+
this.emit("node error", error2, key2);
|
|
14123
14123
|
});
|
|
14124
14124
|
this.subscriber = new ClusterSubscriber_1.default(this.connectionPool, this);
|
|
14125
14125
|
if (this.options.scripts) {
|
|
@@ -14349,8 +14349,8 @@ var require_cluster = __commonJS({
|
|
|
14349
14349
|
return wrapper(error2);
|
|
14350
14350
|
}
|
|
14351
14351
|
const node = nodes[index];
|
|
14352
|
-
const
|
|
14353
|
-
debug("getting slot cache from %s",
|
|
14352
|
+
const key2 = `${node.options.host}:${node.options.port}`;
|
|
14353
|
+
debug("getting slot cache from %s", key2);
|
|
14354
14354
|
_this.getInfoFromNode(node, function(err2) {
|
|
14355
14355
|
switch (_this.status) {
|
|
14356
14356
|
case "close":
|
|
@@ -14360,7 +14360,7 @@ var require_cluster = __commonJS({
|
|
|
14360
14360
|
return wrapper(new Error("Cluster is disconnecting."));
|
|
14361
14361
|
}
|
|
14362
14362
|
if (err2) {
|
|
14363
|
-
_this.emit("node error", err2,
|
|
14363
|
+
_this.emit("node error", err2, key2);
|
|
14364
14364
|
lastNodeError = err2;
|
|
14365
14365
|
tryNode(index + 1);
|
|
14366
14366
|
} else {
|
|
@@ -14398,23 +14398,23 @@ var require_cluster = __commonJS({
|
|
|
14398
14398
|
command2.reject = function(err2) {
|
|
14399
14399
|
const partialTry = tryConnection.bind(null, true);
|
|
14400
14400
|
_this.handleError(err2, ttl, {
|
|
14401
|
-
moved: function(slot,
|
|
14402
|
-
debug("command %s is moved to %s", command2.name,
|
|
14401
|
+
moved: function(slot, key2) {
|
|
14402
|
+
debug("command %s is moved to %s", command2.name, key2);
|
|
14403
14403
|
targetSlot = Number(slot);
|
|
14404
14404
|
if (_this.slots[slot]) {
|
|
14405
|
-
_this.slots[slot][0] =
|
|
14405
|
+
_this.slots[slot][0] = key2;
|
|
14406
14406
|
} else {
|
|
14407
|
-
_this.slots[slot] = [
|
|
14407
|
+
_this.slots[slot] = [key2];
|
|
14408
14408
|
}
|
|
14409
14409
|
_this._groupsBySlot[slot] = _this._groupsIds[_this.slots[slot].join(";")];
|
|
14410
|
-
_this.connectionPool.findOrCreate(_this.natMapper(
|
|
14410
|
+
_this.connectionPool.findOrCreate(_this.natMapper(key2));
|
|
14411
14411
|
tryConnection();
|
|
14412
14412
|
debug("refreshing slot caches... (triggered by MOVED error)");
|
|
14413
14413
|
_this.refreshSlotsCache();
|
|
14414
14414
|
},
|
|
14415
|
-
ask: function(slot,
|
|
14416
|
-
debug("command %s is required to ask %s:%s", command2.name,
|
|
14417
|
-
const mapped = _this.natMapper(
|
|
14415
|
+
ask: function(slot, key2) {
|
|
14416
|
+
debug("command %s is required to ask %s:%s", command2.name, key2);
|
|
14417
|
+
const mapped = _this.natMapper(key2);
|
|
14418
14418
|
_this.connectionPool.findOrCreate(mapped);
|
|
14419
14419
|
tryConnection(false, `${mapped.host}:${mapped.port}`);
|
|
14420
14420
|
},
|
|
@@ -14471,8 +14471,8 @@ var require_cluster = __commonJS({
|
|
|
14471
14471
|
if (typeof targetSlot === "number" && _this.slots[targetSlot]) {
|
|
14472
14472
|
const nodeKeys = _this.slots[targetSlot];
|
|
14473
14473
|
if (typeof to === "function") {
|
|
14474
|
-
const nodes = nodeKeys.map(function(
|
|
14475
|
-
return _this.connectionPool.getInstanceByKey(
|
|
14474
|
+
const nodes = nodeKeys.map(function(key2) {
|
|
14475
|
+
return _this.connectionPool.getInstanceByKey(key2);
|
|
14476
14476
|
});
|
|
14477
14477
|
redis = to(nodes, command2);
|
|
14478
14478
|
if (Array.isArray(redis)) {
|
|
@@ -14482,15 +14482,15 @@ var require_cluster = __commonJS({
|
|
|
14482
14482
|
redis = nodes[0];
|
|
14483
14483
|
}
|
|
14484
14484
|
} else {
|
|
14485
|
-
let
|
|
14485
|
+
let key2;
|
|
14486
14486
|
if (to === "all") {
|
|
14487
|
-
|
|
14487
|
+
key2 = (0, utils_1.sample)(nodeKeys);
|
|
14488
14488
|
} else if (to === "slave" && nodeKeys.length > 1) {
|
|
14489
|
-
|
|
14489
|
+
key2 = (0, utils_1.sample)(nodeKeys, 1);
|
|
14490
14490
|
} else {
|
|
14491
|
-
|
|
14491
|
+
key2 = nodeKeys[0];
|
|
14492
14492
|
}
|
|
14493
|
-
redis = _this.connectionPool.getInstanceByKey(
|
|
14493
|
+
redis = _this.connectionPool.getInstanceByKey(key2);
|
|
14494
14494
|
}
|
|
14495
14495
|
}
|
|
14496
14496
|
if (asking) {
|
|
@@ -14520,23 +14520,23 @@ var require_cluster = __commonJS({
|
|
|
14520
14520
|
}
|
|
14521
14521
|
return command2.promise;
|
|
14522
14522
|
}
|
|
14523
|
-
sscanStream(
|
|
14524
|
-
return this.createScanStream("sscan", { key, options });
|
|
14523
|
+
sscanStream(key2, options) {
|
|
14524
|
+
return this.createScanStream("sscan", { key: key2, options });
|
|
14525
14525
|
}
|
|
14526
|
-
sscanBufferStream(
|
|
14527
|
-
return this.createScanStream("sscanBuffer", { key, options });
|
|
14526
|
+
sscanBufferStream(key2, options) {
|
|
14527
|
+
return this.createScanStream("sscanBuffer", { key: key2, options });
|
|
14528
14528
|
}
|
|
14529
|
-
hscanStream(
|
|
14530
|
-
return this.createScanStream("hscan", { key, options });
|
|
14529
|
+
hscanStream(key2, options) {
|
|
14530
|
+
return this.createScanStream("hscan", { key: key2, options });
|
|
14531
14531
|
}
|
|
14532
|
-
hscanBufferStream(
|
|
14533
|
-
return this.createScanStream("hscanBuffer", { key, options });
|
|
14532
|
+
hscanBufferStream(key2, options) {
|
|
14533
|
+
return this.createScanStream("hscanBuffer", { key: key2, options });
|
|
14534
14534
|
}
|
|
14535
|
-
zscanStream(
|
|
14536
|
-
return this.createScanStream("zscan", { key, options });
|
|
14535
|
+
zscanStream(key2, options) {
|
|
14536
|
+
return this.createScanStream("zscan", { key: key2, options });
|
|
14537
14537
|
}
|
|
14538
|
-
zscanBufferStream(
|
|
14539
|
-
return this.createScanStream("zscanBuffer", { key, options });
|
|
14538
|
+
zscanBufferStream(key2, options) {
|
|
14539
|
+
return this.createScanStream("zscanBuffer", { key: key2, options });
|
|
14540
14540
|
}
|
|
14541
14541
|
/**
|
|
14542
14542
|
* @ignore
|
|
@@ -14662,15 +14662,15 @@ var require_cluster = __commonJS({
|
|
|
14662
14662
|
}
|
|
14663
14663
|
}
|
|
14664
14664
|
natMapper(nodeKey) {
|
|
14665
|
-
const
|
|
14665
|
+
const key2 = typeof nodeKey === "string" ? nodeKey : `${nodeKey.host}:${nodeKey.port}`;
|
|
14666
14666
|
let mapped = null;
|
|
14667
14667
|
if (this.options.natMap && typeof this.options.natMap === "function") {
|
|
14668
|
-
mapped = this.options.natMap(
|
|
14668
|
+
mapped = this.options.natMap(key2);
|
|
14669
14669
|
} else if (this.options.natMap && typeof this.options.natMap === "object") {
|
|
14670
|
-
mapped = this.options.natMap[
|
|
14670
|
+
mapped = this.options.natMap[key2];
|
|
14671
14671
|
}
|
|
14672
14672
|
if (mapped) {
|
|
14673
|
-
debug("NAT mapping %s -> %O",
|
|
14673
|
+
debug("NAT mapping %s -> %O", key2, mapped);
|
|
14674
14674
|
return Object.assign({}, mapped);
|
|
14675
14675
|
}
|
|
14676
14676
|
return typeof nodeKey === "string" ? (0, util_1.nodeKeyToRedisOptions)(nodeKey) : nodeKey;
|
|
@@ -14788,7 +14788,7 @@ var require_cluster = __commonJS({
|
|
|
14788
14788
|
if (!sortedKeys.length) {
|
|
14789
14789
|
return reject(err3);
|
|
14790
14790
|
}
|
|
14791
|
-
const
|
|
14791
|
+
const key2 = sortedKeys[0], group = groupedRecords[key2], record2 = (0, util_1.weightSrvRecords)(group);
|
|
14792
14792
|
if (!group.records.length) {
|
|
14793
14793
|
sortedKeys.shift();
|
|
14794
14794
|
}
|
|
@@ -14842,10 +14842,10 @@ var require_cluster = __commonJS({
|
|
|
14842
14842
|
return Object.assign({}, node, { host: config6 });
|
|
14843
14843
|
});
|
|
14844
14844
|
}
|
|
14845
|
-
createScanStream(command2, { key, options = {} }) {
|
|
14845
|
+
createScanStream(command2, { key: key2, options = {} }) {
|
|
14846
14846
|
return new ScanStream_1.default({
|
|
14847
14847
|
objectMode: true,
|
|
14848
|
-
key,
|
|
14848
|
+
key: key2,
|
|
14849
14849
|
redis: this,
|
|
14850
14850
|
command: command2,
|
|
14851
14851
|
...options
|
|
@@ -15217,12 +15217,12 @@ var require_SentinelConnector = __commonJS({
|
|
|
15217
15217
|
sentinelNatResolve(item) {
|
|
15218
15218
|
if (!item || !this.options.natMap)
|
|
15219
15219
|
return item;
|
|
15220
|
-
const
|
|
15220
|
+
const key2 = `${item.host}:${item.port}`;
|
|
15221
15221
|
let result = item;
|
|
15222
15222
|
if (typeof this.options.natMap === "function") {
|
|
15223
|
-
result = this.options.natMap(
|
|
15223
|
+
result = this.options.natMap(key2) || item;
|
|
15224
15224
|
} else if (typeof this.options.natMap === "object") {
|
|
15225
|
-
result = this.options.natMap[
|
|
15225
|
+
result = this.options.natMap[key2] || item;
|
|
15226
15226
|
}
|
|
15227
15227
|
return result;
|
|
15228
15228
|
}
|
|
@@ -16796,23 +16796,23 @@ var require_Redis = __commonJS({
|
|
|
16796
16796
|
scanBufferStream(options) {
|
|
16797
16797
|
return this.createScanStream("scanBuffer", { options });
|
|
16798
16798
|
}
|
|
16799
|
-
sscanStream(
|
|
16800
|
-
return this.createScanStream("sscan", { key, options });
|
|
16799
|
+
sscanStream(key2, options) {
|
|
16800
|
+
return this.createScanStream("sscan", { key: key2, options });
|
|
16801
16801
|
}
|
|
16802
|
-
sscanBufferStream(
|
|
16803
|
-
return this.createScanStream("sscanBuffer", { key, options });
|
|
16802
|
+
sscanBufferStream(key2, options) {
|
|
16803
|
+
return this.createScanStream("sscanBuffer", { key: key2, options });
|
|
16804
16804
|
}
|
|
16805
|
-
hscanStream(
|
|
16806
|
-
return this.createScanStream("hscan", { key, options });
|
|
16805
|
+
hscanStream(key2, options) {
|
|
16806
|
+
return this.createScanStream("hscan", { key: key2, options });
|
|
16807
16807
|
}
|
|
16808
|
-
hscanBufferStream(
|
|
16809
|
-
return this.createScanStream("hscanBuffer", { key, options });
|
|
16808
|
+
hscanBufferStream(key2, options) {
|
|
16809
|
+
return this.createScanStream("hscanBuffer", { key: key2, options });
|
|
16810
16810
|
}
|
|
16811
|
-
zscanStream(
|
|
16812
|
-
return this.createScanStream("zscan", { key, options });
|
|
16811
|
+
zscanStream(key2, options) {
|
|
16812
|
+
return this.createScanStream("zscan", { key: key2, options });
|
|
16813
16813
|
}
|
|
16814
|
-
zscanBufferStream(
|
|
16815
|
-
return this.createScanStream("zscanBuffer", { key, options });
|
|
16814
|
+
zscanBufferStream(key2, options) {
|
|
16815
|
+
return this.createScanStream("zscanBuffer", { key: key2, options });
|
|
16816
16816
|
}
|
|
16817
16817
|
/**
|
|
16818
16818
|
* Emit only when there's at least one listener.
|
|
@@ -16948,10 +16948,10 @@ var require_Redis = __commonJS({
|
|
|
16948
16948
|
this.status = status;
|
|
16949
16949
|
process.nextTick(this.emit.bind(this, status, arg));
|
|
16950
16950
|
}
|
|
16951
|
-
createScanStream(command2, { key, options = {} }) {
|
|
16951
|
+
createScanStream(command2, { key: key2, options = {} }) {
|
|
16952
16952
|
return new ScanStream_1.default({
|
|
16953
16953
|
objectMode: true,
|
|
16954
|
-
key,
|
|
16954
|
+
key: key2,
|
|
16955
16955
|
redis: this,
|
|
16956
16956
|
command: command2,
|
|
16957
16957
|
...options
|
|
@@ -20169,9 +20169,9 @@ var require_mutable = __commonJS({
|
|
|
20169
20169
|
function extend2(target) {
|
|
20170
20170
|
for (var i = 1; i < arguments.length; i++) {
|
|
20171
20171
|
var source = arguments[i];
|
|
20172
|
-
for (var
|
|
20173
|
-
if (hasOwnProperty.call(source,
|
|
20174
|
-
target[
|
|
20172
|
+
for (var key2 in source) {
|
|
20173
|
+
if (hasOwnProperty.call(source, key2)) {
|
|
20174
|
+
target[key2] = source[key2];
|
|
20175
20175
|
}
|
|
20176
20176
|
}
|
|
20177
20177
|
}
|
|
@@ -21141,8 +21141,8 @@ var require_utils_legacy = __commonJS({
|
|
|
21141
21141
|
hashName = hashName.replace(/(\D)-/, "$1");
|
|
21142
21142
|
return nodeCrypto.createHash(hashName).update(text).digest();
|
|
21143
21143
|
}
|
|
21144
|
-
function hmacSha256(
|
|
21145
|
-
return nodeCrypto.createHmac("sha256",
|
|
21144
|
+
function hmacSha256(key2, msg) {
|
|
21145
|
+
return nodeCrypto.createHmac("sha256", key2).update(msg).digest();
|
|
21146
21146
|
}
|
|
21147
21147
|
async function deriveKey(password, salt, iterations) {
|
|
21148
21148
|
return nodeCrypto.pbkdf2Sync(password, salt, iterations, 32, "sha256");
|
|
@@ -21199,13 +21199,13 @@ var require_utils_webcrypto = __commonJS({
|
|
|
21199
21199
|
return await subtleCrypto.digest(hashName, text);
|
|
21200
21200
|
}
|
|
21201
21201
|
async function hmacSha256(keyBuffer, msg) {
|
|
21202
|
-
const
|
|
21203
|
-
return await subtleCrypto.sign("HMAC",
|
|
21202
|
+
const key2 = await subtleCrypto.importKey("raw", keyBuffer, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
21203
|
+
return await subtleCrypto.sign("HMAC", key2, textEncoder.encode(msg));
|
|
21204
21204
|
}
|
|
21205
21205
|
async function deriveKey(password, salt, iterations) {
|
|
21206
|
-
const
|
|
21206
|
+
const key2 = await subtleCrypto.importKey("raw", textEncoder.encode(password), "PBKDF2", false, ["deriveBits"]);
|
|
21207
21207
|
const params = { name: "PBKDF2", hash: "SHA-256", salt, iterations };
|
|
21208
|
-
return await subtleCrypto.deriveBits(params,
|
|
21208
|
+
return await subtleCrypto.deriveBits(params, key2, 32 * 8, ["deriveBits"]);
|
|
21209
21209
|
}
|
|
21210
21210
|
}
|
|
21211
21211
|
});
|
|
@@ -21666,35 +21666,35 @@ var require_pg_connection_string = __commonJS({
|
|
|
21666
21666
|
return config6;
|
|
21667
21667
|
}
|
|
21668
21668
|
function toConnectionOptions(sslConfig) {
|
|
21669
|
-
const connectionOptions = Object.entries(sslConfig).reduce((c, [
|
|
21669
|
+
const connectionOptions = Object.entries(sslConfig).reduce((c, [key2, value]) => {
|
|
21670
21670
|
if (value !== void 0 && value !== null) {
|
|
21671
|
-
c[
|
|
21671
|
+
c[key2] = value;
|
|
21672
21672
|
}
|
|
21673
21673
|
return c;
|
|
21674
21674
|
}, {});
|
|
21675
21675
|
return connectionOptions;
|
|
21676
21676
|
}
|
|
21677
21677
|
function toClientConfig(config6) {
|
|
21678
|
-
const poolConfig = Object.entries(config6).reduce((c, [
|
|
21679
|
-
if (
|
|
21678
|
+
const poolConfig = Object.entries(config6).reduce((c, [key2, value]) => {
|
|
21679
|
+
if (key2 === "ssl") {
|
|
21680
21680
|
const sslConfig = value;
|
|
21681
21681
|
if (typeof sslConfig === "boolean") {
|
|
21682
|
-
c[
|
|
21682
|
+
c[key2] = sslConfig;
|
|
21683
21683
|
}
|
|
21684
21684
|
if (typeof sslConfig === "object") {
|
|
21685
|
-
c[
|
|
21685
|
+
c[key2] = toConnectionOptions(sslConfig);
|
|
21686
21686
|
}
|
|
21687
21687
|
} else if (value !== void 0 && value !== null) {
|
|
21688
|
-
if (
|
|
21688
|
+
if (key2 === "port") {
|
|
21689
21689
|
if (value !== "") {
|
|
21690
21690
|
const v = parseInt(value, 10);
|
|
21691
21691
|
if (isNaN(v)) {
|
|
21692
|
-
throw new Error(`Invalid ${
|
|
21692
|
+
throw new Error(`Invalid ${key2}: ${value}`);
|
|
21693
21693
|
}
|
|
21694
|
-
c[
|
|
21694
|
+
c[key2] = v;
|
|
21695
21695
|
}
|
|
21696
21696
|
} else {
|
|
21697
|
-
c[
|
|
21697
|
+
c[key2] = value;
|
|
21698
21698
|
}
|
|
21699
21699
|
}
|
|
21700
21700
|
return c;
|
|
@@ -21731,17 +21731,17 @@ var require_connection_parameters = __commonJS({
|
|
|
21731
21731
|
var dns = require("dns");
|
|
21732
21732
|
var defaults2 = require_defaults();
|
|
21733
21733
|
var parse4 = require_pg_connection_string().parse;
|
|
21734
|
-
var val = function(
|
|
21735
|
-
if (config6[
|
|
21736
|
-
return config6[
|
|
21734
|
+
var val = function(key2, config6, envVar) {
|
|
21735
|
+
if (config6[key2]) {
|
|
21736
|
+
return config6[key2];
|
|
21737
21737
|
}
|
|
21738
21738
|
if (envVar === void 0) {
|
|
21739
|
-
envVar = process.env["PG" +
|
|
21739
|
+
envVar = process.env["PG" + key2.toUpperCase()];
|
|
21740
21740
|
} else if (envVar === false) {
|
|
21741
21741
|
} else {
|
|
21742
21742
|
envVar = process.env[envVar];
|
|
21743
21743
|
}
|
|
21744
|
-
return envVar || defaults2[
|
|
21744
|
+
return envVar || defaults2[key2];
|
|
21745
21745
|
};
|
|
21746
21746
|
var readSSLConfigFromEnvironment = function() {
|
|
21747
21747
|
switch (process.env.PGSSLMODE) {
|
|
@@ -22409,8 +22409,8 @@ var require_serializer = __commonJS({
|
|
|
22409
22409
|
var writer = new buffer_writer_1.Writer();
|
|
22410
22410
|
var startup = (opts) => {
|
|
22411
22411
|
writer.addInt16(3).addInt16(0);
|
|
22412
|
-
for (const
|
|
22413
|
-
writer.addCString(
|
|
22412
|
+
for (const key2 of Object.keys(opts)) {
|
|
22413
|
+
writer.addCString(key2).addCString(opts[key2]);
|
|
22414
22414
|
}
|
|
22415
22415
|
writer.addCString("client_encoding").addCString("UTF8");
|
|
22416
22416
|
const bodyBuffer = writer.addCString("").flush();
|
|
@@ -24565,9 +24565,9 @@ var require_query2 = __commonJS({
|
|
|
24565
24565
|
NativeQuery.prototype.handleError = function(err2) {
|
|
24566
24566
|
const fields = this.native.pq.resultErrorFields();
|
|
24567
24567
|
if (fields) {
|
|
24568
|
-
for (const
|
|
24569
|
-
const normalizedFieldName = errorFieldMap[
|
|
24570
|
-
err2[normalizedFieldName] = fields[
|
|
24568
|
+
for (const key2 in fields) {
|
|
24569
|
+
const normalizedFieldName = errorFieldMap[key2] || key2;
|
|
24570
|
+
err2[normalizedFieldName] = fields[key2];
|
|
24571
24571
|
}
|
|
24572
24572
|
}
|
|
24573
24573
|
if (this.callback) {
|
|
@@ -26287,7 +26287,7 @@ var init_change_text = __esm({
|
|
|
26287
26287
|
});
|
|
26288
26288
|
|
|
26289
26289
|
// ../../packages/@company/db/src/org-purge.ts
|
|
26290
|
-
var observability5, PURGE_STATEMENT_TIMEOUT_MS;
|
|
26290
|
+
var observability5, PURGE_LOCK_TIMEOUT_MS, PURGE_STATEMENT_TIMEOUT_MS, PURGE_SESSION_TIMEOUTS_SQL;
|
|
26291
26291
|
var init_org_purge = __esm({
|
|
26292
26292
|
"../../packages/@company/db/src/org-purge.ts"() {
|
|
26293
26293
|
"use strict";
|
|
@@ -26296,7 +26296,9 @@ var init_org_purge = __esm({
|
|
|
26296
26296
|
init_client();
|
|
26297
26297
|
init_org_context();
|
|
26298
26298
|
observability5 = createObservabilityService("org-purge");
|
|
26299
|
+
PURGE_LOCK_TIMEOUT_MS = 3e4;
|
|
26299
26300
|
PURGE_STATEMENT_TIMEOUT_MS = 5 * 6e4;
|
|
26301
|
+
PURGE_SESSION_TIMEOUTS_SQL = `SET lock_timeout = ${PURGE_LOCK_TIMEOUT_MS}; SET statement_timeout = ${PURGE_STATEMENT_TIMEOUT_MS}`;
|
|
26300
26302
|
}
|
|
26301
26303
|
});
|
|
26302
26304
|
|
|
@@ -28754,9 +28756,9 @@ function scrubJsonStrings(value) {
|
|
|
28754
28756
|
if (value && typeof value === "object") {
|
|
28755
28757
|
const out = {};
|
|
28756
28758
|
for (const [k, v] of Object.entries(value)) {
|
|
28757
|
-
let
|
|
28758
|
-
while (
|
|
28759
|
-
out[
|
|
28759
|
+
let key2 = scrubText(k);
|
|
28760
|
+
while (key2 !== k && key2 in out) key2 = `${key2}_`;
|
|
28761
|
+
out[key2] = scrubJsonStrings(v);
|
|
28760
28762
|
}
|
|
28761
28763
|
return out;
|
|
28762
28764
|
}
|
|
@@ -30532,9 +30534,9 @@ var init_util = __esm({
|
|
|
30532
30534
|
};
|
|
30533
30535
|
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object3) => {
|
|
30534
30536
|
const keys = [];
|
|
30535
|
-
for (const
|
|
30536
|
-
if (Object.prototype.hasOwnProperty.call(object3,
|
|
30537
|
-
keys.push(
|
|
30537
|
+
for (const key2 in object3) {
|
|
30538
|
+
if (Object.prototype.hasOwnProperty.call(object3, key2)) {
|
|
30539
|
+
keys.push(key2);
|
|
30538
30540
|
}
|
|
30539
30541
|
}
|
|
30540
30542
|
return keys;
|
|
@@ -30951,10 +30953,10 @@ var init_parseUtil = __esm({
|
|
|
30951
30953
|
static async mergeObjectAsync(status, pairs) {
|
|
30952
30954
|
const syncPairs = [];
|
|
30953
30955
|
for (const pair of pairs) {
|
|
30954
|
-
const
|
|
30956
|
+
const key2 = await pair.key;
|
|
30955
30957
|
const value = await pair.value;
|
|
30956
30958
|
syncPairs.push({
|
|
30957
|
-
key,
|
|
30959
|
+
key: key2,
|
|
30958
30960
|
value
|
|
30959
30961
|
});
|
|
30960
30962
|
}
|
|
@@ -30963,17 +30965,17 @@ var init_parseUtil = __esm({
|
|
|
30963
30965
|
static mergeObjectSync(status, pairs) {
|
|
30964
30966
|
const finalObject = {};
|
|
30965
30967
|
for (const pair of pairs) {
|
|
30966
|
-
const { key, value } = pair;
|
|
30967
|
-
if (
|
|
30968
|
+
const { key: key2, value } = pair;
|
|
30969
|
+
if (key2.status === "aborted")
|
|
30968
30970
|
return INVALID;
|
|
30969
30971
|
if (value.status === "aborted")
|
|
30970
30972
|
return INVALID;
|
|
30971
|
-
if (
|
|
30973
|
+
if (key2.status === "dirty")
|
|
30972
30974
|
status.dirty();
|
|
30973
30975
|
if (value.status === "dirty")
|
|
30974
30976
|
status.dirty();
|
|
30975
|
-
if (
|
|
30976
|
-
finalObject[
|
|
30977
|
+
if (key2.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
|
30978
|
+
finalObject[key2.value] = value.value;
|
|
30977
30979
|
}
|
|
30978
30980
|
}
|
|
30979
30981
|
return { status: status.value, value: finalObject };
|
|
@@ -31105,9 +31107,9 @@ function floatSafeRemainder(val, step) {
|
|
|
31105
31107
|
function deepPartialify(schema) {
|
|
31106
31108
|
if (schema instanceof ZodObject) {
|
|
31107
31109
|
const newShape = {};
|
|
31108
|
-
for (const
|
|
31109
|
-
const fieldSchema = schema.shape[
|
|
31110
|
-
newShape[
|
|
31110
|
+
for (const key2 in schema.shape) {
|
|
31111
|
+
const fieldSchema = schema.shape[key2];
|
|
31112
|
+
newShape[key2] = ZodOptional.create(deepPartialify(fieldSchema));
|
|
31111
31113
|
}
|
|
31112
31114
|
return new ZodObject({
|
|
31113
31115
|
...schema._def,
|
|
@@ -31135,14 +31137,14 @@ function mergeValues(a, b) {
|
|
|
31135
31137
|
return { valid: true, data: a };
|
|
31136
31138
|
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
|
31137
31139
|
const bKeys = util.objectKeys(b);
|
|
31138
|
-
const sharedKeys = util.objectKeys(a).filter((
|
|
31140
|
+
const sharedKeys = util.objectKeys(a).filter((key2) => bKeys.indexOf(key2) !== -1);
|
|
31139
31141
|
const newObj = { ...a, ...b };
|
|
31140
|
-
for (const
|
|
31141
|
-
const sharedValue = mergeValues(a[
|
|
31142
|
+
for (const key2 of sharedKeys) {
|
|
31143
|
+
const sharedValue = mergeValues(a[key2], b[key2]);
|
|
31142
31144
|
if (!sharedValue.valid) {
|
|
31143
31145
|
return { valid: false };
|
|
31144
31146
|
}
|
|
31145
|
-
newObj[
|
|
31147
|
+
newObj[key2] = sharedValue.data;
|
|
31146
31148
|
}
|
|
31147
31149
|
return { valid: true, data: newObj };
|
|
31148
31150
|
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
|
@@ -31182,12 +31184,12 @@ var init_types3 = __esm({
|
|
|
31182
31184
|
init_parseUtil();
|
|
31183
31185
|
init_util();
|
|
31184
31186
|
ParseInputLazyPath = class {
|
|
31185
|
-
constructor(parent, value, path2,
|
|
31187
|
+
constructor(parent, value, path2, key2) {
|
|
31186
31188
|
this._cachedPath = [];
|
|
31187
31189
|
this.parent = parent;
|
|
31188
31190
|
this.data = value;
|
|
31189
31191
|
this._path = path2;
|
|
31190
|
-
this._key =
|
|
31192
|
+
this._key = key2;
|
|
31191
31193
|
}
|
|
31192
31194
|
get path() {
|
|
31193
31195
|
if (!this._cachedPath.length) {
|
|
@@ -32865,29 +32867,29 @@ var init_types3 = __esm({
|
|
|
32865
32867
|
const { shape, keys: shapeKeys } = this._getCached();
|
|
32866
32868
|
const extraKeys = [];
|
|
32867
32869
|
if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
|
|
32868
|
-
for (const
|
|
32869
|
-
if (!shapeKeys.includes(
|
|
32870
|
-
extraKeys.push(
|
|
32870
|
+
for (const key2 in ctx.data) {
|
|
32871
|
+
if (!shapeKeys.includes(key2)) {
|
|
32872
|
+
extraKeys.push(key2);
|
|
32871
32873
|
}
|
|
32872
32874
|
}
|
|
32873
32875
|
}
|
|
32874
32876
|
const pairs = [];
|
|
32875
|
-
for (const
|
|
32876
|
-
const keyValidator = shape[
|
|
32877
|
-
const value = ctx.data[
|
|
32877
|
+
for (const key2 of shapeKeys) {
|
|
32878
|
+
const keyValidator = shape[key2];
|
|
32879
|
+
const value = ctx.data[key2];
|
|
32878
32880
|
pairs.push({
|
|
32879
|
-
key: { status: "valid", value:
|
|
32880
|
-
value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path,
|
|
32881
|
-
alwaysSet:
|
|
32881
|
+
key: { status: "valid", value: key2 },
|
|
32882
|
+
value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key2)),
|
|
32883
|
+
alwaysSet: key2 in ctx.data
|
|
32882
32884
|
});
|
|
32883
32885
|
}
|
|
32884
32886
|
if (this._def.catchall instanceof ZodNever) {
|
|
32885
32887
|
const unknownKeys = this._def.unknownKeys;
|
|
32886
32888
|
if (unknownKeys === "passthrough") {
|
|
32887
|
-
for (const
|
|
32889
|
+
for (const key2 of extraKeys) {
|
|
32888
32890
|
pairs.push({
|
|
32889
|
-
key: { status: "valid", value:
|
|
32890
|
-
value: { status: "valid", value: ctx.data[
|
|
32891
|
+
key: { status: "valid", value: key2 },
|
|
32892
|
+
value: { status: "valid", value: ctx.data[key2] }
|
|
32891
32893
|
});
|
|
32892
32894
|
}
|
|
32893
32895
|
} else if (unknownKeys === "strict") {
|
|
@@ -32904,15 +32906,15 @@ var init_types3 = __esm({
|
|
|
32904
32906
|
}
|
|
32905
32907
|
} else {
|
|
32906
32908
|
const catchall = this._def.catchall;
|
|
32907
|
-
for (const
|
|
32908
|
-
const value = ctx.data[
|
|
32909
|
+
for (const key2 of extraKeys) {
|
|
32910
|
+
const value = ctx.data[key2];
|
|
32909
32911
|
pairs.push({
|
|
32910
|
-
key: { status: "valid", value:
|
|
32912
|
+
key: { status: "valid", value: key2 },
|
|
32911
32913
|
value: catchall._parse(
|
|
32912
|
-
new ParseInputLazyPath(ctx, value, ctx.path,
|
|
32914
|
+
new ParseInputLazyPath(ctx, value, ctx.path, key2)
|
|
32913
32915
|
//, ctx.child(key), value, getParsedType(value)
|
|
32914
32916
|
),
|
|
32915
|
-
alwaysSet:
|
|
32917
|
+
alwaysSet: key2 in ctx.data
|
|
32916
32918
|
});
|
|
32917
32919
|
}
|
|
32918
32920
|
}
|
|
@@ -32920,10 +32922,10 @@ var init_types3 = __esm({
|
|
|
32920
32922
|
return Promise.resolve().then(async () => {
|
|
32921
32923
|
const syncPairs = [];
|
|
32922
32924
|
for (const pair of pairs) {
|
|
32923
|
-
const
|
|
32925
|
+
const key2 = await pair.key;
|
|
32924
32926
|
const value = await pair.value;
|
|
32925
32927
|
syncPairs.push({
|
|
32926
|
-
key,
|
|
32928
|
+
key: key2,
|
|
32927
32929
|
value,
|
|
32928
32930
|
alwaysSet: pair.alwaysSet
|
|
32929
32931
|
});
|
|
@@ -33048,8 +33050,8 @@ var init_types3 = __esm({
|
|
|
33048
33050
|
// }) as any;
|
|
33049
33051
|
// return merged;
|
|
33050
33052
|
// }
|
|
33051
|
-
setKey(
|
|
33052
|
-
return this.augment({ [
|
|
33053
|
+
setKey(key2, schema) {
|
|
33054
|
+
return this.augment({ [key2]: schema });
|
|
33053
33055
|
}
|
|
33054
33056
|
// merge<Incoming extends AnyZodObject>(
|
|
33055
33057
|
// merging: Incoming
|
|
@@ -33080,9 +33082,9 @@ var init_types3 = __esm({
|
|
|
33080
33082
|
}
|
|
33081
33083
|
pick(mask) {
|
|
33082
33084
|
const shape = {};
|
|
33083
|
-
for (const
|
|
33084
|
-
if (mask[
|
|
33085
|
-
shape[
|
|
33085
|
+
for (const key2 of util.objectKeys(mask)) {
|
|
33086
|
+
if (mask[key2] && this.shape[key2]) {
|
|
33087
|
+
shape[key2] = this.shape[key2];
|
|
33086
33088
|
}
|
|
33087
33089
|
}
|
|
33088
33090
|
return new _ZodObject({
|
|
@@ -33092,9 +33094,9 @@ var init_types3 = __esm({
|
|
|
33092
33094
|
}
|
|
33093
33095
|
omit(mask) {
|
|
33094
33096
|
const shape = {};
|
|
33095
|
-
for (const
|
|
33096
|
-
if (!mask[
|
|
33097
|
-
shape[
|
|
33097
|
+
for (const key2 of util.objectKeys(this.shape)) {
|
|
33098
|
+
if (!mask[key2]) {
|
|
33099
|
+
shape[key2] = this.shape[key2];
|
|
33098
33100
|
}
|
|
33099
33101
|
}
|
|
33100
33102
|
return new _ZodObject({
|
|
@@ -33110,12 +33112,12 @@ var init_types3 = __esm({
|
|
|
33110
33112
|
}
|
|
33111
33113
|
partial(mask) {
|
|
33112
33114
|
const newShape = {};
|
|
33113
|
-
for (const
|
|
33114
|
-
const fieldSchema = this.shape[
|
|
33115
|
-
if (mask && !mask[
|
|
33116
|
-
newShape[
|
|
33115
|
+
for (const key2 of util.objectKeys(this.shape)) {
|
|
33116
|
+
const fieldSchema = this.shape[key2];
|
|
33117
|
+
if (mask && !mask[key2]) {
|
|
33118
|
+
newShape[key2] = fieldSchema;
|
|
33117
33119
|
} else {
|
|
33118
|
-
newShape[
|
|
33120
|
+
newShape[key2] = fieldSchema.optional();
|
|
33119
33121
|
}
|
|
33120
33122
|
}
|
|
33121
33123
|
return new _ZodObject({
|
|
@@ -33125,16 +33127,16 @@ var init_types3 = __esm({
|
|
|
33125
33127
|
}
|
|
33126
33128
|
required(mask) {
|
|
33127
33129
|
const newShape = {};
|
|
33128
|
-
for (const
|
|
33129
|
-
if (mask && !mask[
|
|
33130
|
-
newShape[
|
|
33130
|
+
for (const key2 of util.objectKeys(this.shape)) {
|
|
33131
|
+
if (mask && !mask[key2]) {
|
|
33132
|
+
newShape[key2] = this.shape[key2];
|
|
33131
33133
|
} else {
|
|
33132
|
-
const fieldSchema = this.shape[
|
|
33134
|
+
const fieldSchema = this.shape[key2];
|
|
33133
33135
|
let newField = fieldSchema;
|
|
33134
33136
|
while (newField instanceof ZodOptional) {
|
|
33135
33137
|
newField = newField._def.innerType;
|
|
33136
33138
|
}
|
|
33137
|
-
newShape[
|
|
33139
|
+
newShape[key2] = newField;
|
|
33138
33140
|
}
|
|
33139
33141
|
}
|
|
33140
33142
|
return new _ZodObject({
|
|
@@ -33511,11 +33513,11 @@ var init_types3 = __esm({
|
|
|
33511
33513
|
const pairs = [];
|
|
33512
33514
|
const keyType = this._def.keyType;
|
|
33513
33515
|
const valueType = this._def.valueType;
|
|
33514
|
-
for (const
|
|
33516
|
+
for (const key2 in ctx.data) {
|
|
33515
33517
|
pairs.push({
|
|
33516
|
-
key: keyType._parse(new ParseInputLazyPath(ctx,
|
|
33517
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[
|
|
33518
|
-
alwaysSet:
|
|
33518
|
+
key: keyType._parse(new ParseInputLazyPath(ctx, key2, ctx.path, key2)),
|
|
33519
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key2], ctx.path, key2)),
|
|
33520
|
+
alwaysSet: key2 in ctx.data
|
|
33519
33521
|
});
|
|
33520
33522
|
}
|
|
33521
33523
|
if (ctx.common.async) {
|
|
@@ -33563,9 +33565,9 @@ var init_types3 = __esm({
|
|
|
33563
33565
|
}
|
|
33564
33566
|
const keyType = this._def.keyType;
|
|
33565
33567
|
const valueType = this._def.valueType;
|
|
33566
|
-
const pairs = [...ctx.data.entries()].map(([
|
|
33568
|
+
const pairs = [...ctx.data.entries()].map(([key2, value], index) => {
|
|
33567
33569
|
return {
|
|
33568
|
-
key: keyType._parse(new ParseInputLazyPath(ctx,
|
|
33570
|
+
key: keyType._parse(new ParseInputLazyPath(ctx, key2, ctx.path, [index, "key"])),
|
|
33569
33571
|
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
|
|
33570
33572
|
};
|
|
33571
33573
|
});
|
|
@@ -33573,30 +33575,30 @@ var init_types3 = __esm({
|
|
|
33573
33575
|
const finalMap = /* @__PURE__ */ new Map();
|
|
33574
33576
|
return Promise.resolve().then(async () => {
|
|
33575
33577
|
for (const pair of pairs) {
|
|
33576
|
-
const
|
|
33578
|
+
const key2 = await pair.key;
|
|
33577
33579
|
const value = await pair.value;
|
|
33578
|
-
if (
|
|
33580
|
+
if (key2.status === "aborted" || value.status === "aborted") {
|
|
33579
33581
|
return INVALID;
|
|
33580
33582
|
}
|
|
33581
|
-
if (
|
|
33583
|
+
if (key2.status === "dirty" || value.status === "dirty") {
|
|
33582
33584
|
status.dirty();
|
|
33583
33585
|
}
|
|
33584
|
-
finalMap.set(
|
|
33586
|
+
finalMap.set(key2.value, value.value);
|
|
33585
33587
|
}
|
|
33586
33588
|
return { status: status.value, value: finalMap };
|
|
33587
33589
|
});
|
|
33588
33590
|
} else {
|
|
33589
33591
|
const finalMap = /* @__PURE__ */ new Map();
|
|
33590
33592
|
for (const pair of pairs) {
|
|
33591
|
-
const
|
|
33593
|
+
const key2 = pair.key;
|
|
33592
33594
|
const value = pair.value;
|
|
33593
|
-
if (
|
|
33595
|
+
if (key2.status === "aborted" || value.status === "aborted") {
|
|
33594
33596
|
return INVALID;
|
|
33595
33597
|
}
|
|
33596
|
-
if (
|
|
33598
|
+
if (key2.status === "dirty" || value.status === "dirty") {
|
|
33597
33599
|
status.dirty();
|
|
33598
33600
|
}
|
|
33599
|
-
finalMap.set(
|
|
33601
|
+
finalMap.set(key2.value, value.value);
|
|
33600
33602
|
}
|
|
33601
33603
|
return { status: status.value, value: finalMap };
|
|
33602
33604
|
}
|
|
@@ -34648,9 +34650,9 @@ function floatSafeRemainder2(val, step) {
|
|
|
34648
34650
|
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
34649
34651
|
return valInt % stepInt / 10 ** decCount;
|
|
34650
34652
|
}
|
|
34651
|
-
function defineLazy(object3,
|
|
34653
|
+
function defineLazy(object3, key2, getter) {
|
|
34652
34654
|
let value = void 0;
|
|
34653
|
-
Object.defineProperty(object3,
|
|
34655
|
+
Object.defineProperty(object3, key2, {
|
|
34654
34656
|
get() {
|
|
34655
34657
|
if (value === EVALUATING) {
|
|
34656
34658
|
return void 0;
|
|
@@ -34662,7 +34664,7 @@ function defineLazy(object3, key, getter) {
|
|
|
34662
34664
|
return value;
|
|
34663
34665
|
},
|
|
34664
34666
|
set(v) {
|
|
34665
|
-
Object.defineProperty(object3,
|
|
34667
|
+
Object.defineProperty(object3, key2, {
|
|
34666
34668
|
value: v
|
|
34667
34669
|
// configurable: true,
|
|
34668
34670
|
});
|
|
@@ -34695,11 +34697,11 @@ function cloneDef(schema) {
|
|
|
34695
34697
|
function getElementAtPath(obj, path2) {
|
|
34696
34698
|
if (!path2)
|
|
34697
34699
|
return obj;
|
|
34698
|
-
return path2.reduce((acc,
|
|
34700
|
+
return path2.reduce((acc, key2) => acc?.[key2], obj);
|
|
34699
34701
|
}
|
|
34700
34702
|
function promiseAllObject(promisesObj) {
|
|
34701
34703
|
const keys = Object.keys(promisesObj);
|
|
34702
|
-
const promises = keys.map((
|
|
34704
|
+
const promises = keys.map((key2) => promisesObj[key2]);
|
|
34703
34705
|
return Promise.all(promises).then((results) => {
|
|
34704
34706
|
const resolvedObj = {};
|
|
34705
34707
|
for (let i = 0; i < keys.length; i++) {
|
|
@@ -34750,8 +34752,8 @@ function shallowClone(o) {
|
|
|
34750
34752
|
}
|
|
34751
34753
|
function numKeys(data) {
|
|
34752
34754
|
let keyCount = 0;
|
|
34753
|
-
for (const
|
|
34754
|
-
if (Object.prototype.hasOwnProperty.call(data,
|
|
34755
|
+
for (const key2 in data) {
|
|
34756
|
+
if (Object.prototype.hasOwnProperty.call(data, key2)) {
|
|
34755
34757
|
keyCount++;
|
|
34756
34758
|
}
|
|
34757
34759
|
}
|
|
@@ -34837,13 +34839,13 @@ function pick(schema, mask) {
|
|
|
34837
34839
|
const def = mergeDefs(schema._zod.def, {
|
|
34838
34840
|
get shape() {
|
|
34839
34841
|
const newShape = {};
|
|
34840
|
-
for (const
|
|
34841
|
-
if (!(
|
|
34842
|
-
throw new Error(`Unrecognized key: "${
|
|
34842
|
+
for (const key2 in mask) {
|
|
34843
|
+
if (!(key2 in currDef.shape)) {
|
|
34844
|
+
throw new Error(`Unrecognized key: "${key2}"`);
|
|
34843
34845
|
}
|
|
34844
|
-
if (!mask[
|
|
34846
|
+
if (!mask[key2])
|
|
34845
34847
|
continue;
|
|
34846
|
-
newShape[
|
|
34848
|
+
newShape[key2] = currDef.shape[key2];
|
|
34847
34849
|
}
|
|
34848
34850
|
assignProp(this, "shape", newShape);
|
|
34849
34851
|
return newShape;
|
|
@@ -34862,13 +34864,13 @@ function omit(schema, mask) {
|
|
|
34862
34864
|
const def = mergeDefs(schema._zod.def, {
|
|
34863
34865
|
get shape() {
|
|
34864
34866
|
const newShape = { ...schema._zod.def.shape };
|
|
34865
|
-
for (const
|
|
34866
|
-
if (!(
|
|
34867
|
-
throw new Error(`Unrecognized key: "${
|
|
34867
|
+
for (const key2 in mask) {
|
|
34868
|
+
if (!(key2 in currDef.shape)) {
|
|
34869
|
+
throw new Error(`Unrecognized key: "${key2}"`);
|
|
34868
34870
|
}
|
|
34869
|
-
if (!mask[
|
|
34871
|
+
if (!mask[key2])
|
|
34870
34872
|
continue;
|
|
34871
|
-
delete newShape[
|
|
34873
|
+
delete newShape[key2];
|
|
34872
34874
|
}
|
|
34873
34875
|
assignProp(this, "shape", newShape);
|
|
34874
34876
|
return newShape;
|
|
@@ -34885,8 +34887,8 @@ function extend(schema, shape) {
|
|
|
34885
34887
|
const hasChecks = checks && checks.length > 0;
|
|
34886
34888
|
if (hasChecks) {
|
|
34887
34889
|
const existingShape = schema._zod.def.shape;
|
|
34888
|
-
for (const
|
|
34889
|
-
if (Object.getOwnPropertyDescriptor(existingShape,
|
|
34890
|
+
for (const key2 in shape) {
|
|
34891
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key2) !== void 0) {
|
|
34890
34892
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
34891
34893
|
}
|
|
34892
34894
|
}
|
|
@@ -34940,23 +34942,23 @@ function partial(Class2, schema, mask) {
|
|
|
34940
34942
|
const oldShape = schema._zod.def.shape;
|
|
34941
34943
|
const shape = { ...oldShape };
|
|
34942
34944
|
if (mask) {
|
|
34943
|
-
for (const
|
|
34944
|
-
if (!(
|
|
34945
|
-
throw new Error(`Unrecognized key: "${
|
|
34945
|
+
for (const key2 in mask) {
|
|
34946
|
+
if (!(key2 in oldShape)) {
|
|
34947
|
+
throw new Error(`Unrecognized key: "${key2}"`);
|
|
34946
34948
|
}
|
|
34947
|
-
if (!mask[
|
|
34949
|
+
if (!mask[key2])
|
|
34948
34950
|
continue;
|
|
34949
|
-
shape[
|
|
34951
|
+
shape[key2] = Class2 ? new Class2({
|
|
34950
34952
|
type: "optional",
|
|
34951
|
-
innerType: oldShape[
|
|
34952
|
-
}) : oldShape[
|
|
34953
|
+
innerType: oldShape[key2]
|
|
34954
|
+
}) : oldShape[key2];
|
|
34953
34955
|
}
|
|
34954
34956
|
} else {
|
|
34955
|
-
for (const
|
|
34956
|
-
shape[
|
|
34957
|
+
for (const key2 in oldShape) {
|
|
34958
|
+
shape[key2] = Class2 ? new Class2({
|
|
34957
34959
|
type: "optional",
|
|
34958
|
-
innerType: oldShape[
|
|
34959
|
-
}) : oldShape[
|
|
34960
|
+
innerType: oldShape[key2]
|
|
34961
|
+
}) : oldShape[key2];
|
|
34960
34962
|
}
|
|
34961
34963
|
}
|
|
34962
34964
|
assignProp(this, "shape", shape);
|
|
@@ -34972,22 +34974,22 @@ function required(Class2, schema, mask) {
|
|
|
34972
34974
|
const oldShape = schema._zod.def.shape;
|
|
34973
34975
|
const shape = { ...oldShape };
|
|
34974
34976
|
if (mask) {
|
|
34975
|
-
for (const
|
|
34976
|
-
if (!(
|
|
34977
|
-
throw new Error(`Unrecognized key: "${
|
|
34977
|
+
for (const key2 in mask) {
|
|
34978
|
+
if (!(key2 in shape)) {
|
|
34979
|
+
throw new Error(`Unrecognized key: "${key2}"`);
|
|
34978
34980
|
}
|
|
34979
|
-
if (!mask[
|
|
34981
|
+
if (!mask[key2])
|
|
34980
34982
|
continue;
|
|
34981
|
-
shape[
|
|
34983
|
+
shape[key2] = new Class2({
|
|
34982
34984
|
type: "nonoptional",
|
|
34983
|
-
innerType: oldShape[
|
|
34985
|
+
innerType: oldShape[key2]
|
|
34984
34986
|
});
|
|
34985
34987
|
}
|
|
34986
34988
|
} else {
|
|
34987
|
-
for (const
|
|
34988
|
-
shape[
|
|
34989
|
+
for (const key2 in oldShape) {
|
|
34990
|
+
shape[key2] = new Class2({
|
|
34989
34991
|
type: "nonoptional",
|
|
34990
|
-
innerType: oldShape[
|
|
34992
|
+
innerType: oldShape[key2]
|
|
34991
34993
|
});
|
|
34992
34994
|
}
|
|
34993
34995
|
}
|
|
@@ -36183,19 +36185,19 @@ function handleArrayResult(result, final, index) {
|
|
|
36183
36185
|
}
|
|
36184
36186
|
final.value[index] = result.value;
|
|
36185
36187
|
}
|
|
36186
|
-
function handlePropertyResult(result, final,
|
|
36188
|
+
function handlePropertyResult(result, final, key2, input, isOptionalOut) {
|
|
36187
36189
|
if (result.issues.length) {
|
|
36188
|
-
if (isOptionalOut && !(
|
|
36190
|
+
if (isOptionalOut && !(key2 in input)) {
|
|
36189
36191
|
return;
|
|
36190
36192
|
}
|
|
36191
|
-
final.issues.push(...prefixIssues(
|
|
36193
|
+
final.issues.push(...prefixIssues(key2, result.issues));
|
|
36192
36194
|
}
|
|
36193
36195
|
if (result.value === void 0) {
|
|
36194
|
-
if (
|
|
36195
|
-
final.value[
|
|
36196
|
+
if (key2 in input) {
|
|
36197
|
+
final.value[key2] = void 0;
|
|
36196
36198
|
}
|
|
36197
36199
|
} else {
|
|
36198
|
-
final.value[
|
|
36200
|
+
final.value[key2] = result.value;
|
|
36199
36201
|
}
|
|
36200
36202
|
}
|
|
36201
36203
|
function normalizeDef(def) {
|
|
@@ -36220,18 +36222,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
36220
36222
|
const _catchall = def.catchall._zod;
|
|
36221
36223
|
const t = _catchall.def.type;
|
|
36222
36224
|
const isOptionalOut = _catchall.optout === "optional";
|
|
36223
|
-
for (const
|
|
36224
|
-
if (keySet.has(
|
|
36225
|
+
for (const key2 in input) {
|
|
36226
|
+
if (keySet.has(key2))
|
|
36225
36227
|
continue;
|
|
36226
36228
|
if (t === "never") {
|
|
36227
|
-
unrecognized.push(
|
|
36229
|
+
unrecognized.push(key2);
|
|
36228
36230
|
continue;
|
|
36229
36231
|
}
|
|
36230
|
-
const r = _catchall.run({ value: input[
|
|
36232
|
+
const r = _catchall.run({ value: input[key2], issues: [] }, ctx);
|
|
36231
36233
|
if (r instanceof Promise) {
|
|
36232
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
36234
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input, isOptionalOut)));
|
|
36233
36235
|
} else {
|
|
36234
|
-
handlePropertyResult(r, payload,
|
|
36236
|
+
handlePropertyResult(r, payload, key2, input, isOptionalOut);
|
|
36235
36237
|
}
|
|
36236
36238
|
}
|
|
36237
36239
|
if (unrecognized.length) {
|
|
@@ -36301,17 +36303,17 @@ function mergeValues2(a, b) {
|
|
|
36301
36303
|
}
|
|
36302
36304
|
if (isPlainObject(a) && isPlainObject(b)) {
|
|
36303
36305
|
const bKeys = Object.keys(b);
|
|
36304
|
-
const sharedKeys = Object.keys(a).filter((
|
|
36306
|
+
const sharedKeys = Object.keys(a).filter((key2) => bKeys.indexOf(key2) !== -1);
|
|
36305
36307
|
const newObj = { ...a, ...b };
|
|
36306
|
-
for (const
|
|
36307
|
-
const sharedValue = mergeValues2(a[
|
|
36308
|
+
for (const key2 of sharedKeys) {
|
|
36309
|
+
const sharedValue = mergeValues2(a[key2], b[key2]);
|
|
36308
36310
|
if (!sharedValue.valid) {
|
|
36309
36311
|
return {
|
|
36310
36312
|
valid: false,
|
|
36311
|
-
mergeErrorPath: [
|
|
36313
|
+
mergeErrorPath: [key2, ...sharedValue.mergeErrorPath]
|
|
36312
36314
|
};
|
|
36313
36315
|
}
|
|
36314
|
-
newObj[
|
|
36316
|
+
newObj[key2] = sharedValue.data;
|
|
36315
36317
|
}
|
|
36316
36318
|
return { valid: true, data: newObj };
|
|
36317
36319
|
}
|
|
@@ -36381,10 +36383,10 @@ function handleTupleResult(result, final, index) {
|
|
|
36381
36383
|
}
|
|
36382
36384
|
final.value[index] = result.value;
|
|
36383
36385
|
}
|
|
36384
|
-
function handleMapResult(keyResult, valueResult, final,
|
|
36386
|
+
function handleMapResult(keyResult, valueResult, final, key2, input, inst, ctx) {
|
|
36385
36387
|
if (keyResult.issues.length) {
|
|
36386
|
-
if (propertyKeyTypes.has(typeof
|
|
36387
|
-
final.issues.push(...prefixIssues(
|
|
36388
|
+
if (propertyKeyTypes.has(typeof key2)) {
|
|
36389
|
+
final.issues.push(...prefixIssues(key2, keyResult.issues));
|
|
36388
36390
|
} else {
|
|
36389
36391
|
final.issues.push({
|
|
36390
36392
|
code: "invalid_key",
|
|
@@ -36396,15 +36398,15 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
36396
36398
|
}
|
|
36397
36399
|
}
|
|
36398
36400
|
if (valueResult.issues.length) {
|
|
36399
|
-
if (propertyKeyTypes.has(typeof
|
|
36400
|
-
final.issues.push(...prefixIssues(
|
|
36401
|
+
if (propertyKeyTypes.has(typeof key2)) {
|
|
36402
|
+
final.issues.push(...prefixIssues(key2, valueResult.issues));
|
|
36401
36403
|
} else {
|
|
36402
36404
|
final.issues.push({
|
|
36403
36405
|
origin: "map",
|
|
36404
36406
|
code: "invalid_element",
|
|
36405
36407
|
input,
|
|
36406
36408
|
inst,
|
|
36407
|
-
key,
|
|
36409
|
+
key: key2,
|
|
36408
36410
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config3()))
|
|
36409
36411
|
});
|
|
36410
36412
|
}
|
|
@@ -37121,12 +37123,12 @@ var init_schemas = __esm({
|
|
|
37121
37123
|
defineLazy(inst._zod, "propValues", () => {
|
|
37122
37124
|
const shape = def.shape;
|
|
37123
37125
|
const propValues = {};
|
|
37124
|
-
for (const
|
|
37125
|
-
const field = shape[
|
|
37126
|
+
for (const key2 in shape) {
|
|
37127
|
+
const field = shape[key2]._zod;
|
|
37126
37128
|
if (field.values) {
|
|
37127
|
-
propValues[
|
|
37129
|
+
propValues[key2] ?? (propValues[key2] = /* @__PURE__ */ new Set());
|
|
37128
37130
|
for (const v of field.values)
|
|
37129
|
-
propValues[
|
|
37131
|
+
propValues[key2].add(v);
|
|
37130
37132
|
}
|
|
37131
37133
|
}
|
|
37132
37134
|
return propValues;
|
|
@@ -37149,14 +37151,14 @@ var init_schemas = __esm({
|
|
|
37149
37151
|
payload.value = {};
|
|
37150
37152
|
const proms = [];
|
|
37151
37153
|
const shape = value.shape;
|
|
37152
|
-
for (const
|
|
37153
|
-
const el = shape[
|
|
37154
|
+
for (const key2 of value.keys) {
|
|
37155
|
+
const el = shape[key2];
|
|
37154
37156
|
const isOptionalOut = el._zod.optout === "optional";
|
|
37155
|
-
const r = el._zod.run({ value: input[
|
|
37157
|
+
const r = el._zod.run({ value: input[key2], issues: [] }, ctx);
|
|
37156
37158
|
if (r instanceof Promise) {
|
|
37157
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
37159
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input, isOptionalOut)));
|
|
37158
37160
|
} else {
|
|
37159
|
-
handlePropertyResult(r, payload,
|
|
37161
|
+
handlePropertyResult(r, payload, key2, input, isOptionalOut);
|
|
37160
37162
|
}
|
|
37161
37163
|
}
|
|
37162
37164
|
if (!catchall) {
|
|
@@ -37172,23 +37174,23 @@ var init_schemas = __esm({
|
|
|
37172
37174
|
const generateFastpass = (shape) => {
|
|
37173
37175
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
37174
37176
|
const normalized = _normalized.value;
|
|
37175
|
-
const parseStr = (
|
|
37176
|
-
const k = esc(
|
|
37177
|
+
const parseStr = (key2) => {
|
|
37178
|
+
const k = esc(key2);
|
|
37177
37179
|
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
37178
37180
|
};
|
|
37179
37181
|
doc.write(`const input = payload.value;`);
|
|
37180
37182
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
37181
37183
|
let counter = 0;
|
|
37182
|
-
for (const
|
|
37183
|
-
ids[
|
|
37184
|
+
for (const key2 of normalized.keys) {
|
|
37185
|
+
ids[key2] = `key_${counter++}`;
|
|
37184
37186
|
}
|
|
37185
37187
|
doc.write(`const newResult = {};`);
|
|
37186
|
-
for (const
|
|
37187
|
-
const id = ids[
|
|
37188
|
-
const k = esc(
|
|
37189
|
-
const schema = shape[
|
|
37188
|
+
for (const key2 of normalized.keys) {
|
|
37189
|
+
const id = ids[key2];
|
|
37190
|
+
const k = esc(key2);
|
|
37191
|
+
const schema = shape[key2];
|
|
37190
37192
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
37191
|
-
doc.write(`const ${id} = ${parseStr(
|
|
37193
|
+
doc.write(`const ${id} = ${parseStr(key2)};`);
|
|
37192
37194
|
if (isOptionalOut) {
|
|
37193
37195
|
doc.write(`
|
|
37194
37196
|
if (${id}.issues.length) {
|
|
@@ -37507,30 +37509,30 @@ var init_schemas = __esm({
|
|
|
37507
37509
|
if (values) {
|
|
37508
37510
|
payload.value = {};
|
|
37509
37511
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
37510
|
-
for (const
|
|
37511
|
-
if (typeof
|
|
37512
|
-
recordKeys.add(typeof
|
|
37513
|
-
const result = def.valueType._zod.run({ value: input[
|
|
37512
|
+
for (const key2 of values) {
|
|
37513
|
+
if (typeof key2 === "string" || typeof key2 === "number" || typeof key2 === "symbol") {
|
|
37514
|
+
recordKeys.add(typeof key2 === "number" ? key2.toString() : key2);
|
|
37515
|
+
const result = def.valueType._zod.run({ value: input[key2], issues: [] }, ctx);
|
|
37514
37516
|
if (result instanceof Promise) {
|
|
37515
37517
|
proms.push(result.then((result2) => {
|
|
37516
37518
|
if (result2.issues.length) {
|
|
37517
|
-
payload.issues.push(...prefixIssues(
|
|
37519
|
+
payload.issues.push(...prefixIssues(key2, result2.issues));
|
|
37518
37520
|
}
|
|
37519
|
-
payload.value[
|
|
37521
|
+
payload.value[key2] = result2.value;
|
|
37520
37522
|
}));
|
|
37521
37523
|
} else {
|
|
37522
37524
|
if (result.issues.length) {
|
|
37523
|
-
payload.issues.push(...prefixIssues(
|
|
37525
|
+
payload.issues.push(...prefixIssues(key2, result.issues));
|
|
37524
37526
|
}
|
|
37525
|
-
payload.value[
|
|
37527
|
+
payload.value[key2] = result.value;
|
|
37526
37528
|
}
|
|
37527
37529
|
}
|
|
37528
37530
|
}
|
|
37529
37531
|
let unrecognized;
|
|
37530
|
-
for (const
|
|
37531
|
-
if (!recordKeys.has(
|
|
37532
|
+
for (const key2 in input) {
|
|
37533
|
+
if (!recordKeys.has(key2)) {
|
|
37532
37534
|
unrecognized = unrecognized ?? [];
|
|
37533
|
-
unrecognized.push(
|
|
37535
|
+
unrecognized.push(key2);
|
|
37534
37536
|
}
|
|
37535
37537
|
}
|
|
37536
37538
|
if (unrecognized && unrecognized.length > 0) {
|
|
@@ -37543,16 +37545,16 @@ var init_schemas = __esm({
|
|
|
37543
37545
|
}
|
|
37544
37546
|
} else {
|
|
37545
37547
|
payload.value = {};
|
|
37546
|
-
for (const
|
|
37547
|
-
if (
|
|
37548
|
+
for (const key2 of Reflect.ownKeys(input)) {
|
|
37549
|
+
if (key2 === "__proto__")
|
|
37548
37550
|
continue;
|
|
37549
|
-
let keyResult = def.keyType._zod.run({ value:
|
|
37551
|
+
let keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
37550
37552
|
if (keyResult instanceof Promise) {
|
|
37551
37553
|
throw new Error("Async schemas not supported in object keys currently");
|
|
37552
37554
|
}
|
|
37553
|
-
const checkNumericKey = typeof
|
|
37555
|
+
const checkNumericKey = typeof key2 === "string" && number.test(key2) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number");
|
|
37554
37556
|
if (checkNumericKey) {
|
|
37555
|
-
const retryResult = def.keyType._zod.run({ value: Number(
|
|
37557
|
+
const retryResult = def.keyType._zod.run({ value: Number(key2), issues: [] }, ctx);
|
|
37556
37558
|
if (retryResult instanceof Promise) {
|
|
37557
37559
|
throw new Error("Async schemas not supported in object keys currently");
|
|
37558
37560
|
}
|
|
@@ -37562,30 +37564,30 @@ var init_schemas = __esm({
|
|
|
37562
37564
|
}
|
|
37563
37565
|
if (keyResult.issues.length) {
|
|
37564
37566
|
if (def.mode === "loose") {
|
|
37565
|
-
payload.value[
|
|
37567
|
+
payload.value[key2] = input[key2];
|
|
37566
37568
|
} else {
|
|
37567
37569
|
payload.issues.push({
|
|
37568
37570
|
code: "invalid_key",
|
|
37569
37571
|
origin: "record",
|
|
37570
37572
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config3())),
|
|
37571
|
-
input:
|
|
37572
|
-
path: [
|
|
37573
|
+
input: key2,
|
|
37574
|
+
path: [key2],
|
|
37573
37575
|
inst
|
|
37574
37576
|
});
|
|
37575
37577
|
}
|
|
37576
37578
|
continue;
|
|
37577
37579
|
}
|
|
37578
|
-
const result = def.valueType._zod.run({ value: input[
|
|
37580
|
+
const result = def.valueType._zod.run({ value: input[key2], issues: [] }, ctx);
|
|
37579
37581
|
if (result instanceof Promise) {
|
|
37580
37582
|
proms.push(result.then((result2) => {
|
|
37581
37583
|
if (result2.issues.length) {
|
|
37582
|
-
payload.issues.push(...prefixIssues(
|
|
37584
|
+
payload.issues.push(...prefixIssues(key2, result2.issues));
|
|
37583
37585
|
}
|
|
37584
37586
|
payload.value[keyResult.value] = result2.value;
|
|
37585
37587
|
}));
|
|
37586
37588
|
} else {
|
|
37587
37589
|
if (result.issues.length) {
|
|
37588
|
-
payload.issues.push(...prefixIssues(
|
|
37590
|
+
payload.issues.push(...prefixIssues(key2, result.issues));
|
|
37589
37591
|
}
|
|
37590
37592
|
payload.value[keyResult.value] = result.value;
|
|
37591
37593
|
}
|
|
@@ -37612,15 +37614,15 @@ var init_schemas = __esm({
|
|
|
37612
37614
|
}
|
|
37613
37615
|
const proms = [];
|
|
37614
37616
|
payload.value = /* @__PURE__ */ new Map();
|
|
37615
|
-
for (const [
|
|
37616
|
-
const keyResult = def.keyType._zod.run({ value:
|
|
37617
|
+
for (const [key2, value] of input) {
|
|
37618
|
+
const keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
37617
37619
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
37618
37620
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
37619
37621
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
37620
|
-
handleMapResult(keyResult2, valueResult2, payload,
|
|
37622
|
+
handleMapResult(keyResult2, valueResult2, payload, key2, input, inst, ctx);
|
|
37621
37623
|
}));
|
|
37622
37624
|
} else {
|
|
37623
|
-
handleMapResult(keyResult, valueResult, payload,
|
|
37625
|
+
handleMapResult(keyResult, valueResult, payload, key2, input, inst, ctx);
|
|
37624
37626
|
}
|
|
37625
37627
|
}
|
|
37626
37628
|
if (proms.length)
|
|
@@ -39614,8 +39616,8 @@ function extractDefs(ctx, schema) {
|
|
|
39614
39616
|
if (defId)
|
|
39615
39617
|
seen.defId = defId;
|
|
39616
39618
|
const schema2 = seen.schema;
|
|
39617
|
-
for (const
|
|
39618
|
-
delete schema2[
|
|
39619
|
+
for (const key2 in schema2) {
|
|
39620
|
+
delete schema2[key2];
|
|
39619
39621
|
}
|
|
39620
39622
|
schema2.$ref = ref;
|
|
39621
39623
|
};
|
|
@@ -39684,20 +39686,20 @@ function finalize(ctx, schema) {
|
|
|
39684
39686
|
Object.assign(schema2, _cached);
|
|
39685
39687
|
const isParentRef = zodSchema._zod.parent === ref;
|
|
39686
39688
|
if (isParentRef) {
|
|
39687
|
-
for (const
|
|
39688
|
-
if (
|
|
39689
|
+
for (const key2 in schema2) {
|
|
39690
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
39689
39691
|
continue;
|
|
39690
|
-
if (!(
|
|
39691
|
-
delete schema2[
|
|
39692
|
+
if (!(key2 in _cached)) {
|
|
39693
|
+
delete schema2[key2];
|
|
39692
39694
|
}
|
|
39693
39695
|
}
|
|
39694
39696
|
}
|
|
39695
39697
|
if (refSchema.$ref) {
|
|
39696
|
-
for (const
|
|
39697
|
-
if (
|
|
39698
|
+
for (const key2 in schema2) {
|
|
39699
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
39698
39700
|
continue;
|
|
39699
|
-
if (
|
|
39700
|
-
delete schema2[
|
|
39701
|
+
if (key2 in refSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(refSeen.def[key2])) {
|
|
39702
|
+
delete schema2[key2];
|
|
39701
39703
|
}
|
|
39702
39704
|
}
|
|
39703
39705
|
}
|
|
@@ -39709,11 +39711,11 @@ function finalize(ctx, schema) {
|
|
|
39709
39711
|
if (parentSeen?.schema.$ref) {
|
|
39710
39712
|
schema2.$ref = parentSeen.schema.$ref;
|
|
39711
39713
|
if (parentSeen.def) {
|
|
39712
|
-
for (const
|
|
39713
|
-
if (
|
|
39714
|
+
for (const key2 in schema2) {
|
|
39715
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
39714
39716
|
continue;
|
|
39715
|
-
if (
|
|
39716
|
-
delete schema2[
|
|
39717
|
+
if (key2 in parentSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(parentSeen.def[key2])) {
|
|
39718
|
+
delete schema2[key2];
|
|
39717
39719
|
}
|
|
39718
39720
|
}
|
|
39719
39721
|
}
|
|
@@ -39807,8 +39809,8 @@ function isTransforming(_schema, _ctx) {
|
|
|
39807
39809
|
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
39808
39810
|
}
|
|
39809
39811
|
if (def.type === "object") {
|
|
39810
|
-
for (const
|
|
39811
|
-
if (isTransforming(def.shape[
|
|
39812
|
+
for (const key2 in def.shape) {
|
|
39813
|
+
if (isTransforming(def.shape[key2], ctx))
|
|
39812
39814
|
return true;
|
|
39813
39815
|
}
|
|
39814
39816
|
return false;
|
|
@@ -39869,9 +39871,9 @@ function toJSONSchema(input, params) {
|
|
|
39869
39871
|
};
|
|
39870
39872
|
ctx2.external = external;
|
|
39871
39873
|
for (const entry2 of registry2._idmap.entries()) {
|
|
39872
|
-
const [
|
|
39874
|
+
const [key2, schema] = entry2;
|
|
39873
39875
|
extractDefs(ctx2, schema);
|
|
39874
|
-
schemas[
|
|
39876
|
+
schemas[key2] = finalize(ctx2, schema);
|
|
39875
39877
|
}
|
|
39876
39878
|
if (Object.keys(defs).length > 0) {
|
|
39877
39879
|
const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
@@ -40150,15 +40152,15 @@ var init_json_schema_processors = __esm({
|
|
|
40150
40152
|
json2.type = "object";
|
|
40151
40153
|
json2.properties = {};
|
|
40152
40154
|
const shape = def.shape;
|
|
40153
|
-
for (const
|
|
40154
|
-
json2.properties[
|
|
40155
|
+
for (const key2 in shape) {
|
|
40156
|
+
json2.properties[key2] = process2(shape[key2], ctx, {
|
|
40155
40157
|
...params,
|
|
40156
|
-
path: [...params.path, "properties",
|
|
40158
|
+
path: [...params.path, "properties", key2]
|
|
40157
40159
|
});
|
|
40158
40160
|
}
|
|
40159
40161
|
const allKeys = new Set(Object.keys(shape));
|
|
40160
|
-
const requiredKeys = new Set([...allKeys].filter((
|
|
40161
|
-
const v = def.shape[
|
|
40162
|
+
const requiredKeys = new Set([...allKeys].filter((key2) => {
|
|
40163
|
+
const v = def.shape[key2]._zod;
|
|
40162
40164
|
if (ctx.io === "input") {
|
|
40163
40165
|
return v.optin === void 0;
|
|
40164
40166
|
} else {
|
|
@@ -43796,19 +43798,19 @@ var init_Refs = __esm({
|
|
|
43796
43798
|
});
|
|
43797
43799
|
|
|
43798
43800
|
// ../../node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
43799
|
-
function addErrorMessage(res,
|
|
43801
|
+
function addErrorMessage(res, key2, errorMessage, refs) {
|
|
43800
43802
|
if (!refs?.errorMessages)
|
|
43801
43803
|
return;
|
|
43802
43804
|
if (errorMessage) {
|
|
43803
43805
|
res.errorMessage = {
|
|
43804
43806
|
...res.errorMessage,
|
|
43805
|
-
[
|
|
43807
|
+
[key2]: errorMessage
|
|
43806
43808
|
};
|
|
43807
43809
|
}
|
|
43808
43810
|
}
|
|
43809
|
-
function setResponseValueAndErrors(res,
|
|
43810
|
-
res[
|
|
43811
|
-
addErrorMessage(res,
|
|
43811
|
+
function setResponseValueAndErrors(res, key2, value, errorMessage, refs) {
|
|
43812
|
+
res[key2] = value;
|
|
43813
|
+
addErrorMessage(res, key2, errorMessage, refs);
|
|
43812
43814
|
}
|
|
43813
43815
|
var init_errorMessages = __esm({
|
|
43814
43816
|
"../../node_modules/zod-to-json-schema/dist/esm/errorMessages.js"() {
|
|
@@ -44478,11 +44480,11 @@ function parseRecordDef(def, refs) {
|
|
|
44478
44480
|
return {
|
|
44479
44481
|
type: "object",
|
|
44480
44482
|
required: def.keyType._def.values,
|
|
44481
|
-
properties: def.keyType._def.values.reduce((acc,
|
|
44483
|
+
properties: def.keyType._def.values.reduce((acc, key2) => ({
|
|
44482
44484
|
...acc,
|
|
44483
|
-
[
|
|
44485
|
+
[key2]: parseDef(def.valueType._def, {
|
|
44484
44486
|
...refs,
|
|
44485
|
-
currentPath: [...refs.currentPath, "properties",
|
|
44487
|
+
currentPath: [...refs.currentPath, "properties", key2]
|
|
44486
44488
|
}) ?? parseAnyDef(refs)
|
|
44487
44489
|
}), {}),
|
|
44488
44490
|
additionalProperties: refs.rejectedAdditionalProperties
|
|
@@ -44565,10 +44567,10 @@ var init_map = __esm({
|
|
|
44565
44567
|
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
44566
44568
|
function parseNativeEnumDef(def) {
|
|
44567
44569
|
const object3 = def.values;
|
|
44568
|
-
const actualKeys = Object.keys(def.values).filter((
|
|
44569
|
-
return typeof object3[object3[
|
|
44570
|
+
const actualKeys = Object.keys(def.values).filter((key2) => {
|
|
44571
|
+
return typeof object3[object3[key2]] !== "number";
|
|
44570
44572
|
});
|
|
44571
|
-
const actualValues = actualKeys.map((
|
|
44573
|
+
const actualValues = actualKeys.map((key2) => object3[key2]);
|
|
44572
44574
|
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
|
|
44573
44575
|
return {
|
|
44574
44576
|
type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
@@ -45357,8 +45359,8 @@ function isPlainObject2(value) {
|
|
|
45357
45359
|
}
|
|
45358
45360
|
function mergeCapabilities(base, additional) {
|
|
45359
45361
|
const result = { ...base };
|
|
45360
|
-
for (const
|
|
45361
|
-
const k =
|
|
45362
|
+
for (const key2 in additional) {
|
|
45363
|
+
const k = key2;
|
|
45362
45364
|
const addValue = additional[k];
|
|
45363
45365
|
if (addValue === void 0)
|
|
45364
45366
|
continue;
|
|
@@ -46444,15 +46446,15 @@ var require_code = __commonJS({
|
|
|
46444
46446
|
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
46445
46447
|
}
|
|
46446
46448
|
exports2.safeStringify = safeStringify;
|
|
46447
|
-
function getProperty(
|
|
46448
|
-
return typeof
|
|
46449
|
+
function getProperty(key2) {
|
|
46450
|
+
return typeof key2 == "string" && exports2.IDENTIFIER.test(key2) ? new _Code(`.${key2}`) : _`[${key2}]`;
|
|
46449
46451
|
}
|
|
46450
46452
|
exports2.getProperty = getProperty;
|
|
46451
|
-
function getEsmExportName(
|
|
46452
|
-
if (typeof
|
|
46453
|
-
return new _Code(`${
|
|
46453
|
+
function getEsmExportName(key2) {
|
|
46454
|
+
if (typeof key2 == "string" && exports2.IDENTIFIER.test(key2)) {
|
|
46455
|
+
return new _Code(`${key2}`);
|
|
46454
46456
|
}
|
|
46455
|
-
throw new Error(`CodeGen: invalid export name: ${
|
|
46457
|
+
throw new Error(`CodeGen: invalid export name: ${key2}, use explicit $id name mapping`);
|
|
46456
46458
|
}
|
|
46457
46459
|
exports2.getEsmExportName = getEsmExportName;
|
|
46458
46460
|
function regexpCode(rx) {
|
|
@@ -47079,11 +47081,11 @@ var require_codegen = __commonJS({
|
|
|
47079
47081
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
47080
47082
|
object(...keyValues) {
|
|
47081
47083
|
const code = ["{"];
|
|
47082
|
-
for (const [
|
|
47084
|
+
for (const [key2, value] of keyValues) {
|
|
47083
47085
|
if (code.length > 1)
|
|
47084
47086
|
code.push(",");
|
|
47085
|
-
code.push(
|
|
47086
|
-
if (
|
|
47087
|
+
code.push(key2);
|
|
47088
|
+
if (key2 !== value || this.opts.es5) {
|
|
47087
47089
|
code.push(":");
|
|
47088
47090
|
(0, code_1.addCodeArg)(code, value);
|
|
47089
47091
|
}
|
|
@@ -47358,17 +47360,17 @@ var require_util2 = __commonJS({
|
|
|
47358
47360
|
if (typeof schema === "boolean")
|
|
47359
47361
|
return;
|
|
47360
47362
|
const rules = self.RULES.keywords;
|
|
47361
|
-
for (const
|
|
47362
|
-
if (!rules[
|
|
47363
|
-
checkStrictMode(it, `unknown keyword: "${
|
|
47363
|
+
for (const key2 in schema) {
|
|
47364
|
+
if (!rules[key2])
|
|
47365
|
+
checkStrictMode(it, `unknown keyword: "${key2}"`);
|
|
47364
47366
|
}
|
|
47365
47367
|
}
|
|
47366
47368
|
exports2.checkUnknownRules = checkUnknownRules;
|
|
47367
47369
|
function schemaHasRules(schema, rules) {
|
|
47368
47370
|
if (typeof schema == "boolean")
|
|
47369
47371
|
return !schema;
|
|
47370
|
-
for (const
|
|
47371
|
-
if (rules[
|
|
47372
|
+
for (const key2 in schema)
|
|
47373
|
+
if (rules[key2])
|
|
47372
47374
|
return true;
|
|
47373
47375
|
return false;
|
|
47374
47376
|
}
|
|
@@ -47376,8 +47378,8 @@ var require_util2 = __commonJS({
|
|
|
47376
47378
|
function schemaHasRulesButRef(schema, RULES2) {
|
|
47377
47379
|
if (typeof schema == "boolean")
|
|
47378
47380
|
return !schema;
|
|
47379
|
-
for (const
|
|
47380
|
-
if (
|
|
47381
|
+
for (const key2 in schema)
|
|
47382
|
+
if (key2 !== "$ref" && RULES2.all[key2])
|
|
47381
47383
|
return true;
|
|
47382
47384
|
return false;
|
|
47383
47385
|
}
|
|
@@ -47955,8 +47957,8 @@ var require_defaults2 = __commonJS({
|
|
|
47955
47957
|
function assignDefaults(it, ty) {
|
|
47956
47958
|
const { properties, items } = it.schema;
|
|
47957
47959
|
if (ty === "object" && properties) {
|
|
47958
|
-
for (const
|
|
47959
|
-
assignDefault(it,
|
|
47960
|
+
for (const key2 in properties) {
|
|
47961
|
+
assignDefault(it, key2, properties[key2].default);
|
|
47960
47962
|
}
|
|
47961
47963
|
} else if (ty === "array" && Array.isArray(items)) {
|
|
47962
47964
|
items.forEach((sch, i) => assignDefault(it, i, sch.default));
|
|
@@ -48340,8 +48342,8 @@ var require_fast_deep_equal = __commonJS({
|
|
|
48340
48342
|
for (i = length; i-- !== 0; )
|
|
48341
48343
|
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
48342
48344
|
for (i = length; i-- !== 0; ) {
|
|
48343
|
-
var
|
|
48344
|
-
if (!equal(a[
|
|
48345
|
+
var key2 = keys[i];
|
|
48346
|
+
if (!equal(a[key2], b[key2])) return false;
|
|
48345
48347
|
}
|
|
48346
48348
|
return true;
|
|
48347
48349
|
}
|
|
@@ -48413,20 +48415,20 @@ var require_json_schema_traverse = __commonJS({
|
|
|
48413
48415
|
function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
48414
48416
|
if (schema && typeof schema == "object" && !Array.isArray(schema)) {
|
|
48415
48417
|
pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
48416
|
-
for (var
|
|
48417
|
-
var sch = schema[
|
|
48418
|
+
for (var key2 in schema) {
|
|
48419
|
+
var sch = schema[key2];
|
|
48418
48420
|
if (Array.isArray(sch)) {
|
|
48419
|
-
if (
|
|
48421
|
+
if (key2 in traverse.arrayKeywords) {
|
|
48420
48422
|
for (var i = 0; i < sch.length; i++)
|
|
48421
|
-
_traverse(opts, pre, post, sch[i], jsonPtr + "/" +
|
|
48423
|
+
_traverse(opts, pre, post, sch[i], jsonPtr + "/" + key2 + "/" + i, rootSchema, jsonPtr, key2, schema, i);
|
|
48422
48424
|
}
|
|
48423
|
-
} else if (
|
|
48425
|
+
} else if (key2 in traverse.propsKeywords) {
|
|
48424
48426
|
if (sch && typeof sch == "object") {
|
|
48425
48427
|
for (var prop in sch)
|
|
48426
|
-
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" +
|
|
48428
|
+
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key2 + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key2, schema, prop);
|
|
48427
48429
|
}
|
|
48428
|
-
} else if (
|
|
48429
|
-
_traverse(opts, pre, post, sch, jsonPtr + "/" +
|
|
48430
|
+
} else if (key2 in traverse.keywords || opts.allKeys && !(key2 in traverse.skipKeywords)) {
|
|
48431
|
+
_traverse(opts, pre, post, sch, jsonPtr + "/" + key2, rootSchema, jsonPtr, key2, schema);
|
|
48430
48432
|
}
|
|
48431
48433
|
}
|
|
48432
48434
|
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
@@ -48483,10 +48485,10 @@ var require_resolve = __commonJS({
|
|
|
48483
48485
|
"$dynamicAnchor"
|
|
48484
48486
|
]);
|
|
48485
48487
|
function hasRef(schema) {
|
|
48486
|
-
for (const
|
|
48487
|
-
if (REF_KEYWORDS.has(
|
|
48488
|
+
for (const key2 in schema) {
|
|
48489
|
+
if (REF_KEYWORDS.has(key2))
|
|
48488
48490
|
return true;
|
|
48489
|
-
const sch = schema[
|
|
48491
|
+
const sch = schema[key2];
|
|
48490
48492
|
if (Array.isArray(sch) && sch.some(hasRef))
|
|
48491
48493
|
return true;
|
|
48492
48494
|
if (typeof sch == "object" && hasRef(sch))
|
|
@@ -48496,14 +48498,14 @@ var require_resolve = __commonJS({
|
|
|
48496
48498
|
}
|
|
48497
48499
|
function countKeys(schema) {
|
|
48498
48500
|
let count4 = 0;
|
|
48499
|
-
for (const
|
|
48500
|
-
if (
|
|
48501
|
+
for (const key2 in schema) {
|
|
48502
|
+
if (key2 === "$ref")
|
|
48501
48503
|
return Infinity;
|
|
48502
48504
|
count4++;
|
|
48503
|
-
if (SIMPLE_INLINED.has(
|
|
48505
|
+
if (SIMPLE_INLINED.has(key2))
|
|
48504
48506
|
continue;
|
|
48505
|
-
if (typeof schema[
|
|
48506
|
-
(0, util_1.eachItem)(schema[
|
|
48507
|
+
if (typeof schema[key2] == "object") {
|
|
48508
|
+
(0, util_1.eachItem)(schema[key2], (sch) => count4 += countKeys(sch));
|
|
48507
48509
|
}
|
|
48508
48510
|
if (count4 === Infinity)
|
|
48509
48511
|
return Infinity;
|
|
@@ -48692,8 +48694,8 @@ var require_validate = __commonJS({
|
|
|
48692
48694
|
function schemaCxtHasRules({ schema, self }) {
|
|
48693
48695
|
if (typeof schema == "boolean")
|
|
48694
48696
|
return !schema;
|
|
48695
|
-
for (const
|
|
48696
|
-
if (self.RULES.all[
|
|
48697
|
+
for (const key2 in schema)
|
|
48698
|
+
if (self.RULES.all[key2])
|
|
48697
48699
|
return true;
|
|
48698
48700
|
return false;
|
|
48699
48701
|
}
|
|
@@ -50335,7 +50337,7 @@ var require_core = __commonJS({
|
|
|
50335
50337
|
}
|
|
50336
50338
|
}
|
|
50337
50339
|
// Adds schema to the instance
|
|
50338
|
-
addSchema(schema,
|
|
50340
|
+
addSchema(schema, key2, _meta, _validateSchema = this.opts.validateSchema) {
|
|
50339
50341
|
if (Array.isArray(schema)) {
|
|
50340
50342
|
for (const sch of schema)
|
|
50341
50343
|
this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
@@ -50349,15 +50351,15 @@ var require_core = __commonJS({
|
|
|
50349
50351
|
throw new Error(`schema ${schemaId} must be string`);
|
|
50350
50352
|
}
|
|
50351
50353
|
}
|
|
50352
|
-
|
|
50353
|
-
this._checkUnique(
|
|
50354
|
-
this.schemas[
|
|
50354
|
+
key2 = (0, resolve_1.normalizeId)(key2 || id);
|
|
50355
|
+
this._checkUnique(key2);
|
|
50356
|
+
this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
|
|
50355
50357
|
return this;
|
|
50356
50358
|
}
|
|
50357
50359
|
// Add schema that will be used to validate other schemas
|
|
50358
50360
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
50359
|
-
addMetaSchema(schema,
|
|
50360
|
-
this.addSchema(schema,
|
|
50361
|
+
addMetaSchema(schema, key2, _validateSchema = this.opts.validateSchema) {
|
|
50362
|
+
this.addSchema(schema, key2, true, _validateSchema);
|
|
50361
50363
|
return this;
|
|
50362
50364
|
}
|
|
50363
50365
|
// Validate schema against its meta-schema
|
|
@@ -50513,14 +50515,14 @@ var require_core = __commonJS({
|
|
|
50513
50515
|
let keywords = metaSchema;
|
|
50514
50516
|
for (const seg of segments)
|
|
50515
50517
|
keywords = keywords[seg];
|
|
50516
|
-
for (const
|
|
50517
|
-
const rule = rules[
|
|
50518
|
+
for (const key2 in rules) {
|
|
50519
|
+
const rule = rules[key2];
|
|
50518
50520
|
if (typeof rule != "object")
|
|
50519
50521
|
continue;
|
|
50520
50522
|
const { $data } = rule.definition;
|
|
50521
|
-
const schema = keywords[
|
|
50523
|
+
const schema = keywords[key2];
|
|
50522
50524
|
if ($data && schema)
|
|
50523
|
-
keywords[
|
|
50525
|
+
keywords[key2] = schemaOrData(schema);
|
|
50524
50526
|
}
|
|
50525
50527
|
}
|
|
50526
50528
|
return metaSchema;
|
|
@@ -50593,10 +50595,10 @@ var require_core = __commonJS({
|
|
|
50593
50595
|
Ajv2.MissingRefError = ref_error_1.default;
|
|
50594
50596
|
exports2.default = Ajv2;
|
|
50595
50597
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
50596
|
-
for (const
|
|
50597
|
-
const opt =
|
|
50598
|
+
for (const key2 in checkOpts) {
|
|
50599
|
+
const opt = key2;
|
|
50598
50600
|
if (opt in options)
|
|
50599
|
-
this.logger[log](`${msg}: option ${
|
|
50601
|
+
this.logger[log](`${msg}: option ${key2}. ${checkOpts[opt]}`);
|
|
50600
50602
|
}
|
|
50601
50603
|
}
|
|
50602
50604
|
function getSchEnv(keyRef) {
|
|
@@ -50610,8 +50612,8 @@ var require_core = __commonJS({
|
|
|
50610
50612
|
if (Array.isArray(optsSchemas))
|
|
50611
50613
|
this.addSchema(optsSchemas);
|
|
50612
50614
|
else
|
|
50613
|
-
for (const
|
|
50614
|
-
this.addSchema(optsSchemas[
|
|
50615
|
+
for (const key2 in optsSchemas)
|
|
50616
|
+
this.addSchema(optsSchemas[key2], key2);
|
|
50615
50617
|
}
|
|
50616
50618
|
function addInitialFormats() {
|
|
50617
50619
|
for (const name in this.opts.formats) {
|
|
@@ -51659,11 +51661,11 @@ var require_dependencies = __commonJS({
|
|
|
51659
51661
|
function splitDependencies({ schema }) {
|
|
51660
51662
|
const propertyDeps = {};
|
|
51661
51663
|
const schemaDeps = {};
|
|
51662
|
-
for (const
|
|
51663
|
-
if (
|
|
51664
|
+
for (const key2 in schema) {
|
|
51665
|
+
if (key2 === "__proto__")
|
|
51664
51666
|
continue;
|
|
51665
|
-
const deps = Array.isArray(schema[
|
|
51666
|
-
deps[
|
|
51667
|
+
const deps = Array.isArray(schema[key2]) ? propertyDeps : schemaDeps;
|
|
51668
|
+
deps[key2] = schema[key2];
|
|
51667
51669
|
}
|
|
51668
51670
|
return [propertyDeps, schemaDeps];
|
|
51669
51671
|
}
|
|
@@ -51740,13 +51742,13 @@ var require_propertyNames = __commonJS({
|
|
|
51740
51742
|
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
51741
51743
|
return;
|
|
51742
51744
|
const valid = gen.name("valid");
|
|
51743
|
-
gen.forIn("key", data, (
|
|
51744
|
-
cxt.setParams({ propertyName:
|
|
51745
|
+
gen.forIn("key", data, (key2) => {
|
|
51746
|
+
cxt.setParams({ propertyName: key2 });
|
|
51745
51747
|
cxt.subschema({
|
|
51746
51748
|
keyword: "propertyNames",
|
|
51747
|
-
data:
|
|
51749
|
+
data: key2,
|
|
51748
51750
|
dataTypes: ["string"],
|
|
51749
|
-
propertyName:
|
|
51751
|
+
propertyName: key2,
|
|
51750
51752
|
compositeRule: true
|
|
51751
51753
|
}, valid);
|
|
51752
51754
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
@@ -51795,38 +51797,38 @@ var require_additionalProperties = __commonJS({
|
|
|
51795
51797
|
checkAdditionalProperties();
|
|
51796
51798
|
cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
51797
51799
|
function checkAdditionalProperties() {
|
|
51798
|
-
gen.forIn("key", data, (
|
|
51800
|
+
gen.forIn("key", data, (key2) => {
|
|
51799
51801
|
if (!props.length && !patProps.length)
|
|
51800
|
-
additionalPropertyCode(
|
|
51802
|
+
additionalPropertyCode(key2);
|
|
51801
51803
|
else
|
|
51802
|
-
gen.if(isAdditional(
|
|
51804
|
+
gen.if(isAdditional(key2), () => additionalPropertyCode(key2));
|
|
51803
51805
|
});
|
|
51804
51806
|
}
|
|
51805
|
-
function isAdditional(
|
|
51807
|
+
function isAdditional(key2) {
|
|
51806
51808
|
let definedProp;
|
|
51807
51809
|
if (props.length > 8) {
|
|
51808
51810
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
51809
|
-
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema,
|
|
51811
|
+
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key2);
|
|
51810
51812
|
} else if (props.length) {
|
|
51811
|
-
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${
|
|
51813
|
+
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key2} === ${p}`));
|
|
51812
51814
|
} else {
|
|
51813
51815
|
definedProp = codegen_1.nil;
|
|
51814
51816
|
}
|
|
51815
51817
|
if (patProps.length) {
|
|
51816
|
-
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${
|
|
51818
|
+
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key2})`));
|
|
51817
51819
|
}
|
|
51818
51820
|
return (0, codegen_1.not)(definedProp);
|
|
51819
51821
|
}
|
|
51820
|
-
function deleteAdditional(
|
|
51821
|
-
gen.code((0, codegen_1._)`delete ${data}[${
|
|
51822
|
+
function deleteAdditional(key2) {
|
|
51823
|
+
gen.code((0, codegen_1._)`delete ${data}[${key2}]`);
|
|
51822
51824
|
}
|
|
51823
|
-
function additionalPropertyCode(
|
|
51825
|
+
function additionalPropertyCode(key2) {
|
|
51824
51826
|
if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
|
|
51825
|
-
deleteAdditional(
|
|
51827
|
+
deleteAdditional(key2);
|
|
51826
51828
|
return;
|
|
51827
51829
|
}
|
|
51828
51830
|
if (schema === false) {
|
|
51829
|
-
cxt.setParams({ additionalProperty:
|
|
51831
|
+
cxt.setParams({ additionalProperty: key2 });
|
|
51830
51832
|
cxt.error();
|
|
51831
51833
|
if (!allErrors)
|
|
51832
51834
|
gen.break();
|
|
@@ -51835,22 +51837,22 @@ var require_additionalProperties = __commonJS({
|
|
|
51835
51837
|
if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
51836
51838
|
const valid = gen.name("valid");
|
|
51837
51839
|
if (opts.removeAdditional === "failing") {
|
|
51838
|
-
applyAdditionalSchema(
|
|
51840
|
+
applyAdditionalSchema(key2, valid, false);
|
|
51839
51841
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
51840
51842
|
cxt.reset();
|
|
51841
|
-
deleteAdditional(
|
|
51843
|
+
deleteAdditional(key2);
|
|
51842
51844
|
});
|
|
51843
51845
|
} else {
|
|
51844
|
-
applyAdditionalSchema(
|
|
51846
|
+
applyAdditionalSchema(key2, valid);
|
|
51845
51847
|
if (!allErrors)
|
|
51846
51848
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
51847
51849
|
}
|
|
51848
51850
|
}
|
|
51849
51851
|
}
|
|
51850
|
-
function applyAdditionalSchema(
|
|
51852
|
+
function applyAdditionalSchema(key2, valid, errors) {
|
|
51851
51853
|
const subschema = {
|
|
51852
51854
|
keyword: "additionalProperties",
|
|
51853
|
-
dataProp:
|
|
51855
|
+
dataProp: key2,
|
|
51854
51856
|
dataPropType: util_1.Type.Str
|
|
51855
51857
|
};
|
|
51856
51858
|
if (errors === false) {
|
|
@@ -51975,19 +51977,19 @@ var require_patternProperties = __commonJS({
|
|
|
51975
51977
|
}
|
|
51976
51978
|
}
|
|
51977
51979
|
function validateProperties(pat) {
|
|
51978
|
-
gen.forIn("key", data, (
|
|
51979
|
-
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${
|
|
51980
|
+
gen.forIn("key", data, (key2) => {
|
|
51981
|
+
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key2})`, () => {
|
|
51980
51982
|
const alwaysValid = alwaysValidPatterns.includes(pat);
|
|
51981
51983
|
if (!alwaysValid) {
|
|
51982
51984
|
cxt.subschema({
|
|
51983
51985
|
keyword: "patternProperties",
|
|
51984
51986
|
schemaProp: pat,
|
|
51985
|
-
dataProp:
|
|
51987
|
+
dataProp: key2,
|
|
51986
51988
|
dataPropType: util_2.Type.Str
|
|
51987
51989
|
}, valid);
|
|
51988
51990
|
}
|
|
51989
51991
|
if (it.opts.unevaluated && props !== true) {
|
|
51990
|
-
gen.assign((0, codegen_1._)`${props}[${
|
|
51992
|
+
gen.assign((0, codegen_1._)`${props}[${key2}]`, true);
|
|
51991
51993
|
} else if (!alwaysValid && !it.allErrors) {
|
|
51992
51994
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
51993
51995
|
}
|
|
@@ -53099,15 +53101,15 @@ var require_code3 = __commonJS({
|
|
|
53099
53101
|
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
53100
53102
|
}
|
|
53101
53103
|
exports2.safeStringify = safeStringify;
|
|
53102
|
-
function getProperty(
|
|
53103
|
-
return typeof
|
|
53104
|
+
function getProperty(key2) {
|
|
53105
|
+
return typeof key2 == "string" && exports2.IDENTIFIER.test(key2) ? new _Code(`.${key2}`) : _`[${key2}]`;
|
|
53104
53106
|
}
|
|
53105
53107
|
exports2.getProperty = getProperty;
|
|
53106
|
-
function getEsmExportName(
|
|
53107
|
-
if (typeof
|
|
53108
|
-
return new _Code(`${
|
|
53108
|
+
function getEsmExportName(key2) {
|
|
53109
|
+
if (typeof key2 == "string" && exports2.IDENTIFIER.test(key2)) {
|
|
53110
|
+
return new _Code(`${key2}`);
|
|
53109
53111
|
}
|
|
53110
|
-
throw new Error(`CodeGen: invalid export name: ${
|
|
53112
|
+
throw new Error(`CodeGen: invalid export name: ${key2}, use explicit $id name mapping`);
|
|
53111
53113
|
}
|
|
53112
53114
|
exports2.getEsmExportName = getEsmExportName;
|
|
53113
53115
|
function regexpCode(rx) {
|
|
@@ -53734,11 +53736,11 @@ var require_codegen2 = __commonJS({
|
|
|
53734
53736
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
53735
53737
|
object(...keyValues) {
|
|
53736
53738
|
const code = ["{"];
|
|
53737
|
-
for (const [
|
|
53739
|
+
for (const [key2, value] of keyValues) {
|
|
53738
53740
|
if (code.length > 1)
|
|
53739
53741
|
code.push(",");
|
|
53740
|
-
code.push(
|
|
53741
|
-
if (
|
|
53742
|
+
code.push(key2);
|
|
53743
|
+
if (key2 !== value || this.opts.es5) {
|
|
53742
53744
|
code.push(":");
|
|
53743
53745
|
(0, code_1.addCodeArg)(code, value);
|
|
53744
53746
|
}
|
|
@@ -54013,17 +54015,17 @@ var require_util3 = __commonJS({
|
|
|
54013
54015
|
if (typeof schema === "boolean")
|
|
54014
54016
|
return;
|
|
54015
54017
|
const rules = self.RULES.keywords;
|
|
54016
|
-
for (const
|
|
54017
|
-
if (!rules[
|
|
54018
|
-
checkStrictMode(it, `unknown keyword: "${
|
|
54018
|
+
for (const key2 in schema) {
|
|
54019
|
+
if (!rules[key2])
|
|
54020
|
+
checkStrictMode(it, `unknown keyword: "${key2}"`);
|
|
54019
54021
|
}
|
|
54020
54022
|
}
|
|
54021
54023
|
exports2.checkUnknownRules = checkUnknownRules;
|
|
54022
54024
|
function schemaHasRules(schema, rules) {
|
|
54023
54025
|
if (typeof schema == "boolean")
|
|
54024
54026
|
return !schema;
|
|
54025
|
-
for (const
|
|
54026
|
-
if (rules[
|
|
54027
|
+
for (const key2 in schema)
|
|
54028
|
+
if (rules[key2])
|
|
54027
54029
|
return true;
|
|
54028
54030
|
return false;
|
|
54029
54031
|
}
|
|
@@ -54031,8 +54033,8 @@ var require_util3 = __commonJS({
|
|
|
54031
54033
|
function schemaHasRulesButRef(schema, RULES2) {
|
|
54032
54034
|
if (typeof schema == "boolean")
|
|
54033
54035
|
return !schema;
|
|
54034
|
-
for (const
|
|
54035
|
-
if (
|
|
54036
|
+
for (const key2 in schema)
|
|
54037
|
+
if (key2 !== "$ref" && RULES2.all[key2])
|
|
54036
54038
|
return true;
|
|
54037
54039
|
return false;
|
|
54038
54040
|
}
|
|
@@ -54610,8 +54612,8 @@ var require_defaults3 = __commonJS({
|
|
|
54610
54612
|
function assignDefaults(it, ty) {
|
|
54611
54613
|
const { properties, items } = it.schema;
|
|
54612
54614
|
if (ty === "object" && properties) {
|
|
54613
|
-
for (const
|
|
54614
|
-
assignDefault(it,
|
|
54615
|
+
for (const key2 in properties) {
|
|
54616
|
+
assignDefault(it, key2, properties[key2].default);
|
|
54615
54617
|
}
|
|
54616
54618
|
} else if (ty === "array" && Array.isArray(items)) {
|
|
54617
54619
|
items.forEach((sch, i) => assignDefault(it, i, sch.default));
|
|
@@ -55033,20 +55035,20 @@ var require_json_schema_traverse2 = __commonJS({
|
|
|
55033
55035
|
function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
55034
55036
|
if (schema && typeof schema == "object" && !Array.isArray(schema)) {
|
|
55035
55037
|
pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
55036
|
-
for (var
|
|
55037
|
-
var sch = schema[
|
|
55038
|
+
for (var key2 in schema) {
|
|
55039
|
+
var sch = schema[key2];
|
|
55038
55040
|
if (Array.isArray(sch)) {
|
|
55039
|
-
if (
|
|
55041
|
+
if (key2 in traverse.arrayKeywords) {
|
|
55040
55042
|
for (var i = 0; i < sch.length; i++)
|
|
55041
|
-
_traverse(opts, pre, post, sch[i], jsonPtr + "/" +
|
|
55043
|
+
_traverse(opts, pre, post, sch[i], jsonPtr + "/" + key2 + "/" + i, rootSchema, jsonPtr, key2, schema, i);
|
|
55042
55044
|
}
|
|
55043
|
-
} else if (
|
|
55045
|
+
} else if (key2 in traverse.propsKeywords) {
|
|
55044
55046
|
if (sch && typeof sch == "object") {
|
|
55045
55047
|
for (var prop in sch)
|
|
55046
|
-
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" +
|
|
55048
|
+
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key2 + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key2, schema, prop);
|
|
55047
55049
|
}
|
|
55048
|
-
} else if (
|
|
55049
|
-
_traverse(opts, pre, post, sch, jsonPtr + "/" +
|
|
55050
|
+
} else if (key2 in traverse.keywords || opts.allKeys && !(key2 in traverse.skipKeywords)) {
|
|
55051
|
+
_traverse(opts, pre, post, sch, jsonPtr + "/" + key2, rootSchema, jsonPtr, key2, schema);
|
|
55050
55052
|
}
|
|
55051
55053
|
}
|
|
55052
55054
|
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
@@ -55103,10 +55105,10 @@ var require_resolve2 = __commonJS({
|
|
|
55103
55105
|
"$dynamicAnchor"
|
|
55104
55106
|
]);
|
|
55105
55107
|
function hasRef(schema) {
|
|
55106
|
-
for (const
|
|
55107
|
-
if (REF_KEYWORDS.has(
|
|
55108
|
+
for (const key2 in schema) {
|
|
55109
|
+
if (REF_KEYWORDS.has(key2))
|
|
55108
55110
|
return true;
|
|
55109
|
-
const sch = schema[
|
|
55111
|
+
const sch = schema[key2];
|
|
55110
55112
|
if (Array.isArray(sch) && sch.some(hasRef))
|
|
55111
55113
|
return true;
|
|
55112
55114
|
if (typeof sch == "object" && hasRef(sch))
|
|
@@ -55116,14 +55118,14 @@ var require_resolve2 = __commonJS({
|
|
|
55116
55118
|
}
|
|
55117
55119
|
function countKeys(schema) {
|
|
55118
55120
|
let count4 = 0;
|
|
55119
|
-
for (const
|
|
55120
|
-
if (
|
|
55121
|
+
for (const key2 in schema) {
|
|
55122
|
+
if (key2 === "$ref")
|
|
55121
55123
|
return Infinity;
|
|
55122
55124
|
count4++;
|
|
55123
|
-
if (SIMPLE_INLINED.has(
|
|
55125
|
+
if (SIMPLE_INLINED.has(key2))
|
|
55124
55126
|
continue;
|
|
55125
|
-
if (typeof schema[
|
|
55126
|
-
(0, util_1.eachItem)(schema[
|
|
55127
|
+
if (typeof schema[key2] == "object") {
|
|
55128
|
+
(0, util_1.eachItem)(schema[key2], (sch) => count4 += countKeys(sch));
|
|
55127
55129
|
}
|
|
55128
55130
|
if (count4 === Infinity)
|
|
55129
55131
|
return Infinity;
|
|
@@ -55312,8 +55314,8 @@ var require_validate2 = __commonJS({
|
|
|
55312
55314
|
function schemaCxtHasRules({ schema, self }) {
|
|
55313
55315
|
if (typeof schema == "boolean")
|
|
55314
55316
|
return !schema;
|
|
55315
|
-
for (const
|
|
55316
|
-
if (self.RULES.all[
|
|
55317
|
+
for (const key2 in schema)
|
|
55318
|
+
if (self.RULES.all[key2])
|
|
55317
55319
|
return true;
|
|
55318
55320
|
return false;
|
|
55319
55321
|
}
|
|
@@ -56233,7 +56235,7 @@ var require_core3 = __commonJS({
|
|
|
56233
56235
|
}
|
|
56234
56236
|
}
|
|
56235
56237
|
// Adds schema to the instance
|
|
56236
|
-
addSchema(schema,
|
|
56238
|
+
addSchema(schema, key2, _meta, _validateSchema = this.opts.validateSchema) {
|
|
56237
56239
|
if (Array.isArray(schema)) {
|
|
56238
56240
|
for (const sch of schema)
|
|
56239
56241
|
this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
@@ -56247,15 +56249,15 @@ var require_core3 = __commonJS({
|
|
|
56247
56249
|
throw new Error(`schema ${schemaId} must be string`);
|
|
56248
56250
|
}
|
|
56249
56251
|
}
|
|
56250
|
-
|
|
56251
|
-
this._checkUnique(
|
|
56252
|
-
this.schemas[
|
|
56252
|
+
key2 = (0, resolve_1.normalizeId)(key2 || id);
|
|
56253
|
+
this._checkUnique(key2);
|
|
56254
|
+
this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
|
|
56253
56255
|
return this;
|
|
56254
56256
|
}
|
|
56255
56257
|
// Add schema that will be used to validate other schemas
|
|
56256
56258
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
56257
|
-
addMetaSchema(schema,
|
|
56258
|
-
this.addSchema(schema,
|
|
56259
|
+
addMetaSchema(schema, key2, _validateSchema = this.opts.validateSchema) {
|
|
56260
|
+
this.addSchema(schema, key2, true, _validateSchema);
|
|
56259
56261
|
return this;
|
|
56260
56262
|
}
|
|
56261
56263
|
// Validate schema against its meta-schema
|
|
@@ -56411,14 +56413,14 @@ var require_core3 = __commonJS({
|
|
|
56411
56413
|
let keywords = metaSchema;
|
|
56412
56414
|
for (const seg of segments)
|
|
56413
56415
|
keywords = keywords[seg];
|
|
56414
|
-
for (const
|
|
56415
|
-
const rule = rules[
|
|
56416
|
+
for (const key2 in rules) {
|
|
56417
|
+
const rule = rules[key2];
|
|
56416
56418
|
if (typeof rule != "object")
|
|
56417
56419
|
continue;
|
|
56418
56420
|
const { $data } = rule.definition;
|
|
56419
|
-
const schema = keywords[
|
|
56421
|
+
const schema = keywords[key2];
|
|
56420
56422
|
if ($data && schema)
|
|
56421
|
-
keywords[
|
|
56423
|
+
keywords[key2] = schemaOrData(schema);
|
|
56422
56424
|
}
|
|
56423
56425
|
}
|
|
56424
56426
|
return metaSchema;
|
|
@@ -56491,10 +56493,10 @@ var require_core3 = __commonJS({
|
|
|
56491
56493
|
Ajv2.MissingRefError = ref_error_1.default;
|
|
56492
56494
|
exports2.default = Ajv2;
|
|
56493
56495
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
56494
|
-
for (const
|
|
56495
|
-
const opt =
|
|
56496
|
+
for (const key2 in checkOpts) {
|
|
56497
|
+
const opt = key2;
|
|
56496
56498
|
if (opt in options)
|
|
56497
|
-
this.logger[log](`${msg}: option ${
|
|
56499
|
+
this.logger[log](`${msg}: option ${key2}. ${checkOpts[opt]}`);
|
|
56498
56500
|
}
|
|
56499
56501
|
}
|
|
56500
56502
|
function getSchEnv(keyRef) {
|
|
@@ -56508,8 +56510,8 @@ var require_core3 = __commonJS({
|
|
|
56508
56510
|
if (Array.isArray(optsSchemas))
|
|
56509
56511
|
this.addSchema(optsSchemas);
|
|
56510
56512
|
else
|
|
56511
|
-
for (const
|
|
56512
|
-
this.addSchema(optsSchemas[
|
|
56513
|
+
for (const key2 in optsSchemas)
|
|
56514
|
+
this.addSchema(optsSchemas[key2], key2);
|
|
56513
56515
|
}
|
|
56514
56516
|
function addInitialFormats() {
|
|
56515
56517
|
for (const name in this.opts.formats) {
|
|
@@ -57548,11 +57550,11 @@ var require_dependencies2 = __commonJS({
|
|
|
57548
57550
|
function splitDependencies({ schema }) {
|
|
57549
57551
|
const propertyDeps = {};
|
|
57550
57552
|
const schemaDeps = {};
|
|
57551
|
-
for (const
|
|
57552
|
-
if (
|
|
57553
|
+
for (const key2 in schema) {
|
|
57554
|
+
if (key2 === "__proto__")
|
|
57553
57555
|
continue;
|
|
57554
|
-
const deps = Array.isArray(schema[
|
|
57555
|
-
deps[
|
|
57556
|
+
const deps = Array.isArray(schema[key2]) ? propertyDeps : schemaDeps;
|
|
57557
|
+
deps[key2] = schema[key2];
|
|
57556
57558
|
}
|
|
57557
57559
|
return [propertyDeps, schemaDeps];
|
|
57558
57560
|
}
|
|
@@ -57629,13 +57631,13 @@ var require_propertyNames2 = __commonJS({
|
|
|
57629
57631
|
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
57630
57632
|
return;
|
|
57631
57633
|
const valid = gen.name("valid");
|
|
57632
|
-
gen.forIn("key", data, (
|
|
57633
|
-
cxt.setParams({ propertyName:
|
|
57634
|
+
gen.forIn("key", data, (key2) => {
|
|
57635
|
+
cxt.setParams({ propertyName: key2 });
|
|
57634
57636
|
cxt.subschema({
|
|
57635
57637
|
keyword: "propertyNames",
|
|
57636
|
-
data:
|
|
57638
|
+
data: key2,
|
|
57637
57639
|
dataTypes: ["string"],
|
|
57638
|
-
propertyName:
|
|
57640
|
+
propertyName: key2,
|
|
57639
57641
|
compositeRule: true
|
|
57640
57642
|
}, valid);
|
|
57641
57643
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
@@ -57684,38 +57686,38 @@ var require_additionalProperties2 = __commonJS({
|
|
|
57684
57686
|
checkAdditionalProperties();
|
|
57685
57687
|
cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
57686
57688
|
function checkAdditionalProperties() {
|
|
57687
|
-
gen.forIn("key", data, (
|
|
57689
|
+
gen.forIn("key", data, (key2) => {
|
|
57688
57690
|
if (!props.length && !patProps.length)
|
|
57689
|
-
additionalPropertyCode(
|
|
57691
|
+
additionalPropertyCode(key2);
|
|
57690
57692
|
else
|
|
57691
|
-
gen.if(isAdditional(
|
|
57693
|
+
gen.if(isAdditional(key2), () => additionalPropertyCode(key2));
|
|
57692
57694
|
});
|
|
57693
57695
|
}
|
|
57694
|
-
function isAdditional(
|
|
57696
|
+
function isAdditional(key2) {
|
|
57695
57697
|
let definedProp;
|
|
57696
57698
|
if (props.length > 8) {
|
|
57697
57699
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
57698
|
-
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema,
|
|
57700
|
+
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key2);
|
|
57699
57701
|
} else if (props.length) {
|
|
57700
|
-
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${
|
|
57702
|
+
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key2} === ${p}`));
|
|
57701
57703
|
} else {
|
|
57702
57704
|
definedProp = codegen_1.nil;
|
|
57703
57705
|
}
|
|
57704
57706
|
if (patProps.length) {
|
|
57705
|
-
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${
|
|
57707
|
+
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key2})`));
|
|
57706
57708
|
}
|
|
57707
57709
|
return (0, codegen_1.not)(definedProp);
|
|
57708
57710
|
}
|
|
57709
|
-
function deleteAdditional(
|
|
57710
|
-
gen.code((0, codegen_1._)`delete ${data}[${
|
|
57711
|
+
function deleteAdditional(key2) {
|
|
57712
|
+
gen.code((0, codegen_1._)`delete ${data}[${key2}]`);
|
|
57711
57713
|
}
|
|
57712
|
-
function additionalPropertyCode(
|
|
57714
|
+
function additionalPropertyCode(key2) {
|
|
57713
57715
|
if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
|
|
57714
|
-
deleteAdditional(
|
|
57716
|
+
deleteAdditional(key2);
|
|
57715
57717
|
return;
|
|
57716
57718
|
}
|
|
57717
57719
|
if (schema === false) {
|
|
57718
|
-
cxt.setParams({ additionalProperty:
|
|
57720
|
+
cxt.setParams({ additionalProperty: key2 });
|
|
57719
57721
|
cxt.error();
|
|
57720
57722
|
if (!allErrors)
|
|
57721
57723
|
gen.break();
|
|
@@ -57724,22 +57726,22 @@ var require_additionalProperties2 = __commonJS({
|
|
|
57724
57726
|
if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
57725
57727
|
const valid = gen.name("valid");
|
|
57726
57728
|
if (opts.removeAdditional === "failing") {
|
|
57727
|
-
applyAdditionalSchema(
|
|
57729
|
+
applyAdditionalSchema(key2, valid, false);
|
|
57728
57730
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
57729
57731
|
cxt.reset();
|
|
57730
|
-
deleteAdditional(
|
|
57732
|
+
deleteAdditional(key2);
|
|
57731
57733
|
});
|
|
57732
57734
|
} else {
|
|
57733
|
-
applyAdditionalSchema(
|
|
57735
|
+
applyAdditionalSchema(key2, valid);
|
|
57734
57736
|
if (!allErrors)
|
|
57735
57737
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
57736
57738
|
}
|
|
57737
57739
|
}
|
|
57738
57740
|
}
|
|
57739
|
-
function applyAdditionalSchema(
|
|
57741
|
+
function applyAdditionalSchema(key2, valid, errors) {
|
|
57740
57742
|
const subschema = {
|
|
57741
57743
|
keyword: "additionalProperties",
|
|
57742
|
-
dataProp:
|
|
57744
|
+
dataProp: key2,
|
|
57743
57745
|
dataPropType: util_1.Type.Str
|
|
57744
57746
|
};
|
|
57745
57747
|
if (errors === false) {
|
|
@@ -57864,19 +57866,19 @@ var require_patternProperties2 = __commonJS({
|
|
|
57864
57866
|
}
|
|
57865
57867
|
}
|
|
57866
57868
|
function validateProperties(pat) {
|
|
57867
|
-
gen.forIn("key", data, (
|
|
57868
|
-
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${
|
|
57869
|
+
gen.forIn("key", data, (key2) => {
|
|
57870
|
+
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key2})`, () => {
|
|
57869
57871
|
const alwaysValid = alwaysValidPatterns.includes(pat);
|
|
57870
57872
|
if (!alwaysValid) {
|
|
57871
57873
|
cxt.subschema({
|
|
57872
57874
|
keyword: "patternProperties",
|
|
57873
57875
|
schemaProp: pat,
|
|
57874
|
-
dataProp:
|
|
57876
|
+
dataProp: key2,
|
|
57875
57877
|
dataPropType: util_2.Type.Str
|
|
57876
57878
|
}, valid);
|
|
57877
57879
|
}
|
|
57878
57880
|
if (it.opts.unevaluated && props !== true) {
|
|
57879
|
-
gen.assign((0, codegen_1._)`${props}[${
|
|
57881
|
+
gen.assign((0, codegen_1._)`${props}[${key2}]`, true);
|
|
57880
57882
|
} else if (!alwaysValid && !it.allErrors) {
|
|
57881
57883
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
57882
57884
|
}
|
|
@@ -60581,11 +60583,11 @@ var require_depd = __commonJS({
|
|
|
60581
60583
|
break;
|
|
60582
60584
|
}
|
|
60583
60585
|
}
|
|
60584
|
-
var
|
|
60585
|
-
if (
|
|
60586
|
+
var key2 = caller ? depSite.join(":") + "__" + caller.join(":") : void 0;
|
|
60587
|
+
if (key2 !== void 0 && key2 in this._warned) {
|
|
60586
60588
|
return;
|
|
60587
60589
|
}
|
|
60588
|
-
this._warned[
|
|
60590
|
+
this._warned[key2] = true;
|
|
60589
60591
|
var msg = message;
|
|
60590
60592
|
if (!msg) {
|
|
60591
60593
|
msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite);
|
|
@@ -61039,9 +61041,9 @@ var require_http_errors = __commonJS({
|
|
|
61039
61041
|
err2.expose = status < 500;
|
|
61040
61042
|
err2.status = err2.statusCode = status;
|
|
61041
61043
|
}
|
|
61042
|
-
for (var
|
|
61043
|
-
if (
|
|
61044
|
-
err2[
|
|
61044
|
+
for (var key2 in props) {
|
|
61045
|
+
if (key2 !== "status" && key2 !== "statusCode") {
|
|
61046
|
+
err2[key2] = props[key2];
|
|
61045
61047
|
}
|
|
61046
61048
|
}
|
|
61047
61049
|
return err2;
|
|
@@ -61247,17 +61249,17 @@ var require_safer = __commonJS({
|
|
|
61247
61249
|
var buffer = require("buffer");
|
|
61248
61250
|
var Buffer2 = buffer.Buffer;
|
|
61249
61251
|
var safer = {};
|
|
61250
|
-
var
|
|
61251
|
-
for (
|
|
61252
|
-
if (!buffer.hasOwnProperty(
|
|
61253
|
-
if (
|
|
61254
|
-
safer[
|
|
61252
|
+
var key2;
|
|
61253
|
+
for (key2 in buffer) {
|
|
61254
|
+
if (!buffer.hasOwnProperty(key2)) continue;
|
|
61255
|
+
if (key2 === "SlowBuffer" || key2 === "Buffer") continue;
|
|
61256
|
+
safer[key2] = buffer[key2];
|
|
61255
61257
|
}
|
|
61256
61258
|
var Safer = safer.Buffer = {};
|
|
61257
|
-
for (
|
|
61258
|
-
if (!Buffer2.hasOwnProperty(
|
|
61259
|
-
if (
|
|
61260
|
-
Safer[
|
|
61259
|
+
for (key2 in Buffer2) {
|
|
61260
|
+
if (!Buffer2.hasOwnProperty(key2)) continue;
|
|
61261
|
+
if (key2 === "allocUnsafe" || key2 === "allocUnsafeSlow") continue;
|
|
61262
|
+
Safer[key2] = Buffer2[key2];
|
|
61261
61263
|
}
|
|
61262
61264
|
safer.Buffer.prototype = Buffer2.prototype;
|
|
61263
61265
|
if (!Safer.from || Safer.from === Uint8Array.from) {
|
|
@@ -61360,9 +61362,9 @@ var require_merge_exports = __commonJS({
|
|
|
61360
61362
|
"use strict";
|
|
61361
61363
|
var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn;
|
|
61362
61364
|
function mergeModules(target, module3) {
|
|
61363
|
-
for (var
|
|
61364
|
-
if (hasOwn(module3,
|
|
61365
|
-
target[
|
|
61365
|
+
for (var key2 in module3) {
|
|
61366
|
+
if (hasOwn(module3, key2)) {
|
|
61367
|
+
target[key2] = module3[key2];
|
|
61366
61368
|
}
|
|
61367
61369
|
}
|
|
61368
61370
|
}
|
|
@@ -64950,8 +64952,8 @@ var require_lib4 = __commonJS({
|
|
|
64950
64952
|
enc = codecDef;
|
|
64951
64953
|
break;
|
|
64952
64954
|
case "object":
|
|
64953
|
-
for (var
|
|
64954
|
-
codecOptions[
|
|
64955
|
+
for (var key2 in codecDef) {
|
|
64956
|
+
codecOptions[key2] = codecDef[key2];
|
|
64955
64957
|
}
|
|
64956
64958
|
if (!codecOptions.encodingName) {
|
|
64957
64959
|
codecOptions.encodingName = enc;
|
|
@@ -65459,7 +65461,7 @@ var require_content_type = __commonJS({
|
|
|
65459
65461
|
}
|
|
65460
65462
|
var obj = new ContentType(type.toLowerCase());
|
|
65461
65463
|
if (index !== -1) {
|
|
65462
|
-
var
|
|
65464
|
+
var key2;
|
|
65463
65465
|
var match;
|
|
65464
65466
|
var value;
|
|
65465
65467
|
PARAM_REGEXP.lastIndex = index;
|
|
@@ -65468,7 +65470,7 @@ var require_content_type = __commonJS({
|
|
|
65468
65470
|
throw new TypeError("invalid parameter format");
|
|
65469
65471
|
}
|
|
65470
65472
|
index += match[0].length;
|
|
65471
|
-
|
|
65473
|
+
key2 = match[1].toLowerCase();
|
|
65472
65474
|
value = match[2];
|
|
65473
65475
|
if (value.charCodeAt(0) === 34) {
|
|
65474
65476
|
value = value.slice(1, -1);
|
|
@@ -65476,7 +65478,7 @@ var require_content_type = __commonJS({
|
|
|
65476
65478
|
value = value.replace(QESC_REGEXP, "$1");
|
|
65477
65479
|
}
|
|
65478
65480
|
}
|
|
65479
|
-
obj.parameters[
|
|
65481
|
+
obj.parameters[key2] = value;
|
|
65480
65482
|
}
|
|
65481
65483
|
if (index !== header.length) {
|
|
65482
65484
|
throw new TypeError("invalid parameter format");
|
|
@@ -75461,9 +75463,9 @@ var require_json = __commonJS({
|
|
|
75461
75463
|
function normalizeJsonSyntaxError(error2, obj) {
|
|
75462
75464
|
var keys = Object.getOwnPropertyNames(error2);
|
|
75463
75465
|
for (var i = 0; i < keys.length; i++) {
|
|
75464
|
-
var
|
|
75465
|
-
if (
|
|
75466
|
-
delete error2[
|
|
75466
|
+
var key2 = keys[i];
|
|
75467
|
+
if (key2 !== "stack" && key2 !== "message") {
|
|
75468
|
+
delete error2[key2];
|
|
75467
75469
|
}
|
|
75468
75470
|
}
|
|
75469
75471
|
error2.stack = obj.stack.replace(error2.message, obj.message);
|
|
@@ -75717,8 +75719,8 @@ var require_object_inspect = __commonJS({
|
|
|
75717
75719
|
if (isMap(obj)) {
|
|
75718
75720
|
var mapParts = [];
|
|
75719
75721
|
if (mapForEach) {
|
|
75720
|
-
mapForEach.call(obj, function(value,
|
|
75721
|
-
mapParts.push(inspect(
|
|
75722
|
+
mapForEach.call(obj, function(value, key2) {
|
|
75723
|
+
mapParts.push(inspect(key2, obj, true) + " => " + inspect(value, obj));
|
|
75722
75724
|
});
|
|
75723
75725
|
}
|
|
75724
75726
|
return collectionOf("Map", mapSize.call(obj), mapParts, indent);
|
|
@@ -75836,11 +75838,11 @@ var require_object_inspect = __commonJS({
|
|
|
75836
75838
|
}
|
|
75837
75839
|
return false;
|
|
75838
75840
|
}
|
|
75839
|
-
var hasOwn = Object.prototype.hasOwnProperty || function(
|
|
75840
|
-
return
|
|
75841
|
+
var hasOwn = Object.prototype.hasOwnProperty || function(key2) {
|
|
75842
|
+
return key2 in this;
|
|
75841
75843
|
};
|
|
75842
|
-
function has(obj,
|
|
75843
|
-
return hasOwn.call(obj,
|
|
75844
|
+
function has(obj, key2) {
|
|
75845
|
+
return hasOwn.call(obj, key2);
|
|
75844
75846
|
}
|
|
75845
75847
|
function toStr(obj) {
|
|
75846
75848
|
return objectToString.call(obj);
|
|
@@ -76031,19 +76033,19 @@ var require_object_inspect = __commonJS({
|
|
|
76031
76033
|
symMap["$" + syms[k]] = syms[k];
|
|
76032
76034
|
}
|
|
76033
76035
|
}
|
|
76034
|
-
for (var
|
|
76035
|
-
if (!has(obj,
|
|
76036
|
+
for (var key2 in obj) {
|
|
76037
|
+
if (!has(obj, key2)) {
|
|
76036
76038
|
continue;
|
|
76037
76039
|
}
|
|
76038
|
-
if (isArr && String(Number(
|
|
76040
|
+
if (isArr && String(Number(key2)) === key2 && key2 < obj.length) {
|
|
76039
76041
|
continue;
|
|
76040
76042
|
}
|
|
76041
|
-
if (hasShammedSymbols && symMap["$" +
|
|
76043
|
+
if (hasShammedSymbols && symMap["$" + key2] instanceof Symbol) {
|
|
76042
76044
|
continue;
|
|
76043
|
-
} else if ($test.call(/[^\w$]/,
|
|
76044
|
-
xs.push(inspect(
|
|
76045
|
+
} else if ($test.call(/[^\w$]/, key2)) {
|
|
76046
|
+
xs.push(inspect(key2, obj) + ": " + inspect(obj[key2], obj));
|
|
76045
76047
|
} else {
|
|
76046
|
-
xs.push(
|
|
76048
|
+
xs.push(key2 + ": " + inspect(obj[key2], obj));
|
|
76047
76049
|
}
|
|
76048
76050
|
}
|
|
76049
76051
|
if (typeof gOPS === "function") {
|
|
@@ -76064,11 +76066,11 @@ var require_side_channel_list = __commonJS({
|
|
|
76064
76066
|
"use strict";
|
|
76065
76067
|
var inspect = require_object_inspect();
|
|
76066
76068
|
var $TypeError = require_type();
|
|
76067
|
-
var listGetNode = function(list2,
|
|
76069
|
+
var listGetNode = function(list2, key2, isDelete) {
|
|
76068
76070
|
var prev = list2;
|
|
76069
76071
|
var curr;
|
|
76070
76072
|
for (; (curr = prev.next) != null; prev = curr) {
|
|
76071
|
-
if (curr.key ===
|
|
76073
|
+
if (curr.key === key2) {
|
|
76072
76074
|
prev.next = curr.next;
|
|
76073
76075
|
if (!isDelete) {
|
|
76074
76076
|
curr.next = /** @type {NonNullable<typeof list.next>} */
|
|
@@ -76079,61 +76081,61 @@ var require_side_channel_list = __commonJS({
|
|
|
76079
76081
|
}
|
|
76080
76082
|
}
|
|
76081
76083
|
};
|
|
76082
|
-
var listGet = function(objects,
|
|
76084
|
+
var listGet = function(objects, key2) {
|
|
76083
76085
|
if (!objects) {
|
|
76084
76086
|
return void 0;
|
|
76085
76087
|
}
|
|
76086
|
-
var node = listGetNode(objects,
|
|
76088
|
+
var node = listGetNode(objects, key2);
|
|
76087
76089
|
return node && node.value;
|
|
76088
76090
|
};
|
|
76089
|
-
var listSet = function(objects,
|
|
76090
|
-
var node = listGetNode(objects,
|
|
76091
|
+
var listSet = function(objects, key2, value) {
|
|
76092
|
+
var node = listGetNode(objects, key2);
|
|
76091
76093
|
if (node) {
|
|
76092
76094
|
node.value = value;
|
|
76093
76095
|
} else {
|
|
76094
76096
|
objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
|
|
76095
76097
|
{
|
|
76096
76098
|
// eslint-disable-line no-param-reassign, no-extra-parens
|
|
76097
|
-
key,
|
|
76099
|
+
key: key2,
|
|
76098
76100
|
next: objects.next,
|
|
76099
76101
|
value
|
|
76100
76102
|
};
|
|
76101
76103
|
}
|
|
76102
76104
|
};
|
|
76103
|
-
var listHas = function(objects,
|
|
76105
|
+
var listHas = function(objects, key2) {
|
|
76104
76106
|
if (!objects) {
|
|
76105
76107
|
return false;
|
|
76106
76108
|
}
|
|
76107
|
-
return !!listGetNode(objects,
|
|
76109
|
+
return !!listGetNode(objects, key2);
|
|
76108
76110
|
};
|
|
76109
|
-
var listDelete = function(objects,
|
|
76111
|
+
var listDelete = function(objects, key2) {
|
|
76110
76112
|
if (objects) {
|
|
76111
|
-
return listGetNode(objects,
|
|
76113
|
+
return listGetNode(objects, key2, true);
|
|
76112
76114
|
}
|
|
76113
76115
|
};
|
|
76114
76116
|
module2.exports = function getSideChannelList() {
|
|
76115
76117
|
var $o;
|
|
76116
76118
|
var channel = {
|
|
76117
|
-
assert: function(
|
|
76118
|
-
if (!channel.has(
|
|
76119
|
-
throw new $TypeError("Side channel does not contain " + inspect(
|
|
76119
|
+
assert: function(key2) {
|
|
76120
|
+
if (!channel.has(key2)) {
|
|
76121
|
+
throw new $TypeError("Side channel does not contain " + inspect(key2));
|
|
76120
76122
|
}
|
|
76121
76123
|
},
|
|
76122
|
-
"delete": function(
|
|
76124
|
+
"delete": function(key2) {
|
|
76123
76125
|
var root = $o && $o.next;
|
|
76124
|
-
var deletedNode = listDelete($o,
|
|
76126
|
+
var deletedNode = listDelete($o, key2);
|
|
76125
76127
|
if (deletedNode && root && root === deletedNode) {
|
|
76126
76128
|
$o = void 0;
|
|
76127
76129
|
}
|
|
76128
76130
|
return !!deletedNode;
|
|
76129
76131
|
},
|
|
76130
|
-
get: function(
|
|
76131
|
-
return listGet($o,
|
|
76132
|
+
get: function(key2) {
|
|
76133
|
+
return listGet($o, key2);
|
|
76132
76134
|
},
|
|
76133
|
-
has: function(
|
|
76134
|
-
return listHas($o,
|
|
76135
|
+
has: function(key2) {
|
|
76136
|
+
return listHas($o, key2);
|
|
76135
76137
|
},
|
|
76136
|
-
set: function(
|
|
76138
|
+
set: function(key2, value) {
|
|
76137
76139
|
if (!$o) {
|
|
76138
76140
|
$o = {
|
|
76139
76141
|
next: void 0
|
|
@@ -76142,7 +76144,7 @@ var require_side_channel_list = __commonJS({
|
|
|
76142
76144
|
listSet(
|
|
76143
76145
|
/** @type {NonNullable<typeof $o>} */
|
|
76144
76146
|
$o,
|
|
76145
|
-
|
|
76147
|
+
key2,
|
|
76146
76148
|
value
|
|
76147
76149
|
);
|
|
76148
76150
|
}
|
|
@@ -76988,14 +76990,14 @@ var require_side_channel_map = __commonJS({
|
|
|
76988
76990
|
function getSideChannelMap() {
|
|
76989
76991
|
var $m;
|
|
76990
76992
|
var channel = {
|
|
76991
|
-
assert: function(
|
|
76992
|
-
if (!channel.has(
|
|
76993
|
-
throw new $TypeError("Side channel does not contain " + inspect(
|
|
76993
|
+
assert: function(key2) {
|
|
76994
|
+
if (!channel.has(key2)) {
|
|
76995
|
+
throw new $TypeError("Side channel does not contain " + inspect(key2));
|
|
76994
76996
|
}
|
|
76995
76997
|
},
|
|
76996
|
-
"delete": function(
|
|
76998
|
+
"delete": function(key2) {
|
|
76997
76999
|
if ($m) {
|
|
76998
|
-
var result = $mapDelete($m,
|
|
77000
|
+
var result = $mapDelete($m, key2);
|
|
76999
77001
|
if ($mapSize($m) === 0) {
|
|
77000
77002
|
$m = void 0;
|
|
77001
77003
|
}
|
|
@@ -77003,22 +77005,22 @@ var require_side_channel_map = __commonJS({
|
|
|
77003
77005
|
}
|
|
77004
77006
|
return false;
|
|
77005
77007
|
},
|
|
77006
|
-
get: function(
|
|
77008
|
+
get: function(key2) {
|
|
77007
77009
|
if ($m) {
|
|
77008
|
-
return $mapGet($m,
|
|
77010
|
+
return $mapGet($m, key2);
|
|
77009
77011
|
}
|
|
77010
77012
|
},
|
|
77011
|
-
has: function(
|
|
77013
|
+
has: function(key2) {
|
|
77012
77014
|
if ($m) {
|
|
77013
|
-
return $mapHas($m,
|
|
77015
|
+
return $mapHas($m, key2);
|
|
77014
77016
|
}
|
|
77015
77017
|
return false;
|
|
77016
77018
|
},
|
|
77017
|
-
set: function(
|
|
77019
|
+
set: function(key2, value) {
|
|
77018
77020
|
if (!$m) {
|
|
77019
77021
|
$m = new $Map();
|
|
77020
77022
|
}
|
|
77021
|
-
$mapSet($m,
|
|
77023
|
+
$mapSet($m, key2, value);
|
|
77022
77024
|
}
|
|
77023
77025
|
};
|
|
77024
77026
|
return channel;
|
|
@@ -77046,50 +77048,50 @@ var require_side_channel_weakmap = __commonJS({
|
|
|
77046
77048
|
var $wm;
|
|
77047
77049
|
var $m;
|
|
77048
77050
|
var channel = {
|
|
77049
|
-
assert: function(
|
|
77050
|
-
if (!channel.has(
|
|
77051
|
-
throw new $TypeError("Side channel does not contain " + inspect(
|
|
77051
|
+
assert: function(key2) {
|
|
77052
|
+
if (!channel.has(key2)) {
|
|
77053
|
+
throw new $TypeError("Side channel does not contain " + inspect(key2));
|
|
77052
77054
|
}
|
|
77053
77055
|
},
|
|
77054
|
-
"delete": function(
|
|
77055
|
-
if ($WeakMap &&
|
|
77056
|
+
"delete": function(key2) {
|
|
77057
|
+
if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) {
|
|
77056
77058
|
if ($wm) {
|
|
77057
|
-
return $weakMapDelete($wm,
|
|
77059
|
+
return $weakMapDelete($wm, key2);
|
|
77058
77060
|
}
|
|
77059
77061
|
} else if (getSideChannelMap) {
|
|
77060
77062
|
if ($m) {
|
|
77061
|
-
return $m["delete"](
|
|
77063
|
+
return $m["delete"](key2);
|
|
77062
77064
|
}
|
|
77063
77065
|
}
|
|
77064
77066
|
return false;
|
|
77065
77067
|
},
|
|
77066
|
-
get: function(
|
|
77067
|
-
if ($WeakMap &&
|
|
77068
|
+
get: function(key2) {
|
|
77069
|
+
if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) {
|
|
77068
77070
|
if ($wm) {
|
|
77069
|
-
return $weakMapGet($wm,
|
|
77071
|
+
return $weakMapGet($wm, key2);
|
|
77070
77072
|
}
|
|
77071
77073
|
}
|
|
77072
|
-
return $m && $m.get(
|
|
77074
|
+
return $m && $m.get(key2);
|
|
77073
77075
|
},
|
|
77074
|
-
has: function(
|
|
77075
|
-
if ($WeakMap &&
|
|
77076
|
+
has: function(key2) {
|
|
77077
|
+
if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) {
|
|
77076
77078
|
if ($wm) {
|
|
77077
|
-
return $weakMapHas($wm,
|
|
77079
|
+
return $weakMapHas($wm, key2);
|
|
77078
77080
|
}
|
|
77079
77081
|
}
|
|
77080
|
-
return !!$m && $m.has(
|
|
77082
|
+
return !!$m && $m.has(key2);
|
|
77081
77083
|
},
|
|
77082
|
-
set: function(
|
|
77083
|
-
if ($WeakMap &&
|
|
77084
|
+
set: function(key2, value) {
|
|
77085
|
+
if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) {
|
|
77084
77086
|
if (!$wm) {
|
|
77085
77087
|
$wm = new $WeakMap();
|
|
77086
77088
|
}
|
|
77087
|
-
$weakMapSet($wm,
|
|
77089
|
+
$weakMapSet($wm, key2, value);
|
|
77088
77090
|
} else if (getSideChannelMap) {
|
|
77089
77091
|
if (!$m) {
|
|
77090
77092
|
$m = getSideChannelMap();
|
|
77091
77093
|
}
|
|
77092
|
-
$m.set(
|
|
77094
|
+
$m.set(key2, value);
|
|
77093
77095
|
}
|
|
77094
77096
|
}
|
|
77095
77097
|
};
|
|
@@ -77112,25 +77114,25 @@ var require_side_channel = __commonJS({
|
|
|
77112
77114
|
module2.exports = function getSideChannel() {
|
|
77113
77115
|
var $channelData;
|
|
77114
77116
|
var channel = {
|
|
77115
|
-
assert: function(
|
|
77116
|
-
if (!channel.has(
|
|
77117
|
-
throw new $TypeError("Side channel does not contain " + inspect(
|
|
77117
|
+
assert: function(key2) {
|
|
77118
|
+
if (!channel.has(key2)) {
|
|
77119
|
+
throw new $TypeError("Side channel does not contain " + inspect(key2));
|
|
77118
77120
|
}
|
|
77119
77121
|
},
|
|
77120
|
-
"delete": function(
|
|
77121
|
-
return !!$channelData && $channelData["delete"](
|
|
77122
|
+
"delete": function(key2) {
|
|
77123
|
+
return !!$channelData && $channelData["delete"](key2);
|
|
77122
77124
|
},
|
|
77123
|
-
get: function(
|
|
77124
|
-
return $channelData && $channelData.get(
|
|
77125
|
+
get: function(key2) {
|
|
77126
|
+
return $channelData && $channelData.get(key2);
|
|
77125
77127
|
},
|
|
77126
|
-
has: function(
|
|
77127
|
-
return !!$channelData && $channelData.has(
|
|
77128
|
+
has: function(key2) {
|
|
77129
|
+
return !!$channelData && $channelData.has(key2);
|
|
77128
77130
|
},
|
|
77129
|
-
set: function(
|
|
77131
|
+
set: function(key2, value) {
|
|
77130
77132
|
if (!$channelData) {
|
|
77131
77133
|
$channelData = makeChannel();
|
|
77132
77134
|
}
|
|
77133
|
-
$channelData.set(
|
|
77135
|
+
$channelData.set(key2, value);
|
|
77134
77136
|
}
|
|
77135
77137
|
};
|
|
77136
77138
|
return channel;
|
|
@@ -77268,19 +77270,19 @@ var require_utils7 = __commonJS({
|
|
|
77268
77270
|
});
|
|
77269
77271
|
return target;
|
|
77270
77272
|
}
|
|
77271
|
-
return Object.keys(source).reduce(function(acc,
|
|
77272
|
-
var value = source[
|
|
77273
|
-
if (has.call(acc,
|
|
77274
|
-
acc[
|
|
77273
|
+
return Object.keys(source).reduce(function(acc, key2) {
|
|
77274
|
+
var value = source[key2];
|
|
77275
|
+
if (has.call(acc, key2)) {
|
|
77276
|
+
acc[key2] = merge3(acc[key2], value, options);
|
|
77275
77277
|
} else {
|
|
77276
|
-
acc[
|
|
77278
|
+
acc[key2] = value;
|
|
77277
77279
|
}
|
|
77278
77280
|
return acc;
|
|
77279
77281
|
}, mergeTarget);
|
|
77280
77282
|
};
|
|
77281
77283
|
var assign = function assignSingleSource(target, source) {
|
|
77282
|
-
return Object.keys(source).reduce(function(acc,
|
|
77283
|
-
acc[
|
|
77284
|
+
return Object.keys(source).reduce(function(acc, key2) {
|
|
77285
|
+
acc[key2] = source[key2];
|
|
77284
77286
|
return acc;
|
|
77285
77287
|
}, target);
|
|
77286
77288
|
};
|
|
@@ -77349,10 +77351,10 @@ var require_utils7 = __commonJS({
|
|
|
77349
77351
|
var obj = item.obj[item.prop];
|
|
77350
77352
|
var keys = Object.keys(obj);
|
|
77351
77353
|
for (var j = 0; j < keys.length; ++j) {
|
|
77352
|
-
var
|
|
77353
|
-
var val = obj[
|
|
77354
|
+
var key2 = keys[j];
|
|
77355
|
+
var val = obj[key2];
|
|
77354
77356
|
if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
|
|
77355
|
-
queue.push({ obj, prop:
|
|
77357
|
+
queue.push({ obj, prop: key2 });
|
|
77356
77358
|
refs.push(val);
|
|
77357
77359
|
}
|
|
77358
77360
|
}
|
|
@@ -77421,8 +77423,8 @@ var require_stringify = __commonJS({
|
|
|
77421
77423
|
return prefix + "[]";
|
|
77422
77424
|
},
|
|
77423
77425
|
comma: "comma",
|
|
77424
|
-
indices: function indices(prefix,
|
|
77425
|
-
return prefix + "[" +
|
|
77426
|
+
indices: function indices(prefix, key2) {
|
|
77427
|
+
return prefix + "[" + key2 + "]";
|
|
77426
77428
|
},
|
|
77427
77429
|
repeat: function repeat(prefix) {
|
|
77428
77430
|
return prefix;
|
|
@@ -77529,12 +77531,12 @@ var require_stringify = __commonJS({
|
|
|
77529
77531
|
return adjustedPrefix + "[]";
|
|
77530
77532
|
}
|
|
77531
77533
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
77532
|
-
var
|
|
77533
|
-
var value = typeof
|
|
77534
|
+
var key2 = objKeys[j];
|
|
77535
|
+
var value = typeof key2 === "object" && key2 && typeof key2.value !== "undefined" ? key2.value : obj[key2];
|
|
77534
77536
|
if (skipNulls && value === null) {
|
|
77535
77537
|
continue;
|
|
77536
77538
|
}
|
|
77537
|
-
var encodedKey = allowDots && encodeDotInKeys ? String(
|
|
77539
|
+
var encodedKey = allowDots && encodeDotInKeys ? String(key2).replace(/\./g, "%2E") : String(key2);
|
|
77538
77540
|
var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
|
|
77539
77541
|
sideChannel.set(object3, step);
|
|
77540
77542
|
var valueSideChannel = getSideChannel();
|
|
@@ -77651,14 +77653,14 @@ var require_stringify = __commonJS({
|
|
|
77651
77653
|
}
|
|
77652
77654
|
var sideChannel = getSideChannel();
|
|
77653
77655
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
77654
|
-
var
|
|
77655
|
-
var value = obj[
|
|
77656
|
+
var key2 = objKeys[i];
|
|
77657
|
+
var value = obj[key2];
|
|
77656
77658
|
if (options.skipNulls && value === null) {
|
|
77657
77659
|
continue;
|
|
77658
77660
|
}
|
|
77659
77661
|
pushToArray(keys, stringify2(
|
|
77660
77662
|
value,
|
|
77661
|
-
|
|
77663
|
+
key2,
|
|
77662
77664
|
generateArrayPrefix,
|
|
77663
77665
|
commaRoundTrip,
|
|
77664
77666
|
options.allowEmptyArrays,
|
|
@@ -77772,19 +77774,19 @@ var require_parse2 = __commonJS({
|
|
|
77772
77774
|
var part = parts[i];
|
|
77773
77775
|
var bracketEqualsPos = part.indexOf("]=");
|
|
77774
77776
|
var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
|
|
77775
|
-
var
|
|
77777
|
+
var key2;
|
|
77776
77778
|
var val;
|
|
77777
77779
|
if (pos === -1) {
|
|
77778
|
-
|
|
77780
|
+
key2 = options.decoder(part, defaults2.decoder, charset, "key");
|
|
77779
77781
|
val = options.strictNullHandling ? null : "";
|
|
77780
77782
|
} else {
|
|
77781
|
-
|
|
77782
|
-
if (
|
|
77783
|
+
key2 = options.decoder(part.slice(0, pos), defaults2.decoder, charset, "key");
|
|
77784
|
+
if (key2 !== null) {
|
|
77783
77785
|
val = utils.maybeMap(
|
|
77784
77786
|
parseArrayValue(
|
|
77785
77787
|
part.slice(pos + 1),
|
|
77786
77788
|
options,
|
|
77787
|
-
isArray(obj[
|
|
77789
|
+
isArray(obj[key2]) ? obj[key2].length : 0
|
|
77788
77790
|
),
|
|
77789
77791
|
function(encodedVal) {
|
|
77790
77792
|
return options.decoder(encodedVal, defaults2.decoder, charset, "value");
|
|
@@ -77798,17 +77800,17 @@ var require_parse2 = __commonJS({
|
|
|
77798
77800
|
if (part.indexOf("[]=") > -1) {
|
|
77799
77801
|
val = isArray(val) ? [val] : val;
|
|
77800
77802
|
}
|
|
77801
|
-
if (
|
|
77802
|
-
var existing = has.call(obj,
|
|
77803
|
+
if (key2 !== null) {
|
|
77804
|
+
var existing = has.call(obj, key2);
|
|
77803
77805
|
if (existing && options.duplicates === "combine") {
|
|
77804
|
-
obj[
|
|
77805
|
-
obj[
|
|
77806
|
+
obj[key2] = utils.combine(
|
|
77807
|
+
obj[key2],
|
|
77806
77808
|
val,
|
|
77807
77809
|
options.arrayLimit,
|
|
77808
77810
|
options.plainObjects
|
|
77809
77811
|
);
|
|
77810
77812
|
} else if (!existing || options.duplicates === "last") {
|
|
77811
|
-
obj[
|
|
77813
|
+
obj[key2] = val;
|
|
77812
77814
|
}
|
|
77813
77815
|
}
|
|
77814
77816
|
}
|
|
@@ -77854,19 +77856,19 @@ var require_parse2 = __commonJS({
|
|
|
77854
77856
|
return leaf;
|
|
77855
77857
|
};
|
|
77856
77858
|
var splitKeyIntoSegments = function splitKeyIntoSegments2(givenKey, options) {
|
|
77857
|
-
var
|
|
77859
|
+
var key2 = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
|
|
77858
77860
|
if (options.depth <= 0) {
|
|
77859
|
-
if (!options.plainObjects && has.call(Object.prototype,
|
|
77861
|
+
if (!options.plainObjects && has.call(Object.prototype, key2)) {
|
|
77860
77862
|
if (!options.allowPrototypes) {
|
|
77861
77863
|
return;
|
|
77862
77864
|
}
|
|
77863
77865
|
}
|
|
77864
|
-
return [
|
|
77866
|
+
return [key2];
|
|
77865
77867
|
}
|
|
77866
77868
|
var brackets = /(\[[^[\]]*])/;
|
|
77867
77869
|
var child = /(\[[^[\]]*])/g;
|
|
77868
|
-
var segment = brackets.exec(
|
|
77869
|
-
var parent = segment ?
|
|
77870
|
+
var segment = brackets.exec(key2);
|
|
77871
|
+
var parent = segment ? key2.slice(0, segment.index) : key2;
|
|
77870
77872
|
var keys = [];
|
|
77871
77873
|
if (parent) {
|
|
77872
77874
|
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
@@ -77877,7 +77879,7 @@ var require_parse2 = __commonJS({
|
|
|
77877
77879
|
keys.push(parent);
|
|
77878
77880
|
}
|
|
77879
77881
|
var i = 0;
|
|
77880
|
-
while ((segment = child.exec(
|
|
77882
|
+
while ((segment = child.exec(key2)) !== null && i < options.depth) {
|
|
77881
77883
|
i += 1;
|
|
77882
77884
|
var segmentContent = segment[1].slice(1, -1);
|
|
77883
77885
|
if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
|
|
@@ -77891,7 +77893,7 @@ var require_parse2 = __commonJS({
|
|
|
77891
77893
|
if (options.strictDepth === true) {
|
|
77892
77894
|
throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
|
|
77893
77895
|
}
|
|
77894
|
-
keys.push("[" +
|
|
77896
|
+
keys.push("[" + key2.slice(segment.index) + "]");
|
|
77895
77897
|
}
|
|
77896
77898
|
return keys;
|
|
77897
77899
|
};
|
|
@@ -77964,8 +77966,8 @@ var require_parse2 = __commonJS({
|
|
|
77964
77966
|
var obj = options.plainObjects ? { __proto__: null } : {};
|
|
77965
77967
|
var keys = Object.keys(tempObj);
|
|
77966
77968
|
for (var i = 0; i < keys.length; ++i) {
|
|
77967
|
-
var
|
|
77968
|
-
var newObj = parseKeys(
|
|
77969
|
+
var key2 = keys[i];
|
|
77970
|
+
var newObj = parseKeys(key2, tempObj[key2], options, typeof str2 === "string");
|
|
77969
77971
|
obj = utils.merge(obj, newObj, options);
|
|
77970
77972
|
}
|
|
77971
77973
|
if (options.allowSparse === true) {
|
|
@@ -78382,8 +78384,8 @@ var require_finalhandler = __commonJS({
|
|
|
78382
78384
|
res.removeHeader("Content-Encoding");
|
|
78383
78385
|
res.removeHeader("Content-Language");
|
|
78384
78386
|
res.removeHeader("Content-Range");
|
|
78385
|
-
for (const [
|
|
78386
|
-
res.setHeader(
|
|
78387
|
+
for (const [key2, value] of Object.entries(headers ?? {})) {
|
|
78388
|
+
res.setHeader(key2, value);
|
|
78387
78389
|
}
|
|
78388
78390
|
res.setHeader("Content-Security-Policy", "default-src 'none'");
|
|
78389
78391
|
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
@@ -79405,12 +79407,12 @@ var require_utils8 = __commonJS({
|
|
|
79405
79407
|
index = str2.lastIndexOf(";", splitIndex - 1) + 1;
|
|
79406
79408
|
continue;
|
|
79407
79409
|
}
|
|
79408
|
-
var
|
|
79410
|
+
var key2 = str2.slice(index, splitIndex).trim();
|
|
79409
79411
|
var value = str2.slice(splitIndex + 1, endIndex).trim();
|
|
79410
|
-
if (
|
|
79412
|
+
if (key2 === "q") {
|
|
79411
79413
|
ret.quality = parseFloat(value);
|
|
79412
79414
|
} else {
|
|
79413
|
-
ret.params[
|
|
79415
|
+
ret.params[key2] = value;
|
|
79414
79416
|
}
|
|
79415
79417
|
index = endIndex + 1;
|
|
79416
79418
|
}
|
|
@@ -79790,10 +79792,10 @@ var require_dist3 = __commonJS({
|
|
|
79790
79792
|
function match(path2, options = {}) {
|
|
79791
79793
|
const { decode: decode3 = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
79792
79794
|
const { regexp, keys } = pathToRegexp(path2, options);
|
|
79793
|
-
const decoders = keys.map((
|
|
79795
|
+
const decoders = keys.map((key2) => {
|
|
79794
79796
|
if (decode3 === false)
|
|
79795
79797
|
return NOOP_VALUE;
|
|
79796
|
-
if (
|
|
79798
|
+
if (key2.type === "param")
|
|
79797
79799
|
return decode3;
|
|
79798
79800
|
return (value) => value.split(delimiter).map(decode3);
|
|
79799
79801
|
});
|
|
@@ -79806,9 +79808,9 @@ var require_dist3 = __commonJS({
|
|
|
79806
79808
|
for (let i = 1; i < m.length; i++) {
|
|
79807
79809
|
if (m[i] === void 0)
|
|
79808
79810
|
continue;
|
|
79809
|
-
const
|
|
79811
|
+
const key2 = keys[i - 1];
|
|
79810
79812
|
const decoder = decoders[i - 1];
|
|
79811
|
-
params[
|
|
79813
|
+
params[key2.name] = decoder(m[i]);
|
|
79812
79814
|
}
|
|
79813
79815
|
return { path: path3, params };
|
|
79814
79816
|
};
|
|
@@ -79978,8 +79980,8 @@ var require_layer = __commonJS({
|
|
|
79978
79980
|
}
|
|
79979
79981
|
const params = {};
|
|
79980
79982
|
for (let i = 1; i < match.length; i++) {
|
|
79981
|
-
const
|
|
79982
|
-
const prop =
|
|
79983
|
+
const key2 = keys[i - 1];
|
|
79984
|
+
const prop = key2.name;
|
|
79983
79985
|
const val = decodeParam(match[i]);
|
|
79984
79986
|
if (val !== void 0) {
|
|
79985
79987
|
params[prop] = val;
|
|
@@ -80504,7 +80506,7 @@ var require_router = __commonJS({
|
|
|
80504
80506
|
}
|
|
80505
80507
|
let i = 0;
|
|
80506
80508
|
let paramIndex = 0;
|
|
80507
|
-
let
|
|
80509
|
+
let key2;
|
|
80508
80510
|
let paramVal;
|
|
80509
80511
|
let paramCallbacks;
|
|
80510
80512
|
let paramCalled;
|
|
@@ -80516,18 +80518,18 @@ var require_router = __commonJS({
|
|
|
80516
80518
|
return done();
|
|
80517
80519
|
}
|
|
80518
80520
|
paramIndex = 0;
|
|
80519
|
-
|
|
80520
|
-
paramVal = req.params[
|
|
80521
|
-
paramCallbacks = params[
|
|
80522
|
-
paramCalled = called[
|
|
80521
|
+
key2 = keys[i++];
|
|
80522
|
+
paramVal = req.params[key2];
|
|
80523
|
+
paramCallbacks = params[key2];
|
|
80524
|
+
paramCalled = called[key2];
|
|
80523
80525
|
if (paramVal === void 0 || !paramCallbacks) {
|
|
80524
80526
|
return param();
|
|
80525
80527
|
}
|
|
80526
80528
|
if (paramCalled && (paramCalled.match === paramVal || paramCalled.error && paramCalled.error !== "route")) {
|
|
80527
|
-
req.params[
|
|
80529
|
+
req.params[key2] = paramCalled.value;
|
|
80528
80530
|
return param(paramCalled.error);
|
|
80529
80531
|
}
|
|
80530
|
-
called[
|
|
80532
|
+
called[key2] = paramCalled = {
|
|
80531
80533
|
error: null,
|
|
80532
80534
|
match: paramVal,
|
|
80533
80535
|
value: paramVal
|
|
@@ -80536,7 +80538,7 @@ var require_router = __commonJS({
|
|
|
80536
80538
|
}
|
|
80537
80539
|
function paramCallback(err2) {
|
|
80538
80540
|
const fn = paramCallbacks[paramIndex++];
|
|
80539
|
-
paramCalled.value = req.params[
|
|
80541
|
+
paramCalled.value = req.params[key2];
|
|
80540
80542
|
if (err2) {
|
|
80541
80543
|
paramCalled.error = err2;
|
|
80542
80544
|
param(err2);
|
|
@@ -80544,7 +80546,7 @@ var require_router = __commonJS({
|
|
|
80544
80546
|
}
|
|
80545
80547
|
if (!fn) return param();
|
|
80546
80548
|
try {
|
|
80547
|
-
const ret = fn(req, res, paramCallback, paramVal,
|
|
80549
|
+
const ret = fn(req, res, paramCallback, paramVal, key2);
|
|
80548
80550
|
if (isPromise2(ret)) {
|
|
80549
80551
|
if (!(ret instanceof Promise)) {
|
|
80550
80552
|
deprecate("parameters that are Promise-like are deprecated, use a native Promise instead");
|
|
@@ -81190,14 +81192,14 @@ var require_mediaType = __commonJS({
|
|
|
81190
81192
|
var kvps = splitParameters(match[3]).map(splitKeyValuePair);
|
|
81191
81193
|
for (var j = 0; j < kvps.length; j++) {
|
|
81192
81194
|
var pair = kvps[j];
|
|
81193
|
-
var
|
|
81195
|
+
var key2 = pair[0].toLowerCase();
|
|
81194
81196
|
var val = pair[1];
|
|
81195
81197
|
var value = val && val[0] === '"' && val[val.length - 1] === '"' ? val.slice(1, -1) : val;
|
|
81196
|
-
if (
|
|
81198
|
+
if (key2 === "q") {
|
|
81197
81199
|
q = parseFloat(value);
|
|
81198
81200
|
break;
|
|
81199
81201
|
}
|
|
81200
|
-
params[
|
|
81202
|
+
params[key2] = value;
|
|
81201
81203
|
}
|
|
81202
81204
|
}
|
|
81203
81205
|
return {
|
|
@@ -81283,15 +81285,15 @@ var require_mediaType = __commonJS({
|
|
|
81283
81285
|
}
|
|
81284
81286
|
function splitKeyValuePair(str2) {
|
|
81285
81287
|
var index = str2.indexOf("=");
|
|
81286
|
-
var
|
|
81288
|
+
var key2;
|
|
81287
81289
|
var val;
|
|
81288
81290
|
if (index === -1) {
|
|
81289
|
-
|
|
81291
|
+
key2 = str2;
|
|
81290
81292
|
} else {
|
|
81291
|
-
|
|
81293
|
+
key2 = str2.slice(0, index);
|
|
81292
81294
|
val = str2.slice(index + 1);
|
|
81293
81295
|
}
|
|
81294
|
-
return [
|
|
81296
|
+
return [key2, val];
|
|
81295
81297
|
}
|
|
81296
81298
|
function splitMediaTypes(accept) {
|
|
81297
81299
|
var accepts = accept.split(",");
|
|
@@ -81867,7 +81869,7 @@ var require_content_disposition = __commonJS({
|
|
|
81867
81869
|
}
|
|
81868
81870
|
var index = match[0].length;
|
|
81869
81871
|
var type = match[1].toLowerCase();
|
|
81870
|
-
var
|
|
81872
|
+
var key2;
|
|
81871
81873
|
var names = [];
|
|
81872
81874
|
var params = {};
|
|
81873
81875
|
var value;
|
|
@@ -81877,25 +81879,25 @@ var require_content_disposition = __commonJS({
|
|
|
81877
81879
|
throw new TypeError("invalid parameter format");
|
|
81878
81880
|
}
|
|
81879
81881
|
index += match[0].length;
|
|
81880
|
-
|
|
81882
|
+
key2 = match[1].toLowerCase();
|
|
81881
81883
|
value = match[2];
|
|
81882
|
-
if (names.indexOf(
|
|
81884
|
+
if (names.indexOf(key2) !== -1) {
|
|
81883
81885
|
throw new TypeError("invalid duplicate parameter");
|
|
81884
81886
|
}
|
|
81885
|
-
names.push(
|
|
81886
|
-
if (
|
|
81887
|
-
|
|
81887
|
+
names.push(key2);
|
|
81888
|
+
if (key2.indexOf("*") + 1 === key2.length) {
|
|
81889
|
+
key2 = key2.slice(0, -1);
|
|
81888
81890
|
value = decodefield(value);
|
|
81889
|
-
params[
|
|
81891
|
+
params[key2] = value;
|
|
81890
81892
|
continue;
|
|
81891
81893
|
}
|
|
81892
|
-
if (typeof params[
|
|
81894
|
+
if (typeof params[key2] === "string") {
|
|
81893
81895
|
continue;
|
|
81894
81896
|
}
|
|
81895
81897
|
if (value[0] === '"') {
|
|
81896
81898
|
value = value.slice(1, -1).replace(QESC_REGEXP, "$1");
|
|
81897
81899
|
}
|
|
81898
|
-
params[
|
|
81900
|
+
params[key2] = value;
|
|
81899
81901
|
}
|
|
81900
81902
|
if (index !== -1 && index !== string3.length) {
|
|
81901
81903
|
throw new TypeError("invalid parameter format");
|
|
@@ -81977,8 +81979,8 @@ var require_cookie = __commonJS({
|
|
|
81977
81979
|
}
|
|
81978
81980
|
var keyStartIdx = startIndex(str2, index, eqIdx);
|
|
81979
81981
|
var keyEndIdx = endIndex(str2, eqIdx, keyStartIdx);
|
|
81980
|
-
var
|
|
81981
|
-
if (!__hasOwnProperty.call(obj,
|
|
81982
|
+
var key2 = str2.slice(keyStartIdx, keyEndIdx);
|
|
81983
|
+
if (!__hasOwnProperty.call(obj, key2)) {
|
|
81982
81984
|
var valStartIdx = startIndex(str2, eqIdx + 1, endIdx);
|
|
81983
81985
|
var valEndIdx = endIndex(str2, endIdx, valStartIdx);
|
|
81984
81986
|
if (str2.charCodeAt(valStartIdx) === 34 && str2.charCodeAt(valEndIdx - 1) === 34) {
|
|
@@ -81986,7 +81988,7 @@ var require_cookie = __commonJS({
|
|
|
81986
81988
|
valEndIdx--;
|
|
81987
81989
|
}
|
|
81988
81990
|
var val = str2.slice(valStartIdx, valEndIdx);
|
|
81989
|
-
obj[
|
|
81991
|
+
obj[key2] = tryDecode(val, dec);
|
|
81990
81992
|
}
|
|
81991
81993
|
index = endIdx + 1;
|
|
81992
81994
|
} while (index < len);
|
|
@@ -82584,8 +82586,8 @@ var require_send = __commonJS({
|
|
|
82584
82586
|
function setHeaders(res, headers) {
|
|
82585
82587
|
var keys = Object.keys(headers);
|
|
82586
82588
|
for (var i = 0; i < keys.length; i++) {
|
|
82587
|
-
var
|
|
82588
|
-
res.setHeader(
|
|
82589
|
+
var key2 = keys[i];
|
|
82590
|
+
res.setHeader(key2, headers[key2]);
|
|
82589
82591
|
}
|
|
82590
82592
|
}
|
|
82591
82593
|
}
|
|
@@ -82884,9 +82886,9 @@ var require_response = __commonJS({
|
|
|
82884
82886
|
if (opts && opts.headers) {
|
|
82885
82887
|
var keys = Object.keys(opts.headers);
|
|
82886
82888
|
for (var i = 0; i < keys.length; i++) {
|
|
82887
|
-
var
|
|
82888
|
-
if (
|
|
82889
|
-
headers[
|
|
82889
|
+
var key2 = keys[i];
|
|
82890
|
+
if (key2.toLowerCase() !== "content-disposition") {
|
|
82891
|
+
headers[key2] = opts.headers[key2];
|
|
82890
82892
|
}
|
|
82891
82893
|
}
|
|
82892
82894
|
}
|
|
@@ -82905,11 +82907,11 @@ var require_response = __commonJS({
|
|
|
82905
82907
|
var keys = Object.keys(obj).filter(function(v) {
|
|
82906
82908
|
return v !== "default";
|
|
82907
82909
|
});
|
|
82908
|
-
var
|
|
82910
|
+
var key2 = keys.length > 0 ? req.accepts(keys) : false;
|
|
82909
82911
|
this.vary("Accept");
|
|
82910
|
-
if (
|
|
82911
|
-
this.set("Content-Type", normalizeType(
|
|
82912
|
-
obj[
|
|
82912
|
+
if (key2) {
|
|
82913
|
+
this.set("Content-Type", normalizeType(key2).value);
|
|
82914
|
+
obj[key2](req, this, next);
|
|
82913
82915
|
} else if (obj.default) {
|
|
82914
82916
|
obj.default(req, this, next);
|
|
82915
82917
|
} else {
|
|
@@ -82947,8 +82949,8 @@ var require_response = __commonJS({
|
|
|
82947
82949
|
}
|
|
82948
82950
|
this.setHeader(field, value);
|
|
82949
82951
|
} else {
|
|
82950
|
-
for (var
|
|
82951
|
-
this.set(
|
|
82952
|
+
for (var key2 in field) {
|
|
82953
|
+
this.set(key2, field[key2]);
|
|
82952
82954
|
}
|
|
82953
82955
|
}
|
|
82954
82956
|
return this;
|
|
@@ -83368,10 +83370,10 @@ var init_dist = __esm({
|
|
|
83368
83370
|
const headerRecord = [];
|
|
83369
83371
|
const rawHeaders = incoming.rawHeaders;
|
|
83370
83372
|
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
83371
|
-
const { [i]:
|
|
83372
|
-
if (
|
|
83373
|
+
const { [i]: key2, [i + 1]: value } = rawHeaders;
|
|
83374
|
+
if (key2.charCodeAt(0) !== /*:*/
|
|
83373
83375
|
58) {
|
|
83374
|
-
headerRecord.push([
|
|
83376
|
+
headerRecord.push([key2, value]);
|
|
83375
83377
|
}
|
|
83376
83378
|
}
|
|
83377
83379
|
return new Headers(headerRecord);
|
|
@@ -85092,7 +85094,7 @@ async function config5(args) {
|
|
|
85092
85094
|
const apiUrl2 = apiUrl();
|
|
85093
85095
|
const subcommand = args[0];
|
|
85094
85096
|
if (subcommand === "get") {
|
|
85095
|
-
const
|
|
85097
|
+
const key2 = args[1];
|
|
85096
85098
|
const response = await fetch(
|
|
85097
85099
|
`${apiUrl2}/api/v1/workspace/users/me/preferences`,
|
|
85098
85100
|
{
|
|
@@ -85106,12 +85108,12 @@ async function config5(args) {
|
|
|
85106
85108
|
}
|
|
85107
85109
|
const data = await response.json();
|
|
85108
85110
|
const prefs = data.preferences || {};
|
|
85109
|
-
if (
|
|
85110
|
-
const value = prefs[
|
|
85111
|
+
if (key2) {
|
|
85112
|
+
const value = prefs[key2];
|
|
85111
85113
|
if (value === void 0) {
|
|
85112
|
-
console.log(`${
|
|
85114
|
+
console.log(`${key2}: not set`);
|
|
85113
85115
|
} else {
|
|
85114
|
-
console.log(`${
|
|
85116
|
+
console.log(`${key2}: ${value}`);
|
|
85115
85117
|
}
|
|
85116
85118
|
} else {
|
|
85117
85119
|
if (Object.keys(prefs).length === 0) {
|
|
@@ -85123,14 +85125,14 @@ async function config5(args) {
|
|
|
85123
85125
|
}
|
|
85124
85126
|
}
|
|
85125
85127
|
} else if (subcommand === "set") {
|
|
85126
|
-
const
|
|
85128
|
+
const key2 = args[1];
|
|
85127
85129
|
const value = args[2];
|
|
85128
|
-
if (!
|
|
85130
|
+
if (!key2 || value === void 0) {
|
|
85129
85131
|
console.error("Usage: haansi config set <key> <value>");
|
|
85130
85132
|
process.exit(1);
|
|
85131
85133
|
return;
|
|
85132
85134
|
}
|
|
85133
|
-
if (
|
|
85135
|
+
if (key2 === "session_mode" && !VALID_SESSION_MODES.includes(value)) {
|
|
85134
85136
|
console.error(
|
|
85135
85137
|
`Error: session_mode must be one of: ${VALID_SESSION_MODES.join(", ")}`
|
|
85136
85138
|
);
|
|
@@ -85145,7 +85147,7 @@ async function config5(args) {
|
|
|
85145
85147
|
Authorization: `Bearer ${token2}`,
|
|
85146
85148
|
"Content-Type": "application/json"
|
|
85147
85149
|
},
|
|
85148
|
-
body: JSON.stringify({ [
|
|
85150
|
+
body: JSON.stringify({ [key2]: value })
|
|
85149
85151
|
}
|
|
85150
85152
|
);
|
|
85151
85153
|
if (!response.ok) {
|
|
@@ -85153,7 +85155,7 @@ async function config5(args) {
|
|
|
85153
85155
|
process.exit(1);
|
|
85154
85156
|
return;
|
|
85155
85157
|
}
|
|
85156
|
-
console.log(`${
|
|
85158
|
+
console.log(`${key2} set to "${value}"`);
|
|
85157
85159
|
} else {
|
|
85158
85160
|
console.error(`Usage:
|
|
85159
85161
|
haansi config get [key] \u2014 show preferences
|
|
@@ -86819,7 +86821,7 @@ function isDocFile(path2) {
|
|
|
86819
86821
|
}
|
|
86820
86822
|
function lineKeys(files, tests) {
|
|
86821
86823
|
const keys = /* @__PURE__ */ new Map();
|
|
86822
|
-
const add = (
|
|
86824
|
+
const add = (key2) => keys.set(key2, (keys.get(key2) ?? 0) + 1);
|
|
86823
86825
|
for (const f of files) {
|
|
86824
86826
|
if (tests.has(f.path) || isDocFile(f.path)) continue;
|
|
86825
86827
|
for (const l of f.added) if (l.trim()) add(`${f.path}\0+${l.trim()}`);
|
|
@@ -86832,7 +86834,7 @@ function lineOverlapOf(agent, target, testFiles) {
|
|
|
86832
86834
|
const mine = lineKeys(agent, tests);
|
|
86833
86835
|
const theirs = lineKeys(target, tests);
|
|
86834
86836
|
let both = 0;
|
|
86835
|
-
for (const [
|
|
86837
|
+
for (const [key2, n] of mine) both += Math.min(n, theirs.get(key2) ?? 0);
|
|
86836
86838
|
const mineCount = count2(mine);
|
|
86837
86839
|
const theirCount = count2(theirs);
|
|
86838
86840
|
const known = mineCount > 0 && theirCount > 0;
|
|
@@ -87430,8 +87432,8 @@ function pythonMocks(source, fromPath) {
|
|
|
87430
87432
|
const kept = maskPython(source, false);
|
|
87431
87433
|
const out = [];
|
|
87432
87434
|
const add = (c) => {
|
|
87433
|
-
const
|
|
87434
|
-
if (c.length && !out.some((o) => o.join("\0") ===
|
|
87435
|
+
const key2 = c.join("\0");
|
|
87436
|
+
if (c.length && !out.some((o) => o.join("\0") === key2)) out.push(c);
|
|
87435
87437
|
};
|
|
87436
87438
|
for (const m of kept.matchAll(
|
|
87437
87439
|
/\b(?:patch|setattr)\(\s*(?:target\s*=\s*)?["']([A-Za-z_][\w.]*)["']/g
|
|
@@ -88226,8 +88228,8 @@ function usageOf(output) {
|
|
|
88226
88228
|
(o) => o.type === "turn.completed" && o.usage && typeof o.usage === "object"
|
|
88227
88229
|
);
|
|
88228
88230
|
if (turns.length) {
|
|
88229
|
-
const sum = (
|
|
88230
|
-
(n, t) => n + (count3(t.usage[
|
|
88231
|
+
const sum = (key2) => turns.reduce(
|
|
88232
|
+
(n, t) => n + (count3(t.usage[key2]) ?? 0),
|
|
88231
88233
|
0
|
|
88232
88234
|
);
|
|
88233
88235
|
return {
|
|
@@ -88438,7 +88440,7 @@ function copyCommand(platform2, from, to, restore) {
|
|
|
88438
88440
|
}
|
|
88439
88441
|
async function setUpClone(deps, dir, setupCmd, timeoutMs, cache, platform2 = process.platform) {
|
|
88440
88442
|
if (!setupCmd) return { code: 0, output: "", cached: false };
|
|
88441
|
-
const
|
|
88443
|
+
const key2 = cache && cache.paths.every(safeCachePath) ? setupCacheKey(
|
|
88442
88444
|
// What is kept is part of the key: other paths, another entry.
|
|
88443
88445
|
`${setupCmd}\0${cache.paths.join(",")}`,
|
|
88444
88446
|
cache.keyFiles.filter(safeCachePath).map((path2) => ({
|
|
@@ -88446,7 +88448,7 @@ async function setUpClone(deps, dir, setupCmd, timeoutMs, cache, platform2 = pro
|
|
|
88446
88448
|
content: deps.readFile((0, import_node_path14.join)(dir, path2))
|
|
88447
88449
|
}))
|
|
88448
88450
|
) : null;
|
|
88449
|
-
const kept =
|
|
88451
|
+
const kept = key2 && cache ? (0, import_node_path14.join)(cache.dir, key2) : null;
|
|
88450
88452
|
const q = shellPath;
|
|
88451
88453
|
const run3 = (command2) => deps.shell(command2, dir, {}, timeoutMs);
|
|
88452
88454
|
if (kept && cache) {
|
|
@@ -88565,9 +88567,9 @@ function stackFramesOf(output) {
|
|
|
88565
88567
|
const path2 = m[1].replace(/^\.\//, "");
|
|
88566
88568
|
const n = Number(m[2]);
|
|
88567
88569
|
if (!n || path2.split("/").includes("..") || !isAppFile(path2)) continue;
|
|
88568
|
-
const
|
|
88569
|
-
if (seen.has(
|
|
88570
|
-
seen.add(
|
|
88570
|
+
const key2 = `${path2}:${n}`;
|
|
88571
|
+
if (seen.has(key2)) continue;
|
|
88572
|
+
seen.add(key2);
|
|
88571
88573
|
out.push({ path: path2, line: n });
|
|
88572
88574
|
if (out.length >= MAX_FRAMES) return out;
|
|
88573
88575
|
}
|
|
@@ -88797,8 +88799,8 @@ function errorLineOf(output) {
|
|
|
88797
88799
|
for (const line of output.split("\n")) {
|
|
88798
88800
|
const m = /\b\w*(?:Error|Exception)\b:?\s*(.+)$/.exec(line) ?? /\b(expected .+)$/i.exec(line);
|
|
88799
88801
|
if (!m) continue;
|
|
88800
|
-
const
|
|
88801
|
-
if (
|
|
88802
|
+
const key2 = norm(m[1]).slice(0, 120);
|
|
88803
|
+
if (key2.length >= 12) return key2;
|
|
88802
88804
|
}
|
|
88803
88805
|
return null;
|
|
88804
88806
|
}
|
|
@@ -88854,6 +88856,248 @@ var init_replay_spec = __esm({
|
|
|
88854
88856
|
}
|
|
88855
88857
|
});
|
|
88856
88858
|
|
|
88859
|
+
// src/commands/replay-judge.ts
|
|
88860
|
+
function fitPrompt(render, changeChars, itemsChars, maxBytes = MAX_PROMPT_BYTES) {
|
|
88861
|
+
const FLOOR = 4e3;
|
|
88862
|
+
let change = changeChars;
|
|
88863
|
+
let items = itemsChars;
|
|
88864
|
+
let prompt2 = render(change, items);
|
|
88865
|
+
while (Buffer.byteLength(prompt2, "utf8") > maxBytes) {
|
|
88866
|
+
if (items > FLOOR) items = Math.max(FLOOR, Math.floor(items * 0.8));
|
|
88867
|
+
else if (change > FLOOR) change = Math.max(FLOOR, Math.floor(change * 0.8));
|
|
88868
|
+
else break;
|
|
88869
|
+
prompt2 = render(change, items);
|
|
88870
|
+
}
|
|
88871
|
+
return prompt2;
|
|
88872
|
+
}
|
|
88873
|
+
function renderTemplate(template, vars) {
|
|
88874
|
+
return template.replace(
|
|
88875
|
+
/\{\{(\w+)\}\}/g,
|
|
88876
|
+
(all, key2) => key2 in vars ? vars[key2] : all
|
|
88877
|
+
);
|
|
88878
|
+
}
|
|
88879
|
+
function judgeChange(diff) {
|
|
88880
|
+
return clip(diff, MAX_CHANGE_CHARS);
|
|
88881
|
+
}
|
|
88882
|
+
function baselineText(baseline) {
|
|
88883
|
+
if (baseline === null || baseline === void 0)
|
|
88884
|
+
return "(not run alongside this one: judge from the material and the change alone)";
|
|
88885
|
+
return baseline || "(it changed nothing)";
|
|
88886
|
+
}
|
|
88887
|
+
function parseJudgement(text, returnedIds) {
|
|
88888
|
+
const match = /\{[\s\S]*\}/.exec(text);
|
|
88889
|
+
if (!match) return null;
|
|
88890
|
+
let v;
|
|
88891
|
+
try {
|
|
88892
|
+
v = JSON.parse(match[0]);
|
|
88893
|
+
} catch {
|
|
88894
|
+
return null;
|
|
88895
|
+
}
|
|
88896
|
+
if (!VERDICTS.includes(v.verdict)) return null;
|
|
88897
|
+
const items = Array.isArray(v.used_items) ? new Set(
|
|
88898
|
+
v.used_items.filter(
|
|
88899
|
+
(id) => typeof id === "string" && returnedIds.has(id)
|
|
88900
|
+
)
|
|
88901
|
+
) : /* @__PURE__ */ new Set();
|
|
88902
|
+
const reason = typeof v.reason === "string" && v.reason.trim() ? v.reason.trim().slice(0, MAX_REASON) : null;
|
|
88903
|
+
return {
|
|
88904
|
+
used: v.verdict,
|
|
88905
|
+
reason,
|
|
88906
|
+
usedItems: items.size,
|
|
88907
|
+
usedIds: [...items].sort()
|
|
88908
|
+
};
|
|
88909
|
+
}
|
|
88910
|
+
async function judgeUse(deps, input) {
|
|
88911
|
+
const returnedIds = new Set(input.calls.flatMap((c) => c.returnedIds));
|
|
88912
|
+
if (input.calls.length === 0)
|
|
88913
|
+
return {
|
|
88914
|
+
used: "not_used",
|
|
88915
|
+
reason: "The agent did not call Haansi.",
|
|
88916
|
+
usedItems: 0,
|
|
88917
|
+
usedIds: [],
|
|
88918
|
+
judgeTag: null
|
|
88919
|
+
};
|
|
88920
|
+
if (returnedIds.size === 0)
|
|
88921
|
+
return {
|
|
88922
|
+
used: "not_used",
|
|
88923
|
+
reason: "Haansi returned nothing.",
|
|
88924
|
+
usedItems: 0,
|
|
88925
|
+
usedIds: [],
|
|
88926
|
+
judgeTag: null
|
|
88927
|
+
};
|
|
88928
|
+
if (!input.prompt)
|
|
88929
|
+
return {
|
|
88930
|
+
used: null,
|
|
88931
|
+
reason: null,
|
|
88932
|
+
usedItems: null,
|
|
88933
|
+
usedIds: null,
|
|
88934
|
+
judgeTag: null
|
|
88935
|
+
};
|
|
88936
|
+
const tag = input.prompt.edited ? `${input.prompt.tag}+edited` : input.prompt.tag;
|
|
88937
|
+
const dir = (0, import_node_path15.join)(deps.workDir(), `${input.taskId}-judge`);
|
|
88938
|
+
const verdictFile = (0, import_node_path15.join)(dir, "verdict.json");
|
|
88939
|
+
const promptFile = (0, import_node_path15.join)(dir, "prompt.md");
|
|
88940
|
+
const configFile = (0, import_node_path15.join)(dir, "mcp.json");
|
|
88941
|
+
const returned = input.calls.map((c) => c.returnedText ?? "").filter(Boolean).join("\n\n");
|
|
88942
|
+
const prompt2 = fitPrompt(
|
|
88943
|
+
(changeChars, returnedChars) => [
|
|
88944
|
+
input.prompt.system,
|
|
88945
|
+
"",
|
|
88946
|
+
renderTemplate(input.prompt.user, {
|
|
88947
|
+
task: input.card,
|
|
88948
|
+
returned: clip(returned || "(only ids came back)", returnedChars),
|
|
88949
|
+
change: clip(input.change || "(no change)", changeChars),
|
|
88950
|
+
// Shares the change's budget: they are read side by side.
|
|
88951
|
+
baseline: clip(baselineText(input.baseline), changeChars),
|
|
88952
|
+
verdict_file: verdictFile
|
|
88953
|
+
})
|
|
88954
|
+
].join("\n"),
|
|
88955
|
+
MAX_CHANGE_CHARS,
|
|
88956
|
+
MAX_RETURNED_CHARS
|
|
88957
|
+
);
|
|
88958
|
+
try {
|
|
88959
|
+
deps.writeFile(promptFile, prompt2);
|
|
88960
|
+
deps.writeFile(configFile, JSON.stringify({ mcpServers: {} }));
|
|
88961
|
+
const ran = await deps.shell(
|
|
88962
|
+
input.agentCmd,
|
|
88963
|
+
dir,
|
|
88964
|
+
{
|
|
88965
|
+
HAANSI_REPLAY_PROMPT: prompt2,
|
|
88966
|
+
HAANSI_REPLAY_PROMPT_FILE: promptFile,
|
|
88967
|
+
HAANSI_REPLAY_MCP_CONFIG: configFile,
|
|
88968
|
+
HAANSI_REPLAY_VERDICT_FILE: verdictFile
|
|
88969
|
+
},
|
|
88970
|
+
input.timeoutMs
|
|
88971
|
+
);
|
|
88972
|
+
const judged = parseJudgement(deps.readFile(verdictFile) ?? "", returnedIds) ?? parseJudgement(ran.output, returnedIds);
|
|
88973
|
+
if (!judged) {
|
|
88974
|
+
deps.log(`\u2026 ${input.label} [haansi]: the judge gave no verdict`);
|
|
88975
|
+
return {
|
|
88976
|
+
used: null,
|
|
88977
|
+
reason: null,
|
|
88978
|
+
usedItems: null,
|
|
88979
|
+
usedIds: null,
|
|
88980
|
+
judgeTag: tag
|
|
88981
|
+
};
|
|
88982
|
+
}
|
|
88983
|
+
return { ...judged, judgeTag: tag };
|
|
88984
|
+
} finally {
|
|
88985
|
+
deps.removeDir(dir);
|
|
88986
|
+
}
|
|
88987
|
+
}
|
|
88988
|
+
var import_node_path15, MAX_CHANGE_CHARS, MAX_RETURNED_CHARS, MAX_PROMPT_BYTES, MAX_REASON, VERDICTS, clip;
|
|
88989
|
+
var init_replay_judge = __esm({
|
|
88990
|
+
"src/commands/replay-judge.ts"() {
|
|
88991
|
+
"use strict";
|
|
88992
|
+
import_node_path15 = require("node:path");
|
|
88993
|
+
init_replay_diff();
|
|
88994
|
+
MAX_CHANGE_CHARS = 6e4;
|
|
88995
|
+
MAX_RETURNED_CHARS = 6e4;
|
|
88996
|
+
MAX_PROMPT_BYTES = 12e4;
|
|
88997
|
+
MAX_REASON = 300;
|
|
88998
|
+
VERDICTS = ["used", "partly", "not_used"];
|
|
88999
|
+
clip = (text, max2) => text.length > max2 ? `${text.slice(0, max2)}
|
|
89000
|
+
\u2026 (trimmed)` : text;
|
|
89001
|
+
}
|
|
89002
|
+
});
|
|
89003
|
+
|
|
89004
|
+
// src/commands/replay-select.ts
|
|
89005
|
+
function answerOf(text) {
|
|
89006
|
+
const match = /\{[\s\S]*\}/.exec(text);
|
|
89007
|
+
if (!match) return null;
|
|
89008
|
+
try {
|
|
89009
|
+
const v = JSON.parse(match[0]);
|
|
89010
|
+
if (!Array.isArray(v.tests) && typeof v.result === "string")
|
|
89011
|
+
return answerOf(v.result);
|
|
89012
|
+
return v;
|
|
89013
|
+
} catch {
|
|
89014
|
+
return null;
|
|
89015
|
+
}
|
|
89016
|
+
}
|
|
89017
|
+
function parseSelection(text, candidates) {
|
|
89018
|
+
const v = answerOf(text);
|
|
89019
|
+
if (!v || !Array.isArray(v.tests)) return null;
|
|
89020
|
+
const picked = new Set(
|
|
89021
|
+
v.tests.filter((t) => typeof t === "string").map(key)
|
|
89022
|
+
);
|
|
89023
|
+
const out = candidates.map((c) => c.name).filter((name) => picked.has(key(name))).slice(0, MAX_SELECTED_TESTS);
|
|
89024
|
+
return out.length ? out : null;
|
|
89025
|
+
}
|
|
89026
|
+
function candidatesText(candidates) {
|
|
89027
|
+
return candidates.map((c) => `- ${c.name}${c.isNew ? " (new)" : ""}`).join("\n");
|
|
89028
|
+
}
|
|
89029
|
+
async function selectExpectedTests(deps, input) {
|
|
89030
|
+
const offered = input.candidates.map((c) => c.name);
|
|
89031
|
+
if (offered.length === 0) return { tests: [], picked: false };
|
|
89032
|
+
const all = offered.length <= MAX_EXPECTED_TESTS ? offered : [];
|
|
89033
|
+
if (!input.prompt || !input.agentCmd) return { tests: all, picked: false };
|
|
89034
|
+
const dir = (0, import_node_path16.join)(
|
|
89035
|
+
deps.workDir(),
|
|
89036
|
+
`${input.taskId.replace(/[^a-zA-Z0-9-]/g, "")}-select`
|
|
89037
|
+
);
|
|
89038
|
+
const verdictFile = (0, import_node_path16.join)(dir, "verdict.json");
|
|
89039
|
+
const promptFile = (0, import_node_path16.join)(dir, "prompt.md");
|
|
89040
|
+
const configFile = (0, import_node_path16.join)(dir, "mcp.json");
|
|
89041
|
+
const render = (changeChars, testsChars) => [
|
|
89042
|
+
input.prompt.system,
|
|
89043
|
+
"",
|
|
89044
|
+
renderTemplate(input.prompt.user, {
|
|
89045
|
+
task: input.card,
|
|
89046
|
+
change: clip2(input.change || "(no code files)", changeChars),
|
|
89047
|
+
tests: clip2(candidatesText(input.candidates), testsChars),
|
|
89048
|
+
verdict_file: verdictFile
|
|
89049
|
+
})
|
|
89050
|
+
].join("\n");
|
|
89051
|
+
const prompt2 = fitPrompt(render, MAX_CHANGE_CHARS2, MAX_TESTS_CHARS);
|
|
89052
|
+
try {
|
|
89053
|
+
deps.writeFile(promptFile, prompt2);
|
|
89054
|
+
deps.writeFile(configFile, JSON.stringify({ mcpServers: {} }));
|
|
89055
|
+
const ran = await deps.shell(
|
|
89056
|
+
input.agentCmd,
|
|
89057
|
+
dir,
|
|
89058
|
+
{
|
|
89059
|
+
HAANSI_REPLAY_PROMPT: prompt2,
|
|
89060
|
+
HAANSI_REPLAY_PROMPT_FILE: promptFile,
|
|
89061
|
+
HAANSI_REPLAY_MCP_CONFIG: configFile,
|
|
89062
|
+
HAANSI_REPLAY_VERDICT_FILE: verdictFile
|
|
89063
|
+
},
|
|
89064
|
+
input.timeoutMs
|
|
89065
|
+
);
|
|
89066
|
+
const tests = parseSelection(deps.readFile(verdictFile) ?? "", input.candidates) ?? parseSelection(ran.output, input.candidates);
|
|
89067
|
+
if (!tests) {
|
|
89068
|
+
const said2 = ran.output.replace(/\s+/g, " ").trim().slice(0, 200);
|
|
89069
|
+
deps.log(
|
|
89070
|
+
`\u2026 ${input.label}: the test selection's agent exited ${ran.code}, ${deps.readFile(verdictFile) === null ? "wrote no answer file" : "wrote an answer file Haansi could not read"}; its output begins: ${said2 || "(none)"}`
|
|
89071
|
+
);
|
|
89072
|
+
deps.log(
|
|
89073
|
+
all.length ? `\u2026 ${input.label}: the test selection gave no answer: graded on all ${all.length} candidate test(s)` : `\u2026 ${input.label}: the test selection gave no answer: graded on its whole test files (${offered.length} candidates, over ${MAX_EXPECTED_TESTS})`
|
|
89074
|
+
);
|
|
89075
|
+
return { tests: all, picked: false };
|
|
89076
|
+
}
|
|
89077
|
+
deps.log(
|
|
89078
|
+
`\u2026 ${input.label}: graded on ${tests.length} of ${offered.length} candidate test(s), picked for the change`
|
|
89079
|
+
);
|
|
89080
|
+
return { tests, picked: true };
|
|
89081
|
+
} finally {
|
|
89082
|
+
deps.removeDir(dir);
|
|
89083
|
+
}
|
|
89084
|
+
}
|
|
89085
|
+
var import_node_path16, MAX_SELECTED_TESTS, MAX_EXPECTED_TESTS, key, MAX_TESTS_CHARS, MAX_CHANGE_CHARS2, clip2;
|
|
89086
|
+
var init_replay_select = __esm({
|
|
89087
|
+
"src/commands/replay-select.ts"() {
|
|
89088
|
+
"use strict";
|
|
89089
|
+
import_node_path16 = require("node:path");
|
|
89090
|
+
init_replay_judge();
|
|
89091
|
+
MAX_SELECTED_TESTS = 60;
|
|
89092
|
+
MAX_EXPECTED_TESTS = 200;
|
|
89093
|
+
key = (name) => name.replace(/\s+\(new\)\s*$/i, "").replace(/^[-*]\s+/, "").replace(/\s+/g, " ").trim();
|
|
89094
|
+
MAX_TESTS_CHARS = 6e4;
|
|
89095
|
+
MAX_CHANGE_CHARS2 = 2e4;
|
|
89096
|
+
clip2 = (text, max2) => text.length > max2 ? `${text.slice(0, max2)}
|
|
89097
|
+
\u2026 (trimmed)` : text;
|
|
89098
|
+
}
|
|
89099
|
+
});
|
|
89100
|
+
|
|
88857
89101
|
// src/commands/replay-ci-token.ts
|
|
88858
89102
|
var replay_ci_token_exports = {};
|
|
88859
89103
|
__export(replay_ci_token_exports, {
|
|
@@ -88968,7 +89212,8 @@ async function expectedTestsFor(deps, task, pick2) {
|
|
|
88968
89212
|
const change = stat.code === 0 ? stat.output.trim().split("\n").map((l) => l.split(" ")).filter((c) => c.length >= 3).map(
|
|
88969
89213
|
([a, r, path2]) => a === "-" ? `- ${path2} (binary)` : `- ${path2} (+${a} \u2212${r})`
|
|
88970
89214
|
).join("\n") : codeFiles.map((f) => `- ${f}`).join("\n");
|
|
88971
|
-
|
|
89215
|
+
const tests = pick2 ? await pick2(task, candidates, change) : candidates.map((c) => c.name);
|
|
89216
|
+
return tests.length <= MAX_EXPECTED_TESTS ? tests : [];
|
|
88972
89217
|
}
|
|
88973
89218
|
function parseCalibrateArgs(argv) {
|
|
88974
89219
|
const scale = newScaleArgs((0, import_node_os10.homedir)());
|
|
@@ -89113,7 +89358,7 @@ async function calibrateTask(deps, options, commands, task) {
|
|
|
89113
89358
|
if (grade === null) throw new Error(`${label}: ${CHECK_COMMANDS_SKIP}`);
|
|
89114
89359
|
const sides = isFeatureDelivery(task) ? ["target"] : ["base", "target"];
|
|
89115
89360
|
for (const side of sides) {
|
|
89116
|
-
const dir = (0,
|
|
89361
|
+
const dir = (0, import_node_path17.join)(
|
|
89117
89362
|
deps.workDir(),
|
|
89118
89363
|
`${task.taskId.replace(/[^a-zA-Z0-9-]/g, "")}-${side}`
|
|
89119
89364
|
);
|
|
@@ -89156,15 +89401,15 @@ async function calibrateTask(deps, options, commands, task) {
|
|
|
89156
89401
|
if (side === "base" && testNamesOf(task).length === 0) {
|
|
89157
89402
|
for (const f of task.testFiles) {
|
|
89158
89403
|
const content = await deps.showFile(task.targetSha, f);
|
|
89159
|
-
if (content === null) deps.removeFile((0,
|
|
89160
|
-
else deps.writeFile((0,
|
|
89404
|
+
if (content === null) deps.removeFile((0, import_node_path17.join)(dir, f));
|
|
89405
|
+
else deps.writeFile((0, import_node_path17.join)(dir, f), content);
|
|
89161
89406
|
}
|
|
89162
89407
|
}
|
|
89163
89408
|
if (side === "target" && testNamesOf(task).length > 0) {
|
|
89164
89409
|
for (const f of task.testFiles) {
|
|
89165
89410
|
const content = await deps.showFile(task.baseSha, f);
|
|
89166
|
-
if (content === null) deps.removeFile((0,
|
|
89167
|
-
else deps.writeFile((0,
|
|
89411
|
+
if (content === null) deps.removeFile((0, import_node_path17.join)(dir, f));
|
|
89412
|
+
else deps.writeFile((0, import_node_path17.join)(dir, f), content);
|
|
89168
89413
|
}
|
|
89169
89414
|
}
|
|
89170
89415
|
for (let i = 0; i < options.runs; i++) {
|
|
@@ -89355,10 +89600,16 @@ async function runCalibration(options, deps, preloaded) {
|
|
|
89355
89600
|
});
|
|
89356
89601
|
if (options.dryRun || calibrations.length === 0)
|
|
89357
89602
|
return { calibrations, reused, skipped, recorded: null, states, reasons };
|
|
89358
|
-
for (
|
|
89359
|
-
|
|
89360
|
-
|
|
89361
|
-
|
|
89603
|
+
for (const c of unsent) {
|
|
89604
|
+
try {
|
|
89605
|
+
const out = await send([c]);
|
|
89606
|
+
recorded += out.recorded;
|
|
89607
|
+
noteRefused(out.refused.length);
|
|
89608
|
+
} catch (err2) {
|
|
89609
|
+
deps.log(
|
|
89610
|
+
`Haansi did not record the calibration of ${c.taskId}: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
89611
|
+
);
|
|
89612
|
+
}
|
|
89362
89613
|
}
|
|
89363
89614
|
return { calibrations, reused, skipped, recorded, states, reasons };
|
|
89364
89615
|
}
|
|
@@ -89391,7 +89642,7 @@ async function calibrate(argv) {
|
|
|
89391
89642
|
process.exitCode = 1;
|
|
89392
89643
|
return;
|
|
89393
89644
|
}
|
|
89394
|
-
const work = (0, import_node_fs13.mkdtempSync)((0,
|
|
89645
|
+
const work = (0, import_node_fs13.mkdtempSync)((0, import_node_path17.join)((0, import_node_os10.tmpdir)(), "haansi-calibrate-"));
|
|
89395
89646
|
let stop = null;
|
|
89396
89647
|
try {
|
|
89397
89648
|
const contained = await withContainer(
|
|
@@ -89443,7 +89694,7 @@ function cliVersion() {
|
|
|
89443
89694
|
return null;
|
|
89444
89695
|
}
|
|
89445
89696
|
}
|
|
89446
|
-
var import_node_crypto5, import_node_fs13, import_node_os10,
|
|
89697
|
+
var import_node_crypto5, import_node_fs13, import_node_os10, import_node_path17, CHECK_COMMANDS_SKIP, RUNTIMES, FAILURE_LINES, STATE, CALIBRATION_VERSION, isFeatureDelivery, USAGE;
|
|
89447
89698
|
var init_replay_calibrate = __esm({
|
|
89448
89699
|
"src/commands/replay-calibrate.ts"() {
|
|
89449
89700
|
"use strict";
|
|
@@ -89451,7 +89702,7 @@ var init_replay_calibrate = __esm({
|
|
|
89451
89702
|
import_node_crypto5 = require("node:crypto");
|
|
89452
89703
|
import_node_fs13 = require("node:fs");
|
|
89453
89704
|
import_node_os10 = require("node:os");
|
|
89454
|
-
|
|
89705
|
+
import_node_path17 = require("node:path");
|
|
89455
89706
|
init_paths();
|
|
89456
89707
|
init_api2();
|
|
89457
89708
|
init_replay_errors();
|
|
@@ -89461,10 +89712,10 @@ var init_replay_calibrate = __esm({
|
|
|
89461
89712
|
init_replay_guard();
|
|
89462
89713
|
init_replay_diff();
|
|
89463
89714
|
init_replay_spec();
|
|
89715
|
+
init_replay_select();
|
|
89464
89716
|
init_replay_scale();
|
|
89465
89717
|
CHECK_COMMANDS_SKIP = "graded by the commands its CI job ran; pass --check-commands to run them";
|
|
89466
89718
|
RUNTIMES = ["node", "python3", "go", "java", "ruby", "rustc"];
|
|
89467
|
-
REPORT_CHUNK = 100;
|
|
89468
89719
|
FAILURE_LINES = 5;
|
|
89469
89720
|
STATE = {
|
|
89470
89721
|
fails_at_base_passes_at_target: "valid",
|
|
@@ -89497,151 +89748,6 @@ haansi replay run); required in a job with "permissions: id-token: write".`;
|
|
|
89497
89748
|
}
|
|
89498
89749
|
});
|
|
89499
89750
|
|
|
89500
|
-
// src/commands/replay-judge.ts
|
|
89501
|
-
function fitPrompt(render, changeChars, itemsChars, maxBytes = MAX_PROMPT_BYTES) {
|
|
89502
|
-
const FLOOR = 4e3;
|
|
89503
|
-
let change = changeChars;
|
|
89504
|
-
let items = itemsChars;
|
|
89505
|
-
let prompt2 = render(change, items);
|
|
89506
|
-
while (Buffer.byteLength(prompt2, "utf8") > maxBytes) {
|
|
89507
|
-
if (items > FLOOR) items = Math.max(FLOOR, Math.floor(items * 0.8));
|
|
89508
|
-
else if (change > FLOOR) change = Math.max(FLOOR, Math.floor(change * 0.8));
|
|
89509
|
-
else break;
|
|
89510
|
-
prompt2 = render(change, items);
|
|
89511
|
-
}
|
|
89512
|
-
return prompt2;
|
|
89513
|
-
}
|
|
89514
|
-
function renderTemplate(template, vars) {
|
|
89515
|
-
return template.replace(
|
|
89516
|
-
/\{\{(\w+)\}\}/g,
|
|
89517
|
-
(all, key) => key in vars ? vars[key] : all
|
|
89518
|
-
);
|
|
89519
|
-
}
|
|
89520
|
-
function judgeChange(diff) {
|
|
89521
|
-
return clip(diff, MAX_CHANGE_CHARS);
|
|
89522
|
-
}
|
|
89523
|
-
function baselineText(baseline) {
|
|
89524
|
-
if (baseline === null || baseline === void 0)
|
|
89525
|
-
return "(not run alongside this one: judge from the material and the change alone)";
|
|
89526
|
-
return baseline || "(it changed nothing)";
|
|
89527
|
-
}
|
|
89528
|
-
function parseJudgement(text, returnedIds) {
|
|
89529
|
-
const match = /\{[\s\S]*\}/.exec(text);
|
|
89530
|
-
if (!match) return null;
|
|
89531
|
-
let v;
|
|
89532
|
-
try {
|
|
89533
|
-
v = JSON.parse(match[0]);
|
|
89534
|
-
} catch {
|
|
89535
|
-
return null;
|
|
89536
|
-
}
|
|
89537
|
-
if (!VERDICTS.includes(v.verdict)) return null;
|
|
89538
|
-
const items = Array.isArray(v.used_items) ? new Set(
|
|
89539
|
-
v.used_items.filter(
|
|
89540
|
-
(id) => typeof id === "string" && returnedIds.has(id)
|
|
89541
|
-
)
|
|
89542
|
-
) : /* @__PURE__ */ new Set();
|
|
89543
|
-
const reason = typeof v.reason === "string" && v.reason.trim() ? v.reason.trim().slice(0, MAX_REASON) : null;
|
|
89544
|
-
return {
|
|
89545
|
-
used: v.verdict,
|
|
89546
|
-
reason,
|
|
89547
|
-
usedItems: items.size,
|
|
89548
|
-
usedIds: [...items].sort()
|
|
89549
|
-
};
|
|
89550
|
-
}
|
|
89551
|
-
async function judgeUse(deps, input) {
|
|
89552
|
-
const returnedIds = new Set(input.calls.flatMap((c) => c.returnedIds));
|
|
89553
|
-
if (input.calls.length === 0)
|
|
89554
|
-
return {
|
|
89555
|
-
used: "not_used",
|
|
89556
|
-
reason: "The agent did not call Haansi.",
|
|
89557
|
-
usedItems: 0,
|
|
89558
|
-
usedIds: [],
|
|
89559
|
-
judgeTag: null
|
|
89560
|
-
};
|
|
89561
|
-
if (returnedIds.size === 0)
|
|
89562
|
-
return {
|
|
89563
|
-
used: "not_used",
|
|
89564
|
-
reason: "Haansi returned nothing.",
|
|
89565
|
-
usedItems: 0,
|
|
89566
|
-
usedIds: [],
|
|
89567
|
-
judgeTag: null
|
|
89568
|
-
};
|
|
89569
|
-
if (!input.prompt)
|
|
89570
|
-
return {
|
|
89571
|
-
used: null,
|
|
89572
|
-
reason: null,
|
|
89573
|
-
usedItems: null,
|
|
89574
|
-
usedIds: null,
|
|
89575
|
-
judgeTag: null
|
|
89576
|
-
};
|
|
89577
|
-
const tag = input.prompt.edited ? `${input.prompt.tag}+edited` : input.prompt.tag;
|
|
89578
|
-
const dir = (0, import_node_path16.join)(deps.workDir(), `${input.taskId}-judge`);
|
|
89579
|
-
const verdictFile = (0, import_node_path16.join)(dir, "verdict.json");
|
|
89580
|
-
const promptFile = (0, import_node_path16.join)(dir, "prompt.md");
|
|
89581
|
-
const configFile = (0, import_node_path16.join)(dir, "mcp.json");
|
|
89582
|
-
const returned = input.calls.map((c) => c.returnedText ?? "").filter(Boolean).join("\n\n");
|
|
89583
|
-
const prompt2 = fitPrompt(
|
|
89584
|
-
(changeChars, returnedChars) => [
|
|
89585
|
-
input.prompt.system,
|
|
89586
|
-
"",
|
|
89587
|
-
renderTemplate(input.prompt.user, {
|
|
89588
|
-
task: input.card,
|
|
89589
|
-
returned: clip(returned || "(only ids came back)", returnedChars),
|
|
89590
|
-
change: clip(input.change || "(no change)", changeChars),
|
|
89591
|
-
// Shares the change's budget: they are read side by side.
|
|
89592
|
-
baseline: clip(baselineText(input.baseline), changeChars),
|
|
89593
|
-
verdict_file: verdictFile
|
|
89594
|
-
})
|
|
89595
|
-
].join("\n"),
|
|
89596
|
-
MAX_CHANGE_CHARS,
|
|
89597
|
-
MAX_RETURNED_CHARS
|
|
89598
|
-
);
|
|
89599
|
-
try {
|
|
89600
|
-
deps.writeFile(promptFile, prompt2);
|
|
89601
|
-
deps.writeFile(configFile, JSON.stringify({ mcpServers: {} }));
|
|
89602
|
-
const ran = await deps.shell(
|
|
89603
|
-
input.agentCmd,
|
|
89604
|
-
dir,
|
|
89605
|
-
{
|
|
89606
|
-
HAANSI_REPLAY_PROMPT: prompt2,
|
|
89607
|
-
HAANSI_REPLAY_PROMPT_FILE: promptFile,
|
|
89608
|
-
HAANSI_REPLAY_MCP_CONFIG: configFile,
|
|
89609
|
-
HAANSI_REPLAY_VERDICT_FILE: verdictFile
|
|
89610
|
-
},
|
|
89611
|
-
input.timeoutMs
|
|
89612
|
-
);
|
|
89613
|
-
const judged = parseJudgement(deps.readFile(verdictFile) ?? "", returnedIds) ?? parseJudgement(ran.output, returnedIds);
|
|
89614
|
-
if (!judged) {
|
|
89615
|
-
deps.log(`\u2026 ${input.label} [haansi]: the judge gave no verdict`);
|
|
89616
|
-
return {
|
|
89617
|
-
used: null,
|
|
89618
|
-
reason: null,
|
|
89619
|
-
usedItems: null,
|
|
89620
|
-
usedIds: null,
|
|
89621
|
-
judgeTag: tag
|
|
89622
|
-
};
|
|
89623
|
-
}
|
|
89624
|
-
return { ...judged, judgeTag: tag };
|
|
89625
|
-
} finally {
|
|
89626
|
-
deps.removeDir(dir);
|
|
89627
|
-
}
|
|
89628
|
-
}
|
|
89629
|
-
var import_node_path16, MAX_CHANGE_CHARS, MAX_RETURNED_CHARS, MAX_PROMPT_BYTES, MAX_REASON, VERDICTS, clip;
|
|
89630
|
-
var init_replay_judge = __esm({
|
|
89631
|
-
"src/commands/replay-judge.ts"() {
|
|
89632
|
-
"use strict";
|
|
89633
|
-
import_node_path16 = require("node:path");
|
|
89634
|
-
init_replay_diff();
|
|
89635
|
-
MAX_CHANGE_CHARS = 6e4;
|
|
89636
|
-
MAX_RETURNED_CHARS = 6e4;
|
|
89637
|
-
MAX_PROMPT_BYTES = 12e4;
|
|
89638
|
-
MAX_REASON = 300;
|
|
89639
|
-
VERDICTS = ["used", "partly", "not_used"];
|
|
89640
|
-
clip = (text, max2) => text.length > max2 ? `${text.slice(0, max2)}
|
|
89641
|
-
\u2026 (trimmed)` : text;
|
|
89642
|
-
}
|
|
89643
|
-
});
|
|
89644
|
-
|
|
89645
89751
|
// src/commands/replay-relevance.ts
|
|
89646
89752
|
function wordsOf(text) {
|
|
89647
89753
|
return (text.replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase().match(/[a-z][a-z0-9]{3,}/g) ?? []).filter((w) => !COMMON.has(w));
|
|
@@ -89750,21 +89856,21 @@ async function judgeRelevance(deps, input) {
|
|
|
89750
89856
|
judgeTag: null
|
|
89751
89857
|
};
|
|
89752
89858
|
const tag = input.prompt.edited ? `${input.prompt.tag}+edited` : input.prompt.tag;
|
|
89753
|
-
const dir = (0,
|
|
89754
|
-
const verdictFile = (0,
|
|
89755
|
-
const promptFile = (0,
|
|
89756
|
-
const configFile = (0,
|
|
89859
|
+
const dir = (0, import_node_path18.join)(deps.workDir(), `${input.taskId}-relevance`);
|
|
89860
|
+
const verdictFile = (0, import_node_path18.join)(dir, "verdict.json");
|
|
89861
|
+
const promptFile = (0, import_node_path18.join)(dir, "prompt.md");
|
|
89862
|
+
const configFile = (0, import_node_path18.join)(dir, "mcp.json");
|
|
89757
89863
|
const render = (changeChars, itemsChars) => [
|
|
89758
89864
|
input.prompt.system,
|
|
89759
89865
|
"",
|
|
89760
89866
|
renderTemplate(input.prompt.user, {
|
|
89761
89867
|
task: input.card,
|
|
89762
|
-
target_change:
|
|
89763
|
-
items:
|
|
89868
|
+
target_change: clip3(input.targetChange || "(no change)", changeChars),
|
|
89869
|
+
items: clip3(itemsText(all) || "(only ids came back)", itemsChars),
|
|
89764
89870
|
verdict_file: verdictFile
|
|
89765
89871
|
})
|
|
89766
89872
|
].join("\n");
|
|
89767
|
-
const prompt2 = fitPrompt(render,
|
|
89873
|
+
const prompt2 = fitPrompt(render, MAX_CHANGE_CHARS3, MAX_ITEMS_CHARS);
|
|
89768
89874
|
try {
|
|
89769
89875
|
deps.writeFile(promptFile, prompt2);
|
|
89770
89876
|
deps.writeFile(configFile, JSON.stringify({ mcpServers: {} }));
|
|
@@ -89804,18 +89910,18 @@ async function judgeRelevance(deps, input) {
|
|
|
89804
89910
|
deps.removeDir(dir);
|
|
89805
89911
|
}
|
|
89806
89912
|
}
|
|
89807
|
-
var
|
|
89913
|
+
var import_node_path18, MAX_CHANGE_CHARS3, MAX_ITEMS_CHARS, QUERY_CHARS, TERMS, clip3, COMMON, MAX_RECALL_HINTS, MAX_HINT_CHARS, IDENTIFIER, said;
|
|
89808
89914
|
var init_replay_relevance = __esm({
|
|
89809
89915
|
"src/commands/replay-relevance.ts"() {
|
|
89810
89916
|
"use strict";
|
|
89811
|
-
|
|
89917
|
+
import_node_path18 = require("node:path");
|
|
89812
89918
|
init_replay_judge();
|
|
89813
89919
|
init_replay_judge();
|
|
89814
|
-
|
|
89920
|
+
MAX_CHANGE_CHARS3 = 6e4;
|
|
89815
89921
|
MAX_ITEMS_CHARS = 8e4;
|
|
89816
89922
|
QUERY_CHARS = 200;
|
|
89817
89923
|
TERMS = 8;
|
|
89818
|
-
|
|
89924
|
+
clip3 = (text, max2) => text.length > max2 ? `${text.slice(0, max2)}
|
|
89819
89925
|
\u2026 (trimmed)` : text;
|
|
89820
89926
|
COMMON = new Set(
|
|
89821
89927
|
"this that with from have will when then than they them their there what which while where return const function export import class true false null undefined async await string number value values type types test tests expect should data item items list name names error errors".split(" ")
|
|
@@ -90283,8 +90389,8 @@ async function specGapsOf(show, grep, task, prompt2) {
|
|
|
90283
90389
|
for (const file2 of task.testFiles) {
|
|
90284
90390
|
const source = await show(task.targetSha, file2);
|
|
90285
90391
|
if (source === null) continue;
|
|
90286
|
-
for (const
|
|
90287
|
-
if (!shown.has(
|
|
90392
|
+
for (const key2 of testKeysOf(source, file2))
|
|
90393
|
+
if (!shown.has(key2)) candidates.add(key2);
|
|
90288
90394
|
}
|
|
90289
90395
|
const asked = [...candidates].sort().slice(0, MAX_GAP_CANDIDATES);
|
|
90290
90396
|
if (!asked.length) return [];
|
|
@@ -90327,8 +90433,8 @@ function errorKeyOf(output) {
|
|
|
90327
90433
|
for (const line of output.split("\n")) {
|
|
90328
90434
|
const m = /\b\w*(?:Error|Exception)\b:?\s*(.+)$/.exec(line) ?? /\b(expected .+)$/i.exec(line);
|
|
90329
90435
|
if (!m) continue;
|
|
90330
|
-
const
|
|
90331
|
-
if (
|
|
90436
|
+
const key2 = m[1].toLowerCase().replace(/(["'`])(?:(?!\1).)*\1/g, "_").replace(/\d+/g, "#").replace(/\s+/g, " ").trim().slice(0, 80);
|
|
90437
|
+
if (key2.replace(/[_#\s]/g, "").length >= 12) return key2;
|
|
90332
90438
|
}
|
|
90333
90439
|
return null;
|
|
90334
90440
|
}
|
|
@@ -90867,91 +90973,6 @@ var init_replay_inject = __esm({
|
|
|
90867
90973
|
}
|
|
90868
90974
|
});
|
|
90869
90975
|
|
|
90870
|
-
// src/commands/replay-select.ts
|
|
90871
|
-
function parseSelection(text, candidates) {
|
|
90872
|
-
const match = /\{[\s\S]*\}/.exec(text);
|
|
90873
|
-
if (!match) return null;
|
|
90874
|
-
let v;
|
|
90875
|
-
try {
|
|
90876
|
-
v = JSON.parse(match[0]);
|
|
90877
|
-
} catch {
|
|
90878
|
-
return null;
|
|
90879
|
-
}
|
|
90880
|
-
if (!Array.isArray(v.tests)) return null;
|
|
90881
|
-
const picked = new Set(
|
|
90882
|
-
v.tests.filter((t) => typeof t === "string")
|
|
90883
|
-
);
|
|
90884
|
-
const out = candidates.map((c) => c.name).filter((name) => picked.has(name)).slice(0, MAX_SELECTED_TESTS);
|
|
90885
|
-
return out.length ? out : null;
|
|
90886
|
-
}
|
|
90887
|
-
function candidatesText(candidates) {
|
|
90888
|
-
return candidates.map((c) => `- ${c.name}${c.isNew ? " (new)" : ""}`).join("\n");
|
|
90889
|
-
}
|
|
90890
|
-
async function selectExpectedTests(deps, input) {
|
|
90891
|
-
const all = input.candidates.map((c) => c.name);
|
|
90892
|
-
if (all.length === 0) return { tests: [], picked: false };
|
|
90893
|
-
if (!input.prompt || !input.agentCmd) return { tests: all, picked: false };
|
|
90894
|
-
const dir = (0, import_node_path18.join)(
|
|
90895
|
-
deps.workDir(),
|
|
90896
|
-
`${input.taskId.replace(/[^a-zA-Z0-9-]/g, "")}-select`
|
|
90897
|
-
);
|
|
90898
|
-
const verdictFile = (0, import_node_path18.join)(dir, "verdict.json");
|
|
90899
|
-
const promptFile = (0, import_node_path18.join)(dir, "prompt.md");
|
|
90900
|
-
const configFile = (0, import_node_path18.join)(dir, "mcp.json");
|
|
90901
|
-
const render = (changeChars, testsChars) => [
|
|
90902
|
-
input.prompt.system,
|
|
90903
|
-
"",
|
|
90904
|
-
renderTemplate(input.prompt.user, {
|
|
90905
|
-
task: input.card,
|
|
90906
|
-
change: clip3(input.change || "(no code files)", changeChars),
|
|
90907
|
-
tests: clip3(candidatesText(input.candidates), testsChars),
|
|
90908
|
-
verdict_file: verdictFile
|
|
90909
|
-
})
|
|
90910
|
-
].join("\n");
|
|
90911
|
-
const prompt2 = fitPrompt(render, MAX_CHANGE_CHARS3, MAX_TESTS_CHARS);
|
|
90912
|
-
try {
|
|
90913
|
-
deps.writeFile(promptFile, prompt2);
|
|
90914
|
-
deps.writeFile(configFile, JSON.stringify({ mcpServers: {} }));
|
|
90915
|
-
const ran = await deps.shell(
|
|
90916
|
-
input.agentCmd,
|
|
90917
|
-
dir,
|
|
90918
|
-
{
|
|
90919
|
-
HAANSI_REPLAY_PROMPT: prompt2,
|
|
90920
|
-
HAANSI_REPLAY_PROMPT_FILE: promptFile,
|
|
90921
|
-
HAANSI_REPLAY_MCP_CONFIG: configFile,
|
|
90922
|
-
HAANSI_REPLAY_VERDICT_FILE: verdictFile
|
|
90923
|
-
},
|
|
90924
|
-
input.timeoutMs
|
|
90925
|
-
);
|
|
90926
|
-
const tests = parseSelection(deps.readFile(verdictFile) ?? "", input.candidates) ?? parseSelection(ran.output, input.candidates);
|
|
90927
|
-
if (!tests) {
|
|
90928
|
-
deps.log(
|
|
90929
|
-
`\u2026 ${input.label}: the test selection gave no answer: graded on all ${all.length} candidate test(s)`
|
|
90930
|
-
);
|
|
90931
|
-
return { tests: all, picked: false };
|
|
90932
|
-
}
|
|
90933
|
-
deps.log(
|
|
90934
|
-
`\u2026 ${input.label}: graded on ${tests.length} of ${all.length} candidate test(s), picked for the change`
|
|
90935
|
-
);
|
|
90936
|
-
return { tests, picked: true };
|
|
90937
|
-
} finally {
|
|
90938
|
-
deps.removeDir(dir);
|
|
90939
|
-
}
|
|
90940
|
-
}
|
|
90941
|
-
var import_node_path18, MAX_SELECTED_TESTS, MAX_TESTS_CHARS, MAX_CHANGE_CHARS3, clip3;
|
|
90942
|
-
var init_replay_select = __esm({
|
|
90943
|
-
"src/commands/replay-select.ts"() {
|
|
90944
|
-
"use strict";
|
|
90945
|
-
import_node_path18 = require("node:path");
|
|
90946
|
-
init_replay_judge();
|
|
90947
|
-
MAX_SELECTED_TESTS = 60;
|
|
90948
|
-
MAX_TESTS_CHARS = 6e4;
|
|
90949
|
-
MAX_CHANGE_CHARS3 = 2e4;
|
|
90950
|
-
clip3 = (text, max2) => text.length > max2 ? `${text.slice(0, max2)}
|
|
90951
|
-
\u2026 (trimmed)` : text;
|
|
90952
|
-
}
|
|
90953
|
-
});
|
|
90954
|
-
|
|
90955
90976
|
// src/commands/replay-tasks.ts
|
|
90956
90977
|
var replay_tasks_exports = {};
|
|
90957
90978
|
__export(replay_tasks_exports, {
|
|
@@ -90984,7 +91005,7 @@ function reportBatches(results, size = (r) => JSON.stringify(r).length) {
|
|
|
90984
91005
|
let chars = 0;
|
|
90985
91006
|
for (const r of results) {
|
|
90986
91007
|
const n = size(r);
|
|
90987
|
-
if (batch.length && (batch.length >=
|
|
91008
|
+
if (batch.length && (batch.length >= REPORT_CHUNK || chars + n > REPORT_CHARS)) {
|
|
90988
91009
|
batches.push(batch);
|
|
90989
91010
|
batch = [];
|
|
90990
91011
|
chars = 0;
|
|
@@ -91767,7 +91788,7 @@ function haansiText(use) {
|
|
|
91767
91788
|
if (!use.used || use.calls === 0 && !handed) return base;
|
|
91768
91789
|
return use.used === "not_used" ? `${base}, not used` : `${base}, ${use.used === "partly" ? "partly " : ""}used${use.usedItems ? ` (${use.usedItems})` : ""}`;
|
|
91769
91790
|
}
|
|
91770
|
-
var import_node_crypto6, FEEDBACK_HEADER,
|
|
91791
|
+
var import_node_crypto6, FEEDBACK_HEADER, REPORT_CHUNK, REPORT_CHARS, HAANSI_LINE, BUG_FIX_DONE, CHECK_FIX_DONE, CODE_ONLY_LINE, toolLine, HAANSI_HINTS, WORK_LINE, FEATURE_MIN_FILE_RECALL, share2, pct;
|
|
91771
91792
|
var init_replay_tasks = __esm({
|
|
91772
91793
|
"src/commands/replay-tasks.ts"() {
|
|
91773
91794
|
"use strict";
|
|
@@ -91790,7 +91811,7 @@ var init_replay_tasks = __esm({
|
|
|
91790
91811
|
init_replay_select();
|
|
91791
91812
|
init_replay_context();
|
|
91792
91813
|
FEEDBACK_HEADER = "Your previous attempt did not pass the tests. Their output ends with:";
|
|
91793
|
-
|
|
91814
|
+
REPORT_CHUNK = 200;
|
|
91794
91815
|
REPORT_CHARS = 4e6;
|
|
91795
91816
|
HAANSI_LINE = "Haansi's MCP servers are available to you: they give access to your organization's knowledge (solutions to past problems, team skills, digests, guides and Exchange). Use them if they help.";
|
|
91796
91817
|
BUG_FIX_DONE = "These tests pass, and the tests that pass now still pass.";
|