@wildo-ai/external-connectors-public 1.1.13 → 1.1.15
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/providers/dropbox/dropbox.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.js +22 -0
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.js.map +1 -1
- package/dist/esm/shared/frontend-provider-consent.d.ts +7 -0
- package/dist/esm/shared/frontend-provider-consent.d.ts.map +1 -1
- package/dist/esm/shared/frontend-provider-consent.js +2 -0
- package/dist/esm/shared/frontend-provider-consent.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropbox.frontend-app.module.d.ts","sourceRoot":"","sources":["../../../../src/providers/dropbox/dropbox.frontend-app.module.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"dropbox.frontend-app.module.d.ts","sourceRoot":"","sources":["../../../../src/providers/dropbox/dropbox.frontend-app.module.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,0BAA0B,EAAE,yBAsFxC,CAAC"}
|
|
@@ -103,7 +103,29 @@ export const DropboxFrontendAppProvider = {
|
|
|
103
103
|
processingRegions: ['United States', 'Australia', 'European Union', 'Japan', 'United Kingdom'],
|
|
104
104
|
processingRegionReach: Object.fromEntries(['United States', 'Australia', 'European Union', 'Japan', 'United Kingdom'].map((region) => [region, { kind: ProviderProcessingRegionReachKind.ACCOUNT_RESIDENCY }])),
|
|
105
105
|
vendorLegalEntityName: 'Dropbox, Inc.',
|
|
106
|
+
/*
|
|
107
|
+
* Where each location keeps data at rest (#3875): file blocks stay in the chosen location, while "File metadata is stored
|
|
108
|
+
* in the United States" and "Paper docs and previews are currently stored in the United States for all customers", so
|
|
109
|
+
* every location other than the United States also lists it.
|
|
110
|
+
* spec-cite: Dropbox Help Center, "Where does Dropbox store my data?" (fetched 2026-11-16) — "The Dropbox server location
|
|
111
|
+
* selected applies to a team's file data while stored permanently at rest."; Dropbox Business security whitepaper V2026.03.
|
|
112
|
+
*/
|
|
113
|
+
storageRegionTerritories: {
|
|
114
|
+
'United States': ['us'], Australia: ['au', 'us'], 'European Union': ['eu', 'us'], Japan: ['jp', 'us'], 'United Kingdom': ['gb', 'us'],
|
|
115
|
+
},
|
|
116
|
+
// Each region's storage holds only on this account arrangement (#3920), in the vendor's terms.
|
|
117
|
+
storageRegionConditions: Object.fromEntries([
|
|
118
|
+
'Australia', 'European Union', 'Japan', 'United Kingdom',
|
|
119
|
+
].map((region) => [
|
|
120
|
+
region,
|
|
121
|
+
'Holds only for an eligible team whose request for this storage location Dropbox has approved.'
|
|
122
|
+
])),
|
|
106
123
|
evidence: [
|
|
124
|
+
{
|
|
125
|
+
facts: [ProviderComplianceFact.STORAGE_REGION_TERRITORIES],
|
|
126
|
+
source: 'https://help.dropbox.com/security/physical-location-data-storage',
|
|
127
|
+
verifiedAt: '2026-11-16',
|
|
128
|
+
},
|
|
107
129
|
{ facts: [ProviderComplianceFact.PROCESSING_REGIONS, ProviderComplianceFact.PROCESSING_REGION_REACH], source: 'https://help.dropbox.com/security/physical-location-data-storage', verifiedAt: '2026-11-10' },
|
|
108
130
|
],
|
|
109
131
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropbox.frontend-app.module.js","sourceRoot":"","sources":["../../../../src/providers/dropbox/dropbox.frontend-app.module.ts"],"names":[],"mappings":"AAAA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AAC,uBAAuB,CAAC,aAAa,CAAC;QACzD;;;;;;;;;;;;WAYG;QACH,iBAAiB,EAAE,CAAC,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,CAAC;QAC9F,qBAAqB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,iCAAiC,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;QAC/M,qBAAqB,EAAE,eAAe;QACtC,QAAQ,EAAE;YACR,EAAE,KAAK,EAAE,CAAC,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,uBAAuB,CAAC,EAAE,MAAM,EAAE,kEAAkE,EAAE,UAAU,EAAE,YAAY,EAAE;SAC7M;KACF;CACF,CAAC","sourcesContent":["import { ENGINE_FRONTEND_PROVIDERS_PACKAGE_NAME } from '../../engine-frontend-providers-package';\nimport {\n ProviderComplianceFact, ProviderDeploymentModel, ProviderProcessingRegionReachKind, BUILTIN_PROVIDER_CAPABILITY, BUILTIN_PROVIDER_PROTOCOL, defineProviderMetadata, ENGINE_PROVIDER_ORIGIN, ProviderFrontendSelectionDelivery, ProviderTier, defineFrontendPublicConfigSchema, FrontendPublicConfigValueKind } from '@wildo-ai/saas-models/public-runtime';\nimport type { FrontendAppProviderModule } from '../../app/frontend-app-provider-module.types';\n\n/**\n * Dropbox on the frontend: the Chooser, and nothing else.\n *\n * Same ref as a backend Dropbox provider (`dropbox` — the archived catalogue's, or a registry provider adopted from\n * it), for the reason recorded on `google-drive`: the ref is the identity every seam joins on.\n *\n * ## The attach-only arm, and why this one is BROWSER_READABLE_URL\n *\n * Opened with `linkType: 'direct'`, the Chooser returns each chosen file carrying a link that is\n * \"directly downloadable without requiring credentials\" and expires after four hours. The browser\n * genuinely can read the bytes, so the honest declaration is `BROWSER_READABLE_URL` and the framework\n * ingests the result into the field's own storage like any other upload.\n *\n * spec-cite: Dropbox Chooser reference —\n * https://docs.dropboxapi.com/dropbox-api/docs/pre-built-components/chooser — for `linkType`'s two\n * values, the direct link being credential-free, and its four-hour expiry. The quoted fragment is the\n * documentation's own wording about direct links; the rest is paraphrased.\n *\n * The expiry is why a selection must be ingested promptly rather than stored as a reference — which\n * is the same reason this arm exists at all, and the opposite of what `google-drive` does.\n *\n * ## DECIDED 2026-09-18: attach-only, and GOOGLE DRIVE remains the one proven governed mechanism\n *\n * The declaration below is the whole interface Dropbox complies with, and it is deliberately\n * complete: the picker capability is contributed, `BROWSER_READABLE_URL` says truthfully how the\n * bytes arrive, and **no `fileStorage` is declared** — which is what keeps `FileStorageAccepted.DROPBOX`\n * honestly unserved rather than half-served. A stub storage provider was considered and refused for\n * the reason #460 records: the router would then report DROPBOX as \"implemented but not configured\"\n * and send an operator looking for environment variables that cannot exist.\n *\n * So the capability an application may claim is \"Dropbox files can be ATTACHED\", never \"stored in\n * Dropbox\". Exactly OneDrive's posture (#570), reached for the same reason, and both of them exist so\n * that the GOVERNED path has one proven implementation rather than three unproven ones — that\n * implementation is `google-drive`, whose `REMOTE_REFERENCE` leaves the bytes at the vendor and whose\n * `GoogleDriveStorageProvider` reads them back through the linker's own delegated grant.\n *\n * What a governed Dropbox path would additionally need, so a later attempt starts from the\n * requirement rather than rediscovering it: a connected-account grant for this ref on the\n * access-token door, a `DROPBOX` `IFileStorageProvider` reading `/2/files/download` with that\n * delegated token, and authored consent. It is not built, and nothing here pretends otherwise.\n *\n * It is left UNPROVEN deliberately: no part of this has been driven against a real Dropbox account.\n */\nexport const DropboxFrontendAppProvider: FrontendAppProviderModule = {\n metadata: defineProviderMetadata({\n ref: 'dropbox',\n packageName: ENGINE_FRONTEND_PROVIDERS_PACKAGE_NAME,\n tier: ProviderTier.MAIN,\n origin: ENGINE_PROVIDER_ORIGIN,\n }),\n providerCapabilities: [BUILTIN_PROVIDER_CAPABILITY.FRONTEND_FILE_PICKER],\n protocols: [BUILTIN_PROVIDER_PROTOCOL.FRONTEND_SDK],\n publicConfig: {},\n publicConfigSchema: defineFrontendPublicConfigSchema({\n appKey: { kind: FrontendPublicConfigValueKind.STRING, description: 'Dropbox app key the Chooser is registered under; public by design.' },\n }),\n /**\n * The vendor documents the app key as a `data-app-key` attribute on a script tag carrying\n * `id=\"dropboxjs\"`, which this channel cannot express — the declaration is static engine DATA and\n * the key is per-application configuration.\n *\n * It does not have to. Reading the shipped `dropins.js` shows the key has three sources, and the\n * second is a public API: `Dropbox.init({ appKey })`. So the script is declared here like any\n * other, plainly, and the picker component supplies the key from `publicConfig` after it loads.\n * Recorded because the documented path would otherwise look like a missing framework capability,\n * and extending the script declaration to carry configured attributes was one step away.\n */\n scripts: [{ src: 'https://www.dropbox.com/static/api/2/dropins.js', async: true, defer: true }],\n /**\n * The loader script and the overlay it renders, both on the vendor's own origin. The SELECTED\n * bytes are fetched from a `dl.dropboxusercontent.com` direct link, so that host belongs in\n * `connectOrigins` — the framework fetches it to ingest the file, and a bucket left out is a bucket\n * CSP blocks in production only.\n */\n csp: {\n scriptOrigins: ['https://www.dropbox.com'],\n frameOrigins: ['https://www.dropbox.com'],\n connectOrigins: ['https://dl.dropboxusercontent.com'],\n },\n components: {\n [BUILTIN_PROVIDER_CAPABILITY.FRONTEND_FILE_PICKER]: {\n // No `load` — the facet library registers the loader (see `google-drive`).\n selectionDelivery: ProviderFrontendSelectionDelivery.BROWSER_READABLE_URL,\n },\n },\n complianceProfile: {\n deploymentModels: [ProviderDeploymentModel.VENDOR_HOSTED],\n /*\n * #2294: the places Dropbox stores a team's files, in Dropbox's own words. The AWS-style labels 'us-east-1' /\n * 'eu-west-1' are retired: nothing Dropbox offers is named that way. An application still naming one is reported as\n * naming a region Dropbox does not offer.\n *\n * #3513: every region is ACCOUNT RESIDENCY, attested. The region is the TEAM's, set through a support request, and the\n * Chooser and the API offer no region choice; no call selects it.\n *\n * #2294: no processingRegionTerritories, deliberately. The commitment covers \"a team's file data while stored\n * permanently at rest\" and says nothing of where it is processed; a declared data residency refuses Dropbox.\n * spec-cite: Dropbox Help Center, \"Where does Dropbox store data?\"\n * (https://help.dropbox.com/security/physical-location-data-storage, fetched 2026-11-10).\n */\n processingRegions: ['United States', 'Australia', 'European Union', 'Japan', 'United Kingdom'],\n processingRegionReach: Object.fromEntries(['United States', 'Australia', 'European Union', 'Japan', 'United Kingdom'].map((region) => [region, { kind: ProviderProcessingRegionReachKind.ACCOUNT_RESIDENCY }])),\n vendorLegalEntityName: 'Dropbox, Inc.',\n evidence: [\n { facts: [ProviderComplianceFact.PROCESSING_REGIONS, ProviderComplianceFact.PROCESSING_REGION_REACH], source: 'https://help.dropbox.com/security/physical-location-data-storage', verifiedAt: '2026-11-10' },\n ],\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"dropbox.frontend-app.module.js","sourceRoot":"","sources":["../../../../src/providers/dropbox/dropbox.frontend-app.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EACL,sBAAsB,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,iCAAiC,EAAE,YAAY,EAAE,gCAAgC,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAG7V;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA8B;IACnE,QAAQ,EAAE,sBAAsB,CAAC;QAC/B,GAAG,EAAE,SAAS;QACd,WAAW,EAAE,sCAAsC;QACnD,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,MAAM,EAAE,sBAAsB;KAC/B,CAAC;IACF,oBAAoB,EAAE,CAAC,2BAA2B,CAAC,oBAAoB,CAAC;IACxE,SAAS,EAAE,CAAC,y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AAI,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;SACtI;QACD,+FAA+F;QAC/F,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC;YAC1C,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB;SACzD,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YAChB,MAAM;YACN,+FAA+F;SAChG,CAAC,CAAC;QACH,QAAQ,EAAE;YACR;gBACE,KAAK,EAAE,CAAC,sBAAsB,CAAC,0BAA0B,CAAC;gBAC1D,MAAM,EAAE,kEAAkE;gBAC1E,UAAU,EAAE,YAAY;aACzB;YACD,EAAE,KAAK,EAAE,CAAC,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,uBAAuB,CAAC,EAAE,MAAM,EAAE,kEAAkE,EAAE,UAAU,EAAE,YAAY,EAAE;SAC7M;KACF;CACF,CAAC","sourcesContent":["import { ENGINE_FRONTEND_PROVIDERS_PACKAGE_NAME } from '../../engine-frontend-providers-package';\nimport {\n ProviderComplianceFact, ProviderDeploymentModel, ProviderProcessingRegionReachKind, BUILTIN_PROVIDER_CAPABILITY, BUILTIN_PROVIDER_PROTOCOL, defineProviderMetadata, ENGINE_PROVIDER_ORIGIN, ProviderFrontendSelectionDelivery, ProviderTier, defineFrontendPublicConfigSchema, FrontendPublicConfigValueKind } from '@wildo-ai/saas-models/public-runtime';\nimport type { FrontendAppProviderModule } from '../../app/frontend-app-provider-module.types';\n\n/**\n * Dropbox on the frontend: the Chooser, and nothing else.\n *\n * Same ref as a backend Dropbox provider (`dropbox` — the archived catalogue's, or a registry provider adopted from\n * it), for the reason recorded on `google-drive`: the ref is the identity every seam joins on.\n *\n * ## The attach-only arm, and why this one is BROWSER_READABLE_URL\n *\n * Opened with `linkType: 'direct'`, the Chooser returns each chosen file carrying a link that is\n * \"directly downloadable without requiring credentials\" and expires after four hours. The browser\n * genuinely can read the bytes, so the honest declaration is `BROWSER_READABLE_URL` and the framework\n * ingests the result into the field's own storage like any other upload.\n *\n * spec-cite: Dropbox Chooser reference —\n * https://docs.dropboxapi.com/dropbox-api/docs/pre-built-components/chooser — for `linkType`'s two\n * values, the direct link being credential-free, and its four-hour expiry. The quoted fragment is the\n * documentation's own wording about direct links; the rest is paraphrased.\n *\n * The expiry is why a selection must be ingested promptly rather than stored as a reference — which\n * is the same reason this arm exists at all, and the opposite of what `google-drive` does.\n *\n * ## DECIDED 2026-09-18: attach-only, and GOOGLE DRIVE remains the one proven governed mechanism\n *\n * The declaration below is the whole interface Dropbox complies with, and it is deliberately\n * complete: the picker capability is contributed, `BROWSER_READABLE_URL` says truthfully how the\n * bytes arrive, and **no `fileStorage` is declared** — which is what keeps `FileStorageAccepted.DROPBOX`\n * honestly unserved rather than half-served. A stub storage provider was considered and refused for\n * the reason #460 records: the router would then report DROPBOX as \"implemented but not configured\"\n * and send an operator looking for environment variables that cannot exist.\n *\n * So the capability an application may claim is \"Dropbox files can be ATTACHED\", never \"stored in\n * Dropbox\". Exactly OneDrive's posture (#570), reached for the same reason, and both of them exist so\n * that the GOVERNED path has one proven implementation rather than three unproven ones — that\n * implementation is `google-drive`, whose `REMOTE_REFERENCE` leaves the bytes at the vendor and whose\n * `GoogleDriveStorageProvider` reads them back through the linker's own delegated grant.\n *\n * What a governed Dropbox path would additionally need, so a later attempt starts from the\n * requirement rather than rediscovering it: a connected-account grant for this ref on the\n * access-token door, a `DROPBOX` `IFileStorageProvider` reading `/2/files/download` with that\n * delegated token, and authored consent. It is not built, and nothing here pretends otherwise.\n *\n * It is left UNPROVEN deliberately: no part of this has been driven against a real Dropbox account.\n */\nexport const DropboxFrontendAppProvider: FrontendAppProviderModule = {\n metadata: defineProviderMetadata({\n ref: 'dropbox',\n packageName: ENGINE_FRONTEND_PROVIDERS_PACKAGE_NAME,\n tier: ProviderTier.MAIN,\n origin: ENGINE_PROVIDER_ORIGIN,\n }),\n providerCapabilities: [BUILTIN_PROVIDER_CAPABILITY.FRONTEND_FILE_PICKER],\n protocols: [BUILTIN_PROVIDER_PROTOCOL.FRONTEND_SDK],\n publicConfig: {},\n publicConfigSchema: defineFrontendPublicConfigSchema({\n appKey: { kind: FrontendPublicConfigValueKind.STRING, description: 'Dropbox app key the Chooser is registered under; public by design.' },\n }),\n /**\n * The vendor documents the app key as a `data-app-key` attribute on a script tag carrying\n * `id=\"dropboxjs\"`, which this channel cannot express — the declaration is static engine DATA and\n * the key is per-application configuration.\n *\n * It does not have to. Reading the shipped `dropins.js` shows the key has three sources, and the\n * second is a public API: `Dropbox.init({ appKey })`. So the script is declared here like any\n * other, plainly, and the picker component supplies the key from `publicConfig` after it loads.\n * Recorded because the documented path would otherwise look like a missing framework capability,\n * and extending the script declaration to carry configured attributes was one step away.\n */\n scripts: [{ src: 'https://www.dropbox.com/static/api/2/dropins.js', async: true, defer: true }],\n /**\n * The loader script and the overlay it renders, both on the vendor's own origin. The SELECTED\n * bytes are fetched from a `dl.dropboxusercontent.com` direct link, so that host belongs in\n * `connectOrigins` — the framework fetches it to ingest the file, and a bucket left out is a bucket\n * CSP blocks in production only.\n */\n csp: {\n scriptOrigins: ['https://www.dropbox.com'],\n frameOrigins: ['https://www.dropbox.com'],\n connectOrigins: ['https://dl.dropboxusercontent.com'],\n },\n components: {\n [BUILTIN_PROVIDER_CAPABILITY.FRONTEND_FILE_PICKER]: {\n // No `load` — the facet library registers the loader (see `google-drive`).\n selectionDelivery: ProviderFrontendSelectionDelivery.BROWSER_READABLE_URL,\n },\n },\n complianceProfile: {\n deploymentModels: [ProviderDeploymentModel.VENDOR_HOSTED],\n /*\n * #2294: the places Dropbox stores a team's files, in Dropbox's own words. The AWS-style labels 'us-east-1' /\n * 'eu-west-1' are retired: nothing Dropbox offers is named that way. An application still naming one is reported as\n * naming a region Dropbox does not offer.\n *\n * #3513: every region is ACCOUNT RESIDENCY, attested. The region is the TEAM's, set through a support request, and the\n * Chooser and the API offer no region choice; no call selects it.\n *\n * #2294: no processingRegionTerritories, deliberately. The commitment covers \"a team's file data while stored\n * permanently at rest\" and says nothing of where it is processed; a declared data residency refuses Dropbox.\n * spec-cite: Dropbox Help Center, \"Where does Dropbox store data?\"\n * (https://help.dropbox.com/security/physical-location-data-storage, fetched 2026-11-10).\n */\n processingRegions: ['United States', 'Australia', 'European Union', 'Japan', 'United Kingdom'],\n processingRegionReach: Object.fromEntries(['United States', 'Australia', 'European Union', 'Japan', 'United Kingdom'].map((region) => [region, { kind: ProviderProcessingRegionReachKind.ACCOUNT_RESIDENCY }])),\n vendorLegalEntityName: 'Dropbox, Inc.',\n /*\n * Where each location keeps data at rest (#3875): file blocks stay in the chosen location, while \"File metadata is stored\n * in the United States\" and \"Paper docs and previews are currently stored in the United States for all customers\", so\n * every location other than the United States also lists it.\n * spec-cite: Dropbox Help Center, \"Where does Dropbox store my data?\" (fetched 2026-11-16) — \"The Dropbox server location\n * selected applies to a team's file data while stored permanently at rest.\"; Dropbox Business security whitepaper V2026.03.\n */\n storageRegionTerritories: {\n 'United States': ['us'], Australia: ['au', 'us'], 'European Union': ['eu', 'us'], Japan: ['jp', 'us'], 'United Kingdom': ['gb', 'us'],\n },\n // Each region's storage holds only on this account arrangement (#3920), in the vendor's terms.\n storageRegionConditions: Object.fromEntries([\n 'Australia', 'European Union', 'Japan', 'United Kingdom',\n ].map((region) => [\n region,\n 'Holds only for an eligible team whose request for this storage location Dropbox has approved.'\n ])),\n evidence: [\n {\n facts: [ProviderComplianceFact.STORAGE_REGION_TERRITORIES],\n source: 'https://help.dropbox.com/security/physical-location-data-storage',\n verifiedAt: '2026-11-16',\n },\n { facts: [ProviderComplianceFact.PROCESSING_REGIONS, ProviderComplianceFact.PROCESSING_REGION_REACH], source: 'https://help.dropbox.com/security/physical-location-data-storage', verifiedAt: '2026-11-10' },\n ],\n },\n};\n"]}
|
|
@@ -175,6 +175,13 @@ export declare const PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION: Readon
|
|
|
175
175
|
*/
|
|
176
176
|
readonly browserHosted: false;
|
|
177
177
|
};
|
|
178
|
+
readonly EMBEDDED_ELECTRONIC_SIGNATURE: {
|
|
179
|
+
/**
|
|
180
|
+
* The capability runs server-side only (a mail sender, an LLM, an audit sink). A frontend module
|
|
181
|
+
* declaring it is refused at projection and never permitted to start.
|
|
182
|
+
*/
|
|
183
|
+
readonly browserHosted: false;
|
|
184
|
+
};
|
|
178
185
|
readonly SSO_SAML: {
|
|
179
186
|
/**
|
|
180
187
|
* The capability runs server-side only (a mail sender, an LLM, an audit sink). A frontend module
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-provider-consent.d.ts","sourceRoot":"","sources":["../../../src/shared/frontend-provider-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EAEL,cAAc,EAIf,MAAM,sCAAsC,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,MAAM,uCAAuC,GAC/C;IACA,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,gGAAgG;IAChG,QAAQ,CAAC,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;CACrD,GACC;IACA;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC;CAC/B,CAAC;AAQJ,wIAAwI;AACxI;;;;;;GAMG;AACH,eAAO,MAAM,mDAAmD;;;;;;QA3B5D,qDAAqD;gCAC7B,IAAI;QAC5B,gGAAgG;kCACtE,SAAS,cAAc,EAAE;;;QAHnD,qDAAqD;gCAC7B,IAAI;QAC5B,gGAAgG;kCACtE,SAAS,cAAc,EAAE;;;QAHnD,qDAAqD;gCAC7B,IAAI;QAC5B,gGAAgG;kCACtE,SAAS,cAAc,EAAE;;;QAHnD,qDAAqD;gCAC7B,IAAI;QAC5B,gGAAgG;kC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C,OAAO,EAAE,QAAQ,CAAC,iCAAiC,CAAC,GAAG,SAAS,GAAG,cAAc,EAAE,CAIlI;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA+B,SAAQ,iCAAiC;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B,GAAG,MAAM,GAAG,SAAS,CAc/H"}
|
|
@@ -99,6 +99,8 @@ export const PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION = Object.freeze
|
|
|
99
99
|
SMS: SERVER_ONLY,
|
|
100
100
|
// #2293: a deliverable is sent for signature from the backend; the vendor's signing page is its own, not a browser SDK.
|
|
101
101
|
ELECTRONIC_SIGNATURE: SERVER_ONLY,
|
|
102
|
+
// The frame is the application's own engine component, not a browser module the provider loads.
|
|
103
|
+
EMBEDDED_ELECTRONIC_SIGNATURE: SERVER_ONLY,
|
|
102
104
|
SSO_SAML: SERVER_ONLY,
|
|
103
105
|
LLM_CHAT: SERVER_ONLY,
|
|
104
106
|
LLM_EMBEDDINGS: SERVER_ONLY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-provider-consent.js","sourceRoot":"","sources":["../../../src/shared/frontend-provider-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,wBAAwB,GAEzB,MAAM,sCAAsC,CAAC;AAwB9C,MAAM,WAAW,GAA4C,MAAM,CAAC,MAAM,CAAC,EAAE,aA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AA2G;AAC3G,MAAM,UAAU,+BAA+B,CAAC,OAAgE;IAC9G,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,KAAK,MAAM,MAAM,IAAI,OAAO,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,iCAAiC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7F,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAWD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,+BAA+B,CAAC,WAAmB,EAAE,MAAsC;IACzG,MAAM,QAAQ,GAAG,iCAAiC,CAAC,MAAM,CAAC,CAAC;IAC3D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,aAAa,WAAW,yBAAyB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,+CAA+C;cACtH,+GAA+G;cAC/G,kBAAkB,CAAC;IACzB,CAAC;IACD,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAC9D,OAAO,aAAa,WAAW,yBAAyB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,iDAAiD;cACxH,oHAAoH;cACpH,0BAA0B,CAAC;IACjC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Which frontend providers may start before a person consents, and which may not (#534, #1702).\n *\n * ## Why the floor lives on the CAPABILITY\n *\n * A vendor is not a purpose. PostHog is product analytics on the website and could be something else\n * tomorrow; what makes it consent-based is the capability it is registered for. So the floor is keyed by\n * `ProviderCapability`. A table of vendor names would be a second catalogue that rots.\n *\n * ## Why the table is total over the WHOLE vocabulary, not over `FRONTEND_*` names (#1702)\n *\n * It used to be total over `Extract<ProviderCapability, 'FRONTEND_${string}'>` and to answer \"no\n * consent\" for every other capability. That made the compile-time forcing depend on a naming\n * convention, and the fallback fail OPEN: frontend modules then declared `BILLING` and `SSO_OAUTH2`,\n * and a vendor declaring any other non-prefixed capability on its frontend module — or a future member\n * named without the prefix — would have started without consent, with nothing saying so.\n *\n * So every capability is classified here, and a new member of the vocabulary is a compile error until\n * somebody decides two things about it: can a browser host it at all, and if so, which purposes does it\n * rest on. A capability that is not browser-hosted may not be declared by a frontend module:\n * `projectFrontendProviderContribution` refuses the module, and at runtime the provider is never\n * permitted to start (fail closed), so a stale or hand-written entry cannot slip past the projection.\n * The `FRONTEND_` prefix remains a naming convention and nothing else.\n *\n * ## The floor, and why most capabilities need no consent\n *\n * - `FRONTEND_PRODUCT_ANALYTICS` measures how the service is used — `ConsentPurpose.ANALYTICS`.\n * - Error monitoring, captcha, search, file pickers, address lookup and sign-in code deliver or protect\n * a service the visitor asked for. They are not consent-based\n * processing; their lawful basis is the operator's to state in `operatorComplianceIdentity`, not a\n * banner's to ask. Gating them on consent would break the site for everyone who declines, which is the\n * opposite of what declining means.\n *\n * ## A vendor may add to the floor, never remove from it (#1702)\n *\n * Some vendors do more than their capability's floor. Google reCAPTCHA is the measured case: the CNIL\n * held that it is not exempt from consent as a security measure, because it also serves Google's own\n * analysis (Délibération SAN-2023-003), while a privacy-preserving captcha is exempt. The capability\n * cannot express that difference, so a frontend module may declare `consentPurposes` of its own, and the\n * provider rests on the UNION of those and its capabilities' floor. There is no field that subtracts: a\n * provider declaring `consentPurposes: []` on an analytics capability still rests on `ANALYTICS`.\n *\n * spec-cite: https://www.legifrance.gouv.fr/cnil/id/CNILTEXT000047346903 — the reCAPTCHA holding is\n * summarised from issue #1702's research, not quoted; no sentence of the decision is reproduced here.\n *\n * ## Where it is enforced\n *\n * In the shared runners — `activateFrontendProviderSdks` and `collectDeclaredProviderScripts` — and at\n * component load (`@wildo-ai/saas-frontend-lib`'s provider component registry), so no surface can\n * forget it. The SDK runner and the component registry take the granted purposes and default to NONE, so a\n * call that passes no grant — the SaaS application's startup activation, which runs before any person is known,\n * and the technical documentation, which asks no one — starts no consent-based provider rather than starting it\n * on an assumed consent. The script collector takes no grant at all: it never collects a consent-based\n * provider's scripts, granted or not (#1704). An application-tier consent-based SDK (the app-tier PostHog module is the first) is\n * activated by `ConsentBasedProviderSdksProvider` in `@wildo-ai/saas-frontend-lib`, which holds the signed-in\n * person's granted purposes (#1704).\n *\n * A consent-based provider must also be STOPPABLE ({@link consentBasedProviderStopRefusal}): refused at projection,\n * withheld at hydration, and skipped by the SDK runner, the script collector and the component registry.\n */\n\nimport {\n CONSENT_PURPOSES,\n ConsentPurpose,\n missingConsentPurposes,\n normalizeConsentPurposes,\n type ProviderCapability,\n} from '@wildo-ai/saas-models/public-runtime';\n\n/**\n * How a capability stands with respect to a browser and to consent.\n *\n * Two arms rather than a nullable purpose list, because \"needs no consent\" (`[]`) and \"cannot be hosted\n * by a browser at all\" are opposite answers, and a `null` standing for the second would be the silent\n * fallback this table exists to remove.\n */\nexport type FrontendCapabilityConsentClassification =\n | {\n /** A frontend module may declare this capability. */\n readonly browserHosted: true;\n /** The consent floor: purposes every provider of this capability rests on. Empty means none. */\n readonly consentPurposes: readonly ConsentPurpose[];\n }\n | {\n /**\n * The capability runs server-side only (a mail sender, an LLM, an audit sink). A frontend module\n * declaring it is refused at projection and never permitted to start.\n */\n readonly browserHosted: false;\n };\n\nconst SERVER_ONLY: FrontendCapabilityConsentClassification = Object.freeze({ browserHosted: false });\nconst HOSTED_WITHOUT_CONSENT: FrontendCapabilityConsentClassification = Object.freeze({\n browserHosted: true,\n consentPurposes: Object.freeze([]),\n});\n\n/** @wildo_source:part:start external-connectors.frontend-provider-consent-classification facet:kind:api facet:audience:app-developer */\n/**\n * The consent classification of EVERY provider capability — total over the vocabulary, so a capability\n * added tomorrow does not compile until it is classified here (#1702).\n *\n * A frontend provider module may declare only capabilities classified `browserHosted: true`; it rests on\n * the union of their `consentPurposes` and its own module-level `consentPurposes`.\n */\nexport const PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION = Object.freeze({\n // Browser-hosted, consent-based: measuring how the service is used.\n FRONTEND_PRODUCT_ANALYTICS: Object.freeze({ browserHosted: true, consentPurposes: Object.freeze([ConsentPurpose.ANALYTICS]) }),\n // Browser-hosted, no consent at the floor: each delivers or protects a service the person asked for.\n FRONTEND_ERROR_MONITORING: HOSTED_WITHOUT_CONSENT,\n FRONTEND_CAPTCHA: HOSTED_WITHOUT_CONSENT,\n FRONTEND_SEARCH: HOSTED_WITHOUT_CONSENT,\n FRONTEND_FILE_PICKER: HOSTED_WITHOUT_CONSENT,\n FRONTEND_ADDRESS_LOOKUP: HOSTED_WITHOUT_CONSENT,\n // Telling the chat host that opened the sign-in window that the sign-in finished: the person asked to sign in.\n FRONTEND_CHAT_SIGN_IN_COMPLETION: HOSTED_WITHOUT_CONSENT,\n // Browser sign-in code (a vendor's one-tap or button SDK). The person asked to sign in; that is not\n // consent-based processing. No engine module declares it today: the redirect-based sign-in the engine\n // ships runs no vendor code on the page, and its button labels come from the ref (#1701).\n SSO_OAUTH2: HOSTED_WITHOUT_CONSENT,\n // Server-side only. A frontend module declaring any of these is refused.\n // BILLING is the backend billing slot (subscriptions, checkout sessions, the portal link, webhooks).\n // Checkout and the customer portal are hosted redirects, so no billing code runs in the browser; a\n // frontend module declaring it used to FILL the engine's billing slot from the browser (#1701). An\n // embedded payment UI would be its own browser capability, decided in #1741.\n BILLING: SERVER_ONLY,\n EMAIL_TRANSACTIONAL: SERVER_ONLY,\n EMAIL_MARKETING: SERVER_ONLY,\n EMAIL_INBOUND: SERVER_ONLY,\n SMS: SERVER_ONLY,\n // #2293: a deliverable is sent for signature from the backend; the vendor's signing page is its own, not a browser SDK.\n ELECTRONIC_SIGNATURE: SERVER_ONLY,\n SSO_SAML: SERVER_ONLY,\n LLM_CHAT: SERVER_ONLY,\n LLM_EMBEDDINGS: SERVER_ONLY,\n DOCUMENT_TEXT_EXTRACTION: SERVER_ONLY,\n PROMPT_INJECTION_SCREENING: SERVER_ONLY,\n OUTPUT_MODERATION: SERVER_ONLY,\n CODING_AGENT: SERVER_ONLY,\n IMAGE_GENERATION: SERVER_ONLY,\n LLM_OBSERVABILITY: SERVER_ONLY,\n OBSERVABILITY_TELEMETRY: SERVER_ONLY,\n COMPLIANCE_AUDIT_TRAIL: SERVER_ONLY,\n // Key custody signs, MACs and wraps with keys a browser must never hold or reach (#2891).\n KEY_MANAGEMENT: SERVER_ONLY,\n} as const satisfies Readonly<Record<ProviderCapability, FrontendCapabilityConsentClassification>>);\n/** @wildo_source:part:end external-connectors.frontend-provider-consent-classification */\n\ntype ConsentClassificationTable = typeof PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION;\n\n/** The capabilities a browser surface can host — DERIVED from the classification, never from a name prefix. */\nexport type FrontendProviderCapability = {\n [K in keyof ConsentClassificationTable]: ConsentClassificationTable[K]['browserHosted'] extends true ? K : never;\n}[keyof ConsentClassificationTable];\n\n/** The shape this module needs off a provider module or DATA entry. */\nexport interface ConsentClassifiableProviderModule {\n readonly providerCapabilities?: ReadonlyArray<string>;\n /**\n * Purposes the provider rests on BEYOND its capabilities' floor — the vendor-level addition (#1702).\n * Typed as strings because a hydrated module reads it off the wire; an unknown member is refused at\n * projection and makes the provider unpermitted at runtime rather than being dropped.\n */\n readonly consentPurposes?: ReadonlyArray<string>;\n}\n\nfunction classificationOf(capability: string): FrontendCapabilityConsentClassification | undefined {\n return Object.prototype.hasOwnProperty.call(PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION, capability)\n ? (PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION as Readonly<Record<string, FrontendCapabilityConsentClassification>>)[capability]\n : undefined;\n}\n\n/**\n * Every capability the provider declares that a browser may NOT host — server-only capabilities and\n * strings that are no capability at all. Empty for a correctly classified frontend provider.\n */\nexport function unclassifiedFrontendCapabilities(module: ConsentClassifiableProviderModule): string[] {\n return (module.providerCapabilities ?? []).filter((capability) => classificationOf(capability)?.browserHosted !== true);\n}\n\n/** Every provider-level consent purpose that is not a member of `ConsentPurpose`. */\nexport function unknownProviderConsentPurposes(module: ConsentClassifiableProviderModule): string[] {\n const known = new Set<string>(CONSENT_PURPOSES);\n return (module.consentPurposes ?? []).filter((purpose) => !known.has(purpose));\n}\n\n/**\n * Every consent purpose a provider rests on, in vocabulary order: the union of its capabilities' floor\n * and its own module-level `consentPurposes`. Nothing a provider declares can remove a purpose its\n * capability requires — the union has no subtracting input.\n */\nexport function consentPurposesRequiredByProvider(module: ConsentClassifiableProviderModule): ConsentPurpose[] {\n const required: string[] = [...(module.consentPurposes ?? [])];\n for (const capability of module.providerCapabilities ?? []) {\n const classification = classificationOf(capability);\n if (classification?.browserHosted === true) required.push(...classification.consentPurposes);\n }\n return normalizeConsentPurposes(required);\n}\n\n/**\n * Whether a provider may start given the purposes granted.\n *\n * FAILS CLOSED on a provider whose classification is broken — a capability no browser may host, or a\n * provider-level purpose outside the vocabulary. The projection refuses both, so reaching here with one\n * means an entry that bypassed it (a stale artifact, the backend's non-refusing fallback, a hand-written\n * contribution); starting it anyway would be the fail-open defect #1702 closes.\n */\nexport function isProviderPermittedByConsent(\n module: ConsentClassifiableProviderModule,\n grantedConsentPurposes: readonly ConsentPurpose[],\n): boolean {\n if (unclassifiedFrontendCapabilities(module).length > 0) return false;\n if (unknownProviderConsentPurposes(module).length > 0) return false;\n return missingConsentPurposes(grantedConsentPurposes, consentPurposesRequiredByProvider(module)).length === 0;\n}\n\n/**\n * The purposes the person would have to grant for this provider to start — what a consent-required\n * state names and offers. Empty both when the provider is permitted and when no grant could permit it\n * (a broken classification); `isProviderPermittedByConsent` tells the two apart.\n */\nexport function missingConsentPurposesForProvider(\n module: ConsentClassifiableProviderModule,\n grantedConsentPurposes: readonly ConsentPurpose[],\n): ConsentPurpose[] {\n return missingConsentPurposes(grantedConsentPurposes, consentPurposesRequiredByProvider(module));\n}\n\n/**\n * One sentence saying why a provider was withheld, for a diagnostic. Distinguishes the two reasons,\n * because their remedies are opposite: a missing grant is the person's to give, a broken classification\n * is the provider author's to fix.\n */\nexport function describeProviderConsentRefusal(\n providerRef: string,\n module: ConsentClassifiableProviderModule,\n grantedConsentPurposes: readonly ConsentPurpose[],\n): string {\n const unclassified = unclassifiedFrontendCapabilities(module);\n if (unclassified.length > 0) {\n return `Provider \"${providerRef}\" declares ${unclassified.join(', ')}, which no browser surface may host, so it `\n + 'never starts. Remove the capability from its frontend module.';\n }\n const unknownPurposes = unknownProviderConsentPurposes(module);\n if (unknownPurposes.length > 0) {\n return `Provider \"${providerRef}\" declares consent purposes ${unknownPurposes.join(', ')}, which are not consent `\n + 'purposes, so it never starts. Declare members of ConsentPurpose.';\n }\n return `Provider \"${providerRef}\" rests on consent to ${missingConsentPurposesForProvider(module, grantedConsentPurposes).join(', ')}, `\n + 'which has not been granted on this surface.';\n}\n\n/** Every purpose the given providers rest on — what a consent surface must ask about, and nothing more. */\nexport function consentPurposesInUseByProviders(modules: Iterable<ConsentClassifiableProviderModule> | undefined): ConsentPurpose[] {\n const inUse: ConsentPurpose[] = [];\n for (const module of modules ?? []) inUse.push(...consentPurposesRequiredByProvider(module));\n return normalizeConsentPurposes(inUse);\n}\n\n/**\n * The code-bearing shape the stop rule needs: whether a provider injects `<script>` tags, and whether\n * its SDK declares that it can be stopped.\n */\nexport interface StoppableConsentProviderModule extends ConsentClassifiableProviderModule {\n readonly scripts?: ReadonlyArray<unknown>;\n readonly sdk?: { readonly stoppable?: true };\n}\n\n/**\n * Why a CONSENT-BASED provider cannot honour a withdrawal, or `undefined` when it can (#1704).\n *\n * Consent can be withdrawn at any moment and must be as easy to withdraw as to give, so a provider that\n * starts on a grant must be stoppable on the withdrawal of that grant, in the same page. Two shapes\n * cannot be:\n *\n * - **`scripts`.** A `<script>` tag is DATA: the framework injects it and has no handle on what it runs.\n * Removing the element afterwards undoes nothing — the vendor's globals, listeners, timers and the\n * storage it wrote all stay (`load-frontend-provider-scripts.ts` says the same). A consent-based\n * vendor that ships as a script loads it from inside its own `sdk.activate` instead, where it can\n * also stop it.\n * - **An SDK that does not declare `stoppable`.** Whether `activate()` returns a `deactivate` is only\n * known after the vendor has started, which is too late to refuse. So the SDK states it up front,\n * and a declared SDK whose activation then returns no `deactivate` is reported by the runner.\n *\n * Asked at projection (the provider package's own `./companion` barrel refuses) and at hydration (the\n * provider's code and scripts are withheld with a diagnostic), so neither a stale artifact nor a\n * hand-written contribution can start an unstoppable consent-based provider. A provider resting on no\n * purpose is never refused here: nothing can be withdrawn from it.\n */\nexport function consentBasedProviderStopRefusal(providerRef: string, module: StoppableConsentProviderModule): string | undefined {\n const purposes = consentPurposesRequiredByProvider(module);\n if (purposes.length === 0) return undefined;\n if ((module.scripts?.length ?? 0) > 0) {\n return `Provider \"${providerRef}\" rests on consent to ${purposes.join(', ')} and declares <script> tags, which cannot be `\n + 'stopped when that consent is withdrawn. Load the script from inside its sdk.activate and return a deactivate '\n + 'instead (#1704).';\n }\n if (module.sdk !== undefined && module.sdk.stoppable !== true) {\n return `Provider \"${providerRef}\" rests on consent to ${purposes.join(', ')} and its SDK does not declare stoppable: true, `\n + 'so a withdrawal could not stop it. Return a deactivate from sdk.activate that fully stops the vendor, and declare '\n + 'stoppable: true (#1704).';\n }\n return undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"frontend-provider-consent.js","sourceRoot":"","sources":["../../../src/shared/frontend-provider-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,wBAAwB,GAEzB,MAAM,sCAAsC,CAAC;AAwB9C,MAAM,WAAW,GAA4C,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;AACrG,MAAM,sBAAsB,GAA4C,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UAAU,+BAA+B,CAAC,OAAgE;IAC9G,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,KAAK,MAAM,MAAM,IAAI,OAAO,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,iCAAiC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7F,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAWD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,+BAA+B,CAAC,WAAmB,EAAE,MAAsC;IACzG,MAAM,QAAQ,GAAG,iCAAiC,CAAC,MAAM,CAAC,CAAC;IAC3D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,aAAa,WAAW,yBAAyB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,+CAA+C;cACtH,+GAA+G;cAC/G,kBAAkB,CAAC;IACzB,CAAC;IACD,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAC9D,OAAO,aAAa,WAAW,yBAAyB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,iDAAiD;cACxH,oHAAoH;cACpH,0BAA0B,CAAC;IACjC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Which frontend providers may start before a person consents, and which may not (#534, #1702).\n *\n * ## Why the floor lives on the CAPABILITY\n *\n * A vendor is not a purpose. PostHog is product analytics on the website and could be something else\n * tomorrow; what makes it consent-based is the capability it is registered for. So the floor is keyed by\n * `ProviderCapability`. A table of vendor names would be a second catalogue that rots.\n *\n * ## Why the table is total over the WHOLE vocabulary, not over `FRONTEND_*` names (#1702)\n *\n * It used to be total over `Extract<ProviderCapability, 'FRONTEND_${string}'>` and to answer \"no\n * consent\" for every other capability. That made the compile-time forcing depend on a naming\n * convention, and the fallback fail OPEN: frontend modules then declared `BILLING` and `SSO_OAUTH2`,\n * and a vendor declaring any other non-prefixed capability on its frontend module — or a future member\n * named without the prefix — would have started without consent, with nothing saying so.\n *\n * So every capability is classified here, and a new member of the vocabulary is a compile error until\n * somebody decides two things about it: can a browser host it at all, and if so, which purposes does it\n * rest on. A capability that is not browser-hosted may not be declared by a frontend module:\n * `projectFrontendProviderContribution` refuses the module, and at runtime the provider is never\n * permitted to start (fail closed), so a stale or hand-written entry cannot slip past the projection.\n * The `FRONTEND_` prefix remains a naming convention and nothing else.\n *\n * ## The floor, and why most capabilities need no consent\n *\n * - `FRONTEND_PRODUCT_ANALYTICS` measures how the service is used — `ConsentPurpose.ANALYTICS`.\n * - Error monitoring, captcha, search, file pickers, address lookup and sign-in code deliver or protect\n * a service the visitor asked for. They are not consent-based\n * processing; their lawful basis is the operator's to state in `operatorComplianceIdentity`, not a\n * banner's to ask. Gating them on consent would break the site for everyone who declines, which is the\n * opposite of what declining means.\n *\n * ## A vendor may add to the floor, never remove from it (#1702)\n *\n * Some vendors do more than their capability's floor. Google reCAPTCHA is the measured case: the CNIL\n * held that it is not exempt from consent as a security measure, because it also serves Google's own\n * analysis (Délibération SAN-2023-003), while a privacy-preserving captcha is exempt. The capability\n * cannot express that difference, so a frontend module may declare `consentPurposes` of its own, and the\n * provider rests on the UNION of those and its capabilities' floor. There is no field that subtracts: a\n * provider declaring `consentPurposes: []` on an analytics capability still rests on `ANALYTICS`.\n *\n * spec-cite: https://www.legifrance.gouv.fr/cnil/id/CNILTEXT000047346903 — the reCAPTCHA holding is\n * summarised from issue #1702's research, not quoted; no sentence of the decision is reproduced here.\n *\n * ## Where it is enforced\n *\n * In the shared runners — `activateFrontendProviderSdks` and `collectDeclaredProviderScripts` — and at\n * component load (`@wildo-ai/saas-frontend-lib`'s provider component registry), so no surface can\n * forget it. The SDK runner and the component registry take the granted purposes and default to NONE, so a\n * call that passes no grant — the SaaS application's startup activation, which runs before any person is known,\n * and the technical documentation, which asks no one — starts no consent-based provider rather than starting it\n * on an assumed consent. The script collector takes no grant at all: it never collects a consent-based\n * provider's scripts, granted or not (#1704). An application-tier consent-based SDK (the app-tier PostHog module is the first) is\n * activated by `ConsentBasedProviderSdksProvider` in `@wildo-ai/saas-frontend-lib`, which holds the signed-in\n * person's granted purposes (#1704).\n *\n * A consent-based provider must also be STOPPABLE ({@link consentBasedProviderStopRefusal}): refused at projection,\n * withheld at hydration, and skipped by the SDK runner, the script collector and the component registry.\n */\n\nimport {\n CONSENT_PURPOSES,\n ConsentPurpose,\n missingConsentPurposes,\n normalizeConsentPurposes,\n type ProviderCapability,\n} from '@wildo-ai/saas-models/public-runtime';\n\n/**\n * How a capability stands with respect to a browser and to consent.\n *\n * Two arms rather than a nullable purpose list, because \"needs no consent\" (`[]`) and \"cannot be hosted\n * by a browser at all\" are opposite answers, and a `null` standing for the second would be the silent\n * fallback this table exists to remove.\n */\nexport type FrontendCapabilityConsentClassification =\n | {\n /** A frontend module may declare this capability. */\n readonly browserHosted: true;\n /** The consent floor: purposes every provider of this capability rests on. Empty means none. */\n readonly consentPurposes: readonly ConsentPurpose[];\n }\n | {\n /**\n * The capability runs server-side only (a mail sender, an LLM, an audit sink). A frontend module\n * declaring it is refused at projection and never permitted to start.\n */\n readonly browserHosted: false;\n };\n\nconst SERVER_ONLY: FrontendCapabilityConsentClassification = Object.freeze({ browserHosted: false });\nconst HOSTED_WITHOUT_CONSENT: FrontendCapabilityConsentClassification = Object.freeze({\n browserHosted: true,\n consentPurposes: Object.freeze([]),\n});\n\n/** @wildo_source:part:start external-connectors.frontend-provider-consent-classification facet:kind:api facet:audience:app-developer */\n/**\n * The consent classification of EVERY provider capability — total over the vocabulary, so a capability\n * added tomorrow does not compile until it is classified here (#1702).\n *\n * A frontend provider module may declare only capabilities classified `browserHosted: true`; it rests on\n * the union of their `consentPurposes` and its own module-level `consentPurposes`.\n */\nexport const PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION = Object.freeze({\n // Browser-hosted, consent-based: measuring how the service is used.\n FRONTEND_PRODUCT_ANALYTICS: Object.freeze({ browserHosted: true, consentPurposes: Object.freeze([ConsentPurpose.ANALYTICS]) }),\n // Browser-hosted, no consent at the floor: each delivers or protects a service the person asked for.\n FRONTEND_ERROR_MONITORING: HOSTED_WITHOUT_CONSENT,\n FRONTEND_CAPTCHA: HOSTED_WITHOUT_CONSENT,\n FRONTEND_SEARCH: HOSTED_WITHOUT_CONSENT,\n FRONTEND_FILE_PICKER: HOSTED_WITHOUT_CONSENT,\n FRONTEND_ADDRESS_LOOKUP: HOSTED_WITHOUT_CONSENT,\n // Telling the chat host that opened the sign-in window that the sign-in finished: the person asked to sign in.\n FRONTEND_CHAT_SIGN_IN_COMPLETION: HOSTED_WITHOUT_CONSENT,\n // Browser sign-in code (a vendor's one-tap or button SDK). The person asked to sign in; that is not\n // consent-based processing. No engine module declares it today: the redirect-based sign-in the engine\n // ships runs no vendor code on the page, and its button labels come from the ref (#1701).\n SSO_OAUTH2: HOSTED_WITHOUT_CONSENT,\n // Server-side only. A frontend module declaring any of these is refused.\n // BILLING is the backend billing slot (subscriptions, checkout sessions, the portal link, webhooks).\n // Checkout and the customer portal are hosted redirects, so no billing code runs in the browser; a\n // frontend module declaring it used to FILL the engine's billing slot from the browser (#1701). An\n // embedded payment UI would be its own browser capability, decided in #1741.\n BILLING: SERVER_ONLY,\n EMAIL_TRANSACTIONAL: SERVER_ONLY,\n EMAIL_MARKETING: SERVER_ONLY,\n EMAIL_INBOUND: SERVER_ONLY,\n SMS: SERVER_ONLY,\n // #2293: a deliverable is sent for signature from the backend; the vendor's signing page is its own, not a browser SDK.\n ELECTRONIC_SIGNATURE: SERVER_ONLY,\n // The frame is the application's own engine component, not a browser module the provider loads.\n EMBEDDED_ELECTRONIC_SIGNATURE: SERVER_ONLY,\n SSO_SAML: SERVER_ONLY,\n LLM_CHAT: SERVER_ONLY,\n LLM_EMBEDDINGS: SERVER_ONLY,\n DOCUMENT_TEXT_EXTRACTION: SERVER_ONLY,\n PROMPT_INJECTION_SCREENING: SERVER_ONLY,\n OUTPUT_MODERATION: SERVER_ONLY,\n CODING_AGENT: SERVER_ONLY,\n IMAGE_GENERATION: SERVER_ONLY,\n LLM_OBSERVABILITY: SERVER_ONLY,\n OBSERVABILITY_TELEMETRY: SERVER_ONLY,\n COMPLIANCE_AUDIT_TRAIL: SERVER_ONLY,\n // Key custody signs, MACs and wraps with keys a browser must never hold or reach (#2891).\n KEY_MANAGEMENT: SERVER_ONLY,\n} as const satisfies Readonly<Record<ProviderCapability, FrontendCapabilityConsentClassification>>);\n/** @wildo_source:part:end external-connectors.frontend-provider-consent-classification */\n\ntype ConsentClassificationTable = typeof PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION;\n\n/** The capabilities a browser surface can host — DERIVED from the classification, never from a name prefix. */\nexport type FrontendProviderCapability = {\n [K in keyof ConsentClassificationTable]: ConsentClassificationTable[K]['browserHosted'] extends true ? K : never;\n}[keyof ConsentClassificationTable];\n\n/** The shape this module needs off a provider module or DATA entry. */\nexport interface ConsentClassifiableProviderModule {\n readonly providerCapabilities?: ReadonlyArray<string>;\n /**\n * Purposes the provider rests on BEYOND its capabilities' floor — the vendor-level addition (#1702).\n * Typed as strings because a hydrated module reads it off the wire; an unknown member is refused at\n * projection and makes the provider unpermitted at runtime rather than being dropped.\n */\n readonly consentPurposes?: ReadonlyArray<string>;\n}\n\nfunction classificationOf(capability: string): FrontendCapabilityConsentClassification | undefined {\n return Object.prototype.hasOwnProperty.call(PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION, capability)\n ? (PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION as Readonly<Record<string, FrontendCapabilityConsentClassification>>)[capability]\n : undefined;\n}\n\n/**\n * Every capability the provider declares that a browser may NOT host — server-only capabilities and\n * strings that are no capability at all. Empty for a correctly classified frontend provider.\n */\nexport function unclassifiedFrontendCapabilities(module: ConsentClassifiableProviderModule): string[] {\n return (module.providerCapabilities ?? []).filter((capability) => classificationOf(capability)?.browserHosted !== true);\n}\n\n/** Every provider-level consent purpose that is not a member of `ConsentPurpose`. */\nexport function unknownProviderConsentPurposes(module: ConsentClassifiableProviderModule): string[] {\n const known = new Set<string>(CONSENT_PURPOSES);\n return (module.consentPurposes ?? []).filter((purpose) => !known.has(purpose));\n}\n\n/**\n * Every consent purpose a provider rests on, in vocabulary order: the union of its capabilities' floor\n * and its own module-level `consentPurposes`. Nothing a provider declares can remove a purpose its\n * capability requires — the union has no subtracting input.\n */\nexport function consentPurposesRequiredByProvider(module: ConsentClassifiableProviderModule): ConsentPurpose[] {\n const required: string[] = [...(module.consentPurposes ?? [])];\n for (const capability of module.providerCapabilities ?? []) {\n const classification = classificationOf(capability);\n if (classification?.browserHosted === true) required.push(...classification.consentPurposes);\n }\n return normalizeConsentPurposes(required);\n}\n\n/**\n * Whether a provider may start given the purposes granted.\n *\n * FAILS CLOSED on a provider whose classification is broken — a capability no browser may host, or a\n * provider-level purpose outside the vocabulary. The projection refuses both, so reaching here with one\n * means an entry that bypassed it (a stale artifact, the backend's non-refusing fallback, a hand-written\n * contribution); starting it anyway would be the fail-open defect #1702 closes.\n */\nexport function isProviderPermittedByConsent(\n module: ConsentClassifiableProviderModule,\n grantedConsentPurposes: readonly ConsentPurpose[],\n): boolean {\n if (unclassifiedFrontendCapabilities(module).length > 0) return false;\n if (unknownProviderConsentPurposes(module).length > 0) return false;\n return missingConsentPurposes(grantedConsentPurposes, consentPurposesRequiredByProvider(module)).length === 0;\n}\n\n/**\n * The purposes the person would have to grant for this provider to start — what a consent-required\n * state names and offers. Empty both when the provider is permitted and when no grant could permit it\n * (a broken classification); `isProviderPermittedByConsent` tells the two apart.\n */\nexport function missingConsentPurposesForProvider(\n module: ConsentClassifiableProviderModule,\n grantedConsentPurposes: readonly ConsentPurpose[],\n): ConsentPurpose[] {\n return missingConsentPurposes(grantedConsentPurposes, consentPurposesRequiredByProvider(module));\n}\n\n/**\n * One sentence saying why a provider was withheld, for a diagnostic. Distinguishes the two reasons,\n * because their remedies are opposite: a missing grant is the person's to give, a broken classification\n * is the provider author's to fix.\n */\nexport function describeProviderConsentRefusal(\n providerRef: string,\n module: ConsentClassifiableProviderModule,\n grantedConsentPurposes: readonly ConsentPurpose[],\n): string {\n const unclassified = unclassifiedFrontendCapabilities(module);\n if (unclassified.length > 0) {\n return `Provider \"${providerRef}\" declares ${unclassified.join(', ')}, which no browser surface may host, so it `\n + 'never starts. Remove the capability from its frontend module.';\n }\n const unknownPurposes = unknownProviderConsentPurposes(module);\n if (unknownPurposes.length > 0) {\n return `Provider \"${providerRef}\" declares consent purposes ${unknownPurposes.join(', ')}, which are not consent `\n + 'purposes, so it never starts. Declare members of ConsentPurpose.';\n }\n return `Provider \"${providerRef}\" rests on consent to ${missingConsentPurposesForProvider(module, grantedConsentPurposes).join(', ')}, `\n + 'which has not been granted on this surface.';\n}\n\n/** Every purpose the given providers rest on — what a consent surface must ask about, and nothing more. */\nexport function consentPurposesInUseByProviders(modules: Iterable<ConsentClassifiableProviderModule> | undefined): ConsentPurpose[] {\n const inUse: ConsentPurpose[] = [];\n for (const module of modules ?? []) inUse.push(...consentPurposesRequiredByProvider(module));\n return normalizeConsentPurposes(inUse);\n}\n\n/**\n * The code-bearing shape the stop rule needs: whether a provider injects `<script>` tags, and whether\n * its SDK declares that it can be stopped.\n */\nexport interface StoppableConsentProviderModule extends ConsentClassifiableProviderModule {\n readonly scripts?: ReadonlyArray<unknown>;\n readonly sdk?: { readonly stoppable?: true };\n}\n\n/**\n * Why a CONSENT-BASED provider cannot honour a withdrawal, or `undefined` when it can (#1704).\n *\n * Consent can be withdrawn at any moment and must be as easy to withdraw as to give, so a provider that\n * starts on a grant must be stoppable on the withdrawal of that grant, in the same page. Two shapes\n * cannot be:\n *\n * - **`scripts`.** A `<script>` tag is DATA: the framework injects it and has no handle on what it runs.\n * Removing the element afterwards undoes nothing — the vendor's globals, listeners, timers and the\n * storage it wrote all stay (`load-frontend-provider-scripts.ts` says the same). A consent-based\n * vendor that ships as a script loads it from inside its own `sdk.activate` instead, where it can\n * also stop it.\n * - **An SDK that does not declare `stoppable`.** Whether `activate()` returns a `deactivate` is only\n * known after the vendor has started, which is too late to refuse. So the SDK states it up front,\n * and a declared SDK whose activation then returns no `deactivate` is reported by the runner.\n *\n * Asked at projection (the provider package's own `./companion` barrel refuses) and at hydration (the\n * provider's code and scripts are withheld with a diagnostic), so neither a stale artifact nor a\n * hand-written contribution can start an unstoppable consent-based provider. A provider resting on no\n * purpose is never refused here: nothing can be withdrawn from it.\n */\nexport function consentBasedProviderStopRefusal(providerRef: string, module: StoppableConsentProviderModule): string | undefined {\n const purposes = consentPurposesRequiredByProvider(module);\n if (purposes.length === 0) return undefined;\n if ((module.scripts?.length ?? 0) > 0) {\n return `Provider \"${providerRef}\" rests on consent to ${purposes.join(', ')} and declares <script> tags, which cannot be `\n + 'stopped when that consent is withdrawn. Load the script from inside its sdk.activate and return a deactivate '\n + 'instead (#1704).';\n }\n if (module.sdk !== undefined && module.sdk.stoppable !== true) {\n return `Provider \"${providerRef}\" rests on consent to ${purposes.join(', ')} and its SDK does not declare stoppable: true, `\n + 'so a withdrawal could not stop it. Return a deactivate from sdk.activate that fully stops the vendor, and declare '\n + 'stoppable: true (#1704).';\n }\n return undefined;\n}\n"]}
|