@medusajs/file-local-next 0.0.3-snapshot-20240704130951 → 0.0.3-snapshot-20240711051411
Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAKvD,QAAA,MAAM,cAAc,EAAE,qBAErB,CAAA;AAED,eAAe,cAAc,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"local-file.d.ts","sourceRoot":"","sources":["../../src/services/local-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,2BAA2B,EAAe,MAAM,iBAAiB,CAAA;AAI1E,qBAAa,gBAAiB,SAAQ,2BAA2B;IAC/D,MAAM,CAAC,UAAU,SAAY;IAC7B,SAAS,CAAC,UAAU,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,WAAW,EAAE,MAAM,CAAA;gBAEjB,CAAC,KAAA,EAAE,OAAO,EAAE,uBAAuB;IAMzC,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,qBAAqB,GACpC,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC;IAgCrC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY5D,uBAAuB,CAC3B,QAAQ,EAAE,SAAS,CAAC,kBAAkB,GACrC,OAAO,CAAC,MAAM,CAAC;IAgBlB,OAAO,CAAC,iBAAiB,CAExB;IAED,OAAO,CAAC,gBAAgB,CAIvB;YAEa,eAAe;CAQ9B"}
|
@@ -14,10 +14,12 @@ class LocalFileService extends utils_1.AbstractFileProviderService {
|
|
14
14
|
return path_1.default.join(this.uploadDir_, fileKey);
|
15
15
|
};
|
16
16
|
this.getUploadFileUrl = (fileKey) => {
|
17
|
-
|
17
|
+
const baseUrl = new URL(this.backendUrl_);
|
18
|
+
baseUrl.pathname = path_1.default.join(baseUrl.pathname, fileKey);
|
19
|
+
return baseUrl.href;
|
18
20
|
};
|
19
|
-
this.uploadDir_ = options?.upload_dir || path_1.default.join(
|
20
|
-
this.backendUrl_ = options?.backend_url || "http://localhost:9000";
|
21
|
+
this.uploadDir_ = options?.upload_dir || path_1.default.join(process.cwd(), "static");
|
22
|
+
this.backendUrl_ = options?.backend_url || "http://localhost:9000/static";
|
21
23
|
}
|
22
24
|
async upload(file) {
|
23
25
|
if (!file) {
|
@@ -70,4 +72,4 @@ class LocalFileService extends utils_1.AbstractFileProviderService {
|
|
70
72
|
}
|
71
73
|
exports.LocalFileService = LocalFileService;
|
72
74
|
LocalFileService.identifier = "localfs";
|
73
|
-
//# sourceMappingURL=data:application/json;base64,
|
75
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJ2aWNlcy9sb2NhbC1maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUNBLDJDQUEwRTtBQUMxRSwyREFBNEI7QUFDNUIsZ0RBQXVCO0FBRXZCLE1BQWEsZ0JBQWlCLFNBQVEsbUNBQTJCO0lBSy9ELFlBQVksQ0FBQyxFQUFFLE9BQWdDO1FBQzdDLEtBQUssRUFBRSxDQUFBO1FBcUVELHNCQUFpQixHQUFHLENBQUMsT0FBZSxFQUFFLEVBQUU7WUFDOUMsT0FBTyxjQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsT0FBTyxDQUFDLENBQUE7UUFDNUMsQ0FBQyxDQUFBO1FBRU8scUJBQWdCLEdBQUcsQ0FBQyxPQUFlLEVBQUUsRUFBRTtZQUM3QyxNQUFNLE9BQU8sR0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4
|
"description": "Local filesystem file storage for Medusa",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"repository": {
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"typescript": "^5.3.3"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@medusajs/utils": "1.12.0-snapshot-
|
32
|
+
"@medusajs/utils": "1.12.0-snapshot-20240711051411"
|
33
33
|
},
|
34
34
|
"keywords": [
|
35
35
|
"medusa-plugin",
|