@aglyn/aglyn 1.0.0-beta.218 → 1.0.0-beta.220
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 +12 -12
- package/src/lib/app-utils/actions.d.ts +26 -433
- package/src/lib/app-utils/actions.js +108 -633
- package/src/lib/app-utils/actions.js.map +1 -1
- package/src/lib/app-utils/activity-presenter.d.ts +3 -3
- package/src/lib/app-utils/activity-presenter.js +36 -52
- package/src/lib/app-utils/activity-presenter.js.map +1 -1
- package/src/lib/app-utils/analytics-events.d.ts +1 -1
- package/src/lib/app-utils/analytics-events.js.map +1 -1
- package/src/lib/app-utils/analytics-provider.d.ts +182 -0
- package/src/lib/app-utils/analytics-provider.js +133 -0
- package/src/lib/app-utils/analytics-provider.js.map +1 -0
- package/src/lib/app-utils/api-plugins.d.ts +46 -0
- package/src/lib/app-utils/api-plugins.js +19 -0
- package/src/lib/app-utils/api-plugins.js.map +1 -1
- package/src/lib/app-utils/{marketplace-overrides.d.ts → artifact-overrides.d.ts} +9 -6
- package/src/lib/app-utils/{marketplace-overrides.js → artifact-overrides.js} +10 -7
- package/src/lib/app-utils/artifact-overrides.js.map +1 -0
- package/src/lib/app-utils/{marketplace-provenance.d.ts → artifact-provenance.d.ts} +12 -10
- package/src/lib/app-utils/{marketplace-provenance.js → artifact-provenance.js} +9 -7
- package/src/lib/app-utils/artifact-provenance.js.map +1 -0
- package/src/lib/app-utils/binding-token-catalog.d.ts +5 -13
- package/src/lib/app-utils/binding-token-catalog.js +17 -41
- package/src/lib/app-utils/binding-token-catalog.js.map +1 -1
- package/src/lib/app-utils/brand-support-line.d.ts +36 -0
- package/src/lib/app-utils/brand-support-line.js +38 -0
- package/src/lib/app-utils/brand-support-line.js.map +1 -0
- package/src/lib/app-utils/collection-entries.d.ts +2 -2
- package/src/lib/app-utils/collection-entries.js.map +1 -1
- package/src/lib/app-utils/consent-group-change.d.ts +4 -0
- package/src/lib/app-utils/consent-group-change.js.map +1 -1
- package/src/lib/app-utils/consent-groups.d.ts +1 -1
- package/src/lib/app-utils/consent-groups.js.map +1 -1
- package/src/lib/app-utils/console-routes.d.ts +15 -42
- package/src/lib/app-utils/console-routes.js +10 -39
- package/src/lib/app-utils/console-routes.js.map +1 -1
- package/src/lib/app-utils/contacts.d.ts +24 -2
- package/src/lib/app-utils/contacts.js +21 -5
- package/src/lib/app-utils/contacts.js.map +1 -1
- package/src/lib/app-utils/container-membership.d.ts +93 -0
- package/src/lib/app-utils/container-membership.js +165 -0
- package/src/lib/app-utils/container-membership.js.map +1 -0
- package/src/lib/app-utils/crm-task-reminders.d.ts +23 -6
- package/src/lib/app-utils/crm-task-reminders.js +32 -11
- package/src/lib/app-utils/crm-task-reminders.js.map +1 -1
- package/src/lib/app-utils/crm.d.ts +24 -4
- package/src/lib/app-utils/crm.js +23 -0
- package/src/lib/app-utils/crm.js.map +1 -1
- package/src/lib/app-utils/cross-pool-desync.d.ts +39 -0
- package/src/lib/app-utils/cross-pool-desync.js +47 -0
- package/src/lib/app-utils/cross-pool-desync.js.map +1 -0
- package/src/lib/app-utils/csv-upload.d.ts +29 -0
- package/src/lib/app-utils/csv-upload.js +29 -0
- package/src/lib/app-utils/csv-upload.js.map +1 -0
- package/src/lib/app-utils/{dataset-csv.d.ts → csv.d.ts} +10 -43
- package/src/lib/app-utils/{dataset-csv.js → csv.js} +10 -81
- package/src/lib/app-utils/csv.js.map +1 -0
- package/src/lib/app-utils/dataset-models.d.ts +5 -5
- package/src/lib/app-utils/dataset-models.js +19 -2
- package/src/lib/app-utils/dataset-models.js.map +1 -1
- package/src/lib/app-utils/datasets.d.ts +65 -30
- package/src/lib/app-utils/datasets.js +74 -24
- package/src/lib/app-utils/datasets.js.map +1 -1
- package/src/lib/app-utils/docs-deflection.d.ts +6 -6
- package/src/lib/app-utils/docs-deflection.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.d.ts +14 -8
- package/src/lib/app-utils/docs-help.generated.js +23 -6
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.d.ts +2 -2
- package/src/lib/app-utils/docs-index.generated.js +570 -346
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/docs-retrieval.d.ts +3 -3
- package/src/lib/app-utils/docs-retrieval.js +14 -10
- package/src/lib/app-utils/docs-retrieval.js.map +1 -1
- package/src/lib/app-utils/duplicate-resource.d.ts +4 -1
- package/src/lib/app-utils/duplicate-resource.js +7 -4
- package/src/lib/app-utils/duplicate-resource.js.map +1 -1
- package/src/lib/app-utils/dynamic-list-rule.d.ts +1 -1
- package/src/lib/app-utils/dynamic-list-rule.js +3 -3
- package/src/lib/app-utils/dynamic-list-rule.js.map +1 -1
- package/src/lib/app-utils/element-ui.d.ts +1 -1
- package/src/lib/app-utils/element-ui.js +1 -1
- package/src/lib/app-utils/element-ui.js.map +1 -1
- package/src/lib/app-utils/email-starter-policy.js +3 -3
- package/src/lib/app-utils/email-starter-policy.js.map +1 -1
- package/src/lib/app-utils/email-text.d.ts +80 -0
- package/src/lib/app-utils/email-text.js +189 -0
- package/src/lib/app-utils/email-text.js.map +1 -0
- package/src/lib/app-utils/{list-assignment-policy.d.ts → enrollment-basis.d.ts} +4 -0
- package/src/lib/app-utils/{list-assignment-policy.js → enrollment-basis.js} +5 -1
- package/src/lib/app-utils/enrollment-basis.js.map +1 -0
- package/src/lib/app-utils/entity-picker-context.d.ts +10 -5
- package/src/lib/app-utils/entity-picker-context.js.map +1 -1
- package/src/lib/app-utils/error-beacon.d.ts +75 -6
- package/src/lib/app-utils/error-beacon.js +160 -21
- package/src/lib/app-utils/error-beacon.js.map +1 -1
- package/src/lib/app-utils/expand-repeatables.d.ts +10 -10
- package/src/lib/app-utils/expand-repeatables.js +14 -14
- package/src/lib/app-utils/expand-repeatables.js.map +1 -1
- package/src/lib/app-utils/forms.js +2 -2
- package/src/lib/app-utils/forms.js.map +1 -1
- package/src/lib/app-utils/health-report.d.ts +2 -3
- package/src/lib/app-utils/health-report.js +8 -6
- package/src/lib/app-utils/health-report.js.map +1 -1
- package/src/lib/app-utils/host-events.d.ts +82 -0
- package/src/lib/app-utils/host-events.js +62 -0
- package/src/lib/app-utils/host-events.js.map +1 -0
- package/src/lib/app-utils/inbound-mail-domain.d.ts +27 -0
- package/src/lib/app-utils/inbound-mail-domain.js +31 -0
- package/src/lib/app-utils/inbound-mail-domain.js.map +1 -0
- package/src/lib/app-utils/lockdown.d.ts +11 -0
- package/src/lib/app-utils/lockdown.js +33 -3
- package/src/lib/app-utils/lockdown.js.map +1 -1
- package/src/lib/app-utils/margin-utilization.d.ts +4 -69
- package/src/lib/app-utils/margin-utilization.js +82 -69
- package/src/lib/app-utils/margin-utilization.js.map +1 -1
- package/src/lib/app-utils/member-email-aliases.d.ts +25 -0
- package/src/lib/app-utils/member-email-aliases.js +29 -0
- package/src/lib/app-utils/member-email-aliases.js.map +1 -1
- package/src/lib/app-utils/node-definition-sanitizer.d.ts +16 -16
- package/src/lib/app-utils/node-definition-sanitizer.js +24 -20
- package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -1
- package/src/lib/app-utils/node-interactions.d.ts +7 -7
- package/src/lib/app-utils/node-interactions.js.map +1 -1
- package/src/lib/app-utils/notifications.d.ts +147 -47
- package/src/lib/app-utils/notifications.js +182 -44
- package/src/lib/app-utils/notifications.js.map +1 -1
- package/src/lib/app-utils/operator-alerts.d.ts +15 -1
- package/src/lib/app-utils/operator-alerts.js +47 -10
- package/src/lib/app-utils/operator-alerts.js.map +1 -1
- package/src/lib/app-utils/payments-configured.d.ts +8 -21
- package/src/lib/app-utils/payments-configured.js +8 -23
- package/src/lib/app-utils/payments-configured.js.map +1 -1
- package/src/lib/app-utils/plan-entitlements.d.ts +207 -306
- package/src/lib/app-utils/plan-entitlements.js +345 -528
- package/src/lib/app-utils/plan-entitlements.js.map +1 -1
- package/src/lib/app-utils/platform-brand.d.ts +10 -0
- package/src/lib/app-utils/platform-brand.js +14 -3
- package/src/lib/app-utils/platform-brand.js.map +1 -1
- package/src/lib/app-utils/platform-marketing-consent.d.ts +56 -2
- package/src/lib/app-utils/platform-marketing-consent.js +6 -5
- package/src/lib/app-utils/platform-marketing-consent.js.map +1 -1
- package/src/lib/app-utils/plugin-api-rate-limit.d.ts +7 -1
- package/src/lib/app-utils/plugin-api-rate-limit.js +11 -3
- package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -1
- package/src/lib/app-utils/plugin-bundle-checks.js +2 -2
- package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -1
- package/src/lib/app-utils/plugin-host-events.generated.d.ts +12 -0
- package/src/lib/app-utils/plugin-host-events.generated.js +169 -0
- package/src/lib/app-utils/plugin-host-events.generated.js.map +1 -0
- package/src/lib/app-utils/plugin-release-flags.generated.d.ts +12 -0
- package/src/lib/app-utils/plugin-release-flags.generated.js +106 -0
- package/src/lib/app-utils/plugin-release-flags.generated.js.map +1 -0
- package/src/lib/app-utils/plugin-starter-templates.generated.d.ts +12 -0
- package/src/lib/app-utils/plugin-starter-templates.generated.js +711 -0
- package/src/lib/app-utils/plugin-starter-templates.generated.js.map +1 -0
- package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
- package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
- package/src/lib/app-utils/release-flags.d.ts +14 -5
- package/src/lib/app-utils/release-flags.js +21 -125
- package/src/lib/app-utils/release-flags.js.map +1 -1
- package/src/lib/app-utils/repeat-query.d.ts +56 -0
- package/src/lib/app-utils/{dataset-query.js → repeat-query.js} +16 -16
- package/src/lib/app-utils/repeat-query.js.map +1 -0
- package/src/lib/app-utils/repeat-sources.d.ts +9 -0
- package/src/lib/app-utils/repeat-sources.js.map +1 -1
- package/src/lib/app-utils/retained-refusals.d.ts +73 -0
- package/src/lib/app-utils/retained-refusals.js +186 -0
- package/src/lib/app-utils/retained-refusals.js.map +1 -0
- package/src/lib/app-utils/scope-tokens.d.ts +27 -0
- package/src/lib/app-utils/scope-tokens.js +61 -0
- package/src/lib/app-utils/scope-tokens.js.map +1 -1
- package/src/lib/app-utils/screen-link-context.js +3 -3
- package/src/lib/app-utils/screen-link-context.js.map +1 -1
- package/src/lib/app-utils/screen-route.js +1 -1
- package/src/lib/app-utils/screen-route.js.map +1 -1
- package/src/lib/app-utils/seo-audit.d.ts +132 -0
- package/src/lib/app-utils/seo-audit.js +246 -0
- package/src/lib/app-utils/seo-audit.js.map +1 -0
- package/src/lib/app-utils/seo-keywords.d.ts +48 -0
- package/src/lib/app-utils/seo-keywords.js +60 -0
- package/src/lib/app-utils/seo-keywords.js.map +1 -0
- package/src/lib/app-utils/seo-page-facts.d.ts +66 -0
- package/src/lib/app-utils/seo-page-facts.js +155 -0
- package/src/lib/app-utils/seo-page-facts.js.map +1 -0
- package/src/lib/app-utils/seo-site-scan.d.ts +126 -0
- package/src/lib/app-utils/seo-site-scan.js +162 -0
- package/src/lib/app-utils/seo-site-scan.js.map +1 -0
- package/src/lib/app-utils/seo-title-variables.js +1 -1
- package/src/lib/app-utils/seo-title-variables.js.map +1 -1
- package/src/lib/app-utils/server.d.ts +13 -18
- package/src/lib/app-utils/server.js +33 -51
- package/src/lib/app-utils/server.js.map +1 -1
- package/src/lib/app-utils/site-interactions.d.ts +501 -0
- package/src/lib/app-utils/site-interactions.js +554 -0
- package/src/lib/app-utils/site-interactions.js.map +1 -0
- package/src/lib/app-utils/{marketplace-theme.d.ts → site-theme.d.ts} +13 -2
- package/src/lib/app-utils/{marketplace-theme.js → site-theme.js} +2 -2
- package/src/lib/app-utils/site-theme.js.map +1 -0
- package/src/lib/app-utils/sitemap.d.ts +4 -3
- package/src/lib/app-utils/sitemap.js +9 -7
- package/src/lib/app-utils/sitemap.js.map +1 -1
- package/src/lib/app-utils/stale-build-error.d.ts +51 -0
- package/src/lib/app-utils/stale-build-error.js +100 -1
- package/src/lib/app-utils/stale-build-error.js.map +1 -1
- package/src/lib/app-utils/starter-template-nodes.d.ts +137 -0
- package/src/lib/app-utils/starter-template-nodes.js +129 -0
- package/src/lib/app-utils/starter-template-nodes.js.map +1 -0
- package/src/lib/app-utils/starter-templates.d.ts +11 -34
- package/src/lib/app-utils/starter-templates.js +19 -230
- package/src/lib/app-utils/starter-templates.js.map +1 -1
- package/src/lib/app-utils/{email-topics.d.ts → subscription-topics.d.ts} +64 -48
- package/src/lib/app-utils/{email-topics.js → subscription-topics.js} +39 -109
- package/src/lib/app-utils/subscription-topics.js.map +1 -0
- package/src/lib/app-utils/tax-jurisdiction-figures.d.ts +118 -0
- package/src/lib/app-utils/tax-jurisdiction-figures.js +123 -0
- package/src/lib/app-utils/tax-jurisdiction-figures.js.map +1 -0
- package/src/lib/app-utils/theme-library.d.ts +10 -3
- package/src/lib/app-utils/theme-library.js +13 -4
- package/src/lib/app-utils/theme-library.js.map +1 -1
- package/src/lib/app-utils/usage-budget.d.ts +73 -188
- package/src/lib/app-utils/usage-budget.js +58 -194
- package/src/lib/app-utils/usage-budget.js.map +1 -1
- package/src/lib/app-utils/{campaign-attribution.d.ts → utm-attribution.d.ts} +11 -6
- package/src/lib/app-utils/{campaign-attribution.js → utm-attribution.js} +13 -8
- package/src/lib/app-utils/utm-attribution.js.map +1 -0
- package/src/lib/app-utils/{campaign-forwarding.d.ts → utm-forwarding.d.ts} +14 -14
- package/src/lib/app-utils/{campaign-forwarding.js → utm-forwarding.js} +26 -26
- package/src/lib/app-utils/utm-forwarding.js.map +1 -0
- package/src/lib/app-utils/{campaign-touch.d.ts → utm-touch.d.ts} +25 -17
- package/src/lib/app-utils/{campaign-touch.js → utm-touch.js} +38 -30
- package/src/lib/app-utils/utm-touch.js.map +1 -0
- package/src/lib/app-utils/variables.d.ts +9 -9
- package/src/lib/app-utils/variables.js.map +1 -1
- package/src/lib/app-utils/video-object.js +6 -5
- package/src/lib/app-utils/video-object.js.map +1 -1
- package/src/lib/app-utils/visitor-consent.d.ts +41 -164
- package/src/lib/app-utils/visitor-consent.js +66 -277
- package/src/lib/app-utils/visitor-consent.js.map +1 -1
- package/src/lib/app-utils/visitor-record-ceiling.d.ts +32 -0
- package/src/lib/app-utils/visitor-record-ceiling.js +39 -0
- package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
- package/src/lib/app-utils/web-vitals-rum.d.ts +7 -7
- package/src/lib/app-utils/web-vitals-rum.js +31 -63
- package/src/lib/app-utils/web-vitals-rum.js.map +1 -1
- package/src/lib/app-utils/where-used.d.ts +11 -6
- package/src/lib/app-utils/where-used.js +3 -8
- package/src/lib/app-utils/where-used.js.map +1 -1
- package/src/lib/foundation/definitions/components.types.d.ts +1 -1
- package/src/lib/foundation/definitions/components.types.js +1 -1
- package/src/lib/foundation/definitions/components.types.js.map +1 -1
- package/src/lib/foundation/definitions/org-billing.types.d.ts +11 -137
- package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
- package/src/lib/foundation/definitions/organization.types.d.ts +1 -3
- package/src/lib/foundation/definitions/organization.types.js.map +1 -1
- package/src/lib/foundation/definitions/platform.types.d.ts +11 -5
- package/src/lib/foundation/definitions/platform.types.js.map +1 -1
- package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +16 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.js +20 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -1
- package/src/lib/foundation/index.d.ts +1 -1
- package/src/lib/foundation/index.js.map +1 -1
- package/src/lib/plugin-manager/besigner-documents.d.ts +96 -0
- package/src/lib/plugin-manager/besigner-documents.js +61 -0
- package/src/lib/plugin-manager/besigner-documents.js.map +1 -0
- package/src/lib/plugin-manager/computed-variables.d.ts +71 -0
- package/src/lib/plugin-manager/computed-variables.js +74 -0
- package/src/lib/plugin-manager/computed-variables.js.map +1 -0
- package/src/lib/plugin-manager/custom-fields.d.ts +29 -2
- package/src/lib/plugin-manager/custom-fields.js +47 -1
- package/src/lib/plugin-manager/custom-fields.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +372 -99
- package/src/lib/plugin-manager/feature-plugins.js +126 -51
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +134 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js +840 -10
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
- package/src/lib/plugin-manager/index.d.ts +0 -1
- package/src/lib/plugin-manager/index.js +0 -1
- package/src/lib/plugin-manager/index.js.map +1 -1
- package/src/lib/plugin-manager/plugin-activity-actions.d.ts +12 -0
- package/src/lib/plugin-manager/plugin-activity-actions.js +25 -0
- package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -1
- package/src/lib/plugin-manager/plugin-contact-capture.d.ts +9 -4
- package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
- package/src/lib/plugin-manager/plugin-containers.d.ts +68 -0
- package/src/lib/plugin-manager/plugin-containers.generated.d.ts +10 -0
- package/src/lib/plugin-manager/plugin-containers.generated.js +20 -0
- package/src/lib/plugin-manager/plugin-containers.generated.js.map +1 -0
- package/src/lib/plugin-manager/plugin-containers.js +27 -0
- package/src/lib/plugin-manager/plugin-containers.js.map +1 -0
- package/src/lib/plugin-manager/plugin-contributions.d.ts +1 -1
- package/src/lib/plugin-manager/plugin-contributions.js.map +1 -1
- package/src/lib/plugin-manager/plugin-declarations-repair.d.ts +36 -0
- package/src/lib/plugin-manager/plugin-declarations-repair.js +64 -0
- package/src/lib/plugin-manager/plugin-declarations-repair.js.map +1 -0
- package/src/lib/plugin-manager/plugin-dependents.d.ts +101 -0
- package/src/lib/plugin-manager/plugin-dependents.js +75 -0
- package/src/lib/plugin-manager/plugin-dependents.js.map +1 -0
- package/src/lib/plugin-manager/plugin-distribution.d.ts +55 -0
- package/src/lib/plugin-manager/plugin-distribution.js +45 -0
- package/src/lib/plugin-manager/plugin-distribution.js.map +1 -0
- package/src/lib/plugin-manager/plugin-entitlements.d.ts +8 -0
- package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -1
- package/src/lib/plugin-manager/plugin-host-collections.d.ts +17 -0
- package/src/lib/plugin-manager/plugin-host-collections.js +6 -0
- package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -1
- package/src/lib/plugin-manager/plugin-host-resources.d.ts +133 -0
- package/src/lib/plugin-manager/plugin-host-resources.js +52 -0
- package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -0
- package/src/lib/plugin-manager/plugin-membership-detach.js +1 -1
- package/src/lib/plugin-manager/plugin-membership-detach.js.map +1 -1
- package/src/lib/plugin-manager/plugin-org-erasure.d.ts +28 -2
- package/src/lib/plugin-manager/plugin-org-erasure.js +61 -2
- package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
- package/src/lib/plugin-manager/plugin-plan-entitlements.d.ts +123 -0
- package/src/lib/plugin-manager/plugin-plan-entitlements.js +101 -0
- package/src/lib/plugin-manager/plugin-plan-entitlements.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-email-state.d.ts +69 -0
- package/src/lib/plugin-manager/plugin-record-email-state.js +32 -0
- package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-index.d.ts +95 -0
- package/src/lib/plugin-manager/plugin-record-index.js +51 -0
- package/src/lib/plugin-manager/plugin-record-index.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-lists.d.ts +115 -0
- package/src/lib/plugin-manager/plugin-record-lists.js +75 -0
- package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-timeline.d.ts +42 -8
- package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-written.d.ts +58 -0
- package/src/lib/plugin-manager/plugin-record-written.js +42 -0
- package/src/lib/plugin-manager/plugin-record-written.js.map +1 -0
- package/src/lib/plugin-manager/plugin-revenue-sources.d.ts +213 -0
- package/src/lib/plugin-manager/plugin-revenue-sources.js +194 -0
- package/src/lib/plugin-manager/plugin-revenue-sources.js.map +1 -0
- package/src/lib/plugin-manager/plugin-site-beacons.d.ts +71 -0
- package/src/lib/plugin-manager/plugin-site-beacons.js +54 -0
- package/src/lib/plugin-manager/plugin-site-beacons.js.map +1 -0
- package/src/lib/plugin-manager/plugin-site-bundle.d.ts +145 -0
- package/src/lib/plugin-manager/plugin-site-bundle.js +78 -0
- package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -0
- package/src/lib/plugin-manager/plugin-site-cache.d.ts +12 -0
- package/src/lib/plugin-manager/plugin-site-cache.js.map +1 -1
- package/src/lib/plugin-manager/plugin-site-export.d.ts +81 -0
- package/src/lib/plugin-manager/plugin-site-export.js +40 -0
- package/src/lib/plugin-manager/plugin-site-export.js.map +1 -0
- package/src/lib/plugin-manager/plugin-sitemap-sections.d.ts +88 -0
- package/src/lib/plugin-manager/plugin-sitemap-sections.js +29 -0
- package/src/lib/plugin-manager/plugin-sitemap-sections.js.map +1 -0
- package/src/lib/plugin-manager/plugin-subscription-topics.generated.d.ts +11 -0
- package/src/lib/plugin-manager/plugin-subscription-topics.generated.js +41 -0
- package/src/lib/plugin-manager/plugin-subscription-topics.generated.js.map +1 -0
- package/src/lib/plugin-manager/plugin-tax-profile.d.ts +20 -4
- package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -1
- package/src/lib/plugin-manager/plugin-tax-return-sources.d.ts +255 -0
- package/src/lib/plugin-manager/plugin-tax-return-sources.js +191 -0
- package/src/lib/plugin-manager/plugin-tax-return-sources.js.map +1 -0
- package/src/lib/plugin-manager/plugin-template-sources.d.ts +75 -0
- package/src/lib/plugin-manager/plugin-template-sources.js +37 -0
- package/src/lib/plugin-manager/plugin-template-sources.js.map +1 -0
- package/src/lib/plugin-manager/plugin-usage-axes.d.ts +319 -0
- package/src/lib/plugin-manager/plugin-usage-axes.js +186 -0
- package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -0
- package/src/lib/plugin-manager/plugin-usage-meters.d.ts +108 -0
- package/src/lib/plugin-manager/plugin-usage-meters.js +105 -0
- package/src/lib/plugin-manager/plugin-usage-meters.js.map +1 -0
- package/src/lib/plugin-manager/plugin-zones.d.ts +4 -5
- package/src/lib/plugin-manager/plugin-zones.js.map +1 -1
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
- package/src/lib/plugin-manager/record-captured-contact.d.ts +1 -14
- package/src/lib/plugin-manager/record-captured-contact.js +10 -32
- package/src/lib/plugin-manager/record-captured-contact.js.map +1 -1
- package/src/lib/plugin-manager/repeat-rows.d.ts +124 -0
- package/src/lib/plugin-manager/repeat-rows.js +108 -0
- package/src/lib/plugin-manager/repeat-rows.js.map +1 -0
- package/src/lib/plugin-manager/submission-record-target.d.ts +144 -0
- package/src/lib/plugin-manager/submission-record-target.js +125 -0
- package/src/lib/plugin-manager/submission-record-target.js.map +1 -0
- package/src/lib/plugin-manager/usage-alert-contributors.d.ts +76 -6
- package/src/lib/plugin-manager/usage-alert-contributors.js +23 -10
- package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -1
- package/src/lib/plugin-manager/video-embed-provider.d.ts +108 -0
- package/src/lib/plugin-manager/video-embed-provider.js +165 -0
- package/src/lib/plugin-manager/video-embed-provider.js.map +1 -0
- package/src/lib/types/nodes.d.ts +2 -2
- package/src/lib/types/nodes.js.map +1 -1
- package/src/lib/app-utils/assist-credits.d.ts +0 -482
- package/src/lib/app-utils/assist-credits.js +0 -509
- package/src/lib/app-utils/assist-credits.js.map +0 -1
- package/src/lib/app-utils/campaign-attribution.js.map +0 -1
- package/src/lib/app-utils/campaign-forwarding.js.map +0 -1
- package/src/lib/app-utils/campaign-membership.d.ts +0 -121
- package/src/lib/app-utils/campaign-membership.js +0 -189
- package/src/lib/app-utils/campaign-membership.js.map +0 -1
- package/src/lib/app-utils/campaign-touch.js.map +0 -1
- package/src/lib/app-utils/console-record-links.d.ts +0 -163
- package/src/lib/app-utils/console-record-links.js +0 -180
- package/src/lib/app-utils/console-record-links.js.map +0 -1
- package/src/lib/app-utils/contact-holder.d.ts +0 -68
- package/src/lib/app-utils/contact-holder.js +0 -129
- package/src/lib/app-utils/contact-holder.js.map +0 -1
- package/src/lib/app-utils/contact-merge.d.ts +0 -136
- package/src/lib/app-utils/contact-merge.js +0 -412
- package/src/lib/app-utils/contact-merge.js.map +0 -1
- package/src/lib/app-utils/crm-booking.d.ts +0 -75
- package/src/lib/app-utils/crm-booking.js +0 -133
- package/src/lib/app-utils/crm-booking.js.map +0 -1
- package/src/lib/app-utils/crm-csv.d.ts +0 -239
- package/src/lib/app-utils/crm-csv.js +0 -467
- package/src/lib/app-utils/crm-csv.js.map +0 -1
- package/src/lib/app-utils/crm-digest.d.ts +0 -185
- package/src/lib/app-utils/crm-digest.js +0 -272
- package/src/lib/app-utils/crm-digest.js.map +0 -1
- package/src/lib/app-utils/crm-inbound.d.ts +0 -245
- package/src/lib/app-utils/crm-inbound.js +0 -407
- package/src/lib/app-utils/crm-inbound.js.map +0 -1
- package/src/lib/app-utils/crm-reports.d.ts +0 -479
- package/src/lib/app-utils/crm-reports.js +0 -680
- package/src/lib/app-utils/crm-reports.js.map +0 -1
- package/src/lib/app-utils/dataset-csv.js.map +0 -1
- package/src/lib/app-utils/dataset-query.d.ts +0 -57
- package/src/lib/app-utils/dataset-query.js.map +0 -1
- package/src/lib/app-utils/email-topics.js.map +0 -1
- package/src/lib/app-utils/form-dataset-binding.d.ts +0 -50
- package/src/lib/app-utils/form-dataset-binding.js +0 -74
- package/src/lib/app-utils/form-dataset-binding.js.map +0 -1
- package/src/lib/app-utils/list-assignment-policy.js.map +0 -1
- package/src/lib/app-utils/list-import.d.ts +0 -158
- package/src/lib/app-utils/list-import.js +0 -332
- package/src/lib/app-utils/list-import.js.map +0 -1
- package/src/lib/app-utils/marketplace-listing-visibility.d.ts +0 -122
- package/src/lib/app-utils/marketplace-listing-visibility.js +0 -147
- package/src/lib/app-utils/marketplace-listing-visibility.js.map +0 -1
- package/src/lib/app-utils/marketplace-overrides.js.map +0 -1
- package/src/lib/app-utils/marketplace-provenance.js.map +0 -1
- package/src/lib/app-utils/marketplace-theme.js.map +0 -1
- package/src/lib/app-utils/marketplace-update-state.d.ts +0 -119
- package/src/lib/app-utils/marketplace-update-state.js +0 -132
- package/src/lib/app-utils/marketplace-update-state.js.map +0 -1
- package/src/lib/app-utils/publisher-agreement.d.ts +0 -289
- package/src/lib/app-utils/publisher-agreement.js +0 -321
- package/src/lib/app-utils/publisher-agreement.js.map +0 -1
- package/src/lib/app-utils/wistia-embed.d.ts +0 -104
- package/src/lib/app-utils/wistia-embed.js +0 -138
- package/src/lib/app-utils/wistia-embed.js.map +0 -1
- package/src/lib/app-utils/workflows.d.ts +0 -136
- package/src/lib/app-utils/workflows.js +0 -346
- package/src/lib/app-utils/workflows.js.map +0 -1
- package/src/lib/plugin-manager/commerce-zone-props.d.ts +0 -172
- package/src/lib/plugin-manager/commerce-zone-props.js +0 -31
- package/src/lib/plugin-manager/commerce-zone-props.js.map +0 -1
- package/src/lib/plugin-manager/plugin-metered-lines.d.ts +0 -97
- package/src/lib/plugin-manager/plugin-metered-lines.js +0 -123
- package/src/lib/plugin-manager/plugin-metered-lines.js.map +0 -1
|
@@ -15,14 +15,22 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Alerts a plugin contributes to the usage-alerts sweep (AGL-2984).
|
|
19
19
|
*
|
|
20
20
|
* The usage-alerts cron walks every org, reads its usage once, and sends
|
|
21
21
|
* core's own alerts: the plan quotas, the customer's budget and the free
|
|
22
22
|
* plan's bandwidth cap. A plugin that meters a cost or enforces a ceiling
|
|
23
23
|
* core knows nothing about registers a contributor here from its
|
|
24
|
-
* `serverDeclarations` entry,
|
|
25
|
-
*
|
|
24
|
+
* `serverDeclarations` entry, in either or both of two shapes:
|
|
25
|
+
*
|
|
26
|
+
* - `quotaChecks` answers the bands the WORKSPACE is warned about — a used
|
|
27
|
+
* figure against a limit, how often it may be announced, what happens at
|
|
28
|
+
* it, and the words for approaching and reaching it. The sweep runs them
|
|
29
|
+
* after its own quota checks, through the same approach threshold, guards
|
|
30
|
+
* and both channels, so a plugin's band warns exactly as a platform band
|
|
31
|
+
* does.
|
|
32
|
+
* - `evaluate` decides STAFF alerts, and the sweep hands it each org's
|
|
33
|
+
* reading after the budget alert and before the bandwidth cap.
|
|
26
34
|
*
|
|
27
35
|
* THE PIPELINE IS THE SWEEP'S. A contributor decides whether an alert is due
|
|
28
36
|
* and what it says; the context does everything else:
|
|
@@ -57,6 +65,7 @@
|
|
|
57
65
|
* loaded the declarations, and a list that followed it could send and report
|
|
58
66
|
* one org's alerts in a different order per process.
|
|
59
67
|
*/
|
|
68
|
+
import type { NotificationLevel } from '../app-utils/notifications';
|
|
60
69
|
import type { OrgSpendBreakdown, UsageAlertGuard } from '../app-utils/usage-budget';
|
|
61
70
|
/** One staff alert, as the sweep delivers and reports it. */
|
|
62
71
|
export interface UsageStaffAlert {
|
|
@@ -72,6 +81,12 @@ export interface UsageStaffAlert {
|
|
|
72
81
|
link: string;
|
|
73
82
|
/** The email's tag and log label. */
|
|
74
83
|
emailContext: string;
|
|
84
|
+
/**
|
|
85
|
+
* How loud the bell draws it (AGL-3437). A contributor's threshold is its
|
|
86
|
+
* own unit, not a percentage, so only the contributor can say; absent, the
|
|
87
|
+
* `billing.usage` default answers.
|
|
88
|
+
*/
|
|
89
|
+
level?: NotificationLevel;
|
|
75
90
|
}
|
|
76
91
|
/** What the sweep hands a contributor for one org. */
|
|
77
92
|
export interface UsageAlertContext {
|
|
@@ -94,19 +109,74 @@ export interface UsageAlertContext {
|
|
|
94
109
|
/** Delivers one staff alert through the sweep's senders and reports it. */
|
|
95
110
|
alertStaff: (alert: UsageStaffAlert) => Promise<void>;
|
|
96
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* One band a workspace is warned about as it approaches and reaches it — the
|
|
114
|
+
* shape of a plugin's quota check.
|
|
115
|
+
*
|
|
116
|
+
* The sweep owns everything past the numbers and the words: the approach
|
|
117
|
+
* percentage, the guard under `key`, the first-sweep seeding, both channels,
|
|
118
|
+
* and the sentence every notice opens with — the workspace, then the figures,
|
|
119
|
+
* then `noun` ("The Acme workspace has used 2,300 of the 2,750 AI assist
|
|
120
|
+
* credits your plan includes this month").
|
|
121
|
+
*/
|
|
122
|
+
export interface UsageQuotaCheck {
|
|
123
|
+
/** The guard key; named for what it measures, never one of core's. */
|
|
124
|
+
key: string;
|
|
125
|
+
/** How the alert's title names the band: "AI assist credits". */
|
|
126
|
+
label: string;
|
|
127
|
+
/** What the figures count, in the opening sentence. */
|
|
128
|
+
noun: string;
|
|
129
|
+
used: number;
|
|
130
|
+
/** `UNLIMITED` or anything not above 0 is skipped. */
|
|
131
|
+
limit: number;
|
|
132
|
+
/**
|
|
133
|
+
* How often one threshold may be announced: `crossing` for something the
|
|
134
|
+
* workspace HAS, announced once when reached and again only after usage
|
|
135
|
+
* falls back below; `monthly` for a meter that resets on the 1st.
|
|
136
|
+
*/
|
|
137
|
+
cadence: 'crossing' | 'monthly';
|
|
138
|
+
/**
|
|
139
|
+
* What happens at the band, which the notice has to say because the three
|
|
140
|
+
* call for different actions: `stops` (new use is refused, nothing is
|
|
141
|
+
* charged), `bills` (it keeps working and starts charging) or `continues`
|
|
142
|
+
* (nothing is refused and nothing is charged).
|
|
143
|
+
*/
|
|
144
|
+
outcome: 'stops' | 'bills' | 'continues';
|
|
145
|
+
/** What is true now, at or past the band. */
|
|
146
|
+
reached: string;
|
|
147
|
+
/** What will happen at the band, said while approaching it. */
|
|
148
|
+
approach: string;
|
|
149
|
+
/** Replaces the generic title at 100%, when that would not be true. */
|
|
150
|
+
reachedTitle?: string;
|
|
151
|
+
}
|
|
152
|
+
/** What the sweep hands a contributor's quota checks for one org. */
|
|
153
|
+
export interface UsageQuotaContext {
|
|
154
|
+
orgId: string;
|
|
155
|
+
/** The org document as the sweep read it. */
|
|
156
|
+
org: Readonly<Record<string, unknown>>;
|
|
157
|
+
/** The `YYYY-MM` month the sweep dedupes against. */
|
|
158
|
+
month: string;
|
|
159
|
+
/** The org's spend this month, built from the figures the sweep read. */
|
|
160
|
+
spend: Readonly<OrgSpendBreakdown>;
|
|
161
|
+
}
|
|
97
162
|
/** A plugin's rule for the usage-alerts sweep. */
|
|
98
163
|
export interface UsageAlertContributor {
|
|
99
164
|
pluginId: string;
|
|
100
165
|
/** Unique within the plugin; two plugins may use the same id. */
|
|
101
166
|
id: string;
|
|
102
|
-
/** Evaluates one org, sending only through the context. */
|
|
103
|
-
evaluate
|
|
167
|
+
/** Evaluates one org's STAFF alerts, sending only through the context. */
|
|
168
|
+
evaluate?: (context: UsageAlertContext) => Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* The bands the WORKSPACE is warned about, which the sweep runs after its
|
|
171
|
+
* own through the same thresholds, guards and senders.
|
|
172
|
+
*/
|
|
173
|
+
quotaChecks?: (context: UsageQuotaContext) => Promise<readonly UsageQuotaCheck[]>;
|
|
104
174
|
}
|
|
105
175
|
/**
|
|
106
176
|
* Registers a contributor. Idempotent per plugin and id: registering the same
|
|
107
177
|
* pair again replaces the earlier contributor in place, so a declarations
|
|
108
178
|
* module evaluated twice does not alert twice. A contributor with no plugin,
|
|
109
|
-
* no id or
|
|
179
|
+
* no id, or neither `evaluate` nor `quotaChecks` throws.
|
|
110
180
|
*/
|
|
111
181
|
export declare function registerUsageAlertContributor(contributor: UsageAlertContributor): void;
|
|
112
182
|
/** Every registered contributor, in the order the sweep runs them. */
|
|
@@ -14,14 +14,22 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/ /**
|
|
17
|
-
*
|
|
17
|
+
* Alerts a plugin contributes to the usage-alerts sweep (AGL-2984).
|
|
18
18
|
*
|
|
19
19
|
* The usage-alerts cron walks every org, reads its usage once, and sends
|
|
20
20
|
* core's own alerts: the plan quotas, the customer's budget and the free
|
|
21
21
|
* plan's bandwidth cap. A plugin that meters a cost or enforces a ceiling
|
|
22
22
|
* core knows nothing about registers a contributor here from its
|
|
23
|
-
* `serverDeclarations` entry,
|
|
24
|
-
*
|
|
23
|
+
* `serverDeclarations` entry, in either or both of two shapes:
|
|
24
|
+
*
|
|
25
|
+
* - `quotaChecks` answers the bands the WORKSPACE is warned about — a used
|
|
26
|
+
* figure against a limit, how often it may be announced, what happens at
|
|
27
|
+
* it, and the words for approaching and reaching it. The sweep runs them
|
|
28
|
+
* after its own quota checks, through the same approach threshold, guards
|
|
29
|
+
* and both channels, so a plugin's band warns exactly as a platform band
|
|
30
|
+
* does.
|
|
31
|
+
* - `evaluate` decides STAFF alerts, and the sweep hands it each org's
|
|
32
|
+
* reading after the budget alert and before the bandwidth cap.
|
|
25
33
|
*
|
|
26
34
|
* THE PIPELINE IS THE SWEEP'S. A contributor decides whether an alert is due
|
|
27
35
|
* and what it says; the context does everything else:
|
|
@@ -73,7 +81,7 @@ function catalogRank(pluginId) {
|
|
|
73
81
|
* Registers a contributor. Idempotent per plugin and id: registering the same
|
|
74
82
|
* pair again replaces the earlier contributor in place, so a declarations
|
|
75
83
|
* module evaluated twice does not alert twice. A contributor with no plugin,
|
|
76
|
-
* no id or
|
|
84
|
+
* no id, or neither `evaluate` nor `quotaChecks` throws.
|
|
77
85
|
*/ export function registerUsageAlertContributor(contributor) {
|
|
78
86
|
var _contributor_pluginId, _contributor_id;
|
|
79
87
|
const pluginId = String((_contributor_pluginId = contributor.pluginId) != null ? _contributor_pluginId : '').trim();
|
|
@@ -81,14 +89,19 @@ function catalogRank(pluginId) {
|
|
|
81
89
|
if (!pluginId || !id) {
|
|
82
90
|
throw new Error('a usage alert contributor needs a pluginId and an id');
|
|
83
91
|
}
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
const evaluate = typeof contributor.evaluate === 'function' ? contributor.evaluate : undefined;
|
|
93
|
+
const quotaChecks = typeof contributor.quotaChecks === 'function' ? contributor.quotaChecks : undefined;
|
|
94
|
+
if (!evaluate && !quotaChecks) {
|
|
95
|
+
throw new Error(`usage alert contributor "${pluginId}:${id}" has neither an evaluate ` + 'nor a quotaChecks function');
|
|
86
96
|
}
|
|
87
|
-
const entry = {
|
|
97
|
+
const entry = _extends({
|
|
88
98
|
pluginId,
|
|
89
|
-
id
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
id
|
|
100
|
+
}, evaluate ? {
|
|
101
|
+
evaluate
|
|
102
|
+
} : {}, quotaChecks ? {
|
|
103
|
+
quotaChecks
|
|
104
|
+
} : {});
|
|
92
105
|
const index = registrations.findIndex((existing)=>existing.pluginId === pluginId && existing.id === id);
|
|
93
106
|
if (index >= 0) registrations[index] = entry;
|
|
94
107
|
else registrations.push(entry);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/usage-alert-contributors.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/**\n * Staff alerts a plugin contributes to the usage-alerts sweep (AGL-2984).\n *\n * The usage-alerts cron walks every org, reads its usage once, and sends\n * core's own alerts: the plan quotas, the customer's budget and the free\n * plan's bandwidth cap. A plugin that meters a cost or enforces a ceiling\n * core knows nothing about registers a contributor here from its\n * `serverDeclarations` entry, and the sweep hands the contributor each org's\n * reading after the budget alert and before the bandwidth cap.\n *\n * THE PIPELINE IS THE SWEEP'S. A contributor decides whether an alert is due\n * and what it says; the context does everything else:\n *\n * - `recordAlert(key, threshold)` records the dedupe guard and answers\n * whether the alert may be SENT. On an org's first, silent evaluation it\n * records the guard as though the alert went out and answers `false`, so a\n * contributor that sends only on `true` honors the first-sweep seeding\n * without knowing when it applies.\n * - `alertStaff(alert)` is the sweep's own sender: the staff bell, then the\n * staff inbox, then a row in the run's report saying whether the mail went\n * out. On an org's first, silent evaluation it sends nothing, whoever calls\n * it.\n * - `guards` is the org's guard map as the sweep read it. A contributor reads\n * it to dedupe and never writes a guard itself: the sweep writes what\n * `recordAlert` recorded, once, with the rest of the org's update.\n *\n * Guard keys share one map with core's own checks (`hosts`, `bandwidth`,\n * `budget` and the rest), so a contributor names its keys for what it\n * measures and never reuses one of core's.\n *\n * Contributors run one at a time and are ISOLATED: a throw is logged against\n * the contributor and the next one runs. A guard the failed contributor\n * recorded for an alert it never delivered is dropped rather than written, so\n * the next sweep tries that alert again instead of counting it as announced.\n * One plugin's failure costs no other plugin's alert, none of core's, and not\n * the rest of the sweep.\n *\n * The order is deterministic: the catalog order of `FIRST_PARTY_PLUGINS`,\n * then any other plugin id in code-unit order, then registration order within\n * a plugin. The order contributors REGISTER in depends on how each process\n * loaded the declarations, and a list that followed it could send and report\n * one org's alerts in a different order per process.\n */\n\nimport type {\n OrgSpendBreakdown,\n UsageAlertGuard,\n} from '../app-utils/usage-budget'\nimport { FIRST_PARTY_PLUGINS } from './enabled-plugins'\n\n/** One staff alert, as the sweep delivers and reports it. */\nexport interface UsageStaffAlert {\n /** The guard key the alert was recorded under; the report row's `quota`. */\n quota: string\n /** The threshold passed to `recordAlert`; the report row's `threshold`. */\n threshold: number\n /** The bell's title and the email's subject: one set of words for both. */\n title: string\n /** The bell's body. The email carries it verbatim, followed by the link. */\n body: string\n /** A console path. The bell links it; the email makes it absolute. */\n link: string\n /** The email's tag and log label. */\n emailContext: string\n}\n\n/** What the sweep hands a contributor for one org. */\nexport interface UsageAlertContext {\n orgId: string\n /** The org's slug, or `null` when the document carries none. */\n orgSlug: string | null\n /** The org document as the sweep read it. */\n org: Readonly<Record<string, unknown>>\n /** The `YYYY-MM` month the sweep dedupes against, fixed for the whole run. */\n month: string\n /** The org's spend this month, built from the figures the sweep read. */\n spend: Readonly<OrgSpendBreakdown>\n /** The org's guard map as the sweep read it, before this run's updates. */\n guards: Readonly<Record<string, Readonly<UsageAlertGuard>>>\n /**\n * Records the guard for `key` at `threshold` and answers whether the alert\n * may be sent. Call it once the alert is due, and send only on `true`.\n */\n recordAlert: (key: string, threshold: number) => boolean\n /** Delivers one staff alert through the sweep's senders and reports it. */\n alertStaff: (alert: UsageStaffAlert) => Promise<void>\n}\n\n/** A plugin's rule for the usage-alerts sweep. */\nexport interface UsageAlertContributor {\n pluginId: string\n /** Unique within the plugin; two plugins may use the same id. */\n id: string\n /** Evaluates one org, sending only through the context. */\n evaluate: (context: UsageAlertContext) => Promise<void>\n}\n\nconst registrations: UsageAlertContributor[] = []\n\nconst CATALOG_ORDER = new Map(\n FIRST_PARTY_PLUGINS.map((plugin, index) => [plugin.id, index]),\n)\n\nfunction catalogRank(pluginId: string): number {\n return CATALOG_ORDER.get(pluginId) ?? Number.MAX_SAFE_INTEGER\n}\n\n/** Code-unit order, which no locale can reorder. */\nfunction codeUnitOrder(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0\n}\n\n/**\n * Registers a contributor. Idempotent per plugin and id: registering the same\n * pair again replaces the earlier contributor in place, so a declarations\n * module evaluated twice does not alert twice. A contributor with no plugin,\n * no id or no `evaluate` throws.\n */\nexport function registerUsageAlertContributor(\n contributor: UsageAlertContributor,\n): void {\n const pluginId = String(contributor.pluginId ?? '').trim()\n const id = String(contributor.id ?? '').trim()\n if (!pluginId || !id) {\n throw new Error('a usage alert contributor needs a pluginId and an id')\n }\n if (typeof contributor.evaluate !== 'function') {\n throw new Error(\n `usage alert contributor \"${pluginId}:${id}\" has no evaluate function`,\n )\n }\n const entry: UsageAlertContributor = {\n pluginId,\n id,\n evaluate: contributor.evaluate,\n }\n const index = registrations.findIndex(\n (existing) => existing.pluginId === pluginId && existing.id === id,\n )\n if (index >= 0) registrations[index] = entry\n else registrations.push(entry)\n}\n\n/** Every registered contributor, in the order the sweep runs them. */\nexport function listUsageAlertContributors(): UsageAlertContributor[] {\n return registrations\n .map((entry, sequence) => ({ entry, sequence }))\n .sort(\n (a, b) =>\n catalogRank(a.entry.pluginId) - catalogRank(b.entry.pluginId) ||\n codeUnitOrder(a.entry.pluginId, b.entry.pluginId) ||\n a.sequence - b.sequence,\n )\n .map(({ entry }) => ({ ...entry }))\n}\n\n/** Test seam: forget every contributor. */\nexport function resetUsageAlertContributorsForTests(): void {\n registrations.length = 0\n}\n"],"names":["FIRST_PARTY_PLUGINS","registrations","CATALOG_ORDER","Map","map","plugin","index","id","catalogRank","pluginId","get","Number","MAX_SAFE_INTEGER","codeUnitOrder","a","b","registerUsageAlertContributor","contributor","String","trim","Error","evaluate","entry","findIndex","existing","push","listUsageAlertContributors","sequence","sort","resetUsageAlertContributorsForTests","length"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC;AAMD,SAASA,mBAAmB,QAAQ,uBAAmB;AAiDvD,MAAMC,gBAAyC,EAAE;AAEjD,MAAMC,gBAAgB,IAAIC,IACxBH,oBAAoBI,GAAG,CAAC,CAACC,QAAQC,QAAU;QAACD,OAAOE,EAAE;QAAED;KAAM;AAG/D,SAASE,YAAYC,QAAgB;QAC5BP;IAAP,QAAOA,qBAAAA,cAAcQ,GAAG,CAACD,qBAAlBP,qBAA+BS,OAAOC,gBAAgB;AAC/D;AAEA,kDAAkD,GAClD,SAASC,cAAcC,CAAS,EAAEC,CAAS;IACzC,OAAOD,IAAIC,IAAI,CAAC,IAAID,IAAIC,IAAI,IAAI;AAClC;AAEA;;;;;CAKC,GACD,OAAO,SAASC,8BACdC,WAAkC;QAEVA,uBACNA;IADlB,MAAMR,WAAWS,QAAOD,wBAAAA,YAAYR,QAAQ,YAApBQ,wBAAwB,IAAIE,IAAI;IACxD,MAAMZ,KAAKW,QAAOD,kBAAAA,YAAYV,EAAE,YAAdU,kBAAkB,IAAIE,IAAI;IAC5C,IAAI,CAACV,YAAY,CAACF,IAAI;QACpB,MAAM,IAAIa,MAAM;IAClB;IACA,IAAI,OAAOH,YAAYI,QAAQ,KAAK,YAAY;QAC9C,MAAM,IAAID,MACR,CAAC,yBAAyB,EAAEX,SAAS,CAAC,EAAEF,GAAG,0BAA0B,CAAC;IAE1E;IACA,MAAMe,QAA+B;QACnCb;QACAF;QACAc,UAAUJ,YAAYI,QAAQ;IAChC;IACA,MAAMf,QAAQL,cAAcsB,SAAS,CACnC,CAACC,WAAaA,SAASf,QAAQ,KAAKA,YAAYe,SAASjB,EAAE,KAAKA;IAElE,IAAID,SAAS,GAAGL,aAAa,CAACK,MAAM,GAAGgB;SAClCrB,cAAcwB,IAAI,CAACH;AAC1B;AAEA,oEAAoE,GACpE,OAAO,SAASI;IACd,OAAOzB,cACJG,GAAG,CAAC,CAACkB,OAAOK,WAAc,CAAA;YAAEL;YAAOK;QAAS,CAAA,GAC5CC,IAAI,CACH,CAACd,GAAGC,IACFP,YAAYM,EAAEQ,KAAK,CAACb,QAAQ,IAAID,YAAYO,EAAEO,KAAK,CAACb,QAAQ,KAC5DI,cAAcC,EAAEQ,KAAK,CAACb,QAAQ,EAAEM,EAAEO,KAAK,CAACb,QAAQ,KAChDK,EAAEa,QAAQ,GAAGZ,EAAEY,QAAQ,EAE1BvB,GAAG,CAAC,CAAC,EAAEkB,KAAK,EAAE,GAAM,aAAKA;AAC9B;AAEA,yCAAyC,GACzC,OAAO,SAASO;IACd5B,cAAc6B,MAAM,GAAG;AACzB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/usage-alert-contributors.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/**\n * Alerts a plugin contributes to the usage-alerts sweep (AGL-2984).\n *\n * The usage-alerts cron walks every org, reads its usage once, and sends\n * core's own alerts: the plan quotas, the customer's budget and the free\n * plan's bandwidth cap. A plugin that meters a cost or enforces a ceiling\n * core knows nothing about registers a contributor here from its\n * `serverDeclarations` entry, in either or both of two shapes:\n *\n * - `quotaChecks` answers the bands the WORKSPACE is warned about — a used\n * figure against a limit, how often it may be announced, what happens at\n * it, and the words for approaching and reaching it. The sweep runs them\n * after its own quota checks, through the same approach threshold, guards\n * and both channels, so a plugin's band warns exactly as a platform band\n * does.\n * - `evaluate` decides STAFF alerts, and the sweep hands it each org's\n * reading after the budget alert and before the bandwidth cap.\n *\n * THE PIPELINE IS THE SWEEP'S. A contributor decides whether an alert is due\n * and what it says; the context does everything else:\n *\n * - `recordAlert(key, threshold)` records the dedupe guard and answers\n * whether the alert may be SENT. On an org's first, silent evaluation it\n * records the guard as though the alert went out and answers `false`, so a\n * contributor that sends only on `true` honors the first-sweep seeding\n * without knowing when it applies.\n * - `alertStaff(alert)` is the sweep's own sender: the staff bell, then the\n * staff inbox, then a row in the run's report saying whether the mail went\n * out. On an org's first, silent evaluation it sends nothing, whoever calls\n * it.\n * - `guards` is the org's guard map as the sweep read it. A contributor reads\n * it to dedupe and never writes a guard itself: the sweep writes what\n * `recordAlert` recorded, once, with the rest of the org's update.\n *\n * Guard keys share one map with core's own checks (`hosts`, `bandwidth`,\n * `budget` and the rest), so a contributor names its keys for what it\n * measures and never reuses one of core's.\n *\n * Contributors run one at a time and are ISOLATED: a throw is logged against\n * the contributor and the next one runs. A guard the failed contributor\n * recorded for an alert it never delivered is dropped rather than written, so\n * the next sweep tries that alert again instead of counting it as announced.\n * One plugin's failure costs no other plugin's alert, none of core's, and not\n * the rest of the sweep.\n *\n * The order is deterministic: the catalog order of `FIRST_PARTY_PLUGINS`,\n * then any other plugin id in code-unit order, then registration order within\n * a plugin. The order contributors REGISTER in depends on how each process\n * loaded the declarations, and a list that followed it could send and report\n * one org's alerts in a different order per process.\n */\n\nimport type { NotificationLevel } from '../app-utils/notifications'\nimport type {\n OrgSpendBreakdown,\n UsageAlertGuard,\n} from '../app-utils/usage-budget'\nimport { FIRST_PARTY_PLUGINS } from './enabled-plugins'\n\n/** One staff alert, as the sweep delivers and reports it. */\nexport interface UsageStaffAlert {\n /** The guard key the alert was recorded under; the report row's `quota`. */\n quota: string\n /** The threshold passed to `recordAlert`; the report row's `threshold`. */\n threshold: number\n /** The bell's title and the email's subject: one set of words for both. */\n title: string\n /** The bell's body. The email carries it verbatim, followed by the link. */\n body: string\n /** A console path. The bell links it; the email makes it absolute. */\n link: string\n /** The email's tag and log label. */\n emailContext: string\n /**\n * How loud the bell draws it (AGL-3437). A contributor's threshold is its\n * own unit, not a percentage, so only the contributor can say; absent, the\n * `billing.usage` default answers.\n */\n level?: NotificationLevel\n}\n\n/** What the sweep hands a contributor for one org. */\nexport interface UsageAlertContext {\n orgId: string\n /** The org's slug, or `null` when the document carries none. */\n orgSlug: string | null\n /** The org document as the sweep read it. */\n org: Readonly<Record<string, unknown>>\n /** The `YYYY-MM` month the sweep dedupes against, fixed for the whole run. */\n month: string\n /** The org's spend this month, built from the figures the sweep read. */\n spend: Readonly<OrgSpendBreakdown>\n /** The org's guard map as the sweep read it, before this run's updates. */\n guards: Readonly<Record<string, Readonly<UsageAlertGuard>>>\n /**\n * Records the guard for `key` at `threshold` and answers whether the alert\n * may be sent. Call it once the alert is due, and send only on `true`.\n */\n recordAlert: (key: string, threshold: number) => boolean\n /** Delivers one staff alert through the sweep's senders and reports it. */\n alertStaff: (alert: UsageStaffAlert) => Promise<void>\n}\n\n/**\n * One band a workspace is warned about as it approaches and reaches it — the\n * shape of a plugin's quota check.\n *\n * The sweep owns everything past the numbers and the words: the approach\n * percentage, the guard under `key`, the first-sweep seeding, both channels,\n * and the sentence every notice opens with — the workspace, then the figures,\n * then `noun` (\"The Acme workspace has used 2,300 of the 2,750 AI assist\n * credits your plan includes this month\").\n */\nexport interface UsageQuotaCheck {\n /** The guard key; named for what it measures, never one of core's. */\n key: string\n /** How the alert's title names the band: \"AI assist credits\". */\n label: string\n /** What the figures count, in the opening sentence. */\n noun: string\n used: number\n /** `UNLIMITED` or anything not above 0 is skipped. */\n limit: number\n /**\n * How often one threshold may be announced: `crossing` for something the\n * workspace HAS, announced once when reached and again only after usage\n * falls back below; `monthly` for a meter that resets on the 1st.\n */\n cadence: 'crossing' | 'monthly'\n /**\n * What happens at the band, which the notice has to say because the three\n * call for different actions: `stops` (new use is refused, nothing is\n * charged), `bills` (it keeps working and starts charging) or `continues`\n * (nothing is refused and nothing is charged).\n */\n outcome: 'stops' | 'bills' | 'continues'\n /** What is true now, at or past the band. */\n reached: string\n /** What will happen at the band, said while approaching it. */\n approach: string\n /** Replaces the generic title at 100%, when that would not be true. */\n reachedTitle?: string\n}\n\n/** What the sweep hands a contributor's quota checks for one org. */\nexport interface UsageQuotaContext {\n orgId: string\n /** The org document as the sweep read it. */\n org: Readonly<Record<string, unknown>>\n /** The `YYYY-MM` month the sweep dedupes against. */\n month: string\n /** The org's spend this month, built from the figures the sweep read. */\n spend: Readonly<OrgSpendBreakdown>\n}\n\n/** A plugin's rule for the usage-alerts sweep. */\nexport interface UsageAlertContributor {\n pluginId: string\n /** Unique within the plugin; two plugins may use the same id. */\n id: string\n /** Evaluates one org's STAFF alerts, sending only through the context. */\n evaluate?: (context: UsageAlertContext) => Promise<void>\n /**\n * The bands the WORKSPACE is warned about, which the sweep runs after its\n * own through the same thresholds, guards and senders.\n */\n quotaChecks?: (context: UsageQuotaContext) => Promise<readonly UsageQuotaCheck[]>\n}\n\nconst registrations: UsageAlertContributor[] = []\n\nconst CATALOG_ORDER = new Map(\n FIRST_PARTY_PLUGINS.map((plugin, index) => [plugin.id, index]),\n)\n\nfunction catalogRank(pluginId: string): number {\n return CATALOG_ORDER.get(pluginId) ?? Number.MAX_SAFE_INTEGER\n}\n\n/** Code-unit order, which no locale can reorder. */\nfunction codeUnitOrder(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0\n}\n\n/**\n * Registers a contributor. Idempotent per plugin and id: registering the same\n * pair again replaces the earlier contributor in place, so a declarations\n * module evaluated twice does not alert twice. A contributor with no plugin,\n * no id, or neither `evaluate` nor `quotaChecks` throws.\n */\nexport function registerUsageAlertContributor(\n contributor: UsageAlertContributor,\n): void {\n const pluginId = String(contributor.pluginId ?? '').trim()\n const id = String(contributor.id ?? '').trim()\n if (!pluginId || !id) {\n throw new Error('a usage alert contributor needs a pluginId and an id')\n }\n const evaluate =\n typeof contributor.evaluate === 'function' ? contributor.evaluate : undefined\n const quotaChecks =\n typeof contributor.quotaChecks === 'function'\n ? contributor.quotaChecks\n : undefined\n if (!evaluate && !quotaChecks) {\n throw new Error(\n `usage alert contributor \"${pluginId}:${id}\" has neither an evaluate ` +\n 'nor a quotaChecks function',\n )\n }\n const entry: UsageAlertContributor = {\n pluginId,\n id,\n ...(evaluate ? { evaluate } : {}),\n ...(quotaChecks ? { quotaChecks } : {}),\n }\n const index = registrations.findIndex(\n (existing) => existing.pluginId === pluginId && existing.id === id,\n )\n if (index >= 0) registrations[index] = entry\n else registrations.push(entry)\n}\n\n/** Every registered contributor, in the order the sweep runs them. */\nexport function listUsageAlertContributors(): UsageAlertContributor[] {\n return registrations\n .map((entry, sequence) => ({ entry, sequence }))\n .sort(\n (a, b) =>\n catalogRank(a.entry.pluginId) - catalogRank(b.entry.pluginId) ||\n codeUnitOrder(a.entry.pluginId, b.entry.pluginId) ||\n a.sequence - b.sequence,\n )\n .map(({ entry }) => ({ ...entry }))\n}\n\n/** Test seam: forget every contributor. */\nexport function resetUsageAlertContributorsForTests(): void {\n registrations.length = 0\n}\n"],"names":["FIRST_PARTY_PLUGINS","registrations","CATALOG_ORDER","Map","map","plugin","index","id","catalogRank","pluginId","get","Number","MAX_SAFE_INTEGER","codeUnitOrder","a","b","registerUsageAlertContributor","contributor","String","trim","Error","evaluate","undefined","quotaChecks","entry","findIndex","existing","push","listUsageAlertContributors","sequence","sort","resetUsageAlertContributorsForTests","length"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDC;AAOD,SAASA,mBAAmB,QAAQ,uBAAmB;AAgHvD,MAAMC,gBAAyC,EAAE;AAEjD,MAAMC,gBAAgB,IAAIC,IACxBH,oBAAoBI,GAAG,CAAC,CAACC,QAAQC,QAAU;QAACD,OAAOE,EAAE;QAAED;KAAM;AAG/D,SAASE,YAAYC,QAAgB;QAC5BP;IAAP,QAAOA,qBAAAA,cAAcQ,GAAG,CAACD,qBAAlBP,qBAA+BS,OAAOC,gBAAgB;AAC/D;AAEA,kDAAkD,GAClD,SAASC,cAAcC,CAAS,EAAEC,CAAS;IACzC,OAAOD,IAAIC,IAAI,CAAC,IAAID,IAAIC,IAAI,IAAI;AAClC;AAEA;;;;;CAKC,GACD,OAAO,SAASC,8BACdC,WAAkC;QAEVA,uBACNA;IADlB,MAAMR,WAAWS,QAAOD,wBAAAA,YAAYR,QAAQ,YAApBQ,wBAAwB,IAAIE,IAAI;IACxD,MAAMZ,KAAKW,QAAOD,kBAAAA,YAAYV,EAAE,YAAdU,kBAAkB,IAAIE,IAAI;IAC5C,IAAI,CAACV,YAAY,CAACF,IAAI;QACpB,MAAM,IAAIa,MAAM;IAClB;IACA,MAAMC,WACJ,OAAOJ,YAAYI,QAAQ,KAAK,aAAaJ,YAAYI,QAAQ,GAAGC;IACtE,MAAMC,cACJ,OAAON,YAAYM,WAAW,KAAK,aAC/BN,YAAYM,WAAW,GACvBD;IACN,IAAI,CAACD,YAAY,CAACE,aAAa;QAC7B,MAAM,IAAIH,MACR,CAAC,yBAAyB,EAAEX,SAAS,CAAC,EAAEF,GAAG,0BAA0B,CAAC,GACpE;IAEN;IACA,MAAMiB,QAA+B;QACnCf;QACAF;OACIc,WAAW;QAAEA;IAAS,IAAI,CAAC,GAC3BE,cAAc;QAAEA;IAAY,IAAI,CAAC;IAEvC,MAAMjB,QAAQL,cAAcwB,SAAS,CACnC,CAACC,WAAaA,SAASjB,QAAQ,KAAKA,YAAYiB,SAASnB,EAAE,KAAKA;IAElE,IAAID,SAAS,GAAGL,aAAa,CAACK,MAAM,GAAGkB;SAClCvB,cAAc0B,IAAI,CAACH;AAC1B;AAEA,oEAAoE,GACpE,OAAO,SAASI;IACd,OAAO3B,cACJG,GAAG,CAAC,CAACoB,OAAOK,WAAc,CAAA;YAAEL;YAAOK;QAAS,CAAA,GAC5CC,IAAI,CACH,CAAChB,GAAGC,IACFP,YAAYM,EAAEU,KAAK,CAACf,QAAQ,IAAID,YAAYO,EAAES,KAAK,CAACf,QAAQ,KAC5DI,cAAcC,EAAEU,KAAK,CAACf,QAAQ,EAAEM,EAAES,KAAK,CAACf,QAAQ,KAChDK,EAAEe,QAAQ,GAAGd,EAAEc,QAAQ,EAE1BzB,GAAG,CAAC,CAAC,EAAEoB,KAAK,EAAE,GAAM,aAAKA;AAC9B;AAEA,yCAAyC,GACzC,OAAO,SAASO;IACd9B,cAAc+B,MAAM,GAAG;AACzB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* A choice the Video element makes for each player it frames. A declaration
|
|
19
|
+
* says how its player spells each one it supports; one it does not name is
|
|
20
|
+
* never sent.
|
|
21
|
+
*
|
|
22
|
+
* - `autoPlay` — start as soon as the player is ready. ON unless the caller
|
|
23
|
+
* passes exactly `false`: the usual frame is the one a visitor's press
|
|
24
|
+
* loads, and a second play button inside it would ask them twice.
|
|
25
|
+
* - `doNotTrack` — ask the host not to record the viewing session.
|
|
26
|
+
* - `muted` — start without sound.
|
|
27
|
+
* - `loop` — restart at the end.
|
|
28
|
+
*/
|
|
29
|
+
export type VideoEmbedPlayerOption = 'autoPlay' | 'doNotTrack' | 'muted' | 'loop';
|
|
30
|
+
export declare const VIDEO_EMBED_PLAYER_OPTIONS: readonly VideoEmbedPlayerOption[];
|
|
31
|
+
export type VideoEmbedPlayerOptions = Partial<Record<VideoEmbedPlayerOption, boolean>>;
|
|
32
|
+
/**
|
|
33
|
+
* One query parameter of a player address, in the order the declaration
|
|
34
|
+
* lists them. Either `value`, sent on every address, or an `option` whose
|
|
35
|
+
* state picks `on` or `off`; a state with no value leaves the parameter out.
|
|
36
|
+
*/
|
|
37
|
+
export type VideoEmbedPlayerParam = {
|
|
38
|
+
param: string;
|
|
39
|
+
value: string;
|
|
40
|
+
} | {
|
|
41
|
+
param: string;
|
|
42
|
+
option: VideoEmbedPlayerOption;
|
|
43
|
+
on?: string;
|
|
44
|
+
off?: string;
|
|
45
|
+
};
|
|
46
|
+
export interface VideoEmbedProviderDeclaration {
|
|
47
|
+
/** Stable id, unique across plugins. */
|
|
48
|
+
id: string;
|
|
49
|
+
/** The host's name as an author knows it, for labels and help text. */
|
|
50
|
+
label: string;
|
|
51
|
+
/**
|
|
52
|
+
* The domains a link's host must equal or end in (after a dot). Exact or
|
|
53
|
+
* dot-anchored only, so a domain that merely contains one is refused.
|
|
54
|
+
*/
|
|
55
|
+
domains: readonly string[];
|
|
56
|
+
/**
|
|
57
|
+
* Regular expressions over a link's PATH, anchored at both ends, whose
|
|
58
|
+
* first capture group is the media id. The host is checked separately,
|
|
59
|
+
* against {@link domains}.
|
|
60
|
+
*/
|
|
61
|
+
mediaIdPaths: readonly string[];
|
|
62
|
+
/** A regular expression, anchored at both ends, a media id must match. */
|
|
63
|
+
mediaIdPattern: string;
|
|
64
|
+
/** The one origin the host's player is framed from. */
|
|
65
|
+
playerOrigin: string;
|
|
66
|
+
/** The player page's path on {@link playerOrigin}; `{id}` is the media id. */
|
|
67
|
+
playerPath: string;
|
|
68
|
+
/** The query every player address carries, in this order. */
|
|
69
|
+
playerQuery?: readonly VideoEmbedPlayerParam[];
|
|
70
|
+
}
|
|
71
|
+
/** A declaration, with the plugin that made it. */
|
|
72
|
+
export interface ResolvedVideoEmbedProvider extends VideoEmbedProviderDeclaration {
|
|
73
|
+
pluginId: string;
|
|
74
|
+
}
|
|
75
|
+
/** A link a declared host recognized. */
|
|
76
|
+
export interface VideoEmbed {
|
|
77
|
+
provider: ResolvedVideoEmbedProvider;
|
|
78
|
+
/** The media id the link named, and nothing else of it. */
|
|
79
|
+
mediaId: string;
|
|
80
|
+
/**
|
|
81
|
+
* The player page with no per-visit options — what a `VideoObject`
|
|
82
|
+
* publishes as `embedUrl`.
|
|
83
|
+
*/
|
|
84
|
+
embedUrl: string;
|
|
85
|
+
}
|
|
86
|
+
/** Every host a first-party plugin declares. */
|
|
87
|
+
export declare function videoEmbedProviders(): readonly ResolvedVideoEmbedProvider[];
|
|
88
|
+
/**
|
|
89
|
+
* The declared host a link belongs to, with the media id it names, or
|
|
90
|
+
* `undefined` for anything else: a value that is not an http(s) URL, a host
|
|
91
|
+
* nothing declares, or a path that names no id the host's pattern accepts.
|
|
92
|
+
*/
|
|
93
|
+
export declare function videoEmbedOf(value: unknown, providers?: readonly ResolvedVideoEmbedProvider[]): VideoEmbed | undefined;
|
|
94
|
+
/** The player page for a declared host's link, with no per-visit options. */
|
|
95
|
+
export declare function videoEmbedUrl(value: unknown, providers?: readonly ResolvedVideoEmbedProvider[]): string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* The address of a declared host's player frame for this visit, carrying the
|
|
98
|
+
* declaration's query in its own order. See {@link VideoEmbedPlayerOption}
|
|
99
|
+
* for what each option means and which way it defaults.
|
|
100
|
+
*/
|
|
101
|
+
export declare function videoEmbedPlayerSrc(value: unknown, options?: VideoEmbedPlayerOptions, providers?: readonly ResolvedVideoEmbedProvider[]): string | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Every origin a declared player is framed from: what a published page's
|
|
104
|
+
* `frame-src` admits for the Video element.
|
|
105
|
+
*/
|
|
106
|
+
export declare function videoEmbedPlayerOrigins(providers?: readonly ResolvedVideoEmbedProvider[]): string[];
|
|
107
|
+
/** The declared hosts' names, as an author knows them. */
|
|
108
|
+
export declare function videoEmbedProviderLabels(providers?: readonly ResolvedVideoEmbedProvider[]): string[];
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
* A VIDEO HOST WHOSE OWN PLAYER A VIDEO PLAYS IN (AGL-3080).
|
|
18
|
+
*
|
|
19
|
+
* Some video hosts hand an author a link to a page, not to a file: the film
|
|
20
|
+
* plays only inside the host's player, framed from the host's origin. The
|
|
21
|
+
* Video element recognizes such a link, keeps only the media id it names,
|
|
22
|
+
* and frames the host's player for it. Core never names a host. A plugin
|
|
23
|
+
* DECLARES one — the domains its links live on, where in the path the media
|
|
24
|
+
* id sits, the one origin its player is framed from, and the query that
|
|
25
|
+
* player reads — and core's resolvers answer from the declarations alone.
|
|
26
|
+
*
|
|
27
|
+
* This sits beside `media-delivery-provider.ts` and is not that seam. A
|
|
28
|
+
* delivery provider is where the platform serves ITS OWN copy of a file
|
|
29
|
+
* from; an embed provider is a host whose player the author chose, which the
|
|
30
|
+
* platform never serves a byte of.
|
|
31
|
+
*
|
|
32
|
+
* ## Only the media id survives
|
|
33
|
+
*
|
|
34
|
+
* The string an author pasted never reaches a frame. {@link videoEmbedOf}
|
|
35
|
+
* reads the media id out of it, and every address below is rebuilt from the
|
|
36
|
+
* declaration and that id alone, so a declared player is framed from its
|
|
37
|
+
* declared origin and nowhere else. That closed set is what lets a published
|
|
38
|
+
* page's `frame-src` name the origin for every site
|
|
39
|
+
* ({@link videoEmbedPlayerOrigins}). The id must match the declaration's own
|
|
40
|
+
* pattern AND {@link SAFE_MEDIA_ID}, so no declaration can widen the path it
|
|
41
|
+
* is put into.
|
|
42
|
+
*
|
|
43
|
+
* ## Compiled, and deliberately without a runtime registrar
|
|
44
|
+
*
|
|
45
|
+
* The readers are the published page and its policy: the Video element that
|
|
46
|
+
* plays the link, the `VideoObject` a crawler reads, the built-in entry page
|
|
47
|
+
* that decides whether a featured film can play, and the tenant middleware
|
|
48
|
+
* whose `frame-src` must admit the player. None of them loads a plugin's
|
|
49
|
+
* console code, and the middleware loads no plugin at all. A registry one of
|
|
50
|
+
* them had not filled would render a customer's link as a `<video>` pointed
|
|
51
|
+
* at an HTML page, or refuse the frame, and nothing would go red — the
|
|
52
|
+
* AGL-3025 shape, on the customer's own film. So a first-party plugin
|
|
53
|
+
* declares its hosts under `videoEmbedProviders` in `plugins.config.json`,
|
|
54
|
+
* `tools/scripts/generate-plugin-manifests.mjs` validates and compiles them,
|
|
55
|
+
* and this module reads the compiled list.
|
|
56
|
+
*
|
|
57
|
+
* A marketplace plugin cannot add a host this way, and that is the point
|
|
58
|
+
* rather than a gap: a declaration widens every published page's
|
|
59
|
+
* `frame-src`, which is a platform decision, not one a plugin's own code
|
|
60
|
+
* makes at runtime.
|
|
61
|
+
*
|
|
62
|
+
* ## What "absent" means
|
|
63
|
+
*
|
|
64
|
+
* A link no declaration recognizes is an ordinary URL, rendered exactly as
|
|
65
|
+
* any other link is. Removing a declaration therefore turns its links back
|
|
66
|
+
* into plain URLs, which play nothing — so the declaring plugin's spec holds
|
|
67
|
+
* the declaration to the links it must keep reading.
|
|
68
|
+
*/ import { FIRST_PARTY_VIDEO_EMBED_PROVIDERS } from "./first-party-plugins.generated.js";
|
|
69
|
+
export const VIDEO_EMBED_PLAYER_OPTIONS = [
|
|
70
|
+
'autoPlay',
|
|
71
|
+
'doNotTrack',
|
|
72
|
+
'muted',
|
|
73
|
+
'loop'
|
|
74
|
+
];
|
|
75
|
+
/**
|
|
76
|
+
* The floor every media id stands on, whatever a declaration's own pattern
|
|
77
|
+
* admits: no separator, dot, query or fragment can reach the player path.
|
|
78
|
+
*/ const SAFE_MEDIA_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
79
|
+
/** The placeholder a `playerPath` names the media id with. */ const ID_PLACEHOLDER = '{id}';
|
|
80
|
+
/** Every host a first-party plugin declares. */ export function videoEmbedProviders() {
|
|
81
|
+
return FIRST_PARTY_VIDEO_EMBED_PROVIDERS;
|
|
82
|
+
}
|
|
83
|
+
const compiled = new WeakMap();
|
|
84
|
+
function compile(provider) {
|
|
85
|
+
let answer = compiled.get(provider);
|
|
86
|
+
if (!answer) {
|
|
87
|
+
answer = {
|
|
88
|
+
paths: provider.mediaIdPaths.map((source)=>new RegExp(source)),
|
|
89
|
+
mediaId: new RegExp(provider.mediaIdPattern)
|
|
90
|
+
};
|
|
91
|
+
compiled.set(provider, answer);
|
|
92
|
+
}
|
|
93
|
+
return answer;
|
|
94
|
+
}
|
|
95
|
+
function onDomain(hostname, domains) {
|
|
96
|
+
return domains.some((domain)=>hostname === domain || hostname.endsWith(`.${domain}`));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The declared host a link belongs to, with the media id it names, or
|
|
100
|
+
* `undefined` for anything else: a value that is not an http(s) URL, a host
|
|
101
|
+
* nothing declares, or a path that names no id the host's pattern accepts.
|
|
102
|
+
*/ export function videoEmbedOf(value, providers = videoEmbedProviders()) {
|
|
103
|
+
if (typeof value !== 'string' || !providers.length) return undefined;
|
|
104
|
+
let url;
|
|
105
|
+
try {
|
|
106
|
+
url = new URL(value.trim());
|
|
107
|
+
} catch (unused) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
if (url.protocol !== 'https:' && url.protocol !== 'http:') return undefined;
|
|
111
|
+
for (const provider of providers){
|
|
112
|
+
if (!onDomain(url.hostname, provider.domains)) continue;
|
|
113
|
+
const { paths, mediaId } = compile(provider);
|
|
114
|
+
for (const pattern of paths){
|
|
115
|
+
var _pattern_exec;
|
|
116
|
+
const id = (_pattern_exec = pattern.exec(url.pathname)) == null ? void 0 : _pattern_exec[1];
|
|
117
|
+
if (id && mediaId.test(id) && SAFE_MEDIA_ID.test(id)) {
|
|
118
|
+
return {
|
|
119
|
+
provider,
|
|
120
|
+
mediaId: id,
|
|
121
|
+
embedUrl: `${provider.playerOrigin}${provider.playerPath.replace(ID_PLACEHOLDER, id)}`
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
/** The player page for a declared host's link, with no per-visit options. */ export function videoEmbedUrl(value, providers) {
|
|
129
|
+
var _videoEmbedOf;
|
|
130
|
+
return (_videoEmbedOf = videoEmbedOf(value, providers)) == null ? void 0 : _videoEmbedOf.embedUrl;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The address of a declared host's player frame for this visit, carrying the
|
|
134
|
+
* declaration's query in its own order. See {@link VideoEmbedPlayerOption}
|
|
135
|
+
* for what each option means and which way it defaults.
|
|
136
|
+
*/ export function videoEmbedPlayerSrc(value, options = {}, providers) {
|
|
137
|
+
var _embed_provider_playerQuery;
|
|
138
|
+
const embed = videoEmbedOf(value, providers);
|
|
139
|
+
if (!embed) return undefined;
|
|
140
|
+
const params = new URLSearchParams();
|
|
141
|
+
for (const entry of (_embed_provider_playerQuery = embed.provider.playerQuery) != null ? _embed_provider_playerQuery : []){
|
|
142
|
+
if ('value' in entry) {
|
|
143
|
+
params.set(entry.param, entry.value);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const on = entry.option === 'autoPlay' ? options.autoPlay !== false : Boolean(options[entry.option]);
|
|
147
|
+
const sent = on ? entry.on : entry.off;
|
|
148
|
+
if (sent !== undefined) params.set(entry.param, sent);
|
|
149
|
+
}
|
|
150
|
+
const query = params.toString();
|
|
151
|
+
return query ? `${embed.embedUrl}?${query}` : embed.embedUrl;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Every origin a declared player is framed from: what a published page's
|
|
155
|
+
* `frame-src` admits for the Video element.
|
|
156
|
+
*/ export function videoEmbedPlayerOrigins(providers = videoEmbedProviders()) {
|
|
157
|
+
return [
|
|
158
|
+
...new Set(providers.map((provider)=>provider.playerOrigin))
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
/** The declared hosts' names, as an author knows them. */ export function videoEmbedProviderLabels(providers = videoEmbedProviders()) {
|
|
162
|
+
return providers.map((provider)=>provider.label);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=video-embed-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/video-embed-provider.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/**\n * A VIDEO HOST WHOSE OWN PLAYER A VIDEO PLAYS IN (AGL-3080).\n *\n * Some video hosts hand an author a link to a page, not to a file: the film\n * plays only inside the host's player, framed from the host's origin. The\n * Video element recognizes such a link, keeps only the media id it names,\n * and frames the host's player for it. Core never names a host. A plugin\n * DECLARES one — the domains its links live on, where in the path the media\n * id sits, the one origin its player is framed from, and the query that\n * player reads — and core's resolvers answer from the declarations alone.\n *\n * This sits beside `media-delivery-provider.ts` and is not that seam. A\n * delivery provider is where the platform serves ITS OWN copy of a file\n * from; an embed provider is a host whose player the author chose, which the\n * platform never serves a byte of.\n *\n * ## Only the media id survives\n *\n * The string an author pasted never reaches a frame. {@link videoEmbedOf}\n * reads the media id out of it, and every address below is rebuilt from the\n * declaration and that id alone, so a declared player is framed from its\n * declared origin and nowhere else. That closed set is what lets a published\n * page's `frame-src` name the origin for every site\n * ({@link videoEmbedPlayerOrigins}). The id must match the declaration's own\n * pattern AND {@link SAFE_MEDIA_ID}, so no declaration can widen the path it\n * is put into.\n *\n * ## Compiled, and deliberately without a runtime registrar\n *\n * The readers are the published page and its policy: the Video element that\n * plays the link, the `VideoObject` a crawler reads, the built-in entry page\n * that decides whether a featured film can play, and the tenant middleware\n * whose `frame-src` must admit the player. None of them loads a plugin's\n * console code, and the middleware loads no plugin at all. A registry one of\n * them had not filled would render a customer's link as a `<video>` pointed\n * at an HTML page, or refuse the frame, and nothing would go red — the\n * AGL-3025 shape, on the customer's own film. So a first-party plugin\n * declares its hosts under `videoEmbedProviders` in `plugins.config.json`,\n * `tools/scripts/generate-plugin-manifests.mjs` validates and compiles them,\n * and this module reads the compiled list.\n *\n * A marketplace plugin cannot add a host this way, and that is the point\n * rather than a gap: a declaration widens every published page's\n * `frame-src`, which is a platform decision, not one a plugin's own code\n * makes at runtime.\n *\n * ## What \"absent\" means\n *\n * A link no declaration recognizes is an ordinary URL, rendered exactly as\n * any other link is. Removing a declaration therefore turns its links back\n * into plain URLs, which play nothing — so the declaring plugin's spec holds\n * the declaration to the links it must keep reading.\n */\n\nimport { FIRST_PARTY_VIDEO_EMBED_PROVIDERS } from './first-party-plugins.generated'\n\n/**\n * A choice the Video element makes for each player it frames. A declaration\n * says how its player spells each one it supports; one it does not name is\n * never sent.\n *\n * - `autoPlay` — start as soon as the player is ready. ON unless the caller\n * passes exactly `false`: the usual frame is the one a visitor's press\n * loads, and a second play button inside it would ask them twice.\n * - `doNotTrack` — ask the host not to record the viewing session.\n * - `muted` — start without sound.\n * - `loop` — restart at the end.\n */\nexport type VideoEmbedPlayerOption = 'autoPlay' | 'doNotTrack' | 'muted' | 'loop'\n\nexport const VIDEO_EMBED_PLAYER_OPTIONS: readonly VideoEmbedPlayerOption[] = [\n 'autoPlay',\n 'doNotTrack',\n 'muted',\n 'loop',\n]\n\nexport type VideoEmbedPlayerOptions = Partial<\n Record<VideoEmbedPlayerOption, boolean>\n>\n\n/**\n * One query parameter of a player address, in the order the declaration\n * lists them. Either `value`, sent on every address, or an `option` whose\n * state picks `on` or `off`; a state with no value leaves the parameter out.\n */\nexport type VideoEmbedPlayerParam =\n | { param: string; value: string }\n | {\n param: string\n option: VideoEmbedPlayerOption\n on?: string\n off?: string\n }\n\nexport interface VideoEmbedProviderDeclaration {\n /** Stable id, unique across plugins. */\n id: string\n /** The host's name as an author knows it, for labels and help text. */\n label: string\n /**\n * The domains a link's host must equal or end in (after a dot). Exact or\n * dot-anchored only, so a domain that merely contains one is refused.\n */\n domains: readonly string[]\n /**\n * Regular expressions over a link's PATH, anchored at both ends, whose\n * first capture group is the media id. The host is checked separately,\n * against {@link domains}.\n */\n mediaIdPaths: readonly string[]\n /** A regular expression, anchored at both ends, a media id must match. */\n mediaIdPattern: string\n /** The one origin the host's player is framed from. */\n playerOrigin: string\n /** The player page's path on {@link playerOrigin}; `{id}` is the media id. */\n playerPath: string\n /** The query every player address carries, in this order. */\n playerQuery?: readonly VideoEmbedPlayerParam[]\n}\n\n/** A declaration, with the plugin that made it. */\nexport interface ResolvedVideoEmbedProvider\n extends VideoEmbedProviderDeclaration {\n pluginId: string\n}\n\n/** A link a declared host recognized. */\nexport interface VideoEmbed {\n provider: ResolvedVideoEmbedProvider\n /** The media id the link named, and nothing else of it. */\n mediaId: string\n /**\n * The player page with no per-visit options — what a `VideoObject`\n * publishes as `embedUrl`.\n */\n embedUrl: string\n}\n\n/**\n * The floor every media id stands on, whatever a declaration's own pattern\n * admits: no separator, dot, query or fragment can reach the player path.\n */\nconst SAFE_MEDIA_ID = /^[A-Za-z0-9_-]{1,64}$/\n\n/** The placeholder a `playerPath` names the media id with. */\nconst ID_PLACEHOLDER = '{id}'\n\n/** Every host a first-party plugin declares. */\nexport function videoEmbedProviders(): readonly ResolvedVideoEmbedProvider[] {\n return FIRST_PARTY_VIDEO_EMBED_PROVIDERS\n}\n\ninterface CompiledProvider {\n paths: RegExp[]\n mediaId: RegExp\n}\n\nconst compiled = new WeakMap<VideoEmbedProviderDeclaration, CompiledProvider>()\n\nfunction compile(provider: VideoEmbedProviderDeclaration): CompiledProvider {\n let answer = compiled.get(provider)\n if (!answer) {\n answer = {\n paths: provider.mediaIdPaths.map((source) => new RegExp(source)),\n mediaId: new RegExp(provider.mediaIdPattern),\n }\n compiled.set(provider, answer)\n }\n return answer\n}\n\nfunction onDomain(hostname: string, domains: readonly string[]): boolean {\n return domains.some(\n (domain) => hostname === domain || hostname.endsWith(`.${domain}`),\n )\n}\n\n/**\n * The declared host a link belongs to, with the media id it names, or\n * `undefined` for anything else: a value that is not an http(s) URL, a host\n * nothing declares, or a path that names no id the host's pattern accepts.\n */\nexport function videoEmbedOf(\n value: unknown,\n providers: readonly ResolvedVideoEmbedProvider[] = videoEmbedProviders(),\n): VideoEmbed | undefined {\n if (typeof value !== 'string' || !providers.length) return undefined\n let url: URL\n try {\n url = new URL(value.trim())\n } catch {\n return undefined\n }\n if (url.protocol !== 'https:' && url.protocol !== 'http:') return undefined\n for (const provider of providers) {\n if (!onDomain(url.hostname, provider.domains)) continue\n const { paths, mediaId } = compile(provider)\n for (const pattern of paths) {\n const id = pattern.exec(url.pathname)?.[1]\n if (id && mediaId.test(id) && SAFE_MEDIA_ID.test(id)) {\n return {\n provider,\n mediaId: id,\n embedUrl: `${provider.playerOrigin}${provider.playerPath.replace(ID_PLACEHOLDER, id)}`,\n }\n }\n }\n }\n return undefined\n}\n\n/** The player page for a declared host's link, with no per-visit options. */\nexport function videoEmbedUrl(\n value: unknown,\n providers?: readonly ResolvedVideoEmbedProvider[],\n): string | undefined {\n return videoEmbedOf(value, providers)?.embedUrl\n}\n\n/**\n * The address of a declared host's player frame for this visit, carrying the\n * declaration's query in its own order. See {@link VideoEmbedPlayerOption}\n * for what each option means and which way it defaults.\n */\nexport function videoEmbedPlayerSrc(\n value: unknown,\n options: VideoEmbedPlayerOptions = {},\n providers?: readonly ResolvedVideoEmbedProvider[],\n): string | undefined {\n const embed = videoEmbedOf(value, providers)\n if (!embed) return undefined\n const params = new URLSearchParams()\n for (const entry of embed.provider.playerQuery ?? []) {\n if ('value' in entry) {\n params.set(entry.param, entry.value)\n continue\n }\n const on =\n entry.option === 'autoPlay'\n ? options.autoPlay !== false\n : Boolean(options[entry.option])\n const sent = on ? entry.on : entry.off\n if (sent !== undefined) params.set(entry.param, sent)\n }\n const query = params.toString()\n return query ? `${embed.embedUrl}?${query}` : embed.embedUrl\n}\n\n/**\n * Every origin a declared player is framed from: what a published page's\n * `frame-src` admits for the Video element.\n */\nexport function videoEmbedPlayerOrigins(\n providers: readonly ResolvedVideoEmbedProvider[] = videoEmbedProviders(),\n): string[] {\n return [...new Set(providers.map((provider) => provider.playerOrigin))]\n}\n\n/** The declared hosts' names, as an author knows them. */\nexport function videoEmbedProviderLabels(\n providers: readonly ResolvedVideoEmbedProvider[] = videoEmbedProviders(),\n): string[] {\n return providers.map((provider) => provider.label)\n}\n"],"names":["FIRST_PARTY_VIDEO_EMBED_PROVIDERS","VIDEO_EMBED_PLAYER_OPTIONS","SAFE_MEDIA_ID","ID_PLACEHOLDER","videoEmbedProviders","compiled","WeakMap","compile","provider","answer","get","paths","mediaIdPaths","map","source","RegExp","mediaId","mediaIdPattern","set","onDomain","hostname","domains","some","domain","endsWith","videoEmbedOf","value","providers","length","undefined","url","URL","trim","protocol","pattern","id","exec","pathname","test","embedUrl","playerOrigin","playerPath","replace","videoEmbedUrl","videoEmbedPlayerSrc","options","embed","params","URLSearchParams","entry","playerQuery","param","on","option","autoPlay","Boolean","sent","off","query","toString","videoEmbedPlayerOrigins","Set","videoEmbedProviderLabels","label"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDC,GAED,SAASA,iCAAiC,QAAQ,qCAAiC;AAgBnF,OAAO,MAAMC,6BAAgE;IAC3E;IACA;IACA;IACA;CACD,CAAA;AAgED;;;CAGC,GACD,MAAMC,gBAAgB;AAEtB,4DAA4D,GAC5D,MAAMC,iBAAiB;AAEvB,8CAA8C,GAC9C,OAAO,SAASC;IACd,OAAOJ;AACT;AAOA,MAAMK,WAAW,IAAIC;AAErB,SAASC,QAAQC,QAAuC;IACtD,IAAIC,SAASJ,SAASK,GAAG,CAACF;IAC1B,IAAI,CAACC,QAAQ;QACXA,SAAS;YACPE,OAAOH,SAASI,YAAY,CAACC,GAAG,CAAC,CAACC,SAAW,IAAIC,OAAOD;YACxDE,SAAS,IAAID,OAAOP,SAASS,cAAc;QAC7C;QACAZ,SAASa,GAAG,CAACV,UAAUC;IACzB;IACA,OAAOA;AACT;AAEA,SAASU,SAASC,QAAgB,EAAEC,OAA0B;IAC5D,OAAOA,QAAQC,IAAI,CACjB,CAACC,SAAWH,aAAaG,UAAUH,SAASI,QAAQ,CAAC,CAAC,CAAC,EAAED,QAAQ;AAErE;AAEA;;;;CAIC,GACD,OAAO,SAASE,aACdC,KAAc,EACdC,YAAmDvB,qBAAqB;IAExE,IAAI,OAAOsB,UAAU,YAAY,CAACC,UAAUC,MAAM,EAAE,OAAOC;IAC3D,IAAIC;IACJ,IAAI;QACFA,MAAM,IAAIC,IAAIL,MAAMM,IAAI;IAC1B,EAAE,eAAM;QACN,OAAOH;IACT;IACA,IAAIC,IAAIG,QAAQ,KAAK,YAAYH,IAAIG,QAAQ,KAAK,SAAS,OAAOJ;IAClE,KAAK,MAAMrB,YAAYmB,UAAW;QAChC,IAAI,CAACR,SAASW,IAAIV,QAAQ,EAAEZ,SAASa,OAAO,GAAG;QAC/C,MAAM,EAAEV,KAAK,EAAEK,OAAO,EAAE,GAAGT,QAAQC;QACnC,KAAK,MAAM0B,WAAWvB,MAAO;gBAChBuB;YAAX,MAAMC,MAAKD,gBAAAA,QAAQE,IAAI,CAACN,IAAIO,QAAQ,sBAAzBH,aAA4B,CAAC,EAAE;YAC1C,IAAIC,MAAMnB,QAAQsB,IAAI,CAACH,OAAOjC,cAAcoC,IAAI,CAACH,KAAK;gBACpD,OAAO;oBACL3B;oBACAQ,SAASmB;oBACTI,UAAU,GAAG/B,SAASgC,YAAY,GAAGhC,SAASiC,UAAU,CAACC,OAAO,CAACvC,gBAAgBgC,KAAK;gBACxF;YACF;QACF;IACF;IACA,OAAON;AACT;AAEA,2EAA2E,GAC3E,OAAO,SAASc,cACdjB,KAAc,EACdC,SAAiD;QAE1CF;IAAP,QAAOA,gBAAAA,aAAaC,OAAOC,+BAApBF,cAAgCc,QAAQ;AACjD;AAEA;;;;CAIC,GACD,OAAO,SAASK,oBACdlB,KAAc,EACdmB,UAAmC,CAAC,CAAC,EACrClB,SAAiD;QAK7BmB;IAHpB,MAAMA,QAAQrB,aAAaC,OAAOC;IAClC,IAAI,CAACmB,OAAO,OAAOjB;IACnB,MAAMkB,SAAS,IAAIC;IACnB,KAAK,MAAMC,UAASH,8BAAAA,MAAMtC,QAAQ,CAAC0C,WAAW,YAA1BJ,8BAA8B,EAAE,CAAE;QACpD,IAAI,WAAWG,OAAO;YACpBF,OAAO7B,GAAG,CAAC+B,MAAME,KAAK,EAAEF,MAAMvB,KAAK;YACnC;QACF;QACA,MAAM0B,KACJH,MAAMI,MAAM,KAAK,aACbR,QAAQS,QAAQ,KAAK,QACrBC,QAAQV,OAAO,CAACI,MAAMI,MAAM,CAAC;QACnC,MAAMG,OAAOJ,KAAKH,MAAMG,EAAE,GAAGH,MAAMQ,GAAG;QACtC,IAAID,SAAS3B,WAAWkB,OAAO7B,GAAG,CAAC+B,MAAME,KAAK,EAAEK;IAClD;IACA,MAAME,QAAQX,OAAOY,QAAQ;IAC7B,OAAOD,QAAQ,GAAGZ,MAAMP,QAAQ,CAAC,CAAC,EAAEmB,OAAO,GAAGZ,MAAMP,QAAQ;AAC9D;AAEA;;;CAGC,GACD,OAAO,SAASqB,wBACdjC,YAAmDvB,qBAAqB;IAExE,OAAO;WAAI,IAAIyD,IAAIlC,UAAUd,GAAG,CAAC,CAACL,WAAaA,SAASgC,YAAY;KAAG;AACzE;AAEA,wDAAwD,GACxD,OAAO,SAASsB,yBACdnC,YAAmDvB,qBAAqB;IAExE,OAAOuB,UAAUd,GAAG,CAAC,CAACL,WAAaA,SAASuD,KAAK;AACnD"}
|
package/src/lib/types/nodes.d.ts
CHANGED
|
@@ -363,8 +363,8 @@ export interface NodeSchema<P = JSX.AnyProps> extends NodeI<P> {
|
|
|
363
363
|
*
|
|
364
364
|
* ## Shape
|
|
365
365
|
*
|
|
366
|
-
* Deliberately the same `
|
|
367
|
-
*
|
|
366
|
+
* Deliberately the same `SiteInteraction` a site-wide interaction is, so
|
|
367
|
+
* nothing about the runtime changes: the selector is stamped from this
|
|
368
368
|
* node's own id when the page is composed, and the compiled result is the
|
|
369
369
|
* shape the client engine has always consumed. `trigger.selector` is
|
|
370
370
|
* therefore ignored here — the node IS the selector.
|