@capawesome/capacitor-live-update 6.8.0 → 7.0.0-dev.2633ff2.1765953041
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/CapawesomeCapacitorLiveUpdate.podspec +3 -3
- package/Package.swift +32 -0
- package/README.md +438 -86
- package/android/build.gradle +12 -12
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdate.java +754 -279
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateConfig.java +29 -27
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateHttpClient.java +40 -7
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java +210 -67
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePreferences.java +52 -3
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +11 -2
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java +32 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/{results/GetBundleResult.java → events/NextBundleSetEvent.java} +9 -7
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetConfigOptions.java +19 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SyncOptions.java +4 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/FetchLatestBundleResult.java +8 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java +27 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetConfigResult.java +40 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java +27 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/IsSyncingResult.java +26 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/ReadyResult.java +32 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/interfaces/DownloadProgressCallback.java +5 -0
- package/dist/docs.json +597 -102
- package/dist/esm/definitions.d.ts +338 -39
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +9 -2
- package/dist/esm/web.js +21 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +22 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +22 -3
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Classes/Events/DownloadBundleProgressEvent.swift +25 -0
- package/ios/Plugin/Classes/{Results/GetBundleResult.swift → Events/NextBundleSetEvent.swift} +3 -3
- package/ios/Plugin/Classes/Options/SetConfigOptions.swift +14 -0
- package/ios/Plugin/Classes/Options/SyncOptions.swift +4 -0
- package/ios/Plugin/Classes/Results/{FetchLatestBundle.swift → FetchLatestBundleResult.swift} +6 -1
- package/ios/Plugin/Classes/Results/GetBlockedBundlesResult.swift +16 -0
- package/ios/Plugin/Classes/Results/GetConfigResult.swift +19 -0
- package/ios/Plugin/Classes/Results/GetDownloadedBundlesResult.swift +16 -0
- package/ios/Plugin/Classes/Results/IsSyncingResult.swift +16 -0
- package/ios/Plugin/Classes/Results/ReadyResult.swift +22 -0
- package/ios/Plugin/LiveUpdate.swift +365 -149
- package/ios/Plugin/LiveUpdateConfig.swift +4 -4
- package/ios/Plugin/LiveUpdateHttpClient.swift +10 -4
- package/ios/Plugin/LiveUpdatePlugin.swift +136 -34
- package/ios/Plugin/LiveUpdatePreferences.swift +54 -12
- package/ios/Plugin/Protocols/Api/GetLatestBundleResponse.swift +1 -0
- package/package.json +19 -20
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetBundleOptions.java +0 -18
- package/ios/Plugin/Classes/Options/SetBundleOptions.swift +0 -14
- package/ios/Plugin/LiveUpdatePlugin.h +0 -10
- package/ios/Plugin/LiveUpdatePlugin.m +0 -27
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
package io.capawesome.capacitorjs.plugins.liveupdate.classes.
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.liveupdate.classes.events;
|
|
2
2
|
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
3
|
import androidx.annotation.Nullable;
|
|
5
|
-
import com.getcapacitor.JSArray;
|
|
6
4
|
import com.getcapacitor.JSObject;
|
|
7
|
-
import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
|
|
8
5
|
import org.json.JSONObject;
|
|
9
6
|
|
|
10
|
-
public class
|
|
7
|
+
public class NextBundleSetEvent {
|
|
11
8
|
|
|
12
9
|
@Nullable
|
|
13
|
-
private String bundleId;
|
|
10
|
+
private final String bundleId;
|
|
14
11
|
|
|
15
|
-
public
|
|
12
|
+
public NextBundleSetEvent(@Nullable String bundleId) {
|
|
16
13
|
this.bundleId = bundleId;
|
|
17
14
|
}
|
|
18
15
|
|
|
16
|
+
@Nullable
|
|
17
|
+
public String getBundleId() {
|
|
18
|
+
return bundleId;
|
|
19
|
+
}
|
|
20
|
+
|
|
19
21
|
public JSObject toJSObject() {
|
|
20
22
|
JSObject result = new JSObject();
|
|
21
23
|
result.put("bundleId", bundleId == null ? JSONObject.NULL : bundleId);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.liveupdate.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
|
|
6
|
+
public class SetConfigOptions {
|
|
7
|
+
|
|
8
|
+
@Nullable
|
|
9
|
+
private final String appId;
|
|
10
|
+
|
|
11
|
+
public SetConfigOptions(PluginCall call) {
|
|
12
|
+
this.appId = call.getString("appId");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Nullable
|
|
16
|
+
public String getAppId() {
|
|
17
|
+
return appId;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -18,6 +18,9 @@ public class FetchLatestBundleResult implements Result {
|
|
|
18
18
|
@Nullable
|
|
19
19
|
private final String checksum;
|
|
20
20
|
|
|
21
|
+
@Nullable
|
|
22
|
+
private final JSONObject customProperties;
|
|
23
|
+
|
|
21
24
|
@Nullable
|
|
22
25
|
private final String downloadUrl;
|
|
23
26
|
|
|
@@ -28,12 +31,14 @@ public class FetchLatestBundleResult implements Result {
|
|
|
28
31
|
@Nullable ArtifactType artifactType,
|
|
29
32
|
@Nullable String bundleId,
|
|
30
33
|
@Nullable String checksum,
|
|
34
|
+
@Nullable JSONObject customProperties,
|
|
31
35
|
@Nullable String downloadUrl,
|
|
32
36
|
@Nullable String signature
|
|
33
37
|
) {
|
|
34
38
|
this.artifactType = artifactType;
|
|
35
39
|
this.bundleId = bundleId;
|
|
36
40
|
this.checksum = checksum;
|
|
41
|
+
this.customProperties = customProperties;
|
|
37
42
|
this.downloadUrl = downloadUrl;
|
|
38
43
|
this.signature = signature;
|
|
39
44
|
}
|
|
@@ -50,6 +55,9 @@ public class FetchLatestBundleResult implements Result {
|
|
|
50
55
|
if (checksum != null) {
|
|
51
56
|
result.put("checksum", checksum);
|
|
52
57
|
}
|
|
58
|
+
if (customProperties != null) {
|
|
59
|
+
result.put("customProperties", customProperties);
|
|
60
|
+
}
|
|
53
61
|
if (downloadUrl != null) {
|
|
54
62
|
result.put("downloadUrl", downloadUrl);
|
|
55
63
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.liveupdate.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSArray;
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
|
|
7
|
+
|
|
8
|
+
public class GetBlockedBundlesResult implements Result {
|
|
9
|
+
|
|
10
|
+
@NonNull
|
|
11
|
+
private String[] bundleIds;
|
|
12
|
+
|
|
13
|
+
public GetBlockedBundlesResult(@NonNull String[] bundleIds) {
|
|
14
|
+
this.bundleIds = bundleIds;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public JSObject toJSObject() {
|
|
18
|
+
JSArray bundleIdsResult = new JSArray();
|
|
19
|
+
for (String bundleId : bundleIds) {
|
|
20
|
+
bundleIdsResult.put(bundleId);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
JSObject result = new JSObject();
|
|
24
|
+
result.put("bundleIds", bundleIdsResult);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.liveupdate.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
|
|
7
|
+
import org.json.JSONObject;
|
|
8
|
+
|
|
9
|
+
public class GetConfigResult implements Result {
|
|
10
|
+
|
|
11
|
+
@Nullable
|
|
12
|
+
private final String appId;
|
|
13
|
+
|
|
14
|
+
@NonNull
|
|
15
|
+
private final String autoUpdateStrategy;
|
|
16
|
+
|
|
17
|
+
public GetConfigResult(@Nullable String appId, @NonNull String autoUpdateStrategy) {
|
|
18
|
+
this.appId = appId;
|
|
19
|
+
this.autoUpdateStrategy = autoUpdateStrategy;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Nullable
|
|
23
|
+
public String getAppId() {
|
|
24
|
+
return appId;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@NonNull
|
|
28
|
+
public String getAutoUpdateStrategy() {
|
|
29
|
+
return autoUpdateStrategy;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
@NonNull
|
|
34
|
+
public JSObject toJSObject() {
|
|
35
|
+
JSObject result = new JSObject();
|
|
36
|
+
result.put("appId", appId == null ? JSONObject.NULL : appId);
|
|
37
|
+
result.put("autoUpdateStrategy", autoUpdateStrategy);
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.liveupdate.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSArray;
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
|
|
7
|
+
|
|
8
|
+
public class GetDownloadedBundlesResult implements Result {
|
|
9
|
+
|
|
10
|
+
@NonNull
|
|
11
|
+
private String[] bundleIds;
|
|
12
|
+
|
|
13
|
+
public GetDownloadedBundlesResult(@NonNull String[] bundleIds) {
|
|
14
|
+
this.bundleIds = bundleIds;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public JSObject toJSObject() {
|
|
18
|
+
JSArray bundleIdsResult = new JSArray();
|
|
19
|
+
for (String bundleId : bundleIds) {
|
|
20
|
+
bundleIdsResult.put(bundleId);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
JSObject result = new JSObject();
|
|
24
|
+
result.put("bundleIds", bundleIdsResult);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.liveupdate.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSObject;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
|
|
6
|
+
|
|
7
|
+
public class IsSyncingResult implements Result {
|
|
8
|
+
|
|
9
|
+
private final boolean syncing;
|
|
10
|
+
|
|
11
|
+
public IsSyncingResult(boolean syncing) {
|
|
12
|
+
this.syncing = syncing;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public boolean getSyncing() {
|
|
16
|
+
return syncing;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Override
|
|
20
|
+
@NonNull
|
|
21
|
+
public JSObject toJSObject() {
|
|
22
|
+
JSObject result = new JSObject();
|
|
23
|
+
result.put("syncing", syncing);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.liveupdate.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
import com.getcapacitor.JSObject;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.liveupdate.LiveUpdate;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
|
|
7
|
+
import org.json.JSONObject;
|
|
8
|
+
|
|
9
|
+
public class ReadyResult implements Result {
|
|
10
|
+
|
|
11
|
+
@Nullable
|
|
12
|
+
private String currentBundleId;
|
|
13
|
+
|
|
14
|
+
@Nullable
|
|
15
|
+
private String previousBundleId;
|
|
16
|
+
|
|
17
|
+
private boolean rollback;
|
|
18
|
+
|
|
19
|
+
public ReadyResult(@Nullable String currentBundleId, @Nullable String previousBundleId, boolean rollback) {
|
|
20
|
+
this.currentBundleId = currentBundleId;
|
|
21
|
+
this.previousBundleId = previousBundleId;
|
|
22
|
+
this.rollback = rollback;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public JSObject toJSObject() {
|
|
26
|
+
JSObject result = new JSObject();
|
|
27
|
+
result.put("currentBundleId", currentBundleId == null ? JSONObject.NULL : currentBundleId);
|
|
28
|
+
result.put("previousBundleId", previousBundleId == null ? JSONObject.NULL : previousBundleId);
|
|
29
|
+
result.put("rollback", rollback);
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
}
|