@algocare/react-native-code-push 12.6.4 → 13.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CodePush.podspec +6 -8
- package/README.md +343 -586
- package/android/app/build.gradle +2 -1
- package/android/app/proguard-rules.pro +14 -0
- package/android/app/src/debug/AndroidManifest.xml +9 -0
- package/android/app/src/main/AndroidManifest.xml +1 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +14 -139
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +0 -3
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +108 -63
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +2 -33
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +13 -109
- package/android/build.gradle +3 -0
- package/app.plugin.js +1 -0
- package/bin/code-push.js +6 -0
- package/cli/commands/bundleCommand/bundleCodePush.ts +118 -0
- package/cli/commands/bundleCommand/index.ts +34 -0
- package/cli/commands/createHistoryCommand/createReleaseHistory.ts +37 -0
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.ts +40 -0
- package/cli/commands/createHistoryCommand/index.ts +44 -0
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.ts +33 -0
- package/cli/commands/createPullRequestHistoryCommand/index.ts +31 -0
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.ts +71 -0
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.ts +75 -0
- package/cli/commands/createPullRequestReleaseCommand/index.ts +74 -0
- package/cli/commands/getPackageHashCommand/index.ts +45 -0
- package/cli/commands/initCommand/index.ts +14 -0
- package/cli/commands/initCommand/initAndroid.ts +91 -0
- package/cli/commands/initCommand/initIos.ts +123 -0
- package/cli/commands/initCommand/test/initAndroid.test.ts +128 -0
- package/cli/commands/initCommand/test/initIos.test.ts +99 -0
- package/cli/commands/releaseCommand/addToReleaseHistory.ts +57 -0
- package/cli/commands/releaseCommand/index.ts +90 -0
- package/cli/commands/releaseCommand/release.ts +105 -0
- package/cli/commands/removePullRequestHistoryCommand/index.ts +37 -0
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.ts +28 -0
- package/cli/commands/showHistoryCommand/index.ts +31 -0
- package/cli/commands/updateHistoryCommand/index.ts +55 -0
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.ts +42 -0
- package/cli/constant.ts +4 -0
- package/cli/dist/commands/bundleCommand/bundleCodePush.js +65 -0
- package/cli/dist/commands/bundleCommand/index.js +15 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistory.js +25 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistoryList.js +27 -0
- package/cli/dist/commands/createHistoryCommand/index.js +20 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +23 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/index.js +15 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +51 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +39 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/index.js +35 -0
- package/cli/dist/commands/getPackageHashCommand/index.js +26 -0
- package/cli/dist/commands/initCommand/index.js +12 -0
- package/cli/dist/commands/initCommand/initAndroid.js +73 -0
- package/cli/dist/commands/initCommand/initIos.js +108 -0
- package/cli/dist/commands/initCommand/test/initAndroid.test.js +113 -0
- package/cli/dist/commands/initCommand/test/initIos.test.js +95 -0
- package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +35 -0
- package/cli/dist/commands/releaseCommand/index.js +45 -0
- package/cli/dist/commands/releaseCommand/release.js +62 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/index.js +19 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +18 -0
- package/cli/dist/commands/showHistoryCommand/index.js +15 -0
- package/cli/dist/commands/updateHistoryCommand/index.js +31 -0
- package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +28 -0
- package/cli/dist/constant.js +4 -0
- package/cli/dist/functions/getReactTempDir.js +10 -0
- package/cli/{functions → dist/functions}/makeCodePushBundle.js +5 -11
- package/cli/{functions → dist/functions}/prepareToBundleJS.js +2 -5
- package/cli/dist/functions/runExpoBundleCommand.js +35 -0
- package/cli/{functions → dist/functions}/runHermesEmitBinaryCommand.js +36 -71
- package/cli/{functions → dist/functions}/runReactNativeBundleCommand.js +19 -24
- package/cli/dist/index.js +54 -0
- package/cli/dist/utils/datetime.js +17 -0
- package/cli/dist/utils/file-utils.js +19 -0
- package/cli/dist/utils/fsUtils.js +44 -0
- package/cli/{utils → dist/utils}/hash-utils.js +19 -130
- package/cli/{utils → dist/utils}/promisfied-fs.js +5 -16
- package/cli/dist/utils/showLogo.js +21 -0
- package/cli/dist/utils/unzip.js +41 -0
- package/cli/{utils → dist/utils}/zip.js +15 -51
- package/cli/functions/{getReactTempDir.js → getReactTempDir.ts} +2 -6
- package/cli/functions/makeCodePushBundle.ts +26 -0
- package/cli/functions/prepareToBundleJS.ts +10 -0
- package/cli/functions/runExpoBundleCommand.ts +45 -0
- package/cli/functions/runHermesEmitBinaryCommand.ts +203 -0
- package/cli/functions/runReactNativeBundleCommand.ts +67 -0
- package/cli/index.ts +68 -0
- package/cli/package.json +35 -0
- package/cli/utils/datetime.ts +19 -0
- package/cli/utils/{file-utils.js → file-utils.ts} +4 -21
- package/cli/utils/fsUtils.ts +50 -0
- package/cli/utils/hash-utils.ts +143 -0
- package/cli/utils/promisfied-fs.ts +19 -0
- package/cli/utils/{showLogo.js → showLogo.ts} +4 -6
- package/cli/utils/unzip.ts +46 -0
- package/cli/utils/zip.ts +65 -0
- package/expo/plugin/withCodePush.js +14 -0
- package/expo/plugin/withCodePushAndroid.js +92 -0
- package/expo/plugin/withCodePushIos.js +143 -0
- package/ios/CodePush/CodePush.h +0 -16
- package/ios/CodePush/CodePush.m +30 -20
- package/ios/CodePush/CodePushConfig.m +1 -11
- package/ios/CodePush/CodePushPackage.m +12 -69
- package/ios/CodePush/CodePushUpdateUtils.m +1 -91
- package/ios/CodePush/SSZipArchive/Info.plist +26 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -1
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +129 -27
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +1119 -314
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
- package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +244 -453
- package/ios/PrivacyInfo.xcprivacy +31 -0
- package/package.json +68 -42
- package/react-native.config.js +1 -1
- package/{AlertAdapter.js → src/AlertAdapter.js} +5 -5
- package/src/CodePush.js +947 -0
- package/{package-mixins.js → src/package-mixins.js} +1 -1
- package/{versioning → src/versioning}/BaseVersioning.js +12 -1
- package/{versioning → src/versioning}/SemverVersioning.test.js +78 -0
- package/typings/react-native-code-push.d.ts +559 -495
- package/.claude/commands/release.md +0 -78
- package/.claude/skills/npm-release/SKILL.md +0 -89
- package/CLAUDE.md +0 -83
- package/CONTRIBUTING.md +0 -134
- package/CodePush.js +0 -972
- package/SECURITY.md +0 -41
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +0 -12
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +0 -17
- package/android/codepush.gradle +0 -162
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -164
- package/android/gradlew.bat +0 -90
- package/babel.config.js +0 -3
- package/cli/commands/bundleCommand/bundleCodePush.js +0 -57
- package/cli/commands/bundleCommand/index.js +0 -55
- package/cli/commands/common.js +0 -245
- package/cli/commands/createHistoryCommand/createReleaseHistory.js +0 -42
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.js +0 -52
- package/cli/commands/createHistoryCommand/index.js +0 -95
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +0 -34
- package/cli/commands/createPullRequestHistoryCommand/index.js +0 -29
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +0 -74
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +0 -91
- package/cli/commands/createPullRequestReleaseCommand/index.js +0 -68
- package/cli/commands/getPackageHashCommand/index.js +0 -42
- package/cli/commands/releaseCommand/addToReleaseHistory.js +0 -85
- package/cli/commands/releaseCommand/index.js +0 -151
- package/cli/commands/releaseCommand/release.js +0 -121
- package/cli/commands/removePullRequestHistoryCommand/index.js +0 -28
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +0 -23
- package/cli/commands/showHistoryCommand/index.js +0 -88
- package/cli/commands/updateHistoryCommand/index.js +0 -123
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.js +0 -69
- package/cli/constant.js +0 -8
- package/cli/index.js +0 -63
- package/cli/utils/datetime.js +0 -22
- package/cli/utils/fsUtils.js +0 -64
- package/cli/utils/version.js +0 -26
- package/code-push.config.example.supabase.ts +0 -114
- package/code-push.config.js +0 -229
- package/code-push.config.ts +0 -175
- package/docs/api-android.md +0 -83
- package/docs/api-ios.md +0 -31
- package/docs/api-js.md +0 -592
- package/docs/multi-deployment-testing-android.md +0 -148
- package/docs/multi-deployment-testing-ios.md +0 -59
- package/docs/setup-android.md +0 -482
- package/docs/setup-ios.md +0 -280
- package/eslint.config.mjs +0 -32
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
- package/ios/CodePush/Base64/README.md +0 -47
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
- package/ios/CodePush/JWT/LICENSE +0 -19
- package/ios/CodePush/JWT/README.md +0 -489
- package/ios/CodePush/SSZipArchive/Common.h +0 -81
- package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
- package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
- package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
- package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
- package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
- package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
- package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
- package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
- package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
- package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
- package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
- package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
- package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
- package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
- package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
- package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
- package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
- package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
- package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
- package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
- package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
- package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
- package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
- package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
- package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
- package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
- package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
- package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
- package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
- package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
- package/scripts/generateBundledResourcesHash.js +0 -125
- package/scripts/getFilesInFolder.js +0 -19
- package/scripts/recordFilesBeforeBundleCommand.js +0 -41
- package/scripts/release.sh +0 -86
- package/tsconfig.json +0 -20
- package/tslint.json +0 -32
- /package/{logging.js → src/logging.js} +0 -0
- /package/{versioning → src/versioning}/BaseVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/SemverVersioning.js +0 -0
- /package/{versioning → src/versioning}/index.js +0 -0
|
@@ -1,565 +1,573 @@
|
|
|
1
|
-
export type DownloadProgressCallback = (progress: DownloadProgress) => void
|
|
2
|
-
export type SyncStatusChangedCallback = (status: CodePush.SyncStatus) => void
|
|
3
|
-
export type HandleBinaryVersionMismatchCallback = (
|
|
4
|
-
update: RemotePackage
|
|
5
|
-
) => void
|
|
1
|
+
export type DownloadProgressCallback = (progress: DownloadProgress) => void;
|
|
2
|
+
export type SyncStatusChangedCallback = (status: CodePush.SyncStatus) => void;
|
|
3
|
+
export type HandleBinaryVersionMismatchCallback = (update: RemotePackage) => void;
|
|
6
4
|
|
|
7
|
-
// from code-push SDK
|
|
8
5
|
export interface UpdateCheckRequest {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
package_hash?: string
|
|
6
|
+
/** The native version, not in package.json. */
|
|
7
|
+
app_version: string;
|
|
8
|
+
client_unique_id?: string;
|
|
9
|
+
is_companion?: boolean;
|
|
10
|
+
label?: string;
|
|
11
|
+
package_hash?: string;
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
/**
|
|
19
15
|
* Alias for a string representing a released CodePush update version.
|
|
20
16
|
*/
|
|
21
|
-
export type ReleaseVersion = string
|
|
17
|
+
export type ReleaseVersion = string;
|
|
22
18
|
|
|
23
19
|
/**
|
|
24
20
|
* The interface representing the release information that the `releaseHistoryFetcher` function must return.
|
|
25
21
|
*/
|
|
26
|
-
export type ReleaseHistoryInterface = Record<ReleaseVersion, ReleaseInfo
|
|
22
|
+
export type ReleaseHistoryInterface = Record<ReleaseVersion, ReleaseInfo>;
|
|
27
23
|
|
|
28
24
|
/**
|
|
29
25
|
* The interface that represents a single deployment history entry, which the `releaseHistoryFetcher` function should return.
|
|
30
26
|
*/
|
|
31
27
|
export interface ReleaseInfo {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
mandatory: boolean;
|
|
30
|
+
downloadUrl: string;
|
|
31
|
+
packageHash: string;
|
|
32
|
+
rollout?: number;
|
|
33
|
+
/** The binary version a PR preview release was built against. (PR preview releases only) */
|
|
34
|
+
binaryVersion?: string;
|
|
35
|
+
/** Release creation timestamp recorded by the CLI. (e.g. '2026-07-03 12:34:56') */
|
|
36
|
+
createdAt?: string;
|
|
37
|
+
/** Last `update-history` timestamp recorded by the CLI. ('-' if never updated) */
|
|
38
|
+
updatedAt?: string;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
// from code-push SDK
|
|
39
42
|
export interface UpdateCheckResponse {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
download_url?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
is_available: boolean;
|
|
46
|
+
is_disabled?: boolean;
|
|
47
|
+
target_binary_range: string;
|
|
48
|
+
/*generated*/ label?: string;
|
|
49
|
+
/*generated*/ package_hash?: string;
|
|
50
|
+
package_size?: number;
|
|
51
|
+
should_run_binary_version?: boolean;
|
|
52
|
+
update_app_version?: boolean;
|
|
53
|
+
is_mandatory?: boolean;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
export interface CodePushOptions extends SyncOptions {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
/**
|
|
58
|
+
* The `ignoreFailedUpdates` option is only available as an option for `CodePush.sync()`.
|
|
59
|
+
*/
|
|
60
|
+
ignoreFailedUpdates?: never;
|
|
61
|
+
/**
|
|
62
|
+
* Specifies when you would like to synchronize updates with the CodePush server.
|
|
63
|
+
* Defaults to codePush.CheckFrequency.ON_APP_START.
|
|
64
|
+
*/
|
|
65
|
+
checkFrequency: CodePush.CheckFrequency;
|
|
66
|
+
/**
|
|
67
|
+
* Specifies a function to get the release history.
|
|
68
|
+
*
|
|
69
|
+
* If you want to use `updateChecker`, pass no-op function like below.
|
|
70
|
+
* But it is deprecated and will be removed in the next major version.
|
|
71
|
+
*
|
|
72
|
+
* ```ts
|
|
73
|
+
* const codePushOptions: {
|
|
74
|
+
* releaseHistoryFetcher: async () => ({}), // This will not be called
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
releaseHistoryFetcher: (updateRequest: UpdateCheckRequest) => Promise<ReleaseHistoryInterface>;
|
|
79
|
+
/**
|
|
80
|
+
* Specify a function to perform the update check.
|
|
81
|
+
* It can be used for self-hosting.
|
|
82
|
+
* Defaults to AppCenter update_check REST API request.
|
|
83
|
+
*
|
|
84
|
+
* @deprecated It will be removed in the next major version. Please migrate to `releaseHistoryFetcher`.
|
|
85
|
+
*/
|
|
86
|
+
updateChecker?: (updateRequest: UpdateCheckRequest) => Promise<{ update_info: UpdateCheckResponse }>;
|
|
87
|
+
/**
|
|
88
|
+
* Callback function that is called when the update installation succeeds.
|
|
89
|
+
*/
|
|
90
|
+
onUpdateSuccess?: (label: string) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Callback function that is called when the update rolled back.
|
|
93
|
+
*/
|
|
94
|
+
onUpdateRollback?: (label: string) => void;
|
|
95
|
+
/**
|
|
96
|
+
* Callback function that is called when download starts.
|
|
97
|
+
*/
|
|
98
|
+
onDownloadStart?: (label: string) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Callback function that is called when download finished successfully.
|
|
101
|
+
*/
|
|
102
|
+
onDownloadSuccess?: (label: string) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Callback function that is called when sync process failed.
|
|
105
|
+
*/
|
|
106
|
+
onSyncError?: (label: string, error: Error) => void;
|
|
107
|
+
/**
|
|
108
|
+
* Callback function that is called when rollout is skipped.
|
|
109
|
+
*/
|
|
110
|
+
onRolloutSkipped?: (label: string, error: Error) => void;
|
|
84
111
|
}
|
|
85
112
|
|
|
86
113
|
export interface DownloadProgress {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
114
|
+
/**
|
|
115
|
+
* The total number of bytes expected to be received for this update.
|
|
116
|
+
*/
|
|
117
|
+
totalBytes: number;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The number of bytes downloaded thus far.
|
|
121
|
+
*/
|
|
122
|
+
receivedBytes: number;
|
|
96
123
|
}
|
|
97
124
|
|
|
98
125
|
export interface LocalPackage extends Package {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
installMode: CodePush.InstallMode,
|
|
107
|
-
minimumBackgroundDuration?: number
|
|
108
|
-
): Promise<void>
|
|
126
|
+
/**
|
|
127
|
+
* Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app.
|
|
128
|
+
*
|
|
129
|
+
* @param installMode Indicates when you would like the update changes to take affect for the end-user.
|
|
130
|
+
* @param minimumBackgroundDuration For resume-based installs, this specifies the number of seconds the app needs to be in the background before forcing a restart. Defaults to 0 if unspecified.
|
|
131
|
+
*/
|
|
132
|
+
install(installMode: CodePush.InstallMode, minimumBackgroundDuration?: number): Promise<void>;
|
|
109
133
|
}
|
|
110
134
|
|
|
111
135
|
export interface Package {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
136
|
+
/**
|
|
137
|
+
* The app binary version that this update is dependent on. This is the value that was
|
|
138
|
+
* specified via the appStoreVersion parameter when calling the CLI's release command.
|
|
139
|
+
*/
|
|
140
|
+
appVersion: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The deployment key that was used to originally download this update.
|
|
144
|
+
*/
|
|
145
|
+
deploymentKey: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The description of the update. This is the same value that you specified in the CLI when you released the update.
|
|
149
|
+
*/
|
|
150
|
+
description: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Indicates whether this update has been previously installed but was rolled back.
|
|
154
|
+
*/
|
|
155
|
+
failedInstall: boolean;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Indicates whether this is the first time the update has been run after being installed.
|
|
159
|
+
*/
|
|
160
|
+
isFirstRun: boolean;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Indicates whether the update is considered mandatory. This is the value that was specified in the CLI when the update was released.
|
|
164
|
+
*/
|
|
165
|
+
isMandatory: boolean;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Indicates whether this update is in a "pending" state. When true, that means the update has been downloaded and installed, but the app restart
|
|
169
|
+
* needed to apply it hasn't occurred yet, and therefore, its changes aren't currently visible to the end-user.
|
|
170
|
+
*/
|
|
171
|
+
isPending: boolean;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The internal label automatically given to the update by the CodePush server. This value uniquely identifies the update within its deployment.
|
|
175
|
+
*/
|
|
176
|
+
label: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The SHA hash value of the update.
|
|
180
|
+
*/
|
|
181
|
+
packageHash: string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The size of the code contained within the update, in bytes.
|
|
185
|
+
*/
|
|
186
|
+
packageSize: number;
|
|
163
187
|
}
|
|
164
188
|
|
|
165
189
|
export interface RemotePackage extends Package {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
* The URL at which the package is available for download.
|
|
179
|
-
*/
|
|
180
|
-
downloadUrl: string
|
|
190
|
+
/**
|
|
191
|
+
* Downloads the available update from the CodePush service.
|
|
192
|
+
*
|
|
193
|
+
* @param downloadProgressCallback An optional callback that allows tracking the progress of the update while it is being downloaded.
|
|
194
|
+
* @param downloadCompleteCallback An optional callback that is called when the HTTP download completes and post-processing begins (iOS only).
|
|
195
|
+
*/
|
|
196
|
+
download(downloadProgressCallback?: DownloadProgressCallback, downloadCompleteCallback?: () => void): Promise<LocalPackage>;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The URL at which the package is available for download.
|
|
200
|
+
*/
|
|
201
|
+
downloadUrl: string;
|
|
181
202
|
}
|
|
182
203
|
|
|
183
204
|
export interface SyncOptions {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
*/
|
|
191
|
-
deploymentKey?: string
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Specifies when you would like to install optional updates (i.e. those that aren't marked as mandatory).
|
|
195
|
-
* Defaults to codePush.InstallMode.ON_NEXT_RESTART.
|
|
196
|
-
*/
|
|
197
|
-
installMode?: CodePush.InstallMode
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Specifies when you would like to install updates which are marked as mandatory.
|
|
201
|
-
* Defaults to codePush.InstallMode.IMMEDIATE.
|
|
202
|
-
*/
|
|
203
|
-
mandatoryInstallMode?: CodePush.InstallMode
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property
|
|
207
|
-
* only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful
|
|
208
|
-
* for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying
|
|
209
|
-
* the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.
|
|
210
|
-
*/
|
|
211
|
-
minimumBackgroundDuration?: number
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available,
|
|
215
|
-
* and if so, what strings to use. Defaults to null, which has the effect of disabling the dialog completely. Setting this to any truthy
|
|
216
|
-
* value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as
|
|
217
|
-
* overriding one or more of the default strings.
|
|
218
|
-
*/
|
|
219
|
-
updateDialog?: UpdateDialog | true
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions
|
|
223
|
-
* specified in the options). It is an "options" object used to determine whether a rollback retry should occur, and if so, what settings to use
|
|
224
|
-
* for the rollback retry. This defaults to null, which has the effect of disabling the retry mechanism. Setting this to any truthy value will enable
|
|
225
|
-
* the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding
|
|
226
|
-
* one or more of the default values.
|
|
227
|
-
*/
|
|
228
|
-
rollbackRetryOptions?: RollbackRetryOptions
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Specifies whether to ignore the update if the installation fails.
|
|
232
|
-
* If set to false, the update will be retried when the sync method is called, even if the previous installation attempt failed.
|
|
233
|
-
* However, depending on the deployment strategy, if an update that cannot be successfully installed is deployed, this option could result in an infinite update retry loop.
|
|
234
|
-
* Defaults to true.
|
|
235
|
-
*/
|
|
236
|
-
ignoreFailedUpdates?: boolean
|
|
237
|
-
}
|
|
205
|
+
/**
|
|
206
|
+
* Specifies the deployment key you want to query for an update against. By default, this value is derived from the Info.plist
|
|
207
|
+
* file (iOS) and MainActivity.java file (Android), but this option allows you to override it from the script-side if you need to
|
|
208
|
+
* dynamically use a different deployment for a specific call to sync.
|
|
209
|
+
*/
|
|
210
|
+
deploymentKey?: string;
|
|
238
211
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
appendReleaseDescription?: boolean
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Indicates the string you would like to prefix the release description with, if any, when
|
|
248
|
-
* displaying the update notification to the end user. Defaults to " Description: "
|
|
249
|
-
*/
|
|
250
|
-
descriptionPrefix?: string
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* The text to use for the button the end user must press in order to install a mandatory update. Defaults to "Continue".
|
|
254
|
-
*/
|
|
255
|
-
mandatoryContinueButtonLabel?: string
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* The text used as the body of an update notification, when the update is specified as mandatory.
|
|
259
|
-
* Defaults to "An update is available that must be installed.".
|
|
260
|
-
*/
|
|
261
|
-
mandatoryUpdateMessage?: string
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* The text to use for the button the end user can press in order to ignore an optional update that is available. Defaults to "Ignore".
|
|
265
|
-
*/
|
|
266
|
-
optionalIgnoreButtonLabel?: string
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* The text to use for the button the end user can press in order to install an optional update. Defaults to "Install".
|
|
270
|
-
*/
|
|
271
|
-
optionalInstallButtonLabel?: string
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* The text used as the body of an update notification, when the update is optional. Defaults to "An update is available. Would you like to install it?".
|
|
275
|
-
*/
|
|
276
|
-
optionalUpdateMessage?: string
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* The text used as the header of an update notification that is displayed to the end user. Defaults to "Update available".
|
|
280
|
-
*/
|
|
281
|
-
title?: string
|
|
282
|
-
}
|
|
212
|
+
/**
|
|
213
|
+
* Specifies when you would like to install optional updates (i.e. those that aren't marked as mandatory).
|
|
214
|
+
* Defaults to codePush.InstallMode.ON_NEXT_RESTART.
|
|
215
|
+
*/
|
|
216
|
+
installMode?: CodePush.InstallMode;
|
|
283
217
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
delayInHours?: number
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Specifies the maximum number of retry attempts that the app can make before it stops trying.
|
|
293
|
-
* Cannot be less than `1`. Defaults to `1`.
|
|
294
|
-
*/
|
|
295
|
-
maxRetryAttempts?: number
|
|
296
|
-
}
|
|
218
|
+
/**
|
|
219
|
+
* Specifies when you would like to install updates which are marked as mandatory.
|
|
220
|
+
* Defaults to codePush.InstallMode.IMMEDIATE.
|
|
221
|
+
*/
|
|
222
|
+
mandatoryInstallMode?: CodePush.InstallMode;
|
|
297
223
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
* The version of the app that was deployed (for a native app upgrade).
|
|
306
|
-
*/
|
|
307
|
-
appVersion?: string
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Details of the package that was deployed (or attempted to).
|
|
311
|
-
*/
|
|
312
|
-
package?: Package
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Deployment key used when deploying the previous package.
|
|
316
|
-
*/
|
|
317
|
-
previousDeploymentKey?: string
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* The label (v#) of the package that was upgraded from.
|
|
321
|
-
*/
|
|
322
|
-
previousLabelOrAppVersion?: string
|
|
323
|
-
}
|
|
224
|
+
/**
|
|
225
|
+
* Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property
|
|
226
|
+
* only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful
|
|
227
|
+
* for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying
|
|
228
|
+
* the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.
|
|
229
|
+
*/
|
|
230
|
+
minimumBackgroundDuration?: number;
|
|
324
231
|
|
|
325
|
-
/**
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
232
|
+
/**
|
|
233
|
+
* An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available,
|
|
234
|
+
* and if so, what strings to use. Defaults to null, which has the effect of disabling the dialog completely. Setting this to any truthy
|
|
235
|
+
* value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as
|
|
236
|
+
* overriding one or more of the default strings.
|
|
237
|
+
*/
|
|
238
|
+
updateDialog?: UpdateDialog | true;
|
|
331
239
|
|
|
332
|
-
/**
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
240
|
+
/**
|
|
241
|
+
* The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions
|
|
242
|
+
* specified in the options). It is an "options" object used to determine whether a rollback retry should occur, and if so, what settings to use
|
|
243
|
+
* for the rollback retry. This defaults to null, which has the effect of disabling the retry mechanism. Setting this to any truthy value will enable
|
|
244
|
+
* the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding
|
|
245
|
+
* one or more of the default values.
|
|
246
|
+
*/
|
|
247
|
+
rollbackRetryOptions?: RollbackRetryOptions;
|
|
338
248
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Asks the CodePush service whether the configured app deployment has an update available.
|
|
348
|
-
*
|
|
349
|
-
* @param prNumber The pull request number to use to query the CodePush server for an update.
|
|
350
|
-
* @param packageHash The package hash to use to query the CodePush server for an update.
|
|
351
|
-
* @param handleBinaryVersionMismatchCallback An optional callback for handling target binary version mismatch
|
|
352
|
-
*/
|
|
353
|
-
function checkForUpdate(
|
|
354
|
-
prNumber?: string,
|
|
355
|
-
packageHash?: string,
|
|
356
|
-
handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback
|
|
357
|
-
): Promise<RemotePackage | null>
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Retrieves the metadata for an installed update (e.g. description, mandatory).
|
|
361
|
-
*
|
|
362
|
-
* @param updateState The state of the update you want to retrieve the metadata for. Defaults to UpdateState.RUNNING.
|
|
363
|
-
*/
|
|
364
|
-
function getUpdateMetadata(
|
|
365
|
-
updateState?: UpdateState
|
|
366
|
-
): Promise<LocalPackage | null>
|
|
249
|
+
/**
|
|
250
|
+
* Specifies whether to ignore the update if the installation fails.
|
|
251
|
+
* If set to false, the update will be retried when the sync method is called, even if the previous installation attempt failed.
|
|
252
|
+
* However, depending on the deployment strategy, if an update that cannot be successfully installed is deployed, this option could result in an infinite update retry loop.
|
|
253
|
+
* Defaults to true.
|
|
254
|
+
*/
|
|
255
|
+
ignoreFailedUpdates?: boolean;
|
|
367
256
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
257
|
+
/**
|
|
258
|
+
* (algocare PR preview release extension)
|
|
259
|
+
* When given, only PR preview releases (`{prNumber}-{semver}` keys in the release history)
|
|
260
|
+
* are considered during the update check. Normal releases are ignored.
|
|
261
|
+
*/
|
|
262
|
+
prNumber?: string;
|
|
263
|
+
}
|
|
372
264
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
265
|
+
export interface UpdateDialog {
|
|
266
|
+
/**
|
|
267
|
+
* Indicates whether you would like to append the description of an available release to the
|
|
268
|
+
* notification message which is displayed to the end user. Defaults to false.
|
|
269
|
+
*/
|
|
270
|
+
appendReleaseDescription?: boolean;
|
|
377
271
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
272
|
+
/**
|
|
273
|
+
* Indicates the string you would like to prefix the release description with, if any, when
|
|
274
|
+
* displaying the update notification to the end user. Defaults to " Description: "
|
|
275
|
+
*/
|
|
276
|
+
descriptionPrefix?: string;
|
|
382
277
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
* this method automatically when needed in other cases) as it could lead to unpredictable behavior.
|
|
388
|
-
*/
|
|
389
|
-
function clearUpdates(): void
|
|
278
|
+
/**
|
|
279
|
+
* The text to use for the button the end user must press in order to install a mandatory update. Defaults to "Continue".
|
|
280
|
+
*/
|
|
281
|
+
mandatoryContinueButtonLabel?: string;
|
|
390
282
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
function restartApp(onlyIfUpdateIsPending?: boolean): void
|
|
283
|
+
/**
|
|
284
|
+
* The text used as the body of an update notification, when the update is specified as mandatory.
|
|
285
|
+
* Defaults to "An update is available that must be installed.".
|
|
286
|
+
*/
|
|
287
|
+
mandatoryUpdateMessage?: string;
|
|
397
288
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
* @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.
|
|
403
|
-
* @param downloadProgressCallback An optional callback that allows tracking the progress of an update while it is being downloaded.
|
|
404
|
-
* @param handleBinaryVersionMismatchCallback An optional callback for handling target binary version mismatch
|
|
405
|
-
*/
|
|
406
|
-
function sync(
|
|
407
|
-
options?: SyncOptions,
|
|
408
|
-
syncStatusChangedCallback?: SyncStatusChangedCallback,
|
|
409
|
-
downloadProgressCallback?: DownloadProgressCallback,
|
|
410
|
-
handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback
|
|
411
|
-
): Promise<SyncStatus>
|
|
289
|
+
/**
|
|
290
|
+
* The text to use for the button the end user can press in order to ignore an optional update that is available. Defaults to "Ignore".
|
|
291
|
+
*/
|
|
292
|
+
optionalIgnoreButtonLabel?: string;
|
|
412
293
|
|
|
413
|
-
/**
|
|
414
|
-
* Indicates when you would like an installed update to actually be applied.
|
|
415
|
-
*/
|
|
416
|
-
enum InstallMode {
|
|
417
294
|
/**
|
|
418
|
-
*
|
|
295
|
+
* The text to use for the button the end user can press in order to install an optional update. Defaults to "Install".
|
|
419
296
|
*/
|
|
420
|
-
|
|
297
|
+
optionalInstallButtonLabel?: string;
|
|
421
298
|
|
|
422
299
|
/**
|
|
423
|
-
*
|
|
300
|
+
* The text used as the body of an update notification, when the update is optional. Defaults to "An update is available. Would you like to install it?".
|
|
424
301
|
*/
|
|
425
|
-
|
|
302
|
+
optionalUpdateMessage?: string;
|
|
426
303
|
|
|
427
304
|
/**
|
|
428
|
-
*
|
|
429
|
-
* the end user resumes it from the background. This way, you don't disrupt their current session,
|
|
430
|
-
* but you can get the update in front of them sooner then having to wait for the next natural restart.
|
|
431
|
-
* This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
|
|
305
|
+
* The text used as the header of an update notification that is displayed to the end user. Defaults to "Update available".
|
|
432
306
|
*/
|
|
433
|
-
|
|
307
|
+
title?: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export interface RollbackRetryOptions {
|
|
311
|
+
/**
|
|
312
|
+
* Specifies the minimum time in hours that the app will wait after the latest rollback
|
|
313
|
+
* before attempting to reinstall same rolled-back package. Defaults to `24`.
|
|
314
|
+
*/
|
|
315
|
+
delayInHours?: number;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Specifies the maximum number of retry attempts that the app can make before it stops trying.
|
|
319
|
+
* Cannot be less than `1`. Defaults to `1`.
|
|
320
|
+
*/
|
|
321
|
+
maxRetryAttempts?: number;
|
|
322
|
+
}
|
|
434
323
|
|
|
324
|
+
export interface StatusReport {
|
|
435
325
|
/**
|
|
436
|
-
*
|
|
437
|
-
* but only after it has been in the background for "minimumBackgroundDuration" seconds (0 by default),
|
|
438
|
-
* so that user context isn't lost unless the app suspension is long enough to not matter.
|
|
326
|
+
* Whether the deployment succeeded or failed.
|
|
439
327
|
*/
|
|
440
|
-
|
|
441
|
-
}
|
|
328
|
+
status: CodePush.DeploymentStatus;
|
|
442
329
|
|
|
443
|
-
/**
|
|
444
|
-
* Indicates the current status of a sync operation.
|
|
445
|
-
*/
|
|
446
|
-
enum SyncStatus {
|
|
447
330
|
/**
|
|
448
|
-
* The app
|
|
331
|
+
* The version of the app that was deployed (for a native app upgrade).
|
|
449
332
|
*/
|
|
450
|
-
|
|
333
|
+
appVersion?: string;
|
|
451
334
|
|
|
452
335
|
/**
|
|
453
|
-
*
|
|
454
|
-
* syncStatusChangedCallback function returns or the next time the app resumes/restarts,
|
|
455
|
-
* depending on the InstallMode specified in SyncOptions
|
|
336
|
+
* Details of the package that was deployed (or attempted to).
|
|
456
337
|
*/
|
|
457
|
-
|
|
338
|
+
package?: Package;
|
|
458
339
|
|
|
459
340
|
/**
|
|
460
|
-
*
|
|
461
|
-
* (This is only applicable when the updateDialog is used)
|
|
341
|
+
* Deployment key used when deploying the previous package.
|
|
462
342
|
*/
|
|
463
|
-
|
|
343
|
+
previousDeploymentKey?: string;
|
|
464
344
|
|
|
465
345
|
/**
|
|
466
|
-
* The
|
|
346
|
+
* The label (v#) of the package that was upgraded from.
|
|
467
347
|
*/
|
|
468
|
-
|
|
348
|
+
previousLabelOrAppVersion?: string;
|
|
349
|
+
}
|
|
469
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Decorates a React Component configuring it to sync for updates with the CodePush server.
|
|
353
|
+
*
|
|
354
|
+
* @param options Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show an prompt?, install the update immediately?).
|
|
355
|
+
*/
|
|
356
|
+
declare function CodePush(options?: CodePushOptions): (x: any) => any;
|
|
357
|
+
|
|
358
|
+
declare namespace CodePush {
|
|
470
359
|
/**
|
|
471
|
-
*
|
|
360
|
+
* Represents the default settings that will be used by the sync method if
|
|
361
|
+
* an update dialog is configured to be displayed.
|
|
472
362
|
*/
|
|
473
|
-
|
|
363
|
+
var DEFAULT_UPDATE_DIALOG: UpdateDialog;
|
|
474
364
|
|
|
475
365
|
/**
|
|
476
|
-
*
|
|
366
|
+
* Asks the CodePush service whether the configured app deployment has an update available.
|
|
367
|
+
*
|
|
368
|
+
* @param handleBinaryVersionMismatchCallback An optional callback for handling target binary version mismatch
|
|
369
|
+
* @param prNumber (algocare PR preview release extension) When given, only PR preview releases
|
|
370
|
+
* (`{prNumber}-{semver}` keys in the release history) are considered.
|
|
477
371
|
*/
|
|
478
|
-
|
|
372
|
+
function checkForUpdate(handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback, prNumber?: string): Promise<RemotePackage | null>;
|
|
479
373
|
|
|
480
374
|
/**
|
|
481
|
-
*
|
|
482
|
-
*
|
|
375
|
+
* Retrieves the metadata for an installed update (e.g. description, mandatory).
|
|
376
|
+
*
|
|
377
|
+
* @param updateState The state of the update you want to retrieve the metadata for. Defaults to UpdateState.RUNNING.
|
|
483
378
|
*/
|
|
484
|
-
|
|
379
|
+
function getUpdateMetadata(updateState?: UpdateState): Promise<LocalPackage|null>;
|
|
485
380
|
|
|
486
381
|
/**
|
|
487
|
-
*
|
|
382
|
+
* Notifies the CodePush runtime that an installed update is considered successful.
|
|
488
383
|
*/
|
|
489
|
-
|
|
384
|
+
function notifyAppReady(): Promise<StatusReport|void>;
|
|
490
385
|
|
|
491
386
|
/**
|
|
492
|
-
*
|
|
387
|
+
* Allow CodePush to restart the app.
|
|
493
388
|
*/
|
|
494
|
-
|
|
389
|
+
function allowRestart(): void;
|
|
495
390
|
|
|
496
391
|
/**
|
|
497
|
-
*
|
|
498
|
-
* This status is only reported on iOS when the native module supports it.
|
|
392
|
+
* Forbid CodePush to restart the app.
|
|
499
393
|
*/
|
|
500
|
-
|
|
501
|
-
}
|
|
394
|
+
function disallowRestart(): void;
|
|
502
395
|
|
|
503
|
-
/**
|
|
504
|
-
* Indicates the state that an update is currently in.
|
|
505
|
-
*/
|
|
506
|
-
enum UpdateState {
|
|
507
396
|
/**
|
|
508
|
-
*
|
|
509
|
-
*
|
|
397
|
+
* Clear all downloaded CodePush updates.
|
|
398
|
+
* This is useful when switching to a different deployment which may have an older release than the current package.
|
|
399
|
+
* Note: we don’t recommend to use this method in scenarios other than that (CodePush will call
|
|
400
|
+
* this method automatically when needed in other cases) as it could lead to unpredictable behavior.
|
|
510
401
|
*/
|
|
511
|
-
|
|
402
|
+
function clearUpdates(): void;
|
|
512
403
|
|
|
513
404
|
/**
|
|
514
|
-
*
|
|
515
|
-
*
|
|
405
|
+
* Immediately restarts the app.
|
|
406
|
+
*
|
|
407
|
+
* @param onlyIfUpdateIsPending Indicates whether you want the restart to no-op if there isn't currently a pending update.
|
|
516
408
|
*/
|
|
517
|
-
|
|
409
|
+
function restartApp(onlyIfUpdateIsPending?: boolean): void;
|
|
518
410
|
|
|
519
411
|
/**
|
|
520
|
-
*
|
|
521
|
-
*
|
|
412
|
+
* Allows checking for an update, downloading it and installing it, all with a single call.
|
|
413
|
+
*
|
|
414
|
+
* @param options Options used to configure the end-user update experience (e.g. show an prompt?, install the update immediately?).
|
|
415
|
+
* @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.
|
|
416
|
+
* @param downloadProgressCallback An optional callback that allows tracking the progress of an update while it is being downloaded.
|
|
417
|
+
* @param handleBinaryVersionMismatchCallback An optional callback for handling target binary version mismatch
|
|
522
418
|
*/
|
|
523
|
-
|
|
524
|
-
}
|
|
419
|
+
function sync(options?: SyncOptions, syncStatusChangedCallback?: SyncStatusChangedCallback, downloadProgressCallback?: DownloadProgressCallback, handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback): Promise<SyncStatus>;
|
|
525
420
|
|
|
526
|
-
/**
|
|
527
|
-
* Indicates the status of a deployment (after installing and restarting).
|
|
528
|
-
*/
|
|
529
|
-
enum DeploymentStatus {
|
|
530
421
|
/**
|
|
531
|
-
*
|
|
422
|
+
* Indicates when you would like an installed update to actually be applied.
|
|
532
423
|
*/
|
|
533
|
-
|
|
424
|
+
enum InstallMode {
|
|
425
|
+
/**
|
|
426
|
+
* Indicates that you want to install the update and restart the app immediately.
|
|
427
|
+
*/
|
|
428
|
+
IMMEDIATE,
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Indicates that you want to install the update, but not forcibly restart the app.
|
|
432
|
+
*/
|
|
433
|
+
ON_NEXT_RESTART,
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Indicates that you want to install the update, but don't want to restart the app until the next time
|
|
437
|
+
* the end user resumes it from the background. This way, you don't disrupt their current session,
|
|
438
|
+
* but you can get the update in front of them sooner then having to wait for the next natural restart.
|
|
439
|
+
* This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
|
|
440
|
+
*/
|
|
441
|
+
ON_NEXT_RESUME,
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Indicates that you want to install the update when the app is in the background,
|
|
445
|
+
* but only after it has been in the background for "minimumBackgroundDuration" seconds (0 by default),
|
|
446
|
+
* so that user context isn't lost unless the app suspension is long enough to not matter.
|
|
447
|
+
*/
|
|
448
|
+
ON_NEXT_SUSPEND
|
|
449
|
+
}
|
|
534
450
|
|
|
535
451
|
/**
|
|
536
|
-
*
|
|
452
|
+
* Indicates the current status of a sync operation.
|
|
537
453
|
*/
|
|
538
|
-
|
|
539
|
-
|
|
454
|
+
enum SyncStatus {
|
|
455
|
+
/**
|
|
456
|
+
* The app is up-to-date with the CodePush server.
|
|
457
|
+
*/
|
|
458
|
+
UP_TO_DATE,
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* An available update has been installed and will be run either immediately after the
|
|
462
|
+
* syncStatusChangedCallback function returns or the next time the app resumes/restarts,
|
|
463
|
+
* depending on the InstallMode specified in SyncOptions
|
|
464
|
+
*/
|
|
465
|
+
UPDATE_INSTALLED,
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* The app had an optional update which the end user chose to ignore.
|
|
469
|
+
* (This is only applicable when the updateDialog is used)
|
|
470
|
+
*/
|
|
471
|
+
UPDATE_IGNORED,
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* The sync operation encountered an unknown error.
|
|
475
|
+
*/
|
|
476
|
+
UNKNOWN_ERROR,
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* There is an ongoing sync operation running which prevents the current call from being executed.
|
|
480
|
+
*/
|
|
481
|
+
SYNC_IN_PROGRESS,
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* The CodePush server is being queried for an update.
|
|
485
|
+
*/
|
|
486
|
+
CHECKING_FOR_UPDATE,
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* An update is available, and a confirmation dialog was shown
|
|
490
|
+
* to the end user. (This is only applicable when the updateDialog is used)
|
|
491
|
+
*/
|
|
492
|
+
AWAITING_USER_ACTION,
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* An available update is being downloaded from the CodePush server.
|
|
496
|
+
*/
|
|
497
|
+
DOWNLOADING_PACKAGE,
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* An available update was downloaded and is about to be installed.
|
|
501
|
+
*/
|
|
502
|
+
INSTALLING_UPDATE,
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* The update has been downloaded and post-processing (unzip/file copy) is in progress.
|
|
506
|
+
* This status is only reported on iOS when the native module supports it.
|
|
507
|
+
*/
|
|
508
|
+
PREPARING_UPDATE
|
|
509
|
+
}
|
|
540
510
|
|
|
541
|
-
/**
|
|
542
|
-
* Indicates when you would like to check for (and install) updates from the CodePush server.
|
|
543
|
-
*/
|
|
544
|
-
enum CheckFrequency {
|
|
545
511
|
/**
|
|
546
|
-
*
|
|
512
|
+
* Indicates the state that an update is currently in.
|
|
547
513
|
*/
|
|
548
|
-
|
|
514
|
+
enum UpdateState {
|
|
515
|
+
/**
|
|
516
|
+
* Indicates that an update represents the
|
|
517
|
+
* version of the app that is currently running.
|
|
518
|
+
*/
|
|
519
|
+
RUNNING,
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Indicates than an update has been installed, but the
|
|
523
|
+
* app hasn't been restarted yet in order to apply it.
|
|
524
|
+
*/
|
|
525
|
+
PENDING,
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Indicates than an update represents the latest available
|
|
529
|
+
* release, and can be either currently running or pending.
|
|
530
|
+
*/
|
|
531
|
+
LATEST
|
|
532
|
+
}
|
|
549
533
|
|
|
550
534
|
/**
|
|
551
|
-
*
|
|
535
|
+
* Indicates the status of a deployment (after installing and restarting).
|
|
552
536
|
*/
|
|
553
|
-
|
|
537
|
+
enum DeploymentStatus {
|
|
538
|
+
/**
|
|
539
|
+
* The deployment failed (and was rolled back).
|
|
540
|
+
*/
|
|
541
|
+
FAILED,
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The deployment succeeded.
|
|
545
|
+
*/
|
|
546
|
+
SUCCEEDED
|
|
547
|
+
}
|
|
554
548
|
|
|
555
549
|
/**
|
|
556
|
-
*
|
|
550
|
+
* Indicates when you would like to check for (and install) updates from the CodePush server.
|
|
557
551
|
*/
|
|
558
|
-
|
|
559
|
-
|
|
552
|
+
enum CheckFrequency {
|
|
553
|
+
/**
|
|
554
|
+
* When the app is fully initialized (or more specifically, when the root component is mounted).
|
|
555
|
+
*/
|
|
556
|
+
ON_APP_START,
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* When the app re-enters the foreground.
|
|
560
|
+
*/
|
|
561
|
+
ON_APP_RESUME,
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Don't automatically check for updates, but only do it when codePush.sync() is manully called inside app code.
|
|
565
|
+
*/
|
|
566
|
+
MANUAL
|
|
567
|
+
}
|
|
560
568
|
}
|
|
561
569
|
|
|
562
|
-
export default CodePush
|
|
570
|
+
export default CodePush;
|
|
563
571
|
|
|
564
572
|
/**
|
|
565
573
|
* Interface for the config file required for `npx code-push` CLI operation.
|
|
@@ -567,55 +575,111 @@ export default CodePush
|
|
|
567
575
|
* Please refer to the example code for implementation guidance.
|
|
568
576
|
*/
|
|
569
577
|
export interface CliConfigInterface {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
578
|
+
/**
|
|
579
|
+
* Interface that must be implemented to upload CodePush bundle files to an arbitrary infrastructure.
|
|
580
|
+
*
|
|
581
|
+
* Used in the `release` command, and must return a URL that allows downloading the file after the upload is completed.
|
|
582
|
+
* The URL is recorded in the ReleaseHistory, and the CodePush runtime library downloads the bundle file from this address.
|
|
583
|
+
*
|
|
584
|
+
* @param source The relative path of the generated bundle file. (e.g. build/bundleOutput/1087bc338fc45a961c...)
|
|
585
|
+
* @param platform The target platform of the bundle file. This is the string passed when executing the CLI command. ('ios'/'android')
|
|
586
|
+
* @return {Promise<{downloadUrl: string}>} An object containing the `downloadUrl` property, which is the URL from which the uploaded bundle file can be downloaded. This URL will be recorded in the release history.
|
|
587
|
+
*/
|
|
588
|
+
bundleUploader: (
|
|
589
|
+
source: string,
|
|
590
|
+
platform: "ios" | "android",
|
|
591
|
+
identifier?: string,
|
|
592
|
+
app?: string,
|
|
593
|
+
) => Promise<{downloadUrl: string}>;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Interface that must be implemented to retrieve ReleaseHistory information.
|
|
597
|
+
*
|
|
598
|
+
* Use `fetch`, `axios`, or similar methods to fetch the data and return it.
|
|
599
|
+
*
|
|
600
|
+
* @param targetBinaryVersion The target binary app version for which ReleaseHistory information is retrieved. This string is passed when executing the CLI command. (e.g., '1.0.0')
|
|
601
|
+
* @param platform The target platform for which the information is retrieved. This string is passed when executing the CLI command. ('ios'/'android')
|
|
602
|
+
* @param identifier An additional identifier string. This string is passed when executing the CLI command.
|
|
603
|
+
*/
|
|
604
|
+
getReleaseHistory: (
|
|
605
|
+
targetBinaryVersion: string,
|
|
606
|
+
platform: "ios" | "android",
|
|
607
|
+
identifier?: string,
|
|
608
|
+
app?: string,
|
|
609
|
+
) => Promise<ReleaseHistoryInterface>;
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Interface that must be implemented to create or update ReleaseHistory information.
|
|
613
|
+
*
|
|
614
|
+
* Used in the `create-history`, `release`, and `update-history` commands.
|
|
615
|
+
* The created or modified object and the JSON file path containing the result of the command execution are provided.
|
|
616
|
+
* Implement this function to upload the file or call a REST API to update the release history.
|
|
617
|
+
*
|
|
618
|
+
* @param targetBinaryVersion The target binary app version for the ReleaseHistory. This string is passed when executing the CLI command. (e.g., '1.0.0')
|
|
619
|
+
* @param jsonFilePath The absolute path to a JSON file following the `ReleaseHistoryInterface` structure. The file is created in the project's root directory and deleted when the command execution completes.
|
|
620
|
+
* @param releaseInfo A plain object following the `ReleaseHistoryInterface` structure.
|
|
621
|
+
* @param platform The target platform. This string is passed when executing the CLI command. ('ios'/'android')
|
|
622
|
+
* @param identifier An additional identifier string. This string is passed when executing the CLI command.
|
|
623
|
+
*/
|
|
624
|
+
setReleaseHistory: (
|
|
625
|
+
targetBinaryVersion: string,
|
|
626
|
+
jsonFilePath: string,
|
|
627
|
+
releaseInfo: ReleaseHistoryInterface,
|
|
628
|
+
platform: "ios" | "android",
|
|
629
|
+
identifier?: string,
|
|
630
|
+
app?: string,
|
|
631
|
+
) => Promise<void>;
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* (Optional / algocare extension) Retrieves the binary version list file (`list.json`) that indexes
|
|
635
|
+
* all binary versions for which a release history exists.
|
|
636
|
+
*
|
|
637
|
+
* Used in the `create-history` command. If not implemented, the `list.json` update step is skipped.
|
|
638
|
+
*
|
|
639
|
+
* @param platform The target platform. ('ios'/'android')
|
|
640
|
+
* @param identifier An additional identifier string. (e.g. 'stg'/'prd')
|
|
641
|
+
* @param app The target app name. (e.g. 'home-mobile')
|
|
642
|
+
* @return An object mapping binary versions to their release history URLs. (e.g. { "1.0.0": "https://cdn/histories/home-mobile/ios/1.0.0.json" })
|
|
643
|
+
*/
|
|
644
|
+
getBinaryVersionList?: (
|
|
645
|
+
platform: "ios" | "android",
|
|
646
|
+
identifier?: string,
|
|
647
|
+
app?: string,
|
|
648
|
+
) => Promise<Record<string, string>>;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* (Optional / algocare extension) Adds a binary version entry to the binary version list file (`list.json`).
|
|
652
|
+
*
|
|
653
|
+
* Used in the `create-history` command. If not implemented, the `list.json` update step is skipped.
|
|
654
|
+
*
|
|
655
|
+
* @param targetBinaryVersion The binary version to add to the list.
|
|
656
|
+
* @param jsonFilePath The absolute path to a JSON file containing the current list content (before adding the new version).
|
|
657
|
+
* @param platform The target platform. ('ios'/'android')
|
|
658
|
+
* @param identifier An additional identifier string. (e.g. 'stg'/'prd')
|
|
659
|
+
* @param app The target app name. (e.g. 'home-mobile')
|
|
660
|
+
*/
|
|
661
|
+
setBinaryVersionList?: (
|
|
662
|
+
targetBinaryVersion: string,
|
|
663
|
+
jsonFilePath: string,
|
|
664
|
+
platform: "ios" | "android",
|
|
665
|
+
identifier?: string,
|
|
666
|
+
app?: string,
|
|
667
|
+
) => Promise<void>;
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* (Optional / algocare extension) Removes a release history file.
|
|
671
|
+
*
|
|
672
|
+
* Used in the `remove-pr-history` command to clean up PR preview release histories.
|
|
673
|
+
*
|
|
674
|
+
* @param targetBinaryVersion The binary version (or PR number for PR preview histories) whose history should be removed.
|
|
675
|
+
* @param platform The target platform. ('ios'/'android')
|
|
676
|
+
* @param identifier An additional identifier string. (e.g. 'stg'/'prd')
|
|
677
|
+
* @param app The target app name. (e.g. 'home-mobile')
|
|
678
|
+
*/
|
|
679
|
+
removeReleaseHistory?: (
|
|
680
|
+
targetBinaryVersion: string,
|
|
681
|
+
platform: "ios" | "android",
|
|
682
|
+
identifier?: string,
|
|
683
|
+
app?: string,
|
|
684
|
+
) => Promise<void>;
|
|
621
685
|
}
|