@hot-updater/plugin-core 1.0.0-rc.3 → 1.0.0-rc.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/README.md +33 -0
  2. package/dist/baseCandidateKey.cjs +50 -0
  3. package/dist/baseCandidateKey.d.cts +27 -0
  4. package/dist/baseCandidateKey.d.mts +27 -0
  5. package/dist/baseCandidateKey.mjs +49 -0
  6. package/dist/bundleStorageLayout.cjs +7 -0
  7. package/dist/bundleStorageLayout.d.cts +5 -1
  8. package/dist/bundleStorageLayout.d.mts +5 -1
  9. package/dist/bundleStorageLayout.mjs +7 -1
  10. package/dist/contentType.cjs +9 -0
  11. package/dist/contentType.d.cts +4 -0
  12. package/dist/contentType.d.mts +4 -0
  13. package/dist/contentType.mjs +7 -0
  14. package/dist/coreApi.d.cts +131 -0
  15. package/dist/coreApi.d.mts +131 -0
  16. package/dist/createStorageAdapter.cjs +8 -0
  17. package/dist/createStorageAdapter.d.cts +9 -0
  18. package/dist/createStorageAdapter.d.mts +9 -0
  19. package/dist/createStorageAdapter.mjs +7 -0
  20. package/dist/database/adapter.cjs +61 -0
  21. package/dist/database/adapter.d.cts +200 -0
  22. package/dist/database/adapter.d.mts +200 -0
  23. package/dist/database/adapter.mjs +55 -0
  24. package/dist/database/distinct.cjs +88 -0
  25. package/dist/database/distinct.d.cts +18 -0
  26. package/dist/database/distinct.d.mts +18 -0
  27. package/dist/database/distinct.mjs +85 -0
  28. package/dist/database/memoryAdapter.cjs +107 -0
  29. package/dist/database/memoryAdapter.d.cts +14 -0
  30. package/dist/database/memoryAdapter.d.mts +14 -0
  31. package/dist/database/memoryAdapter.mjs +107 -0
  32. package/dist/database/values.cjs +114 -0
  33. package/dist/database/values.d.cts +17 -0
  34. package/dist/database/values.d.mts +17 -0
  35. package/dist/database/values.mjs +104 -0
  36. package/dist/database/verifyAdapter.cjs +137 -0
  37. package/dist/database/verifyAdapter.d.cts +37 -0
  38. package/dist/database/verifyAdapter.d.mts +37 -0
  39. package/dist/database/verifyAdapter.mjs +136 -0
  40. package/dist/databaseErrors.cjs +30 -0
  41. package/dist/databaseErrors.d.cts +21 -0
  42. package/dist/databaseErrors.d.mts +21 -0
  43. package/dist/databaseErrors.mjs +28 -0
  44. package/dist/databaseJsonValue.cjs +6 -0
  45. package/dist/databaseJsonValue.d.cts +9 -2
  46. package/dist/databaseJsonValue.d.mts +9 -2
  47. package/dist/databaseJsonValue.mjs +6 -0
  48. package/dist/databaseMetadata.cjs +4 -4
  49. package/dist/databaseMetadata.mjs +3 -3
  50. package/dist/databaseRows.cjs +6 -12
  51. package/dist/databaseRows.d.cts +1 -1
  52. package/dist/databaseRows.d.mts +1 -1
  53. package/dist/databaseRows.mjs +1 -7
  54. package/dist/engine/core/schema.cjs +279 -0
  55. package/dist/engine/core/schema.d.cts +312 -0
  56. package/dist/engine/core/schema.d.mts +312 -0
  57. package/dist/engine/core/schema.mjs +277 -0
  58. package/dist/engine/createEngine.cjs +72 -0
  59. package/dist/engine/createEngine.d.cts +45 -0
  60. package/dist/engine/createEngine.d.mts +45 -0
  61. package/dist/engine/createEngine.mjs +72 -0
  62. package/dist/engine/database/aggregateBatching.cjs +627 -0
  63. package/dist/engine/database/aggregateBatching.mjs +626 -0
  64. package/dist/engine/database/cursor.cjs +42 -0
  65. package/dist/engine/database/cursor.mjs +38 -0
  66. package/dist/engine/database/database.cjs +68 -0
  67. package/dist/engine/database/database.mjs +68 -0
  68. package/dist/engine/database/engine.cjs +37 -0
  69. package/dist/engine/database/engine.mjs +37 -0
  70. package/dist/engine/database/engineAggregates.cjs +120 -0
  71. package/dist/engine/database/engineAggregates.mjs +117 -0
  72. package/dist/engine/database/engineReads.cjs +182 -0
  73. package/dist/engine/database/engineReads.d.cts +10 -0
  74. package/dist/engine/database/engineReads.d.mts +10 -0
  75. package/dist/engine/database/engineReads.mjs +181 -0
  76. package/dist/engine/database/engineTransaction.cjs +399 -0
  77. package/dist/engine/database/engineTransaction.d.cts +18 -0
  78. package/dist/engine/database/engineTransaction.d.mts +18 -0
  79. package/dist/engine/database/engineTransaction.mjs +398 -0
  80. package/dist/engine/database/fence.cjs +156 -0
  81. package/dist/engine/database/fence.d.cts +41 -0
  82. package/dist/engine/database/fence.d.mts +41 -0
  83. package/dist/engine/database/fence.mjs +149 -0
  84. package/dist/engine/database/kv/kvAdapter.cjs +293 -0
  85. package/dist/engine/database/kv/kvAdapter.d.cts +116 -0
  86. package/dist/engine/database/kv/kvAdapter.d.mts +116 -0
  87. package/dist/engine/database/kv/kvAdapter.mjs +292 -0
  88. package/dist/engine/database/readMeter.cjs +80 -0
  89. package/dist/engine/database/readMeter.d.cts +34 -0
  90. package/dist/engine/database/readMeter.d.mts +34 -0
  91. package/dist/engine/database/readMeter.mjs +79 -0
  92. package/dist/engine/database/resolveSchema.cjs +197 -0
  93. package/dist/engine/database/resolveSchema.d.cts +35 -0
  94. package/dist/engine/database/resolveSchema.d.mts +35 -0
  95. package/dist/engine/database/resolveSchema.mjs +195 -0
  96. package/dist/engine/database/retention.cjs +100 -0
  97. package/dist/engine/database/retention.mjs +98 -0
  98. package/dist/engine/database/sql/sqlAdapter.cjs +290 -0
  99. package/dist/engine/database/sql/sqlAdapter.d.cts +45 -0
  100. package/dist/engine/database/sql/sqlAdapter.d.mts +45 -0
  101. package/dist/engine/database/sql/sqlAdapter.mjs +288 -0
  102. package/dist/engine/database/sql/sqlSchema.cjs +175 -0
  103. package/dist/engine/database/sql/sqlSchema.d.cts +45 -0
  104. package/dist/engine/database/sql/sqlSchema.d.mts +45 -0
  105. package/dist/engine/database/sql/sqlSchema.mjs +169 -0
  106. package/dist/engine/db/coreDatabase.cjs +94 -0
  107. package/dist/engine/db/coreDatabase.d.cts +78 -0
  108. package/dist/engine/db/coreDatabase.d.mts +78 -0
  109. package/dist/engine/db/coreDatabase.mjs +86 -0
  110. package/dist/engine/db/engineMigrator.cjs +53 -0
  111. package/dist/engine/db/engineMigrator.mjs +53 -0
  112. package/dist/engine/db/engineSql.cjs +26 -0
  113. package/dist/engine/db/engineSql.d.cts +16 -0
  114. package/dist/engine/db/engineSql.d.mts +16 -0
  115. package/dist/engine/db/engineSql.mjs +25 -0
  116. package/dist/engine/db/engineSqlMigrator.cjs +67 -0
  117. package/dist/engine/db/engineSqlMigrator.d.cts +21 -0
  118. package/dist/engine/db/engineSqlMigrator.d.mts +21 -0
  119. package/dist/engine/db/engineSqlMigrator.mjs +67 -0
  120. package/dist/engine/db/fixedMigratorShared.cjs +12 -0
  121. package/dist/engine/db/fixedMigratorShared.mjs +11 -0
  122. package/dist/engine/db/schemaSettings.cjs +63 -0
  123. package/dist/engine/db/schemaSettings.d.cts +7 -0
  124. package/dist/engine/db/schemaSettings.d.mts +7 -0
  125. package/dist/engine/db/schemaSettings.mjs +62 -0
  126. package/dist/engine/db/settingsMigrator.cjs +94 -0
  127. package/dist/engine/db/settingsMigrator.d.cts +25 -0
  128. package/dist/engine/db/settingsMigrator.d.mts +25 -0
  129. package/dist/engine/db/settingsMigrator.mjs +91 -0
  130. package/dist/engine/db/types.d.cts +78 -0
  131. package/dist/engine/db/types.d.mts +78 -0
  132. package/dist/index.cjs +97 -49
  133. package/dist/index.d.cts +46 -22
  134. package/dist/index.d.mts +46 -22
  135. package/dist/index.mjs +32 -17
  136. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.cjs +0 -5
  137. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.mjs +1 -5
  138. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.cjs +8 -0
  139. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.mjs +9 -2
  140. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.cjs +4 -0
  141. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.mjs +4 -1
  142. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.cjs +0 -5
  143. package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.mjs +2 -6
  144. package/dist/releaseCatalogCompiler.cjs +27 -26
  145. package/dist/releaseCatalogCompiler.d.cts +1 -2
  146. package/dist/releaseCatalogCompiler.d.mts +2 -3
  147. package/dist/releaseCatalogCompiler.mjs +5 -9
  148. package/dist/releaseCatalogMutation.cjs +0 -292
  149. package/dist/releaseCatalogMutation.d.cts +4 -45
  150. package/dist/releaseCatalogMutation.d.mts +4 -45
  151. package/dist/releaseCatalogMutation.mjs +1 -288
  152. package/dist/releaseManagement.cjs +0 -221
  153. package/dist/releaseManagement.d.cts +4 -28
  154. package/dist/releaseManagement.d.mts +4 -28
  155. package/dist/releaseManagement.mjs +1 -216
  156. package/dist/remoteBundleSigning.d.cts +2 -2
  157. package/dist/remoteBundleSigning.d.mts +2 -2
  158. package/dist/serverPlugin/busy.cjs +36 -0
  159. package/dist/serverPlugin/busy.d.cts +12 -0
  160. package/dist/serverPlugin/busy.d.mts +12 -0
  161. package/dist/serverPlugin/busy.mjs +36 -0
  162. package/dist/serverPlugin/configError.cjs +7 -0
  163. package/dist/serverPlugin/configError.d.cts +7 -0
  164. package/dist/serverPlugin/configError.d.mts +7 -0
  165. package/dist/serverPlugin/configError.mjs +7 -0
  166. package/dist/serverPlugin/coreReads.d.cts +48 -0
  167. package/dist/serverPlugin/coreReads.d.mts +48 -0
  168. package/dist/serverPlugin/databaseHandle.d.cts +105 -0
  169. package/dist/serverPlugin/databaseHandle.d.mts +105 -0
  170. package/dist/serverPlugin/definePlugin.cjs +5 -0
  171. package/dist/serverPlugin/definePlugin.d.cts +130 -0
  172. package/dist/serverPlugin/definePlugin.d.mts +130 -0
  173. package/dist/serverPlugin/definePlugin.mjs +5 -0
  174. package/dist/serverPlugin/definitions.d.cts +76 -0
  175. package/dist/serverPlugin/definitions.d.mts +76 -0
  176. package/dist/serverPlugin/errors.cjs +37 -0
  177. package/dist/serverPlugin/errors.d.cts +29 -0
  178. package/dist/serverPlugin/errors.d.mts +29 -0
  179. package/dist/serverPlugin/errors.mjs +32 -0
  180. package/dist/serverPlugin/schema.cjs +24 -0
  181. package/dist/serverPlugin/schema.d.cts +90 -0
  182. package/dist/serverPlugin/schema.d.mts +90 -0
  183. package/dist/serverPlugin/schema.mjs +23 -0
  184. package/dist/types/databaseConfig.cjs +5 -0
  185. package/dist/types/databaseConfig.d.cts +68 -0
  186. package/dist/types/databaseConfig.d.mts +68 -0
  187. package/dist/types/databaseConfig.mjs +5 -0
  188. package/dist/types/databaseOperations.d.cts +5 -180
  189. package/dist/types/databaseOperations.d.mts +5 -180
  190. package/dist/types/databaseRows.d.cts +5 -56
  191. package/dist/types/databaseRows.d.mts +5 -56
  192. package/dist/types/index.cjs +2 -0
  193. package/dist/types/index.d.cts +31 -97
  194. package/dist/types/index.d.mts +31 -97
  195. package/dist/types/index.mjs +2 -1
  196. package/dist/types/models.d.cts +14 -0
  197. package/dist/types/models.d.mts +14 -0
  198. package/dist/types/public.d.cts +4 -3
  199. package/dist/types/public.d.mts +4 -3
  200. package/dist/uuidv7.cjs +3 -3
  201. package/dist/uuidv7.d.cts +1 -1
  202. package/dist/uuidv7.d.mts +1 -1
  203. package/dist/uuidv7.mjs +1 -1
  204. package/package.json +10 -7
  205. package/dist/calculatePagination.cjs +0 -25
  206. package/dist/calculatePagination.d.cts +0 -12
  207. package/dist/calculatePagination.d.mts +0 -12
  208. package/dist/calculatePagination.mjs +0 -25
  209. package/dist/compressionFormat.cjs +0 -62
  210. package/dist/compressionFormat.d.cts +0 -33
  211. package/dist/compressionFormat.d.mts +0 -33
  212. package/dist/compressionFormat.mjs +0 -58
  213. package/dist/createDatabasePlugin.cjs +0 -920
  214. package/dist/createDatabasePlugin.d.cts +0 -28
  215. package/dist/createDatabasePlugin.d.mts +0 -28
  216. package/dist/createDatabasePlugin.mjs +0 -916
  217. package/dist/createStoragePlugin.cjs +0 -8
  218. package/dist/createStoragePlugin.d.cts +0 -9
  219. package/dist/createStoragePlugin.d.mts +0 -9
  220. package/dist/createStoragePlugin.mjs +0 -7
  221. package/dist/databaseClient.cjs +0 -117
  222. package/dist/databaseClient.d.cts +0 -32
  223. package/dist/databaseClient.d.mts +0 -32
  224. package/dist/databaseClient.mjs +0 -114
  225. package/dist/databaseClientReads.cjs +0 -115
  226. package/dist/databaseClientReads.mjs +0 -113
  227. package/dist/databaseClientUpdates.cjs +0 -40
  228. package/dist/databaseClientUpdates.d.cts +0 -11
  229. package/dist/databaseClientUpdates.d.mts +0 -11
  230. package/dist/databaseClientUpdates.mjs +0 -38
  231. package/dist/databasePluginCrud.cjs +0 -88
  232. package/dist/databasePluginCrud.d.cts +0 -4
  233. package/dist/databasePluginCrud.d.mts +0 -4
  234. package/dist/databasePluginCrud.mjs +0 -87
  235. package/dist/databasePluginCrudValidation.d.cts +0 -6
  236. package/dist/databasePluginCrudValidation.d.mts +0 -6
  237. package/dist/databasePluginCrudValidationErrors.cjs +0 -11
  238. package/dist/databasePluginCrudValidationErrors.d.cts +0 -9
  239. package/dist/databasePluginCrudValidationErrors.d.mts +0 -9
  240. package/dist/databasePluginCrudValidationErrors.mjs +0 -11
  241. package/dist/databasePluginCrudValidationFields.cjs +0 -321
  242. package/dist/databasePluginCrudValidationFields.d.cts +0 -1
  243. package/dist/databasePluginCrudValidationFields.d.mts +0 -1
  244. package/dist/databasePluginCrudValidationFields.mjs +0 -309
  245. package/dist/databasePluginCrudValidationMutations.cjs +0 -107
  246. package/dist/databasePluginCrudValidationMutations.d.cts +0 -1
  247. package/dist/databasePluginCrudValidationMutations.d.mts +0 -1
  248. package/dist/databasePluginCrudValidationMutations.mjs +0 -100
  249. package/dist/databasePluginCrudValidationQueries.cjs +0 -103
  250. package/dist/databasePluginCrudValidationQueries.d.cts +0 -2
  251. package/dist/databasePluginCrudValidationQueries.d.mts +0 -2
  252. package/dist/databasePluginCrudValidationQueries.mjs +0 -97
  253. package/dist/databasePluginCrudValidationRows.cjs +0 -55
  254. package/dist/databasePluginCrudValidationRows.d.cts +0 -1
  255. package/dist/databasePluginCrudValidationRows.d.mts +0 -1
  256. package/dist/databasePluginCrudValidationRows.mjs +0 -53
  257. package/dist/databasePluginTransaction.cjs +0 -7
  258. package/dist/databasePluginTransaction.mjs +0 -7
  259. package/dist/insightsContract.cjs +0 -157
  260. package/dist/insightsContract.d.cts +0 -11
  261. package/dist/insightsContract.d.mts +0 -11
  262. package/dist/insightsContract.mjs +0 -153
  263. package/dist/internal.cjs +0 -6
  264. package/dist/internal.d.cts +0 -10
  265. package/dist/internal.d.mts +0 -10
  266. package/dist/internal.mjs +0 -3
  267. package/dist/paginateBundles.cjs +0 -53
  268. package/dist/paginateBundles.d.cts +0 -13
  269. package/dist/paginateBundles.d.mts +0 -13
  270. package/dist/paginateBundles.mjs +0 -53
  271. package/dist/queryBundles.cjs +0 -34
  272. package/dist/queryBundles.d.cts +0 -9
  273. package/dist/queryBundles.d.mts +0 -9
  274. package/dist/queryBundles.mjs +0 -32
  275. package/dist/requestBundleCache.cjs +0 -22
  276. package/dist/requestBundleCache.d.cts +0 -8
  277. package/dist/requestBundleCache.d.mts +0 -8
  278. package/dist/requestBundleCache.mjs +0 -22
  279. package/dist/types/database.d.cts +0 -5
  280. package/dist/types/database.d.mts +0 -5
  281. package/dist/types/databaseFields.cjs +0 -105
  282. package/dist/types/databaseFields.d.cts +0 -13
  283. package/dist/types/databaseFields.d.mts +0 -13
  284. package/dist/types/databaseFields.mjs +0 -105
  285. package/dist/types/databasePlugin.d.cts +0 -298
  286. package/dist/types/databasePlugin.d.mts +0 -298
  287. package/dist/types/databaseQuery.d.cts +0 -46
  288. package/dist/types/databaseQuery.d.mts +0 -46
  289. package/dist/types/internal.d.cts +0 -8
  290. package/dist/types/internal.d.mts +0 -8
