@valbuild/server 0.154.3 → 0.154.4
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 +14 -0
- package/browser/dist/valbuild-server-browser.cjs.dev.js +4 -4
- package/browser/dist/valbuild-server-browser.cjs.prod.js +4 -4
- package/browser/dist/valbuild-server-browser.esm.js +4 -4
- package/dist/{ValOpsMemory-972616ae.esm.js → ValOpsMemory-82af54c9.esm.js} +33 -14
- package/dist/{ValOpsMemory-45ba05ad.cjs.dev.js → ValOpsMemory-88633e0f.cjs.dev.js} +32 -12
- package/dist/{ValOpsMemory-18337353.cjs.prod.js → ValOpsMemory-a1a58597.cjs.prod.js} +32 -12
- package/dist/{ValPatchStore-df8cdbe7.cjs.dev.js → ValPatchStore-457b166f.cjs.prod.js} +37 -59
- package/dist/{ValPatchStore-e23070df.esm.js → ValPatchStore-9ccc09e7.esm.js} +38 -60
- package/dist/{ValPatchStore-2f92eced.cjs.prod.js → ValPatchStore-b53db740.cjs.dev.js} +37 -59
- package/dist/{ValRouterCore-86757d56.cjs.dev.js → ValRouterCore-65bb6323.cjs.prod.js} +11 -2
- package/dist/{ValRouterCore-5b747abb.cjs.prod.js → ValRouterCore-adb69698.cjs.dev.js} +11 -2
- package/dist/{ValRouterCore-73eb843d.esm.js → ValRouterCore-f7d6394e.esm.js} +11 -2
- package/dist/{createPrettierFormatter-851fcf99.cjs.dev.js → createPrettierFormatter-5d830bdf.cjs.dev.js} +6 -14
- package/dist/{createPrettierFormatter-05ad7480.cjs.prod.js → createPrettierFormatter-b31bfbe5.cjs.prod.js} +6 -14
- package/dist/{createPrettierFormatter-1edca494.esm.js → createPrettierFormatter-ce478de1.esm.js} +7 -15
- package/dist/{createValRuntime-472df6e8.cjs.prod.js → createValRuntime-07bf43dd.cjs.prod.js} +5 -5
- package/dist/{createValRuntime-5cebf459.cjs.dev.js → createValRuntime-858474b4.cjs.dev.js} +5 -5
- package/dist/{createValRuntime-c77ee010.esm.js → createValRuntime-d34c69e8.esm.js} +5 -5
- package/dist/declarations/src/draftReads.d.ts +5 -0
- package/dist/declarations/src/head.d.ts +7 -7
- package/dist/{draftReads-3f7dcda5.cjs.prod.js → draftReads-1f256502.cjs.dev.js} +5 -0
- package/dist/{draftReads-a300a02f.cjs.dev.js → draftReads-27351e97.cjs.prod.js} +5 -0
- package/dist/{draftReads-bca0d49c.esm.js → draftReads-7f0f0eb3.esm.js} +5 -0
- package/dist/{inTabFetch-0c997998.esm.js → inTabFetch-54c1cb83.esm.js} +2 -2
- package/dist/{inTabFetch-c2efa1bd.cjs.prod.js → inTabFetch-e9a48fac.cjs.prod.js} +2 -2
- package/dist/{inTabFetch-db6d6425.cjs.dev.js → inTabFetch-fb9cf5e0.cjs.dev.js} +2 -2
- package/dist/{proposalJsonEntries-0669f027.esm.js → proposalJsonEntries-2cd6f6fe.esm.js} +1 -1
- package/dist/{proposalJsonEntries-26f397bd.cjs.dev.js → proposalJsonEntries-d21900d4.cjs.dev.js} +1 -1
- package/dist/{proposalJsonEntries-9e537244.cjs.prod.js → proposalJsonEntries-d4623810.cjs.prod.js} +1 -1
- package/dist/{publishKit-ac0af189.esm.js → publishKit-4e7a1516.esm.js} +7 -7
- package/dist/{publishKit-38d46a51.cjs.dev.js → publishKit-6b88a02e.cjs.dev.js} +5 -5
- package/dist/{publishKit-7aca03bb.cjs.prod.js → publishKit-cf3858a0.cjs.prod.js} +5 -5
- package/dist/{valRuntime-70ee2dc2.cjs.dev.js → valRuntime-5cadce34.cjs.dev.js} +41 -23
- package/dist/{valRuntime-2a3cc887.cjs.prod.js → valRuntime-ae69b225.cjs.prod.js} +41 -23
- package/dist/{valRuntime-e4d26702.esm.js → valRuntime-ca9958fc.esm.js} +42 -24
- package/dist/valbuild-server.cjs.dev.js +6 -6
- package/dist/valbuild-server.cjs.prod.js +6 -6
- package/dist/valbuild-server.esm.js +9 -9
- package/internal/browser/dist/valbuild-server-internal-browser.cjs.dev.js +5 -5
- package/internal/browser/dist/valbuild-server-internal-browser.cjs.prod.js +5 -5
- package/internal/browser/dist/valbuild-server-internal-browser.esm.js +5 -5
- package/internal/dist/valbuild-server-internal.cjs.dev.js +4 -4
- package/internal/dist/valbuild-server-internal.cjs.prod.js +4 -4
- package/internal/dist/valbuild-server-internal.esm.js +4 -4
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_CONTENT_HOST } from '@valbuild/core';
|
|
2
|
-
import { o as ValOpsMemory,
|
|
3
|
-
import { c as createValRequestHandler } from './ValRouterCore-
|
|
2
|
+
import { o as ValOpsMemory, L as bytesToBase64, V as ValServer } from './ValOpsMemory-82af54c9.esm.js';
|
|
3
|
+
import { c as createValRequestHandler } from './ValRouterCore-f7d6394e.esm.js';
|
|
4
4
|
|
|
5
5
|
const NO_SESSIONS = "Val: sessions are not available here -- this server runs in the browser, " + "has no secret to sign them with, and serves without authenticating.";
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@valbuild/core');
|
|
4
|
-
var ValOpsMemory = require('./ValOpsMemory-
|
|
5
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
4
|
+
var ValOpsMemory = require('./ValOpsMemory-a1a58597.cjs.prod.js');
|
|
5
|
+
var ValRouterCore = require('./ValRouterCore-65bb6323.cjs.prod.js');
|
|
6
6
|
|
|
7
7
|
const NO_SESSIONS = "Val: sessions are not available here -- this server runs in the browser, " + "has no secret to sign them with, and serves without authenticating.";
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@valbuild/core');
|
|
4
|
-
var ValOpsMemory = require('./ValOpsMemory-
|
|
5
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
4
|
+
var ValOpsMemory = require('./ValOpsMemory-88633e0f.cjs.dev.js');
|
|
5
|
+
var ValRouterCore = require('./ValRouterCore-adb69698.cjs.dev.js');
|
|
6
6
|
|
|
7
7
|
const NO_SESSIONS = "Val: sessions are not available here -- this server runs in the browser, " + "has no secret to sign them with, and serves without authenticating.";
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { result, pipe } from '@valbuild/core/fp';
|
|
2
2
|
import ts from 'typescript';
|
|
3
3
|
import { r as resolveExistingJsonPath } from './jsonValuesPatch-13acc674.esm.js';
|
|
4
|
-
import { a as proposalSnapshot, i as isObject, d as isJsonValue } from './createPrettierFormatter-
|
|
4
|
+
import { a as proposalSnapshot, i as isObject, d as isJsonValue } from './createPrettierFormatter-ce478de1.esm.js';
|
|
5
5
|
|
|
6
6
|
class ValSyntaxError {
|
|
7
7
|
constructor(message, node) {
|
package/dist/{proposalJsonEntries-26f397bd.cjs.dev.js → proposalJsonEntries-d21900d4.cjs.dev.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var fp = require('@valbuild/core/fp');
|
|
4
4
|
var ts = require('typescript');
|
|
5
5
|
var jsonValuesPatch = require('./jsonValuesPatch-88bc661d.cjs.dev.js');
|
|
6
|
-
var createPrettierFormatter = require('./createPrettierFormatter-
|
|
6
|
+
var createPrettierFormatter = require('./createPrettierFormatter-5d830bdf.cjs.dev.js');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
9
|
|
package/dist/{proposalJsonEntries-9e537244.cjs.prod.js → proposalJsonEntries-d4623810.cjs.prod.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var fp = require('@valbuild/core/fp');
|
|
4
4
|
var ts = require('typescript');
|
|
5
5
|
var jsonValuesPatch = require('./jsonValuesPatch-92798812.cjs.prod.js');
|
|
6
|
-
var createPrettierFormatter = require('./createPrettierFormatter-
|
|
6
|
+
var createPrettierFormatter = require('./createPrettierFormatter-b31bfbe5.cjs.prod.js');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { result, pipe } from '@valbuild/core/fp';
|
|
3
|
-
import { T as TSOps } from './valRuntime-
|
|
4
|
-
export { h as insertValJsonEntry, f as removeValJsonEntry } from './valRuntime-
|
|
5
|
-
import { a as analyzeValModule, c as analyzeJsonValuesEntries } from './proposalJsonEntries-
|
|
6
|
-
export { c as analyzeJsonValuesEntries, a as analyzeValModule, j as evaluateModuleSource, k as jsonValuesRecordKeys } from './proposalJsonEntries-
|
|
3
|
+
import { T as TSOps } from './valRuntime-ca9958fc.esm.js';
|
|
4
|
+
export { h as insertValJsonEntry, f as removeValJsonEntry } from './valRuntime-ca9958fc.esm.js';
|
|
5
|
+
import { a as analyzeValModule, c as analyzeJsonValuesEntries } from './proposalJsonEntries-2cd6f6fe.esm.js';
|
|
6
|
+
export { c as analyzeJsonValuesEntries, a as analyzeValModule, j as evaluateModuleSource, k as jsonValuesRecordKeys } from './proposalJsonEntries-2cd6f6fe.esm.js';
|
|
7
7
|
import { p as posixPath } from './jsonValuesPatch-13acc674.esm.js';
|
|
8
|
-
import {
|
|
8
|
+
import { N as bytesToUtf8 } from './ValOpsMemory-82af54c9.esm.js';
|
|
9
9
|
import '@valbuild/core';
|
|
10
10
|
import 'path';
|
|
11
11
|
import 'zod';
|
|
@@ -15,11 +15,11 @@ import '@valbuild/shared/internal';
|
|
|
15
15
|
import 'os';
|
|
16
16
|
import 'crypto';
|
|
17
17
|
import 'buffer';
|
|
18
|
-
import './createPrettierFormatter-
|
|
18
|
+
import './createPrettierFormatter-ce478de1.esm.js';
|
|
19
19
|
import '@valbuild/core/patch';
|
|
20
20
|
import 'node:vm';
|
|
21
21
|
import 'node:module';
|
|
22
|
-
import './ValPatchStore-
|
|
22
|
+
import './ValPatchStore-9ccc09e7.esm.js';
|
|
23
23
|
import 'image-size';
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var ts = require('typescript');
|
|
4
4
|
var fp = require('@valbuild/core/fp');
|
|
5
|
-
var valRuntime = require('./valRuntime-
|
|
6
|
-
var proposalJsonEntries = require('./proposalJsonEntries-
|
|
5
|
+
var valRuntime = require('./valRuntime-5cadce34.cjs.dev.js');
|
|
6
|
+
var proposalJsonEntries = require('./proposalJsonEntries-d21900d4.cjs.dev.js');
|
|
7
7
|
var jsonValuesPatch = require('./jsonValuesPatch-88bc661d.cjs.dev.js');
|
|
8
|
-
var ValOpsMemory = require('./ValOpsMemory-
|
|
8
|
+
var ValOpsMemory = require('./ValOpsMemory-88633e0f.cjs.dev.js');
|
|
9
9
|
require('@valbuild/core');
|
|
10
10
|
require('path');
|
|
11
11
|
require('zod');
|
|
@@ -15,11 +15,11 @@ require('@valbuild/shared/internal');
|
|
|
15
15
|
require('os');
|
|
16
16
|
require('crypto');
|
|
17
17
|
require('buffer');
|
|
18
|
-
require('./createPrettierFormatter-
|
|
18
|
+
require('./createPrettierFormatter-5d830bdf.cjs.dev.js');
|
|
19
19
|
require('@valbuild/core/patch');
|
|
20
20
|
require('node:vm');
|
|
21
21
|
require('node:module');
|
|
22
|
-
require('./ValPatchStore-
|
|
22
|
+
require('./ValPatchStore-b53db740.cjs.dev.js');
|
|
23
23
|
require('image-size');
|
|
24
24
|
|
|
25
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var ts = require('typescript');
|
|
4
4
|
var fp = require('@valbuild/core/fp');
|
|
5
|
-
var valRuntime = require('./valRuntime-
|
|
6
|
-
var proposalJsonEntries = require('./proposalJsonEntries-
|
|
5
|
+
var valRuntime = require('./valRuntime-ae69b225.cjs.prod.js');
|
|
6
|
+
var proposalJsonEntries = require('./proposalJsonEntries-d4623810.cjs.prod.js');
|
|
7
7
|
var jsonValuesPatch = require('./jsonValuesPatch-92798812.cjs.prod.js');
|
|
8
|
-
var ValOpsMemory = require('./ValOpsMemory-
|
|
8
|
+
var ValOpsMemory = require('./ValOpsMemory-a1a58597.cjs.prod.js');
|
|
9
9
|
require('@valbuild/core');
|
|
10
10
|
require('path');
|
|
11
11
|
require('zod');
|
|
@@ -15,11 +15,11 @@ require('@valbuild/shared/internal');
|
|
|
15
15
|
require('os');
|
|
16
16
|
require('crypto');
|
|
17
17
|
require('buffer');
|
|
18
|
-
require('./createPrettierFormatter-
|
|
18
|
+
require('./createPrettierFormatter-b31bfbe5.cjs.prod.js');
|
|
19
19
|
require('@valbuild/core/patch');
|
|
20
20
|
require('node:vm');
|
|
21
21
|
require('node:module');
|
|
22
|
-
require('./ValPatchStore-
|
|
22
|
+
require('./ValPatchStore-457b166f.cjs.prod.js');
|
|
23
23
|
require('image-size');
|
|
24
24
|
|
|
25
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@valbuild/core');
|
|
4
|
-
var ValOpsMemory = require('./ValOpsMemory-
|
|
4
|
+
var ValOpsMemory = require('./ValOpsMemory-88633e0f.cjs.dev.js');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var ts = require('typescript');
|
|
7
7
|
var z = require('zod');
|
|
8
8
|
var fs = require('fs');
|
|
9
9
|
var zodValidationError = require('zod-validation-error');
|
|
10
10
|
var fp = require('@valbuild/core/fp');
|
|
11
|
-
var proposalJsonEntries = require('./proposalJsonEntries-
|
|
11
|
+
var proposalJsonEntries = require('./proposalJsonEntries-d21900d4.cjs.dev.js');
|
|
12
12
|
var jsonValuesPatch = require('./jsonValuesPatch-88bc661d.cjs.dev.js');
|
|
13
13
|
var internal = require('@valbuild/shared/internal');
|
|
14
14
|
var os = require('os');
|
|
15
15
|
var crypto$1 = require('crypto');
|
|
16
16
|
var buffer = require('buffer');
|
|
17
|
-
var createPrettierFormatter = require('./createPrettierFormatter-
|
|
17
|
+
var createPrettierFormatter = require('./createPrettierFormatter-5d830bdf.cjs.dev.js');
|
|
18
18
|
var patch = require('@valbuild/core/patch');
|
|
19
19
|
require('node:vm');
|
|
20
20
|
require('node:module');
|
|
@@ -1889,7 +1889,7 @@ function createFsSketchpadStore(rootDir, now = () => new Date()) {
|
|
|
1889
1889
|
* as a bundler does.
|
|
1890
1890
|
*/
|
|
1891
1891
|
function loadTypeScriptKit() {
|
|
1892
|
-
return Promise.resolve().then(function () { return require('./publishKit-
|
|
1892
|
+
return Promise.resolve().then(function () { return require('./publishKit-6b88a02e.cjs.dev.js'); });
|
|
1893
1893
|
}
|
|
1894
1894
|
|
|
1895
1895
|
/** Serializes a schema, or gives up quietly — serialization errors are reported elsewhere. */
|
|
@@ -4192,7 +4192,7 @@ async function stagedModuleSources(files) {
|
|
|
4192
4192
|
parseValFile,
|
|
4193
4193
|
analyzeValModule,
|
|
4194
4194
|
evaluateModuleSource
|
|
4195
|
-
} = await Promise.resolve().then(function () { return require('./publishKit-
|
|
4195
|
+
} = await Promise.resolve().then(function () { return require('./publishKit-6b88a02e.cjs.dev.js'); });
|
|
4196
4196
|
const sources = {};
|
|
4197
4197
|
for (const {
|
|
4198
4198
|
path,
|
|
@@ -5148,7 +5148,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5148
5148
|
branch
|
|
5149
5149
|
})}` : "";
|
|
5150
5150
|
try {
|
|
5151
|
-
const res = await
|
|
5151
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/chain/version${query}`, {
|
|
5152
5152
|
headers: this.authHeaders
|
|
5153
5153
|
});
|
|
5154
5154
|
if (res.status === 404) {
|
|
@@ -5309,7 +5309,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5309
5309
|
* rather than letting the tab talk to content.
|
|
5310
5310
|
*/
|
|
5311
5311
|
async mintPublishToken() {
|
|
5312
|
-
const res = await
|
|
5312
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/publish-token`, {
|
|
5313
5313
|
method: "POST",
|
|
5314
5314
|
headers: this.authHeaders
|
|
5315
5315
|
});
|
|
@@ -5593,7 +5593,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5593
5593
|
}
|
|
5594
5594
|
// Staged module files go with the Source they declare.
|
|
5595
5595
|
const body = (writes === null || writes === void 0 ? void 0 : writes.write) === "files" && init.body !== undefined ? await withStagedModuleSources(init.body) : init.body;
|
|
5596
|
-
const res = await
|
|
5596
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals${path}`, {
|
|
5597
5597
|
method: init.method,
|
|
5598
5598
|
headers: {
|
|
5599
5599
|
...this.authHeaders,
|
|
@@ -5660,7 +5660,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5660
5660
|
message: `Invalid update: ${zodValidationError.fromError(request.error).toString()}`
|
|
5661
5661
|
});
|
|
5662
5662
|
}
|
|
5663
|
-
const content = (path, init = {}) =>
|
|
5663
|
+
const content = (path, init = {}) => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals/${name}${path}`, {
|
|
5664
5664
|
...init,
|
|
5665
5665
|
headers: {
|
|
5666
5666
|
...this.authHeaders,
|
|
@@ -5777,7 +5777,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5777
5777
|
|
|
5778
5778
|
/** Content's proposals API for one proposal, as the person asking. */
|
|
5779
5779
|
proposalContent(name, profileId) {
|
|
5780
|
-
return (path, init = {}) =>
|
|
5780
|
+
return (path, init = {}) => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals/${name}${path}`, {
|
|
5781
5781
|
...init,
|
|
5782
5782
|
headers: {
|
|
5783
5783
|
...this.authHeaders,
|
|
@@ -5937,7 +5937,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5937
5937
|
message: `Invalid update: ${zodValidationError.fromError(request.error).toString()}`
|
|
5938
5938
|
});
|
|
5939
5939
|
}
|
|
5940
|
-
const content = (path, init = {}) =>
|
|
5940
|
+
const content = (path, init = {}) => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals/${name}${path}`, {
|
|
5941
5941
|
...init,
|
|
5942
5942
|
headers: {
|
|
5943
5943
|
...this.authHeaders,
|
|
@@ -6047,7 +6047,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6047
6047
|
}
|
|
6048
6048
|
async callPublishApi(path, init) {
|
|
6049
6049
|
const json = "application/json";
|
|
6050
|
-
const send = async token =>
|
|
6050
|
+
const send = async token => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1${path}`, {
|
|
6051
6051
|
method: init.method,
|
|
6052
6052
|
headers: {
|
|
6053
6053
|
...ValOpsMemory.VAL_CLIENT_HEADERS,
|
|
@@ -6114,7 +6114,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6114
6114
|
async getPresignedAuthNonce(profileId, corsOrigin) {
|
|
6115
6115
|
try {
|
|
6116
6116
|
var _res$headers$get2;
|
|
6117
|
-
const res = await
|
|
6117
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/presigned-auth-nonce`, {
|
|
6118
6118
|
method: "POST",
|
|
6119
6119
|
headers: {
|
|
6120
6120
|
...this.authHeaders,
|
|
@@ -6441,7 +6441,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6441
6441
|
* `applicable/patches`), so its `patches` messages and that stat agree.
|
|
6442
6442
|
*/
|
|
6443
6443
|
relativeTo) {
|
|
6444
|
-
return
|
|
6444
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/websocket/nonces`, {
|
|
6445
6445
|
method: "POST",
|
|
6446
6446
|
body: JSON.stringify({
|
|
6447
6447
|
profileId,
|
|
@@ -6691,7 +6691,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6691
6691
|
}
|
|
6692
6692
|
const searchParams = new URLSearchParams(params);
|
|
6693
6693
|
try {
|
|
6694
|
-
const patchesRes = await
|
|
6694
|
+
const patchesRes = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/applicable/patches${searchParams.size > 0 ? `?${searchParams.toString()}` : ""}`, {
|
|
6695
6695
|
headers: this.authHeaders
|
|
6696
6696
|
});
|
|
6697
6697
|
const patches = [];
|
|
@@ -6825,6 +6825,24 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6825
6825
|
}
|
|
6826
6826
|
};
|
|
6827
6827
|
} catch (err) {
|
|
6828
|
+
if (internal.isCrossRequestError(err)) {
|
|
6829
|
+
/*
|
|
6830
|
+
* Not the network: workerd refused, at once, a promise or I/O object
|
|
6831
|
+
* of another request, so nothing was asked of the content service.
|
|
6832
|
+
* `fetchFresh` already tried once more. A server failure, then --
|
|
6833
|
+
* never `networkError`, which `/stat` answers as a 503 saying the
|
|
6834
|
+
* service could not be reached.
|
|
6835
|
+
*/
|
|
6836
|
+
const details = err instanceof Error ? err.message : String(err);
|
|
6837
|
+
core.Internal.log.error(`Could not get patches. ${details}`);
|
|
6838
|
+
return {
|
|
6839
|
+
patches: [],
|
|
6840
|
+
error: {
|
|
6841
|
+
message: "Val's server could not load your changes, because of an error in Val itself. Trying again usually works.",
|
|
6842
|
+
details
|
|
6843
|
+
}
|
|
6844
|
+
};
|
|
6845
|
+
}
|
|
6828
6846
|
const failure = contentServiceUnreachable(contentServiceName(this.contentUrl), "load your changes", err);
|
|
6829
6847
|
core.Internal.log.error(`Could not get patches. ${failure.message} ${failure.details}`);
|
|
6830
6848
|
return {
|
|
@@ -6839,7 +6857,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6839
6857
|
}
|
|
6840
6858
|
async saveSourceFilePatch(path, patch, patchId, parentRef, authorId, sessionId) {
|
|
6841
6859
|
const baseSha = await this.getBaseSha();
|
|
6842
|
-
return
|
|
6860
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches`, {
|
|
6843
6861
|
method: "POST",
|
|
6844
6862
|
headers: {
|
|
6845
6863
|
...this.authHeaders,
|
|
@@ -6949,7 +6967,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6949
6967
|
*/
|
|
6950
6968
|
async saveBase64EncodedBinaryFileFromPatch(filePathOrRef, parentRef, patchId, data, type, metadata) {
|
|
6951
6969
|
const filePath = filePathOrRef;
|
|
6952
|
-
return
|
|
6970
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches/${patchId}/files`, {
|
|
6953
6971
|
method: "POST",
|
|
6954
6972
|
headers: {
|
|
6955
6973
|
...this.authHeaders,
|
|
@@ -7004,7 +7022,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7004
7022
|
params.set("body_sha",
|
|
7005
7023
|
// We use this for cache invalidation
|
|
7006
7024
|
core.Internal.getSHA256Hash(textEncoder.encode(stringifiedFiles)));
|
|
7007
|
-
return
|
|
7025
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/files?${params}`, {
|
|
7008
7026
|
method: "PUT",
|
|
7009
7027
|
// Yes, PUT is weird. Weirder to have a body in a GET request.
|
|
7010
7028
|
headers: {
|
|
@@ -7161,7 +7179,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7161
7179
|
params.set("file_path", filePath);
|
|
7162
7180
|
params.set("remote", remote.toString());
|
|
7163
7181
|
try {
|
|
7164
|
-
const metadataRes = await
|
|
7182
|
+
const metadataRes = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches/${patchId}/files?${params}`, {
|
|
7165
7183
|
headers: {
|
|
7166
7184
|
...this.authHeaders,
|
|
7167
7185
|
"Content-Type": "application/json"
|
|
@@ -7219,7 +7237,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7219
7237
|
};
|
|
7220
7238
|
}
|
|
7221
7239
|
async deletePatches(patchIds) {
|
|
7222
|
-
return
|
|
7240
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches`, {
|
|
7223
7241
|
method: "DELETE",
|
|
7224
7242
|
headers: {
|
|
7225
7243
|
...this.authHeaders,
|
|
@@ -7291,7 +7309,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7291
7309
|
*/
|
|
7292
7310
|
const proposalName = intoProposal ?? ((_this$proposal4 = this.proposal) === null || _this$proposal4 === void 0 ? void 0 : _this$proposal4.name);
|
|
7293
7311
|
const commitUrl = proposalName !== undefined ? `${this.contentUrl}/v1/${this.project}/proposals/${proposalName}/save` : `${this.contentUrl}/v1/${this.project}/commit`;
|
|
7294
|
-
const res = await
|
|
7312
|
+
const res = await ValOpsMemory.fetchFresh(commitUrl, {
|
|
7295
7313
|
method: "POST",
|
|
7296
7314
|
headers: {
|
|
7297
7315
|
...this.authHeaders,
|
|
@@ -7427,7 +7445,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7427
7445
|
async getHistory(path, schema, commitShaForErrors) {
|
|
7428
7446
|
let res;
|
|
7429
7447
|
try {
|
|
7430
|
-
res = await
|
|
7448
|
+
res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}${path}`, {
|
|
7431
7449
|
headers: {
|
|
7432
7450
|
...this.authHeaders,
|
|
7433
7451
|
"Content-Type": "application/json"
|
|
@@ -7578,7 +7596,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7578
7596
|
}
|
|
7579
7597
|
let res;
|
|
7580
7598
|
try {
|
|
7581
|
-
res = await
|
|
7599
|
+
res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/commits/${commitSha}/file?${params}`, {
|
|
7582
7600
|
headers: {
|
|
7583
7601
|
...this.authHeaders
|
|
7584
7602
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@valbuild/core');
|
|
4
|
-
var ValOpsMemory = require('./ValOpsMemory-
|
|
4
|
+
var ValOpsMemory = require('./ValOpsMemory-a1a58597.cjs.prod.js');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var ts = require('typescript');
|
|
7
7
|
var z = require('zod');
|
|
8
8
|
var fs = require('fs');
|
|
9
9
|
var zodValidationError = require('zod-validation-error');
|
|
10
10
|
var fp = require('@valbuild/core/fp');
|
|
11
|
-
var proposalJsonEntries = require('./proposalJsonEntries-
|
|
11
|
+
var proposalJsonEntries = require('./proposalJsonEntries-d4623810.cjs.prod.js');
|
|
12
12
|
var jsonValuesPatch = require('./jsonValuesPatch-92798812.cjs.prod.js');
|
|
13
13
|
var internal = require('@valbuild/shared/internal');
|
|
14
14
|
var os = require('os');
|
|
15
15
|
var crypto$1 = require('crypto');
|
|
16
16
|
var buffer = require('buffer');
|
|
17
|
-
var createPrettierFormatter = require('./createPrettierFormatter-
|
|
17
|
+
var createPrettierFormatter = require('./createPrettierFormatter-b31bfbe5.cjs.prod.js');
|
|
18
18
|
var patch = require('@valbuild/core/patch');
|
|
19
19
|
require('node:vm');
|
|
20
20
|
require('node:module');
|
|
@@ -1889,7 +1889,7 @@ function createFsSketchpadStore(rootDir, now = () => new Date()) {
|
|
|
1889
1889
|
* as a bundler does.
|
|
1890
1890
|
*/
|
|
1891
1891
|
function loadTypeScriptKit() {
|
|
1892
|
-
return Promise.resolve().then(function () { return require('./publishKit-
|
|
1892
|
+
return Promise.resolve().then(function () { return require('./publishKit-cf3858a0.cjs.prod.js'); });
|
|
1893
1893
|
}
|
|
1894
1894
|
|
|
1895
1895
|
/** Serializes a schema, or gives up quietly — serialization errors are reported elsewhere. */
|
|
@@ -4192,7 +4192,7 @@ async function stagedModuleSources(files) {
|
|
|
4192
4192
|
parseValFile,
|
|
4193
4193
|
analyzeValModule,
|
|
4194
4194
|
evaluateModuleSource
|
|
4195
|
-
} = await Promise.resolve().then(function () { return require('./publishKit-
|
|
4195
|
+
} = await Promise.resolve().then(function () { return require('./publishKit-cf3858a0.cjs.prod.js'); });
|
|
4196
4196
|
const sources = {};
|
|
4197
4197
|
for (const {
|
|
4198
4198
|
path,
|
|
@@ -5148,7 +5148,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5148
5148
|
branch
|
|
5149
5149
|
})}` : "";
|
|
5150
5150
|
try {
|
|
5151
|
-
const res = await
|
|
5151
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/chain/version${query}`, {
|
|
5152
5152
|
headers: this.authHeaders
|
|
5153
5153
|
});
|
|
5154
5154
|
if (res.status === 404) {
|
|
@@ -5309,7 +5309,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5309
5309
|
* rather than letting the tab talk to content.
|
|
5310
5310
|
*/
|
|
5311
5311
|
async mintPublishToken() {
|
|
5312
|
-
const res = await
|
|
5312
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/publish-token`, {
|
|
5313
5313
|
method: "POST",
|
|
5314
5314
|
headers: this.authHeaders
|
|
5315
5315
|
});
|
|
@@ -5593,7 +5593,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5593
5593
|
}
|
|
5594
5594
|
// Staged module files go with the Source they declare.
|
|
5595
5595
|
const body = (writes === null || writes === void 0 ? void 0 : writes.write) === "files" && init.body !== undefined ? await withStagedModuleSources(init.body) : init.body;
|
|
5596
|
-
const res = await
|
|
5596
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals${path}`, {
|
|
5597
5597
|
method: init.method,
|
|
5598
5598
|
headers: {
|
|
5599
5599
|
...this.authHeaders,
|
|
@@ -5660,7 +5660,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5660
5660
|
message: `Invalid update: ${zodValidationError.fromError(request.error).toString()}`
|
|
5661
5661
|
});
|
|
5662
5662
|
}
|
|
5663
|
-
const content = (path, init = {}) =>
|
|
5663
|
+
const content = (path, init = {}) => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals/${name}${path}`, {
|
|
5664
5664
|
...init,
|
|
5665
5665
|
headers: {
|
|
5666
5666
|
...this.authHeaders,
|
|
@@ -5777,7 +5777,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5777
5777
|
|
|
5778
5778
|
/** Content's proposals API for one proposal, as the person asking. */
|
|
5779
5779
|
proposalContent(name, profileId) {
|
|
5780
|
-
return (path, init = {}) =>
|
|
5780
|
+
return (path, init = {}) => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals/${name}${path}`, {
|
|
5781
5781
|
...init,
|
|
5782
5782
|
headers: {
|
|
5783
5783
|
...this.authHeaders,
|
|
@@ -5937,7 +5937,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
5937
5937
|
message: `Invalid update: ${zodValidationError.fromError(request.error).toString()}`
|
|
5938
5938
|
});
|
|
5939
5939
|
}
|
|
5940
|
-
const content = (path, init = {}) =>
|
|
5940
|
+
const content = (path, init = {}) => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/proposals/${name}${path}`, {
|
|
5941
5941
|
...init,
|
|
5942
5942
|
headers: {
|
|
5943
5943
|
...this.authHeaders,
|
|
@@ -6047,7 +6047,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6047
6047
|
}
|
|
6048
6048
|
async callPublishApi(path, init) {
|
|
6049
6049
|
const json = "application/json";
|
|
6050
|
-
const send = async token =>
|
|
6050
|
+
const send = async token => ValOpsMemory.fetchFresh(`${this.contentUrl}/v1${path}`, {
|
|
6051
6051
|
method: init.method,
|
|
6052
6052
|
headers: {
|
|
6053
6053
|
...ValOpsMemory.VAL_CLIENT_HEADERS,
|
|
@@ -6114,7 +6114,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6114
6114
|
async getPresignedAuthNonce(profileId, corsOrigin) {
|
|
6115
6115
|
try {
|
|
6116
6116
|
var _res$headers$get2;
|
|
6117
|
-
const res = await
|
|
6117
|
+
const res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/presigned-auth-nonce`, {
|
|
6118
6118
|
method: "POST",
|
|
6119
6119
|
headers: {
|
|
6120
6120
|
...this.authHeaders,
|
|
@@ -6441,7 +6441,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6441
6441
|
* `applicable/patches`), so its `patches` messages and that stat agree.
|
|
6442
6442
|
*/
|
|
6443
6443
|
relativeTo) {
|
|
6444
|
-
return
|
|
6444
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/websocket/nonces`, {
|
|
6445
6445
|
method: "POST",
|
|
6446
6446
|
body: JSON.stringify({
|
|
6447
6447
|
profileId,
|
|
@@ -6691,7 +6691,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6691
6691
|
}
|
|
6692
6692
|
const searchParams = new URLSearchParams(params);
|
|
6693
6693
|
try {
|
|
6694
|
-
const patchesRes = await
|
|
6694
|
+
const patchesRes = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/applicable/patches${searchParams.size > 0 ? `?${searchParams.toString()}` : ""}`, {
|
|
6695
6695
|
headers: this.authHeaders
|
|
6696
6696
|
});
|
|
6697
6697
|
const patches = [];
|
|
@@ -6825,6 +6825,24 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6825
6825
|
}
|
|
6826
6826
|
};
|
|
6827
6827
|
} catch (err) {
|
|
6828
|
+
if (internal.isCrossRequestError(err)) {
|
|
6829
|
+
/*
|
|
6830
|
+
* Not the network: workerd refused, at once, a promise or I/O object
|
|
6831
|
+
* of another request, so nothing was asked of the content service.
|
|
6832
|
+
* `fetchFresh` already tried once more. A server failure, then --
|
|
6833
|
+
* never `networkError`, which `/stat` answers as a 503 saying the
|
|
6834
|
+
* service could not be reached.
|
|
6835
|
+
*/
|
|
6836
|
+
const details = err instanceof Error ? err.message : String(err);
|
|
6837
|
+
core.Internal.log.error(`Could not get patches. ${details}`);
|
|
6838
|
+
return {
|
|
6839
|
+
patches: [],
|
|
6840
|
+
error: {
|
|
6841
|
+
message: "Val's server could not load your changes, because of an error in Val itself. Trying again usually works.",
|
|
6842
|
+
details
|
|
6843
|
+
}
|
|
6844
|
+
};
|
|
6845
|
+
}
|
|
6828
6846
|
const failure = contentServiceUnreachable(contentServiceName(this.contentUrl), "load your changes", err);
|
|
6829
6847
|
core.Internal.log.error(`Could not get patches. ${failure.message} ${failure.details}`);
|
|
6830
6848
|
return {
|
|
@@ -6839,7 +6857,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6839
6857
|
}
|
|
6840
6858
|
async saveSourceFilePatch(path, patch, patchId, parentRef, authorId, sessionId) {
|
|
6841
6859
|
const baseSha = await this.getBaseSha();
|
|
6842
|
-
return
|
|
6860
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches`, {
|
|
6843
6861
|
method: "POST",
|
|
6844
6862
|
headers: {
|
|
6845
6863
|
...this.authHeaders,
|
|
@@ -6949,7 +6967,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
6949
6967
|
*/
|
|
6950
6968
|
async saveBase64EncodedBinaryFileFromPatch(filePathOrRef, parentRef, patchId, data, type, metadata) {
|
|
6951
6969
|
const filePath = filePathOrRef;
|
|
6952
|
-
return
|
|
6970
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches/${patchId}/files`, {
|
|
6953
6971
|
method: "POST",
|
|
6954
6972
|
headers: {
|
|
6955
6973
|
...this.authHeaders,
|
|
@@ -7004,7 +7022,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7004
7022
|
params.set("body_sha",
|
|
7005
7023
|
// We use this for cache invalidation
|
|
7006
7024
|
core.Internal.getSHA256Hash(textEncoder.encode(stringifiedFiles)));
|
|
7007
|
-
return
|
|
7025
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/files?${params}`, {
|
|
7008
7026
|
method: "PUT",
|
|
7009
7027
|
// Yes, PUT is weird. Weirder to have a body in a GET request.
|
|
7010
7028
|
headers: {
|
|
@@ -7161,7 +7179,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7161
7179
|
params.set("file_path", filePath);
|
|
7162
7180
|
params.set("remote", remote.toString());
|
|
7163
7181
|
try {
|
|
7164
|
-
const metadataRes = await
|
|
7182
|
+
const metadataRes = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches/${patchId}/files?${params}`, {
|
|
7165
7183
|
headers: {
|
|
7166
7184
|
...this.authHeaders,
|
|
7167
7185
|
"Content-Type": "application/json"
|
|
@@ -7219,7 +7237,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7219
7237
|
};
|
|
7220
7238
|
}
|
|
7221
7239
|
async deletePatches(patchIds) {
|
|
7222
|
-
return
|
|
7240
|
+
return ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/patches`, {
|
|
7223
7241
|
method: "DELETE",
|
|
7224
7242
|
headers: {
|
|
7225
7243
|
...this.authHeaders,
|
|
@@ -7291,7 +7309,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7291
7309
|
*/
|
|
7292
7310
|
const proposalName = intoProposal ?? ((_this$proposal4 = this.proposal) === null || _this$proposal4 === void 0 ? void 0 : _this$proposal4.name);
|
|
7293
7311
|
const commitUrl = proposalName !== undefined ? `${this.contentUrl}/v1/${this.project}/proposals/${proposalName}/save` : `${this.contentUrl}/v1/${this.project}/commit`;
|
|
7294
|
-
const res = await
|
|
7312
|
+
const res = await ValOpsMemory.fetchFresh(commitUrl, {
|
|
7295
7313
|
method: "POST",
|
|
7296
7314
|
headers: {
|
|
7297
7315
|
...this.authHeaders,
|
|
@@ -7427,7 +7445,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7427
7445
|
async getHistory(path, schema, commitShaForErrors) {
|
|
7428
7446
|
let res;
|
|
7429
7447
|
try {
|
|
7430
|
-
res = await
|
|
7448
|
+
res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}${path}`, {
|
|
7431
7449
|
headers: {
|
|
7432
7450
|
...this.authHeaders,
|
|
7433
7451
|
"Content-Type": "application/json"
|
|
@@ -7578,7 +7596,7 @@ class ValOpsHttp extends ValOpsMemory.ValOps {
|
|
|
7578
7596
|
}
|
|
7579
7597
|
let res;
|
|
7580
7598
|
try {
|
|
7581
|
-
res = await
|
|
7599
|
+
res = await ValOpsMemory.fetchFresh(`${this.contentUrl}/v1/${this.project}/commits/${commitSha}/file?${params}`, {
|
|
7582
7600
|
headers: {
|
|
7583
7601
|
...this.authHeaders
|
|
7584
7602
|
}
|