@gfean/react-native-bundle-drop 0.1.31
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/BundleDrop.podspec +23 -0
- package/CLIENT_README.md +139 -0
- package/README.md +91 -0
- package/android/build.gradle +79 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/bundledrop/BundleDropModule.kt +148 -0
- package/android/src/main/java/com/bundledrop/BundleDropPackage.kt +16 -0
- package/ios/BundleDropBridge.m +16 -0
- package/ios/BundleDropLocator.swift +34 -0
- package/ios/BundleDropModule.swift +58 -0
- package/lib/CLI/cli.d.ts +2 -0
- package/lib/CLI/cli.js +122 -0
- package/lib/CLI/scripts/init-config.d.ts +17 -0
- package/lib/CLI/scripts/init-config.js +106 -0
- package/lib/CLI/scripts/init-native-config.d.ts +2 -0
- package/lib/CLI/scripts/init-native-config.js +137 -0
- package/lib/CLI/scripts/login-cli.d.ts +2 -0
- package/lib/CLI/scripts/login-cli.js +56 -0
- package/lib/CLI/scripts/upload-cli.d.ts +8 -0
- package/lib/CLI/scripts/upload-cli.js +248 -0
- package/lib/CLI/utils/ui.d.ts +8 -0
- package/lib/CLI/utils/ui.js +16 -0
- package/lib/bundleInfo.d.ts +14 -0
- package/lib/bundleInfo.js +34 -0
- package/lib/image-manifest.d.ts +1 -0
- package/lib/image-manifest.js +4 -0
- package/lib/index.d.ts +51 -0
- package/lib/index.js +415 -0
- package/lib/injectImageResolver.d.ts +2 -0
- package/lib/injectImageResolver.js +121 -0
- package/lib/loadConfig.d.ts +17 -0
- package/lib/loadConfig.js +33 -0
- package/lib/patchImageAutoResolve.d.ts +1 -0
- package/lib/patchImageAutoResolve.js +25 -0
- package/lib/scripts/bundle.d.ts +2 -0
- package/lib/scripts/bundle.js +163 -0
- package/lib/scripts/download-bundle.d.ts +2 -0
- package/lib/scripts/download-bundle.js +79 -0
- package/lib/scripts/upload-bundle.d.ts +2 -0
- package/lib/scripts/upload-bundle.js +290 -0
- package/lib/types.d.ts +1 -0
- package/lib/types.js +2 -0
- package/lib/useBundleDrop.d.ts +40 -0
- package/lib/useBundleDrop.js +131 -0
- package/package.json +66 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.default = upload;
|
|
40
|
+
const axios_1 = __importDefault(require("axios"));
|
|
41
|
+
const child_process_1 = require("child_process");
|
|
42
|
+
const form_data_1 = __importDefault(require("form-data"));
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const plist = __importStar(require("plist"));
|
|
46
|
+
const ui_1 = require("../utils/ui");
|
|
47
|
+
const packageRoot = path.resolve(__dirname, '..', '..', '..');
|
|
48
|
+
async function upload(platform, options) {
|
|
49
|
+
console.log(); // blank line
|
|
50
|
+
ui_1.log.info('🚀 React Native OTA Upload Initialized');
|
|
51
|
+
const projectRoot = process.cwd();
|
|
52
|
+
const configPath = path.resolve(projectRoot, 'bundle.drop.config.js');
|
|
53
|
+
//eslint-disable-next-line
|
|
54
|
+
const authPath = path.join(require('os').homedir(), '.bundle-drop', 'auth.json');
|
|
55
|
+
// Validate config
|
|
56
|
+
if (!fs.existsSync(configPath)) {
|
|
57
|
+
ui_1.log.error('❌ bundle.drop.config.js not found in project root');
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
//eslint-disable-next-line
|
|
61
|
+
const config = require(configPath);
|
|
62
|
+
const serverUrl = config.serverUrl;
|
|
63
|
+
const orgSlug = config.org?.slug;
|
|
64
|
+
const projectSlug = config.project?.slug;
|
|
65
|
+
if (!serverUrl || !projectSlug || !orgSlug) {
|
|
66
|
+
ui_1.log.error('❌ Missing "serverUrl", "org.slug" or "project.slug" in config');
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
// Validate auth token
|
|
70
|
+
if (!fs.existsSync(authPath)) {
|
|
71
|
+
ui_1.log.error('❌ Not authenticated. Please run `bundle-drop login` first.');
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
const { token } = JSON.parse(fs.readFileSync(authPath, 'utf-8'));
|
|
75
|
+
// Validate channel
|
|
76
|
+
const channel = options.channel;
|
|
77
|
+
if (!channel) {
|
|
78
|
+
ui_1.log.error('❌ Missing required --channel argument');
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
ui_1.log.label('Platform', platform);
|
|
82
|
+
ui_1.log.label('Org', orgSlug);
|
|
83
|
+
ui_1.log.label('Project', projectSlug);
|
|
84
|
+
ui_1.log.label('Channel', channel);
|
|
85
|
+
let version = options.version;
|
|
86
|
+
const buildGradlePath = options.buildGradlePath || options.buildgradlePath;
|
|
87
|
+
let runtimeVersionOverride = options.runtimeVersion;
|
|
88
|
+
let releaseNotes = options.releaseNotes;
|
|
89
|
+
const MAX_NOTES = 2000;
|
|
90
|
+
if (releaseNotes && releaseNotes.length > MAX_NOTES) {
|
|
91
|
+
ui_1.log.warn(`Release notes too long (${releaseNotes.length}); truncating to ${MAX_NOTES} chars.`);
|
|
92
|
+
releaseNotes = releaseNotes.slice(0, MAX_NOTES);
|
|
93
|
+
}
|
|
94
|
+
const parseAndroidVersionFromGradle = (filePath) => {
|
|
95
|
+
if (!fs.existsSync(filePath)) {
|
|
96
|
+
ui_1.log.error(`❌ build.gradle not found at ${filePath}`);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
100
|
+
const match = content.match(/versionName\s+['"]([^'"]+)['"]/);
|
|
101
|
+
if (!match) {
|
|
102
|
+
ui_1.log.error('❌ Could not parse versionName from build.gradle');
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
return match[1];
|
|
106
|
+
};
|
|
107
|
+
if (platform === 'ios') {
|
|
108
|
+
if (!version) {
|
|
109
|
+
if (!options.plistFile) {
|
|
110
|
+
ui_1.log.error('❌ Provide --version or --plist-file for iOS');
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const plistContent = fs.readFileSync(options.plistFile, 'utf-8');
|
|
115
|
+
const parsed = plist.parse(plistContent);
|
|
116
|
+
version = parsed.CFBundleShortVersionString;
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
ui_1.log.error(`❌ Failed to parse Info.plist: ${err.message}`);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
if (!version) {
|
|
126
|
+
if (buildGradlePath) {
|
|
127
|
+
version = parseAndroidVersionFromGradle(path.resolve(projectRoot, buildGradlePath));
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const defaultPath = path.join(projectRoot, 'android', 'app', 'build.gradle');
|
|
131
|
+
if (fs.existsSync(defaultPath)) {
|
|
132
|
+
version = parseAndroidVersionFromGradle(defaultPath);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
ui_1.log.error('❌ Provide --version or --buildgradle-path for Android');
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (!version) {
|
|
142
|
+
ui_1.log.error('❌ Version could not be determined');
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
ui_1.log.label('App Version', version);
|
|
146
|
+
console.log();
|
|
147
|
+
ui_1.log.arrow(`Bundling ${platform} app...`);
|
|
148
|
+
const compiledBundleScript = path.join(packageRoot, 'lib', 'scripts', 'bundle.js');
|
|
149
|
+
const tsBundleScript = path.join(packageRoot, 'src', 'scripts', 'bundle.ts');
|
|
150
|
+
const bundleCommand = fs.existsSync(compiledBundleScript)
|
|
151
|
+
? `node ${compiledBundleScript}`
|
|
152
|
+
: `ts-node ${tsBundleScript}`;
|
|
153
|
+
try {
|
|
154
|
+
(0, child_process_1.execSync)(`${bundleCommand} ${platform}`, {
|
|
155
|
+
stdio: 'inherit',
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
ui_1.log.error('❌ Bundling failed');
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
const outputDir = path.join(packageRoot, 'dist');
|
|
163
|
+
const metadataPath = path.join(outputDir, `metadata-${platform}.json`);
|
|
164
|
+
let runtimeVersion;
|
|
165
|
+
try {
|
|
166
|
+
const parsed = JSON.parse(fs.readFileSync(metadataPath, 'utf-8'));
|
|
167
|
+
runtimeVersion = parsed.runtimeVersion;
|
|
168
|
+
if (runtimeVersion) {
|
|
169
|
+
ui_1.log.label('Runtime Version', runtimeVersion);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
// ignore
|
|
174
|
+
}
|
|
175
|
+
if (runtimeVersionOverride) {
|
|
176
|
+
runtimeVersion = runtimeVersionOverride;
|
|
177
|
+
ui_1.log.label('Runtime Version (override)', runtimeVersion);
|
|
178
|
+
}
|
|
179
|
+
else if (!runtimeVersion && config.runtimeVersion?.[platform]) {
|
|
180
|
+
runtimeVersion = config.runtimeVersion[platform];
|
|
181
|
+
ui_1.log.label('Runtime Version (from config)', runtimeVersion);
|
|
182
|
+
}
|
|
183
|
+
if (!runtimeVersion) {
|
|
184
|
+
ui_1.log.error('❌ runtimeVersion could not be determined');
|
|
185
|
+
process.exit(1);
|
|
186
|
+
}
|
|
187
|
+
const zipPath = path.join(outputDir, `bundle-${platform}.zip`);
|
|
188
|
+
if (!fs.existsSync(zipPath)) {
|
|
189
|
+
ui_1.log.error(`❌ Bundle ZIP not found at: ${zipPath}`);
|
|
190
|
+
process.exit(1);
|
|
191
|
+
}
|
|
192
|
+
// Build form data
|
|
193
|
+
const form = new form_data_1.default();
|
|
194
|
+
form.append('orgSlug', orgSlug);
|
|
195
|
+
form.append('projectSlug', projectSlug);
|
|
196
|
+
form.append('platform', platform);
|
|
197
|
+
form.append('version', version);
|
|
198
|
+
form.append('channelName', channel);
|
|
199
|
+
form.append('runtimeVersion', runtimeVersion);
|
|
200
|
+
if (releaseNotes) {
|
|
201
|
+
form.append('releaseNotes', releaseNotes);
|
|
202
|
+
}
|
|
203
|
+
form.append('file', fs.createReadStream(zipPath));
|
|
204
|
+
ui_1.log.arrow('Uploading bundle to server...');
|
|
205
|
+
try {
|
|
206
|
+
const res = await axios_1.default.post(`${serverUrl}/bundle/upload`, form, {
|
|
207
|
+
headers: {
|
|
208
|
+
...form.getHeaders(),
|
|
209
|
+
Authorization: `Bearer ${token}`,
|
|
210
|
+
},
|
|
211
|
+
maxContentLength: Infinity,
|
|
212
|
+
maxBodyLength: Infinity,
|
|
213
|
+
});
|
|
214
|
+
ui_1.log.success(`✅ Upload complete (bundleId: ${res.data?.bundleId || 'N/A'})`);
|
|
215
|
+
}
|
|
216
|
+
catch (err) {
|
|
217
|
+
const raw = err?.response?.data || err.message;
|
|
218
|
+
if (typeof raw === 'object') {
|
|
219
|
+
ui_1.log.error(`Upload failed:\n${JSON.stringify(raw, null, 2)}`);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
ui_1.log.error(`Upload failed: ${raw}`);
|
|
223
|
+
}
|
|
224
|
+
process.exit(1);
|
|
225
|
+
}
|
|
226
|
+
// Cleanup
|
|
227
|
+
console.log();
|
|
228
|
+
ui_1.log.arrow('Cleaning up temporary files...');
|
|
229
|
+
const cleanupFiles = [
|
|
230
|
+
zipPath,
|
|
231
|
+
path.join(outputDir, `metadata-${platform}.json`),
|
|
232
|
+
path.join(outputDir, 'main.jsbundle'),
|
|
233
|
+
];
|
|
234
|
+
const assetsPath = path.join(outputDir, 'assets');
|
|
235
|
+
for (const file of cleanupFiles) {
|
|
236
|
+
if (fs.existsSync(file)) {
|
|
237
|
+
fs.unlinkSync(file);
|
|
238
|
+
ui_1.log.label('🧹 Deleted', file);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (fs.existsSync(assetsPath)) {
|
|
242
|
+
fs.rmSync(assetsPath, { recursive: true, force: true });
|
|
243
|
+
ui_1.log.label('🧹 Deleted', assetsPath);
|
|
244
|
+
}
|
|
245
|
+
console.log();
|
|
246
|
+
ui_1.log.success('🎉 Done! Bundle uploaded and cleaned.');
|
|
247
|
+
console.log();
|
|
248
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.log = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const figures_1 = __importDefault(require("figures"));
|
|
9
|
+
exports.log = {
|
|
10
|
+
info: (msg) => console.log(chalk_1.default.blue(figures_1.default.pointer), msg),
|
|
11
|
+
success: (msg) => console.log(chalk_1.default.green(figures_1.default.tick), msg),
|
|
12
|
+
warn: (msg) => console.log(chalk_1.default.yellow(figures_1.default.warning), msg),
|
|
13
|
+
error: (msg) => console.log(chalk_1.default.red(figures_1.default.cross), msg),
|
|
14
|
+
arrow: (msg) => console.log(chalk_1.default.cyan(figures_1.default.arrowRight), msg),
|
|
15
|
+
label: (label, value) => console.log(`${chalk_1.default.gray(label)}: ${chalk_1.default.white(value)}`),
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type BundleInfo = {
|
|
2
|
+
bundleVersion?: number;
|
|
3
|
+
version?: string;
|
|
4
|
+
hash?: string;
|
|
5
|
+
installedAt?: string;
|
|
6
|
+
channelName?: string;
|
|
7
|
+
platform?: 'ios' | 'android';
|
|
8
|
+
pendingApply?: boolean;
|
|
9
|
+
lastInstalledReportedHash?: string;
|
|
10
|
+
runtimeVersion?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function readBundleInfo(): Promise<BundleInfo | null>;
|
|
13
|
+
export declare function writeBundleInfo(info: BundleInfo): Promise<void>;
|
|
14
|
+
export declare function updateBundleInfo(partial: Partial<BundleInfo>): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readBundleInfo = readBundleInfo;
|
|
7
|
+
exports.writeBundleInfo = writeBundleInfo;
|
|
8
|
+
exports.updateBundleInfo = updateBundleInfo;
|
|
9
|
+
const react_native_fs_1 = __importDefault(require("react-native-fs"));
|
|
10
|
+
const BUNDLE_INFO_PATH = `${react_native_fs_1.default.DocumentDirectoryPath}/bundle-info.json`;
|
|
11
|
+
async function readBundleInfo() {
|
|
12
|
+
try {
|
|
13
|
+
if (!(await react_native_fs_1.default.exists(BUNDLE_INFO_PATH)))
|
|
14
|
+
return null;
|
|
15
|
+
const raw = await react_native_fs_1.default.readFile(BUNDLE_INFO_PATH, 'utf8');
|
|
16
|
+
return JSON.parse(raw);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
console.warn('⚠️ Failed to read bundle-info.json', e);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function writeBundleInfo(info) {
|
|
24
|
+
try {
|
|
25
|
+
await react_native_fs_1.default.writeFile(BUNDLE_INFO_PATH, JSON.stringify(info, null, 2), 'utf8');
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
console.warn('⚠️ Failed to write bundle-info.json', e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function updateBundleInfo(partial) {
|
|
32
|
+
const existing = (await readBundleInfo()) || {};
|
|
33
|
+
await writeBundleInfo({ ...existing, ...partial });
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const imageManifest: Record<string, string>;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BundleInfo } from './bundleInfo';
|
|
2
|
+
import { UpdatePolicy } from './types';
|
|
3
|
+
type UpdateCheckResponse = {
|
|
4
|
+
upToDate?: boolean;
|
|
5
|
+
bundleVersion?: number;
|
|
6
|
+
version?: string;
|
|
7
|
+
hash?: string;
|
|
8
|
+
downloadUrl?: string;
|
|
9
|
+
channelName?: string;
|
|
10
|
+
reason?: string;
|
|
11
|
+
incompatible?: boolean;
|
|
12
|
+
runtimeVersion?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getDownloadedBundlePath(): Promise<string | null>;
|
|
15
|
+
export declare function checkForUpdate(channelName?: string, onStatusUpdate?: (status: string) => void): Promise<UpdateCheckResponse | null>;
|
|
16
|
+
export declare function getInstalledBundleInfo(): Promise<BundleInfo | null>;
|
|
17
|
+
export declare function downloadAndInstallBundle(platformOrStatus?: 'ios' | 'android' | ((status: string) => void), onStatusUpdate?: (status: string) => void, options?: {
|
|
18
|
+
channelName?: string;
|
|
19
|
+
forceDownload?: boolean;
|
|
20
|
+
applyBehavior?: UpdatePolicy;
|
|
21
|
+
}): Promise<string | null>;
|
|
22
|
+
export declare const restartAppAndInstallUpdate: (onStatusUpdate: (status: string) => void, options?: {
|
|
23
|
+
channelName?: string;
|
|
24
|
+
forceDownload?: boolean;
|
|
25
|
+
applyBehavior?: UpdatePolicy;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
export declare const downloadUpdate: (options?: {
|
|
28
|
+
channelName?: string;
|
|
29
|
+
forceDownload?: boolean;
|
|
30
|
+
applyBehavior?: UpdatePolicy;
|
|
31
|
+
}, onStatusUpdate?: (status: string) => void) => Promise<string>;
|
|
32
|
+
export declare const applyReadyUpdate: (onStatusUpdate?: (status: string) => void) => Promise<boolean>;
|
|
33
|
+
export declare const getUpdateState: () => Promise<{
|
|
34
|
+
hasBundle: boolean;
|
|
35
|
+
info: BundleInfo;
|
|
36
|
+
pendingApply: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Initialize update behavior at app start.
|
|
40
|
+
* - manual: no auto-download/apply (optional checkOnly)
|
|
41
|
+
* - immediate: download and apply now; if a pending bundle exists, apply it
|
|
42
|
+
* - on-next-launch: download in background; apply on next launch if pending
|
|
43
|
+
*/
|
|
44
|
+
export declare function initUpdateManager(opts?: {
|
|
45
|
+
channelName?: string;
|
|
46
|
+
policy?: UpdatePolicy;
|
|
47
|
+
onStatusUpdate?: (status: string) => void;
|
|
48
|
+
checkOnly?: boolean;
|
|
49
|
+
}): Promise<void>;
|
|
50
|
+
export type { BundleInfo } from './bundleInfo';
|
|
51
|
+
export type { UpdatePolicy } from './types';
|