@adcp/sdk 14.0.0-beta.5 → 14.0.0-beta.6

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.
Files changed (80) hide show
  1. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  2. package/dist/lib/core/AgentClient.js +26 -10
  3. package/dist/lib/core/AgentClient.js.map +1 -1
  4. package/dist/lib/core/AgentClient.mjs +26 -10
  5. package/dist/lib/core/AgentClient.mjs.map +1 -1
  6. package/dist/lib/core/AsyncHandler.d.mts +4 -2
  7. package/dist/lib/core/AsyncHandler.d.ts +4 -2
  8. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  9. package/dist/lib/core/AsyncHandler.js +15 -1
  10. package/dist/lib/core/AsyncHandler.js.map +1 -1
  11. package/dist/lib/core/AsyncHandler.mjs +15 -1
  12. package/dist/lib/core/AsyncHandler.mjs.map +1 -1
  13. package/dist/lib/core/SingleAgentClient.d.mts +3 -1
  14. package/dist/lib/core/SingleAgentClient.d.ts +3 -1
  15. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  16. package/dist/lib/core/SingleAgentClient.js +158 -39
  17. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  18. package/dist/lib/core/SingleAgentClient.mjs +167 -40
  19. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  20. package/dist/lib/core/TaskExecutor.d.mts +57 -2
  21. package/dist/lib/core/TaskExecutor.d.ts +57 -2
  22. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  23. package/dist/lib/core/TaskExecutor.js +382 -44
  24. package/dist/lib/core/TaskExecutor.js.map +1 -1
  25. package/dist/lib/core/TaskExecutor.mjs +382 -45
  26. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  27. package/dist/lib/core/request-proposals-guard.d.mts +11 -0
  28. package/dist/lib/core/request-proposals-guard.d.ts +12 -0
  29. package/dist/lib/core/request-proposals-guard.d.ts.map +1 -0
  30. package/dist/lib/core/request-proposals-guard.js +65 -0
  31. package/dist/lib/core/request-proposals-guard.js.map +1 -0
  32. package/dist/lib/core/request-proposals-guard.mjs +39 -0
  33. package/dist/lib/core/request-proposals-guard.mjs.map +1 -0
  34. package/dist/lib/core/webhook-registration.d.mts +5 -0
  35. package/dist/lib/core/webhook-registration.d.ts +5 -0
  36. package/dist/lib/core/webhook-registration.d.ts.map +1 -1
  37. package/dist/lib/core/webhook-registration.js +13 -0
  38. package/dist/lib/core/webhook-registration.js.map +1 -1
  39. package/dist/lib/core/webhook-registration.mjs +13 -0
  40. package/dist/lib/core/webhook-registration.mjs.map +1 -1
  41. package/dist/lib/media-buy/compatibility.d.mts +45 -10
  42. package/dist/lib/media-buy/compatibility.d.ts +45 -10
  43. package/dist/lib/media-buy/compatibility.d.ts.map +1 -1
  44. package/dist/lib/media-buy/compatibility.js +295 -113
  45. package/dist/lib/media-buy/compatibility.js.map +1 -1
  46. package/dist/lib/media-buy/compatibility.mjs +295 -113
  47. package/dist/lib/media-buy/compatibility.mjs.map +1 -1
  48. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  49. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  50. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  51. package/dist/lib/types/core.generated.d.mts +334 -85
  52. package/dist/lib/types/core.generated.d.ts +334 -85
  53. package/dist/lib/types/core.generated.d.ts.map +1 -1
  54. package/dist/lib/types/core.generated.js.map +1 -1
  55. package/dist/lib/types/decline-proposals.d.ts +0 -5
  56. package/dist/lib/types/index.d.mts +2 -0
  57. package/dist/lib/types/index.d.ts +2 -0
  58. package/dist/lib/types/index.d.ts.map +1 -1
  59. package/dist/lib/types/index.js.map +1 -1
  60. package/dist/lib/types/index.mjs.map +1 -1
  61. package/dist/lib/types/request-proposals.d.ts +254 -36
  62. package/dist/lib/types/schemas.generated.d.ts +3123 -835
  63. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  64. package/dist/lib/types/schemas.generated.js +192 -85
  65. package/dist/lib/types/schemas.generated.js.map +1 -1
  66. package/dist/lib/types/schemas.generated.mjs +192 -85
  67. package/dist/lib/types/schemas.generated.mjs.map +1 -1
  68. package/dist/lib/types/tools.generated.d.mts +1 -121
  69. package/dist/lib/types/tools.generated.d.ts +1 -121
  70. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  71. package/dist/lib/types/tools.generated.js.map +1 -1
  72. package/dist/lib/version.d.mts +3 -3
  73. package/dist/lib/version.d.ts +3 -3
  74. package/dist/lib/version.js +3 -3
  75. package/dist/lib/version.js.map +1 -1
  76. package/dist/lib/version.mjs +3 -3
  77. package/dist/lib/version.mjs.map +1 -1
  78. package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +28 -14
  79. package/docs/llms.txt +1 -1
  80. package/package.json +1 -1
