@aglyn/aglyn 1.0.0-beta.149 → 1.0.0-beta.151

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 (36) hide show
  1. package/package.json +10 -10
  2. package/src/lib/app-utils/console-routes.d.ts +0 -40
  3. package/src/lib/app-utils/console-routes.js +15 -13
  4. package/src/lib/app-utils/console-routes.js.map +1 -1
  5. package/src/lib/app-utils/contexts.d.ts +1 -0
  6. package/src/lib/app-utils/contexts.js +1 -0
  7. package/src/lib/app-utils/contexts.js.map +1 -1
  8. package/src/lib/app-utils/docs-help.generated.d.ts +24 -0
  9. package/src/lib/app-utils/docs-help.generated.js +61 -0
  10. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  11. package/src/lib/app-utils/index.d.ts +1 -0
  12. package/src/lib/app-utils/index.js +1 -0
  13. package/src/lib/app-utils/index.js.map +1 -1
  14. package/src/lib/app-utils/media-src.d.ts +93 -0
  15. package/src/lib/app-utils/media-src.js +114 -0
  16. package/src/lib/app-utils/media-src.js.map +1 -0
  17. package/src/lib/app-utils/page-header-help-context.d.ts +83 -0
  18. package/src/lib/app-utils/page-header-help-context.js +56 -0
  19. package/src/lib/app-utils/page-header-help-context.js.map +1 -0
  20. package/src/lib/app-utils/release-flags.js +5 -4
  21. package/src/lib/app-utils/release-flags.js.map +1 -1
  22. package/src/lib/app-utils/staff-role-gate.d.ts +56 -0
  23. package/src/lib/app-utils/staff-role-gate.js +46 -0
  24. package/src/lib/app-utils/staff-role-gate.js.map +1 -0
  25. package/src/lib/plugin-manager/feature-plugins.d.ts +113 -23
  26. package/src/lib/plugin-manager/feature-plugins.js +15 -19
  27. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  28. package/src/lib/plugin-manager/plugin-media-publish.d.ts +88 -0
  29. package/src/lib/plugin-manager/plugin-media-publish.js +118 -0
  30. package/src/lib/plugin-manager/plugin-media-publish.js.map +1 -0
  31. package/src/lib/plugin-manager/plugin-route-metadata.d.ts +141 -0
  32. package/src/lib/plugin-manager/plugin-route-metadata.js +140 -0
  33. package/src/lib/plugin-manager/plugin-route-metadata.js.map +1 -0
  34. package/src/lib/plugin-manager/plugin-site-cache.d.ts +78 -0
  35. package/src/lib/plugin-manager/plugin-site-cache.js +125 -0
  36. package/src/lib/plugin-manager/plugin-site-cache.js.map +1 -0
