@adcp/sdk 15.9.1 → 16.0.0-beta.2
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-identity.js +74 -0
- package/bin/adcp.js +2 -0
- package/dist/lib/adapters/keyed-account-backend.d.mts +37 -0
- package/dist/lib/adapters/keyed-account-backend.d.ts +37 -0
- package/dist/lib/adapters/keyed-account-backend.js +121 -0
- package/dist/lib/adapters/keyed-account-backend.mjs +94 -0
- package/dist/lib/adapters/keyed-account-store.d.mts +28 -0
- package/dist/lib/adapters/keyed-account-store.d.ts +28 -0
- package/dist/lib/adapters/keyed-account-store.js +227 -0
- package/dist/lib/adapters/keyed-account-store.mjs +203 -0
- package/dist/lib/core/SingleAgentClient.d.mts +25 -2
- package/dist/lib/core/SingleAgentClient.d.ts +25 -2
- package/dist/lib/core/SingleAgentClient.js +280 -62
- package/dist/lib/core/SingleAgentClient.mjs +282 -57
- package/dist/lib/core/TaskExecutor.d.mts +6 -0
- package/dist/lib/core/TaskExecutor.d.ts +6 -0
- package/dist/lib/core/TaskExecutor.js +66 -5
- package/dist/lib/core/TaskExecutor.mjs +71 -5
- package/dist/lib/core/postgres-webhook-registration-store.js +32 -5
- package/dist/lib/core/postgres-webhook-registration-store.mjs +32 -5
- package/dist/lib/core/redis-webhook-registration-store.js +23 -1
- package/dist/lib/core/redis-webhook-registration-store.mjs +23 -1
- package/dist/lib/core/webhook-registration.d.mts +7 -1
- package/dist/lib/core/webhook-registration.d.ts +7 -1
- package/dist/lib/core/webhook-registration.js +24 -2
- package/dist/lib/core/webhook-registration.mjs +23 -2
- package/dist/lib/identity-3.3/generated-compat.d.mts +34 -0
- package/dist/lib/identity-3.3/generated-compat.d.ts +34 -0
- package/dist/lib/identity-3.3/generated-compat.js +16 -0
- package/dist/lib/identity-3.3/generated-compat.mjs +0 -0
- package/dist/lib/identity-3.3/index.d.mts +10 -0
- package/dist/lib/identity-3.3/index.d.ts +10 -0
- package/dist/lib/identity-3.3/index.js +79 -0
- package/dist/lib/identity-3.3/index.mjs +50 -0
- package/dist/lib/identity-3.3/lifecycle.d.mts +125 -0
- package/dist/lib/identity-3.3/lifecycle.d.ts +125 -0
- package/dist/lib/identity-3.3/lifecycle.js +294 -0
- package/dist/lib/identity-3.3/lifecycle.mjs +272 -0
- package/dist/lib/identity-3.3/revocation.d.mts +86 -0
- package/dist/lib/identity-3.3/revocation.d.ts +86 -0
- package/dist/lib/identity-3.3/revocation.js +308 -0
- package/dist/lib/identity-3.3/revocation.mjs +286 -0
- package/dist/lib/identity-3.3/schemas.draft.d.mts +2472 -0
- package/dist/lib/identity-3.3/schemas.draft.d.ts +2472 -0
- package/dist/lib/identity-3.3/schemas.draft.js +1448 -0
- package/dist/lib/identity-3.3/schemas.draft.mjs +1428 -0
- package/dist/lib/identity-3.3/server.d.mts +46 -0
- package/dist/lib/identity-3.3/server.d.ts +46 -0
- package/dist/lib/identity-3.3/server.js +279 -0
- package/dist/lib/identity-3.3/server.mjs +260 -0
- package/dist/lib/identity-3.3/store.d.mts +24 -0
- package/dist/lib/identity-3.3/store.d.ts +24 -0
- package/dist/lib/identity-3.3/store.js +191 -0
- package/dist/lib/identity-3.3/store.mjs +169 -0
- package/dist/lib/identity-3.3/trust.d.mts +155 -0
- package/dist/lib/identity-3.3/trust.d.ts +155 -0
- package/dist/lib/identity-3.3/trust.js +383 -0
- package/dist/lib/identity-3.3/trust.mjs +342 -0
- package/dist/lib/identity-3.3/types.d.mts +155 -0
- package/dist/lib/identity-3.3/types.d.ts +155 -0
- package/dist/lib/identity-3.3/types.js +16 -0
- package/dist/lib/identity-3.3/types.mjs +0 -0
- package/dist/lib/identity-3.3/validation.d.mts +2 -0
- package/dist/lib/identity-3.3/validation.d.ts +2 -0
- package/dist/lib/identity-3.3/validation.js +125 -0
- package/dist/lib/identity-3.3/validation.mjs +91 -0
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.mjs +2 -0
- package/dist/lib/protocols/index.d.mts +1 -1
- package/dist/lib/protocols/index.d.ts +1 -1
- package/dist/lib/protocols/index.js +2 -2
- package/dist/lib/protocols/index.mjs +2 -2
- package/dist/lib/reporting/azure/index.d.mts +5 -0
- package/dist/lib/reporting/azure/index.d.ts +5 -0
- package/dist/lib/reporting/azure/index.js +26 -7
- package/dist/lib/reporting/azure/index.mjs +26 -7
- package/dist/lib/reporting/bigquery/index.d.mts +39 -5
- package/dist/lib/reporting/bigquery/index.d.ts +39 -5
- package/dist/lib/reporting/bigquery/index.js +26 -20
- package/dist/lib/reporting/bigquery/index.mjs +26 -20
- package/dist/lib/reporting/gcs/adapter.d.mts +8 -1
- package/dist/lib/reporting/gcs/adapter.d.ts +8 -1
- package/dist/lib/reporting/gcs/errors.d.mts +6 -0
- package/dist/lib/reporting/gcs/errors.d.ts +6 -0
- package/dist/lib/reporting/gcs/fence.d.mts +5 -0
- package/dist/lib/reporting/gcs/fence.d.ts +5 -0
- package/dist/lib/reporting/gcs/index.d.mts +9 -0
- package/dist/lib/reporting/gcs/index.d.ts +9 -0
- package/dist/lib/reporting/gcs/reader.d.mts +27 -3
- package/dist/lib/reporting/gcs/reader.d.ts +27 -3
- package/dist/lib/reporting/gcs/row-provider.d.mts +7 -0
- package/dist/lib/reporting/gcs/row-provider.d.ts +7 -0
- package/dist/lib/reporting/gcs/row-provider.js +34 -14
- package/dist/lib/reporting/gcs/row-provider.mjs +34 -14
- package/dist/lib/reporting/ledger/change-feed.d.mts +22 -1
- package/dist/lib/reporting/ledger/change-feed.d.ts +22 -1
- package/dist/lib/reporting/ledger/index.d.mts +11 -0
- package/dist/lib/reporting/ledger/index.d.ts +11 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +8 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +8 -0
- package/dist/lib/reporting/ledger/managed-router.d.mts +27 -2
- package/dist/lib/reporting/ledger/managed-router.d.ts +27 -2
- package/dist/lib/reporting/ledger/managed.d.mts +86 -6
- package/dist/lib/reporting/ledger/managed.d.ts +86 -6
- package/dist/lib/reporting/ledger/notification-activity.d.mts +65 -3
- package/dist/lib/reporting/ledger/notification-activity.d.ts +65 -3
- package/dist/lib/reporting/ledger/object-writes.d.mts +64 -5
- package/dist/lib/reporting/ledger/object-writes.d.ts +64 -5
- package/dist/lib/reporting/ledger/postgres.d.mts +43 -9
- package/dist/lib/reporting/ledger/postgres.d.ts +43 -9
- package/dist/lib/reporting/ledger/postgres.js +43 -27
- package/dist/lib/reporting/ledger/postgres.mjs +43 -27
- package/dist/lib/reporting/ledger/row-encoding.d.mts +92 -6
- package/dist/lib/reporting/ledger/row-encoding.d.ts +92 -6
- package/dist/lib/reporting/ledger/row-encoding.js +8 -4
- package/dist/lib/reporting/ledger/row-encoding.mjs +6 -3
- package/dist/lib/reporting/ledger/row-storage-errors.d.mts +11 -1
- package/dist/lib/reporting/ledger/row-storage-errors.d.ts +11 -1
- package/dist/lib/reporting/ledger/row-storage-migration.d.mts +19 -1
- package/dist/lib/reporting/ledger/row-storage-migration.d.ts +19 -1
- package/dist/lib/reporting/ledger/row-storage-migration.js +133 -18
- package/dist/lib/reporting/ledger/row-storage-migration.mjs +133 -18
- package/dist/lib/reporting/ledger/row-storage-object.d.mts +103 -12
- package/dist/lib/reporting/ledger/row-storage-object.d.ts +103 -12
- package/dist/lib/reporting/ledger/row-storage-object.js +106 -31
- package/dist/lib/reporting/ledger/row-storage-object.mjs +104 -31
- package/dist/lib/reporting/ledger/row-storage.d.mts +87 -20
- package/dist/lib/reporting/ledger/row-storage.d.ts +87 -20
- package/dist/lib/reporting/ledger/row-storage.js +126 -66
- package/dist/lib/reporting/ledger/row-storage.mjs +129 -67
- package/dist/lib/reporting/ledger/schedule.d.mts +13 -0
- package/dist/lib/reporting/ledger/schedule.d.ts +13 -0
- package/dist/lib/reporting/ledger/schedule.js +24 -0
- package/dist/lib/reporting/ledger/schedule.mjs +23 -0
- package/dist/lib/reporting/ledger/types.d.mts +23 -1
- package/dist/lib/reporting/ledger/types.d.ts +23 -1
- package/dist/lib/reporting/s3/index.d.mts +5 -0
- package/dist/lib/reporting/s3/index.d.ts +5 -0
- package/dist/lib/reporting/s3/index.js +37 -14
- package/dist/lib/reporting/s3/index.mjs +37 -14
- package/dist/lib/reporting/service/index.d.mts +10 -0
- package/dist/lib/reporting/service/index.d.ts +10 -0
- package/dist/lib/reporting/service/maintenance.d.mts +28 -2
- package/dist/lib/reporting/service/maintenance.d.ts +28 -2
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/account-sync-contract.d.mts +14 -0
- package/dist/lib/server/account-sync-contract.d.ts +14 -0
- package/dist/lib/server/account-sync-contract.js +225 -0
- package/dist/lib/server/account-sync-contract.mjs +197 -0
- package/dist/lib/server/adcp-server.js +5 -0
- package/dist/lib/server/adcp-server.mjs +10 -0
- package/dist/lib/server/auth-signature.d.mts +15 -0
- package/dist/lib/server/auth-signature.d.ts +15 -0
- package/dist/lib/server/auth-signature.js +72 -2
- package/dist/lib/server/auth-signature.mjs +81 -2
- package/dist/lib/server/auth.d.mts +6 -0
- package/dist/lib/server/auth.d.ts +6 -0
- package/dist/lib/server/auth.js +6 -0
- package/dist/lib/server/auth.mjs +6 -0
- package/dist/lib/server/create-adcp-server.d.mts +19 -5
- package/dist/lib/server/create-adcp-server.d.ts +19 -5
- package/dist/lib/server/create-adcp-server.js +259 -19
- package/dist/lib/server/create-adcp-server.mjs +266 -10
- package/dist/lib/server/decisioning/account.d.mts +24 -1
- package/dist/lib/server/decisioning/account.d.ts +24 -1
- package/dist/lib/server/decisioning/index.d.mts +1 -1
- package/dist/lib/server/decisioning/index.d.ts +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.d.mts +0 -50
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +0 -50
- package/dist/lib/server/decisioning/runtime/from-platform.js +61 -11
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +65 -12
- package/dist/lib/server/index.d.mts +2 -0
- package/dist/lib/server/index.d.ts +2 -0
- package/dist/lib/server/index.js +12 -0
- package/dist/lib/server/index.mjs +12 -0
- package/dist/lib/server/notification-subscriptions/runtime.js +9 -1
- package/dist/lib/server/notification-subscriptions/runtime.mjs +9 -1
- package/dist/lib/server/notification-subscriptions/types.d.mts +5 -0
- package/dist/lib/server/notification-subscriptions/types.d.ts +5 -0
- package/dist/lib/server/principal/types.d.mts +1 -1
- package/dist/lib/server/principal/types.d.ts +1 -1
- package/dist/lib/server/serve.js +5 -0
- package/dist/lib/server/serve.mjs +5 -0
- package/dist/lib/server/webhook-delivery/recovery.d.mts +1 -0
- package/dist/lib/server/webhook-delivery/recovery.d.ts +1 -0
- package/dist/lib/server/webhook-delivery/recovery.js +4 -0
- package/dist/lib/server/webhook-delivery/recovery.mjs +4 -0
- package/dist/lib/server/webhook-emitter.d.mts +10 -0
- package/dist/lib/server/webhook-emitter.d.ts +10 -0
- package/dist/lib/server/webhook-emitter.js +22 -0
- package/dist/lib/server/webhook-emitter.mjs +22 -0
- package/dist/lib/signing/agent-context.d.mts +0 -5
- package/dist/lib/signing/agent-context.d.ts +0 -5
- package/dist/lib/signing/agent-context.js +9 -1
- package/dist/lib/signing/agent-context.mjs +9 -1
- package/dist/lib/signing/agent-fetch.js +27 -2
- package/dist/lib/signing/agent-fetch.mjs +32 -2
- package/dist/lib/signing/agent-resolver/canonicalize.d.mts +10 -15
- package/dist/lib/signing/agent-resolver/canonicalize.d.ts +10 -15
- package/dist/lib/signing/agent-resolver/canonicalize.js +17 -5
- package/dist/lib/signing/agent-resolver/canonicalize.mjs +16 -5
- package/dist/lib/signing/agent-resolver/index.d.mts +1 -0
- package/dist/lib/signing/agent-resolver/index.d.ts +1 -0
- package/dist/lib/signing/agent-resolver/index.js +5 -0
- package/dist/lib/signing/agent-resolver/index.mjs +3 -0
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.mts +3 -2
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.ts +3 -2
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.js +30 -3
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.mjs +30 -3
- package/dist/lib/signing/agent-resolver/strict-json.d.mts +2 -2
- package/dist/lib/signing/agent-resolver/strict-json.d.ts +2 -2
- package/dist/lib/signing/agent-resolver/strict-json.js +5 -3
- package/dist/lib/signing/agent-resolver/strict-json.mjs +5 -3
- package/dist/lib/signing/brand-jwks.d.mts +2 -2
- package/dist/lib/signing/brand-jwks.d.ts +2 -2
- package/dist/lib/signing/brand-jwks.js +4 -4
- package/dist/lib/signing/brand-jwks.mjs +4 -4
- package/dist/lib/signing/client.d.mts +1 -0
- package/dist/lib/signing/client.d.ts +1 -0
- package/dist/lib/signing/client.js +5 -0
- package/dist/lib/signing/client.mjs +3 -0
- package/dist/lib/signing/crypto.js +8 -0
- package/dist/lib/signing/crypto.mjs +9 -1
- package/dist/lib/signing/fetch-async.js +1 -1
- package/dist/lib/signing/fetch-async.mjs +1 -1
- package/dist/lib/signing/fetch.js +1 -1
- package/dist/lib/signing/fetch.mjs +1 -1
- package/dist/lib/signing/jwks-https.d.mts +1 -1
- package/dist/lib/signing/jwks-https.d.ts +1 -1
- package/dist/lib/signing/jwks-https.js +1 -1
- package/dist/lib/signing/jwks-https.mjs +1 -1
- package/dist/lib/signing/jwks.d.mts +11 -3
- package/dist/lib/signing/jwks.d.ts +11 -3
- package/dist/lib/signing/jwks.js +1 -1
- package/dist/lib/signing/jwks.mjs +1 -1
- package/dist/lib/signing/middleware.js +9 -0
- package/dist/lib/signing/middleware.mjs +14 -0
- package/dist/lib/signing/parser.d.mts +9 -6
- package/dist/lib/signing/parser.d.ts +9 -6
- package/dist/lib/signing/parser.js +82 -64
- package/dist/lib/signing/parser.mjs +83 -65
- package/dist/lib/signing/revocation.d.mts +4 -1
- package/dist/lib/signing/revocation.d.ts +4 -1
- package/dist/lib/signing/revocation.js +36 -3
- package/dist/lib/signing/revocation.mjs +34 -2
- package/dist/lib/signing/server.d.mts +1 -1
- package/dist/lib/signing/server.d.ts +1 -1
- package/dist/lib/signing/server.js +4 -0
- package/dist/lib/signing/server.mjs +4 -0
- package/dist/lib/signing/types.d.mts +3 -0
- package/dist/lib/signing/types.d.ts +3 -0
- package/dist/lib/signing/verifier.js +1 -1
- package/dist/lib/signing/verifier.mjs +1 -1
- package/dist/lib/signing/web-bot-auth.d.mts +191 -0
- package/dist/lib/signing/web-bot-auth.d.ts +191 -0
- package/dist/lib/signing/web-bot-auth.js +837 -0
- package/dist/lib/signing/web-bot-auth.mjs +796 -0
- package/dist/lib/signing/webhook-verifier.js +1 -1
- package/dist/lib/signing/webhook-verifier.mjs +1 -1
- package/dist/lib/testing/client.d.mts +1 -4
- package/dist/lib/testing/client.d.ts +1 -4
- package/dist/lib/testing/client.js +141 -20
- package/dist/lib/testing/client.mjs +137 -19
- package/dist/lib/testing/compliance/comply.js +29 -10
- package/dist/lib/testing/compliance/comply.mjs +37 -11
- package/dist/lib/testing/storyboard/account-sync-contract.d.mts +3 -0
- package/dist/lib/testing/storyboard/account-sync-contract.d.ts +3 -0
- package/dist/lib/testing/storyboard/account-sync-contract.js +79 -0
- package/dist/lib/testing/storyboard/account-sync-contract.mjs +55 -0
- package/dist/lib/testing/storyboard/default-invariants.js +2 -0
- package/dist/lib/testing/storyboard/default-invariants.mjs +2 -0
- package/dist/lib/testing/storyboard/runner.js +23 -8
- package/dist/lib/testing/storyboard/runner.mjs +24 -8
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/types/adcp.d.mts +4 -0
- package/dist/lib/types/adcp.d.ts +4 -0
- package/dist/lib/types/schemas.generated.d.ts +6 -6
- package/dist/lib/utils/capabilities.d.mts +1 -0
- package/dist/lib/utils/capabilities.d.ts +1 -0
- package/dist/lib/utils/capabilities.js +5 -0
- package/dist/lib/utils/capabilities.mjs +5 -0
- package/dist/lib/v2/projection/catalog-snapshot.js +3 -1
- package/dist/lib/v2/projection/catalog-snapshot.mjs +3 -1
- package/dist/lib/v2/projection/creative-delivery.d.mts +34 -10
- package/dist/lib/v2/projection/creative-delivery.d.ts +34 -10
- package/dist/lib/v2/projection/creative-delivery.js +26 -10
- package/dist/lib/v2/projection/creative-delivery.mjs +26 -10
- package/dist/lib/v2/projection/index.d.mts +1 -1
- package/dist/lib/v2/projection/index.d.ts +1 -1
- package/dist/lib/v2/projection/index.js +2 -0
- package/dist/lib/v2/projection/index.mjs +2 -0
- package/dist/lib/v2/projection/legacy-routes.d.mts +34 -2
- package/dist/lib/v2/projection/legacy-routes.d.ts +34 -2
- package/dist/lib/v2/projection/legacy-routes.js +35 -2
- package/dist/lib/v2/projection/legacy-routes.mjs +32 -2
- package/dist/lib/validation/schema-loader.d.mts +2 -0
- package/dist/lib/validation/schema-loader.d.ts +2 -0
- package/dist/lib/validation/schema-loader.js +43 -4
- package/dist/lib/validation/schema-loader.mjs +39 -3
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +4 -0
- package/docs/guides/REPORTING-LEDGER-CUTOVER.md +1 -1
- package/docs/guides/REPORTING-LEDGER.md +99 -29
- package/docs/guides/REPORTING-OPERATIONS.md +29 -13
- package/docs/guides/REPORTING-STABILITY.md +76 -0
- package/docs/guides/account-resolution.md +101 -0
- package/docs/llms.txt +3 -2
- package/docs/migration-12-to-13.md +15 -0
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-agent-identity-3.3.md +494 -0
- package/docs/migration-agent-resolution-3.3.md +5 -0
- package/docs/migration-reporting-row-storage-alignment.md +137 -0
- package/examples/storyboards/account-sync-contract.yaml +57 -0
- package/package.json +17 -1
|
@@ -53,6 +53,7 @@ export interface MediaBuyFeatures {
|
|
|
53
53
|
* Account management capabilities declared by the seller
|
|
54
54
|
*/
|
|
55
55
|
export interface AccountCapabilities {
|
|
56
|
+
agentOnboarding?: import('../identity-3.3/types').AgentOnboarding;
|
|
56
57
|
/** Seller-issued IDs are stable and accepted wherever an account reference is used. */
|
|
57
58
|
stableAccountId?: boolean;
|
|
58
59
|
/** Optional account change feed; absence does not imply support. */
|
|
@@ -316,6 +316,11 @@ function parseCapabilitiesResponse(response) {
|
|
|
316
316
|
authorizationEndpoint: response.account.authorization_endpoint,
|
|
317
317
|
supportedBilling: response.account.supported_billing ?? [],
|
|
318
318
|
defaultBilling: response.account.default_billing,
|
|
319
|
+
...response.account.agent_onboarding && {
|
|
320
|
+
agentOnboarding: structuredClone(
|
|
321
|
+
response.account.agent_onboarding
|
|
322
|
+
)
|
|
323
|
+
},
|
|
319
324
|
supportedAccountCurrencyModes: response.account.supported_account_currency_modes,
|
|
320
325
|
...response.account.timezone && {
|
|
321
326
|
timezone: {
|
|
@@ -260,6 +260,11 @@ function parseCapabilitiesResponse(response) {
|
|
|
260
260
|
authorizationEndpoint: response.account.authorization_endpoint,
|
|
261
261
|
supportedBilling: response.account.supported_billing ?? [],
|
|
262
262
|
defaultBilling: response.account.default_billing,
|
|
263
|
+
...response.account.agent_onboarding && {
|
|
264
|
+
agentOnboarding: structuredClone(
|
|
265
|
+
response.account.agent_onboarding
|
|
266
|
+
)
|
|
267
|
+
},
|
|
263
268
|
supportedAccountCurrencyModes: response.account.supported_account_currency_modes,
|
|
264
269
|
...response.account.timezone && {
|
|
265
270
|
timezone: {
|
|
@@ -25,6 +25,7 @@ __export(catalog_snapshot_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(catalog_snapshot_exports);
|
|
26
26
|
var import_resolve_agent_properties = require('../../discovery/resolve-agent-properties.js');
|
|
27
27
|
var import_canonical_properties = require('./canonical-properties.js');
|
|
28
|
+
var import_legacy_routes = require('./legacy-routes.js');
|
|
28
29
|
const compiledSnapshotCache = /* @__PURE__ */ new WeakMap();
|
|
29
30
|
function normalizedAgentUrl(value) {
|
|
30
31
|
return (0, import_resolve_agent_properties.canonicalizeAgentUrl)(value) ?? value;
|
|
@@ -202,7 +203,7 @@ function legacyFormatConverterFromCatalogSnapshots(snapshots, fallback) {
|
|
|
202
203
|
function canonicalFormatLegacyResolverFromCatalogSnapshots(snapshots, fallback) {
|
|
203
204
|
if (!snapshots || snapshots.length === 0) return fallback;
|
|
204
205
|
const compiled = compileProjectionCatalogSnapshots(snapshots);
|
|
205
|
-
|
|
206
|
+
const resolver = (context) => {
|
|
206
207
|
const refs = resolutionContextFormatOptionRefs(context);
|
|
207
208
|
if (refs.length === 0) return fallback?.(context);
|
|
208
209
|
const resolved = [];
|
|
@@ -225,6 +226,7 @@ function canonicalFormatLegacyResolverFromCatalogSnapshots(snapshots, fallback)
|
|
|
225
226
|
}
|
|
226
227
|
return [...new Map(resolved.map((ref) => [legacyRefKey(ref), ref])).values()];
|
|
227
228
|
};
|
|
229
|
+
return (0, import_legacy_routes.carryFormatOptionOrigins)(resolver, fallback);
|
|
228
230
|
}
|
|
229
231
|
function assertBidirectionalProjectionCatalogs(snapshots) {
|
|
230
232
|
const routeByCanonicalOption = /* @__PURE__ */ new Map();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { canonicalizeAgentUrl } from "../../discovery/resolve-agent-properties.mjs";
|
|
2
2
|
import { isCanonicalV1Translatable } from "./canonical-properties.mjs";
|
|
3
|
+
import { carryFormatOptionOrigins } from "./legacy-routes.mjs";
|
|
3
4
|
const compiledSnapshotCache = /* @__PURE__ */ new WeakMap();
|
|
4
5
|
function normalizedAgentUrl(value) {
|
|
5
6
|
return canonicalizeAgentUrl(value) ?? value;
|
|
@@ -177,7 +178,7 @@ function legacyFormatConverterFromCatalogSnapshots(snapshots, fallback) {
|
|
|
177
178
|
function canonicalFormatLegacyResolverFromCatalogSnapshots(snapshots, fallback) {
|
|
178
179
|
if (!snapshots || snapshots.length === 0) return fallback;
|
|
179
180
|
const compiled = compileProjectionCatalogSnapshots(snapshots);
|
|
180
|
-
|
|
181
|
+
const resolver = (context) => {
|
|
181
182
|
const refs = resolutionContextFormatOptionRefs(context);
|
|
182
183
|
if (refs.length === 0) return fallback?.(context);
|
|
183
184
|
const resolved = [];
|
|
@@ -200,6 +201,7 @@ function canonicalFormatLegacyResolverFromCatalogSnapshots(snapshots, fallback)
|
|
|
200
201
|
}
|
|
201
202
|
return [...new Map(resolved.map((ref) => [legacyRefKey(ref), ref])).values()];
|
|
202
203
|
};
|
|
204
|
+
return carryFormatOptionOrigins(resolver, fallback);
|
|
203
205
|
}
|
|
204
206
|
function assertBidirectionalProjectionCatalogs(snapshots) {
|
|
205
207
|
const routeByCanonicalOption = /* @__PURE__ */ new Map();
|
|
@@ -78,23 +78,47 @@ export type CanonicalCreateMediaBuyRequest = Omit<CanonicalCreativeResponse<Crea
|
|
|
78
78
|
packages?: CanonicalPackageRequest[];
|
|
79
79
|
};
|
|
80
80
|
type CanonicalReportingWebhook = NonNullable<CanonicalCreateMediaBuyRequest['reporting_webhook']>;
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Client-facing form of a wire reporting webhook `W`. Every field is optional:
|
|
83
|
+
* the SDK can supply the callback `url`, `reporting_frequency` and the
|
|
84
|
+
* `authentication` block from client configuration.
|
|
85
|
+
*
|
|
86
|
+
* `authentication` is optional even with a caller-supplied `url`. AdCP 3.3
|
|
87
|
+
* makes it optional on the wire when the seller signs webhooks under its
|
|
88
|
+
* profile (`webhook_signing.supported`), and the experimental 3.3 client sends
|
|
89
|
+
* the registration without it once it has negotiated that. Below 3.3 the wire
|
|
90
|
+
* still requires it: with `webhookUrlTemplate` configured the client throws
|
|
91
|
+
* rather than send a caller URL without credentials (it never pairs its own
|
|
92
|
+
* `webhookSecret` with a caller-controlled host), and request validation
|
|
93
|
+
* reports the missing field otherwise.
|
|
94
|
+
*
|
|
95
|
+
* Derived from `W` rather than restating its fields, so it accepts every
|
|
96
|
+
* reporting webhook the pinned schemas generate, whether they declare
|
|
97
|
+
* `authentication` required (3.2) or optional (3.3).
|
|
98
|
+
*
|
|
99
|
+
* Exported for the type tests only; not re-exported from the package root.
|
|
100
|
+
*/
|
|
101
|
+
export type ClientReportingWebhookInputFor<W extends {
|
|
102
|
+
url: string;
|
|
103
|
+
reporting_frequency: unknown;
|
|
104
|
+
}> = Omit<W, 'url' | 'authentication' | 'reporting_frequency'> & {
|
|
105
|
+
url?: W['url'];
|
|
106
|
+
reporting_frequency?: W['reporting_frequency'];
|
|
107
|
+
/** Atomic: `schemes` and `credentials` always come from the same source. */
|
|
108
|
+
authentication?: W extends {
|
|
109
|
+
authentication?: infer A;
|
|
110
|
+
} ? (unknown extends A ? never : A) : never;
|
|
83
111
|
};
|
|
84
|
-
type ClientReportingWebhookInput =
|
|
85
|
-
url?: never;
|
|
86
|
-
authentication?: CanonicalReportingWebhook['authentication'];
|
|
87
|
-
}) | (ReportingWebhookPreferences & {
|
|
88
|
-
url: CanonicalReportingWebhook['url'];
|
|
89
|
-
authentication: CanonicalReportingWebhook['authentication'];
|
|
90
|
-
});
|
|
112
|
+
type ClientReportingWebhookInput = ClientReportingWebhookInputFor<CanonicalReportingWebhook>;
|
|
91
113
|
/**
|
|
92
114
|
* Client-facing create request. The SDK may supply the reporting callback URL
|
|
93
115
|
* and its complete authentication block from client configuration; the wire
|
|
94
116
|
* request remains a strict {@link CanonicalCreateMediaBuyRequest}.
|
|
95
117
|
*/
|
|
96
118
|
export type CanonicalCreateMediaBuyInput = Omit<CanonicalCreateMediaBuyRequest, 'reporting_webhook'> & {
|
|
97
|
-
reporting_webhook?: ClientReportingWebhookInput
|
|
119
|
+
reporting_webhook?: ClientReportingWebhookInput & {
|
|
120
|
+
signing_profile?: 'adcp/webhook-signing/v1' | 'web-bot-auth';
|
|
121
|
+
};
|
|
98
122
|
};
|
|
99
123
|
export type CanonicalUpdateMediaBuyRequest = Omit<CanonicalCreativeResponse<UpdateMediaBuyRequest>, 'packages' | 'new_packages'> & {
|
|
100
124
|
packages?: CanonicalPackageUpdate[];
|
|
@@ -78,23 +78,47 @@ export type CanonicalCreateMediaBuyRequest = Omit<CanonicalCreativeResponse<Crea
|
|
|
78
78
|
packages?: CanonicalPackageRequest[];
|
|
79
79
|
};
|
|
80
80
|
type CanonicalReportingWebhook = NonNullable<CanonicalCreateMediaBuyRequest['reporting_webhook']>;
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Client-facing form of a wire reporting webhook `W`. Every field is optional:
|
|
83
|
+
* the SDK can supply the callback `url`, `reporting_frequency` and the
|
|
84
|
+
* `authentication` block from client configuration.
|
|
85
|
+
*
|
|
86
|
+
* `authentication` is optional even with a caller-supplied `url`. AdCP 3.3
|
|
87
|
+
* makes it optional on the wire when the seller signs webhooks under its
|
|
88
|
+
* profile (`webhook_signing.supported`), and the experimental 3.3 client sends
|
|
89
|
+
* the registration without it once it has negotiated that. Below 3.3 the wire
|
|
90
|
+
* still requires it: with `webhookUrlTemplate` configured the client throws
|
|
91
|
+
* rather than send a caller URL without credentials (it never pairs its own
|
|
92
|
+
* `webhookSecret` with a caller-controlled host), and request validation
|
|
93
|
+
* reports the missing field otherwise.
|
|
94
|
+
*
|
|
95
|
+
* Derived from `W` rather than restating its fields, so it accepts every
|
|
96
|
+
* reporting webhook the pinned schemas generate, whether they declare
|
|
97
|
+
* `authentication` required (3.2) or optional (3.3).
|
|
98
|
+
*
|
|
99
|
+
* Exported for the type tests only; not re-exported from the package root.
|
|
100
|
+
*/
|
|
101
|
+
export type ClientReportingWebhookInputFor<W extends {
|
|
102
|
+
url: string;
|
|
103
|
+
reporting_frequency: unknown;
|
|
104
|
+
}> = Omit<W, 'url' | 'authentication' | 'reporting_frequency'> & {
|
|
105
|
+
url?: W['url'];
|
|
106
|
+
reporting_frequency?: W['reporting_frequency'];
|
|
107
|
+
/** Atomic: `schemes` and `credentials` always come from the same source. */
|
|
108
|
+
authentication?: W extends {
|
|
109
|
+
authentication?: infer A;
|
|
110
|
+
} ? (unknown extends A ? never : A) : never;
|
|
83
111
|
};
|
|
84
|
-
type ClientReportingWebhookInput =
|
|
85
|
-
url?: never;
|
|
86
|
-
authentication?: CanonicalReportingWebhook['authentication'];
|
|
87
|
-
}) | (ReportingWebhookPreferences & {
|
|
88
|
-
url: CanonicalReportingWebhook['url'];
|
|
89
|
-
authentication: CanonicalReportingWebhook['authentication'];
|
|
90
|
-
});
|
|
112
|
+
type ClientReportingWebhookInput = ClientReportingWebhookInputFor<CanonicalReportingWebhook>;
|
|
91
113
|
/**
|
|
92
114
|
* Client-facing create request. The SDK may supply the reporting callback URL
|
|
93
115
|
* and its complete authentication block from client configuration; the wire
|
|
94
116
|
* request remains a strict {@link CanonicalCreateMediaBuyRequest}.
|
|
95
117
|
*/
|
|
96
118
|
export type CanonicalCreateMediaBuyInput = Omit<CanonicalCreateMediaBuyRequest, 'reporting_webhook'> & {
|
|
97
|
-
reporting_webhook?: ClientReportingWebhookInput
|
|
119
|
+
reporting_webhook?: ClientReportingWebhookInput & {
|
|
120
|
+
signing_profile?: 'adcp/webhook-signing/v1' | 'web-bot-auth';
|
|
121
|
+
};
|
|
98
122
|
};
|
|
99
123
|
export type CanonicalUpdateMediaBuyRequest = Omit<CanonicalCreativeResponse<UpdateMediaBuyRequest>, 'packages' | 'new_packages'> & {
|
|
100
124
|
packages?: CanonicalPackageUpdate[];
|
|
@@ -487,20 +487,32 @@ function creativeFormatParameterConstraints(creative) {
|
|
|
487
487
|
if (width === void 0 && height === void 0 && durationMs === void 0) return void 0;
|
|
488
488
|
return { width, height, durationMs };
|
|
489
489
|
}
|
|
490
|
+
function legacyRefParameterConstraints(ref) {
|
|
491
|
+
const params = typeof ref.width !== "number" || typeof ref.height !== "number" ? record((0, import_v1_to_v2.canonicalDeclarationFromBareId)(ref.id, { agentUrl: ref.agent_url })?.params) : void 0;
|
|
492
|
+
return {
|
|
493
|
+
width: typeof ref.width === "number" ? ref.width : typeof params?.width === "number" ? params.width : void 0,
|
|
494
|
+
height: typeof ref.height === "number" ? ref.height : typeof params?.height === "number" ? params.height : void 0,
|
|
495
|
+
durationMs: ref.duration_ms
|
|
496
|
+
};
|
|
497
|
+
}
|
|
490
498
|
function refContradictsConstraints(ref, constraints) {
|
|
491
|
-
|
|
492
|
-
if (constraints.
|
|
499
|
+
const refConstraints = legacyRefParameterConstraints(ref);
|
|
500
|
+
if (constraints.width !== void 0 && refConstraints.width !== void 0 && refConstraints.width !== constraints.width) {
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
if (constraints.height !== void 0 && refConstraints.height !== void 0 && refConstraints.height !== constraints.height) {
|
|
493
504
|
return true;
|
|
494
505
|
}
|
|
495
|
-
if (constraints.durationMs !== void 0 && typeof
|
|
506
|
+
if (constraints.durationMs !== void 0 && typeof refConstraints.durationMs === "number" && refConstraints.durationMs !== constraints.durationMs) {
|
|
496
507
|
return true;
|
|
497
508
|
}
|
|
498
509
|
return false;
|
|
499
510
|
}
|
|
500
511
|
function refPinsConstraints(ref, constraints) {
|
|
501
|
-
|
|
502
|
-
if (constraints.
|
|
503
|
-
if (constraints.
|
|
512
|
+
const refConstraints = legacyRefParameterConstraints(ref);
|
|
513
|
+
if (constraints.width !== void 0 && refConstraints.width === void 0) return false;
|
|
514
|
+
if (constraints.height !== void 0 && refConstraints.height === void 0) return false;
|
|
515
|
+
if (constraints.durationMs !== void 0 && typeof refConstraints.durationMs !== "number") return false;
|
|
504
516
|
return true;
|
|
505
517
|
}
|
|
506
518
|
function legacyIdPinsDimensions(ref) {
|
|
@@ -510,15 +522,19 @@ function legacyIdPinsDimensions(ref) {
|
|
|
510
522
|
return typeof params.width === "number" || typeof params.height === "number" || typeof params.duration_ms_exact === "number" || Array.isArray(params.sizes);
|
|
511
523
|
}
|
|
512
524
|
function refConstraintKey(ref) {
|
|
513
|
-
|
|
525
|
+
const constraints = legacyRefParameterConstraints(ref);
|
|
526
|
+
return [
|
|
527
|
+
agentIdentity(ref.agent_url),
|
|
528
|
+
constraints.width ?? "",
|
|
529
|
+
constraints.height ?? "",
|
|
530
|
+
constraints.durationMs ?? ""
|
|
531
|
+
].join("|");
|
|
514
532
|
}
|
|
515
533
|
function preferMostConstrainedLegacyCandidates(candidates, creative) {
|
|
516
|
-
if (candidates.length <= 1) return candidates;
|
|
517
534
|
let remaining = candidates;
|
|
518
535
|
const constraints = creativeFormatParameterConstraints(creative);
|
|
519
536
|
if (constraints) {
|
|
520
|
-
|
|
521
|
-
if (compatible.length > 0) remaining = compatible;
|
|
537
|
+
remaining = remaining.filter((candidate) => !refContradictsConstraints(candidate.ref, constraints));
|
|
522
538
|
const pinned = remaining.filter((candidate) => refPinsConstraints(candidate.ref, constraints));
|
|
523
539
|
if (pinned.length > 0) remaining = pinned;
|
|
524
540
|
}
|
|
@@ -466,20 +466,32 @@ function creativeFormatParameterConstraints(creative) {
|
|
|
466
466
|
if (width === void 0 && height === void 0 && durationMs === void 0) return void 0;
|
|
467
467
|
return { width, height, durationMs };
|
|
468
468
|
}
|
|
469
|
+
function legacyRefParameterConstraints(ref) {
|
|
470
|
+
const params = typeof ref.width !== "number" || typeof ref.height !== "number" ? record(canonicalDeclarationFromBareId(ref.id, { agentUrl: ref.agent_url })?.params) : void 0;
|
|
471
|
+
return {
|
|
472
|
+
width: typeof ref.width === "number" ? ref.width : typeof params?.width === "number" ? params.width : void 0,
|
|
473
|
+
height: typeof ref.height === "number" ? ref.height : typeof params?.height === "number" ? params.height : void 0,
|
|
474
|
+
durationMs: ref.duration_ms
|
|
475
|
+
};
|
|
476
|
+
}
|
|
469
477
|
function refContradictsConstraints(ref, constraints) {
|
|
470
|
-
|
|
471
|
-
if (constraints.
|
|
478
|
+
const refConstraints = legacyRefParameterConstraints(ref);
|
|
479
|
+
if (constraints.width !== void 0 && refConstraints.width !== void 0 && refConstraints.width !== constraints.width) {
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
if (constraints.height !== void 0 && refConstraints.height !== void 0 && refConstraints.height !== constraints.height) {
|
|
472
483
|
return true;
|
|
473
484
|
}
|
|
474
|
-
if (constraints.durationMs !== void 0 && typeof
|
|
485
|
+
if (constraints.durationMs !== void 0 && typeof refConstraints.durationMs === "number" && refConstraints.durationMs !== constraints.durationMs) {
|
|
475
486
|
return true;
|
|
476
487
|
}
|
|
477
488
|
return false;
|
|
478
489
|
}
|
|
479
490
|
function refPinsConstraints(ref, constraints) {
|
|
480
|
-
|
|
481
|
-
if (constraints.
|
|
482
|
-
if (constraints.
|
|
491
|
+
const refConstraints = legacyRefParameterConstraints(ref);
|
|
492
|
+
if (constraints.width !== void 0 && refConstraints.width === void 0) return false;
|
|
493
|
+
if (constraints.height !== void 0 && refConstraints.height === void 0) return false;
|
|
494
|
+
if (constraints.durationMs !== void 0 && typeof refConstraints.durationMs !== "number") return false;
|
|
483
495
|
return true;
|
|
484
496
|
}
|
|
485
497
|
function legacyIdPinsDimensions(ref) {
|
|
@@ -489,15 +501,19 @@ function legacyIdPinsDimensions(ref) {
|
|
|
489
501
|
return typeof params.width === "number" || typeof params.height === "number" || typeof params.duration_ms_exact === "number" || Array.isArray(params.sizes);
|
|
490
502
|
}
|
|
491
503
|
function refConstraintKey(ref) {
|
|
492
|
-
|
|
504
|
+
const constraints = legacyRefParameterConstraints(ref);
|
|
505
|
+
return [
|
|
506
|
+
agentIdentity(ref.agent_url),
|
|
507
|
+
constraints.width ?? "",
|
|
508
|
+
constraints.height ?? "",
|
|
509
|
+
constraints.durationMs ?? ""
|
|
510
|
+
].join("|");
|
|
493
511
|
}
|
|
494
512
|
function preferMostConstrainedLegacyCandidates(candidates, creative) {
|
|
495
|
-
if (candidates.length <= 1) return candidates;
|
|
496
513
|
let remaining = candidates;
|
|
497
514
|
const constraints = creativeFormatParameterConstraints(creative);
|
|
498
515
|
if (constraints) {
|
|
499
|
-
|
|
500
|
-
if (compatible.length > 0) remaining = compatible;
|
|
516
|
+
remaining = remaining.filter((candidate) => !refContradictsConstraints(candidate.ref, constraints));
|
|
501
517
|
const pinned = remaining.filter((candidate) => refPinsConstraints(candidate.ref, constraints));
|
|
502
518
|
if (pinned.length > 0) remaining = pinned;
|
|
503
519
|
}
|
|
@@ -43,7 +43,7 @@ export { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalF
|
|
|
43
43
|
export type { V1ToV2Result, V1ToV2ProjectionOptions, BareFormatIdResolveOptions, LegacyFormatConversionContext, LegacyFormatConverter, LegacyFormatResolutionContext, LegacyFormatResolver, } from './v1-to-v2.mjs';
|
|
44
44
|
export { projectV2ProductToV1 } from './v2-to-v1.mjs';
|
|
45
45
|
export type { V2ToV1Result, V2ToV1ProjectionOptions, CanonicalFormatLegacyResolver, CanonicalFormatLegacyResolutionContext, CanonicalProductFormatLegacyResolutionContext, CanonicalCreativeFormatLegacyResolutionContext, CanonicalSelectorFormatLegacyResolutionContext, } from './v2-to-v1.mjs';
|
|
46
|
-
export { canonicalFormatLegacyResolverFromRoutes, legacyRoutesForProduct, type CanonicalFormatLegacyRoute, } from './legacy-routes.mjs';
|
|
46
|
+
export { canonicalFormatLegacyResolverFromRoutes, carryFormatOptionOrigins, legacyRoutesForProduct, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, } from './legacy-routes.mjs';
|
|
47
47
|
export { augmentProductWithFormatOptions, withFormatOptions, toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, type V2AugmentedProduct, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, } from './augment-response.mjs';
|
|
48
48
|
export { CanonicalFormat, audioDaastFormatDeclaration, audioHostedFormatDeclaration, audioVastFormatDeclaration, agentPlacementFormatDeclaration, canonicalFormatDeclaration, customFormatDeclaration, displayTagFormatDeclaration, legacyFormatRef, legacyFormatRefs, html5FormatDeclaration, imageCarouselFormatDeclaration, imageFormatDeclaration, nativeInFeedFormatDeclaration, productCard, productCardDetailed, responsiveCreativeFormatDeclaration, sellerRenderedStatefulDisplayFormatDeclaration, sponsoredPlacementFormatDeclaration, coordinatedPlacementsFormatDeclaration, videoHostedFormatDeclaration, videoVastFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type FormatReferenceInput, type ProductCardDetailedFields, type ProductCardFields, } from './builders.mjs';
|
|
49
49
|
export { packageRefsForFormatOptions, packageRefsForCapabilities, legacyFormatIdsFromOptions, tryLegacyFormatIdsFromOptions, legacyFormatIdsForFormatOption, legacyFormatIdsForCapability, lintPackageFormatSelectorDimensions, FormatOptionRefsLookupError, CapabilityIdsLookupError, type PackageFormatRefs, type PackageCapabilityRefs, type FormatOptionRef, type FormatOptionSelector, type FormatOptionRefsLookupErrorCode, type CapabilityIdsLookupErrorCode, type PackageFormatSelectorInput, type PackageFormatSelectorDimensionOptions, type FixedSizeDimensions, type PackageFormatSelectorDimensionDiagnosticCode, type PackageFormatSelectorDimensionDiagnostic, } from './write-side.mjs';
|
|
@@ -43,7 +43,7 @@ export { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalF
|
|
|
43
43
|
export type { V1ToV2Result, V1ToV2ProjectionOptions, BareFormatIdResolveOptions, LegacyFormatConversionContext, LegacyFormatConverter, LegacyFormatResolutionContext, LegacyFormatResolver, } from './v1-to-v2';
|
|
44
44
|
export { projectV2ProductToV1 } from './v2-to-v1';
|
|
45
45
|
export type { V2ToV1Result, V2ToV1ProjectionOptions, CanonicalFormatLegacyResolver, CanonicalFormatLegacyResolutionContext, CanonicalProductFormatLegacyResolutionContext, CanonicalCreativeFormatLegacyResolutionContext, CanonicalSelectorFormatLegacyResolutionContext, } from './v2-to-v1';
|
|
46
|
-
export { canonicalFormatLegacyResolverFromRoutes, legacyRoutesForProduct, type CanonicalFormatLegacyRoute, } from './legacy-routes';
|
|
46
|
+
export { canonicalFormatLegacyResolverFromRoutes, carryFormatOptionOrigins, legacyRoutesForProduct, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, } from './legacy-routes';
|
|
47
47
|
export { augmentProductWithFormatOptions, withFormatOptions, toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, type V2AugmentedProduct, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, } from './augment-response';
|
|
48
48
|
export { CanonicalFormat, audioDaastFormatDeclaration, audioHostedFormatDeclaration, audioVastFormatDeclaration, agentPlacementFormatDeclaration, canonicalFormatDeclaration, customFormatDeclaration, displayTagFormatDeclaration, legacyFormatRef, legacyFormatRefs, html5FormatDeclaration, imageCarouselFormatDeclaration, imageFormatDeclaration, nativeInFeedFormatDeclaration, productCard, productCardDetailed, responsiveCreativeFormatDeclaration, sellerRenderedStatefulDisplayFormatDeclaration, sponsoredPlacementFormatDeclaration, coordinatedPlacementsFormatDeclaration, videoHostedFormatDeclaration, videoVastFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type FormatReferenceInput, type ProductCardDetailedFields, type ProductCardFields, } from './builders';
|
|
49
49
|
export { packageRefsForFormatOptions, packageRefsForCapabilities, legacyFormatIdsFromOptions, tryLegacyFormatIdsFromOptions, legacyFormatIdsForFormatOption, legacyFormatIdsForCapability, lintPackageFormatSelectorDimensions, FormatOptionRefsLookupError, CapabilityIdsLookupError, type PackageFormatRefs, type PackageCapabilityRefs, type FormatOptionRef, type FormatOptionSelector, type FormatOptionRefsLookupErrorCode, type CapabilityIdsLookupErrorCode, type PackageFormatSelectorInput, type PackageFormatSelectorDimensionOptions, type FixedSizeDimensions, type PackageFormatSelectorDimensionDiagnosticCode, type PackageFormatSelectorDimensionDiagnostic, } from './write-side';
|
|
@@ -33,6 +33,7 @@ __export(projection_exports, {
|
|
|
33
33
|
canonicalFormatDeclaration: () => import_builders.canonicalFormatDeclaration,
|
|
34
34
|
canonicalFormatLegacyResolverFromCatalogSnapshots: () => import_catalog_snapshot.canonicalFormatLegacyResolverFromCatalogSnapshots,
|
|
35
35
|
canonicalFormatLegacyResolverFromRoutes: () => import_legacy_routes.canonicalFormatLegacyResolverFromRoutes,
|
|
36
|
+
carryFormatOptionOrigins: () => import_legacy_routes.carryFormatOptionOrigins,
|
|
36
37
|
coordinatedPlacementsFormatDeclaration: () => import_builders.coordinatedPlacementsFormatDeclaration,
|
|
37
38
|
customFormatDeclaration: () => import_builders.customFormatDeclaration,
|
|
38
39
|
displayTagFormatDeclaration: () => import_builders.displayTagFormatDeclaration,
|
|
@@ -111,6 +112,7 @@ var import_creative_delivery = require('./creative-delivery.js');
|
|
|
111
112
|
canonicalFormatDeclaration,
|
|
112
113
|
canonicalFormatLegacyResolverFromCatalogSnapshots,
|
|
113
114
|
canonicalFormatLegacyResolverFromRoutes,
|
|
115
|
+
carryFormatOptionOrigins,
|
|
114
116
|
coordinatedPlacementsFormatDeclaration,
|
|
115
117
|
customFormatDeclaration,
|
|
116
118
|
displayTagFormatDeclaration,
|
|
@@ -2,6 +2,7 @@ import { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalF
|
|
|
2
2
|
import { projectV2ProductToV1 } from "./v2-to-v1.mjs";
|
|
3
3
|
import {
|
|
4
4
|
canonicalFormatLegacyResolverFromRoutes,
|
|
5
|
+
carryFormatOptionOrigins,
|
|
5
6
|
legacyRoutesForProduct
|
|
6
7
|
} from "./legacy-routes.mjs";
|
|
7
8
|
import {
|
|
@@ -88,6 +89,7 @@ export {
|
|
|
88
89
|
canonicalFormatDeclaration,
|
|
89
90
|
canonicalFormatLegacyResolverFromCatalogSnapshots,
|
|
90
91
|
canonicalFormatLegacyResolverFromRoutes,
|
|
92
|
+
carryFormatOptionOrigins,
|
|
91
93
|
coordinatedPlacementsFormatDeclaration,
|
|
92
94
|
customFormatDeclaration,
|
|
93
95
|
displayTagFormatDeclaration,
|
|
@@ -51,12 +51,44 @@ export type FormatOptionOrigin = {
|
|
|
51
51
|
seller_declared: false;
|
|
52
52
|
selector: UndeclaredFormatOptionSelector;
|
|
53
53
|
};
|
|
54
|
-
/**
|
|
55
|
-
export declare function
|
|
54
|
+
/** Whether two option refs name the same format option. Publisher domains compare case-insensitively. */
|
|
55
|
+
export declare function sameFormatOptionRef(left: FormatOptionReference, right: FormatOptionReference): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Option refs a product declares in its own `format_options[]`, read from the
|
|
58
|
+
* product exactly as the seller returned it. Options the SDK derives from the
|
|
59
|
+
* seller's legacy `format_ids` never appear here.
|
|
60
|
+
*/
|
|
61
|
+
export declare function sellerDeclaredFormatOptionRefs(sellerProduct: unknown): FormatOptionReference[];
|
|
62
|
+
export interface LegacyRoutesForProductOptions {
|
|
63
|
+
/**
|
|
64
|
+
* The product exactly as the seller returned it from `get_products`. When
|
|
65
|
+
* given, an option is seller-declared exactly when this product's own
|
|
66
|
+
* `format_options[]` names it. Use it when the declarations were projected
|
|
67
|
+
* from a stored seller response in a process that never ran discovery, so
|
|
68
|
+
* the SDK holds no origin metadata for them.
|
|
69
|
+
*/
|
|
70
|
+
sellerProduct?: unknown;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Extract persistable routes from canonical declarations, including concealed
|
|
74
|
+
* migration metadata. Pass `sellerProduct` to record each option's origin from
|
|
75
|
+
* the seller's own response instead of that metadata.
|
|
76
|
+
*/
|
|
77
|
+
export declare function legacyRoutesForProduct(productId: string, declarations: readonly V2ProductFormatDeclaration[], options?: LegacyRoutesForProductOptions): CanonicalFormatLegacyRoute[];
|
|
56
78
|
/**
|
|
57
79
|
* The origin a resolver built by {@link canonicalFormatLegacyResolverFromRoutes}
|
|
58
80
|
* recorded for one option. Without a product id, every route for the option
|
|
59
81
|
* must agree that the seller did not declare it.
|
|
60
82
|
*/
|
|
61
83
|
export declare function formatOptionOriginFromRoutes(resolver: CanonicalFormatLegacyResolver | undefined, ref: FormatOptionReference, productId: string | undefined): FormatOptionOrigin | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Make `resolver` report the format-option origins recorded by `sources`.
|
|
86
|
+
*
|
|
87
|
+
* A resolver built by {@link canonicalFormatLegacyResolverFromRoutes} carries
|
|
88
|
+
* each route's `seller_declared` origin, which `AgentClient` reads to rewrite
|
|
89
|
+
* options the seller never declared on the canonical wire. A resolver that
|
|
90
|
+
* wraps or composes it is a new function and would otherwise carry none.
|
|
91
|
+
* Returns `resolver` itself, so the call can wrap a composition inline.
|
|
92
|
+
*/
|
|
93
|
+
export declare function carryFormatOptionOrigins(resolver: CanonicalFormatLegacyResolver, ...sources: ReadonlyArray<CanonicalFormatLegacyResolver | undefined>): CanonicalFormatLegacyResolver;
|
|
62
94
|
export declare function canonicalFormatLegacyResolverFromRoutes(routes: readonly CanonicalFormatLegacyRoute[]): CanonicalFormatLegacyResolver;
|
|
@@ -51,12 +51,44 @@ export type FormatOptionOrigin = {
|
|
|
51
51
|
seller_declared: false;
|
|
52
52
|
selector: UndeclaredFormatOptionSelector;
|
|
53
53
|
};
|
|
54
|
-
/**
|
|
55
|
-
export declare function
|
|
54
|
+
/** Whether two option refs name the same format option. Publisher domains compare case-insensitively. */
|
|
55
|
+
export declare function sameFormatOptionRef(left: FormatOptionReference, right: FormatOptionReference): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Option refs a product declares in its own `format_options[]`, read from the
|
|
58
|
+
* product exactly as the seller returned it. Options the SDK derives from the
|
|
59
|
+
* seller's legacy `format_ids` never appear here.
|
|
60
|
+
*/
|
|
61
|
+
export declare function sellerDeclaredFormatOptionRefs(sellerProduct: unknown): FormatOptionReference[];
|
|
62
|
+
export interface LegacyRoutesForProductOptions {
|
|
63
|
+
/**
|
|
64
|
+
* The product exactly as the seller returned it from `get_products`. When
|
|
65
|
+
* given, an option is seller-declared exactly when this product's own
|
|
66
|
+
* `format_options[]` names it. Use it when the declarations were projected
|
|
67
|
+
* from a stored seller response in a process that never ran discovery, so
|
|
68
|
+
* the SDK holds no origin metadata for them.
|
|
69
|
+
*/
|
|
70
|
+
sellerProduct?: unknown;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Extract persistable routes from canonical declarations, including concealed
|
|
74
|
+
* migration metadata. Pass `sellerProduct` to record each option's origin from
|
|
75
|
+
* the seller's own response instead of that metadata.
|
|
76
|
+
*/
|
|
77
|
+
export declare function legacyRoutesForProduct(productId: string, declarations: readonly V2ProductFormatDeclaration[], options?: LegacyRoutesForProductOptions): CanonicalFormatLegacyRoute[];
|
|
56
78
|
/**
|
|
57
79
|
* The origin a resolver built by {@link canonicalFormatLegacyResolverFromRoutes}
|
|
58
80
|
* recorded for one option. Without a product id, every route for the option
|
|
59
81
|
* must agree that the seller did not declare it.
|
|
60
82
|
*/
|
|
61
83
|
export declare function formatOptionOriginFromRoutes(resolver: CanonicalFormatLegacyResolver | undefined, ref: FormatOptionReference, productId: string | undefined): FormatOptionOrigin | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Make `resolver` report the format-option origins recorded by `sources`.
|
|
86
|
+
*
|
|
87
|
+
* A resolver built by {@link canonicalFormatLegacyResolverFromRoutes} carries
|
|
88
|
+
* each route's `seller_declared` origin, which `AgentClient` reads to rewrite
|
|
89
|
+
* options the seller never declared on the canonical wire. A resolver that
|
|
90
|
+
* wraps or composes it is a new function and would otherwise carry none.
|
|
91
|
+
* Returns `resolver` itself, so the call can wrap a composition inline.
|
|
92
|
+
*/
|
|
93
|
+
export declare function carryFormatOptionOrigins(resolver: CanonicalFormatLegacyResolver, ...sources: ReadonlyArray<CanonicalFormatLegacyResolver | undefined>): CanonicalFormatLegacyResolver;
|
|
62
94
|
export declare function canonicalFormatLegacyResolverFromRoutes(routes: readonly CanonicalFormatLegacyRoute[]): CanonicalFormatLegacyResolver;
|
|
@@ -19,8 +19,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var legacy_routes_exports = {};
|
|
20
20
|
__export(legacy_routes_exports, {
|
|
21
21
|
canonicalFormatLegacyResolverFromRoutes: () => canonicalFormatLegacyResolverFromRoutes,
|
|
22
|
+
carryFormatOptionOrigins: () => carryFormatOptionOrigins,
|
|
22
23
|
formatOptionOriginFromRoutes: () => formatOptionOriginFromRoutes,
|
|
23
24
|
legacyRoutesForProduct: () => legacyRoutesForProduct,
|
|
25
|
+
sameFormatOptionRef: () => sameFormatOptionRef,
|
|
26
|
+
sellerDeclaredFormatOptionRefs: () => sellerDeclaredFormatOptionRefs,
|
|
24
27
|
undeclaredFormatOptionSelector: () => undeclaredFormatOptionSelector
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(legacy_routes_exports);
|
|
@@ -62,6 +65,27 @@ function routeRef(value) {
|
|
|
62
65
|
if (record.scope !== void 0 && record.scope !== "product") return void 0;
|
|
63
66
|
return { scope: "product", format_option_id: record.format_option_id };
|
|
64
67
|
}
|
|
68
|
+
function sameFormatOptionRef(left, right) {
|
|
69
|
+
return left.scope === right.scope && left.format_option_id === right.format_option_id && (left.scope !== "publisher" || right.scope === "publisher" && left.publisher_domain.toLowerCase() === right.publisher_domain.toLowerCase());
|
|
70
|
+
}
|
|
71
|
+
function sellerDeclaredFormatOptionRefs(sellerProduct) {
|
|
72
|
+
if (!sellerProduct || typeof sellerProduct !== "object" || Array.isArray(sellerProduct)) return [];
|
|
73
|
+
const options = sellerProduct.format_options;
|
|
74
|
+
const refs = [];
|
|
75
|
+
for (const optionValue of Array.isArray(options) ? options : []) {
|
|
76
|
+
if (!optionValue || typeof optionValue !== "object" || Array.isArray(optionValue)) continue;
|
|
77
|
+
const option = optionValue;
|
|
78
|
+
if (typeof option.format_option_id !== "string") continue;
|
|
79
|
+
refs.push(
|
|
80
|
+
typeof option.publisher_domain === "string" ? {
|
|
81
|
+
scope: "publisher",
|
|
82
|
+
publisher_domain: option.publisher_domain,
|
|
83
|
+
format_option_id: option.format_option_id
|
|
84
|
+
} : { scope: "product", format_option_id: option.format_option_id }
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
return refs;
|
|
88
|
+
}
|
|
65
89
|
function routeKey(productId, ref) {
|
|
66
90
|
return JSON.stringify([
|
|
67
91
|
productId,
|
|
@@ -89,12 +113,13 @@ function uniqueFormatIds(refs) {
|
|
|
89
113
|
).values()
|
|
90
114
|
];
|
|
91
115
|
}
|
|
92
|
-
function legacyRoutesForProduct(productId, declarations) {
|
|
116
|
+
function legacyRoutesForProduct(productId, declarations, options = {}) {
|
|
117
|
+
const declaredRefs = options.sellerProduct === void 0 ? void 0 : sellerDeclaredFormatOptionRefs(options.sellerProduct);
|
|
93
118
|
return declarations.flatMap((declaration) => {
|
|
94
119
|
const formatOptionRef = routeRef(declaration);
|
|
95
120
|
const formatIds = uniqueFormatIds((0, import_legacy_metadata.legacyFormatRefsForDeclaration)(declaration));
|
|
96
121
|
if (!formatOptionRef || formatIds.length === 0) return [];
|
|
97
|
-
const declared = (0, import_legacy_metadata.sellerDeclaredFormatOption)(declaration);
|
|
122
|
+
const declared = declaredRefs ? declaredRefs.some((ref) => sameFormatOptionRef(ref, formatOptionRef)) : (0, import_legacy_metadata.sellerDeclaredFormatOption)(declaration);
|
|
98
123
|
const selector = declared === false ? undeclaredFormatOptionSelector(declaration) : void 0;
|
|
99
124
|
return [
|
|
100
125
|
{
|
|
@@ -180,6 +205,11 @@ function formatOptionOriginFromRoutes(resolver, ref, productId) {
|
|
|
180
205
|
if (matching.some((entry) => entry.origin === void 0)) return void 0;
|
|
181
206
|
return matching[0].origin;
|
|
182
207
|
}
|
|
208
|
+
function carryFormatOptionOrigins(resolver, ...sources) {
|
|
209
|
+
const carried = [resolver, ...sources].flatMap((source) => source ? originsByResolver.get(source) ?? [] : []);
|
|
210
|
+
if (carried.length > 0) originsByResolver.set(resolver, Object.freeze(carried));
|
|
211
|
+
return resolver;
|
|
212
|
+
}
|
|
183
213
|
function canonicalFormatLegacyResolverFromRoutes(routes) {
|
|
184
214
|
const index = /* @__PURE__ */ new Map();
|
|
185
215
|
const origins = [];
|
|
@@ -213,7 +243,10 @@ function canonicalFormatLegacyResolverFromRoutes(routes) {
|
|
|
213
243
|
// Annotate the CommonJS export names for ESM import in node:
|
|
214
244
|
0 && (module.exports = {
|
|
215
245
|
canonicalFormatLegacyResolverFromRoutes,
|
|
246
|
+
carryFormatOptionOrigins,
|
|
216
247
|
formatOptionOriginFromRoutes,
|
|
217
248
|
legacyRoutesForProduct,
|
|
249
|
+
sameFormatOptionRef,
|
|
250
|
+
sellerDeclaredFormatOptionRefs,
|
|
218
251
|
undeclaredFormatOptionSelector
|
|
219
252
|
});
|
|
@@ -36,6 +36,27 @@ function routeRef(value) {
|
|
|
36
36
|
if (record.scope !== void 0 && record.scope !== "product") return void 0;
|
|
37
37
|
return { scope: "product", format_option_id: record.format_option_id };
|
|
38
38
|
}
|
|
39
|
+
function sameFormatOptionRef(left, right) {
|
|
40
|
+
return left.scope === right.scope && left.format_option_id === right.format_option_id && (left.scope !== "publisher" || right.scope === "publisher" && left.publisher_domain.toLowerCase() === right.publisher_domain.toLowerCase());
|
|
41
|
+
}
|
|
42
|
+
function sellerDeclaredFormatOptionRefs(sellerProduct) {
|
|
43
|
+
if (!sellerProduct || typeof sellerProduct !== "object" || Array.isArray(sellerProduct)) return [];
|
|
44
|
+
const options = sellerProduct.format_options;
|
|
45
|
+
const refs = [];
|
|
46
|
+
for (const optionValue of Array.isArray(options) ? options : []) {
|
|
47
|
+
if (!optionValue || typeof optionValue !== "object" || Array.isArray(optionValue)) continue;
|
|
48
|
+
const option = optionValue;
|
|
49
|
+
if (typeof option.format_option_id !== "string") continue;
|
|
50
|
+
refs.push(
|
|
51
|
+
typeof option.publisher_domain === "string" ? {
|
|
52
|
+
scope: "publisher",
|
|
53
|
+
publisher_domain: option.publisher_domain,
|
|
54
|
+
format_option_id: option.format_option_id
|
|
55
|
+
} : { scope: "product", format_option_id: option.format_option_id }
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return refs;
|
|
59
|
+
}
|
|
39
60
|
function routeKey(productId, ref) {
|
|
40
61
|
return JSON.stringify([
|
|
41
62
|
productId,
|
|
@@ -63,12 +84,13 @@ function uniqueFormatIds(refs) {
|
|
|
63
84
|
).values()
|
|
64
85
|
];
|
|
65
86
|
}
|
|
66
|
-
function legacyRoutesForProduct(productId, declarations) {
|
|
87
|
+
function legacyRoutesForProduct(productId, declarations, options = {}) {
|
|
88
|
+
const declaredRefs = options.sellerProduct === void 0 ? void 0 : sellerDeclaredFormatOptionRefs(options.sellerProduct);
|
|
67
89
|
return declarations.flatMap((declaration) => {
|
|
68
90
|
const formatOptionRef = routeRef(declaration);
|
|
69
91
|
const formatIds = uniqueFormatIds(legacyFormatRefsForDeclaration(declaration));
|
|
70
92
|
if (!formatOptionRef || formatIds.length === 0) return [];
|
|
71
|
-
const declared = sellerDeclaredFormatOption(declaration);
|
|
93
|
+
const declared = declaredRefs ? declaredRefs.some((ref) => sameFormatOptionRef(ref, formatOptionRef)) : sellerDeclaredFormatOption(declaration);
|
|
72
94
|
const selector = declared === false ? undeclaredFormatOptionSelector(declaration) : void 0;
|
|
73
95
|
return [
|
|
74
96
|
{
|
|
@@ -154,6 +176,11 @@ function formatOptionOriginFromRoutes(resolver, ref, productId) {
|
|
|
154
176
|
if (matching.some((entry) => entry.origin === void 0)) return void 0;
|
|
155
177
|
return matching[0].origin;
|
|
156
178
|
}
|
|
179
|
+
function carryFormatOptionOrigins(resolver, ...sources) {
|
|
180
|
+
const carried = [resolver, ...sources].flatMap((source) => source ? originsByResolver.get(source) ?? [] : []);
|
|
181
|
+
if (carried.length > 0) originsByResolver.set(resolver, Object.freeze(carried));
|
|
182
|
+
return resolver;
|
|
183
|
+
}
|
|
157
184
|
function canonicalFormatLegacyResolverFromRoutes(routes) {
|
|
158
185
|
const index = /* @__PURE__ */ new Map();
|
|
159
186
|
const origins = [];
|
|
@@ -186,7 +213,10 @@ function canonicalFormatLegacyResolverFromRoutes(routes) {
|
|
|
186
213
|
}
|
|
187
214
|
export {
|
|
188
215
|
canonicalFormatLegacyResolverFromRoutes,
|
|
216
|
+
carryFormatOptionOrigins,
|
|
189
217
|
formatOptionOriginFromRoutes,
|
|
190
218
|
legacyRoutesForProduct,
|
|
219
|
+
sameFormatOptionRef,
|
|
220
|
+
sellerDeclaredFormatOptionRefs,
|
|
191
221
|
undeclaredFormatOptionSelector
|
|
192
222
|
};
|