@causa/workspace-google 0.7.1 → 0.8.0

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
@@ -16,6 +16,24 @@ Add `@causa/workspace-google` to your Causa configuration in `causa.modules`.
16
16
 
17
17
  For all the Google-related configuration in your Causa files, look at [the schema for the `GoogleConfiguration`](./src/configurations/google.ts).
18
18
 
19
+ ### Firebase
20
+
21
+ If you use Firebase functionalities and the corresponding CLI commands listed below (e.g. AppCheck, Identity Platform), you may want to set the configuration under the `google.firebase` path. This configuration is optional, but may speed up some CLI commands that would otherwise need to fetch the configuration from GCP using APIs every time they are run. Here is an example of such configuration:
22
+
23
+ ```yaml
24
+ google:
25
+ firebase:
26
+ adminServiceAccount: firebase-adminsdk-<random ID>@<GCP project>.iam.gserviceaccount.com
27
+ apiKey: Public API key, e.g. for iOS, Android, or Web.
28
+ appId: Firebase App ID for iOS, Android, or Web.
29
+ ```
30
+
31
+ - `adminServiceAccount` references a private service account only known to developers. While it cannot be used without the corresponding IAM credentials, you should ensure only developers with relevant access can read this configuration.
32
+ - `apiKey`: Be sure to select a public API key. For example, keys embedded in client applications are safe because they are distributed to all users anyway.
33
+ - `appId`: Firebase App IDs are also embedded in client applications. Any (public) app ID is safe to set in the configuration.
34
+
35
+ This makes the `google.firebase` configuration safe to commit in your repository. Getting access to this configuration does not grant any permission that is either public or has to be set separately in IAM.
36
+
19
37
  ## ✨ Supported project types and commands
20
38
 
21
39
  ### Project types
@@ -162,5 +180,3 @@ Although infrastructure as code tools usually expose this feature as well (e.g.
162
180
  ### `GooglePubSubWriteTopics`
163
181
 
164
182
  [GooglePubSubWriteTopics](./src/functions/google-pubsub-write-topics.ts) writes a configuration file for each event topic, such that it can be picked up by the Causa Pub/Sub Terraform module. This allows automatic setup of Pub/Sub topics, and optionally of the corresponding BigQuery tables.
165
-
166
- Documentation of Firebase account + Firebase API key.
@@ -116,6 +116,12 @@ export class EmulatorStartForSpanner extends EmulatorStart {
116
116
  const [db, operation] = await instance.createDatabase(database.id, {
117
117
  schema: ddls,
118
118
  });
119
+ // While unlikely, the database object might emit errors, e.g "The client has already been closed.".
120
+ // These errors could simply be ignored, as awaiting on the operation should be enough to ensure the database is
121
+ // created. However they are logged as warnings for completeness.
122
+ db.on('error', (error) => {
123
+ context.logger.warn(`⚠️ Uncaught Spanner database error: '${error.message}'.`);
124
+ });
119
125
  await operation.promise();
120
126
  await db.close();
121
127
  }));
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@causa/workspace-google",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "The Causa workspace module providing many functionalities related to GCP and its services.",
5
5
  "repository": "github:causa-io/workspace-module-google",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "engines": {
9
- "node": ">=16"
9
+ "node": ">=18"
10
10
  },
11
11
  "main": "dist/index.js",
12
12
  "types": "dist/index.d.ts",
@@ -29,46 +29,46 @@
29
29
  "test:cov": "npm run test -- --coverage"
30
30
  },
31
31
  "dependencies": {
32
- "@causa/cli": ">= 0.4.1 < 1.0.0",
33
- "@causa/workspace": ">= 0.12.1 < 1.0.0",
34
- "@causa/workspace-core": ">= 0.19.1 < 1.0.0",
35
- "@causa/workspace-typescript": ">=0.8.2",
36
- "@google-cloud/apikeys": "^1.1.0",
37
- "@google-cloud/bigquery": "^7.4.0",
38
- "@google-cloud/iam-credentials": "^3.1.0",
39
- "@google-cloud/pubsub": "^4.3.2",
40
- "@google-cloud/resource-manager": "^5.1.0",
41
- "@google-cloud/run": "^1.1.0",
42
- "@google-cloud/secret-manager": "^5.1.0",
43
- "@google-cloud/service-usage": "^3.2.0",
44
- "@google-cloud/spanner": "7.3.0",
45
- "@google-cloud/storage": "^7.7.0",
32
+ "@causa/cli": ">= 0.5.0 < 1.0.0",
33
+ "@causa/workspace": ">= 0.13.0 < 1.0.0",
34
+ "@causa/workspace-core": ">= 0.20.0 < 1.0.0",
35
+ "@causa/workspace-typescript": ">= 0.9.0 < 1.0.0",
36
+ "@google-cloud/apikeys": "^1.2.0",
37
+ "@google-cloud/bigquery": "^7.7.0",
38
+ "@google-cloud/iam-credentials": "^3.2.0",
39
+ "@google-cloud/pubsub": "^4.4.0",
40
+ "@google-cloud/resource-manager": "^5.2.0",
41
+ "@google-cloud/run": "^1.2.0",
42
+ "@google-cloud/secret-manager": "~5.3.0",
43
+ "@google-cloud/service-usage": "^3.3.0",
44
+ "@google-cloud/spanner": "7.7.0",
45
+ "@google-cloud/storage": "^7.11.0",
46
46
  "class-validator": "^0.14.1",
47
- "firebase": "^10.8.0",
48
- "firebase-admin": "^12.0.0",
47
+ "firebase": "^10.12.1",
48
+ "firebase-admin": "^12.1.0",
49
49
  "globby": "^14.0.1",
50
- "google-auth-library": "^9.6.3",
51
- "google-gax": "4.3.0",
52
- "googleapis": "^133.0.0",
53
- "pino": "^8.19.0",
54
- "quicktype-core": "^23.0.104",
50
+ "google-auth-library": "^9.10.0",
51
+ "google-gax": "4.3.2",
52
+ "googleapis": "^137.1.0",
53
+ "pino": "^9.1.0",
54
+ "quicktype-core": "^23.0.168",
55
55
  "uuid": "^9.0.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@tsconfig/node18": "^18.2.2",
58
+ "@tsconfig/node20": "^20.1.4",
59
59
  "@types/jest": "^29.5.12",
60
- "@types/node": "^18.19.17",
60
+ "@types/node": "^18.19.33",
61
61
  "@types/uuid": "^9.0.8",
62
- "@typescript-eslint/eslint-plugin": "^7.0.2",
62
+ "@typescript-eslint/eslint-plugin": "^7.10.0",
63
63
  "copyfiles": "^2.4.1",
64
- "eslint": "^8.56.0",
64
+ "eslint": "^8.57.0",
65
65
  "eslint-config-prettier": "^9.1.0",
66
66
  "eslint-plugin-prettier": "^5.1.3",
67
67
  "jest": "^29.7.0",
68
68
  "jest-extended": "^4.0.2",
69
- "rimraf": "^5.0.5",
70
- "ts-jest": "^29.1.2",
69
+ "rimraf": "^5.0.7",
70
+ "ts-jest": "^29.1.3",
71
71
  "ts-node": "^10.9.2",
72
- "typescript": "^5.3.3"
72
+ "typescript": "^5.4.5"
73
73
  }
74
74
  }