next-tinacms-cloudinary 11.0.1 → 12.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.
Files changed (2) hide show
  1. package/dist/handlers.js +9 -8
  2. 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
  ));
@@ -62,6 +66,7 @@ async function uploadMedia(req, res) {
62
66
  const upload = (0, import_util.promisify)(
63
67
  (0, import_multer.default)({
64
68
  storage: import_multer.default.diskStorage({
69
+ // @ts-ignore
65
70
  directory: (req2, file, cb) => {
66
71
  cb(null, "/tmp");
67
72
  },
@@ -147,20 +152,16 @@ async function listMedia(req, res, opts) {
147
152
  }
148
153
  }
149
154
  var findErrorMessage = (e) => {
150
- if (typeof e == "string")
151
- return e;
152
- if (e.message)
153
- return e.message;
154
- if (e.error && e.error.message)
155
- return e.error.message;
155
+ if (typeof e == "string") return e;
156
+ if (e.message) return e.message;
157
+ if (e.error && e.error.message) return e.error.message;
156
158
  return "an error occurred";
157
159
  };
158
160
  async function deleteAsset(req, res) {
159
161
  const { media } = req.query;
160
162
  const [, public_id] = media;
161
163
  import_cloudinary.v2.uploader.destroy(public_id, {}, (err) => {
162
- if (err)
163
- res.status(500);
164
+ if (err) res.status(500);
164
165
  res.json({
165
166
  err,
166
167
  public_id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-tinacms-cloudinary",
3
- "version": "11.0.1",
3
+ "version": "12.0.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "files": [
@@ -30,10 +30,10 @@
30
30
  "react-dom": "^18.3.1",
31
31
  "typescript": "^5.6.3",
32
32
  "@tinacms/scripts": "1.3.1",
33
- "tinacms": "2.5.1"
33
+ "tinacms": "2.6.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "tinacms": "2.5.1"
36
+ "tinacms": "2.6.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "registry": "https://registry.npmjs.org"