@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.
- package/dist/datastore.db.js +6 -1
- package/package.json +1 -1
- package/src/datastore.db.ts +5 -1
package/dist/datastore.db.js
CHANGED
|
@@ -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
|
-
|
|
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
package/src/datastore.db.ts
CHANGED
|
@@ -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
|
-
|
|
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')
|