@adcp/sdk 15.9.1 → 16.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/bin/adcp-identity.js +74 -0
  2. package/bin/adcp.js +2 -0
  3. package/dist/lib/adapters/keyed-account-backend.d.mts +37 -0
  4. package/dist/lib/adapters/keyed-account-backend.d.ts +37 -0
  5. package/dist/lib/adapters/keyed-account-backend.js +121 -0
  6. package/dist/lib/adapters/keyed-account-backend.mjs +94 -0
  7. package/dist/lib/adapters/keyed-account-store.d.mts +28 -0
  8. package/dist/lib/adapters/keyed-account-store.d.ts +28 -0
  9. package/dist/lib/adapters/keyed-account-store.js +227 -0
  10. package/dist/lib/adapters/keyed-account-store.mjs +203 -0
  11. package/dist/lib/core/SingleAgentClient.d.mts +25 -2
  12. package/dist/lib/core/SingleAgentClient.d.ts +25 -2
  13. package/dist/lib/core/SingleAgentClient.js +280 -62
  14. package/dist/lib/core/SingleAgentClient.mjs +282 -57
  15. package/dist/lib/core/TaskExecutor.d.mts +6 -0
  16. package/dist/lib/core/TaskExecutor.d.ts +6 -0
  17. package/dist/lib/core/TaskExecutor.js +66 -5
  18. package/dist/lib/core/TaskExecutor.mjs +71 -5
  19. package/dist/lib/core/postgres-webhook-registration-store.js +32 -5
  20. package/dist/lib/core/postgres-webhook-registration-store.mjs +32 -5
  21. package/dist/lib/core/redis-webhook-registration-store.js +23 -1
  22. package/dist/lib/core/redis-webhook-registration-store.mjs +23 -1
  23. package/dist/lib/core/webhook-registration.d.mts +7 -1
  24. package/dist/lib/core/webhook-registration.d.ts +7 -1
  25. package/dist/lib/core/webhook-registration.js +24 -2
  26. package/dist/lib/core/webhook-registration.mjs +23 -2
  27. package/dist/lib/identity-3.3/generated-compat.d.mts +34 -0
  28. package/dist/lib/identity-3.3/generated-compat.d.ts +34 -0
  29. package/dist/lib/identity-3.3/generated-compat.js +16 -0
  30. package/dist/lib/identity-3.3/generated-compat.mjs +0 -0
  31. package/dist/lib/identity-3.3/index.d.mts +10 -0
  32. package/dist/lib/identity-3.3/index.d.ts +10 -0
  33. package/dist/lib/identity-3.3/index.js +79 -0
  34. package/dist/lib/identity-3.3/index.mjs +50 -0
  35. package/dist/lib/identity-3.3/lifecycle.d.mts +125 -0
  36. package/dist/lib/identity-3.3/lifecycle.d.ts +125 -0
  37. package/dist/lib/identity-3.3/lifecycle.js +294 -0
  38. package/dist/lib/identity-3.3/lifecycle.mjs +272 -0
  39. package/dist/lib/identity-3.3/revocation.d.mts +86 -0
  40. package/dist/lib/identity-3.3/revocation.d.ts +86 -0
  41. package/dist/lib/identity-3.3/revocation.js +308 -0
  42. package/dist/lib/identity-3.3/revocation.mjs +286 -0
  43. package/dist/lib/identity-3.3/schemas.draft.d.mts +2472 -0
  44. package/dist/lib/identity-3.3/schemas.draft.d.ts +2472 -0
  45. package/dist/lib/identity-3.3/schemas.draft.js +1448 -0
  46. package/dist/lib/identity-3.3/schemas.draft.mjs +1428 -0
  47. package/dist/lib/identity-3.3/server.d.mts +46 -0
  48. package/dist/lib/identity-3.3/server.d.ts +46 -0
  49. package/dist/lib/identity-3.3/server.js +279 -0
  50. package/dist/lib/identity-3.3/server.mjs +260 -0
  51. package/dist/lib/identity-3.3/store.d.mts +24 -0
  52. package/dist/lib/identity-3.3/store.d.ts +24 -0
  53. package/dist/lib/identity-3.3/store.js +191 -0
  54. package/dist/lib/identity-3.3/store.mjs +169 -0
  55. package/dist/lib/identity-3.3/trust.d.mts +155 -0
  56. package/dist/lib/identity-3.3/trust.d.ts +155 -0
  57. package/dist/lib/identity-3.3/trust.js +383 -0
  58. package/dist/lib/identity-3.3/trust.mjs +342 -0
  59. package/dist/lib/identity-3.3/types.d.mts +155 -0
  60. package/dist/lib/identity-3.3/types.d.ts +155 -0
  61. package/dist/lib/identity-3.3/types.js +16 -0
  62. package/dist/lib/identity-3.3/types.mjs +0 -0
  63. package/dist/lib/identity-3.3/validation.d.mts +2 -0
  64. package/dist/lib/identity-3.3/validation.d.ts +2 -0
  65. package/dist/lib/identity-3.3/validation.js +125 -0
  66. package/dist/lib/identity-3.3/validation.mjs +91 -0
  67. package/dist/lib/index.d.mts +1 -1
  68. package/dist/lib/index.d.ts +1 -1
  69. package/dist/lib/index.js +2 -0
  70. package/dist/lib/index.mjs +2 -0
  71. package/dist/lib/protocols/index.d.mts +1 -1
  72. package/dist/lib/protocols/index.d.ts +1 -1
  73. package/dist/lib/protocols/index.js +2 -2
  74. package/dist/lib/protocols/index.mjs +2 -2
  75. package/dist/lib/reporting/azure/index.d.mts +5 -0
  76. package/dist/lib/reporting/azure/index.d.ts +5 -0
  77. package/dist/lib/reporting/azure/index.js +26 -7
  78. package/dist/lib/reporting/azure/index.mjs +26 -7
  79. package/dist/lib/reporting/bigquery/index.d.mts +39 -5
  80. package/dist/lib/reporting/bigquery/index.d.ts +39 -5
  81. package/dist/lib/reporting/bigquery/index.js +26 -20
  82. package/dist/lib/reporting/bigquery/index.mjs +26 -20
  83. package/dist/lib/reporting/gcs/adapter.d.mts +8 -1
  84. package/dist/lib/reporting/gcs/adapter.d.ts +8 -1
  85. package/dist/lib/reporting/gcs/errors.d.mts +6 -0
  86. package/dist/lib/reporting/gcs/errors.d.ts +6 -0
  87. package/dist/lib/reporting/gcs/fence.d.mts +5 -0
  88. package/dist/lib/reporting/gcs/fence.d.ts +5 -0
  89. package/dist/lib/reporting/gcs/index.d.mts +9 -0
  90. package/dist/lib/reporting/gcs/index.d.ts +9 -0
  91. package/dist/lib/reporting/gcs/reader.d.mts +27 -3
  92. package/dist/lib/reporting/gcs/reader.d.ts +27 -3
  93. package/dist/lib/reporting/gcs/row-provider.d.mts +7 -0
  94. package/dist/lib/reporting/gcs/row-provider.d.ts +7 -0
  95. package/dist/lib/reporting/gcs/row-provider.js +34 -14
  96. package/dist/lib/reporting/gcs/row-provider.mjs +34 -14
  97. package/dist/lib/reporting/ledger/change-feed.d.mts +22 -1
  98. package/dist/lib/reporting/ledger/change-feed.d.ts +22 -1
  99. package/dist/lib/reporting/ledger/index.d.mts +11 -0
  100. package/dist/lib/reporting/ledger/index.d.ts +11 -0
  101. package/dist/lib/reporting/ledger/managed-postgres.d.mts +8 -0
  102. package/dist/lib/reporting/ledger/managed-postgres.d.ts +8 -0
  103. package/dist/lib/reporting/ledger/managed-router.d.mts +27 -2
  104. package/dist/lib/reporting/ledger/managed-router.d.ts +27 -2
  105. package/dist/lib/reporting/ledger/managed.d.mts +86 -6
  106. package/dist/lib/reporting/ledger/managed.d.ts +86 -6
  107. package/dist/lib/reporting/ledger/notification-activity.d.mts +65 -3
  108. package/dist/lib/reporting/ledger/notification-activity.d.ts +65 -3
  109. package/dist/lib/reporting/ledger/object-writes.d.mts +64 -5
  110. package/dist/lib/reporting/ledger/object-writes.d.ts +64 -5
  111. package/dist/lib/reporting/ledger/postgres.d.mts +43 -9
  112. package/dist/lib/reporting/ledger/postgres.d.ts +43 -9
  113. package/dist/lib/reporting/ledger/postgres.js +43 -27
  114. package/dist/lib/reporting/ledger/postgres.mjs +43 -27
  115. package/dist/lib/reporting/ledger/row-encoding.d.mts +92 -6
  116. package/dist/lib/reporting/ledger/row-encoding.d.ts +92 -6
  117. package/dist/lib/reporting/ledger/row-encoding.js +8 -4
  118. package/dist/lib/reporting/ledger/row-encoding.mjs +6 -3
  119. package/dist/lib/reporting/ledger/row-storage-errors.d.mts +11 -1
  120. package/dist/lib/reporting/ledger/row-storage-errors.d.ts +11 -1
  121. package/dist/lib/reporting/ledger/row-storage-migration.d.mts +19 -1
  122. package/dist/lib/reporting/ledger/row-storage-migration.d.ts +19 -1
  123. package/dist/lib/reporting/ledger/row-storage-migration.js +133 -18
  124. package/dist/lib/reporting/ledger/row-storage-migration.mjs +133 -18
  125. package/dist/lib/reporting/ledger/row-storage-object.d.mts +103 -12
  126. package/dist/lib/reporting/ledger/row-storage-object.d.ts +103 -12
  127. package/dist/lib/reporting/ledger/row-storage-object.js +106 -31
  128. package/dist/lib/reporting/ledger/row-storage-object.mjs +104 -31
  129. package/dist/lib/reporting/ledger/row-storage.d.mts +87 -20
  130. package/dist/lib/reporting/ledger/row-storage.d.ts +87 -20
  131. package/dist/lib/reporting/ledger/row-storage.js +126 -66
  132. package/dist/lib/reporting/ledger/row-storage.mjs +129 -67
  133. package/dist/lib/reporting/ledger/schedule.d.mts +13 -0
  134. package/dist/lib/reporting/ledger/schedule.d.ts +13 -0
  135. package/dist/lib/reporting/ledger/schedule.js +24 -0
  136. package/dist/lib/reporting/ledger/schedule.mjs +23 -0
  137. package/dist/lib/reporting/ledger/types.d.mts +23 -1
  138. package/dist/lib/reporting/ledger/types.d.ts +23 -1
  139. package/dist/lib/reporting/s3/index.d.mts +5 -0
  140. package/dist/lib/reporting/s3/index.d.ts +5 -0
  141. package/dist/lib/reporting/s3/index.js +37 -14
  142. package/dist/lib/reporting/s3/index.mjs +37 -14
  143. package/dist/lib/reporting/service/index.d.mts +10 -0
  144. package/dist/lib/reporting/service/index.d.ts +10 -0
  145. package/dist/lib/reporting/service/maintenance.d.mts +28 -2
  146. package/dist/lib/reporting/service/maintenance.d.ts +28 -2
  147. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  148. package/dist/lib/server/account-sync-contract.d.mts +14 -0
  149. package/dist/lib/server/account-sync-contract.d.ts +14 -0
  150. package/dist/lib/server/account-sync-contract.js +225 -0
  151. package/dist/lib/server/account-sync-contract.mjs +197 -0
  152. package/dist/lib/server/adcp-server.js +5 -0
  153. package/dist/lib/server/adcp-server.mjs +10 -0
  154. package/dist/lib/server/auth-signature.d.mts +15 -0
  155. package/dist/lib/server/auth-signature.d.ts +15 -0
  156. package/dist/lib/server/auth-signature.js +72 -2
  157. package/dist/lib/server/auth-signature.mjs +81 -2
  158. package/dist/lib/server/auth.d.mts +6 -0
  159. package/dist/lib/server/auth.d.ts +6 -0
  160. package/dist/lib/server/auth.js +6 -0
  161. package/dist/lib/server/auth.mjs +6 -0
  162. package/dist/lib/server/create-adcp-server.d.mts +19 -5
  163. package/dist/lib/server/create-adcp-server.d.ts +19 -5
  164. package/dist/lib/server/create-adcp-server.js +259 -19
  165. package/dist/lib/server/create-adcp-server.mjs +266 -10
  166. package/dist/lib/server/decisioning/account.d.mts +24 -1
  167. package/dist/lib/server/decisioning/account.d.ts +24 -1
  168. package/dist/lib/server/decisioning/index.d.mts +1 -1
  169. package/dist/lib/server/decisioning/index.d.ts +1 -1
  170. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +0 -50
  171. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +0 -50
  172. package/dist/lib/server/decisioning/runtime/from-platform.js +61 -11
  173. package/dist/lib/server/decisioning/runtime/from-platform.mjs +65 -12
  174. package/dist/lib/server/index.d.mts +2 -0
  175. package/dist/lib/server/index.d.ts +2 -0
  176. package/dist/lib/server/index.js +12 -0
  177. package/dist/lib/server/index.mjs +12 -0
  178. package/dist/lib/server/notification-subscriptions/runtime.js +9 -1
  179. package/dist/lib/server/notification-subscriptions/runtime.mjs +9 -1
  180. package/dist/lib/server/notification-subscriptions/types.d.mts +5 -0
  181. package/dist/lib/server/notification-subscriptions/types.d.ts +5 -0
  182. package/dist/lib/server/principal/types.d.mts +1 -1
  183. package/dist/lib/server/principal/types.d.ts +1 -1
  184. package/dist/lib/server/serve.js +5 -0
  185. package/dist/lib/server/serve.mjs +5 -0
  186. package/dist/lib/server/webhook-delivery/recovery.d.mts +1 -0
  187. package/dist/lib/server/webhook-delivery/recovery.d.ts +1 -0
  188. package/dist/lib/server/webhook-delivery/recovery.js +4 -0
  189. package/dist/lib/server/webhook-delivery/recovery.mjs +4 -0
  190. package/dist/lib/server/webhook-emitter.d.mts +10 -0
  191. package/dist/lib/server/webhook-emitter.d.ts +10 -0
  192. package/dist/lib/server/webhook-emitter.js +22 -0
  193. package/dist/lib/server/webhook-emitter.mjs +22 -0
  194. package/dist/lib/signing/agent-context.d.mts +0 -5
  195. package/dist/lib/signing/agent-context.d.ts +0 -5
  196. package/dist/lib/signing/agent-context.js +9 -1
  197. package/dist/lib/signing/agent-context.mjs +9 -1
  198. package/dist/lib/signing/agent-fetch.js +27 -2
  199. package/dist/lib/signing/agent-fetch.mjs +32 -2
  200. package/dist/lib/signing/agent-resolver/canonicalize.d.mts +10 -15
  201. package/dist/lib/signing/agent-resolver/canonicalize.d.ts +10 -15
  202. package/dist/lib/signing/agent-resolver/canonicalize.js +17 -5
  203. package/dist/lib/signing/agent-resolver/canonicalize.mjs +16 -5
  204. package/dist/lib/signing/agent-resolver/index.d.mts +1 -0
  205. package/dist/lib/signing/agent-resolver/index.d.ts +1 -0
  206. package/dist/lib/signing/agent-resolver/index.js +5 -0
  207. package/dist/lib/signing/agent-resolver/index.mjs +3 -0
  208. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.mts +3 -2
  209. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.ts +3 -2
  210. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.js +30 -3
  211. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.mjs +30 -3
  212. package/dist/lib/signing/agent-resolver/strict-json.d.mts +2 -2
  213. package/dist/lib/signing/agent-resolver/strict-json.d.ts +2 -2
  214. package/dist/lib/signing/agent-resolver/strict-json.js +5 -3
  215. package/dist/lib/signing/agent-resolver/strict-json.mjs +5 -3
  216. package/dist/lib/signing/brand-jwks.d.mts +2 -2
  217. package/dist/lib/signing/brand-jwks.d.ts +2 -2
  218. package/dist/lib/signing/brand-jwks.js +4 -4
  219. package/dist/lib/signing/brand-jwks.mjs +4 -4
  220. package/dist/lib/signing/client.d.mts +1 -0
  221. package/dist/lib/signing/client.d.ts +1 -0
  222. package/dist/lib/signing/client.js +5 -0
  223. package/dist/lib/signing/client.mjs +3 -0
  224. package/dist/lib/signing/crypto.js +8 -0
  225. package/dist/lib/signing/crypto.mjs +9 -1
  226. package/dist/lib/signing/fetch-async.js +1 -1
  227. package/dist/lib/signing/fetch-async.mjs +1 -1
  228. package/dist/lib/signing/fetch.js +1 -1
  229. package/dist/lib/signing/fetch.mjs +1 -1
  230. package/dist/lib/signing/jwks-https.d.mts +1 -1
  231. package/dist/lib/signing/jwks-https.d.ts +1 -1
  232. package/dist/lib/signing/jwks-https.js +1 -1
  233. package/dist/lib/signing/jwks-https.mjs +1 -1
  234. package/dist/lib/signing/jwks.d.mts +11 -3
  235. package/dist/lib/signing/jwks.d.ts +11 -3
  236. package/dist/lib/signing/jwks.js +1 -1
  237. package/dist/lib/signing/jwks.mjs +1 -1
  238. package/dist/lib/signing/middleware.js +9 -0
  239. package/dist/lib/signing/middleware.mjs +14 -0
  240. package/dist/lib/signing/parser.d.mts +9 -6
  241. package/dist/lib/signing/parser.d.ts +9 -6
  242. package/dist/lib/signing/parser.js +82 -64
  243. package/dist/lib/signing/parser.mjs +83 -65
  244. package/dist/lib/signing/revocation.d.mts +4 -1
  245. package/dist/lib/signing/revocation.d.ts +4 -1
  246. package/dist/lib/signing/revocation.js +36 -3
  247. package/dist/lib/signing/revocation.mjs +34 -2
  248. package/dist/lib/signing/server.d.mts +1 -1
  249. package/dist/lib/signing/server.d.ts +1 -1
  250. package/dist/lib/signing/server.js +4 -0
  251. package/dist/lib/signing/server.mjs +4 -0
  252. package/dist/lib/signing/types.d.mts +3 -0
  253. package/dist/lib/signing/types.d.ts +3 -0
  254. package/dist/lib/signing/verifier.js +1 -1
  255. package/dist/lib/signing/verifier.mjs +1 -1
  256. package/dist/lib/signing/web-bot-auth.d.mts +191 -0
  257. package/dist/lib/signing/web-bot-auth.d.ts +191 -0
  258. package/dist/lib/signing/web-bot-auth.js +837 -0
  259. package/dist/lib/signing/web-bot-auth.mjs +796 -0
  260. package/dist/lib/signing/webhook-verifier.js +1 -1
  261. package/dist/lib/signing/webhook-verifier.mjs +1 -1
  262. package/dist/lib/testing/client.d.mts +1 -4
  263. package/dist/lib/testing/client.d.ts +1 -4
  264. package/dist/lib/testing/client.js +141 -20
  265. package/dist/lib/testing/client.mjs +137 -19
  266. package/dist/lib/testing/compliance/comply.js +29 -10
  267. package/dist/lib/testing/compliance/comply.mjs +37 -11
  268. package/dist/lib/testing/storyboard/account-sync-contract.d.mts +3 -0
  269. package/dist/lib/testing/storyboard/account-sync-contract.d.ts +3 -0
  270. package/dist/lib/testing/storyboard/account-sync-contract.js +79 -0
  271. package/dist/lib/testing/storyboard/account-sync-contract.mjs +55 -0
  272. package/dist/lib/testing/storyboard/default-invariants.js +2 -0
  273. package/dist/lib/testing/storyboard/default-invariants.mjs +2 -0
  274. package/dist/lib/testing/storyboard/runner.js +23 -8
  275. package/dist/lib/testing/storyboard/runner.mjs +24 -8
  276. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  277. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  278. package/dist/lib/types/adcp.d.mts +4 -0
  279. package/dist/lib/types/adcp.d.ts +4 -0
  280. package/dist/lib/types/schemas.generated.d.ts +6 -6
  281. package/dist/lib/utils/capabilities.d.mts +1 -0
  282. package/dist/lib/utils/capabilities.d.ts +1 -0
  283. package/dist/lib/utils/capabilities.js +5 -0
  284. package/dist/lib/utils/capabilities.mjs +5 -0
  285. package/dist/lib/v2/projection/catalog-snapshot.js +3 -1
  286. package/dist/lib/v2/projection/catalog-snapshot.mjs +3 -1
  287. package/dist/lib/v2/projection/creative-delivery.d.mts +34 -10
  288. package/dist/lib/v2/projection/creative-delivery.d.ts +34 -10
  289. package/dist/lib/v2/projection/creative-delivery.js +26 -10
  290. package/dist/lib/v2/projection/creative-delivery.mjs +26 -10
  291. package/dist/lib/v2/projection/index.d.mts +1 -1
  292. package/dist/lib/v2/projection/index.d.ts +1 -1
  293. package/dist/lib/v2/projection/index.js +2 -0
  294. package/dist/lib/v2/projection/index.mjs +2 -0
  295. package/dist/lib/v2/projection/legacy-routes.d.mts +34 -2
  296. package/dist/lib/v2/projection/legacy-routes.d.ts +34 -2
  297. package/dist/lib/v2/projection/legacy-routes.js +35 -2
  298. package/dist/lib/v2/projection/legacy-routes.mjs +32 -2
  299. package/dist/lib/validation/schema-loader.d.mts +2 -0
  300. package/dist/lib/validation/schema-loader.d.ts +2 -0
  301. package/dist/lib/validation/schema-loader.js +43 -4
  302. package/dist/lib/validation/schema-loader.mjs +39 -3
  303. package/dist/lib/version.d.mts +3 -3
  304. package/dist/lib/version.d.ts +3 -3
  305. package/dist/lib/version.js +3 -3
  306. package/dist/lib/version.mjs +3 -3
  307. package/docs/TYPE-SUMMARY.md +2 -2
  308. package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +4 -0
  309. package/docs/guides/REPORTING-LEDGER-CUTOVER.md +1 -1
  310. package/docs/guides/REPORTING-LEDGER.md +99 -29
  311. package/docs/guides/REPORTING-OPERATIONS.md +29 -13
  312. package/docs/guides/REPORTING-STABILITY.md +76 -0
  313. package/docs/guides/account-resolution.md +101 -0
  314. package/docs/llms.txt +3 -2
  315. package/docs/migration-12-to-13.md +15 -0
  316. package/docs/migration-14.x-rc-worksheet.md +4 -4
  317. package/docs/migration-agent-identity-3.3.md +494 -0
  318. package/docs/migration-agent-resolution-3.3.md +5 -0
  319. package/docs/migration-reporting-row-storage-alignment.md +137 -0
  320. package/examples/storyboards/account-sync-contract.yaml +57 -0
  321. package/package.json +17 -1
