@travetto/model-s3 3.1.4 → 3.1.6
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 +7 -1
- package/package.json +3 -3
- package/src/service.ts +4 -0
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ export class Init {
|
|
|
36
36
|
}
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
where the [S3ModelConfig](https://github.com/travetto/travetto/tree/main/module/model-s3/src/config.ts#
|
|
39
|
+
where the [S3ModelConfig](https://github.com/travetto/travetto/tree/main/module/model-s3/src/config.ts#L12) is defined by:
|
|
40
40
|
|
|
41
41
|
**Code: Structure of S3ModelConfig**
|
|
42
42
|
```typescript
|
|
@@ -45,6 +45,7 @@ import type s3 from '@aws-sdk/client-s3';
|
|
|
45
45
|
|
|
46
46
|
import { Config, EnvVar } from '@travetto/config';
|
|
47
47
|
import { Field, Required } from '@travetto/schema';
|
|
48
|
+
import { GlobalEnv } from '@travetto/base';
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* S3 Support as an Asset Source
|
|
@@ -97,6 +98,11 @@ export class S3ModelConfig {
|
|
|
97
98
|
secretAccessKey: this.secretAccessKey
|
|
98
99
|
}
|
|
99
100
|
};
|
|
101
|
+
|
|
102
|
+
// We are in localhost and not in prod, turn on forcePathStyle
|
|
103
|
+
if (!GlobalEnv.prod && this.endpoint.includes('localhost')) {
|
|
104
|
+
this.config.forcePathStyle ??= true;
|
|
105
|
+
}
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
108
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-s3",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "S3 backing for the travetto model module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"s3",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"@aws-sdk/client-s3": "^3.272.0",
|
|
29
29
|
"@aws-sdk/credential-provider-ini": "^3.218.0",
|
|
30
30
|
"@travetto/config": "^3.1.2",
|
|
31
|
-
"@travetto/model": "^3.1.
|
|
31
|
+
"@travetto/model": "^3.1.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@travetto/command": "^3.1.
|
|
34
|
+
"@travetto/command": "^3.1.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@travetto/command": {
|
package/src/service.ts
CHANGED
|
@@ -93,6 +93,10 @@ export class S3ModelService implements ModelCrudSupport, ModelStreamSupport, Mod
|
|
|
93
93
|
const { UploadId } = await this.client.createMultipartUpload(this.#q(STREAM_SPACE, id, {
|
|
94
94
|
ContentType: meta.contentType,
|
|
95
95
|
ContentLength: meta.size,
|
|
96
|
+
Metadata: {
|
|
97
|
+
...meta,
|
|
98
|
+
size: `${meta.size}`
|
|
99
|
+
}
|
|
96
100
|
}));
|
|
97
101
|
|
|
98
102
|
const parts: s3.CompletedPart[] = [];
|