@aglyn/aglyn 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +11 -11
  2. package/src/lib/app-utils/contacts.d.ts +4 -1
  3. package/src/lib/app-utils/contacts.js +5 -1
  4. package/src/lib/app-utils/contacts.js.map +1 -1
  5. package/src/lib/app-utils/crm.d.ts +11 -0
  6. package/src/lib/app-utils/crm.js +10 -4
  7. package/src/lib/app-utils/crm.js.map +1 -1
  8. package/src/lib/app-utils/docs-help.generated.d.ts +1 -1
  9. package/src/lib/app-utils/docs-help.generated.js +2 -0
  10. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  11. package/src/lib/app-utils/docs-index.generated.js +32 -11
  12. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  13. package/src/lib/app-utils/lockdown.js +4 -1
  14. package/src/lib/app-utils/lockdown.js.map +1 -1
  15. package/src/lib/app-utils/plan-entitlements.d.ts +5 -0
  16. package/src/lib/app-utils/plan-entitlements.js +6 -0
  17. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  18. package/src/lib/app-utils/plugin-sale.d.ts +36 -0
  19. package/src/lib/app-utils/plugin-sale.js +37 -0
  20. package/src/lib/app-utils/plugin-sale.js.map +1 -0
  21. package/src/lib/app-utils/site-starter-pick.d.ts +11 -0
  22. package/src/lib/app-utils/site-starter-pick.js +17 -1
  23. package/src/lib/app-utils/site-starter-pick.js.map +1 -1
  24. package/src/lib/app-utils/site-starter-theme.d.ts +28 -1
  25. package/src/lib/app-utils/site-starter-theme.js +78 -4
  26. package/src/lib/app-utils/site-starter-theme.js.map +1 -1
  27. package/src/lib/app-utils/site-styles.d.ts +11 -0
  28. package/src/lib/app-utils/site-styles.js +11 -0
  29. package/src/lib/app-utils/site-styles.js.map +1 -1
  30. package/src/lib/app-utils/site-unavailable.d.ts +22 -2
  31. package/src/lib/app-utils/site-unavailable.js +19 -3
  32. package/src/lib/app-utils/site-unavailable.js.map +1 -1
  33. package/src/lib/plugin-manager/feature-plugins.d.ts +6 -1
  34. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/site-unavailable.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The site's 503 answer, sent as a 503 (AGL-4110).\n *\n * Maintenance mode (AGL-131) and preview (AGL-4086) answer a visitor who is\n * not let through with the site's designed 503 page, or the built-in notice,\n * at every address. The body was right and the status was not: every address\n * said `200 OK`, which tells a crawler the notice IS the page. A live site\n * that spent a weekend in maintenance could be re-indexed as \"Temporarily\n * unavailable\" and drop out of search. `503` with `Retry-After` is the answer\n * that means \"this site is briefly down, come back\".\n *\n * The body still comes from the ISR-cached catch-all, exactly as before; only\n * the tenant middleware can set the status, because an App Router page has no\n * status lever and the middleware is the one layer that runs ahead of the\n * cache on every request. It asks {@link siteUnavailableForRequest} and\n * rewrites with the status, so a cached page body never decides it.\n *\n * DEPENDENCY-FREE ON PURPOSE, like `site-preview.ts`: the middleware runs on\n * the edge and deep-imports this leaf, so it imports nothing.\n */\n\n/**\n * How long a crawler or uptime check is told to wait before asking again, in\n * seconds: an hour.\n *\n * The bandwidth cap's figure (`BANDWIDTH_CAP_RETRY_AFTER_SECONDS`), for the\n * same reason. Both states end the moment the owner flips a switch, and the\n * site is back within about a minute, so no longer value is ever \"correct\".\n * Too long is wrong in the direction that costs the site: a crawler staying\n * away after the site came back. An hour is short enough to be wrong in the\n * recoverable direction, and long enough that a crawler does not spend its\n * visits re-reading \"not yet\".\n */\nexport const SITE_UNAVAILABLE_RETRY_AFTER_SECONDS = 3600\n\n/**\n * Is the site in maintenance mode (AGL-131)?\n *\n * The loader's own test, shared with the verdict the middleware reads, so the\n * status and the body are decided by one predicate: a field the loader reads as\n * \"in maintenance\" is a field the middleware reads the same way.\n */\nexport function isHostInMaintenance(\n host: { maintenance?: unknown } | null | undefined,\n): boolean {\n return Boolean(host?.maintenance)\n}\n\n/** What the middleware knows about a site, from its verdict. */\nexport interface SiteUnavailableVerdict {\n /** Maintenance mode is on. */\n maintenance?: boolean\n /** The WHOLE site is in preview. One page in preview is not this. */\n preview?: boolean\n}\n\n/** How the middleware is routing this request. */\nexport interface SiteUnavailableRouting {\n /** An entry preview link (`?aglyn_preview=`) is being opened. */\n entryPreview: boolean\n /**\n * A team cookie sent this request around the cache to the uncached preview\n * route, which shows the team the site.\n */\n teamPreview: boolean\n}\n\n/**\n * Does this page request get the site's 503 answer as an HTTP 503?\n *\n * - **Maintenance: yes, for everyone**, the site's team included. It is the\n * switch that means \"nobody\", and the loader serves the 503 page to every\n * request, the team's preview route included, so every status says so.\n * - **A site in preview: yes, for the public**, the requests answered from the\n * shared cache. A request carrying a team cookie goes to the uncached\n * preview route instead, which shows the team the whole site.\n * - **An entry preview link: no.** When the site is unavailable its route\n * redirects to the plain address, which answers 503 by the rules above; a\n * 503 set here would only argue with that redirect.\n * - **One page in preview: no.** The public gets the site's 404 there, and the\n * render's own 404 decides that status.\n *\n * Nothing here is a permission. The body is the loader's decision, and a\n * request this answers `false` for is one whose body is already the site, or\n * an answer with a status of its own.\n */\nexport function siteUnavailableForRequest(\n verdict: SiteUnavailableVerdict | null | undefined,\n routing: SiteUnavailableRouting,\n): boolean {\n if (!verdict || routing.entryPreview) return false\n if (verdict.maintenance === true) return true\n return verdict.preview === true && !routing.teamPreview\n}\n"],"names":["SITE_UNAVAILABLE_RETRY_AFTER_SECONDS","isHostInMaintenance","host","Boolean","maintenance","siteUnavailableForRequest","verdict","routing","entryPreview","preview","teamPreview"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;CAmBC,GAED;;;;;;;;;;;CAWC,GACD,OAAO,MAAMA,uCAAuC,KAAI;AAExD;;;;;;CAMC,GACD,OAAO,SAASC,oBACdC,IAAkD;IAElD,OAAOC,QAAQD,wBAAAA,KAAME,WAAW;AAClC;AAqBA;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,SAASC,0BACdC,OAAkD,EAClDC,OAA+B;IAE/B,IAAI,CAACD,WAAWC,QAAQC,YAAY,EAAE,OAAO;IAC7C,IAAIF,QAAQF,WAAW,KAAK,MAAM,OAAO;IACzC,OAAOE,QAAQG,OAAO,KAAK,QAAQ,CAACF,QAAQG,WAAW;AACzD"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/site-unavailable.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The site's 503 answer, sent as a 503 (AGL-4110).\n *\n * Maintenance mode (AGL-131) and preview (AGL-4086) answer a visitor who is\n * not let through with the site's designed 503 page, or the built-in notice,\n * at every address. The body was right and the status was not: every address\n * said `200 OK`, which tells a crawler the notice IS the page. A live site\n * that spent a weekend in maintenance could be re-indexed as \"Temporarily\n * unavailable\" and drop out of search. `503` with `Retry-After` is the answer\n * that means \"this site is briefly down, come back\".\n *\n * The body still comes from the ISR-cached catch-all, exactly as before; only\n * the tenant middleware can set the status, because an App Router page has no\n * status lever and the middleware is the one layer that runs ahead of the\n * cache on every request. It asks {@link siteUnavailableForRequest}, reads the\n * page, and sends it as a 503, so a cached page body never decides the status.\n * Why it reads the page rather than putting the status on its rewrite is the\n * note beside that code: on Vercel that rewrite loses the page.\n *\n * DEPENDENCY-FREE ON PURPOSE, like `site-preview.ts`: the middleware runs on\n * the edge and deep-imports this leaf, so it imports nothing.\n */\n\n/**\n * How long a crawler or uptime check is told to wait before asking again, in\n * seconds: an hour.\n *\n * The bandwidth cap's figure (`BANDWIDTH_CAP_RETRY_AFTER_SECONDS`), for the\n * same reason. Both states end the moment the owner flips a switch, and the\n * site is back within about a minute, so no longer value is ever \"correct\".\n * Too long is wrong in the direction that costs the site: a crawler staying\n * away after the site came back. An hour is short enough to be wrong in the\n * recoverable direction, and long enough that a crawler does not spend its\n * visits re-reading \"not yet\".\n */\nexport const SITE_UNAVAILABLE_RETRY_AFTER_SECONDS = 3600\n\n/**\n * Marks the middleware's own read of the notice page, which comes back through\n * the middleware and must take the plain rewrite rather than read it again.\n *\n * Not a secret, and nothing is withheld behind it: a stranger who sends it gets\n * the same notice with a 200.\n */\nexport const SITE_NOTICE_REQUEST_HEADER = 'x-aglyn-site-notice'\n\n/**\n * How long a visitor waits on that read, in milliseconds, before being served\n * the plain rewrite. Generous, as the verdict's deadline is: a cold render\n * answers inside it, and the page still arrives if it does not.\n */\nexport const SITE_NOTICE_DEADLINE_MS = 8_000\n\n/**\n * Is the site in maintenance mode (AGL-131)?\n *\n * The loader's own test, shared with the verdict the middleware reads, so the\n * status and the body are decided by one predicate: a field the loader reads as\n * \"in maintenance\" is a field the middleware reads the same way.\n */\nexport function isHostInMaintenance(\n host: { maintenance?: unknown } | null | undefined,\n): boolean {\n return Boolean(host?.maintenance)\n}\n\n/** What the middleware knows about a site, from its verdict. */\nexport interface SiteUnavailableVerdict {\n /** Maintenance mode is on. */\n maintenance?: boolean\n /** The WHOLE site is in preview. One page in preview is not this. */\n preview?: boolean\n}\n\n/** How the middleware is routing this request. */\nexport interface SiteUnavailableRouting {\n /** An entry preview link (`?aglyn_preview=`) is being opened. */\n entryPreview: boolean\n /**\n * A team cookie sent this request around the cache to the uncached preview\n * route, which shows the team the site.\n */\n teamPreview: boolean\n /** The middleware's own read of the notice page, not a visitor. */\n noticeRequest?: boolean\n}\n\n/**\n * Does this page request get the site's 503 answer as an HTTP 503?\n *\n * - **Maintenance: yes, for everyone**, the site's team included. It is the\n * switch that means \"nobody\", and the loader serves the 503 page to every\n * request, the team's preview route included, so every status says so.\n * - **A site in preview: yes, for the public**, the requests answered from the\n * shared cache. A request carrying a team cookie goes to the uncached\n * preview route instead, which shows the team the whole site.\n * - **An entry preview link: no.** When the site is unavailable its route\n * redirects to the plain address, which answers 503 by the rules above; a\n * 503 set here would only argue with that redirect.\n * - **One page in preview: no.** The public gets the site's 404 there, and the\n * render's own 404 decides that status.\n * - **The middleware's own read of the page: no.** That is how the body of the\n * 503 is fetched, and it would otherwise fetch itself.\n *\n * Nothing here is a permission. The body is the loader's decision, and a\n * request this answers `false` for is one whose body is already the site, or\n * an answer with a status of its own.\n */\nexport function siteUnavailableForRequest(\n verdict: SiteUnavailableVerdict | null | undefined,\n routing: SiteUnavailableRouting,\n): boolean {\n if (!verdict || routing.entryPreview || routing.noticeRequest) return false\n if (verdict.maintenance === true) return true\n return verdict.preview === true && !routing.teamPreview\n}\n"],"names":["SITE_UNAVAILABLE_RETRY_AFTER_SECONDS","SITE_NOTICE_REQUEST_HEADER","SITE_NOTICE_DEADLINE_MS","isHostInMaintenance","host","Boolean","maintenance","siteUnavailableForRequest","verdict","routing","entryPreview","noticeRequest","preview","teamPreview"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;CAqBC,GAED;;;;;;;;;;;CAWC,GACD,OAAO,MAAMA,uCAAuC,KAAI;AAExD;;;;;;CAMC,GACD,OAAO,MAAMC,6BAA6B,sBAAqB;AAE/D;;;;CAIC,GACD,OAAO,MAAMC,0BAA0B,KAAK;AAE5C;;;;;;CAMC,GACD,OAAO,SAASC,oBACdC,IAAkD;IAElD,OAAOC,QAAQD,wBAAAA,KAAME,WAAW;AAClC;AAuBA;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,SAASC,0BACdC,OAAkD,EAClDC,OAA+B;IAE/B,IAAI,CAACD,WAAWC,QAAQC,YAAY,IAAID,QAAQE,aAAa,EAAE,OAAO;IACtE,IAAIH,QAAQF,WAAW,KAAK,MAAM,OAAO;IACzC,OAAOE,QAAQI,OAAO,KAAK,QAAQ,CAACH,QAAQI,WAAW;AACzD"}
@@ -1407,7 +1407,12 @@ export interface ConsoleClientBuildStart {
1407
1407
  * widget that does not publish a kind draws nothing for it.
1408
1408
  */
1409
1409
  export interface ConsolePublishableArtifact {
1410
- /** What the thing is: `layout`, `component`, `theme`, `site`, … */
1410
+ /**
1411
+ * What the thing is: `layout`, `component`, `theme`, `site`, … A whole
1412
+ * site as a site starter people create a new site from is `siteStarter`
1413
+ * (AGL-4049), with the `hostId` it is, and the site's name and description
1414
+ * to seed the listing.
1415
+ */
1411
1416
  kind: string;
1412
1417
  /** The site it belongs to, where the kind belongs to one. */
1413
1418
  hostId?: string | null;