@yaks/platform 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +261 -2
- package/_client-blobs.js +7 -0
- package/_client-error.js +70 -0
- package/_client-modal.js +3 -0
- package/_client-replica.js +5 -0
- package/_client-review.js +1 -0
- package/_client-schema.js +1 -0
- package/_client-vault.js +31 -0
- package/_edit-query.js +1 -0
- package/_uploads.js +4 -0
- package/account-browser.js +67 -0
- package/account-browser.js.map +1 -0
- package/account-browser.ts +87 -0
- package/account-rows.js +130 -0
- package/account-rows.js.map +1 -0
- package/account-rows.ts +237 -0
- package/admin-visits-view.js +65 -0
- package/admin-visits-view.js.map +1 -0
- package/admin-visits-view.ts +120 -0
- package/admin-visits.js +143 -0
- package/admin-visits.js.map +1 -0
- package/admin-visits.ts +211 -0
- package/admit-graph.js +8 -0
- package/admit-graph.js.map +1 -0
- package/admit-graph.ts +10 -0
- package/agent-guide.js +368 -0
- package/agent-guide.js.map +1 -0
- package/agent-guide.ts +450 -0
- package/agents-browser.js +143 -0
- package/agents-browser.js.map +1 -0
- package/agents-browser.ts +141 -0
- package/agents-view.js +129 -0
- package/agents-view.js.map +1 -0
- package/agents-view.ts +236 -0
- package/agents.js +148 -0
- package/agents.js.map +1 -0
- package/agents.ts +150 -0
- package/app-actions.js +56 -0
- package/app-actions.js.map +1 -0
- package/app-actions.ts +61 -0
- package/app-authority.js +280 -0
- package/app-authority.js.map +1 -0
- package/app-authority.ts +356 -0
- package/app-canvas-browser.js +308 -0
- package/app-canvas-browser.js.map +1 -0
- package/app-canvas-browser.ts +377 -0
- package/app-canvas-view.js +244 -0
- package/app-canvas-view.js.map +1 -0
- package/app-canvas-view.ts +399 -0
- package/app-canvas.js +87 -0
- package/app-canvas.js.map +1 -0
- package/app-canvas.ts +170 -0
- package/app-client.js +521 -0
- package/app-client.js.map +1 -0
- package/app-client.ts +562 -0
- package/app-command.js +108 -0
- package/app-command.js.map +1 -0
- package/app-command.ts +155 -0
- package/app-commands.js +334 -0
- package/app-commands.js.map +1 -0
- package/app-commands.ts +379 -0
- package/app-decision.js +69 -0
- package/app-decision.js.map +1 -0
- package/app-decision.ts +61 -0
- package/app-effects.js +43 -0
- package/app-effects.js.map +1 -0
- package/app-effects.ts +53 -0
- package/app-file.js +252 -0
- package/app-file.js.map +1 -0
- package/app-file.ts +362 -0
- package/app-friends.js +60 -0
- package/app-friends.js.map +1 -0
- package/app-friends.ts +81 -0
- package/app-graph.js +9 -0
- package/app-graph.js.map +1 -0
- package/app-graph.ts +9 -0
- package/app-icon.js +59 -0
- package/app-icon.js.map +1 -0
- package/app-icon.ts +121 -0
- package/app-made.js +164 -0
- package/app-made.js.map +1 -0
- package/app-made.ts +306 -0
- package/app-outbound.js +72 -0
- package/app-outbound.js.map +1 -0
- package/app-outbound.ts +109 -0
- package/app-outbox.js +42 -0
- package/app-outbox.js.map +1 -0
- package/app-outbox.ts +46 -0
- package/app-patch.js +75 -0
- package/app-patch.js.map +1 -0
- package/app-patch.ts +106 -0
- package/app-read.js +101 -0
- package/app-read.js.map +1 -0
- package/app-read.ts +126 -0
- package/app-role-tools.js +232 -0
- package/app-role-tools.js.map +1 -0
- package/app-role-tools.ts +258 -0
- package/app-roles.js +91 -0
- package/app-roles.js.map +1 -0
- package/app-roles.ts +76 -0
- package/app-session-access.js +109 -0
- package/app-session-access.js.map +1 -0
- package/app-session-access.ts +145 -0
- package/app-starter.js +109 -0
- package/app-starter.js.map +1 -0
- package/app-starter.ts +123 -0
- package/app-storage.js +38 -0
- package/app-storage.js.map +1 -0
- package/app-storage.ts +54 -0
- package/app-style-guide.js +138 -0
- package/app-style-guide.js.map +1 -0
- package/app-style-guide.ts +195 -0
- package/app-subs.js +89 -0
- package/app-subs.js.map +1 -0
- package/app-subs.ts +110 -0
- package/app-tests.js +54 -0
- package/app-tests.js.map +1 -0
- package/app-tests.ts +56 -0
- package/app-tile.js +209 -0
- package/app-tile.js.map +1 -0
- package/app-tile.ts +227 -0
- package/app-transfer.js +188 -0
- package/app-transfer.js.map +1 -0
- package/app-transfer.ts +281 -0
- package/app-vocab.js +52 -0
- package/app-vocab.js.map +1 -0
- package/app-vocab.ts +43 -0
- package/app-words.js +55 -0
- package/app-words.js.map +1 -0
- package/app-words.ts +73 -0
- package/app-worker.js +28 -0
- package/app-worker.js.map +1 -0
- package/app-worker.ts +38 -0
- package/app-writes.js +132 -0
- package/app-writes.js.map +1 -0
- package/app-writes.ts +128 -0
- package/asset-bytes.js +57 -0
- package/asset-bytes.js.map +1 -0
- package/asset-bytes.ts +90 -0
- package/asset-response.js +28 -0
- package/asset-response.js.map +1 -0
- package/asset-response.ts +46 -0
- package/asset-url.js +556 -0
- package/asset-url.js.map +1 -0
- package/asset-url.ts +774 -0
- package/attribution-vocab.js +14 -0
- package/attribution-vocab.js.map +1 -0
- package/attribution-vocab.ts +11 -0
- package/authorship-graph.js +8 -0
- package/authorship-graph.js.map +1 -0
- package/authorship-graph.ts +10 -0
- package/badge.js +98 -0
- package/blob-images.js +206 -0
- package/blob-images.js.map +1 -0
- package/blob-images.ts +323 -0
- package/blob-posters.js +125 -0
- package/blob-posters.js.map +1 -0
- package/blob-posters.ts +207 -0
- package/blob-routes.js +14 -0
- package/blob-routes.js.map +1 -0
- package/blob-routes.ts +25 -0
- package/bots.js +77 -0
- package/bots.js.map +1 -0
- package/bots.ts +93 -0
- package/browser-mockup.js +81 -0
- package/browser-mockup.js.map +1 -0
- package/browser-mockup.ts +105 -0
- package/browser-record.js +55 -0
- package/browser-record.js.map +1 -0
- package/browser-record.ts +66 -0
- package/browser-scroll.js +90 -0
- package/browser-scroll.js.map +1 -0
- package/browser-scroll.ts +108 -0
- package/browser-stream.js +79 -0
- package/browser-stream.js.map +1 -0
- package/browser-stream.ts +84 -0
- package/browser-trace.js +252 -0
- package/browser-trace.js.map +1 -0
- package/browser-trace.ts +330 -0
- package/browser-viewer.js +236 -0
- package/browser-viewer.js.map +1 -0
- package/browser-viewer.ts +233 -0
- package/browser-visit.js +1522 -0
- package/browser-visit.js.map +1 -0
- package/browser-visit.ts +2179 -0
- package/browser-wire.js +242 -0
- package/browser-wire.js.map +1 -0
- package/browser-wire.ts +262 -0
- package/budget.js +17 -0
- package/budget.js.map +1 -0
- package/budget.ts +42 -0
- package/cli.js +52 -0
- package/cli.js.map +1 -0
- package/cli.ts +55 -0
- package/client-modules.js +24 -0
- package/client-modules.js.map +1 -0
- package/client-modules.ts +24 -0
- package/client-routes.js +83 -0
- package/client-routes.js.map +1 -0
- package/client-routes.ts +104 -0
- package/client-words.js +62 -0
- package/client-words.js.map +1 -0
- package/client-words.ts +77 -0
- package/client.js +709 -0
- package/comp.js +2 -0
- package/comp.js.map +1 -0
- package/comp.ts +15 -0
- package/config.js +497 -0
- package/config.js.map +1 -0
- package/config.ts +287 -0
- package/connect-parts.js +107 -0
- package/connect-parts.js.map +1 -0
- package/connect-parts.ts +165 -0
- package/connected-activity-browser.js +301 -0
- package/connected-activity-browser.js.map +1 -0
- package/connected-activity-browser.ts +341 -0
- package/connected-activity-view.js +55 -0
- package/connected-activity-view.js.map +1 -0
- package/connected-activity-view.ts +81 -0
- package/connected-activity-wire.js +165 -0
- package/connected-activity-wire.js.map +1 -0
- package/connected-activity-wire.ts +171 -0
- package/connected-activity.css +156 -0
- package/connected-activity.js +185 -0
- package/connected-activity.js.map +1 -0
- package/connected-activity.ts +278 -0
- package/connection-icon-browser.js +50 -0
- package/connection-icon-browser.js.map +1 -0
- package/connection-icon-browser.ts +52 -0
- package/connections-browser.js +393 -0
- package/connections-browser.js.map +1 -0
- package/connections-browser.ts +465 -0
- package/connections-page.js +178 -0
- package/connections-page.js.map +1 -0
- package/connections-page.ts +461 -0
- package/connections-view.js +1215 -0
- package/connections-view.js.map +1 -0
- package/connections-view.ts +2239 -0
- package/connector-upload.js +94 -0
- package/connector-upload.js.map +1 -0
- package/connector-upload.ts +146 -0
- package/consent.js +2 -0
- package/consent.js.map +1 -0
- package/consent.ts +3 -0
- package/cookie.js +53 -0
- package/cookie.js.map +1 -0
- package/cookie.ts +75 -0
- package/copy.js +104 -0
- package/corner.js +226 -0
- package/credential-draft-move.js +154 -0
- package/credential-draft-move.js.map +1 -0
- package/credential-draft-move.ts +197 -0
- package/credential-draft-place.js +2 -0
- package/credential-draft-place.js.map +1 -0
- package/credential-draft-place.ts +4 -0
- package/credential-drafts.js +66 -0
- package/credential-drafts.js.map +1 -0
- package/credential-drafts.ts +93 -0
- package/dashboard-browser.js +149 -0
- package/dashboard-browser.js.map +1 -0
- package/dashboard-browser.ts +184 -0
- package/dashboard-view.js +293 -0
- package/dashboard-view.js.map +1 -0
- package/dashboard-view.ts +423 -0
- package/dashboard.js +268 -0
- package/dashboard.js.map +1 -0
- package/dashboard.ts +436 -0
- package/deno.json +1 -0
- package/describe-graph.js +8 -0
- package/describe-graph.js.map +1 -0
- package/describe-graph.ts +7 -0
- package/directory-derived.js +142 -0
- package/directory-derived.js.map +1 -0
- package/directory-derived.ts +198 -0
- package/directory-index-move.js +77 -0
- package/directory-index-move.js.map +1 -0
- package/directory-index-move.ts +59 -0
- package/directory-index.js +382 -0
- package/directory-index.js.map +1 -0
- package/directory-index.ts +550 -0
- package/directory-pages.js +41 -0
- package/directory-pages.js.map +1 -0
- package/directory-pages.ts +71 -0
- package/directory-route.js +129 -0
- package/directory-route.js.map +1 -0
- package/directory-route.ts +189 -0
- package/directory-vocab.js +58 -0
- package/directory-vocab.js.map +1 -0
- package/directory-vocab.ts +46 -0
- package/document-graph.js +86 -0
- package/document-graph.js.map +1 -0
- package/document-graph.ts +93 -0
- package/document-ocr.js +146 -0
- package/document-ocr.js.map +1 -0
- package/document-ocr.ts +204 -0
- package/documents.js +50 -0
- package/documents.js.map +1 -0
- package/documents.ts +64 -0
- package/domain-pages.js +221 -0
- package/domain-pages.js.map +1 -0
- package/domain-pages.ts +586 -0
- package/domain-settings.js +88 -0
- package/domain-settings.js.map +1 -0
- package/domain-settings.ts +132 -0
- package/domain-transfer.js +138 -0
- package/domain-transfer.js.map +1 -0
- package/domain-transfer.ts +190 -0
- package/donation-loans.js +176 -0
- package/donation-loans.js.map +1 -0
- package/donation-loans.ts +271 -0
- package/draft-choice.js +136 -0
- package/draft-choice.js.map +1 -0
- package/draft-choice.ts +310 -0
- package/drawing.js +27 -0
- package/drawing.js.map +1 -0
- package/drawing.ts +40 -0
- package/early-report.js +18 -0
- package/early-report.js.map +1 -0
- package/early-report.ts +31 -0
- package/edit-client-path.js +2 -0
- package/edit-client-path.js.map +1 -0
- package/edit-client-path.ts +1 -0
- package/edit-mode.js +920 -0
- package/edit-mode.js.map +1 -0
- package/edit-mode.ts +1003 -0
- package/edit-sync.js +61 -0
- package/edit-sync.js.map +1 -0
- package/edit-sync.ts +83 -0
- package/edit.js +265 -0
- package/embed-graph.js +11 -0
- package/embed-graph.js.map +1 -0
- package/embed-graph.ts +8 -0
- package/embedded-payment.js +211 -0
- package/embedded-payment.js.map +1 -0
- package/embedded-payment.ts +290 -0
- package/entry-actions-browser.js +43 -0
- package/entry-actions-browser.js.map +1 -0
- package/entry-actions-browser.ts +64 -0
- package/entry-actions.js +56 -0
- package/entry-actions.js.map +1 -0
- package/entry-actions.ts +59 -0
- package/escape.js +14 -0
- package/escape.js.map +1 -0
- package/escape.ts +24 -0
- package/face-input.js +6 -0
- package/face-input.js.map +1 -0
- package/face-input.ts +14 -0
- package/facebook.js +370 -0
- package/facebook.js.map +1 -0
- package/facebook.ts +474 -0
- package/facets.js +142 -0
- package/facets.js.map +1 -0
- package/facets.ts +89 -0
- package/fee.js +45 -0
- package/fee.js.map +1 -0
- package/fee.ts +51 -0
- package/fence.js +164 -0
- package/fence.js.map +1 -0
- package/fence.ts +223 -0
- package/file-metadata.js +135 -0
- package/file-metadata.js.map +1 -0
- package/file-metadata.ts +177 -0
- package/file-operation.js +51 -0
- package/file-operation.js.map +1 -0
- package/file-operation.ts +32 -0
- package/file-redirects.js +72 -0
- package/file-redirects.js.map +1 -0
- package/file-redirects.ts +74 -0
- package/file-root.js +8 -0
- package/file-root.js.map +1 -0
- package/file-root.ts +24 -0
- package/files-routes.js +203 -0
- package/files-routes.js.map +1 -0
- package/files-routes.ts +282 -0
- package/files.js +369 -0
- package/files.js.map +1 -0
- package/files.ts +522 -0
- package/fingerprint.js +217 -0
- package/fingerprint.js.map +1 -0
- package/fingerprint.ts +314 -0
- package/firsts.js +335 -0
- package/firsts.js.map +1 -0
- package/firsts.ts +368 -0
- package/friends-at.js +78 -0
- package/friends-at.js.map +1 -0
- package/friends-at.ts +115 -0
- package/friends-browser.js +66 -0
- package/friends-browser.js.map +1 -0
- package/friends-browser.ts +77 -0
- package/friends-dock-browser.js +375 -0
- package/friends-dock-browser.js.map +1 -0
- package/friends-dock-browser.ts +408 -0
- package/friends-dock-view.js +363 -0
- package/friends-dock-view.js.map +1 -0
- package/friends-dock-view.ts +592 -0
- package/friends-view.js +33 -0
- package/friends-view.js.map +1 -0
- package/friends-view.ts +69 -0
- package/friends.js +153 -0
- package/friends.js.map +1 -0
- package/friends.ts +200 -0
- package/fundraising-orders.js +197 -0
- package/fundraising-orders.js.map +1 -0
- package/fundraising-orders.ts +283 -0
- package/fundraising.js +165 -0
- package/fundraising.js.map +1 -0
- package/fundraising.ts +215 -0
- package/funnel.js +141 -0
- package/funnel.js.map +1 -0
- package/funnel.ts +284 -0
- package/gift-savings.js +19 -0
- package/gift-savings.js.map +1 -0
- package/gift-savings.ts +29 -0
- package/git-history.js +331 -0
- package/git-history.js.map +1 -0
- package/git-history.ts +481 -0
- package/giving-browser.js +35 -0
- package/giving-browser.js.map +1 -0
- package/giving-browser.ts +40 -0
- package/giving-pages.js +284 -0
- package/giving-pages.js.map +1 -0
- package/giving-pages.ts +418 -0
- package/giving-view.js +244 -0
- package/giving-view.js.map +1 -0
- package/giving-view.ts +509 -0
- package/giving.js +198 -0
- package/giving.js.map +1 -0
- package/giving.ts +280 -0
- package/gmail-mailbox.js +52 -0
- package/gmail-mailbox.js.map +1 -0
- package/gmail-mailbox.ts +74 -0
- package/graves.js +136 -0
- package/graves.js.map +1 -0
- package/graves.ts +180 -0
- package/hashed.js +499 -0
- package/hashed.js.map +1 -0
- package/hashed.ts +676 -0
- package/home/assets.js +15 -0
- package/home/assets.js.map +1 -0
- package/home/assets.ts +16 -0
- package/home/brands/stripe.svg +12 -0
- package/home/brands/zoom.svg +34 -0
- package/home/demos.js +413 -0
- package/home/demos.js.map +1 -0
- package/home/demos.ts +431 -0
- package/home/games.js +112 -0
- package/home/games.js.map +1 -0
- package/home/games.ts +137 -0
- package/home/icons.js +41 -0
- package/home/icons.js.map +1 -0
- package/home/icons.ts +42 -0
- package/home/mascot/calculating.webp +0 -0
- package/home/mascot/flag.webp +0 -0
- package/home/mascot/letter.webp +0 -0
- package/home/mascot/plane.webp +0 -0
- package/home/mascot/plug.webp +0 -0
- package/home/mascot/thinking.webp +0 -0
- package/home/mascot/typing.webp +0 -0
- package/home/mascot/wave.webp +0 -0
- package/home/mod.tsx +517 -0
- package/home/parts.js +149 -0
- package/home/parts.js.map +1 -0
- package/home/parts.ts +45 -0
- package/home/phone.tsx +152 -0
- package/home/scenes.tsx +212 -0
- package/home/sky.js +930 -0
- package/home/sky.tsx +479 -0
- package/home/story.js +392 -0
- package/home/style.css +1304 -0
- package/home/words.js +2 -0
- package/home/words.js.map +1 -0
- package/home/words.ts +8 -0
- package/home/yak.js +146 -0
- package/home/yak_test.tsx +111 -0
- package/home-router.js +30 -0
- package/home-router.js.map +1 -0
- package/home-router.ts +41 -0
- package/host.js +58 -0
- package/host.js.map +1 -0
- package/host.ts +97 -0
- package/hosted-page.js +126 -0
- package/hosted-page.js.map +1 -0
- package/hosted-page.ts +295 -0
- package/install-browser.js +89 -0
- package/install-browser.js.map +1 -0
- package/install-browser.ts +99 -0
- package/install-icons.js +271 -0
- package/install-icons.js.map +1 -0
- package/install-icons.ts +366 -0
- package/installs.js +197 -0
- package/installs.js.map +1 -0
- package/installs.ts +270 -0
- package/instrument.js +50 -0
- package/instrument.js.map +1 -0
- package/instrument.ts +55 -0
- package/integration-icons.js +138 -0
- package/integration-icons.js.map +1 -0
- package/integration-icons.ts +198 -0
- package/interaction-browser.js +95 -0
- package/interaction-browser.js.map +1 -0
- package/interaction-browser.ts +107 -0
- package/interaction-report.js +399 -0
- package/interaction-report.js.map +1 -0
- package/interaction-report.ts +450 -0
- package/interaction.js +273 -0
- package/interaction.js.map +1 -0
- package/interaction.ts +290 -0
- package/invite-browser.js +98 -0
- package/invite-browser.js.map +1 -0
- package/invite-browser.ts +123 -0
- package/invite-view.js +100 -0
- package/invite-view.js.map +1 -0
- package/invite-view.ts +137 -0
- package/kept.js +520 -0
- package/kept.js.map +1 -0
- package/kept.ts +821 -0
- package/kills-graph.js +18 -0
- package/kills-graph.js.map +1 -0
- package/kills-graph.ts +16 -0
- package/ladder.js +418 -0
- package/ladder.js.map +1 -0
- package/ladder.ts +510 -0
- package/lenses-graph.js +24 -0
- package/lenses-graph.js.map +1 -0
- package/lenses-graph.ts +27 -0
- package/lenses.js +197 -0
- package/lenses.js.map +1 -0
- package/lenses.ts +204 -0
- package/lent.js +32 -0
- package/lent.js.map +1 -0
- package/lent.ts +95 -0
- package/letters.js +134 -0
- package/letters.js.map +1 -0
- package/letters.ts +251 -0
- package/lexicon-graph.js +11 -0
- package/lexicon-graph.js.map +1 -0
- package/lexicon-graph.ts +7 -0
- package/link-preview.js +111 -0
- package/link-preview.js.map +1 -0
- package/link-preview.ts +136 -0
- package/listing.js +262 -0
- package/listing.js.map +1 -0
- package/listing.ts +330 -0
- package/local-time.js +32 -0
- package/local-time.js.map +1 -0
- package/local-time.ts +41 -0
- package/located.js +380 -0
- package/located.js.map +1 -0
- package/located.ts +471 -0
- package/log-graph.js +7 -0
- package/log-graph.js.map +1 -0
- package/log-graph.ts +9 -0
- package/lower-graph.js +7 -0
- package/lower-graph.js.map +1 -0
- package/lower-graph.ts +9 -0
- package/mail-request.js +32 -0
- package/mail-request.js.map +1 -0
- package/mail-request.ts +29 -0
- package/mail-senders.js +40 -0
- package/mail-senders.js.map +1 -0
- package/mail-senders.ts +47 -0
- package/managed-browser-pilot.js +151 -0
- package/managed-browser-pilot.js.map +1 -0
- package/managed-browser-pilot.ts +230 -0
- package/managed-browser-sites.js +43 -0
- package/managed-browser-sites.js.map +1 -0
- package/managed-browser-sites.ts +41 -0
- package/managed-browser-wire.js +142 -0
- package/managed-browser-wire.js.map +1 -0
- package/managed-browser-wire.ts +140 -0
- package/managed-browser.js +529 -0
- package/managed-browser.js.map +1 -0
- package/managed-browser.ts +740 -0
- package/manifest.js +425 -0
- package/manifest.js.map +1 -0
- package/manifest.ts +468 -0
- package/metadata-effect.js +61 -0
- package/metadata-effect.js.map +1 -0
- package/metadata-effect.ts +59 -0
- package/meter-graph.js +205 -0
- package/meter-graph.js.map +1 -0
- package/meter-graph.ts +238 -0
- package/meter-vocab.js +8 -0
- package/meter-vocab.js.map +1 -0
- package/meter-vocab.ts +4 -0
- package/meter.js +402 -0
- package/meter.js.map +1 -0
- package/meter.ts +697 -0
- package/mod.js +14 -0
- package/mod.js.map +1 -0
- package/mod.ts +16 -0
- package/models-vocab.js +25 -0
- package/models-vocab.js.map +1 -0
- package/models-vocab.ts +15 -0
- package/monogram.js +32 -0
- package/monogram.js.map +1 -0
- package/monogram.ts +46 -0
- package/mover.js +6 -0
- package/mover.js.map +1 -0
- package/mover.ts +45 -0
- package/named.js +136 -0
- package/named.js.map +1 -0
- package/named.ts +169 -0
- package/names.js +196 -0
- package/names.js.map +1 -0
- package/names.ts +252 -0
- package/notices-vocab.js +20 -0
- package/notices-vocab.js.map +1 -0
- package/notices-vocab.ts +28 -0
- package/numbers.js +85 -0
- package/numbers.js.map +1 -0
- package/numbers.ts +97 -0
- package/object-hosts.js +137 -0
- package/object-hosts.js.map +1 -0
- package/object-hosts.ts +153 -0
- package/open-script.js +235 -0
- package/open-script.js.map +1 -0
- package/open-script.ts +253 -0
- package/opening.js +31 -0
- package/opening.js.map +1 -0
- package/opening.ts +28 -0
- package/operator-activity-view.js +82 -0
- package/operator-activity-view.js.map +1 -0
- package/operator-activity-view.ts +85 -0
- package/operator-activity.js +220 -0
- package/operator-activity.js.map +1 -0
- package/operator-activity.ts +293 -0
- package/operator-brief.js +36 -0
- package/operator-brief.js.map +1 -0
- package/operator-brief.ts +76 -0
- package/operator-copy-browser.js +67 -0
- package/operator-copy-browser.js.map +1 -0
- package/operator-copy-browser.ts +71 -0
- package/operator-corner.js +266 -0
- package/operator-corner.js.map +1 -0
- package/operator-corner.ts +300 -0
- package/operator-decisions.js +19 -0
- package/operator-decisions.js.map +1 -0
- package/operator-decisions.ts +18 -0
- package/operator-docs.js +152 -0
- package/operator-docs.js.map +1 -0
- package/operator-docs.ts +196 -0
- package/operator-door.js +10 -0
- package/operator-door.js.map +1 -0
- package/operator-door.ts +14 -0
- package/operator-drafts-browser.js +28 -0
- package/operator-drafts-browser.js.map +1 -0
- package/operator-drafts-browser.ts +32 -0
- package/operator-drafts.js +60 -0
- package/operator-drafts.js.map +1 -0
- package/operator-drafts.ts +80 -0
- package/operator-early-draft.js +110 -0
- package/operator-early-draft.js.map +1 -0
- package/operator-early-draft.ts +125 -0
- package/operator-go-browser.js +130 -0
- package/operator-go-browser.js.map +1 -0
- package/operator-go-browser.ts +182 -0
- package/operator-go-step.js +86 -0
- package/operator-go-step.js.map +1 -0
- package/operator-go-step.ts +92 -0
- package/operator-go-tool.js +49 -0
- package/operator-go-tool.js.map +1 -0
- package/operator-go-tool.ts +31 -0
- package/operator-go.js +68 -0
- package/operator-go.js.map +1 -0
- package/operator-go.ts +100 -0
- package/operator-graph.js +46 -0
- package/operator-graph.js.map +1 -0
- package/operator-graph.ts +60 -0
- package/operator-handoff.js +91 -0
- package/operator-handoff.js.map +1 -0
- package/operator-handoff.ts +104 -0
- package/operator-machine.js +136 -0
- package/operator-machine.js.map +1 -0
- package/operator-machine.ts +168 -0
- package/operator-matches-browser.js +155 -0
- package/operator-matches-browser.js.map +1 -0
- package/operator-matches-browser.ts +178 -0
- package/operator-matches-view.js +147 -0
- package/operator-matches-view.js.map +1 -0
- package/operator-matches-view.ts +224 -0
- package/operator-matches.js +65 -0
- package/operator-matches.js.map +1 -0
- package/operator-matches.ts +120 -0
- package/operator-memory.js +119 -0
- package/operator-memory.js.map +1 -0
- package/operator-memory.ts +122 -0
- package/operator-mic.ts +40 -0
- package/operator-model.js +144 -0
- package/operator-model.js.map +1 -0
- package/operator-model.ts +154 -0
- package/operator-notes.js +32 -0
- package/operator-notes.js.map +1 -0
- package/operator-notes.ts +40 -0
- package/operator-opening-browser.js +184 -0
- package/operator-opening-browser.js.map +1 -0
- package/operator-opening-browser.ts +195 -0
- package/operator-owner.js +391 -0
- package/operator-owner.js.map +1 -0
- package/operator-owner.ts +392 -0
- package/operator-page-context.js +121 -0
- package/operator-page-context.js.map +1 -0
- package/operator-page-context.ts +143 -0
- package/operator-page-image.js +38 -0
- package/operator-page-image.js.map +1 -0
- package/operator-page-image.ts +42 -0
- package/operator-panel-browser.js +601 -0
- package/operator-panel-browser.js.map +1 -0
- package/operator-panel-browser.ts +669 -0
- package/operator-panel-view.js +69 -0
- package/operator-panel-view.js.map +1 -0
- package/operator-panel-view.ts +100 -0
- package/operator-panel.js +131 -0
- package/operator-panel.js.map +1 -0
- package/operator-panel.ts +155 -0
- package/operator-push.tsx +112 -0
- package/operator-record.js +55 -0
- package/operator-record.js.map +1 -0
- package/operator-record.ts +92 -0
- package/operator-replies.js +240 -0
- package/operator-replies.js.map +1 -0
- package/operator-replies.ts +281 -0
- package/operator-reply-view.js +117 -0
- package/operator-reply-view.js.map +1 -0
- package/operator-reply-view.ts +185 -0
- package/operator-safety.js +30 -0
- package/operator-safety.js.map +1 -0
- package/operator-safety.ts +53 -0
- package/operator-settings-browser.js +257 -0
- package/operator-settings-browser.js.map +1 -0
- package/operator-settings-browser.ts +290 -0
- package/operator-settings-view.js +291 -0
- package/operator-settings-view.js.map +1 -0
- package/operator-settings-view.ts +588 -0
- package/operator-settings.js +79 -0
- package/operator-settings.js.map +1 -0
- package/operator-settings.ts +137 -0
- package/operator-source.js +43 -0
- package/operator-source.js.map +1 -0
- package/operator-source.ts +69 -0
- package/operator-talk-browser.js +94 -0
- package/operator-talk-browser.js.map +1 -0
- package/operator-talk-browser.ts +120 -0
- package/operator-talk.js +83 -0
- package/operator-talk.js.map +1 -0
- package/operator-talk.ts +127 -0
- package/operator-task-text.js +45 -0
- package/operator-task-text.js.map +1 -0
- package/operator-task-text.ts +49 -0
- package/operator-timing-browser.js +51 -0
- package/operator-timing-browser.js.map +1 -0
- package/operator-timing-browser.ts +68 -0
- package/operator-timing-view.js +48 -0
- package/operator-timing-view.js.map +1 -0
- package/operator-timing-view.ts +90 -0
- package/operator-timing.js +132 -0
- package/operator-timing.js.map +1 -0
- package/operator-timing.ts +170 -0
- package/operator-vocab.js +8 -0
- package/operator-vocab.js.map +1 -0
- package/operator-vocab.ts +7 -0
- package/operator-voice-audio.ts +84 -0
- package/operator-voice-browser.ts +237 -0
- package/operator-voice-feedback.js +108 -0
- package/operator-voice-feedback.js.map +1 -0
- package/operator-voice-feedback.ts +133 -0
- package/operator-voice-view.js +33 -0
- package/operator-voice-view.js.map +1 -0
- package/operator-voice-view.ts +43 -0
- package/operator-voice.css +38 -0
- package/operator-voice.js +35 -0
- package/operator-voice.js.map +1 -0
- package/operator-voice.ts +33 -0
- package/operator-wait.js +70 -0
- package/operator-wait.js.map +1 -0
- package/operator-wait.ts +79 -0
- package/operator-watches.js +126 -0
- package/operator-watches.js.map +1 -0
- package/operator-watches.ts +141 -0
- package/operator-words.js +94 -0
- package/operator-words.js.map +1 -0
- package/operator-words.ts +114 -0
- package/outreach-trial.js +103 -0
- package/outreach-trial.js.map +1 -0
- package/outreach-trial.ts +122 -0
- package/outreach-vocab.js +10 -0
- package/outreach-vocab.js.map +1 -0
- package/outreach-vocab.ts +7 -0
- package/outreach.js +162 -0
- package/outreach.js.map +1 -0
- package/outreach.ts +239 -0
- package/package.json +1131 -4
- package/packs.js +103 -0
- package/packs.js.map +1 -0
- package/packs.ts +119 -0
- package/page-copy.js +267 -0
- package/page-copy.js.map +1 -0
- package/page-copy.ts +362 -0
- package/page-graph.js +114 -0
- package/page-graph.js.map +1 -0
- package/page-graph.ts +151 -0
- package/page-links.js +78 -0
- package/page-links.js.map +1 -0
- package/page-links.ts +124 -0
- package/page-parts.js +236 -0
- package/page-parts.js.map +1 -0
- package/page-parts.ts +388 -0
- package/page-query.js +95 -0
- package/page-query.js.map +1 -0
- package/page-query.ts +120 -0
- package/page-script.js +183 -0
- package/page-script.js.map +1 -0
- package/page-script.ts +192 -0
- package/page-wire.js +93 -0
- package/page-wire.js.map +1 -0
- package/page-wire.ts +100 -0
- package/pages-vocab.js +9 -0
- package/pages-vocab.js.map +1 -0
- package/pages-vocab.ts +5 -0
- package/partials.js +21 -0
- package/partials.js.map +1 -0
- package/partials.ts +37 -0
- package/payment-browser.js +250 -0
- package/payment-browser.js.map +1 -0
- package/payment-browser.ts +298 -0
- package/payment-rows.js +117 -0
- package/payment-rows.js.map +1 -0
- package/payment-rows.ts +219 -0
- package/payment-view.js +397 -0
- package/payment-view.js.map +1 -0
- package/payment-view.ts +852 -0
- package/people-browser.js +186 -0
- package/people-browser.js.map +1 -0
- package/people-browser.ts +210 -0
- package/people-rows.js +192 -0
- package/people-rows.js.map +1 -0
- package/people-rows.ts +289 -0
- package/people-view.js +463 -0
- package/people-view.js.map +1 -0
- package/people-view.ts +804 -0
- package/person-lines.js +196 -0
- package/person-lines.js.map +1 -0
- package/person-lines.ts +256 -0
- package/place.js +30 -0
- package/place.js.map +1 -0
- package/place.ts +31 -0
- package/plan-details.js +39 -0
- package/plan-details.js.map +1 -0
- package/plan-details.ts +57 -0
- package/plan-trial-graph.js +63 -0
- package/plan-trial-graph.js.map +1 -0
- package/plan-trial-graph.ts +57 -0
- package/plans.js +223 -0
- package/plans.js.map +1 -0
- package/plans.ts +313 -0
- package/platform-credentials.js +136 -0
- package/platform-credentials.js.map +1 -0
- package/platform-credentials.ts +189 -0
- package/poster-backfill.js +72 -0
- package/poster-backfill.js.map +1 -0
- package/poster-backfill.ts +96 -0
- package/presence.js +57 -0
- package/presence.js.map +1 -0
- package/presence.ts +77 -0
- package/preview-audit.js +65 -0
- package/preview-audit.js.map +1 -0
- package/preview-audit.ts +126 -0
- package/preview-fit.js +62 -0
- package/preview-fit.js.map +1 -0
- package/preview-fit.ts +72 -0
- package/preview-html.js +96 -0
- package/preview-html.js.map +1 -0
- package/preview-html.ts +139 -0
- package/preview.js +317 -0
- package/preview.js.map +1 -0
- package/preview.ts +498 -0
- package/price.js +53 -0
- package/price.js.map +1 -0
- package/price.ts +85 -0
- package/profile-browser.js +117 -0
- package/profile-browser.js.map +1 -0
- package/profile-browser.ts +141 -0
- package/profile-view.js +96 -0
- package/profile-view.js.map +1 -0
- package/profile-view.ts +197 -0
- package/provider-credits.js +159 -0
- package/provider-credits.js.map +1 -0
- package/provider-credits.ts +174 -0
- package/public-site-choice.js +18 -0
- package/public-site-choice.js.map +1 -0
- package/public-site-choice.ts +21 -0
- package/public-site.js +151 -0
- package/public-site.js.map +1 -0
- package/public-site.ts +268 -0
- package/publishing-graph.js +136 -0
- package/publishing-graph.js.map +1 -0
- package/publishing-graph.ts +122 -0
- package/qr.js +32 -0
- package/qr.js.map +1 -0
- package/qr.ts +32 -0
- package/query-page.js +159 -0
- package/query-page.js.map +1 -0
- package/query-page.ts +249 -0
- package/query-refusal.js +174 -0
- package/query-refusal.js.map +1 -0
- package/query-refusal.ts +319 -0
- package/refusal-loop.js +71 -0
- package/refusal-loop.js.map +1 -0
- package/refusal-loop.ts +98 -0
- package/refusals-vocab.js +9 -0
- package/refusals-vocab.js.map +1 -0
- package/refusals-vocab.ts +5 -0
- package/refused-writes.js +119 -0
- package/refused-writes.js.map +1 -0
- package/refused-writes.ts +152 -0
- package/refused.js +67 -0
- package/refused.js.map +1 -0
- package/refused.ts +76 -0
- package/regional-route-storage.js +127 -0
- package/regional-route-storage.js.map +1 -0
- package/regional-route-storage.ts +94 -0
- package/regional-route.js +105 -0
- package/regional-route.js.map +1 -0
- package/regional-route.ts +158 -0
- package/regional-serving-copy.js +153 -0
- package/regional-serving-copy.js.map +1 -0
- package/regional-serving-copy.ts +200 -0
- package/release-asset.js +71 -0
- package/release-asset.js.map +1 -0
- package/release-asset.ts +121 -0
- package/release-browser.js +383 -0
- package/release-code.js +5 -0
- package/release-entry.js +3 -0
- package/release-file.js +169 -0
- package/release-file.js.map +1 -0
- package/release-file.ts +241 -0
- package/release-index.js +140 -0
- package/release-index.js.map +1 -0
- package/release-index.ts +161 -0
- package/release-page.js +227 -0
- package/release-reads.js +27 -0
- package/release-reads.js.map +1 -0
- package/release-reads.ts +56 -0
- package/release-sheets.js +76 -0
- package/release-state.js +181 -0
- package/release-update.js +22 -0
- package/release-update.js.map +1 -0
- package/release-update.ts +29 -0
- package/release.js +50 -0
- package/release.js.map +1 -0
- package/release.ts +72 -0
- package/released.js +263 -0
- package/released.js.map +1 -0
- package/released.ts +310 -0
- package/remake-graph.js +17 -0
- package/remake-graph.js.map +1 -0
- package/remake-graph.ts +15 -0
- package/rouse-graph.js +11 -0
- package/rouse-graph.js.map +1 -0
- package/rouse-graph.ts +8 -0
- package/route-memory.js +101 -0
- package/route-memory.js.map +1 -0
- package/route-memory.ts +132 -0
- package/routes.js +1143 -0
- package/routes.js.map +1 -0
- package/routes.ts +1502 -0
- package/sale-recovery.js +175 -0
- package/sale-recovery.js.map +1 -0
- package/sale-recovery.ts +156 -0
- package/sales.js +113 -0
- package/sales.js.map +1 -0
- package/sales.ts +150 -0
- package/schema.js +28 -0
- package/schema.js.map +1 -0
- package/schema.ts +13 -0
- package/serving-copy.js +161 -0
- package/serving-copy.js.map +1 -0
- package/serving-copy.ts +201 -0
- package/settings-drafts-browser.js +81 -0
- package/settings-drafts-browser.js.map +1 -0
- package/settings-drafts-browser.ts +95 -0
- package/settings-drafts.js +119 -0
- package/settings-drafts.js.map +1 -0
- package/settings-drafts.ts +136 -0
- package/shared-browser.js +61 -0
- package/shared-browser.js.map +1 -0
- package/shared-browser.ts +77 -0
- package/shared-view.js +29 -0
- package/shared-view.js.map +1 -0
- package/shared-view.ts +47 -0
- package/side-browser.js +164 -0
- package/side-browser.js.map +1 -0
- package/side-browser.ts +201 -0
- package/side-parts.js +258 -0
- package/side-parts.js.map +1 -0
- package/side-parts.ts +447 -0
- package/side-rows.js +64 -0
- package/side-rows.js.map +1 -0
- package/side-rows.ts +104 -0
- package/signed-in.js +37 -0
- package/signed-in.js.map +1 -0
- package/signed-in.ts +45 -0
- package/site-assets.js +8 -0
- package/site-assets.js.map +1 -0
- package/site-assets.ts +25 -0
- package/site-header.js +65 -0
- package/site-header.js.map +1 -0
- package/site-header.ts +71 -0
- package/site-nav.js +75 -0
- package/site-nav.js.map +1 -0
- package/site-nav.ts +82 -0
- package/site-validation.js +37 -0
- package/site-validation.js.map +1 -0
- package/site-validation.ts +47 -0
- package/space-apps-browser.js +107 -0
- package/space-apps-browser.js.map +1 -0
- package/space-apps-browser.ts +128 -0
- package/space-apps-view.js +222 -0
- package/space-apps-view.js.map +1 -0
- package/space-apps-view.ts +396 -0
- package/space-apps.js +88 -0
- package/space-apps.js.map +1 -0
- package/space-apps.ts +143 -0
- package/space-logo.js +82 -0
- package/space-logo.js.map +1 -0
- package/space-logo.ts +112 -0
- package/space-pages-browser.js +474 -0
- package/space-pages-browser.js.map +1 -0
- package/space-pages-browser.ts +463 -0
- package/space-pages-view.js +212 -0
- package/space-pages-view.js.map +1 -0
- package/space-pages-view.ts +460 -0
- package/space-pages.js +193 -0
- package/space-pages.js.map +1 -0
- package/space-pages.ts +282 -0
- package/space-switch.js +36 -0
- package/space-switch.js.map +1 -0
- package/space-switch.ts +64 -0
- package/splash.js +510 -0
- package/splash.js.map +1 -0
- package/splash.ts +525 -0
- package/standing.js +409 -0
- package/standing.js.map +1 -0
- package/standing.ts +746 -0
- package/still.js +63 -0
- package/still.js.map +1 -0
- package/still.ts +95 -0
- package/store-listing.js +107 -0
- package/store-listing.js.map +1 -0
- package/store-listing.ts +133 -0
- package/store-wake.js +65 -0
- package/store-wake.js.map +1 -0
- package/store-wake.ts +101 -0
- package/stream-posters.js +177 -0
- package/stream-posters.js.map +1 -0
- package/stream-posters.ts +297 -0
- package/support-contract-service.js +219 -0
- package/support-contract-service.js.map +1 -0
- package/support-contract-service.ts +307 -0
- package/support-contract-view.js +155 -0
- package/support-contract-view.js.map +1 -0
- package/support-contract-view.ts +265 -0
- package/support-contract.js +114 -0
- package/support-contract.js.map +1 -0
- package/support-contract.ts +157 -0
- package/sweep-vocab.js +10 -0
- package/sweep-vocab.js.map +1 -0
- package/sweep-vocab.ts +9 -0
- package/talk-views-browser.js +208 -0
- package/talk-views-browser.js.map +1 -0
- package/talk-views-browser.ts +232 -0
- package/talk-views.js +36 -0
- package/talk-views.js.map +1 -0
- package/talk-views.ts +64 -0
- package/task-rows.js +86 -0
- package/task-rows.js.map +1 -0
- package/task-rows.ts +96 -0
- package/tasks-view.js +111 -0
- package/tasks-view.js.map +1 -0
- package/tasks-view.ts +176 -0
- package/toast.ts +17 -0
- package/trash-graph.js +41 -0
- package/trash-graph.js.map +1 -0
- package/trash-graph.ts +27 -0
- package/trash-vocab.js +8 -0
- package/trash-vocab.js.map +1 -0
- package/trash-vocab.ts +4 -0
- package/trial.js +325 -0
- package/trial.js.map +1 -0
- package/trial.ts +451 -0
- package/update-rows.js +77 -0
- package/update-rows.js.map +1 -0
- package/update-rows.ts +171 -0
- package/update-waiting.js +131 -0
- package/update-waiting.js.map +1 -0
- package/update-waiting.ts +133 -0
- package/updates-browser.js +28 -0
- package/updates-browser.js.map +1 -0
- package/updates-browser.ts +33 -0
- package/updates-day-browser.js +77 -0
- package/updates-day-browser.js.map +1 -0
- package/updates-day-browser.ts +84 -0
- package/updates-day.js +60 -0
- package/updates-day.js.map +1 -0
- package/updates-day.ts +94 -0
- package/updates-list-browser.js +175 -0
- package/updates-list-browser.js.map +1 -0
- package/updates-list-browser.ts +198 -0
- package/updates-view.js +546 -0
- package/updates-view.js.map +1 -0
- package/updates-view.ts +814 -0
- package/upload-client-path.js +5 -0
- package/upload-client-path.js.map +1 -0
- package/upload-client-path.ts +4 -0
- package/uploads.js +290 -0
- package/uploads.js.map +1 -0
- package/uploads.ts +334 -0
- package/upstream.js +40 -0
- package/upstream.js.map +1 -0
- package/upstream.ts +57 -0
- package/version-view.js +57 -0
- package/version-view.js.map +1 -0
- package/version-view.ts +99 -0
- package/versions.js +231 -0
- package/versions.js.map +1 -0
- package/versions.ts +367 -0
- package/visit-counts.js +123 -0
- package/visit-counts.js.map +1 -0
- package/visit-counts.ts +162 -0
- package/visitor-location.js +33 -0
- package/visitor-location.js.map +1 -0
- package/visitor-location.ts +38 -0
- package/visitor.js +152 -0
- package/visitor.js.map +1 -0
- package/visitor.ts +228 -0
- package/visits-browser.js +71 -0
- package/visits-browser.js.map +1 -0
- package/visits-browser.ts +87 -0
- package/visits-view.js +88 -0
- package/visits-view.js.map +1 -0
- package/visits-view.ts +184 -0
- package/visits.js +428 -0
- package/visits.js.map +1 -0
- package/visits.ts +561 -0
- package/vocab/account.vocab.json +349 -0
- package/vocab/agents.vocab.json +64 -0
- package/vocab/app-canvas.vocab.json +137 -0
- package/vocab/app-friends.vocab.json +71 -0
- package/vocab/app-permissions.vocab.json +46 -0
- package/vocab/apps.vocab.json +553 -0
- package/vocab/attribution.vocab.json +32 -0
- package/vocab/builder-install.vocab.json +10 -0
- package/vocab/connections.vocab.json +128 -0
- package/vocab/dashboard.vocab.json +148 -0
- package/vocab/directory.vocab.json +2445 -0
- package/vocab/exception.vocab.json +18 -0
- package/vocab/fundraising.vocab.json +284 -0
- package/vocab/gmail-mailbox.vocab.json +73 -0
- package/vocab/kernel.vocab.json +420 -0
- package/vocab/mcp-retirement.vocab.json +66 -0
- package/vocab/meter.vocab.json +230 -0
- package/vocab/models-install.vocab.json +10 -0
- package/vocab/notices.vocab.json +88 -0
- package/vocab/operator-drafts.vocab.json +19 -0
- package/vocab/operator-matches.vocab.json +85 -0
- package/vocab/operator-settings.vocab.json +127 -0
- package/vocab/operator-talk.vocab.json +92 -0
- package/vocab/operator.vocab.json +1314 -0
- package/vocab/outreach.vocab.json +141 -0
- package/vocab/pages.vocab.json +38 -0
- package/vocab/payment.vocab.json +271 -0
- package/vocab/people.vocab.json +337 -0
- package/vocab/presence.vocab.json +19 -0
- package/vocab/preview.vocab.json +66 -0
- package/vocab/referenced.vocab.json +17 -0
- package/vocab/referral.vocab.json +272 -0
- package/vocab/refusals.vocab.json +16 -0
- package/vocab/registration.vocab.json +17 -0
- package/vocab/serving.vocab.json +103 -0
- package/vocab/side.vocab.json +97 -0
- package/vocab/space-apps.vocab.json +137 -0
- package/vocab/space-pages.vocab.json +416 -0
- package/vocab/sweep-install.vocab.json +10 -0
- package/vocab/sweep.vocab.json +125 -0
- package/vocab/trash.vocab.json +19 -0
- package/vocab/update.vocab.json +53 -0
- package/vocab/upload.vocab.json +69 -0
- package/vocab/use.vocab.json +93 -0
- package/vocab/visits.vocab.json +143 -0
- package/vocab/waiting.vocab.json +29 -0
- package/vocab.js +16 -0
- package/vocab.js.map +1 -0
- package/vocab.json +1703 -0
- package/vocab.ts +17 -0
- package/weigh-graph.js +12 -0
- package/weigh-graph.js.map +1 -0
- package/weigh-graph.ts +9 -0
- package/wire-news.js +30 -0
- package/wire-news.js.map +1 -0
- package/wire-news.ts +30 -0
- package/work-standing.js +64 -0
- package/work-standing.js.map +1 -0
- package/work-standing.ts +44 -0
- package/woven.js +435 -0
- package/woven.js.map +1 -0
- package/woven.ts +649 -0
- package/wrap-graph.js +17 -0
- package/wrap-graph.js.map +1 -0
- package/wrap-graph.ts +15 -0
- package/write-owner.js +11 -0
- package/write-owner.js.map +1 -0
- package/write-owner.ts +24 -0
package/kept.ts
ADDED
|
@@ -0,0 +1,821 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@yaks/platform/kept` — what a shared cache may keep of a hosted app, under
|
|
3
|
+
* which address, and for how long. Pure: the host's cache is the runtime's
|
|
4
|
+
* (on yaks.app, Cloudflare's, at the Worker's `Files` and `Site` entrypoints
|
|
5
|
+
* through `@yaks/workerd/cache`), and the host asks it and fills it.
|
|
6
|
+
*
|
|
7
|
+
* ── Why no cache sits in front of the door a browser reaches ──────────────
|
|
8
|
+
*
|
|
9
|
+
* Cloudflare's key for a Worker's cache is the path, the query and the
|
|
10
|
+
* entrypoint, shared across the Worker's versions. It is not the hostname,
|
|
11
|
+
* and every space is a hostname: they all share one path namespace, so
|
|
12
|
+
* `alice.yaks.app/app/x.css` and `bob.yaks.app/app/x.css` are one key, and a
|
|
13
|
+
* custom domain serving its app at `/` collides with every other front page.
|
|
14
|
+
* Caching the door the browser reaches would serve one space's bytes to
|
|
15
|
+
* another's visitors on the second request.
|
|
16
|
+
*
|
|
17
|
+
* So that door, the gateway, is uncached and runs on every request, and the
|
|
18
|
+
* caches stand behind it on inner entrypoints it asks at addresses that name
|
|
19
|
+
* the tenant in their path, which is all a key is made of. A hit still runs
|
|
20
|
+
* the gateway; what it skips is the round trip to the bucket and the work of
|
|
21
|
+
* assembling the page.
|
|
22
|
+
*
|
|
23
|
+
* ── An app's bytes ────────────────────────────────────────────────────────
|
|
24
|
+
*
|
|
25
|
+
* Files keeps an app's bytes, never anybody's response (`fileAt`, `blobAt`,
|
|
26
|
+
* `keptAt`, `servableAt`, `packageAt`). The bytes of `style.css` are the same
|
|
27
|
+
* whoever may read them; what differs per person is only whether they may,
|
|
28
|
+
* and that is decided in front, on every request. So a private app's file is
|
|
29
|
+
* as cacheable as a public one, and a mistake here makes something slow, not
|
|
30
|
+
* wrong: nothing kept is one person's private response.
|
|
31
|
+
*
|
|
32
|
+
* ── An app's pages ────────────────────────────────────────────────────────
|
|
33
|
+
*
|
|
34
|
+
* Site keeps whole pages, so it keeps only an answer that is the same for
|
|
35
|
+
* everyone it could be sent to (`keepable`, `keep`): the own file or 404 of
|
|
36
|
+
* an app anyone may read at a path no worker of its own is asked about, with
|
|
37
|
+
* no sandbox, no router claiming the path and no cookie, the release files
|
|
38
|
+
* of a private one anyone may install, a space's 404 where no app answers, or
|
|
39
|
+
* its index as a stranger sees it. A person signed in who holds no seat in the space is shown its
|
|
40
|
+
* index as such an outsider, kept under their own session (`pageAt`); a
|
|
41
|
+
* member's is never kept. Anything else is a pass, kept as briefly as a page.
|
|
42
|
+
*
|
|
43
|
+
* A page is keyed by the hostname routed, the path and the mount (`pageAt`),
|
|
44
|
+
* so two spaces never share a key and one app mounted at two addresses keeps
|
|
45
|
+
* two pages. It is tagged with its app and its space (`appTag`, `spaceTag`)
|
|
46
|
+
* and purged when what it shows changes. A purge owed is stored work retried
|
|
47
|
+
* until it lands, and until then what was kept lives no longer than its short
|
|
48
|
+
* lifetime (`KEPT`, at most `SHORT`). App answers revalidate before serving
|
|
49
|
+
* again. The platform's public listings have their own lifetime.
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { fileAt, pageAt } from '@yaks/platform/kept'
|
|
53
|
+
* import { assertNotEquals } from '@std/assert'
|
|
54
|
+
* assertNotEquals(fileAt('app-a', '/x.css'), fileAt('app-b', '/x.css'))
|
|
55
|
+
* assertNotEquals(pageAt('ada.yaks.app', '/', null), pageAt('bo.yaks.app', '/', null))
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @module
|
|
59
|
+
*/
|
|
60
|
+
import { CLIENT_MODULES } from './client-modules.js'
|
|
61
|
+
import { EDIT_CLIENT } from './edit-client-path.js'
|
|
62
|
+
import { UPLOAD_CLIENT } from './upload-client-path.js'
|
|
63
|
+
import { matches } from '@yaks/blob/serve'
|
|
64
|
+
import { addressed } from '@yaks/blob'
|
|
65
|
+
import { sha256 } from '@yaks/graph/sha256'
|
|
66
|
+
import { mode } from '@yaks/member/words'
|
|
67
|
+
import { COOKIE, cookieValue, HOST_COOKIE } from './cookie.js'
|
|
68
|
+
import { type Assets, declared, decoded, page, workerFirst } from './files.js'
|
|
69
|
+
import { apex, type Host, url } from './host.js'
|
|
70
|
+
import { offered, sandboxed } from './installs.js'
|
|
71
|
+
import { bearing, MOUNT, previews } from './routes.js'
|
|
72
|
+
import { assetPath, fingerprintPath } from './versions.js'
|
|
73
|
+
|
|
74
|
+
// ── An app's bytes, at Files ───────────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
// A release source never changes. A new release gets a new key, so old
|
|
77
|
+
// entries can expire on their own without a purge.
|
|
78
|
+
let YEAR = 31536000
|
|
79
|
+
|
|
80
|
+
/** What Files says of bytes that cannot change under their key: source-named
|
|
81
|
+
* files and content-addressed blobs. Metadata and access are decided by the
|
|
82
|
+
* gateway, outside this cache. */
|
|
83
|
+
export let immutable: { 'cache-control': string } = {
|
|
84
|
+
'cache-control': `public, max-age=${YEAR}, immutable`,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** What the gateway tells a browser of the same bytes: it may keep the exact
|
|
88
|
+
* asset it fetched, while a shared cache must never retain the gateway's
|
|
89
|
+
* answer for a person. */
|
|
90
|
+
export let browserImmutable: string = `private, max-age=${YEAR}, immutable`
|
|
91
|
+
|
|
92
|
+
/** Freshness of a file whose bare address follows the app's current release. */
|
|
93
|
+
export let staticCaching = (shared: boolean): string =>
|
|
94
|
+
shared
|
|
95
|
+
? 'public, max-age=60, stale-while-revalidate=300'
|
|
96
|
+
: 'private, max-age=60, must-revalidate'
|
|
97
|
+
|
|
98
|
+
// What a browser's request for a page's file says it loads (`Sec-Fetch-Dest`):
|
|
99
|
+
// everything but a page, a frame, a worker's script and the data a page asks
|
|
100
|
+
// for by its own fetch.
|
|
101
|
+
let LOADS = new Set([
|
|
102
|
+
'image',
|
|
103
|
+
'font',
|
|
104
|
+
'style',
|
|
105
|
+
'script',
|
|
106
|
+
'audio',
|
|
107
|
+
'video',
|
|
108
|
+
'track',
|
|
109
|
+
])
|
|
110
|
+
|
|
111
|
+
/** Whether the browser asked for a file a page loads: its picture, font,
|
|
112
|
+
* stylesheet, script or media, not a page or the page's own fetch. */
|
|
113
|
+
export let loadsAsset = (req: Request): boolean =>
|
|
114
|
+
LOADS.has(req.headers.get('sec-fetch-dest') ?? '')
|
|
115
|
+
|
|
116
|
+
/** Whether a request for an asset uses an address that can also serve HTML. */
|
|
117
|
+
export let assetAtPage = (req: Request, path: string): boolean =>
|
|
118
|
+
loadsAsset(req) && page(decoded(path) ?? path)
|
|
119
|
+
|
|
120
|
+
/** Whether a Cache-Control lets the browser keep the answer without asking
|
|
121
|
+
* again: immutable, or fresh for a day or more. */
|
|
122
|
+
/// keptLong('private, max-age=31536000, immutable') -> true
|
|
123
|
+
/// keptLong('public, max-age=300') -> false
|
|
124
|
+
/// keptLong('private, no-cache') -> false
|
|
125
|
+
/// keptLong(null) -> false
|
|
126
|
+
export let keptLong = (cache: string | null): boolean => {
|
|
127
|
+
if (!cache || /no-cache|no-store/i.test(cache)) return false
|
|
128
|
+
let age = /max-age=(\d+)/i.exec(cache)
|
|
129
|
+
return /immutable/i.test(cache) || !!age && Number(age[1]) >= 86400
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** A load can reuse long-lived bytes or a fresh file it can revalidate. */
|
|
133
|
+
export let assetKept = (headers: Headers): boolean => {
|
|
134
|
+
let cache = headers.get('cache-control')
|
|
135
|
+
if (!cache || /no-cache|no-store/i.test(cache)) return false
|
|
136
|
+
let age = /(?:^|,)\s*max-age=(\d+)/i.exec(cache)
|
|
137
|
+
return keptLong(cache) || headers.has('etag') && Number(age?.[1]) > 0
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Files' local Cache API entries survive deploys, so a deploy of the platform
|
|
141
|
+
// leaves every app's cached bytes in place. An address's answer is a release's immutable bytes,
|
|
142
|
+
// but how Files frames them (a type, a header, a compiled script) is code: a
|
|
143
|
+
// change to that for addresses already answered bumps this number, which
|
|
144
|
+
// moves every address to a new key and lets the old entries expire unread.
|
|
145
|
+
let FILES = 4
|
|
146
|
+
let generation = (address: string) =>
|
|
147
|
+
`${address}${address.includes('?') ? '&' : '?'}g=${FILES}`
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Where Files keeps one of an app's files. The hostname is a placeholder
|
|
151
|
+
* that never resolves (the request goes over a service binding), and
|
|
152
|
+
* everything that tells one answer from another is in the path and query,
|
|
153
|
+
* which are what the key is made of:
|
|
154
|
+
* `/<app eid>/<the app's own path>?source=<release source>&g=<generation>`.
|
|
155
|
+
* An asset at a page address uses a separate key for its exact file lookup.
|
|
156
|
+
*
|
|
157
|
+
* The eid and not the slug, because an app answers at every address it has
|
|
158
|
+
* ever had, a rename leaves the old one resolving, and a custom domain is a
|
|
159
|
+
* third address for the same bytes: those are one entry, and a rename cannot
|
|
160
|
+
* make one app read another's. The release source keeps old and new bytes
|
|
161
|
+
* apart when the serving pointer moves.
|
|
162
|
+
*/
|
|
163
|
+
/// fileAt('a', '/x.css', 'ada/.releases/1/r') -> 'https://files.invalid/a/x.css?source=ada%2F.releases%2F1%2Fr&g=4'
|
|
164
|
+
/// fileAt('a', 'x.css') -> 'https://files.invalid/a/x.css?g=4'
|
|
165
|
+
export let fileAt = (
|
|
166
|
+
eid: string,
|
|
167
|
+
path: string,
|
|
168
|
+
source = '',
|
|
169
|
+
asset = false,
|
|
170
|
+
): string =>
|
|
171
|
+
generation(
|
|
172
|
+
`https://files.invalid/${eid}${path.startsWith('/') ? '' : '/'}${path}` +
|
|
173
|
+
(source ? `?source=${encodeURIComponent(source)}` : '') +
|
|
174
|
+
(asset ? `${source ? '&' : '?'}asset=1` : '') +
|
|
175
|
+
(/\.html$/i.test(decoded(path) ?? path)
|
|
176
|
+
? `${source || asset ? '&' : '?'}page=clean`
|
|
177
|
+
: ''),
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
/** Where Files keeps a blob's bytes. A blob has no mutable file path, so its
|
|
181
|
+
* entry is apart from the app's files, and names both the app and the
|
|
182
|
+
* content, so neither tenant nor upload can reuse another's. */
|
|
183
|
+
/// blobAt('a', 'ab') -> 'https://files.invalid/blob/a/ab?g=4'
|
|
184
|
+
export let blobAt = (eid: string, sha: string): string =>
|
|
185
|
+
generation(`https://files.invalid/blob/${eid}/${sha}`)
|
|
186
|
+
|
|
187
|
+
/** Where Files keeps a compiled module (@yaks/esbuild/file), by its name:
|
|
188
|
+
* the same bytes for every app that holds its source, so no app is in the
|
|
189
|
+
* key. The gateway checks access to the app that asked before it asks.
|
|
190
|
+
*/
|
|
191
|
+
/// moduleAt('ab') -> 'https://files.invalid/modules/ab.js?g=4'
|
|
192
|
+
export let moduleAt = (name: string): string =>
|
|
193
|
+
generation(`https://files.invalid/modules/${name}.js`)
|
|
194
|
+
|
|
195
|
+
/** Where Files keeps an object the platform keeps about an app under a name
|
|
196
|
+
* written once, such as a release's declaration. Where in the bucket it lives
|
|
197
|
+
* is told beside the key, as a blob's is. */
|
|
198
|
+
/// keptAt('a', 'declared/r.json') -> 'https://files.invalid/kept/a/declared/r.json?g=4'
|
|
199
|
+
export let keptAt = (eid: string, name: string): string =>
|
|
200
|
+
generation(`https://files.invalid/kept/${eid}/${name}`)
|
|
201
|
+
|
|
202
|
+
/** Where Files keeps whether an app's rows still name the bytes at `sha` as
|
|
203
|
+
* representation `rep`, while the app's `withdrawn` mark stands. Both are in
|
|
204
|
+
* the key: one upload may be framed under more than one representation, and
|
|
205
|
+
* each is its own answer. The mark moves whenever the app's rows stop naming
|
|
206
|
+
* an upload, so every answer kept under the last one is asked again. */
|
|
207
|
+
/// servableAt('a', 'ab', 'r') -> 'https://files.invalid/servable/a/ab/r?g=4'
|
|
208
|
+
/// servableAt('a', 'ab', 'r', 'm') -> 'https://files.invalid/servable/a/ab/r?withdrawn=m&g=4'
|
|
209
|
+
export let servableAt = (
|
|
210
|
+
eid: string,
|
|
211
|
+
sha: string,
|
|
212
|
+
rep: string,
|
|
213
|
+
withdrawn?: string | null,
|
|
214
|
+
view?: string,
|
|
215
|
+
): string => {
|
|
216
|
+
let scope = new URLSearchParams({
|
|
217
|
+
...withdrawn ? { withdrawn } : {},
|
|
218
|
+
...view ? { view } : {},
|
|
219
|
+
})
|
|
220
|
+
let query = scope.size ? `?${scope}` : ''
|
|
221
|
+
return generation(
|
|
222
|
+
`https://files.invalid/servable/${eid}/${sha}/${rep}${query}`,
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** Where Files keeps a compiler-owned package file, the same for every app. */
|
|
227
|
+
/// packageAt('/__packages/d/mod.js') -> 'https://files.invalid/__packages/d/mod.js?g=4'
|
|
228
|
+
export let packageAt = (path: string): string =>
|
|
229
|
+
generation(`https://files.invalid${path}`)
|
|
230
|
+
|
|
231
|
+
/** A compiler-owned public resource, named by its package's content hash: a
|
|
232
|
+
* pack's file under `/__packages/`, or a package module or its resource
|
|
233
|
+
* under `/__m/` (@yaks/esbuild/file `MODULES_AT`). */
|
|
234
|
+
/// packagePath(`/__packages/${'a'.repeat(64)}/pack.js`) -> true
|
|
235
|
+
/// packagePath(`/__m/${'a'.repeat(64)}.js`) -> true
|
|
236
|
+
/// packagePath(`/__m/${'a'.repeat(64)}/fonts/a.woff2`) -> true
|
|
237
|
+
/// packagePath(`/__m/${'a'.repeat(64)}.html`) -> false
|
|
238
|
+
/// packagePath(`/__m/${'a'.repeat(64)}/../x.js`) -> false
|
|
239
|
+
export let packagePath = (path: string): boolean =>
|
|
240
|
+
/^\/__(?:packages\/[a-f0-9]{64}\/.+|m\/[a-f0-9]{64}(?:\.(?:js|css)|\/.+))$/
|
|
241
|
+
.test(path) &&
|
|
242
|
+
!/[\\?#%]/.test(path) &&
|
|
243
|
+
!path.slice(1).split('/').some((p) => !p || p == '.' || p == '..')
|
|
244
|
+
|
|
245
|
+
// ── What the gateway sends ─────────────────────────────────────────────────
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The gateway's answer as it leaves, its cache default made to stick.
|
|
249
|
+
*
|
|
250
|
+
* Omitting `Cache-Control` is not opting out of a cache: Cloudflare applies
|
|
251
|
+
* RFC 9111 heuristic freshness and holds a bare `200` for two hours. The
|
|
252
|
+
* gateway is uncached, so nothing it forgets to mark is stored, but that is a
|
|
253
|
+
* line in a config, and the day someone enables caching there every unmarked
|
|
254
|
+
* door would silently become shared. So an answer that states its own policy
|
|
255
|
+
* keeps it, and one that says nothing gets `private, no-store`. A 101 carries
|
|
256
|
+
* the runtime's own socket, which no Response constructor can copy, so a
|
|
257
|
+
* socket passes untouched.
|
|
258
|
+
*
|
|
259
|
+
* Framing (T-33409): an app is a framed resource, and only its own space
|
|
260
|
+
* (its own origin, `'self'`: a space's apps share its hostname, so they frame
|
|
261
|
+
* each other) and the platform's own home page may embed it. Any other
|
|
262
|
+
* space's page is refused by the browser, which is the whole clickjacking
|
|
263
|
+
* defense: a same-site frame would otherwise carry the viewer's session
|
|
264
|
+
* cookie and load signed in, and the browser is the one thing that knows the
|
|
265
|
+
* full ancestor chain. On the apex's own pages it only governs who may frame
|
|
266
|
+
* them, never what they may frame. Appended, not set, so it stacks with an
|
|
267
|
+
* answer's own policy (a blob's sandbox) and no app can widen past it.
|
|
268
|
+
*/
|
|
269
|
+
export let sealed = (res: Response, env: Host = {}): Response => {
|
|
270
|
+
if (res.status == 101) return res
|
|
271
|
+
let headers = new Headers(res.headers)
|
|
272
|
+
headers.append(
|
|
273
|
+
'content-security-policy',
|
|
274
|
+
`frame-ancestors 'self' ${url(env)}`,
|
|
275
|
+
)
|
|
276
|
+
if (!headers.has('cache-control')) {
|
|
277
|
+
headers.set('cache-control', 'private, no-store')
|
|
278
|
+
}
|
|
279
|
+
return new Response(res.body, {
|
|
280
|
+
status: res.status,
|
|
281
|
+
statusText: res.statusText,
|
|
282
|
+
headers,
|
|
283
|
+
})
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* A public page drawn from this deploy's own files, validated by the deploy,
|
|
288
|
+
* the apex, its path and any `variant` of it, so the next deploy changes its
|
|
289
|
+
* validator and a conditional hit never draws it. Kept `maxAge` seconds and
|
|
290
|
+
* then revalidated; where no deploy is known (a local run), never kept.
|
|
291
|
+
*/
|
|
292
|
+
export let publicPage = async (
|
|
293
|
+
req: Request,
|
|
294
|
+
env: Host,
|
|
295
|
+
path: string,
|
|
296
|
+
draw: () => Promise<Response | null> | Response | null,
|
|
297
|
+
maxAge = 300,
|
|
298
|
+
variant = '',
|
|
299
|
+
): Promise<Response | null> => {
|
|
300
|
+
let id = env.CF_VERSION_METADATA?.id
|
|
301
|
+
let etag = id
|
|
302
|
+
? `W/"${encodeURIComponent(`${id}:${apex(env)}:${path}:${variant}`)}"`
|
|
303
|
+
: null
|
|
304
|
+
let headers = new Headers({
|
|
305
|
+
'cache-control': etag
|
|
306
|
+
? `public, max-age=${maxAge}, must-revalidate`
|
|
307
|
+
: 'private, no-store',
|
|
308
|
+
})
|
|
309
|
+
if (etag) headers.set('etag', etag)
|
|
310
|
+
if (matches(req.headers.get('if-none-match'), etag)) {
|
|
311
|
+
return new Response(null, { status: 304, headers })
|
|
312
|
+
}
|
|
313
|
+
let answer = await draw()
|
|
314
|
+
if (!answer || answer.status != 200) return answer
|
|
315
|
+
let copied = new Headers(answer.headers)
|
|
316
|
+
headers.forEach((value, name) => copied.set(name, value))
|
|
317
|
+
return new Response(req.method == 'HEAD' ? null : answer.body, {
|
|
318
|
+
status: answer.status,
|
|
319
|
+
statusText: answer.statusText,
|
|
320
|
+
headers: copied,
|
|
321
|
+
})
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// ── An app's pages, at Site ────────────────────────────────────────────────
|
|
325
|
+
|
|
326
|
+
/** The longest Site keeps anything of an app before asking again (s): what a
|
|
327
|
+
* purge not yet landed can leave of an app made private, unpublished or
|
|
328
|
+
* trashed. Purges keep what is kept right; this keeps a missed one brief. */
|
|
329
|
+
export let SHORT = 30
|
|
330
|
+
|
|
331
|
+
/** A Files permission can feed a Site fill until this age. Including
|
|
332
|
+
* Site's own freshness, an old answer has at most five minutes to live. */
|
|
333
|
+
export let SERVABILITY_AGE = 300 - SHORT
|
|
334
|
+
|
|
335
|
+
/** How long Site holds a page before asking again. */
|
|
336
|
+
export let KEPT = `public, max-age=${SHORT}, must-revalidate`
|
|
337
|
+
|
|
338
|
+
/** What Site says of a pass for now only (`passed`), which no cache holds. */
|
|
339
|
+
export let UNKEPT = 'private, no-store'
|
|
340
|
+
|
|
341
|
+
/** What a browser is told of a listing's lifetime: the edge's is its own. */
|
|
342
|
+
export let FRESH = 'public, max-age=30, must-revalidate'
|
|
343
|
+
|
|
344
|
+
let PUBLIC_READ = 'public, max-age=10, must-revalidate'
|
|
345
|
+
|
|
346
|
+
/** Site revalidates public platform pages in the background for a day. */
|
|
347
|
+
export let LISTING =
|
|
348
|
+
'public, max-age=30, stale-while-revalidate=86400, stale-if-error=0'
|
|
349
|
+
|
|
350
|
+
/** Site keeps the home app's pages at the apex a day. What changes one takes
|
|
351
|
+
* it out: a release of the app (`appTag`), a listing it shows changing and a
|
|
352
|
+
* deploy of the Worker that weaves it (`SITE_TAG`). The app is the
|
|
353
|
+
* platform's own and public, so no access change waits on this lifetime, as
|
|
354
|
+
* it does on `SHORT`. Cloudflare's Workers cache answers a page past its
|
|
355
|
+
* lifetime only once it has asked again (`EXPIRED`), so a short one makes
|
|
356
|
+
* nearly every visit to a quiet page wait for Site to draw it. */
|
|
357
|
+
export let APEX = 'public, max-age=86400'
|
|
358
|
+
|
|
359
|
+
/** Site's lifetime for the answer's source. App workers can opt into a
|
|
360
|
+
* shorter shared lifetime. */
|
|
361
|
+
export let siteLifetime = (
|
|
362
|
+
kind: 'app' | 'apex' | 'platform' | 'read',
|
|
363
|
+
workerAge?: number,
|
|
364
|
+
): string =>
|
|
365
|
+
kind == 'platform'
|
|
366
|
+
? LISTING
|
|
367
|
+
: kind == 'apex'
|
|
368
|
+
? APEX
|
|
369
|
+
: kind == 'read'
|
|
370
|
+
? PUBLIC_READ
|
|
371
|
+
: workerAge && workerAge < SHORT
|
|
372
|
+
? `public, max-age=${workerAge}, must-revalidate`
|
|
373
|
+
: KEPT
|
|
374
|
+
|
|
375
|
+
/** The header a kept answer names its purge tags in. */
|
|
376
|
+
export let TAGS = 'cache-tag'
|
|
377
|
+
|
|
378
|
+
// Between the gateway's serving and Site, and Site and the gateway; never a
|
|
379
|
+
// browser's.
|
|
380
|
+
/** The purge tags of an answer Site may keep (`keep`). */
|
|
381
|
+
export let KEEP = 'x-yak-keep'
|
|
382
|
+
/** That an answer passes for now only (`passed`). */
|
|
383
|
+
export let NOW = 'x-yak-now'
|
|
384
|
+
/** What a kept page says of itself (`Seen`, `Alone`). */
|
|
385
|
+
export let SEEN = 'x-yak-seen'
|
|
386
|
+
/** The browser's own cache rule, carried past Site's. */
|
|
387
|
+
export let BROWSER = 'x-yak-browser-cache'
|
|
388
|
+
/** Between the gateway and an edge in front of it: the mount of an app whose
|
|
389
|
+
* pages are never kept, which it need not ask Site about for a while. */
|
|
390
|
+
export let UNKEPT_AT = 'x-yak-unkept'
|
|
391
|
+
|
|
392
|
+
/** The tag on every answer the site keeps, purged when a space is created or
|
|
393
|
+
* renamed, and by every deploy of the Worker that draws them. */
|
|
394
|
+
export let SITE_TAG = 'site'
|
|
395
|
+
/** The tag on every answer an app gave. */
|
|
396
|
+
export let appTag = (eid: string): string => `app:${eid}`
|
|
397
|
+
/** The tag on an app's addressed uploads, purged when one is withdrawn. */
|
|
398
|
+
export let uploadTag = (eid: string): string => `uploads:${eid}`
|
|
399
|
+
/** The tag on every answer in a space. */
|
|
400
|
+
export let spaceTag = (eid: string): string => `space:${eid}`
|
|
401
|
+
/** The tag on every answer at a custom domain's own address, by its hostname
|
|
402
|
+
* row: attaching, detaching or moving it takes them out. */
|
|
403
|
+
export let hostTag = (eid: string): string => `host:${eid}`
|
|
404
|
+
/** The tag on a listed app's picture when its files choose it, which a
|
|
405
|
+
* release can change and the listings beside it cannot. */
|
|
406
|
+
export let cardTag = (eid: string): string => `card:${eid}`
|
|
407
|
+
|
|
408
|
+
// Move the keys when the rendering or cache policy changes, so old entries
|
|
409
|
+
// expire without being read.
|
|
410
|
+
let PAGES = 12
|
|
411
|
+
|
|
412
|
+
// What a key says of the session it is for.
|
|
413
|
+
let heldBy = (session: string) => sha256(session).slice(0, 32)
|
|
414
|
+
|
|
415
|
+
/** Where Site keeps one address's page. The hostname is a placeholder for
|
|
416
|
+
* the binding; what names the page is the path, which carries the hostname
|
|
417
|
+
* the gateway routed, because the key holds no hostname of its own.
|
|
418
|
+
* `session` keys a signed-in person's own copy of a page kept for strangers:
|
|
419
|
+
* the digest of their session token, which only they hold, so nobody else's
|
|
420
|
+
* request ever reads it, and a forged cookie names a key Site never filled. */
|
|
421
|
+
/// pageAt('ada.yaks.app', '/menu/', '/menu/') -> 'https://site.invalid/@ada.yaks.app/menu/?g=12&mount=%2Fmenu%2F'
|
|
422
|
+
/// pageAt('ada.yaks.app', '/menu/icon.png', '/menu/', undefined, '?v=r.&utm_source=x') -> 'https://site.invalid/@ada.yaks.app/menu/icon.png?g=12&mount=%2Fmenu%2F&search=%3Fv%3Dr.%26utm_source%3Dx'
|
|
423
|
+
export let pageAt = (
|
|
424
|
+
host: string,
|
|
425
|
+
path: string,
|
|
426
|
+
mount: string | null,
|
|
427
|
+
session?: string,
|
|
428
|
+
// An app's worker can vary its response by any part of the query string.
|
|
429
|
+
search = '',
|
|
430
|
+
// A page from an older release can read its own vocabulary and query in it.
|
|
431
|
+
pageVersion: string | null = null,
|
|
432
|
+
): string => {
|
|
433
|
+
let read = publicRead(path)
|
|
434
|
+
let version = (read == 'query' || read == 'vocab') && pageVersion != null
|
|
435
|
+
? `&pv=${encodeURIComponent(pageVersion)}`
|
|
436
|
+
: ''
|
|
437
|
+
return `https://site.invalid/@${encodeURIComponent(host)}${path}?g=${PAGES}${
|
|
438
|
+
mount ? `&mount=${encodeURIComponent(mount)}` : ''
|
|
439
|
+
}${/\.html$/i.test(decoded(path) ?? path) ? '&page=clean' : ''}${
|
|
440
|
+
session ? `&who=${heldBy(session)}` : ''
|
|
441
|
+
}${
|
|
442
|
+
read == 'query'
|
|
443
|
+
? `&q=${encodeURIComponent(search)}${version}`
|
|
444
|
+
: read == 'vocab'
|
|
445
|
+
? version
|
|
446
|
+
: search && read != 'who' && !fixed(path) && !uploaded(path)
|
|
447
|
+
? `&search=${encodeURIComponent(search)}`
|
|
448
|
+
: named(search, '&', uploaded(path))
|
|
449
|
+
}`
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// What the platform names an address by in its query.
|
|
453
|
+
let NAMED = ['display', 'v']
|
|
454
|
+
let UPLOAD_QUERY = [...NAMED, 'width', 'download']
|
|
455
|
+
let named = (search: string, lead: string, upload: boolean) => {
|
|
456
|
+
let from = new URLSearchParams(search)
|
|
457
|
+
let kept = new URLSearchParams()
|
|
458
|
+
for (let name of upload ? UPLOAD_QUERY : NAMED) {
|
|
459
|
+
let value = from.get(name)
|
|
460
|
+
if (value != null) kept.set(name, value)
|
|
461
|
+
}
|
|
462
|
+
let said = kept.toString().replace(/=(?=&|$)/g, '')
|
|
463
|
+
return said ? lead + said : ''
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/** The address a key names, as the request a visitor would have sent: with
|
|
467
|
+
* the session cookie `asking` carries, where the key is that session's own
|
|
468
|
+
* and the cookie is the session it names, else with no cookie at all. */
|
|
469
|
+
export let visitor = (url: string, asking?: Request): Request | null => {
|
|
470
|
+
let { pathname, search, searchParams } = new URL(url)
|
|
471
|
+
let at = pathname.indexOf('/', 2)
|
|
472
|
+
if (!pathname.startsWith('/@') || at < 0) return null
|
|
473
|
+
let host = decoded(pathname.slice(2, at))
|
|
474
|
+
if (host == null) return null
|
|
475
|
+
let mount = searchParams.get('mount')
|
|
476
|
+
let path = pathname.slice(at)
|
|
477
|
+
let read = publicRead(path)
|
|
478
|
+
let headers = new Headers(mount ? { [MOUNT]: mount } : {})
|
|
479
|
+
let pageVersion = read == 'query' || read == 'vocab'
|
|
480
|
+
? searchParams.get('pv')
|
|
481
|
+
: null
|
|
482
|
+
if (pageVersion != null) headers.set('x-yak-version', pageVersion)
|
|
483
|
+
let session = asking && cookieValue(asking.headers.get('cookie'))
|
|
484
|
+
if (session && searchParams.get('who') == heldBy(session)) {
|
|
485
|
+
headers.set('cookie', `${COOKIE}=${session}`)
|
|
486
|
+
}
|
|
487
|
+
// An upload's fill may take Files' yes: it is kept under its app's mark,
|
|
488
|
+
// which moves the moment an upload is withdrawn, so only this keep's own
|
|
489
|
+
// freshness bounds a removed upload.
|
|
490
|
+
return new Request(
|
|
491
|
+
`https://${host}${path}${
|
|
492
|
+
read == 'query'
|
|
493
|
+
? searchParams.get('q') ?? ''
|
|
494
|
+
: searchParams.get('search') ??
|
|
495
|
+
named(search, '?', uploaded(path))
|
|
496
|
+
}`,
|
|
497
|
+
{ headers },
|
|
498
|
+
)
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/** Whether a key is a session's own (`pageAt`). */
|
|
502
|
+
export let personal = (url: string): boolean =>
|
|
503
|
+
new URL(url).searchParams.has('who')
|
|
504
|
+
|
|
505
|
+
/** The addresses one app answers on a hostname: those under its mount, which
|
|
506
|
+
* for a space's front page is every one. */
|
|
507
|
+
export let scope = (host: string, mount: string | null, at: string): string =>
|
|
508
|
+
`${host} ${mount ?? ''} ${at}`
|
|
509
|
+
|
|
510
|
+
/** The platform's modules an app's pages import from its `/api/`: one file
|
|
511
|
+
* for every app. */
|
|
512
|
+
export let CLIENT: string[] = [
|
|
513
|
+
'/client.js',
|
|
514
|
+
...Object.values(CLIENT_MODULES).map((name) => '/' + name),
|
|
515
|
+
'/' + EDIT_CLIENT,
|
|
516
|
+
'/' + UPLOAD_CLIENT,
|
|
517
|
+
'/storage.js',
|
|
518
|
+
'/_draft.js',
|
|
519
|
+
'/_outbox.js',
|
|
520
|
+
'/_wire.js',
|
|
521
|
+
'/_edit.js',
|
|
522
|
+
'/_operator-corner.js',
|
|
523
|
+
'/_operator-page-image.js',
|
|
524
|
+
]
|
|
525
|
+
|
|
526
|
+
/** The store client under a name of its bytes, the address a page of
|
|
527
|
+
* modules imports it by. */
|
|
528
|
+
export let NAMED_CLIENT: RegExp = /^\/client\.[0-9a-f]{10}\.js$/
|
|
529
|
+
|
|
530
|
+
let appApiPath = (path: string) =>
|
|
531
|
+
/^(?:\/[^/]+)?\/api(\/.+)$/.exec(path)?.[1] ?? ''
|
|
532
|
+
|
|
533
|
+
/** Whether a path names an app asset by the SHA of the bytes served. */
|
|
534
|
+
export let fingerprinted = (path: string): boolean =>
|
|
535
|
+
!!fingerprintPath(appApiPath(path))
|
|
536
|
+
|
|
537
|
+
let releaseAsset = (api: string) => !!assetPath(api) || !!fingerprintPath(api)
|
|
538
|
+
|
|
539
|
+
/** Whether an app API address names immutable release bytes. */
|
|
540
|
+
export let releaseAddress = (path: string): boolean =>
|
|
541
|
+
releaseAsset(appApiPath(path))
|
|
542
|
+
|
|
543
|
+
/** Whether a path names bytes at an app's `/api/` that are the same for
|
|
544
|
+
* everyone who may read the app: a release's asset or one of the platform's
|
|
545
|
+
* modules. A page's first paint loads them, so Site keeps them as it keeps
|
|
546
|
+
* the page. */
|
|
547
|
+
/// fixed('/menu/api/client.js') -> true
|
|
548
|
+
/// fixed('/menu/api/who') -> false
|
|
549
|
+
export let fixed = (path: string): boolean => {
|
|
550
|
+
let api = appApiPath(path)
|
|
551
|
+
return CLIENT.includes(api) || NAMED_CLIENT.test(api) || releaseAsset(api)
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/** A complete upload representation, whose bytes and headers are fixed but
|
|
555
|
+
* whose row must still exist. Unlike `fixed`, these are private app data,
|
|
556
|
+
* even when the app's release is offered for installation. */
|
|
557
|
+
export let uploaded = (path: string): boolean => {
|
|
558
|
+
let blob = /^(?:\/[^/]+)?\/api\/blob\/(.+)$/.exec(path)?.[1]
|
|
559
|
+
return !!blob && !!addressed(blob)?.eid
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/** The read-only app doors whose public answer can be shared. */
|
|
563
|
+
export type PublicRead = 'query' | 'who' | 'vocab'
|
|
564
|
+
|
|
565
|
+
export let publicRead = (path: string): PublicRead | null => {
|
|
566
|
+
let api = appApiPath(path)
|
|
567
|
+
return api == '/query'
|
|
568
|
+
? 'query'
|
|
569
|
+
: api == '/who' || api == '/me'
|
|
570
|
+
? 'who'
|
|
571
|
+
: api == '/vocab.json'
|
|
572
|
+
? 'vocab'
|
|
573
|
+
: null
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** Public snapshots tolerate ordinary browser revalidation for their short
|
|
577
|
+
* edge lifetime. Explicit live queries and no-store requests bypass it. */
|
|
578
|
+
export let dataAtEdge = (req: Request, path = new URL(req.url).pathname) => {
|
|
579
|
+
let read = publicRead(path)
|
|
580
|
+
if (
|
|
581
|
+
!read || req.method != 'GET' || req.cache == 'no-store' ||
|
|
582
|
+
/(?:^|,)\s*no-store\s*(?:,|$)/i.test(req.headers.get('cache-control') ?? '')
|
|
583
|
+
) return false
|
|
584
|
+
return read != 'query' || new URL(req.url).searchParams.get('live') != '1'
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** Loading a page's media shares the page's activity receipt. A direct
|
|
588
|
+
* download or an API client reading an upload records its own use. */
|
|
589
|
+
export let recordsUse = (req: Request): boolean =>
|
|
590
|
+
!loadsAsset(req) || !uploaded(new URL(req.url).pathname)
|
|
591
|
+
|
|
592
|
+
/** Whether a request could be answered by a kept page: a read with nothing
|
|
593
|
+
* that requires the gateway (a grant, a bearer, a byte range), and not an
|
|
594
|
+
* app's `/api/` (but for its `fixed` bytes and `uploaded` representations), a sandboxed page's token path
|
|
595
|
+
* or a draft's preview link, which never are. */
|
|
596
|
+
export let shareable = (
|
|
597
|
+
req: Request,
|
|
598
|
+
path: string = new URL(req.url).pathname,
|
|
599
|
+
): boolean =>
|
|
600
|
+
(req.method == 'GET' || req.method == 'HEAD') &&
|
|
601
|
+
!req.headers.has('authorization') && !req.headers.has('x-yak-caller') &&
|
|
602
|
+
!req.headers.has('range') &&
|
|
603
|
+
!req.headers.has('upgrade') && !bearing(req) &&
|
|
604
|
+
(fixed(path) || uploaded(path) || dataAtEdge(req, path) ||
|
|
605
|
+
!assetAtPage(req, path) &&
|
|
606
|
+
!/^(?:\/[^/]+)?\/(?:api\/|_web(?:\/|$))/.test(path)) &&
|
|
607
|
+
!path.includes('/~') && !previews(path)
|
|
608
|
+
|
|
609
|
+
/** What a page may say of itself as it answers from the edge: its app, its
|
|
610
|
+
* space and slug, the store its app keeps, which a page that `opens` starts,
|
|
611
|
+
* and its space's handle, which the browser is told the hostname's storage is
|
|
612
|
+
* now. A page kept before it said either says none. */
|
|
613
|
+
export type Seen = {
|
|
614
|
+
app: string
|
|
615
|
+
space: string
|
|
616
|
+
slug: string
|
|
617
|
+
store?: string
|
|
618
|
+
handle?: string
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/** Whether a browser goes on to run this answer, so that its scripts ask the
|
|
622
|
+
* app's store next: an HTML page, sent whole or revalidated. */
|
|
623
|
+
export let opens = (res: Response): boolean =>
|
|
624
|
+
(res.status == 200 || res.status == 304) &&
|
|
625
|
+
(res.headers.get('content-type') ?? '').startsWith('text/html')
|
|
626
|
+
|
|
627
|
+
/** Whom a kept page alone is for, where it isn't everyone: strangers, or a
|
|
628
|
+
* person signed in who holds no seat in its space (a space's index, as each
|
|
629
|
+
* is shown it). */
|
|
630
|
+
export type Alone = 'stranger' | 'outsider'
|
|
631
|
+
|
|
632
|
+
/** What Site says of a kept page: what it `Seen`s, and whom it is for
|
|
633
|
+
* alone. */
|
|
634
|
+
export type Said = Partial<Seen> & { [who in Alone]?: true } & {
|
|
635
|
+
read?: PublicRead
|
|
636
|
+
worker?: number
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/** Site's lifetime for a public worker response. The browser still sees the
|
|
640
|
+
* worker's cache rule, including its revalidation directive. */
|
|
641
|
+
export let workerMaxAge = (answer: Response): number => {
|
|
642
|
+
let cache = (answer.headers.get('cache-control') ?? '').toLowerCase()
|
|
643
|
+
.split(',').map((directive) => directive.trim())
|
|
644
|
+
let vary = answer.headers.get('vary')?.trim().toLowerCase()
|
|
645
|
+
if (
|
|
646
|
+
answer.status != 200 || answer.headers.has('set-cookie') ||
|
|
647
|
+
vary && vary != 'accept-encoding' ||
|
|
648
|
+
cache.some((d) => /^(?:private|no-store)(?:=|$)/.test(d))
|
|
649
|
+
) return 0
|
|
650
|
+
let shared = cache.find((d) => /^s-maxage=\d+$/.test(d))
|
|
651
|
+
if (shared) return Math.min(SHORT, Number(shared.slice('s-maxage='.length)))
|
|
652
|
+
let type = answer.headers.get('content-type') ?? ''
|
|
653
|
+
return cache.includes('public') ||
|
|
654
|
+
/^(?:text\/html|application\/json)\b/i.test(type)
|
|
655
|
+
? SHORT
|
|
656
|
+
: 0
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/** An address no kept page may answer: the gateway serves it itself. A pass
|
|
660
|
+
* `now` holds for this answer only: neither Site nor the gateway keeps it. */
|
|
661
|
+
export let passed = (now = false): Response =>
|
|
662
|
+
new Response(null, { status: 204, headers: now ? { [NOW]: '1' } : {} })
|
|
663
|
+
|
|
664
|
+
/** What a page Site may keep is of: the space and app its purge names (none,
|
|
665
|
+
* for a space's own 404 or index; no space, for a missing one), what it says
|
|
666
|
+
* of itself, and the app's release fence, if one is up. */
|
|
667
|
+
export type Of = {
|
|
668
|
+
space: { eid: string } | null
|
|
669
|
+
app: { eid: string; fence?: string | null } | null
|
|
670
|
+
seen: Said
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/** An answer Site may keep, tagged for its purge and saying what it is (`Of`):
|
|
674
|
+
* a page or a 404, unless the caller names other `statuses` the same for
|
|
675
|
+
* everyone, and for everyone unless it is a stranger's or an outsider's
|
|
676
|
+
* `alone`. An app mid-release had its pages purged as the release began, and
|
|
677
|
+
* its commit purges nothing more, so a page of it kept now would outlive the
|
|
678
|
+
* release: it passes, and only for now. */
|
|
679
|
+
export let keep = (
|
|
680
|
+
page: Response,
|
|
681
|
+
of: Of,
|
|
682
|
+
statuses: number[] = [200, 404],
|
|
683
|
+
alone?: Alone,
|
|
684
|
+
): Response => {
|
|
685
|
+
if (!statuses.includes(page.status) || page.headers.has('set-cookie')) {
|
|
686
|
+
return passed()
|
|
687
|
+
}
|
|
688
|
+
if (of.app?.fence) return passed(true)
|
|
689
|
+
let headers = new Headers(page.headers)
|
|
690
|
+
headers.set(
|
|
691
|
+
KEEP,
|
|
692
|
+
[
|
|
693
|
+
...of.app ? [appTag(of.app.eid)] : [],
|
|
694
|
+
of.space ? spaceTag(of.space.eid) : SITE_TAG,
|
|
695
|
+
].join(','),
|
|
696
|
+
)
|
|
697
|
+
headers.set(
|
|
698
|
+
SEEN,
|
|
699
|
+
JSON.stringify({ ...of.seen, ...alone ? { [alone]: true } : {} }),
|
|
700
|
+
)
|
|
701
|
+
return new Response(page.body, { status: page.status, headers })
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/** An app as `keepable` reads it. */
|
|
705
|
+
export type Keepable = {
|
|
706
|
+
access: unknown
|
|
707
|
+
worker?: string | null
|
|
708
|
+
installed?: { sandboxed?: string | null } | null
|
|
709
|
+
published?: unknown
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/** Whether Site may keep an app's answer at `path`, or with no path, at any
|
|
713
|
+
* of its addresses: every own file of an app anyone may read (public or
|
|
714
|
+
* open), and the `fixed` bytes of one anyone may install (`offered`), which
|
|
715
|
+
* its pages load first. A private app's pages and data are its members', a
|
|
716
|
+
* sandboxed page carries its visitor's token, and an app's worker may answer
|
|
717
|
+
* each visitor differently: so of an app with a worker, only what no worker
|
|
718
|
+
* is asked about, its `fixed` bytes and uploads (the platform's `/api/`
|
|
719
|
+
* answers those before any worker), and every path its release's config
|
|
720
|
+
* (`assets`) leaves its files (./files.ts `workerFirst`).
|
|
721
|
+
*
|
|
722
|
+
* ```ts
|
|
723
|
+
* import { keepable } from '@yaks/platform/kept'
|
|
724
|
+
* import { assert } from '@std/assert'
|
|
725
|
+
* let css = '/api/assets/fdcc9a38-0b6b-4f8c-bcbd-15bad97cee69/style.css'
|
|
726
|
+
* let published = { name: 'notes', version: 2, at: '', about: '' }
|
|
727
|
+
* let app = { access: 'private', worker: '', published }
|
|
728
|
+
* assert(keepable(app, css) && keepable(app, '/api/client.js'))
|
|
729
|
+
* assert(keepable(app) && !keepable(app, '/') && !keepable(app, '/api/who'))
|
|
730
|
+
* assert(!keepable({ ...app, published: null }))
|
|
731
|
+
* // A public app's worker is asked about every path, unless its config
|
|
732
|
+
* // declares its routes.
|
|
733
|
+
* let worked = { access: 'public', worker: 'w' }
|
|
734
|
+
* assert(keepable(worked, css) && !keepable(worked, '/data.json'))
|
|
735
|
+
* let routes = { run_worker_first: ['/p/*'] }
|
|
736
|
+
* assert(keepable(worked, '/data.json', routes) && !keepable(worked, '/p/1', routes))
|
|
737
|
+
* ```
|
|
738
|
+
*/
|
|
739
|
+
export let keepable = (
|
|
740
|
+
app: Keepable,
|
|
741
|
+
path?: string,
|
|
742
|
+
assets?: Assets,
|
|
743
|
+
): boolean =>
|
|
744
|
+
!sandboxed(app) &&
|
|
745
|
+
(app.worker === '' ||
|
|
746
|
+
(path == null
|
|
747
|
+
? declared(assets)
|
|
748
|
+
: uploaded(path) || fixed(path) || !workerFirst(assets, path))) &&
|
|
749
|
+
(mode(app.access) == 'public' || mode(app.access) == 'open' ||
|
|
750
|
+
mode(app.access) == 'private' && offered(app) &&
|
|
751
|
+
(path == null || fixed(path)))
|
|
752
|
+
|
|
753
|
+
/** Site's half: the gateway's anonymous answer as Site keeps it, or the pass
|
|
754
|
+
* every other answer is. At a session's own key (`personal`) that is only
|
|
755
|
+
* the page drawn for an outsider: whatever else it served the person is
|
|
756
|
+
* everyone's, kept at its own key, or theirs alone, which is never kept.
|
|
757
|
+
* An upload at `path` is kept only until its servability must be asked again,
|
|
758
|
+
* with neither stale answers nor cached misses. A directory-copy fallback
|
|
759
|
+
* can answer the visitor while both caches bypass it. */
|
|
760
|
+
export let kept = async (
|
|
761
|
+
answer: Response,
|
|
762
|
+
personal = false,
|
|
763
|
+
path = '',
|
|
764
|
+
cache = true,
|
|
765
|
+
): Promise<Response> => {
|
|
766
|
+
let upload = uploaded(path), read = publicRead(path)
|
|
767
|
+
let tags = answer.headers.get(KEEP)
|
|
768
|
+
let alone = JSON.parse(answer.headers.get(SEEN) ?? '{}') as Said
|
|
769
|
+
if (
|
|
770
|
+
!tags || personal && !alone.outsider ||
|
|
771
|
+
(upload || read) && answer.status != 200 || read && alone.read != read ||
|
|
772
|
+
upload && answer.headers.get('cache-control') == UNKEPT
|
|
773
|
+
) {
|
|
774
|
+
await answer.body?.cancel()
|
|
775
|
+
return new Response(null, {
|
|
776
|
+
status: 204,
|
|
777
|
+
headers: {
|
|
778
|
+
'cache-control': !cache || upload || read || answer.headers.has(NOW)
|
|
779
|
+
? UNKEPT
|
|
780
|
+
: KEPT,
|
|
781
|
+
},
|
|
782
|
+
})
|
|
783
|
+
}
|
|
784
|
+
let headers = new Headers(answer.headers)
|
|
785
|
+
headers.delete(KEEP)
|
|
786
|
+
headers.set(
|
|
787
|
+
BROWSER,
|
|
788
|
+
cache && !read
|
|
789
|
+
? answer.headers.get('cache-control') ?? (alone.worker ? UNKEPT : '')
|
|
790
|
+
: UNKEPT,
|
|
791
|
+
)
|
|
792
|
+
let lifetime = siteLifetime(read ? 'read' : 'app', alone.worker)
|
|
793
|
+
headers.set('cache-control', cache ? lifetime : UNKEPT)
|
|
794
|
+
if (cache) {
|
|
795
|
+
headers.set(
|
|
796
|
+
TAGS,
|
|
797
|
+
upload && alone.app ? `${tags},${uploadTag(alone.app)}` : tags,
|
|
798
|
+
)
|
|
799
|
+
} else headers.delete(TAGS)
|
|
800
|
+
return new Response(answer.body, { status: answer.status, headers })
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
// ── The apex's listings, at Site ───────────────────────────────────────────
|
|
804
|
+
|
|
805
|
+
/** Where Site keeps one of the apex's own pages. The hostname is a
|
|
806
|
+
* placeholder for a service binding; the apex is in the path because the
|
|
807
|
+
* cache keys by path and entrypoint. The generation skips entries stored
|
|
808
|
+
* under the older lifetime. */
|
|
809
|
+
/// listingAt('yaks.app', '/gallery') -> 'https://site.invalid/yaks.app/gallery?g=2'
|
|
810
|
+
export let listingAt = (apex: string, path: string): string =>
|
|
811
|
+
`https://site.invalid/${encodeURIComponent(apex)}${path}?g=2`
|
|
812
|
+
|
|
813
|
+
/** Whether a visit to the sign-in card is a stranger's with nowhere to return
|
|
814
|
+
* to: no session cookie and no credentials, so nobody is signed in to be sent
|
|
815
|
+
* on, and no `return` the card would carry forward. Such a card is the same
|
|
816
|
+
* for everyone, so Site keeps it. */
|
|
817
|
+
export let stranger = (req: Request): boolean =>
|
|
818
|
+
!cookieValue(req.headers.get('cookie')) &&
|
|
819
|
+
!cookieValue(req.headers.get('cookie'), HOST_COOKIE) &&
|
|
820
|
+
!req.headers.has('authorization') &&
|
|
821
|
+
!new URL(req.url).searchParams.has('return')
|