@valbuild/shared 0.148.6 → 0.149.7
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/CHANGELOG.md +17 -0
- package/client/dist/valbuild-shared-client.cjs.dev.js +2 -1
- package/client/dist/valbuild-shared-client.cjs.prod.js +2 -1
- package/client/dist/valbuild-shared-client.esm.js +2 -1
- package/dist/acquireTypes-50960f2c.esm.js +1801 -0
- package/dist/acquireTypes-de10005d.cjs.dev.js +1815 -0
- package/dist/acquireTypes-e9467a2a.cjs.prod.js +1815 -0
- package/dist/createForOfIteratorHelper-3db5d737.esm.js +121 -0
- package/dist/createForOfIteratorHelper-90e6a8b6.cjs.prod.js +129 -0
- package/dist/createForOfIteratorHelper-d86bb352.cjs.dev.js +129 -0
- package/dist/declarations/src/internal/ApiRoutes.d.ts +3 -3
- package/dist/declarations/src/internal/index.d.ts +1 -0
- package/dist/declarations/src/internal/selfCheck.d.ts +51 -0
- package/dist/declarations/src/publish/buildProposal.d.ts +106 -0
- package/dist/declarations/src/publish/builder.d.ts +22 -0
- package/dist/declarations/src/publish/callJson.d.ts +21 -0
- package/dist/declarations/src/publish/index.d.ts +23 -0
- package/dist/declarations/src/publish/jobClient.d.ts +96 -0
- package/dist/declarations/src/publish/loadedLayer.d.ts +50 -0
- package/dist/declarations/src/publish/proposalProject.d.ts +2 -0
- package/dist/declarations/src/publish/publishClient.d.ts +95 -0
- package/dist/declarations/src/publish/runStudioDeploy.d.ts +244 -0
- package/dist/declarations/src/publish/runStudioJob.d.ts +102 -0
- package/dist/declarations/src/publish/runStudioPublish.d.ts +80 -0
- package/dist/declarations/src/typecheck/acquireTypes.d.ts +109 -0
- package/dist/declarations/src/typecheck/adeptSources.d.ts +9 -0
- package/dist/declarations/src/typecheck/index.d.ts +20 -0
- package/dist/declarations/src/typecheck/linkedFileSystem.d.ts +53 -0
- package/dist/declarations/src/typecheck/lockedVersions.d.ts +14 -0
- package/dist/declarations/src/typecheck/pnpmLayout.d.ts +95 -0
- package/dist/declarations/src/typecheck/pnpmLockfile.d.ts +57 -0
- package/dist/declarations/src/typecheck/proposalTypecheck.d.ts +76 -0
- package/dist/declarations/src/typecheck/testing/index.d.ts +6 -0
- package/dist/declarations/src/typecheck/testing/nodeModulesSources.d.ts +5 -0
- package/dist/declarations/src/typecheck/typecheckProject.d.ts +89 -0
- package/dist/declarations/src/typecheck/typescriptCompiler.d.ts +52 -0
- package/dist/{getSitemapTree-40d76bf8.cjs.prod.js → getSitemapTree-0fa0569c.cjs.dev.js} +5 -131
- package/dist/{getSitemapTree-cd006a36.esm.js → getSitemapTree-5afbc3ac.esm.js} +2 -121
- package/dist/{getSitemapTree-a7f2cc6d.cjs.dev.js → getSitemapTree-667bcb3c.cjs.prod.js} +5 -131
- package/dist/proposalProject-28550146.cjs.prod.js +18 -0
- package/dist/proposalProject-a3d3ad76.esm.js +16 -0
- package/dist/proposalProject-cdc53711.cjs.dev.js +18 -0
- package/dist/protocol-1c13de0d.cjs.prod.js +433 -0
- package/dist/protocol-3b9ef786.esm.js +413 -0
- package/dist/protocol-d8a6efda.cjs.dev.js +433 -0
- package/dist/slicedToArray-62e428df.cjs.dev.js +309 -0
- package/dist/slicedToArray-6cd80315.esm.js +299 -0
- package/dist/slicedToArray-af50e684.cjs.prod.js +309 -0
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +419 -888
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +419 -888
- package/internal/dist/valbuild-shared-internal.esm.js +236 -707
- package/package.json +28 -5
- package/publish/dist/valbuild-shared-publish.cjs.d.ts +2 -0
- package/publish/dist/valbuild-shared-publish.cjs.dev.js +2466 -0
- package/publish/dist/valbuild-shared-publish.cjs.js +7 -0
- package/publish/dist/valbuild-shared-publish.cjs.prod.js +2466 -0
- package/publish/dist/valbuild-shared-publish.esm.js +2428 -0
- package/publish/package.json +4 -0
- package/typecheck/dist/valbuild-shared-typecheck.cjs.d.ts +2 -0
- package/typecheck/dist/valbuild-shared-typecheck.cjs.dev.js +1173 -0
- package/typecheck/dist/valbuild-shared-typecheck.cjs.js +7 -0
- package/typecheck/dist/valbuild-shared-typecheck.cjs.prod.js +1173 -0
- package/typecheck/dist/valbuild-shared-typecheck.esm.js +1152 -0
- package/typecheck/package.json +4 -0
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.d.ts +2 -0
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.dev.js +202 -0
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.js +7 -0
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.prod.js +202 -0
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.esm.js +177 -0
- package/typecheck/testing/package.json +4 -0
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-d86bb352.cjs.dev.js');
|
|
6
6
|
var core = require('@valbuild/core');
|
|
7
|
+
var slicedToArray = require('../../dist/slicedToArray-62e428df.cjs.dev.js');
|
|
7
8
|
var zod = require('zod');
|
|
9
|
+
var protocol = require('../../dist/protocol-d8a6efda.cjs.dev.js');
|
|
8
10
|
var zodValidationError = require('zod-validation-error');
|
|
11
|
+
var getSitemapTree = require('../../dist/getSitemapTree-0fa0569c.cjs.dev.js');
|
|
9
12
|
var FlexSearch = require('flexsearch');
|
|
10
13
|
var utils = require('../../dist/utils-d3d8b4b5.cjs.dev.js');
|
|
11
14
|
|
|
@@ -17,7 +20,7 @@ function remirrorToRichTextSource(node, configDirectory, remoteOptions) {
|
|
|
17
20
|
var files = {};
|
|
18
21
|
var blocks = [];
|
|
19
22
|
var i = 0;
|
|
20
|
-
var _iterator =
|
|
23
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper((node === null || node === void 0 ? void 0 : node.content) || []),
|
|
21
24
|
_step;
|
|
22
25
|
try {
|
|
23
26
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -222,7 +225,7 @@ function convertImageNode(path, node, files, configDirectory, remoteOptions) {
|
|
|
222
225
|
// file is added as src (see below):
|
|
223
226
|
.concat("src");
|
|
224
227
|
var remoteFileHash = core.Internal.remote.hashToRemoteFileHash(fullFileHash);
|
|
225
|
-
var ref = remoteOptions ? core.Internal.remote.createRemoteRef(remoteOptions.remoteHost,
|
|
228
|
+
var ref = remoteOptions ? core.Internal.remote.createRemoteRef(remoteOptions.remoteHost, createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, remoteOptions), {}, {
|
|
226
229
|
fileHash: remoteFileHash,
|
|
227
230
|
validationHash: core.Internal.remote.getValidationHash(remoteOptions.coreVersion, remoteOptions.schema, mimeType, {
|
|
228
231
|
width: typeof node.attrs.width === "number" ? node.attrs.width : 0,
|
|
@@ -280,7 +283,7 @@ function convertImageNode(path, node, files, configDirectory, remoteOptions) {
|
|
|
280
283
|
}
|
|
281
284
|
var tag = {
|
|
282
285
|
tag: "img",
|
|
283
|
-
src:
|
|
286
|
+
src: createForOfIteratorHelper._objectSpread2({
|
|
284
287
|
path: noParamsUrl,
|
|
285
288
|
width: typeof node.attrs.width === "number" ? node.attrs.width : 0,
|
|
286
289
|
height: typeof node.attrs.height === "number" ? node.attrs.height : 0,
|
|
@@ -389,22 +392,6 @@ var RemirrorJSON = zod.z.object({
|
|
|
389
392
|
content: zod.z.array(zod.z.union([RemirrorParagraph, RemirrorHeading, RemirrorBulletList, RemirrorOrderedList]))
|
|
390
393
|
});
|
|
391
394
|
|
|
392
|
-
function _arrayWithoutHoles(r) {
|
|
393
|
-
if (Array.isArray(r)) return getSitemapTree._arrayLikeToArray(r);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
function _iterableToArray(r) {
|
|
397
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
function _nonIterableSpread() {
|
|
401
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function _toConsumableArray(r) {
|
|
405
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || getSitemapTree._unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
406
|
-
}
|
|
407
|
-
|
|
408
395
|
function richTextToRemirror(richtext) {
|
|
409
396
|
return {
|
|
410
397
|
type: "doc",
|
|
@@ -552,7 +539,7 @@ function convertLinkNodeToRemirror(linkNode) {
|
|
|
552
539
|
if (remirrorNode.type !== "text") {
|
|
553
540
|
return remirrorNode;
|
|
554
541
|
}
|
|
555
|
-
return
|
|
542
|
+
return createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, remirrorNode), {}, {
|
|
556
543
|
marks: (remirrorNode.marks || []).concat({
|
|
557
544
|
type: "link",
|
|
558
545
|
attrs: {
|
|
@@ -599,7 +586,7 @@ function convertListItemToRemirror(liNode) {
|
|
|
599
586
|
}
|
|
600
587
|
function convertListItemToRemirrorParagraph(rtChildren) {
|
|
601
588
|
var children = [];
|
|
602
|
-
var _iterator =
|
|
589
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(rtChildren),
|
|
603
590
|
_step;
|
|
604
591
|
try {
|
|
605
592
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -632,7 +619,7 @@ function convertListItemToRemirrorParagraph(rtChildren) {
|
|
|
632
619
|
var newChild = convertParagraphToRemirror(child.children);
|
|
633
620
|
if (lastChild.type === "paragraph" && newChild.type === "paragraph") {
|
|
634
621
|
if (newChild.content) {
|
|
635
|
-
lastChildContent.push.apply(lastChildContent, _toConsumableArray(newChild.content));
|
|
622
|
+
lastChildContent.push.apply(lastChildContent, slicedToArray._toConsumableArray(newChild.content));
|
|
636
623
|
} else {
|
|
637
624
|
// no content - skip
|
|
638
625
|
}
|
|
@@ -722,7 +709,7 @@ function concatModulePath(moduleFilePath, modulePath, key) {
|
|
|
722
709
|
function richTextImageSchema(schema) {
|
|
723
710
|
var _schema$options;
|
|
724
711
|
var img = (_schema$options = schema.options) === null || _schema$options === void 0 ? void 0 : _schema$options.img;
|
|
725
|
-
return
|
|
712
|
+
return createForOfIteratorHelper._typeof(img) === "object" && img !== null ? img : null;
|
|
726
713
|
}
|
|
727
714
|
|
|
728
715
|
/**
|
|
@@ -740,14 +727,14 @@ function forEachRichTextImage(path, source, visit) {
|
|
|
740
727
|
}
|
|
741
728
|
for (var index = 0; index < source.length; index++) {
|
|
742
729
|
var node = source[index];
|
|
743
|
-
if (
|
|
730
|
+
if (createForOfIteratorHelper._typeof(node) !== "object" || node === null || Array.isArray(node)) {
|
|
744
731
|
continue;
|
|
745
732
|
}
|
|
746
733
|
var nodePath = sourcePathOfChild(path, index);
|
|
747
734
|
if ("tag" in node && node.tag === "img" && "src" in node) {
|
|
748
735
|
var src = node.src;
|
|
749
|
-
if (
|
|
750
|
-
visit(sourcePathOfChild(nodePath, "src"),
|
|
736
|
+
if (createForOfIteratorHelper._typeof(src) === "object" && src !== null && !Array.isArray(src)) {
|
|
737
|
+
visit(sourcePathOfChild(nodePath, "src"), createForOfIteratorHelper._objectSpread2({}, src));
|
|
751
738
|
}
|
|
752
739
|
}
|
|
753
740
|
if ("children" in node) {
|
|
@@ -818,142 +805,6 @@ function memoizePerRequest(box, key, compute) {
|
|
|
818
805
|
return promise;
|
|
819
806
|
}
|
|
820
807
|
|
|
821
|
-
function _regeneratorDefine(e, r, n, t) {
|
|
822
|
-
var i = Object.defineProperty;
|
|
823
|
-
try {
|
|
824
|
-
i({}, "", {});
|
|
825
|
-
} catch (e) {
|
|
826
|
-
i = 0;
|
|
827
|
-
}
|
|
828
|
-
_regeneratorDefine = function (e, r, n, t) {
|
|
829
|
-
function o(r, n) {
|
|
830
|
-
_regeneratorDefine(e, r, function (e) {
|
|
831
|
-
return this._invoke(r, n, e);
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
r ? i ? i(e, r, {
|
|
835
|
-
value: n,
|
|
836
|
-
enumerable: !t,
|
|
837
|
-
configurable: !t,
|
|
838
|
-
writable: !t
|
|
839
|
-
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
840
|
-
}, _regeneratorDefine(e, r, n, t);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
function _regenerator() {
|
|
844
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
845
|
-
var e,
|
|
846
|
-
t,
|
|
847
|
-
r = "function" == typeof Symbol ? Symbol : {},
|
|
848
|
-
n = r.iterator || "@@iterator",
|
|
849
|
-
o = r.toStringTag || "@@toStringTag";
|
|
850
|
-
function i(r, n, o, i) {
|
|
851
|
-
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
852
|
-
u = Object.create(c.prototype);
|
|
853
|
-
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
854
|
-
var i,
|
|
855
|
-
c,
|
|
856
|
-
u,
|
|
857
|
-
f = 0,
|
|
858
|
-
p = o || [],
|
|
859
|
-
y = !1,
|
|
860
|
-
G = {
|
|
861
|
-
p: 0,
|
|
862
|
-
n: 0,
|
|
863
|
-
v: e,
|
|
864
|
-
a: d,
|
|
865
|
-
f: d.bind(e, 4),
|
|
866
|
-
d: function (t, r) {
|
|
867
|
-
return i = t, c = 0, u = e, G.n = r, a;
|
|
868
|
-
}
|
|
869
|
-
};
|
|
870
|
-
function d(r, n) {
|
|
871
|
-
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
872
|
-
var o,
|
|
873
|
-
i = p[t],
|
|
874
|
-
d = G.p,
|
|
875
|
-
l = i[2];
|
|
876
|
-
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
877
|
-
}
|
|
878
|
-
if (o || r > 1) return a;
|
|
879
|
-
throw y = !0, n;
|
|
880
|
-
}
|
|
881
|
-
return function (o, p, l) {
|
|
882
|
-
if (f > 1) throw TypeError("Generator is already running");
|
|
883
|
-
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
884
|
-
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
885
|
-
try {
|
|
886
|
-
if (f = 2, i) {
|
|
887
|
-
if (c || (o = "next"), t = i[o]) {
|
|
888
|
-
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
889
|
-
if (!t.done) return t;
|
|
890
|
-
u = t.value, c < 2 && (c = 0);
|
|
891
|
-
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
892
|
-
i = e;
|
|
893
|
-
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
894
|
-
} catch (t) {
|
|
895
|
-
i = e, c = 1, u = t;
|
|
896
|
-
} finally {
|
|
897
|
-
f = 1;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
return {
|
|
901
|
-
value: t,
|
|
902
|
-
done: y
|
|
903
|
-
};
|
|
904
|
-
};
|
|
905
|
-
}(r, o, i), !0), u;
|
|
906
|
-
}
|
|
907
|
-
var a = {};
|
|
908
|
-
function Generator() {}
|
|
909
|
-
function GeneratorFunction() {}
|
|
910
|
-
function GeneratorFunctionPrototype() {}
|
|
911
|
-
t = Object.getPrototypeOf;
|
|
912
|
-
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
913
|
-
return this;
|
|
914
|
-
}), t),
|
|
915
|
-
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
916
|
-
function f(e) {
|
|
917
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
918
|
-
}
|
|
919
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
920
|
-
return this;
|
|
921
|
-
}), _regeneratorDefine(u, "toString", function () {
|
|
922
|
-
return "[object Generator]";
|
|
923
|
-
}), (_regenerator = function () {
|
|
924
|
-
return {
|
|
925
|
-
w: i,
|
|
926
|
-
m: f
|
|
927
|
-
};
|
|
928
|
-
})();
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
932
|
-
try {
|
|
933
|
-
var i = n[a](c),
|
|
934
|
-
u = i.value;
|
|
935
|
-
} catch (n) {
|
|
936
|
-
return void e(n);
|
|
937
|
-
}
|
|
938
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
939
|
-
}
|
|
940
|
-
function _asyncToGenerator(n) {
|
|
941
|
-
return function () {
|
|
942
|
-
var t = this,
|
|
943
|
-
e = arguments;
|
|
944
|
-
return new Promise(function (r, o) {
|
|
945
|
-
var a = n.apply(t, e);
|
|
946
|
-
function _next(n) {
|
|
947
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
948
|
-
}
|
|
949
|
-
function _throw(n) {
|
|
950
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
951
|
-
}
|
|
952
|
-
_next(void 0);
|
|
953
|
-
});
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
|
|
957
808
|
/**
|
|
958
809
|
* JSON, recursively — the shape of a Source over the wire.
|
|
959
810
|
*
|
|
@@ -1058,28 +909,6 @@ var SourcePath = zod.z.string().transform(function (path) {
|
|
|
1058
909
|
return path;
|
|
1059
910
|
});
|
|
1060
911
|
|
|
1061
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
1062
|
-
if (null == r) return {};
|
|
1063
|
-
var t = {};
|
|
1064
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
1065
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
1066
|
-
t[n] = r[n];
|
|
1067
|
-
}
|
|
1068
|
-
return t;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
function _objectWithoutProperties(e, t) {
|
|
1072
|
-
if (null == e) return {};
|
|
1073
|
-
var o,
|
|
1074
|
-
r,
|
|
1075
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
1076
|
-
if (Object.getOwnPropertySymbols) {
|
|
1077
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
1078
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
1079
|
-
}
|
|
1080
|
-
return i;
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
912
|
var ModuleFilePath$1 = zod.z.string().transform(function (path) {
|
|
1084
913
|
return path;
|
|
1085
914
|
});
|
|
@@ -1128,7 +957,7 @@ var commonSchemaFields = {
|
|
|
1128
957
|
hidden: zod.z["boolean"]().optional(),
|
|
1129
958
|
description: zod.z.string().optional()
|
|
1130
959
|
};
|
|
1131
|
-
var SerializedStringSchema = zod.z.object(
|
|
960
|
+
var SerializedStringSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1132
961
|
type: zod.z.literal("string"),
|
|
1133
962
|
// `.multiline()`. Stripped like any undeclared key if it goes missing here,
|
|
1134
963
|
// which is a single-line input where the author asked for a text box.
|
|
@@ -1150,16 +979,16 @@ var SerializedStringSchema = zod.z.object(getSitemapTree._objectSpread2(getSitem
|
|
|
1150
979
|
opt: zod.z["boolean"](),
|
|
1151
980
|
raw: zod.z["boolean"]()
|
|
1152
981
|
}));
|
|
1153
|
-
var SerializedLiteralSchema = zod.z.object(
|
|
982
|
+
var SerializedLiteralSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1154
983
|
type: zod.z.literal("literal"),
|
|
1155
984
|
value: zod.z.string(),
|
|
1156
985
|
opt: zod.z["boolean"]()
|
|
1157
986
|
}));
|
|
1158
|
-
var SerializedBooleanSchema = zod.z.object(
|
|
987
|
+
var SerializedBooleanSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1159
988
|
type: zod.z.literal("boolean"),
|
|
1160
989
|
opt: zod.z["boolean"]()
|
|
1161
990
|
}));
|
|
1162
|
-
var SerializedNumberSchema = zod.z.object(
|
|
991
|
+
var SerializedNumberSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1163
992
|
type: zod.z.literal("number"),
|
|
1164
993
|
options: zod.z.object({
|
|
1165
994
|
max: zod.z.number().optional(),
|
|
@@ -1171,14 +1000,14 @@ var SerializedNumberSchema = zod.z.object(getSitemapTree._objectSpread2(getSitem
|
|
|
1171
1000
|
opt: zod.z["boolean"]()
|
|
1172
1001
|
}));
|
|
1173
1002
|
var SerializedObjectSchema = zod.z.lazy(function () {
|
|
1174
|
-
return zod.z.object(
|
|
1003
|
+
return zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1175
1004
|
type: zod.z.literal("object"),
|
|
1176
1005
|
items: zod.z.record(zod.z.string(), SerializedSchema),
|
|
1177
1006
|
opt: zod.z["boolean"]()
|
|
1178
1007
|
}));
|
|
1179
1008
|
});
|
|
1180
1009
|
var SerializedArraySchema = zod.z.lazy(function () {
|
|
1181
|
-
return zod.z.object(
|
|
1010
|
+
return zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1182
1011
|
render: FieldRender,
|
|
1183
1012
|
type: zod.z.literal("array"),
|
|
1184
1013
|
item: SerializedSchema,
|
|
@@ -1186,14 +1015,14 @@ var SerializedArraySchema = zod.z.lazy(function () {
|
|
|
1186
1015
|
}));
|
|
1187
1016
|
});
|
|
1188
1017
|
var SerializedDiscriminatedUnionSchema = zod.z.lazy(function () {
|
|
1189
|
-
return zod.z.object(
|
|
1018
|
+
return zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1190
1019
|
type: zod.z.literal("discriminated-union"),
|
|
1191
1020
|
key: zod.z.string(),
|
|
1192
1021
|
items: zod.z.array(SerializedObjectSchema),
|
|
1193
1022
|
opt: zod.z["boolean"]()
|
|
1194
1023
|
}));
|
|
1195
1024
|
});
|
|
1196
|
-
var SerializedEnumSchema = zod.z.object(
|
|
1025
|
+
var SerializedEnumSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1197
1026
|
type: zod.z.literal("enum"),
|
|
1198
1027
|
values: zod.z.array(zod.z.string()),
|
|
1199
1028
|
locales: zod.z.record(zod.z.string(), zod.z.string()).optional(),
|
|
@@ -1220,13 +1049,13 @@ var ImageEncodeOption = zod.z.union([zod.z.literal(false), zod.z.object({
|
|
|
1220
1049
|
* not happen) keeps the current key.
|
|
1221
1050
|
*/
|
|
1222
1051
|
var readLegacyDirectoryAsDir = function readLegacyDirectoryAsDir(value) {
|
|
1223
|
-
if (!value ||
|
|
1052
|
+
if (!value || createForOfIteratorHelper._typeof(value) !== "object" || Array.isArray(value) || !("directory" in value) || "dir" in value) {
|
|
1224
1053
|
return value;
|
|
1225
1054
|
}
|
|
1226
1055
|
var _ref = value,
|
|
1227
1056
|
directory = _ref.directory,
|
|
1228
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
1229
|
-
return
|
|
1057
|
+
rest = protocol._objectWithoutProperties(_ref, _excluded);
|
|
1058
|
+
return createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, rest), {}, {
|
|
1230
1059
|
dir: directory
|
|
1231
1060
|
});
|
|
1232
1061
|
};
|
|
@@ -1235,7 +1064,7 @@ var ImageOptions = zod.z.preprocess(readLegacyDirectoryAsDir, zod.z.object({
|
|
|
1235
1064
|
accept: zod.z.string().optional(),
|
|
1236
1065
|
encode: ImageEncodeOption.optional()
|
|
1237
1066
|
}));
|
|
1238
|
-
var SerializedImageSchema = zod.z.object(
|
|
1067
|
+
var SerializedImageSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1239
1068
|
type: zod.z.literal("image"),
|
|
1240
1069
|
options: ImageOptions.optional(),
|
|
1241
1070
|
opt: zod.z["boolean"](),
|
|
@@ -1267,13 +1096,13 @@ var RichTextOptions = zod.z.lazy(function () {
|
|
|
1267
1096
|
img: zod.z.union([zod.z["boolean"](), SerializedImageSchema]).optional()
|
|
1268
1097
|
});
|
|
1269
1098
|
});
|
|
1270
|
-
var SerializedRichTextSchema = zod.z.object(
|
|
1099
|
+
var SerializedRichTextSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1271
1100
|
type: zod.z.literal("richtext"),
|
|
1272
1101
|
options: RichTextOptions.optional(),
|
|
1273
1102
|
opt: zod.z["boolean"]()
|
|
1274
1103
|
}));
|
|
1275
1104
|
var SerializedRecordSchema = zod.z.lazy(function () {
|
|
1276
|
-
return zod.z.preprocess(readLegacyDirectoryAsDir, zod.z.object(
|
|
1105
|
+
return zod.z.preprocess(readLegacyDirectoryAsDir, zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1277
1106
|
render: FieldRender,
|
|
1278
1107
|
type: zod.z.literal("record"),
|
|
1279
1108
|
item: SerializedSchema,
|
|
@@ -1294,7 +1123,7 @@ var SerializedRecordSchema = zod.z.lazy(function () {
|
|
|
1294
1123
|
})).passthrough());
|
|
1295
1124
|
});
|
|
1296
1125
|
var SerializedKeyOfSchema = zod.z.lazy(function () {
|
|
1297
|
-
return zod.z.object(
|
|
1126
|
+
return zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1298
1127
|
render: FieldRender,
|
|
1299
1128
|
type: zod.z.literal("keyOf"),
|
|
1300
1129
|
path: SourcePath,
|
|
@@ -1313,7 +1142,7 @@ var SerializedKeyOfSchema = zod.z.lazy(function () {
|
|
|
1313
1142
|
var FileOptions = zod.z.object({
|
|
1314
1143
|
accept: zod.z.string().optional()
|
|
1315
1144
|
});
|
|
1316
|
-
var SerializedFileSchema = zod.z.object(
|
|
1145
|
+
var SerializedFileSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1317
1146
|
type: zod.z.literal("file"),
|
|
1318
1147
|
options: FileOptions.optional(),
|
|
1319
1148
|
opt: zod.z["boolean"](),
|
|
@@ -1337,7 +1166,7 @@ var VideoOptions = zod.z.object({
|
|
|
1337
1166
|
accept: zod.z.string().optional(),
|
|
1338
1167
|
stream: VideoStreamOption.optional()
|
|
1339
1168
|
});
|
|
1340
|
-
var SerializedVideoSchema = zod.z.object(
|
|
1169
|
+
var SerializedVideoSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1341
1170
|
type: zod.z.literal("video"),
|
|
1342
1171
|
options: VideoOptions.optional(),
|
|
1343
1172
|
opt: zod.z["boolean"](),
|
|
@@ -1349,12 +1178,12 @@ var DateOptions = zod.z.object({
|
|
|
1349
1178
|
from: zod.z.string().optional(),
|
|
1350
1179
|
to: zod.z.string().optional()
|
|
1351
1180
|
});
|
|
1352
|
-
var SerializedDateSchema = zod.z.object(
|
|
1181
|
+
var SerializedDateSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1353
1182
|
type: zod.z.literal("date"),
|
|
1354
1183
|
options: DateOptions.optional(),
|
|
1355
1184
|
opt: zod.z["boolean"]()
|
|
1356
1185
|
}));
|
|
1357
|
-
var SerializedDateTimeSchema = zod.z.object(
|
|
1186
|
+
var SerializedDateTimeSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1358
1187
|
type: zod.z.literal("dateTime"),
|
|
1359
1188
|
options: DateOptions.optional(),
|
|
1360
1189
|
opt: zod.z["boolean"]()
|
|
@@ -1363,7 +1192,7 @@ var ColorOptions = zod.z.object({
|
|
|
1363
1192
|
format: zod.z["enum"](["hex", "rgb", "hsl", "oklch"]).optional(),
|
|
1364
1193
|
alpha: zod.z["boolean"]().optional()
|
|
1365
1194
|
});
|
|
1366
|
-
var SerializedColorSchema = zod.z.object(
|
|
1195
|
+
var SerializedColorSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1367
1196
|
type: zod.z.literal("color"),
|
|
1368
1197
|
options: ColorOptions.optional(),
|
|
1369
1198
|
opt: zod.z["boolean"]()
|
|
@@ -1371,7 +1200,7 @@ var SerializedColorSchema = zod.z.object(getSitemapTree._objectSpread2(getSitema
|
|
|
1371
1200
|
var CodeOptions = zod.z.object({
|
|
1372
1201
|
language: zod.z["enum"](core.CODE_LANGUAGES).optional()
|
|
1373
1202
|
});
|
|
1374
|
-
var SerializedCodeSchema = zod.z.object(
|
|
1203
|
+
var SerializedCodeSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1375
1204
|
type: zod.z.literal("code"),
|
|
1376
1205
|
options: CodeOptions.optional(),
|
|
1377
1206
|
opt: zod.z["boolean"]()
|
|
@@ -1385,7 +1214,7 @@ var SerializedLocaleSchema = zod.z.object({
|
|
|
1385
1214
|
hidden: zod.z["boolean"]().optional(),
|
|
1386
1215
|
description: zod.z.string().optional()
|
|
1387
1216
|
});
|
|
1388
|
-
var SerializedRouteSchema = zod.z.object(
|
|
1217
|
+
var SerializedRouteSchema = zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1389
1218
|
type: zod.z.literal("route"),
|
|
1390
1219
|
options: zod.z.object({
|
|
1391
1220
|
include: zod.z.object({
|
|
@@ -1407,7 +1236,7 @@ var SerializedRouteSchema = zod.z.object(getSitemapTree._objectSpread2(getSitema
|
|
|
1407
1236
|
// (see core/src/schema/settings.ts), but they are accepted here because they
|
|
1408
1237
|
// are part of the declared type.
|
|
1409
1238
|
var SerializedSettingsSchema = zod.z.lazy(function () {
|
|
1410
|
-
return zod.z.object(
|
|
1239
|
+
return zod.z.object(createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, commonSchemaFields), {}, {
|
|
1411
1240
|
type: zod.z.literal("settings"),
|
|
1412
1241
|
items: zod.z.record(zod.z.string(), SerializedSchema),
|
|
1413
1242
|
opt: zod.z["boolean"](),
|
|
@@ -1680,8 +1509,8 @@ function adminProxyEndpoint() {
|
|
|
1680
1509
|
req: {
|
|
1681
1510
|
path: zod.z.string(),
|
|
1682
1511
|
rawQuery: zod.z.string(),
|
|
1683
|
-
headers:
|
|
1684
|
-
cookies:
|
|
1512
|
+
headers: createForOfIteratorHelper._defineProperty({}, VAL_STUDIO_HEADER, zod.z.string().optional()),
|
|
1513
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional()),
|
|
1685
1514
|
body: zod.z.unknown()
|
|
1686
1515
|
},
|
|
1687
1516
|
res: AdminProxyResponse
|
|
@@ -1831,7 +1660,7 @@ var Api = {
|
|
|
1831
1660
|
query: {
|
|
1832
1661
|
redirect_to: onlyOneStringQueryParam.optional()
|
|
1833
1662
|
},
|
|
1834
|
-
cookies:
|
|
1663
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
1835
1664
|
},
|
|
1836
1665
|
res: zod.z.union([zod.z.object({
|
|
1837
1666
|
status: zod.z.literal(401),
|
|
@@ -1853,7 +1682,7 @@ var Api = {
|
|
|
1853
1682
|
query: {
|
|
1854
1683
|
redirect_to: onlyOneStringQueryParam.optional()
|
|
1855
1684
|
},
|
|
1856
|
-
cookies:
|
|
1685
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
1857
1686
|
},
|
|
1858
1687
|
res: zod.z.union([zod.z.object({
|
|
1859
1688
|
status: zod.z.literal(401),
|
|
@@ -1893,7 +1722,7 @@ var Api = {
|
|
|
1893
1722
|
"/draft/stat": {
|
|
1894
1723
|
GET: {
|
|
1895
1724
|
req: {
|
|
1896
|
-
cookies:
|
|
1725
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
1897
1726
|
},
|
|
1898
1727
|
res: zod.z.union([zod.z.object({
|
|
1899
1728
|
status: zod.z.literal(401),
|
|
@@ -1912,7 +1741,7 @@ var Api = {
|
|
|
1912
1741
|
query: {
|
|
1913
1742
|
redirect_to: onlyOneStringQueryParam.optional()
|
|
1914
1743
|
},
|
|
1915
|
-
cookies:
|
|
1744
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
1916
1745
|
},
|
|
1917
1746
|
res: zod.z.union([zod.z.object({
|
|
1918
1747
|
status: zod.z.literal(401),
|
|
@@ -1920,7 +1749,7 @@ var Api = {
|
|
|
1920
1749
|
}), zod.z.object({
|
|
1921
1750
|
status: zod.z.literal(302),
|
|
1922
1751
|
redirectTo: zod.z.string(),
|
|
1923
|
-
cookies: zod.z.object(
|
|
1752
|
+
cookies: zod.z.object(createForOfIteratorHelper._defineProperty(createForOfIteratorHelper._defineProperty({}, VAL_ENABLE_COOKIE_NAME, enableCookieValue), VAL_STATE_COOKIE, zod.z.object({
|
|
1924
1753
|
value: zod.z.string(),
|
|
1925
1754
|
options: zod.z.object({
|
|
1926
1755
|
httpOnly: zod.z.literal(true),
|
|
@@ -1931,7 +1760,7 @@ var Api = {
|
|
|
1931
1760
|
}), zod.z.object({
|
|
1932
1761
|
status: zod.z.literal(302),
|
|
1933
1762
|
redirectTo: zod.z.string(),
|
|
1934
|
-
cookies: zod.z.object(
|
|
1763
|
+
cookies: zod.z.object(createForOfIteratorHelper._defineProperty({}, VAL_ENABLE_COOKIE_NAME, enableCookieValue))
|
|
1935
1764
|
}), zod.z.object({
|
|
1936
1765
|
status: zod.z.literal(400),
|
|
1937
1766
|
json: zod.z.object({
|
|
@@ -1946,7 +1775,7 @@ var Api = {
|
|
|
1946
1775
|
query: {
|
|
1947
1776
|
redirect_to: onlyOneStringQueryParam.optional()
|
|
1948
1777
|
},
|
|
1949
|
-
cookies:
|
|
1778
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
1950
1779
|
},
|
|
1951
1780
|
res: zod.z.union([zod.z.object({
|
|
1952
1781
|
status: zod.z.literal(401),
|
|
@@ -1954,7 +1783,7 @@ var Api = {
|
|
|
1954
1783
|
}), zod.z.object({
|
|
1955
1784
|
status: zod.z.literal(302),
|
|
1956
1785
|
redirectTo: zod.z.string(),
|
|
1957
|
-
cookies: zod.z.object(
|
|
1786
|
+
cookies: zod.z.object(createForOfIteratorHelper._defineProperty({}, VAL_ENABLE_COOKIE_NAME, zod.z.object({
|
|
1958
1787
|
value: zod.z.literal("false")
|
|
1959
1788
|
})))
|
|
1960
1789
|
}), zod.z.object({
|
|
@@ -1975,7 +1804,7 @@ var Api = {
|
|
|
1975
1804
|
res: zod.z.union([zod.z.object({
|
|
1976
1805
|
status: zod.z.literal(302),
|
|
1977
1806
|
redirectTo: zod.z.string(),
|
|
1978
|
-
cookies: zod.z.object(
|
|
1807
|
+
cookies: zod.z.object(createForOfIteratorHelper._defineProperty(createForOfIteratorHelper._defineProperty({}, VAL_ENABLE_COOKIE_NAME, enableCookieValue), VAL_STATE_COOKIE, zod.z.object({
|
|
1979
1808
|
value: zod.z.string(),
|
|
1980
1809
|
options: zod.z.object({
|
|
1981
1810
|
httpOnly: zod.z.literal(true),
|
|
@@ -1998,12 +1827,12 @@ var Api = {
|
|
|
1998
1827
|
code: onlyOneStringQueryParam.optional(),
|
|
1999
1828
|
state: onlyOneStringQueryParam.optional()
|
|
2000
1829
|
},
|
|
2001
|
-
cookies:
|
|
1830
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_STATE_COOKIE, zod.z.string())
|
|
2002
1831
|
},
|
|
2003
1832
|
res: zod.z.object({
|
|
2004
1833
|
status: zod.z.literal(302),
|
|
2005
1834
|
redirectTo: zod.z.string(),
|
|
2006
|
-
cookies: zod.z.object(
|
|
1835
|
+
cookies: zod.z.object(createForOfIteratorHelper._defineProperty(createForOfIteratorHelper._defineProperty(createForOfIteratorHelper._defineProperty({}, VAL_STATE_COOKIE, zod.z.object({
|
|
2007
1836
|
value: zod.z.literal(null)
|
|
2008
1837
|
})), VAL_ENABLE_COOKIE_NAME, enableCookieValue.optional()), VAL_SESSION_COOKIE, zod.z.object({
|
|
2009
1838
|
value: zod.z.string(),
|
|
@@ -2028,7 +1857,7 @@ var Api = {
|
|
|
2028
1857
|
// TODO fix req types
|
|
2029
1858
|
res: zod.z.union([zod.z.object({
|
|
2030
1859
|
status: zod.z.literal(200),
|
|
2031
|
-
cookies: zod.z.object(
|
|
1860
|
+
cookies: zod.z.object(createForOfIteratorHelper._defineProperty(createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.object({
|
|
2032
1861
|
value: zod.z.string(),
|
|
2033
1862
|
options: zod.z.object({
|
|
2034
1863
|
httpOnly: zod.z.literal(true),
|
|
@@ -2050,7 +1879,7 @@ var Api = {
|
|
|
2050
1879
|
}), zod.z.object({
|
|
2051
1880
|
status: zod.z.literal(302),
|
|
2052
1881
|
redirectTo: zod.z.string(),
|
|
2053
|
-
cookies: zod.z.object(
|
|
1882
|
+
cookies: zod.z.object(createForOfIteratorHelper._defineProperty(createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.object({
|
|
2054
1883
|
value: zod.z.string(),
|
|
2055
1884
|
options: zod.z.object({
|
|
2056
1885
|
httpOnly: zod.z.literal(true),
|
|
@@ -3548,7 +3377,7 @@ var Api = {
|
|
|
3548
3377
|
}, "limit must be between 1 and ".concat(JSON_ENTRIES_BATCH_MAX)).optional(),
|
|
3549
3378
|
apply_patches: onlyOneBooleanQueryParam.optional()
|
|
3550
3379
|
},
|
|
3551
|
-
cookies:
|
|
3380
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3552
3381
|
},
|
|
3553
3382
|
res: zod.z.union([unauthorizedResponse, notFoundResponse,
|
|
3554
3383
|
// Shape (1): single `key`.
|
|
@@ -3595,7 +3424,7 @@ var Api = {
|
|
|
3595
3424
|
"/ai/initialize": {
|
|
3596
3425
|
POST: {
|
|
3597
3426
|
req: {
|
|
3598
|
-
cookies:
|
|
3427
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3599
3428
|
},
|
|
3600
3429
|
res: zod.z.union([unauthorizedResponse, zod.z.object({
|
|
3601
3430
|
status: zod.z.literal(200),
|
|
@@ -3652,7 +3481,7 @@ var Api = {
|
|
|
3652
3481
|
cursor_updatedAt: onlyOneStringQueryParam.optional(),
|
|
3653
3482
|
cursor_id: onlyOneStringQueryParam.optional()
|
|
3654
3483
|
},
|
|
3655
|
-
cookies:
|
|
3484
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3656
3485
|
},
|
|
3657
3486
|
res: zod.z.union([unauthorizedResponse, zod.z.object({
|
|
3658
3487
|
status: zod.z.literal(200),
|
|
@@ -3679,7 +3508,7 @@ var Api = {
|
|
|
3679
3508
|
body: zod.z.object({
|
|
3680
3509
|
name: zod.z.string()
|
|
3681
3510
|
}),
|
|
3682
|
-
cookies:
|
|
3511
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3683
3512
|
},
|
|
3684
3513
|
res: zod.z.union([unauthorizedResponse, zod.z.object({
|
|
3685
3514
|
status: zod.z.literal(200),
|
|
@@ -3699,7 +3528,7 @@ var Api = {
|
|
|
3699
3528
|
cursor_updatedAt: onlyOneStringQueryParam.optional(),
|
|
3700
3529
|
cursor_id: onlyOneStringQueryParam.optional()
|
|
3701
3530
|
},
|
|
3702
|
-
cookies:
|
|
3531
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3703
3532
|
},
|
|
3704
3533
|
res: zod.z.union([unauthorizedResponse, zod.z.object({
|
|
3705
3534
|
status: zod.z.literal(200),
|
|
@@ -3737,7 +3566,7 @@ var Api = {
|
|
|
3737
3566
|
isRemote: zod.z["boolean"]().optional()
|
|
3738
3567
|
})).min(1)
|
|
3739
3568
|
}),
|
|
3740
|
-
cookies:
|
|
3569
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3741
3570
|
},
|
|
3742
3571
|
res: zod.z.union([unauthorizedResponse, zod.z.object({
|
|
3743
3572
|
status: zod.z.literal(200),
|
|
@@ -3774,7 +3603,7 @@ var Api = {
|
|
|
3774
3603
|
metadata: zod.z.any(),
|
|
3775
3604
|
contentType: zod.z.string()
|
|
3776
3605
|
}),
|
|
3777
|
-
cookies:
|
|
3606
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3778
3607
|
},
|
|
3779
3608
|
res: zod.z.union([unauthorizedResponse, zod.z.object({
|
|
3780
3609
|
status: zod.z.literal(200),
|
|
@@ -3809,7 +3638,7 @@ var Api = {
|
|
|
3809
3638
|
"/admin/status": {
|
|
3810
3639
|
GET: {
|
|
3811
3640
|
req: {
|
|
3812
|
-
cookies:
|
|
3641
|
+
cookies: createForOfIteratorHelper._defineProperty({}, VAL_SESSION_COOKIE, zod.z.string().optional())
|
|
3813
3642
|
},
|
|
3814
3643
|
res: zod.z.object({
|
|
3815
3644
|
status: zod.z.literal(200),
|
|
@@ -3871,7 +3700,7 @@ var Api = {
|
|
|
3871
3700
|
*/
|
|
3872
3701
|
var MAX_DETAILS_LENGTH = 500;
|
|
3873
3702
|
function getErrorMessageFromUnknownJson(json, fallback) {
|
|
3874
|
-
if (
|
|
3703
|
+
if (createForOfIteratorHelper._typeof(json) === "object" && json !== null && "message" in json && typeof json.message === "string") {
|
|
3875
3704
|
var details = detailsOf(json);
|
|
3876
3705
|
if (details === null || details === json.message) {
|
|
3877
3706
|
return json.message;
|
|
@@ -3924,10 +3753,10 @@ var createValClient = function createValClient(host, config, options) {
|
|
|
3924
3753
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3925
3754
|
var anyApi = Api;
|
|
3926
3755
|
return /*#__PURE__*/function () {
|
|
3927
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(path, method, req) {
|
|
3756
|
+
var _ref = slicedToArray._asyncToGenerator(/*#__PURE__*/slicedToArray._regenerator().m(function _callee2(path, method, req) {
|
|
3928
3757
|
var _anyApi$path, _apiEndpoint$req$body;
|
|
3929
3758
|
var anyReq, fullPath, params, _i, _Object$keys, _anyReq$query, key, _anyReq$query2, _iterator, _step, value, _anyReq$query3, _anyReq$query4, apiEndpoint, reqBodyResult, res, _t;
|
|
3930
|
-
return _regenerator().w(function (_context2) {
|
|
3759
|
+
return slicedToArray._regenerator().w(function (_context2) {
|
|
3931
3760
|
while (1) switch (_context2.p = _context2.n) {
|
|
3932
3761
|
case 0:
|
|
3933
3762
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3941,7 +3770,7 @@ var createValClient = function createValClient(host, config, options) {
|
|
|
3941
3770
|
for (_i = 0, _Object$keys = Object.keys(anyReq.query); _i < _Object$keys.length; _i++) {
|
|
3942
3771
|
key = _Object$keys[_i];
|
|
3943
3772
|
if (Array.isArray((_anyReq$query = anyReq.query) === null || _anyReq$query === void 0 ? void 0 : _anyReq$query[key])) {
|
|
3944
|
-
_iterator =
|
|
3773
|
+
_iterator = createForOfIteratorHelper._createForOfIteratorHelper(((_anyReq$query2 = anyReq.query) === null || _anyReq$query2 === void 0 ? void 0 : _anyReq$query2[key]) || []);
|
|
3945
3774
|
try {
|
|
3946
3775
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
3947
3776
|
value = _step.value;
|
|
@@ -4018,10 +3847,10 @@ var createValClient = function createValClient(host, config, options) {
|
|
|
4018
3847
|
},
|
|
4019
3848
|
body: anyReq.body !== undefined ? JSON.stringify(anyReq.body) : undefined
|
|
4020
3849
|
}).then(/*#__PURE__*/function () {
|
|
4021
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(res) {
|
|
3850
|
+
var _ref2 = slicedToArray._asyncToGenerator(/*#__PURE__*/slicedToArray._regenerator().m(function _callee(res) {
|
|
4022
3851
|
var _apiEndpoint$res;
|
|
4023
3852
|
var contentTypeHeaders, json, valClientResult, message, responseResult;
|
|
4024
|
-
return _regenerator().w(function (_context) {
|
|
3853
|
+
return slicedToArray._regenerator().w(function (_context) {
|
|
4025
3854
|
while (1) switch (_context.n) {
|
|
4026
3855
|
case 0:
|
|
4027
3856
|
contentTypeHeaders = res.headers.get("content-type");
|
|
@@ -4220,52 +4049,12 @@ function getValDemo() {
|
|
|
4220
4049
|
return (_globalThis$__VAL_DEM = globalThis.__VAL_DEMO__) !== null && _globalThis$__VAL_DEM !== void 0 ? _globalThis$__VAL_DEM : null;
|
|
4221
4050
|
}
|
|
4222
4051
|
|
|
4223
|
-
function _arrayWithHoles(r) {
|
|
4224
|
-
if (Array.isArray(r)) return r;
|
|
4225
|
-
}
|
|
4226
|
-
|
|
4227
|
-
function _iterableToArrayLimit(r, l) {
|
|
4228
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
4229
|
-
if (null != t) {
|
|
4230
|
-
var e,
|
|
4231
|
-
n,
|
|
4232
|
-
i,
|
|
4233
|
-
u,
|
|
4234
|
-
a = [],
|
|
4235
|
-
f = !0,
|
|
4236
|
-
o = !1;
|
|
4237
|
-
try {
|
|
4238
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
4239
|
-
if (Object(t) !== t) return;
|
|
4240
|
-
f = !1;
|
|
4241
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
4242
|
-
} catch (r) {
|
|
4243
|
-
o = !0, n = r;
|
|
4244
|
-
} finally {
|
|
4245
|
-
try {
|
|
4246
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
4247
|
-
} finally {
|
|
4248
|
-
if (o) throw n;
|
|
4249
|
-
}
|
|
4250
|
-
}
|
|
4251
|
-
return a;
|
|
4252
|
-
}
|
|
4253
|
-
}
|
|
4254
|
-
|
|
4255
|
-
function _nonIterableRest() {
|
|
4256
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4257
|
-
}
|
|
4258
|
-
|
|
4259
|
-
function _slicedToArray(r, e) {
|
|
4260
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || getSitemapTree._unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
4261
|
-
}
|
|
4262
|
-
|
|
4263
4052
|
var urlOf = function urlOf() {
|
|
4264
4053
|
var route = arguments.length <= 0 ? undefined : arguments[0];
|
|
4265
4054
|
var query = arguments.length <= 1 ? undefined : arguments[1];
|
|
4266
4055
|
if (query) {
|
|
4267
4056
|
var params = Object.entries(query).flatMap(function (_ref) {
|
|
4268
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
4057
|
+
var _ref2 = slicedToArray._slicedToArray(_ref, 2),
|
|
4269
4058
|
key = _ref2[0],
|
|
4270
4059
|
value = _ref2[1];
|
|
4271
4060
|
if (!value) {
|
|
@@ -4305,7 +4094,7 @@ var compatible = {
|
|
|
4305
4094
|
* predicate is that check, said once.
|
|
4306
4095
|
*/
|
|
4307
4096
|
function isJsonObject$1(value) {
|
|
4308
|
-
return
|
|
4097
|
+
return createForOfIteratorHelper._typeof(value) === "object" && value !== null && !Array.isArray(value);
|
|
4309
4098
|
}
|
|
4310
4099
|
function incompatible(reason) {
|
|
4311
4100
|
return {
|
|
@@ -4412,7 +4201,7 @@ function checkCompatibility(from, to) {
|
|
|
4412
4201
|
// wholesale would refuse a restore that is perfectly safe.
|
|
4413
4202
|
if (to.schema.type === "discriminated-union") {
|
|
4414
4203
|
var key = to.schema.key;
|
|
4415
|
-
var _iterator =
|
|
4204
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(to.schema.items),
|
|
4416
4205
|
_step;
|
|
4417
4206
|
try {
|
|
4418
4207
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -4524,7 +4313,7 @@ function checkCompatibility(from, to) {
|
|
|
4524
4313
|
var unknown = null;
|
|
4525
4314
|
for (var _i = 0, _Object$entries = Object.entries(target); _i < _Object$entries.length; _i++) {
|
|
4526
4315
|
var _fromValue$_key;
|
|
4527
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
4316
|
+
var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
|
|
4528
4317
|
_key = _Object$entries$_i[0],
|
|
4529
4318
|
targetItem = _Object$entries$_i[1];
|
|
4530
4319
|
var sourceItem = source[_key];
|
|
@@ -4565,7 +4354,7 @@ function checkCompatibility(from, to) {
|
|
|
4565
4354
|
});
|
|
4566
4355
|
}
|
|
4567
4356
|
var _unknown = null;
|
|
4568
|
-
var _iterator2 =
|
|
4357
|
+
var _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(from.value),
|
|
4569
4358
|
_step2;
|
|
4570
4359
|
try {
|
|
4571
4360
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -4667,7 +4456,7 @@ function checkCompatibility(from, to) {
|
|
|
4667
4456
|
function newestCommitSha(commits) {
|
|
4668
4457
|
var _newest$commitSha, _newest;
|
|
4669
4458
|
var newest = null;
|
|
4670
|
-
var _iterator =
|
|
4459
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(commits !== null && commits !== void 0 ? commits : []),
|
|
4671
4460
|
_step;
|
|
4672
4461
|
try {
|
|
4673
4462
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -4844,7 +4633,7 @@ function getRoutesWithModulePaths(schemas, sources) {
|
|
|
4844
4633
|
var moduleFilePath = moduleFilePathS;
|
|
4845
4634
|
var schema = schemas[moduleFilePath];
|
|
4846
4635
|
var source = sources[moduleFilePath];
|
|
4847
|
-
if (schema && schema.type === "record" && schema.router && source &&
|
|
4636
|
+
if (schema && schema.type === "record" && schema.router && source && createForOfIteratorHelper._typeof(source) === "object" && !Array.isArray(source)) {
|
|
4848
4637
|
for (var key in source) {
|
|
4849
4638
|
if (!routeMap.has(key)) {
|
|
4850
4639
|
routeMap.set(key, moduleFilePath);
|
|
@@ -4853,7 +4642,7 @@ function getRoutesWithModulePaths(schemas, sources) {
|
|
|
4853
4642
|
}
|
|
4854
4643
|
}
|
|
4855
4644
|
var routes = Array.from(routeMap.entries()).map(function (_ref) {
|
|
4856
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
4645
|
+
var _ref2 = slicedToArray._slicedToArray(_ref, 2),
|
|
4857
4646
|
route = _ref2[0],
|
|
4858
4647
|
moduleFilePath = _ref2[1];
|
|
4859
4648
|
return {
|
|
@@ -4915,7 +4704,7 @@ function findSimilar(key, targets) {
|
|
|
4915
4704
|
*/
|
|
4916
4705
|
function getKeyOfRecordAt(sourcePath, snapshot) {
|
|
4917
4706
|
var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(sourcePath),
|
|
4918
|
-
_Internal$splitModule2 = _slicedToArray(_Internal$splitModule, 2),
|
|
4707
|
+
_Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
|
|
4919
4708
|
moduleFilePath = _Internal$splitModule2[0],
|
|
4920
4709
|
modulePath = _Internal$splitModule2[1];
|
|
4921
4710
|
var moduleSource = snapshot.sources[moduleFilePath];
|
|
@@ -4938,12 +4727,12 @@ function getKeyOfRecordAt(sourcePath, snapshot) {
|
|
|
4938
4727
|
// returns undefined source on any mismatch.
|
|
4939
4728
|
var source = moduleSource;
|
|
4940
4729
|
var schema = moduleSchema;
|
|
4941
|
-
var _iterator =
|
|
4730
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(core.Internal.splitModulePath(modulePath)),
|
|
4942
4731
|
_step;
|
|
4943
4732
|
try {
|
|
4944
4733
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
4945
4734
|
var part = _step.value;
|
|
4946
|
-
if (source &&
|
|
4735
|
+
if (source && createForOfIteratorHelper._typeof(source) === "object" && !Array.isArray(source) && part in source) {
|
|
4947
4736
|
source = source[part];
|
|
4948
4737
|
} else {
|
|
4949
4738
|
source = undefined;
|
|
@@ -4976,12 +4765,12 @@ function checkKeyIsValid(key, sourcePath, snapshot) {
|
|
|
4976
4765
|
message: "Expected key at ".concat(sourcePath, " to be of type 'record'")
|
|
4977
4766
|
};
|
|
4978
4767
|
}
|
|
4979
|
-
if (keyOfModuleSource &&
|
|
4768
|
+
if (keyOfModuleSource && createForOfIteratorHelper._typeof(keyOfModuleSource) === "object" && !Array.isArray(keyOfModuleSource) && key in keyOfModuleSource) {
|
|
4980
4769
|
return {
|
|
4981
4770
|
error: false
|
|
4982
4771
|
};
|
|
4983
4772
|
}
|
|
4984
|
-
if (!keyOfModuleSource ||
|
|
4773
|
+
if (!keyOfModuleSource || createForOfIteratorHelper._typeof(keyOfModuleSource) !== "object" || Array.isArray(keyOfModuleSource)) {
|
|
4985
4774
|
return {
|
|
4986
4775
|
error: true,
|
|
4987
4776
|
message: "Expected ".concat(sourcePath, " to be a truthy object")
|
|
@@ -5008,7 +4797,7 @@ function checkRouteIsValid(route, includePattern, excludePattern, snapshot) {
|
|
|
5008
4797
|
var schema = snapshot.schemas[moduleFilePath];
|
|
5009
4798
|
if ((schema === null || schema === void 0 ? void 0 : schema.type) === "record" && schema.router) {
|
|
5010
4799
|
var source = snapshot.sources[moduleFilePath];
|
|
5011
|
-
if (source &&
|
|
4800
|
+
if (source && createForOfIteratorHelper._typeof(source) === "object" && !Array.isArray(source)) {
|
|
5012
4801
|
routerModules[moduleFilePath] = Object.keys(source);
|
|
5013
4802
|
}
|
|
5014
4803
|
}
|
|
@@ -5016,7 +4805,7 @@ function checkRouteIsValid(route, includePattern, excludePattern, snapshot) {
|
|
|
5016
4805
|
var moduleEntries = Object.entries(routerModules);
|
|
5017
4806
|
var foundInModule = null;
|
|
5018
4807
|
for (var _i = 0, _moduleEntries = moduleEntries; _i < _moduleEntries.length; _i++) {
|
|
5019
|
-
var _moduleEntries$_i = _slicedToArray(_moduleEntries[_i], 2),
|
|
4808
|
+
var _moduleEntries$_i = slicedToArray._slicedToArray(_moduleEntries[_i], 2),
|
|
5020
4809
|
_moduleFilePath = _moduleEntries$_i[0],
|
|
5021
4810
|
routes = _moduleEntries$_i[1];
|
|
5022
4811
|
if (routes.includes(route)) {
|
|
@@ -5026,7 +4815,7 @@ function checkRouteIsValid(route, includePattern, excludePattern, snapshot) {
|
|
|
5026
4815
|
}
|
|
5027
4816
|
if (!foundInModule) {
|
|
5028
4817
|
var allRoutes = moduleEntries.flatMap(function (_ref4) {
|
|
5029
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
|
4818
|
+
var _ref5 = slicedToArray._slicedToArray(_ref4, 2),
|
|
5030
4819
|
routes = _ref5[1];
|
|
5031
4820
|
return routes;
|
|
5032
4821
|
});
|
|
@@ -5071,11 +4860,11 @@ function declaredLocales(snapshot) {
|
|
|
5071
4860
|
return [];
|
|
5072
4861
|
}
|
|
5073
4862
|
var source = snapshot.sources[moduleFilePath];
|
|
5074
|
-
if (
|
|
4863
|
+
if (createForOfIteratorHelper._typeof(source) !== "object" || source === null || Array.isArray(source)) {
|
|
5075
4864
|
return [];
|
|
5076
4865
|
}
|
|
5077
4866
|
var locales = source["locales"];
|
|
5078
|
-
if (
|
|
4867
|
+
if (createForOfIteratorHelper._typeof(locales) !== "object" || locales === null || Array.isArray(locales)) {
|
|
5079
4868
|
return [];
|
|
5080
4869
|
}
|
|
5081
4870
|
var available = locales["available"];
|
|
@@ -5132,7 +4921,7 @@ function keyOfRecordPath(error) {
|
|
|
5132
4921
|
return null;
|
|
5133
4922
|
}
|
|
5134
4923
|
var value = error.value;
|
|
5135
|
-
if (!value ||
|
|
4924
|
+
if (!value || createForOfIteratorHelper._typeof(value) !== "object") {
|
|
5136
4925
|
return null;
|
|
5137
4926
|
}
|
|
5138
4927
|
var sourcePath = value.sourcePath;
|
|
@@ -5154,7 +4943,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5154
4943
|
// The gallery as it is now -- with what a pending change, a save in a
|
|
5155
4944
|
// proposal or a content-only publish added -- not as the schema was built.
|
|
5156
4945
|
var entries = getKeyOfRecordAt(gallery.gallery, snapshot).source;
|
|
5157
|
-
var has =
|
|
4946
|
+
var has = createForOfIteratorHelper._typeof(entries) === "object" && entries !== null && !Array.isArray(entries) && core.Internal.media.galleryKeyOf(gallery.path, function (key) {
|
|
5158
4947
|
return key in entries;
|
|
5159
4948
|
}) !== null;
|
|
5160
4949
|
if (has) {
|
|
@@ -5164,7 +4953,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5164
4953
|
}
|
|
5165
4954
|
return {
|
|
5166
4955
|
status: "remaining",
|
|
5167
|
-
error:
|
|
4956
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5168
4957
|
value: gallery.source,
|
|
5169
4958
|
fixes: undefined
|
|
5170
4959
|
})
|
|
@@ -5173,7 +4962,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5173
4962
|
if (fixes.includes("image:check-gallery") || fixes.includes("file:check-gallery") || fixes.includes("video:check-gallery")) {
|
|
5174
4963
|
return {
|
|
5175
4964
|
status: "remaining",
|
|
5176
|
-
error:
|
|
4965
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5177
4966
|
message: "".concat(error.message, " The gallery could not be read from this error. ").concat(TYPE_ERROR_MESSAGE),
|
|
5178
4967
|
typeError: true,
|
|
5179
4968
|
fixes: undefined
|
|
@@ -5184,18 +4973,18 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5184
4973
|
if (!error.value) {
|
|
5185
4974
|
return {
|
|
5186
4975
|
status: "remaining",
|
|
5187
|
-
error:
|
|
4976
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5188
4977
|
message: "Could not find a value for keyOf. ".concat(TYPE_ERROR_MESSAGE),
|
|
5189
4978
|
typeError: true,
|
|
5190
4979
|
fixes: undefined
|
|
5191
4980
|
})
|
|
5192
4981
|
};
|
|
5193
4982
|
}
|
|
5194
|
-
if (
|
|
4983
|
+
if (createForOfIteratorHelper._typeof(error.value) !== "object") {
|
|
5195
4984
|
return {
|
|
5196
4985
|
status: "remaining",
|
|
5197
|
-
error:
|
|
5198
|
-
message: "Expected keyOf validation error to have a 'value' property of type 'object'. Found: ".concat(
|
|
4986
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
4987
|
+
message: "Expected keyOf validation error to have a 'value' property of type 'object'. Found: ".concat(createForOfIteratorHelper._typeof(error.value), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5199
4988
|
typeError: true,
|
|
5200
4989
|
fixes: undefined
|
|
5201
4990
|
})
|
|
@@ -5207,8 +4996,8 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5207
4996
|
if (typeof key !== "string") {
|
|
5208
4997
|
return {
|
|
5209
4998
|
status: "remaining",
|
|
5210
|
-
error:
|
|
5211
|
-
message: "Expected keyOf validation error 'value' to have property 'key' of type 'string'. Found: ".concat(
|
|
4999
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5000
|
+
message: "Expected keyOf validation error 'value' to have property 'key' of type 'string'. Found: ".concat(createForOfIteratorHelper._typeof(key), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5212
5001
|
typeError: true,
|
|
5213
5002
|
fixes: undefined
|
|
5214
5003
|
})
|
|
@@ -5217,8 +5006,8 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5217
5006
|
if (typeof valueSourcePath !== "string") {
|
|
5218
5007
|
return {
|
|
5219
5008
|
status: "remaining",
|
|
5220
|
-
error:
|
|
5221
|
-
message: "Expected keyOf validation error 'value' to have property 'sourcePath' of type 'string'. Found: ".concat(
|
|
5009
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5010
|
+
message: "Expected keyOf validation error 'value' to have property 'sourcePath' of type 'string'. Found: ".concat(createForOfIteratorHelper._typeof(valueSourcePath), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5222
5011
|
typeError: true,
|
|
5223
5012
|
fixes: undefined
|
|
5224
5013
|
})
|
|
@@ -5228,7 +5017,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5228
5017
|
if (res.error) {
|
|
5229
5018
|
return {
|
|
5230
5019
|
status: "remaining",
|
|
5231
|
-
error:
|
|
5020
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5232
5021
|
message: res.message,
|
|
5233
5022
|
fixes: undefined
|
|
5234
5023
|
})
|
|
@@ -5240,11 +5029,11 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5240
5029
|
}
|
|
5241
5030
|
if (fixes.includes("locale:check-locale")) {
|
|
5242
5031
|
var value = error.value;
|
|
5243
|
-
if (
|
|
5032
|
+
if (createForOfIteratorHelper._typeof(value) !== "object" || value === null) {
|
|
5244
5033
|
return {
|
|
5245
5034
|
status: "remaining",
|
|
5246
|
-
error:
|
|
5247
|
-
message: "Expected locale validation error to have a 'value' object. Found: ".concat(
|
|
5035
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5036
|
+
message: "Expected locale validation error to have a 'value' object. Found: ".concat(createForOfIteratorHelper._typeof(value), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5248
5037
|
typeError: true,
|
|
5249
5038
|
fixes: undefined
|
|
5250
5039
|
})
|
|
@@ -5255,8 +5044,8 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5255
5044
|
if (typeof locale !== "string") {
|
|
5256
5045
|
return {
|
|
5257
5046
|
status: "remaining",
|
|
5258
|
-
error:
|
|
5259
|
-
message: "Expected locale validation error 'value' to have property 'locale' of type 'string'. Found: ".concat(
|
|
5047
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5048
|
+
message: "Expected locale validation error 'value' to have property 'locale' of type 'string'. Found: ".concat(createForOfIteratorHelper._typeof(locale), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5260
5049
|
typeError: true,
|
|
5261
5050
|
fixes: undefined
|
|
5262
5051
|
})
|
|
@@ -5266,7 +5055,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5266
5055
|
if (available.length === 0) {
|
|
5267
5056
|
return {
|
|
5268
5057
|
status: "remaining",
|
|
5269
|
-
error:
|
|
5058
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5270
5059
|
// The project has not said it is translated, so the value is not
|
|
5271
5060
|
// wrong so much as premature — and the fix is in another file.
|
|
5272
5061
|
message: "This project has no languages. Declare them under 'locales.available' in the settings module before using s.locale().",
|
|
@@ -5281,7 +5070,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5281
5070
|
}
|
|
5282
5071
|
return {
|
|
5283
5072
|
status: "remaining",
|
|
5284
|
-
error:
|
|
5073
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5285
5074
|
message: "'".concat(locale, "' is not one of this project's languages: ").concat(available.map(function (each) {
|
|
5286
5075
|
return "'".concat(each, "'");
|
|
5287
5076
|
}).join(", ")),
|
|
@@ -5291,13 +5080,13 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5291
5080
|
}
|
|
5292
5081
|
if (fixes.includes("router:check-locale-param")) {
|
|
5293
5082
|
var _value = error.value;
|
|
5294
|
-
var _ref7 =
|
|
5083
|
+
var _ref7 = createForOfIteratorHelper._typeof(_value) === "object" && _value !== null ? _value : {},
|
|
5295
5084
|
name = _ref7.name,
|
|
5296
5085
|
segment = _ref7.segment;
|
|
5297
5086
|
if (typeof name !== "string" || typeof segment !== "string") {
|
|
5298
5087
|
return {
|
|
5299
5088
|
status: "remaining",
|
|
5300
|
-
error:
|
|
5089
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5301
5090
|
message: "Expected route locale parameter validation error to have a 'value' with 'name' and 'segment'. ".concat(TYPE_ERROR_MESSAGE),
|
|
5302
5091
|
typeError: true,
|
|
5303
5092
|
fixes: undefined
|
|
@@ -5313,7 +5102,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5313
5102
|
}
|
|
5314
5103
|
return {
|
|
5315
5104
|
status: "remaining",
|
|
5316
|
-
error:
|
|
5105
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5317
5106
|
message: "This route has a '".concat(name, "' segment (").concat(segment, "), but nothing says which of the project's languages it can be, so its pages are not in any language and '/xx/\u2026' validates. Give the parameter a locale schema: s.router(router, { ").concat(name, ": urlLocale, \u2026 }, item), where urlLocale is an s.enum(\u2026).locales({ \u2026 }) or s.locale(). If '").concat(name, "' is not a language here, give it a schema of its own instead, e.g. { ").concat(name, ": s.enum(\u2026) }."),
|
|
5318
5107
|
fixes: undefined
|
|
5319
5108
|
})
|
|
@@ -5321,11 +5110,11 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5321
5110
|
}
|
|
5322
5111
|
if (fixes.includes("record:fill-keys")) {
|
|
5323
5112
|
var _value2 = error.value;
|
|
5324
|
-
if (
|
|
5113
|
+
if (createForOfIteratorHelper._typeof(_value2) !== "object" || _value2 === null) {
|
|
5325
5114
|
return {
|
|
5326
5115
|
status: "remaining",
|
|
5327
|
-
error:
|
|
5328
|
-
message: "Expected record key validation error to have a 'value' object. Found: ".concat(
|
|
5116
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5117
|
+
message: "Expected record key validation error to have a 'value' object. Found: ".concat(createForOfIteratorHelper._typeof(_value2), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5329
5118
|
typeError: true,
|
|
5330
5119
|
fixes: undefined
|
|
5331
5120
|
})
|
|
@@ -5337,8 +5126,8 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5337
5126
|
if (!Array.isArray(present)) {
|
|
5338
5127
|
return {
|
|
5339
5128
|
status: "remaining",
|
|
5340
|
-
error:
|
|
5341
|
-
message: "Expected record key validation error 'value' to have property 'present' of type 'array'. Found: ".concat(
|
|
5129
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5130
|
+
message: "Expected record key validation error 'value' to have property 'present' of type 'array'. Found: ".concat(createForOfIteratorHelper._typeof(present), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5342
5131
|
typeError: true,
|
|
5343
5132
|
fixes: undefined
|
|
5344
5133
|
})
|
|
@@ -5370,7 +5159,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5370
5159
|
}
|
|
5371
5160
|
return {
|
|
5372
5161
|
status: "remaining",
|
|
5373
|
-
error:
|
|
5162
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5374
5163
|
message: "Missing ".concat(missing.length === 1 ? "key" : "keys", ": ").concat(missing.map(function (each) {
|
|
5375
5164
|
return "'".concat(each, "'");
|
|
5376
5165
|
}).join(", "), ". This record's keys are declared by its schema, so every one of them is an entry \u2014 an entry nobody has written yet is null, not absent."),
|
|
@@ -5386,18 +5175,18 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5386
5175
|
if (!error.value) {
|
|
5387
5176
|
return {
|
|
5388
5177
|
status: "remaining",
|
|
5389
|
-
error:
|
|
5178
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5390
5179
|
message: "Could not find a value for route. ".concat(TYPE_ERROR_MESSAGE),
|
|
5391
5180
|
typeError: true,
|
|
5392
5181
|
fixes: undefined
|
|
5393
5182
|
})
|
|
5394
5183
|
};
|
|
5395
5184
|
}
|
|
5396
|
-
if (
|
|
5185
|
+
if (createForOfIteratorHelper._typeof(error.value) !== "object") {
|
|
5397
5186
|
return {
|
|
5398
5187
|
status: "remaining",
|
|
5399
|
-
error:
|
|
5400
|
-
message: "Expected route validation error to have a 'value' property of type 'object'. Found: ".concat(
|
|
5188
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5189
|
+
message: "Expected route validation error to have a 'value' property of type 'object'. Found: ".concat(createForOfIteratorHelper._typeof(error.value), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5401
5190
|
typeError: true,
|
|
5402
5191
|
fixes: undefined
|
|
5403
5192
|
})
|
|
@@ -5408,8 +5197,8 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5408
5197
|
if (typeof route !== "string") {
|
|
5409
5198
|
return {
|
|
5410
5199
|
status: "remaining",
|
|
5411
|
-
error:
|
|
5412
|
-
message: "Expected route validation error 'value' to have property 'route' of type 'string'. Found: ".concat(
|
|
5200
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5201
|
+
message: "Expected route validation error 'value' to have property 'route' of type 'string'. Found: ".concat(createForOfIteratorHelper._typeof(route), ". ").concat(TYPE_ERROR_MESSAGE),
|
|
5413
5202
|
typeError: true,
|
|
5414
5203
|
fixes: undefined
|
|
5415
5204
|
})
|
|
@@ -5421,7 +5210,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5421
5210
|
if (_res.error) {
|
|
5422
5211
|
return {
|
|
5423
5212
|
status: "remaining",
|
|
5424
|
-
error:
|
|
5213
|
+
error: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, error), {}, {
|
|
5425
5214
|
message: _res.message,
|
|
5426
5215
|
fixes: undefined
|
|
5427
5216
|
})
|
|
@@ -5434,7 +5223,7 @@ function resolveSchemaSourceFixForError(error, snapshot) {
|
|
|
5434
5223
|
return null;
|
|
5435
5224
|
}
|
|
5436
5225
|
function asRegExpPattern(value) {
|
|
5437
|
-
if (value &&
|
|
5226
|
+
if (value && createForOfIteratorHelper._typeof(value) === "object" && "source" in value && "flags" in value && typeof value.source === "string" && typeof value.flags === "string") {
|
|
5438
5227
|
return value;
|
|
5439
5228
|
}
|
|
5440
5229
|
return undefined;
|
|
@@ -5456,7 +5245,7 @@ function resolveSchemaSourceFixes(validationErrors, snapshot) {
|
|
|
5456
5245
|
for (var sourcePathS in validationErrors) {
|
|
5457
5246
|
var sourcePath = sourcePathS;
|
|
5458
5247
|
var remaining = [];
|
|
5459
|
-
var _iterator2 =
|
|
5248
|
+
var _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(validationErrors[sourcePath]),
|
|
5460
5249
|
_step2;
|
|
5461
5250
|
try {
|
|
5462
5251
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -5506,7 +5295,7 @@ function localeAt(path, snapshot) {
|
|
|
5506
5295
|
return null;
|
|
5507
5296
|
}
|
|
5508
5297
|
var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(path),
|
|
5509
|
-
_Internal$splitModule2 = _slicedToArray(_Internal$splitModule, 2),
|
|
5298
|
+
_Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
|
|
5510
5299
|
moduleFilePath = _Internal$splitModule2[0],
|
|
5511
5300
|
modulePath = _Internal$splitModule2[1];
|
|
5512
5301
|
var schema = snapshot.schemas[moduleFilePath];
|
|
@@ -5580,7 +5369,7 @@ function localeOfRouteKey(schema, moduleFilePath, key, available) {
|
|
|
5580
5369
|
return null;
|
|
5581
5370
|
}
|
|
5582
5371
|
for (var _i = 0, _Object$entries = Object.entries(schema.params); _i < _Object$entries.length; _i++) {
|
|
5583
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
5372
|
+
var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
|
|
5584
5373
|
name = _Object$entries$_i[0],
|
|
5585
5374
|
param = _Object$entries$_i[1];
|
|
5586
5375
|
if (isLocaleSchema(param) && Object.prototype.hasOwnProperty.call(values, name)) {
|
|
@@ -5607,7 +5396,7 @@ function walk(schema, source, segments, available, moduleFilePath) {
|
|
|
5607
5396
|
var locale = entered.locale;
|
|
5608
5397
|
var currentSchema = entered.schema;
|
|
5609
5398
|
var currentSource = source;
|
|
5610
|
-
var _iterator =
|
|
5399
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(segments),
|
|
5611
5400
|
_step;
|
|
5612
5401
|
try {
|
|
5613
5402
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -5687,7 +5476,7 @@ function localeOfObjectField(schema, source, available) {
|
|
|
5687
5476
|
return null;
|
|
5688
5477
|
}
|
|
5689
5478
|
for (var _i2 = 0, _Object$entries2 = Object.entries(schema.items); _i2 < _Object$entries2.length; _i2++) {
|
|
5690
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
|
5479
|
+
var _Object$entries2$_i = slicedToArray._slicedToArray(_Object$entries2[_i2], 2),
|
|
5691
5480
|
key = _Object$entries2$_i[0],
|
|
5692
5481
|
item = _Object$entries2$_i[1];
|
|
5693
5482
|
if (!isLocaleSchema(item)) {
|
|
@@ -5740,7 +5529,7 @@ function childSource(source, segment) {
|
|
|
5740
5529
|
* property would need an assertion.
|
|
5741
5530
|
*/
|
|
5742
5531
|
function isJsonObject(source) {
|
|
5743
|
-
return
|
|
5532
|
+
return createForOfIteratorHelper._typeof(source) === "object" && source !== null && !Array.isArray(source);
|
|
5744
5533
|
}
|
|
5745
5534
|
|
|
5746
5535
|
/**
|
|
@@ -5923,13 +5712,13 @@ function emptyRecord(schema, context) {
|
|
|
5923
5712
|
var toolNames = ["get_all_schema", "get_source", "search_content", "validate_content", "create_patch", "add_session_image_to_gallery", "remove_image_gallery_entry", "navigate_to", "get_current_context", "get_patches", "get_source_path_from_route", "set_session_name", "show_compare_view", "ask_user_question", "duplicate_source", "empty_at_path", "count_entries", "get_record_keys"];
|
|
5924
5713
|
|
|
5925
5714
|
function buildFileRefValue(filePath, metadata) {
|
|
5926
|
-
return
|
|
5715
|
+
return createForOfIteratorHelper._objectSpread2({
|
|
5927
5716
|
path: filePath
|
|
5928
5717
|
}, metadata);
|
|
5929
5718
|
}
|
|
5930
5719
|
function getSourceAt(source, path) {
|
|
5931
5720
|
var current = source;
|
|
5932
|
-
var _iterator =
|
|
5721
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(path),
|
|
5933
5722
|
_step;
|
|
5934
5723
|
try {
|
|
5935
5724
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -5939,7 +5728,7 @@ function getSourceAt(source, path) {
|
|
|
5939
5728
|
var idx = Number(part);
|
|
5940
5729
|
if (!Number.isInteger(idx)) return undefined;
|
|
5941
5730
|
current = current[idx];
|
|
5942
|
-
} else if (
|
|
5731
|
+
} else if (createForOfIteratorHelper._typeof(current) === "object") {
|
|
5943
5732
|
current = current[part];
|
|
5944
5733
|
} else {
|
|
5945
5734
|
return undefined;
|
|
@@ -5988,7 +5777,7 @@ function resolveSerializedSchemaAtPath(schema, path) {
|
|
|
5988
5777
|
remainingPath: path.slice(i)
|
|
5989
5778
|
};
|
|
5990
5779
|
} else if (current.type === "discriminated-union") {
|
|
5991
|
-
var _iterator2 =
|
|
5780
|
+
var _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(current.items),
|
|
5992
5781
|
_step2;
|
|
5993
5782
|
try {
|
|
5994
5783
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -6094,7 +5883,7 @@ function buildImageGalleryPatch(args, moduleSchema) {
|
|
|
6094
5883
|
var patch = [{
|
|
6095
5884
|
op: "add",
|
|
6096
5885
|
path: [args.filePath],
|
|
6097
|
-
value:
|
|
5886
|
+
value: createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, args.metadata), {}, {
|
|
6098
5887
|
// `alt` is a REQUIRED field of a gallery entry (`s.imagedir()` gives it a
|
|
6099
5888
|
// nullable string schema), so an entry written without one is invalid
|
|
6100
5889
|
// the moment it lands — and the caller that had no alt to give is the
|
|
@@ -6115,7 +5904,7 @@ function buildImageGalleryPatch(args, moduleSchema) {
|
|
|
6115
5904
|
function buildRemoveImageGalleryEntryPatch(args, moduleSchema, moduleSource) {
|
|
6116
5905
|
var wrong = checkGallerySchema(moduleSchema);
|
|
6117
5906
|
if (wrong) return wrong;
|
|
6118
|
-
if (!moduleSource ||
|
|
5907
|
+
if (!moduleSource || createForOfIteratorHelper._typeof(moduleSource) !== "object" || Array.isArray(moduleSource)) {
|
|
6119
5908
|
return {
|
|
6120
5909
|
kind: "error",
|
|
6121
5910
|
message: "Cannot remove from gallery: module source is not an object."
|
|
@@ -6458,11 +6247,11 @@ function describeContainerAtPath(moduleSchema, moduleSource, path) {
|
|
|
6458
6247
|
};
|
|
6459
6248
|
}
|
|
6460
6249
|
if (schema.type === "record" || schema.type === "object") {
|
|
6461
|
-
if (value === null ||
|
|
6250
|
+
if (value === null || createForOfIteratorHelper._typeof(value) !== "object" || Array.isArray(value)) {
|
|
6462
6251
|
return {
|
|
6463
6252
|
kind: "error",
|
|
6464
6253
|
reason: "not-a-container",
|
|
6465
|
-
message: "Path ".concat(JSON.stringify(path), " points to a ").concat(value === null ? "null" : Array.isArray(value) ? "array" :
|
|
6254
|
+
message: "Path ".concat(JSON.stringify(path), " points to a ").concat(value === null ? "null" : Array.isArray(value) ? "array" : createForOfIteratorHelper._typeof(value), " value, which has no entries to count or list.")
|
|
6466
6255
|
};
|
|
6467
6256
|
}
|
|
6468
6257
|
return {
|
|
@@ -6508,7 +6297,7 @@ function partitionValidationErrors(validationErrors) {
|
|
|
6508
6297
|
var skipped = {};
|
|
6509
6298
|
for (var sourcePathS in validationErrors) {
|
|
6510
6299
|
var sourcePath = sourcePathS;
|
|
6511
|
-
var _iterator =
|
|
6300
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(validationErrors[sourcePath]),
|
|
6512
6301
|
_step;
|
|
6513
6302
|
try {
|
|
6514
6303
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -6950,7 +6739,7 @@ function traverseSchemaSource(source, schema, path, callback) {
|
|
|
6950
6739
|
|
|
6951
6740
|
// Handle file/image/video
|
|
6952
6741
|
if (schema.type === "file" || schema.type === "image" || schema.type === "video") {
|
|
6953
|
-
if (source &&
|
|
6742
|
+
if (source && createForOfIteratorHelper._typeof(source) === "object" && "path" in source && typeof source.path === "string") {
|
|
6954
6743
|
callback({
|
|
6955
6744
|
source: source,
|
|
6956
6745
|
schema: schema,
|
|
@@ -7074,7 +6863,7 @@ function traverseSchemaSource(source, schema, path, callback) {
|
|
|
7074
6863
|
// Settings walks like an object, and starting from the SOURCE is what makes
|
|
7075
6864
|
// its optional keys work: an absent section has nothing to traverse.
|
|
7076
6865
|
schema.type === "settings") {
|
|
7077
|
-
if (
|
|
6866
|
+
if (createForOfIteratorHelper._typeof(source) !== "object" || source === null || Array.isArray(source)) {
|
|
7078
6867
|
return;
|
|
7079
6868
|
}
|
|
7080
6869
|
for (var key in source) {
|
|
@@ -7092,7 +6881,7 @@ function traverseSchemaSource(source, schema, path, callback) {
|
|
|
7092
6881
|
// Handle discriminated union: descend through the variant the value takes
|
|
7093
6882
|
if (schema.type === "discriminated-union") {
|
|
7094
6883
|
var schemaKey = schema.key;
|
|
7095
|
-
if (source &&
|
|
6884
|
+
if (source && createForOfIteratorHelper._typeof(source) === "object" && !Array.isArray(source) && schemaKey in source) {
|
|
7096
6885
|
var itemKey = source[schemaKey];
|
|
7097
6886
|
if (typeof itemKey === "string") {
|
|
7098
6887
|
var schemaOfItem = schema.items.filter(function (item) {
|
|
@@ -7133,8 +6922,8 @@ function flattenRichText(source) {
|
|
|
7133
6922
|
if (typeof child === "string") {
|
|
7134
6923
|
res += child;
|
|
7135
6924
|
} else {
|
|
7136
|
-
if (child &&
|
|
7137
|
-
var _iterator =
|
|
6925
|
+
if (child && createForOfIteratorHelper._typeof(child) === "object" && "children" in child && Array.isArray(child.children)) {
|
|
6926
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(child.children),
|
|
7138
6927
|
_step;
|
|
7139
6928
|
try {
|
|
7140
6929
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -7298,7 +7087,7 @@ function indexModule(searchIndex, moduleFilePath, source, schema) {
|
|
|
7298
7087
|
}
|
|
7299
7088
|
// Handle file/image/video
|
|
7300
7089
|
else if (schema.type === "file" || schema.type === "image" || schema.type === "video") {
|
|
7301
|
-
if (source !== null &&
|
|
7090
|
+
if (source !== null && createForOfIteratorHelper._typeof(source) === "object" && "path" in source && typeof source.path === "string") {
|
|
7302
7091
|
// The label is the bare filename - the folder is shown separately in
|
|
7303
7092
|
// the UI - but both are searchable.
|
|
7304
7093
|
var _getRefParts = getRefParts(source.path),
|
|
@@ -7313,7 +7102,7 @@ function indexModule(searchIndex, moduleFilePath, source, schema) {
|
|
|
7313
7102
|
// Add to index if we have search text
|
|
7314
7103
|
if (searchText) {
|
|
7315
7104
|
var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(path),
|
|
7316
|
-
_Internal$splitModule2 = _slicedToArray(_Internal$splitModule, 2),
|
|
7105
|
+
_Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
|
|
7317
7106
|
modulePath = _Internal$splitModule2[1];
|
|
7318
7107
|
var cleanPath = fastRemoveNonWordChars(modulePath) + " ";
|
|
7319
7108
|
index.add(path, cleanPath + " " + path + " " + searchText);
|
|
@@ -7335,7 +7124,7 @@ function removeModule(searchIndex, moduleFilePath) {
|
|
|
7335
7124
|
docsByModule = searchIndex.docsByModule;
|
|
7336
7125
|
var existing = docsByModule.get(moduleFilePath);
|
|
7337
7126
|
if (existing === undefined) return;
|
|
7338
|
-
var _iterator =
|
|
7127
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(existing),
|
|
7339
7128
|
_step;
|
|
7340
7129
|
try {
|
|
7341
7130
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -7639,7 +7428,7 @@ function accentRamp(accent) {
|
|
|
7639
7428
|
return null;
|
|
7640
7429
|
}
|
|
7641
7430
|
var _rgbToOklch = rgbToOklch(rgb),
|
|
7642
|
-
_rgbToOklch2 = _slicedToArray(_rgbToOklch, 3),
|
|
7431
|
+
_rgbToOklch2 = slicedToArray._slicedToArray(_rgbToOklch, 3),
|
|
7643
7432
|
accentChroma = _rgbToOklch2[1],
|
|
7644
7433
|
accentHue = _rgbToOklch2[2];
|
|
7645
7434
|
var anchor = GREEN_PROFILE.find(function (entry) {
|
|
@@ -7658,7 +7447,7 @@ function accentRamp(accent) {
|
|
|
7658
7447
|
}
|
|
7659
7448
|
// Green's lightness and chroma, the accent's hue. Green's own hue is the
|
|
7660
7449
|
// one thing a generated ramp does not keep.
|
|
7661
|
-
var _entry$lch = _slicedToArray(entry.lch, 2),
|
|
7450
|
+
var _entry$lch = slicedToArray._slicedToArray(entry.lch, 2),
|
|
7662
7451
|
lightness = _entry$lch[0],
|
|
7663
7452
|
chroma = _entry$lch[1];
|
|
7664
7453
|
return rgbToHex(oklchToRgb(clampChromaToGamut([lightness, chroma * chromaScale, accentHue])));
|
|
@@ -7696,7 +7485,7 @@ function themeCustomProperties(theme) {
|
|
|
7696
7485
|
if (theme.accent) {
|
|
7697
7486
|
var ramp = accentRamp(theme.accent);
|
|
7698
7487
|
if (ramp !== null) {
|
|
7699
|
-
var _iterator =
|
|
7488
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(RAMP_STEPS),
|
|
7700
7489
|
_step;
|
|
7701
7490
|
try {
|
|
7702
7491
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -7764,7 +7553,7 @@ function relativeLuminance(hex) {
|
|
|
7764
7553
|
throw new Error("Not a six-digit hex colour: ".concat(hex));
|
|
7765
7554
|
}
|
|
7766
7555
|
var _rgb$map = rgb.map(srgbToLinear),
|
|
7767
|
-
_rgb$map2 = _slicedToArray(_rgb$map, 3),
|
|
7556
|
+
_rgb$map2 = slicedToArray._slicedToArray(_rgb$map, 3),
|
|
7768
7557
|
r = _rgb$map2[0],
|
|
7769
7558
|
g = _rgb$map2[1],
|
|
7770
7559
|
b = _rgb$map2[2];
|
|
@@ -7916,496 +7705,6 @@ function resolvePairGround(ground, ramp) {
|
|
|
7916
7705
|
return typeof ground === "number" ? ramp[ground] : ground;
|
|
7917
7706
|
}
|
|
7918
7707
|
|
|
7919
|
-
function _defineProperties(e, r) {
|
|
7920
|
-
for (var t = 0; t < r.length; t++) {
|
|
7921
|
-
var o = r[t];
|
|
7922
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, getSitemapTree._toPropertyKey(o.key), o);
|
|
7923
|
-
}
|
|
7924
|
-
}
|
|
7925
|
-
function _createClass(e, r, t) {
|
|
7926
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
7927
|
-
writable: !1
|
|
7928
|
-
}), e;
|
|
7929
|
-
}
|
|
7930
|
-
|
|
7931
|
-
function _classCallCheck(a, n) {
|
|
7932
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
7933
|
-
}
|
|
7934
|
-
|
|
7935
|
-
function _getPrototypeOf(t) {
|
|
7936
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
7937
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
7938
|
-
}, _getPrototypeOf(t);
|
|
7939
|
-
}
|
|
7940
|
-
|
|
7941
|
-
function _isNativeReflectConstruct() {
|
|
7942
|
-
try {
|
|
7943
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
7944
|
-
} catch (t) {}
|
|
7945
|
-
return (_isNativeReflectConstruct = function () {
|
|
7946
|
-
return !!t;
|
|
7947
|
-
})();
|
|
7948
|
-
}
|
|
7949
|
-
|
|
7950
|
-
function _assertThisInitialized(e) {
|
|
7951
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7952
|
-
return e;
|
|
7953
|
-
}
|
|
7954
|
-
|
|
7955
|
-
function _possibleConstructorReturn(t, e) {
|
|
7956
|
-
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
7957
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
7958
|
-
return _assertThisInitialized(t);
|
|
7959
|
-
}
|
|
7960
|
-
|
|
7961
|
-
function _callSuper(t, o, e) {
|
|
7962
|
-
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
7963
|
-
}
|
|
7964
|
-
|
|
7965
|
-
function _setPrototypeOf(t, e) {
|
|
7966
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
7967
|
-
return t.__proto__ = e, t;
|
|
7968
|
-
}, _setPrototypeOf(t, e);
|
|
7969
|
-
}
|
|
7970
|
-
|
|
7971
|
-
function _inherits(t, e) {
|
|
7972
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
7973
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
7974
|
-
constructor: {
|
|
7975
|
-
value: t,
|
|
7976
|
-
writable: !0,
|
|
7977
|
-
configurable: !0
|
|
7978
|
-
}
|
|
7979
|
-
}), Object.defineProperty(t, "prototype", {
|
|
7980
|
-
writable: !1
|
|
7981
|
-
}), e && _setPrototypeOf(t, e);
|
|
7982
|
-
}
|
|
7983
|
-
|
|
7984
|
-
function _isNativeFunction(t) {
|
|
7985
|
-
try {
|
|
7986
|
-
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
7987
|
-
} catch (n) {
|
|
7988
|
-
return "function" == typeof t;
|
|
7989
|
-
}
|
|
7990
|
-
}
|
|
7991
|
-
|
|
7992
|
-
function _construct(t, e, r) {
|
|
7993
|
-
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
7994
|
-
var o = [null];
|
|
7995
|
-
o.push.apply(o, e);
|
|
7996
|
-
var p = new (t.bind.apply(t, o))();
|
|
7997
|
-
return r && _setPrototypeOf(p, r.prototype), p;
|
|
7998
|
-
}
|
|
7999
|
-
|
|
8000
|
-
function _wrapNativeSuper(t) {
|
|
8001
|
-
var r = "function" == typeof Map ? new Map() : void 0;
|
|
8002
|
-
return _wrapNativeSuper = function (t) {
|
|
8003
|
-
if (null === t || !_isNativeFunction(t)) return t;
|
|
8004
|
-
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
8005
|
-
if (void 0 !== r) {
|
|
8006
|
-
if (r.has(t)) return r.get(t);
|
|
8007
|
-
r.set(t, Wrapper);
|
|
8008
|
-
}
|
|
8009
|
-
function Wrapper() {
|
|
8010
|
-
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
8011
|
-
}
|
|
8012
|
-
return Wrapper.prototype = Object.create(t.prototype, {
|
|
8013
|
-
constructor: {
|
|
8014
|
-
value: Wrapper,
|
|
8015
|
-
enumerable: !1,
|
|
8016
|
-
writable: !0,
|
|
8017
|
-
configurable: !0
|
|
8018
|
-
}
|
|
8019
|
-
}), _setPrototypeOf(Wrapper, t);
|
|
8020
|
-
}, _wrapNativeSuper(t);
|
|
8021
|
-
}
|
|
8022
|
-
|
|
8023
|
-
/**
|
|
8024
|
-
* Reading what content answers.
|
|
8025
|
-
*
|
|
8026
|
-
* Every type here comes from `contentApi.ts`, which is a copy of the
|
|
8027
|
-
* service's own `Api.ts` - so the shapes are not re-derived from what this end
|
|
8028
|
-
* wishes it received, and a copy brought up to date fails to compile wherever
|
|
8029
|
-
* this CLI has not caught up.
|
|
8030
|
-
*
|
|
8031
|
-
* The schemas are the runtime half, and they are needed as well as the types:
|
|
8032
|
-
* what arrives is JSON over HTTP from a service that versions separately, so a
|
|
8033
|
-
* type alone asserts a shape rather than checking one. Each schema is
|
|
8034
|
-
* annotated with the copied type it must produce (`z.ZodType<DeclareResponse>`
|
|
8035
|
-
* and so on), which is what ties the two halves together - a schema that drifts
|
|
8036
|
-
* from the copy does not compile, and an answer that drifts from the schema
|
|
8037
|
-
* does not parse. `ValOpsHttp` in `@valbuild/server` reads every other content
|
|
8038
|
-
* route the same way.
|
|
8039
|
-
*
|
|
8040
|
-
* Nothing here is laxer than the copy. An optional field is optional because
|
|
8041
|
-
* the service says so; making a required one optional here would hide exactly
|
|
8042
|
-
* the drift this file exists to catch.
|
|
8043
|
-
*/
|
|
8044
|
-
|
|
8045
|
-
/** An artifact, as it is declared: by key, by hash, by size. */
|
|
8046
|
-
|
|
8047
|
-
/** Permission to write one artifact's bytes to object storage. */
|
|
8048
|
-
|
|
8049
|
-
var publishState = zod.z["enum"](["awaiting-artifacts", "ready", "verified", "live", "failed", "expired"]);
|
|
8050
|
-
var publishProblem = zod.z.object({
|
|
8051
|
-
code: zod.z.string(),
|
|
8052
|
-
message: zod.z.string(),
|
|
8053
|
-
hint: zod.z.string().optional(),
|
|
8054
|
-
keys: zod.z.array(zod.z.string()).optional()
|
|
8055
|
-
});
|
|
8056
|
-
var uploadSlot = zod.z.object({
|
|
8057
|
-
key: zod.z.string(),
|
|
8058
|
-
url: zod.z.string(),
|
|
8059
|
-
method: zod.z.literal("PUT"),
|
|
8060
|
-
headers: zod.z.record(zod.z.string(), zod.z.string()),
|
|
8061
|
-
expiresAt: zod.z.string()
|
|
8062
|
-
});
|
|
8063
|
-
var declareResponse = zod.z.object({
|
|
8064
|
-
publishId: zod.z.string(),
|
|
8065
|
-
state: publishState,
|
|
8066
|
-
project: zod.z.object({
|
|
8067
|
-
publicProjectId: zod.z.string(),
|
|
8068
|
-
siteUrl: zod.z.string().nullable()
|
|
8069
|
-
}),
|
|
8070
|
-
uploads: zod.z.array(uploadSlot),
|
|
8071
|
-
have: zod.z.array(zod.z.string())
|
|
8072
|
-
});
|
|
8073
|
-
var artifactsResponse = zod.z.object({
|
|
8074
|
-
state: publishState,
|
|
8075
|
-
problems: zod.z.array(publishProblem)
|
|
8076
|
-
});
|
|
8077
|
-
var verifyResponse = zod.z.object({
|
|
8078
|
-
state: publishState,
|
|
8079
|
-
ok: zod.z["boolean"](),
|
|
8080
|
-
previewUrl: zod.z.string().nullable(),
|
|
8081
|
-
problems: zod.z.array(publishProblem)
|
|
8082
|
-
});
|
|
8083
|
-
var promoteResponse = zod.z.object({
|
|
8084
|
-
state: publishState,
|
|
8085
|
-
url: zod.z.string().nullable(),
|
|
8086
|
-
commit: zod.z.string().nullable()
|
|
8087
|
-
});
|
|
8088
|
-
var statusResponse = zod.z.object({
|
|
8089
|
-
publishId: zod.z.string(),
|
|
8090
|
-
state: publishState,
|
|
8091
|
-
buildHash: zod.z.string(),
|
|
8092
|
-
missing: zod.z.array(zod.z.string()),
|
|
8093
|
-
problems: zod.z.array(publishProblem)
|
|
8094
|
-
});
|
|
8095
|
-
var publishTokenResponse = zod.z.object({
|
|
8096
|
-
token: zod.z.string(),
|
|
8097
|
-
expiresAt: zod.z.string().nullable(),
|
|
8098
|
-
publicProjectId: zod.z.string(),
|
|
8099
|
-
productionUrl: zod.z.string().nullable()
|
|
8100
|
-
});
|
|
8101
|
-
|
|
8102
|
-
/**
|
|
8103
|
-
* Content answered, and the answer was not one this CLI can act on.
|
|
8104
|
-
*
|
|
8105
|
-
* Separate from a refusal, which is content saying no in a sentence meant for
|
|
8106
|
-
* a person. This is two programs disagreeing - the copy in `contentApi.ts` and
|
|
8107
|
-
* the service that has moved on from it - and the two want opposite things
|
|
8108
|
-
* said about them.
|
|
8109
|
-
*/
|
|
8110
|
-
var PublishProtocolError = /*#__PURE__*/function (_Error) {
|
|
8111
|
-
function PublishProtocolError(message) {
|
|
8112
|
-
var _this;
|
|
8113
|
-
_classCallCheck(this, PublishProtocolError);
|
|
8114
|
-
_this = _callSuper(this, PublishProtocolError, [message]);
|
|
8115
|
-
_this.name = "PublishProtocolError";
|
|
8116
|
-
return _this;
|
|
8117
|
-
}
|
|
8118
|
-
_inherits(PublishProtocolError, _Error);
|
|
8119
|
-
return _createClass(PublishProtocolError);
|
|
8120
|
-
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
8121
|
-
var parseDeclare = function parseDeclare(body) {
|
|
8122
|
-
return parse(declareResponse, body, "POST /v1/publish");
|
|
8123
|
-
};
|
|
8124
|
-
var parseArtifacts = function parseArtifacts(body) {
|
|
8125
|
-
return parse(artifactsResponse, body, "POST /v1/publish/{id}/artifacts");
|
|
8126
|
-
};
|
|
8127
|
-
var parseVerify = function parseVerify(body) {
|
|
8128
|
-
return parse(verifyResponse, body, "POST /v1/publish/{id}/verify");
|
|
8129
|
-
};
|
|
8130
|
-
var parsePromote = function parsePromote(body) {
|
|
8131
|
-
return parse(promoteResponse, body, "POST /v1/publish/{id}/promote");
|
|
8132
|
-
};
|
|
8133
|
-
var parseStatus = function parseStatus(body) {
|
|
8134
|
-
return parse(statusResponse, body, "GET /v1/publish/{id}");
|
|
8135
|
-
};
|
|
8136
|
-
var parsePublishToken = function parsePublishToken(body, call) {
|
|
8137
|
-
return parse(publishTokenResponse, body, call);
|
|
8138
|
-
};
|
|
8139
|
-
|
|
8140
|
-
/**
|
|
8141
|
-
* What a build targets, and the project's files, as the Studio asks for them.
|
|
8142
|
-
*
|
|
8143
|
-
* Both are read through `/publish-api` rather than fetched from the loader,
|
|
8144
|
-
* because a browser has neither the loader's address nor a credential it would
|
|
8145
|
-
* accept. `fetchBuildTarget` in `@valbuild/tanstack-build` is the other half --
|
|
8146
|
-
* same shape, a different caller, and it CASTS where this parses.
|
|
8147
|
-
*
|
|
8148
|
-
* Parsed rather than cast here because of what sits in between: a proxy, a
|
|
8149
|
-
* gateway and a service boundary. An HTML error page cast to `BuildTarget`
|
|
8150
|
-
* fails several layers down inside rolldown with a message about a module
|
|
8151
|
-
* specifier, and the publish that follows would label a build against a layer
|
|
8152
|
-
* that was never there.
|
|
8153
|
-
*
|
|
8154
|
-
* The TYPE is inferred from this schema instead of imported. `BuildTarget` is
|
|
8155
|
-
* declared in `@valbuild/tanstack-build`, which has no zod and deliberately
|
|
8156
|
-
* almost no dependencies -- it goes into a browser bundle -- and this package
|
|
8157
|
-
* is imported by everything. The declarations are kept honest at the one place
|
|
8158
|
-
* the value is used: it is passed straight into `buildUserApp({ target })`, so
|
|
8159
|
-
* a drift between them is a compile error at that call rather than a runtime
|
|
8160
|
-
* surprise.
|
|
8161
|
-
*/
|
|
8162
|
-
var buildTargetResponse = zod.z.object({
|
|
8163
|
-
base: zod.z.object({
|
|
8164
|
-
rev: zod.z.string(),
|
|
8165
|
-
shellRev: zod.z.string(),
|
|
8166
|
-
rscShellRev: zod.z.string(),
|
|
8167
|
-
modules: zod.z.record(zod.z.string(), zod.z.string()),
|
|
8168
|
-
rscModules: zod.z.record(zod.z.string(), zod.z.string()),
|
|
8169
|
-
paths: zod.z.object({
|
|
8170
|
-
baseFromProject: zod.z.string(),
|
|
8171
|
-
projectVendorDir: zod.z.string(),
|
|
8172
|
-
rscVendorBase: zod.z.string(),
|
|
8173
|
-
rscRuntimeSpecifier: zod.z.string(),
|
|
8174
|
-
rscRuntimePath: zod.z.string(),
|
|
8175
|
-
flightServer: zod.z.string(),
|
|
8176
|
-
serverFnBase: zod.z.string()
|
|
8177
|
-
}),
|
|
8178
|
-
/*
|
|
8179
|
-
* What the base layer is built from and what its chunks export, which
|
|
8180
|
-
* `val publish` checks a project's layer against (`BuildTarget.base` in
|
|
8181
|
-
* @valbuild/tanstack-build). Declared, because `z.object` DROPS a key it
|
|
8182
|
-
* does not name: left out, they never reached the build, and every
|
|
8183
|
-
* publish skipped both checks while saying the platform had not sent them.
|
|
8184
|
-
* Optional, for a platform that predates them.
|
|
8185
|
-
*/
|
|
8186
|
-
pins: zod.z.record(zod.z.string(), zod.z.string()).optional(),
|
|
8187
|
-
exports: zod.z.object({
|
|
8188
|
-
worker: zod.z.record(zod.z.string(), zod.z.array(zod.z.string())),
|
|
8189
|
-
browser: zod.z.record(zod.z.string(), zod.z.array(zod.z.string()))
|
|
8190
|
-
}).optional()
|
|
8191
|
-
}),
|
|
8192
|
-
project: zod.z.object({
|
|
8193
|
-
rev: zod.z.string().nullable(),
|
|
8194
|
-
rsc: zod.z["boolean"](),
|
|
8195
|
-
modules: zod.z.record(zod.z.string(), zod.z.string()),
|
|
8196
|
-
css: zod.z.record(zod.z.string(), zod.z.string()),
|
|
8197
|
-
workerOnly: zod.z.array(zod.z.string())
|
|
8198
|
-
}),
|
|
8199
|
-
/**
|
|
8200
|
-
* The project's branch: what a build is wired at, so its Val saves where
|
|
8201
|
-
* publishes commit. Optional, for a content service that predates it.
|
|
8202
|
-
*/
|
|
8203
|
-
branch: zod.z.string().optional()
|
|
8204
|
-
});
|
|
8205
|
-
/**
|
|
8206
|
-
* `null` files is a real answer: a project that has never published.
|
|
8207
|
-
*
|
|
8208
|
-
* Distinguished from an empty record, which would be a project that published
|
|
8209
|
-
* nothing -- and which a build would take as "no entry point" rather than as
|
|
8210
|
-
* "there is nothing here yet".
|
|
8211
|
-
*/
|
|
8212
|
-
var projectSourceResponse = zod.z.object({
|
|
8213
|
-
files: zod.z.record(zod.z.string(), zod.z.string()).nullable(),
|
|
8214
|
-
/**
|
|
8215
|
-
* The live build's `public/*` artifacts, by hash -- what a publisher with no
|
|
8216
|
-
* checkout carries into its build so the site keeps its favicon and images.
|
|
8217
|
-
*
|
|
8218
|
-
* The loader stores public files PER BUILD, so a build that names none
|
|
8219
|
-
* serves none. A publisher with a checkout has them on disk; the Studio has
|
|
8220
|
-
* this. Re-declaring one costs nothing: content holds the bytes for the
|
|
8221
|
-
* project already and asks for no upload.
|
|
8222
|
-
*
|
|
8223
|
-
* `null` when content cannot say -- the live build was not published through
|
|
8224
|
-
* it -- and absent from a content service that predates it. A publisher
|
|
8225
|
-
* must treat both as "unknown", never as "none": publishing on that guess
|
|
8226
|
-
* deletes every public file the site has.
|
|
8227
|
-
*/
|
|
8228
|
-
publicFiles: zod.z.array(zod.z.object({
|
|
8229
|
-
key: zod.z.string(),
|
|
8230
|
-
sha256: zod.z.string(),
|
|
8231
|
-
bytes: zod.z.number()["int"]().nonnegative()
|
|
8232
|
-
})).nullable().optional(),
|
|
8233
|
-
/**
|
|
8234
|
-
* The URL paths the live build serves from `public/`, as the loader has
|
|
8235
|
-
* them -- without the bytes' hashes.
|
|
8236
|
-
*
|
|
8237
|
-
* The fallback for when `publicFiles` is `null`: a build content has no
|
|
8238
|
-
* record of, which is every project cloned from a template seed. A publisher
|
|
8239
|
-
* running on the site's own origin can fetch these and build with them;
|
|
8240
|
-
* after that publish content holds their hashes and `publicFiles` answers.
|
|
8241
|
-
* `null` when the loader serves no build or does not say.
|
|
8242
|
-
*/
|
|
8243
|
-
publicPaths: zod.z.array(zod.z.string()).nullable().optional()
|
|
8244
|
-
});
|
|
8245
|
-
/**
|
|
8246
|
-
* Whether a managed project can be updated onto its template's current seed,
|
|
8247
|
-
* and -- when it is asked with `POST`, the press -- what to build against.
|
|
8248
|
-
*
|
|
8249
|
-
* An update rebuilds the site as it is on newer dependencies. The loader
|
|
8250
|
-
* decides whether there is one; content adds whether the project is managed at
|
|
8251
|
-
* all, and the branch head the rebuild is wired at, because an update
|
|
8252
|
-
* publishes no content of its own.
|
|
8253
|
-
*
|
|
8254
|
-
* `target` is a `/build-target` answer whose project half is the SEED's
|
|
8255
|
-
* dependency layer, already copied into the project so a publish can name it.
|
|
8256
|
-
* Only a `POST` carries it.
|
|
8257
|
-
*/
|
|
8258
|
-
var dependencyChange = zod.z.object({
|
|
8259
|
-
name: zod.z.string(),
|
|
8260
|
-
section: zod.z["enum"](["dependencies", "devDependencies"]),
|
|
8261
|
-
/** `null` for a dependency the template added. */
|
|
8262
|
-
from: zod.z.string().nullable(),
|
|
8263
|
-
/** `null` for a dependency the template dropped: it leaves `package.json`. */
|
|
8264
|
-
to: zod.z.string().nullable()
|
|
8265
|
-
});
|
|
8266
|
-
var updateTargetResponse = zod.z.discriminatedUnion("status", [zod.z.object({
|
|
8267
|
-
status: zod.z.literal("current"),
|
|
8268
|
-
template: zod.z.string(),
|
|
8269
|
-
layerRev: zod.z.string()
|
|
8270
|
-
}), zod.z.object({
|
|
8271
|
-
status: zod.z.literal("available"),
|
|
8272
|
-
template: zod.z.string(),
|
|
8273
|
-
/** Empty when only the dependency layer moved, and no version did. */
|
|
8274
|
-
changes: zod.z.array(dependencyChange),
|
|
8275
|
-
layerRev: zod.z.object({
|
|
8276
|
-
from: zod.z.string().nullable(),
|
|
8277
|
-
to: zod.z.string()
|
|
8278
|
-
}),
|
|
8279
|
-
/** The project's `package.json`, rewritten to the seed's versions. */
|
|
8280
|
-
packageJson: zod.z.string(),
|
|
8281
|
-
/** The branch head to build at; `null` for a project with no commits. */
|
|
8282
|
-
commit: zod.z.string().nullable(),
|
|
8283
|
-
branch: zod.z.string(),
|
|
8284
|
-
target: buildTargetResponse.optional()
|
|
8285
|
-
}), zod.z.object({
|
|
8286
|
-
status: zod.z.literal("unavailable"),
|
|
8287
|
-
reason: zod.z.string(),
|
|
8288
|
-
message: zod.z.string()
|
|
8289
|
-
})]);
|
|
8290
|
-
var parseUpdateTarget = function parseUpdateTarget(body) {
|
|
8291
|
-
return parse(updateTargetResponse, body, "/v1/update-target");
|
|
8292
|
-
};
|
|
8293
|
-
var parseBuildTarget = function parseBuildTarget(body) {
|
|
8294
|
-
return parse(buildTargetResponse, body, "GET /v1/build-target");
|
|
8295
|
-
};
|
|
8296
|
-
var parseProjectSource = function parseProjectSource(body) {
|
|
8297
|
-
return parse(projectSourceResponse, body, "GET /v1/project-source");
|
|
8298
|
-
};
|
|
8299
|
-
|
|
8300
|
-
// ------------------------------------------------------ publish jobs
|
|
8301
|
-
|
|
8302
|
-
/*
|
|
8303
|
-
* Publishing as a queued job (valbuild/home docs/app-mode.md, "Publishing is a
|
|
8304
|
-
* queued job"): a press is a request, the tab builds and uploads the job it is
|
|
8305
|
-
* given, and content runs verify and the seal. Each parser is typed against
|
|
8306
|
-
* the copy in `contentApi.ts`, so a copy brought up to date fails to compile
|
|
8307
|
-
* here until these follow it.
|
|
8308
|
-
*/
|
|
8309
|
-
|
|
8310
|
-
var requestStatus = zod.z.union([zod.z.object({
|
|
8311
|
-
kind: zod.z.literal("queued")
|
|
8312
|
-
}), zod.z.object({
|
|
8313
|
-
kind: zod.z.literal("publishing")
|
|
8314
|
-
}), zod.z.object({
|
|
8315
|
-
kind: zod.z.literal("live"),
|
|
8316
|
-
commit: zod.z.string()
|
|
8317
|
-
}), zod.z.object({
|
|
8318
|
-
kind: zod.z.literal("failed"),
|
|
8319
|
-
message: zod.z.string(),
|
|
8320
|
-
actions: zod.z.array(zod.z["enum"](["try-again", "discard", "re-run-build"])),
|
|
8321
|
-
job: zod.z.string(),
|
|
8322
|
-
movedTo: zod.z.object({
|
|
8323
|
-
proposal: zod.z.string(),
|
|
8324
|
-
displayName: zod.z.string(),
|
|
8325
|
-
changes: zod.z.number()
|
|
8326
|
-
}).optional()
|
|
8327
|
-
}), zod.z.object({
|
|
8328
|
-
kind: zod.z.literal("cancelled")
|
|
8329
|
-
}), zod.z.object({
|
|
8330
|
-
kind: zod.z.literal("nothing-to-publish")
|
|
8331
|
-
})]);
|
|
8332
|
-
var tabJob = zod.z.object({
|
|
8333
|
-
id: zod.z.string(),
|
|
8334
|
-
step: zod.z["enum"](["prepare", "build", "upload"]).nullable(),
|
|
8335
|
-
base: zod.z.string().nullable(),
|
|
8336
|
-
patches: zod.z.array(zod.z.string()),
|
|
8337
|
-
contentOnly: zod.z.literal(true).optional()
|
|
8338
|
-
});
|
|
8339
|
-
var pressResponse = zod.z.object({
|
|
8340
|
-
request: requestStatus,
|
|
8341
|
-
job: tabJob.nullable()
|
|
8342
|
-
});
|
|
8343
|
-
var requestStatusResponse = zod.z.object({
|
|
8344
|
-
request: requestStatus
|
|
8345
|
-
});
|
|
8346
|
-
// `/next`, `/prepare` and `/steps` all answer with the job as it now is.
|
|
8347
|
-
var jobResponse = zod.z.object({
|
|
8348
|
-
job: tabJob.nullable()
|
|
8349
|
-
});
|
|
8350
|
-
var renewResponse = zod.z.object({
|
|
8351
|
-
renewed: zod.z["boolean"]()
|
|
8352
|
-
});
|
|
8353
|
-
var cancelResponse = zod.z.object({
|
|
8354
|
-
cancelled: zod.z["boolean"]()
|
|
8355
|
-
});
|
|
8356
|
-
var discardResponse = zod.z.object({
|
|
8357
|
-
stillHeld: zod.z.array(zod.z.string())
|
|
8358
|
-
});
|
|
8359
|
-
var parsePress = function parsePress(body, call) {
|
|
8360
|
-
return parse(pressResponse, body, call);
|
|
8361
|
-
};
|
|
8362
|
-
var parseRequestStatus = function parseRequestStatus(body) {
|
|
8363
|
-
return parse(requestStatusResponse, body, "GET /v1/publish-requests/{id}");
|
|
8364
|
-
};
|
|
8365
|
-
var parseJob = function parseJob(body, call) {
|
|
8366
|
-
return parse(jobResponse, body, call);
|
|
8367
|
-
};
|
|
8368
|
-
var parseRenew = function parseRenew(body) {
|
|
8369
|
-
return parse(renewResponse, body, "POST /v1/publish-jobs/{id}/renew");
|
|
8370
|
-
};
|
|
8371
|
-
var parseCancel = function parseCancel(body) {
|
|
8372
|
-
return parse(cancelResponse, body, "POST /v1/publish-jobs/{id}/cancel");
|
|
8373
|
-
};
|
|
8374
|
-
var parseDiscard = function parseDiscard(body) {
|
|
8375
|
-
return parse(discardResponse, body, "POST /v1/publish-jobs/{id}/discard");
|
|
8376
|
-
};
|
|
8377
|
-
var newestCiRunResponse = zod.z.object({
|
|
8378
|
-
run: zod.z.object({
|
|
8379
|
-
commit: zod.z.string(),
|
|
8380
|
-
status: zod.z["enum"](["failed", "succeeded"]),
|
|
8381
|
-
url: zod.z.string().nullable()
|
|
8382
|
-
}).nullable()
|
|
8383
|
-
});
|
|
8384
|
-
var parseNewestCiRun = function parseNewestCiRun(body) {
|
|
8385
|
-
return parse(newestCiRunResponse, body, "GET /v1/ci-runs/newest");
|
|
8386
|
-
};
|
|
8387
|
-
|
|
8388
|
-
/**
|
|
8389
|
-
* The `details` of a refusal, when it carries a list of problems.
|
|
8390
|
-
*
|
|
8391
|
-
* Every non-2xx is `{ statusCode, message, details? }`, and the publish routes
|
|
8392
|
-
* put `PublishProblem[]` in `details` - a declaration is answered with EVERY
|
|
8393
|
-
* problem rather than the first, because finding them one round trip at a time
|
|
8394
|
-
* is how a publish takes six attempts. Anything else in there is somebody
|
|
8395
|
-
* else's `details` and is left to the caller's own message.
|
|
8396
|
-
*/
|
|
8397
|
-
function parseProblems(details) {
|
|
8398
|
-
var parsed = zod.z.array(publishProblem).safeParse(details);
|
|
8399
|
-
return parsed.success ? parsed.data : [];
|
|
8400
|
-
}
|
|
8401
|
-
function parse(schema, body, call) {
|
|
8402
|
-
var parsed = schema.safeParse(body);
|
|
8403
|
-
if (!parsed.success) {
|
|
8404
|
-
throw new PublishProtocolError("".concat(call, " answered with something this publisher cannot read: ").concat(zodValidationError.fromError(parsed.error).toString()));
|
|
8405
|
-
}
|
|
8406
|
-
return parsed.data;
|
|
8407
|
-
}
|
|
8408
|
-
|
|
8409
7708
|
/**
|
|
8410
7709
|
* This functions returns all the possible schema types of a given module path.
|
|
8411
7710
|
*/
|
|
@@ -8416,7 +7715,7 @@ function schemaTypesOfPath(schema, patchPath) {
|
|
|
8416
7715
|
var branches = new Set();
|
|
8417
7716
|
var current = schema;
|
|
8418
7717
|
var i = -1;
|
|
8419
|
-
var _iterator =
|
|
7718
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(patchPath),
|
|
8420
7719
|
_step;
|
|
8421
7720
|
try {
|
|
8422
7721
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -8436,7 +7735,7 @@ function schemaTypesOfPath(schema, patchPath) {
|
|
|
8436
7735
|
break;
|
|
8437
7736
|
} else if (current.type === "discriminated-union") {
|
|
8438
7737
|
var types = current.items;
|
|
8439
|
-
var _iterator2 =
|
|
7738
|
+
var _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(types),
|
|
8440
7739
|
_step2;
|
|
8441
7740
|
try {
|
|
8442
7741
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -8534,15 +7833,15 @@ function isInsidePatchSetPath(inner, outer) {
|
|
|
8534
7833
|
}
|
|
8535
7834
|
var PatchSets = /*#__PURE__*/function () {
|
|
8536
7835
|
function PatchSets() {
|
|
8537
|
-
_classCallCheck(this, PatchSets);
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
7836
|
+
slicedToArray._classCallCheck(this, PatchSets);
|
|
7837
|
+
createForOfIteratorHelper._defineProperty(this, "insertedPatches", void 0);
|
|
7838
|
+
createForOfIteratorHelper._defineProperty(this, "patchSetMetadata", void 0);
|
|
7839
|
+
createForOfIteratorHelper._defineProperty(this, "orderedInsertKeys", void 0);
|
|
8541
7840
|
this.patchSetMetadata = {};
|
|
8542
7841
|
this.orderedInsertKeys = [];
|
|
8543
7842
|
this.insertedPatches = new Set();
|
|
8544
7843
|
}
|
|
8545
|
-
return _createClass(PatchSets, [{
|
|
7844
|
+
return slicedToArray._createClass(PatchSets, [{
|
|
8546
7845
|
key: "reset",
|
|
8547
7846
|
value: function reset() {
|
|
8548
7847
|
this.patchSetMetadata = {};
|
|
@@ -8605,7 +7904,7 @@ var PatchSets = /*#__PURE__*/function () {
|
|
|
8605
7904
|
};
|
|
8606
7905
|
}
|
|
8607
7906
|
if (existingPatchSetMetadata) {
|
|
8608
|
-
var _iterator =
|
|
7907
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(existingPatchSetMetadata.patches.slice()),
|
|
8609
7908
|
_step;
|
|
8610
7909
|
try {
|
|
8611
7910
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -8690,7 +7989,7 @@ var PatchSets = /*#__PURE__*/function () {
|
|
|
8690
7989
|
// the fallback is already re-derived from scratch when the schema lands, and a
|
|
8691
7990
|
// conditional here would only leave the per-patch de-duplication half-applied.
|
|
8692
7991
|
this.insertedPatches.add(patchId);
|
|
8693
|
-
var _iterator2 =
|
|
7992
|
+
var _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(patch),
|
|
8694
7993
|
_step2;
|
|
8695
7994
|
try {
|
|
8696
7995
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -8852,13 +8151,13 @@ var PatchSets = /*#__PURE__*/function () {
|
|
|
8852
8151
|
*/
|
|
8853
8152
|
function joinSharedChanges(sets) {
|
|
8854
8153
|
var groups = [];
|
|
8855
|
-
var _iterator =
|
|
8154
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(sets),
|
|
8856
8155
|
_step;
|
|
8857
8156
|
try {
|
|
8858
8157
|
var _loop = function _loop() {
|
|
8859
8158
|
var set = _step.value;
|
|
8860
8159
|
var joined = new Set(set);
|
|
8861
|
-
var _iterator2 =
|
|
8160
|
+
var _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(groups.filter(function (g) {
|
|
8862
8161
|
return set.some(function (id) {
|
|
8863
8162
|
return g.has(id);
|
|
8864
8163
|
});
|
|
@@ -8867,7 +8166,7 @@ function joinSharedChanges(sets) {
|
|
|
8867
8166
|
try {
|
|
8868
8167
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
8869
8168
|
var group = _step2.value;
|
|
8870
|
-
var _iterator3 =
|
|
8169
|
+
var _iterator3 = createForOfIteratorHelper._createForOfIteratorHelper(group),
|
|
8871
8170
|
_step3;
|
|
8872
8171
|
try {
|
|
8873
8172
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -8913,7 +8212,7 @@ function joinSharedChanges(sets) {
|
|
|
8913
8212
|
function selectionClosure(patchSets, selected, patchIds) {
|
|
8914
8213
|
var wanted = new Set(selected);
|
|
8915
8214
|
var closed = new Set();
|
|
8916
|
-
var _iterator4 =
|
|
8215
|
+
var _iterator4 = createForOfIteratorHelper._createForOfIteratorHelper(joinSharedChanges(patchSets.map(function (set) {
|
|
8917
8216
|
return set.patches.map(function (patch) {
|
|
8918
8217
|
return patch.patchId;
|
|
8919
8218
|
});
|
|
@@ -8922,10 +8221,10 @@ function selectionClosure(patchSets, selected, patchIds) {
|
|
|
8922
8221
|
try {
|
|
8923
8222
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
8924
8223
|
var group = _step4.value;
|
|
8925
|
-
if (_toConsumableArray(group).some(function (id) {
|
|
8224
|
+
if (slicedToArray._toConsumableArray(group).some(function (id) {
|
|
8926
8225
|
return wanted.has(id);
|
|
8927
8226
|
})) {
|
|
8928
|
-
var _iterator6 =
|
|
8227
|
+
var _iterator6 = createForOfIteratorHelper._createForOfIteratorHelper(group),
|
|
8929
8228
|
_step6;
|
|
8930
8229
|
try {
|
|
8931
8230
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -8945,7 +8244,7 @@ function selectionClosure(patchSets, selected, patchIds) {
|
|
|
8945
8244
|
} finally {
|
|
8946
8245
|
_iterator4.f();
|
|
8947
8246
|
}
|
|
8948
|
-
var _iterator5 =
|
|
8247
|
+
var _iterator5 = createForOfIteratorHelper._createForOfIteratorHelper(wanted),
|
|
8949
8248
|
_step5;
|
|
8950
8249
|
try {
|
|
8951
8250
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -8980,11 +8279,11 @@ function selectionClosure(patchSets, selected, patchIds) {
|
|
|
8980
8279
|
/** A side's files: the site's tree, the base's changes over it, the proposal's over that. */
|
|
8981
8280
|
function sideFiles(trees, side) {
|
|
8982
8281
|
var layers = side === "site" ? [] : side === "base" ? [trees.trees.base] : [trees.trees.base, trees.trees.proposal];
|
|
8983
|
-
var files =
|
|
8282
|
+
var files = createForOfIteratorHelper._objectSpread2({}, trees.trees.site);
|
|
8984
8283
|
for (var _i = 0, _layers = layers; _i < _layers.length; _i++) {
|
|
8985
8284
|
var layer = _layers[_i];
|
|
8986
8285
|
for (var _i2 = 0, _Object$entries = Object.entries(layer); _i2 < _Object$entries.length; _i2++) {
|
|
8987
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
|
|
8286
|
+
var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i2], 2),
|
|
8988
8287
|
path = _Object$entries$_i[0],
|
|
8989
8288
|
text = _Object$entries$_i[1];
|
|
8990
8289
|
if (text === null) delete files[path];else files[path] = text;
|
|
@@ -9010,14 +8309,14 @@ function schemaErrorsOf(schema, moduleFilePath, source) {
|
|
|
9010
8309
|
if (res === false) return [];
|
|
9011
8310
|
var errors = [];
|
|
9012
8311
|
for (var _i3 = 0, _Object$entries2 = Object.entries(res); _i3 < _Object$entries2.length; _i3++) {
|
|
9013
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
|
|
8312
|
+
var _Object$entries2$_i = slicedToArray._slicedToArray(_Object$entries2[_i3], 2),
|
|
9014
8313
|
sourcePath = _Object$entries2$_i[0],
|
|
9015
8314
|
list = _Object$entries2$_i[1];
|
|
9016
8315
|
var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(sourcePath),
|
|
9017
|
-
_Internal$splitModule2 = _slicedToArray(_Internal$splitModule, 2),
|
|
8316
|
+
_Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
|
|
9018
8317
|
modulePath = _Internal$splitModule2[1];
|
|
9019
8318
|
var path = modulePath ? core.Internal.createPatchPath(modulePath) : [];
|
|
9020
|
-
var _iterator =
|
|
8319
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(list),
|
|
9021
8320
|
_step;
|
|
9022
8321
|
try {
|
|
9023
8322
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -9037,6 +8336,254 @@ function schemaErrorsOf(schema, moduleFilePath, source) {
|
|
|
9037
8336
|
return errors;
|
|
9038
8337
|
}
|
|
9039
8338
|
|
|
8339
|
+
/**
|
|
8340
|
+
* A Val checking a site with ITS OWN rules: the platform's upgrade page
|
|
8341
|
+
* (valbuild/home `docs/plans/upgrades-v2.md`, piece E) calls this on the
|
|
8342
|
+
* version an upgrade moves to, because only that version knows what it
|
|
8343
|
+
* requires of the site's content.
|
|
8344
|
+
*
|
|
8345
|
+
* The page is home's and runs no Val code of its own. It finds this as
|
|
8346
|
+
* `Internal.selfCheck` on the framework package in the site's own vendor
|
|
8347
|
+
* layer -- the copy that made the site's schemas, since `val.config.ts`
|
|
8348
|
+
* imports `initVal` from it -- and hands it the default export of the
|
|
8349
|
+
* site's `val.modules.ts`, bundled. A Val from before this has no
|
|
8350
|
+
* `selfCheck`, and the page says validation was not available.
|
|
8351
|
+
*
|
|
8352
|
+
* The answer is data the page shows and nothing else, so its shape is the
|
|
8353
|
+
* contract: {@link SELF_CHECK_VERSION} names it, and an answer the page
|
|
8354
|
+
* cannot read counts as a failed check there. Change the shape and the
|
|
8355
|
+
* version goes up.
|
|
8356
|
+
*/
|
|
8357
|
+
var SELF_CHECK_VERSION = 1;
|
|
8358
|
+
|
|
8359
|
+
/** Content the site's schemas do not allow, or a module that would not load. */
|
|
8360
|
+
|
|
8361
|
+
function selfCheck(_x) {
|
|
8362
|
+
return _selfCheck.apply(this, arguments);
|
|
8363
|
+
}
|
|
8364
|
+
function _selfCheck() {
|
|
8365
|
+
_selfCheck = slicedToArray._asyncToGenerator(/*#__PURE__*/slicedToArray._regenerator().m(function _callee(valModules) {
|
|
8366
|
+
var options,
|
|
8367
|
+
errors,
|
|
8368
|
+
found,
|
|
8369
|
+
schemas,
|
|
8370
|
+
sources,
|
|
8371
|
+
_iterator,
|
|
8372
|
+
_step,
|
|
8373
|
+
_step$value,
|
|
8374
|
+
index,
|
|
8375
|
+
entry,
|
|
8376
|
+
module,
|
|
8377
|
+
_path,
|
|
8378
|
+
schema,
|
|
8379
|
+
_moduleFilePath,
|
|
8380
|
+
source,
|
|
8381
|
+
_options$sourceOf,
|
|
8382
|
+
_options$sourceOf2,
|
|
8383
|
+
result,
|
|
8384
|
+
_i2,
|
|
8385
|
+
_Object$entries2,
|
|
8386
|
+
_found,
|
|
8387
|
+
_ref,
|
|
8388
|
+
_found$_ref,
|
|
8389
|
+
_Object$entries2$_i,
|
|
8390
|
+
_sourcePath,
|
|
8391
|
+
_list,
|
|
8392
|
+
_partitionValidationE,
|
|
8393
|
+
surfaced,
|
|
8394
|
+
skipped,
|
|
8395
|
+
_i,
|
|
8396
|
+
_Object$entries,
|
|
8397
|
+
_Object$entries$_i,
|
|
8398
|
+
sourcePath,
|
|
8399
|
+
list,
|
|
8400
|
+
_Internal$splitModule,
|
|
8401
|
+
_Internal$splitModule2,
|
|
8402
|
+
moduleFilePath,
|
|
8403
|
+
modulePath,
|
|
8404
|
+
path,
|
|
8405
|
+
_iterator2,
|
|
8406
|
+
_step2,
|
|
8407
|
+
error,
|
|
8408
|
+
_args = arguments,
|
|
8409
|
+
_t,
|
|
8410
|
+
_t2,
|
|
8411
|
+
_t3,
|
|
8412
|
+
_t4;
|
|
8413
|
+
return slicedToArray._regenerator().w(function (_context) {
|
|
8414
|
+
while (1) switch (_context.p = _context.n) {
|
|
8415
|
+
case 0:
|
|
8416
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
8417
|
+
errors = [];
|
|
8418
|
+
found = {};
|
|
8419
|
+
schemas = {};
|
|
8420
|
+
sources = {};
|
|
8421
|
+
_iterator = createForOfIteratorHelper._createForOfIteratorHelper(valModules.modules.entries());
|
|
8422
|
+
_context.p = 1;
|
|
8423
|
+
_iterator.s();
|
|
8424
|
+
case 2:
|
|
8425
|
+
if ((_step = _iterator.n()).done) {
|
|
8426
|
+
_context.n = 17;
|
|
8427
|
+
break;
|
|
8428
|
+
}
|
|
8429
|
+
_step$value = slicedToArray._slicedToArray(_step.value, 2), index = _step$value[0], entry = _step$value[1];
|
|
8430
|
+
module = void 0;
|
|
8431
|
+
_context.p = 3;
|
|
8432
|
+
_context.n = 4;
|
|
8433
|
+
return entry.def();
|
|
8434
|
+
case 4:
|
|
8435
|
+
module = _context.v["default"];
|
|
8436
|
+
_context.n = 6;
|
|
8437
|
+
break;
|
|
8438
|
+
case 5:
|
|
8439
|
+
_context.p = 5;
|
|
8440
|
+
_t = _context.v;
|
|
8441
|
+
errors.push({
|
|
8442
|
+
moduleFilePath: null,
|
|
8443
|
+
path: [],
|
|
8444
|
+
message: "Entry ".concat(index + 1, " of val.modules.ts could not be loaded: ").concat(messageOf(_t))
|
|
8445
|
+
});
|
|
8446
|
+
return _context.a(3, 16);
|
|
8447
|
+
case 6:
|
|
8448
|
+
if (core.Internal.isValModule(module)) {
|
|
8449
|
+
_context.n = 7;
|
|
8450
|
+
break;
|
|
8451
|
+
}
|
|
8452
|
+
errors.push({
|
|
8453
|
+
moduleFilePath: null,
|
|
8454
|
+
path: [],
|
|
8455
|
+
message: "Entry ".concat(index + 1, " of val.modules.ts does not export c.define(...) as its default.")
|
|
8456
|
+
});
|
|
8457
|
+
return _context.a(3, 16);
|
|
8458
|
+
case 7:
|
|
8459
|
+
_path = core.Internal.getValPath(module);
|
|
8460
|
+
schema = core.Internal.getSchema(module);
|
|
8461
|
+
if (!(_path === undefined || schema === undefined)) {
|
|
8462
|
+
_context.n = 8;
|
|
8463
|
+
break;
|
|
8464
|
+
}
|
|
8465
|
+
return _context.a(3, 16);
|
|
8466
|
+
case 8:
|
|
8467
|
+
_moduleFilePath = _path;
|
|
8468
|
+
source = void 0;
|
|
8469
|
+
_context.p = 9;
|
|
8470
|
+
if (!((_options$sourceOf = (_options$sourceOf2 = options.sourceOf) === null || _options$sourceOf2 === void 0 ? void 0 : _options$sourceOf2.call(options, _moduleFilePath)) !== null && _options$sourceOf !== void 0)) {
|
|
8471
|
+
_context.n = 10;
|
|
8472
|
+
break;
|
|
8473
|
+
}
|
|
8474
|
+
_t2 = _options$sourceOf;
|
|
8475
|
+
_context.n = 12;
|
|
8476
|
+
break;
|
|
8477
|
+
case 10:
|
|
8478
|
+
_context.n = 11;
|
|
8479
|
+
return core.Internal.resolveJsonValues(core.Internal.getSource(module));
|
|
8480
|
+
case 11:
|
|
8481
|
+
_t2 = _context.v;
|
|
8482
|
+
case 12:
|
|
8483
|
+
source = _t2;
|
|
8484
|
+
_context.n = 14;
|
|
8485
|
+
break;
|
|
8486
|
+
case 13:
|
|
8487
|
+
_context.p = 13;
|
|
8488
|
+
_t3 = _context.v;
|
|
8489
|
+
errors.push({
|
|
8490
|
+
moduleFilePath: _moduleFilePath,
|
|
8491
|
+
path: [],
|
|
8492
|
+
message: "Its content could not be read: ".concat(messageOf(_t3))
|
|
8493
|
+
});
|
|
8494
|
+
return _context.a(3, 16);
|
|
8495
|
+
case 14:
|
|
8496
|
+
schemas[_moduleFilePath] = schema["executeSerialize"]();
|
|
8497
|
+
sources[_moduleFilePath] = source;
|
|
8498
|
+
result = schema["executeValidate"](_path, source);
|
|
8499
|
+
if (!(result === false)) {
|
|
8500
|
+
_context.n = 15;
|
|
8501
|
+
break;
|
|
8502
|
+
}
|
|
8503
|
+
return _context.a(3, 16);
|
|
8504
|
+
case 15:
|
|
8505
|
+
for (_i2 = 0, _Object$entries2 = Object.entries(result); _i2 < _Object$entries2.length; _i2++) {
|
|
8506
|
+
_Object$entries2$_i = slicedToArray._slicedToArray(_Object$entries2[_i2], 2), _sourcePath = _Object$entries2$_i[0], _list = _Object$entries2$_i[1];
|
|
8507
|
+
(_found = (_found$_ref = found[_ref = _sourcePath]) !== null && _found$_ref !== void 0 ? _found$_ref : found[_ref] = []).push.apply(_found, slicedToArray._toConsumableArray(_list));
|
|
8508
|
+
}
|
|
8509
|
+
case 16:
|
|
8510
|
+
_context.n = 2;
|
|
8511
|
+
break;
|
|
8512
|
+
case 17:
|
|
8513
|
+
_context.n = 19;
|
|
8514
|
+
break;
|
|
8515
|
+
case 18:
|
|
8516
|
+
_context.p = 18;
|
|
8517
|
+
_t4 = _context.v;
|
|
8518
|
+
_iterator.e(_t4);
|
|
8519
|
+
case 19:
|
|
8520
|
+
_context.p = 19;
|
|
8521
|
+
_iterator.f();
|
|
8522
|
+
return _context.f(19);
|
|
8523
|
+
case 20:
|
|
8524
|
+
// The markers only the whole project can answer (a keyOf's keys, a route,
|
|
8525
|
+
// a gallery's entries) are answered here, as a publish answers them, and
|
|
8526
|
+
// what Val repairs on save is left out: the same gate the Studio applies.
|
|
8527
|
+
_partitionValidationE = partitionValidationErrors(resolveSchemaSourceFixes(found, {
|
|
8528
|
+
schemas: schemas,
|
|
8529
|
+
sources: sources
|
|
8530
|
+
})), surfaced = _partitionValidationE.surfaced, skipped = _partitionValidationE.skipped;
|
|
8531
|
+
for (_i = 0, _Object$entries = Object.entries(surfaced); _i < _Object$entries.length; _i++) {
|
|
8532
|
+
_Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2), sourcePath = _Object$entries$_i[0], list = _Object$entries$_i[1];
|
|
8533
|
+
_Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(sourcePath), _Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2), moduleFilePath = _Internal$splitModule2[0], modulePath = _Internal$splitModule2[1];
|
|
8534
|
+
path = modulePath ? core.Internal.createPatchPath(modulePath) : [];
|
|
8535
|
+
_iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(list);
|
|
8536
|
+
try {
|
|
8537
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
8538
|
+
error = _step2.value;
|
|
8539
|
+
errors.push({
|
|
8540
|
+
moduleFilePath: moduleFilePath,
|
|
8541
|
+
path: path,
|
|
8542
|
+
message: error.message
|
|
8543
|
+
});
|
|
8544
|
+
}
|
|
8545
|
+
} catch (err) {
|
|
8546
|
+
_iterator2.e(err);
|
|
8547
|
+
} finally {
|
|
8548
|
+
_iterator2.f();
|
|
8549
|
+
}
|
|
8550
|
+
}
|
|
8551
|
+
return _context.a(2, {
|
|
8552
|
+
version: SELF_CHECK_VERSION,
|
|
8553
|
+
valVersion: core.Internal.VERSION.core,
|
|
8554
|
+
modules: valModules.modules.length,
|
|
8555
|
+
errors: errors,
|
|
8556
|
+
repairedOnSave: Object.values(skipped).reduce(function (count, list) {
|
|
8557
|
+
return count + list.length;
|
|
8558
|
+
}, 0)
|
|
8559
|
+
});
|
|
8560
|
+
}
|
|
8561
|
+
}, _callee, null, [[9, 13], [3, 5], [1, 18, 19, 20]]);
|
|
8562
|
+
}));
|
|
8563
|
+
return _selfCheck.apply(this, arguments);
|
|
8564
|
+
}
|
|
8565
|
+
var messageOf = function messageOf(error) {
|
|
8566
|
+
return error instanceof Error ? error.message : String(error);
|
|
8567
|
+
};
|
|
8568
|
+
|
|
8569
|
+
exports.PublishProtocolError = protocol.PublishProtocolError;
|
|
8570
|
+
exports.parseArtifacts = protocol.parseArtifacts;
|
|
8571
|
+
exports.parseBuildTarget = protocol.parseBuildTarget;
|
|
8572
|
+
exports.parseCancel = protocol.parseCancel;
|
|
8573
|
+
exports.parseDeclare = protocol.parseDeclare;
|
|
8574
|
+
exports.parseDiscard = protocol.parseDiscard;
|
|
8575
|
+
exports.parseJob = protocol.parseJob;
|
|
8576
|
+
exports.parseNewestCiRun = protocol.parseNewestCiRun;
|
|
8577
|
+
exports.parsePress = protocol.parsePress;
|
|
8578
|
+
exports.parseProblems = protocol.parseProblems;
|
|
8579
|
+
exports.parseProjectSource = protocol.parseProjectSource;
|
|
8580
|
+
exports.parsePromote = protocol.parsePromote;
|
|
8581
|
+
exports.parsePublishToken = protocol.parsePublishToken;
|
|
8582
|
+
exports.parseRenew = protocol.parseRenew;
|
|
8583
|
+
exports.parseRequestStatus = protocol.parseRequestStatus;
|
|
8584
|
+
exports.parseStatus = protocol.parseStatus;
|
|
8585
|
+
exports.parseUpdateTarget = protocol.parseUpdateTarget;
|
|
8586
|
+
exports.parseVerify = protocol.parseVerify;
|
|
9040
8587
|
exports.DEFAULT_CANVAS_SELECTION = getSitemapTree.DEFAULT_CANVAS_SELECTION;
|
|
9041
8588
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = getSitemapTree.DEFAULT_CANVAS_SELECTION_SOFT;
|
|
9042
8589
|
exports.VAL_AI_SESSION_STORAGE_KEY = getSitemapTree.VAL_AI_SESSION_STORAGE_KEY;
|
|
@@ -9086,7 +8633,6 @@ exports.PatchId = PatchId;
|
|
|
9086
8633
|
exports.PatchJSON = PatchJSON;
|
|
9087
8634
|
exports.PatchSets = PatchSets;
|
|
9088
8635
|
exports.PlanRefusalError = PlanRefusalError;
|
|
9089
|
-
exports.PublishProtocolError = PublishProtocolError;
|
|
9090
8636
|
exports.RAMP_STEPS = RAMP_STEPS;
|
|
9091
8637
|
exports.RemirrorBr = RemirrorBr;
|
|
9092
8638
|
exports.RemirrorBulletList = RemirrorBulletList;
|
|
@@ -9102,6 +8648,7 @@ exports.RemirrorTextMark = RemirrorTextMark;
|
|
|
9102
8648
|
exports.RestoreVerdict = RestoreVerdict;
|
|
9103
8649
|
exports.RichTextOptions = RichTextOptions;
|
|
9104
8650
|
exports.SCHEMA_SOURCE_FIXES = SCHEMA_SOURCE_FIXES;
|
|
8651
|
+
exports.SELF_CHECK_VERSION = SELF_CHECK_VERSION;
|
|
9105
8652
|
exports.STUDIO_FIXES = STUDIO_FIXES;
|
|
9106
8653
|
exports.SerializedArraySchema = SerializedArraySchema;
|
|
9107
8654
|
exports.SerializedBooleanSchema = SerializedBooleanSchema;
|
|
@@ -9189,23 +8736,6 @@ exports.localeAt = localeAt;
|
|
|
9189
8736
|
exports.localeMeantBy = localeMeantBy;
|
|
9190
8737
|
exports.memoizePerRequest = memoizePerRequest;
|
|
9191
8738
|
exports.newestCommitSha = newestCommitSha;
|
|
9192
|
-
exports.parseArtifacts = parseArtifacts;
|
|
9193
|
-
exports.parseBuildTarget = parseBuildTarget;
|
|
9194
|
-
exports.parseCancel = parseCancel;
|
|
9195
|
-
exports.parseDeclare = parseDeclare;
|
|
9196
|
-
exports.parseDiscard = parseDiscard;
|
|
9197
|
-
exports.parseJob = parseJob;
|
|
9198
|
-
exports.parseNewestCiRun = parseNewestCiRun;
|
|
9199
|
-
exports.parsePress = parsePress;
|
|
9200
|
-
exports.parseProblems = parseProblems;
|
|
9201
|
-
exports.parseProjectSource = parseProjectSource;
|
|
9202
|
-
exports.parsePromote = parsePromote;
|
|
9203
|
-
exports.parsePublishToken = parsePublishToken;
|
|
9204
|
-
exports.parseRenew = parseRenew;
|
|
9205
|
-
exports.parseRequestStatus = parseRequestStatus;
|
|
9206
|
-
exports.parseStatus = parseStatus;
|
|
9207
|
-
exports.parseUpdateTarget = parseUpdateTarget;
|
|
9208
|
-
exports.parseVerify = parseVerify;
|
|
9209
8739
|
exports.partitionValidationErrors = partitionValidationErrors;
|
|
9210
8740
|
exports.performSearch = performSearch;
|
|
9211
8741
|
exports.relativeLuminance = relativeLuminance;
|
|
@@ -9222,6 +8752,7 @@ exports.safeParsePatch = safeParsePatch;
|
|
|
9222
8752
|
exports.schemaErrorsOf = schemaErrorsOf;
|
|
9223
8753
|
exports.schemaTypesOfPath = schemaTypesOfPath;
|
|
9224
8754
|
exports.selectionClosure = selectionClosure;
|
|
8755
|
+
exports.selfCheck = selfCheck;
|
|
9225
8756
|
exports.shouldEncodeWithWasm = shouldEncodeWithWasm;
|
|
9226
8757
|
exports.sideFiles = sideFiles;
|
|
9227
8758
|
exports.sideSource = sideSource;
|