@adcp/sdk 17.0.0-beta.0 → 17.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.
Files changed (277) hide show
  1. package/dist/lib/adapters/keyed-account-store.js +1 -1
  2. package/dist/lib/adapters/keyed-account-store.mjs +1 -1
  3. package/dist/lib/adapters/version/3.0/brand-fields.d.mts +7 -1
  4. package/dist/lib/adapters/version/3.0/brand-fields.d.ts +7 -1
  5. package/dist/lib/adapters/version/3.0/brand-fields.js +139 -3
  6. package/dist/lib/adapters/version/3.0/brand-fields.mjs +136 -2
  7. package/dist/lib/adapters/version/3.0/index.js +6 -0
  8. package/dist/lib/adapters/version/3.0/index.mjs +7 -1
  9. package/dist/lib/adapters/version/3.1/bidding.js +1 -1
  10. package/dist/lib/adapters/version/3.1/bidding.mjs +1 -1
  11. package/dist/lib/adapters/version/types.d.mts +5 -0
  12. package/dist/lib/adapters/version/types.d.ts +5 -0
  13. package/dist/lib/canonical-references/index.js +2 -0
  14. package/dist/lib/canonical-references/index.mjs +2 -0
  15. package/dist/lib/client/account-changes.d.mts +3 -1
  16. package/dist/lib/client/account-changes.d.ts +3 -1
  17. package/dist/lib/client/account-changes.js +22 -2
  18. package/dist/lib/client/account-changes.mjs +22 -2
  19. package/dist/lib/conformance/oracle.js +3 -2
  20. package/dist/lib/conformance/oracle.mjs +3 -2
  21. package/dist/lib/core/AgentClient.d.mts +165 -1
  22. package/dist/lib/core/AgentClient.d.ts +165 -1
  23. package/dist/lib/core/AgentClient.js +446 -8
  24. package/dist/lib/core/AgentClient.mjs +446 -8
  25. package/dist/lib/core/ConversationTypes.d.mts +8 -0
  26. package/dist/lib/core/ConversationTypes.d.ts +8 -0
  27. package/dist/lib/core/ProtocolResponseParser.d.mts +1 -1
  28. package/dist/lib/core/ProtocolResponseParser.d.ts +1 -1
  29. package/dist/lib/core/ProtocolResponseParser.js +28 -18
  30. package/dist/lib/core/ProtocolResponseParser.mjs +11 -1
  31. package/dist/lib/core/ResponseValidator.js +1 -1
  32. package/dist/lib/core/ResponseValidator.mjs +1 -1
  33. package/dist/lib/core/SingleAgentClient.d.mts +122 -7
  34. package/dist/lib/core/SingleAgentClient.d.ts +122 -7
  35. package/dist/lib/core/SingleAgentClient.js +601 -96
  36. package/dist/lib/core/SingleAgentClient.mjs +590 -84
  37. package/dist/lib/core/TaskExecutor.d.mts +7 -0
  38. package/dist/lib/core/TaskExecutor.d.ts +7 -0
  39. package/dist/lib/core/TaskExecutor.js +23 -8
  40. package/dist/lib/core/TaskExecutor.mjs +23 -8
  41. package/dist/lib/core/task-status.d.mts +2 -0
  42. package/dist/lib/core/task-status.d.ts +2 -0
  43. package/dist/lib/core/task-status.js +11 -2
  44. package/dist/lib/core/task-status.mjs +9 -1
  45. package/dist/lib/errors/index.d.mts +22 -0
  46. package/dist/lib/errors/index.d.ts +22 -0
  47. package/dist/lib/errors/index.js +43 -0
  48. package/dist/lib/errors/index.mjs +42 -0
  49. package/dist/lib/identity-3.3/trust.d.mts +1 -4
  50. package/dist/lib/identity-3.3/trust.d.ts +1 -4
  51. package/dist/lib/identity-3.3/trust.js +34 -21
  52. package/dist/lib/identity-3.3/trust.mjs +34 -21
  53. package/dist/lib/identity-3.3/validation.js +5 -3
  54. package/dist/lib/identity-3.3/validation.mjs +6 -4
  55. package/dist/lib/index.d.mts +7 -53
  56. package/dist/lib/index.d.ts +7 -53
  57. package/dist/lib/index.js +13 -0
  58. package/dist/lib/index.mjs +9 -0
  59. package/dist/lib/media-buy/compatibility.js +6 -1
  60. package/dist/lib/media-buy/compatibility.mjs +6 -1
  61. package/dist/lib/protocols/mcp-modern.d.mts +2 -0
  62. package/dist/lib/protocols/mcp-modern.d.ts +2 -0
  63. package/dist/lib/protocols/mcp-modern.js +31 -5
  64. package/dist/lib/protocols/mcp-modern.mjs +31 -5
  65. package/dist/lib/protocols/mcp-scope.d.mts +6 -1
  66. package/dist/lib/protocols/mcp-scope.d.ts +6 -1
  67. package/dist/lib/protocols/mcp-scope.js +25 -3
  68. package/dist/lib/protocols/mcp-scope.mjs +24 -3
  69. package/dist/lib/protocols/mcp.js +12 -6
  70. package/dist/lib/protocols/mcp.mjs +13 -6
  71. package/dist/lib/reporting/inspection.js +1 -0
  72. package/dist/lib/reporting/inspection.mjs +1 -0
  73. package/dist/lib/reporting/ledger/coverage.d.mts +5 -0
  74. package/dist/lib/reporting/ledger/coverage.d.ts +5 -0
  75. package/dist/lib/reporting/ledger/coverage.js +37 -3
  76. package/dist/lib/reporting/ledger/coverage.mjs +36 -3
  77. package/dist/lib/reporting/ledger/handler.js +7 -4
  78. package/dist/lib/reporting/ledger/handler.mjs +7 -4
  79. package/dist/lib/reporting/ledger/producer.js +215 -69
  80. package/dist/lib/reporting/ledger/producer.mjs +217 -70
  81. package/dist/lib/reporting/ledger/schedule.d.mts +2 -2
  82. package/dist/lib/reporting/ledger/schedule.d.ts +2 -2
  83. package/dist/lib/reporting/ledger/schedule.js +8 -5
  84. package/dist/lib/reporting/ledger/schedule.mjs +8 -5
  85. package/dist/lib/reporting/ledger/status-ingest.d.mts +1 -1
  86. package/dist/lib/reporting/ledger/status-ingest.d.ts +1 -1
  87. package/dist/lib/reporting/ledger/status-ingest.js +4 -3
  88. package/dist/lib/reporting/ledger/status-ingest.mjs +4 -3
  89. package/dist/lib/reporting/ledger/types.d.mts +36 -1
  90. package/dist/lib/reporting/ledger/types.d.ts +36 -1
  91. package/dist/lib/reporting/service/index.d.mts +14 -1
  92. package/dist/lib/reporting/service/index.d.ts +14 -1
  93. package/dist/lib/reporting/service/index.js +24 -12
  94. package/dist/lib/reporting/service/index.mjs +24 -12
  95. package/dist/lib/schemas/browser.d.mts +2 -0
  96. package/dist/lib/schemas/browser.d.ts +2 -0
  97. package/dist/lib/schemas/browser.js +3 -0
  98. package/dist/lib/schemas/browser.mjs +2 -0
  99. package/dist/lib/schemas/index.d.mts +5 -3
  100. package/dist/lib/schemas/index.d.ts +5 -3
  101. package/dist/lib/schemas/index.js +5 -0
  102. package/dist/lib/schemas/index.mjs +4 -0
  103. package/dist/lib/server/account-response-identity.d.mts +17 -0
  104. package/dist/lib/server/account-response-identity.d.ts +17 -0
  105. package/dist/lib/server/account-response-identity.js +52 -0
  106. package/dist/lib/server/account-response-identity.mjs +28 -0
  107. package/dist/lib/server/account-sync-contract.js +2 -2
  108. package/dist/lib/server/account-sync-contract.mjs +2 -2
  109. package/dist/lib/server/create-adcp-server.js +33 -20
  110. package/dist/lib/server/create-adcp-server.mjs +36 -12
  111. package/dist/lib/server/decisioning/account.d.mts +36 -10
  112. package/dist/lib/server/decisioning/account.d.ts +36 -10
  113. package/dist/lib/server/decisioning/account.js +33 -14
  114. package/dist/lib/server/decisioning/account.mjs +33 -14
  115. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +5 -5
  116. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +5 -5
  117. package/dist/lib/server/decisioning/runtime/from-platform.js +4 -4
  118. package/dist/lib/server/decisioning/runtime/from-platform.mjs +4 -4
  119. package/dist/lib/server/media-buy-store.d.mts +26 -12
  120. package/dist/lib/server/media-buy-store.d.ts +26 -12
  121. package/dist/lib/server/media-buy-store.js +69 -21
  122. package/dist/lib/server/media-buy-store.mjs +69 -21
  123. package/dist/lib/server/notification-subscriptions/runtime.d.mts +1 -1
  124. package/dist/lib/server/notification-subscriptions/runtime.d.ts +1 -1
  125. package/dist/lib/server/notification-subscriptions/runtime.js +4 -0
  126. package/dist/lib/server/notification-subscriptions/runtime.mjs +4 -0
  127. package/dist/lib/server/responses.js +9 -1
  128. package/dist/lib/server/responses.mjs +9 -1
  129. package/dist/lib/signing/agent-fetch.d.mts +1 -1
  130. package/dist/lib/signing/agent-fetch.d.ts +1 -1
  131. package/dist/lib/signing/agent-fetch.js +3 -3
  132. package/dist/lib/signing/agent-fetch.mjs +3 -3
  133. package/dist/lib/testing/client.d.mts +1 -0
  134. package/dist/lib/testing/client.d.ts +1 -0
  135. package/dist/lib/testing/client.js +6 -5
  136. package/dist/lib/testing/client.mjs +6 -5
  137. package/dist/lib/testing/storyboard/agent-routing.d.mts +5 -2
  138. package/dist/lib/testing/storyboard/agent-routing.d.ts +5 -2
  139. package/dist/lib/testing/storyboard/agent-routing.js +11 -4
  140. package/dist/lib/testing/storyboard/agent-routing.mjs +11 -4
  141. package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +60 -14
  142. package/dist/lib/testing/storyboard/canonical-format-satisfaction.mjs +60 -14
  143. package/dist/lib/testing/storyboard/compliance.d.mts +2 -5
  144. package/dist/lib/testing/storyboard/compliance.d.ts +2 -5
  145. package/dist/lib/testing/storyboard/compliance.js +62 -13
  146. package/dist/lib/testing/storyboard/compliance.mjs +63 -14
  147. package/dist/lib/testing/storyboard/context.d.mts +13 -3
  148. package/dist/lib/testing/storyboard/context.d.ts +13 -3
  149. package/dist/lib/testing/storyboard/context.js +15 -10
  150. package/dist/lib/testing/storyboard/context.mjs +15 -10
  151. package/dist/lib/testing/storyboard/request-signing/vector-loader.d.mts +2 -0
  152. package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts +2 -0
  153. package/dist/lib/testing/storyboard/request-signing/vector-loader.js +11 -0
  154. package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +10 -0
  155. package/dist/lib/testing/storyboard/runner.js +141 -13
  156. package/dist/lib/testing/storyboard/runner.mjs +141 -13
  157. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  158. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  159. package/dist/lib/testing/storyboard/validations.js +4 -1
  160. package/dist/lib/testing/storyboard/validations.mjs +4 -1
  161. package/dist/lib/testing/test-controller.js +3 -0
  162. package/dist/lib/testing/test-controller.mjs +3 -0
  163. package/dist/lib/types/accept-proposal.d.ts +20 -28
  164. package/dist/lib/types/asset-instances.d.mts +1 -1
  165. package/dist/lib/types/asset-instances.d.ts +1 -1
  166. package/dist/lib/types/buy-products.d.ts +20 -28
  167. package/dist/lib/types/check-governance.d.ts +20 -28
  168. package/dist/lib/types/comply-test-controller.d.ts +20 -28
  169. package/dist/lib/types/control-media-buy.d.ts +20 -28
  170. package/dist/lib/types/core.generated.d.mts +273 -184
  171. package/dist/lib/types/core.generated.d.ts +273 -184
  172. package/dist/lib/types/create-media-buy.d.ts +20 -28
  173. package/dist/lib/types/get-media-buys.d.ts +20 -28
  174. package/dist/lib/types/get-products.d.ts +20 -28
  175. package/dist/lib/types/index.d.mts +6 -1
  176. package/dist/lib/types/index.d.ts +6 -1
  177. package/dist/lib/types/index.js +6 -1
  178. package/dist/lib/types/index.mjs +4 -1
  179. package/dist/lib/types/inline-enums.generated.d.mts +30 -4
  180. package/dist/lib/types/inline-enums.generated.d.ts +30 -4
  181. package/dist/lib/types/inline-enums.generated.js +41 -2
  182. package/dist/lib/types/inline-enums.generated.mjs +28 -2
  183. package/dist/lib/types/list-products.d.ts +20 -28
  184. package/dist/lib/types/list-proposals.d.ts +20 -28
  185. package/dist/lib/types/media-buy-delivery-report.d.mts +6 -0
  186. package/dist/lib/types/media-buy-delivery-report.d.ts +6 -0
  187. package/dist/lib/types/media-buy-delivery-report.js +16 -0
  188. package/dist/lib/types/media-buy-delivery-report.mjs +0 -0
  189. package/dist/lib/types/refine-proposals.d.ts +20 -28
  190. package/dist/lib/types/request-proposals.d.ts +20 -28
  191. package/dist/lib/types/schemas.generated.d.ts +63113 -127273
  192. package/dist/lib/types/schemas.generated.js +759 -770
  193. package/dist/lib/types/schemas.generated.mjs +759 -770
  194. package/dist/lib/types/targeting-keys.generated.d.mts +4 -0
  195. package/dist/lib/types/targeting-keys.generated.d.ts +4 -0
  196. package/dist/lib/types/targeting-keys.generated.js +109 -0
  197. package/dist/lib/types/targeting-keys.generated.mjs +84 -0
  198. package/dist/lib/types/tools.generated.d.mts +2 -68
  199. package/dist/lib/types/tools.generated.d.ts +2 -68
  200. package/dist/lib/types/update-media-buy.d.ts +20 -28
  201. package/dist/lib/utils/adcp-version-config.js +5 -2
  202. package/dist/lib/utils/adcp-version-config.mjs +5 -2
  203. package/dist/lib/utils/envelope-status-compat.d.mts +18 -1
  204. package/dist/lib/utils/envelope-status-compat.d.ts +18 -1
  205. package/dist/lib/utils/envelope-status-compat.js +11 -5
  206. package/dist/lib/utils/envelope-status-compat.mjs +11 -5
  207. package/dist/lib/utils/response-unwrapper.js +18 -10
  208. package/dist/lib/utils/response-unwrapper.mjs +18 -10
  209. package/dist/lib/v2/format-schema/resolver.js +1 -1
  210. package/dist/lib/v2/format-schema/resolver.mjs +1 -1
  211. package/dist/lib/v2/projection/creative-delivery.js +159 -39
  212. package/dist/lib/v2/projection/creative-delivery.mjs +163 -39
  213. package/dist/lib/v2/projection/index.d.mts +1 -0
  214. package/dist/lib/v2/projection/index.d.ts +1 -0
  215. package/dist/lib/v2/projection/index.js +3 -0
  216. package/dist/lib/v2/projection/index.mjs +2 -0
  217. package/dist/lib/v2/projection/legacy-metadata.d.mts +19 -0
  218. package/dist/lib/v2/projection/legacy-metadata.d.ts +19 -0
  219. package/dist/lib/v2/projection/legacy-metadata.js +91 -0
  220. package/dist/lib/v2/projection/legacy-metadata.mjs +86 -0
  221. package/dist/lib/v2/projection/v1-to-v2.d.mts +1 -1
  222. package/dist/lib/v2/projection/v1-to-v2.d.ts +1 -1
  223. package/dist/lib/v2/projection/v1-to-v2.js +12 -9
  224. package/dist/lib/v2/projection/v1-to-v2.mjs +12 -9
  225. package/dist/lib/validation/budget-allocation.d.mts +3 -3
  226. package/dist/lib/validation/budget-allocation.d.ts +3 -3
  227. package/dist/lib/validation/compact-schema.d.mts +27 -0
  228. package/dist/lib/validation/compact-schema.d.ts +27 -0
  229. package/dist/lib/validation/compact-schema.js +276 -0
  230. package/dist/lib/validation/compact-schema.mjs +250 -0
  231. package/dist/lib/validation/media-buy-delivery-report.d.mts +8 -0
  232. package/dist/lib/validation/media-buy-delivery-report.d.ts +8 -0
  233. package/dist/lib/validation/media-buy-delivery-report.js +31 -0
  234. package/dist/lib/validation/media-buy-delivery-report.mjs +7 -0
  235. package/dist/lib/validation/nonempty-array.d.mts +15 -0
  236. package/dist/lib/validation/nonempty-array.d.ts +15 -0
  237. package/dist/lib/validation/nonempty-array.js +41 -0
  238. package/dist/lib/validation/nonempty-array.mjs +7 -0
  239. package/dist/lib/validation/schema-diagnostic-origins.d.mts +21 -0
  240. package/dist/lib/validation/schema-diagnostic-origins.d.ts +21 -0
  241. package/dist/lib/validation/schema-diagnostic-origins.js +193 -0
  242. package/dist/lib/validation/schema-diagnostic-origins.mjs +169 -0
  243. package/dist/lib/validation/schema-loader.js +86 -16
  244. package/dist/lib/validation/schema-loader.mjs +82 -16
  245. package/dist/lib/validation/schema-validator.d.mts +10 -19
  246. package/dist/lib/validation/schema-validator.d.ts +10 -19
  247. package/dist/lib/validation/schema-validator.js +136 -43
  248. package/dist/lib/validation/schema-validator.mjs +140 -44
  249. package/dist/lib/validation/sync-creatives.d.mts +22 -22
  250. package/dist/lib/validation/sync-creatives.d.ts +22 -22
  251. package/dist/lib/version.d.mts +3 -3
  252. package/dist/lib/version.d.ts +3 -3
  253. package/dist/lib/version.js +3 -3
  254. package/dist/lib/version.mjs +3 -3
  255. package/dist/lib/webhooks/index.d.mts +3 -0
  256. package/dist/lib/webhooks/index.d.ts +3 -0
  257. package/dist/lib/webhooks/index.js +3 -0
  258. package/dist/lib/webhooks/index.mjs +2 -0
  259. package/dist/lib/webhooks/media-buy-delivery.d.mts +43 -0
  260. package/dist/lib/webhooks/media-buy-delivery.d.ts +43 -0
  261. package/dist/lib/webhooks/media-buy-delivery.js +119 -0
  262. package/dist/lib/webhooks/media-buy-delivery.mjs +94 -0
  263. package/docs/TYPE-SUMMARY.md +2 -2
  264. package/docs/guides/COLLECTION-FIXTURE-FOUNDATION.md +11 -0
  265. package/docs/guides/DELIVERY-WEBHOOK-PARSING.md +142 -0
  266. package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +27 -1
  267. package/docs/guides/REPORTING-LEDGER.md +93 -0
  268. package/docs/guides/REPORTING-STABILITY.md +1 -1
  269. package/docs/guides/TYPED-CLIENT-TOOLS.md +49 -0
  270. package/docs/llms.txt +2 -2
  271. package/docs/migration-14.x-rc-worksheet.md +4 -4
  272. package/docs/migration-16-to-17.md +202 -2
  273. package/docs/migration-6.6-to-6.7.md +14 -0
  274. package/docs/migration-account-change-feed.md +15 -0
  275. package/docs/migration-reporting-storage-package.md +1 -1
  276. package/docs/recipes/verifying-inbound-webhooks.md +18 -2
  277. package/package.json +2 -2