@@ -2556,8 +2556,6 @@ const DeclineProposalsResponseSchema = z.union([z.object({
2556
2556
  }).passthrough(), z.object({
2557
2557
  outcome: z.literal("unable")
2558
2558
  }).passthrough()])),
2559
- status: z.literal("submitted").optional(),
2560
- task_id: z.string().min(1).optional(),
2561
2559
  message: z.string().max(2e3).optional(),
2562
2560
  errors: z.array(ErrorSchema).optional(),
2563
2561
  context: ContextObjectSchema.optional(),
@@ -10635,6 +10633,10 @@ const ValidationResultSchema = z.object({
10635
10633
  authorization: AuthorizationResultSchema.optional(),
10636
10634
  ext: ExtensionObjectSchema.optional()
10637
10635
  }).passthrough();
10636
+ const ProductDiscoveryTargetingResolutionSchema = z.object({
10637
+ brief_targeting: TargetingOverlaySchema,
10638
+ ext: ExtensionObjectSchema.optional()
10639
+ }).passthrough();
10638
10640
  const AudienceEvidenceSchema = z.object({}).passthrough().merge(z.object({}).passthrough()).merge(z.object({}).passthrough()).merge(z.object({
10639
10641
  evidence_id: z.string(),
10640
10642
  snapshot_id: z.string(),
@@ -12205,10 +12207,6 @@ const ProductSchema = z.object({
12205
12207
  }).passthrough().optional(),
12206
12208
  ext: ExtensionObjectSchema.optional()
12207
12209
  }).passthrough();
12208
- const ProductDiscoveryTargetingResolutionSchema = z.object({
12209
- brief_targeting: TargetingOverlaySchema,
12210
- ext: ExtensionObjectSchema.optional()
12211
- }).passthrough();
12212
12210
  const ProductAllocationSchema = z.object({
12213
12211
  product_id: z.string(),
12214
12212
  allocation_percentage: z.number().optional(),
@@ -13286,43 +13284,6 @@ const RequestProposalsRequestSchema = z.object({
13286
13284
  status: z.literal("open").optional()
13287
13285
  }).passthrough()).optional()
13288
13286
  }).passthrough();
