mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
Merge branch 'master' into feature/assets-styling
This commit is contained in:
commit
1e02037a18
@ -2,13 +2,11 @@ language: node_js
|
|||||||
node_js: node
|
node_js: node
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./scripts/install.sh
|
# - ./scripts/install.sh # runs automatically with npm ci
|
||||||
- ./scripts/test.sh
|
- ./scripts/test.sh
|
||||||
- ./scripts/build.sh
|
- ./scripts/build.sh
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|
||||||
cache:
|
cache: npm
|
||||||
directories:
|
|
||||||
- node_modules
|
|
||||||
|
505
client/package-lock.json
generated
505
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -11,22 +11,22 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@oceanprotocol/art": "^2.2.0",
|
"@oceanprotocol/art": "^2.2.0",
|
||||||
"@oceanprotocol/squid": "^0.4.0",
|
"@oceanprotocol/squid": "^0.4.1",
|
||||||
"@oceanprotocol/typographies": "^0.1.0",
|
"@oceanprotocol/typographies": "^0.1.0",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"filesize": "^4.1.2",
|
"filesize": "^4.1.2",
|
||||||
"is-url": "^1.2.4",
|
"is-url": "^1.2.4",
|
||||||
"moment": "^2.24.0",
|
"moment": "^2.24.0",
|
||||||
"query-string": "^6.4.0",
|
"query-string": "^6.4.2",
|
||||||
"react": "^16.8.5",
|
"react": "^16.8.6",
|
||||||
"react-dom": "^16.8.5",
|
"react-dom": "^16.8.6",
|
||||||
"react-helmet": "^5.2.0",
|
"react-helmet": "^5.2.0",
|
||||||
"react-moment": "^0.8.4",
|
"react-moment": "^0.8.4",
|
||||||
"react-popper": "^1.3.3",
|
"react-popper": "^1.3.3",
|
||||||
"react-router-dom": "^5.0.0",
|
"react-router-dom": "^5.0.0",
|
||||||
"react-transition-group": "^2.7.0",
|
"react-transition-group": "^2.7.1",
|
||||||
"slugify": "^1.3.4",
|
"slugify": "^1.3.4",
|
||||||
"web3": "^1.0.0-beta.50"
|
"web3": "^1.0.0-beta.51"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/classnames": "^2.2.7",
|
"@types/classnames": "^2.2.7",
|
||||||
@ -34,7 +34,7 @@
|
|||||||
"@types/is-url": "^1.2.28",
|
"@types/is-url": "^1.2.28",
|
||||||
"@types/jest": "^24.0.11",
|
"@types/jest": "^24.0.11",
|
||||||
"@types/query-string": "^6.3.0",
|
"@types/query-string": "^6.3.0",
|
||||||
"@types/react": "^16.8.8",
|
"@types/react": "^16.8.10",
|
||||||
"@types/react-dom": "^16.8.3",
|
"@types/react-dom": "^16.8.3",
|
||||||
"@types/react-helmet": "^5.0.8",
|
"@types/react-helmet": "^5.0.8",
|
||||||
"@types/react-router-dom": "^4.3.1",
|
"@types/react-router-dom": "^4.3.1",
|
||||||
@ -42,7 +42,7 @@
|
|||||||
"@types/web3": "^1.0.18",
|
"@types/web3": "^1.0.18",
|
||||||
"node-sass": "^4.11.0",
|
"node-sass": "^4.11.0",
|
||||||
"react-scripts": "^2.1.8",
|
"react-scripts": "^2.1.8",
|
||||||
"typescript": "^3.3.4000"
|
"typescript": "^3.4.1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -8,14 +8,10 @@ const AssetModel = {
|
|||||||
name: null,
|
name: null,
|
||||||
description: null,
|
description: null,
|
||||||
dateCreated: null,
|
dateCreated: null,
|
||||||
size: null,
|
|
||||||
author: null,
|
author: null,
|
||||||
type: '',
|
type: '',
|
||||||
license: null,
|
license: null,
|
||||||
copyrightHolder: null,
|
copyrightHolder: null,
|
||||||
encoding: null,
|
|
||||||
compression: null,
|
|
||||||
contentType: null,
|
|
||||||
workExample: null,
|
workExample: null,
|
||||||
files: [],
|
files: [],
|
||||||
categories: [],
|
categories: [],
|
||||||
|
@ -8,8 +8,19 @@ import styles from './index.module.scss'
|
|||||||
|
|
||||||
import { serviceHost, servicePort, serviceScheme } from '../../../config'
|
import { serviceHost, servicePort, serviceScheme } from '../../../config'
|
||||||
|
|
||||||
|
interface File {
|
||||||
|
url: string
|
||||||
|
checksum?: string
|
||||||
|
checksumType?: string
|
||||||
|
contentLength?: string
|
||||||
|
contentType?: string
|
||||||
|
resourceId?: string
|
||||||
|
encoding?: string
|
||||||
|
compression?: string
|
||||||
|
}
|
||||||
|
|
||||||
interface FilesProps {
|
interface FilesProps {
|
||||||
files: any[]
|
files: File[]
|
||||||
placeholder: string
|
placeholder: string
|
||||||
help?: string
|
help?: string
|
||||||
name: string
|
name: string
|
||||||
@ -20,6 +31,32 @@ interface FilesStates {
|
|||||||
isFormShown: boolean
|
isFormShown: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getFileCompression = async (contentType: string) => {
|
||||||
|
// TODO: add all the possible archive & compression MIME types
|
||||||
|
if (
|
||||||
|
contentType === 'application/zip' ||
|
||||||
|
contentType === 'application/gzip' ||
|
||||||
|
contentType === 'application/x-lzma' ||
|
||||||
|
contentType === 'application/x-xz' ||
|
||||||
|
contentType === 'application/x-tar' ||
|
||||||
|
contentType === 'application/x-gtar' ||
|
||||||
|
contentType === 'application/x-bzip2' ||
|
||||||
|
contentType === 'application/x-7z-compressed' ||
|
||||||
|
contentType === 'application/x-rar-compressed' ||
|
||||||
|
contentType === 'application/x-apple-diskimage'
|
||||||
|
) {
|
||||||
|
const contentTypeSplit = contentType.split('/')
|
||||||
|
|
||||||
|
if (contentTypeSplit[1].includes('x-')) {
|
||||||
|
return contentTypeSplit[1].replace('x-', '')
|
||||||
|
}
|
||||||
|
|
||||||
|
return contentTypeSplit[1]
|
||||||
|
} else {
|
||||||
|
return 'none'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default class Files extends PureComponent<FilesProps, FilesStates> {
|
export default class Files extends PureComponent<FilesProps, FilesStates> {
|
||||||
public state: FilesStates = {
|
public state: FilesStates = {
|
||||||
isFormShown: false
|
isFormShown: false
|
||||||
@ -46,8 +83,9 @@ export default class Files extends PureComponent<FilesProps, FilesStates> {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
res = await response.json()
|
res = await response.json()
|
||||||
file.size = res.result.contentLength
|
file.contentLength = res.result.contentLength
|
||||||
file.type = res.result.contentType
|
file.contentType = res.result.contentType
|
||||||
|
file.compression = await getFileCompression(file.contentType)
|
||||||
file.found = res.result.found
|
file.found = res.result.found
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// error
|
// error
|
||||||
|
@ -258,10 +258,6 @@ class Publish extends Component<{}, PublishState> {
|
|||||||
price: this.state.price,
|
price: this.state.price,
|
||||||
type: this.state.type,
|
type: this.state.type,
|
||||||
categories: [this.state.categories],
|
categories: [this.state.categories],
|
||||||
size: '',
|
|
||||||
encoding: '',
|
|
||||||
compression: undefined,
|
|
||||||
contentType: '',
|
|
||||||
workExample: undefined,
|
workExample: undefined,
|
||||||
inLanguage: undefined,
|
inLanguage: undefined,
|
||||||
tags: ''
|
tags: ''
|
||||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@ -1267,9 +1267,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.6.0",
|
"version": "5.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
|
||||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
|
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3735,9 +3735,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parent-module": {
|
"parent-module": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||||
"integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==",
|
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"callsites": "^3.0.0"
|
"callsites": "^3.0.0"
|
||||||
@ -6498,9 +6498,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.3.4000",
|
"version": "3.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.1.tgz",
|
||||||
"integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==",
|
"integrity": "sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unherit": {
|
"unherit": {
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
"stylelint-config-bigchaindb": "^1.2.1",
|
"stylelint-config-bigchaindb": "^1.2.1",
|
||||||
"stylelint-config-css-modules": "^1.3.0",
|
"stylelint-config-css-modules": "^1.3.0",
|
||||||
"stylelint-config-standard": "^18.2.0",
|
"stylelint-config-standard": "^18.2.0",
|
||||||
"typescript": "^3.3.4000"
|
"typescript": "^3.4.1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
980
server/package-lock.json
generated
980
server/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.18.3",
|
"body-parser": "^1.18.3",
|
||||||
"color-js": "^1.0.5",
|
"color-js": "^1.0.5",
|
||||||
"compression": "^1.7.3",
|
"compression": "^1.7.4",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
"express-validator": "^5.3.1",
|
"express-validator": "^5.3.1",
|
||||||
@ -28,22 +28,22 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/body-parser": "^1.17.0",
|
"@types/body-parser": "^1.17.0",
|
||||||
"@types/compression": "0.0.36",
|
"@types/compression": "0.0.36",
|
||||||
"@types/debug": "^4.1.1",
|
"@types/debug": "^4.1.3",
|
||||||
"@types/dotenv": "^6.1.0",
|
"@types/dotenv": "^6.1.1",
|
||||||
"@types/express": "^4.16.1",
|
"@types/express": "^4.16.1",
|
||||||
"@types/jasmine": "^3.3.9",
|
"@types/jasmine": "^3.3.12",
|
||||||
"@types/jest": "^24.0.5",
|
"@types/jest": "^24.0.11",
|
||||||
"@types/morgan": "^1.7.35",
|
"@types/morgan": "^1.7.35",
|
||||||
"@types/node": "^11.9.4",
|
"@types/node": "^11.12.2",
|
||||||
"@types/request": "^2.48.1",
|
"@types/request": "^2.48.1",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"jest": "^24.1.0",
|
"jest": "^24.5.0",
|
||||||
"mocha": "^6.0.2",
|
"mocha": "^6.0.2",
|
||||||
"nodemon": "^1.18.10",
|
"nodemon": "^1.18.10",
|
||||||
"supertest": "^3.4.2",
|
"supertest": "^4.0.2",
|
||||||
"ts-jest": "^24.0.0",
|
"ts-jest": "^24.0.1",
|
||||||
"ts-node": "^8.0.2",
|
"ts-node": "^8.0.3",
|
||||||
"typescript": "^3.3.4000"
|
"typescript": "^3.4.1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user