@appzung/react-native-code-push 11.0.0-rc1 → 11.0.0-rc10
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 +3 -5
- package/README.md +26 -24
- package/android/app/proguard-rules.pro +5 -0
- package/android/app/src/main/java/com/appzung/codepush/react/CodePush.java +4 -0
- package/android/app/src/main/java/com/appzung/codepush/react/CodePushConstants.java +2 -0
- package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +86 -4
- package/android/app/src/main/java/com/appzung/codepush/react/ExpoUtils.java +22 -0
- package/ios/CodePush/CodePush.h +11 -6
- package/ios/CodePush/{CodePush.m → CodePush.mm} +132 -141
- package/ios/CodePush/CodePushConfig.m +54 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +6 -6
- package/lib/commonjs/CodePush.js +11 -2
- package/lib/commonjs/CodePush.js.map +1 -1
- package/lib/commonjs/allowRestart.js +6 -2
- package/lib/commonjs/allowRestart.js.map +1 -1
- package/lib/commonjs/checkForUpdates.js +25 -26
- package/lib/commonjs/checkForUpdates.js.map +1 -1
- package/lib/commonjs/clearUpdates.js +6 -3
- package/lib/commonjs/clearUpdates.js.map +1 -1
- package/lib/commonjs/dataTransmission.js +28 -0
- package/lib/commonjs/dataTransmission.js.map +1 -0
- package/lib/commonjs/disallowRestart.js +6 -2
- package/lib/commonjs/disallowRestart.js.map +1 -1
- package/lib/commonjs/enums/CheckFrequency.enum.js +2 -2
- package/lib/commonjs/enums/InstallMode.enum.js +7 -3
- package/lib/commonjs/enums/InstallMode.enum.js.map +1 -1
- package/lib/commonjs/enums/LogLevel.enum.js +17 -0
- package/lib/commonjs/enums/LogLevel.enum.js.map +1 -0
- package/lib/commonjs/enums/SyncStatus.enum.js +7 -7
- package/lib/commonjs/enums/UpdateState.enum.js +7 -6
- package/lib/commonjs/enums/UpdateState.enum.js.map +1 -1
- package/lib/commonjs/getClientUniqueId.js +16 -0
- package/lib/commonjs/getClientUniqueId.js.map +1 -0
- package/lib/commonjs/index.js +90 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internals/CodePushApiSdk.errors.js +26 -0
- package/lib/commonjs/internals/CodePushApiSdk.errors.js.map +1 -0
- package/lib/commonjs/internals/CodePushApiSdk.js +122 -0
- package/lib/commonjs/internals/CodePushApiSdk.js.map +1 -0
- package/lib/commonjs/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +3 -2
- package/lib/commonjs/internals/CodePushApiSdk.types.js.map +1 -0
- package/lib/commonjs/internals/CodePushEventEmitter.js +10 -0
- package/lib/commonjs/internals/CodePushEventEmitter.js.map +1 -0
- package/lib/commonjs/internals/RemotePackageImplementation.js +9 -8
- package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -1
- package/lib/commonjs/internals/getConfiguration.js +4 -0
- package/lib/commonjs/internals/getConfiguration.js.map +1 -1
- package/lib/commonjs/internals/logger.js +51 -0
- package/lib/commonjs/internals/logger.js.map +1 -0
- package/lib/commonjs/internals/shouldUpdateBeIgnored.js +6 -5
- package/lib/commonjs/internals/shouldUpdateBeIgnored.js.map +1 -1
- package/lib/commonjs/internals/utils/fetchRetry.js +59 -0
- package/lib/commonjs/internals/utils/fetchRetry.js.map +1 -0
- package/lib/commonjs/internals/utils/log.js +10 -3
- package/lib/commonjs/internals/utils/log.js.map +1 -1
- package/lib/commonjs/internals/utils/queryStringify.js +25 -0
- package/lib/commonjs/internals/utils/queryStringify.js.map +1 -0
- package/lib/commonjs/internals/utils/requestFetchAdapter.js +38 -0
- package/lib/commonjs/internals/utils/requestFetchAdapter.js.map +1 -0
- package/lib/commonjs/internals/version.js +1 -1
- package/lib/commonjs/internals/version.js.map +1 -1
- package/lib/commonjs/logLevel.js +15 -0
- package/lib/commonjs/logLevel.js.map +1 -0
- package/lib/commonjs/logger.js +19 -0
- package/lib/commonjs/logger.js.map +1 -0
- package/lib/commonjs/notifyAppReady.js +26 -15
- package/lib/commonjs/notifyAppReady.js.map +1 -1
- package/lib/commonjs/resetClientUniqueId.js +18 -0
- package/lib/commonjs/resetClientUniqueId.js.map +1 -0
- package/lib/commonjs/restartApp.js +4 -2
- package/lib/commonjs/restartApp.js.map +1 -1
- package/lib/commonjs/sync.js +35 -28
- package/lib/commonjs/sync.js.map +1 -1
- package/lib/commonjs/telemetry.js +28 -0
- package/lib/commonjs/telemetry.js.map +1 -0
- package/lib/module/CodePush.js +11 -2
- package/lib/module/CodePush.js.map +1 -1
- package/lib/module/allowRestart.js +5 -1
- package/lib/module/allowRestart.js.map +1 -1
- package/lib/module/checkForUpdates.js +25 -26
- package/lib/module/checkForUpdates.js.map +1 -1
- package/lib/module/clearUpdates.js +5 -2
- package/lib/module/clearUpdates.js.map +1 -1
- package/lib/module/dataTransmission.js +24 -0
- package/lib/module/dataTransmission.js.map +1 -0
- package/lib/module/disallowRestart.js +5 -1
- package/lib/module/disallowRestart.js.map +1 -1
- package/lib/module/enums/CheckFrequency.enum.js +2 -2
- package/lib/module/enums/InstallMode.enum.js +7 -3
- package/lib/module/enums/InstallMode.enum.js.map +1 -1
- package/lib/module/enums/LogLevel.enum.js +13 -0
- package/lib/module/enums/LogLevel.enum.js.map +1 -0
- package/lib/module/enums/SyncStatus.enum.js +7 -7
- package/lib/module/enums/UpdateState.enum.js +7 -6
- package/lib/module/enums/UpdateState.enum.js.map +1 -1
- package/lib/module/getClientUniqueId.js +12 -0
- package/lib/module/getClientUniqueId.js.map +1 -0
- package/lib/module/index.js +8 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internals/CodePushApiSdk.errors.js +20 -0
- package/lib/module/internals/CodePushApiSdk.errors.js.map +1 -0
- package/lib/module/internals/CodePushApiSdk.js +118 -0
- package/lib/module/internals/CodePushApiSdk.js.map +1 -0
- package/lib/module/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +2 -1
- package/lib/module/internals/CodePushApiSdk.types.js.map +1 -0
- package/lib/module/internals/CodePushEventEmitter.js +6 -0
- package/lib/module/internals/CodePushEventEmitter.js.map +1 -0
- package/lib/module/internals/RemotePackageImplementation.js +9 -8
- package/lib/module/internals/RemotePackageImplementation.js.map +1 -1
- package/lib/module/internals/getConfiguration.js +3 -0
- package/lib/module/internals/getConfiguration.js.map +1 -1
- package/lib/module/internals/logger.js +44 -0
- package/lib/module/internals/logger.js.map +1 -0
- package/lib/module/internals/shouldUpdateBeIgnored.js +6 -5
- package/lib/module/internals/shouldUpdateBeIgnored.js.map +1 -1
- package/lib/module/internals/utils/fetchRetry.js +55 -0
- package/lib/module/internals/utils/fetchRetry.js.map +1 -0
- package/lib/module/internals/utils/log.js +11 -3
- package/lib/module/internals/utils/log.js.map +1 -1
- package/lib/module/internals/utils/queryStringify.js +21 -0
- package/lib/module/internals/utils/queryStringify.js.map +1 -0
- package/lib/module/internals/utils/requestFetchAdapter.js +34 -0
- package/lib/module/internals/utils/requestFetchAdapter.js.map +1 -0
- package/lib/module/internals/version.js +1 -1
- package/lib/module/internals/version.js.map +1 -1
- package/lib/module/logLevel.js +9 -0
- package/lib/module/logLevel.js.map +1 -0
- package/lib/module/logger.js +4 -0
- package/lib/module/logger.js.map +1 -0
- package/lib/module/notifyAppReady.js +26 -15
- package/lib/module/notifyAppReady.js.map +1 -1
- package/lib/module/resetClientUniqueId.js +14 -0
- package/lib/module/resetClientUniqueId.js.map +1 -0
- package/lib/module/restartApp.js +4 -2
- package/lib/module/restartApp.js.map +1 -1
- package/lib/module/sync.js +35 -28
- package/lib/module/sync.js.map +1 -1
- package/lib/module/telemetry.js +24 -0
- package/lib/module/telemetry.js.map +1 -0
- package/lib/typescript/commonjs/src/CodePush.d.ts +10 -5
- package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/allowRestart.d.ts +3 -1
- package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/checkForUpdates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/clearUpdates.d.ts +3 -2
- package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/dataTransmission.d.ts +13 -0
- package/lib/typescript/commonjs/src/dataTransmission.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/disallowRestart.d.ts +3 -1
- package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts +2 -2
- package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts +7 -3
- package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts +10 -0
- package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts +7 -7
- package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts +7 -6
- package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/getClientUniqueId.d.ts +5 -0
- package/lib/typescript/commonjs/src/getClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +8 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +15 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts +9 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts +103 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/CodePushEventEmitter.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/CodePushEventEmitter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +5 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts +2 -2
- package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts +1 -0
- package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/logger.d.ts +33 -0
- package/lib/typescript/commonjs/src/internals/logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/types.d.ts +2 -2
- package/lib/typescript/commonjs/src/internals/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts +9 -0
- package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/utils/log.d.ts +2 -1
- package/lib/typescript/commonjs/src/internals/utils/log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts +4 -0
- package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
- package/lib/typescript/commonjs/src/internals/version.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/logLevel.d.ts +4 -0
- package/lib/typescript/commonjs/src/logLevel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/logger.d.ts +3 -0
- package/lib/typescript/commonjs/src/logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/notifyAppReady.d.ts +4 -0
- package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts +5 -0
- package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/restartApp.d.ts +2 -0
- package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/sync.d.ts +5 -1
- package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/telemetry.d.ts +13 -0
- package/lib/typescript/commonjs/src/telemetry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types.d.ts +72 -29
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
- package/lib/typescript/module/src/CodePush.d.ts +10 -5
- package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
- package/lib/typescript/module/src/allowRestart.d.ts +3 -1
- package/lib/typescript/module/src/allowRestart.d.ts.map +1 -1
- package/lib/typescript/module/src/checkForUpdates.d.ts.map +1 -1
- package/lib/typescript/module/src/clearUpdates.d.ts +3 -2
- package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/module/src/dataTransmission.d.ts +13 -0
- package/lib/typescript/module/src/dataTransmission.d.ts.map +1 -0
- package/lib/typescript/module/src/disallowRestart.d.ts +3 -1
- package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
- package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts +2 -2
- package/lib/typescript/module/src/enums/InstallMode.enum.d.ts +7 -3
- package/lib/typescript/module/src/enums/InstallMode.enum.d.ts.map +1 -1
- package/lib/typescript/module/src/enums/LogLevel.enum.d.ts +10 -0
- package/lib/typescript/module/src/enums/LogLevel.enum.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts +7 -7
- package/lib/typescript/module/src/enums/UpdateState.enum.d.ts +7 -6
- package/lib/typescript/module/src/enums/UpdateState.enum.d.ts.map +1 -1
- package/lib/typescript/module/src/getClientUniqueId.d.ts +5 -0
- package/lib/typescript/module/src/getClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +8 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +15 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts +9 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts +103 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/CodePushEventEmitter.d.ts +3 -0
- package/lib/typescript/module/src/internals/CodePushEventEmitter.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +5 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts +2 -2
- package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/getConfiguration.d.ts +1 -0
- package/lib/typescript/module/src/internals/getConfiguration.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/logger.d.ts +33 -0
- package/lib/typescript/module/src/internals/logger.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/types.d.ts +2 -2
- package/lib/typescript/module/src/internals/types.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts +9 -0
- package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/utils/log.d.ts +2 -1
- package/lib/typescript/module/src/internals/utils/log.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/utils/queryStringify.d.ts +4 -0
- package/lib/typescript/module/src/internals/utils/queryStringify.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts +3 -0
- package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/version.d.ts +1 -1
- package/lib/typescript/module/src/internals/version.d.ts.map +1 -1
- package/lib/typescript/module/src/logLevel.d.ts +4 -0
- package/lib/typescript/module/src/logLevel.d.ts.map +1 -0
- package/lib/typescript/module/src/logger.d.ts +3 -0
- package/lib/typescript/module/src/logger.d.ts.map +1 -0
- package/lib/typescript/module/src/notifyAppReady.d.ts +4 -0
- package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
- package/lib/typescript/module/src/resetClientUniqueId.d.ts +5 -0
- package/lib/typescript/module/src/resetClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/module/src/restartApp.d.ts +2 -0
- package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
- package/lib/typescript/module/src/sync.d.ts +5 -1
- package/lib/typescript/module/src/sync.d.ts.map +1 -1
- package/lib/typescript/module/src/telemetry.d.ts +13 -0
- package/lib/typescript/module/src/telemetry.d.ts.map +1 -0
- package/lib/typescript/module/src/types.d.ts +72 -29
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/package.json +24 -13
- package/scripts/generateBundledResourcesHash.js +73 -68
- package/scripts/getFilesInFolder.js +12 -12
- package/scripts/recordFilesBeforeBundleCommand.js +19 -20
- package/src/CodePush.tsx +20 -5
- package/src/allowRestart.ts +5 -1
- package/src/checkForUpdates.ts +26 -24
- package/src/clearUpdates.ts +5 -2
- package/src/dataTransmission.ts +21 -0
- package/src/disallowRestart.ts +5 -1
- package/src/enums/CheckFrequency.enum.ts +2 -2
- package/src/enums/InstallMode.enum.ts +7 -3
- package/src/enums/LogLevel.enum.ts +9 -0
- package/src/enums/SyncStatus.enum.ts +7 -7
- package/src/enums/UpdateState.enum.ts +7 -6
- package/src/getClientUniqueId.ts +9 -0
- package/src/index.ts +8 -1
- package/src/internals/CodePushApiSdk.errors.ts +22 -0
- package/src/internals/CodePushApiSdk.ts +160 -0
- package/src/internals/CodePushApiSdk.types.ts +117 -0
- package/src/internals/CodePushEventEmitter.ts +4 -0
- package/src/internals/RNAppZungCodePushModuleSpec.ts +7 -0
- package/src/internals/RemotePackageImplementation.ts +11 -10
- package/src/internals/getConfiguration.ts +4 -0
- package/src/internals/logger.ts +46 -0
- package/src/internals/shouldUpdateBeIgnored.ts +6 -5
- package/src/internals/types.ts +2 -2
- package/src/internals/utils/fetchRetry.ts +72 -0
- package/src/internals/utils/log.ts +13 -3
- package/src/internals/utils/queryStringify.ts +22 -0
- package/src/internals/utils/requestFetchAdapter.ts +36 -0
- package/src/internals/version.ts +1 -1
- package/src/logLevel.ts +9 -0
- package/src/logger.ts +2 -0
- package/src/notifyAppReady.ts +29 -18
- package/src/resetClientUniqueId.ts +11 -0
- package/src/restartApp.ts +4 -2
- package/src/sync.ts +41 -27
- package/src/telemetry.ts +21 -0
- package/src/types.ts +72 -29
- package/android/app/.gradle/config.properties +0 -2
- package/android/app/local.properties +0 -8
- package/docs/advanced-usage.md +0 -56
- package/docs/api-android.md +0 -22
- package/docs/api-ios.md +0 -19
- package/docs/api-js.md +0 -557
- package/docs/code-signing.md +0 -62
- package/docs/migrating-to-v10.md +0 -31
- package/docs/setup-android.md +0 -81
- package/docs/setup-ios.md +0 -108
- package/docs/setup-windows.md +0 -55
- package/lib/commonjs/enums/DeploymentStatus.enum.js.map +0 -1
- package/lib/commonjs/internals/AcquisitionSdk.js +0 -9
- package/lib/commonjs/internals/AcquisitionSdk.js.map +0 -1
- package/lib/commonjs/internals/getPromisifiedSdk.js +0 -49
- package/lib/commonjs/internals/getPromisifiedSdk.js.map +0 -1
- package/lib/commonjs/internals/utils/request-fetch-adapter.js +0 -50
- package/lib/commonjs/internals/utils/request-fetch-adapter.js.map +0 -1
- package/lib/module/enums/DeploymentStatus.enum.js.map +0 -1
- package/lib/module/internals/AcquisitionSdk.js +0 -5
- package/lib/module/internals/AcquisitionSdk.js.map +0 -1
- package/lib/module/internals/getPromisifiedSdk.js +0 -45
- package/lib/module/internals/getPromisifiedSdk.js.map +0 -1
- package/lib/module/internals/utils/request-fetch-adapter.js +0 -46
- package/lib/module/internals/utils/request-fetch-adapter.js.map +0 -1
- package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts +0 -14
- package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts +0 -3
- package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts +0 -13
- package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts +0 -3
- package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
- package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts +0 -14
- package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
- package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts +0 -3
- package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts.map +0 -1
- package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts +0 -13
- package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts.map +0 -1
- package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts +0 -3
- package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
- package/src/enums/DeploymentStatus.enum.ts +0 -14
- package/src/internals/AcquisitionSdk.ts +0 -3
- package/src/internals/getPromisifiedSdk.ts +0 -72
- package/src/internals/utils/request-fetch-adapter.ts +0 -58
|
@@ -5,13 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.notifyAppReady = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
+
var _LogLevelEnum = require("./enums/LogLevel.enum.js");
|
|
9
|
+
var _CodePushApiSdk = require("./internals/CodePushApiSdk.js");
|
|
8
10
|
var _NativeRNAppZungCodePushModule = require("./internals/NativeRNAppZungCodePushModule.js");
|
|
9
11
|
var _getConfiguration = require("./internals/getConfiguration.js");
|
|
10
|
-
var _getPromisifiedSdk = require("./internals/getPromisifiedSdk.js");
|
|
11
12
|
var _log = require("./internals/utils/log.js");
|
|
12
|
-
var _requestFetchAdapter = require("./internals/utils/
|
|
13
|
+
var _requestFetchAdapter = require("./internals/utils/requestFetchAdapter.js");
|
|
13
14
|
/**
|
|
15
|
+
* @function
|
|
16
|
+
*
|
|
14
17
|
* Notifies the CodePush runtime that an installed update is considered successful.
|
|
18
|
+
*
|
|
19
|
+
* If you are manually checking for and installing updates (i.e. not using the `sync` method to handle it all for you), then this method **MUST** be called; otherwise CodePush will treat the update as failed and rollback to the previous version when the app next restarts.
|
|
15
20
|
*/
|
|
16
21
|
const notifyAppReady = exports.notifyAppReady = (() => {
|
|
17
22
|
// This ensures that notifyApplicationReadyInternal is only called once
|
|
@@ -25,46 +30,51 @@ const notifyAppReady = exports.notifyAppReady = (() => {
|
|
|
25
30
|
};
|
|
26
31
|
})();
|
|
27
32
|
async function notifyApplicationReadyInternal() {
|
|
33
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, 'notifyApplicationReady');
|
|
28
34
|
await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.notifyApplicationReady();
|
|
29
35
|
const statusReport = await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.getNewStatusReport();
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
if (statusReport) {
|
|
37
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `tryReportStatus ${statusReport.status || '(no update)'}`);
|
|
38
|
+
tryReportStatus(statusReport); // Don't wait for this to complete.
|
|
39
|
+
} else {
|
|
40
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `Nothing to report`);
|
|
41
|
+
}
|
|
32
42
|
return statusReport;
|
|
33
43
|
}
|
|
34
44
|
async function tryReportStatus(statusReport, retryOnAppResume) {
|
|
35
45
|
const config = await (0, _getConfiguration.getConfiguration)();
|
|
36
|
-
const previousLabelOrAppVersion = statusReport.previousLabelOrAppVersion;
|
|
46
|
+
const previousLabelOrAppVersion = statusReport.previousLabelOrAppVersion ?? null;
|
|
37
47
|
const previousReleaseChannelPublicId = statusReport.previousReleaseChannelPublicId || config.releaseChannelPublicId;
|
|
38
48
|
try {
|
|
39
49
|
if (statusReport.appVersion) {
|
|
40
|
-
(0, _log.log)(`Reporting binary update (${statusReport.appVersion})`);
|
|
50
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, `Reporting binary update (${statusReport.appVersion})`);
|
|
41
51
|
if (!config.releaseChannelPublicId) {
|
|
42
52
|
throw new Error('Release channel is missing');
|
|
43
53
|
}
|
|
44
|
-
const sdk =
|
|
45
|
-
await sdk.reportStatusDeploy(
|
|
54
|
+
const sdk = new _CodePushApiSdk.CodePushApiSdk(_requestFetchAdapter.requestFetchAdapter, _log.log, config);
|
|
55
|
+
await sdk.reportStatusDeploy(null, previousLabelOrAppVersion, previousReleaseChannelPublicId);
|
|
46
56
|
} else {
|
|
47
57
|
if (!statusReport.package) {
|
|
48
58
|
throw new Error('Missing package in status report');
|
|
49
59
|
}
|
|
50
60
|
const label = statusReport.package.label;
|
|
51
61
|
if (statusReport.status === 'DeploymentSucceeded') {
|
|
52
|
-
(0, _log.log)(`Reporting CodePush update success (${label})`);
|
|
62
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, `Reporting CodePush update success (${label})`);
|
|
53
63
|
} else {
|
|
54
|
-
(0, _log.log)(`Reporting CodePush update rollback (${label})`);
|
|
64
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, `Reporting CodePush update rollback (${label})`);
|
|
55
65
|
await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.setLatestRollbackInfo(statusReport.package.packageHash);
|
|
56
66
|
}
|
|
57
67
|
config.releaseChannelPublicId = statusReport.package.releaseChannelPublicId;
|
|
58
|
-
const sdk =
|
|
68
|
+
const sdk = new _CodePushApiSdk.CodePushApiSdk(_requestFetchAdapter.requestFetchAdapter, _log.log, config);
|
|
59
69
|
await sdk.reportStatusDeploy({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
70
|
+
package: statusReport.package,
|
|
71
|
+
status: statusReport.status
|
|
72
|
+
}, previousLabelOrAppVersion, previousReleaseChannelPublicId);
|
|
63
73
|
}
|
|
64
74
|
_NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.recordStatusReported(statusReport);
|
|
65
75
|
retryOnAppResume && retryOnAppResume.remove();
|
|
66
76
|
} catch (e) {
|
|
67
|
-
(0, _log.log)(`Report status failed: ${JSON.stringify(statusReport)}`);
|
|
77
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.WARN, `Report status failed: ${JSON.stringify(statusReport)}`);
|
|
68
78
|
_NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.saveStatusReportForRetry(statusReport);
|
|
69
79
|
// Try again when the app resumes
|
|
70
80
|
if (!retryOnAppResume) {
|
|
@@ -72,6 +82,7 @@ async function tryReportStatus(statusReport, retryOnAppResume) {
|
|
|
72
82
|
if (newState !== 'active') return;
|
|
73
83
|
const refreshedStatusReport = await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.getNewStatusReport();
|
|
74
84
|
if (refreshedStatusReport) {
|
|
85
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `tryReportStatus on active appState ${statusReport.status || '(no update)'}`);
|
|
75
86
|
tryReportStatus(refreshedStatusReport, resumeListener);
|
|
76
87
|
} else {
|
|
77
88
|
resumeListener && resumeListener.remove();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_LogLevelEnum","_CodePushApiSdk","_NativeRNAppZungCodePushModule","_getConfiguration","_log","_requestFetchAdapter","notifyAppReady","exports","notifyApplicationReadyPromise","notifyApplicationReadyInternal","log","LogLevel","DEBUG","NativeRNAppZungCodePushModule","notifyApplicationReady","statusReport","getNewStatusReport","status","tryReportStatus","retryOnAppResume","config","getConfiguration","previousLabelOrAppVersion","previousReleaseChannelPublicId","releaseChannelPublicId","appVersion","INFO","Error","sdk","CodePushApiSdk","requestFetchAdapter","reportStatusDeploy","package","label","setLatestRollbackInfo","packageHash","recordStatusReported","remove","e","WARN","JSON","stringify","saveStatusReportForRetry","resumeListener","AppState","addEventListener","newState","refreshedStatusReport"],"sourceRoot":"../../src","sources":["notifyAppReady.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,CAAC,MAAM;EACnC;EACA;EACA,IAAIE,6BAAuE;EAE3E,OAAO,MAAM;IACX,IAAI,CAACA,6BAA6B,EAAE;MAClCA,6BAA6B,GAAGC,8BAA8B,CAAC,CAAC;IAClE;IAEA,OAAOD,6BAA6B;EACtC,CAAC;AACH,CAAC,EAAE,CAAC;AAEJ,eAAeC,8BAA8BA,CAAA,EAAG;EAC9C,IAAAC,QAAG,EAACC,sBAAQ,CAACC,KAAK,EAAE,wBAAwB,CAAC;EAE7C,MAAMC,4DAA6B,CAACC,sBAAsB,CAAC,CAAC;EAC5D,MAAMC,YAAY,GAAG,MAAMF,4DAA6B,CAACG,kBAAkB,CAAC,CAAC;EAC7E,IAAID,YAAY,EAAE;IAChB,IAAAL,QAAG,EAACC,sBAAQ,CAACC,KAAK,EAAE,mBAAmBG,YAAY,CAACE,MAAM,IAAI,aAAa,EAAE,CAAC;IAE9E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IACJ;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resetClientUniqueId = void 0;
|
|
7
|
+
var _NativeRNAppZungCodePushModule = require("./internals/NativeRNAppZungCodePushModule.js");
|
|
8
|
+
var _getConfiguration = require("./internals/getConfiguration.js");
|
|
9
|
+
/**
|
|
10
|
+
* Resets the client's unique ID. You may use this in some GDPR compliance scenarios. Note that this will create a new MAU if a new request is sent later.
|
|
11
|
+
*/
|
|
12
|
+
const resetClientUniqueId = async () => {
|
|
13
|
+
const newId = await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.resetClientUniqueId();
|
|
14
|
+
await (0, _getConfiguration.reloadCachedConfiguration)();
|
|
15
|
+
return newId;
|
|
16
|
+
};
|
|
17
|
+
exports.resetClientUniqueId = resetClientUniqueId;
|
|
18
|
+
//# sourceMappingURL=resetClientUniqueId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_NativeRNAppZungCodePushModule","require","_getConfiguration","resetClientUniqueId","newId","NativeRNAppZungCodePushModule","reloadCachedConfiguration","exports"],"sourceRoot":"../../src","sources":["resetClientUniqueId.ts"],"mappings":";;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACO,MAAME,mBAAmB,GAAG,MAAAA,CAAA,KAAY;EAC7C,MAAMC,KAAK,GAAG,MAAMC,4DAA6B,CAACF,mBAAmB,CAAC,CAAC;EACvE,MAAM,IAAAG,2CAAyB,EAAC,CAAC;EACjC,OAAOF,KAAK;AACd,CAAC;AAACG,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -8,9 +8,11 @@ var _NativeRNAppZungCodePushModule = require("./internals/NativeRNAppZungCodePus
|
|
|
8
8
|
/**
|
|
9
9
|
* Immediately restarts the app.
|
|
10
10
|
*
|
|
11
|
+
* If there is an update pending, it will be immediately displayed to the end user. Otherwise, calling this method simply has the same behavior as the end user killing and restarting the process.
|
|
12
|
+
*
|
|
11
13
|
* @param onlyIfUpdateIsPending Indicates whether you want the restart to no-op if there isn't currently a pending update.
|
|
12
14
|
*/
|
|
13
|
-
|
|
14
|
-
_NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
|
|
15
|
+
function restartApp(onlyIfUpdateIsPending = false) {
|
|
16
|
+
return _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=restartApp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_NativeRNAppZungCodePushModule","require","restartApp","onlyIfUpdateIsPending","NativeRNAppZungCodePushModule"],"sourceRoot":"../../src","sources":["restartApp.ts"],"mappings":";;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"names":["_NativeRNAppZungCodePushModule","require","restartApp","onlyIfUpdateIsPending","NativeRNAppZungCodePushModule"],"sourceRoot":"../../src","sources":["restartApp.ts"],"mappings":";;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,qBAAqB,GAAG,KAAK,EAAE;EACxD,OAAOC,4DAA6B,CAACF,UAAU,CAACC,qBAAqB,CAAC;AACxE","ignoreList":[]}
|
package/lib/commonjs/sync.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.sync = exports.DEFAULT_UPDATE_DIALOG = void 0;
|
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _checkForUpdates = require("./checkForUpdates.js");
|
|
9
9
|
var _InstallModeEnum = require("./enums/InstallMode.enum.js");
|
|
10
|
+
var _LogLevelEnum = require("./enums/LogLevel.enum.js");
|
|
10
11
|
var _SyncStatusEnum = require("./enums/SyncStatus.enum.js");
|
|
11
12
|
var _getCurrentPackage = require("./internals/getCurrentPackage.js");
|
|
12
13
|
var _shouldUpdateBeIgnored = require("./internals/shouldUpdateBeIgnored.js");
|
|
@@ -51,36 +52,36 @@ async function syncInternal(options, syncStatusChangeCallback, downloadProgressC
|
|
|
51
52
|
syncStatusChangeCallback = typeof syncStatusChangeCallback === 'function' ? syncStatusChangeCallback : syncStatus => {
|
|
52
53
|
switch (syncStatus) {
|
|
53
54
|
case _SyncStatusEnum.SyncStatus.CHECKING_FOR_UPDATE:
|
|
54
|
-
(0, _log.log)('Checking for update.');
|
|
55
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'Checking for update.');
|
|
55
56
|
break;
|
|
56
57
|
case _SyncStatusEnum.SyncStatus.AWAITING_USER_ACTION:
|
|
57
|
-
(0, _log.log)('Awaiting user action.');
|
|
58
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'Awaiting user action.');
|
|
58
59
|
break;
|
|
59
60
|
case _SyncStatusEnum.SyncStatus.DOWNLOADING_PACKAGE:
|
|
60
|
-
(0, _log.log)('Downloading package.');
|
|
61
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'Downloading package.');
|
|
61
62
|
break;
|
|
62
63
|
case _SyncStatusEnum.SyncStatus.INSTALLING_UPDATE:
|
|
63
|
-
(0, _log.log)('Installing update.');
|
|
64
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'Installing update.');
|
|
64
65
|
break;
|
|
65
66
|
case _SyncStatusEnum.SyncStatus.UP_TO_DATE:
|
|
66
|
-
(0, _log.log)('App is up to date.');
|
|
67
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'App is up to date.');
|
|
67
68
|
break;
|
|
68
69
|
case _SyncStatusEnum.SyncStatus.UPDATE_IGNORED:
|
|
69
|
-
(0, _log.log)('User cancelled the update.');
|
|
70
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'User cancelled the update.');
|
|
70
71
|
break;
|
|
71
72
|
case _SyncStatusEnum.SyncStatus.UPDATE_INSTALLED:
|
|
72
|
-
if (resolvedInstallMode
|
|
73
|
-
(0, _log.log)('Update is installed and will be run on the next app restart.');
|
|
74
|
-
} else if (resolvedInstallMode
|
|
75
|
-
if (
|
|
76
|
-
(0, _log.log)(`Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`);
|
|
73
|
+
if (resolvedInstallMode === _InstallModeEnum.InstallMode.ON_NEXT_RESTART) {
|
|
74
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'Update is installed and will be run on the next app restart.');
|
|
75
|
+
} else if (resolvedInstallMode === _InstallModeEnum.InstallMode.ON_NEXT_RESUME) {
|
|
76
|
+
if (syncOptions.minimumBackgroundDuration) {
|
|
77
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, `Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`);
|
|
77
78
|
} else {
|
|
78
|
-
(0, _log.log)('Update is installed and will be run when the app next resumes.');
|
|
79
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'Update is installed and will be run when the app next resumes.');
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
break;
|
|
82
83
|
case _SyncStatusEnum.SyncStatus.UNKNOWN_ERROR:
|
|
83
|
-
(0, _log.log)('An unknown error occurred.');
|
|
84
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.ERROR, 'An unknown error occurred.');
|
|
84
85
|
break;
|
|
85
86
|
}
|
|
86
87
|
};
|
|
@@ -106,7 +107,7 @@ async function syncInternal(options, syncStatusChangeCallback, downloadProgressC
|
|
|
106
107
|
const updateShouldBeIgnored = await (0, _shouldUpdateBeIgnored.shouldUpdateBeIgnored)(remotePackage, syncOptions);
|
|
107
108
|
if (!remotePackage || updateShouldBeIgnored) {
|
|
108
109
|
if (updateShouldBeIgnored) {
|
|
109
|
-
(0, _log.log)('An update is available, but it is being ignored due to having been previously rolled back.');
|
|
110
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'An update is available, but it is being ignored due to having been previously rolled back.');
|
|
110
111
|
}
|
|
111
112
|
const currentPackage = await (0, _getCurrentPackage.getCurrentPackage)();
|
|
112
113
|
if (currentPackage && currentPackage.isPending) {
|
|
@@ -164,14 +165,18 @@ async function syncInternal(options, syncStatusChangeCallback, downloadProgressC
|
|
|
164
165
|
}
|
|
165
166
|
} catch (error) {
|
|
166
167
|
syncStatusChangeCallback(_SyncStatusEnum.SyncStatus.UNKNOWN_ERROR);
|
|
167
|
-
(0, _log.log)(error != null && typeof error === 'object' && 'message' in error && typeof error.message === 'string' ? error.message : 'Unknown');
|
|
168
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.ERROR, error != null && typeof error === 'object' && 'message' in error && typeof error.message === 'string' ? error.message : 'Unknown');
|
|
168
169
|
throw error;
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
/**
|
|
174
|
+
* @function
|
|
175
|
+
*
|
|
173
176
|
* Allows checking for an update, downloading it and installing it, all with a single call.
|
|
174
177
|
*
|
|
178
|
+
* Unless you need custom UI and/or behavior, we recommend most developers to use this method when integrating CodePush into their apps, if they are not using the `withCodePush` HOC.
|
|
179
|
+
*
|
|
175
180
|
* @param options Options used to configure the end-user update experience (e.g. show a prompt?, install the update immediately?).
|
|
176
181
|
* @param syncStatusChangedCallback An optional callback that allows tracking the status of the sync operation, as opposed to simply checking the resolved state via the returned Promise.
|
|
177
182
|
* @param downloadProgressCallback An optional callback that allows tracking the progress of an update while it is being downloaded.
|
|
@@ -185,29 +190,31 @@ const sync = exports.sync = (() => {
|
|
|
185
190
|
const setSyncCompleted = () => {
|
|
186
191
|
syncInProgress = false;
|
|
187
192
|
};
|
|
188
|
-
return (options,
|
|
189
|
-
|
|
193
|
+
return (options, syncStatusChangedCallback, downloadProgressCallback, handleBinaryVersionMismatchCallback) => {
|
|
194
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `sync start`);
|
|
195
|
+
let syncStatusCallbackWithTryCatch = status => {
|
|
196
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `sync status ${_SyncStatusEnum.SyncStatus[status]}`);
|
|
197
|
+
if (typeof syncStatusChangedCallback !== 'function') {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
try {
|
|
201
|
+
syncStatusChangedCallback(status);
|
|
202
|
+
} catch (error) {
|
|
203
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.ERROR, `An error has occurred : ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
190
206
|
let downloadProgressCallbackWithTryCatch;
|
|
191
|
-
if (typeof syncStatusChangeCallback === 'function') {
|
|
192
|
-
syncStatusCallbackWithTryCatch = (...args) => {
|
|
193
|
-
try {
|
|
194
|
-
syncStatusChangeCallback(...args);
|
|
195
|
-
} catch (error) {
|
|
196
|
-
(0, _log.log)(`An error has occurred : ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
207
|
if (typeof downloadProgressCallback === 'function') {
|
|
201
208
|
downloadProgressCallbackWithTryCatch = (...args) => {
|
|
202
209
|
try {
|
|
203
210
|
downloadProgressCallback(...args);
|
|
204
211
|
} catch (error) {
|
|
205
|
-
(0, _log.log)(`An error has occurred: ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
212
|
+
(0, _log.log)(_LogLevelEnum.LogLevel.ERROR, `An error has occurred: ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
206
213
|
}
|
|
207
214
|
};
|
|
208
215
|
}
|
|
209
216
|
if (syncInProgress) {
|
|
210
|
-
typeof syncStatusCallbackWithTryCatch === 'function' ? syncStatusCallbackWithTryCatch(_SyncStatusEnum.SyncStatus.SYNC_IN_PROGRESS) : (0, _log.log)('Sync already in progress.');
|
|
217
|
+
typeof syncStatusCallbackWithTryCatch === 'function' ? syncStatusCallbackWithTryCatch(_SyncStatusEnum.SyncStatus.SYNC_IN_PROGRESS) : (0, _log.log)(_LogLevelEnum.LogLevel.WARN, 'Sync already in progress.');
|
|
211
218
|
return Promise.resolve(_SyncStatusEnum.SyncStatus.SYNC_IN_PROGRESS);
|
|
212
219
|
}
|
|
213
220
|
syncInProgress = true;
|
package/lib/commonjs/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_checkForUpdates","_InstallModeEnum","_SyncStatusEnum","_getCurrentPackage","_shouldUpdateBeIgnored","_log","_notifyAppReady","DEFAULT_UPDATE_DIALOG","exports","appendReleaseDescription","descriptionPrefix","mandatoryContinueButtonLabel","mandatoryUpdateMessage","optionalIgnoreButtonLabel","optionalInstallButtonLabel","optionalUpdateMessage","title","syncInternal","options","syncStatusChangeCallback","downloadProgressCallback","handleBinaryVersionMismatchCallback","resolvedInstallMode","syncOptions","releaseChannelPublicId","undefined","ignoreFailedUpdates","rollbackRetryOptions","installMode","InstallMode","ON_NEXT_RESTART","mandatoryInstallMode","IMMEDIATE","minimumBackgroundDuration","updateDialog","syncStatus","SyncStatus","CHECKING_FOR_UPDATE","log","AWAITING_USER_ACTION","DOWNLOADING_PACKAGE","INSTALLING_UPDATE","UP_TO_DATE","UPDATE_IGNORED","UPDATE_INSTALLED","ON_NEXT_RESUME","UNKNOWN_ERROR","notifyAppReady","remotePackage","checkForUpdate","doDownloadAndInstall","Error","localPackage","download","isMandatory","install","updateShouldBeIgnored","shouldUpdateBeIgnored","currentPackage","getCurrentPackage","isPending","updateDialogConfig","Promise","resolve","reject","message","installButtonText","dialogButtons","push","text","onPress","then","description","Alert","alert","Platform","OS","reverse","error","sync","syncInProgress","setSyncCompleted","syncStatusCallbackWithTryCatch","downloadProgressCallbackWithTryCatch","args","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_checkForUpdates","_InstallModeEnum","_LogLevelEnum","_SyncStatusEnum","_getCurrentPackage","_shouldUpdateBeIgnored","_log","_notifyAppReady","DEFAULT_UPDATE_DIALOG","exports","appendReleaseDescription","descriptionPrefix","mandatoryContinueButtonLabel","mandatoryUpdateMessage","optionalIgnoreButtonLabel","optionalInstallButtonLabel","optionalUpdateMessage","title","syncInternal","options","syncStatusChangeCallback","downloadProgressCallback","handleBinaryVersionMismatchCallback","resolvedInstallMode","syncOptions","releaseChannelPublicId","undefined","ignoreFailedUpdates","rollbackRetryOptions","installMode","InstallMode","ON_NEXT_RESTART","mandatoryInstallMode","IMMEDIATE","minimumBackgroundDuration","updateDialog","syncStatus","SyncStatus","CHECKING_FOR_UPDATE","log","LogLevel","INFO","AWAITING_USER_ACTION","DOWNLOADING_PACKAGE","INSTALLING_UPDATE","UP_TO_DATE","UPDATE_IGNORED","UPDATE_INSTALLED","ON_NEXT_RESUME","UNKNOWN_ERROR","ERROR","notifyAppReady","remotePackage","checkForUpdate","doDownloadAndInstall","Error","localPackage","download","isMandatory","install","updateShouldBeIgnored","shouldUpdateBeIgnored","currentPackage","getCurrentPackage","isPending","updateDialogConfig","Promise","resolve","reject","message","installButtonText","dialogButtons","push","text","onPress","then","description","Alert","alert","Platform","OS","reverse","error","sync","syncInProgress","setSyncCompleted","syncStatusChangedCallback","DEBUG","syncStatusCallbackWithTryCatch","status","stack","downloadProgressCallbackWithTryCatch","args","SYNC_IN_PROGRESS","WARN","syncPromise","catch"],"sourceRoot":"../../src","sources":["sync.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAA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B,KAAK,GAAG2B,KAAK,CAACQ,KAAK,GAAG,SAAS,EAAE,CAAC;MACpG;IACF,CAAC;IAED,IAAIC,oCAA0E;IAC9E,IAAI,OAAOtE,wBAAwB,KAAK,UAAU,EAAE;MAClDsE,oCAAoC,GAAGA,CAAC,GAAGC,IAAI,KAAK;QAClD,IAAI;UACFvE,wBAAwB,CAAC,GAAGuE,IAAI,CAAC;QACnC,CAAC,CAAC,OAAOV,KAAK,EAAE;UACd,IAAA3C,QAAG,EAACC,sBAAQ,CAACU,KAAK,EAAE,0BAA0BgC,KAAK,YAAY3B,KAAK,GAAG2B,KAAK,CAACQ,KAAK,GAAG,SAAS,EAAE,CAAC;QACnG;MACF,CAAC;IACH;IAEA,IAAIN,cAAc,EAAE;MAClB,OAAOI,8BAA8B,KAAK,UAAU,GAChDA,8BAA8B,CAACnD,0BAAU,CAACwD,gBAAgB,CAAC,GAC3D,IAAAtD,QAAG,EAACC,sBAAQ,CAACsD,IAAI,EAAE,2BAA2B,CAAC;MACnD,OAAO5B,OAAO,CAACC,OAAO,CAAC9B,0BAAU,CAACwD,gBAAgB,CAAC;IACrD;IAEAT,cAAc,GAAG,IAAI;IAErB,MAAMW,WAAW,GAAG7E,YAAY,CAC9BC,OAAO,EACPqE,8BAA8B,EAC9BG,oCAAoC,EACpCrE,mCACF,CAAC;IAEDyE,WAAW,CAACpB,IAAI,CAACU,gBAAgB,CAAC,CAACW,KAAK,CAACX,gBAAgB,CAAC;IAE1D,OAAOU,WAAW;EACpB,CAAC;AACH,CAAC,EAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTelemetryEnabled = getTelemetryEnabled;
|
|
7
|
+
exports.setTelemetryEnabled = setTelemetryEnabled;
|
|
8
|
+
var _NativeRNAppZungCodePushModule = require("./internals/NativeRNAppZungCodePushModule.js");
|
|
9
|
+
var _getConfiguration = require("./internals/getConfiguration.js");
|
|
10
|
+
/**
|
|
11
|
+
* Controls telemetry reporting.
|
|
12
|
+
*
|
|
13
|
+
* @param enabled - When false, updates on this device will stop appearing as failed, pending or succeeded in analytics.
|
|
14
|
+
*/
|
|
15
|
+
async function setTelemetryEnabled(enabled) {
|
|
16
|
+
await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.setTelemetryEnabled(enabled);
|
|
17
|
+
await (0, _getConfiguration.reloadCachedConfiguration)();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Gets the current telemetry enabled status.
|
|
22
|
+
*
|
|
23
|
+
* When setTelemetryEnabled has never been enabled, returns the default value set in your configuration.
|
|
24
|
+
*/
|
|
25
|
+
function getTelemetryEnabled() {
|
|
26
|
+
return _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.getTelemetryEnabled();
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_NativeRNAppZungCodePushModule","require","_getConfiguration","setTelemetryEnabled","enabled","NativeRNAppZungCodePushModule","reloadCachedConfiguration","getTelemetryEnabled"],"sourceRoot":"../../src","sources":["telemetry.ts"],"mappings":";;;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,eAAeE,mBAAmBA,CAACC,OAAgB,EAAiB;EACzE,MAAMC,4DAA6B,CAACF,mBAAmB,CAACC,OAAO,CAAC;EAChE,MAAM,IAAAE,2CAAyB,EAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAA,EAAqB;EACtD,OAAOF,4DAA6B,CAACE,mBAAmB,CAAC,CAAC;AAC5D","ignoreList":[]}
|
package/lib/module/CodePush.js
CHANGED
|
@@ -4,18 +4,24 @@ import hoistStatics from 'hoist-non-react-statics';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { AppState } from 'react-native';
|
|
6
6
|
import { CheckFrequency } from "./enums/CheckFrequency.enum.js";
|
|
7
|
+
import { LogLevel } from "./enums/LogLevel.enum.js";
|
|
8
|
+
import { log } from "./internals/utils/log.js";
|
|
7
9
|
import { notifyAppReady } from "./notifyAppReady.js";
|
|
8
10
|
import { sync } from "./sync.js";
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
|
|
14
|
+
*
|
|
15
|
+
* Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
|
|
12
16
|
*
|
|
13
17
|
* @param component the React Component that will be decorated
|
|
14
18
|
*/
|
|
15
19
|
// @ts-ignore
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
22
|
+
* Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
|
|
23
|
+
*
|
|
24
|
+
* Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
|
|
19
25
|
*
|
|
20
26
|
* @param options Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).
|
|
21
27
|
*/
|
|
@@ -29,6 +35,7 @@ export function withCodePush(optionsOrComponent) {
|
|
|
29
35
|
this.rootComponentRef = /*#__PURE__*/React.createRef();
|
|
30
36
|
}
|
|
31
37
|
componentDidMount() {
|
|
38
|
+
log(LogLevel.DEBUG, `withCodePush ${JSON.stringify(options)}`);
|
|
32
39
|
if (options.checkFrequency === CheckFrequency.MANUAL) {
|
|
33
40
|
notifyAppReady();
|
|
34
41
|
} else {
|
|
@@ -45,10 +52,12 @@ export function withCodePush(optionsOrComponent) {
|
|
|
45
52
|
if (rootComponentInstance && rootComponentInstance.codePushOnBinaryVersionMismatch) {
|
|
46
53
|
handleBinaryVersionMismatchCallback = rootComponentInstance.codePushOnBinaryVersionMismatch.bind(rootComponentInstance);
|
|
47
54
|
}
|
|
55
|
+
log(LogLevel.DEBUG, `sync on mount`);
|
|
48
56
|
sync(options, syncStatusCallback, downloadProgressCallback, handleBinaryVersionMismatchCallback);
|
|
49
57
|
if (options.checkFrequency === CheckFrequency.ON_APP_RESUME) {
|
|
50
58
|
AppState.addEventListener('change', newState => {
|
|
51
59
|
if (newState === 'active') {
|
|
60
|
+
log(LogLevel.DEBUG, `sync on active appState`);
|
|
52
61
|
sync(options, syncStatusCallback, downloadProgressCallback);
|
|
53
62
|
}
|
|
54
63
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["hoistStatics","React","AppState","CheckFrequency","notifyAppReady","sync","jsx","_jsx","withCodePush","optionsOrComponent","options","WithCodePush","RootComponent","CodePushComponent","Component","constructor","props","rootComponentRef","createRef","componentDidMount","checkFrequency","MANUAL","rootComponentInstance","current","syncStatusCallback","codePushStatusDidChange","bind","downloadProgressCallback","codePushDownloadDidProgress","handleBinaryVersionMismatchCallback","codePushOnBinaryVersionMismatch","ON_APP_RESUME","addEventListener","newState","render","prototype","ref"],"sourceRoot":"../../src","sources":["CodePush.tsx"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,yBAAyB;AAClD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,gCAA6B;AAC5D,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,IAAI,QAAQ,WAAQ;;
|
|
1
|
+
{"version":3,"names":["hoistStatics","React","AppState","CheckFrequency","LogLevel","log","notifyAppReady","sync","jsx","_jsx","withCodePush","optionsOrComponent","options","WithCodePush","RootComponent","CodePushComponent","Component","constructor","props","rootComponentRef","createRef","componentDidMount","DEBUG","JSON","stringify","checkFrequency","MANUAL","rootComponentInstance","current","syncStatusCallback","codePushStatusDidChange","bind","downloadProgressCallback","codePushDownloadDidProgress","handleBinaryVersionMismatchCallback","codePushOnBinaryVersionMismatch","ON_APP_RESUME","addEventListener","newState","render","prototype","ref"],"sourceRoot":"../../src","sources":["CodePush.tsx"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,yBAAyB;AAClD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,gCAA6B;AAC5D,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASC,GAAG,QAAQ,0BAAuB;AAC3C,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,IAAI,QAAQ,WAAQ;;AAiB7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAWA,OAAO,SAASC,YAAYA,CAAmBC,kBAA4D,EAAE;EAC3G,MAAMC,OAAwB,GAAG,OAAOD,kBAAkB,KAAK,UAAU,GAAG,CAAC,CAAC,GAAGA,kBAAkB;EAEnG,MAAME,YAAY,GAAIC,aAAqC,IAAK;IAC9D,MAAMC,iBAAiB,SAASd,KAAK,CAACe,SAAS,CAAI;MAGjDC,WAAWA,CAACC,KAAY,EAAE;QACxB,KAAK,CAACA,KAAK,CAAC;QACZ,IAAI,CAACC,gBAAgB,gBAAGlB,KAAK,CAACmB,SAAS,CAAC,CAAC;MAC3C;MAEAC,iBAAiBA,CAAA,EAAG;QAClBhB,GAAG,CAACD,QAAQ,CAACkB,KAAK,EAAE,gBAAgBC,IAAI,CAACC,SAAS,CAACZ,OAAO,CAAC,EAAE,CAAC;QAE9D,IAAIA,OAAO,CAACa,cAAc,KAAKtB,cAAc,CAACuB,MAAM,EAAE;UACpDpB,cAAc,CAAC,CAAC;QAClB,CAAC,MAAM;UACL,MAAMqB,qBAAqB,GAAG,IAAI,CAACR,gBAA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,gBAAgB;QACnC;QAEA,oBAAOV,IAAA,CAACK,aAAa;UAAA,GAAKI;QAAK,CAAG,CAAC;MACrC;IACF;IAEA,OAAOlB,YAAY,CAACe,iBAAiB,EAAED,aAAa,CAAC;EACvD,CAAC;EAED,IAAI,OAAOH,kBAAkB,KAAK,UAAU,EAAE;IAC5C;IACA,OAAOE,YAAY,CAACF,kBAAkB,CAAC;EACzC,CAAC,MAAM;IACL,OAAOE,YAAY;EACrB;AACF;AAEA,eAAeH,YAAY","ignoreList":[]}
|
|
@@ -4,6 +4,10 @@ import { NativeRNAppZungCodePushModule } from "./internals/NativeRNAppZungCodePu
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Allow CodePush to restart the app.
|
|
7
|
+
*
|
|
8
|
+
* This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
|
|
7
9
|
*/
|
|
8
|
-
export
|
|
10
|
+
export function allowRestart() {
|
|
11
|
+
return NativeRNAppZungCodePushModule.allow();
|
|
12
|
+
}
|
|
9
13
|
//# sourceMappingURL=allowRestart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeRNAppZungCodePushModule","allowRestart","allow"],"sourceRoot":"../../src","sources":["allowRestart.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;;AAEzF;AACA;AACA;AACA,OAAO,
|
|
1
|
+
{"version":3,"names":["NativeRNAppZungCodePushModule","allowRestart","allow"],"sourceRoot":"../../src","sources":["allowRestart.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;;AAEzF;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAG;EAC7B,OAAOD,6BAA6B,CAACE,KAAK,CAAC,CAAC;AAC9C","ignoreList":[]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
|
+
import { LogLevel } from "./enums/LogLevel.enum.js";
|
|
5
|
+
import { CodePushApiSdk } from "./internals/CodePushApiSdk.js";
|
|
4
6
|
import { NativeRNAppZungCodePushModule } from "./internals/NativeRNAppZungCodePushModule.js";
|
|
5
7
|
import { RemotePackageImpl } from "./internals/RemotePackageImplementation.js";
|
|
6
8
|
import { getConfiguration } from "./internals/getConfiguration.js";
|
|
7
9
|
import { getCurrentPackage } from "./internals/getCurrentPackage.js";
|
|
8
|
-
import { getPromisifiedSdk } from "./internals/getPromisifiedSdk.js";
|
|
9
10
|
import { log } from "./internals/utils/log.js";
|
|
10
|
-
import { requestFetchAdapter } from "./internals/utils/
|
|
11
|
+
import { requestFetchAdapter } from "./internals/utils/requestFetchAdapter.js";
|
|
11
12
|
/**
|
|
12
13
|
* Asks the CodePush service whether the configured app release channel has an update available.
|
|
13
14
|
*
|
|
@@ -34,11 +35,9 @@ export async function checkForUpdate(releaseChannelPublicId, handleBinaryVersion
|
|
|
34
35
|
*/
|
|
35
36
|
const config = releaseChannelPublicId ? {
|
|
36
37
|
...nativeConfig,
|
|
37
|
-
|
|
38
|
-
releaseChannelPublicId
|
|
39
|
-
}
|
|
38
|
+
releaseChannelPublicId
|
|
40
39
|
} : nativeConfig;
|
|
41
|
-
const sdk =
|
|
40
|
+
const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
|
|
42
41
|
const localPackage = await getCurrentPackage();
|
|
43
42
|
|
|
44
43
|
/*
|
|
@@ -49,17 +48,12 @@ export async function checkForUpdate(releaseChannelPublicId, handleBinaryVersion
|
|
|
49
48
|
* to send the app version to the server, since we are interested
|
|
50
49
|
* in any updates for current binary version, regardless of hash.
|
|
51
50
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
if (Platform.OS === 'ios' && config.packageHash) {
|
|
60
|
-
queryPackage.packageHash = config.packageHash;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
51
|
+
const queryPackage = localPackage ?? {
|
|
52
|
+
appVersion: config.appVersion,
|
|
53
|
+
...(Platform.OS === 'ios' && config.packageHash ? {
|
|
54
|
+
packageHash: config.packageHash
|
|
55
|
+
} : {})
|
|
56
|
+
};
|
|
63
57
|
const update = await sdk.queryUpdateWithCurrentPackage(queryPackage);
|
|
64
58
|
|
|
65
59
|
/*
|
|
@@ -83,19 +77,24 @@ export async function checkForUpdate(releaseChannelPublicId, handleBinaryVersion
|
|
|
83
77
|
if (!update) {
|
|
84
78
|
return null;
|
|
85
79
|
}
|
|
86
|
-
if ('updateAppVersion' in update
|
|
87
|
-
|
|
80
|
+
if ('updateAppVersion' in update) {
|
|
81
|
+
if (!update.updateAppVersion) {
|
|
82
|
+
throw new Error('updateAppVersion should never be false');
|
|
83
|
+
}
|
|
84
|
+
log(LogLevel.INFO, 'An update is available but it is not targeting the binary version of your app.');
|
|
88
85
|
handleBinaryVersionMismatchCallback?.(update);
|
|
89
86
|
return null;
|
|
90
87
|
}
|
|
91
|
-
if (localPackage &&
|
|
88
|
+
if (localPackage && update.packageHash === localPackage.packageHash || (!localPackage || '_isDebugOnly' in localPackage && localPackage._isDebugOnly) && config.packageHash === update.packageHash) {
|
|
92
89
|
return null;
|
|
93
90
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
const remotePackageData = {
|
|
92
|
+
...update,
|
|
93
|
+
releaseChannelPublicId: releaseChannelPublicId || nativeConfig.releaseChannelPublicId,
|
|
94
|
+
failedInstall: await NativeRNAppZungCodePushModule.isFailedUpdate(update.packageHash),
|
|
95
|
+
isFirstRun: false,
|
|
96
|
+
isPending: false
|
|
97
|
+
};
|
|
98
|
+
return new RemotePackageImpl(remotePackageData, packageInfo => sdk.reportStatusDownload(packageInfo));
|
|
100
99
|
}
|
|
101
100
|
//# sourceMappingURL=checkForUpdates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","NativeRNAppZungCodePushModule","RemotePackageImpl","getConfiguration","getCurrentPackage","
|
|
1
|
+
{"version":3,"names":["Platform","LogLevel","CodePushApiSdk","NativeRNAppZungCodePushModule","RemotePackageImpl","getConfiguration","getCurrentPackage","log","requestFetchAdapter","checkForUpdate","releaseChannelPublicId","handleBinaryVersionMismatchCallback","nativeConfig","config","sdk","localPackage","queryPackage","appVersion","OS","packageHash","update","queryUpdateWithCurrentPackage","updateAppVersion","Error","INFO","_isDebugOnly","remotePackageData","failedInstall","isFailedUpdate","isFirstRun","isPending","packageInfo","reportStatusDownload"],"sourceRoot":"../../src","sources":["checkForUpdates.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASC,cAAc,QAAQ,+BAA4B;AAE3D,SAASC,6BAA6B,QAAQ,8CAA2C;AACzF,SAASC,iBAAiB,QAAQ,4CAAyC;AAC3E,SAASC,gBAAgB,QAAQ,iCAA8B;AAC/D,SAASC,iBAAiB,QAAQ,kCAA+B;AAEjE,SAASC,GAAG,QAAQ,0BAAuB;AAC3C,SAASC,mBAAmB,QAAQ,0CAAuC;AAG3E;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,cAAcA,CAClCC,sBAA+B,EAC/BC,mCAAyE,EAC1C;EAC/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,YAAY,GAAG,MAAMP,gBAAgB,CAAC,CAAC;EAC7C;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMQ,MAAqB,GAAGH,sBAAsB,GAAG;IAAE,GAAGE,YAAY;IAAEF;EAAuB,CAAC,GAAGE,YAAY;EACjH,MAAME,GAAG,GAAG,IAAIZ,cAAc,CAACM,mBAAmB,EAAED,GAAG,EAAEM,MAAM,CAAC;EAEhE,MAAME,YAAY,GAAG,MAAMT,iBAAiB,CAAC,CAAC;;EAE9C;AACF;AACA;AACA;AACA;AACA;A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AAW,IAAKjB,GAAG,CAACkB,oBAAoB,CAACD,WAAW,CAAC,CAAC;AACzG","ignoreList":[]}
|
|
@@ -4,9 +4,12 @@ import { NativeRNAppZungCodePushModule } from "./internals/NativeRNAppZungCodePu
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Clears all downloaded CodePush updates.
|
|
7
|
+
*
|
|
7
8
|
* This is useful when switching to a different release channel which may have an older release than the current package.
|
|
8
|
-
* Note: we don’t recommend
|
|
9
|
+
* Note: we don’t recommend using this method in scenarios other than that (CodePush will call
|
|
9
10
|
* this method automatically when needed in other cases) as it could lead to unpredictable behavior.
|
|
10
11
|
*/
|
|
11
|
-
export
|
|
12
|
+
export function clearUpdates() {
|
|
13
|
+
return NativeRNAppZungCodePushModule.clearUpdates();
|
|
14
|
+
}
|
|
12
15
|
//# sourceMappingURL=clearUpdates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeRNAppZungCodePushModule","clearUpdates"],"sourceRoot":"../../src","sources":["clearUpdates.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,
|
|
1
|
+
{"version":3,"names":["NativeRNAppZungCodePushModule","clearUpdates"],"sourceRoot":"../../src","sources":["clearUpdates.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAG;EAC7B,OAAOD,6BAA6B,CAACC,YAAY,CAAC,CAAC;AACrD","ignoreList":[]}
|