@live-change/upload-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/definition.js +5 -4
- package/endpoint.js +9 -8
- package/index.js +6 -5
- package/model.js +2 -2
- package/package.json +5 -4
package/definition.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import App from '@live-change/framework'
|
|
2
|
+
const app = App.app()
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import relationsPlugin from '@live-change/relations-plugin'
|
|
5
|
+
import userService from '@live-change/user-service'
|
|
5
6
|
|
|
6
7
|
const definition = app.createServiceDefinition({
|
|
7
8
|
name: "upload",
|
|
8
9
|
use: [ relationsPlugin, userService ]
|
|
9
10
|
})
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
export default definition
|
package/endpoint.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
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
|
+
import progress from 'progress-stream'
|
|
6
7
|
|
|
7
8
|
const uploadsPath = config.uploadsPath || "./storage/uploads/"
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
import crypto from "crypto"
|
|
11
|
+
import fs from 'fs'
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
import express from "express"
|
|
13
14
|
|
|
14
15
|
fs.mkdirSync(uploadsPath, { recursive: true })
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
import { Upload } from "./model.js"
|
|
17
18
|
|
|
18
19
|
async function setStreamInfo(info) {
|
|
19
20
|
console.dir(info)
|
|
@@ -114,4 +115,4 @@ definition.endpoint({
|
|
|
114
115
|
}
|
|
115
116
|
})
|
|
116
117
|
|
|
117
|
-
|
|
118
|
+
export {}
|
package/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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
|
-
|
|
6
|
+
import './endpoint.js'
|
|
7
|
+
import './model.js'
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
export default definition
|
package/model.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/upload-service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
"name": "Michał Łaszczewski",
|
|
21
21
|
"url": "https://www.viamage.com/"
|
|
22
22
|
},
|
|
23
|
+
"type": "module",
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@live-change/framework": "0.
|
|
25
|
-
"@live-change/relations-plugin": "0.
|
|
25
|
+
"@live-change/framework": "0.8.0",
|
|
26
|
+
"@live-change/relations-plugin": "0.8.0",
|
|
26
27
|
"pluralize": "^8.0.0",
|
|
27
28
|
"progress-stream": "^2.0.0"
|
|
28
29
|
},
|
|
29
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "74215655da2a4bc3ef73c62e5d79d988276165e8"
|
|
30
31
|
}
|