@capawesome/cordova-live-update 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1113 -0
  3. package/dist/docs.json +1654 -0
  4. package/dist/esm/definitions.d.ts +788 -0
  5. package/dist/esm/definitions.js +7 -0
  6. package/dist/esm/definitions.js.map +1 -0
  7. package/dist/esm/exec.d.ts +1 -0
  8. package/dist/esm/exec.js +8 -0
  9. package/dist/esm/exec.js.map +1 -0
  10. package/dist/esm/index.d.ts +4 -0
  11. package/dist/esm/index.js +46 -0
  12. package/dist/esm/index.js.map +1 -0
  13. package/dist/plugin.js +56 -0
  14. package/dist/plugin.js.map +1 -0
  15. package/package.json +93 -0
  16. package/plugin.xml +268 -0
  17. package/src/android/capawesome-cordova-live-update.gradle +12 -0
  18. package/src/android/capawesome-live-update.xml +5 -0
  19. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdate.java +1480 -0
  20. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdateConfig.java +105 -0
  21. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdateHttpClient.java +114 -0
  22. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePathHandler.java +96 -0
  23. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePlugin.java +550 -0
  24. package/src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePreferences.java +151 -0
  25. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/Manifest.java +58 -0
  26. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/ManifestItem.java +37 -0
  27. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/api/GetChannelsResponseItem.java +28 -0
  28. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +74 -0
  29. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java +33 -0
  30. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/events/NextBundleSetEvent.java +26 -0
  31. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/DeleteBundleOptions.java +18 -0
  32. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/DownloadBundleOptions.java +66 -0
  33. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/FetchChannelsOptions.java +39 -0
  34. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/FetchLatestBundleOptions.java +25 -0
  35. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetChannelOptions.java +18 -0
  36. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetConfigOptions.java +20 -0
  37. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetCustomIdOptions.java +18 -0
  38. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetNextBundleOptions.java +21 -0
  39. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SyncOptions.java +25 -0
  40. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/ChannelResult.java +29 -0
  41. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/FetchChannelsResult.java +29 -0
  42. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/FetchLatestBundleResult.java +69 -0
  43. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java +28 -0
  44. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetBundlesResult.java +28 -0
  45. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetChannelResult.java +22 -0
  46. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetConfigResult.java +40 -0
  47. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetCurrentBundleResult.java +22 -0
  48. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetCustomIdResult.java +22 -0
  49. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetDeviceIdResult.java +22 -0
  50. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java +28 -0
  51. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetNextBundleResult.java +22 -0
  52. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetVersionCodeResult.java +21 -0
  53. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetVersionNameResult.java +22 -0
  54. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/IsSyncingResult.java +27 -0
  55. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/ReadyResult.java +32 -0
  56. package/src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/SyncResult.java +22 -0
  57. package/src/android/io/capawesome/cordova/plugins/liveupdate/enums/ArtifactType.java +6 -0
  58. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/Callback.java +5 -0
  59. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/DownloadProgressCallback.java +5 -0
  60. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/EmptyCallback.java +5 -0
  61. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/NonEmptyCallback.java +7 -0
  62. package/src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/Result.java +8 -0
  63. package/src/ios/LiveUpdate.swift +895 -0
  64. package/src/ios/LiveUpdateArtifactType.swift +4 -0
  65. package/src/ios/LiveUpdateChannelResult.swift +18 -0
  66. package/src/ios/LiveUpdateConfig.swift +11 -0
  67. package/src/ios/LiveUpdateDeleteBundleOptions.swift +13 -0
  68. package/src/ios/LiveUpdateDownloadBundleOptions.swift +41 -0
  69. package/src/ios/LiveUpdateDownloadBundleProgressEvent.swift +24 -0
  70. package/src/ios/LiveUpdateError.swift +62 -0
  71. package/src/ios/LiveUpdateFetchChannelsOptions.swift +25 -0
  72. package/src/ios/LiveUpdateFetchChannelsResult.swift +15 -0
  73. package/src/ios/LiveUpdateFetchLatestBundleOptions.swift +17 -0
  74. package/src/ios/LiveUpdateFetchLatestBundleResult.swift +42 -0
  75. package/src/ios/LiveUpdateGetBlockedBundlesResult.swift +15 -0
  76. package/src/ios/LiveUpdateGetBundlesResult.swift +15 -0
  77. package/src/ios/LiveUpdateGetChannelResult.swift +15 -0
  78. package/src/ios/LiveUpdateGetChannelsResponseItem.swift +4 -0
  79. package/src/ios/LiveUpdateGetConfigResult.swift +18 -0
  80. package/src/ios/LiveUpdateGetCurrentBundleResult.swift +15 -0
  81. package/src/ios/LiveUpdateGetCustomIdResult.swift +15 -0
  82. package/src/ios/LiveUpdateGetDeviceIdResult.swift +15 -0
  83. package/src/ios/LiveUpdateGetDownloadedBundlesResult.swift +15 -0
  84. package/src/ios/LiveUpdateGetLatestBundleResponse.swift +8 -0
  85. package/src/ios/LiveUpdateGetNextBundleResult.swift +15 -0
  86. package/src/ios/LiveUpdateGetVersionCodeResult.swift +15 -0
  87. package/src/ios/LiveUpdateGetVersionNameResult.swift +15 -0
  88. package/src/ios/LiveUpdateHttpClient.swift +58 -0
  89. package/src/ios/LiveUpdateIsSyncingResult.swift +15 -0
  90. package/src/ios/LiveUpdateManifest.swift +19 -0
  91. package/src/ios/LiveUpdateManifestItem.swift +5 -0
  92. package/src/ios/LiveUpdateNextBundleSetEvent.swift +15 -0
  93. package/src/ios/LiveUpdatePlugin.swift +521 -0
  94. package/src/ios/LiveUpdatePreferences.swift +116 -0
  95. package/src/ios/LiveUpdateReadyResult.swift +21 -0
  96. package/src/ios/LiveUpdateResult.swift +5 -0
  97. package/src/ios/LiveUpdateSchemeHandler.swift +286 -0
  98. package/src/ios/LiveUpdateSetChannelOptions.swift +13 -0
  99. package/src/ios/LiveUpdateSetConfigOptions.swift +13 -0
  100. package/src/ios/LiveUpdateSetCustomIdOptions.swift +13 -0
  101. package/src/ios/LiveUpdateSetNextBundleOptions.swift +13 -0
  102. package/src/ios/LiveUpdateSyncOptions.swift +17 -0
  103. package/src/ios/LiveUpdateSyncResult.swift +15 -0
