@adcp/sdk 12.1.1 → 13.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/README.md +19 -3
  2. package/bin/adcp-fuzz.js +3 -1
  3. package/dist/lib/adapters/content-standards-adapter.d.mts +9 -9
  4. package/dist/lib/adapters/content-standards-adapter.d.ts +9 -9
  5. package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
  6. package/dist/lib/adapters/content-standards-adapter.js +22 -22
  7. package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
  8. package/dist/lib/adapters/content-standards-adapter.mjs +18 -18
  9. package/dist/lib/adapters/content-standards-adapter.mjs.map +1 -1
  10. package/dist/lib/adapters/index.d.mts +2 -2
  11. package/dist/lib/adapters/index.d.ts +2 -2
  12. package/dist/lib/adapters/index.d.ts.map +1 -1
  13. package/dist/lib/adapters/index.js +10 -10
  14. package/dist/lib/adapters/index.js.map +1 -1
  15. package/dist/lib/adapters/index.mjs +9 -9
  16. package/dist/lib/adapters/index.mjs.map +1 -1
  17. package/dist/lib/auth/oauth/provider-cache.d.mts +7 -0
  18. package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
  19. package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
  20. package/dist/lib/auth/oauth/provider-cache.js +44 -0
  21. package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
  22. package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
  23. package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
  24. package/dist/lib/conformance/invariants/uniformError.js +1 -1
  25. package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
  26. package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
  27. package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
  28. package/dist/lib/conformance/runners.js +1 -1
  29. package/dist/lib/conformance/runners.js.map +1 -1
  30. package/dist/lib/conformance/runners.mjs +1 -1
  31. package/dist/lib/conformance/runners.mjs.map +1 -1
  32. package/dist/lib/conformance/seeder.js +5 -5
  33. package/dist/lib/conformance/seeder.js.map +1 -1
  34. package/dist/lib/conformance/seeder.mjs +5 -5
  35. package/dist/lib/conformance/seeder.mjs.map +1 -1
  36. package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
  37. package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
  38. package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
  39. package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
  40. package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
  41. package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
  42. package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
  43. package/dist/lib/core/AgentClient.d.mts +148 -138
  44. package/dist/lib/core/AgentClient.d.ts +148 -138
  45. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  46. package/dist/lib/core/AgentClient.js +174 -85
  47. package/dist/lib/core/AgentClient.js.map +1 -1
  48. package/dist/lib/core/AgentClient.mjs +174 -85
  49. package/dist/lib/core/AgentClient.mjs.map +1 -1
  50. package/dist/lib/core/AsyncHandler.d.mts +18 -16
  51. package/dist/lib/core/AsyncHandler.d.ts +18 -16
  52. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  53. package/dist/lib/core/AsyncHandler.js +22 -1
  54. package/dist/lib/core/AsyncHandler.js.map +1 -1
  55. package/dist/lib/core/AsyncHandler.mjs +22 -1
  56. package/dist/lib/core/AsyncHandler.mjs.map +1 -1
  57. package/dist/lib/core/ConversationTypes.d.mts +6 -2
  58. package/dist/lib/core/ConversationTypes.d.ts +6 -2
  59. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  60. package/dist/lib/core/ConversationTypes.js.map +1 -1
  61. package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
  62. package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
  63. package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
  64. package/dist/lib/core/CreativeAgentClient.js +39 -12
  65. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  66. package/dist/lib/core/CreativeAgentClient.mjs +39 -12
  67. package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
  68. package/dist/lib/core/SingleAgentClient.d.mts +127 -50
  69. package/dist/lib/core/SingleAgentClient.d.ts +127 -50
  70. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  71. package/dist/lib/core/SingleAgentClient.js +1617 -177
  72. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  73. package/dist/lib/core/SingleAgentClient.mjs +1627 -177
  74. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  75. package/dist/lib/core/TaskExecutor.d.mts +9 -0
  76. package/dist/lib/core/TaskExecutor.d.ts +9 -0
  77. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  78. package/dist/lib/core/TaskExecutor.js +136 -43
  79. package/dist/lib/core/TaskExecutor.js.map +1 -1
  80. package/dist/lib/core/TaskExecutor.mjs +136 -43
  81. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  82. package/dist/lib/index.d.mts +111 -17
  83. package/dist/lib/index.d.ts +111 -17
  84. package/dist/lib/index.d.ts.map +1 -1
  85. package/dist/lib/index.js +94 -94
  86. package/dist/lib/index.js.map +1 -1
  87. package/dist/lib/index.mjs +93 -94
  88. package/dist/lib/index.mjs.map +1 -1
  89. package/dist/lib/protocols/index.d.ts.map +1 -1
  90. package/dist/lib/protocols/index.js +6 -15
  91. package/dist/lib/protocols/index.js.map +1 -1
  92. package/dist/lib/protocols/index.mjs +6 -16
  93. package/dist/lib/protocols/index.mjs.map +1 -1
  94. package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
  95. package/dist/lib/protocols/mcp-modern.js +87 -12
  96. package/dist/lib/protocols/mcp-modern.js.map +1 -1
  97. package/dist/lib/protocols/mcp-modern.mjs +89 -12
  98. package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
  99. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  100. package/dist/lib/server/create-adcp-server.d.mts +6 -0
  101. package/dist/lib/server/create-adcp-server.d.ts +6 -0
  102. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  103. package/dist/lib/server/create-adcp-server.js +295 -48
  104. package/dist/lib/server/create-adcp-server.js.map +1 -1
  105. package/dist/lib/server/create-adcp-server.mjs +301 -50
  106. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  107. package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
  108. package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
  109. package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
  110. package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
  111. package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
  112. package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
  113. package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
  114. package/dist/lib/server/decisioning/index.d.mts +13 -12
  115. package/dist/lib/server/decisioning/index.d.ts +13 -12
  116. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  117. package/dist/lib/server/decisioning/index.js +6 -0
  118. package/dist/lib/server/decisioning/index.js.map +1 -1
  119. package/dist/lib/server/decisioning/index.mjs +9 -3
  120. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  121. package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
  122. package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
  123. package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
  124. package/dist/lib/server/decisioning/list-helpers.js +13 -3
  125. package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
  126. package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
  127. package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
  128. package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
  129. package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
  130. package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
  131. package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
  132. package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
  133. package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
  134. package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
  135. package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
  136. package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
  137. package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
  138. package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
  139. package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
  140. package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
  141. package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
  142. package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
  143. package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
  144. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
  145. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
  146. package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
  147. package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
  148. package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
  149. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
  150. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
  151. package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
  152. package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
  153. package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
  154. package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
  155. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  156. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  157. package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
  158. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
  159. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
  160. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  161. package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
  162. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  163. package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
  164. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  165. package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
  166. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
  167. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  168. package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
  169. package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
  170. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
  171. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
  172. package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
  173. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
  174. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
  175. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  176. package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
  177. package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
  178. package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
  179. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  180. package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
  181. package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
  182. package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
  183. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  184. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  185. package/dist/lib/server/index.d.mts +3 -3
  186. package/dist/lib/server/index.d.ts +3 -3
  187. package/dist/lib/server/index.d.ts.map +1 -1
  188. package/dist/lib/server/index.js +72 -72
  189. package/dist/lib/server/index.js.map +1 -1
  190. package/dist/lib/server/index.mjs +36 -36
  191. package/dist/lib/server/index.mjs.map +1 -1
  192. package/dist/lib/server/legacy/v5/index.d.mts +1 -0
  193. package/dist/lib/server/legacy/v5/index.d.ts +1 -0
  194. package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
  195. package/dist/lib/server/legacy/v5/index.js +74 -1
  196. package/dist/lib/server/legacy/v5/index.js.map +1 -1
  197. package/dist/lib/server/legacy/v5/index.mjs +75 -1
  198. package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
  199. package/dist/lib/server/responses.d.mts +2 -2
  200. package/dist/lib/server/responses.d.ts +2 -2
  201. package/dist/lib/server/responses.js.map +1 -1
  202. package/dist/lib/server/responses.mjs.map +1 -1
  203. package/dist/lib/testing/client.js +1 -1
  204. package/dist/lib/testing/client.js.map +1 -1
  205. package/dist/lib/testing/client.mjs +1 -1
  206. package/dist/lib/testing/client.mjs.map +1 -1
  207. package/dist/lib/testing/scenarios/brand-rights.js +6 -6
  208. package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
  209. package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
  210. package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
  211. package/dist/lib/testing/scenarios/creative.js +7 -7
  212. package/dist/lib/testing/scenarios/creative.js.map +1 -1
  213. package/dist/lib/testing/scenarios/creative.mjs +7 -7
  214. package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
  215. package/dist/lib/testing/scenarios/discovery.js +2 -2
  216. package/dist/lib/testing/scenarios/discovery.js.map +1 -1
  217. package/dist/lib/testing/scenarios/discovery.mjs +2 -2
  218. package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
  219. package/dist/lib/testing/scenarios/edge-cases.js +11 -11
  220. package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
  221. package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
  222. package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
  223. package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
  224. package/dist/lib/testing/scenarios/governance.js +16 -22
  225. package/dist/lib/testing/scenarios/governance.js.map +1 -1
  226. package/dist/lib/testing/scenarios/governance.mjs +16 -22
  227. package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
  228. package/dist/lib/testing/scenarios/media-buy.js +5 -5
  229. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  230. package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
  231. package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
  232. package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
  233. package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
  234. package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
  235. package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
  236. package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
  237. package/dist/lib/testing/scenarios/trusted-match.js +4 -3
  238. package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
  239. package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
  240. package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
  241. package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
  242. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
  243. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
  244. package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
  245. package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
  246. package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
  247. package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
  248. package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
  249. package/dist/lib/testing/storyboard/task-map.js +43 -5
  250. package/dist/lib/testing/storyboard/task-map.js.map +1 -1
  251. package/dist/lib/testing/storyboard/task-map.mjs +43 -5
  252. package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
  253. package/dist/lib/testing/test-helpers.d.mts +2 -2
  254. package/dist/lib/testing/test-helpers.d.ts +2 -2
  255. package/dist/lib/testing/test-helpers.js.map +1 -1
  256. package/dist/lib/testing/test-helpers.mjs.map +1 -1
  257. package/dist/lib/types/adcp.d.mts +14 -14
  258. package/dist/lib/types/adcp.d.ts +14 -14
  259. package/dist/lib/types/adcp.d.ts.map +1 -1
  260. package/dist/lib/types/adcp.js.map +1 -1
  261. package/dist/lib/types/adcp.mjs.map +1 -1
  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/index.d.ts.map +1 -1
  265. package/dist/lib/types/index.js.map +1 -1
  266. package/dist/lib/types/index.mjs.map +1 -1
  267. package/dist/lib/utils/capabilities.d.mts +6 -0
  268. package/dist/lib/utils/capabilities.d.ts +6 -0
  269. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  270. package/dist/lib/utils/capabilities.js +4 -0
  271. package/dist/lib/utils/capabilities.js.map +1 -1
  272. package/dist/lib/utils/capabilities.mjs +4 -0
  273. package/dist/lib/utils/capabilities.mjs.map +1 -1
  274. package/dist/lib/utils/creative-delivery.d.mts +52 -10
  275. package/dist/lib/utils/creative-delivery.d.ts +52 -10
  276. package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
  277. package/dist/lib/utils/creative-delivery.js +104 -9
  278. package/dist/lib/utils/creative-delivery.js.map +1 -1
  279. package/dist/lib/utils/creative-delivery.mjs +104 -8
  280. package/dist/lib/utils/creative-delivery.mjs.map +1 -1
  281. package/dist/lib/utils/format-assets.d.mts +41 -38
  282. package/dist/lib/utils/format-assets.d.ts +41 -38
  283. package/dist/lib/utils/format-assets.d.ts.map +1 -1
  284. package/dist/lib/utils/format-assets.js +3 -1
  285. package/dist/lib/utils/format-assets.js.map +1 -1
  286. package/dist/lib/utils/format-assets.mjs +3 -1
  287. package/dist/lib/utils/format-assets.mjs.map +1 -1
  288. package/dist/lib/utils/index.d.mts +8 -8
  289. package/dist/lib/utils/index.d.ts +8 -8
  290. package/dist/lib/utils/index.d.ts.map +1 -1
  291. package/dist/lib/utils/index.js +11 -9
  292. package/dist/lib/utils/index.js.map +1 -1
  293. package/dist/lib/utils/index.mjs +9 -8
  294. package/dist/lib/utils/index.mjs.map +1 -1
  295. package/dist/lib/utils/preview-utils.d.mts +11 -8
  296. package/dist/lib/utils/preview-utils.d.ts +11 -8
  297. package/dist/lib/utils/preview-utils.d.ts.map +1 -1
  298. package/dist/lib/utils/preview-utils.js +4 -4
  299. package/dist/lib/utils/preview-utils.js.map +1 -1
  300. package/dist/lib/utils/preview-utils.mjs +3 -3
  301. package/dist/lib/utils/preview-utils.mjs.map +1 -1
  302. package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
  303. package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
  304. package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
  305. package/dist/lib/v2/projection/augment-response.d.mts +31 -11
  306. package/dist/lib/v2/projection/augment-response.d.ts +31 -11
  307. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  308. package/dist/lib/v2/projection/augment-response.js +233 -27
  309. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  310. package/dist/lib/v2/projection/augment-response.mjs +232 -27
  311. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  312. package/dist/lib/v2/projection/builders.d.mts +7 -6
  313. package/dist/lib/v2/projection/builders.d.ts +7 -6
  314. package/dist/lib/v2/projection/builders.d.ts.map +1 -1
  315. package/dist/lib/v2/projection/builders.js +11 -8
  316. package/dist/lib/v2/projection/builders.js.map +1 -1
  317. package/dist/lib/v2/projection/builders.mjs +9 -6
  318. package/dist/lib/v2/projection/builders.mjs.map +1 -1
  319. package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
  320. package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
  321. package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
  322. package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
  323. package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
  324. package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
  325. package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
  326. package/dist/lib/v2/projection/catalog.d.mts +23 -2
  327. package/dist/lib/v2/projection/catalog.d.ts +23 -2
  328. package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
  329. package/dist/lib/v2/projection/catalog.js +34 -10
  330. package/dist/lib/v2/projection/catalog.js.map +1 -1
  331. package/dist/lib/v2/projection/catalog.mjs +33 -10
  332. package/dist/lib/v2/projection/catalog.mjs.map +1 -1
  333. package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
  334. package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
  335. package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
  336. package/dist/lib/v2/projection/creative-delivery.js +967 -0
  337. package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
  338. package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
  339. package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
  340. package/dist/lib/v2/projection/index.d.mts +8 -6
  341. package/dist/lib/v2/projection/index.d.ts +8 -6
  342. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  343. package/dist/lib/v2/projection/index.js +26 -4
  344. package/dist/lib/v2/projection/index.js.map +1 -1
  345. package/dist/lib/v2/projection/index.mjs +28 -4
  346. package/dist/lib/v2/projection/index.mjs.map +1 -1
  347. package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
  348. package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
  349. package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
  350. package/dist/lib/v2/projection/legacy-metadata.js +73 -0
  351. package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
  352. package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
  353. package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
  354. package/dist/lib/v2/projection/types.d.mts +29 -23
  355. package/dist/lib/v2/projection/types.d.ts +29 -23
  356. package/dist/lib/v2/projection/types.d.ts.map +1 -1
  357. package/dist/lib/v2/projection/types.js.map +1 -1
  358. package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
  359. package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
  360. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  361. package/dist/lib/v2/projection/v1-to-v2.js +218 -9
  362. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  363. package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
  364. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  365. package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
  366. package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
  367. package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
  368. package/dist/lib/v2/projection/v2-to-v1.js +138 -7
  369. package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
  370. package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
  371. package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
  372. package/dist/lib/v2/projection/write-side.d.mts +12 -13
  373. package/dist/lib/v2/projection/write-side.d.ts +12 -13
  374. package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
  375. package/dist/lib/v2/projection/write-side.js +16 -12
  376. package/dist/lib/v2/projection/write-side.js.map +1 -1
  377. package/dist/lib/v2/projection/write-side.mjs +16 -12
  378. package/dist/lib/v2/projection/write-side.mjs.map +1 -1
  379. package/dist/lib/version.d.mts +3 -3
  380. package/dist/lib/version.d.ts +3 -3
  381. package/dist/lib/version.d.ts.map +1 -1
  382. package/dist/lib/version.js +3 -3
  383. package/dist/lib/version.js.map +1 -1
  384. package/dist/lib/version.mjs +3 -3
  385. package/dist/lib/version.mjs.map +1 -1
  386. package/docs/guides/BUILD-AN-AGENT.md +7 -2
  387. package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
  388. package/docs/llms.txt +1 -0
  389. package/examples/README.md +1 -1
  390. package/examples/batch-preview-test.ts +3 -3
  391. package/examples/conversation-client.ts +2 -2
  392. package/examples/debug-preview-response.ts +1 -1
  393. package/examples/decisioning-platform-broadcast-tv.ts +10 -4
  394. package/examples/decisioning-platform-mock-seller.ts +16 -9
  395. package/examples/decisioning-platform-programmatic.ts +18 -7
  396. package/examples/error-compliant-server.ts +26 -16
  397. package/examples/generative-creative-demo.ts +7 -19
  398. package/examples/hello_creative_adapter_ad_server.ts +37 -16
  399. package/examples/hello_creative_adapter_template.ts +12 -10
  400. package/examples/hello_seller_adapter_guaranteed.ts +52 -23
  401. package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
  402. package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
  403. package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
  404. package/examples/hello_seller_adapter_social.ts +2 -7
  405. package/examples/inspect-card-formats.ts +1 -1
  406. package/examples/simple-getting-started.ts +1 -1
  407. package/examples/test-helpers-demo.ts +1 -1
  408. package/package.json +2 -2
  409. package/skills/build-decisioning-creative-template/SKILL.md +11 -11
  410. package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/creative-delivery.ts"],"sourcesContent":["import type {\n CreativeAsset,\n CreateMediaBuyRequest,\n CreateMediaBuyResponse,\n FormatOptionReference,\n GetProductsRequest,\n GetProductsResponse,\n GetCreativeDeliveryResponse,\n GetMediaBuyDeliveryResponse,\n GetMediaBuysResponse,\n CreativeFilters,\n ListCreativesResponse,\n ListCreativesRequest,\n PackageRequest,\n PackageUpdate,\n Package,\n Placement,\n Product,\n SyncCreativesRequest,\n SyncCreativesResponse,\n UpdateMediaBuyRequest,\n UpdateMediaBuyResponse,\n} from '../../types/tools.generated';\nimport { projectV1ProductToV2, resolveCanonicalFormatKind } from './v1-to-v2';\nimport type { LegacyFormatConverter } from './v1-to-v2';\nimport { CanonicalFormatLegacyResolutionError, resolveCanonicalFormatLegacyRefs } from './v2-to-v1';\nimport type { CanonicalFormatLegacyResolver } from './v2-to-v1';\nimport type { CanonicalFormatKind, ProjectionDiagnostic, V1FormatId } from './types';\nimport {\n legacyFormatRefsForDeclaration,\n selectedFormatOptions,\n transferLegacyCreativeMetadata,\n} from './legacy-metadata';\nimport type { CanonicalFormatDeclaration } from './legacy-metadata';\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, Extract<keyof T, K>> : never;\n\n/** Primary SDK creative shape. Legacy creative identity is a wire-adapter concern. */\nexport type CanonicalCreativeAsset = Omit<CanonicalCreativeResponse<CreativeAsset>, 'format_kind'> & {\n format_kind: CanonicalFormatKind;\n format_id?: never;\n};\n\n/** Explicit compatibility-only creative shape used at a legacy wire boundary. */\nexport type LegacyCreativeAsset = Omit<CreativeAsset, 'format_id' | 'format_kind' | 'format_option_ref'> & {\n format_id: V1FormatId;\n format_kind?: never;\n format_option_ref?: never;\n};\n\nexport type CanonicalPackageRequest = DistributiveOmit<\n CanonicalCreativeResponse<PackageRequest>,\n 'creatives' | 'format_ids'\n> & {\n creatives?: CanonicalCreativeAsset[];\n format_ids?: never;\n};\nexport type NonEmptyCanonicalFormatDeclarations = [CanonicalFormatDeclaration, ...CanonicalFormatDeclaration[]];\nexport type CanonicalPlacement = Omit<CanonicalCreativeResponse<Placement>, 'format_ids' | 'format_options'> & {\n format_ids?: never;\n format_options?: NonEmptyCanonicalFormatDeclarations;\n};\nexport type CanonicalProduct = Omit<\n CanonicalCreativeResponse<Product>,\n 'format_ids' | 'format_options' | 'placements'\n> & {\n product_id: string;\n format_ids?: never;\n format_options: NonEmptyCanonicalFormatDeclarations;\n placements?: CanonicalPlacement[];\n};\ntype CanonicalGetProductsField = Exclude<NonNullable<GetProductsRequest['fields']>[number], 'format_ids'>;\n/** Primary product discovery request cannot ask the SDK to expose legacy format IDs. */\nexport type CanonicalGetProductsRequest = Omit<GetProductsRequest, 'fields'> & {\n fields?: CanonicalGetProductsField[];\n};\nexport type CanonicalGetProductsResponse = Omit<CanonicalCreativeResponse<GetProductsResponse>, 'products'> & {\n products: CanonicalProduct[];\n projection: { diagnostics: ProjectionDiagnostic[] };\n};\nexport type CanonicalPackageUpdate = Omit<CanonicalCreativeResponse<PackageUpdate>, 'creatives'> & {\n creatives?: CanonicalCreativeAsset[];\n};\nexport type CanonicalPackage = CanonicalCreativeResponse<Package>;\nexport type CanonicalCreateMediaBuyRequest = Omit<CanonicalCreativeResponse<CreateMediaBuyRequest>, 'packages'> & {\n packages?: CanonicalPackageRequest[];\n};\nexport type CanonicalUpdateMediaBuyRequest = Omit<\n CanonicalCreativeResponse<UpdateMediaBuyRequest>,\n 'packages' | 'new_packages'\n> & {\n packages?: CanonicalPackageUpdate[];\n new_packages?: CanonicalPackageRequest[];\n};\nexport type CanonicalSyncCreativesRequest = Omit<CanonicalCreativeResponse<SyncCreativesRequest>, 'creatives'> & {\n creatives: CanonicalCreativeAsset[];\n};\nexport type CanonicalListedCreative = Omit<\n CanonicalCreativeResponse<ListCreativesResponse['creatives'][number]>,\n 'format_id' | 'format_kind' | 'format_option_ref'\n> & {\n format_kind: CanonicalFormatKind;\n format_option_ref?: FormatOptionReference;\n format_id?: never;\n};\nexport type CanonicalListCreativesResponse = Omit<CanonicalCreativeResponse<ListCreativesResponse>, 'creatives'> & {\n creatives: CanonicalListedCreative[];\n};\nexport type CanonicalCreateMediaBuyResponse = CanonicalCreativeResponse<CreateMediaBuyResponse>;\nexport type CanonicalUpdateMediaBuyResponse = CanonicalCreativeResponse<UpdateMediaBuyResponse>;\nexport type CanonicalSyncCreativesResponse = CanonicalCreativeResponse<SyncCreativesResponse>;\nexport type CanonicalGetMediaBuysResponse = CanonicalCreativeResponse<GetMediaBuysResponse>;\nexport type CanonicalGetMediaBuyDeliveryResponse = CanonicalCreativeResponse<GetMediaBuyDeliveryResponse>;\nexport type CanonicalGetCreativeDeliveryResponse = CanonicalCreativeResponse<GetCreativeDeliveryResponse>;\n\nexport type CanonicalCreativeFilters = Omit<CanonicalCreativeResponse<CreativeFilters>, 'format_ids'> & {\n format_ids?: never;\n};\n\ntype CanonicalListCreativeField = Exclude<NonNullable<ListCreativesRequest['fields']>[number], 'format_id'>;\n\n/** Primary list request: legacy named-format filters and response fields are migration-only. */\nexport type CanonicalListCreativesRequest = Omit<\n CanonicalCreativeResponse<ListCreativesRequest>,\n 'filters' | 'fields'\n> & {\n filters?: CanonicalCreativeFilters;\n fields?: CanonicalListCreativeField[];\n};\n\ntype IsLegacyCreativeIdentityKey<K extends PropertyKey> = K extends string\n ? K extends '_message' | `${string}format_id${string}` | `${string}v1_format_ref${string}`\n ? true\n : false\n : false;\n\n/** Recursively removes legacy creative routing identity from primary response types. */\nexport type CanonicalCreativeResponse<T> = T extends (...args: never[]) => unknown\n ? T\n : T extends readonly (infer TItem)[]\n ? CanonicalCreativeResponse<TItem>[]\n : T extends object\n ? {\n [K in keyof T as IsLegacyCreativeIdentityKey<K> extends true ? never : K]: CanonicalCreativeResponse<T[K]>;\n }\n : T;\n\n/** Runtime counterpart to {@link CanonicalCreativeResponse}. */\nexport function stripLegacyCreativeIdentity<T>(value: T): CanonicalCreativeResponse<T> {\n const legacyTokens = new Set<string>();\n const legacyUrlTokens = new Set<string>();\n const canonicalKinds = new Set<string>([\n 'image',\n 'html5',\n 'display_tag',\n 'image_carousel',\n 'video_hosted',\n 'video_vast',\n 'audio_hosted',\n 'audio_daast',\n 'sponsored_placement',\n 'native_in_feed',\n 'responsive_creative',\n 'agent_placement',\n 'custom',\n ]);\n const creativeIdentityKey = (key: string): boolean =>\n key === '_message' || /(^|_)(?:format_ids?|v1_format_ref)($|_)/.test(key);\n const ownDataValue = (owner: Record<string, unknown>, key: string): unknown => {\n const descriptor = Object.getOwnPropertyDescriptor(owner, key);\n return descriptor && 'value' in descriptor ? descriptor.value : undefined;\n };\n const nonCreativeAgentContext = (key: string | undefined): boolean =>\n typeof key === 'string' &&\n !/(^|_)(?:creative|format|legacy)($|_)/.test(key) &&\n /(^|_)(?:agents?|agent_details|agent_info)($|_)/.test(key);\n const nonCreativeSignalContext = (owner: Record<string, unknown>, key: string | undefined): boolean =>\n ownDataValue(owner, 'source') === 'agent' && typeof key === 'string' && /(^|_)signal_ids?($|_)/.test(key);\n const nonCreativeListContext = (owner: Record<string, unknown>, key: string | undefined): boolean =>\n typeof ownDataValue(owner, 'list_id') === 'string' &&\n typeof key === 'string' &&\n /(^|_)(?:property_list|collection_list|list_ref)($|_)/.test(key);\n const explicitNonCreativeContextKey = (key: string | undefined): boolean =>\n nonCreativeAgentContext(key) ||\n (typeof key === 'string' && /(^|_)(?:signal_ids?|property_list|collection_list|list_ref)($|_)/.test(key));\n const standaloneLegacyTuple = (owner: Record<string, unknown>, ownerKey?: string): boolean => {\n if (\n nonCreativeAgentContext(ownerKey) ||\n nonCreativeSignalContext(owner, ownerKey) ||\n nonCreativeListContext(owner, ownerKey)\n ) {\n return false;\n }\n if (typeof ownDataValue(owner, 'agent_url') !== 'string' || typeof ownDataValue(owner, 'id') !== 'string') {\n return false;\n }\n return true;\n };\n const preservesNonCreativeAgentUrl = (key: string, owner: Record<string, unknown>, ownerKey?: string): boolean => {\n if (!/(^|_)agent_url($|_)/.test(key)) return false;\n if (key === 'agent_url') {\n return (\n nonCreativeAgentContext(ownerKey) ||\n nonCreativeSignalContext(owner, ownerKey) ||\n nonCreativeListContext(owner, ownerKey) ||\n (typeof ownDataValue(owner, 'id') === 'string' && !standaloneLegacyTuple(owner, ownerKey))\n );\n }\n return !/(^|_)(?:creative|format|legacy|offending|target|input|output)($|_)/.test(key);\n };\n const legacyKey = (key: string, owner: Record<string, unknown>, ownerKey?: string): boolean => {\n if (creativeIdentityKey(key)) return true;\n if (!/(^|_)agent_url($|_)/.test(key)) return false;\n if (preservesNonCreativeAgentUrl(key, owner, ownerKey)) return false;\n const value = ownDataValue(owner, key);\n // Composite agent URL fields are used by several non-creative protocol\n // domains. Remove them only when their value is known to belong to a\n // legacy creative identity collected elsewhere in this payload.\n return typeof value === 'string' && legacyTokens.has(value);\n };\n const collectStrings = (current: unknown, seen = new WeakSet<object>(), ownerKey?: string): void => {\n if (typeof current === 'string') {\n if (current.length > 1) {\n legacyTokens.add(current);\n if (ownerKey === 'agent_url' || /^https?:\\/\\//i.test(current)) legacyUrlTokens.add(current);\n }\n return;\n }\n if (current === null || typeof current !== 'object' || seen.has(current)) return;\n seen.add(current);\n if (Array.isArray(current)) {\n for (const child of current) collectStrings(child, seen, ownerKey);\n return;\n }\n for (const key of Reflect.ownKeys(current)) {\n const descriptor = Object.getOwnPropertyDescriptor(current, key);\n if (!descriptor || !('value' in descriptor)) continue;\n collectStrings(descriptor.value, seen, typeof key === 'string' ? key : ownerKey);\n }\n };\n const tokenSeenByContext = {\n default: new WeakSet<object>(),\n nonCreativeAgent: new WeakSet<object>(),\n };\n const collectLegacyTokens = (current: unknown, ownerKey?: string): void => {\n const seen = explicitNonCreativeContextKey(ownerKey)\n ? tokenSeenByContext.nonCreativeAgent\n : tokenSeenByContext.default;\n if (current === null || typeof current !== 'object' || seen.has(current)) return;\n seen.add(current);\n if (Array.isArray(current)) {\n for (const child of current) collectLegacyTokens(child, ownerKey);\n return;\n }\n const owner = current as Record<string, unknown>;\n if (standaloneLegacyTuple(owner, ownerKey)) collectStrings(owner, new WeakSet<object>(), ownerKey);\n for (const key of Object.getOwnPropertyNames(owner)) {\n const descriptor = Object.getOwnPropertyDescriptor(owner, key);\n if (!descriptor || !('value' in descriptor)) continue;\n const child = descriptor.value;\n if (creativeIdentityKey(key)) collectStrings(child);\n else collectLegacyTokens(child, key);\n }\n };\n collectLegacyTokens(value);\n\n const sanitizeText = (text: string, ownerKey?: string): string => {\n const mentionsLegacyIdentity =\n /\\b(?:format_id|format_ids|target_format_ids|input_format_ids|output_format_ids|v1_format_ref|agent_url)\\b/.test(\n text\n );\n let safe = text;\n if (mentionsLegacyIdentity) {\n // Diagnostics sometimes repeat only the flattened identity and omit the\n // structured field that supplied it. Fail closed for those orphan\n // values while leaving unrelated URLs in ordinary messages untouched.\n safe = safe.replace(/\\bhttps?:\\/\\/[^\\s\"'`<>]+/g, '[legacy creative identity]');\n safe = safe.replace(\n /(\\b(?:format_ids?|v1_format_ref|agent_url)\\b(?:\\s+(?:was|is|from))?\\s*[:=]?\\s*[\"'`]?)\\b[a-zA-Z0-9][a-zA-Z0-9_.-]{1,}/g,\n '$1[legacy creative identity]'\n );\n }\n safe = safe.replace(\n /\\b(?:format_id|format_ids|target_format_ids|input_format_ids|output_format_ids|v1_format_ref|agent_url)\\b/g,\n 'legacy creative identity'\n );\n for (const token of [...legacyUrlTokens].sort((left, right) => right.length - left.length)) {\n safe = safe.split(token).join('[legacy creative identity]');\n }\n const diagnosticContext =\n mentionsLegacyIdentity ||\n (typeof ownerKey === 'string' &&\n /(^|_)(?:message|question|prompt|error|reason|summary|context|stack|diagnostic)($|_)/.test(ownerKey));\n if (diagnosticContext) {\n for (const token of [...legacyTokens].sort((left, right) => right.length - left.length)) {\n if (legacyUrlTokens.has(token) || canonicalKinds.has(token)) continue;\n if (token.length < 8 && !/[_:/. -]/.test(token)) continue;\n safe = safe.split(token).join('[legacy creative identity]');\n }\n }\n return safe;\n };\n\n // The same object can appear once under an explicit agent field and once\n // under an ambiguous extension field. Cache by policy context so an allowed\n // agent occurrence cannot make a later ambiguous tuple fail open (or vice\n // versa based on property order).\n const seenByContext = {\n default: new WeakMap<object, unknown>(),\n nonCreativeAgent: new WeakMap<object, unknown>(),\n };\n const hasCustomToJSON = (candidate: object): boolean => {\n let cursor: object | null = candidate;\n while (cursor) {\n const descriptor = Object.getOwnPropertyDescriptor(cursor, 'toJSON');\n if (descriptor) return !('value' in descriptor) || typeof descriptor.value === 'function';\n cursor = Object.getPrototypeOf(cursor) as object | null;\n }\n return false;\n };\n const strip = (current: unknown, ownerKey?: string): unknown => {\n if (typeof current === 'string') return sanitizeText(current, ownerKey);\n if (current === null || typeof current !== 'object') return current;\n const seen = explicitNonCreativeContextKey(ownerKey) ? seenByContext.nonCreativeAgent : seenByContext.default;\n const cached = seen.get(current);\n if (cached !== undefined) return cached;\n if (Array.isArray(current)) {\n const result: unknown[] = [];\n seen.set(current, result);\n const needsSafeToJSON = hasCustomToJSON(current);\n let changed = needsSafeToJSON || Object.getPrototypeOf(current) !== Array.prototype;\n for (const key of Reflect.ownKeys(current)) {\n if (key === 'length') continue;\n const descriptor = Object.getOwnPropertyDescriptor(current, key);\n if (!descriptor) continue;\n if (!('value' in descriptor)) {\n changed = true;\n continue;\n }\n if (key === 'toJSON' && typeof descriptor.value === 'function') {\n changed = true;\n continue;\n }\n if (typeof key === 'string' && legacyKey(key, current as unknown as Record<string, unknown>, ownerKey)) {\n changed = true;\n continue;\n }\n const safe = strip(descriptor.value, typeof key === 'string' && !/^\\d+$/.test(key) ? key : ownerKey);\n if (safe !== descriptor.value) changed = true;\n Object.defineProperty(result, key, { ...descriptor, value: safe });\n }\n result.length = current.length;\n if (!changed) {\n seen.set(current, current);\n return current;\n }\n if (needsSafeToJSON) {\n Object.defineProperty(result, 'toJSON', {\n configurable: true,\n enumerable: false,\n value: () => Array.from(result),\n });\n }\n transferLegacyCreativeMetadata(current, result);\n return result;\n }\n const prototype = Object.getPrototypeOf(current);\n const plain = prototype === Object.prototype || prototype === null;\n const safePrototype =\n prototype === null ? null : Error.prototype.isPrototypeOf(current) ? Error.prototype : Object.prototype;\n // Never retain an adopter-controlled prototype. Inherited getters and\n // methods are behavior, not inspected data, and can reveal legacy identity\n // after this boundary has supposedly been sanitized.\n const result: Record<string | symbol, unknown> = Object.create(safePrototype);\n seen.set(current, result);\n const owner = current as Record<string, unknown>;\n if (standaloneLegacyTuple(owner, ownerKey)) {\n const empty = {};\n seen.set(current, empty);\n return empty;\n }\n const needsSafeToJSON = hasCustomToJSON(current);\n let changed = !plain || needsSafeToJSON;\n const keys: Array<string | symbol> = Reflect.ownKeys(current);\n for (const key of keys) {\n const descriptor = Object.getOwnPropertyDescriptor(current, key);\n if (!descriptor) continue;\n if (!('value' in descriptor)) {\n // Never reflect accessors across the canonical boundary. Evaluating a\n // retained getter later could reveal a legacy identity that was not\n // present while this object was inspected (and may run adopter code).\n changed = true;\n continue;\n }\n const child = descriptor.value;\n if (typeof key === 'symbol') {\n const safe = strip(child);\n if (safe !== child) changed = true;\n if (!plain) Object.defineProperty(result, key, { ...descriptor, value: safe });\n continue;\n }\n if (key === 'toJSON' && typeof child === 'function') {\n changed = true;\n continue;\n }\n if (legacyKey(key, owner, ownerKey)) {\n changed = true;\n continue;\n }\n const safe = preservesNonCreativeAgentUrl(key, owner, ownerKey) ? child : strip(child, key);\n if (safe !== child) changed = true;\n if (plain && typeof key === 'string' && descriptor.enumerable) result[key] = safe;\n else Object.defineProperty(result, key, { ...descriptor, value: safe });\n }\n if (!changed) {\n seen.set(current, current);\n return current;\n }\n if (needsSafeToJSON) {\n Object.defineProperty(result, 'toJSON', {\n configurable: true,\n enumerable: false,\n value: () => {\n const serialized: Record<string, unknown> = {};\n for (const key of Object.keys(result)) serialized[key] = result[key];\n return serialized;\n },\n });\n }\n transferLegacyCreativeMetadata(current, result);\n return result;\n };\n return strip(value) as CanonicalCreativeResponse<T>;\n}\n\nexport type CanonicalProjectedCreative<T> = Omit<T, 'format_id' | 'format_kind'> & {\n format_kind: CanonicalFormatKind;\n format_id?: never;\n};\nexport type LegacyProjectedCreative<T> = Omit<T, 'format_id' | 'format_kind' | 'format_option_ref'> & {\n format_id: V1FormatId;\n format_kind?: never;\n format_option_ref?: never;\n};\n\ntype ProjectedCreativeArray<T, TMode extends 'canonical' | 'legacy'> =\n T extends ReadonlyArray<infer TCreative>\n ? Array<TMode extends 'canonical' ? CanonicalProjectedCreative<TCreative> : LegacyProjectedCreative<TCreative>>\n : T;\ntype ReplaceCreatives<T, TMode extends 'canonical' | 'legacy'> = T extends object\n ? 'creatives' extends keyof T\n ? Omit<T, 'creatives'> &\n (Record<never, never> extends Pick<T, 'creatives'>\n ? { creatives?: ProjectedCreativeArray<T['creatives'], TMode> }\n : { creatives: ProjectedCreativeArray<T['creatives'], TMode> })\n : T\n : T;\ntype ProjectedContainerArray<T, TMode extends 'canonical' | 'legacy'> =\n T extends ReadonlyArray<infer TContainer> ? Array<ReplaceCreatives<TContainer, TMode>> : T;\ntype ReplaceContainerKey<\n T,\n TKey extends 'packages' | 'new_packages',\n TMode extends 'canonical' | 'legacy',\n> = TKey extends keyof T\n ? Record<never, never> extends Pick<T, TKey>\n ? { [K in TKey]?: ProjectedContainerArray<T[TKey], TMode> }\n : { [K in TKey]: ProjectedContainerArray<T[TKey], TMode> }\n : Record<never, never>;\n\nexport type ProjectedMediaBuyCreativeRequest<T, TMode extends 'canonical' | 'legacy'> = Omit<\n T,\n 'packages' | 'new_packages'\n> &\n ReplaceContainerKey<T, 'packages', TMode> &\n ReplaceContainerKey<T, 'new_packages', TMode>;\nexport type ProjectedSyncCreativeRequest<T, TMode extends 'canonical' | 'legacy'> = ReplaceCreatives<T, TMode>;\n\nexport type CreativeFormatWireMode = 'canonical' | 'legacy' | 'unknown';\n\nexport interface CreativeFormatSelectorContainer {\n package_id?: string;\n format_ids?: unknown[];\n formats?: unknown[];\n format_options?: unknown[];\n format_option_refs?: unknown[];\n format_kind?: unknown;\n params?: unknown;\n /** Internal composition seam used to preserve per-package selector constraints. */\n selector_containers?: ReadonlyArray<CreativeFormatSelectorContainer>;\n [key: string]: unknown;\n}\n\n/** Canonical package/product selectors accepted by the primary sync API. */\nexport interface CanonicalCreativeFormatSelectorContainer {\n package_id?: string;\n format_options?: ReadonlyArray<CanonicalFormatDeclaration>;\n format_option_refs?: ReadonlyArray<FormatOptionReference>;\n format_kind?: CanonicalFormatKind;\n params?: CanonicalFormatDeclaration['params'];\n selector_containers?: ReadonlyArray<CanonicalCreativeFormatSelectorContainer>;\n}\n\nexport interface SyncCreativeFormatProjection {\n selectorContainers: ReadonlyArray<CanonicalCreativeFormatSelectorContainer>;\n legacyFormatConverter?: LegacyFormatConverter;\n}\n\nexport class CreativeFormatProjectionError extends Error {\n readonly code = 'ADCP_CREATIVE_FORMAT_PROJECTION_FAILED';\n\n constructor(\n readonly operation: string,\n readonly creativeId: string,\n reason: string\n ) {\n super(`${operation}: cannot select a valid creative wire shape for ${creativeId}: ${reason}`);\n this.name = 'CreativeFormatProjectionError';\n }\n}\n\nexport class CreativeFormatCapabilityError extends Error {\n readonly code = 'ADCP_CREATIVE_FORMAT_CAPABILITY_CONTRADICTION';\n\n constructor(message: string) {\n super(message);\n this.name = 'CreativeFormatCapabilityError';\n }\n}\n\nconst CANONICAL_FORMAT_KINDS = new Set<CanonicalFormatKind>([\n 'image',\n 'html5',\n 'display_tag',\n 'image_carousel',\n 'video_hosted',\n 'video_vast',\n 'audio_hosted',\n 'audio_daast',\n 'sponsored_placement',\n 'native_in_feed',\n 'responsive_creative',\n 'agent_placement',\n 'custom',\n]);\n\ntype LegacyCandidate = {\n ref: V1FormatId;\n formatKind?: string;\n formatOptionRef?: FormatOptionReference;\n selectorParams?: unknown;\n};\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction legacyRef(value: unknown): V1FormatId | undefined {\n const candidate = record(value);\n if (!candidate || typeof candidate.agent_url !== 'string' || typeof candidate.id !== 'string') return undefined;\n if (candidate.agent_url.length === 0 || candidate.id.length === 0) return undefined;\n return {\n agent_url: candidate.agent_url,\n id: candidate.id,\n ...(typeof candidate.width === 'number' ? { width: candidate.width } : {}),\n ...(typeof candidate.height === 'number' ? { height: candidate.height } : {}),\n ...(typeof candidate.duration_ms === 'number' ? { duration_ms: candidate.duration_ms } : {}),\n };\n}\n\nfunction refsFromValue(value: unknown): V1FormatId[] {\n if (Array.isArray(value)) return value.flatMap(item => refsFromValue(item));\n const ref = legacyRef(value);\n return ref ? [ref] : [];\n}\n\ntype CanonicalFormatOptionReference = FormatOptionReference & { canonical_formats_only?: true };\n\nfunction optionReference(value: unknown): CanonicalFormatOptionReference | undefined {\n const option = record(value);\n if (!option || typeof option.format_option_id !== 'string' || option.format_option_id.length === 0) return undefined;\n const canonicalOnly = option.canonical_formats_only === true ? { canonical_formats_only: true as const } : {};\n if (typeof option.publisher_domain === 'string') {\n return {\n scope: 'publisher',\n publisher_domain: option.publisher_domain,\n format_option_id: option.format_option_id,\n ...canonicalOnly,\n };\n }\n return { scope: 'product', format_option_id: option.format_option_id, ...canonicalOnly };\n}\n\nfunction sameOptionReference(left: FormatOptionReference, right: FormatOptionReference): boolean {\n return (\n left.scope === right.scope &&\n left.format_option_id === right.format_option_id &&\n (left.scope !== 'publisher' || (right.scope === 'publisher' && left.publisher_domain === right.publisher_domain))\n );\n}\n\nfunction selectedOptionReferences(container: CreativeFormatSelectorContainer): CanonicalFormatOptionReference[] {\n const direct = Array.isArray(container.format_option_refs)\n ? container.format_option_refs.flatMap(value => {\n const ref = optionReference(value);\n return ref ? [ref] : [];\n })\n : [];\n const nested = Array.isArray(container.selector_containers)\n ? container.selector_containers.flatMap(selectedOptionReferences)\n : [];\n return [...direct, ...nested];\n}\n\nfunction agentIdentity(value: string): string {\n try {\n // URL parsing normalizes the scheme/host (the case-insensitive pieces)\n // while preserving case-sensitive paths, queries, and fragments.\n return new URL(value).href;\n } catch {\n return value;\n }\n}\n\nfunction sameLegacyIdentity(left: V1FormatId, right: V1FormatId): boolean {\n return agentIdentity(left.agent_url) === agentIdentity(right.agent_url) && left.id === right.id;\n}\n\nfunction candidatesFromContainer(\n container: CreativeFormatSelectorContainer,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver,\n operation = 'creative_delivery'\n): LegacyCandidate[] {\n if (Array.isArray(container.selector_containers)) {\n return uniqueCandidates(\n container.selector_containers.flatMap(candidate =>\n candidatesFromContainer(candidate, canonicalFormatLegacyResolver, operation)\n )\n );\n }\n const candidates: LegacyCandidate[] = [];\n const containerKind = typeof container.format_kind === 'string' ? container.format_kind : undefined;\n for (const key of ['format_ids', 'formats'] as const) {\n for (const ref of refsFromValue(container[key])) {\n candidates.push({\n ref,\n formatKind: resolveCanonicalFormatKind(ref.id) ?? containerKind,\n selectorParams: container.params,\n });\n }\n }\n const formatOptions = [\n ...(Array.isArray(container.format_options) ? container.format_options : []),\n ...selectedFormatOptions(container),\n ];\n for (const optionValue of formatOptions) {\n const option = record(optionValue);\n if (!option) continue;\n const formatKind = typeof option.format_kind === 'string' ? option.format_kind : undefined;\n const formatOptionRef = optionReference(option);\n let refs = [...legacyFormatRefsForDeclaration(option)];\n if (refs.length === 0 && option.canonical_formats_only !== true && formatKind) {\n try {\n refs =\n resolveCanonicalFormatLegacyRefs(canonicalFormatLegacyResolver, {\n source: 'product',\n declaration: option as unknown as import('./types').V2ProductFormatDeclaration,\n productId: typeof container.product_id === 'string' ? container.product_id : '<selector>',\n field: formatOptionRef?.format_option_id ?? '(format option)',\n }) ?? [];\n } catch (error) {\n if (!(error instanceof CanonicalFormatLegacyResolutionError)) throw error;\n throw new CreativeFormatProjectionError(\n operation,\n '(format option)',\n 'canonical format legacy resolver returned an invalid product mapping'\n );\n }\n }\n for (const ref of refs) {\n candidates.push({ ref, formatKind, formatOptionRef, selectorParams: option.params ?? container.params });\n }\n }\n return uniqueCandidates(candidates);\n}\n\nfunction containerOptsOutOfLegacy(\n container: CreativeFormatSelectorContainer,\n formatKind?: string,\n formatOptionRef?: FormatOptionReference\n): boolean {\n if ((formatOptionRef as CanonicalFormatOptionReference | undefined)?.canonical_formats_only === true) return true;\n if (\n Array.isArray(container.selector_containers) &&\n container.selector_containers.some(candidate => containerOptsOutOfLegacy(candidate, formatKind, formatOptionRef))\n ) {\n return true;\n }\n const selectedRefs = selectedOptionReferences(container);\n if (\n selectedRefs.some(ref => {\n if (ref.canonical_formats_only !== true) return false;\n return formatOptionRef === undefined || sameOptionReference(ref, formatOptionRef);\n })\n ) {\n return true;\n }\n const formatOptions = [\n ...(Array.isArray(container.format_options) ? container.format_options : []),\n ...selectedFormatOptions(container),\n ];\n return formatOptions.some(value => {\n const option = record(value);\n if (!option || option.canonical_formats_only !== true) return false;\n if (formatKind && option.format_kind !== formatKind) return false;\n if (formatOptionRef) {\n const optionRef = optionReference(option);\n if (!optionRef || !sameOptionReference(optionRef, formatOptionRef)) return false;\n }\n return true;\n });\n}\n\nfunction candidateKey(candidate: LegacyCandidate): string {\n const ref = candidate.ref;\n return [\n agentIdentity(ref.agent_url),\n ref.id,\n ref.width ?? '',\n ref.height ?? '',\n ref.duration_ms ?? '',\n candidate.formatOptionRef?.scope ?? '',\n candidate.formatOptionRef?.format_option_id ?? '',\n candidate.formatOptionRef?.scope === 'publisher' ? candidate.formatOptionRef.publisher_domain : '',\n ].join('|');\n}\n\nfunction uniqueCandidates(candidates: LegacyCandidate[]): LegacyCandidate[] {\n return [...new Map(candidates.map(candidate => [candidateKey(candidate), candidate])).values()];\n}\n\nfunction refMatchesParams(ref: V1FormatId, paramsValue: unknown): boolean {\n const params = record(paramsValue);\n if (!params) return true;\n const sizes = Array.isArray(params.sizes) ? params.sizes.flatMap(size => (record(size) ? [record(size)!] : [])) : [];\n if (sizes.length === 1) {\n const size = sizes[0]!;\n if (typeof size.width === 'number' && ref.width !== size.width) return false;\n if (typeof size.height === 'number' && ref.height !== size.height) return false;\n }\n if (typeof params.width === 'number' && ref.width !== params.width) return false;\n if (typeof params.height === 'number' && ref.height !== params.height) return false;\n if (typeof params.duration_ms_exact === 'number' && ref.duration_ms !== params.duration_ms_exact) return false;\n return true;\n}\n\nfunction selectLegacyRef(\n creative: Record<string, unknown>,\n container: CreativeFormatSelectorContainer,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver,\n operation = 'creative_delivery'\n): V1FormatId | undefined {\n let candidates = candidatesFromContainer(container, canonicalFormatLegacyResolver, operation);\n const creativeOptionRef = optionReference(creative.format_option_ref);\n const selectedOptionRefs = Array.isArray(container.format_option_refs)\n ? container.format_option_refs.flatMap(value => {\n const ref = optionReference(value);\n return ref ? [ref] : [];\n })\n : [];\n if (creativeOptionRef) {\n if (selectedOptionRefs.length > 0 && !selectedOptionRefs.some(ref => sameOptionReference(ref, creativeOptionRef))) {\n return undefined;\n }\n candidates = candidates.filter(\n candidate => candidate.formatOptionRef && sameOptionReference(candidate.formatOptionRef, creativeOptionRef)\n );\n } else if (selectedOptionRefs.length > 0) {\n candidates = candidates.filter(\n candidate =>\n candidate.formatOptionRef &&\n selectedOptionRefs.some(ref => sameOptionReference(ref, candidate.formatOptionRef!))\n );\n }\n const existing = legacyRef(creative.format_id);\n if (existing) {\n const exact = candidates.filter(\n candidate =>\n sameLegacyIdentity(candidate.ref, existing) &&\n (existing.width === undefined || candidate.ref.width === existing.width) &&\n (existing.height === undefined || candidate.ref.height === existing.height) &&\n (existing.duration_ms === undefined || candidate.ref.duration_ms === existing.duration_ms)\n );\n if (exact.length === 1) return exact[0]!.ref;\n return candidates.length === 0 ? existing : undefined;\n }\n\n if (typeof creative.format_kind !== 'string') return undefined;\n let matching = candidates.filter(candidate => candidate.formatKind === creative.format_kind);\n const constrained = matching.filter(candidate => refMatchesParams(candidate.ref, candidate.selectorParams));\n if (constrained.length > 0) matching = constrained;\n return matching.length === 1 ? matching[0]!.ref : undefined;\n}\n\nfunction projectCreative<T extends Record<string, unknown>>(creative: T, formatId: V1FormatId): T {\n const next: Record<string, unknown> = { ...creative };\n delete next.format_kind;\n delete next.format_option_ref;\n next.format_id = { ...formatId };\n return next as T;\n}\n\nfunction dedupeLegacyRefs(refs: readonly V1FormatId[]): V1FormatId[] {\n return [...new Map(refs.map(ref => [candidateKey({ ref }), { ...ref }])).values()];\n}\n\nfunction projectPackageSelectors(\n pkg: Record<string | symbol, unknown>,\n wireMode: CreativeFormatWireMode,\n operation: string,\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): Record<string | symbol, unknown> {\n const next = { ...pkg };\n const optionRefs = Array.isArray(pkg.format_option_refs)\n ? pkg.format_option_refs.flatMap(value => {\n const ref = optionReference(value);\n return ref ? [ref] : [];\n })\n : [];\n const legacyRefs = refsFromValue(pkg.format_ids);\n const candidates = candidatesFromContainer(\n pkg as CreativeFormatSelectorContainer,\n wireMode === 'canonical' ? undefined : canonicalFormatLegacyResolver,\n operation\n );\n const canonicalKind = typeof pkg.format_kind === 'string' ? pkg.format_kind : undefined;\n\n if (wireMode === 'canonical') {\n if (optionRefs.length > 0) {\n // Rebuild the array before transport so SDK-private downgrade metadata\n // never crosses the canonical wire boundary.\n next.format_option_refs = optionRefs.map(ref => ({ ...ref }));\n }\n if (legacyRefs.length > 0) {\n let mappedRefs = legacyRefs.flatMap(legacy => {\n const matches = candidates.filter(candidate => sameLegacyIdentity(candidate.ref, legacy));\n if (matches.length !== 1 || !matches[0]!.formatOptionRef) return [];\n return [matches[0]!.formatOptionRef];\n });\n if (optionRefs.length === 0 && mappedRefs.length !== legacyRefs.length) {\n const productId = typeof pkg.product_id === 'string' ? pkg.product_id : '<package-selector>';\n const projected = projectV1ProductToV2(\n {\n product_id: productId,\n name: productId,\n description: 'legacy package selector normalization',\n format_ids: legacyRefs,\n },\n { legacyFormatConverter }\n );\n const projectedRefs = projected.v2.format_options.flatMap(option => {\n const ref = optionReference(option);\n return ref ? [ref] : [];\n });\n if (projected.diagnostics.length > 0 || projectedRefs.length !== legacyRefs.length) {\n throw new CreativeFormatProjectionError(\n operation,\n '(package selector)',\n 'legacy package format_ids cannot be converted to stable canonical format_option_refs'\n );\n }\n mappedRefs = projectedRefs;\n }\n if (optionRefs.length === 0) next.format_option_refs = mappedRefs;\n }\n delete next.format_ids;\n } else {\n if (optionRefs.length > 0) {\n const selectedCandidates = candidates.filter(\n candidate =>\n candidate.formatOptionRef &&\n optionRefs.some(selected => sameOptionReference(selected, candidate.formatOptionRef!))\n );\n const everyOptionMapped = optionRefs.every(selected =>\n selectedCandidates.some(candidate =>\n candidate.formatOptionRef ? sameOptionReference(selected, candidate.formatOptionRef) : false\n )\n );\n if (!everyOptionMapped || selectedCandidates.length === 0) {\n let resolved: V1FormatId[] | undefined;\n try {\n if (!containerOptsOutOfLegacy(pkg as CreativeFormatSelectorContainer)) {\n resolved = resolveCanonicalFormatLegacyRefs(canonicalFormatLegacyResolver, {\n source: 'selector',\n selector: pkg as Record<string, unknown>,\n operation,\n field: '(package selector)',\n });\n }\n } catch (error) {\n if (!(error instanceof CanonicalFormatLegacyResolutionError)) throw error;\n throw new CreativeFormatProjectionError(\n operation,\n '(package selector)',\n 'canonical format legacy resolver returned an invalid or ambiguous package mapping'\n );\n }\n if (!resolved) {\n throw new CreativeFormatProjectionError(\n operation,\n '(package selector)',\n 'canonical format_option_refs have no complete legacy representation; re-run getProducts() or configure canonicalFormatLegacyResolver for persisted selections'\n );\n }\n next.format_ids = resolved;\n delete next.format_option_refs;\n delete next.format_kind;\n return next;\n }\n next.format_ids = dedupeLegacyRefs(selectedCandidates.map(candidate => candidate.ref));\n delete next.format_option_refs;\n } else if (canonicalKind) {\n const selectedCandidates = candidates.filter(candidate => candidate.formatKind === canonicalKind);\n if (selectedCandidates.length === 1) {\n next.format_ids = [{ ...selectedCandidates[0]!.ref }];\n } else {\n let resolved: V1FormatId[] | undefined;\n try {\n if (!containerOptsOutOfLegacy(pkg as CreativeFormatSelectorContainer, canonicalKind)) {\n resolved = resolveCanonicalFormatLegacyRefs(\n canonicalFormatLegacyResolver,\n {\n source: 'selector',\n selector: pkg as Record<string, unknown>,\n operation,\n field: '(package selector)',\n },\n true\n );\n }\n } catch (error) {\n if (!(error instanceof CanonicalFormatLegacyResolutionError)) throw error;\n throw new CreativeFormatProjectionError(\n operation,\n '(package selector)',\n 'canonical format legacy resolver returned an invalid or ambiguous package mapping'\n );\n }\n if (resolved) {\n next.format_ids = resolved;\n } else {\n throw new CreativeFormatProjectionError(\n operation,\n '(package selector)',\n 'canonical package format_kind has no unambiguous legacy representation; select a format_option_ref from the product before delivery'\n );\n }\n }\n }\n delete next.format_kind;\n }\n\n return next;\n}\n\nfunction canonicalizeCreative<T extends Record<string, unknown>>(\n creative: T,\n selectorContainer: CreativeFormatSelectorContainer,\n operation: string,\n legacyFormatConverter?: LegacyFormatConverter\n): T {\n const creativeId = typeof creative.creative_id === 'string' ? creative.creative_id : '(unknown)';\n const hasCanonicalKind = typeof creative.format_kind === 'string';\n if (hasCanonicalKind && creative.format_id !== undefined) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n 'creative must not declare both canonical format_kind and legacy format_id'\n );\n }\n if (hasCanonicalKind && creative.format_id === undefined) {\n if (!CANONICAL_FORMAT_KINDS.has(creative.format_kind as CanonicalFormatKind)) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n `unknown canonical format_kind ${creative.format_kind}`\n );\n }\n const creativeOptionRef = optionReference(creative.format_option_ref);\n const selectedRefs = selectedOptionReferences(selectorContainer);\n if (\n creativeOptionRef &&\n selectedRefs.length > 0 &&\n !selectedRefs.some(ref => sameOptionReference(ref, creativeOptionRef))\n ) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n 'creative format_option_ref conflicts with the package selected format_option_refs'\n );\n }\n return creative;\n }\n const existing = legacyRef(creative.format_id);\n if (!existing) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n 'creative must identify its format canonically with format_kind'\n );\n }\n\n const matchingCandidates = candidatesFromContainer(selectorContainer).filter(\n candidate =>\n sameLegacyIdentity(candidate.ref, existing) &&\n (existing.width === undefined || candidate.ref.width === existing.width) &&\n (existing.height === undefined || candidate.ref.height === existing.height) &&\n (existing.duration_ms === undefined || candidate.ref.duration_ms === existing.duration_ms)\n );\n if (matchingCandidates.length === 1 && matchingCandidates[0]!.formatKind) {\n const candidate = matchingCandidates[0]!;\n const next: Record<string, unknown> = { ...creative, format_kind: candidate.formatKind };\n delete next.format_id;\n if (candidate.formatOptionRef) next.format_option_ref = candidate.formatOptionRef;\n if (candidate.formatKind === 'custom' && !candidate.formatOptionRef) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n 'custom product format must provide format_option_id so the canonical creative retains a concrete identity'\n );\n }\n return next as T;\n }\n const selectorCandidates = candidatesFromContainer(selectorContainer);\n if (selectorCandidates.length > 0 && matchingCandidates.length !== 1) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n matchingCandidates.length === 0\n ? 'legacy format reference conflicts with the selected seller format identity or constraints'\n : 'legacy format reference is ambiguous within the selected seller format options'\n );\n }\n\n const { v2, diagnostics } = projectV1ProductToV2(\n {\n product_id: `<creative:${creativeId}>`,\n name: creativeId,\n description: 'legacy creative normalization',\n format_ids: [existing],\n },\n { legacyFormatConverter }\n );\n const declaration = v2.format_options[0];\n if (!declaration) {\n const diagnostic = diagnostics[0];\n const failure =\n diagnostic?.code === 'FORMAT_PROJECTION_FAILED' ? diagnostic.error.details.resolution_failure : undefined;\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n `legacy creative format has no canonical conversion${failure ? ` (${failure})` : ''}`\n );\n }\n const next: Record<string, unknown> = { ...creative, format_kind: declaration.format_kind };\n delete next.format_id;\n const candidateOptionRef =\n matchingCandidates.length === 1 && matchingCandidates[0]!.formatKind === declaration.format_kind\n ? matchingCandidates[0]!.formatOptionRef\n : undefined;\n const convertedOptionRef = optionReference(declaration) ?? candidateOptionRef;\n if (convertedOptionRef) next.format_option_ref = convertedOptionRef;\n if (declaration.format_kind === 'custom' && !convertedOptionRef) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n 'custom legacy conversion must provide format_option_id so the canonical creative retains a concrete identity'\n );\n }\n return next as T;\n}\n\nexport function projectCreativeForDelivery<T extends CreativeAsset>(\n creative: T,\n selectorContainer: CreativeFormatSelectorContainer,\n wireMode?: 'canonical',\n operation?: string,\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): CanonicalProjectedCreative<T>;\nexport function projectCreativeForDelivery<T extends CreativeAsset>(\n creative: T,\n selectorContainer: CreativeFormatSelectorContainer,\n wireMode: 'legacy' | 'unknown',\n operation?: string,\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): LegacyProjectedCreative<T>;\nexport function projectCreativeForDelivery<T extends CreativeAsset>(\n creative: T,\n selectorContainer: CreativeFormatSelectorContainer,\n wireMode: CreativeFormatWireMode,\n operation?: string,\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): CanonicalProjectedCreative<T> | LegacyProjectedCreative<T>;\nexport function projectCreativeForDelivery<T extends CreativeAsset>(\n creative: T,\n selectorContainer: CreativeFormatSelectorContainer,\n wireMode: CreativeFormatWireMode = 'canonical',\n operation = 'creative_delivery',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): CanonicalProjectedCreative<T> | LegacyProjectedCreative<T> {\n const inputRecord = creative as unknown as Record<string, unknown>;\n const originalLegacyRef = legacyRef(inputRecord.format_id);\n const creativeRecord = canonicalizeCreative(inputRecord, selectorContainer, operation, legacyFormatConverter);\n if (wireMode === 'canonical') return creativeRecord as unknown as CanonicalProjectedCreative<T>;\n if (originalLegacyRef) {\n const selectedOriginal = selectLegacyRef(inputRecord, selectorContainer, canonicalFormatLegacyResolver, operation);\n if (selectedOriginal) {\n return projectCreative(creativeRecord, selectedOriginal) as unknown as LegacyProjectedCreative<T>;\n }\n throw new CreativeFormatProjectionError(\n operation,\n typeof inputRecord.creative_id === 'string' ? inputRecord.creative_id : '(unknown)',\n 'the original legacy format reference conflicts with the selected seller format identity or constraints'\n );\n }\n const formatId = selectLegacyRef(creativeRecord, selectorContainer, canonicalFormatLegacyResolver, operation);\n if (formatId) return projectCreative(creativeRecord, formatId) as unknown as LegacyProjectedCreative<T>;\n\n if (typeof creativeRecord.format_kind === 'string') {\n const creativeId = typeof creativeRecord.creative_id === 'string' ? creativeRecord.creative_id : '(unknown)';\n const allCandidates = candidatesFromContainer(selectorContainer, canonicalFormatLegacyResolver, operation);\n let candidates = allCandidates.filter(candidate => candidate.formatKind === creativeRecord.format_kind);\n const constrained = candidates.filter(candidate => refMatchesParams(candidate.ref, selectorContainer.params));\n if (constrained.length > 0) candidates = constrained;\n let resolved: V1FormatId[] | undefined;\n try {\n if (\n !containerOptsOutOfLegacy(\n selectorContainer,\n creativeRecord.format_kind,\n optionReference(creativeRecord.format_option_ref)\n )\n ) {\n resolved = resolveCanonicalFormatLegacyRefs(\n canonicalFormatLegacyResolver,\n {\n source: 'creative',\n creative: creativeRecord,\n selector: selectorContainer as Record<string, unknown>,\n operation,\n field: creativeId,\n },\n true\n );\n }\n } catch (error) {\n if (!(error instanceof CanonicalFormatLegacyResolutionError)) throw error;\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n 'canonical format legacy resolver returned an invalid or ambiguous creative mapping'\n );\n }\n if (resolved) return projectCreative(creativeRecord, resolved[0]!) as unknown as LegacyProjectedCreative<T>;\n if (candidates.length > 1) {\n throw new CreativeFormatProjectionError(\n operation,\n creativeId,\n `the seller advertised ${candidates.length} legacy refs for canonical kind ${creativeRecord.format_kind}`\n );\n }\n const reason = 'the selected seller product did not provide one unambiguous legacy format reference';\n throw new CreativeFormatProjectionError(operation, creativeId, reason);\n }\n return creative as unknown as LegacyProjectedCreative<T>;\n}\n\nexport function projectMediaBuyCreativesForDelivery<T>(\n request: T,\n wireMode: 'canonical',\n operation?: 'create_media_buy' | 'update_media_buy',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedMediaBuyCreativeRequest<T, 'canonical'>;\nexport function projectMediaBuyCreativesForDelivery<T>(\n request: T,\n wireMode: 'legacy' | 'unknown',\n operation?: 'create_media_buy' | 'update_media_buy',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedMediaBuyCreativeRequest<T, 'legacy'>;\nexport function projectMediaBuyCreativesForDelivery<T>(\n request: T,\n wireMode: CreativeFormatWireMode,\n operation?: 'create_media_buy' | 'update_media_buy',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedMediaBuyCreativeRequest<T, 'canonical'> | ProjectedMediaBuyCreativeRequest<T, 'legacy'>;\nexport function projectMediaBuyCreativesForDelivery<T>(\n request: T,\n wireMode: CreativeFormatWireMode = 'canonical',\n operation: 'create_media_buy' | 'update_media_buy' = 'create_media_buy',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedMediaBuyCreativeRequest<T, 'canonical'> | ProjectedMediaBuyCreativeRequest<T, 'legacy'> {\n const requestRecord = record(request);\n if (!requestRecord) return request as ProjectedMediaBuyCreativeRequest<T, 'canonical'>;\n let changed = false;\n const next = { ...requestRecord };\n for (const key of ['packages', 'new_packages'] as const) {\n const packages = requestRecord[key];\n if (!Array.isArray(packages)) continue;\n next[key] = packages.map(packageValue => {\n const pkg = record(packageValue);\n if (!pkg) return packageValue;\n const creatives = Array.isArray(pkg.creatives)\n ? pkg.creatives.map(creativeValue => {\n const creative = record(creativeValue);\n if (!creative) return creativeValue;\n const projected = projectCreativeForDelivery(\n creative as unknown as CreativeAsset,\n pkg as CreativeFormatSelectorContainer,\n wireMode,\n operation,\n legacyFormatConverter,\n canonicalFormatLegacyResolver\n );\n if (projected !== creativeValue) changed = true;\n return projected;\n })\n : undefined;\n const projectedPackage = projectPackageSelectors(\n pkg,\n wireMode,\n operation,\n legacyFormatConverter,\n canonicalFormatLegacyResolver\n );\n if (projectedPackage !== packageValue) changed = true;\n return creatives ? { ...projectedPackage, creatives } : projectedPackage;\n });\n }\n return (changed ? next : request) as\n | ProjectedMediaBuyCreativeRequest<T, 'canonical'>\n | ProjectedMediaBuyCreativeRequest<T, 'legacy'>;\n}\n\nexport function projectSyncCreativesForDelivery<T>(\n request: T,\n selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>,\n wireMode: 'canonical',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedSyncCreativeRequest<T, 'canonical'>;\nexport function projectSyncCreativesForDelivery<T>(\n request: T,\n selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>,\n wireMode: 'legacy' | 'unknown',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedSyncCreativeRequest<T, 'legacy'>;\nexport function projectSyncCreativesForDelivery<T>(\n request: T,\n selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>,\n wireMode: CreativeFormatWireMode,\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedSyncCreativeRequest<T, 'canonical'> | ProjectedSyncCreativeRequest<T, 'legacy'>;\nexport function projectSyncCreativesForDelivery<T>(\n request: T,\n selectorContainers: ReadonlyArray<CreativeFormatSelectorContainer>,\n wireMode: CreativeFormatWireMode = 'canonical',\n legacyFormatConverter?: LegacyFormatConverter,\n canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver\n): ProjectedSyncCreativeRequest<T, 'canonical'> | ProjectedSyncCreativeRequest<T, 'legacy'> {\n const requestRecord = record(request);\n if (!requestRecord || !Array.isArray(requestRecord.creatives)) {\n return request as ProjectedSyncCreativeRequest<T, 'canonical'>;\n }\n const assignments = Array.isArray(requestRecord.assignments) ? requestRecord.assignments : [];\n let changed = false;\n const creatives = requestRecord.creatives.map(creativeValue => {\n const creative = record(creativeValue);\n if (!creative) return creativeValue;\n const assignedPackageIds = new Set(\n assignments.flatMap(assignmentValue => {\n const assignment = record(assignmentValue);\n if (!assignment || assignment.creative_id !== creative.creative_id) return [];\n return typeof assignment.package_id === 'string' ? [assignment.package_id] : [];\n })\n );\n const relevant =\n assignedPackageIds.size === 0\n ? selectorContainers\n : selectorContainers.filter(\n container => typeof container.package_id === 'string' && assignedPackageIds.has(container.package_id)\n );\n const combined: CreativeFormatSelectorContainer = {\n selector_containers: relevant,\n };\n const projected = projectCreativeForDelivery(\n creative as unknown as CreativeAsset,\n combined,\n wireMode,\n 'sync_creatives',\n legacyFormatConverter,\n canonicalFormatLegacyResolver\n );\n if (projected !== creativeValue) changed = true;\n return projected;\n });\n return (changed ? { ...requestRecord, creatives } : request) as\n | ProjectedSyncCreativeRequest<T, 'canonical'>\n | ProjectedSyncCreativeRequest<T, 'legacy'>;\n}\n\ntype CreativeProtocolRelease = { major: number; minor: number; label: string };\n\nfunction release(value: unknown): CreativeProtocolRelease | undefined {\n if (typeof value !== 'string') return undefined;\n const match = /^v?(\\d+)\\.(\\d+)(?:\\.|-|$)/.exec(value.trim());\n return match ? { major: Number(match[1]), minor: Number(match[2]), label: value } : undefined;\n}\n\nfunction mutuallyServedRelease(\n caps: Record<string, unknown> | undefined,\n raw: Record<string, unknown> | undefined,\n requestedVersion: string | undefined\n): CreativeProtocolRelease | undefined {\n const requested = release(requestedVersion);\n if (!requested) return undefined;\n const normalizedSupported = Array.isArray(caps?.supportedVersions) ? caps.supportedVersions : [];\n const directSupported = record(caps?.adcp)?.supported_versions;\n const rawSupported = record(raw?.adcp)?.supported_versions;\n const advertisedValues = [\n ...normalizedSupported,\n ...(Array.isArray(directSupported) ? directSupported : []),\n ...(Array.isArray(rawSupported) ? rawSupported : []),\n ];\n const advertised = advertisedValues.flatMap(value => {\n const parsed = release(value);\n return parsed ? [parsed] : [];\n });\n if (advertisedValues.length > 0 && advertised.length === 0) {\n throw new CreativeFormatCapabilityError(\n 'Seller advertised supported AdCP versions, but none were valid release identifiers'\n );\n }\n if (advertised.length === 0) {\n // A buyer pin is an upper bound, not evidence that the seller serves the\n // same release. Legacy 3.0 sellers commonly omit supported_versions; that\n // omission must not turn a 3.2 buyer pin into a false canonical guarantee.\n return requested.major < 3 || (requested.major === 3 && requested.minor === 0) ? requested : undefined;\n }\n const mutuallyServed = advertised\n .filter(\n candidate =>\n candidate.major === requested.major &&\n (candidate.minor < requested.minor || candidate.minor === requested.minor)\n )\n .sort((left, right) => right.minor - left.minor)[0];\n if (!mutuallyServed) {\n const supported = [...new Set(advertised.map(candidate => candidate.label))].join(', ');\n throw new CreativeFormatCapabilityError(\n `No mutually supported AdCP release: client requested ${requestedVersion}, seller advertised ${supported}`\n );\n }\n return mutuallyServed;\n}\n\nexport function resolveCreativeFormatWireMode(\n capabilities: unknown,\n negotiatedVersion?: string\n): CreativeFormatWireMode {\n const caps = record(capabilities);\n const raw = record(caps?._raw);\n const features = record(caps?.features);\n const mediaBuyFeatures = record(record(caps?.media_buy)?.features);\n const rawMediaBuyFeatures = record(record(raw?.media_buy)?.features);\n const declarations = [\n features?.canonicalCreatives,\n mediaBuyFeatures?.canonical_creatives,\n rawMediaBuyFeatures?.canonical_creatives,\n ].filter((value): value is boolean => typeof value === 'boolean');\n if (declarations.includes(true) && declarations.includes(false)) {\n throw new CreativeFormatCapabilityError(\n 'Seller capability response contains conflicting canonical_creatives declarations'\n );\n }\n const explicitCanonical = declarations[0];\n // `supported_versions` is the seller's wire-release contract. A newer\n // buyer can be downshifted within the same major, so a 3.2 client talking\n // to a 3.1-only seller must apply the 3.1 feature semantics rather than\n // assuming the 3.2 canonical guarantee. `build_version` is intentionally\n // absent here: the capability schema marks it advisory-only.\n const negotiated = mutuallyServedRelease(caps, raw, negotiatedVersion);\n if (caps?.version === 'v2') return 'legacy';\n if (negotiated && (negotiated.major > 3 || (negotiated.major === 3 && negotiated.minor >= 2))) {\n if (explicitCanonical === false) {\n throw new CreativeFormatCapabilityError(\n `AdCP ${negotiated.label} guarantees canonical creatives, but the seller advertised canonical_creatives: false`\n );\n }\n return 'canonical';\n }\n if (negotiated && (negotiated.major < 3 || (negotiated.major === 3 && negotiated.minor === 0))) {\n return 'legacy';\n }\n if (!caps) return 'unknown';\n if (explicitCanonical === true) return 'canonical';\n if (explicitCanonical === false) return 'legacy';\n return 'unknown';\n}\n"],"mappings":"AAuBA,SAAS,sBAAsB,kCAAkC;AAEjE,SAAS,sCAAsC,wCAAwC;AAGvF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoHA,SAAS,4BAA+B,OAAwC;AACrF,QAAM,eAAe,oBAAI,IAAY;AACrC,QAAM,kBAAkB,oBAAI,IAAY;AACxC,QAAM,iBAAiB,oBAAI,IAAY;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,sBAAsB,CAAC,QAC3B,QAAQ,cAAc,0CAA0C,KAAK,GAAG;AAC1E,QAAM,eAAe,CAAC,OAAgC,QAAyB;AAC7E,UAAM,aAAa,OAAO,yBAAyB,OAAO,GAAG;AAC7D,WAAO,cAAc,WAAW,aAAa,WAAW,QAAQ;AAAA,EAClE;AACA,QAAM,0BAA0B,CAAC,QAC/B,OAAO,QAAQ,YACf,CAAC,uCAAuC,KAAK,GAAG,KAChD,iDAAiD,KAAK,GAAG;AAC3D,QAAM,2BAA2B,CAAC,OAAgC,QAChE,aAAa,OAAO,QAAQ,MAAM,WAAW,OAAO,QAAQ,YAAY,wBAAwB,KAAK,GAAG;AAC1G,QAAM,yBAAyB,CAAC,OAAgC,QAC9D,OAAO,aAAa,OAAO,SAAS,MAAM,YAC1C,OAAO,QAAQ,YACf,uDAAuD,KAAK,GAAG;AACjE,QAAM,gCAAgC,CAAC,QACrC,wBAAwB,GAAG,KAC1B,OAAO,QAAQ,YAAY,mEAAmE,KAAK,GAAG;AACzG,QAAM,wBAAwB,CAAC,OAAgC,aAA+B;AAC5F,QACE,wBAAwB,QAAQ,KAChC,y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":["value","result","needsSafeToJSON","changed","safe","next"]}
@@ -28,17 +28,19 @@
28
28
  * `findCatalogEntryByCanonicalAndSize`, registry exports) for
29
29
  * callers wiring projection into their own code paths.
30
30
  *
31
- * Exposed from both `@adcp/sdk/v2/projection` and the package root for
32
- * adopters migrating from local format metadata and `product_card.format_id`
33
- * conventions to canonical creative formats.
31
+ * Legacy-preserving and raw wire projection helpers are exposed only from
32
+ * `@adcp/sdk/v2/projection`. The package root exports the canonical authoring
33
+ * surface so ordinary buyers do not accidentally retain legacy identities.
34
34
  */
35
35
  export { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalFormatKind } from './v1-to-v2.mjs';
36
- export type { V1ToV2Result, BareFormatIdResolveOptions } from './v1-to-v2.mjs';
36
+ export type { V1ToV2Result, V1ToV2ProjectionOptions, BareFormatIdResolveOptions, LegacyFormatConversionContext, LegacyFormatConverter, } from './v1-to-v2.mjs';
37
37
  export { projectV2ProductToV1 } from './v2-to-v1.mjs';
38
- export type { V2ToV1Result } from './v2-to-v1.mjs';
38
+ export type { V2ToV1Result, V2ToV1ProjectionOptions, CanonicalFormatLegacyResolver, CanonicalFormatLegacyResolutionContext, CanonicalProductFormatLegacyResolutionContext, CanonicalCreativeFormatLegacyResolutionContext, CanonicalSelectorFormatLegacyResolutionContext, } from './v2-to-v1.mjs';
39
39
  export { augmentProductWithFormatOptions, withFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, type V2AugmentedProduct, type CanonicalOnlyProduct, } from './augment-response.mjs';
40
- export { CanonicalFormat, audioDaastFormatDeclaration, audioHostedFormatDeclaration, agentPlacementFormatDeclaration, canonicalFormatDeclaration, customFormatDeclaration, displayTagFormatDeclaration, formatRef, formatRefs, html5FormatDeclaration, imageCarouselFormatDeclaration, imageFormatDeclaration, nativeInFeedFormatDeclaration, productCard, productCardDetailed, responsiveCreativeFormatDeclaration, sponsoredPlacementFormatDeclaration, videoHostedFormatDeclaration, videoVastFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type FormatReferenceInput, type ProductCardDetailedFields, type ProductCardFields, } from './builders.mjs';
40
+ export { CanonicalFormat, audioDaastFormatDeclaration, audioHostedFormatDeclaration, agentPlacementFormatDeclaration, canonicalFormatDeclaration, customFormatDeclaration, displayTagFormatDeclaration, legacyFormatRef, legacyFormatRefs, html5FormatDeclaration, imageCarouselFormatDeclaration, imageFormatDeclaration, nativeInFeedFormatDeclaration, productCard, productCardDetailed, responsiveCreativeFormatDeclaration, sponsoredPlacementFormatDeclaration, videoHostedFormatDeclaration, videoVastFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type FormatReferenceInput, type ProductCardDetailedFields, type ProductCardFields, } from './builders.mjs';
41
41
  export { packageRefsForFormatOptions, packageRefsForCapabilities, legacyFormatIdsFromOptions, tryLegacyFormatIdsFromOptions, legacyFormatIdsForFormatOption, legacyFormatIdsForCapability, FormatOptionRefsLookupError, CapabilityIdsLookupError, type PackageFormatRefs, type PackageCapabilityRefs, type FormatOptionRef, type FormatOptionSelector, type FormatOptionRefsLookupErrorCode, type CapabilityIdsLookupErrorCode, } from './write-side.mjs';
42
42
  export type { V1FormatId, V2ProductFormatDeclaration, V2Product, V1Product, ProjectionDiagnostic } from './types.mjs';
43
+ export { legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, } from './catalog-snapshot.mjs';
43
44
  export { loadCatalog, lookupV1Format, findCatalogEntryByCanonicalAndSize, parseSizedIdTemplate, _resetCatalogCache, type V1FormatDefinition, type CanonicalProjectionRef, } from './catalog.mjs';
44
45
  export { isCanonicalV1Translatable } from './canonical-properties.mjs';
46
+ export { CreativeFormatProjectionError, CreativeFormatCapabilityError, projectCreativeForDelivery, projectMediaBuyCreativesForDelivery, projectSyncCreativesForDelivery, stripLegacyCreativeIdentity, resolveCreativeFormatWireMode, type CreativeFormatSelectorContainer, type CanonicalCreativeFormatSelectorContainer, type CreativeFormatWireMode, type CanonicalCreativeAsset, type CanonicalCreativeResponse, type CanonicalGetProductsResponse, type CanonicalGetProductsRequest, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreativeFilters, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageUpdate, type CanonicalPackage, type CanonicalPlacement, type CanonicalProduct, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type LegacyCreativeAsset, type LegacyProjectedCreative, type ProjectedMediaBuyCreativeRequest, type ProjectedSyncCreativeRequest, type SyncCreativeFormatProjection, } from './creative-delivery.mjs';
@@ -28,18 +28,20 @@
28
28
  * `findCatalogEntryByCanonicalAndSize`, registry exports) for
