@naturalcycles/datastore-lib 3.18.1 → 3.18.2

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.
@@ -36,7 +36,12 @@ class DatastoreDB extends db_lib_1.BaseCommonDB {
36
36
  const DS = datastoreLib.Datastore;
37
37
  (_a = this.cfg).projectId || (_a.projectId = this.cfg.credentials?.project_id || process.env['GOOGLE_CLOUD_PROJECT']);
38
38
  (0, js_lib_1._assert)(this.cfg.projectId, '"projectId" is not set for DatastoreDB');
39
- this.cfg.logger.log(`DatastoreDB connected to ${(0, colors_1.boldWhite)(this.cfg.projectId)}`);
39
+ if (this.cfg.projectId) {
40
+ this.cfg.logger.log(`DatastoreDB connected to ${(0, colors_1.boldWhite)(this.cfg.projectId)}`);
41
+ }
42
+ else if (process.env['GOOGLE_APPLICATION_CREDENTIALS']) {
43
+ this.cfg.logger.log(`DatastoreDB connected via GOOGLE_APPLICATION_CREDENTIALS`);
44
+ }
40
45
  if (this.cfg.useLegacyGRPC) {
41
46
  this.cfg.grpc = require('grpc');
42
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/datastore-lib",
3
- "version": "3.18.1",
3
+ "version": "3.18.2",
4
4
  "description": "Opinionated library to work with Google Datastore",
5
5
  "scripts": {
6
6
  "prepare": "husky install"
@@ -86,7 +86,11 @@ export class DatastoreDB extends BaseCommonDB implements CommonDB {
86
86
 
87
87
  _assert(this.cfg.projectId, '"projectId" is not set for DatastoreDB')
88
88
 
89
- this.cfg.logger.log(`DatastoreDB connected to ${boldWhite(this.cfg.projectId)}`)
89
+ if (this.cfg.projectId) {
90
+ this.cfg.logger.log(`DatastoreDB connected to ${boldWhite(this.cfg.projectId)}`)
91
+ } else if (process.env['GOOGLE_APPLICATION_CREDENTIALS']) {
92
+ this.cfg.logger.log(`DatastoreDB connected via GOOGLE_APPLICATION_CREDENTIALS`)
93
+ }
90
94
 
91
95
  if (this.cfg.useLegacyGRPC) {
92
96
  this.cfg.grpc = require('grpc')