next-tinacms-cloudinary 6.0.0 → 7.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 -6
- package/package.json +4 -4
package/dist/handlers.js
CHANGED
|
@@ -73,12 +73,17 @@ async function uploadMedia(req, res) {
|
|
|
73
73
|
);
|
|
74
74
|
await upload(req, res);
|
|
75
75
|
const { directory } = req.body;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
try {
|
|
77
|
+
const result = await import_cloudinary.v2.uploader.upload(req.file.path, {
|
|
78
|
+
folder: directory.replace(/^\//, ""),
|
|
79
|
+
use_filename: true,
|
|
80
|
+
overwrite: false,
|
|
81
|
+
resource_type: "auto"
|
|
82
|
+
});
|
|
83
|
+
res.json(result);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
res.status(error.http_code).json({ message: error.message });
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
async function listMedia(req, res, opts) {
|
|
84
89
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-tinacms-cloudinary",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"react": "^18.3.1",
|
|
30
30
|
"react-dom": "^18.3.1",
|
|
31
31
|
"typescript": "4.6.4",
|
|
32
|
-
"tinacms": "
|
|
33
|
-
"
|
|
32
|
+
"@tinacms/scripts": "1.1.6",
|
|
33
|
+
"tinacms": "2.1.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"tinacms": "2.
|
|
36
|
+
"tinacms": "2.1.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"registry": "https://registry.npmjs.org"
|