@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,893 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bootSalesGuaranteed = bootSalesGuaranteed;
|
|
4
|
+
const node_http_1 = require("node:http");
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const seed_data_1 = require("./seed-data");
|
|
7
|
+
async function bootSalesGuaranteed(options) {
|
|
8
|
+
const apiKey = options.apiKey ?? seed_data_1.DEFAULT_API_KEY;
|
|
9
|
+
const networks = options.networks ?? seed_data_1.NETWORKS;
|
|
10
|
+
const adUnits = options.adUnits ?? seed_data_1.AD_UNITS;
|
|
11
|
+
const products = options.products ?? seed_data_1.PRODUCTS;
|
|
12
|
+
const orders = new Map();
|
|
13
|
+
const creatives = new Map();
|
|
14
|
+
const tasks = new Map();
|
|
15
|
+
// Idempotency table — keyed `<network_code>::<resource_kind>::<client_request_id>`.
|
|
16
|
+
const idempotency = new Map();
|
|
17
|
+
// Traffic counters keyed by `<METHOD> <route-template>`. Harness queries
|
|
18
|
+
// `GET /_debug/traffic` after the storyboard run and asserts headline
|
|
19
|
+
// routes were hit ≥1. Façade adapters that skip the upstream produce zero
|
|
20
|
+
// counters and fail the assertion. adcontextprotocol/adcp-client#1225.
|
|
21
|
+
const traffic = new Map();
|
|
22
|
+
const bump = (routeTemplate) => {
|
|
23
|
+
traffic.set(routeTemplate, (traffic.get(routeTemplate) ?? 0) + 1);
|
|
24
|
+
};
|
|
25
|
+
const server = (0, node_http_1.createServer)((req, res) => {
|
|
26
|
+
handleRequest(req, res).catch(err => {
|
|
27
|
+
writeJson(res, 500, { code: 'internal_error', message: err?.message ?? 'unexpected error' });
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
await new Promise((resolve, reject) => {
|
|
31
|
+
server.once('error', reject);
|
|
32
|
+
server.listen(options.port, '127.0.0.1', () => {
|
|
33
|
+
server.removeListener('error', reject);
|
|
34
|
+
resolve();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
const addr = server.address();
|
|
38
|
+
const boundPort = typeof addr === 'object' && addr ? addr.port : options.port;
|
|
39
|
+
const url = `http://127.0.0.1:${boundPort}`;
|
|
40
|
+
return {
|
|
41
|
+
url,
|
|
42
|
+
close: () => new Promise((resolve, reject) => {
|
|
43
|
+
server.close(err => (err ? reject(err) : resolve()));
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
async function handleRequest(req, res) {
|
|
47
|
+
const url = new URL(req.url ?? '/', 'http://127.0.0.1');
|
|
48
|
+
const path = url.pathname;
|
|
49
|
+
const method = req.method ?? 'GET';
|
|
50
|
+
// Façade-detection traffic dump — harness-only, no auth required.
|
|
51
|
+
if (method === 'GET' && path === '/_debug/traffic') {
|
|
52
|
+
writeJson(res, 200, { traffic: Object.fromEntries(traffic) });
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
// Discovery endpoint — replaces the hardcoded principal-mapping table the
|
|
56
|
+
// harness used to inline. Adapters resolve at runtime by querying with
|
|
57
|
+
// the AdCP-side identifier they receive from buyers (`account.publisher`,
|
|
58
|
+
// `account.brand.domain`). No auth required — discovery happens before
|
|
59
|
+
// the agent has any network context. Issue #1225.
|
|
60
|
+
if (method === 'GET' && path === '/_lookup/network') {
|
|
61
|
+
bump('GET /_lookup/network');
|
|
62
|
+
const adcpPublisher = url.searchParams.get('adcp_publisher');
|
|
63
|
+
if (!adcpPublisher) {
|
|
64
|
+
writeJson(res, 400, {
|
|
65
|
+
code: 'invalid_request',
|
|
66
|
+
message: 'adcp_publisher query parameter is required.',
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const match = networks.find(n => n.adcp_publisher === adcpPublisher);
|
|
71
|
+
if (!match) {
|
|
72
|
+
writeJson(res, 404, {
|
|
73
|
+
code: 'network_not_found',
|
|
74
|
+
message: `No upstream network registered for adcp_publisher=${adcpPublisher}.`,
|
|
75
|
+
});
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
writeJson(res, 200, {
|
|
79
|
+
adcp_publisher: match.adcp_publisher,
|
|
80
|
+
network_code: match.network_code,
|
|
81
|
+
display_name: match.display_name,
|
|
82
|
+
});
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const auth = req.headers['authorization'];
|
|
86
|
+
if (!auth || !auth.startsWith('Bearer ') || auth.slice(7) !== apiKey) {
|
|
87
|
+
writeJson(res, 401, { code: 'unauthorized', message: 'Missing or invalid bearer credential.' });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const networkHeader = req.headers['x-network-code'];
|
|
91
|
+
const networkCode = Array.isArray(networkHeader) ? networkHeader[0] : networkHeader;
|
|
92
|
+
if (!networkCode) {
|
|
93
|
+
writeJson(res, 403, {
|
|
94
|
+
code: 'network_required',
|
|
95
|
+
message: 'X-Network-Code header is required on every request.',
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const network = networks.find(n => n.network_code === networkCode);
|
|
100
|
+
if (!network) {
|
|
101
|
+
writeJson(res, 403, { code: 'unknown_network', message: `Unknown network: ${networkCode}` });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (method === 'GET' && path === '/v1/inventory') {
|
|
105
|
+
bump('GET /v1/inventory');
|
|
106
|
+
return handleListInventory(network, res);
|
|
107
|
+
}
|
|
108
|
+
if (method === 'GET' && path === '/v1/products') {
|
|
109
|
+
bump('GET /v1/products');
|
|
110
|
+
return handleListProducts(url, network, res);
|
|
111
|
+
}
|
|
112
|
+
if (method === 'POST' && path === '/v1/forecast') {
|
|
113
|
+
bump('POST /v1/forecast');
|
|
114
|
+
return handleForecast(req, network, res);
|
|
115
|
+
}
|
|
116
|
+
if (method === 'POST' && path === '/v1/availability') {
|
|
117
|
+
bump('POST /v1/availability');
|
|
118
|
+
return handleAvailability(req, network, res);
|
|
119
|
+
}
|
|
120
|
+
if (method === 'GET' && path === '/v1/creatives') {
|
|
121
|
+
bump('GET /v1/creatives');
|
|
122
|
+
return handleListCreatives(network, res);
|
|
123
|
+
}
|
|
124
|
+
if (method === 'POST' && path === '/v1/creatives') {
|
|
125
|
+
bump('POST /v1/creatives');
|
|
126
|
+
return handleCreateCreative(req, network, res);
|
|
127
|
+
}
|
|
128
|
+
if (method === 'GET' && path === '/v1/orders') {
|
|
129
|
+
bump('GET /v1/orders');
|
|
130
|
+
return handleListOrders(network, res);
|
|
131
|
+
}
|
|
132
|
+
if (method === 'POST' && path === '/v1/orders') {
|
|
133
|
+
bump('POST /v1/orders');
|
|
134
|
+
return handleCreateOrder(req, network, res);
|
|
135
|
+
}
|
|
136
|
+
const orderMatch = path.match(/^\/v1\/orders\/([^/]+)(\/.*)?$/);
|
|
137
|
+
if (orderMatch && orderMatch[1]) {
|
|
138
|
+
const orderId = decodeURIComponent(orderMatch[1]);
|
|
139
|
+
const subPath = orderMatch[2] ?? '/';
|
|
140
|
+
const order = orders.get(orderId);
|
|
141
|
+
if (!order || order.network_code !== network.network_code) {
|
|
142
|
+
writeJson(res, 404, { code: 'order_not_found', message: `Order ${orderId} not found.` });
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (method === 'GET' && subPath === '/') {
|
|
146
|
+
bump('GET /v1/orders/{id}');
|
|
147
|
+
return handleGetOrder(order, res);
|
|
148
|
+
}
|
|
149
|
+
if (method === 'GET' && subPath === '/lineitems') {
|
|
150
|
+
bump('GET /v1/orders/{id}/lineitems');
|
|
151
|
+
return handleListLineItems(order, res);
|
|
152
|
+
}
|
|
153
|
+
if (method === 'POST' && subPath === '/lineitems') {
|
|
154
|
+
bump('POST /v1/orders/{id}/lineitems');
|
|
155
|
+
return handleCreateLineItem(req, order, res);
|
|
156
|
+
}
|
|
157
|
+
const liAttachMatch = subPath.match(/^\/lineitems\/([^/]+)\/creative-attach$/);
|
|
158
|
+
if (method === 'POST' && liAttachMatch && liAttachMatch[1]) {
|
|
159
|
+
bump('POST /v1/orders/{id}/lineitems/{li}/creative-attach');
|
|
160
|
+
return handleAttachCreative(req, order, decodeURIComponent(liAttachMatch[1]), res);
|
|
161
|
+
}
|
|
162
|
+
if (method === 'GET' && subPath === '/delivery') {
|
|
163
|
+
bump('GET /v1/orders/{id}/delivery');
|
|
164
|
+
return handleGetDelivery(order, res);
|
|
165
|
+
}
|
|
166
|
+
if (method === 'POST' && subPath === '/conversions') {
|
|
167
|
+
bump('POST /v1/orders/{id}/conversions');
|
|
168
|
+
return handleIngestConversions(req, order, res);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const taskMatch = path.match(/^\/v1\/tasks\/([^/]+)$/);
|
|
172
|
+
if (method === 'GET' && taskMatch && taskMatch[1]) {
|
|
173
|
+
bump('GET /v1/tasks/{id}');
|
|
174
|
+
return handleGetTask(decodeURIComponent(taskMatch[1]), network, res);
|
|
175
|
+
}
|
|
176
|
+
writeJson(res, 404, { code: 'not_found', message: `No route for ${method} ${path}` });
|
|
177
|
+
}
|
|
178
|
+
// ────────────────────────────────────────────────────────────
|
|
179
|
+
// Inventory + Products + Creatives
|
|
180
|
+
// ────────────────────────────────────────────────────────────
|
|
181
|
+
function handleListInventory(network, res) {
|
|
182
|
+
const visible = adUnits.filter(au => au.network_code === network.network_code);
|
|
183
|
+
writeJson(res, 200, { ad_units: visible });
|
|
184
|
+
}
|
|
185
|
+
function handleListProducts(url, network, res) {
|
|
186
|
+
let visible = products.filter(p => p.network_code === network.network_code);
|
|
187
|
+
const deliveryType = url.searchParams.get('delivery_type');
|
|
188
|
+
const channel = url.searchParams.get('channel');
|
|
189
|
+
if (deliveryType)
|
|
190
|
+
visible = visible.filter(p => p.delivery_type === deliveryType);
|
|
191
|
+
if (channel)
|
|
192
|
+
visible = visible.filter(p => p.channel === channel);
|
|
193
|
+
// Per-query forecast embedding. When the caller passes any of
|
|
194
|
+
// `targeting`, `flight_start`, `flight_end`, or `budget`, attach a
|
|
195
|
+
// deterministic-seeded forecast keyed on those inputs so a single
|
|
196
|
+
// get_products call surfaces both the catalog and the forecast curve
|
|
197
|
+
// without a follow-up POST /v1/forecast. Mirrors GAM's
|
|
198
|
+
// `forecastService.getAvailabilityForecast` returning availability inline
|
|
199
|
+
// with product metadata when a brief is supplied.
|
|
200
|
+
const targeting = url.searchParams.get('targeting');
|
|
201
|
+
const flightStart = parseDateParam(url.searchParams.get('flight_start'));
|
|
202
|
+
const flightEnd = parseDateParam(url.searchParams.get('flight_end'));
|
|
203
|
+
const budget = parsePositiveNumber(url.searchParams.get('budget'));
|
|
204
|
+
const hasQuery = Boolean(targeting || flightStart || flightEnd || budget !== undefined);
|
|
205
|
+
if (hasQuery) {
|
|
206
|
+
const dates = { start: flightStart, end: flightEnd };
|
|
207
|
+
const decorated = visible.map(p => ({
|
|
208
|
+
...p,
|
|
209
|
+
forecast: synthForecast(p, { targeting, dates, budget }),
|
|
210
|
+
}));
|
|
211
|
+
writeJson(res, 200, { products: decorated });
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
writeJson(res, 200, { products: visible });
|
|
215
|
+
}
|
|
216
|
+
// ────────────────────────────────────────────────────────────
|
|
217
|
+
// Forecast + availability (GAM-style getDeliveryForecast)
|
|
218
|
+
// ────────────────────────────────────────────────────────────
|
|
219
|
+
async function handleForecast(req, network, res) {
|
|
220
|
+
const body = await readJsonObject(req, res);
|
|
221
|
+
if (!body)
|
|
222
|
+
return;
|
|
223
|
+
const { product_id, targeting, flight_dates, budget } = body;
|
|
224
|
+
if (typeof product_id !== 'string') {
|
|
225
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'product_id is required.' });
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const product = products.find(p => p.product_id === product_id && p.network_code === network.network_code);
|
|
229
|
+
if (!product) {
|
|
230
|
+
writeJson(res, 404, { code: 'product_not_found', message: `Product ${product_id} not found.` });
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const dates = isObject(flight_dates) ? flight_dates : {};
|
|
234
|
+
const targetingKey = serializeTargeting(targeting);
|
|
235
|
+
const forecast = synthForecast(product, {
|
|
236
|
+
targeting: targetingKey,
|
|
237
|
+
dates: {
|
|
238
|
+
start: typeof dates.start === 'string' ? dates.start : undefined,
|
|
239
|
+
end: typeof dates.end === 'string' ? dates.end : undefined,
|
|
240
|
+
},
|
|
241
|
+
budget: typeof budget === 'number' ? budget : undefined,
|
|
242
|
+
});
|
|
243
|
+
writeJson(res, 200, forecast);
|
|
244
|
+
}
|
|
245
|
+
async function handleAvailability(req, network, res) {
|
|
246
|
+
const body = await readJsonObject(req, res);
|
|
247
|
+
if (!body)
|
|
248
|
+
return;
|
|
249
|
+
const { items, dry_run } = body;
|
|
250
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
251
|
+
writeJson(res, 400, {
|
|
252
|
+
code: 'invalid_request',
|
|
253
|
+
message: 'items must be a non-empty array of { product_id, budget?, flight_dates? }.',
|
|
254
|
+
});
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (dry_run === false) {
|
|
258
|
+
writeJson(res, 400, {
|
|
259
|
+
code: 'invalid_request',
|
|
260
|
+
message: 'availability is dry-run only; reservations happen via POST /v1/orders.',
|
|
261
|
+
});
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
// Track cumulative reservations across overlapping line items so the
|
|
265
|
+
// second LI sees reduced inventory when its targeting overlaps the first.
|
|
266
|
+
// Mirrors GAM's getCompetitiveForecast semantics.
|
|
267
|
+
const reservedByProduct = new Map();
|
|
268
|
+
const conflicts = [];
|
|
269
|
+
const results = [];
|
|
270
|
+
for (const raw of items) {
|
|
271
|
+
if (!isObject(raw)) {
|
|
272
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'each item must be an object.' });
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const itemProductId = typeof raw.product_id === 'string' ? raw.product_id : null;
|
|
276
|
+
if (!itemProductId) {
|
|
277
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'each item requires product_id.' });
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const product = products.find(p => p.product_id === itemProductId && p.network_code === network.network_code);
|
|
281
|
+
if (!product) {
|
|
282
|
+
results.push({ product_id: itemProductId, available: false, reason: 'product_not_found' });
|
|
283
|
+
conflicts.push({ product_id: itemProductId, reason: 'product_not_found' });
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
const itemDates = isObject(raw.flight_dates) ? raw.flight_dates : {};
|
|
287
|
+
const itemBudget = typeof raw.budget === 'number' ? raw.budget : undefined;
|
|
288
|
+
const itemTargeting = serializeTargeting(raw.targeting);
|
|
289
|
+
const forecast = synthForecast(product, {
|
|
290
|
+
targeting: itemTargeting,
|
|
291
|
+
dates: {
|
|
292
|
+
start: typeof itemDates.start === 'string' ? itemDates.start : undefined,
|
|
293
|
+
end: typeof itemDates.end === 'string' ? itemDates.end : undefined,
|
|
294
|
+
},
|
|
295
|
+
budget: itemBudget,
|
|
296
|
+
});
|
|
297
|
+
const availabilityPoint = forecast.points.find((pt) => pt.budget === undefined);
|
|
298
|
+
const availableImpressions = availabilityPoint?.metrics.impressions?.mid ?? 0;
|
|
299
|
+
const alreadyReserved = reservedByProduct.get(itemProductId) ?? 0;
|
|
300
|
+
const remaining = Math.max(0, availableImpressions - alreadyReserved);
|
|
301
|
+
const cpmForCalc = product.pricing.cpm > 0 ? product.pricing.cpm : 1;
|
|
302
|
+
const requiredImpressions = itemBudget ? Math.floor((itemBudget / cpmForCalc) * 1000) : 0;
|
|
303
|
+
const fits = requiredImpressions === 0 || remaining >= requiredImpressions;
|
|
304
|
+
if (!fits) {
|
|
305
|
+
conflicts.push({
|
|
306
|
+
product_id: itemProductId,
|
|
307
|
+
reason: `Requested ${requiredImpressions.toLocaleString()} impressions but only ${remaining.toLocaleString()} remain after prior items in this proposal.`,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
reservedByProduct.set(itemProductId, alreadyReserved + requiredImpressions);
|
|
311
|
+
results.push({
|
|
312
|
+
product_id: itemProductId,
|
|
313
|
+
available: fits,
|
|
314
|
+
forecast,
|
|
315
|
+
tier_pricing: tierPricing(product),
|
|
316
|
+
...(itemBudget !== undefined && {
|
|
317
|
+
required_impressions: requiredImpressions,
|
|
318
|
+
remaining_after_prior_items: remaining,
|
|
319
|
+
}),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
writeJson(res, 200, {
|
|
323
|
+
available: conflicts.length === 0,
|
|
324
|
+
items: results,
|
|
325
|
+
...(conflicts.length > 0 && { conflicts }),
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function handleListCreatives(network, res) {
|
|
329
|
+
const list = Array.from(creatives.values()).filter(c => c.network_code === network.network_code);
|
|
330
|
+
writeJson(res, 200, { creatives: list.map(stripBodyFingerprint) });
|
|
331
|
+
}
|
|
332
|
+
async function handleCreateCreative(req, network, res) {
|
|
333
|
+
const body = await readJsonObject(req, res);
|
|
334
|
+
if (!body)
|
|
335
|
+
return;
|
|
336
|
+
const { name, format_id, advertiser_id, snippet, client_request_id } = body;
|
|
337
|
+
if (typeof name !== 'string' || typeof format_id !== 'string' || typeof advertiser_id !== 'string') {
|
|
338
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'name, format_id, advertiser_id are required.' });
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const fingerprint = JSON.stringify({ name, format_id, advertiser_id, snippet });
|
|
342
|
+
const replay = checkIdempotentReplay(network.network_code, 'creative', client_request_id, fingerprint);
|
|
343
|
+
if (replay.kind === 'conflict') {
|
|
344
|
+
writeJson(res, 409, { code: 'idempotency_conflict', message: replay.message });
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
if (replay.kind === 'replay') {
|
|
348
|
+
const existing = creatives.get(replay.id);
|
|
349
|
+
if (existing) {
|
|
350
|
+
writeJson(res, 200, stripBodyFingerprint(existing));
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
const id = `cr_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
355
|
+
const cr = {
|
|
356
|
+
creative_id: id,
|
|
357
|
+
network_code: network.network_code,
|
|
358
|
+
name,
|
|
359
|
+
format_id,
|
|
360
|
+
advertiser_id,
|
|
361
|
+
snippet: typeof snippet === 'string' ? snippet : undefined,
|
|
362
|
+
status: 'active',
|
|
363
|
+
body_fingerprint: fingerprint,
|
|
364
|
+
created_at: new Date().toISOString(),
|
|
365
|
+
};
|
|
366
|
+
creatives.set(id, cr);
|
|
367
|
+
if (typeof client_request_id === 'string' && client_request_id.length > 0) {
|
|
368
|
+
idempotency.set(`${network.network_code}::creative::${client_request_id}`, id);
|
|
369
|
+
}
|
|
370
|
+
writeJson(res, 201, stripBodyFingerprint(cr));
|
|
371
|
+
}
|
|
372
|
+
// ────────────────────────────────────────────────────────────
|
|
373
|
+
// Orders + state machine
|
|
374
|
+
// ────────────────────────────────────────────────────────────
|
|
375
|
+
function handleListOrders(network, res) {
|
|
376
|
+
const list = Array.from(orders.values()).filter(o => o.network_code === network.network_code);
|
|
377
|
+
writeJson(res, 200, { orders: list.map(serializeOrder) });
|
|
378
|
+
}
|
|
379
|
+
async function handleCreateOrder(req, network, res) {
|
|
380
|
+
const body = await readJsonObject(req, res);
|
|
381
|
+
if (!body)
|
|
382
|
+
return;
|
|
383
|
+
const { name, advertiser_id, currency, budget, client_request_id } = body;
|
|
384
|
+
if (typeof name !== 'string' ||
|
|
385
|
+
typeof advertiser_id !== 'string' ||
|
|
386
|
+
typeof currency !== 'string' ||
|
|
387
|
+
typeof budget !== 'number') {
|
|
388
|
+
writeJson(res, 400, {
|
|
389
|
+
code: 'invalid_request',
|
|
390
|
+
message: 'name, advertiser_id, currency, budget are all required.',
|
|
391
|
+
});
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
const fingerprint = JSON.stringify({ name, advertiser_id, currency, budget });
|
|
395
|
+
const replay = checkIdempotentReplay(network.network_code, 'order', client_request_id, fingerprint);
|
|
396
|
+
if (replay.kind === 'conflict') {
|
|
397
|
+
writeJson(res, 409, { code: 'idempotency_conflict', message: replay.message });
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
if (replay.kind === 'replay') {
|
|
401
|
+
const existing = orders.get(replay.id);
|
|
402
|
+
if (existing) {
|
|
403
|
+
writeJson(res, 200, serializeOrder(existing));
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
const id = `ord_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
408
|
+
const taskId = `task_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
409
|
+
const now = new Date().toISOString();
|
|
410
|
+
const order = {
|
|
411
|
+
order_id: id,
|
|
412
|
+
network_code: network.network_code,
|
|
413
|
+
name,
|
|
414
|
+
status: 'pending_approval',
|
|
415
|
+
advertiser_id,
|
|
416
|
+
currency,
|
|
417
|
+
budget,
|
|
418
|
+
approval_task_id: taskId,
|
|
419
|
+
line_items: new Map(),
|
|
420
|
+
conversions: { count: 0, dedup_keys: new Set(), total_value: 0 },
|
|
421
|
+
body_fingerprint: fingerprint,
|
|
422
|
+
created_at: now,
|
|
423
|
+
updated_at: now,
|
|
424
|
+
};
|
|
425
|
+
orders.set(id, order);
|
|
426
|
+
tasks.set(taskId, {
|
|
427
|
+
task_id: taskId,
|
|
428
|
+
order_id: id,
|
|
429
|
+
status: 'submitted',
|
|
430
|
+
poll_count: 0,
|
|
431
|
+
created_at: now,
|
|
432
|
+
updated_at: now,
|
|
433
|
+
});
|
|
434
|
+
if (typeof client_request_id === 'string' && client_request_id.length > 0) {
|
|
435
|
+
idempotency.set(`${network.network_code}::order::${client_request_id}`, id);
|
|
436
|
+
}
|
|
437
|
+
writeJson(res, 201, serializeOrder(order));
|
|
438
|
+
}
|
|
439
|
+
function handleGetOrder(order, res) {
|
|
440
|
+
// Auto-promote pending_approval orders by checking the task. Real
|
|
441
|
+
// platforms rely on a human review workflow; the mock advances on
|
|
442
|
+
// poll counts so adapters exercise the polling pattern without the
|
|
443
|
+
// matrix run dragging.
|
|
444
|
+
if (order.status === 'pending_approval' && order.approval_task_id) {
|
|
445
|
+
const task = tasks.get(order.approval_task_id);
|
|
446
|
+
if (task && task.status === 'completed' && task.result?.outcome === 'approved') {
|
|
447
|
+
order.status = 'approved';
|
|
448
|
+
order.updated_at = new Date().toISOString();
|
|
449
|
+
order.approval_task_id = undefined;
|
|
450
|
+
// Promote any pending line items that have creatives → delivering.
|
|
451
|
+
for (const li of order.line_items.values()) {
|
|
452
|
+
if (li.creative_ids.length > 0 && li.status === 'pending_creatives') {
|
|
453
|
+
li.status = 'delivering';
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
else if (task && task.status === 'rejected') {
|
|
458
|
+
order.status = 'rejected';
|
|
459
|
+
order.rejection_reason = task.result?.reviewer_note ?? 'Order rejected by IO review.';
|
|
460
|
+
order.updated_at = new Date().toISOString();
|
|
461
|
+
order.approval_task_id = undefined;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
if (order.status === 'approved') {
|
|
465
|
+
// After approval, naturally transition to delivering on first GET.
|
|
466
|
+
// Mirrors GAM's auto-activation once IO is signed.
|
|
467
|
+
order.status = 'delivering';
|
|
468
|
+
order.updated_at = new Date().toISOString();
|
|
469
|
+
}
|
|
470
|
+
writeJson(res, 200, serializeOrder(order));
|
|
471
|
+
}
|
|
472
|
+
function handleListLineItems(order, res) {
|
|
473
|
+
writeJson(res, 200, {
|
|
474
|
+
line_items: Array.from(order.line_items.values()).map(stripBodyFingerprint),
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
async function handleCreateLineItem(req, order, res) {
|
|
478
|
+
if (order.status === 'completed' || order.status === 'canceled' || order.status === 'rejected') {
|
|
479
|
+
writeJson(res, 422, {
|
|
480
|
+
code: 'invalid_state_transition',
|
|
481
|
+
message: `Cannot add line items to an order in terminal status: ${order.status}.`,
|
|
482
|
+
});
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
const body = await readJsonObject(req, res);
|
|
486
|
+
if (!body)
|
|
487
|
+
return;
|
|
488
|
+
const { product_id, budget, ad_unit_targeting, client_request_id } = body;
|
|
489
|
+
if (typeof product_id !== 'string' || typeof budget !== 'number') {
|
|
490
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'product_id and budget are required.' });
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
const targeting = Array.isArray(ad_unit_targeting)
|
|
494
|
+
? ad_unit_targeting.filter(x => typeof x === 'string')
|
|
495
|
+
: [];
|
|
496
|
+
const fingerprint = JSON.stringify({ order_id: order.order_id, product_id, budget, ad_unit_targeting: targeting });
|
|
497
|
+
const replay = checkIdempotentReplay(order.network_code, 'lineitem', client_request_id, fingerprint);
|
|
498
|
+
if (replay.kind === 'conflict') {
|
|
499
|
+
writeJson(res, 409, { code: 'idempotency_conflict', message: replay.message });
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
if (replay.kind === 'replay') {
|
|
503
|
+
const existing = order.line_items.get(replay.id);
|
|
504
|
+
if (existing) {
|
|
505
|
+
writeJson(res, 200, stripBodyFingerprint(existing));
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
const id = `li_${(0, node_crypto_1.randomUUID)().replace(/-/g, '').slice(0, 16)}`;
|
|
510
|
+
const li = {
|
|
511
|
+
line_item_id: id,
|
|
512
|
+
order_id: order.order_id,
|
|
513
|
+
product_id,
|
|
514
|
+
status: 'pending_creatives',
|
|
515
|
+
budget,
|
|
516
|
+
ad_unit_targeting: targeting,
|
|
517
|
+
creative_ids: [],
|
|
518
|
+
body_fingerprint: fingerprint,
|
|
519
|
+
created_at: new Date().toISOString(),
|
|
520
|
+
};
|
|
521
|
+
order.line_items.set(id, li);
|
|
522
|
+
if (typeof client_request_id === 'string' && client_request_id.length > 0) {
|
|
523
|
+
idempotency.set(`${order.network_code}::lineitem::${client_request_id}`, id);
|
|
524
|
+
}
|
|
525
|
+
writeJson(res, 201, stripBodyFingerprint(li));
|
|
526
|
+
}
|
|
527
|
+
function handleAttachCreative(req, order, lineItemId, res) {
|
|
528
|
+
void readJsonObject(req, res).then(body => {
|
|
529
|
+
if (!body)
|
|
530
|
+
return;
|
|
531
|
+
const li = order.line_items.get(lineItemId);
|
|
532
|
+
if (!li) {
|
|
533
|
+
writeJson(res, 404, { code: 'line_item_not_found', message: `Line item ${lineItemId} not found.` });
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const { creative_id } = body;
|
|
537
|
+
if (typeof creative_id !== 'string') {
|
|
538
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'creative_id is required.' });
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
if (!li.creative_ids.includes(creative_id))
|
|
542
|
+
li.creative_ids.push(creative_id);
|
|
543
|
+
// Promote the line item to delivering if the order is already approved.
|
|
544
|
+
if (order.status === 'delivering' || order.status === 'approved') {
|
|
545
|
+
li.status = 'delivering';
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
li.status = 'ready';
|
|
549
|
+
}
|
|
550
|
+
writeJson(res, 200, stripBodyFingerprint(li));
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
// ────────────────────────────────────────────────────────────
|
|
554
|
+
// Approval task polling — auto-progress submitted → working → completed
|
|
555
|
+
// ────────────────────────────────────────────────────────────
|
|
556
|
+
function handleGetTask(taskId, network, res) {
|
|
557
|
+
const task = tasks.get(taskId);
|
|
558
|
+
if (!task) {
|
|
559
|
+
writeJson(res, 404, { code: 'task_not_found', message: `Task ${taskId} not found.` });
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
const order = orders.get(task.order_id);
|
|
563
|
+
if (!order || order.network_code !== network.network_code) {
|
|
564
|
+
writeJson(res, 404, { code: 'task_not_found', message: `Task ${taskId} not found.` });
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
task.poll_count++;
|
|
568
|
+
if (task.status === 'submitted' && task.poll_count >= 1) {
|
|
569
|
+
task.status = 'working';
|
|
570
|
+
task.updated_at = new Date().toISOString();
|
|
571
|
+
}
|
|
572
|
+
else if (task.status === 'working' && task.poll_count >= 2) {
|
|
573
|
+
task.status = 'completed';
|
|
574
|
+
task.result = { outcome: 'approved', reviewer_note: 'IO signed; approved for delivery.' };
|
|
575
|
+
task.updated_at = new Date().toISOString();
|
|
576
|
+
}
|
|
577
|
+
writeJson(res, 200, {
|
|
578
|
+
task_id: task.task_id,
|
|
579
|
+
order_id: task.order_id,
|
|
580
|
+
status: task.status,
|
|
581
|
+
result: task.result,
|
|
582
|
+
created_at: task.created_at,
|
|
583
|
+
updated_at: task.updated_at,
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
// ────────────────────────────────────────────────────────────
|
|
587
|
+
// Delivery reporting + CAPI conversion ingestion
|
|
588
|
+
// ────────────────────────────────────────────────────────────
|
|
589
|
+
function handleGetDelivery(order, res) {
|
|
590
|
+
// Synthesize plausible delivery numbers based on order budget and
|
|
591
|
+
// status. Real platforms compute from impression logs; the mock
|
|
592
|
+
// produces stable, deterministic-feeling numbers for storyboard graders.
|
|
593
|
+
const isLive = order.status === 'delivering' || order.status === 'completed';
|
|
594
|
+
const budget = order.budget ?? 50_000;
|
|
595
|
+
const totalSpend = isLive ? Math.min(budget * 0.4, budget) : 0;
|
|
596
|
+
const cpm = 35;
|
|
597
|
+
const impressions = isLive ? Math.floor((totalSpend / cpm) * 1000) : 0;
|
|
598
|
+
const clicks = Math.floor(impressions * 0.0042);
|
|
599
|
+
const viewable = Math.floor(impressions * 0.71);
|
|
600
|
+
const completions = Math.floor(impressions * 0.78);
|
|
601
|
+
writeJson(res, 200, {
|
|
602
|
+
order_id: order.order_id,
|
|
603
|
+
currency: order.currency,
|
|
604
|
+
reporting_period: {
|
|
605
|
+
start: order.created_at,
|
|
606
|
+
end: new Date().toISOString(),
|
|
607
|
+
},
|
|
608
|
+
totals: {
|
|
609
|
+
impressions,
|
|
610
|
+
clicks,
|
|
611
|
+
spend: totalSpend,
|
|
612
|
+
viewable_impressions: viewable,
|
|
613
|
+
video_completions: completions,
|
|
614
|
+
conversions: order.conversions.count,
|
|
615
|
+
},
|
|
616
|
+
line_item_breakdown: Array.from(order.line_items.values()).map(li => ({
|
|
617
|
+
line_item_id: li.line_item_id,
|
|
618
|
+
impressions: Math.floor(impressions / Math.max(1, order.line_items.size)),
|
|
619
|
+
spend: totalSpend / Math.max(1, order.line_items.size),
|
|
620
|
+
})),
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
async function handleIngestConversions(req, order, res) {
|
|
624
|
+
const body = await readJsonObject(req, res);
|
|
625
|
+
if (!body)
|
|
626
|
+
return;
|
|
627
|
+
const { conversions } = body;
|
|
628
|
+
if (!Array.isArray(conversions) || conversions.length === 0) {
|
|
629
|
+
writeJson(res, 400, { code: 'empty_conversions', message: 'conversions must be a non-empty array.' });
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
let received = 0;
|
|
633
|
+
let dedup = 0;
|
|
634
|
+
for (const c of conversions) {
|
|
635
|
+
if (!c || typeof c !== 'object')
|
|
636
|
+
continue;
|
|
637
|
+
const conv = c;
|
|
638
|
+
if (typeof conv.event_name !== 'string' || typeof conv.event_time !== 'number')
|
|
639
|
+
continue;
|
|
640
|
+
const value = typeof conv.value === 'number' ? conv.value : 0;
|
|
641
|
+
const dedupKey = typeof conv.dedup_key === 'string' ? conv.dedup_key : null;
|
|
642
|
+
if (dedupKey && order.conversions.dedup_keys.has(dedupKey)) {
|
|
643
|
+
dedup++;
|
|
644
|
+
continue;
|
|
645
|
+
}
|
|
646
|
+
if (dedupKey)
|
|
647
|
+
order.conversions.dedup_keys.add(dedupKey);
|
|
648
|
+
order.conversions.count++;
|
|
649
|
+
order.conversions.total_value += value;
|
|
650
|
+
received++;
|
|
651
|
+
}
|
|
652
|
+
writeJson(res, 200, {
|
|
653
|
+
order_id: order.order_id,
|
|
654
|
+
events_received: received,
|
|
655
|
+
events_deduplicated: dedup,
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
// ────────────────────────────────────────────────────────────
|
|
659
|
+
// Helpers
|
|
660
|
+
// ────────────────────────────────────────────────────────────
|
|
661
|
+
function checkIdempotentReplay(networkCode, resourceKind, clientRequestId, fingerprint) {
|
|
662
|
+
if (typeof clientRequestId !== 'string' || clientRequestId.length === 0)
|
|
663
|
+
return { kind: 'fresh' };
|
|
664
|
+
const key = `${networkCode}::${resourceKind}::${clientRequestId}`;
|
|
665
|
+
const existingId = idempotency.get(key);
|
|
666
|
+
if (!existingId)
|
|
667
|
+
return { kind: 'fresh' };
|
|
668
|
+
const stored = lookupResource(resourceKind, existingId);
|
|
669
|
+
if (!stored)
|
|
670
|
+
return { kind: 'fresh' };
|
|
671
|
+
if (stored.body_fingerprint !== fingerprint) {
|
|
672
|
+
return {
|
|
673
|
+
kind: 'conflict',
|
|
674
|
+
message: `client_request_id ${clientRequestId} was previously used with a different body. Use a fresh idempotency key for distinct requests.`,
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
return { kind: 'replay', id: existingId };
|
|
678
|
+
}
|
|
679
|
+
function lookupResource(kind, id) {
|
|
680
|
+
if (kind === 'order')
|
|
681
|
+
return orders.get(id);
|
|
682
|
+
if (kind === 'creative')
|
|
683
|
+
return creatives.get(id);
|
|
684
|
+
if (kind === 'lineitem') {
|
|
685
|
+
for (const order of orders.values()) {
|
|
686
|
+
const li = order.line_items.get(id);
|
|
687
|
+
if (li)
|
|
688
|
+
return li;
|
|
689
|
+
}
|
|
690
|
+
return undefined;
|
|
691
|
+
}
|
|
692
|
+
return undefined;
|
|
693
|
+
}
|
|
694
|
+
function serializeOrder(order) {
|
|
695
|
+
const { body_fingerprint, line_items, conversions, ...rest } = order;
|
|
696
|
+
return rest;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function stripBodyFingerprint(record) {
|
|
700
|
+
const { body_fingerprint, ...rest } = record;
|
|
701
|
+
return rest;
|
|
702
|
+
}
|
|
703
|
+
async function readJsonObject(req, res) {
|
|
704
|
+
let body;
|
|
705
|
+
try {
|
|
706
|
+
body = await readJson(req);
|
|
707
|
+
}
|
|
708
|
+
catch {
|
|
709
|
+
writeJson(res, 400, { code: 'invalid_json', message: 'Request body must be valid JSON.' });
|
|
710
|
+
return null;
|
|
711
|
+
}
|
|
712
|
+
if (!body || typeof body !== 'object' || Array.isArray(body)) {
|
|
713
|
+
writeJson(res, 400, { code: 'invalid_request', message: 'Body must be a JSON object.' });
|
|
714
|
+
return null;
|
|
715
|
+
}
|
|
716
|
+
return body;
|
|
717
|
+
}
|
|
718
|
+
function readJson(req) {
|
|
719
|
+
return new Promise((resolve, reject) => {
|
|
720
|
+
const chunks = [];
|
|
721
|
+
req.on('data', c => chunks.push(c));
|
|
722
|
+
req.on('error', reject);
|
|
723
|
+
req.on('end', () => {
|
|
724
|
+
const raw = Buffer.concat(chunks).toString('utf8');
|
|
725
|
+
if (!raw) {
|
|
726
|
+
resolve({});
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
try {
|
|
730
|
+
resolve(JSON.parse(raw));
|
|
731
|
+
}
|
|
732
|
+
catch (err) {
|
|
733
|
+
reject(err);
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
function writeJson(res, status, body) {
|
|
739
|
+
const json = JSON.stringify(body);
|
|
740
|
+
res.writeHead(status, {
|
|
741
|
+
'content-type': 'application/json; charset=utf-8',
|
|
742
|
+
'content-length': Buffer.byteLength(json),
|
|
743
|
+
});
|
|
744
|
+
res.end(json);
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Deterministic forecast generator. Same (product, targeting, dates, budget)
|
|
748
|
+
* inputs always yield the same numbers — storyboard graders can assert exact
|
|
749
|
+
* values without flake. Different targeting hashes produce different
|
|
750
|
+
* availability levels so adapters can demonstrate that targeting actually
|
|
751
|
+
* affects the forecast.
|
|
752
|
+
*/
|
|
753
|
+
function synthForecast(product, query) {
|
|
754
|
+
const seedKey = stableStringify({
|
|
755
|
+
product_id: product.product_id,
|
|
756
|
+
targeting: query.targeting ?? null,
|
|
757
|
+
dates: query.dates,
|
|
758
|
+
});
|
|
759
|
+
const seed = seedFromString(seedKey);
|
|
760
|
+
const baseImpressions = product.availability?.available_impressions ?? 10_000_000;
|
|
761
|
+
// Targeting tightens supply: hash → fraction in [0.35, 0.95].
|
|
762
|
+
const supplyFraction = 0.35 + (seed.next() % 6001) / 10_000;
|
|
763
|
+
const availability = Math.floor(baseImpressions * supplyFraction);
|
|
764
|
+
// Guard against zero-CPM seed entries — would NaN out availabilityCost
|
|
765
|
+
// and the spend-curve tiers below. Real seeds never hit zero, but a
|
|
766
|
+
// misconfigured override would.
|
|
767
|
+
const cpm = product.pricing.cpm > 0 ? product.pricing.cpm : 1;
|
|
768
|
+
const availabilityCost = (availability / 1000) * cpm;
|
|
769
|
+
const reachAvail = Math.floor(availability * 0.42);
|
|
770
|
+
const availabilityPoint = {
|
|
771
|
+
label: 'available inventory',
|
|
772
|
+
metrics: {
|
|
773
|
+
impressions: range(availability, 0.85, 1.1),
|
|
774
|
+
reach: range(reachAvail, 0.85, 1.1),
|
|
775
|
+
frequency: range(availability / Math.max(1, reachAvail), 0.95, 1.05),
|
|
776
|
+
spend: range(availabilityCost, 0.95, 1.05),
|
|
777
|
+
},
|
|
778
|
+
};
|
|
779
|
+
// Spend-curve points. If the caller passed a budget we anchor at it; else
|
|
780
|
+
// we generate three plausible budget tiers under the availability ceiling.
|
|
781
|
+
const anchorBudget = query.budget ?? availabilityCost * 0.5;
|
|
782
|
+
const tiers = [anchorBudget * 0.5, anchorBudget, anchorBudget * 1.5];
|
|
783
|
+
const spendPoints = tiers.map(b => {
|
|
784
|
+
const impressions = Math.min(availability, Math.floor((b / cpm) * 1000));
|
|
785
|
+
const reach = Math.floor(impressions * 0.42);
|
|
786
|
+
return {
|
|
787
|
+
budget: Math.round(b),
|
|
788
|
+
metrics: {
|
|
789
|
+
impressions: range(impressions, 0.9, 1.05),
|
|
790
|
+
reach: range(reach, 0.9, 1.05),
|
|
791
|
+
frequency: range(impressions / Math.max(1, reach), 0.97, 1.03),
|
|
792
|
+
},
|
|
793
|
+
};
|
|
794
|
+
});
|
|
795
|
+
return {
|
|
796
|
+
points: [availabilityPoint, ...spendPoints],
|
|
797
|
+
forecast_range_unit: query.budget !== undefined ? 'spend' : 'availability',
|
|
798
|
+
method: query.budget !== undefined ? 'modeled' : 'guaranteed',
|
|
799
|
+
currency: product.pricing.currency,
|
|
800
|
+
generated_at: '2026-04-01T00:00:00.000Z',
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
function tierPricing(product) {
|
|
804
|
+
// Plausible-feeling, deterministic per-product tiers so the adapter has
|
|
805
|
+
// something concrete to project onto a rate card. Real platforms vary
|
|
806
|
+
// tier composition (daypart, geo, audience); we expose three tiers so the
|
|
807
|
+
// adapter can demonstrate that pricing is not a single scalar.
|
|
808
|
+
const base = product.pricing.cpm;
|
|
809
|
+
return [
|
|
810
|
+
{ tier: 'open', cpm: base, currency: product.pricing.currency },
|
|
811
|
+
{ tier: 'preferred', cpm: roundCpm(base * 1.15), currency: product.pricing.currency },
|
|
812
|
+
{ tier: 'premium', cpm: roundCpm(base * 1.4), currency: product.pricing.currency },
|
|
813
|
+
];
|
|
814
|
+
}
|
|
815
|
+
function roundCpm(n) {
|
|
816
|
+
return Math.round(n * 100) / 100;
|
|
817
|
+
}
|
|
818
|
+
function range(mid, lowFactor, highFactor) {
|
|
819
|
+
return {
|
|
820
|
+
low: Math.max(0, Math.floor(mid * lowFactor)),
|
|
821
|
+
mid: Math.max(0, Math.floor(mid)),
|
|
822
|
+
high: Math.max(0, Math.floor(mid * highFactor)),
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
function isObject(v) {
|
|
826
|
+
return Boolean(v) && typeof v === 'object' && !Array.isArray(v);
|
|
827
|
+
}
|
|
828
|
+
function parsePositiveNumber(raw) {
|
|
829
|
+
if (raw === null || raw === undefined || raw === '')
|
|
830
|
+
return undefined;
|
|
831
|
+
const n = Number(raw);
|
|
832
|
+
return Number.isFinite(n) && n >= 0 ? n : undefined;
|
|
833
|
+
}
|
|
834
|
+
function parseDateParam(raw) {
|
|
835
|
+
if (!raw)
|
|
836
|
+
return undefined;
|
|
837
|
+
// OpenAPI declares `format: date` (YYYY-MM-DD). Tighten beyond `Date.parse`
|
|
838
|
+
// so `?flight_start=2026` (which Date.parse accepts as Jan 1) doesn't hash
|
|
839
|
+
// to a different seed than `?flight_start=2026-01-01`. Storyboards that
|
|
840
|
+
// mix abbreviated and full dates would otherwise produce unstable forecasts.
|
|
841
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(raw))
|
|
842
|
+
return undefined;
|
|
843
|
+
return Number.isFinite(Date.parse(raw)) ? raw : undefined;
|
|
844
|
+
}
|
|
845
|
+
function serializeTargeting(t) {
|
|
846
|
+
if (t === null || t === undefined)
|
|
847
|
+
return null;
|
|
848
|
+
if (typeof t === 'string')
|
|
849
|
+
return t;
|
|
850
|
+
try {
|
|
851
|
+
return stableStringify(t);
|
|
852
|
+
}
|
|
853
|
+
catch {
|
|
854
|
+
return null;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Recursive deterministic JSON stringifier — sorts object keys at every
|
|
859
|
+
* depth so two equivalent payloads with different key insertion orders
|
|
860
|
+
* hash identically. Plain `JSON.stringify(t, keys.sort())` only sorts the
|
|
861
|
+
* top level AND treats the array as a key allowlist (silently dropping
|
|
862
|
+
* nested fields).
|
|
863
|
+
*/
|
|
864
|
+
function stableStringify(v) {
|
|
865
|
+
if (v === null || typeof v !== 'object')
|
|
866
|
+
return JSON.stringify(v);
|
|
867
|
+
if (Array.isArray(v))
|
|
868
|
+
return `[${v.map(stableStringify).join(',')}]`;
|
|
869
|
+
const obj = v;
|
|
870
|
+
const keys = Object.keys(obj).sort();
|
|
871
|
+
const parts = keys.map(k => `${JSON.stringify(k)}:${stableStringify(obj[k])}`);
|
|
872
|
+
return `{${parts.join(',')}}`;
|
|
873
|
+
}
|
|
874
|
+
function seedFromString(key) {
|
|
875
|
+
// SHA-256 → consume 4-byte windows as uint32 stream. Stable across Node
|
|
876
|
+
// versions; storyboards assert exact forecast numbers.
|
|
877
|
+
const digest = (0, node_crypto_1.createHash)('sha256').update(key).digest();
|
|
878
|
+
let offset = 0;
|
|
879
|
+
return {
|
|
880
|
+
next: () => {
|
|
881
|
+
if (offset + 4 > digest.length) {
|
|
882
|
+
// Re-hash to extend the stream if a caller exhausts it.
|
|
883
|
+
const extended = (0, node_crypto_1.createHash)('sha256').update(digest).digest();
|
|
884
|
+
digest.set(extended);
|
|
885
|
+
offset = 0;
|
|
886
|
+
}
|
|
887
|
+
const v = digest.readUInt32BE(offset);
|
|
888
|
+
offset += 4;
|
|
889
|
+
return v;
|
|
890
|
+
},
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
//# sourceMappingURL=server.js.map
|