@travetto/model-s3 7.0.0-rc.2 → 7.0.0-rc.4

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
@@ -60,7 +60,7 @@ export class S3ModelConfig {
60
60
 
61
61
  chunkSize = 5 * 2 ** 20; // Chunk size in bytes
62
62
 
63
- autoCreate?: boolean;
63
+ modifyStorage?: boolean;
64
64
 
65
65
  /**
66
66
  * Provide host to bucket
@@ -73,6 +73,13 @@ export class S3ModelConfig {
73
73
  * Produces the s3 config from the provide details, post construction
74
74
  */
75
75
  async postConstruct(): Promise<void> {
76
+ if (!Runtime.production) {
77
+ this.endpoint ??= 'http://localhost:4566'; // From docker
78
+ if (this.endpoint.includes('localhost')) {
79
+ this.config.forcePathStyle ??= true;
80
+ }
81
+ }
82
+
76
83
  if (!this.accessKeyId && !this.secretAccessKey) {
77
84
  const creds = await fromIni({ profile: this.profile })();
78
85
  this.accessKeyId = creds.accessKeyId;
@@ -88,11 +95,6 @@ export class S3ModelConfig {
88
95
  secretAccessKey: this.secretAccessKey
89
96
  }
90
97
  };
91
-
92
- // We are in localhost and not in prod, turn on forcePathStyle
93
- if (!Runtime.production && this.endpoint.includes('localhost')) {
94
- this.config.forcePathStyle ??= true;
95
- }
96
98
  }
97
99
  }
98
100
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-s3",
3
- "version": "7.0.0-rc.2",
3
+ "version": "7.0.0-rc.4",
4
4
  "description": "S3 backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "s3",
@@ -28,9 +28,9 @@
28
28
  "@aws-sdk/client-s3": "^3.940.0",
29
29
  "@aws-sdk/credential-provider-ini": "^3.940.0",
30
30
  "@aws-sdk/s3-request-presigner": "^3.940.0",
31
- "@travetto/cli": "^7.0.0-rc.2",
32
- "@travetto/config": "^7.0.0-rc.2",
33
- "@travetto/model": "^7.0.0-rc.2"
31
+ "@travetto/cli": "^7.0.0-rc.4",
32
+ "@travetto/config": "^7.0.0-rc.4",
33
+ "@travetto/model": "^7.0.0-rc.4"
34
34
  },
35
35
  "travetto": {
36
36
  "displayName": "S3 Model Support"
package/src/config.ts CHANGED
@@ -27,7 +27,7 @@ export class S3ModelConfig {
27
27
 
28
28
  chunkSize = 5 * 2 ** 20; // Chunk size in bytes
29
29
 
30
- autoCreate?: boolean;
30
+ modifyStorage?: boolean;
31
31
 
32
32
  /**
33
33
  * Provide host to bucket
@@ -40,6 +40,13 @@ export class S3ModelConfig {
40
40
  * Produces the s3 config from the provide details, post construction
41
41
  */
42
42
  async postConstruct(): Promise<void> {
43
+ if (!Runtime.production) {
44
+ this.endpoint ??= 'http://localhost:4566'; // From docker
45
+ if (this.endpoint.includes('localhost')) {
46
+ this.config.forcePathStyle ??= true;
47
+ }
48
+ }
49
+
43
50
  if (!this.accessKeyId && !this.secretAccessKey) {
44
51
  const creds = await fromIni({ profile: this.profile })();
45
52
  this.accessKeyId = creds.accessKeyId;
@@ -55,10 +62,5 @@ export class S3ModelConfig {
55
62
  secretAccessKey: this.secretAccessKey
56
63
  }
57
64
  };
58
-
59
- // We are in localhost and not in prod, turn on forcePathStyle
60
- if (!Runtime.production && this.endpoint.includes('localhost')) {
61
- this.config.forcePathStyle ??= true;
62
- }
63
65
  }
64
66
  }
package/src/service.ts CHANGED
@@ -190,7 +190,7 @@ export class S3ModelService implements ModelCrudSupport, ModelBlobSupport, Model
190
190
  }),
191
191
  } : {})
192
192
  });
193
- ModelStorageUtil.registerModelChangeListener(this);
193
+ ModelStorageUtil.storageInitialization(this);
194
194
  }
195
195
 
196
196
  async head<T extends ModelType>(cls: Class<T>, id: string): Promise<boolean> {