@live-change/image-service 0.9.193 → 0.9.195

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/image.js +2 -2
  2. package/package.json +4 -4
package/image.js CHANGED
@@ -105,7 +105,7 @@ definition.action({
105
105
  } else {
106
106
  // TODO: check id source session
107
107
  const existing = await Image.get(image)
108
- if (existing) throw 'already_exists'
108
+ if (existing) throw app.logicError("already_exists")
109
109
  }
110
110
  const uploadRow = await Upload.get(upload)
111
111
  if(!uploadRow) throw new Error("upload_not_found")
@@ -178,7 +178,7 @@ definition.trigger({
178
178
  async execute({ image, name, width, height, fileName, purpose, owner, ownerType, crop }, { client, service }, emit) {
179
179
  if(!image) throw new Error("image_not_found")
180
180
  const existing = await Image.get(image)
181
- if (existing) throw 'already_exists'
181
+ if (existing) throw app.logicError("already_exists")
182
182
 
183
183
  let extension = fileName.match(/\.([A-Z0-9]+)$/i)[1].toLowerCase()
184
184
  if(extension === 'jpg') throw new Error('jpg should have jpeg extension')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/image-service",
3
- "version": "0.9.193",
3
+ "version": "0.9.195",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,12 +21,12 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.9.193",
25
- "@live-change/relations-plugin": "^0.9.193",
24
+ "@live-change/framework": "^0.9.195",
25
+ "@live-change/relations-plugin": "^0.9.195",
26
26
  "download": "^8.0.0",
27
27
  "pluralize": "^8.0.0",
28
28
  "sharp": "^0.32.5"
29
29
  },
30
- "gitHead": "8a7627bed2cb66684e7169ddb3998191612e57a9",
30
+ "gitHead": "9f61eddae56ddd89aba20988b8e208d948728496",
31
31
  "type": "module"
32
32
  }