@live-change/image-service 0.3.41 → 0.4.1

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 CHANGED
@@ -1,4 +1,4 @@
1
- const definition = require('./definition.js')
1
+ import definition from './definition.js'
2
2
 
3
3
  const config = definition.config
4
4
  const uploadConfig = config.upload || {}
package/definition.js CHANGED
@@ -1,10 +1,11 @@
1
- const app = require("@live-change/framework").app()
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
2
3
 
3
- const relationsPlugin = require('@live-change/relations-plugin')
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
- module.exports = definition
11
+ export default definition
package/endpoint.js CHANGED
@@ -1,11 +1,12 @@
1
- const app = require("@live-change/framework").app()
2
- const definition = require('./definition.js')
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+ import definition from './definition.js'
3
4
 
4
- const { Image } = require('./image.js')
5
+ import { Image } from './image.js'
5
6
 
6
- const fs = require("fs")
7
- const path = require("path")
8
- const sharp = require('sharp')
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
- const express = require("express")
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
- module.exports = {}
196
+ export {}
package/fsUtils.js CHANGED
@@ -1,4 +1,4 @@
1
- const fs = require('fs')
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
- module.exports = { move, copy, mkdir, rmdir }
39
+ export { move, copy, mkdir, rmdir }
package/image.js CHANGED
@@ -1,5 +1,6 @@
1
- const app = require("@live-change/framework").app()
2
- const definition = require('./definition.js')
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
- const { move, copy, mkdir, rmdir } = require('./fsUtils')
53
- const fs = require('fs')
54
- const sharp = require('sharp')
55
- const download = require('download')
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
- module.exports = { Image }
219
+ export { Image }
package/index.js CHANGED
@@ -1,9 +1,10 @@
1
- const app = require("@live-change/framework").app()
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
2
3
 
3
- const definition = require('./definition.js')
4
+ import definition from './definition.js'
4
5
 
5
- require('./clientConfig.js')
6
- require('./image.js')
7
- require('./endpoint.js')
6
+ import './clientConfig.js'
7
+ import './image.js'
8
+ import './endpoint.js'
8
9
 
9
- module.exports = definition
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.41",
3
+ "version": "0.4.1",
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.7.39",
25
- "@live-change/relations-plugin": "0.7.39",
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": "cf7a4196465c134c4685571526754330d7c70475"
30
+ "gitHead": "74215655da2a4bc3ef73c62e5d79d988276165e8",
31
+ "type": "module"
31
32
  }