next-tinacms-dos 8.0.2 → 9.0.0
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/dist/handlers.js +11 -10
- package/package.json +3 -3
package/dist/handlers.js
CHANGED
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -76,6 +80,8 @@ async function uploadMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
|
|
|
76
80
|
const upload = (0, import_util.promisify)(
|
|
77
81
|
(0, import_multer.default)({
|
|
78
82
|
storage: import_multer.default.diskStorage({
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
84
|
+
// @ts-ignore
|
|
79
85
|
directory: (req2, file, cb) => {
|
|
80
86
|
cb(null, "/tmp");
|
|
81
87
|
},
|
|
@@ -88,8 +94,7 @@ async function uploadMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
|
|
|
88
94
|
await upload(req, res);
|
|
89
95
|
const { directory } = req.body;
|
|
90
96
|
let prefix = directory.replace(/^\//, "").replace(/\/$/, "");
|
|
91
|
-
if (prefix)
|
|
92
|
-
prefix = prefix + "/";
|
|
97
|
+
if (prefix) prefix = prefix + "/";
|
|
93
98
|
const filePath = req.file.path;
|
|
94
99
|
const fileType = (_a = req.file) == null ? void 0 : _a.mimetype;
|
|
95
100
|
const blob = import_fs.default.readFileSync(filePath);
|
|
@@ -148,8 +153,7 @@ async function listMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
|
|
|
148
153
|
offset
|
|
149
154
|
} = req.query;
|
|
150
155
|
let prefix = directory.replace(/^\//, "").replace(/\/$/, "");
|
|
151
|
-
if (prefix)
|
|
152
|
-
prefix = prefix + "/";
|
|
156
|
+
if (prefix) prefix = prefix + "/";
|
|
153
157
|
const params = {
|
|
154
158
|
Bucket: bucket,
|
|
155
159
|
Delimiter: "/",
|
|
@@ -190,12 +194,9 @@ async function listMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
|
|
|
190
194
|
}
|
|
191
195
|
}
|
|
192
196
|
var findErrorMessage = (e) => {
|
|
193
|
-
if (typeof e == "string")
|
|
194
|
-
|
|
195
|
-
if (e.message)
|
|
196
|
-
return e.message;
|
|
197
|
-
if (e.error && e.error.message)
|
|
198
|
-
return e.error.message;
|
|
197
|
+
if (typeof e == "string") return e;
|
|
198
|
+
if (e.message) return e.message;
|
|
199
|
+
if (e.error && e.error.message) return e.error.message;
|
|
199
200
|
return "an error occurred";
|
|
200
201
|
};
|
|
201
202
|
async function deleteAsset(req, res, client, bucket) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-tinacms-dos",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"tinacms": "2.
|
|
21
|
+
"tinacms": "2.6.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/crypto-js": "^3.1.47",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react-dom": "^18.3.1",
|
|
30
30
|
"typescript": "^5.6.3",
|
|
31
31
|
"@tinacms/scripts": "1.3.1",
|
|
32
|
-
"tinacms": "2.
|
|
32
|
+
"tinacms": "2.6.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"registry": "https://registry.npmjs.org"
|