@@ -0,0 +1,276 @@
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 compact_schema_exports = {};
20
+ __export(compact_schema_exports, {
21
+ COMPACT_DEFINITIONS_KEY: () => COMPACT_DEFINITIONS_KEY,
22
+ compactBundledSchema: () => compactBundledSchema,
23
+ compactSchemaForValidation: () => compactSchemaForValidation
24
+ });
25
+ module.exports = __toCommonJS(compact_schema_exports);
26
+ var import_node_crypto = require("node:crypto");
27
+ const COMPACT_DEFINITIONS_KEY = "x-adcp-compact-definitions";
28
+ const SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set(["properties", "patternProperties", "$defs", "definitions", "dependentSchemas"]);
29
+ const SCHEMA_ARRAY_KEYWORDS = /* @__PURE__ */ new Set(["allOf", "anyOf", "oneOf", "prefixItems"]);
30
+ const SCHEMA_VALUE_KEYWORDS = /* @__PURE__ */ new Set([
31
+ "additionalProperties",
32
+ "additionalItems",
33
+ "contains",
34
+ "if",
35
+ "then",
36
+ "else",
37
+ "not",
38
+ "propertyNames",
39
+ "contentSchema",
40
+ "unevaluatedProperties",
41
+ "unevaluatedItems"
42
+ ]);
43
+ function isObject(value) {
44
+ return value !== null && typeof value === "object" && !Array.isArray(value);
45
+ }
46
+ function forEachChildSchema(schema, visit) {
47
+ for (const [keyword, value] of Object.entries(schema)) {
48
+ if (SCHEMA_MAP_KEYWORDS.has(keyword) && isObject(value)) {
49
+ for (const child of Object.values(value)) visit(child);
50
+ } else if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
51
+ for (const child of value) visit(child);
52
+ } else if (SCHEMA_VALUE_KEYWORDS.has(keyword)) {
53
+ visit(value);
54
+ } else if (keyword === "items") {
55
+ if (Array.isArray(value)) {
56
+ for (const child of value) visit(child);
57
+ } else {
58
+ visit(value);
59
+ }
60
+ } else if (keyword === "dependencies" && isObject(value)) {
61
+ for (const child of Object.values(value)) {
62
+ if (!Array.isArray(child)) visit(child);
63
+ }
64
+ }
65
+ }
66
+ }
67
+ function cloneData(value) {
68
+ if (Array.isArray(value)) return value.map(cloneData);
69
+ if (!isObject(value)) return value;
70
+ return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, cloneData(child)]));
71
+ }
72
+ function compactBundledSchema(root, options = {}) {
73
+ const referenceCounts = /* @__PURE__ */ new Map();
74
+ const visited = /* @__PURE__ */ new Set();
75
+ const countSchema = (value) => {
76
+ if (!isObject(value)) return;
77
+ referenceCounts.set(value, (referenceCounts.get(value) ?? 0) + 1);
78
+ if (visited.has(value)) return;
79
+ visited.add(value);
80
+ forEachChildSchema(value, countSchema);
81
+ };
82
+ countSchema(root);
83
+ const pointerAddressedNodes = /* @__PURE__ */ new Set();
84
+ const unionAlternatives = /* @__PURE__ */ new Set();
85
+ if (options.maxInlineSchemaBytes !== void 0) {
86
+ const rootUrl = new URL(typeof root.$id === "string" ? root.$id : "", "https://adcp.invalid/");
87
+ rootUrl.hash = "";
88
+ for (const schema of visited) {
89
+ for (const keyword of ["oneOf", "anyOf"]) {
90
+ const alternatives = schema[keyword];
91
+ if (Array.isArray(alternatives)) {
92
+ for (const alternative of alternatives) if (isObject(alternative)) unionAlternatives.add(alternative);
93
+ }
94
+ }
95
+ if (typeof schema.$ref !== "string") continue;
96
+ let fragment;
97
+ try {
98
+ const target = new URL(schema.$ref, rootUrl);
99
+ fragment = decodeURIComponent(target.hash.slice(1));
100
+ target.hash = "";
101
+ if (target.href !== rootUrl.href || !fragment.startsWith("/")) continue;
102
+ } catch {
103
+ continue;
104
+ }
105
+ let value = root;
106
+ for (const segment of fragment.slice(1).split("/")) {
107
+ if (isObject(value)) pointerAddressedNodes.add(value);
108
+ if (!isObject(value) && !Array.isArray(value)) break;
109
+ const key = segment.replace(/~1/g, "/").replace(/~0/g, "~");
110
+ value = value[key];
111
+ }
112
+ if (isObject(value)) pointerAddressedNodes.add(value);
113
+ }
114
+ }
115
+ const signatureCache = /* @__PURE__ */ new Map();
116
+ const weightCache = /* @__PURE__ */ new Map();
117
+ const schemaSignature = (schema) => {
118
+ const cached = signatureCache.get(schema);
119
+ if (cached) return cached;
120
+ const hash = (0, import_node_crypto.createHash)("sha256");
121
+ const updateHash = (value) => {
122
+ hash.update(`${Buffer.byteLength(value)}:`);
123
+ hash.update(value);
124
+ };
125
+ let weight = 2;
126
+ for (const [keyword, value] of Object.entries(schema)) {
127
+ updateHash(keyword);
128
+ if (SCHEMA_MAP_KEYWORDS.has(keyword) && isObject(value)) {
129
+ for (const [key, child] of Object.entries(value)) {
130
+ updateHash(key);
131
+ if (isObject(child)) {
132
+ updateHash(schemaSignature(child));
133
+ weight += weightCache.get(child) ?? 0;
134
+ } else {
135
+ const serialized = JSON.stringify(child);
136
+ updateHash(serialized);
137
+ weight += Buffer.byteLength(serialized);
138
+ }
139
+ }
140
+ } else if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
141
+ for (const child of value) {
142
+ if (isObject(child)) {
143
+ updateHash(schemaSignature(child));
144
+ weight += weightCache.get(child) ?? 0;
145
+ } else {
146
+ const serialized = JSON.stringify(child);
147
+ updateHash(serialized);
148
+ weight += Buffer.byteLength(serialized);
149
+ }
150
+ }
151
+ } else if (SCHEMA_VALUE_KEYWORDS.has(keyword) && isObject(value)) {
152
+ updateHash(schemaSignature(value));
153
+ weight += weightCache.get(value) ?? 0;
154
+ } else if (keyword === "items") {
155
+ updateHash(Array.isArray(value) ? "tuple" : "single");
156
+ const children = Array.isArray(value) ? value : [value];
157
+ for (const child of children) {
158
+ if (isObject(child)) {
159
+ updateHash(schemaSignature(child));
160
+ weight += weightCache.get(child) ?? 0;
161
+ } else {
162
+ const serialized = JSON.stringify(child);
163
+ updateHash(serialized);
164
+ weight += Buffer.byteLength(serialized);
165
+ }
166
+ }
167
+ } else if (keyword === "dependencies" && isObject(value)) {
168
+ for (const [key, child] of Object.entries(value)) {
169
+ updateHash(key);
170
+ if (isObject(child)) {
171
+ updateHash(schemaSignature(child));
172
+ weight += weightCache.get(child) ?? 0;
173
+ } else {
174
+ const serialized = JSON.stringify(child);
175
+ updateHash(serialized);
176
+ weight += Buffer.byteLength(serialized);
177
+ }
178
+ }
179
+ } else {
180
+ const serialized = JSON.stringify(value);
181
+ updateHash(serialized);
182
+ weight += Buffer.byteLength(serialized);
183
+ }
184
+ }
185
+ const signature = hash.digest("hex");
186
+ signatureCache.set(schema, signature);
187
+ weightCache.set(schema, weight);
188
+ return signature;
189
+ };
190
+ const signatureGroups = /* @__PURE__ */ new Map();
191
+ for (const schema of visited) {
192
+ if (schema === root || pointerAddressedNodes.has(schema) || unionAlternatives.has(schema)) continue;
193
+ const signature = schemaSignature(schema);
194
+ const group = signatureGroups.get(signature) ?? [];
195
+ group.push(schema);
196
+ signatureGroups.set(signature, group);
197
+ }
198
+ const sharedNames = /* @__PURE__ */ new Map();
199
+ const sharedDefinitions = /* @__PURE__ */ new Map();
200
+ const reservedNames = new Set(isObject(root.$defs) ? Object.keys(root.$defs) : []);
201
+ let sharedIndex = 0;
202
+ for (const group of signatureGroups.values()) {
203
+ const useCount = group.reduce((sum, schema) => sum + (referenceCounts.get(schema) ?? 0), 0);
204
+ const weight = weightCache.get(group[0]) ?? 0;
205
+ const identityShared = group.some((schema) => (referenceCounts.get(schema) ?? 0) > 1);
206
+ const largeValidationNode = options.maxInlineSchemaBytes !== void 0 && weight >= options.maxInlineSchemaBytes;
207
+ if (!largeValidationNode && (useCount < 2 || !identityShared && weight < 256)) continue;
208
+ let name;
209
+ do
210
+ name = `__adcp_shared_${sharedIndex++}`;
211
+ while (reservedNames.has(name));
212
+ reservedNames.add(name);
213
+ for (const schema of group) sharedNames.set(schema, name);
214
+ sharedDefinitions.set(name, group[0]);
215
+ }
216
+ const encodeSchema = (schema, expanding, ancestors = /* @__PURE__ */ new Set()) => {
217
+ if (!isObject(schema)) return schema;
218
+ const sharedName = sharedNames.get(schema);
219
+ if (sharedName && schema !== expanding) return { $ref: `#/$defs/${sharedName}` };
220
+ if (ancestors.has(schema)) {
221
+ if (!sharedName) throw new Error("Dereferenced schema contains an unaddressable cycle");
222
+ return { $ref: `#/$defs/${sharedName}` };
223
+ }
224
+ const nextAncestors = new Set(ancestors);
225
+ nextAncestors.add(schema);
226
+ const encoded = {};
227
+ for (const [keyword, value] of Object.entries(schema)) {
228
+ if (SCHEMA_MAP_KEYWORDS.has(keyword) && isObject(value)) {
229
+ encoded[keyword] = Object.fromEntries(
230
+ Object.entries(value).map(([key, child]) => [key, encodeSchema(child, void 0, nextAncestors)])
231
+ );
232
+ } else if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
233
+ encoded[keyword] = value.map((child) => encodeSchema(child, void 0, nextAncestors));
234
+ } else if (SCHEMA_VALUE_KEYWORDS.has(keyword)) {
235
+ encoded[keyword] = encodeSchema(value, void 0, nextAncestors);
236
+ } else if (keyword === "items") {
237
+ encoded[keyword] = Array.isArray(value) ? value.map((child) => encodeSchema(child, void 0, nextAncestors)) : encodeSchema(value, void 0, nextAncestors);
238
+ } else if (keyword === "dependencies" && isObject(value)) {
239
+ encoded[keyword] = Object.fromEntries(
240
+ Object.entries(value).map(([key, child]) => [
241
+ key,
242
+ Array.isArray(child) ? cloneData(child) : encodeSchema(child, void 0, nextAncestors)
243
+ ])
244
+ );
245
+ } else {
246
+ encoded[keyword] = cloneData(value);
247
+ }
248
+ }
249
+ return encoded;
250
+ };
251
+ const compacted = encodeSchema(root, root);
252
+ if (compacted[COMPACT_DEFINITIONS_KEY] !== void 0) {
253
+ throw new Error(`Schema already contains reserved property ${COMPACT_DEFINITIONS_KEY}`);
254
+ }
255
+ const defs = isObject(compacted.$defs) ? { ...compacted.$defs } : {};
256
+ for (const [name, schema] of sharedDefinitions) defs[name] = encodeSchema(schema, schema);
257
+ if (Object.keys(defs).length > 0) compacted.$defs = defs;
258
+ if (sharedDefinitions.size > 0) compacted[COMPACT_DEFINITIONS_KEY] = [...sharedDefinitions.keys()];
259
+ return compacted;
260
+ }
261
+ function compactSchemaForValidation(schema) {
262
+ const copied = cloneData(schema);
263
+ const stripIds = (node, root = false) => {
264
+ if (!isObject(node)) return;
265
+ if (!root) delete node.$id;
266
+ forEachChildSchema(node, (child) => stripIds(child));
267
+ };
268
+ stripIds(copied, true);
269
+ return compactBundledSchema(copied, { maxInlineSchemaBytes: 1024 });
270
+ }
271
+ // Annotate the CommonJS export names for ESM import in node:
272
+ 0 && (module.exports = {
273
+ COMPACT_DEFINITIONS_KEY,
274
+ compactBundledSchema,
275
+ compactSchemaForValidation
276
+ });
@@ -0,0 +1,250 @@
1
+ import { createHash } from "node:crypto";
2
+ const COMPACT_DEFINITIONS_KEY = "x-adcp-compact-definitions";
3
+ const SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set(["properties", "patternProperties", "$defs", "definitions", "dependentSchemas"]);
4
+ const SCHEMA_ARRAY_KEYWORDS = /* @__PURE__ */ new Set(["allOf", "anyOf", "oneOf", "prefixItems"]);
5
+ const SCHEMA_VALUE_KEYWORDS = /* @__PURE__ */ new Set([
6
+ "additionalProperties",
7
+ "additionalItems",
8
+ "contains",
9
+ "if",
10
+ "then",
11
+ "else",
12
+ "not",
13
+ "propertyNames",
14
+ "contentSchema",
15
+ "unevaluatedProperties",
16
+ "unevaluatedItems"
17
+ ]);
18
+ function isObject(value) {
19
+ return value !== null && typeof value === "object" && !Array.isArray(value);
20
+ }
21
+ function forEachChildSchema(schema, visit) {
22
+ for (const [keyword, value] of Object.entries(schema)) {
23
+ if (SCHEMA_MAP_KEYWORDS.has(keyword) && isObject(value)) {
24
+ for (const child of Object.values(value)) visit(child);
25
+ } else if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
26
+ for (const child of value) visit(child);
27
+ } else if (SCHEMA_VALUE_KEYWORDS.has(keyword)) {
28
+ visit(value);
29
+ } else if (keyword === "items") {
30
+ if (Array.isArray(value)) {
31
+ for (const child of value) visit(child);
32
+ } else {
33
+ visit(value);
34
+ }
35
+ } else if (keyword === "dependencies" && isObject(value)) {
36
+ for (const child of Object.values(value)) {
37
+ if (!Array.isArray(child)) visit(child);
38
+ }
39
+ }
40
+ }
41
+ }
42
+ function cloneData(value) {
43
+ if (Array.isArray(value)) return value.map(cloneData);
44
+ if (!isObject(value)) return value;
45
+ return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, cloneData(child)]));
46
+ }
47
+ function compactBundledSchema(root, options = {}) {
48
+ const referenceCounts = /* @__PURE__ */ new Map();
49
+ const visited = /* @__PURE__ */ new Set();
50
+ const countSchema = (value) => {
51
+ if (!isObject(value)) return;
52
+ referenceCounts.set(value, (referenceCounts.get(value) ?? 0) + 1);
53
+ if (visited.has(value)) return;
54
+ visited.add(value);
55
+ forEachChildSchema(value, countSchema);
56
+ };
57
+ countSchema(root);
58
+ const pointerAddressedNodes = /* @__PURE__ */ new Set();
59
+ const unionAlternatives = /* @__PURE__ */ new Set();
60
+ if (options.maxInlineSchemaBytes !== void 0) {
61
+ const rootUrl = new URL(typeof root.$id === "string" ? root.$id : "", "https://adcp.invalid/");
62
+ rootUrl.hash = "";
63
+ for (const schema of visited) {
64
+ for (const keyword of ["oneOf", "anyOf"]) {
65
+ const alternatives = schema[keyword];
66
+ if (Array.isArray(alternatives)) {
67
+ for (const alternative of alternatives) if (isObject(alternative)) unionAlternatives.add(alternative);
68
+ }
69
+ }
70
+ if (typeof schema.$ref !== "string") continue;
71
+ let fragment;
72
+ try {
73
+ const target = new URL(schema.$ref, rootUrl);
74
+ fragment = decodeURIComponent(target.hash.slice(1));
75
+ target.hash = "";
76
+ if (target.href !== rootUrl.href || !fragment.startsWith("/")) continue;
77
+ } catch {
78
+ continue;
79
+ }
80
+ let value = root;
81
+ for (const segment of fragment.slice(1).split("/")) {
82
+ if (isObject(value)) pointerAddressedNodes.add(value);
83
+ if (!isObject(value) && !Array.isArray(value)) break;
84
+ const key = segment.replace(/~1/g, "/").replace(/~0/g, "~");
85
+ value = value[key];
86
+ }
87
+ if (isObject(value)) pointerAddressedNodes.add(value);
88
+ }
89
+ }
90
+ const signatureCache = /* @__PURE__ */ new Map();
91
+ const weightCache = /* @__PURE__ */ new Map();
92
+ const schemaSignature = (schema) => {
93
+ const cached = signatureCache.get(schema);
94
+ if (cached) return cached;
95
+ const hash = createHash("sha256");
96
+ const updateHash = (value) => {
97
+ hash.update(`${Buffer.byteLength(value)}:`);
98
+ hash.update(value);
99
+ };
100
+ let weight = 2;
101
+ for (const [keyword, value] of Object.entries(schema)) {
102
+ updateHash(keyword);
103
+ if (SCHEMA_MAP_KEYWORDS.has(keyword) && isObject(value)) {
104
+ for (const [key, child] of Object.entries(value)) {
105
+ updateHash(key);
106
+ if (isObject(child)) {
107
+ updateHash(schemaSignature(child));
108
+ weight += weightCache.get(child) ?? 0;
109
+ } else {
110
+ const serialized = JSON.stringify(child);
111
+ updateHash(serialized);
112
+ weight += Buffer.byteLength(serialized);
113
+ }
114
+ }
115
+ } else if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
116
+ for (const child of value) {
117
+ if (isObject(child)) {
118
+ updateHash(schemaSignature(child));
119
+ weight += weightCache.get(child) ?? 0;
120
+ } else {
121
+ const serialized = JSON.stringify(child);
122
+ updateHash(serialized);
123
+ weight += Buffer.byteLength(serialized);
124
+ }
125
+ }
126
+ } else if (SCHEMA_VALUE_KEYWORDS.has(keyword) && isObject(value)) {
127
+ updateHash(schemaSignature(value));
128
+ weight += weightCache.get(value) ?? 0;
129
+ } else if (keyword === "items") {
130
+ updateHash(Array.isArray(value) ? "tuple" : "single");
131
+ const children = Array.isArray(value) ? value : [value];
132
+ for (const child of children) {
133
+ if (isObject(child)) {
134
+ updateHash(schemaSignature(child));
135
+ weight += weightCache.get(child) ?? 0;
136
+ } else {
137
+ const serialized = JSON.stringify(child);
138
+ updateHash(serialized);
139
+ weight += Buffer.byteLength(serialized);
140
+ }
141
+ }
142
+ } else if (keyword === "dependencies" && isObject(value)) {
143
+ for (const [key, child] of Object.entries(value)) {
144
+ updateHash(key);
145
+ if (isObject(child)) {
146
+ updateHash(schemaSignature(child));
147
+ weight += weightCache.get(child) ?? 0;
148
+ } else {
149
+ const serialized = JSON.stringify(child);
150
+ updateHash(serialized);
151
+ weight += Buffer.byteLength(serialized);
152
+ }
153
+ }
154
+ } else {
155
+ const serialized = JSON.stringify(value);
156
+ updateHash(serialized);
157
+ weight += Buffer.byteLength(serialized);
158
+ }
159
+ }
160
+ const signature = hash.digest("hex");
161
+ signatureCache.set(schema, signature);
162
+ weightCache.set(schema, weight);
163
+ return signature;
164
+ };
165
+ const signatureGroups = /* @__PURE__ */ new Map();
166
+ for (const schema of visited) {
167
+ if (schema === root || pointerAddressedNodes.has(schema) || unionAlternatives.has(schema)) continue;
168
+ const signature = schemaSignature(schema);
169
+ const group = signatureGroups.get(signature) ?? [];
170
+ group.push(schema);
171
+ signatureGroups.set(signature, group);
172
+ }
173
+ const sharedNames = /* @__PURE__ */ new Map();
174
+ const sharedDefinitions = /* @__PURE__ */ new Map();
175
+ const reservedNames = new Set(isObject(root.$defs) ? Object.keys(root.$defs) : []);
176
+ let sharedIndex = 0;
177
+ for (const group of signatureGroups.values()) {
178
+ const useCount = group.reduce((sum, schema) => sum + (referenceCounts.get(schema) ?? 0), 0);
179
+ const weight = weightCache.get(group[0]) ?? 0;
180
+ const identityShared = group.some((schema) => (referenceCounts.get(schema) ?? 0) > 1);
181
+ const largeValidationNode = options.maxInlineSchemaBytes !== void 0 && weight >= options.maxInlineSchemaBytes;
182
+ if (!largeValidationNode && (useCount < 2 || !identityShared && weight < 256)) continue;
183
+ let name;
184
+ do
185
+ name = `__adcp_shared_${sharedIndex++}`;
186
+ while (reservedNames.has(name));
187
+ reservedNames.add(name);
188
+ for (const schema of group) sharedNames.set(schema, name);
189
+ sharedDefinitions.set(name, group[0]);
190
+ }
191
+ const encodeSchema = (schema, expanding, ancestors = /* @__PURE__ */ new Set()) => {
192
+ if (!isObject(schema)) return schema;
193
+ const sharedName = sharedNames.get(schema);
194
+ if (sharedName && schema !== expanding) return { $ref: `#/$defs/${sharedName}` };
195
+ if (ancestors.has(schema)) {
196
+ if (!sharedName) throw new Error("Dereferenced schema contains an unaddressable cycle");
197
+ return { $ref: `#/$defs/${sharedName}` };
198
+ }
199
+ const nextAncestors = new Set(ancestors);
200
+ nextAncestors.add(schema);
201
+ const encoded = {};
202
+ for (const [keyword, value] of Object.entries(schema)) {
203
+ if (SCHEMA_MAP_KEYWORDS.has(keyword) && isObject(value)) {
204
+ encoded[keyword] = Object.fromEntries(
205
+ Object.entries(value).map(([key, child]) => [key, encodeSchema(child, void 0, nextAncestors)])
206
+ );
207
+ } else if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
208
+ encoded[keyword] = value.map((child) => encodeSchema(child, void 0, nextAncestors));
209
+ } else if (SCHEMA_VALUE_KEYWORDS.has(keyword)) {
210
+ encoded[keyword] = encodeSchema(value, void 0, nextAncestors);
211
+ } else if (keyword === "items") {
212
+ encoded[keyword] = Array.isArray(value) ? value.map((child) => encodeSchema(child, void 0, nextAncestors)) : encodeSchema(value, void 0, nextAncestors);
213
+ } else if (keyword === "dependencies" && isObject(value)) {
214
+ encoded[keyword] = Object.fromEntries(
215
+ Object.entries(value).map(([key, child]) => [
216
+ key,
217
+ Array.isArray(child) ? cloneData(child) : encodeSchema(child, void 0, nextAncestors)
218
+ ])
219
+ );
220
+ } else {
221
+ encoded[keyword] = cloneData(value);
222
+ }
223
+ }
224
+ return encoded;
225
+ };
226
+ const compacted = encodeSchema(root, root);
227
+ if (compacted[COMPACT_DEFINITIONS_KEY] !== void 0) {
228
+ throw new Error(`Schema already contains reserved property ${COMPACT_DEFINITIONS_KEY}`);
229
+ }
230
+ const defs = isObject(compacted.$defs) ? { ...compacted.$defs } : {};
231
+ for (const [name, schema] of sharedDefinitions) defs[name] = encodeSchema(schema, schema);
232
+ if (Object.keys(defs).length > 0) compacted.$defs = defs;
233
+ if (sharedDefinitions.size > 0) compacted[COMPACT_DEFINITIONS_KEY] = [...sharedDefinitions.keys()];
234
+ return compacted;
235
+ }
236
+ function compactSchemaForValidation(schema) {
237
+ const copied = cloneData(schema);
238
+ const stripIds = (node, root = false) => {
239
+ if (!isObject(node)) return;
240
+ if (!root) delete node.$id;
241
+ forEachChildSchema(node, (child) => stripIds(child));
242
+ };
243
+ stripIds(copied, true);
244
+ return compactBundledSchema(copied, { maxInlineSchemaBytes: 1024 });
245
+ }
246
+ export {
247
+ COMPACT_DEFINITIONS_KEY,
248
+ compactBundledSchema,
249
+ compactSchemaForValidation
250
+ };
@@ -0,0 +1,8 @@
1
+ import type { z } from 'zod';
2
+ import type { MediaBuyDeliveryReport } from '../types/media-buy-delivery-report.mjs';
3
+ /**
4
+ * Payload-only reporting shape at the SDK pin. Poll responses still require
5
+ * their task status; webhook receivers validate the separate outer envelope.
6
+ * Use parseMediaBuyDeliveryWebhook for strict validation at an older release.
7
+ */
8
+ export declare const MediaBuyDeliveryReportSchema: z.ZodType<MediaBuyDeliveryReport>;
@@ -0,0 +1,8 @@
1
+ import type { z } from 'zod';
2
+ import type { MediaBuyDeliveryReport } from '../types/media-buy-delivery-report';
3
+ /**
4
+ * Payload-only reporting shape at the SDK pin. Poll responses still require
5
+ * their task status; webhook receivers validate the separate outer envelope.
6
+ * Use parseMediaBuyDeliveryWebhook for strict validation at an older release.
7
+ */
8
+ export declare const MediaBuyDeliveryReportSchema: z.ZodType<MediaBuyDeliveryReport>;
@@ -0,0 +1,31 @@
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 media_buy_delivery_report_exports = {};
20
+ __export(media_buy_delivery_report_exports, {
21
+ MediaBuyDeliveryReportSchema: () => MediaBuyDeliveryReportSchema
22
+ });
23
+ module.exports = __toCommonJS(media_buy_delivery_report_exports);
24
+ var import_schemas = require('../types/schemas.generated.js');
25
+ const MediaBuyDeliveryReportSchema = /* @__PURE__ */ import_schemas.GetMediaBuyDeliveryResponseSchema.omit({
26
+ status: true
27
+ });
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ MediaBuyDeliveryReportSchema
31
+ });
@@ -0,0 +1,7 @@
1
+ import { GetMediaBuyDeliveryResponseSchema } from "../types/schemas.generated.mjs";
2
+ const MediaBuyDeliveryReportSchema = /* @__PURE__ */ GetMediaBuyDeliveryResponseSchema.omit({
3
+ status: true
4
+ });
5
+ export {
6
+ MediaBuyDeliveryReportSchema
7
+ };
@@ -0,0 +1,15 @@
1
+ import * as z from 'zod';
2
+ type ArrayBoundMethods = 'min' | 'max' | 'length' | 'nonempty';
3
+ /** A normal ZodArray whose checked minimum is reflected in its input/output. */
4
+ export interface NonemptyArraySchema<Element extends z.ZodType> extends Omit<z.ZodArray<Element>, keyof z.ZodType | ArrayBoundMethods>, z.ZodType<[z.output<Element>, ...z.output<Element>[]], [z.input<Element>, ...z.input<Element>[]]> {
5
+ min(...args: Parameters<z.ZodArray<Element>['min']>): this;
6
+ max(...args: Parameters<z.ZodArray<Element>['max']>): this;
7
+ length(...args: Parameters<z.ZodArray<Element>['length']>): this;
8
+ nonempty(...args: Parameters<z.ZodArray<Element>['nonempty']>): this;
9
+ }
10
+ /**
11
+ * Zod 4's .min(1) retains an array type. Reflect the enforced bound without
12
+ * turning homogeneous wire arrays into JSON Schema prefixItems tuples.
13
+ */
14
+ export declare function nonemptyArray<Element extends z.ZodType>(element: Element): NonemptyArraySchema<Element>;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import * as z from 'zod';
2
+ type ArrayBoundMethods = 'min' | 'max' | 'length' | 'nonempty';
3
+ /** A normal ZodArray whose checked minimum is reflected in its input/output. */
4
+ export interface NonemptyArraySchema<Element extends z.ZodType> extends Omit<z.ZodArray<Element>, keyof z.ZodType | ArrayBoundMethods>, z.ZodType<[z.output<Element>, ...z.output<Element>[]], [z.input<Element>, ...z.input<Element>[]]> {
5
+ min(...args: Parameters<z.ZodArray<Element>['min']>): this;
6
+ max(...args: Parameters<z.ZodArray<Element>['max']>): this;
7
+ length(...args: Parameters<z.ZodArray<Element>['length']>): this;
8
+ nonempty(...args: Parameters<z.ZodArray<Element>['nonempty']>): this;
9
+ }
10
+ /**
11
+ * Zod 4's .min(1) retains an array type. Reflect the enforced bound without
12
+ * turning homogeneous wire arrays into JSON Schema prefixItems tuples.
13
+ */
14
+ export declare function nonemptyArray<Element extends z.ZodType>(element: Element): NonemptyArraySchema<Element>;
15
+ export {};
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var nonempty_array_exports = {};
30
+ __export(nonempty_array_exports, {
31
+ nonemptyArray: () => nonemptyArray
32
+ });
33
+ module.exports = __toCommonJS(nonempty_array_exports);
34
+ var z = __toESM(require("zod"));
35
+ function nonemptyArray(element) {
36
+ return z.array(element).min(1);
37
+ }
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ nonemptyArray
41
+ });
@@ -0,0 +1,7 @@
1
+ import * as z from "zod";
2
+ function nonemptyArray(element) {
3
+ return z.array(element).min(1);
4
+ }
5
+ export {
6
+ nonemptyArray
7
+ };