@adcp/sdk 12.1.0 → 13.0.0-rc.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/README.md +19 -3
- package/bin/adcp-fuzz.js +3 -1
- package/dist/lib/adapters/content-standards-adapter.d.mts +9 -9
- package/dist/lib/adapters/content-standards-adapter.d.ts +9 -9
- package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
- package/dist/lib/adapters/content-standards-adapter.js +22 -22
- package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
- package/dist/lib/adapters/content-standards-adapter.mjs +18 -18
- package/dist/lib/adapters/content-standards-adapter.mjs.map +1 -1
- package/dist/lib/adapters/index.d.mts +2 -2
- package/dist/lib/adapters/index.d.ts +2 -2
- package/dist/lib/adapters/index.d.ts.map +1 -1
- package/dist/lib/adapters/index.js +10 -10
- package/dist/lib/adapters/index.js.map +1 -1
- package/dist/lib/adapters/index.mjs +9 -9
- package/dist/lib/adapters/index.mjs.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.d.mts +3 -0
- package/dist/lib/auth/oauth/authorization-required.d.ts +3 -0
- package/dist/lib/auth/oauth/authorization-required.d.ts.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.js +12 -9
- package/dist/lib/auth/oauth/authorization-required.js.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.mjs +12 -9
- package/dist/lib/auth/oauth/authorization-required.mjs.map +1 -1
- package/dist/lib/auth/oauth/provider-cache.d.mts +7 -0
- package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
- package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
- package/dist/lib/auth/oauth/provider-cache.js +44 -0
- package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
- package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
- package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
- package/dist/lib/conformance/invariants/uniformError.js +1 -1
- package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
- package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
- package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
- package/dist/lib/conformance/runners.js +1 -1
- package/dist/lib/conformance/runners.js.map +1 -1
- package/dist/lib/conformance/runners.mjs +1 -1
- package/dist/lib/conformance/runners.mjs.map +1 -1
- package/dist/lib/conformance/seeder.js +5 -5
- package/dist/lib/conformance/seeder.js.map +1 -1
- package/dist/lib/conformance/seeder.mjs +5 -5
- package/dist/lib/conformance/seeder.mjs.map +1 -1
- package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
- package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
- package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
- package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
- package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
- package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
- package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
- package/dist/lib/core/AgentClient.d.mts +148 -138
- package/dist/lib/core/AgentClient.d.ts +148 -138
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/AgentClient.js +174 -85
- package/dist/lib/core/AgentClient.js.map +1 -1
- package/dist/lib/core/AgentClient.mjs +174 -85
- package/dist/lib/core/AgentClient.mjs.map +1 -1
- package/dist/lib/core/AsyncHandler.d.mts +18 -16
- package/dist/lib/core/AsyncHandler.d.ts +18 -16
- package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
- package/dist/lib/core/AsyncHandler.js +22 -1
- package/dist/lib/core/AsyncHandler.js.map +1 -1
- package/dist/lib/core/AsyncHandler.mjs +22 -1
- package/dist/lib/core/AsyncHandler.mjs.map +1 -1
- package/dist/lib/core/ConversationTypes.d.mts +6 -2
- package/dist/lib/core/ConversationTypes.d.ts +6 -2
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/ConversationTypes.js.map +1 -1
- package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
- package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
- package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
- package/dist/lib/core/CreativeAgentClient.js +39 -12
- package/dist/lib/core/CreativeAgentClient.js.map +1 -1
- package/dist/lib/core/CreativeAgentClient.mjs +39 -12
- package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +129 -52
- package/dist/lib/core/SingleAgentClient.d.ts +129 -52
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +1748 -218
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/SingleAgentClient.mjs +1758 -218
- package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
- package/dist/lib/core/TaskExecutor.d.mts +9 -0
- package/dist/lib/core/TaskExecutor.d.ts +9 -0
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +137 -44
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/core/TaskExecutor.mjs +137 -44
- package/dist/lib/core/TaskExecutor.mjs.map +1 -1
- package/dist/lib/index.d.mts +111 -17
- package/dist/lib/index.d.ts +111 -17
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +94 -94
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +93 -94
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/net/ssrf-fetch.d.mts +13 -1
- package/dist/lib/net/ssrf-fetch.d.ts +13 -1
- package/dist/lib/net/ssrf-fetch.d.ts.map +1 -1
- package/dist/lib/net/ssrf-fetch.js +14 -7
- package/dist/lib/net/ssrf-fetch.js.map +1 -1
- package/dist/lib/net/ssrf-fetch.mjs +14 -7
- package/dist/lib/net/ssrf-fetch.mjs.map +1 -1
- package/dist/lib/protocols/a2a.d.mts +2 -2
- package/dist/lib/protocols/a2a.d.ts +2 -2
- package/dist/lib/protocols/a2a.d.ts.map +1 -1
- package/dist/lib/protocols/a2a.js +14 -9
- package/dist/lib/protocols/a2a.js.map +1 -1
- package/dist/lib/protocols/a2a.mjs +14 -9
- package/dist/lib/protocols/a2a.mjs.map +1 -1
- package/dist/lib/protocols/index.d.mts +20 -3
- package/dist/lib/protocols/index.d.ts +20 -3
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +44 -31
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/protocols/index.mjs +44 -32
- package/dist/lib/protocols/index.mjs.map +1 -1
- package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
- package/dist/lib/protocols/mcp-modern.js +87 -12
- package/dist/lib/protocols/mcp-modern.js.map +1 -1
- package/dist/lib/protocols/mcp-modern.mjs +89 -12
- package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
- package/dist/lib/protocols/mcp-tasks.d.mts +3 -0
- package/dist/lib/protocols/mcp-tasks.d.ts +3 -0
- package/dist/lib/protocols/mcp-tasks.d.ts.map +1 -1
- package/dist/lib/protocols/mcp-tasks.js +21 -11
- package/dist/lib/protocols/mcp-tasks.js.map +1 -1
- package/dist/lib/protocols/mcp-tasks.mjs +21 -11
- package/dist/lib/protocols/mcp-tasks.mjs.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.d.mts +6 -0
- package/dist/lib/server/create-adcp-server.d.ts +6 -0
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +295 -48
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/create-adcp-server.mjs +301 -50
- package/dist/lib/server/create-adcp-server.mjs.map +1 -1
- package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
- package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
- package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
- package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
- package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
- package/dist/lib/server/decisioning/index.d.mts +13 -12
- package/dist/lib/server/decisioning/index.d.ts +13 -12
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +6 -0
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/index.mjs +9 -3
- package/dist/lib/server/decisioning/index.mjs.map +1 -1
- package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
- package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
- package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/list-helpers.js +13 -3
- package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
- package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
- package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
- package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
- package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
- package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
- package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
- package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
- package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
- package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
- package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
- package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
- package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
- package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
- package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
- package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
- package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
- package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
- package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
- package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
- package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
- package/dist/lib/server/index.d.mts +3 -3
- package/dist/lib/server/index.d.ts +3 -3
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js +72 -72
- package/dist/lib/server/index.js.map +1 -1
- package/dist/lib/server/index.mjs +36 -36
- package/dist/lib/server/index.mjs.map +1 -1
- package/dist/lib/server/legacy/v5/index.d.mts +1 -0
- package/dist/lib/server/legacy/v5/index.d.ts +1 -0
- package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
- package/dist/lib/server/legacy/v5/index.js +74 -1
- package/dist/lib/server/legacy/v5/index.js.map +1 -1
- package/dist/lib/server/legacy/v5/index.mjs +75 -1
- package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
- package/dist/lib/server/responses.d.mts +2 -2
- package/dist/lib/server/responses.d.ts +2 -2
- package/dist/lib/server/responses.js.map +1 -1
- package/dist/lib/server/responses.mjs.map +1 -1
- package/dist/lib/testing/client.d.ts.map +1 -1
- package/dist/lib/testing/client.js +13 -5
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/client.mjs +13 -5
- package/dist/lib/testing/client.mjs.map +1 -1
- package/dist/lib/testing/compliance/comply.d.mts +1 -1
- package/dist/lib/testing/compliance/comply.d.ts +1 -1
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +16 -6
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/comply.mjs +16 -6
- package/dist/lib/testing/compliance/comply.mjs.map +1 -1
- package/dist/lib/testing/scenarios/brand-rights.js +6 -6
- package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
- package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
- package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
- package/dist/lib/testing/scenarios/creative.js +7 -7
- package/dist/lib/testing/scenarios/creative.js.map +1 -1
- package/dist/lib/testing/scenarios/creative.mjs +7 -7
- package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
- package/dist/lib/testing/scenarios/discovery.js +2 -2
- package/dist/lib/testing/scenarios/discovery.js.map +1 -1
- package/dist/lib/testing/scenarios/discovery.mjs +2 -2
- package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
- package/dist/lib/testing/scenarios/edge-cases.js +11 -11
- package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
- package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
- package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
- package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/governance.js +16 -22
- package/dist/lib/testing/scenarios/governance.js.map +1 -1
- package/dist/lib/testing/scenarios/governance.mjs +16 -22
- package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.js +5 -5
- package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
- package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
- package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/trusted-match.js +4 -3
- package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
- package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
- package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
- package/dist/lib/testing/storyboard/probes.d.mts +6 -0
- package/dist/lib/testing/storyboard/probes.d.ts +6 -0
- package/dist/lib/testing/storyboard/probes.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/probes.js +16 -5
- package/dist/lib/testing/storyboard/probes.js.map +1 -1
- package/dist/lib/testing/storyboard/probes.mjs +16 -5
- package/dist/lib/testing/storyboard/probes.mjs.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +6 -2
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.mjs +6 -2
- package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
- package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
- package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
- package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
- package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
- package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
- package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
- package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/task-map.js +43 -5
- package/dist/lib/testing/storyboard/task-map.js.map +1 -1
- package/dist/lib/testing/storyboard/task-map.mjs +43 -5
- package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
- package/dist/lib/testing/test-helpers.d.mts +2 -2
- package/dist/lib/testing/test-helpers.d.ts +2 -2
- package/dist/lib/testing/test-helpers.js.map +1 -1
- package/dist/lib/testing/test-helpers.mjs.map +1 -1
- package/dist/lib/testing/types.d.mts +7 -1
- package/dist/lib/testing/types.d.ts +7 -1
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/testing/types.js.map +1 -1
- package/dist/lib/types/adcp.d.mts +14 -14
- package/dist/lib/types/adcp.d.ts +14 -14
- package/dist/lib/types/adcp.d.ts.map +1 -1
- package/dist/lib/types/adcp.js.map +1 -1
- package/dist/lib/types/adcp.mjs.map +1 -1
- package/dist/lib/types/index.d.mts +2 -2
- package/dist/lib/types/index.d.ts +2 -2
- package/dist/lib/types/index.d.ts.map +1 -1
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/index.mjs.map +1 -1
- package/dist/lib/utils/capabilities.d.mts +6 -0
- package/dist/lib/utils/capabilities.d.ts +6 -0
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +4 -0
- package/dist/lib/utils/capabilities.js.map +1 -1
- package/dist/lib/utils/capabilities.mjs +4 -0
- package/dist/lib/utils/capabilities.mjs.map +1 -1
- package/dist/lib/utils/creative-delivery.d.mts +52 -10
- package/dist/lib/utils/creative-delivery.d.ts +52 -10
- package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
- package/dist/lib/utils/creative-delivery.js +104 -9
- package/dist/lib/utils/creative-delivery.js.map +1 -1
- package/dist/lib/utils/creative-delivery.mjs +104 -8
- package/dist/lib/utils/creative-delivery.mjs.map +1 -1
- package/dist/lib/utils/format-assets.d.mts +41 -38
- package/dist/lib/utils/format-assets.d.ts +41 -38
- package/dist/lib/utils/format-assets.d.ts.map +1 -1
- package/dist/lib/utils/format-assets.js +3 -1
- package/dist/lib/utils/format-assets.js.map +1 -1
- package/dist/lib/utils/format-assets.mjs +3 -1
- package/dist/lib/utils/format-assets.mjs.map +1 -1
- package/dist/lib/utils/index.d.mts +8 -8
- package/dist/lib/utils/index.d.ts +8 -8
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +11 -9
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/utils/index.mjs +9 -8
- package/dist/lib/utils/index.mjs.map +1 -1
- package/dist/lib/utils/preview-utils.d.mts +11 -8
- package/dist/lib/utils/preview-utils.d.ts +11 -8
- package/dist/lib/utils/preview-utils.d.ts.map +1 -1
- package/dist/lib/utils/preview-utils.js +4 -4
- package/dist/lib/utils/preview-utils.js.map +1 -1
- package/dist/lib/utils/preview-utils.mjs +3 -3
- package/dist/lib/utils/preview-utils.mjs.map +1 -1
- package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
- package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
- package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
- package/dist/lib/v2/projection/augment-response.d.mts +31 -11
- package/dist/lib/v2/projection/augment-response.d.ts +31 -11
- package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
- package/dist/lib/v2/projection/augment-response.js +233 -27
- package/dist/lib/v2/projection/augment-response.js.map +1 -1
- package/dist/lib/v2/projection/augment-response.mjs +232 -27
- package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
- package/dist/lib/v2/projection/builders.d.mts +7 -6
- package/dist/lib/v2/projection/builders.d.ts +7 -6
- package/dist/lib/v2/projection/builders.d.ts.map +1 -1
- package/dist/lib/v2/projection/builders.js +11 -8
- package/dist/lib/v2/projection/builders.js.map +1 -1
- package/dist/lib/v2/projection/builders.mjs +9 -6
- package/dist/lib/v2/projection/builders.mjs.map +1 -1
- package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
- package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
- package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
- package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
- package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
- package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
- package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
- package/dist/lib/v2/projection/catalog.d.mts +23 -2
- package/dist/lib/v2/projection/catalog.d.ts +23 -2
- package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
- package/dist/lib/v2/projection/catalog.js +34 -10
- package/dist/lib/v2/projection/catalog.js.map +1 -1
- package/dist/lib/v2/projection/catalog.mjs +33 -10
- package/dist/lib/v2/projection/catalog.mjs.map +1 -1
- package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
- package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
- package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
- package/dist/lib/v2/projection/creative-delivery.js +967 -0
- package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
- package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
- package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
- package/dist/lib/v2/projection/index.d.mts +8 -6
- package/dist/lib/v2/projection/index.d.ts +8 -6
- package/dist/lib/v2/projection/index.d.ts.map +1 -1
- package/dist/lib/v2/projection/index.js +26 -4
- package/dist/lib/v2/projection/index.js.map +1 -1
- package/dist/lib/v2/projection/index.mjs +28 -4
- package/dist/lib/v2/projection/index.mjs.map +1 -1
- package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
- package/dist/lib/v2/projection/legacy-metadata.js +73 -0
- package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
- package/dist/lib/v2/projection/types.d.mts +29 -23
- package/dist/lib/v2/projection/types.d.ts +29 -23
- package/dist/lib/v2/projection/types.d.ts.map +1 -1
- package/dist/lib/v2/projection/types.js.map +1 -1
- package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
- package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
- package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
- package/dist/lib/v2/projection/v1-to-v2.js +218 -9
- package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
- package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
- package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
- package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
- package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
- package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
- package/dist/lib/v2/projection/v2-to-v1.js +138 -7
- package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
- package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
- package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
- package/dist/lib/v2/projection/write-side.d.mts +12 -13
- package/dist/lib/v2/projection/write-side.d.ts +12 -13
- package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
- package/dist/lib/v2/projection/write-side.js +16 -12
- package/dist/lib/v2/projection/write-side.js.map +1 -1
- package/dist/lib/v2/projection/write-side.mjs +16 -12
- package/dist/lib/v2/projection/write-side.mjs.map +1 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.js.map +1 -1
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/version.mjs.map +1 -1
- package/docs/guides/BUILD-AN-AGENT.md +7 -2
- package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
- package/docs/llms.txt +1 -0
- package/examples/README.md +1 -1
- package/examples/batch-preview-test.ts +3 -3
- package/examples/conversation-client.ts +2 -2
- package/examples/debug-preview-response.ts +1 -1
- package/examples/decisioning-platform-broadcast-tv.ts +10 -4
- package/examples/decisioning-platform-mock-seller.ts +16 -9
- package/examples/decisioning-platform-programmatic.ts +18 -7
- package/examples/error-compliant-server.ts +26 -16
- package/examples/generative-creative-demo.ts +7 -19
- package/examples/hello_creative_adapter_ad_server.ts +37 -16
- package/examples/hello_creative_adapter_template.ts +12 -10
- package/examples/hello_seller_adapter_guaranteed.ts +52 -23
- package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
- package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
- package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
- package/examples/hello_seller_adapter_social.ts +2 -7
- package/examples/inspect-card-formats.ts +1 -1
- package/examples/simple-getting-started.ts +1 -1
- package/examples/test-helpers-demo.ts +1 -1
- package/package.json +2 -2
- package/skills/build-decisioning-creative-template/SKILL.md +11 -11
- package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
|
@@ -6,6 +6,95 @@ const DEFAULT_REPORTING_CAPABILITIES = {
|
|
|
6
6
|
available_metrics: ["impressions", "spend", "clicks"],
|
|
7
7
|
date_range_support: "date_range"
|
|
8
8
|
};
|
|
9
|
+
const CANONICAL_PRODUCT_RESERVED_EXTRA_KEYS = /* @__PURE__ */ new Set([
|
|
10
|
+
"product_id",
|
|
11
|
+
"name",
|
|
12
|
+
"description",
|
|
13
|
+
"publisher_properties",
|
|
14
|
+
"format_options",
|
|
15
|
+
"format_ids",
|
|
16
|
+
"delivery_type",
|
|
17
|
+
"pricing_options",
|
|
18
|
+
"reporting_capabilities",
|
|
19
|
+
"channels",
|
|
20
|
+
"ctx_metadata"
|
|
21
|
+
]);
|
|
22
|
+
function assertCanonicalProductExtra(extra) {
|
|
23
|
+
if (!extra) return;
|
|
24
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
25
|
+
const visit = (value, path, root) => {
|
|
26
|
+
if (value === null || typeof value !== "object" || seen.has(value)) return;
|
|
27
|
+
seen.add(value);
|
|
28
|
+
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
|
|
29
|
+
if (key === "toJSON") {
|
|
30
|
+
throw new Error(`buildProduct: extra.${path}${key} is not allowed on canonical product data`);
|
|
31
|
+
}
|
|
32
|
+
if (!descriptor.enumerable) continue;
|
|
33
|
+
if (!("value" in descriptor)) {
|
|
34
|
+
throw new Error(`buildProduct: extra.${path}${key} must be a data property, not an accessor`);
|
|
35
|
+
}
|
|
36
|
+
if (typeof descriptor.value === "function") {
|
|
37
|
+
throw new Error(`buildProduct: extra.${path}${key} must not be callable`);
|
|
38
|
+
}
|
|
39
|
+
if (root && CANONICAL_PRODUCT_RESERVED_EXTRA_KEYS.has(key)) {
|
|
40
|
+
throw new Error(`buildProduct: extra.${key} cannot override a canonical product field`);
|
|
41
|
+
}
|
|
42
|
+
if (key === "agent_url" || /(^|_)(?:format_ids?|v1_format_ref)($|_)/.test(key)) {
|
|
43
|
+
throw new Error(`buildProduct: extra.${path}${key} contains legacy creative identity`);
|
|
44
|
+
}
|
|
45
|
+
visit(descriptor.value, `${path}${key}.`, false);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
visit(extra, "", true);
|
|
49
|
+
}
|
|
50
|
+
function cloneCanonicalProductData(value, path, active = /* @__PURE__ */ new WeakSet()) {
|
|
51
|
+
if (typeof value === "function") throw new Error(`buildProduct: ${path} must not be callable`);
|
|
52
|
+
if (value === null || typeof value !== "object") return value;
|
|
53
|
+
if (active.has(value)) throw new Error(`buildProduct: ${path} must not contain cycles`);
|
|
54
|
+
active.add(value);
|
|
55
|
+
try {
|
|
56
|
+
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
57
|
+
if (Array.isArray(value)) {
|
|
58
|
+
const clone2 = [];
|
|
59
|
+
for (const [key, descriptor] of Object.entries(descriptors)) {
|
|
60
|
+
if (key === "toJSON") {
|
|
61
|
+
throw new Error(`buildProduct: ${path}.${key} is not allowed on canonical product data`);
|
|
62
|
+
}
|
|
63
|
+
if (!descriptor.enumerable) continue;
|
|
64
|
+
if (!("value" in descriptor)) {
|
|
65
|
+
throw new Error(`buildProduct: ${path}[${key}] must be a data property, not an accessor`);
|
|
66
|
+
}
|
|
67
|
+
if (!/^(0|[1-9]\d*)$/.test(key)) {
|
|
68
|
+
throw new Error(`buildProduct: ${path} has unsupported enumerable array property ${key}`);
|
|
69
|
+
}
|
|
70
|
+
clone2[Number(key)] = cloneCanonicalProductData(descriptor.value, `${path}[${key}]`, active);
|
|
71
|
+
}
|
|
72
|
+
return clone2;
|
|
73
|
+
}
|
|
74
|
+
const clone = {};
|
|
75
|
+
for (const [key, descriptor] of Object.entries(descriptors)) {
|
|
76
|
+
if (key === "toJSON") {
|
|
77
|
+
throw new Error(`buildProduct: ${path}.${key} is not allowed on canonical product data`);
|
|
78
|
+
}
|
|
79
|
+
if (!descriptor.enumerable) continue;
|
|
80
|
+
if (!("value" in descriptor)) {
|
|
81
|
+
throw new Error(`buildProduct: ${path}.${key} must be a data property, not an accessor`);
|
|
82
|
+
}
|
|
83
|
+
if (key === "agent_url" || /(^|_)(?:format_ids?|v1_format_ref)($|_)/.test(key)) {
|
|
84
|
+
throw new Error(`buildProduct: ${path}.${key} contains legacy creative identity`);
|
|
85
|
+
}
|
|
86
|
+
Object.defineProperty(clone, key, {
|
|
87
|
+
configurable: true,
|
|
88
|
+
enumerable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: cloneCanonicalProductData(descriptor.value, `${path}.${key}`, active)
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return clone;
|
|
94
|
+
} finally {
|
|
95
|
+
active.delete(value);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
9
98
|
function resolvePublisherProperties(input) {
|
|
10
99
|
if (input.publisher_properties && input.publisher_properties.length > 0) {
|
|
11
100
|
return input.publisher_properties;
|
|
@@ -18,11 +107,42 @@ function resolvePublisherProperties(input) {
|
|
|
18
107
|
);
|
|
19
108
|
}
|
|
20
109
|
function buildProduct(input) {
|
|
110
|
+
const extraDescriptor = Object.getOwnPropertyDescriptor(input, "extra");
|
|
111
|
+
if (extraDescriptor && !("value" in extraDescriptor)) {
|
|
112
|
+
throw new Error("buildProduct: extra must be an own data property, not an accessor");
|
|
113
|
+
}
|
|
114
|
+
const rawExtra = extraDescriptor?.value;
|
|
115
|
+
assertCanonicalProductExtra(rawExtra);
|
|
116
|
+
const extra = rawExtra === void 0 ? void 0 : cloneCanonicalProductData(rawExtra, "extra");
|
|
117
|
+
const formatOptionsDescriptor = Object.getOwnPropertyDescriptor(input, "format_options");
|
|
118
|
+
if (!formatOptionsDescriptor || !("value" in formatOptionsDescriptor)) {
|
|
119
|
+
throw new Error("buildProduct: format_options must be an own data property");
|
|
120
|
+
}
|
|
121
|
+
const format_options = cloneCanonicalProductData(
|
|
122
|
+
formatOptionsDescriptor.value,
|
|
123
|
+
"format_options"
|
|
124
|
+
);
|
|
125
|
+
const pricing_options = resolvePricingOptions(input);
|
|
126
|
+
return {
|
|
127
|
+
...extra ?? {},
|
|
128
|
+
product_id: input.id,
|
|
129
|
+
name: input.name,
|
|
130
|
+
description: input.description ?? input.name,
|
|
131
|
+
publisher_properties: resolvePublisherProperties(input),
|
|
132
|
+
format_options,
|
|
133
|
+
delivery_type: input.delivery_type,
|
|
134
|
+
pricing_options,
|
|
135
|
+
reporting_capabilities: input.reporting_capabilities ?? DEFAULT_REPORTING_CAPABILITIES,
|
|
136
|
+
...input.channels && input.channels.length > 0 && { channels: [...input.channels] },
|
|
137
|
+
...input.ctx_metadata !== void 0 && { ctx_metadata: input.ctx_metadata }
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function buildProductLegacy(input) {
|
|
21
141
|
const formats = input.formats.map((f) => {
|
|
22
142
|
if (typeof f === "string") {
|
|
23
143
|
if (!input.agentUrl) {
|
|
24
144
|
throw new Error(
|
|
25
|
-
`
|
|
145
|
+
`buildProductLegacy: ${input.id} declares format '${f}' as a bare string, but \`agentUrl\` is required to build the wire \`{ id, agent_url }\` shape. Pass \`agentUrl\` on the input, OR pass each format as \`{ id, agent_url }\` directly.`
|
|
26
146
|
);
|
|
27
147
|
}
|
|
28
148
|
return { id: f, agent_url: input.agentUrl };
|
|
@@ -30,18 +150,11 @@ function buildProduct(input) {
|
|
|
30
150
|
if (f.agent_url) return f;
|
|
31
151
|
if (input.agentUrl) return { ...f, agent_url: input.agentUrl };
|
|
32
152
|
throw new Error(
|
|
33
|
-
`
|
|
153
|
+
`buildProductLegacy: ${input.id} format '${f.id}' has no agent_url and no \`agentUrl\` was passed on the input.`
|
|
34
154
|
);
|
|
35
155
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
pricing_options = [...input.pricing];
|
|
39
|
-
} else if (input.pricing) {
|
|
40
|
-
pricing_options = [buildPricingOption(input.pricing)];
|
|
41
|
-
} else {
|
|
42
|
-
pricing_options = [buildPricingOption({ model: "cpm", floor: 0.01, currency: "USD" })];
|
|
43
|
-
}
|
|
44
|
-
const product = {
|
|
156
|
+
const pricing_options = resolvePricingOptions(input);
|
|
157
|
+
return {
|
|
45
158
|
product_id: input.id,
|
|
46
159
|
name: input.name,
|
|
47
160
|
description: input.description ?? input.name,
|
|
@@ -54,7 +167,14 @@ function buildProduct(input) {
|
|
|
54
167
|
...input.ctx_metadata !== void 0 && { ctx_metadata: input.ctx_metadata },
|
|
55
168
|
...input.extra ?? {}
|
|
56
169
|
};
|
|
57
|
-
|
|
170
|
+
}
|
|
171
|
+
function resolvePricingOptions(input) {
|
|
172
|
+
if (Array.isArray(input.pricing)) {
|
|
173
|
+
return [...input.pricing];
|
|
174
|
+
} else if (input.pricing) {
|
|
175
|
+
return [buildPricingOption(input.pricing)];
|
|
176
|
+
}
|
|
177
|
+
return [buildPricingOption({ model: "cpm", floor: 0.01, currency: "USD" })];
|
|
58
178
|
}
|
|
59
179
|
function buildPricingOption(input) {
|
|
60
180
|
if (input.fixed !== void 0 && input.floor !== void 0) {
|
|
@@ -88,6 +208,7 @@ function buildPackage(input) {
|
|
|
88
208
|
export {
|
|
89
209
|
buildPackage,
|
|
90
210
|
buildPricingOption,
|
|
91
|
-
buildProduct
|
|
211
|
+
buildProduct,
|
|
212
|
+
buildProductLegacy
|
|
92
213
|
};
|
|
93
214
|
//# sourceMappingURL=assembly-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/server/decisioning/assembly-helpers.ts"],"sourcesContent":["/**\n * Wire-shape assembly helpers.\n *\n * AdCP wire shapes carry many required fields (Product needs 8 required\n * properties; PricingOption needs at least 3 plus model-specific extras).\n * Building them by hand is the largest single source of validation\n * cascades in LLM-generated platforms (Emma matrix v18: a single missed\n * `format_ids[0].id` shape error swallowed 30+ storyboard steps).\n *\n * These helpers emit correct wire shapes from a flatter, intent-shaped\n * input. Adopters opt in — anything you don't pass in gets a sensible\n * default; anything required gets a clear TS error if you omit it.\n *\n * @public\n */\n\nimport type { Product, PricingOption, ReportingCapabilities } from '../../types/tools.generated';\n\n// ---------------------------------------------------------------------------\n// buildProduct\n// ---------------------------------------------------------------------------\n\nexport interface BuildProductInput {\n /** Unique product id. */\n id: string;\n\n /** Human-readable name surfaced to buyers. */\n name: string;\n\n /** Description surfaced to buyers. Defaults to `name`. */\n description?: string;\n\n /**\n * Format ids accepted on creatives bound to this product.\n *\n * Pass either:\n * - Array of strings → SDK wraps each as `{ id, agent_url }` using the\n * `agentUrl` you pass alongside (required for string-form formats —\n * wire schema requires `agent_url` per AdCP 3.0.1)\n * - Array of `{ id, agent_url }` for cross-agent format references\n * (each entry carries its own agent_url)\n */\n formats: ReadonlyArray<string | { id: string; agent_url?: string }>;\n\n /**\n * Your agent's URL (e.g., `'http://127.0.0.1:4200/mcp'` in tests, your\n * production MCP endpoint live). Required when any entry in `formats` is\n * a bare string (so the helper can build `{ id, agent_url }`). Ignored\n * when every entry is `{ id, agent_url }`.\n *\n * Per AdCP 3.0.1, `format_ids[i].agent_url` is required on the wire shape\n * — every format reference must point at the agent that defines that\n * format. Pass once per `buildProduct` call and the helper threads it\n * into each format ref.\n */\n agentUrl?: string;\n\n /** `'guaranteed'` (reserved inventory) or `'non_guaranteed'` (auction / remnant). */\n delivery_type: 'guaranteed' | 'non_guaranteed';\n\n /**\n * One or more pricing options. Pass strings for \"default CPM with floor\"\n * convenience, or full `PricingOption` objects for fine-grained control.\n *\n * Convenience shortcut: `pricing: { model: 'cpm', floor: 5, currency: 'USD' }`\n * builds a single CPM auction pricing option with the given floor.\n */\n pricing?:\n | {\n model: 'cpm' | 'vcpm' | 'cpc' | 'cpcv' | 'cpv' | 'cpp' | 'cpa' | 'flat_rate' | 'time';\n floor?: number;\n fixed?: number;\n currency?: string;\n pricing_option_id?: string;\n }\n | ReadonlyArray<PricingOption>;\n\n /**\n * Shortcut for the common single-publisher case: pass the domain (e.g.,\n * `'sports.example'`) and the helper builds `publisher_properties: [{\n * publisher_domain: '<domain>', selection_type: 'all' }]`.\n *\n * Use `publisher_properties` directly for multi-domain or by-id / by-tag\n * selection.\n */\n publisher_domain?: string;\n\n /**\n * Publisher properties this product covers. Required (per AdCP 3.0.1\n * product schema) — pass `publisher_domain` for the common single-domain\n * shortcut, OR pass this directly for fine-grained selection.\n *\n * Each entry is a discriminated union by `selection_type`:\n * - `'all'` — select all properties at the publisher_domain\n * - `'by_id'` — select specific property_ids[]\n * - `'by_tag'` — select by property_tags[]\n */\n publisher_properties?: ReadonlyArray<\n | { publisher_domain: string; selection_type: 'all' }\n | {\n publisher_domain: string;\n selection_type: 'by_id';\n property_ids: ReadonlyArray<{ property_type: string; identifier: string; [k: string]: unknown }>;\n }\n | { publisher_domain: string; selection_type: 'by_tag'; property_tags: ReadonlyArray<string> }\n >;\n\n /** Reporting capabilities. Defaults to hourly+daily impressions/spend/clicks. */\n reporting_capabilities?: ReportingCapabilities;\n\n /** Channels this product targets (`'display'`, `'video'`, etc.). */\n channels?: ReadonlyArray<string>;\n\n /** Adapter-internal opaque blob round-tripped by the SDK. */\n ctx_metadata?: unknown;\n\n /** Anything else on the wire shape (escape hatch). */\n extra?: Record<string, unknown>;\n}\n\nconst DEFAULT_REPORTING_CAPABILITIES: ReportingCapabilities = {\n available_reporting_frequencies: ['hourly', 'daily'],\n expected_delay_minutes: 60,\n timezone: 'UTC',\n supports_webhooks: false,\n available_metrics: ['impressions', 'spend', 'clicks'],\n date_range_support: 'date_range',\n} as ReportingCapabilities;\n\nfunction resolvePublisherProperties(input: BuildProductInput): ReadonlyArray<unknown> {\n if (input.publisher_properties && input.publisher_properties.length > 0) {\n return input.publisher_properties;\n }\n if (input.publisher_domain) {\n return [{ publisher_domain: input.publisher_domain, selection_type: 'all' }];\n }\n throw new Error(\n `buildProduct: ${input.id} requires either \\`publisher_domain\\` (single-publisher shortcut) ` +\n `or \\`publisher_properties\\` (multi-domain / by-id / by-tag selection). The wire schema requires ` +\n `at least one publisher_property entry per product.`\n );\n}\n\n/**\n * Build a wire-correct `Product` from intent-shaped input. Required fields\n * (per AdCP 3.0.1 product.json) are filled in with sensible defaults when\n * omitted; the caller can override any of them.\n *\n * @example Catalog product (minimal)\n * ```ts\n * const product = buildProduct({\n * id: 'sports_display_auction',\n * name: 'Sports Display Auction',\n * formats: ['display_300x250', 'display_728x90'],\n * delivery_type: 'non_guaranteed',\n * pricing: { model: 'cpm', floor: 5.0, currency: 'USD' },\n * ctx_metadata: { gam: { ad_unit_ids: ['au_123'] } },\n * });\n * ```\n *\n * @example Multi-pricing-option product\n * ```ts\n * const product = buildProduct({\n * id: 'premium_homepage',\n * name: 'Premium Homepage Takeover',\n * formats: [{ id: 'display_970x250' }],\n * delivery_type: 'guaranteed',\n * pricing: [\n * buildPricingOption({ id: 'po_cpm', model: 'cpm', fixed: 25.0, currency: 'USD' }),\n * buildPricingOption({ id: 'po_flat', model: 'flat_rate', fixed: 50000, currency: 'USD' }),\n * ],\n * });\n * ```\n */\nexport function buildProduct(input: BuildProductInput): Product {\n const formats = input.formats.map(f => {\n if (typeof f === 'string') {\n if (!input.agentUrl) {\n throw new Error(\n `buildProduct: ${input.id} declares format '${f}' as a bare string, but \\`agentUrl\\` is required ` +\n `to build the wire \\`{ id, agent_url }\\` shape. Pass \\`agentUrl\\` on the input, OR pass each format ` +\n `as \\`{ id, agent_url }\\` directly.`\n );\n }\n return { id: f, agent_url: input.agentUrl };\n }\n if (f.agent_url) return f;\n if (input.agentUrl) return { ...f, agent_url: input.agentUrl };\n throw new Error(\n `buildProduct: ${input.id} format '${f.id}' has no agent_url and no \\`agentUrl\\` was passed on the input.`\n );\n });\n\n let pricing_options: PricingOption[];\n if (Array.isArray(input.pricing)) {\n pricing_options = [...input.pricing];\n } else if (input.pricing) {\n // Narrow: not an array, so it's the BuildPricingOptionInput shorthand object.\n pricing_options = [buildPricingOption(input.pricing as BuildPricingOptionInput)];\n } else {\n // No pricing supplied — emit a single CPM placeholder so the wire shape\n // validates. Adopters who skip pricing usually don't realize it's required.\n pricing_options = [buildPricingOption({ model: 'cpm', floor: 0.01, currency: 'USD' })];\n }\n\n const product = {\n product_id: input.id,\n name: input.name,\n description: input.description ?? input.name,\n publisher_properties: resolvePublisherProperties(input),\n format_ids: formats,\n delivery_type: input.delivery_type,\n pricing_options,\n reporting_capabilities: input.reporting_capabilities ?? DEFAULT_REPORTING_CAPABILITIES,\n ...(input.channels && input.channels.length > 0 && { channels: [...input.channels] }),\n ...(input.ctx_metadata !== undefined && { ctx_metadata: input.ctx_metadata }),\n ...(input.extra ?? {}),\n } as unknown as Product;\n\n return product;\n}\n\n// ---------------------------------------------------------------------------\n// buildPricingOption\n// ---------------------------------------------------------------------------\n\nexport interface BuildPricingOptionInput {\n /** Pricing option id, unique within the product. Defaults to `${model}_${floor||fixed||'default'}`. */\n id?: string;\n\n /** Pricing model. */\n model: 'cpm' | 'vcpm' | 'cpc' | 'cpcv' | 'cpv' | 'cpp' | 'cpa' | 'flat_rate' | 'time';\n\n /** Fixed price per unit. Mutually exclusive with `floor`. */\n fixed?: number;\n\n /** Auction floor price. Mutually exclusive with `fixed`. */\n floor?: number;\n\n /** ISO 4217 currency code (e.g., `'USD'`, `'EUR'`). Defaults to `'USD'`. */\n currency?: string;\n\n /** Minimum spend requirement per package using this pricing option. */\n min_spend_per_package?: number;\n}\n\n/**\n * Build a wire-correct `PricingOption` from intent-shaped input. Use the\n * shortcut on `buildProduct({ pricing })` for the common case; call\n * `buildPricingOption` directly when you need multiple options on a product.\n *\n * @example\n * ```ts\n * const cpm = buildPricingOption({ model: 'cpm', floor: 5.0, currency: 'USD' });\n * const flat = buildPricingOption({ id: 'po_flat', model: 'flat_rate', fixed: 50000, currency: 'USD' });\n * ```\n */\nexport function buildPricingOption(input: BuildPricingOptionInput): PricingOption {\n if (input.fixed !== undefined && input.floor !== undefined) {\n throw new Error(\n 'buildPricingOption: `fixed` and `floor` are mutually exclusive (CPM/etc. is either fixed-price or auction).'\n );\n }\n const currency = input.currency ?? 'USD';\n const idHint =\n input.fixed != null ? `fixed_${input.fixed}` : input.floor != null ? `floor_${input.floor}` : 'default';\n const opt = {\n pricing_option_id: input.id ?? `${input.model}_${idHint}`,\n pricing_model: input.model,\n currency,\n ...(input.fixed !== undefined && { fixed_price: input.fixed }),\n ...(input.floor !== undefined && { floor_price: input.floor }),\n ...(input.min_spend_per_package !== undefined && { min_spend_per_package: input.min_spend_per_package }),\n } as unknown as PricingOption;\n return opt;\n}\n\n// ---------------------------------------------------------------------------\n// buildPackage (createMediaBuy / getMediaBuys response packages)\n// ---------------------------------------------------------------------------\n\nexport interface BuildPackageInput {\n id: string;\n /** Buyer-supplied client-side reference (echoed from the request). */\n buyer_ref?: string;\n /** AdCP package status. Defaults to `'pending_creatives'` (just-created buys). */\n status?:\n | 'draft'\n | 'pending_creatives'\n | 'pending_start'\n | 'active'\n | 'paused'\n | 'completed'\n | 'canceled'\n | 'rejected';\n /** product_id this package was bound to. */\n product_id?: string;\n /** pricing_option_id selected for this package. */\n pricing_option_id?: string;\n /** Adapter-internal opaque blob round-tripped by the SDK. */\n ctx_metadata?: unknown;\n /** Anything else on the wire shape. */\n extra?: Record<string, unknown>;\n}\n\n/**\n * Build a wire-correct package shape for a media buy response.\n *\n * @example\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * const order = await this.gam.createOrder(req);\n * return {\n * media_buy_id: order.id,\n * status: 'pending_creatives',\n * packages: order.lineItems.map(li => buildPackage({\n * id: li.id,\n * buyer_ref: li.buyerRef,\n * status: 'pending_creatives',\n * ctx_metadata: { gam_line_item_id: li.gamLineItemId },\n * })),\n * };\n * }\n * ```\n */\nexport function buildPackage(input: BuildPackageInput): Record<string, unknown> {\n return {\n package_id: input.id,\n status: input.status ?? 'pending_creatives',\n ...(input.buyer_ref !== undefined && { buyer_ref: input.buyer_ref }),\n ...(input.product_id !== undefined && { product_id: input.product_id }),\n ...(input.pricing_option_id !== undefined && { pricing_option_id: input.pricing_option_id }),\n ...(input.ctx_metadata !== undefined && { ctx_metadata: input.ctx_metadata }),\n ...(input.extra ?? {}),\n };\n}\n"],"mappings":"AAwHA,MAAM,iCAAwD;AAAA,EAC5D,iCAAiC,CAAC,UAAU,OAAO;AAAA,EACnD,wBAAwB;AAAA,EACxB,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,mBAAmB,CAAC,eAAe,SAAS,QAAQ;AAAA,EACpD,oBAAoB;AACtB;AAEA,SAAS,2BAA2B,OAAkD;AACpF,MAAI,MAAM,wBAAwB,MAAM,qBAAqB,SAAS,GAAG;AACvE,WAAO,MAAM;AAAA,EACf;AACA,MAAI,MAAM,kBAAkB;AAC1B,WAAO,CAAC,EAAE,kBAAkB,MAAM,kBAAkB,gBAAgB,MAAM,CAAC;AAAA,EAC7E;AACA,QAAM,IAAI;AAAA,IACR,iBAAiB,MAAM,EAAE;AAAA,EAG3B;AACF;AAiCO,SAAS,aAAa,OAAmC;AAC9D,QAAM,UAAU,MAAM,QAAQ,IAAI,OAAK;AACrC,QAAI,OAAO,MAAM,UAAU;AACzB,UAAI,CAAC,MAAM,UAAU;AACnB,cAAM,IAAI;AAAA,UACR,iBAAiB,MAAM,EAAE,qBAAqB,CAAC;AAAA,QAGjD;AAAA,MACF;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AM,KAAK,KAAK;AAChG,QAAM,MAAM;AAAA,IACV,mBAAmB,MAAM,MAAM,GAAG,MAAM,KAAK,IAAI,MAAM;AAAA,IACvD,eAAe,MAAM;AAAA,IACrB;AAAA,IACA,GAAI,MAAM,UAAU,UAAa,EAAE,aAAa,MAAM,MAAM;AAAA,IAC5D,GAAI,MAAM,UAAU,UAAa,EAAE,aAAa,MAAM,MAAM;AAAA,IAC5D,GAAI,MAAM,0BAA0B,UAAa,EAAE,uBAAuB,MAAM,sBAAsB;AAAA,EACxG;AACA,SAAO;AACT;AAkDO,SAAS,aAAa,OAAmD;AAC9E,SAAO;AAAA,IACL,YAAY,MAAM;AAAA,IAClB,QAAQ,MAAM,UAAU;AAAA,IACxB,GAAI,MAAM,cAAc,UAAa,EAAE,WAAW,MAAM,UAAU;AAAA,IAClE,GAAI,MAAM,eAAe,UAAa,EAAE,YAAY,MAAM,WAAW;AAAA,IACrE,GAAI,MAAM,sBAAsB,UAAa,EAAE,mBAAmB,MAAM,kBAAkB;AAAA,IAC1F,GAAI,MAAM,iBAAiB,UAAa,EAAE,cAAc,MAAM,aAAa;AAAA,IAC3E,GAAI,MAAM,SAAS,CAAC;AAAA,EACtB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/server/decisioning/assembly-helpers.ts"],"sourcesContent":["/**\n * Canonical decisioning assembly helpers.\n *\n * AdCP products carry many required fields (Product needs 8 required\n * properties; PricingOption needs at least 3 plus model-specific extras).\n * Building them by hand is a common source of validation cascades in\n * generated platforms. The primary product helper accepts only canonical\n * `format_options`; named-format assembly is explicitly `buildProductLegacy`.\n *\n * These helpers emit correct wire shapes from a flatter, intent-shaped\n * input. Adopters opt in — anything you don't pass in gets a sensible\n * default; anything required gets a clear TS error if you omit it.\n *\n * @public\n */\n\nimport type { Product, PricingOption, ReportingCapabilities } from '../../types/tools.generated';\nimport type { CanonicalProduct } from '../../v2/projection/creative-delivery';\nimport type { CanonicalFormatDeclaration } from '../../v2/projection/legacy-metadata';\n\n// ---------------------------------------------------------------------------\n// buildProduct\n// ---------------------------------------------------------------------------\n\n/** @deprecated Compatibility input for {@link buildProductLegacy}. */\nexport interface BuildProductLegacyInput {\n /** Unique product id. */\n id: string;\n\n /** Human-readable name surfaced to buyers. */\n name: string;\n\n /** Description surfaced to buyers. Defaults to `name`. */\n description?: string;\n\n /**\n * Format ids accepted on creatives bound to this product.\n *\n * Pass either:\n * - Array of strings → SDK wraps each as `{ id, agent_url }` using the\n * `agentUrl` you pass alongside (required for string-form formats —\n * wire schema requires `agent_url` per AdCP 3.0.1)\n * - Array of `{ id, agent_url }` for cross-agent format references\n * (each entry carries its own agent_url)\n */\n formats: ReadonlyArray<string | { id: string; agent_url?: string }>;\n\n /**\n * Your agent's URL (e.g., `'http://127.0.0.1:4200/mcp'` in tests, your\n * production MCP endpoint live). Required when any entry in `formats` is\n * a bare string (so the helper can build `{ id, agent_url }`). Ignored\n * when every entry is `{ id, agent_url }`.\n *\n * Per AdCP 3.0.1, `format_ids[i].agent_url` is required on the wire shape\n * — every format reference must point at the agent that defines that\n * format. Pass once per `buildProduct` call and the helper threads it\n * into each format ref.\n */\n agentUrl?: string;\n\n /** `'guaranteed'` (reserved inventory) or `'non_guaranteed'` (auction / remnant). */\n delivery_type: 'guaranteed' | 'non_guaranteed';\n\n /**\n * One or more pricing options. Pass strings for \"default CPM with floor\"\n * convenience, or full `PricingOption` objects for fine-grained control.\n *\n * Convenience shortcut: `pricing: { model: 'cpm', floor: 5, currency: 'USD' }`\n * builds a single CPM auction pricing option with the given floor.\n */\n pricing?:\n | {\n model: 'cpm' | 'vcpm' | 'cpc' | 'cpcv' | 'cpv' | 'cpp' | 'cpa' | 'flat_rate' | 'time';\n floor?: number;\n fixed?: number;\n currency?: string;\n pricing_option_id?: string;\n }\n | ReadonlyArray<PricingOption>;\n\n /**\n * Shortcut for the common single-publisher case: pass the domain (e.g.,\n * `'sports.example'`) and the helper builds `publisher_properties: [{\n * publisher_domain: '<domain>', selection_type: 'all' }]`.\n *\n * Use `publisher_properties` directly for multi-domain or by-id / by-tag\n * selection.\n */\n publisher_domain?: string;\n\n /**\n * Publisher properties this product covers. Required (per AdCP 3.0.1\n * product schema) — pass `publisher_domain` for the common single-domain\n * shortcut, OR pass this directly for fine-grained selection.\n *\n * Each entry is a discriminated union by `selection_type`:\n * - `'all'` — select all properties at the publisher_domain\n * - `'by_id'` — select specific property_ids[]\n * - `'by_tag'` — select by property_tags[]\n */\n publisher_properties?: ReadonlyArray<\n | { publisher_domain: string; selection_type: 'all' }\n | {\n publisher_domain: string;\n selection_type: 'by_id';\n property_ids: ReadonlyArray<{ property_type: string; identifier: string; [k: string]: unknown }>;\n }\n | { publisher_domain: string; selection_type: 'by_tag'; property_tags: ReadonlyArray<string> }\n >;\n\n /** Reporting capabilities. Defaults to hourly+daily impressions/spend/clicks. */\n reporting_capabilities?: ReportingCapabilities;\n\n /** Channels this product targets (`'display'`, `'video'`, etc.). */\n channels?: ReadonlyArray<string>;\n\n /** Adapter-internal opaque blob round-tripped by the SDK. */\n ctx_metadata?: unknown;\n\n /** Additional non-identity product fields. Canonical fields and legacy creative identity are rejected. */\n extra?: Record<string, unknown>;\n}\n\n/** Canonical product input used by the primary server SDK. */\nexport interface BuildProductInput extends Omit<BuildProductLegacyInput, 'formats' | 'agentUrl'> {\n /** Canonical creative declarations accepted by this product. */\n format_options: ReadonlyArray<CanonicalFormatDeclaration>;\n}\n\nconst DEFAULT_REPORTING_CAPABILITIES: ReportingCapabilities = {\n available_reporting_frequencies: ['hourly', 'daily'],\n expected_delay_minutes: 60,\n timezone: 'UTC',\n supports_webhooks: false,\n available_metrics: ['impressions', 'spend', 'clicks'],\n date_range_support: 'date_range',\n} as ReportingCapabilities;\n\nconst CANONICAL_PRODUCT_RESERVED_EXTRA_KEYS = new Set([\n 'product_id',\n 'name',\n 'description',\n 'publisher_properties',\n 'format_options',\n 'format_ids',\n 'delivery_type',\n 'pricing_options',\n 'reporting_capabilities',\n 'channels',\n 'ctx_metadata',\n]);\n\nfunction assertCanonicalProductExtra(extra: Record<string, unknown> | undefined): void {\n if (!extra) return;\n const seen = new WeakSet<object>();\n const visit = (value: unknown, path: string, root: boolean): void => {\n if (value === null || typeof value !== 'object' || seen.has(value)) return;\n seen.add(value);\n for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {\n if (key === 'toJSON') {\n throw new Error(`buildProduct: extra.${path}${key} is not allowed on canonical product data`);\n }\n if (!descriptor.enumerable) continue;\n if (!('value' in descriptor)) {\n throw new Error(`buildProduct: extra.${path}${key} must be a data property, not an accessor`);\n }\n if (typeof descriptor.value === 'function') {\n throw new Error(`buildProduct: extra.${path}${key} must not be callable`);\n }\n if (root && CANONICAL_PRODUCT_RESERVED_EXTRA_KEYS.has(key)) {\n throw new Error(`buildProduct: extra.${key} cannot override a canonical product field`);\n }\n if (key === 'agent_url' || /(^|_)(?:format_ids?|v1_format_ref)($|_)/.test(key)) {\n throw new Error(`buildProduct: extra.${path}${key} contains legacy creative identity`);\n }\n visit(descriptor.value, `${path}${key}.`, false);\n }\n };\n visit(extra, '', true);\n}\n\nfunction cloneCanonicalProductData<T>(value: T, path: string, active = new WeakSet<object>()): T {\n if (typeof value === 'function') throw new Error(`buildProduct: ${path} must not be callable`);\n if (value === null || typeof value !== 'object') return value;\n if (active.has(value)) throw new Error(`buildProduct: ${path} must not contain cycles`);\n active.add(value);\n try {\n const descriptors = Object.getOwnPropertyDescriptors(value);\n if (Array.isArray(value)) {\n const clone: unknown[] = [];\n for (const [key, descriptor] of Object.entries(descriptors)) {\n if (key === 'toJSON') {\n throw new Error(`buildProduct: ${path}.${key} is not allowed on canonical product data`);\n }\n if (!descriptor.enumerable) continue;\n if (!('value' in descriptor)) {\n throw new Error(`buildProduct: ${path}[${key}] must be a data property, not an accessor`);\n }\n if (!/^(0|[1-9]\\d*)$/.test(key)) {\n throw new Error(`buildProduct: ${path} has unsupported enumerable array property ${key}`);\n }\n clone[Number(key)] = cloneCanonicalProductData(descriptor.value, `${path}[${key}]`, active);\n }\n return clone as T;\n }\n\n const clone: Record<string, unknown> = {};\n for (const [key, descriptor] of Object.entries(descriptors)) {\n if (key === 'toJSON') {\n throw new Error(`buildProduct: ${path}.${key} is not allowed on canonical product data`);\n }\n if (!descriptor.enumerable) continue;\n if (!('value' in descriptor)) {\n throw new Error(`buildProduct: ${path}.${key} must be a data property, not an accessor`);\n }\n if (key === 'agent_url' || /(^|_)(?:format_ids?|v1_format_ref)($|_)/.test(key)) {\n throw new Error(`buildProduct: ${path}.${key} contains legacy creative identity`);\n }\n Object.defineProperty(clone, key, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: cloneCanonicalProductData(descriptor.value, `${path}.${key}`, active),\n });\n }\n return clone as T;\n } finally {\n active.delete(value);\n }\n}\n\nfunction resolvePublisherProperties(input: BuildProductInput | BuildProductLegacyInput): ReadonlyArray<unknown> {\n if (input.publisher_properties && input.publisher_properties.length > 0) {\n return input.publisher_properties;\n }\n if (input.publisher_domain) {\n return [{ publisher_domain: input.publisher_domain, selection_type: 'all' }];\n }\n throw new Error(\n `buildProduct: ${input.id} requires either \\`publisher_domain\\` (single-publisher shortcut) ` +\n `or \\`publisher_properties\\` (multi-domain / by-id / by-tag selection). The wire schema requires ` +\n `at least one publisher_property entry per product.`\n );\n}\n\n/**\n * Build a canonical `Product` from intent-shaped input. Required common\n * product fields are filled in with sensible defaults when omitted.\n *\n * @example Catalog product (minimal)\n * ```ts\n * const product = buildProduct({\n * id: 'sports_display_auction',\n * name: 'Sports Display Auction',\n * format_options: [\n * { format_option_id: 'medium-rectangle', format_kind: 'image', params: { width: 300, height: 250 } },\n * { format_option_id: 'leaderboard', format_kind: 'image', params: { width: 728, height: 90 } },\n * ],\n * delivery_type: 'non_guaranteed',\n * pricing: { model: 'cpm', floor: 5.0, currency: 'USD' },\n * ctx_metadata: { gam: { ad_unit_ids: ['au_123'] } },\n * });\n * ```\n *\n * @example Multi-pricing-option product\n * ```ts\n * const product = buildProduct({\n * id: 'premium_homepage',\n * name: 'Premium Homepage Takeover',\n * format_options: [\n * { format_option_id: 'billboard', format_kind: 'image', params: { width: 970, height: 250 } },\n * ],\n * delivery_type: 'guaranteed',\n * pricing: [\n * buildPricingOption({ id: 'po_cpm', model: 'cpm', fixed: 25.0, currency: 'USD' }),\n * buildPricingOption({ id: 'po_flat', model: 'flat_rate', fixed: 50000, currency: 'USD' }),\n * ],\n * });\n * ```\n */\nexport function buildProduct(input: BuildProductInput): CanonicalProduct {\n const extraDescriptor = Object.getOwnPropertyDescriptor(input, 'extra');\n if (extraDescriptor && !('value' in extraDescriptor)) {\n throw new Error('buildProduct: extra must be an own data property, not an accessor');\n }\n const rawExtra = extraDescriptor?.value as Record<string, unknown> | undefined;\n assertCanonicalProductExtra(rawExtra);\n const extra = rawExtra === undefined ? undefined : cloneCanonicalProductData(rawExtra, 'extra');\n const formatOptionsDescriptor = Object.getOwnPropertyDescriptor(input, 'format_options');\n if (!formatOptionsDescriptor || !('value' in formatOptionsDescriptor)) {\n throw new Error('buildProduct: format_options must be an own data property');\n }\n const format_options = cloneCanonicalProductData(\n formatOptionsDescriptor.value as ReadonlyArray<CanonicalFormatDeclaration>,\n 'format_options'\n );\n const pricing_options = resolvePricingOptions(input);\n\n return {\n ...(extra ?? {}),\n product_id: input.id,\n name: input.name,\n description: input.description ?? input.name,\n publisher_properties: resolvePublisherProperties(input),\n format_options,\n delivery_type: input.delivery_type,\n pricing_options,\n reporting_capabilities: input.reporting_capabilities ?? DEFAULT_REPORTING_CAPABILITIES,\n ...(input.channels && input.channels.length > 0 && { channels: [...input.channels] }),\n ...(input.ctx_metadata !== undefined && { ctx_metadata: input.ctx_metadata }),\n } as unknown as CanonicalProduct;\n}\n\n/** @deprecated Explicit compatibility helper for legacy `format_ids` products. */\nexport function buildProductLegacy(input: BuildProductLegacyInput): Product {\n const formats = input.formats.map(f => {\n if (typeof f === 'string') {\n if (!input.agentUrl) {\n throw new Error(\n `buildProductLegacy: ${input.id} declares format '${f}' as a bare string, but \\`agentUrl\\` is required ` +\n `to build the wire \\`{ id, agent_url }\\` shape. Pass \\`agentUrl\\` on the input, OR pass each format ` +\n `as \\`{ id, agent_url }\\` directly.`\n );\n }\n return { id: f, agent_url: input.agentUrl };\n }\n if (f.agent_url) return f;\n if (input.agentUrl) return { ...f, agent_url: input.agentUrl };\n throw new Error(\n `buildProductLegacy: ${input.id} format '${f.id}' has no agent_url and no \\`agentUrl\\` was passed on the input.`\n );\n });\n\n const pricing_options = resolvePricingOptions(input);\n\n return {\n product_id: input.id,\n name: input.name,\n description: input.description ?? input.name,\n publisher_properties: resolvePublisherProperties(input),\n format_ids: formats,\n delivery_type: input.delivery_type,\n pricing_options,\n reporting_capabilities: input.reporting_capabilities ?? DEFAULT_REPORTING_CAPABILITIES,\n ...(input.channels && input.channels.length > 0 && { channels: [...input.channels] }),\n ...(input.ctx_metadata !== undefined && { ctx_metadata: input.ctx_metadata }),\n ...(input.extra ?? {}),\n } as unknown as Product;\n}\n\nfunction resolvePricingOptions(input: BuildProductInput | BuildProductLegacyInput): PricingOption[] {\n if (Array.isArray(input.pricing)) {\n return [...input.pricing];\n } else if (input.pricing) {\n // Narrow: not an array, so it's the BuildPricingOptionInput shorthand object.\n return [buildPricingOption(input.pricing as BuildPricingOptionInput)];\n }\n // No pricing supplied — emit a single CPM placeholder so the wire shape\n // validates. Adopters who skip pricing usually don't realize it's required.\n return [buildPricingOption({ model: 'cpm', floor: 0.01, currency: 'USD' })];\n}\n\n// ---------------------------------------------------------------------------\n// buildPricingOption\n// ---------------------------------------------------------------------------\n\nexport interface BuildPricingOptionInput {\n /** Pricing option id, unique within the product. Defaults to `${model}_${floor||fixed||'default'}`. */\n id?: string;\n\n /** Pricing model. */\n model: 'cpm' | 'vcpm' | 'cpc' | 'cpcv' | 'cpv' | 'cpp' | 'cpa' | 'flat_rate' | 'time';\n\n /** Fixed price per unit. Mutually exclusive with `floor`. */\n fixed?: number;\n\n /** Auction floor price. Mutually exclusive with `fixed`. */\n floor?: number;\n\n /** ISO 4217 currency code (e.g., `'USD'`, `'EUR'`). Defaults to `'USD'`. */\n currency?: string;\n\n /** Minimum spend requirement per package using this pricing option. */\n min_spend_per_package?: number;\n}\n\n/**\n * Build a wire-correct `PricingOption` from intent-shaped input. Use the\n * shortcut on `buildProduct({ pricing })` for the common case; call\n * `buildPricingOption` directly when you need multiple options on a product.\n *\n * @example\n * ```ts\n * const cpm = buildPricingOption({ model: 'cpm', floor: 5.0, currency: 'USD' });\n * const flat = buildPricingOption({ id: 'po_flat', model: 'flat_rate', fixed: 50000, currency: 'USD' });\n * ```\n */\nexport function buildPricingOption(input: BuildPricingOptionInput): PricingOption {\n if (input.fixed !== undefined && input.floor !== undefined) {\n throw new Error(\n 'buildPricingOption: `fixed` and `floor` are mutually exclusive (CPM/etc. is either fixed-price or auction).'\n );\n }\n const currency = input.currency ?? 'USD';\n const idHint =\n input.fixed != null ? `fixed_${input.fixed}` : input.floor != null ? `floor_${input.floor}` : 'default';\n const opt = {\n pricing_option_id: input.id ?? `${input.model}_${idHint}`,\n pricing_model: input.model,\n currency,\n ...(input.fixed !== undefined && { fixed_price: input.fixed }),\n ...(input.floor !== undefined && { floor_price: input.floor }),\n ...(input.min_spend_per_package !== undefined && { min_spend_per_package: input.min_spend_per_package }),\n } as unknown as PricingOption;\n return opt;\n}\n\n// ---------------------------------------------------------------------------\n// buildPackage (createMediaBuy / getMediaBuys response packages)\n// ---------------------------------------------------------------------------\n\nexport interface BuildPackageInput {\n id: string;\n /** Buyer-supplied client-side reference (echoed from the request). */\n buyer_ref?: string;\n /** AdCP package status. Defaults to `'pending_creatives'` (just-created buys). */\n status?:\n | 'draft'\n | 'pending_creatives'\n | 'pending_start'\n | 'active'\n | 'paused'\n | 'completed'\n | 'canceled'\n | 'rejected';\n /** product_id this package was bound to. */\n product_id?: string;\n /** pricing_option_id selected for this package. */\n pricing_option_id?: string;\n /** Adapter-internal opaque blob round-tripped by the SDK. */\n ctx_metadata?: unknown;\n /** Anything else on the wire shape. */\n extra?: Record<string, unknown>;\n}\n\n/**\n * Build a wire-correct package shape for a media buy response.\n *\n * @example\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * const order = await this.gam.createOrder(req);\n * return {\n * media_buy_id: order.id,\n * status: 'pending_creatives',\n * packages: order.lineItems.map(li => buildPackage({\n * id: li.id,\n * buyer_ref: li.buyerRef,\n * status: 'pending_creatives',\n * ctx_metadata: { gam_line_item_id: li.gamLineItemId },\n * })),\n * };\n * }\n * ```\n */\nexport function buildPackage(input: BuildPackageInput): Record<string, unknown> {\n return {\n package_id: input.id,\n status: input.status ?? 'pending_creatives',\n ...(input.buyer_ref !== undefined && { buyer_ref: input.buyer_ref }),\n ...(input.product_id !== undefined && { product_id: input.product_id }),\n ...(input.pricing_option_id !== undefined && { pricing_option_id: input.pricing_option_id }),\n ...(input.ctx_metadata !== undefined && { ctx_metadata: input.ctx_metadata }),\n ...(input.extra ?? {}),\n };\n}\n"],"mappings":"AAiIA,MAAM,iCAAwD;AAAA,EAC5D,iCAAiC,CAAC,UAAU,OAAO;AAAA,EACnD,wBAAwB;AAAA,EACxB,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,mBAAmB,CAAC,eAAe,SAAS,QAAQ;AAAA,EACpD,oBAAoB;AACtB;AAEA,MAAM,wCAAwC,oBAAI,IAAI;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,4BAA4B,OAAkD;AACrF,MAAI,CAAC,MAAO;AACZ,QAAM,OAAO,oBAAI,QAAgB;AACjC,QAAM,QAAQ,CAAC,OAAgB,MAAc,SAAwB;AACnE,QAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,KAAK,IAAI,KAAK,EAAG;AACpE,SAAK,IAAI,KAAK;AACd,eAAW,CAAC,KAAK,UAAU,KAAK,OAAO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AM,WAAW,MAAM,YAAY;AACnC,QAAM,SACJ,MAAM,SAAS,OAAO,SAAS,MAAM,KAAK,KAAK,MAAM,SAAS,OAAO,SAAS,MAAM,KAAK,KAAK;AAChG,QAAM,MAAM;AAAA,IACV,mBAAmB,MAAM,MAAM,GAAG,MAAM,KAAK,IAAI,MAAM;AAAA,IACvD,eAAe,MAAM;AAAA,IACrB;AAAA,IACA,GAAI,MAAM,UAAU,UAAa,EAAE,aAAa,MAAM,MAAM;AAAA,IAC5D,GAAI,MAAM,UAAU,UAAa,EAAE,aAAa,MAAM,MAAM;AAAA,IAC5D,GAAI,MAAM,0BAA0B,UAAa,EAAE,uBAAuB,MAAM,sBAAsB;AAAA,EACxG;AACA,SAAO;AACT;AAkDO,SAAS,aAAa,OAAmD;AAC9E,SAAO;AAAA,IACL,YAAY,MAAM;AAAA,IAClB,QAAQ,MAAM,UAAU;AAAA,IACxB,GAAI,MAAM,cAAc,UAAa,EAAE,WAAW,MAAM,UAAU;AAAA,IAClE,GAAI,MAAM,eAAe,UAAa,EAAE,YAAY,MAAM,WAAW;AAAA,IACrE,GAAI,MAAM,sBAAsB,UAAa,EAAE,mBAAmB,MAAM,kBAAkB;AAAA,IAC1F,GAAI,MAAM,iBAAiB,UAAa,EAAE,cAAc,MAAM,aAAa;AAAA,IAC3E,GAAI,MAAM,SAAS,CAAC;AAAA,EACtB;AACF;","names":["clone"]}
|
|
@@ -31,31 +31,32 @@ export { composeMethod } from './compose.mjs';
|
|
|
31
31
|
export type { ComposeHooks, ComposeShortCircuit } from './compose.mjs';
|
|
32
32
|
export { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets.mjs';
|
|
33
33
|
export type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets.mjs';
|
|
34
|
-
export type { CreativeBuilderPlatform,
|
|
35
|
-
export type { CreativeAdServerPlatform,
|
|
34
|
+
export type { CreativeBuilderPlatform, LegacyBuildCreativeReturn, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyPreviewCreativePayload, LegacyListCreativeFormatsPayload, CreativeTemplatePlatform, CreativeGenerativePlatform, RefinementMessage, SyncCreativesRow, } from './specialisms/creative.mjs';
|
|
35
|
+
export type { CreativeAdServerPlatform, LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn, LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload, LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload, LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload, ListCreativesPayload as CreativeAdServerListCreativesPayload, GetCreativeDeliveryPayload, GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload, LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload, } from './specialisms/creative-ad-server.mjs';
|
|
36
36
|
export type { CampaignGovernancePlatform, CheckGovernancePayload, SyncPlansPayload, ReportPlanOutcomePayload, GetPlanAuditLogsPayload, } from './specialisms/campaign-governance.mjs';
|
|
37
|
-
export type { ContentStandardsPlatform,
|
|
37
|
+
export type { ContentStandardsPlatform, LegacyListContentStandardsPayload, LegacyGetContentStandardsPayload, LegacyCreateContentStandardsPayload, LegacyUpdateContentStandardsPayload, LegacyCalibrateContentPayload, LegacyValidateContentDeliveryPayload, LegacyGetMediaBuyArtifactsPayload, LegacyGetCreativeFeaturesPayload, } from './specialisms/content-standards.mjs';
|
|
38
38
|
export type { PropertyListsPlatform, CollectionListsPlatform, CreatePropertyListPayload, UpdatePropertyListPayload, GetPropertyListPayload, ListPropertyListsPayload, DeletePropertyListPayload, CreateCollectionListPayload, UpdateCollectionListPayload, GetCollectionListPayload, ListCollectionListsPayload, DeleteCollectionListPayload, } from './specialisms/lists.mjs';
|
|
39
|
-
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, GetMediaBuysPayload, ProvidePerformanceFeedbackPayload,
|
|
39
|
+
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, LegacyGetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, LegacyCreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, LegacyUpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, LegacyGetMediaBuyDeliveryPayload, GetMediaBuysPayload, LegacyGetMediaBuysPayload, ProvidePerformanceFeedbackPayload, LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload, ListCreativesPayload, LegacyListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales.mjs';
|
|
40
40
|
export type { AudiencePlatform, Audience, SyncAudiencesPayload, SyncAudiencesRow, SyncAudiencesHandlerResult, AudienceStatus, } from './specialisms/audiences.mjs';
|
|
41
41
|
export type { SignalsPlatform, GetSignalsPayload, GetSignalsHandlerResult, ActivateSignalPayload, } from './specialisms/signals.mjs';
|
|
42
42
|
export type { SponsoredIntelligencePlatform, SIGetOfferingPayload, SIInitiateSessionPayload, SISendMessagePayload, SITerminateSessionPayload, } from './specialisms/sponsored-intelligence.mjs';
|
|
43
|
-
export type { BrandRightsPlatform, GetBrandIdentityPayload,
|
|
44
|
-
export type { GetBrandIdentityRequest, GetBrandIdentitySuccess, GetRightsRequest, GetRightsSuccess, AcquireRightsRequest, AcquireRightsAcquired, AcquireRightsPendingApproval, AcquireRightsRejected, AcquireRightsError, RightUse, RightType, RightsConstraint, RightsTerms, RightsPricingOption, GenerationCredential, } from '../../types/core.generated.mjs';
|
|
45
|
-
export { createAdcpServerFromPlatform, getAllAdcpMigrations, type CreateAdcpServerFromPlatformOptions, type RequiredOptsFor, type DecisioningAdcpServer, type DecisioningObservabilityHooks, } from './runtime/from-platform.mjs';
|
|
43
|
+
export type { BrandRightsPlatform, GetBrandIdentityPayload, LegacyGetRightsPayload, LegacyAcquireRightsAcquiredPayload, LegacyAcquireRightsPendingApprovalPayload, LegacyAcquireRightsRejectedPayload, LegacyAcquireRightsPayload, LegacyUpdateRightsPayload, CreativeApprovedPayload, CreativeRejectedPayload, CreativePendingReviewPayload, CreativeApprovalPayload, } from './specialisms/brand-rights.mjs';
|
|
44
|
+
export type { GetBrandIdentityRequest, GetBrandIdentitySuccess, GetRightsRequest as LegacyGetRightsRequest, GetRightsSuccess as LegacyGetRightsSuccess, AcquireRightsRequest as LegacyAcquireRightsRequest, AcquireRightsAcquired as LegacyAcquireRightsAcquired, AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval, AcquireRightsRejected as LegacyAcquireRightsRejected, AcquireRightsError as LegacyAcquireRightsError, RightUse, RightType, RightsConstraint, RightsTerms, RightsPricingOption, GenerationCredential, } from '../../types/core.generated.mjs';
|
|
45
|
+
export { createAdcpServerFromPlatform, getAllAdcpMigrations, type CreateAdcpServerFromPlatformOptions, type LegacyDecisioningHandlerGroups, type RequiredOptsFor, type DecisioningAdcpServer, type DecisioningObservabilityHooks, } from './runtime/from-platform.mjs';
|
|
46
46
|
export { PlatformConfigError, validatePlatform } from './runtime/validate-platform.mjs';
|
|
47
47
|
export { createInMemoryTaskRegistry, type TaskRegistry, type TaskRecord, type TaskStatus, } from './runtime/task-registry.mjs';
|
|
48
48
|
export { createPostgresTaskRegistry, getDecisioningTaskRegistryMigration, type CreatePostgresTaskRegistryOptions, type PgQueryable, } from './runtime/postgres-task-registry.mjs';
|
|
49
49
|
export { createTenantRegistry, createDefaultJwksValidator, createSelfSignedTenantKey, createNoopJwksValidator, type TenantRegistry, type TenantConfig, type TenantSigningKey, type TenantStatus, type TenantHealth, type TenantRegistryOptions, type JwksValidator, type JwksValidationResult, } from './tenant-registry.mjs';
|
|
50
|
-
export { getAsset, requireAsset } from './manifest-helpers.mjs';
|
|
51
|
-
export {
|
|
50
|
+
export { getAsset, getAssetSlot, requireAsset } from './manifest-helpers.mjs';
|
|
51
|
+
export type { CreativeAssetsContainer } from './manifest-helpers.mjs';
|
|
52
|
+
export { buildListCreativesResponse, buildListCreativesResponseLegacy, type BuildListCreativesResponseOpts, type BuildListCreativesResponseLegacyOpts, } from './list-helpers.mjs';
|
|
52
53
|
export { resolveStartTime, type ResolveStartTimeOptions } from './start-time.mjs';
|
|
53
54
|
export { createTenantAdminRouter, createTenantAdminHandlers, mountTenantAdmin, type TenantAdminHandlers, type RouterLike, } from './admin-router.mjs';
|
|
54
55
|
export { batchPoll, validationError, upstreamError } from './helpers.mjs';
|
|
55
56
|
export type { RequestShape } from './helpers.mjs';
|
|
56
57
|
export { definePlatform, defineSalesPlatform, defineSalesCorePlatform, defineSalesIngestionPlatform, defineAudiencePlatform, defineSignalsPlatform, defineSponsoredIntelligencePlatform, defineCreativeBuilderPlatform, defineCreativeAdServerPlatform, defineCampaignGovernancePlatform, defineContentStandardsPlatform, definePropertyListsPlatform, defineCollectionListsPlatform, defineBrandRightsPlatform, definePlatformWithCompliance, } from './platform-helpers.mjs';
|
|
57
|
-
export type { ProposalManager, ProposalCapabilities, ProposalSalesSpecialism, Recipe, CapabilityOverlap, FinalizeProposalRequest, FinalizeProposalSuccess, ProposalState, ProposalRecord, ProposalStore, InMemoryProposalStoreOptions, MockProposalManagerOptions, } from './proposal/index.mjs';
|
|
58
|
+
export type { ProposalManager, ProposalGetProductsPayload, LegacyProposalGetProductsPayload, ProposalCapabilities, ProposalSalesSpecialism, Recipe, CapabilityOverlap, FinalizeProposalRequest, FinalizeProposalSuccess, ProposalState, ProposalRecord, ProposalStore, InMemoryProposalStoreOptions, MockProposalManagerOptions, } from './proposal/index.mjs';
|
|
58
59
|
export { validateProposalCapabilities, InMemoryProposalStore, MockProposalManager, enforceProposalExpiry, validateCapabilityOverlap, validateOverlapSubsetOfWire, detectFinalizeAction, setProposalLifecycleLogger, maybeInterceptFinalize, maybePersistDraftAfterGetProducts, maybeReserveProposalForCreateMediaBuy, finalizeProposalConsumption, releaseProposalReservation, maybeHydrateRecipesForMediaBuyId, } from './proposal/index.mjs';
|
|
59
60
|
export type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal/index.mjs';
|
|
60
|
-
export { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers.mjs';
|
|
61
|
-
export type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers.mjs';
|
|
61
|
+
export { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers.mjs';
|
|
62
|
+
export type { BuildProductInput, BuildProductLegacyInput, BuildPricingOptionInput, BuildPackageInput, } from './assembly-helpers.mjs';
|
|
@@ -31,32 +31,33 @@ export { composeMethod } from './compose';
|
|
|
31
31
|
export type { ComposeHooks, ComposeShortCircuit } from './compose';
|
|
32
32
|
export { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';
|
|
33
33
|
export type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';
|
|
34
|
-
export type { CreativeBuilderPlatform,
|
|
35
|
-
export type { CreativeAdServerPlatform,
|
|
34
|
+
export type { CreativeBuilderPlatform, LegacyBuildCreativeReturn, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyPreviewCreativePayload, LegacyListCreativeFormatsPayload, CreativeTemplatePlatform, CreativeGenerativePlatform, RefinementMessage, SyncCreativesRow, } from './specialisms/creative';
|
|
35
|
+
export type { CreativeAdServerPlatform, LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn, LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload, LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload, LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload, ListCreativesPayload as CreativeAdServerListCreativesPayload, GetCreativeDeliveryPayload, GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload, LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload, } from './specialisms/creative-ad-server';
|
|
36
36
|
export type { CampaignGovernancePlatform, CheckGovernancePayload, SyncPlansPayload, ReportPlanOutcomePayload, GetPlanAuditLogsPayload, } from './specialisms/campaign-governance';
|
|
37
|
-
export type { ContentStandardsPlatform,
|
|
37
|
+
export type { ContentStandardsPlatform, LegacyListContentStandardsPayload, LegacyGetContentStandardsPayload, LegacyCreateContentStandardsPayload, LegacyUpdateContentStandardsPayload, LegacyCalibrateContentPayload, LegacyValidateContentDeliveryPayload, LegacyGetMediaBuyArtifactsPayload, LegacyGetCreativeFeaturesPayload, } from './specialisms/content-standards';
|
|
38
38
|
export type { PropertyListsPlatform, CollectionListsPlatform, CreatePropertyListPayload, UpdatePropertyListPayload, GetPropertyListPayload, ListPropertyListsPayload, DeletePropertyListPayload, CreateCollectionListPayload, UpdateCollectionListPayload, GetCollectionListPayload, ListCollectionListsPayload, DeleteCollectionListPayload, } from './specialisms/lists';
|
|
39
|
-
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, GetMediaBuysPayload, ProvidePerformanceFeedbackPayload,
|
|
39
|
+
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, LegacyGetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, LegacyCreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, LegacyUpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, LegacyGetMediaBuyDeliveryPayload, GetMediaBuysPayload, LegacyGetMediaBuysPayload, ProvidePerformanceFeedbackPayload, LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload, ListCreativesPayload, LegacyListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales';
|
|
40
40
|
export type { AudiencePlatform, Audience, SyncAudiencesPayload, SyncAudiencesRow, SyncAudiencesHandlerResult, AudienceStatus, } from './specialisms/audiences';
|
|
41
41
|
export type { SignalsPlatform, GetSignalsPayload, GetSignalsHandlerResult, ActivateSignalPayload, } from './specialisms/signals';
|
|
42
42
|
export type { SponsoredIntelligencePlatform, SIGetOfferingPayload, SIInitiateSessionPayload, SISendMessagePayload, SITerminateSessionPayload, } from './specialisms/sponsored-intelligence';
|
|
43
|
-
export type { BrandRightsPlatform, GetBrandIdentityPayload,
|
|
44
|
-
export type { GetBrandIdentityRequest, GetBrandIdentitySuccess, GetRightsRequest, GetRightsSuccess, AcquireRightsRequest, AcquireRightsAcquired, AcquireRightsPendingApproval, AcquireRightsRejected, AcquireRightsError, RightUse, RightType, RightsConstraint, RightsTerms, RightsPricingOption, GenerationCredential, } from '../../types/core.generated';
|
|
45
|
-
export { createAdcpServerFromPlatform, getAllAdcpMigrations, type CreateAdcpServerFromPlatformOptions, type RequiredOptsFor, type DecisioningAdcpServer, type DecisioningObservabilityHooks, } from './runtime/from-platform';
|
|
43
|
+
export type { BrandRightsPlatform, GetBrandIdentityPayload, LegacyGetRightsPayload, LegacyAcquireRightsAcquiredPayload, LegacyAcquireRightsPendingApprovalPayload, LegacyAcquireRightsRejectedPayload, LegacyAcquireRightsPayload, LegacyUpdateRightsPayload, CreativeApprovedPayload, CreativeRejectedPayload, CreativePendingReviewPayload, CreativeApprovalPayload, } from './specialisms/brand-rights';
|
|
44
|
+
export type { GetBrandIdentityRequest, GetBrandIdentitySuccess, GetRightsRequest as LegacyGetRightsRequest, GetRightsSuccess as LegacyGetRightsSuccess, AcquireRightsRequest as LegacyAcquireRightsRequest, AcquireRightsAcquired as LegacyAcquireRightsAcquired, AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval, AcquireRightsRejected as LegacyAcquireRightsRejected, AcquireRightsError as LegacyAcquireRightsError, RightUse, RightType, RightsConstraint, RightsTerms, RightsPricingOption, GenerationCredential, } from '../../types/core.generated';
|
|
45
|
+
export { createAdcpServerFromPlatform, getAllAdcpMigrations, type CreateAdcpServerFromPlatformOptions, type LegacyDecisioningHandlerGroups, type RequiredOptsFor, type DecisioningAdcpServer, type DecisioningObservabilityHooks, } from './runtime/from-platform';
|
|
46
46
|
export { PlatformConfigError, validatePlatform } from './runtime/validate-platform';
|
|
47
47
|
export { createInMemoryTaskRegistry, type TaskRegistry, type TaskRecord, type TaskStatus, } from './runtime/task-registry';
|
|
48
48
|
export { createPostgresTaskRegistry, getDecisioningTaskRegistryMigration, type CreatePostgresTaskRegistryOptions, type PgQueryable, } from './runtime/postgres-task-registry';
|
|
49
49
|
export { createTenantRegistry, createDefaultJwksValidator, createSelfSignedTenantKey, createNoopJwksValidator, type TenantRegistry, type TenantConfig, type TenantSigningKey, type TenantStatus, type TenantHealth, type TenantRegistryOptions, type JwksValidator, type JwksValidationResult, } from './tenant-registry';
|
|
50
|
-
export { getAsset, requireAsset } from './manifest-helpers';
|
|
51
|
-
export {
|
|
50
|
+
export { getAsset, getAssetSlot, requireAsset } from './manifest-helpers';
|
|
51
|
+
export type { CreativeAssetsContainer } from './manifest-helpers';
|
|
52
|
+
export { buildListCreativesResponse, buildListCreativesResponseLegacy, type BuildListCreativesResponseOpts, type BuildListCreativesResponseLegacyOpts, } from './list-helpers';
|
|
52
53
|
export { resolveStartTime, type ResolveStartTimeOptions } from './start-time';
|
|
53
54
|
export { createTenantAdminRouter, createTenantAdminHandlers, mountTenantAdmin, type TenantAdminHandlers, type RouterLike, } from './admin-router';
|
|
54
55
|
export { batchPoll, validationError, upstreamError } from './helpers';
|
|
55
56
|
export type { RequestShape } from './helpers';
|
|
56
57
|
export { definePlatform, defineSalesPlatform, defineSalesCorePlatform, defineSalesIngestionPlatform, defineAudiencePlatform, defineSignalsPlatform, defineSponsoredIntelligencePlatform, defineCreativeBuilderPlatform, defineCreativeAdServerPlatform, defineCampaignGovernancePlatform, defineContentStandardsPlatform, definePropertyListsPlatform, defineCollectionListsPlatform, defineBrandRightsPlatform, definePlatformWithCompliance, } from './platform-helpers';
|
|
57
|
-
export type { ProposalManager, ProposalCapabilities, ProposalSalesSpecialism, Recipe, CapabilityOverlap, FinalizeProposalRequest, FinalizeProposalSuccess, ProposalState, ProposalRecord, ProposalStore, InMemoryProposalStoreOptions, MockProposalManagerOptions, } from './proposal';
|
|
58
|
+
export type { ProposalManager, ProposalGetProductsPayload, LegacyProposalGetProductsPayload, ProposalCapabilities, ProposalSalesSpecialism, Recipe, CapabilityOverlap, FinalizeProposalRequest, FinalizeProposalSuccess, ProposalState, ProposalRecord, ProposalStore, InMemoryProposalStoreOptions, MockProposalManagerOptions, } from './proposal';
|
|
58
59
|
export { validateProposalCapabilities, InMemoryProposalStore, MockProposalManager, enforceProposalExpiry, validateCapabilityOverlap, validateOverlapSubsetOfWire, detectFinalizeAction, setProposalLifecycleLogger, maybeInterceptFinalize, maybePersistDraftAfterGetProducts, maybeReserveProposalForCreateMediaBuy, finalizeProposalConsumption, releaseProposalReservation, maybeHydrateRecipesForMediaBuyId, } from './proposal';
|
|
59
60
|
export type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';
|
|
60
|
-
export { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers';
|
|
61
|
-
export type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers';
|
|
61
|
+
export { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers';
|
|
62
|
+
export type { BuildProductInput, BuildProductLegacyInput, BuildPricingOptionInput, BuildPackageInput, } from './assembly-helpers';
|
|
62
63
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtF,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAMhE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO9D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAG5F,YAAY,EACV,OAAO,EACP,aAAa,EACb,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,E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B,CAAC;AACjG,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGlF,YAAY,EACV,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtF,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAMhE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO9D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAG5F,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EAAE,MAAM,WAAW,CAAC;AAU9C,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,mCAAmC,EACnC,6BAA6B,EAC7B,8BAA8B,EAC9B,gCAAgC,EAChC,8BAA8B,EAC9B,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAM5B,YAAY,EACV,eAAe,EACf,0BAA0B,EAC1B,gCAAgC,EAChC,oBAAoB,EACpB,uBAAuB,EACvB,MAAM,EACN,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,aAAa,EACb,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iCAAiC,EACjC,qCAAqC,EACrC,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKxH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxG,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
|
@@ -48,9 +48,11 @@ __export(decisioning_exports, {
|
|
|
48
48
|
UnsupportedFeatureError: () => import_errors_typed.UnsupportedFeatureError,
|
|
49
49
|
batchPoll: () => import_helpers.batchPoll,
|
|
50
50
|
buildListCreativesResponse: () => import_list_helpers.buildListCreativesResponse,
|
|
51
|
+
buildListCreativesResponseLegacy: () => import_list_helpers.buildListCreativesResponseLegacy,
|
|
51
52
|
buildPackage: () => import_assembly_helpers.buildPackage,
|
|
52
53
|
buildPricingOption: () => import_assembly_helpers.buildPricingOption,
|
|
53
54
|
buildProduct: () => import_assembly_helpers.buildProduct,
|
|
55
|
+
buildProductLegacy: () => import_assembly_helpers.buildProductLegacy,
|
|
54
56
|
composeMethod: () => import_compose.composeMethod,
|
|
55
57
|
createAdcpServerFromPlatform: () => import_from_platform.createAdcpServerFromPlatform,
|
|
56
58
|
createDefaultJwksValidator: () => import_tenant_registry.createDefaultJwksValidator,
|
|
@@ -83,6 +85,7 @@ __export(decisioning_exports, {
|
|
|
83
85
|
finalizeProposalConsumption: () => import_proposal.finalizeProposalConsumption,
|
|
84
86
|
getAllAdcpMigrations: () => import_from_platform.getAllAdcpMigrations,
|
|
85
87
|
getAsset: () => import_manifest_helpers.getAsset,
|
|
88
|
+
getAssetSlot: () => import_manifest_helpers.getAssetSlot,
|
|
86
89
|
getDecisioningTaskRegistryMigration: () => import_postgres_task_registry.getDecisioningTaskRegistryMigration,
|
|
87
90
|
getStatusChangeBus: () => import_status_changes.getStatusChangeBus,
|
|
88
91
|
identityStatusMappers: () => import_status_mappers.identityStatusMappers,
|
|
@@ -167,9 +170,11 @@ var import_assembly_helpers = require('./assembly-helpers.js');
|
|
|
167
170
|
UnsupportedFeatureError,
|
|
168
171
|
batchPoll,
|
|
169
172
|
buildListCreativesResponse,
|
|
173
|
+
buildListCreativesResponseLegacy,
|
|
170
174
|
buildPackage,
|
|
171
175
|
buildPricingOption,
|
|
172
176
|
buildProduct,
|
|
177
|
+
buildProductLegacy,
|
|
173
178
|
composeMethod,
|
|
174
179
|
createAdcpServerFromPlatform,
|
|
175
180
|
createDefaultJwksValidator,
|
|
@@ -202,6 +207,7 @@ var import_assembly_helpers = require('./assembly-helpers.js');
|
|
|
202
207
|
finalizeProposalConsumption,
|
|
203
208
|
getAllAdcpMigrations,
|
|
204
209
|
getAsset,
|
|
210
|
+
getAssetSlot,
|
|
205
211
|
getDecisioningTaskRegistryMigration,
|
|
206
212
|
getStatusChangeBus,
|
|
207
213
|
identityStatusMappers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n BuildCreativeReturn,\n BuildCreativePayload,\n BuildCreativeMultiPayload,\n PreviewCreativePayload as CreativePreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n BuildCreativeReturn as CreativeAdServerBuildCreativeReturn,\n BuildCreativePayload as CreativeAdServerBuildCreativePayload,\n BuildCreativeMultiPayload as CreativeAdServerBuildCreativeMultiPayload,\n PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeAdServerListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n ListContentStandardsPayload,\n GetContentStandardsPayload,\n CreateContentStandardsPayload,\n UpdateContentStandardsPayload,\n CalibrateContentPayload,\n ValidateContentDeliveryPayload,\n GetMediaBuyArtifactsPayload,\n GetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n ListCreativeFormatsPayload,\n ListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n GetRightsPayload,\n AcquireRightsAcquiredPayload,\n AcquireRightsPendingApprovalPayload,\n AcquireRightsRejectedPayload,\n AcquireRightsPayload,\n UpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest,\n GetRightsSuccess,\n AcquireRightsRequest,\n AcquireRightsAcquired,\n AcquireRightsPendingApproval,\n AcquireRightsRejected,\n AcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, requireAsset } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport { buildListCreativesResponse, type BuildListCreativesResponseOpts } from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Wire-shape assembly helpers — emit correct Product / PricingOption /\n// package shapes from intent-shaped input. Reduces 30+ lines of wire\n// boilerplate per resource. Used in slim skill examples so LLMs scaffold\n// correct shapes from first attempt.\nexport { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBA,2BAAoE;AAQpE,0BAuBO;AAUP,4BAUO;AAWP,0BAA2E;AA8B3E,qBAAmD;AAMnD,0BAAoD;AAsBpD,yBAAmC;AAInC,4BAAsC;AAkBtC,qBAA8B;AAM9B,6BAA6E;AAuJ7E,2BAOO;AACP,+BAAsD;AACtD,2BAKO;AACP,oCAKO;AAKP,6BAaO;AAKP,8BAAuC;AAIvC,0BAAgF;AAIhF,wBAA+D;AAI/D,0BAMO;AAIP,qBAA0D;AAW1D,8BAgBO;AAoBP,sBAeO;AAOP,8BAA+D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n LegacyBuildCreativeReturn,\n LegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn,\n LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n LegacyListContentStandardsPayload,\n LegacyGetContentStandardsPayload,\n LegacyCreateContentStandardsPayload,\n LegacyUpdateContentStandardsPayload,\n LegacyCalibrateContentPayload,\n LegacyValidateContentDeliveryPayload,\n LegacyGetMediaBuyArtifactsPayload,\n LegacyGetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n LegacyGetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n LegacyCreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n LegacyUpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n LegacyGetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n LegacyGetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload,\n ListCreativesPayload,\n LegacyListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n LegacyGetRightsPayload,\n LegacyAcquireRightsAcquiredPayload,\n LegacyAcquireRightsPendingApprovalPayload,\n LegacyAcquireRightsRejectedPayload,\n LegacyAcquireRightsPayload,\n LegacyUpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest as LegacyGetRightsRequest,\n GetRightsSuccess as LegacyGetRightsSuccess,\n AcquireRightsRequest as LegacyAcquireRightsRequest,\n AcquireRightsAcquired as LegacyAcquireRightsAcquired,\n AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval,\n AcquireRightsRejected as LegacyAcquireRightsRejected,\n AcquireRightsError as LegacyAcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type LegacyDecisioningHandlerGroups,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, getAssetSlot, requireAsset } from './manifest-helpers';\nexport type { CreativeAssetsContainer } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport {\n buildListCreativesResponse,\n buildListCreativesResponseLegacy,\n type BuildListCreativesResponseOpts,\n type BuildListCreativesResponseLegacyOpts,\n} from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalGetProductsPayload,\n LegacyProposalGetProductsPayload,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Canonical assembly helpers — emit Product / PricingOption / package shapes\n// from intent-shaped input. Raw named-format product assembly is available\n// only through the explicit buildProductLegacy compatibility helper.\nexport { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type {\n BuildProductInput,\n BuildProductLegacyInput,\n BuildPricingOptionInput,\n BuildPackageInput,\n} from './assembly-helpers';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBA,2BAAoE;AAQpE,0BAuBO;AAUP,4BAUO;AAWP,0BAA2E;AA8B3E,qBAAmD;AAMnD,0BAAoD;AAsBpD,yBAAmC;AAInC,4BAAsC;AAkBtC,qBAA8B;AAM9B,6BAA6E;AA+J7E,2BAQO;AACP,+BAAsD;AACtD,2BAKO;AACP,oCAKO;AAKP,6BAaO;AAKP,8BAAqD;AAKrD,0BAKO;AAIP,wBAA+D;AAI/D,0BAMO;AAIP,qBAA0D;AAW1D,8BAgBO;AAsBP,sBAeO;AAMP,8BAAmF;","names":[]}
|