@live-change/upload-service 0.3.40 → 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/definition.js CHANGED
@@ -1,11 +1,12 @@
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
- const userService = require('@live-change/user-service')
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
- module.exports = definition
12
+ export default definition
package/endpoint.js CHANGED
@@ -1,19 +1,20 @@
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
- const progress = require('progress-stream')
6
+ import progress from 'progress-stream'
6
7
 
7
8
  const uploadsPath = config.uploadsPath || "./storage/uploads/"
8
9
 
9
- const crypto = require("crypto")
10
- const fs = require('fs')
10
+ import crypto from "crypto"
11
+ import fs from 'fs'
11
12
 
12
- const express = require("express")
13
+ import express from "express"
13
14
 
14
15
  fs.mkdirSync(uploadsPath, { recursive: true })
15
16
 
16
- const { Upload } = require("./model.js")
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
- module.exports = {}
118
+ export {}
package/index.js CHANGED
@@ -1,8 +1,9 @@
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('./endpoint.js')
6
- require('./model.js')
6
+ import './endpoint.js'
7
+ import './model.js'
7
8
 
8
- module.exports = definition
9
+ export default definition
package/model.js CHANGED
@@ -1,4 +1,4 @@
1
- const definition = require('./definition.js')
1
+ import definition from './definition.js'
2
2
 
3
3
  const Upload = definition.model({
4
4
  name: 'Upload',
@@ -116,4 +116,4 @@ definition.trigger({
116
116
  })
117
117
 
118
118
 
119
- module.exports = { Upload }
119
+ export { Upload }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/upload-service",
3
- "version": "0.3.40",
3
+ "version": "0.4.0",
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.7.38",
25
- "@live-change/relations-plugin": "0.7.38",
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": "d72cc68ee4c46242e5f6a51c303be4177a1c33cf"
30
+ "gitHead": "87010b19907140a326943f22cd538eafdc9c28f1"
30
31
  }