@capgo/cordova-updater 8.1.4 → 8.2.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.
- package/dist/esm/definitions.d.ts +116 -86
- package/dist/esm/definitions.js +2 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/exec.js +11 -1
- package/dist/esm/exec.js.map +1 -1
- package/dist/esm/history.js +7 -7
- package/dist/esm/history.js.map +1 -1
- package/dist/plugin.cjs.js +13 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +13 -3
- package/dist/plugin.js.map +1 -1
- package/package.json +5 -3
- package/plugin.xml +9 -9
- package/src/android/CordovaUpdaterPlugin.java +173 -5
- package/src/android/app/capgo/cordova/updater/CapgoUpdater.java +313 -55
- package/src/android/app/capgo/cordova/updater/CryptoCipher.java +51 -18
- package/src/android/app/capgo/cordova/updater/DelayUpdateUtils.java +0 -1
- package/src/android/app/capgo/cordova/updater/DownloadService.java +402 -89
- package/src/android/app/capgo/cordova/updater/Version.java +312 -0
- package/src/android/capgo-cordova-updater.gradle +3 -5
- package/src/android/test/app/capgo/cordova/updater/BackgroundDownloadSettlementTest.java +29 -0
- package/src/android/test/app/capgo/cordova/updater/CapacitorUpdaterUnitTest.java.skip +2 -12
- package/src/android/test/app/capgo/cordova/updater/DelayUpdateUtilsTest.java +0 -1
- package/src/android/test/app/capgo/cordova/updater/RsaContractTest.java +137 -0
- package/src/android/test/app/capgo/cordova/updater/SecurityHardeningTest.java +197 -0
- package/src/android/test/app/capgo/cordova/updater/SessionKeyRequiredTest.java +344 -0
- package/src/ios/CapgoSemanticVersion.swift +181 -0
- package/src/ios/CapgoUpdater.swift +427 -114
- package/src/ios/CordovaUpdaterPlugin.swift +171 -40
- package/src/ios/CryptoCipher.swift +41 -38
- package/src/ios/DelayUpdateUtils.swift +19 -45
- package/src/ios/Logger.swift +81 -5
- package/src/ios/RedirectPolicyDelegate.swift +53 -0
- package/src/ios/WebViewStatsReporter.swift +5 -0
- package/src/ios/ZipArchiveReader.swift +263 -0
- package/src/ios/ZipCentralDirectory.swift +283 -0
package/dist/esm/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAC3D,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AACtD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,CAAC;AAErH,IAAI,SAAS,EAAE,CAAC;IACd,MAAM,GAAG,GAAG,MAGX,CAAC;IAEF,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QAC/B,GAAG,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAEjC,MAAM,mBAAmB,GAAG,GAAY,EAAE;YACxC,IAAI,CAAC;gBACH,IAAI,GAAG,CAAC,6BAA6B,EAAE,CAAC;oBACtC,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,uBAAuB;YACzB,CAAC;YACD,IAAI,CAAC;gBACH,OAAO,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC;YAC5D,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC;QAIF,MAAM,UAAU,GAAG,GAAkB,EAAE;YACrC,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;gBAC/D,IAAI,CAAC,GAAG,EAAE,CAAC;oBACT,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAA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IAAI,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["/*\n * Maintains navigation history across Capgo-controlled reloads when keepUrlPathAfterReload is enabled.\n */\n\nconst KEEP_FLAG_KEY = '__capgo_keep_url_path_after_reload';\nconst HISTORY_STORAGE_KEY = '__capgo_history_stack__';\nconst MAX_STACK_ENTRIES = 100;\n\nconst isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof history !== 'undefined';\n\nif (isBrowser) {\n const win = window as typeof window & {\n __capgoHistoryPatched?: boolean;\n __capgoKeepUrlPathAfterReload?: boolean;\n };\n\n if (!win.__capgoHistoryPatched) {\n win.__capgoHistoryPatched = true;\n\n const isFeatureConfigured = (): boolean => {\n try {\n if (win.__capgoKeepUrlPathAfterReload) {\n return true;\n }\n } catch (err) {\n // ignore access issues\n }\n try {\n return window.localStorage.getItem(KEEP_FLAG_KEY) === '1';\n } catch (err) {\n return false;\n }\n };\n\n type StoredHistory = { stack: string[]; index: number };\n\n const readStored = (): StoredHistory => {\n try {\n const raw = window.sessionStorage.getItem(HISTORY_STORAGE_KEY);\n if (!raw) {\n return { stack: [], index: -1 };\n }\n const parsed = JSON.parse(raw) as StoredHistory;\n if (!parsed || !Array.isArray(parsed.stack) || typeof parsed.index !== 'number') {\n return { stack: [], index: -1 };\n }\n return parsed;\n } catch (err) {\n return { stack: [], index: -1 };\n }\n };\n\n const writeStored = (stack: string[], index: number): void => {\n try {\n window.sessionStorage.setItem(HISTORY_STORAGE_KEY, JSON.stringify({ stack, index }));\n } catch (err) {\n // Storage might be unavailable; fail silently.\n }\n };\n\n const clearStored = (): void => {\n try {\n window.sessionStorage.removeItem(HISTORY_STORAGE_KEY);\n } catch (err) {\n // ignore\n }\n };\n\n const normalize = (url?: string | URL | null): string | null => {\n try {\n const base = url ?? window.location.href;\n const parsed = new URL(base instanceof URL ? base.toString() : base, window.location.href);\n return `${parsed.pathname}${parsed.search}${parsed.hash}`;\n } catch (err) {\n return null;\n }\n };\n\n const trimStack = (stack: string[], index: number): StoredHistory => {\n if (stack.length <= MAX_STACK_ENTRIES) {\n return { stack, index };\n }\n const start = stack.length - MAX_STACK_ENTRIES;\n const trimmed = stack.slice(start);\n const adjustedIndex = Math.max(0, index - start);\n return { stack: trimmed, index: adjustedIndex };\n };\n\n const runWhenReady = (fn: () => void): void => {\n if (document.readyState === 'complete' || document.readyState === 'interactive') {\n fn();\n } else {\n window.addEventListener('DOMContentLoaded', fn, { once: true });\n }\n };\n\n let featureActive = false;\n let isRestoring = false;\n let restoreScheduled = false;\n\n const ensureCurrentTracked = () => {\n if (!featureActive) {\n return;\n }\n const stored = readStored();\n const current = normalize();\n if (!current) {\n return;\n }\n if (stored.stack.length === 0) {\n stored.stack.push(current);\n stored.index = 0;\n writeStored(stored.stack, stored.index);\n return;\n }\n if (stored.index < 0 || stored.index >= stored.stack.length) {\n stored.index = stored.stack.length - 1;\n }\n if (stored.stack[stored.index] !== current) {\n stored.stack[stored.index] = current;\n writeStored(stored.stack, stored.index);\n }\n };\n\n const record = (url: string | URL | null | undefined, replace: boolean) => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize(url);\n if (!normalized) {\n return;\n }\n let { stack, index } = readStored();\n if (stack.length === 0) {\n stack.push(normalized);\n index = stack.length - 1;\n } else if (replace) {\n if (index < 0 || index >= stack.length) {\n index = stack.length - 1;\n }\n stack[index] = normalized;\n } else {\n if (index >= stack.length - 1) {\n stack.push(normalized);\n index = stack.length - 1;\n } else {\n stack = stack.slice(0, index + 1);\n stack.push(normalized);\n index = stack.length - 1;\n }\n }\n ({ stack, index } = trimStack(stack, index));\n writeStored(stack, index);\n };\n\n const restoreHistory = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const stored = readStored();\n if (stored.stack.length === 0) {\n ensureCurrentTracked();\n return;\n }\n const targetIndex =\n stored.index >= 0 && stored.index < stored.stack.length ? stored.index : stored.stack.length - 1;\n const normalizedCurrent = normalize();\n if (stored.stack.length === 1 && normalizedCurrent === stored.stack[0]) {\n return;\n }\n const firstEntry = stored.stack[0];\n if (!firstEntry) {\n return;\n }\n isRestoring = true;\n try {\n history.replaceState(history.state, document.title, firstEntry);\n for (let i = 1; i < stored.stack.length; i += 1) {\n history.pushState(history.state, document.title, stored.stack[i]);\n }\n } catch (err) {\n isRestoring = false;\n return;\n }\n isRestoring = false;\n const currentIndex = stored.stack.length - 1;\n const offset = targetIndex - currentIndex;\n if (offset !== 0) {\n history.go(offset);\n } else {\n history.replaceState(history.state, document.title, stored.stack[targetIndex]);\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n };\n\n const scheduleRestore = () => {\n if (!featureActive || restoreScheduled) {\n return;\n }\n restoreScheduled = true;\n runWhenReady(() => {\n restoreScheduled = false;\n restoreHistory();\n });\n };\n\n let originalPushState: typeof history.pushState | null = null;\n let originalReplaceState: typeof history.replaceState | null = null;\n\n const popstateHandler = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize();\n if (!normalized) {\n return;\n }\n const stored = readStored();\n const idx = stored.stack.lastIndexOf(normalized);\n if (idx >= 0) {\n stored.index = idx;\n } else {\n stored.stack.push(normalized);\n stored.index = stored.stack.length - 1;\n }\n const trimmed = trimStack(stored.stack, stored.index);\n writeStored(trimmed.stack, trimmed.index);\n };\n\n const patchHistory = () => {\n if (originalPushState && originalReplaceState) {\n return;\n }\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n\n history.pushState = function pushStatePatched(state: any, title: string, url?: string | URL | null) {\n const result = originalPushState?.call(history, state, title, url as any);\n record(url, false);\n return result;\n };\n\n history.replaceState = function replaceStatePatched(state: any, title: string, url?: string | URL | null) {\n const result = originalReplaceState?.call(history, state, title, url as any);\n record(url, true);\n return result;\n };\n\n window.addEventListener('popstate', popstateHandler);\n };\n\n const unpatchHistory = () => {\n if (originalPushState) {\n history.pushState = originalPushState;\n originalPushState = null;\n }\n if (originalReplaceState) {\n history.replaceState = originalReplaceState;\n originalReplaceState = null;\n }\n window.removeEventListener('popstate', popstateHandler);\n };\n\n const setFeatureActive = (enabled: boolean) => {\n if (featureActive === enabled) {\n if (featureActive) {\n ensureCurrentTracked();\n scheduleRestore();\n }\n return;\n }\n featureActive = enabled;\n if (featureActive) {\n patchHistory();\n ensureCurrentTracked();\n scheduleRestore();\n } else {\n unpatchHistory();\n clearStored();\n }\n };\n\n window.addEventListener('CapacitorUpdaterKeepUrlPathAfterReload', (event) => {\n const evt = event as CustomEvent<{ enabled?: boolean }>;\n const enabled = evt?.detail?.enabled;\n if (typeof enabled === 'boolean') {\n win.__capgoKeepUrlPathAfterReload = enabled;\n setFeatureActive(enabled);\n } else {\n win.__capgoKeepUrlPathAfterReload = true;\n setFeatureActive(true);\n }\n });\n\n setFeatureActive(isFeatureConfigured());\n }\n}\n\nexport {};\n"]}
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAC3D,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AACtD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,CAAC;AAErH,IAAI,SAAS,EAAE,CAAC;IACd,MAAM,GAAG,GAAG,MAGX,CAAC;IAEF,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QAC/B,GAAG,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAEjC,MAAM,mBAAmB,GAAG,GAAY,EAAE;YACxC,IAAI,CAAC;gBACH,IAAI,GAAG,CAAC,6BAA6B,EAAE,CAAC;oBACtC,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAAC,WAAM,CAAC;gBACP,uB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E,EAAE;;YAC1E,MAAM,GAAG,GAAG,KAA2C,CAAC;YACxD,MAAM,OAAO,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,0CAAE,OAAO,CAAC;YACrC,IAAI,OAAO,OAAO,KAAK,SAAS,EAAE,CAAC;gBACjC,GAAG,CAAC,6BAA6B,GAAG,OAAO,CAAC;gBAC5C,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,6BAA6B,GAAG,IAAI,CAAC;gBACzC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["/*\n * Maintains navigation history across Capgo-controlled reloads when keepUrlPathAfterReload is enabled.\n */\n\nconst KEEP_FLAG_KEY = '__capgo_keep_url_path_after_reload';\nconst HISTORY_STORAGE_KEY = '__capgo_history_stack__';\nconst MAX_STACK_ENTRIES = 100;\n\nconst isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof history !== 'undefined';\n\nif (isBrowser) {\n const win = window as typeof window & {\n __capgoHistoryPatched?: boolean;\n __capgoKeepUrlPathAfterReload?: boolean;\n };\n\n if (!win.__capgoHistoryPatched) {\n win.__capgoHistoryPatched = true;\n\n const isFeatureConfigured = (): boolean => {\n try {\n if (win.__capgoKeepUrlPathAfterReload) {\n return true;\n }\n } catch {\n // ignore access issues\n }\n try {\n return window.localStorage.getItem(KEEP_FLAG_KEY) === '1';\n } catch {\n return false;\n }\n };\n\n type StoredHistory = { stack: string[]; index: number };\n\n const readStored = (): StoredHistory => {\n try {\n const raw = window.sessionStorage.getItem(HISTORY_STORAGE_KEY);\n if (!raw) {\n return { stack: [], index: -1 };\n }\n const parsed = JSON.parse(raw) as StoredHistory;\n if (!parsed || !Array.isArray(parsed.stack) || typeof parsed.index !== 'number') {\n return { stack: [], index: -1 };\n }\n return parsed;\n } catch {\n return { stack: [], index: -1 };\n }\n };\n\n const writeStored = (stack: string[], index: number): void => {\n try {\n window.sessionStorage.setItem(HISTORY_STORAGE_KEY, JSON.stringify({ stack, index }));\n } catch {\n // Storage might be unavailable; fail silently.\n }\n };\n\n const clearStored = (): void => {\n try {\n window.sessionStorage.removeItem(HISTORY_STORAGE_KEY);\n } catch {\n // ignore\n }\n };\n\n const normalize = (url?: string | URL | null): string | null => {\n try {\n const base = url ?? window.location.href;\n const parsed = new URL(base instanceof URL ? base.toString() : base, window.location.href);\n return `${parsed.pathname}${parsed.search}${parsed.hash}`;\n } catch {\n return null;\n }\n };\n\n const trimStack = (stack: string[], index: number): StoredHistory => {\n if (stack.length <= MAX_STACK_ENTRIES) {\n return { stack, index };\n }\n const start = stack.length - MAX_STACK_ENTRIES;\n const trimmed = stack.slice(start);\n const adjustedIndex = Math.max(0, index - start);\n return { stack: trimmed, index: adjustedIndex };\n };\n\n const runWhenReady = (fn: () => void): void => {\n if (document.readyState === 'complete' || document.readyState === 'interactive') {\n fn();\n } else {\n window.addEventListener('DOMContentLoaded', fn, { once: true });\n }\n };\n\n let featureActive = false;\n let isRestoring = false;\n let restoreScheduled = false;\n\n const ensureCurrentTracked = () => {\n if (!featureActive) {\n return;\n }\n const stored = readStored();\n const current = normalize();\n if (!current) {\n return;\n }\n if (stored.stack.length === 0) {\n stored.stack.push(current);\n stored.index = 0;\n writeStored(stored.stack, stored.index);\n return;\n }\n if (stored.index < 0 || stored.index >= stored.stack.length) {\n stored.index = stored.stack.length - 1;\n }\n if (stored.stack[stored.index] !== current) {\n stored.stack[stored.index] = current;\n writeStored(stored.stack, stored.index);\n }\n };\n\n const record = (url: string | URL | null | undefined, replace: boolean) => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize(url);\n if (!normalized) {\n return;\n }\n let { stack, index } = readStored();\n if (stack.length === 0) {\n stack.push(normalized);\n index = stack.length - 1;\n } else if (replace) {\n if (index < 0 || index >= stack.length) {\n index = stack.length - 1;\n }\n stack[index] = normalized;\n } else {\n if (index >= stack.length - 1) {\n stack.push(normalized);\n index = stack.length - 1;\n } else {\n stack = stack.slice(0, index + 1);\n stack.push(normalized);\n index = stack.length - 1;\n }\n }\n ({ stack, index } = trimStack(stack, index));\n writeStored(stack, index);\n };\n\n const restoreHistory = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const stored = readStored();\n if (stored.stack.length === 0) {\n ensureCurrentTracked();\n return;\n }\n const targetIndex =\n stored.index >= 0 && stored.index < stored.stack.length ? stored.index : stored.stack.length - 1;\n const normalizedCurrent = normalize();\n if (stored.stack.length === 1 && normalizedCurrent === stored.stack[0]) {\n return;\n }\n const firstEntry = stored.stack[0];\n if (!firstEntry) {\n return;\n }\n isRestoring = true;\n try {\n history.replaceState(history.state, document.title, firstEntry);\n for (let i = 1; i < stored.stack.length; i += 1) {\n history.pushState(history.state, document.title, stored.stack[i]);\n }\n } catch {\n isRestoring = false;\n return;\n }\n isRestoring = false;\n const currentIndex = stored.stack.length - 1;\n const offset = targetIndex - currentIndex;\n if (offset !== 0) {\n history.go(offset);\n } else {\n history.replaceState(history.state, document.title, stored.stack[targetIndex]);\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n };\n\n const scheduleRestore = () => {\n if (!featureActive || restoreScheduled) {\n return;\n }\n restoreScheduled = true;\n runWhenReady(() => {\n restoreScheduled = false;\n restoreHistory();\n });\n };\n\n let originalPushState: typeof history.pushState | null = null;\n let originalReplaceState: typeof history.replaceState | null = null;\n\n const popstateHandler = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize();\n if (!normalized) {\n return;\n }\n const stored = readStored();\n const idx = stored.stack.lastIndexOf(normalized);\n if (idx >= 0) {\n stored.index = idx;\n } else {\n stored.stack.push(normalized);\n stored.index = stored.stack.length - 1;\n }\n const trimmed = trimStack(stored.stack, stored.index);\n writeStored(trimmed.stack, trimmed.index);\n };\n\n const patchHistory = () => {\n if (originalPushState && originalReplaceState) {\n return;\n }\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n\n history.pushState = function pushStatePatched(state: any, title: string, url?: string | URL | null) {\n const result = originalPushState?.call(history, state, title, url as any);\n record(url, false);\n return result;\n };\n\n history.replaceState = function replaceStatePatched(state: any, title: string, url?: string | URL | null) {\n const result = originalReplaceState?.call(history, state, title, url as any);\n record(url, true);\n return result;\n };\n\n window.addEventListener('popstate', popstateHandler);\n };\n\n const unpatchHistory = () => {\n if (originalPushState) {\n history.pushState = originalPushState;\n originalPushState = null;\n }\n if (originalReplaceState) {\n history.replaceState = originalReplaceState;\n originalReplaceState = null;\n }\n window.removeEventListener('popstate', popstateHandler);\n };\n\n const setFeatureActive = (enabled: boolean) => {\n if (featureActive === enabled) {\n if (featureActive) {\n ensureCurrentTracked();\n scheduleRestore();\n }\n return;\n }\n featureActive = enabled;\n if (featureActive) {\n patchHistory();\n ensureCurrentTracked();\n scheduleRestore();\n } else {\n unpatchHistory();\n clearStored();\n }\n };\n\n window.addEventListener('CapacitorUpdaterKeepUrlPathAfterReload', (event) => {\n const evt = event as CustomEvent<{ enabled?: boolean }>;\n const enabled = evt?.detail?.enabled;\n if (typeof enabled === 'boolean') {\n win.__capgoKeepUrlPathAfterReload = enabled;\n setFeatureActive(enabled);\n } else {\n win.__capgoKeepUrlPathAfterReload = true;\n setFeatureActive(true);\n }\n });\n\n setFeatureActive(isFeatureConfigured());\n }\n}\n\nexport {};\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -20,8 +20,18 @@ function normalizeEmptyCordovaResult(result) {
|
|
|
20
20
|
return result;
|
|
21
21
|
}
|
|
22
22
|
function exec(action, args = []) {
|
|
23
|
+
const payloadArgs = [...args];
|
|
24
|
+
if (action === 'notifyAppReady') {
|
|
25
|
+
const win = window;
|
|
26
|
+
if (typeof win.__CAPGO_READY_GEN === 'number') {
|
|
27
|
+
const payload = payloadArgs[0] != null && typeof payloadArgs[0] === 'object' && !Array.isArray(payloadArgs[0])
|
|
28
|
+
? Object.assign({}, payloadArgs[0]) : {};
|
|
29
|
+
payload.loadGeneration = win.__CAPGO_READY_GEN;
|
|
30
|
+
payloadArgs[0] = payload;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
23
33
|
return new Promise((resolve, reject) => {
|
|
24
|
-
cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action,
|
|
34
|
+
cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, payloadArgs);
|
|
25
35
|
});
|
|
26
36
|
}
|
|
27
37
|
|
|
@@ -95,7 +105,7 @@ var FlexibleUpdateInstallStatus;
|
|
|
95
105
|
FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["CANCELED"] = 6] = "CANCELED";
|
|
96
106
|
/**
|
|
97
107
|
* The update has been downloaded and is ready to install.
|
|
98
|
-
* Call {@link
|
|
108
|
+
* Call {@link CordovaUpdaterPlugin.completeFlexibleUpdate} to install.
|
|
99
109
|
*/
|
|
100
110
|
FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["DOWNLOADED"] = 11] = "DOWNLOADED";
|
|
101
111
|
})(FlexibleUpdateInstallStatus || (FlexibleUpdateInstallStatus = {}));
|
|
@@ -129,7 +139,7 @@ var AppUpdateResultCode;
|
|
|
129
139
|
AppUpdateResultCode[AppUpdateResultCode["NOT_ALLOWED"] = 4] = "NOT_ALLOWED";
|
|
130
140
|
/**
|
|
131
141
|
* Required information is missing.
|
|
132
|
-
* This can happen if {@link
|
|
142
|
+
* This can happen if {@link CordovaUpdaterPlugin.getAppUpdateInfo} wasn't called first.
|
|
133
143
|
*/
|
|
134
144
|
AppUpdateResultCode[AppUpdateResultCode["INFO_MISSING"] = 5] = "INFO_MISSING";
|
|
135
145
|
})(AppUpdateResultCode || (AppUpdateResultCode = {}));
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +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: (options) => exec('unsetChannel', [options !== null && options !== void 0 ? options : {}]),\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,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC9D,QAAQ,MAAM,MAAM,GAAG,MAAM;AAC7B,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;AAC5F,YAAY,OAAO,IAAI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AC;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;;;;"}
|
|
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 const payloadArgs = [...args];\n if (action === 'notifyAppReady') {\n const win = window;\n if (typeof win.__CAPGO_READY_GEN === 'number') {\n const payload = payloadArgs[0] != null && typeof payloadArgs[0] === 'object' && !Array.isArray(payloadArgs[0])\n ? Object.assign({}, payloadArgs[0]) : {};\n payload.loadGeneration = win.__CAPGO_READY_GEN;\n payloadArgs[0] = payload;\n }\n }\n return new Promise((resolve, reject) => {\n cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, payloadArgs);\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 CordovaUpdaterPlugin.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 CordovaUpdaterPlugin.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: (options) => exec('unsetChannel', [options !== null && options !== void 0 ? options : {}]),\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,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC9D,QAAQ,MAAM,MAAM,GAAG,MAAM;AAC7B,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;AAC5F,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACO,SAAS,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE;AACxC,I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AAC,OAAO,CAAC,OAAO,GAAG,GAAG;AACrC,CAAC,CAAC;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -21,8 +21,18 @@ var capgoCordovaUpdaterBootstrap = (function (exports) {
|
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
23
23
|
function exec(action, args = []) {
|
|
24
|
+
const payloadArgs = [...args];
|
|
25
|
+
if (action === 'notifyAppReady') {
|
|
26
|
+
const win = window;
|
|
27
|
+
if (typeof win.__CAPGO_READY_GEN === 'number') {
|
|
28
|
+
const payload = payloadArgs[0] != null && typeof payloadArgs[0] === 'object' && !Array.isArray(payloadArgs[0])
|
|
29
|
+
? Object.assign({}, payloadArgs[0]) : {};
|
|
30
|
+
payload.loadGeneration = win.__CAPGO_READY_GEN;
|
|
31
|
+
payloadArgs[0] = payload;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
24
34
|
return new Promise((resolve, reject) => {
|
|
25
|
-
cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action,
|
|
35
|
+
cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, payloadArgs);
|
|
26
36
|
});
|
|
27
37
|
}
|
|
28
38
|
|
|
@@ -96,7 +106,7 @@ var capgoCordovaUpdaterBootstrap = (function (exports) {
|
|
|
96
106
|
FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["CANCELED"] = 6] = "CANCELED";
|
|
97
107
|
/**
|
|
98
108
|
* The update has been downloaded and is ready to install.
|
|
99
|
-
* Call {@link
|
|
109
|
+
* Call {@link CordovaUpdaterPlugin.completeFlexibleUpdate} to install.
|
|
100
110
|
*/
|
|
101
111
|
FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus["DOWNLOADED"] = 11] = "DOWNLOADED";
|
|
102
112
|
})(FlexibleUpdateInstallStatus || (FlexibleUpdateInstallStatus = {}));
|
|
@@ -130,7 +140,7 @@ var capgoCordovaUpdaterBootstrap = (function (exports) {
|
|
|
130
140
|
AppUpdateResultCode[AppUpdateResultCode["NOT_ALLOWED"] = 4] = "NOT_ALLOWED";
|
|
131
141
|
/**
|
|
132
142
|
* Required information is missing.
|
|
133
|
-
* This can happen if {@link
|
|
143
|
+
* This can happen if {@link CordovaUpdaterPlugin.getAppUpdateInfo} wasn't called first.
|
|
134
144
|
*/
|
|
135
145
|
AppUpdateResultCode[AppUpdateResultCode["INFO_MISSING"] = 5] = "INFO_MISSING";
|
|
136
146
|
})(AppUpdateResultCode || (AppUpdateResultCode = {}));
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +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: (options) => exec('unsetChannel', [options !== null && options !== void 0 ? options : {}]),\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,IA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":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 const payloadArgs = [...args];\n if (action === 'notifyAppReady') {\n const win = window;\n if (typeof win.__CAPGO_READY_GEN === 'number') {\n const payload = payloadArgs[0] != null && typeof payloadArgs[0] === 'object' && !Array.isArray(payloadArgs[0])\n ? Object.assign({}, payloadArgs[0]) : {};\n payload.loadGeneration = win.__CAPGO_READY_GEN;\n payloadArgs[0] = payload;\n }\n }\n return new Promise((resolve, reject) => {\n cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, payloadArgs);\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 CordovaUpdaterPlugin.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 CordovaUpdaterPlugin.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: (options) => exec('unsetChannel', [options !== null && options !== void 0 ? options : {}]),\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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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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cordova-updater",
|
|
3
|
-
"version": "8.1
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Live update Cordova plugin for Capgo",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"verify:web": "bun run build",
|
|
44
44
|
"verify:android": "cd android && ./gradlew clean test && cd ..",
|
|
45
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",
|
|
46
|
+
"native:contract": "bun run native:contract:android && bun run native:contract:crypto:android && bun run native:contract:ios && bun run native:contract:crypto:ios",
|
|
47
47
|
"test:maestro": "./scripts/maestro/run-android-live-update.sh",
|
|
48
48
|
"test:maestro:android": "./scripts/test-maestro-android.sh",
|
|
49
49
|
"test:maestro:ios": "./scripts/maestro/run-ios-live-update.sh",
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
"example:install": "cd example-app && npm install",
|
|
60
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
61
|
"native:contract:android": "cd android && ./gradlew testDebugUnitTest --tests app.capgo.cordova.updater.NativeContractTest && cd ..",
|
|
62
|
+
"native:contract:crypto:android": "cd android && ./gradlew testDebugUnitTest --tests app.capgo.cordova.updater.RsaContractTest && cd ..",
|
|
63
|
+
"native:contract:crypto:ios": "./scripts/test-ios.sh -only-testing:CordovaUpdaterPluginTests/RsaContractTests",
|
|
62
64
|
"test": "bun run test:android && bun run test:ios",
|
|
63
65
|
"test:android": "cd android && ./gradlew test && cd ..",
|
|
64
66
|
"check:wiring": "node scripts/check-cordova-plugin-wiring.mjs",
|
|
@@ -80,7 +82,7 @@
|
|
|
80
82
|
"prettier-pretty-check": "^0.2.0",
|
|
81
83
|
"rimraf": "^6.0.1",
|
|
82
84
|
"rollup": "^4.50.0",
|
|
83
|
-
"typescript": "^
|
|
85
|
+
"typescript": "^6.0.3"
|
|
84
86
|
},
|
|
85
87
|
"prettier": "@ionic/prettier-config",
|
|
86
88
|
"eslintConfig": {
|
package/plugin.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
3
|
id="@capgo/cordova-updater"
|
|
4
|
-
version="8.1
|
|
4
|
+
version="8.2.1">
|
|
5
5
|
|
|
6
6
|
<name>Updater</name>
|
|
7
7
|
<description>Cordova plugin for Capgo live updates (OTA).</description>
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
<preference name="PERSIST_CUSTOM_ID" default="false"/>
|
|
53
53
|
<preference name="PERSIST_MODIFY_URL" default="false"/>
|
|
54
54
|
<preference name="PERSIST_DEFAULT_CHANNEL_ON_REINSTALL" default="true"/>
|
|
55
|
+
<preference name="ALLOW_HTTPS_TO_HTTP_REDIRECT" default="false"/>
|
|
55
56
|
|
|
56
57
|
<platform name="android">
|
|
57
58
|
<config-file target="res/xml/config.xml" parent="/*">
|
|
@@ -100,6 +101,7 @@
|
|
|
100
101
|
<string name="capgo_updater_persist_custom_id">$PERSIST_CUSTOM_ID</string>
|
|
101
102
|
<string name="capgo_updater_persist_modify_url">$PERSIST_MODIFY_URL</string>
|
|
102
103
|
<string name="capgo_updater_persist_default_channel_on_reinstall">$PERSIST_DEFAULT_CHANNEL_ON_REINSTALL</string>
|
|
104
|
+
<string name="capgo_updater_allow_https_to_http_redirect">$ALLOW_HTTPS_TO_HTTP_REDIRECT</string>
|
|
103
105
|
</config-file>
|
|
104
106
|
|
|
105
107
|
<framework src="src/android/capgo-cordova-updater.gradle" custom="true" type="gradleReference"/>
|
|
@@ -126,6 +128,7 @@
|
|
|
126
128
|
<source-file src="src/android/app/capgo/cordova/updater/ShakeDetector.java" target-dir="src/app/capgo/cordova/updater"/>
|
|
127
129
|
<source-file src="src/android/app/capgo/cordova/updater/ShakeMenu.java" target-dir="src/app/capgo/cordova/updater"/>
|
|
128
130
|
<source-file src="src/android/app/capgo/cordova/updater/ThreeFingerPinchDetector.java" target-dir="src/app/capgo/cordova/updater"/>
|
|
131
|
+
<source-file src="src/android/app/capgo/cordova/updater/Version.java" target-dir="src/app/capgo/cordova/updater"/>
|
|
129
132
|
<source-file src="src/android/app/capgo/cordova/updater/compat/JSArray.java" target-dir="src/app/capgo/cordova/updater/compat"/>
|
|
130
133
|
<source-file src="src/android/app/capgo/cordova/updater/compat/JSObject.java" target-dir="src/app/capgo/cordova/updater/compat"/>
|
|
131
134
|
<source-file src="src/android/app/capgo/cordova/updater/compat/PluginCall.java" target-dir="src/app/capgo/cordova/updater/compat"/>
|
|
@@ -171,6 +174,7 @@
|
|
|
171
174
|
<config-file target="*-Info.plist" parent="CapgoUpdaterPersistCustomId"><string>$PERSIST_CUSTOM_ID</string></config-file>
|
|
172
175
|
<config-file target="*-Info.plist" parent="CapgoUpdaterPersistModifyUrl"><string>$PERSIST_MODIFY_URL</string></config-file>
|
|
173
176
|
<config-file target="*-Info.plist" parent="CapgoUpdaterPersistDefaultChannelOnReinstall"><string>$PERSIST_DEFAULT_CHANNEL_ON_REINSTALL</string></config-file>
|
|
177
|
+
<config-file target="*-Info.plist" parent="CapgoUpdaterAllowHttpsToHttpRedirect"><string>$ALLOW_HTTPS_TO_HTTP_REDIRECT</string></config-file>
|
|
174
178
|
|
|
175
179
|
|
|
176
180
|
<source-file src="src/ios/AES.swift"/>
|
|
@@ -195,13 +199,9 @@
|
|
|
195
199
|
<source-file src="src/ios/UpdaterSchemeHandler.swift"/>
|
|
196
200
|
<source-file src="src/ios/UserDefaultsExtension.swift"/>
|
|
197
201
|
<source-file src="src/ios/WebViewStatsReporter.swift"/>
|
|
198
|
-
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<pod name="ZIPFoundation" spec="~> 0.9.20" />
|
|
203
|
-
<pod name="Version" spec="0.8.0" />
|
|
204
|
-
</pods>
|
|
205
|
-
</podspec>
|
|
202
|
+
<source-file src="src/ios/CapgoSemanticVersion.swift"/>
|
|
203
|
+
<source-file src="src/ios/RedirectPolicyDelegate.swift"/>
|
|
204
|
+
<source-file src="src/ios/ZipArchiveReader.swift"/>
|
|
205
|
+
<source-file src="src/ios/ZipCentralDirectory.swift"/>
|
|
206
206
|
</platform>
|
|
207
207
|
</plugin>
|