@adcp/sdk 14.0.0-rc.38 → 14.0.0-rc.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (600) hide show
  1. package/bin/adcp-storyboard-summary.js +286 -0
  2. package/bin/adcp.js +221 -10
  3. package/dist/lib/conformance/schemaLoader.d.mts +1 -1
  4. package/dist/lib/conformance/schemaLoader.d.ts +1 -1
  5. package/dist/lib/core/AgentClient.d.mts +6 -1
  6. package/dist/lib/core/AgentClient.d.ts +6 -1
  7. package/dist/lib/core/AgentClient.js +9 -0
  8. package/dist/lib/core/AgentClient.mjs +9 -0
  9. package/dist/lib/core/ConversationTypes.d.mts +29 -0
  10. package/dist/lib/core/ConversationTypes.d.ts +29 -0
  11. package/dist/lib/core/SingleAgentClient.d.mts +3 -1
  12. package/dist/lib/core/SingleAgentClient.d.ts +3 -1
  13. package/dist/lib/core/SingleAgentClient.js +9 -1
  14. package/dist/lib/core/SingleAgentClient.mjs +9 -1
  15. package/dist/lib/core/TaskExecutor.d.mts +13 -1
  16. package/dist/lib/core/TaskExecutor.d.ts +13 -1
  17. package/dist/lib/core/TaskExecutor.js +216 -18
  18. package/dist/lib/core/TaskExecutor.mjs +216 -19
  19. package/dist/lib/index.d.mts +5 -2
  20. package/dist/lib/index.d.ts +5 -2
  21. package/dist/lib/index.js +10 -1
  22. package/dist/lib/index.mjs +10 -1
  23. package/dist/lib/media-buy/action-assessment.d.mts +77 -0
  24. package/dist/lib/media-buy/action-assessment.d.ts +77 -0
  25. package/dist/lib/media-buy/action-assessment.js +300 -0
  26. package/dist/lib/media-buy/action-assessment.mjs +284 -0
  27. package/dist/lib/media-buy/action-constraints.d.mts +9 -0
  28. package/dist/lib/media-buy/action-constraints.d.ts +9 -0
  29. package/dist/lib/media-buy/action-constraints.js +170 -0
  30. package/dist/lib/media-buy/action-constraints.mjs +146 -0
  31. package/dist/lib/media-buy/action-contracts.d.mts +40 -0
  32. package/dist/lib/media-buy/action-contracts.d.ts +40 -0
  33. package/dist/lib/media-buy/action-contracts.js +304 -0
  34. package/dist/lib/media-buy/action-contracts.mjs +267 -0
  35. package/dist/lib/media-buy/action-metadata.generated.d.mts +37 -0
  36. package/dist/lib/media-buy/action-metadata.generated.d.ts +37 -0
  37. package/dist/lib/media-buy/action-metadata.generated.js +128 -0
  38. package/dist/lib/media-buy/action-metadata.generated.mjs +101 -0
  39. package/dist/lib/media-buy/action-types.d.mts +106 -0
  40. package/dist/lib/media-buy/action-types.d.ts +106 -0
  41. package/dist/lib/{types/v3-1-beta/tools.generated.js → media-buy/action-types.js} +2 -2
  42. package/dist/lib/media-buy/actions.d.mts +6 -0
  43. package/dist/lib/media-buy/actions.d.ts +6 -0
  44. package/dist/lib/media-buy/actions.js +38 -0
  45. package/dist/lib/media-buy/actions.mjs +9 -0
  46. package/dist/lib/media-buy/available-actions.d.mts +2 -1
  47. package/dist/lib/media-buy/available-actions.d.ts +2 -1
  48. package/dist/lib/media-buy/available-actions.js +4 -3
  49. package/dist/lib/media-buy/available-actions.mjs +4 -3
  50. package/dist/lib/media-buy/compatibility.js +3 -0
  51. package/dist/lib/media-buy/compatibility.mjs +3 -0
  52. package/dist/lib/media-buy/index.d.mts +4 -0
  53. package/dist/lib/media-buy/index.d.ts +4 -0
  54. package/dist/lib/media-buy/index.js +3 -1
  55. package/dist/lib/media-buy/index.mjs +1 -0
  56. package/dist/lib/media-buy/legacy-action-ids.d.mts +1 -0
  57. package/dist/lib/media-buy/legacy-action-ids.d.ts +1 -0
  58. package/dist/lib/media-buy/legacy-action-ids.js +50 -0
  59. package/dist/lib/media-buy/legacy-action-ids.mjs +26 -0
  60. package/dist/lib/media-buy/mutations.d.mts +70 -0
  61. package/dist/lib/media-buy/mutations.d.ts +70 -0
  62. package/dist/lib/media-buy/mutations.js +525 -0
  63. package/dist/lib/media-buy/mutations.mjs +498 -0
  64. package/dist/lib/media-buy/preflight.d.mts +20 -69
  65. package/dist/lib/media-buy/preflight.d.ts +20 -69
  66. package/dist/lib/media-buy/preflight.js +100 -336
  67. package/dist/lib/media-buy/preflight.mjs +111 -333
  68. package/dist/lib/media-buy/targeting-input.d.mts +7 -4
  69. package/dist/lib/media-buy/targeting-input.d.ts +7 -4
  70. package/dist/lib/media-buy/types.d.mts +55 -7
  71. package/dist/lib/media-buy/types.d.ts +55 -7
  72. package/dist/lib/protocols/rawResponseCapture.d.mts +12 -0
  73. package/dist/lib/protocols/rawResponseCapture.d.ts +12 -0
  74. package/dist/lib/protocols/rawResponseCapture.js +33 -3
  75. package/dist/lib/protocols/rawResponseCapture.mjs +32 -3
  76. package/dist/lib/registry/types.generated.d.mts +377 -9
  77. package/dist/lib/registry/types.generated.d.ts +377 -9
  78. package/dist/lib/reporting/evidence.d.mts +1 -0
  79. package/dist/lib/reporting/evidence.d.ts +1 -0
  80. package/dist/lib/reporting/evidence.js +32 -3
  81. package/dist/lib/reporting/evidence.mjs +31 -3
  82. package/dist/lib/reporting/ledger/handler.d.mts +51 -1
  83. package/dist/lib/reporting/ledger/handler.d.ts +51 -1
  84. package/dist/lib/reporting/ledger/handler.js +306 -38
  85. package/dist/lib/reporting/ledger/handler.mjs +304 -37
  86. package/dist/lib/reporting/ledger/health.d.mts +12 -0
  87. package/dist/lib/reporting/ledger/health.d.ts +12 -0
  88. package/dist/lib/reporting/ledger/health.js +15 -2
  89. package/dist/lib/reporting/ledger/health.mjs +13 -1
  90. package/dist/lib/reporting/ledger/index.d.mts +3 -0
  91. package/dist/lib/reporting/ledger/index.d.ts +3 -0
  92. package/dist/lib/reporting/ledger/index.js +7 -1
  93. package/dist/lib/reporting/ledger/index.mjs +3 -0
  94. package/dist/lib/reporting/ledger/lifecycle.d.mts +31 -4
  95. package/dist/lib/reporting/ledger/lifecycle.d.ts +31 -4
  96. package/dist/lib/reporting/ledger/lifecycle.js +244 -37
  97. package/dist/lib/reporting/ledger/lifecycle.mjs +244 -37
  98. package/dist/lib/reporting/ledger/managed-postgres.d.mts +231 -0
  99. package/dist/lib/reporting/ledger/managed-postgres.d.ts +231 -0
  100. package/dist/lib/reporting/ledger/managed-postgres.js +1797 -0
  101. package/dist/lib/reporting/ledger/managed-postgres.mjs +1776 -0
  102. package/dist/lib/reporting/ledger/managed.d.mts +355 -0
  103. package/dist/lib/reporting/ledger/managed.d.ts +355 -0
  104. package/dist/lib/reporting/ledger/managed.js +661 -0
  105. package/dist/lib/reporting/ledger/managed.mjs +633 -0
  106. package/dist/lib/reporting/ledger/notification-activity.d.mts +222 -0
  107. package/dist/lib/reporting/ledger/notification-activity.d.ts +222 -0
  108. package/dist/lib/reporting/ledger/notification-activity.js +1139 -0
  109. package/dist/lib/reporting/ledger/notification-activity.mjs +1110 -0
  110. package/dist/lib/reporting/ledger/postgres.d.mts +161 -1
  111. package/dist/lib/reporting/ledger/postgres.d.ts +161 -1
  112. package/dist/lib/reporting/ledger/postgres.js +1153 -21
  113. package/dist/lib/reporting/ledger/postgres.mjs +1152 -21
  114. package/dist/lib/reporting/ledger/producer.d.mts +8 -0
  115. package/dist/lib/reporting/ledger/producer.d.ts +8 -0
  116. package/dist/lib/reporting/ledger/producer.js +146 -52
  117. package/dist/lib/reporting/ledger/producer.mjs +146 -51
  118. package/dist/lib/reporting/ledger/types.d.mts +358 -1
  119. package/dist/lib/reporting/ledger/types.d.ts +358 -1
  120. package/dist/lib/reporting/ledger/types.js +3 -0
  121. package/dist/lib/reporting/ledger/types.mjs +2 -0
  122. package/dist/lib/reporting/service/conformance.d.mts +35 -0
  123. package/dist/lib/reporting/service/conformance.d.ts +35 -0
  124. package/dist/lib/reporting/service/conformance.js +89 -0
  125. package/dist/lib/reporting/service/conformance.mjs +68 -0
  126. package/dist/lib/reporting/service/index.d.mts +182 -0
  127. package/dist/lib/reporting/service/index.d.ts +182 -0
  128. package/dist/lib/reporting/service/index.js +793 -0
  129. package/dist/lib/reporting/service/index.mjs +787 -0
  130. package/dist/lib/reporting/source/index.d.mts +2 -1
  131. package/dist/lib/reporting/source/index.d.ts +2 -1
  132. package/dist/lib/reporting/source/index.js +16 -3
  133. package/dist/lib/reporting/source/index.mjs +12 -1
  134. package/dist/lib/reporting/source/inline.d.mts +88 -1
  135. package/dist/lib/reporting/source/inline.d.ts +88 -1
  136. package/dist/lib/reporting/source/inline.js +1161 -163
  137. package/dist/lib/reporting/source/inline.mjs +1166 -163
  138. package/dist/lib/reporting/source/manifest.js +12 -7
  139. package/dist/lib/reporting/source/manifest.mjs +12 -7
  140. package/dist/lib/reporting/source/source.d.mts +26 -0
  141. package/dist/lib/reporting/source/source.d.ts +26 -0
  142. package/dist/lib/reporting/source/source.js +71 -2
  143. package/dist/lib/reporting/source/source.mjs +65 -1
  144. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  145. package/dist/lib/server/create-adcp-server.d.mts +18 -0
  146. package/dist/lib/server/create-adcp-server.d.ts +18 -0
  147. package/dist/lib/server/create-adcp-server.js +52 -2
  148. package/dist/lib/server/create-adcp-server.mjs +52 -2
  149. package/dist/lib/server/decisioning/account.d.mts +1 -1
  150. package/dist/lib/server/decisioning/account.d.ts +1 -1
  151. package/dist/lib/server/decisioning/index.d.mts +1 -0
  152. package/dist/lib/server/decisioning/index.d.ts +1 -0
  153. package/dist/lib/server/decisioning/platform.d.mts +3 -0
  154. package/dist/lib/server/decisioning/platform.d.ts +3 -0
  155. package/dist/lib/server/decisioning/runtime/from-platform.js +88 -10
  156. package/dist/lib/server/decisioning/runtime/from-platform.mjs +88 -10
  157. package/dist/lib/server/decisioning/specialisms/reporting.d.mts +38 -0
  158. package/dist/lib/server/decisioning/specialisms/reporting.d.ts +38 -0
  159. package/dist/lib/{types/v3-1-beta/index.js → server/decisioning/specialisms/reporting.js} +2 -8
  160. package/dist/lib/server/decisioning/specialisms/reporting.mjs +0 -0
  161. package/dist/lib/server/index.d.mts +4 -2
  162. package/dist/lib/server/index.d.ts +4 -2
  163. package/dist/lib/server/index.js +5 -0
  164. package/dist/lib/server/index.mjs +4 -0
  165. package/dist/lib/server/media-buy-action-resolver.d.mts +63 -0
  166. package/dist/lib/server/media-buy-action-resolver.d.ts +63 -0
  167. package/dist/lib/server/media-buy-action-resolver.js +297 -0
  168. package/dist/lib/server/media-buy-action-resolver.mjs +285 -0
  169. package/dist/lib/server/media-buy-actions.d.mts +7 -8
  170. package/dist/lib/server/media-buy-actions.d.ts +7 -8
  171. package/dist/lib/server/media-buy-actions.js +57 -14
  172. package/dist/lib/server/media-buy-actions.mjs +63 -14
  173. package/dist/lib/server/notification-subscriptions/index.d.mts +2 -2
  174. package/dist/lib/server/notification-subscriptions/index.d.ts +2 -2
  175. package/dist/lib/server/notification-subscriptions/index.js +2 -0
  176. package/dist/lib/server/notification-subscriptions/index.mjs +2 -0
  177. package/dist/lib/server/notification-subscriptions/postgres-runtime.d.mts +3 -1
  178. package/dist/lib/server/notification-subscriptions/postgres-runtime.d.ts +3 -1
  179. package/dist/lib/server/notification-subscriptions/postgres-runtime.js +1 -0
  180. package/dist/lib/server/notification-subscriptions/postgres-runtime.mjs +1 -0
  181. package/dist/lib/server/notification-subscriptions/runtime.d.mts +12 -1
  182. package/dist/lib/server/notification-subscriptions/runtime.d.ts +12 -1
  183. package/dist/lib/server/notification-subscriptions/runtime.js +102 -16
  184. package/dist/lib/server/notification-subscriptions/runtime.mjs +101 -16
  185. package/dist/lib/server/notification-subscriptions/types.d.mts +104 -1
  186. package/dist/lib/server/notification-subscriptions/types.d.ts +104 -1
  187. package/dist/lib/server/webhook-emitter.d.mts +40 -5
  188. package/dist/lib/server/webhook-emitter.d.ts +40 -5
  189. package/dist/lib/server/webhook-emitter.js +23 -12
  190. package/dist/lib/server/webhook-emitter.mjs +23 -12
  191. package/dist/lib/storage/interfaces.d.mts +14 -2
  192. package/dist/lib/storage/interfaces.d.ts +14 -2
  193. package/dist/lib/testing/compliance/comply.d.mts +9 -3
  194. package/dist/lib/testing/compliance/comply.d.ts +9 -3
  195. package/dist/lib/testing/compliance/comply.js +158 -3
  196. package/dist/lib/testing/compliance/comply.mjs +159 -4
  197. package/dist/lib/testing/compliance/storyboard-tracks.js +7 -5
  198. package/dist/lib/testing/compliance/storyboard-tracks.mjs +7 -5
  199. package/dist/lib/testing/compliance/summary.js +10 -1
  200. package/dist/lib/testing/compliance/summary.mjs +10 -1
  201. package/dist/lib/testing/index.d.mts +1 -1
  202. package/dist/lib/testing/index.d.ts +1 -1
  203. package/dist/lib/testing/index.js +2 -0
  204. package/dist/lib/testing/index.mjs +3 -1
  205. package/dist/lib/testing/storyboard/agent-routing.d.mts +12 -43
  206. package/dist/lib/testing/storyboard/agent-routing.d.ts +12 -43
  207. package/dist/lib/testing/storyboard/agent-routing.js +75 -13
  208. package/dist/lib/testing/storyboard/agent-routing.mjs +70 -12
  209. package/dist/lib/testing/storyboard/index.d.mts +1 -0
  210. package/dist/lib/testing/storyboard/index.d.ts +1 -0
  211. package/dist/lib/testing/storyboard/index.js +3 -0
  212. package/dist/lib/testing/storyboard/index.mjs +2 -0
  213. package/dist/lib/testing/storyboard/junit.d.mts +1 -1
  214. package/dist/lib/testing/storyboard/junit.d.ts +1 -1
  215. package/dist/lib/testing/storyboard/junit.js +21 -2
  216. package/dist/lib/testing/storyboard/junit.mjs +21 -2
  217. package/dist/lib/testing/storyboard/probes.d.mts +130 -0
  218. package/dist/lib/testing/storyboard/probes.d.ts +130 -0
  219. package/dist/lib/testing/storyboard/probes.js +682 -10
  220. package/dist/lib/testing/storyboard/probes.mjs +683 -3
  221. package/dist/lib/testing/storyboard/request-signing/builder.d.mts +16 -5
  222. package/dist/lib/testing/storyboard/request-signing/builder.d.ts +16 -5
  223. package/dist/lib/testing/storyboard/request-signing/grader.d.mts +44 -1
  224. package/dist/lib/testing/storyboard/request-signing/grader.d.ts +44 -1
  225. package/dist/lib/testing/storyboard/request-signing/grader.js +46 -22
  226. package/dist/lib/testing/storyboard/request-signing/grader.mjs +43 -21
  227. package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.mts +86 -11
  228. package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.ts +86 -11
  229. package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +119 -25
  230. package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +117 -26
  231. package/dist/lib/testing/storyboard/request-signing/synthesize.js +22 -2
  232. package/dist/lib/testing/storyboard/request-signing/synthesize.mjs +22 -2
  233. package/dist/lib/testing/storyboard/runner.d.mts +103 -0
  234. package/dist/lib/testing/storyboard/runner.d.ts +103 -0
  235. package/dist/lib/testing/storyboard/runner.js +1090 -268
  236. package/dist/lib/testing/storyboard/runner.mjs +1096 -261
  237. package/dist/lib/testing/storyboard/seeding.d.mts +4 -1
  238. package/dist/lib/testing/storyboard/seeding.d.ts +4 -1
  239. package/dist/lib/testing/storyboard/seeding.js +55 -24
  240. package/dist/lib/testing/storyboard/seeding.mjs +55 -24
  241. package/dist/lib/testing/storyboard/test-kit.d.mts +37 -3
  242. package/dist/lib/testing/storyboard/test-kit.d.ts +37 -3
  243. package/dist/lib/testing/storyboard/test-kit.js +8 -2
  244. package/dist/lib/testing/storyboard/test-kit.mjs +7 -2
  245. package/dist/lib/testing/storyboard/types.d.mts +132 -10
  246. package/dist/lib/testing/storyboard/types.d.ts +132 -10
  247. package/dist/lib/testing/storyboard/types.js +17 -0
  248. package/dist/lib/testing/storyboard/types.mjs +16 -0
  249. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  250. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  251. package/dist/lib/testing/storyboard/validations.js +16 -0
  252. package/dist/lib/testing/storyboard/validations.mjs +16 -0
  253. package/dist/lib/testing/test-controller.d.mts +1 -1
  254. package/dist/lib/testing/test-controller.d.ts +1 -1
  255. package/dist/lib/types/buy-products.d.ts +71 -6
  256. package/dist/lib/types/control-media-buy.d.ts +25 -11
  257. package/dist/lib/types/core.generated.d.mts +69 -10
  258. package/dist/lib/types/core.generated.d.ts +69 -10
  259. package/dist/lib/types/create-media-buy.d.ts +71 -6
  260. package/dist/lib/types/forward-compat-error-codes.d.mts +7 -6
  261. package/dist/lib/types/forward-compat-error-codes.d.ts +7 -6
  262. package/dist/lib/types/index.d.mts +2 -2
  263. package/dist/lib/types/index.d.ts +2 -2
  264. package/dist/lib/types/schemas.generated.d.ts +8040 -8116
  265. package/dist/lib/types/schemas.generated.js +1074 -309
  266. package/dist/lib/types/schemas.generated.mjs +1068 -309
  267. package/dist/lib/types/tools.generated.d.mts +65 -6
  268. package/dist/lib/types/tools.generated.d.ts +65 -6
  269. package/dist/lib/types/update-media-buy.d.ts +71 -6
  270. package/dist/lib/utils/redact-secrets.d.mts +1 -1
  271. package/dist/lib/utils/redact-secrets.d.ts +1 -1
  272. package/dist/lib/utils/redact-secrets.js +1 -1
  273. package/dist/lib/utils/redact-secrets.mjs +1 -1
  274. package/dist/lib/v2/projection/cache-versions.d.mts +0 -1
  275. package/dist/lib/v2/projection/cache-versions.d.ts +0 -1
  276. package/dist/lib/v2/projection/cache-versions.js +1 -15
  277. package/dist/lib/v2/projection/cache-versions.mjs +1 -14
  278. package/dist/lib/v2/projection/canonical-properties.js +2 -2
  279. package/dist/lib/v2/projection/canonical-properties.mjs +3 -3
  280. package/dist/lib/v2/projection/registry.d.mts +1 -1
  281. package/dist/lib/v2/projection/registry.d.ts +1 -1
  282. package/dist/lib/v2/projection/registry.js +2 -2
  283. package/dist/lib/v2/projection/registry.mjs +3 -3
  284. package/dist/lib/version.d.mts +5 -5
  285. package/dist/lib/version.d.ts +5 -5
  286. package/dist/lib/version.js +3 -8
  287. package/dist/lib/version.mjs +3 -8
  288. package/dist/lib/wholesale-feed-sync/index.d.mts +1 -0
  289. package/dist/lib/wholesale-feed-sync/index.d.ts +1 -0
  290. package/dist/lib/wholesale-feed-sync/protocol-types.d.mts +42 -0
  291. package/dist/lib/wholesale-feed-sync/protocol-types.d.ts +42 -0
  292. package/dist/lib/wholesale-feed-sync/protocol-types.js +16 -0
  293. package/dist/lib/wholesale-feed-sync/protocol-types.mjs +0 -0
  294. package/dist/lib/wholesale-feed-sync/sync.d.mts +6 -6
  295. package/dist/lib/wholesale-feed-sync/sync.d.ts +6 -6
  296. package/dist/lib/wholesale-feed-sync/sync.js +3 -1
  297. package/dist/lib/wholesale-feed-sync/sync.mjs +3 -1
  298. package/dist/lib/wholesale-feed-sync/types.d.mts +15 -14
  299. package/dist/lib/wholesale-feed-sync/types.d.ts +15 -14
  300. package/dist/lib/wholesale-feed-sync/webhook-notification.d.mts +7 -5
  301. package/dist/lib/wholesale-feed-sync/webhook-notification.d.ts +7 -5
  302. package/dist/lib/wholesale-feed-sync/webhook-notification.js +45 -0
  303. package/dist/lib/wholesale-feed-sync/webhook-notification.mjs +44 -0
  304. package/docs/CLI.md +1 -1
  305. package/docs/TYPE-SUMMARY.md +118 -4
  306. package/docs/guides/ASYNC-API-REFERENCE.md +62 -1
  307. package/docs/guides/ASYNC-DEVELOPER-GUIDE.md +25 -0
  308. package/docs/guides/ASYNC-DOCUMENTATION-INDEX.md +3 -0
  309. package/docs/guides/BUYER-QUICKSTART-3.2.md +5 -0
  310. package/docs/guides/DURABLE-BUYER-WRITES.md +337 -0
  311. package/docs/guides/EXISTING-PLATFORM.md +35 -0
  312. package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +7 -3
  313. package/docs/guides/MEDIA-BUY-ACTION-ASSESSMENT.md +300 -0
  314. package/docs/guides/REPORTING-LEDGER.md +654 -3
  315. package/docs/guides/REPORTING-SOURCE-EXECUTOR.md +63 -1
  316. package/docs/guides/SELLER-QUICKSTART-3.2.md +2 -0
  317. package/docs/guides/VALIDATE-YOUR-AGENT.md +35 -0
  318. package/docs/guides/idempotency-crash-recovery.md +4 -0
  319. package/docs/llms.txt +4 -2
  320. package/docs/migration-14.x-rc-worksheet.md +5 -5
  321. package/docs/migration-7.9-to-7.10.md +7 -5
  322. package/examples/README.md +17 -0
  323. package/examples/durable-buyer-writes/caller.ts +745 -0
  324. package/examples/durable-buyer-writes/worker.ts +240 -0
  325. package/examples/reliable-reporting-service/README.md +100 -0
  326. package/examples/seller-3.2-starter.ts +7 -8
  327. package/examples/targeting-input-existing-platform.ts +153 -0
  328. package/package.json +41 -29
  329. package/skills/build-seller-agent/specialisms/signed-requests.md +11 -1
  330. package/skills/cross-cutting.md +28 -11
  331. package/compliance/cache/3.1.0-beta.7/domains/brand/index.yaml +0 -160
  332. package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/distributed_brand_resolution.yaml +0 -415
  333. package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/single_side_trust_extension.yaml +0 -454
  334. package/compliance/cache/3.1.0-beta.7/domains/creative/index.yaml +0 -339
  335. package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/billing_out_of_band.yaml +0 -153
  336. package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
  337. package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/native_in_feed.yaml +0 -543
  338. package/compliance/cache/3.1.0-beta.7/domains/governance/index.yaml +0 -682
  339. package/compliance/cache/3.1.0-beta.7/domains/media-buy/index.yaml +0 -781
  340. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/audience_buy_flow.yaml +0 -380
  341. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/available_actions.yaml +0 -565
  342. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
  343. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/canonical_formats.yaml +0 -711
  344. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
  345. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
  346. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -234
  347. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
  348. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_reception.yaml +0 -247
  349. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/delivery_reporting.yaml +0 -357
  350. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment.yaml +0 -633
  351. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
  352. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/event_dedup_flow.yaml +0 -399
  353. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
  354. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_approved.yaml +0 -214
  355. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_conditions.yaml +0 -199
  356. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied.yaml +0 -204
  357. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
  358. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/invalid_transitions.yaml +0 -289
  359. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
  360. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
  361. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_accountability.yaml +0 -244
  362. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
  363. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
  364. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
  365. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow.yaml +0 -428
  366. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
  367. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/product_signal_targeting.yaml +0 -373
  368. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize.yaml +0 -399
  369. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
  370. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
  371. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
  372. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_enforcement.yaml +0 -517
  373. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
  374. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/reach_buy_flow.yaml +0 -823
  375. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
  376. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_products.yaml +0 -148
  377. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
  378. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
  379. package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
  380. package/compliance/cache/3.1.0-beta.7/domains/media-buy/state-machine.yaml +0 -442
  381. package/compliance/cache/3.1.0-beta.7/domains/signals/index.yaml +0 -266
  382. package/compliance/cache/3.1.0-beta.7/domains/sponsored-intelligence/index.yaml +0 -256
  383. package/compliance/cache/3.1.0-beta.7/index.json +0 -356
  384. package/compliance/cache/3.1.0-beta.7/protocols/brand/index.yaml +0 -160
  385. package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/distributed_brand_resolution.yaml +0 -415
  386. package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/single_side_trust_extension.yaml +0 -454
  387. package/compliance/cache/3.1.0-beta.7/protocols/creative/index.yaml +0 -339
  388. package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/billing_out_of_band.yaml +0 -153
  389. package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
  390. package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/native_in_feed.yaml +0 -543
  391. package/compliance/cache/3.1.0-beta.7/protocols/governance/index.yaml +0 -682
  392. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/index.yaml +0 -781
  393. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/audience_buy_flow.yaml +0 -380
  394. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/available_actions.yaml +0 -565
  395. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
  396. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/canonical_formats.yaml +0 -711
  397. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
  398. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
  399. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -234
  400. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
  401. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_reception.yaml +0 -247
  402. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -357
  403. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment.yaml +0 -633
  404. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
  405. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/event_dedup_flow.yaml +0 -399
  406. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
  407. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_approved.yaml +0 -214
  408. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_conditions.yaml +0 -199
  409. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied.yaml +0 -204
  410. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
  411. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -289
  412. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
  413. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
  414. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_accountability.yaml +0 -244
  415. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
  416. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
  417. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
  418. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow.yaml +0 -428
  419. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
  420. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/product_signal_targeting.yaml +0 -373
  421. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -399
  422. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
  423. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
  424. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
  425. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_enforcement.yaml +0 -517
  426. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
  427. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/reach_buy_flow.yaml +0 -823
  428. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
  429. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_products.yaml +0 -148
  430. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
  431. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
  432. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
  433. package/compliance/cache/3.1.0-beta.7/protocols/media-buy/state-machine.yaml +0 -442
  434. package/compliance/cache/3.1.0-beta.7/protocols/signals/index.yaml +0 -266
  435. package/compliance/cache/3.1.0-beta.7/protocols/sponsored-intelligence/index.yaml +0 -256
  436. package/compliance/cache/3.1.0-beta.7/specialisms/audience-sync/index.yaml +0 -313
  437. package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/index.yaml +0 -350
  438. package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -226
  439. package/compliance/cache/3.1.0-beta.7/specialisms/collection-lists/index.yaml +0 -359
  440. package/compliance/cache/3.1.0-beta.7/specialisms/content-standards/index.yaml +0 -572
  441. package/compliance/cache/3.1.0-beta.7/specialisms/creative-ad-server/index.yaml +0 -409
  442. package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/generative-seller.yaml +0 -807
  443. package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/index.yaml +0 -758
  444. package/compliance/cache/3.1.0-beta.7/specialisms/creative-template/index.yaml +0 -510
  445. package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/index.yaml +0 -143
  446. package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/scenarios/governance_multi_agent_rejected.yaml +0 -117
  447. package/compliance/cache/3.1.0-beta.7/specialisms/governance-delivery-monitor/index.yaml +0 -441
  448. package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/denied.yaml +0 -221
  449. package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/index.yaml +0 -330
  450. package/compliance/cache/3.1.0-beta.7/specialisms/property-lists/index.yaml +0 -482
  451. package/compliance/cache/3.1.0-beta.7/specialisms/sales-broadcast-tv/index.yaml +0 -738
  452. package/compliance/cache/3.1.0-beta.7/specialisms/sales-catalog-driven/index.yaml +0 -840
  453. package/compliance/cache/3.1.0-beta.7/specialisms/sales-guaranteed/index.yaml +0 -601
  454. package/compliance/cache/3.1.0-beta.7/specialisms/sales-non-guaranteed/index.yaml +0 -546
  455. package/compliance/cache/3.1.0-beta.7/specialisms/sales-proposal-mode/index.yaml +0 -586
  456. package/compliance/cache/3.1.0-beta.7/specialisms/sales-social/index.yaml +0 -919
  457. package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/index.yaml +0 -424
  458. package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -211
  459. package/compliance/cache/3.1.0-beta.7/specialisms/signal-owned/index.yaml +0 -317
  460. package/compliance/cache/3.1.0-beta.7/specialisms/sponsored-intelligence/index.yaml +0 -59
  461. package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor-live.yaml +0 -78
  462. package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor.yaml +0 -223
  463. package/compliance/cache/3.1.0-beta.7/test-kits/billing-gate-runner.yaml +0 -115
  464. package/compliance/cache/3.1.0-beta.7/test-kits/bistro-oranje.yaml +0 -126
  465. package/compliance/cache/3.1.0-beta.7/test-kits/distributed-brand-runner.yaml +0 -281
  466. package/compliance/cache/3.1.0-beta.7/test-kits/nova-motors.yaml +0 -262
  467. package/compliance/cache/3.1.0-beta.7/test-kits/osei-natural.yaml +0 -126
  468. package/compliance/cache/3.1.0-beta.7/test-kits/parallel-dispatch-runner.yaml +0 -196
  469. package/compliance/cache/3.1.0-beta.7/test-kits/rate-limit-trip-runner.yaml +0 -172
  470. package/compliance/cache/3.1.0-beta.7/test-kits/signed-requests-runner.yaml +0 -155
  471. package/compliance/cache/3.1.0-beta.7/test-kits/single-side-trust-runner.yaml +0 -294
  472. package/compliance/cache/3.1.0-beta.7/test-kits/substitution-observer-runner.yaml +0 -688
  473. package/compliance/cache/3.1.0-beta.7/test-kits/summit-foods.yaml +0 -125
  474. package/compliance/cache/3.1.0-beta.7/test-kits/webhook-receiver-runner.yaml +0 -265
  475. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/001-minimal-plan.json +0 -43
  476. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/002-full-plan.json +0 -217
  477. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -60
  478. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004a-human-review-omitted.json +0 -43
  479. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -49
  480. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -53
  481. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -57
  482. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -49
  483. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -53
  484. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/007-unicode-objectives.json +0 -43
  485. package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -65
  486. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/README.md +0 -220
  487. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/canonicalization.json +0 -241
  488. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/keys.json +0 -60
  489. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/001-no-signature-header.json +0 -24
  490. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/002-wrong-tag.json +0 -26
  491. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/003-expired-signature.json +0 -26
  492. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/004-window-too-long.json +0 -26
  493. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -26
  494. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -26
  495. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -26
  496. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -26
  497. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -27
  498. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -33
  499. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/011-malformed-header.json +0 -27
  500. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -26
  501. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/013-expires-le-created.json +0 -27
  502. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -27
  503. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/015-signature-invalid.json +0 -28
  504. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -35
  505. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/017-key-revoked.json +0 -38
  506. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -28
  507. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -26
  508. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/020-rate-abuse.json +0 -34
  509. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -31
  510. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -31
  511. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -32
  512. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -31
  513. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -43
  514. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -31
  515. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -25
  516. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/028-unsigned-protocol-method-required.json +0 -26
  517. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/001-basic-post.json +0 -30
  518. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -31
  519. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/003-es256-post.json +0 -30
  520. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -26
  521. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -30
  522. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -30
  523. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -30
  524. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -30
  525. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -30
  526. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -30
  527. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -30
  528. package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -30
  529. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/README.md +0 -211
  530. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/keys.json +0 -61
  531. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -26
  532. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -26
  533. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -26
  534. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -26
  535. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -26
  536. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -25
  537. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -26
  538. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -26
  539. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -26
  540. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -26
  541. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -25
  542. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -26
  543. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -26
  544. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -26
  545. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -26
  546. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -37
  547. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -32
  548. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -33
  549. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -32
  550. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -41
  551. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -26
  552. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/001-basic-post.json +0 -24
  553. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/002-es256-post.json +0 -24
  554. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -24
  555. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -24
  556. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -24
  557. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -24
  558. package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -25
  559. package/compliance/cache/3.1.0-beta.7/universal/billing-gate-dispatch.yaml +0 -450
  560. package/compliance/cache/3.1.0-beta.7/universal/canonical-format-validate-input.yaml +0 -640
  561. package/compliance/cache/3.1.0-beta.7/universal/capability-discovery.yaml +0 -125
  562. package/compliance/cache/3.1.0-beta.7/universal/collection-lists-pagination-integrity.yaml +0 -306
  563. package/compliance/cache/3.1.0-beta.7/universal/comply-controller-mode-gate.yaml +0 -141
  564. package/compliance/cache/3.1.0-beta.7/universal/content-standards-pagination-integrity.yaml +0 -326
  565. package/compliance/cache/3.1.0-beta.7/universal/deterministic-testing.yaml +0 -1430
  566. package/compliance/cache/3.1.0-beta.7/universal/error-compliance-signals.yaml +0 -377
  567. package/compliance/cache/3.1.0-beta.7/universal/error-compliance.yaml +0 -528
  568. package/compliance/cache/3.1.0-beta.7/universal/fictional-entities.yaml +0 -307
  569. package/compliance/cache/3.1.0-beta.7/universal/get-media-buys-pagination-integrity.yaml +0 -160
  570. package/compliance/cache/3.1.0-beta.7/universal/get-signals-pagination-integrity.yaml +0 -211
  571. package/compliance/cache/3.1.0-beta.7/universal/idempotency.yaml +0 -861
  572. package/compliance/cache/3.1.0-beta.7/universal/notification-config-event-scope.yaml +0 -119
  573. package/compliance/cache/3.1.0-beta.7/universal/notification-config-lifecycle.yaml +0 -337
  574. package/compliance/cache/3.1.0-beta.7/universal/notification-config-rejections.yaml +0 -107
  575. package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-creative-formats.yaml +0 -265
  576. package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-list-accounts.yaml +0 -245
  577. package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity.yaml +0 -263
  578. package/compliance/cache/3.1.0-beta.7/universal/property-lists-pagination-integrity.yaml +0 -307
  579. package/compliance/cache/3.1.0-beta.7/universal/read-tool-idempotency.yaml +0 -405
  580. package/compliance/cache/3.1.0-beta.7/universal/runner-output-contract.yaml +0 -1266
  581. package/compliance/cache/3.1.0-beta.7/universal/schema-validation-signals.yaml +0 -181
  582. package/compliance/cache/3.1.0-beta.7/universal/schema-validation.yaml +0 -548
  583. package/compliance/cache/3.1.0-beta.7/universal/security.yaml +0 -539
  584. package/compliance/cache/3.1.0-beta.7/universal/signed-requests.yaml +0 -217
  585. package/compliance/cache/3.1.0-beta.7/universal/stale-response-advisory.yaml +0 -295
  586. package/compliance/cache/3.1.0-beta.7/universal/storyboard-schema.yaml +0 -2136
  587. package/compliance/cache/3.1.0-beta.7/universal/v3-envelope-integrity.yaml +0 -117
  588. package/compliance/cache/3.1.0-beta.7/universal/version-negotiation.yaml +0 -130
  589. package/compliance/cache/3.1.0-beta.7/universal/webhook-emission.yaml +0 -411
  590. package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-bulk-webhooks.yaml +0 -82
  591. package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-product-webhooks.yaml +0 -83
  592. package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-products.yaml +0 -151
  593. package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signal-webhooks.yaml +0 -83
  594. package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signals.yaml +0 -149
  595. package/dist/lib/types/v3-1-beta/index.d.mts +0 -1
  596. package/dist/lib/types/v3-1-beta/index.d.ts +0 -1
  597. package/dist/lib/types/v3-1-beta/index.mjs +0 -1
  598. package/dist/lib/types/v3-1-beta/tools.generated.d.mts +0 -26788
  599. package/dist/lib/types/v3-1-beta/tools.generated.d.ts +0 -26788
  600. /package/dist/lib/{types/v3-1-beta/tools.generated.mjs → media-buy/action-types.mjs} +0 -0
