@travetto/model-firestore 3.4.5 → 4.0.0-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.
- package/README.md +2 -3
- package/package.json +6 -6
- package/src/config.ts +2 -3
- package/src/service.ts +1 -1
- package/support/service.firestore.ts +1 -2
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ where the [FirestoreModelConfig](https://github.com/travetto/travetto/tree/main/
|
|
|
39
39
|
|
|
40
40
|
**Code: Structure of FirestoreModelConfig**
|
|
41
41
|
```typescript
|
|
42
|
-
import {
|
|
42
|
+
import { RuntimeResources } from '@travetto/base';
|
|
43
43
|
import { Config } from '@travetto/config';
|
|
44
44
|
|
|
45
45
|
@Config('model.firestore')
|
|
@@ -62,8 +62,7 @@ export class FirestoreModelConfig {
|
|
|
62
62
|
process.env.FIRESTORE_EMULATOR_HOST = this.emulator;
|
|
63
63
|
}
|
|
64
64
|
if (this.credentialsFile && !this.credentials) {
|
|
65
|
-
|
|
66
|
-
this.credentials = JSON.parse(await resources.read(this.credentialsFile));
|
|
65
|
+
this.credentials = JSON.parse(await RuntimeResources.read(this.credentialsFile));
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-firestore",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-rc.1",
|
|
4
4
|
"description": "Firestore backing for the travetto model module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"directory": "module/model-firestore"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@google-cloud/firestore": "^7.
|
|
29
|
-
"@travetto/base": "^
|
|
30
|
-
"@travetto/config": "^
|
|
31
|
-
"@travetto/model": "^
|
|
28
|
+
"@google-cloud/firestore": "^7.3.0",
|
|
29
|
+
"@travetto/base": "^4.0.0-rc.1",
|
|
30
|
+
"@travetto/config": "^4.0.0-rc.1",
|
|
31
|
+
"@travetto/model": "^4.0.0-rc.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@travetto/command": "^
|
|
34
|
+
"@travetto/command": "^4.0.0-rc.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@travetto/command": {
|
package/src/config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeResources } from '@travetto/base';
|
|
2
2
|
import { Config } from '@travetto/config';
|
|
3
3
|
|
|
4
4
|
@Config('model.firestore')
|
|
@@ -21,8 +21,7 @@ export class FirestoreModelConfig {
|
|
|
21
21
|
process.env.FIRESTORE_EMULATOR_HOST = this.emulator;
|
|
22
22
|
}
|
|
23
23
|
if (this.credentialsFile && !this.credentials) {
|
|
24
|
-
|
|
25
|
-
this.credentials = JSON.parse(await resources.read(this.credentialsFile));
|
|
24
|
+
this.credentials = JSON.parse(await RuntimeResources.read(this.credentialsFile));
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
}
|
package/src/service.ts
CHANGED
|
@@ -43,7 +43,7 @@ export class FirestoreModelService implements ModelCrudSupport, ModelStorageSupp
|
|
|
43
43
|
|
|
44
44
|
async postConstruct(): Promise<void> {
|
|
45
45
|
this.client = new Firestore(this.config);
|
|
46
|
-
ShutdownManager.
|
|
46
|
+
ShutdownManager.onGracefulShutdown(() => this.client.terminate(), this);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// Storage
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Env } from '@travetto/base';
|
|
2
1
|
import type { CommandService } from '@travetto/command';
|
|
3
2
|
|
|
4
|
-
const version =
|
|
3
|
+
const version = process.env.FIRESTORE_VERSION || 'latest';
|
|
5
4
|
|
|
6
5
|
export const service: CommandService = {
|
|
7
6
|
name: 'firestore',
|