@react-native-firebase/storage 24.1.1 → 25.0.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/{lib → dist/module}/StorageDownloadTask.js +4 -3
  3. package/dist/module/StorageDownloadTask.js.map +1 -0
  4. package/{lib → dist/module}/StorageListResult.js +13 -8
  5. package/dist/module/StorageListResult.js.map +1 -0
  6. package/dist/module/StorageReference.js +270 -0
  7. package/dist/module/StorageReference.js.map +1 -0
  8. package/{lib → dist/module}/StorageStatics.js +5 -16
  9. package/dist/module/StorageStatics.js.map +1 -0
  10. package/{lib → dist/module}/StorageTask.js +82 -71
  11. package/dist/module/StorageTask.js.map +1 -0
  12. package/{lib → dist/module}/StorageUploadTask.js +4 -3
  13. package/dist/module/StorageUploadTask.js.map +1 -0
  14. package/dist/module/index.js +29 -0
  15. package/dist/module/index.js.map +1 -0
  16. package/{lib/modular/index.js → dist/module/modular.js} +65 -79
  17. package/dist/module/modular.js.map +1 -0
  18. package/dist/module/namespaced.js +192 -0
  19. package/dist/module/namespaced.js.map +1 -0
  20. package/dist/module/package.json +1 -0
  21. package/dist/module/types/internal.js +4 -0
  22. package/dist/module/types/internal.js.map +1 -0
  23. package/dist/module/types/namespaced.js +64 -0
  24. package/dist/module/types/namespaced.js.map +1 -0
  25. package/dist/module/types/storage.js +139 -0
  26. package/dist/module/types/storage.js.map +1 -0
  27. package/dist/module/utils.js +105 -0
  28. package/dist/module/utils.js.map +1 -0
  29. package/dist/module/version.js +5 -0
  30. package/dist/module/version.js.map +1 -0
  31. package/dist/module/web/RNFBStorageModule.android.js +6 -0
  32. package/dist/module/web/RNFBStorageModule.android.js.map +1 -0
  33. package/dist/module/web/RNFBStorageModule.ios.js +6 -0
  34. package/dist/module/web/RNFBStorageModule.ios.js.map +1 -0
  35. package/{lib → dist/module}/web/RNFBStorageModule.js +115 -197
  36. package/dist/module/web/RNFBStorageModule.js.map +1 -0
  37. package/dist/typescript/lib/StorageDownloadTask.d.ts +6 -0
  38. package/dist/typescript/lib/StorageDownloadTask.d.ts.map +1 -0
  39. package/dist/typescript/lib/StorageListResult.d.ts +13 -0
  40. package/dist/typescript/lib/StorageListResult.d.ts.map +1 -0
  41. package/dist/typescript/lib/StorageReference.d.ts +87 -0
  42. package/dist/typescript/lib/StorageReference.d.ts.map +1 -0
  43. package/dist/typescript/lib/StorageStatics.d.ts +2 -0
  44. package/dist/typescript/lib/StorageStatics.d.ts.map +1 -0
  45. package/dist/typescript/lib/StorageTask.d.ts +43 -0
  46. package/dist/typescript/lib/StorageTask.d.ts.map +1 -0
  47. package/dist/typescript/lib/StorageUploadTask.d.ts +6 -0
  48. package/dist/typescript/lib/StorageUploadTask.d.ts.map +1 -0
  49. package/dist/typescript/lib/index.d.ts +6 -0
  50. package/dist/typescript/lib/index.d.ts.map +1 -0
  51. package/dist/typescript/lib/modular.d.ts +154 -0
  52. package/dist/typescript/lib/modular.d.ts.map +1 -0
  53. package/dist/typescript/lib/namespaced.d.ts +12 -0
  54. package/dist/typescript/lib/namespaced.d.ts.map +1 -0
  55. package/dist/typescript/lib/types/internal.d.ts +131 -0
  56. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  57. package/dist/typescript/lib/types/namespaced.d.ts +1122 -0
  58. package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
  59. package/dist/typescript/lib/types/storage.d.ts +338 -0
  60. package/dist/typescript/lib/types/storage.d.ts.map +1 -0
  61. package/dist/typescript/lib/utils.d.ts +20 -0
  62. package/dist/typescript/lib/utils.d.ts.map +1 -0
  63. package/dist/typescript/lib/version.d.ts +2 -0
  64. package/dist/typescript/lib/version.d.ts.map +1 -0
  65. package/dist/typescript/lib/web/RNFBStorageModule.android.d.ts +3 -0
  66. package/dist/typescript/lib/web/RNFBStorageModule.android.d.ts.map +1 -0
  67. package/dist/typescript/lib/web/RNFBStorageModule.d.ts +142 -0
  68. package/dist/typescript/lib/web/RNFBStorageModule.d.ts.map +1 -0
  69. package/dist/typescript/lib/web/RNFBStorageModule.ios.d.ts +3 -0
  70. package/dist/typescript/lib/web/RNFBStorageModule.ios.d.ts.map +1 -0
  71. package/dist/typescript/package.json +1 -0
  72. package/lib/StorageDownloadTask.ts +30 -0
  73. package/lib/StorageListResult.ts +61 -0
  74. package/lib/{StorageReference.js → StorageReference.ts} +103 -61
  75. package/lib/StorageStatics.ts +19 -0
  76. package/lib/StorageTask.ts +336 -0
  77. package/lib/StorageUploadTask.ts +30 -0
  78. package/lib/index.ts +27 -0
  79. package/lib/modular.ts +401 -0
  80. package/lib/{index.js → namespaced.ts} +70 -28
  81. package/lib/types/internal.ts +189 -0
  82. package/lib/{index.d.ts → types/namespaced.ts} +111 -49
  83. package/lib/types/storage.ts +417 -0
  84. package/lib/{utils.js → utils.ts} +62 -15
  85. package/lib/version.ts +2 -0
  86. package/lib/web/RNFBStorageModule.android.ts +3 -0
  87. package/lib/web/RNFBStorageModule.ios.ts +3 -0
  88. package/lib/web/RNFBStorageModule.ts +557 -0
  89. package/package.json +41 -7
  90. package/tsconfig.json +23 -0
  91. package/typedoc.json +1 -1
  92. package/lib/modular/index.d.ts +0 -276
  93. package/lib/version.js +0 -2
  94. package/lib/web/RNFBStorageModule.android.js +0 -2
  95. package/lib/web/RNFBStorageModule.ios.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespaced.d.ts","sourceRoot":"","sources":["../../../../lib/types/namespaced.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;;;GAGG;AAEH,yBAAiB,oBAAoB,CAAC;IACpC,KAAK,cAAc,GAAG,mBAAmB,CAAC,cAAc,CAAC;IACzD,KAAK,mBAAmB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC;IAEnE;;;;;;;;OAQG;IACH,MAAM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O,IAAI,oBAAoB,CAAC,MAAM,CAAA;KAAE,CAAC;CAClG,CAAC;AAEF,eAAe,aAAa,CAAC;AAE7B;;GAEG;AAEH,OAAO,QAAQ,4BAA4B,CAAC;IAC1C,UAAU,mBAAmB,CAAC;QAC5B,OAAO,+BAA+B,GAAG,mBAAmB,CAAC,+BAA+B,CAAC;QAC7F,UAAU,MAAM;YACd,OAAO,EAAE,+BAA+B,CACtC,oBAAoB,CAAC,MAAM,EAC3B,oBAAoB,CAAC,OAAO,CAC7B,CAAC;SACH;QACD,UAAU,WAAW;YACnB,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAAC,MAAM,CAAC;SACvD;KACF;CACF"}