29
29
  * callers wiring projection into their own code paths.
30
30
  *
31
- * Exposed from both `@adcp/sdk/v2/projection` and the package root for
32
- * adopters migrating from local format metadata and `product_card.format_id`
33
- * conventions to canonical creative formats.
31
+ * Legacy-preserving and raw wire projection helpers are exposed only from
32
+ * `@adcp/sdk/v2/projection`. The package root exports the canonical authoring
33
+ * surface so ordinary buyers do not accidentally retain legacy identities.
34
34
  */
35
35
  export { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalFormatKind } from './v1-to-v2';
36
- export type { V1ToV2Result, BareFormatIdResolveOptions } from './v1-to-v2';
36
+ export type { V1ToV2Result, V1ToV2ProjectionOptions, BareFormatIdResolveOptions, LegacyFormatConversionContext, LegacyFormatConverter, } from './v1-to-v2';
37
37
  export { projectV2ProductToV1 } from './v2-to-v1';
38
- export type { V2ToV1Result } from './v2-to-v1';
38
+ export type { V2ToV1Result, V2ToV1ProjectionOptions, CanonicalFormatLegacyResolver, CanonicalFormatLegacyResolutionContext, CanonicalProductFormatLegacyResolutionContext, CanonicalCreativeFormatLegacyResolutionContext, CanonicalSelectorFormatLegacyResolutionContext, } from './v2-to-v1';
39
39
  export { augmentProductWithFormatOptions, withFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, type V2AugmentedProduct, type CanonicalOnlyProduct, } from './augment-response';
