@firebase-function-kits/bigquery-firestore-export 0.0.1 → 0.0.2-rc.1

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 (63) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +308 -0
  3. package/lib/config.d.ts +5 -0
  4. package/lib/config.d.ts.map +1 -0
  5. package/lib/config.js +181 -0
  6. package/lib/config.js.map +1 -0
  7. package/lib/dts.d.ts +21 -0
  8. package/lib/dts.d.ts.map +1 -0
  9. package/lib/dts.js +193 -0
  10. package/lib/dts.js.map +1 -0
  11. package/lib/export-config.d.ts +55 -0
  12. package/lib/export-config.d.ts.map +1 -0
  13. package/lib/export-config.js +55 -0
  14. package/lib/export-config.js.map +1 -0
  15. package/lib/handlers.d.ts +22 -0
  16. package/lib/handlers.d.ts.map +1 -0
  17. package/lib/handlers.js +125 -0
  18. package/lib/handlers.js.map +1 -0
  19. package/lib/helper.d.ts +37 -0
  20. package/lib/helper.d.ts.map +1 -0
  21. package/lib/helper.js +219 -0
  22. package/lib/helper.js.map +1 -0
  23. package/lib/index.d.ts +7 -0
  24. package/lib/index.d.ts.map +1 -0
  25. package/lib/index.js +137 -0
  26. package/lib/index.js.map +1 -0
  27. package/lib/lib.d.ts +11 -0
  28. package/lib/lib.d.ts.map +1 -0
  29. package/lib/lib.js +47 -0
  30. package/lib/lib.js.map +1 -0
  31. package/lib/logs.d.ts +21 -0
  32. package/lib/logs.d.ts.map +1 -0
  33. package/lib/logs.js +122 -0
  34. package/lib/logs.js.map +1 -0
  35. package/lib/metadata.d.ts +6 -0
  36. package/lib/metadata.d.ts.map +1 -0
  37. package/lib/metadata.js +34 -0
  38. package/lib/metadata.js.map +1 -0
  39. package/lib/types.d.ts +44 -0
  40. package/lib/types.d.ts.map +1 -0
  41. package/lib/types.js +18 -0
  42. package/lib/types.js.map +1 -0
  43. package/npm-shrinkwrap.json +5049 -0
  44. package/package.json +40 -4
  45. package/src/config.ts +205 -0
  46. package/src/dts.ts +217 -0
  47. package/src/export-config.ts +119 -0
  48. package/src/handlers.ts +141 -0
  49. package/src/helper.ts +320 -0
  50. package/src/index.ts +126 -0
  51. package/src/lib.ts +69 -0
  52. package/src/logs.ts +145 -0
  53. package/src/metadata.ts +31 -0
  54. package/src/types.ts +100 -0
  55. package/tests/config.test.ts +61 -0
  56. package/tests/dts.test.ts +120 -0
  57. package/tests/export-config.test.ts +74 -0
  58. package/tests/handlers.test.ts +170 -0
  59. package/tests/helper.test.ts +74 -0
  60. package/tests/lib.test.ts +43 -0
  61. package/tsconfig.json +18 -0
  62. package/tsconfig.tsbuildinfo +1 -0
  63. package/index.js +0 -0
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2026 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.metadata = void 0;
19
+ exports.metadata = {
20
+ roles: [
21
+ "datastore.user",
22
+ "bigquery.admin",
23
+ "pubsub.admin",
24
+ "eventarc.eventReceiver",
25
+ "run.invoker",
26
+ ],
27
+ apis: [
28
+ "bigquery.googleapis.com",
29
+ "bigquerydatatransfer.googleapis.com",
30
+ "pubsub.googleapis.com",
31
+ ],
32
+ functionNames: ["processMessages", "upsertTransferConfig"],
33
+ };
34
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEU,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE;QACL,gBAAgB;QAChB,gBAAgB;QAChB,cAAc;QACd,wBAAwB;QACxB,aAAa;KACd;IACD,IAAI,EAAE;QACJ,yBAAyB;QACzB,qCAAqC;QACrC,uBAAuB;KACxB;IACD,aAAa,EAAE,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;CAClD,CAAC"}
package/lib/types.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ import type { BigQueryDate, BigQueryDatetime, BigQueryTime, BigQueryTimestamp, Geography } from "@google-cloud/bigquery";
2
+ import type { Timestamp } from "firebase-admin/firestore";
3
+ /** Parameters attached to a BigQuery scheduled-query transfer run. */
4
+ export interface TransferRunParams {
5
+ destination_table_name_template: string;
6
+ partitioning_field: string;
7
+ query: string;
8
+ write_disposition: string;
9
+ }
10
+ /** State of a BigQuery Data Transfer run. */
11
+ export type TransferRunState = "SUCCEEDED" | "FAILED" | "CANCELLED" | "PENDING" | "RUNNING" | "TRANSFER_STATE_UNSPECIFIED";
12
+ /** JSON payload from a BigQuery Data Transfer Pub/Sub notification. */
13
+ export interface TransferRunPayload {
14
+ name: string;
15
+ runTime: string;
16
+ state: TransferRunState;
17
+ destinationDatasetId: string;
18
+ dataSourceId: string;
19
+ schedule: string;
20
+ scheduleTime: string;
21
+ startTime: string;
22
+ endTime: string;
23
+ updateTime: string;
24
+ userId: string;
25
+ notificationPubsubTopic: string;
26
+ params: TransferRunParams;
27
+ emailPreferences: Record<string, unknown>;
28
+ errorStatus: Record<string, unknown>;
29
+ }
30
+ /** Message-shaped wrapper retained for the core handler boundary. */
31
+ export interface TransferRunMessage {
32
+ json: TransferRunPayload;
33
+ }
34
+ /** Values returned in a BigQuery row before conversion. */
35
+ export type BigQueryRowValue = string | number | boolean | null | Date | Buffer | BigQueryTimestamp | BigQueryDate | BigQueryTime | BigQueryDatetime | Geography | BigQueryRow | BigQueryRowValue[];
36
+ export interface BigQueryRow {
37
+ [key: string]: BigQueryRowValue;
38
+ }
39
+ /** Firestore-compatible equivalent of a BigQuery row value. */
40
+ export type FirestoreRowValue = string | number | boolean | null | Timestamp | Uint8Array | FirestoreRow | FirestoreRowValue[];
41
+ export interface FirestoreRow {
42
+ [key: string]: FirestoreRowValue;
43
+ }
44
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,+BAA+B,EAAE,MAAM,CAAC;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,6CAA6C;AAC7C,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,QAAQ,GACR,WAAW,GACX,SAAS,GACT,SAAS,GACT,4BAA4B,CAAC;AAEjC,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,2DAA2D;AAC3D,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,SAAS,GACT,WAAW,GACX,gBAAgB,EAAE,CAAC;AAEvB,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACjC;AAED,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,UAAU,GACV,YAAY,GACZ,iBAAiB,EAAE,CAAC;AAExB,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAClC"}
package/lib/types.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2025 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}