@appzung/react-native-code-push 10.0.0-rc1 → 10.0.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/CodePush.podspec +1 -0
- package/LICENSE.md +2 -2
- package/README.md +74 -95
- package/android/app/build.gradle +62 -18
- package/android/app/src/main/AndroidManifest.xml +2 -3
- package/android/app/src/main/AndroidManifestNew.xml +3 -0
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePush.java +21 -89
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushNativeModule.java +32 -3
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateManager.java +2 -2
- package/android/build.gradle +1 -11
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradle.properties +4 -20
- package/docs/advanced-usage.md +2 -2
- package/docs/api-android.md +12 -10
- package/docs/api-ios.md +5 -5
- package/docs/api-js.md +180 -178
- package/docs/code-signing.md +62 -0
- package/docs/migrating-to-v10.md +31 -0
- package/docs/setup-android.md +52 -79
- package/docs/setup-ios.md +31 -28
- package/docs/setup-windows.md +1 -0
- package/ios/CodePush/CodePush.m +13 -57
- package/lib/commonjs/CodePush.js +90 -0
- package/lib/commonjs/CodePush.js.map +1 -0
- package/lib/commonjs/allowRestart.js +12 -0
- package/lib/commonjs/allowRestart.js.map +1 -0
- package/lib/commonjs/checkForUpdates.js +105 -0
- package/lib/commonjs/checkForUpdates.js.map +1 -0
- package/lib/commonjs/clearUpdates.js +15 -0
- package/lib/commonjs/clearUpdates.js.map +1 -0
- package/lib/commonjs/disallowRestart.js +12 -0
- package/lib/commonjs/disallowRestart.js.map +1 -0
- package/lib/commonjs/enums/CheckFrequency.enum.js +25 -0
- package/lib/commonjs/enums/CheckFrequency.enum.js.map +1 -0
- package/lib/commonjs/enums/DeploymentStatus.enum.js +21 -0
- package/lib/commonjs/enums/DeploymentStatus.enum.js.map +1 -0
- package/lib/commonjs/enums/InstallMode.enum.js +35 -0
- package/lib/commonjs/enums/InstallMode.enum.js.map +1 -0
- package/lib/commonjs/enums/SyncStatus.enum.js +53 -0
- package/lib/commonjs/enums/SyncStatus.enum.js.map +1 -0
- package/lib/commonjs/enums/UpdateState.enum.js +29 -0
- package/lib/commonjs/enums/UpdateState.enum.js.map +1 -0
- package/lib/commonjs/getUpdateMetadata.js +25 -0
- package/lib/commonjs/getUpdateMetadata.js.map +1 -0
- package/lib/commonjs/index.js +195 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/internals/AcquisitionSdk.js +9 -0
- package/lib/commonjs/internals/AcquisitionSdk.js.map +1 -0
- package/lib/commonjs/internals/LocalPackageImplementation.js +29 -0
- package/lib/commonjs/internals/LocalPackageImplementation.js.map +1 -0
- package/lib/commonjs/internals/NativeRNAppZungCodePushModule.js +8 -0
- package/lib/commonjs/internals/NativeRNAppZungCodePushModule.js.map +1 -0
- package/lib/commonjs/internals/RNAppZungCodePushModuleSpec.js +6 -0
- package/lib/commonjs/internals/RNAppZungCodePushModuleSpec.js.map +1 -0
- package/lib/commonjs/internals/RemotePackageImplementation.js +49 -0
- package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -0
- package/lib/commonjs/internals/getConfiguration.js +15 -0
- package/lib/commonjs/internals/getConfiguration.js.map +1 -0
- package/lib/commonjs/internals/getCurrentPackage.js +12 -0
- package/lib/commonjs/internals/getCurrentPackage.js.map +1 -0
- package/lib/commonjs/internals/getPromisifiedSdk.js +49 -0
- package/lib/commonjs/internals/getPromisifiedSdk.js.map +1 -0
- package/lib/commonjs/internals/shouldUpdateBeIgnored.js +62 -0
- package/lib/commonjs/internals/shouldUpdateBeIgnored.js.map +1 -0
- package/lib/commonjs/internals/types.js +6 -0
- package/lib/commonjs/internals/types.js.map +1 -0
- package/lib/commonjs/internals/utils/log.js +11 -0
- package/lib/commonjs/internals/utils/log.js.map +1 -0
- package/lib/commonjs/internals/utils/request-fetch-adapter.js +50 -0
- package/lib/commonjs/internals/utils/request-fetch-adapter.js.map +1 -0
- package/lib/commonjs/internals/version.js +9 -0
- package/lib/commonjs/internals/version.js.map +1 -0
- package/lib/commonjs/notifyAppReady.js +83 -0
- package/lib/commonjs/notifyAppReady.js.map +1 -0
- package/lib/commonjs/reactNative.d.js +2 -0
- package/lib/commonjs/reactNative.d.js.map +1 -0
- package/lib/commonjs/restartApp.js +16 -0
- package/lib/commonjs/restartApp.js.map +1 -0
- package/lib/commonjs/sync.js +219 -0
- package/lib/commonjs/sync.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/CodePush.js +84 -0
- package/lib/module/CodePush.js.map +1 -0
- package/lib/module/allowRestart.js +9 -0
- package/lib/module/allowRestart.js.map +1 -0
- package/lib/module/checkForUpdates.js +101 -0
- package/lib/module/checkForUpdates.js.map +1 -0
- package/lib/module/clearUpdates.js +12 -0
- package/lib/module/clearUpdates.js.map +1 -0
- package/lib/module/disallowRestart.js +9 -0
- package/lib/module/disallowRestart.js.map +1 -0
- package/lib/module/enums/CheckFrequency.enum.js +21 -0
- package/lib/module/enums/CheckFrequency.enum.js.map +1 -0
- package/lib/module/enums/DeploymentStatus.enum.js +17 -0
- package/lib/module/enums/DeploymentStatus.enum.js.map +1 -0
- package/lib/module/enums/InstallMode.enum.js +32 -0
- package/lib/module/enums/InstallMode.enum.js.map +1 -0
- package/lib/module/enums/SyncStatus.enum.js +49 -0
- package/lib/module/enums/SyncStatus.enum.js.map +1 -0
- package/lib/module/enums/UpdateState.enum.js +26 -0
- package/lib/module/enums/UpdateState.enum.js.map +1 -0
- package/lib/module/getUpdateMetadata.js +21 -0
- package/lib/module/getUpdateMetadata.js.map +1 -0
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internals/AcquisitionSdk.js +5 -0
- package/lib/module/internals/AcquisitionSdk.js.map +1 -0
- package/lib/module/internals/LocalPackageImplementation.js +24 -0
- package/lib/module/internals/LocalPackageImplementation.js.map +1 -0
- package/lib/module/internals/NativeRNAppZungCodePushModule.js +4 -0
- package/lib/module/internals/NativeRNAppZungCodePushModule.js.map +1 -0
- package/lib/module/internals/RNAppZungCodePushModuleSpec.js +4 -0
- package/lib/module/internals/RNAppZungCodePushModuleSpec.js.map +1 -0
- package/lib/module/internals/RemotePackageImplementation.js +44 -0
- package/lib/module/internals/RemotePackageImplementation.js.map +1 -0
- package/lib/module/internals/getConfiguration.js +11 -0
- package/lib/module/internals/getConfiguration.js.map +1 -0
- package/lib/module/internals/getCurrentPackage.js +8 -0
- package/lib/module/internals/getCurrentPackage.js.map +1 -0
- package/lib/module/internals/getPromisifiedSdk.js +45 -0
- package/lib/module/internals/getPromisifiedSdk.js.map +1 -0
- package/lib/module/internals/shouldUpdateBeIgnored.js +58 -0
- package/lib/module/internals/shouldUpdateBeIgnored.js.map +1 -0
- package/lib/module/internals/types.js +4 -0
- package/lib/module/internals/types.js.map +1 -0
- package/lib/module/internals/utils/log.js +7 -0
- package/lib/module/internals/utils/log.js.map +1 -0
- package/lib/module/internals/utils/request-fetch-adapter.js +46 -0
- package/lib/module/internals/utils/request-fetch-adapter.js.map +1 -0
- package/lib/module/internals/version.js +5 -0
- package/lib/module/internals/version.js.map +1 -0
- package/lib/module/notifyAppReady.js +79 -0
- package/lib/module/notifyAppReady.js.map +1 -0
- package/lib/module/reactNative.d.js +2 -0
- package/lib/module/reactNative.d.js.map +1 -0
- package/lib/module/restartApp.js +13 -0
- package/lib/module/restartApp.js.map +1 -0
- package/lib/module/sync.js +215 -0
- package/lib/module/sync.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/CodePush.d.ts +24 -0
- package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/allowRestart.d.ts +5 -0
- package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/checkForUpdates.d.ts +9 -0
- package/lib/typescript/commonjs/src/checkForUpdates.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/clearUpdates.d.ts +8 -0
- package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/disallowRestart.d.ts +5 -0
- package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts +18 -0
- package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts +14 -0
- package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts +27 -0
- package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts +46 -0
- package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts +21 -0
- package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/getUpdateMetadata.d.ts +9 -0
- package/lib/typescript/commonjs/src/getUpdateMetadata.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +17 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/LocalPackageImplementation.d.ts +17 -0
- package/lib/typescript/commonjs/src/internals/LocalPackageImplementation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/NativeRNAppZungCodePushModule.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/NativeRNAppZungCodePushModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +36 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts +18 -0
- package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/getCurrentPackage.d.ts +2 -0
- package/lib/typescript/commonjs/src/internals/getCurrentPackage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts +13 -0
- package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/shouldUpdateBeIgnored.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/types.d.ts +16 -0
- package/lib/typescript/commonjs/src/internals/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/utils/log.d.ts +2 -0
- package/lib/typescript/commonjs/src/internals/utils/log.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/version.d.ts +2 -0
- package/lib/typescript/commonjs/src/internals/version.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/notifyAppReady.d.ts +6 -0
- package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/restartApp.d.ts +7 -0
- package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/sync.d.ts +17 -0
- package/lib/typescript/commonjs/src/sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types.d.ts +196 -0
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/CodePush.d.ts +24 -0
- package/lib/typescript/module/src/CodePush.d.ts.map +1 -0
- package/lib/typescript/module/src/allowRestart.d.ts +5 -0
- package/lib/typescript/module/src/allowRestart.d.ts.map +1 -0
- package/lib/typescript/module/src/checkForUpdates.d.ts +9 -0
- package/lib/typescript/module/src/checkForUpdates.d.ts.map +1 -0
- package/lib/typescript/module/src/clearUpdates.d.ts +8 -0
- package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -0
- package/lib/typescript/module/src/disallowRestart.d.ts +5 -0
- package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts +18 -0
- package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts +14 -0
- package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/InstallMode.enum.d.ts +27 -0
- package/lib/typescript/module/src/enums/InstallMode.enum.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts +46 -0
- package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/UpdateState.enum.d.ts +21 -0
- package/lib/typescript/module/src/enums/UpdateState.enum.d.ts.map +1 -0
- package/lib/typescript/module/src/getUpdateMetadata.d.ts +9 -0
- package/lib/typescript/module/src/getUpdateMetadata.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +17 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts +3 -0
- package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/LocalPackageImplementation.d.ts +17 -0
- package/lib/typescript/module/src/internals/LocalPackageImplementation.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/NativeRNAppZungCodePushModule.d.ts +3 -0
- package/lib/typescript/module/src/internals/NativeRNAppZungCodePushModule.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +36 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts +18 -0
- package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/getConfiguration.d.ts +3 -0
- package/lib/typescript/module/src/internals/getConfiguration.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/getCurrentPackage.d.ts +2 -0
- package/lib/typescript/module/src/internals/getCurrentPackage.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts +13 -0
- package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/shouldUpdateBeIgnored.d.ts +3 -0
- package/lib/typescript/module/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/types.d.ts +16 -0
- package/lib/typescript/module/src/internals/types.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/utils/log.d.ts +2 -0
- package/lib/typescript/module/src/internals/utils/log.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts +3 -0
- package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/version.d.ts +2 -0
- package/lib/typescript/module/src/internals/version.d.ts.map +1 -0
- package/lib/typescript/module/src/notifyAppReady.d.ts +6 -0
- package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -0
- package/lib/typescript/module/src/restartApp.d.ts +7 -0
- package/lib/typescript/module/src/restartApp.d.ts.map +1 -0
- package/lib/typescript/module/src/sync.d.ts +17 -0
- package/lib/typescript/module/src/sync.d.ts.map +1 -0
- package/lib/typescript/module/src/types.d.ts +196 -0
- package/lib/typescript/module/src/types.d.ts.map +1 -0
- package/package.json +58 -11
- package/react-native.config.js +8 -8
- package/src/CodePush.tsx +108 -0
- package/src/allowRestart.ts +6 -0
- package/src/checkForUpdates.ts +109 -0
- package/src/clearUpdates.ts +9 -0
- package/src/disallowRestart.ts +6 -0
- package/src/enums/CheckFrequency.enum.ts +19 -0
- package/src/enums/DeploymentStatus.enum.ts +14 -0
- package/src/enums/InstallMode.enum.ts +31 -0
- package/src/enums/SyncStatus.enum.ts +53 -0
- package/src/enums/UpdateState.enum.ts +24 -0
- package/src/getUpdateMetadata.ts +23 -0
- package/src/index.ts +18 -0
- package/src/internals/AcquisitionSdk.ts +3 -0
- package/src/internals/LocalPackageImplementation.ts +45 -0
- package/src/internals/NativeRNAppZungCodePushModule.ts +3 -0
- package/src/internals/RNAppZungCodePushModuleSpec.ts +54 -0
- package/src/internals/RemotePackageImplementation.ts +69 -0
- package/src/internals/getConfiguration.ts +12 -0
- package/src/internals/getCurrentPackage.ts +6 -0
- package/src/internals/getPromisifiedSdk.ts +72 -0
- package/src/internals/shouldUpdateBeIgnored.ts +76 -0
- package/src/internals/types.ts +18 -0
- package/{logging.js → src/internals/utils/log.ts} +1 -3
- package/src/internals/utils/request-fetch-adapter.ts +58 -0
- package/src/internals/version.ts +2 -0
- package/src/notifyAppReady.ts +94 -0
- package/src/reactNative.d.ts +34 -0
- package/src/restartApp.ts +10 -0
- package/src/sync.ts +272 -0
- package/src/types.ts +237 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +29 -12
- package/AlertAdapter.js +0 -24
- package/CONTRIBUTING.md +0 -134
- package/CodePush.js +0 -674
- package/android/app/.gradle/config.properties +0 -2
- package/android/app/local.properties +0 -8
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +0 -102
- package/package-mixins.js +0 -68
- package/request-fetch-adapter.js +0 -52
- package/tslint.json +0 -32
- package/typings/react-native-code-push.d.ts +0 -455
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushConstants.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInstallMode.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInvalidPublicKeyException.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInvalidUpdateException.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushMalformedDataException.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushNotInitializedException.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushTelemetryManager.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUnknownException.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateState.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateUtils.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUtils.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/DownloadProgress.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/DownloadProgressCallback.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/FileUtils.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/ReactInstanceHolder.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/SettingsManager.java +0 -0
- /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/TLSSocketFactory.java +0 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import type { NativeUpdateNotification } from 'code-push/script/acquisition-sdk';
|
|
2
|
+
import type { DeploymentStatus } from './enums/DeploymentStatus.enum';
|
|
3
|
+
import type { InstallMode } from './enums/InstallMode.enum';
|
|
4
|
+
import type { SyncStatus } from './enums/SyncStatus.enum';
|
|
5
|
+
|
|
6
|
+
export interface UpdateDialog {
|
|
7
|
+
/**
|
|
8
|
+
* Indicates whether you would like to append the description of an available release to the
|
|
9
|
+
* notification message which is displayed to the end user. Defaults to false.
|
|
10
|
+
*/
|
|
11
|
+
appendReleaseDescription?: boolean;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Indicates the string you would like to prefix the release description with, if any, when
|
|
15
|
+
* displaying the update notification to the end user. Defaults to " Description: "
|
|
16
|
+
*/
|
|
17
|
+
descriptionPrefix?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The text to use for the button the end user must press in order to install a mandatory update. Defaults to "Continue".
|
|
21
|
+
*/
|
|
22
|
+
mandatoryContinueButtonLabel?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The text used as the body of an update notification, when the update is specified as mandatory.
|
|
26
|
+
* Defaults to "An update is available that must be installed.".
|
|
27
|
+
*/
|
|
28
|
+
mandatoryUpdateMessage?: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The text to use for the button the end user can press in order to ignore an optional update that is available. Defaults to "Ignore".
|
|
32
|
+
*/
|
|
33
|
+
optionalIgnoreButtonLabel?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The text to use for the button the end user can press in order to install an optional update. Defaults to "Install".
|
|
37
|
+
*/
|
|
38
|
+
optionalInstallButtonLabel?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The text used as the body of an update notification, when the update is optional. Defaults to "An update is available. Would you like to install it?".
|
|
42
|
+
*/
|
|
43
|
+
optionalUpdateMessage?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The text used as the header of an update notification that is displayed to the end user. Defaults to "Update available".
|
|
47
|
+
*/
|
|
48
|
+
title?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type DownloadProgressCallback = (progress: DownloadProgress) => void;
|
|
52
|
+
export type SyncStatusChangedCallback = (status: SyncStatus) => void;
|
|
53
|
+
export type HandleBinaryVersionMismatchCallback = (update: NativeUpdateNotification) => void;
|
|
54
|
+
|
|
55
|
+
export interface DownloadProgress {
|
|
56
|
+
/**
|
|
57
|
+
* The total number of bytes expected to be received for this update.
|
|
58
|
+
*/
|
|
59
|
+
totalBytes: number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The number of bytes downloaded thus far.
|
|
63
|
+
*/
|
|
64
|
+
receivedBytes: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface LocalPackage extends Package {
|
|
68
|
+
/**
|
|
69
|
+
* Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app.
|
|
70
|
+
*
|
|
71
|
+
* @param installMode Indicates when you would like the update changes to take effect for the end-user.
|
|
72
|
+
* @param minimumBackgroundDuration For resume-based installs, this specifies the number of seconds the app needs to be in the background before forcing a restart. Defaults to 0 if unspecified.
|
|
73
|
+
* @param onUpdateInstalled An optional promise called after app installation
|
|
74
|
+
*/
|
|
75
|
+
install(
|
|
76
|
+
installMode?: InstallMode,
|
|
77
|
+
minimumBackgroundDuration?: number,
|
|
78
|
+
onUpdateInstalled?: () => Promise<void> | void,
|
|
79
|
+
): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface Package {
|
|
83
|
+
/**
|
|
84
|
+
* The app binary version that this update is dependent on. This is the value that was
|
|
85
|
+
* specified via the appStoreVersion parameter when calling the CLI's release command.
|
|
86
|
+
*/
|
|
87
|
+
appVersion: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The release channel public ID that was used to originally download this update.
|
|
91
|
+
*/
|
|
92
|
+
releaseChannelPublicId: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The description of the update. This is the same value that you specified in the CLI when you released the update.
|
|
96
|
+
*/
|
|
97
|
+
description: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Indicates whether this update has been previously installed but was rolled back.
|
|
101
|
+
*/
|
|
102
|
+
failedInstall: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Indicates whether this is the first time the update has been run after being installed.
|
|
106
|
+
*/
|
|
107
|
+
isFirstRun: boolean;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Indicates whether the update is considered mandatory. This is the value that was specified in the CLI when the update was released.
|
|
111
|
+
*/
|
|
112
|
+
isMandatory: boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Indicates whether this update is in a "pending" state. When true, that means the update has been downloaded and installed, but the app restart
|
|
116
|
+
* needed to apply it hasn't occurred yet, and therefore, its changes aren't currently visible to the end-user.
|
|
117
|
+
*/
|
|
118
|
+
isPending: boolean;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The internal label automatically given to the update by the CodePush server. This value uniquely identifies the update within its release channel.
|
|
122
|
+
*/
|
|
123
|
+
label: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The SHA hash value of the update.
|
|
127
|
+
*/
|
|
128
|
+
packageHash: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The size of the code contained within the update, in bytes.
|
|
132
|
+
*/
|
|
133
|
+
packageSize: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface RemotePackage extends Package {
|
|
137
|
+
/**
|
|
138
|
+
* Downloads the available update from the CodePush service.
|
|
139
|
+
*
|
|
140
|
+
* @param downloadProgressCallback An optional callback that allows tracking the progress of the update while it is being downloaded.
|
|
141
|
+
*/
|
|
142
|
+
download(downloadProgressCallback?: DownloadProgressCallback): Promise<LocalPackage>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The URL at which the package is available for download.
|
|
146
|
+
*/
|
|
147
|
+
downloadUrl: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface SyncOptions {
|
|
151
|
+
/**
|
|
152
|
+
* Specifies the release channel you want to query for an update against. By default, this value is derived from the Info.plist
|
|
153
|
+
* file (iOS) and strings resources (Android), but this option allows you to override it from the script-side if you need to
|
|
154
|
+
* dynamically use a different release channel for a specific call to sync.
|
|
155
|
+
*/
|
|
156
|
+
releaseChannelPublicId?: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Specifies when you would like to install optional updates (i.e. those that aren't marked as mandatory).
|
|
160
|
+
* Defaults to codePush.InstallMode.ON_NEXT_RESTART.
|
|
161
|
+
*/
|
|
162
|
+
installMode?: InstallMode;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Specifies when you would like to install updates which are marked as mandatory.
|
|
166
|
+
* Defaults to codePush.InstallMode.IMMEDIATE.
|
|
167
|
+
*/
|
|
168
|
+
mandatoryInstallMode?: InstallMode;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property
|
|
172
|
+
* only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful
|
|
173
|
+
* for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying
|
|
174
|
+
* the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.
|
|
175
|
+
*/
|
|
176
|
+
minimumBackgroundDuration?: number;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available,
|
|
180
|
+
* and if so, what strings to use. Defaults to null, which has the effect of disabling the dialog completely. Setting this to any truthy
|
|
181
|
+
* value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as
|
|
182
|
+
* overriding one or more of the default strings.
|
|
183
|
+
*/
|
|
184
|
+
updateDialog?: UpdateDialog | true;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions
|
|
188
|
+
* specified in the options). It is an "options" object used to determine whether a rollback retry should occur, and if so, what settings to use
|
|
189
|
+
* for the rollback retry. This defaults to null, which has the effect of disabling the retry mechanism. Setting this to true will enable
|
|
190
|
+
* the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding
|
|
191
|
+
* one or more of the default values.
|
|
192
|
+
*/
|
|
193
|
+
rollbackRetryOptions?: RollbackRetryOptions | true;
|
|
194
|
+
|
|
195
|
+
ignoreFailedUpdates?: boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface RollbackRetryOptions {
|
|
199
|
+
/**
|
|
200
|
+
* Specifies the minimum time in hours that the app will wait after the latest rollback
|
|
201
|
+
* before attempting to reinstall same rolled-back package. Defaults to `24`.
|
|
202
|
+
*/
|
|
203
|
+
delayInHours?: number;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Specifies the maximum number of retry attempts that the app can make before it stops trying.
|
|
207
|
+
* Cannot be less than `1`. Defaults to `1`.
|
|
208
|
+
*/
|
|
209
|
+
maxRetryAttempts?: number;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface StatusReport {
|
|
213
|
+
/**
|
|
214
|
+
* Whether the deployment succeeded or failed.
|
|
215
|
+
*/
|
|
216
|
+
status: DeploymentStatus;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* The version of the app that was deployed (for a native app upgrade).
|
|
220
|
+
*/
|
|
221
|
+
appVersion?: string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Details of the package that was deployed (or attempted to).
|
|
225
|
+
*/
|
|
226
|
+
package?: Package;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Release channel used when deploying the previous package.
|
|
230
|
+
*/
|
|
231
|
+
previousReleaseChannelPublicId?: string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* The label (v#) of the package that was upgraded from.
|
|
235
|
+
*/
|
|
236
|
+
previousLabelOrAppVersion?: string;
|
|
237
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"exclude": ["test"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": ".",
|
|
5
|
+
"paths": {
|
|
6
|
+
"@appzung/react-native-code-push": ["./src/index"]
|
|
7
|
+
},
|
|
8
|
+
"allowUnreachableCode": false,
|
|
9
|
+
"allowUnusedLabels": false,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"jsx": "react-jsx",
|
|
13
|
+
"lib": ["ESNext"],
|
|
14
|
+
"module": "ESNext",
|
|
15
|
+
"moduleResolution": "Bundler",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"noImplicitUseStrict": false,
|
|
20
|
+
"noStrictGenericChecks": false,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"noUnusedLocals": true,
|
|
23
|
+
"noUnusedParameters": true,
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"resolvePackageJsonImports": false,
|
|
26
|
+
"skipLibCheck": true,
|
|
27
|
+
"strict": true,
|
|
28
|
+
"target": "ESNext",
|
|
29
|
+
"verbatimModuleSyntax": true
|
|
30
|
+
}
|
|
14
31
|
}
|
package/AlertAdapter.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { Platform } from "react-native";
|
|
2
|
-
let { Alert } = React;
|
|
3
|
-
|
|
4
|
-
if (Platform.OS === "android") {
|
|
5
|
-
const { NativeModules: { CodePushDialog } } = React;
|
|
6
|
-
|
|
7
|
-
Alert = {
|
|
8
|
-
alert(title, message, buttons) {
|
|
9
|
-
if (buttons.length > 2) {
|
|
10
|
-
throw "Can only show 2 buttons for Android dialog.";
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const button1Text = buttons[0] ? buttons[0].text : null,
|
|
14
|
-
button2Text = buttons[1] ? buttons[1].text : null;
|
|
15
|
-
|
|
16
|
-
CodePushDialog.showDialog(
|
|
17
|
-
title, message, button1Text, button2Text,
|
|
18
|
-
(buttonId) => { buttons[buttonId].onPress && buttons[buttonId].onPress(); },
|
|
19
|
-
(error) => { throw error; });
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = { Alert };
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
## Using the plugin
|
|
4
|
-
|
|
5
|
-
### Environment setup
|
|
6
|
-
|
|
7
|
-
`node.js` and `npm` are needed for using this project. `npm` comes bundled with the `node.js` installer. You can download the `node.js` installer here: https://nodejs.org/download/.
|
|
8
|
-
|
|
9
|
-
Once you have installed `node.js` and `npm`, install the dev dependencies for the project.
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
npm install
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Using the plugin manually
|
|
16
|
-
|
|
17
|
-
Follow these steps to test your modifications to the plugin manually:
|
|
18
|
-
- clone this repository
|
|
19
|
-
- install the dependencies
|
|
20
|
-
|
|
21
|
-
Navigate to the root folder from your command line console and run:
|
|
22
|
-
```
|
|
23
|
-
npm install
|
|
24
|
-
```
|
|
25
|
-
- install the plugin in a React-Native project
|
|
26
|
-
|
|
27
|
-
Navigate to the root folder of your React-Native project from your command line console and run:
|
|
28
|
-
```
|
|
29
|
-
npm install local_path_to_your_clone_of_this_repo
|
|
30
|
-
```
|
|
31
|
-
- configure the plugin using the steps in the README.md
|
|
32
|
-
- build and run your app on an emulator or device
|
|
33
|
-
|
|
34
|
-
## Test
|
|
35
|
-
|
|
36
|
-
### Environment setup
|
|
37
|
-
|
|
38
|
-
First, make sure you have installed the dependencies for the plugin by following the steps above.
|
|
39
|
-
|
|
40
|
-
Then, make sure you have installed `react-native`.
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
npm install -g react-native
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
To run Android tests, make sure you have `sdk\tools`, `sdk\emulator` and `sdk\platform-tools` in your PATH.
|
|
47
|
-
|
|
48
|
-
To run iOS tests, make sure you've installed CocoaPods and have `.gem/bin` in your PATH.
|
|
49
|
-
|
|
50
|
-
### Supported platforms
|
|
51
|
-
|
|
52
|
-
The plugin has end to end tests for Android and iOS. Depending on your development machine OS, you can run some or all the tests.
|
|
53
|
-
|
|
54
|
-
OS | Supported tests
|
|
55
|
-
------------- | -------------
|
|
56
|
-
OS X | Android, iOS
|
|
57
|
-
Windows | Android
|
|
58
|
-
|
|
59
|
-
### Test descriptions
|
|
60
|
-
|
|
61
|
-
The tests first build the app.
|
|
62
|
-
|
|
63
|
-
They then check if the required emulators are currently running.
|
|
64
|
-
|
|
65
|
-
If an Android emulator is not running, it attempts to boot the latest Android emulator. You can specify an emulator by adding env variable `ANDROID_EMU=yourEmulatorNameHere` to the npm command. For example: `ANDROID_EMU=yourEmulatorNameHere npm run test:android`.
|
|
66
|
-
|
|
67
|
-
If an iOS simulator is not running, it attempts to boot the latest iOS iPhone simulator. You can specify a simulator by adding env variable `IOS_EMU=yourSimulatorNameHere` to the npm command. For example: `IOS_EMU="iPhone 8 (0567DFF8-329E-41A3-BD6D-E48E9DD5EF39)" npm run test:ios`.
|
|
68
|
-
|
|
69
|
-
If all the required emulators are not running and the tests fail to boot them, the tests will fail.
|
|
70
|
-
|
|
71
|
-
If you would like the tests to always restart the necessary emulators (killing them if they are currently running), setup a env variable `CLEAN=true` to the command. For example: `CLEAN=true npm run test`.
|
|
72
|
-
|
|
73
|
-
The desired unit tests are then run.
|
|
74
|
-
|
|
75
|
-
If you would like to skip building, add a `:fast` in the command you'd like to run. For example, `npm run test:ios` becomes `npm run test:fast:ios` or `npm run test:android` becomes `npm run test:fast:android`.
|
|
76
|
-
|
|
77
|
-
There is a both a full unit test suite and a "core" set of unit tests that you may run. If you would like to run only the core tests, setup a env variable `CORE=true` to the command. For example: `CORE=true npm run test:android`.
|
|
78
|
-
|
|
79
|
-
If you would like to pull the plugin from NPM rather than running the tests on the local version, setup a env variable `NPM=true` to the command. For example: `NPM=true npm run test:ios`.
|
|
80
|
-
|
|
81
|
-
#### Default
|
|
82
|
-
|
|
83
|
-
To run all of the unit tests on Android and iOS:
|
|
84
|
-
```
|
|
85
|
-
npm run test
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
#### iOS
|
|
89
|
-
|
|
90
|
-
To run all of the unit tests on iOS:
|
|
91
|
-
```
|
|
92
|
-
npm run test:ios
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
#### Android
|
|
96
|
-
|
|
97
|
-
To run all of the unit tests on Android:
|
|
98
|
-
```
|
|
99
|
-
npm run test:android
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
#### More examples
|
|
103
|
-
|
|
104
|
-
All possible testing configurations have tasks!
|
|
105
|
-
|
|
106
|
-
The platforms are ordered as follows, and ran in that order:
|
|
107
|
-
android, ios
|
|
108
|
-
|
|
109
|
-
To run the core unit tests on Android:
|
|
110
|
-
```
|
|
111
|
-
CORE=true npm run test:android
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
To run all of the unit tests on iOS and pull the plugin from NPM:
|
|
115
|
-
```
|
|
116
|
-
NPM=true npm run test:ios
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
To run all of the unit tests on Android and iOS without building first:
|
|
120
|
-
```
|
|
121
|
-
npm run test:fast
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
To run all of the unit tests on iOS and restart the emulators:
|
|
125
|
-
```
|
|
126
|
-
CLEAN=true npm run test:ios
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
To run the core unit tests on Android and pull the plugin from NPM:
|
|
130
|
-
```
|
|
131
|
-
NPM=true CORE=true npm run test:android
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
...and so on!
|