@adcp/sdk 6.5.0 → 6.7.0
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/ADCP_VERSION +1 -1
- package/AGENTS.md +4 -0
- package/README.md +29 -16
- package/bin/adcp-resolve.js +166 -0
- package/bin/adcp.js +547 -9
- package/compliance/cache/{3.0.1 → 3.0.5}/index.json +2 -2
- package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/audience-sync/index.yaml +1 -1
- package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/brand-rights/index.yaml +3 -3
- package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-social/index.yaml +7 -0
- package/compliance/cache/{3.0.1 → 3.0.5}/universal/runner-output-contract.yaml +23 -4
- package/compliance/cache/{3.0.1 → 3.0.5}/universal/storyboard-schema.yaml +106 -1
- package/compliance/cache/{3.0.1 → 3.0.5}/universal/v3-envelope-integrity.yaml +4 -2
- package/dist/lib/adapters/implicit-account-store.d.ts +170 -0
- package/dist/lib/adapters/implicit-account-store.d.ts.map +1 -0
- package/dist/lib/adapters/implicit-account-store.js +313 -0
- package/dist/lib/adapters/implicit-account-store.js.map +1 -0
- package/dist/lib/adapters/index.d.ts +4 -0
- package/dist/lib/adapters/index.d.ts.map +1 -1
- package/dist/lib/adapters/index.js +19 -1
- package/dist/lib/adapters/index.js.map +1 -1
- package/dist/lib/adapters/oauth-passthrough-resolver.d.ts +191 -0
- package/dist/lib/adapters/oauth-passthrough-resolver.d.ts.map +1 -0
- package/dist/lib/adapters/oauth-passthrough-resolver.js +178 -0
- package/dist/lib/adapters/oauth-passthrough-resolver.js.map +1 -0
- package/dist/lib/adapters/roster-account-store.d.ts +221 -0
- package/dist/lib/adapters/roster-account-store.d.ts.map +1 -0
- package/dist/lib/adapters/roster-account-store.js +194 -0
- package/dist/lib/adapters/roster-account-store.js.map +1 -0
- package/dist/lib/auth/oauth/ClientCredentialsFlow.d.ts.map +1 -1
- package/dist/lib/auth/oauth/ClientCredentialsFlow.js +5 -1
- package/dist/lib/auth/oauth/ClientCredentialsFlow.js.map +1 -1
- package/dist/lib/auth/oauth/discovery.d.ts.map +1 -1
- package/dist/lib/auth/oauth/discovery.js +6 -1
- package/dist/lib/auth/oauth/discovery.js.map +1 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +22 -0
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +117 -23
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +22 -7
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/mock-server/creative-template/seed-data.d.ts +45 -0
- package/dist/lib/mock-server/creative-template/seed-data.d.ts.map +1 -0
- package/dist/lib/mock-server/creative-template/seed-data.js +149 -0
- package/dist/lib/mock-server/creative-template/seed-data.js.map +1 -0
- package/dist/lib/mock-server/creative-template/server.d.ts +13 -0
- package/dist/lib/mock-server/creative-template/server.d.ts.map +1 -0
- package/dist/lib/mock-server/creative-template/server.js +325 -0
- package/dist/lib/mock-server/creative-template/server.js.map +1 -0
- package/dist/lib/mock-server/index.d.ts +64 -0
- package/dist/lib/mock-server/index.d.ts.map +1 -0
- package/dist/lib/mock-server/index.js +225 -0
- package/dist/lib/mock-server/index.js.map +1 -0
- package/dist/lib/mock-server/sales-guaranteed/seed-data.d.ts +46 -0
- package/dist/lib/mock-server/sales-guaranteed/seed-data.d.ts.map +1 -0
- package/dist/lib/mock-server/sales-guaranteed/seed-data.js +167 -0
- package/dist/lib/mock-server/sales-guaranteed/seed-data.js.map +1 -0
- package/dist/lib/mock-server/sales-guaranteed/server.d.ts +14 -0
- package/dist/lib/mock-server/sales-guaranteed/server.d.ts.map +1 -0
- package/dist/lib/mock-server/sales-guaranteed/server.js +893 -0
- package/dist/lib/mock-server/sales-guaranteed/server.js.map +1 -0
- package/dist/lib/mock-server/sales-social/seed-data.d.ts +34 -0
- package/dist/lib/mock-server/sales-social/seed-data.d.ts.map +1 -0
- package/dist/lib/mock-server/sales-social/seed-data.js +42 -0
- package/dist/lib/mock-server/sales-social/seed-data.js.map +1 -0
- package/dist/lib/mock-server/sales-social/server.d.ts +17 -0
- package/dist/lib/mock-server/sales-social/server.d.ts.map +1 -0
- package/dist/lib/mock-server/sales-social/server.js +1219 -0
- package/dist/lib/mock-server/sales-social/server.js.map +1 -0
- package/dist/lib/mock-server/signal-marketplace/seed-data.d.ts +77 -0
- package/dist/lib/mock-server/signal-marketplace/seed-data.d.ts.map +1 -0
- package/dist/lib/mock-server/signal-marketplace/seed-data.js +194 -0
- package/dist/lib/mock-server/signal-marketplace/seed-data.js.map +1 -0
- package/dist/lib/mock-server/signal-marketplace/server.d.ts +15 -0
- package/dist/lib/mock-server/signal-marketplace/server.d.ts.map +1 -0
- package/dist/lib/mock-server/signal-marketplace/server.js +382 -0
- package/dist/lib/mock-server/signal-marketplace/server.js.map +1 -0
- package/dist/lib/protocols/mcp.d.ts +4 -4
- package/dist/lib/protocols/mcp.d.ts.map +1 -1
- package/dist/lib/protocols/mcp.js +19 -13
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/schemas-data/3.0/a2ui/bound-value.json +1 -1
- package/dist/lib/schemas-data/3.0/a2ui/component.json +1 -1
- package/dist/lib/schemas-data/3.0/a2ui/si-catalog.json +25 -25
- package/dist/lib/schemas-data/3.0/a2ui/surface.json +2 -2
- package/dist/lib/schemas-data/3.0/a2ui/user-action.json +1 -1
- package/dist/lib/schemas-data/3.0/account/get-account-financials-request.json +5 -5
- package/dist/lib/schemas-data/3.0/account/get-account-financials-response.json +10 -10
- package/dist/lib/schemas-data/3.0/account/list-accounts-request.json +4 -4
- package/dist/lib/schemas-data/3.0/account/list-accounts-response.json +6 -6
- package/dist/lib/schemas-data/3.0/account/report-usage-request.json +5 -5
- package/dist/lib/schemas-data/3.0/account/report-usage-response.json +4 -4
- package/dist/lib/schemas-data/3.0/account/sync-accounts-request.json +9 -9
- package/dist/lib/schemas-data/3.0/account/sync-accounts-response.json +12 -12
- package/dist/lib/schemas-data/3.0/account/sync-governance-request.json +5 -5
- package/dist/lib/schemas-data/3.0/account/sync-governance-response.json +8 -8
- package/dist/lib/schemas-data/3.0/adagents.json +32 -32
- package/dist/lib/schemas-data/3.0/brand/acquire-rights-request.json +8 -8
- package/dist/lib/schemas-data/3.0/brand/acquire-rights-response.json +14 -14
- package/dist/lib/schemas-data/3.0/brand/creative-approval-request.json +4 -4
- package/dist/lib/schemas-data/3.0/brand/creative-approval-response.json +10 -10
- package/dist/lib/schemas-data/3.0/brand/get-brand-identity-request.json +3 -3
- package/dist/lib/schemas-data/3.0/brand/get-brand-identity-response.json +8 -8
- package/dist/lib/schemas-data/3.0/brand/get-rights-request.json +7 -7
- package/dist/lib/schemas-data/3.0/brand/get-rights-response.json +9 -9
- package/dist/lib/schemas-data/3.0/brand/revocation-notification.json +4 -4
- package/dist/lib/schemas-data/3.0/brand/rights-pricing-option.json +5 -5
- package/dist/lib/schemas-data/3.0/brand/rights-terms.json +3 -3
- package/dist/lib/schemas-data/3.0/brand/update-rights-request.json +4 -4
- package/dist/lib/schemas-data/3.0/brand/update-rights-response.json +9 -9
- package/dist/lib/schemas-data/3.0/brand.json +14 -14
- package/dist/lib/schemas-data/3.0/bundled/content-standards/calibrate-content-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/content-standards/calibrate-content-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/content-standards/create-content-standards-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/content-standards/create-content-standards-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/content-standards/get-content-standards-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/content-standards/get-content-standards-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/content-standards/get-media-buy-artifacts-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/content-standards/get-media-buy-artifacts-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/content-standards/list-content-standards-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/content-standards/list-content-standards-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/content-standards/update-content-standards-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/content-standards/update-content-standards-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/content-standards/validate-content-delivery-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/content-standards/validate-content-delivery-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/core/tasks-get-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/core/tasks-get-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/core/tasks-list-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/core/tasks-list-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-delivery-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-delivery-response.json +40 -6
- package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-features-request.json +7 -4
- package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-features-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/creative/list-creative-formats-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/creative/list-creative-formats-response.json +38 -7
- package/dist/lib/schemas-data/3.0/bundled/creative/list-creatives-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/creative/list-creatives-response.json +40 -6
- package/dist/lib/schemas-data/3.0/bundled/creative/preview-creative-request.json +11 -5
- package/dist/lib/schemas-data/3.0/bundled/creative/preview-creative-response.json +40 -6
- package/dist/lib/schemas-data/3.0/bundled/creative/sync-creatives-request.json +7 -4
- package/dist/lib/schemas-data/3.0/bundled/creative/sync-creatives-response.json +101 -8
- package/dist/lib/schemas-data/3.0/bundled/media-buy/build-creative-request.json +7 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/build-creative-response.json +110 -11
- package/dist/lib/schemas-data/3.0/bundled/media-buy/create-media-buy-request.json +7 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/create-media-buy-response.json +68 -6
- package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buy-delivery-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buy-delivery-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buys-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buys-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/get-products-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/get-products-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/list-creative-formats-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/list-creative-formats-response.json +38 -7
- package/dist/lib/schemas-data/3.0/bundled/media-buy/log-event-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/log-event-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/package-request.json +7 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/provide-performance-feedback-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/provide-performance-feedback-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-audiences-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-audiences-response.json +68 -6
- package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-catalogs-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-catalogs-response.json +68 -6
- package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-event-sources-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-event-sources-response.json +68 -6
- package/dist/lib/schemas-data/3.0/bundled/media-buy/update-media-buy-request.json +11 -5
- package/dist/lib/schemas-data/3.0/bundled/media-buy/update-media-buy-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/property/create-property-list-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/create-property-list-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/delete-property-list-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/delete-property-list-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/get-property-list-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/get-property-list-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/list-property-lists-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/list-property-lists-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/update-property-list-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/update-property-list-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/validate-property-delivery-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/property/validate-property-delivery-response.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/protocol/get-adcp-capabilities-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/protocol/get-adcp-capabilities-response.json +36 -5
- package/dist/lib/schemas-data/3.0/bundled/signals/activate-signal-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/signals/activate-signal-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/signals/get-signals-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/signals/get-signals-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-get-offering-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-get-offering-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-initiate-session-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-initiate-session-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-send-message-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-send-message-response.json +35 -4
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-terminate-session-request.json +2 -2
- package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-terminate-session-response.json +35 -4
- package/dist/lib/schemas-data/3.0/collection/base-collection-source.json +3 -3
- package/dist/lib/schemas-data/3.0/collection/collection-list-changed-webhook.json +2 -2
- package/dist/lib/schemas-data/3.0/collection/collection-list-filters.json +7 -7
- package/dist/lib/schemas-data/3.0/collection/collection-list.json +5 -5
- package/dist/lib/schemas-data/3.0/collection/create-collection-list-request.json +7 -7
- package/dist/lib/schemas-data/3.0/collection/create-collection-list-response.json +4 -4
- package/dist/lib/schemas-data/3.0/collection/delete-collection-list-request.json +4 -4
- package/dist/lib/schemas-data/3.0/collection/delete-collection-list-response.json +3 -3
- package/dist/lib/schemas-data/3.0/collection/get-collection-list-request.json +4 -4
- package/dist/lib/schemas-data/3.0/collection/get-collection-list-response.json +10 -10
- package/dist/lib/schemas-data/3.0/collection/list-collection-lists-request.json +5 -5
- package/dist/lib/schemas-data/3.0/collection/list-collection-lists-response.json +5 -5
- package/dist/lib/schemas-data/3.0/collection/update-collection-list-request.json +7 -7
- package/dist/lib/schemas-data/3.0/collection/update-collection-list-response.json +4 -4
- package/dist/lib/schemas-data/3.0/content-standards/artifact-webhook-payload.json +3 -3
- package/dist/lib/schemas-data/3.0/content-standards/artifact.json +7 -7
- package/dist/lib/schemas-data/3.0/content-standards/calibrate-content-request.json +4 -4
- package/dist/lib/schemas-data/3.0/content-standards/calibrate-content-response.json +8 -8
- package/dist/lib/schemas-data/3.0/content-standards/content-standards.json +7 -7
- package/dist/lib/schemas-data/3.0/content-standards/create-content-standards-request.json +7 -7
- package/dist/lib/schemas-data/3.0/content-standards/create-content-standards-response.json +6 -6
- package/dist/lib/schemas-data/3.0/content-standards/get-content-standards-request.json +3 -3
- package/dist/lib/schemas-data/3.0/content-standards/get-content-standards-response.json +7 -7
- package/dist/lib/schemas-data/3.0/content-standards/get-media-buy-artifacts-request.json +4 -4
- package/dist/lib/schemas-data/3.0/content-standards/get-media-buy-artifacts-response.json +8 -8
- package/dist/lib/schemas-data/3.0/content-standards/list-content-standards-request.json +5 -5
- package/dist/lib/schemas-data/3.0/content-standards/list-content-standards-response.json +8 -8
- package/dist/lib/schemas-data/3.0/content-standards/update-content-standards-request.json +7 -7
- package/dist/lib/schemas-data/3.0/content-standards/update-content-standards-response.json +6 -6
- package/dist/lib/schemas-data/3.0/content-standards/validate-content-delivery-request.json +4 -4
- package/dist/lib/schemas-data/3.0/content-standards/validate-content-delivery-response.json +8 -8
- package/dist/lib/schemas-data/3.0/core/account-ref.json +2 -2
- package/dist/lib/schemas-data/3.0/core/account.json +9 -9
- package/dist/lib/schemas-data/3.0/core/activation-key.json +1 -1
- package/dist/lib/schemas-data/3.0/core/ad-inventory-config.json +1 -1
- package/dist/lib/schemas-data/3.0/core/agent-encryption-key.json +1 -1
- package/dist/lib/schemas-data/3.0/core/agent-signing-key.json +1 -1
- package/dist/lib/schemas-data/3.0/core/app-item.json +4 -4
- package/dist/lib/schemas-data/3.0/core/assets/asset-union.json +53 -0
- package/dist/lib/schemas-data/3.0/core/assets/audio-asset.json +3 -3
- package/dist/lib/schemas-data/3.0/core/assets/brief-asset.json +2 -2
- package/dist/lib/schemas-data/3.0/core/assets/catalog-asset.json +2 -2
- package/dist/lib/schemas-data/3.0/core/assets/css-asset.json +2 -2
- package/dist/lib/schemas-data/3.0/core/assets/daast-asset.json +4 -4
- package/dist/lib/schemas-data/3.0/core/assets/html-asset.json +2 -2
- package/dist/lib/schemas-data/3.0/core/assets/image-asset.json +2 -2
- package/dist/lib/schemas-data/3.0/core/assets/javascript-asset.json +3 -3
- package/dist/lib/schemas-data/3.0/core/assets/markdown-asset.json +2 -2
- package/dist/lib/schemas-data/3.0/core/assets/text-asset.json +2 -2
- package/dist/lib/schemas-data/3.0/core/assets/url-asset.json +6 -5
- package/dist/lib/schemas-data/3.0/core/assets/vast-asset.json +4 -4
- package/dist/lib/schemas-data/3.0/core/assets/video-asset.json +7 -7
- package/dist/lib/schemas-data/3.0/core/assets/webhook-asset.json +7 -7
- package/dist/lib/schemas-data/3.0/core/async-response-data.json +25 -25
- package/dist/lib/schemas-data/3.0/core/attribution-window.json +4 -4
- package/dist/lib/schemas-data/3.0/core/audience-member.json +3 -3
- package/dist/lib/schemas-data/3.0/core/audience-selector.json +4 -4
- package/dist/lib/schemas-data/3.0/core/brand-id.json +1 -1
- package/dist/lib/schemas-data/3.0/core/brand-ref.json +2 -2
- package/dist/lib/schemas-data/3.0/core/business-entity.json +2 -2
- package/dist/lib/schemas-data/3.0/core/cancellation-policy.json +2 -2
- package/dist/lib/schemas-data/3.0/core/catalog-field-mapping.json +2 -2
- package/dist/lib/schemas-data/3.0/core/catalog.json +7 -7
- package/dist/lib/schemas-data/3.0/core/catchment.json +5 -5
- package/dist/lib/schemas-data/3.0/core/collection-distribution.json +2 -2
- package/dist/lib/schemas-data/3.0/core/collection-list-ref.json +1 -1
- package/dist/lib/schemas-data/3.0/core/collection-selector.json +1 -1
- package/dist/lib/schemas-data/3.0/core/collection.json +13 -13
- package/dist/lib/schemas-data/3.0/core/content-rating.json +2 -2
- package/dist/lib/schemas-data/3.0/core/context.json +1 -1
- package/dist/lib/schemas-data/3.0/core/creative-asset.json +6 -52
- package/dist/lib/schemas-data/3.0/core/creative-assignment.json +1 -1
- package/dist/lib/schemas-data/3.0/core/creative-brief.json +4 -4
- package/dist/lib/schemas-data/3.0/core/creative-consumption.json +1 -1
- package/dist/lib/schemas-data/3.0/core/creative-filters.json +4 -4
- package/dist/lib/schemas-data/3.0/core/creative-item.json +1 -1
- package/dist/lib/schemas-data/3.0/core/creative-manifest.json +7 -53
- package/dist/lib/schemas-data/3.0/core/creative-policy.json +3 -3
- package/dist/lib/schemas-data/3.0/core/creative-variable.json +1 -1
- package/dist/lib/schemas-data/3.0/core/creative-variant.json +5 -5
- package/dist/lib/schemas-data/3.0/core/data-provider-signal-selector.json +1 -1
- package/dist/lib/schemas-data/3.0/core/date-range.json +1 -1
- package/dist/lib/schemas-data/3.0/core/datetime-range.json +1 -1
- package/dist/lib/schemas-data/3.0/core/daypart-target.json +2 -2
- package/dist/lib/schemas-data/3.0/core/deadline-policy.json +1 -1
- package/dist/lib/schemas-data/3.0/core/delivery-forecast.json +7 -7
- package/dist/lib/schemas-data/3.0/core/delivery-metrics.json +5 -5
- package/dist/lib/schemas-data/3.0/core/deployment.json +3 -3
- package/dist/lib/schemas-data/3.0/core/destination-item.json +4 -4
- package/dist/lib/schemas-data/3.0/core/destination.json +1 -1
- package/dist/lib/schemas-data/3.0/core/diagnostic-issue.json +1 -1
- package/dist/lib/schemas-data/3.0/core/duration.json +1 -1
- package/dist/lib/schemas-data/3.0/core/education-item.json +4 -4
- package/dist/lib/schemas-data/3.0/core/error.json +34 -3
- package/dist/lib/schemas-data/3.0/core/event-custom-data.json +2 -2
- package/dist/lib/schemas-data/3.0/core/event-source-health.json +3 -3
- package/dist/lib/schemas-data/3.0/core/event.json +6 -6
- package/dist/lib/schemas-data/3.0/core/ext.json +1 -1
- package/dist/lib/schemas-data/3.0/core/feature-requirement.json +1 -1
- package/dist/lib/schemas-data/3.0/core/flight-item.json +4 -4
- package/dist/lib/schemas-data/3.0/core/forecast-point.json +18 -18
- package/dist/lib/schemas-data/3.0/core/forecast-range.json +1 -1
- package/dist/lib/schemas-data/3.0/core/format-id.json +1 -1
- package/dist/lib/schemas-data/3.0/core/format.json +42 -42
- package/dist/lib/schemas-data/3.0/core/frequency-cap.json +4 -4
- package/dist/lib/schemas-data/3.0/core/generation-credential.json +3 -3
- package/dist/lib/schemas-data/3.0/core/geo-breakdown-support.json +3 -3
- package/dist/lib/schemas-data/3.0/core/hotel-item.json +4 -4
- package/dist/lib/schemas-data/3.0/core/identifier.json +2 -2
- package/dist/lib/schemas-data/3.0/core/industry-identifier.json +2 -2
- package/dist/lib/schemas-data/3.0/core/insertion-order.json +1 -1
- package/dist/lib/schemas-data/3.0/core/installment-deadlines.json +2 -2
- package/dist/lib/schemas-data/3.0/core/installment.json +9 -9
- package/dist/lib/schemas-data/3.0/core/job-item.json +3 -3
- package/dist/lib/schemas-data/3.0/core/limited-series.json +1 -1
- package/dist/lib/schemas-data/3.0/core/material-deadline.json +1 -1
- package/dist/lib/schemas-data/3.0/core/mcp-webhook-payload.json +5 -5
- package/dist/lib/schemas-data/3.0/core/measurement-readiness.json +5 -5
- package/dist/lib/schemas-data/3.0/core/measurement-terms.json +3 -3
- package/dist/lib/schemas-data/3.0/core/measurement-window.json +1 -1
- package/dist/lib/schemas-data/3.0/core/media-buy-features.json +1 -1
- package/dist/lib/schemas-data/3.0/core/media-buy.json +7 -7
- package/dist/lib/schemas-data/3.0/core/offering-asset-group.json +16 -16
- package/dist/lib/schemas-data/3.0/core/offering.json +5 -5
- package/dist/lib/schemas-data/3.0/core/optimization-goal.json +6 -6
- package/dist/lib/schemas-data/3.0/core/outcome-measurement.json +2 -2
- package/dist/lib/schemas-data/3.0/core/overlay.json +1 -1
- package/dist/lib/schemas-data/3.0/core/package.json +14 -14
- package/dist/lib/schemas-data/3.0/core/pagination-request.json +1 -1
- package/dist/lib/schemas-data/3.0/core/pagination-response.json +1 -1
- package/dist/lib/schemas-data/3.0/core/performance-feedback.json +3 -3
- package/dist/lib/schemas-data/3.0/core/performance-standard.json +4 -4
- package/dist/lib/schemas-data/3.0/core/placement-definition.json +5 -5
- package/dist/lib/schemas-data/3.0/core/placement.json +2 -2
- package/dist/lib/schemas-data/3.0/core/planned-delivery.json +5 -5
- package/dist/lib/schemas-data/3.0/core/price.json +1 -1
- package/dist/lib/schemas-data/3.0/core/pricing-option.json +10 -10
- package/dist/lib/schemas-data/3.0/core/product-allocation.json +4 -4
- package/dist/lib/schemas-data/3.0/core/product-filters.json +16 -16
- package/dist/lib/schemas-data/3.0/core/product.json +28 -28
- package/dist/lib/schemas-data/3.0/core/property-id.json +1 -1
- package/dist/lib/schemas-data/3.0/core/property-list-ref.json +1 -1
- package/dist/lib/schemas-data/3.0/core/property-tag.json +1 -1
- package/dist/lib/schemas-data/3.0/core/property.json +6 -6
- package/dist/lib/schemas-data/3.0/core/proposal.json +6 -6
- package/dist/lib/schemas-data/3.0/core/protocol-envelope.json +3 -3
- package/dist/lib/schemas-data/3.0/core/provenance.json +6 -6
- package/dist/lib/schemas-data/3.0/core/publisher-property-selector.json +3 -3
- package/dist/lib/schemas-data/3.0/core/push-notification-config.json +2 -2
- package/dist/lib/schemas-data/3.0/core/real-estate-item.json +4 -4
- package/dist/lib/schemas-data/3.0/core/reference-asset.json +1 -1
- package/dist/lib/schemas-data/3.0/core/reporting-capabilities.json +5 -5
- package/dist/lib/schemas-data/3.0/core/reporting-webhook.json +3 -3
- package/dist/lib/schemas-data/3.0/core/requirements/asset-requirements.json +13 -13
- package/dist/lib/schemas-data/3.0/core/requirements/audio-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/catalog-field-binding.json +4 -4
- package/dist/lib/schemas-data/3.0/core/requirements/catalog-requirements.json +5 -5
- package/dist/lib/schemas-data/3.0/core/requirements/css-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/daast-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/html-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/image-asset-requirements.json +2 -2
- package/dist/lib/schemas-data/3.0/core/requirements/javascript-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/markdown-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/offering-asset-constraint.json +4 -4
- package/dist/lib/schemas-data/3.0/core/requirements/text-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/url-asset-requirements.json +2 -2
- package/dist/lib/schemas-data/3.0/core/requirements/vast-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/requirements/video-asset-requirements.json +6 -6
- package/dist/lib/schemas-data/3.0/core/requirements/webhook-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.0/core/response.json +1 -1
- package/dist/lib/schemas-data/3.0/core/rights-constraint.json +4 -4
- package/dist/lib/schemas-data/3.0/core/seller-agent-ref.json +1 -1
- package/dist/lib/schemas-data/3.0/core/signal-definition.json +3 -3
- package/dist/lib/schemas-data/3.0/core/signal-filters.json +2 -2
- package/dist/lib/schemas-data/3.0/core/signal-id.json +1 -1
- package/dist/lib/schemas-data/3.0/core/signal-pricing-option.json +2 -2
- package/dist/lib/schemas-data/3.0/core/signal-pricing.json +6 -6
- package/dist/lib/schemas-data/3.0/core/signal-targeting.json +4 -4
- package/dist/lib/schemas-data/3.0/core/special.json +2 -2
- package/dist/lib/schemas-data/3.0/core/start-timing.json +1 -1
- package/dist/lib/schemas-data/3.0/core/store-item.json +3 -3
- package/dist/lib/schemas-data/3.0/core/talent.json +2 -2
- package/dist/lib/schemas-data/3.0/core/targeting.json +20 -20
- package/dist/lib/schemas-data/3.0/core/tasks-get-request.json +3 -3
- package/dist/lib/schemas-data/3.0/core/tasks-get-response.json +7 -7
- package/dist/lib/schemas-data/3.0/core/tasks-list-request.json +11 -11
- package/dist/lib/schemas-data/3.0/core/tasks-list-response.json +6 -6
- package/dist/lib/schemas-data/3.0/core/user-match.json +3 -3
- package/dist/lib/schemas-data/3.0/core/vehicle-item.json +4 -4
- package/dist/lib/schemas-data/3.0/core/vendor-pricing-option.json +2 -2
- package/dist/lib/schemas-data/3.0/core/x-entity-types.json +1 -1
- package/dist/lib/schemas-data/3.0/creative/asset-types/index.json +5 -5
- package/dist/lib/schemas-data/3.0/creative/creative-feature-result.json +2 -2
- package/dist/lib/schemas-data/3.0/creative/get-creative-delivery-request.json +5 -5
- package/dist/lib/schemas-data/3.0/creative/get-creative-delivery-response.json +7 -7
- package/dist/lib/schemas-data/3.0/creative/get-creative-features-request.json +5 -5
- package/dist/lib/schemas-data/3.0/creative/get-creative-features-response.json +8 -8
- package/dist/lib/schemas-data/3.0/creative/list-creative-formats-request.json +11 -11
- package/dist/lib/schemas-data/3.0/creative/list-creative-formats-response.json +7 -7
- package/dist/lib/schemas-data/3.0/creative/list-creatives-request.json +8 -8
- package/dist/lib/schemas-data/3.0/creative/list-creatives-response.json +14 -60
- package/dist/lib/schemas-data/3.0/creative/preview-creative-request.json +11 -11
- package/dist/lib/schemas-data/3.0/creative/preview-creative-response.json +12 -12
- package/dist/lib/schemas-data/3.0/creative/preview-render.json +1 -1
- package/dist/lib/schemas-data/3.0/creative/sync-creatives-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.0/creative/sync-creatives-async-response-submitted.json +3 -3
- package/dist/lib/schemas-data/3.0/creative/sync-creatives-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.0/creative/sync-creatives-request.json +7 -7
- package/dist/lib/schemas-data/3.0/creative/sync-creatives-response.json +13 -13
- package/dist/lib/schemas-data/3.0/enums/account-scope.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/account-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/action-source.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/adcp-protocol.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/adjustment-kind.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/advertiser-industry.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/age-verification-method.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/assessment-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/asset-content-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/attribution-model.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/audience-source.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/audience-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/audio-channel-layout.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/auth-scheme.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/available-metric.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/billing-party.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/binary-verdict.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/brand-agent-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/canceled-by.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/catalog-action.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/catalog-item-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/catalog-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/channels.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/cloud-storage-protocol.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/co-branding-requirement.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/collection-cadence.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/collection-kind.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/collection-relationship.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/collection-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/consent-basis.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/content-id-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/content-rating-system.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/creative-action.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/creative-agent-capability.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/creative-approval-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/creative-identifier-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/creative-quality.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/creative-sort-field.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/creative-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/daast-tracking-event.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/daast-version.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/day-of-week.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/delegation-authority.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/delivery-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/demographic-system.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/derivative-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/device-platform.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/device-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/digital-source-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/dimension-unit.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/disclosure-persistence.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/disclosure-position.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/distance-unit.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/distribution-identifier-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/error-code.json +185 -2
- package/dist/lib/schemas-data/3.0/enums/escalation-severity.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/event-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/exclusivity.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/feature-check-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/feed-format.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/feedback-source.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/forecast-method.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/forecast-range-unit.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/forecastable-metric.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/format-id-parameter.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/frame-rate-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/frequency-cap-scope.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/genre-taxonomy.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/geo-level.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/gop-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/governance-decision.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/governance-domain.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/governance-mode.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/governance-phase.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/history-entry-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/http-method.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/identifier-types.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/installment-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/javascript-module-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/landing-page-requirement.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/makegood-remedy.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/markdown-flavor.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/match-id-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/match-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/media-buy-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/media-buy-valid-action.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/metric-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/metro-system.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/moov-atom-position.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/notification-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/outcome-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/pacing.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/payment-terms.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/performance-standard-metric.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/policy-category.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/policy-enforcement.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/postal-system.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/preview-output-format.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/pricing-model.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/production-quality.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/property-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/proposal-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/publisher-identifier-types.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/purchase-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/reach-unit.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/reporting-frequency.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/response-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/restricted-attribute.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/right-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/right-use.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/rights-billing-period.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/scan-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/si-session-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/signal-catalog-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/signal-source.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/signal-value-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/snapshot-unavailable-reason.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/sort-direction.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/sort-metric.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/special-category.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/specialism.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/talent-role.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/task-status.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/task-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/transport-mode.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/travel-time-unit.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/uid-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/universal-macro.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/update-frequency.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/url-asset-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/validation-mode.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/vast-tracking-event.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/vast-version.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/viewability-standard.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/wcag-level.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/webhook-response-type.json +1 -1
- package/dist/lib/schemas-data/3.0/enums/webhook-security-method.json +1 -1
- package/dist/lib/schemas-data/3.0/error-details/account-setup-required.json +2 -2
- package/dist/lib/schemas-data/3.0/error-details/audience-too-small.json +2 -2
- package/dist/lib/schemas-data/3.0/error-details/budget-too-low.json +2 -2
- package/dist/lib/schemas-data/3.0/error-details/conflict.json +2 -2
- package/dist/lib/schemas-data/3.0/error-details/creative-rejected.json +2 -2
- package/dist/lib/schemas-data/3.0/error-details/policy-violation.json +2 -2
- package/dist/lib/schemas-data/3.0/error-details/rate-limited.json +1 -1
- package/dist/lib/schemas-data/3.0/error-details/vendor-error-codes.json +1 -1
- package/dist/lib/schemas-data/3.0/extensions/extension-meta.json +1 -1
- package/dist/lib/schemas-data/3.0/extensions/index.json +2 -2
- package/dist/lib/schemas-data/3.0/governance/attribute-definition.json +1 -1
- package/dist/lib/schemas-data/3.0/governance/audience-constraints.json +3 -3
- package/dist/lib/schemas-data/3.0/governance/check-governance-request.json +7 -7
- package/dist/lib/schemas-data/3.0/governance/check-governance-response.json +6 -6
- package/dist/lib/schemas-data/3.0/governance/get-plan-audit-logs-request.json +4 -4
- package/dist/lib/schemas-data/3.0/governance/get-plan-audit-logs-response.json +9 -9
- package/dist/lib/schemas-data/3.0/governance/policy-category-definition.json +2 -2
- package/dist/lib/schemas-data/3.0/governance/policy-entry.json +6 -6
- package/dist/lib/schemas-data/3.0/governance/policy-ref.json +1 -1
- package/dist/lib/schemas-data/3.0/governance/report-plan-outcome-request.json +6 -6
- package/dist/lib/schemas-data/3.0/governance/report-plan-outcome-response.json +4 -4
- package/dist/lib/schemas-data/3.0/governance/sync-plans-request.json +13 -13
- package/dist/lib/schemas-data/3.0/governance/sync-plans-response.json +4 -4
- package/dist/lib/schemas-data/3.0/index.json +364 -364
- package/dist/lib/schemas-data/3.0/manifest.json +1190 -0
- package/dist/lib/schemas-data/3.0/manifest.schema.json +202 -0
- package/dist/lib/schemas-data/3.0/media-buy/build-creative-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.0/media-buy/build-creative-async-response-submitted.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/build-creative-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/build-creative-request.json +11 -11
- package/dist/lib/schemas-data/3.0/media-buy/build-creative-response.json +17 -17
- package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-async-response-submitted.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-request.json +12 -12
- package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-response.json +15 -15
- package/dist/lib/schemas-data/3.0/media-buy/get-media-buy-delivery-request.json +17 -17
- package/dist/lib/schemas-data/3.0/media-buy/get-media-buy-delivery-response.json +24 -24
- package/dist/lib/schemas-data/3.0/media-buy/get-media-buys-request.json +7 -7
- package/dist/lib/schemas-data/3.0/media-buy/get-media-buys-response.json +19 -19
- package/dist/lib/schemas-data/3.0/media-buy/get-products-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.0/media-buy/get-products-async-response-submitted.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/get-products-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/get-products-request.json +11 -11
- package/dist/lib/schemas-data/3.0/media-buy/get-products-response.json +8 -8
- package/dist/lib/schemas-data/3.0/media-buy/list-creative-formats-request.json +11 -11
- package/dist/lib/schemas-data/3.0/media-buy/list-creative-formats-response.json +7 -7
- package/dist/lib/schemas-data/3.0/media-buy/log-event-request.json +4 -4
- package/dist/lib/schemas-data/3.0/media-buy/log-event-response.json +6 -6
- package/dist/lib/schemas-data/3.0/media-buy/package-request.json +12 -12
- package/dist/lib/schemas-data/3.0/media-buy/package-update.json +13 -13
- package/dist/lib/schemas-data/3.0/media-buy/provide-performance-feedback-request.json +6 -6
- package/dist/lib/schemas-data/3.0/media-buy/provide-performance-feedback-response.json +6 -6
- package/dist/lib/schemas-data/3.0/media-buy/sync-audiences-request.json +7 -7
- package/dist/lib/schemas-data/3.0/media-buy/sync-audiences-response.json +9 -9
- package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-async-response-submitted.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-request.json +7 -7
- package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-response.json +9 -9
- package/dist/lib/schemas-data/3.0/media-buy/sync-event-sources-request.json +5 -5
- package/dist/lib/schemas-data/3.0/media-buy/sync-event-sources-response.json +10 -10
- package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-async-response-submitted.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-request.json +10 -10
- package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-response.json +10 -10
- package/dist/lib/schemas-data/3.0/pricing-options/cpa-option.json +4 -4
- package/dist/lib/schemas-data/3.0/pricing-options/cpc-option.json +4 -4
- package/dist/lib/schemas-data/3.0/pricing-options/cpcv-option.json +4 -4
- package/dist/lib/schemas-data/3.0/pricing-options/cpm-option.json +4 -4
- package/dist/lib/schemas-data/3.0/pricing-options/cpp-option.json +5 -5
- package/dist/lib/schemas-data/3.0/pricing-options/cpv-option.json +4 -4
- package/dist/lib/schemas-data/3.0/pricing-options/flat-rate-option.json +4 -4
- package/dist/lib/schemas-data/3.0/pricing-options/price-breakdown.json +2 -2
- package/dist/lib/schemas-data/3.0/pricing-options/price-guidance.json +1 -1
- package/dist/lib/schemas-data/3.0/pricing-options/time-option.json +4 -4
- package/dist/lib/schemas-data/3.0/pricing-options/vcpm-option.json +4 -4
- package/dist/lib/schemas-data/3.0/property/authorization-result.json +1 -1
- package/dist/lib/schemas-data/3.0/property/base-property-source.json +4 -4
- package/dist/lib/schemas-data/3.0/property/create-property-list-request.json +7 -7
- package/dist/lib/schemas-data/3.0/property/create-property-list-response.json +4 -4
- package/dist/lib/schemas-data/3.0/property/delete-property-list-request.json +4 -4
- package/dist/lib/schemas-data/3.0/property/delete-property-list-response.json +3 -3
- package/dist/lib/schemas-data/3.0/property/delivery-record.json +3 -3
- package/dist/lib/schemas-data/3.0/property/get-property-list-request.json +4 -4
- package/dist/lib/schemas-data/3.0/property/get-property-list-response.json +7 -7
- package/dist/lib/schemas-data/3.0/property/list-property-lists-request.json +5 -5
- package/dist/lib/schemas-data/3.0/property/list-property-lists-response.json +5 -5
- package/dist/lib/schemas-data/3.0/property/property-error.json +2 -2
- package/dist/lib/schemas-data/3.0/property/property-feature-definition.json +2 -2
- package/dist/lib/schemas-data/3.0/property/property-feature-result.json +4 -4
- package/dist/lib/schemas-data/3.0/property/property-feature-value.json +2 -2
- package/dist/lib/schemas-data/3.0/property/property-feature.json +1 -1
- package/dist/lib/schemas-data/3.0/property/property-list-changed-webhook.json +2 -2
- package/dist/lib/schemas-data/3.0/property/property-list-filters.json +5 -5
- package/dist/lib/schemas-data/3.0/property/property-list.json +6 -6
- package/dist/lib/schemas-data/3.0/property/update-property-list-request.json +7 -7
- package/dist/lib/schemas-data/3.0/property/update-property-list-response.json +4 -4
- package/dist/lib/schemas-data/3.0/property/validate-property-delivery-request.json +5 -5
- package/dist/lib/schemas-data/3.0/property/validate-property-delivery-response.json +4 -4
- package/dist/lib/schemas-data/3.0/property/validation-result.json +5 -5
- package/dist/lib/schemas-data/3.0/protocol/get-adcp-capabilities-request.json +3 -3
- package/dist/lib/schemas-data/3.0/protocol/get-adcp-capabilities-response.json +26 -26
- package/dist/lib/schemas-data/3.0/signals/activate-signal-request.json +5 -5
- package/dist/lib/schemas-data/3.0/signals/activate-signal-response.json +7 -7
- package/dist/lib/schemas-data/3.0/signals/get-signals-request.json +8 -8
- package/dist/lib/schemas-data/3.0/signals/get-signals-response.json +10 -10
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-capabilities.json +1 -1
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-get-offering-request.json +3 -3
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-get-offering-response.json +4 -4
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-identity.json +1 -1
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-initiate-session-request.json +5 -5
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-initiate-session-response.json +7 -7
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-send-message-request.json +3 -3
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-send-message-response.json +7 -7
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-terminate-session-request.json +3 -3
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-terminate-session-response.json +5 -5
- package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-ui-element.json +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/adcp-server.d.ts +21 -0
- package/dist/lib/server/adcp-server.d.ts.map +1 -1
- package/dist/lib/server/adcp-server.js +22 -1
- package/dist/lib/server/adcp-server.js.map +1 -1
- package/dist/lib/server/auth-signature.d.ts.map +1 -1
- package/dist/lib/server/auth-signature.js +21 -0
- package/dist/lib/server/auth-signature.js.map +1 -1
- package/dist/lib/server/auth.d.ts +24 -0
- package/dist/lib/server/auth.d.ts.map +1 -1
- package/dist/lib/server/auth.js +71 -3
- package/dist/lib/server/auth.js.map +1 -1
- package/dist/lib/server/create-adcp-server.d.ts +203 -21
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +322 -13
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/decisioning/account.d.ts +340 -21
- package/dist/lib/server/decisioning/account.d.ts.map +1 -1
- package/dist/lib/server/decisioning/account.js +150 -4
- package/dist/lib/server/decisioning/account.js.map +1 -1
- package/dist/lib/server/decisioning/admin-router.d.ts.map +1 -1
- package/dist/lib/server/decisioning/admin-router.js +5 -1
- package/dist/lib/server/decisioning/admin-router.js.map +1 -1
- package/dist/lib/server/decisioning/buyer-agent.d.ts +465 -0
- package/dist/lib/server/decisioning/buyer-agent.d.ts.map +1 -0
- package/dist/lib/server/decisioning/buyer-agent.js +372 -0
- package/dist/lib/server/decisioning/buyer-agent.js.map +1 -0
- package/dist/lib/server/decisioning/capabilities.d.ts +39 -7
- package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
- package/dist/lib/server/decisioning/compose.d.ts +93 -0
- package/dist/lib/server/decisioning/compose.d.ts.map +1 -0
- package/dist/lib/server/decisioning/compose.js +81 -0
- package/dist/lib/server/decisioning/compose.js.map +1 -0
- package/dist/lib/server/decisioning/context.d.ts +11 -0
- package/dist/lib/server/decisioning/context.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.d.ts +12 -3
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +45 -2
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/platform-helpers.d.ts +269 -0
- package/dist/lib/server/decisioning/platform-helpers.d.ts.map +1 -0
- package/dist/lib/server/decisioning/platform-helpers.js +316 -0
- package/dist/lib/server/decisioning/platform-helpers.js.map +1 -0
- package/dist/lib/server/decisioning/platform.d.ts +127 -4
- package/dist/lib/server/decisioning/platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/platform.js.map +1 -1
- package/dist/lib/server/decisioning/resolve-presets.d.ts +129 -0
- package/dist/lib/server/decisioning/resolve-presets.d.ts.map +1 -0
- package/dist/lib/server/decisioning/resolve-presets.js +142 -0
- package/dist/lib/server/decisioning/resolve-presets.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/entity-hydration.generated.d.ts +8 -0
- package/dist/lib/server/decisioning/runtime/entity-hydration.generated.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/entity-hydration.generated.js +101 -0
- package/dist/lib/server/decisioning/runtime/entity-hydration.generated.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +91 -8
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +764 -130
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.js +1 -0
- package/dist/lib/server/decisioning/runtime/to-context.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.js +31 -3
- package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +83 -6
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/brand-rights.js +12 -5
- package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +41 -4
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative.d.ts +47 -3
- package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.d.ts +115 -9
- package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
- package/dist/lib/server/decisioning/tenant-registry.d.ts.map +1 -1
- package/dist/lib/server/decisioning/tenant-registry.js +8 -3
- package/dist/lib/server/decisioning/tenant-registry.js.map +1 -1
- package/dist/lib/server/decisioning/tenant-store.d.ts +200 -0
- package/dist/lib/server/decisioning/tenant-store.d.ts.map +1 -0
- package/dist/lib/server/decisioning/tenant-store.js +182 -0
- package/dist/lib/server/decisioning/tenant-store.js.map +1 -0
- package/dist/lib/server/decisioning/validate-specialisms.d.ts +66 -0
- package/dist/lib/server/decisioning/validate-specialisms.d.ts.map +1 -0
- package/dist/lib/server/decisioning/validate-specialisms.js +119 -0
- package/dist/lib/server/decisioning/validate-specialisms.js.map +1 -0
- package/dist/lib/server/index.d.ts +11 -2
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js +35 -3
- package/dist/lib/server/index.js.map +1 -1
- package/dist/lib/server/media-buy-store.d.ts +126 -0
- package/dist/lib/server/media-buy-store.d.ts.map +1 -0
- package/dist/lib/server/media-buy-store.js +171 -0
- package/dist/lib/server/media-buy-store.js.map +1 -0
- package/dist/lib/server/redact.d.ts +52 -0
- package/dist/lib/server/redact.d.ts.map +1 -0
- package/dist/lib/server/redact.js +86 -0
- package/dist/lib/server/redact.js.map +1 -0
- package/dist/lib/server/responses.d.ts +60 -1
- package/dist/lib/server/responses.d.ts.map +1 -1
- package/dist/lib/server/responses.js +110 -1
- package/dist/lib/server/responses.js.map +1 -1
- package/dist/lib/server/serve.d.ts.map +1 -1
- package/dist/lib/server/serve.js +35 -1
- package/dist/lib/server/serve.js.map +1 -1
- package/dist/lib/server/state-machine.d.ts +80 -0
- package/dist/lib/server/state-machine.d.ts.map +1 -0
- package/dist/lib/server/state-machine.js +125 -0
- package/dist/lib/server/state-machine.js.map +1 -0
- package/dist/lib/server/test-controller.d.ts +48 -0
- package/dist/lib/server/test-controller.d.ts.map +1 -1
- package/dist/lib/server/test-controller.js +89 -10
- package/dist/lib/server/test-controller.js.map +1 -1
- package/dist/lib/server/upstream-helpers.d.ts +182 -0
- package/dist/lib/server/upstream-helpers.d.ts.map +1 -0
- package/dist/lib/server/upstream-helpers.js +140 -0
- package/dist/lib/server/upstream-helpers.js.map +1 -0
- package/dist/lib/signing/agent-resolver/canonicalize.d.ts +44 -0
- package/dist/lib/signing/agent-resolver/canonicalize.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/canonicalize.js +85 -0
- package/dist/lib/signing/agent-resolver/canonicalize.js.map +1 -0
- package/dist/lib/signing/agent-resolver/capabilities-types.d.ts +54 -0
- package/dist/lib/signing/agent-resolver/capabilities-types.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/capabilities-types.js +49 -0
- package/dist/lib/signing/agent-resolver/capabilities-types.js.map +1 -0
- package/dist/lib/signing/agent-resolver/consistency.d.ts +84 -0
- package/dist/lib/signing/agent-resolver/consistency.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/consistency.js +121 -0
- package/dist/lib/signing/agent-resolver/consistency.js.map +1 -0
- package/dist/lib/signing/agent-resolver/errors.d.ts +68 -0
- package/dist/lib/signing/agent-resolver/errors.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/errors.js +45 -0
- package/dist/lib/signing/agent-resolver/errors.js.map +1 -0
- package/dist/lib/signing/agent-resolver/etld.d.ts +25 -0
- package/dist/lib/signing/agent-resolver/etld.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/etld.js +75 -0
- package/dist/lib/signing/agent-resolver/etld.js.map +1 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +41 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.js +85 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.js.map +1 -0
- package/dist/lib/signing/agent-resolver/index.d.ts +26 -0
- package/dist/lib/signing/agent-resolver/index.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/index.js +33 -0
- package/dist/lib/signing/agent-resolver/index.js.map +1 -0
- package/dist/lib/signing/agent-resolver/jwks-set.d.ts +76 -0
- package/dist/lib/signing/agent-resolver/jwks-set.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/jwks-set.js +124 -0
- package/dist/lib/signing/agent-resolver/jwks-set.js.map +1 -0
- package/dist/lib/signing/agent-resolver/resolve-agent.d.ts +123 -0
- package/dist/lib/signing/agent-resolver/resolve-agent.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/resolve-agent.js +398 -0
- package/dist/lib/signing/agent-resolver/resolve-agent.js.map +1 -0
- package/dist/lib/signing/agent-resolver/select-agent.d.ts +54 -0
- package/dist/lib/signing/agent-resolver/select-agent.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/select-agent.js +94 -0
- package/dist/lib/signing/agent-resolver/select-agent.js.map +1 -0
- package/dist/lib/signing/agent-resolver/strict-json.d.ts +44 -0
- package/dist/lib/signing/agent-resolver/strict-json.d.ts.map +1 -0
- package/dist/lib/signing/agent-resolver/strict-json.js +219 -0
- package/dist/lib/signing/agent-resolver/strict-json.js.map +1 -0
- package/dist/lib/signing/capability-priming.d.ts.map +1 -1
- package/dist/lib/signing/capability-priming.js +2 -55
- package/dist/lib/signing/capability-priming.js.map +1 -1
- package/dist/lib/signing/protocol-response.d.ts +18 -0
- package/dist/lib/signing/protocol-response.d.ts.map +1 -0
- package/dist/lib/signing/protocol-response.js +69 -0
- package/dist/lib/signing/protocol-response.js.map +1 -0
- package/dist/lib/signing/server.d.ts +1 -0
- package/dist/lib/signing/server.d.ts.map +1 -1
- package/dist/lib/signing/server.js +10 -1
- package/dist/lib/signing/server.js.map +1 -1
- package/dist/lib/signing/testing.d.ts +64 -0
- package/dist/lib/signing/testing.d.ts.map +1 -1
- package/dist/lib/signing/testing.js +100 -5
- package/dist/lib/signing/testing.js.map +1 -1
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +2 -0
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/types.d.ts +8 -0
- package/dist/lib/testing/compliance/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/agent-routing.d.ts +92 -0
- package/dist/lib/testing/storyboard/agent-routing.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/agent-routing.js +291 -0
- package/dist/lib/testing/storyboard/agent-routing.js.map +1 -0
- package/dist/lib/testing/storyboard/context.d.ts +22 -0
- package/dist/lib/testing/storyboard/context.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/context.js +35 -8
- package/dist/lib/testing/storyboard/context.js.map +1 -1
- package/dist/lib/testing/storyboard/default-invariants.js +6 -35
- package/dist/lib/testing/storyboard/default-invariants.js.map +1 -1
- package/dist/lib/testing/storyboard/index.d.ts +1 -1
- package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/index.js.map +1 -1
- package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/loader.js +84 -12
- package/dist/lib/testing/storyboard/loader.js.map +1 -1
- package/dist/lib/testing/storyboard/request-builder.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-builder.js +14 -1
- package/dist/lib/testing/storyboard/request-builder.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts +17 -0
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +867 -144
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/types.d.ts +254 -12
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +65 -0
- package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/validations.js +529 -2
- package/dist/lib/testing/storyboard/validations.js.map +1 -1
- package/dist/lib/testing/test-controller.d.ts +59 -1
- package/dist/lib/testing/test-controller.d.ts.map +1 -1
- package/dist/lib/testing/test-controller.js +30 -0
- package/dist/lib/testing/test-controller.js.map +1 -1
- package/dist/lib/testing/types.d.ts +14 -0
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/types/core.generated.d.ts +299 -141
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +2 -2
- package/dist/lib/types/error-codes.d.ts +168 -108
- package/dist/lib/types/error-codes.d.ts.map +1 -1
- package/dist/lib/types/error-codes.js +23 -190
- package/dist/lib/types/error-codes.js.map +1 -1
- package/dist/lib/types/error-details.aliases.d.ts +48 -0
- package/dist/lib/types/error-details.aliases.d.ts.map +1 -0
- package/dist/lib/types/error-details.aliases.js +41 -0
- package/dist/lib/types/error-details.aliases.js.map +1 -0
- package/dist/lib/types/index.d.ts +14 -1
- package/dist/lib/types/index.d.ts.map +1 -1
- package/dist/lib/types/index.js +4 -0
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/inline-enums.generated.d.ts +2 -4
- package/dist/lib/types/inline-enums.generated.d.ts.map +1 -1
- package/dist/lib/types/inline-enums.generated.js +10 -7
- package/dist/lib/types/inline-enums.generated.js.map +1 -1
- package/dist/lib/types/manifest.generated.d.ts +280 -0
- package/dist/lib/types/manifest.generated.d.ts.map +1 -0
- package/dist/lib/types/manifest.generated.js +339 -0
- package/dist/lib/types/manifest.generated.js.map +1 -0
- package/dist/lib/types/schemas.generated.d.ts +27229 -25160
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +584 -533
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/tools.generated.d.ts +146 -21
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/types/v2-5/tools.generated.d.ts +48 -1
- package/dist/lib/types/v2-5/tools.generated.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/index.d.ts +57 -0
- package/dist/lib/upstream-recorder/index.d.ts.map +1 -0
- package/dist/lib/upstream-recorder/index.js +62 -0
- package/dist/lib/upstream-recorder/index.js.map +1 -0
- package/dist/lib/upstream-recorder/recorder.d.ts +35 -0
- package/dist/lib/upstream-recorder/recorder.d.ts.map +1 -0
- package/dist/lib/upstream-recorder/recorder.js +507 -0
- package/dist/lib/upstream-recorder/recorder.js.map +1 -0
- package/dist/lib/upstream-recorder/types.d.ts +365 -0
- package/dist/lib/upstream-recorder/types.d.ts.map +1 -0
- package/dist/lib/upstream-recorder/types.js +30 -0
- package/dist/lib/upstream-recorder/types.js.map +1 -0
- package/dist/lib/utils/capabilities.d.ts +66 -3
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +111 -3
- package/dist/lib/utils/capabilities.js.map +1 -1
- package/dist/lib/utils/error-extraction.d.ts +24 -0
- package/dist/lib/utils/error-extraction.d.ts.map +1 -1
- package/dist/lib/utils/error-extraction.js +0 -2
- package/dist/lib/utils/error-extraction.js.map +1 -1
- package/dist/lib/utils/format-render-builders.d.ts +2 -1
- package/dist/lib/utils/format-render-builders.d.ts.map +1 -1
- package/dist/lib/utils/format-render-builders.js +0 -23
- package/dist/lib/utils/format-render-builders.js.map +1 -1
- package/dist/lib/utils/glob.d.ts +28 -0
- package/dist/lib/utils/glob.d.ts.map +1 -0
- package/dist/lib/utils/glob.js +37 -0
- package/dist/lib/utils/glob.js.map +1 -0
- package/dist/lib/utils/redact-secrets.d.ts +37 -0
- package/dist/lib/utils/redact-secrets.d.ts.map +1 -0
- package/dist/lib/utils/redact-secrets.js +65 -0
- package/dist/lib/utils/redact-secrets.js.map +1 -0
- package/dist/lib/utils/tool-request-schemas.d.ts.map +1 -1
- package/dist/lib/utils/tool-request-schemas.js +1 -0
- package/dist/lib/utils/tool-request-schemas.js.map +1 -1
- package/dist/lib/validation/hints.d.ts +50 -0
- package/dist/lib/validation/hints.d.ts.map +1 -0
- package/dist/lib/validation/hints.js +194 -0
- package/dist/lib/validation/hints.js.map +1 -0
- package/dist/lib/validation/schema-errors.d.ts +2 -1
- package/dist/lib/validation/schema-errors.d.ts.map +1 -1
- package/dist/lib/validation/schema-errors.js +39 -4
- package/dist/lib/validation/schema-errors.js.map +1 -1
- package/dist/lib/validation/schema-loader.d.ts +13 -0
- package/dist/lib/validation/schema-loader.d.ts.map +1 -1
- package/dist/lib/validation/schema-loader.js +20 -0
- package/dist/lib/validation/schema-loader.js.map +1 -1
- package/dist/lib/validation/schema-validator.d.ts +107 -2
- package/dist/lib/validation/schema-validator.d.ts.map +1 -1
- package/dist/lib/validation/schema-validator.js +205 -12
- package/dist/lib/validation/schema-validator.js.map +1 -1
- package/dist/lib/validation/sync-creatives.d.ts +30 -0
- package/dist/lib/validation/sync-creatives.d.ts.map +1 -1
- package/dist/lib/version.d.ts +7 -7
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +9 -5
- package/dist/lib/version.js.map +1 -1
- package/docs/guides/BUILD-AN-AGENT.md +267 -137
- package/docs/llms.txt +110 -55
- package/examples/CONTRIBUTING.md +173 -0
- package/examples/README.md +32 -0
- package/examples/comply-controller-seller.ts +9 -17
- package/examples/decisioning-platform-broadcast-tv.ts +3 -2
- package/examples/decisioning-platform-implicit-accounts.ts +168 -0
- package/examples/decisioning-platform-mock-seller.ts +3 -2
- package/examples/decisioning-platform-multi-tenant-db.ts +317 -0
- package/examples/decisioning-platform-programmatic.ts +3 -2
- package/examples/hello-cluster.ts +421 -0
- package/examples/hello_creative_adapter_template.ts +528 -0
- package/examples/hello_seller_adapter_guaranteed.ts +1080 -0
- package/examples/hello_seller_adapter_multi_tenant.ts +1046 -0
- package/examples/hello_seller_adapter_social.ts +829 -0
- package/examples/hello_signals_adapter_marketplace.ts +532 -0
- package/examples/seller-test-controller.ts +22 -28
- package/package.json +30 -3
- package/skills/SHAPE-GOTCHAS.md +233 -0
- package/skills/build-brand-rights-agent/SKILL.md +121 -16
- package/skills/build-creative-agent/SKILL.md +25 -1
- package/skills/build-decisioning-platform/advanced/MULTI-TENANT.md +104 -28
- package/skills/build-holdco-agent/SKILL.md +250 -0
- package/skills/build-seller-agent/SKILL.md +313 -49
- package/skills/build-seller-agent/specialisms/sales-broadcast-tv.md +2 -0
- package/skills/build-seller-agent/specialisms/sales-guaranteed.md +18 -0
- package/skills/build-seller-agent/specialisms/sales-non-guaranteed.md +2 -0
- package/skills/build-seller-agent/specialisms/sales-social.md +63 -2
- package/skills/build-signals-agent/SKILL.md +2 -0
- package/skills/call-adcp-agent.previous/SKILL.md +8 -86
- package/skills/run-by-experts/SKILL.md +116 -0
- package/skills/triage-storyboard-failure/SKILL.md +96 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/brand/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/creative/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/governance/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/creative-reception.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/delivery_reporting.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_approved.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_conditions.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/invalid_transitions.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/proposal_finalize.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/refine_products.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/state-machine.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/signals/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/domains/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/brand/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/creative/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/governance/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/creative-reception.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_approved.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_conditions.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/refine_products.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/state-machine.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/signals/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/collection-lists/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/content-standards/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-ad-server/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-generative/generative-seller.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-generative/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-template/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-aware-seller/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-delivery-monitor/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-spend-authority/denied.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-spend-authority/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/property-lists/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-broadcast-tv/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-catalog-driven/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-guaranteed/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-non-guaranteed/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-proposal-mode/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/signal-marketplace/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/signal-owned/index.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/acme-outdoor.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/bistro-oranje.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/nova-motors.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/osei-natural.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/signed-requests-runner.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/substitution-observer-runner.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/summit-foods.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/webhook-receiver-runner.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/001-minimal-plan.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/002-full-plan.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/004a-human-review-omitted.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/007-unicode-objectives.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/README.md +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/canonicalization.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/keys.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/001-no-signature-header.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/002-wrong-tag.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/003-expired-signature.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/004-window-too-long.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/011-malformed-header.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/013-expires-le-created.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/015-signature-invalid.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/017-key-revoked.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/020-rate-abuse.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/001-basic-post.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/003-es256-post.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/README.md +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/keys.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/001-basic-post.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/002-es256-post.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/capability-discovery.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/collection-lists-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/content-standards-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/deterministic-testing.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/error-compliance.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/fictional-entities.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/get-media-buys-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/get-signals-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/idempotency.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/pagination-integrity-creative-formats.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/pagination-integrity-list-accounts.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/property-lists-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/schema-validation.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/security.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/signed-requests.yaml +0 -0
- /package/compliance/cache/{3.0.1 → 3.0.5}/universal/webhook-emission.yaml +0 -0
|
@@ -0,0 +1,1219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bootSalesSocial = bootSalesSocial;
|
|
4
|
+
const node_http_1 = require("node:http");
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const seed_data_1 = require("./seed-data");
|
|
7
|
+
async function bootSalesSocial(options) {
|
|
8
|
+
const advertisers = options.advertisers ?? seed_data_1.ADVERTISERS;
|
|
9
|
+
const oauthClients = options.oauthClients ?? seed_data_1.OAUTH_CLIENTS;
|
|
10
|
+
const accessTtl = options.accessTokenTtlSeconds ?? seed_data_1.ACCESS_TOKEN_TTL_SECONDS;
|
|
11
|
+
const tokensByAccess = new Map();
|
|
12
|
+
const tokensByRefresh = new Map();
|
|
13
|
+
// Per-advertiser resource state.
|
|
14
|
+
const audiences = new Map();
|
|
15
|
+
const catalogs = new Map();
|
|
16
|
+
const creatives = new Map();
|
|
17
|
+
const pixels = new Map();
|
|
18
|
+
// Idempotency tables — keyed `<advertiser_id>::<resource_kind>::<client_request_id>`
|
|
19
|
+
// so cross-advertiser collisions are isolated.
|
|
20
|
+
const idempotency = new Map();
|
|
21
|
+
// Traffic counters keyed by `<METHOD> <route-template>`. The harness queries
|
|
22
|
+
// `GET /_debug/traffic` after a storyboard run and asserts the headline
|
|
23
|
+
// endpoints (custom_audience/upload, event/track, etc.) were called ≥1 time.
|
|
24
|
+
// Façade adapters that never call upstream produce zero counters and fail
|
|
25
|
+
// the assertion — façade detection without depending on storyboard data
|
|
26
|
+
// shape. See adcontextprotocol/adcp-client#1225.
|
|
27
|
+
const traffic = new Map();
|
|
28
|
+
function bump(routeTemplate) {
|
|
29
|
+
traffic.set(routeTemplate, (traffic.get(routeTemplate) ?? 0) + 1);
|
|
30
|
+
}
|
|
31
|
+
function issueTokens(client) {
|
|
32
|
+
const now = Date.now();
|
|
33
|
+
const t = {
|
|
34
|
+
access_token: `tok_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 24)}`,
|
|
35
|
+
refresh_token: `rfr_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 24)}`,
|
|
36
|
+
client_id: client.client_id,
|
|
37
|
+
expires_at_ms: now + accessTtl * 1000,
|
|
38
|
+
refresh_expires_at_ms: now + seed_data_1.REFRESH_TOKEN_TTL_SECONDS * 1000,
|
|
39
|
+
};
|
|
40
|
+
tokensByAccess.set(t.access_token, t);
|
|
41
|
+
tokensByRefresh.set(t.refresh_token, t);
|
|
42
|
+
return t;
|
|
43
|
+
}
|
|
44
|
+
function authenticatedClient(req) {
|
|
45
|
+
const auth = req.headers['authorization'];
|
|
46
|
+
if (!auth || !auth.startsWith('Bearer '))
|
|
47
|
+
return null;
|
|
48
|
+
const accessToken = auth.slice(7);
|
|
49
|
+
const issued = tokensByAccess.get(accessToken);
|
|
50
|
+
if (!issued)
|
|
51
|
+
return null;
|
|
52
|
+
if (issued.expires_at_ms < Date.now())
|
|
53
|
+
return null;
|
|
54
|
+
return oauthClients.find(c => c.client_id === issued.client_id) ?? null;
|
|
55
|
+
}
|
|
56
|
+
const server = (0, node_http_1.createServer)((req, res) => {
|
|
57
|
+
handleRequest(req, res).catch(err => {
|
|
58
|
+
const requestId = req.headers['x-request-id'] ?? (0, node_crypto_1.randomUUID)();
|
|
59
|
+
writeJson(res, 500, {
|
|
60
|
+
code: 'internal_error',
|
|
61
|
+
message: err?.message ?? 'unexpected error',
|
|
62
|
+
request_id: requestId,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
await new Promise((resolve, reject) => {
|
|
67
|
+
server.once('error', reject);
|
|
68
|
+
server.listen(options.port, '127.0.0.1', () => {
|
|
69
|
+
server.removeListener('error', reject);
|
|
70
|
+
resolve();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
const addr = server.address();
|
|
74
|
+
const boundPort = typeof addr === 'object' && addr ? addr.port : options.port;
|
|
75
|
+
const url = `http://127.0.0.1:${boundPort}`;
|
|
76
|
+
return {
|
|
77
|
+
url,
|
|
78
|
+
close: () => new Promise((resolve, reject) => {
|
|
79
|
+
server.close(err => (err ? reject(err) : resolve()));
|
|
80
|
+
}),
|
|
81
|
+
};
|
|
82
|
+
// ────────────────────────────────────────────────────────────
|
|
83
|
+
// Top-level request dispatcher
|
|
84
|
+
// ────────────────────────────────────────────────────────────
|
|
85
|
+
async function handleRequest(req, res) {
|
|
86
|
+
const url = new URL(req.url ?? '/', `http://127.0.0.1`);
|
|
87
|
+
const path = url.pathname;
|
|
88
|
+
const method = req.method ?? 'GET';
|
|
89
|
+
// Façade-detection traffic dump — harness-only, no auth required.
|
|
90
|
+
// Returns per-endpoint hit counts for assertion in the matrix runner.
|
|
91
|
+
if (method === 'GET' && path === '/_debug/traffic') {
|
|
92
|
+
writeJson(res, 200, { traffic: Object.fromEntries(traffic) });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// OAuth token endpoint — no Bearer required.
|
|
96
|
+
if (method === 'POST' && path === '/oauth/token') {
|
|
97
|
+
bump('POST /oauth/token');
|
|
98
|
+
return handleOauthToken(req, res);
|
|
99
|
+
}
|
|
100
|
+
// Discovery endpoint — replaces the hardcoded principal-mapping table
|
|
101
|
+
// the harness used to inline into Claude's prompt. Adapters look up the
|
|
102
|
+
// upstream advertiser_id at runtime by querying with the AdCP-side
|
|
103
|
+
// identifier they receive from buyers (`account.advertiser`,
|
|
104
|
+
// `account.brand.domain`, etc.). No auth required — discovery is the
|
|
105
|
+
// entry point before the agent has any account context. Issue #1225.
|
|
106
|
+
if (method === 'GET' && path === '/_lookup/advertiser') {
|
|
107
|
+
bump('GET /_lookup/advertiser');
|
|
108
|
+
const adcpAdvertiser = url.searchParams.get('adcp_advertiser');
|
|
109
|
+
if (!adcpAdvertiser) {
|
|
110
|
+
writeJson(res, 400, {
|
|
111
|
+
code: 'invalid_request',
|
|
112
|
+
message: 'adcp_advertiser query parameter is required.',
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const match = advertisers.find(a => a.adcp_advertiser === adcpAdvertiser);
|
|
117
|
+
if (!match) {
|
|
118
|
+
writeJson(res, 404, {
|
|
119
|
+
code: 'advertiser_not_found',
|
|
120
|
+
message: `No upstream advertiser registered for adcp_advertiser=${adcpAdvertiser}.`,
|
|
121
|
+
});
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
writeJson(res, 200, {
|
|
125
|
+
adcp_advertiser: match.adcp_advertiser,
|
|
126
|
+
advertiser_id: match.advertiser_id,
|
|
127
|
+
display_name: match.display_name,
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// Everything else requires a valid access token.
|
|
132
|
+
const client = authenticatedClient(req);
|
|
133
|
+
if (!client) {
|
|
134
|
+
writeJson(res, 401, {
|
|
135
|
+
code: 'unauthorized',
|
|
136
|
+
message: 'Missing, invalid, or expired bearer token. Acquire one via POST /oauth/token.',
|
|
137
|
+
});
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
// Path-based advertiser scoping.
|
|
141
|
+
const advMatch = path.match(/^\/v1\.3\/advertiser\/([^/]+)(\/.*)?$/);
|
|
142
|
+
if (!advMatch || !advMatch[1]) {
|
|
143
|
+
writeJson(res, 404, { code: 'not_found', message: `No route for ${method} ${path}` });
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const advertiserId = decodeURIComponent(advMatch[1]);
|
|
147
|
+
const subPath = advMatch[2] ?? '/';
|
|
148
|
+
const advertiser = advertisers.find(a => a.advertiser_id === advertiserId);
|
|
149
|
+
if (!advertiser) {
|
|
150
|
+
writeJson(res, 404, {
|
|
151
|
+
code: 'advertiser_not_found',
|
|
152
|
+
message: `Advertiser ${advertiserId} not found.`,
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (!client.authorized_advertiser_ids.includes(advertiserId)) {
|
|
157
|
+
writeJson(res, 404, {
|
|
158
|
+
code: 'advertiser_not_authorized',
|
|
159
|
+
message: `Advertiser ${advertiserId} not visible to this OAuth client.`,
|
|
160
|
+
});
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// Sub-path routing — bump traffic counters on each route hit so
|
|
164
|
+
// /_debug/traffic can later report which endpoints the adapter actually
|
|
165
|
+
// exercised. Façade adapters return shape-valid AdCP responses without
|
|
166
|
+
// calling these endpoints; the harness's post-run check catches that.
|
|
167
|
+
if (method === 'GET' && subPath === '/info') {
|
|
168
|
+
bump('GET /v1.3/advertiser/{id}/info');
|
|
169
|
+
return handleGetAdvertiser(advertiser, res);
|
|
170
|
+
}
|
|
171
|
+
// Audiences
|
|
172
|
+
if (method === 'GET' && subPath === '/custom_audience/list') {
|
|
173
|
+
bump('GET /v1.3/advertiser/{id}/custom_audience/list');
|
|
174
|
+
return handleListAudiences(advertiser, res);
|
|
175
|
+
}
|
|
176
|
+
if (method === 'POST' && subPath === '/custom_audience/create') {
|
|
177
|
+
bump('POST /v1.3/advertiser/{id}/custom_audience/create');
|
|
178
|
+
return handleCreateAudience(req, advertiser, res);
|
|
179
|
+
}
|
|
180
|
+
if (method === 'POST' && subPath === '/custom_audience/upload') {
|
|
181
|
+
bump('POST /v1.3/advertiser/{id}/custom_audience/upload');
|
|
182
|
+
return handleUploadAudience(req, advertiser, res);
|
|
183
|
+
}
|
|
184
|
+
// Catalogs
|
|
185
|
+
if (method === 'GET' && subPath === '/catalog/list') {
|
|
186
|
+
bump('GET /v1.3/advertiser/{id}/catalog/list');
|
|
187
|
+
return handleListCatalogs(advertiser, res);
|
|
188
|
+
}
|
|
189
|
+
if (method === 'POST' && subPath === '/catalog/create') {
|
|
190
|
+
bump('POST /v1.3/advertiser/{id}/catalog/create');
|
|
191
|
+
return handleCreateCatalog(req, advertiser, res);
|
|
192
|
+
}
|
|
193
|
+
if (method === 'POST' && subPath === '/catalog/upload') {
|
|
194
|
+
bump('POST /v1.3/advertiser/{id}/catalog/upload');
|
|
195
|
+
return handleUploadCatalog(req, advertiser, res);
|
|
196
|
+
}
|
|
197
|
+
// Creatives
|
|
198
|
+
if (method === 'GET' && subPath === '/creative/list') {
|
|
199
|
+
bump('GET /v1.3/advertiser/{id}/creative/list');
|
|
200
|
+
return handleListCreatives(advertiser, res);
|
|
201
|
+
}
|
|
202
|
+
if (method === 'POST' && subPath === '/creative/create') {
|
|
203
|
+
bump('POST /v1.3/advertiser/{id}/creative/create');
|
|
204
|
+
return handleCreateCreative(req, advertiser, res);
|
|
205
|
+
}
|
|
206
|
+
// Pixels (event sources)
|
|
207
|
+
if (method === 'GET' && subPath === '/pixel/list') {
|
|
208
|
+
bump('GET /v1.3/advertiser/{id}/pixel/list');
|
|
209
|
+
return handleListPixels(advertiser, res);
|
|
210
|
+
}
|
|
211
|
+
if (method === 'POST' && subPath === '/pixel/create') {
|
|
212
|
+
bump('POST /v1.3/advertiser/{id}/pixel/create');
|
|
213
|
+
return handleCreatePixel(req, advertiser, res);
|
|
214
|
+
}
|
|
215
|
+
// Conversion API
|
|
216
|
+
if (method === 'POST' && subPath === '/event/track') {
|
|
217
|
+
bump('POST /v1.3/advertiser/{id}/event/track');
|
|
218
|
+
return handleTrackEvents(req, advertiser, res);
|
|
219
|
+
}
|
|
220
|
+
// Planning surface — Meta/TikTok-style delivery + reach forecasts.
|
|
221
|
+
// adcontextprotocol/adcp-client#1378.
|
|
222
|
+
if (method === 'POST' && subPath === '/delivery_estimate') {
|
|
223
|
+
bump('POST /v1.3/advertiser/{id}/delivery_estimate');
|
|
224
|
+
return handleDeliveryEstimate(req, advertiser, res);
|
|
225
|
+
}
|
|
226
|
+
if (method === 'POST' && subPath === '/audience_reach_estimate') {
|
|
227
|
+
bump('POST /v1.3/advertiser/{id}/audience_reach_estimate');
|
|
228
|
+
return handleAudienceReachEstimate(req, advertiser, res);
|
|
229
|
+
}
|
|
230
|
+
const lookalikeMatch = subPath.match(/^\/audience\/([^/]+)\/lookalike$/);
|
|
231
|
+
if (method === 'POST' && lookalikeMatch && lookalikeMatch[1]) {
|
|
232
|
+
bump('POST /v1.3/advertiser/{id}/audience/{audience_id}/lookalike');
|
|
233
|
+
return handleLookalikeEstimate(req, advertiser, decodeURIComponent(lookalikeMatch[1]), res);
|
|
234
|
+
}
|
|
235
|
+
writeJson(res, 404, { code: 'not_found', message: `No route for ${method} ${path}` });
|
|
236
|
+
}
|
|
237
|
+
// ────────────────────────────────────────────────────────────
|
|
238
|
+
// OAuth handler
|
|
239
|
+
// ────────────────────────────────────────────────────────────
|
|
240
|
+
async function handleOauthToken(req, res) {
|
|
241
|
+
let body;
|
|
242
|
+
try {
|
|
243
|
+
body = await readForm(req);
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'Body must be application/x-www-form-urlencoded.' });
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const grantType = body.grant_type;
|
|
250
|
+
if (grantType === 'client_credentials') {
|
|
251
|
+
const client = oauthClients.find(c => c.client_id === body.client_id);
|
|
252
|
+
if (!client || client.client_secret !== body.client_secret) {
|
|
253
|
+
writeJson(res, 400, { code: 'invalid_client', message: 'Unknown client_id or wrong client_secret.' });
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const t = issueTokens(client);
|
|
257
|
+
writeJson(res, 200, {
|
|
258
|
+
access_token: t.access_token,
|
|
259
|
+
refresh_token: t.refresh_token,
|
|
260
|
+
token_type: 'bearer',
|
|
261
|
+
expires_in: Math.max(0, Math.floor((t.expires_at_ms - Date.now()) / 1000)),
|
|
262
|
+
});
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (grantType === 'refresh_token') {
|
|
266
|
+
const refreshToken = body.refresh_token;
|
|
267
|
+
const issued = refreshToken ? tokensByRefresh.get(refreshToken) : undefined;
|
|
268
|
+
if (!issued || issued.refresh_expires_at_ms < Date.now()) {
|
|
269
|
+
writeJson(res, 400, { code: 'invalid_grant', message: 'Unknown or expired refresh_token.' });
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const client = oauthClients.find(c => c.client_id === issued.client_id);
|
|
273
|
+
if (!client) {
|
|
274
|
+
writeJson(res, 400, { code: 'invalid_grant', message: 'Refresh token references a vanished client.' });
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
// Rotate: invalidate old refresh, issue new pair.
|
|
278
|
+
tokensByRefresh.delete(refreshToken);
|
|
279
|
+
tokensByAccess.delete(issued.access_token);
|
|
280
|
+
const t = issueTokens(client);
|
|
281
|
+
writeJson(res, 200, {
|
|
282
|
+
access_token: t.access_token,
|
|
283
|
+
refresh_token: t.refresh_token,
|
|
284
|
+
token_type: 'bearer',
|
|
285
|
+
expires_in: Math.max(0, Math.floor((t.expires_at_ms - Date.now()) / 1000)),
|
|
286
|
+
});
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
writeJson(res, 400, {
|
|
290
|
+
code: 'unsupported_grant_type',
|
|
291
|
+
message: `grant_type must be one of: client_credentials, refresh_token. Got: ${grantType}`,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
// ────────────────────────────────────────────────────────────
|
|
295
|
+
// Advertiser handler
|
|
296
|
+
// ────────────────────────────────────────────────────────────
|
|
297
|
+
function handleGetAdvertiser(advertiser, res) {
|
|
298
|
+
writeJson(res, 200, advertiser);
|
|
299
|
+
}
|
|
300
|
+
// ────────────────────────────────────────────────────────────
|
|
301
|
+
// Audience handlers
|
|
302
|
+
// ────────────────────────────────────────────────────────────
|
|
303
|
+
function handleListAudiences(advertiser, res) {
|
|
304
|
+
const list = Array.from(audiences.values()).filter(a => a.advertiser_id === advertiser.advertiser_id);
|
|
305
|
+
writeJson(res, 200, { audiences: list.map(stripBodyFingerprint) });
|
|
306
|
+
}
|
|
307
|
+
async function handleCreateAudience(req, advertiser, res) {
|
|
308
|
+
const body = await readJsonObject(req, res);
|
|
309
|
+
if (!body)
|
|
310
|
+
return;
|
|
311
|
+
const { name, description, source_type, client_request_id } = body;
|
|
312
|
+
if (typeof name !== 'string' || typeof source_type !== 'string') {
|
|
313
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'name and source_type are required strings.' });
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const validSources = ['customer_file', 'website_traffic', 'app_activity', 'lookalike', 'engagement'];
|
|
317
|
+
if (!validSources.includes(source_type)) {
|
|
318
|
+
writeJson(res, 400, {
|
|
319
|
+
code: 'invalid_source_type',
|
|
320
|
+
message: `source_type must be one of ${validSources.join(', ')}.`,
|
|
321
|
+
});
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const fingerprint = JSON.stringify({ name, description, source_type });
|
|
325
|
+
const replay = checkIdempotentReplay(advertiser.advertiser_id, 'audience', client_request_id, fingerprint);
|
|
326
|
+
if (replay.kind === 'conflict') {
|
|
327
|
+
writeJson(res, 409, { code: 'idempotency_conflict', message: replay.message });
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (replay.kind === 'replay') {
|
|
331
|
+
const existing = audiences.get(replay.id);
|
|
332
|
+
if (existing) {
|
|
333
|
+
writeJson(res, 200, stripBodyFingerprint(existing));
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
const id = `ca_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
338
|
+
const now = new Date().toISOString();
|
|
339
|
+
const audience = {
|
|
340
|
+
audience_id: id,
|
|
341
|
+
advertiser_id: advertiser.advertiser_id,
|
|
342
|
+
name,
|
|
343
|
+
description: typeof description === 'string' ? description : undefined,
|
|
344
|
+
source_type,
|
|
345
|
+
member_count: 0,
|
|
346
|
+
status: 'building',
|
|
347
|
+
created_at: now,
|
|
348
|
+
updated_at: now,
|
|
349
|
+
body_fingerprint: fingerprint,
|
|
350
|
+
};
|
|
351
|
+
audiences.set(id, audience);
|
|
352
|
+
if (typeof client_request_id === 'string' && client_request_id.length > 0) {
|
|
353
|
+
idempotency.set(`${advertiser.advertiser_id}::audience::${client_request_id}`, id);
|
|
354
|
+
}
|
|
355
|
+
writeJson(res, 201, stripBodyFingerprint(audience));
|
|
356
|
+
}
|
|
357
|
+
async function handleUploadAudience(req, advertiser, res) {
|
|
358
|
+
const body = await readJsonObject(req, res);
|
|
359
|
+
if (!body)
|
|
360
|
+
return;
|
|
361
|
+
const { audience_id, identifier_type, members } = body;
|
|
362
|
+
if (typeof audience_id !== 'string') {
|
|
363
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'audience_id is required.' });
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
const aud = audiences.get(audience_id);
|
|
367
|
+
if (!aud || aud.advertiser_id !== advertiser.advertiser_id) {
|
|
368
|
+
writeJson(res, 404, { code: 'audience_not_found', message: `Audience ${audience_id} not found.` });
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
const validIds = [
|
|
372
|
+
'hashed_email_sha256',
|
|
373
|
+
'hashed_phone_sha256',
|
|
374
|
+
'hashed_email_or_phone_sha256',
|
|
375
|
+
'mobile_advertising_id',
|
|
376
|
+
];
|
|
377
|
+
if (typeof identifier_type !== 'string' || !validIds.includes(identifier_type)) {
|
|
378
|
+
writeJson(res, 400, {
|
|
379
|
+
code: 'invalid_identifier_type',
|
|
380
|
+
message: `identifier_type must be one of ${validIds.join(', ')}.`,
|
|
381
|
+
});
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (!Array.isArray(members) || members.length === 0) {
|
|
385
|
+
writeJson(res, 400, { code: 'empty_members', message: 'members must be a non-empty array.' });
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (identifier_type.startsWith('hashed_')) {
|
|
389
|
+
const hashRe = /^[0-9a-f]{64}$/;
|
|
390
|
+
const malformed = members.filter(m => typeof m !== 'string' || !hashRe.test(m));
|
|
391
|
+
if (malformed.length > 0) {
|
|
392
|
+
// Real walled gardens reject silently per-row in batch but for the
|
|
393
|
+
// test fixture we hard-fail on any malformed — adapter bugs that
|
|
394
|
+
// pass raw PII or wrong-cased hex get surfaced loudly.
|
|
395
|
+
writeJson(res, 400, {
|
|
396
|
+
code: 'invalid_hash_format',
|
|
397
|
+
message: `${malformed.length} member(s) are not 64-char lowercase hex. Walled gardens require ` +
|
|
398
|
+
`client-side SHA-256 hashing of the lowercased trimmed identifier; uploading raw PII is rejected.`,
|
|
399
|
+
});
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
aud.member_count += members.length;
|
|
404
|
+
aud.status = 'active';
|
|
405
|
+
aud.updated_at = new Date().toISOString();
|
|
406
|
+
writeJson(res, 202, {
|
|
407
|
+
audience_id,
|
|
408
|
+
status: aud.status,
|
|
409
|
+
batch_size: members.length,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
// ────────────────────────────────────────────────────────────
|
|
413
|
+
// Catalog handlers
|
|
414
|
+
// ────────────────────────────────────────────────────────────
|
|
415
|
+
function handleListCatalogs(advertiser, res) {
|
|
416
|
+
const list = Array.from(catalogs.values()).filter(c => c.advertiser_id === advertiser.advertiser_id);
|
|
417
|
+
writeJson(res, 200, { catalogs: list.map(stripBodyFingerprint) });
|
|
418
|
+
}
|
|
419
|
+
async function handleCreateCatalog(req, advertiser, res) {
|
|
420
|
+
const body = await readJsonObject(req, res);
|
|
421
|
+
if (!body)
|
|
422
|
+
return;
|
|
423
|
+
const { name, vertical, client_request_id } = body;
|
|
424
|
+
if (typeof name !== 'string' || typeof vertical !== 'string') {
|
|
425
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'name and vertical are required.' });
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
const fingerprint = JSON.stringify({ name, vertical });
|
|
429
|
+
const replay = checkIdempotentReplay(advertiser.advertiser_id, 'catalog', client_request_id, fingerprint);
|
|
430
|
+
if (replay.kind === 'conflict') {
|
|
431
|
+
writeJson(res, 409, { code: 'idempotency_conflict', message: replay.message });
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
if (replay.kind === 'replay') {
|
|
435
|
+
const existing = catalogs.get(replay.id);
|
|
436
|
+
if (existing) {
|
|
437
|
+
writeJson(res, 200, stripBodyFingerprint(existing));
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
const id = `cat_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
442
|
+
const cat = {
|
|
443
|
+
catalog_id: id,
|
|
444
|
+
advertiser_id: advertiser.advertiser_id,
|
|
445
|
+
name,
|
|
446
|
+
vertical,
|
|
447
|
+
status: 'active',
|
|
448
|
+
item_count: 0,
|
|
449
|
+
body_fingerprint: fingerprint,
|
|
450
|
+
};
|
|
451
|
+
catalogs.set(id, cat);
|
|
452
|
+
if (typeof client_request_id === 'string' && client_request_id.length > 0) {
|
|
453
|
+
idempotency.set(`${advertiser.advertiser_id}::catalog::${client_request_id}`, id);
|
|
454
|
+
}
|
|
455
|
+
writeJson(res, 201, stripBodyFingerprint(cat));
|
|
456
|
+
}
|
|
457
|
+
async function handleUploadCatalog(req, advertiser, res) {
|
|
458
|
+
const body = await readJsonObject(req, res);
|
|
459
|
+
if (!body)
|
|
460
|
+
return;
|
|
461
|
+
const { catalog_id, items } = body;
|
|
462
|
+
if (typeof catalog_id !== 'string') {
|
|
463
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'catalog_id is required.' });
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
const cat = catalogs.get(catalog_id);
|
|
467
|
+
if (!cat || cat.advertiser_id !== advertiser.advertiser_id) {
|
|
468
|
+
writeJson(res, 404, { code: 'catalog_not_found', message: `Catalog ${catalog_id} not found.` });
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
472
|
+
writeJson(res, 400, { code: 'empty_items', message: 'items must be a non-empty array.' });
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
cat.item_count += items.length;
|
|
476
|
+
writeJson(res, 202, { catalog_id, batch_size: items.length });
|
|
477
|
+
}
|
|
478
|
+
// ────────────────────────────────────────────────────────────
|
|
479
|
+
// Creative handlers
|
|
480
|
+
// ────────────────────────────────────────────────────────────
|
|
481
|
+
function handleListCreatives(advertiser, res) {
|
|
482
|
+
const list = Array.from(creatives.values()).filter(c => c.advertiser_id === advertiser.advertiser_id);
|
|
483
|
+
writeJson(res, 200, { creatives: list.map(stripBodyFingerprint) });
|
|
484
|
+
}
|
|
485
|
+
async function handleCreateCreative(req, advertiser, res) {
|
|
486
|
+
const body = await readJsonObject(req, res);
|
|
487
|
+
if (!body)
|
|
488
|
+
return;
|
|
489
|
+
const { name, format_id, primary_text, cta_label, landing_page_url, media_url, client_request_id } = body;
|
|
490
|
+
if (typeof name !== 'string' ||
|
|
491
|
+
typeof format_id !== 'string' ||
|
|
492
|
+
typeof primary_text !== 'string' ||
|
|
493
|
+
typeof landing_page_url !== 'string' ||
|
|
494
|
+
typeof media_url !== 'string') {
|
|
495
|
+
writeJson(res, 400, {
|
|
496
|
+
code: 'invalid_request',
|
|
497
|
+
message: 'name, format_id, primary_text, landing_page_url, media_url are all required strings.',
|
|
498
|
+
});
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
const validFormats = ['native_feed', 'story_video', 'vertical_video', 'carousel_image'];
|
|
502
|
+
if (!validFormats.includes(format_id)) {
|
|
503
|
+
writeJson(res, 400, { code: 'invalid_format', message: `format_id must be one of ${validFormats.join(', ')}.` });
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
const fingerprint = JSON.stringify({ name, format_id, primary_text, cta_label, landing_page_url, media_url });
|
|
507
|
+
const replay = checkIdempotentReplay(advertiser.advertiser_id, 'creative', client_request_id, fingerprint);
|
|
508
|
+
if (replay.kind === 'conflict') {
|
|
509
|
+
writeJson(res, 409, { code: 'idempotency_conflict', message: replay.message });
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (replay.kind === 'replay') {
|
|
513
|
+
const existing = creatives.get(replay.id);
|
|
514
|
+
if (existing) {
|
|
515
|
+
writeJson(res, 200, stripBodyFingerprint(existing));
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
const id = `cr_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
520
|
+
const cr = {
|
|
521
|
+
creative_id: id,
|
|
522
|
+
advertiser_id: advertiser.advertiser_id,
|
|
523
|
+
name,
|
|
524
|
+
format_id,
|
|
525
|
+
primary_text,
|
|
526
|
+
cta_label: typeof cta_label === 'string' ? cta_label : undefined,
|
|
527
|
+
landing_page_url,
|
|
528
|
+
media_url,
|
|
529
|
+
status: 'pending_review',
|
|
530
|
+
created_at: new Date().toISOString(),
|
|
531
|
+
body_fingerprint: fingerprint,
|
|
532
|
+
};
|
|
533
|
+
creatives.set(id, cr);
|
|
534
|
+
if (typeof client_request_id === 'string' && client_request_id.length > 0) {
|
|
535
|
+
idempotency.set(`${advertiser.advertiser_id}::creative::${client_request_id}`, id);
|
|
536
|
+
}
|
|
537
|
+
writeJson(res, 201, stripBodyFingerprint(cr));
|
|
538
|
+
}
|
|
539
|
+
// ────────────────────────────────────────────────────────────
|
|
540
|
+
// Pixel handlers
|
|
541
|
+
// ────────────────────────────────────────────────────────────
|
|
542
|
+
function handleListPixels(advertiser, res) {
|
|
543
|
+
const list = Array.from(pixels.values()).filter(p => p.advertiser_id === advertiser.advertiser_id);
|
|
544
|
+
writeJson(res, 200, { pixels: list.map(stripBodyFingerprint) });
|
|
545
|
+
}
|
|
546
|
+
async function handleCreatePixel(req, advertiser, res) {
|
|
547
|
+
const body = await readJsonObject(req, res);
|
|
548
|
+
if (!body)
|
|
549
|
+
return;
|
|
550
|
+
const { name, domain, client_request_id } = body;
|
|
551
|
+
if (typeof name !== 'string') {
|
|
552
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'name is required.' });
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
const fingerprint = JSON.stringify({ name, domain });
|
|
556
|
+
const replay = checkIdempotentReplay(advertiser.advertiser_id, 'pixel', client_request_id, fingerprint);
|
|
557
|
+
if (replay.kind === 'conflict') {
|
|
558
|
+
writeJson(res, 409, { code: 'idempotency_conflict', message: replay.message });
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
if (replay.kind === 'replay') {
|
|
562
|
+
const existing = pixels.get(replay.id);
|
|
563
|
+
if (existing) {
|
|
564
|
+
writeJson(res, 200, stripBodyFingerprint(existing));
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
const id = `px_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
569
|
+
const px = {
|
|
570
|
+
pixel_id: id,
|
|
571
|
+
advertiser_id: advertiser.advertiser_id,
|
|
572
|
+
name,
|
|
573
|
+
domain: typeof domain === 'string' ? domain : undefined,
|
|
574
|
+
status: 'active',
|
|
575
|
+
events_received_24h: 0,
|
|
576
|
+
created_at: new Date().toISOString(),
|
|
577
|
+
body_fingerprint: fingerprint,
|
|
578
|
+
};
|
|
579
|
+
pixels.set(id, px);
|
|
580
|
+
if (typeof client_request_id === 'string' && client_request_id.length > 0) {
|
|
581
|
+
idempotency.set(`${advertiser.advertiser_id}::pixel::${client_request_id}`, id);
|
|
582
|
+
}
|
|
583
|
+
writeJson(res, 201, stripBodyFingerprint(px));
|
|
584
|
+
}
|
|
585
|
+
// ────────────────────────────────────────────────────────────
|
|
586
|
+
// Conversion API (events) handler
|
|
587
|
+
// ────────────────────────────────────────────────────────────
|
|
588
|
+
async function handleTrackEvents(req, advertiser, res) {
|
|
589
|
+
const body = await readJsonObject(req, res);
|
|
590
|
+
if (!body)
|
|
591
|
+
return;
|
|
592
|
+
const { pixel_id, events } = body;
|
|
593
|
+
if (typeof pixel_id !== 'string') {
|
|
594
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'pixel_id is required.' });
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
const px = pixels.get(pixel_id);
|
|
598
|
+
if (!px || px.advertiser_id !== advertiser.advertiser_id) {
|
|
599
|
+
writeJson(res, 404, { code: 'pixel_not_found', message: `Pixel ${pixel_id} not found.` });
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
if (!Array.isArray(events) || events.length === 0) {
|
|
603
|
+
writeJson(res, 400, { code: 'empty_events', message: 'events must be a non-empty array.' });
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
let received = 0;
|
|
607
|
+
let dropped = 0;
|
|
608
|
+
const hashRe = /^[0-9a-f]{64}$/;
|
|
609
|
+
for (const ev of events) {
|
|
610
|
+
if (!ev || typeof ev !== 'object') {
|
|
611
|
+
dropped++;
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
const event = ev;
|
|
615
|
+
if (typeof event.event_name !== 'string' || typeof event.event_time !== 'number') {
|
|
616
|
+
dropped++;
|
|
617
|
+
continue;
|
|
618
|
+
}
|
|
619
|
+
const userData = event.user_data;
|
|
620
|
+
const hasMatchableId = !!(userData &&
|
|
621
|
+
((typeof userData.email_sha256 === 'string' && hashRe.test(userData.email_sha256)) ||
|
|
622
|
+
(typeof userData.phone_sha256 === 'string' && hashRe.test(userData.phone_sha256)) ||
|
|
623
|
+
(typeof userData.external_id_sha256 === 'string' && hashRe.test(userData.external_id_sha256))));
|
|
624
|
+
if (!hasMatchableId) {
|
|
625
|
+
// Walled gardens reject events without a matchable identifier.
|
|
626
|
+
dropped++;
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
received++;
|
|
630
|
+
}
|
|
631
|
+
if (received === 0) {
|
|
632
|
+
writeJson(res, 400, {
|
|
633
|
+
code: 'no_matchable_events',
|
|
634
|
+
message: `All ${events.length} events were dropped — none carried a hashed identifier ` +
|
|
635
|
+
`(email_sha256, phone_sha256, or external_id_sha256). Walled-garden CAPI requires ` +
|
|
636
|
+
`at least one matchable identifier per event.`,
|
|
637
|
+
});
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
px.events_received_24h += received;
|
|
641
|
+
writeJson(res, 200, { pixel_id, events_received: received, events_dropped: dropped });
|
|
642
|
+
}
|
|
643
|
+
// ────────────────────────────────────────────────────────────
|
|
644
|
+
// Planning surface (Meta/TikTok-style forecast endpoints)
|
|
645
|
+
// adcontextprotocol/adcp-client#1378
|
|
646
|
+
// ────────────────────────────────────────────────────────────
|
|
647
|
+
async function handleDeliveryEstimate(req, advertiser, res) {
|
|
648
|
+
const body = await readJsonObject(req, res);
|
|
649
|
+
if (!body)
|
|
650
|
+
return;
|
|
651
|
+
const { targeting, optimization_goal, budget, target_outcome, flight_dates } = body;
|
|
652
|
+
if (typeof optimization_goal !== 'string') {
|
|
653
|
+
writeJson(res, 400, {
|
|
654
|
+
code: 'invalid_request',
|
|
655
|
+
message: 'optimization_goal is required (e.g. "reach", "conversions", "clicks", "video_views").',
|
|
656
|
+
});
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
if (budget === undefined && target_outcome === undefined) {
|
|
660
|
+
writeJson(res, 400, {
|
|
661
|
+
code: 'invalid_request',
|
|
662
|
+
message: 'Provide either budget (forward forecast) or target_outcome (reverse / goal-based forecast).',
|
|
663
|
+
});
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
if (budget !== undefined && (typeof budget !== 'number' || !Number.isFinite(budget) || budget <= 0)) {
|
|
667
|
+
writeJson(res, 400, {
|
|
668
|
+
code: 'invalid_request',
|
|
669
|
+
message: 'budget must be a positive number.',
|
|
670
|
+
});
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
if (target_outcome !== undefined &&
|
|
674
|
+
(typeof target_outcome !== 'number' || !Number.isFinite(target_outcome) || target_outcome <= 0)) {
|
|
675
|
+
writeJson(res, 400, {
|
|
676
|
+
code: 'invalid_request',
|
|
677
|
+
message: 'target_outcome must be a positive number.',
|
|
678
|
+
});
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
const targetingKey = serializeTargeting(targeting);
|
|
682
|
+
const dates = isObject(flight_dates) ? flight_dates : {};
|
|
683
|
+
const estimate = synthDeliveryEstimate({
|
|
684
|
+
advertiserId: advertiser.advertiser_id,
|
|
685
|
+
currency: advertiser.currency,
|
|
686
|
+
targeting: targetingKey,
|
|
687
|
+
optimizationGoal: optimization_goal,
|
|
688
|
+
budget: typeof budget === 'number' ? budget : undefined,
|
|
689
|
+
targetOutcome: typeof target_outcome === 'number' ? target_outcome : undefined,
|
|
690
|
+
flightStart: typeof dates.start === 'string' ? dates.start : undefined,
|
|
691
|
+
flightEnd: typeof dates.end === 'string' ? dates.end : undefined,
|
|
692
|
+
});
|
|
693
|
+
writeJson(res, 200, estimate);
|
|
694
|
+
}
|
|
695
|
+
async function handleAudienceReachEstimate(req, advertiser, res) {
|
|
696
|
+
const body = await readJsonObject(req, res);
|
|
697
|
+
if (!body)
|
|
698
|
+
return;
|
|
699
|
+
const { targeting } = body;
|
|
700
|
+
if (!isObject(targeting)) {
|
|
701
|
+
writeJson(res, 400, {
|
|
702
|
+
code: 'invalid_request',
|
|
703
|
+
message: 'targeting (object) is required — geo, age, interests, custom audiences, etc.',
|
|
704
|
+
});
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
const targetingKey = serializeTargeting(targeting);
|
|
708
|
+
const estimate = synthAudienceReach({
|
|
709
|
+
advertiserId: advertiser.advertiser_id,
|
|
710
|
+
targeting: targetingKey,
|
|
711
|
+
});
|
|
712
|
+
writeJson(res, 200, estimate);
|
|
713
|
+
}
|
|
714
|
+
async function handleLookalikeEstimate(req, advertiser, audienceId, res) {
|
|
715
|
+
const body = await readJsonObject(req, res);
|
|
716
|
+
if (!body)
|
|
717
|
+
return;
|
|
718
|
+
const seed = audiences.get(audienceId);
|
|
719
|
+
if (!seed || seed.advertiser_id !== advertiser.advertiser_id) {
|
|
720
|
+
writeJson(res, 404, {
|
|
721
|
+
code: 'audience_not_found',
|
|
722
|
+
message: `Seed audience ${audienceId} not found for advertiser ${advertiser.advertiser_id}.`,
|
|
723
|
+
});
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
const { similarity_pct, country } = body;
|
|
727
|
+
if (typeof similarity_pct !== 'number' || similarity_pct < 1 || similarity_pct > 10) {
|
|
728
|
+
writeJson(res, 400, {
|
|
729
|
+
code: 'invalid_request',
|
|
730
|
+
message: 'similarity_pct must be a number between 1 (closest) and 10 (broadest).',
|
|
731
|
+
});
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
if (typeof country !== 'string' || country.length === 0) {
|
|
735
|
+
writeJson(res, 400, {
|
|
736
|
+
code: 'invalid_request',
|
|
737
|
+
message: 'country (ISO 3166-1 alpha-2) is required — lookalikes are country-scoped.',
|
|
738
|
+
});
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
const estimate = synthLookalikeEstimate({
|
|
742
|
+
advertiserId: advertiser.advertiser_id,
|
|
743
|
+
seedAudienceId: audienceId,
|
|
744
|
+
seedSize: seed.member_count,
|
|
745
|
+
similarityPct: similarity_pct,
|
|
746
|
+
country,
|
|
747
|
+
});
|
|
748
|
+
writeJson(res, 200, estimate);
|
|
749
|
+
}
|
|
750
|
+
// ────────────────────────────────────────────────────────────
|
|
751
|
+
// Helpers
|
|
752
|
+
// ────────────────────────────────────────────────────────────
|
|
753
|
+
function checkIdempotentReplay(advertiserId, resourceKind, clientRequestId, fingerprint) {
|
|
754
|
+
if (typeof clientRequestId !== 'string' || clientRequestId.length === 0)
|
|
755
|
+
return { kind: 'fresh' };
|
|
756
|
+
const key = `${advertiserId}::${resourceKind}::${clientRequestId}`;
|
|
757
|
+
const existingId = idempotency.get(key);
|
|
758
|
+
if (!existingId)
|
|
759
|
+
return { kind: 'fresh' };
|
|
760
|
+
const stored = lookupResource(resourceKind, existingId);
|
|
761
|
+
if (!stored)
|
|
762
|
+
return { kind: 'fresh' };
|
|
763
|
+
if (stored.body_fingerprint !== fingerprint) {
|
|
764
|
+
return {
|
|
765
|
+
kind: 'conflict',
|
|
766
|
+
message: `client_request_id ${clientRequestId} was previously used with a different body. Use a fresh idempotency key for distinct requests.`,
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
return { kind: 'replay', id: existingId };
|
|
770
|
+
}
|
|
771
|
+
function lookupResource(kind, id) {
|
|
772
|
+
switch (kind) {
|
|
773
|
+
case 'audience':
|
|
774
|
+
return audiences.get(id);
|
|
775
|
+
case 'catalog':
|
|
776
|
+
return catalogs.get(id);
|
|
777
|
+
case 'creative':
|
|
778
|
+
return creatives.get(id);
|
|
779
|
+
case 'pixel':
|
|
780
|
+
return pixels.get(id);
|
|
781
|
+
default:
|
|
782
|
+
return undefined;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
function stripBodyFingerprint(record) {
|
|
787
|
+
const { body_fingerprint, ...rest } = record;
|
|
788
|
+
return rest;
|
|
789
|
+
}
|
|
790
|
+
function readForm(req) {
|
|
791
|
+
return new Promise((resolve, reject) => {
|
|
792
|
+
const chunks = [];
|
|
793
|
+
req.on('data', c => chunks.push(c));
|
|
794
|
+
req.on('error', reject);
|
|
795
|
+
req.on('end', () => {
|
|
796
|
+
const raw = Buffer.concat(chunks).toString('utf8');
|
|
797
|
+
const out = {};
|
|
798
|
+
for (const pair of raw.split('&')) {
|
|
799
|
+
if (!pair)
|
|
800
|
+
continue;
|
|
801
|
+
const [k, v = ''] = pair.split('=');
|
|
802
|
+
if (k === undefined)
|
|
803
|
+
continue;
|
|
804
|
+
out[decodeURIComponent(k)] = decodeURIComponent(v.replace(/\+/g, ' '));
|
|
805
|
+
}
|
|
806
|
+
resolve(out);
|
|
807
|
+
});
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
async function readJsonObject(req, res) {
|
|
811
|
+
let body;
|
|
812
|
+
try {
|
|
813
|
+
body = await readJson(req);
|
|
814
|
+
}
|
|
815
|
+
catch {
|
|
816
|
+
writeJson(res, 400, { code: 'invalid_json', message: 'Request body must be valid JSON.' });
|
|
817
|
+
return null;
|
|
818
|
+
}
|
|
819
|
+
if (!body || typeof body !== 'object' || Array.isArray(body)) {
|
|
820
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'Body must be a JSON object.' });
|
|
821
|
+
return null;
|
|
822
|
+
}
|
|
823
|
+
return body;
|
|
824
|
+
}
|
|
825
|
+
function readJson(req) {
|
|
826
|
+
return new Promise((resolve, reject) => {
|
|
827
|
+
const chunks = [];
|
|
828
|
+
req.on('data', c => chunks.push(c));
|
|
829
|
+
req.on('error', reject);
|
|
830
|
+
req.on('end', () => {
|
|
831
|
+
const raw = Buffer.concat(chunks).toString('utf8');
|
|
832
|
+
if (!raw) {
|
|
833
|
+
resolve({});
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
try {
|
|
837
|
+
resolve(JSON.parse(raw));
|
|
838
|
+
}
|
|
839
|
+
catch (err) {
|
|
840
|
+
reject(err);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
function writeJson(res, status, body) {
|
|
846
|
+
const json = JSON.stringify(body);
|
|
847
|
+
res.writeHead(status, {
|
|
848
|
+
'content-type': 'application/json; charset=utf-8',
|
|
849
|
+
'content-length': Buffer.byteLength(json),
|
|
850
|
+
});
|
|
851
|
+
res.end(json);
|
|
852
|
+
}
|
|
853
|
+
/** Daily-budget learning-phase floors typical of walled-garden platforms.
|
|
854
|
+
* Bid_strategy and platform vary; these are mid-range defaults adopters
|
|
855
|
+
* can override per-tenant. */
|
|
856
|
+
function dailyBudgetFloor(goal) {
|
|
857
|
+
switch (goal) {
|
|
858
|
+
case 'reach':
|
|
859
|
+
case 'awareness':
|
|
860
|
+
case 'video_views':
|
|
861
|
+
case 'thru_play':
|
|
862
|
+
return 5;
|
|
863
|
+
case 'clicks':
|
|
864
|
+
case 'link_clicks':
|
|
865
|
+
case 'traffic':
|
|
866
|
+
case 'engagement':
|
|
867
|
+
case 'follows':
|
|
868
|
+
case 'profile_visits':
|
|
869
|
+
return 10;
|
|
870
|
+
case 'conversions':
|
|
871
|
+
case 'purchase':
|
|
872
|
+
case 'app_install':
|
|
873
|
+
return 40;
|
|
874
|
+
default:
|
|
875
|
+
return 10;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
function synthDeliveryEstimate(input) {
|
|
879
|
+
const seedKey = stableStringify({
|
|
880
|
+
advertiserId: input.advertiserId,
|
|
881
|
+
targeting: input.targeting,
|
|
882
|
+
goal: input.optimizationGoal,
|
|
883
|
+
flight: { start: input.flightStart, end: input.flightEnd },
|
|
884
|
+
});
|
|
885
|
+
const seed = seedFromString(seedKey);
|
|
886
|
+
// Audience pool size derived from targeting hash. Real Marketing APIs
|
|
887
|
+
// base everything on this number; we anchor here too.
|
|
888
|
+
const audiencePool = 500_000 + (seed.next() % 50_000_000);
|
|
889
|
+
// Saturation rate — what fraction of pool you can reach at infinite spend.
|
|
890
|
+
const saturationCap = 0.55 + (seed.next() % 4001) / 10_000; // [0.55, 0.95]
|
|
891
|
+
// Goal-specific CPM band.
|
|
892
|
+
const cpmBase = goalCpm(input.optimizationGoal, seed);
|
|
893
|
+
// Funnel parameters. CTR varies by goal: reach campaigns don't optimize
|
|
894
|
+
// for clicks; clicks campaigns over-index. Conversion rate likewise.
|
|
895
|
+
// Applying a single conversion rate across all goals (the prior shape)
|
|
896
|
+
// produced wrong reverse-forecast budgets for non-conversion goals.
|
|
897
|
+
const ctr = ctrForGoal(input.optimizationGoal, seed);
|
|
898
|
+
const conversionRate = conversionRateForGoal(input.optimizationGoal, seed);
|
|
899
|
+
const floor = dailyBudgetFloor(input.optimizationGoal);
|
|
900
|
+
// Budget anchor. Forward: caller's budget. Reverse: derive from
|
|
901
|
+
// target_outcome — but the math depends on which goal is being targeted.
|
|
902
|
+
let dailyBudget = input.budget ?? 0;
|
|
903
|
+
let requiredBudget;
|
|
904
|
+
let preClampBudget = 0;
|
|
905
|
+
if (dailyBudget === 0 && input.targetOutcome !== undefined) {
|
|
906
|
+
const goal = input.optimizationGoal;
|
|
907
|
+
let requiredImpressions;
|
|
908
|
+
if (goal === 'reach' || goal === 'awareness') {
|
|
909
|
+
// Reverse for reach: invert the saturating curve to find the spend
|
|
910
|
+
// level that hits target_outcome unique users.
|
|
911
|
+
const cap = audiencePool * saturationCap;
|
|
912
|
+
const targetReach = Math.min(input.targetOutcome, cap * 0.99);
|
|
913
|
+
// reach = cap × (1 − e^−impressions/cap) ⇒ impressions = −cap × ln(1 − reach/cap)
|
|
914
|
+
requiredImpressions = -cap * Math.log(1 - targetReach / cap);
|
|
915
|
+
}
|
|
916
|
+
else if (goal === 'video_views' || goal === 'thru_play') {
|
|
917
|
+
// Roughly 35% completion rate at the goal level; impressions ≈ views/.35
|
|
918
|
+
requiredImpressions = input.targetOutcome / 0.35;
|
|
919
|
+
}
|
|
920
|
+
else if (goal === 'clicks' || goal === 'link_clicks' || goal === 'traffic') {
|
|
921
|
+
requiredImpressions = input.targetOutcome / Math.max(0.001, ctr);
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
// conversions / purchase / app_install / engagement etc.
|
|
925
|
+
requiredImpressions = input.targetOutcome / Math.max(ctr * conversionRate * 8, 0.0001);
|
|
926
|
+
}
|
|
927
|
+
dailyBudget = (requiredImpressions / 1000) * cpmBase.median;
|
|
928
|
+
preClampBudget = dailyBudget;
|
|
929
|
+
if (dailyBudget < floor)
|
|
930
|
+
dailyBudget = floor;
|
|
931
|
+
requiredBudget = { min: Math.floor(dailyBudget * 0.85), max: Math.ceil(dailyBudget * 1.2) };
|
|
932
|
+
}
|
|
933
|
+
if (dailyBudget === 0)
|
|
934
|
+
dailyBudget = Math.max(floor, 100);
|
|
935
|
+
// Saturating-curve: reach grows fast then plateaus at saturationCap × pool.
|
|
936
|
+
const reachAt = (b) => {
|
|
937
|
+
const impressions = (b / cpmBase.median) * 1000;
|
|
938
|
+
const cap = audiencePool * saturationCap;
|
|
939
|
+
const ratePer = impressions / Math.max(1, cap);
|
|
940
|
+
return Math.floor(cap * (1 - Math.exp(-ratePer)));
|
|
941
|
+
};
|
|
942
|
+
const dailyReach = reachAt(dailyBudget);
|
|
943
|
+
const dailyImpressions = Math.floor((dailyBudget / cpmBase.median) * 1000);
|
|
944
|
+
const dailyClicks = Math.floor(dailyImpressions * ctr);
|
|
945
|
+
const dailyConversions = Math.floor(dailyClicks * conversionRate * 8); // post-click + view-through
|
|
946
|
+
const rangeUnit = input.targetOutcome !== undefined && input.budget === undefined
|
|
947
|
+
? input.optimizationGoal === 'clicks' ||
|
|
948
|
+
input.optimizationGoal === 'link_clicks' ||
|
|
949
|
+
input.optimizationGoal === 'traffic'
|
|
950
|
+
? 'clicks'
|
|
951
|
+
: 'conversions' // Reach-goal reverse fits the conversions enum better than reach_freq, which is broadcast-shaped per the AdCP schema.
|
|
952
|
+
: 'spend';
|
|
953
|
+
const tiers = [0.5, 1.0, 1.5, 2.5, 4.0].map(m => Math.round(dailyBudget * m));
|
|
954
|
+
// Tighten ranges to ±15-30% (was ±60% min / ±10% max) — real walled-garden
|
|
955
|
+
// delivery_estimate ranges are ±25-35% per recent benchmarks.
|
|
956
|
+
const deliveryCurve = tiers.map(t => ({
|
|
957
|
+
daily_budget: t,
|
|
958
|
+
estimated_daily_reach: { min: Math.floor(reachAt(t) * 0.78), max: Math.floor(reachAt(t) * 1.18) },
|
|
959
|
+
estimated_daily_conversions: {
|
|
960
|
+
min: Math.floor((t / cpmBase.median) * 1000 * ctr * conversionRate * 8 * 0.78),
|
|
961
|
+
max: Math.floor((t / cpmBase.median) * 1000 * ctr * conversionRate * 8 * 1.22),
|
|
962
|
+
},
|
|
963
|
+
}));
|
|
964
|
+
const minBudgetWarning = preClampBudget > 0 && preClampBudget < floor
|
|
965
|
+
? {
|
|
966
|
+
floor,
|
|
967
|
+
reason: `Inferred budget ${round2(preClampBudget)} ${input.currency}/day below platform learning-phase floor for ${input.optimizationGoal} (${floor} ${input.currency}/day); clamped.`,
|
|
968
|
+
}
|
|
969
|
+
: undefined;
|
|
970
|
+
return {
|
|
971
|
+
optimization_goal: input.optimizationGoal,
|
|
972
|
+
currency: input.currency,
|
|
973
|
+
forecast_range_unit: rangeUnit,
|
|
974
|
+
estimated_daily_reach: { min: Math.floor(dailyReach * 0.78), max: Math.floor(dailyReach * 1.18) },
|
|
975
|
+
estimated_daily_impressions: {
|
|
976
|
+
min: Math.floor(dailyImpressions * 0.78),
|
|
977
|
+
max: Math.floor(dailyImpressions * 1.18),
|
|
978
|
+
},
|
|
979
|
+
estimated_daily_clicks: { min: Math.floor(dailyClicks * 0.78), max: Math.floor(dailyClicks * 1.22) },
|
|
980
|
+
estimated_daily_conversions: {
|
|
981
|
+
min: Math.floor(dailyConversions * 0.75),
|
|
982
|
+
max: Math.floor(dailyConversions * 1.25),
|
|
983
|
+
},
|
|
984
|
+
estimated_cpm: cpmBase,
|
|
985
|
+
bid_recommendation: {
|
|
986
|
+
low: round2(cpmBase.median * 0.75),
|
|
987
|
+
median: round2(cpmBase.median),
|
|
988
|
+
high: round2(cpmBase.median * 1.35),
|
|
989
|
+
},
|
|
990
|
+
daily_budget_recommendation: {
|
|
991
|
+
min: Math.max(floor, Math.floor(dailyBudget * 0.5)),
|
|
992
|
+
max: Math.ceil(dailyBudget * 2),
|
|
993
|
+
},
|
|
994
|
+
delivery_curve: deliveryCurve,
|
|
995
|
+
...(requiredBudget && { required_budget: requiredBudget }),
|
|
996
|
+
...(minBudgetWarning && { min_budget_warning: minBudgetWarning }),
|
|
997
|
+
generated_at: '2026-04-01T00:00:00.000Z',
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
function ctrForGoal(goal, seed) {
|
|
1001
|
+
const base = (() => {
|
|
1002
|
+
switch (goal) {
|
|
1003
|
+
case 'reach':
|
|
1004
|
+
case 'awareness':
|
|
1005
|
+
return 0.003; // 0.3% — reach campaigns don't optimize for clicks
|
|
1006
|
+
case 'video_views':
|
|
1007
|
+
case 'thru_play':
|
|
1008
|
+
return 0.005;
|
|
1009
|
+
case 'clicks':
|
|
1010
|
+
case 'link_clicks':
|
|
1011
|
+
case 'traffic':
|
|
1012
|
+
return 0.013; // 1.3% — performance-optimized
|
|
1013
|
+
case 'conversions':
|
|
1014
|
+
case 'purchase':
|
|
1015
|
+
case 'app_install':
|
|
1016
|
+
return 0.011;
|
|
1017
|
+
case 'engagement':
|
|
1018
|
+
case 'follows':
|
|
1019
|
+
case 'profile_visits':
|
|
1020
|
+
return 0.018; // engagement campaigns get high CTR
|
|
1021
|
+
default:
|
|
1022
|
+
return 0.008;
|
|
1023
|
+
}
|
|
1024
|
+
})();
|
|
1025
|
+
// ±15% wobble so storyboards stay deterministic but inputs perturb output.
|
|
1026
|
+
return base * (0.85 + (seed.next() % 3001) / 10_000);
|
|
1027
|
+
}
|
|
1028
|
+
function conversionRateForGoal(goal, seed) {
|
|
1029
|
+
const base = (() => {
|
|
1030
|
+
switch (goal) {
|
|
1031
|
+
case 'conversions':
|
|
1032
|
+
case 'purchase':
|
|
1033
|
+
return 0.022; // optimization toward purchase tightens funnel
|
|
1034
|
+
case 'app_install':
|
|
1035
|
+
return 0.028;
|
|
1036
|
+
case 'reach':
|
|
1037
|
+
case 'awareness':
|
|
1038
|
+
return 0.004; // upper-funnel — conversions are incidental
|
|
1039
|
+
default:
|
|
1040
|
+
return 0.012;
|
|
1041
|
+
}
|
|
1042
|
+
})();
|
|
1043
|
+
return base * (0.85 + (seed.next() % 3001) / 10_000);
|
|
1044
|
+
}
|
|
1045
|
+
function goalCpm(goal, seed) {
|
|
1046
|
+
// Approximate CPM bands typical of social Marketing APIs in 2024-2026.
|
|
1047
|
+
// Reach is cheaper than video (in-stream/feed video CPMs run $8-15);
|
|
1048
|
+
// clicks and conversions are top of the band because they buy auction
|
|
1049
|
+
// priority for the most contested inventory.
|
|
1050
|
+
// Calibrated to 2024-2026 walled-garden benchmarks: reach is cheaper than
|
|
1051
|
+
// video CPMs (Meta in-stream/Reels run $11-16; mock weighted toward feed
|
|
1052
|
+
// video). Conversions tops the band as auction priority spikes.
|
|
1053
|
+
const base = (() => {
|
|
1054
|
+
switch (goal) {
|
|
1055
|
+
case 'reach':
|
|
1056
|
+
case 'awareness':
|
|
1057
|
+
return 7;
|
|
1058
|
+
case 'video_views':
|
|
1059
|
+
case 'thru_play':
|
|
1060
|
+
return 10;
|
|
1061
|
+
case 'engagement':
|
|
1062
|
+
case 'follows':
|
|
1063
|
+
case 'profile_visits':
|
|
1064
|
+
return 6;
|
|
1065
|
+
case 'clicks':
|
|
1066
|
+
case 'link_clicks':
|
|
1067
|
+
case 'traffic':
|
|
1068
|
+
return 11;
|
|
1069
|
+
case 'conversions':
|
|
1070
|
+
case 'purchase':
|
|
1071
|
+
case 'app_install':
|
|
1072
|
+
return 18;
|
|
1073
|
+
default:
|
|
1074
|
+
return 10;
|
|
1075
|
+
}
|
|
1076
|
+
})();
|
|
1077
|
+
// ±15% wobble — narrower than the original ±15% min / 60% max range,
|
|
1078
|
+
// matching real walled-garden delivery_estimate jitter (~±10-15% on CPM
|
|
1079
|
+
// medians, ±50-60% on min/max bounds).
|
|
1080
|
+
const wobble = 0.88 + (seed.next() % 2401) / 10_000; // [0.88, 1.12]
|
|
1081
|
+
const median = round2(base * wobble);
|
|
1082
|
+
return { min: round2(median * 0.7), median, max: round2(median * 1.45) };
|
|
1083
|
+
}
|
|
1084
|
+
function synthAudienceReach(input) {
|
|
1085
|
+
const seed = seedFromString(stableStringify({ adv: input.advertiserId, t: input.targeting, kind: 'audience_reach' }));
|
|
1086
|
+
// Audience pool varies dramatically by targeting tightness.
|
|
1087
|
+
const pool = 50_000 + (seed.next() % 80_000_000);
|
|
1088
|
+
const matchRate = 0.55 + (seed.next() % 3501) / 10_000; // platform match ~55–90%
|
|
1089
|
+
const matchable = Math.floor(pool * matchRate);
|
|
1090
|
+
const quality = pool < 1_000_000 ? 'narrow' : pool < 10_000_000 ? 'specific' : 'broad';
|
|
1091
|
+
return {
|
|
1092
|
+
estimated_audience_size: { min: Math.floor(pool * 0.8), max: Math.floor(pool * 1.2) },
|
|
1093
|
+
matchable_size_at_platform: { min: Math.floor(matchable * 0.8), max: Math.floor(matchable * 1.2) },
|
|
1094
|
+
reach_quality: quality,
|
|
1095
|
+
generated_at: '2026-04-01T00:00:00.000Z',
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Approximate adult-internet population by country (rough order-of-magnitude
|
|
1100
|
+
* for top markets; default for unmatched). Used to clamp lookalike sizing
|
|
1101
|
+
* so a large seed doesn't produce a lookalike larger than the country.
|
|
1102
|
+
* Real walled-garden APIs gate lookalikes at country-share boundaries
|
|
1103
|
+
* (Meta caps LAL audiences at country_pop × similarity_pct/100).
|
|
1104
|
+
*/
|
|
1105
|
+
function countryPopulation(country) {
|
|
1106
|
+
// Adult-internet population estimates (mid-2020s, rounded). Numbers don't
|
|
1107
|
+
// need to be precise — they only anchor the lookalike sizing cap so the
|
|
1108
|
+
// mock doesn't produce 19M LAL audiences from 1M seeds.
|
|
1109
|
+
const c = country.toUpperCase();
|
|
1110
|
+
switch (c) {
|
|
1111
|
+
case 'US':
|
|
1112
|
+
return 260_000_000;
|
|
1113
|
+
case 'CA':
|
|
1114
|
+
return 32_000_000;
|
|
1115
|
+
case 'GB':
|
|
1116
|
+
case 'UK':
|
|
1117
|
+
return 55_000_000;
|
|
1118
|
+
case 'DE':
|
|
1119
|
+
return 70_000_000;
|
|
1120
|
+
case 'FR':
|
|
1121
|
+
return 55_000_000;
|
|
1122
|
+
case 'JP':
|
|
1123
|
+
return 85_000_000;
|
|
1124
|
+
case 'AU':
|
|
1125
|
+
return 22_000_000;
|
|
1126
|
+
case 'BR':
|
|
1127
|
+
return 140_000_000;
|
|
1128
|
+
case 'IN':
|
|
1129
|
+
return 625_000_000;
|
|
1130
|
+
case 'MX':
|
|
1131
|
+
return 100_000_000;
|
|
1132
|
+
default:
|
|
1133
|
+
return 25_000_000; // default for smaller markets
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
function synthLookalikeEstimate(input) {
|
|
1137
|
+
const seed = seedFromString(stableStringify({
|
|
1138
|
+
adv: input.advertiserId,
|
|
1139
|
+
aud: input.seedAudienceId,
|
|
1140
|
+
country: input.country,
|
|
1141
|
+
pct: input.similarityPct,
|
|
1142
|
+
}));
|
|
1143
|
+
const pop = countryPopulation(input.country);
|
|
1144
|
+
// Meta's LAL math: country_pop × (similarity_pct / 100) is the upper cap.
|
|
1145
|
+
// A 1% LAL in the US ≈ 2.6M; a 10% LAL ≈ 26M. We hold sizing well below the
|
|
1146
|
+
// cap (`cap * 0.6` × `wobble ∈ [0.85, 1.15]` → max ≈ `cap * 0.69`) so the
|
|
1147
|
+
// mock is conservatively realistic — real walled gardens rarely hit the
|
|
1148
|
+
// theoretical cap on first generation.
|
|
1149
|
+
const cap = Math.floor(pop * (input.similarityPct / 100));
|
|
1150
|
+
// Seed-driven contribution as a fallback for small seeds — never exceeds
|
|
1151
|
+
// the platform cap.
|
|
1152
|
+
const seedContribution = Math.floor(Math.max(1000, input.seedSize) * (8 + input.similarityPct * 8));
|
|
1153
|
+
const wobble = 0.85 + (seed.next() % 3001) / 10_000;
|
|
1154
|
+
const size = Math.floor(Math.min(cap * 0.6, seedContribution) * wobble);
|
|
1155
|
+
// ETA varies by platform: TikTok 1-6h, Meta 4-24h. Mock spans both.
|
|
1156
|
+
const eta = 4 + (seed.next() % 21); // 4–24h
|
|
1157
|
+
return {
|
|
1158
|
+
seed_audience_id: input.seedAudienceId,
|
|
1159
|
+
similarity_pct: input.similarityPct,
|
|
1160
|
+
country: input.country.toUpperCase(),
|
|
1161
|
+
estimated_size: { min: Math.floor(size * 0.85), max: Math.floor(size * 1.15) },
|
|
1162
|
+
activation_eta_hours: eta,
|
|
1163
|
+
generated_at: '2026-04-01T00:00:00.000Z',
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
function round2(n) {
|
|
1167
|
+
return Math.round(n * 100) / 100;
|
|
1168
|
+
}
|
|
1169
|
+
function isObject(v) {
|
|
1170
|
+
return Boolean(v) && typeof v === 'object' && !Array.isArray(v);
|
|
1171
|
+
}
|
|
1172
|
+
function serializeTargeting(t) {
|
|
1173
|
+
if (t === null || t === undefined)
|
|
1174
|
+
return null;
|
|
1175
|
+
if (typeof t === 'string')
|
|
1176
|
+
return t;
|
|
1177
|
+
try {
|
|
1178
|
+
return stableStringify(t);
|
|
1179
|
+
}
|
|
1180
|
+
catch {
|
|
1181
|
+
return null;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Recursive deterministic JSON stringifier — sorts object keys at every
|
|
1186
|
+
* depth so two equivalent payloads with different key insertion orders
|
|
1187
|
+
* hash identically. Plain `JSON.stringify(t, keys.sort())` only sorts the
|
|
1188
|
+
* top level AND treats the array as a key allowlist (silently dropping
|
|
1189
|
+
* nested fields).
|
|
1190
|
+
*/
|
|
1191
|
+
function stableStringify(v) {
|
|
1192
|
+
if (v === null || typeof v !== 'object')
|
|
1193
|
+
return JSON.stringify(v);
|
|
1194
|
+
if (Array.isArray(v))
|
|
1195
|
+
return `[${v.map(stableStringify).join(',')}]`;
|
|
1196
|
+
const obj = v;
|
|
1197
|
+
const keys = Object.keys(obj).sort();
|
|
1198
|
+
const parts = keys.map(k => `${JSON.stringify(k)}:${stableStringify(obj[k])}`);
|
|
1199
|
+
return `{${parts.join(',')}}`;
|
|
1200
|
+
}
|
|
1201
|
+
function seedFromString(key) {
|
|
1202
|
+
// SHA-256 → 4-byte uint32 stream. Stable across Node versions; storyboards
|
|
1203
|
+
// can assert exact numbers without flake.
|
|
1204
|
+
const digest = (0, node_crypto_1.createHash)('sha256').update(key).digest();
|
|
1205
|
+
let offset = 0;
|
|
1206
|
+
return {
|
|
1207
|
+
next: () => {
|
|
1208
|
+
if (offset + 4 > digest.length) {
|
|
1209
|
+
const extended = (0, node_crypto_1.createHash)('sha256').update(digest).digest();
|
|
1210
|
+
digest.set(extended);
|
|
1211
|
+
offset = 0;
|
|
1212
|
+
}
|
|
1213
|
+
const v = digest.readUInt32BE(offset);
|
|
1214
|
+
offset += 4;
|
|
1215
|
+
return v;
|
|
1216
|
+
},
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
//# sourceMappingURL=server.js.map
|