@nexrender/core 1.50.7 → 1.51.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexrender/core",
3
- "version": "1.50.7",
3
+ "version": "1.51.2",
4
4
  "main": "src/index.js",
5
5
  "author": "Inlife",
6
6
  "homepage": "https://www.nexrender.com",
@@ -27,6 +27,7 @@
27
27
  "@nexrender/action-copy": "^1.0.0",
28
28
  "@nexrender/action-decompress": "^1.48.2",
29
29
  "@nexrender/action-encode": "^1.1.4",
30
+ "@nexrender/action-image": "^1.49.4",
30
31
  "@nexrender/action-upload": "^1.0.0",
31
32
  "@nexrender/provider-ftp": "^1.17.2",
32
33
  "@nexrender/provider-gs": "^1.21.3",
@@ -37,5 +38,5 @@
37
38
  "publishConfig": {
38
39
  "access": "public"
39
40
  },
40
- "gitHead": "007bcea7cc5837f89de5087bc2e7337fea2838cb"
41
+ "gitHead": "02fbfff977eb0b0d5b662de0dec37d7ed3899981"
41
42
  }
package/src/index.js CHANGED
@@ -31,6 +31,7 @@ if (process.env.NEXRENDER_REQUIRE_PLUGINS) {
31
31
  require('@nexrender/action-encode');
32
32
  require('@nexrender/action-upload');
33
33
  require('@nexrender/action-decompress');
34
+ require('@nexrender/action-image');
34
35
 
35
36
  require('@nexrender/provider-s3');
36
37
  require('@nexrender/provider-ftp');
@@ -25,10 +25,8 @@ const download = (job, settings, asset) => {
25
25
  /* ^ remove possible query search string params ^ */
26
26
  destName = decodeURI(destName) /* < remove/decode any special URI symbols within filename */
27
27
 
28
- /* prevent same name file collisions */
29
- if (fs.existsSync(path.join(job.workpath, destName))) {
30
- destName = Math.random().toString(36).substring(2) + path.extname(asset.src).split('?')[0];
31
- }
28
+ /* prevent duplicate filename collisions during parallel fetch */
29
+ destName = Math.random().toString(36).substring(2) + '-' + destName;
32
30
  }
33
31
 
34
32
  /* force asset name if it is provided */
@@ -86,7 +84,7 @@ const download = (job, settings, asset) => {
86
84
  /* TODO: maybe move to external package ?? */
87
85
  const src = asset.src
88
86
  return fetch(src, asset.params)
89
- .then(res => res.ok ? res : Promise.reject({reason: 'Initial error downloading file', meta: {src, error: res.error}}))
87
+ .then(res => res.ok ? res : Promise.reject(new Error(`Unable to download file ${src}`)))
90
88
  .then(res => {
91
89
  // Set a file extension based on content-type header if not already set
92
90
  if (!asset.extension) {