sequoia-cli 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/sequoia-comments.js +856 -0
- package/dist/index.js +1114 -997
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3673,13 +3673,141 @@ var require_cjs = __commonJS((exports) => {
|
|
|
3673
3673
|
} });
|
|
3674
3674
|
});
|
|
3675
3675
|
|
|
3676
|
+
// ../../node_modules/.bun/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
3677
|
+
var require_picocolors = __commonJS((exports, module) => {
|
|
3678
|
+
var p = process || {};
|
|
3679
|
+
var argv = p.argv || [];
|
|
3680
|
+
var env2 = p.env || {};
|
|
3681
|
+
var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
|
|
3682
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
3683
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
3684
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
3685
|
+
};
|
|
3686
|
+
var replaceClose = (string, close, replace, index) => {
|
|
3687
|
+
let result = "", cursor = 0;
|
|
3688
|
+
do {
|
|
3689
|
+
result += string.substring(cursor, index) + replace;
|
|
3690
|
+
cursor = index + close.length;
|
|
3691
|
+
index = string.indexOf(close, cursor);
|
|
3692
|
+
} while (~index);
|
|
3693
|
+
return result + string.substring(cursor);
|
|
3694
|
+
};
|
|
3695
|
+
var createColors = (enabled = isColorSupported) => {
|
|
3696
|
+
let f = enabled ? formatter : () => String;
|
|
3697
|
+
return {
|
|
3698
|
+
isColorSupported: enabled,
|
|
3699
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
3700
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
3701
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
3702
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
3703
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
3704
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
3705
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
3706
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
3707
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
3708
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
3709
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
3710
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
3711
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
3712
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
3713
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
3714
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
3715
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
3716
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
3717
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
3718
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
3719
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
3720
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
3721
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
3722
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
3723
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
3724
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
3725
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
3726
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
3727
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
3728
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
3729
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
3730
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
3731
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
3732
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
3733
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
3734
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
3735
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
3736
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
3737
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
3738
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
3739
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
3740
|
+
};
|
|
3741
|
+
};
|
|
3742
|
+
module.exports = createColors();
|
|
3743
|
+
module.exports.createColors = createColors;
|
|
3744
|
+
});
|
|
3745
|
+
|
|
3746
|
+
// ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
3747
|
+
var require_src2 = __commonJS((exports, module) => {
|
|
3748
|
+
var ESC = "\x1B";
|
|
3749
|
+
var CSI = `${ESC}[`;
|
|
3750
|
+
var beep = "\x07";
|
|
3751
|
+
var cursor = {
|
|
3752
|
+
to(x, y) {
|
|
3753
|
+
if (!y)
|
|
3754
|
+
return `${CSI}${x + 1}G`;
|
|
3755
|
+
return `${CSI}${y + 1};${x + 1}H`;
|
|
3756
|
+
},
|
|
3757
|
+
move(x, y) {
|
|
3758
|
+
let ret = "";
|
|
3759
|
+
if (x < 0)
|
|
3760
|
+
ret += `${CSI}${-x}D`;
|
|
3761
|
+
else if (x > 0)
|
|
3762
|
+
ret += `${CSI}${x}C`;
|
|
3763
|
+
if (y < 0)
|
|
3764
|
+
ret += `${CSI}${-y}A`;
|
|
3765
|
+
else if (y > 0)
|
|
3766
|
+
ret += `${CSI}${y}B`;
|
|
3767
|
+
return ret;
|
|
3768
|
+
},
|
|
3769
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
3770
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
3771
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
3772
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
3773
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
3774
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
3775
|
+
left: `${CSI}G`,
|
|
3776
|
+
hide: `${CSI}?25l`,
|
|
3777
|
+
show: `${CSI}?25h`,
|
|
3778
|
+
save: `${ESC}7`,
|
|
3779
|
+
restore: `${ESC}8`
|
|
3780
|
+
};
|
|
3781
|
+
var scroll = {
|
|
3782
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
3783
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
3784
|
+
};
|
|
3785
|
+
var erase = {
|
|
3786
|
+
screen: `${CSI}2J`,
|
|
3787
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
3788
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
3789
|
+
line: `${CSI}2K`,
|
|
3790
|
+
lineEnd: `${CSI}K`,
|
|
3791
|
+
lineStart: `${CSI}1K`,
|
|
3792
|
+
lines(count) {
|
|
3793
|
+
let clear = "";
|
|
3794
|
+
for (let i = 0;i < count; i++)
|
|
3795
|
+
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
3796
|
+
if (count)
|
|
3797
|
+
clear += cursor.left;
|
|
3798
|
+
return clear;
|
|
3799
|
+
}
|
|
3800
|
+
};
|
|
3801
|
+
module.exports = { cursor, scroll, erase, beep };
|
|
3802
|
+
});
|
|
3803
|
+
|
|
3676
3804
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.cjs
|
|
3677
3805
|
var require_util = __commonJS((exports) => {
|
|
3678
3806
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3679
3807
|
exports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = undefined;
|
|
3680
3808
|
var util;
|
|
3681
3809
|
(function(util2) {
|
|
3682
|
-
util2.assertEqual = (
|
|
3810
|
+
util2.assertEqual = (_2) => {};
|
|
3683
3811
|
function assertIs(_arg) {}
|
|
3684
3812
|
util2.assertIs = assertIs;
|
|
3685
3813
|
function assertNever(_x) {
|
|
@@ -3694,10 +3822,10 @@ var require_util = __commonJS((exports) => {
|
|
|
3694
3822
|
return obj;
|
|
3695
3823
|
};
|
|
3696
3824
|
util2.getValidEnumValues = (obj) => {
|
|
3697
|
-
const validKeys = util2.objectKeys(obj).filter((
|
|
3825
|
+
const validKeys = util2.objectKeys(obj).filter((k3) => typeof obj[obj[k3]] !== "number");
|
|
3698
3826
|
const filtered = {};
|
|
3699
|
-
for (const
|
|
3700
|
-
filtered[
|
|
3827
|
+
for (const k3 of validKeys) {
|
|
3828
|
+
filtered[k3] = obj[k3];
|
|
3701
3829
|
}
|
|
3702
3830
|
return util2.objectValues(filtered);
|
|
3703
3831
|
};
|
|
@@ -3727,7 +3855,7 @@ var require_util = __commonJS((exports) => {
|
|
|
3727
3855
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
3728
3856
|
}
|
|
3729
3857
|
util2.joinValues = joinValues;
|
|
3730
|
-
util2.jsonStringifyReplacer = (
|
|
3858
|
+
util2.jsonStringifyReplacer = (_2, value) => {
|
|
3731
3859
|
if (typeof value === "bigint") {
|
|
3732
3860
|
return value.toString();
|
|
3733
3861
|
}
|
|
@@ -3766,8 +3894,8 @@ var require_util = __commonJS((exports) => {
|
|
|
3766
3894
|
"set"
|
|
3767
3895
|
]);
|
|
3768
3896
|
var getParsedType = (data) => {
|
|
3769
|
-
const
|
|
3770
|
-
switch (
|
|
3897
|
+
const t2 = typeof data;
|
|
3898
|
+
switch (t2) {
|
|
3771
3899
|
case "undefined":
|
|
3772
3900
|
return exports.ZodParsedType.undefined;
|
|
3773
3901
|
case "string":
|
|
@@ -4074,8 +4202,8 @@ var require_parseUtil = __commonJS((exports) => {
|
|
|
4074
4202
|
var errors_js_1 = require_errors();
|
|
4075
4203
|
var en_js_1 = __importDefault(require_en());
|
|
4076
4204
|
var makeIssue = (params) => {
|
|
4077
|
-
const { data, path, errorMaps, issueData } = params;
|
|
4078
|
-
const fullPath = [...
|
|
4205
|
+
const { data, path: path3, errorMaps, issueData } = params;
|
|
4206
|
+
const fullPath = [...path3, ...issueData.path || []];
|
|
4079
4207
|
const fullIssue = {
|
|
4080
4208
|
...issueData,
|
|
4081
4209
|
path: fullPath
|
|
@@ -4111,7 +4239,7 @@ var require_parseUtil = __commonJS((exports) => {
|
|
|
4111
4239
|
ctx.schemaErrorMap,
|
|
4112
4240
|
overrideMap,
|
|
4113
4241
|
overrideMap === en_js_1.default ? undefined : en_js_1.default
|
|
4114
|
-
].filter((
|
|
4242
|
+
].filter((x3) => !!x3)
|
|
4115
4243
|
});
|
|
4116
4244
|
ctx.common.issues.push(issue);
|
|
4117
4245
|
}
|
|
@@ -4178,13 +4306,13 @@ var require_parseUtil = __commonJS((exports) => {
|
|
|
4178
4306
|
exports.DIRTY = DIRTY;
|
|
4179
4307
|
var OK = (value) => ({ status: "valid", value });
|
|
4180
4308
|
exports.OK = OK;
|
|
4181
|
-
var isAborted = (
|
|
4309
|
+
var isAborted = (x3) => x3.status === "aborted";
|
|
4182
4310
|
exports.isAborted = isAborted;
|
|
4183
|
-
var isDirty = (
|
|
4311
|
+
var isDirty = (x3) => x3.status === "dirty";
|
|
4184
4312
|
exports.isDirty = isDirty;
|
|
4185
|
-
var isValid = (
|
|
4313
|
+
var isValid = (x3) => x3.status === "valid";
|
|
4186
4314
|
exports.isValid = isValid;
|
|
4187
|
-
var isAsync = (
|
|
4315
|
+
var isAsync = (x3) => typeof Promise !== "undefined" && x3 instanceof Promise;
|
|
4188
4316
|
exports.isAsync = isAsync;
|
|
4189
4317
|
});
|
|
4190
4318
|
|
|
@@ -4218,11 +4346,11 @@ var require_types2 = __commonJS((exports) => {
|
|
|
4218
4346
|
var util_js_1 = require_util();
|
|
4219
4347
|
|
|
4220
4348
|
class ParseInputLazyPath {
|
|
4221
|
-
constructor(parent, value,
|
|
4349
|
+
constructor(parent, value, path3, key) {
|
|
4222
4350
|
this._cachedPath = [];
|
|
4223
4351
|
this.parent = parent;
|
|
4224
4352
|
this.data = value;
|
|
4225
|
-
this._path =
|
|
4353
|
+
this._path = path3;
|
|
4226
4354
|
this._key = key;
|
|
4227
4355
|
}
|
|
4228
4356
|
get path() {
|
|
@@ -6598,7 +6726,7 @@ var require_types2 = __commonJS((exports) => {
|
|
|
6598
6726
|
if (!schema)
|
|
6599
6727
|
return null;
|
|
6600
6728
|
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
6601
|
-
}).filter((
|
|
6729
|
+
}).filter((x3) => !!x3);
|
|
6602
6730
|
if (ctx.common.async) {
|
|
6603
6731
|
return Promise.all(items).then((results) => {
|
|
6604
6732
|
return parseUtil_js_1.ParseStatus.mergeArray(status, results);
|
|
@@ -6859,7 +6987,7 @@ var require_types2 = __commonJS((exports) => {
|
|
|
6859
6987
|
return (0, parseUtil_js_1.makeIssue)({
|
|
6860
6988
|
data: args,
|
|
6861
6989
|
path: ctx.path,
|
|
6862
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((
|
|
6990
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x3) => !!x3),
|
|
6863
6991
|
issueData: {
|
|
6864
6992
|
code: ZodError_js_1.ZodIssueCode.invalid_arguments,
|
|
6865
6993
|
argumentsError: error
|
|
@@ -6870,7 +6998,7 @@ var require_types2 = __commonJS((exports) => {
|
|
|
6870
6998
|
return (0, parseUtil_js_1.makeIssue)({
|
|
6871
6999
|
data: returns,
|
|
6872
7000
|
path: ctx.path,
|
|
6873
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((
|
|
7001
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x3) => !!x3),
|
|
6874
7002
|
issueData: {
|
|
6875
7003
|
code: ZodError_js_1.ZodIssueCode.invalid_return_type,
|
|
6876
7004
|
returnTypeError: error
|
|
@@ -6880,29 +7008,29 @@ var require_types2 = __commonJS((exports) => {
|
|
|
6880
7008
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
6881
7009
|
const fn = ctx.data;
|
|
6882
7010
|
if (this._def.returns instanceof ZodPromise) {
|
|
6883
|
-
const
|
|
7011
|
+
const me2 = this;
|
|
6884
7012
|
return (0, parseUtil_js_1.OK)(async function(...args) {
|
|
6885
7013
|
const error = new ZodError_js_1.ZodError([]);
|
|
6886
|
-
const parsedArgs = await
|
|
7014
|
+
const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
|
|
6887
7015
|
error.addIssue(makeArgsIssue(args, e));
|
|
6888
7016
|
throw error;
|
|
6889
7017
|
});
|
|
6890
7018
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
6891
|
-
const parsedReturns = await
|
|
7019
|
+
const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
6892
7020
|
error.addIssue(makeReturnsIssue(result, e));
|
|
6893
7021
|
throw error;
|
|
6894
7022
|
});
|
|
6895
7023
|
return parsedReturns;
|
|
6896
7024
|
});
|
|
6897
7025
|
} else {
|
|
6898
|
-
const
|
|
7026
|
+
const me2 = this;
|
|
6899
7027
|
return (0, parseUtil_js_1.OK)(function(...args) {
|
|
6900
|
-
const parsedArgs =
|
|
7028
|
+
const parsedArgs = me2._def.args.safeParse(args, params);
|
|
6901
7029
|
if (!parsedArgs.success) {
|
|
6902
7030
|
throw new ZodError_js_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
6903
7031
|
}
|
|
6904
7032
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
6905
|
-
const parsedReturns =
|
|
7033
|
+
const parsedReturns = me2._def.returns.safeParse(result, params);
|
|
6906
7034
|
if (!parsedReturns.success) {
|
|
6907
7035
|
throw new ZodError_js_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
6908
7036
|
}
|
|
@@ -7687,20 +7815,20 @@ var require_types2 = __commonJS((exports) => {
|
|
|
7687
7815
|
|
|
7688
7816
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.cjs
|
|
7689
7817
|
var require_external = __commonJS((exports) => {
|
|
7690
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
7691
|
-
if (
|
|
7692
|
-
|
|
7693
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
7818
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
7819
|
+
if (k22 === undefined)
|
|
7820
|
+
k22 = k3;
|
|
7821
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
7694
7822
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7695
7823
|
desc = { enumerable: true, get: function() {
|
|
7696
|
-
return m[
|
|
7824
|
+
return m[k3];
|
|
7697
7825
|
} };
|
|
7698
7826
|
}
|
|
7699
|
-
Object.defineProperty(o,
|
|
7700
|
-
} : function(o, m,
|
|
7701
|
-
if (
|
|
7702
|
-
|
|
7703
|
-
o[
|
|
7827
|
+
Object.defineProperty(o, k22, desc);
|
|
7828
|
+
} : function(o, m, k3, k22) {
|
|
7829
|
+
if (k22 === undefined)
|
|
7830
|
+
k22 = k3;
|
|
7831
|
+
o[k22] = m[k3];
|
|
7704
7832
|
});
|
|
7705
7833
|
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
7706
7834
|
for (var p in m)
|
|
@@ -7718,20 +7846,20 @@ var require_external = __commonJS((exports) => {
|
|
|
7718
7846
|
|
|
7719
7847
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/index.cjs
|
|
7720
7848
|
var require_zod = __commonJS((exports) => {
|
|
7721
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
7722
|
-
if (
|
|
7723
|
-
|
|
7724
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
7849
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
7850
|
+
if (k22 === undefined)
|
|
7851
|
+
k22 = k3;
|
|
7852
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
7725
7853
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7726
7854
|
desc = { enumerable: true, get: function() {
|
|
7727
|
-
return m[
|
|
7855
|
+
return m[k3];
|
|
7728
7856
|
} };
|
|
7729
7857
|
}
|
|
7730
|
-
Object.defineProperty(o,
|
|
7731
|
-
} : function(o, m,
|
|
7732
|
-
if (
|
|
7733
|
-
|
|
7734
|
-
o[
|
|
7858
|
+
Object.defineProperty(o, k22, desc);
|
|
7859
|
+
} : function(o, m, k3, k22) {
|
|
7860
|
+
if (k22 === undefined)
|
|
7861
|
+
k22 = k3;
|
|
7862
|
+
o[k22] = m[k3];
|
|
7735
7863
|
});
|
|
7736
7864
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
7737
7865
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
@@ -7743,9 +7871,9 @@ var require_zod = __commonJS((exports) => {
|
|
|
7743
7871
|
return mod;
|
|
7744
7872
|
var result = {};
|
|
7745
7873
|
if (mod != null) {
|
|
7746
|
-
for (var
|
|
7747
|
-
if (
|
|
7748
|
-
__createBinding(result, mod,
|
|
7874
|
+
for (var k3 in mod)
|
|
7875
|
+
if (k3 !== "default" && Object.prototype.hasOwnProperty.call(mod, k3))
|
|
7876
|
+
__createBinding(result, mod, k3);
|
|
7749
7877
|
}
|
|
7750
7878
|
__setModuleDefault(result, mod);
|
|
7751
7879
|
return result;
|
|
@@ -7757,10 +7885,10 @@ var require_zod = __commonJS((exports) => {
|
|
|
7757
7885
|
};
|
|
7758
7886
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7759
7887
|
exports.z = undefined;
|
|
7760
|
-
var
|
|
7761
|
-
exports.z =
|
|
7888
|
+
var z3 = __importStar(require_external());
|
|
7889
|
+
exports.z = z3;
|
|
7762
7890
|
__exportStar(require_external(), exports);
|
|
7763
|
-
exports.default =
|
|
7891
|
+
exports.default = z3;
|
|
7764
7892
|
});
|
|
7765
7893
|
|
|
7766
7894
|
// ../../node_modules/.bun/@atproto+common-web@0.4.13/node_modules/@atproto/common-web/dist/check.js
|
|
@@ -7790,9 +7918,9 @@ var require_util2 = __commonJS((exports) => {
|
|
|
7790
7918
|
exports.aggregateErrors = aggregateErrors;
|
|
7791
7919
|
exports.omit = omit;
|
|
7792
7920
|
var noUndefinedVals = (obj) => {
|
|
7793
|
-
for (const
|
|
7794
|
-
if (obj[
|
|
7795
|
-
delete obj[
|
|
7921
|
+
for (const k3 of Object.keys(obj)) {
|
|
7922
|
+
if (obj[k3] === undefined) {
|
|
7923
|
+
delete obj[k3];
|
|
7796
7924
|
}
|
|
7797
7925
|
}
|
|
7798
7926
|
return obj;
|
|
@@ -7886,8 +8014,8 @@ var require_util2 = __commonJS((exports) => {
|
|
|
7886
8014
|
};
|
|
7887
8015
|
exports.s32decode = s32decode;
|
|
7888
8016
|
var asyncFilter = async (arr, fn) => {
|
|
7889
|
-
const results = await Promise.all(arr.map((
|
|
7890
|
-
return arr.filter((
|
|
8017
|
+
const results = await Promise.all(arr.map((t2) => fn(t2)));
|
|
8018
|
+
return arr.filter((_2, i) => results[i]);
|
|
7891
8019
|
};
|
|
7892
8020
|
exports.asyncFilter = asyncFilter;
|
|
7893
8021
|
var isErrnoException = (err) => {
|
|
@@ -8316,26 +8444,26 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8316
8444
|
}
|
|
8317
8445
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __);
|
|
8318
8446
|
};
|
|
8319
|
-
__assign = Object.assign || function(
|
|
8447
|
+
__assign = Object.assign || function(t2) {
|
|
8320
8448
|
for (var s, i = 1, n = arguments.length;i < n; i++) {
|
|
8321
8449
|
s = arguments[i];
|
|
8322
8450
|
for (var p in s)
|
|
8323
8451
|
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8324
|
-
|
|
8452
|
+
t2[p] = s[p];
|
|
8325
8453
|
}
|
|
8326
|
-
return
|
|
8454
|
+
return t2;
|
|
8327
8455
|
};
|
|
8328
8456
|
__rest = function(s, e) {
|
|
8329
|
-
var
|
|
8457
|
+
var t2 = {};
|
|
8330
8458
|
for (var p in s)
|
|
8331
8459
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
8332
|
-
|
|
8460
|
+
t2[p] = s[p];
|
|
8333
8461
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
8334
8462
|
for (var i = 0, p = Object.getOwnPropertySymbols(s);i < p.length; i++) {
|
|
8335
8463
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8336
|
-
|
|
8464
|
+
t2[p[i]] = s[p[i]];
|
|
8337
8465
|
}
|
|
8338
|
-
return
|
|
8466
|
+
return t2;
|
|
8339
8467
|
};
|
|
8340
8468
|
__decorate = function(decorators, target, key, desc) {
|
|
8341
8469
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -8361,7 +8489,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8361
8489
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
8362
8490
|
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
8363
8491
|
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
8364
|
-
var
|
|
8492
|
+
var _2, done = false;
|
|
8365
8493
|
for (var i = decorators.length - 1;i >= 0; i--) {
|
|
8366
8494
|
var context = {};
|
|
8367
8495
|
for (var p in contextIn)
|
|
@@ -8379,17 +8507,17 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8379
8507
|
continue;
|
|
8380
8508
|
if (result === null || typeof result !== "object")
|
|
8381
8509
|
throw new TypeError("Object expected");
|
|
8382
|
-
if (
|
|
8383
|
-
descriptor.get =
|
|
8384
|
-
if (
|
|
8385
|
-
descriptor.set =
|
|
8386
|
-
if (
|
|
8387
|
-
initializers.unshift(
|
|
8388
|
-
} else if (
|
|
8510
|
+
if (_2 = accept(result.get))
|
|
8511
|
+
descriptor.get = _2;
|
|
8512
|
+
if (_2 = accept(result.set))
|
|
8513
|
+
descriptor.set = _2;
|
|
8514
|
+
if (_2 = accept(result.init))
|
|
8515
|
+
initializers.unshift(_2);
|
|
8516
|
+
} else if (_2 = accept(result)) {
|
|
8389
8517
|
if (kind === "field")
|
|
8390
|
-
initializers.unshift(
|
|
8518
|
+
initializers.unshift(_2);
|
|
8391
8519
|
else
|
|
8392
|
-
descriptor[key] =
|
|
8520
|
+
descriptor[key] = _2;
|
|
8393
8521
|
}
|
|
8394
8522
|
}
|
|
8395
8523
|
if (target)
|
|
@@ -8403,8 +8531,8 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8403
8531
|
}
|
|
8404
8532
|
return useValue ? value : undefined;
|
|
8405
8533
|
};
|
|
8406
|
-
__propKey = function(
|
|
8407
|
-
return typeof
|
|
8534
|
+
__propKey = function(x3) {
|
|
8535
|
+
return typeof x3 === "symbol" ? x3 : "".concat(x3);
|
|
8408
8536
|
};
|
|
8409
8537
|
__setFunctionName = function(f, name, prefix) {
|
|
8410
8538
|
if (typeof name === "symbol")
|
|
@@ -8415,13 +8543,13 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8415
8543
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
8416
8544
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8417
8545
|
};
|
|
8418
|
-
__awaiter = function(thisArg, _arguments,
|
|
8546
|
+
__awaiter = function(thisArg, _arguments, P3, generator) {
|
|
8419
8547
|
function adopt(value) {
|
|
8420
|
-
return value instanceof
|
|
8548
|
+
return value instanceof P3 ? value : new P3(function(resolve) {
|
|
8421
8549
|
resolve(value);
|
|
8422
8550
|
});
|
|
8423
8551
|
}
|
|
8424
|
-
return new (
|
|
8552
|
+
return new (P3 || (P3 = Promise))(function(resolve, reject) {
|
|
8425
8553
|
function fulfilled(value) {
|
|
8426
8554
|
try {
|
|
8427
8555
|
step(generator.next(value));
|
|
@@ -8443,11 +8571,11 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8443
8571
|
});
|
|
8444
8572
|
};
|
|
8445
8573
|
__generator = function(thisArg, body) {
|
|
8446
|
-
var
|
|
8447
|
-
if (
|
|
8448
|
-
throw
|
|
8449
|
-
return
|
|
8450
|
-
}, trys: [], ops: [] }, f,
|
|
8574
|
+
var _2 = { label: 0, sent: function() {
|
|
8575
|
+
if (t2[0] & 1)
|
|
8576
|
+
throw t2[1];
|
|
8577
|
+
return t2[1];
|
|
8578
|
+
}, trys: [], ops: [] }, f, y2, t2, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8451
8579
|
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
8452
8580
|
return this;
|
|
8453
8581
|
}), g;
|
|
@@ -8459,59 +8587,59 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8459
8587
|
function step(op) {
|
|
8460
8588
|
if (f)
|
|
8461
8589
|
throw new TypeError("Generator is already executing.");
|
|
8462
|
-
while (g && (g = 0, op[0] && (
|
|
8590
|
+
while (g && (g = 0, op[0] && (_2 = 0)), _2)
|
|
8463
8591
|
try {
|
|
8464
|
-
if (f = 1,
|
|
8465
|
-
return
|
|
8466
|
-
if (
|
|
8467
|
-
op = [op[0] & 2,
|
|
8592
|
+
if (f = 1, y2 && (t2 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t2 = y2["return"]) && t2.call(y2), 0) : y2.next) && !(t2 = t2.call(y2, op[1])).done)
|
|
8593
|
+
return t2;
|
|
8594
|
+
if (y2 = 0, t2)
|
|
8595
|
+
op = [op[0] & 2, t2.value];
|
|
8468
8596
|
switch (op[0]) {
|
|
8469
8597
|
case 0:
|
|
8470
8598
|
case 1:
|
|
8471
|
-
|
|
8599
|
+
t2 = op;
|
|
8472
8600
|
break;
|
|
8473
8601
|
case 4:
|
|
8474
|
-
|
|
8602
|
+
_2.label++;
|
|
8475
8603
|
return { value: op[1], done: false };
|
|
8476
8604
|
case 5:
|
|
8477
|
-
|
|
8478
|
-
|
|
8605
|
+
_2.label++;
|
|
8606
|
+
y2 = op[1];
|
|
8479
8607
|
op = [0];
|
|
8480
8608
|
continue;
|
|
8481
8609
|
case 7:
|
|
8482
|
-
op =
|
|
8483
|
-
|
|
8610
|
+
op = _2.ops.pop();
|
|
8611
|
+
_2.trys.pop();
|
|
8484
8612
|
continue;
|
|
8485
8613
|
default:
|
|
8486
|
-
if (!(
|
|
8487
|
-
|
|
8614
|
+
if (!(t2 = _2.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
8615
|
+
_2 = 0;
|
|
8488
8616
|
continue;
|
|
8489
8617
|
}
|
|
8490
|
-
if (op[0] === 3 && (!
|
|
8491
|
-
|
|
8618
|
+
if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
|
|
8619
|
+
_2.label = op[1];
|
|
8492
8620
|
break;
|
|
8493
8621
|
}
|
|
8494
|
-
if (op[0] === 6 &&
|
|
8495
|
-
|
|
8496
|
-
|
|
8622
|
+
if (op[0] === 6 && _2.label < t2[1]) {
|
|
8623
|
+
_2.label = t2[1];
|
|
8624
|
+
t2 = op;
|
|
8497
8625
|
break;
|
|
8498
8626
|
}
|
|
8499
|
-
if (
|
|
8500
|
-
|
|
8501
|
-
|
|
8627
|
+
if (t2 && _2.label < t2[2]) {
|
|
8628
|
+
_2.label = t2[2];
|
|
8629
|
+
_2.ops.push(op);
|
|
8502
8630
|
break;
|
|
8503
8631
|
}
|
|
8504
|
-
if (
|
|
8505
|
-
|
|
8506
|
-
|
|
8632
|
+
if (t2[2])
|
|
8633
|
+
_2.ops.pop();
|
|
8634
|
+
_2.trys.pop();
|
|
8507
8635
|
continue;
|
|
8508
8636
|
}
|
|
8509
|
-
op = body.call(thisArg,
|
|
8637
|
+
op = body.call(thisArg, _2);
|
|
8510
8638
|
} catch (e) {
|
|
8511
8639
|
op = [6, e];
|
|
8512
|
-
|
|
8640
|
+
y2 = 0;
|
|
8513
8641
|
} finally {
|
|
8514
|
-
f =
|
|
8642
|
+
f = t2 = 0;
|
|
8515
8643
|
}
|
|
8516
8644
|
if (op[0] & 5)
|
|
8517
8645
|
throw op[1];
|
|
@@ -8523,20 +8651,20 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8523
8651
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
8524
8652
|
__createBinding(o, m, p);
|
|
8525
8653
|
};
|
|
8526
|
-
__createBinding = Object.create ? function(o, m,
|
|
8527
|
-
if (
|
|
8528
|
-
|
|
8529
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
8654
|
+
__createBinding = Object.create ? function(o, m, k3, k22) {
|
|
8655
|
+
if (k22 === undefined)
|
|
8656
|
+
k22 = k3;
|
|
8657
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
8530
8658
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8531
8659
|
desc = { enumerable: true, get: function() {
|
|
8532
|
-
return m[
|
|
8660
|
+
return m[k3];
|
|
8533
8661
|
} };
|
|
8534
8662
|
}
|
|
8535
|
-
Object.defineProperty(o,
|
|
8536
|
-
} : function(o, m,
|
|
8537
|
-
if (
|
|
8538
|
-
|
|
8539
|
-
o[
|
|
8663
|
+
Object.defineProperty(o, k22, desc);
|
|
8664
|
+
} : function(o, m, k3, k22) {
|
|
8665
|
+
if (k22 === undefined)
|
|
8666
|
+
k22 = k3;
|
|
8667
|
+
o[k22] = m[k3];
|
|
8540
8668
|
};
|
|
8541
8669
|
__values = function(o) {
|
|
8542
8670
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
@@ -8581,9 +8709,9 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8581
8709
|
__spreadArrays = function() {
|
|
8582
8710
|
for (var s = 0, i = 0, il = arguments.length;i < il; i++)
|
|
8583
8711
|
s += arguments[i].length;
|
|
8584
|
-
for (var r = Array(s),
|
|
8585
|
-
for (var a = arguments[i],
|
|
8586
|
-
r[
|
|
8712
|
+
for (var r = Array(s), k3 = 0, i = 0;i < il; i++)
|
|
8713
|
+
for (var a = arguments[i], j2 = 0, jl = a.length;j2 < jl; j2++, k3++)
|
|
8714
|
+
r[k3] = a[j2];
|
|
8587
8715
|
return r;
|
|
8588
8716
|
};
|
|
8589
8717
|
__spreadArray = function(to, from, pack) {
|
|
@@ -8603,7 +8731,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8603
8731
|
__asyncGenerator = function(thisArg, _arguments, generator) {
|
|
8604
8732
|
if (!Symbol.asyncIterator)
|
|
8605
8733
|
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
8606
|
-
var g = generator.apply(thisArg, _arguments || []), i,
|
|
8734
|
+
var g = generator.apply(thisArg, _arguments || []), i, q3 = [];
|
|
8607
8735
|
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
8608
8736
|
return this;
|
|
8609
8737
|
}, i;
|
|
@@ -8616,7 +8744,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8616
8744
|
if (g[n]) {
|
|
8617
8745
|
i[n] = function(v) {
|
|
8618
8746
|
return new Promise(function(a, b) {
|
|
8619
|
-
|
|
8747
|
+
q3.push([n, v, a, b]) > 1 || resume(n, v);
|
|
8620
8748
|
});
|
|
8621
8749
|
};
|
|
8622
8750
|
if (f)
|
|
@@ -8627,11 +8755,11 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8627
8755
|
try {
|
|
8628
8756
|
step(g[n](v));
|
|
8629
8757
|
} catch (e) {
|
|
8630
|
-
settle(
|
|
8758
|
+
settle(q3[0][3], e);
|
|
8631
8759
|
}
|
|
8632
8760
|
}
|
|
8633
8761
|
function step(r) {
|
|
8634
|
-
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(
|
|
8762
|
+
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q3[0][2], r);
|
|
8635
8763
|
}
|
|
8636
8764
|
function fulfill(value) {
|
|
8637
8765
|
resume("next", value);
|
|
@@ -8640,8 +8768,8 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8640
8768
|
resume("throw", value);
|
|
8641
8769
|
}
|
|
8642
8770
|
function settle(f, v) {
|
|
8643
|
-
if (f(v),
|
|
8644
|
-
resume(
|
|
8771
|
+
if (f(v), q3.shift(), q3.length)
|
|
8772
|
+
resume(q3[0][0], q3[0][1]);
|
|
8645
8773
|
}
|
|
8646
8774
|
};
|
|
8647
8775
|
__asyncDelegator = function(o) {
|
|
@@ -8693,9 +8821,9 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8693
8821
|
var ownKeys = function(o) {
|
|
8694
8822
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
8695
8823
|
var ar = [];
|
|
8696
|
-
for (var
|
|
8697
|
-
if (Object.prototype.hasOwnProperty.call(o2,
|
|
8698
|
-
ar[ar.length] =
|
|
8824
|
+
for (var k3 in o2)
|
|
8825
|
+
if (Object.prototype.hasOwnProperty.call(o2, k3))
|
|
8826
|
+
ar[ar.length] = k3;
|
|
8699
8827
|
return ar;
|
|
8700
8828
|
};
|
|
8701
8829
|
return ownKeys(o);
|
|
@@ -8705,9 +8833,9 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8705
8833
|
return mod;
|
|
8706
8834
|
var result = {};
|
|
8707
8835
|
if (mod != null) {
|
|
8708
|
-
for (var
|
|
8709
|
-
if (
|
|
8710
|
-
__createBinding(result, mod,
|
|
8836
|
+
for (var k3 = ownKeys(mod), i = 0;i < k3.length; i++)
|
|
8837
|
+
if (k3[i] !== "default")
|
|
8838
|
+
__createBinding(result, mod, k3[i]);
|
|
8711
8839
|
}
|
|
8712
8840
|
__setModuleDefault(result, mod);
|
|
8713
8841
|
return result;
|
|
@@ -8804,13 +8932,13 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
8804
8932
|
}
|
|
8805
8933
|
return next();
|
|
8806
8934
|
};
|
|
8807
|
-
__rewriteRelativeImportExtension = function(
|
|
8808
|
-
if (typeof
|
|
8809
|
-
return
|
|
8935
|
+
__rewriteRelativeImportExtension = function(path3, preserveJsx) {
|
|
8936
|
+
if (typeof path3 === "string" && /^\.\.?\//.test(path3)) {
|
|
8937
|
+
return path3.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
8810
8938
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
8811
8939
|
});
|
|
8812
8940
|
}
|
|
8813
|
-
return
|
|
8941
|
+
return path3;
|
|
8814
8942
|
};
|
|
8815
8943
|
exporter("__extends", __extends);
|
|
8816
8944
|
exporter("__assign", __assign);
|
|
@@ -8888,7 +9016,7 @@ var require_varint = __commonJS((exports, module) => {
|
|
|
8888
9016
|
return res;
|
|
8889
9017
|
}
|
|
8890
9018
|
var N1 = Math.pow(2, 7);
|
|
8891
|
-
var
|
|
9019
|
+
var N22 = Math.pow(2, 14);
|
|
8892
9020
|
var N3 = Math.pow(2, 21);
|
|
8893
9021
|
var N4 = Math.pow(2, 28);
|
|
8894
9022
|
var N5 = Math.pow(2, 35);
|
|
@@ -8897,7 +9025,7 @@ var require_varint = __commonJS((exports, module) => {
|
|
|
8897
9025
|
var N8 = Math.pow(2, 56);
|
|
8898
9026
|
var N9 = Math.pow(2, 63);
|
|
8899
9027
|
var length = function(value) {
|
|
8900
|
-
return value < N1 ? 1 : value <
|
|
9028
|
+
return value < N1 ? 1 : value < N22 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10;
|
|
8901
9029
|
};
|
|
8902
9030
|
var varint = {
|
|
8903
9031
|
encode: encode_1,
|
|
@@ -9031,14 +9159,14 @@ var require_base_x = __commonJS((exports, module) => {
|
|
|
9031
9159
|
throw new TypeError("Alphabet too long");
|
|
9032
9160
|
}
|
|
9033
9161
|
var BASE_MAP = new Uint8Array(256);
|
|
9034
|
-
for (var
|
|
9035
|
-
BASE_MAP[
|
|
9162
|
+
for (var j2 = 0;j2 < BASE_MAP.length; j2++) {
|
|
9163
|
+
BASE_MAP[j2] = 255;
|
|
9036
9164
|
}
|
|
9037
9165
|
for (var i = 0;i < ALPHABET.length; i++) {
|
|
9038
|
-
var
|
|
9039
|
-
var xc =
|
|
9166
|
+
var x3 = ALPHABET.charAt(i);
|
|
9167
|
+
var xc = x3.charCodeAt(0);
|
|
9040
9168
|
if (BASE_MAP[xc] !== 255) {
|
|
9041
|
-
throw new TypeError(
|
|
9169
|
+
throw new TypeError(x3 + " is ambiguous");
|
|
9042
9170
|
}
|
|
9043
9171
|
BASE_MAP[xc] = i;
|
|
9044
9172
|
}
|
|
@@ -9138,14 +9266,14 @@ var require_base_x = __commonJS((exports, module) => {
|
|
|
9138
9266
|
it4++;
|
|
9139
9267
|
}
|
|
9140
9268
|
var vch = new Uint8Array(zeroes + (size - it4));
|
|
9141
|
-
var
|
|
9269
|
+
var j3 = zeroes;
|
|
9142
9270
|
while (it4 !== size) {
|
|
9143
|
-
vch[
|
|
9271
|
+
vch[j3++] = b256[it4++];
|
|
9144
9272
|
}
|
|
9145
9273
|
return vch;
|
|
9146
9274
|
}
|
|
9147
|
-
function decode(
|
|
9148
|
-
var buffer = decodeUnsafe(
|
|
9275
|
+
function decode(string2) {
|
|
9276
|
+
var buffer = decodeUnsafe(string2);
|
|
9149
9277
|
if (buffer) {
|
|
9150
9278
|
return buffer;
|
|
9151
9279
|
}
|
|
@@ -9256,13 +9384,13 @@ var require_base = __commonJS((exports) => {
|
|
|
9256
9384
|
decode: (text) => bytes.coerce(decode2(text))
|
|
9257
9385
|
});
|
|
9258
9386
|
};
|
|
9259
|
-
var decode = (
|
|
9387
|
+
var decode = (string2, alphabet, bitsPerChar, name) => {
|
|
9260
9388
|
const codes = {};
|
|
9261
9389
|
for (let i = 0;i < alphabet.length; ++i) {
|
|
9262
9390
|
codes[alphabet[i]] = i;
|
|
9263
9391
|
}
|
|
9264
|
-
let end =
|
|
9265
|
-
while (
|
|
9392
|
+
let end = string2.length;
|
|
9393
|
+
while (string2[end - 1] === "=") {
|
|
9266
9394
|
--end;
|
|
9267
9395
|
}
|
|
9268
9396
|
const out = new Uint8Array(end * bitsPerChar / 8 | 0);
|
|
@@ -9270,7 +9398,7 @@ var require_base = __commonJS((exports) => {
|
|
|
9270
9398
|
let buffer = 0;
|
|
9271
9399
|
let written = 0;
|
|
9272
9400
|
for (let i = 0;i < end; ++i) {
|
|
9273
|
-
const value = codes[
|
|
9401
|
+
const value = codes[string2[i]];
|
|
9274
9402
|
if (value === undefined) {
|
|
9275
9403
|
throw new SyntaxError(`Non-${name} character`);
|
|
9276
9404
|
}
|
|
@@ -10045,7 +10173,7 @@ var require_json = __commonJS((exports) => {
|
|
|
10045
10173
|
});
|
|
10046
10174
|
|
|
10047
10175
|
// ../../node_modules/.bun/multiformats@9.9.0/node_modules/multiformats/cjs/src/index.js
|
|
10048
|
-
var
|
|
10176
|
+
var require_src3 = __commonJS((exports) => {
|
|
10049
10177
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10050
10178
|
var cid = require_cid();
|
|
10051
10179
|
var varint = require_varint2();
|
|
@@ -10076,7 +10204,7 @@ var require_basics = __commonJS((exports) => {
|
|
|
10076
10204
|
var identity$1 = require_identity2();
|
|
10077
10205
|
var raw = require_raw();
|
|
10078
10206
|
var json = require_json();
|
|
10079
|
-
|
|
10207
|
+
require_src3();
|
|
10080
10208
|
var cid = require_cid();
|
|
10081
10209
|
var hasher = require_hasher();
|
|
10082
10210
|
var digest = require_digest();
|
|
@@ -10127,7 +10255,7 @@ var require_bases = __commonJS((exports, module) => {
|
|
|
10127
10255
|
decoder: { decode }
|
|
10128
10256
|
};
|
|
10129
10257
|
}
|
|
10130
|
-
var
|
|
10258
|
+
var string2 = createCodec("utf8", "u", (buf) => {
|
|
10131
10259
|
const decoder = new TextDecoder("utf8");
|
|
10132
10260
|
return "u" + decoder.decode(buf);
|
|
10133
10261
|
}, (str) => {
|
|
@@ -10135,11 +10263,11 @@ var require_bases = __commonJS((exports, module) => {
|
|
|
10135
10263
|
return encoder.encode(str.substring(1));
|
|
10136
10264
|
});
|
|
10137
10265
|
var ascii = createCodec("ascii", "a", (buf) => {
|
|
10138
|
-
let
|
|
10266
|
+
let string3 = "a";
|
|
10139
10267
|
for (let i = 0;i < buf.length; i++) {
|
|
10140
|
-
|
|
10268
|
+
string3 += String.fromCharCode(buf[i]);
|
|
10141
10269
|
}
|
|
10142
|
-
return
|
|
10270
|
+
return string3;
|
|
10143
10271
|
}, (str) => {
|
|
10144
10272
|
str = str.substring(1);
|
|
10145
10273
|
const buf = new Uint8Array(str.length);
|
|
@@ -10149,8 +10277,8 @@ var require_bases = __commonJS((exports, module) => {
|
|
|
10149
10277
|
return buf;
|
|
10150
10278
|
});
|
|
10151
10279
|
var BASES = {
|
|
10152
|
-
utf8:
|
|
10153
|
-
"utf-8":
|
|
10280
|
+
utf8: string2,
|
|
10281
|
+
"utf-8": string2,
|
|
10154
10282
|
hex: basics.bases.base16,
|
|
10155
10283
|
latin1: ascii,
|
|
10156
10284
|
ascii,
|
|
@@ -10164,12 +10292,12 @@ var require_bases = __commonJS((exports, module) => {
|
|
|
10164
10292
|
var require_from_string = __commonJS((exports) => {
|
|
10165
10293
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10166
10294
|
var bases = require_bases();
|
|
10167
|
-
function fromString(
|
|
10295
|
+
function fromString(string2, encoding = "utf8") {
|
|
10168
10296
|
const base = bases[encoding];
|
|
10169
10297
|
if (!base) {
|
|
10170
10298
|
throw new Error(`Unsupported encoding "${encoding}"`);
|
|
10171
10299
|
}
|
|
10172
|
-
return base.decoder.decode(`${base.prefix}${
|
|
10300
|
+
return base.decoder.decode(`${base.prefix}${string2}`);
|
|
10173
10301
|
}
|
|
10174
10302
|
exports.fromString = fromString;
|
|
10175
10303
|
});
|
|
@@ -10900,7 +11028,7 @@ var require_grapheme = __commonJS((exports) => {
|
|
|
10900
11028
|
}
|
|
10901
11029
|
function countGraphemes(text) {
|
|
10902
11030
|
let count = 0;
|
|
10903
|
-
for (let
|
|
11031
|
+
for (let _2 of graphemeSegments(text))
|
|
10904
11032
|
count += 1;
|
|
10905
11033
|
return count;
|
|
10906
11034
|
}
|
|
@@ -10995,7 +11123,7 @@ var require_utf8_grapheme_len = __commonJS((exports) => {
|
|
|
10995
11123
|
var segmenter = "Segmenter" in Intl && typeof Intl.Segmenter === "function" ? /* @__PURE__ */ new Intl.Segmenter : null;
|
|
10996
11124
|
exports.graphemeLenNative = segmenter ? function graphemeLenNative(str) {
|
|
10997
11125
|
let length = 0;
|
|
10998
|
-
for (const
|
|
11126
|
+
for (const _2 of segmenter.segment(str))
|
|
10999
11127
|
length++;
|
|
11000
11128
|
return length;
|
|
11001
11129
|
} : null;
|
|
@@ -11010,20 +11138,20 @@ var require_utf8_len = __commonJS((exports) => {
|
|
|
11010
11138
|
exports.utf8LenNode = undefined;
|
|
11011
11139
|
exports.utf8LenCompute = utf8LenCompute;
|
|
11012
11140
|
var nodejs_buffer_js_1 = require_nodejs_buffer();
|
|
11013
|
-
exports.utf8LenNode = nodejs_buffer_js_1.NodeJSBuffer ? function utf8LenNode(
|
|
11014
|
-
return nodejs_buffer_js_1.NodeJSBuffer.byteLength(
|
|
11141
|
+
exports.utf8LenNode = nodejs_buffer_js_1.NodeJSBuffer ? function utf8LenNode(string2) {
|
|
11142
|
+
return nodejs_buffer_js_1.NodeJSBuffer.byteLength(string2, "utf8");
|
|
11015
11143
|
} : null;
|
|
11016
|
-
function utf8LenCompute(
|
|
11017
|
-
let len =
|
|
11144
|
+
function utf8LenCompute(string2) {
|
|
11145
|
+
let len = string2.length;
|
|
11018
11146
|
let code;
|
|
11019
|
-
for (let i = 0;i <
|
|
11020
|
-
code =
|
|
11147
|
+
for (let i = 0;i < string2.length; i += 1) {
|
|
11148
|
+
code = string2.charCodeAt(i);
|
|
11021
11149
|
if (code <= 127) {} else if (code <= 2047) {
|
|
11022
11150
|
len += 1;
|
|
11023
11151
|
} else {
|
|
11024
11152
|
len += 2;
|
|
11025
11153
|
if (code >= 55296 && code <= 56319) {
|
|
11026
|
-
code =
|
|
11154
|
+
code = string2.charCodeAt(i + 1);
|
|
11027
11155
|
if (code >= 56320 && code <= 57343) {
|
|
11028
11156
|
i++;
|
|
11029
11157
|
}
|
|
@@ -12008,9 +12136,9 @@ var require_aturi = __commonJS((exports) => {
|
|
|
12008
12136
|
return this.toString();
|
|
12009
12137
|
}
|
|
12010
12138
|
toString() {
|
|
12011
|
-
let
|
|
12012
|
-
if (!
|
|
12013
|
-
|
|
12139
|
+
let path3 = this.pathname || "/";
|
|
12140
|
+
if (!path3.startsWith("/")) {
|
|
12141
|
+
path3 = `/${path3}`;
|
|
12014
12142
|
}
|
|
12015
12143
|
let qs = "";
|
|
12016
12144
|
if (this.searchParams.size) {
|
|
@@ -12020,7 +12148,7 @@ var require_aturi = __commonJS((exports) => {
|
|
|
12020
12148
|
if (hash && !hash.startsWith("#")) {
|
|
12021
12149
|
hash = `#${hash}`;
|
|
12022
12150
|
}
|
|
12023
|
-
return `at://${this.host}${
|
|
12151
|
+
return `at://${this.host}${path3}${qs}${hash}`;
|
|
12024
12152
|
}
|
|
12025
12153
|
}
|
|
12026
12154
|
exports.AtUri = AtUri;
|
|
@@ -12400,20 +12528,20 @@ var require_did_doc = __commonJS((exports) => {
|
|
|
12400
12528
|
|
|
12401
12529
|
// ../../node_modules/.bun/@atproto+common-web@0.4.13/node_modules/@atproto/common-web/dist/index.js
|
|
12402
12530
|
var require_dist4 = __commonJS((exports) => {
|
|
12403
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
12404
|
-
if (
|
|
12405
|
-
|
|
12406
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
12531
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
12532
|
+
if (k22 === undefined)
|
|
12533
|
+
k22 = k3;
|
|
12534
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
12407
12535
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12408
12536
|
desc = { enumerable: true, get: function() {
|
|
12409
|
-
return m[
|
|
12537
|
+
return m[k3];
|
|
12410
12538
|
} };
|
|
12411
12539
|
}
|
|
12412
|
-
Object.defineProperty(o,
|
|
12413
|
-
} : function(o, m,
|
|
12414
|
-
if (
|
|
12415
|
-
|
|
12416
|
-
o[
|
|
12540
|
+
Object.defineProperty(o, k22, desc);
|
|
12541
|
+
} : function(o, m, k3, k22) {
|
|
12542
|
+
if (k22 === undefined)
|
|
12543
|
+
k22 = k3;
|
|
12544
|
+
o[k22] = m[k3];
|
|
12417
12545
|
});
|
|
12418
12546
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
12419
12547
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
@@ -12424,9 +12552,9 @@ var require_dist4 = __commonJS((exports) => {
|
|
|
12424
12552
|
var ownKeys = function(o) {
|
|
12425
12553
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
12426
12554
|
var ar = [];
|
|
12427
|
-
for (var
|
|
12428
|
-
if (Object.prototype.hasOwnProperty.call(o2,
|
|
12429
|
-
ar[ar.length] =
|
|
12555
|
+
for (var k3 in o2)
|
|
12556
|
+
if (Object.prototype.hasOwnProperty.call(o2, k3))
|
|
12557
|
+
ar[ar.length] = k3;
|
|
12430
12558
|
return ar;
|
|
12431
12559
|
};
|
|
12432
12560
|
return ownKeys(o);
|
|
@@ -12436,9 +12564,9 @@ var require_dist4 = __commonJS((exports) => {
|
|
|
12436
12564
|
return mod;
|
|
12437
12565
|
var result = {};
|
|
12438
12566
|
if (mod != null) {
|
|
12439
|
-
for (var
|
|
12440
|
-
if (
|
|
12441
|
-
__createBinding(result, mod,
|
|
12567
|
+
for (var k3 = ownKeys(mod), i = 0;i < k3.length; i++)
|
|
12568
|
+
if (k3[i] !== "default")
|
|
12569
|
+
__createBinding(result, mod, k3[i]);
|
|
12442
12570
|
}
|
|
12443
12571
|
__setModuleDefault(result, mod);
|
|
12444
12572
|
return result;
|
|
@@ -12913,11 +13041,11 @@ var require_blob3 = __commonJS((exports) => {
|
|
|
12913
13041
|
exports.blob = blob;
|
|
12914
13042
|
var blob_refs_1 = require_blob_refs();
|
|
12915
13043
|
var types_1 = require_types4();
|
|
12916
|
-
function blob(lexicons,
|
|
13044
|
+
function blob(lexicons, path3, def, value) {
|
|
12917
13045
|
if (!value || !(value instanceof blob_refs_1.BlobRef)) {
|
|
12918
13046
|
return {
|
|
12919
13047
|
success: false,
|
|
12920
|
-
error: new types_1.ValidationError(`${
|
|
13048
|
+
error: new types_1.ValidationError(`${path3} should be a blob ref`)
|
|
12921
13049
|
};
|
|
12922
13050
|
}
|
|
12923
13051
|
return { success: true, value };
|
|
@@ -12927,46 +13055,46 @@ var require_blob3 = __commonJS((exports) => {
|
|
|
12927
13055
|
// ../../node_modules/.bun/iso-datestring-validator@2.2.2/node_modules/iso-datestring-validator/dist/index.js
|
|
12928
13056
|
var require_dist5 = __commonJS((exports) => {
|
|
12929
13057
|
(() => {
|
|
12930
|
-
var e = { d: (
|
|
13058
|
+
var e = { d: (t3, r2) => {
|
|
12931
13059
|
for (var n2 in r2)
|
|
12932
|
-
e.o(r2, n2) && !e.o(
|
|
12933
|
-
}, o: (e2,
|
|
13060
|
+
e.o(r2, n2) && !e.o(t3, n2) && Object.defineProperty(t3, n2, { enumerable: true, get: r2[n2] });
|
|
13061
|
+
}, o: (e2, t3) => Object.prototype.hasOwnProperty.call(e2, t3), r: (e2) => {
|
|
12934
13062
|
typeof Symbol != "undefined" && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true });
|
|
12935
|
-
} },
|
|
12936
|
-
function r(e2,
|
|
12937
|
-
return
|
|
13063
|
+
} }, t2 = {};
|
|
13064
|
+
function r(e2, t3) {
|
|
13065
|
+
return t3 === undefined && (t3 = "-"), new RegExp("^(?!0{4}" + t3 + "0{2}" + t3 + "0{2})((?=[0-9]{4}" + t3 + "(((0[^2])|1[0-2])|02(?=" + t3 + "(([0-1][0-9])|2[0-8])))" + t3 + "[0-9]{2})|(?=((([13579][26])|([2468][048])|(0[48]))0{2})|([0-9]{2}((((0|[2468])[48])|[2468][048])|([13579][26])))" + t3 + "02" + t3 + "29))([0-9]{4})" + t3 + "(?!((0[469])|11)" + t3 + "31)((0[1,3-9]|1[0-2])|(02(?!" + t3 + "3)))" + t3 + "(0[1-9]|[1-2][0-9]|3[0-1])$").test(e2);
|
|
12938
13066
|
}
|
|
12939
13067
|
function n(e2) {
|
|
12940
|
-
var
|
|
12941
|
-
return
|
|
13068
|
+
var t3 = /\D/.exec(e2);
|
|
13069
|
+
return t3 ? t3[0] : "";
|
|
12942
13070
|
}
|
|
12943
|
-
function i(e2,
|
|
12944
|
-
|
|
12945
|
-
var i2 = new RegExp("^([0-1]|2(?=([0-3])|4" +
|
|
13071
|
+
function i(e2, t3, r2) {
|
|
13072
|
+
t3 === undefined && (t3 = ":"), r2 === undefined && (r2 = false);
|
|
13073
|
+
var i2 = new RegExp("^([0-1]|2(?=([0-3])|4" + t3 + "00))[0-9]" + t3 + "[0-5][0-9](" + t3 + "([0-5]|6(?=0))[0-9])?(.[0-9]{1,9})?$");
|
|
12946
13074
|
if (!r2 || !/[Z+\-]/.test(e2))
|
|
12947
13075
|
return i2.test(e2);
|
|
12948
13076
|
if (/Z$/.test(e2))
|
|
12949
13077
|
return i2.test(e2.replace("Z", ""));
|
|
12950
13078
|
var o2 = e2.includes("+"), a2 = e2.split(/[+-]/), u2 = a2[0], d2 = a2[1];
|
|
12951
|
-
return i2.test(u2) && function(e3,
|
|
12952
|
-
return r3 === undefined && (r3 = ":"), new RegExp(
|
|
13079
|
+
return i2.test(u2) && function(e3, t4, r3) {
|
|
13080
|
+
return r3 === undefined && (r3 = ":"), new RegExp(t4 ? "^(0(?!(2" + r3 + "4)|0" + r3 + "3)|1(?=([0-1]|2(?=" + r3 + "[04])|[34](?=" + r3 + "0))))([03469](?=" + r3 + "[03])|[17](?=" + r3 + "0)|2(?=" + r3 + "[04])|5(?=" + r3 + "[034])|8(?=" + r3 + "[04]))" + r3 + "([03](?=0)|4(?=5))[05]$" : "^(0(?=[^0])|1(?=[0-2]))([39](?=" + r3 + "[03])|[0-24-8](?=" + r3 + "00))" + r3 + "[03]0$").test(e3);
|
|
12953
13081
|
}(d2, o2, n(d2));
|
|
12954
13082
|
}
|
|
12955
13083
|
function o(e2) {
|
|
12956
|
-
var
|
|
13084
|
+
var t3 = e2.split("T"), o2 = t3[0], a2 = t3[1], u2 = r(o2, n(o2));
|
|
12957
13085
|
if (!a2)
|
|
12958
13086
|
return false;
|
|
12959
13087
|
var d2, s = (d2 = a2.match(/([^Z+\-\d])(?=\d+\1)/), Array.isArray(d2) ? d2[0] : "");
|
|
12960
13088
|
return u2 && i(a2, s, true);
|
|
12961
13089
|
}
|
|
12962
|
-
function a(e2,
|
|
12963
|
-
return
|
|
13090
|
+
function a(e2, t3) {
|
|
13091
|
+
return t3 === undefined && (t3 = "-"), new RegExp("^[0-9]{4}" + t3 + "(0(?=[^0])|1(?=[0-2]))[0-9]$").test(e2);
|
|
12964
13092
|
}
|
|
12965
|
-
e.r(
|
|
13093
|
+
e.r(t2), e.d(t2, { isValidDate: () => r, isValidISODateString: () => o, isValidTime: () => i, isValidYearMonth: () => a });
|
|
12966
13094
|
var u = exports;
|
|
12967
|
-
for (var d in
|
|
12968
|
-
u[d] =
|
|
12969
|
-
|
|
13095
|
+
for (var d in t2)
|
|
13096
|
+
u[d] = t2[d];
|
|
13097
|
+
t2.__esModule && Object.defineProperty(u, "__esModule", { value: true });
|
|
12970
13098
|
})();
|
|
12971
13099
|
});
|
|
12972
13100
|
|
|
@@ -12989,7 +13117,7 @@ var require_formats = __commonJS((exports) => {
|
|
|
12989
13117
|
var common_web_1 = require_dist4();
|
|
12990
13118
|
var syntax_1 = require_dist3();
|
|
12991
13119
|
var types_1 = require_types4();
|
|
12992
|
-
function datetime(
|
|
13120
|
+
function datetime(path3, value) {
|
|
12993
13121
|
try {
|
|
12994
13122
|
if (!(0, iso_datestring_validator_1.isValidISODateString)(value)) {
|
|
12995
13123
|
throw new Error;
|
|
@@ -12997,69 +13125,69 @@ var require_formats = __commonJS((exports) => {
|
|
|
12997
13125
|
} catch {
|
|
12998
13126
|
return {
|
|
12999
13127
|
success: false,
|
|
13000
|
-
error: new types_1.ValidationError(`${
|
|
13128
|
+
error: new types_1.ValidationError(`${path3} must be an valid atproto datetime (both RFC-3339 and ISO-8601)`)
|
|
13001
13129
|
};
|
|
13002
13130
|
}
|
|
13003
13131
|
return { success: true, value };
|
|
13004
13132
|
}
|
|
13005
|
-
function uri(
|
|
13133
|
+
function uri(path3, value) {
|
|
13006
13134
|
if (!(0, syntax_1.isValidUri)(value)) {
|
|
13007
13135
|
return {
|
|
13008
13136
|
success: false,
|
|
13009
|
-
error: new types_1.ValidationError(`${
|
|
13137
|
+
error: new types_1.ValidationError(`${path3} must be a uri`)
|
|
13010
13138
|
};
|
|
13011
13139
|
}
|
|
13012
13140
|
return { success: true, value };
|
|
13013
13141
|
}
|
|
13014
|
-
function atUri(
|
|
13142
|
+
function atUri(path3, value) {
|
|
13015
13143
|
try {
|
|
13016
13144
|
(0, syntax_1.ensureValidAtUri)(value);
|
|
13017
13145
|
} catch {
|
|
13018
13146
|
return {
|
|
13019
13147
|
success: false,
|
|
13020
|
-
error: new types_1.ValidationError(`${
|
|
13148
|
+
error: new types_1.ValidationError(`${path3} must be a valid at-uri`)
|
|
13021
13149
|
};
|
|
13022
13150
|
}
|
|
13023
13151
|
return { success: true, value };
|
|
13024
13152
|
}
|
|
13025
|
-
function did(
|
|
13153
|
+
function did(path3, value) {
|
|
13026
13154
|
try {
|
|
13027
13155
|
(0, syntax_1.ensureValidDid)(value);
|
|
13028
13156
|
} catch {
|
|
13029
13157
|
return {
|
|
13030
13158
|
success: false,
|
|
13031
|
-
error: new types_1.ValidationError(`${
|
|
13159
|
+
error: new types_1.ValidationError(`${path3} must be a valid did`)
|
|
13032
13160
|
};
|
|
13033
13161
|
}
|
|
13034
13162
|
return { success: true, value };
|
|
13035
13163
|
}
|
|
13036
|
-
function handle(
|
|
13164
|
+
function handle(path3, value) {
|
|
13037
13165
|
try {
|
|
13038
13166
|
(0, syntax_1.ensureValidHandle)(value);
|
|
13039
13167
|
} catch {
|
|
13040
13168
|
return {
|
|
13041
13169
|
success: false,
|
|
13042
|
-
error: new types_1.ValidationError(`${
|
|
13170
|
+
error: new types_1.ValidationError(`${path3} must be a valid handle`)
|
|
13043
13171
|
};
|
|
13044
13172
|
}
|
|
13045
13173
|
return { success: true, value };
|
|
13046
13174
|
}
|
|
13047
|
-
function atIdentifier(
|
|
13175
|
+
function atIdentifier(path3, value) {
|
|
13048
13176
|
if (value.startsWith("did:")) {
|
|
13049
|
-
const didResult = did(
|
|
13177
|
+
const didResult = did(path3, value);
|
|
13050
13178
|
if (didResult.success)
|
|
13051
13179
|
return didResult;
|
|
13052
13180
|
} else {
|
|
13053
|
-
const handleResult = handle(
|
|
13181
|
+
const handleResult = handle(path3, value);
|
|
13054
13182
|
if (handleResult.success)
|
|
13055
13183
|
return handleResult;
|
|
13056
13184
|
}
|
|
13057
13185
|
return {
|
|
13058
13186
|
success: false,
|
|
13059
|
-
error: new types_1.ValidationError(`${
|
|
13187
|
+
error: new types_1.ValidationError(`${path3} must be a valid did or a handle`)
|
|
13060
13188
|
};
|
|
13061
13189
|
}
|
|
13062
|
-
function nsid(
|
|
13190
|
+
function nsid(path3, value) {
|
|
13063
13191
|
if ((0, syntax_1.isValidNsid)(value)) {
|
|
13064
13192
|
return {
|
|
13065
13193
|
success: true,
|
|
@@ -13068,46 +13196,46 @@ var require_formats = __commonJS((exports) => {
|
|
|
13068
13196
|
} else {
|
|
13069
13197
|
return {
|
|
13070
13198
|
success: false,
|
|
13071
|
-
error: new types_1.ValidationError(`${
|
|
13199
|
+
error: new types_1.ValidationError(`${path3} must be a valid nsid`)
|
|
13072
13200
|
};
|
|
13073
13201
|
}
|
|
13074
13202
|
}
|
|
13075
|
-
function cid(
|
|
13203
|
+
function cid(path3, value) {
|
|
13076
13204
|
try {
|
|
13077
13205
|
cid_1.CID.parse(value);
|
|
13078
13206
|
} catch {
|
|
13079
13207
|
return {
|
|
13080
13208
|
success: false,
|
|
13081
|
-
error: new types_1.ValidationError(`${
|
|
13209
|
+
error: new types_1.ValidationError(`${path3} must be a cid string`)
|
|
13082
13210
|
};
|
|
13083
13211
|
}
|
|
13084
13212
|
return { success: true, value };
|
|
13085
13213
|
}
|
|
13086
|
-
function language(
|
|
13214
|
+
function language(path3, value) {
|
|
13087
13215
|
if ((0, common_web_1.validateLanguage)(value)) {
|
|
13088
13216
|
return { success: true, value };
|
|
13089
13217
|
}
|
|
13090
13218
|
return {
|
|
13091
13219
|
success: false,
|
|
13092
|
-
error: new types_1.ValidationError(`${
|
|
13220
|
+
error: new types_1.ValidationError(`${path3} must be a well-formed BCP 47 language tag`)
|
|
13093
13221
|
};
|
|
13094
13222
|
}
|
|
13095
|
-
function tid(
|
|
13223
|
+
function tid(path3, value) {
|
|
13096
13224
|
if ((0, syntax_1.isValidTid)(value)) {
|
|
13097
13225
|
return { success: true, value };
|
|
13098
13226
|
}
|
|
13099
13227
|
return {
|
|
13100
13228
|
success: false,
|
|
13101
|
-
error: new types_1.ValidationError(`${
|
|
13229
|
+
error: new types_1.ValidationError(`${path3} must be a valid TID`)
|
|
13102
13230
|
};
|
|
13103
13231
|
}
|
|
13104
|
-
function recordKey(
|
|
13232
|
+
function recordKey(path3, value) {
|
|
13105
13233
|
try {
|
|
13106
13234
|
(0, syntax_1.ensureValidRecordKey)(value);
|
|
13107
13235
|
} catch {
|
|
13108
13236
|
return {
|
|
13109
13237
|
success: false,
|
|
13110
|
-
error: new types_1.ValidationError(`${
|
|
13238
|
+
error: new types_1.ValidationError(`${path3} must be a valid Record Key`)
|
|
13111
13239
|
};
|
|
13112
13240
|
}
|
|
13113
13241
|
return { success: true, value };
|
|
@@ -13116,20 +13244,20 @@ var require_formats = __commonJS((exports) => {
|
|
|
13116
13244
|
|
|
13117
13245
|
// ../../node_modules/.bun/@atproto+lexicon@0.6.1/node_modules/@atproto/lexicon/dist/validators/primitives.js
|
|
13118
13246
|
var require_primitives = __commonJS((exports) => {
|
|
13119
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
13120
|
-
if (
|
|
13121
|
-
|
|
13122
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
13247
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
13248
|
+
if (k22 === undefined)
|
|
13249
|
+
k22 = k3;
|
|
13250
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
13123
13251
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13124
13252
|
desc = { enumerable: true, get: function() {
|
|
13125
|
-
return m[
|
|
13253
|
+
return m[k3];
|
|
13126
13254
|
} };
|
|
13127
13255
|
}
|
|
13128
|
-
Object.defineProperty(o,
|
|
13129
|
-
} : function(o, m,
|
|
13130
|
-
if (
|
|
13131
|
-
|
|
13132
|
-
o[
|
|
13256
|
+
Object.defineProperty(o, k22, desc);
|
|
13257
|
+
} : function(o, m, k3, k22) {
|
|
13258
|
+
if (k22 === undefined)
|
|
13259
|
+
k22 = k3;
|
|
13260
|
+
o[k22] = m[k3];
|
|
13133
13261
|
});
|
|
13134
13262
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
13135
13263
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
@@ -13140,9 +13268,9 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13140
13268
|
var ownKeys = function(o) {
|
|
13141
13269
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
13142
13270
|
var ar = [];
|
|
13143
|
-
for (var
|
|
13144
|
-
if (Object.prototype.hasOwnProperty.call(o2,
|
|
13145
|
-
ar[ar.length] =
|
|
13271
|
+
for (var k3 in o2)
|
|
13272
|
+
if (Object.prototype.hasOwnProperty.call(o2, k3))
|
|
13273
|
+
ar[ar.length] = k3;
|
|
13146
13274
|
return ar;
|
|
13147
13275
|
};
|
|
13148
13276
|
return ownKeys(o);
|
|
@@ -13152,9 +13280,9 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13152
13280
|
return mod;
|
|
13153
13281
|
var result = {};
|
|
13154
13282
|
if (mod != null) {
|
|
13155
|
-
for (var
|
|
13156
|
-
if (
|
|
13157
|
-
__createBinding(result, mod,
|
|
13283
|
+
for (var k3 = ownKeys(mod), i = 0;i < k3.length; i++)
|
|
13284
|
+
if (k3[i] !== "default")
|
|
13285
|
+
__createBinding(result, mod, k3[i]);
|
|
13158
13286
|
}
|
|
13159
13287
|
__setModuleDefault(result, mod);
|
|
13160
13288
|
return result;
|
|
@@ -13166,20 +13294,20 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13166
13294
|
var common_web_1 = require_dist4();
|
|
13167
13295
|
var types_1 = require_types4();
|
|
13168
13296
|
var formats = __importStar(require_formats());
|
|
13169
|
-
function validate(lexicons,
|
|
13297
|
+
function validate(lexicons, path3, def, value) {
|
|
13170
13298
|
switch (def.type) {
|
|
13171
13299
|
case "boolean":
|
|
13172
|
-
return boolean(lexicons,
|
|
13300
|
+
return boolean(lexicons, path3, def, value);
|
|
13173
13301
|
case "integer":
|
|
13174
|
-
return integer(lexicons,
|
|
13302
|
+
return integer(lexicons, path3, def, value);
|
|
13175
13303
|
case "string":
|
|
13176
|
-
return
|
|
13304
|
+
return string2(lexicons, path3, def, value);
|
|
13177
13305
|
case "bytes":
|
|
13178
|
-
return bytes(lexicons,
|
|
13306
|
+
return bytes(lexicons, path3, def, value);
|
|
13179
13307
|
case "cid-link":
|
|
13180
|
-
return cidLink(lexicons,
|
|
13308
|
+
return cidLink(lexicons, path3, def, value);
|
|
13181
13309
|
case "unknown":
|
|
13182
|
-
return unknown(lexicons,
|
|
13310
|
+
return unknown(lexicons, path3, def, value);
|
|
13183
13311
|
default:
|
|
13184
13312
|
return {
|
|
13185
13313
|
success: false,
|
|
@@ -13187,7 +13315,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13187
13315
|
};
|
|
13188
13316
|
}
|
|
13189
13317
|
}
|
|
13190
|
-
function boolean(lexicons,
|
|
13318
|
+
function boolean(lexicons, path3, def, value) {
|
|
13191
13319
|
def = def;
|
|
13192
13320
|
const type = typeof value;
|
|
13193
13321
|
if (type === "undefined") {
|
|
@@ -13196,25 +13324,25 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13196
13324
|
}
|
|
13197
13325
|
return {
|
|
13198
13326
|
success: false,
|
|
13199
|
-
error: new types_1.ValidationError(`${
|
|
13327
|
+
error: new types_1.ValidationError(`${path3} must be a boolean`)
|
|
13200
13328
|
};
|
|
13201
13329
|
} else if (type !== "boolean") {
|
|
13202
13330
|
return {
|
|
13203
13331
|
success: false,
|
|
13204
|
-
error: new types_1.ValidationError(`${
|
|
13332
|
+
error: new types_1.ValidationError(`${path3} must be a boolean`)
|
|
13205
13333
|
};
|
|
13206
13334
|
}
|
|
13207
13335
|
if (typeof def.const === "boolean") {
|
|
13208
13336
|
if (value !== def.const) {
|
|
13209
13337
|
return {
|
|
13210
13338
|
success: false,
|
|
13211
|
-
error: new types_1.ValidationError(`${
|
|
13339
|
+
error: new types_1.ValidationError(`${path3} must be ${def.const}`)
|
|
13212
13340
|
};
|
|
13213
13341
|
}
|
|
13214
13342
|
}
|
|
13215
13343
|
return { success: true, value };
|
|
13216
13344
|
}
|
|
13217
|
-
function integer(lexicons,
|
|
13345
|
+
function integer(lexicons, path3, def, value) {
|
|
13218
13346
|
def = def;
|
|
13219
13347
|
const type = typeof value;
|
|
13220
13348
|
if (type === "undefined") {
|
|
@@ -13223,19 +13351,19 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13223
13351
|
}
|
|
13224
13352
|
return {
|
|
13225
13353
|
success: false,
|
|
13226
|
-
error: new types_1.ValidationError(`${
|
|
13354
|
+
error: new types_1.ValidationError(`${path3} must be an integer`)
|
|
13227
13355
|
};
|
|
13228
13356
|
} else if (!Number.isInteger(value)) {
|
|
13229
13357
|
return {
|
|
13230
13358
|
success: false,
|
|
13231
|
-
error: new types_1.ValidationError(`${
|
|
13359
|
+
error: new types_1.ValidationError(`${path3} must be an integer`)
|
|
13232
13360
|
};
|
|
13233
13361
|
}
|
|
13234
13362
|
if (typeof def.const === "number") {
|
|
13235
13363
|
if (value !== def.const) {
|
|
13236
13364
|
return {
|
|
13237
13365
|
success: false,
|
|
13238
|
-
error: new types_1.ValidationError(`${
|
|
13366
|
+
error: new types_1.ValidationError(`${path3} must be ${def.const}`)
|
|
13239
13367
|
};
|
|
13240
13368
|
}
|
|
13241
13369
|
}
|
|
@@ -13243,7 +13371,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13243
13371
|
if (!def.enum.includes(value)) {
|
|
13244
13372
|
return {
|
|
13245
13373
|
success: false,
|
|
13246
|
-
error: new types_1.ValidationError(`${
|
|
13374
|
+
error: new types_1.ValidationError(`${path3} must be one of (${def.enum.join("|")})`)
|
|
13247
13375
|
};
|
|
13248
13376
|
}
|
|
13249
13377
|
}
|
|
@@ -13251,7 +13379,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13251
13379
|
if (value > def.maximum) {
|
|
13252
13380
|
return {
|
|
13253
13381
|
success: false,
|
|
13254
|
-
error: new types_1.ValidationError(`${
|
|
13382
|
+
error: new types_1.ValidationError(`${path3} can not be greater than ${def.maximum}`)
|
|
13255
13383
|
};
|
|
13256
13384
|
}
|
|
13257
13385
|
}
|
|
@@ -13259,13 +13387,13 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13259
13387
|
if (value < def.minimum) {
|
|
13260
13388
|
return {
|
|
13261
13389
|
success: false,
|
|
13262
|
-
error: new types_1.ValidationError(`${
|
|
13390
|
+
error: new types_1.ValidationError(`${path3} can not be less than ${def.minimum}`)
|
|
13263
13391
|
};
|
|
13264
13392
|
}
|
|
13265
13393
|
}
|
|
13266
13394
|
return { success: true, value };
|
|
13267
13395
|
}
|
|
13268
|
-
function
|
|
13396
|
+
function string2(lexicons, path3, def, value) {
|
|
13269
13397
|
def = def;
|
|
13270
13398
|
if (typeof value === "undefined") {
|
|
13271
13399
|
if (typeof def.default === "string") {
|
|
@@ -13273,19 +13401,19 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13273
13401
|
}
|
|
13274
13402
|
return {
|
|
13275
13403
|
success: false,
|
|
13276
|
-
error: new types_1.ValidationError(`${
|
|
13404
|
+
error: new types_1.ValidationError(`${path3} must be a string`)
|
|
13277
13405
|
};
|
|
13278
13406
|
} else if (typeof value !== "string") {
|
|
13279
13407
|
return {
|
|
13280
13408
|
success: false,
|
|
13281
|
-
error: new types_1.ValidationError(`${
|
|
13409
|
+
error: new types_1.ValidationError(`${path3} must be a string`)
|
|
13282
13410
|
};
|
|
13283
13411
|
}
|
|
13284
13412
|
if (typeof def.const === "string") {
|
|
13285
13413
|
if (value !== def.const) {
|
|
13286
13414
|
return {
|
|
13287
13415
|
success: false,
|
|
13288
|
-
error: new types_1.ValidationError(`${
|
|
13416
|
+
error: new types_1.ValidationError(`${path3} must be ${def.const}`)
|
|
13289
13417
|
};
|
|
13290
13418
|
}
|
|
13291
13419
|
}
|
|
@@ -13293,7 +13421,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13293
13421
|
if (!def.enum.includes(value)) {
|
|
13294
13422
|
return {
|
|
13295
13423
|
success: false,
|
|
13296
|
-
error: new types_1.ValidationError(`${
|
|
13424
|
+
error: new types_1.ValidationError(`${path3} must be one of (${def.enum.join("|")})`)
|
|
13297
13425
|
};
|
|
13298
13426
|
}
|
|
13299
13427
|
}
|
|
@@ -13301,7 +13429,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13301
13429
|
if (typeof def.minLength === "number" && value.length * 3 < def.minLength) {
|
|
13302
13430
|
return {
|
|
13303
13431
|
success: false,
|
|
13304
|
-
error: new types_1.ValidationError(`${
|
|
13432
|
+
error: new types_1.ValidationError(`${path3} must not be shorter than ${def.minLength} characters`)
|
|
13305
13433
|
};
|
|
13306
13434
|
}
|
|
13307
13435
|
let canSkipUtf8LenChecks = false;
|
|
@@ -13314,7 +13442,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13314
13442
|
if (len > def.maxLength) {
|
|
13315
13443
|
return {
|
|
13316
13444
|
success: false,
|
|
13317
|
-
error: new types_1.ValidationError(`${
|
|
13445
|
+
error: new types_1.ValidationError(`${path3} must not be longer than ${def.maxLength} characters`)
|
|
13318
13446
|
};
|
|
13319
13447
|
}
|
|
13320
13448
|
}
|
|
@@ -13322,7 +13450,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13322
13450
|
if (len < def.minLength) {
|
|
13323
13451
|
return {
|
|
13324
13452
|
success: false,
|
|
13325
|
-
error: new types_1.ValidationError(`${
|
|
13453
|
+
error: new types_1.ValidationError(`${path3} must not be shorter than ${def.minLength} characters`)
|
|
13326
13454
|
};
|
|
13327
13455
|
}
|
|
13328
13456
|
}
|
|
@@ -13342,7 +13470,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13342
13470
|
if (value.length < def.minGraphemes) {
|
|
13343
13471
|
return {
|
|
13344
13472
|
success: false,
|
|
13345
|
-
error: new types_1.ValidationError(`${
|
|
13473
|
+
error: new types_1.ValidationError(`${path3} must not be shorter than ${def.minGraphemes} graphemes`)
|
|
13346
13474
|
};
|
|
13347
13475
|
} else {
|
|
13348
13476
|
needsMinGraphemesCheck = true;
|
|
@@ -13354,7 +13482,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13354
13482
|
if (len > def.maxGraphemes) {
|
|
13355
13483
|
return {
|
|
13356
13484
|
success: false,
|
|
13357
|
-
error: new types_1.ValidationError(`${
|
|
13485
|
+
error: new types_1.ValidationError(`${path3} must not be longer than ${def.maxGraphemes} graphemes`)
|
|
13358
13486
|
};
|
|
13359
13487
|
}
|
|
13360
13488
|
}
|
|
@@ -13362,7 +13490,7 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13362
13490
|
if (len < def.minGraphemes) {
|
|
13363
13491
|
return {
|
|
13364
13492
|
success: false,
|
|
13365
|
-
error: new types_1.ValidationError(`${
|
|
13493
|
+
error: new types_1.ValidationError(`${path3} must not be shorter than ${def.minGraphemes} graphemes`)
|
|
13366
13494
|
};
|
|
13367
13495
|
}
|
|
13368
13496
|
}
|
|
@@ -13371,44 +13499,44 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13371
13499
|
if (typeof def.format === "string") {
|
|
13372
13500
|
switch (def.format) {
|
|
13373
13501
|
case "datetime":
|
|
13374
|
-
return formats.datetime(
|
|
13502
|
+
return formats.datetime(path3, value);
|
|
13375
13503
|
case "uri":
|
|
13376
|
-
return formats.uri(
|
|
13504
|
+
return formats.uri(path3, value);
|
|
13377
13505
|
case "at-uri":
|
|
13378
|
-
return formats.atUri(
|
|
13506
|
+
return formats.atUri(path3, value);
|
|
13379
13507
|
case "did":
|
|
13380
|
-
return formats.did(
|
|
13508
|
+
return formats.did(path3, value);
|
|
13381
13509
|
case "handle":
|
|
13382
|
-
return formats.handle(
|
|
13510
|
+
return formats.handle(path3, value);
|
|
13383
13511
|
case "at-identifier":
|
|
13384
|
-
return formats.atIdentifier(
|
|
13512
|
+
return formats.atIdentifier(path3, value);
|
|
13385
13513
|
case "nsid":
|
|
13386
|
-
return formats.nsid(
|
|
13514
|
+
return formats.nsid(path3, value);
|
|
13387
13515
|
case "cid":
|
|
13388
|
-
return formats.cid(
|
|
13516
|
+
return formats.cid(path3, value);
|
|
13389
13517
|
case "language":
|
|
13390
|
-
return formats.language(
|
|
13518
|
+
return formats.language(path3, value);
|
|
13391
13519
|
case "tid":
|
|
13392
|
-
return formats.tid(
|
|
13520
|
+
return formats.tid(path3, value);
|
|
13393
13521
|
case "record-key":
|
|
13394
|
-
return formats.recordKey(
|
|
13522
|
+
return formats.recordKey(path3, value);
|
|
13395
13523
|
}
|
|
13396
13524
|
}
|
|
13397
13525
|
return { success: true, value };
|
|
13398
13526
|
}
|
|
13399
|
-
function bytes(lexicons,
|
|
13527
|
+
function bytes(lexicons, path3, def, value) {
|
|
13400
13528
|
def = def;
|
|
13401
13529
|
if (!value || !(value instanceof Uint8Array)) {
|
|
13402
13530
|
return {
|
|
13403
13531
|
success: false,
|
|
13404
|
-
error: new types_1.ValidationError(`${
|
|
13532
|
+
error: new types_1.ValidationError(`${path3} must be a byte array`)
|
|
13405
13533
|
};
|
|
13406
13534
|
}
|
|
13407
13535
|
if (typeof def.maxLength === "number") {
|
|
13408
13536
|
if (value.byteLength > def.maxLength) {
|
|
13409
13537
|
return {
|
|
13410
13538
|
success: false,
|
|
13411
|
-
error: new types_1.ValidationError(`${
|
|
13539
|
+
error: new types_1.ValidationError(`${path3} must not be larger than ${def.maxLength} bytes`)
|
|
13412
13540
|
};
|
|
13413
13541
|
}
|
|
13414
13542
|
}
|
|
@@ -13416,26 +13544,26 @@ var require_primitives = __commonJS((exports) => {
|
|
|
13416
13544
|
if (value.byteLength < def.minLength) {
|
|
13417
13545
|
return {
|
|
13418
13546
|
success: false,
|
|
13419
|
-
error: new types_1.ValidationError(`${
|
|
13547
|
+
error: new types_1.ValidationError(`${path3} must not be smaller than ${def.minLength} bytes`)
|
|
13420
13548
|
};
|
|
13421
13549
|
}
|
|
13422
13550
|
}
|
|
13423
13551
|
return { success: true, value };
|
|
13424
13552
|
}
|
|
13425
|
-
function cidLink(lexicons,
|
|
13553
|
+
function cidLink(lexicons, path3, def, value) {
|
|
13426
13554
|
if (cid_1.CID.asCID(value) === null) {
|
|
13427
13555
|
return {
|
|
13428
13556
|
success: false,
|
|
13429
|
-
error: new types_1.ValidationError(`${
|
|
13557
|
+
error: new types_1.ValidationError(`${path3} must be a CID`)
|
|
13430
13558
|
};
|
|
13431
13559
|
}
|
|
13432
13560
|
return { success: true, value };
|
|
13433
13561
|
}
|
|
13434
|
-
function unknown(lexicons,
|
|
13562
|
+
function unknown(lexicons, path3, def, value) {
|
|
13435
13563
|
if (!value || typeof value !== "object") {
|
|
13436
13564
|
return {
|
|
13437
13565
|
success: false,
|
|
13438
|
-
error: new types_1.ValidationError(`${
|
|
13566
|
+
error: new types_1.ValidationError(`${path3} must be an object`)
|
|
13439
13567
|
};
|
|
13440
13568
|
}
|
|
13441
13569
|
return { success: true, value };
|
|
@@ -13453,30 +13581,30 @@ var require_complex = __commonJS((exports) => {
|
|
|
13453
13581
|
var util_1 = require_util3();
|
|
13454
13582
|
var blob_1 = require_blob3();
|
|
13455
13583
|
var primitives_1 = require_primitives();
|
|
13456
|
-
function validate(lexicons,
|
|
13584
|
+
function validate(lexicons, path3, def, value) {
|
|
13457
13585
|
switch (def.type) {
|
|
13458
13586
|
case "object":
|
|
13459
|
-
return object(lexicons,
|
|
13587
|
+
return object(lexicons, path3, def, value);
|
|
13460
13588
|
case "array":
|
|
13461
|
-
return array(lexicons,
|
|
13589
|
+
return array(lexicons, path3, def, value);
|
|
13462
13590
|
case "blob":
|
|
13463
|
-
return (0, blob_1.blob)(lexicons,
|
|
13591
|
+
return (0, blob_1.blob)(lexicons, path3, def, value);
|
|
13464
13592
|
default:
|
|
13465
|
-
return (0, primitives_1.validate)(lexicons,
|
|
13593
|
+
return (0, primitives_1.validate)(lexicons, path3, def, value);
|
|
13466
13594
|
}
|
|
13467
13595
|
}
|
|
13468
|
-
function array(lexicons,
|
|
13596
|
+
function array(lexicons, path3, def, value) {
|
|
13469
13597
|
if (!Array.isArray(value)) {
|
|
13470
13598
|
return {
|
|
13471
13599
|
success: false,
|
|
13472
|
-
error: new types_1.ValidationError(`${
|
|
13600
|
+
error: new types_1.ValidationError(`${path3} must be an array`)
|
|
13473
13601
|
};
|
|
13474
13602
|
}
|
|
13475
13603
|
if (typeof def.maxLength === "number") {
|
|
13476
13604
|
if (value.length > def.maxLength) {
|
|
13477
13605
|
return {
|
|
13478
13606
|
success: false,
|
|
13479
|
-
error: new types_1.ValidationError(`${
|
|
13607
|
+
error: new types_1.ValidationError(`${path3} must not have more than ${def.maxLength} elements`)
|
|
13480
13608
|
};
|
|
13481
13609
|
}
|
|
13482
13610
|
}
|
|
@@ -13484,14 +13612,14 @@ var require_complex = __commonJS((exports) => {
|
|
|
13484
13612
|
if (value.length < def.minLength) {
|
|
13485
13613
|
return {
|
|
13486
13614
|
success: false,
|
|
13487
|
-
error: new types_1.ValidationError(`${
|
|
13615
|
+
error: new types_1.ValidationError(`${path3} must not have fewer than ${def.minLength} elements`)
|
|
13488
13616
|
};
|
|
13489
13617
|
}
|
|
13490
13618
|
}
|
|
13491
13619
|
const itemsDef = def.items;
|
|
13492
13620
|
for (let i = 0;i < value.length; i++) {
|
|
13493
13621
|
const itemValue = value[i];
|
|
13494
|
-
const itemPath = `${
|
|
13622
|
+
const itemPath = `${path3}/${i}`;
|
|
13495
13623
|
const res = validateOneOf(lexicons, itemPath, itemsDef, itemValue);
|
|
13496
13624
|
if (!res.success) {
|
|
13497
13625
|
return res;
|
|
@@ -13499,11 +13627,11 @@ var require_complex = __commonJS((exports) => {
|
|
|
13499
13627
|
}
|
|
13500
13628
|
return { success: true, value };
|
|
13501
13629
|
}
|
|
13502
|
-
function object(lexicons,
|
|
13630
|
+
function object(lexicons, path3, def, value) {
|
|
13503
13631
|
if (!(0, types_1.isObj)(value)) {
|
|
13504
13632
|
return {
|
|
13505
13633
|
success: false,
|
|
13506
|
-
error: new types_1.ValidationError(`${
|
|
13634
|
+
error: new types_1.ValidationError(`${path3} must be an object`)
|
|
13507
13635
|
};
|
|
13508
13636
|
}
|
|
13509
13637
|
let resultValue = value;
|
|
@@ -13523,14 +13651,14 @@ var require_complex = __commonJS((exports) => {
|
|
|
13523
13651
|
continue;
|
|
13524
13652
|
}
|
|
13525
13653
|
}
|
|
13526
|
-
const propPath = `${
|
|
13654
|
+
const propPath = `${path3}/${key}`;
|
|
13527
13655
|
const validated = validateOneOf(lexicons, propPath, propDef, keyValue);
|
|
13528
13656
|
const propValue = validated.success ? validated.value : keyValue;
|
|
13529
13657
|
if (propValue === undefined) {
|
|
13530
13658
|
if (def.required?.includes(key)) {
|
|
13531
13659
|
return {
|
|
13532
13660
|
success: false,
|
|
13533
|
-
error: new types_1.ValidationError(`${
|
|
13661
|
+
error: new types_1.ValidationError(`${path3} must have the property "${key}"`)
|
|
13534
13662
|
};
|
|
13535
13663
|
}
|
|
13536
13664
|
} else {
|
|
@@ -13548,20 +13676,20 @@ var require_complex = __commonJS((exports) => {
|
|
|
13548
13676
|
}
|
|
13549
13677
|
return { success: true, value: resultValue };
|
|
13550
13678
|
}
|
|
13551
|
-
function validateOneOf(lexicons,
|
|
13679
|
+
function validateOneOf(lexicons, path3, def, value, mustBeObj = false) {
|
|
13552
13680
|
let concreteDef;
|
|
13553
13681
|
if (def.type === "union") {
|
|
13554
13682
|
if (!(0, types_1.isDiscriminatedObject)(value)) {
|
|
13555
13683
|
return {
|
|
13556
13684
|
success: false,
|
|
13557
|
-
error: new types_1.ValidationError(`${
|
|
13685
|
+
error: new types_1.ValidationError(`${path3} must be an object which includes the "$type" property`)
|
|
13558
13686
|
};
|
|
13559
13687
|
}
|
|
13560
13688
|
if (!refsContainType(def.refs, value.$type)) {
|
|
13561
13689
|
if (def.closed) {
|
|
13562
13690
|
return {
|
|
13563
13691
|
success: false,
|
|
13564
|
-
error: new types_1.ValidationError(`${
|
|
13692
|
+
error: new types_1.ValidationError(`${path3} $type must be one of ${def.refs.join(", ")}`)
|
|
13565
13693
|
};
|
|
13566
13694
|
}
|
|
13567
13695
|
return { success: true, value };
|
|
@@ -13573,7 +13701,7 @@ var require_complex = __commonJS((exports) => {
|
|
|
13573
13701
|
} else {
|
|
13574
13702
|
concreteDef = def;
|
|
13575
13703
|
}
|
|
13576
|
-
return mustBeObj ? object(lexicons,
|
|
13704
|
+
return mustBeObj ? object(lexicons, path3, concreteDef, value) : validate(lexicons, path3, concreteDef, value);
|
|
13577
13705
|
}
|
|
13578
13706
|
var refsContainType = (refs, type) => {
|
|
13579
13707
|
const lexUri = (0, util_1.toLexUri)(type);
|
|
@@ -13590,20 +13718,20 @@ var require_complex = __commonJS((exports) => {
|
|
|
13590
13718
|
|
|
13591
13719
|
// ../../node_modules/.bun/@atproto+lexicon@0.6.1/node_modules/@atproto/lexicon/dist/validators/xrpc.js
|
|
13592
13720
|
var require_xrpc = __commonJS((exports) => {
|
|
13593
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
13594
|
-
if (
|
|
13595
|
-
|
|
13596
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
13721
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
13722
|
+
if (k22 === undefined)
|
|
13723
|
+
k22 = k3;
|
|
13724
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
13597
13725
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13598
13726
|
desc = { enumerable: true, get: function() {
|
|
13599
|
-
return m[
|
|
13727
|
+
return m[k3];
|
|
13600
13728
|
} };
|
|
13601
13729
|
}
|
|
13602
|
-
Object.defineProperty(o,
|
|
13603
|
-
} : function(o, m,
|
|
13604
|
-
if (
|
|
13605
|
-
|
|
13606
|
-
o[
|
|
13730
|
+
Object.defineProperty(o, k22, desc);
|
|
13731
|
+
} : function(o, m, k3, k22) {
|
|
13732
|
+
if (k22 === undefined)
|
|
13733
|
+
k22 = k3;
|
|
13734
|
+
o[k22] = m[k3];
|
|
13607
13735
|
});
|
|
13608
13736
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
13609
13737
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
@@ -13614,9 +13742,9 @@ var require_xrpc = __commonJS((exports) => {
|
|
|
13614
13742
|
var ownKeys = function(o) {
|
|
13615
13743
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
13616
13744
|
var ar = [];
|
|
13617
|
-
for (var
|
|
13618
|
-
if (Object.prototype.hasOwnProperty.call(o2,
|
|
13619
|
-
ar[ar.length] =
|
|
13745
|
+
for (var k3 in o2)
|
|
13746
|
+
if (Object.prototype.hasOwnProperty.call(o2, k3))
|
|
13747
|
+
ar[ar.length] = k3;
|
|
13620
13748
|
return ar;
|
|
13621
13749
|
};
|
|
13622
13750
|
return ownKeys(o);
|
|
@@ -13626,9 +13754,9 @@ var require_xrpc = __commonJS((exports) => {
|
|
|
13626
13754
|
return mod;
|
|
13627
13755
|
var result = {};
|
|
13628
13756
|
if (mod != null) {
|
|
13629
|
-
for (var
|
|
13630
|
-
if (
|
|
13631
|
-
__createBinding(result, mod,
|
|
13757
|
+
for (var k3 = ownKeys(mod), i = 0;i < k3.length; i++)
|
|
13758
|
+
if (k3[i] !== "default")
|
|
13759
|
+
__createBinding(result, mod, k3[i]);
|
|
13632
13760
|
}
|
|
13633
13761
|
__setModuleDefault(result, mod);
|
|
13634
13762
|
return result;
|
|
@@ -13639,7 +13767,7 @@ var require_xrpc = __commonJS((exports) => {
|
|
|
13639
13767
|
var types_1 = require_types4();
|
|
13640
13768
|
var complex_1 = require_complex();
|
|
13641
13769
|
var PrimitiveValidators = __importStar(require_primitives());
|
|
13642
|
-
function params(lexicons,
|
|
13770
|
+
function params(lexicons, path3, def, val) {
|
|
13643
13771
|
const value = val && typeof val === "object" ? val : {};
|
|
13644
13772
|
const requiredProps = new Set(def.required ?? []);
|
|
13645
13773
|
let resultValue = value;
|
|
@@ -13652,7 +13780,7 @@ var require_xrpc = __commonJS((exports) => {
|
|
|
13652
13780
|
if (propIsUndefined && requiredProps.has(key)) {
|
|
13653
13781
|
return {
|
|
13654
13782
|
success: false,
|
|
13655
|
-
error: new types_1.ValidationError(`${
|
|
13783
|
+
error: new types_1.ValidationError(`${path3} must have the property "${key}"`)
|
|
13656
13784
|
};
|
|
13657
13785
|
} else if (!propIsUndefined && !validated.success) {
|
|
13658
13786
|
return validated;
|
|
@@ -13708,8 +13836,8 @@ var require_validation = __commonJS((exports) => {
|
|
|
13708
13836
|
return assertValidOneOf(lexicons, "Message", def.message.schema, value, true);
|
|
13709
13837
|
}
|
|
13710
13838
|
}
|
|
13711
|
-
function assertValidOneOf(lexicons,
|
|
13712
|
-
const res = (0, complex_1.validateOneOf)(lexicons,
|
|
13839
|
+
function assertValidOneOf(lexicons, path3, def, value, mustBeObj = false) {
|
|
13840
|
+
const res = (0, complex_1.validateOneOf)(lexicons, path3, def, value, mustBeObj);
|
|
13713
13841
|
if (!res.success)
|
|
13714
13842
|
throw res.error;
|
|
13715
13843
|
return res.value;
|
|
@@ -13859,13 +13987,13 @@ var require_lexicons = __commonJS((exports) => {
|
|
|
13859
13987
|
}
|
|
13860
13988
|
}
|
|
13861
13989
|
function resolveRefUris(obj, baseUri) {
|
|
13862
|
-
for (const
|
|
13990
|
+
for (const k3 in obj) {
|
|
13863
13991
|
if (obj.type === "ref") {
|
|
13864
13992
|
obj.ref = (0, util_1.toLexUri)(obj.ref, baseUri);
|
|
13865
13993
|
} else if (obj.type === "union") {
|
|
13866
13994
|
obj.refs = obj.refs.map((ref) => (0, util_1.toLexUri)(ref, baseUri));
|
|
13867
|
-
} else if (Array.isArray(obj[
|
|
13868
|
-
obj[
|
|
13995
|
+
} else if (Array.isArray(obj[k3])) {
|
|
13996
|
+
obj[k3] = obj[k3].map((item) => {
|
|
13869
13997
|
if (typeof item === "string") {
|
|
13870
13998
|
return item.startsWith("#") ? (0, util_1.toLexUri)(item, baseUri) : item;
|
|
13871
13999
|
} else if (item && typeof item === "object") {
|
|
@@ -13873,8 +14001,8 @@ var require_lexicons = __commonJS((exports) => {
|
|
|
13873
14001
|
}
|
|
13874
14002
|
return item;
|
|
13875
14003
|
});
|
|
13876
|
-
} else if (obj[
|
|
13877
|
-
obj[
|
|
14004
|
+
} else if (obj[k3] && typeof obj[k3] === "object") {
|
|
14005
|
+
obj[k3] = resolveRefUris(obj[k3], baseUri);
|
|
13878
14006
|
}
|
|
13879
14007
|
}
|
|
13880
14008
|
return obj;
|
|
@@ -13948,20 +14076,20 @@ var require_serialize = __commonJS((exports) => {
|
|
|
13948
14076
|
|
|
13949
14077
|
// ../../node_modules/.bun/@atproto+lexicon@0.6.1/node_modules/@atproto/lexicon/dist/index.js
|
|
13950
14078
|
var require_dist6 = __commonJS((exports) => {
|
|
13951
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
13952
|
-
if (
|
|
13953
|
-
|
|
13954
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
14079
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
14080
|
+
if (k22 === undefined)
|
|
14081
|
+
k22 = k3;
|
|
14082
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
13955
14083
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13956
14084
|
desc = { enumerable: true, get: function() {
|
|
13957
|
-
return m[
|
|
14085
|
+
return m[k3];
|
|
13958
14086
|
} };
|
|
13959
14087
|
}
|
|
13960
|
-
Object.defineProperty(o,
|
|
13961
|
-
} : function(o, m,
|
|
13962
|
-
if (
|
|
13963
|
-
|
|
13964
|
-
o[
|
|
14088
|
+
Object.defineProperty(o, k22, desc);
|
|
14089
|
+
} : function(o, m, k3, k22) {
|
|
14090
|
+
if (k22 === undefined)
|
|
14091
|
+
k22 = k3;
|
|
14092
|
+
o[k22] = m[k3];
|
|
13965
14093
|
});
|
|
13966
14094
|
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
13967
14095
|
for (var p in m)
|
|
@@ -34807,7 +34935,7 @@ var require_client = __commonJS((exports) => {
|
|
|
34807
34935
|
get fetch() {
|
|
34808
34936
|
throw new Error("Client.fetch is no longer supported. Use an XrpcClient instead.");
|
|
34809
34937
|
}
|
|
34810
|
-
set fetch(
|
|
34938
|
+
set fetch(_2) {
|
|
34811
34939
|
throw new Error("Client.fetch is no longer supported. Use an XrpcClient instead.");
|
|
34812
34940
|
}
|
|
34813
34941
|
async call(serviceUri, methodNsid, params, data, opts) {
|
|
@@ -34856,20 +34984,20 @@ var require_client = __commonJS((exports) => {
|
|
|
34856
34984
|
|
|
34857
34985
|
// ../../node_modules/.bun/@atproto+xrpc@0.7.7/node_modules/@atproto/xrpc/dist/index.js
|
|
34858
34986
|
var require_dist7 = __commonJS((exports) => {
|
|
34859
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
34860
|
-
if (
|
|
34861
|
-
|
|
34862
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
34987
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
34988
|
+
if (k22 === undefined)
|
|
34989
|
+
k22 = k3;
|
|
34990
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
34863
34991
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
34864
34992
|
desc = { enumerable: true, get: function() {
|
|
34865
|
-
return m[
|
|
34993
|
+
return m[k3];
|
|
34866
34994
|
} };
|
|
34867
34995
|
}
|
|
34868
|
-
Object.defineProperty(o,
|
|
34869
|
-
} : function(o, m,
|
|
34870
|
-
if (
|
|
34871
|
-
|
|
34872
|
-
o[
|
|
34996
|
+
Object.defineProperty(o, k22, desc);
|
|
34997
|
+
} : function(o, m, k3, k22) {
|
|
34998
|
+
if (k22 === undefined)
|
|
34999
|
+
k22 = k3;
|
|
35000
|
+
o[k22] = m[k3];
|
|
34873
35001
|
});
|
|
34874
35002
|
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
34875
35003
|
for (var p in m)
|
|
@@ -43384,20 +43512,20 @@ var require_revokeVerifications = __commonJS((exports) => {
|
|
|
43384
43512
|
|
|
43385
43513
|
// ../../node_modules/.bun/@atproto+api@0.18.17/node_modules/@atproto/api/dist/client/index.js
|
|
43386
43514
|
var require_client2 = __commonJS((exports) => {
|
|
43387
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
43388
|
-
if (
|
|
43389
|
-
|
|
43390
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
43515
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
43516
|
+
if (k22 === undefined)
|
|
43517
|
+
k22 = k3;
|
|
43518
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
43391
43519
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
43392
43520
|
desc = { enumerable: true, get: function() {
|
|
43393
|
-
return m[
|
|
43521
|
+
return m[k3];
|
|
43394
43522
|
} };
|
|
43395
43523
|
}
|
|
43396
|
-
Object.defineProperty(o,
|
|
43397
|
-
} : function(o, m,
|
|
43398
|
-
if (
|
|
43399
|
-
|
|
43400
|
-
o[
|
|
43524
|
+
Object.defineProperty(o, k22, desc);
|
|
43525
|
+
} : function(o, m, k3, k22) {
|
|
43526
|
+
if (k22 === undefined)
|
|
43527
|
+
k22 = k3;
|
|
43528
|
+
o[k22] = m[k3];
|
|
43401
43529
|
});
|
|
43402
43530
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
43403
43531
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
@@ -43408,9 +43536,9 @@ var require_client2 = __commonJS((exports) => {
|
|
|
43408
43536
|
var ownKeys = function(o) {
|
|
43409
43537
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
43410
43538
|
var ar = [];
|
|
43411
|
-
for (var
|
|
43412
|
-
if (Object.prototype.hasOwnProperty.call(o2,
|
|
43413
|
-
ar[ar.length] =
|
|
43539
|
+
for (var k3 in o2)
|
|
43540
|
+
if (Object.prototype.hasOwnProperty.call(o2, k3))
|
|
43541
|
+
ar[ar.length] = k3;
|
|
43414
43542
|
return ar;
|
|
43415
43543
|
};
|
|
43416
43544
|
return ownKeys(o);
|
|
@@ -43420,9 +43548,9 @@ var require_client2 = __commonJS((exports) => {
|
|
|
43420
43548
|
return mod;
|
|
43421
43549
|
var result = {};
|
|
43422
43550
|
if (mod != null) {
|
|
43423
|
-
for (var
|
|
43424
|
-
if (
|
|
43425
|
-
__createBinding(result, mod,
|
|
43551
|
+
for (var k3 = ownKeys(mod), i = 0;i < k3.length; i++)
|
|
43552
|
+
if (k3[i] !== "default")
|
|
43553
|
+
__createBinding(result, mod, k3[i]);
|
|
43426
43554
|
}
|
|
43427
43555
|
__setModuleDefault(result, mod);
|
|
43428
43556
|
return result;
|
|
@@ -48152,8 +48280,8 @@ var require_detection = __commonJS((exports) => {
|
|
|
48152
48280
|
let match;
|
|
48153
48281
|
const facets = [];
|
|
48154
48282
|
{
|
|
48155
|
-
const
|
|
48156
|
-
while (match =
|
|
48283
|
+
const re2 = util_1.MENTION_REGEX;
|
|
48284
|
+
while (match = re2.exec(text.utf16)) {
|
|
48157
48285
|
if (!isValidDomain(match[3]) && !match[3].endsWith(".test")) {
|
|
48158
48286
|
continue;
|
|
48159
48287
|
}
|
|
@@ -48174,8 +48302,8 @@ var require_detection = __commonJS((exports) => {
|
|
|
48174
48302
|
}
|
|
48175
48303
|
}
|
|
48176
48304
|
{
|
|
48177
|
-
const
|
|
48178
|
-
while (match =
|
|
48305
|
+
const re2 = util_1.URL_REGEX;
|
|
48306
|
+
while (match = re2.exec(text.utf16)) {
|
|
48179
48307
|
let uri = match[2];
|
|
48180
48308
|
if (!uri.startsWith("http")) {
|
|
48181
48309
|
const domain = match.groups?.domain;
|
|
@@ -48209,8 +48337,8 @@ var require_detection = __commonJS((exports) => {
|
|
|
48209
48337
|
}
|
|
48210
48338
|
}
|
|
48211
48339
|
{
|
|
48212
|
-
const
|
|
48213
|
-
while (match =
|
|
48340
|
+
const re2 = util_1.TAG_REGEX;
|
|
48341
|
+
while (match = re2.exec(text.utf16)) {
|
|
48214
48342
|
const leading = match[1];
|
|
48215
48343
|
let tag = match[2];
|
|
48216
48344
|
if (!tag)
|
|
@@ -48234,8 +48362,8 @@ var require_detection = __commonJS((exports) => {
|
|
|
48234
48362
|
}
|
|
48235
48363
|
}
|
|
48236
48364
|
{
|
|
48237
|
-
const
|
|
48238
|
-
while (match =
|
|
48365
|
+
const re2 = util_1.CASHTAG_REGEX;
|
|
48366
|
+
while (match = re2.exec(text.utf16)) {
|
|
48239
48367
|
const leading = match[1];
|
|
48240
48368
|
let ticker = match[2];
|
|
48241
48369
|
if (!ticker)
|
|
@@ -48524,7 +48652,7 @@ var require_rich_text = __commonJS((exports) => {
|
|
|
48524
48652
|
for (const facet of this.facets) {
|
|
48525
48653
|
for (const feature of facet.features) {
|
|
48526
48654
|
if (client_1.AppBskyRichtextFacet.isMention(feature)) {
|
|
48527
|
-
promises.push(agent.com.atproto.identity.resolveHandle({ handle: feature.did }).then((res) => res?.data.did).catch((
|
|
48655
|
+
promises.push(agent.com.atproto.identity.resolveHandle({ handle: feature.did }).then((res) => res?.data.did).catch((_2) => {
|
|
48528
48656
|
return;
|
|
48529
48657
|
}).then((did) => {
|
|
48530
48658
|
feature.did = did || "";
|
|
@@ -49314,7 +49442,7 @@ var require_mutewords = __commonJS((exports) => {
|
|
|
49314
49442
|
];
|
|
49315
49443
|
function matchMuteWords({ mutedWords, text, facets, outlineTags, languages, actor }) {
|
|
49316
49444
|
const exception = LANGUAGE_EXCEPTIONS.includes(languages?.[0] || "");
|
|
49317
|
-
const tags = [].concat(outlineTags || []).concat((facets || []).flatMap((facet) => facet.features.filter(client_1.AppBskyRichtextFacet.isTag).map((tag) => tag.tag))).map((
|
|
49445
|
+
const tags = [].concat(outlineTags || []).concat((facets || []).flatMap((facet) => facet.features.filter(client_1.AppBskyRichtextFacet.isTag).map((tag) => tag.tag))).map((t2) => t2.toLowerCase());
|
|
49318
49446
|
const matches = [];
|
|
49319
49447
|
outer:
|
|
49320
49448
|
for (const muteWord of mutedWords) {
|
|
@@ -50055,7 +50183,7 @@ var require_AwaitLock = __commonJS((exports) => {
|
|
|
50055
50183
|
};
|
|
50056
50184
|
__classPrivateFieldGet(this, _AwaitLock_waitingResolvers, "f").add(resolver);
|
|
50057
50185
|
}),
|
|
50058
|
-
new Promise((
|
|
50186
|
+
new Promise((_2, reject) => {
|
|
50059
50187
|
timer = setTimeout(() => {
|
|
50060
50188
|
__classPrivateFieldGet(this, _AwaitLock_waitingResolvers, "f").delete(resolver);
|
|
50061
50189
|
reject(new Error(`Timed out waiting for lock`));
|
|
@@ -50114,20 +50242,20 @@ var require_predicate = __commonJS((exports) => {
|
|
|
50114
50242
|
|
|
50115
50243
|
// ../../node_modules/.bun/@atproto+api@0.18.17/node_modules/@atproto/api/dist/agent.js
|
|
50116
50244
|
var require_agent = __commonJS((exports) => {
|
|
50117
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
50118
|
-
if (
|
|
50119
|
-
|
|
50120
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
50245
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
50246
|
+
if (k22 === undefined)
|
|
50247
|
+
k22 = k3;
|
|
50248
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
50121
50249
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
50122
50250
|
desc = { enumerable: true, get: function() {
|
|
50123
|
-
return m[
|
|
50251
|
+
return m[k3];
|
|
50124
50252
|
} };
|
|
50125
50253
|
}
|
|
50126
|
-
Object.defineProperty(o,
|
|
50127
|
-
} : function(o, m,
|
|
50128
|
-
if (
|
|
50129
|
-
|
|
50130
|
-
o[
|
|
50254
|
+
Object.defineProperty(o, k22, desc);
|
|
50255
|
+
} : function(o, m, k3, k22) {
|
|
50256
|
+
if (k22 === undefined)
|
|
50257
|
+
k22 = k3;
|
|
50258
|
+
o[k22] = m[k3];
|
|
50131
50259
|
});
|
|
50132
50260
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
50133
50261
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
@@ -50138,9 +50266,9 @@ var require_agent = __commonJS((exports) => {
|
|
|
50138
50266
|
var ownKeys = function(o) {
|
|
50139
50267
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
50140
50268
|
var ar = [];
|
|
50141
|
-
for (var
|
|
50142
|
-
if (Object.prototype.hasOwnProperty.call(o2,
|
|
50143
|
-
ar[ar.length] =
|
|
50269
|
+
for (var k3 in o2)
|
|
50270
|
+
if (Object.prototype.hasOwnProperty.call(o2, k3))
|
|
50271
|
+
ar[ar.length] = k3;
|
|
50144
50272
|
return ar;
|
|
50145
50273
|
};
|
|
50146
50274
|
return ownKeys(o);
|
|
@@ -50150,9 +50278,9 @@ var require_agent = __commonJS((exports) => {
|
|
|
50150
50278
|
return mod;
|
|
50151
50279
|
var result = {};
|
|
50152
50280
|
if (mod != null) {
|
|
50153
|
-
for (var
|
|
50154
|
-
if (
|
|
50155
|
-
__createBinding(result, mod,
|
|
50281
|
+
for (var k3 = ownKeys(mod), i = 0;i < k3.length; i++)
|
|
50282
|
+
if (k3[i] !== "default")
|
|
50283
|
+
__createBinding(result, mod, k3[i]);
|
|
50156
50284
|
}
|
|
50157
50285
|
__setModuleDefault(result, mod);
|
|
50158
50286
|
return result;
|
|
@@ -50531,7 +50659,7 @@ var require_agent = __commonJS((exports) => {
|
|
|
50531
50659
|
const upsert = async () => {
|
|
50532
50660
|
const repo = this.assertDid;
|
|
50533
50661
|
const collection = "app.bsky.actor.profile";
|
|
50534
|
-
const existing = await this.com.atproto.repo.getRecord({ repo, collection, rkey: "self" }).catch((
|
|
50662
|
+
const existing = await this.com.atproto.repo.getRecord({ repo, collection, rkey: "self" }).catch((_2) => {
|
|
50535
50663
|
return;
|
|
50536
50664
|
});
|
|
50537
50665
|
const existingRecord = existing && predicate.isValidProfile(existing.data.value) ? existing.data.value : undefined;
|
|
@@ -50659,16 +50787,16 @@ var require_agent = __commonJS((exports) => {
|
|
|
50659
50787
|
prefs.birthDate = new Date(pref.birthDate);
|
|
50660
50788
|
}
|
|
50661
50789
|
} else if (predicate.isValidDeclaredAgePref(pref)) {
|
|
50662
|
-
const { $type:
|
|
50790
|
+
const { $type: _2, ...declaredAgePref } = pref;
|
|
50663
50791
|
prefs.declaredAge = declaredAgePref;
|
|
50664
50792
|
} else if (predicate.isValidFeedViewPref(pref)) {
|
|
50665
|
-
const { $type:
|
|
50793
|
+
const { $type: _2, feed, ...v } = pref;
|
|
50666
50794
|
prefs.feedViewPrefs[feed] = { ...FEED_VIEW_PREF_DEFAULTS, ...v };
|
|
50667
50795
|
} else if (predicate.isValidThreadViewPref(pref)) {
|
|
50668
|
-
const { $type:
|
|
50796
|
+
const { $type: _2, ...v } = pref;
|
|
50669
50797
|
prefs.threadViewPrefs = { ...prefs.threadViewPrefs, ...v };
|
|
50670
50798
|
} else if (predicate.isValidInterestsPref(pref)) {
|
|
50671
|
-
const { $type:
|
|
50799
|
+
const { $type: _2, ...v } = pref;
|
|
50672
50800
|
prefs.interests = { ...prefs.interests, ...v };
|
|
50673
50801
|
} else if (predicate.isValidMutedWordsPref(pref)) {
|
|
50674
50802
|
prefs.moderationPrefs.mutedWords = pref.items;
|
|
@@ -51655,20 +51783,20 @@ var require_bsky_agent = __commonJS((exports) => {
|
|
|
51655
51783
|
|
|
51656
51784
|
// ../../node_modules/.bun/@atproto+api@0.18.17/node_modules/@atproto/api/dist/index.js
|
|
51657
51785
|
var require_dist8 = __commonJS((exports) => {
|
|
51658
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m,
|
|
51659
|
-
if (
|
|
51660
|
-
|
|
51661
|
-
var desc = Object.getOwnPropertyDescriptor(m,
|
|
51786
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k3, k22) {
|
|
51787
|
+
if (k22 === undefined)
|
|
51788
|
+
k22 = k3;
|
|
51789
|
+
var desc = Object.getOwnPropertyDescriptor(m, k3);
|
|
51662
51790
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
51663
51791
|
desc = { enumerable: true, get: function() {
|
|
51664
|
-
return m[
|
|
51792
|
+
return m[k3];
|
|
51665
51793
|
} };
|
|
51666
51794
|
}
|
|
51667
|
-
Object.defineProperty(o,
|
|
51668
|
-
} : function(o, m,
|
|
51669
|
-
if (
|
|
51670
|
-
|
|
51671
|
-
o[
|
|
51795
|
+
Object.defineProperty(o, k22, desc);
|
|
51796
|
+
} : function(o, m, k3, k22) {
|
|
51797
|
+
if (k22 === undefined)
|
|
51798
|
+
k22 = k3;
|
|
51799
|
+
o[k22] = m[k3];
|
|
51672
51800
|
});
|
|
51673
51801
|
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
51674
51802
|
for (var p in m)
|
|
@@ -51753,134 +51881,6 @@ var require_dist8 = __commonJS((exports) => {
|
|
|
51753
51881
|
exports.lexicons = new lexicon_1.Lexicons(lexicons_1.lexicons);
|
|
51754
51882
|
});
|
|
51755
51883
|
|
|
51756
|
-
// ../../node_modules/.bun/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
51757
|
-
var require_picocolors = __commonJS((exports, module) => {
|
|
51758
|
-
var p = process || {};
|
|
51759
|
-
var argv = p.argv || [];
|
|
51760
|
-
var env2 = p.env || {};
|
|
51761
|
-
var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
|
|
51762
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
51763
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
51764
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
51765
|
-
};
|
|
51766
|
-
var replaceClose = (string, close, replace, index) => {
|
|
51767
|
-
let result = "", cursor = 0;
|
|
51768
|
-
do {
|
|
51769
|
-
result += string.substring(cursor, index) + replace;
|
|
51770
|
-
cursor = index + close.length;
|
|
51771
|
-
index = string.indexOf(close, cursor);
|
|
51772
|
-
} while (~index);
|
|
51773
|
-
return result + string.substring(cursor);
|
|
51774
|
-
};
|
|
51775
|
-
var createColors = (enabled = isColorSupported) => {
|
|
51776
|
-
let f = enabled ? formatter : () => String;
|
|
51777
|
-
return {
|
|
51778
|
-
isColorSupported: enabled,
|
|
51779
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
51780
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
51781
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
51782
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
51783
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
51784
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
51785
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
51786
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
51787
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
51788
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
51789
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
51790
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
51791
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
51792
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
51793
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
51794
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
51795
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
51796
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
51797
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
51798
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
51799
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
51800
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
51801
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
51802
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
51803
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
51804
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
51805
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
51806
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
51807
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
51808
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
51809
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
51810
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
51811
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
51812
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
51813
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
51814
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
51815
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
51816
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
51817
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
51818
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
51819
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
51820
|
-
};
|
|
51821
|
-
};
|
|
51822
|
-
module.exports = createColors();
|
|
51823
|
-
module.exports.createColors = createColors;
|
|
51824
|
-
});
|
|
51825
|
-
|
|
51826
|
-
// ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
51827
|
-
var require_src3 = __commonJS((exports, module) => {
|
|
51828
|
-
var ESC = "\x1B";
|
|
51829
|
-
var CSI = `${ESC}[`;
|
|
51830
|
-
var beep = "\x07";
|
|
51831
|
-
var cursor = {
|
|
51832
|
-
to(x, y) {
|
|
51833
|
-
if (!y)
|
|
51834
|
-
return `${CSI}${x + 1}G`;
|
|
51835
|
-
return `${CSI}${y + 1};${x + 1}H`;
|
|
51836
|
-
},
|
|
51837
|
-
move(x, y) {
|
|
51838
|
-
let ret = "";
|
|
51839
|
-
if (x < 0)
|
|
51840
|
-
ret += `${CSI}${-x}D`;
|
|
51841
|
-
else if (x > 0)
|
|
51842
|
-
ret += `${CSI}${x}C`;
|
|
51843
|
-
if (y < 0)
|
|
51844
|
-
ret += `${CSI}${-y}A`;
|
|
51845
|
-
else if (y > 0)
|
|
51846
|
-
ret += `${CSI}${y}B`;
|
|
51847
|
-
return ret;
|
|
51848
|
-
},
|
|
51849
|
-
up: (count = 1) => `${CSI}${count}A`,
|
|
51850
|
-
down: (count = 1) => `${CSI}${count}B`,
|
|
51851
|
-
forward: (count = 1) => `${CSI}${count}C`,
|
|
51852
|
-
backward: (count = 1) => `${CSI}${count}D`,
|
|
51853
|
-
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
51854
|
-
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
51855
|
-
left: `${CSI}G`,
|
|
51856
|
-
hide: `${CSI}?25l`,
|
|
51857
|
-
show: `${CSI}?25h`,
|
|
51858
|
-
save: `${ESC}7`,
|
|
51859
|
-
restore: `${ESC}8`
|
|
51860
|
-
};
|
|
51861
|
-
var scroll = {
|
|
51862
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
51863
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
51864
|
-
};
|
|
51865
|
-
var erase = {
|
|
51866
|
-
screen: `${CSI}2J`,
|
|
51867
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
51868
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
51869
|
-
line: `${CSI}2K`,
|
|
51870
|
-
lineEnd: `${CSI}K`,
|
|
51871
|
-
lineStart: `${CSI}1K`,
|
|
51872
|
-
lines(count) {
|
|
51873
|
-
let clear = "";
|
|
51874
|
-
for (let i = 0;i < count; i++)
|
|
51875
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
51876
|
-
if (count)
|
|
51877
|
-
clear += cursor.left;
|
|
51878
|
-
return clear;
|
|
51879
|
-
}
|
|
51880
|
-
};
|
|
51881
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
51882
|
-
});
|
|
51883
|
-
|
|
51884
51884
|
// ../../node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/db.json
|
|
51885
51885
|
var require_db = __commonJS((exports, module) => {
|
|
51886
51886
|
module.exports = {
|
|
@@ -61094,25 +61094,25 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61094
61094
|
deprecatedTransitional: new RegExp(`^(?:::)(${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?)$`, "i"),
|
|
61095
61095
|
transitional: new RegExp(`^((?:${ipv6Part})|(?:::)(?:${ipv6Part})?)${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?$`, "i")
|
|
61096
61096
|
};
|
|
61097
|
-
function expandIPv6(
|
|
61098
|
-
if (
|
|
61097
|
+
function expandIPv6(string2, parts) {
|
|
61098
|
+
if (string2.indexOf("::") !== string2.lastIndexOf("::")) {
|
|
61099
61099
|
return null;
|
|
61100
61100
|
}
|
|
61101
61101
|
let colonCount = 0;
|
|
61102
61102
|
let lastColon = -1;
|
|
61103
|
-
let zoneId = (
|
|
61103
|
+
let zoneId = (string2.match(ipv6Regexes.zoneIndex) || [])[0];
|
|
61104
61104
|
let replacement, replacementCount;
|
|
61105
61105
|
if (zoneId) {
|
|
61106
61106
|
zoneId = zoneId.substring(1);
|
|
61107
|
-
|
|
61107
|
+
string2 = string2.replace(/%.+$/, "");
|
|
61108
61108
|
}
|
|
61109
|
-
while ((lastColon =
|
|
61109
|
+
while ((lastColon = string2.indexOf(":", lastColon + 1)) >= 0) {
|
|
61110
61110
|
colonCount++;
|
|
61111
61111
|
}
|
|
61112
|
-
if (
|
|
61112
|
+
if (string2.substr(0, 2) === "::") {
|
|
61113
61113
|
colonCount--;
|
|
61114
61114
|
}
|
|
61115
|
-
if (
|
|
61115
|
+
if (string2.substr(-2, 2) === "::") {
|
|
61116
61116
|
colonCount--;
|
|
61117
61117
|
}
|
|
61118
61118
|
if (colonCount > parts) {
|
|
@@ -61123,15 +61123,15 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61123
61123
|
while (replacementCount--) {
|
|
61124
61124
|
replacement += "0:";
|
|
61125
61125
|
}
|
|
61126
|
-
|
|
61127
|
-
if (
|
|
61128
|
-
|
|
61126
|
+
string2 = string2.replace("::", replacement);
|
|
61127
|
+
if (string2[0] === ":") {
|
|
61128
|
+
string2 = string2.slice(1);
|
|
61129
61129
|
}
|
|
61130
|
-
if (
|
|
61131
|
-
|
|
61130
|
+
if (string2[string2.length - 1] === ":") {
|
|
61131
|
+
string2 = string2.slice(0, -1);
|
|
61132
61132
|
}
|
|
61133
61133
|
parts = function() {
|
|
61134
|
-
const ref =
|
|
61134
|
+
const ref = string2.split(":");
|
|
61135
61135
|
const results = [];
|
|
61136
61136
|
for (let i = 0;i < ref.length; i++) {
|
|
61137
61137
|
results.push(parseInt(ref[i], 16));
|
|
@@ -61162,17 +61162,17 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61162
61162
|
}
|
|
61163
61163
|
return true;
|
|
61164
61164
|
}
|
|
61165
|
-
function parseIntAuto(
|
|
61166
|
-
if (hexRegex.test(
|
|
61167
|
-
return parseInt(
|
|
61165
|
+
function parseIntAuto(string2) {
|
|
61166
|
+
if (hexRegex.test(string2)) {
|
|
61167
|
+
return parseInt(string2, 16);
|
|
61168
61168
|
}
|
|
61169
|
-
if (
|
|
61170
|
-
if (octalRegex.test(
|
|
61171
|
-
return parseInt(
|
|
61169
|
+
if (string2[0] === "0" && !isNaN(parseInt(string2[1], 10))) {
|
|
61170
|
+
if (octalRegex.test(string2)) {
|
|
61171
|
+
return parseInt(string2, 8);
|
|
61172
61172
|
}
|
|
61173
|
-
throw new Error(`ipaddr: cannot parse ${
|
|
61173
|
+
throw new Error(`ipaddr: cannot parse ${string2} as octal`);
|
|
61174
61174
|
}
|
|
61175
|
-
return parseInt(
|
|
61175
|
+
return parseInt(string2, 10);
|
|
61176
61176
|
}
|
|
61177
61177
|
function padPart(part, length) {
|
|
61178
61178
|
while (part.length < length) {
|
|
@@ -61288,9 +61288,9 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61288
61288
|
};
|
|
61289
61289
|
return IPv4;
|
|
61290
61290
|
}();
|
|
61291
|
-
ipaddr.IPv4.broadcastAddressFromCIDR = function(
|
|
61291
|
+
ipaddr.IPv4.broadcastAddressFromCIDR = function(string2) {
|
|
61292
61292
|
try {
|
|
61293
|
-
const cidr = this.parseCIDR(
|
|
61293
|
+
const cidr = this.parseCIDR(string2);
|
|
61294
61294
|
const ipInterfaceOctets = cidr[0].toByteArray();
|
|
61295
61295
|
const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
61296
61296
|
const octets = [];
|
|
@@ -61304,43 +61304,43 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61304
61304
|
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
|
|
61305
61305
|
}
|
|
61306
61306
|
};
|
|
61307
|
-
ipaddr.IPv4.isIPv4 = function(
|
|
61308
|
-
return this.parser(
|
|
61307
|
+
ipaddr.IPv4.isIPv4 = function(string2) {
|
|
61308
|
+
return this.parser(string2) !== null;
|
|
61309
61309
|
};
|
|
61310
|
-
ipaddr.IPv4.isValid = function(
|
|
61310
|
+
ipaddr.IPv4.isValid = function(string2) {
|
|
61311
61311
|
try {
|
|
61312
|
-
new this(this.parser(
|
|
61312
|
+
new this(this.parser(string2));
|
|
61313
61313
|
return true;
|
|
61314
61314
|
} catch (e) {
|
|
61315
61315
|
return false;
|
|
61316
61316
|
}
|
|
61317
61317
|
};
|
|
61318
|
-
ipaddr.IPv4.isValidCIDR = function(
|
|
61318
|
+
ipaddr.IPv4.isValidCIDR = function(string2) {
|
|
61319
61319
|
try {
|
|
61320
|
-
this.parseCIDR(
|
|
61320
|
+
this.parseCIDR(string2);
|
|
61321
61321
|
return true;
|
|
61322
61322
|
} catch (e) {
|
|
61323
61323
|
return false;
|
|
61324
61324
|
}
|
|
61325
61325
|
};
|
|
61326
|
-
ipaddr.IPv4.isValidFourPartDecimal = function(
|
|
61327
|
-
if (ipaddr.IPv4.isValid(
|
|
61326
|
+
ipaddr.IPv4.isValidFourPartDecimal = function(string2) {
|
|
61327
|
+
if (ipaddr.IPv4.isValid(string2) && string2.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) {
|
|
61328
61328
|
return true;
|
|
61329
61329
|
} else {
|
|
61330
61330
|
return false;
|
|
61331
61331
|
}
|
|
61332
61332
|
};
|
|
61333
|
-
ipaddr.IPv4.isValidCIDRFourPartDecimal = function(
|
|
61334
|
-
const match2 =
|
|
61335
|
-
if (!ipaddr.IPv4.isValidCIDR(
|
|
61333
|
+
ipaddr.IPv4.isValidCIDRFourPartDecimal = function(string2) {
|
|
61334
|
+
const match2 = string2.match(/^(.+)\/(\d+)$/);
|
|
61335
|
+
if (!ipaddr.IPv4.isValidCIDR(string2) || !match2) {
|
|
61336
61336
|
return false;
|
|
61337
61337
|
}
|
|
61338
61338
|
return ipaddr.IPv4.isValidFourPartDecimal(match2[1]);
|
|
61339
61339
|
};
|
|
61340
|
-
ipaddr.IPv4.networkAddressFromCIDR = function(
|
|
61340
|
+
ipaddr.IPv4.networkAddressFromCIDR = function(string2) {
|
|
61341
61341
|
let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
61342
61342
|
try {
|
|
61343
|
-
cidr = this.parseCIDR(
|
|
61343
|
+
cidr = this.parseCIDR(string2);
|
|
61344
61344
|
ipInterfaceOctets = cidr[0].toByteArray();
|
|
61345
61345
|
subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
61346
61346
|
octets = [];
|
|
@@ -61354,16 +61354,16 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61354
61354
|
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
|
|
61355
61355
|
}
|
|
61356
61356
|
};
|
|
61357
|
-
ipaddr.IPv4.parse = function(
|
|
61358
|
-
const parts = this.parser(
|
|
61357
|
+
ipaddr.IPv4.parse = function(string2) {
|
|
61358
|
+
const parts = this.parser(string2);
|
|
61359
61359
|
if (parts === null) {
|
|
61360
61360
|
throw new Error("ipaddr: string is not formatted like an IPv4 Address");
|
|
61361
61361
|
}
|
|
61362
61362
|
return new this(parts);
|
|
61363
61363
|
};
|
|
61364
|
-
ipaddr.IPv4.parseCIDR = function(
|
|
61364
|
+
ipaddr.IPv4.parseCIDR = function(string2) {
|
|
61365
61365
|
let match2;
|
|
61366
|
-
if (match2 =
|
|
61366
|
+
if (match2 = string2.match(/^(.+)\/(\d+)$/)) {
|
|
61367
61367
|
const maskLength = parseInt(match2[2]);
|
|
61368
61368
|
if (maskLength >= 0 && maskLength <= 32) {
|
|
61369
61369
|
const parsed = [this.parse(match2[1]), maskLength];
|
|
@@ -61377,9 +61377,9 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61377
61377
|
}
|
|
61378
61378
|
throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range");
|
|
61379
61379
|
};
|
|
61380
|
-
ipaddr.IPv4.parser = function(
|
|
61380
|
+
ipaddr.IPv4.parser = function(string2) {
|
|
61381
61381
|
let match2, part, value;
|
|
61382
|
-
if (match2 =
|
|
61382
|
+
if (match2 = string2.match(ipv4Regexes.fourOctet)) {
|
|
61383
61383
|
return function() {
|
|
61384
61384
|
const ref = match2.slice(1, 6);
|
|
61385
61385
|
const results = [];
|
|
@@ -61389,7 +61389,7 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61389
61389
|
}
|
|
61390
61390
|
return results;
|
|
61391
61391
|
}();
|
|
61392
|
-
} else if (match2 =
|
|
61392
|
+
} else if (match2 = string2.match(ipv4Regexes.longValue)) {
|
|
61393
61393
|
value = parseIntAuto(match2[1]);
|
|
61394
61394
|
if (value > 4294967295 || value < 0) {
|
|
61395
61395
|
throw new Error("ipaddr: address outside defined range");
|
|
@@ -61402,7 +61402,7 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61402
61402
|
}
|
|
61403
61403
|
return results;
|
|
61404
61404
|
}().reverse();
|
|
61405
|
-
} else if (match2 =
|
|
61405
|
+
} else if (match2 = string2.match(ipv4Regexes.twoOctet)) {
|
|
61406
61406
|
return function() {
|
|
61407
61407
|
const ref = match2.slice(1, 4);
|
|
61408
61408
|
const results = [];
|
|
@@ -61416,7 +61416,7 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61416
61416
|
results.push(value & 255);
|
|
61417
61417
|
return results;
|
|
61418
61418
|
}();
|
|
61419
|
-
} else if (match2 =
|
|
61419
|
+
} else if (match2 = string2.match(ipv4Regexes.threeOctet)) {
|
|
61420
61420
|
return function() {
|
|
61421
61421
|
const ref = match2.slice(1, 5);
|
|
61422
61422
|
const results = [];
|
|
@@ -61611,29 +61611,29 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61611
61611
|
};
|
|
61612
61612
|
IPv6.prototype.toRFC5952String = function() {
|
|
61613
61613
|
const regex2 = /((^|:)(0(:|$)){2,})/g;
|
|
61614
|
-
const
|
|
61614
|
+
const string2 = this.toNormalizedString();
|
|
61615
61615
|
let bestMatchIndex = 0;
|
|
61616
61616
|
let bestMatchLength = -1;
|
|
61617
61617
|
let match2;
|
|
61618
|
-
while (match2 = regex2.exec(
|
|
61618
|
+
while (match2 = regex2.exec(string2)) {
|
|
61619
61619
|
if (match2[0].length > bestMatchLength) {
|
|
61620
61620
|
bestMatchIndex = match2.index;
|
|
61621
61621
|
bestMatchLength = match2[0].length;
|
|
61622
61622
|
}
|
|
61623
61623
|
}
|
|
61624
61624
|
if (bestMatchLength < 0) {
|
|
61625
|
-
return
|
|
61625
|
+
return string2;
|
|
61626
61626
|
}
|
|
61627
|
-
return `${
|
|
61627
|
+
return `${string2.substring(0, bestMatchIndex)}::${string2.substring(bestMatchIndex + bestMatchLength)}`;
|
|
61628
61628
|
};
|
|
61629
61629
|
IPv6.prototype.toString = function() {
|
|
61630
61630
|
return this.toRFC5952String();
|
|
61631
61631
|
};
|
|
61632
61632
|
return IPv6;
|
|
61633
61633
|
}();
|
|
61634
|
-
ipaddr.IPv6.broadcastAddressFromCIDR = function(
|
|
61634
|
+
ipaddr.IPv6.broadcastAddressFromCIDR = function(string2) {
|
|
61635
61635
|
try {
|
|
61636
|
-
const cidr = this.parseCIDR(
|
|
61636
|
+
const cidr = this.parseCIDR(string2);
|
|
61637
61637
|
const ipInterfaceOctets = cidr[0].toByteArray();
|
|
61638
61638
|
const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
61639
61639
|
const octets = [];
|
|
@@ -61647,36 +61647,36 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61647
61647
|
throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
|
|
61648
61648
|
}
|
|
61649
61649
|
};
|
|
61650
|
-
ipaddr.IPv6.isIPv6 = function(
|
|
61651
|
-
return this.parser(
|
|
61650
|
+
ipaddr.IPv6.isIPv6 = function(string2) {
|
|
61651
|
+
return this.parser(string2) !== null;
|
|
61652
61652
|
};
|
|
61653
|
-
ipaddr.IPv6.isValid = function(
|
|
61654
|
-
if (typeof
|
|
61653
|
+
ipaddr.IPv6.isValid = function(string2) {
|
|
61654
|
+
if (typeof string2 === "string" && string2.indexOf(":") === -1) {
|
|
61655
61655
|
return false;
|
|
61656
61656
|
}
|
|
61657
61657
|
try {
|
|
61658
|
-
const addr = this.parser(
|
|
61658
|
+
const addr = this.parser(string2);
|
|
61659
61659
|
new this(addr.parts, addr.zoneId);
|
|
61660
61660
|
return true;
|
|
61661
61661
|
} catch (e) {
|
|
61662
61662
|
return false;
|
|
61663
61663
|
}
|
|
61664
61664
|
};
|
|
61665
|
-
ipaddr.IPv6.isValidCIDR = function(
|
|
61666
|
-
if (typeof
|
|
61665
|
+
ipaddr.IPv6.isValidCIDR = function(string2) {
|
|
61666
|
+
if (typeof string2 === "string" && string2.indexOf(":") === -1) {
|
|
61667
61667
|
return false;
|
|
61668
61668
|
}
|
|
61669
61669
|
try {
|
|
61670
|
-
this.parseCIDR(
|
|
61670
|
+
this.parseCIDR(string2);
|
|
61671
61671
|
return true;
|
|
61672
61672
|
} catch (e) {
|
|
61673
61673
|
return false;
|
|
61674
61674
|
}
|
|
61675
61675
|
};
|
|
61676
|
-
ipaddr.IPv6.networkAddressFromCIDR = function(
|
|
61676
|
+
ipaddr.IPv6.networkAddressFromCIDR = function(string2) {
|
|
61677
61677
|
let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
61678
61678
|
try {
|
|
61679
|
-
cidr = this.parseCIDR(
|
|
61679
|
+
cidr = this.parseCIDR(string2);
|
|
61680
61680
|
ipInterfaceOctets = cidr[0].toByteArray();
|
|
61681
61681
|
subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
61682
61682
|
octets = [];
|
|
@@ -61690,16 +61690,16 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61690
61690
|
throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
|
|
61691
61691
|
}
|
|
61692
61692
|
};
|
|
61693
|
-
ipaddr.IPv6.parse = function(
|
|
61694
|
-
const addr = this.parser(
|
|
61693
|
+
ipaddr.IPv6.parse = function(string2) {
|
|
61694
|
+
const addr = this.parser(string2);
|
|
61695
61695
|
if (addr.parts === null) {
|
|
61696
61696
|
throw new Error("ipaddr: string is not formatted like an IPv6 Address");
|
|
61697
61697
|
}
|
|
61698
61698
|
return new this(addr.parts, addr.zoneId);
|
|
61699
61699
|
};
|
|
61700
|
-
ipaddr.IPv6.parseCIDR = function(
|
|
61700
|
+
ipaddr.IPv6.parseCIDR = function(string2) {
|
|
61701
61701
|
let maskLength, match2, parsed;
|
|
61702
|
-
if (match2 =
|
|
61702
|
+
if (match2 = string2.match(/^(.+)\/(\d+)$/)) {
|
|
61703
61703
|
maskLength = parseInt(match2[2]);
|
|
61704
61704
|
if (maskLength >= 0 && maskLength <= 128) {
|
|
61705
61705
|
parsed = [this.parse(match2[1]), maskLength];
|
|
@@ -61713,15 +61713,15 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61713
61713
|
}
|
|
61714
61714
|
throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range");
|
|
61715
61715
|
};
|
|
61716
|
-
ipaddr.IPv6.parser = function(
|
|
61716
|
+
ipaddr.IPv6.parser = function(string2) {
|
|
61717
61717
|
let addr, i, match2, octet, octets, zoneId;
|
|
61718
|
-
if (match2 =
|
|
61718
|
+
if (match2 = string2.match(ipv6Regexes.deprecatedTransitional)) {
|
|
61719
61719
|
return this.parser(`::ffff:${match2[1]}`);
|
|
61720
61720
|
}
|
|
61721
|
-
if (ipv6Regexes.native.test(
|
|
61722
|
-
return expandIPv6(
|
|
61721
|
+
if (ipv6Regexes.native.test(string2)) {
|
|
61722
|
+
return expandIPv6(string2, 8);
|
|
61723
61723
|
}
|
|
61724
|
-
if (match2 =
|
|
61724
|
+
if (match2 = string2.match(ipv6Regexes.transitional)) {
|
|
61725
61725
|
zoneId = match2[6] || "";
|
|
61726
61726
|
addr = match2[1];
|
|
61727
61727
|
if (!match2[1].endsWith("::")) {
|
|
@@ -61778,34 +61778,34 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
61778
61778
|
throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
|
|
61779
61779
|
}
|
|
61780
61780
|
};
|
|
61781
|
-
ipaddr.isValid = function(
|
|
61782
|
-
return ipaddr.IPv6.isValid(
|
|
61781
|
+
ipaddr.isValid = function(string2) {
|
|
61782
|
+
return ipaddr.IPv6.isValid(string2) || ipaddr.IPv4.isValid(string2);
|
|
61783
61783
|
};
|
|
61784
|
-
ipaddr.isValidCIDR = function(
|
|
61785
|
-
return ipaddr.IPv6.isValidCIDR(
|
|
61784
|
+
ipaddr.isValidCIDR = function(string2) {
|
|
61785
|
+
return ipaddr.IPv6.isValidCIDR(string2) || ipaddr.IPv4.isValidCIDR(string2);
|
|
61786
61786
|
};
|
|
61787
|
-
ipaddr.parse = function(
|
|
61788
|
-
if (ipaddr.IPv6.isValid(
|
|
61789
|
-
return ipaddr.IPv6.parse(
|
|
61790
|
-
} else if (ipaddr.IPv4.isValid(
|
|
61791
|
-
return ipaddr.IPv4.parse(
|
|
61787
|
+
ipaddr.parse = function(string2) {
|
|
61788
|
+
if (ipaddr.IPv6.isValid(string2)) {
|
|
61789
|
+
return ipaddr.IPv6.parse(string2);
|
|
61790
|
+
} else if (ipaddr.IPv4.isValid(string2)) {
|
|
61791
|
+
return ipaddr.IPv4.parse(string2);
|
|
61792
61792
|
} else {
|
|
61793
61793
|
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
|
|
61794
61794
|
}
|
|
61795
61795
|
};
|
|
61796
|
-
ipaddr.parseCIDR = function(
|
|
61796
|
+
ipaddr.parseCIDR = function(string2) {
|
|
61797
61797
|
try {
|
|
61798
|
-
return ipaddr.IPv6.parseCIDR(
|
|
61798
|
+
return ipaddr.IPv6.parseCIDR(string2);
|
|
61799
61799
|
} catch (e) {
|
|
61800
61800
|
try {
|
|
61801
|
-
return ipaddr.IPv4.parseCIDR(
|
|
61801
|
+
return ipaddr.IPv4.parseCIDR(string2);
|
|
61802
61802
|
} catch (e2) {
|
|
61803
61803
|
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
|
|
61804
61804
|
}
|
|
61805
61805
|
}
|
|
61806
61806
|
};
|
|
61807
|
-
ipaddr.process = function(
|
|
61808
|
-
const addr = this.parse(
|
|
61807
|
+
ipaddr.process = function(string2) {
|
|
61808
|
+
const addr = this.parse(string2);
|
|
61809
61809
|
if (addr.kind() === "ipv6" && addr.isIPv4MappedAddress()) {
|
|
61810
61810
|
return addr.toIPv4Address();
|
|
61811
61811
|
} else {
|
|
@@ -62612,14 +62612,14 @@ var require_util10 = __commonJS((exports, module) => {
|
|
|
62612
62612
|
}
|
|
62613
62613
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
62614
62614
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
62615
|
-
let
|
|
62615
|
+
let path5 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
62616
62616
|
if (origin[origin.length - 1] === "/") {
|
|
62617
62617
|
origin = origin.slice(0, origin.length - 1);
|
|
62618
62618
|
}
|
|
62619
|
-
if (
|
|
62620
|
-
|
|
62619
|
+
if (path5 && path5[0] !== "/") {
|
|
62620
|
+
path5 = `/${path5}`;
|
|
62621
62621
|
}
|
|
62622
|
-
return new URL(`${origin}${
|
|
62622
|
+
return new URL(`${origin}${path5}`);
|
|
62623
62623
|
}
|
|
62624
62624
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
62625
62625
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -63049,29 +63049,29 @@ var require_diagnostics = __commonJS((exports, module) => {
|
|
|
63049
63049
|
});
|
|
63050
63050
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
|
63051
63051
|
const {
|
|
63052
|
-
request: { method, path:
|
|
63052
|
+
request: { method, path: path5, origin }
|
|
63053
63053
|
} = evt;
|
|
63054
|
-
debuglog("sending request to %s %s/%s", method, origin,
|
|
63054
|
+
debuglog("sending request to %s %s/%s", method, origin, path5);
|
|
63055
63055
|
});
|
|
63056
63056
|
diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => {
|
|
63057
63057
|
const {
|
|
63058
|
-
request: { method, path:
|
|
63058
|
+
request: { method, path: path5, origin },
|
|
63059
63059
|
response: { statusCode }
|
|
63060
63060
|
} = evt;
|
|
63061
|
-
debuglog("received response to %s %s/%s - HTTP %d", method, origin,
|
|
63061
|
+
debuglog("received response to %s %s/%s - HTTP %d", method, origin, path5, statusCode);
|
|
63062
63062
|
});
|
|
63063
63063
|
diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => {
|
|
63064
63064
|
const {
|
|
63065
|
-
request: { method, path:
|
|
63065
|
+
request: { method, path: path5, origin }
|
|
63066
63066
|
} = evt;
|
|
63067
|
-
debuglog("trailers received from %s %s/%s", method, origin,
|
|
63067
|
+
debuglog("trailers received from %s %s/%s", method, origin, path5);
|
|
63068
63068
|
});
|
|
63069
63069
|
diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
|
|
63070
63070
|
const {
|
|
63071
|
-
request: { method, path:
|
|
63071
|
+
request: { method, path: path5, origin },
|
|
63072
63072
|
error
|
|
63073
63073
|
} = evt;
|
|
63074
|
-
debuglog("request to %s %s/%s errored - %s", method, origin,
|
|
63074
|
+
debuglog("request to %s %s/%s errored - %s", method, origin, path5, error.message);
|
|
63075
63075
|
});
|
|
63076
63076
|
isClientSet = true;
|
|
63077
63077
|
}
|
|
@@ -63099,9 +63099,9 @@ var require_diagnostics = __commonJS((exports, module) => {
|
|
|
63099
63099
|
});
|
|
63100
63100
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
|
63101
63101
|
const {
|
|
63102
|
-
request: { method, path:
|
|
63102
|
+
request: { method, path: path5, origin }
|
|
63103
63103
|
} = evt;
|
|
63104
|
-
debuglog("sending request to %s %s/%s", method, origin,
|
|
63104
|
+
debuglog("sending request to %s %s/%s", method, origin, path5);
|
|
63105
63105
|
});
|
|
63106
63106
|
}
|
|
63107
63107
|
diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => {
|
|
@@ -63157,7 +63157,7 @@ var require_request = __commonJS((exports, module) => {
|
|
|
63157
63157
|
|
|
63158
63158
|
class Request2 {
|
|
63159
63159
|
constructor(origin, {
|
|
63160
|
-
path:
|
|
63160
|
+
path: path5,
|
|
63161
63161
|
method,
|
|
63162
63162
|
body,
|
|
63163
63163
|
headers,
|
|
@@ -63172,11 +63172,11 @@ var require_request = __commonJS((exports, module) => {
|
|
|
63172
63172
|
expectContinue,
|
|
63173
63173
|
servername
|
|
63174
63174
|
}, handler) {
|
|
63175
|
-
if (typeof
|
|
63175
|
+
if (typeof path5 !== "string") {
|
|
63176
63176
|
throw new InvalidArgumentError("path must be a string");
|
|
63177
|
-
} else if (
|
|
63177
|
+
} else if (path5[0] !== "/" && !(path5.startsWith("http://") || path5.startsWith("https://")) && method !== "CONNECT") {
|
|
63178
63178
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
63179
|
-
} else if (invalidPathRegex.test(
|
|
63179
|
+
} else if (invalidPathRegex.test(path5)) {
|
|
63180
63180
|
throw new InvalidArgumentError("invalid request path");
|
|
63181
63181
|
}
|
|
63182
63182
|
if (typeof method !== "string") {
|
|
@@ -63239,7 +63239,7 @@ var require_request = __commonJS((exports, module) => {
|
|
|
63239
63239
|
this.completed = false;
|
|
63240
63240
|
this.aborted = false;
|
|
63241
63241
|
this.upgrade = upgrade || null;
|
|
63242
|
-
this.path = query ? buildURL(
|
|
63242
|
+
this.path = query ? buildURL(path5, query) : path5;
|
|
63243
63243
|
this.origin = origin;
|
|
63244
63244
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
63245
63245
|
this.blocking = blocking == null ? false : blocking;
|
|
@@ -67395,7 +67395,7 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
67395
67395
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
67396
67396
|
}
|
|
67397
67397
|
function writeH1(client, request) {
|
|
67398
|
-
const { method, path:
|
|
67398
|
+
const { method, path: path5, host, upgrade, blocking, reset } = request;
|
|
67399
67399
|
let { body, headers, contentLength } = request;
|
|
67400
67400
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
67401
67401
|
if (util.isFormDataLike(body)) {
|
|
@@ -67461,7 +67461,7 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
67461
67461
|
if (blocking) {
|
|
67462
67462
|
socket[kBlocking] = true;
|
|
67463
67463
|
}
|
|
67464
|
-
let header = `${method} ${
|
|
67464
|
+
let header = `${method} ${path5} HTTP/1.1\r
|
|
67465
67465
|
`;
|
|
67466
67466
|
if (typeof host === "string") {
|
|
67467
67467
|
header += `host: ${host}\r
|
|
@@ -67990,7 +67990,7 @@ var require_client_h2 = __commonJS((exports, module) => {
|
|
|
67990
67990
|
}
|
|
67991
67991
|
function writeH2(client, request) {
|
|
67992
67992
|
const session = client[kHTTP2Session];
|
|
67993
|
-
const { method, path:
|
|
67993
|
+
const { method, path: path5, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
|
|
67994
67994
|
let { body } = request;
|
|
67995
67995
|
if (upgrade) {
|
|
67996
67996
|
util.errorRequest(client, request, new Error("Upgrade not supported for H2"));
|
|
@@ -68058,7 +68058,7 @@ var require_client_h2 = __commonJS((exports, module) => {
|
|
|
68058
68058
|
});
|
|
68059
68059
|
return true;
|
|
68060
68060
|
}
|
|
68061
|
-
headers[HTTP2_HEADER_PATH] =
|
|
68061
|
+
headers[HTTP2_HEADER_PATH] = path5;
|
|
68062
68062
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
68063
68063
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
68064
68064
|
if (body && typeof body.read === "function") {
|
|
@@ -68352,9 +68352,9 @@ var require_redirect_handler = __commonJS((exports, module) => {
|
|
|
68352
68352
|
return this.handler.onHeaders(statusCode, headers, resume, statusText);
|
|
68353
68353
|
}
|
|
68354
68354
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
68355
|
-
const
|
|
68355
|
+
const path5 = search ? `${pathname}${search}` : pathname;
|
|
68356
68356
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
68357
|
-
this.opts.path =
|
|
68357
|
+
this.opts.path = path5;
|
|
68358
68358
|
this.opts.origin = origin;
|
|
68359
68359
|
this.opts.maxRedirections = 0;
|
|
68360
68360
|
this.opts.query = null;
|
|
@@ -69559,10 +69559,10 @@ var require_proxy_agent = __commonJS((exports, module) => {
|
|
|
69559
69559
|
};
|
|
69560
69560
|
const {
|
|
69561
69561
|
origin,
|
|
69562
|
-
path:
|
|
69562
|
+
path: path5 = "/",
|
|
69563
69563
|
headers = {}
|
|
69564
69564
|
} = opts;
|
|
69565
|
-
opts.path = origin +
|
|
69565
|
+
opts.path = origin + path5;
|
|
69566
69566
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
69567
69567
|
const { host } = new URL2(origin);
|
|
69568
69568
|
headers.host = host;
|
|
@@ -71385,20 +71385,20 @@ var require_mock_utils = __commonJS((exports, module) => {
|
|
|
71385
71385
|
}
|
|
71386
71386
|
return true;
|
|
71387
71387
|
}
|
|
71388
|
-
function safeUrl(
|
|
71389
|
-
if (typeof
|
|
71390
|
-
return
|
|
71388
|
+
function safeUrl(path5) {
|
|
71389
|
+
if (typeof path5 !== "string") {
|
|
71390
|
+
return path5;
|
|
71391
71391
|
}
|
|
71392
|
-
const pathSegments =
|
|
71392
|
+
const pathSegments = path5.split("?");
|
|
71393
71393
|
if (pathSegments.length !== 2) {
|
|
71394
|
-
return
|
|
71394
|
+
return path5;
|
|
71395
71395
|
}
|
|
71396
71396
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
71397
71397
|
qp.sort();
|
|
71398
71398
|
return [...pathSegments, qp.toString()].join("?");
|
|
71399
71399
|
}
|
|
71400
|
-
function matchKey(mockDispatch2, { path:
|
|
71401
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
71400
|
+
function matchKey(mockDispatch2, { path: path5, method, body, headers }) {
|
|
71401
|
+
const pathMatch = matchValue(mockDispatch2.path, path5);
|
|
71402
71402
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
71403
71403
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
71404
71404
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -71420,7 +71420,7 @@ var require_mock_utils = __commonJS((exports, module) => {
|
|
|
71420
71420
|
function getMockDispatch(mockDispatches, key) {
|
|
71421
71421
|
const basePath = key.query ? buildURL(key.path, key.query) : key.path;
|
|
71422
71422
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
71423
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
71423
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path5 }) => matchValue(safeUrl(path5), resolvedPath));
|
|
71424
71424
|
if (matchedMockDispatches.length === 0) {
|
|
71425
71425
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
71426
71426
|
}
|
|
@@ -71458,9 +71458,9 @@ var require_mock_utils = __commonJS((exports, module) => {
|
|
|
71458
71458
|
}
|
|
71459
71459
|
}
|
|
71460
71460
|
function buildKey(opts) {
|
|
71461
|
-
const { path:
|
|
71461
|
+
const { path: path5, method, body, headers, query } = opts;
|
|
71462
71462
|
return {
|
|
71463
|
-
path:
|
|
71463
|
+
path: path5,
|
|
71464
71464
|
method,
|
|
71465
71465
|
body,
|
|
71466
71466
|
headers,
|
|
@@ -71880,10 +71880,10 @@ var require_pending_interceptors_formatter = __commonJS((exports, module) => {
|
|
|
71880
71880
|
});
|
|
71881
71881
|
}
|
|
71882
71882
|
format(pendingInterceptors) {
|
|
71883
|
-
const withPrettyHeaders = pendingInterceptors.map(({ method, path:
|
|
71883
|
+
const withPrettyHeaders = pendingInterceptors.map(({ method, path: path5, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
71884
71884
|
Method: method,
|
|
71885
71885
|
Origin: origin,
|
|
71886
|
-
Path:
|
|
71886
|
+
Path: path5,
|
|
71887
71887
|
"Status code": statusCode,
|
|
71888
71888
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
71889
71889
|
Invocations: timesInvoked,
|
|
@@ -76309,9 +76309,9 @@ var require_util15 = __commonJS((exports, module) => {
|
|
|
76309
76309
|
}
|
|
76310
76310
|
}
|
|
76311
76311
|
}
|
|
76312
|
-
function validateCookiePath(
|
|
76313
|
-
for (let i = 0;i <
|
|
76314
|
-
const code =
|
|
76312
|
+
function validateCookiePath(path5) {
|
|
76313
|
+
for (let i = 0;i < path5.length; ++i) {
|
|
76314
|
+
const code = path5.charCodeAt(i);
|
|
76315
76315
|
if (code < 32 || code === 127 || code === 59) {
|
|
76316
76316
|
throw new Error("Invalid cookie path");
|
|
76317
76317
|
}
|
|
@@ -78691,11 +78691,11 @@ var require_undici = __commonJS((exports, module) => {
|
|
|
78691
78691
|
if (typeof opts.path !== "string") {
|
|
78692
78692
|
throw new InvalidArgumentError("invalid opts.path");
|
|
78693
78693
|
}
|
|
78694
|
-
let
|
|
78694
|
+
let path5 = opts.path;
|
|
78695
78695
|
if (!opts.path.startsWith("/")) {
|
|
78696
|
-
|
|
78696
|
+
path5 = `/${path5}`;
|
|
78697
78697
|
}
|
|
78698
|
-
url = new URL(util.parseOrigin(url).origin +
|
|
78698
|
+
url = new URL(util.parseOrigin(url).origin + path5);
|
|
78699
78699
|
} else {
|
|
78700
78700
|
if (!opts) {
|
|
78701
78701
|
opts = typeof url === "object" ? url : {};
|
|
@@ -79301,17 +79301,17 @@ var require_web = __commonJS((exports) => {
|
|
|
79301
79301
|
}
|
|
79302
79302
|
function urlToDidWeb(url) {
|
|
79303
79303
|
const port = url.port ? `%3A${url.port}` : "";
|
|
79304
|
-
const
|
|
79305
|
-
return `did:web:${url.hostname}${port}${
|
|
79304
|
+
const path5 = url.pathname === "/" ? "" : url.pathname.replaceAll("/", ":");
|
|
79305
|
+
return `did:web:${url.hostname}${port}${path5}`;
|
|
79306
79306
|
}
|
|
79307
79307
|
function buildDidWebUrl(did) {
|
|
79308
79308
|
const hostIdx = exports.DID_WEB_PREFIX.length;
|
|
79309
79309
|
const pathIdx = did.indexOf(":", hostIdx);
|
|
79310
79310
|
const hostEnc = pathIdx === -1 ? did.slice(hostIdx) : did.slice(hostIdx, pathIdx);
|
|
79311
79311
|
const host = hostEnc.replaceAll("%3A", ":");
|
|
79312
|
-
const
|
|
79312
|
+
const path5 = pathIdx === -1 ? "" : did.slice(pathIdx).replaceAll(":", "/");
|
|
79313
79313
|
const proto2 = host.startsWith("localhost") && (host.length === 9 || host.charCodeAt(9) === 58) ? "http" : "https";
|
|
79314
|
-
return `${proto2}://${host}${
|
|
79314
|
+
return `${proto2}://${host}${path5}`;
|
|
79315
79315
|
}
|
|
79316
79316
|
});
|
|
79317
79317
|
|
|
@@ -87507,12 +87507,12 @@ var require_object_define_property = __commonJS((exports) => {
|
|
|
87507
87507
|
|
|
87508
87508
|
// ../../node_modules/.bun/core-js@3.48.0/node_modules/core-js/internals/well-known-symbol-define.js
|
|
87509
87509
|
var require_well_known_symbol_define = __commonJS((exports, module) => {
|
|
87510
|
-
var
|
|
87510
|
+
var path5 = require_path();
|
|
87511
87511
|
var hasOwn = require_has_own_property();
|
|
87512
87512
|
var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped();
|
|
87513
87513
|
var defineProperty = require_object_define_property().f;
|
|
87514
87514
|
module.exports = function(NAME) {
|
|
87515
|
-
var Symbol2 =
|
|
87515
|
+
var Symbol2 = path5.Symbol || (path5.Symbol = {});
|
|
87516
87516
|
if (!hasOwn(Symbol2, NAME))
|
|
87517
87517
|
defineProperty(Symbol2, NAME, {
|
|
87518
87518
|
value: wrappedWellKnownSymbolModule.f(NAME)
|
|
@@ -91458,10 +91458,10 @@ var require_dist24 = __commonJS((exports) => {
|
|
|
91458
91458
|
});
|
|
91459
91459
|
|
|
91460
91460
|
// ../../node_modules/.bun/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
91461
|
-
import
|
|
91461
|
+
import fs9 from "node:fs";
|
|
91462
91462
|
function hasDockerEnv() {
|
|
91463
91463
|
try {
|
|
91464
|
-
|
|
91464
|
+
fs9.statSync("/.dockerenv");
|
|
91465
91465
|
return true;
|
|
91466
91466
|
} catch {
|
|
91467
91467
|
return false;
|
|
@@ -91469,7 +91469,7 @@ function hasDockerEnv() {
|
|
|
91469
91469
|
}
|
|
91470
91470
|
function hasDockerCGroup() {
|
|
91471
91471
|
try {
|
|
91472
|
-
return
|
|
91472
|
+
return fs9.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
91473
91473
|
} catch {
|
|
91474
91474
|
return false;
|
|
91475
91475
|
}
|
|
@@ -91484,7 +91484,7 @@ var isDockerCached;
|
|
|
91484
91484
|
var init_is_docker = () => {};
|
|
91485
91485
|
|
|
91486
91486
|
// ../../node_modules/.bun/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
|
|
91487
|
-
import
|
|
91487
|
+
import fs10 from "node:fs";
|
|
91488
91488
|
function isInsideContainer() {
|
|
91489
91489
|
if (cachedResult === undefined) {
|
|
91490
91490
|
cachedResult = hasContainerEnv() || isDocker();
|
|
@@ -91493,7 +91493,7 @@ function isInsideContainer() {
|
|
|
91493
91493
|
}
|
|
91494
91494
|
var cachedResult, hasContainerEnv = () => {
|
|
91495
91495
|
try {
|
|
91496
|
-
|
|
91496
|
+
fs10.statSync("/run/.containerenv");
|
|
91497
91497
|
return true;
|
|
91498
91498
|
} catch {
|
|
91499
91499
|
return false;
|
|
@@ -91506,7 +91506,7 @@ var init_is_inside_container = __esm(() => {
|
|
|
91506
91506
|
// ../../node_modules/.bun/is-wsl@3.1.0/node_modules/is-wsl/index.js
|
|
91507
91507
|
import process3 from "node:process";
|
|
91508
91508
|
import os4 from "node:os";
|
|
91509
|
-
import
|
|
91509
|
+
import fs11 from "node:fs";
|
|
91510
91510
|
var isWsl = () => {
|
|
91511
91511
|
if (process3.platform !== "linux") {
|
|
91512
91512
|
return false;
|
|
@@ -91518,7 +91518,7 @@ var isWsl = () => {
|
|
|
91518
91518
|
return true;
|
|
91519
91519
|
}
|
|
91520
91520
|
try {
|
|
91521
|
-
return
|
|
91521
|
+
return fs11.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
91522
91522
|
} catch {
|
|
91523
91523
|
return false;
|
|
91524
91524
|
}
|
|
@@ -91533,12 +91533,12 @@ import process4 from "node:process";
|
|
|
91533
91533
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
91534
91534
|
import { promisify } from "node:util";
|
|
91535
91535
|
import childProcess from "node:child_process";
|
|
91536
|
-
var execFile, powerShellPath = () => `${process4.env.SYSTEMROOT || process4.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, executePowerShell = async (
|
|
91536
|
+
var execFile, powerShellPath = () => `${process4.env.SYSTEMROOT || process4.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, executePowerShell = async (command5, options = {}) => {
|
|
91537
91537
|
const {
|
|
91538
91538
|
powerShellPath: psPath,
|
|
91539
91539
|
...execFileOptions
|
|
91540
91540
|
} = options;
|
|
91541
|
-
const encodedCommand = executePowerShell.encodeCommand(
|
|
91541
|
+
const encodedCommand = executePowerShell.encodeCommand(command5);
|
|
91542
91542
|
return execFile(psPath ?? powerShellPath(), [
|
|
91543
91543
|
...executePowerShell.argumentsPrefix,
|
|
91544
91544
|
encodedCommand
|
|
@@ -91556,7 +91556,7 @@ var init_powershell_utils = __esm(() => {
|
|
|
91556
91556
|
"Bypass",
|
|
91557
91557
|
"-EncodedCommand"
|
|
91558
91558
|
];
|
|
91559
|
-
executePowerShell.encodeCommand = (
|
|
91559
|
+
executePowerShell.encodeCommand = (command5) => Buffer2.from(command5, "utf16le").toString("base64");
|
|
91560
91560
|
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
91561
91561
|
});
|
|
91562
91562
|
|
|
@@ -91578,7 +91578,7 @@ function parseMountPointFromConfig(content) {
|
|
|
91578
91578
|
// ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
|
|
91579
91579
|
import { promisify as promisify2 } from "node:util";
|
|
91580
91580
|
import childProcess2 from "node:child_process";
|
|
91581
|
-
import
|
|
91581
|
+
import fs12, { constants as fsConstants } from "node:fs/promises";
|
|
91582
91582
|
var execFile2, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
91583
91583
|
const mountPoint = await wslDrivesMountPoint();
|
|
91584
91584
|
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
@@ -91586,7 +91586,7 @@ var execFile2, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
|
91586
91586
|
canAccessPowerShellPromise ??= (async () => {
|
|
91587
91587
|
try {
|
|
91588
91588
|
const psPath = await powerShellPath2();
|
|
91589
|
-
await
|
|
91589
|
+
await fs12.access(psPath, fsConstants.X_OK);
|
|
91590
91590
|
return true;
|
|
91591
91591
|
} catch {
|
|
91592
91592
|
return false;
|
|
@@ -91595,18 +91595,18 @@ var execFile2, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
|
91595
91595
|
return canAccessPowerShellPromise;
|
|
91596
91596
|
}, wslDefaultBrowser = async () => {
|
|
91597
91597
|
const psPath = await powerShellPath2();
|
|
91598
|
-
const
|
|
91599
|
-
const { stdout } = await executePowerShell(
|
|
91598
|
+
const command5 = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
91599
|
+
const { stdout } = await executePowerShell(command5, { powerShellPath: psPath });
|
|
91600
91600
|
return stdout.trim();
|
|
91601
|
-
}, convertWslPathToWindows = async (
|
|
91602
|
-
if (/^[a-z]+:\/\//i.test(
|
|
91603
|
-
return
|
|
91601
|
+
}, convertWslPathToWindows = async (path10) => {
|
|
91602
|
+
if (/^[a-z]+:\/\//i.test(path10)) {
|
|
91603
|
+
return path10;
|
|
91604
91604
|
}
|
|
91605
91605
|
try {
|
|
91606
|
-
const { stdout } = await execFile2("wslpath", ["-aw",
|
|
91606
|
+
const { stdout } = await execFile2("wslpath", ["-aw", path10], { encoding: "utf8" });
|
|
91607
91607
|
return stdout.trim();
|
|
91608
91608
|
} catch {
|
|
91609
|
-
return
|
|
91609
|
+
return path10;
|
|
91610
91610
|
}
|
|
91611
91611
|
};
|
|
91612
91612
|
var init_wsl_utils = __esm(() => {
|
|
@@ -91624,13 +91624,13 @@ var init_wsl_utils = __esm(() => {
|
|
|
91624
91624
|
const configFilePath = "/etc/wsl.conf";
|
|
91625
91625
|
let isConfigFileExists = false;
|
|
91626
91626
|
try {
|
|
91627
|
-
await
|
|
91627
|
+
await fs12.access(configFilePath, fsConstants.F_OK);
|
|
91628
91628
|
isConfigFileExists = true;
|
|
91629
91629
|
} catch {}
|
|
91630
91630
|
if (!isConfigFileExists) {
|
|
91631
91631
|
return defaultMountPoint;
|
|
91632
91632
|
}
|
|
91633
|
-
const configContent = await
|
|
91633
|
+
const configContent = await fs12.readFile(configFilePath, { encoding: "utf8" });
|
|
91634
91634
|
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
91635
91635
|
if (parsedMountPoint === undefined) {
|
|
91636
91636
|
return defaultMountPoint;
|
|
@@ -91780,7 +91780,7 @@ async function defaultBrowser2() {
|
|
|
91780
91780
|
}
|
|
91781
91781
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
91782
91782
|
}
|
|
91783
|
-
var execFileAsync4, titleize = (
|
|
91783
|
+
var execFileAsync4, titleize = (string4) => string4.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x3) => x3.toUpperCase());
|
|
91784
91784
|
var init_default_browser = __esm(() => {
|
|
91785
91785
|
init_default_browser_id();
|
|
91786
91786
|
init_bundle_name();
|
|
@@ -91805,10 +91805,10 @@ __export(exports_open, {
|
|
|
91805
91805
|
apps: () => apps
|
|
91806
91806
|
});
|
|
91807
91807
|
import process9 from "node:process";
|
|
91808
|
-
import
|
|
91809
|
-
import { fileURLToPath as
|
|
91808
|
+
import path10 from "node:path";
|
|
91809
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
91810
91810
|
import childProcess3 from "node:child_process";
|
|
91811
|
-
import
|
|
91811
|
+
import fs13, { constants as fsConstants2 } from "node:fs/promises";
|
|
91812
91812
|
function detectArchBinary(binary) {
|
|
91813
91813
|
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
91814
91814
|
return binary;
|
|
@@ -91828,7 +91828,7 @@ function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
|
|
|
91828
91828
|
}
|
|
91829
91829
|
return detectArchBinary(platformBinary);
|
|
91830
91830
|
}
|
|
91831
|
-
var fallbackAttemptSymbol,
|
|
91831
|
+
var fallbackAttemptSymbol, __dirname3, localXdgOpenPath, platform, arch, tryEachApp = async (apps, opener) => {
|
|
91832
91832
|
if (apps.length === 0) {
|
|
91833
91833
|
return;
|
|
91834
91834
|
}
|
|
@@ -91915,7 +91915,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform, arch, tryEach
|
|
|
91915
91915
|
}
|
|
91916
91916
|
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
91917
91917
|
}
|
|
91918
|
-
let
|
|
91918
|
+
let command5;
|
|
91919
91919
|
const cliArguments = [];
|
|
91920
91920
|
const childProcessOptions = {};
|
|
91921
91921
|
let shouldUseWindowsInWsl = false;
|
|
@@ -91923,7 +91923,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform, arch, tryEach
|
|
|
91923
91923
|
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
91924
91924
|
}
|
|
91925
91925
|
if (platform === "darwin") {
|
|
91926
|
-
|
|
91926
|
+
command5 = "open";
|
|
91927
91927
|
if (options.wait) {
|
|
91928
91928
|
cliArguments.push("--wait-apps");
|
|
91929
91929
|
}
|
|
@@ -91937,7 +91937,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform, arch, tryEach
|
|
|
91937
91937
|
cliArguments.push("-a", app);
|
|
91938
91938
|
}
|
|
91939
91939
|
} else if (platform === "win32" || shouldUseWindowsInWsl) {
|
|
91940
|
-
|
|
91940
|
+
command5 = await powerShellPath2();
|
|
91941
91941
|
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
91942
91942
|
if (!is_wsl_default) {
|
|
91943
91943
|
childProcessOptions.windowsVerbatimArguments = true;
|
|
@@ -91967,16 +91967,16 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform, arch, tryEach
|
|
|
91967
91967
|
}
|
|
91968
91968
|
} else {
|
|
91969
91969
|
if (app) {
|
|
91970
|
-
|
|
91970
|
+
command5 = app;
|
|
91971
91971
|
} else {
|
|
91972
|
-
const isBundled = !
|
|
91972
|
+
const isBundled = !__dirname3 || __dirname3 === "/";
|
|
91973
91973
|
let exeLocalXdgOpen = false;
|
|
91974
91974
|
try {
|
|
91975
|
-
await
|
|
91975
|
+
await fs13.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
91976
91976
|
exeLocalXdgOpen = true;
|
|
91977
91977
|
} catch {}
|
|
91978
91978
|
const useSystemXdgOpen = process9.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
91979
|
-
|
|
91979
|
+
command5 = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
91980
91980
|
}
|
|
91981
91981
|
if (appArguments.length > 0) {
|
|
91982
91982
|
cliArguments.push(...appArguments);
|
|
@@ -91992,7 +91992,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform, arch, tryEach
|
|
|
91992
91992
|
if (options.target) {
|
|
91993
91993
|
cliArguments.push(options.target);
|
|
91994
91994
|
}
|
|
91995
|
-
const subprocess = childProcess3.spawn(
|
|
91995
|
+
const subprocess = childProcess3.spawn(command5, cliArguments, childProcessOptions);
|
|
91996
91996
|
if (options.wait) {
|
|
91997
91997
|
return new Promise((resolve, reject) => {
|
|
91998
91998
|
subprocess.once("error", reject);
|
|
@@ -92060,8 +92060,8 @@ var init_open = __esm(() => {
|
|
|
92060
92060
|
init_is_inside_container();
|
|
92061
92061
|
init_is_in_ssh();
|
|
92062
92062
|
fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
92063
|
-
|
|
92064
|
-
localXdgOpenPath =
|
|
92063
|
+
__dirname3 = import.meta.url ? path10.dirname(fileURLToPath4(import.meta.url)) : "";
|
|
92064
|
+
localXdgOpenPath = path10.join(__dirname3, "xdg-open");
|
|
92065
92065
|
({ platform, arch } = process9);
|
|
92066
92066
|
apps = {
|
|
92067
92067
|
browser: "browser",
|
|
@@ -92108,14 +92108,17 @@ var init_open = __esm(() => {
|
|
|
92108
92108
|
});
|
|
92109
92109
|
|
|
92110
92110
|
// src/index.ts
|
|
92111
|
-
var
|
|
92111
|
+
var import_cmd_ts9 = __toESM(require_cjs(), 1);
|
|
92112
92112
|
|
|
92113
|
-
// src/commands/
|
|
92114
|
-
var
|
|
92113
|
+
// src/commands/add.ts
|
|
92114
|
+
var import_cmd_ts = __toESM(require_cjs(), 1);
|
|
92115
|
+
import * as fs2 from "node:fs/promises";
|
|
92116
|
+
import { existsSync } from "node:fs";
|
|
92117
|
+
import * as path2 from "node:path";
|
|
92115
92118
|
|
|
92116
92119
|
// ../../node_modules/.bun/@clack+core@1.0.0/node_modules/@clack/core/dist/index.mjs
|
|
92117
92120
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
92118
|
-
var import_sisteransi = __toESM(
|
|
92121
|
+
var import_sisteransi = __toESM(require_src2(), 1);
|
|
92119
92122
|
import { stdout as R, stdin as q } from "node:process";
|
|
92120
92123
|
import * as k from "node:readline";
|
|
92121
92124
|
import ot from "node:readline";
|
|
@@ -92707,7 +92710,7 @@ class $t extends x {
|
|
|
92707
92710
|
// ../../node_modules/.bun/@clack+prompts@1.0.0/node_modules/@clack/prompts/dist/index.mjs
|
|
92708
92711
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
92709
92712
|
import P2 from "node:process";
|
|
92710
|
-
var import_sisteransi2 = __toESM(
|
|
92713
|
+
var import_sisteransi2 = __toESM(require_src2(), 1);
|
|
92711
92714
|
function ht2() {
|
|
92712
92715
|
return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
92713
92716
|
}
|
|
@@ -93237,8 +93240,228 @@ ${l}
|
|
|
93237
93240
|
}
|
|
93238
93241
|
} }).prompt();
|
|
93239
93242
|
|
|
93243
|
+
// src/commands/add.ts
|
|
93244
|
+
import { fileURLToPath } from "node:url";
|
|
93245
|
+
import { dirname as dirname2 } from "node:path";
|
|
93246
|
+
|
|
93247
|
+
// src/lib/config.ts
|
|
93248
|
+
import * as fs from "node:fs/promises";
|
|
93249
|
+
import * as path from "node:path";
|
|
93250
|
+
var CONFIG_FILENAME = "sequoia.json";
|
|
93251
|
+
var STATE_FILENAME = ".sequoia-state.json";
|
|
93252
|
+
async function fileExists(filePath) {
|
|
93253
|
+
try {
|
|
93254
|
+
await fs.access(filePath);
|
|
93255
|
+
return true;
|
|
93256
|
+
} catch {
|
|
93257
|
+
return false;
|
|
93258
|
+
}
|
|
93259
|
+
}
|
|
93260
|
+
async function findConfig(startDir = process.cwd()) {
|
|
93261
|
+
let currentDir = startDir;
|
|
93262
|
+
while (true) {
|
|
93263
|
+
const configPath = path.join(currentDir, CONFIG_FILENAME);
|
|
93264
|
+
if (await fileExists(configPath)) {
|
|
93265
|
+
return configPath;
|
|
93266
|
+
}
|
|
93267
|
+
const parentDir = path.dirname(currentDir);
|
|
93268
|
+
if (parentDir === currentDir) {
|
|
93269
|
+
return null;
|
|
93270
|
+
}
|
|
93271
|
+
currentDir = parentDir;
|
|
93272
|
+
}
|
|
93273
|
+
}
|
|
93274
|
+
async function loadConfig(configPath) {
|
|
93275
|
+
const resolvedPath = configPath || await findConfig();
|
|
93276
|
+
if (!resolvedPath) {
|
|
93277
|
+
throw new Error(`Could not find ${CONFIG_FILENAME}. Run 'sequoia init' to create one.`);
|
|
93278
|
+
}
|
|
93279
|
+
try {
|
|
93280
|
+
const content = await fs.readFile(resolvedPath, "utf-8");
|
|
93281
|
+
const config = JSON.parse(content);
|
|
93282
|
+
if (!config.siteUrl)
|
|
93283
|
+
throw new Error("siteUrl is required in config");
|
|
93284
|
+
if (!config.contentDir)
|
|
93285
|
+
throw new Error("contentDir is required in config");
|
|
93286
|
+
if (!config.publicationUri)
|
|
93287
|
+
throw new Error("publicationUri is required in config");
|
|
93288
|
+
return config;
|
|
93289
|
+
} catch (error) {
|
|
93290
|
+
if (error instanceof Error && error.message.includes("required")) {
|
|
93291
|
+
throw error;
|
|
93292
|
+
}
|
|
93293
|
+
throw new Error(`Failed to load config from ${resolvedPath}: ${error}`);
|
|
93294
|
+
}
|
|
93295
|
+
}
|
|
93296
|
+
function generateConfigTemplate(options) {
|
|
93297
|
+
const config = {
|
|
93298
|
+
siteUrl: options.siteUrl,
|
|
93299
|
+
contentDir: options.contentDir
|
|
93300
|
+
};
|
|
93301
|
+
if (options.imagesDir) {
|
|
93302
|
+
config.imagesDir = options.imagesDir;
|
|
93303
|
+
}
|
|
93304
|
+
if (options.publicDir && options.publicDir !== "./public") {
|
|
93305
|
+
config.publicDir = options.publicDir;
|
|
93306
|
+
}
|
|
93307
|
+
if (options.outputDir) {
|
|
93308
|
+
config.outputDir = options.outputDir;
|
|
93309
|
+
}
|
|
93310
|
+
if (options.pathPrefix && options.pathPrefix !== "/posts") {
|
|
93311
|
+
config.pathPrefix = options.pathPrefix;
|
|
93312
|
+
}
|
|
93313
|
+
config.publicationUri = options.publicationUri;
|
|
93314
|
+
if (options.pdsUrl && options.pdsUrl !== "https://bsky.social") {
|
|
93315
|
+
config.pdsUrl = options.pdsUrl;
|
|
93316
|
+
}
|
|
93317
|
+
if (options.frontmatter && Object.keys(options.frontmatter).length > 0) {
|
|
93318
|
+
config.frontmatter = options.frontmatter;
|
|
93319
|
+
}
|
|
93320
|
+
if (options.ignore && options.ignore.length > 0) {
|
|
93321
|
+
config.ignore = options.ignore;
|
|
93322
|
+
}
|
|
93323
|
+
if (options.removeIndexFromSlug) {
|
|
93324
|
+
config.removeIndexFromSlug = options.removeIndexFromSlug;
|
|
93325
|
+
}
|
|
93326
|
+
if (options.stripDatePrefix) {
|
|
93327
|
+
config.stripDatePrefix = options.stripDatePrefix;
|
|
93328
|
+
}
|
|
93329
|
+
if (options.textContentField) {
|
|
93330
|
+
config.textContentField = options.textContentField;
|
|
93331
|
+
}
|
|
93332
|
+
if (options.bluesky) {
|
|
93333
|
+
config.bluesky = options.bluesky;
|
|
93334
|
+
}
|
|
93335
|
+
return JSON.stringify(config, null, 2);
|
|
93336
|
+
}
|
|
93337
|
+
async function loadState(configDir) {
|
|
93338
|
+
const statePath = path.join(configDir, STATE_FILENAME);
|
|
93339
|
+
if (!await fileExists(statePath)) {
|
|
93340
|
+
return { posts: {} };
|
|
93341
|
+
}
|
|
93342
|
+
try {
|
|
93343
|
+
const content = await fs.readFile(statePath, "utf-8");
|
|
93344
|
+
return JSON.parse(content);
|
|
93345
|
+
} catch {
|
|
93346
|
+
return { posts: {} };
|
|
93347
|
+
}
|
|
93348
|
+
}
|
|
93349
|
+
async function saveState(configDir, state) {
|
|
93350
|
+
const statePath = path.join(configDir, STATE_FILENAME);
|
|
93351
|
+
await fs.writeFile(statePath, JSON.stringify(state, null, 2));
|
|
93352
|
+
}
|
|
93353
|
+
|
|
93354
|
+
// src/commands/add.ts
|
|
93355
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
93356
|
+
var __dirname2 = dirname2(__filename2);
|
|
93357
|
+
var COMPONENTS_DIR = path2.join(__dirname2, "components");
|
|
93358
|
+
var DEFAULT_COMPONENTS_PATH = "src/components";
|
|
93359
|
+
var AVAILABLE_COMPONENTS = ["sequoia-comments"];
|
|
93360
|
+
var addCommand = import_cmd_ts.command({
|
|
93361
|
+
name: "add",
|
|
93362
|
+
description: "Add a UI component to your project",
|
|
93363
|
+
args: {
|
|
93364
|
+
componentName: import_cmd_ts.positional({
|
|
93365
|
+
type: import_cmd_ts.string,
|
|
93366
|
+
displayName: "component",
|
|
93367
|
+
description: "The name of the component to add"
|
|
93368
|
+
})
|
|
93369
|
+
},
|
|
93370
|
+
handler: async ({ componentName }) => {
|
|
93371
|
+
Nt("Add Sequoia Component");
|
|
93372
|
+
if (!AVAILABLE_COMPONENTS.includes(componentName)) {
|
|
93373
|
+
R2.error(`Component '${componentName}' not found`);
|
|
93374
|
+
R2.info("Available components:");
|
|
93375
|
+
for (const comp of AVAILABLE_COMPONENTS) {
|
|
93376
|
+
R2.info(` - ${comp}`);
|
|
93377
|
+
}
|
|
93378
|
+
process.exit(1);
|
|
93379
|
+
}
|
|
93380
|
+
const configPath = await findConfig();
|
|
93381
|
+
let config = null;
|
|
93382
|
+
let componentsDir = DEFAULT_COMPONENTS_PATH;
|
|
93383
|
+
if (configPath) {
|
|
93384
|
+
try {
|
|
93385
|
+
config = await loadConfig(configPath);
|
|
93386
|
+
if (config.ui?.components) {
|
|
93387
|
+
componentsDir = config.ui.components;
|
|
93388
|
+
}
|
|
93389
|
+
} catch {}
|
|
93390
|
+
}
|
|
93391
|
+
if (!config?.ui?.components) {
|
|
93392
|
+
R2.info("No UI configuration found in sequoia.json");
|
|
93393
|
+
const inputPath = await Qt({
|
|
93394
|
+
message: "Where would you like to install components?",
|
|
93395
|
+
placeholder: DEFAULT_COMPONENTS_PATH,
|
|
93396
|
+
defaultValue: DEFAULT_COMPONENTS_PATH
|
|
93397
|
+
});
|
|
93398
|
+
if (inputPath === Symbol.for("cancel")) {
|
|
93399
|
+
Wt2("Cancelled");
|
|
93400
|
+
process.exit(0);
|
|
93401
|
+
}
|
|
93402
|
+
componentsDir = inputPath;
|
|
93403
|
+
if (configPath) {
|
|
93404
|
+
const s2 = Ie();
|
|
93405
|
+
s2.start("Updating sequoia.json...");
|
|
93406
|
+
try {
|
|
93407
|
+
const configContent = await fs2.readFile(configPath, "utf-8");
|
|
93408
|
+
const existingConfig = JSON.parse(configContent);
|
|
93409
|
+
existingConfig.ui = { components: componentsDir };
|
|
93410
|
+
await fs2.writeFile(configPath, JSON.stringify(existingConfig, null, 2), "utf-8");
|
|
93411
|
+
s2.stop("Updated sequoia.json with UI configuration");
|
|
93412
|
+
} catch (error) {
|
|
93413
|
+
s2.stop("Failed to update sequoia.json");
|
|
93414
|
+
R2.warn(`Could not update config: ${error}`);
|
|
93415
|
+
}
|
|
93416
|
+
} else {
|
|
93417
|
+
const s2 = Ie();
|
|
93418
|
+
s2.start("Creating sequoia.json...");
|
|
93419
|
+
const minimalConfig = {
|
|
93420
|
+
ui: { components: componentsDir }
|
|
93421
|
+
};
|
|
93422
|
+
await fs2.writeFile(path2.join(process.cwd(), "sequoia.json"), JSON.stringify(minimalConfig, null, 2), "utf-8");
|
|
93423
|
+
s2.stop("Created sequoia.json with UI configuration");
|
|
93424
|
+
}
|
|
93425
|
+
}
|
|
93426
|
+
const resolvedComponentsDir = path2.isAbsolute(componentsDir) ? componentsDir : path2.join(process.cwd(), componentsDir);
|
|
93427
|
+
if (!existsSync(resolvedComponentsDir)) {
|
|
93428
|
+
const s2 = Ie();
|
|
93429
|
+
s2.start(`Creating ${componentsDir} directory...`);
|
|
93430
|
+
await fs2.mkdir(resolvedComponentsDir, { recursive: true });
|
|
93431
|
+
s2.stop(`Created ${componentsDir}`);
|
|
93432
|
+
}
|
|
93433
|
+
const sourceFile = path2.join(COMPONENTS_DIR, `${componentName}.js`);
|
|
93434
|
+
const destFile = path2.join(resolvedComponentsDir, `${componentName}.js`);
|
|
93435
|
+
if (!existsSync(sourceFile)) {
|
|
93436
|
+
R2.error(`Component source file not found: ${sourceFile}`);
|
|
93437
|
+
R2.info("This may be a build issue. Try reinstalling sequoia-cli.");
|
|
93438
|
+
process.exit(1);
|
|
93439
|
+
}
|
|
93440
|
+
const s = Ie();
|
|
93441
|
+
s.start(`Installing ${componentName}...`);
|
|
93442
|
+
try {
|
|
93443
|
+
const componentCode = await fs2.readFile(sourceFile, "utf-8");
|
|
93444
|
+
await fs2.writeFile(destFile, componentCode, "utf-8");
|
|
93445
|
+
s.stop(`Installed ${componentName}`);
|
|
93446
|
+
} catch (error) {
|
|
93447
|
+
s.stop("Failed to install component");
|
|
93448
|
+
R2.error(`Error: ${error}`);
|
|
93449
|
+
process.exit(1);
|
|
93450
|
+
}
|
|
93451
|
+
kt2(`Add to your HTML:
|
|
93452
|
+
|
|
93453
|
+
` + `<script type="module" src="${componentsDir}/${componentName}.js"></script>
|
|
93454
|
+
` + `<${componentName}></${componentName}>
|
|
93455
|
+
|
|
93456
|
+
` + `The component will automatically read the document URI from:
|
|
93457
|
+
` + `<link rel="site.standard.document" href="at://...">`, "Usage");
|
|
93458
|
+
Wt2(`${componentName} added successfully!`);
|
|
93459
|
+
}
|
|
93460
|
+
});
|
|
93461
|
+
|
|
93240
93462
|
// src/commands/auth.ts
|
|
93241
|
-
var
|
|
93463
|
+
var import_api2 = __toESM(require_dist8(), 1);
|
|
93464
|
+
var import_cmd_ts2 = __toESM(require_cjs(), 1);
|
|
93242
93465
|
|
|
93243
93466
|
// src/lib/atproto.ts
|
|
93244
93467
|
var import_api = __toESM(require_dist8(), 1);
|
|
@@ -93256,11 +93479,11 @@ var $extensions = Object.create(null);
|
|
|
93256
93479
|
var $lookup = lookup;
|
|
93257
93480
|
var $types = Object.create(null);
|
|
93258
93481
|
populateMaps($extensions, $types);
|
|
93259
|
-
function lookup(
|
|
93260
|
-
if (!
|
|
93482
|
+
function lookup(path3) {
|
|
93483
|
+
if (!path3 || typeof path3 !== "string") {
|
|
93261
93484
|
return false;
|
|
93262
93485
|
}
|
|
93263
|
-
var extension = extname("x." +
|
|
93486
|
+
var extension = extname("x." + path3).toLowerCase().substr(1);
|
|
93264
93487
|
if (!extension) {
|
|
93265
93488
|
return false;
|
|
93266
93489
|
}
|
|
@@ -93290,12 +93513,12 @@ function populateMaps(extensions, types) {
|
|
|
93290
93513
|
}
|
|
93291
93514
|
|
|
93292
93515
|
// src/lib/atproto.ts
|
|
93293
|
-
import * as
|
|
93294
|
-
import * as
|
|
93516
|
+
import * as fs5 from "node:fs/promises";
|
|
93517
|
+
import * as path6 from "node:path";
|
|
93295
93518
|
|
|
93296
93519
|
// src/lib/markdown.ts
|
|
93297
|
-
import * as
|
|
93298
|
-
import * as
|
|
93520
|
+
import * as fs3 from "node:fs/promises";
|
|
93521
|
+
import * as path4 from "node:path";
|
|
93299
93522
|
|
|
93300
93523
|
// ../../node_modules/.bun/@isaacs+balanced-match@4.0.1/node_modules/@isaacs/balanced-match/dist/esm/index.js
|
|
93301
93524
|
var balanced = (a, b, str) => {
|
|
@@ -94098,11 +94321,11 @@ var qmarksTestNoExtDot = ([$0]) => {
|
|
|
94098
94321
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
94099
94322
|
};
|
|
94100
94323
|
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
94101
|
-
var
|
|
94324
|
+
var path3 = {
|
|
94102
94325
|
win32: { sep: "\\" },
|
|
94103
94326
|
posix: { sep: "/" }
|
|
94104
94327
|
};
|
|
94105
|
-
var sep = defaultPlatform === "win32" ?
|
|
94328
|
+
var sep = defaultPlatform === "win32" ? path3.win32.sep : path3.posix.sep;
|
|
94106
94329
|
minimatch.sep = sep;
|
|
94107
94330
|
var GLOBSTAR = Symbol("globstar **");
|
|
94108
94331
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -94732,7 +94955,7 @@ minimatch.escape = escape;
|
|
|
94732
94955
|
minimatch.unescape = unescape;
|
|
94733
94956
|
|
|
94734
94957
|
// ../../node_modules/.bun/glob@13.0.0/node_modules/glob/dist/esm/glob.js
|
|
94735
|
-
import { fileURLToPath as
|
|
94958
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
94736
94959
|
|
|
94737
94960
|
// ../../node_modules/.bun/lru-cache@11.2.5/node_modules/lru-cache/dist/esm/index.js
|
|
94738
94961
|
var defaultPerf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
@@ -95895,7 +96118,7 @@ class LRUCache {
|
|
|
95895
96118
|
|
|
95896
96119
|
// ../../node_modules/.bun/path-scurry@2.0.1/node_modules/path-scurry/dist/esm/index.js
|
|
95897
96120
|
import { posix, win32 } from "node:path";
|
|
95898
|
-
import { fileURLToPath } from "node:url";
|
|
96121
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
95899
96122
|
import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps } from "fs";
|
|
95900
96123
|
import * as actualFS from "node:fs";
|
|
95901
96124
|
import { lstat, readdir, readlink, realpath } from "node:fs/promises";
|
|
@@ -96765,12 +96988,12 @@ class PathBase {
|
|
|
96765
96988
|
childrenCache() {
|
|
96766
96989
|
return this.#children;
|
|
96767
96990
|
}
|
|
96768
|
-
resolve(
|
|
96769
|
-
if (!
|
|
96991
|
+
resolve(path4) {
|
|
96992
|
+
if (!path4) {
|
|
96770
96993
|
return this;
|
|
96771
96994
|
}
|
|
96772
|
-
const rootPath = this.getRootString(
|
|
96773
|
-
const dir =
|
|
96995
|
+
const rootPath = this.getRootString(path4);
|
|
96996
|
+
const dir = path4.substring(rootPath.length);
|
|
96774
96997
|
const dirParts = dir.split(this.splitSep);
|
|
96775
96998
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
96776
96999
|
return result;
|
|
@@ -97299,8 +97522,8 @@ class PathWin32 extends PathBase {
|
|
|
97299
97522
|
newChild(name, type = UNKNOWN, opts = {}) {
|
|
97300
97523
|
return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
|
|
97301
97524
|
}
|
|
97302
|
-
getRootString(
|
|
97303
|
-
return win32.parse(
|
|
97525
|
+
getRootString(path4) {
|
|
97526
|
+
return win32.parse(path4).root;
|
|
97304
97527
|
}
|
|
97305
97528
|
getRoot(rootPath) {
|
|
97306
97529
|
rootPath = uncToDrive(rootPath.toUpperCase());
|
|
@@ -97326,8 +97549,8 @@ class PathPosix extends PathBase {
|
|
|
97326
97549
|
constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
|
|
97327
97550
|
super(name, type, root, roots, nocase, children, opts);
|
|
97328
97551
|
}
|
|
97329
|
-
getRootString(
|
|
97330
|
-
return
|
|
97552
|
+
getRootString(path4) {
|
|
97553
|
+
return path4.startsWith("/") ? "/" : "";
|
|
97331
97554
|
}
|
|
97332
97555
|
getRoot(_rootPath) {
|
|
97333
97556
|
return this.root;
|
|
@@ -97347,10 +97570,10 @@ class PathScurryBase {
|
|
|
97347
97570
|
#children;
|
|
97348
97571
|
nocase;
|
|
97349
97572
|
#fs;
|
|
97350
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
|
|
97351
|
-
this.#fs = fsFromOption(
|
|
97573
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs3 = defaultFS } = {}) {
|
|
97574
|
+
this.#fs = fsFromOption(fs3);
|
|
97352
97575
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
97353
|
-
cwd =
|
|
97576
|
+
cwd = fileURLToPath2(cwd);
|
|
97354
97577
|
}
|
|
97355
97578
|
const cwdPath = pathImpl.resolve(cwd);
|
|
97356
97579
|
this.roots = Object.create(null);
|
|
@@ -97384,11 +97607,11 @@ class PathScurryBase {
|
|
|
97384
97607
|
}
|
|
97385
97608
|
this.cwd = prev;
|
|
97386
97609
|
}
|
|
97387
|
-
depth(
|
|
97388
|
-
if (typeof
|
|
97389
|
-
|
|
97610
|
+
depth(path4 = this.cwd) {
|
|
97611
|
+
if (typeof path4 === "string") {
|
|
97612
|
+
path4 = this.cwd.resolve(path4);
|
|
97390
97613
|
}
|
|
97391
|
-
return
|
|
97614
|
+
return path4.depth();
|
|
97392
97615
|
}
|
|
97393
97616
|
childrenCache() {
|
|
97394
97617
|
return this.#children;
|
|
@@ -97804,9 +98027,9 @@ class PathScurryBase {
|
|
|
97804
98027
|
process3();
|
|
97805
98028
|
return results;
|
|
97806
98029
|
}
|
|
97807
|
-
chdir(
|
|
98030
|
+
chdir(path4 = this.cwd) {
|
|
97808
98031
|
const oldCwd = this.cwd;
|
|
97809
|
-
this.cwd = typeof
|
|
98032
|
+
this.cwd = typeof path4 === "string" ? this.cwd.resolve(path4) : path4;
|
|
97810
98033
|
this.cwd[setAsCwd](oldCwd);
|
|
97811
98034
|
}
|
|
97812
98035
|
}
|
|
@@ -97824,8 +98047,8 @@ class PathScurryWin32 extends PathScurryBase {
|
|
|
97824
98047
|
parseRootPath(dir) {
|
|
97825
98048
|
return win32.parse(dir).root.toUpperCase();
|
|
97826
98049
|
}
|
|
97827
|
-
newRoot(
|
|
97828
|
-
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
|
|
98050
|
+
newRoot(fs3) {
|
|
98051
|
+
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs3 });
|
|
97829
98052
|
}
|
|
97830
98053
|
isAbsolute(p) {
|
|
97831
98054
|
return p.startsWith("/") || p.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p);
|
|
@@ -97842,8 +98065,8 @@ class PathScurryPosix extends PathScurryBase {
|
|
|
97842
98065
|
parseRootPath(_dir) {
|
|
97843
98066
|
return "/";
|
|
97844
98067
|
}
|
|
97845
|
-
newRoot(
|
|
97846
|
-
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
|
|
98068
|
+
newRoot(fs3) {
|
|
98069
|
+
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs3 });
|
|
97847
98070
|
}
|
|
97848
98071
|
isAbsolute(p) {
|
|
97849
98072
|
return p.startsWith("/");
|
|
@@ -98095,8 +98318,8 @@ class MatchRecord {
|
|
|
98095
98318
|
this.store.set(target, current === undefined ? n : n & current);
|
|
98096
98319
|
}
|
|
98097
98320
|
entries() {
|
|
98098
|
-
return [...this.store.entries()].map(([
|
|
98099
|
-
|
|
98321
|
+
return [...this.store.entries()].map(([path4, n]) => [
|
|
98322
|
+
path4,
|
|
98100
98323
|
!!(n & 2),
|
|
98101
98324
|
!!(n & 1)
|
|
98102
98325
|
]);
|
|
@@ -98299,9 +98522,9 @@ class GlobUtil {
|
|
|
98299
98522
|
signal;
|
|
98300
98523
|
maxDepth;
|
|
98301
98524
|
includeChildMatches;
|
|
98302
|
-
constructor(patterns,
|
|
98525
|
+
constructor(patterns, path4, opts) {
|
|
98303
98526
|
this.patterns = patterns;
|
|
98304
|
-
this.path =
|
|
98527
|
+
this.path = path4;
|
|
98305
98528
|
this.opts = opts;
|
|
98306
98529
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
98307
98530
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -98320,11 +98543,11 @@ class GlobUtil {
|
|
|
98320
98543
|
});
|
|
98321
98544
|
}
|
|
98322
98545
|
}
|
|
98323
|
-
#ignored(
|
|
98324
|
-
return this.seen.has(
|
|
98546
|
+
#ignored(path4) {
|
|
98547
|
+
return this.seen.has(path4) || !!this.#ignore?.ignored?.(path4);
|
|
98325
98548
|
}
|
|
98326
|
-
#childrenIgnored(
|
|
98327
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
98549
|
+
#childrenIgnored(path4) {
|
|
98550
|
+
return !!this.#ignore?.childrenIgnored?.(path4);
|
|
98328
98551
|
}
|
|
98329
98552
|
pause() {
|
|
98330
98553
|
this.paused = true;
|
|
@@ -98537,8 +98760,8 @@ class GlobUtil {
|
|
|
98537
98760
|
|
|
98538
98761
|
class GlobWalker extends GlobUtil {
|
|
98539
98762
|
matches = new Set;
|
|
98540
|
-
constructor(patterns,
|
|
98541
|
-
super(patterns,
|
|
98763
|
+
constructor(patterns, path4, opts) {
|
|
98764
|
+
super(patterns, path4, opts);
|
|
98542
98765
|
}
|
|
98543
98766
|
matchEmit(e) {
|
|
98544
98767
|
this.matches.add(e);
|
|
@@ -98576,8 +98799,8 @@ class GlobWalker extends GlobUtil {
|
|
|
98576
98799
|
|
|
98577
98800
|
class GlobStream extends GlobUtil {
|
|
98578
98801
|
results;
|
|
98579
|
-
constructor(patterns,
|
|
98580
|
-
super(patterns,
|
|
98802
|
+
constructor(patterns, path4, opts) {
|
|
98803
|
+
super(patterns, path4, opts);
|
|
98581
98804
|
this.results = new Minipass({
|
|
98582
98805
|
signal: this.signal,
|
|
98583
98806
|
objectMode: true
|
|
@@ -98654,7 +98877,7 @@ class Glob {
|
|
|
98654
98877
|
if (!opts.cwd) {
|
|
98655
98878
|
this.cwd = "";
|
|
98656
98879
|
} else if (opts.cwd instanceof URL || opts.cwd.startsWith("file://")) {
|
|
98657
|
-
opts.cwd =
|
|
98880
|
+
opts.cwd = fileURLToPath3(opts.cwd);
|
|
98658
98881
|
}
|
|
98659
98882
|
this.cwd = opts.cwd || "";
|
|
98660
98883
|
this.root = opts.root;
|
|
@@ -99021,8 +99244,8 @@ async function scanContentDirectory(contentDir, frontmatterMappingOrOptions, ign
|
|
|
99021
99244
|
if (shouldIgnore(relativePath, ignore)) {
|
|
99022
99245
|
continue;
|
|
99023
99246
|
}
|
|
99024
|
-
const filePath =
|
|
99025
|
-
const rawContent = await
|
|
99247
|
+
const filePath = path4.join(contentDir, relativePath);
|
|
99248
|
+
const rawContent = await fs3.readFile(filePath, "utf-8");
|
|
99026
99249
|
try {
|
|
99027
99250
|
const { frontmatter, body, rawFrontmatter } = parseFrontmatter(rawContent, frontmatterMapping);
|
|
99028
99251
|
const slug = getSlugFromOptions(relativePath, rawFrontmatter, {
|
|
@@ -99078,34 +99301,34 @@ function stripMarkdownForText(markdown) {
|
|
|
99078
99301
|
var import_oauth_client_node = __toESM(require_dist24(), 1);
|
|
99079
99302
|
|
|
99080
99303
|
// src/lib/oauth-store.ts
|
|
99081
|
-
import * as
|
|
99304
|
+
import * as fs4 from "node:fs/promises";
|
|
99082
99305
|
import * as os2 from "node:os";
|
|
99083
|
-
import * as
|
|
99084
|
-
var CONFIG_DIR =
|
|
99085
|
-
var OAUTH_FILE =
|
|
99086
|
-
async function
|
|
99306
|
+
import * as path5 from "node:path";
|
|
99307
|
+
var CONFIG_DIR = path5.join(os2.homedir(), ".config", "sequoia");
|
|
99308
|
+
var OAUTH_FILE = path5.join(CONFIG_DIR, "oauth.json");
|
|
99309
|
+
async function fileExists2(filePath) {
|
|
99087
99310
|
try {
|
|
99088
|
-
await
|
|
99311
|
+
await fs4.access(filePath);
|
|
99089
99312
|
return true;
|
|
99090
99313
|
} catch {
|
|
99091
99314
|
return false;
|
|
99092
99315
|
}
|
|
99093
99316
|
}
|
|
99094
99317
|
async function loadOAuthStore() {
|
|
99095
|
-
if (!await
|
|
99318
|
+
if (!await fileExists2(OAUTH_FILE)) {
|
|
99096
99319
|
return { states: {}, sessions: {} };
|
|
99097
99320
|
}
|
|
99098
99321
|
try {
|
|
99099
|
-
const content = await
|
|
99322
|
+
const content = await fs4.readFile(OAUTH_FILE, "utf-8");
|
|
99100
99323
|
return JSON.parse(content);
|
|
99101
99324
|
} catch {
|
|
99102
99325
|
return { states: {}, sessions: {} };
|
|
99103
99326
|
}
|
|
99104
99327
|
}
|
|
99105
99328
|
async function saveOAuthStore(store) {
|
|
99106
|
-
await
|
|
99107
|
-
await
|
|
99108
|
-
await
|
|
99329
|
+
await fs4.mkdir(CONFIG_DIR, { recursive: true });
|
|
99330
|
+
await fs4.writeFile(OAUTH_FILE, JSON.stringify(store, null, 2));
|
|
99331
|
+
await fs4.chmod(OAUTH_FILE, 384);
|
|
99109
99332
|
}
|
|
99110
99333
|
var stateStore = {
|
|
99111
99334
|
async set(key, state) {
|
|
@@ -99252,9 +99475,9 @@ function isDocumentRecord(value) {
|
|
|
99252
99475
|
const v = value;
|
|
99253
99476
|
return v.$type === "site.standard.document" && typeof v.title === "string" && typeof v.site === "string" && typeof v.path === "string" && typeof v.textContent === "string" && typeof v.publishedAt === "string";
|
|
99254
99477
|
}
|
|
99255
|
-
async function
|
|
99478
|
+
async function fileExists3(filePath) {
|
|
99256
99479
|
try {
|
|
99257
|
-
await
|
|
99480
|
+
await fs5.access(filePath);
|
|
99258
99481
|
return true;
|
|
99259
99482
|
} catch {
|
|
99260
99483
|
return false;
|
|
@@ -99326,11 +99549,11 @@ async function createAgent(credentials) {
|
|
|
99326
99549
|
return agent;
|
|
99327
99550
|
}
|
|
99328
99551
|
async function uploadImage(agent, imagePath) {
|
|
99329
|
-
if (!await
|
|
99552
|
+
if (!await fileExists3(imagePath)) {
|
|
99330
99553
|
return;
|
|
99331
99554
|
}
|
|
99332
99555
|
try {
|
|
99333
|
-
const imageBuffer = await
|
|
99556
|
+
const imageBuffer = await fs5.readFile(imagePath);
|
|
99334
99557
|
const mimeType = $lookup(imagePath) || "application/octet-stream";
|
|
99335
99558
|
const response = await agent.com.atproto.repo.uploadBlob(new Uint8Array(imageBuffer), {
|
|
99336
99559
|
encoding: mimeType
|
|
@@ -99350,29 +99573,29 @@ async function uploadImage(agent, imagePath) {
|
|
|
99350
99573
|
}
|
|
99351
99574
|
async function resolveImagePath(ogImage, imagesDir, contentDir) {
|
|
99352
99575
|
if (imagesDir) {
|
|
99353
|
-
const imagesDirBaseName =
|
|
99576
|
+
const imagesDirBaseName = path6.basename(imagesDir);
|
|
99354
99577
|
const imagesDirIndex = ogImage.indexOf(imagesDirBaseName);
|
|
99355
99578
|
let relativePath;
|
|
99356
99579
|
if (imagesDirIndex !== -1) {
|
|
99357
99580
|
const afterImagesDir = ogImage.substring(imagesDirIndex + imagesDirBaseName.length);
|
|
99358
99581
|
relativePath = afterImagesDir.replace(/^[/\\]/, "");
|
|
99359
99582
|
} else {
|
|
99360
|
-
relativePath =
|
|
99583
|
+
relativePath = path6.basename(ogImage);
|
|
99361
99584
|
}
|
|
99362
|
-
const imagePath =
|
|
99363
|
-
if (await
|
|
99364
|
-
const stat2 = await
|
|
99585
|
+
const imagePath = path6.join(imagesDir, relativePath);
|
|
99586
|
+
if (await fileExists3(imagePath)) {
|
|
99587
|
+
const stat2 = await fs5.stat(imagePath);
|
|
99365
99588
|
if (stat2.size > 0) {
|
|
99366
99589
|
return imagePath;
|
|
99367
99590
|
}
|
|
99368
99591
|
}
|
|
99369
99592
|
}
|
|
99370
|
-
if (
|
|
99593
|
+
if (path6.isAbsolute(ogImage)) {
|
|
99371
99594
|
return ogImage;
|
|
99372
99595
|
}
|
|
99373
|
-
const contentRelative =
|
|
99374
|
-
if (await
|
|
99375
|
-
const stat2 = await
|
|
99596
|
+
const contentRelative = path6.join(contentDir, ogImage);
|
|
99597
|
+
if (await fileExists3(contentRelative)) {
|
|
99598
|
+
const stat2 = await fs5.stat(contentRelative);
|
|
99376
99599
|
if (stat2.size > 0) {
|
|
99377
99600
|
return contentRelative;
|
|
99378
99601
|
}
|
|
@@ -99705,14 +99928,14 @@ async function addBskyPostRefToDocument(agent, documentAtUri, bskyPostRef) {
|
|
|
99705
99928
|
}
|
|
99706
99929
|
|
|
99707
99930
|
// src/lib/credentials.ts
|
|
99708
|
-
import * as
|
|
99931
|
+
import * as fs6 from "node:fs/promises";
|
|
99709
99932
|
import * as os3 from "node:os";
|
|
99710
|
-
import * as
|
|
99711
|
-
var CONFIG_DIR2 =
|
|
99712
|
-
var CREDENTIALS_FILE =
|
|
99713
|
-
async function
|
|
99933
|
+
import * as path7 from "node:path";
|
|
99934
|
+
var CONFIG_DIR2 = path7.join(os3.homedir(), ".config", "sequoia");
|
|
99935
|
+
var CREDENTIALS_FILE = path7.join(CONFIG_DIR2, "credentials.json");
|
|
99936
|
+
async function fileExists4(filePath) {
|
|
99714
99937
|
try {
|
|
99715
|
-
await
|
|
99938
|
+
await fs6.access(filePath);
|
|
99716
99939
|
return true;
|
|
99717
99940
|
} catch {
|
|
99718
99941
|
return false;
|
|
@@ -99730,11 +99953,11 @@ function normalizeCredentials(creds) {
|
|
|
99730
99953
|
};
|
|
99731
99954
|
}
|
|
99732
99955
|
async function loadCredentialsStore() {
|
|
99733
|
-
if (!await
|
|
99956
|
+
if (!await fileExists4(CREDENTIALS_FILE)) {
|
|
99734
99957
|
return {};
|
|
99735
99958
|
}
|
|
99736
99959
|
try {
|
|
99737
|
-
const content = await
|
|
99960
|
+
const content = await fs6.readFile(CREDENTIALS_FILE, "utf-8");
|
|
99738
99961
|
const parsed = JSON.parse(content);
|
|
99739
99962
|
if (parsed.identifier && parsed.password) {
|
|
99740
99963
|
const legacy = parsed;
|
|
@@ -99746,9 +99969,9 @@ async function loadCredentialsStore() {
|
|
|
99746
99969
|
}
|
|
99747
99970
|
}
|
|
99748
99971
|
async function saveCredentialsStore(store) {
|
|
99749
|
-
await
|
|
99750
|
-
await
|
|
99751
|
-
await
|
|
99972
|
+
await fs6.mkdir(CONFIG_DIR2, { recursive: true });
|
|
99973
|
+
await fs6.writeFile(CREDENTIALS_FILE, JSON.stringify(store, null, 2));
|
|
99974
|
+
await fs6.chmod(CREDENTIALS_FILE, 384);
|
|
99752
99975
|
}
|
|
99753
99976
|
async function tryLoadOAuthCredentials(profile) {
|
|
99754
99977
|
if (profile.startsWith("did:")) {
|
|
@@ -99889,16 +100112,16 @@ function exitOnCancel(value) {
|
|
|
99889
100112
|
}
|
|
99890
100113
|
|
|
99891
100114
|
// src/commands/auth.ts
|
|
99892
|
-
var authCommand =
|
|
100115
|
+
var authCommand = import_cmd_ts2.command({
|
|
99893
100116
|
name: "auth",
|
|
99894
100117
|
description: "Authenticate with your ATProto PDS",
|
|
99895
100118
|
args: {
|
|
99896
|
-
logout:
|
|
100119
|
+
logout: import_cmd_ts2.option({
|
|
99897
100120
|
long: "logout",
|
|
99898
100121
|
description: "Remove credentials for a specific identity (or all if only one exists)",
|
|
99899
|
-
type:
|
|
100122
|
+
type: import_cmd_ts2.optional(import_cmd_ts2.string)
|
|
99900
100123
|
}),
|
|
99901
|
-
list:
|
|
100124
|
+
list: import_cmd_ts2.flag({
|
|
99902
100125
|
long: "list",
|
|
99903
100126
|
description: "List all stored identities"
|
|
99904
100127
|
})
|
|
@@ -100011,116 +100234,9 @@ var authCommand = import_cmd_ts.command({
|
|
|
100011
100234
|
});
|
|
100012
100235
|
|
|
100013
100236
|
// src/commands/init.ts
|
|
100014
|
-
var
|
|
100015
|
-
import * as
|
|
100016
|
-
import * as
|
|
100017
|
-
|
|
100018
|
-
// src/lib/config.ts
|
|
100019
|
-
import * as fs5 from "node:fs/promises";
|
|
100020
|
-
import * as path6 from "node:path";
|
|
100021
|
-
var CONFIG_FILENAME = "sequoia.json";
|
|
100022
|
-
var STATE_FILENAME = ".sequoia-state.json";
|
|
100023
|
-
async function fileExists4(filePath) {
|
|
100024
|
-
try {
|
|
100025
|
-
await fs5.access(filePath);
|
|
100026
|
-
return true;
|
|
100027
|
-
} catch {
|
|
100028
|
-
return false;
|
|
100029
|
-
}
|
|
100030
|
-
}
|
|
100031
|
-
async function findConfig(startDir = process.cwd()) {
|
|
100032
|
-
let currentDir = startDir;
|
|
100033
|
-
while (true) {
|
|
100034
|
-
const configPath = path6.join(currentDir, CONFIG_FILENAME);
|
|
100035
|
-
if (await fileExists4(configPath)) {
|
|
100036
|
-
return configPath;
|
|
100037
|
-
}
|
|
100038
|
-
const parentDir = path6.dirname(currentDir);
|
|
100039
|
-
if (parentDir === currentDir) {
|
|
100040
|
-
return null;
|
|
100041
|
-
}
|
|
100042
|
-
currentDir = parentDir;
|
|
100043
|
-
}
|
|
100044
|
-
}
|
|
100045
|
-
async function loadConfig(configPath) {
|
|
100046
|
-
const resolvedPath = configPath || await findConfig();
|
|
100047
|
-
if (!resolvedPath) {
|
|
100048
|
-
throw new Error(`Could not find ${CONFIG_FILENAME}. Run 'sequoia init' to create one.`);
|
|
100049
|
-
}
|
|
100050
|
-
try {
|
|
100051
|
-
const content = await fs5.readFile(resolvedPath, "utf-8");
|
|
100052
|
-
const config = JSON.parse(content);
|
|
100053
|
-
if (!config.siteUrl)
|
|
100054
|
-
throw new Error("siteUrl is required in config");
|
|
100055
|
-
if (!config.contentDir)
|
|
100056
|
-
throw new Error("contentDir is required in config");
|
|
100057
|
-
if (!config.publicationUri)
|
|
100058
|
-
throw new Error("publicationUri is required in config");
|
|
100059
|
-
return config;
|
|
100060
|
-
} catch (error) {
|
|
100061
|
-
if (error instanceof Error && error.message.includes("required")) {
|
|
100062
|
-
throw error;
|
|
100063
|
-
}
|
|
100064
|
-
throw new Error(`Failed to load config from ${resolvedPath}: ${error}`);
|
|
100065
|
-
}
|
|
100066
|
-
}
|
|
100067
|
-
function generateConfigTemplate(options) {
|
|
100068
|
-
const config = {
|
|
100069
|
-
siteUrl: options.siteUrl,
|
|
100070
|
-
contentDir: options.contentDir
|
|
100071
|
-
};
|
|
100072
|
-
if (options.imagesDir) {
|
|
100073
|
-
config.imagesDir = options.imagesDir;
|
|
100074
|
-
}
|
|
100075
|
-
if (options.publicDir && options.publicDir !== "./public") {
|
|
100076
|
-
config.publicDir = options.publicDir;
|
|
100077
|
-
}
|
|
100078
|
-
if (options.outputDir) {
|
|
100079
|
-
config.outputDir = options.outputDir;
|
|
100080
|
-
}
|
|
100081
|
-
if (options.pathPrefix && options.pathPrefix !== "/posts") {
|
|
100082
|
-
config.pathPrefix = options.pathPrefix;
|
|
100083
|
-
}
|
|
100084
|
-
config.publicationUri = options.publicationUri;
|
|
100085
|
-
if (options.pdsUrl && options.pdsUrl !== "https://bsky.social") {
|
|
100086
|
-
config.pdsUrl = options.pdsUrl;
|
|
100087
|
-
}
|
|
100088
|
-
if (options.frontmatter && Object.keys(options.frontmatter).length > 0) {
|
|
100089
|
-
config.frontmatter = options.frontmatter;
|
|
100090
|
-
}
|
|
100091
|
-
if (options.ignore && options.ignore.length > 0) {
|
|
100092
|
-
config.ignore = options.ignore;
|
|
100093
|
-
}
|
|
100094
|
-
if (options.removeIndexFromSlug) {
|
|
100095
|
-
config.removeIndexFromSlug = options.removeIndexFromSlug;
|
|
100096
|
-
}
|
|
100097
|
-
if (options.stripDatePrefix) {
|
|
100098
|
-
config.stripDatePrefix = options.stripDatePrefix;
|
|
100099
|
-
}
|
|
100100
|
-
if (options.textContentField) {
|
|
100101
|
-
config.textContentField = options.textContentField;
|
|
100102
|
-
}
|
|
100103
|
-
if (options.bluesky) {
|
|
100104
|
-
config.bluesky = options.bluesky;
|
|
100105
|
-
}
|
|
100106
|
-
return JSON.stringify(config, null, 2);
|
|
100107
|
-
}
|
|
100108
|
-
async function loadState(configDir) {
|
|
100109
|
-
const statePath = path6.join(configDir, STATE_FILENAME);
|
|
100110
|
-
if (!await fileExists4(statePath)) {
|
|
100111
|
-
return { posts: {} };
|
|
100112
|
-
}
|
|
100113
|
-
try {
|
|
100114
|
-
const content = await fs5.readFile(statePath, "utf-8");
|
|
100115
|
-
return JSON.parse(content);
|
|
100116
|
-
} catch {
|
|
100117
|
-
return { posts: {} };
|
|
100118
|
-
}
|
|
100119
|
-
}
|
|
100120
|
-
async function saveState(configDir, state) {
|
|
100121
|
-
const statePath = path6.join(configDir, STATE_FILENAME);
|
|
100122
|
-
await fs5.writeFile(statePath, JSON.stringify(state, null, 2));
|
|
100123
|
-
}
|
|
100237
|
+
var import_cmd_ts3 = __toESM(require_cjs(), 1);
|
|
100238
|
+
import * as fs7 from "node:fs/promises";
|
|
100239
|
+
import * as path8 from "node:path";
|
|
100124
100240
|
|
|
100125
100241
|
// src/lib/credential-select.ts
|
|
100126
100242
|
async function selectCredential(allCredentials) {
|
|
@@ -100161,7 +100277,7 @@ async function selectCredential(allCredentials) {
|
|
|
100161
100277
|
// src/commands/init.ts
|
|
100162
100278
|
async function fileExists5(filePath) {
|
|
100163
100279
|
try {
|
|
100164
|
-
await
|
|
100280
|
+
await fs7.access(filePath);
|
|
100165
100281
|
return true;
|
|
100166
100282
|
} catch {
|
|
100167
100283
|
return false;
|
|
@@ -100171,7 +100287,7 @@ var onCancel = () => {
|
|
|
100171
100287
|
Wt2("Setup cancelled");
|
|
100172
100288
|
process.exit(0);
|
|
100173
100289
|
};
|
|
100174
|
-
var initCommand =
|
|
100290
|
+
var initCommand = import_cmd_ts3.command({
|
|
100175
100291
|
name: "init",
|
|
100176
100292
|
description: "Initialize a new publisher configuration",
|
|
100177
100293
|
args: {},
|
|
@@ -100410,29 +100526,29 @@ var initCommand = import_cmd_ts2.command({
|
|
|
100410
100526
|
frontmatter: frontmatterMapping,
|
|
100411
100527
|
bluesky: blueskyConfig
|
|
100412
100528
|
});
|
|
100413
|
-
const configPath =
|
|
100414
|
-
await
|
|
100529
|
+
const configPath = path8.join(process.cwd(), "sequoia.json");
|
|
100530
|
+
await fs7.writeFile(configPath, configContent);
|
|
100415
100531
|
R2.success(`Configuration saved to ${configPath}`);
|
|
100416
100532
|
const publicDir = siteConfig.publicDir || "./public";
|
|
100417
|
-
const resolvedPublicDir =
|
|
100418
|
-
const wellKnownDir =
|
|
100419
|
-
const wellKnownPath =
|
|
100420
|
-
await
|
|
100421
|
-
await
|
|
100422
|
-
await
|
|
100533
|
+
const resolvedPublicDir = path8.isAbsolute(publicDir) ? publicDir : path8.join(process.cwd(), publicDir);
|
|
100534
|
+
const wellKnownDir = path8.join(resolvedPublicDir, ".well-known");
|
|
100535
|
+
const wellKnownPath = path8.join(wellKnownDir, "site.standard.publication");
|
|
100536
|
+
await fs7.mkdir(wellKnownDir, { recursive: true });
|
|
100537
|
+
await fs7.writeFile(path8.join(wellKnownDir, ".gitkeep"), "");
|
|
100538
|
+
await fs7.writeFile(wellKnownPath, publicationUri);
|
|
100423
100539
|
R2.success(`Created ${wellKnownPath}`);
|
|
100424
|
-
const gitignorePath =
|
|
100540
|
+
const gitignorePath = path8.join(process.cwd(), ".gitignore");
|
|
100425
100541
|
const stateFilename = ".sequoia-state.json";
|
|
100426
100542
|
if (await fileExists5(gitignorePath)) {
|
|
100427
|
-
const gitignoreContent = await
|
|
100543
|
+
const gitignoreContent = await fs7.readFile(gitignorePath, "utf-8");
|
|
100428
100544
|
if (!gitignoreContent.includes(stateFilename)) {
|
|
100429
|
-
await
|
|
100545
|
+
await fs7.writeFile(gitignorePath, `${gitignoreContent}
|
|
100430
100546
|
${stateFilename}
|
|
100431
100547
|
`);
|
|
100432
100548
|
R2.info(`Added ${stateFilename} to .gitignore`);
|
|
100433
100549
|
}
|
|
100434
100550
|
} else {
|
|
100435
|
-
await
|
|
100551
|
+
await fs7.writeFile(gitignorePath, `${stateFilename}
|
|
100436
100552
|
`);
|
|
100437
100553
|
R2.info(`Created .gitignore with ${stateFilename}`);
|
|
100438
100554
|
}
|
|
@@ -100444,20 +100560,20 @@ ${stateFilename}
|
|
|
100444
100560
|
});
|
|
100445
100561
|
|
|
100446
100562
|
// src/commands/inject.ts
|
|
100447
|
-
var
|
|
100448
|
-
import * as
|
|
100449
|
-
import * as
|
|
100450
|
-
var injectCommand =
|
|
100563
|
+
var import_cmd_ts4 = __toESM(require_cjs(), 1);
|
|
100564
|
+
import * as fs8 from "node:fs/promises";
|
|
100565
|
+
import * as path9 from "node:path";
|
|
100566
|
+
var injectCommand = import_cmd_ts4.command({
|
|
100451
100567
|
name: "inject",
|
|
100452
100568
|
description: "Inject site.standard.document link tags into built HTML files",
|
|
100453
100569
|
args: {
|
|
100454
|
-
outputDir:
|
|
100570
|
+
outputDir: import_cmd_ts4.option({
|
|
100455
100571
|
long: "output",
|
|
100456
100572
|
short: "o",
|
|
100457
100573
|
description: "Output directory to scan for HTML files",
|
|
100458
|
-
type:
|
|
100574
|
+
type: import_cmd_ts4.optional(import_cmd_ts4.string)
|
|
100459
100575
|
}),
|
|
100460
|
-
dryRun:
|
|
100576
|
+
dryRun: import_cmd_ts4.flag({
|
|
100461
100577
|
long: "dry-run",
|
|
100462
100578
|
short: "n",
|
|
100463
100579
|
description: "Preview what would be injected without making changes"
|
|
@@ -100470,9 +100586,9 @@ var injectCommand = import_cmd_ts3.command({
|
|
|
100470
100586
|
process.exit(1);
|
|
100471
100587
|
}
|
|
100472
100588
|
const config = await loadConfig(configPath);
|
|
100473
|
-
const configDir =
|
|
100589
|
+
const configDir = path9.dirname(configPath);
|
|
100474
100590
|
const outputDir = outputDirArg || config.outputDir || "./dist";
|
|
100475
|
-
const resolvedOutputDir =
|
|
100591
|
+
const resolvedOutputDir = path9.isAbsolute(outputDir) ? outputDir : path9.join(configDir, outputDir);
|
|
100476
100592
|
R2.info(`Scanning for HTML files in: ${resolvedOutputDir}`);
|
|
100477
100593
|
const state = await loadState(configDir);
|
|
100478
100594
|
const slugToAtUri = new Map;
|
|
@@ -100484,7 +100600,7 @@ var injectCommand = import_cmd_ts3.command({
|
|
|
100484
100600
|
slugToAtUri.set(lastSegment, postState.atUri);
|
|
100485
100601
|
}
|
|
100486
100602
|
} else if (postState.atUri) {
|
|
100487
|
-
const basename3 =
|
|
100603
|
+
const basename3 = path9.basename(filePath, path9.extname(filePath));
|
|
100488
100604
|
slugToAtUri.set(basename3.toLowerCase(), postState.atUri);
|
|
100489
100605
|
}
|
|
100490
100606
|
}
|
|
@@ -100506,16 +100622,16 @@ var injectCommand = import_cmd_ts3.command({
|
|
|
100506
100622
|
let skippedCount = 0;
|
|
100507
100623
|
let alreadyHasCount = 0;
|
|
100508
100624
|
for (const file of htmlFiles) {
|
|
100509
|
-
const htmlPath =
|
|
100625
|
+
const htmlPath = path9.join(resolvedOutputDir, file);
|
|
100510
100626
|
const relativePath = file;
|
|
100511
|
-
const htmlDir =
|
|
100512
|
-
const htmlBasename =
|
|
100627
|
+
const htmlDir = path9.dirname(relativePath);
|
|
100628
|
+
const htmlBasename = path9.basename(relativePath, ".html");
|
|
100513
100629
|
let atUri;
|
|
100514
100630
|
atUri = slugToAtUri.get(htmlBasename);
|
|
100515
100631
|
if (!atUri && htmlBasename === "index" && htmlDir !== ".") {
|
|
100516
100632
|
atUri = slugToAtUri.get(htmlDir);
|
|
100517
100633
|
if (!atUri) {
|
|
100518
|
-
const lastDir =
|
|
100634
|
+
const lastDir = path9.basename(htmlDir);
|
|
100519
100635
|
atUri = slugToAtUri.get(lastDir);
|
|
100520
100636
|
}
|
|
100521
100637
|
}
|
|
@@ -100526,7 +100642,7 @@ var injectCommand = import_cmd_ts3.command({
|
|
|
100526
100642
|
skippedCount++;
|
|
100527
100643
|
continue;
|
|
100528
100644
|
}
|
|
100529
|
-
let content = await
|
|
100645
|
+
let content = await fs8.readFile(htmlPath, "utf-8");
|
|
100530
100646
|
const linkTag = `<link rel="site.standard.document" href="${atUri}">`;
|
|
100531
100647
|
if (content.includes('rel="site.standard.document"')) {
|
|
100532
100648
|
alreadyHasCount++;
|
|
@@ -100547,7 +100663,7 @@ var injectCommand = import_cmd_ts3.command({
|
|
|
100547
100663
|
const indent = " ";
|
|
100548
100664
|
content = content.slice(0, headCloseIndex) + `${indent}${linkTag}
|
|
100549
100665
|
${indent}` + content.slice(headCloseIndex);
|
|
100550
|
-
await
|
|
100666
|
+
await fs8.writeFile(htmlPath, content);
|
|
100551
100667
|
R2.success(` Injected into: ${relativePath}`);
|
|
100552
100668
|
injectedCount++;
|
|
100553
100669
|
}
|
|
@@ -100568,18 +100684,18 @@ Tip: Skipped files had no matching published post. This is normal for non-post p
|
|
|
100568
100684
|
|
|
100569
100685
|
// src/commands/login.ts
|
|
100570
100686
|
import * as http from "node:http";
|
|
100571
|
-
var
|
|
100687
|
+
var import_cmd_ts5 = __toESM(require_cjs(), 1);
|
|
100572
100688
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
100573
|
-
var loginCommand =
|
|
100689
|
+
var loginCommand = import_cmd_ts5.command({
|
|
100574
100690
|
name: "login",
|
|
100575
100691
|
description: "Login with OAuth (browser-based authentication)",
|
|
100576
100692
|
args: {
|
|
100577
|
-
logout:
|
|
100693
|
+
logout: import_cmd_ts5.option({
|
|
100578
100694
|
long: "logout",
|
|
100579
100695
|
description: "Remove OAuth session for a specific DID",
|
|
100580
|
-
type:
|
|
100696
|
+
type: import_cmd_ts5.optional(import_cmd_ts5.string)
|
|
100581
100697
|
}),
|
|
100582
|
-
list:
|
|
100698
|
+
list: import_cmd_ts5.flag({
|
|
100583
100699
|
long: "list",
|
|
100584
100700
|
description: "List all stored OAuth sessions"
|
|
100585
100701
|
})
|
|
@@ -100791,19 +100907,19 @@ function waitForCallback() {
|
|
|
100791
100907
|
}
|
|
100792
100908
|
|
|
100793
100909
|
// src/commands/publish.ts
|
|
100794
|
-
var
|
|
100795
|
-
import * as
|
|
100796
|
-
import * as
|
|
100797
|
-
var publishCommand =
|
|
100910
|
+
var import_cmd_ts6 = __toESM(require_cjs(), 1);
|
|
100911
|
+
import * as fs14 from "node:fs/promises";
|
|
100912
|
+
import * as path11 from "node:path";
|
|
100913
|
+
var publishCommand = import_cmd_ts6.command({
|
|
100798
100914
|
name: "publish",
|
|
100799
100915
|
description: "Publish content to ATProto",
|
|
100800
100916
|
args: {
|
|
100801
|
-
force:
|
|
100917
|
+
force: import_cmd_ts6.flag({
|
|
100802
100918
|
long: "force",
|
|
100803
100919
|
short: "f",
|
|
100804
100920
|
description: "Force publish all posts, ignoring change detection"
|
|
100805
100921
|
}),
|
|
100806
|
-
dryRun:
|
|
100922
|
+
dryRun: import_cmd_ts6.flag({
|
|
100807
100923
|
long: "dry-run",
|
|
100808
100924
|
short: "n",
|
|
100809
100925
|
description: "Preview what would be published without making changes"
|
|
@@ -100816,7 +100932,7 @@ var publishCommand = import_cmd_ts5.command({
|
|
|
100816
100932
|
process.exit(1);
|
|
100817
100933
|
}
|
|
100818
100934
|
const config = await loadConfig(configPath);
|
|
100819
|
-
const configDir =
|
|
100935
|
+
const configDir = path11.dirname(configPath);
|
|
100820
100936
|
R2.info(`Site: ${config.siteUrl}`);
|
|
100821
100937
|
R2.info(`Content directory: ${config.contentDir}`);
|
|
100822
100938
|
let credentials = await loadCredentials(config.identity);
|
|
@@ -100866,8 +100982,8 @@ var publishCommand = import_cmd_ts5.command({
|
|
|
100866
100982
|
const displayId = credentials.type === "oauth" ? credentials.handle || credentials.did : credentials.identifier;
|
|
100867
100983
|
R2.info(`Tip: Add "identity": "${displayId}" to sequoia.json to use this by default.`);
|
|
100868
100984
|
}
|
|
100869
|
-
const contentDir =
|
|
100870
|
-
const imagesDir = config.imagesDir ?
|
|
100985
|
+
const contentDir = path11.isAbsolute(config.contentDir) ? config.contentDir : path11.join(configDir, config.contentDir);
|
|
100986
|
+
const imagesDir = config.imagesDir ? path11.isAbsolute(config.imagesDir) ? config.imagesDir : path11.join(configDir, config.imagesDir) : undefined;
|
|
100871
100987
|
const state = await loadState(configDir);
|
|
100872
100988
|
const s = Ie();
|
|
100873
100989
|
s.start("Scanning for posts...");
|
|
@@ -100887,7 +101003,7 @@ var publishCommand = import_cmd_ts5.command({
|
|
|
100887
101003
|
continue;
|
|
100888
101004
|
}
|
|
100889
101005
|
const contentHash = await getContentHash(post.rawContent);
|
|
100890
|
-
const relativeFilePath =
|
|
101006
|
+
const relativeFilePath = path11.relative(configDir, post.filePath);
|
|
100891
101007
|
const postState = state.posts[relativeFilePath];
|
|
100892
101008
|
if (force) {
|
|
100893
101009
|
postsToPublish.push({
|
|
@@ -100925,7 +101041,7 @@ ${postsToPublish.length} posts to publish:
|
|
|
100925
101041
|
cutoffDate.setDate(cutoffDate.getDate() - maxAgeDays);
|
|
100926
101042
|
for (const { post, action, reason } of postsToPublish) {
|
|
100927
101043
|
const icon = action === "create" ? "+" : "~";
|
|
100928
|
-
const relativeFilePath =
|
|
101044
|
+
const relativeFilePath = path11.relative(configDir, post.filePath);
|
|
100929
101045
|
const existingBskyPostRef = state.posts[relativeFilePath]?.bskyPostRef;
|
|
100930
101046
|
let bskyNote = "";
|
|
100931
101047
|
if (blueskyEnabled) {
|
|
@@ -100973,7 +101089,7 @@ Dry run complete. No changes made.`);
|
|
|
100973
101089
|
if (post.frontmatter.ogImage) {
|
|
100974
101090
|
const imagePath = await resolveImagePath(post.frontmatter.ogImage, imagesDir, contentDir);
|
|
100975
101091
|
if (imagePath) {
|
|
100976
|
-
R2.info(` Uploading cover image: ${
|
|
101092
|
+
R2.info(` Uploading cover image: ${path11.basename(imagePath)}`);
|
|
100977
101093
|
coverImage = await uploadImage(agent, imagePath);
|
|
100978
101094
|
if (coverImage) {
|
|
100979
101095
|
R2.info(` Uploaded image blob: ${coverImage.ref.$link}`);
|
|
@@ -100985,14 +101101,14 @@ Dry run complete. No changes made.`);
|
|
|
100985
101101
|
let atUri;
|
|
100986
101102
|
let contentForHash;
|
|
100987
101103
|
let bskyPostRef;
|
|
100988
|
-
const relativeFilePath =
|
|
101104
|
+
const relativeFilePath = path11.relative(configDir, post.filePath);
|
|
100989
101105
|
const existingBskyPostRef = state.posts[relativeFilePath]?.bskyPostRef;
|
|
100990
101106
|
if (action === "create") {
|
|
100991
101107
|
atUri = await createDocument(agent, post, config, coverImage);
|
|
100992
101108
|
s.stop(`Created: ${atUri}`);
|
|
100993
101109
|
const updatedContent = updateFrontmatterWithAtUri(post.rawContent, atUri);
|
|
100994
|
-
await
|
|
100995
|
-
R2.info(` Updated frontmatter in ${
|
|
101110
|
+
await fs14.writeFile(post.filePath, updatedContent);
|
|
101111
|
+
R2.info(` Updated frontmatter in ${path11.basename(post.filePath)}`);
|
|
100996
101112
|
contentForHash = updatedContent;
|
|
100997
101113
|
publishedCount++;
|
|
100998
101114
|
} else {
|
|
@@ -101041,7 +101157,7 @@ Dry run complete. No changes made.`);
|
|
|
101041
101157
|
};
|
|
101042
101158
|
} catch (error) {
|
|
101043
101159
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
101044
|
-
s.stop(`Error publishing "${
|
|
101160
|
+
s.stop(`Error publishing "${path11.basename(post.filePath)}"`);
|
|
101045
101161
|
R2.error(` ${errorMessage}`);
|
|
101046
101162
|
errorCount++;
|
|
101047
101163
|
}
|
|
@@ -101061,19 +101177,19 @@ Dry run complete. No changes made.`);
|
|
|
101061
101177
|
});
|
|
101062
101178
|
|
|
101063
101179
|
// src/commands/sync.ts
|
|
101064
|
-
var
|
|
101065
|
-
import * as
|
|
101066
|
-
import * as
|
|
101067
|
-
var syncCommand =
|
|
101180
|
+
var import_cmd_ts7 = __toESM(require_cjs(), 1);
|
|
101181
|
+
import * as fs15 from "node:fs/promises";
|
|
101182
|
+
import * as path12 from "node:path";
|
|
101183
|
+
var syncCommand = import_cmd_ts7.command({
|
|
101068
101184
|
name: "sync",
|
|
101069
101185
|
description: "Sync state from ATProto to restore .sequoia-state.json",
|
|
101070
101186
|
args: {
|
|
101071
|
-
updateFrontmatter:
|
|
101187
|
+
updateFrontmatter: import_cmd_ts7.flag({
|
|
101072
101188
|
long: "update-frontmatter",
|
|
101073
101189
|
short: "u",
|
|
101074
101190
|
description: "Update frontmatter atUri fields in local markdown files"
|
|
101075
101191
|
}),
|
|
101076
|
-
dryRun:
|
|
101192
|
+
dryRun: import_cmd_ts7.flag({
|
|
101077
101193
|
long: "dry-run",
|
|
101078
101194
|
short: "n",
|
|
101079
101195
|
description: "Preview what would be synced without making changes"
|
|
@@ -101086,7 +101202,7 @@ var syncCommand = import_cmd_ts6.command({
|
|
|
101086
101202
|
process.exit(1);
|
|
101087
101203
|
}
|
|
101088
101204
|
const config = await loadConfig(configPath);
|
|
101089
|
-
const configDir =
|
|
101205
|
+
const configDir = path12.dirname(configPath);
|
|
101090
101206
|
R2.info(`Site: ${config.siteUrl}`);
|
|
101091
101207
|
R2.info(`Publication: ${config.publicationUri}`);
|
|
101092
101208
|
let credentials = await loadCredentials(config.identity);
|
|
@@ -101152,7 +101268,7 @@ var syncCommand = import_cmd_ts6.command({
|
|
|
101152
101268
|
R2.info("No documents found for this publication.");
|
|
101153
101269
|
return;
|
|
101154
101270
|
}
|
|
101155
|
-
const contentDir =
|
|
101271
|
+
const contentDir = path12.isAbsolute(config.contentDir) ? config.contentDir : path12.join(configDir, config.contentDir);
|
|
101156
101272
|
s.start("Scanning local content...");
|
|
101157
101273
|
const localPosts = await scanContentDirectory(contentDir, {
|
|
101158
101274
|
frontmatterMapping: config.frontmatter,
|
|
@@ -101184,9 +101300,9 @@ Matching documents to local files:
|
|
|
101184
101300
|
R2.message(` ✓ ${doc.value.title}`);
|
|
101185
101301
|
R2.message(` Path: ${docPath}`);
|
|
101186
101302
|
R2.message(` URI: ${doc.uri}`);
|
|
101187
|
-
R2.message(` File: ${
|
|
101303
|
+
R2.message(` File: ${path12.basename(localPost.filePath)}`);
|
|
101188
101304
|
const contentHash = await getContentHash(localPost.rawContent);
|
|
101189
|
-
const relativeFilePath =
|
|
101305
|
+
const relativeFilePath = path12.relative(configDir, localPost.filePath);
|
|
101190
101306
|
state.posts[relativeFilePath] = {
|
|
101191
101307
|
contentHash,
|
|
101192
101308
|
atUri: doc.uri,
|
|
@@ -101224,10 +101340,10 @@ Saved .sequoia-state.json (${originalPostCount} → ${newPostCount} entries)`);
|
|
|
101224
101340
|
if (frontmatterUpdates.length > 0) {
|
|
101225
101341
|
s.start(`Updating frontmatter in ${frontmatterUpdates.length} files...`);
|
|
101226
101342
|
for (const { filePath, atUri } of frontmatterUpdates) {
|
|
101227
|
-
const content = await
|
|
101343
|
+
const content = await fs15.readFile(filePath, "utf-8");
|
|
101228
101344
|
const updated = updateFrontmatterWithAtUri(content, atUri);
|
|
101229
|
-
await
|
|
101230
|
-
R2.message(` Updated: ${
|
|
101345
|
+
await fs15.writeFile(filePath, updated);
|
|
101346
|
+
R2.message(` Updated: ${path12.basename(filePath)}`);
|
|
101231
101347
|
}
|
|
101232
101348
|
s.stop("Frontmatter updated");
|
|
101233
101349
|
}
|
|
@@ -101237,9 +101353,9 @@ Sync complete!`);
|
|
|
101237
101353
|
});
|
|
101238
101354
|
|
|
101239
101355
|
// src/commands/update.ts
|
|
101240
|
-
var
|
|
101241
|
-
import * as
|
|
101242
|
-
var updateCommand =
|
|
101356
|
+
var import_cmd_ts8 = __toESM(require_cjs(), 1);
|
|
101357
|
+
import * as fs16 from "node:fs/promises";
|
|
101358
|
+
var updateCommand = import_cmd_ts8.command({
|
|
101243
101359
|
name: "update",
|
|
101244
101360
|
description: "Update local config or ATProto publication record",
|
|
101245
101361
|
args: {},
|
|
@@ -101347,7 +101463,7 @@ async function updateConfigFlow(config, configPath) {
|
|
|
101347
101463
|
textContentField: configUpdated.textContentField,
|
|
101348
101464
|
bluesky: configUpdated.bluesky
|
|
101349
101465
|
});
|
|
101350
|
-
await
|
|
101466
|
+
await fs16.writeFile(configPath, configContent);
|
|
101351
101467
|
R2.success("Configuration saved!");
|
|
101352
101468
|
} else {
|
|
101353
101469
|
R2.info("Changes discarded.");
|
|
@@ -101663,7 +101779,7 @@ async function updatePublicationFlow(config) {
|
|
|
101663
101779
|
}
|
|
101664
101780
|
|
|
101665
101781
|
// src/index.ts
|
|
101666
|
-
var app =
|
|
101782
|
+
var app = import_cmd_ts9.subcommands({
|
|
101667
101783
|
name: "sequoia",
|
|
101668
101784
|
description: `
|
|
101669
101785
|
|
|
@@ -101689,8 +101805,9 @@ Publish evergreen content to the ATmosphere
|
|
|
101689
101805
|
|
|
101690
101806
|
> https://tangled.org/stevedylan.dev/sequoia
|
|
101691
101807
|
`,
|
|
101692
|
-
version: "0.
|
|
101808
|
+
version: "0.4.0",
|
|
101693
101809
|
cmds: {
|
|
101810
|
+
add: addCommand,
|
|
101694
101811
|
auth: authCommand,
|
|
101695
101812
|
init: initCommand,
|
|
101696
101813
|
inject: injectCommand,
|
|
@@ -101700,4 +101817,4 @@ Publish evergreen content to the ATmosphere
|
|
|
101700
101817
|
update: updateCommand
|
|
101701
101818
|
}
|
|
101702
101819
|
});
|
|
101703
|
-
|
|
101820
|
+
import_cmd_ts9.run(app, process.argv.slice(2));
|