@hot-updater/plugin-core 0.1.4 → 0.1.6-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/index.d.cts +25 -16
- package/dist/index.d.ts +25 -16
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Platform,
|
|
2
|
-
export {
|
|
1
|
+
import { Platform, Bundle } from '@hot-updater/core';
|
|
2
|
+
export { Bundle, Platform } from '@hot-updater/core';
|
|
3
3
|
|
|
4
4
|
declare const log: {
|
|
5
5
|
normal: (message: string | number | null | undefined) => void;
|
|
@@ -18,27 +18,36 @@ interface BasePluginArgs {
|
|
|
18
18
|
interface BuildPluginArgs extends BasePluginArgs {
|
|
19
19
|
platform: Platform;
|
|
20
20
|
}
|
|
21
|
-
interface
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
interface DatabasePlugin {
|
|
22
|
+
getBundleById: (bundleId: string) => Promise<Bundle | null>;
|
|
23
|
+
getBundles: (refresh?: boolean) => Promise<Bundle[]>;
|
|
24
|
+
updateBundle: (targetBundleId: string, newBundle: Partial<Bundle>) => Promise<void>;
|
|
25
|
+
setBundles: (bundles: Bundle[]) => Promise<void>;
|
|
26
|
+
appendBundle: (bundles: Bundle) => Promise<void>;
|
|
27
|
+
commitBundle: () => Promise<void>;
|
|
28
|
+
onUnmount?: () => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
interface DatabasePluginHooks {
|
|
31
|
+
onDatabaseUpdated?: () => Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
interface StoragePlugin {
|
|
34
|
+
uploadBundle: (bundleId: string, bundlePath: string) => Promise<{
|
|
35
|
+
fileUrl: string;
|
|
29
36
|
}>;
|
|
30
|
-
deleteBundle: (
|
|
37
|
+
deleteBundle: (bundleId: string) => Promise<string>;
|
|
38
|
+
}
|
|
39
|
+
interface StoragePluginHooks {
|
|
40
|
+
onStorageUploaded?: () => Promise<void>;
|
|
31
41
|
}
|
|
32
42
|
type Config = {
|
|
33
|
-
server: string;
|
|
34
|
-
secretKey: string;
|
|
35
43
|
build: (args: BuildPluginArgs) => Promise<{
|
|
36
44
|
buildPath: string;
|
|
37
|
-
|
|
45
|
+
bundleId: string;
|
|
38
46
|
}>;
|
|
39
|
-
|
|
47
|
+
storage: (args: BasePluginArgs) => StoragePlugin;
|
|
48
|
+
database: (args: BasePluginArgs) => DatabasePlugin;
|
|
40
49
|
};
|
|
41
50
|
|
|
42
51
|
declare const loadConfig: () => Promise<Config | null>;
|
|
43
52
|
|
|
44
|
-
export { type BasePluginArgs, type BuildPluginArgs, type Config, type
|
|
53
|
+
export { type BasePluginArgs, type BuildPluginArgs, type Config, type DatabasePlugin, type DatabasePluginHooks, type StoragePlugin, type StoragePluginHooks, getCwd, loadConfig, log };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Platform,
|
|
2
|
-
export {
|
|
1
|
+
import { Platform, Bundle } from '@hot-updater/core';
|
|
2
|
+
export { Bundle, Platform } from '@hot-updater/core';
|
|
3
3
|
|
|
4
4
|
declare const log: {
|
|
5
5
|
normal: (message: string | number | null | undefined) => void;
|
|
@@ -18,27 +18,36 @@ interface BasePluginArgs {
|
|
|
18
18
|
interface BuildPluginArgs extends BasePluginArgs {
|
|
19
19
|
platform: Platform;
|
|
20
20
|
}
|
|
21
|
-
interface
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
interface DatabasePlugin {
|
|
22
|
+
getBundleById: (bundleId: string) => Promise<Bundle | null>;
|
|
23
|
+
getBundles: (refresh?: boolean) => Promise<Bundle[]>;
|
|
24
|
+
updateBundle: (targetBundleId: string, newBundle: Partial<Bundle>) => Promise<void>;
|
|
25
|
+
setBundles: (bundles: Bundle[]) => Promise<void>;
|
|
26
|
+
appendBundle: (bundles: Bundle) => Promise<void>;
|
|
27
|
+
commitBundle: () => Promise<void>;
|
|
28
|
+
onUnmount?: () => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
interface DatabasePluginHooks {
|
|
31
|
+
onDatabaseUpdated?: () => Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
interface StoragePlugin {
|
|
34
|
+
uploadBundle: (bundleId: string, bundlePath: string) => Promise<{
|
|
35
|
+
fileUrl: string;
|
|
29
36
|
}>;
|
|
30
|
-
deleteBundle: (
|
|
37
|
+
deleteBundle: (bundleId: string) => Promise<string>;
|
|
38
|
+
}
|
|
39
|
+
interface StoragePluginHooks {
|
|
40
|
+
onStorageUploaded?: () => Promise<void>;
|
|
31
41
|
}
|
|
32
42
|
type Config = {
|
|
33
|
-
server: string;
|
|
34
|
-
secretKey: string;
|
|
35
43
|
build: (args: BuildPluginArgs) => Promise<{
|
|
36
44
|
buildPath: string;
|
|
37
|
-
|
|
45
|
+
bundleId: string;
|
|
38
46
|
}>;
|
|
39
|
-
|
|
47
|
+
storage: (args: BasePluginArgs) => StoragePlugin;
|
|
48
|
+
database: (args: BasePluginArgs) => DatabasePlugin;
|
|
40
49
|
};
|
|
41
50
|
|
|
42
51
|
declare const loadConfig: () => Promise<Config | null>;
|
|
43
52
|
|
|
44
|
-
export { type BasePluginArgs, type BuildPluginArgs, type Config, type
|
|
53
|
+
export { type BasePluginArgs, type BuildPluginArgs, type Config, type DatabasePlugin, type DatabasePluginHooks, type StoragePlugin, type StoragePluginHooks, getCwd, loadConfig, log };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@hot-updater/
|
|
41
|
+
"@hot-updater/core": "0.1.6-0",
|
|
42
42
|
"cosmiconfig": "^9.0.0",
|
|
43
43
|
"cosmiconfig-typescript-loader": "^5.0.0",
|
|
44
44
|
"picocolors": "^1.0.0",
|