@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
@@ -1,3 +1,4 @@
1
1
  import { ModuleProviderExports } from "@medusajs/types";
2
2
  declare const providerExport: ModuleProviderExports;
3
3
  export default providerExport;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -12,3 +12,4 @@ export declare class LocalFileService extends AbstractFileProviderService {
12
12
  private getUploadFileUrl;
13
13
  private ensureDirExists;
14
14
  }
15
+ //# sourceMappingURL=local-file.d.ts.map
@@ -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
- return path_1.default.join(this.backendUrl_, this.getUploadFilePath(fileKey));
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(__dirname, "uploads");
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJ2aWNlcy9sb2NhbC1maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUNBLDJDQUEwRTtBQUMxRSwyREFBNEI7QUFDNUIsZ0RBQXVCO0FBRXZCLE1BQWEsZ0JBQWlCLFNBQVEsbUNBQTJCO0lBSy9ELFlBQVksQ0FBQyxFQUFFLE9BQWdDO1FBQzdDLEtBQUssRUFBRSxDQUFBO1FBcUVELHNCQUFpQixHQUFHLENBQUMsT0FBZSxFQUFFLEVBQUU7WUFDOUMsT0FBTyxjQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ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ILE1BQU0sa0JBQUUsQ0FBQyxNQUFNLENBQUMsWUFBWSxFQUFFLGtCQUFFLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxDQUFBO1FBQ2xELENBQUM7UUFBQyxPQUFPLENBQUMsRUFBRSxDQUFDO1lBQ1gsTUFBTSxrQkFBRSxDQUFDLEtBQUssQ0FBQyxZQUFZLEVBQUUsRUFBRSxTQUFTLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQTtRQUNuRCxDQUFDO0lBQ0gsQ0FBQzs7QUE1RkgsNENBNkZDO0FBNUZRLDJCQUFVLEdBQUcsU0FBUyxBQUFaLENBQVkifQ==
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/file-local-next",
3
- "version": "0.0.3-snapshot-20240704130951",
3
+ "version": "0.0.3-snapshot-20240711051411",
4
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-20240704130951"
32
+ "@medusajs/utils": "1.12.0-snapshot-20240711051411"
33
33
  },
34
34
  "keywords": [
35
35
  "medusa-plugin",