40
- export { CanonicalFormat, audioDaastFormatDeclaration, audioHostedFormatDeclaration, agentPlacementFormatDeclaration, canonicalFormatDeclaration, customFormatDeclaration, displayTagFormatDeclaration, formatRef, formatRefs, html5FormatDeclaration, imageCarouselFormatDeclaration, imageFormatDeclaration, nativeInFeedFormatDeclaration, productCard, productCardDetailed, responsiveCreativeFormatDeclaration, sponsoredPlacementFormatDeclaration, videoHostedFormatDeclaration, videoVastFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type FormatReferenceInput, type ProductCardDetailedFields, type ProductCardFields, } from './builders';
40
+ export { CanonicalFormat, audioDaastFormatDeclaration, audioHostedFormatDeclaration, agentPlacementFormatDeclaration, canonicalFormatDeclaration, customFormatDeclaration, displayTagFormatDeclaration, legacyFormatRef, legacyFormatRefs, html5FormatDeclaration, imageCarouselFormatDeclaration, imageFormatDeclaration, nativeInFeedFormatDeclaration, productCard, productCardDetailed, responsiveCreativeFormatDeclaration, sponsoredPlacementFormatDeclaration, videoHostedFormatDeclaration, videoVastFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type FormatReferenceInput, type ProductCardDetailedFields, type ProductCardFields, } from './builders';
41
41
  export { packageRefsForFormatOptions, packageRefsForCapabilities, legacyFormatIdsFromOptions, tryLegacyFormatIdsFromOptions, legacyFormatIdsForFormatOption, legacyFormatIdsForCapability, FormatOptionRefsLookupError, CapabilityIdsLookupError, type PackageFormatRefs, type PackageCapabilityRefs, type FormatOptionRef, type FormatOptionSelector, type FormatOptionRefsLookupErrorCode, type CapabilityIdsLookupErrorCode, } from './write-side';
