@hot-updater/server 0.30.12 → 0.31.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 (165) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +25 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +6 -0
  3. package/dist/adapters/drizzle.cjs +6 -9
  4. package/dist/adapters/drizzle.d.cts +8 -1
  5. package/dist/adapters/drizzle.d.mts +8 -1
  6. package/dist/adapters/drizzle.mjs +5 -2
  7. package/dist/adapters/kysely.cjs +7 -9
  8. package/dist/adapters/kysely.d.cts +14 -1
  9. package/dist/adapters/kysely.d.mts +14 -1
  10. package/dist/adapters/kysely.mjs +6 -2
  11. package/dist/adapters/mongodb.cjs +7 -9
  12. package/dist/adapters/mongodb.d.cts +9 -1
  13. package/dist/adapters/mongodb.d.mts +9 -1
  14. package/dist/adapters/mongodb.mjs +5 -2
  15. package/dist/adapters/prisma.cjs +6 -9
  16. package/dist/adapters/prisma.d.cts +8 -1
  17. package/dist/adapters/prisma.d.mts +8 -1
  18. package/dist/adapters/prisma.mjs +5 -2
  19. package/dist/db/createBundleDiff.cjs +166 -0
  20. package/dist/db/createBundleDiff.d.cts +20 -0
  21. package/dist/db/createBundleDiff.d.mts +20 -0
  22. package/dist/db/createBundleDiff.mjs +161 -0
  23. package/dist/db/index.cjs +15 -16
  24. package/dist/db/index.d.cts +5 -4
  25. package/dist/db/index.d.mts +5 -4
  26. package/dist/db/index.mjs +14 -16
  27. package/dist/db/ormCore.cjs +173 -65
  28. package/dist/db/ormCore.d.cts +100 -34
  29. package/dist/db/ormCore.d.mts +100 -34
  30. package/dist/db/ormCore.mjs +171 -64
  31. package/dist/db/pluginCore.cjs +37 -3
  32. package/dist/db/pluginCore.mjs +36 -3
  33. package/dist/db/schemaEnhancements.cjs +171 -0
  34. package/dist/db/schemaEnhancements.mjs +167 -0
  35. package/dist/db/types.cjs +6 -0
  36. package/dist/db/types.d.cts +19 -7
  37. package/dist/db/types.d.mts +22 -10
  38. package/dist/db/types.mjs +6 -1
  39. package/dist/db/updateArtifacts.cjs +127 -0
  40. package/dist/db/updateArtifacts.mjs +125 -0
  41. package/dist/handler.cjs +61 -5
  42. package/dist/handler.d.cts +2 -2
  43. package/dist/handler.d.mts +5 -5
  44. package/dist/handler.mjs +59 -5
  45. package/dist/index.cjs +2 -0
  46. package/dist/index.d.cts +3 -2
  47. package/dist/index.d.mts +3 -2
  48. package/dist/index.mjs +2 -1
  49. package/dist/node.d.cts +0 -1
  50. package/dist/node.d.mts +0 -1
  51. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.cjs +112 -0
  52. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.mjs +108 -0
  53. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.cjs +22 -0
  54. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.mjs +18 -0
  55. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.cjs +219 -0
  56. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.mjs +214 -0
  57. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.cjs +275 -0
  58. package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.mjs +270 -0
  59. package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.cjs +17 -0
  60. package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.mjs +13 -0
  61. package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.cjs +69 -0
  62. package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.mjs +65 -0
  63. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/column.cjs +52 -0
  64. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/column.mjs +52 -0
  65. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/entity.cjs +16 -0
  66. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/entity.mjs +15 -0
  67. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/pg-core/columns/enum.cjs +7 -0
  68. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/pg-core/columns/enum.mjs +7 -0
  69. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/conditions.cjs +92 -0
  70. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/conditions.mjs +78 -0
  71. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/select.cjs +11 -0
  72. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/select.mjs +10 -0
  73. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/sql.cjs +383 -0
  74. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/sql.mjs +366 -0
  75. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/subquery.cjs +17 -0
  76. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/subquery.mjs +17 -0
  77. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.cjs +60 -0
  78. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.mjs +59 -0
  79. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.utils.cjs +4 -0
  80. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.utils.mjs +4 -0
  81. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/tracing.cjs +6 -0
  82. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/tracing.mjs +6 -0
  83. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/view-common.cjs +4 -0
  84. package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/view-common.mjs +4 -0
  85. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.cjs +383 -0
  86. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.d.cts +12 -0
  87. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.d.mts +12 -0
  88. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.mjs +383 -0
  89. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/kysely/index.cjs +4 -0
  90. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/kysely/index.mjs +5 -0
  91. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.cjs +339 -0
  92. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.d.cts +70 -0
  93. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.d.mts +70 -0
  94. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.mjs +339 -0
  95. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-7PZK4ONR.cjs +57 -0
  96. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-7PZK4ONR.mjs +56 -0
  97. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-C6OTUURW.cjs +330 -0
  98. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-C6OTUURW.mjs +326 -0
  99. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-CHTIKPQU.cjs +166 -0
  100. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-CHTIKPQU.mjs +163 -0
  101. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-GUE4GMNC.cjs +14 -0
  102. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-GUE4GMNC.mjs +13 -0
  103. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LHHP6UVP.cjs +24 -0
  104. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LHHP6UVP.mjs +24 -0
  105. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LVCPMTAT.cjs +1190 -0
  106. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LVCPMTAT.mjs +1189 -0
  107. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-PK2W2SQ7.cjs +197 -0
  108. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-PK2W2SQ7.mjs +197 -0
  109. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.cjs +410 -0
  110. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.mjs +400 -0
  111. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZOCGSAWS.cjs +213 -0
  112. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZOCGSAWS.mjs +212 -0
  113. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/create-tg0451Y_.d.cts +285 -0
  114. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/create-tg0451Y_.d.mts +285 -0
  115. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index-CMqePMTF.d.cts +45 -0
  116. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index-CMqePMTF.d.mts +45 -0
  117. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.cjs +69 -0
  118. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.d.cts +49 -0
  119. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.d.mts +49 -0
  120. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.mjs +67 -0
  121. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/query/index.d.cts +156 -0
  122. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/query/index.d.mts +156 -0
  123. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.cjs +1 -0
  124. package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.mjs +2 -0
  125. package/dist/{package.cjs → packages/server/package.cjs} +1 -1
  126. package/dist/{package.mjs → packages/server/package.mjs} +1 -1
  127. package/dist/runtime.cjs +13 -13
  128. package/dist/runtime.d.cts +4 -4
  129. package/dist/runtime.d.mts +4 -4
  130. package/dist/runtime.mjs +12 -13
  131. package/dist/schema/v0_21_0.cjs +16 -15
  132. package/dist/schema/v0_21_0.mjs +3 -2
  133. package/dist/schema/v0_29_0.cjs +18 -17
  134. package/dist/schema/v0_29_0.mjs +3 -2
  135. package/dist/schema/v0_31_0.cjs +48 -0
  136. package/dist/schema/v0_31_0.mjs +48 -0
  137. package/dist/storageAccess.cjs +44 -0
  138. package/dist/storageAccess.mjs +44 -0
  139. package/dist/version.cjs +1 -1
  140. package/dist/version.mjs +1 -1
  141. package/package.json +15 -7
  142. package/src/adapters/drizzle.ts +15 -1
  143. package/src/adapters/kysely.ts +24 -1
  144. package/src/adapters/mongodb.ts +19 -1
  145. package/src/adapters/prisma.ts +15 -1
  146. package/src/db/createBundleDiff.spec.ts +402 -0
  147. package/src/db/createBundleDiff.ts +375 -0
  148. package/src/db/index.spec.ts +528 -27
  149. package/src/db/index.ts +22 -36
  150. package/src/db/ormCore.ts +308 -75
  151. package/src/db/pluginCore.spec.ts +385 -0
  152. package/src/db/pluginCore.ts +45 -4
  153. package/src/db/schemaEnhancements.ts +460 -0
  154. package/src/db/types.ts +38 -7
  155. package/src/db/updateArtifacts.ts +388 -0
  156. package/src/handler-standalone.integration.spec.ts +1 -0
  157. package/src/handler.spec.ts +121 -0
  158. package/src/handler.ts +117 -5
  159. package/src/runtime.spec.ts +287 -55
  160. package/src/runtime.ts +21 -37
  161. package/src/schema/v0_21_0.ts +1 -1
  162. package/src/schema/v0_29_0.ts +1 -1
  163. package/src/schema/v0_31_0.ts +58 -0
  164. package/src/storageAccess.spec.ts +57 -0
  165. package/src/storageAccess.ts +90 -0
