@travetto/model-firestore 3.4.5 → 4.0.0-rc.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
@@ -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 { ResourceLoader } from '@travetto/base';
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
- const resources = new ResourceLoader();
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.4.5",
3
+ "version": "4.0.0-rc.0",
4
4
  "description": "Firestore backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -26,12 +26,12 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@google-cloud/firestore": "^7.1.0",
29
- "@travetto/base": "^3.4.2",
30
- "@travetto/config": "^3.4.4",
31
- "@travetto/model": "^3.4.5"
29
+ "@travetto/base": "^4.0.0-rc.0",
30
+ "@travetto/config": "^4.0.0-rc.0",
31
+ "@travetto/model": "^4.0.0-rc.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@travetto/command": "^3.4.3"
34
+ "@travetto/command": "^4.0.0-rc.0"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@travetto/command": {
package/src/config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ResourceLoader } from '@travetto/base';
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
- const resources = new ResourceLoader();
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.onShutdown(this, () => this.client.terminate());
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 = Env.get('FIRESTORE_VERSION', 'latest');
3
+ const version = process.env.FIRESTORE_VERSION || 'latest';
5
4
 
6
5
  export const service: CommandService = {
7
6
  name: 'firestore',