1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

Merge pull request #204 from oceanprotocol/feature/bump-squid

bump packages
This commit is contained in:
Matthias Kretschmann 2019-11-01 12:47:12 +01:00 committed by GitHub
commit 7c88cb4fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 6826 additions and 5171 deletions

View File

@ -31,12 +31,13 @@
"env": { "env": {
"es6": true, "es6": true,
"browser": true, "browser": true,
"node": true,
"jest": true, "jest": true,
"cypress/globals": true "cypress/globals": true
}, },
"settings": { "settings": {
"react": { "react": {
"version": "16.8" "version": "16"
} }
} }
} }

View File

@ -35,7 +35,7 @@ env:
# start Barge with these versions # start Barge with these versions
- BRIZO_VERSION=v0.4.5 - BRIZO_VERSION=v0.4.5
- AQUARIUS_VERSION=v0.3.8 - AQUARIUS_VERSION=v0.3.8
- KEEPER_VERSION=v0.11.1 - KEEPER_VERSION=v0.12.6
- EVENTS_HANDLER_VERSION=v0.1.2 - EVENTS_HANDLER_VERSION=v0.1.2
- KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260" - KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"
- FAUCET_TIMESPAN=0 - FAUCET_TIMESPAN=0
@ -61,7 +61,7 @@ script:
# executing `npm test` scripts individually here, so first one failing will exit the build # executing `npm test` scripts individually here, so first one failing will exit the build
- npm run lint || travis_terminate 1 - npm run lint || travis_terminate 1
- ./scripts/keeper.sh - ./scripts/keeper.sh
- ./scripts/test.sh || travis_terminate 1 - ./scripts/test.sh
- ./scripts/coverage.sh - ./scripts/coverage.sh
# Pipe the coverage data to Code Climate # Pipe the coverage data to Code Climate
- ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.client.json client/coverage/lcov.info - ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.client.json client/coverage/lcov.info