@@ -55,12 +55,14 @@ class ReportingRowStorageV1 {
55
55
  if (!provider) throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", `row binding ${id} names an unknown provider`);
56
56
  provider.validateLocation(binding.location);
57
57
  (0, import_row_storage_object.assertReportingRowPrefixV1)(binding.prefix);
58
- (0, import_row_storage_object.assertReportingRowKeyTemplateV1)(binding.keyTemplate ?? import_row_storage_object.REPORTING_ROW_DEFAULT_KEY_TEMPLATE);
59
58
  if (binding.credentialRef !== void 0 && !CREDENTIAL_REF.test(binding.credentialRef)) {
60
59
  throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", `row binding ${id} has an invalid credentialRef`);
61
60
  }
62
61
  }
63
- this.bindings = Object.freeze({ ...bindings });
62
+ this.bindings = Object.freeze(
63
+ Object.fromEntries(Object.entries(bindings).map(([id, binding]) => [id, Object.freeze({ ...binding })]))
64
+ );
65
+ this.assertBindingKeyTemplates();
64
66
  this.deploymentNamespace = options.deploymentNamespace ?? "default";
65
67
  if (!this.deploymentNamespace || this.deploymentNamespace.length > 256) {
66
68
  throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "deploymentNamespace must be 1-256 characters");
