@lpdjs/firestore-repo-service 2.3.2 → 2.3.4

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.
Files changed (37) hide show
  1. package/dist/{create-servers-CFZ_ZQzB.d.cts → create-servers-BmgAjUFD.d.cts} +2 -2
  2. package/dist/{create-servers-DLEocmga.d.ts → create-servers-Dv0V1LB8.d.ts} +2 -2
  3. package/dist/index.cjs +40 -40
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +3 -3
  6. package/dist/index.d.ts +3 -3
  7. package/dist/index.js +40 -40
  8. package/dist/index.js.map +1 -1
  9. package/dist/{queue-V0OPbQa0.d.ts → queue-CmBKfeqG.d.cts} +10 -1
  10. package/dist/{queue-BTe8rqCq.d.cts → queue-DLrIuZ7L.d.ts} +10 -1
  11. package/dist/servers/index.cjs +40 -40
  12. package/dist/servers/index.cjs.map +1 -1
  13. package/dist/servers/index.d.cts +3 -3
  14. package/dist/servers/index.d.ts +3 -3
  15. package/dist/servers/index.js +40 -40
  16. package/dist/servers/index.js.map +1 -1
  17. package/dist/sync/bigquery-storage.cjs +8 -0
  18. package/dist/sync/bigquery-storage.cjs.map +1 -0
  19. package/dist/sync/bigquery-storage.d.cts +113 -0
  20. package/dist/sync/bigquery-storage.d.ts +113 -0
  21. package/dist/sync/bigquery-storage.js +8 -0
  22. package/dist/sync/bigquery-storage.js.map +1 -0
  23. package/dist/sync/bigquery.cjs +8 -8
  24. package/dist/sync/bigquery.cjs.map +1 -1
  25. package/dist/sync/bigquery.d.cts +6 -1
  26. package/dist/sync/bigquery.d.ts +6 -1
  27. package/dist/sync/bigquery.js +8 -8
  28. package/dist/sync/bigquery.js.map +1 -1
  29. package/dist/sync/index.cjs +21 -21
  30. package/dist/sync/index.cjs.map +1 -1
  31. package/dist/sync/index.d.cts +4 -4
  32. package/dist/sync/index.d.ts +4 -4
  33. package/dist/sync/index.js +21 -21
  34. package/dist/sync/index.js.map +1 -1
  35. package/dist/{types-CBwcflkG.d.ts → types-Bhy7MfCj.d.ts} +19 -0
  36. package/dist/{types-BW592RAZ.d.cts → types-_JSH59Iy.d.cts} +19 -0
  37. package/package.json +19 -1
