@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.
- package/dist/_virtual/_rolldown/runtime.cjs +25 -0
- package/dist/_virtual/_rolldown/runtime.mjs +6 -0
- package/dist/adapters/drizzle.cjs +6 -9
- package/dist/adapters/drizzle.d.cts +8 -1
- package/dist/adapters/drizzle.d.mts +8 -1
- package/dist/adapters/drizzle.mjs +5 -2
- package/dist/adapters/kysely.cjs +7 -9
- package/dist/adapters/kysely.d.cts +14 -1
- package/dist/adapters/kysely.d.mts +14 -1
- package/dist/adapters/kysely.mjs +6 -2
- package/dist/adapters/mongodb.cjs +7 -9
- package/dist/adapters/mongodb.d.cts +9 -1
- package/dist/adapters/mongodb.d.mts +9 -1
- package/dist/adapters/mongodb.mjs +5 -2
- package/dist/adapters/prisma.cjs +6 -9
- package/dist/adapters/prisma.d.cts +8 -1
- package/dist/adapters/prisma.d.mts +8 -1
- package/dist/adapters/prisma.mjs +5 -2
- package/dist/db/createBundleDiff.cjs +166 -0
- package/dist/db/createBundleDiff.d.cts +20 -0
- package/dist/db/createBundleDiff.d.mts +20 -0
- package/dist/db/createBundleDiff.mjs +161 -0
- package/dist/db/index.cjs +15 -16
- package/dist/db/index.d.cts +5 -4
- package/dist/db/index.d.mts +5 -4
- package/dist/db/index.mjs +14 -16
- package/dist/db/ormCore.cjs +173 -65
- package/dist/db/ormCore.d.cts +100 -34
- package/dist/db/ormCore.d.mts +100 -34
- package/dist/db/ormCore.mjs +171 -64
- package/dist/db/pluginCore.cjs +37 -3
- package/dist/db/pluginCore.mjs +36 -3
- package/dist/db/schemaEnhancements.cjs +171 -0
- package/dist/db/schemaEnhancements.mjs +167 -0
- package/dist/db/types.cjs +6 -0
- package/dist/db/types.d.cts +19 -7
- package/dist/db/types.d.mts +22 -10
- package/dist/db/types.mjs +6 -1
- package/dist/db/updateArtifacts.cjs +127 -0
- package/dist/db/updateArtifacts.mjs +125 -0
- package/dist/handler.cjs +61 -5
- package/dist/handler.d.cts +2 -2
- package/dist/handler.d.mts +5 -5
- package/dist/handler.mjs +59 -5
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -1
- package/dist/node.d.cts +0 -1
- package/dist/node.d.mts +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.cjs +112 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.mjs +108 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.cjs +22 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.mjs +18 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.cjs +219 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.mjs +214 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.cjs +275 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.mjs +270 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.cjs +17 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.mjs +13 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.cjs +69 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.mjs +65 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/{package.cjs → packages/server/package.cjs} +1 -1
- package/dist/{package.mjs → packages/server/package.mjs} +1 -1
- package/dist/runtime.cjs +13 -13
- package/dist/runtime.d.cts +4 -4
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +12 -13
- package/dist/schema/v0_21_0.cjs +16 -15
- package/dist/schema/v0_21_0.mjs +3 -2
- package/dist/schema/v0_29_0.cjs +18 -17
- package/dist/schema/v0_29_0.mjs +3 -2
- package/dist/schema/v0_31_0.cjs +48 -0
- package/dist/schema/v0_31_0.mjs +48 -0
- package/dist/storageAccess.cjs +44 -0
- package/dist/storageAccess.mjs +44 -0
- package/dist/version.cjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +15 -7
- package/src/adapters/drizzle.ts +15 -1
- package/src/adapters/kysely.ts +24 -1
- package/src/adapters/mongodb.ts +19 -1
- package/src/adapters/prisma.ts +15 -1
- package/src/db/createBundleDiff.spec.ts +402 -0
- package/src/db/createBundleDiff.ts +375 -0
- package/src/db/index.spec.ts +528 -27
- package/src/db/index.ts +22 -36
- package/src/db/ormCore.ts +308 -75
- package/src/db/pluginCore.spec.ts +385 -0
- package/src/db/pluginCore.ts +45 -4
- package/src/db/schemaEnhancements.ts +460 -0
- package/src/db/types.ts +38 -7
- package/src/db/updateArtifacts.ts +388 -0
- package/src/handler-standalone.integration.spec.ts +1 -0
- package/src/handler.spec.ts +121 -0
- package/src/handler.ts +117 -5
- package/src/runtime.spec.ts +287 -55
- package/src/runtime.ts +21 -37
- package/src/schema/v0_21_0.ts +1 -1
- package/src/schema/v0_29_0.ts +1 -1
- package/src/schema/v0_31_0.ts +58 -0
- package/src/storageAccess.spec.ts +57 -0
- package/src/storageAccess.ts +90 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_u64.js
|
|
3
|
+
var require__u64 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.toBig = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = exports.rotr32L = exports.rotr32H = exports.rotlSL = exports.rotlSH = exports.rotlBL = exports.rotlBH = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = void 0;
|
|
6
|
+
exports.add = add;
|
|
7
|
+
exports.fromBig = fromBig;
|
|
8
|
+
exports.split = split;
|
|
9
|
+
/**
|
|
10
|
+
* Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.
|
|
11
|
+
* @todo re-check https://issues.chromium.org/issues/42212588
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
15
|
+
const _32n = /* @__PURE__ */ BigInt(32);
|
|
16
|
+
function fromBig(n, le = false) {
|
|
17
|
+
if (le) return {
|
|
18
|
+
h: Number(n & U32_MASK64),
|
|
19
|
+
l: Number(n >> _32n & U32_MASK64)
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
h: Number(n >> _32n & U32_MASK64) | 0,
|
|
23
|
+
l: Number(n & U32_MASK64) | 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function split(lst, le = false) {
|
|
27
|
+
const len = lst.length;
|
|
28
|
+
let Ah = new Uint32Array(len);
|
|
29
|
+
let Al = new Uint32Array(len);
|
|
30
|
+
for (let i = 0; i < len; i++) {
|
|
31
|
+
const { h, l } = fromBig(lst[i], le);
|
|
32
|
+
[Ah[i], Al[i]] = [h, l];
|
|
33
|
+
}
|
|
34
|
+
return [Ah, Al];
|
|
35
|
+
}
|
|
36
|
+
const toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
|
|
37
|
+
exports.toBig = toBig;
|
|
38
|
+
const shrSH = (h, _l, s) => h >>> s;
|
|
39
|
+
exports.shrSH = shrSH;
|
|
40
|
+
const shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
41
|
+
exports.shrSL = shrSL;
|
|
42
|
+
const rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
43
|
+
exports.rotrSH = rotrSH;
|
|
44
|
+
const rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
45
|
+
exports.rotrSL = rotrSL;
|
|
46
|
+
const rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
47
|
+
exports.rotrBH = rotrBH;
|
|
48
|
+
const rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
49
|
+
exports.rotrBL = rotrBL;
|
|
50
|
+
const rotr32H = (_h, l) => l;
|
|
51
|
+
exports.rotr32H = rotr32H;
|
|
52
|
+
const rotr32L = (h, _l) => h;
|
|
53
|
+
exports.rotr32L = rotr32L;
|
|
54
|
+
const rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
55
|
+
exports.rotlSH = rotlSH;
|
|
56
|
+
const rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
57
|
+
exports.rotlSL = rotlSL;
|
|
58
|
+
const rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
59
|
+
exports.rotlBH = rotlBH;
|
|
60
|
+
const rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
61
|
+
exports.rotlBL = rotlBL;
|
|
62
|
+
function add(Ah, Al, Bh, Bl) {
|
|
63
|
+
const l = (Al >>> 0) + (Bl >>> 0);
|
|
64
|
+
return {
|
|
65
|
+
h: Ah + Bh + (l / 2 ** 32 | 0) | 0,
|
|
66
|
+
l: l | 0
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
70
|
+
exports.add3L = add3L;
|
|
71
|
+
const add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
72
|
+
exports.add3H = add3H;
|
|
73
|
+
const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
74
|
+
exports.add4L = add4L;
|
|
75
|
+
const add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
|
76
|
+
exports.add4H = add4H;
|
|
77
|
+
const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
78
|
+
exports.add5L = add5L;
|
|
79
|
+
const add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
80
|
+
exports.add5H = add5H;
|
|
81
|
+
exports.default = {
|
|
82
|
+
fromBig,
|
|
83
|
+
split,
|
|
84
|
+
toBig,
|
|
85
|
+
shrSH,
|
|
86
|
+
shrSL,
|
|
87
|
+
rotrSH,
|
|
88
|
+
rotrSL,
|
|
89
|
+
rotrBH,
|
|
90
|
+
rotrBL,
|
|
91
|
+
rotr32H,
|
|
92
|
+
rotr32L,
|
|
93
|
+
rotlSH,
|
|
94
|
+
rotlSL,
|
|
95
|
+
rotlBH,
|
|
96
|
+
rotlBL,
|
|
97
|
+
add,
|
|
98
|
+
add3L,
|
|
99
|
+
add3H,
|
|
100
|
+
add4L,
|
|
101
|
+
add4H,
|
|
102
|
+
add5H,
|
|
103
|
+
add5L
|
|
104
|
+
};
|
|
105
|
+
}));
|
|
106
|
+
//#endregion
|
|
107
|
+
export default require__u64();
|
|
108
|
+
export { require__u64 };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.js
|
|
3
|
+
var require_cryptoNode = /* @__PURE__ */ require("../../../../../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports) => {
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.crypto = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Internal webcrypto alias.
|
|
8
|
+
* We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.
|
|
9
|
+
* Falls back to Node.js built-in crypto for Node.js <=v14.
|
|
10
|
+
* See utils.ts for details.
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
const nc = require("node:crypto");
|
|
14
|
+
exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
|
|
15
|
+
}));
|
|
16
|
+
//#endregion
|
|
17
|
+
Object.defineProperty(exports, "default", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return require_cryptoNode();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.js
|
|
3
|
+
var require_cryptoNode = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.crypto = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Internal webcrypto alias.
|
|
8
|
+
* We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.
|
|
9
|
+
* Falls back to Node.js built-in crypto for Node.js <=v14.
|
|
10
|
+
* See utils.ts for details.
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
const nc = __require("node:crypto");
|
|
14
|
+
exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
|
|
15
|
+
}));
|
|
16
|
+
//#endregion
|
|
17
|
+
export default require_cryptoNode();
|
|
18
|
+
export { require_cryptoNode };
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require__u64$1 = require("./_u64.cjs");
|
|
4
|
+
const require_utils$1 = require("./utils.cjs");
|
|
5
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha3.js
|
|
6
|
+
var require_sha3 = /* @__PURE__ */ require_runtime.__commonJSMin(((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = void 0;
|
|
9
|
+
exports.keccakP = keccakP;
|
|
10
|
+
/**
|
|
11
|
+
* SHA3 (keccak) hash function, based on a new "Sponge function" design.
|
|
12
|
+
* Different from older hashes, the internal state is bigger than output size.
|
|
13
|
+
*
|
|
14
|
+
* Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf),
|
|
15
|
+
* [Website](https://keccak.team/keccak.html),
|
|
16
|
+
* [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub).
|
|
17
|
+
*
|
|
18
|
+
* Check out `sha3-addons` module for cSHAKE, k12, and others.
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
const _u64_ts_1 = require__u64$1.default;
|
|
22
|
+
const utils_ts_1 = require_utils$1.default;
|
|
23
|
+
const _0n = BigInt(0);
|
|
24
|
+
const _1n = BigInt(1);
|
|
25
|
+
const _2n = BigInt(2);
|
|
26
|
+
const _7n = BigInt(7);
|
|
27
|
+
const _256n = BigInt(256);
|
|
28
|
+
const _0x71n = BigInt(113);
|
|
29
|
+
const SHA3_PI = [];
|
|
30
|
+
const SHA3_ROTL = [];
|
|
31
|
+
const _SHA3_IOTA = [];
|
|
32
|
+
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
33
|
+
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
34
|
+
SHA3_PI.push(2 * (5 * y + x));
|
|
35
|
+
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
36
|
+
let t = _0n;
|
|
37
|
+
for (let j = 0; j < 7; j++) {
|
|
38
|
+
R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
|
|
39
|
+
if (R & _2n) t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
|
|
40
|
+
}
|
|
41
|
+
_SHA3_IOTA.push(t);
|
|
42
|
+
}
|
|
43
|
+
const IOTAS = (0, _u64_ts_1.split)(_SHA3_IOTA, true);
|
|
44
|
+
const SHA3_IOTA_H = IOTAS[0];
|
|
45
|
+
const SHA3_IOTA_L = IOTAS[1];
|
|
46
|
+
const rotlH = (h, l, s) => s > 32 ? (0, _u64_ts_1.rotlBH)(h, l, s) : (0, _u64_ts_1.rotlSH)(h, l, s);
|
|
47
|
+
const rotlL = (h, l, s) => s > 32 ? (0, _u64_ts_1.rotlBL)(h, l, s) : (0, _u64_ts_1.rotlSL)(h, l, s);
|
|
48
|
+
/** `keccakf1600` internal function, additionally allows to adjust round count. */
|
|
49
|
+
function keccakP(s, rounds = 24) {
|
|
50
|
+
const B = new Uint32Array(10);
|
|
51
|
+
for (let round = 24 - rounds; round < 24; round++) {
|
|
52
|
+
for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
|
|
53
|
+
for (let x = 0; x < 10; x += 2) {
|
|
54
|
+
const idx1 = (x + 8) % 10;
|
|
55
|
+
const idx0 = (x + 2) % 10;
|
|
56
|
+
const B0 = B[idx0];
|
|
57
|
+
const B1 = B[idx0 + 1];
|
|
58
|
+
const Th = rotlH(B0, B1, 1) ^ B[idx1];
|
|
59
|
+
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
|
|
60
|
+
for (let y = 0; y < 50; y += 10) {
|
|
61
|
+
s[x + y] ^= Th;
|
|
62
|
+
s[x + y + 1] ^= Tl;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
let curH = s[2];
|
|
66
|
+
let curL = s[3];
|
|
67
|
+
for (let t = 0; t < 24; t++) {
|
|
68
|
+
const shift = SHA3_ROTL[t];
|
|
69
|
+
const Th = rotlH(curH, curL, shift);
|
|
70
|
+
const Tl = rotlL(curH, curL, shift);
|
|
71
|
+
const PI = SHA3_PI[t];
|
|
72
|
+
curH = s[PI];
|
|
73
|
+
curL = s[PI + 1];
|
|
74
|
+
s[PI] = Th;
|
|
75
|
+
s[PI + 1] = Tl;
|
|
76
|
+
}
|
|
77
|
+
for (let y = 0; y < 50; y += 10) {
|
|
78
|
+
for (let x = 0; x < 10; x++) B[x] = s[y + x];
|
|
79
|
+
for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
|
|
80
|
+
}
|
|
81
|
+
s[0] ^= SHA3_IOTA_H[round];
|
|
82
|
+
s[1] ^= SHA3_IOTA_L[round];
|
|
83
|
+
}
|
|
84
|
+
(0, utils_ts_1.clean)(B);
|
|
85
|
+
}
|
|
86
|
+
/** Keccak sponge function. */
|
|
87
|
+
var Keccak = class Keccak extends utils_ts_1.Hash {
|
|
88
|
+
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
89
|
+
super();
|
|
90
|
+
this.pos = 0;
|
|
91
|
+
this.posOut = 0;
|
|
92
|
+
this.finished = false;
|
|
93
|
+
this.destroyed = false;
|
|
94
|
+
this.enableXOF = false;
|
|
95
|
+
this.blockLen = blockLen;
|
|
96
|
+
this.suffix = suffix;
|
|
97
|
+
this.outputLen = outputLen;
|
|
98
|
+
this.enableXOF = enableXOF;
|
|
99
|
+
this.rounds = rounds;
|
|
100
|
+
(0, utils_ts_1.anumber)(outputLen);
|
|
101
|
+
if (!(0 < blockLen && blockLen < 200)) throw new Error("only keccak-f1600 function is supported");
|
|
102
|
+
this.state = new Uint8Array(200);
|
|
103
|
+
this.state32 = (0, utils_ts_1.u32)(this.state);
|
|
104
|
+
}
|
|
105
|
+
clone() {
|
|
106
|
+
return this._cloneInto();
|
|
107
|
+
}
|
|
108
|
+
keccak() {
|
|
109
|
+
(0, utils_ts_1.swap32IfBE)(this.state32);
|
|
110
|
+
keccakP(this.state32, this.rounds);
|
|
111
|
+
(0, utils_ts_1.swap32IfBE)(this.state32);
|
|
112
|
+
this.posOut = 0;
|
|
113
|
+
this.pos = 0;
|
|
114
|
+
}
|
|
115
|
+
update(data) {
|
|
116
|
+
(0, utils_ts_1.aexists)(this);
|
|
117
|
+
data = (0, utils_ts_1.toBytes)(data);
|
|
118
|
+
(0, utils_ts_1.abytes)(data);
|
|
119
|
+
const { blockLen, state } = this;
|
|
120
|
+
const len = data.length;
|
|
121
|
+
for (let pos = 0; pos < len;) {
|
|
122
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
123
|
+
for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++];
|
|
124
|
+
if (this.pos === blockLen) this.keccak();
|
|
125
|
+
}
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
finish() {
|
|
129
|
+
if (this.finished) return;
|
|
130
|
+
this.finished = true;
|
|
131
|
+
const { state, suffix, pos, blockLen } = this;
|
|
132
|
+
state[pos] ^= suffix;
|
|
133
|
+
if ((suffix & 128) !== 0 && pos === blockLen - 1) this.keccak();
|
|
134
|
+
state[blockLen - 1] ^= 128;
|
|
135
|
+
this.keccak();
|
|
136
|
+
}
|
|
137
|
+
writeInto(out) {
|
|
138
|
+
(0, utils_ts_1.aexists)(this, false);
|
|
139
|
+
(0, utils_ts_1.abytes)(out);
|
|
140
|
+
this.finish();
|
|
141
|
+
const bufferOut = this.state;
|
|
142
|
+
const { blockLen } = this;
|
|
143
|
+
for (let pos = 0, len = out.length; pos < len;) {
|
|
144
|
+
if (this.posOut >= blockLen) this.keccak();
|
|
145
|
+
const take = Math.min(blockLen - this.posOut, len - pos);
|
|
146
|
+
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
|
147
|
+
this.posOut += take;
|
|
148
|
+
pos += take;
|
|
149
|
+
}
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
152
|
+
xofInto(out) {
|
|
153
|
+
if (!this.enableXOF) throw new Error("XOF is not possible for this instance");
|
|
154
|
+
return this.writeInto(out);
|
|
155
|
+
}
|
|
156
|
+
xof(bytes) {
|
|
157
|
+
(0, utils_ts_1.anumber)(bytes);
|
|
158
|
+
return this.xofInto(new Uint8Array(bytes));
|
|
159
|
+
}
|
|
160
|
+
digestInto(out) {
|
|
161
|
+
(0, utils_ts_1.aoutput)(out, this);
|
|
162
|
+
if (this.finished) throw new Error("digest() was already called");
|
|
163
|
+
this.writeInto(out);
|
|
164
|
+
this.destroy();
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
digest() {
|
|
168
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
169
|
+
}
|
|
170
|
+
destroy() {
|
|
171
|
+
this.destroyed = true;
|
|
172
|
+
(0, utils_ts_1.clean)(this.state);
|
|
173
|
+
}
|
|
174
|
+
_cloneInto(to) {
|
|
175
|
+
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
176
|
+
to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
|
177
|
+
to.state32.set(this.state32);
|
|
178
|
+
to.pos = this.pos;
|
|
179
|
+
to.posOut = this.posOut;
|
|
180
|
+
to.finished = this.finished;
|
|
181
|
+
to.rounds = rounds;
|
|
182
|
+
to.suffix = suffix;
|
|
183
|
+
to.outputLen = outputLen;
|
|
184
|
+
to.enableXOF = enableXOF;
|
|
185
|
+
to.destroyed = this.destroyed;
|
|
186
|
+
return to;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
exports.Keccak = Keccak;
|
|
190
|
+
const gen = (suffix, blockLen, outputLen) => (0, utils_ts_1.createHasher)(() => new Keccak(blockLen, suffix, outputLen));
|
|
191
|
+
/** SHA3-224 hash function. */
|
|
192
|
+
exports.sha3_224 = gen(6, 144, 224 / 8);
|
|
193
|
+
/** SHA3-256 hash function. Different from keccak-256. */
|
|
194
|
+
exports.sha3_256 = gen(6, 136, 256 / 8);
|
|
195
|
+
/** SHA3-384 hash function. */
|
|
196
|
+
exports.sha3_384 = gen(6, 104, 384 / 8);
|
|
197
|
+
/** SHA3-512 hash function. */
|
|
198
|
+
exports.sha3_512 = gen(6, 72, 512 / 8);
|
|
199
|
+
/** keccak-224 hash function. */
|
|
200
|
+
exports.keccak_224 = gen(1, 144, 224 / 8);
|
|
201
|
+
/** keccak-256 hash function. Different from SHA3-256. */
|
|
202
|
+
exports.keccak_256 = gen(1, 136, 256 / 8);
|
|
203
|
+
/** keccak-384 hash function. */
|
|
204
|
+
exports.keccak_384 = gen(1, 104, 384 / 8);
|
|
205
|
+
/** keccak-512 hash function. */
|
|
206
|
+
exports.keccak_512 = gen(1, 72, 512 / 8);
|
|
207
|
+
const genShake = (suffix, blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
|
|
208
|
+
/** SHAKE128 XOF with 128-bit security. */
|
|
209
|
+
exports.shake128 = genShake(31, 168, 128 / 8);
|
|
210
|
+
/** SHAKE256 XOF with 256-bit security. */
|
|
211
|
+
exports.shake256 = genShake(31, 136, 256 / 8);
|
|
212
|
+
}));
|
|
213
|
+
//#endregion
|
|
214
|
+
Object.defineProperty(exports, "default", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function() {
|
|
217
|
+
return require_sha3();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require__u64 } from "./_u64.mjs";
|
|
3
|
+
import { require_utils } from "./utils.mjs";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha3.js
|
|
5
|
+
var require_sha3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = void 0;
|
|
8
|
+
exports.keccakP = keccakP;
|
|
9
|
+
/**
|
|
10
|
+
* SHA3 (keccak) hash function, based on a new "Sponge function" design.
|
|
11
|
+
* Different from older hashes, the internal state is bigger than output size.
|
|
12
|
+
*
|
|
13
|
+
* Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf),
|
|
14
|
+
* [Website](https://keccak.team/keccak.html),
|
|
15
|
+
* [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub).
|
|
16
|
+
*
|
|
17
|
+
* Check out `sha3-addons` module for cSHAKE, k12, and others.
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
const _u64_ts_1 = require__u64();
|
|
21
|
+
const utils_ts_1 = require_utils();
|
|
22
|
+
const _0n = BigInt(0);
|
|
23
|
+
const _1n = BigInt(1);
|
|
24
|
+
const _2n = BigInt(2);
|
|
25
|
+
const _7n = BigInt(7);
|
|
26
|
+
const _256n = BigInt(256);
|
|
27
|
+
const _0x71n = BigInt(113);
|
|
28
|
+
const SHA3_PI = [];
|
|
29
|
+
const SHA3_ROTL = [];
|
|
30
|
+
const _SHA3_IOTA = [];
|
|
31
|
+
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
32
|
+
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
33
|
+
SHA3_PI.push(2 * (5 * y + x));
|
|
34
|
+
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
35
|
+
let t = _0n;
|
|
36
|
+
for (let j = 0; j < 7; j++) {
|
|
37
|
+
R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
|
|
38
|
+
if (R & _2n) t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
|
|
39
|
+
}
|
|
40
|
+
_SHA3_IOTA.push(t);
|
|
41
|
+
}
|
|
42
|
+
const IOTAS = (0, _u64_ts_1.split)(_SHA3_IOTA, true);
|
|
43
|
+
const SHA3_IOTA_H = IOTAS[0];
|
|
44
|
+
const SHA3_IOTA_L = IOTAS[1];
|
|
45
|
+
const rotlH = (h, l, s) => s > 32 ? (0, _u64_ts_1.rotlBH)(h, l, s) : (0, _u64_ts_1.rotlSH)(h, l, s);
|
|
46
|
+
const rotlL = (h, l, s) => s > 32 ? (0, _u64_ts_1.rotlBL)(h, l, s) : (0, _u64_ts_1.rotlSL)(h, l, s);
|
|
47
|
+
/** `keccakf1600` internal function, additionally allows to adjust round count. */
|
|
48
|
+
function keccakP(s, rounds = 24) {
|
|
49
|
+
const B = new Uint32Array(10);
|
|
50
|
+
for (let round = 24 - rounds; round < 24; round++) {
|
|
51
|
+
for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
|
|
52
|
+
for (let x = 0; x < 10; x += 2) {
|
|
53
|
+
const idx1 = (x + 8) % 10;
|
|
54
|
+
const idx0 = (x + 2) % 10;
|
|
55
|
+
const B0 = B[idx0];
|
|
56
|
+
const B1 = B[idx0 + 1];
|
|
57
|
+
const Th = rotlH(B0, B1, 1) ^ B[idx1];
|
|
58
|
+
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
|
|
59
|
+
for (let y = 0; y < 50; y += 10) {
|
|
60
|
+
s[x + y] ^= Th;
|
|
61
|
+
s[x + y + 1] ^= Tl;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
let curH = s[2];
|
|
65
|
+
let curL = s[3];
|
|
66
|
+
for (let t = 0; t < 24; t++) {
|
|
67
|
+
const shift = SHA3_ROTL[t];
|
|
68
|
+
const Th = rotlH(curH, curL, shift);
|
|
69
|
+
const Tl = rotlL(curH, curL, shift);
|
|
70
|
+
const PI = SHA3_PI[t];
|
|
71
|
+
curH = s[PI];
|
|
72
|
+
curL = s[PI + 1];
|
|
73
|
+
s[PI] = Th;
|
|
74
|
+
s[PI + 1] = Tl;
|
|
75
|
+
}
|
|
76
|
+
for (let y = 0; y < 50; y += 10) {
|
|
77
|
+
for (let x = 0; x < 10; x++) B[x] = s[y + x];
|
|
78
|
+
for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
|
|
79
|
+
}
|
|
80
|
+
s[0] ^= SHA3_IOTA_H[round];
|
|
81
|
+
s[1] ^= SHA3_IOTA_L[round];
|
|
82
|
+
}
|
|
83
|
+
(0, utils_ts_1.clean)(B);
|
|
84
|
+
}
|
|
85
|
+
/** Keccak sponge function. */
|
|
86
|
+
var Keccak = class Keccak extends utils_ts_1.Hash {
|
|
87
|
+
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
88
|
+
super();
|
|
89
|
+
this.pos = 0;
|
|
90
|
+
this.posOut = 0;
|
|
91
|
+
this.finished = false;
|
|
92
|
+
this.destroyed = false;
|
|
93
|
+
this.enableXOF = false;
|
|
94
|
+
this.blockLen = blockLen;
|
|
95
|
+
this.suffix = suffix;
|
|
96
|
+
this.outputLen = outputLen;
|
|
97
|
+
this.enableXOF = enableXOF;
|
|
98
|
+
this.rounds = rounds;
|
|
99
|
+
(0, utils_ts_1.anumber)(outputLen);
|
|
100
|
+
if (!(0 < blockLen && blockLen < 200)) throw new Error("only keccak-f1600 function is supported");
|
|
101
|
+
this.state = new Uint8Array(200);
|
|
102
|
+
this.state32 = (0, utils_ts_1.u32)(this.state);
|
|
103
|
+
}
|
|
104
|
+
clone() {
|
|
105
|
+
return this._cloneInto();
|
|
106
|
+
}
|
|
107
|
+
keccak() {
|
|
108
|
+
(0, utils_ts_1.swap32IfBE)(this.state32);
|
|
109
|
+
keccakP(this.state32, this.rounds);
|
|
110
|
+
(0, utils_ts_1.swap32IfBE)(this.state32);
|
|
111
|
+
this.posOut = 0;
|
|
112
|
+
this.pos = 0;
|
|
113
|
+
}
|
|
114
|
+
update(data) {
|
|
115
|
+
(0, utils_ts_1.aexists)(this);
|
|
116
|
+
data = (0, utils_ts_1.toBytes)(data);
|
|
117
|
+
(0, utils_ts_1.abytes)(data);
|
|
118
|
+
const { blockLen, state } = this;
|
|
119
|
+
const len = data.length;
|
|
120
|
+
for (let pos = 0; pos < len;) {
|
|
121
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
122
|
+
for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++];
|
|
123
|
+
if (this.pos === blockLen) this.keccak();
|
|
124
|
+
}
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
finish() {
|
|
128
|
+
if (this.finished) return;
|
|
129
|
+
this.finished = true;
|
|
130
|
+
const { state, suffix, pos, blockLen } = this;
|
|
131
|
+
state[pos] ^= suffix;
|
|
132
|
+
if ((suffix & 128) !== 0 && pos === blockLen - 1) this.keccak();
|
|
133
|
+
state[blockLen - 1] ^= 128;
|
|
134
|
+
this.keccak();
|
|
135
|
+
}
|
|
136
|
+
writeInto(out) {
|
|
137
|
+
(0, utils_ts_1.aexists)(this, false);
|
|
138
|
+
(0, utils_ts_1.abytes)(out);
|
|
139
|
+
this.finish();
|
|
140
|
+
const bufferOut = this.state;
|
|
141
|
+
const { blockLen } = this;
|
|
142
|
+
for (let pos = 0, len = out.length; pos < len;) {
|
|
143
|
+
if (this.posOut >= blockLen) this.keccak();
|
|
144
|
+
const take = Math.min(blockLen - this.posOut, len - pos);
|
|
145
|
+
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
|
146
|
+
this.posOut += take;
|
|
147
|
+
pos += take;
|
|
148
|
+
}
|
|
149
|
+
return out;
|
|
150
|
+
}
|
|
151
|
+
xofInto(out) {
|
|
152
|
+
if (!this.enableXOF) throw new Error("XOF is not possible for this instance");
|
|
153
|
+
return this.writeInto(out);
|
|
154
|
+
}
|
|
155
|
+
xof(bytes) {
|
|
156
|
+
(0, utils_ts_1.anumber)(bytes);
|
|
157
|
+
return this.xofInto(new Uint8Array(bytes));
|
|
158
|
+
}
|
|
159
|
+
digestInto(out) {
|
|
160
|
+
(0, utils_ts_1.aoutput)(out, this);
|
|
161
|
+
if (this.finished) throw new Error("digest() was already called");
|
|
162
|
+
this.writeInto(out);
|
|
163
|
+
this.destroy();
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
digest() {
|
|
167
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
168
|
+
}
|
|
169
|
+
destroy() {
|
|
170
|
+
this.destroyed = true;
|
|
171
|
+
(0, utils_ts_1.clean)(this.state);
|
|
172
|
+
}
|
|
173
|
+
_cloneInto(to) {
|
|
174
|
+
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
175
|
+
to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
|
176
|
+
to.state32.set(this.state32);
|
|
177
|
+
to.pos = this.pos;
|
|
178
|
+
to.posOut = this.posOut;
|
|
179
|
+
to.finished = this.finished;
|
|
180
|
+
to.rounds = rounds;
|
|
181
|
+
to.suffix = suffix;
|
|
182
|
+
to.outputLen = outputLen;
|
|
183
|
+
to.enableXOF = enableXOF;
|
|
184
|
+
to.destroyed = this.destroyed;
|
|
185
|
+
return to;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
exports.Keccak = Keccak;
|
|
189
|
+
const gen = (suffix, blockLen, outputLen) => (0, utils_ts_1.createHasher)(() => new Keccak(blockLen, suffix, outputLen));
|
|
190
|
+
/** SHA3-224 hash function. */
|
|
191
|
+
exports.sha3_224 = gen(6, 144, 224 / 8);
|
|
192
|
+
/** SHA3-256 hash function. Different from keccak-256. */
|
|
193
|
+
exports.sha3_256 = gen(6, 136, 256 / 8);
|
|
194
|
+
/** SHA3-384 hash function. */
|
|
195
|
+
exports.sha3_384 = gen(6, 104, 384 / 8);
|
|
196
|
+
/** SHA3-512 hash function. */
|
|
197
|
+
exports.sha3_512 = gen(6, 72, 512 / 8);
|
|
198
|
+
/** keccak-224 hash function. */
|
|
199
|
+
exports.keccak_224 = gen(1, 144, 224 / 8);
|
|
200
|
+
/** keccak-256 hash function. Different from SHA3-256. */
|
|
201
|
+
exports.keccak_256 = gen(1, 136, 256 / 8);
|
|
202
|
+
/** keccak-384 hash function. */
|
|
203
|
+
exports.keccak_384 = gen(1, 104, 384 / 8);
|
|
204
|
+
/** keccak-512 hash function. */
|
|
205
|
+
exports.keccak_512 = gen(1, 72, 512 / 8);
|
|
206
|
+
const genShake = (suffix, blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
|
|
207
|
+
/** SHAKE128 XOF with 128-bit security. */
|
|
208
|
+
exports.shake128 = genShake(31, 168, 128 / 8);
|
|
209
|
+
/** SHAKE256 XOF with 256-bit security. */
|
|
210
|
+
exports.shake256 = genShake(31, 136, 256 / 8);
|
|
211
|
+
}));
|
|
212
|
+
//#endregion
|
|
213
|
+
export default require_sha3();
|
|
214
|
+
export { require_sha3 };
|