@valbuild/server 0.151.0 → 0.152.1
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 +37 -0
- package/browser/dist/valbuild-server-browser.cjs.dev.js +2 -2
- package/browser/dist/valbuild-server-browser.cjs.prod.js +2 -2
- package/browser/dist/valbuild-server-browser.esm.js +2 -2
- package/dist/{ValRouter-ca467c83.cjs.dev.js → ValRouter-541c76f5.cjs.dev.js} +228 -374
- package/dist/{ValRouter-2827d620.esm.js → ValRouter-b4125d35.esm.js} +229 -375
- package/dist/{ValRouter-d43e0a33.cjs.prod.js → ValRouter-e1e0101b.cjs.prod.js} +228 -374
- package/dist/{ValRouterCore-eb1f53f5.cjs.prod.js → ValRouterCore-0c0359fe.cjs.prod.js} +48 -5
- package/dist/{ValRouterCore-0921fe9c.cjs.dev.js → ValRouterCore-bd3e9b6c.cjs.dev.js} +48 -5
- package/dist/{ValRouterCore-6c29fb75.esm.js → ValRouterCore-eea19e82.esm.js} +48 -5
- package/dist/declarations/src/ValOps.d.ts +20 -2
- package/dist/declarations/src/ValOpsHttp.d.ts +4 -39
- package/dist/declarations/src/patch/ts/jsonValuesModule.d.ts +1 -1
- package/dist/{inTabFetch-35cf5698.cjs.prod.js → inTabFetch-5caf8250.cjs.prod.js} +1 -1
- package/dist/{inTabFetch-49db354b.cjs.dev.js → inTabFetch-6d54acd8.cjs.dev.js} +1 -1
- package/dist/{inTabFetch-0cd45721.esm.js → inTabFetch-de7cf596.esm.js} +1 -1
- package/dist/{publishKit-3afe011d.cjs.dev.js → publishKit-42f08a69.cjs.dev.js} +2 -2
- package/dist/{publishKit-24e1406b.cjs.prod.js → publishKit-9600ecef.cjs.prod.js} +2 -2
- package/dist/{publishKit-d2e3e44d.esm.js → publishKit-c13ba76f.esm.js} +3 -3
- package/dist/valbuild-server.cjs.dev.js +2 -2
- package/dist/valbuild-server.cjs.prod.js +2 -2
- package/dist/valbuild-server.esm.js +4 -4
- package/internal/browser/dist/valbuild-server-internal-browser.cjs.dev.js +2 -2
- package/internal/browser/dist/valbuild-server-internal-browser.cjs.prod.js +2 -2
- package/internal/browser/dist/valbuild-server-internal-browser.esm.js +2 -2
- package/internal/dist/valbuild-server-internal.cjs.dev.js +2 -2
- package/internal/dist/valbuild-server-internal.cjs.prod.js +2 -2
- package/internal/dist/valbuild-server-internal.esm.js +2 -2
- package/package.json +4 -4
|
@@ -5114,12 +5114,16 @@ class ValOps {
|
|
|
5114
5114
|
// sends it again later, so an error line here would be one a minute.
|
|
5115
5115
|
return fp.result.err(saveRes.error);
|
|
5116
5116
|
}
|
|
5117
|
-
core.Internal.log.error(`Could not save source patch at path: '${path}'. Error: ${saveRes.error.errorType === "other" ? saveRes.error.message : saveRes.error.errorType}`);
|
|
5117
|
+
core.Internal.log.error(`Could not save source patch at path: '${path}'. Error: ${saveRes.error.errorType === "other" ? saveRes.error.message : saveRes.error.errorType === "service-error" ? `${saveRes.error.message} (${saveRes.error.details})` : saveRes.error.errorType}`);
|
|
5118
5118
|
if (saveRes.error.errorType === "patch-head-conflict") {
|
|
5119
5119
|
return fp.result.err({
|
|
5120
5120
|
errorType: "patch-head-conflict"
|
|
5121
5121
|
});
|
|
5122
5122
|
}
|
|
5123
|
+
if (saveRes.error.errorType === "service-error") {
|
|
5124
|
+
// Not the patch's fault: the Studio keeps it and offers to retry.
|
|
5125
|
+
return fp.result.err(saveRes.error);
|
|
5126
|
+
}
|
|
5123
5127
|
return fp.result.err({
|
|
5124
5128
|
errorType: "other",
|
|
5125
5129
|
error: saveRes.error
|
|
@@ -5460,6 +5464,18 @@ function isFileSource(value) {
|
|
|
5460
5464
|
return typeof value === "object" && value !== null && "path" in value && typeof value.path === "string";
|
|
5461
5465
|
}
|
|
5462
5466
|
|
|
5467
|
+
/**
|
|
5468
|
+
* The content service failed to take the patch: it answered with a server
|
|
5469
|
+
* error, or could not be reached at all.
|
|
5470
|
+
*
|
|
5471
|
+
* Its own error rather than an `other`, for the same reason
|
|
5472
|
+
* {@link PlanRefusedError} is: an `other` becomes a 400, and the Studio drops a
|
|
5473
|
+
* patch it is told is bad -- the field reverts and the edit is gone. Nothing is
|
|
5474
|
+
* wrong with this patch. The service is, and the Studio keeps the edit and
|
|
5475
|
+
* offers to send it again. Only `retryable` failures are this; a 4xx from the
|
|
5476
|
+
* service is still a refusal of the patch.
|
|
5477
|
+
*/
|
|
5478
|
+
|
|
5463
5479
|
/**
|
|
5464
5480
|
* The content API refused a write for the project's plan (a 403 that says why
|
|
5465
5481
|
* as data), as opposed to refusing the patch.
|
|
@@ -6183,7 +6199,7 @@ var packageJson = {
|
|
|
6183
6199
|
],
|
|
6184
6200
|
exports: true
|
|
6185
6201
|
},
|
|
6186
|
-
version: "0.
|
|
6202
|
+
version: "0.152.1",
|
|
6187
6203
|
scripts: {
|
|
6188
6204
|
typecheck: "tsc --noEmit",
|
|
6189
6205
|
test: "jest",
|
|
@@ -8518,7 +8534,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8518
8534
|
return {
|
|
8519
8535
|
status: 503,
|
|
8520
8536
|
json: {
|
|
8521
|
-
|
|
8537
|
+
// Which service could not be reached, rather than "Network
|
|
8538
|
+
// error": the editor reached THIS server, so it is not theirs.
|
|
8539
|
+
message: currentStat.error.message
|
|
8522
8540
|
}
|
|
8523
8541
|
};
|
|
8524
8542
|
}
|
|
@@ -9074,6 +9092,24 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9074
9092
|
...savedSoFar()
|
|
9075
9093
|
}
|
|
9076
9094
|
};
|
|
9095
|
+
} else if (createPatchRes.error.errorType === "service-error") {
|
|
9096
|
+
/*
|
|
9097
|
+
* The content service failed, not the patch: a 502, never the
|
|
9098
|
+
* 400 below. A 400 tells the Studio the patch is bad, and it
|
|
9099
|
+
* drops it -- the editor's change reverted with nothing said
|
|
9100
|
+
* but "All changes saved". The patches before this one in the
|
|
9101
|
+
* batch ARE saved, and are reported as a 200 would report them,
|
|
9102
|
+
* so a retry sends only what is left.
|
|
9103
|
+
*/
|
|
9104
|
+
return {
|
|
9105
|
+
status: 502,
|
|
9106
|
+
json: {
|
|
9107
|
+
type: "service-error",
|
|
9108
|
+
message: createPatchRes.error.message,
|
|
9109
|
+
details: createPatchRes.error.details,
|
|
9110
|
+
...savedSoFar()
|
|
9111
|
+
}
|
|
9112
|
+
};
|
|
9077
9113
|
} else {
|
|
9078
9114
|
return {
|
|
9079
9115
|
status: 400,
|
|
@@ -9133,11 +9169,18 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9133
9169
|
if (fetchedPatchesRes.error) {
|
|
9134
9170
|
// Error is singular
|
|
9135
9171
|
core.Internal.log.error("Failed to get patches", fetchedPatchesRes.error);
|
|
9172
|
+
const details = fetchedPatchesRes.error.details;
|
|
9136
9173
|
return {
|
|
9137
9174
|
status: 500,
|
|
9138
9175
|
json: {
|
|
9139
9176
|
message: fetchedPatchesRes.error.message,
|
|
9140
|
-
error:
|
|
9177
|
+
error: {
|
|
9178
|
+
message: fetchedPatchesRes.error.message
|
|
9179
|
+
},
|
|
9180
|
+
// What the content service said, for the Studio's "Details".
|
|
9181
|
+
...(typeof details === "string" ? {
|
|
9182
|
+
details
|
|
9183
|
+
} : {})
|
|
9141
9184
|
}
|
|
9142
9185
|
};
|
|
9143
9186
|
}
|
|
@@ -12641,7 +12684,7 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
|
|
|
12641
12684
|
const path = url.pathname.slice(route.length);
|
|
12642
12685
|
if (path === internal.QUICK_PREVIEW_SERVICE_WORKER_PATH) {
|
|
12643
12686
|
/*
|
|
12644
|
-
* The
|
|
12687
|
+
* The quick preview worker (`quickPreview.ts` in
|
|
12645
12688
|
* `@valbuild/shared`). `Service-Worker-Allowed: /` lets a script at
|
|
12646
12689
|
* this path control the whole origin, which it needs: it serves the
|
|
12647
12690
|
* page's `/_app/` files. It serves them only to a page opened as a
|
|
@@ -5114,12 +5114,16 @@ class ValOps {
|
|
|
5114
5114
|
// sends it again later, so an error line here would be one a minute.
|
|
5115
5115
|
return fp.result.err(saveRes.error);
|
|
5116
5116
|
}
|
|
5117
|
-
core.Internal.log.error(`Could not save source patch at path: '${path}'. Error: ${saveRes.error.errorType === "other" ? saveRes.error.message : saveRes.error.errorType}`);
|
|
5117
|
+
core.Internal.log.error(`Could not save source patch at path: '${path}'. Error: ${saveRes.error.errorType === "other" ? saveRes.error.message : saveRes.error.errorType === "service-error" ? `${saveRes.error.message} (${saveRes.error.details})` : saveRes.error.errorType}`);
|
|
5118
5118
|
if (saveRes.error.errorType === "patch-head-conflict") {
|
|
5119
5119
|
return fp.result.err({
|
|
5120
5120
|
errorType: "patch-head-conflict"
|
|
5121
5121
|
});
|
|
5122
5122
|
}
|
|
5123
|
+
if (saveRes.error.errorType === "service-error") {
|
|
5124
|
+
// Not the patch's fault: the Studio keeps it and offers to retry.
|
|
5125
|
+
return fp.result.err(saveRes.error);
|
|
5126
|
+
}
|
|
5123
5127
|
return fp.result.err({
|
|
5124
5128
|
errorType: "other",
|
|
5125
5129
|
error: saveRes.error
|
|
@@ -5460,6 +5464,18 @@ function isFileSource(value) {
|
|
|
5460
5464
|
return typeof value === "object" && value !== null && "path" in value && typeof value.path === "string";
|
|
5461
5465
|
}
|
|
5462
5466
|
|
|
5467
|
+
/**
|
|
5468
|
+
* The content service failed to take the patch: it answered with a server
|
|
5469
|
+
* error, or could not be reached at all.
|
|
5470
|
+
*
|
|
5471
|
+
* Its own error rather than an `other`, for the same reason
|
|
5472
|
+
* {@link PlanRefusedError} is: an `other` becomes a 400, and the Studio drops a
|
|
5473
|
+
* patch it is told is bad -- the field reverts and the edit is gone. Nothing is
|
|
5474
|
+
* wrong with this patch. The service is, and the Studio keeps the edit and
|
|
5475
|
+
* offers to send it again. Only `retryable` failures are this; a 4xx from the
|
|
5476
|
+
* service is still a refusal of the patch.
|
|
5477
|
+
*/
|
|
5478
|
+
|
|
5463
5479
|
/**
|
|
5464
5480
|
* The content API refused a write for the project's plan (a 403 that says why
|
|
5465
5481
|
* as data), as opposed to refusing the patch.
|
|
@@ -6183,7 +6199,7 @@ var packageJson = {
|
|
|
6183
6199
|
],
|
|
6184
6200
|
exports: true
|
|
6185
6201
|
},
|
|
6186
|
-
version: "0.
|
|
6202
|
+
version: "0.152.1",
|
|
6187
6203
|
scripts: {
|
|
6188
6204
|
typecheck: "tsc --noEmit",
|
|
6189
6205
|
test: "jest",
|
|
@@ -8518,7 +8534,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8518
8534
|
return {
|
|
8519
8535
|
status: 503,
|
|
8520
8536
|
json: {
|
|
8521
|
-
|
|
8537
|
+
// Which service could not be reached, rather than "Network
|
|
8538
|
+
// error": the editor reached THIS server, so it is not theirs.
|
|
8539
|
+
message: currentStat.error.message
|
|
8522
8540
|
}
|
|
8523
8541
|
};
|
|
8524
8542
|
}
|
|
@@ -9074,6 +9092,24 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9074
9092
|
...savedSoFar()
|
|
9075
9093
|
}
|
|
9076
9094
|
};
|
|
9095
|
+
} else if (createPatchRes.error.errorType === "service-error") {
|
|
9096
|
+
/*
|
|
9097
|
+
* The content service failed, not the patch: a 502, never the
|
|
9098
|
+
* 400 below. A 400 tells the Studio the patch is bad, and it
|
|
9099
|
+
* drops it -- the editor's change reverted with nothing said
|
|
9100
|
+
* but "All changes saved". The patches before this one in the
|
|
9101
|
+
* batch ARE saved, and are reported as a 200 would report them,
|
|
9102
|
+
* so a retry sends only what is left.
|
|
9103
|
+
*/
|
|
9104
|
+
return {
|
|
9105
|
+
status: 502,
|
|
9106
|
+
json: {
|
|
9107
|
+
type: "service-error",
|
|
9108
|
+
message: createPatchRes.error.message,
|
|
9109
|
+
details: createPatchRes.error.details,
|
|
9110
|
+
...savedSoFar()
|
|
9111
|
+
}
|
|
9112
|
+
};
|
|
9077
9113
|
} else {
|
|
9078
9114
|
return {
|
|
9079
9115
|
status: 400,
|
|
@@ -9133,11 +9169,18 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9133
9169
|
if (fetchedPatchesRes.error) {
|
|
9134
9170
|
// Error is singular
|
|
9135
9171
|
core.Internal.log.error("Failed to get patches", fetchedPatchesRes.error);
|
|
9172
|
+
const details = fetchedPatchesRes.error.details;
|
|
9136
9173
|
return {
|
|
9137
9174
|
status: 500,
|
|
9138
9175
|
json: {
|
|
9139
9176
|
message: fetchedPatchesRes.error.message,
|
|
9140
|
-
error:
|
|
9177
|
+
error: {
|
|
9178
|
+
message: fetchedPatchesRes.error.message
|
|
9179
|
+
},
|
|
9180
|
+
// What the content service said, for the Studio's "Details".
|
|
9181
|
+
...(typeof details === "string" ? {
|
|
9182
|
+
details
|
|
9183
|
+
} : {})
|
|
9141
9184
|
}
|
|
9142
9185
|
};
|
|
9143
9186
|
}
|
|
@@ -12641,7 +12684,7 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
|
|
|
12641
12684
|
const path = url.pathname.slice(route.length);
|
|
12642
12685
|
if (path === internal.QUICK_PREVIEW_SERVICE_WORKER_PATH) {
|
|
12643
12686
|
/*
|
|
12644
|
-
* The
|
|
12687
|
+
* The quick preview worker (`quickPreview.ts` in
|
|
12645
12688
|
* `@valbuild/shared`). `Service-Worker-Allowed: /` lets a script at
|
|
12646
12689
|
* this path control the whole origin, which it needs: it serves the
|
|
12647
12690
|
* page's `/_app/` files. It serves them only to a page opened as a
|
|
@@ -5108,12 +5108,16 @@ class ValOps {
|
|
|
5108
5108
|
// sends it again later, so an error line here would be one a minute.
|
|
5109
5109
|
return result.err(saveRes.error);
|
|
5110
5110
|
}
|
|
5111
|
-
Internal.log.error(`Could not save source patch at path: '${path}'. Error: ${saveRes.error.errorType === "other" ? saveRes.error.message : saveRes.error.errorType}`);
|
|
5111
|
+
Internal.log.error(`Could not save source patch at path: '${path}'. Error: ${saveRes.error.errorType === "other" ? saveRes.error.message : saveRes.error.errorType === "service-error" ? `${saveRes.error.message} (${saveRes.error.details})` : saveRes.error.errorType}`);
|
|
5112
5112
|
if (saveRes.error.errorType === "patch-head-conflict") {
|
|
5113
5113
|
return result.err({
|
|
5114
5114
|
errorType: "patch-head-conflict"
|
|
5115
5115
|
});
|
|
5116
5116
|
}
|
|
5117
|
+
if (saveRes.error.errorType === "service-error") {
|
|
5118
|
+
// Not the patch's fault: the Studio keeps it and offers to retry.
|
|
5119
|
+
return result.err(saveRes.error);
|
|
5120
|
+
}
|
|
5117
5121
|
return result.err({
|
|
5118
5122
|
errorType: "other",
|
|
5119
5123
|
error: saveRes.error
|
|
@@ -5454,6 +5458,18 @@ function isFileSource(value) {
|
|
|
5454
5458
|
return typeof value === "object" && value !== null && "path" in value && typeof value.path === "string";
|
|
5455
5459
|
}
|
|
5456
5460
|
|
|
5461
|
+
/**
|
|
5462
|
+
* The content service failed to take the patch: it answered with a server
|
|
5463
|
+
* error, or could not be reached at all.
|
|
5464
|
+
*
|
|
5465
|
+
* Its own error rather than an `other`, for the same reason
|
|
5466
|
+
* {@link PlanRefusedError} is: an `other` becomes a 400, and the Studio drops a
|
|
5467
|
+
* patch it is told is bad -- the field reverts and the edit is gone. Nothing is
|
|
5468
|
+
* wrong with this patch. The service is, and the Studio keeps the edit and
|
|
5469
|
+
* offers to send it again. Only `retryable` failures are this; a 4xx from the
|
|
5470
|
+
* service is still a refusal of the patch.
|
|
5471
|
+
*/
|
|
5472
|
+
|
|
5457
5473
|
/**
|
|
5458
5474
|
* The content API refused a write for the project's plan (a 403 that says why
|
|
5459
5475
|
* as data), as opposed to refusing the patch.
|
|
@@ -6177,7 +6193,7 @@ var packageJson = {
|
|
|
6177
6193
|
],
|
|
6178
6194
|
exports: true
|
|
6179
6195
|
},
|
|
6180
|
-
version: "0.
|
|
6196
|
+
version: "0.152.1",
|
|
6181
6197
|
scripts: {
|
|
6182
6198
|
typecheck: "tsc --noEmit",
|
|
6183
6199
|
test: "jest",
|
|
@@ -8512,7 +8528,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8512
8528
|
return {
|
|
8513
8529
|
status: 503,
|
|
8514
8530
|
json: {
|
|
8515
|
-
|
|
8531
|
+
// Which service could not be reached, rather than "Network
|
|
8532
|
+
// error": the editor reached THIS server, so it is not theirs.
|
|
8533
|
+
message: currentStat.error.message
|
|
8516
8534
|
}
|
|
8517
8535
|
};
|
|
8518
8536
|
}
|
|
@@ -9068,6 +9086,24 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9068
9086
|
...savedSoFar()
|
|
9069
9087
|
}
|
|
9070
9088
|
};
|
|
9089
|
+
} else if (createPatchRes.error.errorType === "service-error") {
|
|
9090
|
+
/*
|
|
9091
|
+
* The content service failed, not the patch: a 502, never the
|
|
9092
|
+
* 400 below. A 400 tells the Studio the patch is bad, and it
|
|
9093
|
+
* drops it -- the editor's change reverted with nothing said
|
|
9094
|
+
* but "All changes saved". The patches before this one in the
|
|
9095
|
+
* batch ARE saved, and are reported as a 200 would report them,
|
|
9096
|
+
* so a retry sends only what is left.
|
|
9097
|
+
*/
|
|
9098
|
+
return {
|
|
9099
|
+
status: 502,
|
|
9100
|
+
json: {
|
|
9101
|
+
type: "service-error",
|
|
9102
|
+
message: createPatchRes.error.message,
|
|
9103
|
+
details: createPatchRes.error.details,
|
|
9104
|
+
...savedSoFar()
|
|
9105
|
+
}
|
|
9106
|
+
};
|
|
9071
9107
|
} else {
|
|
9072
9108
|
return {
|
|
9073
9109
|
status: 400,
|
|
@@ -9127,11 +9163,18 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9127
9163
|
if (fetchedPatchesRes.error) {
|
|
9128
9164
|
// Error is singular
|
|
9129
9165
|
Internal.log.error("Failed to get patches", fetchedPatchesRes.error);
|
|
9166
|
+
const details = fetchedPatchesRes.error.details;
|
|
9130
9167
|
return {
|
|
9131
9168
|
status: 500,
|
|
9132
9169
|
json: {
|
|
9133
9170
|
message: fetchedPatchesRes.error.message,
|
|
9134
|
-
error:
|
|
9171
|
+
error: {
|
|
9172
|
+
message: fetchedPatchesRes.error.message
|
|
9173
|
+
},
|
|
9174
|
+
// What the content service said, for the Studio's "Details".
|
|
9175
|
+
...(typeof details === "string" ? {
|
|
9176
|
+
details
|
|
9177
|
+
} : {})
|
|
9135
9178
|
}
|
|
9136
9179
|
};
|
|
9137
9180
|
}
|
|
@@ -12635,7 +12678,7 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
|
|
|
12635
12678
|
const path = url.pathname.slice(route.length);
|
|
12636
12679
|
if (path === QUICK_PREVIEW_SERVICE_WORKER_PATH) {
|
|
12637
12680
|
/*
|
|
12638
|
-
* The
|
|
12681
|
+
* The quick preview worker (`quickPreview.ts` in
|
|
12639
12682
|
* `@valbuild/shared`). `Service-Worker-Allowed: /` lets a script at
|
|
12640
12683
|
* this path control the whole origin, which it needs: it serves the
|
|
12641
12684
|
* page's `/_app/` files. It serves them only to a page opened as a
|
|
@@ -720,7 +720,7 @@ export declare abstract class ValOps {
|
|
|
720
720
|
error: GenericErrorMessage;
|
|
721
721
|
} | {
|
|
722
722
|
errorType: "patch-head-conflict";
|
|
723
|
-
} | PlanRefusedError>>;
|
|
723
|
+
} | PlanRefusedError | ServiceErrorSavingPatch>>;
|
|
724
724
|
/**
|
|
725
725
|
* Why a publish cannot happen here, or `null` when one can.
|
|
726
726
|
*
|
|
@@ -1055,7 +1055,25 @@ export type SaveSourceFilePatchResult = result.Result<{
|
|
|
1055
1055
|
errorType: "other";
|
|
1056
1056
|
} & GenericErrorMessage) | {
|
|
1057
1057
|
errorType: "patch-head-conflict";
|
|
1058
|
-
} | PlanRefusedError>;
|
|
1058
|
+
} | PlanRefusedError | ServiceErrorSavingPatch>;
|
|
1059
|
+
/**
|
|
1060
|
+
* The content service failed to take the patch: it answered with a server
|
|
1061
|
+
* error, or could not be reached at all.
|
|
1062
|
+
*
|
|
1063
|
+
* Its own error rather than an `other`, for the same reason
|
|
1064
|
+
* {@link PlanRefusedError} is: an `other` becomes a 400, and the Studio drops a
|
|
1065
|
+
* patch it is told is bad -- the field reverts and the edit is gone. Nothing is
|
|
1066
|
+
* wrong with this patch. The service is, and the Studio keeps the edit and
|
|
1067
|
+
* offers to send it again. Only `retryable` failures are this; a 4xx from the
|
|
1068
|
+
* service is still a refusal of the patch.
|
|
1069
|
+
*/
|
|
1070
|
+
export type ServiceErrorSavingPatch = {
|
|
1071
|
+
errorType: "service-error";
|
|
1072
|
+
/** For the person. See `ContentServiceFailure`. */
|
|
1073
|
+
message: string;
|
|
1074
|
+
/** The status line and the service's own words. */
|
|
1075
|
+
details: string;
|
|
1076
|
+
};
|
|
1059
1077
|
/**
|
|
1060
1078
|
* The content API refused a write for the project's plan (a 403 that says why
|
|
1061
1079
|
* as data), as opposed to refusing the patch.
|
|
@@ -369,33 +369,12 @@ export declare class ValOpsHttp extends ValOps {
|
|
|
369
369
|
* Who may make one is {@link ValOpsHttp.mayWriteFiles}.
|
|
370
370
|
*/
|
|
371
371
|
private static proposalFilesWrite;
|
|
372
|
-
/**
|
|
373
|
-
* The writes the SITE's server may make to a proposal's files: what the
|
|
374
|
-
* design tab does (valbuild/home `docs/design-tab.md`, step 2) -- stage
|
|
375
|
-
* code, build it, and report its typecheck. The tab is served by the site's
|
|
376
|
-
* build so that a build the assistant breaks in the proposal cannot take
|
|
377
|
-
* down the tools it would fix it with; at the proposal's address those
|
|
378
|
-
* tools run on the proposal's own code.
|
|
379
|
-
*
|
|
380
|
-
* The typecheck too, though it blocks the proposal's Publish (adept.md,
|
|
381
|
-
* decision 20): it is the proposal's staged files checked against the
|
|
382
|
-
* site's, the same program from either address, and the content service
|
|
383
|
-
* keeps it only for the inputs it was made from. Without it the tab's
|
|
384
|
-
* Types check, and the assistant's `typecheck`, had nothing to show.
|
|
385
|
-
*
|
|
386
|
-
* And a quick preview: the browser half of a build of the staged files,
|
|
387
|
-
* which Val Build makes and nothing serves.
|
|
388
|
-
*
|
|
389
|
-
* The rest stay the proposal's own: Update from the site and the lockfile
|
|
390
|
-
* are answered from the proposal's build and schemas, and bringing back a
|
|
391
|
-
* point's code is the Studio at its address finishing a restore.
|
|
392
|
-
*/
|
|
393
|
-
private static readonly SITE_MAY_WRITE;
|
|
394
372
|
/**
|
|
395
373
|
* Whether this server may make a write to a proposal's files: the
|
|
396
|
-
* proposal's own server,
|
|
397
|
-
*
|
|
398
|
-
*
|
|
374
|
+
* proposal's own server, to its own files, and no other. The site's server
|
|
375
|
+
* makes none -- code is changed in the proposal's own Studio, in code mode
|
|
376
|
+
* -- and a proposal's address none to another proposal. Either way the
|
|
377
|
+
* site's own files change only when a proposal is merged.
|
|
399
378
|
*/
|
|
400
379
|
private mayWriteFiles;
|
|
401
380
|
/**
|
|
@@ -415,20 +394,6 @@ export declare class ValOpsHttp extends ValOps {
|
|
|
415
394
|
body: string;
|
|
416
395
|
contentType: string;
|
|
417
396
|
}>;
|
|
418
|
-
/**
|
|
419
|
-
* A patch written into a module's FILE in a proposal, and staged there as
|
|
420
|
-
* code: the design tab's `create_patch` (valbuild/home `docs/design-tab.md`).
|
|
421
|
-
* The assistant there changes the proposal's code, so content it writes goes
|
|
422
|
-
* with that code -- a field it just added is filled in the same change, and
|
|
423
|
-
* built and rendered with it -- rather than into the proposal's saves, which
|
|
424
|
-
* the site's server does not write.
|
|
425
|
-
*
|
|
426
|
-
* Answered here, at `POST /<name>/patch-file`: the file is the proposal's
|
|
427
|
-
* copy if it has one, otherwise the one this build was made from, and the
|
|
428
|
-
* patch is written into it as a save writes one (`patchModuleText`). Who may
|
|
429
|
-
* is who may stage files: {@link ValOpsHttp.mayWriteFiles}.
|
|
430
|
-
*/
|
|
431
|
-
private patchFileInProposal;
|
|
432
397
|
/**
|
|
433
398
|
* Update from the site, for a proposal that changes only content
|
|
434
399
|
* (valbuild/home `docs/hosted-publishing.md`, step 8.2, slice 1a): content
|
|
@@ -32,7 +32,7 @@ export declare function jsonValuesRecordKeys(source: ts.Expression): string[];
|
|
|
32
32
|
* as written. An error for anything that is not a literal.
|
|
33
33
|
*
|
|
34
34
|
* What a staging records for a module (`stagedModuleSources`): without the
|
|
35
|
-
* markers, an entry the
|
|
35
|
+
* markers, an entry the assistant added to a record was in the module's code
|
|
36
36
|
* and not in its Source, and an edit into it was undone.
|
|
37
37
|
*/
|
|
38
38
|
export declare function evaluateModuleSource(source: ts.Expression): result.Result<JSONValue, ValSyntaxErrorTree>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@valbuild/core');
|
|
4
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
4
|
+
var ValRouterCore = require('./ValRouterCore-0c0359fe.cjs.prod.js');
|
|
5
5
|
|
|
6
6
|
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.";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@valbuild/core');
|
|
4
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
4
|
+
var ValRouterCore = require('./ValRouterCore-bd3e9b6c.cjs.dev.js');
|
|
5
5
|
|
|
6
6
|
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.";
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_CONTENT_HOST } from '@valbuild/core';
|
|
2
|
-
import { e as ValOpsMemory, M as bytesToBase64, K as ValServer, L as createValRequestHandler } from './ValRouterCore-
|
|
2
|
+
import { e as ValOpsMemory, M as bytesToBase64, K as ValServer, L as createValRequestHandler } from './ValRouterCore-eea19e82.esm.js';
|
|
3
3
|
|
|
4
4
|
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.";
|
|
5
5
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var ts = require('typescript');
|
|
4
4
|
var fp = require('@valbuild/core/fp');
|
|
5
|
-
var ValRouter = require('./ValRouter-
|
|
6
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
5
|
+
var ValRouter = require('./ValRouter-541c76f5.cjs.dev.js');
|
|
6
|
+
var ValRouterCore = require('./ValRouterCore-bd3e9b6c.cjs.dev.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
require('@valbuild/ui/server');
|
|
9
9
|
require('path');
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var ts = require('typescript');
|
|
4
4
|
var fp = require('@valbuild/core/fp');
|
|
5
|
-
var ValRouter = require('./ValRouter-
|
|
6
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
5
|
+
var ValRouter = require('./ValRouter-e1e0101b.cjs.prod.js');
|
|
6
|
+
var ValRouterCore = require('./ValRouterCore-0c0359fe.cjs.prod.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
require('@valbuild/ui/server');
|
|
9
9
|
require('path');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { result, pipe } from '@valbuild/core/fp';
|
|
3
|
-
import { a as analyzeValModule, c as analyzeJsonValuesEntries, T as TSOps } from './ValRouter-
|
|
4
|
-
export { c as analyzeJsonValuesEntries, a as analyzeValModule, a7 as evaluateModuleSource, i as insertValJsonEntry, a8 as jsonValuesRecordKeys, r as removeValJsonEntry } from './ValRouter-
|
|
5
|
-
import { R as bytesToUtf8, S as posixPath } from './ValRouterCore-
|
|
3
|
+
import { a as analyzeValModule, c as analyzeJsonValuesEntries, T as TSOps } from './ValRouter-b4125d35.esm.js';
|
|
4
|
+
export { c as analyzeJsonValuesEntries, a as analyzeValModule, a7 as evaluateModuleSource, i as insertValJsonEntry, a8 as jsonValuesRecordKeys, r as removeValJsonEntry } from './ValRouter-b4125d35.esm.js';
|
|
5
|
+
import { R as bytesToUtf8, S as posixPath } from './ValRouterCore-eea19e82.esm.js';
|
|
6
6
|
import '@valbuild/core';
|
|
7
7
|
import '@valbuild/ui/server';
|
|
8
8
|
import 'path';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ValRouter = require('./ValRouter-
|
|
5
|
+
var ValRouter = require('./ValRouter-541c76f5.cjs.dev.js');
|
|
6
6
|
var patch = require('@valbuild/core/patch');
|
|
7
7
|
var fp = require('@valbuild/core/fp');
|
|
8
8
|
var core = require('@valbuild/core');
|
|
@@ -11,7 +11,7 @@ var path = require('path');
|
|
|
11
11
|
var fs = require('fs');
|
|
12
12
|
var vm = require('node:vm');
|
|
13
13
|
var node_module = require('node:module');
|
|
14
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
14
|
+
var ValRouterCore = require('./ValRouterCore-bd3e9b6c.cjs.dev.js');
|
|
15
15
|
var internal = require('@valbuild/shared/internal');
|
|
16
16
|
var sucrase = require('sucrase');
|
|
17
17
|
var fs$1 = require('fs/promises');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ValRouter = require('./ValRouter-
|
|
5
|
+
var ValRouter = require('./ValRouter-e1e0101b.cjs.prod.js');
|
|
6
6
|
var patch = require('@valbuild/core/patch');
|
|
7
7
|
var fp = require('@valbuild/core/fp');
|
|
8
8
|
var core = require('@valbuild/core');
|
|
@@ -11,7 +11,7 @@ var path = require('path');
|
|
|
11
11
|
var fs = require('fs');
|
|
12
12
|
var vm = require('node:vm');
|
|
13
13
|
var node_module = require('node:module');
|
|
14
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
14
|
+
var ValRouterCore = require('./ValRouterCore-0c0359fe.cjs.prod.js');
|
|
15
15
|
var internal = require('@valbuild/shared/internal');
|
|
16
16
|
var sucrase = require('sucrase');
|
|
17
17
|
var fs$1 = require('fs/promises');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TSOps, a as analyzeValModule, f as flatMapErrors, b as formatSyntaxError, c as analyzeJsonValuesEntries, r as removeValJsonEntry, i as insertValJsonEntry, d as collectionReferencePatches, e as checkGalleryFiles, h as handleVideoUploadRemote, g as handleVideoDownloadRemote, j as handleVideosetMetadata, k as handleVideosetUploadRemote, l as handleVideosetCheckRemote, m as handleVideosetCheckAllFiles, n as canReadVideoMetadata, u as unreadableVideoMetadataMessage, o as localFilesWarning, p as openRemoteUploadSession, q as uploadBytesToRemote, s as getPersonalAccessTokenPath, V as ValOpsFS } from './ValRouter-
|
|
2
|
-
export { F as APP_MODE_REQUIRES_REMOTE_FILES, V as ValOpsFS, X as ValOpsHttp, a as analyzeValModule, R as checkRemoteRef, x as contentFromEnv, H as createFixPatch, t as createValApiRouter, D as createValOps, v as createValServer, a0 as decodeJwtWithoutVerifying, _ as describePatchStoreProblems, S as downloadFileFromRemote, a2 as encodeJwt, M as extractFileMetadata, L as extractImageMetadata, N as extractVideoMetadata, O as extractVideoMetadataFromFile, P as filesOfVideo, J as filesOfVideosetEntry, G as formatSyntaxErrorTree, U as getCachedRemoteFileDir, W as getCachedRemoteFilePath, a1 as getExpire, s as getPersonalAccessTokenPath, Q as getValidationErrorFileRef, m as handleVideosetCheckAllFiles, l as handleVideosetCheckRemote, j as handleVideosetMetadata, k as handleVideosetUploadRemote, C as initHandlerOptions, z as layeredSnapshot, Y as loadTypeScriptKit, K as parsePersonalAccessTokenFile, y as proposalFromEnv, A as proposalSnapshot, B as proposalSnapshotForReaders, Z as readPatchStore, E as resolveRemoteFileAuth, w as safeReadGit, $ as verifyJwt, I as videosetEntryVideoSchema } from './ValRouter-
|
|
1
|
+
import { T as TSOps, a as analyzeValModule, f as flatMapErrors, b as formatSyntaxError, c as analyzeJsonValuesEntries, r as removeValJsonEntry, i as insertValJsonEntry, d as collectionReferencePatches, e as checkGalleryFiles, h as handleVideoUploadRemote, g as handleVideoDownloadRemote, j as handleVideosetMetadata, k as handleVideosetUploadRemote, l as handleVideosetCheckRemote, m as handleVideosetCheckAllFiles, n as canReadVideoMetadata, u as unreadableVideoMetadataMessage, o as localFilesWarning, p as openRemoteUploadSession, q as uploadBytesToRemote, s as getPersonalAccessTokenPath, V as ValOpsFS } from './ValRouter-b4125d35.esm.js';
|
|
2
|
+
export { F as APP_MODE_REQUIRES_REMOTE_FILES, V as ValOpsFS, X as ValOpsHttp, a as analyzeValModule, R as checkRemoteRef, x as contentFromEnv, H as createFixPatch, t as createValApiRouter, D as createValOps, v as createValServer, a0 as decodeJwtWithoutVerifying, _ as describePatchStoreProblems, S as downloadFileFromRemote, a2 as encodeJwt, M as extractFileMetadata, L as extractImageMetadata, N as extractVideoMetadata, O as extractVideoMetadataFromFile, P as filesOfVideo, J as filesOfVideosetEntry, G as formatSyntaxErrorTree, U as getCachedRemoteFileDir, W as getCachedRemoteFilePath, a1 as getExpire, s as getPersonalAccessTokenPath, Q as getValidationErrorFileRef, m as handleVideosetCheckAllFiles, l as handleVideosetCheckRemote, j as handleVideosetMetadata, k as handleVideosetUploadRemote, C as initHandlerOptions, z as layeredSnapshot, Y as loadTypeScriptKit, K as parsePersonalAccessTokenFile, y as proposalFromEnv, A as proposalSnapshot, B as proposalSnapshotForReaders, Z as readPatchStore, E as resolveRemoteFileAuth, w as safeReadGit, $ as verifyJwt, I as videosetEntryVideoSchema } from './ValRouter-b4125d35.esm.js';
|
|
3
3
|
import { applyPatch, PatchError, JSONOps, deepClone } from '@valbuild/core/patch';
|
|
4
4
|
import { pipe, result } from '@valbuild/core/fp';
|
|
5
5
|
import { derefPatch, Internal, extractValModules, DEFAULT_CONTENT_HOST } from '@valbuild/core';
|
|
@@ -9,8 +9,8 @@ import path from 'path';
|
|
|
9
9
|
import fs from 'fs';
|
|
10
10
|
import vm from 'node:vm';
|
|
11
11
|
import { Module } from 'node:module';
|
|
12
|
-
import { r as resolveExistingJsonPath, f as findNestedJsonValuesRecords, v as validateJsonValuesEntries, g as getNewJsonEntryPaths, a as formatPatchSourceError, V as VAL_CLIENT_HEADERS } from './ValRouterCore-
|
|
13
|
-
export { I as InMemoryPatchStore, e as ValOpsMemory, b as askOncePerHost, a as formatPatchSourceError, d as getFileExt, c as getSettings, u as uploadRemoteFile } from './ValRouterCore-
|
|
12
|
+
import { r as resolveExistingJsonPath, f as findNestedJsonValuesRecords, v as validateJsonValuesEntries, g as getNewJsonEntryPaths, a as formatPatchSourceError, V as VAL_CLIENT_HEADERS } from './ValRouterCore-eea19e82.esm.js';
|
|
13
|
+
export { I as InMemoryPatchStore, e as ValOpsMemory, b as askOncePerHost, a as formatPatchSourceError, d as getFileExt, c as getSettings, u as uploadRemoteFile } from './ValRouterCore-eea19e82.esm.js';
|
|
14
14
|
import { isJsonValuesRootOp, rebaseContentOp, classifyJsonValuesOp, richTextImageSchema } from '@valbuild/shared/internal';
|
|
15
15
|
export { classifyJsonValuesOp, rebaseContentOp } from '@valbuild/shared/internal';
|
|
16
16
|
import { transform } from 'sucrase';
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var inTabFetch = require('../../../dist/inTabFetch-
|
|
5
|
+
var inTabFetch = require('../../../dist/inTabFetch-6d54acd8.cjs.dev.js');
|
|
6
6
|
var draftReads = require('../../../dist/draftReads-05415ff6.cjs.dev.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
|
-
require('../../../dist/ValRouterCore-
|
|
8
|
+
require('../../../dist/ValRouterCore-bd3e9b6c.cjs.dev.js');
|
|
9
9
|
require('zod');
|
|
10
10
|
require('@valbuild/shared/internal');
|
|
11
11
|
require('zod-validation-error');
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var inTabFetch = require('../../../dist/inTabFetch-
|
|
5
|
+
var inTabFetch = require('../../../dist/inTabFetch-5caf8250.cjs.prod.js');
|
|
6
6
|
var draftReads = require('../../../dist/draftReads-ea3946e0.cjs.prod.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
|
-
require('../../../dist/ValRouterCore-
|
|
8
|
+
require('../../../dist/ValRouterCore-0c0359fe.cjs.prod.js');
|
|
9
9
|
require('zod');
|
|
10
10
|
require('@valbuild/shared/internal');
|
|
11
11
|
require('zod-validation-error');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as createInTabVal } from '../../../dist/inTabFetch-
|
|
1
|
+
export { a as createInTabVal } from '../../../dist/inTabFetch-de7cf596.esm.js';
|
|
2
2
|
export { s as serverDraftSource } from '../../../dist/draftReads-5f99edd3.esm.js';
|
|
3
3
|
import '@valbuild/core';
|
|
4
|
-
import '../../../dist/ValRouterCore-
|
|
4
|
+
import '../../../dist/ValRouterCore-eea19e82.esm.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '@valbuild/shared/internal';
|
|
7
7
|
import 'zod-validation-error';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ValRouter = require('../../dist/ValRouter-
|
|
5
|
+
var ValRouter = require('../../dist/ValRouter-541c76f5.cjs.dev.js');
|
|
6
6
|
var draftReads = require('../../dist/draftReads-05415ff6.cjs.dev.js');
|
|
7
|
-
var ValRouterCore = require('../../dist/ValRouterCore-
|
|
7
|
+
var ValRouterCore = require('../../dist/ValRouterCore-bd3e9b6c.cjs.dev.js');
|
|
8
8
|
require('@valbuild/core');
|
|
9
9
|
require('@valbuild/ui/server');
|
|
10
10
|
require('path');
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ValRouter = require('../../dist/ValRouter-
|
|
5
|
+
var ValRouter = require('../../dist/ValRouter-e1e0101b.cjs.prod.js');
|
|
6
6
|
var draftReads = require('../../dist/draftReads-ea3946e0.cjs.prod.js');
|
|
7
|
-
var ValRouterCore = require('../../dist/ValRouterCore-
|
|
7
|
+
var ValRouterCore = require('../../dist/ValRouterCore-0c0359fe.cjs.prod.js');
|
|
8
8
|
require('@valbuild/core');
|
|
9
9
|
require('@valbuild/ui/server');
|
|
10
10
|
require('path');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { a3 as createValRuntime, a4 as proposalAsBuilt, a5 as stagedAfterBuild, a6 as valRuntime } from '../../dist/ValRouter-
|
|
1
|
+
export { a3 as createValRuntime, a4 as proposalAsBuilt, a5 as stagedAfterBuild, a6 as valRuntime } from '../../dist/ValRouter-b4125d35.esm.js';
|
|
2
2
|
export { d as draftForRequest, r as readDraftChanges, a as readerSchemaVersion, s as serverDraftSource } from '../../dist/draftReads-5f99edd3.esm.js';
|
|
3
|
-
export { P as HEAD_BUDGET_BYTES, Q as HEAD_VERSIONS_PER_MODULE, N as ValHead, O as headWork } from '../../dist/ValRouterCore-
|
|
3
|
+
export { P as HEAD_BUDGET_BYTES, Q as HEAD_VERSIONS_PER_MODULE, N as ValHead, O as headWork } from '../../dist/ValRouterCore-eea19e82.esm.js';
|
|
4
4
|
import '@valbuild/core';
|
|
5
5
|
import '@valbuild/ui/server';
|
|
6
6
|
import 'path';
|