@edgedev/firebase 2.1.74 → 2.1.77
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 +10 -2
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -184,6 +184,7 @@ interface firebaseConfig {
|
|
|
184
184
|
emulatorFirestore?: string;
|
|
185
185
|
emulatorFunctions?: string;
|
|
186
186
|
emulatorStorage?: string;
|
|
187
|
+
functionsRegion?: string;
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
interface actionResponse {
|
|
@@ -206,10 +207,12 @@ interface Meta {
|
|
|
206
207
|
[key: string]: unknown;
|
|
207
208
|
}
|
|
208
209
|
|
|
210
|
+
const DEFAULT_FUNCTIONS_REGION = "us-central1";
|
|
211
|
+
|
|
209
212
|
export const EdgeFirebase = class {
|
|
210
213
|
constructor(
|
|
211
214
|
firebaseConfig: firebaseConfig = {
|
|
212
|
-
|
|
215
|
+
apiKey: "",
|
|
213
216
|
authDomain: "",
|
|
214
217
|
projectId: "",
|
|
215
218
|
storageBucket: "",
|
|
@@ -220,10 +223,10 @@ export const EdgeFirebase = class {
|
|
|
220
223
|
emulatorFirestore: "",
|
|
221
224
|
emulatorFunctions: "",
|
|
222
225
|
emulatorStorage: "",
|
|
226
|
+
functionsRegion: ""
|
|
223
227
|
},
|
|
224
228
|
isPersistant: false,
|
|
225
229
|
enablePopupRedirect: false,
|
|
226
|
-
functionsRegion = "us-central1",
|
|
227
230
|
) {
|
|
228
231
|
this.firebaseConfig = firebaseConfig;
|
|
229
232
|
this.app = initializeApp(this.firebaseConfig);
|
|
@@ -252,7 +255,12 @@ export const EdgeFirebase = class {
|
|
|
252
255
|
if (this.firebaseConfig.storageBucket) {
|
|
253
256
|
this.storage = getStorage(this.app);
|
|
254
257
|
}
|
|
258
|
+
|
|
259
|
+
const functionsRegion =
|
|
260
|
+
this.firebaseConfig.functionsRegion || DEFAULT_FUNCTIONS_REGION;
|
|
261
|
+
|
|
255
262
|
this.functions = getFunctions(this.app, functionsRegion);
|
|
263
|
+
|
|
256
264
|
if (this.firebaseConfig.emulatorFunctions) {
|
|
257
265
|
connectFunctionsEmulator(this.functions, "127.0.0.1", this.firebaseConfig.emulatorFunctions)
|
|
258
266
|
}
|