@capawesome/cordova-live-update 0.1.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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1113 -0
  3. package/dist/docs.json +1654 -0
  4. package/dist/esm/definitions.d.ts +788 -0
  5. package/dist/esm/definitions.js +7 -0
  6. package/dist/esm/definitions.js.map +1 -0
  7. package/dist/esm/exec.d.ts +1 -0
  8. package/dist/esm/exec.js +8 -0
  9. package/dist/esm/exec.js.map +1 -0
  10. package/dist/esm/index.d.ts +4 -0
  11. package/dist/esm/index.js +46 -0
  12. package/dist/esm/index.js.map +1 -0
  13. package/dist/plugin.js +56 -0
  14. package/dist/plugin.js.map +1 -0
  15. package/package.json +93 -0
  16. package/plugin.xml +268 -0
  17. package/src/android/capawesome-cordova-live-update.gradle +12 -0
  18. package/src/android/capawesome-live-update.xml +5 -0
  19. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdate.java +1480 -0
  20. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdateConfig.java +105 -0
  21. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdateHttpClient.java +114 -0
  22. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePathHandler.java +96 -0
  23. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePlugin.java +550 -0
  24. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePreferences.java +151 -0
  25. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/Manifest.java +58 -0
  26. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/ManifestItem.java +37 -0
  27. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/api/GetChannelsResponseItem.java +28 -0
  28. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +74 -0
  29. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java +33 -0
  30. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/events/NextBundleSetEvent.java +26 -0
  31. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/DeleteBundleOptions.java +18 -0
  32. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/DownloadBundleOptions.java +66 -0
  33. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/FetchChannelsOptions.java +39 -0
  34. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/FetchLatestBundleOptions.java +25 -0
  35. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetChannelOptions.java +18 -0
  36. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetConfigOptions.java +20 -0
  37. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetCustomIdOptions.java +18 -0
  38. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetNextBundleOptions.java +21 -0
  39. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SyncOptions.java +25 -0
  40. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/ChannelResult.java +29 -0
  41. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/FetchChannelsResult.java +29 -0
  42. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/FetchLatestBundleResult.java +69 -0
  43. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java +28 -0
  44. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetBundlesResult.java +28 -0
  45. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetChannelResult.java +22 -0
  46. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetConfigResult.java +40 -0
  47. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetCurrentBundleResult.java +22 -0
  48. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetCustomIdResult.java +22 -0
  49. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetDeviceIdResult.java +22 -0
  50. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java +28 -0
  51. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetNextBundleResult.java +22 -0
  52. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetVersionCodeResult.java +21 -0
  53. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetVersionNameResult.java +22 -0
  54. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/IsSyncingResult.java +27 -0
  55. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/ReadyResult.java +32 -0
  56. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/SyncResult.java +22 -0
  57. package/src/android/io/capawesome/cordova/plugins/liveupdate/enums/ArtifactType.java +6 -0
  58. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/Callback.java +5 -0
  59. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/DownloadProgressCallback.java +5 -0
  60. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/EmptyCallback.java +5 -0
  61. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/NonEmptyCallback.java +7 -0
  62. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/Result.java +8 -0
  63. package/src/ios/LiveUpdate.swift +895 -0
  64. package/src/ios/LiveUpdateArtifactType.swift +4 -0
  65. package/src/ios/LiveUpdateChannelResult.swift +18 -0
  66. package/src/ios/LiveUpdateConfig.swift +11 -0
  67. package/src/ios/LiveUpdateDeleteBundleOptions.swift +13 -0
  68. package/src/ios/LiveUpdateDownloadBundleOptions.swift +41 -0
  69. package/src/ios/LiveUpdateDownloadBundleProgressEvent.swift +24 -0
  70. package/src/ios/LiveUpdateError.swift +62 -0
  71. package/src/ios/LiveUpdateFetchChannelsOptions.swift +25 -0
  72. package/src/ios/LiveUpdateFetchChannelsResult.swift +15 -0
  73. package/src/ios/LiveUpdateFetchLatestBundleOptions.swift +17 -0
  74. package/src/ios/LiveUpdateFetchLatestBundleResult.swift +42 -0
  75. package/src/ios/LiveUpdateGetBlockedBundlesResult.swift +15 -0
  76. package/src/ios/LiveUpdateGetBundlesResult.swift +15 -0
  77. package/src/ios/LiveUpdateGetChannelResult.swift +15 -0
  78. package/src/ios/LiveUpdateGetChannelsResponseItem.swift +4 -0
  79. package/src/ios/LiveUpdateGetConfigResult.swift +18 -0
  80. package/src/ios/LiveUpdateGetCurrentBundleResult.swift +15 -0
  81. package/src/ios/LiveUpdateGetCustomIdResult.swift +15 -0
  82. package/src/ios/LiveUpdateGetDeviceIdResult.swift +15 -0
  83. package/src/ios/LiveUpdateGetDownloadedBundlesResult.swift +15 -0
  84. package/src/ios/LiveUpdateGetLatestBundleResponse.swift +8 -0
  85. package/src/ios/LiveUpdateGetNextBundleResult.swift +15 -0
  86. package/src/ios/LiveUpdateGetVersionCodeResult.swift +15 -0
  87. package/src/ios/LiveUpdateGetVersionNameResult.swift +15 -0
  88. package/src/ios/LiveUpdateHttpClient.swift +58 -0
  89. package/src/ios/LiveUpdateIsSyncingResult.swift +15 -0
  90. package/src/ios/LiveUpdateManifest.swift +19 -0
  91. package/src/ios/LiveUpdateManifestItem.swift +5 -0
  92. package/src/ios/LiveUpdateNextBundleSetEvent.swift +15 -0
  93. package/src/ios/LiveUpdatePlugin.swift +521 -0
  94. package/src/ios/LiveUpdatePreferences.swift +116 -0
  95. package/src/ios/LiveUpdateReadyResult.swift +21 -0
  96. package/src/ios/LiveUpdateResult.swift +5 -0
  97. package/src/ios/LiveUpdateSchemeHandler.swift +286 -0
  98. package/src/ios/LiveUpdateSetChannelOptions.swift +13 -0
  99. package/src/ios/LiveUpdateSetConfigOptions.swift +13 -0
  100. package/src/ios/LiveUpdateSetCustomIdOptions.swift +13 -0
  101. package/src/ios/LiveUpdateSetNextBundleOptions.swift +13 -0
  102. package/src/ios/LiveUpdateSyncOptions.swift +17 -0
  103. package/src/ios/LiveUpdateSyncResult.swift +15 -0
