@adcp/sdk 16.0.0-beta.7 → 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 +20 -0
- package/bin/adcp.js +10 -13
- package/dist/lib/conformance/index.d.mts +2 -0
- package/dist/lib/conformance/index.d.ts +2 -0
- package/dist/lib/conformance/index.js +3 -0
- package/dist/lib/conformance/index.mjs +2 -0
- package/dist/lib/conformance/property-lists.d.mts +14 -0
- package/dist/lib/conformance/property-lists.d.ts +14 -0
- package/dist/lib/conformance/property-lists.js +45 -0
- package/dist/lib/conformance/property-lists.mjs +21 -0
- package/dist/lib/conformance/runConformance.js +20 -1
- package/dist/lib/conformance/runConformance.mjs +20 -1
- package/dist/lib/conformance/types.d.mts +3 -0
- package/dist/lib/conformance/types.d.ts +3 -0
- 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 +32 -115
- package/dist/lib/core/SingleAgentClient.d.ts +32 -115
- package/dist/lib/core/SingleAgentClient.js +379 -273
- package/dist/lib/core/SingleAgentClient.mjs +387 -275
- 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/identifiers.d.mts +53 -0
- package/dist/lib/identifiers.d.ts +53 -0
- package/dist/lib/identifiers.js +212 -0
- package/dist/lib/identifiers.mjs +163 -0
- package/dist/lib/index.d.mts +7 -5
- package/dist/lib/index.d.ts +7 -5
- package/dist/lib/index.js +2 -14
- package/dist/lib/index.mjs +1 -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/index.d.mts +1 -1
- package/dist/lib/media-buy/index.d.ts +1 -1
- 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/media-buy/property-policy.d.mts +15 -1
- package/dist/lib/media-buy/property-policy.d.ts +15 -1
- package/dist/lib/media-buy/property-policy.js +135 -3
- package/dist/lib/media-buy/property-policy.mjs +134 -3
- package/dist/lib/protocols/index.js +14 -22
- package/dist/lib/protocols/index.mjs +5 -13
- package/dist/lib/registry/index.d.mts +12 -0
- package/dist/lib/registry/index.d.ts +12 -0
- package/dist/lib/registry/index.js +159 -5
- package/dist/lib/registry/index.mjs +156 -4
- package/dist/lib/registry/types.d.mts +26 -2
- package/dist/lib/registry/types.d.ts +26 -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/server/decisioning/specialisms/lists.d.mts +4 -4
- package/dist/lib/server/decisioning/specialisms/lists.d.ts +4 -4
- package/dist/lib/server/index.d.mts +3 -0
- package/dist/lib/server/index.d.ts +3 -0
- package/dist/lib/server/index.js +8 -1
- package/dist/lib/server/index.mjs +4 -0
- package/dist/lib/server/property-lists.d.mts +36 -0
- package/dist/lib/server/property-lists.d.ts +36 -0
- package/dist/lib/server/property-lists.js +154 -0
- package/dist/lib/server/property-lists.mjs +129 -0
- package/dist/lib/server/targeting-helpers.d.mts +2 -0
- package/dist/lib/server/targeting-helpers.d.ts +2 -0
- package/dist/lib/server/targeting-helpers.js +28 -1
- package/dist/lib/server/targeting-helpers.mjs +18 -1
- package/dist/lib/signing/parser.js +2 -2
- package/dist/lib/signing/parser.mjs +2 -2
- package/dist/lib/signing/server.d.mts +1 -1
- package/dist/lib/signing/server.d.ts +1 -1
- package/dist/lib/signing/server.mjs +5 -1
- package/dist/lib/signing/webhook-verifier.d.mts +11 -0
- package/dist/lib/signing/webhook-verifier.d.ts +11 -0
- package/dist/lib/signing/webhook-verifier.js +11 -3
- package/dist/lib/signing/webhook-verifier.mjs +11 -3
- package/dist/lib/supply-path/verify.js +12 -2
- package/dist/lib/supply-path/verify.mjs +2 -2
- 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/PROPERTY-LISTS.md +264 -0
- package/docs/guides/SIGNING-GUIDE.md +25 -0
- 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,126 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Handles conversion between v2 creative_ids and v3 creative_assignments.
|
|
5
|
-
* The library exposes only v3 API (creative_assignments) to clients,
|
|
6
|
-
* and internally adapts requests for v2 servers.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* v3 creative assignment with optional weight and placement targeting
|
|
10
|
-
*/
|
|
1
|
+
/** Helpers for reading AdCP 3 creative assignments. */
|
|
2
|
+
/** Creative assignment with optional weight and placement targeting. */
|
|
11
3
|
export interface CreativeAssignment {
|
|
12
|
-
/** Unique identifier for the creative */
|
|
13
4
|
creative_id: string;
|
|
14
|
-
/** Delivery weight (0-100) for rotation */
|
|
15
5
|
weight?: number;
|
|
16
|
-
/** Optional placement IDs to restrict where this creative runs */
|
|
17
6
|
placement_ids?: string[];
|
|
7
|
+
[key: string]: unknown;
|
|
18
8
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Package request with creative assignments (v3 style)
|
|
21
|
-
*/
|
|
22
9
|
export interface PackageRequestV3 {
|
|
23
10
|
creative_assignments?: CreativeAssignment[];
|
|
24
|
-
creatives?:
|
|
25
|
-
[key: string]: unknown;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Package request with creative_ids (v2 style)
|
|
29
|
-
*/
|
|
30
|
-
export interface PackageRequestV2 {
|
|
31
|
-
creative_ids?: string[];
|
|
32
|
-
creatives?: any[];
|
|
11
|
+
creatives?: unknown[];
|
|
33
12
|
[key: string]: unknown;
|
|
34
13
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Package response with creative assignments (v3 style)
|
|
37
|
-
*/
|
|
38
14
|
export interface PackageResponseV3 {
|
|
39
15
|
creative_assignments?: CreativeAssignment[];
|
|
40
16
|
[key: string]: unknown;
|
|
41
17
|
}
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* exists yet, so `buyer_ref` is the actual required identifier). v3 doesn't
|
|
54
|
-
* model packages with `buyer_ref`, but `idempotency_key` carries equivalent
|
|
55
|
-
* client-controlled-unique-identity semantics. The `parentBuyerRef` plus
|
|
56
|
-
* `index` compose a stable per-package reference that re-derives identically
|
|
57
|
-
* on replay — preserving the idempotency contract sellers depend on for
|
|
58
|
-
* deduping.
|
|
59
|
-
*/
|
|
60
|
-
export interface PackageAdapterContext {
|
|
61
|
-
/** Top-level `buyer_ref` derived from the parent v3 request. */
|
|
62
|
-
parentBuyerRef?: string;
|
|
63
|
-
/** Position of the package within the parent's `packages[]` array. */
|
|
64
|
-
index?: number;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Adapt a v3-style package request for a v2 server.
|
|
68
|
-
* Converts creative_assignments to creative_ids (dropping weight and placement_ids).
|
|
69
|
-
* Strips v3-only package fields (optimization_goals, catalogs).
|
|
70
|
-
*
|
|
71
|
-
* When `ctx` is provided and the input has no `buyer_ref`, derives one from —
|
|
72
|
-
* in order — `package.context.buyer_ref`, `package.idempotency_key`, or
|
|
73
|
-
* `${ctx.parentBuyerRef}-${ctx.index}` so v2.5 package-request validation
|
|
74
|
-
* passes. Caller-supplied top-level `buyer_ref` always wins. The `context.buyer_ref`
|
|
75
|
-
* fallback exists because v3 callers put their per-package correlation ref in
|
|
76
|
-
* `context.buyer_ref` (per the 3.0 package schema); this adapter is the only
|
|
77
|
-
* place that promotes it back to the top-level shape v2.5 sellers still expect.
|
|
78
|
-
*/
|
|
79
|
-
export declare function adaptPackageRequestForV2(pkg: PackageRequestV3, ctx?: PackageAdapterContext): PackageRequestV2;
|
|
80
|
-
/**
|
|
81
|
-
* Adapt a create_media_buy request for a v2 server.
|
|
82
|
-
* Strips v3-only top-level fields, converts brand → brand_manifest, derives
|
|
83
|
-
* `buyer_ref` (top-level + per-package) from `context.buyer_ref` or
|
|
84
|
-
* `idempotency_key`, and adapts packages.
|
|
85
|
-
*
|
|
86
|
-
* v2.5 requires `buyer_ref` as the buyer's reference for THIS media buy,
|
|
87
|
-
* top-level + per-package. v3 removed the top-level field and moved buyer
|
|
88
|
-
* correlation into `context.buyer_ref`; `idempotency_key` carries the same
|
|
89
|
-
* client-controlled-unique-identity semantics. Preferring the caller's
|
|
90
|
-
* `context.buyer_ref` before falling back to `idempotency_key` preserves the
|
|
91
|
-
* buyer's stable reference on the wire when they provided one, and still
|
|
92
|
-
* satisfies v2.5 dedupe on replay when they did not. Caller-supplied
|
|
93
|
-
* top-level `buyer_ref` (if any) always wins.
|
|
94
|
-
*/
|
|
95
|
-
export declare function adaptCreateMediaBuyRequestForV2(request: any): any;
|
|
96
|
-
/**
|
|
97
|
-
* Adapt an update_media_buy request for a v2 server.
|
|
98
|
-
* Strips v3-only top-level fields and adapts packages.
|
|
99
|
-
*/
|
|
100
|
-
export declare function adaptUpdateMediaBuyRequestForV2(request: any): any;
|
|
101
|
-
/**
|
|
102
|
-
* Normalize a v2-style package response to v3.
|
|
103
|
-
* Converts creative_ids to creative_assignments and coerces null array fields
|
|
104
|
-
* to undefined so downstream consumers can safely use optional chaining.
|
|
105
|
-
*/
|
|
106
|
-
export declare function normalizePackageResponse(pkg: PackageResponseV2 | PackageResponseV3): PackageResponseV3;
|
|
107
|
-
/**
|
|
108
|
-
* Normalize a media buy response (converts all packages).
|
|
109
|
-
*/
|
|
110
|
-
export declare function normalizeMediaBuyResponse(response: any): any;
|
|
111
|
-
/**
|
|
112
|
-
* Check if a package uses v2 creative_ids format
|
|
113
|
-
*/
|
|
114
|
-
export declare function usesV2CreativeIds(pkg: any): boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Check if a package uses v3 creative_assignments format
|
|
117
|
-
*/
|
|
118
|
-
export declare function usesV3CreativeAssignments(pkg: any): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Get all creative IDs from a package (works with both v2 and v3 format)
|
|
121
|
-
*/
|
|
122
|
-
export declare function getCreativeIds(pkg: PackageResponseV2 | PackageResponseV3): string[];
|
|
123
|
-
/**
|
|
124
|
-
* Get creative assignments from a package (normalizes v2 to v3 format)
|
|
125
|
-
*/
|
|
126
|
-
export declare function getCreativeAssignments(pkg: PackageResponseV2 | PackageResponseV3): CreativeAssignment[];
|
|
18
|
+
/** Remove a null assignments array while preserving all extension fields. */
|
|
19
|
+
export declare function normalizePackageResponse<T extends PackageResponseV3>(pkg: T): T;
|
|
20
|
+
/** Normalize optional arrays in the packages of an AdCP 3 media buy response. */
|
|
21
|
+
export declare function normalizeMediaBuyResponse<T extends {
|
|
22
|
+
packages?: PackageResponseV3[];
|
|
23
|
+
}>(response: T): T;
|
|
24
|
+
export declare function usesV3CreativeAssignments(pkg: PackageResponseV3): boolean;
|
|
25
|
+
/** Return creative IDs in assignment order. */
|
|
26
|
+
export declare function getCreativeIds(pkg: PackageResponseV3): string[];
|
|
27
|
+
/** Return the supplied assignments, including their weights and extension fields. */
|
|
28
|
+
export declare function getCreativeAssignments(pkg: PackageResponseV3): CreativeAssignment[];
|
|
@@ -1,126 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Handles conversion between v2 creative_ids and v3 creative_assignments.
|
|
5
|
-
* The library exposes only v3 API (creative_assignments) to clients,
|
|
6
|
-
* and internally adapts requests for v2 servers.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* v3 creative assignment with optional weight and placement targeting
|
|
10
|
-
*/
|
|
1
|
+
/** Helpers for reading AdCP 3 creative assignments. */
|
|
2
|
+
/** Creative assignment with optional weight and placement targeting. */
|
|
11
3
|
export interface CreativeAssignment {
|
|
12
|
-
/** Unique identifier for the creative */
|
|
13
4
|
creative_id: string;
|
|
14
|
-
/** Delivery weight (0-100) for rotation */
|
|
15
5
|
weight?: number;
|
|
16
|
-
/** Optional placement IDs to restrict where this creative runs */
|
|
17
6
|
placement_ids?: string[];
|
|
7
|
+
[key: string]: unknown;
|
|
18
8
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Package request with creative assignments (v3 style)
|
|
21
|
-
*/
|
|
22
9
|
export interface PackageRequestV3 {
|
|
23
10
|
creative_assignments?: CreativeAssignment[];
|
|
24
|
-
creatives?:
|
|
25
|
-
[key: string]: unknown;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Package request with creative_ids (v2 style)
|
|
29
|
-
*/
|
|
30
|
-
export interface PackageRequestV2 {
|
|
31
|
-
creative_ids?: string[];
|
|
32
|
-
creatives?: any[];
|
|
11
|
+
creatives?: unknown[];
|
|
33
12
|
[key: string]: unknown;
|
|
34
13
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Package response with creative assignments (v3 style)
|
|
37
|
-
*/
|
|
38
14
|
export interface PackageResponseV3 {
|
|
39
15
|
creative_assignments?: CreativeAssignment[];
|
|
40
16
|
[key: string]: unknown;
|
|
41
17
|
}
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* exists yet, so `buyer_ref` is the actual required identifier). v3 doesn't
|
|
54
|
-
* model packages with `buyer_ref`, but `idempotency_key` carries equivalent
|
|
55
|
-
* client-controlled-unique-identity semantics. The `parentBuyerRef` plus
|
|
56
|
-
* `index` compose a stable per-package reference that re-derives identically
|
|
57
|
-
* on replay — preserving the idempotency contract sellers depend on for
|
|
58
|
-
* deduping.
|
|
59
|
-
*/
|
|
60
|
-
export interface PackageAdapterContext {
|
|
61
|
-
/** Top-level `buyer_ref` derived from the parent v3 request. */
|
|
62
|
-
parentBuyerRef?: string;
|
|
63
|
-
/** Position of the package within the parent's `packages[]` array. */
|
|
64
|
-
index?: number;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Adapt a v3-style package request for a v2 server.
|
|
68
|
-
* Converts creative_assignments to creative_ids (dropping weight and placement_ids).
|
|
69
|
-
* Strips v3-only package fields (optimization_goals, catalogs).
|
|
70
|
-
*
|
|
71
|
-
* When `ctx` is provided and the input has no `buyer_ref`, derives one from —
|
|
72
|
-
* in order — `package.context.buyer_ref`, `package.idempotency_key`, or
|
|
73
|
-
* `${ctx.parentBuyerRef}-${ctx.index}` so v2.5 package-request validation
|
|
74
|
-
* passes. Caller-supplied top-level `buyer_ref` always wins. The `context.buyer_ref`
|
|
75
|
-
* fallback exists because v3 callers put their per-package correlation ref in
|
|
76
|
-
* `context.buyer_ref` (per the 3.0 package schema); this adapter is the only
|
|
77
|
-
* place that promotes it back to the top-level shape v2.5 sellers still expect.
|
|
78
|
-
*/
|
|
79
|
-
export declare function adaptPackageRequestForV2(pkg: PackageRequestV3, ctx?: PackageAdapterContext): PackageRequestV2;
|
|
80
|
-
/**
|
|
81
|
-
* Adapt a create_media_buy request for a v2 server.
|
|
82
|
-
* Strips v3-only top-level fields, converts brand → brand_manifest, derives
|
|
83
|
-
* `buyer_ref` (top-level + per-package) from `context.buyer_ref` or
|
|
84
|
-
* `idempotency_key`, and adapts packages.
|
|
85
|
-
*
|
|
86
|
-
* v2.5 requires `buyer_ref` as the buyer's reference for THIS media buy,
|
|
87
|
-
* top-level + per-package. v3 removed the top-level field and moved buyer
|
|
88
|
-
* correlation into `context.buyer_ref`; `idempotency_key` carries the same
|
|
89
|
-
* client-controlled-unique-identity semantics. Preferring the caller's
|
|
90
|
-
* `context.buyer_ref` before falling back to `idempotency_key` preserves the
|
|
91
|
-
* buyer's stable reference on the wire when they provided one, and still
|
|
92
|
-
* satisfies v2.5 dedupe on replay when they did not. Caller-supplied
|
|
93
|
-
* top-level `buyer_ref` (if any) always wins.
|
|
94
|
-
*/
|
|
95
|
-
export declare function adaptCreateMediaBuyRequestForV2(request: any): any;
|
|
96
|
-
/**
|
|
97
|
-
* Adapt an update_media_buy request for a v2 server.
|
|
98
|
-
* Strips v3-only top-level fields and adapts packages.
|
|
99
|
-
*/
|
|
100
|
-
export declare function adaptUpdateMediaBuyRequestForV2(request: any): any;
|
|
101
|
-
/**
|
|
102
|
-
* Normalize a v2-style package response to v3.
|
|
103
|
-
* Converts creative_ids to creative_assignments and coerces null array fields
|
|
104
|
-
* to undefined so downstream consumers can safely use optional chaining.
|
|
105
|
-
*/
|
|
106
|
-
export declare function normalizePackageResponse(pkg: PackageResponseV2 | PackageResponseV3): PackageResponseV3;
|
|
107
|
-
/**
|
|
108
|
-
* Normalize a media buy response (converts all packages).
|
|
109
|
-
*/
|
|
110
|
-
export declare function normalizeMediaBuyResponse(response: any): any;
|
|
111
|
-
/**
|
|
112
|
-
* Check if a package uses v2 creative_ids format
|
|
113
|
-
*/
|
|
114
|
-
export declare function usesV2CreativeIds(pkg: any): boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Check if a package uses v3 creative_assignments format
|
|
117
|
-
*/
|
|
118
|
-
export declare function usesV3CreativeAssignments(pkg: any): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Get all creative IDs from a package (works with both v2 and v3 format)
|
|
121
|
-
*/
|
|
122
|
-
export declare function getCreativeIds(pkg: PackageResponseV2 | PackageResponseV3): string[];
|
|
123
|
-
/**
|
|
124
|
-
* Get creative assignments from a package (normalizes v2 to v3 format)
|
|
125
|
-
*/
|
|
126
|
-
export declare function getCreativeAssignments(pkg: PackageResponseV2 | PackageResponseV3): CreativeAssignment[];
|
|
18
|
+
/** Remove a null assignments array while preserving all extension fields. */
|
|
19
|
+
export declare function normalizePackageResponse<T extends PackageResponseV3>(pkg: T): T;
|
|
20
|
+
/** Normalize optional arrays in the packages of an AdCP 3 media buy response. */
|
|
21
|
+
export declare function normalizeMediaBuyResponse<T extends {
|
|
22
|
+
packages?: PackageResponseV3[];
|
|
23
|
+
}>(response: T): T;
|
|
24
|
+
export declare function usesV3CreativeAssignments(pkg: PackageResponseV3): boolean;
|
|
25
|
+
/** Return creative IDs in assignment order. */
|
|
26
|
+
export declare function getCreativeIds(pkg: PackageResponseV3): string[];
|
|
27
|
+
/** Return the supplied assignments, including their weights and extension fields. */
|
|
28
|
+
export declare function getCreativeAssignments(pkg: PackageResponseV3): CreativeAssignment[];
|
|
@@ -18,102 +18,22 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var creative_adapter_exports = {};
|
|
20
20
|
__export(creative_adapter_exports, {
|
|
21
|
-
adaptCreateMediaBuyRequestForV2: () => adaptCreateMediaBuyRequestForV2,
|
|
22
|
-
adaptPackageRequestForV2: () => adaptPackageRequestForV2,
|
|
23
|
-
adaptUpdateMediaBuyRequestForV2: () => adaptUpdateMediaBuyRequestForV2,
|
|
24
21
|
getCreativeAssignments: () => getCreativeAssignments,
|
|
25
22
|
getCreativeIds: () => getCreativeIds,
|
|
26
23
|
normalizeMediaBuyResponse: () => normalizeMediaBuyResponse,
|
|
27
24
|
normalizePackageResponse: () => normalizePackageResponse,
|
|
28
|
-
usesV2CreativeIds: () => usesV2CreativeIds,
|
|
29
25
|
usesV3CreativeAssignments: () => usesV3CreativeAssignments
|
|
30
26
|
});
|
|
31
27
|
module.exports = __toCommonJS(creative_adapter_exports);
|
|
32
|
-
function adaptPackageRequestForV2(pkg, ctx) {
|
|
33
|
-
const {
|
|
34
|
-
optimization_goals,
|
|
35
|
-
catalogs,
|
|
36
|
-
idempotency_key: pkgIdempotencyKey,
|
|
37
|
-
buyer_ref: callerBuyerRef,
|
|
38
|
-
...rest
|
|
39
|
-
} = pkg;
|
|
40
|
-
const contextBuyerRef = rest.context && typeof rest.context === "object" && !Array.isArray(rest.context) ? rest.context.buyer_ref : void 0;
|
|
41
|
-
const derivedBuyerRef = typeof callerBuyerRef === "string" && callerBuyerRef.length > 0 ? callerBuyerRef : typeof contextBuyerRef === "string" && contextBuyerRef.length > 0 ? contextBuyerRef : typeof pkgIdempotencyKey === "string" && pkgIdempotencyKey.length > 0 ? pkgIdempotencyKey : ctx?.parentBuyerRef !== void 0 && ctx?.index !== void 0 ? `${ctx.parentBuyerRef}-${ctx.index}` : void 0;
|
|
42
|
-
const baseOut = rest;
|
|
43
|
-
if (!rest.creative_assignments) {
|
|
44
|
-
return derivedBuyerRef === void 0 ? baseOut : { ...baseOut, buyer_ref: derivedBuyerRef };
|
|
45
|
-
}
|
|
46
|
-
const { creative_assignments, ...withoutAssignments } = rest;
|
|
47
|
-
return {
|
|
48
|
-
...withoutAssignments,
|
|
49
|
-
...derivedBuyerRef !== void 0 && { buyer_ref: derivedBuyerRef },
|
|
50
|
-
creative_ids: creative_assignments.map((a) => a.creative_id)
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function adaptCreateMediaBuyRequestForV2(request) {
|
|
54
|
-
const {
|
|
55
|
-
account,
|
|
56
|
-
proposal_id,
|
|
57
|
-
total_budget,
|
|
58
|
-
artifact_webhook,
|
|
59
|
-
brand,
|
|
60
|
-
brand_manifest: inputManifest,
|
|
61
|
-
adcp_major_version,
|
|
62
|
-
idempotency_key,
|
|
63
|
-
buyer_ref: callerBuyerRef,
|
|
64
|
-
...rest
|
|
65
|
-
} = request;
|
|
66
|
-
const contextBuyerRef = rest.context && typeof rest.context === "object" && !Array.isArray(rest.context) ? rest.context.buyer_ref : void 0;
|
|
67
|
-
if (proposal_id && !rest.packages?.length) {
|
|
68
|
-
throw new Error(
|
|
69
|
-
"Proposal mode (proposal_id + total_budget) requires a v3 server. The connected server only supports AdCP v2. Provide an explicit packages array instead."
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
const callerUrl = typeof inputManifest === "string" ? inputManifest : typeof inputManifest === "object" && inputManifest?.url ? inputManifest.url : void 0;
|
|
73
|
-
const brand_manifest = callerUrl || (brand?.domain ? `https://${brand.domain}` : void 0);
|
|
74
|
-
const buyer_ref = typeof callerBuyerRef === "string" && callerBuyerRef.length > 0 ? callerBuyerRef : typeof contextBuyerRef === "string" && contextBuyerRef.length > 0 ? contextBuyerRef : typeof idempotency_key === "string" && idempotency_key.length > 0 ? idempotency_key : void 0;
|
|
75
|
-
return {
|
|
76
|
-
...rest,
|
|
77
|
-
...buyer_ref !== void 0 && { buyer_ref },
|
|
78
|
-
...brand && !brand_manifest && { brand },
|
|
79
|
-
...brand_manifest !== void 0 && { brand_manifest },
|
|
80
|
-
...rest.packages && {
|
|
81
|
-
packages: rest.packages.map(
|
|
82
|
-
(pkg, index) => adaptPackageRequestForV2(pkg, { parentBuyerRef: buyer_ref, index })
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function adaptUpdateMediaBuyRequestForV2(request) {
|
|
88
|
-
const { reporting_webhook, adcp_major_version, idempotency_key, ...rest } = request;
|
|
89
|
-
return {
|
|
90
|
-
...rest,
|
|
91
|
-
...rest.packages && { packages: rest.packages.map(adaptPackageRequestForV2) }
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
28
|
function normalizePackageResponse(pkg) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (field in cleaned && cleaned[field] === null) {
|
|
99
|
-
const { [field]: _removed, ...rest } = cleaned;
|
|
100
|
-
cleaned = rest;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (cleaned.creative_assignments) {
|
|
104
|
-
return cleaned;
|
|
29
|
+
if (pkg.creative_assignments === null) {
|
|
30
|
+
const { creative_assignments: _removed, ...rest } = pkg;
|
|
31
|
+
return rest;
|
|
105
32
|
}
|
|
106
|
-
|
|
107
|
-
const { creative_ids, ...rest } = cleaned;
|
|
108
|
-
return {
|
|
109
|
-
...rest,
|
|
110
|
-
creative_assignments: creative_ids.map((id) => ({ creative_id: id }))
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
return cleaned;
|
|
33
|
+
return pkg;
|
|
114
34
|
}
|
|
115
35
|
function normalizeMediaBuyResponse(response) {
|
|
116
|
-
if (!response.packages) {
|
|
36
|
+
if (!Array.isArray(response.packages)) {
|
|
117
37
|
return response;
|
|
118
38
|
}
|
|
119
39
|
return {
|
|
@@ -121,39 +41,20 @@ function normalizeMediaBuyResponse(response) {
|
|
|
121
41
|
packages: response.packages.map(normalizePackageResponse)
|
|
122
42
|
};
|
|
123
43
|
}
|
|
124
|
-
function usesV2CreativeIds(pkg) {
|
|
125
|
-
return Array.isArray(pkg.creative_ids) && !pkg.creative_assignments;
|
|
126
|
-
}
|
|
127
44
|
function usesV3CreativeAssignments(pkg) {
|
|
128
45
|
return Array.isArray(pkg.creative_assignments);
|
|
129
46
|
}
|
|
130
47
|
function getCreativeIds(pkg) {
|
|
131
|
-
|
|
132
|
-
return pkg.creative_assignments.map((a) => a.creative_id);
|
|
133
|
-
}
|
|
134
|
-
if (pkg.creative_ids) {
|
|
135
|
-
return pkg.creative_ids;
|
|
136
|
-
}
|
|
137
|
-
return [];
|
|
48
|
+
return getCreativeAssignments(pkg).map((assignment) => assignment.creative_id);
|
|
138
49
|
}
|
|
139
50
|
function getCreativeAssignments(pkg) {
|
|
140
|
-
|
|
141
|
-
return pkg.creative_assignments;
|
|
142
|
-
}
|
|
143
|
-
if (pkg.creative_ids) {
|
|
144
|
-
return pkg.creative_ids.map((id) => ({ creative_id: id }));
|
|
145
|
-
}
|
|
146
|
-
return [];
|
|
51
|
+
return pkg.creative_assignments ?? [];
|
|
147
52
|
}
|
|
148
53
|
// Annotate the CommonJS export names for ESM import in node:
|
|
149
54
|
0 && (module.exports = {
|
|
150
|
-
adaptCreateMediaBuyRequestForV2,
|
|
151
|
-
adaptPackageRequestForV2,
|
|
152
|
-
adaptUpdateMediaBuyRequestForV2,
|
|
153
55
|
getCreativeAssignments,
|
|
154
56
|
getCreativeIds,
|
|
155
57
|
normalizeMediaBuyResponse,
|
|
156
58
|
normalizePackageResponse,
|
|
157
|
-
usesV2CreativeIds,
|
|
158
59
|
usesV3CreativeAssignments
|
|
159
60
|
});
|
|
@@ -1,88 +1,12 @@
|
|
|
1
|
-
function adaptPackageRequestForV2(pkg, ctx) {
|
|
2
|
-
const {
|
|
3
|
-
optimization_goals,
|
|
4
|
-
catalogs,
|
|
5
|
-
idempotency_key: pkgIdempotencyKey,
|
|
6
|
-
buyer_ref: callerBuyerRef,
|
|
7
|
-
...rest
|
|
8
|
-
} = pkg;
|
|
9
|
-
const contextBuyerRef = rest.context && typeof rest.context === "object" && !Array.isArray(rest.context) ? rest.context.buyer_ref : void 0;
|
|
10
|
-
const derivedBuyerRef = typeof callerBuyerRef === "string" && callerBuyerRef.length > 0 ? callerBuyerRef : typeof contextBuyerRef === "string" && contextBuyerRef.length > 0 ? contextBuyerRef : typeof pkgIdempotencyKey === "string" && pkgIdempotencyKey.length > 0 ? pkgIdempotencyKey : ctx?.parentBuyerRef !== void 0 && ctx?.index !== void 0 ? `${ctx.parentBuyerRef}-${ctx.index}` : void 0;
|
|
11
|
-
const baseOut = rest;
|
|
12
|
-
if (!rest.creative_assignments) {
|
|
13
|
-
return derivedBuyerRef === void 0 ? baseOut : { ...baseOut, buyer_ref: derivedBuyerRef };
|
|
14
|
-
}
|
|
15
|
-
const { creative_assignments, ...withoutAssignments } = rest;
|
|
16
|
-
return {
|
|
17
|
-
...withoutAssignments,
|
|
18
|
-
...derivedBuyerRef !== void 0 && { buyer_ref: derivedBuyerRef },
|
|
19
|
-
creative_ids: creative_assignments.map((a) => a.creative_id)
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function adaptCreateMediaBuyRequestForV2(request) {
|
|
23
|
-
const {
|
|
24
|
-
account,
|
|
25
|
-
proposal_id,
|
|
26
|
-
total_budget,
|
|
27
|
-
artifact_webhook,
|
|
28
|
-
brand,
|
|
29
|
-
brand_manifest: inputManifest,
|
|
30
|
-
adcp_major_version,
|
|
31
|
-
idempotency_key,
|
|
32
|
-
buyer_ref: callerBuyerRef,
|
|
33
|
-
...rest
|
|
34
|
-
} = request;
|
|
35
|
-
const contextBuyerRef = rest.context && typeof rest.context === "object" && !Array.isArray(rest.context) ? rest.context.buyer_ref : void 0;
|
|
36
|
-
if (proposal_id && !rest.packages?.length) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
"Proposal mode (proposal_id + total_budget) requires a v3 server. The connected server only supports AdCP v2. Provide an explicit packages array instead."
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
const callerUrl = typeof inputManifest === "string" ? inputManifest : typeof inputManifest === "object" && inputManifest?.url ? inputManifest.url : void 0;
|
|
42
|
-
const brand_manifest = callerUrl || (brand?.domain ? `https://${brand.domain}` : void 0);
|
|
43
|
-
const buyer_ref = typeof callerBuyerRef === "string" && callerBuyerRef.length > 0 ? callerBuyerRef : typeof contextBuyerRef === "string" && contextBuyerRef.length > 0 ? contextBuyerRef : typeof idempotency_key === "string" && idempotency_key.length > 0 ? idempotency_key : void 0;
|
|
44
|
-
return {
|
|
45
|
-
...rest,
|
|
46
|
-
...buyer_ref !== void 0 && { buyer_ref },
|
|
47
|
-
...brand && !brand_manifest && { brand },
|
|
48
|
-
...brand_manifest !== void 0 && { brand_manifest },
|
|
49
|
-
...rest.packages && {
|
|
50
|
-
packages: rest.packages.map(
|
|
51
|
-
(pkg, index) => adaptPackageRequestForV2(pkg, { parentBuyerRef: buyer_ref, index })
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function adaptUpdateMediaBuyRequestForV2(request) {
|
|
57
|
-
const { reporting_webhook, adcp_major_version, idempotency_key, ...rest } = request;
|
|
58
|
-
return {
|
|
59
|
-
...rest,
|
|
60
|
-
...rest.packages && { packages: rest.packages.map(adaptPackageRequestForV2) }
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
1
|
function normalizePackageResponse(pkg) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (field in cleaned && cleaned[field] === null) {
|
|
68
|
-
const { [field]: _removed, ...rest } = cleaned;
|
|
69
|
-
cleaned = rest;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (cleaned.creative_assignments) {
|
|
73
|
-
return cleaned;
|
|
2
|
+
if (pkg.creative_assignments === null) {
|
|
3
|
+
const { creative_assignments: _removed, ...rest } = pkg;
|
|
4
|
+
return rest;
|
|
74
5
|
}
|
|
75
|
-
|
|
76
|
-
const { creative_ids, ...rest } = cleaned;
|
|
77
|
-
return {
|
|
78
|
-
...rest,
|
|
79
|
-
creative_assignments: creative_ids.map((id) => ({ creative_id: id }))
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
return cleaned;
|
|
6
|
+
return pkg;
|
|
83
7
|
}
|
|
84
8
|
function normalizeMediaBuyResponse(response) {
|
|
85
|
-
if (!response.packages) {
|
|
9
|
+
if (!Array.isArray(response.packages)) {
|
|
86
10
|
return response;
|
|
87
11
|
}
|
|
88
12
|
return {
|
|
@@ -90,38 +14,19 @@ function normalizeMediaBuyResponse(response) {
|
|
|
90
14
|
packages: response.packages.map(normalizePackageResponse)
|
|
91
15
|
};
|
|
92
16
|
}
|
|
93
|
-
function usesV2CreativeIds(pkg) {
|
|
94
|
-
return Array.isArray(pkg.creative_ids) && !pkg.creative_assignments;
|
|
95
|
-
}
|
|
96
17
|
function usesV3CreativeAssignments(pkg) {
|
|
97
18
|
return Array.isArray(pkg.creative_assignments);
|
|
98
19
|
}
|
|
99
20
|
function getCreativeIds(pkg) {
|
|
100
|
-
|
|
101
|
-
return pkg.creative_assignments.map((a) => a.creative_id);
|
|
102
|
-
}
|
|
103
|
-
if (pkg.creative_ids) {
|
|
104
|
-
return pkg.creative_ids;
|
|
105
|
-
}
|
|
106
|
-
return [];
|
|
21
|
+
return getCreativeAssignments(pkg).map((assignment) => assignment.creative_id);
|
|
107
22
|
}
|
|
108
23
|
function getCreativeAssignments(pkg) {
|
|
109
|
-
|
|
110
|
-
return pkg.creative_assignments;
|
|
111
|
-
}
|
|
112
|
-
if (pkg.creative_ids) {
|
|
113
|
-
return pkg.creative_ids.map((id) => ({ creative_id: id }));
|
|
114
|
-
}
|
|
115
|
-
return [];
|
|
24
|
+
return pkg.creative_assignments ?? [];
|
|
116
25
|
}
|
|
117
26
|
export {
|
|
118
|
-
adaptCreateMediaBuyRequestForV2,
|
|
119
|
-
adaptPackageRequestForV2,
|
|
120
|
-
adaptUpdateMediaBuyRequestForV2,
|
|
121
27
|
getCreativeAssignments,
|
|
122
28
|
getCreativeIds,
|
|
123
29
|
normalizeMediaBuyResponse,
|
|
124
30
|
normalizePackageResponse,
|
|
125
|
-
usesV2CreativeIds,
|
|
126
31
|
usesV3CreativeAssignments
|
|
127
32
|
};
|