@travetto/model-dynamodb 3.0.0-rc.4 → 3.0.0-rc.7

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
@@ -1,5 +1,5 @@
1
1
  <!-- This file was generated by @travetto/doc and should not be modified directly -->
2
- <!-- Please modify https://github.com/travetto/travetto/tree/main/module/model-dynamodb/doc.ts and execute "npx trv doc" to rebuild -->
2
+ <!-- Please modify https://github.com/travetto/travetto/tree/main/module/model-dynamodb/DOC.ts and execute "npx trv doc" to rebuild -->
3
3
  # DynamoDB Model Support
4
4
  ## DynamoDB backing for the travetto model module.
5
5
 
@@ -39,7 +39,7 @@ export class Init {
39
39
 
40
40
  **Code: Structure of DynamoDBModelConfig**
41
41
  ```typescript
42
- import * as dynamodb from '@aws-sdk/client-dynamodb';
42
+ import type * as dynamodb from '@aws-sdk/client-dynamodb';
43
43
 
44
44
  import { Config } from '@travetto/config';
45
45
  import { Field } from '@travetto/schema';
@@ -55,5 +55,5 @@ export class DynamoDBModelConfig {
55
55
  }
56
56
  ```
57
57
 
58
- Additionally, you can see that the class is registered with the [@Config](https://github.com/travetto/travetto/tree/main/module/config/src/decorator.ts#L9) annotation, and so these values can be overridden using the
59
- standard [Configuration](https://github.com/travetto/travetto/tree/main/module/config#readme "Environment-aware config management using yaml files")resolution paths.
58
+ Additionally, you can see that the class is registered with the [@Config](https://github.com/travetto/travetto/tree/main/module/config/src/decorator.ts#L13) annotation, and so these values can be overridden using the
59
+ standard [Configuration](https://github.com/travetto/travetto/tree/main/module/config#readme "Configuration support")resolution paths.
File without changes
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-dynamodb",
3
- "displayName": "DynamoDB Model Support",
4
- "version": "3.0.0-rc.4",
3
+ "version": "3.0.0-rc.7",
5
4
  "description": "DynamoDB backing for the travetto model module.",
6
5
  "keywords": [
7
6
  "typescript",
@@ -16,19 +15,30 @@
16
15
  "name": "Travetto Framework"
17
16
  },
18
17
  "files": [
19
- "index.ts",
18
+ "__index__.ts",
20
19
  "src",
21
20
  "support"
22
21
  ],
23
- "main": "index.ts",
22
+ "main": "__index__.ts",
24
23
  "repository": {
25
24
  "url": "https://github.com/travetto/travetto.git",
26
25
  "directory": "module/model-dynamodb"
27
26
  },
28
27
  "dependencies": {
29
- "@aws-sdk/client-dynamodb": "^3.160.0",
30
- "@travetto/config": "^3.0.0-rc.4",
31
- "@travetto/model": "^3.0.0-rc.4"
28
+ "@aws-sdk/client-dynamodb": "^3.245.0",
29
+ "@travetto/config": "^3.0.0-rc.7",
30
+ "@travetto/model": "^3.0.0-rc.7"
31
+ },
32
+ "peerDependencies": {
33
+ "@travetto/command": "^3.0.0-rc.5"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "@travetto/command": {
37
+ "optional": true
38
+ }
39
+ },
40
+ "travetto": {
41
+ "displayName": "DynamoDB Model Support"
32
42
  },
33
43
  "publishConfig": {
34
44
  "access": "public"
package/src/config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as dynamodb from '@aws-sdk/client-dynamodb';
1
+ import type * as dynamodb from '@aws-sdk/client-dynamodb';
2
2
 
3
3
  import { Config } from '@travetto/config';
4
4
  import { Field } from '@travetto/schema';
package/src/service.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as dynamodb from '@aws-sdk/client-dynamodb';
2
2
 
3
- import { Class, ShutdownManager, Util } from '@travetto/base';
3
+ import { ShutdownManager, type Class } from '@travetto/base';
4
4
  import { DeepPartial } from '@travetto/schema';
5
5
  import { Injectable } from '@travetto/di';
6
6
  import {
@@ -13,6 +13,7 @@ import { ModelCrudUtil } from '@travetto/model/src/internal/service/crud';
13
13
  import { ModelExpiryUtil } from '@travetto/model/src/internal/service/expiry';
14
14
  import { ModelIndexedUtil } from '@travetto/model/src/internal/service/indexed';
15
15
  import { ModelStorageUtil } from '@travetto/model/src/internal/service/storage';
16
+ import { ModelUtil } from '@travetto/model/src/internal/util';
16
17
 
17
18
  import { DynamoDBModelConfig } from './config';
18
19
 
@@ -186,7 +187,7 @@ export class DynamoDBModelService implements ModelCrudSupport, ModelExpirySuppor
186
187
  async postConstruct(): Promise<void> {
187
188
  this.client = new dynamodb.DynamoDB({ ...this.config.client });
188
189
  await ModelStorageUtil.registerModelChangeListener(this);
189
- ShutdownManager.onShutdown(this.constructor.ᚕid, () => this.client.destroy());
190
+ ShutdownManager.onShutdown(this, () => this.client.destroy());
190
191
  }
191
192
 
192
193
  // Storage
@@ -269,7 +270,7 @@ export class DynamoDBModelService implements ModelCrudSupport, ModelExpirySuppor
269
270
 
270
271
  // Crud
271
272
  uuid(): string {
272
- return Util.uuid();
273
+ return ModelUtil.uuid();
273
274
  }
274
275
 
275
276
  async get<T extends ModelType>(cls: Class<T>, id: string): Promise<T> {
@@ -1,7 +1,7 @@
1
- import { EnvUtil } from '@travetto/boot';
2
- import type { Service } from '@travetto/command/bin/lib/service';
1
+ import { Env } from '@travetto/base';
2
+ import type { Service } from '@travetto/command/support/bin/service';
3
3
 
4
- const version = EnvUtil.get('TRV_SERVICE_DYNAMODB', '1.15.0');
4
+ const version = Env.get('DYNAMODB_VERSION', '1.15.0');
5
5
 
6
6
  export const service: Service = {
7
7
  name: 'dynamodb',