expo-updates 0.25.3 → 0.25.5
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/CHANGELOG.md +10 -0
- package/android/build.gradle +2 -2
- package/build/ExpoUpdatesModule.types.d.ts +3 -0
- package/build/ExpoUpdatesModule.types.d.ts.map +1 -1
- package/build/ExpoUpdatesModule.types.js.map +1 -1
- package/build/Updates.d.ts +13 -12
- package/build/Updates.d.ts.map +1 -1
- package/build/Updates.js +13 -12
- package/build/Updates.js.map +1 -1
- package/build/Updates.types.d.ts +6 -4
- package/build/Updates.types.d.ts.map +1 -1
- package/build/Updates.types.js +3 -3
- package/build/Updates.types.js.map +1 -1
- package/build/UseUpdates.types.d.ts +15 -15
- package/build/UseUpdates.types.d.ts.map +1 -1
- package/build/UseUpdates.types.js.map +1 -1
- package/build/statemachine/UpdatesStateMachine.d.ts +2 -2
- package/build/statemachine/UpdatesStateMachine.js +2 -2
- package/build/statemachine/UpdatesStateMachine.js.map +1 -1
- package/cli/build/generateFingerprint.js +7 -1
- package/cli/build/resolveRuntimeVersion.js +8 -0
- package/cli/build/syncConfigurationToNative.js +7 -0
- package/cli/build/syncConfigurationToNativeAsync.d.ts +2 -0
- package/cli/build/syncConfigurationToNativeAsync.js +1 -3
- package/cli/src/generateFingerprint.ts +10 -1
- package/cli/src/resolveRuntimeVersion.ts +20 -4
- package/cli/src/syncConfigurationToNative.ts +10 -0
- package/cli/src/syncConfigurationToNativeAsync.ts +3 -3
- package/package.json +2 -2
- package/src/ExpoUpdatesModule.types.ts +3 -0
- package/src/Updates.ts +13 -12
- package/src/Updates.types.ts +6 -6
- package/src/UseUpdates.types.ts +15 -14
- package/src/statemachine/UpdatesStateMachine.ts +2 -2
- package/utils/build/createFingerprintAsync.d.ts +2 -1
- package/utils/build/createFingerprintForBuildAsync.js +8 -5
- package/utils/build/resolveRuntimeVersionAsync.d.ts +4 -1
- package/utils/build/resolveRuntimeVersionAsync.js +3 -3
- package/utils/build/vcs.js +8 -2
- package/utils/build/workflow.d.ts +3 -1
- package/utils/build/workflow.js +8 -1
- package/utils/src/createFingerprintAsync.ts +3 -1
- package/utils/src/createFingerprintForBuildAsync.ts +9 -6
- package/utils/src/resolveRuntimeVersionAsync.ts +11 -4
- package/utils/src/vcs.ts +9 -2
- package/utils/src/workflow.ts +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.25.5 — 2024-04-24
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 0.25.4 — 2024-04-24
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Fix CLI VCS detection in CLI and add workflow override ability. ([#28403](https://github.com/expo/expo/pull/28403) by [@wschurman](https://github.com/wschurman))
|
|
22
|
+
|
|
13
23
|
## 0.25.3 — 2024-04-24
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
|
|
2
2
|
apply plugin: 'kotlin-kapt'
|
|
3
3
|
|
|
4
4
|
group = 'host.exp.exponent'
|
|
5
|
-
version = '0.25.
|
|
5
|
+
version = '0.25.5'
|
|
6
6
|
|
|
7
7
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
8
8
|
apply from: expoModulesCorePlugin
|
|
@@ -48,7 +48,7 @@ android {
|
|
|
48
48
|
namespace "expo.modules.updates"
|
|
49
49
|
defaultConfig {
|
|
50
50
|
versionCode 31
|
|
51
|
-
versionName '0.25.
|
|
51
|
+
versionName '0.25.5'
|
|
52
52
|
consumerProguardFiles("proguard-rules.pro")
|
|
53
53
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
54
54
|
|
|
@@ -45,6 +45,9 @@ export interface ExpoUpdatesModule extends Pick<ProxyNativeModule, 'addListener'
|
|
|
45
45
|
} | {
|
|
46
46
|
manifest: Manifest;
|
|
47
47
|
})) | UpdateFetchResultFailure | UpdateFetchResultRollBackToEmbedded>;
|
|
48
|
+
/**
|
|
49
|
+
* @hidden
|
|
50
|
+
*/
|
|
48
51
|
getNativeStateMachineContextAsync: () => Promise<UpdatesNativeStateMachineContext & {
|
|
49
52
|
latestManifestString?: string;
|
|
50
53
|
downloadedManifestString?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoUpdatesModule.types.d.ts","sourceRoot":"","sources":["../src/ExpoUpdatesModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,6BAA6B,EAC7B,yBAAyB,EACzB,mCAAmC,EACnC,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,gCAAgC,EACjC,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,iBAAiB,CAAC;IAClE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD,EAAE,OAAO,CAAC;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;O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ChC,CAAC;IACF,mBAAmB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IACpE,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,gBAAgB,EAAE,MAAM,OAAO,CAC3B,CAAC,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,GACzC,CAAC;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC,GACxD,wBAAwB,GACxB,mCAAmC,CACtC,CAAC;IACF;;OAEG;IACH,iCAAiC,EAAE,MAAM,OAAO,CAC9C,gCAAgC,GAAG;QACjC,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,4BAA4B,CAAC,EAAE,MAAM,CAAC;QACtC,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CACF,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoUpdatesModule.types.js","sourceRoot":"","sources":["../src/ExpoUpdatesModule.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport {\n Manifest,\n UpdateCheckResultAvailable,\n UpdateCheckResultNotAvailable,\n UpdateCheckResultRollBack,\n UpdateFetchResultRollBackToEmbedded,\n UpdateFetchResultFailure,\n UpdateFetchResultSuccess,\n UpdatesLogEntry,\n UpdatesNativeStateMachineContext,\n} from './Updates.types';\n\n/**\n * @internal\n */\nexport interface ExpoUpdatesModule\n extends Pick<ProxyNativeModule, 'addListener' | 'removeListeners'> {\n isEmergencyLaunch: boolean;\n emergencyLaunchReason: string | null;\n isEmbeddedLaunch: boolean;\n isEnabled: boolean;\n isUsingEmbeddedAssets?: boolean;\n /**\n * Can be empty string\n */\n runtimeVersion: string;\n checkAutomatically: string;\n /**\n * Can be empty string\n */\n channel: string;\n shouldDeferToNativeForAPIMethodAvailabilityInDevelopment: boolean;\n updateId?: string;\n commitTime?: string;\n /**\n * @platform android\n */\n manifestString?: string;\n /**\n * @platform ios\n */\n manifest?: Manifest;\n localAssets?: Record<string, string>;\n\n reload: () => Promise<void>;\n checkForUpdateAsync: () => Promise<\n | UpdateCheckResultRollBack\n | (Omit<UpdateCheckResultAvailable, 'manifest'> &\n ({ manifestString: string } | { manifest: Manifest }))\n | UpdateCheckResultNotAvailable\n >;\n getExtraParamsAsync: () => Promise<Record<string, string>>;\n setExtraParamAsync: (key: string, value: string | null) => Promise<void>;\n readLogEntriesAsync: (maxAge: number) => Promise<UpdatesLogEntry[]>;\n clearLogEntriesAsync: () => Promise<void>;\n fetchUpdateAsync: () => Promise<\n | (Omit<UpdateFetchResultSuccess, 'manifest'> &\n ({ manifestString: string } | { manifest: Manifest }))\n | UpdateFetchResultFailure\n | UpdateFetchResultRollBackToEmbedded\n >;\n getNativeStateMachineContextAsync: () => Promise<\n UpdatesNativeStateMachineContext & {\n latestManifestString?: string;\n downloadedManifestString?: string;\n lastCheckForUpdateTimeString?: string;\n rollbackString?: string;\n }\n >;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ExpoUpdatesModule.types.js","sourceRoot":"","sources":["../src/ExpoUpdatesModule.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport {\n Manifest,\n UpdateCheckResultAvailable,\n UpdateCheckResultNotAvailable,\n UpdateCheckResultRollBack,\n UpdateFetchResultRollBackToEmbedded,\n UpdateFetchResultFailure,\n UpdateFetchResultSuccess,\n UpdatesLogEntry,\n UpdatesNativeStateMachineContext,\n} from './Updates.types';\n\n/**\n * @internal\n */\nexport interface ExpoUpdatesModule\n extends Pick<ProxyNativeModule, 'addListener' | 'removeListeners'> {\n isEmergencyLaunch: boolean;\n emergencyLaunchReason: string | null;\n isEmbeddedLaunch: boolean;\n isEnabled: boolean;\n isUsingEmbeddedAssets?: boolean;\n /**\n * Can be empty string\n */\n runtimeVersion: string;\n checkAutomatically: string;\n /**\n * Can be empty string\n */\n channel: string;\n shouldDeferToNativeForAPIMethodAvailabilityInDevelopment: boolean;\n updateId?: string;\n commitTime?: string;\n /**\n * @platform android\n */\n manifestString?: string;\n /**\n * @platform ios\n */\n manifest?: Manifest;\n localAssets?: Record<string, string>;\n\n reload: () => Promise<void>;\n checkForUpdateAsync: () => Promise<\n | UpdateCheckResultRollBack\n | (Omit<UpdateCheckResultAvailable, 'manifest'> &\n ({ manifestString: string } | { manifest: Manifest }))\n | UpdateCheckResultNotAvailable\n >;\n getExtraParamsAsync: () => Promise<Record<string, string>>;\n setExtraParamAsync: (key: string, value: string | null) => Promise<void>;\n readLogEntriesAsync: (maxAge: number) => Promise<UpdatesLogEntry[]>;\n clearLogEntriesAsync: () => Promise<void>;\n fetchUpdateAsync: () => Promise<\n | (Omit<UpdateFetchResultSuccess, 'manifest'> &\n ({ manifestString: string } | { manifest: Manifest }))\n | UpdateFetchResultFailure\n | UpdateFetchResultRollBackToEmbedded\n >;\n /**\n * @hidden\n */\n getNativeStateMachineContextAsync: () => Promise<\n UpdatesNativeStateMachineContext & {\n latestManifestString?: string;\n downloadedManifestString?: string;\n lastCheckForUpdateTimeString?: string;\n rollbackString?: string;\n }\n >;\n}\n"]}
|
package/build/Updates.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocalAssets, Manifest, UpdateCheckResult, UpdateFetchResult, UpdatesCheckAutomaticallyValue, UpdatesLogEntry, UpdatesNativeStateMachineContext } from './Updates.types';
|
|
2
2
|
/**
|
|
3
|
-
* Whether expo-updates is enabled. This may be false in a variety of cases including:
|
|
3
|
+
* Whether `expo-updates` is enabled. This may be false in a variety of cases including:
|
|
4
4
|
* - enabled set to false in configuration
|
|
5
5
|
* - missing or invalid URL in configuration
|
|
6
6
|
* - missing runtime version or SDK version in configuration
|
|
@@ -13,7 +13,8 @@ export declare const isEnabled: boolean;
|
|
|
13
13
|
* The UUID that uniquely identifies the currently running update. The
|
|
14
14
|
* UUID is represented in its canonical string form and will always use lowercase letters.
|
|
15
15
|
* This value is `null` when running in a local development environment or any other environment where `expo-updates` is disabled.
|
|
16
|
-
* @example
|
|
16
|
+
* @example
|
|
17
|
+
* `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"`
|
|
17
18
|
*/
|
|
18
19
|
export declare const updateId: string | null;
|
|
19
20
|
/**
|
|
@@ -27,7 +28,7 @@ export declare const channel: string | null;
|
|
|
27
28
|
*/
|
|
28
29
|
export declare const runtimeVersion: string | null;
|
|
29
30
|
/**
|
|
30
|
-
* Determines if and when expo-updates checks for and downloads updates automatically on startup.
|
|
31
|
+
* Determines if and when `expo-updates` checks for and downloads updates automatically on startup.
|
|
31
32
|
*/
|
|
32
33
|
export declare const checkAutomatically: UpdatesCheckAutomaticallyValue | null;
|
|
33
34
|
/**
|
|
@@ -88,7 +89,7 @@ export declare const createdAt: Date | null;
|
|
|
88
89
|
* the state of the native module and main threads.
|
|
89
90
|
*
|
|
90
91
|
* This method cannot be used in Expo Go or development mode, and the returned promise will be rejected if you
|
|
91
|
-
* try to do so. It also rejects when expo-updates is not enabled.
|
|
92
|
+
* try to do so. It also rejects when `expo-updates` is not enabled.
|
|
92
93
|
*
|
|
93
94
|
* @return A promise that fulfills right before the reload instruction is sent to the JS runtime, or
|
|
94
95
|
* rejects if it cannot find a reference to the JS runtime. If the promise is rejected in production
|
|
@@ -113,27 +114,27 @@ export declare function reloadAsync(): Promise<void>;
|
|
|
113
114
|
* @return A promise that fulfills with an [`UpdateCheckResult`](#updatecheckresult) object.
|
|
114
115
|
*
|
|
115
116
|
* The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or
|
|
116
|
-
* timeout communicating with the server. It also rejects when expo-updates is not enabled.
|
|
117
|
+
* timeout communicating with the server. It also rejects when `expo-updates` is not enabled.
|
|
117
118
|
*/
|
|
118
119
|
export declare function checkForUpdateAsync(): Promise<UpdateCheckResult>;
|
|
119
120
|
/**
|
|
120
121
|
* Retrieves the current extra params.
|
|
121
122
|
*
|
|
122
|
-
* This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.
|
|
123
|
+
* This method cannot be used in Expo Go or development mode. It also rejects when `expo-updates` is not enabled.
|
|
123
124
|
*/
|
|
124
125
|
export declare function getExtraParamsAsync(): Promise<Record<string, string>>;
|
|
125
126
|
/**
|
|
126
127
|
* Sets an extra param if value is non-null, otherwise unsets the param.
|
|
127
|
-
* Extra params are sent as an [Expo Structured Field Value Dictionary](
|
|
128
|
+
* Extra params are sent as an [Expo Structured Field Value Dictionary](/technical-specs/expo-sfv-0/)
|
|
128
129
|
* in the `Expo-Extra-Params` header of update requests. A compliant update server may use these params when selecting an update to serve.
|
|
129
130
|
*
|
|
130
|
-
* This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.
|
|
131
|
+
* This method cannot be used in Expo Go or development mode. It also rejects when `expo-updates` is not enabled.
|
|
131
132
|
*/
|
|
132
133
|
export declare function setExtraParamAsync(key: string, value: string | null | undefined): Promise<void>;
|
|
133
134
|
/**
|
|
134
|
-
* Retrieves the most recent expo-updates log entries.
|
|
135
|
+
* Retrieves the most recent `expo-updates` log entries.
|
|
135
136
|
*
|
|
136
|
-
* @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to 3600000 ms (1 hour).
|
|
137
|
+
* @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to `3600000` ms (1 hour).
|
|
137
138
|
*
|
|
138
139
|
* @return A promise that fulfills with an array of [`UpdatesLogEntry`](#updateslogentry) objects;
|
|
139
140
|
*
|
|
@@ -141,7 +142,7 @@ export declare function setExtraParamAsync(key: string, value: string | null | u
|
|
|
141
142
|
*/
|
|
142
143
|
export declare function readLogEntriesAsync(maxAge?: number): Promise<UpdatesLogEntry[]>;
|
|
143
144
|
/**
|
|
144
|
-
* Clears existing expo-updates log entries.
|
|
145
|
+
* Clears existing `expo-updates` log entries.
|
|
145
146
|
*
|
|
146
147
|
* > For now, this operation does nothing on the client. Once log persistence has been
|
|
147
148
|
* > implemented, this operation will actually remove existing logs.
|
|
@@ -164,7 +165,7 @@ export declare function clearLogEntriesAsync(): Promise<void>;
|
|
|
164
165
|
* @return A promise that fulfills with an [`UpdateFetchResult`](#updatefetchresult) object.
|
|
165
166
|
*
|
|
166
167
|
* The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or
|
|
167
|
-
* timeout communicating with the server. It also rejects when expo-updates is not enabled.
|
|
168
|
+
* timeout communicating with the server. It also rejects when `expo-updates` is not enabled.
|
|
168
169
|
*/
|
|
169
170
|
export declare function fetchUpdateAsync(): Promise<UpdateFetchResult>;
|
|
170
171
|
/**
|
package/build/Updates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updates.d.ts","sourceRoot":"","sources":["../src/Updates.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,8BAA8B,EAC9B,eAAe,EACf,gCAAgC,EACjC,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE,OAAiC,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"Updates.d.ts","sourceRoot":"","sources":["../src/Updates.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,8BAA8B,EAC9B,eAAe,EACf,gCAAgC,EACjC,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,E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AM,GAAE,MAAgB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAE9F;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAoBnE;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,CAAC,EAAE,MAAM,QAIrE;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,qBAAqB,EAAE,gCAAgC,GAAG;IACxD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACA,gCAAgC,CAmBlC;AAED;;GAEG;AACH,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,gCAAgC,CAAC,CAGnG"}
|
package/build/Updates.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodedError } from 'expo-modules-core';
|
|
2
2
|
import ExpoUpdates from './ExpoUpdates';
|
|
3
3
|
/**
|
|
4
|
-
* Whether expo-updates is enabled. This may be false in a variety of cases including:
|
|
4
|
+
* Whether `expo-updates` is enabled. This may be false in a variety of cases including:
|
|
5
5
|
* - enabled set to false in configuration
|
|
6
6
|
* - missing or invalid URL in configuration
|
|
7
7
|
* - missing runtime version or SDK version in configuration
|
|
@@ -14,7 +14,8 @@ export const isEnabled = !!ExpoUpdates.isEnabled;
|
|
|
14
14
|
* The UUID that uniquely identifies the currently running update. The
|
|
15
15
|
* UUID is represented in its canonical string form and will always use lowercase letters.
|
|
16
16
|
* This value is `null` when running in a local development environment or any other environment where `expo-updates` is disabled.
|
|
17
|
-
* @example
|
|
17
|
+
* @example
|
|
18
|
+
* `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"`
|
|
18
19
|
*/
|
|
19
20
|
export const updateId = ExpoUpdates.updateId && typeof ExpoUpdates.updateId === 'string'
|
|
20
21
|
? ExpoUpdates.updateId.toLowerCase()
|
|
@@ -36,7 +37,7 @@ const _checkAutomaticallyMapNativeToJS = {
|
|
|
36
37
|
WIFI_ONLY: 'WIFI_ONLY',
|
|
37
38
|
};
|
|
38
39
|
/**
|
|
39
|
-
* Determines if and when expo-updates checks for and downloads updates automatically on startup.
|
|
40
|
+
* Determines if and when `expo-updates` checks for and downloads updates automatically on startup.
|
|
40
41
|
*/
|
|
41
42
|
export const checkAutomatically = _checkAutomaticallyMapNativeToJS[ExpoUpdates.checkAutomatically] ?? null;
|
|
42
43
|
// @docsMissing
|
|
@@ -114,7 +115,7 @@ const manualUpdatesInstructions = 'To test usage of the expo-updates JS API in y
|
|
|
114
115
|
* the state of the native module and main threads.
|
|
115
116
|
*
|
|
116
117
|
* This method cannot be used in Expo Go or development mode, and the returned promise will be rejected if you
|
|
117
|
-
* try to do so. It also rejects when expo-updates is not enabled.
|
|
118
|
+
* try to do so. It also rejects when `expo-updates` is not enabled.
|
|
118
119
|
*
|
|
119
120
|
* @return A promise that fulfills right before the reload instruction is sent to the JS runtime, or
|
|
120
121
|
* rejects if it cannot find a reference to the JS runtime. If the promise is rejected in production
|
|
@@ -145,7 +146,7 @@ export async function reloadAsync() {
|
|
|
145
146
|
* @return A promise that fulfills with an [`UpdateCheckResult`](#updatecheckresult) object.
|
|
146
147
|
*
|
|
147
148
|
* The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or
|
|
148
|
-
* timeout communicating with the server. It also rejects when expo-updates is not enabled.
|
|
149
|
+
* timeout communicating with the server. It also rejects when `expo-updates` is not enabled.
|
|
149
150
|
*/
|
|
150
151
|
export async function checkForUpdateAsync() {
|
|
151
152
|
if ((__DEV__ || isUsingDeveloperTool) &&
|
|
@@ -165,25 +166,25 @@ export async function checkForUpdateAsync() {
|
|
|
165
166
|
/**
|
|
166
167
|
* Retrieves the current extra params.
|
|
167
168
|
*
|
|
168
|
-
* This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.
|
|
169
|
+
* This method cannot be used in Expo Go or development mode. It also rejects when `expo-updates` is not enabled.
|
|
169
170
|
*/
|
|
170
171
|
export async function getExtraParamsAsync() {
|
|
171
172
|
return await ExpoUpdates.getExtraParamsAsync();
|
|
172
173
|
}
|
|
173
174
|
/**
|
|
174
175
|
* Sets an extra param if value is non-null, otherwise unsets the param.
|
|
175
|
-
* Extra params are sent as an [Expo Structured Field Value Dictionary](
|
|
176
|
+
* Extra params are sent as an [Expo Structured Field Value Dictionary](/technical-specs/expo-sfv-0/)
|
|
176
177
|
* in the `Expo-Extra-Params` header of update requests. A compliant update server may use these params when selecting an update to serve.
|
|
177
178
|
*
|
|
178
|
-
* This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.
|
|
179
|
+
* This method cannot be used in Expo Go or development mode. It also rejects when `expo-updates` is not enabled.
|
|
179
180
|
*/
|
|
180
181
|
export async function setExtraParamAsync(key, value) {
|
|
181
182
|
return await ExpoUpdates.setExtraParamAsync(key, value ?? null);
|
|
182
183
|
}
|
|
183
184
|
/**
|
|
184
|
-
* Retrieves the most recent expo-updates log entries.
|
|
185
|
+
* Retrieves the most recent `expo-updates` log entries.
|
|
185
186
|
*
|
|
186
|
-
* @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to 3600000 ms (1 hour).
|
|
187
|
+
* @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to `3600000` ms (1 hour).
|
|
187
188
|
*
|
|
188
189
|
* @return A promise that fulfills with an array of [`UpdatesLogEntry`](#updateslogentry) objects;
|
|
189
190
|
*
|
|
@@ -193,7 +194,7 @@ export async function readLogEntriesAsync(maxAge = 3600000) {
|
|
|
193
194
|
return await ExpoUpdates.readLogEntriesAsync(maxAge);
|
|
194
195
|
}
|
|
195
196
|
/**
|
|
196
|
-
* Clears existing expo-updates log entries.
|
|
197
|
+
* Clears existing `expo-updates` log entries.
|
|
197
198
|
*
|
|
198
199
|
* > For now, this operation does nothing on the client. Once log persistence has been
|
|
199
200
|
* > implemented, this operation will actually remove existing logs.
|
|
@@ -218,7 +219,7 @@ export async function clearLogEntriesAsync() {
|
|
|
218
219
|
* @return A promise that fulfills with an [`UpdateFetchResult`](#updatefetchresult) object.
|
|
219
220
|
*
|
|
220
221
|
* The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or
|
|
221
|
-
* timeout communicating with the server. It also rejects when expo-updates is not enabled.
|
|
222
|
+
* timeout communicating with the server. It also rejects when `expo-updates` is not enabled.
|
|
222
223
|
*/
|
|
223
224
|
export async function fetchUpdateAsync() {
|
|
224
225
|
if ((__DEV__ || isUsingDeveloperTool) &&
|
package/build/Updates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updates.js","sourceRoot":"","sources":["../src/Updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,WAAW,MAAM,eAAe,CAAC;AAWxC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAY,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GACnB,WAAW,CAAC,QAAQ,IAAI,OAAO,WAAW,CAAC,QAAQ,KAAK,QAAQ;IAC9D,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE;IACpC,CAAC,CAAC,IAAI,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAkB,WAAW,CAAC,OAAO,IAAI,IAAI,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB,WAAW,CAAC,cAAc,IAAI,IAAI,CAAC;AAEhF,MAAM,gCAAgC,GAAG;IACvC,MAAM,EAAE,SAAS;IACjB,mBAAmB,EAAE,mBAAmB;IACxC,KAAK,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AC;QACtF,OAAO,aAAa,CAAC,wBAAwB,CAAC;KAC/C;IACD,IAAI,aAAa,CAAC,4BAA4B,EAAE;QAC9C,aAAa,CAAC,sBAAsB,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;QAC5F,OAAO,aAAa,CAAC,4BAA4B,CAAC;KACnD;IACD,IAAI,aAAa,CAAC,cAAc,EAAE;QAChC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAClE,OAAO,aAAa,CAAC,cAAc,CAAC;KACrC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC;IACrD,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,iCAAiC,EAAE,CAAC;IAC5E,OAAO,kCAAkC,CAAC,aAAa,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { CodedError } from 'expo-modules-core';\n\nimport ExpoUpdates from './ExpoUpdates';\nimport {\n LocalAssets,\n Manifest,\n UpdateCheckResult,\n UpdateFetchResult,\n UpdatesCheckAutomaticallyValue,\n UpdatesLogEntry,\n UpdatesNativeStateMachineContext,\n} from './Updates.types';\n\n/**\n * Whether expo-updates is enabled. This may be false in a variety of cases including:\n * - enabled set to false in configuration\n * - missing or invalid URL in configuration\n * - missing runtime version or SDK version in configuration\n * - error accessing storage on device during initialization\n *\n * When false, the embedded update is loaded.\n */\nexport const isEnabled: boolean = !!ExpoUpdates.isEnabled;\n\n/**\n * The UUID that uniquely identifies the currently running update. The\n * UUID is represented in its canonical string form and will always use lowercase letters.\n * This value is `null` when running in a local development environment or any other environment where `expo-updates` is disabled.\n * @example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n */\nexport const updateId: string | null =\n ExpoUpdates.updateId && typeof ExpoUpdates.updateId === 'string'\n ? ExpoUpdates.updateId.toLowerCase()\n : null;\n\n/**\n * The channel name of the current build, if configured for use with EAS Update. `null` otherwise.\n *\n * Expo Go and development builds are not set to a specific channel and can run any updates compatible with their native runtime. Therefore, this value will always be `null` when running an update on Expo Go or a development build.\n */\nexport const channel: string | null = ExpoUpdates.channel ?? null;\n\n/**\n * The runtime version of the current build.\n */\nexport const runtimeVersion: string | null = ExpoUpdates.runtimeVersion ?? null;\n\nconst _checkAutomaticallyMapNativeToJS = {\n ALWAYS: 'ON_LOAD',\n ERROR_RECOVERY_ONLY: 'ON_ERROR_RECOVERY',\n NEVER: 'NEVER',\n WIFI_ONLY: 'WIFI_ONLY',\n};\n\n/**\n * Determines if and when expo-updates checks for and downloads updates automatically on startup.\n */\nexport const checkAutomatically: UpdatesCheckAutomaticallyValue | null =\n _checkAutomaticallyMapNativeToJS[ExpoUpdates.checkAutomatically] ?? null;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const localAssets: LocalAssets = ExpoUpdates.localAssets ?? {};\n\n/**\n * `expo-updates` does its very best to always launch monotonically newer versions of your app so\n * you don't need to worry about backwards compatibility when you put out an update. In very rare\n * cases, it's possible that `expo-updates` may need to fall back to the update that's embedded in\n * the app binary, even after newer updates have been downloaded and run (an \"emergency launch\").\n * This boolean will be `true` if the app is launching under this fallback mechanism and `false`\n * otherwise. If you are concerned about backwards compatibility of future updates to your app, you\n * can use this constant to provide special behavior for this rare case.\n */\nexport const isEmergencyLaunch = ExpoUpdates.isEmergencyLaunch;\n\n/**\n * If `isEmergencyLaunch` is set to true, this will contain a string error message describing\n * what failed during initialization.\n */\nexport const emergencyLaunchReason = ExpoUpdates.emergencyLaunchReason;\n\n/**\n * This will be true if the currently running update is the one embedded in the build,\n * and not one downloaded from the updates server.\n */\nexport const isEmbeddedLaunch: boolean = ExpoUpdates.isEmbeddedLaunch || false;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const isUsingEmbeddedAssets: boolean = ExpoUpdates.isUsingEmbeddedAssets || false;\n\n/**\n * If `expo-updates` is enabled, this is the\n * [manifest](/versions/latest/sdk/constants/#manifest) (or\n * [classic manifest](/versions/latest/sdk/constants/#appmanifest))\n * object for the update that's currently running.\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this object is\n * empty.\n */\nexport const manifest: Partial<Manifest> =\n (ExpoUpdates.manifestString ? JSON.parse(ExpoUpdates.manifestString) : ExpoUpdates.manifest) ??\n {};\n\n/**\n * If `expo-updates` is enabled, this is a `Date` object representing the creation time of the update that's currently running (whether it was embedded or downloaded at runtime).\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this value is\n * null.\n */\nexport const createdAt: Date | null = ExpoUpdates.commitTime\n ? new Date(ExpoUpdates.commitTime)\n : null;\n\n/**\n * During non-expo development we block accessing the updates API methods on the JS side, but when developing in\n * Expo Go or a development client build, the controllers should have control over which API methods should\n * be allowed.\n */\nconst shouldDeferToNativeForAPIMethodAvailabilityInDevelopment =\n !!ExpoUpdates.shouldDeferToNativeForAPIMethodAvailabilityInDevelopment;\n\n/**\n * Developer tool is set when a project is served by `expo start`.\n */\nconst isUsingDeveloperTool =\n 'extra' in manifest ? !!manifest.extra?.expoGo?.developer?.tool : false;\n\nconst manualUpdatesInstructions =\n 'To test usage of the expo-updates JS API in your app, make a release build with `npx expo run:ios --configuration Release` or ' +\n '`npx expo run:android --variant Release`.';\n\n/**\n * Instructs the app to reload using the most recently downloaded version. This is useful for\n * triggering a newly downloaded update to launch without the user needing to manually restart the\n * app.\n *\n * It is not recommended to place any meaningful logic after a call to `await\n * Updates.reloadAsync()`. This is because the promise is resolved after verifying that the app can\n * be reloaded, and immediately before posting an asynchronous task to the main thread to actually\n * reload the app. It is unsafe to make any assumptions about whether any more JS code will be\n * executed after the `Updates.reloadAsync` method call resolves, since that depends on the OS and\n * the state of the native module and main threads.\n *\n * This method cannot be used in Expo Go or development mode, and the returned promise will be rejected if you\n * try to do so. It also rejects when expo-updates is not enabled.\n *\n * @return A promise that fulfills right before the reload instruction is sent to the JS runtime, or\n * rejects if it cannot find a reference to the JS runtime. If the promise is rejected in production\n * mode, it most likely means you have installed the module incorrectly. Double check you've\n * followed the installation instructions. In particular, on iOS ensure that you set the `bridge`\n * property on `EXUpdatesAppController` with a pointer to the `RCTBridge` you want to reload, and on\n * Android ensure you either call `UpdatesController.initialize` with the instance of\n * `ReactApplication` you want to reload, or call `UpdatesController.setReactNativeHost` with the\n * proper instance of `ReactNativeHost`.\n */\nexport async function reloadAsync(): Promise<void> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot use the Updates module in development mode in a production app. ${manualUpdatesInstructions}`\n );\n }\n await ExpoUpdates.reload();\n}\n\n/**\n * Checks the server to see if a newly deployed update to your project is available. Does not\n * actually download the update. This method cannot be used in development mode, and the returned\n * promise will be rejected if you try to do so.\n *\n * Checking for an update uses a device's bandwidth and battery life like any network call.\n * Additionally, updates served by Expo may be rate limited. A good rule of thumb to check for\n * updates judiciously is to check when the user launches or foregrounds the app. Avoid polling for\n * updates in a frequent loop.\n *\n * @return A promise that fulfills with an [`UpdateCheckResult`](#updatecheckresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when expo-updates is not enabled.\n */\nexport async function checkForUpdateAsync(): Promise<UpdateCheckResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot check for updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.checkForUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * Retrieves the current extra params.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.\n */\nexport async function getExtraParamsAsync(): Promise<Record<string, string>> {\n return await ExpoUpdates.getExtraParamsAsync();\n}\n\n/**\n * Sets an extra param if value is non-null, otherwise unsets the param.\n * Extra params are sent as an [Expo Structured Field Value Dictionary](https://docs.expo.dev/technical-specs/expo-sfv-0/)\n * in the `Expo-Extra-Params` header of update requests. A compliant update server may use these params when selecting an update to serve.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.\n */\nexport async function setExtraParamAsync(\n key: string,\n value: string | null | undefined\n): Promise<void> {\n return await ExpoUpdates.setExtraParamAsync(key, value ?? null);\n}\n\n/**\n * Retrieves the most recent expo-updates log entries.\n *\n * @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to 3600000 ms (1 hour).\n *\n * @return A promise that fulfills with an array of [`UpdatesLogEntry`](#updateslogentry) objects;\n *\n * The promise rejects if there is an unexpected error in retrieving the logs.\n */\nexport async function readLogEntriesAsync(maxAge: number = 3600000): Promise<UpdatesLogEntry[]> {\n return await ExpoUpdates.readLogEntriesAsync(maxAge);\n}\n\n/**\n * Clears existing expo-updates log entries.\n *\n * > For now, this operation does nothing on the client. Once log persistence has been\n * > implemented, this operation will actually remove existing logs.\n *\n * @return A promise that fulfills if the clear operation was successful.\n *\n * The promise rejects if there is an unexpected error in clearing the logs.\n *\n */\nexport async function clearLogEntriesAsync(): Promise<void> {\n await ExpoUpdates.clearLogEntriesAsync();\n}\n\n/**\n * Downloads the most recently deployed update to your project from server to the device's local\n * storage. This method cannot be used in development mode, and the returned promise will be\n * rejected if you try to do so.\n *\n > **Note:** [`reloadAsync()`](#updatesreloadasync) can be called after promise resolution to\n * reload the app using the most recently downloaded version. Otherwise, the update will be applied\n * on the next app cold start.\n *\n * @return A promise that fulfills with an [`UpdateFetchResult`](#updatefetchresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when expo-updates is not enabled.\n */\nexport async function fetchUpdateAsync(): Promise<UpdateFetchResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot fetch updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.fetchUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * @hidden\n */\nexport function clearUpdateCacheExperimentalAsync(_sdkVersion?: string) {\n console.warn(\n \"This method is no longer necessary. `expo-updates` now automatically deletes your app's old bundle files!\"\n );\n}\n\n/**\n * @hidden\n */\nexport function transformNativeStateMachineContext(\n originalNativeContext: UpdatesNativeStateMachineContext & {\n latestManifestString?: string;\n downloadedManifestString?: string;\n lastCheckForUpdateTimeString?: string;\n rollbackString?: string;\n }\n): UpdatesNativeStateMachineContext {\n const nativeContext = { ...originalNativeContext };\n if (nativeContext.latestManifestString) {\n nativeContext.latestManifest = JSON.parse(nativeContext.latestManifestString);\n delete nativeContext.latestManifestString;\n }\n if (nativeContext.downloadedManifestString) {\n nativeContext.downloadedManifest = JSON.parse(nativeContext.downloadedManifestString);\n delete nativeContext.downloadedManifestString;\n }\n if (nativeContext.lastCheckForUpdateTimeString) {\n nativeContext.lastCheckForUpdateTime = new Date(nativeContext.lastCheckForUpdateTimeString);\n delete nativeContext.lastCheckForUpdateTimeString;\n }\n if (nativeContext.rollbackString) {\n nativeContext.rollback = JSON.parse(nativeContext.rollbackString);\n delete nativeContext.rollbackString;\n }\n return nativeContext;\n}\n\n/**\n * @hidden\n */\nexport async function getNativeStateMachineContextAsync(): Promise<UpdatesNativeStateMachineContext> {\n const nativeContext = await ExpoUpdates.getNativeStateMachineContextAsync();\n return transformNativeStateMachineContext(nativeContext);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Updates.js","sourceRoot":"","sources":["../src/Updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,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\n\nimport ExpoUpdates from './ExpoUpdates';\nimport {\n LocalAssets,\n Manifest,\n UpdateCheckResult,\n UpdateFetchResult,\n UpdatesCheckAutomaticallyValue,\n UpdatesLogEntry,\n UpdatesNativeStateMachineContext,\n} from './Updates.types';\n\n/**\n * Whether `expo-updates` is enabled. This may be false in a variety of cases including:\n * - enabled set to false in configuration\n * - missing or invalid URL in configuration\n * - missing runtime version or SDK version in configuration\n * - error accessing storage on device during initialization\n *\n * When false, the embedded update is loaded.\n */\nexport const isEnabled: boolean = !!ExpoUpdates.isEnabled;\n\n/**\n * The UUID that uniquely identifies the currently running update. The\n * UUID is represented in its canonical string form and will always use lowercase letters.\n * This value is `null` when running in a local development environment or any other environment where `expo-updates` is disabled.\n * @example\n * `\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"`\n */\nexport const updateId: string | null =\n ExpoUpdates.updateId && typeof ExpoUpdates.updateId === 'string'\n ? ExpoUpdates.updateId.toLowerCase()\n : null;\n\n/**\n * The channel name of the current build, if configured for use with EAS Update. `null` otherwise.\n *\n * Expo Go and development builds are not set to a specific channel and can run any updates compatible with their native runtime. Therefore, this value will always be `null` when running an update on Expo Go or a development build.\n */\nexport const channel: string | null = ExpoUpdates.channel ?? null;\n\n/**\n * The runtime version of the current build.\n */\nexport const runtimeVersion: string | null = ExpoUpdates.runtimeVersion ?? null;\n\nconst _checkAutomaticallyMapNativeToJS = {\n ALWAYS: 'ON_LOAD',\n ERROR_RECOVERY_ONLY: 'ON_ERROR_RECOVERY',\n NEVER: 'NEVER',\n WIFI_ONLY: 'WIFI_ONLY',\n};\n\n/**\n * Determines if and when `expo-updates` checks for and downloads updates automatically on startup.\n */\nexport const checkAutomatically: UpdatesCheckAutomaticallyValue | null =\n _checkAutomaticallyMapNativeToJS[ExpoUpdates.checkAutomatically] ?? null;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const localAssets: LocalAssets = ExpoUpdates.localAssets ?? {};\n\n/**\n * `expo-updates` does its very best to always launch monotonically newer versions of your app so\n * you don't need to worry about backwards compatibility when you put out an update. In very rare\n * cases, it's possible that `expo-updates` may need to fall back to the update that's embedded in\n * the app binary, even after newer updates have been downloaded and run (an \"emergency launch\").\n * This boolean will be `true` if the app is launching under this fallback mechanism and `false`\n * otherwise. If you are concerned about backwards compatibility of future updates to your app, you\n * can use this constant to provide special behavior for this rare case.\n */\nexport const isEmergencyLaunch = ExpoUpdates.isEmergencyLaunch;\n\n/**\n * If `isEmergencyLaunch` is set to true, this will contain a string error message describing\n * what failed during initialization.\n */\nexport const emergencyLaunchReason = ExpoUpdates.emergencyLaunchReason;\n\n/**\n * This will be true if the currently running update is the one embedded in the build,\n * and not one downloaded from the updates server.\n */\nexport const isEmbeddedLaunch: boolean = ExpoUpdates.isEmbeddedLaunch || false;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const isUsingEmbeddedAssets: boolean = ExpoUpdates.isUsingEmbeddedAssets || false;\n\n/**\n * If `expo-updates` is enabled, this is the\n * [manifest](/versions/latest/sdk/constants/#manifest) (or\n * [classic manifest](/versions/latest/sdk/constants/#appmanifest))\n * object for the update that's currently running.\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this object is\n * empty.\n */\nexport const manifest: Partial<Manifest> =\n (ExpoUpdates.manifestString ? JSON.parse(ExpoUpdates.manifestString) : ExpoUpdates.manifest) ??\n {};\n\n/**\n * If `expo-updates` is enabled, this is a `Date` object representing the creation time of the update that's currently running (whether it was embedded or downloaded at runtime).\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this value is\n * null.\n */\nexport const createdAt: Date | null = ExpoUpdates.commitTime\n ? new Date(ExpoUpdates.commitTime)\n : null;\n\n/**\n * During non-expo development we block accessing the updates API methods on the JS side, but when developing in\n * Expo Go or a development client build, the controllers should have control over which API methods should\n * be allowed.\n */\nconst shouldDeferToNativeForAPIMethodAvailabilityInDevelopment =\n !!ExpoUpdates.shouldDeferToNativeForAPIMethodAvailabilityInDevelopment;\n\n/**\n * Developer tool is set when a project is served by `expo start`.\n */\nconst isUsingDeveloperTool =\n 'extra' in manifest ? !!manifest.extra?.expoGo?.developer?.tool : false;\n\nconst manualUpdatesInstructions =\n 'To test usage of the expo-updates JS API in your app, make a release build with `npx expo run:ios --configuration Release` or ' +\n '`npx expo run:android --variant Release`.';\n\n/**\n * Instructs the app to reload using the most recently downloaded version. This is useful for\n * triggering a newly downloaded update to launch without the user needing to manually restart the\n * app.\n *\n * It is not recommended to place any meaningful logic after a call to `await\n * Updates.reloadAsync()`. This is because the promise is resolved after verifying that the app can\n * be reloaded, and immediately before posting an asynchronous task to the main thread to actually\n * reload the app. It is unsafe to make any assumptions about whether any more JS code will be\n * executed after the `Updates.reloadAsync` method call resolves, since that depends on the OS and\n * the state of the native module and main threads.\n *\n * This method cannot be used in Expo Go or development mode, and the returned promise will be rejected if you\n * try to do so. It also rejects when `expo-updates` is not enabled.\n *\n * @return A promise that fulfills right before the reload instruction is sent to the JS runtime, or\n * rejects if it cannot find a reference to the JS runtime. If the promise is rejected in production\n * mode, it most likely means you have installed the module incorrectly. Double check you've\n * followed the installation instructions. In particular, on iOS ensure that you set the `bridge`\n * property on `EXUpdatesAppController` with a pointer to the `RCTBridge` you want to reload, and on\n * Android ensure you either call `UpdatesController.initialize` with the instance of\n * `ReactApplication` you want to reload, or call `UpdatesController.setReactNativeHost` with the\n * proper instance of `ReactNativeHost`.\n */\nexport async function reloadAsync(): Promise<void> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot use the Updates module in development mode in a production app. ${manualUpdatesInstructions}`\n );\n }\n await ExpoUpdates.reload();\n}\n\n/**\n * Checks the server to see if a newly deployed update to your project is available. Does not\n * actually download the update. This method cannot be used in development mode, and the returned\n * promise will be rejected if you try to do so.\n *\n * Checking for an update uses a device's bandwidth and battery life like any network call.\n * Additionally, updates served by Expo may be rate limited. A good rule of thumb to check for\n * updates judiciously is to check when the user launches or foregrounds the app. Avoid polling for\n * updates in a frequent loop.\n *\n * @return A promise that fulfills with an [`UpdateCheckResult`](#updatecheckresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when `expo-updates` is not enabled.\n */\nexport async function checkForUpdateAsync(): Promise<UpdateCheckResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot check for updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.checkForUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * Retrieves the current extra params.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when `expo-updates` is not enabled.\n */\nexport async function getExtraParamsAsync(): Promise<Record<string, string>> {\n return await ExpoUpdates.getExtraParamsAsync();\n}\n\n/**\n * Sets an extra param if value is non-null, otherwise unsets the param.\n * Extra params are sent as an [Expo Structured Field Value Dictionary](/technical-specs/expo-sfv-0/)\n * in the `Expo-Extra-Params` header of update requests. A compliant update server may use these params when selecting an update to serve.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when `expo-updates` is not enabled.\n */\nexport async function setExtraParamAsync(\n key: string,\n value: string | null | undefined\n): Promise<void> {\n return await ExpoUpdates.setExtraParamAsync(key, value ?? null);\n}\n\n/**\n * Retrieves the most recent `expo-updates` log entries.\n *\n * @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to `3600000` ms (1 hour).\n *\n * @return A promise that fulfills with an array of [`UpdatesLogEntry`](#updateslogentry) objects;\n *\n * The promise rejects if there is an unexpected error in retrieving the logs.\n */\nexport async function readLogEntriesAsync(maxAge: number = 3600000): Promise<UpdatesLogEntry[]> {\n return await ExpoUpdates.readLogEntriesAsync(maxAge);\n}\n\n/**\n * Clears existing `expo-updates` log entries.\n *\n * > For now, this operation does nothing on the client. Once log persistence has been\n * > implemented, this operation will actually remove existing logs.\n *\n * @return A promise that fulfills if the clear operation was successful.\n *\n * The promise rejects if there is an unexpected error in clearing the logs.\n *\n */\nexport async function clearLogEntriesAsync(): Promise<void> {\n await ExpoUpdates.clearLogEntriesAsync();\n}\n\n/**\n * Downloads the most recently deployed update to your project from server to the device's local\n * storage. This method cannot be used in development mode, and the returned promise will be\n * rejected if you try to do so.\n *\n > **Note:** [`reloadAsync()`](#updatesreloadasync) can be called after promise resolution to\n * reload the app using the most recently downloaded version. Otherwise, the update will be applied\n * on the next app cold start.\n *\n * @return A promise that fulfills with an [`UpdateFetchResult`](#updatefetchresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when `expo-updates` is not enabled.\n */\nexport async function fetchUpdateAsync(): Promise<UpdateFetchResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot fetch updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.fetchUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * @hidden\n */\nexport function clearUpdateCacheExperimentalAsync(_sdkVersion?: string) {\n console.warn(\n \"This method is no longer necessary. `expo-updates` now automatically deletes your app's old bundle files!\"\n );\n}\n\n/**\n * @hidden\n */\nexport function transformNativeStateMachineContext(\n originalNativeContext: UpdatesNativeStateMachineContext & {\n latestManifestString?: string;\n downloadedManifestString?: string;\n lastCheckForUpdateTimeString?: string;\n rollbackString?: string;\n }\n): UpdatesNativeStateMachineContext {\n const nativeContext = { ...originalNativeContext };\n if (nativeContext.latestManifestString) {\n nativeContext.latestManifest = JSON.parse(nativeContext.latestManifestString);\n delete nativeContext.latestManifestString;\n }\n if (nativeContext.downloadedManifestString) {\n nativeContext.downloadedManifest = JSON.parse(nativeContext.downloadedManifestString);\n delete nativeContext.downloadedManifestString;\n }\n if (nativeContext.lastCheckForUpdateTimeString) {\n nativeContext.lastCheckForUpdateTime = new Date(nativeContext.lastCheckForUpdateTimeString);\n delete nativeContext.lastCheckForUpdateTimeString;\n }\n if (nativeContext.rollbackString) {\n nativeContext.rollback = JSON.parse(nativeContext.rollbackString);\n delete nativeContext.rollbackString;\n }\n return nativeContext;\n}\n\n/**\n * @hidden\n */\nexport async function getNativeStateMachineContextAsync(): Promise<UpdatesNativeStateMachineContext> {\n const nativeContext = await ExpoUpdates.getNativeStateMachineContextAsync();\n return transformNativeStateMachineContext(nativeContext);\n}\n"]}
|
package/build/Updates.types.d.ts
CHANGED
|
@@ -159,7 +159,7 @@ export type UpdateFetchResultRollBackToEmbedded = {
|
|
|
159
159
|
*/
|
|
160
160
|
export type UpdateFetchResult = UpdateFetchResultSuccess | UpdateFetchResultFailure | UpdateFetchResultRollBackToEmbedded;
|
|
161
161
|
/**
|
|
162
|
-
* An object representing a single log entry from expo-updates logging on the client.
|
|
162
|
+
* An object representing a single log entry from `expo-updates` logging on the client.
|
|
163
163
|
*/
|
|
164
164
|
export type UpdatesLogEntry = {
|
|
165
165
|
/**
|
|
@@ -192,7 +192,7 @@ export type UpdatesLogEntry = {
|
|
|
192
192
|
stacktrace?: string[];
|
|
193
193
|
};
|
|
194
194
|
/**
|
|
195
|
-
* The possible code values for expo-updates log entries
|
|
195
|
+
* The possible code values for `expo-updates` log entries
|
|
196
196
|
*/
|
|
197
197
|
export declare enum UpdatesLogEntryCode {
|
|
198
198
|
NONE = "None",
|
|
@@ -208,7 +208,7 @@ export declare enum UpdatesLogEntryCode {
|
|
|
208
208
|
UNKNOWN = "Unknown"
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
|
-
* The possible log levels for expo-updates log entries
|
|
211
|
+
* The possible log levels for `expo-updates` log entries
|
|
212
212
|
*/
|
|
213
213
|
export declare enum UpdatesLogEntryLevel {
|
|
214
214
|
TRACE = "trace",
|
|
@@ -219,7 +219,7 @@ export declare enum UpdatesLogEntryLevel {
|
|
|
219
219
|
FATAL = "fatal"
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
|
-
* The possible settings that determine if expo-updates will check for updates on app startup.
|
|
222
|
+
* The possible settings that determine if `expo-updates` will check for updates on app startup.
|
|
223
223
|
* By default, Expo will check for updates every time the app is loaded.
|
|
224
224
|
* Set this to `ON_ERROR_RECOVERY` to disable automatic checking unless recovering from an error.
|
|
225
225
|
* Set this to `NEVER` to completely disable automatic checking.
|
|
@@ -253,6 +253,8 @@ export type UpdatesNativeStateRollback = {
|
|
|
253
253
|
commitTime: string;
|
|
254
254
|
};
|
|
255
255
|
/**
|
|
256
|
+
* The native state machine context, either read directly from a native module method,
|
|
257
|
+
* or received in a state change event. Used internally by this module and not exported publicly.
|
|
256
258
|
* @hidden
|
|
257
259
|
*/
|
|
258
260
|
export type UpdatesNativeStateMachineContext = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updates.types.d.ts","sourceRoot":"","sources":["../src/Updates.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,MAAM,MAAM,QAAQ,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAE9D,oBAAY,mCAAmC;IAC7C;;OAEG;IACH,6BAA6B,8BAA8B;IAC3D;;;OAGG;IACH,mCAAmC,oCAAoC;IACvE;;;OAGG;IACH,wBAAwB,2BAA2B;IACnD;;;OAGG;IACH,qCAAqC,sCAAsC;IAC3E;;OAEG;IACH,oBAAoB,oCAAoC;CACzD;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC;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,CAAC,EAAE,IAAI,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAE1C,OAAO,EAAE,gCAAgC,CAAC;CAC3C,CAAC"}
|
package/build/Updates.types.js
CHANGED
|
@@ -25,7 +25,7 @@ export var UpdateCheckResultNotAvailableReason;
|
|
|
25
25
|
UpdateCheckResultNotAvailableReason["ROLLBACK_NO_EMBEDDED"] = "rollbackNoEmbeddedConfiguration";
|
|
26
26
|
})(UpdateCheckResultNotAvailableReason || (UpdateCheckResultNotAvailableReason = {}));
|
|
27
27
|
/**
|
|
28
|
-
* The possible code values for expo-updates log entries
|
|
28
|
+
* The possible code values for `expo-updates` log entries
|
|
29
29
|
*/
|
|
30
30
|
export var UpdatesLogEntryCode;
|
|
31
31
|
(function (UpdatesLogEntryCode) {
|
|
@@ -42,7 +42,7 @@ export var UpdatesLogEntryCode;
|
|
|
42
42
|
UpdatesLogEntryCode["UNKNOWN"] = "Unknown";
|
|
43
43
|
})(UpdatesLogEntryCode || (UpdatesLogEntryCode = {}));
|
|
44
44
|
/**
|
|
45
|
-
* The possible log levels for expo-updates log entries
|
|
45
|
+
* The possible log levels for `expo-updates` log entries
|
|
46
46
|
*/
|
|
47
47
|
export var UpdatesLogEntryLevel;
|
|
48
48
|
(function (UpdatesLogEntryLevel) {
|
|
@@ -54,7 +54,7 @@ export var UpdatesLogEntryLevel;
|
|
|
54
54
|
UpdatesLogEntryLevel["FATAL"] = "fatal";
|
|
55
55
|
})(UpdatesLogEntryLevel || (UpdatesLogEntryLevel = {}));
|
|
56
56
|
/**
|
|
57
|
-
* The possible settings that determine if expo-updates will check for updates on app startup.
|
|
57
|
+
* The possible settings that determine if `expo-updates` will check for updates on app startup.
|
|
58
58
|
* By default, Expo will check for updates every time the app is loaded.
|
|
59
59
|
* Set this to `ON_ERROR_RECOVERY` to disable automatic checking unless recovering from an error.
|
|
60
60
|
* Set this to `NEVER` to completely disable automatic checking.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updates.types.js","sourceRoot":"","sources":["../src/Updates.types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,mCAwBX;AAxBD,WAAY,mCAAmC;IAC7C;;OAEG;IACH,kGAA2D,CAAA;IAC3D;;;OAGG;IACH,8GAAuE,CAAA;IACvE;;;OAGG;IACH,0FAAmD,CAAA;IACnD;;;OAGG;IACH,kHAA2E,CAAA;IAC3E;;OAEG;IACH,+FAAwD,CAAA;AAC1D,CAAC,EAxBW,mCAAmC,KAAnC,mCAAmC,QAwB9C;AAyLD;;GAEG;AACH,MAAM,CAAN,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,kEAA2C,CAAA;IAC3C,+EAAwD,CAAA;IACxD,4EAAqD,CAAA;IACrD,iFAA0D,CAAA;IAC1D,2EAAoD,CAAA;IACpD,mEAA4C,CAAA;IAC5C,mEAA4C,CAAA;IAC5C,0DAAmC,CAAA;IACnC,mEAA4C,CAAA;IAC5C,0CAAmB,CAAA;AACrB,CAAC,EAZW,mBAAmB,KAAnB,mBAAmB,QAY9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,uCAAe,CAAA;IACf,uCAAe,CAAA;AACjB,CAAC,EAPW,oBAAoB,KAApB,oBAAoB,QAO/B;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,8BAiBX;AAjBD,WAAY,8BAA8B;IACxC;;OAEG;IACH,qDAAmB,CAAA;IACnB;;OAEG;IACH,yEAAuC,CAAA;IACvC;;OAEG;IACH,yDAAuB,CAAA;IACvB;;OAEG;IACH,iDAAe,CAAA;AACjB,CAAC,EAjBW,8BAA8B,KAA9B,8BAA8B,QAiBzC","sourcesContent":["import { ExpoUpdatesManifest, EmbeddedManifest } from 'expo-manifests';\n\nexport type Manifest = ExpoUpdatesManifest | EmbeddedManifest;\n\nexport enum UpdateCheckResultNotAvailableReason {\n /**\n * No update manifest or rollback directive received from the update server.\n */\n NO_UPDATE_AVAILABLE_ON_SERVER = 'noUpdateAvailableOnServer',\n /**\n * An update manifest was received from the update server, but the update is not launchable,\n * or does not pass the configured selection policy.\n */\n UPDATE_REJECTED_BY_SELECTION_POLICY = 'updateRejectedBySelectionPolicy',\n /**\n * An update manifest was received from the update server, but the update has been previously\n * launched on this device and never successfully launched.\n */\n UPDATE_PREVIOUSLY_FAILED = 'updatePreviouslyFailed',\n /**\n * A rollback directive was received from the update server, but the directive does not pass\n * the configured selection policy.\n */\n ROLLBACK_REJECTED_BY_SELECTION_POLICY = 'rollbackRejectedBySelectionPolicy',\n /**\n * A rollback directive was received from the update server, but this app has no embedded update.\n */\n ROLLBACK_NO_EMBEDDED = 'rollbackNoEmbeddedConfiguration',\n}\n\n/**\n * The update check result when a rollback directive is received.\n */\nexport type UpdateCheckResultRollBack = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: false;\n /**\n * The manifest of the update when available.\n */\n manifest: undefined;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: true;\n /**\n * If no new update is found, this contains one of several enum values indicating the reason.\n */\n reason: undefined;\n};\n\n/**\n * The update check result when a new update is found on the server.\n */\nexport type UpdateCheckResultAvailable = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: true;\n /**\n * The manifest of the update when available.\n */\n manifest: Manifest;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: false;\n /**\n * If no new update is found, this contains one of several enum values indicating the reason.\n */\n reason: undefined;\n};\n\n/**\n * The update check result if no new update was found.\n */\nexport type UpdateCheckResultNotAvailable = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: false;\n /**\n * The manifest of the update when available.\n */\n manifest: undefined;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: false;\n /**\n * If no new update is found, this contains one of several enum values indicating the reason.\n */\n reason: UpdateCheckResultNotAvailableReason;\n};\n\n/**\n * The result of checking for a new update.\n */\nexport type UpdateCheckResult =\n | UpdateCheckResultRollBack\n | UpdateCheckResultAvailable\n | UpdateCheckResultNotAvailable;\n\n/**\n * @deprecated\n */\nexport type UpdateCheckResultSuccess = UpdateCheckResultAvailable;\n\n/**\n * @deprecated\n */\nexport type UpdateCheckResultFailure = UpdateCheckResultNotAvailable;\n\n/**\n * The successful result of fetching a new update.\n */\nexport type UpdateFetchResultSuccess = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * Always `true` when `isRollBackToEmbedded` is `false`.\n */\n isNew: true;\n /**\n * The manifest of the fetched update.\n */\n manifest: Manifest;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The failed result of fetching a new update.\n */\nexport type UpdateFetchResultFailure = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * Always `false` when `isRollBackToEmbedded` is `true`.\n */\n isNew: false;\n /**\n * The manifest of the fetched update.\n */\n manifest: undefined;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The roll back to embedded result of fetching a new update.\n */\nexport type UpdateFetchResultRollBackToEmbedded = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * Always `false` when `isRollBackToEmbedded` is `true`.\n */\n isNew: false;\n /**\n * The manifest of the fetched update.\n */\n manifest: undefined;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: true;\n};\n\n/**\n * The result of fetching a new update.\n */\nexport type UpdateFetchResult =\n | UpdateFetchResultSuccess\n | UpdateFetchResultFailure\n | UpdateFetchResultRollBackToEmbedded;\n\n/**\n * An object representing a single log entry from expo-updates logging on the client.\n */\nexport type UpdatesLogEntry = {\n /**\n * The time the log was written, in milliseconds since Jan 1 1970 UTC.\n */\n timestamp: number;\n /**\n * The log entry message.\n */\n message: string;\n /**\n * One of the defined code values for `expo-updates` log entries.\n */\n code: UpdatesLogEntryCode;\n /**\n * One of the defined log level or severity values.\n */\n level: UpdatesLogEntryLevel;\n /**\n * If present, the unique ID of an update associated with this log entry.\n */\n updateId?: string;\n /**\n * If present, the unique ID or hash of an asset associated with this log entry.\n */\n assetId?: string;\n /**\n * If present, an Android or iOS native stack trace associated with this log entry.\n */\n stacktrace?: string[];\n};\n\n/**\n * The possible code values for expo-updates log entries\n */\nexport enum UpdatesLogEntryCode {\n NONE = 'None',\n NO_UPDATES_AVAILABLE = 'NoUpdatesAvailable',\n UPDATE_ASSETS_NOT_AVAILABLE = 'UpdateAssetsNotAvailable',\n UPDATE_SERVER_UNREACHABLE = 'UpdateServerUnreachable',\n UPDATE_HAS_INVALID_SIGNATURE = 'UpdateHasInvalidSignature',\n UPDATE_CODE_SIGNING_ERROR = 'UpdateCodeSigningError',\n UPDATE_FAILED_TO_LOAD = 'UpdateFailedToLoad',\n ASSETS_FAILED_TO_LOAD = 'AssetsFailedToLoad',\n JS_RUNTIME_ERROR = 'JSRuntimeError',\n INITIALIZATION_ERROR = 'InitializationError',\n UNKNOWN = 'Unknown',\n}\n\n/**\n * The possible log levels for expo-updates log entries\n */\nexport enum UpdatesLogEntryLevel {\n TRACE = 'trace',\n DEBUG = 'debug',\n INFO = 'info',\n WARN = 'warn',\n ERROR = 'error',\n FATAL = 'fatal',\n}\n\n/**\n * The possible settings that determine if expo-updates will check for updates on app startup.\n * By default, Expo will check for updates every time the app is loaded.\n * Set this to `ON_ERROR_RECOVERY` to disable automatic checking unless recovering from an error.\n * Set this to `NEVER` to completely disable automatic checking.\n */\nexport enum UpdatesCheckAutomaticallyValue {\n /**\n * Checks for updates whenever the app is loaded. This is the default setting.\n */\n ON_LOAD = 'ON_LOAD',\n /**\n * Only checks for updates when the app starts up after an error recovery.\n */\n ON_ERROR_RECOVERY = 'ON_ERROR_RECOVERY',\n /**\n * Only checks for updates when the app starts and has a Wi-Fi connection.\n */\n WIFI_ONLY = 'WIFI_ONLY',\n /**\n * Automatic update checks are off, and update checks must be done through the JS API.\n */\n NEVER = 'NEVER',\n}\n\n/**\n * @hidden\n */\nexport type LocalAssets = Record<string, string>;\n\n/**\n * @hidden\n */\nexport type UpdatesNativeStateRollback = {\n // ISO date string with the rollback commit time\n commitTime: string;\n};\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"Updates.types.js","sourceRoot":"","sources":["../src/Updates.types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,mCAwBX;AAxBD,WAAY,mCAAmC;IAC7C;;OAEG;IACH,kGAA2D,CAAA;IAC3D;;;OAGG;IACH,8GAAuE,CAAA;IACvE;;;OAGG;IACH,0FAAmD,CAAA;IACnD;;;OAGG;IACH,kHAA2E,CAAA;IAC3E;;OAEG;IACH,+FAAwD,CAAA;AAC1D,CAAC,EAxBW,mCAAmC,KAAnC,mCAAmC,QAwB9C;AAyLD;;GAEG;AACH,MAAM,CAAN,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,kEAA2C,CAAA;IAC3C,+EAAwD,CAAA;IACxD,4EAAqD,CAAA;IACrD,iFAA0D,CAAA;IAC1D,2EAAoD,CAAA;IACpD,mEAA4C,CAAA;IAC5C,mEAA4C,CAAA;IAC5C,0DAAmC,CAAA;IACnC,mEAA4C,CAAA;IAC5C,0CAAmB,CAAA;AACrB,CAAC,EAZW,mBAAmB,KAAnB,mBAAmB,QAY9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,uCAAe,CAAA;IACf,uCAAe,CAAA;AACjB,CAAC,EAPW,oBAAoB,KAApB,oBAAoB,QAO/B;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,8BAiBX;AAjBD,WAAY,8BAA8B;IACxC;;OAEG;IACH,qDAAmB,CAAA;IACnB;;OAEG;IACH,yEAAuC,CAAA;IACvC;;OAEG;IACH,yDAAuB,CAAA;IACvB;;OAEG;IACH,iDAAe,CAAA;AACjB,CAAC,EAjBW,8BAA8B,KAA9B,8BAA8B,QAiBzC","sourcesContent":["import { ExpoUpdatesManifest, EmbeddedManifest } from 'expo-manifests';\n\nexport type Manifest = ExpoUpdatesManifest | EmbeddedManifest;\n\nexport enum UpdateCheckResultNotAvailableReason {\n /**\n * No update manifest or rollback directive received from the update server.\n */\n NO_UPDATE_AVAILABLE_ON_SERVER = 'noUpdateAvailableOnServer',\n /**\n * An update manifest was received from the update server, but the update is not launchable,\n * or does not pass the configured selection policy.\n */\n UPDATE_REJECTED_BY_SELECTION_POLICY = 'updateRejectedBySelectionPolicy',\n /**\n * An update manifest was received from the update server, but the update has been previously\n * launched on this device and never successfully launched.\n */\n UPDATE_PREVIOUSLY_FAILED = 'updatePreviouslyFailed',\n /**\n * A rollback directive was received from the update server, but the directive does not pass\n * the configured selection policy.\n */\n ROLLBACK_REJECTED_BY_SELECTION_POLICY = 'rollbackRejectedBySelectionPolicy',\n /**\n * A rollback directive was received from the update server, but this app has no embedded update.\n */\n ROLLBACK_NO_EMBEDDED = 'rollbackNoEmbeddedConfiguration',\n}\n\n/**\n * The update check result when a rollback directive is received.\n */\nexport type UpdateCheckResultRollBack = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: false;\n /**\n * The manifest of the update when available.\n */\n manifest: undefined;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: true;\n /**\n * If no new update is found, this contains one of several enum values indicating the reason.\n */\n reason: undefined;\n};\n\n/**\n * The update check result when a new update is found on the server.\n */\nexport type UpdateCheckResultAvailable = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: true;\n /**\n * The manifest of the update when available.\n */\n manifest: Manifest;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: false;\n /**\n * If no new update is found, this contains one of several enum values indicating the reason.\n */\n reason: undefined;\n};\n\n/**\n * The update check result if no new update was found.\n */\nexport type UpdateCheckResultNotAvailable = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: false;\n /**\n * The manifest of the update when available.\n */\n manifest: undefined;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: false;\n /**\n * If no new update is found, this contains one of several enum values indicating the reason.\n */\n reason: UpdateCheckResultNotAvailableReason;\n};\n\n/**\n * The result of checking for a new update.\n */\nexport type UpdateCheckResult =\n | UpdateCheckResultRollBack\n | UpdateCheckResultAvailable\n | UpdateCheckResultNotAvailable;\n\n/**\n * @deprecated\n */\nexport type UpdateCheckResultSuccess = UpdateCheckResultAvailable;\n\n/**\n * @deprecated\n */\nexport type UpdateCheckResultFailure = UpdateCheckResultNotAvailable;\n\n/**\n * The successful result of fetching a new update.\n */\nexport type UpdateFetchResultSuccess = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * Always `true` when `isRollBackToEmbedded` is `false`.\n */\n isNew: true;\n /**\n * The manifest of the fetched update.\n */\n manifest: Manifest;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The failed result of fetching a new update.\n */\nexport type UpdateFetchResultFailure = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * Always `false` when `isRollBackToEmbedded` is `true`.\n */\n isNew: false;\n /**\n * The manifest of the fetched update.\n */\n manifest: undefined;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The roll back to embedded result of fetching a new update.\n */\nexport type UpdateFetchResultRollBackToEmbedded = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * Always `false` when `isRollBackToEmbedded` is `true`.\n */\n isNew: false;\n /**\n * The manifest of the fetched update.\n */\n manifest: undefined;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: true;\n};\n\n/**\n * The result of fetching a new update.\n */\nexport type UpdateFetchResult =\n | UpdateFetchResultSuccess\n | UpdateFetchResultFailure\n | UpdateFetchResultRollBackToEmbedded;\n\n/**\n * An object representing a single log entry from `expo-updates` logging on the client.\n */\nexport type UpdatesLogEntry = {\n /**\n * The time the log was written, in milliseconds since Jan 1 1970 UTC.\n */\n timestamp: number;\n /**\n * The log entry message.\n */\n message: string;\n /**\n * One of the defined code values for `expo-updates` log entries.\n */\n code: UpdatesLogEntryCode;\n /**\n * One of the defined log level or severity values.\n */\n level: UpdatesLogEntryLevel;\n /**\n * If present, the unique ID of an update associated with this log entry.\n */\n updateId?: string;\n /**\n * If present, the unique ID or hash of an asset associated with this log entry.\n */\n assetId?: string;\n /**\n * If present, an Android or iOS native stack trace associated with this log entry.\n */\n stacktrace?: string[];\n};\n\n/**\n * The possible code values for `expo-updates` log entries\n */\nexport enum UpdatesLogEntryCode {\n NONE = 'None',\n NO_UPDATES_AVAILABLE = 'NoUpdatesAvailable',\n UPDATE_ASSETS_NOT_AVAILABLE = 'UpdateAssetsNotAvailable',\n UPDATE_SERVER_UNREACHABLE = 'UpdateServerUnreachable',\n UPDATE_HAS_INVALID_SIGNATURE = 'UpdateHasInvalidSignature',\n UPDATE_CODE_SIGNING_ERROR = 'UpdateCodeSigningError',\n UPDATE_FAILED_TO_LOAD = 'UpdateFailedToLoad',\n ASSETS_FAILED_TO_LOAD = 'AssetsFailedToLoad',\n JS_RUNTIME_ERROR = 'JSRuntimeError',\n INITIALIZATION_ERROR = 'InitializationError',\n UNKNOWN = 'Unknown',\n}\n\n/**\n * The possible log levels for `expo-updates` log entries\n */\nexport enum UpdatesLogEntryLevel {\n TRACE = 'trace',\n DEBUG = 'debug',\n INFO = 'info',\n WARN = 'warn',\n ERROR = 'error',\n FATAL = 'fatal',\n}\n\n/**\n * The possible settings that determine if `expo-updates` will check for updates on app startup.\n * By default, Expo will check for updates every time the app is loaded.\n * Set this to `ON_ERROR_RECOVERY` to disable automatic checking unless recovering from an error.\n * Set this to `NEVER` to completely disable automatic checking.\n */\nexport enum UpdatesCheckAutomaticallyValue {\n /**\n * Checks for updates whenever the app is loaded. This is the default setting.\n */\n ON_LOAD = 'ON_LOAD',\n /**\n * Only checks for updates when the app starts up after an error recovery.\n */\n ON_ERROR_RECOVERY = 'ON_ERROR_RECOVERY',\n /**\n * Only checks for updates when the app starts and has a Wi-Fi connection.\n */\n WIFI_ONLY = 'WIFI_ONLY',\n /**\n * Automatic update checks are off, and update checks must be done through the JS API.\n */\n NEVER = 'NEVER',\n}\n\n/**\n * @hidden\n */\nexport type LocalAssets = Record<string, string>;\n\n/**\n * @hidden\n */\nexport type UpdatesNativeStateRollback = {\n // ISO date string with the rollback commit time\n commitTime: string;\n};\n\n/**\n * The native state machine context, either read directly from a native module method,\n * or received in a state change event. Used internally by this module and not exported publicly.\n * @hidden\n */\nexport type UpdatesNativeStateMachineContext = {\n isUpdateAvailable: boolean;\n isUpdatePending: boolean;\n isChecking: boolean;\n isDownloading: boolean;\n isRestarting: boolean;\n latestManifest?: Manifest;\n downloadedManifest?: Manifest;\n rollback?: UpdatesNativeStateRollback;\n checkError?: Error;\n downloadError?: Error;\n lastCheckForUpdateTime?: Date;\n};\n\n/**\n * @hidden\n */\nexport type UpdatesNativeStateChangeEvent = {\n // Change event emitted by native\n context: UpdatesNativeStateMachineContext;\n};\n"]}
|
|
@@ -8,11 +8,12 @@ export type CurrentlyRunningInfo = {
|
|
|
8
8
|
* The UUID that uniquely identifies the currently running update if `expo-updates` is enabled. The
|
|
9
9
|
* UUID is represented in its canonical string form and will always use lowercase letters.
|
|
10
10
|
* In development mode, or any other environment in which `expo-updates` is disabled, this value is undefined.
|
|
11
|
-
* @example
|
|
11
|
+
* @example
|
|
12
|
+
* `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"`
|
|
12
13
|
*/
|
|
13
14
|
updateId?: string;
|
|
14
15
|
/**
|
|
15
|
-
* The channel name of the current build, if configured for use with EAS Update
|
|
16
|
+
* The channel name of the current build, if configured for use with EAS Update, `undefined` otherwise.
|
|
16
17
|
*/
|
|
17
18
|
channel?: string;
|
|
18
19
|
/**
|
|
@@ -76,7 +77,7 @@ export declare enum UpdateInfoType {
|
|
|
76
77
|
/**
|
|
77
78
|
* Structure representing a new update.
|
|
78
79
|
*/
|
|
79
|
-
type UpdateInfoNew = {
|
|
80
|
+
export type UpdateInfoNew = {
|
|
80
81
|
/**
|
|
81
82
|
* The type of update.
|
|
82
83
|
*/
|
|
@@ -85,7 +86,8 @@ type UpdateInfoNew = {
|
|
|
85
86
|
* For updates of type `UpdateInfoType.NEW`, this is
|
|
86
87
|
* a string that uniquely identifies the update. For the manifests used in the current Expo Updates protocol (including
|
|
87
88
|
* EAS Update), this represents the update's UUID in its canonical string form and will always use lowercase letters.
|
|
88
|
-
* @example
|
|
89
|
+
* @example
|
|
90
|
+
* `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"`
|
|
89
91
|
*/
|
|
90
92
|
updateId: string;
|
|
91
93
|
/**
|
|
@@ -102,13 +104,13 @@ type UpdateInfoNew = {
|
|
|
102
104
|
/**
|
|
103
105
|
* Structure representing a rollback directive.
|
|
104
106
|
*/
|
|
105
|
-
type UpdateInfoRollback = {
|
|
107
|
+
export type UpdateInfoRollback = {
|
|
106
108
|
/**
|
|
107
109
|
* The type of update.
|
|
108
110
|
*/
|
|
109
111
|
type: UpdateInfoType.ROLLBACK;
|
|
110
112
|
/**
|
|
111
|
-
* For updates of type `UpdateInfoType.ROLLBACK`, this is undefined
|
|
113
|
+
* For updates of type `UpdateInfoType.ROLLBACK`, this is always set to `undefined`.
|
|
112
114
|
*/
|
|
113
115
|
updateId: undefined;
|
|
114
116
|
/**
|
|
@@ -117,7 +119,7 @@ type UpdateInfoRollback = {
|
|
|
117
119
|
*/
|
|
118
120
|
createdAt: Date;
|
|
119
121
|
/**
|
|
120
|
-
* For updates of type `UpdateInfoType.ROLLBACK`, this is undefined
|
|
122
|
+
* For updates of type `UpdateInfoType.ROLLBACK`, this is always set to `undefined`.
|
|
121
123
|
*/
|
|
122
124
|
manifest: undefined;
|
|
123
125
|
};
|
|
@@ -126,7 +128,7 @@ type UpdateInfoRollback = {
|
|
|
126
128
|
*/
|
|
127
129
|
export type UpdateInfo = UpdateInfoNew | UpdateInfoRollback;
|
|
128
130
|
/**
|
|
129
|
-
* The structures and methods returned by `useUpdates()
|
|
131
|
+
* The structures and methods returned by [`useUpdates()`](#useupdates).
|
|
130
132
|
*/
|
|
131
133
|
export type UseUpdatesReturnType = {
|
|
132
134
|
/**
|
|
@@ -134,9 +136,8 @@ export type UseUpdatesReturnType = {
|
|
|
134
136
|
*/
|
|
135
137
|
currentlyRunning: CurrentlyRunningInfo;
|
|
136
138
|
/**
|
|
137
|
-
* If a new available update has been found, either by using
|
|
138
|
-
* or by the `UpdateEvent` listener in `useUpdates()`,
|
|
139
|
-
* this will contain the information for that update.
|
|
139
|
+
* If a new available update has been found, either by using [`checkForUpdateAsync()`](#updatescheckforupdateasync),
|
|
140
|
+
* or by the `UpdateEvent` listener in `useUpdates()`, this will contain the information for that update.
|
|
140
141
|
*/
|
|
141
142
|
availableUpdate?: UpdateInfo;
|
|
142
143
|
/**
|
|
@@ -161,17 +162,17 @@ export type UseUpdatesReturnType = {
|
|
|
161
162
|
*/
|
|
162
163
|
isDownloading: boolean;
|
|
163
164
|
/**
|
|
164
|
-
* If an error is returned from either the startup check for updates, or a call to `checkForUpdateAsync()
|
|
165
|
+
* If an error is returned from either the startup check for updates, or a call to [`checkForUpdateAsync()`](#updatescheckforupdateasync),
|
|
165
166
|
* the error description will appear here.
|
|
166
167
|
*/
|
|
167
168
|
checkError?: Error;
|
|
168
169
|
/**
|
|
169
|
-
* If an error is returned from either a startup update download, or a call to `fetchUpdateAsync()
|
|
170
|
+
* If an error is returned from either a startup update download, or a call to [`fetchUpdateAsync()`](#updatesfetchupdateasync),
|
|
170
171
|
* the error description will appear here.
|
|
171
172
|
*/
|
|
172
173
|
downloadError?: Error;
|
|
173
174
|
/**
|
|
174
|
-
* If an error occurs during initialization of `useUpdates()
|
|
175
|
+
* If an error occurs during initialization of [`useUpdates()`](#useupdates), the error description will appear here.
|
|
175
176
|
*/
|
|
176
177
|
initializationError?: Error;
|
|
177
178
|
/**
|
|
@@ -181,5 +182,4 @@ export type UseUpdatesReturnType = {
|
|
|
181
182
|
*/
|
|
182
183
|
lastCheckForUpdateTimeSinceRestart?: Date;
|
|
183
184
|
};
|
|
184
|
-
export {};
|
|
185
185
|
//# sourceMappingURL=UseUpdates.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseUpdates.types.d.ts","sourceRoot":"","sources":["../src/UseUpdates.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC
|
|
1
|
+
{"version":3,"file":"UseUpdates.types.d.ts","sourceRoot":"","sources":["../src/UseUpdates.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;;;;;OAQG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAA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