@@ -1,85 +1,19 @@
1
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, InsightsInstallationRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
2
- import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountInstallationsInput, InsightsEventCursor, InsightsEventFilter, InsightsFindInstallationsInput, InsightsListEventsInput, InsightsModel, InsightsRecordInput, InsightsScope, ReleaseCatalogModel, ReleaseModel } from "./databasePlugin.cjs";
3
- import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
4
- import "./database.cjs";
1
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
2
+ import { AnyHotUpdaterPlugin } from "../serverPlugin/definePlugin.cjs";
3
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.cjs";
5
4
  import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./utils.cjs";
5
+ import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
6
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
6
7
  import "./public.cjs";
7
- import { Bundle, Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/core";
8
+ import { Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/protocol";
8
9
  //#region src/types/index.d.ts
9
- interface BasePluginArgs {
10
+ interface BuildAdapterArgs {
10
11
  cwd: string;
11
12
  }
12
- interface PaginationInfo {
13
- total: number;
14
- hasNextPage: boolean;
15
- hasPreviousPage: boolean;
16
- currentPage: number;
17
- totalPages: number;
18
- nextCursor?: string | null;
19
- previousCursor?: string | null;
20
- }
21
- interface Paginated<TData> {
22
- data: TData;
23
- pagination: PaginationInfo;
24
- }
25
- type PaginatedResult = Paginated<Bundle[]>;
26
- interface DatabaseBundleIdFilter {
27
- eq?: string;
28
- gt?: string;
29
- gte?: string;
30
- lt?: string;
31
- lte?: string;
32
- in?: string[];
33
- }
34
- interface DatabaseBundleQueryWhere {
35
- platform?: Platform;
36
- id?: DatabaseBundleIdFilter;
37
- }
38
- interface DatabaseBundleQueryOrder {
39
- field: "id";
40
- direction: "asc" | "desc";
41
- }
42
- type DatabaseBundleCursor = {
43
- /**
44
- * Fetch the next window after this bundle ID.
45
- *
46
- * This is the preferred pagination mode for bundle-management queries.
47
- */
48
- after: string;
49
- before?: never;
50
- } | {
51
- after?: never;
52
- /**
53
- * Fetch the previous window before this bundle ID.
54
- *
55
- * This is the preferred pagination mode for bundle-management queries.
56
- */
57
- before: string;
58
- };
59
- type DatabaseBundlePaginationOptions = {
60
- /**
61
- * Optional page number used by management UIs to keep page boundaries
62
- * stable even when new bundles are inserted ahead of the current cursor
63
- * window.
64
- */
65
- page?: number;
66
- cursor?: never;
67
- } | {
68
- page?: never;
69
- /**
70
- * Preferred cursor-based pagination for bundle-management queries.
71
- */
72
- cursor?: DatabaseBundleCursor;
73
- };
74
- type DatabaseBundleQueryOptions = {
75
- where?: DatabaseBundleQueryWhere;
76
- limit: number;
77
- orderBy?: DatabaseBundleQueryOrder;
78
- } & DatabaseBundlePaginationOptions;
79
- interface BuildPluginConfig {
13
+ interface BuildAdapterConfig {
80
14
  outDir?: string;
81
15
  }
82
- interface BuildPlugin {
16
+ interface BuildAdapter {
83
17
  nativeBuild?: {
84
18
  /** Resolves the public key embedded by the native build configuration. */
85
19
  getBundleSigningPublicKey?: () => Promise<{
@@ -290,7 +224,7 @@ interface StorageDeleteResult {
290
224
  readonly deleted: true;
291
225
  }
292
226
  interface StorageObject {
293
- /** Object key relative to the storage plugin's configured base path. */
227
+ /** Object key relative to the storage adapter's configured base path. */
294
228
  readonly key: string;
295
229
  readonly storageUri: string;
296
230
  readonly size: number;
@@ -311,7 +245,7 @@ interface StorageGetDownloadUrlResult {
311
245
  * SDK clients, platform bindings, credentials, and local file I/O belong to
312
246
  * provider implementations and consumers, never to this interface.
313
247
  */
314
- interface StoragePlugin {
248
+ interface StorageAdapter {
315
249
  readonly name: string;
316
250
  /**
317
251
  * Protocol this plugin resolves and stores in database storage URIs.
@@ -334,7 +268,7 @@ interface StoragePlugin {
334
268
  /** Deletes only the exact base-path-relative keys supplied by the caller. */
335
269
  readonly deleteObjects?: (keys: readonly string[]) => Promise<void>;
336
270
  }
337
- interface BundleSigningPlugin {
271
+ interface BundleSigningAdapter {
338
272
  readonly name: string;
339
273
  /** Returns the RSA public key used by this provider in SPKI PEM format. */
340
274
  readonly getPublicKey: (input?: {
@@ -365,8 +299,8 @@ type LocalSigningConfig = {
365
299
  readonly enabled: false;
366
300
  readonly privateKeyPath?: string;
367
301
  };
368
- /** Local config or signing plugin. Signing is disabled when omitted. */
369
- type SigningConfig = BundleSigningPlugin | LocalSigningConfig;
302
+ /** Local config or signing adapter. Signing is disabled when omitted. */
303
+ type SigningConfig = BundleSigningAdapter | LocalSigningConfig;
370
304
  /**
371
305
  * Extra fingerprint sources.
372
306
  *
@@ -397,18 +331,6 @@ type ConfigInput = {
397
331
  * @default "appVersion"
398
332
  */
399
333
  updateStrategy: "fingerprint" | "appVersion";
400
- /**
401
- * The compression strategy used for bundle deployment.
402
- *
403
- * - `zip`: Standard ZIP compression (default). Fast and widely supported.
404
- * - `tar.br`: TAR archive with Brotli compression. Highest compression ratio, smaller bundle size.
405
- * - `tar.gz`: TAR archive with Gzip compression. Balanced speed and compression ratio.
406
- *
407
- * The compression format is determined by the storage plugin used for bundle upload.
408
- *
409
- * @default "zip"
410
- */
411
- compressStrategy?: "zip" | "tar.br" | "tar.gz";
412
334
  /**
413
335
  * The fingerprint configuration.
414
336
  */
@@ -438,7 +360,7 @@ type ConfigInput = {
438
360
  *
439
361
  * When enabled, `hot-updater deploy` tries to prepare binary patches against
440
362
  * up to `maxBaseBundles` recent compatible bundles. Patch generation is an
441
- * optimization only; archive delivery remains the fallback path.
363
+ * optimization only; the original manifest asset remains the fallback path.
442
364
  *
443
365
  * @default { enabled: true, maxBaseBundles: 3 }
444
366
  */
@@ -486,9 +408,21 @@ type ConfigInput = {
486
408
  * ```
487
409
  */
488
410
  signing?: SigningConfig;
489
- build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
490
- storage: StoragePlugin;
491
- database: BundleRepository;
411
+ build: (args: BuildAdapterArgs) => Promise<BuildAdapter> | BuildAdapter;
412
+ /** Where the CLI uploads bundles: the same adapter the server lists in its storage. */
413
+ storage: StorageAdapter;
414
+ /**
415
+ * The server's database, which the CLI opens itself, or
416
+ * `standaloneRepository(...)`, which reaches a self-hosted server through
417
+ * its admin API.
418
+ */
419
+ database: ConfiguredDatabase;
420
+ /**
421
+ * The plugins the server runs, as its definition lists them. Over the
422
+ * server's database the CLI runs them as the server does; with
423
+ * `standaloneRepository`, they run on the server.
424
+ */
425
+ plugins?: readonly AnyHotUpdaterPlugin[];
492
426
  };
493
427
  interface NativeBuildOptions {
494
428
  outputPath?: string;
@@ -497,4 +431,4 @@ interface NativeBuildOptions {
497
431
  scheme?: string;
498
432
  }
499
433
  //#endregion
500
- export { type ApiKeyModel, type ApiKeyRow, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, type Bundle$1 as Bundle, type BundleEventRow, type BundleEventRowBase, type BundleModel, type BundleModelQuery, type BundlePatchModel, type BundlePatchRow, type BundleRepository, type BundleRepositoryChange, type BundleRepositoryCommit, type BundleRow, type BundleRowUpdate, BundleSigningPlugin, type ChannelDeleteInput, type ChannelDeleteResult, type ChannelInsertInput, type ChannelInsertResult, type ChannelModel, type ChannelRow, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, type DatabaseBundleMetadata, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, type DatabaseChange, type DatabaseCommit, type DatabaseCommitExpectation, type DatabaseCommitResult, type DatabaseJsonObject, type DatabaseJsonValue, type DatabaseModels, type DatabasePlugin, FingerprintExtraSources, HasMultipleCallSignatures, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountInstallationsInput, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindInstallationsInput, type InsightsInstallationRow, type InsightsListEventsInput, type InsightsModel, type InsightsRecordInput, type InsightsScope, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseCatalogModel, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseModel, type ReleaseRow, type ReleaseRowUpdate, RequiredDeep, SigningConfig, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePlugin, StoragePutInput, StoragePutResult, supportedIosPlatforms };
434
+ export { type AggregateBatching, ApplePlatform, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, BuiltIns, type Bundle$1 as Bundle, type BundlePatchRow, type BundleRow, type BundleRowUpdate, BundleSigningAdapter, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, ConfigInput, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, FingerprintExtraSources, HasMultipleCallSignatures, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, RequiredDeep, SigningConfig, StorageAdapter, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePutInput, StoragePutResult, isRemoteDatabase, supportedIosPlatforms };
@@ -1,85 +1,19 @@
1
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, InsightsInstallationRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
2
- import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountInstallationsInput, InsightsEventCursor, InsightsEventFilter, InsightsFindInstallationsInput, InsightsListEventsInput, InsightsModel, InsightsRecordInput, InsightsScope, ReleaseCatalogModel, ReleaseModel } from "./databasePlugin.mjs";
3
- import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.mjs";
4
- import "./database.mjs";
1
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
2
+ import { AnyHotUpdaterPlugin } from "../serverPlugin/definePlugin.mjs";
3
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.mjs";
5
4
  import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./utils.mjs";
5
+ import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.mjs";
6
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
6
7
  import "./public.mjs";
7
- import { Bundle, Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/core";
8
+ import { Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/protocol";
8
9
  //#region src/types/index.d.ts
9
- interface BasePluginArgs {
10
+ interface BuildAdapterArgs {
10
11
  cwd: string;
11
12
  }
12
- interface PaginationInfo {
13
- total: number;
14
- hasNextPage: boolean;
15
- hasPreviousPage: boolean;
16
- currentPage: number;
17
- totalPages: number;
18
- nextCursor?: string | null;
19
- previousCursor?: string | null;
20
- }
21
- interface Paginated<TData> {
22
- data: TData;
23
- pagination: PaginationInfo;
24
- }
25
- type PaginatedResult = Paginated<Bundle[]>;
26
- interface DatabaseBundleIdFilter {
27
- eq?: string;
28
- gt?: string;
29
- gte?: string;
30
- lt?: string;
31
- lte?: string;
32
- in?: string[];
33
- }
34
- interface DatabaseBundleQueryWhere {
35
- platform?: Platform;
36
- id?: DatabaseBundleIdFilter;
37
- }
38
- interface DatabaseBundleQueryOrder {
39
- field: "id";
40
- direction: "asc" | "desc";
41
- }
42
- type DatabaseBundleCursor = {
43
- /**
44
- * Fetch the next window after this bundle ID.
45
- *
46
- * This is the preferred pagination mode for bundle-management queries.
47
- */
48
- after: string;
49
- before?: never;
50
- } | {
51
- after?: never;
52
- /**
53
- * Fetch the previous window before this bundle ID.
54
- *
55
- * This is the preferred pagination mode for bundle-management queries.
56
- */
57
- before: string;
58
- };
59
- type DatabaseBundlePaginationOptions = {
60
- /**
61
- * Optional page number used by management UIs to keep page boundaries
62
- * stable even when new bundles are inserted ahead of the current cursor
63
- * window.
64
- */
65
- page?: number;
66
- cursor?: never;
67
- } | {
68
- page?: never;
69
- /**
70
- * Preferred cursor-based pagination for bundle-management queries.
71
- */
72
- cursor?: DatabaseBundleCursor;
73
- };
74
- type DatabaseBundleQueryOptions = {
75
- where?: DatabaseBundleQueryWhere;
76
- limit: number;
77
- orderBy?: DatabaseBundleQueryOrder;
78
- } & DatabaseBundlePaginationOptions;
79
- interface BuildPluginConfig {
13
+ interface BuildAdapterConfig {
80
14
  outDir?: string;
81
15
  }
82
- interface BuildPlugin {
16
+ interface BuildAdapter {
83
17
  nativeBuild?: {
84
18
  /** Resolves the public key embedded by the native build configuration. */
85
19
  getBundleSigningPublicKey?: () => Promise<{
@@ -290,7 +224,7 @@ interface StorageDeleteResult {
290
224
  readonly deleted: true;
291
225
  }
292
226
  interface StorageObject {
293
- /** Object key relative to the storage plugin's configured base path. */
227
+ /** Object key relative to the storage adapter's configured base path. */
294
228
  readonly key: string;
295
229
  readonly storageUri: string;
296
230
  readonly size: number;
@@ -311,7 +245,7 @@ interface StorageGetDownloadUrlResult {
311
245
  * SDK clients, platform bindings, credentials, and local file I/O belong to
312
246
  * provider implementations and consumers, never to this interface.
313
247
  */
314
- interface StoragePlugin {
248
+ interface StorageAdapter {
315
249
  readonly name: string;
316
250
  /**
317
251
  * Protocol this plugin resolves and stores in database storage URIs.
@@ -334,7 +268,7 @@ interface StoragePlugin {
334
268
  /** Deletes only the exact base-path-relative keys supplied by the caller. */
335
269
  readonly deleteObjects?: (keys: readonly string[]) => Promise<void>;
336
270
  }
337
- interface BundleSigningPlugin {
271
+ interface BundleSigningAdapter {
338
272
  readonly name: string;
339
273
  /** Returns the RSA public key used by this provider in SPKI PEM format. */
340
274
  readonly getPublicKey: (input?: {
@@ -365,8 +299,8 @@ type LocalSigningConfig = {
365
299
  readonly enabled: false;
366
300
  readonly privateKeyPath?: string;
367
301
  };
368
- /** Local config or signing plugin. Signing is disabled when omitted. */
369
- type SigningConfig = BundleSigningPlugin | LocalSigningConfig;
302
+ /** Local config or signing adapter. Signing is disabled when omitted. */
303
+ type SigningConfig = BundleSigningAdapter | LocalSigningConfig;
370
304
  /**
371
305
  * Extra fingerprint sources.
372
306
  *
@@ -397,18 +331,6 @@ type ConfigInput = {
397
331
  * @default "appVersion"
398
332
  */
399
333
  updateStrategy: "fingerprint" | "appVersion";
400
- /**
401
- * The compression strategy used for bundle deployment.
402
- *
403
- * - `zip`: Standard ZIP compression (default). Fast and widely supported.
404
- * - `tar.br`: TAR archive with Brotli compression. Highest compression ratio, smaller bundle size.
405
- * - `tar.gz`: TAR archive with Gzip compression. Balanced speed and compression ratio.
406
- *
407
- * The compression format is determined by the storage plugin used for bundle upload.
408
- *
409
- * @default "zip"
410
- */
411
- compressStrategy?: "zip" | "tar.br" | "tar.gz";
412
334
  /**
413
335
  * The fingerprint configuration.
414
336
  */
@@ -438,7 +360,7 @@ type ConfigInput = {
438
360
  *
439
361
  * When enabled, `hot-updater deploy` tries to prepare binary patches against
440
362
  * up to `maxBaseBundles` recent compatible bundles. Patch generation is an
441
- * optimization only; archive delivery remains the fallback path.
363
+ * optimization only; the original manifest asset remains the fallback path.
442
364
  *
443
365
  * @default { enabled: true, maxBaseBundles: 3 }
444
366
  */
@@ -486,9 +408,21 @@ type ConfigInput = {
486
408
  * ```
487
409
  */
488
410
  signing?: SigningConfig;
489
- build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
490
- storage: StoragePlugin;
491
- database: BundleRepository;
411
+ build: (args: BuildAdapterArgs) => Promise<BuildAdapter> | BuildAdapter;
412
+ /** Where the CLI uploads bundles: the same adapter the server lists in its storage. */
413
+ storage: StorageAdapter;
414
+ /**
415
+ * The server's database, which the CLI opens itself, or
416
+ * `standaloneRepository(...)`, which reaches a self-hosted server through
417
+ * its admin API.
418
+ */
419
+ database: ConfiguredDatabase;
420
+ /**
421
+ * The plugins the server runs, as its definition lists them. Over the
422
+ * server's database the CLI runs them as the server does; with
423
+ * `standaloneRepository`, they run on the server.
424
+ */
425
+ plugins?: readonly AnyHotUpdaterPlugin[];
492
426
  };
493
427
  interface NativeBuildOptions {
494
428
  outputPath?: string;
@@ -497,4 +431,4 @@ interface NativeBuildOptions {
497
431
  scheme?: string;
498
432
  }
499
433
  //#endregion
500
- export { type ApiKeyModel, type ApiKeyRow, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, type Bundle$1 as Bundle, type BundleEventRow, type BundleEventRowBase, type BundleModel, type BundleModelQuery, type BundlePatchModel, type BundlePatchRow, type BundleRepository, type BundleRepositoryChange, type BundleRepositoryCommit, type BundleRow, type BundleRowUpdate, BundleSigningPlugin, type ChannelDeleteInput, type ChannelDeleteResult, type ChannelInsertInput, type ChannelInsertResult, type ChannelModel, type ChannelRow, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, type DatabaseBundleMetadata, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, type DatabaseChange, type DatabaseCommit, type DatabaseCommitExpectation, type DatabaseCommitResult, type DatabaseJsonObject, type DatabaseJsonValue, type DatabaseModels, type DatabasePlugin, FingerprintExtraSources, HasMultipleCallSignatures, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountInstallationsInput, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindInstallationsInput, type InsightsInstallationRow, type InsightsListEventsInput, type InsightsModel, type InsightsRecordInput, type InsightsScope, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseCatalogModel, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseModel, type ReleaseRow, type ReleaseRowUpdate, RequiredDeep, SigningConfig, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePlugin, StoragePutInput, StoragePutResult, supportedIosPlatforms };
434
+ export { type AggregateBatching, ApplePlatform, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, BuiltIns, type Bundle$1 as Bundle, type BundlePatchRow, type BundleRow, type BundleRowUpdate, BundleSigningAdapter, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, ConfigInput, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, FingerprintExtraSources, HasMultipleCallSignatures, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, RequiredDeep, SigningConfig, StorageAdapter, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePutInput, StoragePutResult, isRemoteDatabase, supportedIosPlatforms };
@@ -1,7 +1,8 @@
1
+ import { isRemoteDatabase } from "./databaseConfig.mjs";
1
2
  //#region src/types/index.ts
2
3
  /**
3
4
  * Supported Apple platforms for building and deployment
4
5
  */
5
6
  const supportedIosPlatforms = { ios: "ios" };
6
7
  //#endregion
7
- export { supportedIosPlatforms };
8
+ export { isRemoteDatabase, supportedIosPlatforms };
@@ -0,0 +1,14 @@
1
+ import { ChannelRow } from "./databaseRows.cjs";
2
+ //#region src/types/models.d.ts
3
+ interface ChannelInsertResult {
4
+ readonly row: ChannelRow;
5
+ readonly inserted: boolean;
6
+ }
7
+ type ChannelDeleteResult = {
8
+ readonly deleted: true;
9
+ } | {
10
+ readonly deleted: false;
11
+ readonly reason: "not_found" | "not_empty";
12
+ };
13
+ //#endregion
14
+ export { ChannelDeleteResult, ChannelInsertResult };
@@ -0,0 +1,14 @@
1
+ import { ChannelRow } from "./databaseRows.mjs";
2
+ //#region src/types/models.d.ts
3
+ interface ChannelInsertResult {
4
+ readonly row: ChannelRow;
5
+ readonly inserted: boolean;
6
+ }
7
+ type ChannelDeleteResult = {
8
+ readonly deleted: true;
9
+ } | {
10
+ readonly deleted: false;
11
+ readonly reason: "not_found" | "not_empty";
12
+ };
13
+ //#endregion
14
+ export { ChannelDeleteResult, ChannelInsertResult };
@@ -1,4 +1,5 @@
1
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, InsightsInstallationRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
2
- import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountInstallationsInput, InsightsEventCursor, InsightsEventFilter, InsightsFindInstallationsInput, InsightsListEventsInput, InsightsModel, InsightsRecordInput, InsightsScope, ReleaseCatalogModel, ReleaseModel } from "./databasePlugin.cjs";
1
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
2
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.cjs";
3
3
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
4
- export type { ApiKeyModel, ApiKeyRow, BundleEventRow, BundleEventRowBase, BundleModel, BundleModelQuery, BundlePatchModel, BundlePatchRow, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, BundleRow, BundleRowUpdate, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, ChannelRow, DatabaseBundleMetadata, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseJsonObject, DatabaseJsonValue, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountInstallationsInput, InsightsEventCursor, InsightsEventFilter, InsightsFindInstallationsInput, InsightsInstallationRow, InsightsListEventsInput, InsightsModel, InsightsRecordInput, InsightsScope, ReleaseCatalogModel, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseModel, ReleaseRow, ReleaseRowUpdate };
4
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
5
+ export { type AggregateBatching, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, isRemoteDatabase };
@@ -1,4 +1,5 @@
1
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, InsightsInstallationRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
2
- import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountInstallationsInput, InsightsEventCursor, InsightsEventFilter, InsightsFindInstallationsInput, InsightsListEventsInput, InsightsModel, InsightsRecordInput, InsightsScope, ReleaseCatalogModel, ReleaseModel } from "./databasePlugin.mjs";
1
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
2
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.mjs";
3
3
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.mjs";
4
- export type { ApiKeyModel, ApiKeyRow, BundleEventRow, BundleEventRowBase, BundleModel, BundleModelQuery, BundlePatchModel, BundlePatchRow, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, BundleRow, BundleRowUpdate, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, ChannelRow, DatabaseBundleMetadata, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseJsonObject, DatabaseJsonValue, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountInstallationsInput, InsightsEventCursor, InsightsEventFilter, InsightsFindInstallationsInput, InsightsInstallationRow, InsightsListEventsInput, InsightsModel, InsightsRecordInput, InsightsScope, ReleaseCatalogModel, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseModel, ReleaseRow, ReleaseRowUpdate };
4
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
5
+ export { type AggregateBatching, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, isRemoteDatabase };
package/dist/uuidv7.cjs CHANGED
@@ -1,7 +1,7 @@
1
- let _hot_updater_core = require("@hot-updater/core");
1
+ let _hot_updater_protocol = require("@hot-updater/protocol");
2
2
  //#region src/uuidv7.ts
3
3
  const extractTimestampFromUUIDv7 = (uuid) => {
4
- if (!(0, _hot_updater_core.isUUIDv7)(uuid)) throw new TypeError("Expected a canonical lowercase UUIDv7");
4
+ if (!(0, _hot_updater_protocol.isUUIDv7)(uuid)) throw new TypeError("Expected a canonical lowercase UUIDv7");
5
5
  const timestampHex = uuid.split("-").join("").slice(0, 12);
6
6
  return Number.parseInt(timestampHex, 16);
7
7
  };
@@ -38,6 +38,6 @@ exports.extractTimestampFromUUIDv7 = extractTimestampFromUUIDv7;
38
38
  Object.defineProperty(exports, "isUUIDv7", {
39
39
  enumerable: true,
40
40
  get: function() {
41
- return _hot_updater_core.isUUIDv7;
41
+ return _hot_updater_protocol.isUUIDv7;
42
42
  }
43
43
  });
package/dist/uuidv7.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { isUUIDv7 } from "@hot-updater/core";
1
+ import { isUUIDv7 } from "@hot-updater/protocol";
2
2
  //#region src/uuidv7.d.ts
3
3
  declare const extractTimestampFromUUIDv7: (uuid: string) => number;
4
4
  declare const createUUIDv7: () => string;
package/dist/uuidv7.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { isUUIDv7 as isUUIDv7$1 } from "@hot-updater/core";
1
+ import { isUUIDv7 as isUUIDv7$1 } from "@hot-updater/protocol";
2
2
  //#region src/uuidv7.d.ts
3
3
  declare const extractTimestampFromUUIDv7: (uuid: string) => number;
4
4
  declare const createUUIDv7: () => string;
package/dist/uuidv7.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { isUUIDv7, isUUIDv7 as isUUIDv7$1 } from "@hot-updater/core";
1
+ import { isUUIDv7, isUUIDv7 as isUUIDv7$1 } from "@hot-updater/protocol";
2
2
  //#region src/uuidv7.ts
3
3
  const extractTimestampFromUUIDv7 = (uuid) => {
4
4
  if (!isUUIDv7(uuid)) throw new TypeError("Expected a canonical lowercase UUIDv7");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "1.0.0-rc.3",
3
+ "version": "1.0.0-rc.30",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -12,10 +12,6 @@
12
12
  "import": "./dist/index.mjs",
13
13
  "require": "./dist/index.cjs"
14
14
  },
15
- "./internal": {
16
- "import": "./dist/internal.mjs",
17
- "require": "./dist/internal.cjs"
18
- },
19
15
  "./package.json": "./package.json"
20
16
  },
21
17
  "files": [
@@ -49,12 +45,19 @@
49
45
  "es-toolkit": "^1.32.0",
50
46
  "mime": "^4.0.4",
51
47
  "verkit": "0.4.0",
52
- "@hot-updater/core": "1.0.0-rc.0"
48
+ "@hot-updater/protocol": "1.0.0-rc.30"
53
49
  },
54
50
  "devDependencies": {
51
+ "@electric-sql/pglite": "0.4.1",
55
52
  "@types/node": "^20",
56
53
  "@typescript/native": "npm:typescript@7.0.2",
57
- "typescript": "npm:@typescript/typescript6@6.0.2"
54
+ "typescript": "npm:@typescript/typescript6@6.0.2",
55
+ "@hot-updater/test-utils": "1.0.0-rc.32"
56
+ },
57
+ "nx": {
58
+ "implicitDependencies": [
59
+ "!@hot-updater/test-utils"
60
+ ]
58
61
  },
59
62
  "inlinedDependencies": {
60
63
  "verkit": "0.4.0"
@@ -1,25 +0,0 @@
1
- //#region src/calculatePagination.ts
2
- /**
3
- * Calculate pagination information based on total count, limit, and offset
4
- */
5
- function calculatePagination(total, options) {
6
- const { limit, offset } = options;
7
- if (total === 0) return {
8
- total: 0,
9
- hasNextPage: false,
10
- hasPreviousPage: false,
11
- currentPage: 1,
12
- totalPages: 0
13
- };
14
- const currentPage = Math.floor(offset / limit) + 1;
15
- const totalPages = Math.ceil(total / limit);
16
- return {
17
- total,
18
- hasNextPage: offset + limit < total,
19
- hasPreviousPage: offset > 0,
20
- currentPage,
21
- totalPages
22
- };
23
- }
24
- //#endregion
25
- exports.calculatePagination = calculatePagination;
@@ -1,12 +0,0 @@
1
- import { PaginationInfo } from "./types/index.cjs";
2
- //#region src/calculatePagination.d.ts
3
- interface PaginationOptions {
4
- limit: number;
5
- offset: number;
6
- }
7
- /**
8
- * Calculate pagination information based on total count, limit, and offset
9
- */
10
- declare function calculatePagination(total: number, options: PaginationOptions): PaginationInfo;
11
- //#endregion
12
- export { PaginationOptions, calculatePagination };
@@ -1,12 +0,0 @@
1
- import { PaginationInfo } from "./types/index.mjs";
2
- //#region src/calculatePagination.d.ts
3
- interface PaginationOptions {
4
- limit: number;
5
- offset: number;
6
- }
7
- /**
8
- * Calculate pagination information based on total count, limit, and offset
9
- */
10
- declare function calculatePagination(total: number, options: PaginationOptions): PaginationInfo;
11
- //#endregion
12
- export { PaginationOptions, calculatePagination };
@@ -1,25 +0,0 @@
1
- //#region src/calculatePagination.ts
2
- /**
3
- * Calculate pagination information based on total count, limit, and offset
4
- */
5
- function calculatePagination(total, options) {
6
- const { limit, offset } = options;
7
- if (total === 0) return {
8
- total: 0,
9
- hasNextPage: false,
10
- hasPreviousPage: false,
11
- currentPage: 1,
12
- totalPages: 0
13
- };
14
- const currentPage = Math.floor(offset / limit) + 1;
15
- const totalPages = Math.ceil(total / limit);
16
- return {
17
- total,
18
- hasNextPage: offset + limit < total,
19
- hasPreviousPage: offset > 0,
20
- currentPage,
21
- totalPages
22
- };
23
- }
24
- //#endregion
25
- export { calculatePagination };