@wildo-ai/external-connectors-public 1.1.5 → 1.1.7
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/dist/esm/app/compose-frontend-app-providers.d.ts.map +1 -1
- package/dist/esm/app/compose-frontend-app-providers.js.map +1 -1
- package/dist/esm/app/compose-hydrated-frontend-app-providers.d.ts.map +1 -1
- package/dist/esm/app/compose-hydrated-frontend-app-providers.js +4 -0
- package/dist/esm/app/compose-hydrated-frontend-app-providers.js.map +1 -1
- package/dist/esm/app/engine-frontend-app-provider-registry.d.ts.map +1 -1
- package/dist/esm/app/engine-frontend-app-provider-registry.js +23 -10
- package/dist/esm/app/engine-frontend-app-provider-registry.js.map +1 -1
- package/dist/esm/app/frontend-app-provider-module.types.d.ts +22 -2
- package/dist/esm/app/frontend-app-provider-module.types.d.ts.map +1 -1
- package/dist/esm/app/frontend-app-provider-module.types.js +1 -1
- package/dist/esm/app/frontend-app-provider-module.types.js.map +1 -1
- package/dist/esm/app/frontend-app-provider-registry.types.d.ts.map +1 -1
- package/dist/esm/app/frontend-app-provider-registry.types.js.map +1 -1
- package/dist/esm/app/index.d.ts +2 -0
- package/dist/esm/app/index.d.ts.map +1 -1
- package/dist/esm/app/index.js +5 -0
- package/dist/esm/app/index.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +23 -5
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js +131 -18
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/engine-frontend-providers-package.d.ts.map +1 -1
- package/dist/esm/engine-frontend-providers-package.js.map +1 -1
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.d.ts +2 -2
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.js +2 -2
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/dropbox/index.d.ts.map +1 -1
- package/dist/esm/providers/dropbox/index.js.map +1 -1
- package/dist/esm/providers/google-drive/google-drive.frontend-app.module.d.ts +2 -2
- package/dist/esm/providers/google-drive/google-drive.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/google-drive/google-drive.frontend-app.module.js +2 -2
- package/dist/esm/providers/google-drive/google-drive.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/google-drive/index.d.ts.map +1 -1
- package/dist/esm/providers/google-drive/index.js.map +1 -1
- package/dist/esm/providers/google-places/google-places.frontend-app.module.d.ts +48 -0
- package/dist/esm/providers/google-places/google-places.frontend-app.module.d.ts.map +1 -0
- package/dist/esm/providers/google-places/google-places.frontend-app.module.js +81 -0
- package/dist/esm/providers/google-places/google-places.frontend-app.module.js.map +1 -0
- package/dist/esm/providers/microsoft-onedrive/index.d.ts.map +1 -1
- package/dist/esm/providers/microsoft-onedrive/index.js.map +1 -1
- package/dist/esm/providers/microsoft-onedrive/microsoft-onedrive.frontend-app.module.d.ts +10 -16
- package/dist/esm/providers/microsoft-onedrive/microsoft-onedrive.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/microsoft-onedrive/microsoft-onedrive.frontend-app.module.js +10 -16
- package/dist/esm/providers/microsoft-onedrive/microsoft-onedrive.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/posthog/index.d.ts.map +1 -1
- package/dist/esm/providers/posthog/index.js.map +1 -1
- package/dist/esm/providers/posthog/posthog-browser-options.d.ts +34 -0
- package/dist/esm/providers/posthog/posthog-browser-options.d.ts.map +1 -0
- package/dist/esm/providers/posthog/posthog-browser-options.js +34 -0
- package/dist/esm/providers/posthog/posthog-browser-options.js.map +1 -0
- package/dist/esm/providers/posthog/posthog.frontend-app.module.d.ts +38 -0
- package/dist/esm/providers/posthog/posthog.frontend-app.module.d.ts.map +1 -0
- package/dist/esm/providers/posthog/posthog.frontend-app.module.js +111 -0
- package/dist/esm/providers/posthog/posthog.frontend-app.module.js.map +1 -0
- package/dist/esm/providers/posthog/posthog.frontend-website.module.d.ts.map +1 -1
- package/dist/esm/providers/posthog/posthog.frontend-website.module.js +19 -4
- package/dist/esm/providers/posthog/posthog.frontend-website.module.js.map +1 -1
- package/dist/esm/providers/recaptcha/index.d.ts.map +1 -1
- package/dist/esm/providers/recaptcha/index.js.map +1 -1
- package/dist/esm/providers/recaptcha/recaptcha.frontend-website.module.d.ts +41 -0
- package/dist/esm/providers/recaptcha/recaptcha.frontend-website.module.d.ts.map +1 -1
- package/dist/esm/providers/recaptcha/recaptcha.frontend-website.module.js +137 -14
- package/dist/esm/providers/recaptcha/recaptcha.frontend-website.module.js.map +1 -1
- package/dist/esm/providers/sentry/sentry.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/sentry/sentry.frontend-app.module.js +6 -1
- package/dist/esm/providers/sentry/sentry.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/sentry/sentry.frontend-website.module.d.ts.map +1 -1
- package/dist/esm/providers/sentry/sentry.frontend-website.module.js +7 -1
- package/dist/esm/providers/sentry/sentry.frontend-website.module.js.map +1 -1
- package/dist/esm/shared/activate-frontend-provider-sdks.d.ts +41 -1
- package/dist/esm/shared/activate-frontend-provider-sdks.d.ts.map +1 -1
- package/dist/esm/shared/activate-frontend-provider-sdks.js +63 -5
- package/dist/esm/shared/activate-frontend-provider-sdks.js.map +1 -1
- package/dist/esm/shared/frontend-provider-consent.d.ts +293 -26
- package/dist/esm/shared/frontend-provider-consent.d.ts.map +1 -1
- package/dist/esm/shared/frontend-provider-consent.js +197 -34
- package/dist/esm/shared/frontend-provider-consent.js.map +1 -1
- package/dist/esm/shared/frontend-provider-surface.types.d.ts +29 -2
- package/dist/esm/shared/frontend-provider-surface.types.d.ts.map +1 -1
- package/dist/esm/shared/frontend-provider-surface.types.js +27 -4
- package/dist/esm/shared/frontend-provider-surface.types.js.map +1 -1
- package/dist/esm/shared/hydrate-frontend-providers.d.ts +26 -1
- package/dist/esm/shared/hydrate-frontend-providers.d.ts.map +1 -1
- package/dist/esm/shared/hydrate-frontend-providers.js +95 -17
- package/dist/esm/shared/hydrate-frontend-providers.js.map +1 -1
- package/dist/esm/shared/load-frontend-provider-scripts.d.ts +4 -9
- package/dist/esm/shared/load-frontend-provider-scripts.d.ts.map +1 -1
- package/dist/esm/shared/load-frontend-provider-scripts.js +15 -10
- package/dist/esm/shared/load-frontend-provider-scripts.js.map +1 -1
- package/dist/esm/shared/provider-component-registry.d.ts +346 -0
- package/dist/esm/shared/provider-component-registry.d.ts.map +1 -0
- package/dist/esm/shared/provider-component-registry.js +501 -0
- package/dist/esm/shared/provider-component-registry.js.map +1 -0
- package/dist/esm/techdoc/compose-frontend-techdoc-providers.d.ts.map +1 -1
- package/dist/esm/techdoc/compose-frontend-techdoc-providers.js.map +1 -1
- package/dist/esm/techdoc/compose-hydrated-frontend-techdoc-providers.d.ts.map +1 -1
- package/dist/esm/techdoc/compose-hydrated-frontend-techdoc-providers.js +4 -0
- package/dist/esm/techdoc/compose-hydrated-frontend-techdoc-providers.js.map +1 -1
- package/dist/esm/techdoc/engine-frontend-techdoc-provider-registry.d.ts.map +1 -1
- package/dist/esm/techdoc/engine-frontend-techdoc-provider-registry.js +22 -4
- package/dist/esm/techdoc/engine-frontend-techdoc-provider-registry.js.map +1 -1
- package/dist/esm/techdoc/frontend-techdoc-provider-module.types.d.ts +23 -1
- package/dist/esm/techdoc/frontend-techdoc-provider-module.types.d.ts.map +1 -1
- package/dist/esm/techdoc/frontend-techdoc-provider-module.types.js +1 -0
- package/dist/esm/techdoc/frontend-techdoc-provider-module.types.js.map +1 -1
- package/dist/esm/techdoc/frontend-techdoc-provider-registry.types.d.ts.map +1 -1
- package/dist/esm/techdoc/frontend-techdoc-provider-registry.types.js.map +1 -1
- package/dist/esm/techdoc/index.d.ts +1 -0
- package/dist/esm/techdoc/index.d.ts.map +1 -1
- package/dist/esm/techdoc/index.js +1 -0
- package/dist/esm/techdoc/index.js.map +1 -1
- package/dist/esm/website/compose-frontend-website-providers.d.ts.map +1 -1
- package/dist/esm/website/compose-frontend-website-providers.js.map +1 -1
- package/dist/esm/website/compose-hydrated-frontend-website-providers.d.ts.map +1 -1
- package/dist/esm/website/compose-hydrated-frontend-website-providers.js +4 -0
- package/dist/esm/website/compose-hydrated-frontend-website-providers.js.map +1 -1
- package/dist/esm/website/engine-frontend-website-provider-registry.d.ts.map +1 -1
- package/dist/esm/website/engine-frontend-website-provider-registry.js.map +1 -1
- package/dist/esm/website/frontend-website-provider-module.types.d.ts +23 -1
- package/dist/esm/website/frontend-website-provider-module.types.d.ts.map +1 -1
- package/dist/esm/website/frontend-website-provider-module.types.js +1 -0
- package/dist/esm/website/frontend-website-provider-module.types.js.map +1 -1
- package/dist/esm/website/frontend-website-provider-registry.types.d.ts.map +1 -1
- package/dist/esm/website/frontend-website-provider-registry.types.js.map +1 -1
- package/dist/esm/website/index.d.ts +1 -0
- package/dist/esm/website/index.d.ts.map +1 -1
- package/dist/esm/website/index.js +1 -0
- package/dist/esm/website/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/esm/providers/algolia/algolia.frontend-techdoc.module.d.ts +0 -3
- package/dist/esm/providers/algolia/algolia.frontend-techdoc.module.d.ts.map +0 -1
- package/dist/esm/providers/algolia/algolia.frontend-techdoc.module.js +0 -36
- package/dist/esm/providers/algolia/algolia.frontend-techdoc.module.js.map +0 -1
- package/dist/esm/providers/algolia/index.d.ts +0 -2
- package/dist/esm/providers/algolia/index.d.ts.map +0 -1
- package/dist/esm/providers/algolia/index.js +0 -2
- package/dist/esm/providers/algolia/index.js.map +0 -1
- package/dist/esm/providers/apple/apple.frontend-app.module.d.ts +0 -3
- package/dist/esm/providers/apple/apple.frontend-app.module.d.ts.map +0 -1
- package/dist/esm/providers/apple/apple.frontend-app.module.js +0 -25
- package/dist/esm/providers/apple/apple.frontend-app.module.js.map +0 -1
- package/dist/esm/providers/apple/index.d.ts +0 -2
- package/dist/esm/providers/apple/index.d.ts.map +0 -1
- package/dist/esm/providers/apple/index.js +0 -2
- package/dist/esm/providers/apple/index.js.map +0 -1
- package/dist/esm/providers/github/github.frontend-app.module.d.ts +0 -3
- package/dist/esm/providers/github/github.frontend-app.module.d.ts.map +0 -1
- package/dist/esm/providers/github/github.frontend-app.module.js +0 -24
- package/dist/esm/providers/github/github.frontend-app.module.js.map +0 -1
- package/dist/esm/providers/github/index.d.ts +0 -2
- package/dist/esm/providers/github/index.d.ts.map +0 -1
- package/dist/esm/providers/github/index.js +0 -2
- package/dist/esm/providers/github/index.js.map +0 -1
- package/dist/esm/providers/google/google.frontend-app.module.d.ts +0 -12
- package/dist/esm/providers/google/google.frontend-app.module.d.ts.map +0 -1
- package/dist/esm/providers/google/google.frontend-app.module.js +0 -37
- package/dist/esm/providers/google/google.frontend-app.module.js.map +0 -1
- package/dist/esm/providers/google/index.d.ts +0 -2
- package/dist/esm/providers/google/index.d.ts.map +0 -1
- package/dist/esm/providers/google/index.js +0 -2
- package/dist/esm/providers/google/index.js.map +0 -1
- package/dist/esm/providers/microsoft/index.d.ts +0 -2
- package/dist/esm/providers/microsoft/index.d.ts.map +0 -1
- package/dist/esm/providers/microsoft/index.js +0 -2
- package/dist/esm/providers/microsoft/index.js.map +0 -1
- package/dist/esm/providers/microsoft/microsoft.frontend-app.module.d.ts +0 -9
- package/dist/esm/providers/microsoft/microsoft.frontend-app.module.d.ts.map +0 -1
- package/dist/esm/providers/microsoft/microsoft.frontend-app.module.js +0 -30
- package/dist/esm/providers/microsoft/microsoft.frontend-app.module.js.map +0 -1
- package/dist/esm/providers/stripe/index.d.ts +0 -2
- package/dist/esm/providers/stripe/index.d.ts.map +0 -1
- package/dist/esm/providers/stripe/index.js +0 -2
- package/dist/esm/providers/stripe/index.js.map +0 -1
- package/dist/esm/providers/stripe/stripe.frontend-app.module.d.ts +0 -3
- package/dist/esm/providers/stripe/stripe.frontend-app.module.d.ts.map +0 -1
- package/dist/esm/providers/stripe/stripe.frontend-app.module.js +0 -24
- package/dist/esm/providers/stripe/stripe.frontend-app.module.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-frontend-app-providers.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"compose-frontend-app-providers.d.ts","sourceRoot":"","sources":["../../../src/app/compose-frontend-app-providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,wCAAwC,CAAC;AAEhD,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAC;CAClF;AAED,wBAAgB,2BAA2B,CACzC,GAAG,SAAS,EAAE,aAAa,CAAC,mCAAmC,CAAC,GAC/D,2BAA2B,CAQ7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-frontend-app-providers.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"compose-frontend-app-providers.js","sourceRoot":"","sources":["../../../src/app/compose-frontend-app-providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,uBAAuB,EAC9B,2BAA2B,GAC5B,MAAM,sCAAsC,CAAC;AAY9C,MAAM,UAAU,2BAA2B,CACzC,GAAG,SAA6D;IAEhE,MAAM,QAAQ,GAAG,uBAAuB,CACtC,aAAa,EACb,SAAS,CACV,CAAC;IACF,wFAAwF;IACxF,2BAA2B,CAAC,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtE,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/**\n * `composeFrontendAppProviders` — frontend-app-facet wrapper around the\n * generic `composeProviderRegistry` core. See\n * `@wildo-ai/saas-models/external-providers/compose-provider-registry.shared`\n * for behavior, conflict policy, and indexing semantics.\n */\n\nimport { composeProviderRegistry,\n assertProviderTierCoherence,\n} from '@wildo-ai/saas-models/public-runtime';\n\nimport type { FrontendAppProviderModule } from './frontend-app-provider-module.types';\nimport type {\n FrontendAppProviderRef,\n FrontendAppProviderRegistry,\n} from './frontend-app-provider-registry.types';\n\nexport interface FrontendAppProviderRegistryFragment {\n readonly modules: ReadonlyMap<FrontendAppProviderRef, FrontendAppProviderModule>;\n}\n\nexport function composeFrontendAppProviders(\n ...fragments: ReadonlyArray<FrontendAppProviderRegistryFragment>\n): FrontendAppProviderRegistry {\n const registry = composeProviderRegistry<FrontendAppProviderRef, FrontendAppProviderModule>(\n 'FrontendApp',\n fragments,\n );\n // #328 — the tier rule holds on every facet: a CATALOGUE provider binds no engine slot.\n assertProviderTierCoherence('FrontendApp', registry.modules.values());\n return registry;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-hydrated-frontend-app-providers.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"compose-hydrated-frontend-app-providers.d.ts","sourceRoot":"","sources":["../../../src/app/compose-hydrated-frontend-app-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,KAAK,EAEV,2BAA2B,EAC5B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC;AAE9F;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,6BAA6B,CAAC,yBAAyB,CAAC,GAC9D,2BAA2B,CA2B7B"}
|
|
@@ -35,6 +35,10 @@ export function composeHydratedFrontendAppProviders(input) {
|
|
|
35
35
|
// capability may bind an engine slot at all.
|
|
36
36
|
providerCapabilities: module.providerCapabilities,
|
|
37
37
|
protocols: module.protocols,
|
|
38
|
+
// Unchecked for the same reason, and safe for a stronger one (#1702): the consent decision reads
|
|
39
|
+
// these as strings and FAILS CLOSED on any that is not a `ConsentPurpose`, so a wrong member here
|
|
40
|
+
// withholds the provider rather than widening what it may do.
|
|
41
|
+
consentPurposes: module.consentPurposes,
|
|
38
42
|
},
|
|
39
43
|
]));
|
|
40
44
|
return composeFrontendAppProviders({ modules });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-hydrated-frontend-app-providers.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"compose-hydrated-frontend-app-providers.js","sourceRoot":"","sources":["../../../src/app/compose-hydrated-frontend-app-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EACL,8BAA8B,GAE/B,MAAM,sCAAsC,CAAC;AAc9C;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CACjD,KAA+D;IAE/D,MAAM,QAAQ,GAAG,8BAA8B,CAA4B,KAAK,CAAC,CAAC;IAClF,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;QACnC,GAA6B;QAC7B;YACE,GAAG,MAAM;YACT,wEAAwE;YACxE,sEAAsE;YACtE,kEAAkE;YAClE,0EAA0E;YAC1E,6EAA6E;YAC7E,gEAAgE;YAChE,iEAAiE;YACjE,gFAAgF;YAChF,mEAAmE;YACnE,6CAA6C;YAC7C,oBAAoB,EAAE,MAAM,CAAC,oBAAyD;YACtF,SAAS,EAAE,MAAM,CAAC,SAA4C;YAC9D,iGAAiG;YACjG,kGAAkG;YAClG,8DAA8D;YAC9D,eAAe,EAAE,MAAM,CAAC,eAA4D;SACrF;KACF,CAAC,CACH,CAAC;IACF,OAAO,2BAA2B,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/**\n * Hydration for the main SaaS-app frontend facet: the DATA channel joined with the\n * CODE channel, composed into the same registry every consumer already reads.\n *\n * `composeFrontendAppProviders` (the fragment-composition core) is unchanged and still the\n * single place the tier rule runs. What is added here is the step BEFORE it —\n * building each module from its served entry and, where the bundle carries it,\n * the provider package's own module — so the registry is no longer produced by\n * casting a JSON entry to a module type.\n *\n * See `../shared/hydrate-frontend-providers.ts` for the join rule and the\n * diagnostics it raises.\n */\n\nimport type { ConsentPurpose, ProviderCapability, ProviderProtocol } from '@wildo-ai/saas-models/public-runtime';\n\nimport type { FrontendAppProviderModule } from './frontend-app-provider-module.types';\nimport type {\n FrontendAppProviderRef,\n FrontendAppProviderRegistry,\n} from './frontend-app-provider-registry.types';\nimport { composeFrontendAppProviders } from './compose-frontend-app-providers';\nimport {\n hydrateFrontendProviderModules,\n type HydrateFrontendProvidersInput,\n} from '../shared/hydrate-frontend-providers';\n\n/**\n * The shape of `generatedFrontendProviderModules` in a\n * `frontend-providers.generated.ts` written by `wildo config sync` for a\n * main SaaS-app frontend service.\n *\n * The key is the provider's `ref` and must equal `module.metadata.ref`; the\n * join refuses a mismatch rather than binding one provider's code to another's\n * configuration. Config sync emits an empty map for a service with no providers,\n * keeping its startup import stable when the last provider is removed.\n */\nexport type GeneratedAppProviderModules = Readonly<Record<string, FrontendAppProviderModule>>;\n\n/**\n * Joins the served provider entries with the bundle's generated modules and\n * composes the result.\n */\nexport function composeHydratedFrontendAppProviders(\n input: HydrateFrontendProvidersInput<FrontendAppProviderModule>,\n): FrontendAppProviderRegistry {\n const hydrated = hydrateFrontendProviderModules<FrontendAppProviderModule>(input);\n const modules = new Map<FrontendAppProviderRef, FrontendAppProviderModule>(\n [...hydrated].map(([ref, module]) => [\n ref as FrontendAppProviderRef,\n {\n ...module,\n // The ONE narrowing on this path, and it is an unchecked cast: the wire\n // carries `string`, the module type is the capability/protocol union.\n // It was left unchecked because that union was extended by module\n // augmentation, so its members did not exist at runtime — no longer true:\n // `ProviderCapability` is the built-in set since #502 and `ProviderProtocol`\n // is `BuiltinProviderProtocol`, and both sets exist at runtime.\n // A runtime check is now possible and not yet written. What does\n // have teeth still runs: `composeFrontendAppProviders` applies the tier rule to\n // every composed module, which is the check that decides whether a\n // capability may bind an engine slot at all.\n providerCapabilities: module.providerCapabilities as ReadonlyArray<ProviderCapability>,\n protocols: module.protocols as ReadonlyArray<ProviderProtocol>,\n // Unchecked for the same reason, and safe for a stronger one (#1702): the consent decision reads\n // these as strings and FAILS CLOSED on any that is not a `ConsentPurpose`, so a wrong member here\n // withholds the provider rather than widening what it may do.\n consentPurposes: module.consentPurposes as ReadonlyArray<ConsentPurpose> | undefined,\n },\n ]),\n );\n return composeFrontendAppProviders({ modules });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-frontend-app-provider-registry.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"engine-frontend-app-provider-registry.d.ts","sourceRoot":"","sources":["../../../src/app/engine-frontend-app-provider-registry.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AA6B5F,eAAO,MAAM,yCAAyC,EAAE,mCAOvD,CAAC;AAEF,eAAO,MAAM,iCAAiC,8EAE7C,CAAC"}
|
|
@@ -1,25 +1,38 @@
|
|
|
1
|
-
import { AppleFrontendAppProvider } from '../providers/apple/index.js';
|
|
2
1
|
import { DropboxFrontendAppProvider } from '../providers/dropbox/index.js';
|
|
3
|
-
import { GitHubFrontendAppProvider } from '../providers/github/index.js';
|
|
4
|
-
import { GoogleFrontendAppProvider } from '../providers/google/index.js';
|
|
5
2
|
import { GoogleDriveFrontendAppProvider } from '../providers/google-drive/index.js';
|
|
6
|
-
|
|
3
|
+
// The owning source directly: a new provider directory gets no intermediary barrel.
|
|
4
|
+
import { GooglePlacesFrontendAppProvider } from '../providers/google-places/google-places.frontend-app.module.js';
|
|
7
5
|
import { MicrosoftOneDriveFrontendAppProvider } from '../providers/microsoft-onedrive/index.js';
|
|
6
|
+
// The owning source directly, as for Sentry: the `posthog` barrel exports the WEBSITE module.
|
|
7
|
+
import { PostHogFrontendAppProvider } from '../providers/posthog/posthog.frontend-app.module.js';
|
|
8
8
|
// The owning source directly — see the note in the website registry: a barrel exporting
|
|
9
9
|
// both of Sentry's surface modules would put the website module in this app bundle.
|
|
10
10
|
import { SentryFrontendAppProvider } from '../providers/sentry/sentry.frontend-app.module.js';
|
|
11
|
-
import { StripeFrontendAppProvider } from '../providers/stripe/index.js';
|
|
12
11
|
import { composeFrontendAppProviders } from './compose-frontend-app-providers.js';
|
|
12
|
+
/**
|
|
13
|
+
* The engine's application-tier browser modules: only providers that RUN something in the browser.
|
|
14
|
+
*
|
|
15
|
+
* The four sign-in vendors (Apple, GitHub, Google, Microsoft) and Stripe used to have modules here that
|
|
16
|
+
* loaded nothing and declared `SSO_OAUTH2` / `BILLING` only so the sign-in buttons, the identity-links
|
|
17
|
+
* page and the billing components could read a provider display name off them (#1701). Since #1895 that
|
|
18
|
+
* name belongs to the provider REF (`providers.<ref>.displayName`, planned and generated for every
|
|
19
|
+
* declared provider), and those surfaces derive it from the ref they already hold — the configured
|
|
20
|
+
* `auth.socialOAuth2Providers` key, the configured `billing.providerRef`. The modules then carried
|
|
21
|
+
* nothing, while still telling the catalogue that the browser covers sign-in and billing, so they were
|
|
22
|
+
* removed. Sign-in is a redirect to the vendor and checkout / the customer portal are hosted redirects:
|
|
23
|
+
* no vendor code runs on the page. Rejected: keeping them and listing the sign-in buttons from the
|
|
24
|
+
* registry (a module that loads nothing would become a precondition for a button), and a new
|
|
25
|
+
* "identity-only" frontend presence (a declaration whose only content is a name the ref already owns).
|
|
26
|
+
* A vendor whose BROWSER code a surface does run — Google One Tap, Stripe Elements (#1741) — gets a
|
|
27
|
+
* module then, under a capability that says what it runs.
|
|
28
|
+
*/
|
|
13
29
|
const frontendAppProviders = [
|
|
14
|
-
AppleFrontendAppProvider,
|
|
15
30
|
DropboxFrontendAppProvider,
|
|
16
|
-
GitHubFrontendAppProvider,
|
|
17
|
-
GoogleFrontendAppProvider,
|
|
18
31
|
GoogleDriveFrontendAppProvider,
|
|
19
|
-
|
|
32
|
+
GooglePlacesFrontendAppProvider,
|
|
20
33
|
MicrosoftOneDriveFrontendAppProvider,
|
|
34
|
+
PostHogFrontendAppProvider,
|
|
21
35
|
SentryFrontendAppProvider,
|
|
22
|
-
StripeFrontendAppProvider,
|
|
23
36
|
];
|
|
24
37
|
export const EngineFrontendAppProviderRegistryFragment = {
|
|
25
38
|
modules: new Map(frontendAppProviders.map((provider) => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-frontend-app-provider-registry.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"engine-frontend-app-provider-registry.js","sourceRoot":"","sources":["../../../src/app/engine-frontend-app-provider-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,oFAAoF;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,8DAA8D,CAAC;AAC/G,OAAO,EAAE,oCAAoC,EAAE,MAAM,iCAAiC,CAAC;AACvF,8FAA8F;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAC9F,wFAAwF;AACxF,oFAAoF;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAE3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAI/E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,oBAAoB,GAAG;IAC3B,0BAA0B;IAC1B,8BAA8B;IAC9B,+BAA+B;IAC/B,oCAAoC;IACpC,0BAA0B;IAC1B,yBAAyB;CACjB,CAAC;AAEX,MAAM,CAAC,MAAM,yCAAyC,GAAwC;IAC5F,OAAO,EAAE,IAAI,GAAG,CACd,oBAAoB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;QACrC,QAAQ,CAAC,QAAQ,CAAC,GAA6B;QAC/C,QAAQ;KACT,CAAC,CACH;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,2BAA2B,CAC1E,yCAAyC,CAC1C,CAAC","sourcesContent":["import { DropboxFrontendAppProvider } from '../providers/dropbox';\nimport { GoogleDriveFrontendAppProvider } from '../providers/google-drive';\n// The owning source directly: a new provider directory gets no intermediary barrel.\nimport { GooglePlacesFrontendAppProvider } from '../providers/google-places/google-places.frontend-app.module';\nimport { MicrosoftOneDriveFrontendAppProvider } from '../providers/microsoft-onedrive';\n// The owning source directly, as for Sentry: the `posthog` barrel exports the WEBSITE module.\nimport { PostHogFrontendAppProvider } from '../providers/posthog/posthog.frontend-app.module';\n// The owning source directly — see the note in the website registry: a barrel exporting\n// both of Sentry's surface modules would put the website module in this app bundle.\nimport { SentryFrontendAppProvider } from '../providers/sentry/sentry.frontend-app.module';\n\nimport { composeFrontendAppProviders } from './compose-frontend-app-providers';\nimport type { FrontendAppProviderRegistryFragment } from './compose-frontend-app-providers';\nimport type { FrontendAppProviderRef } from './frontend-app-provider-registry.types';\n\n/**\n * The engine's application-tier browser modules: only providers that RUN something in the browser.\n *\n * The four sign-in vendors (Apple, GitHub, Google, Microsoft) and Stripe used to have modules here that\n * loaded nothing and declared `SSO_OAUTH2` / `BILLING` only so the sign-in buttons, the identity-links\n * page and the billing components could read a provider display name off them (#1701). Since #1895 that\n * name belongs to the provider REF (`providers.<ref>.displayName`, planned and generated for every\n * declared provider), and those surfaces derive it from the ref they already hold — the configured\n * `auth.socialOAuth2Providers` key, the configured `billing.providerRef`. The modules then carried\n * nothing, while still telling the catalogue that the browser covers sign-in and billing, so they were\n * removed. Sign-in is a redirect to the vendor and checkout / the customer portal are hosted redirects:\n * no vendor code runs on the page. Rejected: keeping them and listing the sign-in buttons from the\n * registry (a module that loads nothing would become a precondition for a button), and a new\n * \"identity-only\" frontend presence (a declaration whose only content is a name the ref already owns).\n * A vendor whose BROWSER code a surface does run — Google One Tap, Stripe Elements (#1741) — gets a\n * module then, under a capability that says what it runs.\n */\nconst frontendAppProviders = [\n DropboxFrontendAppProvider,\n GoogleDriveFrontendAppProvider,\n GooglePlacesFrontendAppProvider,\n MicrosoftOneDriveFrontendAppProvider,\n PostHogFrontendAppProvider,\n SentryFrontendAppProvider,\n] as const;\n\nexport const EngineFrontendAppProviderRegistryFragment: FrontendAppProviderRegistryFragment = {\n modules: new Map(\n frontendAppProviders.map((provider) => [\n provider.metadata.ref as FrontendAppProviderRef,\n provider,\n ]),\n ),\n};\n\nexport const EngineFrontendAppProviderRegistry = composeFrontendAppProviders(\n EngineFrontendAppProviderRegistryFragment,\n);\n"]}
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* to the other.
|
|
14
14
|
*
|
|
15
15
|
* The `publicConfig` slice is the only place public configuration flows
|
|
16
|
-
* to the frontend (e.g.
|
|
16
|
+
* to the frontend (e.g. a file picker's `appId`, an error monitor's DSN).
|
|
17
17
|
*
|
|
18
18
|
* I18n ownership stays at the consuming frontend surface: provider modules
|
|
19
19
|
* export translation-ready keys on `metadata`, while React/UI code resolves
|
|
20
20
|
* those keys through the app i18n service at render time. Do not freeze
|
|
21
21
|
* localized button labels or provider names into `publicConfig`.
|
|
22
22
|
*/
|
|
23
|
-
import type { FileStorageAccepted, ProviderComplianceProfile } from '@wildo-ai/saas-models/public-runtime';
|
|
23
|
+
import type { ConsentPurpose, FileStorageAccepted, ProviderComplianceProfile } from '@wildo-ai/saas-models/public-runtime';
|
|
24
24
|
import type { ProviderFrontendCspFootprintDeclaration, ProviderFrontendScriptDeclaration, ProviderMetadata, ProviderCapability, ProviderProtocol } from '@wildo-ai/saas-models/public-runtime';
|
|
25
25
|
import type { ProviderFrontendComponents, ProviderFrontendPublicConfigSchema, ProviderFrontendSdk } from '../shared/frontend-provider-surface.types';
|
|
26
26
|
/** @wildo_source:part:start external-connectors.app.frontend-provider-module facet:layer:frontend facet:family:provider */
|
|
@@ -155,6 +155,15 @@ export interface FrontendAppProviderModule {
|
|
|
155
155
|
* so a renamed key yielded `undefined` and a silently wrong provider. With a
|
|
156
156
|
* schema declared, the framework validates once at hydration and a mismatch
|
|
157
157
|
* says which key and why.
|
|
158
|
+
*
|
|
159
|
+
* MANDATORY for an authored module (#1705): its declared keys are the only
|
|
160
|
+
* list that bounds what a browser is served, so a module without one — or
|
|
161
|
+
* with one whose keys cannot be read without running it (use
|
|
162
|
+
* `defineFrontendPublicConfigSchema` or a Zod object) — is refused at
|
|
163
|
+
* projection, at `wildo config sync` and at hydration. It stays OPTIONAL in
|
|
164
|
+
* this type on purpose: the same type describes a HYDRATED registry entry, and
|
|
165
|
+
* a provider the service declares but whose code this bundle does not carry is
|
|
166
|
+
* data-only and has no schema to hold. The three runtime refusals are the gate.
|
|
158
167
|
*/
|
|
159
168
|
publicConfigSchema?: ProviderFrontendPublicConfigSchema;
|
|
160
169
|
/**
|
|
@@ -176,6 +185,17 @@ export interface FrontendAppProviderModule {
|
|
|
176
185
|
* `VENDOR_HOSTED` provider declaring no region cannot support a transfer statement.
|
|
177
186
|
*/
|
|
178
187
|
complianceProfile?: ProviderComplianceProfile;
|
|
188
|
+
/**
|
|
189
|
+
* Consent purposes THIS VENDOR rests on beyond its capabilities' floor (#1702). DATA.
|
|
190
|
+
*
|
|
191
|
+
* ADDITIVE: the provider rests on the union of these and the floor
|
|
192
|
+
* `PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION` gives each declared capability, so nothing
|
|
193
|
+
* written here can lower what a capability requires. Declare it when the vendor's own processing goes
|
|
194
|
+
* beyond the service the person asked for — Google reCAPTCHA is the measured case, a captcha whose
|
|
195
|
+
* vendor also analyses the visitor for its own purposes — and leave it out otherwise. A consent-based
|
|
196
|
+
* provider's SDK, scripts and components are all withheld until the person grants these.
|
|
197
|
+
*/
|
|
198
|
+
consentPurposes?: ReadonlyArray<ConsentPurpose>;
|
|
179
199
|
}
|
|
180
200
|
/** @wildo_source:part:end external-connectors.app.frontend-provider-module */
|
|
181
201
|
//# sourceMappingURL=frontend-app-provider-module.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-app-provider-module.types.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"frontend-app-provider-module.types.d.ts","sourceRoot":"","sources":["../../../src/app/frontend-app-provider-module.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAE3H,OAAO,KAAK,EACV,uCAAuC,EACvC,iCAAiC,EACjC,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,0BAA0B,EAC1B,kCAAkC,EAClC,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAEnD,2HAA2H;AAC3H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,oBAAoB,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACxD,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC3C;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,GAAG,CAAC,EAAE,uCAAuC,CAAC;IAC9C;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,iCAAiC,CAAC,CAAC;IAC3D;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC;;;;;;;;;;;;;;;;;;OAkBG;IACH,kBAAkB,CAAC,EAAE,kCAAkC,CAAC;IACxD;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACjD;AACD,8EAA8E"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* to the other.
|
|
14
14
|
*
|
|
15
15
|
* The `publicConfig` slice is the only place public configuration flows
|
|
16
|
-
* to the frontend (e.g.
|
|
16
|
+
* to the frontend (e.g. a file picker's `appId`, an error monitor's DSN).
|
|
17
17
|
*
|
|
18
18
|
* I18n ownership stays at the consuming frontend surface: provider modules
|
|
19
19
|
* export translation-ready keys on `metadata`, while React/UI code resolves
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-app-provider-module.types.js","sourceRoot":"","sources":["../../../../src/app/frontend-app-provider-module.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA2KH,8EAA8E","sourcesContent":["/**\n * `FrontendAppProviderModule` — browser-bound facet of a provider for\n * the main SaaS-app frontend (`AppFrontendType.SAAS_APP`).\n *\n * Intentionally HOLDS NO SECRETS — this type lives in\n * `@wildo-ai/external-connectors-public/app`, the browser-bound side\n * of the trust-zone split.\n *\n * The module is the CODE half of a provider's frontend surface. Its DATA half\n * is `FrontendProviderEntry`, hydrated on first paint via\n * `FrontendAppBootstrapPayload.frontendProviders`; the two are joined at\n * runtime by `composeHydratedFrontendAppProviders` rather than one being cast\n * to the other.\n *\n * The `publicConfig` slice is the only place public configuration flows\n * to the frontend (e.g. Stripe publishable keys, OAuth client IDs).\n *\n * I18n ownership stays at the consuming frontend surface: provider modules\n * export translation-ready keys on `metadata`, while React/UI code resolves\n * those keys through the app i18n service at render time. Do not freeze\n * localized button labels or provider names into `publicConfig`.\n */\n\nimport type { FileStorageAccepted, ProviderComplianceProfile } from '@wildo-ai/saas-models/public-runtime';\n\nimport type {\n ProviderFrontendCspFootprintDeclaration,\n ProviderFrontendScriptDeclaration,\n ProviderMetadata,\n ProviderCapability,\n ProviderProtocol,\n} from '@wildo-ai/saas-models/public-runtime';\nimport type {\n ProviderFrontendComponents,\n ProviderFrontendPublicConfigSchema,\n ProviderFrontendSdk,\n} from '../shared/frontend-provider-surface.types';\n\n/** @wildo_source:part:start external-connectors.app.frontend-provider-module facet:layer:frontend facet:family:provider */\n/**\n * The browser-bound provider module an application authors for its main\n * SaaS-app frontend.\n *\n * Import from `@wildo-ai/external-connectors-public/app`. The module is a\n * plain object — no class, no registration call: the app re-exports it\n * through its `./frontend-providers` package entry and appends a matching\n * companion contribution; the framework joins it with the provider's hydrated\n * entry on first paint.\n *\n * NEVER put a secret in this object — it ships to the browser. `publicConfig`\n * is the only channel for public runtime configuration (publishable keys,\n * client IDs, picker constraints). Author `metadata` ONLY through\n * `defineProviderMetadata({ ref, packageName, tier, origin })` (#328): it\n * derives the translation-ready display-name key and records the provider's\n * identity — package, tier (an application-owned file picker is CATALOGUE: it\n * binds no engine slot), vendor and origin. Never a frozen localized string,\n * never a hand-written identity.\n *\n * ## Two channels, and which fields ride which\n *\n * `metadata`, `providerCapabilities`, `protocols`, `publicConfig`, `csp` and\n * `scripts` are DATA: they are projected onto the provider's entry, travel as\n * JSON, and are what the CLI reads when it composes the service's\n * Content-Security-Policy — it cannot execute this module, because it is a Node\n * process and this module is browser-bound.\n *\n * `sdk.activate` and `publicConfigSchema` are CODE. They reach a bundle only\n * because the bundle imports this module, through the generated\n * `frontend-providers.generated.ts` that `wildo config sync` writes for each\n * frontend service. They are never serialized; a JSON channel would drop them\n * without a word.\n *\n * A worked module declaring every field is in\n * `frontend-app-provider.example.ts`, beside this file. It lives there rather\n * than in an `@example` block here because the package's typecheck compiles it:\n * the inline version shipped for a session showing three of the CSP footprint's\n * six buckets while the type required all six, and nothing caught it.\n */\nexport interface FrontendAppProviderModule {\n metadata: ProviderMetadata;\n providerCapabilities: ReadonlyArray<ProviderCapability>;\n protocols: ReadonlyArray<ProviderProtocol>;\n /**\n * Public configuration the frontend needs at runtime. Strongly typed\n * via per-providerCapability shapes downstream — the registry stores\n * them as `unknown` so the registry shape stays independent of any one\n * provider's config shape. Declare `publicConfigSchema`\n * beside it to have the framework validate it once, at hydration,\n * instead of each use site coercing it by hand.\n */\n publicConfig?: Readonly<Record<string, unknown>>;\n /**\n * Origins this provider needs the SaaS app's composed CSP to admit.\n *\n * DATA: projected onto the provider entry and read by `resolveCspPolicy`'s\n * provider layer, per service and per environment. Declaring it here is what\n * removes the alternative — hand-editing script / frame / connect origins in\n * every application's config, for every environment.\n *\n * Name only the buckets you reach; the framework fills in the rest. For an\n * endpoint you CANNOT know — one the application configures, such as a\n * monitoring DSN, an analytics host, a self-hosted deployment — declare where\n * it lives instead of guessing what it is:\n *\n * ```ts\n * csp: {\n * derivedOrigins: [\n * { publicConfigKey: 'dsn', bucket: ProviderFrontendCspOriginBucket.CONNECT },\n * ],\n * }\n * ```\n *\n * The framework reads that key out of your own `publicConfig` and takes its\n * URL origin. That is what stops an application authoring the same host twice\n * — once as your configuration, once in its CSP — where the copy that drifts\n * fails only in production, because development is report-only.\n */\n csp?: ProviderFrontendCspFootprintDeclaration;\n /**\n * Third-party `<script>` tags the surface must add for this provider — the\n * case a dynamic `import()` cannot serve, because the vendor ships a\n * global-installing tag rather than an npm module.\n *\n * DATA. Each declared `src`'s origin MUST also appear in `csp.scriptOrigins`\n * — `projectFrontendProviderContribution` refuses the provider otherwise,\n * because the policy it contributes to would block its own script, and only\n * where CSP enforces, so the failure would first appear in production.\n */\n scripts?: ReadonlyArray<ProviderFrontendScriptDeclaration>;\n /**\n * The provider's vendor SDK: which package (DATA) and how to load and start\n * it (CODE).\n *\n * `activate` must reach its package through a DYNAMIC `import()`, so the SDK\n * is a separate chunk and no page pays for a provider it does not use.\n */\n sdk?: ProviderFrontendSdk;\n /**\n * Components this provider contributes, keyed by the capability each fills\n * and loaded on demand. CODE: it reaches a bundle only through the generated\n * `frontend-providers.generated.ts`, never through the JSON entry.\n *\n * Several providers may offer a component for ONE capability — two file\n * pickers, two meeting embeds — and that is the point: the surface presents\n * the choice rather than silently taking whichever the registry happened to\n * index first.\n */\n components?: ProviderFrontendComponents;\n /**\n * The `z_file` storage this provider's file picker fronts (#394 P5). Declare\n * it when the picker delivers a `REMOTE_REFERENCE`: the bytes stay at the\n * vendor, so the FILES row lands in this storage and only a field whose\n * `storageAccepted` names it may receive the link. Leave it undeclared for a\n * picker that delivers bytes — those are ingested into the field's own\n * storage and offered to every field.\n *\n * The backend serves the same storage through an `IFileStorageProvider`\n * keyed by this member that names this provider back as its\n * `connectedProviderRef`; the framework pins the two declarations equal.\n */\n fileStorage?: FileStorageAccepted;\n /**\n * Validator for this provider's own `publicConfig`, as a Standard Schema v1\n * value (a Zod 4 schema satisfies it as-is).\n *\n * CODE, and the answer to a real defect: `publicConfig` is\n * `Record<string, unknown>`, and each consuming site was coercing it by hand,\n * so a renamed key yielded `undefined` and a silently wrong provider. With a\n * schema declared, the framework validates once at hydration and a mismatch\n * says which key and why.\n */\n publicConfigSchema?: ProviderFrontendPublicConfigSchema;\n /**\n * The vendor's deployment model, processing regions and legal entity — the primitives a\n * processor register and a transfer statement are derived from.\n *\n * OPTIONAL, matching the backend contract, because a provider whose author has not stated them\n * must still load. Absent means the APPLICATION has to declare them on its own register entry,\n * where its contract with the vendor makes them checkable.\n *\n * Why a FRONTEND provider needs this at least as much as a backend one (#345): this module\n * executes in the DATA SUBJECT'S BROWSER. It loads third-party script, may set storage, and\n * talks to the vendor directly — the application's backend never sees the call. Product\n * analytics, error monitoring, a captcha and a payment element are precisely the third-party\n * recipients a privacy notice has to name, and the operator controls them LESS than a backend\n * provider routed through their own infrastructure.\n *\n * See `ProviderComplianceProfileSchema` for each field's meaning and for the refusal that a\n * `VENDOR_HOSTED` provider declaring no region cannot support a transfer statement.\n */\n complianceProfile?: ProviderComplianceProfile;\n}\n/** @wildo_source:part:end external-connectors.app.frontend-provider-module */\n"]}
|
|
1
|
+
{"version":3,"file":"frontend-app-provider-module.types.js","sourceRoot":"","sources":["../../../src/app/frontend-app-provider-module.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+LH,8EAA8E","sourcesContent":["/**\n * `FrontendAppProviderModule` — browser-bound facet of a provider for\n * the main SaaS-app frontend (`AppFrontendType.SAAS_APP`).\n *\n * Intentionally HOLDS NO SECRETS — this type lives in\n * `@wildo-ai/external-connectors-public/app`, the browser-bound side\n * of the trust-zone split.\n *\n * The module is the CODE half of a provider's frontend surface. Its DATA half\n * is `FrontendProviderEntry`, hydrated on first paint via\n * `FrontendAppBootstrapPayload.frontendProviders`; the two are joined at\n * runtime by `composeHydratedFrontendAppProviders` rather than one being cast\n * to the other.\n *\n * The `publicConfig` slice is the only place public configuration flows\n * to the frontend (e.g. a file picker's `appId`, an error monitor's DSN).\n *\n * I18n ownership stays at the consuming frontend surface: provider modules\n * export translation-ready keys on `metadata`, while React/UI code resolves\n * those keys through the app i18n service at render time. Do not freeze\n * localized button labels or provider names into `publicConfig`.\n */\n\nimport type { ConsentPurpose, FileStorageAccepted, ProviderComplianceProfile } from '@wildo-ai/saas-models/public-runtime';\n\nimport type {\n ProviderFrontendCspFootprintDeclaration,\n ProviderFrontendScriptDeclaration,\n ProviderMetadata,\n ProviderCapability,\n ProviderProtocol,\n} from '@wildo-ai/saas-models/public-runtime';\nimport type {\n ProviderFrontendComponents,\n ProviderFrontendPublicConfigSchema,\n ProviderFrontendSdk,\n} from '../shared/frontend-provider-surface.types';\n\n/** @wildo_source:part:start external-connectors.app.frontend-provider-module facet:layer:frontend facet:family:provider */\n/**\n * The browser-bound provider module an application authors for its main\n * SaaS-app frontend.\n *\n * Import from `@wildo-ai/external-connectors-public/app`. The module is a\n * plain object — no class, no registration call: the app re-exports it\n * through its `./frontend-providers` package entry and appends a matching\n * companion contribution; the framework joins it with the provider's hydrated\n * entry on first paint.\n *\n * NEVER put a secret in this object — it ships to the browser. `publicConfig`\n * is the only channel for public runtime configuration (publishable keys,\n * client IDs, picker constraints). Author `metadata` ONLY through\n * `defineProviderMetadata({ ref, packageName, tier, origin })` (#328): it\n * derives the translation-ready display-name key and records the provider's\n * identity — package, tier (an application-owned file picker is CATALOGUE: it\n * binds no engine slot), vendor and origin. Never a frozen localized string,\n * never a hand-written identity.\n *\n * ## Two channels, and which fields ride which\n *\n * `metadata`, `providerCapabilities`, `protocols`, `publicConfig`, `csp` and\n * `scripts` are DATA: they are projected onto the provider's entry, travel as\n * JSON, and are what the CLI reads when it composes the service's\n * Content-Security-Policy — it cannot execute this module, because it is a Node\n * process and this module is browser-bound.\n *\n * `sdk.activate` and `publicConfigSchema` are CODE. They reach a bundle only\n * because the bundle imports this module, through the generated\n * `frontend-providers.generated.ts` that `wildo config sync` writes for each\n * frontend service. They are never serialized; a JSON channel would drop them\n * without a word.\n *\n * A worked module declaring every field is in\n * `frontend-app-provider.example.ts`, beside this file. It lives there rather\n * than in an `@example` block here because the package's typecheck compiles it:\n * the inline version shipped for a session showing three of the CSP footprint's\n * six buckets while the type required all six, and nothing caught it.\n */\nexport interface FrontendAppProviderModule {\n metadata: ProviderMetadata;\n providerCapabilities: ReadonlyArray<ProviderCapability>;\n protocols: ReadonlyArray<ProviderProtocol>;\n /**\n * Public configuration the frontend needs at runtime. Strongly typed\n * via per-providerCapability shapes downstream — the registry stores\n * them as `unknown` so the registry shape stays independent of any one\n * provider's config shape. Declare `publicConfigSchema`\n * beside it to have the framework validate it once, at hydration,\n * instead of each use site coercing it by hand.\n */\n publicConfig?: Readonly<Record<string, unknown>>;\n /**\n * Origins this provider needs the SaaS app's composed CSP to admit.\n *\n * DATA: projected onto the provider entry and read by `resolveCspPolicy`'s\n * provider layer, per service and per environment. Declaring it here is what\n * removes the alternative — hand-editing script / frame / connect origins in\n * every application's config, for every environment.\n *\n * Name only the buckets you reach; the framework fills in the rest. For an\n * endpoint you CANNOT know — one the application configures, such as a\n * monitoring DSN, an analytics host, a self-hosted deployment — declare where\n * it lives instead of guessing what it is:\n *\n * ```ts\n * csp: {\n * derivedOrigins: [\n * { publicConfigKey: 'dsn', bucket: ProviderFrontendCspOriginBucket.CONNECT },\n * ],\n * }\n * ```\n *\n * The framework reads that key out of your own `publicConfig` and takes its\n * URL origin. That is what stops an application authoring the same host twice\n * — once as your configuration, once in its CSP — where the copy that drifts\n * fails only in production, because development is report-only.\n */\n csp?: ProviderFrontendCspFootprintDeclaration;\n /**\n * Third-party `<script>` tags the surface must add for this provider — the\n * case a dynamic `import()` cannot serve, because the vendor ships a\n * global-installing tag rather than an npm module.\n *\n * DATA. Each declared `src`'s origin MUST also appear in `csp.scriptOrigins`\n * — `projectFrontendProviderContribution` refuses the provider otherwise,\n * because the policy it contributes to would block its own script, and only\n * where CSP enforces, so the failure would first appear in production.\n */\n scripts?: ReadonlyArray<ProviderFrontendScriptDeclaration>;\n /**\n * The provider's vendor SDK: which package (DATA) and how to load and start\n * it (CODE).\n *\n * `activate` must reach its package through a DYNAMIC `import()`, so the SDK\n * is a separate chunk and no page pays for a provider it does not use.\n */\n sdk?: ProviderFrontendSdk;\n /**\n * Components this provider contributes, keyed by the capability each fills\n * and loaded on demand. CODE: it reaches a bundle only through the generated\n * `frontend-providers.generated.ts`, never through the JSON entry.\n *\n * Several providers may offer a component for ONE capability — two file\n * pickers, two meeting embeds — and that is the point: the surface presents\n * the choice rather than silently taking whichever the registry happened to\n * index first.\n */\n components?: ProviderFrontendComponents;\n /**\n * The `z_file` storage this provider's file picker fronts (#394 P5). Declare\n * it when the picker delivers a `REMOTE_REFERENCE`: the bytes stay at the\n * vendor, so the FILES row lands in this storage and only a field whose\n * `storageAccepted` names it may receive the link. Leave it undeclared for a\n * picker that delivers bytes — those are ingested into the field's own\n * storage and offered to every field.\n *\n * The backend serves the same storage through an `IFileStorageProvider`\n * keyed by this member that names this provider back as its\n * `connectedProviderRef`; the framework pins the two declarations equal.\n */\n fileStorage?: FileStorageAccepted;\n /**\n * Validator for this provider's own `publicConfig`, as a Standard Schema v1\n * value (a Zod 4 schema satisfies it as-is).\n *\n * CODE, and the answer to a real defect: `publicConfig` is\n * `Record<string, unknown>`, and each consuming site was coercing it by hand,\n * so a renamed key yielded `undefined` and a silently wrong provider. With a\n * schema declared, the framework validates once at hydration and a mismatch\n * says which key and why.\n *\n * MANDATORY for an authored module (#1705): its declared keys are the only\n * list that bounds what a browser is served, so a module without one — or\n * with one whose keys cannot be read without running it (use\n * `defineFrontendPublicConfigSchema` or a Zod object) — is refused at\n * projection, at `wildo config sync` and at hydration. It stays OPTIONAL in\n * this type on purpose: the same type describes a HYDRATED registry entry, and\n * a provider the service declares but whose code this bundle does not carry is\n * data-only and has no schema to hold. The three runtime refusals are the gate.\n */\n publicConfigSchema?: ProviderFrontendPublicConfigSchema;\n /**\n * The vendor's deployment model, processing regions and legal entity — the primitives a\n * processor register and a transfer statement are derived from.\n *\n * OPTIONAL, matching the backend contract, because a provider whose author has not stated them\n * must still load. Absent means the APPLICATION has to declare them on its own register entry,\n * where its contract with the vendor makes them checkable.\n *\n * Why a FRONTEND provider needs this at least as much as a backend one (#345): this module\n * executes in the DATA SUBJECT'S BROWSER. It loads third-party script, may set storage, and\n * talks to the vendor directly — the application's backend never sees the call. Product\n * analytics, error monitoring, a captcha and a payment element are precisely the third-party\n * recipients a privacy notice has to name, and the operator controls them LESS than a backend\n * provider routed through their own infrastructure.\n *\n * See `ProviderComplianceProfileSchema` for each field's meaning and for the refusal that a\n * `VENDOR_HOSTED` provider declaring no region cannot support a transfer statement.\n */\n complianceProfile?: ProviderComplianceProfile;\n /**\n * Consent purposes THIS VENDOR rests on beyond its capabilities' floor (#1702). DATA.\n *\n * ADDITIVE: the provider rests on the union of these and the floor\n * `PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION` gives each declared capability, so nothing\n * written here can lower what a capability requires. Declare it when the vendor's own processing goes\n * beyond the service the person asked for — Google reCAPTCHA is the measured case, a captcha whose\n * vendor also analyses the visitor for its own purposes — and leave it out otherwise. A consent-based\n * provider's SDK, scripts and components are all withheld until the person grants these.\n */\n consentPurposes?: ReadonlyArray<ConsentPurpose>;\n}\n/** @wildo_source:part:end external-connectors.app.frontend-provider-module */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-app-provider-registry.types.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"frontend-app-provider-registry.types.d.ts","sourceRoot":"","sources":["../../../src/app/frontend-app-provider-registry.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG;IAC5C,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC;CAC5C,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAC;IAEjF,gBAAgB,CAAC,GAAG,EAAE,sBAAsB,GAAG,yBAAyB,GAAG,SAAS,CAAC;IAErF,gCAAgC,CAC9B,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAE5C,gCAAgC,CAC9B,kBAAkB,EAAE,kBAAkB,GACrC,yBAAyB,GAAG,SAAS,CAAC;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-app-provider-registry.types.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"frontend-app-provider-registry.types.js","sourceRoot":"","sources":["../../../src/app/frontend-app-provider-registry.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG","sourcesContent":["/**\n * `FrontendAppProviderRegistry` — composed frontend-app catalog.\n *\n * Mirrors `BackendProviderRegistry` but holds `FrontendAppProviderModule`\n * entries. Consumed at design-time by `defineSaasConfig.providers.frontendApp`\n * (Phase 3) and at runtime by `FrontendProviderRegistryFrontendService`\n * (Phase 6).\n *\n * Phase 0 ships the type only.\n */\n\nimport type { FrontendAppProviderModule } from './frontend-app-provider-module.types';\nimport type { ProviderCapability } from '@wildo-ai/saas-models/public-runtime';\n\nexport type FrontendAppProviderRef = string & {\n readonly __brand: 'FrontendAppProviderRef';\n};\n\nexport interface FrontendAppProviderRegistry {\n readonly modules: ReadonlyMap<FrontendAppProviderRef, FrontendAppProviderModule>;\n\n getProviderByRef(ref: FrontendAppProviderRef): FrontendAppProviderModule | undefined;\n\n getProvidersByProviderCapability(\n providerCapability: ProviderCapability,\n ): ReadonlyArray<FrontendAppProviderModule>;\n\n findProviderByProviderCapability(\n providerCapability: ProviderCapability,\n ): FrontendAppProviderModule | undefined;\n}\n"]}
|
package/dist/esm/app/index.d.ts
CHANGED
|
@@ -13,4 +13,6 @@ export * from '../shared/hydrate-frontend-providers';
|
|
|
13
13
|
export * from '../shared/activate-frontend-provider-sdks';
|
|
14
14
|
export * from '../shared/load-frontend-provider-scripts';
|
|
15
15
|
export * from '../shared/frontend-provider-consent';
|
|
16
|
+
export * from '../shared/provider-component-registry';
|
|
17
|
+
export * from '../providers/google-places/google-places.frontend-app.module';
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AAItD,cAAc,8DAA8D,CAAC"}
|
package/dist/esm/app/index.js
CHANGED
|
@@ -13,4 +13,9 @@ export * from '../shared/hydrate-frontend-providers.js';
|
|
|
13
13
|
export * from '../shared/activate-frontend-provider-sdks.js';
|
|
14
14
|
export * from '../shared/load-frontend-provider-scripts.js';
|
|
15
15
|
export * from '../shared/frontend-provider-consent.js';
|
|
16
|
+
export * from '../shared/provider-component-registry.js';
|
|
17
|
+
// Google Places' address-lookup constants (#561): the operation ids and the region-code limit its adapter, in the
|
|
18
|
+
// facet library, and the backend join test both read. The module has no other surface, so exporting it puts no
|
|
19
|
+
// second facet's code in this bundle.
|
|
20
|
+
export * from '../providers/google-places/google-places.frontend-app.module.js';
|
|
16
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,kHAAkH;AAClH,+GAA+G;AAC/G,sCAAsC;AACtC,cAAc,8DAA8D,CAAC","sourcesContent":["/**\n * Public surface of `@wildo-ai/external-connectors-public/app`.\n *\n * Browser-bound, no secrets. Phase 1 wires `composeFrontendAppProviders`.\n */\n\nexport * from './frontend-app-provider-module.types';\nexport * from './frontend-app-provider-registry.types';\nexport * from './compose-frontend-app-providers';\nexport * from './engine-frontend-app-provider-registry';\nexport * from './compose-hydrated-frontend-app-providers';\nexport * from '../shared/frontend-provider-surface.types';\nexport * from '../shared/hydrate-frontend-providers';\nexport * from '../shared/activate-frontend-provider-sdks';\nexport * from '../shared/load-frontend-provider-scripts';\nexport * from '../shared/frontend-provider-consent';\nexport * from '../shared/provider-component-registry';\n// Google Places' address-lookup constants (#561): the operation ids and the region-code limit its adapter, in the\n// facet library, and the backend join test both read. The module has no other surface, so exporting it puts no\n// second facet's code in this bundle.\nexport * from '../providers/google-places/google-places.frontend-app.module';\n"]}
|
|
@@ -36,9 +36,24 @@
|
|
|
36
36
|
* remain the browser-shipped surface; this `./companion` subpath is
|
|
37
37
|
* tooling-only.
|
|
38
38
|
*/
|
|
39
|
-
import { AppFrontendType, type ProviderFrontendCspFootprintDeclaration, type ProviderFrontendScriptDeclaration, type ProviderFrontendComponentDescriptor, type ProviderFrontendSdkDescriptor, type ProviderMetadata } from '@wildo-ai/saas-models/public-runtime';
|
|
40
|
-
import { type ProviderCompanionContribution, type RuntimeOwnerCompanionExports } from '@wildo-ai/saas-models';
|
|
39
|
+
import { AppFrontendType, type ProviderFrontendCspFootprintDeclaration, type ProviderFrontendScriptDeclaration, type ProviderFrontendComponentDescriptor, type ProviderFrontendSdkDescriptor, type ProviderComplianceProfile, type ProviderMetadata } from '@wildo-ai/saas-models/public-runtime';
|
|
40
|
+
import { EngineCapability, type ProviderCompanionContribution, type RuntimeOwnerCompanionExports } from '@wildo-ai/saas-models';
|
|
41
41
|
import type { FileStorageAccepted } from '@wildo-ai/saas-models/public-runtime';
|
|
42
|
+
/**
|
|
43
|
+
* The engine slots a BROWSER module may fill: the ones whose work happens on the page.
|
|
44
|
+
*
|
|
45
|
+
* Every other slot (billing, mail, LLM, audit…) is served by a backend part. A frontend contribution
|
|
46
|
+
* used to derive `BILLING` from the Stripe module, which loaded no Stripe code, so the catalogue read
|
|
47
|
+
* the browser as covering the billing slot the backend `stripe` part fills (#1701). The consent
|
|
48
|
+
* classification now refuses `BILLING` on a frontend module, and this set is the second, independent
|
|
49
|
+
* statement: whatever a browser-hosted capability ever maps to, a contribution PROJECTED by
|
|
50
|
+
* `projectFrontendProviderContribution` carries only these slots, and a mapping to any other one is
|
|
51
|
+
* refused there instead of advertised. Today the consent classification refuses first, so the join
|
|
52
|
+
* between the two tables is pinned by a test over both, not by this throw; the throw is what holds if
|
|
53
|
+
* a browser-hosted capability is ever mapped to a backend slot. A hand-written contribution does not
|
|
54
|
+
* pass through here.
|
|
55
|
+
*/
|
|
56
|
+
export declare const BROWSER_FILLED_ENGINE_CAPABILITIES: ReadonlySet<EngineCapability>;
|
|
42
57
|
/**
|
|
43
58
|
* The facet-agnostic view of a frontend provider module this projection reads.
|
|
44
59
|
*
|
|
@@ -59,12 +74,15 @@ interface FrontendProviderModuleShape {
|
|
|
59
74
|
scripts?: ReadonlyArray<ProviderFrontendScriptDeclaration>;
|
|
60
75
|
sdk?: {
|
|
61
76
|
readonly descriptor: ProviderFrontendSdkDescriptor;
|
|
77
|
+
readonly stoppable?: true;
|
|
62
78
|
};
|
|
63
79
|
components?: Readonly<Record<string, ProviderFrontendComponentDescriptor & {
|
|
64
80
|
readonly load?: unknown;
|
|
65
81
|
}>>;
|
|
66
82
|
fileStorage?: FileStorageAccepted;
|
|
67
83
|
publicConfigSchema?: unknown;
|
|
84
|
+
complianceProfile?: ProviderComplianceProfile;
|
|
85
|
+
consentPurposes?: ReadonlyArray<string>;
|
|
68
86
|
}
|
|
69
87
|
/**
|
|
70
88
|
* Turns a frontend provider module into the companion contribution tooling
|
|
@@ -77,9 +95,9 @@ interface FrontendProviderModuleShape {
|
|
|
77
95
|
* surface would end up carried by some packages and dropped by others, and a
|
|
78
96
|
* dropped CSP footprint is invisible until a provider is blocked in production.
|
|
79
97
|
*
|
|
80
|
-
* What crosses and what does not is the whole contract. `csp`, `scripts
|
|
81
|
-
*
|
|
82
|
-
* anything — this runs in Node and a facet module is browser-bound. The
|
|
98
|
+
* What crosses and what does not is the whole contract. `csp`, `scripts`, the
|
|
99
|
+
* SDK DESCRIPTOR and the `complianceProfile` cross, because tooling has to read
|
|
100
|
+
* them without executing anything — this runs in Node and a facet module is browser-bound. The
|
|
83
101
|
* executable half — `sdk.activate`, `publicConfigSchema` — does NOT, and cannot:
|
|
84
102
|
* the contribution is serialized to JSON on its way into the generated
|
|
85
103
|
* artifact, so a function would be dropped by `JSON.stringify` with no error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-exports.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"companion-exports.d.ts","sourceRoot":"","sources":["../../src/companion-exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,eAAe,EAIf,KAAK,uCAAuC,EAC5C,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAEhB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EAClC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAWhF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kCAAkC,EAAE,WAAW,CAAC,gBAAgB,CAG3E,CAAC;AAkCH;;;;;;;;;;GAUG;AACH,UAAU,2BAA2B;IACnC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,oBAAoB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,GAAG,CAAC,EAAE,uCAAuC,CAAC;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC,iCAAiC,CAAC,CAAC;IAC3D,GAAG,CAAC,EAAE;QAAE,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC;QAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC;IACxF,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mCAAmC,GAAG;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;IACzG,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACzC;AA0ID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,2BAA2B,EACnC,WAAW,EAAE,eAAe,EAC5B,iBAAiB,EAAE,MAAM,GACxB,6BAA6B,CAgF/B;AAED,6FAA6F;AAC7F,eAAO,MAAM,sCAAsC,EAAE,6BAA6B,EAG/E,CAAC;AAEJ,iGAAiG;AACjG,eAAO,MAAM,0CAA0C,EAAE,6BAA6B,EAGnF,CAAC;AAEJ,uGAAuG;AACvG,eAAO,MAAM,0CAA0C,EAAE,6BAA6B,EAGnF,CAAC;AAEJ,sGAAsG;AACtG,eAAO,MAAM,mCAAmC,EAAE,6BAA6B,EAI9E,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,EAAE,4BAEvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -37,36 +37,58 @@
|
|
|
37
37
|
* tooling-only.
|
|
38
38
|
*/
|
|
39
39
|
import { AppFrontendType, normalizeProviderFrontendCspFootprint, } from '@wildo-ai/saas-models/public-runtime';
|
|
40
|
-
import { PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY, } from '@wildo-ai/saas-models';
|
|
41
|
-
import { admissibleFrontendPublicConfigKeys, readDeclaredPublicConfigKeys } from '@wildo-ai/saas-models/public-runtime';
|
|
40
|
+
import { EngineCapability, PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY, } from '@wildo-ai/saas-models';
|
|
41
|
+
import { admissibleFrontendPublicConfigKeys, normalizeConsentPurposes, readDeclaredPublicConfigKeys } from '@wildo-ai/saas-models/public-runtime';
|
|
42
42
|
import { projectFrontendComponentDescriptors } from './shared/frontend-provider-surface.types.js';
|
|
43
|
+
import { consentBasedProviderStopRefusal, unclassifiedFrontendCapabilities, unknownProviderConsentPurposes } from './shared/frontend-provider-consent.js';
|
|
43
44
|
import { EngineFrontendAppProviderRegistry } from './app/engine-frontend-app-provider-registry.js';
|
|
44
45
|
import { EngineFrontendTechdocProviderRegistry } from './techdoc/engine-frontend-techdoc-provider-registry.js';
|
|
45
46
|
import { EngineFrontendWebsiteProviderRegistry } from './website/engine-frontend-website-provider-registry.js';
|
|
46
47
|
const APP_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/app';
|
|
47
48
|
const TECHDOC_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/techdoc';
|
|
48
49
|
const WEBSITE_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/website';
|
|
50
|
+
/**
|
|
51
|
+
* The engine slots a BROWSER module may fill: the ones whose work happens on the page.
|
|
52
|
+
*
|
|
53
|
+
* Every other slot (billing, mail, LLM, audit…) is served by a backend part. A frontend contribution
|
|
54
|
+
* used to derive `BILLING` from the Stripe module, which loaded no Stripe code, so the catalogue read
|
|
55
|
+
* the browser as covering the billing slot the backend `stripe` part fills (#1701). The consent
|
|
56
|
+
* classification now refuses `BILLING` on a frontend module, and this set is the second, independent
|
|
57
|
+
* statement: whatever a browser-hosted capability ever maps to, a contribution PROJECTED by
|
|
58
|
+
* `projectFrontendProviderContribution` carries only these slots, and a mapping to any other one is
|
|
59
|
+
* refused there instead of advertised. Today the consent classification refuses first, so the join
|
|
60
|
+
* between the two tables is pinned by a test over both, not by this throw; the throw is what holds if
|
|
61
|
+
* a browser-hosted capability is ever mapped to a backend slot. A hand-written contribution does not
|
|
62
|
+
* pass through here.
|
|
63
|
+
*/
|
|
64
|
+
export const BROWSER_FILLED_ENGINE_CAPABILITIES = new Set([
|
|
65
|
+
EngineCapability.FRONTEND_ERROR_MONITORING,
|
|
66
|
+
EngineCapability.FRONTEND_PRODUCT_ANALYTICS,
|
|
67
|
+
]);
|
|
49
68
|
/**
|
|
50
69
|
* Projects a frontend provider's declared capabilities onto the engine
|
|
51
70
|
* slots it fills, using the canonical
|
|
52
71
|
* `PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY` map from
|
|
53
72
|
* `@wildo-ai/saas-models` — the single source of truth shared with the
|
|
54
|
-
* backend discovery export and the runtime registry projection.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* `
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* absent from the map, so those providers contribute no engine slot by
|
|
62
|
-
* construction.
|
|
73
|
+
* backend discovery export and the runtime registry projection. Among the
|
|
74
|
+
* capabilities a browser may host, only `FRONTEND_ERROR_MONITORING` and
|
|
75
|
+
* `FRONTEND_PRODUCT_ANALYTICS` resolve to a slot; `SSO_OAUTH2`,
|
|
76
|
+
* `FRONTEND_SEARCH`, `FRONTEND_CAPTCHA`, `FRONTEND_FILE_PICKER` and
|
|
77
|
+
* `FRONTEND_ADDRESS_LOOKUP` are absent from the map, so those providers
|
|
78
|
+
* contribute no engine slot by construction. A slot outside
|
|
79
|
+
* {@link BROWSER_FILLED_ENGINE_CAPABILITIES} is refused (#1701).
|
|
63
80
|
*/
|
|
64
|
-
function deriveEngineCapabilities(providerCapabilities) {
|
|
81
|
+
function deriveEngineCapabilities(ref, providerCapabilities) {
|
|
65
82
|
const slots = new Set();
|
|
66
83
|
for (const cap of providerCapabilities) {
|
|
67
84
|
const slot = PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY[cap];
|
|
68
|
-
if (slot)
|
|
69
|
-
|
|
85
|
+
if (!slot)
|
|
86
|
+
continue;
|
|
87
|
+
if (!BROWSER_FILLED_ENGINE_CAPABILITIES.has(slot)) {
|
|
88
|
+
throw new Error(`Frontend provider "${ref}" declares "${cap}", which fills the backend engine slot "${slot}". A browser module `
|
|
89
|
+
+ 'fills only a slot whose work happens on the page; the backend part of the same vendor fills this one.');
|
|
90
|
+
}
|
|
91
|
+
slots.add(slot);
|
|
70
92
|
}
|
|
71
93
|
return Array.from(slots);
|
|
72
94
|
}
|
|
@@ -115,6 +137,81 @@ function assertDeclaredScriptOriginsAreGranted(module) {
|
|
|
115
137
|
}
|
|
116
138
|
}
|
|
117
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Refuses a frontend provider whose consent classification is incomplete (#1702).
|
|
142
|
+
*
|
|
143
|
+
* Two shapes, both of which used to start the provider without consent and say nothing:
|
|
144
|
+
*
|
|
145
|
+
* - a capability no browser may host — anything `PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION`
|
|
146
|
+
* marks `browserHosted: false`, or a string that is no capability at all. The consent table used to be
|
|
147
|
+
* total only over `FRONTEND_*`-named members and treated every other capability as needing no
|
|
148
|
+
* consent, so a vendor declaring, say, `LLM_CHAT` on its frontend module fell through unclassified;
|
|
149
|
+
* - a module-level `consentPurposes` entry that is not a `ConsentPurpose`. Normalization would DROP
|
|
150
|
+
* it, and a dropped purpose on an additive field is a lowered floor.
|
|
151
|
+
*
|
|
152
|
+
* Thrown here, where the author is, for the reason `assertDeclaredScriptOriginsAreGranted` gives. The
|
|
153
|
+
* browser runners do not rely on it: they refuse to start such a provider on their own (fail closed), so
|
|
154
|
+
* an entry that bypassed this projection is withheld rather than started.
|
|
155
|
+
*/
|
|
156
|
+
function assertConsentClassificationIsComplete(module) {
|
|
157
|
+
const unclassified = unclassifiedFrontendCapabilities(module);
|
|
158
|
+
if (unclassified.length > 0) {
|
|
159
|
+
throw new Error(`Frontend provider "${module.metadata.ref}" declares ${unclassified.map((capability) => `"${capability}"`).join(', ')}, `
|
|
160
|
+
+ 'which has no browser consent classification — no browser surface may host it. A frontend module may '
|
|
161
|
+
+ 'declare only capabilities PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION marks browserHosted; '
|
|
162
|
+
+ 'classify a new one there (deciding which consent purposes it rests on) before a frontend module declares it.');
|
|
163
|
+
}
|
|
164
|
+
const unknownPurposes = unknownProviderConsentPurposes(module);
|
|
165
|
+
if (unknownPurposes.length > 0) {
|
|
166
|
+
throw new Error(`Frontend provider "${module.metadata.ref}" declares consentPurposes ${unknownPurposes.map((purpose) => `"${purpose}"`).join(', ')}, `
|
|
167
|
+
+ 'which are not members of ConsentPurpose. They would be dropped on the way to the browser, lowering what '
|
|
168
|
+
+ 'the provider was meant to rest on.');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Refuses a CONSENT-BASED frontend provider that a withdrawal could not stop (#1704): one that injects
|
|
173
|
+
* `<script>` tags, or whose SDK does not declare `stoppable`. The earliest of five applications of the same
|
|
174
|
+
* predicate (`consentBasedProviderStopRefusal`), in the provider package's own `./companion` barrel where
|
|
175
|
+
* the author is; hydration withholds the provider's code and scripts, the SDK runner refuses to start it,
|
|
176
|
+
* the startup script collector skips it and the component registry does not register it, so neither a stale
|
|
177
|
+
* artifact nor a hand-written module list can start one either.
|
|
178
|
+
*/
|
|
179
|
+
function assertConsentBasedProviderIsStoppable(module) {
|
|
180
|
+
// assurance-control: WILDO.PRIVACY.CONSENT_RECORD — a consent-based provider must be stoppable when consent is withdrawn
|
|
181
|
+
const refusal = consentBasedProviderStopRefusal(module.metadata.ref, module);
|
|
182
|
+
if (refusal !== undefined)
|
|
183
|
+
throw new Error(refusal);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Refuses a frontend provider that declares no `publicConfigSchema` whose keys can be read
|
|
187
|
+
* without running it (#1705).
|
|
188
|
+
*
|
|
189
|
+
* Without that list nothing can hold what the provider is served to a set of keys, and "admit
|
|
190
|
+
* everything" was the answer: 8 of the 13 engine modules declared none, including the two that run
|
|
191
|
+
* vendor code (PostHog, Sentry), so any key — a secret under an innocent name included — passed
|
|
192
|
+
* through to every browser. The overlay at `wildo config sync` refuses the same absence on the entry
|
|
193
|
+
* (`SCHEMA_NOT_INTROSPECTABLE`) and hydration refuses it on the code module; this is the earliest of
|
|
194
|
+
* the three, in the provider package's own `./companion` barrel, where the author is.
|
|
195
|
+
*
|
|
196
|
+
* Checked on the module's authored `publicConfig` too: a module whose own defaults carry a key its
|
|
197
|
+
* schema does not declare would fail its own schema at hydration and run none of its code.
|
|
198
|
+
*/
|
|
199
|
+
function assertPublicConfigSchemaIsIntrospectable(module) {
|
|
200
|
+
// assurance-control: WILDO.SECURITY.FAIL_CLOSED — a frontend provider with no readable key list is not projected
|
|
201
|
+
const declared = readDeclaredPublicConfigKeys(module.publicConfigSchema);
|
|
202
|
+
if (declared === undefined) {
|
|
203
|
+
throw new Error(`Frontend provider "${module.metadata.ref}" declares no publicConfigSchema whose keys can be read without running `
|
|
204
|
+
+ 'it. Its publicConfig is served to every browser, and without a declared key list nothing can refuse a key it '
|
|
205
|
+
+ 'never reads — a secret under an innocent name included. Declare one with `defineFrontendPublicConfigSchema` '
|
|
206
|
+
+ '(or a Zod object) listing every key its publicConfig carries.');
|
|
207
|
+
}
|
|
208
|
+
const admissible = new Set(admissibleFrontendPublicConfigKeys({ declaredKeys: declared, providerCapabilities: module.providerCapabilities }));
|
|
209
|
+
const undeclared = Object.keys(module.publicConfig ?? {}).filter((key) => !admissible.has(key));
|
|
210
|
+
if (undeclared.length > 0) {
|
|
211
|
+
throw new Error(`Frontend provider "${module.metadata.ref}" authors publicConfig ${undeclared.map((key) => `"${key}"`).join(', ')}, `
|
|
212
|
+
+ 'which its own publicConfigSchema does not declare. Declare the key, or remove it.');
|
|
213
|
+
}
|
|
214
|
+
}
|
|
118
215
|
/**
|
|
119
216
|
* Turns a frontend provider module into the companion contribution tooling
|
|
120
217
|
* reads — the ONE place a facet module becomes a discovery record.
|
|
@@ -126,9 +223,9 @@ function assertDeclaredScriptOriginsAreGranted(module) {
|
|
|
126
223
|
* surface would end up carried by some packages and dropped by others, and a
|
|
127
224
|
* dropped CSP footprint is invisible until a provider is blocked in production.
|
|
128
225
|
*
|
|
129
|
-
* What crosses and what does not is the whole contract. `csp`, `scripts
|
|
130
|
-
*
|
|
131
|
-
* anything — this runs in Node and a facet module is browser-bound. The
|
|
226
|
+
* What crosses and what does not is the whole contract. `csp`, `scripts`, the
|
|
227
|
+
* SDK DESCRIPTOR and the `complianceProfile` cross, because tooling has to read
|
|
228
|
+
* them without executing anything — this runs in Node and a facet module is browser-bound. The
|
|
132
229
|
* executable half — `sdk.activate`, `publicConfigSchema` — does NOT, and cannot:
|
|
133
230
|
* the contribution is serialized to JSON on its way into the generated
|
|
134
231
|
* artifact, so a function would be dropped by `JSON.stringify` with no error
|
|
@@ -137,6 +234,9 @@ function assertDeclaredScriptOriginsAreGranted(module) {
|
|
|
137
234
|
*/
|
|
138
235
|
export function projectFrontendProviderContribution(module, serviceType, runtimeImportPath) {
|
|
139
236
|
assertDeclaredScriptOriginsAreGranted(module);
|
|
237
|
+
assertConsentClassificationIsComplete(module);
|
|
238
|
+
assertConsentBasedProviderIsStoppable(module);
|
|
239
|
+
assertPublicConfigSchemaIsIntrospectable(module);
|
|
140
240
|
const frontendEntry = {
|
|
141
241
|
metadata: module.metadata,
|
|
142
242
|
providerCapabilities: [...module.providerCapabilities],
|
|
@@ -179,6 +279,19 @@ export function projectFrontendProviderContribution(module, serviceType, runtime
|
|
|
179
279
|
// crosses the wire as-is; the chooser filters on it and the hydration join
|
|
180
280
|
// compares it to the CODE side.
|
|
181
281
|
fileStorage: module.fileStorage,
|
|
282
|
+
// WHO runs the vendor, WHERE it processes and WHICH legal entity stands behind it (#1743).
|
|
283
|
+
// Every engine facet module has declared this since #345 and this projection used to leave it
|
|
284
|
+
// behind — so the browser vendors a privacy notice most needs to name (reCAPTCHA,
|
|
285
|
+
// Sentry, the Drive/OneDrive/Dropbox pickers) reached no compliance reader at all. Pure DATA,
|
|
286
|
+
// like `csp`, so it crosses as-is and lands in the per-service `frontendProviderBootstraps` of
|
|
287
|
+
// the generated artifact, which is where `listServedFrontendProviderCompliance` reads it.
|
|
288
|
+
complianceProfile: module.complianceProfile,
|
|
289
|
+
// The vendor's purposes BEYOND its capabilities' floor (#1702). DATA, because the browser decides
|
|
290
|
+
// on the hydrated module, whose consent inputs come from this entry — a purpose left behind here
|
|
291
|
+
// would reach no gate. Normalized once; absent stays absent so "adds nothing" keeps one spelling.
|
|
292
|
+
consentPurposes: module.consentPurposes === undefined || module.consentPurposes.length === 0
|
|
293
|
+
? undefined
|
|
294
|
+
: normalizeConsentPurposes(module.consentPurposes),
|
|
182
295
|
};
|
|
183
296
|
return {
|
|
184
297
|
ref: module.metadata.ref,
|
|
@@ -190,7 +303,7 @@ export function projectFrontendProviderContribution(module, serviceType, runtime
|
|
|
190
303
|
},
|
|
191
304
|
runtimeImportPath,
|
|
192
305
|
runtimeTargets: [{ kind: 'frontendService', serviceType }],
|
|
193
|
-
engineCapabilities: deriveEngineCapabilities(module.providerCapabilities),
|
|
306
|
+
engineCapabilities: deriveEngineCapabilities(module.metadata.ref, module.providerCapabilities),
|
|
194
307
|
providerCapabilities: [...module.providerCapabilities],
|
|
195
308
|
protocols: [...module.protocols],
|
|
196
309
|
// Browser-safe providers cannot own server secrets. The explicit empty
|