@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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export async function fetchRetry(url, options = {}, attempt = 0) {
|
|
4
|
+
const {
|
|
5
|
+
maxRetries = 3,
|
|
6
|
+
initialBackoff = 1000,
|
|
7
|
+
backoffMultiplier = 2,
|
|
8
|
+
maxRetryDelay = 30000,
|
|
9
|
+
...fetchOptions
|
|
10
|
+
} = options;
|
|
11
|
+
try {
|
|
12
|
+
const response = await fetch(url, fetchOptions);
|
|
13
|
+
if (response.ok || !(response.status === 429 || response.status >= 500)) {
|
|
14
|
+
return response;
|
|
15
|
+
}
|
|
16
|
+
if (attempt >= maxRetries) {
|
|
17
|
+
return response;
|
|
18
|
+
}
|
|
19
|
+
const retryAfter = parseRetryAfterHeader(response);
|
|
20
|
+
if (retryAfter && retryAfter > maxRetryDelay) {
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
const delay = retryAfter ?? addJitter(initialBackoff * Math.pow(backoffMultiplier, attempt));
|
|
24
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
25
|
+
return fetchRetry(url, options, attempt + 1);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (attempt >= maxRetries) {
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
const delay = addJitter(initialBackoff * Math.pow(backoffMultiplier, attempt));
|
|
31
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
32
|
+
return fetchRetry(url, options, attempt + 1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function parseRetryAfterHeader(response) {
|
|
36
|
+
const retryAfter = response.headers.get('Retry-After');
|
|
37
|
+
if (!retryAfter) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
if (!isNaN(Number(retryAfter))) {
|
|
41
|
+
return parseInt(retryAfter, 10) * 1000;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const retryDate = new Date(retryAfter).getTime();
|
|
45
|
+
const now = Date.now();
|
|
46
|
+
return retryDate > now ? retryDate - now : 0;
|
|
47
|
+
} catch (e) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function addJitter(delay) {
|
|
52
|
+
const jitterFactor = 0.5 + Math.random() * 0.5;
|
|
53
|
+
return Math.floor(delay * jitterFactor);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=fetchRetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fetchRetry","url","options","attempt","maxRetries","initialBackoff","backoffMultiplier","maxRetryDelay","fetchOptions","response","fetch","ok","status","retryAfter","parseRetryAfterHeader","delay","addJitter","Math","pow","Promise","resolve","setTimeout","error","headers","get","isNaN","Number","parseInt","retryDate","Date","getTime","now","e","jitterFactor","random","floor"],"sourceRoot":"../../../../src","sources":["internals/utils/fetchRetry.ts"],"mappings":";;AAAA,OAAO,eAAeA,UAAUA,CAACC,GAAW,EAAEC,OAA0B,GAAG,CAAC,CAAC,EAAEC,OAAO,GAAG,CAAC,EAAqB;EAC7G,MAAM;IACJC,UAAU,GAAG,CAAC;IACdC,cAAc,GAAG,IAAI;IACrBC,iBAAiB,GAAG,CAAC;IACrBC,aAAa,GAAG,KAAK;IACrB,GAAGC;EACL,CAAC,GAAGN,OAAO;EAEX,IAAI;IACF,MAAMO,QAAQ,GAAG,MAAMC,KAAK,CAACT,GAAG,EAAEO,YAAY,CAAC;IAC/C,IAAIC,QAAQ,CAACE,EAAE,IAAI,EAAEF,QAAQ,CAACG,MAAM,KAAK,GAAG,IAAIH,QAAQ,CAACG,MAAM,IAAI,GAAG,CAAC,EAAE;MACvE,OAAOH,QAAQ;IACjB;IAEA,IAAIN,OAAO,IAAIC,UAAU,EAAE;MACzB,OAAOK,QAAQ;IACjB;IAEA,MAAMI,UAAU,GAAGC,qBAAqB,CAACL,QAAQ,CAAC;IAClD,IAAII,UAAU,IAAIA,UAAU,GAAGN,aAAa,EAAE;MAC5C,OAAOE,QAAQ;IACjB;IAEA,MAAMM,KAAK,GAAGF,UAAU,IAAIG,SAAS,CAACX,cAAc,GAAGY,IAAI,CAACC,GAAG,CAACZ,iBAAiB,EAAEH,OAAO,CAAC,CAAC;IAE5F,MAAM,IAAIgB,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAEL,KAAK,CAAC,CAAC;IA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AGkB,YAAY,CAAC;AACzC","ignoreList":[]}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { getLogLevel } from "../../logLevel.js";
|
|
4
|
+
import { getLogger } from "../logger.js";
|
|
5
|
+
|
|
6
|
+
/* Logs messages using the configured logger */
|
|
7
|
+
export function log(level, message) {
|
|
8
|
+
const currentLogLevel = getLogLevel();
|
|
9
|
+
if (level < currentLogLevel) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const logger = getLogger();
|
|
13
|
+
logger(level, message);
|
|
6
14
|
}
|
|
7
15
|
//# sourceMappingURL=log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["log","message","
|
|
1
|
+
{"version":3,"names":["getLogLevel","getLogger","log","level","message","currentLogLevel","logger"],"sourceRoot":"../../../../src","sources":["internals/utils/log.ts"],"mappings":";;AACA,SAASA,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,SAAS,QAAQ,cAAW;;AAErC;AACA,OAAO,SAASC,GAAGA,CAACC,KAAe,EAAEC,OAAe,EAAQ;EAC1D,MAAMC,eAAe,GAAGL,WAAW,CAAC,CAAC;EACrC,IAAIG,KAAK,GAAGE,eAAe,EAAE;IAC3B;EACF;EAEA,MAAMC,MAAM,GAAGL,SAAS,CAAC,CAAC;EAC1BK,MAAM,CAACH,KAAK,EAAEC,OAAO,CAAC;AACxB","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function queryStringify(object) {
|
|
4
|
+
let queryString = '';
|
|
5
|
+
let isFirst = true;
|
|
6
|
+
for (const property in object) {
|
|
7
|
+
if (object.hasOwnProperty(property)) {
|
|
8
|
+
const value = object[property];
|
|
9
|
+
if (value !== null && typeof value !== 'undefined') {
|
|
10
|
+
if (!isFirst) {
|
|
11
|
+
queryString += '&';
|
|
12
|
+
}
|
|
13
|
+
queryString += encodeURIComponent(property) + '=';
|
|
14
|
+
queryString += encodeURIComponent(value);
|
|
15
|
+
}
|
|
16
|
+
isFirst = false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return queryString;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=queryStringify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["queryStringify","object","queryString","isFirst","property","hasOwnProperty","value","encodeURIComponent"],"sourceRoot":"../../../../src","sources":["internals/utils/queryStringify.ts"],"mappings":";;AAAA,OAAO,SAASA,cAAcA,CAACC,MAA8B,EAAU;EACrE,IAAIC,WAAW,GAAG,EAAE;EACpB,IAAIC,OAAO,GAAG,IAAI;EAElB,KAAK,MAAMC,QAAQ,IAAIH,MAAM,EAAE;IAC7B,IAAIA,MAAM,CAACI,cAAc,CAACD,QAAQ,CAAC,EAAE;MACnC,MAAME,KAAK,GAAGL,MAAM,CAACG,QAAQ,CAAC;MAC9B,IAAIE,KAAK,KAAK,IAAI,IAAI,OAAOA,KAAK,KAAK,WAAW,EAAE;QAClD,IAAI,CAACH,OAAO,EAAE;UACZD,WAAW,IAAI,GAAG;QACpB;QAEAA,WAAW,IAAIK,kBAAkB,CAACH,QAAQ,CAAC,GAAG,GAAG;QACjDF,WAAW,IAAIK,kBAAkB,CAACD,KAAK,CAAC;MAC1C;MAEAH,OAAO,GAAG,KAAK;IACjB;EACF;EAEA,OAAOD,WAAW;AACpB","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { LogLevel } from "../../enums/LogLevel.enum.js";
|
|
4
|
+
import { version } from "../version.js";
|
|
5
|
+
import { fetchRetry } from "./fetchRetry.js";
|
|
6
|
+
import { log } from "./log.js";
|
|
7
|
+
export const requestFetchAdapter = {
|
|
8
|
+
async request(method, url, requestBody) {
|
|
9
|
+
const headers = {
|
|
10
|
+
Accept: 'application/json',
|
|
11
|
+
'Content-Type': 'application/json',
|
|
12
|
+
'X-CodePush-Plugin-Name': '@appzung/react-native-code-push',
|
|
13
|
+
'X-CodePush-Plugin-Version': version
|
|
14
|
+
};
|
|
15
|
+
if (requestBody && typeof requestBody === 'object') {
|
|
16
|
+
requestBody = JSON.stringify(requestBody);
|
|
17
|
+
}
|
|
18
|
+
const requestId = Math.round(Math.random() * 10000);
|
|
19
|
+
log(LogLevel.DEBUG, `[${requestId}] Will fetch ${method} ${url}`);
|
|
20
|
+
const response = await fetchRetry(url, {
|
|
21
|
+
method,
|
|
22
|
+
headers,
|
|
23
|
+
body: requestBody
|
|
24
|
+
});
|
|
25
|
+
const statusCode = response.status;
|
|
26
|
+
log(LogLevel.DEBUG, `[${requestId}] Done fetching with status code ${statusCode}`);
|
|
27
|
+
const body = await response.text();
|
|
28
|
+
return {
|
|
29
|
+
statusCode,
|
|
30
|
+
body
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=requestFetchAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LogLevel","version","fetchRetry","log","requestFetchAdapter","request","method","url","requestBody","headers","Accept","JSON","stringify","requestId","Math","round","random","DEBUG","response","body","statusCode","status","text"],"sourceRoot":"../../../../src","sources":["internals/utils/requestFetchAdapter.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,8BAA2B;AAEpD,SAASC,OAAO,QAAQ,eAAY;AACpC,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,GAAG,QAAQ,UAAO;AAE3B,OAAO,MAAMC,mBAAmC,GAAG;EACjD,MAAMC,OAAOA,CAACC,MAAM,EAAEC,GAAG,EAAEC,WAAW,EAAE;IACtC,MAAMC,OAAO,GAAG;MACdC,MAAM,EAAE,kBAAkB;MAC1B,cAAc,EAAE,kBAAkB;MAClC,wBAAwB,EAAE,iCAAiC;MAC3D,2BAA2B,EAAET;IAC/B,CAAC;IAED,IAAIO,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;MAClDA,WAAW,GAAGG,IAAI,CAACC,SAAS,CAACJ,WAAW,CAAC;IAC3C;IAEA,MAAMK,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC;IACnDb,GAAG,CAACH,QAAQ,CAACiB,KAAK,EAAE,IAAIJ,SAAS,gBAAgBP,MAAM,IAAIC,GAAG,EAAE,CAAC;IAEjE,MAAMW,QAAQ,GAAG,MAAMhB,UAAU,CAACK,GAAG,EAAE;MACrCD,MAAM;MACNG,OAAO;MACPU,IAAI,EAAEX;IACR,CAAC,CAAC;IAEF,MAAMY,UAAU,GAAGF,QAAQ,CAACG,MAAM;IAElClB,GAAG,CAACH,QAAQ,CAACiB,KAAK,EAAE,IAAIJ,SAAS,oCAAoCO,UAAU,EAAE,CAAC;IAElF,MAAMD,IAAI,GAAG,MAAMD,QAAQ,CAACI,IAAI,CAAC,CAAC;IAClC,OAAO;MAAEF,UAAU;MAAED;IAAK,CAAC;EAC7B;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"names":["version"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LogLevel","logLevel","INFO","setLogLevel","level","getLogLevel"],"sourceRoot":"../../src","sources":["logLevel.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,0BAAuB;AAEhD,IAAIC,QAAQ,GAAGD,QAAQ,CAACE,IAAI;AAE5B,OAAO,MAAMC,WAAW,GAAIC,KAAe,IAAK;EAC9CH,QAAQ,GAAGG,KAAK;AAClB,CAAC;AAED,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAMJ,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["setLogger","resetLogger"],"sourceRoot":"../../src","sources":["logger.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,WAAW,QAAQ,uBAAoB","ignoreList":[]}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { AppState } 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 { getConfiguration } from "./internals/getConfiguration.js";
|
|
6
|
-
import { getPromisifiedSdk } from "./internals/getPromisifiedSdk.js";
|
|
7
8
|
import { log } from "./internals/utils/log.js";
|
|
8
|
-
import { requestFetchAdapter } from "./internals/utils/
|
|
9
|
+
import { requestFetchAdapter } from "./internals/utils/requestFetchAdapter.js";
|
|
9
10
|
/**
|
|
11
|
+
* @function
|
|
12
|
+
*
|
|
10
13
|
* Notifies the CodePush runtime that an installed update is considered successful.
|
|
14
|
+
*
|
|
15
|
+
* 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.
|
|
11
16
|
*/
|
|
12
17
|
export const notifyAppReady = (() => {
|
|
13
18
|
// This ensures that notifyApplicationReadyInternal is only called once
|
|
@@ -21,46 +26,51 @@ export const notifyAppReady = (() => {
|
|
|
21
26
|
};
|
|
22
27
|
})();
|
|
23
28
|
async function notifyApplicationReadyInternal() {
|
|
29
|
+
log(LogLevel.DEBUG, 'notifyApplicationReady');
|
|
24
30
|
await NativeRNAppZungCodePushModule.notifyApplicationReady();
|
|
25
31
|
const statusReport = await NativeRNAppZungCodePushModule.getNewStatusReport();
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
if (statusReport) {
|
|
33
|
+
log(LogLevel.DEBUG, `tryReportStatus ${statusReport.status || '(no update)'}`);
|
|
34
|
+
tryReportStatus(statusReport); // Don't wait for this to complete.
|
|
35
|
+
} else {
|
|
36
|
+
log(LogLevel.DEBUG, `Nothing to report`);
|
|
37
|
+
}
|
|
28
38
|
return statusReport;
|
|
29
39
|
}
|
|
30
40
|
async function tryReportStatus(statusReport, retryOnAppResume) {
|
|
31
41
|
const config = await getConfiguration();
|
|
32
|
-
const previousLabelOrAppVersion = statusReport.previousLabelOrAppVersion;
|
|
42
|
+
const previousLabelOrAppVersion = statusReport.previousLabelOrAppVersion ?? null;
|
|
33
43
|
const previousReleaseChannelPublicId = statusReport.previousReleaseChannelPublicId || config.releaseChannelPublicId;
|
|
34
44
|
try {
|
|
35
45
|
if (statusReport.appVersion) {
|
|
36
|
-
log(`Reporting binary update (${statusReport.appVersion})`);
|
|
46
|
+
log(LogLevel.INFO, `Reporting binary update (${statusReport.appVersion})`);
|
|
37
47
|
if (!config.releaseChannelPublicId) {
|
|
38
48
|
throw new Error('Release channel is missing');
|
|
39
49
|
}
|
|
40
|
-
const sdk =
|
|
41
|
-
await sdk.reportStatusDeploy(
|
|
50
|
+
const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
|
|
51
|
+
await sdk.reportStatusDeploy(null, previousLabelOrAppVersion, previousReleaseChannelPublicId);
|
|
42
52
|
} else {
|
|
43
53
|
if (!statusReport.package) {
|
|
44
54
|
throw new Error('Missing package in status report');
|
|
45
55
|
}
|
|
46
56
|
const label = statusReport.package.label;
|
|
47
57
|
if (statusReport.status === 'DeploymentSucceeded') {
|
|
48
|
-
log(`Reporting CodePush update success (${label})`);
|
|
58
|
+
log(LogLevel.INFO, `Reporting CodePush update success (${label})`);
|
|
49
59
|
} else {
|
|
50
|
-
log(`Reporting CodePush update rollback (${label})`);
|
|
60
|
+
log(LogLevel.INFO, `Reporting CodePush update rollback (${label})`);
|
|
51
61
|
await NativeRNAppZungCodePushModule.setLatestRollbackInfo(statusReport.package.packageHash);
|
|
52
62
|
}
|
|
53
63
|
config.releaseChannelPublicId = statusReport.package.releaseChannelPublicId;
|
|
54
|
-
const sdk =
|
|
64
|
+
const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
|
|
55
65
|
await sdk.reportStatusDeploy({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
66
|
+
package: statusReport.package,
|
|
67
|
+
status: statusReport.status
|
|
68
|
+
}, previousLabelOrAppVersion, previousReleaseChannelPublicId);
|
|
59
69
|
}
|
|
60
70
|
NativeRNAppZungCodePushModule.recordStatusReported(statusReport);
|
|
61
71
|
retryOnAppResume && retryOnAppResume.remove();
|
|
62
72
|
} catch (e) {
|
|
63
|
-
log(`Report status failed: ${JSON.stringify(statusReport)}`);
|
|
73
|
+
log(LogLevel.WARN, `Report status failed: ${JSON.stringify(statusReport)}`);
|
|
64
74
|
NativeRNAppZungCodePushModule.saveStatusReportForRetry(statusReport);
|
|
65
75
|
// Try again when the app resumes
|
|
66
76
|
if (!retryOnAppResume) {
|
|
@@ -68,6 +78,7 @@ async function tryReportStatus(statusReport, retryOnAppResume) {
|
|
|
68
78
|
if (newState !== 'active') return;
|
|
69
79
|
const refreshedStatusReport = await NativeRNAppZungCodePushModule.getNewStatusReport();
|
|
70
80
|
if (refreshedStatusReport) {
|
|
81
|
+
log(LogLevel.DEBUG, `tryReportStatus on active appState ${statusReport.status || '(no update)'}`);
|
|
71
82
|
tryReportStatus(refreshedStatusReport, resumeListener);
|
|
72
83
|
} else {
|
|
73
84
|
resumeListener && resumeListener.remove();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AppState","
|
|
1
|
+
{"version":3,"names":["AppState","LogLevel","CodePushApiSdk","NativeRNAppZungCodePushModule","getConfiguration","log","requestFetchAdapter","notifyAppReady","notifyApplicationReadyPromise","notifyApplicationReadyInternal","DEBUG","notifyApplicationReady","statusReport","getNewStatusReport","status","tryReportStatus","retryOnAppResume","config","previousLabelOrAppVersion","previousReleaseChannelPublicId","releaseChannelPublicId","appVersion","INFO","Error","sdk","reportStatusDeploy","package","label","setLatestRollbackInfo","packageHash","recordStatusReported","remove","e","WARN","JSON","stringify","saveStatusReportForRetry","resumeListener","addEventListener","newState","refreshedStatusReport"],"sourceRoot":"../../src","sources":["notifyAppReady.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAsC,cAAc;AACrE,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,6BAA6B,QAAQ,8CAA2C;AACzF,SAASC,gBAAgB,QAAQ,iCAA8B;AAC/D,SAASC,GAAG,QAAQ,0BAAuB;AAC3C,SAASC,mBAAmB,QAAQ,0CAAuC;AAG3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,CAAC,MAAM;EACnC;EACA;EACA,IAAIC,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;EAC9CJ,GAAG,CAACJ,QAAQ,CAACS,KAAK,EAAE,wBAAwB,CAAC;EAE7C,MAAMP,6BAA6B,CAACQ,sBAAsB,CAAC,CAAC;EAC5D,MAAMC,YAAY,GAAG,MAAMT,6BAA6B,CAACU,kBAAkB,CAAC,CAAC;EAC7E,IAAID,YAAY,EAAE;IAChBP,GAAG,CAACJ,QAAQ,CAACS,KAAK,EAAE,mBAAmBE,YAAY,CAACE,MAAM,IAAI,aAAa,EAAE,CAAC;IAE9EC,eAAe,CAACH,YAAY,CAAC,CAAC,CAAC;EACjC,CAAC,MAAM;IACLP,GAAG,CAACJ,QA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ungCodePushModule.js";
|
|
4
|
+
import { reloadCachedConfiguration } from "./internals/getConfiguration.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 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.
|
|
8
|
+
*/
|
|
9
|
+
export const resetClientUniqueId = async () => {
|
|
10
|
+
const newId = await NativeRNAppZungCodePushModule.resetClientUniqueId();
|
|
11
|
+
await reloadCachedConfiguration();
|
|
12
|
+
return newId;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=resetClientUniqueId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeRNAppZungCodePushModule","reloadCachedConfiguration","resetClientUniqueId","newId"],"sourceRoot":"../../src","sources":["resetClientUniqueId.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;AACzF,SAASC,yBAAyB,QAAQ,iCAA8B;;AAExE;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,MAAAA,CAAA,KAAY;EAC7C,MAAMC,KAAK,GAAG,MAAMH,6BAA6B,CAACE,mBAAmB,CAAC,CAAC;EACvE,MAAMD,yBAAyB,CAAC,CAAC;EACjC,OAAOE,KAAK;AACd,CAAC","ignoreList":[]}
|
package/lib/module/restartApp.js
CHANGED
|
@@ -5,9 +5,11 @@ import { NativeRNAppZungCodePushModule } from "./internals/NativeRNAppZungCodePu
|
|
|
5
5
|
/**
|
|
6
6
|
* Immediately restarts the app.
|
|
7
7
|
*
|
|
8
|
+
* 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.
|
|
9
|
+
*
|
|
8
10
|
* @param onlyIfUpdateIsPending Indicates whether you want the restart to no-op if there isn't currently a pending update.
|
|
9
11
|
*/
|
|
10
|
-
export
|
|
11
|
-
NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
|
|
12
|
+
export function restartApp(onlyIfUpdateIsPending = false) {
|
|
13
|
+
return NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=restartApp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeRNAppZungCodePushModule","restartApp","onlyIfUpdateIsPending"],"sourceRoot":"../../src","sources":["restartApp.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;;AAEzF;AACA;AACA;AACA;AACA;AACA,OAAO,
|
|
1
|
+
{"version":3,"names":["NativeRNAppZungCodePushModule","restartApp","onlyIfUpdateIsPending"],"sourceRoot":"../../src","sources":["restartApp.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,qBAAqB,GAAG,KAAK,EAAE;EACxD,OAAOF,6BAA6B,CAACC,UAAU,CAACC,qBAAqB,CAAC;AACxE","ignoreList":[]}
|
package/lib/module/sync.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Alert, Platform } from 'react-native';
|
|
4
4
|
import { checkForUpdate } from "./checkForUpdates.js";
|
|
5
5
|
import { InstallMode } from "./enums/InstallMode.enum.js";
|
|
6
|
+
import { LogLevel } from "./enums/LogLevel.enum.js";
|
|
6
7
|
import { SyncStatus } from "./enums/SyncStatus.enum.js";
|
|
7
8
|
import { getCurrentPackage } from "./internals/getCurrentPackage.js";
|
|
8
9
|
import { shouldUpdateBeIgnored } from "./internals/shouldUpdateBeIgnored.js";
|
|
@@ -47,36 +48,36 @@ async function syncInternal(options, syncStatusChangeCallback, downloadProgressC
|
|
|
47
48
|
syncStatusChangeCallback = typeof syncStatusChangeCallback === 'function' ? syncStatusChangeCallback : syncStatus => {
|
|
48
49
|
switch (syncStatus) {
|
|
49
50
|
case SyncStatus.CHECKING_FOR_UPDATE:
|
|
50
|
-
log('Checking for update.');
|
|
51
|
+
log(LogLevel.INFO, 'Checking for update.');
|
|
51
52
|
break;
|
|
52
53
|
case SyncStatus.AWAITING_USER_ACTION:
|
|
53
|
-
log('Awaiting user action.');
|
|
54
|
+
log(LogLevel.INFO, 'Awaiting user action.');
|
|
54
55
|
break;
|
|
55
56
|
case SyncStatus.DOWNLOADING_PACKAGE:
|
|
56
|
-
log('Downloading package.');
|
|
57
|
+
log(LogLevel.INFO, 'Downloading package.');
|
|
57
58
|
break;
|
|
58
59
|
case SyncStatus.INSTALLING_UPDATE:
|
|
59
|
-
log('Installing update.');
|
|
60
|
+
log(LogLevel.INFO, 'Installing update.');
|
|
60
61
|
break;
|
|
61
62
|
case SyncStatus.UP_TO_DATE:
|
|
62
|
-
log('App is up to date.');
|
|
63
|
+
log(LogLevel.INFO, 'App is up to date.');
|
|
63
64
|
break;
|
|
64
65
|
case SyncStatus.UPDATE_IGNORED:
|
|
65
|
-
log('User cancelled the update.');
|
|
66
|
+
log(LogLevel.INFO, 'User cancelled the update.');
|
|
66
67
|
break;
|
|
67
68
|
case SyncStatus.UPDATE_INSTALLED:
|
|
68
|
-
if (resolvedInstallMode
|
|
69
|
-
log('Update is installed and will be run on the next app restart.');
|
|
70
|
-
} else if (resolvedInstallMode
|
|
71
|
-
if (
|
|
72
|
-
log(`Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`);
|
|
69
|
+
if (resolvedInstallMode === InstallMode.ON_NEXT_RESTART) {
|
|
70
|
+
log(LogLevel.INFO, 'Update is installed and will be run on the next app restart.');
|
|
71
|
+
} else if (resolvedInstallMode === InstallMode.ON_NEXT_RESUME) {
|
|
72
|
+
if (syncOptions.minimumBackgroundDuration) {
|
|
73
|
+
log(LogLevel.INFO, `Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`);
|
|
73
74
|
} else {
|
|
74
|
-
log('Update is installed and will be run when the app next resumes.');
|
|
75
|
+
log(LogLevel.INFO, 'Update is installed and will be run when the app next resumes.');
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
break;
|
|
78
79
|
case SyncStatus.UNKNOWN_ERROR:
|
|
79
|
-
log('An unknown error occurred.');
|
|
80
|
+
log(LogLevel.ERROR, 'An unknown error occurred.');
|
|
80
81
|
break;
|
|
81
82
|
}
|
|
82
83
|
};
|
|
@@ -102,7 +103,7 @@ async function syncInternal(options, syncStatusChangeCallback, downloadProgressC
|
|
|
102
103
|
const updateShouldBeIgnored = await shouldUpdateBeIgnored(remotePackage, syncOptions);
|
|
103
104
|
if (!remotePackage || updateShouldBeIgnored) {
|
|
104
105
|
if (updateShouldBeIgnored) {
|
|
105
|
-
log('An update is available, but it is being ignored due to having been previously rolled back.');
|
|
106
|
+
log(LogLevel.INFO, 'An update is available, but it is being ignored due to having been previously rolled back.');
|
|
106
107
|
}
|
|
107
108
|
const currentPackage = await getCurrentPackage();
|
|
108
109
|
if (currentPackage && currentPackage.isPending) {
|
|
@@ -160,14 +161,18 @@ async function syncInternal(options, syncStatusChangeCallback, downloadProgressC
|
|
|
160
161
|
}
|
|
161
162
|
} catch (error) {
|
|
162
163
|
syncStatusChangeCallback(SyncStatus.UNKNOWN_ERROR);
|
|
163
|
-
log(error != null && typeof error === 'object' && 'message' in error && typeof error.message === 'string' ? error.message : 'Unknown');
|
|
164
|
+
log(LogLevel.ERROR, error != null && typeof error === 'object' && 'message' in error && typeof error.message === 'string' ? error.message : 'Unknown');
|
|
164
165
|
throw error;
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
/**
|
|
170
|
+
* @function
|
|
171
|
+
*
|
|
169
172
|
* Allows checking for an update, downloading it and installing it, all with a single call.
|
|
170
173
|
*
|
|
174
|
+
* 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.
|
|
175
|
+
*
|
|
171
176
|
* @param options Options used to configure the end-user update experience (e.g. show a prompt?, install the update immediately?).
|
|
172
177
|
* @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.
|
|
173
178
|
* @param downloadProgressCallback An optional callback that allows tracking the progress of an update while it is being downloaded.
|
|
@@ -181,29 +186,31 @@ export const sync = (() => {
|
|
|
181
186
|
const setSyncCompleted = () => {
|
|
182
187
|
syncInProgress = false;
|
|
183
188
|
};
|
|
184
|
-
return (options,
|
|
185
|
-
|
|
189
|
+
return (options, syncStatusChangedCallback, downloadProgressCallback, handleBinaryVersionMismatchCallback) => {
|
|
190
|
+
log(LogLevel.DEBUG, `sync start`);
|
|
191
|
+
let syncStatusCallbackWithTryCatch = status => {
|
|
192
|
+
log(LogLevel.DEBUG, `sync status ${SyncStatus[status]}`);
|
|
193
|
+
if (typeof syncStatusChangedCallback !== 'function') {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
syncStatusChangedCallback(status);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
log(LogLevel.ERROR, `An error has occurred : ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
200
|
+
}
|
|
201
|
+
};
|
|
186
202
|
let downloadProgressCallbackWithTryCatch;
|
|
187
|
-
if (typeof syncStatusChangeCallback === 'function') {
|
|
188
|
-
syncStatusCallbackWithTryCatch = (...args) => {
|
|
189
|
-
try {
|
|
190
|
-
syncStatusChangeCallback(...args);
|
|
191
|
-
} catch (error) {
|
|
192
|
-
log(`An error has occurred : ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
203
|
if (typeof downloadProgressCallback === 'function') {
|
|
197
204
|
downloadProgressCallbackWithTryCatch = (...args) => {
|
|
198
205
|
try {
|
|
199
206
|
downloadProgressCallback(...args);
|
|
200
207
|
} catch (error) {
|
|
201
|
-
log(`An error has occurred: ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
208
|
+
log(LogLevel.ERROR, `An error has occurred: ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
202
209
|
}
|
|
203
210
|
};
|
|
204
211
|
}
|
|
205
212
|
if (syncInProgress) {
|
|
206
|
-
typeof syncStatusCallbackWithTryCatch === 'function' ? syncStatusCallbackWithTryCatch(SyncStatus.SYNC_IN_PROGRESS) : log('Sync already in progress.');
|
|
213
|
+
typeof syncStatusCallbackWithTryCatch === 'function' ? syncStatusCallbackWithTryCatch(SyncStatus.SYNC_IN_PROGRESS) : log(LogLevel.WARN, 'Sync already in progress.');
|
|
207
214
|
return Promise.resolve(SyncStatus.SYNC_IN_PROGRESS);
|
|
208
215
|
}
|
|
209
216
|
syncInProgress = true;
|
package/lib/module/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Alert","Platform","checkForUpdate","InstallMode","SyncStatus","getCurrentPackage","shouldUpdateBeIgnored","log","notifyAppReady","DEFAULT_UPDATE_DIALOG","appendReleaseDescription","descriptionPrefix","mandatoryContinueButtonLabel","mandatoryUpdateMessage","optionalIgnoreButtonLabel","optionalInstallButtonLabel","optionalUpdateMessage","title","syncInternal","options","syncStatusChangeCallback","downloadProgressCallback","handleBinaryVersionMismatchCallback","resolvedInstallMode","syncOptions","releaseChannelPublicId","undefined","ignoreFailedUpdates","rollbackRetryOptions","installMode","ON_NEXT_RESTART","mandatoryInstallMode","IMMEDIATE","minimumBackgroundDuration","updateDialog","syncStatus","CHECKING_FOR_UPDATE","AWAITING_USER_ACTION","DOWNLOADING_PACKAGE","INSTALLING_UPDATE","UP_TO_DATE","UPDATE_IGNORED","UPDATE_INSTALLED","ON_NEXT_RESUME","UNKNOWN_ERROR","remotePackage","doDownloadAndInstall","Error","localPackage","download","isMandatory","install","updateShouldBeIgnored","currentPackage","isPending","updateDialogConfig","Promise","resolve","reject","message","installButtonText","dialogButtons","push","text","onPress","then","description","alert","OS","reverse","error","sync","syncInProgress","setSyncCompleted","syncStatusCallbackWithTryCatch","downloadProgressCallbackWithTryCatch","args","
|
|
1
|
+
{"version":3,"names":["Alert","Platform","checkForUpdate","InstallMode","LogLevel","SyncStatus","getCurrentPackage","shouldUpdateBeIgnored","log","notifyAppReady","DEFAULT_UPDATE_DIALOG","appendReleaseDescription","descriptionPrefix","mandatoryContinueButtonLabel","mandatoryUpdateMessage","optionalIgnoreButtonLabel","optionalInstallButtonLabel","optionalUpdateMessage","title","syncInternal","options","syncStatusChangeCallback","downloadProgressCallback","handleBinaryVersionMismatchCallback","resolvedInstallMode","syncOptions","releaseChannelPublicId","undefined","ignoreFailedUpdates","rollbackRetryOptions","installMode","ON_NEXT_RESTART","mandatoryInstallMode","IMMEDIATE","minimumBackgroundDuration","updateDialog","syncStatus","CHECKING_FOR_UPDATE","INFO","AWAITING_USER_ACTION","DOWNLOADING_PACKAGE","INSTALLING_UPDATE","UP_TO_DATE","UPDATE_IGNORED","UPDATE_INSTALLED","ON_NEXT_RESUME","UNKNOWN_ERROR","ERROR","remotePackage","doDownloadAndInstall","Error","localPackage","download","isMandatory","install","updateShouldBeIgnored","currentPackage","isPending","updateDialogConfig","Promise","resolve","reject","message","installButtonText","dialogButtons","push","text","onPress","then","description","alert","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,SAASA,KAAK,EAAoBC,QAAQ,QAAQ,cAAc;AAChE,SAASC,cAAc,QAAQ,sBAAmB;AAClD,SAASC,WAAW,QAAQ,6BAA0B;AACtD,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASC,UAAU,QAAQ,4BAAyB;AACpD,SAASC,iBAAiB,QAAQ,kCAA+B;AACjE,SAASC,qBAAqB,QAAQ,sCAAmC;AACzE,SAASC,GAAG,QAAQ,0BAAuB;AAC3C,SAASC,cAAc,QAAQ,qBAAkB;AASjD;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAmC,GAA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AAI,CAAC;QACnC,CAAC,CAAC,OAAOV,KAAK,EAAE;UACdjE,GAAG,CAACJ,QAAQ,CAAC2C,KAAK,EAAE,0BAA0B0B,KAAK,YAAYvB,KAAK,GAAGuB,KAAK,CAACQ,KAAK,GAAG,SAAS,EAAE,CAAC;QACnG;MACF,CAAC;IACH;IAEA,IAAIN,cAAc,EAAE;MAClB,OAAOI,8BAA8B,KAAK,UAAU,GAChDA,8BAA8B,CAAC1E,UAAU,CAAC+E,gBAAgB,CAAC,GAC3D5E,GAAG,CAACJ,QAAQ,CAACiF,IAAI,EAAE,2BAA2B,CAAC;MACnD,OAAO1B,OAAO,CAACC,OAAO,CAACvD,UAAU,CAAC+E,gBAAgB,CAAC;IACrD;IAEAT,cAAc,GAAG,IAAI;IAErB,MAAMW,WAAW,GAAGnE,YAAY,CAC9BC,OAAO,EACP2D,8BAA8B,EAC9BG,oCAAoC,EACpC3D,mCACF,CAAC;IAED+D,WAAW,CAAClB,IAAI,CAACQ,gBAAgB,CAAC,CAACW,KAAK,CAACX,gBAAgB,CAAC;IAE1D,OAAOU,WAAW;EACpB,CAAC;AACH,CAAC,EAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NativeRNAppZungCodePushModule } from "./internals/NativeRNAppZungCodePushModule.js";
|
|
4
|
+
import { reloadCachedConfiguration } from "./internals/getConfiguration.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Controls telemetry reporting.
|
|
8
|
+
*
|
|
9
|
+
* @param enabled - When false, updates on this device will stop appearing as failed, pending or succeeded in analytics.
|
|
10
|
+
*/
|
|
11
|
+
export async function setTelemetryEnabled(enabled) {
|
|
12
|
+
await NativeRNAppZungCodePushModule.setTelemetryEnabled(enabled);
|
|
13
|
+
await reloadCachedConfiguration();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Gets the current telemetry enabled status.
|
|
18
|
+
*
|
|
19
|
+
* When setTelemetryEnabled has never been enabled, returns the default value set in your configuration.
|
|
20
|
+
*/
|
|
21
|
+
export function getTelemetryEnabled() {
|
|
22
|
+
return NativeRNAppZungCodePushModule.getTelemetryEnabled();
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeRNAppZungCodePushModule","reloadCachedConfiguration","setTelemetryEnabled","enabled","getTelemetryEnabled"],"sourceRoot":"../../src","sources":["telemetry.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,8CAA2C;AACzF,SAASC,yBAAyB,QAAQ,iCAA8B;;AAExE;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,mBAAmBA,CAACC,OAAgB,EAAiB;EACzE,MAAMH,6BAA6B,CAACE,mBAAmB,CAACC,OAAO,CAAC;EAChE,MAAMF,yBAAyB,CAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,mBAAmBA,CAAA,EAAqB;EACtD,OAAOJ,6BAA6B,CAACI,mBAAmB,CAAC,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -4,21 +4,26 @@ import type { SyncOptions } from './types';
|
|
|
4
4
|
export interface CodePushOptions extends SyncOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Specifies when you would like to synchronize updates with the CodePush server.
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
|
+
* Defaults to CheckFrequency.ON_APP_START.
|
|
8
9
|
*/
|
|
9
10
|
checkFrequency?: CheckFrequency;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
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.
|
|
13
16
|
*
|
|
14
17
|
* @param component the React Component that will be decorated
|
|
15
18
|
*/
|
|
16
|
-
export declare function withCodePush(component:
|
|
19
|
+
export declare function withCodePush<P extends object | Record<string, unknown>>(component: React.ComponentType<P>): React.ComponentType;
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
21
|
+
* 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.
|
|
22
|
+
*
|
|
23
|
+
* 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
24
|
*
|
|
20
25
|
* @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
26
|
*/
|
|
22
|
-
export declare function withCodePush(options: CodePushOptions): (component:
|
|
27
|
+
export declare function withCodePush<P extends object | Record<string, unknown>>(options: CodePushOptions): (component: React.ComponentType<P>) => React.ComponentType;
|
|
23
28
|
export default withCodePush;
|
|
24
29
|
//# sourceMappingURL=CodePush.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodePush.d.ts","sourceRoot":"","sources":["../../../../src/CodePush.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"CodePush.d.ts","sourceRoot":"","sources":["../../../../src/CodePush.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D,OAAO,KAAK,EAGV,WAAW,EAEZ,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;GAMG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC,aAAa,CAAC;AAEvB;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,OAAO,EAAE,eAAe,GACvB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,aAAa,CAAC;AA6E9D,eAAe,YAAY,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Allow CodePush to restart the app.
|
|
3
|
+
*
|
|
4
|
+
* This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
|
|
3
5
|
*/
|
|
4
|
-
export declare
|
|
6
|
+
export declare function allowRestart(): Promise<void>;
|
|
5
7
|
//# sourceMappingURL=allowRestart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowRestart.d.ts","sourceRoot":"","sources":["../../../../src/allowRestart.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"allowRestart.d.ts","sourceRoot":"","sources":["../../../../src/allowRestart.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,YAAY,kBAE3B"}
|