@@ -94,6 +94,16 @@ interface SqlAdapter {
94
94
  * Used by the migration manager to detect schema drift.
95
95
  */
96
96
  getTableColumns(tableName: string): Promise<string[]>;
97
+ /**
98
+ * Return existing columns with their dialect-specific SQL type strings.
99
+ * Used by the worker to detect type drift (e.g. Zod field changes from
100
+ * `number` to `string`) and fail fast with an explicit error rather than
101
+ * letting MERGE/Storage Write fail silently on every event.
102
+ *
103
+ * Optional for backwards-compat: if the adapter does not implement it,
104
+ * the worker skips type-drift detection but still adds new columns.
105
+ */
106
+ getTableColumnsWithTypes?(tableName: string): Promise<Map<string, string>>;
97
107
  /**
98
108
  * Create a table. Should be idempotent (IF NOT EXISTS).
99
109
  */
@@ -116,6 +126,15 @@ interface SqlAdapter {
116
126
  * The adapter is responsible for qualifying table names (e.g. dataset.table).
117
127
  */
118
128
  addColumns(tableName: string, columns: SqlColumn[]): Promise<void>;
129
+ /**
130
+ * Hook called by the worker after a schema change (`addColumns`) so that
131
+ * adapters caching schema-derived state — e.g. Storage Write proto
132
+ * descriptors / writer connections — can invalidate their cache.
133
+ *
134
+ * Optional: adapters with no cache (legacy `BigQueryAdapter`) do not need
135
+ * to implement this.
136
+ */
137
+ onSchemaChange?(tableName: string): void | Promise<void>;
119
138
  /**
120
139
  * Execute a raw SQL statement.
121
140
  * The adapter is responsible for qualifying any table references.
@@ -94,6 +94,16 @@ interface SqlAdapter {
94
94
  * Used by the migration manager to detect schema drift.
95
95
  */
96
96
  getTableColumns(tableName: string): Promise<string[]>;
97
+ /**
98
+ * Return existing columns with their dialect-specific SQL type strings.
99
+ * Used by the worker to detect type drift (e.g. Zod field changes from
100
+ * `number` to `string`) and fail fast with an explicit error rather than
101
+ * letting MERGE/Storage Write fail silently on every event.
102
+ *
103
+ * Optional for backwards-compat: if the adapter does not implement it,
104
+ * the worker skips type-drift detection but still adds new columns.
105
+ */
106
+ getTableColumnsWithTypes?(tableName: string): Promise<Map<string, string>>;
97
107
  /**
98
108
  * Create a table. Should be idempotent (IF NOT EXISTS).
99
109
  */
@@ -116,6 +126,15 @@ interface SqlAdapter {
116
126
  * The adapter is responsible for qualifying table names (e.g. dataset.table).
117
127
  */
118
128
  addColumns(tableName: string, columns: SqlColumn[]): Promise<void>;
129
+ /**
130
+ * Hook called by the worker after a schema change (`addColumns`) so that
131
+ * adapters caching schema-derived state — e.g. Storage Write proto
132
+ * descriptors / writer connections — can invalidate their cache.
133
+ *
134
+ * Optional: adapters with no cache (legacy `BigQueryAdapter`) do not need
135
+ * to implement this.
136
+ */
137
+ onSchemaChange?(tableName: string): void | Promise<void>;
119
138
  /**
120
139
  * Execute a raw SQL statement.
121
140
  * The adapter is responsible for qualifying any table references.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpdjs/firestore-repo-service",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "workspaces": [
5
5
  "test/functions"
6
6
  ],
@@ -40,6 +40,16 @@
40
40
  "default": "./dist/sync/bigquery.js"
41
41
  }
42
42
  },
43
+ "./sync/bigquery-storage": {
44
+ "require": {
45
+ "types": "./dist/sync/bigquery-storage.d.cts",
46
+ "default": "./dist/sync/bigquery-storage.cjs"
47
+ },
48
+ "import": {
49
+ "types": "./dist/sync/bigquery-storage.d.ts",
50
+ "default": "./dist/sync/bigquery-storage.js"
51
+ }
52
+ },
43
53
  "./history": {
44
54
  "require": {
45
55
  "types": "./dist/history/index.d.cts",
@@ -124,6 +134,9 @@
124
134
  "sync/bigquery": [
125
135
  "./dist/sync/bigquery.d.ts"
126
136
  ],
137
+ "sync/bigquery-storage": [
138
+ "./dist/sync/bigquery-storage.d.ts"
139
+ ],
127
140
  "history": [
128
141
  "./dist/history/index.d.ts"
129
142
  ]
@@ -195,6 +208,7 @@
195
208
  "homepage": "https://frs.lpdjs.fr",
196
209
  "peerDependencies": {
197
210
  "@google-cloud/bigquery": "^7.0.0 || ^8.0.0",
211
+ "@google-cloud/bigquery-storage": "^4.0.0 || ^5.0.0",
198
212
  "@google-cloud/pubsub": "^4.0.0 || ^5.0.0",
199
213
  "firebase-admin": "^11.0.0 || ^12.0.0 || ^13.0.0",
200
214
  "firebase-functions": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -208,12 +222,16 @@
208
222
  "@google-cloud/bigquery": {
209
223
  "optional": true
210
224
  },
225
+ "@google-cloud/bigquery-storage": {
226
+ "optional": true
227
+ },
211
228
  "@google-cloud/pubsub": {
212
229
  "optional": true
213
230
  }
214
231
  },
215
232
  "devDependencies": {
216
233
  "@google-cloud/bigquery": "^8.3.0",
234
+ "@google-cloud/bigquery-storage": "^5.1.0",
217
235
  "@google-cloud/pubsub": "^5.3.0",
218
236
  "@types/bun": "latest",
219
237
  "@types/express": "latest",