@strapi/provider-upload-cloudinary 4.11.2 → 4.11.4
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/index.js +25 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
const cloudinary_1 = require("cloudinary");
|
|
6
29
|
const into_stream_1 = __importDefault(require("into-stream"));
|
|
7
|
-
const
|
|
30
|
+
const utils = __importStar(require("@strapi/utils"));
|
|
8
31
|
module.exports = {
|
|
9
32
|
init(options) {
|
|
10
33
|
cloudinary_1.v2.config(options);
|
|
@@ -23,7 +46,7 @@ module.exports = {
|
|
|
23
46
|
const uploadStream = cloudinary_1.v2.uploader.upload_chunked_stream({ ...config, ...customConfig }, (err, image) => {
|
|
24
47
|
if (err) {
|
|
25
48
|
if (err.message.includes('File size too large')) {
|
|
26
|
-
reject(new
|
|
49
|
+
reject(new utils.errors.PayloadTooLargeError());
|
|
27
50
|
}
|
|
28
51
|
else {
|
|
29
52
|
reject(new Error(`Error uploading to cloudinary: ${err.message}`));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA+E;AAC/E,8DAAqC;AACrC,qDAAuC;AAsBvC,iBAAS;IACP,IAAI,CAAC,OAAsB;QACzB,eAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAE3B,MAAM,MAAM,GAAG,CAAC,IAAU,EAAE,YAAY,GAAG,EAAE,EAAiB,EAAE;YAC9D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACrC,MAAM,MAAM,GAA8B;oBACxC,aAAa,EAAE,MAAM;oBACrB,SAAS,EAAE,IAAI,CAAC,IAAI;iBACrB,CAAC;gBAEF,IAAI,IAAI,CAAC,GAAG,EAAE;oBACZ,MAAM,CAAC,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;iBAC7C;gBAED,IAAI,IAAI,CAAC,IAAI,EAAE;oBACb,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;iBAC3B;gBAED,MA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
2
2
|
"name": "@strapi/provider-upload-cloudinary",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.4",
|
|
4
4
|
"description": "Cloudinary provider for strapi upload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"upload",
|
|
@@ -42,17 +42,17 @@
|
|
|
42
42
|
"lint": "run -T eslint ."
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@strapi/utils": "4.11.
|
|
45
|
+
"@strapi/utils": "4.11.4",
|
|
46
46
|
"cloudinary": "^1.37.0",
|
|
47
47
|
"into-stream": "^5.1.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"eslint-config-custom": "4.11.
|
|
51
|
-
"tsconfig": "4.11.
|
|
50
|
+
"eslint-config-custom": "4.11.4",
|
|
51
|
+
"tsconfig": "4.11.4"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=14.19.1 <=18.x.x",
|
|
55
55
|
"npm": ">=6.0.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "8d325a695386ab9b578b360bf768cfa25173050f"
|
|
58
58
|
}
|