@hot-updater/server 0.30.11 → 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,275 @@
1
+ "use strict";
2
+ const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.cjs");
3
+ const require_cryptoNode$1 = require("./cryptoNode.cjs");
4
+ //#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/utils.js
5
+ var require_utils = /* @__PURE__ */ require_runtime.__commonJSMin(((exports) => {
6
+ /**
7
+ * Utilities for hex, bytes, CSPRNG.
8
+ * @module
9
+ */
10
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = void 0;
13
+ exports.isBytes = isBytes;
14
+ exports.anumber = anumber;
15
+ exports.abytes = abytes;
16
+ exports.ahash = ahash;
17
+ exports.aexists = aexists;
18
+ exports.aoutput = aoutput;
19
+ exports.u8 = u8;
20
+ exports.u32 = u32;
21
+ exports.clean = clean;
22
+ exports.createView = createView;
23
+ exports.rotr = rotr;
24
+ exports.rotl = rotl;
25
+ exports.byteSwap = byteSwap;
26
+ exports.byteSwap32 = byteSwap32;
27
+ exports.bytesToHex = bytesToHex;
28
+ exports.hexToBytes = hexToBytes;
29
+ exports.asyncLoop = asyncLoop;
30
+ exports.utf8ToBytes = utf8ToBytes;
31
+ exports.bytesToUtf8 = bytesToUtf8;
32
+ exports.toBytes = toBytes;
33
+ exports.kdfInputToBytes = kdfInputToBytes;
34
+ exports.concatBytes = concatBytes;
35
+ exports.checkOpts = checkOpts;
36
+ exports.createHasher = createHasher;
37
+ exports.createOptHasher = createOptHasher;
38
+ exports.createXOFer = createXOFer;
39
+ exports.randomBytes = randomBytes;
40
+ const crypto_1 = require_cryptoNode$1.default;
41
+ /** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */
42
+ function isBytes(a) {
43
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
44
+ }
45
+ /** Asserts something is positive integer. */
46
+ function anumber(n) {
47
+ if (!Number.isSafeInteger(n) || n < 0) throw new Error("positive integer expected, got " + n);
48
+ }
49
+ /** Asserts something is Uint8Array. */
50
+ function abytes(b, ...lengths) {
51
+ if (!isBytes(b)) throw new Error("Uint8Array expected");
52
+ if (lengths.length > 0 && !lengths.includes(b.length)) throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
53
+ }
54
+ /** Asserts something is hash */
55
+ function ahash(h) {
56
+ if (typeof h !== "function" || typeof h.create !== "function") throw new Error("Hash should be wrapped by utils.createHasher");
57
+ anumber(h.outputLen);
58
+ anumber(h.blockLen);
59
+ }
60
+ /** Asserts a hash instance has not been destroyed / finished */
61
+ function aexists(instance, checkFinished = true) {
62
+ if (instance.destroyed) throw new Error("Hash instance has been destroyed");
63
+ if (checkFinished && instance.finished) throw new Error("Hash#digest() has already been called");
64
+ }
65
+ /** Asserts output is properly-sized byte array */
66
+ function aoutput(out, instance) {
67
+ abytes(out);
68
+ const min = instance.outputLen;
69
+ if (out.length < min) throw new Error("digestInto() expects output buffer of length at least " + min);
70
+ }
71
+ /** Cast u8 / u16 / u32 to u8. */
72
+ function u8(arr) {
73
+ return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
74
+ }
75
+ /** Cast u8 / u16 / u32 to u32. */
76
+ function u32(arr) {
77
+ return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
78
+ }
79
+ /** Zeroize a byte array. Warning: JS provides no guarantees. */
80
+ function clean(...arrays) {
81
+ for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
82
+ }
83
+ /** Create DataView of an array for easy byte-level manipulation. */
84
+ function createView(arr) {
85
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
86
+ }
87
+ /** The rotate right (circular right shift) operation for uint32 */
88
+ function rotr(word, shift) {
89
+ return word << 32 - shift | word >>> shift;
90
+ }
91
+ /** The rotate left (circular left shift) operation for uint32 */
92
+ function rotl(word, shift) {
93
+ return word << shift | word >>> 32 - shift >>> 0;
94
+ }
95
+ /** Is current platform little-endian? Most are. Big-Endian platform: IBM */
96
+ exports.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
97
+ /** The byte swap operation for uint32 */
98
+ function byteSwap(word) {
99
+ return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
100
+ }
101
+ /** Conditionally byte swap if on a big-endian platform */
102
+ exports.swap8IfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
103
+ /** @deprecated */
104
+ exports.byteSwapIfBE = exports.swap8IfBE;
105
+ /** In place byte swap for Uint32Array */
106
+ function byteSwap32(arr) {
107
+ for (let i = 0; i < arr.length; i++) arr[i] = byteSwap(arr[i]);
108
+ return arr;
109
+ }
110
+ exports.swap32IfBE = exports.isLE ? (u) => u : byteSwap32;
111
+ const hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
112
+ const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
113
+ /**
114
+ * Convert byte array to hex string. Uses built-in function, when available.
115
+ * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
116
+ */
117
+ function bytesToHex(bytes) {
118
+ abytes(bytes);
119
+ if (hasHexBuiltin) return bytes.toHex();
120
+ let hex = "";
121
+ for (let i = 0; i < bytes.length; i++) hex += hexes[bytes[i]];
122
+ return hex;
123
+ }
124
+ const asciis = {
125
+ _0: 48,
126
+ _9: 57,
127
+ A: 65,
128
+ F: 70,
129
+ a: 97,
130
+ f: 102
131
+ };
132
+ function asciiToBase16(ch) {
133
+ if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0;
134
+ if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10);
135
+ if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10);
136
+ }
137
+ /**
138
+ * Convert hex string to byte array. Uses built-in function, when available.
139
+ * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
140
+ */
141
+ function hexToBytes(hex) {
142
+ if (typeof hex !== "string") throw new Error("hex string expected, got " + typeof hex);
143
+ if (hasHexBuiltin) return Uint8Array.fromHex(hex);
144
+ const hl = hex.length;
145
+ const al = hl / 2;
146
+ if (hl % 2) throw new Error("hex string expected, got unpadded hex of length " + hl);
147
+ const array = new Uint8Array(al);
148
+ for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
149
+ const n1 = asciiToBase16(hex.charCodeAt(hi));
150
+ const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
151
+ if (n1 === void 0 || n2 === void 0) {
152
+ const char = hex[hi] + hex[hi + 1];
153
+ throw new Error("hex string expected, got non-hex character \"" + char + "\" at index " + hi);
154
+ }
155
+ array[ai] = n1 * 16 + n2;
156
+ }
157
+ return array;
158
+ }
159
+ /**
160
+ * There is no setImmediate in browser and setTimeout is slow.
161
+ * Call of async fn will return Promise, which will be fullfiled only on
162
+ * next scheduler queue processing step and this is exactly what we need.
163
+ */
164
+ const nextTick = async () => {};
165
+ exports.nextTick = nextTick;
166
+ /** Returns control to thread each 'tick' ms to avoid blocking. */
167
+ async function asyncLoop(iters, tick, cb) {
168
+ let ts = Date.now();
169
+ for (let i = 0; i < iters; i++) {
170
+ cb(i);
171
+ const diff = Date.now() - ts;
172
+ if (diff >= 0 && diff < tick) continue;
173
+ await (0, exports.nextTick)();
174
+ ts += diff;
175
+ }
176
+ }
177
+ /**
178
+ * Converts string to bytes using UTF8 encoding.
179
+ * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])
180
+ */
181
+ function utf8ToBytes(str) {
182
+ if (typeof str !== "string") throw new Error("string expected");
183
+ return new Uint8Array(new TextEncoder().encode(str));
184
+ }
185
+ /**
186
+ * Converts bytes to string using UTF8 encoding.
187
+ * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'
188
+ */
189
+ function bytesToUtf8(bytes) {
190
+ return new TextDecoder().decode(bytes);
191
+ }
192
+ /**
193
+ * Normalizes (non-hex) string or Uint8Array to Uint8Array.
194
+ * Warning: when Uint8Array is passed, it would NOT get copied.
195
+ * Keep in mind for future mutable operations.
196
+ */
197
+ function toBytes(data) {
198
+ if (typeof data === "string") data = utf8ToBytes(data);
199
+ abytes(data);
200
+ return data;
201
+ }
202
+ /**
203
+ * Helper for KDFs: consumes uint8array or string.
204
+ * When string is passed, does utf8 decoding, using TextDecoder.
205
+ */
206
+ function kdfInputToBytes(data) {
207
+ if (typeof data === "string") data = utf8ToBytes(data);
208
+ abytes(data);
209
+ return data;
210
+ }
211
+ /** Copies several Uint8Arrays into one. */
212
+ function concatBytes(...arrays) {
213
+ let sum = 0;
214
+ for (let i = 0; i < arrays.length; i++) {
215
+ const a = arrays[i];
216
+ abytes(a);
217
+ sum += a.length;
218
+ }
219
+ const res = new Uint8Array(sum);
220
+ for (let i = 0, pad = 0; i < arrays.length; i++) {
221
+ const a = arrays[i];
222
+ res.set(a, pad);
223
+ pad += a.length;
224
+ }
225
+ return res;
226
+ }
227
+ function checkOpts(defaults, opts) {
228
+ if (opts !== void 0 && {}.toString.call(opts) !== "[object Object]") throw new Error("options should be object or undefined");
229
+ return Object.assign(defaults, opts);
230
+ }
231
+ /** For runtime check if class implements interface */
232
+ var Hash = class {};
233
+ exports.Hash = Hash;
234
+ /** Wraps hash function, creating an interface on top of it */
235
+ function createHasher(hashCons) {
236
+ const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
237
+ const tmp = hashCons();
238
+ hashC.outputLen = tmp.outputLen;
239
+ hashC.blockLen = tmp.blockLen;
240
+ hashC.create = () => hashCons();
241
+ return hashC;
242
+ }
243
+ function createOptHasher(hashCons) {
244
+ const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
245
+ const tmp = hashCons({});
246
+ hashC.outputLen = tmp.outputLen;
247
+ hashC.blockLen = tmp.blockLen;
248
+ hashC.create = (opts) => hashCons(opts);
249
+ return hashC;
250
+ }
251
+ function createXOFer(hashCons) {
252
+ const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
253
+ const tmp = hashCons({});
254
+ hashC.outputLen = tmp.outputLen;
255
+ hashC.blockLen = tmp.blockLen;
256
+ hashC.create = (opts) => hashCons(opts);
257
+ return hashC;
258
+ }
259
+ exports.wrapConstructor = createHasher;
260
+ exports.wrapConstructorWithOpts = createOptHasher;
261
+ exports.wrapXOFConstructorWithOpts = createXOFer;
262
+ /** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */
263
+ function randomBytes(bytesLength = 32) {
264
+ if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
265
+ if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === "function") return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength));
266
+ throw new Error("crypto.getRandomValues must be defined");
267
+ }
268
+ }));
269
+ //#endregion
270
+ Object.defineProperty(exports, "default", {
271
+ enumerable: true,
272
+ get: function() {
273
+ return require_utils();
274
+ }
275
+ });
@@ -0,0 +1,270 @@
1
+ import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
2
+ import { require_cryptoNode } from "./cryptoNode.mjs";
3
+ //#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/utils.js
4
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ /**
6
+ * Utilities for hex, bytes, CSPRNG.
7
+ * @module
8
+ */
9
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = void 0;
12
+ exports.isBytes = isBytes;
13
+ exports.anumber = anumber;
14
+ exports.abytes = abytes;
15
+ exports.ahash = ahash;
16
+ exports.aexists = aexists;
17
+ exports.aoutput = aoutput;
18
+ exports.u8 = u8;
19
+ exports.u32 = u32;
20
+ exports.clean = clean;
21
+ exports.createView = createView;
22
+ exports.rotr = rotr;
23
+ exports.rotl = rotl;
24
+ exports.byteSwap = byteSwap;
25
+ exports.byteSwap32 = byteSwap32;
26
+ exports.bytesToHex = bytesToHex;
27
+ exports.hexToBytes = hexToBytes;
28
+ exports.asyncLoop = asyncLoop;
29
+ exports.utf8ToBytes = utf8ToBytes;
30
+ exports.bytesToUtf8 = bytesToUtf8;
31
+ exports.toBytes = toBytes;
32
+ exports.kdfInputToBytes = kdfInputToBytes;
33
+ exports.concatBytes = concatBytes;
34
+ exports.checkOpts = checkOpts;
35
+ exports.createHasher = createHasher;
36
+ exports.createOptHasher = createOptHasher;
37
+ exports.createXOFer = createXOFer;
38
+ exports.randomBytes = randomBytes;
39
+ const crypto_1 = require_cryptoNode();
40
+ /** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */
41
+ function isBytes(a) {
42
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
43
+ }
44
+ /** Asserts something is positive integer. */
45
+ function anumber(n) {
46
+ if (!Number.isSafeInteger(n) || n < 0) throw new Error("positive integer expected, got " + n);
47
+ }
48
+ /** Asserts something is Uint8Array. */
49
+ function abytes(b, ...lengths) {
50
+ if (!isBytes(b)) throw new Error("Uint8Array expected");
51
+ if (lengths.length > 0 && !lengths.includes(b.length)) throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
52
+ }
53
+ /** Asserts something is hash */
54
+ function ahash(h) {
55
+ if (typeof h !== "function" || typeof h.create !== "function") throw new Error("Hash should be wrapped by utils.createHasher");
56
+ anumber(h.outputLen);
57
+ anumber(h.blockLen);
58
+ }
59
+ /** Asserts a hash instance has not been destroyed / finished */
60
+ function aexists(instance, checkFinished = true) {
61
+ if (instance.destroyed) throw new Error("Hash instance has been destroyed");
62
+ if (checkFinished && instance.finished) throw new Error("Hash#digest() has already been called");
63
+ }
64
+ /** Asserts output is properly-sized byte array */
65
+ function aoutput(out, instance) {
66
+ abytes(out);
67
+ const min = instance.outputLen;
68
+ if (out.length < min) throw new Error("digestInto() expects output buffer of length at least " + min);
69
+ }
70
+ /** Cast u8 / u16 / u32 to u8. */
71
+ function u8(arr) {
72
+ return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
73
+ }
74
+ /** Cast u8 / u16 / u32 to u32. */
75
+ function u32(arr) {
76
+ return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
77
+ }
78
+ /** Zeroize a byte array. Warning: JS provides no guarantees. */
79
+ function clean(...arrays) {
80
+ for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
81
+ }
82
+ /** Create DataView of an array for easy byte-level manipulation. */
83
+ function createView(arr) {
84
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
85
+ }
86
+ /** The rotate right (circular right shift) operation for uint32 */
87
+ function rotr(word, shift) {
88
+ return word << 32 - shift | word >>> shift;
89
+ }
90
+ /** The rotate left (circular left shift) operation for uint32 */
91
+ function rotl(word, shift) {
92
+ return word << shift | word >>> 32 - shift >>> 0;
93
+ }
94
+ /** Is current platform little-endian? Most are. Big-Endian platform: IBM */
95
+ exports.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
96
+ /** The byte swap operation for uint32 */
97
+ function byteSwap(word) {
98
+ return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
99
+ }
100
+ /** Conditionally byte swap if on a big-endian platform */
101
+ exports.swap8IfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
102
+ /** @deprecated */
103
+ exports.byteSwapIfBE = exports.swap8IfBE;
104
+ /** In place byte swap for Uint32Array */
105
+ function byteSwap32(arr) {
106
+ for (let i = 0; i < arr.length; i++) arr[i] = byteSwap(arr[i]);
107
+ return arr;
108
+ }
109
+ exports.swap32IfBE = exports.isLE ? (u) => u : byteSwap32;
110
+ const hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
111
+ const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
112
+ /**
113
+ * Convert byte array to hex string. Uses built-in function, when available.
114
+ * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
115
+ */
116
+ function bytesToHex(bytes) {
117
+ abytes(bytes);
118
+ if (hasHexBuiltin) return bytes.toHex();
119
+ let hex = "";
120
+ for (let i = 0; i < bytes.length; i++) hex += hexes[bytes[i]];
121
+ return hex;
122
+ }
123
+ const asciis = {
124
+ _0: 48,
125
+ _9: 57,
126
+ A: 65,
127
+ F: 70,
128
+ a: 97,
129
+ f: 102
130
+ };
131
+ function asciiToBase16(ch) {
132
+ if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0;
133
+ if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10);
134
+ if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10);
135
+ }
136
+ /**
137
+ * Convert hex string to byte array. Uses built-in function, when available.
138
+ * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
139
+ */
140
+ function hexToBytes(hex) {
141
+ if (typeof hex !== "string") throw new Error("hex string expected, got " + typeof hex);
142
+ if (hasHexBuiltin) return Uint8Array.fromHex(hex);
143
+ const hl = hex.length;
144
+ const al = hl / 2;
145
+ if (hl % 2) throw new Error("hex string expected, got unpadded hex of length " + hl);
146
+ const array = new Uint8Array(al);
147
+ for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
148
+ const n1 = asciiToBase16(hex.charCodeAt(hi));
149
+ const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
150
+ if (n1 === void 0 || n2 === void 0) {
151
+ const char = hex[hi] + hex[hi + 1];
152
+ throw new Error("hex string expected, got non-hex character \"" + char + "\" at index " + hi);
153
+ }
154
+ array[ai] = n1 * 16 + n2;
155
+ }
156
+ return array;
157
+ }
158
+ /**
159
+ * There is no setImmediate in browser and setTimeout is slow.
160
+ * Call of async fn will return Promise, which will be fullfiled only on
161
+ * next scheduler queue processing step and this is exactly what we need.
162
+ */
163
+ const nextTick = async () => {};
164
+ exports.nextTick = nextTick;
165
+ /** Returns control to thread each 'tick' ms to avoid blocking. */
166
+ async function asyncLoop(iters, tick, cb) {
167
+ let ts = Date.now();
168
+ for (let i = 0; i < iters; i++) {
169
+ cb(i);
170
+ const diff = Date.now() - ts;
171
+ if (diff >= 0 && diff < tick) continue;
172
+ await (0, exports.nextTick)();
173
+ ts += diff;
174
+ }
175
+ }
176
+ /**
177
+ * Converts string to bytes using UTF8 encoding.
178
+ * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])
179
+ */
180
+ function utf8ToBytes(str) {
181
+ if (typeof str !== "string") throw new Error("string expected");
182
+ return new Uint8Array(new TextEncoder().encode(str));
183
+ }
184
+ /**
185
+ * Converts bytes to string using UTF8 encoding.
186
+ * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'
187
+ */
188
+ function bytesToUtf8(bytes) {
189
+ return new TextDecoder().decode(bytes);
190
+ }
191
+ /**
192
+ * Normalizes (non-hex) string or Uint8Array to Uint8Array.
193
+ * Warning: when Uint8Array is passed, it would NOT get copied.
194
+ * Keep in mind for future mutable operations.
195
+ */
196
+ function toBytes(data) {
197
+ if (typeof data === "string") data = utf8ToBytes(data);
198
+ abytes(data);
199
+ return data;
200
+ }
201
+ /**
202
+ * Helper for KDFs: consumes uint8array or string.
203
+ * When string is passed, does utf8 decoding, using TextDecoder.
204
+ */
205
+ function kdfInputToBytes(data) {
206
+ if (typeof data === "string") data = utf8ToBytes(data);
207
+ abytes(data);
208
+ return data;
209
+ }
210
+ /** Copies several Uint8Arrays into one. */
211
+ function concatBytes(...arrays) {
212
+ let sum = 0;
213
+ for (let i = 0; i < arrays.length; i++) {
214
+ const a = arrays[i];
215
+ abytes(a);
216
+ sum += a.length;
217
+ }
218
+ const res = new Uint8Array(sum);
219
+ for (let i = 0, pad = 0; i < arrays.length; i++) {
220
+ const a = arrays[i];
221
+ res.set(a, pad);
222
+ pad += a.length;
223
+ }
224
+ return res;
225
+ }
226
+ function checkOpts(defaults, opts) {
227
+ if (opts !== void 0 && {}.toString.call(opts) !== "[object Object]") throw new Error("options should be object or undefined");
228
+ return Object.assign(defaults, opts);
229
+ }
230
+ /** For runtime check if class implements interface */
231
+ var Hash = class {};
232
+ exports.Hash = Hash;
233
+ /** Wraps hash function, creating an interface on top of it */
234
+ function createHasher(hashCons) {
235
+ const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
236
+ const tmp = hashCons();
237
+ hashC.outputLen = tmp.outputLen;
238
+ hashC.blockLen = tmp.blockLen;
239
+ hashC.create = () => hashCons();
240
+ return hashC;
241
+ }
242
+ function createOptHasher(hashCons) {
243
+ const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
244
+ const tmp = hashCons({});
245
+ hashC.outputLen = tmp.outputLen;
246
+ hashC.blockLen = tmp.blockLen;
247
+ hashC.create = (opts) => hashCons(opts);
248
+ return hashC;
249
+ }
250
+ function createXOFer(hashCons) {
251
+ const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
252
+ const tmp = hashCons({});
253
+ hashC.outputLen = tmp.outputLen;
254
+ hashC.blockLen = tmp.blockLen;
255
+ hashC.create = (opts) => hashCons(opts);
256
+ return hashC;
257
+ }
258
+ exports.wrapConstructor = createHasher;
259
+ exports.wrapConstructorWithOpts = createOptHasher;
260
+ exports.wrapXOFConstructorWithOpts = createXOFer;
261
+ /** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */
262
+ function randomBytes(bytesLength = 32) {
263
+ if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
264
+ if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === "function") return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength));
265
+ throw new Error("crypto.getRandomValues must be defined");
266
+ }
267
+ }));
268
+ //#endregion
269
+ export default require_utils();
270
+ export { require_utils };
@@ -0,0 +1,17 @@
1
+ const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_index = require("./src/index.cjs");
3
+ //#region ../../node_modules/.pnpm/@paralleldrive+cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.js
4
+ var require_cuid2 = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
5
+ const { createId, init, getConstants, isCuid } = require_index.default;
6
+ module.exports.createId = createId;
7
+ module.exports.init = init;
8
+ module.exports.getConstants = getConstants;
9
+ module.exports.isCuid = isCuid;
10
+ }));
11
+ //#endregion
12
+ Object.defineProperty(exports, "default", {
13
+ enumerable: true,
14
+ get: function() {
15
+ return require_cuid2();
16
+ }
17
+ });
@@ -0,0 +1,13 @@
1
+ import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
2
+ import { require_src } from "./src/index.mjs";
3
+ //#region ../../node_modules/.pnpm/@paralleldrive+cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.js
4
+ var require_cuid2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ const { createId, init, getConstants, isCuid } = require_src();
6
+ module.exports.createId = createId;
7
+ module.exports.init = init;
8
+ module.exports.getConstants = getConstants;
9
+ module.exports.isCuid = isCuid;
10
+ }));
11
+ //#endregion
12
+ export default require_cuid2();
13
+ export { require_cuid2 };
@@ -0,0 +1,69 @@
1
+ const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_sha3$1 = require("../../../../../@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.cjs");
3
+ //#region ../../node_modules/.pnpm/@paralleldrive+cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.js
4
+ var require_src = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
5
+ const { sha3_512: sha3 } = require_sha3$1.default;
6
+ const defaultLength = 24;
7
+ const bigLength = 32;
8
+ const createEntropy = (length = 4, random = Math.random) => {
9
+ let entropy = "";
10
+ while (entropy.length < length) entropy = entropy + Math.floor(random() * 36).toString(36);
11
+ return entropy;
12
+ };
13
+ function bufToBigInt(buf) {
14
+ let bits = 8n;
15
+ let value = 0n;
16
+ for (const i of buf.values()) {
17
+ const bi = BigInt(i);
18
+ value = (value << bits) + bi;
19
+ }
20
+ return value;
21
+ }
22
+ const hash = (input = "") => {
23
+ return bufToBigInt(sha3(input)).toString(36).slice(1);
24
+ };
25
+ const alphabet = Array.from({ length: 26 }, (x, i) => String.fromCharCode(i + 97));
26
+ const randomLetter = (random) => alphabet[Math.floor(random() * alphabet.length)];
27
+ const createFingerprint = ({ globalObj = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : {}, random = Math.random } = {}) => {
28
+ const globals = Object.keys(globalObj).toString();
29
+ return hash(globals.length ? globals + createEntropy(bigLength, random) : createEntropy(bigLength, random)).substring(0, bigLength);
30
+ };
31
+ const createCounter = (count) => () => {
32
+ return count++;
33
+ };
34
+ const initialCountMax = 476782367;
35
+ const init = ({ random = Math.random, counter = createCounter(Math.floor(random() * initialCountMax)), length = defaultLength, fingerprint = createFingerprint({ random }) } = {}) => {
36
+ return function cuid2() {
37
+ const firstLetter = randomLetter(random);
38
+ const time = Date.now().toString(36);
39
+ const count = counter().toString(36);
40
+ return `${firstLetter + hash(`${time + createEntropy(length, random) + count + fingerprint}`).substring(1, length)}`;
41
+ };
42
+ };
43
+ const createId = init();
44
+ const isCuid = (id, { minLength = 2, maxLength = bigLength } = {}) => {
45
+ const length = id.length;
46
+ const regex = /^[0-9a-z]+$/;
47
+ try {
48
+ if (typeof id === "string" && length >= minLength && length <= maxLength && regex.test(id)) return true;
49
+ } finally {}
50
+ return false;
51
+ };
52
+ module.exports.getConstants = () => ({
53
+ defaultLength,
54
+ bigLength
55
+ });
56
+ module.exports.init = init;
57
+ module.exports.createId = createId;
58
+ module.exports.bufToBigInt = bufToBigInt;
59
+ module.exports.createCounter = createCounter;
60
+ module.exports.createFingerprint = createFingerprint;
61
+ module.exports.isCuid = isCuid;
62
+ }));
63
+ //#endregion
64
+ Object.defineProperty(exports, "default", {
65
+ enumerable: true,
66
+ get: function() {
67
+ return require_src();
68
+ }
69
+ });