@edgedev/firebase 2.1.70 → 2.1.73

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 CHANGED
@@ -1389,8 +1389,13 @@ export const EdgeFirebase = class {
1389
1389
  const canRead = await this.permissionCheck("read", collectionPath);
1390
1390
  if (canRead) {
1391
1391
  const q = this.getQuery(collectionPath, queryList, orderList, max, last);
1392
-
1393
- const docs = await getDocs(q);
1392
+ let docs;
1393
+ try {
1394
+ docs = await getDocs(q);
1395
+ } catch (error) {
1396
+ console.log('error getting documents')
1397
+ console.error('Error getting documents:', error);
1398
+ }
1394
1399
 
1395
1400
  nextLast = docs.docs[docs.docs.length - 1];
1396
1401
  docs.forEach((doc) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "2.1.70",
3
+ "version": "2.1.73",
4
4
  "description": "Vue 3 / Nuxt 3 Plugin or Nuxt 3 plugin for firebase authentication and firestore.",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/src/.env.dev CHANGED
@@ -5,10 +5,11 @@ OPENAI_API_KEY=
5
5
  TWILIO_SID=
6
6
  TWILIO_AUTH_TOKEN=
7
7
  TWILIO_SYSTEM_NUMBER=
8
+
8
9
  FIREBASE_STORAGE_BUCKET=
9
10
  FIREBASE_STORAGE_BUCKET_REGION=
10
- FIREBASE_STORAGE_BUCKET=
11
- FIREBASE_STORAGE_BUCKET_REGION=
11
+ FIREBASE_STORE_REGION=us-west1
12
+
12
13
  CLOUDFLARE_R2_PUBLIC_URL=
13
14
  CLOUDFLARE_R2_ENDPOINT=
14
15
  CLOUDFLARE_R2_ACCESS_KEY_ID=
package/src/.env.prod CHANGED
@@ -5,10 +5,11 @@ OPENAI_API_KEY=
5
5
  TWILIO_SID=
6
6
  TWILIO_AUTH_TOKEN=
7
7
  TWILIO_SYSTEM_NUMBER=
8
+
8
9
  FIREBASE_STORAGE_BUCKET=
9
10
  FIREBASE_STORAGE_BUCKET_REGION=
10
- FIREBASE_STORAGE_BUCKET=
11
- FIREBASE_STORAGE_BUCKET_REGION=
11
+ FIREBASE_STORE_REGION=us-west1
12
+
12
13
  CLOUDFLARE_R2_PUBLIC_URL=
13
14
  CLOUDFLARE_R2_ENDPOINT=
14
15
  CLOUDFLARE_R2_ACCESS_KEY_ID=
package/src/config.js CHANGED
@@ -20,11 +20,16 @@ const {
20
20
  Change,
21
21
  FirestoreEvent,
22
22
  } = require('firebase-functions/v2/firestore')
23
- const { logger } = require('firebase-functions/v2')
23
+ const { logger, setGlobalOptions } = require('firebase-functions/v2')
24
24
  const { Firestore, getFirestore } = require('firebase-admin/firestore')
25
25
  const twilio = require('twilio')
26
26
  const db = getFirestore()
27
27
 
28
+ const defaultRegion = process.env.FIREBASE_STORE_REGION
29
+ || 'us-west1'
30
+
31
+ setGlobalOptions({ region: defaultRegion })
32
+
28
33
  // The permissionCheck function
29
34
 
30
35
  const permissions = {