capacitor-ota 1.0.3 → 1.0.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/cli/ota.mjs +1 -4
- package/dist/src/index.mjs +3 -3
- package/package.json +2 -1
package/dist/cli/ota.mjs
CHANGED
|
@@ -108,7 +108,6 @@ async function upload(appId, inputPath, options) {
|
|
|
108
108
|
formData.append("version", options.version || "1.0.0");
|
|
109
109
|
formData.append("channel", options.channel || "production");
|
|
110
110
|
formData.append("bundle", blob, "bundle.zip");
|
|
111
|
-
if (options.capacitorAppId) formData.append("capacitor_app_id", options.capacitorAppId);
|
|
112
111
|
if (options.minNativeVersion) formData.append("min_native_version", options.minNativeVersion);
|
|
113
112
|
if (options.releaseNotes) formData.append("release_notes", options.releaseNotes);
|
|
114
113
|
console.log(`📤 Uploading...`);
|
|
@@ -155,7 +154,6 @@ Commands:
|
|
|
155
154
|
upload <app_id> <path> Upload a new version (directory or .zip)
|
|
156
155
|
--version, -v <version> Version number (default: 1.0.0)
|
|
157
156
|
--channel, -c <channel> Channel (default: production)
|
|
158
|
-
--capacitor-app-id <id> Capacitor app ID for static JSON
|
|
159
157
|
--min-native <version> Minimum native version
|
|
160
158
|
--notes <text> Release notes
|
|
161
159
|
delete <version_id> Delete a version
|
|
@@ -167,7 +165,7 @@ Examples:
|
|
|
167
165
|
ota login admin password123
|
|
168
166
|
ota apps
|
|
169
167
|
ota versions 9fa3a103d8d0
|
|
170
|
-
ota upload 9fa3a103d8d0 ./dist -v 1.0.1
|
|
168
|
+
ota upload 9fa3a103d8d0 ./dist -v 1.0.1
|
|
171
169
|
ota upload 9fa3a103d8d0 ./bundle.zip -v 1.0.2
|
|
172
170
|
ota delete 5
|
|
173
171
|
ota rollback 3
|
|
@@ -213,7 +211,6 @@ async function main() {
|
|
|
213
211
|
await upload(positional[0], positional[1], {
|
|
214
212
|
version: options["version"] || options["v"],
|
|
215
213
|
channel: options["channel"] || options["c"],
|
|
216
|
-
capacitorAppId: options["capacitor-app-id"],
|
|
217
214
|
minNativeVersion: options["min-native"],
|
|
218
215
|
releaseNotes: options["notes"]
|
|
219
216
|
});
|
package/dist/src/index.mjs
CHANGED
|
@@ -65,8 +65,8 @@ var OtaUpdater = class {
|
|
|
65
65
|
error: null
|
|
66
66
|
});
|
|
67
67
|
try {
|
|
68
|
-
const url = `${this.config.staticUrl}/updates/${this.config.appId}.json
|
|
69
|
-
const response = await fetch(url);
|
|
68
|
+
const url = `${this.config.staticUrl}/updates/${this.config.appId}.json`;
|
|
69
|
+
const response = await fetch(url, { cache: "no-store" });
|
|
70
70
|
if (!response.ok) {
|
|
71
71
|
if (response.status === 404) {
|
|
72
72
|
this.setState({ status: "idle" });
|
|
@@ -118,7 +118,7 @@ var OtaUpdater = class {
|
|
|
118
118
|
}
|
|
119
119
|
try {
|
|
120
120
|
const url = `${this.config.staticUrl}/updates/${this.config.appId}.json`;
|
|
121
|
-
const data = await (await fetch(url)).json();
|
|
121
|
+
const data = await (await fetch(url, { cache: "no-store" })).json();
|
|
122
122
|
const { CapacitorUpdater } = await import("@capgo/capacitor-updater");
|
|
123
123
|
const listener = await CapacitorUpdater.addListener("download", (event) => {
|
|
124
124
|
this.setState({ progress: event.percent });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-ota",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.mjs",
|
|
6
6
|
"types": "dist/src/index.d.mts",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"panel:dev": "vite dev --host",
|
|
24
24
|
"panel:build": "vite build",
|
|
25
25
|
"panel:preview": "vite preview",
|
|
26
|
+
"build:web": "vite build && wrangler deploy",
|
|
26
27
|
"db:migrate": "wrangler d1 migrations apply ota-db --local",
|
|
27
28
|
"db:migrate:remote": "wrangler d1 migrations apply ota-db --remote",
|
|
28
29
|
"cli": "tsx cli/ota.ts"
|