@@ -0,0 +1,156 @@
1
+ import { AnyColumn, AnyRelation, AnySchema, AnyTable, IdColumn, Relation } from "../create-tg0451Y_.cjs";
2
+
3
+ //#region ../../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare+workers-types@4.20260313.1_@electric-sql+pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/query/index.d.ts
4
+ declare enum ConditionType {
5
+ And = 0,
6
+ Or = 1,
7
+ Compare = 2,
8
+ Not = 3
9
+ }
10
+ type Condition = {
11
+ type: ConditionType.Compare;
12
+ a: AnyColumn;
13
+ operator: Operator;
14
+ b: AnyColumn | unknown | null;
15
+ } | {
16
+ type: ConditionType.Or | ConditionType.And;
17
+ items: Condition[];
18
+ } | {
19
+ type: ConditionType.Not;
20
+ item: Condition;
21
+ };
22
+ type ConditionBuilder<Columns extends Record<string, AnyColumn>> = {
23
+ <ColName extends keyof Columns>(a: ColName, operator: (typeof valueOperators)[number] | (typeof stringOperators)[number], b: Columns[ColName]["$in"] | null): Condition;
24
+ <ColName extends keyof Columns>(a: ColName, operator: (typeof arrayOperators)[number], b: Columns[ColName]["$in"][]): Condition;
25
+ /**
26
+ * Boolean values
27
+ */
28
+ <ColName extends keyof Columns>(a: ColName): Condition;
29
+ and: (...v: (Condition | boolean)[]) => Condition | boolean;
30
+ or: (...v: (Condition | boolean)[]) => Condition | boolean;
31
+ not: (v: Condition | boolean) => Condition | boolean;
32
+ isNull: (a: keyof Columns) => Condition;
33
+ isNotNull: (a: keyof Columns) => Condition;
34
+ };
35
+ declare const stringOperators: readonly ["contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
36
+ declare const arrayOperators: readonly ["in", "not in"];
37
+ declare const valueOperators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not"];
38
+ declare const operators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not", "in", "not in", "contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
39
+ type Operator = (typeof operators)[number];
40
+ interface CompiledJoin {
41
+ relation: AnyRelation;
42
+ options: SimplifyFindOptions<FindManyOptions> | false;
43
+ }
44
+ interface SimplifiedCountOptions {
45
+ where?: Condition | undefined;
46
+ }
47
+ type SimplifyFindOptions<O> = Omit<O, "where" | "orderBy" | "select" | "join"> & {
48
+ select: AnySelectClause;
49
+ where?: Condition | undefined;
50
+ orderBy?: OrderBy<AnyColumn>[];
51
+ join?: CompiledJoin[];
52
+ };
53
+ interface ORMAdapter {
54
+ tables: Record<string, AnyTable>;
55
+ count: (table: AnyTable, v: SimplifiedCountOptions) => Promise<number>;
56
+ findFirst: (table: AnyTable, v: SimplifyFindOptions<FindFirstOptions>) => Promise<Record<string, unknown> | null>;
57
+ findMany: (table: AnyTable, v: SimplifyFindOptions<FindManyOptions>) => Promise<Record<string, unknown>[]>;
58
+ updateMany: (table: AnyTable, v: {
59
+ where?: Condition;
60
+ set: Record<string, unknown>;
61
+ }) => Promise<void>;
62
+ upsert: (table: AnyTable, v: {
63
+ where: Condition | undefined;
64
+ update: Record<string, unknown>;
65
+ create: Record<string, unknown>;
66
+ }) => Promise<void>;
67
+ create: (table: AnyTable, values: Record<string, unknown>) => Promise<Record<string, unknown>>;
68
+ createMany: (table: AnyTable, values: Record<string, unknown>[]) => Promise<{
69
+ _id: unknown;
70
+ }[]>;
71
+ deleteMany: (table: AnyTable, v: {
72
+ where?: Condition;
73
+ }) => Promise<void>;
74
+ /**
75
+ * Override this to support native transaction, otherwise use soft transaction.
76
+ */
77
+ transaction: <T>(run: (transactionInstance: AbstractQuery<AnySchema>) => Promise<T>) => Promise<T>;
78
+ }
79
+ type AnySelectClause = SelectClause<AnyTable>;
80
+ type SelectClause<T extends AnyTable> = true | (keyof T["columns"])[];
81
+ type TableToColumnValues<T extends AnyTable> = { [K in keyof T["columns"]]: T["columns"][K]["$out"] };
82
+ type PickNullable<T> = { [P in keyof T as null extends T[P] ? P : never]: T[P] };
83
+ type PickNotNullable<T> = { [P in keyof T as null extends T[P] ? never : P]: T[P] };
84
+ type TableToInsertValues<T extends AnyTable> = Partial<PickNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>> & PickNotNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>;
85
+ type TableToUpdateValues<T extends AnyTable> = { [K in keyof T["columns"]]?: T["columns"][K] extends IdColumn ? never : T["columns"][K]["$in"] };
86
+ type MainSelectResult<S extends SelectClause<T>, T extends AnyTable> = S extends true ? TableToColumnValues<T> : S extends (keyof T["columns"])[] ? Pick<TableToColumnValues<T>, S[number]> : never;
87
+ type JoinBuilder<T extends AnyTable, Out = {}> = { [K in keyof T["relations"]]: T["relations"][K] extends Relation<infer Type, infer Target> ? <Select extends SelectClause<Target> = true, JoinOut = {}>(options?: Type extends "many" ? FindManyOptions<Target, Select, JoinOut, false> : FindFirstOptions<Target, Select, JoinOut, false>) => JoinBuilder<T, Out & { [$K in K]: MapRelationType<SelectResult<Target, JoinOut, Select>, T["relations"][K]["implied"]>[Type] }> : never };
88
+ type SelectResult<T extends AnyTable, JoinOut, Select extends SelectClause<T>> = MainSelectResult<Select, T> & JoinOut;
89
+ type OrderBy<Column = string> = [columnName: Column, "asc" | "desc"];
90
+ type FindFirstOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = Omit<FindManyOptions<T, Select, JoinOut, IsRoot>, IsRoot extends true ? "limit" : "limit" | "offset" | "orderBy">;
91
+ interface MapRelationType<Type, Implied extends boolean> {
92
+ one: Implied extends true ? Type | null : Type;
93
+ many: Type[];
94
+ }
95
+ type FindManyOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = {
96
+ select?: Select;
97
+ where?: (eb: ConditionBuilder<T["columns"]>) => Condition | boolean;
98
+ limit?: number;
99
+ orderBy?: OrderBy<keyof T["columns"]> | OrderBy<keyof T["columns"]>[];
100
+ join?: (builder: JoinBuilder<T, {}>) => JoinBuilder<T, JoinOut>;
101
+ } & (IsRoot extends true ? {
102
+ offset?: number;
103
+ } : {});
104
+ interface AbstractQuery<S extends AnySchema> {
105
+ internal: ORMAdapter;
106
+ /**
107
+ * The code in the transaction will receive a transaction query instance.
108
+ *
109
+ * If you use that instance to write the database (e.g. insert) and an error is thrown, FumaDB will automatically rollback the changes + rethrow the error.
110
+ *
111
+ * It works by using the transaction API that's natively available for the database/ORM, or falling back to the soft transaction layer built by FumaDB.
112
+ */
113
+ transaction: <T>(run: (orm: AbstractQuery<S>) => Promise<T>) => Promise<T>;
114
+ /**
115
+ * Count (all)
116
+ */
117
+ count: <TableName extends keyof S["tables"]>(table: TableName, v?: {
118
+ where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
119
+ }) => Promise<number>;
120
+ findFirst: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v: FindFirstOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select> | null>;
121
+ findMany: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v?: FindManyOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select>[]>;
122
+ /**
123
+ * Upsert a **single row**.
124
+ *
125
+ * For ORMs:
126
+ * - use built-in method whenever possible.
127
+ *
128
+ * Otherwise:
129
+ * - run `update`.
130
+ * - if updated zero rows, run `create`.
131
+ */
132
+ upsert: <TableName extends keyof S["tables"]>(table: TableName, v: {
133
+ where: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
134
+ update: TableToUpdateValues<S["tables"][TableName]>;
135
+ create: TableToInsertValues<S["tables"][TableName]>;
136
+ }) => Promise<void>;
137
+ /**
138
+ * Note: you cannot update the id of a row, some databases don't support that (including MongoDB).
139
+ */
140
+ updateMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
141
+ where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
142
+ set: TableToUpdateValues<S["tables"][TableName]>;
143
+ }) => Promise<void>;
144
+ createMany: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>[]) => Promise<{
145
+ _id: string;
146
+ }[]>;
147
+ /**
148
+ * Note: when you don't need to receive the result, always use `createMany` for better performance.
149
+ */
150
+ create: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>) => Promise<TableToColumnValues<S["tables"][TableName]>>;
151
+ deleteMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
152
+ where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
153
+ }) => Promise<void>;
154
+ }
155
+ //#endregion
156
+ export { type AbstractQuery };
@@ -0,0 +1,156 @@
1
+ import { AnyColumn, AnyRelation, AnySchema, AnyTable, IdColumn, Relation } from "../create-tg0451Y_.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare+workers-types@4.20260313.1_@electric-sql+pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/query/index.d.ts
4
+ declare enum ConditionType {
5
+ And = 0,
6
+ Or = 1,
7
+ Compare = 2,
8
+ Not = 3
9
+ }
10
+ type Condition = {
11
+ type: ConditionType.Compare;
12
+ a: AnyColumn;
13
+ operator: Operator;
14
+ b: AnyColumn | unknown | null;
15
+ } | {
16
+ type: ConditionType.Or | ConditionType.And;
17
+ items: Condition[];
18
+ } | {
19
+ type: ConditionType.Not;
20
+ item: Condition;
21
+ };
22
+ type ConditionBuilder<Columns extends Record<string, AnyColumn>> = {
23
+ <ColName extends keyof Columns>(a: ColName, operator: (typeof valueOperators)[number] | (typeof stringOperators)[number], b: Columns[ColName]["$in"] | null): Condition;
24
+ <ColName extends keyof Columns>(a: ColName, operator: (typeof arrayOperators)[number], b: Columns[ColName]["$in"][]): Condition;
25
+ /**
26
+ * Boolean values
27
+ */
28
+ <ColName extends keyof Columns>(a: ColName): Condition;
29
+ and: (...v: (Condition | boolean)[]) => Condition | boolean;
30
+ or: (...v: (Condition | boolean)[]) => Condition | boolean;
31
+ not: (v: Condition | boolean) => Condition | boolean;
32
+ isNull: (a: keyof Columns) => Condition;
33
+ isNotNull: (a: keyof Columns) => Condition;
34
+ };
35
+ declare const stringOperators: readonly ["contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
36
+ declare const arrayOperators: readonly ["in", "not in"];
37
+ declare const valueOperators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not"];
38
+ declare const operators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not", "in", "not in", "contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
39
+ type Operator = (typeof operators)[number];
40
+ interface CompiledJoin {
41
+ relation: AnyRelation;
42
+ options: SimplifyFindOptions<FindManyOptions> | false;
43
+ }
44
+ interface SimplifiedCountOptions {
45
+ where?: Condition | undefined;
46
+ }
47
+ type SimplifyFindOptions<O> = Omit<O, "where" | "orderBy" | "select" | "join"> & {
48
+ select: AnySelectClause;
49
+ where?: Condition | undefined;
50
+ orderBy?: OrderBy<AnyColumn>[];
51
+ join?: CompiledJoin[];
52
+ };
53
+ interface ORMAdapter {
54
+ tables: Record<string, AnyTable>;
55
+ count: (table: AnyTable, v: SimplifiedCountOptions) => Promise<number>;
56
+ findFirst: (table: AnyTable, v: SimplifyFindOptions<FindFirstOptions>) => Promise<Record<string, unknown> | null>;
57
+ findMany: (table: AnyTable, v: SimplifyFindOptions<FindManyOptions>) => Promise<Record<string, unknown>[]>;
58
+ updateMany: (table: AnyTable, v: {
59
+ where?: Condition;
60
+ set: Record<string, unknown>;
61
+ }) => Promise<void>;
62
+ upsert: (table: AnyTable, v: {
63
+ where: Condition | undefined;
64
+ update: Record<string, unknown>;
65
+ create: Record<string, unknown>;
66
+ }) => Promise<void>;
67
+ create: (table: AnyTable, values: Record<string, unknown>) => Promise<Record<string, unknown>>;
68
+ createMany: (table: AnyTable, values: Record<string, unknown>[]) => Promise<{
69
+ _id: unknown;
70
+ }[]>;
71
+ deleteMany: (table: AnyTable, v: {
72
+ where?: Condition;
73
+ }) => Promise<void>;
74
+ /**
75
+ * Override this to support native transaction, otherwise use soft transaction.
76
+ */
77
+ transaction: <T>(run: (transactionInstance: AbstractQuery<AnySchema>) => Promise<T>) => Promise<T>;
78
+ }
79
+ type AnySelectClause = SelectClause<AnyTable>;
80
+ type SelectClause<T extends AnyTable> = true | (keyof T["columns"])[];
81
+ type TableToColumnValues<T extends AnyTable> = { [K in keyof T["columns"]]: T["columns"][K]["$out"] };
82
+ type PickNullable<T> = { [P in keyof T as null extends T[P] ? P : never]: T[P] };
83
+ type PickNotNullable<T> = { [P in keyof T as null extends T[P] ? never : P]: T[P] };
84
+ type TableToInsertValues<T extends AnyTable> = Partial<PickNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>> & PickNotNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>;
85
+ type TableToUpdateValues<T extends AnyTable> = { [K in keyof T["columns"]]?: T["columns"][K] extends IdColumn ? never : T["columns"][K]["$in"] };
86
+ type MainSelectResult<S extends SelectClause<T>, T extends AnyTable> = S extends true ? TableToColumnValues<T> : S extends (keyof T["columns"])[] ? Pick<TableToColumnValues<T>, S[number]> : never;
87
+ type JoinBuilder<T extends AnyTable, Out = {}> = { [K in keyof T["relations"]]: T["relations"][K] extends Relation<infer Type, infer Target> ? <Select extends SelectClause<Target> = true, JoinOut = {}>(options?: Type extends "many" ? FindManyOptions<Target, Select, JoinOut, false> : FindFirstOptions<Target, Select, JoinOut, false>) => JoinBuilder<T, Out & { [$K in K]: MapRelationType<SelectResult<Target, JoinOut, Select>, T["relations"][K]["implied"]>[Type] }> : never };
88
+ type SelectResult<T extends AnyTable, JoinOut, Select extends SelectClause<T>> = MainSelectResult<Select, T> & JoinOut;
89
+ type OrderBy<Column = string> = [columnName: Column, "asc" | "desc"];
90
+ type FindFirstOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = Omit<FindManyOptions<T, Select, JoinOut, IsRoot>, IsRoot extends true ? "limit" : "limit" | "offset" | "orderBy">;
91
+ interface MapRelationType<Type, Implied extends boolean> {
92
+ one: Implied extends true ? Type | null : Type;
93
+ many: Type[];
94
+ }
95
+ type FindManyOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = {
96
+ select?: Select;
97
+ where?: (eb: ConditionBuilder<T["columns"]>) => Condition | boolean;
98
+ limit?: number;
99
+ orderBy?: OrderBy<keyof T["columns"]> | OrderBy<keyof T["columns"]>[];
100
+ join?: (builder: JoinBuilder<T, {}>) => JoinBuilder<T, JoinOut>;
101
+ } & (IsRoot extends true ? {
102
+ offset?: number;
103
+ } : {});
104
+ interface AbstractQuery<S extends AnySchema> {
105
+ internal: ORMAdapter;
106
+ /**
107
+ * The code in the transaction will receive a transaction query instance.
108
+ *
109
+ * If you use that instance to write the database (e.g. insert) and an error is thrown, FumaDB will automatically rollback the changes + rethrow the error.
110
+ *
111
+ * It works by using the transaction API that's natively available for the database/ORM, or falling back to the soft transaction layer built by FumaDB.
112
+ */
113
+ transaction: <T>(run: (orm: AbstractQuery<S>) => Promise<T>) => Promise<T>;
114
+ /**
115
+ * Count (all)
116
+ */
117
+ count: <TableName extends keyof S["tables"]>(table: TableName, v?: {
118
+ where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
119
+ }) => Promise<number>;
120
+ findFirst: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v: FindFirstOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select> | null>;
121
+ findMany: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v?: FindManyOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select>[]>;
122
+ /**
123
+ * Upsert a **single row**.
124
+ *
125
+ * For ORMs:
126
+ * - use built-in method whenever possible.
127
+ *
128
+ * Otherwise:
129
+ * - run `update`.
130
+ * - if updated zero rows, run `create`.
131
+ */
132
+ upsert: <TableName extends keyof S["tables"]>(table: TableName, v: {
133
+ where: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
134
+ update: TableToUpdateValues<S["tables"][TableName]>;
135
+ create: TableToInsertValues<S["tables"][TableName]>;
136
+ }) => Promise<void>;
137
+ /**
138
+ * Note: you cannot update the id of a row, some databases don't support that (including MongoDB).
139
+ */
140
+ updateMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
141
+ where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
142
+ set: TableToUpdateValues<S["tables"][TableName]>;
143
+ }) => Promise<void>;
144
+ createMany: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>[]) => Promise<{
145
+ _id: string;
146
+ }[]>;
147
+ /**
148
+ * Note: when you don't need to receive the result, always use `createMany` for better performance.
149
+ */
150
+ create: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>) => Promise<TableToColumnValues<S["tables"][TableName]>>;
151
+ deleteMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
152
+ where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
153
+ }) => Promise<void>;
154
+ }
155
+ //#endregion
156
+ export { type AbstractQuery };
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.30.12";
2
+ var version = "0.31.0";
3
3
  //#endregion
