@aglyn/aglyn 1.0.0-beta.207 → 1.0.0-beta.209

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/aglyn",
3
- "version": "1.0.0-beta.207",
3
+ "version": "1.0.0-beta.209",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -33,16 +33,16 @@
33
33
  "./package.json": "./package.json"
34
34
  },
35
35
  "dependencies": {
36
- "@aglyn/shared-data-enums": "1.0.0-beta.207",
37
- "@aglyn/shared-data-mdi": "1.0.0-beta.207",
38
- "@aglyn/shared-data-types": "1.0.0-beta.207",
39
- "@aglyn/shared-util-email": "1.0.0-beta.207",
40
- "@aglyn/shared-util-first-touch": "1.0.0-beta.207",
41
- "@aglyn/shared-util-http": "1.0.0-beta.207",
42
- "@aglyn/shared-util-logger": "1.0.0-beta.207",
43
- "@aglyn/shared-util-timestamp": "1.0.0-beta.207",
44
- "@aglyn/shared-util-tools": "1.0.0-beta.207",
45
- "@aglyn/shared-util-vendor": "1.0.0-beta.207",
36
+ "@aglyn/shared-data-enums": "1.0.0-beta.209",
37
+ "@aglyn/shared-data-mdi": "1.0.0-beta.209",
38
+ "@aglyn/shared-data-types": "1.0.0-beta.209",
39
+ "@aglyn/shared-util-email": "1.0.0-beta.209",
40
+ "@aglyn/shared-util-first-touch": "1.0.0-beta.209",
41
+ "@aglyn/shared-util-http": "1.0.0-beta.209",
42
+ "@aglyn/shared-util-logger": "1.0.0-beta.209",
43
+ "@aglyn/shared-util-timestamp": "1.0.0-beta.209",
44
+ "@aglyn/shared-util-tools": "1.0.0-beta.209",
45
+ "@aglyn/shared-util-vendor": "1.0.0-beta.209",
46
46
  "@data-driven-forms/react-form-renderer": "^4.2.0",
47
47
  "@msgpack/msgpack": "^3.1.3",
48
48
  "@types/unist": "^3.0.3",
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * A plugin's console card just saved a SITE-WIDE setting: drop every cached
19
+ * page of the site (AGL-3386).
20
+ *
21
+ * The plugin-side door to the console's own `/api/screens/revalidate`, which
22
+ * a plugin cannot import. A setting that lives on the host document, or on a
23
+ * site-wide settings document beside it — the announcement bar, the popup,
24
+ * the store's currency — is rendered on every page and saved with no publish
25
+ * step, so without this the live site shows it only once each page's
26
+ * hour-long cache happens to lapse.
27
+ *
28
+ * `entireHost` because such a setting has no address of its own. It is the
29
+ * console route's explicit whole-site branch, authorized for exactly the
30
+ * roles the rules let write the site — the caller already proved that by
31
+ * writing.
32
+ *
33
+ * Call it AFTER the write has succeeded, and do not await it into the save's
34
+ * outcome: it never throws and never rejects, because a cache hint that fails
35
+ * must not make a successful save look failed. The hour-long window is still
36
+ * underneath as the backstop.
37
+ */
38
+ export declare function announceSiteWideChange(options: {
39
+ /** The signed-in user; its ID token authenticates the console route. */
40
+ user: {
41
+ getIdToken?: () => Promise<string>;
42
+ } | null | undefined;
43
+ hostId: string;
44
+ }): Promise<boolean>;
45
+ export default announceSiteWideChange;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { authorizedFetch } from "@aglyn/shared-util-http/authorized-token";
17
+ /**
18
+ * A plugin's console card just saved a SITE-WIDE setting: drop every cached
19
+ * page of the site (AGL-3386).
20
+ *
21
+ * The plugin-side door to the console's own `/api/screens/revalidate`, which
22
+ * a plugin cannot import. A setting that lives on the host document, or on a
23
+ * site-wide settings document beside it — the announcement bar, the popup,
24
+ * the store's currency — is rendered on every page and saved with no publish
25
+ * step, so without this the live site shows it only once each page's
26
+ * hour-long cache happens to lapse.
27
+ *
28
+ * `entireHost` because such a setting has no address of its own. It is the
29
+ * console route's explicit whole-site branch, authorized for exactly the
30
+ * roles the rules let write the site — the caller already proved that by
31
+ * writing.
32
+ *
33
+ * Call it AFTER the write has succeeded, and do not await it into the save's
34
+ * outcome: it never throws and never rejects, because a cache hint that fails
35
+ * must not make a successful save look failed. The hour-long window is still
36
+ * underneath as the backstop.
37
+ */ export async function announceSiteWideChange(options) {
38
+ const { user, hostId } = options;
39
+ if (!hostId) return false;
40
+ try {
41
+ const response = await authorizedFetch(user, '/api/screens/revalidate', {
42
+ method: 'POST',
43
+ headers: {
44
+ 'Content-Type': 'application/json'
45
+ },
46
+ body: JSON.stringify({
47
+ hostId,
48
+ entireHost: true
49
+ })
50
+ });
51
+ return response.ok;
52
+ } catch (unused) {
53
+ return false;
54
+ }
55
+ }
56
+ export default announceSiteWideChange;
57
+
58
+ //# sourceMappingURL=announce-site-wide-change.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/announce-site-wide-change.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\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\n\n/**\n * A plugin's console card just saved a SITE-WIDE setting: drop every cached\n * page of the site (AGL-3386).\n *\n * The plugin-side door to the console's own `/api/screens/revalidate`, which\n * a plugin cannot import. A setting that lives on the host document, or on a\n * site-wide settings document beside it — the announcement bar, the popup,\n * the store's currency — is rendered on every page and saved with no publish\n * step, so without this the live site shows it only once each page's\n * hour-long cache happens to lapse.\n *\n * `entireHost` because such a setting has no address of its own. It is the\n * console route's explicit whole-site branch, authorized for exactly the\n * roles the rules let write the site — the caller already proved that by\n * writing.\n *\n * Call it AFTER the write has succeeded, and do not await it into the save's\n * outcome: it never throws and never rejects, because a cache hint that fails\n * must not make a successful save look failed. The hour-long window is still\n * underneath as the backstop.\n */\nexport async function announceSiteWideChange(options: {\n /** The signed-in user; its ID token authenticates the console route. */\n user: { getIdToken?: () => Promise<string> } | null | undefined\n hostId: string\n}): Promise<boolean> {\n const { user, hostId } = options\n if (!hostId) return false\n try {\n const response = await authorizedFetch(user, '/api/screens/revalidate', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ hostId, entireHost: true }),\n })\n return response.ok\n } catch {\n return false\n }\n}\n\nexport default announceSiteWideChange\n"],"names":["authorizedFetch","announceSiteWideChange","options","user","hostId","response","method","headers","body","JSON","stringify","entireHost","ok"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,eAAe,QAAQ,2CAA0C;AAE1E;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,eAAeC,uBAAuBC,OAI5C;IACC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGF;IACzB,IAAI,CAACE,QAAQ,OAAO;IACpB,IAAI;QACF,MAAMC,WAAW,MAAML,gBAAgBG,MAAM,2BAA2B;YACtEG,QAAQ;YACRC,SAAS;gBAAE,gBAAgB;YAAmB;YAC9CC,MAAMC,KAAKC,SAAS,CAAC;gBAAEN;gBAAQO,YAAY;YAAK;QAClD;QACA,OAAON,SAASO,EAAE;IACpB,EAAE,eAAM;QACN,OAAO;IACT;AACF;AAEA,eAAeX,uBAAsB"}
@@ -6540,7 +6540,7 @@ export const ASSIST_DOCS_INDEX = [
6540
6540
  title: 'Publish your first screen',
6541
6541
  heading: 'How fast changes go live',
6542
6542
  anchor: '#how-fast-changes-go-live',
6543
- text: '- Publishing a screen refreshes its live page immediately — the very next visitor gets the new version, usually within seconds.\n- Publishing a layout or a reusable component refreshes every page that uses it the same way. When that fan-out is very large, the publish confirms that the remaining pages "update on their own within an hour" — and they do.\n- Saving is not publishing. A save writes your working version; the live site serves the published one. The one subtle case: if you edit the version that is currently live and press Save, the live site catches up on its own within about a minute — and because pages regenerate behind the scenes, you may need to refresh twice to see it.\n- Your site\'s sitemap.xml, robots.txt, and RSS feeds refresh within about five minutes (a publish refreshes the sitemap immediately).'
6543
+ text: '- Publishing a screen refreshes its live page immediately — the very next visitor gets the new version, usually within seconds.\n- Publishing a layout or a reusable component refreshes every page that uses it the same way. When that fan-out is very large, the publish confirms that the remaining pages "update on their own within an hour" — and they do.\n- Site settings go live when you save them. Your theme, logo, favicon, app icon, social image, SEO and structured data, business details, languages, consent banner, announcement bar, popup and store settings have no publish step — saving one refreshes every page of the live site immediately, the same way a publish does. Installing, updating or resetting a marketplace theme does too.\n- Saving is not publishing. A save writes your working version; the live site serves the published one. The one subtle case: if you edit the version that is currently live and press Save, the live site catches up on its own within about a minute — and because pages regenerate behind the scenes, you may need to refresh twice to see it.\n- Your site\'s sitemap.xml, robots.txt, and RSS feeds refresh within about five minutes (a publish refreshes the sitemap immediately).'
6544
6544
  },
6545
6545
  {
6546
6546
  path: '/getting-started/publish-your-first-screen',