@@ -0,0 +1,338 @@
1
+ import type { FirebaseApp, ReactNativeFirebase } from '@react-native-firebase/app';
2
+ import type { CompleteFn, NextFn, Unsubscribe } from '@react-native-firebase/app/dist/module/types/common';
3
+ export type { CompleteFn, NextFn, Unsubscribe };
4
+ export type NativeFirebaseError = ReactNativeFirebase.NativeFirebaseError;
5
+ /**
6
+ * Storage module instance
7
+ */
8
+ export interface FirebaseStorage {
9
+ /** The FirebaseApp this module is associated with */
10
+ app: FirebaseApp;
11
+ /**
12
+ * The maximum time in milliseconds to retry an upload if a failure occurs.
13
+ */
14
+ readonly maxUploadRetryTime: number;
15
+ /**
16
+ * The maximum time in milliseconds to retry a download if a failure occurs.
17
+ */
18
+ readonly maxDownloadRetryTime: number;
19
+ /**
20
+ * The maximum time in milliseconds to retry operations if a failure occurs.
21
+ */
22
+ readonly maxOperationRetryTime: number;
23
+ }
24
+ /**
25
+ * Storage reference to a file or folder location.
26
+ */
27
+ export interface StorageReference {
28
+ /**
29
+ * A reference to the root of this object's bucket.
30
+ */
31
+ root: StorageReference;
32
+ /**
33
+ * The name of the bucket containing this reference's object.
34
+ */
35
+ bucket: string;
36
+ /**
37
+ * The full path of this object.
38
+ */
39
+ fullPath: string;
40
+ /**
41
+ * The short name of this object, which is the last component of the full path.
42
+ * For example, if fullPath is 'full/path/image.png', name is 'image.png'.
43
+ */
44
+ name: string;
45
+ /**
46
+ * The {@link FirebaseStorage} instance associated with this reference.
47
+ */
48
+ storage: FirebaseStorage;
49
+ /**
50
+ * A reference pointing to the parent location of this reference, or null if
51
+ * this reference is the root.
52
+ */
53
+ parent: StorageReference | null;
54
+ /**
55
+ * Returns the full URL string for this object in the form
56
+ * @returns The full URL string.
57
+ */
58
+ toString(): string;
59
+ }
60
+ /**
61
+ * Options for listing files and folders.
62
+ */
63
+ export interface ListOptions {
64
+ /**
65
+ * If set, limits the total number of `prefixes` and `items` to return.
66
+ * The default and maximum maxResults is 1000.
67
+ */
68
+ maxResults?: number | null;
69
+ /**
70
+ * The `nextPageToken` from a previous call to `list()`. If provided,
71
+ * listing is resumed from the previous position.
72
+ */
73
+ pageToken?: string | null;
74
+ }
75
+ /**
76
+ * Result of listing files and folders.
77
+ */
78
+ export interface ListResult {
79
+ /**
80
+ * References to prefixes (sub-folders). You can call list() on them to
81
+ * get its contents.
82
+ *
83
+ * Folders are implicit based on '/' in the object paths.
84
+ * For example, if a bucket has two objects '/a/b/1' and '/a/b/2', list('/a')
85
+ * will return '/a/b' as a prefix.
86
+ */
87
+ prefixes: StorageReference[];
88
+ /**
89
+ * Objects in this directory.
90
+ * You can call getMetadata() and getDownloadUrl() on them.
91
+ */
92
+ items: StorageReference[];
93
+ /**
94
+ * If set, there might be more results for this list. Use this token to resume the list.
95
+ */
96
+ nextPageToken?: string;
97
+ }
98
+ /**
99
+ * Object metadata that can be set at any time.
100
+ */
101
+ export interface SettableMetadata {
102
+ cacheControl?: string | undefined;
103
+ contentDisposition?: string | undefined;
104
+ contentEncoding?: string | undefined;
105
+ contentLanguage?: string | undefined;
106
+ contentType?: string | undefined;
107
+ customMetadata?: {
108
+ [key: string]: string;
109
+ } | undefined;
110
+ }
111
+ /**
112
+ * Object metadata that can be set at upload.
113
+ * @public
114
+ */
115
+ export interface UploadMetadata extends SettableMetadata {
116
+ /**
117
+ * A Base64-encoded MD5 hash of the object being uploaded.
118
+ */
119
+ md5Hash?: string | undefined;
120
+ }
121
+ /**
122
+ * The full set of object metadata, including read-only properties.
123
+ */
124
+ export interface FullMetadata extends UploadMetadata {
125
+ /**
126
+ * The bucket this object is contained in.
127
+ */
128
+ bucket: string;
129
+ /**
130
+ * The full path of this object.
131
+ */
132
+ fullPath: string;
133
+ /**
134
+ * The object's generation.
135
+ * {@link https://cloud.google.com/storage/docs/metadata#generation-number}
136
+ */
137
+ generation: string;
138
+ /**
139
+ * The object's metageneration.
140
+ * {@link https://cloud.google.com/storage/docs/metadata#generation-number}
141
+ */
142
+ metageneration: string;
143
+ /**
144
+ * The short name of this object, which is the last component of the full path.
145
+ * For example, if fullPath is 'full/path/image.png', name is 'image.png'.
146
+ */
147
+ name: string;
148
+ /**
149
+ * The size of this object, in bytes.
150
+ */
151
+ size: number;
152
+ /**
153
+ * A date string representing when this object was created.
154
+ */
155
+ timeCreated: string;
156
+ /**
157
+ * A date string representing when this object was last updated.
158
+ */
159
+ updated: string;
160
+ /**
161
+ * Tokens to allow access to the download URL.
162
+ */
163
+ downloadTokens: string[] | undefined;
164
+ /**
165
+ * `StorageReference` associated with this upload.
166
+ */
167
+ ref?: StorageReference | undefined;
168
+ }
169
+ /**
170
+ * An enumeration of the possible string formats for upload.
171
+ * @public
172
+ */
173
+ export type StringFormat = (typeof StringFormat)[keyof typeof StringFormat];
174
+ /**
175
+ * An enumeration of the possible string formats for upload.
176
+ * @public
177
+ */
178
+ export declare const StringFormat: {
179
+ readonly RAW: "raw";
180
+ readonly BASE64: "base64";
181
+ readonly BASE64URL: "base64url";
182
+ readonly DATA_URL: "data_url";
183
+ };
184
+ /**
185
+ * An event that is triggered on a task.
186
+ * @public
187
+ */
188
+ export type TaskEvent = (typeof TaskEvent)[keyof typeof TaskEvent];
189
+ /**
190
+ * An event that is triggered on a task.
191
+ * @public
192
+ */
193
+ export declare const TaskEvent: {
194
+ readonly STATE_CHANGED: "state_changed";
195
+ };
196
+ /**
197
+ * Represents the current state of a running upload/download.
198
+ * @public
199
+ */
200
+ export type TaskState = (typeof TaskState)[keyof typeof TaskState];
201
+ /**
202
+ * Represents the current state of a running upload/download.
203
+ * @public
204
+ */
205
+ export declare const TaskState: {
206
+ readonly RUNNING: "running";
207
+ readonly PAUSED: "paused";
208
+ readonly SUCCESS: "success";
209
+ readonly CANCELED: "canceled";
210
+ readonly CANCELLED: "canceled";
211
+ readonly ERROR: "error";
212
+ };
213
+ /**
214
+ * A stream observer for Firebase Storage.
215
+ * @public
216
+ */
217
+ export interface StorageObserver<T> {
218
+ next?: NextFn<T> | null;
219
+ error?: ((error: NativeFirebaseError) => void) | null;
220
+ complete?: CompleteFn | null;
221
+ }
222
+ /**
223
+ * Represents the process of uploading an object. Allows you to monitor and manage the upload.
224
+ *
225
+ * Note: React Native Firebase returns Promises for pause/resume/cancel to communicate with native iOS/Android.
226
+ *
227
+ * @public
228
+ */
229
+ export interface UploadTask {
230
+ /**
231
+ * Cancels a running task. Has no effect on a complete or failed task.
232
+ * @returns True if the cancel had an effect.
233
+ */
234
+ cancel(): Promise<boolean>;
235
+ /**
236
+ * Equivalent to calling `then(null, onRejected)`.
237
+ */
238
+ catch(onRejected: (error: NativeFirebaseError) => unknown): Promise<unknown>;
239
+ /**
240
+ * Listens for events on this task.
241
+ *
242
+ * @returns If only the event argument is passed, returns a function you can use to add callbacks.
243
+ * Otherwise returns a function you can call to unregister the callbacks.
244
+ */
245
+ on(event: TaskEvent, nextOrObserver?: StorageObserver<UploadTaskSnapshot> | null | ((snapshot: UploadTaskSnapshot) => unknown), error?: ((error: NativeFirebaseError) => unknown) | null, complete?: CompleteFn | null): Unsubscribe | Subscribe<UploadTaskSnapshot>;
246
+ /**
247
+ * Pauses a currently running task. Has no effect on a paused or failed task.
248
+ * @returns True if the operation took effect, false if ignored.
249
+ */
250
+ pause(): Promise<boolean>;
251
+ /**
252
+ * Resumes a paused task. Has no effect on a currently running or failed task.
253
+ * @returns True if the operation took effect, false if ignored.
254
+ */
255
+ resume(): Promise<boolean>;
256
+ /**
257
+ * A snapshot of the current task state.
258
+ */
259
+ snapshot: UploadTaskSnapshot;
260
+ /**
261
+ * This object behaves like a Promise, and resolves with its snapshot data when the upload completes.
262
+ */
263
+ then(onFulfilled?: ((snapshot: UploadTaskSnapshot) => unknown) | null, onRejected?: ((error: NativeFirebaseError) => unknown) | null): Promise<unknown>;
264
+ }
265
+ /**
266
+ * Holds data about the current state of the upload task.
267
+ * @public
268
+ */
269
+ export interface UploadTaskSnapshot {
270
+ /**
271
+ * The number of bytes that have been successfully uploaded so far.
272
+ */
273
+ bytesTransferred: number;
274
+ /**
275
+ * Before the upload completes, contains the metadata sent to the server.
276
+ * After the upload completes, contains the metadata sent back from the server.
277
+ */
278
+ metadata: FullMetadata;
279
+ /**
280
+ * The reference that spawned this snapshot's upload task.
281
+ */
282
+ ref: StorageReference;
283
+ /**
284
+ * The current state of the task.
285
+ */
286
+ state: TaskState;
287
+ /**
288
+ * The task of which this is a snapshot.
289
+ */
290
+ task: UploadTask;
291
+ /**
292
+ * The total number of bytes to be uploaded.
293
+ */
294
+ totalBytes: number;
295
+ }
296
+ /**
297
+ * Result returned from a non-resumable upload.
298
+ * @public
299
+ */
300
+ export interface UploadResult {
301
+ /**
302
+ * Contains the metadata sent back from the server.
303
+ */
304
+ readonly metadata: FullMetadata;
305
+ /**
306
+ * The reference that spawned this upload.
307
+ */
308
+ readonly ref: StorageReference;
309
+ }
310
+ export type Subscribe<T> = (nextOrObserver?: StorageObserver<T> | null | NextFn<T>, error?: ((error: NativeFirebaseError) => unknown) | null, complete?: CompleteFn | null) => Unsubscribe;
311
+ /**
312
+ * Snapshot of a storage task (upload or download).
313
+ */
314
+ export interface TaskSnapshot extends UploadTaskSnapshot {
315
+ /**
316
+ * If the state is `error`, returns a JavaScript error of the current task snapshot.
317
+ */
318
+ error?: NativeFirebaseError;
319
+ }
320
+ /**
321
+ * Result of a completed task.
322
+ */
323
+ export type TaskResult = UploadResult;
324
+ /**
325
+ * Observer object for task state changes.
326
+ */
327
+ export type TaskSnapshotObserver = StorageObserver<TaskSnapshot>;
328
+ /**
329
+ * Storage task for uploads or downloads.
330
+ */
331
+ export type Task = UploadTask;
332
+ /**
333
+ * Options for connecting to the storage emulator (web only).
334
+ */
335
+ export interface EmulatorMockTokenOptions {
336
+ mockUserToken?: string | null;
337
+ }
338
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../lib/types/storage.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,WAAW,EACZ,MAAM,qDAAqD,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC;AAC1E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,GAAG,EAAE,WAAW,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC;;;OAG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eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,EACtD,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,GAAG,IAAI,EACxD,QAAQ,CAAC,EAAE,UAAU,GAAG,IAAI,KACzB,WAAW,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD;;OAEG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,UAAU,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
@@ -0,0 +1,20 @@
1
+ import type { SettableMetadata, UploadMetadata } from './types/storage';
2
+ import type { StorageInternal } from './types/internal';
3
+ import type { NativeErrorUserInfo } from '@react-native-firebase/app/dist/module/types/internal';
4
+ export declare function handleStorageEvent(storageInstance: StorageInternal, event: {
5
+ taskId: string;
6
+ eventName: string;
7
+ body?: {
8
+ error?: NativeErrorUserInfo;
9
+ };
10
+ }): Promise<void>;
11
+ export declare function getHttpUrlParts(url: string): {
12
+ bucket: string;
13
+ path: string;
14
+ } | null;
15
+ export declare function getGsUrlParts(url: string): {
16
+ bucket: string;
17
+ path: string;
18
+ };
19
+ export declare function validateMetadata(metadata: SettableMetadata | UploadMetadata, update?: boolean): SettableMetadata | UploadMetadata;
20
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/utils.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAejG,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,mBAAmB,CAAA;KAAE,CAAC;CACxC,GACA,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASpF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAM3E;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,gBAAgB,GAAG,cAAc,EAC3C,MAAM,UAAO,GACZ,gBAAgB,GAAG,cAAc,CA6DnC"}
@@ -0,0 +1,2 @@
1
+ export declare const version = "25.0.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../lib/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const RNFBStorageModule: {};
2
+ export default RNFBStorageModule;
3
+ //# sourceMappingURL=RNFBStorageModule.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RNFBStorageModule.android.d.ts","sourceRoot":"","sources":["../../../../lib/web/RNFBStorageModule.android.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,iBAAiB,IAAK,CAAC;AAC7B,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,142 @@
1
+ interface Metadata {
2
+ bucket?: string;
3
+ generation?: string;
4
+ metageneration?: string;
5
+ fullPath?: string;
6
+ name?: string;
7
+ size?: number;
8
+ timeCreated?: string;
9
+ updated?: string;
10
+ md5Hash?: string;
11
+ cacheControl?: string;
12
+ contentLanguage?: string;
13
+ contentDisposition?: string;
14
+ contentEncoding?: string;
15
+ contentType?: string;
16
+ customMetadata?: Record<string, string>;
17
+ }
18
+ interface SettableMetadata {
19
+ cacheControl?: string;
20
+ contentDisposition?: string;
21
+ contentEncoding?: string;
22
+ contentType?: string;
23
+ contentLanguage?: string;
24
+ customMetadata?: Record<string, string>;
25
+ md5Hash?: string;
26
+ }
27
+ interface UploadTaskSnapshot {
28
+ totalBytes: number;
29
+ bytesTransferred: number;
30
+ state: string;
31
+ metadata: Metadata;
32
+ }
33
+ interface ListOptions {
34
+ maxResults?: number;
35
+ pageToken?: string | null;
36
+ }
37
+ declare const _default: {
38
+ /**
39
+ * Delete an object at the path.
40
+ * @param appName - The app name.
41
+ * @param url - The path to the object.
42
+ * @return {Promise<void>}
43
+ */
44
+ delete(appName: string, url: string): Promise<void>;
45
+ /**
46
+ * Get the download URL for an object.
47
+ * @param appName - The app name.
48
+ * @param url - The path to the object.
49
+ * @return {Promise<string>} The download URL.
50
+ */
51
+ getDownloadURL(appName: string, url: string): Promise<string>;
52
+ /**
53
+ * Get the metadata for an object.
54
+ * @param appName - The app name.
55
+ * @param url - The path to the object.
56
+ * @return {Promise<Object>} The metadata.
57
+ */
58
+ getMetadata(appName: string, url: string): Promise<Metadata & {
59
+ metadata?: Record<string, string>;
60
+ }>;
61
+ /**
62
+ * List objects at the path.
63
+ * @param appName - The app name.
64
+ * @param url - The path to the object.
65
+ * @param listOptions - The list options.
66
+ * @return {Promise<Object>} The list result.
67
+ */
68
+ list(appName: string, url: string, listOptions?: ListOptions): Promise<{
69
+ nextPageToken?: string;
70
+ items: string[];
71
+ prefixes: string[];
72
+ }>;
73
+ /**
74
+ * List all objects at the path.
75
+ * @param appName - The app name.
76
+ * @param url - The path to the object.
77
+ * @return {Promise<Object>} The list result.
78
+ */
79
+ listAll(appName: string, url: string): Promise<{
80
+ nextPageToken?: string;
81
+ items: string[];
82
+ prefixes: string[];
83
+ }>;
84
+ /**
85
+ * Update the metadata for an object.
86
+ * @param appName - The app name.
87
+ * @param url - The path to the object.
88
+ * @param metadata - The metadata (SettableMetadata).
89
+ */
90
+ updateMetadata(appName: string, url: string, metadata: SettableMetadata): Promise<Metadata & {
91
+ metadata?: Record<string, string>;
92
+ }>;
93
+ setMaxDownloadRetryTime(): void;
94
+ /**
95
+ * Set the maximum operation retry time.
96
+ * @param appName - The app name.
97
+ * @param milliseconds - The maximum operation retry time.
98
+ * @return {Promise<void>}
99
+ */
100
+ setMaxOperationRetryTime(appName: string, milliseconds: number): Promise<void>;
101
+ /**
102
+ * Set the maximum upload retry time.
103
+ * @param appName - The app name.
104
+ * @param milliseconds - The maximum upload retry time.
105
+ * @return {Promise<void>}
106
+ */
107
+ setMaxUploadRetryTime(appName: string, milliseconds: number): Promise<void>;
108
+ /**
109
+ * Use the Firebase Storage emulator.
110
+ * @param appName - The app name.
111
+ * @param host - The emulator host.
112
+ * @param port - The emulator port.
113
+ * @return {Promise<void>}
114
+ */
115
+ useEmulator(appName: string, host: string, port: number, url: string): Promise<void>;
116
+ writeToFile(): Promise<never>;
117
+ /**
118
+ * Put a string to the path.
119
+ * @param appName - The app name.
120
+ * @param url - The path to the object.
121
+ * @param string - The string to put.
122
+ * @param format - The format of the string.
123
+ * @param metadata - The metadata (SettableMetadata).
124
+ * @param taskId - The task ID.
125
+ * @return {Promise<Object>} The upload snapshot.
126
+ */
127
+ putString(appName: string, url: string, string: string, format: string, metadata: SettableMetadata | undefined, taskId: string): Promise<UploadTaskSnapshot>;
128
+ putFile(): Promise<never>;
129
+ /**
130
+ * Set the status of a task.
131
+ * @param appName - The app name.
132
+ * @param taskId - The task ID.
133
+ * @param status - The status.
134
+ * @return {Promise<boolean>} Whether the status was set.
135
+ */
136
+ setTaskStatus(appName: string, taskId: string, status: number): Promise<boolean>;
137
+ maxDownloadRetryTime?: number;
138
+ maxOperationRetryTime?: number;
139
+ maxUploadRetryTime?: number;
140
+ };
141
+ export default _default;
142
+ //# sourceMappingURL=RNFBStorageModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RNFBStorageModule.d.ts","sourceRoot":"","sources":["../../../../lib/web/RNFBStorageModule.ts"],"names":[],"mappings":"AAoCA,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED,UAAU,gBAAgB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,kBAA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AO,CAAC,IAAI,CAAC;IAO3E;;;;;;OAMG;yBACkB,MAAM,QAAQ,MAAM,QAAQ,MAAM,OAAO,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;mBASrE,OAAO,CAAC,KAAK,CAAC;IAO7B;;;;;;;;;OASG;uBAEQ,MAAM,OACV,MAAM,UACH,MAAM,UACN,MAAM,YACJ,gBAAgB,sBAClB,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC;eAiFnB,OAAO,CAAC,KAAK,CAAC;IAOzB;;;;;;OAMG;2BACoB,MAAM,UAAU,MAAM,UAAU,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;2BApSzD,MAAM;4BACL,MAAM;yBACT,MAAM;;AAU7B,wBA4TE"}
@@ -0,0 +1,3 @@
1
+ declare const RNFBStorageModule: {};
2
+ export default RNFBStorageModule;
3
+ //# sourceMappingURL=RNFBStorageModule.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RNFBStorageModule.ios.d.ts","sourceRoot":"","sources":["../../../../lib/web/RNFBStorageModule.ios.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,iBAAiB,IAAK,CAAC;AAC7B,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import StorageTask from './StorageTask';
19
+ import type { StorageReference, TaskSnapshot } from './types/storage';
20
+
21
+ const DOWNLOAD_TASK = 'download';
22
+
23
+ export default class StorageDownloadTask extends StorageTask {
24
+ constructor(
25
+ storageRef: StorageReference,
26
+ beginTaskFn: (task: StorageTask) => Promise<TaskSnapshot>,
27
+ ) {
28
+ super(DOWNLOAD_TASK, storageRef, beginTaskFn);
29
+ }
30
+ }
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import type { StorageReference } from './types/storage';
19
+ import type { ListResultInternal, StorageInternal } from './types/internal';
20
+
21
+ // To avoid React Native require cycle warnings
22
+ let Reference: (new (storage: StorageInternal, path: string) => StorageReference) | null = null;
23
+
24
+ export function provideStorageReferenceClass(
25
+ storageReference: new (storage: StorageInternal, path: string) => StorageReference,
26
+ ): void {
27
+ Reference = storageReference;
28
+ }
29
+
30
+ export default class StorageListResult {
31
+ private _nextPageToken: string | null;
32
+ private _items: StorageReference[];
33
+ private _prefixes: StorageReference[];
34
+
35
+ constructor(storage: StorageInternal, nativeData: ListResultInternal) {
36
+ this._nextPageToken = nativeData.nextPageToken || null;
37
+
38
+ if (!Reference) {
39
+ throw new Error(
40
+ 'Reference class has not been provided. This is likely a module initialization issue.',
41
+ );
42
+ }
43
+
44
+ // TypeScript doesn't narrow the type after the null check, so we assign to a const
45
+ const StorageReferenceClass = Reference;
46
+ this._items = nativeData.items.map(path => new StorageReferenceClass(storage, path));
47
+ this._prefixes = nativeData.prefixes.map(path => new StorageReferenceClass(storage, path));
48
+ }
49
+
50
+ get items(): StorageReference[] {
51
+ return this._items;
52
+ }
53
+
54
+ get nextPageToken(): string | null {
55
+ return this._nextPageToken;
56
+ }
57
+
58
+ get prefixes(): StorageReference[] {
59
+ return this._prefixes;
60
+ }
61
+ }