@aglyn/aglyn 1.0.0-beta.146 → 1.0.0-beta.149
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 +10 -10
- package/src/lib/app-utils/binding-token-catalog.js +9 -2
- package/src/lib/app-utils/binding-token-catalog.js.map +1 -1
- package/src/lib/app-utils/collection-entries.d.ts +95 -3
- package/src/lib/app-utils/collection-entries.js +146 -10
- package/src/lib/app-utils/collection-entries.js.map +1 -1
- package/src/lib/app-utils/console-routes.d.ts +2 -0
- package/src/lib/app-utils/console-routes.js +14 -0
- package/src/lib/app-utils/console-routes.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.d.ts +1 -1
- package/src/lib/app-utils/docs-help.generated.js +3 -0
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +2 -2
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/notifications.d.ts +136 -2
- package/src/lib/app-utils/notifications.js +139 -3
- package/src/lib/app-utils/notifications.js.map +1 -1
- package/src/lib/foundation/definitions/host-content-collections.d.ts +42 -40
- package/src/lib/foundation/definitions/host-content-collections.js +47 -109
- package/src/lib/foundation/definitions/host-content-collections.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +70 -0
- package/src/lib/plugin-manager/feature-plugins.js +27 -0
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +13 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js +257 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
- package/src/lib/plugin-manager/plugin-contact-capture.d.ts +16 -0
- package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
- package/src/lib/plugin-manager/plugin-host-collections.d.ts +27 -5
- package/src/lib/plugin-manager/plugin-host-collections.js +25 -16
- package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -1
- package/src/lib/plugin-manager/plugin-org-capacity.d.ts +57 -0
- package/src/lib/plugin-manager/plugin-org-capacity.js +68 -0
- package/src/lib/plugin-manager/plugin-org-capacity.js.map +1 -0
- package/src/lib/plugin-manager/record-captured-contact.d.ts +89 -0
- package/src/lib/plugin-manager/record-captured-contact.js +128 -0
- package/src/lib/plugin-manager/record-captured-contact.js.map +1 -0
|
@@ -162,5 +162,262 @@ export const PUBLISHED_SITE_IMPACT = {
|
|
|
162
162
|
"path": "/products/orders"
|
|
163
163
|
}
|
|
164
164
|
];
|
|
165
|
+
/**
|
|
166
|
+
* Every host subcollection a first-party plugin owns, declared by that plugin
|
|
167
|
+
* (AGL-3080). Core's readers ask this list; core names no collection.
|
|
168
|
+
*/ export const PLUGIN_HOST_COLLECTIONS_DECLARED = [
|
|
169
|
+
{
|
|
170
|
+
"pluginId": "forms",
|
|
171
|
+
"name": "forms",
|
|
172
|
+
"routeSlug": "forms"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"pluginId": "bookings",
|
|
176
|
+
"name": "services",
|
|
177
|
+
"routeSlug": "bookings"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"pluginId": "bookings",
|
|
181
|
+
"name": "bookings",
|
|
182
|
+
"mediaScan": "none",
|
|
183
|
+
"mediaScanReason": "Booking records — a customer, a time and a service pointer. The service holds the imagery and IS scanned; a booking is the transaction against it."
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"pluginId": "commerce",
|
|
187
|
+
"name": "products",
|
|
188
|
+
"routeSlug": "products"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"pluginId": "commerce",
|
|
192
|
+
"name": "productCategories",
|
|
193
|
+
"routeSlug": "products"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"pluginId": "commerce",
|
|
197
|
+
"name": "suppliers",
|
|
198
|
+
"routeSlug": "products"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"pluginId": "commerce",
|
|
202
|
+
"name": "locations",
|
|
203
|
+
"routeSlug": "products"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"pluginId": "commerce",
|
|
207
|
+
"name": "coupons",
|
|
208
|
+
"routeSlug": "products"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"pluginId": "commerce",
|
|
212
|
+
"name": "discounts",
|
|
213
|
+
"routeSlug": "products"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"pluginId": "commerce",
|
|
217
|
+
"name": "reviews",
|
|
218
|
+
"routeSlug": "products"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"pluginId": "commerce",
|
|
222
|
+
"name": "memberPosts",
|
|
223
|
+
"routeSlug": "products"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"pluginId": "commerce",
|
|
227
|
+
"name": "resources",
|
|
228
|
+
"routeSlug": "products"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"pluginId": "commerce",
|
|
232
|
+
"name": "settings",
|
|
233
|
+
"label": "Store settings",
|
|
234
|
+
"routeSlug": "products"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"pluginId": "commerce",
|
|
238
|
+
"name": "siteMembers"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"pluginId": "commerce",
|
|
242
|
+
"name": "orders",
|
|
243
|
+
"mediaScan": "none",
|
|
244
|
+
"mediaScanReason": "Completed orders. Line items COPY a product's `imageUrl` at purchase time, so these would match — and matching would be the wrong answer: an order is an immutable record of what was sold, deleting the asset changes nothing about it, and no author can edit one. A busy store also holds more of these than the whole read budget."
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"pluginId": "commerce",
|
|
248
|
+
"name": "carts",
|
|
249
|
+
"mediaScan": "none",
|
|
250
|
+
"mediaScanReason": "Live and abandoned carts, with the same copied line-item image and the same reasoning, at higher volume — one document per shopper session."
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"pluginId": "commerce",
|
|
254
|
+
"name": "checkouts",
|
|
255
|
+
"mediaScan": "none",
|
|
256
|
+
"mediaScanReason": "In-flight checkout sessions. Transient buyer state carrying the same line-item snapshot as `carts`."
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"pluginId": "commerce",
|
|
260
|
+
"name": "reservations",
|
|
261
|
+
"mediaScan": "none",
|
|
262
|
+
"mediaScanReason": "POS and booking holds. Short-lived transaction rows pointing at a resource that is itself scanned."
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"pluginId": "commerce",
|
|
266
|
+
"name": "stockHolds",
|
|
267
|
+
"mediaScan": "none",
|
|
268
|
+
"mediaScanReason": "Inventory holds taken during checkout. Machine-written, short-lived, and a quantity rather than content."
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"pluginId": "commerce",
|
|
272
|
+
"name": "subscriptions",
|
|
273
|
+
"mediaScan": "none",
|
|
274
|
+
"mediaScanReason": "Site membership subscriptions: a plan pointer, a status and Stripe ids. Server-written from the billing webhook."
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"pluginId": "commerce",
|
|
278
|
+
"name": "registers",
|
|
279
|
+
"mediaScan": "none",
|
|
280
|
+
"mediaScanReason": "POS register allocations — a count against the register add-on, read by billing (AGL-1775). No content field at all."
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"pluginId": "commerce",
|
|
284
|
+
"name": "giftCards",
|
|
285
|
+
"mediaScan": "none",
|
|
286
|
+
"mediaScanReason": "Gift card balances and redemption history. Money, not content."
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"pluginId": "commerce",
|
|
290
|
+
"name": "licenseKeys",
|
|
291
|
+
"mediaScan": "none",
|
|
292
|
+
"mediaScanReason": "Digital-product license keys issued at fulfilment: a code, an order pointer and a revocation flag."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"pluginId": "commerce",
|
|
296
|
+
"name": "inventoryAdjustments",
|
|
297
|
+
"mediaScan": "none",
|
|
298
|
+
"mediaScanReason": "The append-only stock adjustment ledger (AGL-2269). One row per manual stock edit and per cancellation release, unbounded over a store's life."
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"pluginId": "commerce",
|
|
302
|
+
"name": "inventoryReconciliation",
|
|
303
|
+
"mediaScan": "none",
|
|
304
|
+
"mediaScanReason": "Reconciliation runs comparing counted stock against recorded stock. Machine-written totals."
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"pluginId": "commerce",
|
|
308
|
+
"name": "restockAlerts",
|
|
309
|
+
"mediaScan": "none",
|
|
310
|
+
"mediaScanReason": "Back-in-stock requests: an email address and a product pointer, written by visitors."
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"pluginId": "commerce",
|
|
314
|
+
"name": "stripeTaxRates",
|
|
315
|
+
"mediaScan": "none",
|
|
316
|
+
"mediaScanReason": "Cached Stripe tax rate ids, written by the tax sync. Vendor ids."
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"pluginId": "marketplace",
|
|
320
|
+
"name": "installs"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"pluginId": "crm",
|
|
324
|
+
"name": "leads",
|
|
325
|
+
"mediaScan": "none",
|
|
326
|
+
"mediaScanReason": "Captured leads, on the same footing as `formSubmissions`: visitor-submitted, unbounded, and never a place an author places an asset."
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"pluginId": "email",
|
|
330
|
+
"name": "suppressions",
|
|
331
|
+
"mediaScan": "none",
|
|
332
|
+
"mediaScanReason": "Unsubscribes, bounces and spam complaints. Email addresses and a reason."
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"pluginId": "events-calendar",
|
|
336
|
+
"name": "events",
|
|
337
|
+
"routeSlug": "events"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"pluginId": "inbox",
|
|
341
|
+
"name": "formSubmissions",
|
|
342
|
+
"mediaScan": "none",
|
|
343
|
+
"mediaScanReason": "Visitor form submissions. Unbounded, PII-heavy, and a file attached to one is the visitor's upload — not a library asset an author picked, and not something deleting a library asset would break."
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"pluginId": "logic",
|
|
347
|
+
"name": "functions",
|
|
348
|
+
"routeSlug": "logic"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"pluginId": "logic",
|
|
352
|
+
"name": "variables",
|
|
353
|
+
"routeSlug": "logic"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"pluginId": "marketing",
|
|
357
|
+
"name": "campaigns",
|
|
358
|
+
"routeSlug": "marketing"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"pluginId": "marketing",
|
|
362
|
+
"name": "experiments",
|
|
363
|
+
"routeSlug": "marketing"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"pluginId": "marketing",
|
|
367
|
+
"name": "overlays",
|
|
368
|
+
"routeSlug": "marketing"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"pluginId": "marketing",
|
|
372
|
+
"name": "emailCampaigns",
|
|
373
|
+
"mediaScan": "none",
|
|
374
|
+
"mediaScanReason": "The campaign CONTAINER — a name, a date window, the list ids it is aimed at and a topic. Distinct from `campaigns`, which holds the sends and IS scanned because a send carries the copy that went out. A container carries no copy and no asset reference: the design a send renders is a screen, and the screen is where the picker writes."
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"pluginId": "marketing",
|
|
378
|
+
"name": "campaignAttributions",
|
|
379
|
+
"mediaScan": "none",
|
|
380
|
+
"mediaScanReason": "One row per conversion — a form submission, a lead, a contact or a booking — recording which campaign the visitor arrived from. Written only by the Admin SDK, and the whole record is three sanitized UTM strings capped at a hundred characters: there is no field an asset could occupy and no surface that could pick one into it. Unbounded on the same footing as the conversions it credits."
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"pluginId": "redirects",
|
|
384
|
+
"name": "redirects",
|
|
385
|
+
"routeSlug": "redirects"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"pluginId": "workflows",
|
|
389
|
+
"name": "workflows",
|
|
390
|
+
"routeSlug": "automation"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"pluginId": "workflows",
|
|
394
|
+
"name": "webhooks",
|
|
395
|
+
"routeSlug": "automation"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"pluginId": "workflows",
|
|
399
|
+
"name": "actions",
|
|
400
|
+
"routeSlug": "automation"
|
|
401
|
+
}
|
|
402
|
+
];
|
|
403
|
+
/**
|
|
404
|
+
* Every org capacity a first-party plugin backs, declared by that plugin
|
|
405
|
+
* (AGL-3080). Core owns the money; this says what is counted and what it is
|
|
406
|
+
* called.
|
|
407
|
+
*/ export const PLUGIN_ORG_CAPACITIES_DECLARED = [
|
|
408
|
+
{
|
|
409
|
+
"pluginId": "data",
|
|
410
|
+
"kind": "datasets",
|
|
411
|
+
"order": 30,
|
|
412
|
+
"collection": "datasets",
|
|
413
|
+
"addonKind": "datasets",
|
|
414
|
+
"includedEntitlement": "datasetsPerOrg",
|
|
415
|
+
"nouns": {
|
|
416
|
+
"one": "dataset",
|
|
417
|
+
"many": "datasets",
|
|
418
|
+
"addon": "extra datasets"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
];
|
|
165
422
|
|
|
166
423
|
//# sourceMappingURL=first-party-plugins.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/first-party-plugins.generated.ts"],"sourcesContent":["/**\n * GENERATED FILE — do not edit. Regenerate with:\n * node tools/scripts/generate-plugin-manifests.mjs\n *\n * The switchboard catalog (AGL-3080): one row per plugin and capability, each\n * declared by its own `catalog` block in plugins.config.json. The core holds\n * the types and the resolvers in `enabled-plugins.ts`; it holds no row.\n */\n\nimport type { FirstPartyPlugin, PluginEditBarLink, PublishedSiteImpact } from './enabled-plugins'\n\nexport const FIRST_PARTY_PLUGINS: readonly FirstPartyPlugin[] = [\n {\n \"id\": \"mui\",\n \"label\": \"Components\",\n \"alwaysOn\": true,\n \"description\": \"The base component and theme library every site builds on.\"\n },\n {\n \"id\": \"forms\",\n \"label\": \"Forms\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"Forms on the site and the catalog that owns them.\",\n \"siteOff\": {\n \"stops\": \"Switching Forms off for this site stops forms rendering on its published pages, refuses every submission sent to it, and blocks publishing a form, or a page that carries one, until Forms is back on.\",\n \"keeps\": \"Submissions already received, the workspace’s form catalog and the CRM leads its forms created are kept, and forms keep working on the workspace’s other sites.\",\n \"confirm\": true,\n \"pages\": {\n \"heading\": \"These published pages carry a form. Their forms stop rendering and stop accepting submissions:\",\n \"none\": \"No published page on this site carries a form.\"\n }\n }\n },\n {\n \"id\": \"ai\",\n \"label\": \"AI\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"The assistant, generative building and automation, and the AI add-on.\",\n \"siteOff\": {\n \"stops\": \"Switching AI off for this site hides the assistant, Describe it, the AI cards and the editor’s AI controls on this site, refuses every AI request made for it, and stops its queued AI jobs without spending credits.\",\n \"keeps\": \"It does not stop the workspace’s AI add-on, credits, allotments or overage billing, and AI keeps working on the workspace’s other sites.\"\n }\n },\n {\n \"id\": \"accounts\",\n \"label\": \"User Accounts\",\n \"description\": \"Visitor accounts on the site: the /signin, /signup and /recover pages, and the Members blocks. Off for a site until you turn it on.\",\n \"releaseFlag\": \"release_member_accounts\",\n \"defaultOffPerSite\": true,\n \"requires\": [\n \"commerce\"\n ]\n },\n {\n \"id\": \"bookings\",\n \"label\": \"Bookings\",\n \"description\": \"Services, open slots, and paid bookings.\",\n \"releaseFlag\": \"release_bookings\"\n },\n {\n \"id\": \"commerce\",\n \"label\": \"Commerce\",\n \"description\": \"Products, carts, checkout, orders, POS.\",\n \"releaseFlag\": \"release_commerce_v2\"\n },\n {\n \"id\": \"marketplace\",\n \"label\": \"Marketplace\",\n \"description\": \"Marketplace listings, templates, and installs.\",\n \"releaseFlag\": \"release_marketplace\"\n },\n {\n \"id\": \"crm\",\n \"label\": \"CRM\",\n \"description\": \"Leads, contacts, companies, deals, tasks and reports.\",\n \"releaseFlag\": \"release_crm\"\n },\n {\n \"id\": \"outreach\",\n \"label\": \"Sequences\",\n \"description\": \"One-to-one email sequences sent from connected mailboxes.\",\n \"releaseFlag\": \"release_outreach\"\n },\n {\n \"id\": \"data\",\n \"label\": \"Data\",\n \"description\": \"Datasets, records, and CSV import/export.\",\n \"releaseFlag\": \"release_data_store\"\n },\n {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"description\": \"Designed emails and campaign sending.\",\n \"releaseFlag\": \"release_email\"\n },\n {\n \"id\": \"events-calendar\",\n \"label\": \"Events Calendar\",\n \"description\": \"Event lists and calendars.\",\n \"releaseFlag\": \"release_events\"\n },\n {\n \"id\": \"inbox\",\n \"label\": \"Inbox\",\n \"description\": \"Form submissions and lead inbox.\",\n \"releaseFlag\": \"release_inbox\"\n },\n {\n \"id\": \"logic\",\n \"label\": \"Logic\",\n \"description\": \"Variables, functions, and reference health.\",\n \"releaseFlag\": \"release_logic\"\n },\n {\n \"id\": \"marketing\",\n \"label\": \"Marketing\",\n \"description\": \"Overlays, campaigns, and experiments.\",\n \"releaseFlag\": \"release_marketing\"\n },\n {\n \"id\": \"redirects\",\n \"label\": \"Redirects\",\n \"description\": \"URL redirect rules.\",\n \"releaseFlag\": \"release_redirects\"\n },\n {\n \"id\": \"workflows\",\n \"label\": \"Automation\",\n \"description\": \"Workflows, actions, webhooks, and run logs.\",\n \"releaseFlag\": \"release_workflows\"\n },\n]\n\nexport const PUBLISHED_SITE_IMPACT: Readonly<Record<string, PublishedSiteImpact>> = {\n \"mui\": \"elements\",\n \"forms\": \"elements\",\n \"ai\": \"console-only\",\n \"accounts\": \"routes\",\n \"bookings\": \"elements\",\n \"commerce\": \"elements\",\n \"marketplace\": \"console-only\",\n \"crm\": \"console-only\",\n \"outreach\": \"console-only\",\n \"data\": \"console-only\",\n \"email\": \"elements\",\n \"events-calendar\": \"elements\",\n \"inbox\": \"console-only\",\n \"logic\": \"console-only\",\n \"marketing\": \"elements\",\n \"redirects\": \"routes\",\n \"workflows\": \"routes\",\n}\n\n/**\n * The admin edit bar's quick links, in the order they are drawn — each\n * declared by the plugin whose console page it opens (AGL-3080).\n */\nexport const PLUGIN_EDIT_BAR_LINKS: readonly PluginEditBarLink[] = [\n {\n \"pluginId\": \"inbox\",\n \"order\": 20,\n \"label\": \"Inbox\",\n \"path\": \"/inbox\"\n },\n {\n \"pluginId\": \"commerce\",\n \"order\": 30,\n \"label\": \"Orders\",\n \"path\": \"/products/orders\"\n },\n]\n"],"names":["FIRST_PARTY_PLUGINS","PUBLISHED_SITE_IMPACT","PLUGIN_EDIT_BAR_LINKS"],"mappings":"AAAA;;;;;;;CAOC,GAID,OAAO,MAAMA,sBAAmD;IAC9D;QACE,MAAM;QACN,SAAS;QACT,YAAY;QACZ,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;YACT,WAAW;YACX,SAAS;gBACP,WAAW;gBACX,QAAQ;YACV;QACF;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;QACX;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;QACf,qBAAqB;QACrB,YAAY;YACV;SACD;IACH;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;CACD,CAAA;AAED,OAAO,MAAMC,wBAAuE;IAClF,OAAO;IACP,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,mBAAmB;IACnB,SAAS;IACT,SAAS;IACT,aAAa;IACb,aAAa;IACb,aAAa;AACf,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMC,wBAAsD;IACjE;QACE,YAAY;QACZ,SAAS;QACT,SAAS;QACT,QAAQ;IACV;IACA;QACE,YAAY;QACZ,SAAS;QACT,SAAS;QACT,QAAQ;IACV;CACD,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/first-party-plugins.generated.ts"],"sourcesContent":["/**\n * GENERATED FILE — do not edit. Regenerate with:\n * node tools/scripts/generate-plugin-manifests.mjs\n *\n * The switchboard catalog (AGL-3080): one row per plugin and capability, each\n * declared by its own `catalog` block in plugins.config.json. The core holds\n * the types and the resolvers in `enabled-plugins.ts`; it holds no row.\n */\n\nimport type { FirstPartyPlugin, PluginEditBarLink, PublishedSiteImpact } from './enabled-plugins'\nimport type { ResolvedPluginHostCollection } from './plugin-host-collections'\nimport type { ResolvedPluginOrgCapacity } from './plugin-org-capacity'\n\nexport const FIRST_PARTY_PLUGINS: readonly FirstPartyPlugin[] = [\n {\n \"id\": \"mui\",\n \"label\": \"Components\",\n \"alwaysOn\": true,\n \"description\": \"The base component and theme library every site builds on.\"\n },\n {\n \"id\": \"forms\",\n \"label\": \"Forms\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"Forms on the site and the catalog that owns them.\",\n \"siteOff\": {\n \"stops\": \"Switching Forms off for this site stops forms rendering on its published pages, refuses every submission sent to it, and blocks publishing a form, or a page that carries one, until Forms is back on.\",\n \"keeps\": \"Submissions already received, the workspace’s form catalog and the CRM leads its forms created are kept, and forms keep working on the workspace’s other sites.\",\n \"confirm\": true,\n \"pages\": {\n \"heading\": \"These published pages carry a form. Their forms stop rendering and stop accepting submissions:\",\n \"none\": \"No published page on this site carries a form.\"\n }\n }\n },\n {\n \"id\": \"ai\",\n \"label\": \"AI\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"The assistant, generative building and automation, and the AI add-on.\",\n \"siteOff\": {\n \"stops\": \"Switching AI off for this site hides the assistant, Describe it, the AI cards and the editor’s AI controls on this site, refuses every AI request made for it, and stops its queued AI jobs without spending credits.\",\n \"keeps\": \"It does not stop the workspace’s AI add-on, credits, allotments or overage billing, and AI keeps working on the workspace’s other sites.\"\n }\n },\n {\n \"id\": \"accounts\",\n \"label\": \"User Accounts\",\n \"description\": \"Visitor accounts on the site: the /signin, /signup and /recover pages, and the Members blocks. Off for a site until you turn it on.\",\n \"releaseFlag\": \"release_member_accounts\",\n \"defaultOffPerSite\": true,\n \"requires\": [\n \"commerce\"\n ]\n },\n {\n \"id\": \"bookings\",\n \"label\": \"Bookings\",\n \"description\": \"Services, open slots, and paid bookings.\",\n \"releaseFlag\": \"release_bookings\"\n },\n {\n \"id\": \"commerce\",\n \"label\": \"Commerce\",\n \"description\": \"Products, carts, checkout, orders, POS.\",\n \"releaseFlag\": \"release_commerce_v2\"\n },\n {\n \"id\": \"marketplace\",\n \"label\": \"Marketplace\",\n \"description\": \"Marketplace listings, templates, and installs.\",\n \"releaseFlag\": \"release_marketplace\"\n },\n {\n \"id\": \"crm\",\n \"label\": \"CRM\",\n \"description\": \"Leads, contacts, companies, deals, tasks and reports.\",\n \"releaseFlag\": \"release_crm\"\n },\n {\n \"id\": \"outreach\",\n \"label\": \"Sequences\",\n \"description\": \"One-to-one email sequences sent from connected mailboxes.\",\n \"releaseFlag\": \"release_outreach\"\n },\n {\n \"id\": \"data\",\n \"label\": \"Data\",\n \"description\": \"Datasets, records, and CSV import/export.\",\n \"releaseFlag\": \"release_data_store\"\n },\n {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"description\": \"Designed emails and campaign sending.\",\n \"releaseFlag\": \"release_email\"\n },\n {\n \"id\": \"events-calendar\",\n \"label\": \"Events Calendar\",\n \"description\": \"Event lists and calendars.\",\n \"releaseFlag\": \"release_events\"\n },\n {\n \"id\": \"inbox\",\n \"label\": \"Inbox\",\n \"description\": \"Form submissions and lead inbox.\",\n \"releaseFlag\": \"release_inbox\"\n },\n {\n \"id\": \"logic\",\n \"label\": \"Logic\",\n \"description\": \"Variables, functions, and reference health.\",\n \"releaseFlag\": \"release_logic\"\n },\n {\n \"id\": \"marketing\",\n \"label\": \"Marketing\",\n \"description\": \"Overlays, campaigns, and experiments.\",\n \"releaseFlag\": \"release_marketing\"\n },\n {\n \"id\": \"redirects\",\n \"label\": \"Redirects\",\n \"description\": \"URL redirect rules.\",\n \"releaseFlag\": \"release_redirects\"\n },\n {\n \"id\": \"workflows\",\n \"label\": \"Automation\",\n \"description\": \"Workflows, actions, webhooks, and run logs.\",\n \"releaseFlag\": \"release_workflows\"\n },\n]\n\nexport const PUBLISHED_SITE_IMPACT: Readonly<Record<string, PublishedSiteImpact>> = {\n \"mui\": \"elements\",\n \"forms\": \"elements\",\n \"ai\": \"console-only\",\n \"accounts\": \"routes\",\n \"bookings\": \"elements\",\n \"commerce\": \"elements\",\n \"marketplace\": \"console-only\",\n \"crm\": \"console-only\",\n \"outreach\": \"console-only\",\n \"data\": \"console-only\",\n \"email\": \"elements\",\n \"events-calendar\": \"elements\",\n \"inbox\": \"console-only\",\n \"logic\": \"console-only\",\n \"marketing\": \"elements\",\n \"redirects\": \"routes\",\n \"workflows\": \"routes\",\n}\n\n/**\n * The admin edit bar's quick links, in the order they are drawn — each\n * declared by the plugin whose console page it opens (AGL-3080).\n */\nexport const PLUGIN_EDIT_BAR_LINKS: readonly PluginEditBarLink[] = [\n {\n \"pluginId\": \"inbox\",\n \"order\": 20,\n \"label\": \"Inbox\",\n \"path\": \"/inbox\"\n },\n {\n \"pluginId\": \"commerce\",\n \"order\": 30,\n \"label\": \"Orders\",\n \"path\": \"/products/orders\"\n },\n]\n\n/**\n * Every host subcollection a first-party plugin owns, declared by that plugin\n * (AGL-3080). Core's readers ask this list; core names no collection.\n */\nexport const PLUGIN_HOST_COLLECTIONS_DECLARED: readonly ResolvedPluginHostCollection[] = [\n {\n \"pluginId\": \"forms\",\n \"name\": \"forms\",\n \"routeSlug\": \"forms\"\n },\n {\n \"pluginId\": \"bookings\",\n \"name\": \"services\",\n \"routeSlug\": \"bookings\"\n },\n {\n \"pluginId\": \"bookings\",\n \"name\": \"bookings\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Booking records — a customer, a time and a service pointer. The service holds the imagery and IS scanned; a booking is the transaction against it.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"products\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"productCategories\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"suppliers\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"locations\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"coupons\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"discounts\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"reviews\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"memberPosts\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"resources\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"settings\",\n \"label\": \"Store settings\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"siteMembers\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"orders\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Completed orders. Line items COPY a product's `imageUrl` at purchase time, so these would match — and matching would be the wrong answer: an order is an immutable record of what was sold, deleting the asset changes nothing about it, and no author can edit one. A busy store also holds more of these than the whole read budget.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"carts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Live and abandoned carts, with the same copied line-item image and the same reasoning, at higher volume — one document per shopper session.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"checkouts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"In-flight checkout sessions. Transient buyer state carrying the same line-item snapshot as `carts`.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"reservations\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"POS and booking holds. Short-lived transaction rows pointing at a resource that is itself scanned.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"stockHolds\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Inventory holds taken during checkout. Machine-written, short-lived, and a quantity rather than content.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"subscriptions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Site membership subscriptions: a plan pointer, a status and Stripe ids. Server-written from the billing webhook.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"registers\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"POS register allocations — a count against the register add-on, read by billing (AGL-1775). No content field at all.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"giftCards\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Gift card balances and redemption history. Money, not content.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"licenseKeys\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Digital-product license keys issued at fulfilment: a code, an order pointer and a revocation flag.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"inventoryAdjustments\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"The append-only stock adjustment ledger (AGL-2269). One row per manual stock edit and per cancellation release, unbounded over a store's life.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"inventoryReconciliation\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Reconciliation runs comparing counted stock against recorded stock. Machine-written totals.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"restockAlerts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Back-in-stock requests: an email address and a product pointer, written by visitors.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"stripeTaxRates\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Cached Stripe tax rate ids, written by the tax sync. Vendor ids.\"\n },\n {\n \"pluginId\": \"marketplace\",\n \"name\": \"installs\"\n },\n {\n \"pluginId\": \"crm\",\n \"name\": \"leads\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Captured leads, on the same footing as `formSubmissions`: visitor-submitted, unbounded, and never a place an author places an asset.\"\n },\n {\n \"pluginId\": \"email\",\n \"name\": \"suppressions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Unsubscribes, bounces and spam complaints. Email addresses and a reason.\"\n },\n {\n \"pluginId\": \"events-calendar\",\n \"name\": \"events\",\n \"routeSlug\": \"events\"\n },\n {\n \"pluginId\": \"inbox\",\n \"name\": \"formSubmissions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Visitor form submissions. Unbounded, PII-heavy, and a file attached to one is the visitor's upload — not a library asset an author picked, and not something deleting a library asset would break.\"\n },\n {\n \"pluginId\": \"logic\",\n \"name\": \"functions\",\n \"routeSlug\": \"logic\"\n },\n {\n \"pluginId\": \"logic\",\n \"name\": \"variables\",\n \"routeSlug\": \"logic\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"campaigns\",\n \"routeSlug\": \"marketing\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"experiments\",\n \"routeSlug\": \"marketing\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"overlays\",\n \"routeSlug\": \"marketing\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"emailCampaigns\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"The campaign CONTAINER — a name, a date window, the list ids it is aimed at and a topic. Distinct from `campaigns`, which holds the sends and IS scanned because a send carries the copy that went out. A container carries no copy and no asset reference: the design a send renders is a screen, and the screen is where the picker writes.\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"campaignAttributions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"One row per conversion — a form submission, a lead, a contact or a booking — recording which campaign the visitor arrived from. Written only by the Admin SDK, and the whole record is three sanitized UTM strings capped at a hundred characters: there is no field an asset could occupy and no surface that could pick one into it. Unbounded on the same footing as the conversions it credits.\"\n },\n {\n \"pluginId\": \"redirects\",\n \"name\": \"redirects\",\n \"routeSlug\": \"redirects\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"workflows\",\n \"routeSlug\": \"automation\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"webhooks\",\n \"routeSlug\": \"automation\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"actions\",\n \"routeSlug\": \"automation\"\n },\n]\n\n/**\n * Every org capacity a first-party plugin backs, declared by that plugin\n * (AGL-3080). Core owns the money; this says what is counted and what it is\n * called.\n */\nexport const PLUGIN_ORG_CAPACITIES_DECLARED: readonly ResolvedPluginOrgCapacity[] = [\n {\n \"pluginId\": \"data\",\n \"kind\": \"datasets\",\n \"order\": 30,\n \"collection\": \"datasets\",\n \"addonKind\": \"datasets\",\n \"includedEntitlement\": \"datasetsPerOrg\",\n \"nouns\": {\n \"one\": \"dataset\",\n \"many\": \"datasets\",\n \"addon\": \"extra datasets\"\n }\n },\n]\n"],"names":["FIRST_PARTY_PLUGINS","PUBLISHED_SITE_IMPACT","PLUGIN_EDIT_BAR_LINKS","PLUGIN_HOST_COLLECTIONS_DECLARED","PLUGIN_ORG_CAPACITIES_DECLARED"],"mappings":"AAAA;;;;;;;CAOC,GAMD,OAAO,MAAMA,sBAAmD;IAC9D;QACE,MAAM;QACN,SAAS;QACT,YAAY;QACZ,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;YACT,WAAW;YACX,SAAS;gBACP,WAAW;gBACX,QAAQ;YACV;QACF;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;QACX;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;QACf,qBAAqB;QACrB,YAAY;YACV;SACD;IACH;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;Q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ACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;QACb,mBAAmB;IACrB;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;QACb,mBAAmB;IACrB;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;CACD,CAAA;AAED;;;;CAIC,GACD,OAAO,MAAMC,iCAAuE;IAClF;QACE,YAAY;QACZ,QAAQ;QACR,SAAS;QACT,cAAc;QACd,aAAa;QACb,uBAAuB;QACvB,SAAS;YACP,OAAO;YACP,QAAQ;YACR,SAAS;QACX;IACF;CACD,CAAA"}
|
|
@@ -130,6 +130,22 @@ export interface PluginContactCaptureRequest {
|
|
|
130
130
|
* does not blank a title somebody typed.
|
|
131
131
|
*/
|
|
132
132
|
profile?: Readonly<Record<string, unknown>>;
|
|
133
|
+
/**
|
|
134
|
+
* Facts about THIS CAPTURE that the owner models and the platform does not
|
|
135
|
+
* (AGL-3080) — which form was filled in, which page it was on, where the
|
|
136
|
+
* visitor arrived from.
|
|
137
|
+
*
|
|
138
|
+
* Opaque for the reason {@link profile} is: every one of these is a concept
|
|
139
|
+
* belonging to the plugin that keeps people or to the silo that saw it, and
|
|
140
|
+
* a typed core field for each would be those models spelled out in the
|
|
141
|
+
* platform again. `profile` describes the PERSON and outlives the visit;
|
|
142
|
+
* this describes the visit and does not.
|
|
143
|
+
*
|
|
144
|
+
* A key the owner does not recognize is the owner's to ignore, and a silo
|
|
145
|
+
* that sends nothing here loses nothing: every field is an enrichment of a
|
|
146
|
+
* capture that is already complete without it.
|
|
147
|
+
*/
|
|
148
|
+
detail?: Readonly<Record<string, unknown>>;
|
|
133
149
|
}
|
|
134
150
|
/**
|
|
135
151
|
* The owner's answer. `created: false` is a visit by somebody the workspace
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-contact-capture.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 { getRegisteringPluginId } from '../app-utils/registering-plugin'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginServices,\n} from './plugin-services'\n\n/**\n * A person met on a site, handed to whichever plugin keeps people (AGL-3124).\n *\n * Four silos capture the same thing and none of them is the record system: a\n * form submission, a site member signing up, an order, a booking. Each holds\n * an address, a name and the fact that something happened, and each wants the\n * workspace's person record to know. Today each one imports the writer, which\n * makes the highest-fan-in edge in the repo — thirty files in one plugin alone\n * — and makes the record system's plugin something a storefront cannot take a\n * payment without.\n *\n * So the silo stops importing and starts DECLARING: it registers the capture\n * door it owns, and hands a capture to this seam. The plugin that keeps people\n * registers the writer and does every part of the work that is a record\n * system's to do:\n *\n * - normalizing and keying the address, and deciding whether this is a new\n * person or a visit from one the workspace already holds;\n * - the audience band, the erasure rows, and every other refusal — answered,\n * never thrown, so a capture that is refused never costs the silo the order\n * or the submission it was recording;\n * - what a stage, an owner, a company and a tag mean, and what the arrival\n * of a new person sets off.\n *\n * The silo decides none of that. It reports what it saw.\n *\n * ## Why the profile is opaque\n *\n * `profile` is the owner's own field names with scalar values, not a core\n * type. A person's record shape belongs to the plugin that models it, and a\n * typed core shape would be that model spelled in the platform again — which\n * is the defect this seam exists to retire, not a smaller version of it. A key\n * the owner does not document is the owner's to ignore.\n *\n * `source` is the silo's own word for its door, and it is declared rather than\n * enumerated here for the same reason: core listing `form`, `member`, `order`\n * and `booking` would be core holding the plugin set again. A silo registers\n * its source with {@link registerPluginContactSource}, which is what lets a\n * timeline label an entry and a link point back at the thing that captured the\n * person, without the platform knowing what any of them are.\n *\n * ## One writer; many silos\n *\n * A workspace keeps one set of people, so the writer is a slot: a second\n * plugin's writer is refused naming both, and the incumbent keeps serving. A\n * SOURCE is per silo and there are many, but one source word has one owner —\n * two plugins claiming `order` would make the label and the link ambiguous at\n * the point they are read.\n *\n * ## The caller proves who is asking\n *\n * Like `plugin-record-timeline`, the registry authenticates nobody. A silo has\n * already decided, in its own terms and before it asks, that the capture is\n * the workspace's to record — that the submission was accepted, that the order\n * was paid.\n *\n * Server-side: reached by its own subpath, never through\n * `plugin-manager/index.ts`.\n */\n\n/** The person, as the capturing silo saw them. */\nexport interface PluginContactIdentity {\n /**\n * The address they gave. Raw: the owner normalizes and keys on it, and a\n * silo that normalized first would be keeping a second copy of that rule.\n */\n email: unknown\n name?: string | null\n}\n\n/** What happened, in the capturing silo's own words. */\nexport interface PluginContactInteraction {\n /** The silo's declared source word — see {@link registerPluginContactSource}. */\n source: string\n /** When it happened, epoch ms; the owner uses now when absent. */\n atMs?: number\n /**\n * The document it happened on, in the silo's terms\n * (`formSubmissions/{id}`, `orders/{id}`), so a timeline entry can point\n * back at it. Absent where the door leaves nothing to open.\n */\n refId?: string | null\n /** One line a person reads on the timeline. */\n summary?: string | null\n}\n\nexport interface PluginContactCaptureRequest {\n orgId: string\n /** The site the person was met on: the brand whose form or checkout it was. */\n hostId: string\n identity: PluginContactIdentity\n interaction: PluginContactInteraction\n /**\n * An explicit marketing opt-in the capture surface carried, recorded against\n * `hostId`. Absent is not consent, and filing a capture under a campaign is\n * not consent either.\n */\n marketingConsent?: boolean\n /** Tags the silo puts on this capture; the owner adds, never replaces. */\n tags?: readonly string[]\n /** The campaigns the capture SURFACE is filed under — the merchant's own act. */\n campaignIds?: readonly string[]\n /** Money the capture was worth, in cents, where the silo took some. */\n purchaseCents?: number\n /** The currency {@link purchaseCents} is in, lowercase, when the silo knows. */\n purchaseCurrency?: string\n /**\n * The earliest stage this capture describes, in the OWNER's words. A floor\n * and not a value: the owner fills an empty stage and advances an earlier\n * one, and never moves anybody back, so a repeat customer filling in a\n * contact form is still a customer.\n */\n lifecycleFloor?: string\n /**\n * Profile fields the silo knows, keyed by the owner's own field names.\n * Only the keys given are written, so a silo that knows the phone number\n * does not blank a title somebody typed.\n */\n profile?: Readonly<Record<string, unknown>>\n}\n\n/**\n * The owner's answer. `created: false` is a visit by somebody the workspace\n * already held, which is an interaction and not a new person.\n *\n * A refusal is RETURNED. Every one of these silos has already done the thing\n * it was recording, so a throw here would cost an accepted submission or a\n * paid order for a record it could not keep.\n */\nexport type PluginContactCaptured =\n | { ok: true; contactId: string; created: boolean }\n | {\n ok: false\n /**\n * `invalid-email`: nothing usable to key a person on. `band`: the\n * workspace is at the audience it may hold. `erased`: the workspace\n * erased this person and a capture must not quietly rebuild them.\n * `error`: the owner failed, and said so rather than silently.\n */\n reason: 'invalid-email' | 'band' | 'erased' | 'error'\n /** Customer-safe: a caller may show or log it as it stands. */\n error: string\n }\n\nexport interface PluginContactCaptureWriter {\n /** Records one capture; a refusal is returned, never thrown. */\n capture(\n request: PluginContactCaptureRequest,\n ): Promise<PluginContactCaptured>\n}\n\n/** A capture door a silo owns. */\nexport interface PluginContactSourceDeclaration {\n /** The silo's word for the door, as its captures carry it. */\n source: string\n /** What a timeline entry from this door says: `Form submission`. */\n label: string\n /**\n * What a link from that entry says when there is something to open —\n * `Open submission`. Absent where the door leaves nothing to open, which\n * is the honest answer for an import or a by-hand add.\n */\n openLabel?: string\n /**\n * The record kind the silo's own document is, for\n * `plugin-record-routes` to address it with. Absent where the door has no\n * record of its own to open.\n */\n recordKind?: string\n}\n\n/** A source declaration with the silo that made it. */\nexport type ResolvedPluginContactSource = PluginContactSourceDeclaration & {\n pluginId: string\n}\n\nexport const PLUGIN_CONTACT_CAPTURE =\n definePluginServiceContract<PluginContactCaptureWriter>(\n 'core.contact-capture',\n { multiple: false },\n )\n\nexport const PLUGIN_CONTACT_SOURCES =\n definePluginServiceContract<PluginContactSourceDeclaration>(\n 'core.contact-capture-sources',\n { multiple: true },\n )\n\n/**\n * Registers the plugin that keeps people. The owner is the loader's marker\n * when a register fn is running, else `options.pluginId`; with neither the\n * registration throws, and a second plugin's writer is refused naming both —\n * the incumbent keeps serving.\n */\nexport function registerPluginContactCaptureWriter(\n writer: PluginContactCaptureWriter,\n options?: { pluginId?: string },\n): void {\n registerPluginService(PLUGIN_CONTACT_CAPTURE, writer, {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n })\n}\n\n/** Declares a capture door. One source word has one owner. */\nexport function registerPluginContactSource(\n declaration: PluginContactSourceDeclaration,\n options?: { pluginId?: string },\n): void {\n const key = declaration.source?.trim() ?? ''\n if (!key) throw new Error('a contact capture source needs a source word')\n if (!declaration.label?.trim()) {\n throw new Error(`contact capture source \"${key}\" needs a label`)\n }\n const pluginId = (getRegisteringPluginId() ?? options?.pluginId ?? '').trim()\n const incumbent = resolvePluginServices(PLUGIN_CONTACT_SOURCES).find(\n (entry) => entry.key === key,\n )\n if (incumbent && pluginId && incumbent.pluginId !== pluginId) {\n throw new Error(\n `contact capture source \"${key}\" is already declared by ` +\n `\"${incumbent.pluginId}\"; refused \"${pluginId}\"`,\n )\n }\n registerPluginService(\n PLUGIN_CONTACT_SOURCES,\n { ...declaration, source: key },\n {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n key,\n },\n )\n}\n\nexport interface ResolvedPluginContactCaptureWriter {\n /** The plugin that keeps people. */\n pluginId: string\n writer: PluginContactCaptureWriter\n}\n\n/** The writer with its owner, or `null` when no plugin keeps people here. */\nexport function pluginContactCaptureWriter(): ResolvedPluginContactCaptureWriter | null {\n const entry = resolvePluginServices(PLUGIN_CONTACT_CAPTURE)[0]\n return entry ? { pluginId: entry.pluginId, writer: entry.impl } : null\n}\n\n/**\n * Hands one capture to the plugin that keeps people, or answers `null` when\n * no plugin does.\n *\n * `null` and a refusal are different answers and a silo treats them\n * differently: `null` is a workspace with no record system, where there is\n * nothing to record and nothing has gone wrong; a refusal is a record system\n * that considered this person and declined.\n */\nexport async function capturePluginContact(\n request: PluginContactCaptureRequest,\n): Promise<PluginContactCaptured | null> {\n const found = pluginContactCaptureWriter()\n if (!found) return null\n return found.writer.capture(request)\n}\n\n/** Every declared capture door, with its silo, in registration order. */\nexport function listPluginContactSources(): ResolvedPluginContactSource[] {\n return resolvePluginServices(PLUGIN_CONTACT_SOURCES).map((entry) => ({\n ...entry.impl,\n pluginId: entry.pluginId,\n }))\n}\n\n/** One declared capture door by its source word, or `null`. */\nexport function pluginContactSource(\n source: string,\n): ResolvedPluginContactSource | null {\n const key = source.trim()\n const entry = resolvePluginServices(PLUGIN_CONTACT_SOURCES).find(\n (one) => one.key === key,\n )\n return entry ? { ...entry.impl, pluginId: entry.pluginId } : null\n}\n"],"names":["getRegisteringPluginId","definePluginServiceContract","registerPluginService","resolvePluginServices","PLUGIN_CONTACT_CAPTURE","multiple","PLUGIN_CONTACT_SOURCES","registerPluginContactCaptureWriter","writer","options","pluginId","registerPluginContactSource","declaration","key","source","trim","Error","label","incumbent","find","entry","pluginContactCaptureWriter","impl","capturePluginContact","request","found","capture","listPluginContactSources","map","pluginContactSource","one"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,sBAAsB,QAAQ,qCAAiC;AACxE,SACEC,2BAA2B,EAC3BC,qBAAqB,EACrBC,qBAAqB,QAChB,uBAAmB;AAkL1B,OAAO,MAAMC,yBACXH,4BACE,wBACA;IAAEI,UAAU;AAAM,GACnB;AAEH,OAAO,MAAMC,yBACXL,4BACE,gCACA;IAAEI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;QAAEV,UAAUU,MAAMV,QAAQ;QAAEF,QAAQY,MAAME,IAAI;IAAC,IAAI;AACpE;AAEA;;;;;;;;CAQC,GACD,OAAO,eAAeC,qBACpBC,OAAoC;IAEpC,MAAMC,QAAQJ;IACd,IAAI,CAACI,OAAO,OAAO;IACnB,OAAOA,MAAMjB,MAAM,CAACkB,OAAO,CAACF;AAC9B;AAEA,uEAAuE,GACvE,OAAO,SAASG;IACd,OAAOxB,sBAAsBG,wBAAwBsB,GAAG,CAAC,CAACR,QAAW,aAChEA,MAAME,IAAI;YACbZ,UAAUU,MAAMV,QAAQ;;AAE5B;AAEA,6DAA6D,GAC7D,OAAO,SAASmB,oBACdf,MAAc;IAEd,MAAMD,MAAMC,OAAOC,IAAI;IACvB,MAAMK,QAAQjB,sBAAsBG,wBAAwBa,IAAI,CAC9D,CAACW,MAAQA,IAAIjB,GAAG,KAAKA;IAEvB,OAAOO,QAAQ,aAAKA,MAAME,IAAI;QAAEZ,UAAUU,MAAMV,QAAQ;SAAK;AAC/D"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-contact-capture.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 { getRegisteringPluginId } from '../app-utils/registering-plugin'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginServices,\n} from './plugin-services'\n\n/**\n * A person met on a site, handed to whichever plugin keeps people (AGL-3124).\n *\n * Four silos capture the same thing and none of them is the record system: a\n * form submission, a site member signing up, an order, a booking. Each holds\n * an address, a name and the fact that something happened, and each wants the\n * workspace's person record to know. Today each one imports the writer, which\n * makes the highest-fan-in edge in the repo — thirty files in one plugin alone\n * — and makes the record system's plugin something a storefront cannot take a\n * payment without.\n *\n * So the silo stops importing and starts DECLARING: it registers the capture\n * door it owns, and hands a capture to this seam. The plugin that keeps people\n * registers the writer and does every part of the work that is a record\n * system's to do:\n *\n * - normalizing and keying the address, and deciding whether this is a new\n * person or a visit from one the workspace already holds;\n * - the audience band, the erasure rows, and every other refusal — answered,\n * never thrown, so a capture that is refused never costs the silo the order\n * or the submission it was recording;\n * - what a stage, an owner, a company and a tag mean, and what the arrival\n * of a new person sets off.\n *\n * The silo decides none of that. It reports what it saw.\n *\n * ## Why the profile is opaque\n *\n * `profile` is the owner's own field names with scalar values, not a core\n * type. A person's record shape belongs to the plugin that models it, and a\n * typed core shape would be that model spelled in the platform again — which\n * is the defect this seam exists to retire, not a smaller version of it. A key\n * the owner does not document is the owner's to ignore.\n *\n * `source` is the silo's own word for its door, and it is declared rather than\n * enumerated here for the same reason: core listing `form`, `member`, `order`\n * and `booking` would be core holding the plugin set again. A silo registers\n * its source with {@link registerPluginContactSource}, which is what lets a\n * timeline label an entry and a link point back at the thing that captured the\n * person, without the platform knowing what any of them are.\n *\n * ## One writer; many silos\n *\n * A workspace keeps one set of people, so the writer is a slot: a second\n * plugin's writer is refused naming both, and the incumbent keeps serving. A\n * SOURCE is per silo and there are many, but one source word has one owner —\n * two plugins claiming `order` would make the label and the link ambiguous at\n * the point they are read.\n *\n * ## The caller proves who is asking\n *\n * Like `plugin-record-timeline`, the registry authenticates nobody. A silo has\n * already decided, in its own terms and before it asks, that the capture is\n * the workspace's to record — that the submission was accepted, that the order\n * was paid.\n *\n * Server-side: reached by its own subpath, never through\n * `plugin-manager/index.ts`.\n */\n\n/** The person, as the capturing silo saw them. */\nexport interface PluginContactIdentity {\n /**\n * The address they gave. Raw: the owner normalizes and keys on it, and a\n * silo that normalized first would be keeping a second copy of that rule.\n */\n email: unknown\n name?: string | null\n}\n\n/** What happened, in the capturing silo's own words. */\nexport interface PluginContactInteraction {\n /** The silo's declared source word — see {@link registerPluginContactSource}. */\n source: string\n /** When it happened, epoch ms; the owner uses now when absent. */\n atMs?: number\n /**\n * The document it happened on, in the silo's terms\n * (`formSubmissions/{id}`, `orders/{id}`), so a timeline entry can point\n * back at it. Absent where the door leaves nothing to open.\n */\n refId?: string | null\n /** One line a person reads on the timeline. */\n summary?: string | null\n}\n\nexport interface PluginContactCaptureRequest {\n orgId: string\n /** The site the person was met on: the brand whose form or checkout it was. */\n hostId: string\n identity: PluginContactIdentity\n interaction: PluginContactInteraction\n /**\n * An explicit marketing opt-in the capture surface carried, recorded against\n * `hostId`. Absent is not consent, and filing a capture under a campaign is\n * not consent either.\n */\n marketingConsent?: boolean\n /** Tags the silo puts on this capture; the owner adds, never replaces. */\n tags?: readonly string[]\n /** The campaigns the capture SURFACE is filed under — the merchant's own act. */\n campaignIds?: readonly string[]\n /** Money the capture was worth, in cents, where the silo took some. */\n purchaseCents?: number\n /** The currency {@link purchaseCents} is in, lowercase, when the silo knows. */\n purchaseCurrency?: string\n /**\n * The earliest stage this capture describes, in the OWNER's words. A floor\n * and not a value: the owner fills an empty stage and advances an earlier\n * one, and never moves anybody back, so a repeat customer filling in a\n * contact form is still a customer.\n */\n lifecycleFloor?: string\n /**\n * Profile fields the silo knows, keyed by the owner's own field names.\n * Only the keys given are written, so a silo that knows the phone number\n * does not blank a title somebody typed.\n */\n profile?: Readonly<Record<string, unknown>>\n /**\n * Facts about THIS CAPTURE that the owner models and the platform does not\n * (AGL-3080) — which form was filled in, which page it was on, where the\n * visitor arrived from.\n *\n * Opaque for the reason {@link profile} is: every one of these is a concept\n * belonging to the plugin that keeps people or to the silo that saw it, and\n * a typed core field for each would be those models spelled out in the\n * platform again. `profile` describes the PERSON and outlives the visit;\n * this describes the visit and does not.\n *\n * A key the owner does not recognize is the owner's to ignore, and a silo\n * that sends nothing here loses nothing: every field is an enrichment of a\n * capture that is already complete without it.\n */\n detail?: Readonly<Record<string, unknown>>\n}\n\n/**\n * The owner's answer. `created: false` is a visit by somebody the workspace\n * already held, which is an interaction and not a new person.\n *\n * A refusal is RETURNED. Every one of these silos has already done the thing\n * it was recording, so a throw here would cost an accepted submission or a\n * paid order for a record it could not keep.\n */\nexport type PluginContactCaptured =\n | { ok: true; contactId: string; created: boolean }\n | {\n ok: false\n /**\n * `invalid-email`: nothing usable to key a person on. `band`: the\n * workspace is at the audience it may hold. `erased`: the workspace\n * erased this person and a capture must not quietly rebuild them.\n * `error`: the owner failed, and said so rather than silently.\n */\n reason: 'invalid-email' | 'band' | 'erased' | 'error'\n /** Customer-safe: a caller may show or log it as it stands. */\n error: string\n }\n\nexport interface PluginContactCaptureWriter {\n /** Records one capture; a refusal is returned, never thrown. */\n capture(\n request: PluginContactCaptureRequest,\n ): Promise<PluginContactCaptured>\n}\n\n/** A capture door a silo owns. */\nexport interface PluginContactSourceDeclaration {\n /** The silo's word for the door, as its captures carry it. */\n source: string\n /** What a timeline entry from this door says: `Form submission`. */\n label: string\n /**\n * What a link from that entry says when there is something to open —\n * `Open submission`. Absent where the door leaves nothing to open, which\n * is the honest answer for an import or a by-hand add.\n */\n openLabel?: string\n /**\n * The record kind the silo's own document is, for\n * `plugin-record-routes` to address it with. Absent where the door has no\n * record of its own to open.\n */\n recordKind?: string\n}\n\n/** A source declaration with the silo that made it. */\nexport type ResolvedPluginContactSource = PluginContactSourceDeclaration & {\n pluginId: string\n}\n\nexport const PLUGIN_CONTACT_CAPTURE =\n definePluginServiceContract<PluginContactCaptureWriter>(\n 'core.contact-capture',\n { multiple: false },\n )\n\nexport const PLUGIN_CONTACT_SOURCES =\n definePluginServiceContract<PluginContactSourceDeclaration>(\n 'core.contact-capture-sources',\n { multiple: true },\n )\n\n/**\n * Registers the plugin that keeps people. The owner is the loader's marker\n * when a register fn is running, else `options.pluginId`; with neither the\n * registration throws, and a second plugin's writer is refused naming both —\n * the incumbent keeps serving.\n */\nexport function registerPluginContactCaptureWriter(\n writer: PluginContactCaptureWriter,\n options?: { pluginId?: string },\n): void {\n registerPluginService(PLUGIN_CONTACT_CAPTURE, writer, {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n })\n}\n\n/** Declares a capture door. One source word has one owner. */\nexport function registerPluginContactSource(\n declaration: PluginContactSourceDeclaration,\n options?: { pluginId?: string },\n): void {\n const key = declaration.source?.trim() ?? ''\n if (!key) throw new Error('a contact capture source needs a source word')\n if (!declaration.label?.trim()) {\n throw new Error(`contact capture source \"${key}\" needs a label`)\n }\n const pluginId = (getRegisteringPluginId() ?? options?.pluginId ?? '').trim()\n const incumbent = resolvePluginServices(PLUGIN_CONTACT_SOURCES).find(\n (entry) => entry.key === key,\n )\n if (incumbent && pluginId && incumbent.pluginId !== pluginId) {\n throw new Error(\n `contact capture source \"${key}\" is already declared by ` +\n `\"${incumbent.pluginId}\"; refused \"${pluginId}\"`,\n )\n }\n registerPluginService(\n PLUGIN_CONTACT_SOURCES,\n { ...declaration, source: key },\n {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n key,\n },\n )\n}\n\nexport interface ResolvedPluginContactCaptureWriter {\n /** The plugin that keeps people. */\n pluginId: string\n writer: PluginContactCaptureWriter\n}\n\n/** The writer with its owner, or `null` when no plugin keeps people here. */\nexport function pluginContactCaptureWriter(): ResolvedPluginContactCaptureWriter | null {\n const entry = resolvePluginServices(PLUGIN_CONTACT_CAPTURE)[0]\n return entry ? { pluginId: entry.pluginId, writer: entry.impl } : null\n}\n\n/**\n * Hands one capture to the plugin that keeps people, or answers `null` when\n * no plugin does.\n *\n * `null` and a refusal are different answers and a silo treats them\n * differently: `null` is a workspace with no record system, where there is\n * nothing to record and nothing has gone wrong; a refusal is a record system\n * that considered this person and declined.\n */\nexport async function capturePluginContact(\n request: PluginContactCaptureRequest,\n): Promise<PluginContactCaptured | null> {\n const found = pluginContactCaptureWriter()\n if (!found) return null\n return found.writer.capture(request)\n}\n\n/** Every declared capture door, with its silo, in registration order. */\nexport function listPluginContactSources(): ResolvedPluginContactSource[] {\n return resolvePluginServices(PLUGIN_CONTACT_SOURCES).map((entry) => ({\n ...entry.impl,\n pluginId: entry.pluginId,\n }))\n}\n\n/** One declared capture door by its source word, or `null`. */\nexport function pluginContactSource(\n source: string,\n): ResolvedPluginContactSource | null {\n const key = source.trim()\n const entry = resolvePluginServices(PLUGIN_CONTACT_SOURCES).find(\n (one) => one.key === key,\n )\n return entry ? { ...entry.impl, pluginId: entry.pluginId } : null\n}\n"],"names":["getRegisteringPluginId","definePluginServiceContract","registerPluginService","resolvePluginServices","PLUGIN_CONTACT_CAPTURE","multiple","PLUGIN_CONTACT_SOURCES","registerPluginContactCaptureWriter","writer","options","pluginId","registerPluginContactSource","declaration","key","source","trim","Error","label","incumbent","find","entry","pluginContactCaptureWriter","impl","capturePluginContact","request","found","capture","listPluginContactSources","map","pluginContactSource","one"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,sBAAsB,QAAQ,qCAAiC;AACxE,SACEC,2BAA2B,EAC3BC,qBAAqB,EACrBC,qBAAqB,QAChB,uBAAmB;AAkM1B,OAAO,MAAMC,yBACXH,4BACE,wBACA;IAAEI,UAAU;AAAM,GACnB;AAEH,OAAO,MAAMC,yBACXL,4BACE,gCACA;IAAEI,UAAU;AAAK,GAClB;AAEH;;;;;CAKC,GACD,OAAO,SAASE,mCACdC,MAAkC,EAClCC,OAA+B;IAE/BP,sBAAsBE,wBAAwBI,QAAQ,aAChDC,CAAAA,2BAAAA,QAASC,QAAQ,IAAG;QAAEA,UAAUD,QAAQC,QAAQ;IAAC,IAAI,CAAC;AAE9D;AAEA,4DAA4D,GAC5D,OAAO,SAASC,4BACdC,WAA2C,EAC3CH,OAA+B;cAObT,OAAAA;QALNY,qBAEPA;IAFL,MAAMC,eAAMD,sBAAAA,YAAYE,MAAM,qBAAlBF,oBAAoBG,IAAI,qBAAM;IAC1C,IAAI,CAACF,KAAK,MAAM,IAAIG,MAAM;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,MAAc;IAEd,MAAMD,MAAMC,OAAOC,IAAI;IACvB,MAAMK,QAAQjB,sBAAsBG,wBAAwBa,IAAI,CAC9D,CAACW,MAAQA,IAAIjB,GAAG,KAAKA;IAEvB,OAAOO,QAAQ,aAAKA,MAAME,IAAI;QAAEZ,UAAUU,MAAMV,QAAQ;SAAK;AAC/D"}
|
|
@@ -56,6 +56,22 @@
|
|
|
56
56
|
* refused naming both, and the incumbent keeps it; the same plugin declaring
|
|
57
57
|
* again replaces its own.
|
|
58
58
|
*
|
|
59
|
+
* ## Declared in the config, not registered at boot (AGL-3080)
|
|
60
|
+
*
|
|
61
|
+
* A first-party plugin declares its collections in `plugins.config.json` and
|
|
62
|
+
* the generator compiles them, so every reader has the whole list the moment
|
|
63
|
+
* it imports this module. That is not a preference: the media scan answers
|
|
64
|
+
* "what uses this asset" in the moment before an author deletes it, every way
|
|
65
|
+
* it can be wrong points at "unused", and it runs inside a console request
|
|
66
|
+
* that loads no plugin code. A registry that request had not filled would
|
|
67
|
+
* report every plugin-owned document as holding nothing, with nothing red —
|
|
68
|
+
* the shape of AGL-3025, on the one answer here that somebody acts on.
|
|
69
|
+
*
|
|
70
|
+
* {@link registerPluginHostCollections} is still the door for a plugin the
|
|
71
|
+
* compiler never sees, and the two compose: the compiled rows are a floor a
|
|
72
|
+
* registration cannot lower, and a registration naming a compiled collection
|
|
73
|
+
* is refused the same way a second plugin's would be.
|
|
74
|
+
*
|
|
59
75
|
* Reached by its own subpath rather than through `plugin-manager/index.ts`:
|
|
60
76
|
* the readers are the media scan, the console counters and the reference
|
|
61
77
|
* rows, none of which a published page renders.
|
|
@@ -112,7 +128,10 @@ export declare const PLUGIN_HOST_COLLECTIONS: import("./plugin-services").Plugin
|
|
|
112
128
|
export declare function registerPluginHostCollections(collections: readonly PluginHostCollectionDeclaration[], options?: {
|
|
113
129
|
pluginId?: string;
|
|
114
130
|
}): void;
|
|
115
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Every declared collection, with its owner: the compiled rows first, then
|
|
133
|
+
* anything registered at runtime that they do not already name.
|
|
134
|
+
*/
|
|
116
135
|
export declare function listPluginHostCollections(): ResolvedPluginHostCollection[];
|
|
117
136
|
/** One declared collection by name, with its owner, or `null`. */
|
|
118
137
|
export declare function pluginHostCollection(name: string): ResolvedPluginHostCollection | null;
|
|
@@ -138,9 +157,12 @@ export declare function pluginHostCollectionsExcludedFromMediaScan(): Array<{
|
|
|
138
157
|
export declare function pluginHostArtifactCollections(): string[];
|
|
139
158
|
/**
|
|
140
159
|
* What to call one of a collection's documents in a reference row: the
|
|
141
|
-
* declared label, else
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
160
|
+
* declared label, else core's own derivation from the name.
|
|
161
|
+
*
|
|
162
|
+
* The derivation is `hostContentCollectionLabel` rather than a second copy of
|
|
163
|
+
* it, because a reference row does not know or care whether the collection it
|
|
164
|
+
* names belongs to a plugin — two spellings of "Product category" reachable
|
|
165
|
+
* by two paths is the kind of difference nobody notices until a screenshot
|
|
166
|
+
* disagrees with a test.
|
|
145
167
|
*/
|
|
146
168
|
export declare function pluginHostCollectionLabel(name: string): string;
|
|
@@ -15,6 +15,8 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/ import { getRegisteringPluginId } from "../app-utils/registering-plugin.js";
|
|
18
|
+
import { hostContentCollectionLabel } from "../foundation/definitions/host-content-collections.js";
|
|
19
|
+
import { PLUGIN_HOST_COLLECTIONS_DECLARED } from "./first-party-plugins.generated.js";
|
|
18
20
|
import { definePluginServiceContract, registerPluginService, resolvePluginServices } from "./plugin-services.js";
|
|
19
21
|
export const PLUGIN_HOST_COLLECTIONS = definePluginServiceContract('core.host-collections', {
|
|
20
22
|
multiple: true
|
|
@@ -37,7 +39,7 @@ export const PLUGIN_HOST_COLLECTIONS = definePluginServiceContract('core.host-co
|
|
|
37
39
|
if (declaration.mediaScan === 'none' && !((_declaration_mediaScanReason = declaration.mediaScanReason) == null ? void 0 : _declaration_mediaScanReason.trim())) {
|
|
38
40
|
throw new Error(`host collection "${name}" is not scanned for media and says no ` + 'reason: mediaScanReason has to name what scanning would cost, or ' + 'what it would get wrong');
|
|
39
41
|
}
|
|
40
|
-
const incumbent =
|
|
42
|
+
const incumbent = pluginHostCollection(name);
|
|
41
43
|
if (incumbent && pluginId && incumbent.pluginId !== pluginId) {
|
|
42
44
|
throw new Error(`host collection "${name}" is already declared by ` + `"${incumbent.pluginId}"; refused "${pluginId}"`);
|
|
43
45
|
}
|
|
@@ -53,17 +55,24 @@ export const PLUGIN_HOST_COLLECTIONS = definePluginServiceContract('core.host-co
|
|
|
53
55
|
}));
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Every declared collection, with its owner: the compiled rows first, then
|
|
60
|
+
* anything registered at runtime that they do not already name.
|
|
61
|
+
*/ export function listPluginHostCollections() {
|
|
62
|
+
const compiled = PLUGIN_HOST_COLLECTIONS_DECLARED.map((row)=>_extends({}, row));
|
|
63
|
+
const named = new Set(compiled.map((row)=>row.name));
|
|
64
|
+
const registered = resolvePluginServices(PLUGIN_HOST_COLLECTIONS).map((entry)=>_extends({}, entry.impl, {
|
|
58
65
|
pluginId: entry.pluginId
|
|
59
|
-
}));
|
|
66
|
+
})).filter((row)=>!named.has(row.name));
|
|
67
|
+
return [
|
|
68
|
+
...compiled,
|
|
69
|
+
...registered
|
|
70
|
+
];
|
|
60
71
|
}
|
|
61
72
|
/** One declared collection by name, with its owner, or `null`. */ export function pluginHostCollection(name) {
|
|
73
|
+
var _listPluginHostCollections_find;
|
|
62
74
|
const key = name.trim();
|
|
63
|
-
|
|
64
|
-
return entry ? _extends({}, entry.impl, {
|
|
65
|
-
pluginId: entry.pluginId
|
|
66
|
-
}) : null;
|
|
75
|
+
return (_listPluginHostCollections_find = listPluginHostCollections().find((one)=>one.name === key)) != null ? _listPluginHostCollections_find : null;
|
|
67
76
|
}
|
|
68
77
|
/** The plugin that owns a collection, or `undefined` when none declares it. */ export function pluginIdForHostCollection(name) {
|
|
69
78
|
var _pluginHostCollection;
|
|
@@ -100,17 +109,17 @@ export const PLUGIN_HOST_COLLECTIONS = definePluginServiceContract('core.host-co
|
|
|
100
109
|
}
|
|
101
110
|
/**
|
|
102
111
|
* What to call one of a collection's documents in a reference row: the
|
|
103
|
-
* declared label, else
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
112
|
+
* declared label, else core's own derivation from the name.
|
|
113
|
+
*
|
|
114
|
+
* The derivation is `hostContentCollectionLabel` rather than a second copy of
|
|
115
|
+
* it, because a reference row does not know or care whether the collection it
|
|
116
|
+
* names belongs to a plugin — two spellings of "Product category" reachable
|
|
117
|
+
* by two paths is the kind of difference nobody notices until a screenshot
|
|
118
|
+
* disagrees with a test.
|
|
107
119
|
*/ export function pluginHostCollectionLabel(name) {
|
|
108
120
|
var _pluginHostCollection_label, _pluginHostCollection;
|
|
109
121
|
const declared = (_pluginHostCollection = pluginHostCollection(name)) == null ? void 0 : (_pluginHostCollection_label = _pluginHostCollection.label) == null ? void 0 : _pluginHostCollection_label.trim();
|
|
110
|
-
|
|
111
|
-
const singular = /ies$/.test(name) ? name.replace(/ies$/, 'y') : /(ss|s)$/.test(name) ? name.replace(/s$/, '') : name;
|
|
112
|
-
const spaced = singular.replace(/([a-z0-9])([A-Z])/g, '$1 $2').toLowerCase();
|
|
113
|
-
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
|
122
|
+
return declared || hostContentCollectionLabel(name);
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
//# sourceMappingURL=plugin-host-collections.js.map
|