@aglyn/plugins-marketplace 1.0.0-beta.285 → 1.0.0-beta.288
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 +14 -14
- package/src/lib/declarations.d.ts +26 -0
- package/src/lib/declarations.js +37 -0
- package/src/lib/declarations.js.map +1 -0
- package/src/lib/declarations.server.d.ts +2 -1
- package/src/lib/declarations.server.js +18 -1
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/model/marketplace-site-permissions.d.ts +26 -0
- package/src/lib/model/marketplace-site-permissions.js +62 -0
- package/src/lib/model/marketplace-site-permissions.js.map +1 -0
- package/src/lib/model/marketplace.d.ts +24 -0
- package/src/lib/model/marketplace.js.map +1 -1
- package/src/lib/model/site-starter-listing.d.ts +49 -0
- package/src/lib/model/site-starter-listing.js +75 -0
- package/src/lib/model/site-starter-listing.js.map +1 -0
- package/src/lib/server/install-email-starter.js +7 -4
- package/src/lib/server/install-email-starter.js.map +1 -1
- package/src/lib/server/install-email-template.js +8 -5
- package/src/lib/server/install-email-template.js.map +1 -1
- package/src/lib/server/install-layout.js +7 -4
- package/src/lib/server/install-layout.js.map +1 -1
- package/src/lib/server/install-plugin.js +8 -8
- package/src/lib/server/install-plugin.js.map +1 -1
- package/src/lib/server/install-template.js +7 -4
- package/src/lib/server/install-template.js.map +1 -1
- package/src/lib/server/install-theme.js +10 -7
- package/src/lib/server/install-theme.js.map +1 -1
- package/src/lib/server/install.js +7 -4
- package/src/lib/server/install.js.map +1 -1
- package/src/lib/server/publish-email-starter.js +8 -5
- package/src/lib/server/publish-email-starter.js.map +1 -1
- package/src/lib/server/publish-email-template.js +8 -5
- package/src/lib/server/publish-email-template.js.map +1 -1
- package/src/lib/server/publish-layout.js +8 -5
- package/src/lib/server/publish-layout.js.map +1 -1
- package/src/lib/server/publish-starter.d.ts +37 -0
- package/src/lib/server/publish-starter.js +501 -0
- package/src/lib/server/publish-starter.js.map +1 -0
- package/src/lib/server/publish-template.js +9 -6
- package/src/lib/server/publish-template.js.map +1 -1
- package/src/lib/server/publish-theme.js +8 -5
- package/src/lib/server/publish-theme.js.map +1 -1
- package/src/lib/server/publish.js +8 -5
- package/src/lib/server/publish.js.map +1 -1
- package/src/lib/server/site-starter-source.d.ts +19 -0
- package/src/lib/server/site-starter-source.js +189 -0
- package/src/lib/server/site-starter-source.js.map +1 -0
- package/src/lib/server.js +3 -0
- package/src/lib/server.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-marketplace",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.288",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-ui-next": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
35
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
36
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
37
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
38
|
-
"@aglyn/tenant-data-admin": "1.0.0-beta.
|
|
39
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
40
|
-
"@aglyn/tenant-runtime": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.288",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.288",
|
|
30
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.288",
|
|
31
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.288",
|
|
32
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.288",
|
|
33
|
+
"@aglyn/shared-ui-next": "1.0.0-beta.288",
|
|
34
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.288",
|
|
35
|
+
"@aglyn/shared-util-email": "1.0.0-beta.288",
|
|
36
|
+
"@aglyn/shared-util-http": "1.0.0-beta.288",
|
|
37
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.288",
|
|
38
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.288",
|
|
39
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.288",
|
|
40
|
+
"@aglyn/tenant-runtime": "1.0.0-beta.288",
|
|
41
41
|
"@swc/helpers": "0.5.23"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
* The plugin's DECLARATIONS (AGL-4047): installing into a site and publishing
|
|
19
|
+
* from one, which the one permission catalog lists beside the core keys.
|
|
20
|
+
* Loaded eagerly by the console (client and server) and the tenant's server
|
|
21
|
+
* through the generated declarations manifest, so the role editor offers
|
|
22
|
+
* them, a custom role or a per-member override keeps them, and the site's
|
|
23
|
+
* stamp carries them. Light by construction: nothing here reaches a
|
|
24
|
+
* provider, Firestore or React.
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerMarketplaceDeclarations(): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { registerPluginEntitlements } from "@aglyn/aglyn/plugin-manager/plugin-entitlements";
|
|
17
|
+
import { MARKETPLACE_SITE_PERMISSIONS } from "./model/marketplace-site-permissions.js";
|
|
18
|
+
let declared = false;
|
|
19
|
+
/**
|
|
20
|
+
* The plugin's DECLARATIONS (AGL-4047): installing into a site and publishing
|
|
21
|
+
* from one, which the one permission catalog lists beside the core keys.
|
|
22
|
+
* Loaded eagerly by the console (client and server) and the tenant's server
|
|
23
|
+
* through the generated declarations manifest, so the role editor offers
|
|
24
|
+
* them, a custom role or a per-member override keeps them, and the site's
|
|
25
|
+
* stamp carries them. Light by construction: nothing here reaches a
|
|
26
|
+
* provider, Firestore or React.
|
|
27
|
+
*/ export function registerMarketplaceDeclarations() {
|
|
28
|
+
if (declared) return;
|
|
29
|
+
declared = true;
|
|
30
|
+
registerPluginEntitlements({
|
|
31
|
+
pluginId: 'marketplace',
|
|
32
|
+
orgPermissions: MARKETPLACE_SITE_PERMISSIONS
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
registerMarketplaceDeclarations();
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/marketplace/src/lib/declarations.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 { registerPluginEntitlements } from '@aglyn/aglyn/plugin-manager/plugin-entitlements'\nimport { MARKETPLACE_SITE_PERMISSIONS } from './model/marketplace-site-permissions'\n\nlet declared = false\n\n/**\n * The plugin's DECLARATIONS (AGL-4047): installing into a site and publishing\n * from one, which the one permission catalog lists beside the core keys.\n * Loaded eagerly by the console (client and server) and the tenant's server\n * through the generated declarations manifest, so the role editor offers\n * them, a custom role or a per-member override keeps them, and the site's\n * stamp carries them. Light by construction: nothing here reaches a\n * provider, Firestore or React.\n */\nexport function registerMarketplaceDeclarations(): void {\n if (declared) return\n declared = true\n registerPluginEntitlements({ pluginId: 'marketplace', orgPermissions: MARKETPLACE_SITE_PERMISSIONS })\n}\n\nregisterMarketplaceDeclarations()\n"],"names":["registerPluginEntitlements","MARKETPLACE_SITE_PERMISSIONS","declared","registerMarketplaceDeclarations","pluginId","orgPermissions"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,0BAA0B,QAAQ,kDAAiD;AAC5F,SAASC,4BAA4B,QAAQ,0CAAsC;AAEnF,IAAIC,WAAW;AAEf;;;;;;;;CAQC,GACD,OAAO,SAASC;IACd,IAAID,UAAU;IACdA,WAAW;IACXF,2BAA2B;QAAEI,UAAU;QAAeC,gBAAgBJ;IAA6B;AACrG;AAEAE"}
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* reads at boot, before any surface loads.
|
|
20
20
|
*
|
|
21
21
|
* The `rating` field type's validator (AGL-434), the marketplace's share of
|
|
22
|
-
* a workspace erasure,
|
|
22
|
+
* a workspace erasure, its kill switch as another plugin reads it, and the
|
|
23
|
+
* site starters "Create site" offers (AGL-4049).
|
|
23
24
|
*
|
|
24
25
|
* The validator: A dataset field of this type
|
|
25
26
|
* can be written by a path that never loads the marketplace — a visitor's
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { registerCustomFieldType } from "@aglyn/aglyn/plugin-manager/custom-fields";
|
|
19
19
|
import { listPluginOrgErasers, registerPluginOrgEraser } from "@aglyn/aglyn/plugin-manager/plugin-org-erasure";
|
|
20
20
|
import { registerPluginRevocationReader } from "@aglyn/aglyn/plugin-manager/plugin-revocations";
|
|
21
|
+
import { registerPluginSiteStarterSource } from "@aglyn/aglyn/plugin-manager/plugin-site-starters";
|
|
21
22
|
import { BUNDLE_ID } from "./constants/bundle-common.js";
|
|
22
23
|
import { RATING_FIELD } from "./model/rating-field.js";
|
|
23
24
|
/**
|
|
@@ -25,7 +26,8 @@ import { RATING_FIELD } from "./model/rating-field.js";
|
|
|
25
26
|
* reads at boot, before any surface loads.
|
|
26
27
|
*
|
|
27
28
|
* The `rating` field type's validator (AGL-434), the marketplace's share of
|
|
28
|
-
* a workspace erasure,
|
|
29
|
+
* a workspace erasure, its kill switch as another plugin reads it, and the
|
|
30
|
+
* site starters "Create site" offers (AGL-4049).
|
|
29
31
|
*
|
|
30
32
|
* The validator: A dataset field of this type
|
|
31
33
|
* can be written by a path that never loads the marketplace — a visitor's
|
|
@@ -61,6 +63,21 @@ import { RATING_FIELD } from "./model/rating-field.js";
|
|
|
61
63
|
}, {
|
|
62
64
|
pluginId: BUNDLE_ID
|
|
63
65
|
});
|
|
66
|
+
/*
|
|
67
|
+
* Site starters (AGL-4049): "Create site" searches the marketplace's
|
|
68
|
+
* `siteStarter` listings and creates a site from the one picked, through
|
|
69
|
+
* core's `core.site-starters` seam. Registering reads nothing; the Admin SDK
|
|
70
|
+
* arrives with the first search, not with the boot. The same plugin
|
|
71
|
+
* registering again replaces itself, so a re-run of these declarations is
|
|
72
|
+
* safe.
|
|
73
|
+
*/ const starters = ()=>import("./server/site-starter-source.js").then((m)=>m.marketplaceSiteStarterSource);
|
|
74
|
+
registerPluginSiteStarterSource({
|
|
75
|
+
search: async (input, viewer)=>(await starters()).search(input, viewer),
|
|
76
|
+
resolve: async (choice, viewer)=>(await starters()).resolve(choice, viewer),
|
|
77
|
+
installed: async (choice, viewer, site)=>(await starters()).installed(choice, viewer, site)
|
|
78
|
+
}, {
|
|
79
|
+
pluginId: BUNDLE_ID
|
|
80
|
+
});
|
|
64
81
|
}
|
|
65
82
|
|
|
66
83
|
//# sourceMappingURL=declarations.server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/plugins/marketplace/src/lib/declarations.server.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// The registry from its own module, not the plugin-manager barrel: boot needs\n// the registry and nothing else.\nimport { registerCustomFieldType } from '@aglyn/aglyn/plugin-manager/custom-fields'\nimport {\n listPluginOrgErasers,\n registerPluginOrgEraser,\n} from '@aglyn/aglyn/plugin-manager/plugin-org-erasure'\nimport { registerPluginRevocationReader } from '@aglyn/aglyn/plugin-manager/plugin-revocations'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { RATING_FIELD } from './model/rating-field'\n\n/**\n * The marketplace plugin's server declarations: the light registrations core\n * reads at boot, before any surface loads.\n *\n * The `rating` field type's validator (AGL-434), the marketplace's share of\n * a workspace erasure,
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/marketplace/src/lib/declarations.server.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// The registry from its own module, not the plugin-manager barrel: boot needs\n// the registry and nothing else.\nimport { registerCustomFieldType } from '@aglyn/aglyn/plugin-manager/custom-fields'\nimport {\n listPluginOrgErasers,\n registerPluginOrgEraser,\n} from '@aglyn/aglyn/plugin-manager/plugin-org-erasure'\nimport { registerPluginRevocationReader } from '@aglyn/aglyn/plugin-manager/plugin-revocations'\nimport { registerPluginSiteStarterSource } from '@aglyn/aglyn/plugin-manager/plugin-site-starters'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { RATING_FIELD } from './model/rating-field'\n\n/**\n * The marketplace plugin's server declarations: the light registrations core\n * reads at boot, before any surface loads.\n *\n * The `rating` field type's validator (AGL-434), the marketplace's share of\n * a workspace erasure, its kill switch as another plugin reads it, and the\n * site starters \"Create site\" offers (AGL-4049).\n *\n * The validator: A dataset field of this type\n * can be written by a path that never loads the marketplace — a visitor's\n * form submission and an automation step, both in the tenant (AGL-2773) — so\n * the validator registers from here, which every app runs at boot, rather\n * than only from the console API surface. Pure data: no React, no Admin SDK.\n */\nexport function registerMarketplaceServerDeclarations(): void {\n registerCustomFieldType(RATING_FIELD)\n /*\n * The organization's public marketplace identity, erased with it (AGL-1970).\n * Declared REQUIRED in `plugins.config.json`: the profile carries a payout\n * identifier on a world-readable document, so an erasure refuses to run\n * without this eraser rather than report a workspace erased with it\n * standing. From here, which every app and the erasure script run at boot;\n * the Admin SDK arrives with the first erasure, not with the boot.\n */\n if (!listPluginOrgErasers().includes(BUNDLE_ID)) {\n registerPluginOrgEraser(\n async (request) => {\n const { createPublisherIdentityEraser } = await import('./server/publisher-erasure')\n return createPublisherIdentityEraser()(request)\n },\n { pluginId: BUNDLE_ID },\n )\n }\n /*\n * The kill switch (`plugin-revocations`, AGL-3080): the send path asks it\n * before mailing a design installed from a listing, in whichever process\n * sends. The Admin SDK arrives with the first read.\n */\n registerPluginRevocationReader(\n {\n async revocation(listingId) {\n const { marketplaceRevocationReader } = await import('./server/revocation-reader')\n return marketplaceRevocationReader.revocation(listingId)\n },\n },\n { pluginId: BUNDLE_ID },\n )\n /*\n * Site starters (AGL-4049): \"Create site\" searches the marketplace's\n * `siteStarter` listings and creates a site from the one picked, through\n * core's `core.site-starters` seam. Registering reads nothing; the Admin SDK\n * arrives with the first search, not with the boot. The same plugin\n * registering again replaces itself, so a re-run of these declarations is\n * safe.\n */\n const starters = () => import('./server/site-starter-source').then((m) => m.marketplaceSiteStarterSource)\n registerPluginSiteStarterSource(\n {\n search: async (input, viewer) => (await starters()).search(input, viewer),\n resolve: async (choice, viewer) => (await starters()).resolve(choice, viewer),\n installed: async (choice, viewer, site) => (await starters()).installed(choice, viewer, site),\n },\n { pluginId: BUNDLE_ID },\n )\n}\n"],"names":["registerCustomFieldType","listPluginOrgErasers","registerPluginOrgEraser","registerPluginRevocationReader","registerPluginSiteStarterSource","BUNDLE_ID","RATING_FIELD","registerMarketplaceServerDeclarations","includes","request","createPublisherIdentityEraser","pluginId","revocation","listingId","marketplaceRevocationReader","starters","then","m","marketplaceSiteStarterSource","search","input","viewer","resolve","choice","installed","site"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,8EAA8E;AAC9E,iCAAiC;AACjC,SAASA,uBAAuB,QAAQ,4CAA2C;AACnF,SACEC,oBAAoB,EACpBC,uBAAuB,QAClB,iDAAgD;AACvD,SAASC,8BAA8B,QAAQ,iDAAgD;AAC/F,SAASC,+BAA+B,QAAQ,mDAAkD;AAClG,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,YAAY,QAAQ,0BAAsB;AAEnD;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC;IACdP,wBAAwBM;IACxB;;;;;;;GAOC,GACD,IAAI,CAACL,uBAAuBO,QAAQ,CAACH,YAAY;QAC/CH,wBACE,OAAOO;YACL,MAAM,EAAEC,6BAA6B,EAAE,GAAG,MAAM,MAAM,CAAC;YACvD,OAAOA,gCAAgCD;QACzC,GACA;YAAEE,UAAUN;QAAU;IAE1B;IACA;;;;GAIC,GACDF,+BACE;QACE,MAAMS,YAAWC,SAAS;YACxB,MAAM,EAAEC,2BAA2B,EAAE,GAAG,MAAM,MAAM,CAAC;YACrD,OAAOA,4BAA4BF,UAAU,CAACC;QAChD;IACF,GACA;QAAEF,UAAUN;IAAU;IAExB;;;;;;;GAOC,GACD,MAAMU,WAAW,IAAM,MAAM,CAAC,mCAAgCC,IAAI,CAAC,CAACC,IAAMA,EAAEC,4BAA4B;IACxGd,gCACE;QACEe,QAAQ,OAAOC,OAAOC,SAAW,AAAC,CAAA,MAAMN,UAAS,EAAGI,MAAM,CAACC,OAAOC;QAClEC,SAAS,OAAOC,QAAQF,SAAW,AAAC,CAAA,MAAMN,UAAS,EAAGO,OAAO,CAACC,QAAQF;QACtEG,WAAW,OAAOD,QAAQF,QAAQI,OAAS,AAAC,CAAA,MAAMV,UAAS,EAAGS,SAAS,CAACD,QAAQF,QAAQI;IAC1F,GACA;QAAEd,UAAUN;IAAU;AAE1B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { HostAccessRole } from '@aglyn/aglyn/foundation/definitions/organization.types';
|
|
18
|
+
import type { PluginOrgPermissionDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-entitlements';
|
|
19
|
+
/** The marketplace's keys whose preset is the site role. */
|
|
20
|
+
export type MarketplaceSitePermission = 'marketplace.siteInstall' | 'marketplace.sitePublish';
|
|
21
|
+
/** Who installed into or published from a site before these were keys: the site's Admin and Editor. */
|
|
22
|
+
export declare const MARKETPLACE_SITE_ROLE_PRESET: Readonly<Record<HostAccessRole, boolean>>;
|
|
23
|
+
/** The keys as the plugin declares them into the org permission catalog. */
|
|
24
|
+
export declare const MARKETPLACE_SITE_PERMISSIONS: readonly PluginOrgPermissionDeclaration[];
|
|
25
|
+
/** The refusal a door answers without one: names the permission, never a role. */
|
|
26
|
+
export declare function marketplaceSitePermissionRefusal(key: MarketplaceSitePermission): string;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { _ as _extends } from "@swc/helpers/_/_extends";
|
|
17
|
+
/** Who installed into or published from a site before these were keys: the site's Admin and Editor. */ export const MARKETPLACE_SITE_ROLE_PRESET = {
|
|
18
|
+
admin: true,
|
|
19
|
+
editor: true,
|
|
20
|
+
author: false,
|
|
21
|
+
viewer: false
|
|
22
|
+
};
|
|
23
|
+
/** The keys as the plugin declares them into the org permission catalog. */ export const MARKETPLACE_SITE_PERMISSIONS = [
|
|
24
|
+
{
|
|
25
|
+
key: 'marketplace.siteInstall',
|
|
26
|
+
label: 'Install marketplace items into a site',
|
|
27
|
+
description: 'Install templates, themes, layouts, components, email designs and plugins from the marketplace into a site (with "Install from the marketplace"). Follows the site role unless a role or member sets it.',
|
|
28
|
+
roleDefaults: {
|
|
29
|
+
owner: true,
|
|
30
|
+
admin: true,
|
|
31
|
+
editor: true,
|
|
32
|
+
viewer: false
|
|
33
|
+
},
|
|
34
|
+
hostRoleDefaults: _extends({}, MARKETPLACE_SITE_ROLE_PRESET),
|
|
35
|
+
group: 'marketplace',
|
|
36
|
+
groupLabel: 'Marketplace',
|
|
37
|
+
presetFromSiteRole: true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: 'marketplace.sitePublish',
|
|
41
|
+
label: 'Publish a site’s items to the marketplace',
|
|
42
|
+
description: 'Publish a site’s templates, themes, layouts, components and email designs to the marketplace (with "Publish to the marketplace"). Follows the site role unless a role or member sets it.',
|
|
43
|
+
roleDefaults: {
|
|
44
|
+
owner: true,
|
|
45
|
+
admin: true,
|
|
46
|
+
editor: true,
|
|
47
|
+
viewer: false
|
|
48
|
+
},
|
|
49
|
+
hostRoleDefaults: _extends({}, MARKETPLACE_SITE_ROLE_PRESET),
|
|
50
|
+
group: 'marketplace',
|
|
51
|
+
groupLabel: 'Marketplace',
|
|
52
|
+
presetFromSiteRole: true
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
/** The refusal a door answers without one: names the permission, never a role. */ export function marketplaceSitePermissionRefusal(key) {
|
|
56
|
+
var _ref;
|
|
57
|
+
var _MARKETPLACE_SITE_PERMISSIONS_find;
|
|
58
|
+
const label = (_ref = (_MARKETPLACE_SITE_PERMISSIONS_find = MARKETPLACE_SITE_PERMISSIONS.find((entry)=>entry.key === key)) == null ? void 0 : _MARKETPLACE_SITE_PERMISSIONS_find.label) != null ? _ref : key;
|
|
59
|
+
return `Your role does not include "${label}" — ask an organization admin`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=marketplace-site-permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/marketplace/src/lib/model/marketplace-site-permissions.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 { HostAccessRole } from '@aglyn/aglyn/foundation/definitions/organization.types'\nimport type { PluginOrgPermissionDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-entitlements'\n\n/*\n * THE MARKETPLACE ON A SITE (AGL-4047).\n *\n * Installing a listing into a site (a template, theme, layout, component,\n * email design or plugin) and publishing a site's own to the marketplace\n * asked two things: the workspace's key (`installPlugins`,\n * `publishToMarketplace`), and the member's role ON THE SITE, Admin or\n * Editor. The second is now a key per act whose preset is that site role\n * (`presetFromSiteRole`), so every member keeps exactly the access they had,\n * and a custom role, a member's own permissions or a site's toggle can grant\n * or refuse it. The workspace's key is still asked beside it.\n */\n\n/** The marketplace's keys whose preset is the site role. */\nexport type MarketplaceSitePermission = 'marketplace.siteInstall' | 'marketplace.sitePublish'\n\n/** Who installed into or published from a site before these were keys: the site's Admin and Editor. */\nexport const MARKETPLACE_SITE_ROLE_PRESET: Readonly<Record<HostAccessRole, boolean>> = {\n admin: true,\n editor: true,\n author: false,\n viewer: false,\n}\n\n/** The keys as the plugin declares them into the org permission catalog. */\nexport const MARKETPLACE_SITE_PERMISSIONS: readonly PluginOrgPermissionDeclaration[] = [\n {\n key: 'marketplace.siteInstall',\n label: 'Install marketplace items into a site',\n description:\n 'Install templates, themes, layouts, components, email designs and plugins from the marketplace into a site (with \"Install from the marketplace\"). Follows the site role unless a role or member sets it.',\n roleDefaults: { owner: true, admin: true, editor: true, viewer: false },\n hostRoleDefaults: { ...MARKETPLACE_SITE_ROLE_PRESET },\n group: 'marketplace',\n groupLabel: 'Marketplace',\n presetFromSiteRole: true,\n },\n {\n key: 'marketplace.sitePublish',\n label: 'Publish a site’s items to the marketplace',\n description:\n 'Publish a site’s templates, themes, layouts, components and email designs to the marketplace (with \"Publish to the marketplace\"). Follows the site role unless a role or member sets it.',\n roleDefaults: { owner: true, admin: true, editor: true, viewer: false },\n hostRoleDefaults: { ...MARKETPLACE_SITE_ROLE_PRESET },\n group: 'marketplace',\n groupLabel: 'Marketplace',\n presetFromSiteRole: true,\n },\n]\n\n/** The refusal a door answers without one: names the permission, never a role. */\nexport function marketplaceSitePermissionRefusal(key: MarketplaceSitePermission): string {\n const label = MARKETPLACE_SITE_PERMISSIONS.find((entry) => entry.key === key)?.label ?? key\n return `Your role does not include \"${label}\" — ask an organization admin`\n}\n"],"names":["MARKETPLACE_SITE_ROLE_PRESET","admin","editor","author","viewer","MARKETPLACE_SITE_PERMISSIONS","key","label","description","roleDefaults","owner","hostRoleDefaults","group","groupLabel","presetFromSiteRole","marketplaceSitePermissionRefusal","find","entry"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAqBD,qGAAqG,GACrG,OAAO,MAAMA,+BAA0E;IACrFC,OAAO;IACPC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;AACV,EAAC;AAED,0EAA0E,GAC1E,OAAO,MAAMC,+BAA0E;IACrF;QACEC,KAAK;QACLC,OAAO;QACPC,aACE;QACFC,cAAc;YAAEC,OAAO;YAAMT,OAAO;YAAMC,QAAQ;YAAME,QAAQ;QAAM;QACtEO,kBAAkB,aAAKX;QACvBY,OAAO;QACPC,YAAY;QACZC,oBAAoB;IACtB;IACA;QACER,KAAK;QACLC,OAAO;QACPC,aACE;QACFC,cAAc;YAAEC,OAAO;YAAMT,OAAO;YAAMC,QAAQ;YAAME,QAAQ;QAAM;QACtEO,kBAAkB,aAAKX;QACvBY,OAAO;QACPC,YAAY;QACZC,oBAAoB;IACtB;CACD,CAAA;AAED,gFAAgF,GAChF,OAAO,SAASC,iCAAiCT,GAA8B;;QAC/DD;IAAd,MAAME,iBAAQF,qCAAAA,6BAA6BW,IAAI,CAAC,CAACC,QAAUA,MAAMX,GAAG,KAAKA,yBAA3DD,mCAAiEE,KAAK,mBAAID;IACxF,OAAO,CAAC,4BAA4B,EAAEC,MAAM,6BAA6B,CAAC;AAC5E"}
|
|
@@ -147,6 +147,30 @@ export interface MarketplaceListing {
|
|
|
147
147
|
sourceComponentId?: string;
|
|
148
148
|
/** Source site for a `template` listing. */
|
|
149
149
|
sourceHostId?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Source site for a `siteStarter` listing (AGL-4049): the one-listing-per-
|
|
152
|
+
* source key `publish-starter` looks up. Its own field, never `sourceHostId`:
|
|
153
|
+
* the template, layout and theme doors write that one and key on it with a
|
|
154
|
+
* `limit(1)`, so a shared key would cross a site's starter with its template.
|
|
155
|
+
*/
|
|
156
|
+
sourceStarterHostId?: string;
|
|
157
|
+
/**
|
|
158
|
+
* The platform published it (AGL-4049). Server-owned and ordering only: the
|
|
159
|
+
* starter picker lists these first. No door, price or checkout branches on
|
|
160
|
+
* it; the seed and staff write it, a publish never does.
|
|
161
|
+
*/
|
|
162
|
+
official?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* A site starter's facets (AGL-4049), stamped from its payload by
|
|
165
|
+
* `siteStarterFacetFields` so a starter search can match them. Server-owned:
|
|
166
|
+
* they describe the stored version, so a client rewrite would list a
|
|
167
|
+
* starter under a kind, theme or page count it does not create.
|
|
168
|
+
*/
|
|
169
|
+
starterKind?: string | null;
|
|
170
|
+
starterBase?: string | null;
|
|
171
|
+
starterFonts?: string | null;
|
|
172
|
+
starterPages?: number;
|
|
173
|
+
starterMode?: 'base' | 'ai';
|
|
150
174
|
/** Incremented by the install API; frozen from client writes. */
|
|
151
175
|
installCount?: number;
|
|
152
176
|
/**
|