@adcp/sdk 14.1.0 → 14.3.0
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/dist/lib/core/SingleAgentClient.d.mts +4 -1
- package/dist/lib/core/SingleAgentClient.d.ts +4 -1
- package/dist/lib/core/SingleAgentClient.js +25 -4
- package/dist/lib/core/SingleAgentClient.mjs +25 -4
- package/dist/lib/core/TaskExecutor.d.mts +3 -1
- package/dist/lib/core/TaskExecutor.d.ts +3 -1
- package/dist/lib/core/TaskExecutor.js +15 -11
- package/dist/lib/core/TaskExecutor.mjs +15 -11
- package/dist/lib/core/buyer-account-registry.d.mts +30 -2
- package/dist/lib/core/buyer-account-registry.d.ts +30 -2
- package/dist/lib/core/buyer-account-registry.js +126 -42
- package/dist/lib/core/buyer-account-registry.mjs +127 -43
- package/dist/lib/index.d.mts +3 -2
- package/dist/lib/index.d.ts +3 -2
- package/dist/lib/index.js +9 -0
- package/dist/lib/index.mjs +12 -1
- package/dist/lib/net/agent-transport-fetch.d.mts +4 -0
- package/dist/lib/net/agent-transport-fetch.d.ts +4 -0
- package/dist/lib/net/agent-transport-fetch.js +18 -5
- package/dist/lib/net/agent-transport-fetch.mjs +17 -5
- package/dist/lib/reporting/inspection.d.mts +3 -3
- package/dist/lib/reporting/inspection.d.ts +3 -3
- package/dist/lib/reporting/inspection.js +229 -84
- package/dist/lib/reporting/inspection.mjs +229 -84
- package/dist/lib/reporting/ledger/status-ingest.js +3 -19
- package/dist/lib/reporting/ledger/status-ingest.mjs +2 -18
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.js +5 -2
- package/dist/lib/server/create-adcp-server.mjs +5 -2
- package/dist/lib/signing/agent-resolver/errors.d.mts +2 -0
- package/dist/lib/signing/agent-resolver/errors.d.ts +2 -0
- package/dist/lib/signing/agent-resolver/errors.js +6 -0
- package/dist/lib/signing/agent-resolver/errors.mjs +6 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.mts +9 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +9 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.js +35 -1
- package/dist/lib/signing/agent-resolver/fetch-helpers.mjs +38 -2
- package/dist/lib/signing/agent-resolver/legacy-brand.js +1 -1
- package/dist/lib/signing/agent-resolver/legacy-brand.mjs +2 -2
- package/dist/lib/signing/agent-resolver/resolve-agent.d.mts +1 -1
- package/dist/lib/signing/agent-resolver/resolve-agent.d.ts +1 -1
- package/dist/lib/signing/agent-resolver/resolve-agent.js +47 -5
- package/dist/lib/signing/agent-resolver/resolve-agent.mjs +55 -6
- package/dist/lib/signing/brand-jwks.d.mts +2 -0
- package/dist/lib/signing/brand-jwks.d.ts +2 -0
- package/dist/lib/signing/brand-jwks.js +10 -2
- package/dist/lib/signing/brand-jwks.mjs +10 -2
- package/dist/lib/signing/canonicalize.d.mts +2 -0
- package/dist/lib/signing/canonicalize.d.ts +2 -0
- package/dist/lib/signing/canonicalize.js +1 -1
- package/dist/lib/signing/canonicalize.mjs +1 -1
- package/dist/lib/signing/errors.d.mts +4 -2
- package/dist/lib/signing/errors.d.ts +4 -2
- package/dist/lib/signing/errors.js +3 -1
- package/dist/lib/signing/errors.mjs +3 -1
- package/dist/lib/signing/verifier.js +2 -2
- package/dist/lib/signing/verifier.mjs +2 -2
- package/dist/lib/signing/webhook-verifier.js +2 -2
- package/dist/lib/signing/webhook-verifier.mjs +3 -3
- package/dist/lib/testing/storyboard/request-signing/builder.js +13 -1
- package/dist/lib/testing/storyboard/request-signing/builder.mjs +13 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +1 -0
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +1 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/types/accept-proposal.d.ts +19 -1
- package/dist/lib/types/buy-products.d.ts +19 -1
- package/dist/lib/types/check-governance.d.ts +19 -1
- package/dist/lib/types/comply-test-controller.d.ts +19 -1
- package/dist/lib/types/control-media-buy.d.ts +19 -1
- package/dist/lib/types/core.generated.d.mts +14 -1
- package/dist/lib/types/core.generated.d.ts +14 -1
- package/dist/lib/types/create-media-buy.d.ts +14 -1
- package/dist/lib/types/get-media-buys.d.ts +14 -1
- package/dist/lib/types/get-products.d.ts +19 -1
- package/dist/lib/types/list-products.d.ts +19 -1
- package/dist/lib/types/refine-proposals.d.ts +19 -1
- package/dist/lib/types/request-proposals.d.ts +19 -1
- package/dist/lib/types/schemas.generated.d.ts +12 -3
- package/dist/lib/types/schemas.generated.js +4 -1
- package/dist/lib/types/schemas.generated.mjs +4 -1
- package/dist/lib/types/tools.generated.d.mts +14 -1
- package/dist/lib/types/tools.generated.d.ts +14 -1
- package/dist/lib/types/update-media-buy.d.ts +14 -1
- package/dist/lib/utils/pointer-utils.d.mts +2 -0
- package/dist/lib/utils/pointer-utils.d.ts +2 -0
- package/dist/lib/utils/pointer-utils.js +43 -0
- package/dist/lib/utils/pointer-utils.mjs +19 -0
- package/dist/lib/validation/diagnostic-limits.d.mts +4 -0
- package/dist/lib/validation/diagnostic-limits.d.ts +4 -0
- package/dist/lib/validation/diagnostic-limits.js +57 -0
- package/dist/lib/validation/diagnostic-limits.mjs +32 -0
- package/dist/lib/validation/schema-errors.d.mts +3 -1
- package/dist/lib/validation/schema-errors.d.ts +3 -1
- package/dist/lib/validation/schema-errors.js +18 -3
- package/dist/lib/validation/schema-errors.mjs +18 -3
- package/dist/lib/validation/schema-validator.js +56 -4
- package/dist/lib/validation/schema-validator.mjs +56 -4
- 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/dist/lib/webhooks/index.d.mts +24 -0
- package/dist/lib/webhooks/index.d.ts +24 -0
- package/dist/lib/webhooks/index.js +50 -24
- package/dist/lib/webhooks/index.mjs +49 -24
- package/dist/lib/wholesale-feed-sync/index.d.mts +2 -0
- package/dist/lib/wholesale-feed-sync/index.d.ts +2 -0
- package/dist/lib/wholesale-feed-sync/index.js +7 -0
- package/dist/lib/wholesale-feed-sync/index.mjs +4 -0
- package/dist/lib/wholesale-feed-sync/mirror.d.mts +97 -0
- package/dist/lib/wholesale-feed-sync/mirror.d.ts +97 -0
- package/dist/lib/wholesale-feed-sync/mirror.js +350 -0
- package/dist/lib/wholesale-feed-sync/mirror.mjs +322 -0
- package/dist/lib/wholesale-feed-sync/sync.d.mts +12 -29
- package/dist/lib/wholesale-feed-sync/sync.d.ts +12 -29
- package/dist/lib/wholesale-feed-sync/sync.js +153 -297
- package/dist/lib/wholesale-feed-sync/sync.mjs +158 -297
- package/docs/README.md +6 -0
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/BUYER-STORAGE.md +3 -0
- package/docs/guides/FIRST-CALL-TO-A-SELLER.md +3 -1
- package/docs/guides/account-resolution.md +46 -10
- package/docs/llms.txt +2 -2
- package/docs/migration-14.0-to-14.1.md +85 -0
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-agent-resolution-3.3.md +5 -3
- package/docs/recipes/verifying-inbound-webhooks.md +4 -0
- package/package.json +3 -2
- package/skills/call-adcp-agent/SKILL.md +4 -1
- package/skills/adcp-brand.previous/SKILL.md +0 -200
- package/skills/adcp-creative.previous/SKILL.md +0 -305
- package/skills/adcp-governance.previous/SKILL.md +0 -566
- package/skills/adcp-measurement.previous/SKILL.md +0 -136
- package/skills/adcp-media-buy.previous/SKILL.md +0 -556
- package/skills/adcp-si.previous/SKILL.md +0 -206
- package/skills/adcp-signals.previous/SKILL.md +0 -204
|
@@ -519,6 +519,11 @@ export interface AdInventoryConfiguration {
|
|
|
519
519
|
*/
|
|
520
520
|
export type AdvertiserIndustry = 'automotive' | 'automotive.electric_vehicles' | 'automotive.parts_accessories' | 'automotive.luxury' | 'beauty_cosmetics' | 'beauty_cosmetics.skincare' | 'beauty_cosmetics.fragrance' | 'beauty_cosmetics.haircare' | 'cannabis' | 'cpg' | 'cpg.personal_care' | 'cpg.household' | 'dating' | 'education' | 'education.higher_education' | 'education.online_learning' | 'education.k12' | 'energy_utilities' | 'energy_utilities.renewable' | 'fashion_apparel' | 'fashion_apparel.luxury' | 'fashion_apparel.sportswear' | 'finance' | 'finance.banking' | 'finance.insurance' | 'finance.investment' | 'finance.cryptocurrency' | 'food_beverage' | 'food_beverage.alcohol' | 'food_beverage.restaurants' | 'food_beverage.packaged_goods' | 'gambling_betting' | 'gambling_betting.sports_betting' | 'gambling_betting.casino' | 'gaming' | 'gaming.mobile' | 'gaming.console_pc' | 'gaming.esports' | 'government_nonprofit' | 'government_nonprofit.political' | 'government_nonprofit.charity' | 'healthcare' | 'healthcare.pharmaceutical' | 'healthcare.medical_devices' | 'healthcare.wellness' | 'home_garden' | 'home_garden.furniture' | 'home_garden.home_improvement' | 'media_entertainment' | 'media_entertainment.podcasts' | 'media_entertainment.music' | 'media_entertainment.film_tv' | 'media_entertainment.publishing' | 'media_entertainment.live_events' | 'pets' | 'professional_services' | 'professional_services.legal' | 'professional_services.consulting' | 'real_estate' | 'real_estate.residential' | 'real_estate.commercial' | 'recruitment_hr' | 'retail' | 'retail.ecommerce' | 'retail.department_stores' | 'sports_fitness' | 'sports_fitness.equipment' | 'sports_fitness.teams_leagues' | 'technology' | 'technology.software' | 'technology.hardware' | 'technology.ai_ml' | 'telecom' | 'telecom.mobile_carriers' | 'telecom.internet_providers' | 'transportation_logistics' | 'travel_hospitality' | 'travel_hospitality.airlines' | 'travel_hospitality.hotels' | 'travel_hospitality.cruise' | 'travel_hospitality.tourism';
|
|
521
521
|
|
|
522
|
+
/**
|
|
523
|
+
* User-level bases that may resolve age for demographic targeting execution. Population estimates are deliberately absent because aggregate composition cannot establish an individual impression's age.
|
|
524
|
+
*/
|
|
525
|
+
export type AgeDeterminationBasis = 'verified' | 'declared' | 'inferred';
|
|
526
|
+
|
|
522
527
|
/**
|
|
523
528
|
* Methods for verifying user age for compliance. Does not include 'inferred' as it is not accepted for regulatory compliance.
|
|
524
529
|
*/
|
|
@@ -5662,7 +5667,20 @@ export interface DemographicTargetingCapability {
|
|
|
5662
5667
|
* Canonical demographic audience targeting intent with optional constraints on how age may be determined. This is distinct from age_restriction: demographics selects an audience, while age_restriction expresses a legal eligibility or verification floor. Fresh create/update targeting MUST compile exactly or be rejected. During get_products, a seller may offer a different configured predicate only through sparse targeting_resolution modifications on a distinguishable product_id; selecting that product accepts the alternative. Sellers never silently broaden, narrow, default, drop, or substitute the basis.
|
|
5663
5668
|
*/
|
|
5664
5669
|
export interface DemographicTargetingIntent {
|
|
5665
|
-
age: DemographicAgeRange & {
|
|
5670
|
+
age: DemographicAgeRange & {
|
|
5671
|
+
/**
|
|
5672
|
+
* User-level age determination bases the buyer permits for this predicate. Sellers MUST use only these bases or reject the request; they MUST NOT silently fall back to another basis. When omitted, the buyer imposes no determination-basis constraint beyond product capability and any age_restriction. population_estimate is structurally unavailable because aggregate evidence cannot identify an eligible user.
|
|
5673
|
+
*
|
|
5674
|
+
* @minItems 1
|
|
5675
|
+
*/
|
|
5676
|
+
accepted_bases?: [AgeDeterminationBasis, ...AgeDeterminationBasis[]];
|
|
5677
|
+
/**
|
|
5678
|
+
* Verification methods acceptable when verified is an accepted basis. This field narrows verified demographic execution; age_restriction.accepted_methods independently governs legal eligibility and the two sets are intersected when both are present.
|
|
5679
|
+
*
|
|
5680
|
+
* @minItems 1
|
|
5681
|
+
*/
|
|
5682
|
+
accepted_verification_methods?: [AgeVerificationMethod, ...AgeVerificationMethod[]];
|
|
5683
|
+
};
|
|
5666
5684
|
}
|
|
5667
5685
|
|
|
5668
5686
|
/**
|
|
@@ -258,6 +258,11 @@ export type ActivationKey = {
|
|
|
258
258
|
*/
|
|
259
259
|
export type AdvertiserIndustry = 'automotive' | 'automotive.electric_vehicles' | 'automotive.parts_accessories' | 'automotive.luxury' | 'beauty_cosmetics' | 'beauty_cosmetics.skincare' | 'beauty_cosmetics.fragrance' | 'beauty_cosmetics.haircare' | 'cannabis' | 'cpg' | 'cpg.personal_care' | 'cpg.household' | 'dating' | 'education' | 'education.higher_education' | 'education.online_learning' | 'education.k12' | 'energy_utilities' | 'energy_utilities.renewable' | 'fashion_apparel' | 'fashion_apparel.luxury' | 'fashion_apparel.sportswear' | 'finance' | 'finance.banking' | 'finance.insurance' | 'finance.investment' | 'finance.cryptocurrency' | 'food_beverage' | 'food_beverage.alcohol' | 'food_beverage.restaurants' | 'food_beverage.packaged_goods' | 'gambling_betting' | 'gambling_betting.sports_betting' | 'gambling_betting.casino' | 'gaming' | 'gaming.mobile' | 'gaming.console_pc' | 'gaming.esports' | 'government_nonprofit' | 'government_nonprofit.political' | 'government_nonprofit.charity' | 'healthcare' | 'healthcare.pharmaceutical' | 'healthcare.medical_devices' | 'healthcare.wellness' | 'home_garden' | 'home_garden.furniture' | 'home_garden.home_improvement' | 'media_entertainment' | 'media_entertainment.podcasts' | 'media_entertainment.music' | 'media_entertainment.film_tv' | 'media_entertainment.publishing' | 'media_entertainment.live_events' | 'pets' | 'professional_services' | 'professional_services.legal' | 'professional_services.consulting' | 'real_estate' | 'real_estate.residential' | 'real_estate.commercial' | 'recruitment_hr' | 'retail' | 'retail.ecommerce' | 'retail.department_stores' | 'sports_fitness' | 'sports_fitness.equipment' | 'sports_fitness.teams_leagues' | 'technology' | 'technology.software' | 'technology.hardware' | 'technology.ai_ml' | 'telecom' | 'telecom.mobile_carriers' | 'telecom.internet_providers' | 'transportation_logistics' | 'travel_hospitality' | 'travel_hospitality.airlines' | 'travel_hospitality.hotels' | 'travel_hospitality.cruise' | 'travel_hospitality.tourism';
|
|
260
260
|
|
|
261
|
+
/**
|
|
262
|
+
* User-level bases that may resolve age for demographic targeting execution. Population estimates are deliberately absent because aggregate composition cannot establish an individual impression's age.
|
|
263
|
+
*/
|
|
264
|
+
export type AgeDeterminationBasis = 'verified' | 'declared' | 'inferred';
|
|
265
|
+
|
|
261
266
|
/**
|
|
262
267
|
* Methods for verifying user age for compliance. Does not include 'inferred' as it is not accepted for regulatory compliance.
|
|
263
268
|
*/
|
|
@@ -1379,7 +1384,20 @@ export interface DemographicTargetingCapability {
|
|
|
1379
1384
|
* Canonical demographic audience targeting intent with optional constraints on how age may be determined. This is distinct from age_restriction: demographics selects an audience, while age_restriction expresses a legal eligibility or verification floor. Fresh create/update targeting MUST compile exactly or be rejected. During get_products, a seller may offer a different configured predicate only through sparse targeting_resolution modifications on a distinguishable product_id; selecting that product accepts the alternative. Sellers never silently broaden, narrow, default, drop, or substitute the basis.
|
|
1380
1385
|
*/
|
|
1381
1386
|
export interface DemographicTargetingIntent {
|
|
1382
|
-
age: DemographicAgeRange & {
|
|
1387
|
+
age: DemographicAgeRange & {
|
|
1388
|
+
/**
|
|
1389
|
+
* User-level age determination bases the buyer permits for this predicate. Sellers MUST use only these bases or reject the request; they MUST NOT silently fall back to another basis. When omitted, the buyer imposes no determination-basis constraint beyond product capability and any age_restriction. population_estimate is structurally unavailable because aggregate evidence cannot identify an eligible user.
|
|
1390
|
+
*
|
|
1391
|
+
* @minItems 1
|
|
1392
|
+
*/
|
|
1393
|
+
accepted_bases?: [AgeDeterminationBasis, ...AgeDeterminationBasis[]];
|
|
1394
|
+
/**
|
|
1395
|
+
* Verification methods acceptable when verified is an accepted basis. This field narrows verified demographic execution; age_restriction.accepted_methods independently governs legal eligibility and the two sets are intersected when both are present.
|
|
1396
|
+
*
|
|
1397
|
+
* @minItems 1
|
|
1398
|
+
*/
|
|
1399
|
+
accepted_verification_methods?: [AgeVerificationMethod, ...AgeVerificationMethod[]];
|
|
1400
|
+
};
|
|
1383
1401
|
}
|
|
1384
1402
|
|
|
1385
1403
|
/**
|
|
@@ -408,6 +408,11 @@ export type ActivationKey = {
|
|
|
408
408
|
*/
|
|
409
409
|
export type AdvertiserIndustry = 'automotive' | 'automotive.electric_vehicles' | 'automotive.parts_accessories' | 'automotive.luxury' | 'beauty_cosmetics' | 'beauty_cosmetics.skincare' | 'beauty_cosmetics.fragrance' | 'beauty_cosmetics.haircare' | 'cannabis' | 'cpg' | 'cpg.personal_care' | 'cpg.household' | 'dating' | 'education' | 'education.higher_education' | 'education.online_learning' | 'education.k12' | 'energy_utilities' | 'energy_utilities.renewable' | 'fashion_apparel' | 'fashion_apparel.luxury' | 'fashion_apparel.sportswear' | 'finance' | 'finance.banking' | 'finance.insurance' | 'finance.investment' | 'finance.cryptocurrency' | 'food_beverage' | 'food_beverage.alcohol' | 'food_beverage.restaurants' | 'food_beverage.packaged_goods' | 'gambling_betting' | 'gambling_betting.sports_betting' | 'gambling_betting.casino' | 'gaming' | 'gaming.mobile' | 'gaming.console_pc' | 'gaming.esports' | 'government_nonprofit' | 'government_nonprofit.political' | 'government_nonprofit.charity' | 'healthcare' | 'healthcare.pharmaceutical' | 'healthcare.medical_devices' | 'healthcare.wellness' | 'home_garden' | 'home_garden.furniture' | 'home_garden.home_improvement' | 'media_entertainment' | 'media_entertainment.podcasts' | 'media_entertainment.music' | 'media_entertainment.film_tv' | 'media_entertainment.publishing' | 'media_entertainment.live_events' | 'pets' | 'professional_services' | 'professional_services.legal' | 'professional_services.consulting' | 'real_estate' | 'real_estate.residential' | 'real_estate.commercial' | 'recruitment_hr' | 'retail' | 'retail.ecommerce' | 'retail.department_stores' | 'sports_fitness' | 'sports_fitness.equipment' | 'sports_fitness.teams_leagues' | 'technology' | 'technology.software' | 'technology.hardware' | 'technology.ai_ml' | 'telecom' | 'telecom.mobile_carriers' | 'telecom.internet_providers' | 'transportation_logistics' | 'travel_hospitality' | 'travel_hospitality.airlines' | 'travel_hospitality.hotels' | 'travel_hospitality.cruise' | 'travel_hospitality.tourism';
|
|
410
410
|
|
|
411
|
+
/**
|
|
412
|
+
* User-level bases that may resolve age for demographic targeting execution. Population estimates are deliberately absent because aggregate composition cannot establish an individual impression's age.
|
|
413
|
+
*/
|
|
414
|
+
export type AgeDeterminationBasis = 'verified' | 'declared' | 'inferred';
|
|
415
|
+
|
|
411
416
|
/**
|
|
412
417
|
* Methods for verifying user age for compliance. Does not include 'inferred' as it is not accepted for regulatory compliance.
|
|
413
418
|
*/
|
|
@@ -1987,7 +1992,20 @@ export interface DemographicTargetingCapability {
|
|
|
1987
1992
|
* Canonical demographic audience targeting intent with optional constraints on how age may be determined. This is distinct from age_restriction: demographics selects an audience, while age_restriction expresses a legal eligibility or verification floor. Fresh create/update targeting MUST compile exactly or be rejected. During get_products, a seller may offer a different configured predicate only through sparse targeting_resolution modifications on a distinguishable product_id; selecting that product accepts the alternative. Sellers never silently broaden, narrow, default, drop, or substitute the basis.
|
|
1988
1993
|
*/
|
|
1989
1994
|
export interface DemographicTargetingIntent {
|
|
1990
|
-
age: DemographicAgeRange & {
|
|
1995
|
+
age: DemographicAgeRange & {
|
|
1996
|
+
/**
|
|
1997
|
+
* User-level age determination bases the buyer permits for this predicate. Sellers MUST use only these bases or reject the request; they MUST NOT silently fall back to another basis. When omitted, the buyer imposes no determination-basis constraint beyond product capability and any age_restriction. population_estimate is structurally unavailable because aggregate evidence cannot identify an eligible user.
|
|
1998
|
+
*
|
|
1999
|
+
* @minItems 1
|
|
2000
|
+
*/
|
|
2001
|
+
accepted_bases?: [AgeDeterminationBasis, ...AgeDeterminationBasis[]];
|
|
2002
|
+
/**
|
|
2003
|
+
* Verification methods acceptable when verified is an accepted basis. This field narrows verified demographic execution; age_restriction.accepted_methods independently governs legal eligibility and the two sets are intersected when both are present.
|
|
2004
|
+
*
|
|
2005
|
+
* @minItems 1
|
|
2006
|
+
*/
|
|
2007
|
+
accepted_verification_methods?: [AgeVerificationMethod, ...AgeVerificationMethod[]];
|
|
2008
|
+
};
|
|
1991
2009
|
}
|
|
1992
2010
|
|
|
1993
2011
|
/**
|
|
@@ -476,6 +476,11 @@ export type ActivationKey = {
|
|
|
476
476
|
*/
|
|
477
477
|
export type AdvertiserIndustry = 'automotive' | 'automotive.electric_vehicles' | 'automotive.parts_accessories' | 'automotive.luxury' | 'beauty_cosmetics' | 'beauty_cosmetics.skincare' | 'beauty_cosmetics.fragrance' | 'beauty_cosmetics.haircare' | 'cannabis' | 'cpg' | 'cpg.personal_care' | 'cpg.household' | 'dating' | 'education' | 'education.higher_education' | 'education.online_learning' | 'education.k12' | 'energy_utilities' | 'energy_utilities.renewable' | 'fashion_apparel' | 'fashion_apparel.luxury' | 'fashion_apparel.sportswear' | 'finance' | 'finance.banking' | 'finance.insurance' | 'finance.investment' | 'finance.cryptocurrency' | 'food_beverage' | 'food_beverage.alcohol' | 'food_beverage.restaurants' | 'food_beverage.packaged_goods' | 'gambling_betting' | 'gambling_betting.sports_betting' | 'gambling_betting.casino' | 'gaming' | 'gaming.mobile' | 'gaming.console_pc' | 'gaming.esports' | 'government_nonprofit' | 'government_nonprofit.political' | 'government_nonprofit.charity' | 'healthcare' | 'healthcare.pharmaceutical' | 'healthcare.medical_devices' | 'healthcare.wellness' | 'home_garden' | 'home_garden.furniture' | 'home_garden.home_improvement' | 'media_entertainment' | 'media_entertainment.podcasts' | 'media_entertainment.music' | 'media_entertainment.film_tv' | 'media_entertainment.publishing' | 'media_entertainment.live_events' | 'pets' | 'professional_services' | 'professional_services.legal' | 'professional_services.consulting' | 'real_estate' | 'real_estate.residential' | 'real_estate.commercial' | 'recruitment_hr' | 'retail' | 'retail.ecommerce' | 'retail.department_stores' | 'sports_fitness' | 'sports_fitness.equipment' | 'sports_fitness.teams_leagues' | 'technology' | 'technology.software' | 'technology.hardware' | 'technology.ai_ml' | 'telecom' | 'telecom.mobile_carriers' | 'telecom.internet_providers' | 'transportation_logistics' | 'travel_hospitality' | 'travel_hospitality.airlines' | 'travel_hospitality.hotels' | 'travel_hospitality.cruise' | 'travel_hospitality.tourism';
|
|
478
478
|
|
|
479
|
+
/**
|
|
480
|
+
* User-level bases that may resolve age for demographic targeting execution. Population estimates are deliberately absent because aggregate composition cannot establish an individual impression's age.
|
|
481
|
+
*/
|
|
482
|
+
export type AgeDeterminationBasis = 'verified' | 'declared' | 'inferred';
|
|
483
|
+
|
|
479
484
|
/**
|
|
480
485
|
* Methods for verifying user age for compliance. Does not include 'inferred' as it is not accepted for regulatory compliance.
|
|
481
486
|
*/
|
|
@@ -2075,7 +2080,20 @@ export interface DemographicTargetingCapability {
|
|
|
2075
2080
|
* Canonical demographic audience targeting intent with optional constraints on how age may be determined. This is distinct from age_restriction: demographics selects an audience, while age_restriction expresses a legal eligibility or verification floor. Fresh create/update targeting MUST compile exactly or be rejected. During get_products, a seller may offer a different configured predicate only through sparse targeting_resolution modifications on a distinguishable product_id; selecting that product accepts the alternative. Sellers never silently broaden, narrow, default, drop, or substitute the basis.
|
|
2076
2081
|
*/
|
|
2077
2082
|
export interface DemographicTargetingIntent {
|
|
2078
|
-
age: DemographicAgeRange & {
|
|
2083
|
+
age: DemographicAgeRange & {
|
|
2084
|
+
/**
|
|
2085
|
+
* User-level age determination bases the buyer permits for this predicate. Sellers MUST use only these bases or reject the request; they MUST NOT silently fall back to another basis. When omitted, the buyer imposes no determination-basis constraint beyond product capability and any age_restriction. population_estimate is structurally unavailable because aggregate evidence cannot identify an eligible user.
|
|
2086
|
+
*
|
|
2087
|
+
* @minItems 1
|
|
2088
|
+
*/
|
|
2089
|
+
accepted_bases?: [AgeDeterminationBasis, ...AgeDeterminationBasis[]];
|
|
2090
|
+
/**
|
|
2091
|
+
* Verification methods acceptable when verified is an accepted basis. This field narrows verified demographic execution; age_restriction.accepted_methods independently governs legal eligibility and the two sets are intersected when both are present.
|
|
2092
|
+
*
|
|
2093
|
+
* @minItems 1
|
|
2094
|
+
*/
|
|
2095
|
+
accepted_verification_methods?: [AgeVerificationMethod, ...AgeVerificationMethod[]];
|
|
2096
|
+
};
|
|
2079
2097
|
}
|
|
2080
2098
|
|
|
2081
2099
|
/**
|
|
@@ -1825,7 +1825,10 @@ export declare const DemographicTargetingIntentSchema: z.ZodObject<{
|
|
|
1825
1825
|
min: z.ZodOptional<z.ZodNumber>;
|
|
1826
1826
|
max: z.ZodOptional<z.ZodNumber>;
|
|
1827
1827
|
include_unknown: z.ZodBoolean;
|
|
1828
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
1828
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
1829
|
+
accepted_bases: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"verified">, z.ZodLiteral<"declared">, z.ZodLiteral<"inferred">]>>>;
|
|
1830
|
+
accepted_verification_methods: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"facial_age_estimation">, z.ZodLiteral<"id_document">, z.ZodLiteral<"digital_id">, z.ZodLiteral<"credit_card">, z.ZodLiteral<"world_id">]>>>;
|
|
1831
|
+
}, z.core.$loose>>;
|
|
1829
1832
|
}, z.core.$loose>;
|
|
1830
1833
|
export declare const SellerAgentReferenceSchema: z.ZodObject<{
|
|
1831
1834
|
agent_url: z.ZodString;
|
|
@@ -5126,7 +5129,10 @@ export declare const DemographicTargetingResolutionSchema: z.ZodObject<{
|
|
|
5126
5129
|
min: z.ZodOptional<z.ZodNumber>;
|
|
5127
5130
|
max: z.ZodOptional<z.ZodNumber>;
|
|
5128
5131
|
include_unknown: z.ZodBoolean;
|
|
5129
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
5132
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
5133
|
+
accepted_bases: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"verified">, z.ZodLiteral<"declared">, z.ZodLiteral<"inferred">]>>>;
|
|
5134
|
+
accepted_verification_methods: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"facial_age_estimation">, z.ZodLiteral<"id_document">, z.ZodLiteral<"digital_id">, z.ZodLiteral<"credit_card">, z.ZodLiteral<"world_id">]>>>;
|
|
5135
|
+
}, z.core.$loose>>;
|
|
5130
5136
|
}, z.core.$loose>;
|
|
5131
5137
|
applied: z.ZodObject<{
|
|
5132
5138
|
age: z.ZodObject<{
|
|
@@ -22439,7 +22445,10 @@ export declare const PackageTargetingResolutionSchema: z.ZodObject<{
|
|
|
22439
22445
|
min: z.ZodOptional<z.ZodNumber>;
|
|
22440
22446
|
max: z.ZodOptional<z.ZodNumber>;
|
|
22441
22447
|
include_unknown: z.ZodBoolean;
|
|
22442
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
22448
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
22449
|
+
accepted_bases: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"verified">, z.ZodLiteral<"declared">, z.ZodLiteral<"inferred">]>>>;
|
|
22450
|
+
accepted_verification_methods: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"facial_age_estimation">, z.ZodLiteral<"id_document">, z.ZodLiteral<"digital_id">, z.ZodLiteral<"credit_card">, z.ZodLiteral<"world_id">]>>>;
|
|
22451
|
+
}, z.core.$loose>>;
|
|
22443
22452
|
}, z.core.$loose>;
|
|
22444
22453
|
applied: z.ZodObject<{
|
|
22445
22454
|
age: z.ZodObject<{
|
|
@@ -2933,7 +2933,10 @@ const PackageSignalTargetingSchema = SignalTargetingExpressionSchema.and(import_
|
|
|
2933
2933
|
activation_key: ActivationKeySchema.optional()
|
|
2934
2934
|
}).passthrough());
|
|
2935
2935
|
const DemographicTargetingIntentSchema = import_zod.z.object({
|
|
2936
|
-
age: DemographicAgeRangeSchema.and(import_zod.z.object({
|
|
2936
|
+
age: DemographicAgeRangeSchema.and(import_zod.z.object({
|
|
2937
|
+
accepted_bases: import_zod.z.array(AgeDeterminationBasisSchema).optional(),
|
|
2938
|
+
accepted_verification_methods: import_zod.z.array(AgeVerificationMethodSchema).optional()
|
|
2939
|
+
}).passthrough())
|
|
2937
2940
|
}).passthrough();
|
|
2938
2941
|
const SellerAgentReferenceSchema = import_zod.z.object({
|
|
2939
2942
|
agent_url: import_zod.z.string().refine(adcpJsonSchemaUri, "Invalid URI"),
|
|
@@ -1416,7 +1416,10 @@ const PackageSignalTargetingSchema = SignalTargetingExpressionSchema.and(z.objec
|
|
|
1416
1416
|
activation_key: ActivationKeySchema.optional()
|
|
1417
1417
|
}).passthrough());
|
|
1418
1418
|
const DemographicTargetingIntentSchema = z.object({
|
|
1419
|
-
age: DemographicAgeRangeSchema.and(z.object({
|
|
1419
|
+
age: DemographicAgeRangeSchema.and(z.object({
|
|
1420
|
+
accepted_bases: z.array(AgeDeterminationBasisSchema).optional(),
|
|
1421
|
+
accepted_verification_methods: z.array(AgeVerificationMethodSchema).optional()
|
|
1422
|
+
}).passthrough())
|
|
1420
1423
|
}).passthrough();
|
|
1421
1424
|
const SellerAgentReferenceSchema = z.object({
|
|
1422
1425
|
agent_url: z.string().refine(adcpJsonSchemaUri, "Invalid URI"),
|
|
@@ -1617,7 +1617,20 @@ export interface PackageSignalTargetingGroup {
|
|
|
1617
1617
|
* Canonical demographic audience targeting intent with optional constraints on how age may be determined. This is distinct from age_restriction: demographics selects an audience, while age_restriction expresses a legal eligibility or verification floor. Fresh create/update targeting MUST compile exactly or be rejected. During get_products, a seller may offer a different configured predicate only through sparse targeting_resolution modifications on a distinguishable product_id; selecting that product accepts the alternative. Sellers never silently broaden, narrow, default, drop, or substitute the basis.
|
|
1618
1618
|
*/
|
|
1619
1619
|
export interface DemographicTargetingIntent {
|
|
1620
|
-
age: DemographicAgeRange & {
|
|
1620
|
+
age: DemographicAgeRange & {
|
|
1621
|
+
/**
|
|
1622
|
+
* User-level age determination bases the buyer permits for this predicate. Sellers MUST use only these bases or reject the request; they MUST NOT silently fall back to another basis. When omitted, the buyer imposes no determination-basis constraint beyond product capability and any age_restriction. population_estimate is structurally unavailable because aggregate evidence cannot identify an eligible user.
|
|
1623
|
+
*
|
|
1624
|
+
* @minItems 1
|
|
1625
|
+
*/
|
|
1626
|
+
accepted_bases?: [AgeDeterminationBasis, ...AgeDeterminationBasis[]];
|
|
1627
|
+
/**
|
|
1628
|
+
* Verification methods acceptable when verified is an accepted basis. This field narrows verified demographic execution; age_restriction.accepted_methods independently governs legal eligibility and the two sets are intersected when both are present.
|
|
1629
|
+
*
|
|
1630
|
+
* @minItems 1
|
|
1631
|
+
*/
|
|
1632
|
+
accepted_verification_methods?: [AgeVerificationMethod, ...AgeVerificationMethod[]];
|
|
1633
|
+
};
|
|
1621
1634
|
}
|
|
1622
1635
|
/**
|
|
1623
1636
|
* Reference to a property list for targeting specific properties within this product. The package runs on the intersection of the product's publisher_properties and this list. Sellers SHOULD return a validation error if the product has property_targeting_allowed: false.
|
|
@@ -1617,7 +1617,20 @@ export interface PackageSignalTargetingGroup {
|
|
|
1617
1617
|
* Canonical demographic audience targeting intent with optional constraints on how age may be determined. This is distinct from age_restriction: demographics selects an audience, while age_restriction expresses a legal eligibility or verification floor. Fresh create/update targeting MUST compile exactly or be rejected. During get_products, a seller may offer a different configured predicate only through sparse targeting_resolution modifications on a distinguishable product_id; selecting that product accepts the alternative. Sellers never silently broaden, narrow, default, drop, or substitute the basis.
|
|
1618
1618
|
*/
|
|
1619
1619
|
export interface DemographicTargetingIntent {
|
|
1620
|
-
age: DemographicAgeRange & {
|
|
1620
|
+
age: DemographicAgeRange & {
|
|
1621
|
+
/**
|
|
1622
|
+
* User-level age determination bases the buyer permits for this predicate. Sellers MUST use only these bases or reject the request; they MUST NOT silently fall back to another basis. When omitted, the buyer imposes no determination-basis constraint beyond product capability and any age_restriction. population_estimate is structurally unavailable because aggregate evidence cannot identify an eligible user.
|
|
1623
|
+
*
|
|
1624
|
+
* @minItems 1
|
|
1625
|
+
*/
|
|
1626
|
+
accepted_bases?: [AgeDeterminationBasis, ...AgeDeterminationBasis[]];
|
|
1627
|
+
/**
|
|
1628
|
+
* Verification methods acceptable when verified is an accepted basis. This field narrows verified demographic execution; age_restriction.accepted_methods independently governs legal eligibility and the two sets are intersected when both are present.
|
|
1629
|
+
*
|
|
1630
|
+
* @minItems 1
|
|
1631
|
+
*/
|
|
1632
|
+
accepted_verification_methods?: [AgeVerificationMethod, ...AgeVerificationMethod[]];
|
|
1633
|
+
};
|
|
1621
1634
|
}
|
|
1622
1635
|
/**
|
|
1623
1636
|
* Reference to a property list for targeting specific properties within this product. The package runs on the intersection of the product's publisher_properties and this list. Sellers SHOULD return a validation error if the product has property_targeting_allowed: false.
|
|
@@ -5449,7 +5449,20 @@ export interface DemographicPredicate {
|
|
|
5449
5449
|
* Canonical demographic audience targeting intent with optional constraints on how age may be determined. This is distinct from age_restriction: demographics selects an audience, while age_restriction expresses a legal eligibility or verification floor. Fresh create/update targeting MUST compile exactly or be rejected. During get_products, a seller may offer a different configured predicate only through sparse targeting_resolution modifications on a distinguishable product_id; selecting that product accepts the alternative. Sellers never silently broaden, narrow, default, drop, or substitute the basis.
|
|
5450
5450
|
*/
|
|
5451
5451
|
export interface DemographicTargetingIntent {
|
|
5452
|
-
age: DemographicAgeRange & {
|
|
5452
|
+
age: DemographicAgeRange & {
|
|
5453
|
+
/**
|
|
5454
|
+
* User-level age determination bases the buyer permits for this predicate. Sellers MUST use only these bases or reject the request; they MUST NOT silently fall back to another basis. When omitted, the buyer imposes no determination-basis constraint beyond product capability and any age_restriction. population_estimate is structurally unavailable because aggregate evidence cannot identify an eligible user.
|
|
5455
|
+
*
|
|
5456
|
+
* @minItems 1
|
|
5457
|
+
*/
|
|
5458
|
+
accepted_bases?: [AgeDeterminationBasis, ...AgeDeterminationBasis[]];
|
|
5459
|
+
/**
|
|
5460
|
+
* Verification methods acceptable when verified is an accepted basis. This field narrows verified demographic execution; age_restriction.accepted_methods independently governs legal eligibility and the two sets are intersected when both are present.
|
|
5461
|
+
*
|
|
5462
|
+
* @minItems 1
|
|
5463
|
+
*/
|
|
5464
|
+
accepted_verification_methods?: [AgeVerificationMethod, ...AgeVerificationMethod[]];
|
|
5465
|
+
};
|
|
5453
5466
|
}
|
|
5454
5467
|
|
|
5455
5468
|
/**
|
|
@@ -0,0 +1,43 @@
|
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var pointer_utils_exports = {};
|
|
20
|
+
__export(pointer_utils_exports, {
|
|
21
|
+
jsonPointerToJsonPathLite: () => jsonPointerToJsonPathLite
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(pointer_utils_exports);
|
|
24
|
+
function jsonPointerToJsonPathLite(pointer) {
|
|
25
|
+
if (pointer === "" || pointer === "/") return "$";
|
|
26
|
+
if (!pointer.startsWith("/")) return void 0;
|
|
27
|
+
let field = "";
|
|
28
|
+
for (const encoded of pointer.slice(1).split("/")) {
|
|
29
|
+
const segment = encoded.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
30
|
+
if (/^(0|[1-9][0-9]*)$/.test(segment)) {
|
|
31
|
+
field += `${field ? "" : "$"}[${segment}]`;
|
|
32
|
+
} else if (/^[A-Za-z_][A-Za-z0-9_-]*$/.test(segment)) {
|
|
33
|
+
field += field ? `.${segment}` : segment;
|
|
34
|
+
} else {
|
|
35
|
+
field += `${field ? "" : "$"}[${JSON.stringify(segment)}]`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return field;
|
|
39
|
+
}
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
jsonPointerToJsonPathLite
|
|
43
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function jsonPointerToJsonPathLite(pointer) {
|
|
2
|
+
if (pointer === "" || pointer === "/") return "$";
|
|
3
|
+
if (!pointer.startsWith("/")) return void 0;
|
|
4
|
+
let field = "";
|
|
5
|
+
for (const encoded of pointer.slice(1).split("/")) {
|
|
6
|
+
const segment = encoded.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
7
|
+
if (/^(0|[1-9][0-9]*)$/.test(segment)) {
|
|
8
|
+
field += `${field ? "" : "$"}[${segment}]`;
|
|
9
|
+
} else if (/^[A-Za-z_][A-Za-z0-9_-]*$/.test(segment)) {
|
|
10
|
+
field += field ? `.${segment}` : segment;
|
|
11
|
+
} else {
|
|
12
|
+
field += `${field ? "" : "$"}[${JSON.stringify(segment)}]`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return field;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
jsonPointerToJsonPathLite
|
|
19
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ValidationIssue } from './schema-validator.mjs';
|
|
2
|
+
export declare function validationDiagnosticsTruncated(issues: readonly ValidationIssue[]): boolean;
|
|
3
|
+
/** Retain actionable diagnostics with a visible marker when count/bytes overflow. */
|
|
4
|
+
export declare function boundValidationIssues(issues: Iterable<ValidationIssue>): ValidationIssue[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ValidationIssue } from './schema-validator';
|
|
2
|
+
export declare function validationDiagnosticsTruncated(issues: readonly ValidationIssue[]): boolean;
|
|
3
|
+
/** Retain actionable diagnostics with a visible marker when count/bytes overflow. */
|
|
4
|
+
export declare function boundValidationIssues(issues: Iterable<ValidationIssue>): ValidationIssue[];
|
|
@@ -0,0 +1,57 @@
|
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var diagnostic_limits_exports = {};
|
|
20
|
+
__export(diagnostic_limits_exports, {
|
|
21
|
+
boundValidationIssues: () => boundValidationIssues,
|
|
22
|
+
validationDiagnosticsTruncated: () => validationDiagnosticsTruncated
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(diagnostic_limits_exports);
|
|
25
|
+
const MAX_ISSUES = 100;
|
|
26
|
+
const MAX_ISSUE_BYTES = 64 * 1024;
|
|
27
|
+
const MAX_SINGLE_ISSUE_BYTES = 8 * 1024;
|
|
28
|
+
const OMITTED_MESSAGE = "Validation failed; additional diagnostics omitted because the diagnostic limit was reached.";
|
|
29
|
+
const OMITTED_BYTES = 8 * 1024;
|
|
30
|
+
function validationDiagnosticsTruncated(issues) {
|
|
31
|
+
return issues.some((issue) => issue.message === OMITTED_MESSAGE);
|
|
32
|
+
}
|
|
33
|
+
function boundValidationIssues(issues) {
|
|
34
|
+
const bounded = [];
|
|
35
|
+
let bytes = 2;
|
|
36
|
+
for (const issue of issues) {
|
|
37
|
+
const issueBytes = Buffer.byteLength(JSON.stringify(issue), "utf8") + 1;
|
|
38
|
+
if (bounded.length >= MAX_ISSUES || issueBytes > MAX_SINGLE_ISSUE_BYTES || bytes + issueBytes + OMITTED_BYTES > MAX_ISSUE_BYTES) {
|
|
39
|
+
const omitted = bounded.length === MAX_ISSUES ? bounded.pop() : issue;
|
|
40
|
+
bounded.push({
|
|
41
|
+
pointer: Buffer.byteLength(omitted.pointer, "utf8") <= 1024 ? omitted.pointer : "/",
|
|
42
|
+
keyword: Buffer.byteLength(omitted.keyword, "utf8") <= 128 ? omitted.keyword : "type",
|
|
43
|
+
message: OMITTED_MESSAGE,
|
|
44
|
+
schemaPath: ""
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
bounded.push(issue);
|
|
49
|
+
bytes += issueBytes;
|
|
50
|
+
}
|
|
51
|
+
return bounded;
|
|
52
|
+
}
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
boundValidationIssues,
|
|
56
|
+
validationDiagnosticsTruncated
|
|
57
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const MAX_ISSUES = 100;
|
|
2
|
+
const MAX_ISSUE_BYTES = 64 * 1024;
|
|
3
|
+
const MAX_SINGLE_ISSUE_BYTES = 8 * 1024;
|
|
4
|
+
const OMITTED_MESSAGE = "Validation failed; additional diagnostics omitted because the diagnostic limit was reached.";
|
|
5
|
+
const OMITTED_BYTES = 8 * 1024;
|
|
6
|
+
function validationDiagnosticsTruncated(issues) {
|
|
7
|
+
return issues.some((issue) => issue.message === OMITTED_MESSAGE);
|
|
8
|
+
}
|
|
9
|
+
function boundValidationIssues(issues) {
|
|
10
|
+
const bounded = [];
|
|
11
|
+
let bytes = 2;
|
|
12
|
+
for (const issue of issues) {
|
|
13
|
+
const issueBytes = Buffer.byteLength(JSON.stringify(issue), "utf8") + 1;
|
|
14
|
+
if (bounded.length >= MAX_ISSUES || issueBytes > MAX_SINGLE_ISSUE_BYTES || bytes + issueBytes + OMITTED_BYTES > MAX_ISSUE_BYTES) {
|
|
15
|
+
const omitted = bounded.length === MAX_ISSUES ? bounded.pop() : issue;
|
|
16
|
+
bounded.push({
|
|
17
|
+
pointer: Buffer.byteLength(omitted.pointer, "utf8") <= 1024 ? omitted.pointer : "/",
|
|
18
|
+
keyword: Buffer.byteLength(omitted.keyword, "utf8") <= 128 ? omitted.keyword : "type",
|
|
19
|
+
message: OMITTED_MESSAGE,
|
|
20
|
+
schemaPath: ""
|
|
21
|
+
});
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
bounded.push(issue);
|
|
25
|
+
bytes += issueBytes;
|
|
26
|
+
}
|
|
27
|
+
return bounded;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
boundValidationIssues,
|
|
31
|
+
validationDiagnosticsTruncated
|
|
32
|
+
};
|
|
@@ -9,8 +9,9 @@ export interface ValidationErrorDetails {
|
|
|
9
9
|
tool: string;
|
|
10
10
|
/** Which side of the exchange — request (outgoing) or response (incoming). */
|
|
11
11
|
side: 'request' | 'response';
|
|
12
|
-
/**
|
|
12
|
+
/** Bounded failures, each with a JSON Pointer to the bad field. */
|
|
13
13
|
issues: ValidationIssue[];
|
|
14
|
+
issues_truncated?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Build a `ValidationError` thrown by strict-mode client hooks. Keeps the
|
|
@@ -34,6 +35,7 @@ export interface AdcpValidationErrorDetails {
|
|
|
34
35
|
issues: Array<Omit<ValidationIssue, 'schemaPath'> & {
|
|
35
36
|
schemaPath?: string;
|
|
36
37
|
}>;
|
|
38
|
+
issues_truncated?: boolean;
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* Serialize issues for the server-side `adcpError('VALIDATION_ERROR', ...)` call.
|
|
@@ -9,8 +9,9 @@ export interface ValidationErrorDetails {
|
|
|
9
9
|
tool: string;
|
|
10
10
|
/** Which side of the exchange — request (outgoing) or response (incoming). */
|
|
11
11
|
side: 'request' | 'response';
|
|
12
|
-
/**
|
|
12
|
+
/** Bounded failures, each with a JSON Pointer to the bad field. */
|
|
13
13
|
issues: ValidationIssue[];
|
|
14
|
+
issues_truncated?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Build a `ValidationError` thrown by strict-mode client hooks. Keeps the
|
|
@@ -34,6 +35,7 @@ export interface AdcpValidationErrorDetails {
|
|
|
34
35
|
issues: Array<Omit<ValidationIssue, 'schemaPath'> & {
|
|
35
36
|
schemaPath?: string;
|
|
36
37
|
}>;
|
|
38
|
+
issues_truncated?: boolean;
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* Serialize issues for the server-side `adcpError('VALIDATION_ERROR', ...)` call.
|
|
@@ -24,6 +24,8 @@ __export(schema_errors_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(schema_errors_exports);
|
|
25
25
|
var import_errors = require('../errors/index.js');
|
|
26
26
|
var import_schema_validator = require('./schema-validator.js');
|
|
27
|
+
var import_pointer_utils = require('../utils/pointer-utils.js');
|
|
28
|
+
var import_diagnostic_limits = require('./diagnostic-limits.js');
|
|
27
29
|
function buildIssueProseSuffix(issue, rootSchemaId) {
|
|
28
30
|
const parts = [];
|
|
29
31
|
if (issue.schemaId && issue.schemaId !== rootSchemaId) parts.push(`schema: ${issue.schemaId}`);
|
|
@@ -33,14 +35,21 @@ function buildIssueProseSuffix(issue, rootSchemaId) {
|
|
|
33
35
|
return parts.length > 0 ? ` (${parts.join("; ")})` : "";
|
|
34
36
|
}
|
|
35
37
|
function buildValidationError(tool, side, issues) {
|
|
38
|
+
issues = (0, import_diagnostic_limits.boundValidationIssues)(issues);
|
|
36
39
|
const first = issues[0];
|
|
37
40
|
const field = first?.pointer ?? "/";
|
|
38
41
|
const constraint = first ? `${first.keyword}: ${first.message}${buildIssueProseSuffix(first, void 0)}` : "schema validation failed";
|
|
39
42
|
const err = new import_errors.ValidationError(field, void 0, `${tool} ${side}: ${constraint}`);
|
|
40
|
-
err.details = {
|
|
43
|
+
err.details = {
|
|
44
|
+
tool,
|
|
45
|
+
side,
|
|
46
|
+
issues,
|
|
47
|
+
...(0, import_diagnostic_limits.validationDiagnosticsTruncated)(issues) && { issues_truncated: true }
|
|
48
|
+
};
|
|
41
49
|
return err;
|
|
42
50
|
}
|
|
43
51
|
function buildAdcpValidationErrorPayload(tool, side, issues, options = {}) {
|
|
52
|
+
issues = (0, import_diagnostic_limits.boundValidationIssues)(issues);
|
|
44
53
|
const first = issues[0];
|
|
45
54
|
let message;
|
|
46
55
|
if (first != null) {
|
|
@@ -52,9 +61,15 @@ function buildAdcpValidationErrorPayload(tool, side, issues, options = {}) {
|
|
|
52
61
|
const payload = {
|
|
53
62
|
message,
|
|
54
63
|
issues: emittedIssues,
|
|
55
|
-
details: {
|
|
64
|
+
details: {
|
|
65
|
+
tool,
|
|
66
|
+
side,
|
|
67
|
+
issues: emittedIssues,
|
|
68
|
+
...(0, import_diagnostic_limits.validationDiagnosticsTruncated)(issues) && { issues_truncated: true }
|
|
69
|
+
}
|
|
56
70
|
};
|
|
57
|
-
|
|
71
|
+
const field = first && (0, import_pointer_utils.jsonPointerToJsonPathLite)(first.pointer);
|
|
72
|
+
if (field !== void 0) payload.field = field;
|
|
58
73
|
return payload;
|
|
59
74
|
}
|
|
60
75
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ValidationError } from "../errors/index.mjs";
|
|
2
2
|
import { formatDiscriminator } from "./schema-validator.mjs";
|
|
3
|
+
import { jsonPointerToJsonPathLite } from "../utils/pointer-utils.mjs";
|
|
4
|
+
import { boundValidationIssues, validationDiagnosticsTruncated } from "./diagnostic-limits.mjs";
|
|
3
5
|
function buildIssueProseSuffix(issue, rootSchemaId) {
|
|
4
6
|
const parts = [];
|
|
5
7
|
if (issue.schemaId && issue.schemaId !== rootSchemaId) parts.push(`schema: ${issue.schemaId}`);
|
|
@@ -9,14 +11,21 @@ function buildIssueProseSuffix(issue, rootSchemaId) {
|
|
|
9
11
|
return parts.length > 0 ? ` (${parts.join("; ")})` : "";
|
|
10
12
|
}
|
|
11
13
|
function buildValidationError(tool, side, issues) {
|
|
14
|
+
issues = boundValidationIssues(issues);
|
|
12
15
|
const first = issues[0];
|
|
13
16
|
const field = first?.pointer ?? "/";
|
|
14
17
|
const constraint = first ? `${first.keyword}: ${first.message}${buildIssueProseSuffix(first, void 0)}` : "schema validation failed";
|
|
15
18
|
const err = new ValidationError(field, void 0, `${tool} ${side}: ${constraint}`);
|
|
16
|
-
err.details = {
|
|
19
|
+
err.details = {
|
|
20
|
+
tool,
|
|
21
|
+
side,
|
|
22
|
+
issues,
|
|
23
|
+
...validationDiagnosticsTruncated(issues) && { issues_truncated: true }
|
|
24
|
+
};
|
|
17
25
|
return err;
|
|
18
26
|
}
|
|
19
27
|
function buildAdcpValidationErrorPayload(tool, side, issues, options = {}) {
|
|
28
|
+
issues = boundValidationIssues(issues);
|
|
20
29
|
const first = issues[0];
|
|
21
30
|
let message;
|
|
22
31
|
if (first != null) {
|
|
@@ -28,9 +37,15 @@ function buildAdcpValidationErrorPayload(tool, side, issues, options = {}) {
|
|
|
28
37
|
const payload = {
|
|
29
38
|
message,
|
|
30
39
|
issues: emittedIssues,
|
|
31
|
-
details: {
|
|
40
|
+
details: {
|
|
41
|
+
tool,
|
|
42
|
+
side,
|
|
43
|
+
issues: emittedIssues,
|
|
44
|
+
...validationDiagnosticsTruncated(issues) && { issues_truncated: true }
|
|
45
|
+
}
|
|
32
46
|
};
|
|
33
|
-
|
|
47
|
+
const field = first && jsonPointerToJsonPathLite(first.pointer);
|
|
48
|
+
if (field !== void 0) payload.field = field;
|
|
34
49
|
return payload;
|
|
35
50
|
}
|
|
36
51
|
export {
|