@firebaseextensions/firestore-bigquery-change-tracker 1.1.23 → 1.1.25

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- The `firestore-bigquery-change-tracker` package is a dependency for the official Firebase Extension [_Export Collections to BigQuery_](https://github.com/firebase/extensions/tree/master/firestore-bigquery-export), [_schema views script_](https://github.com/firebase/extensions/blob/master/firestore-bigquery-export/guides/GENERATE_SCHEMA_VIEWS.md) & the [_import Firestore documents script_](https://github.com/firebase/extensions/blob/master/firestore-bigquery-export/guides/IMPORT_EXISTING_DOCUMENTS.md).
1
+ The `firestore-bigquery-change-tracker` package is a dependency for the official Firebase Extension [_Stream Firestore to BigQuery_](https://github.com/firebase/extensions/tree/master/firestore-bigquery-export), [_schema views script_](https://github.com/firebase/extensions/blob/master/firestore-bigquery-export/guides/GENERATE_SCHEMA_VIEWS.md) & the [_import Firestore documents script_](https://github.com/firebase/extensions/blob/master/firestore-bigquery-export/guides/IMPORT_EXISTING_DOCUMENTS.md).
2
2
 
3
3
  Its main purpose is to initialize & update the BigQuery table & view generated by using the `firestore-bigquery-export` extension.
4
4
 
@@ -51,7 +51,9 @@ class FirestoreBigQueryEventHistoryTracker {
51
51
  }
52
52
  }
53
53
  async record(events) {
54
- await this.initialize();
54
+ if (!this.config.skipInit) {
55
+ await this.initialize();
56
+ }
55
57
  const partitionHandler = new partitioning_1.Partitioning(this.config);
56
58
  const rows = events.map((event) => {
57
59
  const partitionValue = partitionHandler.getPartitionValue(event);
@@ -85,7 +87,8 @@ class FirestoreBigQueryEventHistoryTracker {
85
87
  headers: { "Content-Type": "application/json" },
86
88
  });
87
89
  const responseJson = await response.json();
88
- return responseJson.data;
90
+ // To support callable functions, first check result.data
91
+ return responseJson?.result?.data ?? responseJson.data;
89
92
  }
90
93
  return rows;
91
94
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "github.com/firebase/extensions.git",
6
6
  "directory": "firestore-bigquery-export/firestore-bigquery-change-tracker"
7
7
  },
8
- "version": "1.1.23",
8
+ "version": "1.1.25",
9
9
  "description": "Core change-tracker library for Cloud Firestore Collection BigQuery Exports",
10
10
  "main": "./lib/index.js",
11
11
  "scripts": {