10234
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",
"build": "CI=false react-scripts --max_old_space_size=4096 build", "build": "CI=false react-scripts --max_old_space_size=4096 build",
"test": "react-scripts test --coverage --watchAll=false", "test": "react-scripts test --coverage --watchAll=false --silent",
"test:watch": "react-scripts test --coverage", "test:watch": "react-scripts test --coverage",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"coverage": "cat coverage/lcov.info | codacy-coverage --token 8801f827fe1144ffa85cd7da94f2bbf7", "coverage": "cat coverage/lcov.info | codacy-coverage --token 8801f827fe1144ffa85cd7da94f2bbf7",
@ -14,65 +14,64 @@
}, },
"dependencies": { "dependencies": {
"@oceanprotocol/art": "^2.2.0", "@oceanprotocol/art": "^2.2.0",
"@oceanprotocol/squid": "^0.7.3", "@oceanprotocol/squid": "^0.8.0",
"@oceanprotocol/typographies": "^0.1.0", "@oceanprotocol/typographies": "^0.1.0",
"@sindresorhus/slugify": "^0.9.1", "@sindresorhus/slugify": "^0.9.1",
"@truffle/hdwallet-provider": "^1.0.23",
"axios": "^0.19.0", "axios": "^0.19.0",
"bip39": "^3.0.2", "bip39": "^3.0.2",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"ethereum-blockies": "github:MyEtherWallet/blockies", "ethereum-blockies": "github:MyEtherWallet/blockies",
"filesize": "^4.1.2", "filesize": "^6.0.0",
"history": "^4.9.0", "history": "^4.10.1",
"ipfs": "^0.38.0", "ipfs": "^0.39.0",
"ipfs-http-client": "^38.2.0", "ipfs-http-client": "^39.0.2",
"is-url-superb": "^3.0.0", "is-url-superb": "^3.0.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"query-string": "^6.8.2", "query-string": "^6.8.3",
"react": "16.8.6", "react": "^16.11.0",
"react-collapsed": "^2.1.1", "react-collapsed": "^2.2.2",
"react-datepicker": "^2.8.0", "react-datepicker": "^2.9.6",
"react-dom": "16.8.6", "react-dom": "^16.11.0",
"react-dotdotdot": "^1.3.1", "react-dotdotdot": "^1.3.1",
"react-dropzone": "^10.1.8", "react-dropzone": "^10.1.10",
"react-ga": "^2.6.0", "react-ga": "^2.7.0",
"react-helmet": "^5.2.1", "react-helmet": "^5.2.1",
"react-markdown": "^4.1.0", "react-markdown": "^4.2.2",
"react-modal": "^3.9.1", "react-modal": "^3.11.1",
"react-moment": "^0.9.2", "react-moment": "^0.9.6",
"react-paginate": "^6.3.0", "react-paginate": "^6.3.0",
"react-popper": "^1.3.3", "react-popper": "^1.3.4",
"react-router-dom": "^5.0.1", "react-router-dom": "^5.1.2",
"react-transition-group": "^4.2.1", "react-transition-group": "^4.3.0",
"shortid": "^2.2.15", "shortid": "^2.2.15",
"truffle-hdwallet-provider": "1.0.14", "web3": "^1.2.2"
"web3": "1.2.0"
}, },
"devDependencies": { "devDependencies": {
"@react-mock/state": "^0.1.8", "@react-mock/state": "^0.1.8",
"@testing-library/jest-dom": "^4.0.0", "@testing-library/jest-dom": "^4.2.2",
"@testing-library/react": "^8.0.7", "@testing-library/react": "^9.3.1",
"@types/classnames": "^2.2.9", "@types/classnames": "^2.2.9",
"@types/filesize": "^4.1.0",
"@types/is-url": "^1.2.28", "@types/is-url": "^1.2.28",
"@types/jest": "^24.0.16", "@types/jest": "^24.0.21",
"@types/react": "^16.8.23", "@types/react": "^16.9.11",
"@types/react-datepicker": "^2.8.0", "@types/react-datepicker": "^2.9.3",
"@types/react-dom": "^16.8.5", "@types/react-dom": "^16.9.3",
"@types/react-dotdotdot": "^1.2.0", "@types/react-dotdotdot": "^1.2.0",
"@types/react-helmet": "^5.0.8", "@types/react-helmet": "^5.0.14",
"@types/react-modal": "^3.8.2", "@types/react-modal": "^3.10.0",
"@types/react-paginate": "^6.2.1", "@types/react-paginate": "^6.2.1",
"@types/react-router-dom": "^4.3.4", "@types/react-router-dom": "^5.1.1",
"@types/react-transition-group": "^4.2.0", "@types/react-transition-group": "^4.2.3",
"@types/shortid": "0.0.29", "@types/shortid": "^0.0.29",
"@types/web3": "^1.0.19", "@typescript-eslint/eslint-plugin": "^2.6.0",
"@typescript-eslint/eslint-plugin": "^2.4.0", "@typescript-eslint/parser": "^2.6.0",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"jest-mock-axios": "^3.1.0", "jest-mock-axios": "^3.1.2",
"node-sass": "^4.12.0", "node-sass": "^4.13.0",
"react-scripts": "^3.0.0", "react-scripts": "3.0.1",
"source-map-explorer": "^2.0.1", "source-map-explorer": "^2.1.0",
"typescript": "^3.6.2" "typescript": "^3.6.4"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

9
client/src/@types/global.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
import Web3 from 'web3'
import { Eth } from 'web3/eth'
declare global {
interface Window {
web3: Web3
ethereum: Eth
}
}

View File

@ -1 +0,0 @@
declare module 'ipfs-http-client'

View File

@ -1 +0,0 @@
declare module 'ipfs'

View File

@ -3,3 +3,8 @@
declare module 'ethereum-blockies' { declare module 'ethereum-blockies' {
export function toDataUrl(address: string): string export function toDataUrl(address: string): string
} }
declare module 'ipfs'
declare module 'ipfs-http-client'
declare module 'react-collapsed'
declare module 'filesize'

View File

@ -1 +0,0 @@
declare module 'react-collapsed'

View File

@ -1 +0,0 @@
declare module 'truffle-hdwallet-provider'

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import { fireEvent, render } from '@testing-library/react' import { fireEvent, render, act } from '@testing-library/react'
import Dropzone from './Dropzone' import Dropzone from './Dropzone'
function mockData(files: any) { function mockData(files: any) {
@ -38,15 +38,17 @@ test('invoke onDragEnter when dragenter event occurs', async () => {
const data = mockData([file]) const data = mockData([file])
const handleOnDrop = jest.fn() const handleOnDrop = jest.fn()
const ui = <Dropzone handleOnDrop={handleOnDrop} /> await act(async () => {
const { container } = render(ui) const ui = <Dropzone handleOnDrop={handleOnDrop} />
const { container } = render(ui)
// drop a file // drop a file
const dropzone = container.querySelector('div') const dropzone = container.querySelector('div')
dispatchEvt(dropzone, 'dragenter', data) dispatchEvt(dropzone, 'dragenter', data)
dispatchEvt(dropzone, 'dragover', data) dispatchEvt(dropzone, 'dragover', data)
dispatchEvt(dropzone, 'drop', data) dispatchEvt(dropzone, 'drop', data)
await flushPromises(ui, container) await flushPromises(ui, container)
})
expect(handleOnDrop).toHaveBeenCalled() expect(handleOnDrop).toHaveBeenCalled()
}) })

View File

@ -1,6 +1,6 @@
import Web3 from 'web3' import Web3 from 'web3'
import { nodeUri } from '../config' import { nodeUri } from '../config'
import HDWalletProvider from 'truffle-hdwallet-provider' import HDWalletProvider from '@truffle/hdwallet-provider'
import { requestFromFaucet } from '../ocean' import { requestFromFaucet } from '../ocean'
const bip39 = require('bip39') // eslint-disable-line @typescript-eslint/no-var-requires const bip39 = require('bip39') // eslint-disable-line @typescript-eslint/no-var-requires
@ -28,7 +28,7 @@ export class BurnerWalletProvider {
const isLogged = await this.isLogged() const isLogged = await this.isLogged()
if (isLogged) { if (isLogged) {
mnemonic = (await localStorage.getItem('seedphrase')) as string mnemonic = localStorage.getItem('seedphrase')
} else { } else {
mnemonic = bip39.generateMnemonic() mnemonic = bip39.generateMnemonic()
localStorage.setItem('seedphrase', mnemonic) localStorage.setItem('seedphrase', mnemonic)
@ -36,12 +36,12 @@ export class BurnerWalletProvider {
localStorage.setItem('logType', 'BurnerWallet') localStorage.setItem('logType', 'BurnerWallet')
const provider = new HDWalletProvider(mnemonic, `${nodeUri}`, 0, 1) const provider = new HDWalletProvider(mnemonic, `${nodeUri}`, 0, 1)
this.web3 = new Web3(provider) this.web3 = new Web3(provider as any)
const accounts = await this.web3.eth.getAccounts() const accounts = await this.web3.eth.getAccounts()
const balance = await this.web3.eth.getBalance(accounts[0]) const balance = await this.web3.eth.getBalance(accounts[0])
// fill with Ether if account balance is empty // fill with Ether if account balance is empty
balance === '0' && (await requestFromFaucet(provider.addresses[0])) balance === '0' && (await requestFromFaucet(provider.getAddress(0)))
} }
public async logout() { public async logout() {

View File

@ -12,40 +12,6 @@ const POLL_ACCOUNTS = 1000 // every 1s
const POLL_NETWORK = POLL_ACCOUNTS * 60 // every 1 min const POLL_NETWORK = POLL_ACCOUNTS * 60 // every 1 min
const DEFAULT_WEB3 = new Web3(new Web3.providers.HttpProvider(nodeUri)) // default web3 const DEFAULT_WEB3 = new Web3(new Web3.providers.HttpProvider(nodeUri)) // default web3
// taken from
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web3/providers.d.ts
interface JsonRPCRequest {
jsonrpc: string
method: string
params: any[]
id: number
}
interface JsonRPCResponse {
jsonrpc: string
id: number
result?: any
error?: string
}
interface Callback<ResultType> {
(error: Error): void
(error: null, val: ResultType): void
}
declare global {
interface Window {
web3: Web3
ethereum: {
enable(): void
send(
payload: JsonRPCRequest,
callback: Callback<JsonRPCResponse>
): any
}
}
}
interface UserProviderState { interface UserProviderState {
isLogged: boolean isLogged: boolean
isBurner: boolean isBurner: boolean

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import { render, wait } from '@testing-library/react' import { render, wait, act } from '@testing-library/react'
import useIpfs from './use-ipfs' import useIpfs from './use-ipfs'
export default function TestComponent() { export default function TestComponent() {
@ -15,8 +15,13 @@ export default function TestComponent() {
describe('use-ipfs', () => { describe('use-ipfs', () => {
it('renders without crashing', async () => { it('renders without crashing', async () => {
const { container, getByText } = render(<TestComponent />) let element: any
expect(container.firstChild).toBeInTheDocument()
await wait(() => getByText('Ready')) await act(async () => {
element = render(<TestComponent />)
})
expect(element.container.firstChild).toBeInTheDocument()
await wait(() => element.getByText('Ready'))
}) })
}) })

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import { render, fireEvent } from '@testing-library/react' import { render, fireEvent, act } from '@testing-library/react'
import { MemoryRouter } from 'react-router' import { MemoryRouter } from 'react-router'
import { createMemoryHistory, createLocation } from 'history' import { createMemoryHistory, createLocation } from 'history'
import Faucet from '.' import Faucet from '.'
@ -32,11 +32,7 @@ const setup = () => {
) )
const button = utils.getByText('Request ETH') const button = utils.getByText('Request ETH')
const { container } = utils const { container } = utils
return { return { button, container, ...utils }
button,
container,
...utils
}
} }
describe('Faucet', () => { describe('Faucet', () => {
@ -47,17 +43,15 @@ describe('Faucet', () => {
it('shows actions when connected', () => { it('shows actions when connected', () => {
const { button } = setup() const { button } = setup()
expect(button).toBeInTheDocument() expect(button).toBeInTheDocument()
expect(button).not.toHaveAttribute('disabled') expect(button).not.toHaveAttribute('disabled')
}) })
it('fires requestFromFaucet', () => { it('fires requestFromFaucet', async () => {
const { button, getByText } = setup() await act(async () => {
const { button } = setup()
fireEvent.click(button) fireEvent.click(button)
})
expect(userMockConnected.requestFromFaucet).toHaveBeenCalledTimes(1) expect(userMockConnected.requestFromFaucet).toHaveBeenCalledTimes(1)
// check for spinner
expect(getByText('Getting ETH...')).toBeInTheDocument()
}) })
}) })

View File

@ -11,11 +11,11 @@ describe('IPFS', () => {
}) })
it('HTTP API: files can be dropped', async () => { it('HTTP API: files can be dropped', async () => {
const { container, findByText, getByText } = render(ui) const { container, getByText } = render(ui)
expect(container).toBeInTheDocument() expect(container).toBeInTheDocument()
// wait for IPFS node // wait for IPFS node
await findByText(/Connected to /) await waitForElement(() => getByText(/Connected to /))
// drop a file // drop a file
const dropzoneInput = container.querySelector('.dropzone') const dropzoneInput = container.querySelector('.dropzone')

View File

@ -67,17 +67,19 @@ describe('Files', () => {
}) })
it('new IPFS file form can be opened and closed', async () => { it('new IPFS file form can be opened and closed', async () => {
const { container, getByText } = renderComponent() const { getByText } = renderComponent()
// open // open
fireEvent.click(getByText('+ Add to IPFS')) fireEvent.click(getByText('+ Add to IPFS'))
await waitForElement(() => getByText('- Cancel')) const text = await waitForElement(() =>
expect(container.querySelector('.ipfsForm')).toBeInTheDocument() getByText(/Connected to / || /IPFS connection error/)
)
expect(text).toBeInTheDocument()
// close // close
fireEvent.click(getByText('- Cancel')) fireEvent.click(getByText('- Cancel'))
await waitForElement(() => getByText('+ Add to IPFS')) await waitForElement(() => getByText('+ Add to IPFS'))
expect(container.querySelector('.ipfsForm')).not.toBeInTheDocument() expect(text).not.toBeInTheDocument()
}) })
it('item can be removed', async () => { it('item can be removed', async () => {

View File

@ -1,21 +1,3 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
import '@testing-library/jest-dom/extend-expect' import '@testing-library/jest-dom/extend-expect'
import '@testing-library/react/cleanup-after-each'
// this is just a little hack to silence a warning that we'll get until we
// upgrade to 16.9: https://github.com/facebook/react/pull/14853
const originalError = console.error
beforeAll(() => {
console.error = (...args) => {
if (/Warning.*not wrapped in act/.test(args[0])) {
return
}
originalError.call(console, ...args)
}
})
afterAll(() => {
console.error = originalError
})

View File

@ -25,7 +25,7 @@ describe('Publish', () => {
.contains('Add File') .contains('Add File')
.click() .click()
// Verify and nove to next step // Verify and nove to next step
cy.get('button') cy.get('button', { timeout: 60000 })
.contains('Next →') .contains('Next →')
.should('not.be.disabled') .should('not.be.disabled')
.click() .click()
@ -93,7 +93,7 @@ describe('Publish', () => {
.contains('Add File') .contains('Add File')
.click() .click()
// Verify and nove to next step // Verify and nove to next step
cy.get('button') cy.get('button', { timeout: 60000 })
.contains('Next →') .contains('Next →')
.should('not.be.disabled') .should('not.be.disabled')
.click() .click()

View File

@ -1,38 +1,31 @@
/// <reference types="Cypress" /> /// <reference types="Cypress" />
describe('Consume', () => { describe('Consume', () => {
beforeEach(() => { it('should consume https:// file', () => {
cy.fixture('did').then(did => { cy.fixture('did').then(did => {
cy.visit(`/asset/${did}`) cy.visit(`/asset/${did}`)
}) })
// Alias button selector & wait for end of loading // Button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 }) cy.get('button[name="Download"]', { timeout: 60000 }).should(
.first() 'not.be.disabled'
.should('have.length', 1) )
})
it('Download button is clickable when user is connected.', () => {
cy.get('button[name="Download"]').should('not.be.disabled')
})
it('should consume https:// file', () => {
// eslint-disable-next-line // eslint-disable-next-line
cy.wait(10000) cy.wait(5000)
// Wait for faucet // Wait for faucet
// Click consume button // Click consume button
cy.get('button[name="Download"]').click() cy.get('button[name="Download"]').click()
// Wait consume process to end // Wait consume process to end
cy.get('button[name="Download"]', { timeout: 600000 }).should( cy.get('button[name="Download"]', {
'contain', timeout: 600000
'Get file' }).should('contain', 'Get file')
)
// check if there is no error // check if there is no error
cy.get('article>div').should( cy.get('article>div').should(
'not.contain', 'not.contain',
'. Sorry about that, can you try again?' '. Sorry about that, can you try again?'
) )
// eslint-disable-next-line // eslint-disable-next-line
cy.wait(10000) cy.wait(5000)
// wait for file to download before closing browser // wait for file to download before closing browser
// to prevent alert poping up // to prevent alert poping up
}) })
@ -42,28 +35,27 @@ describe('Consume', () => {
cy.visit(`/asset/${did}`) cy.visit(`/asset/${did}`)
}) })
// Alias button selector & wait for end of loading // Button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 }) cy.get('button[name="Download"]', { timeout: 60000 }).should(
.first() 'not.be.disabled'
.should('have.length', 1) )
// eslint-disable-next-line // eslint-disable-next-line
cy.wait(10000) cy.wait(5000)
// Wait for faucet // Wait for faucet
// Click consume button // Click consume button
cy.get('button[name="Download"]').click() cy.get('button[name="Download"]').click()
// Wait consume process to end // Wait consume process to end
cy.get('button[name="Download"]', { timeout: 600000 }).should( cy.get('button[name="Download"]', {
'contain', timeout: 600000
'Get file' }).should('contain', 'Get file')
)
// check if there is no error // check if there is no error
cy.get('article>div').should( cy.get('article>div').should(
'not.contain', 'not.contain',
'. Sorry about that, can you try again?' '. Sorry about that, can you try again?'
) )
// eslint-disable-next-line // eslint-disable-next-line
cy.wait(10000) cy.wait(5000)
// wait for file to download before closing browser // wait for file to download before closing browser
// to prevent alert poping up // to prevent alert poping up
}) })

View File

@ -7,11 +7,11 @@
"dependencies": [ "dependencies": [
{ {
"name": "keeper-contracts", "name": "keeper-contracts",
"version": "~0.11.1" "version": "~0.12.6"
}, },
{ {
"name": "brizo", "name": "brizo",
"version": "~0.4.2" "version": "~0.4.5"
}, },
{ {
"name": "aquarius", "name": "aquarius",
@ -19,7 +19,7 @@
}, },
{ {
"name": "squid-js", "name": "squid-js",
"version": "~0.7.2" "version": "~0.8.0"
}, },
{ {
"name": "faucet", "name": "faucet",

1326
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,27 +24,27 @@
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@release-it/bumper": "^1.0.3", "@release-it/bumper": "^1.0.5",
"@typescript-eslint/eslint-plugin": "^1.13.0", "@typescript-eslint/eslint-plugin": "^2.6.0",
"@typescript-eslint/parser": "^1.13.0", "@typescript-eslint/parser": "^2.6.0",
"auto-changelog": "^1.16.0", "auto-changelog": "^1.16.2",
"concurrently": "^4.1.2", "concurrently": "^5.0.0",
"cypress": "^3.4.1", "cypress": "^3.6.0",
"cypress-log-to-output": "^1.0.4", "cypress-log-to-output": "^1.0.7",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-config-oceanprotocol": "1.4.0", "eslint-config-oceanprotocol": "1.4.0",
"eslint-config-prettier": "^6.1.0", "eslint-config-prettier": "^6.5.0",
"eslint-plugin-cypress": "^2.6.1", "eslint-plugin-cypress": "^2.7.0",
"eslint-plugin-prettier": "^3.1.0", "eslint-plugin-prettier": "^3.1.1",
"prettier": "^1.18.2", "prettier": "^1.18.2",
"prettier-stylelint": "^0.4.2", "prettier-stylelint": "^0.4.2",
"release-it": "^12.3.6", "release-it": "^12.4.3",
"start-server-and-test": "^1.10.0", "start-server-and-test": "^1.10.6",
"stylelint": "^10.1.0", "stylelint": "^11.1.1",
"stylelint-config-bigchaindb": "^1.2.2", "stylelint-config-bigchaindb": "^1.2.2",
"stylelint-config-css-modules": "^1.4.0", "stylelint-config-css-modules": "^1.5.0",
"stylelint-config-standard": "^18.3.0", "stylelint-config-standard": "^19.0.0",
"typescript": "^3.6.2" "typescript": "^3.6.4"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -514,9 +514,9 @@
} }
}, },
"@types/jest": { "@types/jest": {
"version": "24.0.18", "version": "24.0.21",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.18.tgz", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.21.tgz",
"integrity": "sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ==", "integrity": "sha512-uyqFvx78Tuy0h5iLCPWRCvi5HhWwEqhIj30doitp191oYLqlCxUyAJHdWVm5+Nr271/vPnkyt6rWeEIjGowBTg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/jest-diff": "*" "@types/jest-diff": "*"
@ -544,9 +544,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "12.7.3", "version": "12.12.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.3.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.0.tgz",
"integrity": "sha512-3SiLAIBkDWDg6vFo0+5YJyHPWU9uwu40Qe+v+0MH8wRKYBimHvvAOyk3EzMrD/TrIlLYfXrqDqrg913PynrMJQ==" "integrity": "sha512-6N8Sa5AaENRtJnpKXZgvc119PKxT1Lk9VPy4kfT8JF23tIe1qDfaGkBR2DRKJFIA7NptMz+fps//C6aLi1Uoug=="
}, },
"@types/range-parser": { "@types/range-parser": {
"version": "1.2.3", "version": "1.2.3",
@ -555,9 +555,9 @@
"dev": true "dev": true
}, },
"@types/request": { "@types/request": {
"version": "2.48.2", "version": "2.48.3",
"resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.2.tgz", "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.3.tgz",
"integrity": "sha512-gP+PSFXAXMrd5PcD7SqHeUjdGshAI8vKQ3+AvpQr3ht9iQea+59LOKvKITcQI+Lg+1EIkDP6AFSBUJPWG8GDyA==", "integrity": "sha512-3Wo2jNYwqgXcIz/rrq18AdOZUQB8cQ34CXZo+LUwPJNpvRAL86+Kc2wwI8mqpz9Cr1V+enIox5v+WZhy/p3h8w==",
"requires": { "requires": {
"@types/caseless": "*", "@types/caseless": "*",
"@types/node": "*", "@types/node": "*",
@ -1162,9 +1162,9 @@
} }
}, },
"chokidar": { "chokidar": {
"version": "2.1.6", "version": "2.1.8",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
"integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==",
"dev": true, "dev": true,
"requires": { "requires": {
"anymatch": "^2.0.0", "anymatch": "^2.0.0",
@ -1656,9 +1656,9 @@
} }
}, },
"dotenv": { "dotenv": {
"version": "8.1.0", "version": "8.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA==" "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
}, },
"duplexer3": { "duplexer3": {
"version": "0.1.4", "version": "0.1.4",
@ -3228,9 +3228,9 @@
} }
}, },
"is-retry-allowed": { "is-retry-allowed": {
"version": "1.1.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz",
"integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==",
"dev": true "dev": true
}, },
"is-stream": { "is-stream": {
@ -3949,6 +3949,12 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
}, },
"lodash.memoize": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
"integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=",
"dev": true
},
"lodash.sortby": { "lodash.sortby": {
"version": "4.7.0", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
@ -4243,18 +4249,18 @@
} }
}, },
"nodemon": { "nodemon": {
"version": "1.19.1", "version": "1.19.4",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.1.tgz", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.4.tgz",
"integrity": "sha512-/DXLzd/GhiaDXXbGId5BzxP1GlsqtMGM9zTmkWrgXtSqjKmGSbLicM/oAy4FR0YWm14jCHRwnR31AHS2dYFHrg==", "integrity": "sha512-VGPaqQBNk193lrJFotBU8nvWZPqEZY2eIzymy2jjY0fJ9qIsxA0sxQ8ATPl0gZC645gijYEc1jtZvpS8QWzJGQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"chokidar": "^2.1.5", "chokidar": "^2.1.8",
"debug": "^3.1.0", "debug": "^3.2.6",
"ignore-by-default": "^1.0.1", "ignore-by-default": "^1.0.1",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"pstree.remy": "^1.1.6", "pstree.remy": "^1.1.7",
"semver": "^5.5.0", "semver": "^5.7.1",
"supports-color": "^5.2.0", "supports-color": "^5.5.0",
"touch": "^3.1.0", "touch": "^3.1.0",
"undefsafe": "^2.0.2", "undefsafe": "^2.0.2",
"update-notifier": "^2.5.0" "update-notifier": "^2.5.0"
@ -4274,6 +4280,12 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true "dev": true
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
} }
} }
}, },
@ -5741,15 +5753,16 @@
"dev": true "dev": true
}, },
"ts-jest": { "ts-jest": {
"version": "24.0.2", "version": "24.1.0",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.1.0.tgz",
"integrity": "sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==", "integrity": "sha512-HEGfrIEAZKfu1pkaxB9au17b1d9b56YZSqz5eCVE8mX68+5reOvlM93xGOzzCREIov9mdH7JBG+s0UyNAqr0tQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"bs-logger": "0.x", "bs-logger": "0.x",
"buffer-from": "1.x", "buffer-from": "1.x",
"fast-json-stable-stringify": "2.x", "fast-json-stable-stringify": "2.x",
"json5": "2.x", "json5": "2.x",
"lodash.memoize": "4.x",
"make-error": "1.x", "make-error": "1.x",
"mkdirp": "0.x", "mkdirp": "0.x",
"resolve": "1.x", "resolve": "1.x",
@ -5775,9 +5788,9 @@
} }
}, },
"ts-node": { "ts-node": {
"version": "8.3.0", "version": "8.4.1",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", "integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
"dev": true, "dev": true,
"requires": { "requires": {
"arg": "^4.1.0", "arg": "^4.1.0",
@ -5819,9 +5832,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "3.6.2", "version": "3.6.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz",
"integrity": "sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==", "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==",
"dev": true "dev": true
}, },
"uglify-js": { "uglify-js": {
@ -5928,9 +5941,9 @@
"dev": true "dev": true
}, },
"upath": { "upath": {
"version": "1.1.2", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
"integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==",
"dev": true "dev": true
}, },
"update-notifier": { "update-notifier": {
@ -6249,9 +6262,9 @@
} }
}, },
"yn": { "yn": {
"version": "3.1.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true "dev": true
} }
} }