13289
- const CanonicalProductSchema = z.object({
13290
- product_id: z.string(),
13291
- name: z.string(),
13292
- description: z.string().optional(),
13293
- publisher_properties: z.array(PublisherPropertySelectorSchema.and(z.object({}).passthrough())).optional(),
13294
- channels: z.array(MediaChannelSchema).optional(),
13295
- video_placement_types: z.array(VideoPlacementTypeSchema).optional(),
13296
- audio_distribution_types: z.array(AudioDistributionTypeSchema).optional(),
13297
- sponsored_placement_types: z.array(SponsoredPlacementTypeSchema).optional(),
13298
- social_placement_surfaces: z.array(SocialPlacementSurfaceSchema).optional(),
13299
- format_options: z.array(CanonicalFormatOptionSchema).optional(),
13300
- placements: z.array(CanonicalProductPlacementSchema).optional(),
13301
- delivery_type: DeliveryTypeSchema.optional(),
13302
- exclusivity: ExclusivitySchema.optional(),
13303
- pricing_options: z.array(CanonicalPricingOptionSchema).optional(),
13304
- forecast: CanonicalDeliveryForecastSchema.optional(),
13305
- reporting_capabilities: CanonicalReportingCapabilitiesSchema.optional(),
13306
- measurement_terms: CanonicalMeasurementTermsSchema.optional(),
13307
- performance_standards: z.array(CanonicalPerformanceStandardSchema).optional(),
13308
- catalog_types: z.array(CatalogTypeSchema).optional(),
13309
- signal_targeting_allowed: z.boolean().optional(),
13310
- signal_targeting_rules: SignalTargetingRulesSchema.optional(),
13311
- demographic_targeting: DemographicTargetingCapabilitySchema.optional(),
13312
- audience_evidence: z.array(CanonicalAudienceEvidenceSchema).optional(),
13313
- audience_evidence_selections: z.array(CanonicalAudienceEvidenceSelectionSchema).optional(),
13314
- max_optimization_goals: z.number().optional(),
13315
- catalog_match: z.object({
13316
- matched_gtins: z.array(z.string()).optional(),
13317
- matched_ids: z.array(z.string()).optional(),
13318
- matched_count: z.number().optional(),
13319
- submitted_count: z.number()
13320
- }).passthrough().optional(),
13321
- brief_relevance: z.string().optional(),
13322
- expires_at: z.string().optional(),
13323
- allowed_actions: z.array(CanonicalProductActionSchema).optional(),
13324
- ext: ExtensionObjectSchema.optional()
13325
- }).passthrough();
13326
13287
  const CommercialTermsSchema = z.object({
13327
13288
  source_feed_version: z.string().optional(),
13328
13289
  source_pricing_version: z.string().optional(),
@@ -13935,6 +13896,43 @@ const CanonicalProposalSchema = (() => {
13935
13896
  extend: objectSchema.extend.bind(objectSchema)
13936
13897
  });
13937
13898
  })();
