@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
|
@@ -19,10 +19,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var property_policy_exports = {};
|
|
20
20
|
__export(property_policy_exports, {
|
|
21
21
|
ProductPropertyPolicyError: () => ProductPropertyPolicyError,
|
|
22
|
+
isSupportedPropertyIdentifierType: () => isSupportedPropertyIdentifierType,
|
|
22
23
|
normalizeDomainForPropertyPolicy: () => normalizeDomainForPropertyPolicy,
|
|
23
24
|
validateProductsAgainstPropertyPolicy: () => validateProductsAgainstPropertyPolicy
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(property_policy_exports);
|
|
27
|
+
var import_enums = require('../types/enums.generated.js');
|
|
28
|
+
function isSupportedPropertyIdentifierType(type) {
|
|
29
|
+
return import_enums.PropertyIdentifierTypesValues.includes(type);
|
|
30
|
+
}
|
|
26
31
|
class ProductPropertyPolicyError extends Error {
|
|
27
32
|
constructor(result) {
|
|
28
33
|
super(
|
|
@@ -82,6 +87,8 @@ function compilePolicy(policy) {
|
|
|
82
87
|
}
|
|
83
88
|
return {
|
|
84
89
|
allowedDomains,
|
|
90
|
+
publisherCatalogsConfigured: policy.publisherProperties !== void 0,
|
|
91
|
+
publisherProperties: policy.publisherProperties ?? {},
|
|
85
92
|
allowedPropertyIdentifiers: [...policy.allowedPropertyIdentifiers ?? []],
|
|
86
93
|
requireAllowedPropertyMatch: policy.requireAllowedPropertyMatch ?? Boolean(policy.allowedDomains?.length || policy.allowedPropertyIdentifiers?.length),
|
|
87
94
|
excludedDomainsByComparable,
|
|
@@ -116,6 +123,18 @@ function diagnosticsForProduct(product, productIndex, policy) {
|
|
|
116
123
|
hasEligibleSubsetSelector = true;
|
|
117
124
|
}
|
|
118
125
|
});
|
|
126
|
+
if (requiresSubsetMatch) {
|
|
127
|
+
const scopes = publisherProperties.flatMap(
|
|
128
|
+
(selector) => selector && typeof selector === "object" && !Array.isArray(selector) ? [identifierScopeForSelector(selector, policy)] : []
|
|
129
|
+
);
|
|
130
|
+
if (scopes.some((scope) => scope?.hasNonMatch) && !scopes.some((scope) => scope?.hasMatch))
|
|
131
|
+
hasEligibleSubsetSelector = false;
|
|
132
|
+
}
|
|
133
|
+
if (requiresSubsetMatch && hasEligibleSubsetSelector) {
|
|
134
|
+
for (const diagnostic of diagnostics) {
|
|
135
|
+
if (diagnostic.code === "unresolved_property_identifiers") diagnostic.severity = "flagged";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
119
138
|
if (requiresSubsetMatch && !hasEligibleSubsetSelector) {
|
|
120
139
|
diagnostics.push({
|
|
121
140
|
code: "outside_property_list",
|
|
@@ -141,6 +160,7 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
141
160
|
});
|
|
142
161
|
}
|
|
143
162
|
const selector = rawSelector;
|
|
163
|
+
const identifierScope = identifierScopeForSelector(selector, policy);
|
|
144
164
|
const selectionType = typeof selector.selection_type === "string" ? selector.selection_type : void 0;
|
|
145
165
|
const domainCandidates = publisherDomainCandidates(selector, path);
|
|
146
166
|
const normalizedDomains = domainCandidates.map((candidate) => ({ candidate, normalized: normalizeDomainForPropertyPolicy(candidate.raw) })).filter(
|
|
@@ -192,7 +212,27 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
192
212
|
}
|
|
193
213
|
for (const { candidate, normalized: normalizedDomain } of normalizedDomains) {
|
|
194
214
|
const matchedAllowedDomain = matchedAllowedDomainForCandidate(normalizedDomain, policy);
|
|
195
|
-
|
|
215
|
+
const needsCatalogForExclusions = policy.publisherCatalogsConfigured && (policy.excludedDomainsByComparable.size > 0 || selectionType !== "by_id" && policy.excludedPropertyIds.size > 0);
|
|
216
|
+
if ((hasAllowedPropertyScope(policy) || selectionType === "by_tag" || needsCatalogForExclusions) && identifierScope?.unknown) {
|
|
217
|
+
diagnostics.push(
|
|
218
|
+
...diagnosticForBehavior(policy.unknownSelectorBehavior, {
|
|
219
|
+
code: "unresolved_property_identifiers",
|
|
220
|
+
identifier_types: [
|
|
221
|
+
...new Set(
|
|
222
|
+
policy.allowedPropertyIdentifiers.filter((identifier) => identifier.type !== "domain" && identifier.type !== "subdomain").map((identifier) => identifier.type)
|
|
223
|
+
)
|
|
224
|
+
],
|
|
225
|
+
message: "Publisher property identifiers could not be resolved; property-list membership is unknown.",
|
|
226
|
+
product_index: productIndex,
|
|
227
|
+
product_id: productId,
|
|
228
|
+
path,
|
|
229
|
+
publisher_property_index: selectorIndex,
|
|
230
|
+
selection_type: selectionType,
|
|
231
|
+
publisher_domain: candidate.raw
|
|
232
|
+
})
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
if (options.enforceEveryDomainInAllowedScope && hasAllowedPropertyScope(policy) && (identifierScope ? identifierScope.hasNonMatch : !matchedAllowedDomain)) {
|
|
196
236
|
diagnostics.push({
|
|
197
237
|
code: "outside_property_list",
|
|
198
238
|
severity: "rejected",
|
|
@@ -227,6 +267,19 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
227
267
|
});
|
|
228
268
|
}
|
|
229
269
|
}
|
|
270
|
+
if (options.enforceExclusions && identifierScope?.hasExcludedProperty) {
|
|
271
|
+
diagnostics.push({
|
|
272
|
+
code: "excluded_resolved_property",
|
|
273
|
+
severity: "rejected",
|
|
274
|
+
message: "Resolved publisher properties include a buyer-excluded property.",
|
|
275
|
+
product_index: productIndex,
|
|
276
|
+
product_id: productId,
|
|
277
|
+
path,
|
|
278
|
+
publisher_property_index: selectorIndex,
|
|
279
|
+
selection_type: selectionType,
|
|
280
|
+
publisher_domain: domainCandidates[0]?.raw
|
|
281
|
+
});
|
|
282
|
+
}
|
|
230
283
|
if (selectionType === "by_id") {
|
|
231
284
|
const propertyIds = stringArray(selector.property_ids);
|
|
232
285
|
const matchedPropertyIds = propertyIds.filter((id) => policy.excludedPropertyIds.has(id));
|
|
@@ -248,7 +301,7 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
248
301
|
matched_property_ids: matchedPropertyIds
|
|
249
302
|
});
|
|
250
303
|
}
|
|
251
|
-
} else if (selectionType === "by_tag") {
|
|
304
|
+
} else if (selectionType === "by_tag" && !identifierScope) {
|
|
252
305
|
diagnostics.push(
|
|
253
306
|
...diagnosticForBehavior(policy.unknownSelectorBehavior, {
|
|
254
307
|
code: "unresolved_tag_selector",
|
|
@@ -264,7 +317,7 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
264
317
|
normalized_domains: normalizedDomains.map((entry) => entry.normalized.host)
|
|
265
318
|
})
|
|
266
319
|
);
|
|
267
|
-
} else if (selectionType !== "all") {
|
|
320
|
+
} else if (selectionType !== "all" && selectionType !== "by_tag") {
|
|
268
321
|
diagnostics.push(
|
|
269
322
|
...diagnosticForBehavior(policy.unknownSelectorBehavior, {
|
|
270
323
|
code: "unknown_selector",
|
|
@@ -291,6 +344,14 @@ function selectorIsEligibleForSubsetTargeting(rawSelector, productIndex, selecto
|
|
|
291
344
|
if (!rawSelector || typeof rawSelector !== "object" || Array.isArray(rawSelector)) return false;
|
|
292
345
|
const selector = rawSelector;
|
|
293
346
|
if (selector.publisher_domains !== void 0) return false;
|
|
347
|
+
const identifierScope = identifierScopeForSelector(selector, policy);
|
|
348
|
+
if (identifierScope) {
|
|
349
|
+
const domain = typeof selector.publisher_domain === "string" ? normalizeDomainForPropertyPolicy(selector.publisher_domain) : void 0;
|
|
350
|
+
if (!domain || policy.excludedDomainsByComparable.has(domain.comparable)) return false;
|
|
351
|
+
if (selector.selection_type !== "all" && selector.selection_type !== "by_id" && selector.selection_type !== "by_tag")
|
|
352
|
+
return false;
|
|
353
|
+
return identifierScope.hasMatch || identifierScope.unknown && !identifierScope.hasNonMatch && policy.unknownSelectorBehavior !== "reject";
|
|
354
|
+
}
|
|
294
355
|
if (selector.selection_type === "by_tag") return false;
|
|
295
356
|
if (selector.selection_type !== "all" && selector.selection_type !== "by_id") return false;
|
|
296
357
|
const hasEligibleDomain = publisherDomainCandidates(selector, path).some((candidate) => {
|
|
@@ -317,6 +378,76 @@ function matchedAllowedDomainForCandidate(candidate, policy) {
|
|
|
317
378
|
}
|
|
318
379
|
return void 0;
|
|
319
380
|
}
|
|
381
|
+
function identifierScopeForSelector(selector, policy) {
|
|
382
|
+
if (!policy.allowedPropertyIdentifiers.some((id) => id.type !== "domain" && id.type !== "subdomain") && !policy.publisherCatalogsConfigured)
|
|
383
|
+
return void 0;
|
|
384
|
+
const propertyIds = selector.selection_type === "by_id" ? stringArray(selector.property_ids) : [];
|
|
385
|
+
const hasExcludedId = propertyIds.some((id) => policy.excludedPropertyIds.has(id));
|
|
386
|
+
const allIdsExcluded = propertyIds.length > 0 && propertyIds.every((id) => policy.excludedPropertyIds.has(id));
|
|
387
|
+
if (allIdsExcluded) return { allMatch: false, hasMatch: false, hasNonMatch: true, unknown: false };
|
|
388
|
+
const domain = typeof selector.publisher_domain === "string" ? normalizeDomainForPropertyPolicy(selector.publisher_domain) : void 0;
|
|
389
|
+
if (!domain) return { allMatch: false, hasMatch: false, hasNonMatch: hasExcludedId, unknown: true };
|
|
390
|
+
if (policy.excludedDomainsByComparable.has(domain.comparable))
|
|
391
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: true, unknown: false };
|
|
392
|
+
const properties = Object.hasOwn(policy.publisherProperties, domain.host) ? policy.publisherProperties[domain.host] : void 0;
|
|
393
|
+
if (!properties && policy.publisherCatalogsConfigured)
|
|
394
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: hasExcludedId, unknown: true };
|
|
395
|
+
if (!properties) {
|
|
396
|
+
const matchedDomain = !allIdsExcluded && Boolean(matchedAllowedDomainForCandidate(domain, policy));
|
|
397
|
+
const unknown2 = !matchedDomain && !allIdsExcluded || selector.selection_type === "by_tag";
|
|
398
|
+
return {
|
|
399
|
+
allMatch: matchedDomain && !unknown2 && !hasExcludedId,
|
|
400
|
+
hasMatch: matchedDomain && !unknown2,
|
|
401
|
+
hasNonMatch: hasExcludedId,
|
|
402
|
+
unknown: unknown2
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
if (!Array.isArray(properties) || properties.some(
|
|
406
|
+
(property) => !property || typeof property !== "object" || !Array.isArray(property.identifiers) || property.identifiers.some(
|
|
407
|
+
(identifier) => !identifier || typeof identifier.type !== "string" || typeof identifier.value !== "string"
|
|
408
|
+
) || property.tags !== void 0 && (!Array.isArray(property.tags) || property.tags.some((tag) => typeof tag !== "string"))
|
|
409
|
+
)) {
|
|
410
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: hasExcludedId, unknown: true };
|
|
411
|
+
}
|
|
412
|
+
let selected = [...properties];
|
|
413
|
+
let missingIds = false;
|
|
414
|
+
if (selector.selection_type === "by_id") {
|
|
415
|
+
const ids = stringArray(selector.property_ids);
|
|
416
|
+
missingIds = !ids.length || ids.some((id) => !properties.some((property) => property.property_id === id));
|
|
417
|
+
selected = selected.filter((property) => property.property_id && ids.includes(property.property_id));
|
|
418
|
+
} else if (selector.selection_type === "by_tag") {
|
|
419
|
+
const tags = stringArray(selector.property_tags);
|
|
420
|
+
if (!tags.length) return { allMatch: false, hasMatch: false, hasNonMatch: false, unknown: true };
|
|
421
|
+
selected = selected.filter((property) => property.tags?.some((tag) => tags.includes(tag)));
|
|
422
|
+
} else if (selector.selection_type !== "all") {
|
|
423
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: false, unknown: true };
|
|
424
|
+
}
|
|
425
|
+
const excluded = selected.map(
|
|
426
|
+
(property) => policy.excludedPropertyIds.has(property.property_id ?? "") || property.identifiers.some(
|
|
427
|
+
(identifier) => (identifier.type === "domain" || identifier.type === "subdomain") && policy.excludedDomainsByComparable.has(normalizeDomainForPropertyPolicy(identifier.value)?.comparable ?? "")
|
|
428
|
+
)
|
|
429
|
+
);
|
|
430
|
+
const matches = selected.map(
|
|
431
|
+
(property, index) => !excluded[index] && (!hasAllowedPropertyScope(policy) || property.identifiers.some(
|
|
432
|
+
(candidate) => policy.allowedPropertyIdentifiers.some(
|
|
433
|
+
(allowed) => allowed.type === "domain" || allowed.type === "subdomain" ? (candidate.type === "domain" || candidate.type === "subdomain") && propertyListDomainMatches(candidate.value, allowed.value, allowed.type) : isSupportedPropertyIdentifierType(allowed.type) && candidate.type === allowed.type && candidate.value === allowed.value
|
|
434
|
+
) || (candidate.type === "domain" || candidate.type === "subdomain") && policy.allowedDomains.some((allowed) => propertyListDomainMatches(candidate.value, allowed.input))
|
|
435
|
+
))
|
|
436
|
+
);
|
|
437
|
+
const undecidable = selected.map(
|
|
438
|
+
(property, index) => !excluded[index] && (property.identifiers.length === 0 || property.identifiers.some(
|
|
439
|
+
(candidate) => !isSupportedPropertyIdentifierType(candidate.type) && policy.allowedPropertyIdentifiers.some((allowed) => allowed.type === candidate.type)
|
|
440
|
+
))
|
|
441
|
+
);
|
|
442
|
+
const unknown = matches.some((match, index) => !match && undecidable[index]);
|
|
443
|
+
return {
|
|
444
|
+
allMatch: matches.length > 0 && matches.every(Boolean) && !unknown,
|
|
445
|
+
hasMatch: matches.some(Boolean),
|
|
446
|
+
hasNonMatch: missingIds || !selected.length || matches.some((match, index) => !match && !undecidable[index]),
|
|
447
|
+
hasExcludedProperty: excluded.some(Boolean),
|
|
448
|
+
unknown
|
|
449
|
+
};
|
|
450
|
+
}
|
|
320
451
|
function publisherDomainCandidates(selector, path) {
|
|
321
452
|
const candidates = [];
|
|
322
453
|
if (typeof selector.publisher_domain === "string") {
|
|
@@ -382,6 +513,7 @@ function isUsableHostname(host) {
|
|
|
382
513
|
// Annotate the CommonJS export names for ESM import in node:
|
|
383
514
|
0 && (module.exports = {
|
|
384
515
|
ProductPropertyPolicyError,
|
|
516
|
+
isSupportedPropertyIdentifierType,
|
|
385
517
|
normalizeDomainForPropertyPolicy,
|
|
386
518
|
validateProductsAgainstPropertyPolicy
|
|
387
519
|
});
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { PropertyIdentifierTypesValues } from "../types/enums.generated.mjs";
|
|
2
|
+
function isSupportedPropertyIdentifierType(type) {
|
|
3
|
+
return PropertyIdentifierTypesValues.includes(type);
|
|
4
|
+
}
|
|
1
5
|
class ProductPropertyPolicyError extends Error {
|
|
2
6
|
constructor(result) {
|
|
3
7
|
super(
|
|
@@ -57,6 +61,8 @@ function compilePolicy(policy) {
|
|
|
57
61
|
}
|
|
58
62
|
return {
|
|
59
63
|
allowedDomains,
|
|
64
|
+
publisherCatalogsConfigured: policy.publisherProperties !== void 0,
|
|
65
|
+
publisherProperties: policy.publisherProperties ?? {},
|
|
60
66
|
allowedPropertyIdentifiers: [...policy.allowedPropertyIdentifiers ?? []],
|
|
61
67
|
requireAllowedPropertyMatch: policy.requireAllowedPropertyMatch ?? Boolean(policy.allowedDomains?.length || policy.allowedPropertyIdentifiers?.length),
|
|
62
68
|
excludedDomainsByComparable,
|
|
@@ -91,6 +97,18 @@ function diagnosticsForProduct(product, productIndex, policy) {
|
|
|
91
97
|
hasEligibleSubsetSelector = true;
|
|
92
98
|
}
|
|
93
99
|
});
|
|
100
|
+
if (requiresSubsetMatch) {
|
|
101
|
+
const scopes = publisherProperties.flatMap(
|
|
102
|
+
(selector) => selector && typeof selector === "object" && !Array.isArray(selector) ? [identifierScopeForSelector(selector, policy)] : []
|
|
103
|
+
);
|
|
104
|
+
if (scopes.some((scope) => scope?.hasNonMatch) && !scopes.some((scope) => scope?.hasMatch))
|
|
105
|
+
hasEligibleSubsetSelector = false;
|
|
106
|
+
}
|
|
107
|
+
if (requiresSubsetMatch && hasEligibleSubsetSelector) {
|
|
108
|
+
for (const diagnostic of diagnostics) {
|
|
109
|
+
if (diagnostic.code === "unresolved_property_identifiers") diagnostic.severity = "flagged";
|
|
110
|
+
}
|
|
111
|
+
}
|
|
94
112
|
if (requiresSubsetMatch && !hasEligibleSubsetSelector) {
|
|
95
113
|
diagnostics.push({
|
|
96
114
|
code: "outside_property_list",
|
|
@@ -116,6 +134,7 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
116
134
|
});
|
|
117
135
|
}
|
|
118
136
|
const selector = rawSelector;
|
|
137
|
+
const identifierScope = identifierScopeForSelector(selector, policy);
|
|
119
138
|
const selectionType = typeof selector.selection_type === "string" ? selector.selection_type : void 0;
|
|
120
139
|
const domainCandidates = publisherDomainCandidates(selector, path);
|
|
121
140
|
const normalizedDomains = domainCandidates.map((candidate) => ({ candidate, normalized: normalizeDomainForPropertyPolicy(candidate.raw) })).filter(
|
|
@@ -167,7 +186,27 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
167
186
|
}
|
|
168
187
|
for (const { candidate, normalized: normalizedDomain } of normalizedDomains) {
|
|
169
188
|
const matchedAllowedDomain = matchedAllowedDomainForCandidate(normalizedDomain, policy);
|
|
170
|
-
|
|
189
|
+
const needsCatalogForExclusions = policy.publisherCatalogsConfigured && (policy.excludedDomainsByComparable.size > 0 || selectionType !== "by_id" && policy.excludedPropertyIds.size > 0);
|
|
190
|
+
if ((hasAllowedPropertyScope(policy) || selectionType === "by_tag" || needsCatalogForExclusions) && identifierScope?.unknown) {
|
|
191
|
+
diagnostics.push(
|
|
192
|
+
...diagnosticForBehavior(policy.unknownSelectorBehavior, {
|
|
193
|
+
code: "unresolved_property_identifiers",
|
|
194
|
+
identifier_types: [
|
|
195
|
+
...new Set(
|
|
196
|
+
policy.allowedPropertyIdentifiers.filter((identifier) => identifier.type !== "domain" && identifier.type !== "subdomain").map((identifier) => identifier.type)
|
|
197
|
+
)
|
|
198
|
+
],
|
|
199
|
+
message: "Publisher property identifiers could not be resolved; property-list membership is unknown.",
|
|
200
|
+
product_index: productIndex,
|
|
201
|
+
product_id: productId,
|
|
202
|
+
path,
|
|
203
|
+
publisher_property_index: selectorIndex,
|
|
204
|
+
selection_type: selectionType,
|
|
205
|
+
publisher_domain: candidate.raw
|
|
206
|
+
})
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
if (options.enforceEveryDomainInAllowedScope && hasAllowedPropertyScope(policy) && (identifierScope ? identifierScope.hasNonMatch : !matchedAllowedDomain)) {
|
|
171
210
|
diagnostics.push({
|
|
172
211
|
code: "outside_property_list",
|
|
173
212
|
severity: "rejected",
|
|
@@ -202,6 +241,19 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
202
241
|
});
|
|
203
242
|
}
|
|
204
243
|
}
|
|
244
|
+
if (options.enforceExclusions && identifierScope?.hasExcludedProperty) {
|
|
245
|
+
diagnostics.push({
|
|
246
|
+
code: "excluded_resolved_property",
|
|
247
|
+
severity: "rejected",
|
|
248
|
+
message: "Resolved publisher properties include a buyer-excluded property.",
|
|
249
|
+
product_index: productIndex,
|
|
250
|
+
product_id: productId,
|
|
251
|
+
path,
|
|
252
|
+
publisher_property_index: selectorIndex,
|
|
253
|
+
selection_type: selectionType,
|
|
254
|
+
publisher_domain: domainCandidates[0]?.raw
|
|
255
|
+
});
|
|
256
|
+
}
|
|
205
257
|
if (selectionType === "by_id") {
|
|
206
258
|
const propertyIds = stringArray(selector.property_ids);
|
|
207
259
|
const matchedPropertyIds = propertyIds.filter((id) => policy.excludedPropertyIds.has(id));
|
|
@@ -223,7 +275,7 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
223
275
|
matched_property_ids: matchedPropertyIds
|
|
224
276
|
});
|
|
225
277
|
}
|
|
226
|
-
} else if (selectionType === "by_tag") {
|
|
278
|
+
} else if (selectionType === "by_tag" && !identifierScope) {
|
|
227
279
|
diagnostics.push(
|
|
228
280
|
...diagnosticForBehavior(policy.unknownSelectorBehavior, {
|
|
229
281
|
code: "unresolved_tag_selector",
|
|
@@ -239,7 +291,7 @@ function diagnosticsForSelector(rawSelector, productIndex, selectorIndex, produc
|
|
|
239
291
|
normalized_domains: normalizedDomains.map((entry) => entry.normalized.host)
|
|
240
292
|
})
|
|
241
293
|
);
|
|
242
|
-
} else if (selectionType !== "all") {
|
|
294
|
+
} else if (selectionType !== "all" && selectionType !== "by_tag") {
|
|
243
295
|
diagnostics.push(
|
|
244
296
|
...diagnosticForBehavior(policy.unknownSelectorBehavior, {
|
|
245
297
|
code: "unknown_selector",
|
|
@@ -266,6 +318,14 @@ function selectorIsEligibleForSubsetTargeting(rawSelector, productIndex, selecto
|
|
|
266
318
|
if (!rawSelector || typeof rawSelector !== "object" || Array.isArray(rawSelector)) return false;
|
|
267
319
|
const selector = rawSelector;
|
|
268
320
|
if (selector.publisher_domains !== void 0) return false;
|
|
321
|
+
const identifierScope = identifierScopeForSelector(selector, policy);
|
|
322
|
+
if (identifierScope) {
|
|
323
|
+
const domain = typeof selector.publisher_domain === "string" ? normalizeDomainForPropertyPolicy(selector.publisher_domain) : void 0;
|
|
324
|
+
if (!domain || policy.excludedDomainsByComparable.has(domain.comparable)) return false;
|
|
325
|
+
if (selector.selection_type !== "all" && selector.selection_type !== "by_id" && selector.selection_type !== "by_tag")
|
|
326
|
+
return false;
|
|
327
|
+
return identifierScope.hasMatch || identifierScope.unknown && !identifierScope.hasNonMatch && policy.unknownSelectorBehavior !== "reject";
|
|
328
|
+
}
|
|
269
329
|
if (selector.selection_type === "by_tag") return false;
|
|
270
330
|
if (selector.selection_type !== "all" && selector.selection_type !== "by_id") return false;
|
|
271
331
|
const hasEligibleDomain = publisherDomainCandidates(selector, path).some((candidate) => {
|
|
@@ -292,6 +352,76 @@ function matchedAllowedDomainForCandidate(candidate, policy) {
|
|
|
292
352
|
}
|
|
293
353
|
return void 0;
|
|
294
354
|
}
|
|
355
|
+
function identifierScopeForSelector(selector, policy) {
|
|
356
|
+
if (!policy.allowedPropertyIdentifiers.some((id) => id.type !== "domain" && id.type !== "subdomain") && !policy.publisherCatalogsConfigured)
|
|
357
|
+
return void 0;
|
|
358
|
+
const propertyIds = selector.selection_type === "by_id" ? stringArray(selector.property_ids) : [];
|
|
359
|
+
const hasExcludedId = propertyIds.some((id) => policy.excludedPropertyIds.has(id));
|
|
360
|
+
const allIdsExcluded = propertyIds.length > 0 && propertyIds.every((id) => policy.excludedPropertyIds.has(id));
|
|
361
|
+
if (allIdsExcluded) return { allMatch: false, hasMatch: false, hasNonMatch: true, unknown: false };
|
|
362
|
+
const domain = typeof selector.publisher_domain === "string" ? normalizeDomainForPropertyPolicy(selector.publisher_domain) : void 0;
|
|
363
|
+
if (!domain) return { allMatch: false, hasMatch: false, hasNonMatch: hasExcludedId, unknown: true };
|
|
364
|
+
if (policy.excludedDomainsByComparable.has(domain.comparable))
|
|
365
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: true, unknown: false };
|
|
366
|
+
const properties = Object.hasOwn(policy.publisherProperties, domain.host) ? policy.publisherProperties[domain.host] : void 0;
|
|
367
|
+
if (!properties && policy.publisherCatalogsConfigured)
|
|
368
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: hasExcludedId, unknown: true };
|
|
369
|
+
if (!properties) {
|
|
370
|
+
const matchedDomain = !allIdsExcluded && Boolean(matchedAllowedDomainForCandidate(domain, policy));
|
|
371
|
+
const unknown2 = !matchedDomain && !allIdsExcluded || selector.selection_type === "by_tag";
|
|
372
|
+
return {
|
|
373
|
+
allMatch: matchedDomain && !unknown2 && !hasExcludedId,
|
|
374
|
+
hasMatch: matchedDomain && !unknown2,
|
|
375
|
+
hasNonMatch: hasExcludedId,
|
|
376
|
+
unknown: unknown2
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
if (!Array.isArray(properties) || properties.some(
|
|
380
|
+
(property) => !property || typeof property !== "object" || !Array.isArray(property.identifiers) || property.identifiers.some(
|
|
381
|
+
(identifier) => !identifier || typeof identifier.type !== "string" || typeof identifier.value !== "string"
|
|
382
|
+
) || property.tags !== void 0 && (!Array.isArray(property.tags) || property.tags.some((tag) => typeof tag !== "string"))
|
|
383
|
+
)) {
|
|
384
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: hasExcludedId, unknown: true };
|
|
385
|
+
}
|
|
386
|
+
let selected = [...properties];
|
|
387
|
+
let missingIds = false;
|
|
388
|
+
if (selector.selection_type === "by_id") {
|
|
389
|
+
const ids = stringArray(selector.property_ids);
|
|
390
|
+
missingIds = !ids.length || ids.some((id) => !properties.some((property) => property.property_id === id));
|
|
391
|
+
selected = selected.filter((property) => property.property_id && ids.includes(property.property_id));
|
|
392
|
+
} else if (selector.selection_type === "by_tag") {
|
|
393
|
+
const tags = stringArray(selector.property_tags);
|
|
394
|
+
if (!tags.length) return { allMatch: false, hasMatch: false, hasNonMatch: false, unknown: true };
|
|
395
|
+
selected = selected.filter((property) => property.tags?.some((tag) => tags.includes(tag)));
|
|
396
|
+
} else if (selector.selection_type !== "all") {
|
|
397
|
+
return { allMatch: false, hasMatch: false, hasNonMatch: false, unknown: true };
|
|
398
|
+
}
|
|
399
|
+
const excluded = selected.map(
|
|
400
|
+
(property) => policy.excludedPropertyIds.has(property.property_id ?? "") || property.identifiers.some(
|
|
401
|
+
(identifier) => (identifier.type === "domain" || identifier.type === "subdomain") && policy.excludedDomainsByComparable.has(normalizeDomainForPropertyPolicy(identifier.value)?.comparable ?? "")
|
|
402
|
+
)
|
|
403
|
+
);
|
|
404
|
+
const matches = selected.map(
|
|
405
|
+
(property, index) => !excluded[index] && (!hasAllowedPropertyScope(policy) || property.identifiers.some(
|
|
406
|
+
(candidate) => policy.allowedPropertyIdentifiers.some(
|
|
407
|
+
(allowed) => allowed.type === "domain" || allowed.type === "subdomain" ? (candidate.type === "domain" || candidate.type === "subdomain") && propertyListDomainMatches(candidate.value, allowed.value, allowed.type) : isSupportedPropertyIdentifierType(allowed.type) && candidate.type === allowed.type && candidate.value === allowed.value
|
|
408
|
+
) || (candidate.type === "domain" || candidate.type === "subdomain") && policy.allowedDomains.some((allowed) => propertyListDomainMatches(candidate.value, allowed.input))
|
|
409
|
+
))
|
|
410
|
+
);
|
|
411
|
+
const undecidable = selected.map(
|
|
412
|
+
(property, index) => !excluded[index] && (property.identifiers.length === 0 || property.identifiers.some(
|
|
413
|
+
(candidate) => !isSupportedPropertyIdentifierType(candidate.type) && policy.allowedPropertyIdentifiers.some((allowed) => allowed.type === candidate.type)
|
|
414
|
+
))
|
|
415
|
+
);
|
|
416
|
+
const unknown = matches.some((match, index) => !match && undecidable[index]);
|
|
417
|
+
return {
|
|
418
|
+
allMatch: matches.length > 0 && matches.every(Boolean) && !unknown,
|
|
419
|
+
hasMatch: matches.some(Boolean),
|
|
420
|
+
hasNonMatch: missingIds || !selected.length || matches.some((match, index) => !match && !undecidable[index]),
|
|
421
|
+
hasExcludedProperty: excluded.some(Boolean),
|
|
422
|
+
unknown
|
|
423
|
+
};
|
|
424
|
+
}
|
|
295
425
|
function publisherDomainCandidates(selector, path) {
|
|
296
426
|
const candidates = [];
|
|
297
427
|
if (typeof selector.publisher_domain === "string") {
|
|
@@ -356,6 +486,7 @@ function isUsableHostname(host) {
|
|
|
356
486
|
}
|
|
357
487
|
export {
|
|
358
488
|
ProductPropertyPolicyError,
|
|
489
|
+
isSupportedPropertyIdentifierType,
|
|
359
490
|
normalizeDomainForPropertyPolicy,
|
|
360
491
|
validateProductsAgainstPropertyPolicy
|
|
361
492
|
};
|
|
@@ -54,6 +54,7 @@ __export(protocols_exports, {
|
|
|
54
54
|
wrapFetchWithTransportDiagnostics: () => import_transportDiagnostics2.wrapFetchWithTransportDiagnostics
|
|
55
55
|
});
|
|
56
56
|
module.exports = __toCommonJS(protocols_exports);
|
|
57
|
+
var import_errors = require('../errors/index.js');
|
|
57
58
|
var import_mcp = require('./mcp.js');
|
|
58
59
|
var import_mcp2 = require('./mcp.js');
|
|
59
60
|
var import_mcp_scope = require('./mcp-scope.js');
|
|
@@ -70,13 +71,13 @@ var import_auth = require('../auth/index.js');
|
|
|
70
71
|
var import_oauth = require('../auth/oauth/index.js');
|
|
71
72
|
var import_authorization_required = require('../auth/oauth/authorization-required.js');
|
|
72
73
|
var import_provider_cache = require('../auth/oauth/provider-cache.js');
|
|
73
|
-
var
|
|
74
|
+
var import_errors2 = require('../errors/index.js');
|
|
74
75
|
var import_signedRequestRejection = require('./signedRequestRejection.js');
|
|
75
76
|
var import_net = require('../net/index.js');
|
|
76
77
|
var import_validation = require('../validation/index.js');
|
|
77
78
|
var import_tracing = require('../observability/tracing.js');
|
|
78
79
|
var import_version = require('../version.js');
|
|
79
|
-
var
|
|
80
|
+
var import_errors3 = require('../errors/index.js');
|
|
80
81
|
var import_schema_loader = require('../validation/schema-loader.js');
|
|
81
82
|
var import_client = require('../signing/client.js');
|
|
82
83
|
var import_responseSizeLimit2 = require('./responseSizeLimit.js');
|
|
@@ -109,7 +110,7 @@ function resolveWireMajor(adcpVersion) {
|
|
|
109
110
|
if (adcpVersion === void 0) return import_version.ADCP_MAJOR_VERSION;
|
|
110
111
|
const parsed = (0, import_version.parseAdcpMajorVersion)(adcpVersion);
|
|
111
112
|
if (!Number.isFinite(parsed)) {
|
|
112
|
-
throw new
|
|
113
|
+
throw new import_errors3.ConfigurationError(
|
|
113
114
|
`adcpVersion ${JSON.stringify(adcpVersion)} is not a valid AdCP version. Expected a semver string (e.g. '3.0.1', '3.1.0-beta.1') or a legacy alias (e.g. 'v3').`,
|
|
114
115
|
"adcpVersion"
|
|
115
116
|
);
|
|
@@ -126,7 +127,7 @@ function bundleSupportsAdcpVersionField(bundleKey) {
|
|
|
126
127
|
return parseInt(minorMatch[1], 10) >= 1;
|
|
127
128
|
}
|
|
128
129
|
function buildVersionEnvelope(adcpVersion, serverVersion) {
|
|
129
|
-
if (serverVersion === "v2")
|
|
130
|
+
if (serverVersion === "v2") throw new import_errors.VersionUnsupportedError("request", "version", "v2");
|
|
130
131
|
const wireMajor = resolveWireMajor(adcpVersion);
|
|
131
132
|
const bundleKey = (0, import_schema_loader.resolveBundleKey)(adcpVersion ?? import_version.ADCP_VERSION);
|
|
132
133
|
if (!bundleSupportsAdcpVersionField(bundleKey)) {
|
|
@@ -136,16 +137,9 @@ function buildVersionEnvelope(adcpVersion, serverVersion) {
|
|
|
136
137
|
(0, import_schema_loader.validateAdcpVersionWire)(wireValue);
|
|
137
138
|
return { adcp_major_version: wireMajor, adcp_version: wireValue };
|
|
138
139
|
}
|
|
139
|
-
let hasWarnedAboutV2PushNotificationSecret = false;
|
|
140
|
-
function warnV2PushNotificationNeedsSecret() {
|
|
141
|
-
if (hasWarnedAboutV2PushNotificationSecret) return;
|
|
142
|
-
hasWarnedAboutV2PushNotificationSecret = true;
|
|
143
|
-
console.warn(
|
|
144
|
-
"[adcp] Suppressing push_notification_config for a v2 seller: AdCP 2.5 requires an `authentication` block and no `webhookSecret` is configured. Set `webhookSecret` to register async task-status webhooks with this agent, or move the agent to an AdCP 3.x pin, where the RFC 9421 webhook profile needs no shared secret."
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
140
|
function buildVersionEnvelopeForMode(mode, adcpVersion, serverVersion) {
|
|
148
|
-
if (
|
|
141
|
+
if (serverVersion === "v2") throw new import_errors.VersionUnsupportedError("request", "version", "v2");
|
|
142
|
+
if (mode === "none") return {};
|
|
149
143
|
if (mode === "major-only") return { adcp_major_version: resolveWireMajor(adcpVersion) };
|
|
150
144
|
return buildVersionEnvelope(adcpVersion, serverVersion);
|
|
151
145
|
}
|
|
@@ -182,7 +176,7 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
182
176
|
const argsWithVersion = applyVersionEnvelope(args, envelope);
|
|
183
177
|
applyPublishedSchemaCompatibility(options.toolName, argsWithVersion, args);
|
|
184
178
|
const effectiveBundle = typeof argsWithVersion.adcp_version === "string" ? (0, import_schema_loader.resolveBundleKey)(argsWithVersion.adcp_version) : void 0;
|
|
185
|
-
const usesApplicationRegistration =
|
|
179
|
+
const usesApplicationRegistration = (0, import_adcp_version_config.isAdcpVersionAtLeast)(effectiveBundle, "3.1.0");
|
|
186
180
|
let pushNotificationConfig;
|
|
187
181
|
let applicationPushNotificationConfig;
|
|
188
182
|
let operationId;
|
|
@@ -196,8 +190,6 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
196
190
|
credentials: options.webhookSecret
|
|
197
191
|
}
|
|
198
192
|
};
|
|
199
|
-
} else if (options.serverVersion === "v2") {
|
|
200
|
-
warnV2PushNotificationNeedsSecret();
|
|
201
193
|
} else {
|
|
202
194
|
pushNotificationConfig = {
|
|
203
195
|
url: options.webhookUrl,
|
|
@@ -373,7 +365,7 @@ class ProtocolClient {
|
|
|
373
365
|
}
|
|
374
366
|
);
|
|
375
367
|
} catch (err) {
|
|
376
|
-
if (agent.oauth_client_credentials && (0,
|
|
368
|
+
if (agent.oauth_client_credentials && (0, import_errors2.is401Error)(err) && (0, import_signedRequestRejection.getSignedRequestRejection)(err)?.challenge?.scheme !== "signature") {
|
|
377
369
|
const ccStorage = (0, import_oauth.getAgentStorage)(agent);
|
|
378
370
|
const allowPrivateIp = transport?.allowPrivateIp ?? (0, import_net.isLikelyPrivateUrl)(agent.agent_uri);
|
|
379
371
|
await (0, import_oauth.ensureClientCredentialsTokens)(agent, {
|
|
@@ -405,7 +397,7 @@ class ProtocolClient {
|
|
|
405
397
|
}
|
|
406
398
|
);
|
|
407
399
|
} catch (retryErr) {
|
|
408
|
-
const rejection = (0, import_signedRequestRejection.getSignedRequestRejection)(retryErr) ?? ((0,
|
|
400
|
+
const rejection = (0, import_signedRequestRejection.getSignedRequestRejection)(retryErr) ?? ((0, import_errors2.is401Error)(retryErr) ? (0, import_signedRequestRejection.getSignedRequestRejection)(err) : void 0);
|
|
409
401
|
if (rejection) throw rejection;
|
|
410
402
|
await rethrowAsNeedsAuthorization(
|
|
411
403
|
retryErr,
|
|
@@ -447,7 +439,7 @@ class ProtocolClient {
|
|
|
447
439
|
transport?.legacyCompat
|
|
448
440
|
);
|
|
449
441
|
} catch (err) {
|
|
450
|
-
if (agent.oauth_client_credentials && (0,
|
|
442
|
+
if (agent.oauth_client_credentials && (0, import_errors2.is401Error)(err) && (0, import_signedRequestRejection.getSignedRequestRejection)(err)?.challenge?.scheme !== "signature") {
|
|
451
443
|
const ccStorage = (0, import_oauth.getAgentStorage)(agent);
|
|
452
444
|
const allowPrivateIp = transport?.allowPrivateIp ?? (0, import_net.isLikelyPrivateUrl)(agent.agent_uri);
|
|
453
445
|
await (0, import_oauth.ensureClientCredentialsTokens)(agent, {
|
|
@@ -476,7 +468,7 @@ class ProtocolClient {
|
|
|
476
468
|
transport?.legacyCompat
|
|
477
469
|
);
|
|
478
470
|
} catch (retryErr) {
|
|
479
|
-
const rejection = (0, import_signedRequestRejection.getSignedRequestRejection)(retryErr) ?? ((0,
|
|
471
|
+
const rejection = (0, import_signedRequestRejection.getSignedRequestRejection)(retryErr) ?? ((0, import_errors2.is401Error)(retryErr) ? (0, import_signedRequestRejection.getSignedRequestRejection)(err) : void 0);
|
|
480
472
|
if (rejection) throw rejection;
|
|
481
473
|
await rethrowAsNeedsAuthorization(
|
|
482
474
|
retryErr,
|
|
@@ -512,9 +504,9 @@ async function rethrowAsNeedsAuthorization(err, agentUrl, fetchFn, signal, confi
|
|
|
512
504
|
const signedRejection = (0, import_signedRequestRejection.getSignedRequestRejection)(err);
|
|
513
505
|
if (signedRejection) throw signedRejection;
|
|
514
506
|
if (err instanceof import_oauth.NeedsAuthorizationError) throw err;
|
|
515
|
-
if (!(0,
|
|
507
|
+
if (!(0, import_errors2.is401Error)(err)) return;
|
|
516
508
|
if (recoveryMode === "static") {
|
|
517
|
-
throw new
|
|
509
|
+
throw new import_errors2.AuthenticationCredentialsRejectedError(agentUrl, err);
|
|
518
510
|
}
|
|
519
511
|
const allowPrivateIp = configuredAllowPrivateIp ?? (0, import_net.isLikelyPrivateUrl)(agentUrl);
|
|
520
512
|
const requirements = await (0, import_oauth.discoverAuthorizationRequirements)(agentUrl, { allowPrivateIp, fetchFn, signal });
|
|
@@ -3,6 +3,7 @@ import { dirname as __adcpDirname } from "node:path";
|
|
|
3
3
|
import { createRequire as __adcpCreateRequire } from "node:module";
|
|
4
4
|
const __dirname = __adcpDirname(__adcpFileURLToPath(import.meta.url));
|
|
5
5
|
const require2 = __adcpCreateRequire(import.meta.url);
|
|
6
|
+
import { VersionUnsupportedError } from "../errors/index.mjs";
|
|
6
7
|
import {
|
|
7
8
|
callMCPTool,
|
|
8
9
|
callMCPToolWithOAuth,
|
|
@@ -104,7 +105,7 @@ function bundleSupportsAdcpVersionField(bundleKey) {
|
|
|
104
105
|
return parseInt(minorMatch[1], 10) >= 1;
|
|
105
106
|
}
|
|
106
107
|
function buildVersionEnvelope(adcpVersion, serverVersion) {
|
|
107
|
-
if (serverVersion === "v2")
|
|
108
|
+
if (serverVersion === "v2") throw new VersionUnsupportedError("request", "version", "v2");
|
|
108
109
|
const wireMajor = resolveWireMajor(adcpVersion);
|
|
109
110
|
const bundleKey = resolveBundleKey(adcpVersion ?? ADCP_VERSION);
|
|
110
111
|
if (!bundleSupportsAdcpVersionField(bundleKey)) {
|
|
@@ -114,16 +115,9 @@ function buildVersionEnvelope(adcpVersion, serverVersion) {
|
|
|
114
115
|
validateAdcpVersionWire(wireValue);
|
|
115
116
|
return { adcp_major_version: wireMajor, adcp_version: wireValue };
|
|
116
117
|
}
|
|
117
|
-
let hasWarnedAboutV2PushNotificationSecret = false;
|
|
118
|
-
function warnV2PushNotificationNeedsSecret() {
|
|
119
|
-
if (hasWarnedAboutV2PushNotificationSecret) return;
|
|
120
|
-
hasWarnedAboutV2PushNotificationSecret = true;
|
|
121
|
-
console.warn(
|
|
122
|
-
"[adcp] Suppressing push_notification_config for a v2 seller: AdCP 2.5 requires an `authentication` block and no `webhookSecret` is configured. Set `webhookSecret` to register async task-status webhooks with this agent, or move the agent to an AdCP 3.x pin, where the RFC 9421 webhook profile needs no shared secret."
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
118
|
function buildVersionEnvelopeForMode(mode, adcpVersion, serverVersion) {
|
|
126
|
-
if (
|
|
119
|
+
if (serverVersion === "v2") throw new VersionUnsupportedError("request", "version", "v2");
|
|
120
|
+
if (mode === "none") return {};
|
|
127
121
|
if (mode === "major-only") return { adcp_major_version: resolveWireMajor(adcpVersion) };
|
|
128
122
|
return buildVersionEnvelope(adcpVersion, serverVersion);
|
|
129
123
|
}
|
|
@@ -160,7 +154,7 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
160
154
|
const argsWithVersion = applyVersionEnvelope(args, envelope);
|
|
161
155
|
applyPublishedSchemaCompatibility(options.toolName, argsWithVersion, args);
|
|
162
156
|
const effectiveBundle = typeof argsWithVersion.adcp_version === "string" ? resolveBundleKey(argsWithVersion.adcp_version) : void 0;
|
|
163
|
-
const usesApplicationRegistration =
|
|
157
|
+
const usesApplicationRegistration = isAdcpVersionAtLeast(effectiveBundle, "3.1.0");
|
|
164
158
|
let pushNotificationConfig;
|
|
165
159
|
let applicationPushNotificationConfig;
|
|
166
160
|
let operationId;
|
|
@@ -174,8 +168,6 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
174
168
|
credentials: options.webhookSecret
|
|
175
169
|
}
|
|
176
170
|
};
|
|
177
|
-
} else if (options.serverVersion === "v2") {
|
|
178
|
-
warnV2PushNotificationNeedsSecret();
|
|
179
171
|
} else {
|
|
180
172
|
pushNotificationConfig = {
|
|
181
173
|
url: options.webhookUrl,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { SupplyPathRequest, RegistrySupplyPathResult } from '../supply-path/types.mjs';
|
|
2
|
+
export * from '../identifiers.mjs';
|
|
3
|
+
export type { ResolveIdentifiersAllOptions, ResolveIdentifierOutcome } from './types.mjs';
|
|
4
|
+
import type { ResolveIdentifiersAllOptions, ResolveIdentifierOutcome } from './types.mjs';
|
|
2
5
|
import type { ResolvedBrand, LookupBrandOptions, ResolvedProperty, RegistryClientConfig, SaveBrandRequest, SaveBrandResponse, ListBrandLogosOptions, ListBrandLogosResponse, SaveBrandLogoInput, SaveBrandLogoResponse, UploadBrandLogoInput, UploadBrandLogoResponse, SavePropertyRequest, SavePropertyResponse, ResolveIdentifiersRequest, ResolveIdentifiersResponse, FileCatalogDisputeRequest, FileCatalogDisputeResponse, GetCatalogDisputeResponse, ClaimHostedPropertyDomainResponse, VerifyHostedPropertyOriginResponse, PropertyRegistryItem, ValidationResult, DomainLookupResult, ListBrandsOptions, ListBrandsResponse, GetBrandJsonResponse, ListOptions, ListAgentsOptions, ListAgentsResponse, ListPublishersResponse, ValidateAdagentsResponse, CreateAdagentsRequest, CreateAdagentsResponse, CommunityMirrorAdagentsConfig, CreateCommunityMirrorAdagentsConfig, CommunityMirrorAdagentsCatalog, PublishCommunityMirrorAdagentsResponse, ListCommunityMirrorAdagentsResponse, DeleteCommunityMirrorAdagentsResponse, PublisherPropertySelector, FindCompanyResult, FeedQuery, FeedResponse, AgentSearchQuery, AgentSearchResponse, CrawlRequestResponse, ManagerRevalidationResponse, ListPoliciesQuery, ListPoliciesResponse, ResolvePolicyQuery, ResolvePolicyResponse, ResolvePoliciesBulkRequest, ResolvePoliciesBulkResponse, GetPolicyHistoryQuery, GetPolicyHistoryResponse, SavePolicyRequest, SavePolicyResponse, GetBrandHistoryQuery, GetBrandHistoryResponse, GetPropertyHistoryQuery, GetPropertyHistoryResponse, AgentComplianceDetail, OperatorLookupResult, PublisherLookupResult, GetAgentStoryboardStatusResponse, GetAgentStoryboardStatusBulkResponse } from './types.mjs';
|
|
3
6
|
import type { FeedStreamQuery, FeedStreamMessage } from './feed-stream.mjs';
|
|
4
7
|
export type { ResolvedBrand, LookupBrandOptions, ResolvedProperty, PropertyInfo, RegistryClientConfig, SaveBrandRequest, SaveBrandResponse, BrandLogoReviewStatus, ApprovedBrandLogoAsset, PendingBrandLogoAsset, ReviewedBrandLogoAsset, BrandLogoAsset, ListBrandLogosOptions, ListBrandLogosResponse, SaveBrandLogoInput, SaveBrandLogoResponse, UploadBrandLogoInput, UploadBrandLogoResponse, SavePropertyIdentity, RegistryPropertyIdentity, SavePropertyRequest, SavePropertyResponse, ResolveIdentifiersRequest, ResolveIdentifiersResponse, FileCatalogDisputeRequest, FileCatalogDisputeResponse, GetCatalogDisputeResponse, ClaimHostedPropertyDomainResponse, VerifyHostedPropertyOriginResponse, BrandRegistryItem, PropertyRegistryItem, ValidationResult, FederatedAgentWithDetails, FederatedPublisher, DomainLookupResult, ListBrandsOptions, ListBrandsResponse, GetBrandJsonResponse, ListOptions, ListAgentsOptions, ListAgentsResponse, ListPublishersResponse, ValidateAdagentsRequest, ValidateAdagentsResponse, CreateAdagentsRequest, CreateAdagentsResponse, AdagentsAuthorizedAgent, AdagentsCatalogFormat, AdagentsPlacementDefinition, AdagentsPlacementFormatReference, AdagentsPlacementFormatOption, AdagentsPlacementTag, CreatedAdagentsJson, CommunityMirrorAdagentsConfig, CreateCommunityMirrorAdagentsConfig, CommunityMirrorAdagentsCatalog, PublishCommunityMirrorAdagentsResponse, CommunityMirrorAdagentsSummary, ListCommunityMirrorAdagentsResponse, GetCommunityMirrorAdagentsResponse, PublishCommunityMirrorAdagentsRequest, PublishCommunityMirrorAdagentsError, DeleteCommunityMirrorAdagentsResponse, ValidateProductAuthorizationRequest, ExpandProductIdentifiersRequest, PublisherPropertySelector, CompanySearchResult, FindCompanyResult, FeedQuery, AgentSearchQuery, CrawlRequest, ManagerRevalidationRequest, ManagerRevalidationResponse, ListPoliciesQuery, ListPoliciesResponse, ResolvePolicyQuery, ResolvePolicyResponse, ResolvePoliciesBulkRequest, ResolvePoliciesBulkResponse, GetPolicyHistoryQuery, GetPolicyHistoryResponse, SavePolicyRequest, SavePolicyResponse, GetBrandHistoryQuery, GetBrandHistoryResponse, GetPropertyHistoryQuery, GetPropertyHistoryResponse, AgentComplianceDetail, StoryboardStatus, OperatorLookupResult, PublisherLookupResult, ComplianceChangedPayload, GetAgentStoryboardStatusResponse, GetAgentStoryboardStatusBulkResponse, } from './types.mjs';
|
|
@@ -151,6 +154,7 @@ export declare class RegistryClient {
|
|
|
151
154
|
concurrency?: number;
|
|
152
155
|
}): Promise<Record<string, SavePropertyResponse | {
|
|
153
156
|
error: string;
|
|
157
|
+
cause?: Error;
|
|
154
158
|
}>>;
|
|
155
159
|
/**
|
|
156
160
|
* Resolve catalog identifiers to stable property_rids.
|
|
@@ -158,6 +162,14 @@ export declare class RegistryClient {
|
|
|
158
162
|
* contribution; `lookup` mode is read-only.
|
|
159
163
|
*/
|
|
160
164
|
resolveIdentifiers(request: ResolveIdentifiersRequest): Promise<ResolveIdentifiersResponse>;
|
|
165
|
+
/**
|
|
166
|
+
* Bulk catalog registration (`resolve`, the default) or read-only `lookup`.
|
|
167
|
+
* Splits by identifier count and UTF-8 request bytes, bounds concurrency,
|
|
168
|
+
* and honors Retry-After on 429. Results retain input order and duplicates.
|
|
169
|
+
* Network/5xx failures are not retried: resolve contributions have additive
|
|
170
|
+
* activity logs even though identifier-to-RID mapping is idempotent.
|
|
171
|
+
*/
|
|
172
|
+
resolveIdentifiersAll(request: ResolveIdentifiersRequest, options?: ResolveIdentifiersAllOptions): Promise<ResolveIdentifierOutcome[]>;
|
|
161
173
|
/** File a catalog fact dispute. Requires authentication. */
|
|
162
174
|
fileCatalogDispute(request: FileCatalogDisputeRequest): Promise<FileCatalogDisputeResponse>;
|
|
163
175
|
/** Fetch a catalog dispute by id. */
|