@intx/db 0.1.2 → 0.3.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 (241) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +23 -4
  3. package/dist/approval-store.d.ts +52 -0
  4. package/dist/approval-store.js +79 -0
  5. package/dist/asset-resolution.d.ts +52 -0
  6. package/dist/asset-resolution.js +66 -0
  7. package/dist/catalog-resolution.d.ts +76 -0
  8. package/dist/catalog-resolution.js +151 -0
  9. package/dist/client.d.ts +19 -0
  10. package/dist/client.js +18 -0
  11. package/dist/config.d.ts +11 -0
  12. package/dist/config.js +16 -0
  13. package/dist/connection.d.ts +3 -0
  14. package/dist/connection.js +26 -0
  15. package/dist/credential-resolution.d.ts +222 -0
  16. package/dist/credential-resolution.js +255 -0
  17. package/dist/grant-store.d.ts +3 -0
  18. package/dist/grant-store.js +59 -0
  19. package/dist/index.d.ts +22 -0
  20. package/dist/index.js +20 -0
  21. package/dist/migrate.d.ts +36 -0
  22. package/dist/migrate.js +135 -0
  23. package/dist/model-source-resolution.d.ts +115 -0
  24. package/dist/model-source-resolution.js +291 -0
  25. package/dist/parse-row.d.ts +373 -0
  26. package/dist/parse-row.js +232 -0
  27. package/dist/pg-error.d.ts +3 -0
  28. package/dist/pg-error.js +19 -0
  29. package/dist/pricing.d.ts +15 -0
  30. package/dist/pricing.js +24 -0
  31. package/dist/rekey-credential-secrets.d.ts +13 -0
  32. package/dist/rekey-credential-secrets.js +61 -0
  33. package/dist/schema/approvals.d.ts +245 -0
  34. package/dist/schema/approvals.js +52 -0
  35. package/dist/schema/assets.d.ts +143 -0
  36. package/{src/schema/assets.ts → dist/schema/assets.js} +7 -16
  37. package/dist/schema/auth.d.ts +606 -0
  38. package/dist/schema/auth.js +47 -0
  39. package/dist/schema/catalog.d.ts +811 -0
  40. package/dist/schema/catalog.js +108 -0
  41. package/dist/schema/column-types.d.ts +26 -0
  42. package/dist/schema/column-types.js +15 -0
  43. package/dist/schema/credentials.d.ts +305 -0
  44. package/{src/schema/credentials.ts → dist/schema/credentials.js} +16 -22
  45. package/dist/schema/git-tokens.d.ts +256 -0
  46. package/{src/schema/git-tokens.ts → dist/schema/git-tokens.js} +16 -39
  47. package/dist/schema/grants.d.ts +211 -0
  48. package/dist/schema/grants.js +30 -0
  49. package/dist/schema/index.d.ts +25 -0
  50. package/dist/schema/index.js +25 -0
  51. package/dist/schema/messages.d.ts +414 -0
  52. package/dist/schema/messages.js +82 -0
  53. package/dist/schema/oauth-clients.d.ts +246 -0
  54. package/{src/schema/oauth-clients.ts → dist/schema/oauth-clients.js} +8 -14
  55. package/dist/schema/offerings.d.ts +160 -0
  56. package/dist/schema/offerings.js +24 -0
  57. package/dist/schema/principals.d.ts +128 -0
  58. package/dist/schema/principals.js +23 -0
  59. package/dist/schema/providers.d.ts +237 -0
  60. package/dist/schema/providers.js +22 -0
  61. package/dist/schema/roles.d.ts +242 -0
  62. package/dist/schema/roles.js +37 -0
  63. package/dist/schema/session-assets.d.ts +92 -0
  64. package/dist/schema/session-assets.js +45 -0
  65. package/dist/schema/sessions.d.ts +143 -0
  66. package/dist/schema/sessions.js +29 -0
  67. package/dist/schema/sidecar-allocation.d.ts +406 -0
  68. package/dist/schema/sidecar-allocation.js +57 -0
  69. package/dist/schema/sidecar.d.ts +145 -0
  70. package/dist/schema/sidecar.js +28 -0
  71. package/dist/schema/signal-correlations.d.ts +177 -0
  72. package/dist/schema/signal-correlations.js +31 -0
  73. package/dist/schema/tenants.d.ts +235 -0
  74. package/{src/schema/tenants.ts → dist/schema/tenants.js} +10 -27
  75. package/dist/schema/wallets.d.ts +354 -0
  76. package/dist/schema/wallets.js +43 -0
  77. package/dist/schema/workflow-definitions.d.ts +371 -0
  78. package/dist/schema/workflow-definitions.js +97 -0
  79. package/dist/schema/workflow-run-dispatch.d.ts +328 -0
  80. package/dist/schema/workflow-run-dispatch.js +56 -0
  81. package/dist/schema/workflow-run-execution.d.ts +126 -0
  82. package/dist/schema/workflow-run-execution.js +48 -0
  83. package/dist/schema/workflow-run-launch-spec.d.ts +200 -0
  84. package/dist/schema/workflow-run-launch-spec.js +26 -0
  85. package/dist/schema/workflow-run.d.ts +230 -0
  86. package/dist/schema/workflow-run.js +102 -0
  87. package/dist/sidecar-allocation-store.d.ts +171 -0
  88. package/dist/sidecar-allocation-store.js +512 -0
  89. package/dist/signal-correlation-store.d.ts +36 -0
  90. package/dist/signal-correlation-store.js +63 -0
  91. package/dist/tenant-hierarchy.d.ts +23 -0
  92. package/dist/tenant-hierarchy.js +60 -0
  93. package/dist/workflow-definition-store.d.ts +55 -0
  94. package/dist/workflow-definition-store.js +93 -0
  95. package/dist/workflow-run-dispatch-store.d.ts +80 -0
  96. package/dist/workflow-run-dispatch-store.js +298 -0
  97. package/dist/workflow-run-launch-spec-store.d.ts +13 -0
  98. package/dist/workflow-run-launch-spec-store.js +30 -0
  99. package/dist/workflow-run-store.d.ts +54 -0
  100. package/dist/workflow-run-store.js +85 -0
  101. package/migrations/0029_loose_warlock.sql +1 -0
  102. package/migrations/0030_session_asset_audit_split.sql +5 -0
  103. package/migrations/0031_gigantic_nicolaos.sql +68 -0
  104. package/migrations/0032_lethal_misty_knight.sql +1 -0
  105. package/migrations/0033_old_payback.sql +1 -0
  106. package/migrations/0034_sleepy_songbird.sql +11 -0
  107. package/migrations/0035_violet_giant_man.sql +3 -0
  108. package/migrations/0036_sharp_the_executioner.sql +2 -0
  109. package/migrations/0037_credential_use_backfill.sql +39 -0
  110. package/migrations/0038_chilly_blacklash.sql +37 -0
  111. package/migrations/0039_quick_carnage.sql +2 -0
  112. package/migrations/0040_reshape_approval_origin.sql +24 -0
  113. package/migrations/0041_make_approval_timeout_at_nullable.sql +1 -0
  114. package/migrations/0042_youthful_mantis.sql +2 -0
  115. package/migrations/0043_signal_correlation_deployment_fk.sql +1 -0
  116. package/migrations/0044_model_offering_quirks.sql +1 -0
  117. package/migrations/0045_create_workflow_run.sql +13 -0
  118. package/migrations/0046_approval_signal_correlation_run_fk.sql +2 -0
  119. package/migrations/0047_create_workflow_definition.sql +30 -0
  120. package/migrations/0048_workflow_definition_origin_agent_id.sql +2 -0
  121. package/migrations/0049_curly_omega_flight.sql +2 -0
  122. package/migrations/0050_late_crystal.sql +10 -0
  123. package/migrations/0051_funny_madelyne_pryor.sql +1 -0
  124. package/migrations/0052_drop_inference_turn_instance_fk.sql +1 -0
  125. package/migrations/0053_session_mail_session_id_index.sql +1 -0
  126. package/migrations/0054_rekey_instance_grants_to_workflow_run.sql +10 -0
  127. package/migrations/0055_backfill_anchor_workflow_runs.sql +69 -0
  128. package/migrations/0056_repoint_deployment_fks_to_anchor_run.sql +32 -0
  129. package/migrations/0057_drop_workflow_deployment_projection.sql +22 -0
  130. package/migrations/0058_repoint_offering_fk_to_definition.sql +41 -0
  131. package/migrations/0059_repoint_transaction_fk_to_run.sql +10 -0
  132. package/migrations/0060_drop_session_mail_instance_fk.sql +6 -0
  133. package/migrations/0061_drop_session_asset_instance_fk.sql +7 -0
  134. package/migrations/0062_drop_agent_asset_table.sql +11 -0
  135. package/migrations/0063_repoint_agent_role_fk_to_definition.sql +39 -0
  136. package/migrations/0064_repoint_agent_session_fk_to_definition.sql +47 -0
  137. package/migrations/0065_add_workflow_definition_model_requirements.sql +37 -0
  138. package/migrations/0066_rekey_agent_definition_principals_to_workflow.sql +27 -0
  139. package/migrations/0067_add_workflow_definition_kind.sql +10 -0
  140. package/migrations/0068_drop_agent_tables_and_origin_agent_id.sql +31 -0
  141. package/migrations/0069_drop_workflow_definition_kind.sql +10 -0
  142. package/migrations/0070_flashy_proteus.sql +13 -0
  143. package/migrations/0072_add_workflow_definition_credential_bindings.sql +1 -0
  144. package/migrations/0073_grant_target_exactly_one_check.sql +13 -0
  145. package/migrations/0074_add_provider_api_base_url.sql +1 -0
  146. package/migrations/0075_workflow_run_launch_spec.sql +17 -0
  147. package/migrations/0076_sidecar_allocation.sql +40 -0
  148. package/migrations/0077_workflow_run_dispatch.sql +29 -0
  149. package/migrations/0078_workflow_run_dispatch_kind.sql +2 -0
  150. package/migrations/0079_rename_workflow_run_deployment_id_to_anchor_run_id.sql +4 -0
  151. package/migrations/0080_rename_correlation_approval_deployment_id_to_anchor_run_id.sql +9 -0
  152. package/migrations/0081_workflow_definition_content_hash_and_approved_wire_hash.sql +4 -0
  153. package/migrations/0082_blue_black_queen.sql +1 -0
  154. package/migrations/0083_replace_launch_spec_snapshot_with_frozen_bundle.sql +3 -0
  155. package/migrations/0084_delete_orphaned_credential_grants.sql +22 -0
  156. package/migrations/meta/0029_snapshot.json +2664 -0
  157. package/migrations/meta/0030_snapshot.json +2670 -0
  158. package/migrations/meta/0031_snapshot.json +3100 -0
  159. package/migrations/meta/0032_snapshot.json +3106 -0
  160. package/migrations/meta/0033_snapshot.json +3112 -0
  161. package/migrations/meta/0034_snapshot.json +3198 -0
  162. package/migrations/meta/0035_snapshot.json +3225 -0
  163. package/migrations/meta/0036_snapshot.json +3237 -0
  164. package/migrations/meta/0037_snapshot.json +3237 -0
  165. package/migrations/meta/0038_snapshot.json +3470 -0
  166. package/migrations/meta/0039_snapshot.json +3470 -0
  167. package/migrations/meta/0040_snapshot.json +3489 -0
  168. package/migrations/meta/0041_snapshot.json +3489 -0
  169. package/migrations/meta/0042_snapshot.json +3489 -0
  170. package/migrations/meta/0043_snapshot.json +3498 -0
  171. package/migrations/meta/0044_snapshot.json +3504 -0
  172. package/migrations/meta/0045_snapshot.json +3589 -0
  173. package/migrations/meta/0046_snapshot.json +3607 -0
  174. package/migrations/meta/0047_snapshot.json +3832 -0
  175. package/migrations/meta/0048_snapshot.json +3853 -0
  176. package/migrations/meta/0049_snapshot.json +3854 -0
  177. package/migrations/meta/0050_snapshot.json +3924 -0
  178. package/migrations/meta/0051_snapshot.json +3940 -0
  179. package/migrations/meta/0052_snapshot.json +3931 -0
  180. package/migrations/meta/0053_snapshot.json +3952 -0
  181. package/migrations/meta/0054_snapshot.json +3952 -0
  182. package/migrations/meta/0055_snapshot.json +3952 -0
  183. package/migrations/meta/0056_snapshot.json +3952 -0
  184. package/migrations/meta/0057_snapshot.json +3839 -0
  185. package/migrations/meta/0058_snapshot.json +3839 -0
  186. package/migrations/meta/0059_snapshot.json +3839 -0
  187. package/migrations/meta/0060_snapshot.json +3830 -0
  188. package/migrations/meta/0061_snapshot.json +3821 -0
  189. package/migrations/meta/0062_snapshot.json +3723 -0
  190. package/migrations/meta/0063_snapshot.json +3723 -0
  191. package/migrations/meta/0064_snapshot.json +3723 -0
  192. package/migrations/meta/0065_snapshot.json +3729 -0
  193. package/migrations/meta/0066_snapshot.json +3729 -0
  194. package/migrations/meta/0067_snapshot.json +3736 -0
  195. package/migrations/meta/0068_snapshot.json +3347 -0
  196. package/migrations/meta/0069_snapshot.json +3340 -0
  197. package/migrations/meta/0070_snapshot.json +3444 -0
  198. package/migrations/meta/0072_snapshot.json +3450 -0
  199. package/migrations/meta/0073_snapshot.json +3455 -0
  200. package/migrations/meta/0074_snapshot.json +3461 -0
  201. package/migrations/meta/0075_snapshot.json +3567 -0
  202. package/migrations/meta/0076_snapshot.json +3851 -0
  203. package/migrations/meta/0077_snapshot.json +4067 -0
  204. package/migrations/meta/0078_snapshot.json +4078 -0
  205. package/migrations/meta/0079_snapshot.json +4078 -0
  206. package/migrations/meta/0080_snapshot.json +4078 -0
  207. package/migrations/meta/0081_snapshot.json +4096 -0
  208. package/migrations/meta/0082_snapshot.json +4102 -0
  209. package/migrations/meta/0083_snapshot.json +4096 -0
  210. package/migrations/meta/0084_snapshot.json +4096 -0
  211. package/migrations/meta/_journal.json +385 -0
  212. package/package.json +25 -11
  213. package/drizzle.config.ts +0 -23
  214. package/src/client.ts +0 -24
  215. package/src/config.ts +0 -19
  216. package/src/connection.ts +0 -27
  217. package/src/credential-resolution.ts +0 -378
  218. package/src/grant-store.ts +0 -51
  219. package/src/index.ts +0 -32
  220. package/src/migrate.test.ts +0 -35
  221. package/src/migrate.ts +0 -168
  222. package/src/parse-row.test.ts +0 -113
  223. package/src/parse-row.ts +0 -185
  224. package/src/schema/agent-assets.ts +0 -21
  225. package/src/schema/agents.ts +0 -49
  226. package/src/schema/auth.ts +0 -51
  227. package/src/schema/grants.ts +0 -26
  228. package/src/schema/index.ts +0 -19
  229. package/src/schema/instances.ts +0 -36
  230. package/src/schema/messages.ts +0 -108
  231. package/src/schema/offerings.ts +0 -20
  232. package/src/schema/principals.ts +0 -28
  233. package/src/schema/providers.ts +0 -23
  234. package/src/schema/roles.ts +0 -51
  235. package/src/schema/session-assets.ts +0 -49
  236. package/src/schema/sessions.ts +0 -26
  237. package/src/schema/sidecar.ts +0 -14
  238. package/src/schema/wallets.ts +0 -44
  239. package/src/tenant-hierarchy.ts +0 -34
  240. package/tsconfig.json +0 -4
  241. package/tsconfig.tsbuildinfo +0 -1
