@brightsideoy/kama 0.1.0-alpha.57 → 0.1.0-alpha.59
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/index.js
CHANGED
|
@@ -1142,11 +1142,11 @@ function et({ indent: e, options: { commentString: t } }, n, r, i) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
//#region node_modules/yaml/browser/dist/nodes/YAMLMap.js
|
|
1145
|
-
function
|
|
1145
|
+
function tt(e, t) {
|
|
1146
1146
|
let n = S(t) ? t.value : t;
|
|
1147
1147
|
for (let r of e) if (x(r) && (r.key === t || r.key === n || S(r.key) && r.key.value === n)) return r;
|
|
1148
1148
|
}
|
|
1149
|
-
var
|
|
1149
|
+
var B = class extends ye {
|
|
1150
1150
|
static get tagName() {
|
|
1151
1151
|
return "tag:yaml.org,2002:map";
|
|
1152
1152
|
}
|
|
@@ -1166,7 +1166,7 @@ var V = class extends ye {
|
|
|
1166
1166
|
add(e, t) {
|
|
1167
1167
|
let n;
|
|
1168
1168
|
n = x(e) ? e : !e || typeof e != "object" || !("key" in e) ? new z(e, e?.value) : new z(e.key, e.value);
|
|
1169
|
-
let r =
|
|
1169
|
+
let r = tt(this.items, n.key), i = this.schema?.sortMapEntries;
|
|
1170
1170
|
if (r) {
|
|
1171
1171
|
if (!t) throw Error(`Key ${n.key} already set`);
|
|
1172
1172
|
S(r.value) && pe(n.value) ? r.value.value = n.value : r.value = n.value;
|
|
@@ -1176,15 +1176,15 @@ var V = class extends ye {
|
|
|
1176
1176
|
} else this.items.push(n);
|
|
1177
1177
|
}
|
|
1178
1178
|
delete(e) {
|
|
1179
|
-
let t =
|
|
1179
|
+
let t = tt(this.items, e);
|
|
1180
1180
|
return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
|
|
1181
1181
|
}
|
|
1182
1182
|
get(e, t) {
|
|
1183
|
-
let n =
|
|
1183
|
+
let n = tt(this.items, e)?.value;
|
|
1184
1184
|
return (!t && S(n) ? n.value : n) ?? void 0;
|
|
1185
1185
|
}
|
|
1186
1186
|
has(e) {
|
|
1187
|
-
return !!
|
|
1187
|
+
return !!tt(this.items, e);
|
|
1188
1188
|
}
|
|
1189
1189
|
set(e, t) {
|
|
1190
1190
|
this.add(new z(e, t), !0);
|
|
@@ -1209,16 +1209,16 @@ var V = class extends ye {
|
|
|
1209
1209
|
onComment: t
|
|
1210
1210
|
});
|
|
1211
1211
|
}
|
|
1212
|
-
},
|
|
1212
|
+
}, nt = {
|
|
1213
1213
|
collection: "map",
|
|
1214
1214
|
default: !0,
|
|
1215
|
-
nodeClass:
|
|
1215
|
+
nodeClass: B,
|
|
1216
1216
|
tag: "tag:yaml.org,2002:map",
|
|
1217
1217
|
resolve(e, t) {
|
|
1218
1218
|
return b(e) || t("Expected a mapping for this tag"), e;
|
|
1219
1219
|
},
|
|
1220
|
-
createNode: (e, t, n) =>
|
|
1221
|
-
},
|
|
1220
|
+
createNode: (e, t, n) => B.from(e, t, n)
|
|
1221
|
+
}, V = class extends ye {
|
|
1222
1222
|
static get tagName() {
|
|
1223
1223
|
return "tag:yaml.org,2002:seq";
|
|
1224
1224
|
}
|
|
@@ -1229,21 +1229,21 @@ var V = class extends ye {
|
|
|
1229
1229
|
this.items.push(e);
|
|
1230
1230
|
}
|
|
1231
1231
|
delete(e) {
|
|
1232
|
-
let t =
|
|
1232
|
+
let t = rt(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 = rt(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 = rt(e);
|
|
1243
1243
|
return typeof t == "number" && t < this.items.length;
|
|
1244
1244
|
}
|
|
1245
1245
|
set(e, t) {
|
|
1246
|
-
let n =
|
|
1246
|
+
let n = rt(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) && pe(t) ? r.value = t : this.items[n] = t;
|
|
@@ -1282,22 +1282,22 @@ var V = class extends ye {
|
|
|
1282
1282
|
return i;
|
|
1283
1283
|
}
|
|
1284
1284
|
};
|
|
1285
|
-
function
|
|
1285
|
+
function rt(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 it = {
|
|
1292
1292
|
collection: "seq",
|
|
1293
1293
|
default: !0,
|
|
1294
|
-
nodeClass:
|
|
1294
|
+
nodeClass: V,
|
|
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) => V.from(e, t, n)
|
|
1300
|
+
}, at = {
|
|
1301
1301
|
identify: (e) => typeof e == "string",
|
|
1302
1302
|
default: !0,
|
|
1303
1303
|
tag: "tag:yaml.org,2002:str",
|
|
@@ -1305,27 +1305,27 @@ var rt = {
|
|
|
1305
1305
|
stringify(e, t, n, r) {
|
|
1306
1306
|
return t = Object.assign({ actualString: !0 }, t), Ie(e, t, n, r);
|
|
1307
1307
|
}
|
|
1308
|
-
},
|
|
1308
|
+
}, ot = {
|
|
1309
1309
|
identify: (e) => e == null,
|
|
1310
1310
|
createNode: () => new I(null),
|
|
1311
1311
|
default: !0,
|
|
1312
1312
|
tag: "tag:yaml.org,2002:null",
|
|
1313
1313
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1314
1314
|
resolve: () => new I(null),
|
|
1315
|
-
stringify: ({ source: e }, t) => typeof e == "string" &&
|
|
1316
|
-
},
|
|
1315
|
+
stringify: ({ source: e }, t) => typeof e == "string" && ot.test.test(e) ? e : t.options.nullStr
|
|
1316
|
+
}, st = {
|
|
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 I(e[0] === "t" || e[0] === "T"),
|
|
1322
1322
|
stringify({ source: e, value: t }, n) {
|
|
1323
|
-
return e &&
|
|
1323
|
+
return e && st.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 H({ 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 U({ 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 ct = {
|
|
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: H
|
|
1350
|
+
}, lt = {
|
|
1351
1351
|
identify: (e) => typeof e == "number",
|
|
1352
1352
|
default: !0,
|
|
1353
1353
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1356,9 +1356,9 @@ var st = {
|
|
|
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() : H(e);
|
|
1360
1360
|
}
|
|
1361
|
-
},
|
|
1361
|
+
}, ut = {
|
|
1362
1362
|
identify: (e) => typeof e == "number",
|
|
1363
1363
|
default: !0,
|
|
1364
1364
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1367,60 +1367,60 @@ var st = {
|
|
|
1367
1367
|
let t = new I(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: H
|
|
1371
|
+
}, dt = (e) => typeof e == "bigint" || Number.isInteger(e), ft = (e, t, n, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), n);
|
|
1372
|
+
function pt(e, t, n) {
|
|
1373
1373
|
let { value: r } = e;
|
|
1374
|
-
return
|
|
1374
|
+
return dt(r) && r >= 0 ? n + r.toString(t) : H(e);
|
|
1375
1375
|
}
|
|
1376
|
-
var
|
|
1377
|
-
identify: (e) =>
|
|
1376
|
+
var mt = {
|
|
1377
|
+
identify: (e) => dt(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) => ft(e, 2, 8, n),
|
|
1383
|
+
stringify: (e) => pt(e, 8, "0o")
|
|
1384
|
+
}, ht = {
|
|
1385
|
+
identify: dt,
|
|
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) => ft(e, 0, 10, n),
|
|
1390
|
+
stringify: H
|
|
1391
|
+
}, gt = {
|
|
1392
|
+
identify: (e) => dt(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
|
-
},
|
|
1400
|
-
|
|
1401
|
-
rt,
|
|
1397
|
+
resolve: (e, t, n) => ft(e, 2, 16, n),
|
|
1398
|
+
stringify: (e) => pt(e, 16, "0x")
|
|
1399
|
+
}, _t = [
|
|
1400
|
+
nt,
|
|
1402
1401
|
it,
|
|
1403
1402
|
at,
|
|
1404
1403
|
ot,
|
|
1405
|
-
|
|
1404
|
+
st,
|
|
1406
1405
|
mt,
|
|
1407
1406
|
ht,
|
|
1408
|
-
|
|
1407
|
+
gt,
|
|
1409
1408
|
ct,
|
|
1410
|
-
lt
|
|
1409
|
+
lt,
|
|
1410
|
+
ut
|
|
1411
1411
|
];
|
|
1412
1412
|
//#endregion
|
|
1413
1413
|
//#region node_modules/yaml/browser/dist/schema/json/schema.js
|
|
1414
|
-
function
|
|
1414
|
+
function vt(e) {
|
|
1415
1415
|
return typeof e == "bigint" || Number.isInteger(e);
|
|
1416
1416
|
}
|
|
1417
|
-
var
|
|
1417
|
+
var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
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: yt
|
|
1424
1424
|
},
|
|
1425
1425
|
{
|
|
1426
1426
|
identify: (e) => e == null,
|
|
@@ -1429,7 +1429,7 @@ var vt = ({ value: e }) => JSON.stringify(e), yt = [
|
|
|
1429
1429
|
tag: "tag:yaml.org,2002:null",
|
|
1430
1430
|
test: /^null$/,
|
|
1431
1431
|
resolve: () => null,
|
|
1432
|
-
stringify:
|
|
1432
|
+
stringify: yt
|
|
1433
1433
|
},
|
|
1434
1434
|
{
|
|
1435
1435
|
identify: (e) => typeof e == "boolean",
|
|
@@ -1437,15 +1437,15 @@ var vt = ({ value: e }) => JSON.stringify(e), yt = [
|
|
|
1437
1437
|
tag: "tag:yaml.org,2002:bool",
|
|
1438
1438
|
test: /^true$|^false$/,
|
|
1439
1439
|
resolve: (e) => e === "true",
|
|
1440
|
-
stringify:
|
|
1440
|
+
stringify: yt
|
|
1441
1441
|
},
|
|
1442
1442
|
{
|
|
1443
|
-
identify:
|
|
1443
|
+
identify: vt,
|
|
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 }) => vt(e) ? e.toString() : JSON.stringify(e)
|
|
1449
1449
|
},
|
|
1450
1450
|
{
|
|
1451
1451
|
identify: (e) => typeof e == "number",
|
|
@@ -1453,16 +1453,16 @@ var vt = ({ value: e }) => JSON.stringify(e), yt = [
|
|
|
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: yt
|
|
1457
1457
|
}
|
|
1458
|
-
],
|
|
1458
|
+
], xt = [nt, it].concat(bt, {
|
|
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
|
+
}), St = {
|
|
1466
1466
|
identify: (e) => e instanceof Uint8Array,
|
|
1467
1467
|
default: !1,
|
|
1468
1468
|
tag: "tag:yaml.org,2002:binary",
|
|
@@ -1496,7 +1496,7 @@ var vt = ({ value: e }) => JSON.stringify(e), yt = [
|
|
|
1496
1496
|
};
|
|
1497
1497
|
//#endregion
|
|
1498
1498
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
|
|
1499
|
-
function
|
|
1499
|
+
function Ct(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 St(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 wt(e, t, n) {
|
|
1519
|
+
let { replacer: r } = n, i = new V(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,15 +1534,15 @@ function Ct(e, t, n) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
return i;
|
|
1536
1536
|
}
|
|
1537
|
-
var
|
|
1537
|
+
var Tt = {
|
|
1538
1538
|
collection: "seq",
|
|
1539
1539
|
default: !1,
|
|
1540
1540
|
tag: "tag:yaml.org,2002:pairs",
|
|
1541
|
-
resolve:
|
|
1542
|
-
createNode:
|
|
1543
|
-
},
|
|
1541
|
+
resolve: Ct,
|
|
1542
|
+
createNode: wt
|
|
1543
|
+
}, Et = class e extends V {
|
|
1544
1544
|
constructor() {
|
|
1545
|
-
super(), this.add =
|
|
1545
|
+
super(), this.add = B.prototype.add.bind(this), this.delete = B.prototype.delete.bind(this), this.get = B.prototype.get.bind(this), this.has = B.prototype.has.bind(this), this.set = B.prototype.set.bind(this), this.tag = e.tag;
|
|
1546
1546
|
}
|
|
1547
1547
|
toJSON(e, t) {
|
|
1548
1548
|
if (!t) return super.toJSON(e);
|
|
@@ -1556,51 +1556,51 @@ var wt = {
|
|
|
1556
1556
|
return n;
|
|
1557
1557
|
}
|
|
1558
1558
|
static from(e, t, n) {
|
|
1559
|
-
let r =
|
|
1559
|
+
let r = wt(e, t, n), i = new this();
|
|
1560
1560
|
return i.items = r.items, i;
|
|
1561
1561
|
}
|
|
1562
1562
|
};
|
|
1563
|
-
|
|
1564
|
-
var
|
|
1563
|
+
Et.tag = "tag:yaml.org,2002:omap";
|
|
1564
|
+
var Dt = {
|
|
1565
1565
|
collection: "seq",
|
|
1566
1566
|
identify: (e) => e instanceof Map,
|
|
1567
|
-
nodeClass:
|
|
1567
|
+
nodeClass: Et,
|
|
1568
1568
|
default: !1,
|
|
1569
1569
|
tag: "tag:yaml.org,2002:omap",
|
|
1570
1570
|
resolve(e, t) {
|
|
1571
|
-
let n =
|
|
1571
|
+
let n = Ct(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 Et(), n);
|
|
1574
1574
|
},
|
|
1575
|
-
createNode: (e, t, n) =>
|
|
1575
|
+
createNode: (e, t, n) => Et.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 Ot({ value: e, source: t }, n) {
|
|
1580
|
+
return t && (e ? kt : At).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
|
|
1581
1581
|
}
|
|
1582
|
-
var
|
|
1582
|
+
var kt = {
|
|
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 I(!0),
|
|
1588
|
-
stringify:
|
|
1589
|
-
},
|
|
1588
|
+
stringify: Ot
|
|
1589
|
+
}, At = {
|
|
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 I(!1),
|
|
1595
|
-
stringify:
|
|
1596
|
-
},
|
|
1595
|
+
stringify: Ot
|
|
1596
|
+
}, jt = {
|
|
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: H
|
|
1603
|
+
}, Mt = {
|
|
1604
1604
|
identify: (e) => typeof e == "number",
|
|
1605
1605
|
default: !0,
|
|
1606
1606
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1609,9 +1609,9 @@ var Ot = {
|
|
|
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() : H(e);
|
|
1613
1613
|
}
|
|
1614
|
-
},
|
|
1614
|
+
}, Nt = {
|
|
1615
1615
|
identify: (e) => typeof e == "number",
|
|
1616
1616
|
default: !0,
|
|
1617
1617
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1624,9 +1624,9 @@ var Ot = {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
return t;
|
|
1626
1626
|
},
|
|
1627
|
-
stringify:
|
|
1628
|
-
},
|
|
1629
|
-
function
|
|
1627
|
+
stringify: H
|
|
1628
|
+
}, Pt = (e) => typeof e == "bigint" || Number.isInteger(e);
|
|
1629
|
+
function Ft(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,60 +1644,60 @@ function Pt(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 It(e, t, n) {
|
|
1648
1648
|
let { value: r } = e;
|
|
1649
|
-
if (
|
|
1649
|
+
if (Pt(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 H(e);
|
|
1654
1654
|
}
|
|
1655
|
-
var
|
|
1656
|
-
identify:
|
|
1655
|
+
var Lt = {
|
|
1656
|
+
identify: Pt,
|
|
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) => Ft(e, 2, 2, n),
|
|
1662
|
+
stringify: (e) => It(e, 2, "0b")
|
|
1663
|
+
}, Rt = {
|
|
1664
|
+
identify: Pt,
|
|
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) => Ft(e, 1, 8, n),
|
|
1670
|
+
stringify: (e) => It(e, 8, "0")
|
|
1671
|
+
}, zt = {
|
|
1672
|
+
identify: Pt,
|
|
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) => Ft(e, 0, 10, n),
|
|
1677
|
+
stringify: H
|
|
1678
|
+
}, Bt = {
|
|
1679
|
+
identify: Pt,
|
|
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) => Ft(e, 2, 16, n),
|
|
1685
|
+
stringify: (e) => It(e, 16, "0x")
|
|
1686
|
+
}, Vt = class e extends B {
|
|
1687
1687
|
constructor(t) {
|
|
1688
1688
|
super(t), this.tag = e.tag;
|
|
1689
1689
|
}
|
|
1690
1690
|
add(e) {
|
|
1691
1691
|
let t;
|
|
1692
|
-
t = x(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new z(e.key, null) : new z(e, null),
|
|
1692
|
+
t = x(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new z(e.key, null) : new z(e, null), tt(this.items, t.key) || this.items.push(t);
|
|
1693
1693
|
}
|
|
1694
1694
|
get(e, t) {
|
|
1695
|
-
let n =
|
|
1695
|
+
let n = tt(this.items, e);
|
|
1696
1696
|
return !t && x(n) ? S(n.key) ? n.key.value : n.key : n;
|
|
1697
1697
|
}
|
|
1698
1698
|
set(e, t) {
|
|
1699
1699
|
if (typeof t != "boolean") throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
|
|
1700
|
-
let n =
|
|
1700
|
+
let n = tt(this.items, e);
|
|
1701
1701
|
n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new z(e));
|
|
1702
1702
|
}
|
|
1703
1703
|
toJSON(e, t) {
|
|
@@ -1714,17 +1714,17 @@ var It = {
|
|
|
1714
1714
|
return i;
|
|
1715
1715
|
}
|
|
1716
1716
|
};
|
|
1717
|
-
|
|
1718
|
-
var
|
|
1717
|
+
Vt.tag = "tag:yaml.org,2002:set";
|
|
1718
|
+
var Ht = {
|
|
1719
1719
|
collection: "map",
|
|
1720
1720
|
identify: (e) => e instanceof Set,
|
|
1721
|
-
nodeClass:
|
|
1721
|
+
nodeClass: Vt,
|
|
1722
1722
|
default: !1,
|
|
1723
1723
|
tag: "tag:yaml.org,2002:set",
|
|
1724
|
-
createNode: (e, t, n) =>
|
|
1724
|
+
createNode: (e, t, n) => Vt.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 Vt(), 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 Vt = {
|
|
|
1732
1732
|
};
|
|
1733
1733
|
//#endregion
|
|
1734
1734
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
|
|
1735
|
-
function
|
|
1735
|
+
function Ut(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 Wt(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 H(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 Gt = {
|
|
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 }) => Ut(e, n),
|
|
1755
|
+
stringify: Wt
|
|
1756
|
+
}, Kt = {
|
|
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) => Ut(e, !1),
|
|
1763
|
+
stringify: Wt
|
|
1764
|
+
}, qt = {
|
|
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(qt.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 = Ut(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
|
-
},
|
|
1781
|
-
|
|
1782
|
-
rt,
|
|
1780
|
+
}, Jt = [
|
|
1781
|
+
nt,
|
|
1783
1782
|
it,
|
|
1784
1783
|
at,
|
|
1785
|
-
|
|
1784
|
+
ot,
|
|
1786
1785
|
kt,
|
|
1787
|
-
|
|
1786
|
+
At,
|
|
1788
1787
|
Lt,
|
|
1789
1788
|
Rt,
|
|
1790
1789
|
zt,
|
|
1791
|
-
|
|
1790
|
+
Bt,
|
|
1792
1791
|
jt,
|
|
1793
1792
|
Mt,
|
|
1794
|
-
|
|
1793
|
+
Nt,
|
|
1794
|
+
St,
|
|
1795
1795
|
R,
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
Wt,
|
|
1796
|
+
Dt,
|
|
1797
|
+
Tt,
|
|
1798
|
+
Ht,
|
|
1800
1799
|
Gt,
|
|
1801
|
-
Kt
|
|
1802
|
-
|
|
1803
|
-
|
|
1800
|
+
Kt,
|
|
1801
|
+
qt
|
|
1802
|
+
], Yt = /* @__PURE__ */ new Map([
|
|
1803
|
+
["core", _t],
|
|
1804
1804
|
["failsafe", [
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1805
|
+
nt,
|
|
1806
|
+
it,
|
|
1807
|
+
at
|
|
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:
|
|
1823
|
-
map:
|
|
1809
|
+
["json", xt],
|
|
1810
|
+
["yaml11", Jt],
|
|
1811
|
+
["yaml-1.1", Jt]
|
|
1812
|
+
]), Xt = {
|
|
1813
|
+
binary: St,
|
|
1814
|
+
bool: st,
|
|
1815
|
+
float: ut,
|
|
1816
|
+
floatExp: lt,
|
|
1817
|
+
floatNaN: ct,
|
|
1818
|
+
floatTime: Kt,
|
|
1819
|
+
int: ht,
|
|
1820
|
+
intHex: gt,
|
|
1821
|
+
intOct: mt,
|
|
1822
|
+
intTime: Gt,
|
|
1823
|
+
map: nt,
|
|
1824
1824
|
merge: R,
|
|
1825
|
-
null:
|
|
1826
|
-
omap:
|
|
1827
|
-
pairs:
|
|
1828
|
-
seq:
|
|
1829
|
-
set:
|
|
1830
|
-
timestamp:
|
|
1831
|
-
},
|
|
1832
|
-
"tag:yaml.org,2002:binary":
|
|
1825
|
+
null: ot,
|
|
1826
|
+
omap: Dt,
|
|
1827
|
+
pairs: Tt,
|
|
1828
|
+
seq: it,
|
|
1829
|
+
set: Ht,
|
|
1830
|
+
timestamp: qt
|
|
1831
|
+
}, Zt = {
|
|
1832
|
+
"tag:yaml.org,2002:binary": St,
|
|
1833
1833
|
"tag:yaml.org,2002:merge": R,
|
|
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": Dt,
|
|
1835
|
+
"tag:yaml.org,2002:pairs": Tt,
|
|
1836
|
+
"tag:yaml.org,2002:set": Ht,
|
|
1837
|
+
"tag:yaml.org,2002:timestamp": qt
|
|
1838
1838
|
};
|
|
1839
|
-
function
|
|
1840
|
-
let r =
|
|
1839
|
+
function Qt(e, t, n) {
|
|
1840
|
+
let r = Yt.get(t);
|
|
1841
1841
|
if (r && !e) return n && !r.includes(R) ? r.concat(R) : 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(Yt.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(R)), i.reduce((e, t) => {
|
|
1853
|
-
let n = typeof t == "string" ?
|
|
1853
|
+
let n = typeof t == "string" ? Xt[t] : t;
|
|
1854
1854
|
if (!n) {
|
|
1855
|
-
let e = JSON.stringify(t), n = Object.keys(
|
|
1855
|
+
let e = JSON.stringify(t), n = Object.keys(Xt).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 Zt(e, t, n) {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
//#endregion
|
|
1862
1862
|
//#region node_modules/yaml/browser/dist/schema/Schema.js
|
|
1863
|
-
var
|
|
1863
|
+
var $t = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), en = 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) ? Qt(e, "compat") : e ? Qt(null, e) : null, this.name = typeof i == "string" && i || "core", this.knownTags = r ? Zt : {}, this.tags = Qt(t, this.name, n), this.toStringOptions = o ?? null, Object.defineProperty(this, p, { value: nt }), Object.defineProperty(this, h, { value: at }), Object.defineProperty(this, g, { value: it }), this.sortMapEntries = typeof a == "function" ? a : a === !0 ? $t : null;
|
|
1866
1866
|
}
|
|
1867
1867
|
clone() {
|
|
1868
1868
|
let t = Object.create(e.prototype, Object.getOwnPropertyDescriptors(this));
|
|
@@ -1871,7 +1871,7 @@ var Qt = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), $t = class e {
|
|
|
1871
1871
|
};
|
|
1872
1872
|
//#endregion
|
|
1873
1873
|
//#region node_modules/yaml/browser/dist/stringify/stringifyDocument.js
|
|
1874
|
-
function
|
|
1874
|
+
function tn(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 en(e, t) {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
//#endregion
|
|
1911
1911
|
//#region node_modules/yaml/browser/dist/doc/Document.js
|
|
1912
|
-
var
|
|
1912
|
+
var nn = 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 tn = 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
|
+
rn(this.contents) && this.contents.add(e);
|
|
1937
1937
|
}
|
|
1938
1938
|
addIn(e, t) {
|
|
1939
|
-
|
|
1939
|
+
rn(this.contents) && this.contents.addIn(e, t);
|
|
1940
1940
|
}
|
|
1941
1941
|
createAlias(e, t) {
|
|
1942
1942
|
if (!e.anchor) {
|
|
@@ -1967,10 +1967,10 @@ var tn = class e {
|
|
|
1967
1967
|
return new z(this.createNode(e, null, n), this.createNode(t, null, n));
|
|
1968
1968
|
}
|
|
1969
1969
|
delete(e) {
|
|
1970
|
-
return
|
|
1970
|
+
return rn(this.contents) ? this.contents.delete(e) : !1;
|
|
1971
1971
|
}
|
|
1972
1972
|
deleteIn(e) {
|
|
1973
|
-
return ve(e) ? this.contents != null && (this.contents = null, !0) :
|
|
1973
|
+
return ve(e) ? this.contents != null && (this.contents = null, !0) : rn(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 tn = class e {
|
|
|
1985
1985
|
return ve(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 = _e(this.schema, [e], t) :
|
|
1988
|
+
this.contents == null ? this.contents = _e(this.schema, [e], t) : rn(this.contents) && this.contents.set(e, t);
|
|
1989
1989
|
}
|
|
1990
1990
|
setIn(e, t) {
|
|
1991
|
-
ve(e) ? this.contents = t : this.contents == null ? this.contents = _e(this.schema, Array.from(e), t) :
|
|
1991
|
+
ve(e) ? this.contents = t : this.contents == null ? this.contents = _e(this.schema, Array.from(e), t) : rn(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 tn = 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 en(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 tn = 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 tn(this, e);
|
|
2049
2049
|
}
|
|
2050
2050
|
};
|
|
2051
|
-
function
|
|
2051
|
+
function rn(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 an = 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
|
+
}, on = class extends an {
|
|
2062
2062
|
constructor(e, t, n) {
|
|
2063
2063
|
super("YAMLParseError", e, t, n);
|
|
2064
2064
|
}
|
|
2065
|
-
},
|
|
2065
|
+
}, sn = class extends an {
|
|
2066
2066
|
constructor(e, t, n) {
|
|
2067
2067
|
super("YAMLWarning", e, t, n);
|
|
2068
2068
|
}
|
|
2069
|
-
},
|
|
2069
|
+
}, cn = (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 rn = class extends Error {
|
|
|
2089
2089
|
};
|
|
2090
2090
|
//#endregion
|
|
2091
2091
|
//#region node_modules/yaml/browser/dist/compose/resolve-props.js
|
|
2092
|
-
function
|
|
2092
|
+
function ln(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 cn(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 un(e) {
|
|
2139
2139
|
if (!e) return null;
|
|
2140
2140
|
switch (e.type) {
|
|
2141
2141
|
case "alias":
|
|
@@ -2153,7 +2153,7 @@ function ln(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 (un(t.key) || un(t.value)) return !0;
|
|
2157
2157
|
}
|
|
2158
2158
|
return !1;
|
|
2159
2159
|
default: return !0;
|
|
@@ -2161,15 +2161,15 @@ function ln(e) {
|
|
|
2161
2161
|
}
|
|
2162
2162
|
//#endregion
|
|
2163
2163
|
//#region node_modules/yaml/browser/dist/compose/util-flow-indent-check.js
|
|
2164
|
-
function
|
|
2164
|
+
function dn(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 === "}") && un(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 fn(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 dn(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
|
|
2182
|
-
let o = new ((a?.nodeClass) ??
|
|
2180
|
+
var pn = "All mapping items must start at the same column";
|
|
2181
|
+
function mn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2182
|
+
let o = new ((a?.nodeClass) ?? B)(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 = ln(l, {
|
|
2187
2187
|
indicator: "explicit-key-ind",
|
|
2188
2188
|
next: u ?? d?.[0],
|
|
2189
2189
|
offset: s,
|
|
@@ -2192,16 +2192,16 @@ function pn({ 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", pn)), !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 || un(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", pn);
|
|
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 && dn(r.indent, u, i), n.atKey = !1, fn(n, o.items, g) && i(h, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2204
|
+
let _ = ln(d ?? [], {
|
|
2205
2205
|
indicator: "map-value-ind",
|
|
2206
2206
|
next: f,
|
|
2207
2207
|
offset: g.range[2],
|
|
@@ -2212,7 +2212,7 @@ function pn({ 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 && dn(r.indent, f, i), s = c.range[2];
|
|
2216
2216
|
let l = new z(g, c);
|
|
2217
2217
|
n.options.keepSourceTokens && (l.srcToken = a), o.items.push(l);
|
|
2218
2218
|
} else {
|
|
@@ -2229,12 +2229,12 @@ function pn({ 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 hn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2233
|
+
let o = new ((a?.nodeClass) ?? V)(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 = ln(a, {
|
|
2238
2238
|
indicator: "seq-item-ind",
|
|
2239
2239
|
next: l,
|
|
2240
2240
|
offset: s,
|
|
@@ -2250,7 +2250,7 @@ function mn({ 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 && dn(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 mn({ 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 gn(e, t, n, r) {
|
|
2264
2264
|
let i = "";
|
|
2265
2265
|
if (e) {
|
|
2266
2266
|
let a = !1, o = "";
|
|
@@ -2291,15 +2291,15 @@ function hn(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 ?
|
|
2294
|
+
var _n = "Block collections are not allowed within flow collections", vn = (e) => e && (e.type === "block-map" || e.type === "block-seq");
|
|
2295
|
+
function yn({ 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 ? B : V))(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 = ln(d, {
|
|
2303
2303
|
flow: s,
|
|
2304
2304
|
indicator: "explicit-key-ind",
|
|
2305
2305
|
next: f ?? p?.[0],
|
|
@@ -2313,7 +2313,7 @@ function vn({ 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 && un(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 vn({ 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], vn(m) && i(r.range, "BLOCK_IN_FLOW", _n);
|
|
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
|
+
vn(f) && i(g.range, "BLOCK_IN_FLOW", _n), n.atKey = !1;
|
|
2341
|
+
let _ = ln(p ?? [], {
|
|
2342
2342
|
flow: s,
|
|
2343
2343
|
indicator: "map-value-ind",
|
|
2344
2344
|
next: m,
|
|
@@ -2360,13 +2360,13 @@ function vn({ 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 ? vn(m) && i(v.range, "BLOCK_IN_FLOW", _n) : _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
|
|
2364
2364
|
let y = new z(g, v);
|
|
2365
2365
|
if (n.options.keepSourceTokens && (y.srcToken = l), o) {
|
|
2366
2366
|
let e = c;
|
|
2367
|
-
|
|
2367
|
+
fn(n, e.items, g) && i(a, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(y);
|
|
2368
2368
|
} else {
|
|
2369
|
-
let e = new
|
|
2369
|
+
let e = new B(n.schema);
|
|
2370
2370
|
e.flow = !0, e.items.push(y);
|
|
2371
2371
|
let t = (v ?? g).range;
|
|
2372
2372
|
e.range = [
|
|
@@ -2385,7 +2385,7 @@ function vn({ 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 = gn(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 vn({ 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 bn(e, t, n, r, i, a) {
|
|
2404
|
+
let o = n.type === "block-map" ? mn(e, t, n, r, a) : n.type === "block-seq" ? hn(e, t, n, r, a) : yn(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 xn(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 ===
|
|
2414
|
+
if (!a || !o || o === "!" || o === B.tagName && s === "map" || o === V.tagName && s === "seq") return bn(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), bn(e, t, n, i, o);
|
|
2420
2420
|
}
|
|
2421
|
-
let l =
|
|
2421
|
+
let l = bn(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 I(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 Sn(e, t, n) {
|
|
2427
|
+
let r = t.offset, i = Cn(t, e.options.strict, n);
|
|
2428
2428
|
if (!i) return {
|
|
2429
2429
|
value: "",
|
|
2430
2430
|
type: null,
|
|
@@ -2435,7 +2435,7 @@ function xn(e, t, n) {
|
|
|
2435
2435
|
r
|
|
2436
2436
|
]
|
|
2437
2437
|
};
|
|
2438
|
-
let a = i.mode === ">" ? I.BLOCK_FOLDED : I.BLOCK_LITERAL, o = t.source ?
|
|
2438
|
+
let a = i.mode === ">" ? I.BLOCK_FOLDED : I.BLOCK_LITERAL, o = t.source ? wn(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 xn(e, t, n) {
|
|
|
2498
2498
|
]
|
|
2499
2499
|
};
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function Cn({ 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 Sn({ offset: e, props: t }, n, r) {
|
|
|
2541
2541
|
length: d
|
|
2542
2542
|
};
|
|
2543
2543
|
}
|
|
2544
|
-
function
|
|
2544
|
+
function wn(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 Tn(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 = I.PLAIN, c =
|
|
2555
|
+
s = I.PLAIN, c = En(a, l);
|
|
2556
2556
|
break;
|
|
2557
2557
|
case "single-quoted-scalar":
|
|
2558
|
-
s = I.QUOTE_SINGLE, c =
|
|
2558
|
+
s = I.QUOTE_SINGLE, c = Dn(a, l);
|
|
2559
2559
|
break;
|
|
2560
2560
|
case "double-quoted-scalar":
|
|
2561
|
-
s = I.QUOTE_DOUBLE, c =
|
|
2561
|
+
s = I.QUOTE_DOUBLE, c = kn(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 wn(e, t, n) {
|
|
|
2572
2572
|
]
|
|
2573
2573
|
};
|
|
2574
2574
|
}
|
|
2575
|
-
let u = r + a.length, d =
|
|
2575
|
+
let u = r + a.length, d = gn(o, u, t, n);
|
|
2576
2576
|
return {
|
|
2577
2577
|
value: c,
|
|
2578
2578
|
type: s,
|
|
@@ -2584,7 +2584,7 @@ function wn(e, t, n) {
|
|
|
2584
2584
|
]
|
|
2585
2585
|
};
|
|
2586
2586
|
}
|
|
2587
|
-
function
|
|
2587
|
+
function En(e, t) {
|
|
2588
2588
|
let n = "";
|
|
2589
2589
|
switch (e[0]) {
|
|
2590
2590
|
/* istanbul ignore next should not happen */
|
|
@@ -2604,12 +2604,12 @@ function Tn(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}`), On(e);
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2610
|
-
return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"),
|
|
2609
|
+
function Dn(e, t) {
|
|
2610
|
+
return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"), On(e.slice(1, -1)).replace(/''/g, "'");
|
|
2611
2611
|
}
|
|
2612
|
-
function
|
|
2612
|
+
function On(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 Dn(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 kn(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 } = An(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 = jn[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 += Mn(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 On(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 An(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 kn(e, t) {
|
|
|
2660
2660
|
offset: t
|
|
2661
2661
|
};
|
|
2662
2662
|
}
|
|
2663
|
-
var
|
|
2663
|
+
var jn = {
|
|
2664
2664
|
0: "\0",
|
|
2665
2665
|
a: "\x07",
|
|
2666
2666
|
b: "\b",
|
|
@@ -2680,7 +2680,7 @@ var An = {
|
|
|
2680
2680
|
"\\": "\\",
|
|
2681
2681
|
" ": " "
|
|
2682
2682
|
};
|
|
2683
|
-
function
|
|
2683
|
+
function Mn(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 jn(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 Nn(e, t, n, r) {
|
|
2695
|
+
let { value: i, type: a, comment: o, range: s } = t.type === "block-scalar" ? Sn(e, t, r) : Tn(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 ? Pn(e.schema, i, c, n, r) : t.type === "scalar" ? Fn(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 Mn(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 Pn(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 Nn(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 Fn({ 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 Pn({ 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 In(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 Fn(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 Ln = {
|
|
2752
|
+
composeNode: Rn,
|
|
2753
|
+
composeEmptyNode: zn
|
|
2754
2754
|
};
|
|
2755
|
-
function
|
|
2755
|
+
function Rn(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 = Bn(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 = Nn(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 = xn(Ln, 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 ??= zn(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 zn(e, t, n, r, { spaceBefore: i, comment: a, anchor: o, tag: s, end: c }, l) {
|
|
2781
|
+
let u = Nn(e, {
|
|
2782
2782
|
type: "scalar",
|
|
2783
|
-
offset:
|
|
2783
|
+
offset: In(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 Bn({ options: e }, { offset: t, source: n, end: r }, i) {
|
|
2790
2790
|
let a = new de(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 = gn(r, o, e.strict, i);
|
|
2793
2793
|
return a.range = [
|
|
2794
2794
|
t,
|
|
2795
2795
|
o,
|
|
@@ -2798,14 +2798,14 @@ function zn({ 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 Vn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
2802
|
+
let s = new nn(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 = ln(r, {
|
|
2809
2809
|
indicator: "doc-start",
|
|
2810
2810
|
next: i ?? a?.[0],
|
|
2811
2811
|
offset: n,
|
|
@@ -2813,8 +2813,8 @@ function Bn(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 ? Rn(c, i, l, o) : zn(c, l.end, r, null, l, o);
|
|
2817
|
+
let u = s.contents.range[2], d = gn(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 Bn(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 Hn(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 Un(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 Hn(e) {
|
|
|
2848
2848
|
afterEmptyLine: r
|
|
2849
2849
|
};
|
|
2850
2850
|
}
|
|
2851
|
-
var
|
|
2851
|
+
var Wn = 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 = Hn(e);
|
|
2855
|
+
r ? this.warnings.push(new sn(i, t, n)) : this.errors.push(new on(i, t, n));
|
|
2856
2856
|
}, this.directives = new oe({ 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 } = Un(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 Un = class {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
streamInfo() {
|
|
2881
2881
|
return {
|
|
2882
|
-
comment:
|
|
2882
|
+
comment: Un(this.prelude).comment,
|
|
2883
2883
|
directives: this.directives,
|
|
2884
2884
|
errors: this.errors,
|
|
2885
2885
|
warnings: this.warnings
|
|
@@ -2893,12 +2893,12 @@ var Un = 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 = Hn(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 = Vn(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 Un = 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 on(Hn(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 on(Hn(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 = gn(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 Un = 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 on(Hn(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 nn(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 Un = class {
|
|
|
2944
2944
|
};
|
|
2945
2945
|
//#endregion
|
|
2946
2946
|
//#region node_modules/yaml/browser/dist/parse/cst-scalar.js
|
|
2947
|
-
function
|
|
2947
|
+
function Gn(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 on([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 Tn(e, t, r);
|
|
2958
|
+
case "block-scalar": return Sn({ options: { strict: t } }, e, r);
|
|
2959
2959
|
}
|
|
2960
2960
|
}
|
|
2961
2961
|
return null;
|
|
2962
2962
|
}
|
|
2963
|
-
function
|
|
2963
|
+
function Kn(e, t) {
|
|
2964
2964
|
let { implicitKey: n = !1, indent: r, inFlow: i = !1, offset: a = -1, type: o = "PLAIN" } = t, s = Ie({
|
|
2965
2965
|
type: o,
|
|
2966
2966
|
value: e
|
|
@@ -2987,7 +2987,7 @@ function Gn(e, t) {
|
|
|
2987
2987
|
indent: r,
|
|
2988
2988
|
source: t
|
|
2989
2989
|
}];
|
|
2990
|
-
return
|
|
2990
|
+
return Yn(i, c) || i.push({
|
|
2991
2991
|
type: "newline",
|
|
2992
2992
|
offset: -1,
|
|
2993
2993
|
indent: r,
|
|
@@ -3023,7 +3023,7 @@ function Gn(e, t) {
|
|
|
3023
3023
|
};
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
|
-
function
|
|
3026
|
+
function qn(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 Kn(e, t, n = {}) {
|
|
|
3055
3055
|
switch (c[0]) {
|
|
3056
3056
|
case "|":
|
|
3057
3057
|
case ">":
|
|
3058
|
-
|
|
3058
|
+
Jn(e, c);
|
|
3059
3059
|
break;
|
|
3060
3060
|
case "\"":
|
|
3061
|
-
|
|
3061
|
+
Xn(e, c, "double-quoted-scalar");
|
|
3062
3062
|
break;
|
|
3063
3063
|
case "'":
|
|
3064
|
-
|
|
3064
|
+
Xn(e, c, "single-quoted-scalar");
|
|
3065
3065
|
break;
|
|
3066
|
-
default:
|
|
3066
|
+
default: Xn(e, c, "scalar");
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
|
-
function
|
|
3069
|
+
function Jn(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 qn(e, t) {
|
|
|
3079
3079
|
indent: n,
|
|
3080
3080
|
source: r
|
|
3081
3081
|
}];
|
|
3082
|
-
|
|
3082
|
+
Yn(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 qn(e, t) {
|
|
|
3094
3094
|
});
|
|
3095
3095
|
}
|
|
3096
3096
|
}
|
|
3097
|
-
function
|
|
3097
|
+
function Yn(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 Jn(e, t) {
|
|
|
3104
3104
|
}
|
|
3105
3105
|
return !1;
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function Xn(e, t, n) {
|
|
3108
3108
|
switch (e.type) {
|
|
3109
3109
|
case "scalar":
|
|
3110
3110
|
case "double-quoted-scalar":
|
|
@@ -3151,28 +3151,28 @@ function Yn(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 Zn = (e) => "type" in e ? Qn(e) : $n(e);
|
|
3155
|
+
function Qn(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 += Qn(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 += $n(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 += $n(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 = $n(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 Zn(e) {
|
|
|
3183
3183
|
}
|
|
3184
3184
|
}
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function $n({ 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 += Qn(t)), n) for (let e of n) i += e.source;
|
|
3190
|
+
return r && (i += Qn(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 er = Symbol("break visit"), tr = Symbol("skip children"), nr = Symbol("remove item");
|
|
3195
|
+
function rr(e, t) {
|
|
3196
3196
|
"type" in e && e.type === "document" && (e = {
|
|
3197
3197
|
start: e.start,
|
|
3198
3198
|
value: e.value
|
|
3199
|
-
}),
|
|
3199
|
+
}), ir(Object.freeze([]), e, t);
|
|
3200
3200
|
}
|
|
3201
|
-
|
|
3201
|
+
rr.BREAK = er, rr.SKIP = tr, rr.REMOVE = nr, rr.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 @@ nr.BREAK = $n, nr.SKIP = er, nr.REMOVE = tr, nr.itemAtPath = (e, t) => {
|
|
|
3206
3206
|
else return;
|
|
3207
3207
|
}
|
|
3208
3208
|
return n;
|
|
3209
|
-
},
|
|
3210
|
-
let n =
|
|
3209
|
+
}, rr.parentCollection = (e, t) => {
|
|
3210
|
+
let n = rr.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 ir(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 = ir(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 === er) return er;
|
|
3224
|
+
else r === nr && (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 rr(e, t, n) {
|
|
|
3230
3230
|
}
|
|
3231
3231
|
//#endregion
|
|
3232
3232
|
//#region node_modules/yaml/browser/dist/parse/cst.js
|
|
3233
|
-
var
|
|
3233
|
+
var ar = /* @__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: () => Kn,
|
|
3239
|
+
isCollection: () => or,
|
|
3240
|
+
isScalar: () => sr,
|
|
3241
|
+
prettyToken: () => cr,
|
|
3242
|
+
resolveAsScalar: () => Gn,
|
|
3243
|
+
setScalarValue: () => qn,
|
|
3244
|
+
stringify: () => Zn,
|
|
3245
|
+
tokenType: () => lr,
|
|
3246
|
+
visit: () => rr
|
|
3247
|
+
}), or = (e) => !!e && "items" in e, sr = (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 cr(e) {
|
|
3250
3250
|
switch (e) {
|
|
3251
3251
|
case "": return "<BOM>";
|
|
3252
3252
|
case "": return "<DOC>";
|
|
@@ -3255,7 +3255,7 @@ function sr(e) {
|
|
|
3255
3255
|
default: return JSON.stringify(e);
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function lr(e) {
|
|
3259
3259
|
switch (e) {
|
|
3260
3260
|
case "": return "byte-order-mark";
|
|
3261
3261
|
case "": return "doc-mode";
|
|
@@ -3292,7 +3292,7 @@ function cr(e) {
|
|
|
3292
3292
|
}
|
|
3293
3293
|
//#endregion
|
|
3294
3294
|
//#region node_modules/yaml/browser/dist/parse/lexer.js
|
|
3295
|
-
function
|
|
3295
|
+
function U(e) {
|
|
3296
3296
|
switch (e) {
|
|
3297
3297
|
case void 0:
|
|
3298
3298
|
case " ":
|
|
@@ -3302,7 +3302,7 @@ function W(e) {
|
|
|
3302
3302
|
default: return !1;
|
|
3303
3303
|
}
|
|
3304
3304
|
}
|
|
3305
|
-
var
|
|
3305
|
+
var ur = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), dr = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), fr = /* @__PURE__ */ new Set(",[]{}"), pr = /* @__PURE__ */ new Set(" ,[]{}\n\r "), mr = (e) => !e || pr.has(e), hr = 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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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 === "...") && U(this.buffer[e + 3])) return -1;
|
|
3340
3340
|
}
|
|
3341
3341
|
return e;
|
|
3342
3342
|
}
|
|
@@ -3398,14 +3398,14 @@ var lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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 === "...") && U(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 && !U(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 === ":") && U(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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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(mr), "doc";
|
|
3427
3427
|
case "\"":
|
|
3428
3428
|
case "'": return yield* this.parseQuotedScalar();
|
|
3429
3429
|
case "|":
|
|
@@ -3438,7 +3438,7 @@ var lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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("...")) && U(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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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(mr), "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 || U(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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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) => U(e) || e === "#");
|
|
3495
3495
|
}
|
|
3496
3496
|
*parseBlockScalar() {
|
|
3497
3497
|
let e = this.pos - 1, t = 0, n;
|
|
@@ -3541,18 +3541,18 @@ var lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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 (U(r) || e && fr.has(r)) break;
|
|
3545
3545
|
t = n;
|
|
3546
|
-
} else if (
|
|
3546
|
+
} else if (U(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 && fr.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 && fr.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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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(mr), 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 (U(n) || t && fr.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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__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 (; !U(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 (dr.has(t)) t = this.buffer[++e];
|
|
3600
|
+
else if (t === "%" && ur.has(this.buffer[e + 1]) && ur.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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__PURE__ */
|
|
|
3619
3619
|
for (; !e(n);) n = this.buffer[++t];
|
|
3620
3620
|
return yield* this.pushToIndex(t, !1);
|
|
3621
3621
|
}
|
|
3622
|
-
},
|
|
3622
|
+
}, gr = 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 lr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), ur = /* @__PURE__ */
|
|
|
3645
3645
|
};
|
|
3646
3646
|
//#endregion
|
|
3647
3647
|
//#region node_modules/yaml/browser/dist/parse/parser.js
|
|
3648
|
-
function
|
|
3648
|
+
function W(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 _r(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 gr(e) {
|
|
|
3658
3658
|
}
|
|
3659
3659
|
return -1;
|
|
3660
3660
|
}
|
|
3661
|
-
function
|
|
3661
|
+
function vr(e) {
|
|
3662
3662
|
switch (e?.type) {
|
|
3663
3663
|
case "alias":
|
|
3664
3664
|
case "scalar":
|
|
@@ -3668,7 +3668,7 @@ function _r(e) {
|
|
|
3668
3668
|
default: return !1;
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
|
-
function
|
|
3671
|
+
function yr(e) {
|
|
3672
3672
|
switch (e.type) {
|
|
3673
3673
|
case "document": return e.start;
|
|
3674
3674
|
case "block-map": {
|
|
@@ -3680,7 +3680,7 @@ function vr(e) {
|
|
|
3680
3680
|
default: return [];
|
|
3681
3681
|
}
|
|
3682
3682
|
}
|
|
3683
|
-
function
|
|
3683
|
+
function br(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 yr(e) {
|
|
|
3693
3693
|
for (; e[++t]?.type === "space";);
|
|
3694
3694
|
return e.splice(t, e.length);
|
|
3695
3695
|
}
|
|
3696
|
-
function
|
|
3696
|
+
function xr(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 Sr(e) {
|
|
3701
|
+
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !W(t.start, "explicit-key-ind") && !W(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, vr(t.value) ? t.value.end ? xr(t.value.end, t.sep) : t.value.end = t.sep : xr(t.start, t.sep), delete t.sep);
|
|
3702
3702
|
}
|
|
3703
|
-
var
|
|
3703
|
+
var Cr = 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 hr(), 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 Sr = class {
|
|
|
3714
3714
|
this.atScalar = !1, yield* this.step(), this.offset += e.length;
|
|
3715
3715
|
return;
|
|
3716
3716
|
}
|
|
3717
|
-
let t =
|
|
3717
|
+
let t = lr(e);
|
|
3718
3718
|
if (!t) {
|
|
3719
3719
|
let t = `Not a YAML token: ${e}`;
|
|
3720
3720
|
yield* this.pop({
|
|
@@ -3797,7 +3797,7 @@ var Sr = 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" && Sr(t), e.type) {
|
|
3801
3801
|
case "document":
|
|
3802
3802
|
e.value = t;
|
|
3803
3803
|
break;
|
|
@@ -3849,7 +3849,7 @@ var Sr = 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 && _r(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 Sr = class {
|
|
|
3890
3890
|
if (e.value) return yield* this.lineEnd(e);
|
|
3891
3891
|
switch (this.type) {
|
|
3892
3892
|
case "doc-start":
|
|
3893
|
-
|
|
3893
|
+
_r(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 Sr = class {
|
|
|
3910
3910
|
}
|
|
3911
3911
|
*scalar(e) {
|
|
3912
3912
|
if (this.type === "map-value-ind") {
|
|
3913
|
-
let t = yr(
|
|
3913
|
+
let t = br(yr(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 Sr = 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
|
+
xr(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
3964
3964
|
return;
|
|
3965
3965
|
}
|
|
3966
3966
|
}
|
|
@@ -4009,12 +4009,12 @@ var Sr = class {
|
|
|
4009
4009
|
case "map-value-ind":
|
|
4010
4010
|
if (t.explicitKey) {
|
|
4011
4011
|
if (!t.sep) {
|
|
4012
|
-
if (
|
|
4012
|
+
if (W(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 = br(t.start);
|
|
4018
4018
|
this.stack.push({
|
|
4019
4019
|
type: "block-map",
|
|
4020
4020
|
offset: this.offset,
|
|
@@ -4031,7 +4031,7 @@ var Sr = class {
|
|
|
4031
4031
|
key: null,
|
|
4032
4032
|
sep: [this.sourceToken]
|
|
4033
4033
|
});
|
|
4034
|
-
else if (
|
|
4034
|
+
else if (W(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 Sr = class {
|
|
|
4041
4041
|
sep: [this.sourceToken]
|
|
4042
4042
|
}]
|
|
4043
4043
|
});
|
|
4044
|
-
else if (
|
|
4045
|
-
let e =
|
|
4044
|
+
else if (vr(t.key) && !W(t.sep, "newline")) {
|
|
4045
|
+
let e = br(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 Sr = class {
|
|
|
4058
4058
|
start: i,
|
|
4059
4059
|
key: null,
|
|
4060
4060
|
sep: [this.sourceToken]
|
|
4061
|
-
}) :
|
|
4061
|
+
}) : W(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 Sr = 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 && !W(t.sep, "newline")) {
|
|
4096
4096
|
yield* this.pop({
|
|
4097
4097
|
type: "error",
|
|
4098
4098
|
offset: this.offset,
|
|
@@ -4126,7 +4126,7 @@ var Sr = 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
|
+
xr(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
4130
4130
|
return;
|
|
4131
4131
|
}
|
|
4132
4132
|
}
|
|
@@ -4140,7 +4140,7 @@ var Sr = class {
|
|
|
4140
4140
|
return;
|
|
4141
4141
|
case "seq-item-ind":
|
|
4142
4142
|
if (this.indent !== e.indent) break;
|
|
4143
|
-
t.value ||
|
|
4143
|
+
t.value || W(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 Sr = 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 = yr(
|
|
4213
|
-
|
|
4212
|
+
let n = br(yr(t));
|
|
4213
|
+
Sr(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 Sr = class {
|
|
|
4269
4269
|
};
|
|
4270
4270
|
case "explicit-key-ind": {
|
|
4271
4271
|
this.onKeyLine = !0;
|
|
4272
|
-
let t = yr(
|
|
4272
|
+
let t = br(yr(e));
|
|
4273
4273
|
return t.push(this.sourceToken), {
|
|
4274
4274
|
type: "block-map",
|
|
4275
4275
|
offset: this.offset,
|
|
@@ -4282,7 +4282,7 @@ var Sr = class {
|
|
|
4282
4282
|
}
|
|
4283
4283
|
case "map-value-ind": {
|
|
4284
4284
|
this.onKeyLine = !0;
|
|
4285
|
-
let t = yr(
|
|
4285
|
+
let t = br(yr(e));
|
|
4286
4286
|
return {
|
|
4287
4287
|
type: "block-map",
|
|
4288
4288
|
offset: this.offset,
|
|
@@ -4320,31 +4320,31 @@ var Sr = class {
|
|
|
4320
4320
|
};
|
|
4321
4321
|
//#endregion
|
|
4322
4322
|
//#region node_modules/yaml/browser/dist/public-api.js
|
|
4323
|
-
function
|
|
4323
|
+
function wr(e) {
|
|
4324
4324
|
let t = e.prettyErrors !== !1;
|
|
4325
4325
|
return {
|
|
4326
|
-
lineCounter: e.lineCounter || t && new
|
|
4326
|
+
lineCounter: e.lineCounter || t && new gr() || 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 Tr(e, t = {}) {
|
|
4331
|
+
let { lineCounter: n, prettyErrors: r } = wr(t), i = new Cr(n?.addNewLine), a = new Wn(t), o = Array.from(a.compose(i.parse(e)));
|
|
4332
|
+
if (r && n) for (let t of o) t.errors.forEach(cn(e, n)), t.warnings.forEach(cn(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 Er(e, t = {}) {
|
|
4336
|
+
let { lineCounter: n, prettyErrors: r } = wr(t), i = new Cr(n?.addNewLine), a = new Wn(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 on(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(cn(e, n)), o.warnings.forEach(cn(e, n))), o;
|
|
4343
4343
|
}
|
|
4344
|
-
function
|
|
4344
|
+
function Dr(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 = Er(e, n);
|
|
4348
4348
|
if (!i) return null;
|
|
4349
4349
|
if (i.warnings.forEach((e) => He(i.options.logLevel, e)), i.errors.length > 0) {
|
|
4350
4350
|
if (i.options.logLevel !== "silent") throw i.errors[0];
|
|
@@ -4352,7 +4352,7 @@ function Er(e, t, n) {
|
|
|
4352
4352
|
}
|
|
4353
4353
|
return i.toJS(Object.assign({ reviver: r }, n));
|
|
4354
4354
|
}
|
|
4355
|
-
function
|
|
4355
|
+
function Or(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 Dr(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 nn(e, r, n).toString(n);
|
|
4366
4366
|
}
|
|
4367
4367
|
//#endregion
|
|
4368
4368
|
//#region node_modules/yaml/browser/index.js
|
|
4369
|
-
var
|
|
4369
|
+
var kr = /* @__PURE__ */ a({
|
|
4370
4370
|
Alias: () => de,
|
|
4371
|
-
CST: () =>
|
|
4372
|
-
Composer: () =>
|
|
4373
|
-
Document: () =>
|
|
4374
|
-
Lexer: () =>
|
|
4375
|
-
LineCounter: () =>
|
|
4371
|
+
CST: () => ar,
|
|
4372
|
+
Composer: () => Wn,
|
|
4373
|
+
Document: () => nn,
|
|
4374
|
+
Lexer: () => hr,
|
|
4375
|
+
LineCounter: () => gr,
|
|
4376
4376
|
Pair: () => z,
|
|
4377
|
-
Parser: () =>
|
|
4377
|
+
Parser: () => Cr,
|
|
4378
4378
|
Scalar: () => I,
|
|
4379
|
-
Schema: () =>
|
|
4380
|
-
YAMLError: () =>
|
|
4381
|
-
YAMLMap: () =>
|
|
4382
|
-
YAMLParseError: () =>
|
|
4383
|
-
YAMLSeq: () =>
|
|
4384
|
-
YAMLWarning: () =>
|
|
4379
|
+
Schema: () => en,
|
|
4380
|
+
YAMLError: () => an,
|
|
4381
|
+
YAMLMap: () => B,
|
|
4382
|
+
YAMLParseError: () => on,
|
|
4383
|
+
YAMLSeq: () => V,
|
|
4384
|
+
YAMLWarning: () => sn,
|
|
4385
4385
|
isAlias: () => v,
|
|
4386
4386
|
isCollection: () => w,
|
|
4387
4387
|
isDocument: () => y,
|
|
@@ -4390,13 +4390,13 @@ var Or = /* @__PURE__ */ a({
|
|
|
4390
4390
|
isPair: () => x,
|
|
4391
4391
|
isScalar: () => S,
|
|
4392
4392
|
isSeq: () => C,
|
|
4393
|
-
parse: () =>
|
|
4394
|
-
parseAllDocuments: () =>
|
|
4395
|
-
parseDocument: () =>
|
|
4396
|
-
stringify: () =>
|
|
4393
|
+
parse: () => Dr,
|
|
4394
|
+
parseAllDocuments: () => Tr,
|
|
4395
|
+
parseDocument: () => Er,
|
|
4396
|
+
stringify: () => Or,
|
|
4397
4397
|
visit: () => A,
|
|
4398
4398
|
visitAsync: () => ee
|
|
4399
|
-
}),
|
|
4399
|
+
}), Ar = {
|
|
4400
4400
|
rawNodes: {
|
|
4401
4401
|
address: {
|
|
4402
4402
|
id: "address",
|
|
@@ -5810,6 +5810,13 @@ var Or = /* @__PURE__ */ a({
|
|
|
5810
5810
|
required: !1,
|
|
5811
5811
|
public: !0,
|
|
5812
5812
|
inherits: "titlePrefix"
|
|
5813
|
+
},
|
|
5814
|
+
titleSuffix: {
|
|
5815
|
+
label: "Title Suffix",
|
|
5816
|
+
type: "text",
|
|
5817
|
+
required: !1,
|
|
5818
|
+
public: !0,
|
|
5819
|
+
inherits: "titleSuffix"
|
|
5813
5820
|
}
|
|
5814
5821
|
}
|
|
5815
5822
|
},
|
|
@@ -5942,7 +5949,7 @@ var Or = /* @__PURE__ */ a({
|
|
|
5942
5949
|
};
|
|
5943
5950
|
//#endregion
|
|
5944
5951
|
//#region server/db/dynamic-sync.ts
|
|
5945
|
-
async function
|
|
5952
|
+
async function jr(e, t) {
|
|
5946
5953
|
try {
|
|
5947
5954
|
let n = await e.prepare(`PRAGMA table_info("${t}")`).all(), r = Array.isArray(n) ? n : n?.results || [];
|
|
5948
5955
|
return new Set(r.map((e) => e.name));
|
|
@@ -5950,7 +5957,7 @@ async function Ar(e, t) {
|
|
|
5950
5957
|
return /* @__PURE__ */ new Set();
|
|
5951
5958
|
}
|
|
5952
5959
|
}
|
|
5953
|
-
var
|
|
5960
|
+
var Mr = {
|
|
5954
5961
|
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 ",
|
|
5955
5962
|
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 ",
|
|
5956
5963
|
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 ",
|
|
@@ -5965,7 +5972,7 @@ var jr = {
|
|
|
5965
5972
|
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 ",
|
|
5966
5973
|
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 ",
|
|
5967
5974
|
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 "
|
|
5968
|
-
},
|
|
5975
|
+
}, Nr = [
|
|
5969
5976
|
"CREATE INDEX IF NOT EXISTS idx_content_schemas_type ON content_schemas(type);",
|
|
5970
5977
|
"CREATE INDEX IF NOT EXISTS idx_sessions_user ON sessions(userId);",
|
|
5971
5978
|
"CREATE INDEX IF NOT EXISTS idx_sessions_expires ON sessions(expiresAt);",
|
|
@@ -5988,13 +5995,13 @@ var jr = {
|
|
|
5988
5995
|
"CREATE INDEX IF NOT EXISTS idx_assets_deleted ON assets(deletedAt);",
|
|
5989
5996
|
"CREATE INDEX IF NOT EXISTS idx_assets_parent ON assets(parentAssetId);"
|
|
5990
5997
|
];
|
|
5991
|
-
async function
|
|
5998
|
+
async function Pr(e, t) {
|
|
5992
5999
|
try {
|
|
5993
6000
|
await e.prepare("PRAGMA foreign_keys = ON;").run();
|
|
5994
6001
|
} catch {}
|
|
5995
|
-
for (let [t, n] of Object.entries(
|
|
5996
|
-
for (let [t] of Object.entries(
|
|
5997
|
-
let n = await
|
|
6002
|
+
for (let [t, n] of Object.entries(Mr)) await e.prepare(`CREATE TABLE IF NOT EXISTS "${t}" (${n});`).run();
|
|
6003
|
+
for (let [t] of Object.entries(Mr)) {
|
|
6004
|
+
let n = await jr(e, t);
|
|
5998
6005
|
if (n.size > 0) {
|
|
5999
6006
|
if (t === "content_nodes" && !n.has("disabledRegionsJson")) try {
|
|
6000
6007
|
await e.prepare("ALTER TABLE \"content_nodes\" ADD COLUMN disabledRegionsJson TEXT DEFAULT '{}';").run();
|
|
@@ -6009,12 +6016,12 @@ async function Nr(e, t) {
|
|
|
6009
6016
|
}
|
|
6010
6017
|
}
|
|
6011
6018
|
}
|
|
6012
|
-
for (let t of
|
|
6019
|
+
for (let t of Nr) try {
|
|
6013
6020
|
await e.prepare(t).run();
|
|
6014
6021
|
} catch {}
|
|
6015
|
-
await
|
|
6022
|
+
await Fr(e, t || Ar), await Ir(e);
|
|
6016
6023
|
}
|
|
6017
|
-
async function
|
|
6024
|
+
async function Fr(e, t) {
|
|
6018
6025
|
if (!t) return;
|
|
6019
6026
|
let n = t.rawNodes || {}, r = Object.entries(n);
|
|
6020
6027
|
for (let [t, n] of r) {
|
|
@@ -6031,7 +6038,7 @@ async function Pr(e, t) {
|
|
|
6031
6038
|
}
|
|
6032
6039
|
}
|
|
6033
6040
|
}
|
|
6034
|
-
async function
|
|
6041
|
+
async function Ir(e) {
|
|
6035
6042
|
try {
|
|
6036
6043
|
let t = await e.prepare("SELECT COUNT(*) as count FROM channels").get(), n = 1;
|
|
6037
6044
|
if (!t || t.count === 0) {
|
|
@@ -6052,7 +6059,7 @@ async function Fr(e) {
|
|
|
6052
6059
|
}
|
|
6053
6060
|
//#endregion
|
|
6054
6061
|
//#region server/middleware/media-static.ts
|
|
6055
|
-
function
|
|
6062
|
+
function Lr() {
|
|
6056
6063
|
return async (e, t) => {
|
|
6057
6064
|
if (e.env?.MEDIA_BUCKET) {
|
|
6058
6065
|
let t = e.req.path.replace(/^\/media\//, ""), n = await e.env.MEDIA_BUCKET.get(t, { onlyIf: e.req.raw.headers });
|
|
@@ -6083,18 +6090,18 @@ function Ir() {
|
|
|
6083
6090
|
}
|
|
6084
6091
|
//#endregion
|
|
6085
6092
|
//#region node_modules/lru-cache/dist/esm/browser/index.min.js
|
|
6086
|
-
var
|
|
6087
|
-
typeof
|
|
6088
|
-
},
|
|
6093
|
+
var Rr = { hasSubscribers: !1 }, G = Rr, zr = Rr, Br = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, Vr = () => G.hasSubscribers || zr.hasSubscribers, Hr = /* @__PURE__ */ new Set(), Ur = typeof process == "object" && process ? process : {}, Wr = (e, t, n, r) => {
|
|
6094
|
+
typeof Ur.emitWarning == "function" ? Ur.emitWarning(e, t, n, r) : console.error(`[${n}] ${t}: ${e}`);
|
|
6095
|
+
}, Gr = (e) => !Hr.has(e), K = (e) => !!e && e === Math.floor(e) && e > 0 && isFinite(e), Kr = (e) => K(e) ? e <= 256 ? Uint8Array : e <= 2 ** 16 ? Uint16Array : e <= 2 ** 32 ? Uint32Array : e <= 2 ** 53 - 1 ? qr : null : null, qr = class extends Array {
|
|
6089
6096
|
constructor(e) {
|
|
6090
6097
|
super(e), this.fill(0);
|
|
6091
6098
|
}
|
|
6092
|
-
},
|
|
6099
|
+
}, Jr = class e {
|
|
6093
6100
|
heap;
|
|
6094
6101
|
length;
|
|
6095
6102
|
static #e = !1;
|
|
6096
6103
|
static create(t) {
|
|
6097
|
-
let n =
|
|
6104
|
+
let n = Kr(t);
|
|
6098
6105
|
if (!n) return [];
|
|
6099
6106
|
e.#e = !0;
|
|
6100
6107
|
let r = new e(t, n);
|
|
@@ -6110,7 +6117,7 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6110
6117
|
pop() {
|
|
6111
6118
|
return this.heap[--this.length];
|
|
6112
6119
|
}
|
|
6113
|
-
},
|
|
6120
|
+
}, Yr = class e {
|
|
6114
6121
|
#e;
|
|
6115
6122
|
#t;
|
|
6116
6123
|
#n;
|
|
@@ -6213,8 +6220,8 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6213
6220
|
constructor(t) {
|
|
6214
6221
|
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;
|
|
6215
6222
|
if (this.backgroundFetchSize = w, T !== void 0 && typeof T?.now != "function") throw TypeError("perf option must have a now() method if specified");
|
|
6216
|
-
if (this.#s = T ??
|
|
6217
|
-
let E = n ?
|
|
6223
|
+
if (this.#s = T ?? Br, n !== 0 && !K(n)) throw TypeError("max option must be a nonnegative integer");
|
|
6224
|
+
let E = n ? Kr(n) : Array;
|
|
6218
6225
|
if (!E) throw Error("invalid max value: " + n);
|
|
6219
6226
|
if (this.#e = n, this.#t = m, this.maxEntrySize = h || this.#t, this.sizeCalculation = g, this.sizeCalculation) {
|
|
6220
6227
|
if (!this.#t && !this.maxEntrySize) throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
@@ -6222,26 +6229,26 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6222
6229
|
}
|
|
6223
6230
|
if (v !== void 0 && typeof v != "function") throw TypeError("memoMethod must be a function if defined");
|
|
6224
6231
|
if (this.#o = v, _ !== void 0 && typeof _ != "function") throw TypeError("fetchMethod must be a function if specified");
|
|
6225
|
-
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.#_ =
|
|
6226
|
-
if (this.#t !== 0 && !
|
|
6227
|
-
if (!
|
|
6232
|
+
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.#_ = Jr.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) {
|
|
6233
|
+
if (this.#t !== 0 && !K(this.#t)) throw TypeError("maxSize must be a positive integer if specified");
|
|
6234
|
+
if (!K(this.maxEntrySize)) throw TypeError("maxEntrySize must be a positive integer if specified");
|
|
6228
6235
|
this.#M();
|
|
6229
6236
|
}
|
|
6230
|
-
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!s, this.ttlResolution =
|
|
6231
|
-
if (!
|
|
6237
|
+
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!s, this.ttlResolution = K(i) || i === 0 ? i : 1, this.ttlAutopurge = !!a, this.ttl = r || 0, this.ttl) {
|
|
6238
|
+
if (!K(this.ttl)) throw TypeError("ttl must be a positive integer if specified");
|
|
6232
6239
|
this.#D();
|
|
6233
6240
|
}
|
|
6234
6241
|
if (this.#e === 0 && this.ttl === 0 && this.#t === 0) throw TypeError("At least one of max, maxSize, or ttl is required");
|
|
6235
6242
|
if (!this.ttlAutopurge && !this.#e && !this.#t) {
|
|
6236
6243
|
let t = "LRU_CACHE_UNBOUNDED";
|
|
6237
|
-
|
|
6244
|
+
Gr(t) && (Hr.add(t), Wr("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", t, e));
|
|
6238
6245
|
}
|
|
6239
6246
|
}
|
|
6240
6247
|
getRemainingTTL(e) {
|
|
6241
6248
|
return this.#u.has(e) ? 1 / 0 : 0;
|
|
6242
6249
|
}
|
|
6243
6250
|
#D() {
|
|
6244
|
-
let e = new
|
|
6251
|
+
let e = new qr(this.#e), t = new qr(this.#e);
|
|
6245
6252
|
this.#x = e, this.#b = t;
|
|
6246
6253
|
let n = this.ttlAutopurge ? Array.from({ length: this.#e }) : void 0;
|
|
6247
6254
|
this.#S = n, this.#A = (n, i, a = this.#s.now()) => {
|
|
@@ -6291,15 +6298,15 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6291
6298
|
#A = () => {};
|
|
6292
6299
|
#j = () => !1;
|
|
6293
6300
|
#M() {
|
|
6294
|
-
let e = new
|
|
6301
|
+
let e = new qr(this.#e);
|
|
6295
6302
|
this.#l = 0, this.#y = e, this.#N = (t) => {
|
|
6296
6303
|
this.#l -= e[t], e[t] = 0;
|
|
6297
6304
|
}, this.#F = (e, t, n, r) => {
|
|
6298
|
-
if (!
|
|
6305
|
+
if (!K(n)) {
|
|
6299
6306
|
if (this.#W(t)) return this.backgroundFetchSize;
|
|
6300
6307
|
if (r) {
|
|
6301
6308
|
if (typeof r != "function") throw TypeError("sizeCalculation must be a function");
|
|
6302
|
-
if (n = r(t, e), !
|
|
6309
|
+
if (n = r(t, e), !K(n)) throw TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
6303
6310
|
} else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
6304
6311
|
}
|
|
6305
6312
|
return n;
|
|
@@ -6415,10 +6422,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6415
6422
|
}
|
|
6416
6423
|
}
|
|
6417
6424
|
set(e, t, n = {}) {
|
|
6418
|
-
let { status: r =
|
|
6425
|
+
let { status: r = G.hasSubscribers ? {} : void 0 } = n;
|
|
6419
6426
|
n.status = r, r && (r.op = "set", r.key = e, t !== void 0 && (r.value = t), r.cache = this);
|
|
6420
6427
|
let i = this.#z(e, t, n);
|
|
6421
|
-
return r &&
|
|
6428
|
+
return r && G.hasSubscribers && G.publish(r), i;
|
|
6422
6429
|
}
|
|
6423
6430
|
#z(e, t, n, r) {
|
|
6424
6431
|
let { ttl: i = this.ttl, start: a, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: s = this.sizeCalculation, status: c } = n, l = this.#W(t);
|
|
@@ -6486,10 +6493,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6486
6493
|
])), 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;
|
|
6487
6494
|
}
|
|
6488
6495
|
has(e, t = {}) {
|
|
6489
|
-
let { status: n =
|
|
6496
|
+
let { status: n = G.hasSubscribers ? {} : void 0 } = t;
|
|
6490
6497
|
t.status = n, n && (n.op = "has", n.key = e, n.cache = this);
|
|
6491
6498
|
let r = this.#V(e, t);
|
|
6492
|
-
return
|
|
6499
|
+
return G.hasSubscribers && G.publish(n), r;
|
|
6493
6500
|
}
|
|
6494
6501
|
#V(e, t = {}) {
|
|
6495
6502
|
let { updateAgeOnHas: n = this.updateAgeOnHas, status: r } = t, i = this.#u.get(e);
|
|
@@ -6502,10 +6509,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6502
6509
|
return !1;
|
|
6503
6510
|
}
|
|
6504
6511
|
peek(e, t = {}) {
|
|
6505
|
-
let { status: n =
|
|
6512
|
+
let { status: n = Vr() ? {} : void 0 } = t;
|
|
6506
6513
|
n && (n.op = "peek", n.key = e, n.cache = this), t.status = n;
|
|
6507
6514
|
let r = this.#H(e, t);
|
|
6508
|
-
return
|
|
6515
|
+
return G.hasSubscribers && G.publish(n), r;
|
|
6509
6516
|
}
|
|
6510
6517
|
#H(e, t) {
|
|
6511
6518
|
let { status: n, allowStale: r = this.allowStale } = t, i = this.#u.get(e);
|
|
@@ -6557,10 +6564,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6557
6564
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
6558
6565
|
}
|
|
6559
6566
|
fetch(e, t = {}) {
|
|
6560
|
-
let n =
|
|
6567
|
+
let n = zr.hasSubscribers, { status: r = Vr() ? {} : void 0 } = t;
|
|
6561
6568
|
t.status = r, r && t.context && (r.context = t.context);
|
|
6562
6569
|
let i = this.#G(e, t);
|
|
6563
|
-
return r && n && (r.trace = !0,
|
|
6570
|
+
return r && n && (r.trace = !0, zr.tracePromise(() => i, r).catch(() => {})), i;
|
|
6564
6571
|
}
|
|
6565
6572
|
async #G(e, t = {}) {
|
|
6566
6573
|
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;
|
|
@@ -6604,10 +6611,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6604
6611
|
}
|
|
6605
6612
|
}
|
|
6606
6613
|
forceFetch(e, t = {}) {
|
|
6607
|
-
let n =
|
|
6614
|
+
let n = zr.hasSubscribers, { status: r = Vr() ? {} : void 0 } = t;
|
|
6608
6615
|
t.status = r, r && t.context && (r.context = t.context);
|
|
6609
6616
|
let i = this.#K(e, t);
|
|
6610
|
-
return r && n && (r.trace = !0,
|
|
6617
|
+
return r && n && (r.trace = !0, zr.tracePromise(() => i, r).catch(() => {})), i;
|
|
6611
6618
|
}
|
|
6612
6619
|
async #K(e, t = {}) {
|
|
6613
6620
|
let n = await this.#G(e, t);
|
|
@@ -6615,10 +6622,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6615
6622
|
return n;
|
|
6616
6623
|
}
|
|
6617
6624
|
memo(e, t = {}) {
|
|
6618
|
-
let { status: n =
|
|
6625
|
+
let { status: n = G.hasSubscribers ? {} : void 0 } = t;
|
|
6619
6626
|
t.status = n, n && (n.op = "memo", n.key = e, t.context && (n.context = t.context), n.cache = this);
|
|
6620
6627
|
let r = this.#q(e, t);
|
|
6621
|
-
return n && (n.value = r),
|
|
6628
|
+
return n && (n.value = r), G.hasSubscribers && G.publish(n), r;
|
|
6622
6629
|
}
|
|
6623
6630
|
#q(e, t = {}) {
|
|
6624
6631
|
let n = this.#o;
|
|
@@ -6634,10 +6641,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6634
6641
|
return i && (i.value = l), this.#z(e, l, o), l;
|
|
6635
6642
|
}
|
|
6636
6643
|
get(e, t = {}) {
|
|
6637
|
-
let { status: n =
|
|
6644
|
+
let { status: n = G.hasSubscribers ? {} : void 0 } = t;
|
|
6638
6645
|
t.status = n, n && (n.op = "get", n.key = e, n.cache = this);
|
|
6639
6646
|
let r = this.#J(e, t);
|
|
6640
|
-
return n && (r !== void 0 && (n.value = r),
|
|
6647
|
+
return n && (r !== void 0 && (n.value = r), G.hasSubscribers && G.publish(n)), r;
|
|
6641
6648
|
}
|
|
6642
6649
|
#J(e, t = {}) {
|
|
6643
6650
|
let { allowStale: n = this.allowStale, updateAgeOnGet: r = this.updateAgeOnGet, noDeleteOnStaleGet: i = this.noDeleteOnStaleGet, status: a } = t, o = this.#u.get(e);
|
|
@@ -6658,7 +6665,7 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6658
6665
|
return this.#Z(e, "delete");
|
|
6659
6666
|
}
|
|
6660
6667
|
#Z(e, t) {
|
|
6661
|
-
|
|
6668
|
+
G.hasSubscribers && G.publish({
|
|
6662
6669
|
op: "delete",
|
|
6663
6670
|
delete: t,
|
|
6664
6671
|
key: e,
|
|
@@ -6720,10 +6727,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6720
6727
|
for (; t = e?.shift();) this.#i?.(...t);
|
|
6721
6728
|
}
|
|
6722
6729
|
}
|
|
6723
|
-
},
|
|
6730
|
+
}, Xr = class {
|
|
6724
6731
|
cache;
|
|
6725
6732
|
constructor(e = 1e3, t = 3e5) {
|
|
6726
|
-
this.cache = new
|
|
6733
|
+
this.cache = new Yr({
|
|
6727
6734
|
max: e,
|
|
6728
6735
|
ttl: t
|
|
6729
6736
|
});
|
|
@@ -6742,7 +6749,7 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6742
6749
|
async clear() {
|
|
6743
6750
|
this.cache.clear();
|
|
6744
6751
|
}
|
|
6745
|
-
},
|
|
6752
|
+
}, Zr = class {
|
|
6746
6753
|
kv;
|
|
6747
6754
|
constructor(e) {
|
|
6748
6755
|
this.kv = e;
|
|
@@ -6759,21 +6766,21 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6759
6766
|
this.kv && await this.kv.delete(e);
|
|
6760
6767
|
}
|
|
6761
6768
|
async clear() {}
|
|
6762
|
-
},
|
|
6769
|
+
}, Qr = class {
|
|
6763
6770
|
async get() {
|
|
6764
6771
|
return null;
|
|
6765
6772
|
}
|
|
6766
6773
|
async set() {}
|
|
6767
6774
|
async delete() {}
|
|
6768
6775
|
async clear() {}
|
|
6769
|
-
},
|
|
6770
|
-
function
|
|
6776
|
+
}, $r = null;
|
|
6777
|
+
function q(e) {
|
|
6771
6778
|
let t = process.env.CACHE_DRIVER || "lru";
|
|
6772
|
-
return t === "none" || t === "off" || t === "false" ? new
|
|
6779
|
+
return t === "none" || t === "off" || t === "false" ? new Qr() : e?.env?.CMS_CACHE_KV ? new Zr(e.env.CMS_CACHE_KV) : t === "lru" ? ($r ||= new Xr(), $r) : new Qr();
|
|
6773
6780
|
}
|
|
6774
6781
|
//#endregion
|
|
6775
6782
|
//#region server/storage/provider.ts
|
|
6776
|
-
function
|
|
6783
|
+
function ei(e) {
|
|
6777
6784
|
let t = e.split(".").pop()?.toLowerCase() || "bin";
|
|
6778
6785
|
return t = t.replace(/[^a-z0-9]/g, ""), [
|
|
6779
6786
|
"php",
|
|
@@ -6788,14 +6795,14 @@ function $r(e) {
|
|
|
6788
6795
|
"cjs"
|
|
6789
6796
|
].includes(t) ? "bin" : t;
|
|
6790
6797
|
}
|
|
6791
|
-
var
|
|
6798
|
+
var ti = class {
|
|
6792
6799
|
bucket;
|
|
6793
6800
|
publicDomain;
|
|
6794
6801
|
constructor(e, t) {
|
|
6795
6802
|
this.bucket = e, this.publicDomain = t;
|
|
6796
6803
|
}
|
|
6797
6804
|
async upload(e, t = "uploads") {
|
|
6798
|
-
let n =
|
|
6805
|
+
let n = ei(e.name), r = `${t}/${crypto.randomUUID().replace(/-/g, "")}.${n}`;
|
|
6799
6806
|
return await this.bucket.put(r, e.stream(), { httpMetadata: { contentType: e.type } }), {
|
|
6800
6807
|
key: r,
|
|
6801
6808
|
url: `https://${this.publicDomain}/${r}`
|
|
@@ -6804,7 +6811,7 @@ var ei = class {
|
|
|
6804
6811
|
async delete(e) {
|
|
6805
6812
|
await this.bucket.delete(e);
|
|
6806
6813
|
}
|
|
6807
|
-
},
|
|
6814
|
+
}, ni = class {
|
|
6808
6815
|
customStoragePath;
|
|
6809
6816
|
constructor(e) {
|
|
6810
6817
|
this.customStoragePath = e;
|
|
@@ -6822,7 +6829,7 @@ var ei = class {
|
|
|
6822
6829
|
), { pipeline: a } = await import(
|
|
6823
6830
|
/* @vite-ignore */
|
|
6824
6831
|
"node:stream/promises"
|
|
6825
|
-
), o =
|
|
6832
|
+
), o = ei(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);
|
|
6826
6833
|
await i.mkdir(n.dirname(u), { recursive: !0 });
|
|
6827
6834
|
let d = r.createWriteStream(u);
|
|
6828
6835
|
return await a(e.stream(), d), {
|
|
@@ -6845,16 +6852,16 @@ var ei = class {
|
|
|
6845
6852
|
}
|
|
6846
6853
|
}
|
|
6847
6854
|
};
|
|
6848
|
-
function
|
|
6855
|
+
function ri(e) {
|
|
6849
6856
|
if (e.MEDIA_BUCKET) {
|
|
6850
6857
|
let t = e.CDN_DOMAIN || "cdn.yourdomain.com";
|
|
6851
|
-
return new
|
|
6858
|
+
return new ti(e.MEDIA_BUCKET, t);
|
|
6852
6859
|
}
|
|
6853
|
-
return new
|
|
6860
|
+
return new ni(e.LOCAL_MEDIA_PATH);
|
|
6854
6861
|
}
|
|
6855
6862
|
//#endregion
|
|
6856
6863
|
//#region server/utils/node-assets-interceptor.ts
|
|
6857
|
-
function
|
|
6864
|
+
function ii(e) {
|
|
6858
6865
|
if (!e || typeof e != "object") return {
|
|
6859
6866
|
cleanedData: e,
|
|
6860
6867
|
assetRefs: []
|
|
@@ -6913,7 +6920,7 @@ function ri(e) {
|
|
|
6913
6920
|
assetRefs: t
|
|
6914
6921
|
};
|
|
6915
6922
|
}
|
|
6916
|
-
async function
|
|
6923
|
+
async function ai(e, t, n) {
|
|
6917
6924
|
if (await e.prepare("DELETE FROM node_assets WHERE nodeId = ?").run(t), n.length === 0) return;
|
|
6918
6925
|
let r = /* @__PURE__ */ new Set();
|
|
6919
6926
|
for (let i of n) {
|
|
@@ -6923,12 +6930,12 @@ async function ii(e, t, n) {
|
|
|
6923
6930
|
}
|
|
6924
6931
|
//#endregion
|
|
6925
6932
|
//#region server/utils/asset-hydrator.ts
|
|
6926
|
-
function
|
|
6933
|
+
function J(e) {
|
|
6927
6934
|
if (!e) return null;
|
|
6928
6935
|
if (typeof e == "string" && e.startsWith("ast_")) return e;
|
|
6929
6936
|
if (typeof e == "object" && e) {
|
|
6930
6937
|
if (typeof e.id == "string" && e.id.startsWith("ast_")) return e.id;
|
|
6931
|
-
if (typeof e.id == "object") return
|
|
6938
|
+
if (typeof e.id == "object") return J(e.id);
|
|
6932
6939
|
}
|
|
6933
6940
|
return null;
|
|
6934
6941
|
}
|
|
@@ -6936,10 +6943,10 @@ async function oi(e, t) {
|
|
|
6936
6943
|
if (!t || typeof t != "object") return t;
|
|
6937
6944
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
6938
6945
|
if (!e) return;
|
|
6939
|
-
let t =
|
|
6946
|
+
let t = J(e);
|
|
6940
6947
|
if (t) {
|
|
6941
6948
|
if (n.add(t), typeof e == "object" && e.parentAssetId) {
|
|
6942
|
-
let t =
|
|
6949
|
+
let t = J(e.parentAssetId);
|
|
6943
6950
|
t && n.add(t);
|
|
6944
6951
|
}
|
|
6945
6952
|
} else Array.isArray(e) ? e.forEach(r) : typeof e == "object" && Object.values(e).forEach(r);
|
|
@@ -6968,7 +6975,7 @@ async function oi(e, t) {
|
|
|
6968
6975
|
AND (parentAssetId IN (${i}) OR ${Array.from(n).map(() => "filename LIKE ?").join(" OR ")})
|
|
6969
6976
|
`).all(...Array.from(n), ...Array.from(n).map((e) => `%${e}%`)), c = Array.isArray(s) ? s : s?.results || [], l = /* @__PURE__ */ new Map();
|
|
6970
6977
|
for (let e of c) {
|
|
6971
|
-
let t =
|
|
6978
|
+
let t = J(e.parentAssetId) || Array.from(n).find((t) => e.filename.includes(t));
|
|
6972
6979
|
if (!t) continue;
|
|
6973
6980
|
let r = e.filename.match(/^crop_([a-z0-9]+)_/i), i = r ? r[1] : "standard", a = null;
|
|
6974
6981
|
if (e.cropCoordinatesJson) try {
|
|
@@ -7003,7 +7010,7 @@ async function oi(e, t) {
|
|
|
7003
7010
|
id: e.id,
|
|
7004
7011
|
url: t,
|
|
7005
7012
|
originalUrl: n,
|
|
7006
|
-
parentAssetId:
|
|
7013
|
+
parentAssetId: J(e.parentAssetId) || null,
|
|
7007
7014
|
cropCoordinates: r,
|
|
7008
7015
|
variants: i && Object.keys(i).length > 0 ? i : void 0,
|
|
7009
7016
|
filename: e.filename,
|
|
@@ -7015,7 +7022,7 @@ async function oi(e, t) {
|
|
|
7015
7022
|
}
|
|
7016
7023
|
let d = (e) => {
|
|
7017
7024
|
if (!e) return e;
|
|
7018
|
-
let t =
|
|
7025
|
+
let t = J(e);
|
|
7019
7026
|
if (t) {
|
|
7020
7027
|
let n = u.get(t) || {
|
|
7021
7028
|
id: t,
|
|
@@ -7025,7 +7032,7 @@ async function oi(e, t) {
|
|
|
7025
7032
|
return {
|
|
7026
7033
|
...n,
|
|
7027
7034
|
id: t,
|
|
7028
|
-
parentAssetId: n.parentAssetId ?
|
|
7035
|
+
parentAssetId: n.parentAssetId ? J(n.parentAssetId) : null,
|
|
7029
7036
|
url: typeof e == "object" && e.url && !e.url.startsWith("blob:") ? e.url : n.url,
|
|
7030
7037
|
originalUrl: typeof e == "object" && e.originalUrl && !e.originalUrl.startsWith("blob:") ? e.originalUrl : n.originalUrl,
|
|
7031
7038
|
cropCoordinates: i || n.cropCoordinates || null,
|
|
@@ -7092,7 +7099,7 @@ function si() {
|
|
|
7092
7099
|
for (let a of e(r)) {
|
|
7093
7100
|
let e = n.basename(a, n.extname(a));
|
|
7094
7101
|
try {
|
|
7095
|
-
i[e] =
|
|
7102
|
+
i[e] = kr.parse(t.readFileSync(a, "utf-8"));
|
|
7096
7103
|
} catch (e) {
|
|
7097
7104
|
console.warn(`[CMS Schema] Failed to parse ${a}:`, e);
|
|
7098
7105
|
}
|
|
@@ -7102,7 +7109,7 @@ function si() {
|
|
|
7102
7109
|
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"));
|
|
7103
7110
|
if (!o) return null;
|
|
7104
7111
|
try {
|
|
7105
|
-
return
|
|
7112
|
+
return kr.parse(t.readFileSync(o, "utf-8"));
|
|
7106
7113
|
} catch {
|
|
7107
7114
|
return null;
|
|
7108
7115
|
}
|
|
@@ -7479,6 +7486,33 @@ async function vi(e, t, n) {
|
|
|
7479
7486
|
inheritedFields: r
|
|
7480
7487
|
};
|
|
7481
7488
|
}
|
|
7489
|
+
async function yi(e, t) {
|
|
7490
|
+
let n = e.CLOUDFLARE_ZONE_ID, r = e.CLOUDFLARE_API_TOKEN, i = e.PUBLIC_FRONTEND_URL || "https://kama.t3cloud.eu";
|
|
7491
|
+
if (!n || !r) {
|
|
7492
|
+
console.warn("[Cache] Skipping purge: Missing CLOUDFLARE_ZONE_ID or CLOUDFLARE_API_TOKEN in environment.");
|
|
7493
|
+
return;
|
|
7494
|
+
}
|
|
7495
|
+
try {
|
|
7496
|
+
let e = t.replace(/^\/+|\/+$/g, ""), a = e === "home" || !e ? i : `${i}/${e}`, o = [a, `${a}/`];
|
|
7497
|
+
console.log(`[Cache] Purging edge cache for: ${o.join(", ")}`);
|
|
7498
|
+
let s = await fetch(`https://api.cloudflare.com/client/v4/zones/${n}/purge_cache`, {
|
|
7499
|
+
method: "POST",
|
|
7500
|
+
headers: {
|
|
7501
|
+
Authorization: `Bearer ${r}`,
|
|
7502
|
+
"Content-Type": "application/json"
|
|
7503
|
+
},
|
|
7504
|
+
body: JSON.stringify({ files: o })
|
|
7505
|
+
});
|
|
7506
|
+
if (!s.ok) {
|
|
7507
|
+
let e = await s.text();
|
|
7508
|
+
console.error(`[Cache] Purge failed: ${e}`);
|
|
7509
|
+
return;
|
|
7510
|
+
}
|
|
7511
|
+
fetch(a, { headers: { "X-Cache-Warmer": "true" } }).catch((e) => console.error(`[Cache] Warming failed for ${a}:`, e));
|
|
7512
|
+
} catch (e) {
|
|
7513
|
+
console.error("[Cache] Critical error during cache purge:", e);
|
|
7514
|
+
}
|
|
7515
|
+
}
|
|
7482
7516
|
X.get("/", async (e) => {
|
|
7483
7517
|
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));
|
|
7484
7518
|
if (n) {
|
|
@@ -7633,7 +7667,7 @@ X.get("/", async (e) => {
|
|
|
7633
7667
|
limit: f
|
|
7634
7668
|
});
|
|
7635
7669
|
}), X.post("/", async (e) => {
|
|
7636
|
-
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 = hi(_), { cleanedData: y, assetRefs: b } =
|
|
7670
|
+
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 = hi(_), { cleanedData: y, assetRefs: b } = ii(v), x = pi(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();
|
|
7637
7671
|
if (a) {
|
|
7638
7672
|
let n = await t.prepare("SELECT title, slug, contentType, language, draftDataJson, dataJson, publishedAt, status FROM content_nodes WHERE id = ?").get(a), r = n?.draftDataJson || n?.dataJson || "{}";
|
|
7639
7673
|
try {
|
|
@@ -7647,7 +7681,7 @@ X.get("/", async (e) => {
|
|
|
7647
7681
|
} catch {}
|
|
7648
7682
|
});
|
|
7649
7683
|
}
|
|
7650
|
-
if (m === void 0 && o === void 0 && s === void 0 && h === void 0 && g === void 0 && Object.keys(v).length === 0) return 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
|
|
7684
|
+
if (m === void 0 && o === void 0 && s === void 0 && h === void 0 && g === void 0 && Object.keys(v).length === 0) return 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 q(e).clear(), n?.status === "published" && n.slug && e.executionCtx.waitUntil(yi(e.env, n.slug)), e.json({
|
|
7651
7685
|
success: !0,
|
|
7652
7686
|
id: a,
|
|
7653
7687
|
status: n?.status || "published"
|
|
@@ -7693,7 +7727,7 @@ X.get("/", async (e) => {
|
|
|
7693
7727
|
await t.prepare("DELETE FROM content_blocks WHERE contentId = ? AND isDraft = 1").run(T);
|
|
7694
7728
|
let e = [], n = [];
|
|
7695
7729
|
for (let t = 0; t < m.length; t++) {
|
|
7696
|
-
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 } =
|
|
7730
|
+
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 } = ii({
|
|
7697
7731
|
...a,
|
|
7698
7732
|
blockId: o,
|
|
7699
7733
|
_instanceId: o
|
|
@@ -7711,11 +7745,11 @@ X.get("/", async (e) => {
|
|
|
7711
7745
|
}
|
|
7712
7746
|
if (T) {
|
|
7713
7747
|
let n = [...b, ...D];
|
|
7714
|
-
await
|
|
7748
|
+
await ai(t, T, n);
|
|
7715
7749
|
let r = new Set(n.map((e) => e.assetId)), i = new Set([...E].filter((e) => !r.has(e)));
|
|
7716
|
-
i.size > 0 && await _i(t,
|
|
7750
|
+
i.size > 0 && await _i(t, ri(e.env), i);
|
|
7717
7751
|
}
|
|
7718
|
-
return await
|
|
7752
|
+
return await q(e).clear(), e.json({
|
|
7719
7753
|
success: !0,
|
|
7720
7754
|
id: T,
|
|
7721
7755
|
status: "draft"
|
|
@@ -7745,7 +7779,7 @@ X.get("/", async (e) => {
|
|
|
7745
7779
|
},
|
|
7746
7780
|
blocks: l
|
|
7747
7781
|
};
|
|
7748
|
-
return await t.prepare("\n INSERT INTO node_revisions (nodeId, version, snapshotJson, createdById)\n VALUES (?, ?, ?, ?)\n ").run(i, u, JSON.stringify(d), a), await
|
|
7782
|
+
return await t.prepare("\n INSERT INTO node_revisions (nodeId, version, snapshotJson, createdById)\n VALUES (?, ?, ?, ?)\n ").run(i, u, JSON.stringify(d), a), await q(e).clear(), o.slug && e.executionCtx.waitUntil(yi(e.env, o.slug)), e.json({
|
|
7749
7783
|
success: !0,
|
|
7750
7784
|
id: i,
|
|
7751
7785
|
status: "published",
|
|
@@ -7755,30 +7789,32 @@ X.get("/", async (e) => {
|
|
|
7755
7789
|
}), X.delete("/", async (e) => {
|
|
7756
7790
|
let t = e.get("db"), n = e.req.query("id");
|
|
7757
7791
|
if (!n) return e.json({ error: "Node ID required" }, 400);
|
|
7758
|
-
let r = Number(n);
|
|
7759
|
-
return await t.prepare("UPDATE content_nodes SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?").run(r), await
|
|
7792
|
+
let r = Number(n), i = await t.prepare("SELECT slug, status FROM content_nodes WHERE id = ?").get(r);
|
|
7793
|
+
return await t.prepare("UPDATE content_nodes SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?").run(r), await q(e).clear(), i && i.status === "published" && i.slug && e.executionCtx.waitUntil(yi(e.env, i.slug)), e.json({
|
|
7760
7794
|
success: !0,
|
|
7761
7795
|
deletedNodeId: r
|
|
7762
7796
|
});
|
|
7763
7797
|
}), X.post("/restore", async (e) => {
|
|
7764
7798
|
let t = e.get("db"), n = await e.req.json(), r = Number(n.id);
|
|
7765
|
-
|
|
7799
|
+
if (!r) return e.json({ error: "Node ID required" }, 400);
|
|
7800
|
+
let i = await t.prepare("SELECT slug, status FROM content_nodes WHERE id = ?").get(r);
|
|
7801
|
+
return await t.prepare("UPDATE content_nodes SET deletedAt = NULL WHERE id = ?").run(r), await q(e).clear(), i && i.status === "published" && i.slug && e.executionCtx.waitUntil(yi(e.env, i.slug)), e.json({
|
|
7766
7802
|
success: !0,
|
|
7767
7803
|
restoredNodeId: r
|
|
7768
|
-
})
|
|
7804
|
+
});
|
|
7769
7805
|
}), X.delete("/purge", async (e) => {
|
|
7770
7806
|
let t = e.get("db"), n = e.req.query("id");
|
|
7771
7807
|
if (!n) return e.json({ error: "Node ID required" }, 400);
|
|
7772
|
-
let r = Number(n);
|
|
7773
|
-
return 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
|
|
7808
|
+
let r = Number(n), i = await t.prepare("SELECT slug, status FROM content_nodes WHERE id = ?").get(r);
|
|
7809
|
+
return 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 q(e).clear(), i && i.status === "published" && i.slug && e.executionCtx.waitUntil(yi(e.env, i.slug)), e.json({
|
|
7774
7810
|
success: !0,
|
|
7775
7811
|
purgedNodeId: r
|
|
7776
7812
|
});
|
|
7777
7813
|
});
|
|
7778
7814
|
//#endregion
|
|
7779
7815
|
//#region server/routes/admin/trees.ts
|
|
7780
|
-
var
|
|
7781
|
-
function
|
|
7816
|
+
var bi = new e();
|
|
7817
|
+
function xi(e, t = null) {
|
|
7782
7818
|
let n = [];
|
|
7783
7819
|
for (let r = 0; r < e.length; r++) {
|
|
7784
7820
|
let i = e[r];
|
|
@@ -7791,20 +7827,20 @@ function bi(e, t = null) {
|
|
|
7791
7827
|
id: a,
|
|
7792
7828
|
parentId: t,
|
|
7793
7829
|
sortOrder: r
|
|
7794
|
-
}), i.children && Array.isArray(i.children) && i.children.length > 0 && n.push(...
|
|
7830
|
+
}), i.children && Array.isArray(i.children) && i.children.length > 0 && n.push(...xi(i.children, a));
|
|
7795
7831
|
}
|
|
7796
7832
|
}
|
|
7797
7833
|
return n;
|
|
7798
7834
|
}
|
|
7799
|
-
function
|
|
7835
|
+
function Si(e) {
|
|
7800
7836
|
if (e == null || e === "null" || e === "" || typeof e == "string" && e.startsWith("draft-")) return null;
|
|
7801
7837
|
let t = Number(e);
|
|
7802
7838
|
return isNaN(t) ? null : t;
|
|
7803
7839
|
}
|
|
7804
|
-
function
|
|
7840
|
+
function Ci(e) {
|
|
7805
7841
|
return +(e === !0 || e === 1 || e === "1" || e === "true");
|
|
7806
7842
|
}
|
|
7807
|
-
|
|
7843
|
+
bi.get("/tree.json", async (e) => {
|
|
7808
7844
|
try {
|
|
7809
7845
|
let t = e.get("db"), n = e.req.query("treeId") || "main-nav", r = e.req.query("preview") === "true", i = 1;
|
|
7810
7846
|
if (isNaN(Number(n))) {
|
|
@@ -7853,9 +7889,9 @@ yi.get("/tree.json", async (e) => {
|
|
|
7853
7889
|
} catch (t) {
|
|
7854
7890
|
return console.error("[CMS Tree API] GET Error:", t), e.json({ error: t.message || "Failed to fetch tree" }, 500);
|
|
7855
7891
|
}
|
|
7856
|
-
}),
|
|
7892
|
+
}), bi.post("/tree.json", async (e) => {
|
|
7857
7893
|
try {
|
|
7858
|
-
let t = e.get("db"), n = await e.req.json(), r = n.treeId ? String(n.treeId).trim() : "main-nav", i =
|
|
7894
|
+
let t = e.get("db"), n = await e.req.json(), r = n.treeId ? String(n.treeId).trim() : "main-nav", i = q(e), a = 1;
|
|
7859
7895
|
if (isNaN(Number(r))) {
|
|
7860
7896
|
let e = await t.prepare("SELECT id FROM trees WHERE key = ?").get(r);
|
|
7861
7897
|
if (e && e.id) a = Number(e.id);
|
|
@@ -7865,7 +7901,7 @@ yi.get("/tree.json", async (e) => {
|
|
|
7865
7901
|
}
|
|
7866
7902
|
} else a = Number(r);
|
|
7867
7903
|
if (n.tree && Array.isArray(n.tree)) {
|
|
7868
|
-
let r =
|
|
7904
|
+
let r = xi(n.tree, null);
|
|
7869
7905
|
if (r.length > 0) for (let e = 0; e < r.length; e += 50) {
|
|
7870
7906
|
let n = r.slice(e, e + 50), i = n.map((e) => e.id), o = i.map(() => "?").join(","), s = "UPDATE tree_nodes SET \n";
|
|
7871
7907
|
s += "parentId = CASE id \n", n.forEach(() => {
|
|
@@ -7882,9 +7918,9 @@ yi.get("/tree.json", async (e) => {
|
|
|
7882
7918
|
}
|
|
7883
7919
|
return await i.clear(), e.json({ success: !0 });
|
|
7884
7920
|
}
|
|
7885
|
-
let { action: o, title: s, nodeType: c, parentId: l, contentId: u, nodeData: d = {}, pageData: f = {} } = n, p = Object.keys(d).length > 0 ? { ...d } : { ...f }, m =
|
|
7921
|
+
let { action: o, title: s, nodeType: c, parentId: l, contentId: u, nodeData: d = {}, pageData: f = {} } = n, p = Object.keys(d).length > 0 ? { ...d } : { ...f }, m = Ci(n.isHidden === void 0 ? p.isHidden === void 0 ? p.hidden : p.isHidden : n.isHidden);
|
|
7886
7922
|
delete p._isTreeDraft, delete p._draftParentId, delete p.isNew, delete p.nodeType, delete p.contentType, delete p.title, delete p.slug, delete p.hidden, delete p.is_hidden, delete p.isHidden, delete p.status;
|
|
7887
|
-
let h =
|
|
7923
|
+
let h = Si(l), g = e.get("user")?.id || null;
|
|
7888
7924
|
if (o === "create") {
|
|
7889
7925
|
let r = p.slug || n.slug || s, o = r ? String(r).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") : null;
|
|
7890
7926
|
if (o) {
|
|
@@ -7970,7 +8006,7 @@ yi.get("/tree.json", async (e) => {
|
|
|
7970
8006
|
details: t.message
|
|
7971
8007
|
}, 500);
|
|
7972
8008
|
}
|
|
7973
|
-
}),
|
|
8009
|
+
}), bi.get("/trees.json", async (e) => {
|
|
7974
8010
|
try {
|
|
7975
8011
|
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) => {
|
|
7976
8012
|
let n = Number(t.treeId), r = Number(t.channelId);
|
|
@@ -7999,7 +8035,7 @@ yi.get("/tree.json", async (e) => {
|
|
|
7999
8035
|
} catch {
|
|
8000
8036
|
return e.json([]);
|
|
8001
8037
|
}
|
|
8002
|
-
}),
|
|
8038
|
+
}), bi.post("/trees.json", async (e) => {
|
|
8003
8039
|
try {
|
|
8004
8040
|
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 };
|
|
8005
8041
|
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({
|
|
@@ -8024,7 +8060,7 @@ yi.get("/tree.json", async (e) => {
|
|
|
8024
8060
|
await t.prepare(`INSERT OR IGNORE INTO channel_trees (channelId, treeId, key) VALUES ${n}`).run(...r);
|
|
8025
8061
|
}
|
|
8026
8062
|
}
|
|
8027
|
-
return await
|
|
8063
|
+
return await q(e).clear(), e.json({
|
|
8028
8064
|
success: !0,
|
|
8029
8065
|
id: p,
|
|
8030
8066
|
key: o,
|
|
@@ -8038,12 +8074,12 @@ yi.get("/tree.json", async (e) => {
|
|
|
8038
8074
|
} catch (t) {
|
|
8039
8075
|
return console.error("[API Trees] Error saving tree:", t), e.json({ error: t.message || "Failed to save tree" }, 500);
|
|
8040
8076
|
}
|
|
8041
|
-
}),
|
|
8077
|
+
}), bi.delete("/trees.json", async (e) => {
|
|
8042
8078
|
let t = e.get("db"), n = e.req.query("id");
|
|
8043
8079
|
if (!n) return e.json({ error: "Tree ID required" }, 400);
|
|
8044
8080
|
let r = Number(n);
|
|
8045
8081
|
try {
|
|
8046
|
-
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
|
|
8082
|
+
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 q(e).clear(), e.json({
|
|
8047
8083
|
success: !0,
|
|
8048
8084
|
deletedTreeId: r
|
|
8049
8085
|
});
|
|
@@ -8053,8 +8089,8 @@ yi.get("/tree.json", async (e) => {
|
|
|
8053
8089
|
});
|
|
8054
8090
|
//#endregion
|
|
8055
8091
|
//#region server/routes/admin/channels.ts
|
|
8056
|
-
var
|
|
8057
|
-
|
|
8092
|
+
var wi = new e();
|
|
8093
|
+
wi.get("/", async (e) => {
|
|
8058
8094
|
try {
|
|
8059
8095
|
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) => {
|
|
8060
8096
|
e[t.channelId] || (e[t.channelId] = []);
|
|
@@ -8120,7 +8156,7 @@ Ci.get("/", async (e) => {
|
|
|
8120
8156
|
error: t.message
|
|
8121
8157
|
}, 500);
|
|
8122
8158
|
}
|
|
8123
|
-
}),
|
|
8159
|
+
}), wi.post("/", async (e) => {
|
|
8124
8160
|
try {
|
|
8125
8161
|
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;
|
|
8126
8162
|
if (await t.prepare("SELECT id FROM channels WHERE key = ? AND id != ? LIMIT 1").get(y, i ?? -1)) return e.json({
|
|
@@ -8147,7 +8183,7 @@ Ci.get("/", async (e) => {
|
|
|
8147
8183
|
VALUES ${e}
|
|
8148
8184
|
`).run(...n);
|
|
8149
8185
|
}
|
|
8150
|
-
return await
|
|
8186
|
+
return await q(e).clear(), e.json({
|
|
8151
8187
|
success: !0,
|
|
8152
8188
|
id: w
|
|
8153
8189
|
});
|
|
@@ -8157,12 +8193,12 @@ Ci.get("/", async (e) => {
|
|
|
8157
8193
|
details: t.message
|
|
8158
8194
|
}, 500);
|
|
8159
8195
|
}
|
|
8160
|
-
}),
|
|
8196
|
+
}), wi.delete("/", async (e) => {
|
|
8161
8197
|
let t = e.get("db"), n = e.req.query("id");
|
|
8162
8198
|
if (!n) return e.json({ error: "Channel ID required" }, 400);
|
|
8163
8199
|
let r = Number(n);
|
|
8164
8200
|
try {
|
|
8165
|
-
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
|
|
8201
|
+
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 q(e).clear(), e.json({
|
|
8166
8202
|
success: !0,
|
|
8167
8203
|
deletedSiteId: r
|
|
8168
8204
|
});
|
|
@@ -8175,10 +8211,10 @@ Ci.get("/", async (e) => {
|
|
|
8175
8211
|
});
|
|
8176
8212
|
//#endregion
|
|
8177
8213
|
//#region server/routes/admin/schemas.ts
|
|
8178
|
-
var
|
|
8214
|
+
var Ti = new e(), Ei = null, Di = (e) => {
|
|
8179
8215
|
try {
|
|
8180
|
-
if (!
|
|
8181
|
-
let t = ci(e.env?.BUNDLED_DEFINITIONS ||
|
|
8216
|
+
if (!Ei) {
|
|
8217
|
+
let t = ci(e.env?.BUNDLED_DEFINITIONS || Ar), n = t.userTemplate || {
|
|
8182
8218
|
id: "userTemplate",
|
|
8183
8219
|
label: "User Account",
|
|
8184
8220
|
fields: {
|
|
@@ -8214,7 +8250,7 @@ var wi = new e(), Ti = null, Ei = (e) => {
|
|
|
8214
8250
|
}
|
|
8215
8251
|
}
|
|
8216
8252
|
};
|
|
8217
|
-
|
|
8253
|
+
Ei = {
|
|
8218
8254
|
channelTemplate: t.channelTemplate || null,
|
|
8219
8255
|
treeTemplate: t.treeTemplate || null,
|
|
8220
8256
|
userTemplate: n,
|
|
@@ -8226,7 +8262,7 @@ var wi = new e(), Ti = null, Ei = (e) => {
|
|
|
8226
8262
|
blockLayouts: t.blockLayouts || {}
|
|
8227
8263
|
};
|
|
8228
8264
|
}
|
|
8229
|
-
return e.json(
|
|
8265
|
+
return e.json(Ei, 200, { "Cache-Control": "public, max-age=300, stale-while-revalidate=86400" });
|
|
8230
8266
|
} catch (t) {
|
|
8231
8267
|
return console.error("[CMS API] Error loading schemas:", t), e.json({
|
|
8232
8268
|
error: "Failed to load schemas",
|
|
@@ -8234,10 +8270,10 @@ var wi = new e(), Ti = null, Ei = (e) => {
|
|
|
8234
8270
|
}, 500);
|
|
8235
8271
|
}
|
|
8236
8272
|
};
|
|
8237
|
-
|
|
8273
|
+
Ti.get("/", Di), Ti.get("/schemas.json", Di);
|
|
8238
8274
|
//#endregion
|
|
8239
8275
|
//#region server/routes/admin/validation.ts
|
|
8240
|
-
var
|
|
8276
|
+
var Oi = new e(), ki = {
|
|
8241
8277
|
node: "content_nodes",
|
|
8242
8278
|
nodes: "content_nodes",
|
|
8243
8279
|
content_node: "content_nodes",
|
|
@@ -8249,7 +8285,7 @@ var Di = new e(), Oi = {
|
|
|
8249
8285
|
user: "users",
|
|
8250
8286
|
users: "users",
|
|
8251
8287
|
user_account: "user_accounts"
|
|
8252
|
-
},
|
|
8288
|
+
}, Ai = {
|
|
8253
8289
|
content_nodes: [
|
|
8254
8290
|
"id",
|
|
8255
8291
|
"title",
|
|
@@ -8306,11 +8342,11 @@ var Di = new e(), Oi = {
|
|
|
8306
8342
|
"createdAt"
|
|
8307
8343
|
]
|
|
8308
8344
|
};
|
|
8309
|
-
|
|
8345
|
+
Oi.post("/validate-unique", async (e) => {
|
|
8310
8346
|
try {
|
|
8311
8347
|
let t = e.get("db"), { entityType: n, field: r, value: i, excludeId: a } = await e.req.json();
|
|
8312
8348
|
if (!r || i == null || String(i).trim() === "") return e.json({ isUnique: !0 });
|
|
8313
|
-
let o =
|
|
8349
|
+
let o = ki[n] || "content_nodes", s = r.replace(/[^a-zA-Z0-9_]/g, ""), c = (Ai[o] || Ai.content_nodes).includes(s), l = -1;
|
|
8314
8350
|
if (a != null && String(a).trim() !== "") {
|
|
8315
8351
|
let e = Number(a);
|
|
8316
8352
|
l = isNaN(e) ? String(a) : e;
|
|
@@ -8322,7 +8358,7 @@ Di.post("/validate-unique", async (e) => {
|
|
|
8322
8358
|
} catch (t) {
|
|
8323
8359
|
return console.error("[API Validation] Error validating global uniqueness:", t), e.json({ error: "Failed to validate uniqueness" }, 500);
|
|
8324
8360
|
}
|
|
8325
|
-
}),
|
|
8361
|
+
}), Oi.post("/validate-unique-sibling", async (e) => {
|
|
8326
8362
|
try {
|
|
8327
8363
|
let t = e.get("db"), { slug: n, treeId: r, parentId: i, excludeTreeNodeId: a } = await e.req.json();
|
|
8328
8364
|
if (!n || !String(n).trim() || !r) return e.json({ isUnique: !0 });
|
|
@@ -8349,8 +8385,8 @@ Di.post("/validate-unique", async (e) => {
|
|
|
8349
8385
|
});
|
|
8350
8386
|
//#endregion
|
|
8351
8387
|
//#region server/routes/admin/stats.ts
|
|
8352
|
-
var
|
|
8353
|
-
|
|
8388
|
+
var ji = new e();
|
|
8389
|
+
ji.get("/", async (e) => {
|
|
8354
8390
|
try {
|
|
8355
8391
|
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) => ({
|
|
8356
8392
|
...e,
|
|
@@ -8406,12 +8442,12 @@ async function Q(e, t, n = []) {
|
|
|
8406
8442
|
}
|
|
8407
8443
|
return [];
|
|
8408
8444
|
}
|
|
8409
|
-
async function
|
|
8445
|
+
async function Mi(e, t, n = []) {
|
|
8410
8446
|
let r = e.prepare(t);
|
|
8411
8447
|
if (typeof r.bind == "function") return await r.bind(...n).run();
|
|
8412
8448
|
if (typeof r.run == "function") return await r.run(...n);
|
|
8413
8449
|
}
|
|
8414
|
-
function
|
|
8450
|
+
function Ni(e, t, n) {
|
|
8415
8451
|
let r = e || (t ? `/media/${t}` : "");
|
|
8416
8452
|
return r && n && r.startsWith(`https://${n}/`) && !r.includes("/media/") && (r = r.replace(`https://${n}/`, `https://${n}/media/`)), r;
|
|
8417
8453
|
}
|
|
@@ -8482,7 +8518,7 @@ Z.get("/", async (e) => {
|
|
|
8482
8518
|
...JSON.parse(t.dataJson || "{}")
|
|
8483
8519
|
};
|
|
8484
8520
|
} catch {}
|
|
8485
|
-
let r =
|
|
8521
|
+
let r = Ni(t.cdnUrl, t.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8486
8522
|
return {
|
|
8487
8523
|
id: t.id,
|
|
8488
8524
|
filename: t.filename || "Untitled Asset",
|
|
@@ -8508,7 +8544,7 @@ Z.get("/", async (e) => {
|
|
|
8508
8544
|
}
|
|
8509
8545
|
}), Z.post("/upload", async (e) => {
|
|
8510
8546
|
try {
|
|
8511
|
-
let t = u(e), n =
|
|
8547
|
+
let t = u(e), n = ri(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;
|
|
8512
8548
|
s && (await Q(t, "SELECT id FROM assets WHERE id = ?", [s])).length === 0 && (s = null);
|
|
8513
8549
|
let c = r.cropCoordinates, l = null, d = null;
|
|
8514
8550
|
if (c) {
|
|
@@ -8525,7 +8561,7 @@ Z.get("/", async (e) => {
|
|
|
8525
8561
|
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;
|
|
8526
8562
|
T && (await Q(t, "SELECT id FROM users WHERE id = ?", [T])).length === 0 && (T = null);
|
|
8527
8563
|
let E = +!!h;
|
|
8528
|
-
await
|
|
8564
|
+
await Mi(t, "\n INSERT INTO assets (id, filename, mimeType, sizeBytes, storageKeyPrivate, cdnUrl, createdById, isSystemVariant, parentAssetId, cropCoordinatesJson)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n ", [
|
|
8529
8565
|
p,
|
|
8530
8566
|
i.name,
|
|
8531
8567
|
S,
|
|
@@ -8540,7 +8576,7 @@ Z.get("/", async (e) => {
|
|
|
8540
8576
|
let D = x;
|
|
8541
8577
|
if (s) {
|
|
8542
8578
|
let e = await Q(t, "SELECT cdnUrl, storageKeyPrivate FROM assets WHERE id = ?", [s]);
|
|
8543
|
-
e.length > 0 && (D =
|
|
8579
|
+
e.length > 0 && (D = Ni(e[0].cdnUrl, e[0].storageKeyPrivate, y));
|
|
8544
8580
|
}
|
|
8545
8581
|
return e.json({
|
|
8546
8582
|
id: p,
|
|
@@ -8582,7 +8618,7 @@ Z.get("/", async (e) => {
|
|
|
8582
8618
|
...JSON.parse(i.dataJson || "{}")
|
|
8583
8619
|
};
|
|
8584
8620
|
} catch {}
|
|
8585
|
-
let l =
|
|
8621
|
+
let l = Ni(i.cdnUrl, i.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8586
8622
|
return e.json({
|
|
8587
8623
|
id: i.id,
|
|
8588
8624
|
filename: i.filename,
|
|
@@ -8609,7 +8645,7 @@ Z.get("/", async (e) => {
|
|
|
8609
8645
|
createdAt: t.createdAt,
|
|
8610
8646
|
parentAssetId: t.parentAssetId || i.id,
|
|
8611
8647
|
cropCoordinates: n,
|
|
8612
|
-
url:
|
|
8648
|
+
url: Ni(t.cdnUrl, t.storageKeyPrivate, e.env?.CDN_DOMAIN),
|
|
8613
8649
|
originalUrl: l
|
|
8614
8650
|
};
|
|
8615
8651
|
})
|
|
@@ -8625,7 +8661,7 @@ Z.get("/", async (e) => {
|
|
|
8625
8661
|
try {
|
|
8626
8662
|
o = JSON.parse(a.dataJson || "{}");
|
|
8627
8663
|
} catch {}
|
|
8628
|
-
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
|
|
8664
|
+
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 Mi(t, "UPDATE assets SET filename = ?, dataJson = ?, updatedAt = CURRENT_TIMESTAMP WHERE id = ?", [
|
|
8629
8665
|
r.filename === void 0 ? a.filename : r.filename,
|
|
8630
8666
|
JSON.stringify(o),
|
|
8631
8667
|
n
|
|
@@ -8636,7 +8672,7 @@ Z.get("/", async (e) => {
|
|
|
8636
8672
|
}), Z.delete("/:id", async (e) => {
|
|
8637
8673
|
try {
|
|
8638
8674
|
let t = u(e), n = e.req.param("id"), r = (await Q(t, "SELECT id, filename, isSystemVariant FROM assets WHERE id = ?", [n]))[0];
|
|
8639
|
-
return r ? (r.isSystemVariant ? await
|
|
8675
|
+
return r ? (r.isSystemVariant ? await Mi(t, "UPDATE assets SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?", [n]) : await Mi(t, "UPDATE assets\n SET deletedAt = CURRENT_TIMESTAMP\n WHERE id = ? OR parentAssetId = ? OR (isSystemVariant = 1 AND (filename LIKE ? OR filename LIKE ?))", [
|
|
8640
8676
|
n,
|
|
8641
8677
|
n,
|
|
8642
8678
|
`crop_%${r.filename ? r.filename.replace(/\.[^/.]+$/, "") : ""}%`,
|
|
@@ -8657,7 +8693,7 @@ Z.get("/", async (e) => {
|
|
|
8657
8693
|
let t = u(e), n = await e.req.json(), r = n.id || n.assetId;
|
|
8658
8694
|
if (!r) return e.json({ error: "Asset ID required" }, 400);
|
|
8659
8695
|
let i = (await Q(t, "SELECT id, filename FROM assets WHERE id = ?", [r]))[0];
|
|
8660
|
-
return i ? (await
|
|
8696
|
+
return i ? (await Mi(t, "UPDATE assets \n SET deletedAt = NULL \n WHERE id = ? OR parentAssetId = ? OR (isSystemVariant = 1 AND (filename LIKE ? OR filename LIKE ?))", [
|
|
8661
8697
|
r,
|
|
8662
8698
|
r,
|
|
8663
8699
|
`crop_%${i.filename ? i.filename.replace(/\.[^/.]+$/, "") : ""}%`,
|
|
@@ -8675,7 +8711,7 @@ Z.get("/", async (e) => {
|
|
|
8675
8711
|
}
|
|
8676
8712
|
}), Z.delete("/purge/:id", async (e) => {
|
|
8677
8713
|
try {
|
|
8678
|
-
let t = u(e), n =
|
|
8714
|
+
let t = u(e), n = ri(e.env), r = e.req.param("id"), i = (await Q(t, "SELECT id, filename, storageKeyPrivate, isSystemVariant FROM assets WHERE id = ?", [r]))[0];
|
|
8679
8715
|
if (!i) return e.json({ error: "Asset not found" }, 404);
|
|
8680
8716
|
let a = [i];
|
|
8681
8717
|
i.isSystemVariant || (a = [i, ...await Q(t, "SELECT id, storageKeyPrivate FROM assets \n WHERE parentAssetId = ? OR (isSystemVariant = 1 AND (filename LIKE ? OR filename LIKE ?))", [
|
|
@@ -8692,7 +8728,7 @@ Z.get("/", async (e) => {
|
|
|
8692
8728
|
}
|
|
8693
8729
|
}
|
|
8694
8730
|
let s = o.map(() => "?").join(",");
|
|
8695
|
-
return await
|
|
8731
|
+
return await Mi(t, `DELETE FROM node_assets WHERE assetId IN (${s})`, o), await Mi(t, `DELETE FROM assets WHERE id IN (${s})`, o), e.json({
|
|
8696
8732
|
success: !0,
|
|
8697
8733
|
id: r,
|
|
8698
8734
|
purged: !0,
|
|
@@ -8708,8 +8744,8 @@ Z.get("/", async (e) => {
|
|
|
8708
8744
|
});
|
|
8709
8745
|
//#endregion
|
|
8710
8746
|
//#region server/routes/public/node.ts
|
|
8711
|
-
var
|
|
8712
|
-
function
|
|
8747
|
+
var Pi = new e();
|
|
8748
|
+
function Fi(e, t) {
|
|
8713
8749
|
let n = /* @__PURE__ */ new Date();
|
|
8714
8750
|
if (e && String(e).trim() !== "") {
|
|
8715
8751
|
let t = new Date(e);
|
|
@@ -8721,7 +8757,7 @@ function Pi(e, t) {
|
|
|
8721
8757
|
}
|
|
8722
8758
|
return !0;
|
|
8723
8759
|
}
|
|
8724
|
-
async function
|
|
8760
|
+
async function Ii(e, t) {
|
|
8725
8761
|
if (!t || typeof t != "object") return t;
|
|
8726
8762
|
let n = { ...t };
|
|
8727
8763
|
for (let [t, r] of Object.entries(n)) if (typeof r == "string" && r.startsWith("ast_")) try {
|
|
@@ -8742,10 +8778,10 @@ async function Fi(e, t) {
|
|
|
8742
8778
|
};
|
|
8743
8779
|
}
|
|
8744
8780
|
} catch {}
|
|
8745
|
-
else typeof r == "object" && r && !Array.isArray(r) && !r.url && (n[t] = await
|
|
8781
|
+
else typeof r == "object" && r && !Array.isArray(r) && !r.url && (n[t] = await Ii(e, r));
|
|
8746
8782
|
return n;
|
|
8747
8783
|
}
|
|
8748
|
-
async function
|
|
8784
|
+
async function Li(e, t, n) {
|
|
8749
8785
|
let r = t.filter((e) => e.componentId === "content-feed" || e.componentId === "article-list");
|
|
8750
8786
|
for (let t of r) {
|
|
8751
8787
|
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];
|
|
@@ -8761,7 +8797,7 @@ async function Ii(e, t, n) {
|
|
|
8761
8797
|
if (e.dataJson) try {
|
|
8762
8798
|
t = typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson;
|
|
8763
8799
|
} catch {}
|
|
8764
|
-
return
|
|
8800
|
+
return Fi(t.startShowingAt, t.stopShowingAt) ? {
|
|
8765
8801
|
id: e.id,
|
|
8766
8802
|
title: e.title,
|
|
8767
8803
|
slug: e.slug,
|
|
@@ -8778,7 +8814,7 @@ async function Ii(e, t, n) {
|
|
|
8778
8814
|
}
|
|
8779
8815
|
}
|
|
8780
8816
|
}
|
|
8781
|
-
async function
|
|
8817
|
+
async function Ri(e, t, n, r, i = !1) {
|
|
8782
8818
|
if (!t) return { blocks: [] };
|
|
8783
8819
|
let a = 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 UNION ALL\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 * FROM ancestor_path ORDER BY level ASC\n ").all(t, t), o = Array.isArray(a) ? a : a?.results || [];
|
|
8784
8820
|
if (!o || o.length === 0) return { blocks: [] };
|
|
@@ -8808,10 +8844,10 @@ async function Li(e, t, n, r, i = !1) {
|
|
|
8808
8844
|
try {
|
|
8809
8845
|
o = (typeof t.dataJson == "string" ? JSON.parse(t.dataJson) : t.dataJson) || {};
|
|
8810
8846
|
} catch {}
|
|
8811
|
-
let s = o.hidden === !0 || o.hidden === 1 || o.hidden === "1" || o.hidden === "true", l =
|
|
8847
|
+
let s = o.hidden === !0 || o.hidden === 1 || o.hidden === "1" || o.hidden === "true", l = Fi(o.startShowingAt, o.stopShowingAt);
|
|
8812
8848
|
if (!i && (s || !l)) continue;
|
|
8813
|
-
let u = t.elementType || t.componentId || "text-block", d = r.blocks?.[u]?.fields || r.elements?.[u]?.fields || r.components?.[u]?.fields || {}, f = String(o.blockId || o._instanceId || o.id || t.blockId || t.id), p =
|
|
8814
|
-
p = await oi(e, p), p = await
|
|
8849
|
+
let u = t.elementType || t.componentId || "text-block", d = r.blocks?.[u]?.fields || r.elements?.[u]?.fields || r.components?.[u]?.fields || {}, f = String(o.blockId || o._instanceId || o.id || t.blockId || t.id), p = zi(o, d);
|
|
8850
|
+
p = await oi(e, p), p = await Ii(e, p), p = Bi(p), p.blockId = f;
|
|
8815
8851
|
let m = t.region || n;
|
|
8816
8852
|
c[m] || (c[m] = []), c[m].push({
|
|
8817
8853
|
instanceId: t.id,
|
|
@@ -8830,7 +8866,7 @@ async function Li(e, t, n, r, i = !1) {
|
|
|
8830
8866
|
}
|
|
8831
8867
|
return { blocks: [] };
|
|
8832
8868
|
}
|
|
8833
|
-
function
|
|
8869
|
+
function zi(e, t = {}) {
|
|
8834
8870
|
let n = {};
|
|
8835
8871
|
for (let [r, i] of Object.entries(e)) {
|
|
8836
8872
|
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;
|
|
@@ -8839,14 +8875,14 @@ function Ri(e, t = {}) {
|
|
|
8839
8875
|
}
|
|
8840
8876
|
return n;
|
|
8841
8877
|
}
|
|
8842
|
-
function
|
|
8843
|
-
if (Array.isArray(e)) return e.map(
|
|
8878
|
+
function Bi(e) {
|
|
8879
|
+
if (Array.isArray(e)) return e.map(Bi);
|
|
8844
8880
|
if (!e || typeof e != "object") return e;
|
|
8845
8881
|
if (typeof e.id == "string" && e.id.startsWith("ast_") && typeof e.url == "string") {
|
|
8846
8882
|
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 ? {
|
|
8847
8883
|
...t,
|
|
8848
8884
|
...t.crops?.[r] || {}
|
|
8849
|
-
} : t, a = Object.fromEntries(Object.entries(n).filter(([, t]) => t?.id !== e.id).map(([t, n]) => [t,
|
|
8885
|
+
} : t, a = Object.fromEntries(Object.entries(n).filter(([, t]) => t?.id !== e.id).map(([t, n]) => [t, Bi({
|
|
8850
8886
|
...n,
|
|
8851
8887
|
title: n?.title ?? e.title ?? "",
|
|
8852
8888
|
alt: n?.alt ?? e.alt ?? "",
|
|
@@ -8860,9 +8896,9 @@ function zi(e) {
|
|
|
8860
8896
|
...Object.keys(a).length > 0 ? { variants: a } : {}
|
|
8861
8897
|
};
|
|
8862
8898
|
}
|
|
8863
|
-
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e,
|
|
8899
|
+
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Bi(t)]));
|
|
8864
8900
|
}
|
|
8865
|
-
async function
|
|
8901
|
+
async function Vi(e, t) {
|
|
8866
8902
|
if (typeof t == "string") {
|
|
8867
8903
|
if (!t.includes("#node:") && !t.includes("data-node-id") && !t.includes("#asset:") && !t.includes("data-asset-id")) return t;
|
|
8868
8904
|
let n = /* @__PURE__ */ new Set();
|
|
@@ -8879,7 +8915,7 @@ async function Bi(e, t) {
|
|
|
8879
8915
|
let t = n[1], r = t.match(/data-node-id=["']([^"']+)["']/i), i = t.match(/data-tree-id=["']([^"']+)["']/i);
|
|
8880
8916
|
if (!r || !i) continue;
|
|
8881
8917
|
let a = await e.prepare("SELECT id as treeNodeId FROM tree_nodes WHERE contentId = ? AND treeId = ? LIMIT 1").get(r[1], i[1]);
|
|
8882
|
-
a?.treeNodeId && u.set(`${r[1]}:${i[1]}`, await
|
|
8918
|
+
a?.treeNodeId && u.set(`${r[1]}:${i[1]}`, await Wi(e, String(a.treeNodeId), i[1]));
|
|
8883
8919
|
}
|
|
8884
8920
|
return t.replace(d, (e, t) => {
|
|
8885
8921
|
let n = t.match(/data-node-id=["']([^"']+)["']/i), r = t.match(/data-asset-id=["']([^"']+)["']/i), i = t.match(/href=["']([^"']+)["']/i);
|
|
@@ -8894,18 +8930,18 @@ async function Bi(e, t) {
|
|
|
8894
8930
|
return i ? `<a${t.replace(/href=["'][^"']*["']/i, `href="${g || "/"}"`)}>` : e;
|
|
8895
8931
|
});
|
|
8896
8932
|
}
|
|
8897
|
-
if (Array.isArray(t)) return Promise.all(t.map((t) =>
|
|
8933
|
+
if (Array.isArray(t)) return Promise.all(t.map((t) => Vi(e, t)));
|
|
8898
8934
|
if (t && typeof t == "object") {
|
|
8899
8935
|
if (typeof t.href == "string" && (t.href.startsWith("#node:") || t.href.startsWith("#asset:"))) return {
|
|
8900
8936
|
...t,
|
|
8901
|
-
href: await
|
|
8937
|
+
href: await Hi(e, t)
|
|
8902
8938
|
};
|
|
8903
|
-
let n = await Promise.all(Object.entries(t).map(async ([t, n]) => [t, await
|
|
8939
|
+
let n = await Promise.all(Object.entries(t).map(async ([t, n]) => [t, await Vi(e, n)]));
|
|
8904
8940
|
return Object.fromEntries(n);
|
|
8905
8941
|
}
|
|
8906
8942
|
return t;
|
|
8907
8943
|
}
|
|
8908
|
-
async function
|
|
8944
|
+
async function Hi(e, t) {
|
|
8909
8945
|
let n = t.href.match(/^#node:(.+)$/), r = t.href.match(/^#asset:(.+)$/);
|
|
8910
8946
|
if (r) {
|
|
8911
8947
|
let t = await e.prepare("SELECT cdnUrl, storageKeyPrivate FROM assets WHERE id = ?").get(r[1]);
|
|
@@ -8916,14 +8952,14 @@ async function Vi(e, t) {
|
|
|
8916
8952
|
if (t.treeId) {
|
|
8917
8953
|
let n = await e.prepare("SELECT id as treeNodeId FROM tree_nodes WHERE contentId = ? AND treeId = ? LIMIT 1").get(i, t.treeId);
|
|
8918
8954
|
if (n?.treeNodeId) {
|
|
8919
|
-
let r = await
|
|
8955
|
+
let r = await Wi(e, String(n.treeNodeId), String(t.treeId));
|
|
8920
8956
|
if (r) return r;
|
|
8921
8957
|
}
|
|
8922
8958
|
}
|
|
8923
8959
|
let a = await e.prepare("SELECT slug FROM content_nodes WHERE id = ?").get(i);
|
|
8924
8960
|
return a?.slug ? `/${String(a.slug).replace(/^\/+|\/+$/g, "")}` : "#";
|
|
8925
8961
|
}
|
|
8926
|
-
function
|
|
8962
|
+
function Ui(e) {
|
|
8927
8963
|
let t = e.socialImage;
|
|
8928
8964
|
if (!t || typeof t != "object") return null;
|
|
8929
8965
|
let n = (e, t) => {
|
|
@@ -8954,7 +8990,7 @@ function Hi(e) {
|
|
|
8954
8990
|
])
|
|
8955
8991
|
};
|
|
8956
8992
|
}
|
|
8957
|
-
async function
|
|
8993
|
+
async function Wi(e, t, n) {
|
|
8958
8994
|
if (!t) return "";
|
|
8959
8995
|
let r = await e.prepare("\n WITH RECURSIVE ancestor_path(id, parentId, slug, level) AS (\n SELECT t.id, t.parentId, c.slug, 0\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE t.id = ? AND t.treeId = ?\n UNION ALL\n SELECT t.id, t.parentId, c.slug, 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 WHERE t.treeId = ?\n )\n SELECT slug FROM ancestor_path ORDER BY level DESC\n ").all(t, n, n), i = Array.isArray(r) ? r : r?.results || [], a = [];
|
|
8960
8996
|
for (let e of i) {
|
|
@@ -8963,7 +8999,7 @@ async function Ui(e, t, n) {
|
|
|
8963
8999
|
}
|
|
8964
9000
|
return "/" + a.join("/");
|
|
8965
9001
|
}
|
|
8966
|
-
async function
|
|
9002
|
+
async function Gi(e, t, n, r, i) {
|
|
8967
9003
|
let a = {}, o = null;
|
|
8968
9004
|
if (t) {
|
|
8969
9005
|
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 UNION ALL\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([
|
|
@@ -9001,13 +9037,13 @@ async function Wi(e, t, n, r, i) {
|
|
|
9001
9037
|
inheritedFields: a
|
|
9002
9038
|
};
|
|
9003
9039
|
}
|
|
9004
|
-
|
|
9040
|
+
Pi.get("/*", async (e) => {
|
|
9005
9041
|
try {
|
|
9006
9042
|
let t = e.get("db"), n = new URL(e.req.url).pathname.match(/\/node\/(.+)$/), r = (n ? n[1] : "home").replace(/^\/+|\/+$/g, ""), i = e.req.query("channelId") || e.req.query("channel") || "1", a = e.req.query("lang") || "en", o = e.req.query("preview") === "true", s = isNaN(Number(i)) ? await t.prepare("SELECT * FROM channels WHERE key = ?").get(i) : await t.prepare("SELECT * FROM channels WHERE id = ?").get(Number(i));
|
|
9007
9043
|
if (!s) return e.json({ error: `Channel '${i}' not found` }, 404);
|
|
9008
9044
|
let c = s.status === "disabled" || s.status === "inactive" || s.isEnabled === 0 || s.isEnabled === !1;
|
|
9009
9045
|
if (!o && c) return e.json({ error: `Channel '${s.key || i}' is currently inactive` }, 404);
|
|
9010
|
-
let l = s.id, u = s.key || i, d =
|
|
9046
|
+
let l = s.id, u = s.key || i, d = q(e), f = `node:${l || u}:${a}:${r}`;
|
|
9011
9047
|
if (!o) {
|
|
9012
9048
|
let t = await d.get(f);
|
|
9013
9049
|
if (t) return e.header("X-Cache", "HIT"), e.json(t);
|
|
@@ -9023,7 +9059,7 @@ Ni.get("/*", async (e) => {
|
|
|
9023
9059
|
WHERE cn.slug = ? ${l === null ? "" : "AND nc.channelId = ?"}
|
|
9024
9060
|
`, o = l === null ? [n] : [n, l], s = await t.prepare(a).all(...o), c = Array.isArray(s) ? s : s?.results || [];
|
|
9025
9061
|
if (c.length > 0) for (let e of c) {
|
|
9026
|
-
let n = (await
|
|
9062
|
+
let n = (await Wi(t, e.treeNodeId, e.treeId)).replace(/^\/+|\/+$/g, ""), r = i.replace(/^\/+|\/+$/g, "");
|
|
9027
9063
|
if (n === r || r === "home" && (n === "" || n === "home")) {
|
|
9028
9064
|
h = e, g = e;
|
|
9029
9065
|
break;
|
|
@@ -9041,7 +9077,7 @@ Ni.get("/*", async (e) => {
|
|
|
9041
9077
|
LIMIT 1
|
|
9042
9078
|
`).get(...e);
|
|
9043
9079
|
}
|
|
9044
|
-
let v = g?.treeId || _ || "main-nav", y = g?.parentId || null, b = g?.treeNodeId ? await
|
|
9080
|
+
let v = g?.treeId || _ || "main-nav", y = g?.parentId || null, b = g?.treeNodeId ? await Wi(t, g.treeNodeId, v) : `/${(h.slug || "").replace(/^\/+|\/+$/g, "")}`, x = {
|
|
9045
9081
|
id: h.id,
|
|
9046
9082
|
title: h.title,
|
|
9047
9083
|
slug: h.slug,
|
|
@@ -9059,13 +9095,13 @@ Ni.get("/*", async (e) => {
|
|
|
9059
9095
|
k = typeof A == "string" ? JSON.parse(A) : A;
|
|
9060
9096
|
} catch {}
|
|
9061
9097
|
k.disabledRegions && (T = k.disabledRegions), O = k.hidden === !0 || k.hidden === 1 || k.hidden === "1" || k.hidden === "true", E = k.startShowingAt || null, D = k.stopShowingAt || null;
|
|
9062
|
-
let j = k.layoutId, ee = j && j !== "inherit", { resolvedLayoutId: te, inheritedFields: ne } = await
|
|
9098
|
+
let j = k.layoutId, ee = j && j !== "inherit", { resolvedLayoutId: te, inheritedFields: ne } = await Gi(t, y, v, o, w), re = ee ? j : te || C.defaultLayout || null;
|
|
9063
9099
|
for (let [e, t] of Object.entries(ne)) (k[e] === void 0 || k[e] === null || k[e] === "" || k[e] === "inherit") && t !== void 0 && (k[e] = t);
|
|
9064
|
-
let M = await oi(t,
|
|
9065
|
-
M = await
|
|
9066
|
-
let ie =
|
|
9100
|
+
let M = await oi(t, zi(k, w));
|
|
9101
|
+
M = await Ii(t, M), M = Bi(M), M = await Vi(t, M);
|
|
9102
|
+
let ie = Ui(M);
|
|
9067
9103
|
delete M.socialImage, delete M.fbImage, delete M.xImage, delete M.whatsappImage, ie && (M.socialImages = ie), x.slug = h.slug, x.title = h.title, Object.assign(x, M), x.layoutId = re;
|
|
9068
|
-
let ae = !!h.isHidden || O, oe = !
|
|
9104
|
+
let ae = !!h.isHidden || O, oe = !Fi(E, D);
|
|
9069
9105
|
if (!o && (ae || oe)) return e.json({ error: "Node is hidden or outside its scheduled publishing window" }, 404);
|
|
9070
9106
|
let se = [];
|
|
9071
9107
|
if (g?.treeNodeId) {
|
|
@@ -9075,7 +9111,7 @@ Ni.get("/*", async (e) => {
|
|
|
9075
9111
|
try {
|
|
9076
9112
|
t = (typeof n == "string" ? JSON.parse(n) : n) || {};
|
|
9077
9113
|
} catch {}
|
|
9078
|
-
let i = !!e.isHidden || t.hidden === !0 || t.hidden === 1 || t.hidden === "1", a =
|
|
9114
|
+
let i = !!e.isHidden || t.hidden === !0 || t.hidden === 1 || t.hidden === "1", a = Fi(t.startShowingAt, t.stopShowingAt), s = (e.slug || "").replace(/^\/+|\/+$/g, "");
|
|
9079
9115
|
return !o && (i || !a) ? null : {
|
|
9080
9116
|
treeNodeId: e.treeNodeId,
|
|
9081
9117
|
id: e.id,
|
|
@@ -9098,10 +9134,10 @@ Ni.get("/*", async (e) => {
|
|
|
9098
9134
|
try {
|
|
9099
9135
|
r = (typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson) || {};
|
|
9100
9136
|
} catch {}
|
|
9101
|
-
let i = r.hidden === !0 || r.hidden === 1 || r.hidden === "1" || r.hidden === "true", a =
|
|
9137
|
+
let i = r.hidden === !0 || r.hidden === 1 || r.hidden === "1" || r.hidden === "true", a = Fi(r.startShowingAt, r.stopShowingAt);
|
|
9102
9138
|
if (!o && (i || !a)) continue;
|
|
9103
|
-
let s = e.elementType || e.componentId || "text-block", c = p.blocks?.[s]?.fields || p.elements?.[s]?.fields || p.components?.[s]?.fields || {}, l = String(r.blockId || r._instanceId || r.id || e.blockId || e.id), u =
|
|
9104
|
-
u = await oi(t, u), u =
|
|
9139
|
+
let s = e.elementType || e.componentId || "text-block", c = p.blocks?.[s]?.fields || p.elements?.[s]?.fields || p.components?.[s]?.fields || {}, l = String(r.blockId || r._instanceId || r.id || e.blockId || e.id), u = zi(r, c);
|
|
9140
|
+
u = await oi(t, u), u = Bi(u), u = await Vi(t, u), u.blockId = l, P[n].push({
|
|
9105
9141
|
instanceId: e.id,
|
|
9106
9142
|
blockId: l,
|
|
9107
9143
|
componentId: s,
|
|
@@ -9122,7 +9158,7 @@ Ni.get("/*", async (e) => {
|
|
|
9122
9158
|
for (let [e, n] of Object.entries(ue)) {
|
|
9123
9159
|
let r = P[e] && P[e].length > 0, i = !!T[e];
|
|
9124
9160
|
if (P[e] || (P[e] = [], F[e] = { isInherited: !1 }), (n?.inherit === "parent" || n?.inherit === !0 || n?.inherit === "true" || e === "header" || e === "footer") && !r && !i && y) {
|
|
9125
|
-
let n = await
|
|
9161
|
+
let n = await Ri(t, y, e, p, o);
|
|
9126
9162
|
if (n.blocks.length > 0 && (P[e] = n.blocks, F[e] = {
|
|
9127
9163
|
isInherited: !0,
|
|
9128
9164
|
inheritedFromId: n.inheritedFromId,
|
|
@@ -9134,7 +9170,7 @@ Ni.get("/*", async (e) => {
|
|
|
9134
9170
|
});
|
|
9135
9171
|
}
|
|
9136
9172
|
}
|
|
9137
|
-
for (let e of Object.keys(P)) await
|
|
9173
|
+
for (let e of Object.keys(P)) await Li(t, P[e], l);
|
|
9138
9174
|
let de = {
|
|
9139
9175
|
channelId: l || u,
|
|
9140
9176
|
treeId: v,
|
|
@@ -9153,8 +9189,8 @@ Ni.get("/*", async (e) => {
|
|
|
9153
9189
|
});
|
|
9154
9190
|
//#endregion
|
|
9155
9191
|
//#region server/routes/public/tree.ts
|
|
9156
|
-
var
|
|
9157
|
-
function
|
|
9192
|
+
var Ki = new e();
|
|
9193
|
+
function qi(e, t) {
|
|
9158
9194
|
let n = /* @__PURE__ */ new Date();
|
|
9159
9195
|
if (e && String(e).trim() !== "") {
|
|
9160
9196
|
let t = new Date(e);
|
|
@@ -9166,7 +9202,7 @@ function Ki(e, t) {
|
|
|
9166
9202
|
}
|
|
9167
9203
|
return !0;
|
|
9168
9204
|
}
|
|
9169
|
-
|
|
9205
|
+
Ki.get("/:treeParam", async (e) => {
|
|
9170
9206
|
try {
|
|
9171
9207
|
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";
|
|
9172
9208
|
if (r && r !== "default" && r !== "all") {
|
|
@@ -9176,7 +9212,7 @@ Gi.get("/:treeParam", async (e) => {
|
|
|
9176
9212
|
if (!i && t) return e.json({ error: `Channel '${n.key || r}' is currently inactive` }, 404);
|
|
9177
9213
|
}
|
|
9178
9214
|
}
|
|
9179
|
-
let a =
|
|
9215
|
+
let a = q(e), o = `tree:${r}:${n}`;
|
|
9180
9216
|
if (!i) {
|
|
9181
9217
|
let t = await a.get(o);
|
|
9182
9218
|
if (t) return e.header("X-Cache", "HIT"), e.json(t);
|
|
@@ -9205,7 +9241,7 @@ Gi.get("/:treeParam", async (e) => {
|
|
|
9205
9241
|
if (r) try {
|
|
9206
9242
|
n = typeof r == "string" ? JSON.parse(r) : r, delete n._isTreeDraft, delete n._draftParentId, delete n.isNew, delete n.hidden, delete n.is_hidden, delete n.isHidden, delete n.status;
|
|
9207
9243
|
} catch {}
|
|
9208
|
-
let a = !i && (e.status === "draft" || e.status === "new"), o = !!e.isHidden || a || n.hidden === !0 || n.hidden === 1 || n.hidden === "1" || n.hidden === "true", s =
|
|
9244
|
+
let a = !i && (e.status === "draft" || e.status === "new"), o = !!e.isHidden || a || n.hidden === !0 || n.hidden === 1 || n.hidden === "1" || n.hidden === "true", s = qi(n.startShowingAt, n.stopShowingAt), c = (e.slug || "").replace(/^\/+|\/+$/g, ""), l = c === "home" || c === "homee" ? "/" : `${t}/${c}`.replace(/\/+/g, "/"), u = {
|
|
9209
9245
|
id: e.id,
|
|
9210
9246
|
treeNodeId: e.treeNodeId,
|
|
9211
9247
|
parentId: e.parentId || null,
|
|
@@ -9240,8 +9276,8 @@ Gi.get("/:treeParam", async (e) => {
|
|
|
9240
9276
|
});
|
|
9241
9277
|
//#endregion
|
|
9242
9278
|
//#region server/routes/public/assets.ts
|
|
9243
|
-
var
|
|
9244
|
-
function
|
|
9279
|
+
var Ji = new e();
|
|
9280
|
+
function Yi(e, t) {
|
|
9245
9281
|
if (t === "webp") return "image/webp";
|
|
9246
9282
|
if (t === "avif") return "image/avif";
|
|
9247
9283
|
if (t === "jpeg" || t === "jpg") return "image/jpeg";
|
|
@@ -9249,7 +9285,7 @@ function Ji(e, t) {
|
|
|
9249
9285
|
let n = e.toLowerCase();
|
|
9250
9286
|
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";
|
|
9251
9287
|
}
|
|
9252
|
-
|
|
9288
|
+
Ji.get("/*", async (e) => {
|
|
9253
9289
|
let t = e.req.path.replace(/^\/media\//, "").replace(/^\//, "");
|
|
9254
9290
|
if (!t) return e.text("Asset key missing", 400);
|
|
9255
9291
|
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("Via")?.includes("image-resizing") || e.req.header("User-Agent")?.includes("Cloudflare-ImgRen");
|
|
@@ -9295,7 +9331,7 @@ qi.get("/*", async (e) => {
|
|
|
9295
9331
|
if (!s) {
|
|
9296
9332
|
let n = u(g);
|
|
9297
9333
|
return e.body(n, 200, {
|
|
9298
|
-
"Content-Type":
|
|
9334
|
+
"Content-Type": Yi(t),
|
|
9299
9335
|
"Cache-Control": "public, max-age=86400"
|
|
9300
9336
|
});
|
|
9301
9337
|
}
|
|
@@ -9303,7 +9339,7 @@ qi.get("/*", async (e) => {
|
|
|
9303
9339
|
if (l(b)) {
|
|
9304
9340
|
let n = u(b);
|
|
9305
9341
|
return e.body(n, 200, {
|
|
9306
|
-
"Content-Type":
|
|
9342
|
+
"Content-Type": Yi(t, v),
|
|
9307
9343
|
"Cache-Control": "public, max-age=31536000, immutable",
|
|
9308
9344
|
"X-Local-Cache": "HIT"
|
|
9309
9345
|
});
|
|
@@ -9316,14 +9352,14 @@ qi.get("/*", async (e) => {
|
|
|
9316
9352
|
typeof n == "number" && (a.width = n), typeof c == "number" && (a.height = c), (a.width || a.height) && (a.fit = "cover", i = i.resize(a)), v === "webp" ? i = i.webp({ quality: typeof _ == "number" ? _ : 80 }) : v === "avif" ? i = i.avif({ quality: typeof _ == "number" ? _ : 70 }) : v === "jpeg" || v === "jpg" ? i = i.jpeg({ quality: typeof _ == "number" ? _ : 80 }) : v === "png" && (i = i.png({ quality: typeof _ == "number" ? _ : 80 }));
|
|
9317
9353
|
let o = await i.toBuffer();
|
|
9318
9354
|
return d(m(b), { recursive: !0 }), f(b, o), e.body(o, 200, {
|
|
9319
|
-
"Content-Type":
|
|
9355
|
+
"Content-Type": Yi(t, v),
|
|
9320
9356
|
"Cache-Control": "public, max-age=31536000, immutable",
|
|
9321
9357
|
"X-Local-Cache": "MISS"
|
|
9322
9358
|
});
|
|
9323
9359
|
} catch {
|
|
9324
9360
|
let n = u(g);
|
|
9325
9361
|
return e.body(n, 200, {
|
|
9326
|
-
"Content-Type":
|
|
9362
|
+
"Content-Type": Yi(t),
|
|
9327
9363
|
"Cache-Control": "public, max-age=86400"
|
|
9328
9364
|
});
|
|
9329
9365
|
}
|
|
@@ -9334,8 +9370,8 @@ qi.get("/*", async (e) => {
|
|
|
9334
9370
|
});
|
|
9335
9371
|
//#endregion
|
|
9336
9372
|
//#region server/routes/public/paths.ts
|
|
9337
|
-
var
|
|
9338
|
-
function
|
|
9373
|
+
var Xi = new e();
|
|
9374
|
+
function Zi(e, t) {
|
|
9339
9375
|
let n = /* @__PURE__ */ new Date();
|
|
9340
9376
|
if (e && String(e).trim() !== "") {
|
|
9341
9377
|
let t = new Date(e);
|
|
@@ -9347,7 +9383,7 @@ function Xi(e, t) {
|
|
|
9347
9383
|
}
|
|
9348
9384
|
return !0;
|
|
9349
9385
|
}
|
|
9350
|
-
|
|
9386
|
+
Xi.get("/", async (e) => {
|
|
9351
9387
|
try {
|
|
9352
9388
|
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 ").all(), n = Array.isArray(t) ? t : t?.results || [], r = [];
|
|
9353
9389
|
function i(e = null, t = "") {
|
|
@@ -9360,7 +9396,7 @@ Yi.get("/", async (e) => {
|
|
|
9360
9396
|
if (e.dataJson) try {
|
|
9361
9397
|
n = typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson;
|
|
9362
9398
|
} catch {}
|
|
9363
|
-
let a = e.status === "published" || e.status === "active", o =
|
|
9399
|
+
let a = e.status === "published" || e.status === "active", o = Zi(n.startShowingAt, n.stopShowingAt);
|
|
9364
9400
|
if (!a || !o) continue;
|
|
9365
9401
|
let s = (e.slug || "").replace(/^\/+|\/+$/g, ""), c = s === "home" || s === "homee" ? "/" : `${t}/${s}`.replace(/\/+/g, "/");
|
|
9366
9402
|
e.nodeType !== "external-link" && r.push(c);
|
|
@@ -9377,7 +9413,7 @@ Yi.get("/", async (e) => {
|
|
|
9377
9413
|
});
|
|
9378
9414
|
//#endregion
|
|
9379
9415
|
//#region server/index.ts
|
|
9380
|
-
var $ = new e(),
|
|
9416
|
+
var $ = new e(), Qi = !1;
|
|
9381
9417
|
$.use("*", o()), $.use("/media/*", o({
|
|
9382
9418
|
origin: "*",
|
|
9383
9419
|
allowMethods: [
|
|
@@ -9398,13 +9434,13 @@ $.use("*", o()), $.use("/media/*", o({
|
|
|
9398
9434
|
let n = new URL(e.req.url), r = (e.req.header("host") || n.hostname).split(":")[0];
|
|
9399
9435
|
e.set("currentDomain", r);
|
|
9400
9436
|
let i = u(e);
|
|
9401
|
-
if (e.set("db", i), !
|
|
9402
|
-
await
|
|
9437
|
+
if (e.set("db", i), !Qi) try {
|
|
9438
|
+
await Pr(i), Qi = !0;
|
|
9403
9439
|
} catch (e) {
|
|
9404
9440
|
console.error("❌ [CMS Server] Failed to initialize system tables on cold start:", e);
|
|
9405
9441
|
}
|
|
9406
9442
|
await t();
|
|
9407
|
-
}), $.route("/media",
|
|
9443
|
+
}), $.route("/media", Ji), $.use("/media/*", Lr()), $.route("/api/cms/nodes", X), $.route("/api/cms/nodes.json", X), $.route("/api/cms/formcsv", X), $.route("/api/cms/formcsv.json", X), $.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", Z), $.route("/api/v1/node", Pi), $.route("/api/v1/page", Pi), $.route("/api/v1/tree", Ki), $.route("/api/v1/all-paths", Xi), $.get("*", async (e) => {
|
|
9408
9444
|
if (e.env?.ASSETS) {
|
|
9409
9445
|
let t = await e.env.ASSETS.fetch(e.req.raw);
|
|
9410
9446
|
if (t.status === 404) {
|