@@ -81,12 +83,34 @@ class ReportingRowStorageV1 {
81
83
  get writeDeadlineMilliseconds() {
82
84
  return this.writeDeadline;
83
85
  }
86
+ /** Every writable object binding's key template must include `{revision_key}`; throws `INVALID_INPUT`. */
87
+ assertBindingKeyTemplates() {
88
+ for (const [id, binding] of Object.entries(this.bindings)) {
89
+ if (binding.kind !== "object") continue;
90
+ try {
91
+ (0, import_row_storage_object.assertReportingRowKeyTemplateV1)(binding.keyTemplate ?? import_row_storage_object.REPORTING_ROW_DEFAULT_KEY_TEMPLATE, {
92
+ requireRevisionKey: binding.readOnly !== true
93
+ });
94
+ } catch (error) {
95
+ if ((0, import_row_storage_errors.isReportingRowStoreError)(error)) {
96
+ throw new import_row_storage_errors.ReportingRowStoreError(
97
+ "INVALID_INPUT",
98
+ `row binding ${id}: ${error.message.replace(/^Reporting row store: INVALID_INPUT: /, "")}`
99
+ );
100
+ }
101
+ throw error;
102
+ }
103
+ }
104
+ }
84
105
  /**
85
106
  * Refuse a configuration in which compaction could delete an object a concurrent commit is
86
107
  * adopting. An object binding whose key template omits `{revision_key}` can map two revisions
87
108
  * with identical chunk content to one object key, and a create-only write adopts an existing
88
109
  * object with identical bytes. Compaction deleting that object at the same moment would leave
89
- * the newer revision without its rows. The default template includes `{revision_key}`.
110
+ * the newer revision without its rows. Every writable binding is already required to include
111
+ * `{revision_key}`, so this cannot fail for a validated configuration. A `readOnly` binding is
112
+ * skipped: it never takes commits, so nothing can adopt through it, and every delete is
113
+ * reference-checked.
90
114
  *
91
115
  * Since the reference-checked, per-object-locked delete this is no longer the only guard: every
92
116
  * delete path now skips an object another row set still references. It is kept as defense in
@@ -94,7 +118,7 @@ class ReportingRowStorageV1 {
94
118
  */
95
119
  assertCompactionSafeKeyTemplates() {
96
120
  const unsafe = Object.entries(this.bindings).filter(
97
- ([, binding]) => binding.kind === "object" && !(binding.keyTemplate ?? import_row_storage_object.REPORTING_ROW_DEFAULT_KEY_TEMPLATE).includes("{revision_key}")
121
+ ([, binding]) => binding.kind === "object" && binding.readOnly !== true && !(binding.keyTemplate ?? import_row_storage_object.REPORTING_ROW_DEFAULT_KEY_TEMPLATE).includes("{revision_key}")
98
122
  ).map(([id]) => id);
99
123
  if (unsafe.length > 0) {
100
124
  throw new import_row_storage_errors.ReportingRowStoreError(
@@ -136,30 +160,46 @@ class ReportingRowStorageV1 {
136
160
  if (digest.sha256 !== input.binding.sha256 || digest.byteCount !== input.binding.byteCount || input.binding.rowCount !== input.rows.length) {
137
161
  throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "rows do not reproduce their committed binding");
138
162
  }
139
- const ids = Object.keys(this.bindings);
163
+ const writable = Object.keys(this.bindings).filter((id) => {
164
+ const candidate = this.bindings[id];
165
+ return candidate.kind !== "object" || candidate.readOnly !== true;
166
+ });
167
+ if (writable.length === 0 && !input.bindingId && !this.options.selectRowBinding) {
168
+ throw new import_row_storage_errors.ReportingRowStoreError(
169
+ "UNSAFE_BINDING",
170
+ "no writable row binding is configured: every binding is readOnly"
171
+ );
172
+ }
140
173
  const bindingId = input.bindingId ? input.bindingId : this.options.selectRowBinding ? await this.options.selectRowBinding({
141
174
  account_id: input.accountId,
142
175
  reporting_obligation_id: input.obligationId,
143
176
  row_set_kind: input.rowSetKind,
144
177
  ...input.finality ? { finality: input.finality } : {},
145
178
  row_count: input.rows.length,
146
- canonical_byte_count: digest.byteCount
147
- }) : ids.length === 1 ? ids[0] : DEFAULT_BINDING_ID;
179
+ content_size_bytes: digest.byteCount
180
+ }) : writable.length === 1 ? writable[0] : DEFAULT_BINDING_ID;
148
181
  const binding = this.bindings[bindingId];
149
182
  if (!binding) throw new import_row_storage_errors.ReportingRowStoreError("STATE_UNAVAILABLE", `row binding ${bindingId} is not configured`);
183
+ if (binding.kind === "object" && binding.readOnly === true) {
184
+ throw new import_row_storage_errors.ReportingRowStoreError(
185
+ "UNSAFE_BINDING",
186
+ `row binding ${bindingId} is read-only and cannot take new row sets`
187
+ );
188
+ }
150
189
  if (binding.kind === "postgres") return Object.freeze({ input, encoded, bindingId, binding, digestProfile });
151
190
  const compression = binding.compression ?? "gzip";
152
191
  const namespaceKey = this.installation.namespaceKey;
153
192
  const objects = encoded.chunks.map((chunk) => {
154
193
  const physicalBytes = compression === "gzip" ? (0, import_zlib.gzipSync)(chunk.bytes, { level: 6 }) : chunk.bytes;
155
194
  return Object.freeze({
156
- key: (0, import_row_storage_object.renderReportingRowObjectKeyV1)({
195
+ objectRef: (0, import_row_storage_object.renderReportingRowObjectKeyV1)({
157
196
  template: binding.keyTemplate ?? import_row_storage_object.REPORTING_ROW_DEFAULT_KEY_TEMPLATE,
158
197
  prefix: binding.prefix,
159
198
  namespaceKey,
160
199
  accountId: input.accountId,
161
200
  rowSetId: input.rowSetId,
162
201
  ...input.periodStart ? { periodStart: input.periodStart } : {},
202
+ ...input.sourceTimezone ? { sourceTimezone: input.sourceTimezone } : {},
163
203
  ...input.finality ? { finality: input.finality } : {},
164
204
  contentSha256: input.binding.sha256,
165
205
  chunkIndex: chunk.manifest.chunk_index,
@@ -194,7 +234,7 @@ class ReportingRowStorageV1 {
194
234
  () => provider.putIfAbsent(
195
235
  {
196
236
  ...location,
197
- key: object.key,
237
+ objectRef: object.objectRef,
198
238
  bytes: object.physicalBytes,
199
239
  contentType: object.compression === "gzip" ? "application/gzip" : "application/x-ndjson",
200
240
  metadata: {
@@ -206,20 +246,27 @@ class ReportingRowStorageV1 {
206
246
  )
207
247
  );
208
248
  if (put.created) {
209
- await onCreated({ objectKey: object.key, nativeVersion: put.nativeVersion });
249
+ await onCreated({ objectRef: object.objectRef, nativeVersionRef: put.nativeVersionRef });
250
+ assertNativeVersionRef(put.nativeVersionRef);
210
251
  locators.push({
211
- objectKey: object.key,
212
- nativeVersion: put.nativeVersion,
252
+ objectRef: object.objectRef,
253
+ nativeVersionRef: put.nativeVersionRef,
213
254
  compression: object.compression,
214
255
  physicalSha256: object.physicalSha256,
215
- physicalByteCount: object.physicalBytes.byteLength,
256
+ sizeBytes: object.physicalBytes.byteLength,
216
257
  created: true
217
258
  });
218
259
  continue;
219
260
  }
261
+ assertNativeVersionRef(put.nativeVersionRef);
220
262
  const existing = await this.provider(
221
263
  () => provider.get(
222
- { ...location, key: object.key, nativeVersion: put.nativeVersion, maxBytes: MAX_ADOPTED_OBJECT_BYTES },
264
+ {
265
+ ...location,
266
+ objectRef: object.objectRef,
267
+ nativeVersionRef: put.nativeVersionRef,
268
+ maxBytes: MAX_ADOPTED_OBJECT_BYTES
269
+ },
223
270
  context
224
271
  )
225
272
  );
@@ -228,11 +275,11 @@ class ReportingRowStorageV1 {
228
275
  throw new import_row_storage_errors.ReportingRowStoreError("CONTENT_CONFLICT", `object for chunk ${index} holds different bytes`);
229
276
  }
230
277
  locators.push({
231
- objectKey: object.key,
232
- nativeVersion: put.nativeVersion,
278
+ objectRef: object.objectRef,
279
+ nativeVersionRef: put.nativeVersionRef,
233
280
  compression: object.compression,
234
281
  physicalSha256: sha256Hex(existing),
235
- physicalByteCount: existing.byteLength,
282
+ sizeBytes: existing.byteLength,
236
283
  created: false
237
284
  });
238
285
  }
@@ -251,17 +298,18 @@ class ReportingRowStorageV1 {
251
298
  }
252
299
  const inserted = await transaction.query(
253
300
  `INSERT INTO adcp_reporting_row_sets
254
- (row_set_id, row_set_kind, account_id, obligation_id, encoding, digest_profile, content_sha256,
255
- canonical_byte_count, row_count, row_manifest_sha256, chunk_count, row_binding_id,
301
+ (row_set_id, row_set_kind, account_id, obligation_id, format, algorithm, digest_profile, content_sha256,
302
+ content_size_bytes, row_count, row_manifest_sha256, chunk_count, row_binding_id,
256
303
  rows_shared_from_row_set_id)
257
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
304
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)
258
305
  ON CONFLICT (row_set_id) DO NOTHING`,
259
306
  [
260
307
  input.rowSetId,
261
308
  input.rowSetKind,
262
309
  input.accountId,
263
310
  input.obligationId,
264
- import_row_encoding.REPORTING_ROW_ENCODING_V1,
311
+ import_row_encoding.REPORTING_ROW_FORMAT_V1,
312
+ import_row_encoding.REPORTING_ROW_ALGORITHM_V1,
265
313
  prepared.digestProfile,
266
314
  input.binding.sha256,
267
315
  input.binding.byteCount,
@@ -295,8 +343,8 @@ class ReportingRowStorageV1 {
295
343
  }
296
344
  await transaction.query(
297
345
  `INSERT INTO adcp_reporting_row_chunks
298
- (row_set_id, chunk_index, account_id, obligation_id, first_ordinal, row_count, byte_count, sha256, segments,
299
- object_key, native_version, compression, physical_sha256, physical_byte_count)
346
+ (row_set_id, chunk_index, account_id, obligation_id, first_ordinal, row_count, canonical_size_bytes, sha256,
347
+ segments, object_ref, native_version_ref, compression, physical_sha256, size_bytes)
300
348
  VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9::jsonb, $10, $11, $12, $13, $14)`,
301
349
  [
302
350
  input.rowSetId,
@@ -308,11 +356,11 @@ class ReportingRowStorageV1 {
308
356
  manifest.byte_count,
309
357
  manifest.sha256,
310
358
  JSON.stringify(manifest.segments),
311
- locator?.objectKey ?? null,
312
- locator?.nativeVersion ?? null,
359
+ locator?.objectRef ?? null,
360
+ locator?.nativeVersionRef ?? null,
313
361
  locator?.compression ?? "none",
314
362
  locator?.physicalSha256 ?? null,
315
- locator?.physicalByteCount ?? null
363
+ locator?.sizeBytes ?? null
316
364
  ]
317
365
  );
318
366
  }
@@ -326,7 +374,7 @@ class ReportingRowStorageV1 {
326
374
  async find(rowSetId, accountId, queryable = this.pool) {
327
375
  const found = await queryable.query(
328
376
  `SELECT row_set.row_set_id, row_set.row_set_kind, row_set.account_id, row_set.obligation_id,
329
- row_set.digest_profile, row_set.content_sha256, row_set.canonical_byte_count, row_set.row_count,
377
+ row_set.digest_profile, row_set.content_sha256, row_set.content_size_bytes, row_set.row_count,
330
378
  row_set.row_manifest_sha256, row_set.chunk_count, row_set.row_binding_id,
331
379
  row_set.row_location_version, row_set.rows_state, binding.kind, binding.identity_sha256
332
380
  FROM adcp_reporting_row_sets row_set
@@ -341,8 +389,8 @@ class ReportingRowStorageV1 {
341
389
  }
342
390
  if (record.rows_state === "unavailable") throw new import_row_storage_errors.ReportingRowStoreError("ROWS_UNAVAILABLE");
343
391
  const chunks = await queryable.query(
344
- `SELECT chunk_index, first_ordinal, row_count, byte_count, sha256, segments,
345
- object_key, native_version, compression, physical_sha256, physical_byte_count
392
+ `SELECT chunk_index, first_ordinal, row_count, canonical_size_bytes, sha256, segments,
393
+ object_ref, native_version_ref, compression, physical_sha256, size_bytes
346
394
  FROM adcp_reporting_row_chunks WHERE row_set_id = $1 ORDER BY chunk_index`,
347
395
  [rowSetId]
348
396
  );
@@ -350,7 +398,7 @@ class ReportingRowStorageV1 {
350
398
  chunk_index: chunk.chunk_index,
351
399
  first_ordinal: Number(chunk.first_ordinal),
352
400
  row_count: chunk.row_count,
353
- byte_count: Number(chunk.byte_count),
401
+ byte_count: Number(chunk.canonical_size_bytes),
354
402
  sha256: chunk.sha256,
355
403
  segments: chunk.segments.map((segment) => ({
356
404
  first_ordinal: Number(segment.first_ordinal),
@@ -371,16 +419,16 @@ class ReportingRowStorageV1 {
371
419
  throw new import_row_storage_errors.ReportingRowStoreError("ROWS_INTEGRITY_FAILED", "chunk count does not match the row set");
372
420
  }
373
421
  const locators = chunks.rows.map((chunk) => {
374
- const hasLocation = chunk.object_key !== null;
422
+ const hasLocation = chunk.object_ref !== null;
375
423
  if (hasLocation !== (record.kind === "object")) {
376
424
  throw new import_row_storage_errors.ReportingRowStoreError("ROWS_INTEGRITY_FAILED", "chunk location does not match its binding kind");
377
425
  }
378
426
  return hasLocation ? Object.freeze({
379
- objectKey: chunk.object_key,
380
- nativeVersion: chunk.native_version,
427
+ objectRef: chunk.object_ref,
428
+ nativeVersionRef: chunk.native_version_ref,
381
429
  compression: chunk.compression,
382
430
  physicalSha256: chunk.physical_sha256,
383
- physicalByteCount: Number(chunk.physical_byte_count)
431
+ sizeBytes: Number(chunk.size_bytes)
384
432
  }) : void 0;
385
433
  });
386
434
  return Object.freeze({
@@ -390,7 +438,7 @@ class ReportingRowStorageV1 {
390
438
  obligationId: record.obligation_id,
391
439
  digestProfile: record.digest_profile,
392
440
  contentSha256: record.content_sha256,
393
- canonicalByteCount: Number(record.canonical_byte_count),
441
+ contentSizeBytes: Number(record.content_size_bytes),
394
442
  rowCount,
395
443
  rowManifestSha256: record.row_manifest_sha256,
396
444
  bindingId: record.row_binding_id,
@@ -438,7 +486,7 @@ class ReportingRowStorageV1 {
438
486
  * `controlTotals` are required for revision row sets.
439
487
  */
440
488
  async readAll(handle, controlTotals, options = {}) {
441
- if (options.maxBytes !== void 0 && handle.canonicalByteCount > options.maxBytes) {
489
+ if (options.maxBytes !== void 0 && handle.contentSizeBytes > options.maxBytes) {
442
490
  throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "row set exceeds the hydration byte limit");
443
491
  }
444
492
  const hasher = handle.digestProfile === "revision_envelope_v1" ? (0, import_row_encoding.createReportingRevisionEnvelopeHasherV1)({
@@ -457,7 +505,7 @@ class ReportingRowStorageV1 {
457
505
  );
458
506
  }
459
507
  const digest = this.decode(() => hasher.digest());
460
- if (digest.sha256 !== handle.contentSha256 || digest.byteCount !== handle.canonicalByteCount) {
508
+ if (digest.sha256 !== handle.contentSha256 || digest.byteCount !== handle.contentSizeBytes) {
461
509
  throw new import_row_storage_errors.ReportingRowStoreError("ROWS_INTEGRITY_FAILED", "rows do not reproduce the committed binding");
462
510
  }
463
511
  return rows;
@@ -476,22 +524,28 @@ class ReportingRowStorageV1 {
476
524
  const ownedPrefix = `${binding.prefix}/${this.installation.namespaceKey}/`;
477
525
  const context = { signal: deadlineSignal(this.writeDeadline, signal) };
478
526
  for (const object of objects) {
479
- if (!object.objectKey.startsWith(ownedPrefix)) {
527
+ if (!object.objectRef.startsWith(ownedPrefix)) {
480
528
  throw new import_row_storage_errors.ReportingRowStoreError("UNSAFE_BINDING", "refusing to delete an object outside the owned prefix");
481
529
  }
482
530
  await this.provider(
483
531
  () => provider.delete(
484
- { ...providerLocation(binding), key: object.objectKey, nativeVersion: object.nativeVersion },
532
+ { ...providerLocation(binding), objectRef: object.objectRef, nativeVersionRef: object.nativeVersionRef },
485
533
  context
486
534
  )
487
535
  );
488
536
  }
489
537
  }
490
538
  /**
491
- * Prove each object is still present at its recorded version with the recorded bytes.
539
+ * Prove each object is still present at its recorded version with the recorded size.
492
540
  * A commit that adopted an object another row set created calls this under the object's
493
541
  * lock, so a concurrent delete either finished first (this throws, the commit fails and
494
542
  * the writer re-uploads) or sees the commit's chunk reference and skips the delete.
543
+ *
544
+ * Native versions are write-unique (S3 VersionId, Azure versionId, GCS generation, filesystem
545
+ * `ino:birthtime:mtime:size`), so a version-pinned metadata check, "this exact version exists at the
546
+ * recorded size", proves the object unchanged without downloading it while the commit holds its
547
+ * locks. Bytes were verified when the object was uploaded or adopted. A custom provider without
548
+ * `stat` falls back to reading the whole object and comparing its physical digest.
495
549
  */
496
550
  async assertObjectsPresent(bindingId, objects, signal) {
497
551
  await this.ready();
@@ -501,24 +555,24 @@ class ReportingRowStorageV1 {
501
555
  }
502
556
  const provider = this.providers[binding.provider];
503
557
  const context = { signal: deadlineSignal(this.writeDeadline, signal) };
558
+ const location = providerLocation(binding);
559
+ const changed = () => new import_row_storage_errors.ReportingRowStoreError(
560
+ "STATE_UNAVAILABLE",
561
+ "an adopted row object was deleted or replaced before its commit; retry the upload"
562
+ );
504
563
  for (const object of objects) {
564
+ const identity = { ...location, objectRef: object.objectRef, nativeVersionRef: object.nativeVersionRef };
565
+ if (provider.stat) {
566
+ const stat = await this.provider(() => provider.stat(identity, context));
567
+ if (!stat || stat.nativeVersionRef !== object.nativeVersionRef || !Number.isSafeInteger(stat.sizeBytes) || stat.sizeBytes !== object.sizeBytes) {
568
+ throw changed();
569
+ }
570
+ continue;
571
+ }
505
572
  const bytes = await this.provider(
506
- () => provider.get(
507
- {
508
- ...providerLocation(binding),
509
- key: object.objectKey,
510
- nativeVersion: object.nativeVersion,
511
- maxBytes: MAX_ADOPTED_OBJECT_BYTES
512
- },
513
- context
514
- )
573
+ () => provider.get({ ...identity, maxBytes: MAX_ADOPTED_OBJECT_BYTES }, context)
515
574
  );
516
- if (!bytes || sha256Hex(bytes) !== object.physicalSha256) {
517
- throw new import_row_storage_errors.ReportingRowStoreError(
518
- "STATE_UNAVAILABLE",
519
- "an adopted row object was deleted or replaced before its commit; retry the upload"
520
- );
521
- }
575
+ if (!bytes || sha256Hex(bytes) !== object.physicalSha256) throw changed();
522
576
  }
523
577
  }
524
578
  /**
@@ -545,21 +599,21 @@ class ReportingRowStorageV1 {
545
599
  const rowSetId = found.rows[0]?.row_set_id;
546
600
  if (!rowSetId) return void 0;
547
601
  const chunks = await queryable.query(
548
- `SELECT object_key, native_version, compression, physical_sha256, physical_byte_count
602
+ `SELECT object_ref, native_version_ref, compression, physical_sha256, size_bytes
549
603
  FROM adcp_reporting_row_chunks WHERE row_set_id = $1 ORDER BY chunk_index`,
550
604
  [rowSetId]
551
605
  );
552
606
  if (chunks.rows.length !== prepared.encoded.chunks.length) return void 0;
553
607
  if (prepared.binding.kind === "postgres") return { rowSetId, locators: [] };
554
- if (chunks.rows.some((chunk) => chunk.object_key === null)) return void 0;
608
+ if (chunks.rows.some((chunk) => chunk.object_ref === null)) return void 0;
555
609
  return {
556
610
  rowSetId,
557
611
  locators: chunks.rows.map((chunk) => ({
558
- objectKey: chunk.object_key,
559
- nativeVersion: chunk.native_version,
612
+ objectRef: chunk.object_ref,
613
+ nativeVersionRef: chunk.native_version_ref,
560
614
  compression: chunk.compression,
561
615
  physicalSha256: chunk.physical_sha256,
562
- physicalByteCount: Number(chunk.physical_byte_count),
616
+ sizeBytes: Number(chunk.size_bytes),
563
617
  created: false
564
618
  }))
565
619
  };
@@ -594,8 +648,8 @@ class ReportingRowStorageV1 {
594
648
  () => provider.get(
595
649
  {
596
650
  ...location,
597
- key: locator.objectKey,
598
- nativeVersion: locator.nativeVersion,
651
+ objectRef: locator.objectRef,
652
+ nativeVersionRef: locator.nativeVersionRef,
599
653
  range: { offset: byteOffset, length: byteCount },
600
654
  maxBytes: byteCount
601
655
  },
@@ -613,9 +667,9 @@ class ReportingRowStorageV1 {
613
667
  () => provider.get(
614
668
  {
615
669
  ...location,
616
- key: locator.objectKey,
617
- nativeVersion: locator.nativeVersion,
618
- maxBytes: locator.physicalByteCount
670
+ objectRef: locator.objectRef,
671
+ nativeVersionRef: locator.nativeVersionRef,
672
+ maxBytes: locator.sizeBytes
619
673
  },
620
674
  context
621
675
  )
@@ -623,7 +677,7 @@ class ReportingRowStorageV1 {
623
677
  if (!stored)
624
678
  throw new import_row_storage_errors.ReportingRowStoreError("ROWS_UNAVAILABLE", `chunk ${manifest.chunk_index} object is missing`);
625
679
  const physical = Buffer.from(stored);
626
- if (physical.byteLength !== locator.physicalByteCount || sha256Hex(physical) !== locator.physicalSha256) {
680
+ if (physical.byteLength !== locator.sizeBytes || sha256Hex(physical) !== locator.physicalSha256) {
627
681
  throw new import_row_storage_errors.ReportingRowStoreError("ROWS_INTEGRITY_FAILED", `chunk ${manifest.chunk_index} stored bytes differ`);
628
682
  }
629
683
  const logical = this.inflate(physical, locator.compression, manifest.byte_count);
@@ -662,6 +716,7 @@ class ReportingRowStorageV1 {
662
716
  }
663
717
  }
664
718
  async register() {
719
+ this.assertBindingKeyTemplates();
665
720
  const { installationId } = await (0, import_row_storage_migration.probeReportingRowStorageSchemaV1)(this.pool);
666
721
  const namespaceKey = sha256Hex((0, import_jcs.canonicalize)(["adcp.rows.v1", this.deploymentNamespace, installationId]));
667
722
  this.installation = { installationId, namespaceKey };
@@ -731,6 +786,11 @@ function deadlineSignal(milliseconds, signal) {
731
786
  const timeout = AbortSignal.timeout(milliseconds);
732
787
  return signal ? AbortSignal.any([signal, timeout]) : timeout;
733
788
  }
789
+ function assertNativeVersionRef(value) {
790
+ if (typeof value !== "string" || value.length < 1 || value.length > import_row_storage_object.REPORTING_ROW_NATIVE_VERSION_REF_MAX_LENGTH) {
791
+ throw new import_row_storage_errors.ReportingRowStoreError("PROVIDER_UNAVAILABLE", "provider returned an invalid native version reference");
792
+ }
793
+ }
734
794
  function positiveMilliseconds(value, name) {
735
795
  if (!Number.isSafeInteger(value) || value < 1e3 || value > 6e5) {
736
796
  throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", `${name} must be between 1000 and 600000`);