@@ -84,6 +84,17 @@ export interface ConsolePluginOrgHost {
84
84
  */
85
85
  export interface ConsolePluginOrgMount {
86
86
  orgId: string;
87
+ /**
88
+ * The organization's URL slug (AGL-3080) — the segment its console pages
89
+ * hang under, and what a surface needs to link to one of its siblings.
90
+ *
91
+ * Carried because plugins were reconstructing it: from `hostsPath` by
92
+ * splitting a string, or by resolving a site's org through an async lookup
93
+ * that can come back empty and leave a link unbuilt (AGL-867). The shell
94
+ * has it synchronously; every plugin paying for it again, differently, is
95
+ * the cost of not handing it over.
96
+ */
97
+ orgSlug: string;
87
98
  hosts: readonly ConsolePluginOrgHost[];
88
99
  hostsReady: boolean;
89
100
  /**
@@ -94,6 +105,27 @@ export interface ConsolePluginOrgMount {
94
105
  * cannot import the console's route table.
95
106
  */
96
107
  hostsPath: string;
108
+ /**
109
+ * Where this organization manages its PLAN — the console's billing page
110
+ * for the org (AGL-3080).
111
+ *
112
+ * Here for the same reason `hostsPath` is: a plugin cannot import the
113
+ * console's route table, and a surface that has to say "on a paid plan the
114
+ * cut is lower" is useless without somewhere to send the person who just
115
+ * read it. The shell's own upgrade notice covers an ENTITLEMENT refusal,
116
+ * where the surface never renders; this covers the case the surface renders
117
+ * fine and the plan is still the answer — a marketplace publisher seeing
118
+ * the free-plan fee on a listing they are about to price.
119
+ *
120
+ * OPTIONAL, and a plugin must branch on it rather than assume it: a
121
+ * deployment that bills nobody has no such page, and a self-hoster who
122
+ * removed it should not get a plugin's link into a 404. The shell's own
123
+ * upgrade notice makes the same allowance. `resolveOrgMount` supplies it
124
+ * for every mount this console builds.
125
+ *
126
+ * A plugin renders a link to it or does not, and never parses it.
127
+ */
128
+ billingPath?: string;
97
129
  }
98
130
  /**
99
131
  * Props every plugin-contributed console page receives from the shell's
@@ -113,6 +145,26 @@ export interface ConsolePluginPageProps {
113
145
  hostId: string | null;
114
146
  /** Present only at an org-level mount — see {@link ConsolePluginOrgMount}. */
115
147
  orgMount?: ConsolePluginOrgMount;
148
+ /**
149
+ * Every workspace the SIGNED-IN PERSON belongs to, as the org switcher
150
+ * already names them (AGL-3080) — not the mounted org's siblings, and
151
+ * nothing about what any of them contain.
152
+ *
153
+ * For a surface whose subject crosses workspaces. The marketplace's
154
+ * licences panel is the case: a purchase licenses one organization, so
155
+ * "I bought this once — which workspace did the licence land in?" is a
156
+ * question about the BUYER, and the answer is a name the reader already
157
+ * sees in the switcher. Resolving it from ids would be a read per row of
158
+ * documents the shell is already holding.
159
+ *
160
+ * Absent when the shell has not resolved them, and a surface must name the
161
+ * id rather than wait: this is a label, and a row with a raw id in it is
162
+ * worse than nothing only if the row does not appear at all.
163
+ */
164
+ viewerOrgs?: readonly {
165
+ id: string;
166
+ name: string;
167
+ }[];
116
168
  /** True when the org holds the extension's `featureFlag` entitlement. */
117
169
  entitled: boolean;
118
170
  /**
@@ -495,8 +547,6 @@ export declare const CONSOLE_WIDGET_SLOTS: {
495
547
  readonly orgData: "orgData";
496
548
  /** Besigner functions (ƒx) panel. Props: hostId. */
497
549
  readonly besignerFunctions: "besignerFunctions";
498
- /** Marketplace listing detail body. Props: hostId, listingId, permissions. */
499
- readonly marketplaceListing: "marketplaceListing";
500
550
  /**
501
551
  * Wherever a console page offers to publish something it holds (AGL-3080).
502
552
  * Props: {@link ConsoleArtifactPublishZoneProps}.
@@ -525,27 +575,6 @@ export declare const CONSOLE_WIDGET_SLOTS: {
525
575
  * marketplace.
526
576
  */
527
577
  readonly hostArtifactPublish: "hostArtifactPublish";
528
- /**
529
- * Above the whole Marketplace subtree: what THIS DEPLOYMENT cannot do
530
- * (AGL-2019, moved out of the console app by AGL-3080). No props — the
531
- * widget reads {@link DeploymentCapabilities} from the context the org's
532
- * server layout provides, and draws nothing when the deployment is
533
- * configured.
534
- *
535
- * A zone rather than a component the app holds, because the sentence is
536
- * the marketplace's: it names what still works without a Stripe platform
537
- * (browsing, free installs) and that is the plugin's knowledge, not the
538
- * shell's. The app supplies only the fact.
539
- */
540
- readonly marketplaceCapability: "marketplaceCapability";
541
- /**
542
- * Org marketplace browse body (AGL-772). Props: hostId (acting site),
543
- * permissions, orgScoped. The single org-scope place to browse + install,
544
- * replacing the per-site marketplace tab.
545
- */
546
- readonly orgMarketplace: "orgMarketplace";
547
- /** Plugins & add-ons hub installs section. Props: hostId. */
548
- readonly orgAddons: "orgAddons";
549
578
  /** Bottom of the host dashboard. Props: hostId, org. (AGL-433) */
550
579
  readonly dashboardFooter: "dashboardFooter";
551
580
  /** Org settings page, below the tabbed cards. Props: orgId, org. */
@@ -1213,6 +1242,48 @@ export interface ConsoleUpgradeNotice {
1213
1242
  export interface ConsoleStaffPageProps {
1214
1243
  /** The page's own console path, `/admin/{id}`. */
1215
1244
  basePath: string;
1245
+ /**
1246
+ * Path segments beneath {@link basePath}, `[]` on the page's own URL
1247
+ * (AGL-3080). Only ever non-empty for a page that declared
1248
+ * {@link ConsoleStaffPage.ownsSubtree}.
1249
+ *
1250
+ * The staff twin of {@link ConsolePluginPageProps.segments}, and for the
1251
+ * same case: a queue is a list, and a row of it is a page. A staff page
1252
+ * without this could only ever BE the list.
1253
+ */
1254
+ segments?: readonly string[];
1255
+ /**
1256
+ * The viewer's staff ROLE, or `null` while the claim is still resolving
1257
+ * (AGL-3080).
1258
+ *
1259
+ * Not every staff act is open to every staff role — six are `super`-only
1260
+ * on the server — and a page that cannot tell renders live controls to a
1261
+ * `support` engineer who clicks them and gets a raw 403. Pass it to
1262
+ * `resolveStaffRoleGate` and render the verdict with
1263
+ * `BlockedControl`; `null` must never be treated as a refusal, or every
1264
+ * page flashes a disabled button at the people who may use it.
1265
+ *
1266
+ * ⚠️ NOT the boundary. The routes verify the decoded token per request and
1267
+ * refuse regardless of what rendered. This exists so the console stops
1268
+ * promising what the server will refuse.
1269
+ */
1270
+ staffRole?: string | null;
1271
+ /**
1272
+ * Console destinations a staff page may link ACROSS to, built by the shell
1273
+ * (AGL-3080) — the staff twin of {@link ConsolePluginOrgMount}'s paths,
1274
+ * and for the same reason: a plugin cannot import the console's route
1275
+ * table, and a plugin that rebuilt one of these from a string would break
1276
+ * silently the day the console moved it.
1277
+ */
1278
+ staffPaths?: ConsoleStaffPagePaths;
1279
+ }
1280
+ export interface ConsoleStaffPagePaths {
1281
+ /**
1282
+ * The staff console's page for one workspace. `undefined` on a deployment
1283
+ * that has no such page, which a caller renders as no link rather than a
1284
+ * dead one.
1285
+ */
1286
+ orgDetail(orgId: string): string | undefined;
1216
1287
  }
1217
1288
  /**
1218
1289
  * A page a plugin adds to the STAFF area (AGL-2939): a tab in the staff
@@ -1245,6 +1316,25 @@ export interface ConsoleStaffPage {
1245
1316
  icon?: MdiIconProps;
1246
1317
  docsTopic?: string;
1247
1318
  };
1319
+ /**
1320
+ * Whether this page claims every path beneath `/admin/{id}` too
1321
+ * (AGL-3080) — the staff twin of {@link ConsoleNavItem.ownsSubtree}, with
1322
+ * the same trade and the same duty.
1323
+ *
1324
+ * The case is a staff QUEUE: the list is the page, and each row opens one
1325
+ * submission. The set of ids is a property of the data, so no static list
1326
+ * could enumerate them, and without this every row's URL is a 404.
1327
+ *
1328
+ * A page that claims its subtree can no longer tell a typo from an id, so
1329
+ * it takes on saying "no such thing" itself — which a queue has to be able
1330
+ * to do anyway for a submission withdrawn while a link to it was still in
1331
+ * a reviewer's inbox.
1332
+ *
1333
+ * The console's own staff routes keep winning their segments either way:
1334
+ * a static path beats a dynamic one segment by segment, so `/admin/orgs/1`
1335
+ * is still the orgs route and never a staff page's subtree.
1336
+ */
1337
+ ownsSubtree?: boolean;
1248
1338
  Component: ComponentType<ConsoleStaffPageProps>;
1249
1339
  }
1250
1340
  export interface ConsoleExtension {
@@ -119,7 +119,6 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
119
119
  /** Host dashboard commerce summary. Props: hostId, org. */ commerceGlance: 'commerceGlance',
120
120
  /** Org Data page body. Props: orgId, org. */ orgData: 'orgData',
121
121
  /** Besigner functions (ƒx) panel. Props: hostId. */ besignerFunctions: 'besignerFunctions',
122
- /** Marketplace listing detail body. Props: hostId, listingId, permissions. */ marketplaceListing: 'marketplaceListing',
123
122
  /**
124
123
  * Wherever a console page offers to publish something it holds (AGL-3080).
125
124
  * Props: {@link ConsoleArtifactPublishZoneProps}.
@@ -147,25 +146,22 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
147
146
  * anyway would be a menu item that opens nothing on a workspace with no
148
147
  * marketplace.
149
148
  */ hostArtifactPublish: 'hostArtifactPublish',
150
- /**
151
- * Above the whole Marketplace subtree: what THIS DEPLOYMENT cannot do
152
- * (AGL-2019, moved out of the console app by AGL-3080). No props — the
153
- * widget reads {@link DeploymentCapabilities} from the context the org's
154
- * server layout provides, and draws nothing when the deployment is
155
- * configured.
149
+ /*
150
+ * `marketplaceListing`, `marketplaceCapability`, `orgMarketplace` and
151
+ * `orgAddons` were here until AGL-3080, and are gone rather than deprecated.
156
152
  *
157
- * A zone rather than a component the app holds, because the sentence is
158
- * the marketplace's: it names what still works without a Stripe platform
159
- * (browsing, free installs) and that is the plugin's knowledge, not the
160
- * shell's. The app supplies only the fact.
161
- */ marketplaceCapability: 'marketplaceCapability',
162
- /**
163
- * Org marketplace browse body (AGL-772). Props: hostId (acting site),
164
- * permissions, orgScoped. The single org-scope place to browse + install,
165
- * replacing the per-site marketplace tab.
166
- */ orgMarketplace: 'orgMarketplace',
167
- /** Plugins & add-ons hub installs section. Props: hostId. */ orgAddons: 'orgAddons',
168
- /** Bottom of the host dashboard. Props: hostId, org. (AGL-433) */ dashboardFooter: 'dashboardFooter',
153
+ * Each existed for one reason: a CONSOLE ROUTE had to show marketplace UI
154
+ * and an app may not import a plugin. AGL-3080 moved those routes into the
155
+ * marketplace plugin, where the components are plain imports — so the four
156
+ * zones had no drawer left, and a zone nothing draws is a contract nothing
157
+ * can be held to. `plugin-widget-slot-zones.spec.ts` is what noticed, which
158
+ * is the whole reason that inventory exists.
159
+ *
160
+ * `pluginSiteSet` and `hostArtifactPublish` stayed, and the difference is
161
+ * the test: both are drawn by a console page that is NOT the marketplace —
162
+ * the installation detail page and a site's layouts list — offering a
163
+ * marketplace action in passing.
164
+ */ /** Bottom of the host dashboard. Props: hostId, org. (AGL-433) */ dashboardFooter: 'dashboardFooter',
169
165
  /** Org settings page, below the tabbed cards. Props: orgId, org. */ orgSettings: 'orgSettings',
170
166
  /** Host setup page, below the built-in cards. Props: hostId, org. */ hostSettings: 'hostSettings',
171
167
  /**