@valbuild/tanstack 0.146.4 → 0.147.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/CHANGELOG.md +48 -0
- package/client/dist/valbuild-tanstack-client.cjs.dev.js +6 -6
- package/client/dist/valbuild-tanstack-client.cjs.prod.js +6 -6
- package/client/dist/valbuild-tanstack-client.esm.js +4 -4
- package/demo/dist/valbuild-tanstack-demo.cjs.d.ts +2 -0
- package/demo/dist/valbuild-tanstack-demo.cjs.dev.js +105 -0
- package/demo/dist/valbuild-tanstack-demo.cjs.js +7 -0
- package/demo/dist/valbuild-tanstack-demo.cjs.prod.js +105 -0
- package/demo/dist/valbuild-tanstack-demo.esm.js +101 -0
- package/demo/package.json +4 -0
- package/dist/{ValOverlayContext-3f080cce.cjs.dev.js → ValOverlayContext-510328ec.cjs.dev.js} +17 -17
- package/dist/{ValOverlayContext-59a0b19f.esm.js → ValOverlayContext-6278320b.esm.js} +1 -1
- package/dist/{ValOverlayContext-3e2c48a6.cjs.prod.js → ValOverlayContext-d3acd157.cjs.prod.js} +17 -17
- package/dist/{version-4da65f4f.esm.js → asyncToGenerator-500f022f.esm.js} +1 -149
- package/dist/{version-2cbea560.cjs.prod.js → asyncToGenerator-8e5c36c8.cjs.prod.js} +0 -151
- package/dist/{version-1f65da50.cjs.dev.js → asyncToGenerator-c3823d62.cjs.dev.js} +0 -151
- package/dist/declarations/src/ValApp.d.ts +15 -1
- package/dist/declarations/src/ValProvider.d.ts +1 -0
- package/dist/declarations/src/demo/index.d.ts +7 -0
- package/dist/declarations/src/demo/initValDemoServer.d.ts +27 -0
- package/dist/demoServiceWorker-382e1b63.cjs.dev.js +60 -0
- package/dist/demoServiceWorker-56fd96cf.esm.js +55 -0
- package/dist/demoServiceWorker-994710f7.cjs.prod.js +60 -0
- package/dist/{routeFromVal-385ee69c.cjs.dev.js → routeFromVal-0ea4586f.cjs.dev.js} +17 -24
- package/dist/{routeFromVal-ffa948ef.cjs.prod.js → routeFromVal-97a52f43.cjs.prod.js} +17 -24
- package/dist/{routeFromVal-ae54a17e.esm.js → routeFromVal-9f1f8725.esm.js} +7 -13
- package/dist/{createForOfIteratorHelper-93a62170.esm.js → typeof-66e2d869.esm.js} +11 -1
- package/dist/{createForOfIteratorHelper-9afd7d2d.cjs.prod.js → typeof-8998e126.cjs.prod.js} +11 -0
- package/dist/{createForOfIteratorHelper-4497beef.cjs.dev.js → typeof-dd0246a1.cjs.dev.js} +11 -0
- package/dist/valbuild-tanstack.cjs.dev.js +371 -42
- package/dist/valbuild-tanstack.cjs.prod.js +371 -42
- package/dist/valbuild-tanstack.esm.js +337 -8
- package/dist/version-1ae7092b.esm.js +174 -0
- package/dist/version-83d7f4b7.cjs.prod.js +179 -0
- package/dist/version-a820698f.cjs.dev.js +179 -0
- package/package.json +16 -10
- package/server/dist/valbuild-tanstack-server.cjs.dev.js +60 -75
- package/server/dist/valbuild-tanstack-server.cjs.prod.js +60 -75
- package/server/dist/valbuild-tanstack-server.esm.js +4 -19
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-83d7f4b7.cjs.prod.js');
|
|
6
|
+
var asyncToGenerator = require('../../dist/asyncToGenerator-8e5c36c8.cjs.prod.js');
|
|
6
7
|
var core = require('@valbuild/core');
|
|
7
|
-
var
|
|
8
|
+
var _typeof = require('../../dist/typeof-8998e126.cjs.prod.js');
|
|
8
9
|
var server = require('@valbuild/server');
|
|
9
|
-
var routeFromVal = require('../../dist/routeFromVal-ffa948ef.cjs.prod.js');
|
|
10
10
|
var stega = require('@valbuild/react/stega');
|
|
11
11
|
var internal = require('@valbuild/shared/internal');
|
|
12
|
+
var routeFromVal = require('../../dist/routeFromVal-97a52f43.cjs.prod.js');
|
|
12
13
|
var mcp = require('@valbuild/mcp');
|
|
13
14
|
require('@valbuild/shared/client');
|
|
14
15
|
|
|
@@ -67,9 +68,9 @@ var ENABLED = "1";
|
|
|
67
68
|
function valDraftMode() {
|
|
68
69
|
return {
|
|
69
70
|
isEnabled: function isEnabled() {
|
|
70
|
-
return
|
|
71
|
+
return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee() {
|
|
71
72
|
var _yield$import, getCookie;
|
|
72
|
-
return
|
|
73
|
+
return asyncToGenerator._regenerator().w(function (_context) {
|
|
73
74
|
while (1) switch (_context.p = _context.n) {
|
|
74
75
|
case 0:
|
|
75
76
|
_context.p = 0;
|
|
@@ -88,9 +89,9 @@ function valDraftMode() {
|
|
|
88
89
|
}))();
|
|
89
90
|
},
|
|
90
91
|
enable: function enable() {
|
|
91
|
-
return
|
|
92
|
+
return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2() {
|
|
92
93
|
var _yield$import2, setCookie, getRequest;
|
|
93
|
-
return
|
|
94
|
+
return asyncToGenerator._regenerator().w(function (_context2) {
|
|
94
95
|
while (1) switch (_context2.n) {
|
|
95
96
|
case 0:
|
|
96
97
|
_context2.n = 1;
|
|
@@ -115,9 +116,9 @@ function valDraftMode() {
|
|
|
115
116
|
}))();
|
|
116
117
|
},
|
|
117
118
|
disable: function disable() {
|
|
118
|
-
return
|
|
119
|
+
return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee3() {
|
|
119
120
|
var _yield$import3, deleteCookie;
|
|
120
|
-
return
|
|
121
|
+
return asyncToGenerator._regenerator().w(function (_context3) {
|
|
121
122
|
while (1) switch (_context3.n) {
|
|
122
123
|
case 0:
|
|
123
124
|
_context3.n = 1;
|
|
@@ -156,9 +157,9 @@ function hasValEnableCookieOnServer() {
|
|
|
156
157
|
return _hasValEnableCookieOnServer.apply(this, arguments);
|
|
157
158
|
}
|
|
158
159
|
function _hasValEnableCookieOnServer() {
|
|
159
|
-
_hasValEnableCookieOnServer =
|
|
160
|
+
_hasValEnableCookieOnServer = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee4() {
|
|
160
161
|
var _yield$import4, getCookie;
|
|
161
|
-
return
|
|
162
|
+
return asyncToGenerator._regenerator().w(function (_context4) {
|
|
162
163
|
while (1) switch (_context4.p = _context4.n) {
|
|
163
164
|
case 0:
|
|
164
165
|
_context4.p = 0;
|
|
@@ -204,7 +205,7 @@ var initValApiHandler = function initValApiHandler(valModules, config, draftMode
|
|
|
204
205
|
if (!tanstackVersion) {
|
|
205
206
|
throw new Error("Could not get @valbuild/tanstack package version");
|
|
206
207
|
}
|
|
207
|
-
return server.createValApiRouter(route, server.createValServer(valModules, route,
|
|
208
|
+
return server.createValApiRouter(route, server.createValServer(valModules, route, _typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2({
|
|
208
209
|
versions: {
|
|
209
210
|
/*
|
|
210
211
|
* Reported as `next` because that is the field the wire contract has.
|
|
@@ -249,7 +250,7 @@ var initValApiHandler = function initValApiHandler(valModules, config, draftMode
|
|
|
249
250
|
}
|
|
250
251
|
if ("cookies" in valRes && valRes.cookies) {
|
|
251
252
|
for (var _i = 0, _Object$entries = Object.entries(valRes.cookies); _i < _Object$entries.length; _i++) {
|
|
252
|
-
var _Object$entries$_i =
|
|
253
|
+
var _Object$entries$_i = _typeof._slicedToArray(_Object$entries[_i], 2),
|
|
253
254
|
cookieName = _Object$entries$_i[0],
|
|
254
255
|
cookie = _Object$entries$_i[1];
|
|
255
256
|
headers.append("Set-Cookie", serializeCookie(cookieName, cookie));
|
|
@@ -317,22 +318,6 @@ function initValServer(valModules, config, opts) {
|
|
|
317
318
|
};
|
|
318
319
|
}
|
|
319
320
|
|
|
320
|
-
function _arrayWithoutHoles(r) {
|
|
321
|
-
if (Array.isArray(r)) return createForOfIteratorHelper._arrayLikeToArray(r);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
function _iterableToArray(r) {
|
|
325
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
function _nonIterableSpread() {
|
|
329
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
function _toConsumableArray(r) {
|
|
333
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || createForOfIteratorHelper._unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
334
|
-
}
|
|
335
|
-
|
|
336
321
|
/*
|
|
337
322
|
* NOTE: no `SET_RSC(true)` here, unlike the Next package.
|
|
338
323
|
*
|
|
@@ -387,9 +372,9 @@ function _toConsumableArray(r) {
|
|
|
387
372
|
*/
|
|
388
373
|
function createTanStackRequestScope() {
|
|
389
374
|
var boxes = new WeakMap();
|
|
390
|
-
return /*#__PURE__*/
|
|
375
|
+
return /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee() {
|
|
391
376
|
var request, _yield$import, getRequest, existing, box;
|
|
392
|
-
return
|
|
377
|
+
return asyncToGenerator._regenerator().w(function (_context) {
|
|
393
378
|
while (1) switch (_context.p = _context.n) {
|
|
394
379
|
case 0:
|
|
395
380
|
_context.p = 0;
|
|
@@ -444,9 +429,9 @@ function loadDraftSources(_x, _x2) {
|
|
|
444
429
|
return _loadDraftSources.apply(this, arguments);
|
|
445
430
|
}
|
|
446
431
|
function _loadDraftSources() {
|
|
447
|
-
_loadDraftSources =
|
|
432
|
+
_loadDraftSources = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee8(valServerPromise, sessionCookie) {
|
|
448
433
|
var valServer, treeRes;
|
|
449
|
-
return
|
|
434
|
+
return asyncToGenerator._regenerator().w(function (_context8) {
|
|
450
435
|
while (1) switch (_context8.n) {
|
|
451
436
|
case 0:
|
|
452
437
|
_context8.n = 1;
|
|
@@ -464,7 +449,7 @@ function _loadDraftSources() {
|
|
|
464
449
|
// path, same as the Next package's.
|
|
465
450
|
apply_patches: undefined
|
|
466
451
|
},
|
|
467
|
-
cookies:
|
|
452
|
+
cookies: _typeof._defineProperty({}, internal.VAL_SESSION_COOKIE, sessionCookie)
|
|
468
453
|
});
|
|
469
454
|
case 2:
|
|
470
455
|
treeRes = _context8.v;
|
|
@@ -492,9 +477,9 @@ function _loadDraftSources() {
|
|
|
492
477
|
var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope, snapshot) {
|
|
493
478
|
return function (selector) {
|
|
494
479
|
var exec = /*#__PURE__*/function () {
|
|
495
|
-
var _ref2 =
|
|
480
|
+
var _ref2 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2() {
|
|
496
481
|
var enabled, headers, cookies, host, _cookies, sessionCookie, modules, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10, _t11;
|
|
497
|
-
return
|
|
482
|
+
return asyncToGenerator._regenerator().w(function (_context2) {
|
|
498
483
|
while (1) switch (_context2.p = _context2.n) {
|
|
499
484
|
case 0:
|
|
500
485
|
enabled = false;
|
|
@@ -615,9 +600,9 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
|
|
|
615
600
|
};
|
|
616
601
|
}();
|
|
617
602
|
return exec()["catch"](/*#__PURE__*/function () {
|
|
618
|
-
var _ref3 =
|
|
603
|
+
var _ref3 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee3(err) {
|
|
619
604
|
var _t12, _t13, _t14;
|
|
620
|
-
return
|
|
605
|
+
return asyncToGenerator._regenerator().w(function (_context3) {
|
|
621
606
|
while (1) switch (_context3.n) {
|
|
622
607
|
case 0:
|
|
623
608
|
console.error("Val: failed to fetch ", err);
|
|
@@ -658,11 +643,11 @@ function withJsonValuesEntries(_x4, _x5) {
|
|
|
658
643
|
}
|
|
659
644
|
/** A proposal's saved Source, by module: see `ValProposal` in `@valbuild/server`. */
|
|
660
645
|
function _withJsonValuesEntries() {
|
|
661
|
-
_withJsonValuesEntries =
|
|
646
|
+
_withJsonValuesEntries = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee0(
|
|
662
647
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
663
648
|
selector, sourcesOf) {
|
|
664
649
|
var first, plan, loaded, filled, _t28;
|
|
665
|
-
return
|
|
650
|
+
return asyncToGenerator._regenerator().w(function (_context0) {
|
|
666
651
|
while (1) switch (_context0.n) {
|
|
667
652
|
case 0:
|
|
668
653
|
first = function first(path) {
|
|
@@ -680,9 +665,9 @@ function _withJsonValuesEntries() {
|
|
|
680
665
|
_t28 = Object;
|
|
681
666
|
_context0.n = 2;
|
|
682
667
|
return Promise.all(plan.load.map(/*#__PURE__*/function () {
|
|
683
|
-
var _ref8 =
|
|
668
|
+
var _ref8 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee9(key) {
|
|
684
669
|
var thunk, _t25, _t26, _t27;
|
|
685
|
-
return
|
|
670
|
+
return asyncToGenerator._regenerator().w(function (_context9) {
|
|
686
671
|
while (1) switch (_context9.n) {
|
|
687
672
|
case 0:
|
|
688
673
|
thunk = routeFromVal.bundledJsonEntryImport(plan.module, key);
|
|
@@ -776,9 +761,9 @@ function markContentApplied(http) {
|
|
|
776
761
|
* the browser, by what the editor holds -- old text first on every load.
|
|
777
762
|
*/
|
|
778
763
|
var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled, getCookies, getDraftSourcesScope, snapshot, base) {
|
|
779
|
-
return /*#__PURE__*/
|
|
764
|
+
return /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee4() {
|
|
780
765
|
var onlySnapshot, _yield$getCookies$get, sessionCookie, modules, sources, _i, _Object$entries, _Object$entries$_i, path, module, source, _t15, _t16, _t17, _t18, _t19;
|
|
781
|
-
return
|
|
766
|
+
return asyncToGenerator._regenerator().w(function (_context4) {
|
|
782
767
|
while (1) switch (_context4.p = _context4.n) {
|
|
783
768
|
case 0:
|
|
784
769
|
// At a proposal's address the page needs the snapshot whatever draft mode
|
|
@@ -843,7 +828,7 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
|
|
|
843
828
|
_context4.n = 15;
|
|
844
829
|
break;
|
|
845
830
|
}
|
|
846
|
-
_Object$entries$_i =
|
|
831
|
+
_Object$entries$_i = _typeof._slicedToArray(_Object$entries[_i], 2), path = _Object$entries$_i[0], module = _Object$entries$_i[1];
|
|
847
832
|
if (!(module.patches === undefined)) {
|
|
848
833
|
_context4.n = 12;
|
|
849
834
|
break;
|
|
@@ -862,7 +847,7 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
|
|
|
862
847
|
_context4.n = 11;
|
|
863
848
|
break;
|
|
864
849
|
case 15:
|
|
865
|
-
return _context4.a(2,
|
|
850
|
+
return _context4.a(2, _typeof._objectSpread2(_typeof._objectSpread2({
|
|
866
851
|
sources: sources
|
|
867
852
|
}, snapshot !== undefined ? {
|
|
868
853
|
snapshot: snapshot
|
|
@@ -906,9 +891,9 @@ function withDraftJsonEntries(_x6, _x7, _x8, _x9, _x0) {
|
|
|
906
891
|
return _withDraftJsonEntries.apply(this, arguments);
|
|
907
892
|
}
|
|
908
893
|
function _withDraftJsonEntries() {
|
|
909
|
-
_withDraftJsonEntries =
|
|
894
|
+
_withDraftJsonEntries = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee1(valServerPromise, sessionCookie, moduleFilePath, source, appliedPatchIds) {
|
|
910
895
|
var wire, valServer, cookies, patchesRes, edited, _iterator, _step, _step$value, path, patch, _iterator3, _step3, op, touched, _i2, _touched, _key, keys, draft, i, res, _iterator2, _step2, _step2$value, key, content, _t29, _t30;
|
|
911
|
-
return
|
|
896
|
+
return asyncToGenerator._regenerator().w(function (_context1) {
|
|
912
897
|
while (1) switch (_context1.p = _context1.n) {
|
|
913
898
|
case 0:
|
|
914
899
|
if (!(source === undefined)) {
|
|
@@ -928,7 +913,7 @@ function _withDraftJsonEntries() {
|
|
|
928
913
|
return valServerPromise;
|
|
929
914
|
case 3:
|
|
930
915
|
valServer = _context1.v;
|
|
931
|
-
cookies =
|
|
916
|
+
cookies = _typeof._defineProperty({}, internal.VAL_SESSION_COOKIE, sessionCookie);
|
|
932
917
|
_context1.n = 4;
|
|
933
918
|
return valServer["/patches"]["GET"]({
|
|
934
919
|
query: {
|
|
@@ -946,7 +931,7 @@ function _withDraftJsonEntries() {
|
|
|
946
931
|
return _context1.a(2, undefined);
|
|
947
932
|
case 5:
|
|
948
933
|
edited = new Set();
|
|
949
|
-
_iterator =
|
|
934
|
+
_iterator = _typeof._createForOfIteratorHelper(patchesRes.json.patches);
|
|
950
935
|
_context1.p = 6;
|
|
951
936
|
_iterator.s();
|
|
952
937
|
case 7:
|
|
@@ -961,7 +946,7 @@ function _withDraftJsonEntries() {
|
|
|
961
946
|
}
|
|
962
947
|
return _context1.a(3, 18);
|
|
963
948
|
case 8:
|
|
964
|
-
_iterator3 =
|
|
949
|
+
_iterator3 = _typeof._createForOfIteratorHelper(patch !== null && patch !== void 0 ? patch : []);
|
|
965
950
|
_context1.p = 9;
|
|
966
951
|
_iterator3.s();
|
|
967
952
|
case 10:
|
|
@@ -1023,7 +1008,7 @@ function _withDraftJsonEntries() {
|
|
|
1023
1008
|
_iterator.f();
|
|
1024
1009
|
return _context1.f(21);
|
|
1025
1010
|
case 22:
|
|
1026
|
-
keys = _toConsumableArray(edited);
|
|
1011
|
+
keys = version._toConsumableArray(edited);
|
|
1027
1012
|
draft = wire;
|
|
1028
1013
|
i = 0;
|
|
1029
1014
|
case 23:
|
|
@@ -1051,7 +1036,7 @@ function _withDraftJsonEntries() {
|
|
|
1051
1036
|
}
|
|
1052
1037
|
return _context1.a(2, undefined);
|
|
1053
1038
|
case 25:
|
|
1054
|
-
_iterator2 =
|
|
1039
|
+
_iterator2 = _typeof._createForOfIteratorHelper(res.json.entries);
|
|
1055
1040
|
try {
|
|
1056
1041
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1057
1042
|
_step2$value = _step2.value, key = _step2$value.key, content = _step2$value.content;
|
|
@@ -1074,7 +1059,7 @@ function _withDraftJsonEntries() {
|
|
|
1074
1059
|
return _withDraftJsonEntries.apply(this, arguments);
|
|
1075
1060
|
}
|
|
1076
1061
|
function isRecordOfJsonMarkers(source) {
|
|
1077
|
-
return
|
|
1062
|
+
return _typeof._typeof(source) === "object" && source !== null && !Array.isArray(source) && Object.values(source).some(function (value) {
|
|
1078
1063
|
return core.Internal.isJson(value);
|
|
1079
1064
|
});
|
|
1080
1065
|
}
|
|
@@ -1120,9 +1105,9 @@ function getHost(headers) {
|
|
|
1120
1105
|
|
|
1121
1106
|
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope, snapshot) {
|
|
1122
1107
|
return /*#__PURE__*/function () {
|
|
1123
|
-
var _ref5 =
|
|
1108
|
+
var _ref5 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee5(selector, params) {
|
|
1124
1109
|
var resolvedParams, valModule, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t21;
|
|
1125
|
-
return
|
|
1110
|
+
return asyncToGenerator._regenerator().w(function (_context5) {
|
|
1126
1111
|
while (1) switch (_context5.p = _context5.n) {
|
|
1127
1112
|
case 0:
|
|
1128
1113
|
_context5.n = 1;
|
|
@@ -1243,12 +1228,12 @@ function loadJsonEntryContent(_x11, _x12) {
|
|
|
1243
1228
|
* to the whole server type.
|
|
1244
1229
|
*/
|
|
1245
1230
|
function _loadJsonEntryContent() {
|
|
1246
|
-
_loadJsonEntryContent =
|
|
1231
|
+
_loadJsonEntryContent = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee10(source, key) {
|
|
1247
1232
|
var marker, thunk;
|
|
1248
|
-
return
|
|
1233
|
+
return asyncToGenerator._regenerator().w(function (_context10) {
|
|
1249
1234
|
while (1) switch (_context10.n) {
|
|
1250
1235
|
case 0:
|
|
1251
|
-
if (!(!source ||
|
|
1236
|
+
if (!(!source || _typeof._typeof(source) !== "object")) {
|
|
1252
1237
|
_context10.n = 1;
|
|
1253
1238
|
break;
|
|
1254
1239
|
}
|
|
@@ -1304,7 +1289,7 @@ function snapshotJsonEntry(snapshot, moduleFilePath, key) {
|
|
|
1304
1289
|
status: "absent"
|
|
1305
1290
|
};
|
|
1306
1291
|
}
|
|
1307
|
-
if (source === undefined ||
|
|
1292
|
+
if (source === undefined || _typeof._typeof(source) !== "object" || Array.isArray(source)) {
|
|
1308
1293
|
return {
|
|
1309
1294
|
status: "unavailable"
|
|
1310
1295
|
};
|
|
@@ -1330,8 +1315,8 @@ function resolveDraftOrCommittedEntry(_x13, _x14) {
|
|
|
1330
1315
|
return _resolveDraftOrCommittedEntry.apply(this, arguments);
|
|
1331
1316
|
}
|
|
1332
1317
|
function _resolveDraftOrCommittedEntry() {
|
|
1333
|
-
_resolveDraftOrCommittedEntry =
|
|
1334
|
-
return
|
|
1318
|
+
_resolveDraftOrCommittedEntry = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee11(draft, loadCommitted) {
|
|
1319
|
+
return asyncToGenerator._regenerator().w(function (_context11) {
|
|
1335
1320
|
while (1) switch (_context11.n) {
|
|
1336
1321
|
case 0:
|
|
1337
1322
|
if (!(draft.status === "content")) {
|
|
@@ -1367,10 +1352,10 @@ function loadDraftJsonEntry(_x15, _x16, _x17, _x18) {
|
|
|
1367
1352
|
* the draft read yields nothing.
|
|
1368
1353
|
*/
|
|
1369
1354
|
function _loadDraftJsonEntry() {
|
|
1370
|
-
_loadDraftJsonEntry =
|
|
1355
|
+
_loadDraftJsonEntry = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee12(valServerPromise, getCookies, moduleFilePath, key) {
|
|
1371
1356
|
var _cookies4;
|
|
1372
1357
|
var cookies, valServer, res;
|
|
1373
|
-
return
|
|
1358
|
+
return asyncToGenerator._regenerator().w(function (_context12) {
|
|
1374
1359
|
while (1) switch (_context12.p = _context12.n) {
|
|
1375
1360
|
case 0:
|
|
1376
1361
|
_context12.p = 0;
|
|
@@ -1402,7 +1387,7 @@ function _loadDraftJsonEntry() {
|
|
|
1402
1387
|
limit: undefined,
|
|
1403
1388
|
apply_patches: true
|
|
1404
1389
|
},
|
|
1405
|
-
cookies:
|
|
1390
|
+
cookies: _typeof._defineProperty({}, internal.VAL_SESSION_COOKIE, (_cookies4 = cookies) === null || _cookies4 === void 0 || (_cookies4 = _cookies4.get(internal.VAL_SESSION_COOKIE)) === null || _cookies4 === void 0 ? void 0 : _cookies4.value)
|
|
1406
1391
|
});
|
|
1407
1392
|
case 5:
|
|
1408
1393
|
res = _context12.v;
|
|
@@ -1443,9 +1428,9 @@ function _loadDraftJsonEntry() {
|
|
|
1443
1428
|
}
|
|
1444
1429
|
var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEnabled, getCookies, snapshot) {
|
|
1445
1430
|
return /*#__PURE__*/function () {
|
|
1446
|
-
var _ref6 =
|
|
1431
|
+
var _ref6 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee6(selector, key) {
|
|
1447
1432
|
var enabled, valModule, source, moduleFilePath, draft, content;
|
|
1448
|
-
return
|
|
1433
|
+
return asyncToGenerator._regenerator().w(function (_context6) {
|
|
1449
1434
|
while (1) switch (_context6.p = _context6.n) {
|
|
1450
1435
|
case 0:
|
|
1451
1436
|
enabled = false;
|
|
@@ -1504,9 +1489,9 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
1504
1489
|
};
|
|
1505
1490
|
var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope, snapshot) {
|
|
1506
1491
|
return /*#__PURE__*/function () {
|
|
1507
|
-
var _ref7 =
|
|
1492
|
+
var _ref7 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee7(selector, params) {
|
|
1508
1493
|
var fetchVal, resolvedParams, valModule, path, schema, val, route, _t23, _t24;
|
|
1509
|
-
return
|
|
1494
|
+
return asyncToGenerator._regenerator().w(function (_context7) {
|
|
1510
1495
|
while (1) switch (_context7.n) {
|
|
1511
1496
|
case 0:
|
|
1512
1497
|
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope, snapshot);
|
|
@@ -1564,9 +1549,9 @@ function requestHeaders() {
|
|
|
1564
1549
|
}
|
|
1565
1550
|
/** The request's cookies, in the `{ name, value }` shape the readers want. */
|
|
1566
1551
|
function _requestHeaders() {
|
|
1567
|
-
_requestHeaders =
|
|
1552
|
+
_requestHeaders = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee13() {
|
|
1568
1553
|
var _yield$import2, getRequestHeaders, headers;
|
|
1569
|
-
return
|
|
1554
|
+
return asyncToGenerator._regenerator().w(function (_context13) {
|
|
1570
1555
|
while (1) switch (_context13.n) {
|
|
1571
1556
|
case 0:
|
|
1572
1557
|
_context13.n = 1;
|
|
@@ -1610,9 +1595,9 @@ function requestCookies() {
|
|
|
1610
1595
|
* } = initValContent(config, valModules);
|
|
1611
1596
|
*/
|
|
1612
1597
|
function _requestCookies() {
|
|
1613
|
-
_requestCookies =
|
|
1598
|
+
_requestCookies = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee14() {
|
|
1614
1599
|
var _yield$import3, getCookie;
|
|
1615
|
-
return
|
|
1600
|
+
return asyncToGenerator._regenerator().w(function (_context14) {
|
|
1616
1601
|
while (1) switch (_context14.n) {
|
|
1617
1602
|
case 0:
|
|
1618
1603
|
_context14.n = 1;
|
|
@@ -1652,7 +1637,7 @@ function initValContent(config, valModules, opts) {
|
|
|
1652
1637
|
var isEnabled = function isEnabled() {
|
|
1653
1638
|
return draftMode.isEnabled();
|
|
1654
1639
|
};
|
|
1655
|
-
var valServerPromise = server.createValServer(valModules, valApiEndpoints,
|
|
1640
|
+
var valServerPromise = server.createValServer(valModules, valApiEndpoints, _typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2({
|
|
1656
1641
|
versions: {
|
|
1657
1642
|
// `next` is the field name in the wire contract; see initValServer.
|
|
1658
1643
|
next: tanstackVersion,
|
|
@@ -1701,7 +1686,7 @@ function initValMcp(valModules, config, opts) {
|
|
|
1701
1686
|
if (!tanstackVersion) {
|
|
1702
1687
|
throw new Error("Could not get @valbuild/tanstack package version");
|
|
1703
1688
|
}
|
|
1704
|
-
return mcp.initValMcp(valModules, config,
|
|
1689
|
+
return mcp.initValMcp(valModules, config, _typeof._objectSpread2(_typeof._objectSpread2({}, opts), {}, {
|
|
1705
1690
|
versions: {
|
|
1706
1691
|
next: tanstackVersion
|
|
1707
1692
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-1ae7092b.esm.js';
|
|
2
|
+
import { _ as _asyncToGenerator, a as _regenerator } from '../../dist/asyncToGenerator-500f022f.esm.js';
|
|
2
3
|
import { Internal } from '@valbuild/core';
|
|
3
|
-
import { _ as _objectSpread2, a as _slicedToArray,
|
|
4
|
+
import { _ as _objectSpread2, a as _slicedToArray, b as _createForOfIteratorHelper, g as _defineProperty, c as _typeof } from '../../dist/typeof-66e2d869.esm.js';
|
|
4
5
|
import { createValApiRouter, createValServer, layeredSnapshot, proposalSnapshotForReaders, proposalSnapshot } from '@valbuild/server';
|
|
5
6
|
export { InMemoryPatchStore, createPrettierFormatter } from '@valbuild/server';
|
|
6
|
-
import { _ as _typeof, f as fillJsonValuesRecord, j as jsonValuesRecordToFill, c as initValRouteFromVal, g as getJsonEntryStegaRoot, i as isJsonValuesRecordSchema, a as getValRouteUrlFromVal, b as bundledJsonEntryImport } from '../../dist/routeFromVal-ae54a17e.esm.js';
|
|
7
7
|
import { stegaEncode, SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
|
|
8
8
|
import { memoizePerRequest, VAL_SESSION_COOKIE, JSON_ENTRIES_BATCH_MAX } from '@valbuild/shared/internal';
|
|
9
|
+
import { f as fillJsonValuesRecord, j as jsonValuesRecordToFill, c as initValRouteFromVal, g as getJsonEntryStegaRoot, i as isJsonValuesRecordSchema, a as getValRouteUrlFromVal, b as bundledJsonEntryImport } from '../../dist/routeFromVal-9f1f8725.esm.js';
|
|
9
10
|
import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
|
|
10
11
|
import '@valbuild/shared/client';
|
|
11
12
|
|
|
@@ -296,22 +297,6 @@ function initValServer(valModules, config, opts) {
|
|
|
296
297
|
};
|
|
297
298
|
}
|
|
298
299
|
|
|
299
|
-
function _arrayWithoutHoles(r) {
|
|
300
|
-
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function _iterableToArray(r) {
|
|
304
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
function _nonIterableSpread() {
|
|
308
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function _toConsumableArray(r) {
|
|
312
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
313
|
-
}
|
|
314
|
-
|
|
315
300
|
/*
|
|
316
301
|
* NOTE: no `SET_RSC(true)` here, unlike the Next package.
|
|
317
302
|
*
|