@travetto/model-s3 3.0.0-rc.9 → 3.0.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
@@ -6,6 +6,10 @@
6
6
  **Install: @travetto/model-s3**
7
7
  ```bash
8
8
  npm install @travetto/model-s3
9
+
10
+ # or
11
+
12
+ yarn add @travetto/model-s3
9
13
  ```
10
14
 
11
15
  This module provides an [s3](https://aws.amazon.com/documentation/s3/)-based implementation for the [Data Modeling Support](https://github.com/travetto/travetto/tree/main/module/model#readme "Datastore abstraction for core operations."). This source allows the [Data Modeling Support](https://github.com/travetto/travetto/tree/main/module/model#readme "Datastore abstraction for core operations.") module to read, write and stream against [s3](https://aws.amazon.com/documentation/s3/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-s3",
3
- "version": "3.0.0-rc.9",
3
+ "version": "3.0.0",
4
4
  "description": "S3 backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "s3",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "files": [
18
18
  "__index__.ts",
19
+ "support",
19
20
  "src"
20
21
  ],
21
22
  "main": "__index__.ts",
@@ -24,13 +25,13 @@
24
25
  "directory": "module/model-s3"
25
26
  },
26
27
  "dependencies": {
27
- "@aws-sdk/client-s3": "^3.245.0",
28
+ "@aws-sdk/client-s3": "^3.272.0",
28
29
  "@aws-sdk/credential-provider-ini": "^3.218.0",
29
- "@travetto/config": "^3.0.0-rc.9",
30
- "@travetto/model": "^3.0.0-rc.9"
30
+ "@travetto/config": "^3.0.0",
31
+ "@travetto/model": "^3.0.0"
31
32
  },
32
33
  "peerDependencies": {
33
- "@travetto/command": "^3.0.0-rc.7"
34
+ "@travetto/command": "^3.0.0"
34
35
  },
35
36
  "peerDependenciesMeta": {
36
37
  "@travetto/command": {
package/src/service.ts CHANGED
@@ -13,6 +13,7 @@ import { StreamUtil, Class, AppError } from '@travetto/base';
13
13
  import { ModelCrudUtil } from '@travetto/model/src/internal/service/crud';
14
14
  import { ModelExpirySupport } from '@travetto/model/src/service/expiry';
15
15
  import { ModelExpiryUtil } from '@travetto/model/src/internal/service/expiry';
16
+ import { ModelStorageUtil } from '@travetto/model/src/internal/service/storage';
16
17
  import { ModelUtil } from '@travetto/model/src/internal/util';
17
18
 
18
19
  import { S3ModelConfig } from './config';
@@ -152,6 +153,7 @@ export class S3ModelService implements ModelCrudSupport, ModelStreamSupport, Mod
152
153
 
153
154
  async postConstruct(): Promise<void> {
154
155
  this.client = new s3.S3(this.config.config);
156
+ ModelStorageUtil.registerModelChangeListener(this);
155
157
  }
156
158
 
157
159
  async head<T extends ModelType>(cls: Class<T>, id: string): Promise<boolean> {
@@ -0,0 +1,28 @@
1
+ import { mkdirSync } from 'fs';
2
+ import os from 'os';
3
+
4
+ import type { CommandService } from '@travetto/command';
5
+
6
+ const temp = `${os.tmpdir()}/local-stack`;
7
+ try {
8
+ mkdirSync(temp);
9
+ } catch { }
10
+
11
+ const version = 'latest';
12
+
13
+ export const service: CommandService = {
14
+ name: 's3',
15
+ version,
16
+ privileged: true,
17
+ env: {
18
+ TEST_AWS_ACCOUNT_ID: '000000000000',
19
+ LOCALSTACK_HOSTNAME: 'localhost',
20
+ DEFAULT_REGION: 'us-east-1',
21
+ HOST_TMP_FOLDER: temp
22
+ },
23
+ volumes: {
24
+ [temp]: '/tmp/localstack'
25
+ },
26
+ ports: { 4566: 4566, 4571: 4571, 8080: 8080, 8081: 8081 },
27
+ image: `localstack/localstack:${version}`
28
+ };