@adcp/sdk 6.6.0 → 6.8.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 +462 -11
- 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/derived-account-store.d.ts +152 -0
- package/dist/lib/adapters/derived-account-store.d.ts.map +1 -0
- package/dist/lib/adapters/derived-account-store.js +135 -0
- package/dist/lib/adapters/derived-account-store.js.map +1 -0
- package/dist/lib/adapters/implicit-account-store.d.ts +172 -0
- package/dist/lib/adapters/implicit-account-store.d.ts.map +1 -0
- package/dist/lib/adapters/implicit-account-store.js +315 -0
- package/dist/lib/adapters/implicit-account-store.js.map +1 -0
- package/dist/lib/adapters/index.d.ts +5 -0
- package/dist/lib/adapters/index.d.ts.map +1 -1
- package/dist/lib/adapters/index.js +25 -1
- package/dist/lib/adapters/index.js.map +1 -1
- package/dist/lib/adapters/oauth-passthrough-resolver.d.ts +193 -0
- package/dist/lib/adapters/oauth-passthrough-resolver.d.ts.map +1 -0
- package/dist/lib/adapters/oauth-passthrough-resolver.js +180 -0
- package/dist/lib/adapters/oauth-passthrough-resolver.js.map +1 -0
- package/dist/lib/adapters/roster-account-store.d.ts +282 -0
- package/dist/lib/adapters/roster-account-store.d.ts.map +1 -0
- package/dist/lib/adapters/roster-account-store.js +216 -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 +86 -23
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +27 -7
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/mock-server/creative-ad-server/seed-data.d.ts +81 -0
- package/dist/lib/mock-server/creative-ad-server/seed-data.d.ts.map +1 -0
- package/dist/lib/mock-server/creative-ad-server/seed-data.js +200 -0
- package/dist/lib/mock-server/creative-ad-server/seed-data.js.map +1 -0
- package/dist/lib/mock-server/creative-ad-server/server.d.ts +39 -0
- package/dist/lib/mock-server/creative-ad-server/server.d.ts.map +1 -0
- package/dist/lib/mock-server/creative-ad-server/server.js +618 -0
- package/dist/lib/mock-server/creative-ad-server/server.js.map +1 -0
- package/dist/lib/mock-server/creative-template/server.d.ts.map +1 -1
- package/dist/lib/mock-server/creative-template/server.js +54 -9
- package/dist/lib/mock-server/creative-template/server.js.map +1 -1
- package/dist/lib/mock-server/index.d.ts +27 -1
- package/dist/lib/mock-server/index.d.ts.map +1 -1
- package/dist/lib/mock-server/index.js +289 -15
- package/dist/lib/mock-server/index.js.map +1 -1
- 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-non-guaranteed/seed-data.d.ts +66 -0
- package/dist/lib/mock-server/sales-non-guaranteed/seed-data.d.ts.map +1 -0
- package/dist/lib/mock-server/sales-non-guaranteed/seed-data.js +193 -0
- package/dist/lib/mock-server/sales-non-guaranteed/seed-data.js.map +1 -0
- package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts +33 -0
- package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts.map +1 -0
- package/dist/lib/mock-server/sales-non-guaranteed/server.js +782 -0
- package/dist/lib/mock-server/sales-non-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/server.d.ts.map +1 -1
- package/dist/lib/mock-server/signal-marketplace/server.js +58 -9
- package/dist/lib/mock-server/signal-marketplace/server.js.map +1 -1
- package/dist/lib/mock-server/sponsored-intelligence/seed-data.d.ts +50 -0
- package/dist/lib/mock-server/sponsored-intelligence/seed-data.d.ts.map +1 -0
- package/dist/lib/mock-server/sponsored-intelligence/seed-data.js +133 -0
- package/dist/lib/mock-server/sponsored-intelligence/seed-data.js.map +1 -0
- package/dist/lib/mock-server/sponsored-intelligence/server.d.ts +13 -0
- package/dist/lib/mock-server/sponsored-intelligence/server.d.ts.map +1 -0
- package/dist/lib/mock-server/sponsored-intelligence/server.js +609 -0
- package/dist/lib/mock-server/sponsored-intelligence/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 +20 -54
- 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/account-mode.d.ts +113 -0
- package/dist/lib/server/account-mode.d.ts.map +1 -0
- package/dist/lib/server/account-mode.js +125 -0
- package/dist/lib/server/account-mode.js.map +1 -0
- 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 +63 -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 +59 -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 +220 -21
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +349 -14
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/ctx-metadata/store.d.ts +1 -1
- package/dist/lib/server/ctx-metadata/store.d.ts.map +1 -1
- package/dist/lib/server/ctx-metadata/store.js +1 -0
- package/dist/lib/server/ctx-metadata/store.js.map +1 -1
- package/dist/lib/server/decisioning/account.d.ts +345 -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 +498 -0
- package/dist/lib/server/decisioning/buyer-agent.d.ts.map +1 -0
- package/dist/lib/server/decisioning/buyer-agent.js +382 -0
- package/dist/lib/server/decisioning/buyer-agent.js.map +1 -0
- package/dist/lib/server/decisioning/capabilities.d.ts +32 -5
- package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
- package/dist/lib/server/decisioning/compose.d.ts +124 -0
- package/dist/lib/server/decisioning/compose.d.ts.map +1 -0
- package/dist/lib/server/decisioning/compose.js +48 -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 +13 -3
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +46 -2
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/platform-helpers.d.ts +287 -0
- package/dist/lib/server/decisioning/platform-helpers.d.ts.map +1 -0
- package/dist/lib/server/decisioning/platform-helpers.js +336 -0
- package/dist/lib/server/decisioning/platform-helpers.js.map +1 -0
- package/dist/lib/server/decisioning/platform.d.ts +141 -20
- 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 +928 -146
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/observed-modes.d.ts +40 -0
- package/dist/lib/server/decisioning/runtime/observed-modes.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/observed-modes.js +82 -0
- package/dist/lib/server/decisioning/runtime/observed-modes.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/protocol-for-tool.js +2 -2
- package/dist/lib/server/decisioning/runtime/protocol-for-tool.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 +40 -4
- 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/specialisms/sponsored-intelligence.d.ts +125 -0
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js +52 -0
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js.map +1 -0
- package/dist/lib/server/decisioning/tenant-registry.d.ts +16 -0
- 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 +14 -2
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js +41 -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 +53 -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 +51 -0
- package/dist/lib/server/test-controller.d.ts.map +1 -1
- package/dist/lib/server/test-controller.js +112 -30
- 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/comply-controller.d.ts +23 -2
- package/dist/lib/testing/comply-controller.d.ts.map +1 -1
- package/dist/lib/testing/comply-controller.js +19 -2
- package/dist/lib/testing/comply-controller.js.map +1 -1
- package/dist/lib/testing/index.d.ts +1 -1
- package/dist/lib/testing/index.d.ts.map +1 -1
- package/dist/lib/testing/index.js.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.js +46 -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 +800 -92
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/types.d.ts +221 -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 +511 -2
- package/dist/lib/testing/storyboard/validations.js.map +1 -1
- package/dist/lib/testing/test-controller.d.ts +65 -1
- package/dist/lib/testing/test-controller.d.ts.map +1 -1
- package/dist/lib/testing/test-controller.js +36 -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 +15 -1
- package/dist/lib/types/index.d.ts.map +1 -1
- package/dist/lib/types/index.js +7 -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 +44 -3
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +67 -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 +30 -0
- package/dist/lib/utils/glob.d.ts.map +1 -0
- package/dist/lib/utils/glob.js +39 -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 +48 -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 +460 -0
- package/examples/hello_creative_adapter_ad_server.ts +790 -0
- package/examples/hello_creative_adapter_template.ts +528 -0
- package/examples/hello_seller_adapter_guaranteed.ts +1138 -0
- package/examples/hello_seller_adapter_multi_tenant.ts +1046 -0
- package/examples/hello_seller_adapter_non_guaranteed.ts +1020 -0
- package/examples/hello_seller_adapter_social.ts +829 -0
- package/examples/hello_si_adapter_brand.ts +572 -0
- package/examples/hello_signals_adapter_marketplace.ts +532 -0
- package/examples/seller-test-controller.ts +22 -28
- package/package.json +32 -4
- package/skills/SHAPE-GOTCHAS.md +233 -0
- package/skills/build-brand-rights-agent/SKILL.md +121 -16
- package/skills/build-creative-agent/SKILL.md +128 -184
- package/skills/build-decisioning-platform/advanced/MULTI-TENANT.md +104 -28
- package/skills/build-generative-seller-agent/SKILL.md +15 -9
- package/skills/build-governance-agent/SKILL.md +20 -11
- package/skills/build-holdco-agent/SKILL.md +250 -0
- package/skills/build-retail-media-agent/SKILL.md +10 -8
- package/skills/build-seller-agent/SKILL.md +315 -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 +9 -29
- package/skills/build-seller-agent/specialisms/sales-social.md +63 -2
- package/skills/build-si-agent/SKILL.md +251 -196
- package/skills/build-signals-agent/SKILL.md +4 -0
- package/skills/call-adcp-agent/SKILL.md +7 -1
- package/skills/run-by-experts/SKILL.md +116 -0
- package/skills/triage-storyboard-failure/SKILL.md +96 -0
- package/skills/call-adcp-agent.previous/SKILL.md +0 -339
- /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,1138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hello_seller_adapter_guaranteed — worked starting point for an
|
|
3
|
+
* AdCP guaranteed sales agent (specialism `sales-guaranteed`) that wraps
|
|
4
|
+
* an upstream GAM-style ad-server with HITL IO approval over static Bearer.
|
|
5
|
+
*
|
|
6
|
+
* The headline behavior: `create_media_buy` returns an A2A task envelope
|
|
7
|
+
* (`status: 'submitted'`), the upstream IO review runs in the background,
|
|
8
|
+
* and the buyer receives the final `media_buy_id` either by polling
|
|
9
|
+
* `tasks_get` or via the push_notification webhook. This is the
|
|
10
|
+
* `ctx.handoffToTask(fn)` pattern in v6 typed platforms.
|
|
11
|
+
*
|
|
12
|
+
* Fork this. Replace `upstream` with calls to your real backend. The
|
|
13
|
+
* AdCP-facing platform methods stay the same.
|
|
14
|
+
*
|
|
15
|
+
* FORK CHECKLIST
|
|
16
|
+
* 1. Replace every `// SWAP:` marker with calls to your backend.
|
|
17
|
+
* 2. Replace `KNOWN_PUBLISHERS` (line ~63) with your tenant directory
|
|
18
|
+
* (or remove and use your real `/networks/list` endpoint).
|
|
19
|
+
* 3. Replace `projectProduct()` defaults — `publisher_properties` selector,
|
|
20
|
+
* `pricing_options[]`, `reporting_capabilities` — with values your
|
|
21
|
+
* seller actually commits to.
|
|
22
|
+
* 4. Replace `aggressiveMeasurement` thresholds with your IO-team's
|
|
23
|
+
* committable maxima (viewability, completion-rate, etc.).
|
|
24
|
+
* 5. Replace `advertiserId = networkCode` collapse with a real lookup
|
|
25
|
+
* (production splits network and advertiser ids).
|
|
26
|
+
* 6. Replace the in-memory poll loop (`getTask`) with your IO-task
|
|
27
|
+
* backend; persist `(idempotency_key, lineitem_index) → upstream_lineitem_id`
|
|
28
|
+
* in your DB so a process restart can reconcile partial completion.
|
|
29
|
+
* 7. Validate: `node --test test/examples/hello-seller-adapter-guaranteed.test.js`
|
|
30
|
+
* 8. **DELETE the `// TEST-ONLY` blocks** before deploying:
|
|
31
|
+
* - sandbox-arm in `accounts.resolve` (resolves storyboard runner's
|
|
32
|
+
* synthetic `{brand, sandbox: true}` refs to a known network)
|
|
33
|
+
* - HITL bypass in `createMediaBuy` (the `if (isSandbox)` short-circuit)
|
|
34
|
+
* - `complyTest:` config block on `createAdcpServerFromPlatform`
|
|
35
|
+
* - in-memory `seededMediaBuys` / `simulatedDelivery` Maps
|
|
36
|
+
* These exist so the conformance harness can drive cascade scenarios
|
|
37
|
+
* deterministically. Production sellers ship without them.
|
|
38
|
+
*
|
|
39
|
+
* Demo:
|
|
40
|
+
* npx @adcp/sdk@latest mock-server sales-guaranteed --port 4450
|
|
41
|
+
* UPSTREAM_URL=http://127.0.0.1:4450 \
|
|
42
|
+
* npx tsx examples/hello_seller_adapter_guaranteed.ts
|
|
43
|
+
* adcp storyboard run http://127.0.0.1:3004/mcp sales_guaranteed \
|
|
44
|
+
* --auth sk_harness_do_not_use_in_prod
|
|
45
|
+
* curl http://127.0.0.1:4450/_debug/traffic
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
import {
|
|
49
|
+
createAdcpServerFromPlatform,
|
|
50
|
+
createMediaBuyStore,
|
|
51
|
+
InMemoryStateStore,
|
|
52
|
+
serve,
|
|
53
|
+
verifyApiKey,
|
|
54
|
+
createIdempotencyStore,
|
|
55
|
+
createUpstreamHttpClient,
|
|
56
|
+
memoryBackend,
|
|
57
|
+
AdcpError,
|
|
58
|
+
getAccountMode,
|
|
59
|
+
assertMediaBuyTransition,
|
|
60
|
+
type DecisioningPlatform,
|
|
61
|
+
type SalesCorePlatform,
|
|
62
|
+
type SalesIngestionPlatform,
|
|
63
|
+
type AccountStore,
|
|
64
|
+
type Account,
|
|
65
|
+
type SyncCreativesRow,
|
|
66
|
+
type SyncAccountsResultRow,
|
|
67
|
+
} from '@adcp/sdk/server';
|
|
68
|
+
import type {
|
|
69
|
+
GetProductsRequest,
|
|
70
|
+
GetProductsResponse,
|
|
71
|
+
CreateMediaBuyRequest,
|
|
72
|
+
CreateMediaBuySuccess,
|
|
73
|
+
UpdateMediaBuyRequest,
|
|
74
|
+
UpdateMediaBuySuccess,
|
|
75
|
+
GetMediaBuysRequest,
|
|
76
|
+
GetMediaBuysResponse,
|
|
77
|
+
GetMediaBuyDeliveryRequest,
|
|
78
|
+
GetMediaBuyDeliveryResponse,
|
|
79
|
+
} from '@adcp/sdk/types';
|
|
80
|
+
|
|
81
|
+
// `Product` isn't re-exported from `@adcp/sdk/types` (#1254 in the rollup);
|
|
82
|
+
// derive the shape from the response array.
|
|
83
|
+
type Product = GetProductsResponse['products'][number];
|
|
84
|
+
|
|
85
|
+
const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4450';
|
|
86
|
+
const UPSTREAM_API_KEY = process.env['UPSTREAM_API_KEY'] ?? 'mock_sales_guaranteed_key_do_not_use_in_prod';
|
|
87
|
+
const PORT = Number(process.env['PORT'] ?? 3004);
|
|
88
|
+
const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use_in_prod';
|
|
89
|
+
const PUBLIC_AGENT_URL = process.env['PUBLIC_AGENT_URL'] ?? `http://127.0.0.1:${PORT}`;
|
|
90
|
+
|
|
91
|
+
const KNOWN_PUBLISHERS = ['acmeoutdoor.example', 'pinnacle-agency.example', 'premium-sports.example'];
|
|
92
|
+
|
|
93
|
+
// SWAP: the seller's minimum committable max_variance_percent — the
|
|
94
|
+
// buyer-vs-seller billing-count delta this seller will tolerate before
|
|
95
|
+
// triggering resolution. 5% is industry typical for premium guaranteed
|
|
96
|
+
// inventory; your IO desk owns the real number.
|
|
97
|
+
const MIN_VARIANCE_TOLERANCE = 5;
|
|
98
|
+
|
|
99
|
+
// TEST-ONLY: id-prefix used by the sandbox arm in `accounts.resolve` so
|
|
100
|
+
// `createMediaBuy` can detect cascade-storyboard requests and bypass the
|
|
101
|
+
// HITL handoff. Production sellers don't need this; remove the sandbox
|
|
102
|
+
// arm + this constant before deploying. See FORK CHECKLIST item 8.
|
|
103
|
+
const SANDBOX_ID_PREFIX = 'sandbox_';
|
|
104
|
+
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Upstream client — SWAP for production.
|
|
107
|
+
// Each method maps one AdCP tool concern to one upstream call. Per-request
|
|
108
|
+
// `X-Network-Code` is injected via the `headers` parameter on each call —
|
|
109
|
+
// the mock requires it on every request after auth. Real GAM uses the same
|
|
110
|
+
// pattern (X-API-Network), as do most ad-server APIs.
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
interface UpstreamNetwork {
|
|
114
|
+
network_code: string;
|
|
115
|
+
display_name: string;
|
|
116
|
+
adcp_publisher: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface UpstreamProduct {
|
|
120
|
+
product_id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
network_code: string;
|
|
123
|
+
delivery_type: 'guaranteed' | 'non_guaranteed';
|
|
124
|
+
channel: 'video' | 'ctv' | 'display' | 'audio';
|
|
125
|
+
format_ids: string[];
|
|
126
|
+
ad_unit_ids: string[];
|
|
127
|
+
pricing: { model: 'cpm' | 'cpv'; cpm: number; currency: string; min_spend?: number };
|
|
128
|
+
availability?: { start_date?: string; end_date?: string; available_impressions?: number };
|
|
129
|
+
/** Per-query forecast — present when GET /v1/products is called with
|
|
130
|
+
* `targeting`/`flight_start`/`flight_end`/`budget` query params. Mirrors
|
|
131
|
+
* AdCP `DeliveryForecast` field-for-field; pass through unchanged. */
|
|
132
|
+
forecast?: UpstreamForecast;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface UpstreamForecastRange {
|
|
136
|
+
low?: number;
|
|
137
|
+
mid?: number;
|
|
138
|
+
high?: number;
|
|
139
|
+
[k: string]: unknown;
|
|
140
|
+
}
|
|
141
|
+
interface UpstreamForecastPoint {
|
|
142
|
+
label?: string;
|
|
143
|
+
budget?: number;
|
|
144
|
+
metrics: {
|
|
145
|
+
impressions?: UpstreamForecastRange;
|
|
146
|
+
reach?: UpstreamForecastRange;
|
|
147
|
+
frequency?: UpstreamForecastRange;
|
|
148
|
+
spend?: UpstreamForecastRange;
|
|
149
|
+
[k: string]: UpstreamForecastRange | undefined;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
interface UpstreamForecast {
|
|
153
|
+
points: UpstreamForecastPoint[];
|
|
154
|
+
forecast_range_unit: 'spend' | 'availability';
|
|
155
|
+
method: 'modeled' | 'guaranteed' | 'estimate';
|
|
156
|
+
currency: string;
|
|
157
|
+
generated_at?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface UpstreamOrder {
|
|
161
|
+
order_id: string;
|
|
162
|
+
network_code: string;
|
|
163
|
+
name: string;
|
|
164
|
+
status: 'draft' | 'pending_approval' | 'approved' | 'delivering' | 'completed' | 'canceled' | 'rejected';
|
|
165
|
+
advertiser_id: string;
|
|
166
|
+
currency: string;
|
|
167
|
+
budget?: number;
|
|
168
|
+
approval_task_id?: string;
|
|
169
|
+
rejection_reason?: string;
|
|
170
|
+
/** Mock's GET /v1/orders/{id} omits line_items; fetch via
|
|
171
|
+
* GET /v1/orders/{id}/lineitems separately. Real GAM splits the same
|
|
172
|
+
* way (Order vs LineItem services). */
|
|
173
|
+
line_items?: Array<{
|
|
174
|
+
line_item_id: string;
|
|
175
|
+
order_id: string;
|
|
176
|
+
product_id: string;
|
|
177
|
+
status: 'pending_creatives' | 'ready' | 'paused' | 'delivering' | 'completed';
|
|
178
|
+
budget: number;
|
|
179
|
+
creative_ids: string[];
|
|
180
|
+
}>;
|
|
181
|
+
created_at: string;
|
|
182
|
+
updated_at: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface UpstreamTask {
|
|
186
|
+
task_id: string;
|
|
187
|
+
order_id: string;
|
|
188
|
+
status: 'submitted' | 'working' | 'completed' | 'rejected';
|
|
189
|
+
result?: { outcome: 'approved' | 'rejected'; reviewer_note?: string };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
interface UpstreamCreative {
|
|
193
|
+
creative_id: string;
|
|
194
|
+
network_code: string;
|
|
195
|
+
name: string;
|
|
196
|
+
format_id: string;
|
|
197
|
+
status: 'active' | 'paused' | 'archived';
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
interface UpstreamDelivery {
|
|
201
|
+
order_id: string;
|
|
202
|
+
currency: string;
|
|
203
|
+
reporting_period: { start: string; end: string };
|
|
204
|
+
totals: {
|
|
205
|
+
impressions: number;
|
|
206
|
+
clicks: number;
|
|
207
|
+
spend: number;
|
|
208
|
+
viewable_impressions: number;
|
|
209
|
+
video_completions: number;
|
|
210
|
+
conversions: number;
|
|
211
|
+
};
|
|
212
|
+
line_item_breakdown?: Array<{ line_item_id: string; impressions: number; spend: number }>;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const http = createUpstreamHttpClient({
|
|
216
|
+
baseUrl: UPSTREAM_URL,
|
|
217
|
+
auth: { kind: 'static_bearer', token: UPSTREAM_API_KEY },
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
const networkHeader = (networkCode: string) => ({ 'X-Network-Code': networkCode });
|
|
221
|
+
|
|
222
|
+
const upstream = {
|
|
223
|
+
// SWAP: tenant lookup. Mock exposes /_lookup; production typically a
|
|
224
|
+
// network registry / service-account scope endpoint.
|
|
225
|
+
async lookupNetwork(publisherDomain: string): Promise<UpstreamNetwork | null> {
|
|
226
|
+
const { body } = await http.get<UpstreamNetwork>('/_lookup/network', { adcp_publisher: publisherDomain });
|
|
227
|
+
return body;
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
// SWAP: product catalog. Mock filters by network_code via header + optional
|
|
231
|
+
// ?delivery_type. When `flight_start`/`flight_end`/`budget` are passed, the
|
|
232
|
+
// mock returns per-product `forecast` inline — single round-trip instead of
|
|
233
|
+
// N follow-up `/v1/forecast` calls. Real GAM exposes `/networks/{code}/products`
|
|
234
|
+
// for the catalog and `forecastService.getDeliveryForecast` for forecast;
|
|
235
|
+
// adopters whose backend doesn't fold forecast into the catalog response
|
|
236
|
+
// call `getForecast` per product (or in parallel) below.
|
|
237
|
+
async listProducts(
|
|
238
|
+
networkCode: string,
|
|
239
|
+
opts?: {
|
|
240
|
+
deliveryType?: 'guaranteed' | 'non_guaranteed';
|
|
241
|
+
flightStart?: string;
|
|
242
|
+
flightEnd?: string;
|
|
243
|
+
budget?: number;
|
|
244
|
+
}
|
|
245
|
+
): Promise<UpstreamProduct[]> {
|
|
246
|
+
const params: Record<string, string> = {};
|
|
247
|
+
if (opts?.deliveryType) params['delivery_type'] = opts.deliveryType;
|
|
248
|
+
if (opts?.flightStart) params['flight_start'] = opts.flightStart;
|
|
249
|
+
if (opts?.flightEnd) params['flight_end'] = opts.flightEnd;
|
|
250
|
+
if (opts?.budget !== undefined) params['budget'] = String(opts.budget);
|
|
251
|
+
const { body } = await http.get<{ products: UpstreamProduct[] }>(
|
|
252
|
+
'/v1/products',
|
|
253
|
+
params,
|
|
254
|
+
networkHeader(networkCode)
|
|
255
|
+
);
|
|
256
|
+
return body?.products ?? [];
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
// SWAP: per-product forecast. Use this when your backend separates the
|
|
260
|
+
// catalog and forecast surfaces (typical for GAM's `forecastService` vs
|
|
261
|
+
// `inventoryService`). For the worked-mock case we fold forecast into
|
|
262
|
+
// `listProducts` above; this method shows the discrete shape.
|
|
263
|
+
async getForecast(
|
|
264
|
+
networkCode: string,
|
|
265
|
+
body: {
|
|
266
|
+
product_id: string;
|
|
267
|
+
targeting?: Record<string, unknown>;
|
|
268
|
+
flight_dates?: { start?: string; end?: string };
|
|
269
|
+
budget?: number;
|
|
270
|
+
}
|
|
271
|
+
): Promise<UpstreamForecast | null> {
|
|
272
|
+
const r = await http.post<UpstreamForecast>('/v1/forecast', body, networkHeader(networkCode));
|
|
273
|
+
return r.body;
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
// SWAP: list orders.
|
|
277
|
+
async listOrders(networkCode: string): Promise<UpstreamOrder[]> {
|
|
278
|
+
const { body } = await http.get<{ orders: UpstreamOrder[] }>('/v1/orders', undefined, networkHeader(networkCode));
|
|
279
|
+
return body?.orders ?? [];
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
// SWAP: create order. Mock returns 201 with status='pending_approval' +
|
|
283
|
+
// approval_task_id. Real platforms vary; GAM creates an Order in DRAFT
|
|
284
|
+
// and IO signing is handled out-of-band.
|
|
285
|
+
async createOrder(
|
|
286
|
+
networkCode: string,
|
|
287
|
+
body: { name: string; advertiser_id: string; currency: string; budget: number; client_request_id?: string }
|
|
288
|
+
): Promise<UpstreamOrder> {
|
|
289
|
+
const r = await http.post<UpstreamOrder>('/v1/orders', body, networkHeader(networkCode));
|
|
290
|
+
if (r.body === null) {
|
|
291
|
+
throw new AdcpError('INVALID_REQUEST', { message: 'order creation rejected by upstream' });
|
|
292
|
+
}
|
|
293
|
+
return r.body;
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
async getOrder(networkCode: string, orderId: string): Promise<UpstreamOrder | null> {
|
|
297
|
+
const { body } = await http.get<UpstreamOrder>(
|
|
298
|
+
`/v1/orders/${encodeURIComponent(orderId)}`,
|
|
299
|
+
undefined,
|
|
300
|
+
networkHeader(networkCode)
|
|
301
|
+
);
|
|
302
|
+
return body;
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
// SWAP: list line items under an order. Mock's GET /v1/orders/{id} strips
|
|
306
|
+
// line_items from the response — fetch them via this separate call.
|
|
307
|
+
// Real GAM mirrors this split (OrderService vs LineItemService).
|
|
308
|
+
//
|
|
309
|
+
// Note: returns `[]` on null response body. Callers MUST validate the
|
|
310
|
+
// order exists separately (via `getOrder`) before calling — a missing
|
|
311
|
+
// order returns `[]` here rather than throwing, so it would surface as
|
|
312
|
+
// "no packages match" rather than `MEDIA_BUY_NOT_FOUND`. Both
|
|
313
|
+
// `updateMediaBuy` and `getMediaBuys` below pre-validate by calling
|
|
314
|
+
// `getOrder` / `listOrders`, so the existence check has already run.
|
|
315
|
+
async listLineItems(networkCode: string, orderId: string): Promise<NonNullable<UpstreamOrder['line_items']>> {
|
|
316
|
+
const { body } = await http.get<{ line_items: NonNullable<UpstreamOrder['line_items']> }>(
|
|
317
|
+
`/v1/orders/${encodeURIComponent(orderId)}/lineitems`,
|
|
318
|
+
undefined,
|
|
319
|
+
networkHeader(networkCode)
|
|
320
|
+
);
|
|
321
|
+
return body?.line_items ?? [];
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
// SWAP: create line item under an order. Real GAM uses LineItemService.
|
|
325
|
+
async createLineItem(
|
|
326
|
+
networkCode: string,
|
|
327
|
+
orderId: string,
|
|
328
|
+
body: { product_id: string; budget: number; ad_unit_targeting?: string[]; client_request_id?: string }
|
|
329
|
+
): Promise<{ line_item_id: string }> {
|
|
330
|
+
const r = await http.post<{ line_item_id: string }>(
|
|
331
|
+
`/v1/orders/${encodeURIComponent(orderId)}/lineitems`,
|
|
332
|
+
body,
|
|
333
|
+
networkHeader(networkCode)
|
|
334
|
+
);
|
|
335
|
+
if (r.body === null) {
|
|
336
|
+
throw new AdcpError('INVALID_REQUEST', { message: 'line item creation rejected by upstream' });
|
|
337
|
+
}
|
|
338
|
+
return r.body;
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
// SWAP: poll the IO review task. Mock auto-promotes submitted → working →
|
|
342
|
+
// completed after 2 polls. Real platforms expose a similar poll endpoint
|
|
343
|
+
// OR push the result via webhook; mirror whichever your backend uses.
|
|
344
|
+
async getTask(networkCode: string, taskId: string): Promise<UpstreamTask | null> {
|
|
345
|
+
const { body } = await http.get<UpstreamTask>(
|
|
346
|
+
`/v1/tasks/${encodeURIComponent(taskId)}`,
|
|
347
|
+
undefined,
|
|
348
|
+
networkHeader(networkCode)
|
|
349
|
+
);
|
|
350
|
+
return body;
|
|
351
|
+
},
|
|
352
|
+
|
|
353
|
+
async createCreative(
|
|
354
|
+
networkCode: string,
|
|
355
|
+
body: { name: string; format_id: string; advertiser_id: string; client_request_id?: string }
|
|
356
|
+
): Promise<UpstreamCreative> {
|
|
357
|
+
const r = await http.post<UpstreamCreative>('/v1/creatives', body, networkHeader(networkCode));
|
|
358
|
+
if (r.body === null) {
|
|
359
|
+
throw new AdcpError('INVALID_REQUEST', { message: 'creative creation rejected by upstream' });
|
|
360
|
+
}
|
|
361
|
+
return r.body;
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
async getDelivery(networkCode: string, orderId: string): Promise<UpstreamDelivery | null> {
|
|
365
|
+
const { body } = await http.get<UpstreamDelivery>(
|
|
366
|
+
`/v1/orders/${encodeURIComponent(orderId)}/delivery`,
|
|
367
|
+
undefined,
|
|
368
|
+
networkHeader(networkCode)
|
|
369
|
+
);
|
|
370
|
+
return body;
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
// ---------------------------------------------------------------------------
|
|
375
|
+
// AdCP-side adapter — typed against SalesPlatform.
|
|
376
|
+
// ---------------------------------------------------------------------------
|
|
377
|
+
|
|
378
|
+
interface NetworkMeta {
|
|
379
|
+
network_code: string;
|
|
380
|
+
publisher_domain: string;
|
|
381
|
+
[key: string]: unknown;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const FORMAT_AGENT_URL = PUBLIC_AGENT_URL;
|
|
385
|
+
|
|
386
|
+
/** Project upstream product onto AdCP `Product`. The wire `Product` shape
|
|
387
|
+
* has many optional fields; we populate only the ones the storyboard
|
|
388
|
+
* validates plus the bare-minimum required spec fields. Production
|
|
389
|
+
* adopters lift more from their backend (forecast, performance_standards,
|
|
390
|
+
* reporting_capabilities, etc.). */
|
|
391
|
+
function projectProduct(p: UpstreamProduct, publisherDomain: string): Product {
|
|
392
|
+
return {
|
|
393
|
+
product_id: p.product_id,
|
|
394
|
+
name: p.name,
|
|
395
|
+
description: `${p.name} — ${p.delivery_type} ${p.channel}`,
|
|
396
|
+
// publisher_properties is required minItems: 1. Production sellers
|
|
397
|
+
// surface their actual property catalog (per adagents.json). For the
|
|
398
|
+
// worked example we declare the catch-all selector — every property
|
|
399
|
+
// owned by the publisher domain is in scope.
|
|
400
|
+
publisher_properties: [{ publisher_domain: publisherDomain, selection_type: 'all' }],
|
|
401
|
+
channels: [
|
|
402
|
+
p.channel === 'video'
|
|
403
|
+
? 'olv'
|
|
404
|
+
: p.channel === 'ctv'
|
|
405
|
+
? 'ctv'
|
|
406
|
+
: p.channel === 'audio'
|
|
407
|
+
? 'streaming_audio'
|
|
408
|
+
: 'display',
|
|
409
|
+
],
|
|
410
|
+
format_ids: p.format_ids.map(id => ({ agent_url: FORMAT_AGENT_URL, id })),
|
|
411
|
+
delivery_type: p.delivery_type,
|
|
412
|
+
pricing_options: [
|
|
413
|
+
{
|
|
414
|
+
pricing_option_id: 'cpm_guaranteed_fixed',
|
|
415
|
+
pricing_model: 'cpm',
|
|
416
|
+
currency: p.pricing.currency,
|
|
417
|
+
fixed_price: p.pricing.cpm,
|
|
418
|
+
...(p.pricing.min_spend !== undefined && { min_spend: p.pricing.min_spend }),
|
|
419
|
+
},
|
|
420
|
+
],
|
|
421
|
+
reporting_capabilities: {
|
|
422
|
+
available_reporting_frequencies: ['daily'],
|
|
423
|
+
expected_delay_minutes: 240,
|
|
424
|
+
timezone: 'UTC',
|
|
425
|
+
supports_webhooks: false,
|
|
426
|
+
available_metrics: ['impressions', 'clicks', 'spend'],
|
|
427
|
+
date_range_support: 'date_range',
|
|
428
|
+
},
|
|
429
|
+
// Pass through per-query forecast verbatim — mock returns AdCP-shape
|
|
430
|
+
// already (`points`, `metrics.{impressions,reach,frequency,spend}` with
|
|
431
|
+
// `{low,mid,high}`, `forecast_range_unit`, `method`, `currency`). Real
|
|
432
|
+
// GAM responses need adapter-side translation; the mock skips that step
|
|
433
|
+
// intentionally so adopters can see what AdCP-shape forecast looks like
|
|
434
|
+
// without writing the projection first.
|
|
435
|
+
...(p.forecast && { forecast: p.forecast }),
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function mapMediaBuyStatus(
|
|
440
|
+
orderStatus: UpstreamOrder['status']
|
|
441
|
+
): 'pending_creatives' | 'pending_start' | 'active' | 'paused' | 'completed' | 'canceled' {
|
|
442
|
+
switch (orderStatus) {
|
|
443
|
+
case 'delivering':
|
|
444
|
+
return 'active';
|
|
445
|
+
case 'approved':
|
|
446
|
+
return 'pending_start';
|
|
447
|
+
case 'completed':
|
|
448
|
+
return 'completed';
|
|
449
|
+
case 'canceled':
|
|
450
|
+
case 'rejected':
|
|
451
|
+
return 'canceled';
|
|
452
|
+
default:
|
|
453
|
+
// pending_approval / draft both project to pending_creatives — by the
|
|
454
|
+
// time the buyer reads MediaBuy status the upstream has at minimum
|
|
455
|
+
// accepted the order. The HITL-only "pending_approval" upstream state
|
|
456
|
+
// never reaches MediaBuy.status in this adapter because
|
|
457
|
+
// `createMediaBuy` blocks the task envelope until upstream transitions
|
|
458
|
+
// out of pending_approval.
|
|
459
|
+
return 'pending_creatives';
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const sleep = (ms: number) => new Promise<void>(r => setTimeout(r, ms));
|
|
464
|
+
|
|
465
|
+
class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never>, NetworkMeta> {
|
|
466
|
+
capabilities = {
|
|
467
|
+
specialisms: ['sales-guaranteed'] as const,
|
|
468
|
+
channels: ['olv', 'ctv', 'display'] as const,
|
|
469
|
+
pricingModels: ['cpm'] as const,
|
|
470
|
+
config: {},
|
|
471
|
+
// Declares the comply_test_controller surface so the conformance
|
|
472
|
+
// runner picks up `controller_detected: true` and grades missing
|
|
473
|
+
// scenarios as `not_applicable` instead of `failed`. The framework
|
|
474
|
+
// auto-derives the actual `scenarios` list from the `complyTest:`
|
|
475
|
+
// adapter set wired on `createAdcpServerFromPlatform` below.
|
|
476
|
+
compliance_testing: {
|
|
477
|
+
scenarios: ['force_media_buy_status', 'simulate_delivery'] as const,
|
|
478
|
+
},
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
accounts: AccountStore<NetworkMeta> = {
|
|
482
|
+
/** AdCP `account.brand.domain` → upstream `network_code`. The storyboard
|
|
483
|
+
* uses brand.domain, mapped 1:1 onto the mock's `adcp_publisher` field.
|
|
484
|
+
* Production may use account.publisher or a separate auth-derived
|
|
485
|
+
* binding. */
|
|
486
|
+
resolve: async ref => {
|
|
487
|
+
if (!ref) return null;
|
|
488
|
+
// AccountReference discriminated union — see the worked-example notes
|
|
489
|
+
// on the same pattern in hello_seller_adapter_social. The mock has no
|
|
490
|
+
// account_id → network_code index, so the account_id arm is
|
|
491
|
+
// unreachable; production sellers add a directory lookup.
|
|
492
|
+
// SWAP: persist `account_id → network_code` during sync_accounts and
|
|
493
|
+
// serve account_id lookups from there.
|
|
494
|
+
if ('account_id' in ref) return null;
|
|
495
|
+
|
|
496
|
+
// ─── TEST-ONLY: cascade-scenario sandbox-arm ─────────────────────
|
|
497
|
+
// DELETE THIS BLOCK BEFORE DEPLOYING. The compliance runner injects
|
|
498
|
+
// synthetic refs like `{brand: {domain: 'test.example'}, sandbox: true}`
|
|
499
|
+
// for `media_buy_seller/*` cascade scenarios that test wire shape
|
|
500
|
+
// without depending on real test-kit principals. The block routes
|
|
501
|
+
// those synthetic refs to a fixed seeded network so the rest of the
|
|
502
|
+
// adapter has something concrete to operate on. Production sellers
|
|
503
|
+
// either reject sandbox refs entirely or route them to a dedicated
|
|
504
|
+
// sandbox tenant their IO desk owns; either way, this in-example
|
|
505
|
+
// synthesis isn't appropriate for prod traffic.
|
|
506
|
+
//
|
|
507
|
+
// Gate is `ref.sandbox === true` from the wire `AccountReference`
|
|
508
|
+
// (per `core/account-ref.json`). Stamping `mode: 'sandbox'` on the
|
|
509
|
+
// returned `Account` is what admits the framework's
|
|
510
|
+
// `comply_test_controller` gate — see
|
|
511
|
+
// `src/lib/server/decisioning/runtime/from-platform.ts` and
|
|
512
|
+
// `docs/proposals/lifecycle-state-and-sandbox-authority.md`. No env
|
|
513
|
+
// var is consulted; production traffic that doesn't set
|
|
514
|
+
// `sandbox: true` on the wire never hits this branch.
|
|
515
|
+
if (ref.sandbox === true) {
|
|
516
|
+
const sandboxDomain = 'acmeoutdoor.example';
|
|
517
|
+
const network = await upstream.lookupNetwork(sandboxDomain);
|
|
518
|
+
if (!network) return null;
|
|
519
|
+
return {
|
|
520
|
+
id: `${SANDBOX_ID_PREFIX}${network.network_code}`,
|
|
521
|
+
name: `Sandbox: ${network.display_name}`,
|
|
522
|
+
status: 'active',
|
|
523
|
+
mode: 'sandbox',
|
|
524
|
+
...(ref.operator !== undefined && { operator: ref.operator }),
|
|
525
|
+
brand: { domain: ref.brand.domain ?? sandboxDomain },
|
|
526
|
+
ctx_metadata: {
|
|
527
|
+
network_code: network.network_code,
|
|
528
|
+
publisher_domain: network.adcp_publisher,
|
|
529
|
+
},
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
// ─── /TEST-ONLY ──────────────────────────────────────────────────
|
|
533
|
+
|
|
534
|
+
const publisherDomain = ref.brand.domain;
|
|
535
|
+
if (!publisherDomain) return null;
|
|
536
|
+
const network = await upstream.lookupNetwork(publisherDomain);
|
|
537
|
+
if (!network) return null;
|
|
538
|
+
const operator = ref.operator;
|
|
539
|
+
return {
|
|
540
|
+
id: network.network_code,
|
|
541
|
+
name: network.display_name,
|
|
542
|
+
status: 'active',
|
|
543
|
+
...(operator !== undefined && { operator }),
|
|
544
|
+
brand: { domain: network.adcp_publisher },
|
|
545
|
+
ctx_metadata: {
|
|
546
|
+
network_code: network.network_code,
|
|
547
|
+
publisher_domain: network.adcp_publisher,
|
|
548
|
+
},
|
|
549
|
+
};
|
|
550
|
+
},
|
|
551
|
+
|
|
552
|
+
/** sync_accounts handler. Echoes the buyer's account refs back with the
|
|
553
|
+
* resolved upstream network_code. */
|
|
554
|
+
upsert: async refs => {
|
|
555
|
+
const out: SyncAccountsResultRow[] = [];
|
|
556
|
+
for (const ref of refs) {
|
|
557
|
+
// sync_accounts always carries the brand+operator arm — buyer is
|
|
558
|
+
// registering, not referencing.
|
|
559
|
+
if ('account_id' in ref) {
|
|
560
|
+
out.push({
|
|
561
|
+
brand: { domain: '' },
|
|
562
|
+
operator: '',
|
|
563
|
+
action: 'failed',
|
|
564
|
+
status: 'rejected',
|
|
565
|
+
errors: [{ code: 'INVALID_REQUEST', message: 'sync_accounts requires brand+operator, not account_id' }],
|
|
566
|
+
});
|
|
567
|
+
continue;
|
|
568
|
+
}
|
|
569
|
+
const domain = ref.brand.domain;
|
|
570
|
+
const operator = ref.operator;
|
|
571
|
+
const network = domain ? await upstream.lookupNetwork(domain) : null;
|
|
572
|
+
if (!network) {
|
|
573
|
+
out.push({
|
|
574
|
+
brand: { domain },
|
|
575
|
+
operator,
|
|
576
|
+
action: 'failed',
|
|
577
|
+
status: 'rejected',
|
|
578
|
+
errors: [{ code: 'ACCOUNT_NOT_FOUND', message: `No publisher network registered for ${domain}` }],
|
|
579
|
+
});
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
out.push({
|
|
583
|
+
account_id: network.network_code,
|
|
584
|
+
name: network.display_name,
|
|
585
|
+
brand: { domain: network.adcp_publisher },
|
|
586
|
+
operator,
|
|
587
|
+
action: 'unchanged',
|
|
588
|
+
status: 'active',
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
return out;
|
|
592
|
+
},
|
|
593
|
+
|
|
594
|
+
list: async () => {
|
|
595
|
+
const items: Array<Account<NetworkMeta>> = [];
|
|
596
|
+
for (const domain of KNOWN_PUBLISHERS) {
|
|
597
|
+
const n = await upstream.lookupNetwork(domain);
|
|
598
|
+
if (!n) continue;
|
|
599
|
+
items.push({
|
|
600
|
+
id: n.network_code,
|
|
601
|
+
name: n.display_name,
|
|
602
|
+
status: 'active',
|
|
603
|
+
brand: { domain: n.adcp_publisher },
|
|
604
|
+
ctx_metadata: { network_code: n.network_code, publisher_domain: n.adcp_publisher },
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
return { items, has_more: false };
|
|
608
|
+
},
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
// Required: explicit `SalesCorePlatform<Meta> & SalesIngestionPlatform<Meta>`
|
|
612
|
+
// annotation. `defineSalesPlatform` widens to all-optional, and the
|
|
613
|
+
// per-specialism `RequiredPlatformsFor<'sales-guaranteed'>` check rejects
|
|
614
|
+
// a widened literal. The intersection annotation flows the closed shape
|
|
615
|
+
// into the literal so all five core methods stay required at the type
|
|
616
|
+
// level. See `decisioning.type-checks.ts` for the regression-locked
|
|
617
|
+
// patterns.
|
|
618
|
+
sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
|
|
619
|
+
getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsResponse> => {
|
|
620
|
+
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
621
|
+
const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
|
|
622
|
+
// Storyboard sends buying_mode: 'brief' with a free-text brief —
|
|
623
|
+
// production maps to a relevance ranker. The mock returns the full
|
|
624
|
+
// product catalog; we pull guaranteed products to match the
|
|
625
|
+
// sales-guaranteed specialism's value proposition.
|
|
626
|
+
//
|
|
627
|
+
// When the buyer provides structured filters (flight dates, budget),
|
|
628
|
+
// forward them so each product comes back with a per-query
|
|
629
|
+
// DeliveryForecast — a single upstream round-trip surfaces both the
|
|
630
|
+
// catalog and the forecast curve. SWAP: production GAM splits this
|
|
631
|
+
// into `inventoryService` (catalog) + `forecastService.getDeliveryForecast`
|
|
632
|
+
// (per-product forecast). Use the discrete `getForecast` below if
|
|
633
|
+
// your backend can't fold forecast into the catalog response.
|
|
634
|
+
const briefBudget = (req.filters?.budget_range as { max?: number } | undefined)?.max;
|
|
635
|
+
const guaranteed = await upstream.listProducts(networkCode, {
|
|
636
|
+
deliveryType: 'guaranteed',
|
|
637
|
+
...(req.filters?.start_date && { flightStart: req.filters.start_date }),
|
|
638
|
+
...(req.filters?.end_date && { flightEnd: req.filters.end_date }),
|
|
639
|
+
...(briefBudget !== undefined && { budget: briefBudget }),
|
|
640
|
+
});
|
|
641
|
+
return { products: guaranteed.map(p => projectProduct(p, publisherDomain)) };
|
|
642
|
+
},
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* HITL-handoff create_media_buy. Returns `ctx.handoffToTask(fn)`; the
|
|
646
|
+
* buyer gets `{status: 'submitted', task_id}` immediately and the
|
|
647
|
+
* framework runs `fn` in the background. `fn`'s returned
|
|
648
|
+
* `CreateMediaBuySuccess` becomes the task's terminal artifact, which
|
|
649
|
+
* the buyer reads via `tasks_get` polling or the configured webhook.
|
|
650
|
+
*/
|
|
651
|
+
createMediaBuy: async (req: CreateMediaBuyRequest, ctx) => {
|
|
652
|
+
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
653
|
+
// SWAP: production splits network_code (the publisher's tenant) and
|
|
654
|
+
// advertiser_id (the brand seat under that tenant) — they're distinct
|
|
655
|
+
// upstream identifiers. The mock doesn't model the split (every
|
|
656
|
+
// advertiser is owned by the same network), so this worked example
|
|
657
|
+
// collapses both into network_code. Real GAM/FreeWheel/Operative
|
|
658
|
+
// adapters resolve advertiser_id from `req.brand` against the
|
|
659
|
+
// publisher's advertiser directory before issuing the order.
|
|
660
|
+
const advertiserId = networkCode;
|
|
661
|
+
|
|
662
|
+
// Reject aggressive measurement_terms before the buy hits upstream.
|
|
663
|
+
// The storyboard exercises this path and asserts TERMS_REJECTED on
|
|
664
|
+
// the wire. Production sellers branch on viewability / completion-rate
|
|
665
|
+
// / IVT thresholds the platform won't commit to.
|
|
666
|
+
//
|
|
667
|
+
// SWAP: replace these defaults with your IO team's committable maxima.
|
|
668
|
+
const MAX_VIEWABILITY = 0.85;
|
|
669
|
+
const MAX_COMPLETION_RATE = 0.9;
|
|
670
|
+
// Surface the offending package + threshold name + observed value +
|
|
671
|
+
// committable max so the buyer agent can fix the constraint and retry.
|
|
672
|
+
// Opaque "exceed seller commitments" messages get cargo-culted into
|
|
673
|
+
// every adopter's constraint enforcement and produce un-actionable
|
|
674
|
+
// errors at the buyer-agent boundary.
|
|
675
|
+
// The cascade `measurement_terms_rejected` storyboard sends 0% (zero
|
|
676
|
+
// tolerance), which no operator commits to. Threshold lives at module
|
|
677
|
+
// scope above for one-grep tunability.
|
|
678
|
+
const packagesArr = (req.packages ?? []) as Array<{
|
|
679
|
+
measurement_terms?: {
|
|
680
|
+
viewability_threshold?: number;
|
|
681
|
+
completion_rate_threshold?: number;
|
|
682
|
+
billing_measurement?: { max_variance_percent?: number };
|
|
683
|
+
};
|
|
684
|
+
}>;
|
|
685
|
+
for (let i = 0; i < packagesArr.length; i++) {
|
|
686
|
+
const terms = packagesArr[i]?.measurement_terms;
|
|
687
|
+
if (!terms) continue;
|
|
688
|
+
if (typeof terms.viewability_threshold === 'number' && terms.viewability_threshold > MAX_VIEWABILITY) {
|
|
689
|
+
throw new AdcpError('TERMS_REJECTED', {
|
|
690
|
+
message: `packages[${i}].measurement_terms.viewability_threshold = ${terms.viewability_threshold} exceeds maximum committable threshold (${MAX_VIEWABILITY}). Lower to ≤${MAX_VIEWABILITY} or remove the term to retry.`,
|
|
691
|
+
field: `packages[${i}].measurement_terms.viewability_threshold`,
|
|
692
|
+
recovery: 'correctable',
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
if (
|
|
696
|
+
typeof terms.completion_rate_threshold === 'number' &&
|
|
697
|
+
terms.completion_rate_threshold > MAX_COMPLETION_RATE
|
|
698
|
+
) {
|
|
699
|
+
throw new AdcpError('TERMS_REJECTED', {
|
|
700
|
+
message: `packages[${i}].measurement_terms.completion_rate_threshold = ${terms.completion_rate_threshold} exceeds maximum committable threshold (${MAX_COMPLETION_RATE}). Lower to ≤${MAX_COMPLETION_RATE} or remove the term to retry.`,
|
|
701
|
+
field: `packages[${i}].measurement_terms.completion_rate_threshold`,
|
|
702
|
+
recovery: 'correctable',
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
const variance = terms.billing_measurement?.max_variance_percent;
|
|
706
|
+
if (typeof variance === 'number' && variance < MIN_VARIANCE_TOLERANCE) {
|
|
707
|
+
throw new AdcpError('TERMS_REJECTED', {
|
|
708
|
+
message: `packages[${i}].measurement_terms.billing_measurement.max_variance_percent = ${variance} is below the seller's minimum commitment (${MIN_VARIANCE_TOLERANCE}%). Real billing-count divergence between buyer and seller routinely exceeds zero; commit to ≥${MIN_VARIANCE_TOLERANCE}% or remove the term.`,
|
|
709
|
+
field: `packages[${i}].measurement_terms.billing_measurement.max_variance_percent`,
|
|
710
|
+
recovery: 'correctable',
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
const totalBudget =
|
|
716
|
+
req.total_budget?.amount ??
|
|
717
|
+
(req.packages ?? []).reduce((s, p) => s + ((p as { budget?: number }).budget ?? 0), 0);
|
|
718
|
+
const currency = req.total_budget?.currency ?? 'USD';
|
|
719
|
+
|
|
720
|
+
// Create the upstream order eagerly. The mock returns immediately
|
|
721
|
+
// with status: 'pending_approval' + approval_task_id. The buyer
|
|
722
|
+
// never sees this state — we hold the task envelope open until
|
|
723
|
+
// upstream completes IO review.
|
|
724
|
+
const order = await upstream.createOrder(networkCode, {
|
|
725
|
+
name: `MediaBuy from ${req.brand?.domain ?? 'unknown'}`,
|
|
726
|
+
advertiser_id: advertiserId,
|
|
727
|
+
currency,
|
|
728
|
+
budget: totalBudget,
|
|
729
|
+
client_request_id: req.idempotency_key,
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
const packagesRequest = (req.packages ?? []) as Array<{
|
|
733
|
+
product_id?: string;
|
|
734
|
+
budget?: number;
|
|
735
|
+
}>;
|
|
736
|
+
|
|
737
|
+
// Build the synchronous-confirmation flow as a closure so both
|
|
738
|
+
// the HITL handoff path AND the sandbox-direct path can call it.
|
|
739
|
+
// The work is identical; only the wrapper differs.
|
|
740
|
+
const completeIoAndCreateLineItems = async (): Promise<CreateMediaBuySuccess> => {
|
|
741
|
+
// Poll upstream IO task to terminal state. Mock promotes
|
|
742
|
+
// submitted → working → completed across two polls; production
|
|
743
|
+
// platforms vary in cadence. Bound the poll loop so a stuck
|
|
744
|
+
// upstream doesn't keep the AdCP task open indefinitely.
|
|
745
|
+
if (order.approval_task_id) {
|
|
746
|
+
for (let i = 0; i < 10; i++) {
|
|
747
|
+
const task = await upstream.getTask(networkCode, order.approval_task_id);
|
|
748
|
+
if (!task) break;
|
|
749
|
+
if (task.status === 'completed' && task.result?.outcome === 'approved') break;
|
|
750
|
+
if (task.status === 'rejected' || task.result?.outcome === 'rejected') {
|
|
751
|
+
throw new AdcpError('INVALID_REQUEST', {
|
|
752
|
+
message: task.result?.reviewer_note ?? 'IO review rejected the buy',
|
|
753
|
+
recovery: 'terminal',
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
await sleep(50);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// Trigger the upstream order's auto-transition approved → delivering
|
|
761
|
+
// by reading it once. Real platforms publish this transition via
|
|
762
|
+
// status webhooks; the mock advances on GET.
|
|
763
|
+
await upstream.getOrder(networkCode, order.order_id);
|
|
764
|
+
|
|
765
|
+
// Create line items per requested package.
|
|
766
|
+
const packagesOut: CreateMediaBuySuccess['packages'] = [];
|
|
767
|
+
for (let i = 0; i < packagesRequest.length; i++) {
|
|
768
|
+
const pkg = packagesRequest[i];
|
|
769
|
+
if (!pkg) continue;
|
|
770
|
+
if (!pkg.product_id) {
|
|
771
|
+
throw new AdcpError('INVALID_REQUEST', {
|
|
772
|
+
message: `package[${i}]: product_id required`,
|
|
773
|
+
field: `packages[${i}].product_id`,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
const li = await upstream.createLineItem(networkCode, order.order_id, {
|
|
777
|
+
product_id: pkg.product_id,
|
|
778
|
+
budget: pkg.budget ?? 0,
|
|
779
|
+
client_request_id: `${req.idempotency_key}.li.${i}`,
|
|
780
|
+
});
|
|
781
|
+
packagesOut.push({
|
|
782
|
+
package_id: li.line_item_id,
|
|
783
|
+
product_id: pkg.product_id,
|
|
784
|
+
budget: pkg.budget ?? 0,
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// `confirmed_at = now` per the spec (`media-buy.json:24-28` —
|
|
789
|
+
// "ISO 8601 timestamp when the seller confirmed this media buy.
|
|
790
|
+
// A successful create_media_buy response constitutes order
|
|
791
|
+
// confirmation"). The handoff fn's return IS that confirmation.
|
|
792
|
+
//
|
|
793
|
+
// Status is `pending_creatives` (not `active`) until creatives
|
|
794
|
+
// sync. The MediaBuyStatus enum is `pending_creatives | pending_start
|
|
795
|
+
// | active | paused | completed | rejected | canceled` —
|
|
796
|
+
// `pending_creatives` is the right value when the buy is approved
|
|
797
|
+
// but no creatives have been assigned. Buyers transition to
|
|
798
|
+
// `active` after `sync_creatives` lands, which the framework
|
|
799
|
+
// surfaces via `publishStatusChange` on `resource_type: 'media_buy'`.
|
|
800
|
+
// Stamp the buy's lifecycle entry so update_media_buy can enforce
|
|
801
|
+
// the spec's MediaBuyStatus state machine on subsequent patches.
|
|
802
|
+
localBuyStatus.set(order.order_id, 'pending_creatives');
|
|
803
|
+
return {
|
|
804
|
+
media_buy_id: order.order_id,
|
|
805
|
+
status: 'pending_creatives',
|
|
806
|
+
confirmed_at: new Date().toISOString(),
|
|
807
|
+
packages: packagesOut,
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
// ─── TEST-ONLY: HITL bypass for sandbox accounts ─────────────────
|
|
812
|
+
// DELETE THIS BLOCK BEFORE DEPLOYING. The compliance runner expects
|
|
813
|
+
// synchronous `media_buy_id` for `media_buy_seller/*` cascade
|
|
814
|
+
// scenarios (pending_creatives_to_start / inventory_list_* /
|
|
815
|
+
// invalid_transitions / measurement_terms_rejected follow-up); the
|
|
816
|
+
// BASE `sales_guaranteed` storyboard tests the IO-signing async
|
|
817
|
+
// path. Production sellers route every buy through the same path —
|
|
818
|
+
// either always-HITL or always-sync, never both based on a runtime
|
|
819
|
+
// flag.
|
|
820
|
+
//
|
|
821
|
+
// Trust signal is the resolver-stamped `mode: 'sandbox'` on the
|
|
822
|
+
// resolved account (per `Account.mode`, AdCP 6.7+). The synthesis
|
|
823
|
+
// branch in `accounts.resolve` is the only path that stamps it, so
|
|
824
|
+
// a production account whose id happens to share the sandbox prefix
|
|
825
|
+
// would still flow through the HITL path because its mode would be
|
|
826
|
+
// unset (defaults to `'live'`).
|
|
827
|
+
if (getAccountMode(ctx.account) === 'sandbox') {
|
|
828
|
+
return completeIoAndCreateLineItems();
|
|
829
|
+
}
|
|
830
|
+
// ─── /TEST-ONLY ──────────────────────────────────────────────────
|
|
831
|
+
|
|
832
|
+
return ctx.handoffToTask(async (taskCtx): Promise<CreateMediaBuySuccess> => {
|
|
833
|
+
void taskCtx;
|
|
834
|
+
return completeIoAndCreateLineItems();
|
|
835
|
+
});
|
|
836
|
+
},
|
|
837
|
+
|
|
838
|
+
updateMediaBuy: async (buyId: string, patch: UpdateMediaBuyRequest, ctx): Promise<UpdateMediaBuySuccess> => {
|
|
839
|
+
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
840
|
+
// Validate the buy exists before touching it. Storyboard exercises
|
|
841
|
+
// bogus media_buy_id and bogus package_id paths and asserts the
|
|
842
|
+
// wire spec's MEDIA_BUY_NOT_FOUND / PACKAGE_NOT_FOUND error codes.
|
|
843
|
+
const order = await upstream.getOrder(networkCode, buyId);
|
|
844
|
+
if (!order) {
|
|
845
|
+
throw new AdcpError('MEDIA_BUY_NOT_FOUND', {
|
|
846
|
+
message: `Media buy ${buyId} not found`,
|
|
847
|
+
field: 'media_buy_id',
|
|
848
|
+
recovery: 'terminal',
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
if (patch.packages) {
|
|
852
|
+
const lineItems = await upstream.listLineItems(networkCode, buyId);
|
|
853
|
+
const knownPackageIds = new Set(lineItems.map(li => li.line_item_id));
|
|
854
|
+
for (const p of patch.packages) {
|
|
855
|
+
const pid = (p as { package_id?: string }).package_id;
|
|
856
|
+
if (pid && !knownPackageIds.has(pid)) {
|
|
857
|
+
throw new AdcpError('PACKAGE_NOT_FOUND', {
|
|
858
|
+
message: `Package ${pid} not found in media buy ${buyId}`,
|
|
859
|
+
field: 'packages.package_id',
|
|
860
|
+
recovery: 'terminal',
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// State-machine enforcement. Lifecycle states the upstream mock doesn't
|
|
867
|
+
// track (`canceled`, `paused`) live in the local tracker; everything else
|
|
868
|
+
// reads from the upstream order.status mapping. Production sellers swap
|
|
869
|
+
// this for a single durable lookup against their order DB.
|
|
870
|
+
//
|
|
871
|
+
// The spec's `core/state-machine.yaml` declares `canceled` as a sink and
|
|
872
|
+
// a re-cancel as illegal — `assertMediaBuyTransition` throws
|
|
873
|
+
// `NOT_CANCELLABLE` on `canceled → canceled`, which is the
|
|
874
|
+
// `media_buy_seller/invalid_transitions` storyboard's contract.
|
|
875
|
+
const localStatus = localBuyStatus.get(buyId);
|
|
876
|
+
const currentStatus: MediaBuyStatus =
|
|
877
|
+
localStatus === 'canceled' || localStatus === 'paused' ? localStatus : mapMediaBuyStatus(order.status);
|
|
878
|
+
let nextStatus: MediaBuyStatus = currentStatus;
|
|
879
|
+
if ((patch as { canceled?: boolean }).canceled === true) {
|
|
880
|
+
assertMediaBuyTransition(currentStatus, 'canceled');
|
|
881
|
+
nextStatus = 'canceled';
|
|
882
|
+
localBuyStatus.set(buyId, nextStatus);
|
|
883
|
+
} else if ((patch as { paused?: boolean }).paused === true && currentStatus === 'active') {
|
|
884
|
+
assertMediaBuyTransition(currentStatus, 'paused');
|
|
885
|
+
nextStatus = 'paused';
|
|
886
|
+
localBuyStatus.set(buyId, nextStatus);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// Mock doesn't model partial updates; production wires each patch
|
|
890
|
+
// field onto the upstream's OrderService update endpoint. The
|
|
891
|
+
// worked example just echoes success with the post-transition status.
|
|
892
|
+
return {
|
|
893
|
+
media_buy_id: buyId,
|
|
894
|
+
status: nextStatus,
|
|
895
|
+
};
|
|
896
|
+
},
|
|
897
|
+
|
|
898
|
+
getMediaBuys: async (req: GetMediaBuysRequest, ctx): Promise<GetMediaBuysResponse> => {
|
|
899
|
+
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
900
|
+
const orders = await upstream.listOrders(networkCode);
|
|
901
|
+
const filtered = req.media_buy_ids ? orders.filter(o => req.media_buy_ids!.includes(o.order_id)) : orders;
|
|
902
|
+
// Fetch line items per order — mock's GET /v1/orders strips them.
|
|
903
|
+
// Production GAM/FreeWheel similarly splits Order vs LineItem services.
|
|
904
|
+
// SWAP: this is N+1 against the upstream. Real adapters either batch
|
|
905
|
+
// (e.g. POST /v1/lineitems:batchGet with order_ids[]) or accept the
|
|
906
|
+
// round-trip cost. Some platforms expose a `?include=lineitems`
|
|
907
|
+
// query param on the list endpoint that folds them in.
|
|
908
|
+
const buys = await Promise.all(
|
|
909
|
+
filtered.map(async o => {
|
|
910
|
+
const lineItems = await upstream.listLineItems(networkCode, o.order_id);
|
|
911
|
+
return {
|
|
912
|
+
media_buy_id: o.order_id,
|
|
913
|
+
status: mapMediaBuyStatus(o.status),
|
|
914
|
+
currency: o.currency,
|
|
915
|
+
...(o.budget !== undefined && { total_budget: o.budget }),
|
|
916
|
+
confirmed_at: o.updated_at,
|
|
917
|
+
created_at: o.created_at,
|
|
918
|
+
updated_at: o.updated_at,
|
|
919
|
+
packages: lineItems.map(li => ({
|
|
920
|
+
package_id: li.line_item_id,
|
|
921
|
+
product_id: li.product_id,
|
|
922
|
+
budget: li.budget,
|
|
923
|
+
currency: o.currency,
|
|
924
|
+
})),
|
|
925
|
+
};
|
|
926
|
+
})
|
|
927
|
+
);
|
|
928
|
+
return { media_buys: buys };
|
|
929
|
+
},
|
|
930
|
+
|
|
931
|
+
syncCreatives: async (creatives, ctx): Promise<SyncCreativesRow[]> => {
|
|
932
|
+
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
933
|
+
const rows: SyncCreativesRow[] = [];
|
|
934
|
+
for (const c of creatives) {
|
|
935
|
+
try {
|
|
936
|
+
const created = await upstream.createCreative(networkCode, {
|
|
937
|
+
name: c.name,
|
|
938
|
+
format_id: c.format_id.id,
|
|
939
|
+
advertiser_id: networkCode,
|
|
940
|
+
});
|
|
941
|
+
rows.push({
|
|
942
|
+
creative_id: c.creative_id,
|
|
943
|
+
action: 'created',
|
|
944
|
+
status: 'approved',
|
|
945
|
+
platform_id: created.creative_id,
|
|
946
|
+
});
|
|
947
|
+
} catch (err) {
|
|
948
|
+
rows.push({
|
|
949
|
+
creative_id: c.creative_id,
|
|
950
|
+
action: 'failed',
|
|
951
|
+
errors: [
|
|
952
|
+
{
|
|
953
|
+
code: err instanceof AdcpError ? err.code : 'INVALID_REQUEST',
|
|
954
|
+
message: err instanceof Error ? err.message : 'creative sync failed',
|
|
955
|
+
},
|
|
956
|
+
],
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
return rows;
|
|
961
|
+
},
|
|
962
|
+
|
|
963
|
+
getMediaBuyDelivery: async (req: GetMediaBuyDeliveryRequest, ctx): Promise<GetMediaBuyDeliveryResponse> => {
|
|
964
|
+
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
965
|
+
const ids = req.media_buy_ids ?? [];
|
|
966
|
+
const deliveries = await Promise.all(ids.map(id => upstream.getDelivery(networkCode, id)));
|
|
967
|
+
const present = deliveries.filter((d): d is UpstreamDelivery => d !== null);
|
|
968
|
+
|
|
969
|
+
const earliest = present.reduce(
|
|
970
|
+
(acc, d) => (acc < d.reporting_period.start ? acc : d.reporting_period.start),
|
|
971
|
+
present[0]?.reporting_period.start ?? new Date().toISOString()
|
|
972
|
+
);
|
|
973
|
+
const latest = present.reduce(
|
|
974
|
+
(acc, d) => (acc > d.reporting_period.end ? acc : d.reporting_period.end),
|
|
975
|
+
present[0]?.reporting_period.end ?? new Date().toISOString()
|
|
976
|
+
);
|
|
977
|
+
const currency = present[0]?.currency ?? 'USD';
|
|
978
|
+
|
|
979
|
+
const aggregateImpressions = present.reduce((s, d) => s + d.totals.impressions, 0);
|
|
980
|
+
const aggregateSpend = present.reduce((s, d) => s + d.totals.spend, 0);
|
|
981
|
+
const aggregateClicks = present.reduce((s, d) => s + d.totals.clicks, 0);
|
|
982
|
+
|
|
983
|
+
return {
|
|
984
|
+
reporting_period: { start: earliest, end: latest },
|
|
985
|
+
currency,
|
|
986
|
+
aggregated_totals: {
|
|
987
|
+
impressions: aggregateImpressions,
|
|
988
|
+
spend: aggregateSpend,
|
|
989
|
+
clicks: aggregateClicks,
|
|
990
|
+
media_buy_count: present.length,
|
|
991
|
+
},
|
|
992
|
+
media_buy_deliveries: present.map(d => ({
|
|
993
|
+
media_buy_id: d.order_id,
|
|
994
|
+
status: 'active' as const,
|
|
995
|
+
totals: {
|
|
996
|
+
impressions: d.totals.impressions,
|
|
997
|
+
spend: d.totals.spend,
|
|
998
|
+
clicks: d.totals.clicks,
|
|
999
|
+
},
|
|
1000
|
+
// by_package is required even when we don't have per-package
|
|
1001
|
+
// breakdown from upstream — include an empty array OR project
|
|
1002
|
+
// the line-item-level rows the mock returns. Mock's
|
|
1003
|
+
// line_item_breakdown carries impressions+spend per LI.
|
|
1004
|
+
by_package: (d.line_item_breakdown ?? []).map(li => ({
|
|
1005
|
+
package_id: li.line_item_id,
|
|
1006
|
+
impressions: li.impressions,
|
|
1007
|
+
spend: li.spend,
|
|
1008
|
+
})),
|
|
1009
|
+
})),
|
|
1010
|
+
};
|
|
1011
|
+
},
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// ---------------------------------------------------------------------------
|
|
1016
|
+
// Boot
|
|
1017
|
+
// ---------------------------------------------------------------------------
|
|
1018
|
+
|
|
1019
|
+
const platform = new SalesGuaranteedAdapter();
|
|
1020
|
+
const idempotencyStore = createIdempotencyStore({ backend: memoryBackend(), ttlSeconds: 86_400 });
|
|
1021
|
+
|
|
1022
|
+
// ─── TEST-ONLY: in-memory state for comply_test_controller adapters ─────
|
|
1023
|
+
// DELETE THESE MAPS BEFORE DEPLOYING (or scope per-tenant if you keep the
|
|
1024
|
+
// controller wired in a sandbox tenant). Module-scope shared maps leak
|
|
1025
|
+
// state across accounts — that's fine for a worked example whose only
|
|
1026
|
+
// caller is the conformance harness, but unacceptable in production.
|
|
1027
|
+
// SWAP: scope by `account.id` (or your tenant key) and persist via the
|
|
1028
|
+
// same data layer your production handlers read from. The controller
|
|
1029
|
+
// and production tools should share one source of truth for state.
|
|
1030
|
+
const seededMediaBuys = new Map<string, { status: string; revision: number }>();
|
|
1031
|
+
const simulatedDelivery = new Map<
|
|
1032
|
+
string,
|
|
1033
|
+
{ impressions: number; clicks: number; reported_spend: { amount: number; currency: string } }
|
|
1034
|
+
>();
|
|
1035
|
+
// ─── /TEST-ONLY ──────────────────────────────────────────────────────────
|
|
1036
|
+
|
|
1037
|
+
// Local per-buy status tracker for state-machine enforcement on
|
|
1038
|
+
// `update_media_buy`. The mock-server doesn't model lifecycle transitions
|
|
1039
|
+
// (POST /v1/orders/{id} doesn't exist; cancellation is purely an adapter
|
|
1040
|
+
// concern in this worked example). Production sellers track buy state in
|
|
1041
|
+
// their order DB and check `MEDIA_BUY_TRANSITIONS` against the current
|
|
1042
|
+
// status before applying a patch — this Map stands in for that.
|
|
1043
|
+
//
|
|
1044
|
+
// SWAP: replace with a query against your order/lifecycle service. The
|
|
1045
|
+
// `media_buy_seller/invalid_transitions` storyboard exercises NOT_CANCELLABLE
|
|
1046
|
+
// on re-cancel (canceled → canceled is illegal per `core/state-machine.yaml`).
|
|
1047
|
+
type MediaBuyStatus =
|
|
1048
|
+
| 'pending_creatives'
|
|
1049
|
+
| 'pending_start'
|
|
1050
|
+
| 'active'
|
|
1051
|
+
| 'paused'
|
|
1052
|
+
| 'completed'
|
|
1053
|
+
| 'rejected'
|
|
1054
|
+
| 'canceled';
|
|
1055
|
+
const localBuyStatus = new Map<string, MediaBuyStatus>();
|
|
1056
|
+
|
|
1057
|
+
// Persist `packages[].targeting_overlay` from create_media_buy and echo it
|
|
1058
|
+
// on get_media_buys. The seller spec MANDATES this echo for any seller
|
|
1059
|
+
// claiming property-lists / collection-lists, and SHOULD echo any persisted
|
|
1060
|
+
// targeting regardless. SWAP `InMemoryStateStore` for `PostgresStateStore`
|
|
1061
|
+
// in production — in-memory loss after restart silently strips the echo
|
|
1062
|
+
// from buyers who created buys before the bounce.
|
|
1063
|
+
const stateStore = new InMemoryStateStore();
|
|
1064
|
+
const mediaBuyStore = createMediaBuyStore({ store: stateStore });
|
|
1065
|
+
|
|
1066
|
+
serve(
|
|
1067
|
+
({ taskStore }) =>
|
|
1068
|
+
createAdcpServerFromPlatform(platform, {
|
|
1069
|
+
name: 'hello-seller-adapter-guaranteed',
|
|
1070
|
+
version: '1.0.0',
|
|
1071
|
+
taskStore,
|
|
1072
|
+
idempotency: idempotencyStore,
|
|
1073
|
+
mediaBuyStore,
|
|
1074
|
+
resolveSessionKey: ctx => {
|
|
1075
|
+
const acct = ctx.account as Account<NetworkMeta> | undefined;
|
|
1076
|
+
return acct?.id ?? 'anonymous';
|
|
1077
|
+
},
|
|
1078
|
+
// ─── TEST-ONLY: comply_test_controller wiring ──────────────────────
|
|
1079
|
+
// DELETE THIS BLOCK BEFORE DEPLOYING. The conformance runner uses
|
|
1080
|
+
// `comply_test_controller` to seed media-buy fixtures and force
|
|
1081
|
+
// state transitions deterministically across cascade scenarios.
|
|
1082
|
+
// Production sellers don't need this surface — and shouldn't ship
|
|
1083
|
+
// it. Per `examples/comply-controller-seller.ts`, the recommended
|
|
1084
|
+
// production posture is "don't register the controller at all".
|
|
1085
|
+
//
|
|
1086
|
+
// No `sandboxGate` here — the framework gate inside
|
|
1087
|
+
// `createAdcpServerFromPlatform` resolves the calling principal
|
|
1088
|
+
// through `accounts.resolve` and admits only when the resolved
|
|
1089
|
+
// account's `mode` is `'sandbox'` or `'mock'` (per `Account.mode`
|
|
1090
|
+
// in AdCP 6.7+). The synthesis branch in `accounts.resolve` above
|
|
1091
|
+
// stamps `mode: 'sandbox'` on cascade-scenario refs; production
|
|
1092
|
+
// refs flow through the live path with the field unset (default
|
|
1093
|
+
// `'live'`), so the framework gate refuses dispatch for them.
|
|
1094
|
+
// See `docs/proposals/lifecycle-state-and-sandbox-authority.md`.
|
|
1095
|
+
complyTest: {
|
|
1096
|
+
seed: {
|
|
1097
|
+
media_buy: ({ media_buy_id, fixture }) => {
|
|
1098
|
+
const existing = seededMediaBuys.get(media_buy_id);
|
|
1099
|
+
const status = typeof fixture['status'] === 'string' ? (fixture['status'] as string) : 'pending_creatives';
|
|
1100
|
+
seededMediaBuys.set(media_buy_id, { status, revision: existing?.revision ?? 0 });
|
|
1101
|
+
},
|
|
1102
|
+
},
|
|
1103
|
+
force: {
|
|
1104
|
+
media_buy_status: ({ media_buy_id, status, rejection_reason }) => {
|
|
1105
|
+
const buy = seededMediaBuys.get(media_buy_id);
|
|
1106
|
+
const previous = buy?.status ?? 'pending_creatives';
|
|
1107
|
+
seededMediaBuys.set(media_buy_id, { status, revision: (buy?.revision ?? 0) + 1 });
|
|
1108
|
+
void rejection_reason;
|
|
1109
|
+
return { success: true, previous_state: previous, current_state: status };
|
|
1110
|
+
},
|
|
1111
|
+
},
|
|
1112
|
+
simulate: {
|
|
1113
|
+
delivery: ({ media_buy_id, impressions, clicks, reported_spend }) => {
|
|
1114
|
+
const prev = simulatedDelivery.get(media_buy_id) ?? {
|
|
1115
|
+
impressions: 0,
|
|
1116
|
+
clicks: 0,
|
|
1117
|
+
reported_spend: { amount: 0, currency: 'USD' },
|
|
1118
|
+
};
|
|
1119
|
+
simulatedDelivery.set(media_buy_id, {
|
|
1120
|
+
impressions: prev.impressions + (impressions ?? 0),
|
|
1121
|
+
clicks: prev.clicks + (clicks ?? 0),
|
|
1122
|
+
reported_spend: reported_spend ?? prev.reported_spend,
|
|
1123
|
+
});
|
|
1124
|
+
return { success: true, simulated: { media_buy_id, impressions, clicks, reported_spend } };
|
|
1125
|
+
},
|
|
1126
|
+
},
|
|
1127
|
+
},
|
|
1128
|
+
// ─── /TEST-ONLY ──────────────────────────────────────────────────
|
|
1129
|
+
}),
|
|
1130
|
+
{
|
|
1131
|
+
port: PORT,
|
|
1132
|
+
authenticate: verifyApiKey({
|
|
1133
|
+
keys: { [ADCP_AUTH_TOKEN]: { principal: 'compliance-runner' } },
|
|
1134
|
+
}),
|
|
1135
|
+
}
|
|
1136
|
+
);
|
|
1137
|
+
|
|
1138
|
+
console.log(`sales-guaranteed adapter on http://127.0.0.1:${PORT}/mcp · upstream: ${UPSTREAM_URL}`);
|