@adcp/sdk 16.0.0-beta.8 → 16.0.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/AGENTS.md +3 -3
- package/README.md +5 -2
- package/bin/adcp.js +10 -13
- package/dist/lib/core/AgentClient.d.mts +8 -5
- package/dist/lib/core/AgentClient.d.ts +8 -5
- package/dist/lib/core/AgentClient.js +9 -4
- package/dist/lib/core/AgentClient.mjs +9 -4
- package/dist/lib/core/SingleAgentClient.d.mts +19 -112
- package/dist/lib/core/SingleAgentClient.d.ts +19 -112
- package/dist/lib/core/SingleAgentClient.js +270 -252
- package/dist/lib/core/SingleAgentClient.mjs +275 -253
- package/dist/lib/core/TaskExecutor.d.mts +1 -16
- package/dist/lib/core/TaskExecutor.d.ts +1 -16
- package/dist/lib/core/TaskExecutor.js +34 -51
- package/dist/lib/core/TaskExecutor.mjs +12 -29
- package/dist/lib/core/product-cache.d.mts +3 -1
- package/dist/lib/core/product-cache.d.ts +3 -1
- package/dist/lib/core/product-cache.js +2 -1
- package/dist/lib/core/product-cache.mjs +2 -1
- package/dist/lib/errors/index.d.mts +2 -8
- package/dist/lib/errors/index.d.ts +2 -8
- package/dist/lib/errors/index.js +4 -4
- package/dist/lib/errors/index.mjs +4 -4
- package/dist/lib/identity-3.3/revocation.js +6 -7
- package/dist/lib/identity-3.3/revocation.mjs +6 -7
- package/dist/lib/index.d.mts +4 -4
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +0 -14
- package/dist/lib/index.mjs +0 -14
- package/dist/lib/media-buy/compatibility.d.mts +1 -1
- package/dist/lib/media-buy/compatibility.d.ts +1 -1
- package/dist/lib/media-buy/compatibility.js +26 -45
- package/dist/lib/media-buy/compatibility.mjs +26 -45
- package/dist/lib/media-buy/legacy-purchase-continuation.d.mts +2 -2
- package/dist/lib/media-buy/legacy-purchase-continuation.d.ts +2 -2
- package/dist/lib/protocols/index.js +14 -22
- package/dist/lib/protocols/index.mjs +5 -13
- package/dist/lib/registry/types.d.mts +3 -2
- package/dist/lib/registry/types.d.ts +3 -2
- package/dist/lib/registry/types.generated.d.mts +51 -11
- package/dist/lib/registry/types.generated.d.ts +51 -11
- package/dist/lib/reporting/source/conformance.d.mts +8 -8
- package/dist/lib/reporting/source/conformance.d.ts +8 -8
- package/dist/lib/reporting/source/manifest.d.mts +27 -27
- package/dist/lib/reporting/source/manifest.d.ts +27 -27
- package/dist/lib/server/create-adcp-server.js +7 -1
- package/dist/lib/server/create-adcp-server.mjs +7 -1
- package/dist/lib/signing/crypto.d.mts +1 -1
- package/dist/lib/signing/crypto.d.ts +1 -1
- package/dist/lib/signing/crypto.js +2 -45
- package/dist/lib/signing/crypto.mjs +2 -46
- package/dist/lib/signing/web-bot-auth.d.mts +18 -10
- package/dist/lib/signing/web-bot-auth.d.ts +18 -10
- package/dist/lib/signing/web-bot-auth.js +29 -24
- package/dist/lib/signing/web-bot-auth.mjs +29 -24
- package/dist/lib/testing/compliance/comply.js +0 -8
- package/dist/lib/testing/compliance/comply.mjs +0 -8
- package/dist/lib/testing/compliance/storyboard-tracks.js +11 -0
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +11 -0
- package/dist/lib/testing/index.d.mts +2 -0
- package/dist/lib/testing/index.d.ts +2 -0
- package/dist/lib/testing/index.js +5 -0
- package/dist/lib/testing/index.mjs +3 -0
- package/dist/lib/testing/scenarios/capabilities.d.mts +2 -2
- package/dist/lib/testing/scenarios/capabilities.d.ts +2 -2
- package/dist/lib/testing/scenarios/capabilities.js +8 -41
- package/dist/lib/testing/scenarios/capabilities.mjs +9 -42
- package/dist/lib/testing/storyboard/creative-build-probe.d.mts +34 -0
- package/dist/lib/testing/storyboard/creative-build-probe.d.ts +34 -0
- package/dist/lib/testing/storyboard/creative-build-probe.js +395 -0
- package/dist/lib/testing/storyboard/creative-build-probe.mjs +373 -0
- package/dist/lib/testing/storyboard/index.d.mts +2 -0
- package/dist/lib/testing/storyboard/index.d.ts +2 -0
- package/dist/lib/testing/storyboard/index.js +5 -0
- package/dist/lib/testing/storyboard/index.mjs +3 -0
- package/dist/lib/testing/storyboard/loader.js +12 -0
- package/dist/lib/testing/storyboard/loader.mjs +12 -0
- package/dist/lib/testing/storyboard/property-list-reference.d.mts +15 -0
- package/dist/lib/testing/storyboard/property-list-reference.d.ts +15 -0
- package/dist/lib/testing/storyboard/property-list-reference.js +514 -0
- package/dist/lib/testing/storyboard/property-list-reference.mjs +487 -0
- package/dist/lib/testing/storyboard/runner.js +318 -58
- package/dist/lib/testing/storyboard/runner.mjs +322 -58
- package/dist/lib/testing/storyboard/types.d.mts +38 -16
- package/dist/lib/testing/storyboard/types.d.ts +38 -16
- package/dist/lib/testing/storyboard/types.js +1 -0
- package/dist/lib/testing/storyboard/types.mjs +1 -0
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.js +64 -0
- package/dist/lib/testing/storyboard/validations.mjs +67 -1
- package/dist/lib/testing/types.d.mts +15 -1
- package/dist/lib/testing/types.d.ts +15 -1
- package/dist/lib/types/schemas.generated.d.ts +65 -65
- package/dist/lib/types/wellknown-schemas.generated.d.mts +21 -21
- package/dist/lib/types/wellknown-schemas.generated.d.ts +21 -21
- package/dist/lib/utils/adcp-version-config.js +6 -0
- package/dist/lib/utils/adcp-version-config.mjs +6 -0
- package/dist/lib/utils/capabilities.d.mts +7 -9
- package/dist/lib/utils/capabilities.d.ts +7 -9
- package/dist/lib/utils/capabilities.js +14 -28
- package/dist/lib/utils/capabilities.mjs +14 -27
- package/dist/lib/utils/creative-adapter.d.mts +15 -113
- package/dist/lib/utils/creative-adapter.d.ts +15 -113
- package/dist/lib/utils/creative-adapter.js +7 -106
- package/dist/lib/utils/creative-adapter.mjs +7 -102
- package/dist/lib/utils/format-renders.d.mts +20 -80
- package/dist/lib/utils/format-renders.d.ts +20 -80
- package/dist/lib/utils/format-renders.js +7 -67
- package/dist/lib/utils/format-renders.mjs +7 -66
- package/dist/lib/utils/index.d.mts +1 -2
- package/dist/lib/utils/index.d.ts +1 -2
- package/dist/lib/utils/index.js +0 -7
- package/dist/lib/utils/index.mjs +0 -6
- package/dist/lib/utils/preview-normalizer.d.mts +31 -80
- package/dist/lib/utils/preview-normalizer.d.ts +31 -80
- package/dist/lib/utils/preview-normalizer.js +5 -50
- package/dist/lib/utils/preview-normalizer.mjs +5 -49
- package/dist/lib/utils/pricing-adapter.d.mts +2 -36
- package/dist/lib/utils/pricing-adapter.d.ts +2 -36
- package/dist/lib/utils/pricing-adapter.js +0 -105
- package/dist/lib/utils/pricing-adapter.mjs +0 -100
- package/dist/lib/utils/request-normalizer.d.mts +1 -2
- package/dist/lib/utils/request-normalizer.d.ts +1 -2
- package/dist/lib/v2/projection/catalog.d.mts +4 -0
- package/dist/lib/v2/projection/catalog.d.ts +4 -0
- package/dist/lib/v2/projection/creative-delivery.d.mts +17 -9
- package/dist/lib/v2/projection/creative-delivery.d.ts +17 -9
- package/dist/lib/v2/projection/creative-delivery.js +78 -10
- package/dist/lib/v2/projection/creative-delivery.mjs +77 -10
- package/dist/lib/v2/projection/legacy-metadata.d.mts +12 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +12 -0
- package/dist/lib/v2/projection/legacy-metadata.js +41 -1
- package/dist/lib/v2/projection/legacy-metadata.mjs +37 -1
- package/dist/lib/v2/projection/legacy-normalization.d.mts +1 -1
- package/dist/lib/v2/projection/legacy-normalization.d.ts +1 -1
- package/dist/lib/v2/projection/v1-to-v2.js +13 -0
- package/dist/lib/v2/projection/v1-to-v2.mjs +14 -0
- package/dist/lib/validation/client-hooks.d.mts +1 -4
- package/dist/lib/validation/client-hooks.d.ts +1 -4
- package/dist/lib/validation/get-products-request.d.mts +1 -1
- package/dist/lib/validation/get-products-request.d.ts +1 -1
- package/dist/lib/validation/schema-loader.js +6 -0
- package/dist/lib/validation/schema-loader.mjs +6 -0
- package/dist/lib/validation/schema-validator.js +1 -26
- package/dist/lib/validation/schema-validator.mjs +1 -26
- package/dist/lib/version.d.mts +5 -5
- package/dist/lib/version.d.ts +5 -5
- package/dist/lib/version.js +3 -5
- package/dist/lib/version.mjs +3 -5
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/development/PROTOCOL_DIFFERENCES.md +1 -1
- package/docs/guides/CONFORMANCE.md +25 -0
- package/docs/guides/CREATIVE-BUILD-PROBE.md +156 -0
- package/docs/guides/CREATIVE-DELIVERY.md +63 -7
- package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +15 -18
- package/docs/guides/REPORTING-STABILITY.md +7 -7
- package/docs/guides/VALIDATE-YOUR-AGENT.md +5 -0
- package/docs/llms.txt +3 -3
- package/docs/migration-13-to-14.md +20 -16
- package/docs/migration-14.x-rc-worksheet.md +5 -5
- package/docs/migration-4.x-to-5.x.md +12 -7
- package/docs/migration-agent-identity-3.3.md +44 -19
- package/docs/migration-drop-adcp-2.md +25 -0
- package/docs/migration-reporting-storage-package.md +3 -3
- package/docs/releases/16.0.0.md +20 -0
- package/package.json +3 -18
- package/skills/call-adcp-agent/SKILL.md +23 -25
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.mts +0 -3
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.ts +0 -3
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.js +0 -33
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.mjs +0 -9
- package/dist/lib/adapters/legacy/v2-5/get_products.d.mts +0 -8
- package/dist/lib/adapters/legacy/v2-5/get_products.d.ts +0 -8
- package/dist/lib/adapters/legacy/v2-5/get_products.js +0 -33
- package/dist/lib/adapters/legacy/v2-5/get_products.mjs +0 -9
- package/dist/lib/adapters/legacy/v2-5/index.d.mts +0 -34
- package/dist/lib/adapters/legacy/v2-5/index.d.ts +0 -34
- package/dist/lib/adapters/legacy/v2-5/index.js +0 -50
- package/dist/lib/adapters/legacy/v2-5/index.mjs +0 -25
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.mts +0 -8
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.ts +0 -8
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.js +0 -33
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.mjs +0 -9
- package/dist/lib/adapters/legacy/v2-5/preview_creative.d.mts +0 -3
- package/dist/lib/adapters/legacy/v2-5/preview_creative.d.ts +0 -3
- package/dist/lib/adapters/legacy/v2-5/preview_creative.js +0 -33
- package/dist/lib/adapters/legacy/v2-5/preview_creative.mjs +0 -9
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.mts +0 -11
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.ts +0 -11
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.js +0 -32
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.mjs +0 -8
- package/dist/lib/adapters/legacy/v2-5/types.d.mts +0 -39
- package/dist/lib/adapters/legacy/v2-5/types.d.ts +0 -39
- package/dist/lib/adapters/legacy/v2-5/types.js +0 -16
- package/dist/lib/adapters/legacy/v2-5/types.mjs +0 -0
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.mts +0 -3
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.ts +0 -3
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.js +0 -35
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.mjs +0 -11
- package/dist/lib/schemas-data/v2.5/_provenance.json +0 -8
- package/dist/lib/schemas-data/v2.5/adagents.json +0 -494
- package/dist/lib/schemas-data/v2.5/core/activation-key.json +0 -50
- package/dist/lib/schemas-data/v2.5/core/assets/audio-asset.json +0 -32
- package/dist/lib/schemas-data/v2.5/core/assets/css-asset.json +0 -21
- package/dist/lib/schemas-data/v2.5/core/assets/daast-asset.json +0 -87
- package/dist/lib/schemas-data/v2.5/core/assets/html-asset.json +0 -21
- package/dist/lib/schemas-data/v2.5/core/assets/image-asset.json +0 -38
- package/dist/lib/schemas-data/v2.5/core/assets/javascript-asset.json +0 -21
- package/dist/lib/schemas-data/v2.5/core/assets/markdown-asset.json +0 -31
- package/dist/lib/schemas-data/v2.5/core/assets/text-asset.json +0 -21
- package/dist/lib/schemas-data/v2.5/core/assets/url-asset.json +0 -26
- package/dist/lib/schemas-data/v2.5/core/assets/vast-asset.json +0 -87
- package/dist/lib/schemas-data/v2.5/core/assets/video-asset.json +0 -44
- package/dist/lib/schemas-data/v2.5/core/assets/webhook-asset.json +0 -71
- package/dist/lib/schemas-data/v2.5/core/async-response-data.json +0 -88
- package/dist/lib/schemas-data/v2.5/core/brand-manifest-ref.json +0 -33
- package/dist/lib/schemas-data/v2.5/core/brand-manifest.json +0 -409
- package/dist/lib/schemas-data/v2.5/core/context.json +0 -8
- package/dist/lib/schemas-data/v2.5/core/creative-asset.json +0 -125
- package/dist/lib/schemas-data/v2.5/core/creative-assignment.json +0 -31
- package/dist/lib/schemas-data/v2.5/core/creative-filters.json +0 -111
- package/dist/lib/schemas-data/v2.5/core/creative-manifest.json +0 -72
- package/dist/lib/schemas-data/v2.5/core/creative-policy.json +0 -27
- package/dist/lib/schemas-data/v2.5/core/delivery-metrics.json +0 -171
- package/dist/lib/schemas-data/v2.5/core/deployment.json +0 -93
- package/dist/lib/schemas-data/v2.5/core/destination.json +0 -53
- package/dist/lib/schemas-data/v2.5/core/error.json +0 -40
- package/dist/lib/schemas-data/v2.5/core/ext.json +0 -8
- package/dist/lib/schemas-data/v2.5/core/format-id.json +0 -47
- package/dist/lib/schemas-data/v2.5/core/format.json +0 -324
- package/dist/lib/schemas-data/v2.5/core/frequency-cap.json +0 -18
- package/dist/lib/schemas-data/v2.5/core/mcp-webhook-payload.json +0 -152
- package/dist/lib/schemas-data/v2.5/core/measurement.json +0 -48
- package/dist/lib/schemas-data/v2.5/core/media-buy.json +0 -62
- package/dist/lib/schemas-data/v2.5/core/package.json +0 -72
- package/dist/lib/schemas-data/v2.5/core/performance-feedback.json +0 -90
- package/dist/lib/schemas-data/v2.5/core/placement.json +0 -34
- package/dist/lib/schemas-data/v2.5/core/pricing-option.json +0 -35
- package/dist/lib/schemas-data/v2.5/core/product-filters.json +0 -102
- package/dist/lib/schemas-data/v2.5/core/product.json +0 -153
- package/dist/lib/schemas-data/v2.5/core/promoted-offerings.json +0 -115
- package/dist/lib/schemas-data/v2.5/core/promoted-products.json +0 -67
- package/dist/lib/schemas-data/v2.5/core/property-id.json +0 -14
- package/dist/lib/schemas-data/v2.5/core/property-tag.json +0 -16
- package/dist/lib/schemas-data/v2.5/core/property.json +0 -62
- package/dist/lib/schemas-data/v2.5/core/protocol-envelope.json +0 -146
- package/dist/lib/schemas-data/v2.5/core/publisher-property-selector.json +0 -92
- package/dist/lib/schemas-data/v2.5/core/push-notification-config.json +0 -48
- package/dist/lib/schemas-data/v2.5/core/reporting-capabilities.json +0 -71
- package/dist/lib/schemas-data/v2.5/core/response.json +0 -24
- package/dist/lib/schemas-data/v2.5/core/signal-filters.json +0 -35
- package/dist/lib/schemas-data/v2.5/core/start-timing.json +0 -18
- package/dist/lib/schemas-data/v2.5/core/sub-asset.json +0 -79
- package/dist/lib/schemas-data/v2.5/core/targeting.json +0 -50
- package/dist/lib/schemas-data/v2.5/core/tasks-get-request.json +0 -43
- package/dist/lib/schemas-data/v2.5/core/tasks-get-response.json +0 -166
- package/dist/lib/schemas-data/v2.5/core/tasks-list-request.json +0 -192
- package/dist/lib/schemas-data/v2.5/core/tasks-list-response.json +0 -183
- package/dist/lib/schemas-data/v2.5/creative/asset-types/index.json +0 -101
- package/dist/lib/schemas-data/v2.5/creative/list-creative-formats-request.json +0 -73
- package/dist/lib/schemas-data/v2.5/creative/list-creative-formats-response.json +0 -61
- package/dist/lib/schemas-data/v2.5/creative/preview-creative-request.json +0 -164
- package/dist/lib/schemas-data/v2.5/creative/preview-creative-response.json +0 -245
- package/dist/lib/schemas-data/v2.5/creative/preview-render.json +0 -225
- package/dist/lib/schemas-data/v2.5/enums/adcp-domain.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/asset-content-type.json +0 -22
- package/dist/lib/schemas-data/v2.5/enums/auth-scheme.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/available-metric.json +0 -18
- package/dist/lib/schemas-data/v2.5/enums/channels.json +0 -18
- package/dist/lib/schemas-data/v2.5/enums/co-branding-requirement.json +0 -12
- package/dist/lib/schemas-data/v2.5/enums/creative-action.json +0 -14
- package/dist/lib/schemas-data/v2.5/enums/creative-agent-capability.json +0 -13
- package/dist/lib/schemas-data/v2.5/enums/creative-sort-field.json +0 -15
- package/dist/lib/schemas-data/v2.5/enums/creative-status.json +0 -19
- package/dist/lib/schemas-data/v2.5/enums/daast-tracking-event.json +0 -20
- package/dist/lib/schemas-data/v2.5/enums/daast-version.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/delivery-type.json +0 -15
- package/dist/lib/schemas-data/v2.5/enums/dimension-unit.json +0 -13
- package/dist/lib/schemas-data/v2.5/enums/feed-format.json +0 -12
- package/dist/lib/schemas-data/v2.5/enums/feedback-source.json +0 -13
- package/dist/lib/schemas-data/v2.5/enums/format-category.json +0 -16
- package/dist/lib/schemas-data/v2.5/enums/format-id-parameter.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/frequency-cap-scope.json +0 -13
- package/dist/lib/schemas-data/v2.5/enums/history-entry-type.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/http-method.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/identifier-types.json +0 -34
- package/dist/lib/schemas-data/v2.5/enums/javascript-module-type.json +0 -12
- package/dist/lib/schemas-data/v2.5/enums/landing-page-requirement.json +0 -12
- package/dist/lib/schemas-data/v2.5/enums/markdown-flavor.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/media-buy-status.json +0 -19
- package/dist/lib/schemas-data/v2.5/enums/metric-type.json +0 -17
- package/dist/lib/schemas-data/v2.5/enums/notification-type.json +0 -13
- package/dist/lib/schemas-data/v2.5/enums/pacing.json +0 -17
- package/dist/lib/schemas-data/v2.5/enums/preview-output-format.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/pricing-model.json +0 -25
- package/dist/lib/schemas-data/v2.5/enums/property-type.json +0 -16
- package/dist/lib/schemas-data/v2.5/enums/publisher-identifier-types.json +0 -19
- package/dist/lib/schemas-data/v2.5/enums/reporting-frequency.json +0 -12
- package/dist/lib/schemas-data/v2.5/enums/signal-catalog-type.json +0 -12
- package/dist/lib/schemas-data/v2.5/enums/sort-direction.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/standard-format-ids.json +0 -103
- package/dist/lib/schemas-data/v2.5/enums/task-status.json +0 -29
- package/dist/lib/schemas-data/v2.5/enums/task-type.json +0 -27
- package/dist/lib/schemas-data/v2.5/enums/update-frequency.json +0 -13
- package/dist/lib/schemas-data/v2.5/enums/url-asset-type.json +0 -12
- package/dist/lib/schemas-data/v2.5/enums/validation-mode.json +0 -11
- package/dist/lib/schemas-data/v2.5/enums/vast-tracking-event.json +0 -25
- package/dist/lib/schemas-data/v2.5/enums/vast-version.json +0 -14
- package/dist/lib/schemas-data/v2.5/enums/webhook-response-type.json +0 -13
- package/dist/lib/schemas-data/v2.5/enums/webhook-security-method.json +0 -12
- package/dist/lib/schemas-data/v2.5/index.json +0 -604
- package/dist/lib/schemas-data/v2.5/media-buy/build-creative-request.json +0 -31
- package/dist/lib/schemas-data/v2.5/media-buy/build-creative-response.json +0 -65
- package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-input-required.json +0 -31
- package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-submitted.json +0 -16
- package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-working.json +0 -36
- package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-request.json +0 -126
- package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-response.json +0 -97
- package/dist/lib/schemas-data/v2.5/media-buy/get-media-buy-delivery-request.json +0 -54
- package/dist/lib/schemas-data/v2.5/media-buy/get-media-buy-delivery-response.json +0 -285
- package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-input-required.json +0 -38
- package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-submitted.json +0 -21
- package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-working.json +0 -34
- package/dist/lib/schemas-data/v2.5/media-buy/get-products-request.json +0 -28
- package/dist/lib/schemas-data/v2.5/media-buy/get-products-response.json +0 -33
- package/dist/lib/schemas-data/v2.5/media-buy/list-authorized-properties-request.json +0 -26
- package/dist/lib/schemas-data/v2.5/media-buy/list-authorized-properties-response.json +0 -70
- package/dist/lib/schemas-data/v2.5/media-buy/list-creative-formats-request.json +0 -58
- package/dist/lib/schemas-data/v2.5/media-buy/list-creative-formats-response.json +0 -61
- package/dist/lib/schemas-data/v2.5/media-buy/list-creatives-request.json +0 -137
- package/dist/lib/schemas-data/v2.5/media-buy/list-creatives-response.json +0 -437
- package/dist/lib/schemas-data/v2.5/media-buy/package-request.json +0 -80
- package/dist/lib/schemas-data/v2.5/media-buy/provide-performance-feedback-request.json +0 -88
- package/dist/lib/schemas-data/v2.5/media-buy/provide-performance-feedback-response.json +0 -66
- package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-input-required.json +0 -25
- package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-submitted.json +0 -16
- package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-working.json +0 -46
- package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-request.json +0 -178
- package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-response.json +0 -149
- package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-input-required.json +0 -24
- package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-submitted.json +0 -16
- package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-working.json +0 -36
- package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-request.json +0 -129
- package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-response.json +0 -99
- package/dist/lib/schemas-data/v2.5/pricing-options/cpc-option.json +0 -52
- package/dist/lib/schemas-data/v2.5/pricing-options/cpcv-option.json +0 -52
- package/dist/lib/schemas-data/v2.5/pricing-options/cpm-auction-option.json +0 -81
- package/dist/lib/schemas-data/v2.5/pricing-options/cpm-fixed-option.json +0 -52
- package/dist/lib/schemas-data/v2.5/pricing-options/cpp-option.json +0 -73
- package/dist/lib/schemas-data/v2.5/pricing-options/cpv-option.json +0 -88
- package/dist/lib/schemas-data/v2.5/pricing-options/flat-rate-option.json +0 -93
- package/dist/lib/schemas-data/v2.5/pricing-options/vcpm-auction-option.json +0 -81
- package/dist/lib/schemas-data/v2.5/pricing-options/vcpm-fixed-option.json +0 -52
- package/dist/lib/schemas-data/v2.5/protocols/adcp-extension.json +0 -33
- package/dist/lib/schemas-data/v2.5/signals/activate-signal-request.json +0 -32
- package/dist/lib/schemas-data/v2.5/signals/activate-signal-response.json +0 -68
- package/dist/lib/schemas-data/v2.5/signals/get-signals-request.json +0 -59
- package/dist/lib/schemas-data/v2.5/signals/get-signals-response.json +0 -100
- package/dist/lib/types/v2-5/index.d.mts +0 -1
- package/dist/lib/types/v2-5/index.d.ts +0 -1
- package/dist/lib/types/v2-5/index.js +0 -22
- package/dist/lib/types/v2-5/index.mjs +0 -1
- package/dist/lib/types/v2-5/tools.generated.d.mts +0 -3568
- package/dist/lib/types/v2-5/tools.generated.d.ts +0 -3568
- package/dist/lib/types/v2-5/tools.generated.js +0 -16
- package/dist/lib/types/v2-5/tools.generated.mjs +0 -0
- package/dist/lib/utils/sync-creatives-adapter.d.mts +0 -33
- package/dist/lib/utils/sync-creatives-adapter.d.ts +0 -33
- package/dist/lib/utils/sync-creatives-adapter.js +0 -83
- package/dist/lib/utils/sync-creatives-adapter.mjs +0 -59
|
@@ -33,28 +33,6 @@ function getFloorPrice(option) {
|
|
|
33
33
|
}
|
|
34
34
|
return option.price_guidance?.floor;
|
|
35
35
|
}
|
|
36
|
-
function adaptPricingOptionForV2(option) {
|
|
37
|
-
if (!usesV3PricingFields(option)) {
|
|
38
|
-
return option;
|
|
39
|
-
}
|
|
40
|
-
const { fixed_price, floor_price, price_guidance, ...rest } = option;
|
|
41
|
-
const result = { ...rest };
|
|
42
|
-
if (fixed_price !== void 0) {
|
|
43
|
-
result.rate = fixed_price;
|
|
44
|
-
result.is_fixed = true;
|
|
45
|
-
} else {
|
|
46
|
-
result.is_fixed = false;
|
|
47
|
-
if (floor_price !== void 0 || price_guidance) {
|
|
48
|
-
result.price_guidance = {
|
|
49
|
-
...price_guidance || {}
|
|
50
|
-
};
|
|
51
|
-
if (floor_price !== void 0) {
|
|
52
|
-
result.price_guidance.floor = floor_price;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
36
|
function normalizePricingOption(option) {
|
|
59
37
|
if (usesV3PricingFields(option) && !usesV2PricingFields(option)) {
|
|
60
38
|
return option;
|
|
@@ -76,15 +54,6 @@ function normalizePricingOption(option) {
|
|
|
76
54
|
}
|
|
77
55
|
return result;
|
|
78
56
|
}
|
|
79
|
-
function adaptProductPricingForV2(product) {
|
|
80
|
-
if (!product?.pricing_options || !Array.isArray(product.pricing_options)) {
|
|
81
|
-
return product;
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
...product,
|
|
85
|
-
pricing_options: product.pricing_options.map(adaptPricingOptionForV2)
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
57
|
function normalizeProductPricing(product) {
|
|
89
58
|
if (!product?.pricing_options || !Array.isArray(product.pricing_options)) {
|
|
90
59
|
return product;
|
|
@@ -94,64 +63,6 @@ function normalizeProductPricing(product) {
|
|
|
94
63
|
pricing_options: product.pricing_options.map(normalizePricingOption)
|
|
95
64
|
};
|
|
96
65
|
}
|
|
97
|
-
function adaptGetProductsRequestForV2(request) {
|
|
98
|
-
const adapted = { ...request };
|
|
99
|
-
if (adapted.brand?.domain) {
|
|
100
|
-
adapted.brand_manifest = `https://${adapted.brand.domain}`;
|
|
101
|
-
delete adapted.brand;
|
|
102
|
-
}
|
|
103
|
-
if (adapted.catalog) {
|
|
104
|
-
const catalog = adapted.catalog;
|
|
105
|
-
if (catalog.type === "product") {
|
|
106
|
-
adapted.promoted_offerings = {
|
|
107
|
-
product_selectors: {
|
|
108
|
-
...catalog.gtins?.length && { manifest_gtins: catalog.gtins },
|
|
109
|
-
...catalog.ids?.length && { manifest_skus: catalog.ids },
|
|
110
|
-
...catalog.tags?.length && { manifest_tags: catalog.tags },
|
|
111
|
-
...catalog.category && { manifest_category: catalog.category },
|
|
112
|
-
...catalog.query && { manifest_query: catalog.query }
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
} else if (catalog.type === "offering") {
|
|
116
|
-
adapted.promoted_offerings = {
|
|
117
|
-
...catalog.items?.length && { offerings: catalog.items }
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
delete adapted.catalog;
|
|
121
|
-
}
|
|
122
|
-
if (adapted.filters?.channels) {
|
|
123
|
-
const v2ChannelMap = {
|
|
124
|
-
olv: "video",
|
|
125
|
-
ctv: "video",
|
|
126
|
-
streaming_audio: "audio",
|
|
127
|
-
retail_media: "retail"
|
|
128
|
-
};
|
|
129
|
-
const mapped = adapted.filters.channels.map((ch) => v2ChannelMap[ch] ?? ch);
|
|
130
|
-
adapted.filters = {
|
|
131
|
-
...adapted.filters,
|
|
132
|
-
channels: [...new Set(mapped)]
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
if (adapted.filters) {
|
|
136
|
-
const {
|
|
137
|
-
required_features,
|
|
138
|
-
required_axe_integrations,
|
|
139
|
-
required_geo_targeting,
|
|
140
|
-
signal_targeting,
|
|
141
|
-
regions,
|
|
142
|
-
metros,
|
|
143
|
-
...v2Filters
|
|
144
|
-
} = adapted.filters;
|
|
145
|
-
adapted.filters = v2Filters;
|
|
146
|
-
}
|
|
147
|
-
delete adapted.buying_mode;
|
|
148
|
-
delete adapted.buyer_campaign_ref;
|
|
149
|
-
delete adapted.property_list;
|
|
150
|
-
delete adapted.account;
|
|
151
|
-
delete adapted.pagination;
|
|
152
|
-
delete adapted.adcp_major_version;
|
|
153
|
-
return adapted;
|
|
154
|
-
}
|
|
155
66
|
function normalizeProductChannels(product) {
|
|
156
67
|
if (!product?.channels || !Array.isArray(product.channels)) {
|
|
157
68
|
return product;
|
|
@@ -249,12 +160,6 @@ function normalizeGetProductsResponse(response) {
|
|
|
249
160
|
)
|
|
250
161
|
};
|
|
251
162
|
}
|
|
252
|
-
function adaptPackagePricingForV2(pkg) {
|
|
253
|
-
return pkg;
|
|
254
|
-
}
|
|
255
|
-
function adaptMediaBuyPricingForV2(request) {
|
|
256
|
-
return request;
|
|
257
|
-
}
|
|
258
163
|
function normalizeMediaBuyPricingResponse(response) {
|
|
259
164
|
if (response?.products && Array.isArray(response.products)) {
|
|
260
165
|
return {
|
|
@@ -265,11 +170,6 @@ function normalizeMediaBuyPricingResponse(response) {
|
|
|
265
170
|
return response;
|
|
266
171
|
}
|
|
267
172
|
export {
|
|
268
|
-
adaptGetProductsRequestForV2,
|
|
269
|
-
adaptMediaBuyPricingForV2,
|
|
270
|
-
adaptPackagePricingForV2,
|
|
271
|
-
adaptPricingOptionForV2,
|
|
272
|
-
adaptProductPricingForV2,
|
|
273
173
|
getFloorPrice,
|
|
274
174
|
getPrice,
|
|
275
175
|
isCPAPricing,
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Does NOT copy `context.buyer_ref` up to a top-level `buyer_ref`. The top-level
|
|
16
16
|
* field was removed from the package schema in AdCP 3.0 and strict v3 receivers
|
|
17
|
-
* reject it.
|
|
18
|
-
* `creative-adapter.ts` derives `buyer_ref` (from a caller-supplied value,
|
|
17
|
+
* reject it. Historical SDK releases derived `buyer_ref` (from a caller-supplied value,
|
|
19
18
|
* `context.buyer_ref`, `idempotency_key`, or parent/index) — that adapter is
|
|
20
19
|
* gated on `serverVersion !== 'v3'`, so the field only lands on the wire for
|
|
21
20
|
* sellers that still expect it.
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Does NOT copy `context.buyer_ref` up to a top-level `buyer_ref`. The top-level
|
|
16
16
|
* field was removed from the package schema in AdCP 3.0 and strict v3 receivers
|
|
17
|
-
* reject it.
|
|
18
|
-
* `creative-adapter.ts` derives `buyer_ref` (from a caller-supplied value,
|
|
17
|
+
* reject it. Historical SDK releases derived `buyer_ref` (from a caller-supplied value,
|
|
19
18
|
* `context.buyer_ref`, `idempotency_key`, or parent/index) — that adapter is
|
|
20
19
|
* gated on `serverVersion !== 'v3'`, so the field only lands on the wire for
|
|
21
20
|
* sellers that still expect it.
|
|
@@ -70,6 +70,10 @@ export interface V1FormatDefinition {
|
|
|
70
70
|
required?: boolean;
|
|
71
71
|
asset_type?: string;
|
|
72
72
|
requirements?: Record<string, unknown>;
|
|
73
|
+
/** Reference-catalog extension used to match pixel-tracker slots. */
|
|
74
|
+
event?: string;
|
|
75
|
+
/** Caller-defined tracker extension; required to match a custom event. */
|
|
76
|
+
custom_event_name?: string;
|
|
73
77
|
}>;
|
|
74
78
|
/**
|
|
75
79
|
* v2 canonical projection. Always object-shaped per
|
|
@@ -70,6 +70,10 @@ export interface V1FormatDefinition {
|
|
|
70
70
|
required?: boolean;
|
|
71
71
|
asset_type?: string;
|
|
72
72
|
requirements?: Record<string, unknown>;
|
|
73
|
+
/** Reference-catalog extension used to match pixel-tracker slots. */
|
|
74
|
+
event?: string;
|
|
75
|
+
/** Caller-defined tracker extension; required to match a custom event. */
|
|
76
|
+
custom_event_name?: string;
|
|
73
77
|
}>;
|
|
74
78
|
/**
|
|
75
79
|
* v2 canonical projection. Always object-shaped per
|
|
@@ -4,6 +4,7 @@ import type { CanonicalFormatLegacyResolver } from './v2-to-v1.mjs';
|
|
|
4
4
|
import type { CanonicalFormatKind, ProjectionDiagnostic, V1FormatId } from './types.mjs';
|
|
5
5
|
import type { CanonicalFormatDeclaration } from './legacy-metadata.mjs';
|
|
6
6
|
import type { UndeclaredFormatOptionSelector } from './legacy-routes.mjs';
|
|
7
|
+
import { type V1FormatDefinition } from './catalog.mjs';
|
|
7
8
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, Extract<keyof T, K>> : never;
|
|
8
9
|
/**
|
|
9
10
|
* Primary SDK creative shape. Spell out the named fields rather than using
|
|
@@ -254,6 +255,8 @@ export interface CreativeFormatSelectorContainer {
|
|
|
254
255
|
/** Canonical package/product selectors accepted by the primary sync API. */
|
|
255
256
|
export interface CanonicalCreativeFormatSelectorContainer {
|
|
256
257
|
package_id?: string;
|
|
258
|
+
/** Target product, used to recover seller declarations after serializing selectors. */
|
|
259
|
+
product_id?: string;
|
|
257
260
|
format_options?: ReadonlyArray<CanonicalFormatDeclaration>;
|
|
258
261
|
format_option_refs?: ReadonlyArray<FormatOptionReference>;
|
|
259
262
|
format_kind?: CanonicalFormatKind;
|
|
@@ -274,15 +277,20 @@ export declare class CreativeFormatCapabilityError extends Error {
|
|
|
274
277
|
readonly code = "ADCP_CREATIVE_FORMAT_CAPABILITY_CONTRADICTION";
|
|
275
278
|
constructor(message: string);
|
|
276
279
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
export declare function
|
|
283
|
-
export declare function
|
|
284
|
-
export declare function
|
|
285
|
-
export declare function
|
|
280
|
+
/**
|
|
281
|
+
* Project identity and asset keys for the selected wire mode. Optional
|
|
282
|
+
* `legacyFormatDefinitions` override bundled definitions by exact format owner
|
|
283
|
+
* and ID; ambiguous definitions leave asset keys unchanged.
|
|
284
|
+
*/
|
|
285
|
+
export declare function projectCreativeForDelivery<T extends CreativeAsset>(creative: T, selectorContainer: CreativeFormatSelectorContainer, wireMode?: 'canonical', operation?: string, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): CanonicalProjectedCreative<T>;
|
|
286
|
+
export declare function projectCreativeForDelivery<T extends CreativeAsset>(creative: T, selectorContainer: CreativeFormatSelectorContainer, wireMode: 'legacy' | 'unknown', operation?: string, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): LegacyProjectedCreative<T>;
|
|
287
|
+
export declare function projectCreativeForDelivery<T extends CreativeAsset>(creative: T, selectorContainer: CreativeFormatSelectorContainer, wireMode: CreativeFormatWireMode, operation?: string, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): CanonicalProjectedCreative<T> | LegacyProjectedCreative<T>;
|
|
288
|
+
export declare function projectMediaBuyCreativesForDelivery<T>(request: T, wireMode: 'canonical', operation?: 'create_media_buy' | 'update_media_buy', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedMediaBuyCreativeRequest<T, 'canonical'>;
|
|
289
|
+
export declare function projectMediaBuyCreativesForDelivery<T>(request: T, wireMode: 'legacy' | 'unknown', operation?: 'create_media_buy' | 'update_media_buy', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedMediaBuyCreativeRequest<T, 'legacy'>;
|
|
290
|
+
export declare function projectMediaBuyCreativesForDelivery<T>(request: T, wireMode: CreativeFormatWireMode, operation?: 'create_media_buy' | 'update_media_buy', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedMediaBuyCreativeRequest<T, 'canonical'> | ProjectedMediaBuyCreativeRequest<T, 'legacy'>;
|
|
291
|
+
export declare function projectSyncCreativesForDelivery<T>(request: T, selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>, wireMode: 'canonical', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedSyncCreativeRequest<T, 'canonical'>;
|
|
292
|
+
export declare function projectSyncCreativesForDelivery<T>(request: T, selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>, wireMode: 'legacy' | 'unknown', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedSyncCreativeRequest<T, 'legacy'>;
|
|
293
|
+
export declare function projectSyncCreativesForDelivery<T>(request: T, selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>, wireMode: CreativeFormatWireMode, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedSyncCreativeRequest<T, 'canonical'> | ProjectedSyncCreativeRequest<T, 'legacy'>;
|
|
286
294
|
export type { UndeclaredFormatOptionSelector } from './legacy-routes.mjs';
|
|
287
295
|
/**
|
|
288
296
|
* Looks up a format option the SDK derived from a seller's legacy `format_ids`.
|
|
@@ -4,6 +4,7 @@ import type { CanonicalFormatLegacyResolver } from './v2-to-v1';
|
|
|
4
4
|
import type { CanonicalFormatKind, ProjectionDiagnostic, V1FormatId } from './types';
|
|
5
5
|
import type { CanonicalFormatDeclaration } from './legacy-metadata';
|
|
6
6
|
import type { UndeclaredFormatOptionSelector } from './legacy-routes';
|
|
7
|
+
import { type V1FormatDefinition } from './catalog';
|
|
7
8
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, Extract<keyof T, K>> : never;
|
|
8
9
|
/**
|
|
9
10
|
* Primary SDK creative shape. Spell out the named fields rather than using
|
|
@@ -254,6 +255,8 @@ export interface CreativeFormatSelectorContainer {
|
|
|
254
255
|
/** Canonical package/product selectors accepted by the primary sync API. */
|
|
255
256
|
export interface CanonicalCreativeFormatSelectorContainer {
|
|
256
257
|
package_id?: string;
|
|
258
|
+
/** Target product, used to recover seller declarations after serializing selectors. */
|
|
259
|
+
product_id?: string;
|
|
257
260
|
format_options?: ReadonlyArray<CanonicalFormatDeclaration>;
|
|
258
261
|
format_option_refs?: ReadonlyArray<FormatOptionReference>;
|
|
259
262
|
format_kind?: CanonicalFormatKind;
|
|
@@ -274,15 +277,20 @@ export declare class CreativeFormatCapabilityError extends Error {
|
|
|
274
277
|
readonly code = "ADCP_CREATIVE_FORMAT_CAPABILITY_CONTRADICTION";
|
|
275
278
|
constructor(message: string);
|
|
276
279
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
export declare function
|
|
283
|
-
export declare function
|
|
284
|
-
export declare function
|
|
285
|
-
export declare function
|
|
280
|
+
/**
|
|
281
|
+
* Project identity and asset keys for the selected wire mode. Optional
|
|
282
|
+
* `legacyFormatDefinitions` override bundled definitions by exact format owner
|
|
283
|
+
* and ID; ambiguous definitions leave asset keys unchanged.
|
|
284
|
+
*/
|
|
285
|
+
export declare function projectCreativeForDelivery<T extends CreativeAsset>(creative: T, selectorContainer: CreativeFormatSelectorContainer, wireMode?: 'canonical', operation?: string, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): CanonicalProjectedCreative<T>;
|
|
286
|
+
export declare function projectCreativeForDelivery<T extends CreativeAsset>(creative: T, selectorContainer: CreativeFormatSelectorContainer, wireMode: 'legacy' | 'unknown', operation?: string, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): LegacyProjectedCreative<T>;
|
|
287
|
+
export declare function projectCreativeForDelivery<T extends CreativeAsset>(creative: T, selectorContainer: CreativeFormatSelectorContainer, wireMode: CreativeFormatWireMode, operation?: string, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): CanonicalProjectedCreative<T> | LegacyProjectedCreative<T>;
|
|
288
|
+
export declare function projectMediaBuyCreativesForDelivery<T>(request: T, wireMode: 'canonical', operation?: 'create_media_buy' | 'update_media_buy', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedMediaBuyCreativeRequest<T, 'canonical'>;
|
|
289
|
+
export declare function projectMediaBuyCreativesForDelivery<T>(request: T, wireMode: 'legacy' | 'unknown', operation?: 'create_media_buy' | 'update_media_buy', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedMediaBuyCreativeRequest<T, 'legacy'>;
|
|
290
|
+
export declare function projectMediaBuyCreativesForDelivery<T>(request: T, wireMode: CreativeFormatWireMode, operation?: 'create_media_buy' | 'update_media_buy', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedMediaBuyCreativeRequest<T, 'canonical'> | ProjectedMediaBuyCreativeRequest<T, 'legacy'>;
|
|
291
|
+
export declare function projectSyncCreativesForDelivery<T>(request: T, selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>, wireMode: 'canonical', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedSyncCreativeRequest<T, 'canonical'>;
|
|
292
|
+
export declare function projectSyncCreativesForDelivery<T>(request: T, selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>, wireMode: 'legacy' | 'unknown', legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedSyncCreativeRequest<T, 'legacy'>;
|
|
293
|
+
export declare function projectSyncCreativesForDelivery<T>(request: T, selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>, wireMode: CreativeFormatWireMode, legacyFormatConverter?: LegacyFormatConverter, canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver, legacyFormatDefinitions?: readonly V1FormatDefinition[]): ProjectedSyncCreativeRequest<T, 'canonical'> | ProjectedSyncCreativeRequest<T, 'legacy'>;
|
|
286
294
|
export type { UndeclaredFormatOptionSelector } from './legacy-routes';
|
|
287
295
|
/**
|
|
288
296
|
* Looks up a format option the SDK derived from a seller's legacy `format_ids`.
|
|
@@ -20,6 +20,7 @@ var creative_delivery_exports = {};
|
|
|
20
20
|
__export(creative_delivery_exports, {
|
|
21
21
|
CreativeFormatCapabilityError: () => CreativeFormatCapabilityError,
|
|
22
22
|
CreativeFormatProjectionError: () => CreativeFormatProjectionError,
|
|
23
|
+
canUseProductOptionsForCreativeWire: () => canUseProductOptionsForCreativeWire,
|
|
23
24
|
projectCreativeForDelivery: () => projectCreativeForDelivery,
|
|
24
25
|
projectMediaBuyCreativesForDelivery: () => projectMediaBuyCreativesForDelivery,
|
|
25
26
|
projectSyncCreativesForDelivery: () => projectSyncCreativesForDelivery,
|
|
@@ -32,6 +33,7 @@ var import_v1_to_v2 = require('./v1-to-v2.js');
|
|
|
32
33
|
var import_v2_to_v1 = require('./v2-to-v1.js');
|
|
33
34
|
var import_legacy_metadata = require('./legacy-metadata.js');
|
|
34
35
|
var import_jcs = require('../../utils/jcs.js');
|
|
36
|
+
var import_catalog = require('./catalog.js');
|
|
35
37
|
function stripLegacyCreativeIdentity(value) {
|
|
36
38
|
const legacyTokens = /* @__PURE__ */ new Set();
|
|
37
39
|
const legacyUrlTokens = /* @__PURE__ */ new Set();
|
|
@@ -590,11 +592,55 @@ function selectLegacyRef(creative, container, canonicalFormatLegacyResolver, ope
|
|
|
590
592
|
matching = preferMostConstrainedLegacyCandidates(matching, creative);
|
|
591
593
|
return matching.length === 1 ? matching[0].ref : void 0;
|
|
592
594
|
}
|
|
593
|
-
function
|
|
595
|
+
function projectLegacyAssetKeys(assetsValue, definition) {
|
|
596
|
+
const assets = record(assetsValue);
|
|
597
|
+
if (!assets || !Array.isArray(definition?.assets)) return assetsValue;
|
|
598
|
+
const slots = definition.assets.filter((slot) => record(slot) !== void 0);
|
|
599
|
+
if (slots.some((slot) => slot.item_type !== void 0 && slot.item_type !== "individual")) return assetsValue;
|
|
600
|
+
const declaredIds = new Set(slots.map((slot) => slot.asset_id));
|
|
601
|
+
const availableSlots = slots.filter(
|
|
602
|
+
(slot) => (slot.item_type === void 0 || slot.item_type === "individual") && typeof slot.asset_id === "string" && slot.asset_id.length > 0 && !Object.hasOwn(assets, slot.asset_id)
|
|
603
|
+
);
|
|
604
|
+
const targetBySource = /* @__PURE__ */ new Map();
|
|
605
|
+
const sourcesByTarget = /* @__PURE__ */ new Map();
|
|
606
|
+
for (const [key, value] of Object.entries(assets)) {
|
|
607
|
+
if (declaredIds.has(key)) continue;
|
|
608
|
+
const asset = record(value);
|
|
609
|
+
if (!asset || typeof asset.asset_type !== "string") continue;
|
|
610
|
+
const matches = availableSlots.filter((slot) => {
|
|
611
|
+
if (slot.asset_type !== asset.asset_type) return false;
|
|
612
|
+
if (asset.asset_type === "url") {
|
|
613
|
+
return typeof asset.url_type === "string" && asset.url_type === slot.requirements?.url_type;
|
|
614
|
+
}
|
|
615
|
+
if (asset.asset_type === "pixel_tracker") {
|
|
616
|
+
return typeof asset.event === "string" && asset.event === slot.event && (asset.event !== "custom" || typeof asset.custom_event_name === "string" && asset.custom_event_name === slot.custom_event_name);
|
|
617
|
+
}
|
|
618
|
+
return true;
|
|
619
|
+
});
|
|
620
|
+
if (matches.length !== 1) continue;
|
|
621
|
+
const target = matches[0].asset_id;
|
|
622
|
+
targetBySource.set(key, target);
|
|
623
|
+
const sources = sourcesByTarget.get(target) ?? [];
|
|
624
|
+
sources.push(key);
|
|
625
|
+
sourcesByTarget.set(target, sources);
|
|
626
|
+
}
|
|
627
|
+
for (const sources of sourcesByTarget.values()) {
|
|
628
|
+
if (sources.length > 1) for (const source of sources) targetBySource.delete(source);
|
|
629
|
+
}
|
|
630
|
+
if (targetBySource.size === 0) return assetsValue;
|
|
631
|
+
return Object.fromEntries(Object.entries(assets).map(([key, value]) => [targetBySource.get(key) ?? key, value]));
|
|
632
|
+
}
|
|
633
|
+
function projectCreative(creative, formatId, legacyFormatDefinitions) {
|
|
594
634
|
const next = { ...creative };
|
|
595
635
|
delete next.format_kind;
|
|
596
636
|
delete next.format_option_ref;
|
|
597
637
|
next.format_id = { ...formatId };
|
|
638
|
+
const supplied = legacyFormatDefinitions?.filter((definition2) => {
|
|
639
|
+
const ref = legacyRef(record(definition2)?.format_id);
|
|
640
|
+
return ref !== void 0 && sameLegacyIdentity(ref, formatId);
|
|
641
|
+
});
|
|
642
|
+
const definition = supplied?.length ? supplied.length === 1 ? supplied[0] : void 0 : (0, import_catalog.lookupV1Format)(formatId);
|
|
643
|
+
if (Object.hasOwn(creative, "assets")) next.assets = projectLegacyAssetKeys(creative.assets, definition);
|
|
598
644
|
return next;
|
|
599
645
|
}
|
|
600
646
|
function dedupeLegacyRefs(refs) {
|
|
@@ -828,7 +874,7 @@ function canonicalizeCreative(creative, selectorContainer, operation, legacyForm
|
|
|
828
874
|
}
|
|
829
875
|
return next;
|
|
830
876
|
}
|
|
831
|
-
function projectCreativeForDelivery(creative, selectorContainer, wireMode = "canonical", operation = "creative_delivery", legacyFormatConverter, canonicalFormatLegacyResolver) {
|
|
877
|
+
function projectCreativeForDelivery(creative, selectorContainer, wireMode = "canonical", operation = "creative_delivery", legacyFormatConverter, canonicalFormatLegacyResolver, legacyFormatDefinitions) {
|
|
832
878
|
const inputRecord = creative;
|
|
833
879
|
const originalLegacyRef = legacyRef(inputRecord.format_id);
|
|
834
880
|
const creativeRecord = canonicalizeCreative(inputRecord, selectorContainer, operation, legacyFormatConverter);
|
|
@@ -836,7 +882,11 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
836
882
|
if (originalLegacyRef) {
|
|
837
883
|
const selectedOriginal = selectLegacyRef(inputRecord, selectorContainer, canonicalFormatLegacyResolver, operation);
|
|
838
884
|
if (selectedOriginal) {
|
|
839
|
-
return projectCreative(
|
|
885
|
+
return projectCreative(
|
|
886
|
+
creativeRecord,
|
|
887
|
+
selectedOriginal,
|
|
888
|
+
legacyFormatDefinitions
|
|
889
|
+
);
|
|
840
890
|
}
|
|
841
891
|
throw new CreativeFormatProjectionError(
|
|
842
892
|
operation,
|
|
@@ -845,7 +895,8 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
845
895
|
);
|
|
846
896
|
}
|
|
847
897
|
const formatId = selectLegacyRef(creativeRecord, selectorContainer, canonicalFormatLegacyResolver, operation);
|
|
848
|
-
if (formatId)
|
|
898
|
+
if (formatId)
|
|
899
|
+
return projectCreative(creativeRecord, formatId, legacyFormatDefinitions);
|
|
849
900
|
if (typeof creativeRecord.format_kind === "string") {
|
|
850
901
|
const creativeId = typeof creativeRecord.creative_id === "string" ? creativeRecord.creative_id : "(unknown)";
|
|
851
902
|
const allCandidates = candidatesFromContainer(selectorContainer, canonicalFormatLegacyResolver, operation);
|
|
@@ -880,10 +931,19 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
880
931
|
"canonical format legacy resolver returned an invalid or ambiguous creative mapping"
|
|
881
932
|
);
|
|
882
933
|
}
|
|
883
|
-
if (resolved)
|
|
934
|
+
if (resolved)
|
|
935
|
+
return projectCreative(
|
|
936
|
+
creativeRecord,
|
|
937
|
+
resolved[0],
|
|
938
|
+
legacyFormatDefinitions
|
|
939
|
+
);
|
|
884
940
|
const pinned = optionReference(creativeRecord.format_option_ref) !== void 0;
|
|
885
941
|
if (candidates.length === 1 && !pinned) {
|
|
886
|
-
return projectCreative(
|
|
942
|
+
return projectCreative(
|
|
943
|
+
creativeRecord,
|
|
944
|
+
candidates[0].ref,
|
|
945
|
+
legacyFormatDefinitions
|
|
946
|
+
);
|
|
887
947
|
}
|
|
888
948
|
if (candidates.length > 1) {
|
|
889
949
|
throw new CreativeFormatProjectionError(
|
|
@@ -897,7 +957,7 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
897
957
|
}
|
|
898
958
|
return creative;
|
|
899
959
|
}
|
|
900
|
-
function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", operation = "create_media_buy", legacyFormatConverter, canonicalFormatLegacyResolver) {
|
|
960
|
+
function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", operation = "create_media_buy", legacyFormatConverter, canonicalFormatLegacyResolver, legacyFormatDefinitions) {
|
|
901
961
|
const requestRecord = record(request);
|
|
902
962
|
if (!requestRecord) return request;
|
|
903
963
|
let changed = false;
|
|
@@ -917,7 +977,8 @@ function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", op
|
|
|
917
977
|
wireMode,
|
|
918
978
|
operation,
|
|
919
979
|
legacyFormatConverter,
|
|
920
|
-
canonicalFormatLegacyResolver
|
|
980
|
+
canonicalFormatLegacyResolver,
|
|
981
|
+
legacyFormatDefinitions
|
|
921
982
|
);
|
|
922
983
|
if (projected !== creativeValue) changed = true;
|
|
923
984
|
return projected;
|
|
@@ -935,7 +996,7 @@ function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", op
|
|
|
935
996
|
}
|
|
936
997
|
return changed ? next : request;
|
|
937
998
|
}
|
|
938
|
-
function projectSyncCreativesForDelivery(request, selectorContainers, wireMode = "canonical", legacyFormatConverter, canonicalFormatLegacyResolver) {
|
|
999
|
+
function projectSyncCreativesForDelivery(request, selectorContainers, wireMode = "canonical", legacyFormatConverter, canonicalFormatLegacyResolver, legacyFormatDefinitions) {
|
|
939
1000
|
const requestRecord = record(request);
|
|
940
1001
|
if (!requestRecord || !Array.isArray(requestRecord.creatives)) {
|
|
941
1002
|
return request;
|
|
@@ -964,7 +1025,8 @@ function projectSyncCreativesForDelivery(request, selectorContainers, wireMode =
|
|
|
964
1025
|
wireMode,
|
|
965
1026
|
"sync_creatives",
|
|
966
1027
|
legacyFormatConverter,
|
|
967
|
-
canonicalFormatLegacyResolver
|
|
1028
|
+
canonicalFormatLegacyResolver,
|
|
1029
|
+
legacyFormatDefinitions
|
|
968
1030
|
);
|
|
969
1031
|
if (projected !== creativeValue) changed = true;
|
|
970
1032
|
return projected;
|
|
@@ -1134,10 +1196,16 @@ function resolveCreativeFormatWireMode(capabilities, negotiatedVersion) {
|
|
|
1134
1196
|
if (explicitCanonical === false) return "legacy";
|
|
1135
1197
|
return "unknown";
|
|
1136
1198
|
}
|
|
1199
|
+
function canUseProductOptionsForCreativeWire(capabilities, requestedVersion) {
|
|
1200
|
+
const caps = record(capabilities);
|
|
1201
|
+
const negotiated = mutuallyServedRelease(caps, record(caps?._raw), requestedVersion);
|
|
1202
|
+
return negotiated?.major === 3 && negotiated.minor === 1;
|
|
1203
|
+
}
|
|
1137
1204
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1138
1205
|
0 && (module.exports = {
|
|
1139
1206
|
CreativeFormatCapabilityError,
|
|
1140
1207
|
CreativeFormatProjectionError,
|
|
1208
|
+
canUseProductOptionsForCreativeWire,
|
|
1141
1209
|
projectCreativeForDelivery,
|
|
1142
1210
|
projectMediaBuyCreativesForDelivery,
|
|
1143
1211
|
projectSyncCreativesForDelivery,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
transferLegacyCreativeMetadata
|
|
13
13
|
} from "./legacy-metadata.mjs";
|
|
14
14
|
import { canonicalize as canonicalizeJson } from "../../utils/jcs.mjs";
|
|
15
|
+
import { lookupV1Format } from "./catalog.mjs";
|
|
15
16
|
function stripLegacyCreativeIdentity(value) {
|
|
16
17
|
const legacyTokens = /* @__PURE__ */ new Set();
|
|
17
18
|
const legacyUrlTokens = /* @__PURE__ */ new Set();
|
|
@@ -570,11 +571,55 @@ function selectLegacyRef(creative, container, canonicalFormatLegacyResolver, ope
|
|
|
570
571
|
matching = preferMostConstrainedLegacyCandidates(matching, creative);
|
|
571
572
|
return matching.length === 1 ? matching[0].ref : void 0;
|
|
572
573
|
}
|
|
573
|
-
function
|
|
574
|
+
function projectLegacyAssetKeys(assetsValue, definition) {
|
|
575
|
+
const assets = record(assetsValue);
|
|
576
|
+
if (!assets || !Array.isArray(definition?.assets)) return assetsValue;
|
|
577
|
+
const slots = definition.assets.filter((slot) => record(slot) !== void 0);
|
|
578
|
+
if (slots.some((slot) => slot.item_type !== void 0 && slot.item_type !== "individual")) return assetsValue;
|
|
579
|
+
const declaredIds = new Set(slots.map((slot) => slot.asset_id));
|
|
580
|
+
const availableSlots = slots.filter(
|
|
581
|
+
(slot) => (slot.item_type === void 0 || slot.item_type === "individual") && typeof slot.asset_id === "string" && slot.asset_id.length > 0 && !Object.hasOwn(assets, slot.asset_id)
|
|
582
|
+
);
|
|
583
|
+
const targetBySource = /* @__PURE__ */ new Map();
|
|
584
|
+
const sourcesByTarget = /* @__PURE__ */ new Map();
|
|
585
|
+
for (const [key, value] of Object.entries(assets)) {
|
|
586
|
+
if (declaredIds.has(key)) continue;
|
|
587
|
+
const asset = record(value);
|
|
588
|
+
if (!asset || typeof asset.asset_type !== "string") continue;
|
|
589
|
+
const matches = availableSlots.filter((slot) => {
|
|
590
|
+
if (slot.asset_type !== asset.asset_type) return false;
|
|
591
|
+
if (asset.asset_type === "url") {
|
|
592
|
+
return typeof asset.url_type === "string" && asset.url_type === slot.requirements?.url_type;
|
|
593
|
+
}
|
|
594
|
+
if (asset.asset_type === "pixel_tracker") {
|
|
595
|
+
return typeof asset.event === "string" && asset.event === slot.event && (asset.event !== "custom" || typeof asset.custom_event_name === "string" && asset.custom_event_name === slot.custom_event_name);
|
|
596
|
+
}
|
|
597
|
+
return true;
|
|
598
|
+
});
|
|
599
|
+
if (matches.length !== 1) continue;
|
|
600
|
+
const target = matches[0].asset_id;
|
|
601
|
+
targetBySource.set(key, target);
|
|
602
|
+
const sources = sourcesByTarget.get(target) ?? [];
|
|
603
|
+
sources.push(key);
|
|
604
|
+
sourcesByTarget.set(target, sources);
|
|
605
|
+
}
|
|
606
|
+
for (const sources of sourcesByTarget.values()) {
|
|
607
|
+
if (sources.length > 1) for (const source of sources) targetBySource.delete(source);
|
|
608
|
+
}
|
|
609
|
+
if (targetBySource.size === 0) return assetsValue;
|
|
610
|
+
return Object.fromEntries(Object.entries(assets).map(([key, value]) => [targetBySource.get(key) ?? key, value]));
|
|
611
|
+
}
|
|
612
|
+
function projectCreative(creative, formatId, legacyFormatDefinitions) {
|
|
574
613
|
const next = { ...creative };
|
|
575
614
|
delete next.format_kind;
|
|
576
615
|
delete next.format_option_ref;
|
|
577
616
|
next.format_id = { ...formatId };
|
|
617
|
+
const supplied = legacyFormatDefinitions?.filter((definition2) => {
|
|
618
|
+
const ref = legacyRef(record(definition2)?.format_id);
|
|
619
|
+
return ref !== void 0 && sameLegacyIdentity(ref, formatId);
|
|
620
|
+
});
|
|
621
|
+
const definition = supplied?.length ? supplied.length === 1 ? supplied[0] : void 0 : lookupV1Format(formatId);
|
|
622
|
+
if (Object.hasOwn(creative, "assets")) next.assets = projectLegacyAssetKeys(creative.assets, definition);
|
|
578
623
|
return next;
|
|
579
624
|
}
|
|
580
625
|
function dedupeLegacyRefs(refs) {
|
|
@@ -808,7 +853,7 @@ function canonicalizeCreative(creative, selectorContainer, operation, legacyForm
|
|
|
808
853
|
}
|
|
809
854
|
return next;
|
|
810
855
|
}
|
|
811
|
-
function projectCreativeForDelivery(creative, selectorContainer, wireMode = "canonical", operation = "creative_delivery", legacyFormatConverter, canonicalFormatLegacyResolver) {
|
|
856
|
+
function projectCreativeForDelivery(creative, selectorContainer, wireMode = "canonical", operation = "creative_delivery", legacyFormatConverter, canonicalFormatLegacyResolver, legacyFormatDefinitions) {
|
|
812
857
|
const inputRecord = creative;
|
|
813
858
|
const originalLegacyRef = legacyRef(inputRecord.format_id);
|
|
814
859
|
const creativeRecord = canonicalizeCreative(inputRecord, selectorContainer, operation, legacyFormatConverter);
|
|
@@ -816,7 +861,11 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
816
861
|
if (originalLegacyRef) {
|
|
817
862
|
const selectedOriginal = selectLegacyRef(inputRecord, selectorContainer, canonicalFormatLegacyResolver, operation);
|
|
818
863
|
if (selectedOriginal) {
|
|
819
|
-
return projectCreative(
|
|
864
|
+
return projectCreative(
|
|
865
|
+
creativeRecord,
|
|
866
|
+
selectedOriginal,
|
|
867
|
+
legacyFormatDefinitions
|
|
868
|
+
);
|
|
820
869
|
}
|
|
821
870
|
throw new CreativeFormatProjectionError(
|
|
822
871
|
operation,
|
|
@@ -825,7 +874,8 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
825
874
|
);
|
|
826
875
|
}
|
|
827
876
|
const formatId = selectLegacyRef(creativeRecord, selectorContainer, canonicalFormatLegacyResolver, operation);
|
|
828
|
-
if (formatId)
|
|
877
|
+
if (formatId)
|
|
878
|
+
return projectCreative(creativeRecord, formatId, legacyFormatDefinitions);
|
|
829
879
|
if (typeof creativeRecord.format_kind === "string") {
|
|
830
880
|
const creativeId = typeof creativeRecord.creative_id === "string" ? creativeRecord.creative_id : "(unknown)";
|
|
831
881
|
const allCandidates = candidatesFromContainer(selectorContainer, canonicalFormatLegacyResolver, operation);
|
|
@@ -860,10 +910,19 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
860
910
|
"canonical format legacy resolver returned an invalid or ambiguous creative mapping"
|
|
861
911
|
);
|
|
862
912
|
}
|
|
863
|
-
if (resolved)
|
|
913
|
+
if (resolved)
|
|
914
|
+
return projectCreative(
|
|
915
|
+
creativeRecord,
|
|
916
|
+
resolved[0],
|
|
917
|
+
legacyFormatDefinitions
|
|
918
|
+
);
|
|
864
919
|
const pinned = optionReference(creativeRecord.format_option_ref) !== void 0;
|
|
865
920
|
if (candidates.length === 1 && !pinned) {
|
|
866
|
-
return projectCreative(
|
|
921
|
+
return projectCreative(
|
|
922
|
+
creativeRecord,
|
|
923
|
+
candidates[0].ref,
|
|
924
|
+
legacyFormatDefinitions
|
|
925
|
+
);
|
|
867
926
|
}
|
|
868
927
|
if (candidates.length > 1) {
|
|
869
928
|
throw new CreativeFormatProjectionError(
|
|
@@ -877,7 +936,7 @@ function projectCreativeForDelivery(creative, selectorContainer, wireMode = "can
|
|
|
877
936
|
}
|
|
878
937
|
return creative;
|
|
879
938
|
}
|
|
880
|
-
function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", operation = "create_media_buy", legacyFormatConverter, canonicalFormatLegacyResolver) {
|
|
939
|
+
function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", operation = "create_media_buy", legacyFormatConverter, canonicalFormatLegacyResolver, legacyFormatDefinitions) {
|
|
881
940
|
const requestRecord = record(request);
|
|
882
941
|
if (!requestRecord) return request;
|
|
883
942
|
let changed = false;
|
|
@@ -897,7 +956,8 @@ function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", op
|
|
|
897
956
|
wireMode,
|
|
898
957
|
operation,
|
|
899
958
|
legacyFormatConverter,
|
|
900
|
-
canonicalFormatLegacyResolver
|
|
959
|
+
canonicalFormatLegacyResolver,
|
|
960
|
+
legacyFormatDefinitions
|
|
901
961
|
);
|
|
902
962
|
if (projected !== creativeValue) changed = true;
|
|
903
963
|
return projected;
|
|
@@ -915,7 +975,7 @@ function projectMediaBuyCreativesForDelivery(request, wireMode = "canonical", op
|
|
|
915
975
|
}
|
|
916
976
|
return changed ? next : request;
|
|
917
977
|
}
|
|
918
|
-
function projectSyncCreativesForDelivery(request, selectorContainers, wireMode = "canonical", legacyFormatConverter, canonicalFormatLegacyResolver) {
|
|
978
|
+
function projectSyncCreativesForDelivery(request, selectorContainers, wireMode = "canonical", legacyFormatConverter, canonicalFormatLegacyResolver, legacyFormatDefinitions) {
|
|
919
979
|
const requestRecord = record(request);
|
|
920
980
|
if (!requestRecord || !Array.isArray(requestRecord.creatives)) {
|
|
921
981
|
return request;
|
|
@@ -944,7 +1004,8 @@ function projectSyncCreativesForDelivery(request, selectorContainers, wireMode =
|
|
|
944
1004
|
wireMode,
|
|
945
1005
|
"sync_creatives",
|
|
946
1006
|
legacyFormatConverter,
|
|
947
|
-
canonicalFormatLegacyResolver
|
|
1007
|
+
canonicalFormatLegacyResolver,
|
|
1008
|
+
legacyFormatDefinitions
|
|
948
1009
|
);
|
|
949
1010
|
if (projected !== creativeValue) changed = true;
|
|
950
1011
|
return projected;
|
|
@@ -1114,9 +1175,15 @@ function resolveCreativeFormatWireMode(capabilities, negotiatedVersion) {
|
|
|
1114
1175
|
if (explicitCanonical === false) return "legacy";
|
|
1115
1176
|
return "unknown";
|
|
1116
1177
|
}
|
|
1178
|
+
function canUseProductOptionsForCreativeWire(capabilities, requestedVersion) {
|
|
1179
|
+
const caps = record(capabilities);
|
|
1180
|
+
const negotiated = mutuallyServedRelease(caps, record(caps?._raw), requestedVersion);
|
|
1181
|
+
return negotiated?.major === 3 && negotiated.minor === 1;
|
|
1182
|
+
}
|
|
1117
1183
|
export {
|
|
1118
1184
|
CreativeFormatCapabilityError,
|
|
1119
1185
|
CreativeFormatProjectionError,
|
|
1186
|
+
canUseProductOptionsForCreativeWire,
|
|
1120
1187
|
projectCreativeForDelivery,
|
|
1121
1188
|
projectMediaBuyCreativesForDelivery,
|
|
1122
1189
|
projectSyncCreativesForDelivery,
|