canopycms-cdk 0.13.0 → 0.14.1
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/package.json +4 -4
- package/worker/dist/index.js +1687 -477
- package/worker/dist/index.js.sha256 +1 -1
package/worker/dist/index.js
CHANGED
|
@@ -1783,7 +1783,7 @@ var require_ms = __commonJS({
|
|
|
1783
1783
|
options2 = options2 || {};
|
|
1784
1784
|
var type = typeof val;
|
|
1785
1785
|
if (type === "string" && val.length > 0) {
|
|
1786
|
-
return
|
|
1786
|
+
return parse7(val);
|
|
1787
1787
|
} else if (type === "number" && isFinite(val)) {
|
|
1788
1788
|
return options2.long ? fmtLong(val) : fmtShort(val);
|
|
1789
1789
|
}
|
|
@@ -1791,7 +1791,7 @@ var require_ms = __commonJS({
|
|
|
1791
1791
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
1792
1792
|
);
|
|
1793
1793
|
};
|
|
1794
|
-
function
|
|
1794
|
+
function parse7(str2) {
|
|
1795
1795
|
str2 = String(str2);
|
|
1796
1796
|
if (str2.length > 100) {
|
|
1797
1797
|
return;
|
|
@@ -1934,12 +1934,12 @@ var require_common = __commonJS({
|
|
|
1934
1934
|
args.unshift("%O");
|
|
1935
1935
|
}
|
|
1936
1936
|
let index2 = 0;
|
|
1937
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2,
|
|
1937
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format4) => {
|
|
1938
1938
|
if (match2 === "%%") {
|
|
1939
1939
|
return "%";
|
|
1940
1940
|
}
|
|
1941
1941
|
index2++;
|
|
1942
|
-
const formatter = createDebug2.formatters[
|
|
1942
|
+
const formatter = createDebug2.formatters[format4];
|
|
1943
1943
|
if (typeof formatter === "function") {
|
|
1944
1944
|
const val = args[index2];
|
|
1945
1945
|
match2 = formatter.call(self2, val);
|
|
@@ -5633,8 +5633,8 @@ var init_types = __esm({
|
|
|
5633
5633
|
});
|
|
5634
5634
|
return INVALID;
|
|
5635
5635
|
}
|
|
5636
|
-
const
|
|
5637
|
-
if (!
|
|
5636
|
+
const rest2 = this._def.rest;
|
|
5637
|
+
if (!rest2 && ctx.data.length > this._def.items.length) {
|
|
5638
5638
|
addIssueToContext(ctx, {
|
|
5639
5639
|
code: ZodIssueCode.too_big,
|
|
5640
5640
|
maximum: this._def.items.length,
|
|
@@ -5661,10 +5661,10 @@ var init_types = __esm({
|
|
|
5661
5661
|
get items() {
|
|
5662
5662
|
return this._def.items;
|
|
5663
5663
|
}
|
|
5664
|
-
rest(
|
|
5664
|
+
rest(rest2) {
|
|
5665
5665
|
return new _ZodTuple({
|
|
5666
5666
|
...this._def,
|
|
5667
|
-
rest
|
|
5667
|
+
rest: rest2
|
|
5668
5668
|
});
|
|
5669
5669
|
}
|
|
5670
5670
|
};
|
|
@@ -7661,7 +7661,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7661
7661
|
return template.replace(/\/$/, "");
|
|
7662
7662
|
}
|
|
7663
7663
|
}
|
|
7664
|
-
function
|
|
7664
|
+
function parse7(options2) {
|
|
7665
7665
|
let method = options2.method.toUpperCase();
|
|
7666
7666
|
let url = (options2.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
7667
7667
|
let headers = Object.assign({}, options2.headers);
|
|
@@ -7685,7 +7685,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7685
7685
|
if (!isBinaryRequest) {
|
|
7686
7686
|
if (options2.mediaType.format) {
|
|
7687
7687
|
headers.accept = headers.accept.split(/,/).map(
|
|
7688
|
-
(
|
|
7688
|
+
(format4) => format4.replace(
|
|
7689
7689
|
/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
|
|
7690
7690
|
`application/vnd$1$2.${options2.mediaType.format}`
|
|
7691
7691
|
)
|
|
@@ -7695,8 +7695,8 @@ var require_dist_node3 = __commonJS({
|
|
|
7695
7695
|
if (options2.mediaType.previews?.length) {
|
|
7696
7696
|
const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
|
|
7697
7697
|
headers.accept = previewsFromAcceptHeader.concat(options2.mediaType.previews).map((preview) => {
|
|
7698
|
-
const
|
|
7699
|
-
return `application/vnd.github.${preview}-preview${
|
|
7698
|
+
const format4 = options2.mediaType.format ? `.${options2.mediaType.format}` : "+json";
|
|
7699
|
+
return `application/vnd.github.${preview}-preview${format4}`;
|
|
7700
7700
|
}).join(",");
|
|
7701
7701
|
}
|
|
7702
7702
|
}
|
|
@@ -7725,7 +7725,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7725
7725
|
);
|
|
7726
7726
|
}
|
|
7727
7727
|
function endpointWithDefaults(defaults, route, options2) {
|
|
7728
|
-
return
|
|
7728
|
+
return parse7(merge2(defaults, route, options2));
|
|
7729
7729
|
}
|
|
7730
7730
|
function withDefaults(oldDefaults, newDefaults) {
|
|
7731
7731
|
const DEFAULTS2 = merge2(oldDefaults, newDefaults);
|
|
@@ -7734,7 +7734,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7734
7734
|
DEFAULTS: DEFAULTS2,
|
|
7735
7735
|
defaults: withDefaults.bind(null, DEFAULTS2),
|
|
7736
7736
|
merge: merge2.bind(null, DEFAULTS2),
|
|
7737
|
-
parse:
|
|
7737
|
+
parse: parse7
|
|
7738
7738
|
});
|
|
7739
7739
|
}
|
|
7740
7740
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
@@ -12947,7 +12947,7 @@ var require_visit = __commonJS({
|
|
|
12947
12947
|
var BREAK = Symbol("break visit");
|
|
12948
12948
|
var SKIP3 = Symbol("skip children");
|
|
12949
12949
|
var REMOVE = Symbol("remove node");
|
|
12950
|
-
function
|
|
12950
|
+
function visit5(node2, visitor) {
|
|
12951
12951
|
const visitor_ = initVisitor(visitor);
|
|
12952
12952
|
if (identity.isDocument(node2)) {
|
|
12953
12953
|
const cd = visit_(null, node2.contents, visitor_, Object.freeze([node2]));
|
|
@@ -12956,9 +12956,9 @@ var require_visit = __commonJS({
|
|
|
12956
12956
|
} else
|
|
12957
12957
|
visit_(null, node2, visitor_, Object.freeze([]));
|
|
12958
12958
|
}
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12959
|
+
visit5.BREAK = BREAK;
|
|
12960
|
+
visit5.SKIP = SKIP3;
|
|
12961
|
+
visit5.REMOVE = REMOVE;
|
|
12962
12962
|
function visit_(key, node2, visitor, path44) {
|
|
12963
12963
|
const ctrl = callVisitor(key, node2, visitor, path44);
|
|
12964
12964
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
@@ -13092,7 +13092,7 @@ var require_visit = __commonJS({
|
|
|
13092
13092
|
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
13093
13093
|
}
|
|
13094
13094
|
}
|
|
13095
|
-
exports2.visit =
|
|
13095
|
+
exports2.visit = visit5;
|
|
13096
13096
|
exports2.visitAsync = visitAsync;
|
|
13097
13097
|
}
|
|
13098
13098
|
});
|
|
@@ -13102,7 +13102,7 @@ var require_directives = __commonJS({
|
|
|
13102
13102
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js"(exports2) {
|
|
13103
13103
|
"use strict";
|
|
13104
13104
|
var identity = require_identity();
|
|
13105
|
-
var
|
|
13105
|
+
var visit5 = require_visit();
|
|
13106
13106
|
var escapeChars = {
|
|
13107
13107
|
"!": "%21",
|
|
13108
13108
|
",": "%2C",
|
|
@@ -13246,7 +13246,7 @@ var require_directives = __commonJS({
|
|
|
13246
13246
|
let tagNames;
|
|
13247
13247
|
if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {
|
|
13248
13248
|
const tags = {};
|
|
13249
|
-
|
|
13249
|
+
visit5.visit(doc.contents, (_key, node2) => {
|
|
13250
13250
|
if (identity.isNode(node2) && node2.tag)
|
|
13251
13251
|
tags[node2.tag] = true;
|
|
13252
13252
|
});
|
|
@@ -13273,7 +13273,7 @@ var require_anchors = __commonJS({
|
|
|
13273
13273
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js"(exports2) {
|
|
13274
13274
|
"use strict";
|
|
13275
13275
|
var identity = require_identity();
|
|
13276
|
-
var
|
|
13276
|
+
var visit5 = require_visit();
|
|
13277
13277
|
function anchorIsValid(anchor) {
|
|
13278
13278
|
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
|
|
13279
13279
|
const sa = JSON.stringify(anchor);
|
|
@@ -13284,7 +13284,7 @@ var require_anchors = __commonJS({
|
|
|
13284
13284
|
}
|
|
13285
13285
|
function anchorNames(root5) {
|
|
13286
13286
|
const anchors = /* @__PURE__ */ new Set();
|
|
13287
|
-
|
|
13287
|
+
visit5.visit(root5, {
|
|
13288
13288
|
Value(_key, node2) {
|
|
13289
13289
|
if (node2.anchor)
|
|
13290
13290
|
anchors.add(node2.anchor);
|
|
@@ -13464,7 +13464,7 @@ var require_Alias = __commonJS({
|
|
|
13464
13464
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js"(exports2) {
|
|
13465
13465
|
"use strict";
|
|
13466
13466
|
var anchors = require_anchors();
|
|
13467
|
-
var
|
|
13467
|
+
var visit5 = require_visit();
|
|
13468
13468
|
var identity = require_identity();
|
|
13469
13469
|
var Node3 = require_Node();
|
|
13470
13470
|
var toJS = require_toJS();
|
|
@@ -13488,7 +13488,7 @@ var require_Alias = __commonJS({
|
|
|
13488
13488
|
nodes5 = ctx.aliasResolveCache;
|
|
13489
13489
|
} else {
|
|
13490
13490
|
nodes5 = [];
|
|
13491
|
-
|
|
13491
|
+
visit5.visit(doc, {
|
|
13492
13492
|
Node: (_key, node2) => {
|
|
13493
13493
|
if (identity.isAlias(node2) || identity.hasAnchor(node2))
|
|
13494
13494
|
nodes5.push(node2);
|
|
@@ -13741,14 +13741,14 @@ var require_Collection = __commonJS({
|
|
|
13741
13741
|
if (isEmptyPath(path44))
|
|
13742
13742
|
this.add(value);
|
|
13743
13743
|
else {
|
|
13744
|
-
const [key, ...
|
|
13744
|
+
const [key, ...rest2] = path44;
|
|
13745
13745
|
const node2 = this.get(key, true);
|
|
13746
13746
|
if (identity.isCollection(node2))
|
|
13747
|
-
node2.addIn(
|
|
13747
|
+
node2.addIn(rest2, value);
|
|
13748
13748
|
else if (node2 === void 0 && this.schema)
|
|
13749
|
-
this.set(key, collectionFromPath(this.schema,
|
|
13749
|
+
this.set(key, collectionFromPath(this.schema, rest2, value));
|
|
13750
13750
|
else
|
|
13751
|
-
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${
|
|
13751
|
+
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`);
|
|
13752
13752
|
}
|
|
13753
13753
|
}
|
|
13754
13754
|
/**
|
|
@@ -13756,14 +13756,14 @@ var require_Collection = __commonJS({
|
|
|
13756
13756
|
* @returns `true` if the item was found and removed.
|
|
13757
13757
|
*/
|
|
13758
13758
|
deleteIn(path44) {
|
|
13759
|
-
const [key, ...
|
|
13760
|
-
if (
|
|
13759
|
+
const [key, ...rest2] = path44;
|
|
13760
|
+
if (rest2.length === 0)
|
|
13761
13761
|
return this.delete(key);
|
|
13762
13762
|
const node2 = this.get(key, true);
|
|
13763
13763
|
if (identity.isCollection(node2))
|
|
13764
|
-
return node2.deleteIn(
|
|
13764
|
+
return node2.deleteIn(rest2);
|
|
13765
13765
|
else
|
|
13766
|
-
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${
|
|
13766
|
+
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`);
|
|
13767
13767
|
}
|
|
13768
13768
|
/**
|
|
13769
13769
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -13771,12 +13771,12 @@ var require_Collection = __commonJS({
|
|
|
13771
13771
|
* `true` (collections are always returned intact).
|
|
13772
13772
|
*/
|
|
13773
13773
|
getIn(path44, keepScalar) {
|
|
13774
|
-
const [key, ...
|
|
13774
|
+
const [key, ...rest2] = path44;
|
|
13775
13775
|
const node2 = this.get(key, true);
|
|
13776
|
-
if (
|
|
13776
|
+
if (rest2.length === 0)
|
|
13777
13777
|
return !keepScalar && identity.isScalar(node2) ? node2.value : node2;
|
|
13778
13778
|
else
|
|
13779
|
-
return identity.isCollection(node2) ? node2.getIn(
|
|
13779
|
+
return identity.isCollection(node2) ? node2.getIn(rest2, keepScalar) : void 0;
|
|
13780
13780
|
}
|
|
13781
13781
|
hasAllNullValues(allowScalar) {
|
|
13782
13782
|
return this.items.every((node2) => {
|
|
@@ -13790,28 +13790,28 @@ var require_Collection = __commonJS({
|
|
|
13790
13790
|
* Checks if the collection includes a value with the key `key`.
|
|
13791
13791
|
*/
|
|
13792
13792
|
hasIn(path44) {
|
|
13793
|
-
const [key, ...
|
|
13794
|
-
if (
|
|
13793
|
+
const [key, ...rest2] = path44;
|
|
13794
|
+
if (rest2.length === 0)
|
|
13795
13795
|
return this.has(key);
|
|
13796
13796
|
const node2 = this.get(key, true);
|
|
13797
|
-
return identity.isCollection(node2) ? node2.hasIn(
|
|
13797
|
+
return identity.isCollection(node2) ? node2.hasIn(rest2) : false;
|
|
13798
13798
|
}
|
|
13799
13799
|
/**
|
|
13800
13800
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
13801
13801
|
* boolean to add/remove the item from the set.
|
|
13802
13802
|
*/
|
|
13803
13803
|
setIn(path44, value) {
|
|
13804
|
-
const [key, ...
|
|
13805
|
-
if (
|
|
13804
|
+
const [key, ...rest2] = path44;
|
|
13805
|
+
if (rest2.length === 0) {
|
|
13806
13806
|
this.set(key, value);
|
|
13807
13807
|
} else {
|
|
13808
13808
|
const node2 = this.get(key, true);
|
|
13809
13809
|
if (identity.isCollection(node2))
|
|
13810
|
-
node2.setIn(
|
|
13810
|
+
node2.setIn(rest2, value);
|
|
13811
13811
|
else if (node2 === void 0 && this.schema)
|
|
13812
|
-
this.set(key, collectionFromPath(this.schema,
|
|
13812
|
+
this.set(key, collectionFromPath(this.schema, rest2, value));
|
|
13813
13813
|
else
|
|
13814
|
-
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${
|
|
13814
|
+
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`);
|
|
13815
13815
|
}
|
|
13816
13816
|
}
|
|
13817
13817
|
};
|
|
@@ -15217,14 +15217,14 @@ var require_bool = __commonJS({
|
|
|
15217
15217
|
var require_stringifyNumber = __commonJS({
|
|
15218
15218
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) {
|
|
15219
15219
|
"use strict";
|
|
15220
|
-
function stringifyNumber({ format:
|
|
15220
|
+
function stringifyNumber({ format: format4, minFractionDigits, tag: tag3, value }) {
|
|
15221
15221
|
if (typeof value === "bigint")
|
|
15222
15222
|
return String(value);
|
|
15223
15223
|
const num = typeof value === "number" ? value : Number(value);
|
|
15224
15224
|
if (!isFinite(num))
|
|
15225
15225
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
15226
15226
|
let n7 = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
15227
|
-
if (!
|
|
15227
|
+
if (!format4 && minFractionDigits && (!tag3 || tag3 === "tag:yaml.org,2002:float") && /^\d/.test(n7)) {
|
|
15228
15228
|
let i10 = n7.indexOf(".");
|
|
15229
15229
|
if (i10 < 0) {
|
|
15230
15230
|
i10 = n7.length;
|
|
@@ -18401,15 +18401,15 @@ var require_cst_visit = __commonJS({
|
|
|
18401
18401
|
var BREAK = Symbol("break visit");
|
|
18402
18402
|
var SKIP3 = Symbol("skip children");
|
|
18403
18403
|
var REMOVE = Symbol("remove item");
|
|
18404
|
-
function
|
|
18404
|
+
function visit5(cst, visitor) {
|
|
18405
18405
|
if ("type" in cst && cst.type === "document")
|
|
18406
18406
|
cst = { start: cst.start, value: cst.value };
|
|
18407
18407
|
_visit(Object.freeze([]), cst, visitor);
|
|
18408
18408
|
}
|
|
18409
|
-
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
18409
|
+
visit5.BREAK = BREAK;
|
|
18410
|
+
visit5.SKIP = SKIP3;
|
|
18411
|
+
visit5.REMOVE = REMOVE;
|
|
18412
|
+
visit5.itemAtPath = (cst, path44) => {
|
|
18413
18413
|
let item = cst;
|
|
18414
18414
|
for (const [field, index2] of path44) {
|
|
18415
18415
|
const tok = item?.[field];
|
|
@@ -18420,8 +18420,8 @@ var require_cst_visit = __commonJS({
|
|
|
18420
18420
|
}
|
|
18421
18421
|
return item;
|
|
18422
18422
|
};
|
|
18423
|
-
|
|
18424
|
-
const parent =
|
|
18423
|
+
visit5.parentCollection = (cst, path44) => {
|
|
18424
|
+
const parent = visit5.itemAtPath(cst, path44.slice(0, -1));
|
|
18425
18425
|
const field = path44[path44.length - 1][0];
|
|
18426
18426
|
const coll = parent?.[field];
|
|
18427
18427
|
if (coll && "items" in coll)
|
|
@@ -18452,7 +18452,7 @@ var require_cst_visit = __commonJS({
|
|
|
18452
18452
|
}
|
|
18453
18453
|
return typeof ctrl === "function" ? ctrl(item, path44) : ctrl;
|
|
18454
18454
|
}
|
|
18455
|
-
exports2.visit =
|
|
18455
|
+
exports2.visit = visit5;
|
|
18456
18456
|
}
|
|
18457
18457
|
});
|
|
18458
18458
|
|
|
@@ -20084,7 +20084,7 @@ var require_public_api = __commonJS({
|
|
|
20084
20084
|
}
|
|
20085
20085
|
return doc;
|
|
20086
20086
|
}
|
|
20087
|
-
function
|
|
20087
|
+
function parse7(src, reviver, options2) {
|
|
20088
20088
|
let _reviver = void 0;
|
|
20089
20089
|
if (typeof reviver === "function") {
|
|
20090
20090
|
_reviver = reviver;
|
|
@@ -20125,7 +20125,7 @@ var require_public_api = __commonJS({
|
|
|
20125
20125
|
return value.toString(options2);
|
|
20126
20126
|
return new Document2.Document(value, _replacer, options2).toString(options2);
|
|
20127
20127
|
}
|
|
20128
|
-
exports2.parse =
|
|
20128
|
+
exports2.parse = parse7;
|
|
20129
20129
|
exports2.parseAllDocuments = parseAllDocuments;
|
|
20130
20130
|
exports2.parseDocument = parseDocument3;
|
|
20131
20131
|
exports2.stringify = stringify2;
|
|
@@ -20151,7 +20151,7 @@ var require_dist4 = __commonJS({
|
|
|
20151
20151
|
var lineCounter = require_line_counter();
|
|
20152
20152
|
var parser4 = require_parser();
|
|
20153
20153
|
var publicApi = require_public_api();
|
|
20154
|
-
var
|
|
20154
|
+
var visit5 = require_visit();
|
|
20155
20155
|
exports2.Composer = composer.Composer;
|
|
20156
20156
|
exports2.Document = Document2.Document;
|
|
20157
20157
|
exports2.Schema = Schema3.Schema;
|
|
@@ -20179,8 +20179,8 @@ var require_dist4 = __commonJS({
|
|
|
20179
20179
|
exports2.parseAllDocuments = publicApi.parseAllDocuments;
|
|
20180
20180
|
exports2.parseDocument = publicApi.parseDocument;
|
|
20181
20181
|
exports2.stringify = publicApi.stringify;
|
|
20182
|
-
exports2.visit =
|
|
20183
|
-
exports2.visitAsync =
|
|
20182
|
+
exports2.visit = visit5.visit;
|
|
20183
|
+
exports2.visitAsync = visit5.visitAsync;
|
|
20184
20184
|
}
|
|
20185
20185
|
});
|
|
20186
20186
|
|
|
@@ -20479,7 +20479,7 @@ var require_common2 = __commonJS({
|
|
|
20479
20479
|
}
|
|
20480
20480
|
return target;
|
|
20481
20481
|
}
|
|
20482
|
-
function
|
|
20482
|
+
function repeat2(string3, count) {
|
|
20483
20483
|
var result = "", cycle;
|
|
20484
20484
|
for (cycle = 0; cycle < count; cycle += 1) {
|
|
20485
20485
|
result += string3;
|
|
@@ -20492,7 +20492,7 @@ var require_common2 = __commonJS({
|
|
|
20492
20492
|
module2.exports.isNothing = isNothing;
|
|
20493
20493
|
module2.exports.isObject = isObject2;
|
|
20494
20494
|
module2.exports.toArray = toArray;
|
|
20495
|
-
module2.exports.repeat =
|
|
20495
|
+
module2.exports.repeat = repeat2;
|
|
20496
20496
|
module2.exports.isNegativeZero = isNegativeZero;
|
|
20497
20497
|
module2.exports.extend = extend2;
|
|
20498
20498
|
}
|
|
@@ -21643,7 +21643,7 @@ var require_loader = __commonJS({
|
|
|
21643
21643
|
(c11 - 65536 & 1023) + 56320
|
|
21644
21644
|
);
|
|
21645
21645
|
}
|
|
21646
|
-
function
|
|
21646
|
+
function setProperty2(object, key, value) {
|
|
21647
21647
|
if (key === "__proto__") {
|
|
21648
21648
|
Object.defineProperty(object, key, {
|
|
21649
21649
|
configurable: true,
|
|
@@ -21762,7 +21762,7 @@ var require_loader = __commonJS({
|
|
|
21762
21762
|
for (index2 = 0, quantity = sourceKeys.length; index2 < quantity; index2 += 1) {
|
|
21763
21763
|
key = sourceKeys[index2];
|
|
21764
21764
|
if (!_hasOwnProperty.call(destination, key)) {
|
|
21765
|
-
|
|
21765
|
+
setProperty2(destination, key, source[key]);
|
|
21766
21766
|
overridableKeys[key] = true;
|
|
21767
21767
|
}
|
|
21768
21768
|
}
|
|
@@ -21801,7 +21801,7 @@ var require_loader = __commonJS({
|
|
|
21801
21801
|
state3.position = startPos || state3.position;
|
|
21802
21802
|
throwError(state3, "duplicated mapping key");
|
|
21803
21803
|
}
|
|
21804
|
-
|
|
21804
|
+
setProperty2(_result, keyNode, valueNode);
|
|
21805
21805
|
delete overridableKeys[keyNode];
|
|
21806
21806
|
}
|
|
21807
21807
|
return _result;
|
|
@@ -23562,7 +23562,7 @@ var require_gray_matter = __commonJS({
|
|
|
23562
23562
|
var excerpt = require_excerpt();
|
|
23563
23563
|
var engines2 = require_engines();
|
|
23564
23564
|
var toFile = require_to_file();
|
|
23565
|
-
var
|
|
23565
|
+
var parse7 = require_parse();
|
|
23566
23566
|
var utils = require_utils();
|
|
23567
23567
|
function matter3(input, options2) {
|
|
23568
23568
|
if (input === "") {
|
|
@@ -23614,7 +23614,7 @@ var require_gray_matter = __commonJS({
|
|
|
23614
23614
|
file.empty = file.content;
|
|
23615
23615
|
file.data = {};
|
|
23616
23616
|
} else {
|
|
23617
|
-
file.data =
|
|
23617
|
+
file.data = parse7(file.language, file.matter, opts);
|
|
23618
23618
|
}
|
|
23619
23619
|
if (closeIndex === len) {
|
|
23620
23620
|
file.content = "";
|
|
@@ -23667,154 +23667,6 @@ var require_gray_matter = __commonJS({
|
|
|
23667
23667
|
}
|
|
23668
23668
|
});
|
|
23669
23669
|
|
|
23670
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/umd/main.js
|
|
23671
|
-
var require_main = __commonJS({
|
|
23672
|
-
"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/umd/main.js"(exports2, module2) {
|
|
23673
|
-
(function(factory) {
|
|
23674
|
-
if (typeof module2 === "object" && typeof module2.exports === "object") {
|
|
23675
|
-
var v5 = factory(__require, exports2);
|
|
23676
|
-
if (v5 !== void 0) module2.exports = v5;
|
|
23677
|
-
} else if (typeof define === "function" && define.amd) {
|
|
23678
|
-
define(["require", "exports", "./impl/format", "./impl/edit", "./impl/scanner", "./impl/parser"], factory);
|
|
23679
|
-
}
|
|
23680
|
-
})(function(require2, exports3) {
|
|
23681
|
-
"use strict";
|
|
23682
|
-
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
23683
|
-
exports3.applyEdits = exports3.modify = exports3.format = exports3.printParseErrorCode = exports3.ParseErrorCode = exports3.stripComments = exports3.visit = exports3.getNodeValue = exports3.getNodePath = exports3.findNodeAtOffset = exports3.findNodeAtLocation = exports3.parseTree = exports3.parse = exports3.getLocation = exports3.SyntaxKind = exports3.ScanError = exports3.createScanner = void 0;
|
|
23684
|
-
const formatter = require2("./impl/format");
|
|
23685
|
-
const edit = require2("./impl/edit");
|
|
23686
|
-
const scanner = require2("./impl/scanner");
|
|
23687
|
-
const parser4 = require2("./impl/parser");
|
|
23688
|
-
exports3.createScanner = scanner.createScanner;
|
|
23689
|
-
var ScanError;
|
|
23690
|
-
(function(ScanError2) {
|
|
23691
|
-
ScanError2[ScanError2["None"] = 0] = "None";
|
|
23692
|
-
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
23693
|
-
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
23694
|
-
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
23695
|
-
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
23696
|
-
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
23697
|
-
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
23698
|
-
})(ScanError || (exports3.ScanError = ScanError = {}));
|
|
23699
|
-
var SyntaxKind;
|
|
23700
|
-
(function(SyntaxKind2) {
|
|
23701
|
-
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
23702
|
-
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
23703
|
-
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
23704
|
-
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
23705
|
-
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
23706
|
-
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
23707
|
-
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
23708
|
-
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
23709
|
-
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
23710
|
-
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
23711
|
-
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
23712
|
-
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
23713
|
-
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
23714
|
-
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
23715
|
-
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
23716
|
-
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
23717
|
-
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
23718
|
-
})(SyntaxKind || (exports3.SyntaxKind = SyntaxKind = {}));
|
|
23719
|
-
exports3.getLocation = parser4.getLocation;
|
|
23720
|
-
exports3.parse = parser4.parse;
|
|
23721
|
-
exports3.parseTree = parser4.parseTree;
|
|
23722
|
-
exports3.findNodeAtLocation = parser4.findNodeAtLocation;
|
|
23723
|
-
exports3.findNodeAtOffset = parser4.findNodeAtOffset;
|
|
23724
|
-
exports3.getNodePath = parser4.getNodePath;
|
|
23725
|
-
exports3.getNodeValue = parser4.getNodeValue;
|
|
23726
|
-
exports3.visit = parser4.visit;
|
|
23727
|
-
exports3.stripComments = parser4.stripComments;
|
|
23728
|
-
var ParseErrorCode;
|
|
23729
|
-
(function(ParseErrorCode2) {
|
|
23730
|
-
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
23731
|
-
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
23732
|
-
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
23733
|
-
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
23734
|
-
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
23735
|
-
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
23736
|
-
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
23737
|
-
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
23738
|
-
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
23739
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
23740
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
23741
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
23742
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
23743
|
-
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
23744
|
-
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
23745
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
23746
|
-
})(ParseErrorCode || (exports3.ParseErrorCode = ParseErrorCode = {}));
|
|
23747
|
-
function printParseErrorCode(code2) {
|
|
23748
|
-
switch (code2) {
|
|
23749
|
-
case 1:
|
|
23750
|
-
return "InvalidSymbol";
|
|
23751
|
-
case 2:
|
|
23752
|
-
return "InvalidNumberFormat";
|
|
23753
|
-
case 3:
|
|
23754
|
-
return "PropertyNameExpected";
|
|
23755
|
-
case 4:
|
|
23756
|
-
return "ValueExpected";
|
|
23757
|
-
case 5:
|
|
23758
|
-
return "ColonExpected";
|
|
23759
|
-
case 6:
|
|
23760
|
-
return "CommaExpected";
|
|
23761
|
-
case 7:
|
|
23762
|
-
return "CloseBraceExpected";
|
|
23763
|
-
case 8:
|
|
23764
|
-
return "CloseBracketExpected";
|
|
23765
|
-
case 9:
|
|
23766
|
-
return "EndOfFileExpected";
|
|
23767
|
-
case 10:
|
|
23768
|
-
return "InvalidCommentToken";
|
|
23769
|
-
case 11:
|
|
23770
|
-
return "UnexpectedEndOfComment";
|
|
23771
|
-
case 12:
|
|
23772
|
-
return "UnexpectedEndOfString";
|
|
23773
|
-
case 13:
|
|
23774
|
-
return "UnexpectedEndOfNumber";
|
|
23775
|
-
case 14:
|
|
23776
|
-
return "InvalidUnicode";
|
|
23777
|
-
case 15:
|
|
23778
|
-
return "InvalidEscapeCharacter";
|
|
23779
|
-
case 16:
|
|
23780
|
-
return "InvalidCharacter";
|
|
23781
|
-
}
|
|
23782
|
-
return "<unknown ParseErrorCode>";
|
|
23783
|
-
}
|
|
23784
|
-
exports3.printParseErrorCode = printParseErrorCode;
|
|
23785
|
-
function format3(documentText, range3, options2) {
|
|
23786
|
-
return formatter.format(documentText, range3, options2);
|
|
23787
|
-
}
|
|
23788
|
-
exports3.format = format3;
|
|
23789
|
-
function modify2(text4, path44, value, options2) {
|
|
23790
|
-
return edit.setProperty(text4, path44, value, options2);
|
|
23791
|
-
}
|
|
23792
|
-
exports3.modify = modify2;
|
|
23793
|
-
function applyEdits2(text4, edits) {
|
|
23794
|
-
let sortedEdits = edits.slice(0).sort((a9, b10) => {
|
|
23795
|
-
const diff = a9.offset - b10.offset;
|
|
23796
|
-
if (diff === 0) {
|
|
23797
|
-
return a9.length - b10.length;
|
|
23798
|
-
}
|
|
23799
|
-
return diff;
|
|
23800
|
-
});
|
|
23801
|
-
let lastModifiedOffset = text4.length;
|
|
23802
|
-
for (let i10 = sortedEdits.length - 1; i10 >= 0; i10--) {
|
|
23803
|
-
let e9 = sortedEdits[i10];
|
|
23804
|
-
if (e9.offset + e9.length <= lastModifiedOffset) {
|
|
23805
|
-
text4 = edit.applyEdit(text4, e9);
|
|
23806
|
-
} else {
|
|
23807
|
-
throw new Error("Overlapping edit");
|
|
23808
|
-
}
|
|
23809
|
-
lastModifiedOffset = e9.offset;
|
|
23810
|
-
}
|
|
23811
|
-
return text4;
|
|
23812
|
-
}
|
|
23813
|
-
exports3.applyEdits = applyEdits2;
|
|
23814
|
-
});
|
|
23815
|
-
}
|
|
23816
|
-
});
|
|
23817
|
-
|
|
23818
23670
|
// ../../node_modules/.pnpm/acorn-jsx@5.3.2_acorn@8.16.0/node_modules/acorn-jsx/xhtml.js
|
|
23819
23671
|
var require_xhtml = __commonJS({
|
|
23820
23672
|
"../../node_modules/.pnpm/acorn-jsx@5.3.2_acorn@8.16.0/node_modules/acorn-jsx/xhtml.js"(exports2, module2) {
|
|
@@ -24551,7 +24403,7 @@ var require_acorn = __commonJS({
|
|
|
24551
24403
|
this.privateNameStack = [];
|
|
24552
24404
|
};
|
|
24553
24405
|
var prototypeAccessors2 = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowReturn: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, allowUsing: { configurable: true }, inClassStaticBlock: { configurable: true } };
|
|
24554
|
-
Parser3.prototype.parse = function
|
|
24406
|
+
Parser3.prototype.parse = function parse8() {
|
|
24555
24407
|
var node2 = this.options.program || this.startNode();
|
|
24556
24408
|
this.nextToken();
|
|
24557
24409
|
return this.parseTopLevel(node2);
|
|
@@ -24631,7 +24483,7 @@ var require_acorn = __commonJS({
|
|
|
24631
24483
|
}
|
|
24632
24484
|
return cls;
|
|
24633
24485
|
};
|
|
24634
|
-
Parser3.parse = function
|
|
24486
|
+
Parser3.parse = function parse8(input, options2) {
|
|
24635
24487
|
return new this(options2, input).parse();
|
|
24636
24488
|
};
|
|
24637
24489
|
Parser3.parseExpressionAt = function parseExpressionAt3(input, pos, options2) {
|
|
@@ -26045,9 +25897,9 @@ var require_acorn = __commonJS({
|
|
|
26045
25897
|
} else if (allowTrailingComma && this.afterTrailingComma(close)) {
|
|
26046
25898
|
break;
|
|
26047
25899
|
} else if (this.type === types$12.ellipsis) {
|
|
26048
|
-
var
|
|
26049
|
-
this.parseBindingListItem(
|
|
26050
|
-
elts.push(
|
|
25900
|
+
var rest2 = this.parseRestBinding();
|
|
25901
|
+
this.parseBindingListItem(rest2);
|
|
25902
|
+
elts.push(rest2);
|
|
26051
25903
|
if (this.type === types$12.comma) {
|
|
26052
25904
|
this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
26053
25905
|
}
|
|
@@ -29706,7 +29558,7 @@ var require_acorn = __commonJS({
|
|
|
29706
29558
|
lineBreakG: lineBreakG2,
|
|
29707
29559
|
nonASCIIwhitespace: nonASCIIwhitespace2
|
|
29708
29560
|
};
|
|
29709
|
-
function
|
|
29561
|
+
function parse7(input, options2) {
|
|
29710
29562
|
return Parser3.parse(input, options2);
|
|
29711
29563
|
}
|
|
29712
29564
|
function parseExpressionAt2(input, pos, options2) {
|
|
@@ -29731,7 +29583,7 @@ var require_acorn = __commonJS({
|
|
|
29731
29583
|
exports3.lineBreak = lineBreak2;
|
|
29732
29584
|
exports3.lineBreakG = lineBreakG2;
|
|
29733
29585
|
exports3.nonASCIIwhitespace = nonASCIIwhitespace2;
|
|
29734
|
-
exports3.parse =
|
|
29586
|
+
exports3.parse = parse7;
|
|
29735
29587
|
exports3.parseExpressionAt = parseExpressionAt2;
|
|
29736
29588
|
exports3.tokContexts = types2;
|
|
29737
29589
|
exports3.tokTypes = types$12;
|
|
@@ -30648,8 +30500,8 @@ var require_recursionDetectionMiddleware = __commonJS({
|
|
|
30648
30500
|
const invokeStore = await lambda_invoke_store_1.InvokeStore.getInstanceAsync();
|
|
30649
30501
|
const traceIdFromInvokeStore = invokeStore?.getXRayTraceId();
|
|
30650
30502
|
const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;
|
|
30651
|
-
const
|
|
30652
|
-
if (
|
|
30503
|
+
const nonEmptyString2 = (str2) => typeof str2 === "string" && str2.length > 0;
|
|
30504
|
+
if (nonEmptyString2(functionName) && nonEmptyString2(traceId)) {
|
|
30653
30505
|
request.headers[TRACE_ID_HEADER_NAME] = traceId;
|
|
30654
30506
|
}
|
|
30655
30507
|
return next({
|
|
@@ -35080,17 +34932,17 @@ var init_split_header = __esm({
|
|
|
35080
34932
|
function nv(input) {
|
|
35081
34933
|
return new NumericValue(String(input), "bigDecimal");
|
|
35082
34934
|
}
|
|
35083
|
-
var
|
|
34935
|
+
var format2, NumericValue;
|
|
35084
34936
|
var init_NumericValue = __esm({
|
|
35085
34937
|
"../../node_modules/.pnpm/@smithy+core@3.23.12/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() {
|
|
35086
|
-
|
|
34938
|
+
format2 = /^-?\d*(\.\d+)?$/;
|
|
35087
34939
|
NumericValue = class _NumericValue {
|
|
35088
34940
|
string;
|
|
35089
34941
|
type;
|
|
35090
34942
|
constructor(string3, type) {
|
|
35091
34943
|
this.string = string3;
|
|
35092
34944
|
this.type = type;
|
|
35093
|
-
if (!
|
|
34945
|
+
if (!format2.test(string3)) {
|
|
35094
34946
|
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
35095
34947
|
}
|
|
35096
34948
|
}
|
|
@@ -35102,7 +34954,7 @@ var init_NumericValue = __esm({
|
|
|
35102
34954
|
return false;
|
|
35103
34955
|
}
|
|
35104
34956
|
const _nv = object;
|
|
35105
|
-
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" &&
|
|
34957
|
+
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format2.test(_nv.string);
|
|
35106
34958
|
}
|
|
35107
34959
|
};
|
|
35108
34960
|
}
|
|
@@ -36095,8 +35947,8 @@ var init_FromStringShapeDeserializer = __esm({
|
|
|
36095
35947
|
return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(data4);
|
|
36096
35948
|
}
|
|
36097
35949
|
if (ns.isTimestampSchema()) {
|
|
36098
|
-
const
|
|
36099
|
-
switch (
|
|
35950
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
35951
|
+
switch (format4) {
|
|
36100
35952
|
case 5:
|
|
36101
35953
|
return _parseRfc3339DateTimeWithOffset(data4);
|
|
36102
35954
|
case 6:
|
|
@@ -36219,8 +36071,8 @@ var init_ToStringShapeSerializer = __esm({
|
|
|
36219
36071
|
if (!(value instanceof Date)) {
|
|
36220
36072
|
throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
|
|
36221
36073
|
}
|
|
36222
|
-
const
|
|
36223
|
-
switch (
|
|
36074
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
36075
|
+
switch (format4) {
|
|
36224
36076
|
case 5:
|
|
36225
36077
|
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
36226
36078
|
break;
|
|
@@ -40061,17 +39913,17 @@ var require_dist_cjs25 = __commonJS({
|
|
|
40061
39913
|
const { paginators = {}, waiters = {} } = options2 ?? {};
|
|
40062
39914
|
for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {
|
|
40063
39915
|
if (Client5.prototype[paginatorName] === void 0) {
|
|
40064
|
-
Client5.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...
|
|
39916
|
+
Client5.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest2) {
|
|
40065
39917
|
return paginatorFn({
|
|
40066
39918
|
...paginationConfiguration,
|
|
40067
39919
|
client: this
|
|
40068
|
-
}, commandInput, ...
|
|
39920
|
+
}, commandInput, ...rest2);
|
|
40069
39921
|
};
|
|
40070
39922
|
}
|
|
40071
39923
|
}
|
|
40072
39924
|
for (const [waiterName, waiterFn] of Object.entries(waiters)) {
|
|
40073
39925
|
if (Client5.prototype[waiterName] === void 0) {
|
|
40074
|
-
Client5.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...
|
|
39926
|
+
Client5.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest2) {
|
|
40075
39927
|
let config = waiterConfiguration;
|
|
40076
39928
|
if (typeof waiterConfiguration === "number") {
|
|
40077
39929
|
config = {
|
|
@@ -40081,7 +39933,7 @@ var require_dist_cjs25 = __commonJS({
|
|
|
40081
39933
|
return waiterFn({
|
|
40082
39934
|
...config,
|
|
40083
39935
|
client: this
|
|
40084
|
-
}, commandInput, ...
|
|
39936
|
+
}, commandInput, ...rest2);
|
|
40085
39937
|
};
|
|
40086
39938
|
}
|
|
40087
39939
|
}
|
|
@@ -40922,8 +40774,8 @@ var init_JsonShapeDeserializer = __esm({
|
|
|
40922
40774
|
return value;
|
|
40923
40775
|
}
|
|
40924
40776
|
if (ns.isTimestampSchema() && value != null) {
|
|
40925
|
-
const
|
|
40926
|
-
switch (
|
|
40777
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
40778
|
+
switch (format4) {
|
|
40927
40779
|
case 5:
|
|
40928
40780
|
return parseRfc3339DateTimeWithOffset(value);
|
|
40929
40781
|
case 6:
|
|
@@ -41143,8 +40995,8 @@ var init_JsonShapeSerializer = __esm({
|
|
|
41143
40995
|
return (this.serdeContext?.base64Encoder ?? import_util_base645.toBase64)(value);
|
|
41144
40996
|
}
|
|
41145
40997
|
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
|
|
41146
|
-
const
|
|
41147
|
-
switch (
|
|
40998
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
40999
|
+
switch (format4) {
|
|
41148
41000
|
case 5:
|
|
41149
41001
|
return value.toISOString().replace(".000Z", "Z");
|
|
41150
41002
|
case 6:
|
|
@@ -43422,8 +43274,8 @@ var init_QueryShapeSerializer = __esm({
|
|
|
43422
43274
|
} else if (ns.isTimestampSchema()) {
|
|
43423
43275
|
if (value instanceof Date) {
|
|
43424
43276
|
this.writeKey(prefix);
|
|
43425
|
-
const
|
|
43426
|
-
switch (
|
|
43277
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
43278
|
+
switch (format4) {
|
|
43427
43279
|
case 5:
|
|
43428
43280
|
this.writeValue(value.toISOString().replace(".000Z", "Z"));
|
|
43429
43281
|
break;
|
|
@@ -43995,8 +43847,8 @@ var init_XmlShapeSerializer = __esm({
|
|
|
43995
43847
|
if (ns.isBlobSchema()) {
|
|
43996
43848
|
nodeContents = (this.serdeContext?.base64Encoder ?? import_util_base647.toBase64)(value);
|
|
43997
43849
|
} else if (ns.isTimestampSchema() && value instanceof Date) {
|
|
43998
|
-
const
|
|
43999
|
-
switch (
|
|
43850
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
43851
|
+
switch (format4) {
|
|
44000
43852
|
case 5:
|
|
44001
43853
|
nodeContents = value.toISOString().replace(".000Z", "Z");
|
|
44002
43854
|
break;
|
|
@@ -55070,17 +54922,17 @@ var init_split_header2 = __esm({
|
|
|
55070
54922
|
function nv2(input) {
|
|
55071
54923
|
return new NumericValue2(String(input), "bigDecimal");
|
|
55072
54924
|
}
|
|
55073
|
-
var
|
|
54925
|
+
var format3, NumericValue2;
|
|
55074
54926
|
var init_NumericValue2 = __esm({
|
|
55075
54927
|
"../../node_modules/.pnpm/@smithy+core@3.29.7/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() {
|
|
55076
|
-
|
|
54928
|
+
format3 = /^-?\d*(\.\d+)?$/;
|
|
55077
54929
|
NumericValue2 = class _NumericValue {
|
|
55078
54930
|
string;
|
|
55079
54931
|
type;
|
|
55080
54932
|
constructor(string3, type) {
|
|
55081
54933
|
this.string = string3;
|
|
55082
54934
|
this.type = type;
|
|
55083
|
-
if (!
|
|
54935
|
+
if (!format3.test(string3)) {
|
|
55084
54936
|
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
55085
54937
|
}
|
|
55086
54938
|
}
|
|
@@ -55092,7 +54944,7 @@ var init_NumericValue2 = __esm({
|
|
|
55092
54944
|
return false;
|
|
55093
54945
|
}
|
|
55094
54946
|
const _nv = object;
|
|
55095
|
-
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" &&
|
|
54947
|
+
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format3.test(_nv.string);
|
|
55096
54948
|
}
|
|
55097
54949
|
};
|
|
55098
54950
|
}
|
|
@@ -57514,17 +57366,17 @@ var init_create_aggregated_client = __esm({
|
|
|
57514
57366
|
const { paginators = {}, waiters = {} } = options2 ?? {};
|
|
57515
57367
|
for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {
|
|
57516
57368
|
if (Client4.prototype[paginatorName] === void 0) {
|
|
57517
|
-
Client4.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...
|
|
57369
|
+
Client4.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest2) {
|
|
57518
57370
|
return paginatorFn({
|
|
57519
57371
|
...paginationConfiguration,
|
|
57520
57372
|
client: this
|
|
57521
|
-
}, commandInput, ...
|
|
57373
|
+
}, commandInput, ...rest2);
|
|
57522
57374
|
};
|
|
57523
57375
|
}
|
|
57524
57376
|
}
|
|
57525
57377
|
for (const [waiterName, waiterFn] of Object.entries(waiters)) {
|
|
57526
57378
|
if (Client4.prototype[waiterName] === void 0) {
|
|
57527
|
-
Client4.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...
|
|
57379
|
+
Client4.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest2) {
|
|
57528
57380
|
let config = waiterConfiguration;
|
|
57529
57381
|
if (typeof waiterConfiguration === "number") {
|
|
57530
57382
|
config = {
|
|
@@ -57534,7 +57386,7 @@ var init_create_aggregated_client = __esm({
|
|
|
57534
57386
|
return waiterFn({
|
|
57535
57387
|
...config,
|
|
57536
57388
|
client: this
|
|
57537
|
-
}, commandInput, ...
|
|
57389
|
+
}, commandInput, ...rest2);
|
|
57538
57390
|
};
|
|
57539
57391
|
}
|
|
57540
57392
|
}
|
|
@@ -62876,8 +62728,8 @@ var init_FromStringShapeDeserializer2 = __esm({
|
|
|
62876
62728
|
return (this.serdeContext?.base64Decoder ?? fromBase649)(data4);
|
|
62877
62729
|
}
|
|
62878
62730
|
if (ns.isTimestampSchema()) {
|
|
62879
|
-
const
|
|
62880
|
-
switch (
|
|
62731
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
62732
|
+
switch (format4) {
|
|
62881
62733
|
case 5:
|
|
62882
62734
|
return _parseRfc3339DateTimeWithOffset2(data4);
|
|
62883
62735
|
case 6:
|
|
@@ -62999,8 +62851,8 @@ var init_ToStringShapeSerializer2 = __esm({
|
|
|
62999
62851
|
if (!(value instanceof Date)) {
|
|
63000
62852
|
throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
|
|
63001
62853
|
}
|
|
63002
|
-
const
|
|
63003
|
-
switch (
|
|
62854
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
62855
|
+
switch (format4) {
|
|
63004
62856
|
case 5:
|
|
63005
62857
|
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
63006
62858
|
break;
|
|
@@ -64739,8 +64591,8 @@ var init_recursionDetectionMiddleware = __esm({
|
|
|
64739
64591
|
invokeStore ??= await InvokeStore2.getInstanceAsync();
|
|
64740
64592
|
const traceIdFromInvokeStore = invokeStore?.getXRayTraceId();
|
|
64741
64593
|
const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;
|
|
64742
|
-
const
|
|
64743
|
-
if (
|
|
64594
|
+
const nonEmptyString2 = (str2) => typeof str2 === "string" && str2.length > 0;
|
|
64595
|
+
if (nonEmptyString2(functionName) && nonEmptyString2(traceId)) {
|
|
64744
64596
|
request.headers[X_AMZN_TRACE_ID] = traceId;
|
|
64745
64597
|
}
|
|
64746
64598
|
}
|
|
@@ -66236,8 +66088,8 @@ var init_createUserAgentStringParsingProvider = __esm({
|
|
|
66236
66088
|
"../../node_modules/.pnpm/@aws-sdk+core@3.976.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.js"() {
|
|
66237
66089
|
createUserAgentStringParsingProvider = ({ serviceId, clientVersion }) => async (config) => {
|
|
66238
66090
|
const module2 = await Promise.resolve().then(() => __toESM(require_es5()));
|
|
66239
|
-
const
|
|
66240
|
-
const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent ?
|
|
66091
|
+
const parse7 = module2.parse ?? module2.default.parse ?? (() => "");
|
|
66092
|
+
const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent ? parse7(window.navigator.userAgent) : void 0;
|
|
66241
66093
|
const sections = [
|
|
66242
66094
|
["aws-sdk-js", clientVersion],
|
|
66243
66095
|
["ua", "2.1"],
|
|
@@ -69188,8 +69040,8 @@ var init_JsonShapeDeserializer2 = __esm({
|
|
|
69188
69040
|
return value;
|
|
69189
69041
|
}
|
|
69190
69042
|
if (ns.isTimestampSchema() && value != null) {
|
|
69191
|
-
const
|
|
69192
|
-
switch (
|
|
69043
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
69044
|
+
switch (format4) {
|
|
69193
69045
|
case 5:
|
|
69194
69046
|
return parseRfc3339DateTimeWithOffset2(value);
|
|
69195
69047
|
case 6:
|
|
@@ -69413,8 +69265,8 @@ var init_JsonShapeSerializer2 = __esm({
|
|
|
69413
69265
|
return (this.serdeContext?.base64Encoder ?? toBase649)(value);
|
|
69414
69266
|
}
|
|
69415
69267
|
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
|
|
69416
|
-
const
|
|
69417
|
-
switch (
|
|
69268
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
69269
|
+
switch (format4) {
|
|
69418
69270
|
case 5:
|
|
69419
69271
|
return value.toISOString().replace(".000Z", "Z");
|
|
69420
69272
|
case 6:
|
|
@@ -70313,8 +70165,8 @@ var init_QueryShapeSerializer2 = __esm({
|
|
|
70313
70165
|
} else if (ns.isTimestampSchema()) {
|
|
70314
70166
|
if (value instanceof Date) {
|
|
70315
70167
|
this.writeKey(prefix);
|
|
70316
|
-
const
|
|
70317
|
-
switch (
|
|
70168
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
70169
|
+
switch (format4) {
|
|
70318
70170
|
case 5:
|
|
70319
70171
|
this.writeValue(value.toISOString().replace(".000Z", "Z"));
|
|
70320
70172
|
break;
|
|
@@ -70877,8 +70729,8 @@ var init_XmlShapeSerializer2 = __esm({
|
|
|
70877
70729
|
if (ns.isBlobSchema()) {
|
|
70878
70730
|
nodeContents = (this.serdeContext?.base64Encoder ?? toBase649)(value);
|
|
70879
70731
|
} else if (ns.isTimestampSchema() && value instanceof Date) {
|
|
70880
|
-
const
|
|
70881
|
-
switch (
|
|
70732
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
70733
|
+
switch (format4) {
|
|
70882
70734
|
case 5:
|
|
70883
70735
|
nodeContents = value.toISOString().replace(".000Z", "Z");
|
|
70884
70736
|
break;
|
|
@@ -75145,7 +74997,7 @@ var init_httpAuthSchemeProvider7 = __esm({
|
|
|
75145
74997
|
}
|
|
75146
74998
|
const options2 = [];
|
|
75147
74999
|
for (const scheme of authSchemes) {
|
|
75148
|
-
const { name: resolvedName, properties = {}, ...
|
|
75000
|
+
const { name: resolvedName, properties = {}, ...rest2 } = scheme;
|
|
75149
75001
|
const name3 = resolvedName.toLowerCase();
|
|
75150
75002
|
if (resolvedName !== name3) {
|
|
75151
75003
|
console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name3}'`);
|
|
@@ -75171,7 +75023,7 @@ var init_httpAuthSchemeProvider7 = __esm({
|
|
|
75171
75023
|
}
|
|
75172
75024
|
const option = createOption(authParameters);
|
|
75173
75025
|
option.schemeId = schemeId;
|
|
75174
|
-
option.signingProperties = { ...option.signingProperties || {}, ...
|
|
75026
|
+
option.signingProperties = { ...option.signingProperties || {}, ...rest2, ...properties };
|
|
75175
75027
|
options2.push(option);
|
|
75176
75028
|
}
|
|
75177
75029
|
return options2;
|
|
@@ -82550,17 +82402,17 @@ var init_create_aggregated_client2 = __esm({
|
|
|
82550
82402
|
const { paginators = {}, waiters = {} } = options2 ?? {};
|
|
82551
82403
|
for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {
|
|
82552
82404
|
if (Client4.prototype[paginatorName] === void 0) {
|
|
82553
|
-
Client4.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...
|
|
82405
|
+
Client4.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest2) {
|
|
82554
82406
|
return paginatorFn({
|
|
82555
82407
|
...paginationConfiguration,
|
|
82556
82408
|
client: this
|
|
82557
|
-
}, commandInput, ...
|
|
82409
|
+
}, commandInput, ...rest2);
|
|
82558
82410
|
};
|
|
82559
82411
|
}
|
|
82560
82412
|
}
|
|
82561
82413
|
for (const [waiterName, waiterFn] of Object.entries(waiters)) {
|
|
82562
82414
|
if (Client4.prototype[waiterName] === void 0) {
|
|
82563
|
-
Client4.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...
|
|
82415
|
+
Client4.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest2) {
|
|
82564
82416
|
let config = waiterConfiguration;
|
|
82565
82417
|
if (typeof waiterConfiguration === "number") {
|
|
82566
82418
|
config = {
|
|
@@ -82570,7 +82422,7 @@ var init_create_aggregated_client2 = __esm({
|
|
|
82570
82422
|
return waiterFn({
|
|
82571
82423
|
...config,
|
|
82572
82424
|
client: this
|
|
82573
|
-
}, commandInput, ...
|
|
82425
|
+
}, commandInput, ...rest2);
|
|
82574
82426
|
};
|
|
82575
82427
|
}
|
|
82576
82428
|
}
|
|
@@ -86373,7 +86225,7 @@ var require_parse2 = __commonJS({
|
|
|
86373
86225
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
86374
86226
|
"use strict";
|
|
86375
86227
|
var SemVer = require_semver();
|
|
86376
|
-
var
|
|
86228
|
+
var parse7 = (version2, options2, throwErrors = false) => {
|
|
86377
86229
|
if (version2 instanceof SemVer) {
|
|
86378
86230
|
return version2;
|
|
86379
86231
|
}
|
|
@@ -86386,7 +86238,7 @@ var require_parse2 = __commonJS({
|
|
|
86386
86238
|
throw er;
|
|
86387
86239
|
}
|
|
86388
86240
|
};
|
|
86389
|
-
module2.exports =
|
|
86241
|
+
module2.exports = parse7;
|
|
86390
86242
|
}
|
|
86391
86243
|
});
|
|
86392
86244
|
|
|
@@ -86394,9 +86246,9 @@ var require_parse2 = __commonJS({
|
|
|
86394
86246
|
var require_valid = __commonJS({
|
|
86395
86247
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
86396
86248
|
"use strict";
|
|
86397
|
-
var
|
|
86249
|
+
var parse7 = require_parse2();
|
|
86398
86250
|
var valid = (version2, options2) => {
|
|
86399
|
-
const v5 =
|
|
86251
|
+
const v5 = parse7(version2, options2);
|
|
86400
86252
|
return v5 ? v5.version : null;
|
|
86401
86253
|
};
|
|
86402
86254
|
module2.exports = valid;
|
|
@@ -86407,9 +86259,9 @@ var require_valid = __commonJS({
|
|
|
86407
86259
|
var require_clean = __commonJS({
|
|
86408
86260
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
86409
86261
|
"use strict";
|
|
86410
|
-
var
|
|
86262
|
+
var parse7 = require_parse2();
|
|
86411
86263
|
var clean = (version2, options2) => {
|
|
86412
|
-
const s7 =
|
|
86264
|
+
const s7 = parse7(version2.trim().replace(/^[=v]+/, ""), options2);
|
|
86413
86265
|
return s7 ? s7.version : null;
|
|
86414
86266
|
};
|
|
86415
86267
|
module2.exports = clean;
|
|
@@ -86444,10 +86296,10 @@ var require_inc = __commonJS({
|
|
|
86444
86296
|
var require_diff = __commonJS({
|
|
86445
86297
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
86446
86298
|
"use strict";
|
|
86447
|
-
var
|
|
86299
|
+
var parse7 = require_parse2();
|
|
86448
86300
|
var diff = (version1, version2) => {
|
|
86449
|
-
const v1 =
|
|
86450
|
-
const v22 =
|
|
86301
|
+
const v1 = parse7(version1, null, true);
|
|
86302
|
+
const v22 = parse7(version2, null, true);
|
|
86451
86303
|
const comparison = v1.compare(v22);
|
|
86452
86304
|
if (comparison === 0) {
|
|
86453
86305
|
return null;
|
|
@@ -86518,9 +86370,9 @@ var require_patch = __commonJS({
|
|
|
86518
86370
|
var require_prerelease = __commonJS({
|
|
86519
86371
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
86520
86372
|
"use strict";
|
|
86521
|
-
var
|
|
86373
|
+
var parse7 = require_parse2();
|
|
86522
86374
|
var prerelease = (version2, options2) => {
|
|
86523
|
-
const parsed =
|
|
86375
|
+
const parsed = parse7(version2, options2);
|
|
86524
86376
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
86525
86377
|
};
|
|
86526
86378
|
module2.exports = prerelease;
|
|
@@ -86706,7 +86558,7 @@ var require_coerce = __commonJS({
|
|
|
86706
86558
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
86707
86559
|
"use strict";
|
|
86708
86560
|
var SemVer = require_semver();
|
|
86709
|
-
var
|
|
86561
|
+
var parse7 = require_parse2();
|
|
86710
86562
|
var { safeRe: re, t: t6 } = require_re();
|
|
86711
86563
|
var coerce2 = (version2, options2) => {
|
|
86712
86564
|
if (version2 instanceof SemVer) {
|
|
@@ -86741,7 +86593,7 @@ var require_coerce = __commonJS({
|
|
|
86741
86593
|
const patch = match2[4] || "0";
|
|
86742
86594
|
const prerelease = options2.includePrerelease && match2[5] ? `-${match2[5]}` : "";
|
|
86743
86595
|
const build = options2.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
|
86744
|
-
return
|
|
86596
|
+
return parse7(`${major}.${minor}.${patch}${prerelease}${build}`, options2);
|
|
86745
86597
|
};
|
|
86746
86598
|
module2.exports = coerce2;
|
|
86747
86599
|
}
|
|
@@ -86751,7 +86603,7 @@ var require_coerce = __commonJS({
|
|
|
86751
86603
|
var require_truncate = __commonJS({
|
|
86752
86604
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports2, module2) {
|
|
86753
86605
|
"use strict";
|
|
86754
|
-
var
|
|
86606
|
+
var parse7 = require_parse2();
|
|
86755
86607
|
var constants2 = require_constants2();
|
|
86756
86608
|
var SemVer = require_semver();
|
|
86757
86609
|
var truncate2 = (version2, truncation, options2) => {
|
|
@@ -86763,7 +86615,7 @@ var require_truncate = __commonJS({
|
|
|
86763
86615
|
};
|
|
86764
86616
|
var cloneInputVersion = (version2, options2) => {
|
|
86765
86617
|
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
86766
|
-
return
|
|
86618
|
+
return parse7(versionStringToParse, options2);
|
|
86767
86619
|
};
|
|
86768
86620
|
var doTruncation = (version2, truncation) => {
|
|
86769
86621
|
if (isPrerelease(truncation)) {
|
|
@@ -87807,7 +87659,7 @@ var require_semver2 = __commonJS({
|
|
|
87807
87659
|
var constants2 = require_constants2();
|
|
87808
87660
|
var SemVer = require_semver();
|
|
87809
87661
|
var identifiers = require_identifiers();
|
|
87810
|
-
var
|
|
87662
|
+
var parse7 = require_parse2();
|
|
87811
87663
|
var valid = require_valid();
|
|
87812
87664
|
var clean = require_clean();
|
|
87813
87665
|
var inc = require_inc();
|
|
@@ -87846,7 +87698,7 @@ var require_semver2 = __commonJS({
|
|
|
87846
87698
|
var simplifyRange = require_simplify();
|
|
87847
87699
|
var subset = require_subset();
|
|
87848
87700
|
module2.exports = {
|
|
87849
|
-
parse:
|
|
87701
|
+
parse: parse7,
|
|
87850
87702
|
valid,
|
|
87851
87703
|
clean,
|
|
87852
87704
|
inc,
|
|
@@ -92229,7 +92081,7 @@ function parseStringResponse(result, parsers12, texts, trim = true) {
|
|
|
92229
92081
|
}
|
|
92230
92082
|
return lines[i10 + offset2];
|
|
92231
92083
|
};
|
|
92232
|
-
parsers12.some(({ parse:
|
|
92084
|
+
parsers12.some(({ parse: parse7 }) => parse7(line, result));
|
|
92233
92085
|
}
|
|
92234
92086
|
});
|
|
92235
92087
|
return result;
|
|
@@ -92688,14 +92540,14 @@ function listConfigTask(scope) {
|
|
|
92688
92540
|
}
|
|
92689
92541
|
function config_default() {
|
|
92690
92542
|
return {
|
|
92691
|
-
addConfig(key, value, ...
|
|
92543
|
+
addConfig(key, value, ...rest2) {
|
|
92692
92544
|
return this._runTask(
|
|
92693
92545
|
addConfigTask(
|
|
92694
92546
|
key,
|
|
92695
92547
|
value,
|
|
92696
|
-
|
|
92548
|
+
rest2[0] === true,
|
|
92697
92549
|
asConfigScope(
|
|
92698
|
-
|
|
92550
|
+
rest2[1],
|
|
92699
92551
|
"local"
|
|
92700
92552
|
/* local */
|
|
92701
92553
|
)
|
|
@@ -92709,9 +92561,9 @@ function config_default() {
|
|
|
92709
92561
|
trailingFunctionArgument(arguments)
|
|
92710
92562
|
);
|
|
92711
92563
|
},
|
|
92712
|
-
listConfig(...
|
|
92564
|
+
listConfig(...rest2) {
|
|
92713
92565
|
return this._runTask(
|
|
92714
|
-
listConfigTask(asConfigScope(
|
|
92566
|
+
listConfigTask(asConfigScope(rest2[0], void 0)),
|
|
92715
92567
|
trailingFunctionArgument(arguments)
|
|
92716
92568
|
);
|
|
92717
92569
|
}
|
|
@@ -93473,13 +93325,13 @@ function commitTask(message2, files, customArgs) {
|
|
|
93473
93325
|
}
|
|
93474
93326
|
function commit_default() {
|
|
93475
93327
|
return {
|
|
93476
|
-
commit(message2, ...
|
|
93328
|
+
commit(message2, ...rest2) {
|
|
93477
93329
|
const next = trailingFunctionArgument(arguments);
|
|
93478
93330
|
const task = rejectDeprecatedSignatures(message2) || commitTask(
|
|
93479
93331
|
asArray(message2),
|
|
93480
|
-
asArray(filterType(
|
|
93332
|
+
asArray(filterType(rest2[0], filterStringOrStringArray, [])),
|
|
93481
93333
|
[
|
|
93482
|
-
...asStringArray(filterType(
|
|
93334
|
+
...asStringArray(filterType(rest2[1], filterArray, [])),
|
|
93483
93335
|
...getTrailingOptions(arguments, 0, true)
|
|
93484
93336
|
]
|
|
93485
93337
|
);
|
|
@@ -93594,9 +93446,9 @@ var init_init = __esm2({
|
|
|
93594
93446
|
});
|
|
93595
93447
|
function logFormatFromCommand(customArgs) {
|
|
93596
93448
|
for (let i10 = 0; i10 < customArgs.length; i10++) {
|
|
93597
|
-
const
|
|
93598
|
-
if (
|
|
93599
|
-
return `--${
|
|
93449
|
+
const format4 = logFormatRegex.exec(customArgs[i10]);
|
|
93450
|
+
if (format4) {
|
|
93451
|
+
return `--${format4[1]}`;
|
|
93600
93452
|
}
|
|
93601
93453
|
}
|
|
93602
93454
|
return "";
|
|
@@ -93625,8 +93477,8 @@ var init_DiffSummary = __esm2({
|
|
|
93625
93477
|
};
|
|
93626
93478
|
}
|
|
93627
93479
|
});
|
|
93628
|
-
function getDiffParser(
|
|
93629
|
-
const parser4 = diffSummaryParsers[
|
|
93480
|
+
function getDiffParser(format4 = "") {
|
|
93481
|
+
const parser4 = diffSummaryParsers[format4];
|
|
93630
93482
|
return (stdOut) => parseStringResponse(new DiffSummary(), parser4, stdOut, false);
|
|
93631
93483
|
}
|
|
93632
93484
|
var statParser;
|
|
@@ -93845,12 +93697,12 @@ var init_diff = __esm2({
|
|
|
93845
93697
|
init_task();
|
|
93846
93698
|
}
|
|
93847
93699
|
});
|
|
93848
|
-
function prettyFormat(
|
|
93700
|
+
function prettyFormat(format4, splitter) {
|
|
93849
93701
|
const fields = [];
|
|
93850
93702
|
const formatStr = [];
|
|
93851
|
-
Object.keys(
|
|
93703
|
+
Object.keys(format4).forEach((field) => {
|
|
93852
93704
|
fields.push(field);
|
|
93853
|
-
formatStr.push(String(
|
|
93705
|
+
formatStr.push(String(format4[field]));
|
|
93854
93706
|
});
|
|
93855
93707
|
return [fields, formatStr.join(splitter)];
|
|
93856
93708
|
}
|
|
@@ -93864,7 +93716,7 @@ function userOptions(input) {
|
|
|
93864
93716
|
}
|
|
93865
93717
|
function parseLogOptions(opt = {}, customArgs = []) {
|
|
93866
93718
|
const splitter = filterType(opt.splitter, filterString, SPLITTER);
|
|
93867
|
-
const
|
|
93719
|
+
const format4 = filterPlainObject(opt.format) ? opt.format : {
|
|
93868
93720
|
hash: "%H",
|
|
93869
93721
|
date: opt.strictDate === false ? "%ai" : "%aI",
|
|
93870
93722
|
message: "%s",
|
|
@@ -93873,7 +93725,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
|
|
|
93873
93725
|
author_name: opt.mailMap !== false ? "%aN" : "%an",
|
|
93874
93726
|
author_email: opt.mailMap !== false ? "%aE" : "%ae"
|
|
93875
93727
|
};
|
|
93876
|
-
const [fields, formatStr] = prettyFormat(
|
|
93728
|
+
const [fields, formatStr] = prettyFormat(format4, splitter);
|
|
93877
93729
|
const suffix = [];
|
|
93878
93730
|
const command5 = [
|
|
93879
93731
|
`--pretty=format:${START_BOUNDARY}${formatStr}${COMMIT_BOUNDARY}`,
|
|
@@ -93907,13 +93759,13 @@ function logTask(splitter, fields, customArgs) {
|
|
|
93907
93759
|
}
|
|
93908
93760
|
function log_default() {
|
|
93909
93761
|
return {
|
|
93910
|
-
log(...
|
|
93762
|
+
log(...rest2) {
|
|
93911
93763
|
const next = trailingFunctionArgument(arguments);
|
|
93912
93764
|
const options2 = parseLogOptions(
|
|
93913
93765
|
trailingOptionsArgument(arguments),
|
|
93914
93766
|
asStringArray(filterType(arguments[0], filterArray, []))
|
|
93915
93767
|
);
|
|
93916
|
-
const task = rejectDeprecatedSignatures(...
|
|
93768
|
+
const task = rejectDeprecatedSignatures(...rest2) || validateLogFormatConfig(options2.commands) || createLogTask(options2);
|
|
93917
93769
|
return this._runTask(task, next);
|
|
93918
93770
|
}
|
|
93919
93771
|
};
|
|
@@ -94688,15 +94540,15 @@ function createCloneTask(api, task, repoPath, ...args) {
|
|
|
94688
94540
|
}
|
|
94689
94541
|
function clone_default() {
|
|
94690
94542
|
return {
|
|
94691
|
-
clone(repo, ...
|
|
94543
|
+
clone(repo, ...rest2) {
|
|
94692
94544
|
return this._runTask(
|
|
94693
|
-
createCloneTask("clone", cloneTask, filterType(repo, filterString), ...
|
|
94545
|
+
createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest2),
|
|
94694
94546
|
trailingFunctionArgument(arguments)
|
|
94695
94547
|
);
|
|
94696
94548
|
},
|
|
94697
|
-
mirror(repo, ...
|
|
94549
|
+
mirror(repo, ...rest2) {
|
|
94698
94550
|
return this._runTask(
|
|
94699
|
-
createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...
|
|
94551
|
+
createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest2),
|
|
94700
94552
|
trailingFunctionArgument(arguments)
|
|
94701
94553
|
);
|
|
94702
94554
|
}
|
|
@@ -95829,7 +95681,7 @@ var require_git = __commonJS2({
|
|
|
95829
95681
|
Git2.prototype.binaryCatFile = function() {
|
|
95830
95682
|
return this._catFile("buffer", arguments);
|
|
95831
95683
|
};
|
|
95832
|
-
Git2.prototype._catFile = function(
|
|
95684
|
+
Git2.prototype._catFile = function(format4, args) {
|
|
95833
95685
|
var handler = trailingFunctionArgument2(args);
|
|
95834
95686
|
var command5 = ["cat-file"];
|
|
95835
95687
|
var options2 = args[0];
|
|
@@ -95842,7 +95694,7 @@ var require_git = __commonJS2({
|
|
|
95842
95694
|
if (Array.isArray(options2)) {
|
|
95843
95695
|
command5.push.apply(command5, options2);
|
|
95844
95696
|
}
|
|
95845
|
-
const task =
|
|
95697
|
+
const task = format4 === "buffer" ? straightThroughBufferTask2(command5) : straightThroughStringTask2(command5);
|
|
95846
95698
|
return this._runTask(task, handler);
|
|
95847
95699
|
};
|
|
95848
95700
|
Git2.prototype.diff = function(options2, then) {
|
|
@@ -96443,10 +96295,10 @@ var parseTypedFilename = (filename, entryTypes) => {
|
|
|
96443
96295
|
};
|
|
96444
96296
|
|
|
96445
96297
|
// ../canopycms/src/utils/format.ts
|
|
96446
|
-
var getFormatExtension = (
|
|
96447
|
-
if (
|
|
96448
|
-
if (
|
|
96449
|
-
if (
|
|
96298
|
+
var getFormatExtension = (format4) => {
|
|
96299
|
+
if (format4 === "md") return ".md";
|
|
96300
|
+
if (format4 === "mdx") return ".mdx";
|
|
96301
|
+
if (format4 === "yaml") return ".yaml";
|
|
96450
96302
|
return ".json";
|
|
96451
96303
|
};
|
|
96452
96304
|
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
@@ -96458,7 +96310,7 @@ function toLogicalCollectionPath(physicalPath) {
|
|
|
96458
96310
|
return physicalPath.split("/").map((seg) => extractSlugFromFilename(seg)).join("/");
|
|
96459
96311
|
}
|
|
96460
96312
|
var ENTRY_EXTENSIONS = new Set(
|
|
96461
|
-
Object.keys({ md: true, mdx: true, json: true, yaml: true }).map((
|
|
96313
|
+
Object.keys({ md: true, mdx: true, json: true, yaml: true }).map((format4) => getFormatExtension(format4))
|
|
96462
96314
|
);
|
|
96463
96315
|
function entryLogicalPathOfFile(relativePath, contentRoot) {
|
|
96464
96316
|
const root5 = normalizeFilesystemPath(contentRoot);
|
|
@@ -97772,11 +97624,11 @@ async function list(dir) {
|
|
|
97772
97624
|
throw err;
|
|
97773
97625
|
});
|
|
97774
97626
|
}
|
|
97775
|
-
async function walk(dir,
|
|
97627
|
+
async function walk(dir, visit5) {
|
|
97776
97628
|
for (const entry of await list(dir)) {
|
|
97777
97629
|
const full = path9.join(dir, entry.name);
|
|
97778
|
-
if (entry.isDirectory()) await walk(full,
|
|
97779
|
-
else await
|
|
97630
|
+
if (entry.isDirectory()) await walk(full, visit5);
|
|
97631
|
+
else await visit5(full);
|
|
97780
97632
|
}
|
|
97781
97633
|
}
|
|
97782
97634
|
|
|
@@ -100524,12 +100376,12 @@ async function unreachableFrom(ctx, gitDir, ids, tips) {
|
|
|
100524
100376
|
return unreachable;
|
|
100525
100377
|
}
|
|
100526
100378
|
async function pushToGitHub(ctx, request, readSha, signal) {
|
|
100527
|
-
const { prerequisiteBranches, readSeen, ...
|
|
100379
|
+
const { prerequisiteBranches, readSeen, ...rest2 } = request;
|
|
100528
100380
|
for (let restarts = 0; ; restarts++) {
|
|
100529
100381
|
const sha = await readSha();
|
|
100530
100382
|
const seen = await readSeen?.();
|
|
100531
100383
|
const prerequisites = await trackingTips(ctx.remoteGitPath, prerequisiteBranches);
|
|
100532
|
-
const ask = { ...
|
|
100384
|
+
const ask = { ...rest2, sha, ...seen ? { seen } : {}, prerequisites };
|
|
100533
100385
|
const first2 = await ctx.github().push(ask, void 0, signal);
|
|
100534
100386
|
if (first2.kind === "pushed") return { sha, outcome: outcomeOf(first2) };
|
|
100535
100387
|
const bundle = await startBundle(ctx, request.branch, sha, first2.usable, signal);
|
|
@@ -100565,7 +100417,7 @@ async function startBundle(ctx, branch, sha, usable, signal) {
|
|
|
100565
100417
|
);
|
|
100566
100418
|
const chunks = proc.stdout[Symbol.asyncIterator]();
|
|
100567
100419
|
const reader = new BundleHeaderReader("shorten");
|
|
100568
|
-
let
|
|
100420
|
+
let unreadable2 = null;
|
|
100569
100421
|
try {
|
|
100570
100422
|
for (; ; ) {
|
|
100571
100423
|
const next = await chunks.next();
|
|
@@ -100574,7 +100426,7 @@ async function startBundle(ctx, branch, sha, usable, signal) {
|
|
|
100574
100426
|
try {
|
|
100575
100427
|
read = reader.push(next.value);
|
|
100576
100428
|
} catch (err) {
|
|
100577
|
-
|
|
100429
|
+
unreadable2 = err;
|
|
100578
100430
|
break;
|
|
100579
100431
|
}
|
|
100580
100432
|
if (read === null) continue;
|
|
@@ -100588,9 +100440,9 @@ async function startBundle(ctx, branch, sha, usable, signal) {
|
|
|
100588
100440
|
yield bytes;
|
|
100589
100441
|
if (first2.length > 0) yield first2;
|
|
100590
100442
|
for (; ; ) {
|
|
100591
|
-
const
|
|
100592
|
-
if (
|
|
100593
|
-
yield
|
|
100443
|
+
const rest2 = await chunks.next();
|
|
100444
|
+
if (rest2.done) return;
|
|
100445
|
+
yield rest2.value;
|
|
100594
100446
|
}
|
|
100595
100447
|
})()
|
|
100596
100448
|
);
|
|
@@ -100599,10 +100451,10 @@ async function startBundle(ctx, branch, sha, usable, signal) {
|
|
|
100599
100451
|
} catch (err) {
|
|
100600
100452
|
throw await causeOf(proc, err, "its header could not be read");
|
|
100601
100453
|
}
|
|
100602
|
-
if (
|
|
100454
|
+
if (unreadable2 !== null) {
|
|
100603
100455
|
proc.stdout.destroy();
|
|
100604
100456
|
if (await refusedAsEmpty(proc).catch(() => false)) return "empty";
|
|
100605
|
-
throw
|
|
100457
|
+
throw unreadable2;
|
|
100606
100458
|
}
|
|
100607
100459
|
if (await refusedAsEmpty(proc)) return "empty";
|
|
100608
100460
|
throw new Error(`git bundle create printed no header for ${branch}`);
|
|
@@ -100649,9 +100501,9 @@ async function unbundle(ctx, gitDir, bundleId, signal) {
|
|
|
100649
100501
|
(async function* () {
|
|
100650
100502
|
if (first2.length > 0) yield first2;
|
|
100651
100503
|
for (; ; ) {
|
|
100652
|
-
const
|
|
100653
|
-
if (
|
|
100654
|
-
yield
|
|
100504
|
+
const rest2 = await chunks.next();
|
|
100505
|
+
if (rest2.done) return;
|
|
100506
|
+
yield rest2.value;
|
|
100655
100507
|
}
|
|
100656
100508
|
})()
|
|
100657
100509
|
);
|
|
@@ -100828,7 +100680,7 @@ init_error();
|
|
|
100828
100680
|
init_worker_status();
|
|
100829
100681
|
|
|
100830
100682
|
// ../canopycms/src/version.ts
|
|
100831
|
-
var CANOPYCMS_VERSION = "0.
|
|
100683
|
+
var CANOPYCMS_VERSION = "0.14.1";
|
|
100832
100684
|
|
|
100833
100685
|
// ../canopycms/src/worker/schema-gate.ts
|
|
100834
100686
|
import fs15 from "node:fs/promises";
|
|
@@ -101112,6 +100964,21 @@ var BRANCH_META_FILE = "branch.json";
|
|
|
101112
100964
|
var branchMetadataFilePath = (branchRoot) => path17.join(path17.resolve(branchRoot), BRANCH_META_DIR, BRANCH_META_FILE);
|
|
101113
100965
|
var UNKNOWN_TIME = (/* @__PURE__ */ new Date(0)).toISOString();
|
|
101114
100966
|
var enumOf = (values) => external_exports.nativeEnum(values);
|
|
100967
|
+
var exclusionSchema = external_exports.object({ by: external_exports.string(), at: external_exports.string(), byAdmin: external_exports.boolean() }).passthrough();
|
|
100968
|
+
var branchAccessSchema = external_exports.object({
|
|
100969
|
+
allowedUsers: external_exports.array(external_exports.string()).optional(),
|
|
100970
|
+
allowedGroups: external_exports.array(external_exports.string()).optional(),
|
|
100971
|
+
managerOrAdminAllowed: external_exports.boolean().optional(),
|
|
100972
|
+
restricted: external_exports.boolean().optional(),
|
|
100973
|
+
excluded: external_exports.record(external_exports.string(), exclusionSchema).optional(),
|
|
100974
|
+
excludedGroups: external_exports.record(external_exports.string(), exclusionSchema).optional(),
|
|
100975
|
+
addBy: enumOf({
|
|
100976
|
+
members: "members",
|
|
100977
|
+
owner: "owner",
|
|
100978
|
+
admins: "admins"
|
|
100979
|
+
}).optional(),
|
|
100980
|
+
entryMeta: external_exports.record(external_exports.string(), external_exports.object({ addedBy: external_exports.string(), addedAt: external_exports.string() }).passthrough()).optional()
|
|
100981
|
+
}).passthrough();
|
|
101115
100982
|
var branchMetadataShape = {
|
|
101116
100983
|
name: external_exports.string().min(1),
|
|
101117
100984
|
title: external_exports.string().optional(),
|
|
@@ -101122,11 +100989,7 @@ var branchMetadataShape = {
|
|
|
101122
100989
|
approved: "approved",
|
|
101123
100990
|
archived: "archived"
|
|
101124
100991
|
}),
|
|
101125
|
-
access:
|
|
101126
|
-
allowedUsers: external_exports.array(external_exports.string()).optional(),
|
|
101127
|
-
allowedGroups: external_exports.array(external_exports.string()).optional(),
|
|
101128
|
-
managerOrAdminAllowed: external_exports.boolean().optional()
|
|
101129
|
-
}).passthrough(),
|
|
100992
|
+
access: branchAccessSchema,
|
|
101130
100993
|
createdBy: external_exports.string().default("unknown"),
|
|
101131
100994
|
createdAt: external_exports.string().default(UNKNOWN_TIME),
|
|
101132
100995
|
updatedAt: external_exports.string().default(UNKNOWN_TIME),
|
|
@@ -101235,6 +101098,17 @@ function parseBranchMetadataFile(branchRoot, raw) {
|
|
|
101235
101098
|
const file = result.data;
|
|
101236
101099
|
return file;
|
|
101237
101100
|
}
|
|
101101
|
+
var unreadable = Symbol("unreadable");
|
|
101102
|
+
var nonEmptyString = external_exports.string().min(1).optional();
|
|
101103
|
+
var {
|
|
101104
|
+
name: _name,
|
|
101105
|
+
access: _access,
|
|
101106
|
+
createdAt: _createdAt,
|
|
101107
|
+
updatedAt: _updatedAt,
|
|
101108
|
+
...rest
|
|
101109
|
+
} = branchMetadataShape;
|
|
101110
|
+
var salvagedFieldShape = { ...rest, createdBy: nonEmptyString, baseBranch: nonEmptyString };
|
|
101111
|
+
var salvagedFieldsSchema = external_exports.object(salvagedFieldShape).partial().strip();
|
|
101238
101112
|
|
|
101239
101113
|
// ../canopycms/src/branch-registry.ts
|
|
101240
101114
|
init_error();
|
|
@@ -101557,7 +101431,7 @@ async function withOccRetry(operation3, options2) {
|
|
|
101557
101431
|
}
|
|
101558
101432
|
throw new Error("Unreachable");
|
|
101559
101433
|
}
|
|
101560
|
-
async function withOccFileLock(filePath, fn) {
|
|
101434
|
+
async function withOccFileLock(filePath, fn, options2) {
|
|
101561
101435
|
try {
|
|
101562
101436
|
await fs18.mkdir(path19.dirname(filePath));
|
|
101563
101437
|
} catch (err) {
|
|
@@ -101565,7 +101439,7 @@ async function withOccFileLock(filePath, fn) {
|
|
|
101565
101439
|
throw new OccWriteConflictError(`Could not acquire file lock: ${getErrorMessage(err)}`);
|
|
101566
101440
|
}
|
|
101567
101441
|
}
|
|
101568
|
-
const MAX_ATTEMPTS = 14;
|
|
101442
|
+
const MAX_ATTEMPTS = options2?.tryOnce ? 1 : 14;
|
|
101569
101443
|
let release2 = null;
|
|
101570
101444
|
for (let attempt = 1; release2 === null; attempt++) {
|
|
101571
101445
|
try {
|
|
@@ -101811,7 +101685,7 @@ function mergeBranchMetadata(existing, version2, incoming, now = (/* @__PURE__ *
|
|
|
101811
101685
|
},
|
|
101812
101686
|
// Immutable after creation
|
|
101813
101687
|
createdBy: existing?.branch.createdBy ?? incoming.branch?.createdBy ?? defaults.createdBy,
|
|
101814
|
-
createdAt: existing?.branch.createdAt ?? defaults.createdAt,
|
|
101688
|
+
createdAt: existing?.branch.createdAt ?? incoming.createdAt ?? defaults.createdAt,
|
|
101815
101689
|
// Fork point is recorded once at creation; later saves must not move it
|
|
101816
101690
|
baseBranch: existing?.branch.baseBranch ?? incoming.branch?.baseBranch,
|
|
101817
101691
|
// Always stamped fresh; the spreads above would otherwise let the creation-time value win
|
|
@@ -103309,8 +103183,1337 @@ init_item_keys();
|
|
|
103309
103183
|
init_error();
|
|
103310
103184
|
|
|
103311
103185
|
// ../canopycms/src/utils/json-source-splice.ts
|
|
103312
|
-
var import_jsonc_parser = __toESM(require_main(), 1);
|
|
103313
103186
|
import { isDeepStrictEqual } from "node:util";
|
|
103187
|
+
|
|
103188
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
103189
|
+
function createScanner(text4, ignoreTrivia = false) {
|
|
103190
|
+
const len = text4.length;
|
|
103191
|
+
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
103192
|
+
function scanHexDigits(count, exact) {
|
|
103193
|
+
let digits = 0;
|
|
103194
|
+
let value2 = 0;
|
|
103195
|
+
while (digits < count || !exact) {
|
|
103196
|
+
let ch = text4.charCodeAt(pos);
|
|
103197
|
+
if (ch >= 48 && ch <= 57) {
|
|
103198
|
+
value2 = value2 * 16 + ch - 48;
|
|
103199
|
+
} else if (ch >= 65 && ch <= 70) {
|
|
103200
|
+
value2 = value2 * 16 + ch - 65 + 10;
|
|
103201
|
+
} else if (ch >= 97 && ch <= 102) {
|
|
103202
|
+
value2 = value2 * 16 + ch - 97 + 10;
|
|
103203
|
+
} else {
|
|
103204
|
+
break;
|
|
103205
|
+
}
|
|
103206
|
+
pos++;
|
|
103207
|
+
digits++;
|
|
103208
|
+
}
|
|
103209
|
+
if (digits < count) {
|
|
103210
|
+
value2 = -1;
|
|
103211
|
+
}
|
|
103212
|
+
return value2;
|
|
103213
|
+
}
|
|
103214
|
+
function setPosition(newPosition) {
|
|
103215
|
+
pos = newPosition;
|
|
103216
|
+
value = "";
|
|
103217
|
+
tokenOffset = 0;
|
|
103218
|
+
token = 16;
|
|
103219
|
+
scanError = 0;
|
|
103220
|
+
}
|
|
103221
|
+
function scanNumber() {
|
|
103222
|
+
let start2 = pos;
|
|
103223
|
+
if (text4.charCodeAt(pos) === 48) {
|
|
103224
|
+
pos++;
|
|
103225
|
+
} else {
|
|
103226
|
+
pos++;
|
|
103227
|
+
while (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103228
|
+
pos++;
|
|
103229
|
+
}
|
|
103230
|
+
}
|
|
103231
|
+
if (pos < text4.length && text4.charCodeAt(pos) === 46) {
|
|
103232
|
+
pos++;
|
|
103233
|
+
if (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103234
|
+
pos++;
|
|
103235
|
+
while (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103236
|
+
pos++;
|
|
103237
|
+
}
|
|
103238
|
+
} else {
|
|
103239
|
+
scanError = 3;
|
|
103240
|
+
return text4.substring(start2, pos);
|
|
103241
|
+
}
|
|
103242
|
+
}
|
|
103243
|
+
let end = pos;
|
|
103244
|
+
if (pos < text4.length && (text4.charCodeAt(pos) === 69 || text4.charCodeAt(pos) === 101)) {
|
|
103245
|
+
pos++;
|
|
103246
|
+
if (pos < text4.length && text4.charCodeAt(pos) === 43 || text4.charCodeAt(pos) === 45) {
|
|
103247
|
+
pos++;
|
|
103248
|
+
}
|
|
103249
|
+
if (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103250
|
+
pos++;
|
|
103251
|
+
while (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103252
|
+
pos++;
|
|
103253
|
+
}
|
|
103254
|
+
end = pos;
|
|
103255
|
+
} else {
|
|
103256
|
+
scanError = 3;
|
|
103257
|
+
}
|
|
103258
|
+
}
|
|
103259
|
+
return text4.substring(start2, end);
|
|
103260
|
+
}
|
|
103261
|
+
function scanString() {
|
|
103262
|
+
let result = "", start2 = pos;
|
|
103263
|
+
while (true) {
|
|
103264
|
+
if (pos >= len) {
|
|
103265
|
+
result += text4.substring(start2, pos);
|
|
103266
|
+
scanError = 2;
|
|
103267
|
+
break;
|
|
103268
|
+
}
|
|
103269
|
+
const ch = text4.charCodeAt(pos);
|
|
103270
|
+
if (ch === 34) {
|
|
103271
|
+
result += text4.substring(start2, pos);
|
|
103272
|
+
pos++;
|
|
103273
|
+
break;
|
|
103274
|
+
}
|
|
103275
|
+
if (ch === 92) {
|
|
103276
|
+
result += text4.substring(start2, pos);
|
|
103277
|
+
pos++;
|
|
103278
|
+
if (pos >= len) {
|
|
103279
|
+
scanError = 2;
|
|
103280
|
+
break;
|
|
103281
|
+
}
|
|
103282
|
+
const ch2 = text4.charCodeAt(pos++);
|
|
103283
|
+
switch (ch2) {
|
|
103284
|
+
case 34:
|
|
103285
|
+
result += '"';
|
|
103286
|
+
break;
|
|
103287
|
+
case 92:
|
|
103288
|
+
result += "\\";
|
|
103289
|
+
break;
|
|
103290
|
+
case 47:
|
|
103291
|
+
result += "/";
|
|
103292
|
+
break;
|
|
103293
|
+
case 98:
|
|
103294
|
+
result += "\b";
|
|
103295
|
+
break;
|
|
103296
|
+
case 102:
|
|
103297
|
+
result += "\f";
|
|
103298
|
+
break;
|
|
103299
|
+
case 110:
|
|
103300
|
+
result += "\n";
|
|
103301
|
+
break;
|
|
103302
|
+
case 114:
|
|
103303
|
+
result += "\r";
|
|
103304
|
+
break;
|
|
103305
|
+
case 116:
|
|
103306
|
+
result += " ";
|
|
103307
|
+
break;
|
|
103308
|
+
case 117:
|
|
103309
|
+
const ch3 = scanHexDigits(4, true);
|
|
103310
|
+
if (ch3 >= 0) {
|
|
103311
|
+
result += String.fromCharCode(ch3);
|
|
103312
|
+
} else {
|
|
103313
|
+
scanError = 4;
|
|
103314
|
+
}
|
|
103315
|
+
break;
|
|
103316
|
+
default:
|
|
103317
|
+
scanError = 5;
|
|
103318
|
+
}
|
|
103319
|
+
start2 = pos;
|
|
103320
|
+
continue;
|
|
103321
|
+
}
|
|
103322
|
+
if (ch >= 0 && ch <= 31) {
|
|
103323
|
+
if (isLineBreak(ch)) {
|
|
103324
|
+
result += text4.substring(start2, pos);
|
|
103325
|
+
scanError = 2;
|
|
103326
|
+
break;
|
|
103327
|
+
} else {
|
|
103328
|
+
scanError = 6;
|
|
103329
|
+
}
|
|
103330
|
+
}
|
|
103331
|
+
pos++;
|
|
103332
|
+
}
|
|
103333
|
+
return result;
|
|
103334
|
+
}
|
|
103335
|
+
function scanNext() {
|
|
103336
|
+
value = "";
|
|
103337
|
+
scanError = 0;
|
|
103338
|
+
tokenOffset = pos;
|
|
103339
|
+
lineStartOffset = lineNumber;
|
|
103340
|
+
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
103341
|
+
if (pos >= len) {
|
|
103342
|
+
tokenOffset = len;
|
|
103343
|
+
return token = 17;
|
|
103344
|
+
}
|
|
103345
|
+
let code2 = text4.charCodeAt(pos);
|
|
103346
|
+
if (isWhiteSpace(code2)) {
|
|
103347
|
+
do {
|
|
103348
|
+
pos++;
|
|
103349
|
+
value += String.fromCharCode(code2);
|
|
103350
|
+
code2 = text4.charCodeAt(pos);
|
|
103351
|
+
} while (isWhiteSpace(code2));
|
|
103352
|
+
return token = 15;
|
|
103353
|
+
}
|
|
103354
|
+
if (isLineBreak(code2)) {
|
|
103355
|
+
pos++;
|
|
103356
|
+
value += String.fromCharCode(code2);
|
|
103357
|
+
if (code2 === 13 && text4.charCodeAt(pos) === 10) {
|
|
103358
|
+
pos++;
|
|
103359
|
+
value += "\n";
|
|
103360
|
+
}
|
|
103361
|
+
lineNumber++;
|
|
103362
|
+
tokenLineStartOffset = pos;
|
|
103363
|
+
return token = 14;
|
|
103364
|
+
}
|
|
103365
|
+
switch (code2) {
|
|
103366
|
+
// tokens: []{}:,
|
|
103367
|
+
case 123:
|
|
103368
|
+
pos++;
|
|
103369
|
+
return token = 1;
|
|
103370
|
+
case 125:
|
|
103371
|
+
pos++;
|
|
103372
|
+
return token = 2;
|
|
103373
|
+
case 91:
|
|
103374
|
+
pos++;
|
|
103375
|
+
return token = 3;
|
|
103376
|
+
case 93:
|
|
103377
|
+
pos++;
|
|
103378
|
+
return token = 4;
|
|
103379
|
+
case 58:
|
|
103380
|
+
pos++;
|
|
103381
|
+
return token = 6;
|
|
103382
|
+
case 44:
|
|
103383
|
+
pos++;
|
|
103384
|
+
return token = 5;
|
|
103385
|
+
// strings
|
|
103386
|
+
case 34:
|
|
103387
|
+
pos++;
|
|
103388
|
+
value = scanString();
|
|
103389
|
+
return token = 10;
|
|
103390
|
+
// comments
|
|
103391
|
+
case 47:
|
|
103392
|
+
const start2 = pos - 1;
|
|
103393
|
+
if (text4.charCodeAt(pos + 1) === 47) {
|
|
103394
|
+
pos += 2;
|
|
103395
|
+
while (pos < len) {
|
|
103396
|
+
if (isLineBreak(text4.charCodeAt(pos))) {
|
|
103397
|
+
break;
|
|
103398
|
+
}
|
|
103399
|
+
pos++;
|
|
103400
|
+
}
|
|
103401
|
+
value = text4.substring(start2, pos);
|
|
103402
|
+
return token = 12;
|
|
103403
|
+
}
|
|
103404
|
+
if (text4.charCodeAt(pos + 1) === 42) {
|
|
103405
|
+
pos += 2;
|
|
103406
|
+
const safeLength = len - 1;
|
|
103407
|
+
let commentClosed = false;
|
|
103408
|
+
while (pos < safeLength) {
|
|
103409
|
+
const ch = text4.charCodeAt(pos);
|
|
103410
|
+
if (ch === 42 && text4.charCodeAt(pos + 1) === 47) {
|
|
103411
|
+
pos += 2;
|
|
103412
|
+
commentClosed = true;
|
|
103413
|
+
break;
|
|
103414
|
+
}
|
|
103415
|
+
pos++;
|
|
103416
|
+
if (isLineBreak(ch)) {
|
|
103417
|
+
if (ch === 13 && text4.charCodeAt(pos) === 10) {
|
|
103418
|
+
pos++;
|
|
103419
|
+
}
|
|
103420
|
+
lineNumber++;
|
|
103421
|
+
tokenLineStartOffset = pos;
|
|
103422
|
+
}
|
|
103423
|
+
}
|
|
103424
|
+
if (!commentClosed) {
|
|
103425
|
+
pos++;
|
|
103426
|
+
scanError = 1;
|
|
103427
|
+
}
|
|
103428
|
+
value = text4.substring(start2, pos);
|
|
103429
|
+
return token = 13;
|
|
103430
|
+
}
|
|
103431
|
+
value += String.fromCharCode(code2);
|
|
103432
|
+
pos++;
|
|
103433
|
+
return token = 16;
|
|
103434
|
+
// numbers
|
|
103435
|
+
case 45:
|
|
103436
|
+
value += String.fromCharCode(code2);
|
|
103437
|
+
pos++;
|
|
103438
|
+
if (pos === len || !isDigit(text4.charCodeAt(pos))) {
|
|
103439
|
+
return token = 16;
|
|
103440
|
+
}
|
|
103441
|
+
// found a minus, followed by a number so
|
|
103442
|
+
// we fall through to proceed with scanning
|
|
103443
|
+
// numbers
|
|
103444
|
+
case 48:
|
|
103445
|
+
case 49:
|
|
103446
|
+
case 50:
|
|
103447
|
+
case 51:
|
|
103448
|
+
case 52:
|
|
103449
|
+
case 53:
|
|
103450
|
+
case 54:
|
|
103451
|
+
case 55:
|
|
103452
|
+
case 56:
|
|
103453
|
+
case 57:
|
|
103454
|
+
value += scanNumber();
|
|
103455
|
+
return token = 11;
|
|
103456
|
+
// literals and unknown symbols
|
|
103457
|
+
default:
|
|
103458
|
+
while (pos < len && isUnknownContentCharacter(code2)) {
|
|
103459
|
+
pos++;
|
|
103460
|
+
code2 = text4.charCodeAt(pos);
|
|
103461
|
+
}
|
|
103462
|
+
if (tokenOffset !== pos) {
|
|
103463
|
+
value = text4.substring(tokenOffset, pos);
|
|
103464
|
+
switch (value) {
|
|
103465
|
+
case "true":
|
|
103466
|
+
return token = 8;
|
|
103467
|
+
case "false":
|
|
103468
|
+
return token = 9;
|
|
103469
|
+
case "null":
|
|
103470
|
+
return token = 7;
|
|
103471
|
+
}
|
|
103472
|
+
return token = 16;
|
|
103473
|
+
}
|
|
103474
|
+
value += String.fromCharCode(code2);
|
|
103475
|
+
pos++;
|
|
103476
|
+
return token = 16;
|
|
103477
|
+
}
|
|
103478
|
+
}
|
|
103479
|
+
function isUnknownContentCharacter(code2) {
|
|
103480
|
+
if (isWhiteSpace(code2) || isLineBreak(code2)) {
|
|
103481
|
+
return false;
|
|
103482
|
+
}
|
|
103483
|
+
switch (code2) {
|
|
103484
|
+
case 125:
|
|
103485
|
+
case 93:
|
|
103486
|
+
case 123:
|
|
103487
|
+
case 91:
|
|
103488
|
+
case 34:
|
|
103489
|
+
case 58:
|
|
103490
|
+
case 44:
|
|
103491
|
+
case 47:
|
|
103492
|
+
return false;
|
|
103493
|
+
}
|
|
103494
|
+
return true;
|
|
103495
|
+
}
|
|
103496
|
+
function scanNextNonTrivia() {
|
|
103497
|
+
let result;
|
|
103498
|
+
do {
|
|
103499
|
+
result = scanNext();
|
|
103500
|
+
} while (result >= 12 && result <= 15);
|
|
103501
|
+
return result;
|
|
103502
|
+
}
|
|
103503
|
+
return {
|
|
103504
|
+
setPosition,
|
|
103505
|
+
getPosition: () => pos,
|
|
103506
|
+
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
103507
|
+
getToken: () => token,
|
|
103508
|
+
getTokenValue: () => value,
|
|
103509
|
+
getTokenOffset: () => tokenOffset,
|
|
103510
|
+
getTokenLength: () => pos - tokenOffset,
|
|
103511
|
+
getTokenStartLine: () => lineStartOffset,
|
|
103512
|
+
getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,
|
|
103513
|
+
getTokenError: () => scanError
|
|
103514
|
+
};
|
|
103515
|
+
}
|
|
103516
|
+
function isWhiteSpace(ch) {
|
|
103517
|
+
return ch === 32 || ch === 9;
|
|
103518
|
+
}
|
|
103519
|
+
function isLineBreak(ch) {
|
|
103520
|
+
return ch === 10 || ch === 13;
|
|
103521
|
+
}
|
|
103522
|
+
function isDigit(ch) {
|
|
103523
|
+
return ch >= 48 && ch <= 57;
|
|
103524
|
+
}
|
|
103525
|
+
var CharacterCodes;
|
|
103526
|
+
(function(CharacterCodes2) {
|
|
103527
|
+
CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
|
|
103528
|
+
CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
|
|
103529
|
+
CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
|
|
103530
|
+
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
103531
|
+
CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
|
|
103532
|
+
CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
|
|
103533
|
+
CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
|
|
103534
|
+
CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
|
|
103535
|
+
CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
|
|
103536
|
+
CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
|
|
103537
|
+
CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
|
|
103538
|
+
CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
|
|
103539
|
+
CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
|
|
103540
|
+
CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
|
|
103541
|
+
CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
|
|
103542
|
+
CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
|
|
103543
|
+
CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
|
|
103544
|
+
CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
|
|
103545
|
+
CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
|
|
103546
|
+
CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
|
|
103547
|
+
CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
|
|
103548
|
+
CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
|
|
103549
|
+
CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
|
|
103550
|
+
CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
|
|
103551
|
+
CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
|
|
103552
|
+
CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
|
|
103553
|
+
CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
|
|
103554
|
+
CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
|
|
103555
|
+
CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
|
|
103556
|
+
CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
|
|
103557
|
+
CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
|
|
103558
|
+
CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
|
|
103559
|
+
CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
|
|
103560
|
+
CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
|
|
103561
|
+
CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
|
|
103562
|
+
CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
|
|
103563
|
+
CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
|
|
103564
|
+
CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
|
|
103565
|
+
CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
|
|
103566
|
+
CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
|
|
103567
|
+
CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
|
|
103568
|
+
CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
|
|
103569
|
+
CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
|
|
103570
|
+
CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
|
|
103571
|
+
CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
|
|
103572
|
+
CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
|
|
103573
|
+
CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
|
|
103574
|
+
CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
|
|
103575
|
+
CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
|
|
103576
|
+
CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
|
|
103577
|
+
CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
|
|
103578
|
+
CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
|
|
103579
|
+
CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
|
|
103580
|
+
CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
|
|
103581
|
+
CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
|
|
103582
|
+
CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
|
|
103583
|
+
CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
|
|
103584
|
+
CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
|
|
103585
|
+
CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
|
|
103586
|
+
CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
|
|
103587
|
+
CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
|
|
103588
|
+
CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
|
|
103589
|
+
CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
|
|
103590
|
+
CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
|
|
103591
|
+
CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
|
|
103592
|
+
CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
|
|
103593
|
+
CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
|
|
103594
|
+
CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
|
|
103595
|
+
CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
|
|
103596
|
+
CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
|
|
103597
|
+
CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
|
|
103598
|
+
CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
|
|
103599
|
+
CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
|
|
103600
|
+
CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
|
|
103601
|
+
CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
|
|
103602
|
+
CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
|
|
103603
|
+
CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
|
|
103604
|
+
CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
|
|
103605
|
+
CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
|
|
103606
|
+
CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
|
|
103607
|
+
})(CharacterCodes || (CharacterCodes = {}));
|
|
103608
|
+
|
|
103609
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
103610
|
+
var cachedSpaces = new Array(20).fill(0).map((_3, index2) => {
|
|
103611
|
+
return " ".repeat(index2);
|
|
103612
|
+
});
|
|
103613
|
+
var maxCachedValues = 200;
|
|
103614
|
+
var cachedBreakLinesWithSpaces = {
|
|
103615
|
+
" ": {
|
|
103616
|
+
"\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103617
|
+
return "\n" + " ".repeat(index2);
|
|
103618
|
+
}),
|
|
103619
|
+
"\r": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103620
|
+
return "\r" + " ".repeat(index2);
|
|
103621
|
+
}),
|
|
103622
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103623
|
+
return "\r\n" + " ".repeat(index2);
|
|
103624
|
+
})
|
|
103625
|
+
},
|
|
103626
|
+
" ": {
|
|
103627
|
+
"\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103628
|
+
return "\n" + " ".repeat(index2);
|
|
103629
|
+
}),
|
|
103630
|
+
"\r": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103631
|
+
return "\r" + " ".repeat(index2);
|
|
103632
|
+
}),
|
|
103633
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103634
|
+
return "\r\n" + " ".repeat(index2);
|
|
103635
|
+
})
|
|
103636
|
+
}
|
|
103637
|
+
};
|
|
103638
|
+
var supportedEols = ["\n", "\r", "\r\n"];
|
|
103639
|
+
|
|
103640
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/format.js
|
|
103641
|
+
function format(documentText, range3, options2) {
|
|
103642
|
+
let initialIndentLevel;
|
|
103643
|
+
let formatText;
|
|
103644
|
+
let formatTextStart;
|
|
103645
|
+
let rangeStart;
|
|
103646
|
+
let rangeEnd;
|
|
103647
|
+
if (range3) {
|
|
103648
|
+
rangeStart = range3.offset;
|
|
103649
|
+
rangeEnd = rangeStart + range3.length;
|
|
103650
|
+
formatTextStart = rangeStart;
|
|
103651
|
+
while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {
|
|
103652
|
+
formatTextStart--;
|
|
103653
|
+
}
|
|
103654
|
+
let endOffset = rangeEnd;
|
|
103655
|
+
while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {
|
|
103656
|
+
endOffset++;
|
|
103657
|
+
}
|
|
103658
|
+
formatText = documentText.substring(formatTextStart, endOffset);
|
|
103659
|
+
initialIndentLevel = computeIndentLevel(formatText, options2);
|
|
103660
|
+
} else {
|
|
103661
|
+
formatText = documentText;
|
|
103662
|
+
initialIndentLevel = 0;
|
|
103663
|
+
formatTextStart = 0;
|
|
103664
|
+
rangeStart = 0;
|
|
103665
|
+
rangeEnd = documentText.length;
|
|
103666
|
+
}
|
|
103667
|
+
const eol = getEOL(options2, documentText);
|
|
103668
|
+
const eolFastPathSupported = supportedEols.includes(eol);
|
|
103669
|
+
let numberLineBreaks = 0;
|
|
103670
|
+
let indentLevel = 0;
|
|
103671
|
+
let indentValue;
|
|
103672
|
+
if (options2.insertSpaces) {
|
|
103673
|
+
indentValue = cachedSpaces[options2.tabSize || 4] ?? repeat(cachedSpaces[1], options2.tabSize || 4);
|
|
103674
|
+
} else {
|
|
103675
|
+
indentValue = " ";
|
|
103676
|
+
}
|
|
103677
|
+
const indentType = indentValue === " " ? " " : " ";
|
|
103678
|
+
let scanner = createScanner(formatText, false);
|
|
103679
|
+
let hasError = false;
|
|
103680
|
+
function newLinesAndIndent() {
|
|
103681
|
+
if (numberLineBreaks > 1) {
|
|
103682
|
+
return repeat(eol, numberLineBreaks) + repeat(indentValue, initialIndentLevel + indentLevel);
|
|
103683
|
+
}
|
|
103684
|
+
const amountOfSpaces = indentValue.length * (initialIndentLevel + indentLevel);
|
|
103685
|
+
if (!eolFastPathSupported || amountOfSpaces > cachedBreakLinesWithSpaces[indentType][eol].length) {
|
|
103686
|
+
return eol + repeat(indentValue, initialIndentLevel + indentLevel);
|
|
103687
|
+
}
|
|
103688
|
+
if (amountOfSpaces <= 0) {
|
|
103689
|
+
return eol;
|
|
103690
|
+
}
|
|
103691
|
+
return cachedBreakLinesWithSpaces[indentType][eol][amountOfSpaces];
|
|
103692
|
+
}
|
|
103693
|
+
function scanNext() {
|
|
103694
|
+
let token = scanner.scan();
|
|
103695
|
+
numberLineBreaks = 0;
|
|
103696
|
+
while (token === 15 || token === 14) {
|
|
103697
|
+
if (token === 14 && options2.keepLines) {
|
|
103698
|
+
numberLineBreaks += 1;
|
|
103699
|
+
} else if (token === 14) {
|
|
103700
|
+
numberLineBreaks = 1;
|
|
103701
|
+
}
|
|
103702
|
+
token = scanner.scan();
|
|
103703
|
+
}
|
|
103704
|
+
hasError = token === 16 || scanner.getTokenError() !== 0;
|
|
103705
|
+
return token;
|
|
103706
|
+
}
|
|
103707
|
+
const editOperations = [];
|
|
103708
|
+
function addEdit(text4, startOffset, endOffset) {
|
|
103709
|
+
if (!hasError && (!range3 || startOffset < rangeEnd && endOffset > rangeStart) && documentText.substring(startOffset, endOffset) !== text4) {
|
|
103710
|
+
editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text4 });
|
|
103711
|
+
}
|
|
103712
|
+
}
|
|
103713
|
+
let firstToken = scanNext();
|
|
103714
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103715
|
+
addEdit(repeat(eol, numberLineBreaks), 0, 0);
|
|
103716
|
+
}
|
|
103717
|
+
if (firstToken !== 17) {
|
|
103718
|
+
let firstTokenStart = scanner.getTokenOffset() + formatTextStart;
|
|
103719
|
+
let initialIndent = indentValue.length * initialIndentLevel < 20 && options2.insertSpaces ? cachedSpaces[indentValue.length * initialIndentLevel] : repeat(indentValue, initialIndentLevel);
|
|
103720
|
+
addEdit(initialIndent, formatTextStart, firstTokenStart);
|
|
103721
|
+
}
|
|
103722
|
+
while (firstToken !== 17) {
|
|
103723
|
+
let firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
|
|
103724
|
+
let secondToken = scanNext();
|
|
103725
|
+
let replaceContent = "";
|
|
103726
|
+
let needsLineBreak = false;
|
|
103727
|
+
while (numberLineBreaks === 0 && (secondToken === 12 || secondToken === 13)) {
|
|
103728
|
+
let commentTokenStart = scanner.getTokenOffset() + formatTextStart;
|
|
103729
|
+
addEdit(cachedSpaces[1], firstTokenEnd, commentTokenStart);
|
|
103730
|
+
firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
|
|
103731
|
+
needsLineBreak = secondToken === 12;
|
|
103732
|
+
replaceContent = needsLineBreak ? newLinesAndIndent() : "";
|
|
103733
|
+
secondToken = scanNext();
|
|
103734
|
+
}
|
|
103735
|
+
if (secondToken === 2) {
|
|
103736
|
+
if (firstToken !== 1) {
|
|
103737
|
+
indentLevel--;
|
|
103738
|
+
}
|
|
103739
|
+
;
|
|
103740
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines && firstToken !== 1) {
|
|
103741
|
+
replaceContent = newLinesAndIndent();
|
|
103742
|
+
} else if (options2.keepLines) {
|
|
103743
|
+
replaceContent = cachedSpaces[1];
|
|
103744
|
+
}
|
|
103745
|
+
} else if (secondToken === 4) {
|
|
103746
|
+
if (firstToken !== 3) {
|
|
103747
|
+
indentLevel--;
|
|
103748
|
+
}
|
|
103749
|
+
;
|
|
103750
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines && firstToken !== 3) {
|
|
103751
|
+
replaceContent = newLinesAndIndent();
|
|
103752
|
+
} else if (options2.keepLines) {
|
|
103753
|
+
replaceContent = cachedSpaces[1];
|
|
103754
|
+
}
|
|
103755
|
+
} else {
|
|
103756
|
+
switch (firstToken) {
|
|
103757
|
+
case 3:
|
|
103758
|
+
case 1:
|
|
103759
|
+
indentLevel++;
|
|
103760
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines) {
|
|
103761
|
+
replaceContent = newLinesAndIndent();
|
|
103762
|
+
} else {
|
|
103763
|
+
replaceContent = cachedSpaces[1];
|
|
103764
|
+
}
|
|
103765
|
+
break;
|
|
103766
|
+
case 5:
|
|
103767
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines) {
|
|
103768
|
+
replaceContent = newLinesAndIndent();
|
|
103769
|
+
} else {
|
|
103770
|
+
replaceContent = cachedSpaces[1];
|
|
103771
|
+
}
|
|
103772
|
+
break;
|
|
103773
|
+
case 12:
|
|
103774
|
+
replaceContent = newLinesAndIndent();
|
|
103775
|
+
break;
|
|
103776
|
+
case 13:
|
|
103777
|
+
if (numberLineBreaks > 0) {
|
|
103778
|
+
replaceContent = newLinesAndIndent();
|
|
103779
|
+
} else if (!needsLineBreak) {
|
|
103780
|
+
replaceContent = cachedSpaces[1];
|
|
103781
|
+
}
|
|
103782
|
+
break;
|
|
103783
|
+
case 6:
|
|
103784
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103785
|
+
replaceContent = newLinesAndIndent();
|
|
103786
|
+
} else if (!needsLineBreak) {
|
|
103787
|
+
replaceContent = cachedSpaces[1];
|
|
103788
|
+
}
|
|
103789
|
+
break;
|
|
103790
|
+
case 10:
|
|
103791
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103792
|
+
replaceContent = newLinesAndIndent();
|
|
103793
|
+
} else if (secondToken === 6 && !needsLineBreak) {
|
|
103794
|
+
replaceContent = "";
|
|
103795
|
+
}
|
|
103796
|
+
break;
|
|
103797
|
+
case 7:
|
|
103798
|
+
case 8:
|
|
103799
|
+
case 9:
|
|
103800
|
+
case 11:
|
|
103801
|
+
case 2:
|
|
103802
|
+
case 4:
|
|
103803
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103804
|
+
replaceContent = newLinesAndIndent();
|
|
103805
|
+
} else {
|
|
103806
|
+
if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) {
|
|
103807
|
+
replaceContent = cachedSpaces[1];
|
|
103808
|
+
} else if (secondToken !== 5 && secondToken !== 17) {
|
|
103809
|
+
hasError = true;
|
|
103810
|
+
}
|
|
103811
|
+
}
|
|
103812
|
+
break;
|
|
103813
|
+
case 16:
|
|
103814
|
+
hasError = true;
|
|
103815
|
+
break;
|
|
103816
|
+
}
|
|
103817
|
+
if (numberLineBreaks > 0 && (secondToken === 12 || secondToken === 13)) {
|
|
103818
|
+
replaceContent = newLinesAndIndent();
|
|
103819
|
+
}
|
|
103820
|
+
}
|
|
103821
|
+
if (secondToken === 17) {
|
|
103822
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103823
|
+
replaceContent = newLinesAndIndent();
|
|
103824
|
+
} else {
|
|
103825
|
+
replaceContent = options2.insertFinalNewline ? eol : "";
|
|
103826
|
+
}
|
|
103827
|
+
}
|
|
103828
|
+
const secondTokenStart = scanner.getTokenOffset() + formatTextStart;
|
|
103829
|
+
addEdit(replaceContent, firstTokenEnd, secondTokenStart);
|
|
103830
|
+
firstToken = secondToken;
|
|
103831
|
+
}
|
|
103832
|
+
return editOperations;
|
|
103833
|
+
}
|
|
103834
|
+
function repeat(s7, count) {
|
|
103835
|
+
let result = "";
|
|
103836
|
+
for (let i10 = 0; i10 < count; i10++) {
|
|
103837
|
+
result += s7;
|
|
103838
|
+
}
|
|
103839
|
+
return result;
|
|
103840
|
+
}
|
|
103841
|
+
function computeIndentLevel(content3, options2) {
|
|
103842
|
+
let i10 = 0;
|
|
103843
|
+
let nChars = 0;
|
|
103844
|
+
const tabSize = options2.tabSize || 4;
|
|
103845
|
+
while (i10 < content3.length) {
|
|
103846
|
+
let ch = content3.charAt(i10);
|
|
103847
|
+
if (ch === cachedSpaces[1]) {
|
|
103848
|
+
nChars++;
|
|
103849
|
+
} else if (ch === " ") {
|
|
103850
|
+
nChars += tabSize;
|
|
103851
|
+
} else {
|
|
103852
|
+
break;
|
|
103853
|
+
}
|
|
103854
|
+
i10++;
|
|
103855
|
+
}
|
|
103856
|
+
return Math.floor(nChars / tabSize);
|
|
103857
|
+
}
|
|
103858
|
+
function getEOL(options2, text4) {
|
|
103859
|
+
for (let i10 = 0; i10 < text4.length; i10++) {
|
|
103860
|
+
const ch = text4.charAt(i10);
|
|
103861
|
+
if (ch === "\r") {
|
|
103862
|
+
if (i10 + 1 < text4.length && text4.charAt(i10 + 1) === "\n") {
|
|
103863
|
+
return "\r\n";
|
|
103864
|
+
}
|
|
103865
|
+
return "\r";
|
|
103866
|
+
} else if (ch === "\n") {
|
|
103867
|
+
return "\n";
|
|
103868
|
+
}
|
|
103869
|
+
}
|
|
103870
|
+
return options2 && options2.eol || "\n";
|
|
103871
|
+
}
|
|
103872
|
+
function isEOL(text4, offset2) {
|
|
103873
|
+
return "\r\n".indexOf(text4.charAt(offset2)) !== -1;
|
|
103874
|
+
}
|
|
103875
|
+
|
|
103876
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
103877
|
+
var ParseOptions;
|
|
103878
|
+
(function(ParseOptions2) {
|
|
103879
|
+
ParseOptions2.DEFAULT = {
|
|
103880
|
+
allowTrailingComma: false
|
|
103881
|
+
};
|
|
103882
|
+
})(ParseOptions || (ParseOptions = {}));
|
|
103883
|
+
function parseTree(text4, errors = [], options2 = ParseOptions.DEFAULT) {
|
|
103884
|
+
let currentParent = { type: "array", offset: -1, length: -1, children: [], parent: void 0 };
|
|
103885
|
+
function ensurePropertyComplete(endOffset) {
|
|
103886
|
+
if (currentParent.type === "property") {
|
|
103887
|
+
currentParent.length = endOffset - currentParent.offset;
|
|
103888
|
+
currentParent = currentParent.parent;
|
|
103889
|
+
}
|
|
103890
|
+
}
|
|
103891
|
+
function onValue(valueNode) {
|
|
103892
|
+
currentParent.children.push(valueNode);
|
|
103893
|
+
return valueNode;
|
|
103894
|
+
}
|
|
103895
|
+
const visitor = {
|
|
103896
|
+
onObjectBegin: (offset2) => {
|
|
103897
|
+
currentParent = onValue({ type: "object", offset: offset2, length: -1, parent: currentParent, children: [] });
|
|
103898
|
+
},
|
|
103899
|
+
onObjectProperty: (name3, offset2, length) => {
|
|
103900
|
+
currentParent = onValue({ type: "property", offset: offset2, length: -1, parent: currentParent, children: [] });
|
|
103901
|
+
currentParent.children.push({ type: "string", value: name3, offset: offset2, length, parent: currentParent });
|
|
103902
|
+
},
|
|
103903
|
+
onObjectEnd: (offset2, length) => {
|
|
103904
|
+
ensurePropertyComplete(offset2 + length);
|
|
103905
|
+
currentParent.length = offset2 + length - currentParent.offset;
|
|
103906
|
+
currentParent = currentParent.parent;
|
|
103907
|
+
ensurePropertyComplete(offset2 + length);
|
|
103908
|
+
},
|
|
103909
|
+
onArrayBegin: (offset2, length) => {
|
|
103910
|
+
currentParent = onValue({ type: "array", offset: offset2, length: -1, parent: currentParent, children: [] });
|
|
103911
|
+
},
|
|
103912
|
+
onArrayEnd: (offset2, length) => {
|
|
103913
|
+
currentParent.length = offset2 + length - currentParent.offset;
|
|
103914
|
+
currentParent = currentParent.parent;
|
|
103915
|
+
ensurePropertyComplete(offset2 + length);
|
|
103916
|
+
},
|
|
103917
|
+
onLiteralValue: (value, offset2, length) => {
|
|
103918
|
+
onValue({ type: getNodeType(value), offset: offset2, length, parent: currentParent, value });
|
|
103919
|
+
ensurePropertyComplete(offset2 + length);
|
|
103920
|
+
},
|
|
103921
|
+
onSeparator: (sep2, offset2, length) => {
|
|
103922
|
+
if (currentParent.type === "property") {
|
|
103923
|
+
if (sep2 === ":") {
|
|
103924
|
+
currentParent.colonOffset = offset2;
|
|
103925
|
+
} else if (sep2 === ",") {
|
|
103926
|
+
ensurePropertyComplete(offset2);
|
|
103927
|
+
}
|
|
103928
|
+
}
|
|
103929
|
+
},
|
|
103930
|
+
onError: (error3, offset2, length) => {
|
|
103931
|
+
errors.push({ error: error3, offset: offset2, length });
|
|
103932
|
+
}
|
|
103933
|
+
};
|
|
103934
|
+
visit(text4, visitor, options2);
|
|
103935
|
+
const result = currentParent.children[0];
|
|
103936
|
+
if (result) {
|
|
103937
|
+
delete result.parent;
|
|
103938
|
+
}
|
|
103939
|
+
return result;
|
|
103940
|
+
}
|
|
103941
|
+
function findNodeAtLocation(root5, path44) {
|
|
103942
|
+
if (!root5) {
|
|
103943
|
+
return void 0;
|
|
103944
|
+
}
|
|
103945
|
+
let node2 = root5;
|
|
103946
|
+
for (let segment of path44) {
|
|
103947
|
+
if (typeof segment === "string") {
|
|
103948
|
+
if (node2.type !== "object" || !Array.isArray(node2.children)) {
|
|
103949
|
+
return void 0;
|
|
103950
|
+
}
|
|
103951
|
+
let found = false;
|
|
103952
|
+
for (const propertyNode of node2.children) {
|
|
103953
|
+
if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment && propertyNode.children.length === 2) {
|
|
103954
|
+
node2 = propertyNode.children[1];
|
|
103955
|
+
found = true;
|
|
103956
|
+
break;
|
|
103957
|
+
}
|
|
103958
|
+
}
|
|
103959
|
+
if (!found) {
|
|
103960
|
+
return void 0;
|
|
103961
|
+
}
|
|
103962
|
+
} else {
|
|
103963
|
+
const index2 = segment;
|
|
103964
|
+
if (node2.type !== "array" || index2 < 0 || !Array.isArray(node2.children) || index2 >= node2.children.length) {
|
|
103965
|
+
return void 0;
|
|
103966
|
+
}
|
|
103967
|
+
node2 = node2.children[index2];
|
|
103968
|
+
}
|
|
103969
|
+
}
|
|
103970
|
+
return node2;
|
|
103971
|
+
}
|
|
103972
|
+
function visit(text4, visitor, options2 = ParseOptions.DEFAULT) {
|
|
103973
|
+
const _scanner = createScanner(text4, false);
|
|
103974
|
+
const _jsonPath = [];
|
|
103975
|
+
let suppressedCallbacks = 0;
|
|
103976
|
+
function toNoArgVisit(visitFunction) {
|
|
103977
|
+
return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
103978
|
+
}
|
|
103979
|
+
function toOneArgVisit(visitFunction) {
|
|
103980
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
103981
|
+
}
|
|
103982
|
+
function toOneArgVisitWithPath(visitFunction) {
|
|
103983
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
103984
|
+
}
|
|
103985
|
+
function toBeginVisit(visitFunction) {
|
|
103986
|
+
return visitFunction ? () => {
|
|
103987
|
+
if (suppressedCallbacks > 0) {
|
|
103988
|
+
suppressedCallbacks++;
|
|
103989
|
+
} else {
|
|
103990
|
+
let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());
|
|
103991
|
+
if (cbReturn === false) {
|
|
103992
|
+
suppressedCallbacks = 1;
|
|
103993
|
+
}
|
|
103994
|
+
}
|
|
103995
|
+
} : () => true;
|
|
103996
|
+
}
|
|
103997
|
+
function toEndVisit(visitFunction) {
|
|
103998
|
+
return visitFunction ? () => {
|
|
103999
|
+
if (suppressedCallbacks > 0) {
|
|
104000
|
+
suppressedCallbacks--;
|
|
104001
|
+
}
|
|
104002
|
+
if (suppressedCallbacks === 0) {
|
|
104003
|
+
visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
|
|
104004
|
+
}
|
|
104005
|
+
} : () => true;
|
|
104006
|
+
}
|
|
104007
|
+
const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError2 = toOneArgVisit(visitor.onError);
|
|
104008
|
+
const disallowComments = options2 && options2.disallowComments;
|
|
104009
|
+
const allowTrailingComma = options2 && options2.allowTrailingComma;
|
|
104010
|
+
function scanNext() {
|
|
104011
|
+
while (true) {
|
|
104012
|
+
const token = _scanner.scan();
|
|
104013
|
+
switch (_scanner.getTokenError()) {
|
|
104014
|
+
case 4:
|
|
104015
|
+
handleError(
|
|
104016
|
+
14
|
|
104017
|
+
/* ParseErrorCode.InvalidUnicode */
|
|
104018
|
+
);
|
|
104019
|
+
break;
|
|
104020
|
+
case 5:
|
|
104021
|
+
handleError(
|
|
104022
|
+
15
|
|
104023
|
+
/* ParseErrorCode.InvalidEscapeCharacter */
|
|
104024
|
+
);
|
|
104025
|
+
break;
|
|
104026
|
+
case 3:
|
|
104027
|
+
handleError(
|
|
104028
|
+
13
|
|
104029
|
+
/* ParseErrorCode.UnexpectedEndOfNumber */
|
|
104030
|
+
);
|
|
104031
|
+
break;
|
|
104032
|
+
case 1:
|
|
104033
|
+
if (!disallowComments) {
|
|
104034
|
+
handleError(
|
|
104035
|
+
11
|
|
104036
|
+
/* ParseErrorCode.UnexpectedEndOfComment */
|
|
104037
|
+
);
|
|
104038
|
+
}
|
|
104039
|
+
break;
|
|
104040
|
+
case 2:
|
|
104041
|
+
handleError(
|
|
104042
|
+
12
|
|
104043
|
+
/* ParseErrorCode.UnexpectedEndOfString */
|
|
104044
|
+
);
|
|
104045
|
+
break;
|
|
104046
|
+
case 6:
|
|
104047
|
+
handleError(
|
|
104048
|
+
16
|
|
104049
|
+
/* ParseErrorCode.InvalidCharacter */
|
|
104050
|
+
);
|
|
104051
|
+
break;
|
|
104052
|
+
}
|
|
104053
|
+
switch (token) {
|
|
104054
|
+
case 12:
|
|
104055
|
+
case 13:
|
|
104056
|
+
if (disallowComments) {
|
|
104057
|
+
handleError(
|
|
104058
|
+
10
|
|
104059
|
+
/* ParseErrorCode.InvalidCommentToken */
|
|
104060
|
+
);
|
|
104061
|
+
} else {
|
|
104062
|
+
onComment();
|
|
104063
|
+
}
|
|
104064
|
+
break;
|
|
104065
|
+
case 16:
|
|
104066
|
+
handleError(
|
|
104067
|
+
1
|
|
104068
|
+
/* ParseErrorCode.InvalidSymbol */
|
|
104069
|
+
);
|
|
104070
|
+
break;
|
|
104071
|
+
case 15:
|
|
104072
|
+
case 14:
|
|
104073
|
+
break;
|
|
104074
|
+
default:
|
|
104075
|
+
return token;
|
|
104076
|
+
}
|
|
104077
|
+
}
|
|
104078
|
+
}
|
|
104079
|
+
function handleError(error3, skipUntilAfter = [], skipUntil = []) {
|
|
104080
|
+
onError2(error3);
|
|
104081
|
+
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
104082
|
+
let token = _scanner.getToken();
|
|
104083
|
+
while (token !== 17) {
|
|
104084
|
+
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
104085
|
+
scanNext();
|
|
104086
|
+
break;
|
|
104087
|
+
} else if (skipUntil.indexOf(token) !== -1) {
|
|
104088
|
+
break;
|
|
104089
|
+
}
|
|
104090
|
+
token = scanNext();
|
|
104091
|
+
}
|
|
104092
|
+
}
|
|
104093
|
+
}
|
|
104094
|
+
function parseString(isValue) {
|
|
104095
|
+
const value = _scanner.getTokenValue();
|
|
104096
|
+
if (isValue) {
|
|
104097
|
+
onLiteralValue(value);
|
|
104098
|
+
} else {
|
|
104099
|
+
onObjectProperty(value);
|
|
104100
|
+
_jsonPath.push(value);
|
|
104101
|
+
}
|
|
104102
|
+
scanNext();
|
|
104103
|
+
return true;
|
|
104104
|
+
}
|
|
104105
|
+
function parseLiteral() {
|
|
104106
|
+
switch (_scanner.getToken()) {
|
|
104107
|
+
case 11:
|
|
104108
|
+
const tokenValue = _scanner.getTokenValue();
|
|
104109
|
+
let value = Number(tokenValue);
|
|
104110
|
+
if (isNaN(value)) {
|
|
104111
|
+
handleError(
|
|
104112
|
+
2
|
|
104113
|
+
/* ParseErrorCode.InvalidNumberFormat */
|
|
104114
|
+
);
|
|
104115
|
+
value = 0;
|
|
104116
|
+
}
|
|
104117
|
+
onLiteralValue(value);
|
|
104118
|
+
break;
|
|
104119
|
+
case 7:
|
|
104120
|
+
onLiteralValue(null);
|
|
104121
|
+
break;
|
|
104122
|
+
case 8:
|
|
104123
|
+
onLiteralValue(true);
|
|
104124
|
+
break;
|
|
104125
|
+
case 9:
|
|
104126
|
+
onLiteralValue(false);
|
|
104127
|
+
break;
|
|
104128
|
+
default:
|
|
104129
|
+
return false;
|
|
104130
|
+
}
|
|
104131
|
+
scanNext();
|
|
104132
|
+
return true;
|
|
104133
|
+
}
|
|
104134
|
+
function parseProperty() {
|
|
104135
|
+
if (_scanner.getToken() !== 10) {
|
|
104136
|
+
handleError(3, [], [
|
|
104137
|
+
2,
|
|
104138
|
+
5
|
|
104139
|
+
/* SyntaxKind.CommaToken */
|
|
104140
|
+
]);
|
|
104141
|
+
return false;
|
|
104142
|
+
}
|
|
104143
|
+
parseString(false);
|
|
104144
|
+
if (_scanner.getToken() === 6) {
|
|
104145
|
+
onSeparator(":");
|
|
104146
|
+
scanNext();
|
|
104147
|
+
if (!parseValue()) {
|
|
104148
|
+
handleError(4, [], [
|
|
104149
|
+
2,
|
|
104150
|
+
5
|
|
104151
|
+
/* SyntaxKind.CommaToken */
|
|
104152
|
+
]);
|
|
104153
|
+
}
|
|
104154
|
+
} else {
|
|
104155
|
+
handleError(5, [], [
|
|
104156
|
+
2,
|
|
104157
|
+
5
|
|
104158
|
+
/* SyntaxKind.CommaToken */
|
|
104159
|
+
]);
|
|
104160
|
+
}
|
|
104161
|
+
_jsonPath.pop();
|
|
104162
|
+
return true;
|
|
104163
|
+
}
|
|
104164
|
+
function parseObject() {
|
|
104165
|
+
onObjectBegin();
|
|
104166
|
+
scanNext();
|
|
104167
|
+
let needsComma = false;
|
|
104168
|
+
while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
|
|
104169
|
+
if (_scanner.getToken() === 5) {
|
|
104170
|
+
if (!needsComma) {
|
|
104171
|
+
handleError(4, [], []);
|
|
104172
|
+
}
|
|
104173
|
+
onSeparator(",");
|
|
104174
|
+
scanNext();
|
|
104175
|
+
if (_scanner.getToken() === 2 && allowTrailingComma) {
|
|
104176
|
+
break;
|
|
104177
|
+
}
|
|
104178
|
+
} else if (needsComma) {
|
|
104179
|
+
handleError(6, [], []);
|
|
104180
|
+
}
|
|
104181
|
+
if (!parseProperty()) {
|
|
104182
|
+
handleError(4, [], [
|
|
104183
|
+
2,
|
|
104184
|
+
5
|
|
104185
|
+
/* SyntaxKind.CommaToken */
|
|
104186
|
+
]);
|
|
104187
|
+
}
|
|
104188
|
+
needsComma = true;
|
|
104189
|
+
}
|
|
104190
|
+
onObjectEnd();
|
|
104191
|
+
if (_scanner.getToken() !== 2) {
|
|
104192
|
+
handleError(7, [
|
|
104193
|
+
2
|
|
104194
|
+
/* SyntaxKind.CloseBraceToken */
|
|
104195
|
+
], []);
|
|
104196
|
+
} else {
|
|
104197
|
+
scanNext();
|
|
104198
|
+
}
|
|
104199
|
+
return true;
|
|
104200
|
+
}
|
|
104201
|
+
function parseArray() {
|
|
104202
|
+
onArrayBegin();
|
|
104203
|
+
scanNext();
|
|
104204
|
+
let isFirstElement = true;
|
|
104205
|
+
let needsComma = false;
|
|
104206
|
+
while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
|
|
104207
|
+
if (_scanner.getToken() === 5) {
|
|
104208
|
+
if (!needsComma) {
|
|
104209
|
+
handleError(4, [], []);
|
|
104210
|
+
}
|
|
104211
|
+
onSeparator(",");
|
|
104212
|
+
scanNext();
|
|
104213
|
+
if (_scanner.getToken() === 4 && allowTrailingComma) {
|
|
104214
|
+
break;
|
|
104215
|
+
}
|
|
104216
|
+
} else if (needsComma) {
|
|
104217
|
+
handleError(6, [], []);
|
|
104218
|
+
}
|
|
104219
|
+
if (isFirstElement) {
|
|
104220
|
+
_jsonPath.push(0);
|
|
104221
|
+
isFirstElement = false;
|
|
104222
|
+
} else {
|
|
104223
|
+
_jsonPath[_jsonPath.length - 1]++;
|
|
104224
|
+
}
|
|
104225
|
+
if (!parseValue()) {
|
|
104226
|
+
handleError(4, [], [
|
|
104227
|
+
4,
|
|
104228
|
+
5
|
|
104229
|
+
/* SyntaxKind.CommaToken */
|
|
104230
|
+
]);
|
|
104231
|
+
}
|
|
104232
|
+
needsComma = true;
|
|
104233
|
+
}
|
|
104234
|
+
onArrayEnd();
|
|
104235
|
+
if (!isFirstElement) {
|
|
104236
|
+
_jsonPath.pop();
|
|
104237
|
+
}
|
|
104238
|
+
if (_scanner.getToken() !== 4) {
|
|
104239
|
+
handleError(8, [
|
|
104240
|
+
4
|
|
104241
|
+
/* SyntaxKind.CloseBracketToken */
|
|
104242
|
+
], []);
|
|
104243
|
+
} else {
|
|
104244
|
+
scanNext();
|
|
104245
|
+
}
|
|
104246
|
+
return true;
|
|
104247
|
+
}
|
|
104248
|
+
function parseValue() {
|
|
104249
|
+
switch (_scanner.getToken()) {
|
|
104250
|
+
case 3:
|
|
104251
|
+
return parseArray();
|
|
104252
|
+
case 1:
|
|
104253
|
+
return parseObject();
|
|
104254
|
+
case 10:
|
|
104255
|
+
return parseString(true);
|
|
104256
|
+
default:
|
|
104257
|
+
return parseLiteral();
|
|
104258
|
+
}
|
|
104259
|
+
}
|
|
104260
|
+
scanNext();
|
|
104261
|
+
if (_scanner.getToken() === 17) {
|
|
104262
|
+
if (options2.allowEmptyContent) {
|
|
104263
|
+
return true;
|
|
104264
|
+
}
|
|
104265
|
+
handleError(4, [], []);
|
|
104266
|
+
return false;
|
|
104267
|
+
}
|
|
104268
|
+
if (!parseValue()) {
|
|
104269
|
+
handleError(4, [], []);
|
|
104270
|
+
return false;
|
|
104271
|
+
}
|
|
104272
|
+
if (_scanner.getToken() !== 17) {
|
|
104273
|
+
handleError(9, [], []);
|
|
104274
|
+
}
|
|
104275
|
+
return true;
|
|
104276
|
+
}
|
|
104277
|
+
function getNodeType(value) {
|
|
104278
|
+
switch (typeof value) {
|
|
104279
|
+
case "boolean":
|
|
104280
|
+
return "boolean";
|
|
104281
|
+
case "number":
|
|
104282
|
+
return "number";
|
|
104283
|
+
case "string":
|
|
104284
|
+
return "string";
|
|
104285
|
+
case "object": {
|
|
104286
|
+
if (!value) {
|
|
104287
|
+
return "null";
|
|
104288
|
+
} else if (Array.isArray(value)) {
|
|
104289
|
+
return "array";
|
|
104290
|
+
}
|
|
104291
|
+
return "object";
|
|
104292
|
+
}
|
|
104293
|
+
default:
|
|
104294
|
+
return "null";
|
|
104295
|
+
}
|
|
104296
|
+
}
|
|
104297
|
+
|
|
104298
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
104299
|
+
function setProperty(text4, originalPath, value, options2) {
|
|
104300
|
+
const path44 = originalPath.slice();
|
|
104301
|
+
const errors = [];
|
|
104302
|
+
const root5 = parseTree(text4, errors);
|
|
104303
|
+
let parent = void 0;
|
|
104304
|
+
let lastSegment = void 0;
|
|
104305
|
+
while (path44.length > 0) {
|
|
104306
|
+
lastSegment = path44.pop();
|
|
104307
|
+
parent = findNodeAtLocation(root5, path44);
|
|
104308
|
+
if (parent === void 0 && value !== void 0) {
|
|
104309
|
+
if (typeof lastSegment === "string") {
|
|
104310
|
+
value = { [lastSegment]: value };
|
|
104311
|
+
} else {
|
|
104312
|
+
value = [value];
|
|
104313
|
+
}
|
|
104314
|
+
} else {
|
|
104315
|
+
break;
|
|
104316
|
+
}
|
|
104317
|
+
}
|
|
104318
|
+
if (!parent) {
|
|
104319
|
+
if (value === void 0) {
|
|
104320
|
+
throw new Error("Can not delete in empty document");
|
|
104321
|
+
}
|
|
104322
|
+
return withFormatting(text4, { offset: root5 ? root5.offset : 0, length: root5 ? root5.length : 0, content: JSON.stringify(value) }, options2);
|
|
104323
|
+
} else if (parent.type === "object" && typeof lastSegment === "string" && Array.isArray(parent.children)) {
|
|
104324
|
+
const existing = findNodeAtLocation(parent, [lastSegment]);
|
|
104325
|
+
if (existing !== void 0) {
|
|
104326
|
+
if (value === void 0) {
|
|
104327
|
+
if (!existing.parent) {
|
|
104328
|
+
throw new Error("Malformed AST");
|
|
104329
|
+
}
|
|
104330
|
+
const propertyIndex = parent.children.indexOf(existing.parent);
|
|
104331
|
+
let removeBegin;
|
|
104332
|
+
let removeEnd = existing.parent.offset + existing.parent.length;
|
|
104333
|
+
if (propertyIndex > 0) {
|
|
104334
|
+
let previous3 = parent.children[propertyIndex - 1];
|
|
104335
|
+
removeBegin = previous3.offset + previous3.length;
|
|
104336
|
+
} else {
|
|
104337
|
+
removeBegin = parent.offset + 1;
|
|
104338
|
+
if (parent.children.length > 1) {
|
|
104339
|
+
let next = parent.children[1];
|
|
104340
|
+
removeEnd = next.offset;
|
|
104341
|
+
}
|
|
104342
|
+
}
|
|
104343
|
+
return withFormatting(text4, { offset: removeBegin, length: removeEnd - removeBegin, content: "" }, options2);
|
|
104344
|
+
} else {
|
|
104345
|
+
return withFormatting(text4, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options2);
|
|
104346
|
+
}
|
|
104347
|
+
} else {
|
|
104348
|
+
if (value === void 0) {
|
|
104349
|
+
return [];
|
|
104350
|
+
}
|
|
104351
|
+
const newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;
|
|
104352
|
+
const index2 = options2.getInsertionIndex ? options2.getInsertionIndex(parent.children.map((p8) => p8.children[0].value)) : parent.children.length;
|
|
104353
|
+
let edit;
|
|
104354
|
+
if (index2 > 0) {
|
|
104355
|
+
let previous3 = parent.children[index2 - 1];
|
|
104356
|
+
edit = { offset: previous3.offset + previous3.length, length: 0, content: "," + newProperty };
|
|
104357
|
+
} else if (parent.children.length === 0) {
|
|
104358
|
+
edit = { offset: parent.offset + 1, length: 0, content: newProperty };
|
|
104359
|
+
} else {
|
|
104360
|
+
edit = { offset: parent.offset + 1, length: 0, content: newProperty + "," };
|
|
104361
|
+
}
|
|
104362
|
+
return withFormatting(text4, edit, options2);
|
|
104363
|
+
}
|
|
104364
|
+
} else if (parent.type === "array" && typeof lastSegment === "number" && Array.isArray(parent.children)) {
|
|
104365
|
+
const insertIndex = lastSegment;
|
|
104366
|
+
if (insertIndex === -1) {
|
|
104367
|
+
const newProperty = `${JSON.stringify(value)}`;
|
|
104368
|
+
let edit;
|
|
104369
|
+
if (parent.children.length === 0) {
|
|
104370
|
+
edit = { offset: parent.offset + 1, length: 0, content: newProperty };
|
|
104371
|
+
} else {
|
|
104372
|
+
const previous3 = parent.children[parent.children.length - 1];
|
|
104373
|
+
edit = { offset: previous3.offset + previous3.length, length: 0, content: "," + newProperty };
|
|
104374
|
+
}
|
|
104375
|
+
return withFormatting(text4, edit, options2);
|
|
104376
|
+
} else if (value === void 0 && parent.children.length >= 0) {
|
|
104377
|
+
const removalIndex = lastSegment;
|
|
104378
|
+
const toRemove = parent.children[removalIndex];
|
|
104379
|
+
let edit;
|
|
104380
|
+
if (parent.children.length === 1) {
|
|
104381
|
+
edit = { offset: parent.offset + 1, length: parent.length - 2, content: "" };
|
|
104382
|
+
} else if (parent.children.length - 1 === removalIndex) {
|
|
104383
|
+
let previous3 = parent.children[removalIndex - 1];
|
|
104384
|
+
let offset2 = previous3.offset + previous3.length;
|
|
104385
|
+
let parentEndOffset = parent.offset + parent.length;
|
|
104386
|
+
edit = { offset: offset2, length: parentEndOffset - 2 - offset2, content: "" };
|
|
104387
|
+
} else {
|
|
104388
|
+
edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: "" };
|
|
104389
|
+
}
|
|
104390
|
+
return withFormatting(text4, edit, options2);
|
|
104391
|
+
} else if (value !== void 0) {
|
|
104392
|
+
let edit;
|
|
104393
|
+
const newProperty = `${JSON.stringify(value)}`;
|
|
104394
|
+
if (!options2.isArrayInsertion && parent.children.length > lastSegment) {
|
|
104395
|
+
const toModify = parent.children[lastSegment];
|
|
104396
|
+
edit = { offset: toModify.offset, length: toModify.length, content: newProperty };
|
|
104397
|
+
} else if (parent.children.length === 0 || lastSegment === 0) {
|
|
104398
|
+
edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + "," };
|
|
104399
|
+
} else {
|
|
104400
|
+
const index2 = lastSegment > parent.children.length ? parent.children.length : lastSegment;
|
|
104401
|
+
const previous3 = parent.children[index2 - 1];
|
|
104402
|
+
edit = { offset: previous3.offset + previous3.length, length: 0, content: "," + newProperty };
|
|
104403
|
+
}
|
|
104404
|
+
return withFormatting(text4, edit, options2);
|
|
104405
|
+
} else {
|
|
104406
|
+
throw new Error(`Can not ${value === void 0 ? "remove" : options2.isArrayInsertion ? "insert" : "modify"} Array index ${insertIndex} as length is not sufficient`);
|
|
104407
|
+
}
|
|
104408
|
+
} else {
|
|
104409
|
+
throw new Error(`Can not add ${typeof lastSegment !== "number" ? "index" : "property"} to parent of type ${parent.type}`);
|
|
104410
|
+
}
|
|
104411
|
+
}
|
|
104412
|
+
function withFormatting(text4, edit, options2) {
|
|
104413
|
+
if (!options2.formattingOptions) {
|
|
104414
|
+
return [edit];
|
|
104415
|
+
}
|
|
104416
|
+
let newText = applyEdit(text4, edit);
|
|
104417
|
+
let begin = edit.offset;
|
|
104418
|
+
let end = edit.offset + edit.content.length;
|
|
104419
|
+
if (edit.length === 0 || edit.content.length === 0) {
|
|
104420
|
+
while (begin > 0 && !isEOL(newText, begin - 1)) {
|
|
104421
|
+
begin--;
|
|
104422
|
+
}
|
|
104423
|
+
while (end < newText.length && !isEOL(newText, end)) {
|
|
104424
|
+
end++;
|
|
104425
|
+
}
|
|
104426
|
+
}
|
|
104427
|
+
const edits = format(newText, { offset: begin, length: end - begin }, { ...options2.formattingOptions, keepLines: false });
|
|
104428
|
+
for (let i10 = edits.length - 1; i10 >= 0; i10--) {
|
|
104429
|
+
const edit2 = edits[i10];
|
|
104430
|
+
newText = applyEdit(newText, edit2);
|
|
104431
|
+
begin = Math.min(begin, edit2.offset);
|
|
104432
|
+
end = Math.max(end, edit2.offset + edit2.length);
|
|
104433
|
+
end += edit2.content.length - edit2.length;
|
|
104434
|
+
}
|
|
104435
|
+
const editLength = text4.length - (newText.length - end) - begin;
|
|
104436
|
+
return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }];
|
|
104437
|
+
}
|
|
104438
|
+
function applyEdit(text4, edit) {
|
|
104439
|
+
return text4.substring(0, edit.offset) + edit.content + text4.substring(edit.offset + edit.length);
|
|
104440
|
+
}
|
|
104441
|
+
|
|
104442
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
|
|
104443
|
+
var ScanError;
|
|
104444
|
+
(function(ScanError2) {
|
|
104445
|
+
ScanError2[ScanError2["None"] = 0] = "None";
|
|
104446
|
+
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
104447
|
+
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
104448
|
+
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
104449
|
+
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
104450
|
+
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
104451
|
+
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
104452
|
+
})(ScanError || (ScanError = {}));
|
|
104453
|
+
var SyntaxKind;
|
|
104454
|
+
(function(SyntaxKind2) {
|
|
104455
|
+
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
104456
|
+
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
104457
|
+
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
104458
|
+
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
104459
|
+
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
104460
|
+
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
104461
|
+
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
104462
|
+
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
104463
|
+
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
104464
|
+
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
104465
|
+
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
104466
|
+
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
104467
|
+
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
104468
|
+
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
104469
|
+
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
104470
|
+
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
104471
|
+
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
104472
|
+
})(SyntaxKind || (SyntaxKind = {}));
|
|
104473
|
+
var ParseErrorCode;
|
|
104474
|
+
(function(ParseErrorCode2) {
|
|
104475
|
+
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
104476
|
+
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
104477
|
+
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
104478
|
+
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
104479
|
+
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
104480
|
+
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
104481
|
+
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
104482
|
+
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
104483
|
+
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
104484
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
104485
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
104486
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
104487
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
104488
|
+
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
104489
|
+
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
104490
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
104491
|
+
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
104492
|
+
function modify(text4, path44, value, options2) {
|
|
104493
|
+
return setProperty(text4, path44, value, options2);
|
|
104494
|
+
}
|
|
104495
|
+
function applyEdits(text4, edits) {
|
|
104496
|
+
let sortedEdits = edits.slice(0).sort((a9, b10) => {
|
|
104497
|
+
const diff = a9.offset - b10.offset;
|
|
104498
|
+
if (diff === 0) {
|
|
104499
|
+
return a9.length - b10.length;
|
|
104500
|
+
}
|
|
104501
|
+
return diff;
|
|
104502
|
+
});
|
|
104503
|
+
let lastModifiedOffset = text4.length;
|
|
104504
|
+
for (let i10 = sortedEdits.length - 1; i10 >= 0; i10--) {
|
|
104505
|
+
let e9 = sortedEdits[i10];
|
|
104506
|
+
if (e9.offset + e9.length <= lastModifiedOffset) {
|
|
104507
|
+
text4 = applyEdit(text4, e9);
|
|
104508
|
+
} else {
|
|
104509
|
+
throw new Error("Overlapping edit");
|
|
104510
|
+
}
|
|
104511
|
+
lastModifiedOffset = e9.offset;
|
|
104512
|
+
}
|
|
104513
|
+
return text4;
|
|
104514
|
+
}
|
|
104515
|
+
|
|
104516
|
+
// ../canopycms/src/utils/json-source-splice.ts
|
|
103314
104517
|
init_error();
|
|
103315
104518
|
var log5 = createDebugLogger({ prefix: "JsonSourceSplice" });
|
|
103316
104519
|
function isRecord(value) {
|
|
@@ -103328,23 +104531,23 @@ function detectFormatting(text4) {
|
|
|
103328
104531
|
}
|
|
103329
104532
|
function insertMember(text4, path44, key, value, formattingOptions) {
|
|
103330
104533
|
const at2 = [...path44, key];
|
|
103331
|
-
const [edit] =
|
|
104534
|
+
const [edit] = modify(text4, at2, value, {});
|
|
103332
104535
|
const closing = edit ? /^[ \t]*\r?\n([ \t]*)\}/.exec(text4.slice(edit.offset)) : null;
|
|
103333
104536
|
if (edit && closing && edit.length === 0 && edit.content.startsWith(",")) {
|
|
103334
104537
|
const unit = formattingOptions.insertSpaces ? " ".repeat(formattingOptions.tabSize ?? 2) : " ";
|
|
103335
104538
|
const eol = formattingOptions.eol ?? "\n";
|
|
103336
104539
|
const indent2 = closing[1] + unit;
|
|
103337
104540
|
const rendered = JSON.stringify(value, null, unit).split("\n").join(eol + indent2);
|
|
103338
|
-
return
|
|
104541
|
+
return applyEdits(text4, [
|
|
103339
104542
|
{ ...edit, content: `,${eol}${indent2}${JSON.stringify(key)}: ${rendered}` }
|
|
103340
104543
|
]);
|
|
103341
104544
|
}
|
|
103342
|
-
return
|
|
104545
|
+
return applyEdits(text4, modify(text4, at2, value, { formattingOptions }));
|
|
103343
104546
|
}
|
|
103344
104547
|
function removeMember(text4, path44) {
|
|
103345
|
-
return
|
|
104548
|
+
return applyEdits(
|
|
103346
104549
|
text4,
|
|
103347
|
-
|
|
104550
|
+
modify(text4, path44, void 0, {}).map((edit) => {
|
|
103348
104551
|
const removed = text4.slice(edit.offset, edit.offset + edit.length);
|
|
103349
104552
|
const lead = /^\s+/.exec(removed)?.[0].length ?? 0;
|
|
103350
104553
|
const atMember = /\S/.test(text4.charAt(edit.offset + edit.length));
|
|
@@ -103355,7 +104558,7 @@ function removeMember(text4, path44) {
|
|
|
103355
104558
|
function reconcile(text4, path44, before, after, formattingOptions) {
|
|
103356
104559
|
if (isRecord(before) && isRecord(after)) {
|
|
103357
104560
|
if (Object.keys(after).length === 0 && Object.keys(before).length > 0) {
|
|
103358
|
-
return
|
|
104561
|
+
return applyEdits(text4, modify(text4, path44, {}, { formattingOptions }));
|
|
103359
104562
|
}
|
|
103360
104563
|
let next = text4;
|
|
103361
104564
|
for (const key of Object.keys(before)) {
|
|
@@ -103374,7 +104577,7 @@ function reconcile(text4, path44, before, after, formattingOptions) {
|
|
|
103374
104577
|
);
|
|
103375
104578
|
}
|
|
103376
104579
|
if (JSON.stringify(before) === JSON.stringify(after)) return text4;
|
|
103377
|
-
return
|
|
104580
|
+
return applyEdits(text4, modify(text4, path44, after, { formattingOptions }));
|
|
103378
104581
|
}
|
|
103379
104582
|
function serializeJson(data4, existingRaw) {
|
|
103380
104583
|
if (existingRaw === void 0) return plainStringify(data4);
|
|
@@ -109465,7 +110668,7 @@ function serializeChunks(chunks, expandTabs) {
|
|
|
109465
110668
|
}
|
|
109466
110669
|
|
|
109467
110670
|
// ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/parse.js
|
|
109468
|
-
function
|
|
110671
|
+
function parse3(options2) {
|
|
109469
110672
|
const settings = options2 || {};
|
|
109470
110673
|
const constructs2 = (
|
|
109471
110674
|
/** @type {FullNormalizedExtension} */
|
|
@@ -109627,7 +110830,7 @@ function fromMarkdown(value, encoding, options2) {
|
|
|
109627
110830
|
options2 = encoding;
|
|
109628
110831
|
encoding = void 0;
|
|
109629
110832
|
}
|
|
109630
|
-
return compiler(options2)(postprocess(
|
|
110833
|
+
return compiler(options2)(postprocess(parse3(options2).document().write(preprocess()(value, encoding, true))));
|
|
109631
110834
|
}
|
|
109632
110835
|
function compiler(options2) {
|
|
109633
110836
|
const config = {
|
|
@@ -110489,12 +111692,12 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
110489
111692
|
typeof value.name === "string" ? value.name : void 0
|
|
110490
111693
|
)
|
|
110491
111694
|
);
|
|
110492
|
-
Object.defineProperty(
|
|
111695
|
+
Object.defineProperty(visit5, "name", {
|
|
110493
111696
|
value: "node (" + color(node2.type + (name3 ? "<" + name3 + ">" : "")) + ")"
|
|
110494
111697
|
});
|
|
110495
111698
|
}
|
|
110496
|
-
return
|
|
110497
|
-
function
|
|
111699
|
+
return visit5;
|
|
111700
|
+
function visit5() {
|
|
110498
111701
|
let result = empty2;
|
|
110499
111702
|
let subresult;
|
|
110500
111703
|
let offset2;
|
|
@@ -113651,7 +114854,7 @@ var Parser = function Parser2(options2, input, startPos) {
|
|
|
113651
114854
|
this.privateNameStack = [];
|
|
113652
114855
|
};
|
|
113653
114856
|
var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowReturn: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, allowUsing: { configurable: true }, inClassStaticBlock: { configurable: true } };
|
|
113654
|
-
Parser.prototype.parse = function
|
|
114857
|
+
Parser.prototype.parse = function parse4() {
|
|
113655
114858
|
var node2 = this.options.program || this.startNode();
|
|
113656
114859
|
this.nextToken();
|
|
113657
114860
|
return this.parseTopLevel(node2);
|
|
@@ -113731,7 +114934,7 @@ Parser.extend = function extend() {
|
|
|
113731
114934
|
}
|
|
113732
114935
|
return cls;
|
|
113733
114936
|
};
|
|
113734
|
-
Parser.parse = function
|
|
114937
|
+
Parser.parse = function parse5(input, options2) {
|
|
113735
114938
|
return new this(options2, input).parse();
|
|
113736
114939
|
};
|
|
113737
114940
|
Parser.parseExpressionAt = function parseExpressionAt(input, pos, options2) {
|
|
@@ -115148,9 +116351,9 @@ pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowMod
|
|
|
115148
116351
|
} else if (allowTrailingComma && this.afterTrailingComma(close)) {
|
|
115149
116352
|
break;
|
|
115150
116353
|
} else if (this.type === types$1.ellipsis) {
|
|
115151
|
-
var
|
|
115152
|
-
this.parseBindingListItem(
|
|
115153
|
-
elts.push(
|
|
116354
|
+
var rest2 = this.parseRestBinding();
|
|
116355
|
+
this.parseBindingListItem(rest2);
|
|
116356
|
+
elts.push(rest2);
|
|
115154
116357
|
if (this.type === types$1.comma) {
|
|
115155
116358
|
this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
115156
116359
|
}
|
|
@@ -118826,7 +120029,7 @@ var own3 = {}.hasOwnProperty;
|
|
|
118826
120029
|
var CONTINUE2 = Symbol("continue");
|
|
118827
120030
|
var EXIT2 = Symbol("exit");
|
|
118828
120031
|
var SKIP2 = Symbol("skip");
|
|
118829
|
-
function
|
|
120032
|
+
function visit2(tree, visitor) {
|
|
118830
120033
|
let enter;
|
|
118831
120034
|
let leave;
|
|
118832
120035
|
if (typeof visitor === "function") {
|
|
@@ -118838,10 +120041,10 @@ function visit(tree, visitor) {
|
|
|
118838
120041
|
build(tree, void 0, void 0, [])();
|
|
118839
120042
|
function build(node2, key, index2, parents) {
|
|
118840
120043
|
if (nodelike(node2)) {
|
|
118841
|
-
|
|
120044
|
+
visit5.displayName = "node (" + color2(node2.type) + ")";
|
|
118842
120045
|
}
|
|
118843
|
-
return
|
|
118844
|
-
function
|
|
120046
|
+
return visit5;
|
|
120047
|
+
function visit5() {
|
|
118845
120048
|
const result = enter ? toResult2(enter(node2, key, index2, parents)) : [];
|
|
118846
120049
|
if (result[0] === EXIT2) {
|
|
118847
120050
|
return result;
|
|
@@ -118982,7 +120185,7 @@ function eventsToAcorn(events, options2) {
|
|
|
118982
120185
|
}
|
|
118983
120186
|
if (estree) {
|
|
118984
120187
|
estree.comments = comments;
|
|
118985
|
-
|
|
120188
|
+
visit2(estree, function(esnode, field, index2, parents) {
|
|
118986
120189
|
let context = (
|
|
118987
120190
|
/** @type {AcornNode | Array<AcornNode>} */
|
|
118988
120191
|
parents[parents.length - 1]
|
|
@@ -119096,11 +120299,11 @@ function relativeToPoint(stops, relative) {
|
|
|
119096
120299
|
return void 0;
|
|
119097
120300
|
}
|
|
119098
120301
|
const [stopRelative, stopAbsolute] = stops[index2 - 1];
|
|
119099
|
-
const
|
|
120302
|
+
const rest2 = relative - stopRelative;
|
|
119100
120303
|
return {
|
|
119101
120304
|
line: stopAbsolute.line,
|
|
119102
|
-
column: stopAbsolute.column +
|
|
119103
|
-
offset: stopAbsolute.offset +
|
|
120305
|
+
column: stopAbsolute.column + rest2,
|
|
120306
|
+
offset: stopAbsolute.offset + rest2
|
|
119104
120307
|
};
|
|
119105
120308
|
}
|
|
119106
120309
|
function serializeChunks2(chunks) {
|
|
@@ -120033,9 +121236,9 @@ function mdxjs(options2) {
|
|
|
120033
121236
|
// ../canopycms/src/utils/markdown-parse.ts
|
|
120034
121237
|
init_error();
|
|
120035
121238
|
var log6 = createDebugLogger({ prefix: "MarkdownParse" });
|
|
120036
|
-
function parseMarkdownBody(text4,
|
|
121239
|
+
function parseMarkdownBody(text4, format4) {
|
|
120037
121240
|
try {
|
|
120038
|
-
return
|
|
121241
|
+
return format4 === "mdx" ? fromMarkdown(text4, {
|
|
120039
121242
|
extensions: [gfm(), mdxjs()],
|
|
120040
121243
|
mdastExtensions: [gfmFromMarkdown(), mdxFromMarkdown()]
|
|
120041
121244
|
}) : fromMarkdown(text4, { extensions: [gfm()], mdastExtensions: [gfmFromMarkdown()] });
|
|
@@ -121076,10 +122279,10 @@ function listMarkers(text4, items, ordered) {
|
|
|
121076
122279
|
return marker + itemText.slice(current2[0].length);
|
|
121077
122280
|
};
|
|
121078
122281
|
}
|
|
121079
|
-
function preserveMarkdownSource(original, updated,
|
|
122282
|
+
function preserveMarkdownSource(original, updated, format4) {
|
|
121080
122283
|
if (original === updated) return original;
|
|
121081
122284
|
try {
|
|
121082
|
-
return splice2(original, updated,
|
|
122285
|
+
return splice2(original, updated, format4) ?? updated;
|
|
121083
122286
|
} catch (err) {
|
|
121084
122287
|
log7.debug("markdown-body-splice", "splice failed", { error: getErrorMessage(err) });
|
|
121085
122288
|
return updated;
|
|
@@ -121103,9 +122306,9 @@ function diskBlocks(oNodes, nNodes) {
|
|
|
121103
122306
|
});
|
|
121104
122307
|
return fromDisk;
|
|
121105
122308
|
}
|
|
121106
|
-
function splice2(original, updated,
|
|
121107
|
-
const before = original === void 0 ? void 0 : parseMarkdownBody(original,
|
|
121108
|
-
const after = parseMarkdownBody(updated,
|
|
122309
|
+
function splice2(original, updated, format4) {
|
|
122310
|
+
const before = original === void 0 ? void 0 : parseMarkdownBody(original, format4);
|
|
122311
|
+
const after = parseMarkdownBody(updated, format4);
|
|
121109
122312
|
if (after === void 0) return void 0;
|
|
121110
122313
|
const target = canonical(after);
|
|
121111
122314
|
const fromDisk = diskBlocks(before?.children ?? [], after.children);
|
|
@@ -121114,7 +122317,7 @@ function splice2(original, updated, format3) {
|
|
|
121114
122317
|
after,
|
|
121115
122318
|
(index2) => fromDisk.has(index2),
|
|
121116
122319
|
(text4) => {
|
|
121117
|
-
const tree = parseMarkdownBody(text4,
|
|
122320
|
+
const tree = parseMarkdownBody(text4, format4);
|
|
121118
122321
|
return tree !== void 0 && canonical(tree) === target ? tree : void 0;
|
|
121119
122322
|
}
|
|
121120
122323
|
);
|
|
@@ -121125,7 +122328,7 @@ function splice2(original, updated, format3) {
|
|
|
121125
122328
|
for (const deep of [true, false]) {
|
|
121126
122329
|
const candidate = new Splicer(original, edit.text, deep).body(before, edit.tree);
|
|
121127
122330
|
if (candidate === void 0) continue;
|
|
121128
|
-
const reparsed = parseMarkdownBody(candidate,
|
|
122331
|
+
const reparsed = parseMarkdownBody(candidate, format4);
|
|
121129
122332
|
if (reparsed !== void 0 && canonical(reparsed) === target) return candidate;
|
|
121130
122333
|
log7.debug("markdown-body-splice", "splice does not read back as the edit", {
|
|
121131
122334
|
deep,
|
|
@@ -121390,9 +122593,9 @@ function extractBody(raw) {
|
|
|
121390
122593
|
function writesFrontmatter(data4) {
|
|
121391
122594
|
return Object.values(data4).some((value) => value !== void 0);
|
|
121392
122595
|
}
|
|
121393
|
-
function bodyToWrite(body, data4,
|
|
122596
|
+
function bodyToWrite(body, data4, format4, existingRaw) {
|
|
121394
122597
|
const priorBody = existingRaw === void 0 ? void 0 : extractBody(existingRaw);
|
|
121395
|
-
const spliced = preserveMarkdownSource(priorBody, body,
|
|
122598
|
+
const spliced = preserveMarkdownSource(priorBody, body, format4);
|
|
121396
122599
|
if (!writesFrontmatter(data4)) {
|
|
121397
122600
|
const flush2 = spliced.replace(/^(?:\r?\n)+/, "");
|
|
121398
122601
|
return /^\uFEFF?---/.test(flush2) ? `
|
|
@@ -121470,8 +122673,8 @@ ${asKey ? `${text4}: v` : `v: ${text4}`}
|
|
|
121470
122673
|
return true;
|
|
121471
122674
|
}
|
|
121472
122675
|
}
|
|
121473
|
-
function serializeFrontmatter(editorBody, data4, existingRaw,
|
|
121474
|
-
const file = { content: bodyToWrite(editorBody, data4,
|
|
122676
|
+
function serializeFrontmatter(editorBody, data4, existingRaw, format4, fields = []) {
|
|
122677
|
+
const file = { content: bodyToWrite(editorBody, data4, format4, existingRaw) };
|
|
121475
122678
|
if (existingRaw === void 0) return import_gray_matter.default.stringify(file, data4);
|
|
121476
122679
|
const existingFrontmatter = extractRawFrontmatter(existingRaw);
|
|
121477
122680
|
if (existingFrontmatter === void 0) return import_gray_matter.default.stringify(file, data4);
|
|
@@ -121521,9 +122724,9 @@ var heldRoots = new AsyncLocalStorage();
|
|
|
121521
122724
|
|
|
121522
122725
|
// ../canopycms/src/content-listing.ts
|
|
121523
122726
|
var log9 = createDebugLogger({ prefix: "ContentListing" });
|
|
121524
|
-
var parseEntryParts = (raw,
|
|
121525
|
-
if (
|
|
121526
|
-
if (
|
|
122727
|
+
var parseEntryParts = (raw, format4) => {
|
|
122728
|
+
if (format4 === "json") return { data: asRecord(JSON.parse(raw)) };
|
|
122729
|
+
if (format4 === "yaml") return { data: asRecord((0, import_yaml3.parse)(raw)) };
|
|
121527
122730
|
const parsed = (0, import_gray_matter2.default)(raw);
|
|
121528
122731
|
return { data: { ...parsed.data ?? {} }, body: parsed.content };
|
|
121529
122732
|
};
|
|
@@ -122216,8 +123419,8 @@ function mergeOrder(ancestorIds, baseIds, branchIds) {
|
|
|
122216
123419
|
// ../canopycms/src/merge/text-merge.ts
|
|
122217
123420
|
var split = (text4) => {
|
|
122218
123421
|
const endBreak = text4.endsWith("\n");
|
|
122219
|
-
const
|
|
122220
|
-
return { lines:
|
|
123422
|
+
const rest2 = endBreak ? text4.slice(0, -1) : text4;
|
|
123423
|
+
return { lines: rest2 === "" && !endBreak ? [] : rest2.split("\n"), endBreak };
|
|
122221
123424
|
};
|
|
122222
123425
|
var sameLines = (x6, y3) => x6.length === y3.length && x6.every((line, i10) => line === y3[i10]);
|
|
122223
123426
|
function mergeText(ancestor, base, branch) {
|
|
@@ -122420,13 +123623,13 @@ function insertedByBoth(aPart, aTokens, bPart, bTokens) {
|
|
|
122420
123623
|
if (isSubsequence(bTokens, aTokens)) return [...aPart];
|
|
122421
123624
|
const fromBase = /* @__PURE__ */ new Map();
|
|
122422
123625
|
for (const token of aTokens) fromBase.set(token, (fromBase.get(token) ?? 0) + 1);
|
|
122423
|
-
const
|
|
123626
|
+
const rest2 = bPart.filter((_3, n7) => {
|
|
122424
123627
|
const left = fromBase.get(bTokens[n7]) ?? 0;
|
|
122425
123628
|
if (left === 0) return true;
|
|
122426
123629
|
fromBase.set(bTokens[n7], left - 1);
|
|
122427
123630
|
return false;
|
|
122428
123631
|
});
|
|
122429
|
-
return [...aPart, ...
|
|
123632
|
+
return [...aPart, ...rest2];
|
|
122430
123633
|
}
|
|
122431
123634
|
function mergeRecord(o8, a9, b10, at2, walk2) {
|
|
122432
123635
|
const ancestor = isPlainRecord(o8) ? o8 : {};
|
|
@@ -122588,7 +123791,7 @@ function withListKey(merged, ai, bi, keys, used, at2, walk2) {
|
|
|
122588
123791
|
var withBody = (side, bodyName) => side.body === void 0 ? side.data : { ...side.data, [bodyName]: side.body };
|
|
122589
123792
|
var mdxParses = (text4) => parseMarkdownBody(text4, "mdx") !== void 0;
|
|
122590
123793
|
var sameContent = (x6, y3) => sameValue(x6.data, y3.data) && (x6.body ?? "") === (y3.body ?? "");
|
|
122591
|
-
function mergeBody(o8, a9, b10,
|
|
123794
|
+
function mergeBody(o8, a9, b10, format4, at2, walk2) {
|
|
122592
123795
|
if (a9 === b10 || o8 === a9) return b10;
|
|
122593
123796
|
if (o8 === b10) return a9;
|
|
122594
123797
|
const merged = mergeText(o8, a9, b10);
|
|
@@ -122597,7 +123800,7 @@ function mergeBody(o8, a9, b10, format3, at2, walk2) {
|
|
|
122597
123800
|
return b10;
|
|
122598
123801
|
}
|
|
122599
123802
|
const { text: text4, regions } = merged;
|
|
122600
|
-
const parses = (body) =>
|
|
123803
|
+
const parses = (body) => format4 !== "mdx" || mdxParses(body);
|
|
122601
123804
|
if (!parses(text4) && parses(a9) && parses(b10)) {
|
|
122602
123805
|
walk2.conflicts.push({
|
|
122603
123806
|
at: at2.segments,
|
|
@@ -122620,7 +123823,7 @@ function mergeBody(o8, a9, b10, format3, at2, walk2) {
|
|
|
122620
123823
|
return text4;
|
|
122621
123824
|
}
|
|
122622
123825
|
function mergeEntry({
|
|
122623
|
-
format:
|
|
123826
|
+
format: format4,
|
|
122624
123827
|
ancestor,
|
|
122625
123828
|
base,
|
|
122626
123829
|
branch,
|
|
@@ -122689,7 +123892,7 @@ function mergeEntry({
|
|
|
122689
123892
|
ancestor.body ?? "",
|
|
122690
123893
|
base.body ?? "",
|
|
122691
123894
|
branch.body ?? "",
|
|
122692
|
-
|
|
123895
|
+
format4,
|
|
122693
123896
|
child(ROOT, { field: bodyName }, { o: ancestor.body, a: base.body, b: branch.body }),
|
|
122694
123897
|
walk2
|
|
122695
123898
|
) : void 0;
|
|
@@ -122715,20 +123918,20 @@ function mergeEntry({
|
|
|
122715
123918
|
function ambiguityOf(branch, schemaRead) {
|
|
122716
123919
|
const seen = /* @__PURE__ */ new Map();
|
|
122717
123920
|
const name3 = (within, key) => JSON.stringify([...within, key]);
|
|
122718
|
-
const
|
|
123921
|
+
const visit5 = (node2, within) => {
|
|
122719
123922
|
if (Array.isArray(node2)) {
|
|
122720
123923
|
const readKeys2 = schemaRead ? [] : itemKeysAsRead(node2);
|
|
122721
123924
|
node2.forEach((item, n7) => {
|
|
122722
123925
|
const key = schemaRead ? usableKey(item) : readKeys2[n7];
|
|
122723
123926
|
if (key === void 0) return;
|
|
122724
123927
|
seen.set(name3(within, key), (seen.get(name3(within, key)) ?? 0) + 1);
|
|
122725
|
-
|
|
123928
|
+
visit5(item, [...within, key]);
|
|
122726
123929
|
});
|
|
122727
123930
|
} else if (isPlainRecord(node2)) {
|
|
122728
|
-
for (const value of Object.values(node2))
|
|
123931
|
+
for (const value of Object.values(node2)) visit5(value, within);
|
|
122729
123932
|
}
|
|
122730
123933
|
};
|
|
122731
|
-
|
|
123934
|
+
visit5(branch, []);
|
|
122732
123935
|
return (within, key) => (seen.get(name3(within, key)) ?? 0) > 1;
|
|
122733
123936
|
}
|
|
122734
123937
|
function keyedItems(data4) {
|
|
@@ -122803,7 +124006,7 @@ function named(conflicts2, fields, read, sides) {
|
|
|
122803
124006
|
const out = [];
|
|
122804
124007
|
const asRead = (side) => fields && isPlainRecord(side) ? entryAsRead(fields, side) : side;
|
|
122805
124008
|
const reads = { o: asRead(sides.o), a: asRead(sides.a), b: asRead(sides.b) };
|
|
122806
|
-
for (const { at: at2, places, placeTrail, trail: trail2, ...
|
|
124009
|
+
for (const { at: at2, places, placeTrail, trail: trail2, ...rest2 } of conflicts2) {
|
|
122807
124010
|
const { key, dataPath, depth } = describePath(fields, read, at2);
|
|
122808
124011
|
if (seen.has(key)) continue;
|
|
122809
124012
|
seen.add(key);
|
|
@@ -122817,7 +124020,7 @@ function named(conflicts2, fields, read, sides) {
|
|
|
122817
124020
|
const sidePath = (side) => {
|
|
122818
124021
|
const place = placeOf(side);
|
|
122819
124022
|
if (place) return describe(side, place);
|
|
122820
|
-
const list5 = depth === at2.length &&
|
|
124023
|
+
const list5 = depth === at2.length && rest2.item ? placeTrail?.[at2.length - 2]?.[side] : void 0;
|
|
122821
124024
|
const holder = list5 && describe(side, list5);
|
|
122822
124025
|
const missing = dataPath.at(-1);
|
|
122823
124026
|
return holder && missing && "item" in missing ? holder : void 0;
|
|
@@ -122829,7 +124032,7 @@ function named(conflicts2, fields, read, sides) {
|
|
|
122829
124032
|
...branch && { branch }
|
|
122830
124033
|
};
|
|
122831
124034
|
if (depth === at2.length) {
|
|
122832
|
-
out.push({ key, dataPath, sidePaths, ...
|
|
124035
|
+
out.push({ key, dataPath, sidePaths, ...rest2 });
|
|
122833
124036
|
continue;
|
|
122834
124037
|
}
|
|
122835
124038
|
const whole = trail2?.[depth - 1] ?? (byName ? { o: valueAt(sides.o, prefix), a: valueAt(sides.a, prefix), b: valueAt(sides.b, prefix) } : void 0);
|
|
@@ -123165,18 +124368,18 @@ async function readText(git, oid) {
|
|
|
123165
124368
|
const text4 = await git.raw(["cat-file", "blob", "--end-of-options", oid]);
|
|
123166
124369
|
return Buffer.byteLength(text4, "utf8") === size && !text4.includes("\uFFFD") ? text4 : void 0;
|
|
123167
124370
|
}
|
|
123168
|
-
function holdsRecord(text4,
|
|
123169
|
-
if (
|
|
123170
|
-
if (
|
|
124371
|
+
function holdsRecord(text4, format4) {
|
|
124372
|
+
if (format4 === "json") return isPlainRecord(JSON.parse(text4));
|
|
124373
|
+
if (format4 !== "yaml") return true;
|
|
123171
124374
|
const value = (0, import_yaml4.parse)(text4);
|
|
123172
124375
|
return value === null || value === void 0 || isPlainRecord(value);
|
|
123173
124376
|
}
|
|
123174
|
-
async function readEntry(git, file,
|
|
124377
|
+
async function readEntry(git, file, format4) {
|
|
123175
124378
|
const text4 = await readText(git, file.oid);
|
|
123176
124379
|
if (text4 === void 0) return void 0;
|
|
123177
124380
|
try {
|
|
123178
|
-
if (!holdsRecord(text4,
|
|
123179
|
-
const { data: data4, body } = parseEntryParts(text4,
|
|
124381
|
+
if (!holdsRecord(text4, format4)) return void 0;
|
|
124382
|
+
const { data: data4, body } = parseEntryParts(text4, format4);
|
|
123180
124383
|
const side = { data: structuredClone(data4) };
|
|
123181
124384
|
if (body !== void 0) side.body = body;
|
|
123182
124385
|
const type = parseTypedFilename(path27.posix.basename(file.path))?.type;
|
|
@@ -123197,10 +124400,10 @@ function fieldsFor(flatSchema, file, root5) {
|
|
|
123197
124400
|
return item?.type === "entry-type" ? item.schema : void 0;
|
|
123198
124401
|
}
|
|
123199
124402
|
var sameContent2 = (x6, y3) => exactToken(x6.data) === exactToken(y3.data) && x6.body === y3.body;
|
|
123200
|
-
function serializeEntry(
|
|
123201
|
-
if (
|
|
123202
|
-
if (
|
|
123203
|
-
return serializeFrontmatter(merged.body ?? "", merged.data, onto,
|
|
124403
|
+
function serializeEntry(format4, merged, onto) {
|
|
124404
|
+
if (format4 === "json") return serializeJson(merged.data, onto);
|
|
124405
|
+
if (format4 === "yaml") return serializeYaml(merged.data, onto);
|
|
124406
|
+
return serializeFrontmatter(merged.body ?? "", merged.data, onto, format4);
|
|
123204
124407
|
}
|
|
123205
124408
|
var blobSides = (unit) => {
|
|
123206
124409
|
const [ancestor, base, branch] = [unit.ancestor, sideFile(unit, "base"), sideFile(unit, "branch")];
|
|
@@ -123226,10 +124429,10 @@ var LOCATION = {
|
|
|
123226
124429
|
sidePaths: {},
|
|
123227
124430
|
kind: "changed"
|
|
123228
124431
|
};
|
|
123229
|
-
function readsAs(text4,
|
|
124432
|
+
function readsAs(text4, format4, merged) {
|
|
123230
124433
|
try {
|
|
123231
|
-
if (!holdsRecord(text4,
|
|
123232
|
-
const back = parseEntryParts(text4,
|
|
124434
|
+
if (!holdsRecord(text4, format4)) return false;
|
|
124435
|
+
const back = parseEntryParts(text4, format4);
|
|
123233
124436
|
return sameContent2(
|
|
123234
124437
|
{ data: back.data, ...back.body !== void 0 && { body: back.body } },
|
|
123235
124438
|
merged
|
|
@@ -123246,10 +124449,10 @@ var withoutItemKeys = (value) => {
|
|
|
123246
124449
|
);
|
|
123247
124450
|
};
|
|
123248
124451
|
async function differsInItemKeysOnly(git, x6, y3, contentRoot) {
|
|
123249
|
-
const
|
|
123250
|
-
if (!
|
|
124452
|
+
const format4 = formatOf(y3.path);
|
|
124453
|
+
if (!format4 || x6.path !== y3.path || x6.mode !== y3.mode) return false;
|
|
123251
124454
|
if (entryLogicalPathOfFile(y3.path, normalizeFilesystemPath(contentRoot)) === null) return false;
|
|
123252
|
-
const [a9, b10] = await Promise.all([readEntry(git, x6,
|
|
124455
|
+
const [a9, b10] = await Promise.all([readEntry(git, x6, format4), readEntry(git, y3, format4)]);
|
|
123253
124456
|
return !!a9 && !!b10 && a9.side.body === b10.side.body && exactToken(withoutItemKeys(a9.side.data)) === exactToken(withoutItemKeys(b10.side.data));
|
|
123254
124457
|
}
|
|
123255
124458
|
var Resolver = class {
|
|
@@ -123337,19 +124540,19 @@ var Resolver = class {
|
|
|
123337
124540
|
return { file: { ...b10, path: own4 }, conflict: { path: own4, kind: "unreadable", sides } };
|
|
123338
124541
|
};
|
|
123339
124542
|
if (a9.oid === b10.oid && !apart) return { file: { ...b10, path: at2 } };
|
|
123340
|
-
const
|
|
123341
|
-
if (!
|
|
124543
|
+
const format4 = formatOf(b10.path);
|
|
124544
|
+
if (!format4 || [o8, a9].some((f9) => f9 && formatOf(f9.path) !== format4)) {
|
|
123342
124545
|
return gitClean ? null : keepBranch();
|
|
123343
124546
|
}
|
|
123344
124547
|
const [oSide, aSide, bSide] = await Promise.all(
|
|
123345
|
-
[o8, a9, b10].map((f9) => f9 ? readEntry(git, f9,
|
|
124548
|
+
[o8, a9, b10].map((f9) => f9 ? readEntry(git, f9, format4) : void 0)
|
|
123346
124549
|
);
|
|
123347
124550
|
if (!aSide || !bSide || o8 && !oSide) return gitClean ? null : keepBranch();
|
|
123348
124551
|
const fields = fieldsFor(this.args.flatSchema, b10.path, this.root);
|
|
123349
124552
|
let result;
|
|
123350
124553
|
try {
|
|
123351
124554
|
result = mergeEntry({
|
|
123352
|
-
format:
|
|
124555
|
+
format: format4,
|
|
123353
124556
|
ancestor: oSide?.side ?? { data: {} },
|
|
123354
124557
|
base: aSide.side,
|
|
123355
124558
|
branch: bSide.side,
|
|
@@ -123373,8 +124576,8 @@ var Resolver = class {
|
|
|
123373
124576
|
isBranch: sameContent2(bSide.side, merged),
|
|
123374
124577
|
reads: (text4) => {
|
|
123375
124578
|
try {
|
|
123376
|
-
if (!holdsRecord(text4,
|
|
123377
|
-
const back = parseEntryParts(text4,
|
|
124579
|
+
if (!holdsRecord(text4, format4)) return false;
|
|
124580
|
+
const back = parseEntryParts(text4, format4);
|
|
123378
124581
|
return sameContent2(
|
|
123379
124582
|
{ data: back.data, ...back.body !== void 0 && { body: back.body } },
|
|
123380
124583
|
merged
|
|
@@ -123383,7 +124586,7 @@ var Resolver = class {
|
|
|
123383
124586
|
return false;
|
|
123384
124587
|
}
|
|
123385
124588
|
},
|
|
123386
|
-
serialize: (onto) => serializeEntry(
|
|
124589
|
+
serialize: (onto) => serializeEntry(format4, merged, onto)
|
|
123387
124590
|
},
|
|
123388
124591
|
at2
|
|
123389
124592
|
);
|
|
@@ -123402,17 +124605,17 @@ var Resolver = class {
|
|
|
123402
124605
|
const { git } = this.args;
|
|
123403
124606
|
const [o8, a9, b10] = [unit.ancestor, sideFile(unit, "base"), sideFile(unit, "branch")];
|
|
123404
124607
|
if (!a9 || !b10 || !gitFile || a9.oid === b10.oid) return null;
|
|
123405
|
-
const
|
|
123406
|
-
if (!
|
|
124608
|
+
const format4 = formatOf(gitFile.path);
|
|
124609
|
+
if (!format4 || [o8, a9, b10].some((f9) => f9 && formatOf(f9.path) !== format4)) return null;
|
|
123407
124610
|
const [oSide, aSide, bSide, gitSide] = await Promise.all(
|
|
123408
|
-
[o8, a9, b10, gitFile].map((f9) => f9 ? readEntry(git, f9,
|
|
124611
|
+
[o8, a9, b10, gitFile].map((f9) => f9 ? readEntry(git, f9, format4) : void 0)
|
|
123409
124612
|
);
|
|
123410
124613
|
if (!aSide || !bSide || !gitSide || o8 && !oSide) return null;
|
|
123411
124614
|
const fields = fieldsFor(this.args.flatSchema, b10.path, this.root);
|
|
123412
124615
|
let result;
|
|
123413
124616
|
try {
|
|
123414
124617
|
result = mergeEntry({
|
|
123415
|
-
format:
|
|
124618
|
+
format: format4,
|
|
123416
124619
|
ancestor: oSide?.side ?? { data: {} },
|
|
123417
124620
|
base: aSide.side,
|
|
123418
124621
|
branch: bSide.side,
|
|
@@ -123432,8 +124635,8 @@ var Resolver = class {
|
|
|
123432
124635
|
branch: gitFile,
|
|
123433
124636
|
isBase: false,
|
|
123434
124637
|
isBranch: false,
|
|
123435
|
-
reads: (text4) => readsAs(text4,
|
|
123436
|
-
serialize: (onto) => serializeEntry(
|
|
124638
|
+
reads: (text4) => readsAs(text4, format4, merged),
|
|
124639
|
+
serialize: (onto) => serializeEntry(format4, merged, onto)
|
|
123437
124640
|
},
|
|
123438
124641
|
gitFile.path
|
|
123439
124642
|
);
|
|
@@ -123458,7 +124661,7 @@ var Resolver = class {
|
|
|
123458
124661
|
};
|
|
123459
124662
|
}
|
|
123460
124663
|
if (!o8 || !a9 || !b10) return null;
|
|
123461
|
-
const
|
|
124664
|
+
const parse7 = async (file2) => {
|
|
123462
124665
|
const text4 = await readText(git, file2.oid);
|
|
123463
124666
|
if (text4 === void 0) return void 0;
|
|
123464
124667
|
try {
|
|
@@ -123468,7 +124671,7 @@ var Resolver = class {
|
|
|
123468
124671
|
return void 0;
|
|
123469
124672
|
}
|
|
123470
124673
|
};
|
|
123471
|
-
const [oJson, aJson, bJson] = await Promise.all([o8, a9, b10].map(
|
|
124674
|
+
const [oJson, aJson, bJson] = await Promise.all([o8, a9, b10].map(parse7));
|
|
123472
124675
|
if (!oJson || !aJson || !bJson) return null;
|
|
123473
124676
|
const merged = mergeCollectionMeta(oJson.json, aJson.json, bJson.json);
|
|
123474
124677
|
const dirId = extractIdFromFilename(path27.posix.basename(path27.posix.dirname(b10.path)));
|
|
@@ -123704,9 +124907,9 @@ function keptVersions(kept, stages, contentRoot, named2) {
|
|
|
123704
124907
|
return found;
|
|
123705
124908
|
}
|
|
123706
124909
|
async function commitMerge(git, plan, { head, other, message: message2 }) {
|
|
123707
|
-
const { tree, gitTree: _gitTree, kind: _kind, ...
|
|
124910
|
+
const { tree, gitTree: _gitTree, kind: _kind, ...rest2 } = plan;
|
|
123708
124911
|
const sha = (await git.raw(["commit-tree", "-p", head, "-p", other, "-m", message2, "--end-of-options", tree])).trim();
|
|
123709
|
-
return { kind: "built", sha, ...
|
|
124912
|
+
return { kind: "built", sha, ...rest2 };
|
|
123710
124913
|
}
|
|
123711
124914
|
var mergesAsGitDoes = (plan) => plan.kind === "planned" && plan.asGitDoes;
|
|
123712
124915
|
async function isCleanMergeOf(git, merged, from, other, contentRoot) {
|
|
@@ -123872,6 +125075,7 @@ async function decidePublish(git, { head, published }) {
|
|
|
123872
125075
|
var COMMIT_ID2 = /^[0-9a-f]{40}([0-9a-f]{24})?$/;
|
|
123873
125076
|
var MAX_LISTED_PATH_LENGTH = 200;
|
|
123874
125077
|
var REWRITTEN_PUSH_REFUSAL = "This branch was changed on GitHub in a way CanopyCMS can't combine with the work here, so nothing was pushed. Nothing is lost.";
|
|
125078
|
+
var refusesPushAsRewritten = (branch) => branch.rewrittenOnGitHub !== void 0;
|
|
123875
125079
|
var SEEN_COMMIT_GONE_PUSH_REFUSAL = "A commit this branch had on GitHub is no longer there, so nothing was pushed. Nothing is lost.";
|
|
123876
125080
|
function rewriteCleared(branch) {
|
|
123877
125081
|
const reason = branch.syncFailureReason;
|
|
@@ -123908,7 +125112,7 @@ async function bringInGitHubCommits(ctx, args) {
|
|
|
123908
125112
|
const { branch } = metaFile;
|
|
123909
125113
|
if (branch.name !== branchRef) return { kind: "in-step" };
|
|
123910
125114
|
const gitHubTip = args.gitHub?.tips.get(branchRef);
|
|
123911
|
-
if (args.gitHub !== void 0 && gitHubTip === void 0 && branch
|
|
125115
|
+
if (args.gitHub !== void 0 && gitHubTip === void 0 && refusesPushAsRewritten(branch)) {
|
|
123912
125116
|
await clearRewritten(ctx, args);
|
|
123913
125117
|
}
|
|
123914
125118
|
if (!isPublished(metaFile)) return { kind: "in-step" };
|
|
@@ -123987,19 +125191,19 @@ async function pushedSinceFetch({ branchPath }, fetchedAt) {
|
|
|
123987
125191
|
return pushedAt !== void 0 && Date.parse(pushedAt) >= fetchedAt;
|
|
123988
125192
|
}
|
|
123989
125193
|
async function rewrittenFrom({ git, metaFile }, tip, head, published) {
|
|
123990
|
-
const { lastGitHubTip, historyRewrittenFrom } = metaFile.branch;
|
|
125194
|
+
const { lastGitHubTip, historyRewrittenFrom, rewrittenOnGitHub } = metaFile.branch;
|
|
123991
125195
|
const unrecorded = lastGitHubTip === void 0 && published !== null && published !== head && await contains(git, published, head) && !await contains(git, published, tip) ? published : void 0;
|
|
123992
|
-
const known = [historyRewrittenFrom, lastGitHubTip ?? unrecorded].filter(
|
|
125196
|
+
const known = [historyRewrittenFrom, lastGitHubTip ?? unrecorded, rewrittenOnGitHub].filter(
|
|
123993
125197
|
(sha) => sha !== void 0 && COMMIT_ID2.test(sha)
|
|
123994
125198
|
);
|
|
123995
|
-
if (known.length === 0) return null;
|
|
125199
|
+
if (known.length === 0 && rewrittenOnGitHub === void 0) return null;
|
|
123996
125200
|
if (await contains(git, tip, head) && (published === null || await contains(git, tip, published))) {
|
|
123997
125201
|
return null;
|
|
123998
125202
|
}
|
|
123999
125203
|
for (const sha of known) if (await contains(git, tip, sha)) return null;
|
|
124000
125204
|
const walked = await git.raw(["rev-list", "--count", "--end-of-options", tip]);
|
|
124001
125205
|
if (walked.trim() === "") throw new Error(`No answer reading the history of ${tip}`);
|
|
124002
|
-
return known[0];
|
|
125206
|
+
return known[0] ?? rewrittenOnGitHub ?? null;
|
|
124003
125207
|
}
|
|
124004
125208
|
async function blockAsRewritten(ctx, { branchPath, branchRef, metaFile }, lastSeen) {
|
|
124005
125209
|
if (metaFile.branch.rewrittenOnGitHub !== lastSeen) {
|
|
@@ -124010,7 +125214,7 @@ async function blockAsRewritten(ctx, { branchPath, branchRef, metaFile }, lastSe
|
|
|
124010
125214
|
}
|
|
124011
125215
|
return {
|
|
124012
125216
|
kind: "blocked",
|
|
124013
|
-
reason: `GitHub's ${branchRef} no longer contains ${lastSeen}, the last commit this deployment saw there: it was force-pushed or rewritten. Nothing was merged or pushed, so the rewrite stands, and this branch's changes cannot reach GitHub. To continue, a developer merges that commit back into the branch on GitHub.`
|
|
125217
|
+
reason: COMMIT_ID2.test(lastSeen) ? `GitHub's ${branchRef} no longer contains ${lastSeen}, the last commit this deployment saw there: it was force-pushed or rewritten. Nothing was merged or pushed, so the rewrite stands, and this branch's changes cannot reach GitHub. To continue, a developer merges that commit back into the branch on GitHub.` : `CanopyCMS can't confirm that GitHub's ${branchRef} holds this branch's commits, as its record of that branch was lost, so nothing was merged or pushed. To continue, a developer merges this branch's commits into the branch on GitHub. If they exist only here, delete the branch on GitHub instead: with no pull request recorded, the next sync clears this; with one, withdraw the branch once CanopyCMS has seen that pull request closed. A branch being edited with a pull request still recorded needs an admin to remove rewrittenOnGitHub from its branch.json by hand.`
|
|
124014
125218
|
};
|
|
124015
125219
|
}
|
|
124016
125220
|
async function clearRewritten(ctx, { branchPath, branchRef }) {
|
|
@@ -124314,8 +125518,8 @@ async function landed(ctx, {
|
|
|
124314
125518
|
await noteKeptOverGitHub(ctx, { branchPath, branchRef, metaFile }, landing.keptOverGitHub ?? []);
|
|
124315
125519
|
await store.update((now) => {
|
|
124316
125520
|
if (now?.landing?.mergeSha !== sha) return null;
|
|
124317
|
-
const { landing: _done, ...
|
|
124318
|
-
return
|
|
125521
|
+
const { landing: _done, ...rest2 } = now;
|
|
125522
|
+
return rest2;
|
|
124319
125523
|
});
|
|
124320
125524
|
}
|
|
124321
125525
|
async function noteKeptOverGitHub(ctx, {
|
|
@@ -124432,12 +125636,12 @@ async function reconcileMergeConflicts(ctx, {
|
|
|
124432
125636
|
const entries = (await store.update((now) => {
|
|
124433
125637
|
if (now === null) return null;
|
|
124434
125638
|
const kept = withoutMergesGone(now.entries, held);
|
|
124435
|
-
const { landing, ...
|
|
125639
|
+
const { landing, ...rest2 } = now;
|
|
124436
125640
|
const stays = landing !== void 0 && (branchRef === null || held(landing.mergeSha));
|
|
124437
125641
|
if (JSON.stringify(kept) === JSON.stringify(now.entries) && (stays || !landing)) {
|
|
124438
125642
|
return null;
|
|
124439
125643
|
}
|
|
124440
|
-
return { ...
|
|
125644
|
+
return { ...rest2, entries: kept, ...stays && { landing } };
|
|
124441
125645
|
}))?.entries ?? current2.entries;
|
|
124442
125646
|
await followRecord(ctx, branchPath, branchDir, branchRef, entries);
|
|
124443
125647
|
await applyRemaps(
|
|
@@ -124722,14 +125926,14 @@ async function executeTask(ctx, task, signal) {
|
|
|
124722
125926
|
const deletedPr = typeof payload3.pullRequestNumber === "number" ? payload3.pullRequestNumber : void 0;
|
|
124723
125927
|
const deletedPushedAt = typeof payload3.pushedToGitHubAt === "string" ? payload3.pushedToGitHubAt : void 0;
|
|
124724
125928
|
let live = null;
|
|
124725
|
-
let
|
|
125929
|
+
let unreadable2 = false;
|
|
124726
125930
|
try {
|
|
124727
125931
|
live = await BranchMetadataFileManager.loadOnly(ctx.branchWorkspacePath(branch));
|
|
124728
125932
|
} catch (err) {
|
|
124729
125933
|
if (!(err instanceof BranchMetadataCorruptError)) throw err;
|
|
124730
|
-
|
|
125934
|
+
unreadable2 = true;
|
|
124731
125935
|
}
|
|
124732
|
-
if (
|
|
125936
|
+
if (unreadable2) {
|
|
124733
125937
|
workerLog(
|
|
124734
125938
|
`Not deleting GitHub branch ${branch}: the branch now under that name is unreadable`
|
|
124735
125939
|
);
|
|
@@ -124970,9 +126174,9 @@ async function pushBranchToGitHub(ctx, branch, signal) {
|
|
|
124970
126174
|
});
|
|
124971
126175
|
const metaFile = await readMetadata();
|
|
124972
126176
|
const marker = metaFile?.branch.historyRewrittenFrom;
|
|
124973
|
-
if (metaFile
|
|
126177
|
+
if (metaFile && refusesPushAsRewritten(metaFile.branch)) {
|
|
124974
126178
|
workerLogWarn(
|
|
124975
|
-
`Not pushing ${branch}: GitHub's branch no longer contains ${metaFile.branch.rewrittenOnGitHub}`
|
|
126179
|
+
`Not pushing ${branch}: GitHub's branch no longer contains ${metaFile.branch.rewrittenOnGitHub || "a commit it held"}`
|
|
124976
126180
|
);
|
|
124977
126181
|
throw new PermanentTaskError(REWRITTEN_PUSH_REFUSAL);
|
|
124978
126182
|
}
|
|
@@ -126569,10 +127773,10 @@ async function conflictsStatusOf(branchRoot) {
|
|
|
126569
127773
|
}
|
|
126570
127774
|
async function setConflictsStatuses(ctx, githubTips) {
|
|
126571
127775
|
let due;
|
|
126572
|
-
let
|
|
127776
|
+
let unreadable2;
|
|
126573
127777
|
try {
|
|
126574
127778
|
;
|
|
126575
|
-
({ due, unreadable } = await dueStatuses(ctx, githubTips));
|
|
127779
|
+
({ due, unreadable: unreadable2 } = await dueStatuses(ctx, githubTips));
|
|
126576
127780
|
} catch (err) {
|
|
126577
127781
|
workerLogWarn(
|
|
126578
127782
|
`Could not read the branches' conflicts for their status: ${getErrorMessage(err)}`
|
|
@@ -126614,8 +127818,8 @@ async function setConflictsStatuses(ctx, githubTips) {
|
|
|
126614
127818
|
}
|
|
126615
127819
|
}
|
|
126616
127820
|
}
|
|
126617
|
-
for (const u5 of
|
|
126618
|
-
failure ??=
|
|
127821
|
+
for (const u5 of unreadable2) failed.push(u5.branch);
|
|
127822
|
+
failure ??= unreadable2[0] && { reason: "other", message: unreadable2[0].message };
|
|
126619
127823
|
if (!failure) return void 0;
|
|
126620
127824
|
return {
|
|
126621
127825
|
...failure,
|
|
@@ -126638,11 +127842,11 @@ async function dueStatuses(ctx, githubTips) {
|
|
|
126638
127842
|
}
|
|
126639
127843
|
const set = ctx.conflictsStatusesSet();
|
|
126640
127844
|
const due = [];
|
|
126641
|
-
const
|
|
127845
|
+
const unreadable2 = [];
|
|
126642
127846
|
const cannotRead = (branch, err) => {
|
|
126643
127847
|
const message2 = sanitizeErrorMessage(getErrorMessage(err));
|
|
126644
127848
|
workerLogWarn(`Could not read ${escapeForLog(branch)} for its conflicts status: ${message2}`);
|
|
126645
|
-
|
|
127849
|
+
unreadable2.push({ branch, message: message2 });
|
|
126646
127850
|
};
|
|
126647
127851
|
for (const entry of entries.sort((a9, b10) => a9.name.localeCompare(b10.name))) {
|
|
126648
127852
|
const dir = entry.name;
|
|
@@ -126682,7 +127886,7 @@ async function dueStatuses(ctx, githubTips) {
|
|
|
126682
127886
|
const key = JSON.stringify(status);
|
|
126683
127887
|
if (set.get(branch.name) !== key) due.push({ branch: branch.name, status, key });
|
|
126684
127888
|
}
|
|
126685
|
-
return { due, unreadable };
|
|
127889
|
+
return { due, unreadable: unreadable2 };
|
|
126686
127890
|
}
|
|
126687
127891
|
|
|
126688
127892
|
// ../canopycms/src/worker/git-sync.ts
|
|
@@ -130685,7 +131889,7 @@ var _MachineTokenVerificationError = class _MachineTokenVerificationError2 exten
|
|
|
130685
131889
|
this.action = action;
|
|
130686
131890
|
}
|
|
130687
131891
|
// Keep message unformatted, matching ClerkAPIResponseError's approach
|
|
130688
|
-
static formatMessage(
|
|
131892
|
+
static formatMessage(_name2, msg, _code, _docsUrl) {
|
|
130689
131893
|
return msg;
|
|
130690
131894
|
}
|
|
130691
131895
|
getFullMessage() {
|
|
@@ -130714,7 +131918,7 @@ var runtime = {
|
|
|
130714
131918
|
};
|
|
130715
131919
|
var base64url = {
|
|
130716
131920
|
parse(string3, opts) {
|
|
130717
|
-
return
|
|
131921
|
+
return parse6(string3, base64UrlEncoding, opts);
|
|
130718
131922
|
},
|
|
130719
131923
|
stringify(data4, opts) {
|
|
130720
131924
|
return stringify(data4, base64UrlEncoding, opts);
|
|
@@ -130724,7 +131928,7 @@ var base64UrlEncoding = {
|
|
|
130724
131928
|
chars: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
|
|
130725
131929
|
bits: 6
|
|
130726
131930
|
};
|
|
130727
|
-
function
|
|
131931
|
+
function parse6(string3, encoding, opts = {}) {
|
|
130728
131932
|
if (!encoding.codes) {
|
|
130729
131933
|
encoding.codes = {};
|
|
130730
131934
|
for (let i10 = 0; i10 < encoding.chars.length; ++i10) {
|
|
@@ -130962,8 +132166,8 @@ function importKey(key, algorithm, keyUsage) {
|
|
|
130962
132166
|
return runtime.crypto.subtle.importKey("jwk", key, algorithm, false, [keyUsage]);
|
|
130963
132167
|
}
|
|
130964
132168
|
const keyData = pemToBuffer(key);
|
|
130965
|
-
const
|
|
130966
|
-
return runtime.crypto.subtle.importKey(
|
|
132169
|
+
const format4 = keyUsage === "sign" ? "pkcs8" : "spki";
|
|
132170
|
+
return runtime.crypto.subtle.importKey(format4, keyData, algorithm, false, [keyUsage]);
|
|
130967
132171
|
}
|
|
130968
132172
|
var DEFAULT_CLOCK_SKEW_IN_MS = 5 * 1e3;
|
|
130969
132173
|
async function hasValidSignature(jwt, key) {
|
|
@@ -131780,8 +132984,8 @@ var require_dist5 = __commonJS3({
|
|
|
131780
132984
|
}
|
|
131781
132985
|
return cookieStrings.join("; ");
|
|
131782
132986
|
}
|
|
131783
|
-
function stringifySetCookie(
|
|
131784
|
-
const cookie = typeof
|
|
132987
|
+
function stringifySetCookie(_name2, _val, _opts) {
|
|
132988
|
+
const cookie = typeof _name2 === "object" ? _name2 : { ..._opts, name: _name2, value: String(_val) };
|
|
131785
132989
|
const options2 = typeof _val === "object" ? _val : _opts;
|
|
131786
132990
|
const enc = options2?.encode || encodeURIComponent;
|
|
131787
132991
|
if (!cookieNameRegExp.test(cookie.name)) {
|
|
@@ -133714,9 +134918,9 @@ var OrganizationAPI = class extends AbstractAPI {
|
|
|
133714
134918
|
*/
|
|
133715
134919
|
async updateOrganization(organizationId, params) {
|
|
133716
134920
|
this.requireId(organizationId);
|
|
133717
|
-
const { publicMetadata, privateMetadata, ...
|
|
134921
|
+
const { publicMetadata, privateMetadata, ...rest2 } = params;
|
|
133718
134922
|
const hasMetadata = publicMetadata !== void 0 || privateMetadata !== void 0;
|
|
133719
|
-
const hasRest = Object.keys(
|
|
134923
|
+
const hasRest = Object.keys(rest2).length > 0;
|
|
133720
134924
|
if (hasMetadata) {
|
|
133721
134925
|
deprecated(
|
|
133722
134926
|
"updateOrganization(organizationId, { publicMetadata | privateMetadata })",
|
|
@@ -133727,14 +134931,14 @@ var OrganizationAPI = class extends AbstractAPI {
|
|
|
133727
134931
|
return this.request({
|
|
133728
134932
|
method: "PATCH",
|
|
133729
134933
|
path: joinPaths(basePath20, organizationId),
|
|
133730
|
-
bodyParams:
|
|
134934
|
+
bodyParams: rest2
|
|
133731
134935
|
});
|
|
133732
134936
|
}
|
|
133733
134937
|
if (hasRest) {
|
|
133734
134938
|
await this.request({
|
|
133735
134939
|
method: "PATCH",
|
|
133736
134940
|
path: joinPaths(basePath20, organizationId),
|
|
133737
|
-
bodyParams:
|
|
134941
|
+
bodyParams: rest2
|
|
133738
134942
|
});
|
|
133739
134943
|
}
|
|
133740
134944
|
return this.request({
|
|
@@ -134632,9 +135836,9 @@ var UserAPI = class extends AbstractAPI {
|
|
|
134632
135836
|
*/
|
|
134633
135837
|
async updateUser(userId, params = {}) {
|
|
134634
135838
|
this.requireId(userId);
|
|
134635
|
-
const { publicMetadata, privateMetadata, unsafeMetadata, ...
|
|
135839
|
+
const { publicMetadata, privateMetadata, unsafeMetadata, ...rest2 } = params;
|
|
134636
135840
|
const hasMetadata = publicMetadata !== void 0 || privateMetadata !== void 0 || unsafeMetadata !== void 0;
|
|
134637
|
-
const hasRest = Object.keys(
|
|
135841
|
+
const hasRest = Object.keys(rest2).length > 0;
|
|
134638
135842
|
if (hasMetadata) {
|
|
134639
135843
|
deprecated(
|
|
134640
135844
|
"updateUser(userId, { publicMetadata | privateMetadata | unsafeMetadata })",
|
|
@@ -134645,14 +135849,14 @@ var UserAPI = class extends AbstractAPI {
|
|
|
134645
135849
|
return this.request({
|
|
134646
135850
|
method: "PATCH",
|
|
134647
135851
|
path: joinPaths(basePath33, userId),
|
|
134648
|
-
bodyParams:
|
|
135852
|
+
bodyParams: rest2
|
|
134649
135853
|
});
|
|
134650
135854
|
}
|
|
134651
135855
|
if (hasRest) {
|
|
134652
135856
|
await this.request({
|
|
134653
135857
|
method: "PATCH",
|
|
134654
135858
|
path: joinPaths(basePath33, userId),
|
|
134655
|
-
bodyParams:
|
|
135859
|
+
bodyParams: rest2
|
|
134656
135860
|
});
|
|
134657
135861
|
}
|
|
134658
135862
|
return this.request({
|
|
@@ -139121,14 +140325,14 @@ var TelemetryEventThrottler = class {
|
|
|
139121
140325
|
* This ensures that payloads with identical content in different orders produce the same key.
|
|
139122
140326
|
*/
|
|
139123
140327
|
#generateKey(event) {
|
|
139124
|
-
const { sk: _sk, pk: _pk, payload: payload3, ...
|
|
140328
|
+
const { sk: _sk, pk: _pk, payload: payload3, ...rest2 } = event;
|
|
139125
140329
|
const sanitizedEvent = {
|
|
139126
140330
|
...payload3,
|
|
139127
|
-
...
|
|
140331
|
+
...rest2
|
|
139128
140332
|
};
|
|
139129
140333
|
return JSON.stringify(Object.keys({
|
|
139130
140334
|
...payload3,
|
|
139131
|
-
...
|
|
140335
|
+
...rest2
|
|
139132
140336
|
}).sort().map((key) => sanitizedEvent[key]));
|
|
139133
140337
|
}
|
|
139134
140338
|
};
|
|
@@ -139446,11 +140650,17 @@ function clerkDisplayName(user) {
|
|
|
139446
140650
|
}
|
|
139447
140651
|
return void 0;
|
|
139448
140652
|
}
|
|
140653
|
+
function snakeCasePrimaryEmail(user) {
|
|
140654
|
+
const addresses = user.email_addresses ?? [];
|
|
140655
|
+
const primaryId = user.primary_email_address_id;
|
|
140656
|
+
if (!primaryId) return addresses[0]?.email_address;
|
|
140657
|
+
return addresses.find((address) => address.id === primaryId)?.email_address;
|
|
140658
|
+
}
|
|
139449
140659
|
function toUserSearchResult(user) {
|
|
139450
140660
|
return {
|
|
139451
140661
|
id: user.id,
|
|
139452
140662
|
name: clerkDisplayName(user) ?? "",
|
|
139453
|
-
email: user.primaryEmailAddress?.emailAddress ?? user
|
|
140663
|
+
email: user.primaryEmailAddress?.emailAddress ?? snakeCasePrimaryEmail(user) ?? "",
|
|
139454
140664
|
avatarUrl: user.imageUrl ?? user.image_url ?? void 0
|
|
139455
140665
|
};
|
|
139456
140666
|
}
|