@valbuild/shared 0.67.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/declarations/src/internal/ApiRoutes.d.ts +475 -354
- package/dist/declarations/src/internal/index.d.ts +1 -1
- package/dist/declarations/src/internal/richtext/conversion/remirrorTypes.d.ts +336 -12
- package/dist/declarations/src/internal/zod/Patch.d.ts +23 -0
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +190 -611
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +190 -611
- package/internal/dist/valbuild-shared-internal.esm.js +186 -611
- package/package.json +2 -2
- package/dist/declarations/src/internal/ValCache.d.ts +0 -49
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
var core = require('@valbuild/core');
|
6
6
|
var zod = require('zod');
|
7
|
-
var fp = require('@valbuild/core/fp');
|
8
7
|
var zodValidationError = require('zod-validation-error');
|
9
8
|
|
10
9
|
function _toPrimitive(t, r) {
|
@@ -721,46 +720,6 @@ var VAL_SESSION_COOKIE = core.Internal.VAL_SESSION_COOKIE;
|
|
721
720
|
var VAL_STATE_COOKIE = core.Internal.VAL_STATE_COOKIE;
|
722
721
|
var VAL_ENABLE_COOKIE_NAME = core.Internal.VAL_ENABLE_COOKIE_NAME;
|
723
722
|
|
724
|
-
function _arrayWithHoles(r) {
|
725
|
-
if (Array.isArray(r)) return r;
|
726
|
-
}
|
727
|
-
|
728
|
-
function _iterableToArrayLimit(r, l) {
|
729
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
730
|
-
if (null != t) {
|
731
|
-
var e,
|
732
|
-
n,
|
733
|
-
i,
|
734
|
-
u,
|
735
|
-
a = [],
|
736
|
-
f = !0,
|
737
|
-
o = !1;
|
738
|
-
try {
|
739
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
740
|
-
if (Object(t) !== t) return;
|
741
|
-
f = !1;
|
742
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
743
|
-
} catch (r) {
|
744
|
-
o = !0, n = r;
|
745
|
-
} finally {
|
746
|
-
try {
|
747
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
748
|
-
} finally {
|
749
|
-
if (o) throw n;
|
750
|
-
}
|
751
|
-
}
|
752
|
-
return a;
|
753
|
-
}
|
754
|
-
}
|
755
|
-
|
756
|
-
function _nonIterableRest() {
|
757
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
758
|
-
}
|
759
|
-
|
760
|
-
function _slicedToArray(r, e) {
|
761
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
762
|
-
}
|
763
|
-
|
764
723
|
function _regeneratorRuntime() {
|
765
724
|
_regeneratorRuntime = function () {
|
766
725
|
return e;
|
@@ -1089,522 +1048,52 @@ function _asyncToGenerator(n) {
|
|
1089
1048
|
};
|
1090
1049
|
}
|
1091
1050
|
|
1092
|
-
function _classCallCheck(a, n) {
|
1093
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
1094
|
-
}
|
1095
|
-
|
1096
|
-
function _defineProperties(e, r) {
|
1097
|
-
for (var t = 0; t < r.length; t++) {
|
1098
|
-
var o = r[t];
|
1099
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
1100
|
-
}
|
1101
|
-
}
|
1102
|
-
function _createClass(e, r, t) {
|
1103
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
1104
|
-
writable: !1
|
1105
|
-
}), e;
|
1106
|
-
}
|
1107
|
-
|
1108
|
-
var ValCache = /*#__PURE__*/function () {
|
1109
|
-
function ValCache(client) {
|
1110
|
-
_classCallCheck(this, ValCache);
|
1111
|
-
this.client = client;
|
1112
|
-
this.drafts = {};
|
1113
|
-
this.schema = {};
|
1114
|
-
}
|
1115
|
-
return _createClass(ValCache, [{
|
1116
|
-
key: "reloadPaths",
|
1117
|
-
value: function () {
|
1118
|
-
var _reloadPaths = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(paths) {
|
1119
|
-
var patchesResponse, patches, filteredPatches, treeRes, data, _i, _Object$keys, _data$modules, pathS, path;
|
1120
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
1121
|
-
while (1) switch (_context.prev = _context.next) {
|
1122
|
-
case 0:
|
1123
|
-
_context.next = 2;
|
1124
|
-
return this.client("/patches/~", "GET", {
|
1125
|
-
query: {
|
1126
|
-
omit_patch: true,
|
1127
|
-
author: [],
|
1128
|
-
patch_id: [],
|
1129
|
-
module_file_path: paths
|
1130
|
-
}
|
1131
|
-
});
|
1132
|
-
case 2:
|
1133
|
-
patchesResponse = _context.sent;
|
1134
|
-
if (!(patchesResponse.status !== 200)) {
|
1135
|
-
_context.next = 6;
|
1136
|
-
break;
|
1137
|
-
}
|
1138
|
-
console.error("Val: failed to get patches", patchesResponse.json.message, patchesResponse.json);
|
1139
|
-
return _context.abrupt("return");
|
1140
|
-
case 6:
|
1141
|
-
patches = patchesResponse.json;
|
1142
|
-
filteredPatches = Object.keys(patches);
|
1143
|
-
_context.next = 10;
|
1144
|
-
return this.client("/sources", "PUT", {
|
1145
|
-
query: {
|
1146
|
-
validate_sources: true,
|
1147
|
-
validate_all: false,
|
1148
|
-
validate_binary_files: false
|
1149
|
-
},
|
1150
|
-
path: undefined,
|
1151
|
-
body: {
|
1152
|
-
patchIds: filteredPatches
|
1153
|
-
}
|
1154
|
-
});
|
1155
|
-
case 10:
|
1156
|
-
treeRes = _context.sent;
|
1157
|
-
_context.next = 13;
|
1158
|
-
return this.initialize();
|
1159
|
-
case 13:
|
1160
|
-
if (treeRes.status === 200) {
|
1161
|
-
data = treeRes.json;
|
1162
|
-
for (_i = 0, _Object$keys = Object.keys(data.modules); _i < _Object$keys.length; _i++) {
|
1163
|
-
pathS = _Object$keys[_i];
|
1164
|
-
path = pathS;
|
1165
|
-
this.drafts[path] = data === null || data === void 0 || (_data$modules = data.modules) === null || _data$modules === void 0 || (_data$modules = _data$modules[path]) === null || _data$modules === void 0 ? void 0 : _data$modules.source;
|
1166
|
-
this.emitEvent(path, this.drafts[path]);
|
1167
|
-
}
|
1168
|
-
} else {
|
1169
|
-
console.error("Val: failed to reload paths", paths, treeRes.json);
|
1170
|
-
}
|
1171
|
-
case 14:
|
1172
|
-
case "end":
|
1173
|
-
return _context.stop();
|
1174
|
-
}
|
1175
|
-
}, _callee, this);
|
1176
|
-
}));
|
1177
|
-
function reloadPaths(_x) {
|
1178
|
-
return _reloadPaths.apply(this, arguments);
|
1179
|
-
}
|
1180
|
-
return reloadPaths;
|
1181
|
-
}()
|
1182
|
-
}, {
|
1183
|
-
key: "reset",
|
1184
|
-
value: function () {
|
1185
|
-
var _reset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
1186
|
-
var patchesRes, allPatches, treeRes, initRes, _i2, _Object$keys2, _treeRes$json, pathS, path;
|
1187
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
1188
|
-
while (1) switch (_context2.prev = _context2.next) {
|
1189
|
-
case 0:
|
1190
|
-
_context2.next = 2;
|
1191
|
-
return this.client("/patches/~", "GET", {
|
1192
|
-
query: {
|
1193
|
-
omit_patch: true,
|
1194
|
-
author: [],
|
1195
|
-
patch_id: [],
|
1196
|
-
module_file_path: []
|
1197
|
-
}
|
1198
|
-
});
|
1199
|
-
case 2:
|
1200
|
-
patchesRes = _context2.sent;
|
1201
|
-
if (!(patchesRes.status !== 200)) {
|
1202
|
-
_context2.next = 6;
|
1203
|
-
break;
|
1204
|
-
}
|
1205
|
-
console.error("Val: failed to get patches", patchesRes.json);
|
1206
|
-
return _context2.abrupt("return", fp.result.err({
|
1207
|
-
errorType: "other",
|
1208
|
-
message: "Failed to get patches"
|
1209
|
-
}));
|
1210
|
-
case 6:
|
1211
|
-
allPatches = Object.keys(patchesRes.json.patches);
|
1212
|
-
_context2.next = 9;
|
1213
|
-
return this.client("/sources", "PUT", {
|
1214
|
-
path: undefined,
|
1215
|
-
query: {
|
1216
|
-
validate_sources: false,
|
1217
|
-
validate_all: false,
|
1218
|
-
validate_binary_files: false
|
1219
|
-
},
|
1220
|
-
body: {
|
1221
|
-
patchIds: allPatches
|
1222
|
-
}
|
1223
|
-
});
|
1224
|
-
case 9:
|
1225
|
-
treeRes = _context2.sent;
|
1226
|
-
_context2.next = 12;
|
1227
|
-
return this.initialize();
|
1228
|
-
case 12:
|
1229
|
-
initRes = _context2.sent;
|
1230
|
-
if (!fp.result.isErr(initRes)) {
|
1231
|
-
_context2.next = 16;
|
1232
|
-
break;
|
1233
|
-
}
|
1234
|
-
console.error("Failed to initialize inside reset", initRes.error);
|
1235
|
-
return _context2.abrupt("return", fp.result.err({
|
1236
|
-
errorType: "other",
|
1237
|
-
message: initRes.error.message
|
1238
|
-
}));
|
1239
|
-
case 16:
|
1240
|
-
if (!(treeRes.status === 200)) {
|
1241
|
-
_context2.next = 21;
|
1242
|
-
break;
|
1243
|
-
}
|
1244
|
-
for (_i2 = 0, _Object$keys2 = Object.keys(treeRes.json.modules); _i2 < _Object$keys2.length; _i2++) {
|
1245
|
-
pathS = _Object$keys2[_i2];
|
1246
|
-
path = pathS;
|
1247
|
-
this.drafts[path] = (_treeRes$json = treeRes.json) === null || _treeRes$json === void 0 || (_treeRes$json = _treeRes$json.modules) === null || _treeRes$json === void 0 || (_treeRes$json = _treeRes$json[path]) === null || _treeRes$json === void 0 ? void 0 : _treeRes$json.source;
|
1248
|
-
this.emitEvent(path, this.drafts[path]);
|
1249
|
-
}
|
1250
|
-
return _context2.abrupt("return", fp.result.ok(undefined));
|
1251
|
-
case 21:
|
1252
|
-
if (!(treeRes.status === 400 && "type" in treeRes.json)) {
|
1253
|
-
_context2.next = 25;
|
1254
|
-
break;
|
1255
|
-
}
|
1256
|
-
return _context2.abrupt("return", fp.result.err({
|
1257
|
-
errorType: "patch-error",
|
1258
|
-
errors: Object.entries(treeRes.json.errors).flatMap(function (_ref) {
|
1259
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
1260
|
-
moduleFilePath = _ref2[0],
|
1261
|
-
value = _ref2[1];
|
1262
|
-
return (value !== null && value !== void 0 ? value : []).map(function (item) {
|
1263
|
-
return {
|
1264
|
-
moduleFilePath: moduleFilePath,
|
1265
|
-
patchError: item.error.message,
|
1266
|
-
patchId: item.patchId,
|
1267
|
-
skipped: item.skipped
|
1268
|
-
};
|
1269
|
-
});
|
1270
|
-
})
|
1271
|
-
}));
|
1272
|
-
case 25:
|
1273
|
-
console.error("Val: failed to reset", treeRes.json);
|
1274
|
-
return _context2.abrupt("return", fp.result.err({
|
1275
|
-
errorType: "other",
|
1276
|
-
message: "Failed to reset " + JSON.stringify(treeRes.json)
|
1277
|
-
}));
|
1278
|
-
case 27:
|
1279
|
-
case "end":
|
1280
|
-
return _context2.stop();
|
1281
|
-
}
|
1282
|
-
}, _callee2, this);
|
1283
|
-
}));
|
1284
|
-
function reset() {
|
1285
|
-
return _reset.apply(this, arguments);
|
1286
|
-
}
|
1287
|
-
return reset;
|
1288
|
-
}()
|
1289
|
-
}, {
|
1290
|
-
key: "getModule",
|
1291
|
-
value: function () {
|
1292
|
-
var _getModule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(path) {
|
1293
|
-
var refetch,
|
1294
|
-
treeRes,
|
1295
|
-
_treeRes$json2,
|
1296
|
-
_treeRes$json3,
|
1297
|
-
fetchedSource,
|
1298
|
-
schema,
|
1299
|
-
_args3 = arguments;
|
1300
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
1301
|
-
while (1) switch (_context3.prev = _context3.next) {
|
1302
|
-
case 0:
|
1303
|
-
refetch = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : false;
|
1304
|
-
if (!(!refetch && this.drafts[path] && this.schema[path])) {
|
1305
|
-
_context3.next = 3;
|
1306
|
-
break;
|
1307
|
-
}
|
1308
|
-
return _context3.abrupt("return", fp.result.ok({
|
1309
|
-
source: this.drafts[path],
|
1310
|
-
schema: this.schema[path]
|
1311
|
-
}));
|
1312
|
-
case 3:
|
1313
|
-
_context3.next = 5;
|
1314
|
-
return this.client("/sources", "PUT", {
|
1315
|
-
path: path,
|
1316
|
-
body: {},
|
1317
|
-
query: {
|
1318
|
-
validate_sources: false,
|
1319
|
-
validate_all: false,
|
1320
|
-
validate_binary_files: false
|
1321
|
-
}
|
1322
|
-
});
|
1323
|
-
case 5:
|
1324
|
-
treeRes = _context3.sent;
|
1325
|
-
if (!(treeRes.status === 200)) {
|
1326
|
-
_context3.next = 26;
|
1327
|
-
break;
|
1328
|
-
}
|
1329
|
-
if ((_treeRes$json2 = treeRes.json) !== null && _treeRes$json2 !== void 0 && (_treeRes$json2 = _treeRes$json2.modules) !== null && _treeRes$json2 !== void 0 && _treeRes$json2[path]) {
|
1330
|
-
_context3.next = 10;
|
1331
|
-
break;
|
1332
|
-
}
|
1333
|
-
console.error("Val: could not find the module", {
|
1334
|
-
moduleIds: Object.keys(treeRes.json.modules),
|
1335
|
-
moduleId: path,
|
1336
|
-
data: treeRes
|
1337
|
-
});
|
1338
|
-
return _context3.abrupt("return", fp.result.err({
|
1339
|
-
message: "Could not fetch data.\nCould not find the module:\n" + path + "\n\nVerify that the val.modules file includes this module."
|
1340
|
-
}));
|
1341
|
-
case 10:
|
1342
|
-
fetchedSource = (_treeRes$json3 = treeRes.json) === null || _treeRes$json3 === void 0 || (_treeRes$json3 = _treeRes$json3.modules) === null || _treeRes$json3 === void 0 || (_treeRes$json3 = _treeRes$json3[path]) === null || _treeRes$json3 === void 0 ? void 0 : _treeRes$json3.source;
|
1343
|
-
schema = this.schema[path];
|
1344
|
-
if (this.schema[path]) {
|
1345
|
-
_context3.next = 17;
|
1346
|
-
break;
|
1347
|
-
}
|
1348
|
-
_context3.next = 15;
|
1349
|
-
return this.initialize();
|
1350
|
-
case 15:
|
1351
|
-
if (this.schema[path]) {
|
1352
|
-
_context3.next = 17;
|
1353
|
-
break;
|
1354
|
-
}
|
1355
|
-
return _context3.abrupt("return", fp.result.err({
|
1356
|
-
message: "Path not found in schema. Verify that the module exists."
|
1357
|
-
}));
|
1358
|
-
case 17:
|
1359
|
-
if (!(fetchedSource !== undefined)) {
|
1360
|
-
_context3.next = 22;
|
1361
|
-
break;
|
1362
|
-
}
|
1363
|
-
this.drafts[path] = fetchedSource;
|
1364
|
-
return _context3.abrupt("return", fp.result.ok({
|
1365
|
-
source: fetchedSource,
|
1366
|
-
schema: schema
|
1367
|
-
}));
|
1368
|
-
case 22:
|
1369
|
-
console.error("Val: could not find the module source");
|
1370
|
-
return _context3.abrupt("return", fp.result.err({
|
1371
|
-
message: "Could not fetch data. Verify that the module exists."
|
1372
|
-
}));
|
1373
|
-
case 24:
|
1374
|
-
_context3.next = 33;
|
1375
|
-
break;
|
1376
|
-
case 26:
|
1377
|
-
if (!(treeRes.status === 504)) {
|
1378
|
-
_context3.next = 31;
|
1379
|
-
break;
|
1380
|
-
}
|
1381
|
-
console.error("Val: timeout", treeRes.json);
|
1382
|
-
return _context3.abrupt("return", fp.result.err({
|
1383
|
-
message: "Timed out while fetching data. Try again later."
|
1384
|
-
}));
|
1385
|
-
case 31:
|
1386
|
-
console.error("Val: failed to get module", treeRes.json);
|
1387
|
-
return _context3.abrupt("return", fp.result.err({
|
1388
|
-
message: "Could not fetch data. Verify that is correctly configured."
|
1389
|
-
}));
|
1390
|
-
case 33:
|
1391
|
-
case "end":
|
1392
|
-
return _context3.stop();
|
1393
|
-
}
|
1394
|
-
}, _callee3, this);
|
1395
|
-
}));
|
1396
|
-
function getModule(_x2) {
|
1397
|
-
return _getModule.apply(this, arguments);
|
1398
|
-
}
|
1399
|
-
return getModule;
|
1400
|
-
}()
|
1401
|
-
}, {
|
1402
|
-
key: "deletePatches",
|
1403
|
-
value: function () {
|
1404
|
-
var _deletePatches = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(patchIds) {
|
1405
|
-
var patchesRes;
|
1406
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
1407
|
-
while (1) switch (_context4.prev = _context4.next) {
|
1408
|
-
case 0:
|
1409
|
-
_context4.next = 2;
|
1410
|
-
return this.client("/patches/~", "DELETE", {
|
1411
|
-
query: {
|
1412
|
-
id: patchIds
|
1413
|
-
}
|
1414
|
-
});
|
1415
|
-
case 2:
|
1416
|
-
patchesRes = _context4.sent;
|
1417
|
-
if (!(patchesRes.status === 200)) {
|
1418
|
-
_context4.next = 7;
|
1419
|
-
break;
|
1420
|
-
}
|
1421
|
-
return _context4.abrupt("return", fp.result.ok(patchesRes.json));
|
1422
|
-
case 7:
|
1423
|
-
console.error("Val: failed to delete patches", patchesRes.json);
|
1424
|
-
return _context4.abrupt("return", fp.result.err({
|
1425
|
-
message: patchesRes.json.message
|
1426
|
-
}));
|
1427
|
-
case 9:
|
1428
|
-
case "end":
|
1429
|
-
return _context4.stop();
|
1430
|
-
}
|
1431
|
-
}, _callee4, this);
|
1432
|
-
}));
|
1433
|
-
function deletePatches(_x3) {
|
1434
|
-
return _deletePatches.apply(this, arguments);
|
1435
|
-
}
|
1436
|
-
return deletePatches;
|
1437
|
-
}()
|
1438
|
-
}, {
|
1439
|
-
key: "applyPatch",
|
1440
|
-
value: function () {
|
1441
|
-
var _applyPatch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(path, patchIds, patch) {
|
1442
|
-
var treeRes, _treeRes$json4, newPatchIds, newPatchId, fetchedSource, _treeRes$json5;
|
1443
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
1444
|
-
while (1) switch (_context5.prev = _context5.next) {
|
1445
|
-
case 0:
|
1446
|
-
_context5.next = 2;
|
1447
|
-
return this.client("/sources", "PUT", {
|
1448
|
-
path: path,
|
1449
|
-
query: {
|
1450
|
-
validate_sources: false,
|
1451
|
-
validate_all: false,
|
1452
|
-
validate_binary_files: false
|
1453
|
-
},
|
1454
|
-
body: {
|
1455
|
-
patchIds: patchIds,
|
1456
|
-
addPatches: [{
|
1457
|
-
path: path,
|
1458
|
-
patch: patch
|
1459
|
-
}]
|
1460
|
-
}
|
1461
|
-
});
|
1462
|
-
case 2:
|
1463
|
-
treeRes = _context5.sent;
|
1464
|
-
if (!(treeRes.status === 200)) {
|
1465
|
-
_context5.next = 20;
|
1466
|
-
break;
|
1467
|
-
}
|
1468
|
-
newPatchIds = treeRes.json.newPatchIds;
|
1469
|
-
if (newPatchIds) {
|
1470
|
-
_context5.next = 8;
|
1471
|
-
break;
|
1472
|
-
}
|
1473
|
-
console.error("Val: could create patch", treeRes);
|
1474
|
-
return _context5.abrupt("return", fp.result.err({
|
1475
|
-
errorType: "other",
|
1476
|
-
message: "Val: could not create patch"
|
1477
|
-
}));
|
1478
|
-
case 8:
|
1479
|
-
newPatchId = newPatchIds[0];
|
1480
|
-
fetchedSource = (_treeRes$json4 = treeRes.json) === null || _treeRes$json4 === void 0 || (_treeRes$json4 = _treeRes$json4.modules) === null || _treeRes$json4 === void 0 || (_treeRes$json4 = _treeRes$json4[path]) === null || _treeRes$json4 === void 0 ? void 0 : _treeRes$json4.source;
|
1481
|
-
if (!(fetchedSource !== undefined)) {
|
1482
|
-
_context5.next = 16;
|
1483
|
-
break;
|
1484
|
-
}
|
1485
|
-
this.drafts[path] = fetchedSource;
|
1486
|
-
this.emitEvent(path, fetchedSource);
|
1487
|
-
return _context5.abrupt("return", fp.result.ok({
|
1488
|
-
newPatchId: newPatchId,
|
1489
|
-
modules: _defineProperty({}, path, {
|
1490
|
-
patchIds: ((_treeRes$json5 = treeRes.json) === null || _treeRes$json5 === void 0 || (_treeRes$json5 = _treeRes$json5.modules) === null || _treeRes$json5 === void 0 || (_treeRes$json5 = _treeRes$json5[path]) === null || _treeRes$json5 === void 0 || (_treeRes$json5 = _treeRes$json5.patches) === null || _treeRes$json5 === void 0 ? void 0 : _treeRes$json5.applied) || []
|
1491
|
-
})
|
1492
|
-
}));
|
1493
|
-
case 16:
|
1494
|
-
console.error("Val: could not patch");
|
1495
|
-
return _context5.abrupt("return", fp.result.err({
|
1496
|
-
errorType: "other",
|
1497
|
-
message: "Val: could not fetch data. Verify that the module exists."
|
1498
|
-
}));
|
1499
|
-
case 18:
|
1500
|
-
_context5.next = 26;
|
1501
|
-
break;
|
1502
|
-
case 20:
|
1503
|
-
if (!(treeRes.status === 400 && "type" in treeRes.json)) {
|
1504
|
-
_context5.next = 24;
|
1505
|
-
break;
|
1506
|
-
}
|
1507
|
-
return _context5.abrupt("return", fp.result.err({
|
1508
|
-
errorType: "patch-error",
|
1509
|
-
errors: Object.entries(treeRes.json.errors).flatMap(function (_ref3) {
|
1510
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
1511
|
-
moduleFilePath = _ref4[0],
|
1512
|
-
value = _ref4[1];
|
1513
|
-
return (value !== null && value !== void 0 ? value : []).map(function (item) {
|
1514
|
-
return {
|
1515
|
-
moduleFilePath: moduleFilePath,
|
1516
|
-
patchError: item.error.message,
|
1517
|
-
patchId: item.patchId,
|
1518
|
-
skipped: item.skipped
|
1519
|
-
};
|
1520
|
-
});
|
1521
|
-
})
|
1522
|
-
}));
|
1523
|
-
case 24:
|
1524
|
-
console.error("Val: failed to get module", treeRes.json);
|
1525
|
-
return _context5.abrupt("return", fp.result.err({
|
1526
|
-
errorType: "other",
|
1527
|
-
message: "Val: could not fetch data. Verify that is correctly configured."
|
1528
|
-
}));
|
1529
|
-
case 26:
|
1530
|
-
case "end":
|
1531
|
-
return _context5.stop();
|
1532
|
-
}
|
1533
|
-
}, _callee5, this);
|
1534
|
-
}));
|
1535
|
-
function applyPatch(_x4, _x5, _x6) {
|
1536
|
-
return _applyPatch.apply(this, arguments);
|
1537
|
-
}
|
1538
|
-
return applyPatch;
|
1539
|
-
}()
|
1540
|
-
}, {
|
1541
|
-
key: "emitEvent",
|
1542
|
-
value: function emitEvent(path, source) {
|
1543
|
-
var event = new CustomEvent("val-event", {
|
1544
|
-
detail: {
|
1545
|
-
type: "module-update",
|
1546
|
-
path: path,
|
1547
|
-
source: source
|
1548
|
-
}
|
1549
|
-
});
|
1550
|
-
window.dispatchEvent(event);
|
1551
|
-
}
|
1552
|
-
}, {
|
1553
|
-
key: "initialize",
|
1554
|
-
value: function () {
|
1555
|
-
var _initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
1556
|
-
var schemaRes, paths, _i3, _arr, moduleId, schema, msg;
|
1557
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
1558
|
-
while (1) switch (_context6.prev = _context6.next) {
|
1559
|
-
case 0:
|
1560
|
-
_context6.next = 2;
|
1561
|
-
return this.client("/schema", "GET", {});
|
1562
|
-
case 2:
|
1563
|
-
schemaRes = _context6.sent;
|
1564
|
-
if (!(schemaRes.status === 200)) {
|
1565
|
-
_context6.next = 9;
|
1566
|
-
break;
|
1567
|
-
}
|
1568
|
-
paths = [];
|
1569
|
-
for (_i3 = 0, _arr = Object.keys(schemaRes.json.schemas); _i3 < _arr.length; _i3++) {
|
1570
|
-
moduleId = _arr[_i3];
|
1571
|
-
schema = schemaRes.json.schemas[moduleId];
|
1572
|
-
if (schema) {
|
1573
|
-
paths.push(moduleId);
|
1574
|
-
this.schema[moduleId] = schema;
|
1575
|
-
}
|
1576
|
-
}
|
1577
|
-
return _context6.abrupt("return", fp.result.ok(paths));
|
1578
|
-
case 9:
|
1579
|
-
msg = "Failed to fetch content. ";
|
1580
|
-
if (schemaRes.status === 401) {
|
1581
|
-
msg += "Authorization failed - check that you are logged in.";
|
1582
|
-
} else {
|
1583
|
-
msg += "Get a developer to verify that is correctly setup.";
|
1584
|
-
}
|
1585
|
-
return _context6.abrupt("return", fp.result.err({
|
1586
|
-
message: msg,
|
1587
|
-
details: {
|
1588
|
-
fetchError: schemaRes.json
|
1589
|
-
}
|
1590
|
-
}));
|
1591
|
-
case 12:
|
1592
|
-
case "end":
|
1593
|
-
return _context6.stop();
|
1594
|
-
}
|
1595
|
-
}, _callee6, this);
|
1596
|
-
}));
|
1597
|
-
function initialize() {
|
1598
|
-
return _initialize.apply(this, arguments);
|
1599
|
-
}
|
1600
|
-
return initialize;
|
1601
|
-
}()
|
1602
|
-
}]);
|
1603
|
-
}();
|
1604
|
-
|
1605
1051
|
var JSONValueT = zod.z.lazy(function () {
|
1606
1052
|
return zod.z.union([zod.z.string(), zod.z.number(), zod.z["boolean"](), zod.z["null"](), zod.z.array(JSONValueT), zod.z.record(JSONValueT)]);
|
1607
1053
|
});
|
1054
|
+
|
1055
|
+
/**
|
1056
|
+
* Raw JSON patch operation.
|
1057
|
+
*/
|
1058
|
+
var OperationJSONT = zod.z.discriminatedUnion("op", [zod.z.object({
|
1059
|
+
op: zod.z.literal("add"),
|
1060
|
+
path: zod.z.string(),
|
1061
|
+
value: JSONValueT
|
1062
|
+
}).strict(), zod.z.object({
|
1063
|
+
op: zod.z.literal("remove"),
|
1064
|
+
/**
|
1065
|
+
* Must be non-root
|
1066
|
+
*/
|
1067
|
+
path: zod.z.string()
|
1068
|
+
}).strict(), zod.z.object({
|
1069
|
+
op: zod.z.literal("replace"),
|
1070
|
+
path: zod.z.string(),
|
1071
|
+
value: JSONValueT
|
1072
|
+
}).strict(), zod.z.object({
|
1073
|
+
op: zod.z.literal("move"),
|
1074
|
+
/**
|
1075
|
+
* Must be non-root and not a proper prefix of "path".
|
1076
|
+
*/
|
1077
|
+
from: zod.z.string(),
|
1078
|
+
path: zod.z.string()
|
1079
|
+
}).strict(), zod.z.object({
|
1080
|
+
op: zod.z.literal("copy"),
|
1081
|
+
from: zod.z.string(),
|
1082
|
+
path: zod.z.string()
|
1083
|
+
}).strict(), zod.z.object({
|
1084
|
+
op: zod.z.literal("test"),
|
1085
|
+
path: zod.z.string(),
|
1086
|
+
value: JSONValueT
|
1087
|
+
}).strict(), zod.z.object({
|
1088
|
+
op: zod.z.literal("file"),
|
1089
|
+
path: zod.z.string(),
|
1090
|
+
filePath: zod.z.string(),
|
1091
|
+
value: zod.z.string()
|
1092
|
+
}).strict()]);
|
1093
|
+
var PatchJSON = zod.z.array(OperationJSONT);
|
1094
|
+
/**
|
1095
|
+
* Raw JSON patch operation.
|
1096
|
+
*/
|
1608
1097
|
var OperationT = zod.z.discriminatedUnion("op", [zod.z.object({
|
1609
1098
|
op: zod.z.literal("add"),
|
1610
1099
|
path: zod.z.array(zod.z.string()),
|
@@ -1633,11 +1122,24 @@ var OperationT = zod.z.discriminatedUnion("op", [zod.z.object({
|
|
1633
1122
|
path: zod.z.array(zod.z.string()),
|
1634
1123
|
filePath: zod.z.string(),
|
1635
1124
|
nestedFilePath: zod.z.array(zod.z.string()).optional(),
|
1636
|
-
value: zod.z.
|
1637
|
-
sha256: zod.z.string()
|
1638
|
-
})])
|
1125
|
+
value: zod.z.string()
|
1639
1126
|
}).strict()]);
|
1640
1127
|
var Patch = zod.z.array(OperationT);
|
1128
|
+
var PatchId = zod.z.string().refine(function (_id) {
|
1129
|
+
return true;
|
1130
|
+
} // TODO: validation
|
1131
|
+
);
|
1132
|
+
var ParentRef$1 = zod.z.union([zod.z.object({
|
1133
|
+
type: zod.z.literal("head"),
|
1134
|
+
headBaseSha: zod.z.string()
|
1135
|
+
}), zod.z.object({
|
1136
|
+
type: zod.z.literal("patch"),
|
1137
|
+
patchId: PatchId
|
1138
|
+
})]);
|
1139
|
+
var PatchBlock = zod.z.object({
|
1140
|
+
patch: Patch,
|
1141
|
+
parentRef: ParentRef$1
|
1142
|
+
});
|
1641
1143
|
|
1642
1144
|
var SourcePath = zod.z.string().transform(function (path) {
|
1643
1145
|
return path;
|
@@ -1767,14 +1269,17 @@ var SerializedImageSchema = zod.z.object({
|
|
1767
1269
|
});
|
1768
1270
|
var SerializedSchema = zod.z.union([SerializedStringSchema, SerializedLiteralSchema, SerializedBooleanSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedArraySchema, SerializedUnionSchema, SerializedRichTextSchema, SerializedRecordSchema, SerializedKeyOfSchema, SerializedFileSchema, SerializedDateSchema, SerializedImageSchema]);
|
1769
1271
|
|
1770
|
-
var PatchId = zod.z.string().refine(function (_id) {
|
1771
|
-
return true;
|
1772
|
-
} // TODO:
|
1773
|
-
);
|
1774
1272
|
var ModuleFilePath = zod.z.string().refine(function (_path) {
|
1775
1273
|
return true;
|
1776
|
-
} // TODO:
|
1274
|
+
} // TODO: validation
|
1777
1275
|
);
|
1276
|
+
var ParentRef = zod.z.union([zod.z.object({
|
1277
|
+
type: zod.z.literal("head"),
|
1278
|
+
headBaseSha: zod.z.string()
|
1279
|
+
}), zod.z.object({
|
1280
|
+
type: zod.z.literal("patch"),
|
1281
|
+
patchId: PatchId
|
1282
|
+
})]);
|
1778
1283
|
var ValConfig = zod.z.object({
|
1779
1284
|
project: zod.z.string().optional(),
|
1780
1285
|
root: zod.z.string().optional(),
|
@@ -1784,7 +1289,7 @@ var ValConfig = zod.z.object({
|
|
1784
1289
|
gitCommit: zod.z.string().optional(),
|
1785
1290
|
gitBranch: zod.z.string().optional()
|
1786
1291
|
});
|
1787
|
-
var ValidationFixZ = zod.z.union([zod.z.literal("image:add-metadata"), zod.z.literal("image:
|
1292
|
+
var ValidationFixZ = zod.z.union([zod.z.literal("image:change-extension"), zod.z.literal("image:add-metadata"), zod.z.literal("image:check-metadata"), zod.z.literal("file:change-extension"), zod.z.literal("file:add-metadata"), zod.z.literal("file:check-metadata")]);
|
1788
1293
|
var ValidationError = zod.z.object({
|
1789
1294
|
message: zod.z.string(),
|
1790
1295
|
value: zod.z.unknown().optional(),
|
@@ -1800,6 +1305,13 @@ var notFoundResponse = zod.z.object({
|
|
1800
1305
|
var GenericError = zod.z.object({
|
1801
1306
|
message: zod.z.string()
|
1802
1307
|
});
|
1308
|
+
var GenericPatchError = zod.z.union([zod.z.object({
|
1309
|
+
patchId: PatchId,
|
1310
|
+
message: zod.z.string()
|
1311
|
+
}), zod.z.object({
|
1312
|
+
parentPatchId: zod.z.string(),
|
1313
|
+
message: zod.z.string()
|
1314
|
+
})]);
|
1803
1315
|
var ModulesError = zod.z.object({
|
1804
1316
|
message: zod.z.string(),
|
1805
1317
|
path: ModuleFilePath.optional()
|
@@ -2080,7 +1592,7 @@ var Api = {
|
|
2080
1592
|
})])
|
2081
1593
|
}
|
2082
1594
|
},
|
2083
|
-
"/patches
|
1595
|
+
"/patches": {
|
2084
1596
|
DELETE: {
|
2085
1597
|
req: {
|
2086
1598
|
query: {
|
@@ -2094,13 +1606,50 @@ var Api = {
|
|
2094
1606
|
status: zod.z.literal(500),
|
2095
1607
|
json: zod.z.object({
|
2096
1608
|
message: zod.z.string(),
|
2097
|
-
|
1609
|
+
errors: zod.z.array(GenericPatchError)
|
2098
1610
|
})
|
2099
1611
|
}), zod.z.object({
|
2100
1612
|
status: zod.z.literal(200),
|
2101
1613
|
json: zod.z.array(PatchId)
|
2102
1614
|
})])
|
2103
1615
|
},
|
1616
|
+
PUT: {
|
1617
|
+
req: {
|
1618
|
+
body: zod.z.object({
|
1619
|
+
parentRef: ParentRef,
|
1620
|
+
patches: zod.z.array(zod.z.object({
|
1621
|
+
path: ModuleFilePath,
|
1622
|
+
patch: Patch
|
1623
|
+
}))
|
1624
|
+
}),
|
1625
|
+
cookies: {
|
1626
|
+
val_session: zod.z.string().optional()
|
1627
|
+
}
|
1628
|
+
},
|
1629
|
+
res: zod.z.union([notFoundResponse, zod.z.object({
|
1630
|
+
status: zod.z.literal(409),
|
1631
|
+
// conflict: i.e. not a head of patches
|
1632
|
+
json: zod.z.object({
|
1633
|
+
type: zod.z.literal("patch-head-conflict"),
|
1634
|
+
message: zod.z.string()
|
1635
|
+
})
|
1636
|
+
}), zod.z.object({
|
1637
|
+
status: zod.z.literal(400),
|
1638
|
+
json: zod.z.object({
|
1639
|
+
type: zod.z.literal("patch-error"),
|
1640
|
+
message: zod.z.string(),
|
1641
|
+
errors: zod.z.record(ModuleFilePath, zod.z.array(zod.z.object({
|
1642
|
+
error: GenericError
|
1643
|
+
})))
|
1644
|
+
})
|
1645
|
+
}), zod.z.object({
|
1646
|
+
status: zod.z.literal(200),
|
1647
|
+
json: zod.z.object({
|
1648
|
+
newPatchIds: zod.z.array(PatchId),
|
1649
|
+
parentRef: ParentRef
|
1650
|
+
})
|
1651
|
+
})])
|
1652
|
+
},
|
2104
1653
|
GET: {
|
2105
1654
|
req: {
|
2106
1655
|
query: {
|
@@ -2117,14 +1666,21 @@ var Api = {
|
|
2117
1666
|
status: zod.z.literal(500),
|
2118
1667
|
json: zod.z.object({
|
2119
1668
|
message: zod.z.string(),
|
2120
|
-
|
1669
|
+
patchErrors: zod.z.array(GenericPatchError)
|
1670
|
+
})
|
1671
|
+
}), zod.z.object({
|
1672
|
+
status: zod.z.literal(500),
|
1673
|
+
json: zod.z.object({
|
1674
|
+
message: zod.z.string(),
|
1675
|
+
error: GenericError
|
2121
1676
|
})
|
2122
1677
|
}), zod.z.object({
|
2123
1678
|
status: zod.z.literal(200),
|
2124
1679
|
json: zod.z.object({
|
2125
|
-
patches: zod.z.
|
1680
|
+
patches: zod.z.array(zod.z.object({
|
2126
1681
|
path: ModuleFilePath,
|
2127
1682
|
patch: Patch.optional(),
|
1683
|
+
patchId: PatchId,
|
2128
1684
|
createdAt: zod.z.string(),
|
2129
1685
|
authorId: zod.z.string().nullable(),
|
2130
1686
|
appliedAt: zod.z.object({
|
@@ -2135,6 +1691,7 @@ var Api = {
|
|
2135
1691
|
timestamp: zod.z.string()
|
2136
1692
|
}).nullable()
|
2137
1693
|
})),
|
1694
|
+
baseSha: zod.z.string(),
|
2138
1695
|
error: GenericError.optional(),
|
2139
1696
|
errors: zod.z.record(PatchId, GenericError).optional()
|
2140
1697
|
})
|
@@ -2169,16 +1726,12 @@ var Api = {
|
|
2169
1726
|
})])
|
2170
1727
|
}
|
2171
1728
|
},
|
2172
|
-
"/sources": {
|
1729
|
+
"/sources/~": {
|
2173
1730
|
PUT: {
|
2174
1731
|
req: {
|
2175
1732
|
path: zod.z.string().optional(),
|
2176
1733
|
body: zod.z.object({
|
2177
|
-
patchIds: zod.z.array(PatchId).optional()
|
2178
|
-
addPatches: zod.z.array(zod.z.object({
|
2179
|
-
path: ModuleFilePath,
|
2180
|
-
patch: Patch
|
2181
|
-
})).optional()
|
1734
|
+
patchIds: zod.z.array(PatchId).optional()
|
2182
1735
|
}).optional(),
|
2183
1736
|
query: {
|
2184
1737
|
validate_all: zod.z["boolean"]().optional(),
|
@@ -2192,10 +1745,6 @@ var Api = {
|
|
2192
1745
|
res: zod.z.union([notFoundResponse, zod.z.object({
|
2193
1746
|
status: zod.z.literal(401),
|
2194
1747
|
json: GenericError
|
2195
|
-
}), zod.z.object({
|
2196
|
-
status: zod.z.literal(409),
|
2197
|
-
// conflict: i.e. not a head of patches
|
2198
|
-
json: GenericError
|
2199
1748
|
}), zod.z.object({
|
2200
1749
|
status: zod.z.literal(500),
|
2201
1750
|
json: zod.z.object({
|
@@ -2203,32 +1752,15 @@ var Api = {
|
|
2203
1752
|
details: zod.z.union([zod.z.array(ModulesError), GenericError])
|
2204
1753
|
})
|
2205
1754
|
}), zod.z.object({
|
2206
|
-
status: zod.z.literal(
|
1755
|
+
status: zod.z.literal(409),
|
2207
1756
|
json: zod.z.object({
|
2208
|
-
message: zod.z.string()
|
2209
|
-
details: zod.z.array(ModulesError)
|
1757
|
+
message: zod.z.string()
|
2210
1758
|
})
|
2211
1759
|
}), zod.z.object({
|
2212
1760
|
status: zod.z.literal(400),
|
2213
1761
|
json: zod.z.object({
|
2214
|
-
type: zod.z.literal("patch-error"),
|
2215
1762
|
message: zod.z.string(),
|
2216
|
-
|
2217
|
-
modules: zod.z.record(ModuleFilePath, zod.z.object({
|
2218
|
-
source: zod.z.any(),
|
2219
|
-
//.optional(), // TODO: Json zod type
|
2220
|
-
patches: zod.z.object({
|
2221
|
-
applied: zod.z.array(PatchId),
|
2222
|
-
skipped: zod.z.array(PatchId).optional(),
|
2223
|
-
errors: zod.z.record(PatchId, GenericError).optional()
|
2224
|
-
}).optional(),
|
2225
|
-
validationErrors: zod.z.record(SourcePath, zod.z.array(ValidationError)).optional()
|
2226
|
-
})),
|
2227
|
-
errors: zod.z.record(ModuleFilePath, zod.z.array(zod.z.object({
|
2228
|
-
patchId: PatchId,
|
2229
|
-
skipped: zod.z["boolean"](),
|
2230
|
-
error: GenericError
|
2231
|
-
})))
|
1763
|
+
details: zod.z.array(ModulesError)
|
2232
1764
|
})
|
2233
1765
|
}), zod.z.object({
|
2234
1766
|
status: zod.z.literal(200),
|
@@ -2243,8 +1775,7 @@ var Api = {
|
|
2243
1775
|
errors: zod.z.record(PatchId, GenericError).optional()
|
2244
1776
|
}).optional(),
|
2245
1777
|
validationErrors: zod.z.record(SourcePath, zod.z.array(ValidationError)).optional()
|
2246
|
-
}))
|
2247
|
-
newPatchIds: zod.z.array(PatchId).optional()
|
1778
|
+
}))
|
2248
1779
|
})
|
2249
1780
|
})])
|
2250
1781
|
}
|
@@ -2391,9 +1922,13 @@ var createValClient = function createValClient(host) {
|
|
2391
1922
|
case 7:
|
2392
1923
|
reqBodyResult = (_apiEndpoint$req$body = apiEndpoint.req.body) === null || _apiEndpoint$req$body === void 0 ? void 0 : _apiEndpoint$req$body.safeParse(anyReq.body);
|
2393
1924
|
if (!(reqBodyResult && !reqBodyResult.success)) {
|
2394
|
-
_context2.next =
|
1925
|
+
_context2.next = 11;
|
2395
1926
|
break;
|
2396
1927
|
}
|
1928
|
+
console.error("Invalid request body", {
|
1929
|
+
body: anyReq.body,
|
1930
|
+
error: reqBodyResult.error
|
1931
|
+
});
|
2397
1932
|
return _context2.abrupt("return", {
|
2398
1933
|
status: null,
|
2399
1934
|
json: {
|
@@ -2405,9 +1940,9 @@ var createValClient = function createValClient(host) {
|
|
2405
1940
|
}
|
2406
1941
|
}
|
2407
1942
|
});
|
2408
|
-
case
|
2409
|
-
_context2.prev =
|
2410
|
-
_context2.next =
|
1943
|
+
case 11:
|
1944
|
+
_context2.prev = 11;
|
1945
|
+
_context2.next = 14;
|
2411
1946
|
return fetch("".concat(host).concat(fullPath), {
|
2412
1947
|
method: method,
|
2413
1948
|
headers: {
|
@@ -2430,7 +1965,7 @@ var createValClient = function createValClient(host) {
|
|
2430
1965
|
status: null,
|
2431
1966
|
json: {
|
2432
1967
|
type: "client_side_validation_error",
|
2433
|
-
message: "Invalid
|
1968
|
+
message: "Invalid response (expected JSON, but got something else). This could be a result of mismatched Val versions or a transient error.",
|
2434
1969
|
details: {
|
2435
1970
|
validationError: "Invalid content type",
|
2436
1971
|
data: {
|
@@ -2493,12 +2028,12 @@ var createValClient = function createValClient(host) {
|
|
2493
2028
|
return _ref2.apply(this, arguments);
|
2494
2029
|
};
|
2495
2030
|
}());
|
2496
|
-
case
|
2031
|
+
case 14:
|
2497
2032
|
res = _context2.sent;
|
2498
2033
|
return _context2.abrupt("return", res);
|
2499
|
-
case
|
2500
|
-
_context2.prev =
|
2501
|
-
_context2.t0 = _context2["catch"](
|
2034
|
+
case 18:
|
2035
|
+
_context2.prev = 18;
|
2036
|
+
_context2.t0 = _context2["catch"](11);
|
2502
2037
|
return _context2.abrupt("return", {
|
2503
2038
|
status: null,
|
2504
2039
|
json: {
|
@@ -2508,11 +2043,11 @@ var createValClient = function createValClient(host) {
|
|
2508
2043
|
details: _context2.t0 instanceof Error ? _context2.t0.message : JSON.stringify(_context2.t0)
|
2509
2044
|
}
|
2510
2045
|
});
|
2511
|
-
case
|
2046
|
+
case 21:
|
2512
2047
|
case "end":
|
2513
2048
|
return _context2.stop();
|
2514
2049
|
}
|
2515
|
-
}, _callee2, null, [[
|
2050
|
+
}, _callee2, null, [[11, 18]]);
|
2516
2051
|
}));
|
2517
2052
|
return function (_x, _x2, _x3) {
|
2518
2053
|
return _ref.apply(this, arguments);
|
@@ -2534,6 +2069,46 @@ function isRetryable(error) {
|
|
2534
2069
|
return false;
|
2535
2070
|
}
|
2536
2071
|
|
2072
|
+
function _arrayWithHoles(r) {
|
2073
|
+
if (Array.isArray(r)) return r;
|
2074
|
+
}
|
2075
|
+
|
2076
|
+
function _iterableToArrayLimit(r, l) {
|
2077
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
2078
|
+
if (null != t) {
|
2079
|
+
var e,
|
2080
|
+
n,
|
2081
|
+
i,
|
2082
|
+
u,
|
2083
|
+
a = [],
|
2084
|
+
f = !0,
|
2085
|
+
o = !1;
|
2086
|
+
try {
|
2087
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
2088
|
+
if (Object(t) !== t) return;
|
2089
|
+
f = !1;
|
2090
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
2091
|
+
} catch (r) {
|
2092
|
+
o = !0, n = r;
|
2093
|
+
} finally {
|
2094
|
+
try {
|
2095
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
2096
|
+
} finally {
|
2097
|
+
if (o) throw n;
|
2098
|
+
}
|
2099
|
+
}
|
2100
|
+
return a;
|
2101
|
+
}
|
2102
|
+
}
|
2103
|
+
|
2104
|
+
function _nonIterableRest() {
|
2105
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
2106
|
+
}
|
2107
|
+
|
2108
|
+
function _slicedToArray(r, e) {
|
2109
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
2110
|
+
}
|
2111
|
+
|
2537
2112
|
var urlOf = function urlOf() {
|
2538
2113
|
var route = arguments.length <= 0 ? undefined : arguments[0];
|
2539
2114
|
var query = arguments.length <= 1 ? undefined : arguments[1];
|
@@ -2554,6 +2129,11 @@ var urlOf = function urlOf() {
|
|
2554
2129
|
};
|
2555
2130
|
|
2556
2131
|
exports.Api = Api;
|
2132
|
+
exports.ParentRef = ParentRef$1;
|
2133
|
+
exports.Patch = Patch;
|
2134
|
+
exports.PatchBlock = PatchBlock;
|
2135
|
+
exports.PatchId = PatchId;
|
2136
|
+
exports.PatchJSON = PatchJSON;
|
2557
2137
|
exports.RemirrorBr = RemirrorBr;
|
2558
2138
|
exports.RemirrorBulletList = RemirrorBulletList;
|
2559
2139
|
exports.RemirrorHeading = RemirrorHeading;
|
@@ -2568,7 +2148,6 @@ exports.RemirrorTextMark = RemirrorTextMark;
|
|
2568
2148
|
exports.VAL_ENABLE_COOKIE_NAME = VAL_ENABLE_COOKIE_NAME;
|
2569
2149
|
exports.VAL_SESSION_COOKIE = VAL_SESSION_COOKIE;
|
2570
2150
|
exports.VAL_STATE_COOKIE = VAL_STATE_COOKIE;
|
2571
|
-
exports.ValCache = ValCache;
|
2572
2151
|
exports.createValClient = createValClient;
|
2573
2152
|
exports.remirrorToRichTextSource = remirrorToRichTextSource;
|
2574
2153
|
exports.richTextToRemirror = richTextToRemirror;
|