apps 0.0.1-beta.116 → 0.0.1-beta.118
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/framework-reference.json +1 -1
- package/js/openapi.js +4 -1
- package/js/ui/serving.js +14 -12
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +13 -4
- package/types/apps/src/ui-serving.d.ts +1 -2
- package/types/apps/src/implementation/ui-watch.d.ts +0 -2
package/js/openapi.js
CHANGED
|
@@ -2000,12 +2000,15 @@ var planOperationNames = (inputs) => {
|
|
|
2000
2000
|
const tokens = pathTokens(input.path);
|
|
2001
2001
|
return { input, group, leaf, prefix, versionSegment, tokens, name: `${group}.${leaf}` };
|
|
2002
2002
|
});
|
|
2003
|
+
const wanted = /* @__PURE__ */ new Map();
|
|
2004
|
+
for (const item of staged) wanted.set(item.name, (wanted.get(item.name) ?? 0) + 1);
|
|
2005
|
+
const settled = new Set(staged.filter((item) => wanted.get(item.name) === 1));
|
|
2003
2006
|
const refine = (rename) => {
|
|
2004
2007
|
const buckets = /* @__PURE__ */ new Map();
|
|
2005
2008
|
for (const item of staged) buckets.set(item.name, [...buckets.get(item.name) ?? [], item]);
|
|
2006
2009
|
for (const bucket of buckets.values())
|
|
2007
2010
|
if (bucket.length > 1) {
|
|
2008
|
-
const names = bucket.map((item) => rename(item, bucket));
|
|
2011
|
+
const names = bucket.map((item) => settled.has(item) ? item.name : rename(item, bucket));
|
|
2009
2012
|
for (const [index, item] of bucket.entries()) item.name = names[index] ?? item.name;
|
|
2010
2013
|
}
|
|
2011
2014
|
};
|
package/js/ui/serving.js
CHANGED
|
@@ -8526,7 +8526,7 @@ var versionDocument = (html, version) => {
|
|
|
8526
8526
|
var appFailureBootstrap = `<script>${appFailureSource}</script>`;
|
|
8527
8527
|
|
|
8528
8528
|
// src/implementation/ui-serving.ts
|
|
8529
|
-
var
|
|
8529
|
+
var appFile = (options) => Effect_exports.gen(function* () {
|
|
8530
8530
|
const request = yield* HttpServerRequest_exports.HttpServerRequest;
|
|
8531
8531
|
const pathname = yield* Effect_exports.try(() => new URL(request.url, options.origin).pathname).pipe(
|
|
8532
8532
|
Effect_exports.mapError(() => new UiForbidden())
|
|
@@ -8534,13 +8534,18 @@ var appDocument = (options) => Effect_exports.gen(function* () {
|
|
|
8534
8534
|
const path = Option_exports.getOrUndefined(assetPath(pathname.slice(1)));
|
|
8535
8535
|
const file = pathname === "/" || path === void 0 || path === "index.html" ? void 0 : yield* options.asset(path);
|
|
8536
8536
|
if (file !== void 0 && "body" in file)
|
|
8537
|
-
return
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8537
|
+
return Option_exports.some(
|
|
8538
|
+
HttpServerResponse_exports.uint8Array(file.body, {
|
|
8539
|
+
contentType: file.contentType,
|
|
8540
|
+
headers: appPrivateHeaders
|
|
8541
|
+
})
|
|
8542
|
+
);
|
|
8543
|
+
if (file !== void 0) return Option_exports.some(yield* storedFile(file, "private, no-cache"));
|
|
8542
8544
|
if (pathname.includes(".") && pathname !== "/index.html")
|
|
8543
|
-
return HttpServerResponse_exports.empty({ status: 404 });
|
|
8545
|
+
return Option_exports.some(HttpServerResponse_exports.empty({ status: 404 }));
|
|
8546
|
+
return Option_exports.none();
|
|
8547
|
+
});
|
|
8548
|
+
var appDocument = (options) => Effect_exports.gen(function* () {
|
|
8544
8549
|
const notice = options.accounts;
|
|
8545
8550
|
if (notice?.problems.some(accountProblemBlocks))
|
|
8546
8551
|
return HttpServerResponse_exports.text(accountBlockedPage(notice), {
|
|
@@ -8560,7 +8565,7 @@ var appDocument = (options) => Effect_exports.gen(function* () {
|
|
|
8560
8565
|
const telemetry = yield* CurrentTelemetryConfig;
|
|
8561
8566
|
const attribute = (text) => text.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<");
|
|
8562
8567
|
const metadata = telemetry === void 0 ? "" : `<meta name="executor-build" content="${attribute(telemetry.version)}"><meta name="executor-environment" content="${attribute(telemetry.environment)}">`;
|
|
8563
|
-
const boot = `${metadata}<script type="application/json" id="executor-context">${context}</script>${appFailureBootstrap}${notice === void 0 || notice.problems.length === 0 ? "" : accountNoticeBootstrap(notice)}<script
|
|
8568
|
+
const boot = `${metadata}<script type="application/json" id="executor-context">${context}</script>${appFailureBootstrap}${notice === void 0 || notice.problems.length === 0 ? "" : accountNoticeBootstrap(notice)}<script type="module">${appWatchSource}</script>`;
|
|
8564
8569
|
return HttpServerResponse_exports.text(
|
|
8565
8570
|
versionDocument(new TextDecoder().decode(document.body), options.version).replace(
|
|
8566
8571
|
"<!--executor-ui-->",
|
|
@@ -8656,13 +8661,10 @@ var appAsset = (asset, build, path) => Effect_exports.gen(function* () {
|
|
|
8656
8661
|
};
|
|
8657
8662
|
return etagMatches(request.headers["if-none-match"], etag) ? HttpServerResponse_exports.empty({ status: 304, headers }) : HttpServerResponse_exports.uint8Array(asset.body, { contentType: asset.contentType, headers });
|
|
8658
8663
|
});
|
|
8659
|
-
|
|
8660
|
-
// src/implementation/ui-watch.ts
|
|
8661
|
-
var appWatchScript = appWatchSource;
|
|
8662
8664
|
export {
|
|
8663
8665
|
appAsset,
|
|
8664
8666
|
appDocument,
|
|
8665
|
-
|
|
8667
|
+
appFile,
|
|
8666
8668
|
assetPath,
|
|
8667
8669
|
storedAppFile
|
|
8668
8670
|
};
|