View File

@ -8,7 +8,7 @@
"start": "nodemon --exec ts-node src/server.ts", "start": "nodemon --exec ts-node src/server.ts",
"serve": "node dist/src/server.js", "serve": "node dist/src/server.js",
"build": "tsc", "build": "tsc",
"test": "jest --coverage", "test": "jest --coverage --silent",
"test:watch": "jest --coverage --watch", "test:watch": "jest --coverage --watch",
"coverage": "cat coverage/lcov.info | codacy-coverage --token 8801f827fe1144ffa85cd7da94f2bbf7" "coverage": "cat coverage/lcov.info | codacy-coverage --token 8801f827fe1144ffa85cd7da94f2bbf7"
}, },
@ -17,7 +17,7 @@
"body-parser": "^1.18.3", "body-parser": "^1.18.3",
"compression": "^1.7.4", "compression": "^1.7.4",
"debug": "^4.1.1", "debug": "^4.1.1",
"dotenv": "^8.1.0", "dotenv": "^8.2.0",
"express": "^4.17.1", "express": "^4.17.1",
"express-validator": "^6.2.0", "express-validator": "^6.2.0",
"morgan": "^1.9.1", "morgan": "^1.9.1",
@ -28,23 +28,26 @@
"@types/compression": "^1.0.1", "@types/compression": "^1.0.1",
"@types/debug": "^4.1.5", "@types/debug": "^4.1.5",
"@types/express": "^4.17.1", "@types/express": "^4.17.1",
"@types/jest": "^24.0.18", "@types/jest": "^24.0.21",
"@types/morgan": "^1.7.37", "@types/morgan": "^1.7.37",
"@types/node": "^12.7.3", "@types/node": "^12.12.0",
"@types/request": "^2.48.2", "@types/request": "^2.48.3",
"@types/supertest": "^2.0.8", "@types/supertest": "^2.0.8",
"jest": "^24.9.0", "jest": "^24.9.0",
"nodemon": "^1.19.1", "nodemon": "^1.19.4",
"supertest": "^4.0.2", "supertest": "^4.0.2",
"ts-jest": "^24.0.2", "ts-jest": "^24.1.0",
"ts-node": "^8.3.0", "ts-node": "^8.4.1",
"typescript": "^3.6.2" "typescript": "^3.6.4"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/oceanprotocol/commons" "url": "https://github.com/oceanprotocol/commons"
}, },
"jest": { "jest": {
"preset": "ts-jest" "preset": "ts-jest",
"collectCoverageFrom": [
"src/**/*.{ts,tsx}"
]
} }
} }