@capgo/cordova-updater 8.1.1

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 (76) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +82 -0
  3. package/dist/esm/definitions.d.ts +2684 -0
  4. package/dist/esm/definitions.js +109 -0
  5. package/dist/esm/definitions.js.map +1 -0
  6. package/dist/esm/exec.d.ts +4 -0
  7. package/dist/esm/exec.js +25 -0
  8. package/dist/esm/exec.js.map +1 -0
  9. package/dist/esm/history.d.ts +1 -0
  10. package/dist/esm/history.js +283 -0
  11. package/dist/esm/history.js.map +1 -0
  12. package/dist/esm/index.d.ts +57 -0
  13. package/dist/esm/index.js +68 -0
  14. package/dist/esm/index.js.map +1 -0
  15. package/dist/esm/plugin.d.ts +57 -0
  16. package/dist/esm/plugin.js +15 -0
  17. package/dist/esm/plugin.js.map +1 -0
  18. package/dist/plugin.cjs.js +217 -0
  19. package/dist/plugin.cjs.js.map +1 -0
  20. package/dist/plugin.js +222 -0
  21. package/dist/plugin.js.map +1 -0
  22. package/package.json +96 -0
  23. package/plugin.xml +207 -0
  24. package/src/android/CordovaUpdaterPlugin.java +5662 -0
  25. package/src/android/UpdaterPathHandler.java +99 -0
  26. package/src/android/app/capgo/cordova/updater/AndroidAppExitReporter.java +92 -0
  27. package/src/android/app/capgo/cordova/updater/AppLifecycleObserver.java +115 -0
  28. package/src/android/app/capgo/cordova/updater/BundleInfo.java +246 -0
  29. package/src/android/app/capgo/cordova/updater/BundleStatus.java +45 -0
  30. package/src/android/app/capgo/cordova/updater/Callback.java +13 -0
  31. package/src/android/app/capgo/cordova/updater/CapgoUpdater.java +3404 -0
  32. package/src/android/app/capgo/cordova/updater/CordovaUpdaterConfig.java +56 -0
  33. package/src/android/app/capgo/cordova/updater/CryptoCipher.java +462 -0
  34. package/src/android/app/capgo/cordova/updater/DataManager.java +44 -0
  35. package/src/android/app/capgo/cordova/updater/DelayCondition.java +56 -0
  36. package/src/android/app/capgo/cordova/updater/DelayUntilNext.java +14 -0
  37. package/src/android/app/capgo/cordova/updater/DelayUpdateUtils.java +307 -0
  38. package/src/android/app/capgo/cordova/updater/DeviceIdHelper.java +230 -0
  39. package/src/android/app/capgo/cordova/updater/DownloadService.java +1219 -0
  40. package/src/android/app/capgo/cordova/updater/DownloadWorkerManager.java +260 -0
  41. package/src/android/app/capgo/cordova/updater/InternalUtils.java +54 -0
  42. package/src/android/app/capgo/cordova/updater/Logger.java +345 -0
  43. package/src/android/app/capgo/cordova/updater/ShakeDetector.java +72 -0
  44. package/src/android/app/capgo/cordova/updater/ShakeMenu.java +39 -0
  45. package/src/android/app/capgo/cordova/updater/ThreeFingerPinchDetector.java +323 -0
  46. package/src/android/app/capgo/cordova/updater/compat/JSArray.java +9 -0
  47. package/src/android/app/capgo/cordova/updater/compat/JSObject.java +83 -0
  48. package/src/android/app/capgo/cordova/updater/compat/PluginCall.java +165 -0
  49. package/src/android/capgo-cordova-updater.gradle +19 -0
  50. package/src/android/capgo-updater.xml +3 -0
  51. package/src/android/test/app/capgo/cordova/updater/CapacitorUpdaterUnitTest.java.skip +3039 -0
  52. package/src/android/test/app/capgo/cordova/updater/DelayUpdateUtilsTest.java +177 -0
  53. package/src/android/test/app/capgo/cordova/updater/NativeContractTest.java +105 -0
  54. package/src/ios/AES.swift +216 -0
  55. package/src/ios/AppHealthTracker.swift +82 -0
  56. package/src/ios/BundleInfo.swift +185 -0
  57. package/src/ios/BundleStatus.swift +127 -0
  58. package/src/ios/CapgoRawRsa.swift +36 -0
  59. package/src/ios/CapgoUpdater.swift +3544 -0
  60. package/src/ios/CordovaCompat.swift +11 -0
  61. package/src/ios/CordovaPluginCall.swift +190 -0
  62. package/src/ios/CordovaUpdaterCommands.swift +270 -0
  63. package/src/ios/CordovaUpdaterPlugin.swift +4706 -0
  64. package/src/ios/CryptoCipher.swift +326 -0
  65. package/src/ios/DelayCondition.swift +74 -0
  66. package/src/ios/DelayUntilNext.swift +30 -0
  67. package/src/ios/DelayUpdateUtils.swift +257 -0
  68. package/src/ios/DeviceIdHelper.swift +120 -0
  69. package/src/ios/Info.plist +28 -0
  70. package/src/ios/InternalUtils.swift +471 -0
  71. package/src/ios/Logger.swift +283 -0
  72. package/src/ios/RSA.swift +96 -0
  73. package/src/ios/ShakeMenu.swift +52 -0
  74. package/src/ios/UpdaterSchemeHandler.swift +81 -0
  75. package/src/ios/UserDefaultsExtension.swift +46 -0
  76. package/src/ios/WebViewStatsReporter.swift +303 -0
