@live-change/image-service 0.3.41 → 0.4.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/clientConfig.js +1 -1
- package/definition.js +4 -3
- package/endpoint.js +9 -8
- package/fsUtils.js +2 -2
- package/image.js +8 -7
- package/index.js +7 -6
- package/package.json +5 -4
package/clientConfig.js
CHANGED
package/definition.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import App from '@live-change/framework'
|
|
2
|
+
const app = App.app()
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import relationsPlugin from '@live-change/relations-plugin'
|
|
4
5
|
|
|
5
6
|
const definition = app.createServiceDefinition({
|
|
6
7
|
name: "image",
|
|
7
8
|
use: [ relationsPlugin ]
|
|
8
9
|
})
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
export default definition
|
package/endpoint.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
1
|
+
import App from '@live-change/framework'
|
|
2
|
+
const app = App.app()
|
|
3
|
+
import definition from './definition.js'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
import { Image } from './image.js'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import fs from "fs"
|
|
8
|
+
import path from "path"
|
|
9
|
+
import sharp from 'sharp'
|
|
9
10
|
|
|
10
11
|
const config = definition.config
|
|
11
12
|
|
|
@@ -154,7 +155,7 @@ async function handleImageGet(req, res, params) {
|
|
|
154
155
|
}
|
|
155
156
|
|
|
156
157
|
|
|
157
|
-
|
|
158
|
+
import express from "express"
|
|
158
159
|
|
|
159
160
|
definition.endpoint({
|
|
160
161
|
name: 'image',
|
|
@@ -192,4 +193,4 @@ definition.endpoint({
|
|
|
192
193
|
}
|
|
193
194
|
})
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
export {}
|
package/fsUtils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import fs from 'fs'
|
|
2
2
|
|
|
3
3
|
function move(from, to) {
|
|
4
4
|
return new Promise((resolve,reject) => {
|
|
@@ -36,4 +36,4 @@ function rmdir(path) {
|
|
|
36
36
|
})
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
export { move, copy, mkdir, rmdir }
|
package/image.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
1
|
+
import App from '@live-change/framework'
|
|
2
|
+
const app = App.app()
|
|
3
|
+
import definition from './definition.js'
|
|
3
4
|
const config = definition.config
|
|
4
5
|
|
|
5
6
|
const imagesPath = config.imagesPath || `./storage/images/`
|
|
@@ -49,10 +50,10 @@ const Image = definition.model({
|
|
|
49
50
|
}
|
|
50
51
|
})
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
import { move, copy, mkdir, rmdir } from './fsUtils.js'
|
|
54
|
+
import fs from 'fs'
|
|
55
|
+
import sharp from 'sharp'
|
|
56
|
+
import download from 'download'
|
|
56
57
|
|
|
57
58
|
fs.mkdirSync(imagesPath, { recursive: true })
|
|
58
59
|
|
|
@@ -215,4 +216,4 @@ definition.view({
|
|
|
215
216
|
}
|
|
216
217
|
})
|
|
217
218
|
|
|
218
|
-
|
|
219
|
+
export { Image }
|
package/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import App from '@live-change/framework'
|
|
2
|
+
const app = App.app()
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import definition from './definition.js'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import './clientConfig.js'
|
|
7
|
+
import './image.js'
|
|
8
|
+
import './endpoint.js'
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
export default definition
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/image-service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,11 +21,12 @@
|
|
|
21
21
|
"url": "https://www.viamage.com/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/framework": "0.
|
|
25
|
-
"@live-change/relations-plugin": "0.
|
|
24
|
+
"@live-change/framework": "0.8.0",
|
|
25
|
+
"@live-change/relations-plugin": "0.8.0",
|
|
26
26
|
"download": "^8.0.0",
|
|
27
27
|
"pluralize": "^8.0.0",
|
|
28
28
|
"sharp": "^0.32.5"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "87010b19907140a326943f22cd538eafdc9c28f1",
|
|
31
|
+
"type": "module"
|
|
31
32
|
}
|