@hot-updater/server 0.30.12 → 0.31.1

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
@@ -82,6 +82,298 @@ describe("createPluginDatabaseCore", () => {
82
82
  expect(getBundles).not.toHaveBeenCalled();
83
83
  });
84
84
 
85
+ it("resolves manifest artifacts through storage text reader", async () => {
86
+ const currentBundle = {
87
+ ...baseBundle,
88
+ id: "00000000-0000-0000-0000-000000000001",
89
+ manifestStorageUri: "r2://bucket/current/manifest.json",
90
+ manifestFileHash: "sig:current-manifest",
91
+ assetBaseStorageUri: "r2://bucket/current/files",
92
+ };
93
+ const targetBundle = {
94
+ ...baseBundle,
95
+ id: "00000000-0000-0000-0000-000000000002",
96
+ fileHash: "hash-2",
97
+ manifestStorageUri: "r2://bucket/target/manifest.json",
98
+ manifestFileHash: "sig:target-manifest",
99
+ assetBaseStorageUri: "r2://bucket/target/files",
100
+ };
101
+ const manifests = new Map([
102
+ [
103
+ currentBundle.manifestStorageUri,
104
+ JSON.stringify({
105
+ bundleId: currentBundle.id,
106
+ assets: {
107
+ "index.ios.bundle": {
108
+ fileHash: "old-bundle-hash",
109
+ },
110
+ },
111
+ }),
112
+ ],
113
+ [
114
+ targetBundle.manifestStorageUri,
115
+ JSON.stringify({
116
+ bundleId: targetBundle.id,
117
+ assets: {
118
+ "index.ios.bundle": {
119
+ fileHash: "new-bundle-hash",
120
+ },
121
+ },
122
+ }),
123
+ ],
124
+ ]);
125
+ const getUpdateInfo = vi.fn<
126
+ NonNullable<DatabasePlugin<TestContext>["getUpdateInfo"]>
127
+ >(async () => ({
128
+ fileHash: targetBundle.fileHash,
129
+ id: targetBundle.id,
130
+ message: targetBundle.message,
131
+ shouldForceUpdate: targetBundle.shouldForceUpdate,
132
+ status: "UPDATE",
133
+ storageUri: targetBundle.storageUri,
134
+ }));
135
+
136
+ const plugin: DatabasePlugin<TestContext> = {
137
+ name: "manifest-plugin",
138
+ async appendBundle() {},
139
+ async commitBundle() {},
140
+ async deleteBundle() {},
141
+ async getBundleById(bundleId) {
142
+ if (bundleId === currentBundle.id) return currentBundle;
143
+ if (bundleId === targetBundle.id) return targetBundle;
144
+ return null;
145
+ },
146
+ getUpdateInfo,
147
+ async getBundles() {
148
+ return {
149
+ data: [targetBundle],
150
+ pagination: {
151
+ currentPage: 1,
152
+ hasNextPage: false,
153
+ hasPreviousPage: false,
154
+ total: 1,
155
+ totalPages: 1,
156
+ },
157
+ };
158
+ },
159
+ async getChannels() {
160
+ return ["production"];
161
+ },
162
+ async updateBundle() {},
163
+ };
164
+
165
+ const core = createPluginDatabaseCore(
166
+ () => plugin,
167
+ async (storageUri) => {
168
+ if (!storageUri) return null;
169
+ const url = new URL(storageUri);
170
+ return `https://assets.example.com/${url.host}${url.pathname}`;
171
+ },
172
+ {
173
+ readStorageText: async (storageUri) =>
174
+ manifests.get(storageUri) ?? null,
175
+ },
176
+ );
177
+
178
+ await expect(
179
+ core.api.getAppUpdateInfo({
180
+ ...updateArgs,
181
+ bundleId: currentBundle.id,
182
+ }),
183
+ ).resolves.toMatchObject({
184
+ changedAssets: {
185
+ "index.ios.bundle": {
186
+ file: {
187
+ compression: "br",
188
+ url: "https://assets.example.com/bucket/target/files/index.ios.bundle.br",
189
+ },
190
+ fileHash: "new-bundle-hash",
191
+ },
192
+ },
193
+ manifestFileHash: "sig:target-manifest",
194
+ manifestUrl: "https://assets.example.com/bucket/target/manifest.json",
195
+ });
196
+ });
197
+
198
+ it("falls back to archive metadata when manifest changed assets cannot be resolved", async () => {
199
+ const currentBundle = {
200
+ ...baseBundle,
201
+ id: "00000000-0000-0000-0000-000000000001",
202
+ manifestStorageUri: "r2://bucket/current/manifest.json",
203
+ manifestFileHash: "sig:current-manifest",
204
+ assetBaseStorageUri: "r2://bucket/current/files",
205
+ };
206
+ const targetBundle = {
207
+ ...baseBundle,
208
+ id: "00000000-0000-0000-0000-000000000002",
209
+ fileHash: "hash-2",
210
+ manifestStorageUri: "r2://bucket/target/manifest.json",
211
+ manifestFileHash: "sig:target-manifest",
212
+ assetBaseStorageUri: "r2://bucket/target/files",
213
+ };
214
+ const manifests = new Map([
215
+ [
216
+ currentBundle.manifestStorageUri,
217
+ JSON.stringify({
218
+ bundleId: currentBundle.id,
219
+ assets: {
220
+ "index.ios.bundle": {
221
+ fileHash: "old-bundle-hash",
222
+ },
223
+ },
224
+ }),
225
+ ],
226
+ [
227
+ targetBundle.manifestStorageUri,
228
+ JSON.stringify({
229
+ bundleId: targetBundle.id,
230
+ assets: {
231
+ "index.ios.bundle": {
232
+ fileHash: "new-bundle-hash",
233
+ },
234
+ },
235
+ }),
236
+ ],
237
+ ]);
238
+ const getUpdateInfo = vi.fn<
239
+ NonNullable<DatabasePlugin<TestContext>["getUpdateInfo"]>
240
+ >(async () => ({
241
+ fileHash: targetBundle.fileHash,
242
+ id: targetBundle.id,
243
+ message: targetBundle.message,
244
+ shouldForceUpdate: targetBundle.shouldForceUpdate,
245
+ status: "UPDATE",
246
+ storageUri: targetBundle.storageUri,
247
+ }));
248
+
249
+ const plugin: DatabasePlugin<TestContext> = {
250
+ name: "manifest-unresolved-plugin",
251
+ async appendBundle() {},
252
+ async commitBundle() {},
253
+ async deleteBundle() {},
254
+ async getBundleById(bundleId) {
255
+ if (bundleId === currentBundle.id) return currentBundle;
256
+ if (bundleId === targetBundle.id) return targetBundle;
257
+ return null;
258
+ },
259
+ getUpdateInfo,
260
+ async getBundles() {
261
+ return {
262
+ data: [targetBundle],
263
+ pagination: {
264
+ currentPage: 1,
265
+ hasNextPage: false,
266
+ hasPreviousPage: false,
267
+ total: 1,
268
+ totalPages: 1,
269
+ },
270
+ };
271
+ },
272
+ async getChannels() {
273
+ return ["production"];
274
+ },
275
+ async updateBundle() {},
276
+ };
277
+
278
+ const core = createPluginDatabaseCore(
279
+ () => plugin,
280
+ async (storageUri) => {
281
+ if (!storageUri) return null;
282
+ const url = new URL(storageUri);
283
+ if (url.pathname.endsWith("/files/index.ios.bundle.br")) {
284
+ return null;
285
+ }
286
+ return `https://assets.example.com/${url.host}${url.pathname}`;
287
+ },
288
+ {
289
+ readStorageText: async (storageUri) =>
290
+ manifests.get(storageUri) ?? null,
291
+ },
292
+ );
293
+
294
+ const updateInfo = await core.api.getAppUpdateInfo({
295
+ ...updateArgs,
296
+ bundleId: currentBundle.id,
297
+ });
298
+
299
+ expect(updateInfo).toMatchObject({
300
+ fileHash: "hash-2",
301
+ fileUrl: "https://assets.example.com/bucket/bundle.zip",
302
+ id: targetBundle.id,
303
+ status: "UPDATE",
304
+ });
305
+ expect(updateInfo).not.toHaveProperty("changedAssets");
306
+ expect(updateInfo).not.toHaveProperty("manifestFileHash");
307
+ expect(updateInfo).not.toHaveProperty("manifestUrl");
308
+ });
309
+
310
+ it("propagates manifest storage read failures", async () => {
311
+ const targetBundle = {
312
+ ...baseBundle,
313
+ id: "00000000-0000-0000-0000-000000000002",
314
+ fileHash: "hash-2",
315
+ manifestStorageUri: "r2://bucket/target/manifest.json",
316
+ manifestFileHash: "sig:target-manifest",
317
+ assetBaseStorageUri: "r2://bucket/target/files",
318
+ };
319
+ const storageError = new Error("storage read failed");
320
+ const getUpdateInfo = vi.fn<
321
+ NonNullable<DatabasePlugin<TestContext>["getUpdateInfo"]>
322
+ >(async () => ({
323
+ fileHash: targetBundle.fileHash,
324
+ id: targetBundle.id,
325
+ message: targetBundle.message,
326
+ shouldForceUpdate: targetBundle.shouldForceUpdate,
327
+ status: "UPDATE",
328
+ storageUri: targetBundle.storageUri,
329
+ }));
330
+
331
+ const plugin: DatabasePlugin<TestContext> = {
332
+ name: "manifest-error-plugin",
333
+ async appendBundle() {},
334
+ async commitBundle() {},
335
+ async deleteBundle() {},
336
+ async getBundleById(bundleId) {
337
+ return bundleId === targetBundle.id ? targetBundle : null;
338
+ },
339
+ getUpdateInfo,
340
+ async getBundles() {
341
+ return {
342
+ data: [targetBundle],
343
+ pagination: {
344
+ currentPage: 1,
345
+ hasNextPage: false,
346
+ hasPreviousPage: false,
347
+ total: 1,
348
+ totalPages: 1,
349
+ },
350
+ };
351
+ },
352
+ async getChannels() {
353
+ return ["production"];
354
+ },
355
+ async updateBundle() {},
356
+ };
357
+
358
+ const core = createPluginDatabaseCore(
359
+ () => plugin,
360
+ async (storageUri) => {
361
+ if (!storageUri) return null;
362
+ const url = new URL(storageUri);
363
+ return `https://assets.example.com/${url.host}${url.pathname}`;
364
+ },
365
+ {
366
+ readStorageText: async () => {
367
+ throw storageError;
368
+ },
369
+ },
370
+ );
371
+
372
+ await expect(core.api.getAppUpdateInfo(updateArgs)).rejects.toThrow(
373
+ "storage read failed",
374
+ );
375
+ });
376
+
85
377
  it("does not fall back to scanning when plugin getUpdateInfo returns null", async () => {
86
378
  const getBundles = vi.fn<DatabasePlugin["getBundles"]>(async () => ({
87
379
  data: [baseBundle],
@@ -169,4 +461,97 @@ describe("createPluginDatabaseCore", () => {
169
461
  });
170
462
  expect(getBundles).toHaveBeenCalledOnce();
171
463
  });
464
+
465
+ it("rejects invalid bundles before appendBundle is called", async () => {
466
+ const appendBundle = vi.fn<DatabasePlugin["appendBundle"]>();
467
+ const commitBundle = vi.fn<DatabasePlugin["commitBundle"]>();
468
+
469
+ const plugin: DatabasePlugin = {
470
+ name: "validation-plugin",
471
+ appendBundle,
472
+ commitBundle,
473
+ async deleteBundle() {},
474
+ async getBundleById() {
475
+ return null;
476
+ },
477
+ async getBundles() {
478
+ return {
479
+ data: [],
480
+ pagination: {
481
+ currentPage: 1,
482
+ hasNextPage: false,
483
+ hasPreviousPage: false,
484
+ total: 0,
485
+ totalPages: 1,
486
+ },
487
+ };
488
+ },
489
+ async getChannels() {
490
+ return ["production"];
491
+ },
492
+ async updateBundle() {},
493
+ };
494
+
495
+ const core = createPluginDatabaseCore(
496
+ () => plugin,
497
+ async () => null,
498
+ );
499
+
500
+ await expect(
501
+ core.api.insertBundle({
502
+ ...baseBundle,
503
+ targetAppVersion: null,
504
+ fingerprintHash: null,
505
+ }),
506
+ ).rejects.toThrow(
507
+ "Bundle must define either targetAppVersion or fingerprintHash.",
508
+ );
509
+ expect(appendBundle).not.toHaveBeenCalled();
510
+ expect(commitBundle).not.toHaveBeenCalled();
511
+ });
512
+
513
+ it("rejects invalid updates before plugin.updateBundle is called", async () => {
514
+ const updateBundle = vi.fn<DatabasePlugin["updateBundle"]>();
515
+
516
+ const plugin: DatabasePlugin = {
517
+ name: "update-validation-plugin",
518
+ async appendBundle() {},
519
+ async commitBundle() {},
520
+ async deleteBundle() {},
521
+ async getBundleById(bundleId) {
522
+ return bundleId === baseBundle.id ? baseBundle : null;
523
+ },
524
+ async getBundles() {
525
+ return {
526
+ data: [],
527
+ pagination: {
528
+ currentPage: 1,
529
+ hasNextPage: false,
530
+ hasPreviousPage: false,
531
+ total: 0,
532
+ totalPages: 1,
533
+ },
534
+ };
535
+ },
536
+ async getChannels() {
537
+ return ["production"];
538
+ },
539
+ updateBundle,
540
+ };
541
+
542
+ const core = createPluginDatabaseCore(
543
+ () => plugin,
544
+ async () => null,
545
+ );
546
+
547
+ await expect(
548
+ core.api.updateBundleById(baseBundle.id, {
549
+ targetAppVersion: null,
550
+ fingerprintHash: null,
551
+ }),
552
+ ).rejects.toThrow(
553
+ "Bundle must define either targetAppVersion or fingerprintHash.",
554
+ );
555
+ expect(updateBundle).not.toHaveBeenCalled();
556
+ });
172
557
  });
@@ -1,5 +1,5 @@
1
1
  import type {
2
- AppUpdateInfo,
2
+ AppUpdateAvailableInfo,
3
3
  AppVersionGetBundlesArgs,
4
4
  Bundle,
5
5
  FingerprintGetBundlesArgs,
@@ -17,7 +17,9 @@ import {
17
17
  semverSatisfies,
18
18
  } from "@hot-updater/plugin-core";
19
19
 
20
+ import { assertBundlePersistenceConstraints } from "./schemaEnhancements";
20
21
  import type { DatabaseAPI } from "./types";
22
+ import { resolveManifestArtifacts } from "./updateArtifacts";
21
23
 
22
24
  const PAGE_SIZE = 100;
23
25
  const DESC_ORDER = { field: "id", direction: "desc" } as const;
@@ -110,6 +112,10 @@ export function createPluginDatabaseCore<TContext = unknown>(
110
112
  cleanupMutationPlugin?: (
111
113
  plugin: DatabasePlugin<TContext>,
112
114
  ) => Promise<void> | void;
115
+ readStorageText?: (
116
+ storageUri: string,
117
+ context?: HotUpdaterContext<TContext>,
118
+ ) => Promise<string | null>;
113
119
  },
114
120
  ): {
115
121
  api: DatabaseAPI<TContext>;
@@ -336,7 +342,7 @@ export function createPluginDatabaseCore<TContext = unknown>(
336
342
  async getAppUpdateInfo(
337
343
  args: GetBundlesArgs,
338
344
  context?: HotUpdaterContext<TContext>,
339
- ): Promise<AppUpdateInfo | null> {
345
+ ): Promise<AppUpdateAvailableInfo | null> {
340
346
  const info = await this.getUpdateInfo(args, context);
341
347
  if (!info) {
342
348
  return null;
@@ -344,8 +350,37 @@ export function createPluginDatabaseCore<TContext = unknown>(
344
350
  const { storageUri, ...rest } = info as UpdateInfo & {
345
351
  storageUri: string | null;
346
352
  };
347
- const fileUrl = await resolveFileUrl(storageUri ?? null, context);
348
- return { ...rest, fileUrl };
353
+
354
+ const readStorageText = options?.readStorageText;
355
+ if (info.id === NIL_UUID || !readStorageText) {
356
+ const fileUrl = await resolveFileUrl(storageUri ?? null, context);
357
+ const baseResponse: AppUpdateAvailableInfo = { ...rest, fileUrl };
358
+ return baseResponse;
359
+ }
360
+
361
+ const [fileUrl, targetBundle, currentBundle] = await Promise.all([
362
+ resolveFileUrl(storageUri ?? null, context),
363
+ getPlugin().getBundleById(info.id, context),
364
+ args.bundleId !== NIL_UUID
365
+ ? getPlugin().getBundleById(args.bundleId, context)
366
+ : null,
367
+ ]);
368
+ const baseResponse: AppUpdateAvailableInfo = { ...rest, fileUrl };
369
+ const manifestArtifacts = await resolveManifestArtifacts({
370
+ currentBundle,
371
+ resolveFileUrl,
372
+ readStorageText,
373
+ targetBundle,
374
+ context,
375
+ });
376
+ if (!manifestArtifacts) {
377
+ return baseResponse;
378
+ }
379
+
380
+ return {
381
+ ...baseResponse,
382
+ ...manifestArtifacts,
383
+ };
349
384
  },
350
385
 
351
386
  async getChannels(
@@ -362,6 +397,7 @@ export function createPluginDatabaseCore<TContext = unknown>(
362
397
  bundle: Bundle,
363
398
  context?: HotUpdaterContext<TContext>,
364
399
  ): Promise<void> {
400
+ assertBundlePersistenceConstraints(bundle);
365
401
  await runWithMutationPlugin(async (plugin) => {
366
402
  await plugin.appendBundle(bundle, context);
367
403
  await plugin.commitBundle(context);
@@ -374,6 +410,11 @@ export function createPluginDatabaseCore<TContext = unknown>(
374
410
  context?: HotUpdaterContext<TContext>,
375
411
  ): Promise<void> {
376
412
  await runWithMutationPlugin(async (plugin) => {
413
+ const current = await plugin.getBundleById(bundleId, context);
414
+ if (!current) {
415
+ throw new Error("targetBundleId not found");
416
+ }
417
+ assertBundlePersistenceConstraints({ ...current, ...newBundle });
377
418
  await plugin.updateBundle(bundleId, newBundle, context);
378
419
  await plugin.commitBundle(context);
379
420
  });