@firebase-function-kits/bigquery-firestore-export 0.0.2-rc.4 → 0.0.2-rc.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase-function-kits/bigquery-firestore-export",
3
- "version": "0.0.2-rc.4",
3
+ "version": "0.0.2-rc.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/firebase/extensions.git",
@@ -35,15 +35,19 @@
35
35
  "@firebase/app": "^0.16.0",
36
36
  "@google-cloud/bigquery": "^8.3.1",
37
37
  "@google-cloud/bigquery-data-transfer": "^5.0.1",
38
- "@google-cloud/pubsub": "^4.11.0",
39
- "firebase-admin": "^14.1.0",
40
- "firebase-functions": "^7.3.3-rc.0"
38
+ "@google-cloud/pubsub": "^4.11.0"
41
39
  },
42
40
  "devDependencies": {
41
+ "firebase-admin": "^14.4.0",
42
+ "firebase-functions": "^7.3.3-rc.3",
43
43
  "typescript": "^5.9.3",
44
44
  "vitest": "^4.1.10"
45
45
  },
46
46
  "overrides": {
47
47
  "uuid@9.0.1": "11.1.1"
48
+ },
49
+ "peerDependencies": {
50
+ "firebase-admin": "^14.4.0",
51
+ "firebase-functions": "^7.3.3-rc.3"
48
52
  }
49
53
  }
package/src/dts.ts CHANGED
@@ -194,6 +194,11 @@ export async function constructUpdateTransferConfigRequest(
194
194
  updatedFields.partitioning_field.stringValue = newPartitioningField;
195
195
  }
196
196
 
197
+ if (config.displayName !== transferConfig.displayName) {
198
+ updateMask.push("display_name");
199
+ updatedConfig.displayName = config.displayName;
200
+ }
201
+
197
202
  if (config.schedule !== transferConfig.schedule) {
198
203
  updateMask.push("schedule");
199
204
  updatedConfig.schedule = config.schedule;
package/tests/dts.test.ts CHANGED
@@ -85,6 +85,7 @@ describe("constructUpdateTransferConfigRequest", () => {
85
85
  const client = clientWithTransferConfig({
86
86
  name: "projects/p/locations/us/transferConfigs/c",
87
87
  destinationDatasetId: "analytics",
88
+ displayName: "Users export",
88
89
  schedule: "every 24 hours",
89
90
  notificationPubsubTopic:
90
91
  "projects/test-project/topics/kit-users-export-processMessages",
@@ -108,6 +109,63 @@ describe("constructUpdateTransferConfigRequest", () => {
108
109
  expect(request.updateMask?.paths).toEqual(["params"]);
109
110
  });
110
111
 
112
+ test("updates the display name when it changed", async () => {
113
+ const client = clientWithTransferConfig({
114
+ name: "projects/p/locations/us/transferConfigs/c",
115
+ destinationDatasetId: "analytics",
116
+ displayName: "Old export name",
117
+ schedule: "every 24 hours",
118
+ notificationPubsubTopic:
119
+ "projects/test-project/topics/kit-users-export-processMessages",
120
+ params: {
121
+ fields: {
122
+ query: { stringValue: config.queryString },
123
+ destination_table_name_template: {
124
+ stringValue: 'users_{run_time|"%H%M%S"}',
125
+ },
126
+ partitioning_field: { stringValue: "created_at" },
127
+ },
128
+ },
129
+ });
130
+
131
+ const request = await constructUpdateTransferConfigRequest(
132
+ client,
133
+ "projects/p/locations/us/transferConfigs/c",
134
+ config
135
+ );
136
+
137
+ expect(request.updateMask?.paths).toEqual(["display_name"]);
138
+ expect(request.transferConfig?.displayName).toBe("Users export");
139
+ });
140
+
141
+ test("leaves the display name out of the mask when unchanged", async () => {
142
+ const client = clientWithTransferConfig({
143
+ name: "projects/p/locations/us/transferConfigs/c",
144
+ destinationDatasetId: "analytics",
145
+ displayName: "Users export",
146
+ schedule: "every 12 hours",
147
+ notificationPubsubTopic:
148
+ "projects/test-project/topics/kit-users-export-processMessages",
149
+ params: {
150
+ fields: {
151
+ query: { stringValue: config.queryString },
152
+ destination_table_name_template: {
153
+ stringValue: 'users_{run_time|"%H%M%S"}',
154
+ },
155
+ partitioning_field: { stringValue: "created_at" },
156
+ },
157
+ },
158
+ });
159
+
160
+ const request = await constructUpdateTransferConfigRequest(
161
+ client,
162
+ "projects/p/locations/us/transferConfigs/c",
163
+ config
164
+ );
165
+
166
+ expect(request.updateMask?.paths).toEqual(["schedule"]);
167
+ });
168
+
111
169
  test("rejects clearing an existing partitioning field", async () => {
112
170
  const client = clientWithTransferConfig({
113
171
  name: "projects/p/locations/us/transferConfigs/c",