@aglyn/aglyn 1.0.0-beta.292 → 1.0.0-beta.293
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 +11 -11
- package/src/lib/app-utils/analytics-events.d.ts +12 -2
- package/src/lib/app-utils/analytics-events.js.map +1 -1
- package/src/lib/app-utils/business-profile-values.d.ts +3 -2
- package/src/lib/app-utils/business-profile-values.js +4 -3
- package/src/lib/app-utils/business-profile-values.js.map +1 -1
- package/src/lib/app-utils/docs-help-sections.generated.js +4 -4
- package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.d.ts +8 -2
- package/src/lib/app-utils/docs-help.generated.js +18 -1
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +101 -24
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/notifications.d.ts +31 -2
- package/src/lib/app-utils/notifications.js +18 -2
- package/src/lib/app-utils/notifications.js.map +1 -1
- package/src/lib/app-utils/site-create-return.d.ts +63 -0
- package/src/lib/app-utils/site-create-return.js +72 -0
- package/src/lib/app-utils/site-create-return.js.map +1 -0
- package/src/lib/app-utils/site-starter-pick.d.ts +51 -0
- package/src/lib/app-utils/site-starter-pick.js +47 -0
- package/src/lib/app-utils/site-starter-pick.js.map +1 -0
- package/src/lib/app-utils/site-styles.d.ts +110 -0
- package/src/lib/app-utils/site-styles.js +126 -0
- package/src/lib/app-utils/site-styles.js.map +1 -0
- package/src/lib/app-utils/site-unavailable.d.ts +96 -0
- package/src/lib/app-utils/site-unavailable.js +80 -0
- package/src/lib/app-utils/site-unavailable.js.map +1 -0
- package/src/lib/app-utils/visitor-upload.d.ts +19 -0
- package/src/lib/app-utils/visitor-upload.js +29 -1
- package/src/lib/app-utils/visitor-upload.js.map +1 -1
- package/src/lib/foundation/definitions/platform.types.d.ts +9 -0
- package/src/lib/foundation/definitions/platform.types.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +68 -13
- package/src/lib/plugin-manager/feature-plugins.js +16 -9
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
- package/src/lib/plugin-manager/plugin-site-starters.d.ts +30 -0
- package/src/lib/plugin-manager/plugin-site-starters.js +19 -0
- package/src/lib/plugin-manager/plugin-site-starters.js.map +1 -1
- package/src/lib/plugin-manager/plugin-site-style-looks.d.ts +43 -0
- package/src/lib/plugin-manager/plugin-site-style-looks.js +30 -0
- package/src/lib/plugin-manager/plugin-site-style-looks.js.map +1 -0
- package/src/lib/plugin-manager/plugin-upload-storage-gate.d.ts +60 -0
- package/src/lib/plugin-manager/plugin-upload-storage-gate.js +32 -0
- package/src/lib/plugin-manager/plugin-upload-storage-gate.js.map +1 -0
|
@@ -40,6 +40,19 @@ export interface SiteStarterSummary {
|
|
|
40
40
|
priceUsd: number;
|
|
41
41
|
previewImageUrl: string | null;
|
|
42
42
|
facets: SiteStarterFacets;
|
|
43
|
+
/**
|
|
44
|
+
* What kind of site it is, in words a card shows ("Restaurant & café"), or
|
|
45
|
+
* `null` where it names none. Optional: a source with no such words still
|
|
46
|
+
* satisfies the seam, and `facets.kind` stays the id a search filters on.
|
|
47
|
+
*/
|
|
48
|
+
category?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* The asking workspace may create from it without paying (AGL-4049):
|
|
51
|
+
* bought already, or its own. Read for the person who asked, so it is set
|
|
52
|
+
* only by an answer that knows who that is, and absent where it does not
|
|
53
|
+
* say; a free starter needs no purchase either way.
|
|
54
|
+
*/
|
|
55
|
+
owned?: boolean;
|
|
43
56
|
}
|
|
44
57
|
/** Who is asking: the workspace the site will belong to, and the person. */
|
|
45
58
|
export interface SiteStarterViewer {
|
|
@@ -70,6 +83,15 @@ export interface PluginSiteStarterSource {
|
|
|
70
83
|
installed?(choice: SiteStarterChoice, viewer: SiteStarterViewer, site: {
|
|
71
84
|
hostId: string;
|
|
72
85
|
}): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* One starter as a search would list it for this viewer, or `null` when it
|
|
88
|
+
* is not one they may see (AGL-4049): what the create path records a site
|
|
89
|
+
* was started from, and the name it files the starter's theme under, and
|
|
90
|
+
* what "Choose your starter" shows for a pick it restores. Best-effort.
|
|
91
|
+
* Optional, so a source that cannot describe a single listing still
|
|
92
|
+
* satisfies the seam; read it through {@link describeSiteStarter}.
|
|
93
|
+
*/
|
|
94
|
+
describe?(choice: SiteStarterChoice, viewer: SiteStarterViewer): Promise<SiteStarterSummary | null>;
|
|
73
95
|
}
|
|
74
96
|
export declare const PLUGIN_SITE_STARTERS: import("./plugin-services").PluginServiceContract<PluginSiteStarterSource>;
|
|
75
97
|
/** Registers the plugin that serves site starters. One per deployment; a second is refused. */
|
|
@@ -78,3 +100,11 @@ export declare function registerPluginSiteStarterSource(impl: PluginSiteStarterS
|
|
|
78
100
|
}): void;
|
|
79
101
|
/** The registered starter source, or `null` when no plugin serves starters. */
|
|
80
102
|
export declare function resolveSiteStarterSource(): PluginSiteStarterSource | null;
|
|
103
|
+
/**
|
|
104
|
+
* A starter as the source describes it, or `null` when the source cannot say
|
|
105
|
+
* (AGL-4049): no `describe`, a listing the viewer may not see, or a source
|
|
106
|
+
* that failed. Never throws, because nothing it answers is required: the
|
|
107
|
+
* create path falls back to the payload's own facts, and the picker to the
|
|
108
|
+
* search.
|
|
109
|
+
*/
|
|
110
|
+
export declare function describeSiteStarter(source: PluginSiteStarterSource | null, choice: SiteStarterChoice, viewer: SiteStarterViewer): Promise<SiteStarterSummary | null>;
|
|
@@ -26,5 +26,24 @@ export const PLUGIN_SITE_STARTERS = definePluginServiceContract('core.site-start
|
|
|
26
26
|
var _resolvePluginService;
|
|
27
27
|
return (_resolvePluginService = resolvePluginService(PLUGIN_SITE_STARTERS)) != null ? _resolvePluginService : null;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* A starter as the source describes it, or `null` when the source cannot say
|
|
31
|
+
* (AGL-4049): no `describe`, a listing the viewer may not see, or a source
|
|
32
|
+
* that failed. Never throws, because nothing it answers is required: the
|
|
33
|
+
* create path falls back to the payload's own facts, and the picker to the
|
|
34
|
+
* search.
|
|
35
|
+
*/ export async function describeSiteStarter(source, choice, viewer) {
|
|
36
|
+
if (!(source == null ? void 0 : source.describe) || !(choice == null ? void 0 : choice.listingId)) return null;
|
|
37
|
+
try {
|
|
38
|
+
const summary = await source.describe(choice, viewer);
|
|
39
|
+
return summary && typeof summary === 'object' && summary.listingId === choice.listingId ? summary : null;
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error('[site-starters] describe failed', {
|
|
42
|
+
listingId: choice.listingId,
|
|
43
|
+
error
|
|
44
|
+
});
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
29
48
|
|
|
30
49
|
//# sourceMappingURL=plugin-site-starters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-site-starters.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 type {\n SiteStarterChoice,\n SiteStarterFacets,\n SiteStarterPayload,\n} from '../app-utils/site-starter'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginService,\n} from './plugin-services'\n\n/**\n * Where site starters come from, as the console's SERVER reads them\n * (AGL-4049).\n *\n * \"Create site\" offers a starter for every site, chosen before the site\n * exists, and the site is created from the one picked. The starters are\n * listings a plugin keeps — searched, priced and bought there — so the core\n * names the two questions the create path asks and one plugin answers them:\n * which starters match a search, and what a picked one creates. With none\n * registered there are no starters to offer, and the create path keeps its\n * own default site.\n */\n\n/** One starter as a search lists it. */\nexport interface SiteStarterSummary {\n listingId: string\n displayName: string\n description: string\n /** Who made it, as the search shows them. */\n authorName: string\n /** Published by the platform itself; listed first. */\n official: boolean\n /** The price in US dollars; 0 for free. */\n priceUsd: number\n previewImageUrl: string | null\n facets: SiteStarterFacets\n}\n\n/** Who is asking: the workspace the site will belong to, and the person. */\nexport interface SiteStarterViewer {\n orgId: string | null\n uid: string\n}\n\nexport interface PluginSiteStarterSource {\n /** The starters matching a search, best first, at most `limit` of them. */\n search(\n input: { word: string; filter: Partial<SiteStarterFacets>; limit: number },\n viewer: SiteStarterViewer,\n ): Promise<SiteStarterSummary[]>\n /**\n * What a picked starter creates, or why this viewer cannot have it: 402\n * while a priced starter is unpaid (with its price), 403 when the viewer may\n * not install it, 404 when it is gone.\n */\n resolve(\n choice: SiteStarterChoice,\n viewer: SiteStarterViewer,\n ): Promise<SiteStarterPayload | { error: string; status: 402 | 403 | 404; priceUsd?: number }>\n /**\n * Records that a site was created from a starter; best-effort, never throws.\n * Optional, so a source that does not count installs still satisfies the seam.\n */\n installed?(choice: SiteStarterChoice, viewer: SiteStarterViewer, site: { hostId: string }): Promise<void>\n}\n\nexport const PLUGIN_SITE_STARTERS = definePluginServiceContract<PluginSiteStarterSource>(\n 'core.site-starters',\n { multiple: false },\n)\n\n/** Registers the plugin that serves site starters. One per deployment; a second is refused. */\nexport function registerPluginSiteStarterSource(\n impl: PluginSiteStarterSource,\n options: { pluginId: string },\n): void {\n registerPluginService(PLUGIN_SITE_STARTERS, impl, { pluginId: options.pluginId })\n}\n\n/** The registered starter source, or `null` when no plugin serves starters. */\nexport function resolveSiteStarterSource(): PluginSiteStarterSource | null {\n return resolvePluginService(PLUGIN_SITE_STARTERS) ?? null\n}\n"],"names":["definePluginServiceContract","registerPluginService","resolvePluginService","PLUGIN_SITE_STARTERS","multiple","registerPluginSiteStarterSource","impl","options","pluginId","resolveSiteStarterSource"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAOD,SACEA,2BAA2B,EAC3BC,qBAAqB,EACrBC,oBAAoB,QACf,uBAAmB;
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-site-starters.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 type {\n SiteStarterChoice,\n SiteStarterFacets,\n SiteStarterPayload,\n} from '../app-utils/site-starter'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginService,\n} from './plugin-services'\n\n/**\n * Where site starters come from, as the console's SERVER reads them\n * (AGL-4049).\n *\n * \"Create site\" offers a starter for every site, chosen before the site\n * exists, and the site is created from the one picked. The starters are\n * listings a plugin keeps — searched, priced and bought there — so the core\n * names the two questions the create path asks and one plugin answers them:\n * which starters match a search, and what a picked one creates. With none\n * registered there are no starters to offer, and the create path keeps its\n * own default site.\n */\n\n/** One starter as a search lists it. */\nexport interface SiteStarterSummary {\n listingId: string\n displayName: string\n description: string\n /** Who made it, as the search shows them. */\n authorName: string\n /** Published by the platform itself; listed first. */\n official: boolean\n /** The price in US dollars; 0 for free. */\n priceUsd: number\n previewImageUrl: string | null\n facets: SiteStarterFacets\n /**\n * What kind of site it is, in words a card shows (\"Restaurant & café\"), or\n * `null` where it names none. Optional: a source with no such words still\n * satisfies the seam, and `facets.kind` stays the id a search filters on.\n */\n category?: string | null\n /**\n * The asking workspace may create from it without paying (AGL-4049):\n * bought already, or its own. Read for the person who asked, so it is set\n * only by an answer that knows who that is, and absent where it does not\n * say; a free starter needs no purchase either way.\n */\n owned?: boolean\n}\n\n/** Who is asking: the workspace the site will belong to, and the person. */\nexport interface SiteStarterViewer {\n orgId: string | null\n uid: string\n}\n\nexport interface PluginSiteStarterSource {\n /** The starters matching a search, best first, at most `limit` of them. */\n search(\n input: { word: string; filter: Partial<SiteStarterFacets>; limit: number },\n viewer: SiteStarterViewer,\n ): Promise<SiteStarterSummary[]>\n /**\n * What a picked starter creates, or why this viewer cannot have it: 402\n * while a priced starter is unpaid (with its price), 403 when the viewer may\n * not install it, 404 when it is gone.\n */\n resolve(\n choice: SiteStarterChoice,\n viewer: SiteStarterViewer,\n ): Promise<SiteStarterPayload | { error: string; status: 402 | 403 | 404; priceUsd?: number }>\n /**\n * Records that a site was created from a starter; best-effort, never throws.\n * Optional, so a source that does not count installs still satisfies the seam.\n */\n installed?(choice: SiteStarterChoice, viewer: SiteStarterViewer, site: { hostId: string }): Promise<void>\n /**\n * One starter as a search would list it for this viewer, or `null` when it\n * is not one they may see (AGL-4049): what the create path records a site\n * was started from, and the name it files the starter's theme under, and\n * what \"Choose your starter\" shows for a pick it restores. Best-effort.\n * Optional, so a source that cannot describe a single listing still\n * satisfies the seam; read it through {@link describeSiteStarter}.\n */\n describe?(choice: SiteStarterChoice, viewer: SiteStarterViewer): Promise<SiteStarterSummary | null>\n}\n\nexport const PLUGIN_SITE_STARTERS = definePluginServiceContract<PluginSiteStarterSource>(\n 'core.site-starters',\n { multiple: false },\n)\n\n/** Registers the plugin that serves site starters. One per deployment; a second is refused. */\nexport function registerPluginSiteStarterSource(\n impl: PluginSiteStarterSource,\n options: { pluginId: string },\n): void {\n registerPluginService(PLUGIN_SITE_STARTERS, impl, { pluginId: options.pluginId })\n}\n\n/** The registered starter source, or `null` when no plugin serves starters. */\nexport function resolveSiteStarterSource(): PluginSiteStarterSource | null {\n return resolvePluginService(PLUGIN_SITE_STARTERS) ?? null\n}\n\n/**\n * A starter as the source describes it, or `null` when the source cannot say\n * (AGL-4049): no `describe`, a listing the viewer may not see, or a source\n * that failed. Never throws, because nothing it answers is required: the\n * create path falls back to the payload's own facts, and the picker to the\n * search.\n */\nexport async function describeSiteStarter(\n source: PluginSiteStarterSource | null,\n choice: SiteStarterChoice,\n viewer: SiteStarterViewer,\n): Promise<SiteStarterSummary | null> {\n if (!source?.describe || !choice?.listingId) return null\n try {\n const summary = await source.describe(choice, viewer)\n return summary && typeof summary === 'object' && summary.listingId === choice.listingId ? summary : null\n } catch (error) {\n console.error('[site-starters] describe failed', { listingId: choice.listingId, error })\n return null\n }\n}\n"],"names":["definePluginServiceContract","registerPluginService","resolvePluginService","PLUGIN_SITE_STARTERS","multiple","registerPluginSiteStarterSource","impl","options","pluginId","resolveSiteStarterSource","describeSiteStarter","source","choice","viewer","describe","listingId","summary","error","console"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAOD,SACEA,2BAA2B,EAC3BC,qBAAqB,EACrBC,oBAAoB,QACf,uBAAmB;AAgF1B,OAAO,MAAMC,uBAAuBH,4BAClC,sBACA;IAAEI,UAAU;AAAM,GACnB;AAED,6FAA6F,GAC7F,OAAO,SAASC,gCACdC,IAA6B,EAC7BC,OAA6B;IAE7BN,sBAAsBE,sBAAsBG,MAAM;QAAEE,UAAUD,QAAQC,QAAQ;IAAC;AACjF;AAEA,6EAA6E,GAC7E,OAAO,SAASC;QACPP;IAAP,QAAOA,wBAAAA,qBAAqBC,iCAArBD,wBAA8C;AACvD;AAEA;;;;;;CAMC,GACD,OAAO,eAAeQ,oBACpBC,MAAsC,EACtCC,MAAyB,EACzBC,MAAyB;IAEzB,IAAI,EAACF,0BAAAA,OAAQG,QAAQ,KAAI,EAACF,0BAAAA,OAAQG,SAAS,GAAE,OAAO;IACpD,IAAI;QACF,MAAMC,UAAU,MAAML,OAAOG,QAAQ,CAACF,QAAQC;QAC9C,OAAOG,WAAW,OAAOA,YAAY,YAAYA,QAAQD,SAAS,KAAKH,OAAOG,SAAS,GAAGC,UAAU;IACtG,EAAE,OAAOC,OAAO;QACdC,QAAQD,KAAK,CAAC,mCAAmC;YAAEF,WAAWH,OAAOG,SAAS;YAAEE;QAAM;QACtF,OAAO;IACT;AACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
import type { SiteStarterTheme } from '../app-utils/site-starter';
|
|
18
|
+
/**
|
|
19
|
+
* The look each site style gives a new site, as the console's SERVER reads it
|
|
20
|
+
* (AGL-4049).
|
|
21
|
+
*
|
|
22
|
+
* A site is created only once a person has chosen a style
|
|
23
|
+
* (`app-utils/site-styles.ts`). The core keeps the list of styles; what each
|
|
24
|
+
* one LOOKS like — a built-in theme, a brand color, a font pairing — is the
|
|
25
|
+
* AI plugin's, which designed the 21 looks. So the core names the one
|
|
26
|
+
* question the create asks and one plugin answers it. With none registered,
|
|
27
|
+
* a site still starts in the default theme, and its style is still recorded.
|
|
28
|
+
*/
|
|
29
|
+
/** A built-in theme with a brand and fonts over it: the shape a style's look takes. */
|
|
30
|
+
export type SiteStyleLook = Extract<SiteStarterTheme, {
|
|
31
|
+
kind: 'builtin';
|
|
32
|
+
}>;
|
|
33
|
+
export interface PluginSiteStyleLookSource {
|
|
34
|
+
/** The look a style starts a site in, or `null` for a style this source has none for. */
|
|
35
|
+
look(styleId: string): Promise<SiteStyleLook | null>;
|
|
36
|
+
}
|
|
37
|
+
export declare const PLUGIN_SITE_STYLE_LOOKS: import("./plugin-services").PluginServiceContract<PluginSiteStyleLookSource>;
|
|
38
|
+
/** Registers the plugin that answers each style's look. One per deployment; a second is refused. */
|
|
39
|
+
export declare function registerPluginSiteStyleLooks(impl: PluginSiteStyleLookSource, options: {
|
|
40
|
+
pluginId: string;
|
|
41
|
+
}): void;
|
|
42
|
+
/** The registered look source, or `null` when no plugin answers. */
|
|
43
|
+
export declare function resolveSiteStyleLooks(): PluginSiteStyleLookSource | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { definePluginServiceContract, registerPluginService, resolvePluginService } from "./plugin-services.js";
|
|
17
|
+
export const PLUGIN_SITE_STYLE_LOOKS = definePluginServiceContract('core.site-style-looks', {
|
|
18
|
+
multiple: false
|
|
19
|
+
});
|
|
20
|
+
/** Registers the plugin that answers each style's look. One per deployment; a second is refused. */ export function registerPluginSiteStyleLooks(impl, options) {
|
|
21
|
+
registerPluginService(PLUGIN_SITE_STYLE_LOOKS, impl, {
|
|
22
|
+
pluginId: options.pluginId
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** The registered look source, or `null` when no plugin answers. */ export function resolveSiteStyleLooks() {
|
|
26
|
+
var _resolvePluginService;
|
|
27
|
+
return (_resolvePluginService = resolvePluginService(PLUGIN_SITE_STYLE_LOOKS)) != null ? _resolvePluginService : null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=plugin-site-style-looks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-site-style-looks.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 type { SiteStarterTheme } from '../app-utils/site-starter'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginService,\n} from './plugin-services'\n\n/**\n * The look each site style gives a new site, as the console's SERVER reads it\n * (AGL-4049).\n *\n * A site is created only once a person has chosen a style\n * (`app-utils/site-styles.ts`). The core keeps the list of styles; what each\n * one LOOKS like — a built-in theme, a brand color, a font pairing — is the\n * AI plugin's, which designed the 21 looks. So the core names the one\n * question the create asks and one plugin answers it. With none registered,\n * a site still starts in the default theme, and its style is still recorded.\n */\n\n/** A built-in theme with a brand and fonts over it: the shape a style's look takes. */\nexport type SiteStyleLook = Extract<SiteStarterTheme, { kind: 'builtin' }>\n\nexport interface PluginSiteStyleLookSource {\n /** The look a style starts a site in, or `null` for a style this source has none for. */\n look(styleId: string): Promise<SiteStyleLook | null>\n}\n\nexport const PLUGIN_SITE_STYLE_LOOKS = definePluginServiceContract<PluginSiteStyleLookSource>(\n 'core.site-style-looks',\n { multiple: false },\n)\n\n/** Registers the plugin that answers each style's look. One per deployment; a second is refused. */\nexport function registerPluginSiteStyleLooks(\n impl: PluginSiteStyleLookSource,\n options: { pluginId: string },\n): void {\n registerPluginService(PLUGIN_SITE_STYLE_LOOKS, impl, { pluginId: options.pluginId })\n}\n\n/** The registered look source, or `null` when no plugin answers. */\nexport function resolveSiteStyleLooks(): PluginSiteStyleLookSource | null {\n return resolvePluginService(PLUGIN_SITE_STYLE_LOOKS) ?? null\n}\n"],"names":["definePluginServiceContract","registerPluginService","resolvePluginService","PLUGIN_SITE_STYLE_LOOKS","multiple","registerPluginSiteStyleLooks","impl","options","pluginId","resolveSiteStyleLooks"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SACEA,2BAA2B,EAC3BC,qBAAqB,EACrBC,oBAAoB,QACf,uBAAmB;AAsB1B,OAAO,MAAMC,0BAA0BH,4BACrC,yBACA;IAAEI,UAAU;AAAM,GACnB;AAED,kGAAkG,GAClG,OAAO,SAASC,6BACdC,IAA+B,EAC/BC,OAA6B;IAE7BN,sBAAsBE,yBAAyBG,MAAM;QAAEE,UAAUD,QAAQC,QAAQ;IAAC;AACpF;AAEA,kEAAkE,GAClE,OAAO,SAASC;QACPP;IAAP,QAAOA,wBAAAA,qBAAqBC,oCAArBD,wBAAiD;AAC1D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
* WHETHER A MEMBER'S FILE FITS THE WORKSPACE'S STORAGE (AGL-4096).
|
|
19
|
+
*
|
|
20
|
+
* A file a member attaches outside the media library (a quote's proof) is
|
|
21
|
+
* kept by the shared upload pipeline (`@aglyn/tenant-data-admin/server/visitor-upload`)
|
|
22
|
+
* and counted toward the workspace's storage like a library file. Before it
|
|
23
|
+
* is taken it meets the same storage band a library upload does: refused on
|
|
24
|
+
* a plan that does not bill storage past its allowance, taken and billed on
|
|
25
|
+
* one that does, refused past a storage cap the workspace set.
|
|
26
|
+
*
|
|
27
|
+
* The band and its rules live with the app that holds the media ingress, so
|
|
28
|
+
* this is a contract: the console registers the one implementation at boot
|
|
29
|
+
* (`instrumentation.ts`), the same direction as `core.media-ingest`.
|
|
30
|
+
*
|
|
31
|
+
* Only a MEMBER's file is asked about. A file a site's visitor sends (a
|
|
32
|
+
* customer's artwork on a quote, a form's file) is never refused for the
|
|
33
|
+
* business's storage; it is counted all the same. A process that registered
|
|
34
|
+
* nothing (the site app) answers `null` from {@link uploadStorageGate}, and
|
|
35
|
+
* the file is taken.
|
|
36
|
+
*/
|
|
37
|
+
export interface UploadStorageGateInput {
|
|
38
|
+
/** The site the file is kept on; its workspace's storage is the one asked. */
|
|
39
|
+
hostId: string;
|
|
40
|
+
/** The file's size in bytes. */
|
|
41
|
+
bytes: number;
|
|
42
|
+
}
|
|
43
|
+
/** Why the file does not fit, as the member is told. */
|
|
44
|
+
export interface UploadStorageRefusal {
|
|
45
|
+
status: number;
|
|
46
|
+
error: string;
|
|
47
|
+
/** The storage gate's machine code, as the media library's upload routes answer it. */
|
|
48
|
+
code: string;
|
|
49
|
+
}
|
|
50
|
+
export interface UploadStorageGate {
|
|
51
|
+
/** `null` when the file may be kept; otherwise why it may not. */
|
|
52
|
+
check(input: UploadStorageGateInput): Promise<UploadStorageRefusal | null>;
|
|
53
|
+
}
|
|
54
|
+
/** One implementation: the app that holds the storage band. */
|
|
55
|
+
export declare const UPLOAD_STORAGE_GATE: import("./plugin-services").PluginServiceContract<UploadStorageGate>;
|
|
56
|
+
export declare function registerUploadStorageGate(gate: UploadStorageGate, options?: {
|
|
57
|
+
pluginId?: string;
|
|
58
|
+
}): void;
|
|
59
|
+
/** The registered gate, or `null` in a process that registered none. */
|
|
60
|
+
export declare function uploadStorageGate(): UploadStorageGate | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { definePluginServiceContract, registerPluginService, resolvePluginService } from "./plugin-services.js";
|
|
18
|
+
/** One implementation: the app that holds the storage band. */ export const UPLOAD_STORAGE_GATE = definePluginServiceContract('core.upload-storage-gate', {
|
|
19
|
+
multiple: false
|
|
20
|
+
});
|
|
21
|
+
export function registerUploadStorageGate(gate, options) {
|
|
22
|
+
if (typeof (gate == null ? void 0 : gate.check) !== 'function') throw new Error('an upload storage gate needs check');
|
|
23
|
+
registerPluginService(UPLOAD_STORAGE_GATE, gate, _extends({}, (options == null ? void 0 : options.pluginId) ? {
|
|
24
|
+
pluginId: options.pluginId
|
|
25
|
+
} : {}));
|
|
26
|
+
}
|
|
27
|
+
/** The registered gate, or `null` in a process that registered none. */ export function uploadStorageGate() {
|
|
28
|
+
var _resolvePluginService;
|
|
29
|
+
return (_resolvePluginService = resolvePluginService(UPLOAD_STORAGE_GATE)) != null ? _resolvePluginService : null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=plugin-upload-storage-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-upload-storage-gate.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 {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginService,\n} from './plugin-services'\n\n/**\n * WHETHER A MEMBER'S FILE FITS THE WORKSPACE'S STORAGE (AGL-4096).\n *\n * A file a member attaches outside the media library (a quote's proof) is\n * kept by the shared upload pipeline (`@aglyn/tenant-data-admin/server/visitor-upload`)\n * and counted toward the workspace's storage like a library file. Before it\n * is taken it meets the same storage band a library upload does: refused on\n * a plan that does not bill storage past its allowance, taken and billed on\n * one that does, refused past a storage cap the workspace set.\n *\n * The band and its rules live with the app that holds the media ingress, so\n * this is a contract: the console registers the one implementation at boot\n * (`instrumentation.ts`), the same direction as `core.media-ingest`.\n *\n * Only a MEMBER's file is asked about. A file a site's visitor sends (a\n * customer's artwork on a quote, a form's file) is never refused for the\n * business's storage; it is counted all the same. A process that registered\n * nothing (the site app) answers `null` from {@link uploadStorageGate}, and\n * the file is taken.\n */\n\nexport interface UploadStorageGateInput {\n /** The site the file is kept on; its workspace's storage is the one asked. */\n hostId: string\n /** The file's size in bytes. */\n bytes: number\n}\n\n/** Why the file does not fit, as the member is told. */\nexport interface UploadStorageRefusal {\n status: number\n error: string\n /** The storage gate's machine code, as the media library's upload routes answer it. */\n code: string\n}\n\nexport interface UploadStorageGate {\n /** `null` when the file may be kept; otherwise why it may not. */\n check(input: UploadStorageGateInput): Promise<UploadStorageRefusal | null>\n}\n\n/** One implementation: the app that holds the storage band. */\nexport const UPLOAD_STORAGE_GATE = definePluginServiceContract<UploadStorageGate>(\n 'core.upload-storage-gate',\n { multiple: false },\n)\n\nexport function registerUploadStorageGate(\n gate: UploadStorageGate,\n options?: { pluginId?: string },\n): void {\n if (typeof gate?.check !== 'function') throw new Error('an upload storage gate needs check')\n registerPluginService(UPLOAD_STORAGE_GATE, gate, {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n })\n}\n\n/** The registered gate, or `null` in a process that registered none. */\nexport function uploadStorageGate(): UploadStorageGate | null {\n return resolvePluginService(UPLOAD_STORAGE_GATE) ?? null\n}\n"],"names":["definePluginServiceContract","registerPluginService","resolvePluginService","UPLOAD_STORAGE_GATE","multiple","registerUploadStorageGate","gate","options","check","Error","pluginId","uploadStorageGate"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,2BAA2B,EAC3BC,qBAAqB,EACrBC,oBAAoB,QACf,uBAAmB;AA2C1B,6DAA6D,GAC7D,OAAO,MAAMC,sBAAsBH,4BACjC,4BACA;IAAEI,UAAU;AAAM,GACnB;AAED,OAAO,SAASC,0BACdC,IAAuB,EACvBC,OAA+B;IAE/B,IAAI,QAAOD,wBAAAA,KAAME,KAAK,MAAK,YAAY,MAAM,IAAIC,MAAM;IACvDR,sBAAsBE,qBAAqBG,MAAM,aAC3CC,CAAAA,2BAAAA,QAASG,QAAQ,IAAG;QAAEA,UAAUH,QAAQG,QAAQ;IAAC,IAAI,CAAC;AAE9D;AAEA,sEAAsE,GACtE,OAAO,SAASC;QACPT;IAAP,QAAOA,wBAAAA,qBAAqBC,gCAArBD,wBAA6C;AACtD"}
|