@@ -12,6 +12,7 @@ import {
12
12
  import {
13
13
  aggregateReportingHealthV1,
14
14
  assertReportingConsumerMismatchEscalation,
15
+ reportingEffectiveConsumerMismatchEscalationV1,
15
16
  projectReportingConsumerStatusMismatchV1,
16
17
  projectReportingObligationHealthV1
17
18
  } from "./health.mjs";
@@ -19,7 +20,11 @@ import { compareReportingInstants } from "./instant.mjs";
19
20
  import { ReportingLedgerSnapshotUnavailableError } from "./types.mjs";
20
21
  function createReportingStatusHandler(store, options) {
21
22
  const consumerMismatchEscalation = assertReportingConsumerMismatchEscalation(
22
- resolveConsumerMismatchEscalation(options?.consumerMismatchEscalation, store)
23
+ reportingEffectiveConsumerMismatchEscalationV1(
24
+ options?.consumerMismatchEscalation,
25
+ store,
26
+ "createReportingStatusHandler"
27
+ )
23
28
  );
24
29
  const activeReadsByAccount = /* @__PURE__ */ new Map();
25
30
  return async (request, context) => {
@@ -163,6 +168,28 @@ function createReportingStatusHandler(store, options) {
163
168
  const consumerStatusPending = consumerId !== void 0 && consumerStatusProjection.length === 0 && // Strictly after: the duty is to post "no later than" the deadline, so
164
169
  // a buyer that posts at exactly that instant has met it.
165
170
  compareReportingInstants(page.snapshot.ledgerAsOf, obligation.recoveryDeadlineAt) > 0;
171
+ const baseProjection = {
172
+ ...projection,
173
+ issues: uniqueIssues([...persistedIssues, ...projection.issues, ...mismatch ? [mismatch.issue] : []])
174
+ };
175
+ const managed = projectManagedDelivery({
176
+ obligation,
177
+ binding: page.snapshot.managedBindings?.find((value) => value.configurationId === obligation.configurationId),
178
+ revisions,
179
+ adjustments: page.snapshot.adjustments.filter(
180
+ (value) => value.reporting_obligation_id === obligation.reporting_obligation_id
181
+ ),
182
+ materializations: (page.snapshot.materializationProjection ?? page.snapshot.materializations ?? []).filter(
183
+ (value) => value.reporting_obligation_id === obligation.reporting_obligation_id
184
+ ),
185
+ materializationHistory: (page.snapshot.materializationHistoryProjection ?? page.snapshot.materializations ?? []).filter((value) => value.reporting_obligation_id === obligation.reporting_obligation_id),
186
+ receipts: page.snapshot.receiptProjection ?? page.snapshot.receipts ?? [],
187
+ adjustmentReceipts: page.snapshot.adjustmentReceiptProjection ?? page.snapshot.adjustmentReceipts ?? [],
188
+ base: baseProjection,
189
+ ledgerAsOf: page.snapshot.ledgerAsOf,
190
+ tombstonedAcceptedSubjects: page.snapshot.tombstonedAcceptedSubjects,
191
+ tombstonedDeliveredRevisionIds: page.snapshot.tombstonedDeliveredRevisionIds
192
+ });
166
193
  return {
167
194
  obligation,
168
195
  revisions,
@@ -171,10 +198,15 @@ function createReportingStatusHandler(store, options) {
171
198
  currentConsumerStatus,
172
199
  consumerStatusPending,
173
200
  projection: {
174
- ...projection,
175
- ...mismatch ? { health: mismatch.health } : {},
176
- issues: uniqueIssues([...persistedIssues, ...projection.issues, ...mismatch ? [mismatch.issue] : []])
177
- }
201
+ ...managed?.projection ?? baseProjection,
202
+ ...mismatch ? {
203
+ health: moreSevereReportingHealthV1(
204
+ managed?.projection.health ?? baseProjection.health,
205
+ mismatch.health
206
+ )
207
+ } : {}
208
+ },
209
+ managed
178
210
  };
179
211
  });
180
212
  const healthFilter = view === "periods" && query.health ? new Set(query.health) : void 0;
@@ -188,6 +220,12 @@ function createReportingStatusHandler(store, options) {
188
220
  ledger_as_of: page.snapshot.ledgerAsOf,
189
221
  account_id: accountId
190
222
  };
223
+ const finality = page.snapshot.query.finality;
224
+ const visibleRevisionIds = new Set(
225
+ page.snapshot.revisions.filter((value) => !finality || finality.includes(value.finality)).map((value) => value.reporting_revision_id)
226
+ );
227
+ const visibleAdjustments = finality ? page.snapshot.adjustments.filter((value) => visibleRevisionIds.has(value.adjusts_reporting_revision_id)) : page.snapshot.adjustments;
228
+ const pageAdjustmentIds = new Set(page.adjustments.map((value) => value.reporting_adjustment_id));
191
229
  if (view === "revision") {
192
230
  const id = query.reporting_revision_id;
193
231
  const inSnapshot = id ? page.snapshot.revisions.some((value) => value.reporting_revision_id === id) : false;
@@ -203,6 +241,16 @@ function createReportingStatusHandler(store, options) {
203
241
  if (!revision) {
204
242
  return lookupUnavailable(view);
205
243
  }
244
+ const revisionAdjustmentIds = new Set(
245
+ visibleAdjustments.filter((value) => value.adjusts_reporting_revision_id === revision.reporting_revision_id).map((value) => value.reporting_adjustment_id)
246
+ );
247
+ const revisionAdjustmentReceipts = (page.adjustmentReceipts ?? []).filter(
248
+ (value) => revisionAdjustmentIds.has(value.reporting_adjustment_id)
249
+ );
250
+ const receiptAdjustmentIds = new Set(revisionAdjustmentReceipts.map((value) => value.reporting_adjustment_id));
251
+ const revisionAdjustments = visibleAdjustments.filter(
252
+ (value) => value.adjusts_reporting_revision_id === revision.reporting_revision_id && (pageAdjustmentIds.has(value.reporting_adjustment_id) || receiptAdjustmentIds.has(value.reporting_adjustment_id))
253
+ );
206
254
  return {
207
255
  ...base,
208
256
  view: "revision",
@@ -213,11 +261,20 @@ function createReportingStatusHandler(store, options) {
213
261
  row_count: revision.binding.rowCount
214
262
  },
215
263
  reporting_rows: revision.rows,
216
- adjustments: page.adjustments.filter((value) => value.adjusts_reporting_revision_id === revision.reporting_revision_id).map((value) => value.wireAdjustment),
264
+ adjustments: revisionAdjustments.map((value) => value.wireAdjustment),
217
265
  ...consumerId ? { consumer_statuses: (page.consumerStatuses ?? []).map(wireConsumerStatus) } : {},
218
- adjustment_receipts: [],
219
- materializations: [],
220
- receipts: [],
266
+ materializations: (page.materializations ?? []).filter(
267
+ (value) => value.reporting_revision_id === revision.reporting_revision_id
268
+ ),
269
+ receipts: (page.receipts ?? []).filter(
270
+ (value) => value.reporting_revision_id === revision.reporting_revision_id
271
+ ),
272
+ // RC3 `revision_adjustments`: "every adjustment_receipt, when
273
+ // supported, MUST name one of those adjustments. No unrelated status
274
+ // or correction may appear." Emitting the page's whole adjustment
275
+ // receipt set let a read of R1 return a receipt for an adjustment on
276
+ // R2 while `adjustments` was empty.
277
+ adjustment_receipts: revisionAdjustmentReceipts,
221
278
  errors: [],
222
279
  pagination: {
223
280
  has_more: page.hasMore,
@@ -229,6 +286,18 @@ function createReportingStatusHandler(store, options) {
229
286
  if (view === "periods") {
230
287
  const pageIds = new Set(page.obligations.map((value) => value.reporting_obligation_id));
231
288
  const pageProjected = selected.filter((value) => pageIds.has(value.obligation.reporting_obligation_id));
289
+ const selectedPageIds = new Set(selected.map((value) => value.obligation.reporting_obligation_id));
290
+ const scopedAdjustments = visibleAdjustments.filter(
291
+ (value) => selectedPageIds.has(value.reporting_obligation_id)
292
+ );
293
+ const scopedAdjustmentIds = new Set(scopedAdjustments.map((value) => value.reporting_adjustment_id));
294
+ const scopedAdjustmentReceipts = (page.adjustmentReceipts ?? []).filter(
295
+ (value) => scopedAdjustmentIds.has(value.reporting_adjustment_id)
296
+ );
297
+ const receiptAdjustmentIds = new Set(scopedAdjustmentReceipts.map((value) => value.reporting_adjustment_id));
298
+ const pageAdjustments = scopedAdjustments.filter(
299
+ (value) => pageAdjustmentIds.has(value.reporting_adjustment_id) || receiptAdjustmentIds.has(value.reporting_adjustment_id)
300
+ );
232
301
  return {
233
302
  ...base,
234
303
  view: "periods",
@@ -244,15 +313,27 @@ function createReportingStatusHandler(store, options) {
244
313
  ).length,
245
314
  value.projection,
246
315
  value.currentConsumerStatus,
247
- consumerId ? value.consumerStatusProjection.length : void 0
316
+ consumerId ? value.consumerStatusProjection.length : void 0,
317
+ value.managed
248
318
  )
249
319
  ),
250
- revisions: page.revisions.filter((value) => !query.finality || query.finality.includes(value.finality)).map((value) => value.wireRevision),
251
- adjustments: page.adjustments.map((value) => value.wireAdjustment),
320
+ revisions: page.revisions.filter(
321
+ (value) => selectedPageIds.has(value.reporting_obligation_id) && (!query.finality || query.finality.includes(value.finality))
322
+ ).map((value) => value.wireRevision),
323
+ adjustments: pageAdjustments.map((value) => value.wireAdjustment),
252
324
  ...consumerId ? { consumer_statuses: (page.consumerStatuses ?? []).map(wireConsumerStatus) } : {},
253
- adjustment_receipts: [],
254
- materializations: [],
255
- receipts: [],
325
+ // Same scoping rule as the revision view: a receipt may only appear
326
+ // beside the correction or revision it names.
327
+ adjustment_receipts: scopedAdjustmentReceipts,
328
+ // Managed evidence names a revision, so the finality filter that
329
+ // scopes `revisions` scopes these too — otherwise the response
330
+ // carries public references to a revision it does not contain.
331
+ materializations: (page.materializations ?? []).filter(
332
+ (value) => selectedPageIds.has(value.reporting_obligation_id) && visibleRevisionIds.has(value.reporting_revision_id)
333
+ ),
334
+ receipts: (page.receipts ?? []).filter(
335
+ (value) => selectedPageIds.has(value.reporting_obligation_id) && visibleRevisionIds.has(value.reporting_revision_id)
336
+ ),
256
337
  pagination: {
257
338
  has_more: page.hasMore,
258
339
  total_count: page.totalCount,
@@ -291,17 +372,6 @@ function createReportingStatusHandler(store, options) {
291
372
  }
292
373
  };
293
374
  }
294
- function resolveConsumerMismatchEscalation(fromOptions, store) {
295
- const fromStore = store.consumerMismatchEscalation;
296
- if (!fromOptions) return fromStore;
297
- if (!fromStore) return fromOptions;
298
- if (fromOptions.escalationSeconds !== fromStore.escalationSeconds || fromOptions.operationsContact.url !== fromStore.operationsContact.url || fromOptions.operationsContact.email !== fromStore.operationsContact.email) {
299
- throw new TypeError(
300
- "consumerMismatchEscalation differs between createReportingStatusHandler and the reporting ledger store; configure one value so a health-filtered periods read cannot disagree with the summary"
301
- );
302
- }
303
- return fromOptions;
304
- }
305
375
  function createReportingDeliveryHandler(store) {
306
376
  const activeReadsByAccount = /* @__PURE__ */ new Map();
307
377
  return async (request, context) => {
@@ -384,7 +454,7 @@ function resolvedAccountId(account) {
384
454
  if (!accountId) throw new Error("Reporting reads require a resolved account");
385
455
  return accountId;
386
456
  }
387
- function wireObligation(obligation, revisionCount, adjustmentCount, projection, currentConsumerStatus, consumerStatusCount) {
457
+ function wireObligation(obligation, revisionCount, adjustmentCount, projection, currentConsumerStatus, consumerStatusCount, managed) {
388
458
  return {
389
459
  reporting_obligation_id: obligation.reporting_obligation_id,
390
460
  delivery_config_id: obligation.delivery_config_id,
@@ -402,20 +472,27 @@ function wireObligation(obligation, revisionCount, adjustmentCount, projection,
402
472
  source_timezone: obligation.period.sourceTimezone
403
473
  },
404
474
  expected_at: obligation.expectedAt,
405
- schedule: {
406
- period_duration: `PT${obligation.schedule.periodMilliseconds / 1e3}S`,
407
- alignment: "billing_cycle",
408
- period_anchor: obligation.schedule.anchor,
409
- period_timezone: obligation.period.sourceTimezone,
410
- delivery_sla: `PT${(Date.parse(obligation.expectedAt) - Date.parse(obligation.period.end)) / 1e3}S`
411
- },
475
+ schedule: wireSchedule(obligation),
412
476
  required_finality: obligation.requiredFinality,
413
- reconciliation_mode: "delivery_only",
414
- reconciliation_status: "not_required",
477
+ reconciliation_mode: managed?.binding.reconciliation_mode ?? "delivery_only",
478
+ reconciliation_status: managed?.reconciliationStatus ?? "not_required",
415
479
  health: projection.health,
416
480
  production_status: projection.productionStatus,
417
481
  revision_count: revisionCount,
418
482
  adjustment_count: adjustmentCount,
483
+ ...managed ? {
484
+ destination_ref: managed.binding.destination_ref,
485
+ materialization_count: managed.materializationCount,
486
+ successful_materialization_count: managed.successfulMaterializationCount,
487
+ ...managed.resourceRetainedUntil ? { resource_retained_until: managed.resourceRetainedUntil } : {},
488
+ ...managed.binding.reconciliation_mode === "consumer_receipt" ? {
489
+ receipt_count: managed.receiptCount,
490
+ accepted_receipt_count: managed.acceptedReceiptCount,
491
+ adjustment_receipt_count: managed.adjustmentReceiptCount,
492
+ accepted_adjustment_receipt_count: managed.acceptedAdjustmentReceiptCount,
493
+ pending_adjustment_count: managed.pendingAdjustmentReceiptCount
494
+ } : {}
495
+ } : {},
419
496
  ...consumerStatusCount !== void 0 ? {
420
497
  consumer_status_count: consumerStatusCount,
421
498
  ...currentConsumerStatus ? { current_consumer_status_id: currentConsumerStatus.reporting_status_id } : {}
@@ -423,6 +500,176 @@ function wireObligation(obligation, revisionCount, adjustmentCount, projection,
423
500
  issues: projection.issues.map(wireIssue)
424
501
  };
425
502
  }
503
+ function projectManagedDelivery(input) {
504
+ const {
505
+ obligation,
506
+ binding,
507
+ revisions,
508
+ adjustments,
509
+ materializations,
510
+ materializationHistory,
511
+ receipts,
512
+ adjustmentReceipts,
513
+ base,
514
+ ledgerAsOf,
515
+ tombstonedAcceptedSubjects = [],
516
+ tombstonedDeliveredRevisionIds = []
517
+ } = input;
518
+ if (!binding) return void 0;
519
+ const supersededRevisionIds = new Set(
520
+ revisions.map((value) => value.supersedes_reporting_revision_id).filter((value) => Boolean(value))
521
+ );
522
+ const requiredRevision = revisions.filter((value) => !supersededRevisionIds.has(value.reporting_revision_id)).filter((value) => obligation.requiredFinality !== "official" || value.finality === "official").sort((left, right) => left.revisionNumber - right.revisionNumber).at(-1);
523
+ const successful = materializations.filter(
524
+ (value) => value.reporting_revision_id === requiredRevision?.reporting_revision_id && (value.status === "available" || value.status === "delivered") && value.resource !== void 0 && value.verification !== void 0
525
+ );
526
+ const readable = successful.filter(
527
+ (value) => value.resource && compareReportingInstants(value.resource.expires_at, ledgerAsOf) > 0
528
+ );
529
+ const failed = materializations.filter((value) => value.status === "failed");
530
+ let projection = base;
531
+ if (requiredRevision && !readable.length) {
532
+ const afterExpected = compareReportingInstants(ledgerAsOf, obligation.expectedAt) >= 0;
533
+ const afterRecovery = compareReportingInstants(ledgerAsOf, obligation.recoveryDeadlineAt) >= 0;
534
+ const issue = {
535
+ issueId: `reporting-issue.managed-delivery.${obligation.reporting_obligation_id}`,
536
+ reporting_obligation_id: obligation.reporting_obligation_id,
537
+ code: failed.length ? "DELIVERY_FAILED" : successful.length ? "RESOURCE_EXPIRED" : "REPORT_OVERDUE",
538
+ severity: afterRecovery ? "action_required" : "delayed",
539
+ responsibleParty: "seller",
540
+ recommendedAction: afterRecovery ? "contact_seller" : "wait_for_retry",
541
+ openedAt: successful[0]?.resource?.expires_at ?? failed[0]?.failed_at ?? obligation.expectedAt,
542
+ observedAt: ledgerAsOf
543
+ };
544
+ projection = {
545
+ ...base,
546
+ // Managed delivery is an independent degradation source, exactly like the
547
+ // consumer-status mismatch composed at the call sites. Overwriting
548
+ // `base.health` let an installed managed table suppress Core degradation:
549
+ // an obligation with incomplete coverage (`action_required`) read before
550
+ // its `expectedAt` came back `waiting` while still carrying the
551
+ // action_required issue, which both contradicts itself and makes the
552
+ // period unreachable under every `health` filter.
553
+ health: moreSevereReportingHealthV1(
554
+ base.health,
555
+ afterExpected ? afterRecovery ? "action_required" : "delayed" : "waiting"
556
+ ),
557
+ satisfied: false,
558
+ issues: afterExpected ? uniqueIssues([...base.issues, issue]) : base.issues
559
+ };
560
+ }
561
+ const relevantReceipts = requiredRevision ? receipts.filter((value) => value.reporting_revision_id === requiredRevision.reporting_revision_id) : [];
562
+ const obligationReceipts = receipts.filter(
563
+ (value) => value.reporting_obligation_id === obligation.reporting_obligation_id
564
+ );
565
+ const obligationAdjustmentReceipts = adjustmentReceipts.filter(
566
+ (value) => adjustments.some((adjustment) => adjustment.reporting_adjustment_id === value.reporting_adjustment_id)
567
+ );
568
+ const revisionLeaf = currentReceiptLeaf(relevantReceipts);
569
+ const adjustmentLeaves = adjustments.map(
570
+ (adjustment) => currentAdjustmentReceiptLeaf(
571
+ adjustmentReceipts.filter((value) => value.reporting_adjustment_id === adjustment.reporting_adjustment_id)
572
+ )
573
+ );
574
+ const revisionAcceptedByTombstone = requiredRevision !== void 0 && tombstonedAcceptedSubjects.some(
575
+ (value) => value.kind === "revision" && value.subjectId === requiredRevision.reporting_revision_id
576
+ );
577
+ const tombstonedAdjustmentIds = new Set(
578
+ adjustments.map((adjustment) => adjustment.reporting_adjustment_id).filter((id) => tombstonedAcceptedSubjects.some((value) => value.kind === "adjustment" && value.subjectId === id))
579
+ );
580
+ let reconciliationStatus = "not_required";
581
+ if (binding.reconciliation_mode === "consumer_receipt" && requiredRevision) {
582
+ const rejectedAdjustment = adjustments.some(
583
+ (adjustment, index) => adjustmentLeaves[index]?.status === "rejected" && !tombstonedAdjustmentIds.has(adjustment.reporting_adjustment_id)
584
+ );
585
+ const deliveredEver = tombstonedDeliveredRevisionIds.includes(requiredRevision.reporting_revision_id) || materializationHistory.some(
586
+ (value) => value.reporting_revision_id === requiredRevision.reporting_revision_id && (value.status === "available" || value.status === "delivered") && value.resource !== void 0 && value.verification !== void 0
587
+ );
588
+ const missingAdjustmentAfterTombstones = adjustments.some(
589
+ (adjustment, index) => adjustmentLeaves[index] === void 0 && !tombstonedAdjustmentIds.has(adjustment.reporting_adjustment_id)
590
+ );
591
+ const revisionAccepted = revisionLeaf?.status === "accepted" || revisionAcceptedByTombstone;
592
+ const revisionRejectedNow = revisionLeaf?.status === "rejected" && !revisionAcceptedByTombstone;
593
+ if (revisionRejectedNow || rejectedAdjustment) reconciliationStatus = "rejected";
594
+ else if (!deliveredEver) reconciliationStatus = "pending";
595
+ else if (!revisionAccepted || missingAdjustmentAfterTombstones) reconciliationStatus = "pending";
596
+ else reconciliationStatus = "accepted";
597
+ if (reconciliationStatus !== "accepted") {
598
+ const code = revisionRejectedNow ? "RECEIPT_REJECTED" : rejectedAdjustment ? "ADJUSTMENT_RECEIPT_REJECTED" : !revisionAccepted ? "RECEIPT_REQUIRED" : "ADJUSTMENT_RECEIPT_REQUIRED";
599
+ const sellerAction = code === "RECEIPT_REJECTED" || code === "ADJUSTMENT_RECEIPT_REJECTED";
600
+ const issue = {
601
+ issueId: `reporting-issue.${code.toLowerCase().replaceAll("_", "-")}.${obligation.reporting_obligation_id}`,
602
+ reporting_obligation_id: obligation.reporting_obligation_id,
603
+ code,
604
+ severity: "action_required",
605
+ responsibleParty: sellerAction ? "seller" : "buyer",
606
+ recommendedAction: sellerAction ? "contact_seller" : "contact_buyer",
607
+ openedAt: revisionLeaf?.received_at ?? adjustmentLeaves.find((value) => value?.status === "rejected")?.received_at ?? successful[0]?.ready_at ?? obligation.expectedAt,
608
+ observedAt: ledgerAsOf
609
+ };
610
+ projection = {
611
+ ...projection,
612
+ health: "action_required",
613
+ satisfied: false,
614
+ issues: uniqueIssues([...projection.issues, issue])
615
+ };
616
+ }
617
+ }
618
+ return {
619
+ binding,
620
+ projection,
621
+ reconciliationStatus,
622
+ materializationCount: materializationHistory.length,
623
+ successfulMaterializationCount: materializationHistory.filter(
624
+ (value) => value.status === "available" || value.status === "delivered"
625
+ ).length,
626
+ resourceRetainedUntil: readable.map((value) => value.resource.expires_at).sort(compareReportingInstants).at(-1),
627
+ // Tombstones move the counters as well as the verdict. RC3 requires a
628
+ // `consumer_receipt` obligation that reads healthy or complete to report
629
+ // at least one receipt, at least one accepted receipt, and zero pending
630
+ // adjustments — so counting only live rows emitted a schema-invalid
631
+ // `complete` with `receipt_count: 0` the moment an acceptance was pruned,
632
+ // and left a tombstoned adjustment counted as still pending.
633
+ // Counters describe exactly the records this response emits, nothing
634
+ // more and nothing less. Counting only the required revision's receipts
635
+ // undercounted a superseded revision's receipts, which the periods view
636
+ // does emit; adding tombstones overcounted records that no longer exist.
637
+ // Either way a buyer recomputing the association reports
638
+ // ASSOCIATED_HISTORY_INCOMPLETE. Tombstones keep their real job — they
639
+ // stop a settled subject reopening on the write path — and retention now
640
+ // refuses to prune a receipt whose resource is still readable, so a
641
+ // period can never read complete with nothing to show for it.
642
+ receiptCount: obligationReceipts.length,
643
+ acceptedReceiptCount: obligationReceipts.filter((value) => value.status === "accepted").length,
644
+ adjustmentReceiptCount: obligationAdjustmentReceipts.length,
645
+ acceptedAdjustmentReceiptCount: obligationAdjustmentReceipts.filter((value) => value.status === "accepted").length,
646
+ pendingAdjustmentReceiptCount: adjustments.filter(
647
+ (adjustment, index) => adjustmentLeaves[index]?.status !== "accepted" && !tombstonedAdjustmentIds.has(adjustment.reporting_adjustment_id)
648
+ ).length
649
+ };
650
+ }
651
+ function currentReceiptLeaf(receipts) {
652
+ const superseded = new Set(
653
+ receipts.map((value) => value.supersedes_reporting_receipt_id).filter((value) => Boolean(value))
654
+ );
655
+ return receipts.find((value) => !superseded.has(value.reporting_receipt_id));
656
+ }
657
+ function currentAdjustmentReceiptLeaf(receipts) {
658
+ const superseded = new Set(
659
+ receipts.map((value) => value.supersedes_reporting_receipt_id).filter((value) => Boolean(value))
660
+ );
661
+ return receipts.find((value) => !superseded.has(value.reporting_receipt_id));
662
+ }
663
+ function moreSevereReportingHealthV1(left, right) {
664
+ const severity = {
665
+ complete: 0,
666
+ healthy: 0,
667
+ waiting: 1,
668
+ delayed: 2,
669
+ action_required: 3
670
+ };
671
+ return severity[left] >= severity[right] ? left : right;
672
+ }
426
673
  function consumerStatusMatchesObligation(status, obligation) {
427
674
  return status.delivery_config_id === obligation.delivery_config_id && status.delivery_config_version === obligation.delivery_config_version && status.report_definition_id === obligation.report_definition_id && compareReportingInstants(status.period.start, obligation.period.start) === 0 && compareReportingInstants(status.period.end, obligation.period.end) === 0 && status.period.source_timezone === obligation.period.sourceTimezone;
428
675
  }
@@ -623,10 +870,30 @@ function copyArray(raw, key) {
623
870
  function isRecord(value) {
624
871
  return typeof value === "object" && value !== null && !Array.isArray(value);
625
872
  }
873
+ function wireSchedule(obligation) {
874
+ const alignment = obligation.schedule.alignment ?? "billing_cycle";
875
+ const periodTimezone = obligation.schedule.periodTimezone ?? obligation.period.sourceTimezone;
876
+ return {
877
+ period_duration: obligation.schedule.periodDuration ?? `PT${obligation.schedule.periodMilliseconds / 1e3}S`,
878
+ alignment,
879
+ // reporting-schedule.json: billing_cycle requires both fields,
880
+ // source_timezone requires period_timezone and forbids period_anchor, and
881
+ // utc/account_timezone forbid both. Emitting period_timezone for
882
+ // account_timezone fails the whole strict get_reporting_status response.
883
+ ...alignment === "billing_cycle" ? { period_anchor: obligation.schedule.anchor } : {},
884
+ ...alignment === "billing_cycle" || alignment === "source_timezone" ? { period_timezone: periodTimezone } : {},
885
+ // Echo the installed lexical duration. Recomputing it from expected_at
886
+ // would answer PT3600S where the offering advertised PT1H — the same
887
+ // instant, but not the same value installed_schedule_match compares.
888
+ delivery_sla: obligation.schedule.deliverySlaDuration ?? `PT${(Date.parse(obligation.expectedAt) - Date.parse(obligation.period.end)) / 1e3}S`
889
+ };
890
+ }
626
891
  export {
627
892
  ReportingReadCapacityError,
628
893
  acquireAccountReadSlot,
629
894
  aggregateReportingCoverageV1,
630
895
  createReportingDeliveryHandler,
631
- createReportingStatusHandler
896
+ createReportingStatusHandler,
897
+ moreSevereReportingHealthV1,
898
+ projectManagedDelivery
632
899
  };
@@ -22,6 +22,18 @@ export declare function aggregateReportingHealthV1(values: readonly ReportingHea
22
22
  * rejected here rather than emitted.
23
23
  */
24
24
  export declare function assertReportingConsumerMismatchEscalation(escalation: ReportingConsumerMismatchEscalationV1 | undefined): ReportingConsumerMismatchEscalationV1 | undefined;
25
+ /**
26
+ * Resolve the one escalation commitment in force.
27
+ *
28
+ * The window can be configured on the ledger store, on the status handler, or
29
+ * both, and the store's value is honoured when the handler is given none. A
30
+ * caller that advertises only what it was handed directly therefore publishes
31
+ * nothing for a store-only deployment while still enforcing the store's
32
+ * window — buyers age issues against a clock the capability document denies.
33
+ * Resolve through here for both enforcement and advertisement, and refuse two
34
+ * disagreeing values rather than letting the views diverge.
35
+ */
36
+ export declare function reportingEffectiveConsumerMismatchEscalationV1(fromOptions: ReportingConsumerMismatchEscalationV1 | undefined, store: unknown, configuredBy: string): ReportingConsumerMismatchEscalationV1 | undefined;
25
37
  /**
26
38
  * Project an escalation commitment into the wire fields of the seller's
27
39
  * `media_buy.reporting_delivery` capability block.
@@ -22,6 +22,18 @@ export declare function aggregateReportingHealthV1(values: readonly ReportingHea
22
22
  * rejected here rather than emitted.
23
23
  */
24
24
  export declare function assertReportingConsumerMismatchEscalation(escalation: ReportingConsumerMismatchEscalationV1 | undefined): ReportingConsumerMismatchEscalationV1 | undefined;
25
+ /**
26
+ * Resolve the one escalation commitment in force.
27
+ *
28
+ * The window can be configured on the ledger store, on the status handler, or
29
+ * both, and the store's value is honoured when the handler is given none. A
30
+ * caller that advertises only what it was handed directly therefore publishes
31
+ * nothing for a store-only deployment while still enforcing the store's
32
+ * window — buyers age issues against a clock the capability document denies.
33
+ * Resolve through here for both enforcement and advertisement, and refuse two
34
+ * disagreeing values rather than letting the views diverge.
35
+ */
36
+ export declare function reportingEffectiveConsumerMismatchEscalationV1(fromOptions: ReportingConsumerMismatchEscalationV1 | undefined, store: unknown, configuredBy: string): ReportingConsumerMismatchEscalationV1 | undefined;
25
37
  /**
26
38
  * Project an escalation commitment into the wire fields of the seller's
27
39
  * `media_buy.reporting_delivery` capability block.
@@ -22,7 +22,8 @@ __export(health_exports, {
22
22
  assertReportingConsumerMismatchEscalation: () => assertReportingConsumerMismatchEscalation,
23
23
  projectReportingConsumerStatusMismatchV1: () => projectReportingConsumerStatusMismatchV1,
24
24
  projectReportingObligationHealthV1: () => projectReportingObligationHealthV1,
25
- reportingConsumerStatusCapabilityV1: () => reportingConsumerStatusCapabilityV1
25
+ reportingConsumerStatusCapabilityV1: () => reportingConsumerStatusCapabilityV1,
26
+ reportingEffectiveConsumerMismatchEscalationV1: () => reportingEffectiveConsumerMismatchEscalationV1
26
27
  });
27
28
  module.exports = __toCommonJS(health_exports);
28
29
  var import_node_crypto = require("node:crypto");
@@ -119,6 +120,17 @@ function assertReportingConsumerMismatchEscalation(escalation) {
119
120
  }
120
121
  return escalation;
121
122
  }
123
+ function reportingEffectiveConsumerMismatchEscalationV1(fromOptions, store, configuredBy) {
124
+ const fromStore = store?.consumerMismatchEscalation;
125
+ if (!fromOptions) return fromStore;
126
+ if (!fromStore) return fromOptions;
127
+ if (fromOptions.escalationSeconds !== fromStore.escalationSeconds || fromOptions.operationsContact.url !== fromStore.operationsContact.url || fromOptions.operationsContact.email !== fromStore.operationsContact.email) {
128
+ throw new TypeError(
129
+ `consumerMismatchEscalation differs between ${configuredBy} and the reporting ledger store; configure one value so a health-filtered periods read cannot disagree with the summary`
130
+ );
131
+ }
132
+ return fromOptions;
133
+ }
122
134
  function reportingConsumerStatusCapabilityV1(escalation) {
123
135
  const validated = assertReportingConsumerMismatchEscalation(escalation);
124
136
  if (!validated) return {};
@@ -198,5 +210,6 @@ function consumerStatusMismatchAction(status, severity, responsibleParty, escala
198
210
  assertReportingConsumerMismatchEscalation,
199
211
  projectReportingConsumerStatusMismatchV1,
200
212
  projectReportingObligationHealthV1,
201
- reportingConsumerStatusCapabilityV1
213
+ reportingConsumerStatusCapabilityV1,
214
+ reportingEffectiveConsumerMismatchEscalationV1
202
215
  });
@@ -92,6 +92,17 @@ function assertReportingConsumerMismatchEscalation(escalation) {
92
92
  }
93
93
  return escalation;
94
94
  }
95
+ function reportingEffectiveConsumerMismatchEscalationV1(fromOptions, store, configuredBy) {
96
+ const fromStore = store?.consumerMismatchEscalation;
97
+ if (!fromOptions) return fromStore;
98
+ if (!fromStore) return fromOptions;
99
+ if (fromOptions.escalationSeconds !== fromStore.escalationSeconds || fromOptions.operationsContact.url !== fromStore.operationsContact.url || fromOptions.operationsContact.email !== fromStore.operationsContact.email) {
100
+ throw new TypeError(
101
+ `consumerMismatchEscalation differs between ${configuredBy} and the reporting ledger store; configure one value so a health-filtered periods read cannot disagree with the summary`
102
+ );
103
+ }
104
+ return fromOptions;
105
+ }
95
106
  function reportingConsumerStatusCapabilityV1(escalation) {
96
107
  const validated = assertReportingConsumerMismatchEscalation(escalation);
97
108
  if (!validated) return {};
@@ -170,5 +181,6 @@ export {
170
181
  assertReportingConsumerMismatchEscalation,
171
182
  projectReportingConsumerStatusMismatchV1,
172
183
  projectReportingObligationHealthV1,
173
- reportingConsumerStatusCapabilityV1
184
+ reportingConsumerStatusCapabilityV1,
185
+ reportingEffectiveConsumerMismatchEscalationV1
174
186
  };
@@ -7,3 +7,6 @@ export * from './producer.mjs';
7
7
  export * from './handler.mjs';
8
8
  export * from './status-ingest.mjs';
9
9
  export * from './consumer-status-identity.mjs';
10
+ export * from './managed.mjs';
11
+ export * from './managed-postgres.mjs';
12
+ export * from './notification-activity.mjs';
@@ -7,3 +7,6 @@ export * from './producer';
7
7
  export * from './handler';
8
8
  export * from './status-ingest';
9
9
  export * from './consumer-status-identity';
10
+ export * from './managed';
11
+ export * from './managed-postgres';
12
+ export * from './notification-activity';
@@ -24,6 +24,9 @@ __reExport(ledger_exports, require('./producer.js'), module.exports);
24
24
  __reExport(ledger_exports, require('./handler.js'), module.exports);
25
25
  __reExport(ledger_exports, require('./status-ingest.js'), module.exports);
26
26
  __reExport(ledger_exports, require('./consumer-status-identity.js'), module.exports);
27
+ __reExport(ledger_exports, require('./managed.js'), module.exports);
28
+ __reExport(ledger_exports, require('./managed-postgres.js'), module.exports);
29
+ __reExport(ledger_exports, require('./notification-activity.js'), module.exports);
27
30
  // Annotate the CommonJS export names for ESM import in node:
28
31
  0 && (module.exports = {
29
32
  ...require('./types.js'),
@@ -34,5 +37,8 @@ __reExport(ledger_exports, require('./consumer-status-identity.js'), module.expo
34
37
  ...require('./producer.js'),
35
38
  ...require('./handler.js'),
36
39
  ...require('./status-ingest.js'),
37
- ...require('./consumer-status-identity.js')
40
+ ...require('./consumer-status-identity.js'),
41
+ ...require('./managed.js'),
42
+ ...require('./managed-postgres.js'),
43
+ ...require('./notification-activity.js')
38
44
  });
@@ -7,3 +7,6 @@ export * from "./producer.mjs";
7
7
  export * from "./handler.mjs";
8
8
  export * from "./status-ingest.mjs";
9
9
  export * from "./consumer-status-identity.mjs";
10
+ export * from "./managed.mjs";
11
+ export * from "./managed-postgres.mjs";
12
+ export * from "./notification-activity.mjs";
@@ -2,12 +2,29 @@ import type { ReportingLedgerStatusTransitionV1, ReportingLedgerStore, Reporting
2
2
  export declare function reconcileReportingStatusLifecycleV1(input: {
3
3
  store: ReportingLedgerStore;
4
4
  reporting_obligation_id: string;
5
- ledgerAsOf: string;
5
+ /**
6
+ * Cutoff to reconcile at. Omit it — and prefer omitting it outside a
7
+ * deadline sweep — to let the store supply an authoritative instant at
8
+ * full precision instead of a millisecond-truncated host `Date`.
9
+ */
10
+ ledgerAsOf?: string;
11
+ /** Fallback clock for a store that cannot supply its own instant. */
12
+ now?: () => Date;
6
13
  subscribers?: readonly ReportingLedgerSubscriberV1[];
7
- }): Promise<ReportingLedgerStatusTransitionV1 | null>;
14
+ }, attempt?: number): Promise<ReportingLedgerStatusTransitionV1 | null>;
8
15
  export declare function retryReportingStatusNotificationsV1(input: {
9
16
  store: ReportingLedgerStore;
10
- ledgerAsOf: string;
17
+ /** Omit to let the store supply an authoritative instant. */
18
+ ledgerAsOf?: string;
19
+ /**
20
+ * Clock to use only when the store cannot supply its own instant.
21
+ *
22
+ * A store backed by a database is authoritative and this is ignored. An
23
+ * in-memory or simulated-time store has no clock of its own, so a driver
24
+ * that advances time must still be able to say what "now" means without
25
+ * pinning a cutoff that would be written into the watermark verbatim.
26
+ */
27
+ fallbackLedgerAsOf?: string;
11
28
  account_id?: string;
12
29
  subscribers?: readonly ReportingLedgerSubscriberV1[];
13
30
  limit?: number;
@@ -15,7 +32,17 @@ export declare function retryReportingStatusNotificationsV1(input: {
15
32
  /** Reconcile bounded clock-driven waiting→delayed→action_required transitions. */
16
33
  export declare function reconcileReportingStatusDeadlinesV1(input: {
17
34
  store: ReportingLedgerStore;
18
- ledgerAsOf: string;
35
+ /** Omit to let the store supply an authoritative instant. */
36
+ ledgerAsOf?: string;
37
+ /**
38
+ * Clock to use only when the store cannot supply its own instant.
39
+ *
40
+ * A store backed by a database is authoritative and this is ignored. An
41
+ * in-memory or simulated-time store has no clock of its own, so a driver
42
+ * that advances time must still be able to say what "now" means without
43
+ * pinning a cutoff that would be written into the watermark verbatim.
44
+ */
45
+ fallbackLedgerAsOf?: string;
19
46
  account_id?: string;
20
47
  subscribers?: readonly ReportingLedgerSubscriberV1[];
21
48
  limit?: number;