@@ -204,6 +204,391 @@
204
204
  "when": 1780502952568,
205
205
  "tag": "0028_wet_sugar_man",
206
206
  "breakpoints": true
207
+ },
208
+ {
209
+ "idx": 29,
210
+ "version": "7",
211
+ "when": 1780694869983,
212
+ "tag": "0029_loose_warlock",
213
+ "breakpoints": true
214
+ },
215
+ {
216
+ "idx": 30,
217
+ "version": "7",
218
+ "when": 1780899731435,
219
+ "tag": "0030_session_asset_audit_split",
220
+ "breakpoints": true
221
+ },
222
+ {
223
+ "idx": 31,
224
+ "version": "7",
225
+ "when": 1781823077761,
226
+ "tag": "0031_gigantic_nicolaos",
227
+ "breakpoints": true
228
+ },
229
+ {
230
+ "idx": 32,
231
+ "version": "7",
232
+ "when": 1781837038055,
233
+ "tag": "0032_lethal_misty_knight",
234
+ "breakpoints": true
235
+ },
236
+ {
237
+ "idx": 33,
238
+ "version": "7",
239
+ "when": 1781838311284,
240
+ "tag": "0033_old_payback",
241
+ "breakpoints": true
242
+ },
243
+ {
244
+ "idx": 34,
245
+ "version": "7",
246
+ "when": 1782164862412,
247
+ "tag": "0034_sleepy_songbird",
248
+ "breakpoints": true
249
+ },
250
+ {
251
+ "idx": 35,
252
+ "version": "7",
253
+ "when": 1783373028980,
254
+ "tag": "0035_violet_giant_man",
255
+ "breakpoints": true
256
+ },
257
+ {
258
+ "idx": 36,
259
+ "version": "7",
260
+ "when": 1783998502613,
261
+ "tag": "0036_sharp_the_executioner",
262
+ "breakpoints": true
263
+ },
264
+ {
265
+ "idx": 37,
266
+ "version": "7",
267
+ "when": 1784193583232,
268
+ "tag": "0037_credential_use_backfill",
269
+ "breakpoints": true
270
+ },
271
+ {
272
+ "idx": 38,
273
+ "version": "7",
274
+ "when": 1784229989017,
275
+ "tag": "0038_chilly_blacklash",
276
+ "breakpoints": true
277
+ },
278
+ {
279
+ "idx": 39,
280
+ "version": "7",
281
+ "when": 1784262044343,
282
+ "tag": "0039_quick_carnage",
283
+ "breakpoints": true
284
+ },
285
+ {
286
+ "idx": 40,
287
+ "version": "7",
288
+ "when": 1784290369159,
289
+ "tag": "0040_reshape_approval_origin",
290
+ "breakpoints": true
291
+ },
292
+ {
293
+ "idx": 41,
294
+ "version": "7",
295
+ "when": 1784291992954,
296
+ "tag": "0041_make_approval_timeout_at_nullable",
297
+ "breakpoints": true
298
+ },
299
+ {
300
+ "idx": 42,
301
+ "version": "7",
302
+ "when": 1784385053475,
303
+ "tag": "0042_youthful_mantis",
304
+ "breakpoints": true
305
+ },
306
+ {
307
+ "idx": 43,
308
+ "version": "7",
309
+ "when": 1784574028729,
310
+ "tag": "0043_signal_correlation_deployment_fk",
311
+ "breakpoints": true
312
+ },
313
+ {
314
+ "idx": 44,
315
+ "version": "7",
316
+ "when": 1784647908094,
317
+ "tag": "0044_model_offering_quirks",
318
+ "breakpoints": true
319
+ },
320
+ {
321
+ "idx": 45,
322
+ "version": "7",
323
+ "when": 1784683821134,
324
+ "tag": "0045_create_workflow_run",
325
+ "breakpoints": true
326
+ },
327
+ {
328
+ "idx": 46,
329
+ "version": "7",
330
+ "when": 1784685004809,
331
+ "tag": "0046_approval_signal_correlation_run_fk",
332
+ "breakpoints": true
333
+ },
334
+ {
335
+ "idx": 47,
336
+ "version": "7",
337
+ "when": 1784837465838,
338
+ "tag": "0047_create_workflow_definition",
339
+ "breakpoints": true
340
+ },
341
+ {
342
+ "idx": 48,
343
+ "version": "7",
344
+ "when": 1784843439588,
345
+ "tag": "0048_workflow_definition_origin_agent_id",
346
+ "breakpoints": true
347
+ },
348
+ {
349
+ "idx": 49,
350
+ "version": "7",
351
+ "when": 1784874344480,
352
+ "tag": "0049_curly_omega_flight",
353
+ "breakpoints": true
354
+ },
355
+ {
356
+ "idx": 50,
357
+ "version": "7",
358
+ "when": 1784900369564,
359
+ "tag": "0050_late_crystal",
360
+ "breakpoints": true
361
+ },
362
+ {
363
+ "idx": 51,
364
+ "version": "7",
365
+ "when": 1784904262816,
366
+ "tag": "0051_funny_madelyne_pryor",
367
+ "breakpoints": true
368
+ },
369
+ {
370
+ "idx": 52,
371
+ "version": "7",
372
+ "when": 1784930942498,
373
+ "tag": "0052_drop_inference_turn_instance_fk",
374
+ "breakpoints": true
375
+ },
376
+ {
377
+ "idx": 53,
378
+ "version": "7",
379
+ "when": 1784937859340,
380
+ "tag": "0053_session_mail_session_id_index",
381
+ "breakpoints": true
382
+ },
383
+ {
384
+ "idx": 54,
385
+ "version": "7",
386
+ "when": 1784954863099,
387
+ "tag": "0054_rekey_instance_grants_to_workflow_run",
388
+ "breakpoints": true
389
+ },
390
+ {
391
+ "idx": 55,
392
+ "version": "7",
393
+ "when": 1785022747684,
394
+ "tag": "0055_backfill_anchor_workflow_runs",
395
+ "breakpoints": true
396
+ },
397
+ {
398
+ "idx": 56,
399
+ "version": "7",
400
+ "when": 1785077765166,
401
+ "tag": "0056_repoint_deployment_fks_to_anchor_run",
402
+ "breakpoints": true
403
+ },
404
+ {
405
+ "idx": 57,
406
+ "version": "7",
407
+ "when": 1785081029417,
408
+ "tag": "0057_drop_workflow_deployment_projection",
409
+ "breakpoints": true
410
+ },
411
+ {
412
+ "idx": 58,
413
+ "version": "7",
414
+ "when": 1785085643398,
415
+ "tag": "0058_repoint_offering_fk_to_definition",
416
+ "breakpoints": true
417
+ },
418
+ {
419
+ "idx": 59,
420
+ "version": "7",
421
+ "when": 1785087256544,
422
+ "tag": "0059_repoint_transaction_fk_to_run",
423
+ "breakpoints": true
424
+ },
425
+ {
426
+ "idx": 60,
427
+ "version": "7",
428
+ "when": 1785089581427,
429
+ "tag": "0060_drop_session_mail_instance_fk",
430
+ "breakpoints": true
431
+ },
432
+ {
433
+ "idx": 61,
434
+ "version": "7",
435
+ "when": 1785089702623,
436
+ "tag": "0061_drop_session_asset_instance_fk",
437
+ "breakpoints": true
438
+ },
439
+ {
440
+ "idx": 62,
441
+ "version": "7",
442
+ "when": 1785165557463,
443
+ "tag": "0062_drop_agent_asset_table",
444
+ "breakpoints": true
445
+ },
446
+ {
447
+ "idx": 63,
448
+ "version": "7",
449
+ "when": 1785167954461,
450
+ "tag": "0063_repoint_agent_role_fk_to_definition",
451
+ "breakpoints": true
452
+ },
453
+ {
454
+ "idx": 64,
455
+ "version": "7",
456
+ "when": 1785169484868,
457
+ "tag": "0064_repoint_agent_session_fk_to_definition",
458
+ "breakpoints": true
459
+ },
460
+ {
461
+ "idx": 65,
462
+ "version": "7",
463
+ "when": 1785179839765,
464
+ "tag": "0065_add_workflow_definition_model_requirements",
465
+ "breakpoints": true
466
+ },
467
+ {
468
+ "idx": 66,
469
+ "version": "7",
470
+ "when": 1785280000000,
471
+ "tag": "0066_rekey_agent_definition_principals_to_workflow",
472
+ "breakpoints": true
473
+ },
474
+ {
475
+ "idx": 67,
476
+ "version": "7",
477
+ "when": 1785400000000,
478
+ "tag": "0067_add_workflow_definition_kind",
479
+ "breakpoints": true
480
+ },
481
+ {
482
+ "idx": 68,
483
+ "version": "7",
484
+ "when": 1785500000000,
485
+ "tag": "0068_drop_agent_tables_and_origin_agent_id",
486
+ "breakpoints": true
487
+ },
488
+ {
489
+ "idx": 69,
490
+ "version": "7",
491
+ "when": 1785337102704,
492
+ "tag": "0069_drop_workflow_definition_kind",
493
+ "breakpoints": true
494
+ },
495
+ {
496
+ "idx": 70,
497
+ "version": "7",
498
+ "when": 1785519721882,
499
+ "tag": "0070_flashy_proteus",
500
+ "breakpoints": true
501
+ },
502
+ {
503
+ "idx": 72,
504
+ "version": "7",
505
+ "when": 1785788422511,
506
+ "tag": "0072_add_workflow_definition_credential_bindings",
507
+ "breakpoints": true
508
+ },
509
+ {
510
+ "idx": 73,
511
+ "version": "7",
512
+ "when": 1785791424774,
513
+ "tag": "0073_grant_target_exactly_one_check",
514
+ "breakpoints": true
515
+ },
516
+ {
517
+ "idx": 74,
518
+ "version": "7",
519
+ "when": 1785884353793,
520
+ "tag": "0074_add_provider_api_base_url",
521
+ "breakpoints": true
522
+ },
523
+ {
524
+ "idx": 75,
525
+ "version": "7",
526
+ "when": 1786055554289,
527
+ "tag": "0075_workflow_run_launch_spec",
528
+ "breakpoints": true
529
+ },
530
+ {
531
+ "idx": 76,
532
+ "version": "7",
533
+ "when": 1786055582673,
534
+ "tag": "0076_sidecar_allocation",
535
+ "breakpoints": true
536
+ },
537
+ {
538
+ "idx": 77,
539
+ "version": "7",
540
+ "when": 1786055601046,
541
+ "tag": "0077_workflow_run_dispatch",
542
+ "breakpoints": true
543
+ },
544
+ {
545
+ "idx": 78,
546
+ "version": "7",
547
+ "when": 1786055642946,
548
+ "tag": "0078_workflow_run_dispatch_kind",
549
+ "breakpoints": true
550
+ },
551
+ {
552
+ "idx": 79,
553
+ "version": "7",
554
+ "when": 1786480852752,
555
+ "tag": "0079_rename_workflow_run_deployment_id_to_anchor_run_id",
556
+ "breakpoints": true
557
+ },
558
+ {
559
+ "idx": 80,
560
+ "version": "7",
561
+ "when": 1786481000000,
562
+ "tag": "0080_rename_correlation_approval_deployment_id_to_anchor_run_id",
563
+ "breakpoints": true
564
+ },
565
+ {
566
+ "idx": 81,
567
+ "version": "7",
568
+ "when": 1786665226312,
569
+ "tag": "0081_workflow_definition_content_hash_and_approved_wire_hash",
570
+ "breakpoints": true
571
+ },
572
+ {
573
+ "idx": 82,
574
+ "version": "7",
575
+ "when": 1787066175571,
576
+ "tag": "0082_blue_black_queen",
577
+ "breakpoints": true
578
+ },
579
+ {
580
+ "idx": 83,
581
+ "version": "7",
582
+ "when": 1787096121244,
583
+ "tag": "0083_replace_launch_spec_snapshot_with_frozen_bundle",
584
+ "breakpoints": true
585
+ },
586
+ {
587
+ "idx": 84,
588
+ "version": "7",
589
+ "when": 1787169492000,
590
+ "tag": "0084_delete_orphaned_credential_grants",
591
+ "breakpoints": true
207
592
  }
