@adcp/sdk 16.0.0-beta.8 → 16.0.0-beta.9
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 +3 -0
- 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/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 +6 -0
- package/dist/lib/server/create-adcp-server.mjs +6 -0
- 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/creative-delivery.d.mts +2 -0
- package/dist/lib/v2/projection/creative-delivery.d.ts +2 -0
- package/dist/lib/v2/projection/creative-delivery.js +7 -0
- package/dist/lib/v2/projection/creative-delivery.mjs +6 -0
- 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 +45 -6
- package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +15 -18
- package/docs/guides/VALIDATE-YOUR-AGENT.md +5 -0
- package/docs/llms.txt +2 -2
- 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-drop-adcp-2.md +25 -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
|
@@ -1,95 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Format Renders Normalizer
|
|
3
|
-
*
|
|
4
|
-
* Handles conversion between v2 top-level dimensions and v3 renders array.
|
|
5
|
-
* The library exposes only v3 API (renders array) to clients,
|
|
6
|
-
* and internally normalizes responses from v2 servers.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Dimensions for a render
|
|
10
|
-
*/
|
|
1
|
+
/** Helpers for reading AdCP 3 format renders. */
|
|
11
2
|
export interface RenderDimensions {
|
|
12
3
|
width: number;
|
|
13
4
|
height: number;
|
|
14
5
|
}
|
|
15
|
-
/**
|
|
16
|
-
* v3 render specification — one entry in `Format.renders[]`.
|
|
17
|
-
*
|
|
18
|
-
* Renamed from `FormatRender` (see deprecated alias below) to free the
|
|
19
|
-
* `FormatRender` name for the factory namespace in `format-render-builders`,
|
|
20
|
-
* which is the more common autocomplete target. TypeScript keeps type and
|
|
21
|
-
* value namespaces separate, but the re-export barrel in `src/lib/index.ts`
|
|
22
|
-
* can't disambiguate between a type re-export and a const re-export at the
|
|
23
|
-
* same name — hence the rename.
|
|
24
|
-
*/
|
|
6
|
+
/** One entry in an AdCP 3 format's renders array. */
|
|
25
7
|
export interface FormatRenderEntry {
|
|
26
|
-
/** Unique identifier for this render */
|
|
27
8
|
render_id: string;
|
|
28
|
-
/** Semantic role (e.g., 'primary', 'companion', 'mobile_variant') */
|
|
29
9
|
role: string;
|
|
30
|
-
/** Dimensions of this render */
|
|
31
10
|
dimensions?: RenderDimensions;
|
|
32
|
-
/** Whether dimensions come from format_id parameters */
|
|
33
11
|
parameters_from_format_id?: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated Renamed to `FormatRenderEntry`. This alias keeps existing
|
|
37
|
-
* imports compiling but is not re-exported from the package barrel
|
|
38
|
-
* (`@adcp/sdk`) — the barrel's `FormatRender` identifier now refers to
|
|
39
|
-
* the factory namespace. Migrate to `FormatRenderEntry` next release.
|
|
40
|
-
*/
|
|
41
|
-
export type FormatRender = FormatRenderEntry;
|
|
42
|
-
/**
|
|
43
|
-
* v2 format with top-level dimensions
|
|
44
|
-
*/
|
|
45
|
-
export interface FormatV2 {
|
|
46
|
-
width?: number;
|
|
47
|
-
height?: number;
|
|
48
|
-
dimensions?: RenderDimensions;
|
|
49
12
|
[key: string]: unknown;
|
|
50
13
|
}
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
*/
|
|
14
|
+
/** @deprecated Use FormatRenderEntry; the package's FormatRender export is a factory namespace. */
|
|
15
|
+
export type FormatRender = FormatRenderEntry;
|
|
54
16
|
export interface FormatV3 {
|
|
55
17
|
renders?: FormatRenderEntry[];
|
|
56
18
|
[key: string]: unknown;
|
|
57
19
|
}
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export declare function
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export declare function
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export declare function getPrimaryRender(format: FormatV2 | FormatV3): FormatRenderEntry | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* Get companion renders from a format
|
|
77
|
-
*/
|
|
78
|
-
export declare function getCompanionRenders(format: FormatV2 | FormatV3): FormatRenderEntry[];
|
|
79
|
-
/**
|
|
80
|
-
* Check if format has multiple renders (companion ads, adaptive)
|
|
81
|
-
*/
|
|
82
|
-
export declare function isMultiRenderFormat(format: FormatV2 | FormatV3): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Check if format uses v2 top-level dimensions
|
|
85
|
-
*/
|
|
86
|
-
export declare function usesV2Dimensions(format: any): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Check if format uses v3 renders array
|
|
89
|
-
*/
|
|
90
|
-
export declare function usesV3Renders(format: any): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Get format dimensions (works with both v2 and v3)
|
|
93
|
-
* For multi-render formats, returns primary render dimensions
|
|
94
|
-
*/
|
|
95
|
-
export declare function getFormatDimensions(format: FormatV2 | FormatV3): RenderDimensions | undefined;
|
|
20
|
+
/** Preserve a format's supplied AdCP 3 renders and extension fields. */
|
|
21
|
+
export declare function normalizeFormatRenders<T extends FormatV3>(format: T): T;
|
|
22
|
+
export declare function normalizeFormatsResponse(formats: FormatV3[]): {
|
|
23
|
+
formats: FormatV3[];
|
|
24
|
+
};
|
|
25
|
+
export declare function normalizeFormatsResponse<T extends {
|
|
26
|
+
formats?: FormatV3[];
|
|
27
|
+
}>(response: T): T;
|
|
28
|
+
export declare function getFormatRenders(format: FormatV3): FormatRenderEntry[];
|
|
29
|
+
/** Select the primary render, or the first supplied render when no primary is declared. */
|
|
30
|
+
export declare function getPrimaryRender(format: FormatV3): FormatRenderEntry | undefined;
|
|
31
|
+
export declare function getCompanionRenders(format: FormatV3): FormatRenderEntry[];
|
|
32
|
+
export declare function isMultiRenderFormat(format: FormatV3): boolean;
|
|
33
|
+
export declare function usesV3Renders(format: FormatV3): boolean;
|
|
34
|
+
/** Return the selected render's dimensions, when provided. */
|
|
35
|
+
export declare function getFormatDimensions(format: FormatV3): RenderDimensions | undefined;
|
|
@@ -1,95 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Format Renders Normalizer
|
|
3
|
-
*
|
|
4
|
-
* Handles conversion between v2 top-level dimensions and v3 renders array.
|
|
5
|
-
* The library exposes only v3 API (renders array) to clients,
|
|
6
|
-
* and internally normalizes responses from v2 servers.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Dimensions for a render
|
|
10
|
-
*/
|
|
1
|
+
/** Helpers for reading AdCP 3 format renders. */
|
|
11
2
|
export interface RenderDimensions {
|
|
12
3
|
width: number;
|
|
13
4
|
height: number;
|
|
14
5
|
}
|
|
15
|
-
/**
|
|
16
|
-
* v3 render specification — one entry in `Format.renders[]`.
|
|
17
|
-
*
|
|
18
|
-
* Renamed from `FormatRender` (see deprecated alias below) to free the
|
|
19
|
-
* `FormatRender` name for the factory namespace in `format-render-builders`,
|
|
20
|
-
* which is the more common autocomplete target. TypeScript keeps type and
|
|
21
|
-
* value namespaces separate, but the re-export barrel in `src/lib/index.ts`
|
|
22
|
-
* can't disambiguate between a type re-export and a const re-export at the
|
|
23
|
-
* same name — hence the rename.
|
|
24
|
-
*/
|
|
6
|
+
/** One entry in an AdCP 3 format's renders array. */
|
|
25
7
|
export interface FormatRenderEntry {
|
|
26
|
-
/** Unique identifier for this render */
|
|
27
8
|
render_id: string;
|
|
28
|
-
/** Semantic role (e.g., 'primary', 'companion', 'mobile_variant') */
|
|
29
9
|
role: string;
|
|
30
|
-
/** Dimensions of this render */
|
|
31
10
|
dimensions?: RenderDimensions;
|
|
32
|
-
/** Whether dimensions come from format_id parameters */
|
|
33
11
|
parameters_from_format_id?: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated Renamed to `FormatRenderEntry`. This alias keeps existing
|
|
37
|
-
* imports compiling but is not re-exported from the package barrel
|
|
38
|
-
* (`@adcp/sdk`) — the barrel's `FormatRender` identifier now refers to
|
|
39
|
-
* the factory namespace. Migrate to `FormatRenderEntry` next release.
|
|
40
|
-
*/
|
|
41
|
-
export type FormatRender = FormatRenderEntry;
|
|
42
|
-
/**
|
|
43
|
-
* v2 format with top-level dimensions
|
|
44
|
-
*/
|
|
45
|
-
export interface FormatV2 {
|
|
46
|
-
width?: number;
|
|
47
|
-
height?: number;
|
|
48
|
-
dimensions?: RenderDimensions;
|
|
49
12
|
[key: string]: unknown;
|
|
50
13
|
}
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
*/
|
|
14
|
+
/** @deprecated Use FormatRenderEntry; the package's FormatRender export is a factory namespace. */
|
|
15
|
+
export type FormatRender = FormatRenderEntry;
|
|
54
16
|
export interface FormatV3 {
|
|
55
17
|
renders?: FormatRenderEntry[];
|
|
56
18
|
[key: string]: unknown;
|
|
57
19
|
}
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export declare function
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export declare function
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export declare function getPrimaryRender(format: FormatV2 | FormatV3): FormatRenderEntry | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* Get companion renders from a format
|
|
77
|
-
*/
|
|
78
|
-
export declare function getCompanionRenders(format: FormatV2 | FormatV3): FormatRenderEntry[];
|
|
79
|
-
/**
|
|
80
|
-
* Check if format has multiple renders (companion ads, adaptive)
|
|
81
|
-
*/
|
|
82
|
-
export declare function isMultiRenderFormat(format: FormatV2 | FormatV3): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Check if format uses v2 top-level dimensions
|
|
85
|
-
*/
|
|
86
|
-
export declare function usesV2Dimensions(format: any): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Check if format uses v3 renders array
|
|
89
|
-
*/
|
|
90
|
-
export declare function usesV3Renders(format: any): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Get format dimensions (works with both v2 and v3)
|
|
93
|
-
* For multi-render formats, returns primary render dimensions
|
|
94
|
-
*/
|
|
95
|
-
export declare function getFormatDimensions(format: FormatV2 | FormatV3): RenderDimensions | undefined;
|
|
20
|
+
/** Preserve a format's supplied AdCP 3 renders and extension fields. */
|
|
21
|
+
export declare function normalizeFormatRenders<T extends FormatV3>(format: T): T;
|
|
22
|
+
export declare function normalizeFormatsResponse(formats: FormatV3[]): {
|
|
23
|
+
formats: FormatV3[];
|
|
24
|
+
};
|
|
25
|
+
export declare function normalizeFormatsResponse<T extends {
|
|
26
|
+
formats?: FormatV3[];
|
|
27
|
+
}>(response: T): T;
|
|
28
|
+
export declare function getFormatRenders(format: FormatV3): FormatRenderEntry[];
|
|
29
|
+
/** Select the primary render, or the first supplied render when no primary is declared. */
|
|
30
|
+
export declare function getPrimaryRender(format: FormatV3): FormatRenderEntry | undefined;
|
|
31
|
+
export declare function getCompanionRenders(format: FormatV3): FormatRenderEntry[];
|
|
32
|
+
export declare function isMultiRenderFormat(format: FormatV3): boolean;
|
|
33
|
+
export declare function usesV3Renders(format: FormatV3): boolean;
|
|
34
|
+
/** Return the selected render's dimensions, when provided. */
|
|
35
|
+
export declare function getFormatDimensions(format: FormatV3): RenderDimensions | undefined;
|
|
@@ -25,92 +25,33 @@ __export(format_renders_exports, {
|
|
|
25
25
|
isMultiRenderFormat: () => isMultiRenderFormat,
|
|
26
26
|
normalizeFormatRenders: () => normalizeFormatRenders,
|
|
27
27
|
normalizeFormatsResponse: () => normalizeFormatsResponse,
|
|
28
|
-
usesV2Dimensions: () => usesV2Dimensions,
|
|
29
28
|
usesV3Renders: () => usesV3Renders
|
|
30
29
|
});
|
|
31
30
|
module.exports = __toCommonJS(format_renders_exports);
|
|
32
31
|
function normalizeFormatRenders(format) {
|
|
33
|
-
|
|
34
|
-
return format;
|
|
35
|
-
}
|
|
36
|
-
const v2Format = format;
|
|
37
|
-
const hasWidth = v2Format.width !== void 0;
|
|
38
|
-
const hasHeight = v2Format.height !== void 0;
|
|
39
|
-
const hasDimensions = v2Format.dimensions !== void 0;
|
|
40
|
-
if (!hasWidth && !hasHeight && !hasDimensions) {
|
|
41
|
-
return format;
|
|
42
|
-
}
|
|
43
|
-
let dimensions;
|
|
44
|
-
if (hasDimensions) {
|
|
45
|
-
dimensions = v2Format.dimensions;
|
|
46
|
-
} else if (hasWidth || hasHeight) {
|
|
47
|
-
dimensions = {
|
|
48
|
-
width: v2Format.width ?? 0,
|
|
49
|
-
height: v2Format.height ?? 0
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
const { width, height, dimensions: _, ...rest } = v2Format;
|
|
53
|
-
return {
|
|
54
|
-
...rest,
|
|
55
|
-
renders: [
|
|
56
|
-
{
|
|
57
|
-
render_id: "primary",
|
|
58
|
-
role: "primary",
|
|
59
|
-
dimensions
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
};
|
|
32
|
+
return format;
|
|
63
33
|
}
|
|
64
34
|
function normalizeFormatsResponse(response) {
|
|
65
|
-
|
|
66
|
-
return { formats: response.map(normalizeFormatRenders) };
|
|
67
|
-
}
|
|
68
|
-
if (!response.formats || !Array.isArray(response.formats)) {
|
|
69
|
-
return response;
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
...response,
|
|
73
|
-
formats: response.formats.map(normalizeFormatRenders)
|
|
74
|
-
};
|
|
35
|
+
return Array.isArray(response) ? { formats: response } : response;
|
|
75
36
|
}
|
|
76
37
|
function getFormatRenders(format) {
|
|
77
|
-
|
|
78
|
-
return normalized.renders ?? [];
|
|
38
|
+
return format.renders ?? [];
|
|
79
39
|
}
|
|
80
40
|
function getPrimaryRender(format) {
|
|
81
41
|
const renders = getFormatRenders(format);
|
|
82
|
-
return renders.find((
|
|
42
|
+
return renders.find((render) => render.role === "primary") ?? renders[0];
|
|
83
43
|
}
|
|
84
44
|
function getCompanionRenders(format) {
|
|
85
|
-
|
|
86
|
-
return renders.filter((r) => r.role === "companion");
|
|
45
|
+
return getFormatRenders(format).filter((render) => render.role === "companion");
|
|
87
46
|
}
|
|
88
47
|
function isMultiRenderFormat(format) {
|
|
89
|
-
|
|
90
|
-
return renders.length > 1;
|
|
91
|
-
}
|
|
92
|
-
function usesV2Dimensions(format) {
|
|
93
|
-
return (format.width !== void 0 || format.height !== void 0 || format.dimensions !== void 0) && !format.renders;
|
|
48
|
+
return getFormatRenders(format).length > 1;
|
|
94
49
|
}
|
|
95
50
|
function usesV3Renders(format) {
|
|
96
51
|
return Array.isArray(format.renders);
|
|
97
52
|
}
|
|
98
53
|
function getFormatDimensions(format) {
|
|
99
|
-
|
|
100
|
-
const primary = getPrimaryRender(format);
|
|
101
|
-
return primary?.dimensions;
|
|
102
|
-
}
|
|
103
|
-
const v2Format = format;
|
|
104
|
-
if (v2Format.dimensions) {
|
|
105
|
-
return v2Format.dimensions;
|
|
106
|
-
}
|
|
107
|
-
if (v2Format.width !== void 0 || v2Format.height !== void 0) {
|
|
108
|
-
return {
|
|
109
|
-
width: v2Format.width ?? 0,
|
|
110
|
-
height: v2Format.height ?? 0
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
return void 0;
|
|
54
|
+
return getPrimaryRender(format)?.dimensions;
|
|
114
55
|
}
|
|
115
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
116
57
|
0 && (module.exports = {
|
|
@@ -121,6 +62,5 @@ function getFormatDimensions(format) {
|
|
|
121
62
|
isMultiRenderFormat,
|
|
122
63
|
normalizeFormatRenders,
|
|
123
64
|
normalizeFormatsResponse,
|
|
124
|
-
usesV2Dimensions,
|
|
125
65
|
usesV3Renders
|
|
126
66
|
});
|
|
@@ -1,85 +1,27 @@
|
|
|
1
1
|
function normalizeFormatRenders(format) {
|
|
2
|
-
|
|
3
|
-
return format;
|
|
4
|
-
}
|
|
5
|
-
const v2Format = format;
|
|
6
|
-
const hasWidth = v2Format.width !== void 0;
|
|
7
|
-
const hasHeight = v2Format.height !== void 0;
|
|
8
|
-
const hasDimensions = v2Format.dimensions !== void 0;
|
|
9
|
-
if (!hasWidth && !hasHeight && !hasDimensions) {
|
|
10
|
-
return format;
|
|
11
|
-
}
|
|
12
|
-
let dimensions;
|
|
13
|
-
if (hasDimensions) {
|
|
14
|
-
dimensions = v2Format.dimensions;
|
|
15
|
-
} else if (hasWidth || hasHeight) {
|
|
16
|
-
dimensions = {
|
|
17
|
-
width: v2Format.width ?? 0,
|
|
18
|
-
height: v2Format.height ?? 0
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const { width, height, dimensions: _, ...rest } = v2Format;
|
|
22
|
-
return {
|
|
23
|
-
...rest,
|
|
24
|
-
renders: [
|
|
25
|
-
{
|
|
26
|
-
render_id: "primary",
|
|
27
|
-
role: "primary",
|
|
28
|
-
dimensions
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
};
|
|
2
|
+
return format;
|
|
32
3
|
}
|
|
33
4
|
function normalizeFormatsResponse(response) {
|
|
34
|
-
|
|
35
|
-
return { formats: response.map(normalizeFormatRenders) };
|
|
36
|
-
}
|
|
37
|
-
if (!response.formats || !Array.isArray(response.formats)) {
|
|
38
|
-
return response;
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
...response,
|
|
42
|
-
formats: response.formats.map(normalizeFormatRenders)
|
|
43
|
-
};
|
|
5
|
+
return Array.isArray(response) ? { formats: response } : response;
|
|
44
6
|
}
|
|
45
7
|
function getFormatRenders(format) {
|
|
46
|
-
|
|
47
|
-
return normalized.renders ?? [];
|
|
8
|
+
return format.renders ?? [];
|
|
48
9
|
}
|
|
49
10
|
function getPrimaryRender(format) {
|
|
50
11
|
const renders = getFormatRenders(format);
|
|
51
|
-
return renders.find((
|
|
12
|
+
return renders.find((render) => render.role === "primary") ?? renders[0];
|
|
52
13
|
}
|
|
53
14
|
function getCompanionRenders(format) {
|
|
54
|
-
|
|
55
|
-
return renders.filter((r) => r.role === "companion");
|
|
15
|
+
return getFormatRenders(format).filter((render) => render.role === "companion");
|
|
56
16
|
}
|
|
57
17
|
function isMultiRenderFormat(format) {
|
|
58
|
-
|
|
59
|
-
return renders.length > 1;
|
|
60
|
-
}
|
|
61
|
-
function usesV2Dimensions(format) {
|
|
62
|
-
return (format.width !== void 0 || format.height !== void 0 || format.dimensions !== void 0) && !format.renders;
|
|
18
|
+
return getFormatRenders(format).length > 1;
|
|
63
19
|
}
|
|
64
20
|
function usesV3Renders(format) {
|
|
65
21
|
return Array.isArray(format.renders);
|
|
66
22
|
}
|
|
67
23
|
function getFormatDimensions(format) {
|
|
68
|
-
|
|
69
|
-
const primary = getPrimaryRender(format);
|
|
70
|
-
return primary?.dimensions;
|
|
71
|
-
}
|
|
72
|
-
const v2Format = format;
|
|
73
|
-
if (v2Format.dimensions) {
|
|
74
|
-
return v2Format.dimensions;
|
|
75
|
-
}
|
|
76
|
-
if (v2Format.width !== void 0 || v2Format.height !== void 0) {
|
|
77
|
-
return {
|
|
78
|
-
width: v2Format.width ?? 0,
|
|
79
|
-
height: v2Format.height ?? 0
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
return void 0;
|
|
24
|
+
return getPrimaryRender(format)?.dimensions;
|
|
83
25
|
}
|
|
84
26
|
export {
|
|
85
27
|
getCompanionRenders,
|
|
@@ -89,6 +31,5 @@ export {
|
|
|
89
31
|
isMultiRenderFormat,
|
|
90
32
|
normalizeFormatRenders,
|
|
91
33
|
normalizeFormatsResponse,
|
|
92
|
-
usesV2Dimensions,
|
|
93
34
|
usesV3Renders
|
|
94
35
|
};
|
|
@@ -37,8 +37,7 @@ export type { ExtractedAdcpError } from './error-extraction.mjs';
|
|
|
37
37
|
export { detectProtocol, detectProtocolWithTimeout } from './protocol-detection.mjs';
|
|
38
38
|
export { A2A_CARD_PATHS, TRANSPORT_SUFFIX_REGEX, isAgentCardPath, isWellKnownAgentCardUrl, buildCardUrls, stripAgentCardPath, stripTransportSuffix, } from './a2a-discovery.mjs';
|
|
39
39
|
export { getFormatAssets, getRequiredAssets, getOptionalAssets, getIndividualAssets, getRepeatableGroups, usesDeprecatedAssetsField, getAssetCount, hasAssets, type CanonicalFormatAssetSlot, type FormatAssetsInput, type IndividualFormatAssetSlot, type RepeatableFormatAssetGroup, } from './format-assets.mjs';
|
|
40
|
-
export {
|
|
41
|
-
export { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter.mjs';
|
|
40
|
+
export { normalizeProductChannels, normalizePricingOption, normalizeProductPricing, normalizeGetProductsResponse, usesV2PricingFields, usesV3PricingFields, isFixedPricing, isCPAPricing, getPrice, getFloorPrice, type PricingOptionV2, type PricingOptionV3, type PriceGuidanceV2, type PriceGuidanceV3, } from './pricing-adapter.mjs';
|
|
42
41
|
export { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from './creative-delivery.mjs';
|
|
43
42
|
export type { InlineCreativeAssignment, InlineCreativePackage, InlineCreativePackagePatch, InlineCreativesForPackagesOptions, InlineCreativesForPackagesLegacyOptions, LegacyInlineCreativePackage, } from './creative-delivery.mjs';
|
|
44
43
|
export { paginate, paginatePages, type PaginateOptions } from './pagination.mjs';
|
|
@@ -37,8 +37,7 @@ export type { ExtractedAdcpError } from './error-extraction';
|
|
|
37
37
|
export { detectProtocol, detectProtocolWithTimeout } from './protocol-detection';
|
|
38
38
|
export { A2A_CARD_PATHS, TRANSPORT_SUFFIX_REGEX, isAgentCardPath, isWellKnownAgentCardUrl, buildCardUrls, stripAgentCardPath, stripTransportSuffix, } from './a2a-discovery';
|
|
39
39
|
export { getFormatAssets, getRequiredAssets, getOptionalAssets, getIndividualAssets, getRepeatableGroups, usesDeprecatedAssetsField, getAssetCount, hasAssets, type CanonicalFormatAssetSlot, type FormatAssetsInput, type IndividualFormatAssetSlot, type RepeatableFormatAssetGroup, } from './format-assets';
|
|
40
|
-
export {
|
|
41
|
-
export { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter';
|
|
40
|
+
export { normalizeProductChannels, normalizePricingOption, normalizeProductPricing, normalizeGetProductsResponse, usesV2PricingFields, usesV3PricingFields, isFixedPricing, isCPAPricing, getPrice, getFloorPrice, type PricingOptionV2, type PricingOptionV3, type PriceGuidanceV2, type PriceGuidanceV3, } from './pricing-adapter';
|
|
42
41
|
export { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from './creative-delivery';
|
|
43
42
|
export type { InlineCreativeAssignment, InlineCreativePackage, InlineCreativePackagePatch, InlineCreativesForPackagesOptions, InlineCreativesForPackagesLegacyOptions, LegacyInlineCreativePackage, } from './creative-delivery';
|
|
44
43
|
export { paginate, paginatePages, type PaginateOptions } from './pagination';
|
package/dist/lib/utils/index.js
CHANGED
|
@@ -24,9 +24,6 @@ __export(utils_exports, {
|
|
|
24
24
|
MAX_CONCURRENT: () => MAX_CONCURRENT,
|
|
25
25
|
REQUEST_TIMEOUT: () => REQUEST_TIMEOUT,
|
|
26
26
|
TRANSPORT_SUFFIX_REGEX: () => import_a2a_discovery.TRANSPORT_SUFFIX_REGEX,
|
|
27
|
-
adaptGetProductsRequestForV2: () => import_pricing_adapter.adaptGetProductsRequestForV2,
|
|
28
|
-
adaptPricingOptionForV2: () => import_pricing_adapter.adaptPricingOptionForV2,
|
|
29
|
-
adaptSyncCreativesRequestForV2: () => import_sync_creatives_adapter.adaptSyncCreativesRequestForV2,
|
|
30
27
|
batchPreviewFormatsLegacy: () => import_preview_utils.batchPreviewFormatsLegacy,
|
|
31
28
|
batchPreviewProducts: () => import_preview_utils.batchPreviewProducts,
|
|
32
29
|
buildCardUrls: () => import_a2a_discovery.buildCardUrls,
|
|
@@ -100,7 +97,6 @@ var import_protocol_detection = require('./protocol-detection.js');
|
|
|
100
97
|
var import_a2a_discovery = require('./a2a-discovery.js');
|
|
101
98
|
var import_format_assets = require('./format-assets.js');
|
|
102
99
|
var import_pricing_adapter = require('./pricing-adapter.js');
|
|
103
|
-
var import_sync_creatives_adapter = require('./sync-creatives-adapter.js');
|
|
104
100
|
var import_creative_delivery = require('./creative-delivery.js');
|
|
105
101
|
var import_pagination = require('./pagination.js');
|
|
106
102
|
const REQUEST_TIMEOUT = parseInt(process.env.REQUEST_TIMEOUT || "30000");
|
|
@@ -215,9 +211,6 @@ function getStandardFormatsLegacy() {
|
|
|
215
211
|
MAX_CONCURRENT,
|
|
216
212
|
REQUEST_TIMEOUT,
|
|
217
213
|
TRANSPORT_SUFFIX_REGEX,
|
|
218
|
-
adaptGetProductsRequestForV2,
|
|
219
|
-
adaptPricingOptionForV2,
|
|
220
|
-
adaptSyncCreativesRequestForV2,
|
|
221
214
|
batchPreviewFormatsLegacy,
|
|
222
215
|
batchPreviewProducts,
|
|
223
216
|
buildCardUrls,
|
package/dist/lib/utils/index.mjs
CHANGED
|
@@ -158,9 +158,7 @@ import {
|
|
|
158
158
|
hasAssets
|
|
159
159
|
} from "./format-assets.mjs";
|
|
160
160
|
import {
|
|
161
|
-
adaptGetProductsRequestForV2,
|
|
162
161
|
normalizeProductChannels,
|
|
163
|
-
adaptPricingOptionForV2,
|
|
164
162
|
normalizePricingOption,
|
|
165
163
|
normalizeProductPricing,
|
|
166
164
|
normalizeGetProductsResponse,
|
|
@@ -171,7 +169,6 @@ import {
|
|
|
171
169
|
getPrice,
|
|
172
170
|
getFloorPrice
|
|
173
171
|
} from "./pricing-adapter.mjs";
|
|
174
|
-
import { adaptSyncCreativesRequestForV2 } from "./sync-creatives-adapter.mjs";
|
|
175
172
|
import { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from "./creative-delivery.mjs";
|
|
176
173
|
import { paginate, paginatePages } from "./pagination.mjs";
|
|
177
174
|
export {
|
|
@@ -181,9 +178,6 @@ export {
|
|
|
181
178
|
MAX_CONCURRENT,
|
|
182
179
|
REQUEST_TIMEOUT,
|
|
183
180
|
TRANSPORT_SUFFIX_REGEX,
|
|
184
|
-
adaptGetProductsRequestForV2,
|
|
185
|
-
adaptPricingOptionForV2,
|
|
186
|
-
adaptSyncCreativesRequestForV2,
|
|
187
181
|
batchPreviewFormatsLegacy,
|
|
188
182
|
batchPreviewProducts,
|
|
189
183
|
buildCardUrls,
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preview Response Normalizer
|
|
3
|
-
*
|
|
4
|
-
* Handles conversion between v2 output_id/output_role and v3 render_id/role.
|
|
5
|
-
* The library exposes only v3 API to clients.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* v3 preview render
|
|
9
|
-
*/
|
|
1
|
+
/** Helpers for reading AdCP 3 creative previews. */
|
|
10
2
|
export interface PreviewRendererMetadata {
|
|
11
|
-
/** Stable identifier for the renderer implementation. */
|
|
12
3
|
renderer_id: string;
|
|
13
|
-
/** Exact semantic version of the renderer implementation. */
|
|
14
4
|
version: string;
|
|
15
|
-
/** Named package export or implementation entry point used. */
|
|
16
5
|
export: string;
|
|
17
|
-
/** Whether this renderer represents serving-platform output or an approximation. */
|
|
18
6
|
fidelity: 'authoritative' | 'representative';
|
|
19
|
-
/** True when delivery and measurement side effects were suppressed. */
|
|
20
7
|
tracking_suppressed: boolean;
|
|
21
8
|
[key: string]: unknown;
|
|
22
9
|
}
|
|
@@ -35,36 +22,12 @@ export interface PreviewRenderV3 {
|
|
|
35
22
|
requires_https?: boolean;
|
|
36
23
|
supports_fullscreen?: boolean;
|
|
37
24
|
csp_policy?: string;
|
|
25
|
+
[key: string]: unknown;
|
|
38
26
|
};
|
|
39
27
|
/** Renderer provenance and safety metadata; it does not independently grant authority. */
|
|
40
28
|
renderer?: PreviewRendererMetadata;
|
|
29
|
+
[key: string]: unknown;
|
|
41
30
|
}
|
|
42
|
-
/**
|
|
43
|
-
* v2 preview render (with old field names)
|
|
44
|
-
*/
|
|
45
|
-
export interface PreviewRenderV2 {
|
|
46
|
-
output_id?: string;
|
|
47
|
-
output_role?: string;
|
|
48
|
-
render_id?: string;
|
|
49
|
-
role?: string;
|
|
50
|
-
output_format: 'url' | 'html' | 'both';
|
|
51
|
-
preview_url?: string;
|
|
52
|
-
preview_html?: string;
|
|
53
|
-
dimensions?: {
|
|
54
|
-
width: number;
|
|
55
|
-
height: number;
|
|
56
|
-
};
|
|
57
|
-
embedding?: {
|
|
58
|
-
recommended_sandbox?: string;
|
|
59
|
-
requires_https?: boolean;
|
|
60
|
-
supports_fullscreen?: boolean;
|
|
61
|
-
csp_policy?: string;
|
|
62
|
-
};
|
|
63
|
-
renderer?: PreviewRendererMetadata;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* v3 preview object
|
|
67
|
-
*/
|
|
68
31
|
export interface PreviewV3 {
|
|
69
32
|
preview_id: string;
|
|
70
33
|
renders: PreviewRenderV3[];
|
|
@@ -72,53 +35,41 @@ export interface PreviewV3 {
|
|
|
72
35
|
name: string;
|
|
73
36
|
macros?: Record<string, unknown>;
|
|
74
37
|
context_description?: string;
|
|
38
|
+
[key: string]: unknown;
|
|
75
39
|
};
|
|
76
40
|
interactive_url?: string;
|
|
77
41
|
expires_at: string;
|
|
42
|
+
[key: string]: unknown;
|
|
78
43
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
*/
|
|
94
|
-
export declare function
|
|
95
|
-
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
export declare function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
*/
|
|
102
|
-
export declare function getRenderId(render: PreviewRenderV2 | PreviewRenderV3): string;
|
|
103
|
-
/**
|
|
104
|
-
* Get render role from a render (works with both v2 and v3)
|
|
105
|
-
*/
|
|
106
|
-
export declare function getRenderRole(render: PreviewRenderV2 | PreviewRenderV3): string;
|
|
107
|
-
/**
|
|
108
|
-
* Get primary render from a preview
|
|
109
|
-
*/
|
|
44
|
+
interface PreviewCreativeResponseV3 {
|
|
45
|
+
previews?: PreviewV3[];
|
|
46
|
+
results?: {
|
|
47
|
+
success?: boolean;
|
|
48
|
+
response?: {
|
|
49
|
+
previews?: PreviewV3[];
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
};
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}[];
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
/** Preserve the supplied render, including provenance and extension fields. */
|
|
57
|
+
export declare function normalizePreviewRender<T extends PreviewRenderV3>(render: T): T;
|
|
58
|
+
/** Preserve an AdCP 3 preview and all of its supplied renders. */
|
|
59
|
+
export declare function normalizePreview<T extends PreviewV3>(preview: T): T;
|
|
60
|
+
/** Preserve an AdCP 3 single or batch preview response. */
|
|
61
|
+
export declare function normalizePreviewCreativeResponse<T extends PreviewCreativeResponseV3>(response: T): T;
|
|
62
|
+
export declare function usesV3RenderFields(render: PreviewRenderV3): boolean;
|
|
63
|
+
export declare function getRenderId(render: PreviewRenderV3): string;
|
|
64
|
+
export declare function getRenderRole(render: PreviewRenderV3): string;
|
|
65
|
+
/** Select the primary render, or the first supplied render when no primary is declared. */
|
|
110
66
|
export declare function getPrimaryPreviewRender(preview: {
|
|
111
|
-
renders:
|
|
67
|
+
renders: PreviewRenderV3[];
|
|
112
68
|
}): PreviewRenderV3 | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* Get preview URL from primary render
|
|
115
|
-
*/
|
|
116
69
|
export declare function getPreviewUrl(preview: {
|
|
117
|
-
renders:
|
|
70
|
+
renders: PreviewRenderV3[];
|
|
118
71
|
}): string | undefined;
|
|
119
|
-
/**
|
|
120
|
-
* Get preview HTML from primary render
|
|
121
|
-
*/
|
|
122
72
|
export declare function getPreviewHtml(preview: {
|
|
123
|
-
renders:
|
|
73
|
+
renders: PreviewRenderV3[];
|
|
124
74
|
}): string | undefined;
|
|
75
|
+
export {};
|