@brightsideoy/kama 0.1.0-alpha.68 → 0.1.0-alpha.69
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/assets/{index-Cj926Ids.js → index-CL88iOfO.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +731 -707
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1218,7 +1218,7 @@ var V = class extends ve {
|
|
|
1218
1218
|
return b(e) || t("Expected a mapping for this tag"), e;
|
|
1219
1219
|
},
|
|
1220
1220
|
createNode: (e, t, n) => V.from(e, t, n)
|
|
1221
|
-
},
|
|
1221
|
+
}, H = class extends ve {
|
|
1222
1222
|
static get tagName() {
|
|
1223
1223
|
return "tag:yaml.org,2002:seq";
|
|
1224
1224
|
}
|
|
@@ -1229,21 +1229,21 @@ var V = class extends ve {
|
|
|
1229
1229
|
this.items.push(e);
|
|
1230
1230
|
}
|
|
1231
1231
|
delete(e) {
|
|
1232
|
-
let t =
|
|
1232
|
+
let t = nt(e);
|
|
1233
1233
|
return typeof t == "number" && this.items.splice(t, 1).length > 0;
|
|
1234
1234
|
}
|
|
1235
1235
|
get(e, t) {
|
|
1236
|
-
let n =
|
|
1236
|
+
let n = nt(e);
|
|
1237
1237
|
if (typeof n != "number") return;
|
|
1238
1238
|
let r = this.items[n];
|
|
1239
1239
|
return !t && S(r) ? r.value : r;
|
|
1240
1240
|
}
|
|
1241
1241
|
has(e) {
|
|
1242
|
-
let t =
|
|
1242
|
+
let t = nt(e);
|
|
1243
1243
|
return typeof t == "number" && t < this.items.length;
|
|
1244
1244
|
}
|
|
1245
1245
|
set(e, t) {
|
|
1246
|
-
let n =
|
|
1246
|
+
let n = nt(e);
|
|
1247
1247
|
if (typeof n != "number") throw Error(`Expected a valid index, not ${e}.`);
|
|
1248
1248
|
let r = this.items[n];
|
|
1249
1249
|
S(r) && me(t) ? r.value = t : this.items[n] = t;
|
|
@@ -1282,22 +1282,22 @@ var V = class extends ve {
|
|
|
1282
1282
|
return i;
|
|
1283
1283
|
}
|
|
1284
1284
|
};
|
|
1285
|
-
function
|
|
1285
|
+
function nt(e) {
|
|
1286
1286
|
let t = S(e) ? e.value : e;
|
|
1287
1287
|
return t && typeof t == "string" && (t = Number(t)), typeof t == "number" && Number.isInteger(t) && t >= 0 ? t : null;
|
|
1288
1288
|
}
|
|
1289
1289
|
//#endregion
|
|
1290
1290
|
//#region node_modules/yaml/browser/dist/schema/common/seq.js
|
|
1291
|
-
var
|
|
1291
|
+
var rt = {
|
|
1292
1292
|
collection: "seq",
|
|
1293
1293
|
default: !0,
|
|
1294
|
-
nodeClass:
|
|
1294
|
+
nodeClass: H,
|
|
1295
1295
|
tag: "tag:yaml.org,2002:seq",
|
|
1296
1296
|
resolve(e, t) {
|
|
1297
1297
|
return C(e) || t("Expected a sequence for this tag"), e;
|
|
1298
1298
|
},
|
|
1299
|
-
createNode: (e, t, n) =>
|
|
1300
|
-
},
|
|
1299
|
+
createNode: (e, t, n) => H.from(e, t, n)
|
|
1300
|
+
}, it = {
|
|
1301
1301
|
identify: (e) => typeof e == "string",
|
|
1302
1302
|
default: !0,
|
|
1303
1303
|
tag: "tag:yaml.org,2002:str",
|
|
@@ -1305,27 +1305,27 @@ var it = {
|
|
|
1305
1305
|
stringify(e, t, n, r) {
|
|
1306
1306
|
return t = Object.assign({ actualString: !0 }, t), Fe(e, t, n, r);
|
|
1307
1307
|
}
|
|
1308
|
-
},
|
|
1308
|
+
}, at = {
|
|
1309
1309
|
identify: (e) => e == null,
|
|
1310
1310
|
createNode: () => new F(null),
|
|
1311
1311
|
default: !0,
|
|
1312
1312
|
tag: "tag:yaml.org,2002:null",
|
|
1313
1313
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1314
1314
|
resolve: () => new F(null),
|
|
1315
|
-
stringify: ({ source: e }, t) => typeof e == "string" &&
|
|
1316
|
-
},
|
|
1315
|
+
stringify: ({ source: e }, t) => typeof e == "string" && at.test.test(e) ? e : t.options.nullStr
|
|
1316
|
+
}, ot = {
|
|
1317
1317
|
identify: (e) => typeof e == "boolean",
|
|
1318
1318
|
default: !0,
|
|
1319
1319
|
tag: "tag:yaml.org,2002:bool",
|
|
1320
1320
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1321
1321
|
resolve: (e) => new F(e[0] === "t" || e[0] === "T"),
|
|
1322
1322
|
stringify({ source: e, value: t }, n) {
|
|
1323
|
-
return e &&
|
|
1323
|
+
return e && ot.test.test(e) && t === (e[0] === "t" || e[0] === "T") ? e : t ? n.options.trueStr : n.options.falseStr;
|
|
1324
1324
|
}
|
|
1325
1325
|
};
|
|
1326
1326
|
//#endregion
|
|
1327
1327
|
//#region node_modules/yaml/browser/dist/stringify/stringifyNumber.js
|
|
1328
|
-
function
|
|
1328
|
+
function U({ format: e, minFractionDigits: t, tag: n, value: r }) {
|
|
1329
1329
|
if (typeof r == "bigint") return String(r);
|
|
1330
1330
|
let i = typeof r == "number" ? r : Number(r);
|
|
1331
1331
|
if (!isFinite(i)) return isNaN(i) ? ".nan" : i < 0 ? "-.inf" : ".inf";
|
|
@@ -1340,14 +1340,14 @@ function H({ format: e, minFractionDigits: t, tag: n, value: r }) {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
//#endregion
|
|
1342
1342
|
//#region node_modules/yaml/browser/dist/schema/core/float.js
|
|
1343
|
-
var
|
|
1343
|
+
var st = {
|
|
1344
1344
|
identify: (e) => typeof e == "number",
|
|
1345
1345
|
default: !0,
|
|
1346
1346
|
tag: "tag:yaml.org,2002:float",
|
|
1347
1347
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1348
1348
|
resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
|
|
1349
|
-
stringify:
|
|
1350
|
-
},
|
|
1349
|
+
stringify: U
|
|
1350
|
+
}, ct = {
|
|
1351
1351
|
identify: (e) => typeof e == "number",
|
|
1352
1352
|
default: !0,
|
|
1353
1353
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1356,9 +1356,9 @@ var ct = {
|
|
|
1356
1356
|
resolve: (e) => parseFloat(e),
|
|
1357
1357
|
stringify(e) {
|
|
1358
1358
|
let t = Number(e.value);
|
|
1359
|
-
return isFinite(t) ? t.toExponential() :
|
|
1359
|
+
return isFinite(t) ? t.toExponential() : U(e);
|
|
1360
1360
|
}
|
|
1361
|
-
},
|
|
1361
|
+
}, lt = {
|
|
1362
1362
|
identify: (e) => typeof e == "number",
|
|
1363
1363
|
default: !0,
|
|
1364
1364
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1367,60 +1367,60 @@ var ct = {
|
|
|
1367
1367
|
let t = new F(parseFloat(e)), n = e.indexOf(".");
|
|
1368
1368
|
return n !== -1 && e[e.length - 1] === "0" && (t.minFractionDigits = e.length - n - 1), t;
|
|
1369
1369
|
},
|
|
1370
|
-
stringify:
|
|
1371
|
-
},
|
|
1372
|
-
function
|
|
1370
|
+
stringify: U
|
|
1371
|
+
}, ut = (e) => typeof e == "bigint" || Number.isInteger(e), dt = (e, t, n, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), n);
|
|
1372
|
+
function ft(e, t, n) {
|
|
1373
1373
|
let { value: r } = e;
|
|
1374
|
-
return
|
|
1374
|
+
return ut(r) && r >= 0 ? n + r.toString(t) : U(e);
|
|
1375
1375
|
}
|
|
1376
|
-
var
|
|
1377
|
-
identify: (e) =>
|
|
1376
|
+
var pt = {
|
|
1377
|
+
identify: (e) => ut(e) && e >= 0,
|
|
1378
1378
|
default: !0,
|
|
1379
1379
|
tag: "tag:yaml.org,2002:int",
|
|
1380
1380
|
format: "OCT",
|
|
1381
1381
|
test: /^0o[0-7]+$/,
|
|
1382
|
-
resolve: (e, t, n) =>
|
|
1383
|
-
stringify: (e) =>
|
|
1384
|
-
},
|
|
1385
|
-
identify:
|
|
1382
|
+
resolve: (e, t, n) => dt(e, 2, 8, n),
|
|
1383
|
+
stringify: (e) => ft(e, 8, "0o")
|
|
1384
|
+
}, mt = {
|
|
1385
|
+
identify: ut,
|
|
1386
1386
|
default: !0,
|
|
1387
1387
|
tag: "tag:yaml.org,2002:int",
|
|
1388
1388
|
test: /^[-+]?[0-9]+$/,
|
|
1389
|
-
resolve: (e, t, n) =>
|
|
1390
|
-
stringify:
|
|
1391
|
-
},
|
|
1392
|
-
identify: (e) =>
|
|
1389
|
+
resolve: (e, t, n) => dt(e, 0, 10, n),
|
|
1390
|
+
stringify: U
|
|
1391
|
+
}, ht = {
|
|
1392
|
+
identify: (e) => ut(e) && e >= 0,
|
|
1393
1393
|
default: !0,
|
|
1394
1394
|
tag: "tag:yaml.org,2002:int",
|
|
1395
1395
|
format: "HEX",
|
|
1396
1396
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1397
|
-
resolve: (e, t, n) =>
|
|
1398
|
-
stringify: (e) =>
|
|
1399
|
-
},
|
|
1397
|
+
resolve: (e, t, n) => dt(e, 2, 16, n),
|
|
1398
|
+
stringify: (e) => ft(e, 16, "0x")
|
|
1399
|
+
}, gt = [
|
|
1400
1400
|
tt,
|
|
1401
|
+
rt,
|
|
1401
1402
|
it,
|
|
1402
1403
|
at,
|
|
1403
1404
|
ot,
|
|
1404
|
-
|
|
1405
|
+
pt,
|
|
1405
1406
|
mt,
|
|
1406
1407
|
ht,
|
|
1407
|
-
|
|
1408
|
+
st,
|
|
1408
1409
|
ct,
|
|
1409
|
-
lt
|
|
1410
|
-
ut
|
|
1410
|
+
lt
|
|
1411
1411
|
];
|
|
1412
1412
|
//#endregion
|
|
1413
1413
|
//#region node_modules/yaml/browser/dist/schema/json/schema.js
|
|
1414
|
-
function
|
|
1414
|
+
function _t(e) {
|
|
1415
1415
|
return typeof e == "bigint" || Number.isInteger(e);
|
|
1416
1416
|
}
|
|
1417
|
-
var
|
|
1417
|
+
var vt = ({ value: e }) => JSON.stringify(e), yt = [
|
|
1418
1418
|
{
|
|
1419
1419
|
identify: (e) => typeof e == "string",
|
|
1420
1420
|
default: !0,
|
|
1421
1421
|
tag: "tag:yaml.org,2002:str",
|
|
1422
1422
|
resolve: (e) => e,
|
|
1423
|
-
stringify:
|
|
1423
|
+
stringify: vt
|
|
1424
1424
|
},
|
|
1425
1425
|
{
|
|
1426
1426
|
identify: (e) => e == null,
|
|
@@ -1429,7 +1429,7 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1429
1429
|
tag: "tag:yaml.org,2002:null",
|
|
1430
1430
|
test: /^null$/,
|
|
1431
1431
|
resolve: () => null,
|
|
1432
|
-
stringify:
|
|
1432
|
+
stringify: vt
|
|
1433
1433
|
},
|
|
1434
1434
|
{
|
|
1435
1435
|
identify: (e) => typeof e == "boolean",
|
|
@@ -1437,15 +1437,15 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1437
1437
|
tag: "tag:yaml.org,2002:bool",
|
|
1438
1438
|
test: /^true$|^false$/,
|
|
1439
1439
|
resolve: (e) => e === "true",
|
|
1440
|
-
stringify:
|
|
1440
|
+
stringify: vt
|
|
1441
1441
|
},
|
|
1442
1442
|
{
|
|
1443
|
-
identify:
|
|
1443
|
+
identify: _t,
|
|
1444
1444
|
default: !0,
|
|
1445
1445
|
tag: "tag:yaml.org,2002:int",
|
|
1446
1446
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1447
1447
|
resolve: (e, t, { intAsBigInt: n }) => n ? BigInt(e) : parseInt(e, 10),
|
|
1448
|
-
stringify: ({ value: e }) =>
|
|
1448
|
+
stringify: ({ value: e }) => _t(e) ? e.toString() : JSON.stringify(e)
|
|
1449
1449
|
},
|
|
1450
1450
|
{
|
|
1451
1451
|
identify: (e) => typeof e == "number",
|
|
@@ -1453,16 +1453,16 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1453
1453
|
tag: "tag:yaml.org,2002:float",
|
|
1454
1454
|
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
1455
1455
|
resolve: (e) => parseFloat(e),
|
|
1456
|
-
stringify:
|
|
1456
|
+
stringify: vt
|
|
1457
1457
|
}
|
|
1458
|
-
],
|
|
1458
|
+
], bt = [tt, rt].concat(yt, {
|
|
1459
1459
|
default: !0,
|
|
1460
1460
|
tag: "",
|
|
1461
1461
|
test: /^/,
|
|
1462
1462
|
resolve(e, t) {
|
|
1463
1463
|
return t(`Unresolved plain scalar ${JSON.stringify(e)}`), e;
|
|
1464
1464
|
}
|
|
1465
|
-
}),
|
|
1465
|
+
}), xt = {
|
|
1466
1466
|
identify: (e) => e instanceof Uint8Array,
|
|
1467
1467
|
default: !1,
|
|
1468
1468
|
tag: "tag:yaml.org,2002:binary",
|
|
@@ -1496,7 +1496,7 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1496
1496
|
};
|
|
1497
1497
|
//#endregion
|
|
1498
1498
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
|
|
1499
|
-
function
|
|
1499
|
+
function St(e, t) {
|
|
1500
1500
|
if (C(e)) for (let n = 0; n < e.items.length; ++n) {
|
|
1501
1501
|
let r = e.items[n];
|
|
1502
1502
|
if (!x(r)) {
|
|
@@ -1515,8 +1515,8 @@ function Ct(e, t) {
|
|
|
1515
1515
|
else t("Expected a sequence for this tag");
|
|
1516
1516
|
return e;
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1519
|
-
let { replacer: r } = n, i = new
|
|
1518
|
+
function Ct(e, t, n) {
|
|
1519
|
+
let { replacer: r } = n, i = new H(e);
|
|
1520
1520
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1521
1521
|
let a = 0;
|
|
1522
1522
|
if (t && Symbol.iterator in Object(t)) for (let e of t) {
|
|
@@ -1534,13 +1534,13 @@ function wt(e, t, n) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
return i;
|
|
1536
1536
|
}
|
|
1537
|
-
var
|
|
1537
|
+
var wt = {
|
|
1538
1538
|
collection: "seq",
|
|
1539
1539
|
default: !1,
|
|
1540
1540
|
tag: "tag:yaml.org,2002:pairs",
|
|
1541
|
-
resolve:
|
|
1542
|
-
createNode:
|
|
1543
|
-
},
|
|
1541
|
+
resolve: St,
|
|
1542
|
+
createNode: Ct
|
|
1543
|
+
}, Tt = class e extends H {
|
|
1544
1544
|
constructor() {
|
|
1545
1545
|
super(), this.add = V.prototype.add.bind(this), this.delete = V.prototype.delete.bind(this), this.get = V.prototype.get.bind(this), this.has = V.prototype.has.bind(this), this.set = V.prototype.set.bind(this), this.tag = e.tag;
|
|
1546
1546
|
}
|
|
@@ -1556,51 +1556,51 @@ var Tt = {
|
|
|
1556
1556
|
return n;
|
|
1557
1557
|
}
|
|
1558
1558
|
static from(e, t, n) {
|
|
1559
|
-
let r =
|
|
1559
|
+
let r = Ct(e, t, n), i = new this();
|
|
1560
1560
|
return i.items = r.items, i;
|
|
1561
1561
|
}
|
|
1562
1562
|
};
|
|
1563
|
-
|
|
1564
|
-
var
|
|
1563
|
+
Tt.tag = "tag:yaml.org,2002:omap";
|
|
1564
|
+
var Et = {
|
|
1565
1565
|
collection: "seq",
|
|
1566
1566
|
identify: (e) => e instanceof Map,
|
|
1567
|
-
nodeClass:
|
|
1567
|
+
nodeClass: Tt,
|
|
1568
1568
|
default: !1,
|
|
1569
1569
|
tag: "tag:yaml.org,2002:omap",
|
|
1570
1570
|
resolve(e, t) {
|
|
1571
|
-
let n =
|
|
1571
|
+
let n = St(e, t), r = [];
|
|
1572
1572
|
for (let { key: e } of n.items) S(e) && (r.includes(e.value) ? t(`Ordered maps must not include duplicate keys: ${e.value}`) : r.push(e.value));
|
|
1573
|
-
return Object.assign(new
|
|
1573
|
+
return Object.assign(new Tt(), n);
|
|
1574
1574
|
},
|
|
1575
|
-
createNode: (e, t, n) =>
|
|
1575
|
+
createNode: (e, t, n) => Tt.from(e, t, n)
|
|
1576
1576
|
};
|
|
1577
1577
|
//#endregion
|
|
1578
1578
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js
|
|
1579
|
-
function
|
|
1580
|
-
return t && (e ?
|
|
1579
|
+
function Dt({ value: e, source: t }, n) {
|
|
1580
|
+
return t && (e ? Ot : kt).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
|
|
1581
1581
|
}
|
|
1582
|
-
var
|
|
1582
|
+
var Ot = {
|
|
1583
1583
|
identify: (e) => e === !0,
|
|
1584
1584
|
default: !0,
|
|
1585
1585
|
tag: "tag:yaml.org,2002:bool",
|
|
1586
1586
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1587
1587
|
resolve: () => new F(!0),
|
|
1588
|
-
stringify:
|
|
1589
|
-
},
|
|
1588
|
+
stringify: Dt
|
|
1589
|
+
}, kt = {
|
|
1590
1590
|
identify: (e) => e === !1,
|
|
1591
1591
|
default: !0,
|
|
1592
1592
|
tag: "tag:yaml.org,2002:bool",
|
|
1593
1593
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
1594
1594
|
resolve: () => new F(!1),
|
|
1595
|
-
stringify:
|
|
1596
|
-
},
|
|
1595
|
+
stringify: Dt
|
|
1596
|
+
}, At = {
|
|
1597
1597
|
identify: (e) => typeof e == "number",
|
|
1598
1598
|
default: !0,
|
|
1599
1599
|
tag: "tag:yaml.org,2002:float",
|
|
1600
1600
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1601
1601
|
resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
|
|
1602
|
-
stringify:
|
|
1603
|
-
},
|
|
1602
|
+
stringify: U
|
|
1603
|
+
}, jt = {
|
|
1604
1604
|
identify: (e) => typeof e == "number",
|
|
1605
1605
|
default: !0,
|
|
1606
1606
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1609,9 +1609,9 @@ var kt = {
|
|
|
1609
1609
|
resolve: (e) => parseFloat(e.replace(/_/g, "")),
|
|
1610
1610
|
stringify(e) {
|
|
1611
1611
|
let t = Number(e.value);
|
|
1612
|
-
return isFinite(t) ? t.toExponential() :
|
|
1612
|
+
return isFinite(t) ? t.toExponential() : U(e);
|
|
1613
1613
|
}
|
|
1614
|
-
},
|
|
1614
|
+
}, Mt = {
|
|
1615
1615
|
identify: (e) => typeof e == "number",
|
|
1616
1616
|
default: !0,
|
|
1617
1617
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1624,9 +1624,9 @@ var kt = {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
return t;
|
|
1626
1626
|
},
|
|
1627
|
-
stringify:
|
|
1628
|
-
},
|
|
1629
|
-
function
|
|
1627
|
+
stringify: U
|
|
1628
|
+
}, Nt = (e) => typeof e == "bigint" || Number.isInteger(e);
|
|
1629
|
+
function Pt(e, t, n, { intAsBigInt: r }) {
|
|
1630
1630
|
let i = e[0];
|
|
1631
1631
|
if ((i === "-" || i === "+") && (t += 1), e = e.substring(t).replace(/_/g, ""), r) {
|
|
1632
1632
|
switch (n) {
|
|
@@ -1644,46 +1644,46 @@ function Ft(e, t, n, { intAsBigInt: r }) {
|
|
|
1644
1644
|
let a = parseInt(e, n);
|
|
1645
1645
|
return i === "-" ? -1 * a : a;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function Ft(e, t, n) {
|
|
1648
1648
|
let { value: r } = e;
|
|
1649
|
-
if (
|
|
1649
|
+
if (Nt(r)) {
|
|
1650
1650
|
let e = r.toString(t);
|
|
1651
1651
|
return r < 0 ? "-" + n + e.substr(1) : n + e;
|
|
1652
1652
|
}
|
|
1653
|
-
return
|
|
1653
|
+
return U(e);
|
|
1654
1654
|
}
|
|
1655
|
-
var
|
|
1656
|
-
identify:
|
|
1655
|
+
var It = {
|
|
1656
|
+
identify: Nt,
|
|
1657
1657
|
default: !0,
|
|
1658
1658
|
tag: "tag:yaml.org,2002:int",
|
|
1659
1659
|
format: "BIN",
|
|
1660
1660
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1661
|
-
resolve: (e, t, n) =>
|
|
1662
|
-
stringify: (e) =>
|
|
1663
|
-
},
|
|
1664
|
-
identify:
|
|
1661
|
+
resolve: (e, t, n) => Pt(e, 2, 2, n),
|
|
1662
|
+
stringify: (e) => Ft(e, 2, "0b")
|
|
1663
|
+
}, Lt = {
|
|
1664
|
+
identify: Nt,
|
|
1665
1665
|
default: !0,
|
|
1666
1666
|
tag: "tag:yaml.org,2002:int",
|
|
1667
1667
|
format: "OCT",
|
|
1668
1668
|
test: /^[-+]?0[0-7_]+$/,
|
|
1669
|
-
resolve: (e, t, n) =>
|
|
1670
|
-
stringify: (e) =>
|
|
1671
|
-
},
|
|
1672
|
-
identify:
|
|
1669
|
+
resolve: (e, t, n) => Pt(e, 1, 8, n),
|
|
1670
|
+
stringify: (e) => Ft(e, 8, "0")
|
|
1671
|
+
}, Rt = {
|
|
1672
|
+
identify: Nt,
|
|
1673
1673
|
default: !0,
|
|
1674
1674
|
tag: "tag:yaml.org,2002:int",
|
|
1675
1675
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
1676
|
-
resolve: (e, t, n) =>
|
|
1677
|
-
stringify:
|
|
1678
|
-
},
|
|
1679
|
-
identify:
|
|
1676
|
+
resolve: (e, t, n) => Pt(e, 0, 10, n),
|
|
1677
|
+
stringify: U
|
|
1678
|
+
}, zt = {
|
|
1679
|
+
identify: Nt,
|
|
1680
1680
|
default: !0,
|
|
1681
1681
|
tag: "tag:yaml.org,2002:int",
|
|
1682
1682
|
format: "HEX",
|
|
1683
1683
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1684
|
-
resolve: (e, t, n) =>
|
|
1685
|
-
stringify: (e) =>
|
|
1686
|
-
},
|
|
1684
|
+
resolve: (e, t, n) => Pt(e, 2, 16, n),
|
|
1685
|
+
stringify: (e) => Ft(e, 16, "0x")
|
|
1686
|
+
}, Bt = class e extends V {
|
|
1687
1687
|
constructor(t) {
|
|
1688
1688
|
super(t), this.tag = e.tag;
|
|
1689
1689
|
}
|
|
@@ -1714,17 +1714,17 @@ var Lt = {
|
|
|
1714
1714
|
return i;
|
|
1715
1715
|
}
|
|
1716
1716
|
};
|
|
1717
|
-
|
|
1718
|
-
var
|
|
1717
|
+
Bt.tag = "tag:yaml.org,2002:set";
|
|
1718
|
+
var Vt = {
|
|
1719
1719
|
collection: "map",
|
|
1720
1720
|
identify: (e) => e instanceof Set,
|
|
1721
|
-
nodeClass:
|
|
1721
|
+
nodeClass: Bt,
|
|
1722
1722
|
default: !1,
|
|
1723
1723
|
tag: "tag:yaml.org,2002:set",
|
|
1724
|
-
createNode: (e, t, n) =>
|
|
1724
|
+
createNode: (e, t, n) => Bt.from(e, t, n),
|
|
1725
1725
|
resolve(e, t) {
|
|
1726
1726
|
if (b(e)) {
|
|
1727
|
-
if (e.hasAllNullValues(!0)) return Object.assign(new
|
|
1727
|
+
if (e.hasAllNullValues(!0)) return Object.assign(new Bt(), e);
|
|
1728
1728
|
t("Set items must all have null values");
|
|
1729
1729
|
} else t("Expected a mapping for this tag");
|
|
1730
1730
|
return e;
|
|
@@ -1732,127 +1732,127 @@ var Ht = {
|
|
|
1732
1732
|
};
|
|
1733
1733
|
//#endregion
|
|
1734
1734
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
|
|
1735
|
-
function
|
|
1735
|
+
function Ht(e, t) {
|
|
1736
1736
|
let n = e[0], r = n === "-" || n === "+" ? e.substring(1) : e, i = (e) => t ? BigInt(e) : Number(e), a = r.replace(/_/g, "").split(":").reduce((e, t) => e * i(60) + i(t), i(0));
|
|
1737
1737
|
return n === "-" ? i(-1) * a : a;
|
|
1738
1738
|
}
|
|
1739
|
-
function
|
|
1739
|
+
function Ut(e) {
|
|
1740
1740
|
let { value: t } = e, n = (e) => e;
|
|
1741
1741
|
if (typeof t == "bigint") n = (e) => BigInt(e);
|
|
1742
|
-
else if (isNaN(t) || !isFinite(t)) return
|
|
1742
|
+
else if (isNaN(t) || !isFinite(t)) return U(e);
|
|
1743
1743
|
let r = "";
|
|
1744
1744
|
t < 0 && (r = "-", t *= n(-1));
|
|
1745
1745
|
let i = n(60), a = [t % i];
|
|
1746
1746
|
return t < 60 ? a.unshift(0) : (t = (t - a[0]) / i, a.unshift(t % i), t >= 60 && (t = (t - a[0]) / i, a.unshift(t))), r + a.map((e) => String(e).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
|
|
1747
1747
|
}
|
|
1748
|
-
var
|
|
1748
|
+
var Wt = {
|
|
1749
1749
|
identify: (e) => typeof e == "bigint" || Number.isInteger(e),
|
|
1750
1750
|
default: !0,
|
|
1751
1751
|
tag: "tag:yaml.org,2002:int",
|
|
1752
1752
|
format: "TIME",
|
|
1753
1753
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1754
|
-
resolve: (e, t, { intAsBigInt: n }) =>
|
|
1755
|
-
stringify:
|
|
1756
|
-
},
|
|
1754
|
+
resolve: (e, t, { intAsBigInt: n }) => Ht(e, n),
|
|
1755
|
+
stringify: Ut
|
|
1756
|
+
}, Gt = {
|
|
1757
1757
|
identify: (e) => typeof e == "number",
|
|
1758
1758
|
default: !0,
|
|
1759
1759
|
tag: "tag:yaml.org,2002:float",
|
|
1760
1760
|
format: "TIME",
|
|
1761
1761
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1762
|
-
resolve: (e) =>
|
|
1763
|
-
stringify:
|
|
1764
|
-
},
|
|
1762
|
+
resolve: (e) => Ht(e, !1),
|
|
1763
|
+
stringify: Ut
|
|
1764
|
+
}, Kt = {
|
|
1765
1765
|
identify: (e) => e instanceof Date,
|
|
1766
1766
|
default: !0,
|
|
1767
1767
|
tag: "tag:yaml.org,2002:timestamp",
|
|
1768
1768
|
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
|
|
1769
1769
|
resolve(e) {
|
|
1770
|
-
let t = e.match(
|
|
1770
|
+
let t = e.match(Kt.test);
|
|
1771
1771
|
if (!t) throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1772
1772
|
let [, n, r, i, a, o, s] = t.map(Number), c = t[7] ? Number((t[7] + "00").substr(1, 3)) : 0, l = Date.UTC(n, r - 1, i, a || 0, o || 0, s || 0, c), u = t[8];
|
|
1773
1773
|
if (u && u !== "Z") {
|
|
1774
|
-
let e =
|
|
1774
|
+
let e = Ht(u, !1);
|
|
1775
1775
|
Math.abs(e) < 30 && (e *= 60), l -= 6e4 * e;
|
|
1776
1776
|
}
|
|
1777
1777
|
return new Date(l);
|
|
1778
1778
|
},
|
|
1779
1779
|
stringify: ({ value: e }) => e?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
|
|
1780
|
-
},
|
|
1780
|
+
}, qt = [
|
|
1781
1781
|
tt,
|
|
1782
|
+
rt,
|
|
1782
1783
|
it,
|
|
1783
1784
|
at,
|
|
1784
|
-
|
|
1785
|
+
Ot,
|
|
1785
1786
|
kt,
|
|
1786
|
-
|
|
1787
|
+
It,
|
|
1787
1788
|
Lt,
|
|
1788
1789
|
Rt,
|
|
1789
1790
|
zt,
|
|
1790
|
-
|
|
1791
|
+
At,
|
|
1791
1792
|
jt,
|
|
1792
1793
|
Mt,
|
|
1793
|
-
|
|
1794
|
-
St,
|
|
1794
|
+
xt,
|
|
1795
1795
|
z,
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1796
|
+
Et,
|
|
1797
|
+
wt,
|
|
1798
|
+
Vt,
|
|
1799
|
+
Wt,
|
|
1799
1800
|
Gt,
|
|
1800
|
-
Kt
|
|
1801
|
-
|
|
1802
|
-
],
|
|
1803
|
-
["core", _t],
|
|
1801
|
+
Kt
|
|
1802
|
+
], Jt = /* @__PURE__ */ new Map([
|
|
1803
|
+
["core", gt],
|
|
1804
1804
|
["failsafe", [
|
|
1805
1805
|
tt,
|
|
1806
|
-
|
|
1807
|
-
|
|
1806
|
+
rt,
|
|
1807
|
+
it
|
|
1808
1808
|
]],
|
|
1809
|
-
["json",
|
|
1810
|
-
["yaml11",
|
|
1811
|
-
["yaml-1.1",
|
|
1812
|
-
]),
|
|
1813
|
-
binary:
|
|
1814
|
-
bool:
|
|
1815
|
-
float:
|
|
1816
|
-
floatExp:
|
|
1817
|
-
floatNaN:
|
|
1818
|
-
floatTime:
|
|
1819
|
-
int:
|
|
1820
|
-
intHex:
|
|
1821
|
-
intOct:
|
|
1822
|
-
intTime:
|
|
1809
|
+
["json", bt],
|
|
1810
|
+
["yaml11", qt],
|
|
1811
|
+
["yaml-1.1", qt]
|
|
1812
|
+
]), Yt = {
|
|
1813
|
+
binary: xt,
|
|
1814
|
+
bool: ot,
|
|
1815
|
+
float: lt,
|
|
1816
|
+
floatExp: ct,
|
|
1817
|
+
floatNaN: st,
|
|
1818
|
+
floatTime: Gt,
|
|
1819
|
+
int: mt,
|
|
1820
|
+
intHex: ht,
|
|
1821
|
+
intOct: pt,
|
|
1822
|
+
intTime: Wt,
|
|
1823
1823
|
map: tt,
|
|
1824
1824
|
merge: z,
|
|
1825
|
-
null:
|
|
1826
|
-
omap:
|
|
1827
|
-
pairs:
|
|
1828
|
-
seq:
|
|
1829
|
-
set:
|
|
1830
|
-
timestamp:
|
|
1831
|
-
},
|
|
1832
|
-
"tag:yaml.org,2002:binary":
|
|
1825
|
+
null: at,
|
|
1826
|
+
omap: Et,
|
|
1827
|
+
pairs: wt,
|
|
1828
|
+
seq: rt,
|
|
1829
|
+
set: Vt,
|
|
1830
|
+
timestamp: Kt
|
|
1831
|
+
}, Xt = {
|
|
1832
|
+
"tag:yaml.org,2002:binary": xt,
|
|
1833
1833
|
"tag:yaml.org,2002:merge": z,
|
|
1834
|
-
"tag:yaml.org,2002:omap":
|
|
1835
|
-
"tag:yaml.org,2002:pairs":
|
|
1836
|
-
"tag:yaml.org,2002:set":
|
|
1837
|
-
"tag:yaml.org,2002:timestamp":
|
|
1834
|
+
"tag:yaml.org,2002:omap": Et,
|
|
1835
|
+
"tag:yaml.org,2002:pairs": wt,
|
|
1836
|
+
"tag:yaml.org,2002:set": Vt,
|
|
1837
|
+
"tag:yaml.org,2002:timestamp": Kt
|
|
1838
1838
|
};
|
|
1839
|
-
function
|
|
1840
|
-
let r =
|
|
1839
|
+
function Zt(e, t, n) {
|
|
1840
|
+
let r = Jt.get(t);
|
|
1841
1841
|
if (r && !e) return n && !r.includes(z) ? r.concat(z) : r.slice();
|
|
1842
1842
|
let i = r;
|
|
1843
1843
|
if (!i) {
|
|
1844
1844
|
if (Array.isArray(e)) i = [];
|
|
1845
1845
|
else {
|
|
1846
|
-
let e = Array.from(
|
|
1846
|
+
let e = Array.from(Jt.keys()).filter((e) => e !== "yaml11").map((e) => JSON.stringify(e)).join(", ");
|
|
1847
1847
|
throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`);
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
1850
|
if (Array.isArray(e)) for (let t of e) i = i.concat(t);
|
|
1851
1851
|
else typeof e == "function" && (i = e(i.slice()));
|
|
1852
1852
|
return n && (i = i.concat(z)), i.reduce((e, t) => {
|
|
1853
|
-
let n = typeof t == "string" ?
|
|
1853
|
+
let n = typeof t == "string" ? Yt[t] : t;
|
|
1854
1854
|
if (!n) {
|
|
1855
|
-
let e = JSON.stringify(t), n = Object.keys(
|
|
1855
|
+
let e = JSON.stringify(t), n = Object.keys(Yt).map((e) => JSON.stringify(e)).join(", ");
|
|
1856
1856
|
throw Error(`Unknown custom tag ${e}; use one of ${n}`);
|
|
1857
1857
|
}
|
|
1858
1858
|
return e.includes(n) || e.push(n), e;
|
|
@@ -1860,9 +1860,9 @@ function Qt(e, t, n) {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
//#endregion
|
|
1862
1862
|
//#region node_modules/yaml/browser/dist/schema/Schema.js
|
|
1863
|
-
var
|
|
1863
|
+
var Qt = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), $t = class e {
|
|
1864
1864
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: r, schema: i, sortMapEntries: a, toStringDefaults: o }) {
|
|
1865
|
-
this.compat = Array.isArray(e) ?
|
|
1865
|
+
this.compat = Array.isArray(e) ? Zt(e, "compat") : e ? Zt(null, e) : null, this.name = typeof i == "string" && i || "core", this.knownTags = r ? Xt : {}, this.tags = Zt(t, this.name, n), this.toStringOptions = o ?? null, Object.defineProperty(this, p, { value: tt }), Object.defineProperty(this, h, { value: it }), Object.defineProperty(this, g, { value: rt }), this.sortMapEntries = typeof a == "function" ? a : a === !0 ? Qt : null;
|
|
1866
1866
|
}
|
|
1867
1867
|
clone() {
|
|
1868
1868
|
let t = Object.create(e.prototype, Object.getOwnPropertyDescriptors(this));
|
|
@@ -1871,7 +1871,7 @@ var $t = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), en = class e {
|
|
|
1871
1871
|
};
|
|
1872
1872
|
//#endregion
|
|
1873
1873
|
//#region node_modules/yaml/browser/dist/stringify/stringifyDocument.js
|
|
1874
|
-
function
|
|
1874
|
+
function en(e, t) {
|
|
1875
1875
|
let n = [], r = t.directives === !0;
|
|
1876
1876
|
if (t.directives !== !1 && e.directives) {
|
|
1877
1877
|
let t = e.directives.toString(e);
|
|
@@ -1909,7 +1909,7 @@ function tn(e, t) {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
//#endregion
|
|
1911
1911
|
//#region node_modules/yaml/browser/dist/doc/Document.js
|
|
1912
|
-
var
|
|
1912
|
+
var tn = class e {
|
|
1913
1913
|
constructor(e, t, n) {
|
|
1914
1914
|
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, _, { value: f });
|
|
1915
1915
|
let r = null;
|
|
@@ -1933,10 +1933,10 @@ var nn = class e {
|
|
|
1933
1933
|
return t.commentBefore = this.commentBefore, t.comment = this.comment, t.errors = this.errors.slice(), t.warnings = this.warnings.slice(), t.options = Object.assign({}, this.options), this.directives && (t.directives = this.directives.clone()), t.schema = this.schema.clone(), t.contents = T(this.contents) ? this.contents.clone(t.schema) : this.contents, this.range && (t.range = this.range.slice()), t;
|
|
1934
1934
|
}
|
|
1935
1935
|
add(e) {
|
|
1936
|
-
|
|
1936
|
+
nn(this.contents) && this.contents.add(e);
|
|
1937
1937
|
}
|
|
1938
1938
|
addIn(e, t) {
|
|
1939
|
-
|
|
1939
|
+
nn(this.contents) && this.contents.addIn(e, t);
|
|
1940
1940
|
}
|
|
1941
1941
|
createAlias(e, t) {
|
|
1942
1942
|
if (!e.anchor) {
|
|
@@ -1967,10 +1967,10 @@ var nn = class e {
|
|
|
1967
1967
|
return new B(this.createNode(e, null, n), this.createNode(t, null, n));
|
|
1968
1968
|
}
|
|
1969
1969
|
delete(e) {
|
|
1970
|
-
return
|
|
1970
|
+
return nn(this.contents) ? this.contents.delete(e) : !1;
|
|
1971
1971
|
}
|
|
1972
1972
|
deleteIn(e) {
|
|
1973
|
-
return _e(e) ? this.contents != null && (this.contents = null, !0) :
|
|
1973
|
+
return _e(e) ? this.contents != null && (this.contents = null, !0) : nn(this.contents) ? this.contents.deleteIn(e) : !1;
|
|
1974
1974
|
}
|
|
1975
1975
|
get(e, t) {
|
|
1976
1976
|
return w(this.contents) ? this.contents.get(e, t) : void 0;
|
|
@@ -1985,10 +1985,10 @@ var nn = class e {
|
|
|
1985
1985
|
return _e(e) ? this.contents !== void 0 : w(this.contents) ? this.contents.hasIn(e) : !1;
|
|
1986
1986
|
}
|
|
1987
1987
|
set(e, t) {
|
|
1988
|
-
this.contents == null ? this.contents = ge(this.schema, [e], t) :
|
|
1988
|
+
this.contents == null ? this.contents = ge(this.schema, [e], t) : nn(this.contents) && this.contents.set(e, t);
|
|
1989
1989
|
}
|
|
1990
1990
|
setIn(e, t) {
|
|
1991
|
-
_e(e) ? this.contents = t : this.contents == null ? this.contents = ge(this.schema, Array.from(e), t) :
|
|
1991
|
+
_e(e) ? this.contents = t : this.contents == null ? this.contents = ge(this.schema, Array.from(e), t) : nn(this.contents) && this.contents.setIn(e, t);
|
|
1992
1992
|
}
|
|
1993
1993
|
setSchema(e, t = {}) {
|
|
1994
1994
|
typeof e == "number" && (e = String(e));
|
|
@@ -2016,7 +2016,7 @@ var nn = class e {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
}
|
|
2018
2018
|
if (t.schema instanceof Object) this.schema = t.schema;
|
|
2019
|
-
else if (n) this.schema = new
|
|
2019
|
+
else if (n) this.schema = new $t(Object.assign(n, t));
|
|
2020
2020
|
else throw Error("With a null YAML version, the { schema: Schema } option is required");
|
|
2021
2021
|
}
|
|
2022
2022
|
toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: r, onAnchor: i, reviver: a } = {}) {
|
|
@@ -2045,28 +2045,28 @@ var nn = class e {
|
|
|
2045
2045
|
let t = JSON.stringify(e.indent);
|
|
2046
2046
|
throw Error(`"indent" option must be a positive integer, not ${t}`);
|
|
2047
2047
|
}
|
|
2048
|
-
return
|
|
2048
|
+
return en(this, e);
|
|
2049
2049
|
}
|
|
2050
2050
|
};
|
|
2051
|
-
function
|
|
2051
|
+
function nn(e) {
|
|
2052
2052
|
if (w(e)) return !0;
|
|
2053
2053
|
throw Error("Expected a YAML collection as document contents");
|
|
2054
2054
|
}
|
|
2055
2055
|
//#endregion
|
|
2056
2056
|
//#region node_modules/yaml/browser/dist/errors.js
|
|
2057
|
-
var
|
|
2057
|
+
var rn = class extends Error {
|
|
2058
2058
|
constructor(e, t, n, r) {
|
|
2059
2059
|
super(), this.name = e, this.code = n, this.message = r, this.pos = t;
|
|
2060
2060
|
}
|
|
2061
|
-
},
|
|
2061
|
+
}, an = class extends rn {
|
|
2062
2062
|
constructor(e, t, n) {
|
|
2063
2063
|
super("YAMLParseError", e, t, n);
|
|
2064
2064
|
}
|
|
2065
|
-
},
|
|
2065
|
+
}, on = class extends rn {
|
|
2066
2066
|
constructor(e, t, n) {
|
|
2067
2067
|
super("YAMLWarning", e, t, n);
|
|
2068
2068
|
}
|
|
2069
|
-
},
|
|
2069
|
+
}, sn = (e, t) => (n) => {
|
|
2070
2070
|
if (n.pos[0] === -1) return;
|
|
2071
2071
|
n.linePos = n.pos.map((e) => t.linePos(e));
|
|
2072
2072
|
let { line: r, col: i } = n.linePos[0];
|
|
@@ -2089,7 +2089,7 @@ var an = class extends Error {
|
|
|
2089
2089
|
};
|
|
2090
2090
|
//#endregion
|
|
2091
2091
|
//#region node_modules/yaml/browser/dist/compose/resolve-props.js
|
|
2092
|
-
function
|
|
2092
|
+
function cn(e, { flow: t, indicator: n, next: r, offset: i, onError: a, parentIndent: o, startOnNewline: s }) {
|
|
2093
2093
|
let c = !1, l = s, u = s, d = "", f = "", p = !1, m = !1, h = null, g = null, _ = null, v = null, y = null, b = null, x = null;
|
|
2094
2094
|
for (let i of e) switch (m &&= (i.type !== "space" && i.type !== "newline" && i.type !== "comma" && a(i.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), !1), h &&= (l && i.type !== "comment" && i.type !== "newline" && a(h, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), null), i.type) {
|
|
2095
2095
|
case "space":
|
|
@@ -2135,7 +2135,7 @@ function ln(e, { flow: t, indicator: n, next: r, offset: i, onError: a, parentIn
|
|
|
2135
2135
|
}
|
|
2136
2136
|
//#endregion
|
|
2137
2137
|
//#region node_modules/yaml/browser/dist/compose/util-contains-newline.js
|
|
2138
|
-
function
|
|
2138
|
+
function ln(e) {
|
|
2139
2139
|
if (!e) return null;
|
|
2140
2140
|
switch (e.type) {
|
|
2141
2141
|
case "alias":
|
|
@@ -2153,7 +2153,7 @@ function un(e) {
|
|
|
2153
2153
|
if (t.sep) {
|
|
2154
2154
|
for (let e of t.sep) if (e.type === "newline") return !0;
|
|
2155
2155
|
}
|
|
2156
|
-
if (
|
|
2156
|
+
if (ln(t.key) || ln(t.value)) return !0;
|
|
2157
2157
|
}
|
|
2158
2158
|
return !1;
|
|
2159
2159
|
default: return !0;
|
|
@@ -2161,15 +2161,15 @@ function un(e) {
|
|
|
2161
2161
|
}
|
|
2162
2162
|
//#endregion
|
|
2163
2163
|
//#region node_modules/yaml/browser/dist/compose/util-flow-indent-check.js
|
|
2164
|
-
function
|
|
2164
|
+
function un(e, t, n) {
|
|
2165
2165
|
if (t?.type === "flow-collection") {
|
|
2166
2166
|
let r = t.end[0];
|
|
2167
|
-
r.indent === e && (r.source === "]" || r.source === "}") &&
|
|
2167
|
+
r.indent === e && (r.source === "]" || r.source === "}") && ln(t) && n(r, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
2170
|
//#endregion
|
|
2171
2171
|
//#region node_modules/yaml/browser/dist/compose/util-map-includes.js
|
|
2172
|
-
function
|
|
2172
|
+
function dn(e, t, n) {
|
|
2173
2173
|
let { uniqueKeys: r } = e.options;
|
|
2174
2174
|
if (r === !1) return !1;
|
|
2175
2175
|
let i = typeof r == "function" ? r : (e, t) => e === t || S(e) && S(t) && e.value === t.value;
|
|
@@ -2177,13 +2177,13 @@ function fn(e, t, n) {
|
|
|
2177
2177
|
}
|
|
2178
2178
|
//#endregion
|
|
2179
2179
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-map.js
|
|
2180
|
-
var
|
|
2181
|
-
function
|
|
2180
|
+
var fn = "All mapping items must start at the same column";
|
|
2181
|
+
function pn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2182
2182
|
let o = new ((a?.nodeClass) ?? V)(n.schema);
|
|
2183
2183
|
n.atRoot &&= !1;
|
|
2184
2184
|
let s = r.offset, c = null;
|
|
2185
2185
|
for (let a of r.items) {
|
|
2186
|
-
let { start: l, key: u, sep: d, value: f } = a, p =
|
|
2186
|
+
let { start: l, key: u, sep: d, value: f } = a, p = cn(l, {
|
|
2187
2187
|
indicator: "explicit-key-ind",
|
|
2188
2188
|
next: u ?? d?.[0],
|
|
2189
2189
|
offset: s,
|
|
@@ -2192,16 +2192,16 @@ function mn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2192
2192
|
startOnNewline: !0
|
|
2193
2193
|
}), m = !p.found;
|
|
2194
2194
|
if (m) {
|
|
2195
|
-
if (u && (u.type === "block-seq" ? i(s, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in u && u.indent !== r.indent && i(s, "BAD_INDENT",
|
|
2195
|
+
if (u && (u.type === "block-seq" ? i(s, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in u && u.indent !== r.indent && i(s, "BAD_INDENT", fn)), !p.anchor && !p.tag && !d) {
|
|
2196
2196
|
c = p.end, p.comment && (o.comment ? o.comment += "\n" + p.comment : o.comment = p.comment);
|
|
2197
2197
|
continue;
|
|
2198
2198
|
}
|
|
2199
|
-
(p.newlineAfterProp ||
|
|
2200
|
-
} else p.found?.indent !== r.indent && i(s, "BAD_INDENT",
|
|
2199
|
+
(p.newlineAfterProp || ln(u)) && i(u ?? l[l.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2200
|
+
} else p.found?.indent !== r.indent && i(s, "BAD_INDENT", fn);
|
|
2201
2201
|
n.atKey = !0;
|
|
2202
2202
|
let h = p.end, g = u ? e(n, u, p, i) : t(n, h, l, null, p, i);
|
|
2203
|
-
n.schema.compat &&
|
|
2204
|
-
let _ =
|
|
2203
|
+
n.schema.compat && un(r.indent, u, i), n.atKey = !1, dn(n, o.items, g) && i(h, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2204
|
+
let _ = cn(d ?? [], {
|
|
2205
2205
|
indicator: "map-value-ind",
|
|
2206
2206
|
next: f,
|
|
2207
2207
|
offset: g.range[2],
|
|
@@ -2212,7 +2212,7 @@ function mn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2212
2212
|
if (s = _.end, _.found) {
|
|
2213
2213
|
m && (f?.type === "block-map" && !_.hasNewline && i(s, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), n.options.strict && p.start < _.found.offset - 1024 && i(g.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
|
|
2214
2214
|
let c = f ? e(n, f, _, i) : t(n, s, d, null, _, i);
|
|
2215
|
-
n.schema.compat &&
|
|
2215
|
+
n.schema.compat && un(r.indent, f, i), s = c.range[2];
|
|
2216
2216
|
let l = new B(g, c);
|
|
2217
2217
|
n.options.keepSourceTokens && (l.srcToken = a), o.items.push(l);
|
|
2218
2218
|
} else {
|
|
@@ -2229,12 +2229,12 @@ function mn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
//#endregion
|
|
2231
2231
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-seq.js
|
|
2232
|
-
function
|
|
2233
|
-
let o = new ((a?.nodeClass) ??
|
|
2232
|
+
function mn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2233
|
+
let o = new ((a?.nodeClass) ?? H)(n.schema);
|
|
2234
2234
|
n.atRoot &&= !1, n.atKey &&= !1;
|
|
2235
2235
|
let s = r.offset, c = null;
|
|
2236
2236
|
for (let { start: a, value: l } of r.items) {
|
|
2237
|
-
let u =
|
|
2237
|
+
let u = cn(a, {
|
|
2238
2238
|
indicator: "seq-item-ind",
|
|
2239
2239
|
next: l,
|
|
2240
2240
|
offset: s,
|
|
@@ -2250,7 +2250,7 @@ function hn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
2252
2252
|
let d = l ? e(n, l, u, i) : t(n, u.end, a, null, u, i);
|
|
2253
|
-
n.schema.compat &&
|
|
2253
|
+
n.schema.compat && un(r.indent, l, i), s = d.range[2], o.items.push(d);
|
|
2254
2254
|
}
|
|
2255
2255
|
return o.range = [
|
|
2256
2256
|
r.offset,
|
|
@@ -2260,7 +2260,7 @@ function hn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
//#endregion
|
|
2262
2262
|
//#region node_modules/yaml/browser/dist/compose/resolve-end.js
|
|
2263
|
-
function
|
|
2263
|
+
function hn(e, t, n, r) {
|
|
2264
2264
|
let i = "";
|
|
2265
2265
|
if (e) {
|
|
2266
2266
|
let a = !1, o = "";
|
|
@@ -2291,15 +2291,15 @@ function gn(e, t, n, r) {
|
|
|
2291
2291
|
}
|
|
2292
2292
|
//#endregion
|
|
2293
2293
|
//#region node_modules/yaml/browser/dist/compose/resolve-flow-collection.js
|
|
2294
|
-
var
|
|
2295
|
-
function
|
|
2296
|
-
let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ? V :
|
|
2294
|
+
var gn = "Block collections are not allowed within flow collections", _n = (e) => e && (e.type === "block-map" || e.type === "block-seq");
|
|
2295
|
+
function vn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2296
|
+
let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ? V : H))(n.schema);
|
|
2297
2297
|
c.flow = !0;
|
|
2298
2298
|
let l = n.atRoot;
|
|
2299
2299
|
l && (n.atRoot = !1), n.atKey &&= !1;
|
|
2300
2300
|
let u = r.offset + r.start.source.length;
|
|
2301
2301
|
for (let a = 0; a < r.items.length; ++a) {
|
|
2302
|
-
let l = r.items[a], { start: d, key: f, sep: p, value: m } = l, h =
|
|
2302
|
+
let l = r.items[a], { start: d, key: f, sep: p, value: m } = l, h = cn(d, {
|
|
2303
2303
|
flow: s,
|
|
2304
2304
|
indicator: "explicit-key-ind",
|
|
2305
2305
|
next: f ?? p?.[0],
|
|
@@ -2313,7 +2313,7 @@ function yn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2313
2313
|
a === 0 && h.comma ? i(h.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`) : a < r.items.length - 1 && i(h.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${s}`), h.comment && (c.comment ? c.comment += "\n" + h.comment : c.comment = h.comment), u = h.end;
|
|
2314
2314
|
continue;
|
|
2315
2315
|
}
|
|
2316
|
-
!o && n.options.strict &&
|
|
2316
|
+
!o && n.options.strict && ln(f) && i(f, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
|
|
2317
2317
|
}
|
|
2318
2318
|
if (a === 0) h.comma && i(h.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`);
|
|
2319
2319
|
else if (h.comma || i(h.start, "MISSING_CHAR", `Missing , between ${s} items`), h.comment) {
|
|
@@ -2333,12 +2333,12 @@ function yn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2333
2333
|
}
|
|
2334
2334
|
if (!o && !p && !h.found) {
|
|
2335
2335
|
let r = m ? e(n, m, h, i) : t(n, h.end, p, null, h, i);
|
|
2336
|
-
c.items.push(r), u = r.range[2],
|
|
2336
|
+
c.items.push(r), u = r.range[2], _n(m) && i(r.range, "BLOCK_IN_FLOW", gn);
|
|
2337
2337
|
} else {
|
|
2338
2338
|
n.atKey = !0;
|
|
2339
2339
|
let a = h.end, g = f ? e(n, f, h, i) : t(n, a, d, null, h, i);
|
|
2340
|
-
|
|
2341
|
-
let _ =
|
|
2340
|
+
_n(f) && i(g.range, "BLOCK_IN_FLOW", gn), n.atKey = !1;
|
|
2341
|
+
let _ = cn(p ?? [], {
|
|
2342
2342
|
flow: s,
|
|
2343
2343
|
indicator: "map-value-ind",
|
|
2344
2344
|
next: m,
|
|
@@ -2360,11 +2360,11 @@ function yn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2360
2360
|
}
|
|
2361
2361
|
} else m && ("source" in m && m.source?.[0] === ":" ? i(m, "MISSING_CHAR", `Missing space after : in ${s}`) : i(_.start, "MISSING_CHAR", `Missing , or : between ${s} items`));
|
|
2362
2362
|
let v = m ? e(n, m, _, i) : _.found ? t(n, _.end, p, null, _, i) : null;
|
|
2363
|
-
v ?
|
|
2363
|
+
v ? _n(m) && i(v.range, "BLOCK_IN_FLOW", gn) : _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
|
|
2364
2364
|
let y = new B(g, v);
|
|
2365
2365
|
if (n.options.keepSourceTokens && (y.srcToken = l), o) {
|
|
2366
2366
|
let e = c;
|
|
2367
|
-
|
|
2367
|
+
dn(n, e.items, g) && i(a, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(y);
|
|
2368
2368
|
} else {
|
|
2369
2369
|
let e = new V(n.schema);
|
|
2370
2370
|
e.flow = !0, e.items.push(y);
|
|
@@ -2385,7 +2385,7 @@ function yn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2385
2385
|
i(u, l ? "MISSING_CHAR" : "BAD_INDENT", t), f && f.source.length !== 1 && p.unshift(f);
|
|
2386
2386
|
}
|
|
2387
2387
|
if (p.length > 0) {
|
|
2388
|
-
let e =
|
|
2388
|
+
let e = hn(p, m, n.options.strict, i);
|
|
2389
2389
|
e.comment && (c.comment ? c.comment += "\n" + e.comment : c.comment = e.comment), c.range = [
|
|
2390
2390
|
r.offset,
|
|
2391
2391
|
m,
|
|
@@ -2400,31 +2400,31 @@ function yn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
//#endregion
|
|
2402
2402
|
//#region node_modules/yaml/browser/dist/compose/compose-collection.js
|
|
2403
|
-
function
|
|
2404
|
-
let o = n.type === "block-map" ?
|
|
2403
|
+
function yn(e, t, n, r, i, a) {
|
|
2404
|
+
let o = n.type === "block-map" ? pn(e, t, n, r, a) : n.type === "block-seq" ? mn(e, t, n, r, a) : vn(e, t, n, r, a), s = o.constructor;
|
|
2405
2405
|
return i === "!" || i === s.tagName ? (o.tag = s.tagName, o) : (i && (o.tag = i), o);
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function bn(e, t, n, r, i) {
|
|
2408
2408
|
let a = r.tag, o = a ? t.directives.tagName(a.source, (e) => i(a, "TAG_RESOLVE_FAILED", e)) : null;
|
|
2409
2409
|
if (n.type === "block-seq") {
|
|
2410
2410
|
let { anchor: e, newlineAfterProp: t } = r, n = e && a ? e.offset > a.offset ? e : a : e ?? a;
|
|
2411
2411
|
n && (!t || t.offset < n.offset) && i(n, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2412
2412
|
}
|
|
2413
2413
|
let s = n.type === "block-map" ? "map" : n.type === "block-seq" ? "seq" : n.start.source === "{" ? "map" : "seq";
|
|
2414
|
-
if (!a || !o || o === "!" || o === V.tagName && s === "map" || o ===
|
|
2414
|
+
if (!a || !o || o === "!" || o === V.tagName && s === "map" || o === H.tagName && s === "seq") return yn(e, t, n, i, o);
|
|
2415
2415
|
let c = t.schema.tags.find((e) => e.tag === o && e.collection === s);
|
|
2416
2416
|
if (!c) {
|
|
2417
2417
|
let r = t.schema.knownTags[o];
|
|
2418
2418
|
if (r?.collection === s) t.schema.tags.push(Object.assign({}, r, { default: !1 })), c = r;
|
|
2419
|
-
else return r ? i(a, "BAD_COLLECTION_TYPE", `${r.tag} used for ${s} collection, but expects ${r.collection ?? "scalar"}`, !0) : i(a, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0),
|
|
2419
|
+
else return r ? i(a, "BAD_COLLECTION_TYPE", `${r.tag} used for ${s} collection, but expects ${r.collection ?? "scalar"}`, !0) : i(a, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), yn(e, t, n, i, o);
|
|
2420
2420
|
}
|
|
2421
|
-
let l =
|
|
2421
|
+
let l = yn(e, t, n, i, o, c), u = c.resolve?.(l, (e) => i(a, "TAG_RESOLVE_FAILED", e), t.options) ?? l, d = T(u) ? u : new F(u);
|
|
2422
2422
|
return d.range = l.range, d.tag = o, c?.format && (d.format = c.format), d;
|
|
2423
2423
|
}
|
|
2424
2424
|
//#endregion
|
|
2425
2425
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-scalar.js
|
|
2426
|
-
function
|
|
2427
|
-
let r = t.offset, i =
|
|
2426
|
+
function xn(e, t, n) {
|
|
2427
|
+
let r = t.offset, i = Sn(t, e.options.strict, n);
|
|
2428
2428
|
if (!i) return {
|
|
2429
2429
|
value: "",
|
|
2430
2430
|
type: null,
|
|
@@ -2435,7 +2435,7 @@ function Sn(e, t, n) {
|
|
|
2435
2435
|
r
|
|
2436
2436
|
]
|
|
2437
2437
|
};
|
|
2438
|
-
let a = i.mode === ">" ? F.BLOCK_FOLDED : F.BLOCK_LITERAL, o = t.source ?
|
|
2438
|
+
let a = i.mode === ">" ? F.BLOCK_FOLDED : F.BLOCK_LITERAL, o = t.source ? Cn(t.source) : [], s = o.length;
|
|
2439
2439
|
for (let e = o.length - 1; e >= 0; --e) {
|
|
2440
2440
|
let t = o[e][1];
|
|
2441
2441
|
if (t === "" || t === "\r") s = e;
|
|
@@ -2498,7 +2498,7 @@ function Sn(e, t, n) {
|
|
|
2498
2498
|
]
|
|
2499
2499
|
};
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function Sn({ offset: e, props: t }, n, r) {
|
|
2502
2502
|
/* istanbul ignore if should not happen */
|
|
2503
2503
|
if (t[0].type !== "block-scalar-header") return r(t[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2504
2504
|
let { source: i } = t[0], a = i[0], o = 0, s = "", c = -1;
|
|
@@ -2541,24 +2541,24 @@ function Cn({ offset: e, props: t }, n, r) {
|
|
|
2541
2541
|
length: d
|
|
2542
2542
|
};
|
|
2543
2543
|
}
|
|
2544
|
-
function
|
|
2544
|
+
function Cn(e) {
|
|
2545
2545
|
let t = e.split(/\n( *)/), n = t[0], r = n.match(/^( *)/), i = [r?.[1] ? [r[1], n.slice(r[1].length)] : ["", n]];
|
|
2546
2546
|
for (let e = 1; e < t.length; e += 2) i.push([t[e], t[e + 1]]);
|
|
2547
2547
|
return i;
|
|
2548
2548
|
}
|
|
2549
2549
|
//#endregion
|
|
2550
2550
|
//#region node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js
|
|
2551
|
-
function
|
|
2551
|
+
function wn(e, t, n) {
|
|
2552
2552
|
let { offset: r, type: i, source: a, end: o } = e, s, c, l = (e, t, i) => n(r + e, t, i);
|
|
2553
2553
|
switch (i) {
|
|
2554
2554
|
case "scalar":
|
|
2555
|
-
s = F.PLAIN, c =
|
|
2555
|
+
s = F.PLAIN, c = Tn(a, l);
|
|
2556
2556
|
break;
|
|
2557
2557
|
case "single-quoted-scalar":
|
|
2558
|
-
s = F.QUOTE_SINGLE, c =
|
|
2558
|
+
s = F.QUOTE_SINGLE, c = En(a, l);
|
|
2559
2559
|
break;
|
|
2560
2560
|
case "double-quoted-scalar":
|
|
2561
|
-
s = F.QUOTE_DOUBLE, c =
|
|
2561
|
+
s = F.QUOTE_DOUBLE, c = On(a, l);
|
|
2562
2562
|
break;
|
|
2563
2563
|
/* istanbul ignore next should not happen */
|
|
2564
2564
|
default: return n(e, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
|
|
@@ -2572,7 +2572,7 @@ function Tn(e, t, n) {
|
|
|
2572
2572
|
]
|
|
2573
2573
|
};
|
|
2574
2574
|
}
|
|
2575
|
-
let u = r + a.length, d =
|
|
2575
|
+
let u = r + a.length, d = hn(o, u, t, n);
|
|
2576
2576
|
return {
|
|
2577
2577
|
value: c,
|
|
2578
2578
|
type: s,
|
|
@@ -2584,7 +2584,7 @@ function Tn(e, t, n) {
|
|
|
2584
2584
|
]
|
|
2585
2585
|
};
|
|
2586
2586
|
}
|
|
2587
|
-
function
|
|
2587
|
+
function Tn(e, t) {
|
|
2588
2588
|
let n = "";
|
|
2589
2589
|
switch (e[0]) {
|
|
2590
2590
|
/* istanbul ignore next should not happen */
|
|
@@ -2604,12 +2604,12 @@ function En(e, t) {
|
|
|
2604
2604
|
case "@":
|
|
2605
2605
|
case "`": n = `reserved character ${e[0]}`;
|
|
2606
2606
|
}
|
|
2607
|
-
return n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`),
|
|
2607
|
+
return n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`), Dn(e);
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2610
|
-
return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"),
|
|
2609
|
+
function En(e, t) {
|
|
2610
|
+
return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"), Dn(e.slice(1, -1)).replace(/''/g, "'");
|
|
2611
2611
|
}
|
|
2612
|
-
function
|
|
2612
|
+
function Dn(e) {
|
|
2613
2613
|
let t, n;
|
|
2614
2614
|
try {
|
|
2615
2615
|
t = /* @__PURE__ */ RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy"), n = /* @__PURE__ */ RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
|
|
@@ -2623,22 +2623,22 @@ function On(e) {
|
|
|
2623
2623
|
let s = /[ \t]*(.*)/sy;
|
|
2624
2624
|
return s.lastIndex = o, r = s.exec(e), i + a + (r?.[1] ?? "");
|
|
2625
2625
|
}
|
|
2626
|
-
function
|
|
2626
|
+
function On(e, t) {
|
|
2627
2627
|
let n = "";
|
|
2628
2628
|
for (let r = 1; r < e.length - 1; ++r) {
|
|
2629
2629
|
let i = e[r];
|
|
2630
2630
|
if (i !== "\r" || e[r + 1] !== "\n") {
|
|
2631
2631
|
if (i === "\n") {
|
|
2632
|
-
let { fold: t, offset: i } =
|
|
2632
|
+
let { fold: t, offset: i } = kn(e, r);
|
|
2633
2633
|
n += t, r = i;
|
|
2634
2634
|
} else if (i === "\\") {
|
|
2635
|
-
let i = e[++r], a =
|
|
2635
|
+
let i = e[++r], a = An[i];
|
|
2636
2636
|
if (a) n += a;
|
|
2637
2637
|
else if (i === "\n") for (i = e[r + 1]; i === " " || i === " ";) i = e[++r + 1];
|
|
2638
2638
|
else if (i === "\r" && e[r + 1] === "\n") for (i = e[++r + 1]; i === " " || i === " ";) i = e[++r + 1];
|
|
2639
2639
|
else if (i === "x" || i === "u" || i === "U") {
|
|
2640
2640
|
let a = i === "x" ? 2 : i === "u" ? 4 : 8;
|
|
2641
|
-
n +=
|
|
2641
|
+
n += jn(e, r + 1, a, t), r += a;
|
|
2642
2642
|
} else {
|
|
2643
2643
|
let i = e.substr(r - 1, 2);
|
|
2644
2644
|
t(r - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), n += i;
|
|
@@ -2652,7 +2652,7 @@ function kn(e, t) {
|
|
|
2652
2652
|
}
|
|
2653
2653
|
return (e[e.length - 1] !== "\"" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing \"quote"), n;
|
|
2654
2654
|
}
|
|
2655
|
-
function
|
|
2655
|
+
function kn(e, t) {
|
|
2656
2656
|
let n = "", r = e[t + 1];
|
|
2657
2657
|
for (; (r === " " || r === " " || r === "\n" || r === "\r") && (r !== "\r" || e[t + 2] === "\n");) r === "\n" && (n += "\n"), t += 1, r = e[t + 1];
|
|
2658
2658
|
return n ||= " ", {
|
|
@@ -2660,7 +2660,7 @@ function An(e, t) {
|
|
|
2660
2660
|
offset: t
|
|
2661
2661
|
};
|
|
2662
2662
|
}
|
|
2663
|
-
var
|
|
2663
|
+
var An = {
|
|
2664
2664
|
0: "\0",
|
|
2665
2665
|
a: "\x07",
|
|
2666
2666
|
b: "\b",
|
|
@@ -2680,7 +2680,7 @@ var jn = {
|
|
|
2680
2680
|
"\\": "\\",
|
|
2681
2681
|
" ": " "
|
|
2682
2682
|
};
|
|
2683
|
-
function
|
|
2683
|
+
function jn(e, t, n, r) {
|
|
2684
2684
|
let i = e.substr(t, n), a = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
2685
2685
|
try {
|
|
2686
2686
|
return String.fromCodePoint(a);
|
|
@@ -2691,9 +2691,9 @@ function Mn(e, t, n, r) {
|
|
|
2691
2691
|
}
|
|
2692
2692
|
//#endregion
|
|
2693
2693
|
//#region node_modules/yaml/browser/dist/compose/compose-scalar.js
|
|
2694
|
-
function
|
|
2695
|
-
let { value: i, type: a, comment: o, range: s } = t.type === "block-scalar" ?
|
|
2696
|
-
l = e.options.stringKeys && e.atKey ? e.schema[h] : c ?
|
|
2694
|
+
function Mn(e, t, n, r) {
|
|
2695
|
+
let { value: i, type: a, comment: o, range: s } = t.type === "block-scalar" ? xn(e, t, r) : wn(t, e.options.strict, r), c = n ? e.directives.tagName(n.source, (e) => r(n, "TAG_RESOLVE_FAILED", e)) : null, l;
|
|
2696
|
+
l = e.options.stringKeys && e.atKey ? e.schema[h] : c ? Nn(e.schema, i, c, n, r) : t.type === "scalar" ? Pn(e, i, t, r) : e.schema[h];
|
|
2697
2697
|
let u;
|
|
2698
2698
|
try {
|
|
2699
2699
|
let a = l.resolve(i, (e) => r(n ?? t, "TAG_RESOLVE_FAILED", e), e.options);
|
|
@@ -2704,7 +2704,7 @@ function Nn(e, t, n, r) {
|
|
|
2704
2704
|
}
|
|
2705
2705
|
return u.range = s, u.source = i, a && (u.type = a), c && (u.tag = c), l.format && (u.format = l.format), o && (u.comment = o), u;
|
|
2706
2706
|
}
|
|
2707
|
-
function
|
|
2707
|
+
function Nn(e, t, n, r, i) {
|
|
2708
2708
|
if (n === "!") return e[h];
|
|
2709
2709
|
let a = [];
|
|
2710
2710
|
for (let t of e.tags) if (!t.collection && t.tag === n) {
|
|
@@ -2718,7 +2718,7 @@ function Pn(e, t, n, r, i) {
|
|
|
2718
2718
|
test: void 0
|
|
2719
2719
|
})), o) : (i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${n}`, n !== "tag:yaml.org,2002:str"), e[h]);
|
|
2720
2720
|
}
|
|
2721
|
-
function
|
|
2721
|
+
function Pn({ atKey: e, directives: t, schema: n }, r, i, a) {
|
|
2722
2722
|
let o = n.tags.find((t) => (t.default === !0 || e && t.default === "key") && t.test?.test(r)) || n[h];
|
|
2723
2723
|
if (n.compat) {
|
|
2724
2724
|
let e = n.compat.find((e) => e.default && e.test?.test(r)) ?? n[h];
|
|
@@ -2728,7 +2728,7 @@ function Fn({ atKey: e, directives: t, schema: n }, r, i, a) {
|
|
|
2728
2728
|
}
|
|
2729
2729
|
//#endregion
|
|
2730
2730
|
//#region node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js
|
|
2731
|
-
function
|
|
2731
|
+
function Fn(e, t, n) {
|
|
2732
2732
|
if (t) {
|
|
2733
2733
|
n ??= t.length;
|
|
2734
2734
|
for (let r = n - 1; r >= 0; --r) {
|
|
@@ -2748,48 +2748,48 @@ function In(e, t, n) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
//#endregion
|
|
2750
2750
|
//#region node_modules/yaml/browser/dist/compose/compose-node.js
|
|
2751
|
-
var
|
|
2752
|
-
composeNode:
|
|
2753
|
-
composeEmptyNode:
|
|
2751
|
+
var In = {
|
|
2752
|
+
composeNode: Ln,
|
|
2753
|
+
composeEmptyNode: Rn
|
|
2754
2754
|
};
|
|
2755
|
-
function
|
|
2755
|
+
function Ln(e, t, n, r) {
|
|
2756
2756
|
let i = e.atKey, { spaceBefore: a, comment: o, anchor: s, tag: c } = n, l, u = !0;
|
|
2757
2757
|
switch (t.type) {
|
|
2758
2758
|
case "alias":
|
|
2759
|
-
l =
|
|
2759
|
+
l = zn(e, t, r), (s || c) && r(t, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
2760
2760
|
break;
|
|
2761
2761
|
case "scalar":
|
|
2762
2762
|
case "single-quoted-scalar":
|
|
2763
2763
|
case "double-quoted-scalar":
|
|
2764
2764
|
case "block-scalar":
|
|
2765
|
-
l =
|
|
2765
|
+
l = Mn(e, t, c, r), s && (l.anchor = s.source.substring(1));
|
|
2766
2766
|
break;
|
|
2767
2767
|
case "block-map":
|
|
2768
2768
|
case "block-seq":
|
|
2769
2769
|
case "flow-collection":
|
|
2770
2770
|
try {
|
|
2771
|
-
l =
|
|
2771
|
+
l = bn(In, e, t, n, r), s && (l.anchor = s.source.substring(1));
|
|
2772
2772
|
} catch (e) {
|
|
2773
2773
|
r(t, "RESOURCE_EXHAUSTION", e instanceof Error ? e.message : String(e));
|
|
2774
2774
|
}
|
|
2775
2775
|
break;
|
|
2776
2776
|
default: r(t, "UNEXPECTED_TOKEN", t.type === "error" ? t.message : `Unsupported token (type: ${t.type})`), u = !1;
|
|
2777
2777
|
}
|
|
2778
|
-
return l ??=
|
|
2778
|
+
return l ??= Rn(e, t.offset, void 0, null, n, r), s && l.anchor === "" && r(s, "BAD_ALIAS", "Anchor cannot be an empty string"), i && e.options.stringKeys && (!S(l) || typeof l.value != "string" || l.tag && l.tag !== "tag:yaml.org,2002:str") && r(c ?? t, "NON_STRING_KEY", "With stringKeys, all keys must be strings"), a && (l.spaceBefore = !0), o && (t.type === "scalar" && t.source === "" ? l.comment = o : l.commentBefore = o), e.options.keepSourceTokens && u && (l.srcToken = t), l;
|
|
2779
2779
|
}
|
|
2780
|
-
function
|
|
2781
|
-
let u =
|
|
2780
|
+
function Rn(e, t, n, r, { spaceBefore: i, comment: a, anchor: o, tag: s, end: c }, l) {
|
|
2781
|
+
let u = Mn(e, {
|
|
2782
2782
|
type: "scalar",
|
|
2783
|
-
offset:
|
|
2783
|
+
offset: Fn(t, n, r),
|
|
2784
2784
|
indent: -1,
|
|
2785
2785
|
source: ""
|
|
2786
2786
|
}, s, l);
|
|
2787
2787
|
return o && (u.anchor = o.source.substring(1), u.anchor === "" && l(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (u.spaceBefore = !0), a && (u.comment = a, u.range[2] = c), u;
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function zn({ options: e }, { offset: t, source: n, end: r }, i) {
|
|
2790
2790
|
let a = new fe(n.substring(1));
|
|
2791
2791
|
a.source === "" && i(t, "BAD_ALIAS", "Alias cannot be an empty string"), a.source.endsWith(":") && i(t + n.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
|
|
2792
|
-
let o = t + n.length, s =
|
|
2792
|
+
let o = t + n.length, s = hn(r, o, e.strict, i);
|
|
2793
2793
|
return a.range = [
|
|
2794
2794
|
t,
|
|
2795
2795
|
o,
|
|
@@ -2798,14 +2798,14 @@ function Bn({ options: e }, { offset: t, source: n, end: r }, i) {
|
|
|
2798
2798
|
}
|
|
2799
2799
|
//#endregion
|
|
2800
2800
|
//#region node_modules/yaml/browser/dist/compose/compose-doc.js
|
|
2801
|
-
function
|
|
2802
|
-
let s = new
|
|
2801
|
+
function Bn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
2802
|
+
let s = new tn(void 0, Object.assign({ _directives: t }, e)), c = {
|
|
2803
2803
|
atKey: !1,
|
|
2804
2804
|
atRoot: !0,
|
|
2805
2805
|
directives: s.directives,
|
|
2806
2806
|
options: s.options,
|
|
2807
2807
|
schema: s.schema
|
|
2808
|
-
}, l =
|
|
2808
|
+
}, l = cn(r, {
|
|
2809
2809
|
indicator: "doc-start",
|
|
2810
2810
|
next: i ?? a?.[0],
|
|
2811
2811
|
offset: n,
|
|
@@ -2813,8 +2813,8 @@ function Vn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
|
2813
2813
|
parentIndent: 0,
|
|
2814
2814
|
startOnNewline: !0
|
|
2815
2815
|
});
|
|
2816
|
-
l.found && (s.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !l.hasNewline && o(l.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), s.contents = i ?
|
|
2817
|
-
let u = s.contents.range[2], d =
|
|
2816
|
+
l.found && (s.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !l.hasNewline && o(l.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), s.contents = i ? Ln(c, i, l, o) : Rn(c, l.end, r, null, l, o);
|
|
2817
|
+
let u = s.contents.range[2], d = hn(a, u, !1, o);
|
|
2818
2818
|
return d.comment && (s.comment = d.comment), s.range = [
|
|
2819
2819
|
n,
|
|
2820
2820
|
u,
|
|
@@ -2823,13 +2823,13 @@ function Vn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
|
2823
2823
|
}
|
|
2824
2824
|
//#endregion
|
|
2825
2825
|
//#region node_modules/yaml/browser/dist/compose/composer.js
|
|
2826
|
-
function
|
|
2826
|
+
function Vn(e) {
|
|
2827
2827
|
if (typeof e == "number") return [e, e + 1];
|
|
2828
2828
|
if (Array.isArray(e)) return e.length === 2 ? e : [e[0], e[1]];
|
|
2829
2829
|
let { offset: t, source: n } = e;
|
|
2830
2830
|
return [t, t + (typeof n == "string" ? n.length : 1)];
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function Hn(e) {
|
|
2833
2833
|
let t = "", n = !1, r = !1;
|
|
2834
2834
|
for (let i = 0; i < e.length; ++i) {
|
|
2835
2835
|
let a = e[i];
|
|
@@ -2848,15 +2848,15 @@ function Un(e) {
|
|
|
2848
2848
|
afterEmptyLine: r
|
|
2849
2849
|
};
|
|
2850
2850
|
}
|
|
2851
|
-
var
|
|
2851
|
+
var Un = class {
|
|
2852
2852
|
constructor(e = {}) {
|
|
2853
2853
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (e, t, n, r) => {
|
|
2854
|
-
let i =
|
|
2855
|
-
r ? this.warnings.push(new
|
|
2854
|
+
let i = Vn(e);
|
|
2855
|
+
r ? this.warnings.push(new on(i, t, n)) : this.errors.push(new an(i, t, n));
|
|
2856
2856
|
}, this.directives = new M({ version: e.version || "1.2" }), this.options = e;
|
|
2857
2857
|
}
|
|
2858
2858
|
decorate(e, t) {
|
|
2859
|
-
let { comment: n, afterEmptyLine: r } =
|
|
2859
|
+
let { comment: n, afterEmptyLine: r } = Hn(this.prelude);
|
|
2860
2860
|
if (n) {
|
|
2861
2861
|
let i = e.contents;
|
|
2862
2862
|
if (t) e.comment = e.comment ? `${e.comment}\n${n}` : n;
|
|
@@ -2879,7 +2879,7 @@ var Wn = class {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
streamInfo() {
|
|
2881
2881
|
return {
|
|
2882
|
-
comment:
|
|
2882
|
+
comment: Hn(this.prelude).comment,
|
|
2883
2883
|
directives: this.directives,
|
|
2884
2884
|
errors: this.errors,
|
|
2885
2885
|
warnings: this.warnings
|
|
@@ -2893,12 +2893,12 @@ var Wn = class {
|
|
|
2893
2893
|
switch (e.type) {
|
|
2894
2894
|
case "directive":
|
|
2895
2895
|
this.directives.add(e.source, (t, n, r) => {
|
|
2896
|
-
let i =
|
|
2896
|
+
let i = Vn(e);
|
|
2897
2897
|
i[0] += t, this.onError(i, "BAD_DIRECTIVE", n, r);
|
|
2898
2898
|
}), this.prelude.push(e.source), this.atDirectives = !0;
|
|
2899
2899
|
break;
|
|
2900
2900
|
case "document": {
|
|
2901
|
-
let t =
|
|
2901
|
+
let t = Bn(this.options, this.directives, e, this.onError);
|
|
2902
2902
|
this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
|
|
2903
2903
|
break;
|
|
2904
2904
|
}
|
|
@@ -2909,17 +2909,17 @@ var Wn = class {
|
|
|
2909
2909
|
this.prelude.push(e.source);
|
|
2910
2910
|
break;
|
|
2911
2911
|
case "error": {
|
|
2912
|
-
let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new
|
|
2912
|
+
let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new an(Vn(e), "UNEXPECTED_TOKEN", t);
|
|
2913
2913
|
this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
|
|
2914
2914
|
break;
|
|
2915
2915
|
}
|
|
2916
2916
|
case "doc-end": {
|
|
2917
2917
|
if (!this.doc) {
|
|
2918
|
-
this.errors.push(new
|
|
2918
|
+
this.errors.push(new an(Vn(e), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document"));
|
|
2919
2919
|
break;
|
|
2920
2920
|
}
|
|
2921
2921
|
this.doc.directives.docEnd = !0;
|
|
2922
|
-
let t =
|
|
2922
|
+
let t = hn(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
|
|
2923
2923
|
if (this.decorate(this.doc, !0), t.comment) {
|
|
2924
2924
|
let e = this.doc.comment;
|
|
2925
2925
|
this.doc.comment = e ? `${e}\n${t.comment}` : t.comment;
|
|
@@ -2927,13 +2927,13 @@ var Wn = class {
|
|
|
2927
2927
|
this.doc.range[2] = t.offset;
|
|
2928
2928
|
break;
|
|
2929
2929
|
}
|
|
2930
|
-
default: this.errors.push(new
|
|
2930
|
+
default: this.errors.push(new an(Vn(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
2933
|
*end(e = !1, t = -1) {
|
|
2934
2934
|
if (this.doc) this.decorate(this.doc, !0), yield this.doc, this.doc = null;
|
|
2935
2935
|
else if (e) {
|
|
2936
|
-
let e = new
|
|
2936
|
+
let e = new tn(void 0, Object.assign({ _directives: this.directives }, this.options));
|
|
2937
2937
|
this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), e.range = [
|
|
2938
2938
|
0,
|
|
2939
2939
|
t,
|
|
@@ -2944,23 +2944,23 @@ var Wn = class {
|
|
|
2944
2944
|
};
|
|
2945
2945
|
//#endregion
|
|
2946
2946
|
//#region node_modules/yaml/browser/dist/parse/cst-scalar.js
|
|
2947
|
-
function
|
|
2947
|
+
function Wn(e, t = !0, n) {
|
|
2948
2948
|
if (e) {
|
|
2949
2949
|
let r = (e, t, r) => {
|
|
2950
2950
|
let i = typeof e == "number" ? e : Array.isArray(e) ? e[0] : e.offset;
|
|
2951
2951
|
if (n) n(i, t, r);
|
|
2952
|
-
else throw new
|
|
2952
|
+
else throw new an([i, i + 1], t, r);
|
|
2953
2953
|
};
|
|
2954
2954
|
switch (e.type) {
|
|
2955
2955
|
case "scalar":
|
|
2956
2956
|
case "single-quoted-scalar":
|
|
2957
|
-
case "double-quoted-scalar": return
|
|
2958
|
-
case "block-scalar": return
|
|
2957
|
+
case "double-quoted-scalar": return wn(e, t, r);
|
|
2958
|
+
case "block-scalar": return xn({ options: { strict: t } }, e, r);
|
|
2959
2959
|
}
|
|
2960
2960
|
}
|
|
2961
2961
|
return null;
|
|
2962
2962
|
}
|
|
2963
|
-
function
|
|
2963
|
+
function Gn(e, t) {
|
|
2964
2964
|
let { implicitKey: n = !1, indent: r, inFlow: i = !1, offset: a = -1, type: o = "PLAIN" } = t, s = Fe({
|
|
2965
2965
|
type: o,
|
|
2966
2966
|
value: e
|
|
@@ -2987,7 +2987,7 @@ function Kn(e, t) {
|
|
|
2987
2987
|
indent: r,
|
|
2988
2988
|
source: t
|
|
2989
2989
|
}];
|
|
2990
|
-
return
|
|
2990
|
+
return Jn(i, c) || i.push({
|
|
2991
2991
|
type: "newline",
|
|
2992
2992
|
offset: -1,
|
|
2993
2993
|
indent: r,
|
|
@@ -3023,7 +3023,7 @@ function Kn(e, t) {
|
|
|
3023
3023
|
};
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
|
-
function
|
|
3026
|
+
function Kn(e, t, n = {}) {
|
|
3027
3027
|
let { afterKey: r = !1, implicitKey: i = !1, inFlow: a = !1, type: o } = n, s = "indent" in e ? e.indent : null;
|
|
3028
3028
|
if (r && typeof s == "number" && (s += 2), !o) switch (e.type) {
|
|
3029
3029
|
case "single-quoted-scalar":
|
|
@@ -3055,18 +3055,18 @@ function qn(e, t, n = {}) {
|
|
|
3055
3055
|
switch (c[0]) {
|
|
3056
3056
|
case "|":
|
|
3057
3057
|
case ">":
|
|
3058
|
-
|
|
3058
|
+
qn(e, c);
|
|
3059
3059
|
break;
|
|
3060
3060
|
case "\"":
|
|
3061
|
-
|
|
3061
|
+
Yn(e, c, "double-quoted-scalar");
|
|
3062
3062
|
break;
|
|
3063
3063
|
case "'":
|
|
3064
|
-
|
|
3064
|
+
Yn(e, c, "single-quoted-scalar");
|
|
3065
3065
|
break;
|
|
3066
|
-
default:
|
|
3066
|
+
default: Yn(e, c, "scalar");
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
|
-
function
|
|
3069
|
+
function qn(e, t) {
|
|
3070
3070
|
let n = t.indexOf("\n"), r = t.substring(0, n), i = t.substring(n + 1) + "\n";
|
|
3071
3071
|
if (e.type === "block-scalar") {
|
|
3072
3072
|
let t = e.props[0];
|
|
@@ -3079,7 +3079,7 @@ function Jn(e, t) {
|
|
|
3079
3079
|
indent: n,
|
|
3080
3080
|
source: r
|
|
3081
3081
|
}];
|
|
3082
|
-
|
|
3082
|
+
Jn(a, "end" in e ? e.end : void 0) || a.push({
|
|
3083
3083
|
type: "newline",
|
|
3084
3084
|
offset: -1,
|
|
3085
3085
|
indent: n,
|
|
@@ -3094,7 +3094,7 @@ function Jn(e, t) {
|
|
|
3094
3094
|
});
|
|
3095
3095
|
}
|
|
3096
3096
|
}
|
|
3097
|
-
function
|
|
3097
|
+
function Jn(e, t) {
|
|
3098
3098
|
if (t) for (let n of t) switch (n.type) {
|
|
3099
3099
|
case "space":
|
|
3100
3100
|
case "comment":
|
|
@@ -3104,7 +3104,7 @@ function Yn(e, t) {
|
|
|
3104
3104
|
}
|
|
3105
3105
|
return !1;
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function Yn(e, t, n) {
|
|
3108
3108
|
switch (e.type) {
|
|
3109
3109
|
case "scalar":
|
|
3110
3110
|
case "double-quoted-scalar":
|
|
@@ -3151,28 +3151,28 @@ function Xn(e, t, n) {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
//#endregion
|
|
3153
3153
|
//#region node_modules/yaml/browser/dist/parse/cst-stringify.js
|
|
3154
|
-
var
|
|
3155
|
-
function
|
|
3154
|
+
var Xn = (e) => "type" in e ? Zn(e) : Qn(e);
|
|
3155
|
+
function Zn(e) {
|
|
3156
3156
|
switch (e.type) {
|
|
3157
3157
|
case "block-scalar": {
|
|
3158
3158
|
let t = "";
|
|
3159
|
-
for (let n of e.props) t +=
|
|
3159
|
+
for (let n of e.props) t += Zn(n);
|
|
3160
3160
|
return t + e.source;
|
|
3161
3161
|
}
|
|
3162
3162
|
case "block-map":
|
|
3163
3163
|
case "block-seq": {
|
|
3164
3164
|
let t = "";
|
|
3165
|
-
for (let n of e.items) t +=
|
|
3165
|
+
for (let n of e.items) t += Qn(n);
|
|
3166
3166
|
return t;
|
|
3167
3167
|
}
|
|
3168
3168
|
case "flow-collection": {
|
|
3169
3169
|
let t = e.start.source;
|
|
3170
|
-
for (let n of e.items) t +=
|
|
3170
|
+
for (let n of e.items) t += Qn(n);
|
|
3171
3171
|
for (let n of e.end) t += n.source;
|
|
3172
3172
|
return t;
|
|
3173
3173
|
}
|
|
3174
3174
|
case "document": {
|
|
3175
|
-
let t =
|
|
3175
|
+
let t = Qn(e);
|
|
3176
3176
|
if (e.end) for (let n of e.end) t += n.source;
|
|
3177
3177
|
return t;
|
|
3178
3178
|
}
|
|
@@ -3183,22 +3183,22 @@ function Qn(e) {
|
|
|
3183
3183
|
}
|
|
3184
3184
|
}
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function Qn({ start: e, key: t, sep: n, value: r }) {
|
|
3187
3187
|
let i = "";
|
|
3188
3188
|
for (let t of e) i += t.source;
|
|
3189
|
-
if (t && (i +=
|
|
3190
|
-
return r && (i +=
|
|
3189
|
+
if (t && (i += Zn(t)), n) for (let e of n) i += e.source;
|
|
3190
|
+
return r && (i += Zn(r)), i;
|
|
3191
3191
|
}
|
|
3192
3192
|
//#endregion
|
|
3193
3193
|
//#region node_modules/yaml/browser/dist/parse/cst-visit.js
|
|
3194
|
-
var
|
|
3195
|
-
function
|
|
3194
|
+
var $n = Symbol("break visit"), er = Symbol("skip children"), tr = Symbol("remove item");
|
|
3195
|
+
function nr(e, t) {
|
|
3196
3196
|
"type" in e && e.type === "document" && (e = {
|
|
3197
3197
|
start: e.start,
|
|
3198
3198
|
value: e.value
|
|
3199
|
-
}),
|
|
3199
|
+
}), rr(Object.freeze([]), e, t);
|
|
3200
3200
|
}
|
|
3201
|
-
|
|
3201
|
+
nr.BREAK = $n, nr.SKIP = er, nr.REMOVE = tr, nr.itemAtPath = (e, t) => {
|
|
3202
3202
|
let n = e;
|
|
3203
3203
|
for (let [e, r] of t) {
|
|
3204
3204
|
let t = n?.[e];
|
|
@@ -3206,22 +3206,22 @@ rr.BREAK = er, rr.SKIP = tr, rr.REMOVE = nr, rr.itemAtPath = (e, t) => {
|
|
|
3206
3206
|
else return;
|
|
3207
3207
|
}
|
|
3208
3208
|
return n;
|
|
3209
|
-
},
|
|
3210
|
-
let n =
|
|
3209
|
+
}, nr.parentCollection = (e, t) => {
|
|
3210
|
+
let n = nr.itemAtPath(e, t.slice(0, -1)), r = t[t.length - 1][0], i = n?.[r];
|
|
3211
3211
|
if (i && "items" in i) return i;
|
|
3212
3212
|
throw Error("Parent collection not found");
|
|
3213
3213
|
};
|
|
3214
|
-
function
|
|
3214
|
+
function rr(e, t, n) {
|
|
3215
3215
|
let r = n(t, e);
|
|
3216
3216
|
if (typeof r == "symbol") return r;
|
|
3217
3217
|
for (let i of ["key", "value"]) {
|
|
3218
3218
|
let a = t[i];
|
|
3219
3219
|
if (a && "items" in a) {
|
|
3220
3220
|
for (let t = 0; t < a.items.length; ++t) {
|
|
3221
|
-
let r =
|
|
3221
|
+
let r = rr(Object.freeze(e.concat([[i, t]])), a.items[t], n);
|
|
3222
3222
|
if (typeof r == "number") t = r - 1;
|
|
3223
|
-
else if (r ===
|
|
3224
|
-
else r ===
|
|
3223
|
+
else if (r === $n) return $n;
|
|
3224
|
+
else r === tr && (a.items.splice(t, 1), --t);
|
|
3225
3225
|
}
|
|
3226
3226
|
typeof r == "function" && i === "key" && (r = r(t, e));
|
|
3227
3227
|
}
|
|
@@ -3230,23 +3230,23 @@ function ir(e, t, n) {
|
|
|
3230
3230
|
}
|
|
3231
3231
|
//#endregion
|
|
3232
3232
|
//#region node_modules/yaml/browser/dist/parse/cst.js
|
|
3233
|
-
var
|
|
3233
|
+
var ir = /* @__PURE__ */ a({
|
|
3234
3234
|
BOM: () => "",
|
|
3235
3235
|
DOCUMENT: () => "",
|
|
3236
3236
|
FLOW_END: () => "",
|
|
3237
3237
|
SCALAR: () => "",
|
|
3238
|
-
createScalarToken: () =>
|
|
3239
|
-
isCollection: () =>
|
|
3240
|
-
isScalar: () =>
|
|
3241
|
-
prettyToken: () =>
|
|
3242
|
-
resolveAsScalar: () =>
|
|
3243
|
-
setScalarValue: () =>
|
|
3244
|
-
stringify: () =>
|
|
3245
|
-
tokenType: () =>
|
|
3246
|
-
visit: () =>
|
|
3247
|
-
}),
|
|
3238
|
+
createScalarToken: () => Gn,
|
|
3239
|
+
isCollection: () => ar,
|
|
3240
|
+
isScalar: () => or,
|
|
3241
|
+
prettyToken: () => sr,
|
|
3242
|
+
resolveAsScalar: () => Wn,
|
|
3243
|
+
setScalarValue: () => Kn,
|
|
3244
|
+
stringify: () => Xn,
|
|
3245
|
+
tokenType: () => cr,
|
|
3246
|
+
visit: () => nr
|
|
3247
|
+
}), ar = (e) => !!e && "items" in e, or = (e) => !!e && (e.type === "scalar" || e.type === "single-quoted-scalar" || e.type === "double-quoted-scalar" || e.type === "block-scalar");
|
|
3248
3248
|
/* istanbul ignore next */
|
|
3249
|
-
function
|
|
3249
|
+
function sr(e) {
|
|
3250
3250
|
switch (e) {
|
|
3251
3251
|
case "": return "<BOM>";
|
|
3252
3252
|
case "": return "<DOC>";
|
|
@@ -3255,7 +3255,7 @@ function cr(e) {
|
|
|
3255
3255
|
default: return JSON.stringify(e);
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function cr(e) {
|
|
3259
3259
|
switch (e) {
|
|
3260
3260
|
case "": return "byte-order-mark";
|
|
3261
3261
|
case "": return "doc-mode";
|
|
@@ -3292,7 +3292,7 @@ function lr(e) {
|
|
|
3292
3292
|
}
|
|
3293
3293
|
//#endregion
|
|
3294
3294
|
//#region node_modules/yaml/browser/dist/parse/lexer.js
|
|
3295
|
-
function
|
|
3295
|
+
function W(e) {
|
|
3296
3296
|
switch (e) {
|
|
3297
3297
|
case void 0:
|
|
3298
3298
|
case " ":
|
|
@@ -3302,7 +3302,7 @@ function U(e) {
|
|
|
3302
3302
|
default: return !1;
|
|
3303
3303
|
}
|
|
3304
3304
|
}
|
|
3305
|
-
var
|
|
3305
|
+
var lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), dr = /* @__PURE__ */ new Set(",[]{}"), fr = /* @__PURE__ */ new Set(" ,[]{}\n\r "), pr = (e) => !e || fr.has(e), mr = class {
|
|
3306
3306
|
constructor() {
|
|
3307
3307
|
this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
|
|
3308
3308
|
}
|
|
@@ -3336,7 +3336,7 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3336
3336
|
}
|
|
3337
3337
|
if (t === "-" || t === ".") {
|
|
3338
3338
|
let t = this.buffer.substr(e, 3);
|
|
3339
|
-
if ((t === "---" || t === "...") &&
|
|
3339
|
+
if ((t === "---" || t === "...") && W(this.buffer[e + 3])) return -1;
|
|
3340
3340
|
}
|
|
3341
3341
|
return e;
|
|
3342
3342
|
}
|
|
@@ -3398,14 +3398,14 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3398
3398
|
if (e === "-" || e === ".") {
|
|
3399
3399
|
if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start");
|
|
3400
3400
|
let e = this.peek(3);
|
|
3401
|
-
if ((e === "---" || e === "...") &&
|
|
3401
|
+
if ((e === "---" || e === "...") && W(this.charAt(3))) return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, e === "---" ? "doc" : "stream";
|
|
3402
3402
|
}
|
|
3403
|
-
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !
|
|
3403
|
+
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !W(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
|
|
3404
3404
|
}
|
|
3405
3405
|
*parseBlockStart() {
|
|
3406
3406
|
let [e, t] = this.peek(2);
|
|
3407
3407
|
if (!t && !this.atEnd) return this.setNext("block-start");
|
|
3408
|
-
if ((e === "-" || e === "?" || e === ":") &&
|
|
3408
|
+
if ((e === "-" || e === "?" || e === ":") && W(t)) {
|
|
3409
3409
|
let e = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
|
|
3410
3410
|
return this.indentNext = this.indentValue + 1, this.indentValue += e, "block-start";
|
|
3411
3411
|
}
|
|
@@ -3423,7 +3423,7 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3423
3423
|
case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel = 1, "flow";
|
|
3424
3424
|
case "}":
|
|
3425
3425
|
case "]": return yield* this.pushCount(1), "doc";
|
|
3426
|
-
case "*": return yield* this.pushUntil(
|
|
3426
|
+
case "*": return yield* this.pushUntil(pr), "doc";
|
|
3427
3427
|
case "\"":
|
|
3428
3428
|
case "'": return yield* this.parseQuotedScalar();
|
|
3429
3429
|
case "|":
|
|
@@ -3438,7 +3438,7 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3438
3438
|
while (e + t > 0);
|
|
3439
3439
|
let r = this.getLine();
|
|
3440
3440
|
if (r === null) return this.setNext("flow");
|
|
3441
|
-
if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) &&
|
|
3441
|
+
if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) && W(r[3])) && (n !== this.indentNext - 1 || this.flowLevel !== 1 || r[0] !== "]" && r[0] !== "}")) return this.flowLevel = 0, yield "", yield* this.parseLineStart();
|
|
3442
3442
|
let i = 0;
|
|
3443
3443
|
for (; r[i] === ",";) i += yield* this.pushCount(1), i += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
3444
3444
|
switch (i += yield* this.pushIndicators(), r[i]) {
|
|
@@ -3448,12 +3448,12 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3448
3448
|
case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel += 1, "flow";
|
|
3449
3449
|
case "}":
|
|
3450
3450
|
case "]": return yield* this.pushCount(1), this.flowKey = !0, --this.flowLevel, this.flowLevel ? "flow" : "doc";
|
|
3451
|
-
case "*": return yield* this.pushUntil(
|
|
3451
|
+
case "*": return yield* this.pushUntil(pr), "flow";
|
|
3452
3452
|
case "\"":
|
|
3453
3453
|
case "'": return this.flowKey = !0, yield* this.parseQuotedScalar();
|
|
3454
3454
|
case ":": {
|
|
3455
3455
|
let e = this.charAt(1);
|
|
3456
|
-
if (this.flowKey ||
|
|
3456
|
+
if (this.flowKey || W(e) || e === ",") return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
|
|
3457
3457
|
}
|
|
3458
3458
|
default: return this.flowKey = !1, yield* this.parsePlainScalar();
|
|
3459
3459
|
}
|
|
@@ -3491,7 +3491,7 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3491
3491
|
else if (t > "0" && t <= "9") this.blockScalarIndent = Number(t) - 1;
|
|
3492
3492
|
else if (t !== "-") break;
|
|
3493
3493
|
}
|
|
3494
|
-
return yield* this.pushUntil((e) =>
|
|
3494
|
+
return yield* this.pushUntil((e) => W(e) || e === "#");
|
|
3495
3495
|
}
|
|
3496
3496
|
*parseBlockScalar() {
|
|
3497
3497
|
let e = this.pos - 1, t = 0, n;
|
|
@@ -3541,18 +3541,18 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3541
3541
|
let e = this.flowLevel > 0, t = this.pos - 1, n = this.pos - 1, r;
|
|
3542
3542
|
for (; r = this.buffer[++n];) if (r === ":") {
|
|
3543
3543
|
let r = this.buffer[n + 1];
|
|
3544
|
-
if (
|
|
3544
|
+
if (W(r) || e && dr.has(r)) break;
|
|
3545
3545
|
t = n;
|
|
3546
|
-
} else if (
|
|
3546
|
+
} else if (W(r)) {
|
|
3547
3547
|
let i = this.buffer[n + 1];
|
|
3548
|
-
if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e &&
|
|
3548
|
+
if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e && dr.has(i)) break;
|
|
3549
3549
|
if (r === "\n") {
|
|
3550
3550
|
let e = this.continueScalar(n + 1);
|
|
3551
3551
|
if (e === -1) break;
|
|
3552
3552
|
n = Math.max(n, e - 2);
|
|
3553
3553
|
}
|
|
3554
3554
|
} else {
|
|
3555
|
-
if (e &&
|
|
3555
|
+
if (e && dr.has(r)) break;
|
|
3556
3556
|
t = n;
|
|
3557
3557
|
}
|
|
3558
3558
|
return !r && !this.atEnd ? this.setNext("plain-scalar") : (yield "", yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
|
|
@@ -3572,13 +3572,13 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3572
3572
|
e += yield* this.pushTag(), e += yield* this.pushSpaces(!0);
|
|
3573
3573
|
continue loop;
|
|
3574
3574
|
case "&":
|
|
3575
|
-
e += yield* this.pushUntil(
|
|
3575
|
+
e += yield* this.pushUntil(pr), e += yield* this.pushSpaces(!0);
|
|
3576
3576
|
continue loop;
|
|
3577
3577
|
case "-":
|
|
3578
3578
|
case "?":
|
|
3579
3579
|
case ":": {
|
|
3580
3580
|
let t = this.flowLevel > 0, n = this.charAt(1);
|
|
3581
|
-
if (
|
|
3581
|
+
if (W(n) || t && dr.has(n)) {
|
|
3582
3582
|
t ? this.flowKey &&= !1 : this.indentNext = this.indentValue + 1, e += yield* this.pushCount(1), e += yield* this.pushSpaces(!0);
|
|
3583
3583
|
continue loop;
|
|
3584
3584
|
}
|
|
@@ -3591,13 +3591,13 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3591
3591
|
*pushTag() {
|
|
3592
3592
|
if (this.charAt(1) === "<") {
|
|
3593
3593
|
let e = this.pos + 2, t = this.buffer[e];
|
|
3594
|
-
for (; !
|
|
3594
|
+
for (; !W(t) && t !== ">";) t = this.buffer[++e];
|
|
3595
3595
|
return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
|
|
3596
3596
|
}
|
|
3597
3597
|
{
|
|
3598
3598
|
let e = this.pos + 1, t = this.buffer[e];
|
|
3599
|
-
for (; t;) if (
|
|
3600
|
-
else if (t === "%" &&
|
|
3599
|
+
for (; t;) if (ur.has(t)) t = this.buffer[++e];
|
|
3600
|
+
else if (t === "%" && lr.has(this.buffer[e + 1]) && lr.has(this.buffer[e + 2])) t = this.buffer[e += 3];
|
|
3601
3601
|
else break;
|
|
3602
3602
|
return yield* this.pushToIndex(e, !1);
|
|
3603
3603
|
}
|
|
@@ -3619,7 +3619,7 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3619
3619
|
for (; !e(n);) n = this.buffer[++t];
|
|
3620
3620
|
return yield* this.pushToIndex(t, !1);
|
|
3621
3621
|
}
|
|
3622
|
-
},
|
|
3622
|
+
}, hr = class {
|
|
3623
3623
|
constructor() {
|
|
3624
3624
|
this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
|
|
3625
3625
|
let t = 0, n = this.lineStarts.length;
|
|
@@ -3645,11 +3645,11 @@ var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */
|
|
|
3645
3645
|
};
|
|
3646
3646
|
//#endregion
|
|
3647
3647
|
//#region node_modules/yaml/browser/dist/parse/parser.js
|
|
3648
|
-
function
|
|
3648
|
+
function G(e, t) {
|
|
3649
3649
|
for (let n = 0; n < e.length; ++n) if (e[n].type === t) return !0;
|
|
3650
3650
|
return !1;
|
|
3651
3651
|
}
|
|
3652
|
-
function
|
|
3652
|
+
function gr(e) {
|
|
3653
3653
|
for (let t = 0; t < e.length; ++t) switch (e[t].type) {
|
|
3654
3654
|
case "space":
|
|
3655
3655
|
case "comment":
|
|
@@ -3658,7 +3658,7 @@ function _r(e) {
|
|
|
3658
3658
|
}
|
|
3659
3659
|
return -1;
|
|
3660
3660
|
}
|
|
3661
|
-
function
|
|
3661
|
+
function _r(e) {
|
|
3662
3662
|
switch (e?.type) {
|
|
3663
3663
|
case "alias":
|
|
3664
3664
|
case "scalar":
|
|
@@ -3668,7 +3668,7 @@ function vr(e) {
|
|
|
3668
3668
|
default: return !1;
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
|
-
function
|
|
3671
|
+
function vr(e) {
|
|
3672
3672
|
switch (e.type) {
|
|
3673
3673
|
case "document": return e.start;
|
|
3674
3674
|
case "block-map": {
|
|
@@ -3680,7 +3680,7 @@ function yr(e) {
|
|
|
3680
3680
|
default: return [];
|
|
3681
3681
|
}
|
|
3682
3682
|
}
|
|
3683
|
-
function
|
|
3683
|
+
function yr(e) {
|
|
3684
3684
|
if (e.length === 0) return [];
|
|
3685
3685
|
let t = e.length;
|
|
3686
3686
|
loop: for (; --t >= 0;) switch (e[t].type) {
|
|
@@ -3693,16 +3693,16 @@ function br(e) {
|
|
|
3693
3693
|
for (; e[++t]?.type === "space";);
|
|
3694
3694
|
return e.splice(t, e.length);
|
|
3695
3695
|
}
|
|
3696
|
-
function
|
|
3696
|
+
function br(e, t) {
|
|
3697
3697
|
if (t.length < 1e5) Array.prototype.push.apply(e, t);
|
|
3698
3698
|
else for (let n = 0; n < t.length; ++n) e.push(t[n]);
|
|
3699
3699
|
}
|
|
3700
|
-
function
|
|
3701
|
-
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !
|
|
3700
|
+
function xr(e) {
|
|
3701
|
+
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !G(t.start, "explicit-key-ind") && !G(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, _r(t.value) ? t.value.end ? br(t.value.end, t.sep) : t.value.end = t.sep : br(t.start, t.sep), delete t.sep);
|
|
3702
3702
|
}
|
|
3703
|
-
var
|
|
3703
|
+
var Sr = class {
|
|
3704
3704
|
constructor(e) {
|
|
3705
|
-
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new
|
|
3705
|
+
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new mr(), this.onNewLine = e;
|
|
3706
3706
|
}
|
|
3707
3707
|
*parse(e, t = !1) {
|
|
3708
3708
|
this.onNewLine && this.offset === 0 && this.onNewLine(0);
|
|
@@ -3714,7 +3714,7 @@ var Cr = class {
|
|
|
3714
3714
|
this.atScalar = !1, yield* this.step(), this.offset += e.length;
|
|
3715
3715
|
return;
|
|
3716
3716
|
}
|
|
3717
|
-
let t =
|
|
3717
|
+
let t = cr(e);
|
|
3718
3718
|
if (!t) {
|
|
3719
3719
|
let t = `Not a YAML token: ${e}`;
|
|
3720
3720
|
yield* this.pop({
|
|
@@ -3797,7 +3797,7 @@ var Cr = class {
|
|
|
3797
3797
|
else if (this.stack.length === 0) yield t;
|
|
3798
3798
|
else {
|
|
3799
3799
|
let e = this.peek(1);
|
|
3800
|
-
switch (t.type === "block-scalar" ? t.indent = "indent" in e ? e.indent : 0 : t.type === "flow-collection" && e.type === "document" && (t.indent = 0), t.type === "flow-collection" &&
|
|
3800
|
+
switch (t.type === "block-scalar" ? t.indent = "indent" in e ? e.indent : 0 : t.type === "flow-collection" && e.type === "document" && (t.indent = 0), t.type === "flow-collection" && xr(t), e.type) {
|
|
3801
3801
|
case "document":
|
|
3802
3802
|
e.value = t;
|
|
3803
3803
|
break;
|
|
@@ -3849,7 +3849,7 @@ var Cr = class {
|
|
|
3849
3849
|
}
|
|
3850
3850
|
if ((e.type === "document" || e.type === "block-map" || e.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
3851
3851
|
let n = t.items[t.items.length - 1];
|
|
3852
|
-
n && !n.sep && !n.value && n.start.length > 0 &&
|
|
3852
|
+
n && !n.sep && !n.value && n.start.length > 0 && gr(n.start) === -1 && (t.indent === 0 || n.start.every((e) => e.type !== "comment" || e.indent < t.indent)) && (e.type === "document" ? e.end = n.start : e.items.push({ start: n.start }), t.items.splice(-1, 1));
|
|
3853
3853
|
}
|
|
3854
3854
|
}
|
|
3855
3855
|
}
|
|
@@ -3890,7 +3890,7 @@ var Cr = class {
|
|
|
3890
3890
|
if (e.value) return yield* this.lineEnd(e);
|
|
3891
3891
|
switch (this.type) {
|
|
3892
3892
|
case "doc-start":
|
|
3893
|
-
|
|
3893
|
+
gr(e.start) === -1 ? e.start.push(this.sourceToken) : (yield* this.pop(), yield* this.step());
|
|
3894
3894
|
return;
|
|
3895
3895
|
case "anchor":
|
|
3896
3896
|
case "tag":
|
|
@@ -3910,7 +3910,7 @@ var Cr = class {
|
|
|
3910
3910
|
}
|
|
3911
3911
|
*scalar(e) {
|
|
3912
3912
|
if (this.type === "map-value-ind") {
|
|
3913
|
-
let t =
|
|
3913
|
+
let t = yr(vr(this.peek(2))), n;
|
|
3914
3914
|
e.end ? (n = e.end, n.push(this.sourceToken), delete e.end) : n = [this.sourceToken];
|
|
3915
3915
|
let r = {
|
|
3916
3916
|
type: "block-map",
|
|
@@ -3960,7 +3960,7 @@ var Cr = class {
|
|
|
3960
3960
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
3961
3961
|
let n = e.items[e.items.length - 2]?.value?.end;
|
|
3962
3962
|
if (Array.isArray(n)) {
|
|
3963
|
-
|
|
3963
|
+
br(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
3964
3964
|
return;
|
|
3965
3965
|
}
|
|
3966
3966
|
}
|
|
@@ -4009,12 +4009,12 @@ var Cr = class {
|
|
|
4009
4009
|
case "map-value-ind":
|
|
4010
4010
|
if (t.explicitKey) {
|
|
4011
4011
|
if (!t.sep) {
|
|
4012
|
-
if (
|
|
4012
|
+
if (G(t.start, "newline")) Object.assign(t, {
|
|
4013
4013
|
key: null,
|
|
4014
4014
|
sep: [this.sourceToken]
|
|
4015
4015
|
});
|
|
4016
4016
|
else {
|
|
4017
|
-
let e =
|
|
4017
|
+
let e = yr(t.start);
|
|
4018
4018
|
this.stack.push({
|
|
4019
4019
|
type: "block-map",
|
|
4020
4020
|
offset: this.offset,
|
|
@@ -4031,7 +4031,7 @@ var Cr = class {
|
|
|
4031
4031
|
key: null,
|
|
4032
4032
|
sep: [this.sourceToken]
|
|
4033
4033
|
});
|
|
4034
|
-
else if (
|
|
4034
|
+
else if (G(t.sep, "map-value-ind")) this.stack.push({
|
|
4035
4035
|
type: "block-map",
|
|
4036
4036
|
offset: this.offset,
|
|
4037
4037
|
indent: this.indent,
|
|
@@ -4041,8 +4041,8 @@ var Cr = class {
|
|
|
4041
4041
|
sep: [this.sourceToken]
|
|
4042
4042
|
}]
|
|
4043
4043
|
});
|
|
4044
|
-
else if (
|
|
4045
|
-
let e =
|
|
4044
|
+
else if (_r(t.key) && !G(t.sep, "newline")) {
|
|
4045
|
+
let e = yr(t.start), n = t.key, r = t.sep;
|
|
4046
4046
|
r.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4047
4047
|
type: "block-map",
|
|
4048
4048
|
offset: this.offset,
|
|
@@ -4058,7 +4058,7 @@ var Cr = class {
|
|
|
4058
4058
|
start: i,
|
|
4059
4059
|
key: null,
|
|
4060
4060
|
sep: [this.sourceToken]
|
|
4061
|
-
}) :
|
|
4061
|
+
}) : G(t.sep, "map-value-ind") ? this.stack.push({
|
|
4062
4062
|
type: "block-map",
|
|
4063
4063
|
offset: this.offset,
|
|
4064
4064
|
indent: this.indent,
|
|
@@ -4092,7 +4092,7 @@ var Cr = class {
|
|
|
4092
4092
|
let r = this.startBlockValue(e);
|
|
4093
4093
|
if (r) {
|
|
4094
4094
|
if (r.type === "block-seq") {
|
|
4095
|
-
if (!t.explicitKey && t.sep && !
|
|
4095
|
+
if (!t.explicitKey && t.sep && !G(t.sep, "newline")) {
|
|
4096
4096
|
yield* this.pop({
|
|
4097
4097
|
type: "error",
|
|
4098
4098
|
offset: this.offset,
|
|
@@ -4126,7 +4126,7 @@ var Cr = class {
|
|
|
4126
4126
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
4127
4127
|
let n = e.items[e.items.length - 2]?.value?.end;
|
|
4128
4128
|
if (Array.isArray(n)) {
|
|
4129
|
-
|
|
4129
|
+
br(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
4130
4130
|
return;
|
|
4131
4131
|
}
|
|
4132
4132
|
}
|
|
@@ -4140,7 +4140,7 @@ var Cr = class {
|
|
|
4140
4140
|
return;
|
|
4141
4141
|
case "seq-item-ind":
|
|
4142
4142
|
if (this.indent !== e.indent) break;
|
|
4143
|
-
t.value ||
|
|
4143
|
+
t.value || G(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
|
|
4144
4144
|
return;
|
|
4145
4145
|
}
|
|
4146
4146
|
if (this.indent > e.indent) {
|
|
@@ -4209,8 +4209,8 @@ var Cr = class {
|
|
|
4209
4209
|
let t = this.peek(2);
|
|
4210
4210
|
if (t.type === "block-map" && (this.type === "map-value-ind" && t.indent === e.indent || this.type === "newline" && !t.items[t.items.length - 1].sep)) yield* this.pop(), yield* this.step();
|
|
4211
4211
|
else if (this.type === "map-value-ind" && t.type !== "flow-collection") {
|
|
4212
|
-
let n =
|
|
4213
|
-
|
|
4212
|
+
let n = yr(vr(t));
|
|
4213
|
+
xr(e);
|
|
4214
4214
|
let r = e.end.splice(1, e.end.length);
|
|
4215
4215
|
r.push(this.sourceToken);
|
|
4216
4216
|
let i = {
|
|
@@ -4269,7 +4269,7 @@ var Cr = class {
|
|
|
4269
4269
|
};
|
|
4270
4270
|
case "explicit-key-ind": {
|
|
4271
4271
|
this.onKeyLine = !0;
|
|
4272
|
-
let t =
|
|
4272
|
+
let t = yr(vr(e));
|
|
4273
4273
|
return t.push(this.sourceToken), {
|
|
4274
4274
|
type: "block-map",
|
|
4275
4275
|
offset: this.offset,
|
|
@@ -4282,7 +4282,7 @@ var Cr = class {
|
|
|
4282
4282
|
}
|
|
4283
4283
|
case "map-value-ind": {
|
|
4284
4284
|
this.onKeyLine = !0;
|
|
4285
|
-
let t =
|
|
4285
|
+
let t = yr(vr(e));
|
|
4286
4286
|
return {
|
|
4287
4287
|
type: "block-map",
|
|
4288
4288
|
offset: this.offset,
|
|
@@ -4320,31 +4320,31 @@ var Cr = class {
|
|
|
4320
4320
|
};
|
|
4321
4321
|
//#endregion
|
|
4322
4322
|
//#region node_modules/yaml/browser/dist/public-api.js
|
|
4323
|
-
function
|
|
4323
|
+
function Cr(e) {
|
|
4324
4324
|
let t = e.prettyErrors !== !1;
|
|
4325
4325
|
return {
|
|
4326
|
-
lineCounter: e.lineCounter || t && new
|
|
4326
|
+
lineCounter: e.lineCounter || t && new hr() || null,
|
|
4327
4327
|
prettyErrors: t
|
|
4328
4328
|
};
|
|
4329
4329
|
}
|
|
4330
|
-
function
|
|
4331
|
-
let { lineCounter: n, prettyErrors: r } =
|
|
4332
|
-
if (r && n) for (let t of o) t.errors.forEach(
|
|
4330
|
+
function wr(e, t = {}) {
|
|
4331
|
+
let { lineCounter: n, prettyErrors: r } = Cr(t), i = new Sr(n?.addNewLine), a = new Un(t), o = Array.from(a.compose(i.parse(e)));
|
|
4332
|
+
if (r && n) for (let t of o) t.errors.forEach(sn(e, n)), t.warnings.forEach(sn(e, n));
|
|
4333
4333
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, a.streamInfo());
|
|
4334
4334
|
}
|
|
4335
|
-
function
|
|
4336
|
-
let { lineCounter: n, prettyErrors: r } =
|
|
4335
|
+
function Tr(e, t = {}) {
|
|
4336
|
+
let { lineCounter: n, prettyErrors: r } = Cr(t), i = new Sr(n?.addNewLine), a = new Un(t), o = null;
|
|
4337
4337
|
for (let t of a.compose(i.parse(e), !0, e.length)) if (!o) o = t;
|
|
4338
4338
|
else if (o.options.logLevel !== "silent") {
|
|
4339
|
-
o.errors.push(new
|
|
4339
|
+
o.errors.push(new an(t.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
4340
4340
|
break;
|
|
4341
4341
|
}
|
|
4342
|
-
return r && n && (o.errors.forEach(
|
|
4342
|
+
return r && n && (o.errors.forEach(sn(e, n)), o.warnings.forEach(sn(e, n))), o;
|
|
4343
4343
|
}
|
|
4344
|
-
function
|
|
4344
|
+
function Er(e, t, n) {
|
|
4345
4345
|
let r;
|
|
4346
4346
|
typeof t == "function" ? r = t : n === void 0 && t && typeof t == "object" && (n = t);
|
|
4347
|
-
let i =
|
|
4347
|
+
let i = Tr(e, n);
|
|
4348
4348
|
if (!i) return null;
|
|
4349
4349
|
if (i.warnings.forEach((e) => Ve(i.options.logLevel, e)), i.errors.length > 0) {
|
|
4350
4350
|
if (i.options.logLevel !== "silent") throw i.errors[0];
|
|
@@ -4352,7 +4352,7 @@ function Dr(e, t, n) {
|
|
|
4352
4352
|
}
|
|
4353
4353
|
return i.toJS(Object.assign({ reviver: r }, n));
|
|
4354
4354
|
}
|
|
4355
|
-
function
|
|
4355
|
+
function Dr(e, t, n) {
|
|
4356
4356
|
let r = null;
|
|
4357
4357
|
if (typeof t == "function" || Array.isArray(t) ? r = t : n === void 0 && t && (n = t), typeof n == "string" && (n = n.length), typeof n == "number") {
|
|
4358
4358
|
let e = Math.round(n);
|
|
@@ -4362,26 +4362,26 @@ function Or(e, t, n) {
|
|
|
4362
4362
|
let { keepUndefined: e } = n ?? t ?? {};
|
|
4363
4363
|
if (!e) return;
|
|
4364
4364
|
}
|
|
4365
|
-
return y(e) && !r ? e.toString(n) : new
|
|
4365
|
+
return y(e) && !r ? e.toString(n) : new tn(e, r, n).toString(n);
|
|
4366
4366
|
}
|
|
4367
4367
|
//#endregion
|
|
4368
4368
|
//#region node_modules/yaml/browser/index.js
|
|
4369
|
-
var
|
|
4369
|
+
var Or = /* @__PURE__ */ a({
|
|
4370
4370
|
Alias: () => fe,
|
|
4371
|
-
CST: () =>
|
|
4372
|
-
Composer: () =>
|
|
4373
|
-
Document: () =>
|
|
4374
|
-
Lexer: () =>
|
|
4375
|
-
LineCounter: () =>
|
|
4371
|
+
CST: () => ir,
|
|
4372
|
+
Composer: () => Un,
|
|
4373
|
+
Document: () => tn,
|
|
4374
|
+
Lexer: () => mr,
|
|
4375
|
+
LineCounter: () => hr,
|
|
4376
4376
|
Pair: () => B,
|
|
4377
|
-
Parser: () =>
|
|
4377
|
+
Parser: () => Sr,
|
|
4378
4378
|
Scalar: () => F,
|
|
4379
|
-
Schema: () =>
|
|
4380
|
-
YAMLError: () =>
|
|
4379
|
+
Schema: () => $t,
|
|
4380
|
+
YAMLError: () => rn,
|
|
4381
4381
|
YAMLMap: () => V,
|
|
4382
|
-
YAMLParseError: () =>
|
|
4383
|
-
YAMLSeq: () =>
|
|
4384
|
-
YAMLWarning: () =>
|
|
4382
|
+
YAMLParseError: () => an,
|
|
4383
|
+
YAMLSeq: () => H,
|
|
4384
|
+
YAMLWarning: () => on,
|
|
4385
4385
|
isAlias: () => v,
|
|
4386
4386
|
isCollection: () => w,
|
|
4387
4387
|
isDocument: () => y,
|
|
@@ -4390,13 +4390,13 @@ var kr = /* @__PURE__ */ a({
|
|
|
4390
4390
|
isPair: () => x,
|
|
4391
4391
|
isScalar: () => S,
|
|
4392
4392
|
isSeq: () => C,
|
|
4393
|
-
parse: () =>
|
|
4394
|
-
parseAllDocuments: () =>
|
|
4395
|
-
parseDocument: () =>
|
|
4396
|
-
stringify: () =>
|
|
4393
|
+
parse: () => Er,
|
|
4394
|
+
parseAllDocuments: () => wr,
|
|
4395
|
+
parseDocument: () => Tr,
|
|
4396
|
+
stringify: () => Dr,
|
|
4397
4397
|
visit: () => k,
|
|
4398
4398
|
visitAsync: () => te
|
|
4399
|
-
}),
|
|
4399
|
+
}), kr = {
|
|
4400
4400
|
rawNodes: {
|
|
4401
4401
|
address: {
|
|
4402
4402
|
id: "address",
|
|
@@ -5981,7 +5981,7 @@ var kr = /* @__PURE__ */ a({
|
|
|
5981
5981
|
};
|
|
5982
5982
|
//#endregion
|
|
5983
5983
|
//#region server/db/dynamic-sync.ts
|
|
5984
|
-
async function
|
|
5984
|
+
async function Ar(e, t) {
|
|
5985
5985
|
try {
|
|
5986
5986
|
let n = await e.prepare(`PRAGMA table_info("${t}")`).all(), r = Array.isArray(n) ? n : n?.results || [];
|
|
5987
5987
|
return new Set(r.map((e) => e.name));
|
|
@@ -5989,7 +5989,7 @@ async function jr(e, t) {
|
|
|
5989
5989
|
return /* @__PURE__ */ new Set();
|
|
5990
5990
|
}
|
|
5991
5991
|
}
|
|
5992
|
-
var
|
|
5992
|
+
var jr = {
|
|
5993
5993
|
content_schemas: "\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n type TEXT UNIQUE NOT NULL,\n schemaJson TEXT NOT NULL,\n isSystem INTEGER DEFAULT 1,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n updatedAt TEXT DEFAULT CURRENT_TIMESTAMP\n ",
|
|
5994
5994
|
users: "\n id TEXT PRIMARY KEY,\n email TEXT UNIQUE NOT NULL,\n name TEXT NOT NULL,\n globalRole TEXT DEFAULT 'editor',\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n updatedAt TEXT DEFAULT CURRENT_TIMESTAMP\n ",
|
|
5995
5995
|
user_accounts: "\n id TEXT PRIMARY KEY,\n userId TEXT NOT NULL,\n provider TEXT NOT NULL,\n providerAccountId TEXT NOT NULL,\n passwordHash TEXT NOT NULL,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (userId) REFERENCES users(id) ON DELETE CASCADE,\n UNIQUE(provider, providerAccountId)\n ",
|
|
@@ -6004,7 +6004,7 @@ var Mr = {
|
|
|
6004
6004
|
node_revisions: "\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n nodeId INTEGER NOT NULL,\n version INTEGER NOT NULL DEFAULT 1,\n snapshotJson TEXT NOT NULL,\n createdById TEXT,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (nodeId) REFERENCES content_nodes(id) ON DELETE CASCADE,\n FOREIGN KEY (createdById) REFERENCES users(id) ON DELETE SET NULL\n ",
|
|
6005
6005
|
assets: "\n id TEXT PRIMARY KEY,\n filename TEXT NOT NULL,\n mimeType TEXT NOT NULL,\n sizeBytes INTEGER NOT NULL,\n storageKeyPrivate TEXT,\n cdnUrl TEXT,\n parentAssetId TEXT,\n cropCoordinatesJson TEXT,\n isSystemVariant INTEGER DEFAULT 0,\n dataJson TEXT DEFAULT '{}',\n createdById TEXT,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n updatedAt TEXT DEFAULT CURRENT_TIMESTAMP,\n deletedAt TEXT,\n FOREIGN KEY (parentAssetId) REFERENCES assets(id) ON DELETE SET NULL,\n FOREIGN KEY (createdById) REFERENCES users(id) ON DELETE SET NULL\n ",
|
|
6006
6006
|
node_assets: "\n nodeId INTEGER NOT NULL,\n assetId TEXT NOT NULL,\n fieldKey TEXT NOT NULL,\n sortOrder INTEGER DEFAULT 0,\n PRIMARY KEY (nodeId, assetId, fieldKey),\n FOREIGN KEY (nodeId) REFERENCES content_nodes(id) ON DELETE CASCADE,\n FOREIGN KEY (assetId) REFERENCES assets(id) ON DELETE CASCADE\n "
|
|
6007
|
-
},
|
|
6007
|
+
}, Mr = [
|
|
6008
6008
|
"CREATE INDEX IF NOT EXISTS idx_content_schemas_type ON content_schemas(type);",
|
|
6009
6009
|
"CREATE INDEX IF NOT EXISTS idx_sessions_user ON sessions(userId);",
|
|
6010
6010
|
"CREATE INDEX IF NOT EXISTS idx_sessions_expires ON sessions(expiresAt);",
|
|
@@ -6027,13 +6027,13 @@ var Mr = {
|
|
|
6027
6027
|
"CREATE INDEX IF NOT EXISTS idx_assets_deleted ON assets(deletedAt);",
|
|
6028
6028
|
"CREATE INDEX IF NOT EXISTS idx_assets_parent ON assets(parentAssetId);"
|
|
6029
6029
|
];
|
|
6030
|
-
async function
|
|
6030
|
+
async function Nr(e, t) {
|
|
6031
6031
|
try {
|
|
6032
6032
|
await e.prepare("PRAGMA foreign_keys = ON;").run();
|
|
6033
6033
|
} catch {}
|
|
6034
|
-
for (let [t, n] of Object.entries(
|
|
6035
|
-
for (let [t] of Object.entries(
|
|
6036
|
-
let n = await
|
|
6034
|
+
for (let [t, n] of Object.entries(jr)) await e.prepare(`CREATE TABLE IF NOT EXISTS "${t}" (${n});`).run();
|
|
6035
|
+
for (let [t] of Object.entries(jr)) {
|
|
6036
|
+
let n = await Ar(e, t);
|
|
6037
6037
|
if (n.size > 0) {
|
|
6038
6038
|
if (t === "content_nodes" && !n.has("disabledRegionsJson")) try {
|
|
6039
6039
|
await e.prepare("ALTER TABLE \"content_nodes\" ADD COLUMN disabledRegionsJson TEXT DEFAULT '{}';").run();
|
|
@@ -6048,12 +6048,12 @@ async function Pr(e, t) {
|
|
|
6048
6048
|
}
|
|
6049
6049
|
}
|
|
6050
6050
|
}
|
|
6051
|
-
for (let t of
|
|
6051
|
+
for (let t of Mr) try {
|
|
6052
6052
|
await e.prepare(t).run();
|
|
6053
6053
|
} catch {}
|
|
6054
|
-
await
|
|
6054
|
+
await Pr(e, t || kr), await Fr(e);
|
|
6055
6055
|
}
|
|
6056
|
-
async function
|
|
6056
|
+
async function Pr(e, t) {
|
|
6057
6057
|
if (!t) return;
|
|
6058
6058
|
let n = t.rawNodes || {}, r = Object.entries(n);
|
|
6059
6059
|
for (let [t, n] of r) {
|
|
@@ -6070,7 +6070,7 @@ async function Fr(e, t) {
|
|
|
6070
6070
|
}
|
|
6071
6071
|
}
|
|
6072
6072
|
}
|
|
6073
|
-
async function
|
|
6073
|
+
async function Fr(e) {
|
|
6074
6074
|
try {
|
|
6075
6075
|
let t = await e.prepare("SELECT COUNT(*) as count FROM channels").get(), n = 1;
|
|
6076
6076
|
if (!t || t.count === 0) {
|
|
@@ -6091,7 +6091,7 @@ async function Ir(e) {
|
|
|
6091
6091
|
}
|
|
6092
6092
|
//#endregion
|
|
6093
6093
|
//#region server/middleware/media-static.ts
|
|
6094
|
-
function
|
|
6094
|
+
function Ir() {
|
|
6095
6095
|
return async (e, t) => {
|
|
6096
6096
|
if (e.env?.MEDIA_BUCKET) {
|
|
6097
6097
|
let t = e.req.path.replace(/^\/media\//, ""), n = await e.env.MEDIA_BUCKET.get(t, { onlyIf: e.req.raw.headers });
|
|
@@ -6122,18 +6122,18 @@ function Lr() {
|
|
|
6122
6122
|
}
|
|
6123
6123
|
//#endregion
|
|
6124
6124
|
//#region node_modules/lru-cache/dist/esm/browser/index.min.js
|
|
6125
|
-
var
|
|
6126
|
-
typeof
|
|
6127
|
-
},
|
|
6125
|
+
var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, Br = () => K.hasSubscribers || Rr.hasSubscribers, Vr = /* @__PURE__ */ new Set(), Hr = typeof process == "object" && process ? process : {}, Ur = (e, t, n, r) => {
|
|
6126
|
+
typeof Hr.emitWarning == "function" ? Hr.emitWarning(e, t, n, r) : console.error(`[${n}] ${t}: ${e}`);
|
|
6127
|
+
}, Wr = (e) => !Vr.has(e), q = (e) => !!e && e === Math.floor(e) && e > 0 && isFinite(e), Gr = (e) => q(e) ? e <= 256 ? Uint8Array : e <= 2 ** 16 ? Uint16Array : e <= 2 ** 32 ? Uint32Array : e <= 2 ** 53 - 1 ? Kr : null : null, Kr = class extends Array {
|
|
6128
6128
|
constructor(e) {
|
|
6129
6129
|
super(e), this.fill(0);
|
|
6130
6130
|
}
|
|
6131
|
-
},
|
|
6131
|
+
}, qr = class e {
|
|
6132
6132
|
heap;
|
|
6133
6133
|
length;
|
|
6134
6134
|
static #e = !1;
|
|
6135
6135
|
static create(t) {
|
|
6136
|
-
let n =
|
|
6136
|
+
let n = Gr(t);
|
|
6137
6137
|
if (!n) return [];
|
|
6138
6138
|
e.#e = !0;
|
|
6139
6139
|
let r = new e(t, n);
|
|
@@ -6149,7 +6149,7 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6149
6149
|
pop() {
|
|
6150
6150
|
return this.heap[--this.length];
|
|
6151
6151
|
}
|
|
6152
|
-
},
|
|
6152
|
+
}, Jr = class e {
|
|
6153
6153
|
#e;
|
|
6154
6154
|
#t;
|
|
6155
6155
|
#n;
|
|
@@ -6252,8 +6252,8 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6252
6252
|
constructor(t) {
|
|
6253
6253
|
let { max: n = 0, ttl: r, ttlResolution: i = 1, ttlAutopurge: a, updateAgeOnGet: o, updateAgeOnHas: s, allowStale: c, dispose: l, onInsert: u, disposeAfter: d, noDisposeOnSet: f, noUpdateTTL: p, maxSize: m = 0, maxEntrySize: h = 0, sizeCalculation: g, fetchMethod: _, memoMethod: v, noDeleteOnFetchRejection: y, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: x, allowStaleOnFetchAbort: S, ignoreFetchAbort: C, backgroundFetchSize: w = 1, perf: T } = t;
|
|
6254
6254
|
if (this.backgroundFetchSize = w, T !== void 0 && typeof T?.now != "function") throw TypeError("perf option must have a now() method if specified");
|
|
6255
|
-
if (this.#s = T ??
|
|
6256
|
-
let E = n ?
|
|
6255
|
+
if (this.#s = T ?? zr, n !== 0 && !q(n)) throw TypeError("max option must be a nonnegative integer");
|
|
6256
|
+
let E = n ? Gr(n) : Array;
|
|
6257
6257
|
if (!E) throw Error("invalid max value: " + n);
|
|
6258
6258
|
if (this.#e = n, this.#t = m, this.maxEntrySize = h || this.#t, this.sizeCalculation = g, this.sizeCalculation) {
|
|
6259
6259
|
if (!this.#t && !this.maxEntrySize) throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
@@ -6261,26 +6261,26 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6261
6261
|
}
|
|
6262
6262
|
if (v !== void 0 && typeof v != "function") throw TypeError("memoMethod must be a function if defined");
|
|
6263
6263
|
if (this.#o = v, _ !== void 0 && typeof _ != "function") throw TypeError("fetchMethod must be a function if specified");
|
|
6264
|
-
if (this.#a = _, this.#w = !!_, this.#u = /* @__PURE__ */ new Map(), this.#d = Array.from({ length: n }).fill(void 0), this.#f = Array.from({ length: n }).fill(void 0), this.#p = new E(n), this.#m = new E(n), this.#h = 0, this.#g = 0, this.#_ =
|
|
6265
|
-
if (this.#t !== 0 && !
|
|
6266
|
-
if (!
|
|
6264
|
+
if (this.#a = _, this.#w = !!_, this.#u = /* @__PURE__ */ new Map(), this.#d = Array.from({ length: n }).fill(void 0), this.#f = Array.from({ length: n }).fill(void 0), this.#p = new E(n), this.#m = new E(n), this.#h = 0, this.#g = 0, this.#_ = qr.create(n), this.#c = 0, this.#l = 0, typeof l == "function" && (this.#n = l), typeof u == "function" && (this.#r = u), typeof d == "function" ? (this.#i = d, this.#v = []) : (this.#i = void 0, this.#v = void 0), this.#C = !!this.#n, this.#E = !!this.#r, this.#T = !!this.#i, this.noDisposeOnSet = !!f, this.noUpdateTTL = !!p, this.noDeleteOnFetchRejection = !!y, this.allowStaleOnFetchRejection = !!x, this.allowStaleOnFetchAbort = !!S, this.ignoreFetchAbort = !!C, this.maxEntrySize !== 0) {
|
|
6265
|
+
if (this.#t !== 0 && !q(this.#t)) throw TypeError("maxSize must be a positive integer if specified");
|
|
6266
|
+
if (!q(this.maxEntrySize)) throw TypeError("maxEntrySize must be a positive integer if specified");
|
|
6267
6267
|
this.#M();
|
|
6268
6268
|
}
|
|
6269
|
-
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!s, this.ttlResolution =
|
|
6270
|
-
if (!
|
|
6269
|
+
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!s, this.ttlResolution = q(i) || i === 0 ? i : 1, this.ttlAutopurge = !!a, this.ttl = r || 0, this.ttl) {
|
|
6270
|
+
if (!q(this.ttl)) throw TypeError("ttl must be a positive integer if specified");
|
|
6271
6271
|
this.#D();
|
|
6272
6272
|
}
|
|
6273
6273
|
if (this.#e === 0 && this.ttl === 0 && this.#t === 0) throw TypeError("At least one of max, maxSize, or ttl is required");
|
|
6274
6274
|
if (!this.ttlAutopurge && !this.#e && !this.#t) {
|
|
6275
6275
|
let t = "LRU_CACHE_UNBOUNDED";
|
|
6276
|
-
|
|
6276
|
+
Wr(t) && (Vr.add(t), Ur("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", t, e));
|
|
6277
6277
|
}
|
|
6278
6278
|
}
|
|
6279
6279
|
getRemainingTTL(e) {
|
|
6280
6280
|
return this.#u.has(e) ? 1 / 0 : 0;
|
|
6281
6281
|
}
|
|
6282
6282
|
#D() {
|
|
6283
|
-
let e = new
|
|
6283
|
+
let e = new Kr(this.#e), t = new Kr(this.#e);
|
|
6284
6284
|
this.#x = e, this.#b = t;
|
|
6285
6285
|
let n = this.ttlAutopurge ? Array.from({ length: this.#e }) : void 0;
|
|
6286
6286
|
this.#S = n, this.#A = (n, i, a = this.#s.now()) => {
|
|
@@ -6330,15 +6330,15 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6330
6330
|
#A = () => {};
|
|
6331
6331
|
#j = () => !1;
|
|
6332
6332
|
#M() {
|
|
6333
|
-
let e = new
|
|
6333
|
+
let e = new Kr(this.#e);
|
|
6334
6334
|
this.#l = 0, this.#y = e, this.#N = (t) => {
|
|
6335
6335
|
this.#l -= e[t], e[t] = 0;
|
|
6336
6336
|
}, this.#F = (e, t, n, r) => {
|
|
6337
|
-
if (!
|
|
6337
|
+
if (!q(n)) {
|
|
6338
6338
|
if (this.#W(t)) return this.backgroundFetchSize;
|
|
6339
6339
|
if (r) {
|
|
6340
6340
|
if (typeof r != "function") throw TypeError("sizeCalculation must be a function");
|
|
6341
|
-
if (n = r(t, e), !
|
|
6341
|
+
if (n = r(t, e), !q(n)) throw TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
6342
6342
|
} else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
6343
6343
|
}
|
|
6344
6344
|
return n;
|
|
@@ -6454,10 +6454,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6454
6454
|
}
|
|
6455
6455
|
}
|
|
6456
6456
|
set(e, t, n = {}) {
|
|
6457
|
-
let { status: r =
|
|
6457
|
+
let { status: r = K.hasSubscribers ? {} : void 0 } = n;
|
|
6458
6458
|
n.status = r, r && (r.op = "set", r.key = e, t !== void 0 && (r.value = t), r.cache = this);
|
|
6459
6459
|
let i = this.#z(e, t, n);
|
|
6460
|
-
return r &&
|
|
6460
|
+
return r && K.hasSubscribers && K.publish(r), i;
|
|
6461
6461
|
}
|
|
6462
6462
|
#z(e, t, n, r) {
|
|
6463
6463
|
let { ttl: i = this.ttl, start: a, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: s = this.sizeCalculation, status: c } = n, l = this.#W(t);
|
|
@@ -6525,10 +6525,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6525
6525
|
])), this.#N(t), this.#S?.[t] && (clearTimeout(this.#S[t]), this.#S[t] = void 0), e && (this.#d[t] = void 0, this.#f[t] = void 0, this.#_.push(t)), this.#c === 1 ? (this.#h = this.#g = 0, this.#_.length = 0) : this.#h = this.#p[t], this.#u.delete(n), this.#c--, t;
|
|
6526
6526
|
}
|
|
6527
6527
|
has(e, t = {}) {
|
|
6528
|
-
let { status: n =
|
|
6528
|
+
let { status: n = K.hasSubscribers ? {} : void 0 } = t;
|
|
6529
6529
|
t.status = n, n && (n.op = "has", n.key = e, n.cache = this);
|
|
6530
6530
|
let r = this.#V(e, t);
|
|
6531
|
-
return
|
|
6531
|
+
return K.hasSubscribers && K.publish(n), r;
|
|
6532
6532
|
}
|
|
6533
6533
|
#V(e, t = {}) {
|
|
6534
6534
|
let { updateAgeOnHas: n = this.updateAgeOnHas, status: r } = t, i = this.#u.get(e);
|
|
@@ -6541,10 +6541,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6541
6541
|
return !1;
|
|
6542
6542
|
}
|
|
6543
6543
|
peek(e, t = {}) {
|
|
6544
|
-
let { status: n =
|
|
6544
|
+
let { status: n = Br() ? {} : void 0 } = t;
|
|
6545
6545
|
n && (n.op = "peek", n.key = e, n.cache = this), t.status = n;
|
|
6546
6546
|
let r = this.#H(e, t);
|
|
6547
|
-
return
|
|
6547
|
+
return K.hasSubscribers && K.publish(n), r;
|
|
6548
6548
|
}
|
|
6549
6549
|
#H(e, t) {
|
|
6550
6550
|
let { status: n, allowStale: r = this.allowStale } = t, i = this.#u.get(e);
|
|
@@ -6596,10 +6596,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6596
6596
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
6597
6597
|
}
|
|
6598
6598
|
fetch(e, t = {}) {
|
|
6599
|
-
let n =
|
|
6599
|
+
let n = Rr.hasSubscribers, { status: r = Br() ? {} : void 0 } = t;
|
|
6600
6600
|
t.status = r, r && t.context && (r.context = t.context);
|
|
6601
6601
|
let i = this.#G(e, t);
|
|
6602
|
-
return r && n && (r.trace = !0,
|
|
6602
|
+
return r && n && (r.trace = !0, Rr.tracePromise(() => i, r).catch(() => {})), i;
|
|
6603
6603
|
}
|
|
6604
6604
|
async #G(e, t = {}) {
|
|
6605
6605
|
let { allowStale: n = this.allowStale, updateAgeOnGet: r = this.updateAgeOnGet, noDeleteOnStaleGet: i = this.noDeleteOnStaleGet, ttl: a = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: s = 0, sizeCalculation: c = this.sizeCalculation, noUpdateTTL: l = this.noUpdateTTL, noDeleteOnFetchRejection: u = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: m, forceRefresh: h = !1, status: g, signal: _ } = t;
|
|
@@ -6643,10 +6643,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6643
6643
|
}
|
|
6644
6644
|
}
|
|
6645
6645
|
forceFetch(e, t = {}) {
|
|
6646
|
-
let n =
|
|
6646
|
+
let n = Rr.hasSubscribers, { status: r = Br() ? {} : void 0 } = t;
|
|
6647
6647
|
t.status = r, r && t.context && (r.context = t.context);
|
|
6648
6648
|
let i = this.#K(e, t);
|
|
6649
|
-
return r && n && (r.trace = !0,
|
|
6649
|
+
return r && n && (r.trace = !0, Rr.tracePromise(() => i, r).catch(() => {})), i;
|
|
6650
6650
|
}
|
|
6651
6651
|
async #K(e, t = {}) {
|
|
6652
6652
|
let n = await this.#G(e, t);
|
|
@@ -6654,10 +6654,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6654
6654
|
return n;
|
|
6655
6655
|
}
|
|
6656
6656
|
memo(e, t = {}) {
|
|
6657
|
-
let { status: n =
|
|
6657
|
+
let { status: n = K.hasSubscribers ? {} : void 0 } = t;
|
|
6658
6658
|
t.status = n, n && (n.op = "memo", n.key = e, t.context && (n.context = t.context), n.cache = this);
|
|
6659
6659
|
let r = this.#q(e, t);
|
|
6660
|
-
return n && (n.value = r),
|
|
6660
|
+
return n && (n.value = r), K.hasSubscribers && K.publish(n), r;
|
|
6661
6661
|
}
|
|
6662
6662
|
#q(e, t = {}) {
|
|
6663
6663
|
let n = this.#o;
|
|
@@ -6673,10 +6673,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6673
6673
|
return i && (i.value = l), this.#z(e, l, o), l;
|
|
6674
6674
|
}
|
|
6675
6675
|
get(e, t = {}) {
|
|
6676
|
-
let { status: n =
|
|
6676
|
+
let { status: n = K.hasSubscribers ? {} : void 0 } = t;
|
|
6677
6677
|
t.status = n, n && (n.op = "get", n.key = e, n.cache = this);
|
|
6678
6678
|
let r = this.#J(e, t);
|
|
6679
|
-
return n && (r !== void 0 && (n.value = r),
|
|
6679
|
+
return n && (r !== void 0 && (n.value = r), K.hasSubscribers && K.publish(n)), r;
|
|
6680
6680
|
}
|
|
6681
6681
|
#J(e, t = {}) {
|
|
6682
6682
|
let { allowStale: n = this.allowStale, updateAgeOnGet: r = this.updateAgeOnGet, noDeleteOnStaleGet: i = this.noDeleteOnStaleGet, status: a } = t, o = this.#u.get(e);
|
|
@@ -6697,7 +6697,7 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6697
6697
|
return this.#Z(e, "delete");
|
|
6698
6698
|
}
|
|
6699
6699
|
#Z(e, t) {
|
|
6700
|
-
|
|
6700
|
+
K.hasSubscribers && K.publish({
|
|
6701
6701
|
op: "delete",
|
|
6702
6702
|
delete: t,
|
|
6703
6703
|
key: e,
|
|
@@ -6759,10 +6759,10 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6759
6759
|
for (; t = e?.shift();) this.#i?.(...t);
|
|
6760
6760
|
}
|
|
6761
6761
|
}
|
|
6762
|
-
},
|
|
6762
|
+
}, Yr = class {
|
|
6763
6763
|
cache;
|
|
6764
6764
|
constructor(e = 1e3, t = 3e5) {
|
|
6765
|
-
this.cache = new
|
|
6765
|
+
this.cache = new Jr({
|
|
6766
6766
|
max: e,
|
|
6767
6767
|
ttl: t
|
|
6768
6768
|
});
|
|
@@ -6781,7 +6781,7 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6781
6781
|
async clear() {
|
|
6782
6782
|
this.cache.clear();
|
|
6783
6783
|
}
|
|
6784
|
-
},
|
|
6784
|
+
}, Xr = class {
|
|
6785
6785
|
kv;
|
|
6786
6786
|
constructor(e) {
|
|
6787
6787
|
this.kv = e;
|
|
@@ -6798,21 +6798,21 @@ var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "ob
|
|
|
6798
6798
|
this.kv && await this.kv.delete(e);
|
|
6799
6799
|
}
|
|
6800
6800
|
async clear() {}
|
|
6801
|
-
},
|
|
6801
|
+
}, Zr = class {
|
|
6802
6802
|
async get() {
|
|
6803
6803
|
return null;
|
|
6804
6804
|
}
|
|
6805
6805
|
async set() {}
|
|
6806
6806
|
async delete() {}
|
|
6807
6807
|
async clear() {}
|
|
6808
|
-
},
|
|
6809
|
-
function
|
|
6808
|
+
}, Qr = null;
|
|
6809
|
+
function J(e) {
|
|
6810
6810
|
let t = process.env.CACHE_DRIVER || "lru";
|
|
6811
|
-
return t === "none" || t === "off" || t === "false" ? new
|
|
6811
|
+
return t === "none" || t === "off" || t === "false" ? new Zr() : e?.env?.CMS_CACHE_KV ? new Xr(e.env.CMS_CACHE_KV) : t === "lru" ? (Qr ||= new Yr(), Qr) : new Zr();
|
|
6812
6812
|
}
|
|
6813
6813
|
//#endregion
|
|
6814
6814
|
//#region server/storage/provider.ts
|
|
6815
|
-
function
|
|
6815
|
+
function $r(e) {
|
|
6816
6816
|
let t = e.split(".").pop()?.toLowerCase() || "bin";
|
|
6817
6817
|
return t = t.replace(/[^a-z0-9]/g, ""), [
|
|
6818
6818
|
"php",
|
|
@@ -6827,14 +6827,14 @@ function ei(e) {
|
|
|
6827
6827
|
"cjs"
|
|
6828
6828
|
].includes(t) ? "bin" : t;
|
|
6829
6829
|
}
|
|
6830
|
-
var
|
|
6830
|
+
var ei = class {
|
|
6831
6831
|
bucket;
|
|
6832
6832
|
publicDomain;
|
|
6833
6833
|
constructor(e, t) {
|
|
6834
6834
|
this.bucket = e, this.publicDomain = t;
|
|
6835
6835
|
}
|
|
6836
6836
|
async upload(e, t = "uploads") {
|
|
6837
|
-
let n =
|
|
6837
|
+
let n = $r(e.name), r = `${t}/${crypto.randomUUID().replace(/-/g, "")}.${n}`;
|
|
6838
6838
|
await this.bucket.put(r, e.stream(), { httpMetadata: { contentType: e.type } });
|
|
6839
6839
|
let i = r.replace(/^\//, ""), a = `/media/${i}`;
|
|
6840
6840
|
if (this.publicDomain && this.publicDomain.trim().length > 0) {
|
|
@@ -6849,7 +6849,7 @@ var ti = class {
|
|
|
6849
6849
|
async delete(e) {
|
|
6850
6850
|
await this.bucket.delete(e);
|
|
6851
6851
|
}
|
|
6852
|
-
},
|
|
6852
|
+
}, ti = class {
|
|
6853
6853
|
customStoragePath;
|
|
6854
6854
|
constructor(e) {
|
|
6855
6855
|
this.customStoragePath = e;
|
|
@@ -6867,7 +6867,7 @@ var ti = class {
|
|
|
6867
6867
|
), { pipeline: a } = await import(
|
|
6868
6868
|
/* @vite-ignore */
|
|
6869
6869
|
"node:stream/promises"
|
|
6870
|
-
), o =
|
|
6870
|
+
), o = $r(e.name), s = `${t}/${crypto.randomUUID().replace(/-/g, "")}.${o}`, c = this.customStoragePath || "./public/media", l = n.resolve(process.cwd(), c), u = n.join(l, s);
|
|
6871
6871
|
await i.mkdir(n.dirname(u), { recursive: !0 });
|
|
6872
6872
|
let d = r.createWriteStream(u);
|
|
6873
6873
|
return await a(e.stream(), d), {
|
|
@@ -6890,16 +6890,16 @@ var ti = class {
|
|
|
6890
6890
|
}
|
|
6891
6891
|
}
|
|
6892
6892
|
};
|
|
6893
|
-
function
|
|
6893
|
+
function ni(e) {
|
|
6894
6894
|
if (e.MEDIA_BUCKET) {
|
|
6895
6895
|
let t = e.CDN_DOMAIN || "cdn.yourdomain.com";
|
|
6896
|
-
return new
|
|
6896
|
+
return new ei(e.MEDIA_BUCKET, t);
|
|
6897
6897
|
}
|
|
6898
|
-
return new
|
|
6898
|
+
return new ti(e.LOCAL_MEDIA_PATH);
|
|
6899
6899
|
}
|
|
6900
6900
|
//#endregion
|
|
6901
6901
|
//#region server/utils/node-assets-interceptor.ts
|
|
6902
|
-
function
|
|
6902
|
+
function ri(e) {
|
|
6903
6903
|
if (!e || typeof e != "object") return {
|
|
6904
6904
|
cleanedData: e,
|
|
6905
6905
|
assetRefs: []
|
|
@@ -6958,7 +6958,7 @@ function ii(e) {
|
|
|
6958
6958
|
assetRefs: t
|
|
6959
6959
|
};
|
|
6960
6960
|
}
|
|
6961
|
-
async function
|
|
6961
|
+
async function ii(e, t, n) {
|
|
6962
6962
|
if (await e.prepare("DELETE FROM node_assets WHERE nodeId = ?").run(t), n.length === 0) return;
|
|
6963
6963
|
let r = /* @__PURE__ */ new Set();
|
|
6964
6964
|
for (let i of n) {
|
|
@@ -6968,23 +6968,23 @@ async function ai(e, t, n) {
|
|
|
6968
6968
|
}
|
|
6969
6969
|
//#endregion
|
|
6970
6970
|
//#region server/utils/asset-hydrator.ts
|
|
6971
|
-
function
|
|
6971
|
+
function ai(e) {
|
|
6972
6972
|
if (!e) return null;
|
|
6973
6973
|
if (typeof e == "string" && e.startsWith("ast_")) return e;
|
|
6974
6974
|
if (typeof e == "object" && e) {
|
|
6975
6975
|
if (typeof e.id == "string" && e.id.startsWith("ast_")) return e.id;
|
|
6976
|
-
if (typeof e.id == "object") return
|
|
6976
|
+
if (typeof e.id == "object") return ai(e.id);
|
|
6977
6977
|
}
|
|
6978
6978
|
return null;
|
|
6979
6979
|
}
|
|
6980
|
-
async function
|
|
6980
|
+
async function oi(e, t) {
|
|
6981
6981
|
if (!t || typeof t != "object") return t;
|
|
6982
6982
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
6983
6983
|
if (!e) return;
|
|
6984
|
-
let t =
|
|
6984
|
+
let t = ai(e);
|
|
6985
6985
|
if (t) {
|
|
6986
6986
|
if (n.add(t), typeof e == "object" && e.parentAssetId) {
|
|
6987
|
-
let t =
|
|
6987
|
+
let t = ai(e.parentAssetId);
|
|
6988
6988
|
t && n.add(t);
|
|
6989
6989
|
}
|
|
6990
6990
|
} else Array.isArray(e) ? e.forEach(r) : typeof e == "object" && Object.values(e).forEach(r);
|
|
@@ -7013,7 +7013,7 @@ async function si(e, t) {
|
|
|
7013
7013
|
AND (parentAssetId IN (${i}) OR ${Array.from(n).map(() => "filename LIKE ?").join(" OR ")})
|
|
7014
7014
|
`).all(...Array.from(n), ...Array.from(n).map((e) => `%${e}%`)), c = Array.isArray(s) ? s : s?.results || [], l = /* @__PURE__ */ new Map();
|
|
7015
7015
|
for (let e of c) {
|
|
7016
|
-
let t =
|
|
7016
|
+
let t = ai(e.parentAssetId) || Array.from(n).find((t) => e.filename.includes(t));
|
|
7017
7017
|
if (!t) continue;
|
|
7018
7018
|
let r = e.filename.match(/^crop_([a-z0-9]+)_/i), i = r ? r[1] : "standard", a = null;
|
|
7019
7019
|
if (e.cropCoordinatesJson) try {
|
|
@@ -7048,7 +7048,7 @@ async function si(e, t) {
|
|
|
7048
7048
|
id: e.id,
|
|
7049
7049
|
url: t,
|
|
7050
7050
|
originalUrl: n,
|
|
7051
|
-
parentAssetId:
|
|
7051
|
+
parentAssetId: ai(e.parentAssetId) || null,
|
|
7052
7052
|
cropCoordinates: r,
|
|
7053
7053
|
variants: i && Object.keys(i).length > 0 ? i : void 0,
|
|
7054
7054
|
filename: e.filename,
|
|
@@ -7060,7 +7060,7 @@ async function si(e, t) {
|
|
|
7060
7060
|
}
|
|
7061
7061
|
let d = (e) => {
|
|
7062
7062
|
if (!e) return e;
|
|
7063
|
-
let t =
|
|
7063
|
+
let t = ai(e);
|
|
7064
7064
|
if (t) {
|
|
7065
7065
|
let n = u.get(t) || {
|
|
7066
7066
|
id: t,
|
|
@@ -7070,7 +7070,7 @@ async function si(e, t) {
|
|
|
7070
7070
|
return {
|
|
7071
7071
|
...n,
|
|
7072
7072
|
id: t,
|
|
7073
|
-
parentAssetId: n.parentAssetId ?
|
|
7073
|
+
parentAssetId: n.parentAssetId ? ai(n.parentAssetId) : null,
|
|
7074
7074
|
url: typeof e == "object" && e.url && !e.url.startsWith("blob:") ? e.url : n.url,
|
|
7075
7075
|
originalUrl: typeof e == "object" && e.originalUrl && !e.originalUrl.startsWith("blob:") ? e.originalUrl : n.originalUrl,
|
|
7076
7076
|
cropCoordinates: i || n.cropCoordinates || null,
|
|
@@ -7090,7 +7090,7 @@ async function si(e, t) {
|
|
|
7090
7090
|
}
|
|
7091
7091
|
//#endregion
|
|
7092
7092
|
//#region src/schemas/definitions.ts
|
|
7093
|
-
function
|
|
7093
|
+
function Y(e = {}, t = {}) {
|
|
7094
7094
|
let n = {
|
|
7095
7095
|
...e,
|
|
7096
7096
|
...t
|
|
@@ -7108,7 +7108,7 @@ function J(e = {}, t = {}) {
|
|
|
7108
7108
|
...t.rules || {}
|
|
7109
7109
|
}, n;
|
|
7110
7110
|
}
|
|
7111
|
-
function
|
|
7111
|
+
function si() {
|
|
7112
7112
|
if (typeof process > "u" || !process?.versions?.node) return null;
|
|
7113
7113
|
try {
|
|
7114
7114
|
let e = (e) => {
|
|
@@ -7137,7 +7137,7 @@ function ci() {
|
|
|
7137
7137
|
for (let a of e(r)) {
|
|
7138
7138
|
let e = n.basename(a, n.extname(a));
|
|
7139
7139
|
try {
|
|
7140
|
-
i[e] =
|
|
7140
|
+
i[e] = Or.parse(t.readFileSync(a, "utf-8"));
|
|
7141
7141
|
} catch (e) {
|
|
7142
7142
|
console.warn(`[CMS Schema] Failed to parse ${a}:`, e);
|
|
7143
7143
|
}
|
|
@@ -7147,7 +7147,7 @@ function ci() {
|
|
|
7147
7147
|
let i = e(n.dirname(r)), a = n.basename(r), o = i.find((e) => n.basename(e) === a || n.basename(e) === a.replace(/\.yaml$/, ".yml"));
|
|
7148
7148
|
if (!o) return null;
|
|
7149
7149
|
try {
|
|
7150
|
-
return
|
|
7150
|
+
return Or.parse(t.readFileSync(o, "utf-8"));
|
|
7151
7151
|
} catch {
|
|
7152
7152
|
return null;
|
|
7153
7153
|
}
|
|
@@ -7175,12 +7175,12 @@ function ci() {
|
|
|
7175
7175
|
return null;
|
|
7176
7176
|
}
|
|
7177
7177
|
}
|
|
7178
|
-
function
|
|
7179
|
-
if (e && (Object.keys(e.rawNodes || {}).length > 0 || Object.keys(e.nodes || {}).length > 0)) return
|
|
7180
|
-
let t =
|
|
7181
|
-
return t && Object.keys(t.rawNodes).length > 0 ?
|
|
7178
|
+
function ci(e) {
|
|
7179
|
+
if (e && (Object.keys(e.rawNodes || {}).length > 0 || Object.keys(e.nodes || {}).length > 0)) return li(e);
|
|
7180
|
+
let t = si();
|
|
7181
|
+
return t && Object.keys(t.rawNodes).length > 0 ? li(t) : li(null);
|
|
7182
7182
|
}
|
|
7183
|
-
function
|
|
7183
|
+
function li(e) {
|
|
7184
7184
|
if (!e) return {
|
|
7185
7185
|
nodes: {},
|
|
7186
7186
|
trees: {},
|
|
@@ -7200,7 +7200,7 @@ function ui(e) {
|
|
|
7200
7200
|
let i = {};
|
|
7201
7201
|
if (!Array.isArray(e)) return typeof e == "object" && e ? (Object.entries(e).forEach(([e, t]) => {
|
|
7202
7202
|
let n = i[e] || m[e] || {};
|
|
7203
|
-
i[e] =
|
|
7203
|
+
i[e] = Y(n, t);
|
|
7204
7204
|
}), i) : {};
|
|
7205
7205
|
let a = (e) => {
|
|
7206
7206
|
let a = h[e] || h[`${e}-base`] || {};
|
|
@@ -7213,11 +7213,11 @@ function ui(e) {
|
|
|
7213
7213
|
fields: {}
|
|
7214
7214
|
}), Object.entries(s).forEach(([e, r]) => {
|
|
7215
7215
|
let i = n[t].fields[e] || {};
|
|
7216
|
-
n[t].fields[e] =
|
|
7216
|
+
n[t].fields[e] = Y(i, r);
|
|
7217
7217
|
});
|
|
7218
7218
|
} else Object.entries(s).forEach(([e, t]) => {
|
|
7219
7219
|
let n = i[e] || {};
|
|
7220
|
-
i[e] =
|
|
7220
|
+
i[e] = Y(n, t);
|
|
7221
7221
|
});
|
|
7222
7222
|
};
|
|
7223
7223
|
return e.forEach((e) => {
|
|
@@ -7225,7 +7225,7 @@ function ui(e) {
|
|
|
7225
7225
|
if (e.startsWith("fieldSet:")) a(e.replace("fieldSet:", "").trim());
|
|
7226
7226
|
else {
|
|
7227
7227
|
let t = i[e] || m[e] || {};
|
|
7228
|
-
i[e] =
|
|
7228
|
+
i[e] = Y(t, {
|
|
7229
7229
|
type: "text",
|
|
7230
7230
|
label: e
|
|
7231
7231
|
});
|
|
@@ -7235,7 +7235,7 @@ function ui(e) {
|
|
|
7235
7235
|
if (t === "fieldSet") a(String(n));
|
|
7236
7236
|
else {
|
|
7237
7237
|
let e = i[t] || m[t] || {};
|
|
7238
|
-
i[t] =
|
|
7238
|
+
i[t] = Y(e, typeof n == "object" && n ? n : {});
|
|
7239
7239
|
}
|
|
7240
7240
|
}
|
|
7241
7241
|
}), i;
|
|
@@ -7253,7 +7253,7 @@ function ui(e) {
|
|
|
7253
7253
|
let s = g(i.fields || i, a, n, t);
|
|
7254
7254
|
Object.entries(s).forEach(([e, t]) => {
|
|
7255
7255
|
let r = n[a].fields[e] || {};
|
|
7256
|
-
n[a].fields[e] =
|
|
7256
|
+
n[a].fields[e] = Y(r, t);
|
|
7257
7257
|
});
|
|
7258
7258
|
}
|
|
7259
7259
|
}), n) : (Object.entries(e).forEach(([e, r]) => {
|
|
@@ -7265,7 +7265,7 @@ function ui(e) {
|
|
|
7265
7265
|
let o = g(a, e, n, t);
|
|
7266
7266
|
Object.entries(o).forEach(([t, r]) => {
|
|
7267
7267
|
let i = n[e].fields[t] || {};
|
|
7268
|
-
n[e].fields[t] =
|
|
7268
|
+
n[e].fields[t] = Y(i, r);
|
|
7269
7269
|
});
|
|
7270
7270
|
}), n);
|
|
7271
7271
|
}, v = {};
|
|
@@ -7283,16 +7283,16 @@ function ui(e) {
|
|
|
7283
7283
|
fields: {}
|
|
7284
7284
|
}), Object.entries(o).forEach(([e, r]) => {
|
|
7285
7285
|
let i = n[t].fields[e] || {};
|
|
7286
|
-
n[t].fields[e] =
|
|
7286
|
+
n[t].fields[e] = Y(i, r);
|
|
7287
7287
|
});
|
|
7288
7288
|
} else Object.entries(o).forEach(([e, t]) => {
|
|
7289
7289
|
let n = r[e] || m[e] || {};
|
|
7290
|
-
r[e] =
|
|
7290
|
+
r[e] = Y(n, t);
|
|
7291
7291
|
});
|
|
7292
7292
|
}), Object.values(n).forEach((e) => {
|
|
7293
7293
|
Object.entries(e.fields).forEach(([e, t]) => {
|
|
7294
7294
|
let n = r[e] || {};
|
|
7295
|
-
r[e] =
|
|
7295
|
+
r[e] = Y(n, t);
|
|
7296
7296
|
});
|
|
7297
7297
|
}), Object.keys(n).length === 0 && Object.keys(r).length > 0 && (n.settings = {
|
|
7298
7298
|
label: t.label || "Settings",
|
|
@@ -7315,11 +7315,11 @@ function ui(e) {
|
|
|
7315
7315
|
Array.isArray(t.fieldSets) && t.fieldSets.forEach((e) => {
|
|
7316
7316
|
let t = h[e] || {}, i = t.fields || t, a = g(i, "settings", n);
|
|
7317
7317
|
Object.entries(a).forEach(([e, t]) => {
|
|
7318
|
-
r[e] =
|
|
7318
|
+
r[e] = Y(r[e] || {}, t);
|
|
7319
7319
|
});
|
|
7320
7320
|
}), Object.values(n).forEach((e) => {
|
|
7321
7321
|
Object.entries(e.fields).forEach(([e, t]) => {
|
|
7322
|
-
r[e] =
|
|
7322
|
+
r[e] = Y(r[e] || {}, t);
|
|
7323
7323
|
});
|
|
7324
7324
|
}), y[e] = {
|
|
7325
7325
|
...t,
|
|
@@ -7338,7 +7338,7 @@ function ui(e) {
|
|
|
7338
7338
|
Array.isArray(t.fieldSets) && t.fieldSets.forEach((e) => {
|
|
7339
7339
|
let t = h[e] || {}, r = t.fields || t, i = g(r);
|
|
7340
7340
|
Object.entries(i).forEach(([e, t]) => {
|
|
7341
|
-
n[e] =
|
|
7341
|
+
n[e] = Y(n[e] || {}, t);
|
|
7342
7342
|
});
|
|
7343
7343
|
}), b[e] = {
|
|
7344
7344
|
...t,
|
|
@@ -7387,7 +7387,7 @@ function ui(e) {
|
|
|
7387
7387
|
Array.isArray(f?.fieldSets) && f?.fieldSets.forEach((e) => {
|
|
7388
7388
|
let t = h[e] || {}, n = t.fields || t, r = g(n);
|
|
7389
7389
|
Object.entries(r).forEach(([e, t]) => {
|
|
7390
|
-
T[e] =
|
|
7390
|
+
T[e] = Y(T[e] || {}, t);
|
|
7391
7391
|
});
|
|
7392
7392
|
});
|
|
7393
7393
|
let E = f ? {
|
|
@@ -7397,7 +7397,7 @@ function ui(e) {
|
|
|
7397
7397
|
Array.isArray(p?.fieldSets) && p?.fieldSets.forEach((e) => {
|
|
7398
7398
|
let t = h[e] || {}, n = t.fields || t, r = g(n);
|
|
7399
7399
|
Object.entries(r).forEach(([e, t]) => {
|
|
7400
|
-
D[e] =
|
|
7400
|
+
D[e] = Y(D[e] || {}, t);
|
|
7401
7401
|
});
|
|
7402
7402
|
});
|
|
7403
7403
|
let ee = p ? {
|
|
@@ -7419,7 +7419,7 @@ function ui(e) {
|
|
|
7419
7419
|
}
|
|
7420
7420
|
//#endregion
|
|
7421
7421
|
//#region server/services/cache-manager.ts
|
|
7422
|
-
var
|
|
7422
|
+
var X = class {
|
|
7423
7423
|
zoneId;
|
|
7424
7424
|
apiToken;
|
|
7425
7425
|
frontendUrl;
|
|
@@ -7429,10 +7429,25 @@ var Y = class {
|
|
|
7429
7429
|
dispatch(e, t) {
|
|
7430
7430
|
!this.zoneId || !this.apiToken || (e.executionCtx && typeof e.executionCtx.waitUntil == "function" ? e.executionCtx.waitUntil(t) : t.catch((e) => console.warn("[CacheManager Warn]:", e)));
|
|
7431
7431
|
}
|
|
7432
|
+
async purgeInternalWorkerCache(e, t, n, r, i = "en") {
|
|
7433
|
+
try {
|
|
7434
|
+
let a = J(e), o = await t.prepare("SELECT treeId FROM tree_nodes WHERE contentId = ?").all(n), s = Array.isArray(o) ? o : o?.results || [];
|
|
7435
|
+
for (let e of s) await a.delete(`tree:default:${e.treeId}`), await a.delete(`tree:all:${e.treeId}`);
|
|
7436
|
+
let c = await t.prepare("SELECT c.key, c.id FROM node_channels nc JOIN channels c ON nc.channelId = c.id WHERE nc.nodeId = ?").all(n), l = Array.isArray(c) ? c : c?.results || [];
|
|
7437
|
+
for (let e of l) await a.delete(`node:${e.id}:${i}:${r}`), await a.delete(`node:${e.key}:${i}:${r}`);
|
|
7438
|
+
} catch (e) {
|
|
7439
|
+
console.warn("[CacheManager] Failed to purge internal worker cache:", e);
|
|
7440
|
+
}
|
|
7441
|
+
}
|
|
7432
7442
|
purgeAndWarmSlug(e, t, n = []) {
|
|
7433
7443
|
let r = (async () => {
|
|
7434
7444
|
try {
|
|
7435
|
-
let e = t.replace(/^\/+|\/+$/g, ""), r = e === "home" || !e ? this.frontendUrl : `${this.frontendUrl}/${e}`, i = [
|
|
7445
|
+
let e = t.replace(/^\/+|\/+$/g, ""), r = e === "home" || !e ? this.frontendUrl : `${this.frontendUrl}/${e}`, i = [
|
|
7446
|
+
r,
|
|
7447
|
+
`${r}/`,
|
|
7448
|
+
`https://admin.t3cloud.eu/api/v1/node/${e}?channelId=1&lang=en`,
|
|
7449
|
+
`https://admin.t3cloud.eu/api/v1/node/${e}?channelId=default&lang=en`
|
|
7450
|
+
];
|
|
7436
7451
|
for (let e of n) {
|
|
7437
7452
|
if (!e) continue;
|
|
7438
7453
|
let t = e.startsWith("/") ? e : `/${e}`;
|
|
@@ -7502,7 +7517,12 @@ var Y = class {
|
|
|
7502
7517
|
}
|
|
7503
7518
|
async purgeAndWarmSlugDirect(e, t = []) {
|
|
7504
7519
|
try {
|
|
7505
|
-
let n = e.replace(/^\/+|\/+$/g, ""), r = n === "home" || !n ? this.frontendUrl : `${this.frontendUrl}/${n}`, i = [
|
|
7520
|
+
let n = e.replace(/^\/+|\/+$/g, ""), r = n === "home" || !n ? this.frontendUrl : `${this.frontendUrl}/${n}`, i = [
|
|
7521
|
+
r,
|
|
7522
|
+
`${r}/`,
|
|
7523
|
+
`https://admin.t3cloud.eu/api/v1/node/${n}?channelId=1&lang=en`,
|
|
7524
|
+
`https://admin.t3cloud.eu/api/v1/node/${n}?channelId=default&lang=en`
|
|
7525
|
+
];
|
|
7506
7526
|
for (let e of t) {
|
|
7507
7527
|
if (!e) continue;
|
|
7508
7528
|
let t = e.startsWith("/") ? e : `/${e}`;
|
|
@@ -7518,8 +7538,8 @@ var Y = class {
|
|
|
7518
7538
|
}), fetch(r, { headers: { "X-Cache-Warmer": "true" } }).catch(() => {});
|
|
7519
7539
|
} catch {}
|
|
7520
7540
|
}
|
|
7521
|
-
},
|
|
7522
|
-
async function
|
|
7541
|
+
}, Z = new e();
|
|
7542
|
+
async function ui(e, t, n = []) {
|
|
7523
7543
|
let r = e.prepare(t);
|
|
7524
7544
|
if (typeof r.bind == "function") {
|
|
7525
7545
|
let e = await r.bind(...n).all();
|
|
@@ -7531,38 +7551,30 @@ async function di(e, t, n = []) {
|
|
|
7531
7551
|
}
|
|
7532
7552
|
return [];
|
|
7533
7553
|
}
|
|
7534
|
-
async function
|
|
7554
|
+
async function di(e, t, n = []) {
|
|
7535
7555
|
let r = e.prepare(t);
|
|
7536
7556
|
if (typeof r.bind == "function") return r.bind(...n).run();
|
|
7537
7557
|
if (typeof r.run == "function") return r.run(...n);
|
|
7538
7558
|
}
|
|
7539
|
-
async function
|
|
7559
|
+
async function fi(e, t) {
|
|
7540
7560
|
try {
|
|
7541
|
-
return (await
|
|
7561
|
+
return (await ui(e, "\n SELECT DISTINCT a.url\n FROM node_assets na\n JOIN assets a ON na.assetId = a.id\n WHERE na.nodeId = ? AND a.url IS NOT NULL AND a.url != ''\n ", [t])).map((e) => e.url).filter(Boolean);
|
|
7542
7562
|
} catch {
|
|
7543
7563
|
return [];
|
|
7544
7564
|
}
|
|
7545
7565
|
}
|
|
7546
|
-
|
|
7547
|
-
try {
|
|
7548
|
-
let r = q(e), i = await t.prepare("SELECT treeId FROM tree_nodes WHERE contentId = ?").all(n), a = Array.isArray(i) ? i : i?.results || [];
|
|
7549
|
-
for (let e of a) await r.delete(`tree:default:${e.treeId}`), await r.delete(`tree:all:${e.treeId}`);
|
|
7550
|
-
} catch (e) {
|
|
7551
|
-
console.warn("[Cache] Failed to invalidate tree caches for node", e);
|
|
7552
|
-
}
|
|
7553
|
-
}
|
|
7554
|
-
function hi(e) {
|
|
7566
|
+
function pi(e) {
|
|
7555
7567
|
return !e || !e.trim() ? null : e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/[\s-]+/g, "-").replace(/^-+|-+$/g, "") || null;
|
|
7556
7568
|
}
|
|
7557
|
-
function
|
|
7569
|
+
function mi(e) {
|
|
7558
7570
|
return +(e === !0 || e === 1 || e === "1" || e === "true");
|
|
7559
7571
|
}
|
|
7560
|
-
function
|
|
7572
|
+
function hi(e) {
|
|
7561
7573
|
if (e == null || e === "null" || e === "" || typeof e == "string" && e.startsWith("draft-")) return null;
|
|
7562
7574
|
let t = Number(e);
|
|
7563
7575
|
return isNaN(t) ? null : t;
|
|
7564
7576
|
}
|
|
7565
|
-
function
|
|
7577
|
+
function gi(e) {
|
|
7566
7578
|
let t = { ...e };
|
|
7567
7579
|
for (let e of [
|
|
7568
7580
|
"id",
|
|
@@ -7591,17 +7603,17 @@ function vi(e) {
|
|
|
7591
7603
|
]) delete t[e];
|
|
7592
7604
|
return t;
|
|
7593
7605
|
}
|
|
7594
|
-
function
|
|
7595
|
-
return e ? typeof e == "string" ? (e.startsWith("ast_") && t.add(e), t) : Array.isArray(e) ? (e.forEach((e) =>
|
|
7606
|
+
function _i(e, t = /* @__PURE__ */ new Set()) {
|
|
7607
|
+
return e ? typeof e == "string" ? (e.startsWith("ast_") && t.add(e), t) : Array.isArray(e) ? (e.forEach((e) => _i(e, t)), t) : (typeof e == "object" && Object.values(e).forEach((e) => _i(e, t)), t) : t;
|
|
7596
7608
|
}
|
|
7597
|
-
async function
|
|
7609
|
+
async function vi(e, t, n) {
|
|
7598
7610
|
for (let r of n) {
|
|
7599
|
-
let n = (await
|
|
7600
|
-
if (!n || (await
|
|
7611
|
+
let n = (await ui(e, "\n SELECT id, storageKeyPrivate, isSystemVariant, parentAssetId, filename\n FROM assets WHERE id = ?\n ", [r]))[0];
|
|
7612
|
+
if (!n || (await ui(e, "SELECT 1 FROM node_assets WHERE assetId = ? LIMIT 1", [n.id])).length > 0) continue;
|
|
7601
7613
|
let i = [n];
|
|
7602
7614
|
if (!n.isSystemVariant) {
|
|
7603
|
-
let t = await
|
|
7604
|
-
if (r.length > 0 && (await
|
|
7615
|
+
let t = await ui(e, "\n SELECT id, storageKeyPrivate, isSystemVariant, parentAssetId, filename\n FROM assets\n WHERE parentAssetId = ? OR (isSystemVariant = 1 AND filename LIKE ?)\n ", [n.id, `crop_%${String(n.filename || "").replace(/\.[^/.]+$/, "")}%`]), r = t.map((e) => e.id);
|
|
7616
|
+
if (r.length > 0 && (await ui(e, `SELECT DISTINCT assetId FROM node_assets WHERE assetId IN (${r.map(() => "?").join(",")})`, r)).length > 0) continue;
|
|
7605
7617
|
i = [n, ...t];
|
|
7606
7618
|
}
|
|
7607
7619
|
for (let e of i) if (e.storageKeyPrivate) try {
|
|
@@ -7610,10 +7622,10 @@ async function bi(e, t, n) {
|
|
|
7610
7622
|
console.warn(`[Asset Cleanup] Failed to delete ${e.storageKeyPrivate}:`, t);
|
|
7611
7623
|
}
|
|
7612
7624
|
let a = i.map((e) => e.id), o = a.map(() => "?").join(",");
|
|
7613
|
-
await
|
|
7625
|
+
await di(e, `DELETE FROM node_assets WHERE assetId IN (${o})`, a), await di(e, `DELETE FROM assets WHERE id IN (${o})`, a);
|
|
7614
7626
|
}
|
|
7615
7627
|
}
|
|
7616
|
-
async function
|
|
7628
|
+
async function yi(e, t, n) {
|
|
7617
7629
|
let r = {}, i = null;
|
|
7618
7630
|
if (t) {
|
|
7619
7631
|
let n = await e.prepare("\n WITH RECURSIVE ancestor_path(id, parentId, draftDataJson, dataJson, level) AS (\n SELECT t.id, t.parentId, c.draftDataJson, c.dataJson, 0\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE t.id = ?\n UNION ALL\n SELECT t.id, t.parentId, c.draftDataJson, c.dataJson, ap.level + 1\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n INNER JOIN ancestor_path ap ON t.id = ap.parentId\n )\n SELECT draftDataJson, dataJson FROM ancestor_path ORDER BY level ASC\n ").all(t), a = Array.isArray(n) ? n : n?.results || [];
|
|
@@ -7638,7 +7650,7 @@ async function xi(e, t, n) {
|
|
|
7638
7650
|
inheritedFields: r
|
|
7639
7651
|
};
|
|
7640
7652
|
}
|
|
7641
|
-
|
|
7653
|
+
Z.get("/", async (e) => {
|
|
7642
7654
|
let t = e.get("db"), n = e.req.query("id"), r = e.req.query("type"), i = e.req.query("q") || e.req.query("search"), a = e.req.query("channelId"), o = e.req.query("trashed") === "true", s = e.req.query("assetId"), c = e.req.query("sort") || "updatedAt", l = (e.req.query("order") || "DESC").toUpperCase() === "ASC" ? "ASC" : "DESC", u = e.req.query("limit"), d = e.req.query("offset"), f = Math.max(1, Math.min(100, parseInt(u || "50", 10))), p = Math.max(0, parseInt(d || "0", 10));
|
|
7643
7655
|
if (n) {
|
|
7644
7656
|
let r = Number(n);
|
|
@@ -7663,13 +7675,13 @@ X.get("/", async (e) => {
|
|
|
7663
7675
|
updatedAt: i.updatedAt
|
|
7664
7676
|
}, s = i.draftDataJson || i.dataJson;
|
|
7665
7677
|
if (s) try {
|
|
7666
|
-
let n = typeof s == "string" ? JSON.parse(s) : s, a = await t.prepare("SELECT id as treeNodeId, treeId, parentId FROM tree_nodes WHERE contentId = ? LIMIT 1").get(r), c =
|
|
7678
|
+
let n = typeof s == "string" ? JSON.parse(s) : s, a = await t.prepare("SELECT id as treeNodeId, treeId, parentId FROM tree_nodes WHERE contentId = ? LIMIT 1").get(r), c = li(e.env?.BUNDLED_DEFINITIONS).nodes?.[i.contentType] || {}, l = n.layoutId || null;
|
|
7667
7679
|
if (a) {
|
|
7668
|
-
let { resolvedLayoutId: e, inheritedFields: r } = await
|
|
7680
|
+
let { resolvedLayoutId: e, inheritedFields: r } = await yi(t, a.parentId, a.treeId);
|
|
7669
7681
|
(l === "inherit" || !l) && (l = e || c.defaultLayout || null);
|
|
7670
7682
|
for (let [e, t] of Object.entries(r)) (n[e] === void 0 || n[e] === null || n[e] === "") && t !== void 0 && (n[e] = t);
|
|
7671
7683
|
} else (l === "inherit" || !l) && (l = c.defaultLayout || null);
|
|
7672
|
-
let u = await
|
|
7684
|
+
let u = await oi(t, gi(n));
|
|
7673
7685
|
Object.assign(o, u), o.resolvedLayoutId = l;
|
|
7674
7686
|
} catch {}
|
|
7675
7687
|
let c = await t.prepare("SELECT channelId FROM node_channels WHERE nodeId = ?").all(r);
|
|
@@ -7679,7 +7691,7 @@ X.get("/", async (e) => {
|
|
|
7679
7691
|
let u = await t.prepare("\n SELECT * FROM content_blocks \n WHERE contentId = ? AND isDraft = 1 \n ORDER BY sortOrder ASC\n ").all(r), d = Array.isArray(u) ? u : u?.results || [], f = await Promise.all(d.map(async (e) => {
|
|
7680
7692
|
let n = {};
|
|
7681
7693
|
try {
|
|
7682
|
-
n = typeof e.dataJson == "string" ? JSON.parse(e.dataJson || "{}") : e.dataJson || {}, n && typeof n == "object" && (n = await
|
|
7694
|
+
n = typeof e.dataJson == "string" ? JSON.parse(e.dataJson || "{}") : e.dataJson || {}, n && typeof n == "object" && (n = await oi(t, n));
|
|
7683
7695
|
} catch {
|
|
7684
7696
|
n = {};
|
|
7685
7697
|
}
|
|
@@ -7779,7 +7791,7 @@ X.get("/", async (e) => {
|
|
|
7779
7791
|
assetCount: e.assetCount || 0
|
|
7780
7792
|
}, i = e.draftDataJson || e.dataJson;
|
|
7781
7793
|
if (i) try {
|
|
7782
|
-
let e = typeof i == "string" ? JSON.parse(i) : i, n = await
|
|
7794
|
+
let e = typeof i == "string" ? JSON.parse(i) : i, n = await oi(t, gi(e));
|
|
7783
7795
|
Object.assign(r, n);
|
|
7784
7796
|
} catch {}
|
|
7785
7797
|
return r;
|
|
@@ -7791,25 +7803,27 @@ X.get("/", async (e) => {
|
|
|
7791
7803
|
offset: p,
|
|
7792
7804
|
limit: f
|
|
7793
7805
|
});
|
|
7794
|
-
}),
|
|
7795
|
-
let t = e.get("db"), n = await e.req.json(), r = n.node || n.activeNode || n, i = r.id || n.id, a = i != null && i !== "" && !isNaN(Number(i)) ? Number(i) : null, { title: o, slug: s, language: c, nodeType: l, contentType: u, isHidden: d, hidden: f, is_hidden: p, blocks: m, channels: h, trees: g, ..._ } = r, v =
|
|
7806
|
+
}), Z.post("/", async (e) => {
|
|
7807
|
+
let t = e.get("db"), n = await e.req.json(), r = n.node || n.activeNode || n, i = r.id || n.id, a = i != null && i !== "" && !isNaN(Number(i)) ? Number(i) : null, { title: o, slug: s, language: c, nodeType: l, contentType: u, isHidden: d, hidden: f, is_hidden: p, blocks: m, channels: h, trees: g, ..._ } = r, v = gi(_), { cleanedData: y, assetRefs: b } = ri(v), x = mi(d === void 0 ? f === void 0 ? p : f : d), S = c || "en", C = l || u || "page", w = e.get("user")?.id || null, T = a, E = /* @__PURE__ */ new Set();
|
|
7796
7808
|
if (a) {
|
|
7797
|
-
let n = await t.prepare("SELECT title, slug,
|
|
7809
|
+
let n = await t.prepare("SELECT title, slug, language, contentType, draftDataJson, dataJson, publishedAt, status FROM content_nodes WHERE id = ?").get(a), r = n?.draftDataJson || n?.dataJson || "{}";
|
|
7798
7810
|
try {
|
|
7799
|
-
|
|
7811
|
+
_i(typeof r == "string" ? JSON.parse(r) : r, E);
|
|
7800
7812
|
} catch {}
|
|
7801
7813
|
if (m !== void 0) {
|
|
7802
7814
|
let e = await t.prepare("SELECT dataJson FROM content_blocks WHERE contentId = ? AND isDraft = 1").all(a);
|
|
7803
7815
|
(Array.isArray(e) ? e : e?.results || []).forEach((e) => {
|
|
7804
7816
|
try {
|
|
7805
|
-
|
|
7817
|
+
_i(typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson, E);
|
|
7806
7818
|
} catch {}
|
|
7807
7819
|
});
|
|
7808
7820
|
}
|
|
7809
7821
|
if (m === void 0 && o === void 0 && s === void 0 && h === void 0 && g === void 0 && Object.keys(v).length === 0) {
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7822
|
+
await t.prepare("\n UPDATE content_nodes \n SET isHidden = ?, \n updatedById = ?, \n updatedAt = CURRENT_TIMESTAMP\n WHERE id = ?\n ").run(x, w, a), await J(e).clear();
|
|
7823
|
+
let r = new X(e.env);
|
|
7824
|
+
if (await r.purgeInternalWorkerCache(e, t, a, n?.slug || "", n?.language || "en"), n?.status === "published") {
|
|
7825
|
+
let i = await fi(t, a);
|
|
7826
|
+
r.purgeSmart(e, t, a, n.slug, i);
|
|
7813
7827
|
}
|
|
7814
7828
|
return e.json({
|
|
7815
7829
|
success: !0,
|
|
@@ -7818,7 +7832,7 @@ X.get("/", async (e) => {
|
|
|
7818
7832
|
});
|
|
7819
7833
|
}
|
|
7820
7834
|
{
|
|
7821
|
-
let e = o === void 0 ? n?.title || "Untitled" : o, r = s === void 0 ? n?.slug ?? null :
|
|
7835
|
+
let e = o === void 0 ? n?.title || "Untitled" : o, r = s === void 0 ? n?.slug ?? null : pi(s), i = C || n?.contentType || "page", c = S || n?.language || "en", l = n?.draftDataJson || n?.dataJson || "{}", u = {};
|
|
7822
7836
|
try {
|
|
7823
7837
|
u = JSON.parse(l);
|
|
7824
7838
|
} catch {}
|
|
@@ -7829,7 +7843,7 @@ X.get("/", async (e) => {
|
|
|
7829
7843
|
await t.prepare("\n UPDATE content_nodes \n SET title = ?, \n slug = ?, \n language = ?,\n contentType = ?, \n isHidden = ?, \n status = 'draft', \n draftDataJson = ?, \n updatedById = ?, \n updatedAt = CURRENT_TIMESTAMP\n WHERE id = ?\n ").run(e, r, c, i, x, d, w, a);
|
|
7830
7844
|
}
|
|
7831
7845
|
} else {
|
|
7832
|
-
let e = o || "Untitled", n =
|
|
7846
|
+
let e = o || "Untitled", n = pi(s), r = JSON.stringify(y), i = await t.prepare("\n INSERT INTO content_nodes (contentType, title, slug, language, isHidden, status, draftDataJson, dataJson, createdById, updatedById)\n VALUES (?, ?, ?, ?, ?, 'draft', ?, NULL, ?, ?)\n ").run(C, e, n, S, x, r, w, w);
|
|
7833
7847
|
T = Number(i.lastInsertRowid);
|
|
7834
7848
|
}
|
|
7835
7849
|
if (h !== void 0 && Array.isArray(h) && T) {
|
|
@@ -7847,7 +7861,7 @@ X.get("/", async (e) => {
|
|
|
7847
7861
|
let i = Number(t.treeId) || t.treeId;
|
|
7848
7862
|
if (!e.has(i)) {
|
|
7849
7863
|
e.add(i);
|
|
7850
|
-
let a =
|
|
7864
|
+
let a = hi(t.parentId ?? t._draftParentId ?? null), o = typeof t.sortOrder == "number" ? t.sortOrder : 0;
|
|
7851
7865
|
n.push("(?, ?, ?, ?)"), r.push(i, T, a, o);
|
|
7852
7866
|
}
|
|
7853
7867
|
}
|
|
@@ -7858,7 +7872,7 @@ X.get("/", async (e) => {
|
|
|
7858
7872
|
await t.prepare("DELETE FROM content_blocks WHERE contentId = ? AND isDraft = 1").run(T);
|
|
7859
7873
|
let e = [], n = [];
|
|
7860
7874
|
for (let t = 0; t < m.length; t++) {
|
|
7861
|
-
let r = m[t], i = r.componentId || r.elementType || "text-block", a = r.data || {}, o = String(r.blockId || a.blockId || r.instanceId || r.id || `block-${Date.now()}`), { cleanedData: s, assetRefs: c } =
|
|
7875
|
+
let r = m[t], i = r.componentId || r.elementType || "text-block", a = r.data || {}, o = String(r.blockId || a.blockId || r.instanceId || r.id || `block-${Date.now()}`), { cleanedData: s, assetRefs: c } = ri({
|
|
7862
7876
|
...a,
|
|
7863
7877
|
blockId: o,
|
|
7864
7878
|
_instanceId: o
|
|
@@ -7876,16 +7890,20 @@ X.get("/", async (e) => {
|
|
|
7876
7890
|
}
|
|
7877
7891
|
if (T) {
|
|
7878
7892
|
let n = [...b, ...D];
|
|
7879
|
-
await
|
|
7893
|
+
await ii(t, T, n);
|
|
7880
7894
|
let r = new Set(n.map((e) => e.assetId)), i = new Set([...E].filter((e) => !r.has(e)));
|
|
7881
|
-
i.size > 0 && await
|
|
7895
|
+
i.size > 0 && await vi(t, ni(e.env), i);
|
|
7896
|
+
}
|
|
7897
|
+
if (await J(e).clear(), T) {
|
|
7898
|
+
let n = new X(e.env), r = o === void 0 ? s : pi(s);
|
|
7899
|
+
await n.purgeInternalWorkerCache(e, t, T, r || "", S);
|
|
7882
7900
|
}
|
|
7883
|
-
return
|
|
7901
|
+
return e.json({
|
|
7884
7902
|
success: !0,
|
|
7885
7903
|
id: T,
|
|
7886
7904
|
status: "draft"
|
|
7887
7905
|
});
|
|
7888
|
-
}),
|
|
7906
|
+
}), Z.post("/publish", async (e) => {
|
|
7889
7907
|
let t = e.get("db"), n = await e.req.json(), r = n.id || n.nodeId;
|
|
7890
7908
|
if (!r || isNaN(Number(r))) return e.json({ error: "Node ID required for publishing" }, 400);
|
|
7891
7909
|
let i = Number(r), a = e.get("user")?.id || null, o = await t.prepare("SELECT * FROM content_nodes WHERE id = ?").get(i);
|
|
@@ -7910,52 +7928,58 @@ X.get("/", async (e) => {
|
|
|
7910
7928
|
},
|
|
7911
7929
|
blocks: l
|
|
7912
7930
|
};
|
|
7913
|
-
await t.prepare("\n INSERT INTO node_revisions (nodeId, version, snapshotJson, createdById)\n VALUES (?, ?, ?, ?)\n ").run(i, u, JSON.stringify(d), a), await
|
|
7914
|
-
let f =
|
|
7915
|
-
|
|
7931
|
+
await t.prepare("\n INSERT INTO node_revisions (nodeId, version, snapshotJson, createdById)\n VALUES (?, ?, ?, ?)\n ").run(i, u, JSON.stringify(d), a), await J(e).clear();
|
|
7932
|
+
let f = new X(e.env);
|
|
7933
|
+
await f.purgeInternalWorkerCache(e, t, i, o.slug, o.language || "en");
|
|
7934
|
+
let p = await fi(t, i);
|
|
7935
|
+
return f.purgeSmart(e, t, i, o.slug, p), e.json({
|
|
7916
7936
|
success: !0,
|
|
7917
7937
|
id: i,
|
|
7918
7938
|
status: "published",
|
|
7919
7939
|
version: u,
|
|
7920
7940
|
publishedAt: d.publishedAt
|
|
7921
7941
|
});
|
|
7922
|
-
}),
|
|
7942
|
+
}), Z.delete("/", async (e) => {
|
|
7923
7943
|
let t = e.get("db"), n = e.req.query("id");
|
|
7924
7944
|
if (!n) return e.json({ error: "Node ID required" }, 400);
|
|
7925
|
-
let r = Number(n), i = await t.prepare("SELECT slug, status FROM content_nodes WHERE id = ?").get(r);
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7945
|
+
let r = Number(n), i = await t.prepare("SELECT slug, language, status FROM content_nodes WHERE id = ?").get(r);
|
|
7946
|
+
await t.prepare("UPDATE content_nodes SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?").run(r), await J(e).clear();
|
|
7947
|
+
let a = new X(e.env);
|
|
7948
|
+
if (i && await a.purgeInternalWorkerCache(e, t, r, i.slug, i.language || "en"), i && i.status === "published") {
|
|
7949
|
+
let n = await fi(t, r);
|
|
7950
|
+
a.purgeSmart(e, t, r, i.slug, n);
|
|
7929
7951
|
}
|
|
7930
7952
|
return e.json({
|
|
7931
7953
|
success: !0,
|
|
7932
7954
|
deletedNodeId: r
|
|
7933
7955
|
});
|
|
7934
|
-
}),
|
|
7956
|
+
}), Z.post("/restore", async (e) => {
|
|
7935
7957
|
let t = e.get("db"), n = await e.req.json(), r = Number(n.id);
|
|
7936
7958
|
if (!r) return e.json({ error: "Node ID required" }, 400);
|
|
7937
|
-
let i = await t.prepare("SELECT slug, status FROM content_nodes WHERE id = ?").get(r);
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7959
|
+
let i = await t.prepare("SELECT slug, language, status FROM content_nodes WHERE id = ?").get(r);
|
|
7960
|
+
await t.prepare("UPDATE content_nodes SET deletedAt = NULL WHERE id = ?").run(r), await J(e).clear();
|
|
7961
|
+
let a = new X(e.env);
|
|
7962
|
+
if (i && await a.purgeInternalWorkerCache(e, t, r, i.slug, i.language || "en"), i && i.status === "published") {
|
|
7963
|
+
let n = await fi(t, r);
|
|
7964
|
+
a.purgeSmart(e, t, r, i.slug, n);
|
|
7941
7965
|
}
|
|
7942
7966
|
return e.json({
|
|
7943
7967
|
success: !0,
|
|
7944
7968
|
restoredNodeId: r
|
|
7945
7969
|
});
|
|
7946
|
-
}),
|
|
7970
|
+
}), Z.delete("/purge", async (e) => {
|
|
7947
7971
|
let t = e.get("db"), n = e.req.query("id");
|
|
7948
7972
|
if (!n) return e.json({ error: "Node ID required" }, 400);
|
|
7949
|
-
let r = Number(n), i = await t.prepare("SELECT slug, status FROM content_nodes WHERE id = ?").get(r), a = await
|
|
7950
|
-
return await
|
|
7973
|
+
let r = Number(n), i = await t.prepare("SELECT slug, language, status FROM content_nodes WHERE id = ?").get(r), a = await fi(t, r), o = new X(e.env);
|
|
7974
|
+
return i && await o.purgeInternalWorkerCache(e, t, r, i.slug, i.language || "en"), await t.prepare("DELETE FROM node_channels WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM tree_nodes WHERE contentId = ?").run(r), await t.prepare("DELETE FROM content_blocks WHERE contentId = ?").run(r), await t.prepare("DELETE FROM node_revisions WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM node_assets WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM content_nodes WHERE id = ?").run(r), await J(e).clear(), i && i.status === "published" && o.purgeSmart(e, t, r, i.slug, a), e.json({
|
|
7951
7975
|
success: !0,
|
|
7952
7976
|
purgedNodeId: r
|
|
7953
7977
|
});
|
|
7954
7978
|
});
|
|
7955
7979
|
//#endregion
|
|
7956
7980
|
//#region server/routes/admin/trees.ts
|
|
7957
|
-
var
|
|
7958
|
-
function
|
|
7981
|
+
var bi = new e();
|
|
7982
|
+
function xi(e, t = null) {
|
|
7959
7983
|
let n = [];
|
|
7960
7984
|
for (let r = 0; r < e.length; r++) {
|
|
7961
7985
|
let i = e[r];
|
|
@@ -7968,20 +7992,20 @@ function Ci(e, t = null) {
|
|
|
7968
7992
|
id: a,
|
|
7969
7993
|
parentId: t,
|
|
7970
7994
|
sortOrder: r
|
|
7971
|
-
}), i.children && Array.isArray(i.children) && i.children.length > 0 && n.push(...
|
|
7995
|
+
}), i.children && Array.isArray(i.children) && i.children.length > 0 && n.push(...xi(i.children, a));
|
|
7972
7996
|
}
|
|
7973
7997
|
}
|
|
7974
7998
|
return n;
|
|
7975
7999
|
}
|
|
7976
|
-
function
|
|
8000
|
+
function Si(e) {
|
|
7977
8001
|
if (e == null || e === "null" || e === "" || typeof e == "string" && e.startsWith("draft-")) return null;
|
|
7978
8002
|
let t = Number(e);
|
|
7979
8003
|
return isNaN(t) ? null : t;
|
|
7980
8004
|
}
|
|
7981
|
-
function
|
|
8005
|
+
function Ci(e) {
|
|
7982
8006
|
return +(e === !0 || e === 1 || e === "1" || e === "true");
|
|
7983
8007
|
}
|
|
7984
|
-
|
|
8008
|
+
bi.get("/tree.json", async (e) => {
|
|
7985
8009
|
try {
|
|
7986
8010
|
let t = e.get("db"), n = e.req.query("treeId") || "main-nav", r = e.req.query("preview") === "true", i = 1;
|
|
7987
8011
|
if (isNaN(Number(n))) {
|
|
@@ -8031,9 +8055,9 @@ Si.get("/tree.json", async (e) => {
|
|
|
8031
8055
|
} catch (t) {
|
|
8032
8056
|
return console.error("[CMS Tree API] GET Error:", t), e.json({ error: t.message || "Failed to fetch tree" }, 500);
|
|
8033
8057
|
}
|
|
8034
|
-
}),
|
|
8058
|
+
}), bi.post("/tree.json", async (e) => {
|
|
8035
8059
|
try {
|
|
8036
|
-
let t = e.get("db"), n = await e.req.json(), r = n.treeId ? String(n.treeId).trim() : "main-nav", i =
|
|
8060
|
+
let t = e.get("db"), n = await e.req.json(), r = n.treeId ? String(n.treeId).trim() : "main-nav", i = J(e), a = new X(e.env), o = 1;
|
|
8037
8061
|
if (isNaN(Number(r))) {
|
|
8038
8062
|
let e = await t.prepare("SELECT id FROM trees WHERE key = ?").get(r);
|
|
8039
8063
|
if (e && e.id) o = Number(e.id);
|
|
@@ -8043,7 +8067,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8043
8067
|
}
|
|
8044
8068
|
} else o = Number(r);
|
|
8045
8069
|
if (n.tree && Array.isArray(n.tree)) {
|
|
8046
|
-
let r =
|
|
8070
|
+
let r = xi(n.tree, null);
|
|
8047
8071
|
if (r.length > 0) for (let e = 0; e < r.length; e += 50) {
|
|
8048
8072
|
let n = r.slice(e, e + 50), i = n.map((e) => e.id), a = i.map(() => "?").join(","), s = "UPDATE tree_nodes SET \n";
|
|
8049
8073
|
s += "parentId = CASE id \n", n.forEach(() => {
|
|
@@ -8060,9 +8084,9 @@ Si.get("/tree.json", async (e) => {
|
|
|
8060
8084
|
}
|
|
8061
8085
|
return await i.clear(), await a.purgeGlobalCache(e), e.json({ success: !0 });
|
|
8062
8086
|
}
|
|
8063
|
-
let { action: s, title: c, nodeType: l, parentId: u, contentId: d, nodeData: f = {}, pageData: p = {} } = n, m = Object.keys(f).length > 0 ? { ...f } : { ...p }, h =
|
|
8087
|
+
let { action: s, title: c, nodeType: l, parentId: u, contentId: d, nodeData: f = {}, pageData: p = {} } = n, m = Object.keys(f).length > 0 ? { ...f } : { ...p }, h = Ci(n.isHidden === void 0 ? m.isHidden === void 0 ? m.hidden : m.isHidden : n.isHidden);
|
|
8064
8088
|
delete m._isTreeDraft, delete m._draftParentId, delete m.isNew, delete m.nodeType, delete m.contentType, delete m.title, delete m.slug, delete m.hidden, delete m.is_hidden, delete m.isHidden, delete m.status;
|
|
8065
|
-
let g =
|
|
8089
|
+
let g = Si(u), _ = e.get("user")?.id || null;
|
|
8066
8090
|
if (s === "create") {
|
|
8067
8091
|
let r = m.slug || n.slug || c, s = r ? String(r).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") : null;
|
|
8068
8092
|
if (s) {
|
|
@@ -8148,7 +8172,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8148
8172
|
details: t.message
|
|
8149
8173
|
}, 500);
|
|
8150
8174
|
}
|
|
8151
|
-
}),
|
|
8175
|
+
}), bi.get("/trees.json", async (e) => {
|
|
8152
8176
|
try {
|
|
8153
8177
|
let t = e.get("db"), n = await t.prepare("SELECT * FROM trees ORDER BY LOWER(label) ASC").all(), r = Array.isArray(n) ? n : n?.results || [], i = await t.prepare("SELECT channelId, treeId FROM channel_trees").all(), a = (Array.isArray(i) ? i : i?.results || []).reduce((e, t) => {
|
|
8154
8178
|
let n = Number(t.treeId), r = Number(t.channelId);
|
|
@@ -8178,7 +8202,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8178
8202
|
} catch {
|
|
8179
8203
|
return e.json([]);
|
|
8180
8204
|
}
|
|
8181
|
-
}),
|
|
8205
|
+
}), bi.post("/trees.json", async (e) => {
|
|
8182
8206
|
try {
|
|
8183
8207
|
let t = e.get("db"), n = await e.req.json(), r = n.id, i = r != null && r !== "" && !isNaN(Number(r)) ? Number(r) : null, a = `tree-${Date.now().toString(36)}`, o = (n.key || n.slug || a).toLowerCase().replace(/[^a-z0-9_-]/g, "-"), s = n.label?.trim() || o, c = n.treeType !== void 0 && n.treeType !== null ? n.treeType : n.type ?? "site", l = n.channelId !== void 0 && n.channelId !== null && Number(n.channelId) || null, u = +(n.isHidden === !0 || n.isHidden === 1 || n.isHidden === "true"), d = e.get("user")?.id || null, f = { ...n };
|
|
8184
8208
|
if (delete f.id, delete f.key, delete f.label, delete f.treeType, delete f.type, delete f.channelId, delete f.channels, delete f.isHidden, delete f.createdById, delete f.updatedById, delete f.createdAt, delete f.updatedAt, await t.prepare("SELECT id FROM trees WHERE key = ? AND id != ? LIMIT 1").get(o, i ?? -1)) return e.json({
|
|
@@ -8203,7 +8227,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8203
8227
|
await t.prepare(`INSERT OR IGNORE INTO channel_trees (channelId, treeId, key) VALUES ${n}`).run(...r);
|
|
8204
8228
|
}
|
|
8205
8229
|
}
|
|
8206
|
-
return await
|
|
8230
|
+
return await J(e).clear(), await new X(e.env).purgeGlobalCache(e), e.json({
|
|
8207
8231
|
success: !0,
|
|
8208
8232
|
id: p,
|
|
8209
8233
|
key: o,
|
|
@@ -8217,12 +8241,12 @@ Si.get("/tree.json", async (e) => {
|
|
|
8217
8241
|
} catch (t) {
|
|
8218
8242
|
return console.error("[API Trees] Error saving tree:", t), e.json({ error: t.message || "Failed to save tree" }, 500);
|
|
8219
8243
|
}
|
|
8220
|
-
}),
|
|
8244
|
+
}), bi.delete("/trees.json", async (e) => {
|
|
8221
8245
|
let t = e.get("db"), n = e.req.query("id");
|
|
8222
8246
|
if (!n) return e.json({ error: "Tree ID required" }, 400);
|
|
8223
8247
|
let r = Number(n);
|
|
8224
8248
|
try {
|
|
8225
|
-
return await t.prepare("DELETE FROM trees WHERE id = ?").run(r), await t.prepare("DELETE FROM channel_trees WHERE treeId = ?").run(r), await t.prepare("DELETE FROM tree_nodes WHERE treeId = ?").run(r), await
|
|
8249
|
+
return await t.prepare("DELETE FROM trees WHERE id = ?").run(r), await t.prepare("DELETE FROM channel_trees WHERE treeId = ?").run(r), await t.prepare("DELETE FROM tree_nodes WHERE treeId = ?").run(r), await J(e).clear(), await new X(e.env).purgeGlobalCache(e), e.json({
|
|
8226
8250
|
success: !0,
|
|
8227
8251
|
deletedTreeId: r
|
|
8228
8252
|
});
|
|
@@ -8232,8 +8256,8 @@ Si.get("/tree.json", async (e) => {
|
|
|
8232
8256
|
});
|
|
8233
8257
|
//#endregion
|
|
8234
8258
|
//#region server/routes/admin/channels.ts
|
|
8235
|
-
var
|
|
8236
|
-
|
|
8259
|
+
var wi = new e();
|
|
8260
|
+
wi.get("/", async (e) => {
|
|
8237
8261
|
try {
|
|
8238
8262
|
let t = e.get("db"), n = await t.prepare("SELECT * FROM channels ORDER BY id ASC").all(), r = Array.isArray(n) ? n : n?.results || [], i = await t.prepare("SELECT channelId, treeId, key, metaJson FROM channel_trees").all(), a = ((Array.isArray(i) ? i : i?.results || []) || []).reduce((e, t) => {
|
|
8239
8263
|
e[t.channelId] || (e[t.channelId] = []);
|
|
@@ -8257,7 +8281,7 @@ Ei.get("/", async (e) => {
|
|
|
8257
8281
|
isHidden: !!e.isHidden,
|
|
8258
8282
|
trees: a[e.id] || []
|
|
8259
8283
|
};
|
|
8260
|
-
}), s = e.env?.BUNDLED_DEFINITIONS, c =
|
|
8284
|
+
}), s = e.env?.BUNDLED_DEFINITIONS, c = li(s)?.channelTemplate || {
|
|
8261
8285
|
label: "Channel Settings",
|
|
8262
8286
|
fields: {
|
|
8263
8287
|
key: {
|
|
@@ -8299,7 +8323,7 @@ Ei.get("/", async (e) => {
|
|
|
8299
8323
|
error: t.message
|
|
8300
8324
|
}, 500);
|
|
8301
8325
|
}
|
|
8302
|
-
}),
|
|
8326
|
+
}), wi.post("/", async (e) => {
|
|
8303
8327
|
try {
|
|
8304
8328
|
let t = e.get("db"), n = await e.req.json(), r = n.id, i = r != null && r !== "" && !isNaN(Number(r)) ? Number(r) : null, { key: a, label: o, channelType: s = "website", domain: c = "localhost", baseUrl: l = "http://localhost:4321", defaultLanguage: u = "en", isHidden: d = !1, trees: f = [], createdById: p = null, updatedById: m = null, id: h, createdAt: g, updatedAt: _, ...v } = n, y = a?.trim() || "main", b = o?.trim() || "Untitled Channel", x = Array.isArray(f) ? f : [], S = JSON.stringify(v || {}), C = e.get("user")?.id || m || p || null;
|
|
8305
8329
|
if (await t.prepare("SELECT id FROM channels WHERE key = ? AND id != ? LIMIT 1").get(y, i ?? -1)) return e.json({
|
|
@@ -8326,7 +8350,7 @@ Ei.get("/", async (e) => {
|
|
|
8326
8350
|
VALUES ${e}
|
|
8327
8351
|
`).run(...n);
|
|
8328
8352
|
}
|
|
8329
|
-
return await
|
|
8353
|
+
return await J(e).clear(), new X(e.env).purgeGlobalCache(e), e.json({
|
|
8330
8354
|
success: !0,
|
|
8331
8355
|
id: w
|
|
8332
8356
|
});
|
|
@@ -8336,12 +8360,12 @@ Ei.get("/", async (e) => {
|
|
|
8336
8360
|
details: t.message
|
|
8337
8361
|
}, 500);
|
|
8338
8362
|
}
|
|
8339
|
-
}),
|
|
8363
|
+
}), wi.delete("/", async (e) => {
|
|
8340
8364
|
let t = e.get("db"), n = e.req.query("id");
|
|
8341
8365
|
if (!n) return e.json({ error: "Channel ID required" }, 400);
|
|
8342
8366
|
let r = Number(n);
|
|
8343
8367
|
try {
|
|
8344
|
-
return await t.prepare("DELETE FROM channel_trees WHERE channelId = ?").run(r), await t.prepare("DELETE FROM node_channels WHERE channelId = ?").run(r), await t.prepare("DELETE FROM channels WHERE id = ?").run(r), await
|
|
8368
|
+
return await t.prepare("DELETE FROM channel_trees WHERE channelId = ?").run(r), await t.prepare("DELETE FROM node_channels WHERE channelId = ?").run(r), await t.prepare("DELETE FROM channels WHERE id = ?").run(r), await J(e).clear(), new X(e.env).purgeGlobalCache(e), e.json({
|
|
8345
8369
|
success: !0,
|
|
8346
8370
|
deletedSiteId: r
|
|
8347
8371
|
});
|
|
@@ -8354,10 +8378,10 @@ Ei.get("/", async (e) => {
|
|
|
8354
8378
|
});
|
|
8355
8379
|
//#endregion
|
|
8356
8380
|
//#region server/routes/admin/schemas.ts
|
|
8357
|
-
var
|
|
8381
|
+
var Ti = new e(), Ei = null, Di = (e) => {
|
|
8358
8382
|
try {
|
|
8359
|
-
if (!
|
|
8360
|
-
let t =
|
|
8383
|
+
if (!Ei) {
|
|
8384
|
+
let t = ci(e.env?.BUNDLED_DEFINITIONS || kr), n = t.userTemplate || {
|
|
8361
8385
|
id: "userTemplate",
|
|
8362
8386
|
label: "User Account",
|
|
8363
8387
|
fields: {
|
|
@@ -8393,7 +8417,7 @@ var Di = new e(), Oi = null, ki = (e) => {
|
|
|
8393
8417
|
}
|
|
8394
8418
|
}
|
|
8395
8419
|
};
|
|
8396
|
-
|
|
8420
|
+
Ei = {
|
|
8397
8421
|
channelTemplate: t.channelTemplate || null,
|
|
8398
8422
|
treeTemplate: t.treeTemplate || null,
|
|
8399
8423
|
userTemplate: n,
|
|
@@ -8405,7 +8429,7 @@ var Di = new e(), Oi = null, ki = (e) => {
|
|
|
8405
8429
|
blockLayouts: t.blockLayouts || {}
|
|
8406
8430
|
};
|
|
8407
8431
|
}
|
|
8408
|
-
return e.json(
|
|
8432
|
+
return e.json(Ei, 200, { "Cache-Control": "public, max-age=300, stale-while-revalidate=86400" });
|
|
8409
8433
|
} catch (t) {
|
|
8410
8434
|
return console.error("[CMS API] Error loading schemas:", t), e.json({
|
|
8411
8435
|
error: "Failed to load schemas",
|
|
@@ -8413,10 +8437,10 @@ var Di = new e(), Oi = null, ki = (e) => {
|
|
|
8413
8437
|
}, 500);
|
|
8414
8438
|
}
|
|
8415
8439
|
};
|
|
8416
|
-
|
|
8440
|
+
Ti.get("/", Di), Ti.get("/schemas.json", Di);
|
|
8417
8441
|
//#endregion
|
|
8418
8442
|
//#region server/routes/admin/validation.ts
|
|
8419
|
-
var
|
|
8443
|
+
var Oi = new e(), ki = {
|
|
8420
8444
|
node: "content_nodes",
|
|
8421
8445
|
nodes: "content_nodes",
|
|
8422
8446
|
content_node: "content_nodes",
|
|
@@ -8428,7 +8452,7 @@ var Ai = new e(), ji = {
|
|
|
8428
8452
|
user: "users",
|
|
8429
8453
|
users: "users",
|
|
8430
8454
|
user_account: "user_accounts"
|
|
8431
|
-
},
|
|
8455
|
+
}, Ai = {
|
|
8432
8456
|
content_nodes: [
|
|
8433
8457
|
"id",
|
|
8434
8458
|
"title",
|
|
@@ -8485,11 +8509,11 @@ var Ai = new e(), ji = {
|
|
|
8485
8509
|
"createdAt"
|
|
8486
8510
|
]
|
|
8487
8511
|
};
|
|
8488
|
-
|
|
8512
|
+
Oi.post("/validate-unique", async (e) => {
|
|
8489
8513
|
try {
|
|
8490
8514
|
let t = e.get("db"), { entityType: n, field: r, value: i, excludeId: a } = await e.req.json();
|
|
8491
8515
|
if (!r || i == null || String(i).trim() === "") return e.json({ isUnique: !0 });
|
|
8492
|
-
let o =
|
|
8516
|
+
let o = ki[n] || "content_nodes", s = r.replace(/[^a-zA-Z0-9_]/g, ""), c = (Ai[o] || Ai.content_nodes).includes(s), l = -1;
|
|
8493
8517
|
if (a != null && String(a).trim() !== "") {
|
|
8494
8518
|
let e = Number(a);
|
|
8495
8519
|
l = isNaN(e) ? String(a) : e;
|
|
@@ -8501,7 +8525,7 @@ Ai.post("/validate-unique", async (e) => {
|
|
|
8501
8525
|
} catch (t) {
|
|
8502
8526
|
return console.error("[API Validation] Error validating global uniqueness:", t), e.json({ error: "Failed to validate uniqueness" }, 500);
|
|
8503
8527
|
}
|
|
8504
|
-
}),
|
|
8528
|
+
}), Oi.post("/validate-unique-sibling", async (e) => {
|
|
8505
8529
|
try {
|
|
8506
8530
|
let t = e.get("db"), { slug: n, treeId: r, parentId: i, excludeTreeNodeId: a } = await e.req.json();
|
|
8507
8531
|
if (!n || !String(n).trim() || !r) return e.json({ isUnique: !0 });
|
|
@@ -8528,8 +8552,8 @@ Ai.post("/validate-unique", async (e) => {
|
|
|
8528
8552
|
});
|
|
8529
8553
|
//#endregion
|
|
8530
8554
|
//#region server/routes/admin/stats.ts
|
|
8531
|
-
var
|
|
8532
|
-
|
|
8555
|
+
var ji = new e();
|
|
8556
|
+
ji.get("/", async (e) => {
|
|
8533
8557
|
try {
|
|
8534
8558
|
let t = e.get("db"), n = await t.prepare("\n SELECT \n COUNT(*) as total,\n SUM(CASE WHEN isHidden = 0 THEN 1 ELSE 0 END) as published,\n SUM(CASE WHEN isHidden = 1 THEN 1 ELSE 0 END) as hidden\n FROM content_nodes\n ").get(), r = Number(n?.total) || 0, i = Number(n?.published) || 0, a = Number(n?.hidden) || 0, o = await t.prepare("\n SELECT \n (SELECT COUNT(*) FROM channels) as totalChannels,\n (SELECT COUNT(*) FROM trees) as totalTrees,\n (SELECT COUNT(*) FROM users) as totalUsers\n ").get(), s = await t.prepare("\n SELECT contentType as type, COUNT(*) as count \n FROM content_nodes \n GROUP BY contentType \n ORDER BY count DESC\n ").all(), c = Array.isArray(s) ? s : s?.results || [], l = await t.prepare("\n SELECT id, title, slug, contentType, isHidden, status, updatedAt \n FROM content_nodes \n ORDER BY updatedAt DESC \n LIMIT 5\n ").all(), u = (Array.isArray(l) ? l : l?.results || []).map((e) => ({
|
|
8535
8559
|
...e,
|
|
@@ -8544,7 +8568,7 @@ Ni.get("/", async (e) => {
|
|
|
8544
8568
|
isHidden: !!e.isHidden,
|
|
8545
8569
|
channelNames: e.channelLabels ? e.channelLabels.split(",") : [],
|
|
8546
8570
|
treeNames: e.treeLabels ? e.treeLabels.split(",") : []
|
|
8547
|
-
})), p = e.env?.BUNDLED_DEFINITIONS, m =
|
|
8571
|
+
})), p = e.env?.BUNDLED_DEFINITIONS, m = ci(p), h = m.nodes || m.nodeSchemas || {}, g = c.map((e) => {
|
|
8548
8572
|
let t = e.type || "node", n = h[t]?.label || t.charAt(0).toUpperCase() + t.slice(1);
|
|
8549
8573
|
return {
|
|
8550
8574
|
type: t,
|
|
@@ -8572,7 +8596,7 @@ Ni.get("/", async (e) => {
|
|
|
8572
8596
|
});
|
|
8573
8597
|
//#endregion
|
|
8574
8598
|
//#region server/routes/admin/assets.ts
|
|
8575
|
-
var
|
|
8599
|
+
var Mi = new e();
|
|
8576
8600
|
async function Q(e, t, n = []) {
|
|
8577
8601
|
let r = e.prepare(t);
|
|
8578
8602
|
if (typeof r.bind == "function") {
|
|
@@ -8585,19 +8609,19 @@ async function Q(e, t, n = []) {
|
|
|
8585
8609
|
}
|
|
8586
8610
|
return [];
|
|
8587
8611
|
}
|
|
8588
|
-
async function
|
|
8612
|
+
async function Ni(e, t, n = []) {
|
|
8589
8613
|
let r = e.prepare(t);
|
|
8590
8614
|
if (typeof r.bind == "function") return await r.bind(...n).run();
|
|
8591
8615
|
if (typeof r.run == "function") return await r.run(...n);
|
|
8592
8616
|
}
|
|
8593
|
-
function
|
|
8617
|
+
function Pi(e, t, n) {
|
|
8594
8618
|
let r = e || (t ? `/media/${t}` : "");
|
|
8595
8619
|
return r && n && r.startsWith(`https://${n}/`) && !r.includes("/media/") && (r = r.replace(`https://${n}/`, `https://${n}/media/`)), r;
|
|
8596
8620
|
}
|
|
8597
|
-
async function
|
|
8598
|
-
let r = new
|
|
8621
|
+
async function Fi(e, t, n) {
|
|
8622
|
+
let r = new X(e.env), i = await Q(t, "\n SELECT cdnUrl, storageKeyPrivate\n FROM assets\n WHERE id = ? OR parentAssetId = ?\n ", [n, n]), a = [];
|
|
8599
8623
|
for (let t of i) {
|
|
8600
|
-
let n =
|
|
8624
|
+
let n = Pi(t.cdnUrl, t.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8601
8625
|
n && a.push(n);
|
|
8602
8626
|
}
|
|
8603
8627
|
let o = await Q(t, "\n SELECT DISTINCT cn.id, cn.slug, cn.status\n FROM node_assets na\n INNER JOIN content_nodes cn ON na.nodeId = cn.id\n LEFT JOIN assets crop ON na.assetId = crop.id\n WHERE cn.status = 'published' AND (\n na.assetId = ?\n OR crop.parentAssetId = ?\n OR crop.id = (SELECT parentAssetId FROM assets WHERE id = ?)\n )\n ", [
|
|
@@ -8607,7 +8631,7 @@ async function Ii(e, t, n) {
|
|
|
8607
8631
|
]);
|
|
8608
8632
|
if (o.length !== 0) for (let n of o) n.id && r.purgeSmart(e, t, n.id, n.slug, a);
|
|
8609
8633
|
}
|
|
8610
|
-
|
|
8634
|
+
Mi.get("/", async (e) => {
|
|
8611
8635
|
try {
|
|
8612
8636
|
let t = u(e), { search: n = "", type: r = "all", page: i = "1", limit: a = "24", sort: o = "createdAt", order: s = "DESC", nodeId: c, channelId: l, trashed: d } = e.req.query(), f = Math.max(1, parseInt(i, 10) || 1), p = Math.max(1, Math.min(100, parseInt(a, 10) || 24)), m = (f - 1) * p, h = {
|
|
8613
8637
|
createdAt: "a.createdAt",
|
|
@@ -8674,7 +8698,7 @@ Z.get("/", async (e) => {
|
|
|
8674
8698
|
...JSON.parse(t.dataJson || "{}")
|
|
8675
8699
|
};
|
|
8676
8700
|
} catch {}
|
|
8677
|
-
let r =
|
|
8701
|
+
let r = Pi(t.cdnUrl, t.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8678
8702
|
return {
|
|
8679
8703
|
id: t.id,
|
|
8680
8704
|
filename: t.filename || "Untitled Asset",
|
|
@@ -8698,9 +8722,9 @@ Z.get("/", async (e) => {
|
|
|
8698
8722
|
details: t.message || String(t)
|
|
8699
8723
|
}, 500);
|
|
8700
8724
|
}
|
|
8701
|
-
}),
|
|
8725
|
+
}), Mi.post("/upload", async (e) => {
|
|
8702
8726
|
try {
|
|
8703
|
-
let t = u(e), n =
|
|
8727
|
+
let t = u(e), n = ni(e.env), r = await e.req.parseBody(), i = r.file, a = r.isVariant === "true" || r.isVariant === "1" || r.temporary === "true", o = r.parentAssetId || r.parentAsset, s = typeof o == "string" && o.trim().length > 0 ? o.trim() : null;
|
|
8704
8728
|
s && (await Q(t, "SELECT id FROM assets WHERE id = ?", [s])).length === 0 && (s = null);
|
|
8705
8729
|
let c = r.cropCoordinates, l = null, d = null;
|
|
8706
8730
|
if (c) {
|
|
@@ -8717,7 +8741,7 @@ Z.get("/", async (e) => {
|
|
|
8717
8741
|
let y = e.env.CDN_DOMAIN, b = v.replace(/^\//, ""), x = y ? `https://${y}/media/${b}` : `/media/${b}`, S = i.type || "application/octet-stream", C = i.size || 0, w = e.get("userId"), T = typeof w == "string" && w.trim().length > 0 ? w : null;
|
|
8718
8742
|
T && (await Q(t, "SELECT id FROM users WHERE id = ?", [T])).length === 0 && (T = null);
|
|
8719
8743
|
let E = +!!h;
|
|
8720
|
-
await
|
|
8744
|
+
await Ni(t, "\n INSERT INTO assets (id, filename, mimeType, sizeBytes, storageKeyPrivate, cdnUrl, createdById, isSystemVariant, parentAssetId, cropCoordinatesJson)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n ", [
|
|
8721
8745
|
p,
|
|
8722
8746
|
i.name,
|
|
8723
8747
|
S,
|
|
@@ -8732,7 +8756,7 @@ Z.get("/", async (e) => {
|
|
|
8732
8756
|
let D = x;
|
|
8733
8757
|
if (s) {
|
|
8734
8758
|
let n = await Q(t, "SELECT cdnUrl, storageKeyPrivate FROM assets WHERE id = ?", [s]);
|
|
8735
|
-
n.length > 0 && (D =
|
|
8759
|
+
n.length > 0 && (D = Pi(n[0].cdnUrl, n[0].storageKeyPrivate, y)), await Fi(e, t, s);
|
|
8736
8760
|
}
|
|
8737
8761
|
return e.json({
|
|
8738
8762
|
id: p,
|
|
@@ -8751,7 +8775,7 @@ Z.get("/", async (e) => {
|
|
|
8751
8775
|
details: t.message || String(t)
|
|
8752
8776
|
}, 500);
|
|
8753
8777
|
}
|
|
8754
|
-
}),
|
|
8778
|
+
}), Mi.get("/:id/details", async (e) => {
|
|
8755
8779
|
try {
|
|
8756
8780
|
let t = u(e), n = e.req.param("id"), r = await Q(t, "SELECT * FROM assets WHERE id = ?", [n]);
|
|
8757
8781
|
if (!r || r.length === 0) return e.json({ error: "Asset not found" }, 404);
|
|
@@ -8774,7 +8798,7 @@ Z.get("/", async (e) => {
|
|
|
8774
8798
|
...JSON.parse(i.dataJson || "{}")
|
|
8775
8799
|
};
|
|
8776
8800
|
} catch {}
|
|
8777
|
-
let l =
|
|
8801
|
+
let l = Pi(i.cdnUrl, i.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8778
8802
|
return e.json({
|
|
8779
8803
|
id: i.id,
|
|
8780
8804
|
filename: i.filename,
|
|
@@ -8801,7 +8825,7 @@ Z.get("/", async (e) => {
|
|
|
8801
8825
|
createdAt: t.createdAt,
|
|
8802
8826
|
parentAssetId: t.parentAssetId || i.id,
|
|
8803
8827
|
cropCoordinates: n,
|
|
8804
|
-
url:
|
|
8828
|
+
url: Pi(t.cdnUrl, t.storageKeyPrivate, e.env?.CDN_DOMAIN),
|
|
8805
8829
|
originalUrl: l
|
|
8806
8830
|
};
|
|
8807
8831
|
})
|
|
@@ -8809,7 +8833,7 @@ Z.get("/", async (e) => {
|
|
|
8809
8833
|
} catch (t) {
|
|
8810
8834
|
return console.error("❌ [Asset Details Error]:", t), e.json({ error: "Failed to load details" }, 500);
|
|
8811
8835
|
}
|
|
8812
|
-
}),
|
|
8836
|
+
}), Mi.put("/:id", async (e) => {
|
|
8813
8837
|
try {
|
|
8814
8838
|
let t = u(e), n = e.req.param("id"), r = await e.req.json(), i = await Q(t, "SELECT filename, dataJson FROM assets WHERE id = ?", [n]);
|
|
8815
8839
|
if (!i || i.length === 0) return e.json({ error: "Asset not found" }, 404);
|
|
@@ -8817,18 +8841,18 @@ Z.get("/", async (e) => {
|
|
|
8817
8841
|
try {
|
|
8818
8842
|
o = JSON.parse(a.dataJson || "{}");
|
|
8819
8843
|
} catch {}
|
|
8820
|
-
return r.title !== void 0 && (o.title = r.title), r.alt !== void 0 && (o.alt = r.alt), r.description !== void 0 && (o.description = r.description), await
|
|
8844
|
+
return r.title !== void 0 && (o.title = r.title), r.alt !== void 0 && (o.alt = r.alt), r.description !== void 0 && (o.description = r.description), await Ni(t, "UPDATE assets SET filename = ?, dataJson = ?, updatedAt = CURRENT_TIMESTAMP WHERE id = ?", [
|
|
8821
8845
|
r.filename === void 0 ? a.filename : r.filename,
|
|
8822
8846
|
JSON.stringify(o),
|
|
8823
8847
|
n
|
|
8824
|
-
]), await
|
|
8848
|
+
]), await Fi(e, t, n), e.json({ success: !0 });
|
|
8825
8849
|
} catch (t) {
|
|
8826
8850
|
return console.error("❌ [Asset Update Error]:", t), e.json({ error: "Failed to update asset" }, 500);
|
|
8827
8851
|
}
|
|
8828
|
-
}),
|
|
8852
|
+
}), Mi.delete("/:id", async (e) => {
|
|
8829
8853
|
try {
|
|
8830
8854
|
let t = u(e), n = e.req.param("id"), r = (await Q(t, "SELECT id, filename, isSystemVariant FROM assets WHERE id = ?", [n]))[0];
|
|
8831
|
-
return r ? (await
|
|
8855
|
+
return r ? (await Fi(e, t, n), r.isSystemVariant ? await Ni(t, "UPDATE assets SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?", [n]) : await Ni(t, "UPDATE assets\n SET deletedAt = CURRENT_TIMESTAMP\n WHERE id = ? OR parentAssetId = ? OR (isSystemVariant = 1 AND (filename LIKE ? OR filename LIKE ?))", [
|
|
8832
8856
|
n,
|
|
8833
8857
|
n,
|
|
8834
8858
|
`crop_%${r.filename ? r.filename.replace(/\.[^/.]+$/, "") : ""}%`,
|
|
@@ -8844,17 +8868,17 @@ Z.get("/", async (e) => {
|
|
|
8844
8868
|
details: t.message || String(t)
|
|
8845
8869
|
}, 500);
|
|
8846
8870
|
}
|
|
8847
|
-
}),
|
|
8871
|
+
}), Mi.post("/restore", async (e) => {
|
|
8848
8872
|
try {
|
|
8849
8873
|
let t = u(e), n = await e.req.json(), r = n.id || n.assetId;
|
|
8850
8874
|
if (!r) return e.json({ error: "Asset ID required" }, 400);
|
|
8851
8875
|
let i = (await Q(t, "SELECT id, filename FROM assets WHERE id = ?", [r]))[0];
|
|
8852
|
-
return i ? (await
|
|
8876
|
+
return i ? (await Ni(t, "UPDATE assets \n SET deletedAt = NULL \n WHERE id = ? OR parentAssetId = ? OR (isSystemVariant = 1 AND (filename LIKE ? OR filename LIKE ?))", [
|
|
8853
8877
|
r,
|
|
8854
8878
|
r,
|
|
8855
8879
|
`crop_%${i.filename ? i.filename.replace(/\.[^/.]+$/, "") : ""}%`,
|
|
8856
8880
|
`%${r}%`
|
|
8857
|
-
]), await
|
|
8881
|
+
]), await Fi(e, t, r), e.json({
|
|
8858
8882
|
success: !0,
|
|
8859
8883
|
id: r,
|
|
8860
8884
|
restored: !0
|
|
@@ -8865,11 +8889,11 @@ Z.get("/", async (e) => {
|
|
|
8865
8889
|
details: t.message
|
|
8866
8890
|
}, 500);
|
|
8867
8891
|
}
|
|
8868
|
-
}),
|
|
8892
|
+
}), Mi.delete("/purge/:id", async (e) => {
|
|
8869
8893
|
try {
|
|
8870
|
-
let t = u(e), n =
|
|
8894
|
+
let t = u(e), n = ni(e.env), r = e.req.param("id"), i = (await Q(t, "SELECT id, filename, storageKeyPrivate, isSystemVariant FROM assets WHERE id = ?", [r]))[0];
|
|
8871
8895
|
if (!i) return e.json({ error: "Asset not found" }, 404);
|
|
8872
|
-
await
|
|
8896
|
+
await Fi(e, t, r);
|
|
8873
8897
|
let a = [i];
|
|
8874
8898
|
i.isSystemVariant || (a = [i, ...await Q(t, "SELECT id, storageKeyPrivate FROM assets \n WHERE parentAssetId = ? OR (isSystemVariant = 1 AND (filename LIKE ? OR filename LIKE ?))", [
|
|
8875
8899
|
r,
|
|
@@ -8885,7 +8909,7 @@ Z.get("/", async (e) => {
|
|
|
8885
8909
|
}
|
|
8886
8910
|
}
|
|
8887
8911
|
let s = o.map(() => "?").join(",");
|
|
8888
|
-
return await
|
|
8912
|
+
return await Ni(t, `DELETE FROM node_assets WHERE assetId IN (${s})`, o), await Ni(t, `DELETE FROM assets WHERE id IN (${s})`, o), e.json({
|
|
8889
8913
|
success: !0,
|
|
8890
8914
|
id: r,
|
|
8891
8915
|
purged: !0,
|
|
@@ -8901,8 +8925,8 @@ Z.get("/", async (e) => {
|
|
|
8901
8925
|
});
|
|
8902
8926
|
//#endregion
|
|
8903
8927
|
//#region server/routes/public/node.ts
|
|
8904
|
-
var
|
|
8905
|
-
function
|
|
8928
|
+
var Ii = new e();
|
|
8929
|
+
function Li() {
|
|
8906
8930
|
return {
|
|
8907
8931
|
fullPath: /* @__PURE__ */ new Map(),
|
|
8908
8932
|
treeEdges: /* @__PURE__ */ new Map(),
|
|
@@ -8910,10 +8934,10 @@ function Ri() {
|
|
|
8910
8934
|
assetUrls: /* @__PURE__ */ new Map()
|
|
8911
8935
|
};
|
|
8912
8936
|
}
|
|
8913
|
-
function
|
|
8937
|
+
function Ri(...e) {
|
|
8914
8938
|
return e.map((e) => String(e ?? "")).join(":");
|
|
8915
8939
|
}
|
|
8916
|
-
function
|
|
8940
|
+
function zi(e, t) {
|
|
8917
8941
|
let n = Date.now();
|
|
8918
8942
|
if (e && String(e).trim() !== "") {
|
|
8919
8943
|
let t = Date.parse(e);
|
|
@@ -8925,7 +8949,7 @@ function Bi(e, t) {
|
|
|
8925
8949
|
}
|
|
8926
8950
|
return !0;
|
|
8927
8951
|
}
|
|
8928
|
-
async function
|
|
8952
|
+
async function Bi(e, t, n) {
|
|
8929
8953
|
let r = t.filter((e) => e.componentId === "content-feed" || e.componentId === "article-list");
|
|
8930
8954
|
await Promise.all(r.map(async (t) => {
|
|
8931
8955
|
let r = t.data || {}, i = r.nodeType || "article", a = Number(r.limit) || 12, o = r.sortBy || "updatedAt", s = "FROM content_nodes WHERE contentType = ? AND isHidden = 0 AND (status = 'published' OR status IS NULL)", c = [i];
|
|
@@ -8946,7 +8970,7 @@ async function Vi(e, t, n) {
|
|
|
8946
8970
|
if (e.dataJson) try {
|
|
8947
8971
|
t = typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson;
|
|
8948
8972
|
} catch {}
|
|
8949
|
-
return
|
|
8973
|
+
return zi(t.startShowingAt, t.stopShowingAt) ? {
|
|
8950
8974
|
id: e.id,
|
|
8951
8975
|
title: e.title,
|
|
8952
8976
|
slug: e.slug,
|
|
@@ -8963,7 +8987,7 @@ async function Vi(e, t, n) {
|
|
|
8963
8987
|
}
|
|
8964
8988
|
}));
|
|
8965
8989
|
}
|
|
8966
|
-
async function
|
|
8990
|
+
async function Vi(e, t, n, r, i = !1, a) {
|
|
8967
8991
|
if (!t) return { blocks: [] };
|
|
8968
8992
|
let o = await e.prepare("\n WITH RECURSIVE ancestor_path(id, contentId, title, slug, parentId, level) AS (\n SELECT t.id, t.contentId, c.title, c.slug, t.parentId, 0\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE t.id = ? OR c.id = ?\n\n UNION ALL\n\n SELECT t.id, t.contentId, c.title, c.slug, t.parentId, ap.level + 1\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n INNER JOIN ancestor_path ap ON t.id = ap.parentId\n )\n SELECT *\n FROM ancestor_path\n ORDER BY level ASC\n ").all(t, t), s = Array.isArray(o) ? o : o?.results || [];
|
|
8969
8993
|
if (!s || s.length === 0) return { blocks: [] };
|
|
@@ -9019,10 +9043,10 @@ async function Hi(e, t, n, r, i = !1, a) {
|
|
|
9019
9043
|
try {
|
|
9020
9044
|
a = (typeof t.dataJson == "string" ? JSON.parse(t.dataJson) : t.dataJson) || {};
|
|
9021
9045
|
} catch {}
|
|
9022
|
-
let o = a.hidden === !0 || a.hidden === 1 || a.hidden === "1" || a.hidden === "true", s =
|
|
9046
|
+
let o = a.hidden === !0 || a.hidden === 1 || a.hidden === "1" || a.hidden === "true", s = zi(a.startShowingAt, a.stopShowingAt);
|
|
9023
9047
|
if (!i && (o || !s)) return null;
|
|
9024
|
-
let c = t.elementType || t.componentId || "text-block", l = r.blocks?.[c]?.fields || r.elements?.[c]?.fields || r.components?.[c]?.fields || {}, u = String(a.blockId || a._instanceId || a.id || t.blockId || t.id), d =
|
|
9025
|
-
return d = await
|
|
9048
|
+
let c = t.elementType || t.componentId || "text-block", l = r.blocks?.[c]?.fields || r.elements?.[c]?.fields || r.components?.[c]?.fields || {}, u = String(a.blockId || a._instanceId || a.id || t.blockId || t.id), d = Hi(a, l);
|
|
9049
|
+
return d = await oi(e, d), d = Ui(d), d.blockId = u, {
|
|
9026
9050
|
region: t.region || n,
|
|
9027
9051
|
block: {
|
|
9028
9052
|
instanceId: t.id,
|
|
@@ -9042,7 +9066,7 @@ async function Hi(e, t, n, r, i = !1, a) {
|
|
|
9042
9066
|
}
|
|
9043
9067
|
return { blocks: [] };
|
|
9044
9068
|
}
|
|
9045
|
-
function
|
|
9069
|
+
function Hi(e, t = {}) {
|
|
9046
9070
|
let n = {};
|
|
9047
9071
|
for (let [r, i] of Object.entries(e)) {
|
|
9048
9072
|
if (r.endsWith("_meta") || r === "disabledRegions" || r === "hidden" || r === "is_hidden" || r === "isHidden" || r === "status" || r === "startShowingAt" || r === "stopShowingAt" || r === "slug" || r === "title" || r === "id" || r.startsWith("_")) continue;
|
|
@@ -9051,14 +9075,14 @@ function Ui(e, t = {}) {
|
|
|
9051
9075
|
}
|
|
9052
9076
|
return n;
|
|
9053
9077
|
}
|
|
9054
|
-
function
|
|
9055
|
-
if (Array.isArray(e)) return e.map(
|
|
9078
|
+
function Ui(e) {
|
|
9079
|
+
if (Array.isArray(e)) return e.map(Ui);
|
|
9056
9080
|
if (!e || typeof e != "object") return e;
|
|
9057
9081
|
if (typeof e.id == "string" && e.id.startsWith("ast_") && typeof e.url == "string") {
|
|
9058
9082
|
let t = e.metadataOverrides || {}, n = e.variants && typeof e.variants == "object" ? e.variants : {}, r = Object.entries(n).find(([, t]) => t?.id === e.id)?.[0], i = r ? {
|
|
9059
9083
|
...t,
|
|
9060
9084
|
...t.crops?.[r] || {}
|
|
9061
|
-
} : t, a = Object.fromEntries(Object.entries(n).filter(([, t]) => t?.id !== e.id).map(([t, n]) => [t,
|
|
9085
|
+
} : t, a = Object.fromEntries(Object.entries(n).filter(([, t]) => t?.id !== e.id).map(([t, n]) => [t, Ui({
|
|
9062
9086
|
...n,
|
|
9063
9087
|
title: n?.title ?? e.title ?? "",
|
|
9064
9088
|
alt: n?.alt ?? e.alt ?? "",
|
|
@@ -9072,9 +9096,9 @@ function Wi(e) {
|
|
|
9072
9096
|
...Object.keys(a).length > 0 ? { variants: a } : {}
|
|
9073
9097
|
};
|
|
9074
9098
|
}
|
|
9075
|
-
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e,
|
|
9099
|
+
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Ui(t)]));
|
|
9076
9100
|
}
|
|
9077
|
-
async function
|
|
9101
|
+
async function Wi(e, t, n) {
|
|
9078
9102
|
if (typeof t == "string") {
|
|
9079
9103
|
if (!t.includes("#node:") && !t.includes("data-node-id") && !t.includes("#asset:") && !t.includes("data-asset-id")) return t;
|
|
9080
9104
|
let r = (e, t) => {
|
|
@@ -9100,9 +9124,9 @@ async function Gi(e, t, n) {
|
|
|
9100
9124
|
return await Promise.all(Array.from(t.matchAll(h)).map(async (t) => {
|
|
9101
9125
|
let i = t[1], a = r(i, "data-node-id"), o = r(i, "data-tree-id");
|
|
9102
9126
|
if (!a || !o) return;
|
|
9103
|
-
let s = await
|
|
9127
|
+
let s = await Ki(e, a, o, n);
|
|
9104
9128
|
if (s?.treeNodeId) {
|
|
9105
|
-
let t = await
|
|
9129
|
+
let t = await Xi(e, String(s.treeNodeId), o, n);
|
|
9106
9130
|
m.set(`${a}:${o}`, t);
|
|
9107
9131
|
}
|
|
9108
9132
|
})), t.replace(h, (e, t) => {
|
|
@@ -9122,39 +9146,39 @@ async function Gi(e, t, n) {
|
|
|
9122
9146
|
return /href\s*=\s*["'][^"']*["']/i.test(_) ? _ = _.replace(/href\s*=\s*["'][^"']*["']/i, `href="${g || "/"}"`) : _ += ` href="${g || "/"}"`, `<a ${_}>`;
|
|
9123
9147
|
});
|
|
9124
9148
|
}
|
|
9125
|
-
if (Array.isArray(t)) return Promise.all(t.map((t) =>
|
|
9149
|
+
if (Array.isArray(t)) return Promise.all(t.map((t) => Wi(e, t, n)));
|
|
9126
9150
|
if (t && typeof t == "object") {
|
|
9127
9151
|
if (typeof t.href == "string" && (t.href.startsWith("#node:") || t.href.startsWith("#asset:"))) return {
|
|
9128
9152
|
...t,
|
|
9129
|
-
href: await
|
|
9153
|
+
href: await Gi(e, t, n)
|
|
9130
9154
|
};
|
|
9131
|
-
let r = await Promise.all(Object.entries(t).map(async ([t, r]) => [t, await
|
|
9155
|
+
let r = await Promise.all(Object.entries(t).map(async ([t, r]) => [t, await Wi(e, r, n)]));
|
|
9132
9156
|
return Object.fromEntries(r);
|
|
9133
9157
|
}
|
|
9134
9158
|
return t;
|
|
9135
9159
|
}
|
|
9136
|
-
async function
|
|
9160
|
+
async function Gi(e, t, n) {
|
|
9137
9161
|
let r = t.href.match(/^#node:(.+)$/), i = t.href.match(/^#asset:(.+)$/);
|
|
9138
|
-
if (i) return
|
|
9162
|
+
if (i) return Ji(e, i[1], n);
|
|
9139
9163
|
if (!r) return t.href;
|
|
9140
9164
|
let a = r[1];
|
|
9141
9165
|
if (t.treeId) {
|
|
9142
|
-
let r = await
|
|
9166
|
+
let r = await Ki(e, a, String(t.treeId), n);
|
|
9143
9167
|
if (r?.treeNodeId) {
|
|
9144
|
-
let i = await
|
|
9168
|
+
let i = await Xi(e, String(r.treeNodeId), String(t.treeId), n);
|
|
9145
9169
|
if (i) return i;
|
|
9146
9170
|
}
|
|
9147
9171
|
}
|
|
9148
|
-
let o = await
|
|
9172
|
+
let o = await qi(e, a, n);
|
|
9149
9173
|
return o === void 0 ? "#" : `/${o}`;
|
|
9150
9174
|
}
|
|
9151
|
-
async function
|
|
9152
|
-
let i =
|
|
9175
|
+
async function Ki(e, t, n, r) {
|
|
9176
|
+
let i = Ri(t, n), a = r.treeEdges.get(i);
|
|
9153
9177
|
if (a) return a;
|
|
9154
9178
|
let o = e.prepare("\n SELECT id as treeNodeId\n FROM tree_nodes\n WHERE contentId = ?\n AND treeId = ?\n LIMIT 1\n ").get(t, n);
|
|
9155
9179
|
return r.treeEdges.set(i, Promise.resolve(o)), o;
|
|
9156
9180
|
}
|
|
9157
|
-
async function
|
|
9181
|
+
async function qi(e, t, n) {
|
|
9158
9182
|
let r = String(t), i = n.nodeSlugs.get(r);
|
|
9159
9183
|
if (i) return i;
|
|
9160
9184
|
let a = (async () => {
|
|
@@ -9163,7 +9187,7 @@ async function Ji(e, t, n) {
|
|
|
9163
9187
|
})();
|
|
9164
9188
|
return n.nodeSlugs.set(r, a), a;
|
|
9165
9189
|
}
|
|
9166
|
-
async function
|
|
9190
|
+
async function Ji(e, t, n) {
|
|
9167
9191
|
let r = String(t), i = n.assetUrls.get(r);
|
|
9168
9192
|
if (i) return i;
|
|
9169
9193
|
let a = (async () => {
|
|
@@ -9172,7 +9196,7 @@ async function Yi(e, t, n) {
|
|
|
9172
9196
|
})();
|
|
9173
9197
|
return n.assetUrls.set(r, a), a;
|
|
9174
9198
|
}
|
|
9175
|
-
function
|
|
9199
|
+
function Yi(e) {
|
|
9176
9200
|
let t = e.socialImage;
|
|
9177
9201
|
if (!t || typeof t != "object") return null;
|
|
9178
9202
|
let n = (e, t) => {
|
|
@@ -9203,9 +9227,9 @@ function Xi(e) {
|
|
|
9203
9227
|
])
|
|
9204
9228
|
};
|
|
9205
9229
|
}
|
|
9206
|
-
async function
|
|
9230
|
+
async function Xi(e, t, n, r) {
|
|
9207
9231
|
if (!t) return "";
|
|
9208
|
-
let i =
|
|
9232
|
+
let i = Ri(t, n);
|
|
9209
9233
|
if (r) {
|
|
9210
9234
|
let e = r.fullPath.get(i);
|
|
9211
9235
|
if (e) return e;
|
|
@@ -9220,7 +9244,7 @@ async function Zi(e, t, n, r) {
|
|
|
9220
9244
|
})();
|
|
9221
9245
|
return r && r.fullPath.set(i, a), a;
|
|
9222
9246
|
}
|
|
9223
|
-
async function
|
|
9247
|
+
async function Zi(e, t, n, r, i) {
|
|
9224
9248
|
let a = {}, o = null;
|
|
9225
9249
|
if (t) {
|
|
9226
9250
|
let n = await e.prepare("\n WITH RECURSIVE ancestor_path(id, contentId, title, slug, parentId, level) AS (\n SELECT t.id, t.contentId, c.title, c.slug, t.parentId, 0\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE t.id = ? OR c.id = ?\n\n UNION ALL\n\n SELECT t.id, t.contentId, c.title, c.slug, t.parentId, ap.level + 1\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n INNER JOIN ancestor_path ap ON t.id = ap.parentId\n )\n SELECT c.dataJson, c.draftDataJson\n FROM ancestor_path ap\n INNER JOIN content_nodes c ON ap.contentId = c.id\n ORDER BY ap.level ASC\n ").all(t, t), i = Array.isArray(n) ? n : n?.results || [], s = /* @__PURE__ */ new Set([
|
|
@@ -9258,29 +9282,29 @@ async function Qi(e, t, n, r, i) {
|
|
|
9258
9282
|
inheritedFields: a
|
|
9259
9283
|
};
|
|
9260
9284
|
}
|
|
9261
|
-
function
|
|
9285
|
+
function Qi(e) {
|
|
9262
9286
|
let t = Number(e?.env?.CMS_NODE_CACHE_TTL);
|
|
9263
9287
|
return Number.isFinite(t) && t >= 60 ? Math.floor(t) : 300;
|
|
9264
9288
|
}
|
|
9265
|
-
async function
|
|
9289
|
+
async function $i(e, t, n, r) {
|
|
9266
9290
|
try {
|
|
9267
9291
|
await e.set(t, n, r);
|
|
9268
9292
|
} catch (e) {
|
|
9269
9293
|
console.warn("[CMS Cache] Failed to write node response to cache:", e);
|
|
9270
9294
|
}
|
|
9271
9295
|
}
|
|
9272
|
-
|
|
9296
|
+
Ii.get("/*", async (e) => {
|
|
9273
9297
|
try {
|
|
9274
|
-
let t = e.get("db"), n =
|
|
9298
|
+
let t = e.get("db"), n = Li(), r = new URL(e.req.url).pathname.match(/\/node\/(.+)$/), i = (r ? r[1] : "home").replace(/^\/+|\/+$/g, ""), a = e.req.query("channelId") || e.req.query("channel") || "1", o = e.req.query("lang") || "en", s = e.req.query("preview") === "true", c = isNaN(Number(a)) ? await t.prepare("SELECT * FROM channels WHERE key = ?").get(a) : await t.prepare("SELECT * FROM channels WHERE id = ?").get(Number(a));
|
|
9275
9299
|
if (!c) return e.json({ error: `Channel '${a}' not found` }, 404);
|
|
9276
9300
|
let l = c.status === "disabled" || c.status === "inactive" || c.isEnabled === 0 || c.isEnabled === !1;
|
|
9277
9301
|
if (!s && l) return e.json({ error: `Channel '${c.key || a}' is currently inactive` }, 404);
|
|
9278
|
-
let u = c.id, d = c.key || a, f =
|
|
9302
|
+
let u = c.id, d = c.key || a, f = J(e), p = `node:${u || d}:${o}:${i}`;
|
|
9279
9303
|
if (!s) {
|
|
9280
9304
|
let t = await f.get(p);
|
|
9281
9305
|
if (t) return e.header("X-Cache", "HIT"), e.json(t);
|
|
9282
9306
|
}
|
|
9283
|
-
let m =
|
|
9307
|
+
let m = li(e.env?.BUNDLED_DEFINITIONS), h = /^\d+$/.test(i), g = null, _ = null, v = e.req.query("treeId"), y = i.split("/"), b = y[y.length - 1], x = "/" + i.replace(/^\/+|\/+$/g, ""), S = `
|
|
9284
9308
|
SELECT
|
|
9285
9309
|
cn.*,
|
|
9286
9310
|
tn.id as treeNodeId,
|
|
@@ -9296,7 +9320,7 @@ Li.get("/*", async (e) => {
|
|
|
9296
9320
|
if (T.length > 0) {
|
|
9297
9321
|
let e = await Promise.all(T.map(async (e) => ({
|
|
9298
9322
|
candidate: e,
|
|
9299
|
-
calculatedPath: await
|
|
9323
|
+
calculatedPath: await Xi(t, String(e.treeNodeId), String(e.treeId), n)
|
|
9300
9324
|
}))), r = x.replace(/^\/+|\/+$/g, "");
|
|
9301
9325
|
for (let { candidate: t, calculatedPath: n } of e) {
|
|
9302
9326
|
let e = n.replace(/^\/+|\/+$/g, "");
|
|
@@ -9320,7 +9344,7 @@ Li.get("/*", async (e) => {
|
|
|
9320
9344
|
LIMIT 1
|
|
9321
9345
|
`).get(...e);
|
|
9322
9346
|
}
|
|
9323
|
-
let E = _?.treeId || v || "main-nav", D = _?.parentId || null, ee = _?.treeNodeId ? await
|
|
9347
|
+
let E = _?.treeId || v || "main-nav", D = _?.parentId || null, ee = _?.treeNodeId ? await Xi(t, String(_.treeNodeId), String(E), n) : `/${(g.slug || "").replace(/^\/+|\/+$/g, "")}`, O = {
|
|
9324
9348
|
id: g.id,
|
|
9325
9349
|
title: g.title,
|
|
9326
9350
|
slug: g.slug,
|
|
@@ -9338,13 +9362,13 @@ Li.get("/*", async (e) => {
|
|
|
9338
9362
|
j = typeof oe == "string" ? JSON.parse(oe) : oe;
|
|
9339
9363
|
} catch {}
|
|
9340
9364
|
j.disabledRegions && (ne = j.disabledRegions), ae = j.hidden === !0 || j.hidden === 1 || j.hidden === "1" || j.hidden === "true", re = j.startShowingAt || null, ie = j.stopShowingAt || null;
|
|
9341
|
-
let M = j.layoutId, se = M && M !== "inherit", { resolvedLayoutId: ce, inheritedFields: le } = await
|
|
9365
|
+
let M = j.layoutId, se = M && M !== "inherit", { resolvedLayoutId: ce, inheritedFields: le } = await Zi(t, D, E, s, te), ue = se ? M : ce || A.defaultLayout || null;
|
|
9342
9366
|
for (let [e, t] of Object.entries(le)) (j[e] === void 0 || j[e] === null || j[e] === "" || j[e] === "inherit") && t !== void 0 && (j[e] = t);
|
|
9343
|
-
let N = await
|
|
9344
|
-
N =
|
|
9345
|
-
let P =
|
|
9367
|
+
let N = await oi(t, Hi(j, te));
|
|
9368
|
+
N = Ui(N), N = await Wi(t, N, n);
|
|
9369
|
+
let P = Yi(N);
|
|
9346
9370
|
delete N.socialImage, delete N.fbImage, delete N.xImage, delete N.whatsappImage, P && (N.socialImages = P), O.slug = g.slug, O.title = g.title, Object.assign(O, N), O.layoutId = ue;
|
|
9347
|
-
let de = Number(g.isHidden) === 1 || ae, fe = !
|
|
9371
|
+
let de = Number(g.isHidden) === 1 || ae, fe = !zi(re, ie);
|
|
9348
9372
|
if (!s && (de || fe)) return e.json({ error: "Node is hidden or outside its scheduled publishing window" }, 404);
|
|
9349
9373
|
let pe = [];
|
|
9350
9374
|
if (_?.treeNodeId) {
|
|
@@ -9354,7 +9378,7 @@ Li.get("/*", async (e) => {
|
|
|
9354
9378
|
try {
|
|
9355
9379
|
t = (typeof n == "string" ? JSON.parse(n) : n) || {};
|
|
9356
9380
|
} catch {}
|
|
9357
|
-
let i = Number(e.isHidden) === 1 || t.hidden === !0 || t.hidden === 1 || t.hidden === "1", a =
|
|
9381
|
+
let i = Number(e.isHidden) === 1 || t.hidden === !0 || t.hidden === 1 || t.hidden === "1", a = zi(t.startShowingAt, t.stopShowingAt), o = (e.slug || "").replace(/^\/+|\/+$/g, "");
|
|
9358
9382
|
return !s && (i || !a) ? null : {
|
|
9359
9383
|
treeNodeId: e.treeNodeId,
|
|
9360
9384
|
id: e.id,
|
|
@@ -9374,10 +9398,10 @@ Li.get("/*", async (e) => {
|
|
|
9374
9398
|
try {
|
|
9375
9399
|
i = (typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson) || {};
|
|
9376
9400
|
} catch {}
|
|
9377
|
-
let a = i.hidden === !0 || i.hidden === 1 || i.hidden === "1" || i.hidden === "true", o =
|
|
9401
|
+
let a = i.hidden === !0 || i.hidden === 1 || i.hidden === "1" || i.hidden === "true", o = zi(i.startShowingAt, i.stopShowingAt);
|
|
9378
9402
|
if (!s && (a || !o)) return null;
|
|
9379
|
-
let c = e.elementType || e.componentId || "text-block", l = m.blocks?.[c]?.fields || m.elements?.[c]?.fields || m.components?.[c]?.fields || {}, u = String(i.blockId || i._instanceId || i.id || e.blockId || e.id), d =
|
|
9380
|
-
return d = await
|
|
9403
|
+
let c = e.elementType || e.componentId || "text-block", l = m.blocks?.[c]?.fields || m.elements?.[c]?.fields || m.components?.[c]?.fields || {}, u = String(i.blockId || i._instanceId || i.id || e.blockId || e.id), d = Hi(i, l);
|
|
9404
|
+
return d = await oi(t, d), d = Ui(d), d = await Wi(t, d, n), d.blockId = u, {
|
|
9381
9405
|
region: r,
|
|
9382
9406
|
block: {
|
|
9383
9407
|
instanceId: e.id,
|
|
@@ -9402,7 +9426,7 @@ Li.get("/*", async (e) => {
|
|
|
9402
9426
|
for (let [e, r] of Object.entries(_e)) {
|
|
9403
9427
|
let i = I[e] && I[e].length > 0, a = !!ne[e];
|
|
9404
9428
|
if (I[e] || (I[e] = [], L[e] = { isInherited: !1 }), (r?.inherit === "parent" || r?.inherit === !0 || r?.inherit === "true" || e === "header" || e === "footer") && !i && !a && D) {
|
|
9405
|
-
let r = await
|
|
9429
|
+
let r = await Vi(t, D, e, m, s, n);
|
|
9406
9430
|
if (r.blocks.length > 0 && (I[e] = r.blocks, L[e] = {
|
|
9407
9431
|
isInherited: !0,
|
|
9408
9432
|
inheritedFromId: r.inheritedFromId,
|
|
@@ -9414,7 +9438,7 @@ Li.get("/*", async (e) => {
|
|
|
9414
9438
|
});
|
|
9415
9439
|
}
|
|
9416
9440
|
}
|
|
9417
|
-
await Promise.all(Object.keys(I).map((e) =>
|
|
9441
|
+
await Promise.all(Object.keys(I).map((e) => Bi(t, I[e], u)));
|
|
9418
9442
|
let ve = {
|
|
9419
9443
|
channelId: u || d,
|
|
9420
9444
|
treeId: E,
|
|
@@ -9423,7 +9447,7 @@ Li.get("/*", async (e) => {
|
|
|
9423
9447
|
content: I,
|
|
9424
9448
|
regionMeta: L
|
|
9425
9449
|
};
|
|
9426
|
-
return s || (e.header("X-Cache", "MISS"), await
|
|
9450
|
+
return s || (e.header("X-Cache", "MISS"), await $i(f, p, ve, Qi(e))), e.json(ve);
|
|
9427
9451
|
} catch (t) {
|
|
9428
9452
|
console.error("[CMS Public API] Error fetching node by path:", t);
|
|
9429
9453
|
let n = e.env?.ENVIRONMENT === "development";
|
|
@@ -9435,8 +9459,8 @@ Li.get("/*", async (e) => {
|
|
|
9435
9459
|
});
|
|
9436
9460
|
//#endregion
|
|
9437
9461
|
//#region server/routes/public/tree.ts
|
|
9438
|
-
var
|
|
9439
|
-
function
|
|
9462
|
+
var ea = new e();
|
|
9463
|
+
function ta(e, t) {
|
|
9440
9464
|
let n = /* @__PURE__ */ new Date();
|
|
9441
9465
|
if (e && String(e).trim() !== "") {
|
|
9442
9466
|
let t = new Date(e);
|
|
@@ -9448,14 +9472,14 @@ function na(e, t) {
|
|
|
9448
9472
|
}
|
|
9449
9473
|
return !0;
|
|
9450
9474
|
}
|
|
9451
|
-
async function
|
|
9475
|
+
async function na(e, t, n, r) {
|
|
9452
9476
|
try {
|
|
9453
9477
|
await e.set(t, n, r);
|
|
9454
9478
|
} catch (e) {
|
|
9455
9479
|
console.warn("[CMS Cache] Failed to write tree response to cache:", e);
|
|
9456
9480
|
}
|
|
9457
9481
|
}
|
|
9458
|
-
|
|
9482
|
+
ea.get("/:treeParam", async (e) => {
|
|
9459
9483
|
try {
|
|
9460
9484
|
let t = e.get("db"), n = e.req.param("treeParam"), r = e.req.query("channelId") || e.req.query("channel") || "default", i = e.req.query("preview") === "true";
|
|
9461
9485
|
if (r && r !== "default" && r !== "all") {
|
|
@@ -9465,7 +9489,7 @@ ta.get("/:treeParam", async (e) => {
|
|
|
9465
9489
|
if (!i && t) return e.json({ error: `Channel '${n.key || r}' is currently inactive` }, 404);
|
|
9466
9490
|
}
|
|
9467
9491
|
}
|
|
9468
|
-
let a =
|
|
9492
|
+
let a = J(e), o = `tree:${r}:${n}`;
|
|
9469
9493
|
if (!i) {
|
|
9470
9494
|
let t = await a.get(o);
|
|
9471
9495
|
if (t) return e.header("X-Cache", "HIT"), e.json(t);
|
|
@@ -9474,7 +9498,7 @@ ta.get("/:treeParam", async (e) => {
|
|
|
9474
9498
|
if (c && Number(c.isHidden) === 1 && !i) return e.json({ error: `Tree '${n}' is hidden` }, 404);
|
|
9475
9499
|
let l = c?.id || (s ? Number(n) : null), u = {};
|
|
9476
9500
|
if (c && c.dataJson) try {
|
|
9477
|
-
let t = typeof c.dataJson == "string" ? JSON.parse(c.dataJson) : c.dataJson, r = e.env?.BUNDLED_DEFINITIONS, i =
|
|
9501
|
+
let t = typeof c.dataJson == "string" ? JSON.parse(c.dataJson) : c.dataJson, r = e.env?.BUNDLED_DEFINITIONS, i = li(r), a = (i.trees?.[c.treeType || n] || i.trees?.site || {}).fields || {};
|
|
9478
9502
|
for (let [e, n] of Object.entries(t)) a[e]?.public === !0 && (u[e] = n);
|
|
9479
9503
|
} catch (e) {
|
|
9480
9504
|
console.warn("[CMS Public Tree API] Failed to parse tree dataJson", e);
|
|
@@ -9509,7 +9533,7 @@ ta.get("/:treeParam", async (e) => {
|
|
|
9509
9533
|
return (f.get(n) || []).map((e) => {
|
|
9510
9534
|
let n = p.get(String(e.treeNodeId)) || {}, r = {};
|
|
9511
9535
|
for (let [e, t] of Object.entries(n)) e !== "_isTreeDraft" && e !== "_draftParentId" && e !== "isNew" && e !== "hidden" && e !== "is_hidden" && e !== "isHidden" && e !== "status" && (r[e] = t);
|
|
9512
|
-
let a = !i && (e.status === "draft" || e.status === "new"), o = Number(e.isHidden) === 1 || a || n.hidden === !0 || n.hidden === 1 || n.hidden === "1" || n.hidden === "true", s =
|
|
9536
|
+
let a = !i && (e.status === "draft" || e.status === "new"), o = Number(e.isHidden) === 1 || a || n.hidden === !0 || n.hidden === 1 || n.hidden === "1" || n.hidden === "true", s = ta(n.startShowingAt, n.stopShowingAt), c = (e.slug || "").replace(/^\/+|\/+$/g, ""), l = (!e.parentId || e.parentId === "null" || e.parentId === "") && (c === "home" || c === "homee") ? "/" : `${t}/${c}`.replace(/\/+/g, "/"), u = {
|
|
9513
9537
|
id: e.id,
|
|
9514
9538
|
treeNodeId: e.treeNodeId,
|
|
9515
9539
|
parentId: e.parentId || null,
|
|
@@ -9534,7 +9558,7 @@ ta.get("/:treeParam", async (e) => {
|
|
|
9534
9558
|
...u,
|
|
9535
9559
|
items: m(null)
|
|
9536
9560
|
};
|
|
9537
|
-
return i || (e.header("X-Cache", "MISS"), await
|
|
9561
|
+
return i || (e.header("X-Cache", "MISS"), await na(a, o, h, 300)), e.json(h);
|
|
9538
9562
|
} catch (t) {
|
|
9539
9563
|
return console.error("[CMS Public Tree API] Error:", t), e.json({
|
|
9540
9564
|
error: "Failed to fetch public tree",
|
|
@@ -9544,8 +9568,8 @@ ta.get("/:treeParam", async (e) => {
|
|
|
9544
9568
|
});
|
|
9545
9569
|
//#endregion
|
|
9546
9570
|
//#region server/routes/public/assets.ts
|
|
9547
|
-
var
|
|
9548
|
-
function
|
|
9571
|
+
var ra = new e();
|
|
9572
|
+
function ia(e, t) {
|
|
9549
9573
|
if (t === "webp") return "image/webp";
|
|
9550
9574
|
if (t === "avif") return "image/avif";
|
|
9551
9575
|
if (t === "jpeg" || t === "jpg") return "image/jpeg";
|
|
@@ -9553,7 +9577,7 @@ function aa(e, t) {
|
|
|
9553
9577
|
let n = e.toLowerCase();
|
|
9554
9578
|
return n.endsWith(".jpg") || n.endsWith(".jpeg") ? "image/jpeg" : n.endsWith(".png") ? "image/png" : n.endsWith(".webp") ? "image/webp" : n.endsWith(".gif") ? "image/gif" : n.endsWith(".svg") ? "image/svg+xml" : n.endsWith(".pdf") ? "application/pdf" : n.endsWith(".mp4") ? "video/mp4" : n.endsWith(".webm") ? "video/webm" : "application/octet-stream";
|
|
9555
9579
|
}
|
|
9556
|
-
|
|
9580
|
+
ra.get("/*", async (e) => {
|
|
9557
9581
|
let t = e.req.path.replace(/^\/media\//, "").replace(/^\//, "");
|
|
9558
9582
|
if (!t) return e.text("Asset key missing", 400);
|
|
9559
9583
|
let n = e.env?.MEDIA_BUCKET, { w: r, h: i, q: a, f: o } = e.req.query(), s = !!(r || i || a || o), c = e.req.header("Accept") || "", l = "";
|
|
@@ -9576,7 +9600,7 @@ ia.get("/*", async (e) => {
|
|
|
9576
9600
|
c = await n.get(e);
|
|
9577
9601
|
}
|
|
9578
9602
|
if (!c) return e.text(`Asset not found: ${t}`, 404);
|
|
9579
|
-
let d = c.httpMetadata?.contentType ||
|
|
9603
|
+
let d = c.httpMetadata?.contentType || ia(t), m = d.startsWith("image/") && !d.includes("svg"), g = !1;
|
|
9580
9604
|
if (s && m && e.env?.IMAGES) {
|
|
9581
9605
|
g = !0;
|
|
9582
9606
|
try {
|
|
@@ -9639,7 +9663,7 @@ ia.get("/*", async (e) => {
|
|
|
9639
9663
|
if (!s) {
|
|
9640
9664
|
let n = _(C);
|
|
9641
9665
|
return e.body(n, 200, {
|
|
9642
|
-
"Content-Type":
|
|
9666
|
+
"Content-Type": ia(t),
|
|
9643
9667
|
"Cache-Control": "public, max-age=86400"
|
|
9644
9668
|
});
|
|
9645
9669
|
}
|
|
@@ -9647,7 +9671,7 @@ ia.get("/*", async (e) => {
|
|
|
9647
9671
|
if (g(f)) {
|
|
9648
9672
|
let n = _(f);
|
|
9649
9673
|
return e.body(n, 200, {
|
|
9650
|
-
"Content-Type":
|
|
9674
|
+
"Content-Type": ia(t, u),
|
|
9651
9675
|
"Cache-Control": "public, max-age=31536000, immutable",
|
|
9652
9676
|
"X-Local-Cache": "HIT"
|
|
9653
9677
|
});
|
|
@@ -9660,14 +9684,14 @@ ia.get("/*", async (e) => {
|
|
|
9660
9684
|
typeof n == "number" && (a.width = n), typeof o == "number" && (a.height = o), (a.width || a.height) && (a.fit = "cover", i = i.resize(a)), u === "webp" ? i = i.webp({ quality: typeof c == "number" ? c : 80 }) : u === "avif" ? i = i.avif({ quality: typeof c == "number" ? c : 70 }) : u === "jpeg" || u === "jpg" ? i = i.jpeg({ quality: typeof c == "number" ? c : 80 }) : u === "png" && (i = i.png({ quality: typeof c == "number" ? c : 80 }));
|
|
9661
9685
|
let s = await i.toBuffer();
|
|
9662
9686
|
return v(x(f), { recursive: !0 }), y(f, s), e.body(s, 200, {
|
|
9663
|
-
"Content-Type":
|
|
9687
|
+
"Content-Type": ia(t, u),
|
|
9664
9688
|
"Cache-Control": "public, max-age=31536000, immutable",
|
|
9665
9689
|
"X-Local-Cache": "MISS"
|
|
9666
9690
|
});
|
|
9667
9691
|
} catch {
|
|
9668
9692
|
let n = _(C);
|
|
9669
9693
|
return e.body(n, 200, {
|
|
9670
|
-
"Content-Type":
|
|
9694
|
+
"Content-Type": ia(t),
|
|
9671
9695
|
"Cache-Control": "public, max-age=86400"
|
|
9672
9696
|
});
|
|
9673
9697
|
}
|
|
@@ -9678,8 +9702,8 @@ ia.get("/*", async (e) => {
|
|
|
9678
9702
|
});
|
|
9679
9703
|
//#endregion
|
|
9680
9704
|
//#region server/routes/public/paths.ts
|
|
9681
|
-
var
|
|
9682
|
-
function
|
|
9705
|
+
var aa = new e();
|
|
9706
|
+
function oa(e, t) {
|
|
9683
9707
|
let n = /* @__PURE__ */ new Date();
|
|
9684
9708
|
if (e && String(e).trim() !== "") {
|
|
9685
9709
|
let t = new Date(e);
|
|
@@ -9691,7 +9715,7 @@ function sa(e, t) {
|
|
|
9691
9715
|
}
|
|
9692
9716
|
return !0;
|
|
9693
9717
|
}
|
|
9694
|
-
|
|
9718
|
+
aa.get("/", async (e) => {
|
|
9695
9719
|
try {
|
|
9696
9720
|
let t = await e.get("db").prepare("\n SELECT\n t.id as treeNodeId,\n t.parentId,\n c.slug,\n c.contentType as nodeType,\n c.status,\n c.dataJson\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE (c.deletedAt IS NULL OR c.deletedAt = '')\n ORDER BY t.sortOrder ASC\n ").all(), n = Array.isArray(t) ? t : t?.results || [], r = [], i = /* @__PURE__ */ new Map();
|
|
9697
9721
|
for (let e of n) {
|
|
@@ -9715,7 +9739,7 @@ oa.get("/", async (e) => {
|
|
|
9715
9739
|
function o(e = null, t = "") {
|
|
9716
9740
|
let n = e == null || e === "" || e === "null" ? "__ROOT__" : String(e), s = i.get(n) || [];
|
|
9717
9741
|
for (let e of s) {
|
|
9718
|
-
let n = a.get(String(e.treeNodeId)) || {}, i = e.status === "published" || e.status === "active", s =
|
|
9742
|
+
let n = a.get(String(e.treeNodeId)) || {}, i = e.status === "published" || e.status === "active", s = oa(n.startShowingAt, n.stopShowingAt);
|
|
9719
9743
|
if (!i || !s) continue;
|
|
9720
9744
|
let c = (e.slug || "").replace(/^\/+|\/+$/g, ""), l = c === "home" || c === "homee" ? "/" : `${t}/${c}`.replace(/\/+/g, "/");
|
|
9721
9745
|
e.nodeType !== "external-link" && r.push(l);
|
|
@@ -9732,7 +9756,7 @@ oa.get("/", async (e) => {
|
|
|
9732
9756
|
});
|
|
9733
9757
|
//#endregion
|
|
9734
9758
|
//#region server/index.ts
|
|
9735
|
-
var $ = new e(),
|
|
9759
|
+
var $ = new e(), sa = !1;
|
|
9736
9760
|
$.use("*", o()), $.use("/media/*", o({
|
|
9737
9761
|
origin: "*",
|
|
9738
9762
|
allowMethods: [
|
|
@@ -9753,13 +9777,13 @@ $.use("*", o()), $.use("/media/*", o({
|
|
|
9753
9777
|
let n = new URL(e.req.url), r = (e.req.header("host") || n.hostname).split(":")[0];
|
|
9754
9778
|
e.set("currentDomain", r);
|
|
9755
9779
|
let i = u(e);
|
|
9756
|
-
if (e.set("db", i), !
|
|
9757
|
-
await
|
|
9780
|
+
if (e.set("db", i), !sa) try {
|
|
9781
|
+
await Nr(i), sa = !0;
|
|
9758
9782
|
} catch (e) {
|
|
9759
9783
|
console.error("❌ [CMS Server] Failed to initialize system tables on cold start:", e);
|
|
9760
9784
|
}
|
|
9761
9785
|
await t();
|
|
9762
|
-
}), $.route("/media",
|
|
9786
|
+
}), $.route("/media", ra), $.use("/media/*", Ir()), $.route("/api/cms/nodes", Z), $.route("/api/cms/nodes.json", Z), $.route("/api/cms/formcsv", Z), $.route("/api/cms/formcsv.json", Z), $.route("/api/cms/stats", ji), $.route("/api/cms/stats.json", ji), $.route("/api/cms", bi), $.route("/api/cms/channels", wi), $.route("/api/cms/channels.json", wi), $.route("/api/cms/schemas", Ti), $.route("/api/cms/schemas.json", Ti), $.route("/api/cms", Oi), $.route("/api/admin/assets", Mi), $.route("/api/v1/node", Ii), $.route("/api/v1/page", Ii), $.route("/api/v1/tree", ea), $.route("/api/v1/all-paths", aa), $.get("*", async (e) => {
|
|
9763
9787
|
if (e.env?.ASSETS) {
|
|
9764
9788
|
let t = await e.env.ASSETS.fetch(e.req.raw);
|
|
9765
9789
|
if (t.status === 404) {
|