208
593
  ]
209
594
  }
package/package.json CHANGED
@@ -1,27 +1,41 @@
1
1
  {
2
2
  "name": "@intx/db",
3
- "version": "0.1.2",
3
+ "description": "Client, schema, migrations, and row parsers for the hub's PostgreSQL database",
4
+ "version": "0.3.0",
4
5
  "license": "LGPL-2.1-only",
5
6
  "type": "module",
6
7
  "exports": {
7
8
  ".": {
8
- "types": "./src/index.ts",
9
- "default": "./src/index.ts"
9
+ "intx-src": "./src/index.ts",
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
10
12
  },
11
13
  "./schema": {
12
- "types": "./src/schema/index.ts",
13
- "default": "./src/schema/index.ts"
14
+ "intx-src": "./src/schema/index.ts",
15
+ "types": "./dist/schema/index.d.ts",
16
+ "default": "./dist/schema/index.js"
14
17
  }
15
18
  },
16
- "scripts": {
17
- "db:generate": "drizzle-kit generate --config=drizzle.config.ts",
18
- "db:migrate": "drizzle-kit migrate --config=drizzle.config.ts"
19
- },
20
19
  "dependencies": {
21
- "@intx/log": "0.0.0",
22
- "@intx/types": "0.0.0",
20
+ "@intx/authz": "0.3.0",
21
+ "@intx/crypto": "0.3.0",
22
+ "@intx/log": "0.3.0",
23
+ "@intx/types": "0.3.0",
23
24
  "arktype": "^2.1.29",
24
25
  "drizzle-orm": "^0.45.1",
25
26
  "postgres": "^3.4.8"
27
+ },
28
+ "devDependencies": {
29
+ "drizzle-kit": "^0.31.9"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "migrations",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "sideEffects": false,
38
+ "publishConfig": {
39
+ "access": "public"
26
40
  }
27
41
  }
package/drizzle.config.ts DELETED
@@ -1,23 +0,0 @@
1
- import { defineConfig } from "drizzle-kit";
2
-
3
- function env(name: string): string {
4
- const value = process.env[name];
5
- if (!value) {
6
- throw new Error(`Missing required environment variable: ${name}`);
7
- }
8
- return value;
9
- }
10
-
11
- export default defineConfig({
12
- dialect: "postgresql",
13
- schema: "./src/schema/index.ts",
14
- out: "./migrations",
15
- dbCredentials: {
16
- host: env("DB_HOST"),
17
- port: Number(process.env["DB_PORT"] ?? 5432),
18
- user: env("DB_USER"),
19
- password: process.env["DB_PASSWORD"] ?? "",
20
- database: env("DB_NAME"),
21
- ssl: process.env["DB_SSL"] === "true",
22
- },
23
- });
package/src/client.ts DELETED
@@ -1,24 +0,0 @@
1
- import { type } from "arktype";
2
- import { drizzle } from "drizzle-orm/postgres-js";
3
-
4
- import { DBConfig } from "./config";
5
- import { createConnection } from "./connection";
6
- import * as schema from "./schema";
7
-
8
- export function createDB(raw: unknown) {
9
- const config = DBConfig(raw);
10
- if (config instanceof type.errors) {
11
- throw new Error(`Invalid database config: ${config.summary}`);
12
- }
13
-
14
- const sql = createConnection(config);
15
- const db = drizzle(sql, { schema });
16
-
17
- return {
18
- db,
19
- transaction: db.transaction.bind(db),
20
- close: () => sql.end(),
21
- };
22
- }
23
-
24
- export type DB = ReturnType<typeof createDB>;
package/src/config.ts DELETED
@@ -1,19 +0,0 @@
1
- import { type } from "arktype";
2
-
3
- export const DBConfig = type({
4
- host: "string",
5
- port: "number.integer > 0",
6
- user: "string",
7
- password: "string",
8
- database: "string",
9
- "ssl?": "boolean",
10
- "max?": "number.integer > 0",
11
- // Postgres schema name. When set, the connection's `search_path` is
12
- // pinned to this schema and migrations apply into it. This is the
13
- // mechanism the integration-test harness uses to give each spawned
14
- // hub a dedicated, droppable schema. When unset, the connection uses
15
- // postgres' default `search_path` (which begins with `public`).
16
- "schema?": "string",
17
- });
18
-
19
- export type DBConfig = typeof DBConfig.infer;
package/src/connection.ts DELETED
@@ -1,27 +0,0 @@
1
- import postgres from "postgres";
2
-
3
- import type { DBConfig } from "./config";
4
-
5
- function quoteIdentifier(name: string): string {
6
- return `"${name.replace(/"/g, '""')}"`;
7
- }
8
-
9
- export function createConnection(config: DBConfig) {
10
- return postgres({
11
- host: config.host,
12
- port: config.port,
13
- user: config.user,
14
- password: config.password,
15
- database: config.database,
16
- max: config.max ?? 10,
17
- ...(config.ssl !== undefined && { ssl: config.ssl }),
18
- ...(config.schema !== undefined && {
19
- // Pin the connection's search_path so unqualified table
20
- // references resolve to the caller's schema. The migration
21
- // runner emits SQL with the schema baked into FK references,
22
- // but ORM-issued queries bind table names without a schema
23
- // qualifier and rely on this setting.
24
- connection: { search_path: quoteIdentifier(config.schema) },
25
- }),
26
- });
27
- }