@@ -0,0 +1,7 @@
1
+ // Plugin configuration is set via `<preference>` entries in `config.xml`,
2
+ // not via this TypeScript module. The following preferences are supported:
3
+ // `APP_ID`, `AUTO_BLOCK_ROLLED_BACK_BUNDLES`, `AUTO_DELETE_BUNDLES`,
4
+ // `AUTO_UPDATE_STRATEGY`, `DEFAULT_CHANNEL`, `HTTP_TIMEOUT`, `PUBLIC_KEY`,
5
+ // `READY_TIMEOUT`, `SERVER_DOMAIN`. See README for details.
6
+ export {};
7
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2EAA2E;AAC3E,qEAAqE;AACrE,2EAA2E;AAC3E,4DAA4D","sourcesContent":["// Plugin configuration is set via `<preference>` entries in `config.xml`,\n// not via this TypeScript module. The following preferences are supported:\n// `APP_ID`, `AUTO_BLOCK_ROLLED_BACK_BUNDLES`, `AUTO_DELETE_BUNDLES`,\n// `AUTO_UPDATE_STRATEGY`, `DEFAULT_CHANNEL`, `HTTP_TIMEOUT`, `PUBLIC_KEY`,\n// `READY_TIMEOUT`, `SERVER_DOMAIN`. See README for details.\n\n/**\n * Handle returned from `addListener(...)`. Call `remove()` to detach the\n * listener.\n *\n * @since 0.1.0\n */\nexport interface PluginListenerHandle {\n remove: () => Promise<void>;\n}\n\nexport interface LiveUpdatePlugin {\n /**\n * Clear all blocked bundles from the blocked list.\n *\n * This removes all bundle identifiers that were automatically blocked\n * due to rollbacks when `autoBlockRolledBackBundles` is enabled.\n *\n * @since 0.1.0\n */\n clearBlockedBundles(): Promise<void>;\n /**\n * Delete a bundle from the app.\n *\n * @since 0.1.0\n */\n deleteBundle(options: DeleteBundleOptions): Promise<void>;\n /**\n * Download a bundle.\n *\n * @since 0.1.0\n */\n downloadBundle(options: DownloadBundleOptions): Promise<void>;\n /**\n * Fetch channels from [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * This is primarily intended for development and QA purposes.\n * It allows you to retrieve a list of available channels so you can\n * dynamically switch between them using `setChannel(...)`.\n *\n * **Attention**: Only works for apps with public channels enabled.\n * If channels are private, they can still be set using `setChannel(...)`\n * but won't be returned by this method.\n *\n * @since 0.1.0\n */\n fetchChannels(options?: FetchChannelsOptions): Promise<FetchChannelsResult>;\n /**\n * Fetch the latest bundle using the [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * @since 0.1.0\n */\n fetchLatestBundle(\n options?: FetchLatestBundleOptions,\n ): Promise<FetchLatestBundleResult>;\n /**\n * Get all blocked bundle identifiers.\n *\n * Returns the list of bundle identifiers that were automatically blocked\n * due to rollbacks when `autoBlockRolledBackBundles` is enabled.\n *\n * @since 0.1.0\n */\n getBlockedBundles(): Promise<GetBlockedBundlesResult>;\n /**\n * Get all identifiers of bundles that have been downloaded.\n *\n * @since 0.1.0\n * @deprecated Use `getDownloadedBundles()` instead.\n */\n getBundles(): Promise<GetBundlesResult>;\n /**\n * Get the channel that is used for the update.\n *\n * The channel is resolved in the following order (highest priority first):\n * 1. `setChannel()` (SharedPreferences on Android / UserDefaults on iOS)\n * 2. Native config (`CapawesomeLiveUpdateDefaultChannel` in `Info.plist` on iOS or\n * `capawesome_live_update_default_channel` in `strings.xml` on Android)\n * 3. The `DEFAULT_CHANNEL` preference in `config.xml`\n *\n * **Note**: The `channel` parameter of `sync()` takes the highest priority\n * but is not persisted and therefore not returned by this method.\n *\n * @since 0.1.0\n */\n getChannel(): Promise<GetChannelResult>;\n /**\n * Get the runtime configuration.\n *\n * Returns the current plugin configuration including any runtime\n * overrides set via `setConfig()`.\n *\n * @since 0.1.0\n */\n getConfig(): Promise<GetConfigResult>;\n /**\n * Get all identifiers of bundles that have been downloaded.\n *\n * @since 0.1.0\n */\n getDownloadedBundles(): Promise<GetDownloadedBundlesResult>;\n /**\n * Get the bundle identifier of the current bundle.\n * The current bundle is the bundle that is currently used by the app.\n *\n * @since 0.1.0\n */\n getCurrentBundle(): Promise<GetCurrentBundleResult>;\n /**\n * Get the custom identifier of the device.\n *\n * @since 0.1.0\n */\n getCustomId(): Promise<GetCustomIdResult>;\n /**\n * Get the unique device identifier.\n *\n * @since 0.1.0\n */\n getDeviceId(): Promise<GetDeviceIdResult>;\n /**\n * Check whether a sync operation is currently in progress.\n *\n * @since 0.1.0\n */\n isSyncing(): Promise<IsSyncingResult>;\n /**\n * Get the bundle identifier of the next bundle.\n * The next bundle is the bundle that will be used after calling `reload()`\n * or restarting the app.\n *\n * @since 0.1.0\n */\n getNextBundle(): Promise<GetNextBundleResult>;\n /**\n * Get the version code of the app.\n *\n * On **Android**, this is the `versionCode` from `PackageInfo`.\n * On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.\n *\n * @since 0.1.0\n */\n getVersionCode(): Promise<GetVersionCodeResult>;\n /**\n * Get the version name of the app.\n *\n * On **Android**, this is the `versionName` from `PackageInfo`.\n * On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.\n *\n * @since 0.1.0\n */\n getVersionName(): Promise<GetVersionNameResult>;\n /**\n * Notify the plugin that the app is ready to use and no rollback is needed.\n *\n * **Attention**: This method should be called as soon as the app is ready to use\n * to prevent the app from being reset to the default bundle.\n *\n * @since 0.1.0\n */\n ready(): Promise<ReadyResult>;\n /**\n * Reload the app to apply the new bundle.\n *\n * @since 0.1.0\n */\n reload(): Promise<void>;\n /**\n * Reset the app to the default bundle.\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * @since 0.1.0\n */\n reset(): Promise<void>;\n /**\n * Reset the runtime configuration to the values from `config.xml`.\n *\n * This clears any runtime configuration set via `setConfig()`.\n * The changes take effect immediately.\n *\n * @since 0.1.0\n */\n resetConfig(): Promise<void>;\n /**\n * Set the channel to use for the update.\n *\n * @since 0.1.0\n */\n setChannel(options: SetChannelOptions): Promise<void>;\n /**\n * Set the runtime configuration.\n *\n * This allows updating plugin configuration options at runtime.\n * The changes are persisted across app restarts and take effect immediately.\n *\n * **Important:** Runtime configuration is automatically reset to default values\n * whenever the native app is updated to a new version. This ensures that\n * configuration from previous versions doesn't persist after an app update.\n *\n * @since 0.1.0\n */\n setConfig(options: SetConfigOptions): Promise<void>;\n /**\n * Set the custom identifier of the device.\n *\n * @since 0.1.0\n */\n setCustomId(options: SetCustomIdOptions): Promise<void>;\n /**\n * Set the next bundle to use for the app.\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * @since 0.1.0\n */\n setNextBundle(options: SetNextBundleOptions): Promise<void>;\n /**\n * Automatically download and set the latest bundle for the app using the [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * @since 0.1.0\n */\n sync(options?: SyncOptions): Promise<SyncResult>;\n /**\n * Listen for the download progress of a bundle.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'downloadBundleProgress',\n listenerFunc: DownloadBundleProgressListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for when a bundle is set as the next bundle.\n *\n * This event is triggered whenever a bundle is set to be used on the next app restart,\n * either through automatic updates or manual calls to `setNextBundle()`.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'nextBundleSet',\n listenerFunc: NextBundleSetListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 0.1.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface DeleteBundleOptions {\n /**\n * The unique identifier of the bundle to delete.\n *\n * @since 0.1.0\n * @example '1.0.0'\n */\n bundleId: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface DownloadBundleOptions {\n /**\n * The artifact type of the bundle.\n *\n * @since 0.1.0\n * @default 'zip'\n * @example 'manifest'\n */\n artifactType?: 'manifest' | 'zip';\n /**\n * The unique identifier of the bundle.\n *\n * **Attention**: The value `public` is reserved and cannot be used as a bundle identifier.\n *\n * @since 0.1.0\n * @example '1.0.0'\n */\n bundleId: string;\n /**\n * The checksum of the self-hosted bundle as a SHA-256 hash\n * in hex format to verify the integrity of the bundle.\n *\n * **Attention**: Only supported for the `zip` artifact type.\n *\n * @since 0.1.0\n */\n checksum?: string;\n /**\n * The signature of the self-hosted bundle as a signed SHA-256 hash\n * in base64 format to verify the integrity of the bundle.\n *\n * **Attention**: Only supported for the `zip` artifact type.\n *\n * @since 0.1.0\n */\n signature?: string;\n /**\n * The URL of the bundle to download.\n *\n * For the `zip` artifact type, the URL must point to a ZIP file.\n * For the `manifest` artifact type, the URL serves as the base URL\n * to download the individual files. For example, if the URL is\n * `https://example.com/download`, the plugin will download the file\n * with the href `index.html` from `https://example.com/download?href=index.html`.\n *\n * To **verify the integrity** of the file, the server should return\n * a `X-Checksum` header with the SHA-256 hash in hex format.\n *\n * To **verify the signature** of the file, the server should return\n * a `X-Signature` header with the signed SHA-256 hash in base64 format.\n *\n * @since 0.1.0\n * @example 'https://example.com/bundle.zip'\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface FetchChannelsOptions {\n /**\n * The maximum number of channels to return.\n *\n * @since 0.1.0\n * @default 50\n */\n limit?: number;\n /**\n * The number of channels to skip.\n *\n * @since 0.1.0\n * @default 0\n */\n offset?: number;\n /**\n * The query to filter channels by name.\n *\n * @since 0.1.0\n */\n query?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface FetchChannelsResult {\n /**\n * The list of channels.\n *\n * @since 0.1.0\n */\n channels: Channel[];\n}\n\n/**\n * @since 0.1.0\n */\nexport interface Channel {\n /**\n * The unique identifier of the channel.\n *\n * @since 0.1.0\n */\n id: string;\n /**\n * The name of the channel.\n *\n * @since 0.1.0\n */\n name: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface FetchLatestBundleOptions {\n /**\n * The name of the channel where the latest bundle is fetched from.\n *\n * @since 0.1.0\n */\n channel?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface FetchLatestBundleResult {\n /**\n * The artifact type of the bundle.\n *\n * @since 0.1.0\n */\n artifactType?: 'manifest' | 'zip';\n /**\n * The unique identifier of the latest bundle.\n *\n * On Capawesome Cloud, this is the ID of the app build artifact.\n *\n * If `null`, no bundle is available.\n *\n * @since 0.1.0\n */\n bundleId: string | null;\n /**\n * The checksum of the latest bundle if the bundle is self-hosted.\n *\n * If the bundle is hosted on Capawesome Cloud, the checksum will be\n * returned as response header when downloading the bundle.\n *\n * @since 0.1.0\n */\n checksum?: string;\n /**\n * Custom properties that are associated with the latest bundle.\n *\n * @since 0.1.0\n * @example { \"key\": \"value\" }\n */\n customProperties?: { [key: string]: string };\n /**\n * The URL of the latest bundle to download.\n * Pass this URL to the `downloadBundle(...)` method to download the bundle.\n *\n * @since 0.1.0\n */\n downloadUrl?: string;\n /**\n * The signature of the latest bundle if the bundle is self-hosted.\n *\n * If the bundle is hosted on Capawesome Cloud, the signature will be\n * returned as response header when downloading the bundle.\n *\n * @since 0.1.0\n */\n signature?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetBundleResult {\n /**\n * The unique identifier of the active bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 0.1.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetBlockedBundlesResult {\n /**\n * An array of unique identifiers of all blocked bundles.\n *\n * @since 0.1.0\n */\n bundleIds: string[];\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetBundlesResult {\n /**\n * An array of unique identifiers of all available bundles.\n *\n * @since 0.1.0\n */\n bundleIds: string[];\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetDownloadedBundlesResult {\n /**\n * An array of unique identifiers of all downloaded bundles.\n *\n * @since 0.1.0\n */\n bundleIds: string[];\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetChannelResult {\n /**\n * The channel name.\n *\n * If `null`, the app is using the default channel.\n *\n * @since 0.1.0\n * @example 'production'\n */\n channel: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetConfigResult {\n /**\n * The app ID used to identify the app.\n *\n * If `null`, no app ID is configured.\n *\n * @since 0.1.0\n * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'\n */\n appId: string | null;\n /**\n * The auto-update strategy for live updates.\n *\n * @since 0.1.0\n * @example 'background'\n */\n autoUpdateStrategy: 'none' | 'background';\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetCurrentBundleResult {\n /**\n * The unique identifier of the current bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 0.1.0\n */\n bundleId: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetDeviceIdResult {\n /**\n * The unique identifier of the device.\n *\n * On iOS, [`identifierForVendor`](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor) is used.\n * The value of this property is the same for apps that come from the same vendor running on the same device.\n *\n * @since 0.1.0\n * @example '50d2a548-80b7-4dad-adc7-97c0e79d8a89'\n */\n deviceId: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface IsSyncingResult {\n /**\n * Whether a sync operation is currently in progress.\n *\n * @since 0.1.0\n */\n syncing: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetNextBundleResult {\n /**\n * The unique identifier of the next bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 0.1.0\n */\n bundleId: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetVersionCodeResult {\n /**\n * The version code of the app.\n *\n * On **Android**, this is the `versionCode` from `PackageInfo`.\n * On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.\n *\n * @since 0.1.0\n * @example \"1\"\n */\n versionCode: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetVersionNameResult {\n /**\n * The version name of the app.\n *\n * On **Android**, this is the `versionName` from `PackageInfo`.\n * On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.\n *\n * @since 0.1.0\n * @example \"1.0.0\"\n */\n versionName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetCustomIdResult {\n /**\n * The custom identifier of the device.\n *\n * If `null`, no custom identifier is set.\n *\n * @since 0.1.0\n * @example '50d2a548-80b7-4dad-adc7-97c0e79d8a89'\n */\n customId: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface ReadyResult {\n /**\n * The identifier of the previous bundle used.\n *\n * If `null`, the default bundle was used.\n *\n * @since 0.1.0\n */\n previousBundleId: string | null;\n /**\n * The identifier of the current bundle used.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 0.1.0\n */\n currentBundleId: string | null;\n /**\n * Whether or not the app was reset to the default bundle.\n *\n * @since 0.1.0\n */\n rollback: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetBundleOptions {\n /**\n * The unique identifier of the bundle to use.\n *\n * @since 0.1.0\n * @example '1.0.0'\n */\n bundleId: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetChannelOptions {\n /**\n * The channel name.\n *\n * Set `null` to remove the channel.\n *\n * @since 0.1.0\n */\n channel: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetConfigOptions {\n /**\n * The app ID used to identify the app.\n *\n * Set `null` to reset to the value from the `APP_ID` preference in `config.xml`.\n *\n * @since 0.1.0\n * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'\n */\n appId?: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetCustomIdOptions {\n /**\n * The custom identifier of the device.\n *\n * Set `null` to remove the custom identifier.\n *\n * @since 0.1.0\n */\n customId: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetNextBundleOptions {\n /**\n * The unique identifier of the bundle to use.\n *\n * Set `null` to use the default bundle (same as calling `reset()`).\n *\n * @since 0.1.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SyncOptions {\n /**\n * The name of the channel where the latest bundle is fetched from.\n *\n * @since 0.1.0\n */\n channel?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SyncResult {\n /**\n * The identifier of the next bundle to use.\n *\n * If `null`, the app is up-to-date and no new bundle is available.\n *\n * @since 0.1.0\n */\n nextBundleId: string | null;\n}\n\n/**\n * Listener for the download progress of a bundle.\n *\n * @since 0.1.0\n */\nexport type DownloadBundleProgressListener = (\n event: DownloadBundleProgressEvent,\n) => void;\n\n/**\n * Event that is triggered when the download progress of a bundle changes.\n *\n * @since 0.1.0\n */\nexport interface DownloadBundleProgressEvent {\n /**\n * The unique identifier of the bundle that is being downloaded.\n *\n * @since 0.1.0\n */\n bundleId: string;\n /**\n * The number of bytes that have been downloaded.\n *\n * @since 0.1.0\n */\n downloadedBytes: number;\n /**\n * The progress of the download in percent as a value between `0` and `1`.\n *\n * @since 0.1.0\n * @example 0.5\n */\n progress: number;\n /**\n * The total number of bytes to download.\n *\n * @since 0.1.0\n */\n totalBytes: number;\n}\n\n/**\n * Listener for when a bundle is set as the next bundle.\n *\n * @since 0.1.0\n */\nexport type NextBundleSetListener = (event: NextBundleSetEvent) => void;\n\n/**\n * Event that is triggered when a bundle is set as the next bundle.\n *\n * @since 0.1.0\n */\nexport interface NextBundleSetEvent {\n /**\n * The unique identifier of the bundle that is set as the next bundle.\n *\n * If `null`, the default bundle will be used.\n *\n * @since 0.1.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function exec<T = void>(action: string, args?: unknown[]): Promise<T>;
@@ -0,0 +1,8 @@
1
+ /// <reference types="cordova" />
2
+ const SERVICE_NAME = 'LiveUpdate';
3
+ export function exec(action, args = []) {
4
+ return new Promise((resolve, reject) => {
5
+ cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME, action, args);
6
+ });
7
+ }
8
+ //# sourceMappingURL=exec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/exec.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,MAAM,YAAY,GAAG,YAAY,CAAC;AAElC,MAAM,UAAU,IAAI,CAClB,MAAc,EACd,OAAkB,EAAE;IAEpB,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,OAAO,CAAC,IAAI,CACV,CAAC,MAAS,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAC9B,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EACjC,YAAY,EACZ,MAAM,EACN,IAAI,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/// <reference types=\"cordova\" />\n\nconst SERVICE_NAME = 'LiveUpdate';\n\nexport function exec<T = void>(\n action: string,\n args: unknown[] = [],\n): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n cordova.exec(\n (result: T) => resolve(result),\n (error: unknown) => reject(error),\n SERVICE_NAME,\n action,\n args,\n );\n });\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { LiveUpdatePlugin } from './definitions';
2
+ declare const LiveUpdate: LiveUpdatePlugin;
3
+ export type * from './definitions';
4
+ export default LiveUpdate;
@@ -0,0 +1,46 @@
1
+ /// <reference types="cordova" />
2
+ import { exec } from './exec';
3
+ const SERVICE_NAME = 'LiveUpdate';
4
+ function nextListenerId() {
5
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;
6
+ }
7
+ const LiveUpdate = {
8
+ clearBlockedBundles: () => exec('clearBlockedBundles'),
9
+ deleteBundle: (options) => exec('deleteBundle', [options]),
10
+ downloadBundle: (options) => exec('downloadBundle', [options]),
11
+ fetchChannels: (options) => exec('fetchChannels', [options !== null && options !== void 0 ? options : {}]),
12
+ fetchLatestBundle: (options) => exec('fetchLatestBundle', [options !== null && options !== void 0 ? options : {}]),
13
+ getBlockedBundles: () => exec('getBlockedBundles'),
14
+ getBundles: () => exec('getBundles'),
15
+ getChannel: () => exec('getChannel'),
16
+ getConfig: () => exec('getConfig'),
17
+ getCurrentBundle: () => exec('getCurrentBundle'),
18
+ getCustomId: () => exec('getCustomId'),
19
+ getDeviceId: () => exec('getDeviceId'),
20
+ getDownloadedBundles: () => exec('getDownloadedBundles'),
21
+ getNextBundle: () => exec('getNextBundle'),
22
+ getVersionCode: () => exec('getVersionCode'),
23
+ getVersionName: () => exec('getVersionName'),
24
+ isSyncing: () => exec('isSyncing'),
25
+ ready: () => exec('ready'),
26
+ reload: () => exec('reload'),
27
+ reset: () => exec('reset'),
28
+ resetConfig: () => exec('resetConfig'),
29
+ setChannel: (options) => exec('setChannel', [options]),
30
+ setConfig: (options) => exec('setConfig', [options]),
31
+ setCustomId: (options) => exec('setCustomId', [options]),
32
+ setNextBundle: (options) => exec('setNextBundle', [options]),
33
+ sync: (options) => exec('sync', [options !== null && options !== void 0 ? options : {}]),
34
+ addListener(eventName, listenerFunc) {
35
+ const listenerId = nextListenerId();
36
+ cordova.exec((event) => listenerFunc(event), (error) => {
37
+ console.warn(`[LiveUpdate] listener "${eventName}" reported an error:`, error);
38
+ }, SERVICE_NAME, 'addListener', [eventName, listenerId]);
39
+ return Promise.resolve({
40
+ remove: () => exec('removeListener', [{ listenerId }]),
41
+ });
42
+ },
43
+ removeAllListeners: () => exec('removeAllListeners'),
44
+ };
45
+ export default LiveUpdate;
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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","sourcesContent":["/// <reference types=\"cordova\" />\n\nimport type {\n DeleteBundleOptions,\n DownloadBundleOptions,\n FetchChannelsOptions,\n FetchChannelsResult,\n FetchLatestBundleOptions,\n FetchLatestBundleResult,\n GetBlockedBundlesResult,\n GetBundlesResult,\n GetChannelResult,\n GetConfigResult,\n GetCurrentBundleResult,\n GetCustomIdResult,\n GetDeviceIdResult,\n GetDownloadedBundlesResult,\n GetNextBundleResult,\n GetVersionCodeResult,\n GetVersionNameResult,\n IsSyncingResult,\n LiveUpdatePlugin,\n PluginListenerHandle,\n ReadyResult,\n SetChannelOptions,\n SetConfigOptions,\n SetCustomIdOptions,\n SetNextBundleOptions,\n SyncOptions,\n SyncResult,\n} from './definitions';\nimport { exec } from './exec';\n\nconst SERVICE_NAME = 'LiveUpdate';\n\nfunction nextListenerId(): string {\n return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;\n}\n\nconst LiveUpdate: LiveUpdatePlugin = {\n clearBlockedBundles: () => exec('clearBlockedBundles'),\n deleteBundle: (options: DeleteBundleOptions) =>\n exec('deleteBundle', [options]),\n downloadBundle: (options: DownloadBundleOptions) =>\n exec('downloadBundle', [options]),\n fetchChannels: (options?: FetchChannelsOptions) =>\n exec<FetchChannelsResult>('fetchChannels', [options ?? {}]),\n fetchLatestBundle: (options?: FetchLatestBundleOptions) =>\n exec<FetchLatestBundleResult>('fetchLatestBundle', [options ?? {}]),\n getBlockedBundles: () => exec<GetBlockedBundlesResult>('getBlockedBundles'),\n getBundles: () => exec<GetBundlesResult>('getBundles'),\n getChannel: () => exec<GetChannelResult>('getChannel'),\n getConfig: () => exec<GetConfigResult>('getConfig'),\n getCurrentBundle: () => exec<GetCurrentBundleResult>('getCurrentBundle'),\n getCustomId: () => exec<GetCustomIdResult>('getCustomId'),\n getDeviceId: () => exec<GetDeviceIdResult>('getDeviceId'),\n getDownloadedBundles: () =>\n exec<GetDownloadedBundlesResult>('getDownloadedBundles'),\n getNextBundle: () => exec<GetNextBundleResult>('getNextBundle'),\n getVersionCode: () => exec<GetVersionCodeResult>('getVersionCode'),\n getVersionName: () => exec<GetVersionNameResult>('getVersionName'),\n isSyncing: () => exec<IsSyncingResult>('isSyncing'),\n ready: () => exec<ReadyResult>('ready'),\n reload: () => exec('reload'),\n reset: () => exec('reset'),\n resetConfig: () => exec('resetConfig'),\n setChannel: (options: SetChannelOptions) => exec('setChannel', [options]),\n setConfig: (options: SetConfigOptions) => exec('setConfig', [options]),\n setCustomId: (options: SetCustomIdOptions) => exec('setCustomId', [options]),\n setNextBundle: (options: SetNextBundleOptions) =>\n exec('setNextBundle', [options]),\n sync: (options?: SyncOptions) => exec<SyncResult>('sync', [options ?? {}]),\n addListener(\n eventName: string,\n listenerFunc: (event: any) => void,\n ): Promise<PluginListenerHandle> {\n const listenerId = nextListenerId();\n cordova.exec(\n (event: unknown) => listenerFunc(event),\n (error: unknown) => {\n console.warn(\n `[LiveUpdate] listener \"${eventName}\" reported an error:`,\n error,\n );\n },\n SERVICE_NAME,\n 'addListener',\n [eventName, listenerId],\n );\n return Promise.resolve({\n remove: () => exec('removeListener', [{ listenerId }]),\n });\n },\n removeAllListeners: () => exec('removeAllListeners'),\n};\n\nexport type * from './definitions';\nexport default LiveUpdate;\n"]}
package/dist/plugin.js ADDED
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ /// <reference types="cordova" />
4
+ const SERVICE_NAME$1 = 'LiveUpdate';
5
+ function exec(action, args = []) {
6
+ return new Promise((resolve, reject) => {
7
+ cordova.exec((result) => resolve(result), (error) => reject(error), SERVICE_NAME$1, action, args);
8
+ });
9
+ }
10
+
11
+ /// <reference types="cordova" />
12
+ const SERVICE_NAME = 'LiveUpdate';
13
+ function nextListenerId() {
14
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;
15
+ }
16
+ const LiveUpdate = {
17
+ clearBlockedBundles: () => exec('clearBlockedBundles'),
18
+ deleteBundle: (options) => exec('deleteBundle', [options]),
19
+ downloadBundle: (options) => exec('downloadBundle', [options]),
20
+ fetchChannels: (options) => exec('fetchChannels', [options !== null && options !== void 0 ? options : {}]),
21
+ fetchLatestBundle: (options) => exec('fetchLatestBundle', [options !== null && options !== void 0 ? options : {}]),
22
+ getBlockedBundles: () => exec('getBlockedBundles'),
23
+ getBundles: () => exec('getBundles'),
24
+ getChannel: () => exec('getChannel'),
25
+ getConfig: () => exec('getConfig'),
26
+ getCurrentBundle: () => exec('getCurrentBundle'),
27
+ getCustomId: () => exec('getCustomId'),
28
+ getDeviceId: () => exec('getDeviceId'),
29
+ getDownloadedBundles: () => exec('getDownloadedBundles'),
30
+ getNextBundle: () => exec('getNextBundle'),
31
+ getVersionCode: () => exec('getVersionCode'),
32
+ getVersionName: () => exec('getVersionName'),
33
+ isSyncing: () => exec('isSyncing'),
34
+ ready: () => exec('ready'),
35
+ reload: () => exec('reload'),
36
+ reset: () => exec('reset'),
37
+ resetConfig: () => exec('resetConfig'),
38
+ setChannel: (options) => exec('setChannel', [options]),
39
+ setConfig: (options) => exec('setConfig', [options]),
40
+ setCustomId: (options) => exec('setCustomId', [options]),
41
+ setNextBundle: (options) => exec('setNextBundle', [options]),
42
+ sync: (options) => exec('sync', [options !== null && options !== void 0 ? options : {}]),
43
+ addListener(eventName, listenerFunc) {
44
+ const listenerId = nextListenerId();
45
+ cordova.exec((event) => listenerFunc(event), (error) => {
46
+ console.warn(`[LiveUpdate] listener "${eventName}" reported an error:`, error);
47
+ }, SERVICE_NAME, 'addListener', [eventName, listenerId]);
48
+ return Promise.resolve({
49
+ remove: () => exec('removeListener', [{ listenerId }]),
50
+ });
51
+ },
52
+ removeAllListeners: () => exec('removeAllListeners'),
53
+ };
54
+
55
+ module.exports = LiveUpdate;
56
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/exec.js","esm/index.js"],"sourcesContent":["/// <reference types=\"cordova\" />\nconst SERVICE_NAME = 'LiveUpdate';\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","/// <reference types=\"cordova\" />\nimport { exec } from './exec';\nconst SERVICE_NAME = 'LiveUpdate';\nfunction nextListenerId() {\n return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;\n}\nconst LiveUpdate = {\n clearBlockedBundles: () => exec('clearBlockedBundles'),\n deleteBundle: (options) => exec('deleteBundle', [options]),\n downloadBundle: (options) => exec('downloadBundle', [options]),\n fetchChannels: (options) => exec('fetchChannels', [options !== null && options !== void 0 ? options : {}]),\n fetchLatestBundle: (options) => exec('fetchLatestBundle', [options !== null && options !== void 0 ? options : {}]),\n getBlockedBundles: () => exec('getBlockedBundles'),\n getBundles: () => exec('getBundles'),\n getChannel: () => exec('getChannel'),\n getConfig: () => exec('getConfig'),\n getCurrentBundle: () => exec('getCurrentBundle'),\n getCustomId: () => exec('getCustomId'),\n getDeviceId: () => exec('getDeviceId'),\n getDownloadedBundles: () => exec('getDownloadedBundles'),\n getNextBundle: () => exec('getNextBundle'),\n getVersionCode: () => exec('getVersionCode'),\n getVersionName: () => exec('getVersionName'),\n isSyncing: () => exec('isSyncing'),\n ready: () => exec('ready'),\n reload: () => exec('reload'),\n reset: () => exec('reset'),\n resetConfig: () => exec('resetConfig'),\n setChannel: (options) => exec('setChannel', [options]),\n setConfig: (options) => exec('setConfig', [options]),\n setCustomId: (options) => exec('setCustomId', [options]),\n setNextBundle: (options) => exec('setNextBundle', [options]),\n sync: (options) => exec('sync', [options !== null && options !== void 0 ? options : {}]),\n addListener(eventName, listenerFunc) {\n const listenerId = nextListenerId();\n cordova.exec((event) => listenerFunc(event), (error) => {\n console.warn(`[LiveUpdate] listener \"${eventName}\" reported an error:`, error);\n }, SERVICE_NAME, 'addListener', [eventName, listenerId]);\n return Promise.resolve({\n remove: () => exec('removeListener', [{ listenerId }]),\n });\n },\n removeAllListeners: () => exec('removeAllListeners'),\n};\nexport default LiveUpdate;\n//# sourceMappingURL=index.js.map"],"names":["SERVICE_NAME"],"mappings":";;AAAA;AACA,MAAMA,cAAY,GAAG,YAAY;AAC1B,SAAS,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE;AACxC,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5C,QAAQ,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,EAAEA,cAAY,EAAE,MAAM,EAAE,IAAI,CAAC;AACvG,IAAI,CAAC,CAAC;AACN;;ACNA;AAEA,MAAM,YAAY,GAAG,YAAY;AACjC,SAAS,cAAc,GAAG;AAC1B,IAAI,OAAO,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClF;AACK,MAAC,UAAU,GAAG;AACnB,IAAI,mBAAmB,EAAE,MAAM,IAAI,CAAC,qBAAqB,CAAC;AAC1D,IAAI,YAAY,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,CAAC;AAC9D,IAAI,cAAc,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC;AAClE,IAAI,aAAa,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,eAAe,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AAC9G,IAAI,iBAAiB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,mBAAmB,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AACtH,IAAI,iBAAiB,EAAE,MAAM,IAAI,CAAC,mBAAmB,CAAC;AACtD,IAAI,UAAU,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC;AACxC,IAAI,UAAU,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC;AACxC,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC;AACtC,IAAI,gBAAgB,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC;AACpD,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC;AAC1C,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC;AAC1C,IAAI,oBAAoB,EAAE,MAAM,IAAI,CAAC,sBAAsB,CAAC;AAC5D,IAAI,aAAa,EAAE,MAAM,IAAI,CAAC,eAAe,CAAC;AAC9C,IAAI,cAAc,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC;AAChD,IAAI,cAAc,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC;AAChD,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC;AACtC,IAAI,KAAK,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC;AAC9B,IAAI,MAAM,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC;AAChC,IAAI,KAAK,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC;AAC9B,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC;AAC1C,IAAI,UAAU,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,CAAC;AAC1D,IAAI,SAAS,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC;AACxD,IAAI,WAAW,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,CAAC;AAC5D,IAAI,aAAa,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,CAAC;AAChE,IAAI,IAAI,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AAC5F,IAAI,WAAW,CAAC,SAAS,EAAE,YAAY,EAAE;AACzC,QAAQ,MAAM,UAAU,GAAG,cAAc,EAAE;AAC3C,QAAQ,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK;AAChE,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC,uBAAuB,EAAE,SAAS,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC;AAC1F,QAAQ,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAChE,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC;AAC/B,YAAY,MAAM,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;AAClE,SAAS,CAAC;AACV,IAAI,CAAC;AACL,IAAI,kBAAkB,EAAE,MAAM,IAAI,CAAC,oBAAoB,CAAC;AACxD;;;;"}
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@capawesome/cordova-live-update",
3
+ "version": "0.1.0",
4
+ "description": "Cordova plugin to update your app remotely in real-time.",
5
+ "main": "dist/plugin.js",
6
+ "types": "dist/esm/index.d.ts",
7
+ "files": [
8
+ "dist/",
9
+ "src/android/",
10
+ "src/ios/",
11
+ "plugin.xml",
12
+ "LICENSE",
13
+ "README.md"
14
+ ],
15
+ "author": "Robin Genz <mail@robingenz.dev>",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/capawesome-team/cordova-live-update.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/capawesome-team/cordova-live-update/issues"
23
+ },
24
+ "homepage": "https://capawesome.io/cloud/live-updates/",
25
+ "funding": [
26
+ {
27
+ "type": "github",
28
+ "url": "https://github.com/sponsors/capawesome-team/"
29
+ },
30
+ {
31
+ "type": "opencollective",
32
+ "url": "https://opencollective.com/capawesome"
33
+ }
34
+ ],
35
+ "keywords": [
36
+ "cordova",
37
+ "ecosystem:cordova",
38
+ "cordova-android",
39
+ "cordova-ios",
40
+ "plugin",
41
+ "native",
42
+ "live update",
43
+ "remote update",
44
+ "ota",
45
+ "capgo"
46
+ ],
47
+ "scripts": {
48
+ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
49
+ "clean": "rimraf dist",
50
+ "docgen": "docgen --api LiveUpdatePlugin --output-readme README.md --output-json dist/docs.json",
51
+ "watch": "tsc --watch",
52
+ "lint": "npm run eslint && npm run prettier -- --check",
53
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write",
54
+ "eslint": "eslint . --ext ts",
55
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
56
+ "prepare": "npm run build",
57
+ "release": "commit-and-tag-version"
58
+ },
59
+ "devDependencies": {
60
+ "@capacitor/docgen": "^0.3.1",
61
+ "@ionic/eslint-config": "0.4.0",
62
+ "@types/cordova": "0.0.34",
63
+ "commit-and-tag-version": "12.6.1",
64
+ "eslint": "8.57.0",
65
+ "prettier": "3.4.2",
66
+ "prettier-plugin-java": "2.6.7",
67
+ "rimraf": "6.1.2",
68
+ "rollup": "4.53.3",
69
+ "typescript": "5.9.3"
70
+ },
71
+ "cordova": {
72
+ "id": "@capawesome/cordova-live-update",
73
+ "platforms": [
74
+ "android",
75
+ "ios"
76
+ ]
77
+ },
78
+ "commit-and-tag-version": {
79
+ "bumpFiles": [
80
+ { "filename": "package.json", "type": "json" },
81
+ { "filename": "package-lock.json", "type": "json" },
82
+ { "filename": "plugin.xml", "updater": "scripts/plugin-xml-version-updater.js" },
83
+ {
84
+ "filename": "src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePlugin.java",
85
+ "updater": "scripts/native-version-updater.js"
86
+ },
87
+ {
88
+ "filename": "src/ios/LiveUpdatePlugin.swift",
89
+ "updater": "scripts/native-version-updater.js"
90
+ }
91
+ ]
92
+ }
93
+ }
package/plugin.xml ADDED
@@ -0,0 +1,268 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3
+ id="@capawesome/cordova-live-update"
4
+ version="0.1.0">
5
+
6
+ <name>LiveUpdate</name>
7
+ <description>Cordova plugin to update your app remotely in real-time.</description>
8
+ <license>MIT</license>
9
+ <keywords>cordova,live update,remote update,ota</keywords>
10
+ <repo>https://github.com/capawesome-team/cordova-live-update.git</repo>
11
+ <issue>https://github.com/capawesome-team/cordova-live-update/issues</issue>
12
+
13
+ <engines>
14
+ <engine name="cordova-android" version=">=13.0.0"/>
15
+ <engine name="cordova-ios" version=">=7.0.0"/>
16
+ </engines>
17
+
18
+ <js-module src="dist/plugin.js" name="LiveUpdate">
19
+ <clobbers target="cordova.plugins.LiveUpdate"/>
20
+ </js-module>
21
+
22
+ <!-- Preferences (Cordova `<preference>` mechanism in config.xml). -->
23
+ <!--
24
+ Cordova-lib treats `default=""` as "no default" and refuses to install when
25
+ such a preference is missing. We use a single space as a sentinel for
26
+ "unset" instead; the native code trims and treats whitespace-only values
27
+ as null.
28
+ -->
29
+ <preference name="APP_ID" default=" "/>
30
+ <preference name="DEFAULT_CHANNEL" default=" "/>
31
+ <preference name="AUTO_UPDATE_STRATEGY" default="none"/>
32
+ <preference name="HTTP_TIMEOUT" default="60000"/>
33
+ <preference name="PUBLIC_KEY" default=" "/>
34
+ <preference name="READY_TIMEOUT" default="0"/>
35
+ <preference name="SERVER_DOMAIN" default="api.cloud.capawesome.io"/>
36
+ <preference name="AUTO_DELETE_BUNDLES" default="false"/>
37
+ <preference name="AUTO_BLOCK_ROLLED_BACK_BUNDLES" default="false"/>
38
+
39
+ <!-- =================== Android =================== -->
40
+ <platform name="android">
41
+ <config-file target="res/xml/config.xml" parent="/*">
42
+ <feature name="LiveUpdate">
43
+ <param name="android-package" value="io.capawesome.cordova.plugins.liveupdate.LiveUpdatePlugin"/>
44
+ <param name="onload" value="true"/>
45
+ </feature>
46
+ </config-file>
47
+
48
+ <config-file target="AndroidManifest.xml" parent="/*">
49
+ <uses-permission android:name="android.permission.INTERNET"/>
50
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
51
+ </config-file>
52
+
53
+ <!-- `<resource-file>` seeds an empty skeleton so the next `<config-file>` can target it.
54
+ Filename intentionally does NOT end in `strings.xml` — cordova-common's
55
+ `endsWith('strings.xml')` shortcut would otherwise hijack our target.
56
+ See https://github.com/apache/cordova-android/issues/1922 -->
57
+ <resource-file src="src/android/capawesome-live-update.xml"
58
+ target="res/values/capawesome-live-update.xml"/>
59
+ <config-file target="res/values/capawesome-live-update.xml" parent="/resources">
60
+ <string name="capawesome_live_update_app_id">$APP_ID</string>
61
+ <string name="capawesome_live_update_default_channel">$DEFAULT_CHANNEL</string>
62
+ <string name="capawesome_live_update_auto_update_strategy">$AUTO_UPDATE_STRATEGY</string>
63
+ <string name="capawesome_live_update_http_timeout">$HTTP_TIMEOUT</string>
64
+ <string name="capawesome_live_update_public_key">$PUBLIC_KEY</string>
65
+ <string name="capawesome_live_update_ready_timeout">$READY_TIMEOUT</string>
66
+ <string name="capawesome_live_update_server_domain">$SERVER_DOMAIN</string>
67
+ <string name="capawesome_live_update_auto_delete_bundles">$AUTO_DELETE_BUNDLES</string>
68
+ <string name="capawesome_live_update_auto_block_rolled_back_bundles">$AUTO_BLOCK_ROLLED_BACK_BUNDLES</string>
69
+ </config-file>
70
+
71
+ <framework src="src/android/capawesome-cordova-live-update.gradle"
72
+ custom="true" type="gradleReference"/>
73
+
74
+ <!-- Top-level classes -->
75
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdate.java"
76
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate"/>
77
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdateConfig.java"
78
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate"/>
79
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdateHttpClient.java"
80
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate"/>
81
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePathHandler.java"
82
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate"/>
83
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePlugin.java"
84
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate"/>
85
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/LiveUpdatePreferences.java"
86
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate"/>
87
+
88
+ <!-- classes/ -->
89
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/Manifest.java"
90
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes"/>
91
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/ManifestItem.java"
92
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes"/>
93
+
94
+ <!-- classes/api/ -->
95
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/api/GetChannelsResponseItem.java"
96
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/api"/>
97
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/api/GetLatestBundleResponse.java"
98
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/api"/>
99
+
100
+ <!-- classes/events/ -->
101
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java"
102
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/events"/>
103
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/events/NextBundleSetEvent.java"
104
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/events"/>
105
+
106
+ <!-- classes/options/ -->
107
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/DeleteBundleOptions.java"
108
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
109
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/DownloadBundleOptions.java"
110
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
111
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/FetchChannelsOptions.java"
112
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
113
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/FetchLatestBundleOptions.java"
114
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
115
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetChannelOptions.java"
116
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
117
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetConfigOptions.java"
118
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
119
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetCustomIdOptions.java"
120
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
121
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SetNextBundleOptions.java"
122
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
123
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/options/SyncOptions.java"
124
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/options"/>
125
+
126
+ <!-- classes/results/ -->
127
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/ChannelResult.java"
128
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
129
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/FetchChannelsResult.java"
130
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
131
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/FetchLatestBundleResult.java"
132
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
133
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java"
134
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
135
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetBundlesResult.java"
136
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
137
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetChannelResult.java"
138
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
139
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetConfigResult.java"
140
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
141
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetCurrentBundleResult.java"
142
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
143
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetCustomIdResult.java"
144
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
145
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetDeviceIdResult.java"
146
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
147
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java"
148
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
149
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetNextBundleResult.java"
150
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
151
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetVersionCodeResult.java"
152
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
153
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/GetVersionNameResult.java"
154
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
155
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/IsSyncingResult.java"
156
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
157
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/ReadyResult.java"
158
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
159
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/classes/results/SyncResult.java"
160
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/classes/results"/>
161
+
162
+ <!-- enums/ -->
163
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/enums/ArtifactType.java"
164
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/enums"/>
165
+
166
+ <!-- interfaces/ -->
167
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/Callback.java"
168
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/interfaces"/>
169
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/DownloadProgressCallback.java"
170
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/interfaces"/>
171
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/EmptyCallback.java"
172
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/interfaces"/>
173
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/NonEmptyCallback.java"
174
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/interfaces"/>
175
+ <source-file src="src/android/io/capawesome/cordova/plugins/liveupdate/interfaces/Result.java"
176
+ target-dir="src/io/capawesome/cordova/plugins/liveupdate/interfaces"/>
177
+ </platform>
178
+
179
+ <!-- ===================== iOS ===================== -->
180
+ <platform name="ios">
181
+ <config-file target="config.xml" parent="/*">
182
+ <feature name="LiveUpdate">
183
+ <param name="ios-package" value="CapawesomeLiveUpdatePlugin"/>
184
+ <param name="onload" value="true"/>
185
+ </feature>
186
+ </config-file>
187
+
188
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateAppId">
189
+ <string>$APP_ID</string>
190
+ </config-file>
191
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateDefaultChannel">
192
+ <string>$DEFAULT_CHANNEL</string>
193
+ </config-file>
194
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateAutoUpdateStrategy">
195
+ <string>$AUTO_UPDATE_STRATEGY</string>
196
+ </config-file>
197
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateHttpTimeout">
198
+ <string>$HTTP_TIMEOUT</string>
199
+ </config-file>
200
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdatePublicKey">
201
+ <string>$PUBLIC_KEY</string>
202
+ </config-file>
203
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateReadyTimeout">
204
+ <string>$READY_TIMEOUT</string>
205
+ </config-file>
206
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateServerDomain">
207
+ <string>$SERVER_DOMAIN</string>
208
+ </config-file>
209
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateAutoDeleteBundles">
210
+ <string>$AUTO_DELETE_BUNDLES</string>
211
+ </config-file>
212
+ <config-file target="*-Info.plist" parent="CapawesomeLiveUpdateAutoBlockRolledBackBundles">
213
+ <string>$AUTO_BLOCK_ROLLED_BACK_BUNDLES</string>
214
+ </config-file>
215
+
216
+ <podspec>
217
+ <config>
218
+ <source url="https://cdn.cocoapods.org/"/>
219
+ </config>
220
+ <pods use-frameworks="true">
221
+ <pod name="Alamofire" spec="~> 5.9"/>
222
+ <pod name="ZIPFoundation" spec="~> 0.9"/>
223
+ </pods>
224
+ </podspec>
225
+
226
+ <source-file src="src/ios/LiveUpdate.swift"/>
227
+ <source-file src="src/ios/LiveUpdateArtifactType.swift"/>
228
+ <source-file src="src/ios/LiveUpdateChannelResult.swift"/>
229
+ <source-file src="src/ios/LiveUpdateConfig.swift"/>
230
+ <source-file src="src/ios/LiveUpdateDeleteBundleOptions.swift"/>
231
+ <source-file src="src/ios/LiveUpdateDownloadBundleOptions.swift"/>
232
+ <source-file src="src/ios/LiveUpdateDownloadBundleProgressEvent.swift"/>
233
+ <source-file src="src/ios/LiveUpdateError.swift"/>
234
+ <source-file src="src/ios/LiveUpdateFetchChannelsOptions.swift"/>
235
+ <source-file src="src/ios/LiveUpdateFetchChannelsResult.swift"/>
236
+ <source-file src="src/ios/LiveUpdateFetchLatestBundleOptions.swift"/>
237
+ <source-file src="src/ios/LiveUpdateFetchLatestBundleResult.swift"/>
238
+ <source-file src="src/ios/LiveUpdateGetBlockedBundlesResult.swift"/>
239
+ <source-file src="src/ios/LiveUpdateGetBundlesResult.swift"/>
240
+ <source-file src="src/ios/LiveUpdateGetChannelResult.swift"/>
241
+ <source-file src="src/ios/LiveUpdateGetChannelsResponseItem.swift"/>
242
+ <source-file src="src/ios/LiveUpdateGetConfigResult.swift"/>
243
+ <source-file src="src/ios/LiveUpdateGetCurrentBundleResult.swift"/>
244
+ <source-file src="src/ios/LiveUpdateGetCustomIdResult.swift"/>
245
+ <source-file src="src/ios/LiveUpdateGetDeviceIdResult.swift"/>
246
+ <source-file src="src/ios/LiveUpdateGetDownloadedBundlesResult.swift"/>
247
+ <source-file src="src/ios/LiveUpdateGetLatestBundleResponse.swift"/>
248
+ <source-file src="src/ios/LiveUpdateGetNextBundleResult.swift"/>
249
+ <source-file src="src/ios/LiveUpdateGetVersionCodeResult.swift"/>
250
+ <source-file src="src/ios/LiveUpdateGetVersionNameResult.swift"/>
251
+ <source-file src="src/ios/LiveUpdateHttpClient.swift"/>
252
+ <source-file src="src/ios/LiveUpdateIsSyncingResult.swift"/>
253
+ <source-file src="src/ios/LiveUpdateManifest.swift"/>
254
+ <source-file src="src/ios/LiveUpdateManifestItem.swift"/>
255
+ <source-file src="src/ios/LiveUpdateNextBundleSetEvent.swift"/>
256
+ <source-file src="src/ios/LiveUpdatePlugin.swift"/>
257
+ <source-file src="src/ios/LiveUpdatePreferences.swift"/>
258
+ <source-file src="src/ios/LiveUpdateReadyResult.swift"/>
259
+ <source-file src="src/ios/LiveUpdateResult.swift"/>
260
+ <source-file src="src/ios/LiveUpdateSchemeHandler.swift"/>
261
+ <source-file src="src/ios/LiveUpdateSetChannelOptions.swift"/>
262
+ <source-file src="src/ios/LiveUpdateSetConfigOptions.swift"/>
263
+ <source-file src="src/ios/LiveUpdateSetCustomIdOptions.swift"/>
264
+ <source-file src="src/ios/LiveUpdateSetNextBundleOptions.swift"/>
265
+ <source-file src="src/ios/LiveUpdateSyncOptions.swift"/>
266
+ <source-file src="src/ios/LiveUpdateSyncResult.swift"/>
267
+ </platform>
268
+ </plugin>
@@ -0,0 +1,12 @@
1
+ // Gradle dependencies injected into the host Cordova-Android app project at
2
+ // `cordova prepare android` time via `<framework src="..." type="gradleReference"/>`.
3
+
4
+ repositories {
5
+ mavenCentral()
6
+ }
7
+
8
+ dependencies {
9
+ implementation "com.squareup.okhttp3:okhttp:5.3.2"
10
+ implementation "net.lingala.zip4j:zip4j:2.11.5"
11
+ implementation "androidx.webkit:webkit:1.11.0"
12
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <!-- Skeleton seeded by `<resource-file>` so `<config-file>` can populate it.
3
+ See https://github.com/apache/cordova-android/issues/1922 -->
4
+ <resources>
5
+ </resources>