@appzung/react-native-code-push 11.0.0-rc2 → 11.0.0-rc4
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/README.md +10 -10
- package/android/app/src/main/java/com/appzung/codepush/react/CodePush.java +3 -0
- package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +14 -0
- package/docs/advanced-usage.md +15 -0
- package/docs/api-js/README.md +55 -0
- package/docs/api-js/enumerations/CheckFrequency.md +33 -0
- package/docs/api-js/enumerations/DeploymentStatus.md +25 -0
- package/docs/api-js/enumerations/InstallMode.md +50 -0
- package/docs/api-js/enumerations/SyncStatus.md +85 -0
- package/docs/api-js/enumerations/UpdateState.md +37 -0
- package/docs/api-js/functions/allowRestart.md +17 -0
- package/docs/api-js/functions/checkForUpdate.md +29 -0
- package/docs/api-js/functions/clearUpdates.md +19 -0
- package/docs/api-js/functions/disallowRestart.md +17 -0
- package/docs/api-js/functions/getClientUniqueId.md +15 -0
- package/docs/api-js/functions/getUpdateMetadata.md +23 -0
- package/docs/api-js/functions/notifyAppReady.md +17 -0
- package/docs/api-js/functions/resetClientUniqueId.md +15 -0
- package/docs/api-js/functions/restartApp.md +25 -0
- package/docs/api-js/functions/sync.md +43 -0
- package/docs/api-js/functions/withCodePush.md +65 -0
- package/docs/api-js/interfaces/CodePushOptions.md +118 -0
- package/docs/api-js/interfaces/DownloadProgress.md +23 -0
- package/docs/api-js/interfaces/LocalPackage.md +171 -0
- package/docs/api-js/interfaces/Package.md +98 -0
- package/docs/api-js/interfaces/RemotePackage.md +169 -0
- package/docs/api-js/interfaces/RollbackRetryOptions.md +28 -0
- package/docs/api-js/interfaces/StatusReport.md +47 -0
- package/docs/api-js/interfaces/SyncOptions.md +80 -0
- package/docs/api-js/interfaces/UpdateDialog.md +89 -0
- package/docs/api-js/type-aliases/DownloadProgressCallback.md +21 -0
- package/docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md +23 -0
- package/docs/api-js/type-aliases/SyncStatusChangedCallback.md +23 -0
- package/docs/api-js/variables/DEFAULT_UPDATE_DIALOG.md +12 -0
- package/docs/code-signing.md +2 -0
- package/docs/setup-android.md +1 -2
- package/docs/setup-ios.md +1 -1
- package/ios/CodePush/CodePush.h +1 -0
- package/ios/CodePush/CodePush.m +7 -0
- package/ios/CodePush/CodePushConfig.m +4 -0
- package/lib/commonjs/CodePush.js +6 -2
- package/lib/commonjs/CodePush.js.map +1 -1
- package/lib/commonjs/allowRestart.js +2 -0
- package/lib/commonjs/allowRestart.js.map +1 -1
- package/lib/commonjs/checkForUpdates.js +23 -25
- package/lib/commonjs/checkForUpdates.js.map +1 -1
- package/lib/commonjs/clearUpdates.js +2 -1
- package/lib/commonjs/clearUpdates.js.map +1 -1
- package/lib/commonjs/disallowRestart.js +2 -0
- 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/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 +34 -13
- 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 +100 -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/RemotePackageImplementation.js +6 -5
- 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/utils/fetchRetry.js +59 -0
- package/lib/commonjs/internals/utils/fetchRetry.js.map +1 -0
- 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 +33 -0
- package/lib/commonjs/internals/utils/requestFetchAdapter.js.map +1 -0
- package/lib/commonjs/internals/version.js +1 -1
- package/lib/commonjs/notifyAppReady.js +11 -9
- 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 +2 -0
- package/lib/commonjs/restartApp.js.map +1 -1
- package/lib/commonjs/sync.js +5 -3
- package/lib/commonjs/sync.js.map +1 -1
- package/lib/module/CodePush.js +6 -2
- package/lib/module/CodePush.js.map +1 -1
- package/lib/module/allowRestart.js +2 -0
- package/lib/module/allowRestart.js.map +1 -1
- package/lib/module/checkForUpdates.js +23 -25
- package/lib/module/checkForUpdates.js.map +1 -1
- package/lib/module/clearUpdates.js +2 -1
- package/lib/module/clearUpdates.js.map +1 -1
- package/lib/module/disallowRestart.js +2 -0
- 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/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 +3 -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 +96 -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/RemotePackageImplementation.js +6 -5
- 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/utils/fetchRetry.js +55 -0
- package/lib/module/internals/utils/fetchRetry.js.map +1 -0
- 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 +29 -0
- package/lib/module/internals/utils/requestFetchAdapter.js.map +1 -0
- package/lib/module/internals/version.js +1 -1
- package/lib/module/notifyAppReady.js +11 -9
- 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 +2 -0
- package/lib/module/restartApp.js.map +1 -1
- package/lib/module/sync.js +5 -3
- package/lib/module/sync.js.map +1 -1
- 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 +2 -0
- 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 +2 -1
- package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/disallowRestart.d.ts +2 -0
- 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/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 +3 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +13 -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 +101 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -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/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/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/notifyAppReady.d.ts +2 -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 +3 -1
- package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
- 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 +2 -0
- 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 +2 -1
- package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/module/src/disallowRestart.d.ts +2 -0
- 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/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 +3 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +13 -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 +101 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -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/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/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/notifyAppReady.d.ts +2 -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 +3 -1
- package/lib/typescript/module/src/sync.d.ts.map +1 -1
- package/lib/typescript/module/src/types.d.ts +72 -29
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/CodePush.tsx +12 -5
- package/src/allowRestart.ts +2 -0
- package/src/checkForUpdates.ts +24 -23
- package/src/clearUpdates.ts +2 -1
- package/src/disallowRestart.ts +2 -0
- package/src/enums/CheckFrequency.enum.ts +2 -2
- package/src/enums/InstallMode.enum.ts +7 -3
- 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 +3 -1
- package/src/internals/CodePushApiSdk.errors.ts +22 -0
- package/src/internals/CodePushApiSdk.ts +133 -0
- package/src/internals/CodePushApiSdk.types.ts +115 -0
- package/src/internals/RNAppZungCodePushModuleSpec.ts +1 -0
- package/src/internals/RemotePackageImplementation.ts +8 -7
- package/src/internals/getConfiguration.ts +4 -0
- package/src/internals/types.ts +2 -2
- package/src/internals/utils/fetchRetry.ts +72 -0
- package/src/internals/utils/queryStringify.ts +22 -0
- package/src/internals/utils/requestFetchAdapter.ts +28 -0
- package/src/internals/version.ts +1 -1
- package/src/notifyAppReady.ts +12 -13
- package/src/resetClientUniqueId.ts +11 -0
- package/src/restartApp.ts +2 -0
- package/src/sync.ts +5 -3
- package/src/types.ts +72 -29
- package/typedoc.json +9 -0
- package/docs/api-js.md +0 -557
- 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
package/src/types.ts
CHANGED
|
@@ -1,56 +1,83 @@
|
|
|
1
|
-
import type { NativeUpdateNotification } from 'code-push/script/acquisition-sdk';
|
|
2
|
-
import type { DeploymentStatus } from './enums/DeploymentStatus.enum';
|
|
3
1
|
import type { InstallMode } from './enums/InstallMode.enum';
|
|
4
2
|
import type { SyncStatus } from './enums/SyncStatus.enum';
|
|
3
|
+
import { DeploymentStatus } from './internals/CodePushApiSdk.types';
|
|
5
4
|
|
|
6
5
|
export interface UpdateDialog {
|
|
7
6
|
/**
|
|
8
7
|
* Indicates whether you would like to append the description of an available release to the
|
|
9
|
-
* notification message which is displayed to the end user.
|
|
8
|
+
* notification message which is displayed to the end user.
|
|
9
|
+
*
|
|
10
|
+
* Defaults to false.
|
|
10
11
|
*/
|
|
11
12
|
appendReleaseDescription?: boolean;
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Indicates the string you would like to prefix the release description with, if any, when
|
|
15
|
-
* displaying the update notification to the end user.
|
|
16
|
+
* displaying the update notification to the end user.
|
|
17
|
+
*
|
|
18
|
+
* Defaults to " Description: "
|
|
16
19
|
*/
|
|
17
20
|
descriptionPrefix?: string;
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
|
-
* The text to use for the button the end user must press in order to install a mandatory update.
|
|
23
|
+
* The text to use for the button the end user must press in order to install a mandatory update.
|
|
24
|
+
*
|
|
25
|
+
* Defaults to "Continue".
|
|
21
26
|
*/
|
|
22
27
|
mandatoryContinueButtonLabel?: string;
|
|
23
28
|
|
|
24
29
|
/**
|
|
25
30
|
* The text used as the body of an update notification, when the update is specified as mandatory.
|
|
31
|
+
*
|
|
26
32
|
* Defaults to "An update is available that must be installed.".
|
|
27
33
|
*/
|
|
28
34
|
mandatoryUpdateMessage?: string;
|
|
29
35
|
|
|
30
36
|
/**
|
|
31
|
-
* The text to use for the button the end user can press in order to ignore an optional update that is available.
|
|
37
|
+
* The text to use for the button the end user can press in order to ignore an optional update that is available.
|
|
38
|
+
*
|
|
39
|
+
* Defaults to "Ignore".
|
|
32
40
|
*/
|
|
33
41
|
optionalIgnoreButtonLabel?: string;
|
|
34
42
|
|
|
35
43
|
/**
|
|
36
|
-
* The text to use for the button the end user can press in order to install an optional update.
|
|
44
|
+
* The text to use for the button the end user can press in order to install an optional update.
|
|
45
|
+
*
|
|
46
|
+
* Defaults to "Install".
|
|
37
47
|
*/
|
|
38
48
|
optionalInstallButtonLabel?: string;
|
|
39
49
|
|
|
40
50
|
/**
|
|
41
|
-
* The text used as the body of an update notification, when the update is optional.
|
|
51
|
+
* The text used as the body of an update notification, when the update is optional.
|
|
52
|
+
*
|
|
53
|
+
* Defaults to "An update is available. Would you like to install it?".
|
|
42
54
|
*/
|
|
43
55
|
optionalUpdateMessage?: string;
|
|
44
56
|
|
|
45
57
|
/**
|
|
46
|
-
* The text used as the header of an update notification that is displayed to the end user.
|
|
58
|
+
* The text used as the header of an update notification that is displayed to the end user.
|
|
59
|
+
*
|
|
60
|
+
* Defaults to "Update available".
|
|
47
61
|
*/
|
|
48
62
|
title?: string;
|
|
49
63
|
}
|
|
50
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Called periodically when an available update is being downloaded from the CodePush server.
|
|
67
|
+
*/
|
|
51
68
|
export type DownloadProgressCallback = (progress: DownloadProgress) => void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Called when the sync process moves from one stage to another in the overall update process.
|
|
72
|
+
*
|
|
73
|
+
* The method is called with a status code which represents the current state, and can be any of the `SyncStatus` values.
|
|
74
|
+
*/
|
|
52
75
|
export type SyncStatusChangedCallback = (status: SyncStatus) => void;
|
|
53
|
-
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Called when there are any binary update available.
|
|
79
|
+
*/
|
|
80
|
+
export type HandleBinaryVersionMismatchCallback = (update: { appVersion: string }) => void;
|
|
54
81
|
|
|
55
82
|
export interface DownloadProgress {
|
|
56
83
|
/**
|
|
@@ -64,6 +91,9 @@ export interface DownloadProgress {
|
|
|
64
91
|
receivedBytes: number;
|
|
65
92
|
}
|
|
66
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
|
|
96
|
+
*/
|
|
67
97
|
export interface LocalPackage extends Package {
|
|
68
98
|
/**
|
|
69
99
|
* Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app.
|
|
@@ -82,7 +112,7 @@ export interface LocalPackage extends Package {
|
|
|
82
112
|
export interface Package {
|
|
83
113
|
/**
|
|
84
114
|
* The app binary version that this update is dependent on. This is the value that was
|
|
85
|
-
* specified via the
|
|
115
|
+
* specified via the --target-binary-version parameter when calling the CLI's release command.
|
|
86
116
|
*/
|
|
87
117
|
appVersion: string;
|
|
88
118
|
|
|
@@ -98,11 +128,15 @@ export interface Package {
|
|
|
98
128
|
|
|
99
129
|
/**
|
|
100
130
|
* Indicates whether this update has been previously installed but was rolled back.
|
|
131
|
+
*
|
|
132
|
+
* The `sync` method will automatically ignore updates which have previously failed, so you only need to worry about this property if using `checkForUpdate`.
|
|
101
133
|
*/
|
|
102
134
|
failedInstall: boolean;
|
|
103
135
|
|
|
104
136
|
/**
|
|
105
137
|
* Indicates whether this is the first time the update has been run after being installed.
|
|
138
|
+
*
|
|
139
|
+
* This is useful for determining whether you would like to show a "What's New?" UI to the end user after installing an update.
|
|
106
140
|
*/
|
|
107
141
|
isFirstRun: boolean;
|
|
108
142
|
|
|
@@ -133,6 +167,9 @@ export interface Package {
|
|
|
133
167
|
packageSize: number;
|
|
134
168
|
}
|
|
135
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Represents an available update on the CodePush server that hasn't been downloaded yet.
|
|
172
|
+
*/
|
|
136
173
|
export interface RemotePackage extends Package {
|
|
137
174
|
/**
|
|
138
175
|
* Downloads the available update from the CodePush service.
|
|
@@ -143,27 +180,31 @@ export interface RemotePackage extends Package {
|
|
|
143
180
|
|
|
144
181
|
/**
|
|
145
182
|
* The URL at which the package is available for download.
|
|
183
|
+
*
|
|
184
|
+
* This property is only needed for advanced usage, since the `download` method will automatically handle the acquisition of updates for you.
|
|
146
185
|
*/
|
|
147
186
|
downloadUrl: string;
|
|
148
187
|
}
|
|
149
188
|
|
|
150
189
|
export interface SyncOptions {
|
|
151
190
|
/**
|
|
152
|
-
* Specifies the release channel you want to query for an update against.
|
|
153
|
-
*
|
|
154
|
-
* dynamically use a different release channel for a specific call to sync.
|
|
191
|
+
* Specifies the release channel you want to query for an update against.
|
|
192
|
+
*
|
|
193
|
+
* By default, this value is derived from the Info.plist file (iOS) and strings resources (Android), but this option allows you to override it from the JS-side if you need to dynamically use a different release channel for a specific call to sync.
|
|
155
194
|
*/
|
|
156
195
|
releaseChannelPublicId?: string;
|
|
157
196
|
|
|
158
197
|
/**
|
|
159
|
-
* Specifies when you would like to install
|
|
160
|
-
*
|
|
198
|
+
* Specifies when you would like to install regular updates (i.e. those that aren't marked as mandatory).
|
|
199
|
+
*
|
|
200
|
+
* Defaults to InstallMode.ON_NEXT_RESTART.
|
|
161
201
|
*/
|
|
162
202
|
installMode?: InstallMode;
|
|
163
203
|
|
|
164
204
|
/**
|
|
165
205
|
* Specifies when you would like to install updates which are marked as mandatory.
|
|
166
|
-
*
|
|
206
|
+
*
|
|
207
|
+
* Defaults to InstallMode.IMMEDIATE.
|
|
167
208
|
*/
|
|
168
209
|
mandatoryInstallMode?: InstallMode;
|
|
169
210
|
|
|
@@ -176,19 +217,18 @@ export interface SyncOptions {
|
|
|
176
217
|
minimumBackgroundDuration?: number;
|
|
177
218
|
|
|
178
219
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* overriding one or more of the default strings.
|
|
220
|
+
* Used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use.
|
|
221
|
+
*
|
|
222
|
+
* Defaults to null, which has the effect of disabling the dialog completely.
|
|
223
|
+
* Setting this to true will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings.
|
|
183
224
|
*/
|
|
184
225
|
updateDialog?: UpdateDialog | true;
|
|
185
226
|
|
|
186
227
|
/**
|
|
187
|
-
* The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding
|
|
191
|
-
* one or more of the default values.
|
|
228
|
+
* The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions specified in the options).
|
|
229
|
+
*
|
|
230
|
+
* This defaults to null, which has the effect of disabling the retry mechanism.
|
|
231
|
+
* Setting this to true will enable the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding one or more of the default values.
|
|
192
232
|
*/
|
|
193
233
|
rollbackRetryOptions?: RollbackRetryOptions | true;
|
|
194
234
|
|
|
@@ -197,14 +237,17 @@ export interface SyncOptions {
|
|
|
197
237
|
|
|
198
238
|
export interface RollbackRetryOptions {
|
|
199
239
|
/**
|
|
200
|
-
* Specifies the minimum time in hours that the app will wait after the latest rollback
|
|
201
|
-
*
|
|
240
|
+
* Specifies the minimum time in hours that the app will wait after the latest rollback before attempting to reinstall same rolled-back package.
|
|
241
|
+
*
|
|
242
|
+
* Defaults to `24`.
|
|
202
243
|
*/
|
|
203
244
|
delayInHours?: number;
|
|
204
245
|
|
|
205
246
|
/**
|
|
206
247
|
* Specifies the maximum number of retry attempts that the app can make before it stops trying.
|
|
207
|
-
* Cannot be less than `1`.
|
|
248
|
+
* Cannot be less than `1`.
|
|
249
|
+
*
|
|
250
|
+
* Defaults to `1`.
|
|
208
251
|
*/
|
|
209
252
|
maxRetryAttempts?: number;
|
|
210
253
|
}
|