@@ -0,0 +1,217 @@
1
+ 'use strict';
2
+
3
+ /*
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+ const SERVICE_NAME = 'Updater';
9
+ /** Cordova resolves no-arg native success as `''` instead of `null`/`undefined`. */
10
+ function normalizeEmptyCordovaResult(result) {
11
+ if (result == null || result === '') {
12
+ return null;
13
+ }
14
+ if (typeof result === 'object' && !Array.isArray(result)) {
15
+ const record = result;
16
+ if (!('bundle' in record) && !('id' in record) && Object.keys(record).length === 0) {
17
+ return null;
18
+ }
19
+ }
20
+ return result;
21
+ }
22
+ function exec(action, args = []) {
23
+ return new Promise((resolve, reject) => {
24
+ cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, args);
25
+ });
26
+ }
27
+
28
+ /*
29
+ * This Source Code Form is subject to the terms of the Mozilla Public
30
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
31
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
32
+ */
33
+ /**
34
+ * Update availability status.
35
+ *
36
+ * @since 8.0.0
37
+ */
38
+ var AppUpdateAvailability;
39
+ (function (AppUpdateAvailability) {
40
+ /**
41
+ * Update availability is unknown.
42
+ * This typically means the check hasn't completed or failed.
43
+ */
44
+ AppUpdateAvailability[AppUpdateAvailability["UNKNOWN"] = 0] = "UNKNOWN";
45
+ /**
46
+ * No update is available.
47
+ * The installed version is the latest.
48
+ */
49
+ AppUpdateAvailability[AppUpdateAvailability["UPDATE_NOT_AVAILABLE"] = 1] = "UPDATE_NOT_AVAILABLE";
50
+ /**
51
+ * An update is available for download.
52
+ */
53
+ AppUpdateAvailability[AppUpdateAvailability["UPDATE_AVAILABLE"] = 2] = "UPDATE_AVAILABLE";
54
+ /**
55
+ * An update is currently being downloaded or installed.
56
+ */
57
+ AppUpdateAvailability[AppUpdateAvailability["UPDATE_IN_PROGRESS"] = 3] = "UPDATE_IN_PROGRESS";
58
+ })(AppUpdateAvailability || (AppUpdateAvailability = {}));
59
+ /**
60
+ * Installation status for flexible updates (Android only).
61
+ *
62
+ * @since 8.0.0
63
+ */
64
+ var FlexibleUpdateInstallStatus;
65
+ (function (FlexibleUpdateInstallStatus) {
66
+ /**
67
+ * Unknown install status.
68
+ */
69
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["UNKNOWN"] = 0] = "UNKNOWN";
70
+ /**
71
+ * Download is pending and will start soon.
72
+ */
73
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["PENDING"] = 1] = "PENDING";
74
+ /**
75
+ * Download is in progress.
76
+ * Check `bytesDownloaded` and `totalBytesToDownload` for progress.
77
+ */
78
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["DOWNLOADING"] = 2] = "DOWNLOADING";
79
+ /**
80
+ * The update is being installed.
81
+ */
82
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["INSTALLING"] = 3] = "INSTALLING";
83
+ /**
84
+ * The update has been installed.
85
+ * The app needs to be restarted to use the new version.
86
+ */
87
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["INSTALLED"] = 4] = "INSTALLED";
88
+ /**
89
+ * The update failed to download or install.
90
+ */
91
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["FAILED"] = 5] = "FAILED";
92
+ /**
93
+ * The update was canceled by the user.
94
+ */
95
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["CANCELED"] = 6] = "CANCELED";
96
+ /**
97
+ * The update has been downloaded and is ready to install.
98
+ * Call {@link UpdaterPlugin.completeFlexibleUpdate} to install.
99
+ */
100
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["DOWNLOADED"] = 11] = "DOWNLOADED";
101
+ })(FlexibleUpdateInstallStatus || (FlexibleUpdateInstallStatus = {}));
102
+ /**
103
+ * Result codes for app update operations.
104
+ *
105
+ * @since 8.0.0
106
+ */
107
+ var AppUpdateResultCode;
108
+ (function (AppUpdateResultCode) {
109
+ /**
110
+ * The update completed successfully.
111
+ */
112
+ AppUpdateResultCode[AppUpdateResultCode["OK"] = 0] = "OK";
113
+ /**
114
+ * The user canceled the update.
115
+ */
116
+ AppUpdateResultCode[AppUpdateResultCode["CANCELED"] = 1] = "CANCELED";
117
+ /**
118
+ * The update failed.
119
+ */
120
+ AppUpdateResultCode[AppUpdateResultCode["FAILED"] = 2] = "FAILED";
121
+ /**
122
+ * No update is available.
123
+ */
124
+ AppUpdateResultCode[AppUpdateResultCode["NOT_AVAILABLE"] = 3] = "NOT_AVAILABLE";
125
+ /**
126
+ * The requested update type is not allowed.
127
+ * For example, trying to perform an immediate update when only flexible is allowed.
128
+ */
129
+ AppUpdateResultCode[AppUpdateResultCode["NOT_ALLOWED"] = 4] = "NOT_ALLOWED";
130
+ /**
131
+ * Required information is missing.
132
+ * This can happen if {@link UpdaterPlugin.getAppUpdateInfo} wasn't called first.
133
+ */
134
+ AppUpdateResultCode[AppUpdateResultCode["INFO_MISSING"] = 5] = "INFO_MISSING";
135
+ })(AppUpdateResultCode || (AppUpdateResultCode = {}));
136
+
137
+ const Updater = {
138
+ notifyAppReady: () => exec('notifyAppReady'),
139
+ setUpdateUrl: (options) => exec('setUpdateUrl', [options !== null && options !== void 0 ? options : {}]),
140
+ setStatsUrl: (options) => exec('setStatsUrl', [options !== null && options !== void 0 ? options : {}]),
141
+ setChannelUrl: (options) => exec('setChannelUrl', [options !== null && options !== void 0 ? options : {}]),
142
+ download: (options) => exec('download', [options !== null && options !== void 0 ? options : {}]),
143
+ next: (options) => exec('next', [options !== null && options !== void 0 ? options : {}]),
144
+ set: (options) => exec('set', [options !== null && options !== void 0 ? options : {}]),
145
+ startPreviewSession: (options) => exec('startPreviewSession', [options !== null && options !== void 0 ? options : {}]),
146
+ listPreviews: () => exec('listPreviews'),
147
+ setPreview: (options) => exec('setPreview', [options !== null && options !== void 0 ? options : {}]),
148
+ resetPreview: () => exec('resetPreview'),
149
+ deletePreview: (options) => exec('deletePreview', [options !== null && options !== void 0 ? options : {}]),
150
+ checkPreviewUpdate: (options) => exec('checkPreviewUpdate', [options !== null && options !== void 0 ? options : {}]),
151
+ updatePreview: (options) => exec('updatePreview', [options !== null && options !== void 0 ? options : {}]),
152
+ delete: (options) => exec('delete', [options !== null && options !== void 0 ? options : {}]),
153
+ setBundleError: (options) => exec('setBundleError', [options !== null && options !== void 0 ? options : {}]),
154
+ list: () => exec('list'),
155
+ reset: (options) => exec('reset', [options !== null && options !== void 0 ? options : {}]),
156
+ current: () => exec('current'),
157
+ reload: () => exec('reload'),
158
+ setMultiDelay: (options) => exec('setMultiDelay', [options !== null && options !== void 0 ? options : {}]),
159
+ cancelDelay: () => exec('cancelDelay'),
160
+ triggerUpdateCheck: () => exec('triggerUpdateCheck'),
161
+ getLatest: (options) => exec('getLatest', [options !== null && options !== void 0 ? options : {}]),
162
+ getMissingBundleFiles: (options) => exec('getMissingBundleFiles', [options !== null && options !== void 0 ? options : {}]),
163
+ getBundleDownloadSize: (options) => exec('getBundleDownloadSize', [options !== null && options !== void 0 ? options : {}]),
164
+ setChannel: (options) => exec('setChannel', [options !== null && options !== void 0 ? options : {}]),
165
+ unsetChannel: () => exec('unsetChannel'),
166
+ getChannel: () => exec('getChannel'),
167
+ listChannels: (options) => exec('listChannels', [options !== null && options !== void 0 ? options : {}]),
168
+ setCustomId: (options) => exec('setCustomId', [options !== null && options !== void 0 ? options : {}]),
169
+ getBuiltinVersion: () => exec('getBuiltinVersion'),
170
+ getDeviceId: () => exec('getDeviceId'),
171
+ getPluginVersion: () => exec('getPluginVersion'),
172
+ isAutoUpdateEnabled: () => exec('isAutoUpdateEnabled'),
173
+ isAutoUpdateAvailable: () => exec('isAutoUpdateAvailable'),
174
+ getNextBundle: async () => normalizeEmptyCordovaResult(await exec('getNextBundle')),
175
+ getFailedUpdate: async () => normalizeEmptyCordovaResult(await exec('getFailedUpdate')),
176
+ setShakeMenu: (options) => exec('setShakeMenu', [options !== null && options !== void 0 ? options : {}]),
177
+ isShakeMenuEnabled: () => exec('isShakeMenuEnabled'),
178
+ setShakeChannelSelector: (options) => exec('setShakeChannelSelector', [options !== null && options !== void 0 ? options : {}]),
179
+ isShakeChannelSelectorEnabled: () => exec('isShakeChannelSelectorEnabled'),
180
+ getAppId: () => exec('getAppId'),
181
+ setAppId: (options) => exec('setAppId', [options !== null && options !== void 0 ? options : {}]),
182
+ getAppUpdateInfo: () => exec('getAppUpdateInfo'),
183
+ openAppStore: () => exec('openAppStore'),
184
+ performImmediateUpdate: () => exec('performImmediateUpdate'),
185
+ startFlexibleUpdate: () => exec('startFlexibleUpdate'),
186
+ completeFlexibleUpdate: () => exec('completeFlexibleUpdate'),
187
+ reportWebViewError: (options) => exec('reportWebViewError', [options !== null && options !== void 0 ? options : {}]),
188
+ addListener: (eventName, listener) => {
189
+ const listenerId = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;
190
+ void exec('addListener', [{ eventName, listenerId }]);
191
+ const handler = (ev) => listener(ev.detail);
192
+ document.addEventListener(`cordova-updater:${eventName}`, handler);
193
+ return Promise.resolve({
194
+ remove: async () => {
195
+ document.removeEventListener(`cordova-updater:${eventName}`, handler);
196
+ await exec('removeListener', [{ listenerId }]);
197
+ },
198
+ });
199
+ },
200
+ removeAllListeners: () => exec('removeAllListeners'),
201
+ };
202
+
203
+ /*
204
+ * This Source Code Form is subject to the terms of the Mozilla Public
205
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
206
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
207
+ */
208
+ const api = Object.assign({}, Updater);
209
+ document.addEventListener('deviceready', () => {
210
+ const win = window;
211
+ win.cordova = win.cordova || {};
212
+ win.cordova.plugins = win.cordova.plugins || {};
213
+ win.cordova.plugins.Updater = api;
214
+ });
215
+
216
+ exports.Updater = api;
217
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/exec.js","esm/definitions.js","esm/index.js","esm/plugin.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nexport const SERVICE_NAME = 'Updater';\n/** Cordova resolves no-arg native success as `''` instead of `null`/`undefined`. */\nexport function normalizeEmptyCordovaResult(result) {\n if (result == null || result === '') {\n return null;\n }\n if (typeof result === 'object' && !Array.isArray(result)) {\n const record = result;\n if (!('bundle' in record) && !('id' in record) && Object.keys(record).length === 0) {\n return null;\n }\n }\n return result;\n}\nexport function exec(action, args = []) {\n return new Promise((resolve, reject) => {\n cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, args);\n });\n}\n//# sourceMappingURL=exec.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n/**\n * Update availability status.\n *\n * @since 8.0.0\n */\nexport var AppUpdateAvailability;\n(function (AppUpdateAvailability) {\n /**\n * Update availability is unknown.\n * This typically means the check hasn't completed or failed.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * No update is available.\n * The installed version is the latest.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_NOT_AVAILABLE\"] = 1] = \"UPDATE_NOT_AVAILABLE\";\n /**\n * An update is available for download.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_AVAILABLE\"] = 2] = \"UPDATE_AVAILABLE\";\n /**\n * An update is currently being downloaded or installed.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_IN_PROGRESS\"] = 3] = \"UPDATE_IN_PROGRESS\";\n})(AppUpdateAvailability || (AppUpdateAvailability = {}));\n/**\n * Installation status for flexible updates (Android only).\n *\n * @since 8.0.0\n */\nexport var FlexibleUpdateInstallStatus;\n(function (FlexibleUpdateInstallStatus) {\n /**\n * Unknown install status.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * Download is pending and will start soon.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"PENDING\"] = 1] = \"PENDING\";\n /**\n * Download is in progress.\n * Check `bytesDownloaded` and `totalBytesToDownload` for progress.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"DOWNLOADING\"] = 2] = \"DOWNLOADING\";\n /**\n * The update is being installed.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"INSTALLING\"] = 3] = \"INSTALLING\";\n /**\n * The update has been installed.\n * The app needs to be restarted to use the new version.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"INSTALLED\"] = 4] = \"INSTALLED\";\n /**\n * The update failed to download or install.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"FAILED\"] = 5] = \"FAILED\";\n /**\n * The update was canceled by the user.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"CANCELED\"] = 6] = \"CANCELED\";\n /**\n * The update has been downloaded and is ready to install.\n * Call {@link UpdaterPlugin.completeFlexibleUpdate} to install.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"DOWNLOADED\"] = 11] = \"DOWNLOADED\";\n})(FlexibleUpdateInstallStatus || (FlexibleUpdateInstallStatus = {}));\n/**\n * Result codes for app update operations.\n *\n * @since 8.0.0\n */\nexport var AppUpdateResultCode;\n(function (AppUpdateResultCode) {\n /**\n * The update completed successfully.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"OK\"] = 0] = \"OK\";\n /**\n * The user canceled the update.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"CANCELED\"] = 1] = \"CANCELED\";\n /**\n * The update failed.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"FAILED\"] = 2] = \"FAILED\";\n /**\n * No update is available.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"NOT_AVAILABLE\"] = 3] = \"NOT_AVAILABLE\";\n /**\n * The requested update type is not allowed.\n * For example, trying to perform an immediate update when only flexible is allowed.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"NOT_ALLOWED\"] = 4] = \"NOT_ALLOWED\";\n /**\n * Required information is missing.\n * This can happen if {@link UpdaterPlugin.getAppUpdateInfo} wasn't called first.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"INFO_MISSING\"] = 5] = \"INFO_MISSING\";\n})(AppUpdateResultCode || (AppUpdateResultCode = {}));\n//# sourceMappingURL=definitions.js.map","import { exec, normalizeEmptyCordovaResult } from './exec';\nexport * from './definitions';\nexport const Updater = {\n notifyAppReady: () => exec('notifyAppReady'),\n setUpdateUrl: (options) => exec('setUpdateUrl', [options !== null && options !== void 0 ? options : {}]),\n setStatsUrl: (options) => exec('setStatsUrl', [options !== null && options !== void 0 ? options : {}]),\n setChannelUrl: (options) => exec('setChannelUrl', [options !== null && options !== void 0 ? options : {}]),\n download: (options) => exec('download', [options !== null && options !== void 0 ? options : {}]),\n next: (options) => exec('next', [options !== null && options !== void 0 ? options : {}]),\n set: (options) => exec('set', [options !== null && options !== void 0 ? options : {}]),\n startPreviewSession: (options) => exec('startPreviewSession', [options !== null && options !== void 0 ? options : {}]),\n listPreviews: () => exec('listPreviews'),\n setPreview: (options) => exec('setPreview', [options !== null && options !== void 0 ? options : {}]),\n resetPreview: () => exec('resetPreview'),\n deletePreview: (options) => exec('deletePreview', [options !== null && options !== void 0 ? options : {}]),\n checkPreviewUpdate: (options) => exec('checkPreviewUpdate', [options !== null && options !== void 0 ? options : {}]),\n updatePreview: (options) => exec('updatePreview', [options !== null && options !== void 0 ? options : {}]),\n delete: (options) => exec('delete', [options !== null && options !== void 0 ? options : {}]),\n setBundleError: (options) => exec('setBundleError', [options !== null && options !== void 0 ? options : {}]),\n list: () => exec('list'),\n reset: (options) => exec('reset', [options !== null && options !== void 0 ? options : {}]),\n current: () => exec('current'),\n reload: () => exec('reload'),\n setMultiDelay: (options) => exec('setMultiDelay', [options !== null && options !== void 0 ? options : {}]),\n cancelDelay: () => exec('cancelDelay'),\n triggerUpdateCheck: () => exec('triggerUpdateCheck'),\n getLatest: (options) => exec('getLatest', [options !== null && options !== void 0 ? options : {}]),\n getMissingBundleFiles: (options) => exec('getMissingBundleFiles', [options !== null && options !== void 0 ? options : {}]),\n getBundleDownloadSize: (options) => exec('getBundleDownloadSize', [options !== null && options !== void 0 ? options : {}]),\n setChannel: (options) => exec('setChannel', [options !== null && options !== void 0 ? options : {}]),\n unsetChannel: () => exec('unsetChannel'),\n getChannel: () => exec('getChannel'),\n listChannels: (options) => exec('listChannels', [options !== null && options !== void 0 ? options : {}]),\n setCustomId: (options) => exec('setCustomId', [options !== null && options !== void 0 ? options : {}]),\n getBuiltinVersion: () => exec('getBuiltinVersion'),\n getDeviceId: () => exec('getDeviceId'),\n getPluginVersion: () => exec('getPluginVersion'),\n isAutoUpdateEnabled: () => exec('isAutoUpdateEnabled'),\n isAutoUpdateAvailable: () => exec('isAutoUpdateAvailable'),\n getNextBundle: async () => normalizeEmptyCordovaResult(await exec('getNextBundle')),\n getFailedUpdate: async () => normalizeEmptyCordovaResult(await exec('getFailedUpdate')),\n setShakeMenu: (options) => exec('setShakeMenu', [options !== null && options !== void 0 ? options : {}]),\n isShakeMenuEnabled: () => exec('isShakeMenuEnabled'),\n setShakeChannelSelector: (options) => exec('setShakeChannelSelector', [options !== null && options !== void 0 ? options : {}]),\n isShakeChannelSelectorEnabled: () => exec('isShakeChannelSelectorEnabled'),\n getAppId: () => exec('getAppId'),\n setAppId: (options) => exec('setAppId', [options !== null && options !== void 0 ? options : {}]),\n getAppUpdateInfo: () => exec('getAppUpdateInfo'),\n openAppStore: () => exec('openAppStore'),\n performImmediateUpdate: () => exec('performImmediateUpdate'),\n startFlexibleUpdate: () => exec('startFlexibleUpdate'),\n completeFlexibleUpdate: () => exec('completeFlexibleUpdate'),\n reportWebViewError: (options) => exec('reportWebViewError', [options !== null && options !== void 0 ? options : {}]),\n addListener: (eventName, listener) => {\n const listenerId = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;\n void exec('addListener', [{ eventName, listenerId }]);\n const handler = (ev) => listener(ev.detail);\n document.addEventListener(`cordova-updater:${eventName}`, handler);\n return Promise.resolve({\n remove: async () => {\n document.removeEventListener(`cordova-updater:${eventName}`, handler);\n await exec('removeListener', [{ listenerId }]);\n },\n });\n },\n removeAllListeners: () => exec('removeAllListeners'),\n};\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { Updater } from './index';\nconst api = Object.assign({}, Updater);\ndocument.addEventListener('deviceready', () => {\n const win = window;\n win.cordova = win.cordova || {};\n win.cordova.plugins = win.cordova.plugins || {};\n win.cordova.plugins.Updater = api;\n});\nexport { api as Updater };\n//# sourceMappingURL=plugin.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG,SAAS;AACrC;AACO,SAAS,2BAA2B,CAAC,MAAM,EAAE;AACpD,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,EAAE,EAAE;AACzC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,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SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;AAC7D,QAAQ,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC;AACnD,QAAQ,QAAQ,CAAC,gBAAgB,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC;AAC1E,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC;AAC/B,YAAY,MAAM,EAAE,YAAY;AAChC,gBAAgB,QAAQ,CAAC,mBAAmB,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC;AACrF,gBAAgB,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;AAC9D,YAAY,CAAC;AACb,SAAS,CAAC;AACV,IAAI,CAAC;AACL,IAAI,kBAAkB,EAAE,MAAM,IAAI,CAAC,oBAAoB,CAAC;AACxD,CAAC;;AClED;AACA;AACA;AACA;AACA;AAEK,MAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO;AACrC,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,MAAM;AAC/C,IAAI,MAAM,GAAG,GAAG,MAAM;AACtB,IAAI,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,EAAE;AACnC,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE;AACnD,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG;AACrC,CAAC,CAAC;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,222 @@
1
+ var capgoCordovaUpdaterBootstrap = (function (exports) {
2
+ 'use strict';
3
+
4
+ /*
5
+ * This Source Code Form is subject to the terms of the Mozilla Public
6
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
7
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
+ */
9
+ const SERVICE_NAME = 'Updater';
10
+ /** Cordova resolves no-arg native success as `''` instead of `null`/`undefined`. */
11
+ function normalizeEmptyCordovaResult(result) {
12
+ if (result == null || result === '') {
13
+ return null;
14
+ }
15
+ if (typeof result === 'object' && !Array.isArray(result)) {
16
+ const record = result;
17
+ if (!('bundle' in record) && !('id' in record) && Object.keys(record).length === 0) {
18
+ return null;
19
+ }
20
+ }
21
+ return result;
22
+ }
23
+ function exec(action, args = []) {
24
+ return new Promise((resolve, reject) => {
25
+ cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, args);
26
+ });
27
+ }
28
+
29
+ /*
30
+ * This Source Code Form is subject to the terms of the Mozilla Public
31
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
32
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
33
+ */
34
+ /**
35
+ * Update availability status.
36
+ *
37
+ * @since 8.0.0
38
+ */
39
+ var AppUpdateAvailability;
40
+ (function (AppUpdateAvailability) {
41
+ /**
42
+ * Update availability is unknown.
43
+ * This typically means the check hasn't completed or failed.
44
+ */
45
+ AppUpdateAvailability[AppUpdateAvailability["UNKNOWN"] = 0] = "UNKNOWN";
46
+ /**
47
+ * No update is available.
48
+ * The installed version is the latest.
49
+ */
50
+ AppUpdateAvailability[AppUpdateAvailability["UPDATE_NOT_AVAILABLE"] = 1] = "UPDATE_NOT_AVAILABLE";
51
+ /**
52
+ * An update is available for download.
53
+ */
54
+ AppUpdateAvailability[AppUpdateAvailability["UPDATE_AVAILABLE"] = 2] = "UPDATE_AVAILABLE";
55
+ /**
56
+ * An update is currently being downloaded or installed.
57
+ */
58
+ AppUpdateAvailability[AppUpdateAvailability["UPDATE_IN_PROGRESS"] = 3] = "UPDATE_IN_PROGRESS";
59
+ })(AppUpdateAvailability || (AppUpdateAvailability = {}));
60
+ /**
61
+ * Installation status for flexible updates (Android only).
62
+ *
63
+ * @since 8.0.0
64
+ */
65
+ var FlexibleUpdateInstallStatus;
66
+ (function (FlexibleUpdateInstallStatus) {
67
+ /**
68
+ * Unknown install status.
69
+ */
70
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["UNKNOWN"] = 0] = "UNKNOWN";
71
+ /**
72
+ * Download is pending and will start soon.
73
+ */
74
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["PENDING"] = 1] = "PENDING";
75
+ /**
76
+ * Download is in progress.
77
+ * Check `bytesDownloaded` and `totalBytesToDownload` for progress.
78
+ */
79
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["DOWNLOADING"] = 2] = "DOWNLOADING";
80
+ /**
81
+ * The update is being installed.
82
+ */
83
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["INSTALLING"] = 3] = "INSTALLING";
84
+ /**
85
+ * The update has been installed.
86
+ * The app needs to be restarted to use the new version.
87
+ */
88
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["INSTALLED"] = 4] = "INSTALLED";
89
+ /**
90
+ * The update failed to download or install.
91
+ */
92
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["FAILED"] = 5] = "FAILED";
93
+ /**
94
+ * The update was canceled by the user.
95
+ */
96
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["CANCELED"] = 6] = "CANCELED";
97
+ /**
98
+ * The update has been downloaded and is ready to install.
99
+ * Call {@link UpdaterPlugin.completeFlexibleUpdate} to install.
100
+ */
101
+ FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["DOWNLOADED"] = 11] = "DOWNLOADED";
102
+ })(FlexibleUpdateInstallStatus || (FlexibleUpdateInstallStatus = {}));
103
+ /**
104
+ * Result codes for app update operations.
105
+ *
106
+ * @since 8.0.0
107
+ */
108
+ var AppUpdateResultCode;
109
+ (function (AppUpdateResultCode) {
110
+ /**
111
+ * The update completed successfully.
112
+ */
113
+ AppUpdateResultCode[AppUpdateResultCode["OK"] = 0] = "OK";
114
+ /**
115
+ * The user canceled the update.
116
+ */
117
+ AppUpdateResultCode[AppUpdateResultCode["CANCELED"] = 1] = "CANCELED";
118
+ /**
119
+ * The update failed.
120
+ */
121
+ AppUpdateResultCode[AppUpdateResultCode["FAILED"] = 2] = "FAILED";
122
+ /**
123
+ * No update is available.
124
+ */
125
+ AppUpdateResultCode[AppUpdateResultCode["NOT_AVAILABLE"] = 3] = "NOT_AVAILABLE";
126
+ /**
127
+ * The requested update type is not allowed.
128
+ * For example, trying to perform an immediate update when only flexible is allowed.
129
+ */
130
+ AppUpdateResultCode[AppUpdateResultCode["NOT_ALLOWED"] = 4] = "NOT_ALLOWED";
131
+ /**
132
+ * Required information is missing.
133
+ * This can happen if {@link UpdaterPlugin.getAppUpdateInfo} wasn't called first.
134
+ */
135
+ AppUpdateResultCode[AppUpdateResultCode["INFO_MISSING"] = 5] = "INFO_MISSING";
136
+ })(AppUpdateResultCode || (AppUpdateResultCode = {}));
137
+
138
+ const Updater = {
139
+ notifyAppReady: () => exec('notifyAppReady'),
140
+ setUpdateUrl: (options) => exec('setUpdateUrl', [options !== null && options !== void 0 ? options : {}]),
141
+ setStatsUrl: (options) => exec('setStatsUrl', [options !== null && options !== void 0 ? options : {}]),
142
+ setChannelUrl: (options) => exec('setChannelUrl', [options !== null && options !== void 0 ? options : {}]),
143
+ download: (options) => exec('download', [options !== null && options !== void 0 ? options : {}]),
144
+ next: (options) => exec('next', [options !== null && options !== void 0 ? options : {}]),
145
+ set: (options) => exec('set', [options !== null && options !== void 0 ? options : {}]),
146
+ startPreviewSession: (options) => exec('startPreviewSession', [options !== null && options !== void 0 ? options : {}]),
147
+ listPreviews: () => exec('listPreviews'),
148
+ setPreview: (options) => exec('setPreview', [options !== null && options !== void 0 ? options : {}]),
149
+ resetPreview: () => exec('resetPreview'),
150
+ deletePreview: (options) => exec('deletePreview', [options !== null && options !== void 0 ? options : {}]),
151
+ checkPreviewUpdate: (options) => exec('checkPreviewUpdate', [options !== null && options !== void 0 ? options : {}]),
152
+ updatePreview: (options) => exec('updatePreview', [options !== null && options !== void 0 ? options : {}]),
153
+ delete: (options) => exec('delete', [options !== null && options !== void 0 ? options : {}]),
154
+ setBundleError: (options) => exec('setBundleError', [options !== null && options !== void 0 ? options : {}]),
155
+ list: () => exec('list'),
156
+ reset: (options) => exec('reset', [options !== null && options !== void 0 ? options : {}]),
157
+ current: () => exec('current'),
158
+ reload: () => exec('reload'),
159
+ setMultiDelay: (options) => exec('setMultiDelay', [options !== null && options !== void 0 ? options : {}]),
160
+ cancelDelay: () => exec('cancelDelay'),
161
+ triggerUpdateCheck: () => exec('triggerUpdateCheck'),
162
+ getLatest: (options) => exec('getLatest', [options !== null && options !== void 0 ? options : {}]),
163
+ getMissingBundleFiles: (options) => exec('getMissingBundleFiles', [options !== null && options !== void 0 ? options : {}]),
164
+ getBundleDownloadSize: (options) => exec('getBundleDownloadSize', [options !== null && options !== void 0 ? options : {}]),
165
+ setChannel: (options) => exec('setChannel', [options !== null && options !== void 0 ? options : {}]),
166
+ unsetChannel: () => exec('unsetChannel'),
167
+ getChannel: () => exec('getChannel'),
168
+ listChannels: (options) => exec('listChannels', [options !== null && options !== void 0 ? options : {}]),
169
+ setCustomId: (options) => exec('setCustomId', [options !== null && options !== void 0 ? options : {}]),
170
+ getBuiltinVersion: () => exec('getBuiltinVersion'),
171
+ getDeviceId: () => exec('getDeviceId'),
172
+ getPluginVersion: () => exec('getPluginVersion'),
173
+ isAutoUpdateEnabled: () => exec('isAutoUpdateEnabled'),
174
+ isAutoUpdateAvailable: () => exec('isAutoUpdateAvailable'),
175
+ getNextBundle: async () => normalizeEmptyCordovaResult(await exec('getNextBundle')),
176
+ getFailedUpdate: async () => normalizeEmptyCordovaResult(await exec('getFailedUpdate')),
177
+ setShakeMenu: (options) => exec('setShakeMenu', [options !== null && options !== void 0 ? options : {}]),
178
+ isShakeMenuEnabled: () => exec('isShakeMenuEnabled'),
179
+ setShakeChannelSelector: (options) => exec('setShakeChannelSelector', [options !== null && options !== void 0 ? options : {}]),
180
+ isShakeChannelSelectorEnabled: () => exec('isShakeChannelSelectorEnabled'),
181
+ getAppId: () => exec('getAppId'),
182
+ setAppId: (options) => exec('setAppId', [options !== null && options !== void 0 ? options : {}]),
183
+ getAppUpdateInfo: () => exec('getAppUpdateInfo'),
184
+ openAppStore: () => exec('openAppStore'),
185
+ performImmediateUpdate: () => exec('performImmediateUpdate'),
186
+ startFlexibleUpdate: () => exec('startFlexibleUpdate'),
187
+ completeFlexibleUpdate: () => exec('completeFlexibleUpdate'),
188
+ reportWebViewError: (options) => exec('reportWebViewError', [options !== null && options !== void 0 ? options : {}]),
189
+ addListener: (eventName, listener) => {
190
+ const listenerId = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;
191
+ void exec('addListener', [{ eventName, listenerId }]);
192
+ const handler = (ev) => listener(ev.detail);
193
+ document.addEventListener(`cordova-updater:${eventName}`, handler);
194
+ return Promise.resolve({
195
+ remove: async () => {
196
+ document.removeEventListener(`cordova-updater:${eventName}`, handler);
197
+ await exec('removeListener', [{ listenerId }]);
198
+ },
199
+ });
200
+ },
201
+ removeAllListeners: () => exec('removeAllListeners'),
202
+ };
203
+
204
+ /*
205
+ * This Source Code Form is subject to the terms of the Mozilla Public
206
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
207
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
208
+ */
209
+ const api = Object.assign({}, Updater);
210
+ document.addEventListener('deviceready', () => {
211
+ const win = window;
212
+ win.cordova = win.cordova || {};
213
+ win.cordova.plugins = win.cordova.plugins || {};
214
+ win.cordova.plugins.Updater = api;
215
+ });
216
+
217
+ exports.Updater = api;
218
+
219
+ return exports;
220
+
221
+ })({});
222
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/exec.js","esm/definitions.js","esm/index.js","esm/plugin.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nexport const SERVICE_NAME = 'Updater';\n/** Cordova resolves no-arg native success as `''` instead of `null`/`undefined`. */\nexport function normalizeEmptyCordovaResult(result) {\n if (result == null || result === '') {\n return null;\n }\n if (typeof result === 'object' && !Array.isArray(result)) {\n const record = result;\n if (!('bundle' in record) && !('id' in record) && Object.keys(record).length === 0) {\n return null;\n }\n }\n return result;\n}\nexport function exec(action, args = []) {\n return new Promise((resolve, reject) => {\n cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, args);\n });\n}\n//# sourceMappingURL=exec.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n/**\n * Update availability status.\n *\n * @since 8.0.0\n */\nexport var AppUpdateAvailability;\n(function (AppUpdateAvailability) {\n /**\n * Update availability is unknown.\n * This typically means the check hasn't completed or failed.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * No update is available.\n * The installed version is the latest.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_NOT_AVAILABLE\"] = 1] = \"UPDATE_NOT_AVAILABLE\";\n /**\n * An update is available for download.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_AVAILABLE\"] = 2] = \"UPDATE_AVAILABLE\";\n /**\n * An update is currently being downloaded or installed.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_IN_PROGRESS\"] = 3] = \"UPDATE_IN_PROGRESS\";\n})(AppUpdateAvailability || (AppUpdateAvailability = {}));\n/**\n * Installation status for flexible updates (Android only).\n *\n * @since 8.0.0\n */\nexport var FlexibleUpdateInstallStatus;\n(function (FlexibleUpdateInstallStatus) {\n /**\n * Unknown install status.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * Download is pending and will start soon.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"PENDING\"] = 1] = \"PENDING\";\n /**\n * Download is in progress.\n * Check `bytesDownloaded` and `totalBytesToDownload` for progress.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"DOWNLOADING\"] = 2] = \"DOWNLOADING\";\n /**\n * The update is being installed.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"INSTALLING\"] = 3] = \"INSTALLING\";\n /**\n * The update has been installed.\n * The app needs to be restarted to use the new version.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"INSTALLED\"] = 4] = \"INSTALLED\";\n /**\n * The update failed to download or install.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"FAILED\"] = 5] = \"FAILED\";\n /**\n * The update was canceled by the user.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"CANCELED\"] = 6] = \"CANCELED\";\n /**\n * The update has been downloaded and is ready to install.\n * Call {@link UpdaterPlugin.completeFlexibleUpdate} to install.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"DOWNLOADED\"] = 11] = \"DOWNLOADED\";\n})(FlexibleUpdateInstallStatus || (FlexibleUpdateInstallStatus = {}));\n/**\n * Result codes for app update operations.\n *\n * @since 8.0.0\n */\nexport var AppUpdateResultCode;\n(function (AppUpdateResultCode) {\n /**\n * The update completed successfully.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"OK\"] = 0] = \"OK\";\n /**\n * The user canceled the update.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"CANCELED\"] = 1] = \"CANCELED\";\n /**\n * The update failed.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"FAILED\"] = 2] = \"FAILED\";\n /**\n * No update is available.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"NOT_AVAILABLE\"] = 3] = \"NOT_AVAILABLE\";\n /**\n * The requested update type is not allowed.\n * For example, trying to perform an immediate update when only flexible is allowed.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"NOT_ALLOWED\"] = 4] = \"NOT_ALLOWED\";\n /**\n * Required information is missing.\n * This can happen if {@link UpdaterPlugin.getAppUpdateInfo} wasn't called first.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"INFO_MISSING\"] = 5] = \"INFO_MISSING\";\n})(AppUpdateResultCode || (AppUpdateResultCode = {}));\n//# sourceMappingURL=definitions.js.map","import { exec, normalizeEmptyCordovaResult } from './exec';\nexport * from './definitions';\nexport const Updater = {\n notifyAppReady: () => exec('notifyAppReady'),\n setUpdateUrl: (options) => exec('setUpdateUrl', [options !== null && options !== void 0 ? options : {}]),\n setStatsUrl: (options) => exec('setStatsUrl', [options !== null && options !== void 0 ? options : {}]),\n setChannelUrl: (options) => exec('setChannelUrl', [options !== null && options !== void 0 ? options : {}]),\n download: (options) => exec('download', [options !== null && options !== void 0 ? options : {}]),\n next: (options) => exec('next', [options !== null && options !== void 0 ? options : {}]),\n set: (options) => exec('set', [options !== null && options !== void 0 ? options : {}]),\n startPreviewSession: (options) => exec('startPreviewSession', [options !== null && options !== void 0 ? options : {}]),\n listPreviews: () => exec('listPreviews'),\n setPreview: (options) => exec('setPreview', [options !== null && options !== void 0 ? options : {}]),\n resetPreview: () => exec('resetPreview'),\n deletePreview: (options) => exec('deletePreview', [options !== null && options !== void 0 ? options : {}]),\n checkPreviewUpdate: (options) => exec('checkPreviewUpdate', [options !== null && options !== void 0 ? options : {}]),\n updatePreview: (options) => exec('updatePreview', [options !== null && options !== void 0 ? options : {}]),\n delete: (options) => exec('delete', [options !== null && options !== void 0 ? options : {}]),\n setBundleError: (options) => exec('setBundleError', [options !== null && options !== void 0 ? options : {}]),\n list: () => exec('list'),\n reset: (options) => exec('reset', [options !== null && options !== void 0 ? options : {}]),\n current: () => exec('current'),\n reload: () => exec('reload'),\n setMultiDelay: (options) => exec('setMultiDelay', [options !== null && options !== void 0 ? options : {}]),\n cancelDelay: () => exec('cancelDelay'),\n triggerUpdateCheck: () => exec('triggerUpdateCheck'),\n getLatest: (options) => exec('getLatest', [options !== null && options !== void 0 ? options : {}]),\n getMissingBundleFiles: (options) => exec('getMissingBundleFiles', [options !== null && options !== void 0 ? options : {}]),\n getBundleDownloadSize: (options) => exec('getBundleDownloadSize', [options !== null && options !== void 0 ? options : {}]),\n setChannel: (options) => exec('setChannel', [options !== null && options !== void 0 ? options : {}]),\n unsetChannel: () => exec('unsetChannel'),\n getChannel: () => exec('getChannel'),\n listChannels: (options) => exec('listChannels', [options !== null && options !== void 0 ? options : {}]),\n setCustomId: (options) => exec('setCustomId', [options !== null && options !== void 0 ? options : {}]),\n getBuiltinVersion: () => exec('getBuiltinVersion'),\n getDeviceId: () => exec('getDeviceId'),\n getPluginVersion: () => exec('getPluginVersion'),\n isAutoUpdateEnabled: () => exec('isAutoUpdateEnabled'),\n isAutoUpdateAvailable: () => exec('isAutoUpdateAvailable'),\n getNextBundle: async () => normalizeEmptyCordovaResult(await exec('getNextBundle')),\n getFailedUpdate: async () => normalizeEmptyCordovaResult(await exec('getFailedUpdate')),\n setShakeMenu: (options) => exec('setShakeMenu', [options !== null && options !== void 0 ? options : {}]),\n isShakeMenuEnabled: () => exec('isShakeMenuEnabled'),\n setShakeChannelSelector: (options) => exec('setShakeChannelSelector', [options !== null && options !== void 0 ? options : {}]),\n isShakeChannelSelectorEnabled: () => exec('isShakeChannelSelectorEnabled'),\n getAppId: () => exec('getAppId'),\n setAppId: (options) => exec('setAppId', [options !== null && options !== void 0 ? options : {}]),\n getAppUpdateInfo: () => exec('getAppUpdateInfo'),\n openAppStore: () => exec('openAppStore'),\n performImmediateUpdate: () => exec('performImmediateUpdate'),\n startFlexibleUpdate: () => exec('startFlexibleUpdate'),\n completeFlexibleUpdate: () => exec('completeFlexibleUpdate'),\n reportWebViewError: (options) => exec('reportWebViewError', [options !== null && options !== void 0 ? options : {}]),\n addListener: (eventName, listener) => {\n const listenerId = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;\n void exec('addListener', [{ eventName, listenerId }]);\n const handler = (ev) => listener(ev.detail);\n document.addEventListener(`cordova-updater:${eventName}`, handler);\n return Promise.resolve({\n remove: async () => {\n document.removeEventListener(`cordova-updater:${eventName}`, handler);\n await exec('removeListener', [{ listenerId }]);\n },\n });\n },\n removeAllListeners: () => exec('removeAllListeners'),\n};\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { Updater } from './index';\nconst api = Object.assign({}, Updater);\ndocument.addEventListener('deviceready', () => {\n const win = window;\n win.cordova = win.cordova || {};\n win.cordova.plugins = win.cordova.plugins || {};\n win.cordova.plugins.Updater = api;\n});\nexport { api as Updater };\n//# sourceMappingURL=plugin.js.map"],"names":[],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACO,MAAM,YAAY,GAAG,SAAS;IACrC;IACO,SAAS,2BAA2B,CAAC,MAAM,EAAE;IACpD,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,EAAE,EAAE;IACzC,QAAQ,OAAO,IAAI;IACnB,IAAI;IACJ,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAC9D,QAAQ,MAAM,MAAM,GAAG,MAAM;IAC7B,QAAQ,IAAI,EAAE,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5F,YAAY,OAAO,IAAI;IACvB,QAAQ;IACR,IAAI;IACJ,IAAI,OAAO,MAAM;IACjB;IACO,SAAS,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE;IACxC,IAAI,O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,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9D,YAAY,CAAC;IACb,SAAS,CAAC;IACV,IAAI,CAAC;IACL,IAAI,kBAAkB,EAAE,MAAM,IAAI,CAAC,oBAAoB,CAAC;IACxD,CAAC;;IClED;IACA;IACA;IACA;IACA;AAEK,UAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO;IACrC,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,MAAM;IAC/C,IAAI,MAAM,GAAG,GAAG,MAAM;IACtB,IAAI,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,EAAE;IACnC,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE;IACnD,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG;IACrC,CAAC,CAAC;;;;;;;;;;"}
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@capgo/cordova-updater",
3
+ "version": "8.1.1",
4
+ "license": "MPL-2.0",
5
+ "description": "Live update Cordova plugin for Capgo",
6
+ "main": "dist/plugin.cjs.js",
7
+ "module": "dist/esm/index.js",
8
+ "types": "dist/esm/index.d.ts",
9
+ "unpkg": "dist/plugin.js",
10
+ "files": [
11
+ "dist/",
12
+ "src/android/",
13
+ "src/ios/",
14
+ "plugin.xml"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "author": "Martin Donadieu <martin@capgo.app>",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Cap-go/cordova-updater.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/Cap-go/cordova-updater/issues"
26
+ },
27
+ "homepage": "https://capgo.app/docs/plugins/updater/",
28
+ "keywords": [
29
+ "cordova",
30
+ "live updates",
31
+ "live update",
32
+ "updates",
33
+ "auto update",
34
+ "capgo",
35
+ "plugin",
36
+ "OTA",
37
+ "ionic",
38
+ "native"
39
+ ],
40
+ "scripts": {
41
+ "bootstrap": "./scripts/bootstrap.sh",
42
+ "verify": "bun run verify:android && bun run verify:ios && bun run verify:web",
43
+ "verify:web": "bun run build",
44
+ "verify:android": "cd android && ./gradlew clean test && cd ..",
45
+ "verify:ios": "SDK=$(xcrun --sdk iphonesimulator --show-sdk-path) && swift build --sdk \"$SDK\" --triple arm64-apple-ios16.0-simulator",
46
+ "native:contract": "bun run native:contract:android && bun run native:contract:ios",
47
+ "test:maestro": "./scripts/maestro/run-android-live-update.sh",
48
+ "test:maestro:android": "./scripts/test-maestro-android.sh",
49
+ "test:maestro:ios": "./scripts/maestro/run-ios-live-update.sh",
50
+ "test:maestro:ios:smoke": "./scripts/test-maestro-ios.sh",
51
+ "lint": "bun run eslint && bun run prettier -- --check",
52
+ "fmt": "bun run eslint -- --fix && bun run prettier -- --write",
53
+ "eslint": "eslint . --ext .ts",
54
+ "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
55
+ "build": "node ./node_modules/rimraf/dist/esm/bin.mjs ./dist && node ./node_modules/typescript/lib/tsc.js && node ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs",
56
+ "clean": "node ./node_modules/rimraf/dist/esm/bin.mjs ./dist",
57
+ "watch": "tsc --watch",
58
+ "prepublishOnly": "bun run build",
59
+ "example:install": "cd example-app && npm install",
60
+ "example:build": "bun run build && cd example-app && bun install && bun run build && bun ../scripts/maestro/sync-cordova-config.mjs && npx cordova prepare",
61
+ "native:contract:android": "cd android && ./gradlew testDebugUnitTest --tests app.capgo.cordova.updater.NativeContractTest && cd ..",
62
+ "test": "bun run test:android && bun run test:ios",
63
+ "test:android": "cd android && ./gradlew test && cd ..",
64
+ "check:wiring": "node scripts/check-cordova-plugin-wiring.mjs",
65
+ "native:contract:ios": "./scripts/test-ios.sh -only-testing:CordovaUpdaterPluginTests/NativeContractTests",
66
+ "native:test:ios": "./scripts/test-ios.sh",
67
+ "test:ios": "./scripts/test-ios.sh",
68
+ "changelog:ai": "node scripts/generate-ai-changelog.mjs"
69
+ },
70
+ "devDependencies": {
71
+ "@ionic/eslint-config": "^0.4.0",
72
+ "@ionic/prettier-config": "^4.0.0",
73
+ "@types/node": "^24.3.0",
74
+ "commit-and-tag-version": "^13.2.1",
75
+ "eslint": "^8.57.0",
76
+ "eslint-plugin-import": "^2.32.0",
77
+ "merge-deep": "^3.0.3",
78
+ "prettier": "^3.6.2",
79
+ "prettier-plugin-java": "^2.7.4",
80
+ "prettier-pretty-check": "^0.2.0",
81
+ "rimraf": "^6.0.1",
82
+ "rollup": "^4.50.0",
83
+ "typescript": "^5.9.2"
84
+ },
85
+ "prettier": "@ionic/prettier-config",
86
+ "eslintConfig": {
87
+ "extends": "@ionic/eslint-config/recommended"
88
+ },
89
+ "cordova": {
90
+ "id": "@capgo/cordova-updater",
91
+ "platforms": [
92
+ "android",
93
+ "ios"
94
+ ]
95
+ }
96
+ }