@valbuild/next 0.99.1 → 0.101.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/README.md +232 -0
- package/client/dist/valbuild-next-client.cjs.dev.js +162 -2
- package/client/dist/valbuild-next-client.cjs.prod.js +162 -2
- package/client/dist/valbuild-next-client.esm.js +162 -2
- package/dist/declarations/src/client/initValClient.d.ts +15 -2
- package/dist/declarations/src/external_exempt_from_val_quickjs.d.ts +10 -0
- package/dist/declarations/src/rsc/initValRsc.d.ts +61 -2
- package/dist/{routeFromVal-8855a5cc.esm.js → routeFromVal-263eec96.esm.js} +41 -1
- package/dist/{routeFromVal-13c832b2.cjs.prod.js → routeFromVal-8ac2f984.cjs.prod.js} +43 -0
- package/dist/{routeFromVal-9b610e77.cjs.dev.js → routeFromVal-b48a454a.cjs.dev.js} +43 -0
- package/package.json +7 -7
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +398 -74
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +398 -74
- package/rsc/dist/valbuild-next-rsc.esm.js +398 -74
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('server-only');
|
|
6
|
+
var routeFromVal = require('../../dist/routeFromVal-8ac2f984.cjs.prod.js');
|
|
6
7
|
var objectSpread2 = require('../../dist/objectSpread2-13f847a9.cjs.prod.js');
|
|
7
8
|
var version = require('../../dist/version-0e6da9a7.cjs.prod.js');
|
|
8
9
|
var defineProperty = require('../../dist/defineProperty-8951f469.cjs.prod.js');
|
|
@@ -10,7 +11,6 @@ var stega = require('@valbuild/react/stega');
|
|
|
10
11
|
var core = require('@valbuild/core');
|
|
11
12
|
var internal = require('@valbuild/shared/internal');
|
|
12
13
|
var server = require('@valbuild/server');
|
|
13
|
-
var routeFromVal = require('../../dist/routeFromVal-13c832b2.cjs.prod.js');
|
|
14
14
|
require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
15
15
|
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
16
16
|
require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
|
|
@@ -182,80 +182,383 @@ function getHost(headers) {
|
|
|
182
182
|
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
183
183
|
return /*#__PURE__*/function () {
|
|
184
184
|
var _ref2 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee2(selector, params) {
|
|
185
|
-
var
|
|
185
|
+
var resolvedParams, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t5;
|
|
186
186
|
return version._regenerator().w(function (_context2) {
|
|
187
|
-
while (1) switch (_context2.n) {
|
|
187
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
188
188
|
case 0:
|
|
189
|
-
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
190
189
|
_context2.n = 1;
|
|
191
190
|
return Promise.resolve(params);
|
|
192
191
|
case 1:
|
|
193
192
|
resolvedParams = _context2.v;
|
|
194
193
|
path = selector && core.Internal.getValPath(selector);
|
|
195
|
-
schema = selector && core.Internal.getSchema(selector);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
schema = selector && core.Internal.getSchema(selector); // `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
195
|
+
// entry's backing `*.val.json`, instead of eagerly resolving the whole
|
|
196
|
+
// record via `fetchVal`.
|
|
197
|
+
if (!routeFromVal.isJsonValuesRecordSchema(schema)) {
|
|
198
|
+
_context2.n = 11;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
source = selector && core.Internal.getSource(selector);
|
|
202
|
+
url = routeFromVal.getValRouteUrlFromVal(resolvedParams, "fetchValRoute", path, schema, source);
|
|
203
|
+
if (url) {
|
|
204
|
+
_context2.n = 2;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
return _context2.a(2, null);
|
|
203
208
|
case 2:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
209
|
+
enabled = false;
|
|
210
|
+
_context2.p = 3;
|
|
211
|
+
_context2.n = 4;
|
|
212
|
+
return isEnabled();
|
|
213
|
+
case 4:
|
|
214
|
+
enabled = _context2.v;
|
|
215
|
+
_context2.n = 6;
|
|
216
|
+
break;
|
|
217
|
+
case 5:
|
|
218
|
+
_context2.p = 5;
|
|
219
|
+
_context2.v;
|
|
220
|
+
case 6:
|
|
221
|
+
draft = {
|
|
222
|
+
status: "unavailable"
|
|
223
|
+
};
|
|
224
|
+
if (!(enabled && path)) {
|
|
225
|
+
_context2.n = 8;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
stega.SET_AUTO_TAG_JSX_ENABLED(true);
|
|
229
|
+
_context2.n = 7;
|
|
230
|
+
return loadDraftJsonEntry(valServerPromise, getCookies, path, url);
|
|
231
|
+
case 7:
|
|
232
|
+
draft = _context2.v;
|
|
233
|
+
case 8:
|
|
234
|
+
_context2.n = 9;
|
|
235
|
+
return resolveDraftOrCommittedEntry(draft, function () {
|
|
236
|
+
return loadJsonEntryContent(source, url);
|
|
237
|
+
});
|
|
238
|
+
case 9:
|
|
239
|
+
content = _context2.v;
|
|
240
|
+
if (!(content === undefined)) {
|
|
241
|
+
_context2.n = 10;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
return _context2.a(2, null);
|
|
245
|
+
case 10:
|
|
246
|
+
return _context2.a(2, stega.stegaEncode(content, {
|
|
247
|
+
disabled: !enabled,
|
|
248
|
+
root: routeFromVal.getJsonEntryStegaRoot(selector, url)
|
|
249
|
+
}));
|
|
250
|
+
case 11:
|
|
251
|
+
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
252
|
+
_t5 = selector;
|
|
253
|
+
if (!_t5) {
|
|
254
|
+
_context2.n = 13;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
_context2.n = 12;
|
|
258
|
+
return fetchVal(selector);
|
|
259
|
+
case 12:
|
|
260
|
+
_t5 = _context2.v;
|
|
261
|
+
case 13:
|
|
262
|
+
val = _t5;
|
|
207
263
|
route = routeFromVal.initValRouteFromVal(resolvedParams, "fetchValRoute", path, schema, val);
|
|
208
264
|
return _context2.a(2, route);
|
|
209
265
|
}
|
|
210
|
-
}, _callee2);
|
|
266
|
+
}, _callee2, null, [[3, 5]]);
|
|
211
267
|
}));
|
|
212
268
|
return function (_x, _x2) {
|
|
213
269
|
return _ref2.apply(this, arguments);
|
|
214
270
|
};
|
|
215
271
|
}();
|
|
216
272
|
};
|
|
217
|
-
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Resolves a single `.jsonValues()` entry's content by key from a module's local
|
|
276
|
+
* source markers (one dynamic import). Returns `undefined` when the key is
|
|
277
|
+
* missing or its marker has no runtime thunk (transport marker / draft entry).
|
|
278
|
+
*/
|
|
279
|
+
function loadJsonEntryContent(_x3, _x4) {
|
|
280
|
+
return _loadJsonEntryContent.apply(this, arguments);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Loads a single `.jsonValues()` entry's DRAFT content via the in-process
|
|
284
|
+
* `/json` endpoint (which replays pending patches). Returns `undefined` when the
|
|
285
|
+
* entry has no draft content to serve — the caller then falls back to the
|
|
286
|
+
* locally-bundled committed content.
|
|
287
|
+
*/
|
|
288
|
+
/**
|
|
289
|
+
* What the draft state says about an entry.
|
|
290
|
+
*
|
|
291
|
+
* The three cases have to stay distinct: `absent` is an ANSWER — the entry is not
|
|
292
|
+
* there in the draft state, e.g. a pending patch removed it — while `unavailable`
|
|
293
|
+
* means we could not ask. Collapsing them into `undefined` is what made a
|
|
294
|
+
* draft-deleted entry keep rendering its committed content: the caller could not
|
|
295
|
+
* tell "it is gone" from "ask the committed source instead".
|
|
296
|
+
*/
|
|
297
|
+
/**
|
|
298
|
+
* The slice of `ValServer` the single-entry readers actually use. Narrower than
|
|
299
|
+
* `ValServer` on purpose: it says what the dependency IS, and it lets a test
|
|
300
|
+
* drive these readers with a one-route fake instead of casting a partial object
|
|
301
|
+
* to the whole server type.
|
|
302
|
+
*/
|
|
303
|
+
function _loadJsonEntryContent() {
|
|
304
|
+
_loadJsonEntryContent = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee17(source, key) {
|
|
305
|
+
var marker, thunk;
|
|
306
|
+
return version._regenerator().w(function (_context17) {
|
|
307
|
+
while (1) switch (_context17.n) {
|
|
308
|
+
case 0:
|
|
309
|
+
if (!(!source || routeFromVal._typeof(source) !== "object")) {
|
|
310
|
+
_context17.n = 1;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
return _context17.a(2, undefined);
|
|
314
|
+
case 1:
|
|
315
|
+
marker = source[key];
|
|
316
|
+
if (core.Internal.isJson(marker)) {
|
|
317
|
+
_context17.n = 2;
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
return _context17.a(2, undefined);
|
|
321
|
+
case 2:
|
|
322
|
+
thunk = core.Internal.getJsonImport(marker);
|
|
323
|
+
if (thunk) {
|
|
324
|
+
_context17.n = 3;
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
return _context17.a(2, undefined);
|
|
328
|
+
case 3:
|
|
329
|
+
_context17.n = 4;
|
|
330
|
+
return thunk();
|
|
331
|
+
case 4:
|
|
332
|
+
return _context17.a(2, _context17.v["default"]);
|
|
333
|
+
}
|
|
334
|
+
}, _callee17);
|
|
335
|
+
}));
|
|
336
|
+
return _loadJsonEntryContent.apply(this, arguments);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Picks the content a draft-aware single-entry read should render.
|
|
340
|
+
*
|
|
341
|
+
* The rule the two callers share: the draft state WINS when it has an answer —
|
|
342
|
+
* including the answer "this entry is gone" — and the committed content is used
|
|
343
|
+
* only when there is no draft answer to be had (Val disabled, or we could not
|
|
344
|
+
* ask). Returning `undefined` means "render nothing"; both callers turn that into
|
|
345
|
+
* a null/undefined result.
|
|
346
|
+
*/
|
|
347
|
+
function resolveDraftOrCommittedEntry(_x5, _x6) {
|
|
348
|
+
return _resolveDraftOrCommittedEntry.apply(this, arguments);
|
|
349
|
+
}
|
|
350
|
+
function _resolveDraftOrCommittedEntry() {
|
|
351
|
+
_resolveDraftOrCommittedEntry = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee18(draft, loadCommitted) {
|
|
352
|
+
return version._regenerator().w(function (_context18) {
|
|
353
|
+
while (1) switch (_context18.n) {
|
|
354
|
+
case 0:
|
|
355
|
+
if (!(draft.status === "content")) {
|
|
356
|
+
_context18.n = 1;
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
return _context18.a(2, draft.content);
|
|
360
|
+
case 1:
|
|
361
|
+
if (!(draft.status === "absent")) {
|
|
362
|
+
_context18.n = 2;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
return _context18.a(2, undefined);
|
|
366
|
+
case 2:
|
|
367
|
+
return _context18.a(2, loadCommitted());
|
|
368
|
+
}
|
|
369
|
+
}, _callee18);
|
|
370
|
+
}));
|
|
371
|
+
return _resolveDraftOrCommittedEntry.apply(this, arguments);
|
|
372
|
+
}
|
|
373
|
+
function loadDraftJsonEntry(_x7, _x8, _x9, _x0) {
|
|
374
|
+
return _loadDraftJsonEntry.apply(this, arguments);
|
|
375
|
+
} // The (loosened) content type a single `.jsonValues()` entry resolves to.
|
|
376
|
+
function _loadDraftJsonEntry() {
|
|
377
|
+
_loadDraftJsonEntry = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee19(valServerPromise, getCookies, moduleFilePath, key) {
|
|
378
|
+
var _cookies3;
|
|
379
|
+
var cookies, valServer, res;
|
|
380
|
+
return version._regenerator().w(function (_context19) {
|
|
381
|
+
while (1) switch (_context19.p = _context19.n) {
|
|
382
|
+
case 0:
|
|
383
|
+
_context19.p = 0;
|
|
384
|
+
_context19.n = 1;
|
|
385
|
+
return getCookies();
|
|
386
|
+
case 1:
|
|
387
|
+
cookies = _context19.v;
|
|
388
|
+
_context19.n = 3;
|
|
389
|
+
break;
|
|
390
|
+
case 2:
|
|
391
|
+
_context19.p = 2;
|
|
392
|
+
_context19.v;
|
|
393
|
+
return _context19.a(2, {
|
|
394
|
+
status: "unavailable"
|
|
395
|
+
});
|
|
396
|
+
case 3:
|
|
397
|
+
_context19.n = 4;
|
|
398
|
+
return valServerPromise;
|
|
399
|
+
case 4:
|
|
400
|
+
valServer = _context19.v;
|
|
401
|
+
_context19.n = 5;
|
|
402
|
+
return valServer["/json"]["GET"]({
|
|
403
|
+
query: {
|
|
404
|
+
path: moduleFilePath,
|
|
405
|
+
key: key,
|
|
406
|
+
keys: undefined,
|
|
407
|
+
// single-entry shape
|
|
408
|
+
offset: undefined,
|
|
409
|
+
limit: undefined,
|
|
410
|
+
apply_patches: true
|
|
411
|
+
},
|
|
412
|
+
cookies: defineProperty._defineProperty({}, internal.VAL_SESSION_COOKIE, (_cookies3 = cookies) === null || _cookies3 === void 0 || (_cookies3 = _cookies3.get(internal.VAL_SESSION_COOKIE)) === null || _cookies3 === void 0 ? void 0 : _cookies3.value)
|
|
413
|
+
});
|
|
414
|
+
case 5:
|
|
415
|
+
res = _context19.v;
|
|
416
|
+
if (!(res.status === 200 && "content" in res.json)) {
|
|
417
|
+
_context19.n = 6;
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
return _context19.a(2, {
|
|
421
|
+
status: "content",
|
|
422
|
+
content: res.json.content
|
|
423
|
+
});
|
|
424
|
+
case 6:
|
|
425
|
+
if (!(res.status === 401)) {
|
|
426
|
+
_context19.n = 7;
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
console.warn("Val: authentication error: ", res.json.message);
|
|
430
|
+
return _context19.a(2, {
|
|
431
|
+
status: "unavailable"
|
|
432
|
+
});
|
|
433
|
+
case 7:
|
|
434
|
+
if (!(res.status === 404)) {
|
|
435
|
+
_context19.n = 8;
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
return _context19.a(2, {
|
|
439
|
+
status: "absent"
|
|
440
|
+
});
|
|
441
|
+
case 8:
|
|
442
|
+
console.error("Val: could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
|
|
443
|
+
return _context19.a(2, {
|
|
444
|
+
status: "unavailable"
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}, _callee19, null, [[0, 2]]);
|
|
448
|
+
}));
|
|
449
|
+
return _loadDraftJsonEntry.apply(this, arguments);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
453
|
+
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
454
|
+
*
|
|
455
|
+
* Production (Val disabled): resolves the entry's lazy import thunk from the
|
|
456
|
+
* locally-bundled module. One dynamic import, no server round-trip.
|
|
457
|
+
*
|
|
458
|
+
* Enabled (draft mode): reads the entry through `/json`, which replays pending
|
|
459
|
+
* patches, so uncommitted Studio edits show up. Falls back to the local thunk if
|
|
460
|
+
* the draft read yields nothing.
|
|
461
|
+
*/
|
|
462
|
+
var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEnabled, getCookies) {
|
|
218
463
|
return /*#__PURE__*/function () {
|
|
219
|
-
var _ref3 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee3(selector,
|
|
220
|
-
var
|
|
464
|
+
var _ref3 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee3(selector, key) {
|
|
465
|
+
var enabled, source, moduleFilePath, draft, content;
|
|
221
466
|
return version._regenerator().w(function (_context3) {
|
|
222
|
-
while (1) switch (_context3.n) {
|
|
467
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
468
|
+
case 0:
|
|
469
|
+
enabled = false;
|
|
470
|
+
_context3.p = 1;
|
|
471
|
+
_context3.n = 2;
|
|
472
|
+
return isEnabled();
|
|
473
|
+
case 2:
|
|
474
|
+
enabled = _context3.v;
|
|
475
|
+
_context3.n = 4;
|
|
476
|
+
break;
|
|
477
|
+
case 3:
|
|
478
|
+
_context3.p = 3;
|
|
479
|
+
_context3.v;
|
|
480
|
+
case 4:
|
|
481
|
+
source = selector && core.Internal.getSource(selector);
|
|
482
|
+
moduleFilePath = selector && core.Internal.getValPath(selector);
|
|
483
|
+
draft = {
|
|
484
|
+
status: "unavailable"
|
|
485
|
+
};
|
|
486
|
+
if (!(enabled && moduleFilePath)) {
|
|
487
|
+
_context3.n = 6;
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
stega.SET_AUTO_TAG_JSX_ENABLED(true);
|
|
491
|
+
_context3.n = 5;
|
|
492
|
+
return loadDraftJsonEntry(valServerPromise, getCookies, moduleFilePath, key);
|
|
493
|
+
case 5:
|
|
494
|
+
draft = _context3.v;
|
|
495
|
+
case 6:
|
|
496
|
+
_context3.n = 7;
|
|
497
|
+
return resolveDraftOrCommittedEntry(draft, function () {
|
|
498
|
+
return loadJsonEntryContent(source, key);
|
|
499
|
+
});
|
|
500
|
+
case 7:
|
|
501
|
+
content = _context3.v;
|
|
502
|
+
if (!(content === undefined)) {
|
|
503
|
+
_context3.n = 8;
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
return _context3.a(2, undefined);
|
|
507
|
+
case 8:
|
|
508
|
+
return _context3.a(2, stega.stegaEncode(content, {
|
|
509
|
+
disabled: !enabled,
|
|
510
|
+
root: routeFromVal.getJsonEntryStegaRoot(selector, key)
|
|
511
|
+
}));
|
|
512
|
+
}
|
|
513
|
+
}, _callee3, null, [[1, 3]]);
|
|
514
|
+
}));
|
|
515
|
+
return function (_x1, _x10) {
|
|
516
|
+
return _ref3.apply(this, arguments);
|
|
517
|
+
};
|
|
518
|
+
}();
|
|
519
|
+
};
|
|
520
|
+
var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
521
|
+
return /*#__PURE__*/function () {
|
|
522
|
+
var _ref4 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee4(selector, params) {
|
|
523
|
+
var fetchVal, resolvedParams, path, schema, val, route, _t7, _t8;
|
|
524
|
+
return version._regenerator().w(function (_context4) {
|
|
525
|
+
while (1) switch (_context4.n) {
|
|
223
526
|
case 0:
|
|
224
527
|
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
225
528
|
if (!(params === undefined)) {
|
|
226
|
-
|
|
529
|
+
_context4.n = 1;
|
|
227
530
|
break;
|
|
228
531
|
}
|
|
229
|
-
|
|
230
|
-
|
|
532
|
+
_t7 = undefined;
|
|
533
|
+
_context4.n = 3;
|
|
231
534
|
break;
|
|
232
535
|
case 1:
|
|
233
|
-
|
|
536
|
+
_context4.n = 2;
|
|
234
537
|
return Promise.resolve(params);
|
|
235
538
|
case 2:
|
|
236
|
-
|
|
539
|
+
_t7 = _context4.v;
|
|
237
540
|
case 3:
|
|
238
|
-
resolvedParams =
|
|
541
|
+
resolvedParams = _t7;
|
|
239
542
|
path = selector && core.Internal.getValPath(selector);
|
|
240
543
|
schema = selector && core.Internal.getSchema(selector);
|
|
241
|
-
|
|
242
|
-
if (!
|
|
243
|
-
|
|
544
|
+
_t8 = selector;
|
|
545
|
+
if (!_t8) {
|
|
546
|
+
_context4.n = 5;
|
|
244
547
|
break;
|
|
245
548
|
}
|
|
246
|
-
|
|
549
|
+
_context4.n = 4;
|
|
247
550
|
return fetchVal(selector);
|
|
248
551
|
case 4:
|
|
249
|
-
|
|
552
|
+
_t8 = _context4.v;
|
|
250
553
|
case 5:
|
|
251
|
-
val =
|
|
554
|
+
val = _t8;
|
|
252
555
|
route = routeFromVal.getValRouteUrlFromVal(resolvedParams, "fetchValRouteUrl", path, schema, val);
|
|
253
|
-
return
|
|
556
|
+
return _context4.a(2, route);
|
|
254
557
|
}
|
|
255
|
-
},
|
|
558
|
+
}, _callee4);
|
|
256
559
|
}));
|
|
257
|
-
return function (
|
|
258
|
-
return
|
|
560
|
+
return function (_x11, _x12) {
|
|
561
|
+
return _ref4.apply(this, arguments);
|
|
259
562
|
};
|
|
260
563
|
}();
|
|
261
564
|
};
|
|
@@ -276,19 +579,6 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
276
579
|
}
|
|
277
580
|
}, config), config, {
|
|
278
581
|
isEnabled: function isEnabled() {
|
|
279
|
-
return version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee4() {
|
|
280
|
-
return version._regenerator().w(function (_context4) {
|
|
281
|
-
while (1) switch (_context4.n) {
|
|
282
|
-
case 0:
|
|
283
|
-
_context4.n = 1;
|
|
284
|
-
return rscNextConfig.draftMode();
|
|
285
|
-
case 1:
|
|
286
|
-
return _context4.a(2, _context4.v.isEnabled);
|
|
287
|
-
}
|
|
288
|
-
}, _callee4);
|
|
289
|
-
}))();
|
|
290
|
-
},
|
|
291
|
-
onEnable: function onEnable() {
|
|
292
582
|
return version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee5() {
|
|
293
583
|
return version._regenerator().w(function (_context5) {
|
|
294
584
|
while (1) switch (_context5.n) {
|
|
@@ -296,14 +586,12 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
296
586
|
_context5.n = 1;
|
|
297
587
|
return rscNextConfig.draftMode();
|
|
298
588
|
case 1:
|
|
299
|
-
_context5.v.
|
|
300
|
-
case 2:
|
|
301
|
-
return _context5.a(2);
|
|
589
|
+
return _context5.a(2, _context5.v.isEnabled);
|
|
302
590
|
}
|
|
303
591
|
}, _callee5);
|
|
304
592
|
}))();
|
|
305
593
|
},
|
|
306
|
-
|
|
594
|
+
onEnable: function onEnable() {
|
|
307
595
|
return version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee6() {
|
|
308
596
|
return version._regenerator().w(function (_context6) {
|
|
309
597
|
while (1) switch (_context6.n) {
|
|
@@ -311,35 +599,40 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
311
599
|
_context6.n = 1;
|
|
312
600
|
return rscNextConfig.draftMode();
|
|
313
601
|
case 1:
|
|
314
|
-
_context6.v.
|
|
602
|
+
_context6.v.enable();
|
|
315
603
|
case 2:
|
|
316
604
|
return _context6.a(2);
|
|
317
605
|
}
|
|
318
606
|
}, _callee6);
|
|
319
607
|
}))();
|
|
608
|
+
},
|
|
609
|
+
onDisable: function onDisable() {
|
|
610
|
+
return version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee7() {
|
|
611
|
+
return version._regenerator().w(function (_context7) {
|
|
612
|
+
while (1) switch (_context7.n) {
|
|
613
|
+
case 0:
|
|
614
|
+
_context7.n = 1;
|
|
615
|
+
return rscNextConfig.draftMode();
|
|
616
|
+
case 1:
|
|
617
|
+
_context7.v.disable();
|
|
618
|
+
case 2:
|
|
619
|
+
return _context7.a(2);
|
|
620
|
+
}
|
|
621
|
+
}, _callee7);
|
|
622
|
+
}))();
|
|
320
623
|
}
|
|
321
624
|
});
|
|
322
625
|
return {
|
|
323
626
|
fetchValStega: initFetchValStega(config, valApiEndpoints,
|
|
324
627
|
// TODO: get from config
|
|
325
|
-
valServerPromise, /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function
|
|
326
|
-
return version._regenerator().w(function (_context7) {
|
|
327
|
-
while (1) switch (_context7.n) {
|
|
328
|
-
case 0:
|
|
329
|
-
_context7.n = 1;
|
|
330
|
-
return rscNextConfig.draftMode();
|
|
331
|
-
case 1:
|
|
332
|
-
return _context7.a(2, _context7.v.isEnabled);
|
|
333
|
-
}
|
|
334
|
-
}, _callee7);
|
|
335
|
-
})), /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee8() {
|
|
628
|
+
valServerPromise, /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee8() {
|
|
336
629
|
return version._regenerator().w(function (_context8) {
|
|
337
630
|
while (1) switch (_context8.n) {
|
|
338
631
|
case 0:
|
|
339
632
|
_context8.n = 1;
|
|
340
|
-
return rscNextConfig.
|
|
633
|
+
return rscNextConfig.draftMode();
|
|
341
634
|
case 1:
|
|
342
|
-
return _context8.a(2, _context8.v);
|
|
635
|
+
return _context8.a(2, _context8.v.isEnabled);
|
|
343
636
|
}
|
|
344
637
|
}, _callee8);
|
|
345
638
|
})), /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee9() {
|
|
@@ -347,30 +640,30 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
347
640
|
while (1) switch (_context9.n) {
|
|
348
641
|
case 0:
|
|
349
642
|
_context9.n = 1;
|
|
350
|
-
return rscNextConfig.
|
|
643
|
+
return rscNextConfig.headers();
|
|
351
644
|
case 1:
|
|
352
645
|
return _context9.a(2, _context9.v);
|
|
353
646
|
}
|
|
354
647
|
}, _callee9);
|
|
355
|
-
})))
|
|
356
|
-
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee0() {
|
|
648
|
+
})), /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee0() {
|
|
357
649
|
return version._regenerator().w(function (_context0) {
|
|
358
650
|
while (1) switch (_context0.n) {
|
|
359
651
|
case 0:
|
|
360
652
|
_context0.n = 1;
|
|
361
|
-
return rscNextConfig.
|
|
653
|
+
return rscNextConfig.cookies();
|
|
362
654
|
case 1:
|
|
363
|
-
return _context0.a(2, _context0.v
|
|
655
|
+
return _context0.a(2, _context0.v);
|
|
364
656
|
}
|
|
365
657
|
}, _callee0);
|
|
366
|
-
})),
|
|
658
|
+
}))),
|
|
659
|
+
fetchValKeyStega: initFetchValKeyStega(valServerPromise, /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee1() {
|
|
367
660
|
return version._regenerator().w(function (_context1) {
|
|
368
661
|
while (1) switch (_context1.n) {
|
|
369
662
|
case 0:
|
|
370
663
|
_context1.n = 1;
|
|
371
|
-
return rscNextConfig.
|
|
664
|
+
return rscNextConfig.draftMode();
|
|
372
665
|
case 1:
|
|
373
|
-
return _context1.a(2, _context1.v);
|
|
666
|
+
return _context1.a(2, _context1.v.isEnabled);
|
|
374
667
|
}
|
|
375
668
|
}, _callee1);
|
|
376
669
|
})), /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee10() {
|
|
@@ -384,7 +677,7 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
384
677
|
}
|
|
385
678
|
}, _callee10);
|
|
386
679
|
}))),
|
|
387
|
-
|
|
680
|
+
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee11() {
|
|
388
681
|
return version._regenerator().w(function (_context11) {
|
|
389
682
|
while (1) switch (_context11.n) {
|
|
390
683
|
case 0:
|
|
@@ -414,6 +707,37 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
414
707
|
return _context13.a(2, _context13.v);
|
|
415
708
|
}
|
|
416
709
|
}, _callee13);
|
|
710
|
+
}))),
|
|
711
|
+
fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee14() {
|
|
712
|
+
return version._regenerator().w(function (_context14) {
|
|
713
|
+
while (1) switch (_context14.n) {
|
|
714
|
+
case 0:
|
|
715
|
+
_context14.n = 1;
|
|
716
|
+
return rscNextConfig.draftMode();
|
|
717
|
+
case 1:
|
|
718
|
+
return _context14.a(2, _context14.v.isEnabled);
|
|
719
|
+
}
|
|
720
|
+
}, _callee14);
|
|
721
|
+
})), /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee15() {
|
|
722
|
+
return version._regenerator().w(function (_context15) {
|
|
723
|
+
while (1) switch (_context15.n) {
|
|
724
|
+
case 0:
|
|
725
|
+
_context15.n = 1;
|
|
726
|
+
return rscNextConfig.headers();
|
|
727
|
+
case 1:
|
|
728
|
+
return _context15.a(2, _context15.v);
|
|
729
|
+
}
|
|
730
|
+
}, _callee15);
|
|
731
|
+
})), /*#__PURE__*/version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee16() {
|
|
732
|
+
return version._regenerator().w(function (_context16) {
|
|
733
|
+
while (1) switch (_context16.n) {
|
|
734
|
+
case 0:
|
|
735
|
+
_context16.n = 1;
|
|
736
|
+
return rscNextConfig.cookies();
|
|
737
|
+
case 1:
|
|
738
|
+
return _context16.a(2, _context16.v);
|
|
739
|
+
}
|
|
740
|
+
}, _callee16);
|
|
417
741
|
})))
|
|
418
742
|
};
|
|
419
743
|
}
|