@edgedev/firebase 2.1.45 → 2.1.47

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
@@ -25,6 +25,7 @@ import {
25
25
  arrayRemove,
26
26
  arrayUnion,
27
27
  connectFirestoreEmulator,
28
+ getCountFromServer,
28
29
  } from "firebase/firestore";
29
30
 
30
31
  import {
@@ -60,6 +61,7 @@ import { getStorage, ref, uploadBytesResumable, getDownloadURL, connectStorageEm
60
61
  import { getFunctions, httpsCallable, connectFunctionsEmulator } from "firebase/functions";
61
62
 
62
63
  import { getAnalytics, logEvent } from "firebase/analytics";
64
+ import { get } from "http";
63
65
 
64
66
  interface FirestoreQuery {
65
67
  field: string;
@@ -1285,9 +1287,22 @@ export const EdgeFirebase = class {
1285
1287
  return { data, next: nextLast };
1286
1288
  };
1287
1289
 
1290
+ private getTotalCount = async (
1291
+ collectionPath: string,
1292
+ queryList: FirestoreQuery[] = []
1293
+ ): Promise<number> => {
1294
+ console.log('getTotalCount')
1295
+ console.log(collectionPath )
1296
+ console.log(queryList)
1297
+ const q = this.getQuery(collectionPath, queryList);
1298
+ const snapshot = await getCountFromServer(q);
1299
+ return snapshot.data().count;
1300
+ };
1301
+
1288
1302
  get SearchStaticData() {
1289
1303
  const getStaticData = this.getStaticData;
1290
1304
  const permissionCheckOnly = this.permissionCheckOnly;
1305
+ const getTotalCount = this.getTotalCount;
1291
1306
  const sendResponse = this.sendResponse;
1292
1307
  return class {
1293
1308
  private collectionPath = "";
@@ -1300,7 +1315,8 @@ export const EdgeFirebase = class {
1300
1315
  pagination: [],
1301
1316
  staticIsLastPage: true,
1302
1317
  staticIsFirstPage: true,
1303
- staticCurrentPage: ""
1318
+ staticCurrentPage: "",
1319
+ total: 0
1304
1320
  });
1305
1321
 
1306
1322
  public prev = async (): Promise<void> => {
@@ -1408,6 +1424,7 @@ export const EdgeFirebase = class {
1408
1424
  orderList,
1409
1425
  max
1410
1426
  );
1427
+ this.results.total = await getTotalCount(this.collectionPath, this.queryList);
1411
1428
  if (Object.keys(results.data).length > 0) {
1412
1429
  this.results.staticIsLastPage = false;
1413
1430
  this.results.data = results.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "2.1.45",
3
+ "version": "2.1.47",
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/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "functions",
3
+ "private": true,
3
4
  "description": "Cloud Functions for Firebase",
5
+ "main": "index.js",
6
+ "engines": {
7
+ "node": "18"
8
+ },
4
9
  "scripts": {
5
10
  "serve": "firebase emulators:start --only functions",
6
11
  "shell": "firebase functions:shell",
@@ -8,19 +13,21 @@
8
13
  "deploy": "firebase deploy --only functions",
9
14
  "logs": "firebase functions:log"
10
15
  },
11
- "engines": {
12
- "node": "16"
13
- },
14
- "main": "index.js",
15
16
  "dependencies": {
16
- "@google-cloud/pubsub": "^4.0.6",
17
+ "@google-cloud/pubsub": "^4.9.0",
18
+ "crypto": "^1.0.1",
17
19
  "dotenv": "^16.3.1",
18
- "firebase-admin": "^10.0.2",
19
- "firebase-functions": "^4.5.0",
20
+ "exceljs": "^4.4.0",
21
+ "firebase-admin": "^13.0.2",
22
+ "firebase-functions": "^6.2.0",
23
+ "form-data": "^4.0.0",
24
+ "formidable-serverless": "^1.1.1",
25
+ "moment-timezone": "^0.5.43",
26
+ "openai": "^4.11.1",
27
+ "stripe": "^13.8.0",
20
28
  "twilio": "^4.18.0"
21
29
  },
22
30
  "devDependencies": {
23
31
  "firebase-functions-test": "^0.2.0"
24
- },
25
- "private": true
32
+ }
26
33
  }