expo-file-system 13.1.0 → 13.2.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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/android/build.gradle +4 -4
- package/build/FileSystem.js +1 -1
- package/build/FileSystem.js.map +1 -1
- package/ios/EXFileSystem/EXFileSystem.m +4 -2
- package/ios/EXFileSystem.xcframework/ios-arm64/EXFileSystem.framework/EXFileSystem +0 -0
- package/ios/EXFileSystem.xcframework/ios-arm64/EXFileSystem.framework/Info.plist +0 -0
- package/ios/EXFileSystem.xcframework/ios-arm64_x86_64-simulator/EXFileSystem.framework/EXFileSystem +0 -0
- package/ios/EXFileSystem.xcframework/ios-arm64_x86_64-simulator/EXFileSystem.framework/Info.plist +0 -0
- package/package.json +4 -4
- package/src/FileSystem.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 13.2.0 — 2021-12-22
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fixed runtime crash due to `.toUpperCase` not being invoked as a function, it was missing `()`. ([#15615](https://github.com/expo/expo/pull/15615) by [@lukebrandonfarrell](https://github.com/lukebrandonfarrell))
|
|
18
|
+
- Fixed `totalByteSent` in upload progress callback incorrectly sending `bytesSent` on iOS. ([#15615](https://github.com/expo/expo/pull/15615) by [@lukebrandonfarrell](https://github.com/lukebrandonfarrell))
|
|
19
|
+
- Fixed simulator runtime crash on arm64 devices caused by `CFRelease(NULL)`. ([#15496](https://github.com/expo/expo/pull/15496) by [@daxaxelrod](https://github.com/daxaxelrod))
|
|
20
|
+
|
|
21
|
+
### 💡 Others
|
|
22
|
+
|
|
23
|
+
- Updated `@expo/config-plugins` from `4.0.2` to `4.0.14` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
|
|
24
|
+
|
|
13
25
|
## 13.1.0 — 2021-11-17
|
|
14
26
|
|
|
15
27
|
### 🐛 Bug fixes
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Provides access to the local file system on the device.
|
|
|
9
9
|
|
|
10
10
|
# Installation in managed Expo projects
|
|
11
11
|
|
|
12
|
-
For
|
|
12
|
+
For [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/filesystem/).
|
|
13
13
|
|
|
14
14
|
# Installation in bare React Native projects
|
|
15
15
|
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '13.
|
|
6
|
+
version = '13.2.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
@@ -16,7 +16,7 @@ buildscript {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
dependencies {
|
|
19
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.
|
|
19
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.6.10')}")
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -61,7 +61,7 @@ android {
|
|
|
61
61
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
62
62
|
targetSdkVersion safeExtGet("targetSdkVersion", 30)
|
|
63
63
|
versionCode 30
|
|
64
|
-
versionName "13.
|
|
64
|
+
versionName "13.2.0"
|
|
65
65
|
}
|
|
66
66
|
lintOptions {
|
|
67
67
|
abortOnError false
|
|
@@ -81,5 +81,5 @@ dependencies {
|
|
|
81
81
|
api 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
|
|
82
82
|
api "androidx.legacy:legacy-support-v4:1.0.0"
|
|
83
83
|
|
|
84
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.
|
|
84
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.6.10')}"
|
|
85
85
|
}
|
package/build/FileSystem.js
CHANGED
|
@@ -178,7 +178,7 @@ export class UploadTask extends FileSystemCancellableNetworkTask {
|
|
|
178
178
|
this.url = url;
|
|
179
179
|
this.fileUri = fileUri;
|
|
180
180
|
this.callback = callback;
|
|
181
|
-
const httpMethod = (options?.httpMethod?.toUpperCase ||
|
|
181
|
+
const httpMethod = (options?.httpMethod?.toUpperCase() ||
|
|
182
182
|
'POST');
|
|
183
183
|
this.options = {
|
|
184
184
|
sessionType: FileSystemSessionType.BACKGROUND,
|
package/build/FileSystem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../src/FileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAQL,YAAY,EAKZ,qBAAqB,EAGrB,oBAAoB,GAIrB,MAAM,oBAAoB,CAAC;AAE5B,IAAI,CAAC,kBAAkB,EAAE;IACvB,OAAO,CAAC,IAAI,CACV,2GAA2G,CAC5G,CAAC;CACH;AACD,qCAAqC;AACrC,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,sBAAsB;AAE5E,OAAO,EAML,YAAY,EAKZ,qBAAqB,EAGrB,oBAAoB,GAIrB,CAAC;AAEF,SAAS,oBAA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,yCAAkB,GAAG,sBAAsB,CAAC;IAC5C,wCAAiB,GAAG,qBAAqB,CAAC;IAC1C,kCAAW,GAAG,eAAe,CAAC;IAC9B,gCAAS,GAAG,aAAa,CAAC;IAC1B,gCAAS,GAAG,aAAa,CAAC;AACzC,CAAC,EAtDgB,sBAAsB,KAAtB,sBAAsB,QAsDtC","sourcesContent":["import { EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core';\nimport { Platform } from 'react-native';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport ExponentFileSystem from './ExponentFileSystem';\nimport {\n DownloadOptions,\n DownloadPauseState,\n DownloadProgressCallback,\n FileSystemNetworkTaskProgressCallback,\n DownloadProgressData,\n UploadProgressData,\n DownloadResult,\n EncodingType,\n FileInfo,\n FileSystemAcceptedUploadHttpMethod,\n FileSystemDownloadResult,\n FileSystemRequestDirectoryPermissionsResult,\n FileSystemSessionType,\n FileSystemUploadOptions,\n FileSystemUploadResult,\n FileSystemUploadType,\n ProgressEvent,\n ReadingOptions,\n WritingOptions,\n} from './FileSystem.types';\n\nif (!ExponentFileSystem) {\n console.warn(\n \"No native ExponentFileSystem module found, are you sure the expo-file-system's module is linked properly?\"\n );\n}\n// Prevent webpack from pruning this.\nconst _unused = new EventEmitter(ExponentFileSystem); // eslint-disable-line\n\nexport {\n DownloadOptions,\n DownloadPauseState,\n DownloadProgressCallback,\n DownloadProgressData,\n DownloadResult,\n EncodingType,\n FileInfo,\n FileSystemDownloadResult,\n FileSystemRequestDirectoryPermissionsResult,\n FileSystemAcceptedUploadHttpMethod,\n FileSystemSessionType,\n FileSystemUploadOptions,\n FileSystemUploadResult,\n FileSystemUploadType,\n FileSystemNetworkTaskProgressCallback,\n ReadingOptions,\n WritingOptions,\n};\n\nfunction normalizeEndingSlash(p: string | null): string | null {\n if (p != null) {\n return p.replace(/\\/*$/, '') + '/';\n }\n return null;\n}\n\nexport const documentDirectory = normalizeEndingSlash(ExponentFileSystem.documentDirectory);\nexport const cacheDirectory = normalizeEndingSlash(ExponentFileSystem.cacheDirectory);\n\nexport const { bundledAssets, bundleDirectory } = ExponentFileSystem;\n\nexport async function getInfoAsync(\n fileUri: string,\n options: { md5?: boolean; size?: boolean } = {}\n): Promise<FileInfo> {\n if (!ExponentFileSystem.getInfoAsync) {\n throw new UnavailabilityError('expo-file-system', 'getInfoAsync');\n }\n return await ExponentFileSystem.getInfoAsync(fileUri, options);\n}\n\nexport async function readAsStringAsync(\n fileUri: string,\n options?: ReadingOptions\n): Promise<string> {\n if (!ExponentFileSystem.readAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'readAsStringAsync');\n }\n return await ExponentFileSystem.readAsStringAsync(fileUri, options || {});\n}\n\nexport async function getContentUriAsync(fileUri: string): Promise<string> {\n if (Platform.OS === 'android') {\n if (!ExponentFileSystem.getContentUriAsync) {\n throw new UnavailabilityError('expo-file-system', 'getContentUriAsync');\n }\n return await ExponentFileSystem.getContentUriAsync(fileUri);\n } else {\n return new Promise(function (resolve, reject) {\n resolve(fileUri);\n });\n }\n}\n\nexport async function writeAsStringAsync(\n fileUri: string,\n contents: string,\n options: WritingOptions = {}\n): Promise<void> {\n if (!ExponentFileSystem.writeAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'writeAsStringAsync');\n }\n return await ExponentFileSystem.writeAsStringAsync(fileUri, contents, options);\n}\n\nexport async function deleteAsync(\n fileUri: string,\n options: { idempotent?: boolean } = {}\n): Promise<void> {\n if (!ExponentFileSystem.deleteAsync) {\n throw new UnavailabilityError('expo-file-system', 'deleteAsync');\n }\n return await ExponentFileSystem.deleteAsync(fileUri, options);\n}\n\nexport async function deleteLegacyDocumentDirectoryAndroid(): Promise<void> {\n if (Platform.OS !== 'android' || documentDirectory == null) {\n return;\n }\n const legacyDocumentDirectory = `${documentDirectory}ExperienceData/`;\n return await deleteAsync(legacyDocumentDirectory, { idempotent: true });\n}\n\nexport async function moveAsync(options: { from: string; to: string }): Promise<void> {\n if (!ExponentFileSystem.moveAsync) {\n throw new UnavailabilityError('expo-file-system', 'moveAsync');\n }\n return await ExponentFileSystem.moveAsync(options);\n}\n\nexport async function copyAsync(options: { from: string; to: string }): Promise<void> {\n if (!ExponentFileSystem.copyAsync) {\n throw new UnavailabilityError('expo-file-system', 'copyAsync');\n }\n return await ExponentFileSystem.copyAsync(options);\n}\n\nexport async function makeDirectoryAsync(\n fileUri: string,\n options: { intermediates?: boolean } = {}\n): Promise<void> {\n if (!ExponentFileSystem.makeDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'makeDirectoryAsync');\n }\n return await ExponentFileSystem.makeDirectoryAsync(fileUri, options);\n}\n\nexport async function readDirectoryAsync(fileUri: string): Promise<string[]> {\n if (!ExponentFileSystem.readDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'readDirectoryAsync');\n }\n return await ExponentFileSystem.readDirectoryAsync(fileUri, {});\n}\n\nexport async function getFreeDiskStorageAsync(): Promise<number> {\n if (!ExponentFileSystem.getFreeDiskStorageAsync) {\n throw new UnavailabilityError('expo-file-system', 'getFreeDiskStorageAsync');\n }\n return await ExponentFileSystem.getFreeDiskStorageAsync();\n}\n\nexport async function getTotalDiskCapacityAsync(): Promise<number> {\n if (!ExponentFileSystem.getTotalDiskCapacityAsync) {\n throw new UnavailabilityError('expo-file-system', 'getTotalDiskCapacityAsync');\n }\n return await ExponentFileSystem.getTotalDiskCapacityAsync();\n}\n\nexport async function downloadAsync(\n uri: string,\n fileUri: string,\n options: DownloadOptions = {}\n): Promise<FileSystemDownloadResult> {\n if (!ExponentFileSystem.downloadAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadAsync');\n }\n\n return await ExponentFileSystem.downloadAsync(uri, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n ...options,\n });\n}\n\nexport async function uploadAsync(\n url: string,\n fileUri: string,\n options: FileSystemUploadOptions = {}\n): Promise<FileSystemUploadResult> {\n if (!ExponentFileSystem.uploadAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadAsync');\n }\n\n return await ExponentFileSystem.uploadAsync(url, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod: (options.httpMethod || 'POST').toUpperCase(),\n });\n}\n\nexport function createDownloadResumable(\n uri: string,\n fileUri: string,\n options?: DownloadOptions,\n callback?: FileSystemNetworkTaskProgressCallback<DownloadProgressData>,\n resumeData?: string\n): DownloadResumable {\n return new DownloadResumable(uri, fileUri, options, callback, resumeData);\n}\n\nexport function createUploadTask(\n url: string,\n fileUri: string,\n options?: FileSystemUploadOptions,\n callback?: FileSystemNetworkTaskProgressCallback<UploadProgressData>\n): UploadTask {\n return new UploadTask(url, fileUri, options, callback);\n}\n\nexport abstract class FileSystemCancellableNetworkTask<\n T extends DownloadProgressData | UploadProgressData\n> {\n private _uuid = uuidv4();\n protected taskWasCanceled = false;\n private emitter = new EventEmitter(ExponentFileSystem);\n private subscription?: Subscription | null;\n\n public async cancelAsync(): Promise<void> {\n if (!ExponentFileSystem.networkTaskCancelAsync) {\n throw new UnavailabilityError('expo-file-system', 'networkTaskCancelAsync');\n }\n\n this.removeSubscription();\n this.taskWasCanceled = true;\n return await ExponentFileSystem.networkTaskCancelAsync(this.uuid);\n }\n\n protected isTaskCancelled(): boolean {\n if (this.taskWasCanceled) {\n console.warn('This task was already canceled.');\n return true;\n }\n\n return false;\n }\n\n protected get uuid(): string {\n return this._uuid;\n }\n\n protected abstract getEventName(): string;\n\n protected abstract getCallback(): FileSystemNetworkTaskProgressCallback<T> | undefined;\n\n protected addSubscription() {\n if (this.subscription) {\n return;\n }\n\n this.subscription = this.emitter.addListener(this.getEventName(), (event: ProgressEvent<T>) => {\n if (event.uuid === this.uuid) {\n const callback = this.getCallback();\n if (callback) {\n callback(event.data);\n }\n }\n });\n }\n\n protected removeSubscription() {\n if (!this.subscription) {\n return;\n }\n this.emitter.removeSubscription(this.subscription);\n this.subscription = null;\n }\n}\n\nexport class UploadTask extends FileSystemCancellableNetworkTask<UploadProgressData> {\n private options: FileSystemUploadOptions;\n\n constructor(\n private url: string,\n private fileUri: string,\n options?: FileSystemUploadOptions,\n private callback?: FileSystemNetworkTaskProgressCallback<UploadProgressData>\n ) {\n super();\n\n const httpMethod = (options?.httpMethod?.toUpperCase ||\n 'POST') as FileSystemAcceptedUploadHttpMethod;\n\n this.options = {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod,\n };\n }\n\n protected getEventName(): string {\n return 'expo-file-system.uploadProgress';\n }\n protected getCallback(): FileSystemNetworkTaskProgressCallback<UploadProgressData> | undefined {\n return this.callback;\n }\n\n public async uploadAsync(): Promise<FileSystemUploadResult | undefined> {\n if (!ExponentFileSystem.uploadTaskStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadTaskStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n const result = await ExponentFileSystem.uploadTaskStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options\n );\n this.removeSubscription();\n\n return result;\n }\n}\n\nexport class DownloadResumable extends FileSystemCancellableNetworkTask<DownloadProgressData> {\n constructor(\n private url: string,\n private _fileUri: string,\n private options: DownloadOptions = {},\n private callback?: FileSystemNetworkTaskProgressCallback<DownloadProgressData>,\n private resumeData?: string\n ) {\n super();\n }\n\n public get fileUri(): string {\n return this._fileUri;\n }\n\n protected getEventName(): string {\n return 'expo-file-system.downloadProgress';\n }\n\n protected getCallback(): FileSystemNetworkTaskProgressCallback<DownloadProgressData> | undefined {\n return this.callback;\n }\n\n async downloadAsync(): Promise<FileSystemDownloadResult | undefined> {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this._fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n async pauseAsync(): Promise<DownloadPauseState> {\n if (!ExponentFileSystem.downloadResumablePauseAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumablePauseAsync');\n }\n\n if (this.isTaskCancelled()) {\n return {\n fileUri: this._fileUri,\n options: this.options,\n url: this.url,\n };\n }\n\n const pauseResult = await ExponentFileSystem.downloadResumablePauseAsync(this.uuid);\n this.removeSubscription();\n if (pauseResult) {\n this.resumeData = pauseResult.resumeData;\n return this.savable();\n } else {\n throw new Error('Unable to generate a savable pause state');\n }\n }\n\n async resumeAsync(): Promise<FileSystemDownloadResult | undefined> {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n savable(): DownloadPauseState {\n return {\n url: this.url,\n fileUri: this.fileUri,\n options: this.options,\n resumeData: this.resumeData,\n };\n }\n}\n\nconst baseReadAsStringAsync = readAsStringAsync;\nconst baseWriteAsStringAsync = writeAsStringAsync;\nconst baseDeleteAsync = deleteAsync;\nconst baseMoveAsync = moveAsync;\nconst baseCopyAsync = copyAsync;\n/**\n * Android only\n */\nexport namespace StorageAccessFramework {\n export function getUriForDirectoryInRoot(folderName: string) {\n return `content://com.android.externalstorage.documents/tree/primary:${folderName}/document/primary:${folderName}`;\n }\n\n export async function requestDirectoryPermissionsAsync(\n initialFileUrl: string | null = null\n ): Promise<FileSystemRequestDirectoryPermissionsResult> {\n if (!ExponentFileSystem.requestDirectoryPermissionsAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.requestDirectoryPermissionsAsync'\n );\n }\n\n return await ExponentFileSystem.requestDirectoryPermissionsAsync(initialFileUrl);\n }\n\n export async function readDirectoryAsync(dirUri: string): Promise<string[]> {\n if (!ExponentFileSystem.readSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.readDirectoryAsync'\n );\n }\n return await ExponentFileSystem.readSAFDirectoryAsync(dirUri, {});\n }\n\n export async function makeDirectoryAsync(parentUri: string, dirName: string): Promise<string> {\n if (!ExponentFileSystem.makeSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.makeDirectoryAsync'\n );\n }\n return await ExponentFileSystem.makeSAFDirectoryAsync(parentUri, dirName);\n }\n\n export async function createFileAsync(\n parentUri: string,\n fileName: string,\n mimeType: string\n ): Promise<string> {\n if (!ExponentFileSystem.createSAFFileAsync) {\n throw new UnavailabilityError('expo-file-system', 'StorageAccessFramework.createFileAsync');\n }\n return await ExponentFileSystem.createSAFFileAsync(parentUri, fileName, mimeType);\n }\n\n export const writeAsStringAsync = baseWriteAsStringAsync;\n export const readAsStringAsync = baseReadAsStringAsync;\n export const deleteAsync = baseDeleteAsync;\n export const moveAsync = baseMoveAsync;\n export const copyAsync = baseCopyAsync;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../src/FileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAQL,YAAY,EAKZ,qBAAqB,EAGrB,oBAAoB,GAIrB,MAAM,oBAAoB,CAAC;AAE5B,IAAI,CAAC,kBAAkB,EAAE;IACvB,OAAO,CAAC,IAAI,CACV,2GAA2G,CAC5G,CAAC;CACH;AACD,qCAAqC;AACrC,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,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AAkB,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpF,CAAC;IATqB,sCAAe,kBASpC,CAAA;IAEY,yCAAkB,GAAG,sBAAsB,CAAC;IAC5C,wCAAiB,GAAG,qBAAqB,CAAC;IAC1C,kCAAW,GAAG,eAAe,CAAC;IAC9B,gCAAS,GAAG,aAAa,CAAC;IAC1B,gCAAS,GAAG,aAAa,CAAC;AACzC,CAAC,EAtDgB,sBAAsB,KAAtB,sBAAsB,QAsDtC","sourcesContent":["import { EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core';\nimport { Platform } from 'react-native';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport ExponentFileSystem from './ExponentFileSystem';\nimport {\n DownloadOptions,\n DownloadPauseState,\n DownloadProgressCallback,\n FileSystemNetworkTaskProgressCallback,\n DownloadProgressData,\n UploadProgressData,\n DownloadResult,\n EncodingType,\n FileInfo,\n FileSystemAcceptedUploadHttpMethod,\n FileSystemDownloadResult,\n FileSystemRequestDirectoryPermissionsResult,\n FileSystemSessionType,\n FileSystemUploadOptions,\n FileSystemUploadResult,\n FileSystemUploadType,\n ProgressEvent,\n ReadingOptions,\n WritingOptions,\n} from './FileSystem.types';\n\nif (!ExponentFileSystem) {\n console.warn(\n \"No native ExponentFileSystem module found, are you sure the expo-file-system's module is linked properly?\"\n );\n}\n// Prevent webpack from pruning this.\nconst _unused = new EventEmitter(ExponentFileSystem); // eslint-disable-line\n\nexport {\n DownloadOptions,\n DownloadPauseState,\n DownloadProgressCallback,\n DownloadProgressData,\n DownloadResult,\n EncodingType,\n FileInfo,\n FileSystemDownloadResult,\n FileSystemRequestDirectoryPermissionsResult,\n FileSystemAcceptedUploadHttpMethod,\n FileSystemSessionType,\n FileSystemUploadOptions,\n FileSystemUploadResult,\n FileSystemUploadType,\n FileSystemNetworkTaskProgressCallback,\n ReadingOptions,\n WritingOptions,\n};\n\nfunction normalizeEndingSlash(p: string | null): string | null {\n if (p != null) {\n return p.replace(/\\/*$/, '') + '/';\n }\n return null;\n}\n\nexport const documentDirectory = normalizeEndingSlash(ExponentFileSystem.documentDirectory);\nexport const cacheDirectory = normalizeEndingSlash(ExponentFileSystem.cacheDirectory);\n\nexport const { bundledAssets, bundleDirectory } = ExponentFileSystem;\n\nexport async function getInfoAsync(\n fileUri: string,\n options: { md5?: boolean; size?: boolean } = {}\n): Promise<FileInfo> {\n if (!ExponentFileSystem.getInfoAsync) {\n throw new UnavailabilityError('expo-file-system', 'getInfoAsync');\n }\n return await ExponentFileSystem.getInfoAsync(fileUri, options);\n}\n\nexport async function readAsStringAsync(\n fileUri: string,\n options?: ReadingOptions\n): Promise<string> {\n if (!ExponentFileSystem.readAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'readAsStringAsync');\n }\n return await ExponentFileSystem.readAsStringAsync(fileUri, options || {});\n}\n\nexport async function getContentUriAsync(fileUri: string): Promise<string> {\n if (Platform.OS === 'android') {\n if (!ExponentFileSystem.getContentUriAsync) {\n throw new UnavailabilityError('expo-file-system', 'getContentUriAsync');\n }\n return await ExponentFileSystem.getContentUriAsync(fileUri);\n } else {\n return new Promise(function (resolve, reject) {\n resolve(fileUri);\n });\n }\n}\n\nexport async function writeAsStringAsync(\n fileUri: string,\n contents: string,\n options: WritingOptions = {}\n): Promise<void> {\n if (!ExponentFileSystem.writeAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'writeAsStringAsync');\n }\n return await ExponentFileSystem.writeAsStringAsync(fileUri, contents, options);\n}\n\nexport async function deleteAsync(\n fileUri: string,\n options: { idempotent?: boolean } = {}\n): Promise<void> {\n if (!ExponentFileSystem.deleteAsync) {\n throw new UnavailabilityError('expo-file-system', 'deleteAsync');\n }\n return await ExponentFileSystem.deleteAsync(fileUri, options);\n}\n\nexport async function deleteLegacyDocumentDirectoryAndroid(): Promise<void> {\n if (Platform.OS !== 'android' || documentDirectory == null) {\n return;\n }\n const legacyDocumentDirectory = `${documentDirectory}ExperienceData/`;\n return await deleteAsync(legacyDocumentDirectory, { idempotent: true });\n}\n\nexport async function moveAsync(options: { from: string; to: string }): Promise<void> {\n if (!ExponentFileSystem.moveAsync) {\n throw new UnavailabilityError('expo-file-system', 'moveAsync');\n }\n return await ExponentFileSystem.moveAsync(options);\n}\n\nexport async function copyAsync(options: { from: string; to: string }): Promise<void> {\n if (!ExponentFileSystem.copyAsync) {\n throw new UnavailabilityError('expo-file-system', 'copyAsync');\n }\n return await ExponentFileSystem.copyAsync(options);\n}\n\nexport async function makeDirectoryAsync(\n fileUri: string,\n options: { intermediates?: boolean } = {}\n): Promise<void> {\n if (!ExponentFileSystem.makeDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'makeDirectoryAsync');\n }\n return await ExponentFileSystem.makeDirectoryAsync(fileUri, options);\n}\n\nexport async function readDirectoryAsync(fileUri: string): Promise<string[]> {\n if (!ExponentFileSystem.readDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'readDirectoryAsync');\n }\n return await ExponentFileSystem.readDirectoryAsync(fileUri, {});\n}\n\nexport async function getFreeDiskStorageAsync(): Promise<number> {\n if (!ExponentFileSystem.getFreeDiskStorageAsync) {\n throw new UnavailabilityError('expo-file-system', 'getFreeDiskStorageAsync');\n }\n return await ExponentFileSystem.getFreeDiskStorageAsync();\n}\n\nexport async function getTotalDiskCapacityAsync(): Promise<number> {\n if (!ExponentFileSystem.getTotalDiskCapacityAsync) {\n throw new UnavailabilityError('expo-file-system', 'getTotalDiskCapacityAsync');\n }\n return await ExponentFileSystem.getTotalDiskCapacityAsync();\n}\n\nexport async function downloadAsync(\n uri: string,\n fileUri: string,\n options: DownloadOptions = {}\n): Promise<FileSystemDownloadResult> {\n if (!ExponentFileSystem.downloadAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadAsync');\n }\n\n return await ExponentFileSystem.downloadAsync(uri, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n ...options,\n });\n}\n\nexport async function uploadAsync(\n url: string,\n fileUri: string,\n options: FileSystemUploadOptions = {}\n): Promise<FileSystemUploadResult> {\n if (!ExponentFileSystem.uploadAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadAsync');\n }\n\n return await ExponentFileSystem.uploadAsync(url, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod: (options.httpMethod || 'POST').toUpperCase(),\n });\n}\n\nexport function createDownloadResumable(\n uri: string,\n fileUri: string,\n options?: DownloadOptions,\n callback?: FileSystemNetworkTaskProgressCallback<DownloadProgressData>,\n resumeData?: string\n): DownloadResumable {\n return new DownloadResumable(uri, fileUri, options, callback, resumeData);\n}\n\nexport function createUploadTask(\n url: string,\n fileUri: string,\n options?: FileSystemUploadOptions,\n callback?: FileSystemNetworkTaskProgressCallback<UploadProgressData>\n): UploadTask {\n return new UploadTask(url, fileUri, options, callback);\n}\n\nexport abstract class FileSystemCancellableNetworkTask<\n T extends DownloadProgressData | UploadProgressData\n> {\n private _uuid = uuidv4();\n protected taskWasCanceled = false;\n private emitter = new EventEmitter(ExponentFileSystem);\n private subscription?: Subscription | null;\n\n public async cancelAsync(): Promise<void> {\n if (!ExponentFileSystem.networkTaskCancelAsync) {\n throw new UnavailabilityError('expo-file-system', 'networkTaskCancelAsync');\n }\n\n this.removeSubscription();\n this.taskWasCanceled = true;\n return await ExponentFileSystem.networkTaskCancelAsync(this.uuid);\n }\n\n protected isTaskCancelled(): boolean {\n if (this.taskWasCanceled) {\n console.warn('This task was already canceled.');\n return true;\n }\n\n return false;\n }\n\n protected get uuid(): string {\n return this._uuid;\n }\n\n protected abstract getEventName(): string;\n\n protected abstract getCallback(): FileSystemNetworkTaskProgressCallback<T> | undefined;\n\n protected addSubscription() {\n if (this.subscription) {\n return;\n }\n\n this.subscription = this.emitter.addListener(this.getEventName(), (event: ProgressEvent<T>) => {\n if (event.uuid === this.uuid) {\n const callback = this.getCallback();\n if (callback) {\n callback(event.data);\n }\n }\n });\n }\n\n protected removeSubscription() {\n if (!this.subscription) {\n return;\n }\n this.emitter.removeSubscription(this.subscription);\n this.subscription = null;\n }\n}\n\nexport class UploadTask extends FileSystemCancellableNetworkTask<UploadProgressData> {\n private options: FileSystemUploadOptions;\n\n constructor(\n private url: string,\n private fileUri: string,\n options?: FileSystemUploadOptions,\n private callback?: FileSystemNetworkTaskProgressCallback<UploadProgressData>\n ) {\n super();\n\n const httpMethod = (options?.httpMethod?.toUpperCase() ||\n 'POST') as FileSystemAcceptedUploadHttpMethod;\n\n this.options = {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod,\n };\n }\n\n protected getEventName(): string {\n return 'expo-file-system.uploadProgress';\n }\n protected getCallback(): FileSystemNetworkTaskProgressCallback<UploadProgressData> | undefined {\n return this.callback;\n }\n\n public async uploadAsync(): Promise<FileSystemUploadResult | undefined> {\n if (!ExponentFileSystem.uploadTaskStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadTaskStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n const result = await ExponentFileSystem.uploadTaskStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options\n );\n this.removeSubscription();\n\n return result;\n }\n}\n\nexport class DownloadResumable extends FileSystemCancellableNetworkTask<DownloadProgressData> {\n constructor(\n private url: string,\n private _fileUri: string,\n private options: DownloadOptions = {},\n private callback?: FileSystemNetworkTaskProgressCallback<DownloadProgressData>,\n private resumeData?: string\n ) {\n super();\n }\n\n public get fileUri(): string {\n return this._fileUri;\n }\n\n protected getEventName(): string {\n return 'expo-file-system.downloadProgress';\n }\n\n protected getCallback(): FileSystemNetworkTaskProgressCallback<DownloadProgressData> | undefined {\n return this.callback;\n }\n\n async downloadAsync(): Promise<FileSystemDownloadResult | undefined> {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this._fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n async pauseAsync(): Promise<DownloadPauseState> {\n if (!ExponentFileSystem.downloadResumablePauseAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumablePauseAsync');\n }\n\n if (this.isTaskCancelled()) {\n return {\n fileUri: this._fileUri,\n options: this.options,\n url: this.url,\n };\n }\n\n const pauseResult = await ExponentFileSystem.downloadResumablePauseAsync(this.uuid);\n this.removeSubscription();\n if (pauseResult) {\n this.resumeData = pauseResult.resumeData;\n return this.savable();\n } else {\n throw new Error('Unable to generate a savable pause state');\n }\n }\n\n async resumeAsync(): Promise<FileSystemDownloadResult | undefined> {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n savable(): DownloadPauseState {\n return {\n url: this.url,\n fileUri: this.fileUri,\n options: this.options,\n resumeData: this.resumeData,\n };\n }\n}\n\nconst baseReadAsStringAsync = readAsStringAsync;\nconst baseWriteAsStringAsync = writeAsStringAsync;\nconst baseDeleteAsync = deleteAsync;\nconst baseMoveAsync = moveAsync;\nconst baseCopyAsync = copyAsync;\n/**\n * Android only\n */\nexport namespace StorageAccessFramework {\n export function getUriForDirectoryInRoot(folderName: string) {\n return `content://com.android.externalstorage.documents/tree/primary:${folderName}/document/primary:${folderName}`;\n }\n\n export async function requestDirectoryPermissionsAsync(\n initialFileUrl: string | null = null\n ): Promise<FileSystemRequestDirectoryPermissionsResult> {\n if (!ExponentFileSystem.requestDirectoryPermissionsAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.requestDirectoryPermissionsAsync'\n );\n }\n\n return await ExponentFileSystem.requestDirectoryPermissionsAsync(initialFileUrl);\n }\n\n export async function readDirectoryAsync(dirUri: string): Promise<string[]> {\n if (!ExponentFileSystem.readSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.readDirectoryAsync'\n );\n }\n return await ExponentFileSystem.readSAFDirectoryAsync(dirUri, {});\n }\n\n export async function makeDirectoryAsync(parentUri: string, dirName: string): Promise<string> {\n if (!ExponentFileSystem.makeSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.makeDirectoryAsync'\n );\n }\n return await ExponentFileSystem.makeSAFDirectoryAsync(parentUri, dirName);\n }\n\n export async function createFileAsync(\n parentUri: string,\n fileName: string,\n mimeType: string\n ): Promise<string> {\n if (!ExponentFileSystem.createSAFFileAsync) {\n throw new UnavailabilityError('expo-file-system', 'StorageAccessFramework.createFileAsync');\n }\n return await ExponentFileSystem.createSAFFileAsync(parentUri, fileName, mimeType);\n }\n\n export const writeAsStringAsync = baseWriteAsStringAsync;\n export const readAsStringAsync = baseReadAsStringAsync;\n export const deleteAsync = baseDeleteAsync;\n export const moveAsync = baseMoveAsync;\n export const copyAsync = baseCopyAsync;\n}\n"]}
|
|
@@ -613,7 +613,7 @@ EX_EXPORT_METHOD_AS(uploadTaskStartAsync,
|
|
|
613
613
|
body:@{
|
|
614
614
|
@"uuid": uuid,
|
|
615
615
|
@"data": @{
|
|
616
|
-
@"totalByteSent": @(
|
|
616
|
+
@"totalByteSent": @(totalBytesSent),
|
|
617
617
|
@"totalBytesExpectedToSend": @(totalBytesExpectedToSend),
|
|
618
618
|
},
|
|
619
619
|
}];
|
|
@@ -815,7 +815,9 @@ EX_EXPORT_METHOD_AS(getTotalDiskCapacityAsync, getTotalDiskCapacityAsyncWithReso
|
|
|
815
815
|
{
|
|
816
816
|
CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[path pathExtension], NULL);
|
|
817
817
|
CFStringRef MIMEType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType);
|
|
818
|
-
|
|
818
|
+
if (UTI) {
|
|
819
|
+
CFRelease(UTI);
|
|
820
|
+
}
|
|
819
821
|
if (!MIMEType) {
|
|
820
822
|
return @"application/octet-stream";
|
|
821
823
|
}
|
|
Binary file
|
|
Binary file
|
package/ios/EXFileSystem.xcframework/ios-arm64_x86_64-simulator/EXFileSystem.framework/EXFileSystem
CHANGED
|
Binary file
|
package/ios/EXFileSystem.xcframework/ios-arm64_x86_64-simulator/EXFileSystem.framework/Info.plist
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-file-system",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "Provides access to the local file system on the device.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"preset": "expo-module-scripts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@expo/config-plugins": "^4.0.
|
|
38
|
+
"@expo/config-plugins": "^4.0.14",
|
|
39
39
|
"uuid": "^3.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"expo-module-scripts": "^2.0.0",
|
|
43
|
-
"jest-expo": "~
|
|
43
|
+
"jest-expo": "~44.0.0-beta.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"expo": "*"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "4cf8716f96f5b087fb984b5418ee2548b2069414"
|
|
49
49
|
}
|
package/src/FileSystem.ts
CHANGED
|
@@ -293,7 +293,7 @@ export class UploadTask extends FileSystemCancellableNetworkTask<UploadProgressD
|
|
|
293
293
|
) {
|
|
294
294
|
super();
|
|
295
295
|
|
|
296
|
-
const httpMethod = (options?.httpMethod?.toUpperCase ||
|
|
296
|
+
const httpMethod = (options?.httpMethod?.toUpperCase() ||
|
|
297
297
|
'POST') as FileSystemAcceptedUploadHttpMethod;
|
|
298
298
|
|
|
299
299
|
this.options = {
|