13899
+ const CanonicalProductSchema = z.object({
13900
+ product_id: z.string(),
13901
+ name: z.string(),
13902
+ description: z.string().optional(),
13903
+ publisher_properties: z.array(PublisherPropertySelectorSchema.and(z.object({}).passthrough())).optional(),
13904
+ channels: z.array(MediaChannelSchema).optional(),
13905
+ video_placement_types: z.array(VideoPlacementTypeSchema).optional(),
13906
+ audio_distribution_types: z.array(AudioDistributionTypeSchema).optional(),
13907
+ sponsored_placement_types: z.array(SponsoredPlacementTypeSchema).optional(),
13908
+ social_placement_surfaces: z.array(SocialPlacementSurfaceSchema).optional(),
13909
+ format_options: z.array(CanonicalFormatOptionSchema).optional(),
13910
+ placements: z.array(CanonicalProductPlacementSchema).optional(),
13911
+ delivery_type: DeliveryTypeSchema.optional(),
13912
+ exclusivity: ExclusivitySchema.optional(),
13913
+ pricing_options: z.array(CanonicalPricingOptionSchema).optional(),
13914
+ forecast: CanonicalDeliveryForecastSchema.optional(),
13915
+ reporting_capabilities: CanonicalReportingCapabilitiesSchema.optional(),
13916
+ measurement_terms: CanonicalMeasurementTermsSchema.optional(),
13917
+ performance_standards: z.array(CanonicalPerformanceStandardSchema).optional(),
13918
+ catalog_types: z.array(CatalogTypeSchema).optional(),
13919
+ signal_targeting_allowed: z.boolean().optional(),
13920
+ signal_targeting_rules: SignalTargetingRulesSchema.optional(),
13921
+ demographic_targeting: DemographicTargetingCapabilitySchema.optional(),
13922
+ audience_evidence: z.array(CanonicalAudienceEvidenceSchema).optional(),
13923
+ audience_evidence_selections: z.array(CanonicalAudienceEvidenceSelectionSchema).optional(),
13924
+ max_optimization_goals: z.number().optional(),
13925
+ catalog_match: z.object({
13926
+ matched_gtins: z.array(z.string()).optional(),
13927
+ matched_ids: z.array(z.string()).optional(),
13928
+ matched_count: z.number().optional(),
13929
+ submitted_count: z.number()
13930
+ }).passthrough().optional(),
13931
+ brief_relevance: z.string().optional(),
13932
+ expires_at: z.string().optional(),
13933
+ allowed_actions: z.array(CanonicalProductActionSchema).optional(),
13934
+ ext: ExtensionObjectSchema.optional()
13935
+ }).passthrough();
13938
13936
  const BuyProductsRequestSchema = z.object({
13939
13937
  adcp_version: z.string().optional(),
13940
13938
  adcp_major_version: z.number().optional(),
@@ -15470,58 +15468,135 @@ const ValidatePropertyDeliveryResponseSchema = z.object({
15470
15468
  list_resolved_at: z.iso.datetime().optional(),
15471
15469
  ext: ExtensionObjectSchema.optional()
15472
15470
  }).passthrough();
15473
- const MediaBuySchema = z.object({
15474
- media_buy_id: z.string(),
15475
- name: z.string().min(1).max(255).regex(/\S/).optional(),
15476
- accepted_proposal_id: z.string().min(1).max(255).optional(),
15477
- accepted_proposal_terms_digest: z.string().regex(/^sha256:[A-Za-z0-9_-]{43}$/).optional(),
15478
- account: AccountSchema.optional(),
15479
- status: MediaBuyStatusSchema,
15480
- health: MediaBuyHealthSchema.and(z.string()).optional(),
15481
- impairments: z.array(ImpairmentSchema).optional(),
15482
- rejection_reason: z.string().optional(),
15483
- confirmed_at: z.iso.datetime().nullable(),
15484
- cancellation: z.object({
15485
- canceled_at: z.iso.datetime(),
15486
- canceled_by: CanceledBySchema,
15487
- reason: z.string().max(500).optional()
15488
- }).passthrough().optional(),
15489
- total_budget: z.number().min(0),
15490
- daily_budget_cap: z.number().min(0).optional(),
15491
- budget_cap_timezone: z.string().optional(),
15492
- currency: z.string().regex(/^[A-Z]{3}$/).optional(),
15493
- budget_allocation: BudgetAllocationSchema.optional(),
15494
- pacing: PacingSchema.optional(),
15495
- bidding: BiddingPolicySchema.optional(),
15496
- packages: z.array(PackageSchema),
15497
- context: ContextObjectSchema.optional(),
15498
- invoice_recipient: BusinessEntity1Schema.optional(),
15499
- creative_deadline: z.iso.datetime().optional(),
15500
- revision: z.number().min(1),
15501
- created_at: z.iso.datetime().optional(),
15502
- updated_at: z.iso.datetime().optional(),
15503
- ext: ExtensionObjectSchema.optional()
15504
- }).passthrough();
15505
15471
  const RequestProposalsResponseSchema = z.union([z.object({
15472
+ adcp_version: z.string().optional(),
15506
15473
  outcome: z.literal("proposed"),
15507
- status: z.literal("completed").optional()
15474
+ reason: z.never().optional(),
15475
+ suggestions: z.never().optional(),
15476
+ proposals: z.tuple([CanonicalProposalSchema.and(z.object({
15477
+ proposal_status: z.literal("draft"),
15478
+ expires_at: z.iso.datetime()
15479
+ }).passthrough())]).rest(CanonicalProposalSchema.and(z.object({
15480
+ proposal_status: z.literal("draft"),
15481
+ expires_at: z.iso.datetime()
15482
+ }).passthrough())),
15483
+ products: z.array(CanonicalProductSchema),
15484
+ incomplete: z.tuple([z.object({
15485
+ scope: z.union([z.literal("products"), z.literal("pricing"), z.literal("forecast"), z.literal("proposals"), z.literal("wholesale_feed")]),
15486
+ description: z.string().min(1),
15487
+ estimated_wait: DurationSchema.optional()
15488
+ }).passthrough()]).rest(z.object({
15489
+ scope: z.union([z.literal("products"), z.literal("pricing"), z.literal("forecast"), z.literal("proposals"), z.literal("wholesale_feed")]),
15490
+ description: z.string().min(1),
15491
+ estimated_wait: DurationSchema.optional()
15492
+ }).passthrough()).optional(),
15493
+ purchase_continuation: z.never().optional(),
15494
+ targeting_resolution: ProductDiscoveryTargetingResolutionSchema.optional(),
15495
+ status: z.literal("completed").optional(),
15496
+ task_id: z.never().optional(),
15497
+ message: z.string().max(2e3).optional(),
15498
+ errors: z.array(ErrorSchema).optional(),
15499
+ context: ContextObjectSchema.optional(),
15500
+ ext: ExtensionObjectSchema.optional(),
15501
+ replayed: z.literal(true).optional()
15508
15502
  }).passthrough(), z.object({
15503
+ adcp_version: z.string().optional(),
15509
15504
  outcome: z.literal("products_available"),
15510
- status: z.literal("completed").optional()
15505
+ reason: z.never().optional(),
15506
+ suggestions: z.never().optional(),
15507
+ proposals: z.never().optional(),
15508
+ products: z.array(CanonicalProductSchema),
15509
+ incomplete: z.tuple([z.object({
15510
+ scope: z.union([z.literal("products"), z.literal("pricing"), z.literal("forecast"), z.literal("proposals"), z.literal("wholesale_feed")]),
15511
+ description: z.string().min(1),
15512
+ estimated_wait: DurationSchema.optional()
15513
+ }).passthrough()]).rest(z.object({
15514
+ scope: z.union([z.literal("products"), z.literal("pricing"), z.literal("forecast"), z.literal("proposals"), z.literal("wholesale_feed")]),
15515
+ description: z.string().min(1),
15516
+ estimated_wait: DurationSchema.optional()
15517
+ }).passthrough()).optional(),
15518
+ purchase_continuation: z.union([z.object({
15519
+ kind: z.literal("listed_purchase"),
15520
+ product_ids: z.array(z.string()),
15521
+ cache_scope: z.literal("account"),
15522
+ feed_version: z.string().min(1),
15523
+ pricing_version: z.string().min(1).optional()
15524
+ }).passthrough(), z.object({
15525
+ kind: z.literal("legacy_create"),
15526
+ continuation_token: z.string().min(16),
15527
+ continuation_expires_at: z.iso.datetime(),
15528
+ source_adcp_version: z.union([z.literal("2.5"), z.literal("3.0"), z.literal("3.1")]),
15529
+ product_ids: z.array(z.string()),
15530
+ losses: z.tuple([z.union([z.literal("feed_version_not_atomic"), z.literal("pricing_version_not_atomic"), z.literal("mutation_idempotency_not_guaranteed")]), z.union([z.literal("feed_version_not_atomic"), z.literal("pricing_version_not_atomic"), z.literal("mutation_idempotency_not_guaranteed")])]).rest(z.union([z.literal("feed_version_not_atomic"), z.literal("pricing_version_not_atomic"), z.literal("mutation_idempotency_not_guaranteed")])),
15531
+ requires_explicit_acceptance: z.literal(true)
15532
+ }).passthrough().superRefine((value, ctx) => {
15533
+ if (value.product_ids.length === 0) {
15534
+ ctx.addIssue({ code: "custom", path: ["product_ids"], message: "product_ids must contain at least one entry" });
15535
+ }
15536
+ if (value.product_ids.some((productId) => productId.length === 0)) {
15537
+ ctx.addIssue({ code: "custom", path: ["product_ids"], message: "product_ids must not contain empty IDs" });
15538
+ }
15539
+ if (new Set(value.product_ids).size !== value.product_ids.length) {
15540
+ ctx.addIssue({ code: "custom", path: ["product_ids"], message: "product_ids must be unique" });
15541
+ }
15542
+ if (value.losses.length < 2) {
15543
+ ctx.addIssue({ code: "custom", path: ["losses"], message: "losses must contain at least two entries" });
15544
+ }
15545
+ if (new Set(value.losses).size !== value.losses.length) {
15546
+ ctx.addIssue({ code: "custom", path: ["losses"], message: "losses must be unique" });
15547
+ }
15548
+ for (const required of ["feed_version_not_atomic", "pricing_version_not_atomic"]) {
15549
+ if (!value.losses.includes(required)) {
15550
+ ctx.addIssue({ code: "custom", path: ["losses"], message: `losses must contain ${required}` });
15551
+ }
15552
+ }
15553
+ if (value.source_adcp_version === "2.5" && !value.losses.includes("mutation_idempotency_not_guaranteed")) {
15554
+ ctx.addIssue({ code: "custom", path: ["losses"], message: "AdCP 2.5 losses must contain mutation_idempotency_not_guaranteed" });
15555
+ }
15556
+ })]),
15557
+ targeting_resolution: ProductDiscoveryTargetingResolutionSchema.optional(),
15558
+ status: z.literal("completed").optional(),
15559
+ task_id: z.never().optional(),
15560
+ message: z.string().max(2e3).optional(),
15561
+ errors: z.array(ErrorSchema).optional(),
15562
+ context: ContextObjectSchema.optional(),
15563
+ ext: ExtensionObjectSchema.optional(),
15564
+ replayed: z.literal(true).optional()
15511
15565
  }).passthrough(), z.object({
15566
+ adcp_version: z.string().optional(),
15512
15567
  outcome: z.literal("rejected"),
15513
- status: z.literal("completed").optional()
15514
- }).passthrough(), CompactTaskSubmittedSchema]).and(z.object({
15568
+ reason: z.string().min(1),
15569
+ suggestions: z.array(z.string()).optional(),
15570
+ proposals: z.never().optional(),
15571
+ products: z.never().optional(),
15572
+ incomplete: z.never().optional(),
15573
+ purchase_continuation: z.never().optional(),
15574
+ targeting_resolution: ProductDiscoveryTargetingResolutionSchema.optional(),
15575
+ status: z.literal("completed").optional(),
15576
+ task_id: z.never().optional(),
15577
+ message: z.string().max(2e3).optional(),
15578
+ errors: z.array(ErrorSchema).optional(),
15579
+ context: ContextObjectSchema.optional(),
15580
+ ext: ExtensionObjectSchema.optional(),
15581
+ replayed: z.literal(true).optional()
15582
+ }).passthrough(), z.object({
15515
15583
  adcp_version: z.string().optional(),
15516
15584
  outcome: z.union([z.literal("proposed"), z.literal("products_available"), z.literal("rejected")]).optional(),
15517
15585
  reason: z.string().min(1).optional(),
15518
15586
  suggestions: z.array(z.string()).optional(),
15519
- proposals: z.array(CanonicalProposalSchema.and(z.object({
15587
+ proposals: z.tuple([CanonicalProposalSchema.and(z.object({
15588
+ proposal_status: z.literal("draft"),
15589
+ expires_at: z.iso.datetime()
15590
+ }).passthrough())]).rest(CanonicalProposalSchema.and(z.object({
15520
15591
  proposal_status: z.literal("draft"),
15521
15592
  expires_at: z.iso.datetime()
15522
15593
  }).passthrough())).optional(),
15523
15594
  products: z.array(CanonicalProductSchema).optional(),
15524
- incomplete: z.array(z.object({
15595
+ incomplete: z.tuple([z.object({
15596
+ scope: z.union([z.literal("products"), z.literal("pricing"), z.literal("forecast"), z.literal("proposals"), z.literal("wholesale_feed")]),
15597
+ description: z.string().min(1),
15598
+ estimated_wait: DurationSchema.optional()
15599
+ }).passthrough()]).rest(z.object({
15525
15600
  scope: z.union([z.literal("products"), z.literal("pricing"), z.literal("forecast"), z.literal("proposals"), z.literal("wholesale_feed")]),
15526
15601
  description: z.string().min(1),
15527
15602
  estimated_wait: DurationSchema.optional()
@@ -15538,7 +15613,7 @@ const RequestProposalsResponseSchema = z.union([z.object({
15538
15613
  continuation_expires_at: z.iso.datetime(),
15539
15614
  source_adcp_version: z.union([z.literal("2.5"), z.literal("3.0"), z.literal("3.1")]),
15540
15615
  product_ids: z.array(z.string()),
15541
- losses: z.array(z.union([z.literal("feed_version_not_atomic"), z.literal("pricing_version_not_atomic"), z.literal("mutation_idempotency_not_guaranteed")])),
15616
+ losses: z.tuple([z.union([z.literal("feed_version_not_atomic"), z.literal("pricing_version_not_atomic"), z.literal("mutation_idempotency_not_guaranteed")]), z.union([z.literal("feed_version_not_atomic"), z.literal("pricing_version_not_atomic"), z.literal("mutation_idempotency_not_guaranteed")])]).rest(z.union([z.literal("feed_version_not_atomic"), z.literal("pricing_version_not_atomic"), z.literal("mutation_idempotency_not_guaranteed")])),
15542
15617
  requires_explicit_acceptance: z.literal(true)
15543
15618
  }).passthrough().superRefine((value, ctx) => {
15544
15619
  if (value.product_ids.length === 0) {
@@ -15566,14 +15641,14 @@ const RequestProposalsResponseSchema = z.union([z.object({
15566
15641
  }
15567
15642
  })]).optional(),
15568
15643
  targeting_resolution: ProductDiscoveryTargetingResolutionSchema.optional(),
15569
- status: z.union([z.literal("completed"), z.literal("submitted")]).optional(),
15570
- task_id: z.string().min(1).optional(),
15644
+ status: z.literal("submitted"),
15645
+ task_id: z.string().min(1),
15571
15646
  message: z.string().max(2e3).optional(),
15572
15647
  errors: z.array(ErrorSchema).optional(),
15573
15648
  context: ContextObjectSchema.optional(),
15574
15649
  ext: ExtensionObjectSchema.optional(),
15575
15650
  replayed: z.literal(true).optional()
15576
- }).passthrough()).superRefine((value, ctx) => {
15651
+ }).passthrough()]).superRefine((value, ctx) => {
15577
15652
  const present = (field) => Object.prototype.hasOwnProperty.call(value, field);
15578
15653
  const requireNonEmptyArray = (field) => {
15579
15654
  if (!Array.isArray(value[field]) || value[field].length === 0) {
@@ -15631,6 +15706,38 @@ const RequestProposalsResponseSchema = z.union([z.object({
15631
15706
  forbid(["proposals", "products", "incomplete", "purchase_continuation", "task_id"]);
15632
15707
  }
15633
15708
  });
15709
+ const MediaBuySchema = z.object({
15710
+ media_buy_id: z.string(),
15711
+ name: z.string().min(1).max(255).regex(/\S/).optional(),
15712
+ accepted_proposal_id: z.string().min(1).max(255).optional(),
15713
+ accepted_proposal_terms_digest: z.string().regex(/^sha256:[A-Za-z0-9_-]{43}$/).optional(),
15714
+ account: AccountSchema.optional(),
15715
+ status: MediaBuyStatusSchema,
15716
+ health: MediaBuyHealthSchema.and(z.string()).optional(),
15717
+ impairments: z.array(ImpairmentSchema).optional(),
15718
+ rejection_reason: z.string().optional(),
15719
+ confirmed_at: z.iso.datetime().nullable(),
15720
+ cancellation: z.object({
15721
+ canceled_at: z.iso.datetime(),
15722
+ canceled_by: CanceledBySchema,
15723
+ reason: z.string().max(500).optional()
15724
+ }).passthrough().optional(),
15725
+ total_budget: z.number().min(0),
15726
+ daily_budget_cap: z.number().min(0).optional(),
15727
+ budget_cap_timezone: z.string().optional(),
15728
+ currency: z.string().regex(/^[A-Z]{3}$/).optional(),
15729
+ budget_allocation: BudgetAllocationSchema.optional(),
15730
+ pacing: PacingSchema.optional(),
15731
+ bidding: BiddingPolicySchema.optional(),
15732
+ packages: z.array(PackageSchema),
15733
+ context: ContextObjectSchema.optional(),
15734
+ invoice_recipient: BusinessEntity1Schema.optional(),
15735
+ creative_deadline: z.iso.datetime().optional(),
15736
+ revision: z.number().min(1),
15737
+ created_at: z.iso.datetime().optional(),
15738
+ updated_at: z.iso.datetime().optional(),
15739
+ ext: ExtensionObjectSchema.optional()
15740
+ }).passthrough();
15634
15741
  const RefineProposalsResponseSchema = z.union([z.object({
15635
15742
  adcp_version: z.string().optional(),
15636
15743
  results: z.array(z.union([z.object({