@adcp/sdk 14.0.0-rc.38 → 14.0.0-rc.39
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/bin/adcp-storyboard-summary.js +286 -0
- package/bin/adcp.js +221 -10
- package/dist/lib/conformance/schemaLoader.d.mts +1 -1
- package/dist/lib/conformance/schemaLoader.d.ts +1 -1
- package/dist/lib/core/AgentClient.d.mts +6 -1
- package/dist/lib/core/AgentClient.d.ts +6 -1
- package/dist/lib/core/AgentClient.js +9 -0
- package/dist/lib/core/AgentClient.mjs +9 -0
- package/dist/lib/core/ConversationTypes.d.mts +29 -0
- package/dist/lib/core/ConversationTypes.d.ts +29 -0
- package/dist/lib/core/SingleAgentClient.d.mts +3 -1
- package/dist/lib/core/SingleAgentClient.d.ts +3 -1
- package/dist/lib/core/SingleAgentClient.js +9 -1
- package/dist/lib/core/SingleAgentClient.mjs +9 -1
- package/dist/lib/core/TaskExecutor.d.mts +13 -1
- package/dist/lib/core/TaskExecutor.d.ts +13 -1
- package/dist/lib/core/TaskExecutor.js +216 -18
- package/dist/lib/core/TaskExecutor.mjs +216 -19
- package/dist/lib/index.d.mts +5 -2
- package/dist/lib/index.d.ts +5 -2
- package/dist/lib/index.js +10 -1
- package/dist/lib/index.mjs +10 -1
- package/dist/lib/media-buy/action-assessment.d.mts +77 -0
- package/dist/lib/media-buy/action-assessment.d.ts +77 -0
- package/dist/lib/media-buy/action-assessment.js +300 -0
- package/dist/lib/media-buy/action-assessment.mjs +284 -0
- package/dist/lib/media-buy/action-constraints.d.mts +9 -0
- package/dist/lib/media-buy/action-constraints.d.ts +9 -0
- package/dist/lib/media-buy/action-constraints.js +170 -0
- package/dist/lib/media-buy/action-constraints.mjs +146 -0
- package/dist/lib/media-buy/action-contracts.d.mts +40 -0
- package/dist/lib/media-buy/action-contracts.d.ts +40 -0
- package/dist/lib/media-buy/action-contracts.js +304 -0
- package/dist/lib/media-buy/action-contracts.mjs +267 -0
- package/dist/lib/media-buy/action-metadata.generated.d.mts +37 -0
- package/dist/lib/media-buy/action-metadata.generated.d.ts +37 -0
- package/dist/lib/media-buy/action-metadata.generated.js +128 -0
- package/dist/lib/media-buy/action-metadata.generated.mjs +101 -0
- package/dist/lib/media-buy/action-types.d.mts +106 -0
- package/dist/lib/media-buy/action-types.d.ts +106 -0
- package/dist/lib/{types/v3-1-beta/tools.generated.js → media-buy/action-types.js} +2 -2
- package/dist/lib/media-buy/actions.d.mts +6 -0
- package/dist/lib/media-buy/actions.d.ts +6 -0
- package/dist/lib/media-buy/actions.js +38 -0
- package/dist/lib/media-buy/actions.mjs +9 -0
- package/dist/lib/media-buy/available-actions.d.mts +2 -1
- package/dist/lib/media-buy/available-actions.d.ts +2 -1
- package/dist/lib/media-buy/available-actions.js +4 -3
- package/dist/lib/media-buy/available-actions.mjs +4 -3
- package/dist/lib/media-buy/compatibility.js +3 -0
- package/dist/lib/media-buy/compatibility.mjs +3 -0
- package/dist/lib/media-buy/index.d.mts +4 -0
- package/dist/lib/media-buy/index.d.ts +4 -0
- package/dist/lib/media-buy/index.js +3 -1
- package/dist/lib/media-buy/index.mjs +1 -0
- package/dist/lib/media-buy/legacy-action-ids.d.mts +1 -0
- package/dist/lib/media-buy/legacy-action-ids.d.ts +1 -0
- package/dist/lib/media-buy/legacy-action-ids.js +50 -0
- package/dist/lib/media-buy/legacy-action-ids.mjs +26 -0
- package/dist/lib/media-buy/mutations.d.mts +70 -0
- package/dist/lib/media-buy/mutations.d.ts +70 -0
- package/dist/lib/media-buy/mutations.js +525 -0
- package/dist/lib/media-buy/mutations.mjs +498 -0
- package/dist/lib/media-buy/preflight.d.mts +20 -69
- package/dist/lib/media-buy/preflight.d.ts +20 -69
- package/dist/lib/media-buy/preflight.js +100 -336
- package/dist/lib/media-buy/preflight.mjs +111 -333
- package/dist/lib/media-buy/targeting-input.d.mts +7 -4
- package/dist/lib/media-buy/targeting-input.d.ts +7 -4
- package/dist/lib/media-buy/types.d.mts +55 -7
- package/dist/lib/media-buy/types.d.ts +55 -7
- package/dist/lib/protocols/rawResponseCapture.d.mts +12 -0
- package/dist/lib/protocols/rawResponseCapture.d.ts +12 -0
- package/dist/lib/protocols/rawResponseCapture.js +33 -3
- package/dist/lib/protocols/rawResponseCapture.mjs +32 -3
- package/dist/lib/registry/types.generated.d.mts +377 -9
- package/dist/lib/registry/types.generated.d.ts +377 -9
- package/dist/lib/reporting/evidence.d.mts +1 -0
- package/dist/lib/reporting/evidence.d.ts +1 -0
- package/dist/lib/reporting/evidence.js +32 -3
- package/dist/lib/reporting/evidence.mjs +31 -3
- package/dist/lib/reporting/ledger/handler.d.mts +51 -1
- package/dist/lib/reporting/ledger/handler.d.ts +51 -1
- package/dist/lib/reporting/ledger/handler.js +306 -38
- package/dist/lib/reporting/ledger/handler.mjs +304 -37
- package/dist/lib/reporting/ledger/health.d.mts +12 -0
- package/dist/lib/reporting/ledger/health.d.ts +12 -0
- package/dist/lib/reporting/ledger/health.js +15 -2
- package/dist/lib/reporting/ledger/health.mjs +13 -1
- package/dist/lib/reporting/ledger/index.d.mts +3 -0
- package/dist/lib/reporting/ledger/index.d.ts +3 -0
- package/dist/lib/reporting/ledger/index.js +7 -1
- package/dist/lib/reporting/ledger/index.mjs +3 -0
- package/dist/lib/reporting/ledger/lifecycle.d.mts +31 -4
- package/dist/lib/reporting/ledger/lifecycle.d.ts +31 -4
- package/dist/lib/reporting/ledger/lifecycle.js +244 -37
- package/dist/lib/reporting/ledger/lifecycle.mjs +244 -37
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +231 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +231 -0
- package/dist/lib/reporting/ledger/managed-postgres.js +1797 -0
- package/dist/lib/reporting/ledger/managed-postgres.mjs +1776 -0
- package/dist/lib/reporting/ledger/managed.d.mts +355 -0
- package/dist/lib/reporting/ledger/managed.d.ts +355 -0
- package/dist/lib/reporting/ledger/managed.js +661 -0
- package/dist/lib/reporting/ledger/managed.mjs +633 -0
- package/dist/lib/reporting/ledger/notification-activity.d.mts +222 -0
- package/dist/lib/reporting/ledger/notification-activity.d.ts +222 -0
- package/dist/lib/reporting/ledger/notification-activity.js +1139 -0
- package/dist/lib/reporting/ledger/notification-activity.mjs +1110 -0
- package/dist/lib/reporting/ledger/postgres.d.mts +161 -1
- package/dist/lib/reporting/ledger/postgres.d.ts +161 -1
- package/dist/lib/reporting/ledger/postgres.js +1153 -21
- package/dist/lib/reporting/ledger/postgres.mjs +1152 -21
- package/dist/lib/reporting/ledger/producer.d.mts +8 -0
- package/dist/lib/reporting/ledger/producer.d.ts +8 -0
- package/dist/lib/reporting/ledger/producer.js +146 -52
- package/dist/lib/reporting/ledger/producer.mjs +146 -51
- package/dist/lib/reporting/ledger/types.d.mts +358 -1
- package/dist/lib/reporting/ledger/types.d.ts +358 -1
- package/dist/lib/reporting/ledger/types.js +3 -0
- package/dist/lib/reporting/ledger/types.mjs +2 -0
- package/dist/lib/reporting/service/conformance.d.mts +35 -0
- package/dist/lib/reporting/service/conformance.d.ts +35 -0
- package/dist/lib/reporting/service/conformance.js +89 -0
- package/dist/lib/reporting/service/conformance.mjs +68 -0
- package/dist/lib/reporting/service/index.d.mts +182 -0
- package/dist/lib/reporting/service/index.d.ts +182 -0
- package/dist/lib/reporting/service/index.js +793 -0
- package/dist/lib/reporting/service/index.mjs +787 -0
- package/dist/lib/reporting/source/index.d.mts +2 -1
- package/dist/lib/reporting/source/index.d.ts +2 -1
- package/dist/lib/reporting/source/index.js +16 -3
- package/dist/lib/reporting/source/index.mjs +12 -1
- package/dist/lib/reporting/source/inline.d.mts +88 -1
- package/dist/lib/reporting/source/inline.d.ts +88 -1
- package/dist/lib/reporting/source/inline.js +1161 -163
- package/dist/lib/reporting/source/inline.mjs +1166 -163
- package/dist/lib/reporting/source/manifest.js +12 -7
- package/dist/lib/reporting/source/manifest.mjs +12 -7
- package/dist/lib/reporting/source/source.d.mts +26 -0
- package/dist/lib/reporting/source/source.d.ts +26 -0
- package/dist/lib/reporting/source/source.js +71 -2
- package/dist/lib/reporting/source/source.mjs +65 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.d.mts +18 -0
- package/dist/lib/server/create-adcp-server.d.ts +18 -0
- package/dist/lib/server/create-adcp-server.js +52 -2
- package/dist/lib/server/create-adcp-server.mjs +52 -2
- package/dist/lib/server/decisioning/account.d.mts +1 -1
- package/dist/lib/server/decisioning/account.d.ts +1 -1
- package/dist/lib/server/decisioning/index.d.mts +1 -0
- package/dist/lib/server/decisioning/index.d.ts +1 -0
- package/dist/lib/server/decisioning/platform.d.mts +3 -0
- package/dist/lib/server/decisioning/platform.d.ts +3 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +88 -10
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +88 -10
- package/dist/lib/server/decisioning/specialisms/reporting.d.mts +38 -0
- package/dist/lib/server/decisioning/specialisms/reporting.d.ts +38 -0
- package/dist/lib/{types/v3-1-beta/index.js → server/decisioning/specialisms/reporting.js} +2 -8
- package/dist/lib/server/decisioning/specialisms/reporting.mjs +0 -0
- package/dist/lib/server/index.d.mts +4 -2
- package/dist/lib/server/index.d.ts +4 -2
- package/dist/lib/server/index.js +5 -0
- package/dist/lib/server/index.mjs +4 -0
- package/dist/lib/server/media-buy-action-resolver.d.mts +63 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +63 -0
- package/dist/lib/server/media-buy-action-resolver.js +297 -0
- package/dist/lib/server/media-buy-action-resolver.mjs +285 -0
- package/dist/lib/server/media-buy-actions.d.mts +7 -8
- package/dist/lib/server/media-buy-actions.d.ts +7 -8
- package/dist/lib/server/media-buy-actions.js +57 -14
- package/dist/lib/server/media-buy-actions.mjs +63 -14
- package/dist/lib/server/notification-subscriptions/index.d.mts +2 -2
- package/dist/lib/server/notification-subscriptions/index.d.ts +2 -2
- package/dist/lib/server/notification-subscriptions/index.js +2 -0
- package/dist/lib/server/notification-subscriptions/index.mjs +2 -0
- package/dist/lib/server/notification-subscriptions/postgres-runtime.d.mts +3 -1
- package/dist/lib/server/notification-subscriptions/postgres-runtime.d.ts +3 -1
- package/dist/lib/server/notification-subscriptions/postgres-runtime.js +1 -0
- package/dist/lib/server/notification-subscriptions/postgres-runtime.mjs +1 -0
- package/dist/lib/server/notification-subscriptions/runtime.d.mts +12 -1
- package/dist/lib/server/notification-subscriptions/runtime.d.ts +12 -1
- package/dist/lib/server/notification-subscriptions/runtime.js +102 -16
- package/dist/lib/server/notification-subscriptions/runtime.mjs +101 -16
- package/dist/lib/server/notification-subscriptions/types.d.mts +104 -1
- package/dist/lib/server/notification-subscriptions/types.d.ts +104 -1
- package/dist/lib/server/webhook-emitter.d.mts +40 -5
- package/dist/lib/server/webhook-emitter.d.ts +40 -5
- package/dist/lib/server/webhook-emitter.js +23 -12
- package/dist/lib/server/webhook-emitter.mjs +23 -12
- package/dist/lib/storage/interfaces.d.mts +14 -2
- package/dist/lib/storage/interfaces.d.ts +14 -2
- package/dist/lib/testing/compliance/comply.d.mts +9 -3
- package/dist/lib/testing/compliance/comply.d.ts +9 -3
- package/dist/lib/testing/compliance/comply.js +158 -3
- package/dist/lib/testing/compliance/comply.mjs +159 -4
- package/dist/lib/testing/compliance/storyboard-tracks.js +7 -5
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +7 -5
- package/dist/lib/testing/compliance/summary.js +10 -1
- package/dist/lib/testing/compliance/summary.mjs +10 -1
- package/dist/lib/testing/index.d.mts +1 -1
- package/dist/lib/testing/index.d.ts +1 -1
- package/dist/lib/testing/index.js +2 -0
- package/dist/lib/testing/index.mjs +3 -1
- package/dist/lib/testing/storyboard/agent-routing.d.mts +12 -43
- package/dist/lib/testing/storyboard/agent-routing.d.ts +12 -43
- package/dist/lib/testing/storyboard/agent-routing.js +75 -13
- package/dist/lib/testing/storyboard/agent-routing.mjs +70 -12
- package/dist/lib/testing/storyboard/index.d.mts +1 -0
- package/dist/lib/testing/storyboard/index.d.ts +1 -0
- package/dist/lib/testing/storyboard/index.js +3 -0
- package/dist/lib/testing/storyboard/index.mjs +2 -0
- package/dist/lib/testing/storyboard/junit.d.mts +1 -1
- package/dist/lib/testing/storyboard/junit.d.ts +1 -1
- package/dist/lib/testing/storyboard/junit.js +21 -2
- package/dist/lib/testing/storyboard/junit.mjs +21 -2
- package/dist/lib/testing/storyboard/probes.d.mts +130 -0
- package/dist/lib/testing/storyboard/probes.d.ts +130 -0
- package/dist/lib/testing/storyboard/probes.js +682 -10
- package/dist/lib/testing/storyboard/probes.mjs +683 -3
- package/dist/lib/testing/storyboard/request-signing/builder.d.mts +16 -5
- package/dist/lib/testing/storyboard/request-signing/builder.d.ts +16 -5
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +44 -1
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +44 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +46 -22
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +43 -21
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.mts +86 -11
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.ts +86 -11
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +119 -25
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +117 -26
- package/dist/lib/testing/storyboard/request-signing/synthesize.js +22 -2
- package/dist/lib/testing/storyboard/request-signing/synthesize.mjs +22 -2
- package/dist/lib/testing/storyboard/runner.d.mts +103 -0
- package/dist/lib/testing/storyboard/runner.d.ts +103 -0
- package/dist/lib/testing/storyboard/runner.js +1090 -268
- package/dist/lib/testing/storyboard/runner.mjs +1096 -261
- package/dist/lib/testing/storyboard/seeding.d.mts +4 -1
- package/dist/lib/testing/storyboard/seeding.d.ts +4 -1
- package/dist/lib/testing/storyboard/seeding.js +55 -24
- package/dist/lib/testing/storyboard/seeding.mjs +55 -24
- package/dist/lib/testing/storyboard/test-kit.d.mts +37 -3
- package/dist/lib/testing/storyboard/test-kit.d.ts +37 -3
- package/dist/lib/testing/storyboard/test-kit.js +8 -2
- package/dist/lib/testing/storyboard/test-kit.mjs +7 -2
- package/dist/lib/testing/storyboard/types.d.mts +132 -10
- package/dist/lib/testing/storyboard/types.d.ts +132 -10
- package/dist/lib/testing/storyboard/types.js +17 -0
- package/dist/lib/testing/storyboard/types.mjs +16 -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 +16 -0
- package/dist/lib/testing/storyboard/validations.mjs +16 -0
- package/dist/lib/testing/test-controller.d.mts +1 -1
- package/dist/lib/testing/test-controller.d.ts +1 -1
- package/dist/lib/types/buy-products.d.ts +71 -6
- package/dist/lib/types/control-media-buy.d.ts +25 -11
- package/dist/lib/types/core.generated.d.mts +69 -10
- package/dist/lib/types/core.generated.d.ts +69 -10
- package/dist/lib/types/create-media-buy.d.ts +71 -6
- package/dist/lib/types/forward-compat-error-codes.d.mts +7 -6
- package/dist/lib/types/forward-compat-error-codes.d.ts +7 -6
- package/dist/lib/types/index.d.mts +2 -2
- package/dist/lib/types/index.d.ts +2 -2
- package/dist/lib/types/schemas.generated.d.ts +8040 -8116
- package/dist/lib/types/schemas.generated.js +1074 -309
- package/dist/lib/types/schemas.generated.mjs +1068 -309
- package/dist/lib/types/tools.generated.d.mts +65 -6
- package/dist/lib/types/tools.generated.d.ts +65 -6
- package/dist/lib/types/update-media-buy.d.ts +71 -6
- package/dist/lib/utils/redact-secrets.d.mts +1 -1
- package/dist/lib/utils/redact-secrets.d.ts +1 -1
- package/dist/lib/utils/redact-secrets.js +1 -1
- package/dist/lib/utils/redact-secrets.mjs +1 -1
- package/dist/lib/v2/projection/cache-versions.d.mts +0 -1
- package/dist/lib/v2/projection/cache-versions.d.ts +0 -1
- package/dist/lib/v2/projection/cache-versions.js +1 -15
- package/dist/lib/v2/projection/cache-versions.mjs +1 -14
- package/dist/lib/v2/projection/canonical-properties.js +2 -2
- package/dist/lib/v2/projection/canonical-properties.mjs +3 -3
- package/dist/lib/v2/projection/registry.d.mts +1 -1
- package/dist/lib/v2/projection/registry.d.ts +1 -1
- package/dist/lib/v2/projection/registry.js +2 -2
- package/dist/lib/v2/projection/registry.mjs +3 -3
- package/dist/lib/version.d.mts +5 -5
- package/dist/lib/version.d.ts +5 -5
- package/dist/lib/version.js +3 -8
- package/dist/lib/version.mjs +3 -8
- package/dist/lib/wholesale-feed-sync/index.d.mts +1 -0
- package/dist/lib/wholesale-feed-sync/index.d.ts +1 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.d.mts +42 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.d.ts +42 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.js +16 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.mjs +0 -0
- package/dist/lib/wholesale-feed-sync/sync.d.mts +6 -6
- package/dist/lib/wholesale-feed-sync/sync.d.ts +6 -6
- package/dist/lib/wholesale-feed-sync/sync.js +3 -1
- package/dist/lib/wholesale-feed-sync/sync.mjs +3 -1
- package/dist/lib/wholesale-feed-sync/types.d.mts +15 -14
- package/dist/lib/wholesale-feed-sync/types.d.ts +15 -14
- package/dist/lib/wholesale-feed-sync/webhook-notification.d.mts +7 -5
- package/dist/lib/wholesale-feed-sync/webhook-notification.d.ts +7 -5
- package/dist/lib/wholesale-feed-sync/webhook-notification.js +45 -0
- package/dist/lib/wholesale-feed-sync/webhook-notification.mjs +44 -0
- package/docs/CLI.md +1 -1
- package/docs/TYPE-SUMMARY.md +118 -4
- package/docs/guides/ASYNC-API-REFERENCE.md +62 -1
- package/docs/guides/ASYNC-DEVELOPER-GUIDE.md +25 -0
- package/docs/guides/ASYNC-DOCUMENTATION-INDEX.md +3 -0
- package/docs/guides/BUYER-QUICKSTART-3.2.md +5 -0
- package/docs/guides/DURABLE-BUYER-WRITES.md +337 -0
- package/docs/guides/EXISTING-PLATFORM.md +35 -0
- package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +7 -3
- package/docs/guides/MEDIA-BUY-ACTION-ASSESSMENT.md +300 -0
- package/docs/guides/REPORTING-LEDGER.md +654 -3
- package/docs/guides/REPORTING-SOURCE-EXECUTOR.md +63 -1
- package/docs/guides/SELLER-QUICKSTART-3.2.md +2 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +35 -0
- package/docs/guides/idempotency-crash-recovery.md +4 -0
- package/docs/llms.txt +4 -2
- package/docs/migration-14.x-rc-worksheet.md +5 -5
- package/docs/migration-7.9-to-7.10.md +7 -5
- package/examples/README.md +17 -0
- package/examples/durable-buyer-writes/caller.ts +745 -0
- package/examples/durable-buyer-writes/worker.ts +240 -0
- package/examples/reliable-reporting-service/README.md +100 -0
- package/examples/seller-3.2-starter.ts +7 -8
- package/examples/targeting-input-existing-platform.ts +153 -0
- package/package.json +41 -29
- package/skills/build-seller-agent/specialisms/signed-requests.md +11 -1
- package/skills/cross-cutting.md +28 -11
- package/compliance/cache/3.1.0-beta.7/domains/brand/index.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/distributed_brand_resolution.yaml +0 -415
- package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/single_side_trust_extension.yaml +0 -454
- package/compliance/cache/3.1.0-beta.7/domains/creative/index.yaml +0 -339
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/billing_out_of_band.yaml +0 -153
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/native_in_feed.yaml +0 -543
- package/compliance/cache/3.1.0-beta.7/domains/governance/index.yaml +0 -682
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/index.yaml +0 -781
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/audience_buy_flow.yaml +0 -380
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/available_actions.yaml +0 -565
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/canonical_formats.yaml +0 -711
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -234
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_reception.yaml +0 -247
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/delivery_reporting.yaml +0 -357
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment.yaml +0 -633
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/event_dedup_flow.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_approved.yaml +0 -214
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_conditions.yaml +0 -199
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied.yaml +0 -204
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/invalid_transitions.yaml +0 -289
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_accountability.yaml +0 -244
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow.yaml +0 -428
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/product_signal_targeting.yaml +0 -373
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_enforcement.yaml +0 -517
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/reach_buy_flow.yaml +0 -823
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_products.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/state-machine.yaml +0 -442
- package/compliance/cache/3.1.0-beta.7/domains/signals/index.yaml +0 -266
- package/compliance/cache/3.1.0-beta.7/domains/sponsored-intelligence/index.yaml +0 -256
- package/compliance/cache/3.1.0-beta.7/index.json +0 -356
- package/compliance/cache/3.1.0-beta.7/protocols/brand/index.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/distributed_brand_resolution.yaml +0 -415
- package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/single_side_trust_extension.yaml +0 -454
- package/compliance/cache/3.1.0-beta.7/protocols/creative/index.yaml +0 -339
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/billing_out_of_band.yaml +0 -153
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/native_in_feed.yaml +0 -543
- package/compliance/cache/3.1.0-beta.7/protocols/governance/index.yaml +0 -682
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/index.yaml +0 -781
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/audience_buy_flow.yaml +0 -380
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/available_actions.yaml +0 -565
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/canonical_formats.yaml +0 -711
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -234
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_reception.yaml +0 -247
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -357
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment.yaml +0 -633
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/event_dedup_flow.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_approved.yaml +0 -214
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_conditions.yaml +0 -199
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied.yaml +0 -204
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -289
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_accountability.yaml +0 -244
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow.yaml +0 -428
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/product_signal_targeting.yaml +0 -373
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_enforcement.yaml +0 -517
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/reach_buy_flow.yaml +0 -823
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_products.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/state-machine.yaml +0 -442
- package/compliance/cache/3.1.0-beta.7/protocols/signals/index.yaml +0 -266
- package/compliance/cache/3.1.0-beta.7/protocols/sponsored-intelligence/index.yaml +0 -256
- package/compliance/cache/3.1.0-beta.7/specialisms/audience-sync/index.yaml +0 -313
- package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/index.yaml +0 -350
- package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -226
- package/compliance/cache/3.1.0-beta.7/specialisms/collection-lists/index.yaml +0 -359
- package/compliance/cache/3.1.0-beta.7/specialisms/content-standards/index.yaml +0 -572
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-ad-server/index.yaml +0 -409
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/generative-seller.yaml +0 -807
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/index.yaml +0 -758
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-template/index.yaml +0 -510
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/index.yaml +0 -143
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/scenarios/governance_multi_agent_rejected.yaml +0 -117
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-delivery-monitor/index.yaml +0 -441
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/denied.yaml +0 -221
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/index.yaml +0 -330
- package/compliance/cache/3.1.0-beta.7/specialisms/property-lists/index.yaml +0 -482
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-broadcast-tv/index.yaml +0 -738
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-catalog-driven/index.yaml +0 -840
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-guaranteed/index.yaml +0 -601
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-non-guaranteed/index.yaml +0 -546
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-proposal-mode/index.yaml +0 -586
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-social/index.yaml +0 -919
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/index.yaml +0 -424
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -211
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-owned/index.yaml +0 -317
- package/compliance/cache/3.1.0-beta.7/specialisms/sponsored-intelligence/index.yaml +0 -59
- package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor-live.yaml +0 -78
- package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor.yaml +0 -223
- package/compliance/cache/3.1.0-beta.7/test-kits/billing-gate-runner.yaml +0 -115
- package/compliance/cache/3.1.0-beta.7/test-kits/bistro-oranje.yaml +0 -126
- package/compliance/cache/3.1.0-beta.7/test-kits/distributed-brand-runner.yaml +0 -281
- package/compliance/cache/3.1.0-beta.7/test-kits/nova-motors.yaml +0 -262
- package/compliance/cache/3.1.0-beta.7/test-kits/osei-natural.yaml +0 -126
- package/compliance/cache/3.1.0-beta.7/test-kits/parallel-dispatch-runner.yaml +0 -196
- package/compliance/cache/3.1.0-beta.7/test-kits/rate-limit-trip-runner.yaml +0 -172
- package/compliance/cache/3.1.0-beta.7/test-kits/signed-requests-runner.yaml +0 -155
- package/compliance/cache/3.1.0-beta.7/test-kits/single-side-trust-runner.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/test-kits/substitution-observer-runner.yaml +0 -688
- package/compliance/cache/3.1.0-beta.7/test-kits/summit-foods.yaml +0 -125
- package/compliance/cache/3.1.0-beta.7/test-kits/webhook-receiver-runner.yaml +0 -265
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/001-minimal-plan.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/002-full-plan.json +0 -217
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -60
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004a-human-review-omitted.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -49
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -53
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -57
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -49
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -53
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/007-unicode-objectives.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -65
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/README.md +0 -220
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/canonicalization.json +0 -241
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/keys.json +0 -60
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/001-no-signature-header.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/002-wrong-tag.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/003-expired-signature.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/004-window-too-long.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -33
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/011-malformed-header.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/013-expires-le-created.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/015-signature-invalid.json +0 -28
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -35
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/017-key-revoked.json +0 -38
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -28
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/020-rate-abuse.json +0 -34
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/028-unsigned-protocol-method-required.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/001-basic-post.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/003-es256-post.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/README.md +0 -211
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/keys.json +0 -61
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -37
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -33
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -41
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/001-basic-post.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/002-es256-post.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -25
- package/compliance/cache/3.1.0-beta.7/universal/billing-gate-dispatch.yaml +0 -450
- package/compliance/cache/3.1.0-beta.7/universal/canonical-format-validate-input.yaml +0 -640
- package/compliance/cache/3.1.0-beta.7/universal/capability-discovery.yaml +0 -125
- package/compliance/cache/3.1.0-beta.7/universal/collection-lists-pagination-integrity.yaml +0 -306
- package/compliance/cache/3.1.0-beta.7/universal/comply-controller-mode-gate.yaml +0 -141
- package/compliance/cache/3.1.0-beta.7/universal/content-standards-pagination-integrity.yaml +0 -326
- package/compliance/cache/3.1.0-beta.7/universal/deterministic-testing.yaml +0 -1430
- package/compliance/cache/3.1.0-beta.7/universal/error-compliance-signals.yaml +0 -377
- package/compliance/cache/3.1.0-beta.7/universal/error-compliance.yaml +0 -528
- package/compliance/cache/3.1.0-beta.7/universal/fictional-entities.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/universal/get-media-buys-pagination-integrity.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/universal/get-signals-pagination-integrity.yaml +0 -211
- package/compliance/cache/3.1.0-beta.7/universal/idempotency.yaml +0 -861
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-event-scope.yaml +0 -119
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-lifecycle.yaml +0 -337
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-rejections.yaml +0 -107
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-creative-formats.yaml +0 -265
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-list-accounts.yaml +0 -245
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity.yaml +0 -263
- package/compliance/cache/3.1.0-beta.7/universal/property-lists-pagination-integrity.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/universal/read-tool-idempotency.yaml +0 -405
- package/compliance/cache/3.1.0-beta.7/universal/runner-output-contract.yaml +0 -1266
- package/compliance/cache/3.1.0-beta.7/universal/schema-validation-signals.yaml +0 -181
- package/compliance/cache/3.1.0-beta.7/universal/schema-validation.yaml +0 -548
- package/compliance/cache/3.1.0-beta.7/universal/security.yaml +0 -539
- package/compliance/cache/3.1.0-beta.7/universal/signed-requests.yaml +0 -217
- package/compliance/cache/3.1.0-beta.7/universal/stale-response-advisory.yaml +0 -295
- package/compliance/cache/3.1.0-beta.7/universal/storyboard-schema.yaml +0 -2136
- package/compliance/cache/3.1.0-beta.7/universal/v3-envelope-integrity.yaml +0 -117
- package/compliance/cache/3.1.0-beta.7/universal/version-negotiation.yaml +0 -130
- package/compliance/cache/3.1.0-beta.7/universal/webhook-emission.yaml +0 -411
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-bulk-webhooks.yaml +0 -82
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-product-webhooks.yaml +0 -83
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-products.yaml +0 -151
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signal-webhooks.yaml +0 -83
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signals.yaml +0 -149
- package/dist/lib/types/v3-1-beta/index.d.mts +0 -1
- package/dist/lib/types/v3-1-beta/index.d.ts +0 -1
- package/dist/lib/types/v3-1-beta/index.mjs +0 -1
- package/dist/lib/types/v3-1-beta/tools.generated.d.mts +0 -26788
- package/dist/lib/types/v3-1-beta/tools.generated.d.ts +0 -26788
- /package/dist/lib/{types/v3-1-beta/tools.generated.mjs → media-buy/action-types.mjs} +0 -0
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var service_exports = {};
|
|
21
|
+
__export(service_exports, {
|
|
22
|
+
createReliableReportingService: () => createReliableReportingService
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(service_exports);
|
|
25
|
+
var import_credential_policy = require('../../server/credential-policy.js');
|
|
26
|
+
var import_jcs = require('../../utils/jcs.js');
|
|
27
|
+
var import_redact_credential_patterns = require('../../utils/redact-credential-patterns.js');
|
|
28
|
+
var import_schemas = require('../../types/schemas.generated.js');
|
|
29
|
+
var import_ledger = require('../ledger/index.js');
|
|
30
|
+
var import_source = require('../source/index.js');
|
|
31
|
+
__reExport(service_exports, require('./conformance.js'), module.exports);
|
|
32
|
+
const ADAPTER_SCOPE_KEY = "_adcp_reporting_adapter";
|
|
33
|
+
function createReliableReportingService(options) {
|
|
34
|
+
const adapterEntries = Object.entries(options.adapters);
|
|
35
|
+
if (adapterEntries.length === 0) throw new TypeError("Reliable reporting requires at least one adapter");
|
|
36
|
+
positiveInteger(options.automatedRecoveryWindowSeconds, "automatedRecoveryWindowSeconds");
|
|
37
|
+
const sources = /* @__PURE__ */ new Map();
|
|
38
|
+
const adapterOfferings = /* @__PURE__ */ new Map();
|
|
39
|
+
const offerings = /* @__PURE__ */ new Map();
|
|
40
|
+
const deliveryOfferings = [];
|
|
41
|
+
for (const [adapterId, adapter] of adapterEntries) {
|
|
42
|
+
if (!/^[A-Za-z0-9_.:-]{1,128}$/.test(adapterId)) throw new TypeError("Reporting adapter IDs must be bounded IDs");
|
|
43
|
+
const sourceOffering = import_source.ReportingSourceOfferingV1Schema.parse(structuredClone(adapter.sourceOffering));
|
|
44
|
+
const deliveryOffering = import_schemas.ReportingDeliveryOfferingSchema.parse(
|
|
45
|
+
structuredClone(adapter.deliveryOffering)
|
|
46
|
+
);
|
|
47
|
+
if (offerings.has(sourceOffering.offeringId)) throw new TypeError("Reporting offering IDs must be unique");
|
|
48
|
+
if (adapter.fetchSlice === void 0 === (adapter.executor === void 0)) {
|
|
49
|
+
throw new TypeError("Each reporting adapter requires exactly one of fetchSlice or executor");
|
|
50
|
+
}
|
|
51
|
+
const source = adapter.executor ?? (0, import_source.createInlineReportingSourceExecutor)(adapter.fetchSlice, sourceOffering, {
|
|
52
|
+
...adapter.inlineReplayRetention ? { replayRetention: adapter.inlineReplayRetention } : {}
|
|
53
|
+
});
|
|
54
|
+
const routed = source.capabilities.offerings.filter(
|
|
55
|
+
(candidate) => candidate.offeringId === sourceOffering.offeringId
|
|
56
|
+
);
|
|
57
|
+
if (routed.length !== 1) {
|
|
58
|
+
throw new TypeError("Reporting adapter executor must expose exactly one offering with its declared ID");
|
|
59
|
+
}
|
|
60
|
+
const routedOffering = routed[0];
|
|
61
|
+
if ((0, import_jcs.canonicalize)(routedOffering.contract) !== (0, import_jcs.canonicalize)(sourceOffering.contract)) {
|
|
62
|
+
throw new TypeError("Reporting adapter executor offering contract differs from its declared source offering");
|
|
63
|
+
}
|
|
64
|
+
validateDeliveryOffering(routedOffering, deliveryOffering);
|
|
65
|
+
sources.set(adapterId, source);
|
|
66
|
+
adapterOfferings.set(adapterId, routedOffering);
|
|
67
|
+
offerings.set(routedOffering.offeringId, routedOffering);
|
|
68
|
+
deliveryOfferings.push(deliveryOffering);
|
|
69
|
+
}
|
|
70
|
+
const routedSource = createRoutedSource(sources, offerings);
|
|
71
|
+
const producer = (0, import_ledger.createReportingProducer)({
|
|
72
|
+
store: options.store,
|
|
73
|
+
source: routedSource,
|
|
74
|
+
offerings: [...offerings.values()],
|
|
75
|
+
contact: options.contact,
|
|
76
|
+
...options.subscribers ? { subscribers: options.subscribers } : {}
|
|
77
|
+
});
|
|
78
|
+
const hasConsumerStatus = options.resolveConsumerId !== void 0;
|
|
79
|
+
if (options.consumerMismatchEscalation && !hasConsumerStatus) {
|
|
80
|
+
throw new TypeError("consumerMismatchEscalation requires resolveConsumerId");
|
|
81
|
+
}
|
|
82
|
+
const effectiveConsumerMismatchEscalation = (0, import_ledger.assertReportingConsumerMismatchEscalation)(
|
|
83
|
+
(0, import_ledger.reportingEffectiveConsumerMismatchEscalationV1)(
|
|
84
|
+
options.consumerMismatchEscalation,
|
|
85
|
+
options.store,
|
|
86
|
+
"createReliableReportingService"
|
|
87
|
+
)
|
|
88
|
+
);
|
|
89
|
+
const advertisedConsumerMismatchEscalation = hasConsumerStatus ? effectiveConsumerMismatchEscalation : void 0;
|
|
90
|
+
if (hasConsumerStatus) assertConsumerStatusStore(options.store);
|
|
91
|
+
const retentionDays = options.statusRetentionDays;
|
|
92
|
+
positiveInteger(retentionDays, "statusRetentionDays");
|
|
93
|
+
const capabilities = deepFreeze({
|
|
94
|
+
supported: true,
|
|
95
|
+
reliable_reporting_version: "1.0",
|
|
96
|
+
configuration_task: "sync_accounts",
|
|
97
|
+
status_task: "get_reporting_status",
|
|
98
|
+
...hasConsumerStatus ? { consumer_status_task: "sync_reporting_status" } : {},
|
|
99
|
+
revision_content_task: "get_media_buy_delivery",
|
|
100
|
+
offerings: deliveryOfferings,
|
|
101
|
+
automated_recovery_window_seconds: options.automatedRecoveryWindowSeconds,
|
|
102
|
+
status_retention_days: retentionDays,
|
|
103
|
+
...advertisedConsumerMismatchEscalation ? (0, import_ledger.reportingConsumerStatusCapabilityV1)(advertisedConsumerMismatchEscalation) : {}
|
|
104
|
+
});
|
|
105
|
+
const getReportingStatus = options.resolveConsumerId ? (0, import_ledger.createReportingStatusHandler)(options.store, {
|
|
106
|
+
resolveConsumerId: options.resolveConsumerId,
|
|
107
|
+
...effectiveConsumerMismatchEscalation ? { consumerMismatchEscalation: effectiveConsumerMismatchEscalation } : {}
|
|
108
|
+
}) : (0, import_ledger.createReportingStatusHandler)(options.store);
|
|
109
|
+
const getMediaBuyDelivery = (0, import_ledger.createReportingDeliveryHandler)(options.store);
|
|
110
|
+
const syncReportingStatus = options.resolveConsumerId ? (0, import_ledger.createSyncReportingStatusHandler)(options.store, {
|
|
111
|
+
resolveConsumerId: options.resolveConsumerId
|
|
112
|
+
}) : void 0;
|
|
113
|
+
const reportingPlatform = {
|
|
114
|
+
capabilities,
|
|
115
|
+
getReportingStatus: (request, context) => getReportingStatus(request, context),
|
|
116
|
+
getMediaBuyDelivery: (request, context) => getMediaBuyDelivery(request, context),
|
|
117
|
+
...syncReportingStatus && {
|
|
118
|
+
syncReportingStatus: (request, context) => syncReportingStatus(request, context),
|
|
119
|
+
// Published so `createAdcpServerFromPlatform` can scope replay by the
|
|
120
|
+
// identity the receipt is actually recorded under, rather than by the
|
|
121
|
+
// caller's credential.
|
|
122
|
+
resolveConsumerId: options.resolveConsumerId
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
let schedulerAbort;
|
|
126
|
+
let schedulerPromise;
|
|
127
|
+
const service = {
|
|
128
|
+
setup: Object.freeze({
|
|
129
|
+
component: "reliable-reporting-core",
|
|
130
|
+
migrations: Object.freeze([import_ledger.REPORTING_LEDGER_MIGRATION]),
|
|
131
|
+
requiresIsolatedLedgerDatabaseAcknowledgement: true
|
|
132
|
+
}),
|
|
133
|
+
capabilities,
|
|
134
|
+
producer,
|
|
135
|
+
platform: reportingPlatform,
|
|
136
|
+
get running() {
|
|
137
|
+
return schedulerPromise !== void 0;
|
|
138
|
+
},
|
|
139
|
+
async installConfiguration(configuration, context) {
|
|
140
|
+
if (!context?.account?.id) throw new TypeError("Reporting configuration requires a framework-resolved account");
|
|
141
|
+
assertNoUntrustedLineageFields(configuration);
|
|
142
|
+
if (Object.prototype.hasOwnProperty.call(configuration.sourceSettings, "currency")) {
|
|
143
|
+
throw new TypeError("Reporting configuration must not supply trusted lineage field sourceSettings.currency");
|
|
144
|
+
}
|
|
145
|
+
const frozenInput = structuredClone(configuration);
|
|
146
|
+
const offering = offerings.get(configuration.offeringId);
|
|
147
|
+
if (!offering) throw new TypeError("Reporting configuration selected an unknown offering");
|
|
148
|
+
const deliveryOffering = deliveryOfferings.find((value) => value.offering_id === offering.offeringId);
|
|
149
|
+
validateConfigurationAgainstDeliveryOffering(
|
|
150
|
+
frozenInput,
|
|
151
|
+
deliveryOffering,
|
|
152
|
+
options.automatedRecoveryWindowSeconds
|
|
153
|
+
);
|
|
154
|
+
const [route, currency, coverage] = await Promise.all([
|
|
155
|
+
options.resolveSource(context.account, frozenInput),
|
|
156
|
+
options.resolveCurrency(context.account, frozenInput),
|
|
157
|
+
options.resolveCoverage(context.account, frozenInput)
|
|
158
|
+
]);
|
|
159
|
+
if (!route || typeof route !== "object" || !route.sourceScope || typeof route.sourceScope !== "object") {
|
|
160
|
+
throw new TypeError("resolveSource must return an adapter, sourceScope, and sourceTimezone");
|
|
161
|
+
}
|
|
162
|
+
const source = sources.get(route.adapterId);
|
|
163
|
+
const adapterOffering = adapterOfferings.get(route.adapterId);
|
|
164
|
+
if (!source || !adapterOffering) throw new TypeError("resolveSource selected an unknown reporting adapter");
|
|
165
|
+
if (adapterOffering.offeringId !== offering.offeringId) {
|
|
166
|
+
throw new TypeError("Resolved reporting adapter does not provide the selected offering");
|
|
167
|
+
}
|
|
168
|
+
if ((0, import_jcs.canonicalize)(adapterOffering.contract) !== (0, import_jcs.canonicalize)(offering.contract)) {
|
|
169
|
+
throw new TypeError("Resolved reporting adapter contract differs from the selected offering");
|
|
170
|
+
}
|
|
171
|
+
const normalizedCurrency = trustedCurrency(currency);
|
|
172
|
+
const normalizedTimezone = trustedTimezone(route.sourceTimezone);
|
|
173
|
+
if (configuration.expectedCurrency !== void 0 && configuration.expectedCurrency !== normalizedCurrency) {
|
|
174
|
+
throw new TypeError("Trusted reporting currency conflicts with the configuration currency assertion");
|
|
175
|
+
}
|
|
176
|
+
if (configuration.expectedSourceTimezone !== void 0 && configuration.expectedSourceTimezone !== normalizedTimezone) {
|
|
177
|
+
throw new TypeError("Trusted reporting timezone conflicts with the configuration timezone assertion");
|
|
178
|
+
}
|
|
179
|
+
assertSupportedScheduleSemantics(frozenInput.schedule, deliveryOffering, normalizedTimezone);
|
|
180
|
+
const { constituents, mediaBuyIds } = trustedCoverage(coverage, frozenInput.requestedMetrics);
|
|
181
|
+
if (configuration.expectedMediaBuyIds !== void 0 && !sameIdMembers(configuration.expectedMediaBuyIds, mediaBuyIds)) {
|
|
182
|
+
throw new TypeError("Trusted reporting coverage conflicts with the configuration media-buy assertion");
|
|
183
|
+
}
|
|
184
|
+
if (Object.prototype.hasOwnProperty.call(route.sourceScope, ADAPTER_SCOPE_KEY)) {
|
|
185
|
+
throw new TypeError("Reporting sourceScope contains an SDK-reserved key");
|
|
186
|
+
}
|
|
187
|
+
const credentialPaths = (0, import_credential_policy.scanArgsForCredentials)(route.sourceScope);
|
|
188
|
+
if (credentialPaths.length > 0 || containsContextMetadata(route.sourceScope)) {
|
|
189
|
+
throw new TypeError("Reporting sourceScope must contain non-secret routing identifiers only");
|
|
190
|
+
}
|
|
191
|
+
const routedScope = import_source.ReportingSourceScopeV1Schema.parse({
|
|
192
|
+
...structuredClone(route.sourceScope),
|
|
193
|
+
[ADAPTER_SCOPE_KEY]: route.adapterId
|
|
194
|
+
});
|
|
195
|
+
const predecessor = await predecessorGeneration(options.store, context.account.id, frozenInput);
|
|
196
|
+
const sourceScope = keylessPredecessorScope(predecessor, route.sourceScope, sources.size) ?? routedScope;
|
|
197
|
+
const scheduleIdentity = predecessor && predecessor.schedule.alignment === void 0 ? {} : {
|
|
198
|
+
periodDuration: deliveryOffering.schedule.period_duration,
|
|
199
|
+
deliverySlaDuration: deliveryOffering.schedule.delivery_sla,
|
|
200
|
+
alignment: deliveryOffering.schedule.alignment,
|
|
201
|
+
...deliveryOffering.schedule.alignment === "utc" ? {} : { periodTimezone: normalizedTimezone }
|
|
202
|
+
};
|
|
203
|
+
const {
|
|
204
|
+
expectedCurrency: _currency,
|
|
205
|
+
expectedSourceTimezone: _timezone,
|
|
206
|
+
expectedMediaBuyIds: _mediaBuyIds,
|
|
207
|
+
sourceSettings,
|
|
208
|
+
...ledgerInput
|
|
209
|
+
} = frozenInput;
|
|
210
|
+
void _currency;
|
|
211
|
+
void _timezone;
|
|
212
|
+
void _mediaBuyIds;
|
|
213
|
+
return producer.installConfiguration({
|
|
214
|
+
...ledgerInput,
|
|
215
|
+
schedule: { ...ledgerInput.schedule, ...scheduleIdentity },
|
|
216
|
+
account: { account_id: context.account.id },
|
|
217
|
+
sourceScope,
|
|
218
|
+
sourceTimezone: normalizedTimezone,
|
|
219
|
+
sourceSettings: { ...sourceSettings, currency: normalizedCurrency },
|
|
220
|
+
contract: structuredClone(offering.contract),
|
|
221
|
+
constituents,
|
|
222
|
+
mediaBuyIds
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
226
|
+
install(platform) {
|
|
227
|
+
if (typeof platform.accounts.upsert !== "function") {
|
|
228
|
+
throw new TypeError(
|
|
229
|
+
"Reliable reporting requires accounts.upsert so the advertised sync_accounts configuration task is installed"
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
if (platform.reporting && platform.reporting !== reportingPlatform) {
|
|
233
|
+
throw new TypeError("DecisioningPlatform already has a reporting lifecycle installed");
|
|
234
|
+
}
|
|
235
|
+
if (!platform.reporting) {
|
|
236
|
+
Object.defineProperty(platform, "reporting", {
|
|
237
|
+
value: reportingPlatform,
|
|
238
|
+
enumerable: true,
|
|
239
|
+
configurable: false,
|
|
240
|
+
writable: false
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return platform;
|
|
244
|
+
},
|
|
245
|
+
async runCycle(cycle) {
|
|
246
|
+
const accountId = cycleAccountId(cycle);
|
|
247
|
+
const planningNow = cycle.now ?? /* @__PURE__ */ new Date();
|
|
248
|
+
cycle.signal?.throwIfAborted();
|
|
249
|
+
const planned = await producer.planObligations(planningNow.toISOString(), {
|
|
250
|
+
...accountId !== void 0 ? { account_id: accountId } : {},
|
|
251
|
+
...cycle.maxObligations !== void 0 ? { maxObligations: cycle.maxObligations } : {}
|
|
252
|
+
});
|
|
253
|
+
cycle.signal?.throwIfAborted();
|
|
254
|
+
const result = await producer.runWorker({
|
|
255
|
+
...cycle.signal ? { signal: cycle.signal } : {},
|
|
256
|
+
...cycle.now ? { now: () => cycle.now } : {},
|
|
257
|
+
...accountId !== void 0 ? { account_id: accountId } : {},
|
|
258
|
+
...cycle.maxWorkerIterations !== void 0 ? { maxIterations: cycle.maxWorkerIterations } : {},
|
|
259
|
+
...cycle.retryDelayMilliseconds !== void 0 ? { retryDelayMilliseconds: cycle.retryDelayMilliseconds } : {},
|
|
260
|
+
...cycle.executionDeadlineMilliseconds !== void 0 ? { executionDeadlineMilliseconds: cycle.executionDeadlineMilliseconds } : {},
|
|
261
|
+
...cycle.settlementGraceMilliseconds !== void 0 ? { settlementGraceMilliseconds: cycle.settlementGraceMilliseconds } : {}
|
|
262
|
+
});
|
|
263
|
+
return { planned: planned.length, ...result };
|
|
264
|
+
},
|
|
265
|
+
start(scheduler) {
|
|
266
|
+
if (schedulerPromise) throw new Error("Reliable reporting scheduler is already running");
|
|
267
|
+
positiveInteger(scheduler.intervalMilliseconds, "intervalMilliseconds");
|
|
268
|
+
schedulerAbort = new AbortController();
|
|
269
|
+
const signal = schedulerAbort.signal;
|
|
270
|
+
schedulerPromise = schedulerLoop(service, scheduler, signal, options.store).finally(() => {
|
|
271
|
+
schedulerPromise = void 0;
|
|
272
|
+
schedulerAbort = void 0;
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
async stop() {
|
|
276
|
+
const running = schedulerPromise;
|
|
277
|
+
schedulerAbort?.abort();
|
|
278
|
+
if (running) await running;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
return service;
|
|
282
|
+
}
|
|
283
|
+
function createRoutedSource(sources, offerings) {
|
|
284
|
+
const capabilities = (0, import_source.reportingSourceCapabilitiesV1)([...offerings.values()], "reliable-reporting-service-v1");
|
|
285
|
+
return {
|
|
286
|
+
capabilities,
|
|
287
|
+
execute(request, context) {
|
|
288
|
+
return routeSource(sources, request.sourceScope).execute(request, context);
|
|
289
|
+
},
|
|
290
|
+
read(input) {
|
|
291
|
+
return routeSource(sources, input.sourceScope).read(input);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
function routeSource(sources, sourceScope) {
|
|
296
|
+
const adapterId = sourceScope[ADAPTER_SCOPE_KEY];
|
|
297
|
+
const source = typeof adapterId === "string" ? sources.get(adapterId) : sources.size === 1 ? sources.values().next().value : void 0;
|
|
298
|
+
if (!source) throw new TypeError("Reporting sourceScope has no installed adapter route");
|
|
299
|
+
return source;
|
|
300
|
+
}
|
|
301
|
+
async function schedulerLoop(service, options, signal, store) {
|
|
302
|
+
let rotation = 0;
|
|
303
|
+
while (!signal.aborted) {
|
|
304
|
+
let accountIds = [];
|
|
305
|
+
try {
|
|
306
|
+
accountIds = options.deploymentWide ? (
|
|
307
|
+
// A single deployment-wide sweep shares one budget across every
|
|
308
|
+
// tenant, so whichever account the ledger returns first can consume
|
|
309
|
+
// it — the producer's own default cap starves the rest just as an
|
|
310
|
+
// explicit per-account cap would. Enumerate the roster so each tenant
|
|
311
|
+
// gets its own bounded cycle, and rotate the starting point each pass.
|
|
312
|
+
rotate(await deploymentWideAccountIds(store), rotation)
|
|
313
|
+
) : rotate(
|
|
314
|
+
validateAccountIds(
|
|
315
|
+
typeof options.accountIds === "function" ? await options.accountIds() : options.accountIds
|
|
316
|
+
),
|
|
317
|
+
rotation
|
|
318
|
+
);
|
|
319
|
+
} catch (error) {
|
|
320
|
+
await reportSchedulerError(options, signal, error, { phase: "roster" });
|
|
321
|
+
}
|
|
322
|
+
rotation += 1;
|
|
323
|
+
for (const accountId of accountIds) {
|
|
324
|
+
if (signal.aborted) break;
|
|
325
|
+
try {
|
|
326
|
+
await service.runCycle({
|
|
327
|
+
...accountId === void 0 ? { deploymentWide: true } : { accountId },
|
|
328
|
+
signal,
|
|
329
|
+
...options.maxObligationsPerAccount !== void 0 ? { maxObligations: options.maxObligationsPerAccount } : {},
|
|
330
|
+
...options.maxWorkerIterationsPerAccount !== void 0 ? { maxWorkerIterations: options.maxWorkerIterationsPerAccount } : {},
|
|
331
|
+
...options.retryDelayMilliseconds !== void 0 ? { retryDelayMilliseconds: options.retryDelayMilliseconds } : {},
|
|
332
|
+
...options.executionDeadlineMilliseconds !== void 0 ? { executionDeadlineMilliseconds: options.executionDeadlineMilliseconds } : {},
|
|
333
|
+
...options.settlementGraceMilliseconds !== void 0 ? { settlementGraceMilliseconds: options.settlementGraceMilliseconds } : {}
|
|
334
|
+
});
|
|
335
|
+
} catch (error) {
|
|
336
|
+
await reportSchedulerError(options, signal, error, { phase: "cycle", accountId });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
if (!signal.aborted) await abortableDelay(options.intervalMilliseconds, signal);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
async function reportSchedulerError(options, signal, error, site) {
|
|
343
|
+
if (signal.aborted) return;
|
|
344
|
+
if (options.onError) {
|
|
345
|
+
try {
|
|
346
|
+
await options.onError(error);
|
|
347
|
+
} catch (observerError) {
|
|
348
|
+
warnSchedulerFailure(options, site, error, observerError);
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
warnSchedulerFailure(options, site, error);
|
|
353
|
+
}
|
|
354
|
+
function warnSchedulerFailure(options, site, error, observerError) {
|
|
355
|
+
const where = site.phase === "roster" ? "could not resolve its account roster, so this pass ran no tenants" : site.accountId === void 0 ? "deployment-wide cycle failed; the scheduler continues" : `cycle failed for account ${site.accountId}; later tenants continue`;
|
|
356
|
+
const observed = observerError === void 0 ? "" : ` (the configured onError also threw: ${safeMessage(observerError)})`;
|
|
357
|
+
const message = `[adcp/reporting] scheduler ${where}: ${safeMessage(error)}${observed}`;
|
|
358
|
+
const logger = options.logger;
|
|
359
|
+
try {
|
|
360
|
+
if (logger !== void 0) logger.warn(message);
|
|
361
|
+
else defaultSchedulerWarn(message);
|
|
362
|
+
} catch {
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function defaultSchedulerWarn(message) {
|
|
366
|
+
console.warn(message);
|
|
367
|
+
}
|
|
368
|
+
const MAX_SCHEDULER_MESSAGE_CHARS = 512;
|
|
369
|
+
const MAX_SCHEDULER_SCAN_CHARS = 8192;
|
|
370
|
+
const UNREPORTABLE_SCHEDULER_ERROR = "<unreportable error>";
|
|
371
|
+
function safeMessage(error) {
|
|
372
|
+
try {
|
|
373
|
+
const raw = rawMessage(error);
|
|
374
|
+
const redacted = (0, import_redact_credential_patterns.redactCredentialPatterns)(raw.slice(0, MAX_SCHEDULER_SCAN_CHARS));
|
|
375
|
+
const text = typeof redacted === "string" && redacted.length > 0 ? redacted : UNREPORTABLE_SCHEDULER_ERROR;
|
|
376
|
+
return text.length > MAX_SCHEDULER_MESSAGE_CHARS ? `${text.slice(0, MAX_SCHEDULER_MESSAGE_CHARS)}\u2026` : text;
|
|
377
|
+
} catch {
|
|
378
|
+
return UNREPORTABLE_SCHEDULER_ERROR;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function rawMessage(error) {
|
|
382
|
+
switch (typeof error) {
|
|
383
|
+
case "string":
|
|
384
|
+
return error;
|
|
385
|
+
case "number":
|
|
386
|
+
case "boolean":
|
|
387
|
+
case "bigint":
|
|
388
|
+
return String(error);
|
|
389
|
+
case "undefined":
|
|
390
|
+
return "undefined";
|
|
391
|
+
case "symbol":
|
|
392
|
+
return error.description ?? "symbol";
|
|
393
|
+
default:
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
if (error === null) return "null";
|
|
397
|
+
const message = error.message;
|
|
398
|
+
return typeof message === "string" ? message : "non-Error scheduler failure";
|
|
399
|
+
}
|
|
400
|
+
const MAX_TIMER_DELAY_MILLISECONDS = 2147483647;
|
|
401
|
+
async function abortableDelay(milliseconds, signal) {
|
|
402
|
+
let remaining = milliseconds;
|
|
403
|
+
while (remaining > 0 && !signal.aborted) {
|
|
404
|
+
const chunk = Math.min(remaining, MAX_TIMER_DELAY_MILLISECONDS);
|
|
405
|
+
await abortableTimeout(chunk, signal);
|
|
406
|
+
remaining -= chunk;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function abortableTimeout(milliseconds, signal) {
|
|
410
|
+
return new Promise((resolve) => {
|
|
411
|
+
const timer = setTimeout(done, milliseconds);
|
|
412
|
+
function done() {
|
|
413
|
+
clearTimeout(timer);
|
|
414
|
+
signal.removeEventListener("abort", done);
|
|
415
|
+
resolve();
|
|
416
|
+
}
|
|
417
|
+
signal.addEventListener("abort", done, { once: true });
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function rotate(values, by) {
|
|
421
|
+
if (values.length < 2) return [...values];
|
|
422
|
+
const offset = (by % values.length + values.length) % values.length;
|
|
423
|
+
return [...values.slice(offset), ...values.slice(0, offset)];
|
|
424
|
+
}
|
|
425
|
+
async function deploymentWideAccountIds(store) {
|
|
426
|
+
const configurations = await store.listConfigurations();
|
|
427
|
+
return [...new Set(configurations.map((value) => value.account.account_id))].sort();
|
|
428
|
+
}
|
|
429
|
+
function validateAccountIds(values) {
|
|
430
|
+
if (!Array.isArray(values)) {
|
|
431
|
+
throw new TypeError("Reporting scheduler accountIds resolver must return an array");
|
|
432
|
+
}
|
|
433
|
+
const unique = /* @__PURE__ */ new Set();
|
|
434
|
+
for (const value of values) {
|
|
435
|
+
if (typeof value !== "string" || value.length === 0 || value.length > 255) {
|
|
436
|
+
throw new TypeError("Reporting scheduler accountIds must contain bounded non-empty strings");
|
|
437
|
+
}
|
|
438
|
+
unique.add(value);
|
|
439
|
+
}
|
|
440
|
+
return [...unique];
|
|
441
|
+
}
|
|
442
|
+
function cycleAccountId(cycle) {
|
|
443
|
+
const requested = cycle.accountId;
|
|
444
|
+
if (cycle.deploymentWide === true) {
|
|
445
|
+
if (requested !== void 0) {
|
|
446
|
+
throw new TypeError("Reliable reporting cycles cannot combine deploymentWide with an accountId");
|
|
447
|
+
}
|
|
448
|
+
return void 0;
|
|
449
|
+
}
|
|
450
|
+
if (typeof requested !== "string" || requested.length === 0 || requested.length > 255) {
|
|
451
|
+
throw new TypeError("Reliable reporting cycles require deploymentWide: true or a bounded non-empty accountId");
|
|
452
|
+
}
|
|
453
|
+
return requested;
|
|
454
|
+
}
|
|
455
|
+
async function predecessorGeneration(store, accountId, configuration) {
|
|
456
|
+
return (await store.listConfigurations(accountId)).find(
|
|
457
|
+
(value) => value.delivery_config_id === configuration.delivery_config_id && value.delivery_config_version === configuration.delivery_config_version
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
function keylessPredecessorScope(predecessor, resolvedScope, adapterCount) {
|
|
461
|
+
if (!predecessor || Object.prototype.hasOwnProperty.call(predecessor.sourceScope, ADAPTER_SCOPE_KEY)) {
|
|
462
|
+
return void 0;
|
|
463
|
+
}
|
|
464
|
+
if (adapterCount > 1) {
|
|
465
|
+
throw new TypeError(
|
|
466
|
+
"Reporting configuration generation predates the adapter route key and cannot be routed with multiple adapters installed; install a new generation with an explicit adapter route"
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
if ((0, import_jcs.canonicalize)(predecessor.sourceScope) !== (0, import_jcs.canonicalize)(resolvedScope)) return void 0;
|
|
470
|
+
return structuredClone(predecessor.sourceScope);
|
|
471
|
+
}
|
|
472
|
+
function validateDeliveryOffering(source, delivery) {
|
|
473
|
+
if (delivery.offering_id !== source.offeringId) throw new TypeError("Source and delivery offering IDs differ");
|
|
474
|
+
if (delivery.report_definition_id !== source.contract.report_definition_id) {
|
|
475
|
+
throw new TypeError("Source and delivery report definitions differ");
|
|
476
|
+
}
|
|
477
|
+
if (delivery.report_definition_uri !== source.contract.reportDefinitionUri || delivery.report_definition_sha256 !== source.contract.reportDefinitionSha256 || delivery.reporting_profile.id !== source.contract.reportingProfile || delivery.reporting_profile.version !== source.contract.schemaVersion || delivery.reporting_profile.schema_uri !== source.contract.schemaUri || delivery.reporting_profile.schema_sha256 !== source.contract.schemaSha256 || delivery.reporting_profile.schema_dialect !== source.contract.schemaDialect || delivery.reporting_profile.schema_ref_policy !== source.contract.schemaRefPolicy) {
|
|
478
|
+
throw new TypeError("Delivery offering does not describe the source contract");
|
|
479
|
+
}
|
|
480
|
+
if (delivery.method !== void 0 || delivery.reconciliation_mode !== "delivery_only" || delivery.feed_purpose === "billing") {
|
|
481
|
+
throw new TypeError("ReliableReportingService currently installs Core API delivery only");
|
|
482
|
+
}
|
|
483
|
+
if (delivery.schedule.alignment !== "utc" && delivery.schedule.alignment !== "source_timezone") {
|
|
484
|
+
throw new TypeError(
|
|
485
|
+
`ReliableReportingService cannot honor '${delivery.schedule.alignment}' period alignment; it generates fixed-length periods from the utc and source_timezone origins`
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
assertOfferingScheduleShape(delivery);
|
|
489
|
+
const advertisedSla = parseAdvertisedDuration(delivery.schedule.delivery_sla, "delivery_sla");
|
|
490
|
+
parseAdvertisedDuration(delivery.schedule.period_duration, "period_duration");
|
|
491
|
+
if (delivery.supported_finality.includes("official") && source.publicationClass !== "AUTHORITATIVE") {
|
|
492
|
+
throw new TypeError("Official delivery finality requires an authoritative source offering");
|
|
493
|
+
}
|
|
494
|
+
if (source.publicationClass === "AUTHORITATIVE" && delivery.supported_finality.includes("snapshot")) {
|
|
495
|
+
throw new TypeError(
|
|
496
|
+
"Authoritative source offerings cannot advertise snapshot delivery finality; the ledger installs them as official only"
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
if (delivery.supported_finality.includes("official") && source.publicationClass === "AUTHORITATIVE") {
|
|
500
|
+
const { finalization } = source;
|
|
501
|
+
const readyOffset = finalization.schedule.daysAfterPeriodEnd * 864e5 + localTimeOfDayMilliseconds(finalization.schedule.sourceLocalReadyTime);
|
|
502
|
+
const earliest = readyOffset + (0, import_source.reportingIsoDurationMillisecondsV1)(finalization.worstCaseAvailabilityLag);
|
|
503
|
+
if (advertisedSla < earliest) {
|
|
504
|
+
throw new TypeError(
|
|
505
|
+
"Official reporting delivery SLA is shorter than the source can finalize and publish; the advertised deadline is unreachable for every period"
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (source.publicationClass === "PROVISIONAL_SNAPSHOT") {
|
|
510
|
+
const worstCase = (0, import_source.reportingIsoDurationMillisecondsV1)(source.cadence.worstCaseAvailabilityLag);
|
|
511
|
+
if (advertisedSla < worstCase) {
|
|
512
|
+
throw new TypeError(
|
|
513
|
+
"Snapshot reporting delivery SLA is shorter than the source worst-case availability lag; the advertised deadline is unreachable for every period"
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
const pinnedTimezone = delivery.schedule.period_timezone_policy === "fixed" ? delivery.schedule.period_timezone : source.sourceTimezone.ianaTimezone;
|
|
518
|
+
if (pinnedTimezone) {
|
|
519
|
+
const now = Date.now();
|
|
520
|
+
if (delivery.schedule.alignment === "utc" && (0, import_source.reportingUtcOffsetMinutesV1)(pinnedTimezone, now) !== 0) {
|
|
521
|
+
throw new TypeError("UTC-aligned reporting requires a source timezone whose UTC offset is zero");
|
|
522
|
+
}
|
|
523
|
+
const originMs = (0, import_source.reportingScheduleOriginV1)(
|
|
524
|
+
delivery.schedule.alignment === "utc" ? "utc" : "source_timezone",
|
|
525
|
+
pinnedTimezone
|
|
526
|
+
);
|
|
527
|
+
if ((0, import_source.reportingUtcOffsetMinutesV1)(pinnedTimezone, originMs) !== (0, import_source.reportingUtcOffsetMinutesV1)(pinnedTimezone, now)) {
|
|
528
|
+
throw new TypeError(
|
|
529
|
+
"Reporting source timezone no longer observes its schedule-origin offset; no anchor derived from the protocol origin can land on source-local midnight"
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
assertConstantUtcOffset(
|
|
533
|
+
pinnedTimezone,
|
|
534
|
+
now - OFFSET_BACKWARD_HORIZON_DAYS * DAY_MILLISECONDS,
|
|
535
|
+
now + OFFSET_FORWARD_HORIZON_DAYS * DAY_MILLISECONDS
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
const period = (0, import_source.reportingIsoDurationMillisecondsV1)(delivery.schedule.period_duration);
|
|
539
|
+
const min = (0, import_source.reportingIsoDurationMillisecondsV1)(source.windowing.minimumWindow);
|
|
540
|
+
const max = (0, import_source.reportingIsoDurationMillisecondsV1)(source.windowing.maximumWindow);
|
|
541
|
+
if (period < min || period > max) throw new TypeError("Delivery schedule is outside source window bounds");
|
|
542
|
+
if (period % 864e5 !== 0) {
|
|
543
|
+
throw new TypeError(
|
|
544
|
+
`Delivery schedule period '${delivery.schedule.period_duration}' is not a whole number of source-local days; the service generates period boundaries only on source-local midnight`
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
const executorCeiling = source.sourceExecution.maximumWindowDaysPerRequest * 864e5;
|
|
548
|
+
if (period > executorCeiling) {
|
|
549
|
+
throw new TypeError(
|
|
550
|
+
"Delivery schedule period exceeds the source executor maximumWindowDaysPerRequest; no single request could cover one period"
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
if (delivery.reporting_profile.primary_keys.length === 0) {
|
|
554
|
+
throw new TypeError("Delivery offering requires at least one reporting primary key");
|
|
555
|
+
}
|
|
556
|
+
if (delivery.reporting_profile.grain !== source.grain) {
|
|
557
|
+
throw new TypeError("Delivery offering grain does not match its source offering grain");
|
|
558
|
+
}
|
|
559
|
+
if (delivery.schedule.period_timezone_policy === "fixed" && source.sourceTimezone.ianaTimezone !== void 0 && delivery.schedule.period_timezone !== source.sourceTimezone.ianaTimezone) {
|
|
560
|
+
throw new TypeError("Delivery offering pins a period timezone its source offering does not declare");
|
|
561
|
+
}
|
|
562
|
+
if (delivery.supported_finality.length === 0) {
|
|
563
|
+
throw new TypeError("Delivery offering must advertise at least one supported finality");
|
|
564
|
+
}
|
|
565
|
+
if (new Set(delivery.supported_finality).size !== delivery.supported_finality.length) {
|
|
566
|
+
throw new TypeError("Delivery offering supported finality values must be unique");
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
function validateConfigurationAgainstDeliveryOffering(configuration, offering, automatedRecoveryWindowSeconds) {
|
|
570
|
+
if (configuration.feedPurpose !== offering.feed_purpose || configuration.report_definition_id !== offering.report_definition_id) {
|
|
571
|
+
throw new TypeError("Reporting configuration does not match its delivery offering");
|
|
572
|
+
}
|
|
573
|
+
if (!offering.supported_finality.includes(configuration.requiredFinality)) {
|
|
574
|
+
throw new TypeError("Reporting configuration finality is not supported by its delivery offering");
|
|
575
|
+
}
|
|
576
|
+
if (configuration.schedule.periodMilliseconds !== (0, import_source.reportingIsoDurationMillisecondsV1)(offering.schedule.period_duration) || configuration.schedule.deliverySlaMilliseconds !== (0, import_source.reportingIsoDurationMillisecondsV1)(offering.schedule.delivery_sla)) {
|
|
577
|
+
throw new TypeError("Reporting configuration schedule does not match its delivery offering");
|
|
578
|
+
}
|
|
579
|
+
if (configuration.schedule.officialAfterMilliseconds !== void 0 && configuration.schedule.officialAfterMilliseconds !== configuration.schedule.deliverySlaMilliseconds) {
|
|
580
|
+
throw new TypeError("Reporting official deadline must equal the advertised delivery SLA of its offering");
|
|
581
|
+
}
|
|
582
|
+
if (configuration.schedule.recoveryWindowMilliseconds !== automatedRecoveryWindowSeconds * 1e3) {
|
|
583
|
+
throw new TypeError(
|
|
584
|
+
"Reporting configuration recovery window must equal the advertised automated recovery window; the advertised value is what buyer-facing deadlines are measured against"
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
function trustedCoverage(coverage, requestedMetrics) {
|
|
589
|
+
if (!coverage || typeof coverage !== "object" || !Array.isArray(coverage.constituents)) {
|
|
590
|
+
throw new TypeError("resolveCoverage must return an authorized constituent denominator");
|
|
591
|
+
}
|
|
592
|
+
const constituents = import_source.ReportingCoverageConstituentIdentityV1Schema.array().min(1).max(import_source.SOURCE_BATCH_MANIFEST_MAX_METRIC_AVAILABILITY_V1).parse(structuredClone(coverage.constituents));
|
|
593
|
+
if (constituents.length * requestedMetrics.length > import_source.SOURCE_BATCH_MANIFEST_MAX_METRIC_AVAILABILITY_V1) {
|
|
594
|
+
throw new TypeError(
|
|
595
|
+
"Reporting coverage exceeds the per-slice metric availability bound; reduce constituents or metrics"
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
const constituentIds = new Set(constituents.map((value) => value.constituentId));
|
|
599
|
+
if (constituentIds.size !== constituents.length) {
|
|
600
|
+
throw new TypeError("resolveCoverage must return unique constituent identities");
|
|
601
|
+
}
|
|
602
|
+
for (const constituent of constituents) {
|
|
603
|
+
const binding = constituent.productBinding;
|
|
604
|
+
if (!binding) continue;
|
|
605
|
+
if (binding.productId !== constituent.productId) {
|
|
606
|
+
throw new TypeError("resolveCoverage constituent productId contradicts its product binding");
|
|
607
|
+
}
|
|
608
|
+
if (constituent.constituentKind === "media_buy" && binding.mediaBuyId !== constituent.mediaBuyId) {
|
|
609
|
+
throw new TypeError("resolveCoverage constituent mediaBuyId contradicts its product binding");
|
|
610
|
+
}
|
|
611
|
+
if (constituent.constituentKind === "package_item" && binding.packageId !== constituent.packageId) {
|
|
612
|
+
throw new TypeError("resolveCoverage constituent packageId contradicts its product binding");
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
const mediaBuyIds = [
|
|
616
|
+
...new Set(constituents.map((value) => value.mediaBuyId).filter((value) => Boolean(value)))
|
|
617
|
+
].sort();
|
|
618
|
+
return { constituents, mediaBuyIds };
|
|
619
|
+
}
|
|
620
|
+
function sameIdMembers(left, right) {
|
|
621
|
+
if (!Array.isArray(left)) throw new TypeError("expectedMediaBuyIds must be an array of media buy IDs");
|
|
622
|
+
const expected = new Set(left);
|
|
623
|
+
return expected.size === right.length && right.every((value) => expected.has(value));
|
|
624
|
+
}
|
|
625
|
+
const DAY_MILLISECONDS = 864e5;
|
|
626
|
+
const OFFSET_PROBE_STEP_DAYS = 10;
|
|
627
|
+
const OFFSET_BACKWARD_HORIZON_DAYS = 400;
|
|
628
|
+
const OFFSET_FORWARD_HORIZON_DAYS = 400;
|
|
629
|
+
function assertSupportedScheduleSemantics(schedule, offering, sourceTimezone) {
|
|
630
|
+
const { alignment } = offering.schedule;
|
|
631
|
+
if (alignment !== "utc" && alignment !== "source_timezone") {
|
|
632
|
+
throw new TypeError(
|
|
633
|
+
`ReliableReportingService cannot honor '${alignment}' period alignment; it generates fixed-length periods from the utc and source_timezone origins`
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
if (offering.schedule.period_timezone_policy === "fixed" && offering.schedule.period_timezone !== sourceTimezone) {
|
|
637
|
+
throw new TypeError("Reporting offering pins a period timezone that is not the resolved source timezone");
|
|
638
|
+
}
|
|
639
|
+
if (schedule.periodMilliseconds % DAY_MILLISECONDS !== 0) {
|
|
640
|
+
throw new TypeError(
|
|
641
|
+
"Reporting periods must be whole source-local days; a sub-day window has no source-local midnight boundary"
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
const anchorMs = Date.parse(schedule.anchor);
|
|
645
|
+
if (!Number.isFinite(anchorMs)) throw new TypeError("Reporting configuration anchor must be a valid instant");
|
|
646
|
+
if (alignment === "utc" && (0, import_source.reportingUtcOffsetMinutesV1)(sourceTimezone, anchorMs) !== 0) {
|
|
647
|
+
throw new TypeError("UTC-aligned reporting requires a source timezone whose UTC offset is zero");
|
|
648
|
+
}
|
|
649
|
+
const originMs = (0, import_source.reportingScheduleOriginV1)(alignment, sourceTimezone);
|
|
650
|
+
const phase = ((anchorMs - originMs) % schedule.periodMilliseconds + schedule.periodMilliseconds) % schedule.periodMilliseconds;
|
|
651
|
+
if (phase !== 0) {
|
|
652
|
+
throw new TypeError(
|
|
653
|
+
`Reporting configuration anchor is not on a '${alignment}' period boundary; boundaries are derived from the protocol origin (1970-01-01 local midnight) plus whole periods`
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
const now = Date.now();
|
|
657
|
+
const spanStartMs = Math.max(anchorMs, now - OFFSET_BACKWARD_HORIZON_DAYS * DAY_MILLISECONDS);
|
|
658
|
+
const spanEndMs = Math.max(now, anchorMs) + OFFSET_FORWARD_HORIZON_DAYS * DAY_MILLISECONDS;
|
|
659
|
+
if ((0, import_source.reportingUtcOffsetMinutesV1)(sourceTimezone, originMs) !== (0, import_source.reportingUtcOffsetMinutesV1)(sourceTimezone, now)) {
|
|
660
|
+
throw new TypeError(
|
|
661
|
+
"Reporting source timezone no longer observes its schedule-origin offset; no anchor derived from the protocol origin can land on source-local midnight"
|
|
662
|
+
);
|
|
663
|
+
}
|
|
664
|
+
assertConstantUtcOffset(sourceTimezone, spanStartMs, spanEndMs);
|
|
665
|
+
if (!(0, import_source.reportingIsSourceLocalMidnightV1)(spanStartMs === anchorMs ? anchorMs : now, sourceTimezone)) {
|
|
666
|
+
const ordinal = Math.ceil((spanStartMs - originMs) / schedule.periodMilliseconds);
|
|
667
|
+
if (!(0, import_source.reportingIsSourceLocalMidnightV1)(originMs + ordinal * schedule.periodMilliseconds, sourceTimezone)) {
|
|
668
|
+
throw new TypeError("Reporting configuration boundaries do not land on source-local midnight");
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
function assertConstantUtcOffset(timeZone, startMs, endMs) {
|
|
673
|
+
const baseline = (0, import_source.reportingUtcOffsetMinutesV1)(timeZone, startMs);
|
|
674
|
+
for (let instant = startMs; instant < endMs; instant += OFFSET_PROBE_STEP_DAYS * DAY_MILLISECONDS) {
|
|
675
|
+
if ((0, import_source.reportingUtcOffsetMinutesV1)(timeZone, instant) !== baseline) {
|
|
676
|
+
throw new TypeError(
|
|
677
|
+
"Reporting source timezone changes its UTC offset; fixed-length periods cannot express its local days"
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
if ((0, import_source.reportingUtcOffsetMinutesV1)(timeZone, endMs) !== baseline) {
|
|
682
|
+
throw new TypeError(
|
|
683
|
+
"Reporting source timezone changes its UTC offset; fixed-length periods cannot express its local days"
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
function assertOfferingScheduleShape(offering) {
|
|
688
|
+
const advertised = offering.schedule;
|
|
689
|
+
const forbid = (fields) => {
|
|
690
|
+
for (const field of fields) {
|
|
691
|
+
if (advertised[field] !== void 0) {
|
|
692
|
+
throw new TypeError(
|
|
693
|
+
`Reporting offering advertises ${field}, which '${offering.schedule.alignment}' alignment forbids`
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
if (offering.schedule.alignment === "utc") {
|
|
699
|
+
forbid(["period_anchor", "period_anchor_policy", "period_timezone", "period_timezone_policy"]);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
forbid(["period_anchor", "period_anchor_policy"]);
|
|
703
|
+
const policy = offering.schedule.period_timezone_policy;
|
|
704
|
+
if (policy === void 0) {
|
|
705
|
+
throw new TypeError("source_timezone reporting offerings must advertise a period_timezone_policy");
|
|
706
|
+
}
|
|
707
|
+
if (policy === "fixed") {
|
|
708
|
+
if (offering.schedule.period_timezone === void 0) {
|
|
709
|
+
throw new TypeError("A fixed source_timezone reporting offering must advertise its period_timezone");
|
|
710
|
+
}
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
if (offering.schedule.period_timezone !== void 0) {
|
|
714
|
+
forbid(["period_timezone"]);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
function parseAdvertisedDuration(value, field) {
|
|
718
|
+
try {
|
|
719
|
+
return (0, import_source.reportingIsoDurationMillisecondsV1)(value);
|
|
720
|
+
} catch {
|
|
721
|
+
throw new TypeError(
|
|
722
|
+
`Reporting offering advertises a ${field} of '${value}' that this service cannot express as a fixed duration; every installation would reject it`
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
function localTimeOfDayMilliseconds(value) {
|
|
727
|
+
const [hours = 0, minutes = 0] = value.split(":").map(Number);
|
|
728
|
+
return hours * 36e5 + minutes * 6e4;
|
|
729
|
+
}
|
|
730
|
+
function trustedCurrency(value) {
|
|
731
|
+
if (typeof value !== "string" || !/^[A-Z]{3}$/.test(value)) {
|
|
732
|
+
throw new TypeError("resolveCurrency must return an ISO 4217-style three-letter uppercase currency");
|
|
733
|
+
}
|
|
734
|
+
return value;
|
|
735
|
+
}
|
|
736
|
+
function trustedTimezone(value) {
|
|
737
|
+
if (typeof value !== "string" || value.length === 0 || value.length > 255) {
|
|
738
|
+
throw new TypeError("resolveSource must return a bounded IANA sourceTimezone");
|
|
739
|
+
}
|
|
740
|
+
try {
|
|
741
|
+
new Intl.DateTimeFormat("en-US", { timeZone: value }).format(0);
|
|
742
|
+
} catch {
|
|
743
|
+
throw new TypeError("resolveSource must return a valid IANA sourceTimezone");
|
|
744
|
+
}
|
|
745
|
+
return value;
|
|
746
|
+
}
|
|
747
|
+
function assertNoUntrustedLineageFields(configuration) {
|
|
748
|
+
for (const field of [
|
|
749
|
+
"account",
|
|
750
|
+
"sourceScope",
|
|
751
|
+
"sourceTimezone",
|
|
752
|
+
"contract",
|
|
753
|
+
"currency",
|
|
754
|
+
"ctx_metadata",
|
|
755
|
+
"constituents",
|
|
756
|
+
"mediaBuyIds"
|
|
757
|
+
]) {
|
|
758
|
+
if (Object.prototype.hasOwnProperty.call(configuration, field)) {
|
|
759
|
+
throw new TypeError(`Reporting configuration must not supply trusted lineage field ${field}`);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
function containsContextMetadata(value) {
|
|
764
|
+
if (!value || typeof value !== "object") return false;
|
|
765
|
+
if (Array.isArray(value)) return value.some(containsContextMetadata);
|
|
766
|
+
for (const [key, child] of Object.entries(value)) {
|
|
767
|
+
if (/^(?:ctx_metadata|authInfo|auth_info)$/i.test(key) || containsContextMetadata(child)) return true;
|
|
768
|
+
}
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
function assertConsumerStatusStore(store) {
|
|
772
|
+
const candidate = store;
|
|
773
|
+
for (const method of ["getRevisionMetadata", "getConsumerStatusBatchReplay", "syncConsumerStatusBatch"]) {
|
|
774
|
+
if (typeof candidate[method] !== "function") {
|
|
775
|
+
throw new TypeError(`Consumer status requires a reporting ledger store with ${method}()`);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
function positiveInteger(value, field) {
|
|
780
|
+
if (!Number.isSafeInteger(value) || value <= 0) throw new TypeError(`${field} must be a positive safe integer`);
|
|
781
|
+
}
|
|
782
|
+
function deepFreeze(value) {
|
|
783
|
+
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
784
|
+
Object.freeze(value);
|
|
785
|
+
for (const child of Object.values(value)) deepFreeze(child);
|
|
786
|
+
}
|
|
787
|
+
return value;
|
|
788
|
+
}
|
|
789
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
790
|
+
0 && (module.exports = {
|
|
791
|
+
createReliableReportingService,
|
|
792
|
+
...require('./conformance.js')
|
|
793
|
+
});
|