4
4
  Object.defineProperty(exports, "version", {
5
5
  enumerable: true,
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.30.12";
2
+ var version = "0.31.0";
3
3
  //#endregion
4
4
  export { version };
package/dist/runtime.cjs CHANGED
@@ -1,27 +1,27 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("./_virtual/_rolldown/runtime.cjs");
2
3
  const require_version = require("./version.cjs");
3
4
  const require_handler = require("./handler.cjs");
4
5
  const require_route = require("./route.cjs");
5
- const require_pluginCore = require("./db/pluginCore.cjs");
6
+ const require_storageAccess = require("./storageAccess.cjs");
6
7
  const require_types = require("./db/types.cjs");
8
+ const require_pluginCore = require("./db/pluginCore.cjs");
9
+ let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
7
10
  //#region src/runtime.ts
8
11
  function createHotUpdater(options) {
9
12
  const database = options.database;
10
13
  const basePath = require_route.normalizeBasePath(options.basePath ?? "/api");
11
- const storagePlugins = (options.storages ?? options.storagePlugins ?? []).map((plugin) => typeof plugin === "function" ? plugin() : plugin);
12
- const resolveStoragePluginUrl = async (storageUri, context) => {
13
- if (!storageUri) return null;
14
- const protocol = new URL(storageUri).protocol.replace(":", "");
15
- if (protocol === "http" || protocol === "https") return storageUri;
16
- const plugin = storagePlugins.find((item) => item.supportedProtocol === protocol);
17
- if (!plugin) throw new Error(`No storage plugin for protocol: ${protocol}`);
18
- const { fileUrl } = await plugin.getDownloadUrl(storageUri, context);
19
- if (!fileUrl) throw new Error("Storage plugin returned empty fileUrl");
20
- return fileUrl;
21
- };
14
+ const { readStorageText, resolveFileUrl } = require_storageAccess.createStorageAccess((options.storages ?? options.storagePlugins ?? []).map((plugin) => {
15
+ const storagePlugin = typeof plugin === "function" ? plugin() : plugin;
16
+ (0, _hot_updater_plugin_core.assertRuntimeStoragePlugin)(storagePlugin);
17
+ return storagePlugin;
18
+ }));
22
19
  if (!require_types.isDatabasePluginFactory(database) && !require_types.isDatabasePlugin(database)) throw new Error("@hot-updater/server/runtime only supports database plugins.");
23
20
  const plugin = require_types.isDatabasePluginFactory(database) ? database() : database;
24
- const core = require_pluginCore.createPluginDatabaseCore(() => plugin, resolveStoragePluginUrl, require_types.isDatabasePluginFactory(database) ? { createMutationPlugin: () => database() } : void 0);
21
+ const core = require_pluginCore.createPluginDatabaseCore(() => plugin, resolveFileUrl, require_types.isDatabasePluginFactory(database) ? {
22
+ createMutationPlugin: () => database(),
23
+ readStorageText
24
+ } : { readStorageText });
25
25
  const api = {
26
26
  ...core.api,
27
27
  handler: require_handler.createHandler(core.api, {
@@ -1,7 +1,7 @@
1
1
  import { HandlerRoutes, createHandler } from "./handler.cjs";
2
- import { DatabaseAPI, DatabaseAdapter, StoragePluginFactory } from "./db/types.cjs";
3
2
  import { HOT_UPDATER_SERVER_VERSION } from "./version.cjs";
4
- import { HotUpdaterContext, StoragePlugin } from "@hot-updater/plugin-core";
3
+ import { DatabaseAPI, DatabaseAdapter, StoragePluginFactory } from "./db/types.cjs";
4
+ import { HotUpdaterContext, RuntimeStoragePlugin } from "@hot-updater/plugin-core";
5
5
 
6
6
  //#region src/runtime.d.ts
7
7
  type HotUpdaterAPI<TContext = unknown> = DatabaseAPI<TContext> & {
@@ -11,8 +11,8 @@ type HotUpdaterAPI<TContext = unknown> = DatabaseAPI<TContext> & {
11
11
  };
12
12
  interface CreateHotUpdaterOptions<TContext = unknown> {
13
13
  database: DatabaseAdapter<TContext>;
14
- storages?: (StoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
15
- storagePlugins?: (StoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
14
+ storages?: (RuntimeStoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
15
+ storagePlugins?: (RuntimeStoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
16
16
  basePath?: string;
17
17
  cwd?: string;
18
18
  routes?: HandlerRoutes;
@@ -1,7 +1,7 @@
1
1
  import { HandlerRoutes, createHandler } from "./handler.mjs";
2
- import { DatabaseAPI, DatabaseAdapter, StoragePluginFactory } from "./db/types.mjs";
3
2
  import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
4
- import { HotUpdaterContext, StoragePlugin } from "@hot-updater/plugin-core";
3
+ import { DatabaseAPI, DatabaseAdapter, StoragePluginFactory } from "./db/types.mjs";
4
+ import { HotUpdaterContext, RuntimeStoragePlugin } from "@hot-updater/plugin-core";
5
5
 
6
6
  //#region src/runtime.d.ts
7
7
  type HotUpdaterAPI<TContext = unknown> = DatabaseAPI<TContext> & {
@@ -11,8 +11,8 @@ type HotUpdaterAPI<TContext = unknown> = DatabaseAPI<TContext> & {
11
11
  };
12
12
  interface CreateHotUpdaterOptions<TContext = unknown> {
13
13
  database: DatabaseAdapter<TContext>;
14
- storages?: (StoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
15
- storagePlugins?: (StoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
14
+ storages?: (RuntimeStoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
15
+ storagePlugins?: (RuntimeStoragePlugin<TContext> | StoragePluginFactory<TContext>)[];
16
16
  basePath?: string;
17
17
  cwd?: string;
18
18
  routes?: HandlerRoutes;
package/dist/runtime.mjs CHANGED
@@ -1,26 +1,25 @@
1
1
  import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
2
2
  import { createHandler } from "./handler.mjs";
3
3
  import { normalizeBasePath } from "./route.mjs";
4
- import { createPluginDatabaseCore } from "./db/pluginCore.mjs";
4
+ import { createStorageAccess } from "./storageAccess.mjs";
5
5
  import { isDatabasePlugin, isDatabasePluginFactory } from "./db/types.mjs";
6
+ import { createPluginDatabaseCore } from "./db/pluginCore.mjs";
7
+ import { assertRuntimeStoragePlugin } from "@hot-updater/plugin-core";
6
8
  //#region src/runtime.ts
7
9
  function createHotUpdater(options) {
8
10
  const database = options.database;
9
11
  const basePath = normalizeBasePath(options.basePath ?? "/api");
10
- const storagePlugins = (options.storages ?? options.storagePlugins ?? []).map((plugin) => typeof plugin === "function" ? plugin() : plugin);
11
- const resolveStoragePluginUrl = async (storageUri, context) => {
12
- if (!storageUri) return null;
13
- const protocol = new URL(storageUri).protocol.replace(":", "");
14
- if (protocol === "http" || protocol === "https") return storageUri;
15
- const plugin = storagePlugins.find((item) => item.supportedProtocol === protocol);
16
- if (!plugin) throw new Error(`No storage plugin for protocol: ${protocol}`);
17
- const { fileUrl } = await plugin.getDownloadUrl(storageUri, context);
18
- if (!fileUrl) throw new Error("Storage plugin returned empty fileUrl");
19
- return fileUrl;
20
- };
12
+ const { readStorageText, resolveFileUrl } = createStorageAccess((options.storages ?? options.storagePlugins ?? []).map((plugin) => {
13
+ const storagePlugin = typeof plugin === "function" ? plugin() : plugin;
14
+ assertRuntimeStoragePlugin(storagePlugin);
15
+ return storagePlugin;
16
+ }));
21
17
  if (!isDatabasePluginFactory(database) && !isDatabasePlugin(database)) throw new Error("@hot-updater/server/runtime only supports database plugins.");
22
18
  const plugin = isDatabasePluginFactory(database) ? database() : database;
23
- const core = createPluginDatabaseCore(() => plugin, resolveStoragePluginUrl, isDatabasePluginFactory(database) ? { createMutationPlugin: () => database() } : void 0);
19
+ const core = createPluginDatabaseCore(() => plugin, resolveFileUrl, isDatabasePluginFactory(database) ? {
20
+ createMutationPlugin: () => database(),
21
+ readStorageText
22
+ } : { readStorageText });
24
23
  const api = {
25
24
  ...core.api,
26
25
  handler: createHandler(core.api, {
@@ -1,20 +1,21 @@
1
- let fumadb_schema = require("fumadb/schema");
1
+ const require_chunk_ZEQMAIFI = require("../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.cjs");
2
+ require("../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.cjs");
2
3
  //#region src/schema/v0_21_0.ts
3
- const v0_21_0 = (0, fumadb_schema.schema)({
4
+ const v0_21_0 = require_chunk_ZEQMAIFI.schema({
4
5
  version: "0.21.0",
5
- tables: { bundles: (0, fumadb_schema.table)("bundles", {
6
- id: (0, fumadb_schema.idColumn)("id", "uuid"),
7
- platform: (0, fumadb_schema.column)("platform", "string"),
8
- should_force_update: (0, fumadb_schema.column)("should_force_update", "bool"),
9
- enabled: (0, fumadb_schema.column)("enabled", "bool"),
10
- file_hash: (0, fumadb_schema.column)("file_hash", "string"),
11
- git_commit_hash: (0, fumadb_schema.column)("git_commit_hash", "string").nullable(),
12
- message: (0, fumadb_schema.column)("message", "string").nullable(),
13
- channel: (0, fumadb_schema.column)("channel", "string"),
14
- storage_uri: (0, fumadb_schema.column)("storage_uri", "string"),
15
- target_app_version: (0, fumadb_schema.column)("target_app_version", "string").nullable(),
16
- fingerprint_hash: (0, fumadb_schema.column)("fingerprint_hash", "string").nullable(),
17
- metadata: (0, fumadb_schema.column)("metadata", "json")
6
+ tables: { bundles: require_chunk_ZEQMAIFI.table("bundles", {
7
+ id: require_chunk_ZEQMAIFI.idColumn("id", "uuid"),
8
+ platform: require_chunk_ZEQMAIFI.column("platform", "string"),
9
+ should_force_update: require_chunk_ZEQMAIFI.column("should_force_update", "bool"),
10
+ enabled: require_chunk_ZEQMAIFI.column("enabled", "bool"),
11
+ file_hash: require_chunk_ZEQMAIFI.column("file_hash", "string"),
12
+ git_commit_hash: require_chunk_ZEQMAIFI.column("git_commit_hash", "string").nullable(),
13
+ message: require_chunk_ZEQMAIFI.column("message", "string").nullable(),
14
+ channel: require_chunk_ZEQMAIFI.column("channel", "string").defaultTo("production"),
15
+ storage_uri: require_chunk_ZEQMAIFI.column("storage_uri", "string"),
16
+ target_app_version: require_chunk_ZEQMAIFI.column("target_app_version", "string").nullable(),
17
+ fingerprint_hash: require_chunk_ZEQMAIFI.column("fingerprint_hash", "string").nullable(),
18
+ metadata: require_chunk_ZEQMAIFI.column("metadata", "json")
18
19
  }) },
19
20
  relations: {}
20
21
  });
@@ -1,4 +1,5 @@
1
- import { column, idColumn, schema, table } from "fumadb/schema";
1
+ import { column, idColumn, schema, table } from "../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.mjs";
2
+ import "../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.mjs";
2
3
  //#region src/schema/v0_21_0.ts
3
4
  const v0_21_0 = schema({
4
5
  version: "0.21.0",
@@ -10,7 +11,7 @@ const v0_21_0 = schema({
10
11
  file_hash: column("file_hash", "string"),
11
12
  git_commit_hash: column("git_commit_hash", "string").nullable(),
12
13
  message: column("message", "string").nullable(),
13
- channel: column("channel", "string"),
14
+ channel: column("channel", "string").defaultTo("production"),
14
15
  storage_uri: column("storage_uri", "string"),
15
16
  target_app_version: column("target_app_version", "string").nullable(),
16
17
  fingerprint_hash: column("fingerprint_hash", "string").nullable(),
@@ -1,22 +1,23 @@
1
- let fumadb_schema = require("fumadb/schema");
1
+ const require_chunk_ZEQMAIFI = require("../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.cjs");
2
+ require("../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.cjs");
2
3
  //#region src/schema/v0_29_0.ts
3
- const v0_29_0 = (0, fumadb_schema.schema)({
4
+ const v0_29_0 = require_chunk_ZEQMAIFI.schema({
4
5
  version: "0.29.0",
5
- tables: { bundles: (0, fumadb_schema.table)("bundles", {
6
- id: (0, fumadb_schema.idColumn)("id", "uuid"),
7
- platform: (0, fumadb_schema.column)("platform", "string"),
8
- should_force_update: (0, fumadb_schema.column)("should_force_update", "bool"),
9
- enabled: (0, fumadb_schema.column)("enabled", "bool"),
10
- file_hash: (0, fumadb_schema.column)("file_hash", "string"),
11
- git_commit_hash: (0, fumadb_schema.column)("git_commit_hash", "string").nullable(),
12
- message: (0, fumadb_schema.column)("message", "string").nullable(),
13
- channel: (0, fumadb_schema.column)("channel", "string"),
14
- storage_uri: (0, fumadb_schema.column)("storage_uri", "string"),
15
- target_app_version: (0, fumadb_schema.column)("target_app_version", "string").nullable(),
16
- fingerprint_hash: (0, fumadb_schema.column)("fingerprint_hash", "string").nullable(),
17
- metadata: (0, fumadb_schema.column)("metadata", "json"),
18
- rollout_cohort_count: (0, fumadb_schema.column)("rollout_cohort_count", "integer").defaultTo(1e3),
19
- target_cohorts: (0, fumadb_schema.column)("target_cohorts", "json").nullable()
6
+ tables: { bundles: require_chunk_ZEQMAIFI.table("bundles", {
7
+ id: require_chunk_ZEQMAIFI.idColumn("id", "uuid"),
8
+ platform: require_chunk_ZEQMAIFI.column("platform", "string"),
9
+ should_force_update: require_chunk_ZEQMAIFI.column("should_force_update", "bool"),
10
+ enabled: require_chunk_ZEQMAIFI.column("enabled", "bool"),
11
+ file_hash: require_chunk_ZEQMAIFI.column("file_hash", "string"),
12
+ git_commit_hash: require_chunk_ZEQMAIFI.column("git_commit_hash", "string").nullable(),
13
+ message: require_chunk_ZEQMAIFI.column("message", "string").nullable(),
14
+ channel: require_chunk_ZEQMAIFI.column("channel", "string").defaultTo("production"),
15
+ storage_uri: require_chunk_ZEQMAIFI.column("storage_uri", "string"),
16
+ target_app_version: require_chunk_ZEQMAIFI.column("target_app_version", "string").nullable(),
17
+ fingerprint_hash: require_chunk_ZEQMAIFI.column("fingerprint_hash", "string").nullable(),
18
+ metadata: require_chunk_ZEQMAIFI.column("metadata", "json"),
19
+ rollout_cohort_count: require_chunk_ZEQMAIFI.column("rollout_cohort_count", "integer").defaultTo(1e3),
20
+ target_cohorts: require_chunk_ZEQMAIFI.column("target_cohorts", "json").nullable()
20
21
  }) },
21
22
  relations: {}
22
23
  });
@@ -1,4 +1,5 @@
1
- import { column, idColumn, schema, table } from "fumadb/schema";
1
+ import { column, idColumn, schema, table } from "../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.mjs";
2
+ import "../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.mjs";
2
3
  //#region src/schema/v0_29_0.ts
3
4
  const v0_29_0 = schema({
4
5
  version: "0.29.0",
@@ -10,7 +11,7 @@ const v0_29_0 = schema({
10
11
  file_hash: column("file_hash", "string"),
11
12
  git_commit_hash: column("git_commit_hash", "string").nullable(),
12
13
  message: column("message", "string").nullable(),
13
- channel: column("channel", "string"),
14
+ channel: column("channel", "string").defaultTo("production"),
14
15
  storage_uri: column("storage_uri", "string"),
15
16
  target_app_version: column("target_app_version", "string").nullable(),
16
17
  fingerprint_hash: column("fingerprint_hash", "string").nullable(),
@@ -0,0 +1,48 @@
1
+ const require_chunk_ZEQMAIFI = require("../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.cjs");
2
+ require("../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.cjs");
3
+ //#region src/schema/v0_31_0.ts
4
+ const v0_31_0 = require_chunk_ZEQMAIFI.schema({
5
+ version: "0.31.0",
6
+ tables: {
7
+ bundles: require_chunk_ZEQMAIFI.table("bundles", {
8
+ id: require_chunk_ZEQMAIFI.idColumn("id", "uuid"),
9
+ platform: require_chunk_ZEQMAIFI.column("platform", "string"),
10
+ should_force_update: require_chunk_ZEQMAIFI.column("should_force_update", "bool"),
11
+ enabled: require_chunk_ZEQMAIFI.column("enabled", "bool"),
12
+ file_hash: require_chunk_ZEQMAIFI.column("file_hash", "string"),
13
+ git_commit_hash: require_chunk_ZEQMAIFI.column("git_commit_hash", "string").nullable(),
14
+ message: require_chunk_ZEQMAIFI.column("message", "string").nullable(),
15
+ channel: require_chunk_ZEQMAIFI.column("channel", "string").defaultTo("production"),
16
+ storage_uri: require_chunk_ZEQMAIFI.column("storage_uri", "string"),
17
+ target_app_version: require_chunk_ZEQMAIFI.column("target_app_version", "string").nullable(),
18
+ fingerprint_hash: require_chunk_ZEQMAIFI.column("fingerprint_hash", "string").nullable(),
19
+ metadata: require_chunk_ZEQMAIFI.column("metadata", "json"),
20
+ manifest_storage_uri: require_chunk_ZEQMAIFI.column("manifest_storage_uri", "string").nullable(),
21
+ manifest_file_hash: require_chunk_ZEQMAIFI.column("manifest_file_hash", "string").nullable(),
22
+ asset_base_storage_uri: require_chunk_ZEQMAIFI.column("asset_base_storage_uri", "string").nullable(),
23
+ rollout_cohort_count: require_chunk_ZEQMAIFI.column("rollout_cohort_count", "integer").defaultTo(1e3),
24
+ target_cohorts: require_chunk_ZEQMAIFI.column("target_cohorts", "json").nullable()
25
+ }),
26
+ bundle_patches: require_chunk_ZEQMAIFI.table("bundle_patches", {
27
+ id: require_chunk_ZEQMAIFI.idColumn("id", "varchar(255)"),
28
+ bundle_id: require_chunk_ZEQMAIFI.column("bundle_id", "uuid"),
29
+ base_bundle_id: require_chunk_ZEQMAIFI.column("base_bundle_id", "uuid"),
30
+ base_file_hash: require_chunk_ZEQMAIFI.column("base_file_hash", "string"),
31
+ patch_file_hash: require_chunk_ZEQMAIFI.column("patch_file_hash", "string"),
32
+ patch_storage_uri: require_chunk_ZEQMAIFI.column("patch_storage_uri", "string"),
33
+ order_index: require_chunk_ZEQMAIFI.column("order_index", "integer").defaultTo(0)
34
+ })
35
+ },
36
+ relations: { bundle_patches: (builder) => ({
37
+ bundle: builder.one("bundles", ["bundle_id", "id"]).imply("patches").foreignKey({
38
+ name: "bundle_patches_bundle_id_fk",
39
+ onDelete: "CASCADE"
40
+ }),
41
+ baseBundle: builder.one("bundles", ["base_bundle_id", "id"]).imply("baseForPatches").foreignKey({
42
+ name: "bundle_patches_base_bundle_id_fk",
43
+ onDelete: "CASCADE"
44
+ })
45
+ }) }
46
+ });
47
+ //#endregion
48
+ exports.v0_31_0 = v0_31_0;