42
42
  export type { V1FormatId, V2ProductFormatDeclaration, V2Product, V1Product, ProjectionDiagnostic } from './types';
43
+ export { legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, } from './catalog-snapshot';
43
44
  export { loadCatalog, lookupV1Format, findCatalogEntryByCanonicalAndSize, parseSizedIdTemplate, _resetCatalogCache, type V1FormatDefinition, type CanonicalProjectionRef, } from './catalog';
44
45
  export { isCanonicalV1Translatable } from './canonical-properties';
46
+ export { CreativeFormatProjectionError, CreativeFormatCapabilityError, projectCreativeForDelivery, projectMediaBuyCreativesForDelivery, projectSyncCreativesForDelivery, stripLegacyCreativeIdentity, resolveCreativeFormatWireMode, type CreativeFormatSelectorContainer, type CanonicalCreativeFormatSelectorContainer, type CreativeFormatWireMode, type CanonicalCreativeAsset, type CanonicalCreativeResponse, type CanonicalGetProductsResponse, type CanonicalGetProductsRequest, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreativeFilters, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageUpdate, type CanonicalPackage, type CanonicalPlacement, type CanonicalProduct, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type LegacyCreativeAsset, type LegacyProjectedCreative, type ProjectedMediaBuyCreativeRequest, type ProjectedSyncCreativeRequest, type SyncCreativeFormatProjection, } from './creative-delivery';
45
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/projection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAC9G,YAAY,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACL,+BAA+B,EAC/B,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,eAAe,EACf,2BAA2B,EAC3B,4BAA4B,EAC5B,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,EACvB,2BAA2B,EAC3B,SAAS,EACT,UAAU,EACV,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,6BAA6B,EAC7B,WAAW,EACX,mBAAmB,EACnB,mCAAmC,EACnC,mCAAmC,EACnC,4BAA4B,EAC5B,0BAA0B,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,EAC9B,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,oB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2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EACzC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,GAClC,MAAM,qBAAqB,CAAC"}
@@ -20,6 +20,8 @@ var projection_exports = {};
20
20
  __export(projection_exports, {
21
21
  CanonicalFormat: () => import_builders.CanonicalFormat,
22
22
  CapabilityIdsLookupError: () => import_write_side.CapabilityIdsLookupError,
23
+ CreativeFormatCapabilityError: () => import_creative_delivery.CreativeFormatCapabilityError,
24
+ CreativeFormatProjectionError: () => import_creative_delivery.CreativeFormatProjectionError,
23
25
  FormatOptionRefsLookupError: () => import_write_side.FormatOptionRefsLookupError,
24
26
  _resetCatalogCache: () => import_catalog._resetCatalogCache,
25
27
  agentPlacementFormatDeclaration: () => import_builders.agentPlacementFormatDeclaration,
@@ -28,18 +30,20 @@ __export(projection_exports, {
28
30
  augmentProductWithFormatOptions: () => import_augment_response.augmentProductWithFormatOptions,
29
31
  canonicalDeclarationFromBareId: () => import_v1_to_v2.canonicalDeclarationFromBareId,
30
32
  canonicalFormatDeclaration: () => import_builders.canonicalFormatDeclaration,
33
+ canonicalFormatLegacyResolverFromCatalogSnapshots: () => import_catalog_snapshot.canonicalFormatLegacyResolverFromCatalogSnapshots,
31
34
  customFormatDeclaration: () => import_builders.customFormatDeclaration,
32
35
  displayTagFormatDeclaration: () => import_builders.displayTagFormatDeclaration,
33
36
  findCatalogEntryByCanonicalAndSize: () => import_catalog.findCatalogEntryByCanonicalAndSize,
34
- formatRef: () => import_builders.formatRef,
35
- formatRefs: () => import_builders.formatRefs,
36
37
  html5FormatDeclaration: () => import_builders.html5FormatDeclaration,
37
38
  imageCarouselFormatDeclaration: () => import_builders.imageCarouselFormatDeclaration,
38
39
  imageFormatDeclaration: () => import_builders.imageFormatDeclaration,
39
40
  isCanonicalV1Translatable: () => import_canonical_properties.isCanonicalV1Translatable,
41
+ legacyFormatConverterFromCatalogSnapshots: () => import_catalog_snapshot.legacyFormatConverterFromCatalogSnapshots,
40
42
  legacyFormatIdsForCapability: () => import_write_side.legacyFormatIdsForCapability,
41
43
  legacyFormatIdsForFormatOption: () => import_write_side.legacyFormatIdsForFormatOption,
42
44
  legacyFormatIdsFromOptions: () => import_write_side.legacyFormatIdsFromOptions,
45
+ legacyFormatRef: () => import_builders.legacyFormatRef,
46
+ legacyFormatRefs: () => import_builders.legacyFormatRefs,
43
47
  loadCatalog: () => import_catalog.loadCatalog,
44
48
  lookupV1Format: () => import_catalog.lookupV1Format,
45
49
  nativeInFeedFormatDeclaration: () => import_builders.nativeInFeedFormatDeclaration,
@@ -48,11 +52,17 @@ __export(projection_exports, {
48
52
  parseSizedIdTemplate: () => import_catalog.parseSizedIdTemplate,
49
53
  productCard: () => import_builders.productCard,
50
54
  productCardDetailed: () => import_builders.productCardDetailed,
55
+ projectCreativeForDelivery: () => import_creative_delivery.projectCreativeForDelivery,
56
+ projectMediaBuyCreativesForDelivery: () => import_creative_delivery.projectMediaBuyCreativesForDelivery,
57
+ projectSyncCreativesForDelivery: () => import_creative_delivery.projectSyncCreativesForDelivery,
51
58
  projectV1ProductToV2: () => import_v1_to_v2.projectV1ProductToV2,
52
59
  projectV2ProductToV1: () => import_v2_to_v1.projectV2ProductToV1,
60
+ projectionAdaptersFromCatalogSnapshots: () => import_catalog_snapshot.projectionAdaptersFromCatalogSnapshots,
53
61
  resolveCanonicalFormatKind: () => import_v1_to_v2.resolveCanonicalFormatKind,
62
+ resolveCreativeFormatWireMode: () => import_creative_delivery.resolveCreativeFormatWireMode,
54
63
  responsiveCreativeFormatDeclaration: () => import_builders.responsiveCreativeFormatDeclaration,
55
64
  sponsoredPlacementFormatDeclaration: () => import_builders.sponsoredPlacementFormatDeclaration,
65
+ stripLegacyCreativeIdentity: () => import_creative_delivery.stripLegacyCreativeIdentity,
56
66
  toCanonicalOnlyProduct: () => import_augment_response.toCanonicalOnlyProduct,
57
67
  toCanonicalOnlyResponse: () => import_augment_response.toCanonicalOnlyResponse,
58
68
  tryLegacyFormatIdsFromOptions: () => import_write_side.tryLegacyFormatIdsFromOptions,
@@ -66,12 +76,16 @@ var import_v2_to_v1 = require('./v2-to-v1.js');
66
76
  var import_augment_response = require('./augment-response.js');
67
77
  var import_builders = require('./builders.js');
68
78
  var import_write_side = require('./write-side.js');
79
+ var import_catalog_snapshot = require('./catalog-snapshot.js');
69
80
  var import_catalog = require('./catalog.js');
70
81
  var import_canonical_properties = require('./canonical-properties.js');
82
+ var import_creative_delivery = require('./creative-delivery.js');
71
83
  // Annotate the CommonJS export names for ESM import in node:
72
84
  0 && (module.exports = {
73
85
  CanonicalFormat,
74
86
  CapabilityIdsLookupError,
87
+ CreativeFormatCapabilityError,
88
+ CreativeFormatProjectionError,
75
89
  FormatOptionRefsLookupError,
76
90
  _resetCatalogCache,
77
91
  agentPlacementFormatDeclaration,
@@ -80,18 +94,20 @@ var import_canonical_properties = require('./canonical-properties.js');
80
94
  augmentProductWithFormatOptions,
81
95
  canonicalDeclarationFromBareId,
82
96
  canonicalFormatDeclaration,
97
+ canonicalFormatLegacyResolverFromCatalogSnapshots,
83
98
  customFormatDeclaration,
84
99
  displayTagFormatDeclaration,
85
100
  findCatalogEntryByCanonicalAndSize,
86
- formatRef,
87
- formatRefs,
88
101
  html5FormatDeclaration,
89
102
  imageCarouselFormatDeclaration,
90
103
  imageFormatDeclaration,
91
104
  isCanonicalV1Translatable,
105
+ legacyFormatConverterFromCatalogSnapshots,
92
106
  legacyFormatIdsForCapability,
93
107
  legacyFormatIdsForFormatOption,
94
108
  legacyFormatIdsFromOptions,
109
+ legacyFormatRef,
110
+ legacyFormatRefs,
95
111
  loadCatalog,
96
112
  lookupV1Format,
97
113
  nativeInFeedFormatDeclaration,
@@ -100,11 +116,17 @@ var import_canonical_properties = require('./canonical-properties.js');
100
116
  parseSizedIdTemplate,
101
117
  productCard,
102
118
  productCardDetailed,
119
+ projectCreativeForDelivery,
120
+ projectMediaBuyCreativesForDelivery,
121
+ projectSyncCreativesForDelivery,
103
122
  projectV1ProductToV2,
104
123
  projectV2ProductToV1,
124
+ projectionAdaptersFromCatalogSnapshots,
105
125
  resolveCanonicalFormatKind,
126
+ resolveCreativeFormatWireMode,
106
127
  responsiveCreativeFormatDeclaration,
107
128
  sponsoredPlacementFormatDeclaration,
129
+ stripLegacyCreativeIdentity,
108
130
  toCanonicalOnlyProduct,
109
131
  toCanonicalOnlyResponse,
110
132
  tryLegacyFormatIdsFromOptions,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/v2/projection/index.ts"],"sourcesContent":["/**\n * v1 ↔ v2 Product projection layer (AdCP 3.1).\n *\n * Public surfaces:\n *\n * - `projectV1ProductToV2` / `projectV2ProductToV1` — the symmetric\n * core projections. Read a Product on one side, return a Product\n * on the other plus structured diagnostics (`source: 'sdk'`,\n * normative spec codes + SDK-local codes).\n *\n * - `resolveCanonicalFormatKind` / `canonicalDeclarationFromBareId` —\n * resolve a single bare format-id string (no surrounding Product,\n * no `agent_url`) to its canonical `format_kind` or full declaration.\n * Registry- and catalog-backed; fails closed to `null`.\n *\n * - `withFormatOptions` / `augmentProductWithFormatOptions` —\n * buyer-side response augmentation. Adds `format_options[]` to a\n * v1-shaped get_products response so canonical-format-aware buyers\n * can read the canonical model regardless of the seller's wire\n * version. Additive — `format_ids[]` is preserved.\n *\n * - `toCanonicalOnlyProduct` / `toCanonicalOnlyResponse` — the\n * read-side narrowing for a fully-migrated consumer. Returns\n * `format_options[]` with `format_ids[]` dropped, surfacing a\n * diagnostic for any ref that couldn't be carried over.\n *\n * - Catalog + registry primitives (`lookupV1Format`,\n * `findCatalogEntryByCanonicalAndSize`, registry exports) for\n * callers wiring projection into their own code paths.\n *\n * Exposed from both `@adcp/sdk/v2/projection` and the package root for\n * adopters migrating from local format metadata and `product_card.format_id`\n * conventions to canonical creative formats.\n */\n\nexport { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalFormatKind } from './v1-to-v2';\nexport type { V1ToV2Result, BareFormatIdResolveOptions } from './v1-to-v2';\n\nexport { projectV2ProductToV1 } from './v2-to-v1';\nexport type { V2ToV1Result } from './v2-to-v1';\n\nexport {\n augmentProductWithFormatOptions,\n withFormatOptions,\n toCanonicalOnlyProduct,\n toCanonicalOnlyResponse,\n type V2AugmentedProduct,\n type CanonicalOnlyProduct,\n} from './augment-response';\n\nexport {\n CanonicalFormat,\n audioDaastFormatDeclaration,\n audioHostedFormatDeclaration,\n agentPlacementFormatDeclaration,\n canonicalFormatDeclaration,\n customFormatDeclaration,\n displayTagFormatDeclaration,\n formatRef,\n formatRefs,\n html5FormatDeclaration,\n imageCarouselFormatDeclaration,\n imageFormatDeclaration,\n nativeInFeedFormatDeclaration,\n productCard,\n productCardDetailed,\n responsiveCreativeFormatDeclaration,\n sponsoredPlacementFormatDeclaration,\n videoHostedFormatDeclaration,\n videoVastFormatDeclaration,\n type CanonicalFormatDeclaration,\n type CanonicalFormatDeclarationFields,\n type CanonicalFormatKind,\n type CanonicalFormatParams,\n type FormatReferenceInput,\n type ProductCardDetailedFields,\n type ProductCardFields,\n} from './builders';\n\nexport {\n packageRefsForFormatOptions,\n packageRefsForCapabilities,\n legacyFormatIdsFromOptions,\n tryLegacyFormatIdsFromOptions,\n legacyFormatIdsForFormatOption,\n legacyFormatIdsForCapability,\n FormatOptionRefsLookupError,\n CapabilityIdsLookupError,\n type PackageFormatRefs,\n type PackageCapabilityRefs,\n type FormatOptionRef,\n type FormatOptionSelector,\n type FormatOptionRefsLookupErrorCode,\n type CapabilityIdsLookupErrorCode,\n} from './write-side';\n\nexport type { V1FormatId, V2ProductFormatDeclaration, V2Product, V1Product, ProjectionDiagnostic } from './types';\n\nexport {\n loadCatalog,\n lookupV1Format,\n findCatalogEntryByCanonicalAndSize,\n parseSizedIdTemplate,\n _resetCatalogCache,\n type V1FormatDefinition,\n type CanonicalProjectionRef,\n} from './catalog';\n\nexport { isCanonicalV1Translatable } from './canonical-properties';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCA,sBAAiG;AAGjG,sBAAqC;AAGrC,8BAOO;AAEP,sBA2BO;AAEP,wBAeO;AAIP,qBAQO;AAEP,kCAA0C;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/index.ts"],"sourcesContent":["/**\n * v1 ↔ v2 Product projection layer (AdCP 3.1).\n *\n * Public surfaces:\n *\n * - `projectV1ProductToV2` / `projectV2ProductToV1` — the symmetric\n * core projections. Read a Product on one side, return a Product\n * on the other plus structured diagnostics (`source: 'sdk'`,\n * normative spec codes + SDK-local codes).\n *\n * - `resolveCanonicalFormatKind` / `canonicalDeclarationFromBareId` —\n * resolve a single bare format-id string (no surrounding Product,\n * no `agent_url`) to its canonical `format_kind` or full declaration.\n * Registry- and catalog-backed; fails closed to `null`.\n *\n * - `withFormatOptions` / `augmentProductWithFormatOptions` —\n * buyer-side response augmentation. Adds `format_options[]` to a\n * v1-shaped get_products response so canonical-format-aware buyers\n * can read the canonical model regardless of the seller's wire\n * version. Additive — `format_ids[]` is preserved.\n *\n * - `toCanonicalOnlyProduct` / `toCanonicalOnlyResponse` — the\n * read-side narrowing for a fully-migrated consumer. Returns\n * `format_options[]` with `format_ids[]` dropped, surfacing a\n * diagnostic for any ref that couldn't be carried over.\n *\n * - Catalog + registry primitives (`lookupV1Format`,\n * `findCatalogEntryByCanonicalAndSize`, registry exports) for\n * callers wiring projection into their own code paths.\n *\n * Legacy-preserving and raw wire projection helpers are exposed only from\n * `@adcp/sdk/v2/projection`. The package root exports the canonical authoring\n * surface so ordinary buyers do not accidentally retain legacy identities.\n */\n\nexport { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalFormatKind } from './v1-to-v2';\nexport type {\n V1ToV2Result,\n V1ToV2ProjectionOptions,\n BareFormatIdResolveOptions,\n LegacyFormatConversionContext,\n LegacyFormatConverter,\n} from './v1-to-v2';\n\nexport { projectV2ProductToV1 } from './v2-to-v1';\nexport type {\n V2ToV1Result,\n V2ToV1ProjectionOptions,\n CanonicalFormatLegacyResolver,\n CanonicalFormatLegacyResolutionContext,\n CanonicalProductFormatLegacyResolutionContext,\n CanonicalCreativeFormatLegacyResolutionContext,\n CanonicalSelectorFormatLegacyResolutionContext,\n} from './v2-to-v1';\n\nexport {\n augmentProductWithFormatOptions,\n withFormatOptions,\n toCanonicalOnlyProduct,\n toCanonicalOnlyResponse,\n type V2AugmentedProduct,\n type CanonicalOnlyProduct,\n} from './augment-response';\n\nexport {\n CanonicalFormat,\n audioDaastFormatDeclaration,\n audioHostedFormatDeclaration,\n agentPlacementFormatDeclaration,\n canonicalFormatDeclaration,\n customFormatDeclaration,\n displayTagFormatDeclaration,\n legacyFormatRef,\n legacyFormatRefs,\n html5FormatDeclaration,\n imageCarouselFormatDeclaration,\n imageFormatDeclaration,\n nativeInFeedFormatDeclaration,\n productCard,\n productCardDetailed,\n responsiveCreativeFormatDeclaration,\n sponsoredPlacementFormatDeclaration,\n videoHostedFormatDeclaration,\n videoVastFormatDeclaration,\n type CanonicalFormatDeclaration,\n type CanonicalFormatDeclarationFields,\n type CanonicalFormatKind,\n type CanonicalFormatParams,\n type FormatReferenceInput,\n type ProductCardDetailedFields,\n type ProductCardFields,\n} from './builders';\n\nexport {\n packageRefsForFormatOptions,\n packageRefsForCapabilities,\n legacyFormatIdsFromOptions,\n tryLegacyFormatIdsFromOptions,\n legacyFormatIdsForFormatOption,\n legacyFormatIdsForCapability,\n FormatOptionRefsLookupError,\n CapabilityIdsLookupError,\n type PackageFormatRefs,\n type PackageCapabilityRefs,\n type FormatOptionRef,\n type FormatOptionSelector,\n type FormatOptionRefsLookupErrorCode,\n type CapabilityIdsLookupErrorCode,\n} from './write-side';\n\nexport type { V1FormatId, V2ProductFormatDeclaration, V2Product, V1Product, ProjectionDiagnostic } from './types';\nexport {\n legacyFormatConverterFromCatalogSnapshots,\n canonicalFormatLegacyResolverFromCatalogSnapshots,\n projectionAdaptersFromCatalogSnapshots,\n type ProjectionCatalogAdapters,\n type ProjectionCatalogSnapshot,\n type ProjectionCatalogSource,\n} from './catalog-snapshot';\n\nexport {\n loadCatalog,\n lookupV1Format,\n findCatalogEntryByCanonicalAndSize,\n parseSizedIdTemplate,\n _resetCatalogCache,\n type V1FormatDefinition,\n type CanonicalProjectionRef,\n} from './catalog';\n\nexport { isCanonicalV1Translatable } from './canonical-properties';\n\nexport {\n CreativeFormatProjectionError,\n CreativeFormatCapabilityError,\n projectCreativeForDelivery,\n projectMediaBuyCreativesForDelivery,\n projectSyncCreativesForDelivery,\n stripLegacyCreativeIdentity,\n resolveCreativeFormatWireMode,\n type CreativeFormatSelectorContainer,\n type CanonicalCreativeFormatSelectorContainer,\n type CreativeFormatWireMode,\n type CanonicalCreativeAsset,\n type CanonicalCreativeResponse,\n type CanonicalGetProductsResponse,\n type CanonicalGetProductsRequest,\n type CanonicalCreateMediaBuyRequest,\n type CanonicalCreateMediaBuyResponse,\n type CanonicalCreativeFilters,\n type CanonicalListCreativesRequest,\n type CanonicalListCreativesResponse,\n type CanonicalGetCreativeDeliveryResponse,\n type CanonicalGetMediaBuyDeliveryResponse,\n type CanonicalGetMediaBuysResponse,\n type CanonicalListedCreative,\n type CanonicalPackageRequest,\n type CanonicalPackageUpdate,\n type CanonicalPackage,\n type CanonicalPlacement,\n type CanonicalProduct,\n type CanonicalProjectedCreative,\n type CanonicalSyncCreativesRequest,\n type CanonicalSyncCreativesResponse,\n type CanonicalUpdateMediaBuyRequest,\n type CanonicalUpdateMediaBuyResponse,\n type LegacyCreativeAsset,\n type LegacyProjectedCreative,\n type ProjectedMediaBuyCreativeRequest,\n type ProjectedSyncCreativeRequest,\n type SyncCreativeFormatProjection,\n} from './creative-delivery';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCA,sBAAiG;AASjG,sBAAqC;AAWrC,8BAOO;AAEP,sBA2BO;AAEP,wBAeO;AAGP,8BAOO;AAEP,qBAQO;AAEP,kCAA0C;AAE1C,+BAuCO;","names":[]}
@@ -14,8 +14,8 @@ import {
14
14
  canonicalFormatDeclaration,
15
15
  customFormatDeclaration,
16
16
  displayTagFormatDeclaration,
17
- formatRef,
18
- formatRefs,
17
+ legacyFormatRef,
18
+ legacyFormatRefs,
19
19
  html5FormatDeclaration,
20
20
  imageCarouselFormatDeclaration,
21
21
  imageFormatDeclaration,
@@ -37,6 +37,11 @@ import {
37
37
  FormatOptionRefsLookupError,
38
38
  CapabilityIdsLookupError
39
39
  } from "./write-side.mjs";
40
+ import {
41
+ legacyFormatConverterFromCatalogSnapshots,
42
+ canonicalFormatLegacyResolverFromCatalogSnapshots,
43
+ projectionAdaptersFromCatalogSnapshots
44
+ } from "./catalog-snapshot.mjs";
40
45
  import {
41
46
  loadCatalog,
42
47
  lookupV1Format,
@@ -45,9 +50,20 @@ import {
45
50
  _resetCatalogCache
46
51
  } from "./catalog.mjs";
47
52
  import { isCanonicalV1Translatable } from "./canonical-properties.mjs";
53
+ import {
54
+ CreativeFormatProjectionError,
55
+ CreativeFormatCapabilityError,
56
+ projectCreativeForDelivery,
57
+ projectMediaBuyCreativesForDelivery,
58
+ projectSyncCreativesForDelivery,
59
+ stripLegacyCreativeIdentity,
60
+ resolveCreativeFormatWireMode
61
+ } from "./creative-delivery.mjs";
48
62
  export {
49
63
  CanonicalFormat,
50
64
  CapabilityIdsLookupError,
65
+ CreativeFormatCapabilityError,
66
+ CreativeFormatProjectionError,
51
67
  FormatOptionRefsLookupError,
52
68
  _resetCatalogCache,
53
69
  agentPlacementFormatDeclaration,
@@ -56,18 +72,20 @@ export {
56
72
  augmentProductWithFormatOptions,
57
73
  canonicalDeclarationFromBareId,
58
74
  canonicalFormatDeclaration,
75
+ canonicalFormatLegacyResolverFromCatalogSnapshots,
59
76
  customFormatDeclaration,
60
77
  displayTagFormatDeclaration,
61
78
  findCatalogEntryByCanonicalAndSize,
62
- formatRef,
63
- formatRefs,
64
79
  html5FormatDeclaration,
65
80
  imageCarouselFormatDeclaration,
66
81
  imageFormatDeclaration,
67
82
  isCanonicalV1Translatable,
83
+ legacyFormatConverterFromCatalogSnapshots,
68
84
  legacyFormatIdsForCapability,
69
85
  legacyFormatIdsForFormatOption,
70
86
  legacyFormatIdsFromOptions,
87
+ legacyFormatRef,
88
+ legacyFormatRefs,
71
89
  loadCatalog,
72
90
  lookupV1Format,
73
91
  nativeInFeedFormatDeclaration,
@@ -76,11 +94,17 @@ export {
76
94
  parseSizedIdTemplate,
77
95
  productCard,
78
96
  productCardDetailed,
97
+ projectCreativeForDelivery,
98
+ projectMediaBuyCreativesForDelivery,
99
+ projectSyncCreativesForDelivery,
79
100
  projectV1ProductToV2,
80
101
  projectV2ProductToV1,
102
+ projectionAdaptersFromCatalogSnapshots,
81
103
  resolveCanonicalFormatKind,
104
+ resolveCreativeFormatWireMode,
82
105
  responsiveCreativeFormatDeclaration,
83
106
  sponsoredPlacementFormatDeclaration,
107
+ stripLegacyCreativeIdentity,
84
108
  toCanonicalOnlyProduct,
85
109
  toCanonicalOnlyResponse,
86
110
  tryLegacyFormatIdsFromOptions,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/v2/projection/index.ts"],"sourcesContent":["/**\n * v1 ↔ v2 Product projection layer (AdCP 3.1).\n *\n * Public surfaces:\n *\n * - `projectV1ProductToV2` / `projectV2ProductToV1` — the symmetric\n * core projections. Read a Product on one side, return a Product\n * on the other plus structured diagnostics (`source: 'sdk'`,\n * normative spec codes + SDK-local codes).\n *\n * - `resolveCanonicalFormatKind` / `canonicalDeclarationFromBareId` —\n * resolve a single bare format-id string (no surrounding Product,\n * no `agent_url`) to its canonical `format_kind` or full declaration.\n * Registry- and catalog-backed; fails closed to `null`.\n *\n * - `withFormatOptions` / `augmentProductWithFormatOptions` —\n * buyer-side response augmentation. Adds `format_options[]` to a\n * v1-shaped get_products response so canonical-format-aware buyers\n * can read the canonical model regardless of the seller's wire\n * version. Additive — `format_ids[]` is preserved.\n *\n * - `toCanonicalOnlyProduct` / `toCanonicalOnlyResponse` — the\n * read-side narrowing for a fully-migrated consumer. Returns\n * `format_options[]` with `format_ids[]` dropped, surfacing a\n * diagnostic for any ref that couldn't be carried over.\n *\n * - Catalog + registry primitives (`lookupV1Format`,\n * `findCatalogEntryByCanonicalAndSize`, registry exports) for\n * callers wiring projection into their own code paths.\n *\n * Exposed from both `@adcp/sdk/v2/projection` and the package root for\n * adopters migrating from local format metadata and `product_card.format_id`\n * conventions to canonical creative formats.\n */\n\nexport { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalFormatKind } from './v1-to-v2';\nexport type { V1ToV2Result, BareFormatIdResolveOptions } from './v1-to-v2';\n\nexport { projectV2ProductToV1 } from './v2-to-v1';\nexport type { V2ToV1Result } from './v2-to-v1';\n\nexport {\n augmentProductWithFormatOptions,\n withFormatOptions,\n toCanonicalOnlyProduct,\n toCanonicalOnlyResponse,\n type V2AugmentedProduct,\n type CanonicalOnlyProduct,\n} from './augment-response';\n\nexport {\n CanonicalFormat,\n audioDaastFormatDeclaration,\n audioHostedFormatDeclaration,\n agentPlacementFormatDeclaration,\n canonicalFormatDeclaration,\n customFormatDeclaration,\n displayTagFormatDeclaration,\n formatRef,\n formatRefs,\n html5FormatDeclaration,\n imageCarouselFormatDeclaration,\n imageFormatDeclaration,\n nativeInFeedFormatDeclaration,\n productCard,\n productCardDetailed,\n responsiveCreativeFormatDeclaration,\n sponsoredPlacementFormatDeclaration,\n videoHostedFormatDeclaration,\n videoVastFormatDeclaration,\n type CanonicalFormatDeclaration,\n type CanonicalFormatDeclarationFields,\n type CanonicalFormatKind,\n type CanonicalFormatParams,\n type FormatReferenceInput,\n type ProductCardDetailedFields,\n type ProductCardFields,\n} from './builders';\n\nexport {\n packageRefsForFormatOptions,\n packageRefsForCapabilities,\n legacyFormatIdsFromOptions,\n tryLegacyFormatIdsFromOptions,\n legacyFormatIdsForFormatOption,\n legacyFormatIdsForCapability,\n FormatOptionRefsLookupError,\n CapabilityIdsLookupError,\n type PackageFormatRefs,\n type PackageCapabilityRefs,\n type FormatOptionRef,\n type FormatOptionSelector,\n type FormatOptionRefsLookupErrorCode,\n type CapabilityIdsLookupErrorCode,\n} from './write-side';\n\nexport type { V1FormatId, V2ProductFormatDeclaration, V2Product, V1Product, ProjectionDiagnostic } from './types';\n\nexport {\n loadCatalog,\n lookupV1Format,\n findCatalogEntryByCanonicalAndSize,\n parseSizedIdTemplate,\n _resetCatalogCache,\n type V1FormatDefinition,\n type CanonicalProjectionRef,\n} from './catalog';\n\nexport { isCanonicalV1Translatable } from './canonical-properties';\n"],"mappings":"AAmCA,SAAS,sBAAsB,gCAAgC,kCAAkC;AAGjG,SAAS,4BAA4B;AAGrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AAIP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,iCAAiC;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/index.ts"],"sourcesContent":["/**\n * v1 ↔ v2 Product projection layer (AdCP 3.1).\n *\n * Public surfaces:\n *\n * - `projectV1ProductToV2` / `projectV2ProductToV1` — the symmetric\n * core projections. Read a Product on one side, return a Product\n * on the other plus structured diagnostics (`source: 'sdk'`,\n * normative spec codes + SDK-local codes).\n *\n * - `resolveCanonicalFormatKind` / `canonicalDeclarationFromBareId` —\n * resolve a single bare format-id string (no surrounding Product,\n * no `agent_url`) to its canonical `format_kind` or full declaration.\n * Registry- and catalog-backed; fails closed to `null`.\n *\n * - `withFormatOptions` / `augmentProductWithFormatOptions` —\n * buyer-side response augmentation. Adds `format_options[]` to a\n * v1-shaped get_products response so canonical-format-aware buyers\n * can read the canonical model regardless of the seller's wire\n * version. Additive — `format_ids[]` is preserved.\n *\n * - `toCanonicalOnlyProduct` / `toCanonicalOnlyResponse` — the\n * read-side narrowing for a fully-migrated consumer. Returns\n * `format_options[]` with `format_ids[]` dropped, surfacing a\n * diagnostic for any ref that couldn't be carried over.\n *\n * - Catalog + registry primitives (`lookupV1Format`,\n * `findCatalogEntryByCanonicalAndSize`, registry exports) for\n * callers wiring projection into their own code paths.\n *\n * Legacy-preserving and raw wire projection helpers are exposed only from\n * `@adcp/sdk/v2/projection`. The package root exports the canonical authoring\n * surface so ordinary buyers do not accidentally retain legacy identities.\n */\n\nexport { projectV1ProductToV2, canonicalDeclarationFromBareId, resolveCanonicalFormatKind } from './v1-to-v2';\nexport type {\n V1ToV2Result,\n V1ToV2ProjectionOptions,\n BareFormatIdResolveOptions,\n LegacyFormatConversionContext,\n LegacyFormatConverter,\n} from './v1-to-v2';\n\nexport { projectV2ProductToV1 } from './v2-to-v1';\nexport type {\n V2ToV1Result,\n V2ToV1ProjectionOptions,\n CanonicalFormatLegacyResolver,\n CanonicalFormatLegacyResolutionContext,\n CanonicalProductFormatLegacyResolutionContext,\n CanonicalCreativeFormatLegacyResolutionContext,\n CanonicalSelectorFormatLegacyResolutionContext,\n} from './v2-to-v1';\n\nexport {\n augmentProductWithFormatOptions,\n withFormatOptions,\n toCanonicalOnlyProduct,\n toCanonicalOnlyResponse,\n type V2AugmentedProduct,\n type CanonicalOnlyProduct,\n} from './augment-response';\n\nexport {\n CanonicalFormat,\n audioDaastFormatDeclaration,\n audioHostedFormatDeclaration,\n agentPlacementFormatDeclaration,\n canonicalFormatDeclaration,\n customFormatDeclaration,\n displayTagFormatDeclaration,\n legacyFormatRef,\n legacyFormatRefs,\n html5FormatDeclaration,\n imageCarouselFormatDeclaration,\n imageFormatDeclaration,\n nativeInFeedFormatDeclaration,\n productCard,\n productCardDetailed,\n responsiveCreativeFormatDeclaration,\n sponsoredPlacementFormatDeclaration,\n videoHostedFormatDeclaration,\n videoVastFormatDeclaration,\n type CanonicalFormatDeclaration,\n type CanonicalFormatDeclarationFields,\n type CanonicalFormatKind,\n type CanonicalFormatParams,\n type FormatReferenceInput,\n type ProductCardDetailedFields,\n type ProductCardFields,\n} from './builders';\n\nexport {\n packageRefsForFormatOptions,\n packageRefsForCapabilities,\n legacyFormatIdsFromOptions,\n tryLegacyFormatIdsFromOptions,\n legacyFormatIdsForFormatOption,\n legacyFormatIdsForCapability,\n FormatOptionRefsLookupError,\n CapabilityIdsLookupError,\n type PackageFormatRefs,\n type PackageCapabilityRefs,\n type FormatOptionRef,\n type FormatOptionSelector,\n type FormatOptionRefsLookupErrorCode,\n type CapabilityIdsLookupErrorCode,\n} from './write-side';\n\nexport type { V1FormatId, V2ProductFormatDeclaration, V2Product, V1Product, ProjectionDiagnostic } from './types';\nexport {\n legacyFormatConverterFromCatalogSnapshots,\n canonicalFormatLegacyResolverFromCatalogSnapshots,\n projectionAdaptersFromCatalogSnapshots,\n type ProjectionCatalogAdapters,\n type ProjectionCatalogSnapshot,\n type ProjectionCatalogSource,\n} from './catalog-snapshot';\n\nexport {\n loadCatalog,\n lookupV1Format,\n findCatalogEntryByCanonicalAndSize,\n parseSizedIdTemplate,\n _resetCatalogCache,\n type V1FormatDefinition,\n type CanonicalProjectionRef,\n} from './catalog';\n\nexport { isCanonicalV1Translatable } from './canonical-properties';\n\nexport {\n CreativeFormatProjectionError,\n CreativeFormatCapabilityError,\n projectCreativeForDelivery,\n projectMediaBuyCreativesForDelivery,\n projectSyncCreativesForDelivery,\n stripLegacyCreativeIdentity,\n resolveCreativeFormatWireMode,\n type CreativeFormatSelectorContainer,\n type CanonicalCreativeFormatSelectorContainer,\n type CreativeFormatWireMode,\n type CanonicalCreativeAsset,\n type CanonicalCreativeResponse,\n type CanonicalGetProductsResponse,\n type CanonicalGetProductsRequest,\n type CanonicalCreateMediaBuyRequest,\n type CanonicalCreateMediaBuyResponse,\n type CanonicalCreativeFilters,\n type CanonicalListCreativesRequest,\n type CanonicalListCreativesResponse,\n type CanonicalGetCreativeDeliveryResponse,\n type CanonicalGetMediaBuyDeliveryResponse,\n type CanonicalGetMediaBuysResponse,\n type CanonicalListedCreative,\n type CanonicalPackageRequest,\n type CanonicalPackageUpdate,\n type CanonicalPackage,\n type CanonicalPlacement,\n type CanonicalProduct,\n type CanonicalProjectedCreative,\n type CanonicalSyncCreativesRequest,\n type CanonicalSyncCreativesResponse,\n type CanonicalUpdateMediaBuyRequest,\n type CanonicalUpdateMediaBuyResponse,\n type LegacyCreativeAsset,\n type LegacyProjectedCreative,\n type ProjectedMediaBuyCreativeRequest,\n type ProjectedSyncCreativeRequest,\n type SyncCreativeFormatProjection,\n} from './creative-delivery';\n"],"mappings":"AAmCA,SAAS,sBAAsB,gCAAgC,kCAAkC;AASjG,SAAS,4BAA4B;AAWrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,iCAAiC;AAE1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAgCK;","names":[]}
@@ -0,0 +1,21 @@
1
+ import type { ProductFormatDeclaration } from '../../types/tools.generated.mjs';
2
+ import type { V1FormatId, V2ProductFormatDeclaration } from './types.mjs';
3
+ /**
4
+ * SDK-private downgrade metadata held out-of-band. WeakMaps keep legacy
5
+ * routing identifiers absent from canonical objects even under reflective
6
+ * inspection while still allowing object-spread package authoring.
7
+ */
8
+ export type CanonicalFormatDeclaration = Omit<V2ProductFormatDeclaration, 'v1_format_ref'> & {
9
+ v1_format_ref?: never;
10
+ };
11
+ type DeclarationWithMetadata = CanonicalFormatDeclaration;
12
+ export type PackageSelectionMetadata = {
13
+ format_option_refs?: readonly unknown[];
14
+ };
15
+ export declare function concealLegacyFormatRefs(declaration: ProductFormatDeclaration | V2ProductFormatDeclaration | CanonicalFormatDeclaration): DeclarationWithMetadata;
16
+ export declare function legacyFormatRefsForDeclaration(value: unknown): readonly V1FormatId[];
17
+ export declare function selectedFormatOptions(value: unknown): readonly DeclarationWithMetadata[];
18
+ export declare function concealSelectedFormatOptions(refs: readonly unknown[], declarations: readonly DeclarationWithMetadata[]): void;
19
+ /** Preserve out-of-band downgrade metadata when a canonical sanitizer clones a value. */
20
+ export declare function transferLegacyCreativeMetadata(source: object, target: object): void;
21
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ProductFormatDeclaration } from '../../types/tools.generated';
2
+ import type { V1FormatId, V2ProductFormatDeclaration } from './types';
3
+ /**
4
+ * SDK-private downgrade metadata held out-of-band. WeakMaps keep legacy
5
+ * routing identifiers absent from canonical objects even under reflective
6
+ * inspection while still allowing object-spread package authoring.
7
+ */
8
+ export type CanonicalFormatDeclaration = Omit<V2ProductFormatDeclaration, 'v1_format_ref'> & {
9
+ v1_format_ref?: never;
10
+ };
11
+ type DeclarationWithMetadata = CanonicalFormatDeclaration;
12
+ export type PackageSelectionMetadata = {
13
+ format_option_refs?: readonly unknown[];
14
+ };
15
+ export declare function concealLegacyFormatRefs(declaration: ProductFormatDeclaration | V2ProductFormatDeclaration | CanonicalFormatDeclaration): DeclarationWithMetadata;
16
+ export declare function legacyFormatRefsForDeclaration(value: unknown): readonly V1FormatId[];
17
+ export declare function selectedFormatOptions(value: unknown): readonly DeclarationWithMetadata[];
18
+ export declare function concealSelectedFormatOptions(refs: readonly unknown[], declarations: readonly DeclarationWithMetadata[]): void;
19
+ /** Preserve out-of-band downgrade metadata when a canonical sanitizer clones a value. */
20
+ export declare function transferLegacyCreativeMetadata(source: object, target: object): void;
21
+ export {};
22
+ //# sourceMappingURL=legacy-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-metadata.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/projection/legacy-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAEtE;;;;GAIG;AAEH,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,0BAA0B,EAAE,eAAe,CAAC,GAAG;IAC3F,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,CAAC;AAEF,KAAK,uBAAuB,GAAG,0BAA0B,CAAC;AAE1D,MAAM,MAAM,wBAAwB,GAAG;IACrC,kBAAkB,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CACzC,CAAC;AAKF,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,wBAAwB,GAAG,0BAA0B,GAAG,0BAA0B,GAC9F,uBAAuB,CAWzB;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,UAAU,EAAE,CAMpF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,uBAAuB,EAAE,CAMxF;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,YAAY,EAAE,SAAS,uBAAuB,EAAE,GAC/C,IAAI,CAEN;AAED,yFAAyF;AACzF,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAKnF"}