@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,125 @@
|
|
|
1
|
+
import { getAssetBaseStorageUri, getBundlePatch, getManifestFileHash, getManifestStorageUri, stripBundleArtifactMetadata } from "@hot-updater/core";
|
|
2
|
+
//#region src/db/updateArtifacts.ts
|
|
3
|
+
const HBC_ASSET_PATH_RE = /\.bundle$/;
|
|
4
|
+
const BR_COMPRESSED_ASSET_PATH_RE = /(^|\/)index\.[^/]+\.bundle$/;
|
|
5
|
+
const resolveUniqueHbcAssetPath = (manifest) => {
|
|
6
|
+
const candidates = Object.keys(manifest.assets).sort((left, right) => left.localeCompare(right)).filter((candidate) => HBC_ASSET_PATH_RE.test(candidate));
|
|
7
|
+
return candidates.length === 1 ? candidates[0] : null;
|
|
8
|
+
};
|
|
9
|
+
const isBundleManifest = (value) => {
|
|
10
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
11
|
+
const manifest = value;
|
|
12
|
+
if (typeof manifest.bundleId !== "string") return false;
|
|
13
|
+
if (!manifest.assets || typeof manifest.assets !== "object") return false;
|
|
14
|
+
return Object.values(manifest.assets).every((asset) => {
|
|
15
|
+
if (!asset || typeof asset !== "object" || Array.isArray(asset)) return false;
|
|
16
|
+
const manifestAsset = asset;
|
|
17
|
+
return typeof manifestAsset.fileHash === "string" && (manifestAsset.signature === void 0 || typeof manifestAsset.signature === "string");
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const createChildStorageUri = (baseStorageUri, relativePath) => {
|
|
21
|
+
const baseUrl = new URL(baseStorageUri);
|
|
22
|
+
baseUrl.pathname = `${baseUrl.pathname.replace(/\/+$/, "")}/${relativePath.split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
23
|
+
return baseUrl.toString();
|
|
24
|
+
};
|
|
25
|
+
const parseBundleMetadata = (value) => {
|
|
26
|
+
if (!value) return;
|
|
27
|
+
let parsedValue = value;
|
|
28
|
+
if (typeof parsedValue === "string") try {
|
|
29
|
+
parsedValue = JSON.parse(parsedValue);
|
|
30
|
+
} catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (!parsedValue || typeof parsedValue !== "object" || Array.isArray(parsedValue)) return;
|
|
34
|
+
return stripBundleArtifactMetadata(parsedValue);
|
|
35
|
+
};
|
|
36
|
+
async function fetchBundleManifest(storageUri, readStorageText, resolveFileUrl, context) {
|
|
37
|
+
const [storageText, fileUrl] = await Promise.all([readStorageText(storageUri, context), resolveFileUrl(storageUri, context)]);
|
|
38
|
+
if (storageText === null) return null;
|
|
39
|
+
let payload;
|
|
40
|
+
try {
|
|
41
|
+
payload = JSON.parse(storageText);
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
if (!isBundleManifest(payload)) return null;
|
|
46
|
+
if (!fileUrl) return null;
|
|
47
|
+
return {
|
|
48
|
+
fileUrl,
|
|
49
|
+
manifest: payload
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async function resolveChangedAssets({ assetBaseStorageUri, currentManifest, currentBundle, resolveFileUrl, targetBundle, targetManifest, context }) {
|
|
53
|
+
const patchDescriptor = await resolveHbcPatchDescriptor({
|
|
54
|
+
currentBundle,
|
|
55
|
+
resolveFileUrl,
|
|
56
|
+
targetBundle,
|
|
57
|
+
targetManifest,
|
|
58
|
+
context
|
|
59
|
+
});
|
|
60
|
+
const changedEntries = await Promise.all(Object.entries(targetManifest.assets).map(async ([assetPath, asset]) => {
|
|
61
|
+
if ((currentManifest?.assets[assetPath])?.fileHash === asset.fileHash) return null;
|
|
62
|
+
const usesBrotliAsset = BR_COMPRESSED_ASSET_PATH_RE.test(assetPath);
|
|
63
|
+
const storageUri = createChildStorageUri(assetBaseStorageUri, usesBrotliAsset ? `${assetPath}.br` : assetPath);
|
|
64
|
+
const patch = patchDescriptor?.assetPath === assetPath ? patchDescriptor.patch : null;
|
|
65
|
+
let fileUrl = null;
|
|
66
|
+
try {
|
|
67
|
+
fileUrl = await resolveFileUrl(storageUri, context);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (!patch) throw error;
|
|
70
|
+
}
|
|
71
|
+
if (!fileUrl && !patch) return false;
|
|
72
|
+
const changedAsset = { fileHash: asset.fileHash };
|
|
73
|
+
if (fileUrl) {
|
|
74
|
+
changedAsset.file = { url: fileUrl };
|
|
75
|
+
if (usesBrotliAsset) changedAsset.file.compression = "br";
|
|
76
|
+
}
|
|
77
|
+
if (patch) changedAsset.patch = patch;
|
|
78
|
+
return [assetPath, changedAsset];
|
|
79
|
+
}));
|
|
80
|
+
if (changedEntries.some((entry) => entry === false)) return null;
|
|
81
|
+
return Object.fromEntries(changedEntries.filter((entry) => entry !== null));
|
|
82
|
+
}
|
|
83
|
+
async function resolveHbcPatchDescriptor({ currentBundle, resolveFileUrl, targetBundle, targetManifest, context }) {
|
|
84
|
+
const matchingPatch = targetBundle && currentBundle ? getBundlePatch(targetBundle, currentBundle.id) : null;
|
|
85
|
+
const patchAssetPath = resolveUniqueHbcAssetPath(targetManifest);
|
|
86
|
+
if (!currentBundle || !matchingPatch || !patchAssetPath || !matchingPatch.patchStorageUri || !matchingPatch.patchFileHash || !matchingPatch.baseFileHash) return null;
|
|
87
|
+
const patchUrl = await resolveFileUrl(matchingPatch.patchStorageUri, context);
|
|
88
|
+
if (!patchUrl) return null;
|
|
89
|
+
return {
|
|
90
|
+
assetPath: patchAssetPath,
|
|
91
|
+
patch: {
|
|
92
|
+
algorithm: "bsdiff",
|
|
93
|
+
baseBundleId: matchingPatch.baseBundleId,
|
|
94
|
+
baseFileHash: matchingPatch.baseFileHash,
|
|
95
|
+
patchFileHash: matchingPatch.patchFileHash,
|
|
96
|
+
patchUrl
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
async function resolveManifestArtifacts({ currentBundle, resolveFileUrl, readStorageText, targetBundle, context }) {
|
|
101
|
+
const manifestStorageUri = targetBundle ? getManifestStorageUri(targetBundle) : null;
|
|
102
|
+
const manifestFileHash = targetBundle ? getManifestFileHash(targetBundle) : null;
|
|
103
|
+
const assetBaseStorageUri = targetBundle ? getAssetBaseStorageUri(targetBundle) : null;
|
|
104
|
+
if (!manifestStorageUri || !manifestFileHash || !assetBaseStorageUri) return null;
|
|
105
|
+
const currentManifestStorageUri = currentBundle ? getManifestStorageUri(currentBundle) : null;
|
|
106
|
+
const [targetManifestResult, currentManifestResult] = await Promise.all([fetchBundleManifest(manifestStorageUri, readStorageText, resolveFileUrl, context), currentManifestStorageUri ? fetchBundleManifest(currentManifestStorageUri, readStorageText, resolveFileUrl, context) : null]);
|
|
107
|
+
if (!targetManifestResult) return null;
|
|
108
|
+
const changedAssets = await resolveChangedAssets({
|
|
109
|
+
assetBaseStorageUri,
|
|
110
|
+
currentManifest: currentManifestResult?.manifest ?? null,
|
|
111
|
+
currentBundle,
|
|
112
|
+
resolveFileUrl,
|
|
113
|
+
targetBundle,
|
|
114
|
+
targetManifest: targetManifestResult.manifest,
|
|
115
|
+
context
|
|
116
|
+
});
|
|
117
|
+
if (!changedAssets) return null;
|
|
118
|
+
return {
|
|
119
|
+
changedAssets,
|
|
120
|
+
manifestFileHash,
|
|
121
|
+
manifestUrl: targetManifestResult.fileUrl
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { parseBundleMetadata, resolveManifestArtifacts };
|
package/dist/handler.cjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
1
2
|
const require_internalRouter = require("./internalRouter.cjs");
|
|
2
3
|
const require_version = require("./version.cjs");
|
|
4
|
+
let semver = require("semver");
|
|
5
|
+
semver = require_runtime.__toESM(semver);
|
|
3
6
|
//#region src/handler.ts
|
|
4
7
|
var HandlerBadRequestError = class extends Error {
|
|
5
8
|
constructor(message) {
|
|
@@ -7,6 +10,19 @@ var HandlerBadRequestError = class extends Error {
|
|
|
7
10
|
this.name = "HandlerBadRequestError";
|
|
8
11
|
}
|
|
9
12
|
};
|
|
13
|
+
const SDK_VERSION_HEADER = "Hot-Updater-SDK-Version";
|
|
14
|
+
const EXPLICIT_NO_UPDATE_MIN_SDK_VERSION = "0.31.0";
|
|
15
|
+
const supportsExplicitNoUpdateResponse = (request) => {
|
|
16
|
+
const sdkVersion = request.headers.get(SDK_VERSION_HEADER)?.trim();
|
|
17
|
+
if (!sdkVersion) return false;
|
|
18
|
+
const normalizedSdkVersion = semver.default.valid(sdkVersion);
|
|
19
|
+
return normalizedSdkVersion !== null && semver.default.gte(normalizedSdkVersion, EXPLICIT_NO_UPDATE_MIN_SDK_VERSION);
|
|
20
|
+
};
|
|
21
|
+
const serializeUpdateInfo = (updateInfo, request) => {
|
|
22
|
+
if (updateInfo) return JSON.stringify(updateInfo);
|
|
23
|
+
if (supportsExplicitNoUpdateResponse(request)) return JSON.stringify({ status: "UP_TO_DATE" });
|
|
24
|
+
return JSON.stringify(null);
|
|
25
|
+
};
|
|
10
26
|
const handleVersion = async () => {
|
|
11
27
|
return new Response(JSON.stringify({ version: require_version.HOT_UPDATER_SERVER_VERSION }), {
|
|
12
28
|
status: 200,
|
|
@@ -29,6 +45,22 @@ const requireRouteParam = (params, key) => {
|
|
|
29
45
|
if (!value) throw new HandlerBadRequestError(`Missing route parameter: ${key}`);
|
|
30
46
|
return value;
|
|
31
47
|
};
|
|
48
|
+
const parseBooleanSearchParam = (url, key) => {
|
|
49
|
+
const value = url.searchParams.get(key);
|
|
50
|
+
if (value === null) return;
|
|
51
|
+
if (value === "true") return true;
|
|
52
|
+
if (value === "false") return false;
|
|
53
|
+
throw new HandlerBadRequestError(`The '${key}' query parameter must be 'true' or 'false'.`);
|
|
54
|
+
};
|
|
55
|
+
const parseNullableStringSearchParam = (url, key) => {
|
|
56
|
+
const value = url.searchParams.get(key);
|
|
57
|
+
if (value === null) return;
|
|
58
|
+
return value === "null" ? null : value;
|
|
59
|
+
};
|
|
60
|
+
const parseStringArraySearchParam = (url, key) => {
|
|
61
|
+
const values = url.searchParams.getAll(key);
|
|
62
|
+
return values.length > 0 ? values : void 0;
|
|
63
|
+
};
|
|
32
64
|
const requirePlatformParam = (params) => {
|
|
33
65
|
const platform = requireRouteParam(params, "platform");
|
|
34
66
|
if (!isPlatform(platform)) throw new HandlerBadRequestError(`Invalid platform: ${platform}. Expected 'ios' or 'android'.`);
|
|
@@ -41,7 +73,7 @@ const requireBundlePatchPayload = (payload, bundleId) => {
|
|
|
41
73
|
const { id: _ignoredId, ...rest } = bundlePatch;
|
|
42
74
|
return rest;
|
|
43
75
|
};
|
|
44
|
-
const handleFingerprintUpdateWithCohort = async (params,
|
|
76
|
+
const handleFingerprintUpdateWithCohort = async (params, request, api, context) => {
|
|
45
77
|
const platform = requirePlatformParam(params);
|
|
46
78
|
const fingerprintHash = requireRouteParam(params, "fingerprintHash");
|
|
47
79
|
const channel = requireRouteParam(params, "channel");
|
|
@@ -56,12 +88,12 @@ const handleFingerprintUpdateWithCohort = async (params, _request, api, context)
|
|
|
56
88
|
bundleId,
|
|
57
89
|
cohort: decodeMaybe(params.cohort)
|
|
58
90
|
}, context);
|
|
59
|
-
return new Response(
|
|
91
|
+
return new Response(serializeUpdateInfo(updateInfo, request), {
|
|
60
92
|
status: 200,
|
|
61
93
|
headers: { "Content-Type": "application/json" }
|
|
62
94
|
});
|
|
63
95
|
};
|
|
64
|
-
const handleAppVersionUpdateWithCohort = async (params,
|
|
96
|
+
const handleAppVersionUpdateWithCohort = async (params, request, api, context) => {
|
|
65
97
|
const platform = requirePlatformParam(params);
|
|
66
98
|
const appVersion = requireRouteParam(params, "appVersion");
|
|
67
99
|
const channel = requireRouteParam(params, "channel");
|
|
@@ -76,7 +108,7 @@ const handleAppVersionUpdateWithCohort = async (params, _request, api, context)
|
|
|
76
108
|
bundleId,
|
|
77
109
|
cohort: decodeMaybe(params.cohort)
|
|
78
110
|
}, context);
|
|
79
|
-
return new Response(
|
|
111
|
+
return new Response(serializeUpdateInfo(updateInfo, request), {
|
|
80
112
|
status: 200,
|
|
81
113
|
headers: { "Content-Type": "application/json" }
|
|
82
114
|
});
|
|
@@ -102,6 +134,17 @@ const handleGetBundles = async (_params, request, api, context) => {
|
|
|
102
134
|
const offset = url.searchParams.get("offset");
|
|
103
135
|
const after = url.searchParams.get("after") ?? void 0;
|
|
104
136
|
const before = url.searchParams.get("before") ?? void 0;
|
|
137
|
+
const enabled = parseBooleanSearchParam(url, "enabled");
|
|
138
|
+
const targetAppVersion = parseNullableStringSearchParam(url, "targetAppVersion");
|
|
139
|
+
const targetAppVersionIn = parseStringArraySearchParam(url, "targetAppVersionIn");
|
|
140
|
+
const targetAppVersionNotNull = parseBooleanSearchParam(url, "targetAppVersionNotNull");
|
|
141
|
+
const fingerprintHash = parseNullableStringSearchParam(url, "fingerprintHash");
|
|
142
|
+
const idEq = url.searchParams.get("idEq") ?? void 0;
|
|
143
|
+
const idGt = url.searchParams.get("idGt") ?? void 0;
|
|
144
|
+
const idGte = url.searchParams.get("idGte") ?? void 0;
|
|
145
|
+
const idLt = url.searchParams.get("idLt") ?? void 0;
|
|
146
|
+
const idLte = url.searchParams.get("idLte") ?? void 0;
|
|
147
|
+
const idIn = parseStringArraySearchParam(url, "idIn");
|
|
105
148
|
const page = pageParam === null ? void 0 : Number.isInteger(Number(pageParam)) && Number(pageParam) > 0 ? Number(pageParam) : null;
|
|
106
149
|
if (offset !== null) throw new HandlerBadRequestError("The 'offset' query parameter has been removed. Use 'after' or 'before' cursor pagination instead.");
|
|
107
150
|
if (page === null) throw new HandlerBadRequestError("The 'page' query parameter must be a positive integer.");
|
|
@@ -109,7 +152,20 @@ const handleGetBundles = async (_params, request, api, context) => {
|
|
|
109
152
|
const result = await api.getBundles({
|
|
110
153
|
where: {
|
|
111
154
|
...channel && { channel },
|
|
112
|
-
...platform && { platform }
|
|
155
|
+
...platform && { platform },
|
|
156
|
+
...enabled !== void 0 && { enabled },
|
|
157
|
+
...idEq || idGt || idGte || idLt || idLte || idIn && idIn.length > 0 ? { id: {
|
|
158
|
+
...idEq && { eq: idEq },
|
|
159
|
+
...idGt && { gt: idGt },
|
|
160
|
+
...idGte && { gte: idGte },
|
|
161
|
+
...idLt && { lt: idLt },
|
|
162
|
+
...idLte && { lte: idLte },
|
|
163
|
+
...idIn && idIn.length > 0 && { in: idIn }
|
|
164
|
+
} } : {},
|
|
165
|
+
...targetAppVersion !== void 0 && { targetAppVersion },
|
|
166
|
+
...targetAppVersionIn && { targetAppVersionIn },
|
|
167
|
+
...targetAppVersionNotNull !== void 0 && { targetAppVersionNotNull },
|
|
168
|
+
...fingerprintHash !== void 0 && { fingerprintHash }
|
|
113
169
|
},
|
|
114
170
|
limit,
|
|
115
171
|
page,
|
package/dist/handler.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PaginatedResult } from "./types/index.cjs";
|
|
2
|
+
import { AppUpdateAvailableInfo, AppVersionGetBundlesArgs, Bundle, FingerprintGetBundlesArgs } from "@hot-updater/core";
|
|
2
3
|
import { DatabaseBundleQueryOptions, HotUpdaterContext } from "@hot-updater/plugin-core";
|
|
3
|
-
import { AppUpdateInfo, AppVersionGetBundlesArgs, Bundle, FingerprintGetBundlesArgs } from "@hot-updater/core";
|
|
4
4
|
|
|
5
5
|
//#region src/handler.d.ts
|
|
6
6
|
interface HandlerAPI<TContext = unknown> {
|
|
7
|
-
getAppUpdateInfo: (args: AppVersionGetBundlesArgs | FingerprintGetBundlesArgs, context?: HotUpdaterContext<TContext>) => Promise<
|
|
7
|
+
getAppUpdateInfo: (args: AppVersionGetBundlesArgs | FingerprintGetBundlesArgs, context?: HotUpdaterContext<TContext>) => Promise<AppUpdateAvailableInfo | null>;
|
|
8
8
|
getBundleById: (id: string, context?: HotUpdaterContext<TContext>) => Promise<Bundle | null>;
|
|
9
9
|
getBundles: (options: DatabaseBundleQueryOptions, context?: HotUpdaterContext<TContext>) => Promise<PaginatedResult>;
|
|
10
10
|
insertBundle: (bundle: Bundle, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
package/dist/handler.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PaginatedResult } from "./types/index.mjs";
|
|
2
|
-
import { AppUpdateInfo, AppVersionGetBundlesArgs, Bundle, FingerprintGetBundlesArgs } from "@hot-updater/core";
|
|
3
2
|
import { DatabaseBundleQueryOptions, HotUpdaterContext } from "@hot-updater/plugin-core";
|
|
3
|
+
import { AppUpdateAvailableInfo, AppVersionGetBundlesArgs, Bundle as Bundle$1, FingerprintGetBundlesArgs } from "@hot-updater/core";
|
|
4
4
|
|
|
5
5
|
//#region src/handler.d.ts
|
|
6
6
|
interface HandlerAPI<TContext = unknown> {
|
|
7
|
-
getAppUpdateInfo: (args: AppVersionGetBundlesArgs | FingerprintGetBundlesArgs, context?: HotUpdaterContext<TContext>) => Promise<
|
|
8
|
-
getBundleById: (id: string, context?: HotUpdaterContext<TContext>) => Promise<Bundle | null>;
|
|
7
|
+
getAppUpdateInfo: (args: AppVersionGetBundlesArgs | FingerprintGetBundlesArgs, context?: HotUpdaterContext<TContext>) => Promise<AppUpdateAvailableInfo | null>;
|
|
8
|
+
getBundleById: (id: string, context?: HotUpdaterContext<TContext>) => Promise<Bundle$1 | null>;
|
|
9
9
|
getBundles: (options: DatabaseBundleQueryOptions, context?: HotUpdaterContext<TContext>) => Promise<PaginatedResult>;
|
|
10
|
-
insertBundle: (bundle: Bundle, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
|
11
|
-
updateBundleById: (bundleId: string, bundle: Partial<Bundle>, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
|
10
|
+
insertBundle: (bundle: Bundle$1, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
|
11
|
+
updateBundleById: (bundleId: string, bundle: Partial<Bundle$1>, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
|
12
12
|
deleteBundleById: (bundleId: string, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
|
13
13
|
getChannels: (context?: HotUpdaterContext<TContext>) => Promise<string[]>;
|
|
14
14
|
}
|
package/dist/handler.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addRoute, createRouter, findRoute } from "./internalRouter.mjs";
|
|
2
2
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
3
|
+
import semver from "semver";
|
|
3
4
|
//#region src/handler.ts
|
|
4
5
|
var HandlerBadRequestError = class extends Error {
|
|
5
6
|
constructor(message) {
|
|
@@ -7,6 +8,19 @@ var HandlerBadRequestError = class extends Error {
|
|
|
7
8
|
this.name = "HandlerBadRequestError";
|
|
8
9
|
}
|
|
9
10
|
};
|
|
11
|
+
const SDK_VERSION_HEADER = "Hot-Updater-SDK-Version";
|
|
12
|
+
const EXPLICIT_NO_UPDATE_MIN_SDK_VERSION = "0.31.0";
|
|
13
|
+
const supportsExplicitNoUpdateResponse = (request) => {
|
|
14
|
+
const sdkVersion = request.headers.get(SDK_VERSION_HEADER)?.trim();
|
|
15
|
+
if (!sdkVersion) return false;
|
|
16
|
+
const normalizedSdkVersion = semver.valid(sdkVersion);
|
|
17
|
+
return normalizedSdkVersion !== null && semver.gte(normalizedSdkVersion, EXPLICIT_NO_UPDATE_MIN_SDK_VERSION);
|
|
18
|
+
};
|
|
19
|
+
const serializeUpdateInfo = (updateInfo, request) => {
|
|
20
|
+
if (updateInfo) return JSON.stringify(updateInfo);
|
|
21
|
+
if (supportsExplicitNoUpdateResponse(request)) return JSON.stringify({ status: "UP_TO_DATE" });
|
|
22
|
+
return JSON.stringify(null);
|
|
23
|
+
};
|
|
10
24
|
const handleVersion = async () => {
|
|
11
25
|
return new Response(JSON.stringify({ version: HOT_UPDATER_SERVER_VERSION }), {
|
|
12
26
|
status: 200,
|
|
@@ -29,6 +43,22 @@ const requireRouteParam = (params, key) => {
|
|
|
29
43
|
if (!value) throw new HandlerBadRequestError(`Missing route parameter: ${key}`);
|
|
30
44
|
return value;
|
|
31
45
|
};
|
|
46
|
+
const parseBooleanSearchParam = (url, key) => {
|
|
47
|
+
const value = url.searchParams.get(key);
|
|
48
|
+
if (value === null) return;
|
|
49
|
+
if (value === "true") return true;
|
|
50
|
+
if (value === "false") return false;
|
|
51
|
+
throw new HandlerBadRequestError(`The '${key}' query parameter must be 'true' or 'false'.`);
|
|
52
|
+
};
|
|
53
|
+
const parseNullableStringSearchParam = (url, key) => {
|
|
54
|
+
const value = url.searchParams.get(key);
|
|
55
|
+
if (value === null) return;
|
|
56
|
+
return value === "null" ? null : value;
|
|
57
|
+
};
|
|
58
|
+
const parseStringArraySearchParam = (url, key) => {
|
|
59
|
+
const values = url.searchParams.getAll(key);
|
|
60
|
+
return values.length > 0 ? values : void 0;
|
|
61
|
+
};
|
|
32
62
|
const requirePlatformParam = (params) => {
|
|
33
63
|
const platform = requireRouteParam(params, "platform");
|
|
34
64
|
if (!isPlatform(platform)) throw new HandlerBadRequestError(`Invalid platform: ${platform}. Expected 'ios' or 'android'.`);
|
|
@@ -41,7 +71,7 @@ const requireBundlePatchPayload = (payload, bundleId) => {
|
|
|
41
71
|
const { id: _ignoredId, ...rest } = bundlePatch;
|
|
42
72
|
return rest;
|
|
43
73
|
};
|
|
44
|
-
const handleFingerprintUpdateWithCohort = async (params,
|
|
74
|
+
const handleFingerprintUpdateWithCohort = async (params, request, api, context) => {
|
|
45
75
|
const platform = requirePlatformParam(params);
|
|
46
76
|
const fingerprintHash = requireRouteParam(params, "fingerprintHash");
|
|
47
77
|
const channel = requireRouteParam(params, "channel");
|
|
@@ -56,12 +86,12 @@ const handleFingerprintUpdateWithCohort = async (params, _request, api, context)
|
|
|
56
86
|
bundleId,
|
|
57
87
|
cohort: decodeMaybe(params.cohort)
|
|
58
88
|
}, context);
|
|
59
|
-
return new Response(
|
|
89
|
+
return new Response(serializeUpdateInfo(updateInfo, request), {
|
|
60
90
|
status: 200,
|
|
61
91
|
headers: { "Content-Type": "application/json" }
|
|
62
92
|
});
|
|
63
93
|
};
|
|
64
|
-
const handleAppVersionUpdateWithCohort = async (params,
|
|
94
|
+
const handleAppVersionUpdateWithCohort = async (params, request, api, context) => {
|
|
65
95
|
const platform = requirePlatformParam(params);
|
|
66
96
|
const appVersion = requireRouteParam(params, "appVersion");
|
|
67
97
|
const channel = requireRouteParam(params, "channel");
|
|
@@ -76,7 +106,7 @@ const handleAppVersionUpdateWithCohort = async (params, _request, api, context)
|
|
|
76
106
|
bundleId,
|
|
77
107
|
cohort: decodeMaybe(params.cohort)
|
|
78
108
|
}, context);
|
|
79
|
-
return new Response(
|
|
109
|
+
return new Response(serializeUpdateInfo(updateInfo, request), {
|
|
80
110
|
status: 200,
|
|
81
111
|
headers: { "Content-Type": "application/json" }
|
|
82
112
|
});
|
|
@@ -102,6 +132,17 @@ const handleGetBundles = async (_params, request, api, context) => {
|
|
|
102
132
|
const offset = url.searchParams.get("offset");
|
|
103
133
|
const after = url.searchParams.get("after") ?? void 0;
|
|
104
134
|
const before = url.searchParams.get("before") ?? void 0;
|
|
135
|
+
const enabled = parseBooleanSearchParam(url, "enabled");
|
|
136
|
+
const targetAppVersion = parseNullableStringSearchParam(url, "targetAppVersion");
|
|
137
|
+
const targetAppVersionIn = parseStringArraySearchParam(url, "targetAppVersionIn");
|
|
138
|
+
const targetAppVersionNotNull = parseBooleanSearchParam(url, "targetAppVersionNotNull");
|
|
139
|
+
const fingerprintHash = parseNullableStringSearchParam(url, "fingerprintHash");
|
|
140
|
+
const idEq = url.searchParams.get("idEq") ?? void 0;
|
|
141
|
+
const idGt = url.searchParams.get("idGt") ?? void 0;
|
|
142
|
+
const idGte = url.searchParams.get("idGte") ?? void 0;
|
|
143
|
+
const idLt = url.searchParams.get("idLt") ?? void 0;
|
|
144
|
+
const idLte = url.searchParams.get("idLte") ?? void 0;
|
|
145
|
+
const idIn = parseStringArraySearchParam(url, "idIn");
|
|
105
146
|
const page = pageParam === null ? void 0 : Number.isInteger(Number(pageParam)) && Number(pageParam) > 0 ? Number(pageParam) : null;
|
|
106
147
|
if (offset !== null) throw new HandlerBadRequestError("The 'offset' query parameter has been removed. Use 'after' or 'before' cursor pagination instead.");
|
|
107
148
|
if (page === null) throw new HandlerBadRequestError("The 'page' query parameter must be a positive integer.");
|
|
@@ -109,7 +150,20 @@ const handleGetBundles = async (_params, request, api, context) => {
|
|
|
109
150
|
const result = await api.getBundles({
|
|
110
151
|
where: {
|
|
111
152
|
...channel && { channel },
|
|
112
|
-
...platform && { platform }
|
|
153
|
+
...platform && { platform },
|
|
154
|
+
...enabled !== void 0 && { enabled },
|
|
155
|
+
...idEq || idGt || idGte || idLt || idLte || idIn && idIn.length > 0 ? { id: {
|
|
156
|
+
...idEq && { eq: idEq },
|
|
157
|
+
...idGt && { gt: idGt },
|
|
158
|
+
...idGte && { gte: idGte },
|
|
159
|
+
...idLt && { lt: idLt },
|
|
160
|
+
...idLte && { lte: idLte },
|
|
161
|
+
...idIn && idIn.length > 0 && { in: idIn }
|
|
162
|
+
} } : {},
|
|
163
|
+
...targetAppVersion !== void 0 && { targetAppVersion },
|
|
164
|
+
...targetAppVersionIn && { targetAppVersionIn },
|
|
165
|
+
...targetAppVersionNotNull !== void 0 && { targetAppVersionNotNull },
|
|
166
|
+
...fingerprintHash !== void 0 && { fingerprintHash }
|
|
113
167
|
},
|
|
114
168
|
limit,
|
|
115
169
|
page,
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_createBundleDiff = require("./db/createBundleDiff.cjs");
|
|
2
3
|
const require_version = require("./version.cjs");
|
|
3
4
|
const require_handler = require("./handler.cjs");
|
|
4
5
|
const require_ormCore = require("./db/ormCore.cjs");
|
|
5
6
|
const require_index = require("./db/index.cjs");
|
|
6
7
|
exports.HOT_UPDATER_SERVER_VERSION = require_version.HOT_UPDATER_SERVER_VERSION;
|
|
7
8
|
exports.HotUpdaterDB = require_ormCore.HotUpdaterDB;
|
|
9
|
+
exports.createBundleDiff = require_createBundleDiff.createBundleDiff;
|
|
8
10
|
exports.createHandler = require_handler.createHandler;
|
|
9
11
|
exports.createHotUpdater = require_index.createHotUpdater;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateBundleDiffDependencies, CreateBundleDiffInput, CreateBundleDiffOptions, createBundleDiff } from "./db/createBundleDiff.cjs";
|
|
2
2
|
import { HandlerAPI, HandlerOptions, HandlerRoutes, createHandler } from "./handler.cjs";
|
|
3
3
|
import { HotUpdaterClient, HotUpdaterDB, Migrator } from "./db/ormCore.cjs";
|
|
4
4
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.cjs";
|
|
5
5
|
import { CreateHotUpdaterOptions, HotUpdaterAPI, createHotUpdater } from "./db/index.cjs";
|
|
6
|
-
|
|
6
|
+
import { Bundle, ChannelsResponse, DataResponse, Paginated, PaginatedResult, PaginationInfo, PaginationOptions } from "./types/index.cjs";
|
|
7
|
+
export { Bundle, ChannelsResponse, CreateBundleDiffDependencies, CreateBundleDiffInput, CreateBundleDiffOptions, CreateHotUpdaterOptions, DataResponse, HOT_UPDATER_SERVER_VERSION, HandlerAPI, HandlerOptions, HandlerRoutes, HotUpdaterAPI, HotUpdaterClient, HotUpdaterDB, Migrator, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, createBundleDiff, createHandler, createHotUpdater };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateBundleDiffDependencies, CreateBundleDiffInput, CreateBundleDiffOptions, createBundleDiff } from "./db/createBundleDiff.mjs";
|
|
2
2
|
import { HandlerAPI, HandlerOptions, HandlerRoutes, createHandler } from "./handler.mjs";
|
|
3
3
|
import { HotUpdaterClient, HotUpdaterDB, Migrator } from "./db/ormCore.mjs";
|
|
4
4
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
5
5
|
import { CreateHotUpdaterOptions, HotUpdaterAPI, createHotUpdater } from "./db/index.mjs";
|
|
6
|
-
|
|
6
|
+
import { Bundle, ChannelsResponse, DataResponse, Paginated, PaginatedResult, PaginationInfo, PaginationOptions } from "./types/index.mjs";
|
|
7
|
+
export { Bundle, ChannelsResponse, CreateBundleDiffDependencies, CreateBundleDiffInput, CreateBundleDiffOptions, CreateHotUpdaterOptions, DataResponse, HOT_UPDATER_SERVER_VERSION, HandlerAPI, HandlerOptions, HandlerRoutes, HotUpdaterAPI, HotUpdaterClient, HotUpdaterDB, Migrator, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, createBundleDiff, createHandler, createHotUpdater };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { createBundleDiff } from "./db/createBundleDiff.mjs";
|
|
1
2
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
2
3
|
import { createHandler } from "./handler.mjs";
|
|
3
4
|
import { HotUpdaterDB } from "./db/ormCore.mjs";
|
|
4
5
|
import { createHotUpdater } from "./db/index.mjs";
|
|
5
|
-
export { HOT_UPDATER_SERVER_VERSION, HotUpdaterDB, createHandler, createHotUpdater };
|
|
6
|
+
export { HOT_UPDATER_SERVER_VERSION, HotUpdaterDB, createBundleDiff, createHandler, createHotUpdater };
|
package/dist/node.d.cts
CHANGED
package/dist/node.d.mts
CHANGED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_u64.js
|
|
3
|
+
var require__u64 = /* @__PURE__ */ require("../../../../../../_virtual/_rolldown/runtime.cjs").__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
|
+
Object.defineProperty(exports, "default", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function() {
|
|
110
|
+
return require__u64();
|
|
111
|
+
}
|
|
112
|
+
});
|