@appzung/react-native-code-push 9.0.2 → 10.0.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.
- package/CodePush.podspec +1 -0
- package/LICENSE.md +1 -1
- package/README.md +169 -329
- package/android/app/.gradle/config.properties +2 -0
- package/android/app/build.gradle +63 -19
- package/android/app/local.properties +8 -0
- 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 +35 -97
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushConstants.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInstallMode.java +2 -2
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInvalidPublicKeyException.java +2 -2
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInvalidUpdateException.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushMalformedDataException.java +2 -2
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushNativeModule.java +37 -8
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushNotInitializedException.java +2 -2
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushTelemetryManager.java +14 -14
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUnknownException.java +2 -2
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateManager.java +3 -3
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateState.java +2 -2
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateUtils.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUtils.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/DownloadProgress.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/DownloadProgressCallback.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/FileUtils.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/ReactInstanceHolder.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/SettingsManager.java +1 -1
- package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/TLSSocketFactory.java +1 -1
- package/android/build.gradle +1 -11
- package/android/codepush.gradle +3 -3
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradle.properties +4 -20
- package/docs/advanced-usage.md +56 -0
- package/docs/api-android.md +16 -77
- package/docs/api-ios.md +9 -21
- package/docs/api-js.md +184 -219
- package/docs/code-signing.md +62 -0
- package/docs/migrating-to-v10.md +31 -0
- package/docs/setup-android.md +54 -463
- package/docs/setup-ios.md +37 -208
- package/docs/setup-windows.md +8 -74
- package/ios/CodePush/CodePush.h +4 -4
- package/ios/CodePush/CodePush.m +21 -65
- package/ios/CodePush/CodePushConfig.m +14 -11
- package/ios/CodePush/CodePushPackage.m +60 -60
- package/ios/CodePush/CodePushTelemetryManager.m +13 -13
- package/ios/CodePush.xcodeproj/project.pbxproj +1 -562
- 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 +79 -29
- package/react-native.config.js +8 -8
- package/scripts/generateBundledResourcesHash.js +1 -1
- package/scripts/getFilesInFolder.js +1 -1
- package/scripts/recordFilesBeforeBundleCommand.js +1 -1
- 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/windows/CodePush/CodePushConfig.cpp +3 -3
- package/windows/CodePush/CodePushConfig.h +3 -3
- package/windows/CodePush/CodePushNativeModule.cpp +27 -27
- package/windows/CodePush/CodePushNativeModule.h +4 -4
- package/windows/CodePush/CodePushTelemetryManager.cpp +12 -12
- package/windows/CodePush/CodePushTelemetryManager.h +1 -1
- package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
- package/.azurepipelines/test-rn-code-push.yml +0 -94
- package/.config/CredScanSuppressions.json +0 -14
- package/AlertAdapter.js +0 -24
- package/CONTRIBUTING.md +0 -134
- package/CodePush.js +0 -671
- package/SECURITY.md +0 -41
- 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/docs/multi-deployment-testing-android.md +0 -148
- package/docs/multi-deployment-testing-ios.md +0 -59
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
- package/ios/CodePush/Base64/README.md +0 -47
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
- package/ios/CodePush/JWT/LICENSE +0 -19
- package/ios/CodePush/JWT/README.md +0 -489
- package/ios/CodePush/SSZipArchive/Info.plist +0 -26
- package/ios/CodePush/SSZipArchive/README.md +0 -1
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +0 -178
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +0 -1496
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +0 -71
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +0 -23
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +0 -25
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +0 -17
- package/ios/CodePush/SSZipArchive/minizip/mz.h +0 -273
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +0 -1306
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +0 -346
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +0 -187
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +0 -65
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +0 -526
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +0 -348
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +0 -176
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +0 -350
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +0 -556
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +0 -132
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +0 -383
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +0 -42
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +0 -269
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +0 -48
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +0 -40
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +0 -203
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +0 -334
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +0 -46
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +0 -429
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +0 -43
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +0 -360
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +0 -46
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +0 -389
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +0 -43
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +0 -2782
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +0 -262
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +0 -1942
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +0 -285
- package/package-mixins.js +0 -68
- package/request-fetch-adapter.js +0 -52
- package/scripts/postlink/android/postlink.js +0 -87
- package/scripts/postlink/ios/postlink.js +0 -116
- package/scripts/postlink/run.js +0 -11
- package/scripts/postunlink/android/postunlink.js +0 -74
- package/scripts/postunlink/ios/postunlink.js +0 -87
- package/scripts/postunlink/run.js +0 -11
- package/scripts/tools/linkToolsAndroid.js +0 -57
- package/scripts/tools/linkToolsIos.js +0 -130
- package/tslint.json +0 -32
- package/typings/react-native-code-push.d.ts +0 -455
- package/windows-legacy/CodePush/CodePush.csproj +0 -128
- package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
- package/windows-legacy/CodePush/FileUtils.cs +0 -40
- package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
- package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
- package/windows-legacy/CodePush/UpdateManager.cs +0 -305
- package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
- package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
- package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
- package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
- package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
- package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
- package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
- package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
- package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
- package/windows-legacy/CodePush.Net46/packages.config +0 -5
- package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
- package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
- package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
- package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
- package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
- package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
- package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
- package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
- package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
- package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
- package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
- package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
- package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
- package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
- package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
- package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
- package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
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
|
}
|
|
@@ -36,7 +36,7 @@ namespace winrt::Microsoft::CodePush::ReactNative::implementation
|
|
|
36
36
|
{
|
|
37
37
|
std::optional<hstring> appVersion;
|
|
38
38
|
std::optional<hstring> buildVersion;
|
|
39
|
-
std::optional<hstring>
|
|
39
|
+
std::optional<hstring> releaseChannelPublicId;
|
|
40
40
|
std::optional<hstring> publicKey;
|
|
41
41
|
std::optional<hstring> serverUrl;
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ namespace winrt::Microsoft::CodePush::ReactNative::implementation
|
|
|
44
44
|
{
|
|
45
45
|
appVersion = configMap.TryLookup(AppVersionConfigKey);
|
|
46
46
|
buildVersion = configMap.TryLookup(BuildVersionConfigKey);
|
|
47
|
-
|
|
47
|
+
releaseChannelPublicId = configMap.TryLookup(ReleaseChannelPublicIdConfigKey);
|
|
48
48
|
publicKey = configMap.TryLookup(PublicKeyKey);
|
|
49
49
|
serverUrl = configMap.TryLookup(ServerURLConfigKey);
|
|
50
50
|
}
|
|
@@ -73,7 +73,7 @@ namespace winrt::Microsoft::CodePush::ReactNative::implementation
|
|
|
73
73
|
|
|
74
74
|
addToConfiguration(AppVersionConfigKey, appVersion);
|
|
75
75
|
addToConfiguration(BuildVersionConfigKey, buildVersion);
|
|
76
|
-
addToConfiguration(
|
|
76
|
+
addToConfiguration(ReleaseChannelPublicIdConfigKey, releaseChannelPublicId);
|
|
77
77
|
addToConfiguration(PublicKeyKey, publicKey);
|
|
78
78
|
addToConfiguration(ServerURLConfigKey, serverUrl);
|
|
79
79
|
|
|
@@ -29,8 +29,8 @@ namespace winrt::Microsoft::CodePush::ReactNative::implementation
|
|
|
29
29
|
|
|
30
30
|
Windows::Data::Json::JsonObject GetConfiguration();
|
|
31
31
|
|
|
32
|
-
hstring
|
|
33
|
-
void
|
|
32
|
+
hstring GetReleaseChannelPublicId() { return QueryConfig(ReleaseChannelPublicIdConfigKey); }
|
|
33
|
+
void SetReleaseChannelPublicId(std::wstring_view releaseChannelPublicId) { m_configuration.Insert(ReleaseChannelPublicIdConfigKey, releaseChannelPublicId); }
|
|
34
34
|
|
|
35
35
|
hstring GetServerUrl() { return QueryConfig(ServerURLConfigKey); }
|
|
36
36
|
void SetServerUrl(std::wstring_view serverUrl) { m_configuration.Insert(ServerURLConfigKey, serverUrl); }
|
|
@@ -42,7 +42,7 @@ namespace winrt::Microsoft::CodePush::ReactNative::implementation
|
|
|
42
42
|
static constexpr std::wstring_view AppVersionConfigKey{ L"appVersion" };
|
|
43
43
|
static constexpr std::wstring_view BuildVersionConfigKey{ L"buildVersion" };
|
|
44
44
|
static constexpr std::wstring_view ClientUniqueIDConfigKey{ L"clientUniqueId" };
|
|
45
|
-
static constexpr std::wstring_view
|
|
45
|
+
static constexpr std::wstring_view ReleaseChannelPublicIdConfigKey{ L"releaseChannelPublicId" };
|
|
46
46
|
static constexpr std::wstring_view ServerURLConfigKey{ L"serverUrl" };
|
|
47
47
|
static constexpr std::wstring_view PublicKeyKey{ L"publicKey" };
|
|
48
48
|
|
|
@@ -127,22 +127,22 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
127
127
|
return ApplicationData::Current().LocalSettings();
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
void CodePushNativeModule::OverrideAppVersion(std::wstring_view appVersion)
|
|
130
|
+
void CodePushNativeModule::OverrideAppVersion(std::wstring_view appVersion)
|
|
131
131
|
{
|
|
132
132
|
CodePushConfig::Current().SetAppVersion(appVersion);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
void CodePushNativeModule::
|
|
135
|
+
void CodePushNativeModule::SetReleaseChannelPublicId(std::wstring_view releaseChannelPublicId)
|
|
136
136
|
{
|
|
137
|
-
CodePushConfig::Current().
|
|
137
|
+
CodePushConfig::Current().SetReleaseChannelPublicId(releaseChannelPublicId);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/*
|
|
141
141
|
* This method checks to see whether a specific package hash
|
|
142
142
|
* has previously failed installation.
|
|
143
143
|
*/
|
|
144
|
-
bool CodePushNativeModule::IsFailedHash(std::wstring_view packageHash)
|
|
145
|
-
{
|
|
144
|
+
bool CodePushNativeModule::IsFailedHash(std::wstring_view packageHash)
|
|
145
|
+
{
|
|
146
146
|
auto localSettings{ GetLocalSettings() };
|
|
147
147
|
auto failedUpdatesData{ localSettings.Values().TryLookup(FailedUpdatesKey) };
|
|
148
148
|
if (failedUpdatesData == nullptr)
|
|
@@ -186,7 +186,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
186
186
|
* This method is used to get the count of rollback for the package
|
|
187
187
|
* using the latest rollback information.
|
|
188
188
|
*/
|
|
189
|
-
int CodePushNativeModule::GetRollbackCountForPackage(std::wstring_view packageHash, const JsonObject& latestRollbackInfo)
|
|
189
|
+
int CodePushNativeModule::GetRollbackCountForPackage(std::wstring_view packageHash, const JsonObject& latestRollbackInfo)
|
|
190
190
|
{
|
|
191
191
|
auto oldPackageHash{ latestRollbackInfo.GetNamedString(LatestRollbackPackageHashKey, L"null") };
|
|
192
192
|
if (packageHash == oldPackageHash)
|
|
@@ -194,7 +194,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
194
194
|
auto oldCount{ latestRollbackInfo.GetNamedNumber(LatestRollbackCountKey, 0) };
|
|
195
195
|
return static_cast<int>(oldCount);
|
|
196
196
|
}
|
|
197
|
-
return 0;
|
|
197
|
+
return 0;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/*
|
|
@@ -203,7 +203,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
203
203
|
* been applied yet via an app restart.
|
|
204
204
|
*/
|
|
205
205
|
/*static*/ bool CodePushNativeModule::IsPendingUpdate(std::wstring_view packageHash)
|
|
206
|
-
{
|
|
206
|
+
{
|
|
207
207
|
auto localSettings{ GetLocalSettings() };
|
|
208
208
|
auto pendingUpdateData{ localSettings.Values().TryLookup(PendingUpdateKey) };
|
|
209
209
|
if (pendingUpdateData != nullptr)
|
|
@@ -211,7 +211,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
211
211
|
auto pendingUpdateString{ unbox_value<hstring>(pendingUpdateData) };
|
|
212
212
|
JsonObject pendingUpdate;
|
|
213
213
|
auto success{ JsonObject::TryParse(pendingUpdateString, pendingUpdate) };
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
// If there is a pending update whose "state" isn't loading, then we consider it "pending".
|
|
216
216
|
// Additionally, if a specific hash was provided, we ensure it matches that of the pending update.
|
|
217
217
|
auto updateIsPending{ success &&
|
|
@@ -478,9 +478,9 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
478
478
|
* This is the native side of the CodePush.getConfiguration method. It isn't
|
|
479
479
|
* currently exposed via the "react-native-code-push" module, and is used
|
|
480
480
|
* internally only by the CodePush.checkForUpdate method in order to get the
|
|
481
|
-
* app version, as well as the
|
|
481
|
+
* app version, as well as the release channel that was configured in App.cpp.
|
|
482
482
|
*/
|
|
483
|
-
fire_and_forget CodePushNativeModule::GetConfiguration(ReactPromise<IJsonValue> promise) noexcept
|
|
483
|
+
fire_and_forget CodePushNativeModule::GetConfiguration(ReactPromise<IJsonValue> promise) noexcept
|
|
484
484
|
{
|
|
485
485
|
auto configuration{ CodePushConfig::Current().GetConfiguration() };
|
|
486
486
|
if (isRunningBinaryVersion)
|
|
@@ -498,7 +498,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
498
498
|
/*
|
|
499
499
|
* This method is the native side of the CodePush.getUpdateMetadata method.
|
|
500
500
|
*/
|
|
501
|
-
fire_and_forget CodePushNativeModule::GetUpdateMetadataAsync(CodePushUpdateState updateState, ReactPromise<IJsonValue> promise) noexcept
|
|
501
|
+
fire_and_forget CodePushNativeModule::GetUpdateMetadataAsync(CodePushUpdateState updateState, ReactPromise<IJsonValue> promise) noexcept
|
|
502
502
|
{
|
|
503
503
|
auto package{ co_await CodePushPackage::GetCurrentPackageAsync() };
|
|
504
504
|
if (package == nullptr)
|
|
@@ -539,14 +539,14 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
539
539
|
package.Insert(PackageIsPendingKey, JsonValue::CreateBooleanValue(currentUpdateIsPending));
|
|
540
540
|
promise.Resolve(package);
|
|
541
541
|
}
|
|
542
|
-
co_return;
|
|
542
|
+
co_return;
|
|
543
543
|
}
|
|
544
544
|
|
|
545
545
|
/*
|
|
546
546
|
* This method is the native side of the LocalPackage.install method.
|
|
547
547
|
*/
|
|
548
|
-
fire_and_forget CodePushNativeModule::InstallUpdateAsync(JsonObject updatePackage, CodePushInstallMode installMode, int minimumBackgroundDuration, ReactPromise<void> promise) noexcept
|
|
549
|
-
{
|
|
548
|
+
fire_and_forget CodePushNativeModule::InstallUpdateAsync(JsonObject updatePackage, CodePushInstallMode installMode, int minimumBackgroundDuration, ReactPromise<void> promise) noexcept
|
|
549
|
+
{
|
|
550
550
|
try
|
|
551
551
|
{
|
|
552
552
|
co_await CodePushPackage::InstallPackageAsync(updatePackage, IsPendingUpdate(L""));
|
|
@@ -568,7 +568,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
568
568
|
|
|
569
569
|
// Signal to JS that the update has been applied.
|
|
570
570
|
promise.Resolve();
|
|
571
|
-
co_return;
|
|
571
|
+
co_return;
|
|
572
572
|
}
|
|
573
573
|
|
|
574
574
|
/*
|
|
@@ -659,7 +659,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
659
659
|
* This information will be used to decide whether the application
|
|
660
660
|
* should ignore the update or not.
|
|
661
661
|
*/
|
|
662
|
-
void CodePushNativeModule::GetLatestRollbackInfo(ReactPromise<IJsonValue> promise) noexcept
|
|
662
|
+
void CodePushNativeModule::GetLatestRollbackInfo(ReactPromise<IJsonValue> promise) noexcept
|
|
663
663
|
{
|
|
664
664
|
auto localSettings{ GetLocalSettings() };
|
|
665
665
|
auto res{ localSettings.Values().TryLookup(LatestRollbackInfoKey) };
|
|
@@ -698,7 +698,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
698
698
|
promise.Resolve(JsonValue::CreateNullValue());
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
-
void CodePushNativeModule::Allow(ReactPromise<JSValue> promise) noexcept
|
|
701
|
+
void CodePushNativeModule::Allow(ReactPromise<JSValue> promise) noexcept
|
|
702
702
|
{
|
|
703
703
|
CodePushUtils::Log(L"Re-allowing restarts.");
|
|
704
704
|
m_allowed = true;
|
|
@@ -714,7 +714,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
714
714
|
promise.Resolve(JSValue::Null);
|
|
715
715
|
}
|
|
716
716
|
|
|
717
|
-
void CodePushNativeModule::ClearPendingRestart() noexcept
|
|
717
|
+
void CodePushNativeModule::ClearPendingRestart() noexcept
|
|
718
718
|
{
|
|
719
719
|
m_restartQueue.clear();
|
|
720
720
|
}
|
|
@@ -729,7 +729,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
729
729
|
/*
|
|
730
730
|
* This method is the native side of the CodePush.restartApp() method.
|
|
731
731
|
*/
|
|
732
|
-
fire_and_forget CodePushNativeModule::RestartApp(bool onlyIfUpdateIsPending, ReactPromise<JSValue> promise) noexcept
|
|
732
|
+
fire_and_forget CodePushNativeModule::RestartApp(bool onlyIfUpdateIsPending, ReactPromise<JSValue> promise) noexcept
|
|
733
733
|
{
|
|
734
734
|
co_await RestartAppInternal(onlyIfUpdateIsPending);
|
|
735
735
|
promise.Resolve(JSValue::Null);
|
|
@@ -737,11 +737,11 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
737
737
|
|
|
738
738
|
/*
|
|
739
739
|
* This method clears CodePush's downloaded updates.
|
|
740
|
-
* It is needed to switch to a different
|
|
741
|
-
* Note: we don�t recommend to use this method in scenarios other than that (CodePush will call this method
|
|
740
|
+
* It is needed to switch to a different release channel if the current release channel is more recent.
|
|
741
|
+
* Note: we don�t recommend to use this method in scenarios other than that (CodePush will call this method
|
|
742
742
|
* automatically when needed in other cases) as it could lead to unpredictable behavior.
|
|
743
743
|
*/
|
|
744
|
-
fire_and_forget CodePushNativeModule::ClearUpdates() noexcept
|
|
744
|
+
fire_and_forget CodePushNativeModule::ClearUpdates() noexcept
|
|
745
745
|
{
|
|
746
746
|
co_await ClearUpdatesStaticAsync();
|
|
747
747
|
}
|
|
@@ -752,7 +752,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
752
752
|
* removeBundleUrl. It is only to be used during tests and no-ops if the test
|
|
753
753
|
* configuration flag is not set.
|
|
754
754
|
*/
|
|
755
|
-
fire_and_forget CodePushNativeModule::DownloadAndReplaceCurrentBundle(std::wstring remoteBundleUrl) noexcept
|
|
755
|
+
fire_and_forget CodePushNativeModule::DownloadAndReplaceCurrentBundle(std::wstring remoteBundleUrl) noexcept
|
|
756
756
|
{
|
|
757
757
|
auto errorMessage{ L"Error: DownloadAndReplaceCurrentBundle is not currently implmented" };
|
|
758
758
|
hresult_error error{ E_NOTIMPL, errorMessage };
|
|
@@ -764,7 +764,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
764
764
|
* This method is checks if a new status update exists (new version was installed,
|
|
765
765
|
* or an update failed) and return its details (version label, status).
|
|
766
766
|
*/
|
|
767
|
-
fire_and_forget CodePushNativeModule::GetNewStatusReportAsync(ReactPromise<IJsonValue> promise) noexcept
|
|
767
|
+
fire_and_forget CodePushNativeModule::GetNewStatusReportAsync(ReactPromise<IJsonValue> promise) noexcept
|
|
768
768
|
{
|
|
769
769
|
if (needToReportRollback)
|
|
770
770
|
{
|
|
@@ -816,12 +816,12 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
816
816
|
co_return;
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
-
void CodePushNativeModule::RecordStatusReported(JsonObject statusReport) noexcept
|
|
819
|
+
void CodePushNativeModule::RecordStatusReported(JsonObject statusReport) noexcept
|
|
820
820
|
{
|
|
821
821
|
CodePushTelemetryManager::RecordStatusReported(statusReport);
|
|
822
822
|
}
|
|
823
823
|
|
|
824
|
-
void CodePushNativeModule::SaveStatusReportForRetry(JsonObject statusReport) noexcept
|
|
824
|
+
void CodePushNativeModule::SaveStatusReportForRetry(JsonObject statusReport) noexcept
|
|
825
825
|
{
|
|
826
826
|
CodePushTelemetryManager::SaveStatusReportForRetry(statusReport);
|
|
827
827
|
}
|
|
@@ -47,7 +47,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
47
47
|
static winrt::Windows::Storage::ApplicationDataContainer GetLocalSettings();
|
|
48
48
|
|
|
49
49
|
void OverrideAppVersion(std::wstring_view appVersion);
|
|
50
|
-
void
|
|
50
|
+
void SetReleaseChannelPublicId(std::wstring_view releaseChannelPublicId);
|
|
51
51
|
|
|
52
52
|
bool IsFailedHash(std::wstring_view packageHash);
|
|
53
53
|
|
|
@@ -79,7 +79,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
79
79
|
* This is the native side of the CodePush.getConfiguration method. It isn't
|
|
80
80
|
* currently exposed via the "react-native-code-push" module, and is used
|
|
81
81
|
* internally only by the CodePush.checkForUpdate method in order to get the
|
|
82
|
-
* app version, as well as the
|
|
82
|
+
* app version, as well as the release channel that was configured.
|
|
83
83
|
*/
|
|
84
84
|
REACT_METHOD(GetConfiguration, L"getConfiguration");
|
|
85
85
|
winrt::fire_and_forget GetConfiguration(winrt::Microsoft::ReactNative::ReactPromise<winrt::Windows::Data::Json::IJsonValue> promise) noexcept;
|
|
@@ -151,8 +151,8 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
151
151
|
|
|
152
152
|
/*
|
|
153
153
|
* This method clears CodePush's downloaded updates.
|
|
154
|
-
* It is needed to switch to a different
|
|
155
|
-
* Note: we don�t recommend to use this method in scenarios other than that (CodePush will call this method
|
|
154
|
+
* It is needed to switch to a different release channel if the current release channel is more recent.
|
|
155
|
+
* Note: we don�t recommend to use this method in scenarios other than that (CodePush will call this method
|
|
156
156
|
* automatically when needed in other cases) as it could lead to unpredictable behavior.
|
|
157
157
|
*/
|
|
158
158
|
REACT_METHOD(ClearUpdates, L"clearUpdates");
|
|
@@ -18,12 +18,12 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
18
18
|
|
|
19
19
|
static const std::wstring_view AppVersionKey{ L"appVersion" };
|
|
20
20
|
static const std::wstring_view DeploymentFailed{ L"DeploymentFailed" };
|
|
21
|
-
static const std::wstring_view
|
|
21
|
+
static const std::wstring_view ReleaseChannelPublicIdKey{ L"releaseChannelPublicId" };
|
|
22
22
|
static const std::wstring_view DeploymentSucceeded{ L"DeploymentSucceeded" };
|
|
23
23
|
static const std::wstring_view LabelKey{ L"label" };
|
|
24
24
|
static const std::wstring_view LastDeploymentReportKey{ L"CODE_PUSH_LAST_DEPLOYMENT_REPORT" };
|
|
25
25
|
static const std::wstring_view PackageKey{ L"package" };
|
|
26
|
-
static const std::wstring_view
|
|
26
|
+
static const std::wstring_view PreviousReleaseChannelPublicIdKey{ L"previousReleaseChannelPublicId" };
|
|
27
27
|
static const std::wstring_view PreviousLabelOrAppVersionKey{ L"previousLabelOrAppVersion" };
|
|
28
28
|
static const std::wstring_view RetryDeploymentReportKey{ L"CODE_PUSH_RETRY_DEPLOYMENT_REPORT" };
|
|
29
29
|
static const std::wstring_view StatusKey{ L"status" };
|
|
@@ -42,12 +42,12 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
42
42
|
{
|
|
43
43
|
if (IsStatusReportIdentifierCodePushLabel(previousStatusReportIdentifier))
|
|
44
44
|
{
|
|
45
|
-
auto
|
|
45
|
+
auto previousReleaseChannelPublicId{ GetReleaseChannelPublicIdFromStatusReportIdentifier(previousStatusReportIdentifier) };
|
|
46
46
|
auto previousLabel{ GetVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier) };
|
|
47
47
|
ClearRetryStatusReport();
|
|
48
48
|
JsonObject out;
|
|
49
49
|
out.Insert(AppVersionKey, JsonValue::CreateStringValue(appVersion));
|
|
50
|
-
out.Insert(
|
|
50
|
+
out.Insert(PreviousReleaseChannelPublicIdKey, JsonValue::CreateStringValue(previousReleaseChannelPublicId));
|
|
51
51
|
out.Insert(PreviousLabelOrAppVersionKey, JsonValue::CreateStringValue(previousLabel));
|
|
52
52
|
return out;
|
|
53
53
|
}
|
|
@@ -109,12 +109,12 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
109
109
|
ClearRetryStatusReport();
|
|
110
110
|
if (IsStatusReportIdentifierCodePushLabel(previousStatusReportIdentifier))
|
|
111
111
|
{
|
|
112
|
-
auto
|
|
112
|
+
auto previousReleaseChannelPublicId{ GetReleaseChannelPublicIdFromStatusReportIdentifier(previousStatusReportIdentifier) };
|
|
113
113
|
auto previousLabel{ GetVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier) };
|
|
114
114
|
JsonObject out;
|
|
115
115
|
out.Insert(PackageKey, currentPackage);
|
|
116
116
|
out.Insert(StatusKey, JsonValue::CreateStringValue(DeploymentSucceeded));
|
|
117
|
-
out.Insert(
|
|
117
|
+
out.Insert(PreviousReleaseChannelPublicIdKey, JsonValue::CreateStringValue(previousReleaseChannelPublicId));
|
|
118
118
|
out.Insert(PreviousLabelOrAppVersionKey, JsonValue::CreateStringValue(previousLabel));
|
|
119
119
|
return out;
|
|
120
120
|
}
|
|
@@ -165,22 +165,22 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
165
165
|
localSettings.Values().Remove(RetryDeploymentReportKey);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
/*static*/ std::wstring_view CodePushTelemetryManager::
|
|
168
|
+
/*static*/ std::wstring_view CodePushTelemetryManager::GetReleaseChannelPublicIdFromStatusReportIdentifier(std::wstring_view statusReportIdentifier)
|
|
169
169
|
{
|
|
170
170
|
return statusReportIdentifier.substr(0, statusReportIdentifier.find(':'));
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
/*static*/ hstring CodePushTelemetryManager::GetPackageStatusReportIdentifier(const JsonObject& package)
|
|
174
174
|
{
|
|
175
|
-
// Because
|
|
176
|
-
// combination of the
|
|
177
|
-
if (package.HasKey(
|
|
175
|
+
// Because release channels can be dynamically switched, we use a
|
|
176
|
+
// combination of the release channel public ID and label as the packageIdentifier.
|
|
177
|
+
if (package.HasKey(ReleaseChannelPublicIdKey) && package.HasKey(LabelKey))
|
|
178
178
|
{
|
|
179
179
|
return L"";
|
|
180
180
|
}
|
|
181
|
-
auto
|
|
181
|
+
auto releaseChannelPublicId{ package.GetNamedString(ReleaseChannelPublicIdKey) };
|
|
182
182
|
auto label{ package.GetNamedString(LabelKey) };
|
|
183
|
-
return
|
|
183
|
+
return releaseChannelPublicId + L":" + label;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
/*static*/ hstring CodePushTelemetryManager::GetPreviousStatusReportIdentifier()
|
|
@@ -19,7 +19,7 @@ namespace Microsoft::CodePush::ReactNative
|
|
|
19
19
|
|
|
20
20
|
private:
|
|
21
21
|
static void ClearRetryStatusReport();
|
|
22
|
-
static std::wstring_view
|
|
22
|
+
static std::wstring_view GetReleaseChannelPublicIdFromStatusReportIdentifier(std::wstring_view statusReportIdentifier);
|
|
23
23
|
static winrt::hstring GetPackageStatusReportIdentifier(const winrt::Windows::Data::Json::JsonObject& package);
|
|
24
24
|
static winrt::hstring GetPreviousStatusReportIdentifier();
|
|
25
25
|
static std::wstring_view GetVersionLabelFromStatusReportIdentifier(std::wstring_view statusReportIdentifier);
|