@medusajs/file-s3 0.0.3-snapshot-20240718073308 → 0.0.3-snapshot-20240719080828
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"s3-file.d.ts","sourceRoot":"","sources":["../../src/services/s3-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EAET,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACzE,OAAO,EAAE,2BAA2B,EAAe,MAAM,iBAAiB,CAAA;AAI1E,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,UAAU,mBAAmB;IAE3B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7C;AAGD,qBAAa,aAAc,SAAQ,2BAA2B;IAC5D,MAAM,CAAC,UAAU,SAAO;IACxB,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAA;IACtC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAA;gBAEf,EAAE,MAAM,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,oBAAoB;IAmB3E,SAAS,CAAC,SAAS;IAcb,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,qBAAqB,GACpC,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"s3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,CAAC,MAAM,CAAC;CAWnB"}
|
package/dist/services/s3-file.js
CHANGED
@@ -52,13 +52,11 @@ class S3FileService extends utils_1.AbstractFileProviderService {
|
|
52
52
|
const fileKey = `${this.config_.prefix}${parsedFilename.name}-${(0, ulid_1.ulid)()}${parsedFilename.ext}`;
|
53
53
|
const content = Buffer.from(file.content, "binary");
|
54
54
|
const command = new client_s3_1.PutObjectCommand({
|
55
|
-
// TODO: Add support for private files
|
56
55
|
// We probably also want to support a separate bucket altogether for private files
|
57
56
|
// protected private_bucket_: string
|
58
57
|
// protected private_access_key_id_: string
|
59
58
|
// protected private_secret_access_key_: string
|
60
|
-
|
61
|
-
ACL: "public-read",
|
59
|
+
ACL: file.access === "public" ? "public-read" : "private",
|
62
60
|
Bucket: this.config_.bucket,
|
63
61
|
Body: content,
|
64
62
|
Key: fileKey,
|
@@ -108,4 +106,4 @@ class S3FileService extends utils_1.AbstractFileProviderService {
|
|
108
106
|
}
|
109
107
|
exports.S3FileService = S3FileService;
|
110
108
|
S3FileService.identifier = "s3";
|
111
|
-
//# sourceMappingURL=data:application/json;base64,
|
109
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiczMtZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJ2aWNlcy9zMy1maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLGtEQU0yQjtBQUMzQix3RUFBNEQ7QUFFNUQsMkNBQTBFO0FBQzFFLGdEQUF1QjtBQUN2QiwrQkFBMkI7QUFvQjNCLCtGQUErRjtBQUMvRixNQUFhLGFBQWMsU0FBUSxtQ0FBMkI7SUFNNUQsWUFBWSxFQUFFLE1BQU0sRUFBd0IsRUFBRSxPQUE2QjtRQUN6RSxLQUFLLEVBQUUsQ0FBQTtRQUVQLElBQUksQ0FBQyxPQUFPLEdBQUc7WUFDYixPQUFPLEVBQ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ENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQTtRQUN2QixDQUFDO0lBQ0gsQ0FBQztJQUVELEtBQUssQ0FBQyx1QkFBdUIsQ0FDM0IsUUFBc0M7UUFFdEMsdUVBQXVFO1FBQ3ZFLE1BQU0sT0FBTyxHQUFHLElBQUksNEJBQWdCLENBQUM7WUFDbkMsTUFBTSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTTtZQUMzQixHQUFHLEVBQUUsR0FBRyxRQUFRLENBQUMsT0FBTyxFQUFFO1NBQzNCLENBQUMsQ0FBQTtRQUVGLE9BQU8sTUFBTSxJQUFBLG1DQUFZLEVBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUU7WUFDL0MsU0FBUyxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsb0JBQW9CO1NBQzdDLENBQUMsQ0FBQTtJQUNKLENBQUM7O0FBdkhILHNDQXdIQztBQXZIUSx3QkFBVSxHQUFHLElBQUksQ0FBQSJ9
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/file-s3",
|
3
|
-
"version": "0.0.3-snapshot-
|
3
|
+
"version": "0.0.3-snapshot-20240719080828",
|
4
4
|
"description": "S3 protocol file storage for Medusa. Supports any S3-compatible storage provider",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"repository": {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"dependencies": {
|
34
34
|
"@aws-sdk/client-s3": "^3.556.0",
|
35
35
|
"@aws-sdk/s3-request-presigner": "^3.556.0",
|
36
|
-
"@medusajs/utils": "1.12.0-snapshot-
|
36
|
+
"@medusajs/utils": "1.12.0-snapshot-20240719080828",
|
37
37
|
"ulid": "^2.3.0"
|
38
38
|
},
|
39
39
|
"keywords": [
|