@medusajs/file-local-next 0.0.3 → 1.0.0-rc-20241003153304
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -0
- package/dist/services/local-file.d.ts +5 -3
- package/dist/services/local-file.d.ts.map +1 -0
- package/dist/services/local-file.js +82 -169
- package/dist/services/local-file.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +14 -10
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,2BAA2B,CAAA;AAKjE,QAAA,MAAM,cAAc,EAAE,qBAErB,CAAA;AAED,eAAe,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
services
|
3
|
+
const local_file_1 = require("./services/local-file");
|
4
|
+
const services = [local_file_1.LocalFileService];
|
5
|
+
const providerExport = {
|
6
|
+
services,
|
7
7
|
};
|
8
8
|
exports.default = providerExport;
|
9
|
-
//# sourceMappingURL=
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,sDAAwD;AAExD,MAAM,QAAQ,GAAG,CAAC,6BAAgB,CAAC,CAAA;AAEnC,MAAM,cAAc,GAA0B;IAC5C,QAAQ;CACT,CAAA;AAED,kBAAe,cAAc,CAAA"}
|
@@ -1,14 +1,16 @@
|
|
1
|
-
import { FileTypes, LocalFileServiceOptions } from "@medusajs/types";
|
2
|
-
import { AbstractFileProviderService } from "@medusajs/utils";
|
1
|
+
import { FileTypes, LocalFileServiceOptions } from "@medusajs/framework/types";
|
2
|
+
import { AbstractFileProviderService } from "@medusajs/framework/utils";
|
3
3
|
export declare class LocalFileService extends AbstractFileProviderService {
|
4
4
|
static identifier: string;
|
5
5
|
protected uploadDir_: string;
|
6
|
+
protected privateUploadDir_: string;
|
6
7
|
protected backendUrl_: string;
|
7
8
|
constructor(_: any, options: LocalFileServiceOptions);
|
8
9
|
upload(file: FileTypes.ProviderUploadFileDTO): Promise<FileTypes.ProviderFileResultDTO>;
|
9
10
|
delete(file: FileTypes.ProviderDeleteFileDTO): Promise<void>;
|
10
|
-
getPresignedDownloadUrl(
|
11
|
+
getPresignedDownloadUrl(file: FileTypes.ProviderGetFileDTO): Promise<string>;
|
11
12
|
private getUploadFilePath;
|
12
13
|
private getUploadFileUrl;
|
13
14
|
private ensureDirExists;
|
14
15
|
}
|
16
|
+
//# 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,2BAA2B,CAAA;AAC9E,OAAO,EACL,2BAA2B,EAE5B,MAAM,2BAA2B,CAAA;AAIlC,qBAAa,gBAAiB,SAAQ,2BAA2B;IAC/D,MAAM,CAAC,UAAU,SAAY;IAC7B,SAAS,CAAC,UAAU,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAA;IACnC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAA;gBAEjB,CAAC,KAAA,EAAE,OAAO,EAAE,uBAAuB;IAazC,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,qBAAqB,GACpC,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC;IAqCrC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB5D,uBAAuB,CAC3B,IAAI,EAAE,SAAS,CAAC,kBAAkB,GACjC,OAAO,CAAC,MAAM,CAAC;IAkBlB,OAAO,CAAC,iBAAiB,CAExB;IAED,OAAO,CAAC,gBAAgB,CAIvB;YAEa,eAAe;CAU9B"}
|
@@ -1,179 +1,92 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
3
|
-
var extendStatics = function (d, b) {
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
-
return extendStatics(d, b);
|
8
|
-
};
|
9
|
-
return function (d, b) {
|
10
|
-
if (typeof b !== "function" && b !== null)
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
-
extendStatics(d, b);
|
13
|
-
function __() { this.constructor = d; }
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
-
};
|
16
|
-
})();
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
24
|
-
});
|
25
|
-
};
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
30
|
-
function step(op) {
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
35
|
-
switch (op[0]) {
|
36
|
-
case 0: case 1: t = op; break;
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
40
|
-
default:
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
45
|
-
if (t[2]) _.ops.pop();
|
46
|
-
_.trys.pop(); continue;
|
47
|
-
}
|
48
|
-
op = body.call(thisArg, _);
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
51
|
-
}
|
52
|
-
};
|
53
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
54
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
55
4
|
};
|
56
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
57
6
|
exports.LocalFileService = void 0;
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
7
|
+
const utils_1 = require("@medusajs/framework/utils");
|
8
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
9
|
+
const path_1 = __importDefault(require("path"));
|
10
|
+
class LocalFileService extends utils_1.AbstractFileProviderService {
|
11
|
+
constructor(_, options) {
|
12
|
+
super();
|
13
|
+
this.getUploadFilePath = (baseDir, fileKey) => {
|
14
|
+
return path_1.default.join(baseDir, fileKey);
|
15
|
+
};
|
16
|
+
this.getUploadFileUrl = (fileKey) => {
|
17
|
+
const baseUrl = new URL(this.backendUrl_);
|
18
|
+
baseUrl.pathname = path_1.default.join(baseUrl.pathname, fileKey);
|
19
|
+
return baseUrl.href;
|
67
20
|
};
|
68
|
-
|
69
|
-
|
21
|
+
this.uploadDir_ = options?.upload_dir || path_1.default.join(process.cwd(), "static");
|
22
|
+
// Since there is no way to serve private files through a static server, we simply place them in `static`.
|
23
|
+
// This means that the files will be available publicly if the filename is known. Since the local file provider
|
24
|
+
// is for development only, this shouldn't be an issue. If you really want to use it in production (and you shouldn't)
|
25
|
+
// You can change the private upload dir to `/private` but none of the functionalities where you use a presigned URL will work.
|
26
|
+
this.privateUploadDir_ =
|
27
|
+
options?.private_upload_dir || path_1.default.join(process.cwd(), "static");
|
28
|
+
this.backendUrl_ = options?.backend_url || "http://localhost:9000/static";
|
29
|
+
}
|
30
|
+
async upload(file) {
|
31
|
+
if (!file) {
|
32
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `No file provided`);
|
33
|
+
}
|
34
|
+
if (!file.filename) {
|
35
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `No filename provided`);
|
36
|
+
}
|
37
|
+
const parsedFilename = path_1.default.parse(file.filename);
|
38
|
+
const baseDir = file.access === "public" ? this.uploadDir_ : this.privateUploadDir_;
|
39
|
+
await this.ensureDirExists(baseDir, parsedFilename.dir);
|
40
|
+
const fileKey = path_1.default.join(parsedFilename.dir,
|
41
|
+
// We prepend "private" to the file key so deletions and presigned URLs can know which folder to look into
|
42
|
+
`${file.access === "public" ? "" : "private-"}${Date.now()}-${parsedFilename.base}`);
|
43
|
+
const filePath = this.getUploadFilePath(baseDir, fileKey);
|
44
|
+
const fileUrl = this.getUploadFileUrl(fileKey);
|
45
|
+
const content = Buffer.from(file.content, "binary");
|
46
|
+
await promises_1.default.writeFile(filePath, content);
|
47
|
+
return {
|
48
|
+
key: fileKey,
|
49
|
+
url: fileUrl,
|
70
50
|
};
|
71
|
-
_this.uploadDir_ = (options === null || options === void 0 ? void 0 : options.upload_dir) || "uploads";
|
72
|
-
_this.backendUrl_ = (options === null || options === void 0 ? void 0 : options.backend_url) || "http://localhost:9000";
|
73
|
-
return _this;
|
74
51
|
}
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
_a.label = 1;
|
114
|
-
case 1:
|
115
|
-
_a.trys.push([1, 4, , 5]);
|
116
|
-
return [4 /*yield*/, promises_1.default.access(filePath, promises_1.default.constants.F_OK)];
|
117
|
-
case 2:
|
118
|
-
_a.sent();
|
119
|
-
return [4 /*yield*/, promises_1.default.unlink(filePath)];
|
120
|
-
case 3:
|
121
|
-
_a.sent();
|
122
|
-
return [3 /*break*/, 5];
|
123
|
-
case 4:
|
124
|
-
e_1 = _a.sent();
|
125
|
-
return [3 /*break*/, 5];
|
126
|
-
case 5: return [2 /*return*/];
|
127
|
-
}
|
128
|
-
});
|
129
|
-
});
|
130
|
-
};
|
131
|
-
LocalFileService.prototype.getPresignedDownloadUrl = function (fileData) {
|
132
|
-
return __awaiter(this, void 0, void 0, function () {
|
133
|
-
var _a;
|
134
|
-
return __generator(this, function (_b) {
|
135
|
-
switch (_b.label) {
|
136
|
-
case 0:
|
137
|
-
_b.trys.push([0, 2, , 3]);
|
138
|
-
return [4 /*yield*/, promises_1.default.access(this.getUploadFilePath(fileData.fileKey), promises_1.default.constants.F_OK)];
|
139
|
-
case 1:
|
140
|
-
_b.sent();
|
141
|
-
return [3 /*break*/, 3];
|
142
|
-
case 2:
|
143
|
-
_a = _b.sent();
|
144
|
-
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, "File with key ".concat(fileData.fileKey, " not found"));
|
145
|
-
case 3: return [2 /*return*/, this.getUploadFileUrl(fileData.fileKey)];
|
146
|
-
}
|
147
|
-
});
|
148
|
-
});
|
149
|
-
};
|
150
|
-
LocalFileService.prototype.ensureDirExists = function (dirPath) {
|
151
|
-
return __awaiter(this, void 0, void 0, function () {
|
152
|
-
var relativePath, e_2;
|
153
|
-
return __generator(this, function (_a) {
|
154
|
-
switch (_a.label) {
|
155
|
-
case 0:
|
156
|
-
relativePath = path_1.default.join(this.uploadDir_, dirPath);
|
157
|
-
_a.label = 1;
|
158
|
-
case 1:
|
159
|
-
_a.trys.push([1, 3, , 5]);
|
160
|
-
return [4 /*yield*/, promises_1.default.access(relativePath, promises_1.default.constants.F_OK)];
|
161
|
-
case 2:
|
162
|
-
_a.sent();
|
163
|
-
return [3 /*break*/, 5];
|
164
|
-
case 3:
|
165
|
-
e_2 = _a.sent();
|
166
|
-
return [4 /*yield*/, promises_1.default.mkdir(relativePath, { recursive: true })];
|
167
|
-
case 4:
|
168
|
-
_a.sent();
|
169
|
-
return [3 /*break*/, 5];
|
170
|
-
case 5: return [2 /*return*/];
|
171
|
-
}
|
172
|
-
});
|
173
|
-
});
|
174
|
-
};
|
175
|
-
LocalFileService.identifier = "localfs";
|
176
|
-
return LocalFileService;
|
177
|
-
}(utils_1.AbstractFileProviderService));
|
52
|
+
async delete(file) {
|
53
|
+
const baseDir = file.fileKey.startsWith("private-")
|
54
|
+
? this.privateUploadDir_
|
55
|
+
: this.uploadDir_;
|
56
|
+
const filePath = this.getUploadFilePath(baseDir, file.fileKey);
|
57
|
+
try {
|
58
|
+
await promises_1.default.access(filePath, promises_1.default.constants.F_OK);
|
59
|
+
await promises_1.default.unlink(filePath);
|
60
|
+
}
|
61
|
+
catch (e) {
|
62
|
+
// The file does not exist, so it's a noop.
|
63
|
+
}
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
// The local file provider doesn't support presigned URLs for private files (i.e files not placed in /static).
|
67
|
+
async getPresignedDownloadUrl(file) {
|
68
|
+
const isPrivate = file.fileKey.startsWith("private-");
|
69
|
+
const baseDir = isPrivate ? this.privateUploadDir_ : this.uploadDir_;
|
70
|
+
const filePath = this.getUploadFilePath(baseDir, file.fileKey);
|
71
|
+
try {
|
72
|
+
await promises_1.default.access(filePath, promises_1.default.constants.F_OK);
|
73
|
+
}
|
74
|
+
catch {
|
75
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `File with key ${file.fileKey} not found`);
|
76
|
+
}
|
77
|
+
return this.getUploadFileUrl(file.fileKey);
|
78
|
+
}
|
79
|
+
async ensureDirExists(baseDir, dirPath) {
|
80
|
+
const relativePath = path_1.default.join(baseDir, dirPath);
|
81
|
+
try {
|
82
|
+
await promises_1.default.access(relativePath, promises_1.default.constants.F_OK);
|
83
|
+
}
|
84
|
+
catch (e) {
|
85
|
+
await promises_1.default.mkdir(relativePath, { recursive: true });
|
86
|
+
}
|
87
|
+
return relativePath;
|
88
|
+
}
|
89
|
+
}
|
178
90
|
exports.LocalFileService = LocalFileService;
|
179
|
-
|
91
|
+
LocalFileService.identifier = "localfs";
|
92
|
+
//# sourceMappingURL=local-file.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"local-file.js","sourceRoot":"","sources":["../../src/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I,CAAC,CAAA;QAClD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,kBAAE,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACnD,CAAC;QAED,OAAO,YAAY,CAAA;IACrB,CAAC;;AAlHH,4CAmHC;AAlHQ,2BAAU,GAAG,SAAS,AAAZ,CAAY"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"root":["../src/index.ts","../src/services/local-file.ts"],"version":"5.6.2"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/file-local-next",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "1.0.0-rc-20241003153304",
|
4
4
|
"description": "Local filesystem file storage for Medusa",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"repository": {
|
@@ -9,27 +9,31 @@
|
|
9
9
|
"directory": "packages/file-local"
|
10
10
|
},
|
11
11
|
"files": [
|
12
|
-
"dist"
|
12
|
+
"dist",
|
13
|
+
"!dist/**/__tests__",
|
14
|
+
"!dist/**/__mocks__",
|
15
|
+
"!dist/**/__fixtures__"
|
13
16
|
],
|
14
17
|
"engines": {
|
15
|
-
"node": ">=
|
18
|
+
"node": ">=20"
|
16
19
|
},
|
17
20
|
"author": "Medusa",
|
18
21
|
"license": "MIT",
|
19
22
|
"scripts": {
|
20
|
-
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
21
23
|
"test": "jest --passWithNoTests src",
|
22
|
-
"build": "rimraf dist && tsc
|
24
|
+
"build": "rimraf dist && tsc --build ./tsconfig.json",
|
23
25
|
"watch": "tsc --watch"
|
24
26
|
},
|
25
27
|
"devDependencies": {
|
26
|
-
"
|
27
|
-
"
|
28
|
+
"@medusajs/framework": "1.0.0-rc-20241003153304",
|
29
|
+
"@swc/core": "^1.7.28",
|
30
|
+
"@swc/jest": "^0.2.36",
|
31
|
+
"jest": "^29.7.0",
|
28
32
|
"rimraf": "^5.0.1",
|
29
|
-
"typescript": "^
|
33
|
+
"typescript": "^5.6.2"
|
30
34
|
},
|
31
|
-
"
|
32
|
-
"@medusajs/
|
35
|
+
"peerDependencies": {
|
36
|
+
"@medusajs/framework": "1.0.0-rc-20241003153304"
|
33
37
|
},
|
34
38
|
"keywords": [
|
35
39
|
"medusa-plugin",
|