@@ -0,0 +1,28 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONArray;
6
+ import org.json.JSONException;
7
+ import org.json.JSONObject;
8
+
9
+ public class GetBundlesResult implements Result {
10
+
11
+ @NonNull
12
+ private String[] bundleIds;
13
+
14
+ public GetBundlesResult(@NonNull String[] bundleIds) {
15
+ this.bundleIds = bundleIds;
16
+ }
17
+
18
+ public JSONObject toJSObject() throws JSONException {
19
+ JSONArray bundleIdsResult = new JSONArray();
20
+ for (String bundleId : bundleIds) {
21
+ bundleIdsResult.put(bundleId);
22
+ }
23
+
24
+ JSONObject result = new JSONObject();
25
+ result.put("bundleIds", bundleIdsResult);
26
+ return result;
27
+ }
28
+ }
@@ -0,0 +1,22 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.Nullable;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class GetChannelResult implements Result {
9
+
10
+ @Nullable
11
+ private String channel;
12
+
13
+ public GetChannelResult(@Nullable String channel) {
14
+ this.channel = channel;
15
+ }
16
+
17
+ public JSONObject toJSObject() throws JSONException {
18
+ JSONObject result = new JSONObject();
19
+ result.put("channel", channel == null ? JSONObject.NULL : channel);
20
+ return result;
21
+ }
22
+ }
@@ -0,0 +1,40 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import androidx.annotation.Nullable;
5
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
6
+ import org.json.JSONException;
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 JSONObject toJSObject() throws JSONException {
35
+ JSONObject result = new JSONObject();
36
+ result.put("appId", appId == null ? JSONObject.NULL : appId);
37
+ result.put("autoUpdateStrategy", autoUpdateStrategy);
38
+ return result;
39
+ }
40
+ }
@@ -0,0 +1,22 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.Nullable;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class GetCurrentBundleResult implements Result {
9
+
10
+ @Nullable
11
+ private String bundleId;
12
+
13
+ public GetCurrentBundleResult(@Nullable String bundleId) {
14
+ this.bundleId = bundleId;
15
+ }
16
+
17
+ public JSONObject toJSObject() throws JSONException {
18
+ JSONObject result = new JSONObject();
19
+ result.put("bundleId", bundleId == null ? JSONObject.NULL : bundleId);
20
+ return result;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.Nullable;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class GetCustomIdResult implements Result {
9
+
10
+ @Nullable
11
+ private String customId;
12
+
13
+ public GetCustomIdResult(@Nullable String customId) {
14
+ this.customId = customId;
15
+ }
16
+
17
+ public JSONObject toJSObject() throws JSONException {
18
+ JSONObject result = new JSONObject();
19
+ result.put("customId", customId == null ? JSONObject.NULL : customId);
20
+ return result;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class GetDeviceIdResult implements Result {
9
+
10
+ @NonNull
11
+ private String deviceId;
12
+
13
+ public GetDeviceIdResult(@NonNull String deviceId) {
14
+ this.deviceId = deviceId;
15
+ }
16
+
17
+ public JSONObject toJSObject() throws JSONException {
18
+ JSONObject result = new JSONObject();
19
+ result.put("deviceId", deviceId == null ? JSONObject.NULL : deviceId);
20
+ return result;
21
+ }
22
+ }
@@ -0,0 +1,28 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONArray;
6
+ import org.json.JSONException;
7
+ import org.json.JSONObject;
8
+
9
+ public class GetDownloadedBundlesResult implements Result {
10
+
11
+ @NonNull
12
+ private String[] bundleIds;
13
+
14
+ public GetDownloadedBundlesResult(@NonNull String[] bundleIds) {
15
+ this.bundleIds = bundleIds;
16
+ }
17
+
18
+ public JSONObject toJSObject() throws JSONException {
19
+ JSONArray bundleIdsResult = new JSONArray();
20
+ for (String bundleId : bundleIds) {
21
+ bundleIdsResult.put(bundleId);
22
+ }
23
+
24
+ JSONObject result = new JSONObject();
25
+ result.put("bundleIds", bundleIdsResult);
26
+ return result;
27
+ }
28
+ }
@@ -0,0 +1,22 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.Nullable;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class GetNextBundleResult implements Result {
9
+
10
+ @Nullable
11
+ private String bundleId;
12
+
13
+ public GetNextBundleResult(@Nullable String bundleId) {
14
+ this.bundleId = bundleId;
15
+ }
16
+
17
+ public JSONObject toJSObject() throws JSONException {
18
+ JSONObject result = new JSONObject();
19
+ result.put("bundleId", bundleId == null ? JSONObject.NULL : bundleId);
20
+ return result;
21
+ }
22
+ }
@@ -0,0 +1,21 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.Nullable;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class GetVersionCodeResult implements Result {
9
+
10
+ private String versionCode;
11
+
12
+ public GetVersionCodeResult(String versionCode) {
13
+ this.versionCode = versionCode;
14
+ }
15
+
16
+ public JSONObject toJSObject() throws JSONException {
17
+ JSONObject result = new JSONObject();
18
+ result.put("versionCode", versionCode);
19
+ return result;
20
+ }
21
+ }
@@ -0,0 +1,22 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class GetVersionNameResult implements Result {
9
+
10
+ @NonNull
11
+ private String versionName;
12
+
13
+ public GetVersionNameResult(@NonNull String versionName) {
14
+ this.versionName = versionName;
15
+ }
16
+
17
+ public JSONObject toJSObject() throws JSONException {
18
+ JSONObject result = new JSONObject();
19
+ result.put("versionName", versionName);
20
+ return result;
21
+ }
22
+ }
@@ -0,0 +1,27 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class IsSyncingResult implements Result {
9
+
10
+ private final boolean syncing;
11
+
12
+ public IsSyncingResult(boolean syncing) {
13
+ this.syncing = syncing;
14
+ }
15
+
16
+ public boolean getSyncing() {
17
+ return syncing;
18
+ }
19
+
20
+ @Override
21
+ @NonNull
22
+ public JSONObject toJSObject() throws JSONException {
23
+ JSONObject result = new JSONObject();
24
+ result.put("syncing", syncing);
25
+ return result;
26
+ }
27
+ }
@@ -0,0 +1,32 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.Nullable;
4
+ import io.capawesome.cordova.plugins.liveupdate.LiveUpdate;
5
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
6
+ import org.json.JSONException;
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 JSONObject toJSObject() throws JSONException {
26
+ JSONObject result = new JSONObject();
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
+ }
@@ -0,0 +1,22 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.classes.results;
2
+
3
+ import androidx.annotation.Nullable;
4
+ import io.capawesome.cordova.plugins.liveupdate.interfaces.Result;
5
+ import org.json.JSONException;
6
+ import org.json.JSONObject;
7
+
8
+ public class SyncResult implements Result {
9
+
10
+ @Nullable
11
+ private final String nextBundleId;
12
+
13
+ public SyncResult(@Nullable String nextBundleId) {
14
+ this.nextBundleId = nextBundleId;
15
+ }
16
+
17
+ public JSONObject toJSObject() throws JSONException {
18
+ JSONObject result = new JSONObject();
19
+ result.put("nextBundleId", nextBundleId == null ? JSONObject.NULL : nextBundleId);
20
+ return result;
21
+ }
22
+ }
@@ -0,0 +1,6 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.enums;
2
+
3
+ public enum ArtifactType {
4
+ MANIFEST,
5
+ ZIP
6
+ }
@@ -0,0 +1,5 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.interfaces;
2
+
3
+ public interface Callback {
4
+ void error(Exception exception);
5
+ }
@@ -0,0 +1,5 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.interfaces;
2
+
3
+ public interface DownloadProgressCallback {
4
+ void onProgress(long downloadedBytes, long totalBytes);
5
+ }
@@ -0,0 +1,5 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.interfaces;
2
+
3
+ public interface EmptyCallback extends Callback {
4
+ void success();
5
+ }
@@ -0,0 +1,7 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.interfaces;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ public interface NonEmptyCallback<T> extends Callback {
6
+ void success(@NonNull T result);
7
+ }
@@ -0,0 +1,8 @@
1
+ package io.capawesome.cordova.plugins.liveupdate.interfaces;
2
+
3
+ import org.json.JSONException;
4
+ import org.json.JSONObject;
5
+
6
+ public interface Result {
7
+ JSONObject toJSObject() throws JSONException;
8
+ }