@hot-updater/plugin-core 0.32.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ import { Bundle as Bundle$1, HotUpdaterContext } from "./types/index.cjs";
2
+ import { GetBundlesArgs, UpdateInfo } from "@hot-updater/core";
3
+
4
+ //#region src/resolveUpdateInfoFromBundles.d.ts
5
+ interface ResolveUpdateInfoFromBundlesOptions<TContext = unknown> {
6
+ readonly args: GetBundlesArgs;
7
+ readonly bundles: Bundle$1[];
8
+ readonly context?: HotUpdaterContext<TContext>;
9
+ }
10
+ declare const resolveUpdateInfoFromBundles: <TContext = unknown>({
11
+ args,
12
+ bundles,
13
+ context
14
+ }: ResolveUpdateInfoFromBundlesOptions<TContext>) => Promise<UpdateInfo | null>;
15
+ //#endregion
16
+ export { ResolveUpdateInfoFromBundlesOptions, resolveUpdateInfoFromBundles };
@@ -0,0 +1,16 @@
1
+ import { Bundle as Bundle$1, HotUpdaterContext } from "./types/index.mjs";
2
+ import { GetBundlesArgs, UpdateInfo } from "@hot-updater/core";
3
+
4
+ //#region src/resolveUpdateInfoFromBundles.d.ts
5
+ interface ResolveUpdateInfoFromBundlesOptions<TContext = unknown> {
6
+ readonly args: GetBundlesArgs;
7
+ readonly bundles: Bundle$1[];
8
+ readonly context?: HotUpdaterContext<TContext>;
9
+ }
10
+ declare const resolveUpdateInfoFromBundles: <TContext = unknown>({
11
+ args,
12
+ bundles,
13
+ context
14
+ }: ResolveUpdateInfoFromBundlesOptions<TContext>) => Promise<UpdateInfo | null>;
15
+ //#endregion
16
+ export { ResolveUpdateInfoFromBundlesOptions, resolveUpdateInfoFromBundles };
@@ -0,0 +1,13 @@
1
+ import { seedRequestUpdateBundles } from "./requestUpdateBundleState.mjs";
2
+ import { NIL_UUID } from "@hot-updater/core";
3
+ import { getUpdateInfo } from "@hot-updater/js";
4
+ //#region src/resolveUpdateInfoFromBundles.ts
5
+ const findSeedBundle = (bundles, bundleId) => bundles.find((bundle) => bundle.id === bundleId);
6
+ const resolveUpdateInfoFromBundles = async ({ args, bundles, context }) => {
7
+ const info = await getUpdateInfo(bundles, args);
8
+ if (!info) return null;
9
+ seedRequestUpdateBundles(context, [findSeedBundle(bundles, info.id), args.bundleId === NIL_UUID ? null : findSeedBundle(bundles, args.bundleId)]);
10
+ return info;
11
+ };
12
+ //#endregion
13
+ export { resolveUpdateInfoFromBundles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "0.32.0",
3
+ "version": "0.33.1",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -29,7 +29,10 @@
29
29
  "self-hosted"
30
30
  ],
31
31
  "license": "MIT",
32
- "repository": "https://github.com/gronxb/hot-updater",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/gronxb/hot-updater"
35
+ },
33
36
  "author": "gronxb <gron1gh1@gmail.com> (https://github.com/gronxb)",
34
37
  "bugs": {
35
38
  "url": "https://github.com/gronxb/hot-updater/issues"
@@ -42,14 +45,14 @@
42
45
  "es-toolkit": "^1.32.0",
43
46
  "mime": "^4.0.4",
44
47
  "semver": "^7.7.2",
45
- "@hot-updater/core": "0.32.0",
46
- "@hot-updater/js": "0.32.0"
48
+ "@hot-updater/core": "0.33.1",
49
+ "@hot-updater/js": "0.33.1"
47
50
  },
48
51
  "devDependencies": {
49
52
  "@types/node": "^20",
50
53
  "@types/semver": "^7.5.8",
51
54
  "typescript": "6.0.2",
52
- "@hot-updater/test-utils": "0.32.0"
55
+ "@hot-updater/test-utils": "0.33.1"
53
56
  },
54
57
  "scripts": {
55
58
  "build": "tsdown",