@react-native-firebase/storage 24.1.0 → 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 +14 -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
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.0.0](https://github.com/invertase/react-native-firebase/compare/v24.0.0...v25.0.0) (2026-06-23)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - **storage:** migrate to TypeScript and match firebase-js-sdk API (#8824)
11
+
12
+ ### Code Refactoring
13
+
14
+ - **storage:** migrate to TypeScript and match firebase-js-sdk API ([#8824](https://github.com/invertase/react-native-firebase/issues/8824)) ([663b57c](https://github.com/invertase/react-native-firebase/commit/663b57c220ef733affc1055e674334f35c458861))
15
+
16
+ ## [24.1.1](https://github.com/invertase/react-native-firebase/compare/v24.1.0...v24.1.1) (2026-06-10)
17
+
18
+ **Note:** Version bump only for package @react-native-firebase/storage
19
+
6
20
  ## [24.1.0](https://github.com/invertase/react-native-firebase/compare/v24.0.0...v24.1.0) (2026-06-05)
7
21
 
8
22
  **Note:** Version bump only for package @react-native-firebase/storage
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  /*
2
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
5
  *
@@ -15,12 +17,11 @@
15
17
  *
16
18
  */
17
19
 
18
- import StorageTask from './StorageTask';
19
-
20
+ import StorageTask from "./StorageTask.js";
20
21
  const DOWNLOAD_TASK = 'download';
21
-
22
22
  export default class StorageDownloadTask extends StorageTask {
23
23
  constructor(storageRef, beginTaskFn) {
24
24
  super(DOWNLOAD_TASK, storageRef, beginTaskFn);
25
25
  }
26
26
  }
27
+ //# sourceMappingURL=StorageDownloadTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StorageTask","DOWNLOAD_TASK","StorageDownloadTask","constructor","storageRef","beginTaskFn"],"sourceRoot":"../../lib","sources":["StorageDownloadTask.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,WAAW,MAAM,kBAAe;AAGvC,MAAMC,aAAa,GAAG,UAAU;AAEhC,eAAe,MAAMC,mBAAmB,SAASF,WAAW,CAAC;EAC3DG,WAAWA,CACTC,UAA4B,EAC5BC,WAAyD,EACzD;IACA,KAAK,CAACJ,aAAa,EAAEG,UAAU,EAAEC,WAAW,CAAC;EAC/C;AACF","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  /*
2
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
5
  *
@@ -16,27 +18,30 @@
16
18
  */
17
19
 
18
20
  // To avoid React Native require cycle warnings
19
- let StorageReference = null;
21
+ let Reference = null;
20
22
  export function provideStorageReferenceClass(storageReference) {
21
- StorageReference = storageReference;
23
+ Reference = storageReference;
22
24
  }
23
-
24
25
  export default class StorageListResult {
25
26
  constructor(storage, nativeData) {
26
27
  this._nextPageToken = nativeData.nextPageToken || null;
27
- this._items = nativeData.items.map(path => new StorageReference(storage, path));
28
- this._prefixes = nativeData.prefixes.map(path => new StorageReference(storage, path));
29
- }
28
+ if (!Reference) {
29
+ throw new Error('Reference class has not been provided. This is likely a module initialization issue.');
30
+ }
30
31
 
32
+ // TypeScript doesn't narrow the type after the null check, so we assign to a const
33
+ const StorageReferenceClass = Reference;
34
+ this._items = nativeData.items.map(path => new StorageReferenceClass(storage, path));
35
+ this._prefixes = nativeData.prefixes.map(path => new StorageReferenceClass(storage, path));
36
+ }
31
37
  get items() {
32
38
  return this._items;
33
39
  }
34
-
35
40
  get nextPageToken() {
36
41
  return this._nextPageToken;
37
42
  }
38
-
39
43
  get prefixes() {
40
44
  return this._prefixes;
41
45
  }
42
46
  }
47
+ //# sourceMappingURL=StorageListResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Reference","provideStorageReferenceClass","storageReference","StorageListResult","constructor","storage","nativeData","_nextPageToken","nextPageToken","Error","StorageReferenceClass","_items","items","map","path","_prefixes","prefixes"],"sourceRoot":"../../lib","sources":["StorageListResult.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,IAAIA,SAAoF,GAAG,IAAI;AAE/F,OAAO,SAASC,4BAA4BA,CAC1CC,gBAAkF,EAC5E;EACNF,SAAS,GAAGE,gBAAgB;AAC9B;AAEA,eAAe,MAAMC,iBAAiB,CAAC;EAKrCC,WAAWA,CAACC,OAAwB,EAAEC,UAA8B,EAAE;IACpE,IAAI,CAACC,cAAc,GAAGD,UAAU,CAACE,aAAa,IAAI,IAAI;IAEtD,IAAI,CAACR,SAAS,EAAE;MACd,MAAM,IAAIS,KAAK,CACb,sFACF,CAAC;IACH;;IAEA;IACA,MAAMC,qBAAqB,GAAGV,SAAS;IACvC,IAAI,CAACW,MAAM,GAAGL,UAAU,CAACM,KAAK,CAACC,GAAG,CAACC,IAAI,IAAI,IAAIJ,qBAAqB,CAACL,OAAO,EAAES,IAAI,CAAC,CAAC;IACpF,IAAI,CAACC,SAAS,GAAGT,UAAU,CAACU,QAAQ,CAACH,GAAG,CAACC,IAAI,IAAI,IAAIJ,qBAAqB,CAACL,OAAO,EAAES,IAAI,CAAC,CAAC;EAC5F;EAEA,IAAIF,KAAKA,CAAA,EAAuB;IAC9B,OAAO,IAAI,CAACD,MAAM;EACpB;EAEA,IAAIH,aAAaA,CAAA,EAAkB;IACjC,OAAO,IAAI,CAACD,cAAc;EAC5B;EAEA,IAAIS,QAAQA,CAAA,EAAuB;IACjC,OAAO,IAAI,CAACD,SAAS;EACvB;AACF","ignoreList":[]}
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import { Base64, getDataUrlParts, hasOwnProperty, isInteger, isNumber, isObject, isString, isUndefined, pathChild, pathLastComponent, pathParent, ReferenceBase, toFilePath, isModularCall } from '@react-native-firebase/app/dist/module/common';
21
+ import StorageDownloadTask from "./StorageDownloadTask.js";
22
+ import StorageListResult, { provideStorageReferenceClass } from "./StorageListResult.js";
23
+ import { StringFormat } from "./StorageStatics.js";
24
+ import StorageUploadTask from "./StorageUploadTask.js";
25
+ import { validateMetadata } from "./utils.js";
26
+ export default class Reference extends ReferenceBase {
27
+ constructor(storage, path) {
28
+ super(path);
29
+ this._storage = storage;
30
+ }
31
+
32
+ /**
33
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#bucket
34
+ */
35
+ get bucket() {
36
+ return this._storage._customUrlOrRegion.replace('gs://', '');
37
+ }
38
+
39
+ /**
40
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#fullPath
41
+ */
42
+ get fullPath() {
43
+ return this.path;
44
+ }
45
+
46
+ /**
47
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#name
48
+ */
49
+ get name() {
50
+ return pathLastComponent(this.path);
51
+ }
52
+
53
+ /**
54
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#parent
55
+ */
56
+ get parent() {
57
+ const parentPath = pathParent(this.path);
58
+ if (parentPath === null) {
59
+ return parentPath;
60
+ }
61
+ return new Reference(this._storage, parentPath);
62
+ }
63
+
64
+ /**
65
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#root
66
+ */
67
+ get root() {
68
+ return new Reference(this._storage, '/');
69
+ }
70
+
71
+ /**
72
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#storage
73
+ */
74
+ get storage() {
75
+ return this._storage;
76
+ }
77
+
78
+ /**
79
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#child
80
+ */
81
+ child(path) {
82
+ const childPath = pathChild(this.path, path);
83
+ return new Reference(this._storage, childPath);
84
+ }
85
+
86
+ /**
87
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#delete
88
+ */
89
+ delete() {
90
+ return this._storage.native.delete(this.toString());
91
+ }
92
+
93
+ /**
94
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getDownloadURL
95
+ */
96
+ getDownloadURL() {
97
+ return this._storage.native.getDownloadURL(this.toString());
98
+ }
99
+
100
+ /**
101
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getMetadata
102
+ */
103
+ getMetadata() {
104
+ return this._storage.native.getMetadata(this.toString());
105
+ }
106
+
107
+ /**
108
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#list
109
+ */
110
+ list(options) {
111
+ if (!isUndefined(options) && !isObject(options)) {
112
+ throw new Error("firebase.storage.StorageReference.list(*) 'options' expected an object value.");
113
+ }
114
+ const listOptions = {
115
+ maxResults: 1000
116
+ };
117
+ const isModular = isModularCall(arguments);
118
+ if (options) {
119
+ if (hasOwnProperty(options, 'maxResults')) {
120
+ const maxResults = options.maxResults;
121
+ // Modular typings allow `null` for omission - ignore safely.
122
+ if (isModular && (maxResults === null || isUndefined(maxResults))) {
123
+ // no-op (keep default)
124
+ } else {
125
+ if (!isNumber(maxResults) || !isInteger(maxResults)) {
126
+ throw new Error("firebase.storage.StorageReference.list(*) 'options.maxResults' expected a number value.");
127
+ }
128
+ if (maxResults < 1 || maxResults > 1000) {
129
+ throw new Error("firebase.storage.StorageReference.list(*) 'options.maxResults' expected a number value between 1-1000.");
130
+ }
131
+ listOptions.maxResults = maxResults;
132
+ }
133
+ }
134
+ if (hasOwnProperty(options, 'pageToken')) {
135
+ const pageToken = options.pageToken;
136
+ // Modular typings allow `null` for omission - ignore safely.
137
+ if (isModular && (pageToken === null || isUndefined(pageToken))) {
138
+ // no-op
139
+ } else if (!isUndefined(pageToken) && pageToken !== null) {
140
+ if (!isString(pageToken)) {
141
+ throw new Error("firebase.storage.StorageReference.list(*) 'options.pageToken' expected a string value.");
142
+ }
143
+ listOptions.pageToken = pageToken;
144
+ }
145
+ }
146
+ }
147
+ return this._storage.native.list(this.toString(), listOptions).then(data => new StorageListResult(this._storage, data));
148
+ }
149
+
150
+ /**
151
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#listAll
152
+ */
153
+ listAll() {
154
+ return this._storage.native.listAll(this.toString()).then(data => new StorageListResult(this._storage, data));
155
+ }
156
+
157
+ /**
158
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#put
159
+ */
160
+ put(data, metadata) {
161
+ const validatedMetadata = isUndefined(metadata) ? metadata : validateMetadata(metadata, false);
162
+ return new StorageUploadTask(this, task => Base64.fromData(data).then(({
163
+ string,
164
+ format
165
+ }) => {
166
+ const {
167
+ _string,
168
+ _format,
169
+ _metadata
170
+ } = this._updateString(string, format, validatedMetadata, false);
171
+ return this._storage.native.putString(this.toString(), _string, _format, _metadata, task._id);
172
+ }));
173
+ }
174
+
175
+ /**
176
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#putString
177
+ */
178
+ putString(string, format = StringFormat.RAW, metadata) {
179
+ const {
180
+ _string,
181
+ _format,
182
+ _metadata
183
+ } = this._updateString(string, format, metadata, false);
184
+ return new StorageUploadTask(this, task => this._storage.native.putString(this.toString(), _string, _format, _metadata, task._id));
185
+ }
186
+
187
+ /**
188
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#fullPath
189
+ */
190
+ toString() {
191
+ if (this.path.length <= 1) {
192
+ return `${this._storage._customUrlOrRegion}`;
193
+ }
194
+ return `${this._storage._customUrlOrRegion}/${this.path}`;
195
+ }
196
+
197
+ /**
198
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#updateMetadata
199
+ */
200
+ updateMetadata(metadata) {
201
+ const validatedMetadata = validateMetadata(metadata);
202
+ return this._storage.native.updateMetadata(this.toString(), validatedMetadata);
203
+ }
204
+
205
+ /* ----------------------------------------
206
+ * EXTRA APIS (DO NOT ON EXIST WEB SDK)
207
+ * ---------------------------------------- */
208
+
209
+ /**
210
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference
211
+ */
212
+ writeToFile(filePath) {
213
+ if (!isString(filePath)) {
214
+ throw new Error("firebase.storage.StorageReference.writeToFile(*) 'filePath' expects a string value.");
215
+ }
216
+ return new StorageDownloadTask(this, task => this._storage.native.writeToFile(this.toString(), toFilePath(filePath), task._id));
217
+ }
218
+
219
+ /**
220
+ * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference
221
+ */
222
+ putFile(filePath, metadata) {
223
+ const validatedMetadata = isUndefined(metadata) ? metadata : validateMetadata(metadata, false);
224
+ if (!isString(filePath)) {
225
+ throw new Error("firebase.storage.StorageReference.putFile(*, _) 'filePath' expects a string value.");
226
+ }
227
+ return new StorageUploadTask(this, task => this._storage.native.putFile(this.toString(), toFilePath(filePath), validatedMetadata, task._id));
228
+ }
229
+ _updateString(string, format, metadata, update = false) {
230
+ if (!isString(string)) {
231
+ throw new Error("firebase.storage.StorageReference.putString(*, _, _) 'string' expects a string value.");
232
+ }
233
+ if (!Object.values(StringFormat).includes(format)) {
234
+ throw new Error(`firebase.storage.StorageReference.putString(_, *, _) 'format' provided is invalid, must be one of ${Object.values(StringFormat).join(',')}.`);
235
+ }
236
+ if (!isUndefined(metadata)) {
237
+ metadata = validateMetadata(metadata, update);
238
+ }
239
+ let _string = string;
240
+ let _format = format;
241
+ let _metadata = metadata;
242
+ if (format === StringFormat.RAW) {
243
+ _string = Base64.btoa(_string);
244
+ _format = StringFormat.BASE64;
245
+ } else if (format === StringFormat.DATA_URL) {
246
+ const {
247
+ mediaType,
248
+ base64String
249
+ } = getDataUrlParts(_string);
250
+ if (isUndefined(base64String)) {
251
+ throw new Error('firebase.storage.StorageReference.putString(*, _, _) invalid data_url string provided.');
252
+ }
253
+ if (isUndefined(metadata) || isUndefined(metadata.contentType)) {
254
+ if (isUndefined(metadata)) {
255
+ _metadata = {};
256
+ }
257
+ _metadata.contentType = mediaType;
258
+ _string = base64String;
259
+ _format = StringFormat.BASE64;
260
+ }
261
+ }
262
+ return {
263
+ _string,
264
+ _metadata,
265
+ _format
266
+ };
267
+ }
268
+ }
269
+ provideStorageReferenceClass(Reference);
270
+ //# sourceMappingURL=StorageReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Base64","getDataUrlParts","hasOwnProperty","isInteger","isNumber","isObject","isString","isUndefined","pathChild","pathLastComponent","pathParent","ReferenceBase","toFilePath","isModularCall","StorageDownloadTask","StorageListResult","provideStorageReferenceClass","StringFormat","StorageUploadTask","validateMetadata","Reference","constructor","storage","path","_storage","bucket","_customUrlOrRegion","replace","fullPath","name","parent","parentPath","root","child","childPath","delete","native","toString","getDownloadURL","getMetadata","list","options","Error","listOptions","maxResults","isModular","arguments","pageToken","then","data","listAll","put","metadata","validatedMetadata","task","fromData","string","format","_string","_format","_metadata","_updateString","putString","_id","RAW","length","updateMetadata","writeToFile","filePath","putFile","update","Object","values","includes","join","btoa","BASE64","DATA_URL","mediaType","base64String","contentType"],"sourceRoot":"../../lib","sources":["StorageReference.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,MAAM,EACNC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,SAAS,EACTC,iBAAiB,EACjBC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,aAAa,QACR,+CAA+C;AACtD,OAAOC,mBAAmB,MAAM,0BAAuB;AACvD,OAAOC,iBAAiB,IAAIC,4BAA4B,QAAQ,wBAAqB;AACrF,SAASC,YAAY,QAAQ,qBAAkB;AAC/C,OAAOC,iBAAiB,MAAM,wBAAqB;AACnD,SAASC,gBAAgB,QAAQ,YAAS;AAY1C,eAAe,MAAMC,SAAS,SAAST,aAAa,CAA6B;EAG/EU,WAAWA,CAACC,OAAwB,EAAEC,IAAY,EAAE;IAClD,KAAK,CAACA,IAAI,CAAC;IACX,IAAI,CAACC,QAAQ,GAAGF,OAAO;EACzB;;EAEA;AACF;AACA;EACE,IAAIG,MAAMA,CAAA,EAAW;IACnB,OAAO,IAAI,CAACD,QAAQ,CAACE,kBAAkB,CAAEC,OAAO,CAAC,OAAO,EAAE,EAAE,CA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ACiC,QAAQ,EAAEkB,MAAM,CAAmB;IACjE;IAEA,IAAIZ,OAAO,GAAGF,MAAM;IACpB,IAAIG,OAAO,GAAGF,MAAM;IACpB,IAAIG,SAAS,GAAGR,QAAQ;IAExB,IAAIK,MAAM,KAAKxC,YAAY,CAAC+C,GAAG,EAAE;MAC/BN,OAAO,GAAG1D,MAAM,CAAC2E,IAAI,CAACjB,OAAO,CAAC;MAC9BC,OAAO,GAAG1C,YAAY,CAAC2D,MAAM;IAC/B,CAAC,MAAM,IAAInB,MAAM,KAAKxC,YAAY,CAAC4D,QAAQ,EAAE;MAC3C,MAAM;QAAEC,SAAS;QAAEC;MAAa,CAAC,GAAG9E,eAAe,CAACyD,OAAO,CAAC;MAC5D,IAAInD,WAAW,CAACwE,YAAY,CAAC,EAAE;QAC7B,MAAM,IAAIrC,KAAK,CACb,wFACF,CAAC;MACH;MAEA,IAAInC,WAAW,CAAC6C,QAAQ,CAAC,IAAI7C,WAAW,CAAC6C,QAAQ,CAAC4B,WAAW,CAAC,EAAE;QAC9D,IAAIzE,WAAW,CAAC6C,QAAQ,CAAC,EAAE;UACzBQ,SAAS,GAAG,CAAC,CAAC;QAChB;QACAA,SAAS,CAAEoB,WAAW,GAAGF,SAAS;QAClCpB,OAAO,GAAGqB,YAAY;QACtBpB,OAAO,GAAG1C,YAAY,CAAC2D,MAAM;MAC/B;IACF;IACA,OAAO;MAAElB,OAAO;MAAEE,SAAS;MAAED;IAAQ,CAAC;EACxC;AACF;AAEA3C,4BAA4B,CAACI,SAAS,CAAC","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  /*
2
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
5
  *
@@ -15,19 +17,6 @@
15
17
  *
16
18
  */
17
19
 
18
- export const StringFormat = {
19
- RAW: 'raw',
20
- BASE64: 'base64',
21
- BASE64URL: 'base64url',
22
- DATA_URL: 'data_url',
23
- };
24
- export const TaskEvent = {
25
- STATE_CHANGED: 'state_changed',
26
- };
27
- export const TaskState = {
28
- RUNNING: 'running',
29
- PAUSED: 'paused',
30
- SUCCESS: 'success',
31
- CANCELLED: 'cancelled',
32
- ERROR: 'error',
33
- };
20
+ // Runtime constants live in `types/storage.ts` (alongside their derived-union types).
21
+ export { StringFormat, TaskEvent, TaskState } from "./types/storage.js";
22
+ //# sourceMappingURL=StorageStatics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StringFormat","TaskEvent","TaskState"],"sourceRoot":"../../lib","sources":["StorageStatics.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,YAAY,EAAEC,SAAS,EAAEC,SAAS,QAAQ,oBAAiB","ignoreList":[]}