@hot-updater/plugin-core 0.18.3 → 0.18.5
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/index.cjs +18 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +18 -1
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -20083,7 +20083,10 @@ function createDatabasePlugin(name, abstractPlugin, hooks) {
|
|
|
20083
20083
|
onUnmount: abstractPlugin.onUnmount ? async () => {
|
|
20084
20084
|
const context = memoizedContext();
|
|
20085
20085
|
await abstractPlugin.onUnmount?.(context);
|
|
20086
|
-
} : void 0
|
|
20086
|
+
} : void 0,
|
|
20087
|
+
async deleteBundle(deleteBundle) {
|
|
20088
|
+
markChanged("delete", deleteBundle);
|
|
20089
|
+
}
|
|
20087
20090
|
});
|
|
20088
20091
|
}
|
|
20089
20092
|
|
|
@@ -30525,6 +30528,20 @@ const createBlobDatabasePlugin = ({ name, getContext, listObjects, loadObject, u
|
|
|
30525
30528
|
else if (data.targetAppVersion) pathsToInvalidate.add(`${apiBasePath}/app-version/${data.platform}/${data.targetAppVersion}/${data.channel}/*`);
|
|
30526
30529
|
continue;
|
|
30527
30530
|
}
|
|
30531
|
+
if (operation === "delete") {
|
|
30532
|
+
let bundle$1 = pendingBundlesMap.get(data.id);
|
|
30533
|
+
if (!bundle$1) bundle$1 = bundlesMap.get(data.id);
|
|
30534
|
+
if (!bundle$1) throw new Error("Bundle to delete not found");
|
|
30535
|
+
bundlesMap.delete(data.id);
|
|
30536
|
+
pendingBundlesMap.delete(data.id);
|
|
30537
|
+
const key = bundle$1._updateJsonKey;
|
|
30538
|
+
removalsByKey[key] = removalsByKey[key] || [];
|
|
30539
|
+
removalsByKey[key].push(bundle$1.id);
|
|
30540
|
+
pathsToInvalidate.add(`/${key}`);
|
|
30541
|
+
if (bundle$1.fingerprintHash) pathsToInvalidate.add(`${apiBasePath}/fingerprint/${bundle$1.platform}/${bundle$1.fingerprintHash}/${bundle$1.channel}/*`);
|
|
30542
|
+
else if (bundle$1.targetAppVersion) pathsToInvalidate.add(`${apiBasePath}/app-version/${bundle$1.platform}/${bundle$1.targetAppVersion}/${bundle$1.channel}/*`);
|
|
30543
|
+
continue;
|
|
30544
|
+
}
|
|
30528
30545
|
let bundle = pendingBundlesMap.get(data.id);
|
|
30529
30546
|
if (!bundle) bundle = bundlesMap.get(data.id);
|
|
30530
30547
|
if (!bundle) throw new Error("targetBundleId not found");
|
package/dist/index.d.cts
CHANGED
|
@@ -42,10 +42,11 @@ interface DatabasePlugin {
|
|
|
42
42
|
pagination: PaginationInfo;
|
|
43
43
|
}>;
|
|
44
44
|
updateBundle: (targetBundleId: string, newBundle: Partial<Bundle$1>) => Promise<void>;
|
|
45
|
-
appendBundle: (
|
|
45
|
+
appendBundle: (insertBundle: Bundle$1) => Promise<void>;
|
|
46
46
|
commitBundle: () => Promise<void>;
|
|
47
47
|
onUnmount?: () => Promise<void>;
|
|
48
48
|
name: string;
|
|
49
|
+
deleteBundle: (deleteBundle: Bundle$1) => Promise<void>;
|
|
49
50
|
}
|
|
50
51
|
interface DatabasePluginHooks {
|
|
51
52
|
onDatabaseUpdated?: () => Promise<void>;
|
|
@@ -66,7 +67,9 @@ interface StoragePlugin {
|
|
|
66
67
|
uploadBundle: (bundleId: string, bundlePath: string) => Promise<{
|
|
67
68
|
storageUri: string;
|
|
68
69
|
}>;
|
|
69
|
-
deleteBundle: (bundleId: string) => Promise<
|
|
70
|
+
deleteBundle: (bundleId: string) => Promise<{
|
|
71
|
+
storageUri: string;
|
|
72
|
+
}>;
|
|
70
73
|
name: string;
|
|
71
74
|
}
|
|
72
75
|
interface StoragePluginHooks {
|
package/dist/index.d.ts
CHANGED
|
@@ -42,10 +42,11 @@ interface DatabasePlugin {
|
|
|
42
42
|
pagination: PaginationInfo;
|
|
43
43
|
}>;
|
|
44
44
|
updateBundle: (targetBundleId: string, newBundle: Partial<Bundle$1>) => Promise<void>;
|
|
45
|
-
appendBundle: (
|
|
45
|
+
appendBundle: (insertBundle: Bundle$1) => Promise<void>;
|
|
46
46
|
commitBundle: () => Promise<void>;
|
|
47
47
|
onUnmount?: () => Promise<void>;
|
|
48
48
|
name: string;
|
|
49
|
+
deleteBundle: (deleteBundle: Bundle$1) => Promise<void>;
|
|
49
50
|
}
|
|
50
51
|
interface DatabasePluginHooks {
|
|
51
52
|
onDatabaseUpdated?: () => Promise<void>;
|
|
@@ -66,7 +67,9 @@ interface StoragePlugin {
|
|
|
66
67
|
uploadBundle: (bundleId: string, bundlePath: string) => Promise<{
|
|
67
68
|
storageUri: string;
|
|
68
69
|
}>;
|
|
69
|
-
deleteBundle: (bundleId: string) => Promise<
|
|
70
|
+
deleteBundle: (bundleId: string) => Promise<{
|
|
71
|
+
storageUri: string;
|
|
72
|
+
}>;
|
|
70
73
|
name: string;
|
|
71
74
|
}
|
|
72
75
|
interface StoragePluginHooks {
|
package/dist/index.js
CHANGED
|
@@ -20085,7 +20085,10 @@ function createDatabasePlugin(name, abstractPlugin, hooks) {
|
|
|
20085
20085
|
onUnmount: abstractPlugin.onUnmount ? async () => {
|
|
20086
20086
|
const context = memoizedContext();
|
|
20087
20087
|
await abstractPlugin.onUnmount?.(context);
|
|
20088
|
-
} : void 0
|
|
20088
|
+
} : void 0,
|
|
20089
|
+
async deleteBundle(deleteBundle) {
|
|
20090
|
+
markChanged("delete", deleteBundle);
|
|
20091
|
+
}
|
|
20089
20092
|
});
|
|
20090
20093
|
}
|
|
20091
20094
|
|
|
@@ -30527,6 +30530,20 @@ const createBlobDatabasePlugin = ({ name, getContext, listObjects, loadObject, u
|
|
|
30527
30530
|
else if (data.targetAppVersion) pathsToInvalidate.add(`${apiBasePath}/app-version/${data.platform}/${data.targetAppVersion}/${data.channel}/*`);
|
|
30528
30531
|
continue;
|
|
30529
30532
|
}
|
|
30533
|
+
if (operation === "delete") {
|
|
30534
|
+
let bundle$1 = pendingBundlesMap.get(data.id);
|
|
30535
|
+
if (!bundle$1) bundle$1 = bundlesMap.get(data.id);
|
|
30536
|
+
if (!bundle$1) throw new Error("Bundle to delete not found");
|
|
30537
|
+
bundlesMap.delete(data.id);
|
|
30538
|
+
pendingBundlesMap.delete(data.id);
|
|
30539
|
+
const key = bundle$1._updateJsonKey;
|
|
30540
|
+
removalsByKey[key] = removalsByKey[key] || [];
|
|
30541
|
+
removalsByKey[key].push(bundle$1.id);
|
|
30542
|
+
pathsToInvalidate.add(`/${key}`);
|
|
30543
|
+
if (bundle$1.fingerprintHash) pathsToInvalidate.add(`${apiBasePath}/fingerprint/${bundle$1.platform}/${bundle$1.fingerprintHash}/${bundle$1.channel}/*`);
|
|
30544
|
+
else if (bundle$1.targetAppVersion) pathsToInvalidate.add(`${apiBasePath}/app-version/${bundle$1.platform}/${bundle$1.targetAppVersion}/${bundle$1.channel}/*`);
|
|
30545
|
+
continue;
|
|
30546
|
+
}
|
|
30530
30547
|
let bundle = pendingBundlesMap.get(data.id);
|
|
30531
30548
|
if (!bundle) bundle = bundlesMap.get(data.id);
|
|
30532
30549
|
if (!bundle) throw new Error("targetBundleId not found");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-core",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"cosmiconfig": "9.0.0",
|
|
42
42
|
"cosmiconfig-typescript-loader": "5.0.0",
|
|
43
43
|
"oxc-transform": "0.72.0",
|
|
44
|
-
"@hot-updater/core": "0.18.
|
|
44
|
+
"@hot-updater/core": "0.18.5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^22.7.5",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"jszip": "^3.10.1",
|
|
51
51
|
"picocolors": "^1.0.0",
|
|
52
52
|
"typescript": "5.8.2",
|
|
53
|
-
"workspace-tools": "^0.36.4"
|
|
53
|
+
"workspace-tools": "^0.36.4",
|
|
54
|
+
"@hot-updater/plugin-core": "0.18.5"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
57
|
"build": "tsdown",
|