@edgedev/firebase 2.1.49 → 2.1.51
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/edgeFirebase.ts +16 -6
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -2094,6 +2094,7 @@ export const EdgeFirebase = class {
|
|
|
2094
2094
|
|
|
2095
2095
|
|
|
2096
2096
|
// File functions
|
|
2097
|
+
// TODO... add object to pass merge with customMetadata as var....
|
|
2097
2098
|
public uploadFile = async (orgId: string, file: Blob, filePath: string = "", isPublic: boolean = false, toR2: boolean = false): Promise<actionResponse> => {
|
|
2098
2099
|
// Finish toCF function hook.
|
|
2099
2100
|
this.state.currentUploadProgress = 0;
|
|
@@ -2126,20 +2127,21 @@ export const EdgeFirebase = class {
|
|
|
2126
2127
|
}
|
|
2127
2128
|
|
|
2128
2129
|
try {
|
|
2130
|
+
|
|
2129
2131
|
const fileDoc = {
|
|
2130
2132
|
orgId,
|
|
2131
|
-
|
|
2133
|
+
contentType: file.type,
|
|
2132
2134
|
uploadCompletedToR2: false,
|
|
2133
2135
|
fileName: file.name,
|
|
2134
2136
|
name: file.name,
|
|
2135
2137
|
fileSize: file.size,
|
|
2136
|
-
fileType: file.type,
|
|
2137
2138
|
directory: filePath,
|
|
2138
2139
|
filePath: '',
|
|
2139
2140
|
r2filePath: '',
|
|
2140
2141
|
r2URL: '',
|
|
2141
2142
|
isPublic: isPublic,
|
|
2142
2143
|
toR2: toR2,
|
|
2144
|
+
uploadCompleted: false,
|
|
2143
2145
|
};
|
|
2144
2146
|
|
|
2145
2147
|
const result: any = await this.runFunction("edgeFirebase-addUpdateFileDoc", fileDoc);
|
|
@@ -2159,10 +2161,15 @@ export const EdgeFirebase = class {
|
|
|
2159
2161
|
uid: this.user.uid,
|
|
2160
2162
|
contentType: file.type,
|
|
2161
2163
|
fileName: file.name,
|
|
2164
|
+
name: file.name,
|
|
2165
|
+
fileSize: file.size,
|
|
2166
|
+
directory: filePath,
|
|
2162
2167
|
fileDocId: fileDocId,
|
|
2163
2168
|
filePath: tempFilePath,
|
|
2164
|
-
|
|
2165
|
-
|
|
2169
|
+
r2filePath: '',
|
|
2170
|
+
r2URL: '',
|
|
2171
|
+
isPublic: isPublic ? 'true' : '',
|
|
2172
|
+
toR2: toR2 ? 'true' : '',
|
|
2166
2173
|
}
|
|
2167
2174
|
};
|
|
2168
2175
|
|
|
@@ -2255,10 +2262,13 @@ export const EdgeFirebase = class {
|
|
|
2255
2262
|
const listResult = await listAll(listRef);
|
|
2256
2263
|
const filesPromises = listResult.items.map(async (item) => {
|
|
2257
2264
|
const downloadURL = await getDownloadURL(item);
|
|
2265
|
+
const metadata = await getMetadata(item);
|
|
2266
|
+
const fileName = metadata?.customMetadata?.name || item.name;
|
|
2258
2267
|
return {
|
|
2259
|
-
fileName
|
|
2268
|
+
fileName,
|
|
2260
2269
|
fullPath: item.fullPath, // Assuming fullPath is a property available on the item
|
|
2261
|
-
downloadURL: downloadURL
|
|
2270
|
+
downloadURL: downloadURL,
|
|
2271
|
+
metadata: metadata.customMetadata
|
|
2262
2272
|
};
|
|
2263
2273
|
});
|
|
2264
2274
|
const files = await Promise.all(filesPromises);
|