Upgrade dependencies (#577)
This commit is contained in:
+5138
-5699
File diff suppressed because it is too large
Load Diff
@@ -21,10 +21,10 @@
|
||||
"bcrypt": "^5.0.1",
|
||||
"crypto-random-string": "^3.3.1",
|
||||
"eslint": "^7.29.0",
|
||||
"knex": "^0.95.11",
|
||||
"knex": "^1.0.1",
|
||||
"node-fetch": "^2.6.5",
|
||||
"pg": "^8.7.1",
|
||||
"web-ifc": "0.0.24"
|
||||
"web-ifc": "^0.0.33"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.13"
|
||||
|
||||
Generated
+9098
-8381
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,9 @@ prometheusClient.collectDefaultMetrics()
|
||||
var app = express()
|
||||
|
||||
app.use( logger( 'dev' ) )
|
||||
app.use( express.json() )
|
||||
app.use( express.urlencoded( { extended: false } ) )
|
||||
|
||||
app.use( express.json( { limit: '100mb' } ) )
|
||||
app.use( express.urlencoded( { limit: '100mb', extended: false } ) )
|
||||
app.use( cookieParser() )
|
||||
app.use( express.static( path.join( __dirname, 'public' ) ) )
|
||||
|
||||
|
||||
+12367
-5282
File diff suppressed because it is too large
Load Diff
@@ -14,21 +14,20 @@
|
||||
"build-fe": "webpack --env dev --config webpack.config.render_page.js && webpack --env build --config webpack.config.render_page.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@speckle/objectloader": "^2.2.0",
|
||||
"@speckle/viewer": "^2.2.0",
|
||||
"@speckle/objectloader": "file:../objectloader",
|
||||
"@speckle/viewer": "file:../viewer",
|
||||
"cookie-parser": "~1.4.4",
|
||||
"crypto": "^1.0.1",
|
||||
"debug": "~2.6.9",
|
||||
"express": "~4.16.1",
|
||||
"file-type": "^16.3.0",
|
||||
"http-errors": "~1.6.3",
|
||||
"jade": "^0.29.0",
|
||||
"knex": "^0.95.4",
|
||||
"knex": "^1.0.1",
|
||||
"morgan": "~1.9.1",
|
||||
"node-fetch": "^2.6.1",
|
||||
"pg": "^8.6.0",
|
||||
"pg-query-stream": "^4.1.0",
|
||||
"prom-client": "^13.1.0",
|
||||
"prom-client": "^14.0.1",
|
||||
"puppeteer": "^13.1.1",
|
||||
"yargs": "^17.3.0",
|
||||
"zlib": "^1.0.5"
|
||||
|
||||
@@ -18,7 +18,6 @@ const RefreshTokens = ( ) => knex( 'refresh_tokens' )
|
||||
module.exports = {
|
||||
|
||||
async getApp( { id } ) {
|
||||
|
||||
let allScopes = await Scopes( ).select( '*' )
|
||||
|
||||
let app = await ServerApps( ).select( '*' ).where( { id: id } ).first( )
|
||||
@@ -29,11 +28,9 @@ module.exports = {
|
||||
app.scopes = allScopes.filter( scope => appScopeNames.indexOf( scope.name ) !== -1 )
|
||||
app.author = await Users( ).select( 'id', 'name', 'avatar' ).where( { id: app.authorId } ).first( )
|
||||
return app
|
||||
|
||||
},
|
||||
|
||||
async getAllPublicApps( ) {
|
||||
|
||||
let apps = await ServerApps( )
|
||||
.select( 'server_apps.id', 'server_apps.name', 'server_apps.description', 'server_apps.logo', 'server_apps.termsAndConditionsLink', 'users.name as authorName', 'users.id as authorId' )
|
||||
.where( { public: true } )
|
||||
@@ -52,7 +49,6 @@ module.exports = {
|
||||
},
|
||||
|
||||
async getAllAppsCreatedByUser( { userId } ) {
|
||||
|
||||
let apps = await ServerApps( )
|
||||
.select( 'server_apps.id', 'server_apps.secret', 'server_apps.name', 'server_apps.description', 'server_apps.redirectUrl', 'server_apps.logo', 'server_apps.termsAndConditionsLink', 'users.name as authorName', 'users.id as authorId' )
|
||||
.where( { authorId: userId } )
|
||||
@@ -70,7 +66,6 @@ module.exports = {
|
||||
},
|
||||
|
||||
async getAllAppsAuthorizedByUser( { userId } ) {
|
||||
|
||||
let query = knex.raw( `
|
||||
SELECT DISTINCT ON (a."appId") a."appId" as id, sa."name", sa."description", sa."trustByDefault", sa."redirectUrl" as "redirectUrl", sa.logo, sa."termsAndConditionsLink", json_build_object('name', u.name, 'id', sa."authorId") as author
|
||||
FROM user_server_app_tokens a
|
||||
@@ -84,7 +79,6 @@ module.exports = {
|
||||
},
|
||||
|
||||
async createApp( app ) {
|
||||
|
||||
app.id = crs( { length: 10 } )
|
||||
app.secret = crs( { length: 10 } )
|
||||
|
||||
@@ -101,11 +95,9 @@ module.exports = {
|
||||
await ServerApps( ).insert( app )
|
||||
await ServerAppsScopes( ).insert( scopes.map( s => ( { appId: app.id, scopeName: s } ) ) )
|
||||
return { id: app.id, secret: app.secret }
|
||||
|
||||
},
|
||||
|
||||
async updateApp( { app } ) {
|
||||
|
||||
// any app update should nuke everything and force users to re-authorize it.
|
||||
await module.exports.revokeExistingAppCredentials( { appId: app.id } )
|
||||
|
||||
@@ -120,18 +112,15 @@ module.exports = {
|
||||
delete app.secret
|
||||
delete app.scopes
|
||||
|
||||
let [ res ] = await ServerApps( ).returning( 'id' ).where( { id: app.id } ).update( app )
|
||||
|
||||
return res
|
||||
let [ { id } ] = await ServerApps( ).returning( 'id' ).where( { id: app.id } ).update( app )
|
||||
|
||||
return id
|
||||
},
|
||||
|
||||
async deleteApp( { id } ) {
|
||||
|
||||
await module.exports.revokeExistingAppCredentials( { appId: id } )
|
||||
|
||||
return await ServerApps( ).where( { id: id } ).del( )
|
||||
|
||||
},
|
||||
|
||||
async revokeRefreshToken( { tokenId } ) {
|
||||
@@ -144,7 +133,6 @@ module.exports = {
|
||||
},
|
||||
|
||||
async revokeExistingAppCredentials( { appId } ) {
|
||||
|
||||
let resAccessCodeDelete = await AuthorizationCodes( ).where( { appId: appId } ).del( )
|
||||
let resRefreshTokenDelete = await RefreshTokens( ).where( { appId: appId } ).del( )
|
||||
|
||||
@@ -155,11 +143,9 @@ module.exports = {
|
||||
.del( )
|
||||
|
||||
return resApiTokenDelete
|
||||
|
||||
},
|
||||
|
||||
async revokeExistingAppCredentialsForUser( { appId, userId } ) {
|
||||
|
||||
let resAccessCodeDelete = await AuthorizationCodes( ).where( { appId: appId, userId: userId } ).del( )
|
||||
let resRefreshTokenDelete = await RefreshTokens( ).where( { appId: appId, userId: userId } ).del( )
|
||||
let resApiTokenDelete = await ApiTokens( )
|
||||
@@ -169,11 +155,9 @@ module.exports = {
|
||||
.del( )
|
||||
|
||||
return resApiTokenDelete
|
||||
|
||||
},
|
||||
|
||||
async createAuthorizationCode( { appId, userId, challenge } ) {
|
||||
|
||||
let ac = {
|
||||
id: crs( { length: 42 } ),
|
||||
appId: appId,
|
||||
@@ -183,11 +167,9 @@ module.exports = {
|
||||
|
||||
await AuthorizationCodes( ).insert( ac )
|
||||
return ac.id
|
||||
|
||||
},
|
||||
|
||||
async createAppTokenFromAccessCode( { appId, appSecret, accessCode, challenge } ) {
|
||||
|
||||
let code = await AuthorizationCodes( ).select( ).where( { id: accessCode } ).first( )
|
||||
|
||||
if ( !code ) throw new Error( 'Access code not found.' )
|
||||
@@ -230,11 +212,9 @@ module.exports = {
|
||||
token: appToken,
|
||||
refreshToken: bareToken.tokenId + bareToken.tokenString
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
async refreshAppToken( { refreshToken, appId, appSecret } ) {
|
||||
|
||||
let refreshTokenId = refreshToken.slice( 0, 10 )
|
||||
let refreshTokenContent = refreshToken.slice( 10, 42 )
|
||||
|
||||
@@ -282,6 +262,5 @@ module.exports = {
|
||||
token: appToken,
|
||||
refreshToken: bareToken.tokenId + bareToken.tokenString
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
'use strict'
|
||||
const zlib = require( 'zlib' )
|
||||
const Busboy = require( 'busboy' )
|
||||
const debug = require( 'debug' )
|
||||
const appRoot = require( 'app-root-path' )
|
||||
const cors = require( 'cors' )
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict'
|
||||
const zlib = require( 'zlib' )
|
||||
const cors = require( 'cors' )
|
||||
const Busboy = require( 'busboy' )
|
||||
const debug = require( 'debug' )
|
||||
const appRoot = require( 'app-root-path' )
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
'use strict'
|
||||
const zlib = require( 'zlib' )
|
||||
const Busboy = require( 'busboy' )
|
||||
const debug = require( 'debug' )
|
||||
const appRoot = require( 'app-root-path' )
|
||||
const cors = require( 'cors' )
|
||||
|
||||
@@ -22,17 +22,19 @@ module.exports = ( app ) => {
|
||||
return res.status( hasStreamAccess.status ).end()
|
||||
}
|
||||
|
||||
let busboy = new Busboy( { headers: req.headers } )
|
||||
let busboy = Busboy( { headers: req.headers } )
|
||||
let totalProcessed = 0
|
||||
let last = {}
|
||||
|
||||
let promises = [ ]
|
||||
let requestDropped = false
|
||||
|
||||
busboy.on( 'file', ( fieldname, file, filename, encoding, mimetype ) => {
|
||||
busboy.on( 'file', ( name, file, info ) => {
|
||||
const { filename, encoding, mimeType } = info
|
||||
|
||||
if ( requestDropped ) return
|
||||
|
||||
if ( mimetype === 'application/gzip' ) {
|
||||
if ( mimeType === 'application/gzip' ) {
|
||||
let buffer = [ ]
|
||||
|
||||
file.on( 'data', ( data ) => {
|
||||
@@ -80,7 +82,7 @@ module.exports = ( app ) => {
|
||||
|
||||
debug( 'speckle:info' )( `[User ${req.context.userId || '-'}] Uploaded batch of ${objs.length} objects to stream ${req.params.streamId} (size: ${gunzippedBuffer.length / 1000000} MB, duration: ${( Date.now() - t0 ) / 1000}s, crtMemUsage: ${process.memoryUsage( ).heapUsed / 1024 / 1024} MB, dropped=${requestDropped})` )
|
||||
} )
|
||||
} else if ( mimetype === 'text/plain' || mimetype === 'application/json' || mimetype === 'application/octet-stream' ) {
|
||||
} else if ( mimeType === 'text/plain' || mimeType === 'application/json' || mimeType === 'application/octet-stream' ) {
|
||||
let buffer = ''
|
||||
|
||||
file.on( 'data', ( data ) => {
|
||||
@@ -119,7 +121,7 @@ module.exports = ( app ) => {
|
||||
debug( 'speckle:info' )( `[User ${req.context.userId || '-'}] Uploaded batch of ${objs.length} objects to stream ${req.params.streamId} (size: ${buffer.length / 1000000} MB, duration: ${( Date.now() - t0 ) / 1000}s, crtMemUsage: ${process.memoryUsage( ).heapUsed / 1024 / 1024} MB, dropped=${requestDropped})` )
|
||||
} )
|
||||
} else {
|
||||
debug( 'speckle:error' )( `[User ${req.context.userId || '-'}] Invalid ContentType header: ${mimetype}` )
|
||||
debug( 'speckle:error' )( `[User ${req.context.userId || '-'}] Invalid ContentType header: ${mimeType}` )
|
||||
if ( !requestDropped ) res.status( 400 ).send( 'Invalid ContentType header. This route only accepts "application/gzip", "text/plain" or "application/json".' )
|
||||
requestDropped = true
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = {
|
||||
|
||||
if ( name ) module.exports.validateBranchName( { name } )
|
||||
|
||||
let [ id ] = await Branches( ).returning( 'id' ).insert( branch )
|
||||
let [ { id } ] = await Branches( ).returning( 'id' ).insert( branch )
|
||||
|
||||
// update stream updated at
|
||||
await Streams().where( { id: streamId } ).update( { updatedAt: knex.fn.now() } )
|
||||
|
||||
@@ -25,7 +25,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Create main table entry
|
||||
let [ id ] = await Commits( ).returning( 'id' ).insert( {
|
||||
let [ { id } ] = await Commits( ).returning( 'id' ).insert( {
|
||||
id: crs( { length: 10 } ),
|
||||
referencedObject: objectId,
|
||||
author: authorId,
|
||||
|
||||
@@ -21,7 +21,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Create the stream & set up permissions
|
||||
let [ streamId ] = await Streams( ).returning( 'id' ).insert( stream )
|
||||
let [ { id: streamId } ] = await Streams( ).returning( 'id' ).insert( stream )
|
||||
await Acl( ).insert( { userId: ownerId, resourceId: streamId, role: 'stream:owner' } )
|
||||
|
||||
// Create a default main branch
|
||||
@@ -40,11 +40,11 @@ module.exports = {
|
||||
},
|
||||
|
||||
async updateStream( { streamId, name, description, isPublic } ) {
|
||||
let [ res ] = await Streams( )
|
||||
let [ { id } ] = await Streams( )
|
||||
.returning( 'id' )
|
||||
.where( { id: streamId } )
|
||||
.update( { name, description, isPublic, updatedAt: knex.fn.now() } )
|
||||
return res
|
||||
return id
|
||||
},
|
||||
|
||||
async grantPermissionsStream( { streamId, userId, role } ) {
|
||||
|
||||
@@ -55,7 +55,7 @@ module.exports = {
|
||||
|
||||
let userRole = await countAdminUsers () === 0 ? 'server:admin' : 'server:user'
|
||||
|
||||
await Acl( ).insert( { userId: res[ 0 ], role: userRole } )
|
||||
await Acl( ).insert( { userId: res[ 0 ].id, role: userRole } )
|
||||
|
||||
let loggedUser = { ...user }
|
||||
delete loggedUser.passwordDigest
|
||||
@@ -69,7 +69,7 @@ module.exports = {
|
||||
message: 'User created'
|
||||
} )
|
||||
|
||||
return res[ 0 ]
|
||||
return res[ 0 ].id
|
||||
},
|
||||
|
||||
async findOrCreateUser( { user, rawProfile } ) {
|
||||
|
||||
@@ -104,7 +104,7 @@ describe( 'Actors & Tokens @user-services', () => {
|
||||
user.passwordDigest = await bcrypt.hash( user.password, 10 )
|
||||
delete user.password
|
||||
|
||||
const [ userId ] = await knex( 'users' ).returning( 'id' ).insert( user )
|
||||
const [ { id: userId } ] = await knex( 'users' ).returning( 'id' ).insert( user )
|
||||
|
||||
const userByEmail = await getUserByEmail( { email } )
|
||||
expect( userByEmail ).to.not.be.null
|
||||
|
||||
@@ -102,9 +102,10 @@ exports.init = async ( app, options ) => {
|
||||
}
|
||||
|
||||
let fileUploadPromises = []
|
||||
let busboy = new Busboy( { headers: req.headers } )
|
||||
let busboy = Busboy( { headers: req.headers } )
|
||||
|
||||
busboy.on( 'file', function( fieldname, file, filename, encoding, mimetype ) {
|
||||
busboy.on( 'file', ( name, file, info ) => {
|
||||
const { filename, encoding, mimeType } = info
|
||||
let promise = uploadFile( {
|
||||
streamId: req.params.streamId,
|
||||
branchName: req.params.branchName || '',
|
||||
|
||||
@@ -23,7 +23,7 @@ module.exports = {
|
||||
|
||||
let triggersObj = Object.assign( {}, ...triggers.map( ( x ) => ( { [ x ]: true } ) ) )
|
||||
|
||||
let [ id ] = await WebhooksConfig( ).returning( 'id' ).insert( {
|
||||
let [ { id } ] = await WebhooksConfig( ).returning( 'id' ).insert( {
|
||||
id: crs( { length: 10 } ),
|
||||
streamId,
|
||||
url,
|
||||
@@ -55,7 +55,7 @@ module.exports = {
|
||||
fieldsToUpdate.triggers = triggersObj
|
||||
}
|
||||
|
||||
let [ res ] = await WebhooksConfig( )
|
||||
let [ { id: res } ] = await WebhooksConfig( )
|
||||
.returning( 'id' )
|
||||
.where( { id } )
|
||||
.update( fieldsToUpdate )
|
||||
|
||||
Generated
+41839
-13913
File diff suppressed because it is too large
Load Diff
@@ -19,8 +19,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@godaddy/terminus": "^4.9.0",
|
||||
"@sentry/node": "^5.29.2",
|
||||
"@sentry/tracing": "^5.29.2",
|
||||
"@sentry/node": "^6.17.3",
|
||||
"@sentry/tracing": "^6.17.3",
|
||||
"apollo-server-express": "^2.19.0",
|
||||
"apollo-server-testing": "^2.19.0",
|
||||
"app-root-path": "^3.0.0",
|
||||
@@ -28,21 +28,21 @@
|
||||
"aws-sdk": "^2.989.0",
|
||||
"bcrypt": "^5.0.0",
|
||||
"body-parser": "^1.19.0",
|
||||
"busboy": "^0.3.1",
|
||||
"busboy": "^1.4.0",
|
||||
"compression": "^1.7.4",
|
||||
"connect-redis": "^4.0.4",
|
||||
"connect-redis": "^6.0.0",
|
||||
"crypto-random-string": "^3.2.0",
|
||||
"debug": "^4.3.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1",
|
||||
"express-session": "^1.17.1",
|
||||
"graphql": "^14.6.0",
|
||||
"graphql": "^15.8.0",
|
||||
"graphql-redis-subscriptions": "^2.2.2",
|
||||
"graphql-scalars": "^1.6.1",
|
||||
"graphql-tag": "^2.11.0",
|
||||
"graphql-tools": "^4.0.7",
|
||||
"ioredis": "^4.19.4",
|
||||
"knex": "^0.21.14",
|
||||
"knex": "^1.0.1",
|
||||
"lodash.chunk": "^4.2.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lodash.get": "^4.4.2",
|
||||
@@ -60,11 +60,11 @@
|
||||
"passport-google-oauth2": "^0.2.0",
|
||||
"passport-google-oauth20": "^2.0.0",
|
||||
"pg": "^8.5.1",
|
||||
"pg-query-stream": "^3.4.2",
|
||||
"prom-client": "^13.1.0",
|
||||
"pg-query-stream": "^4.2.1",
|
||||
"prom-client": "^14.0.1",
|
||||
"redis": "^3.1.1",
|
||||
"sanitize-html": "^2.4.0",
|
||||
"sharp": "^0.28.3",
|
||||
"sharp": "^0.29.3",
|
||||
"string-pixel-width": "^1.10.0",
|
||||
"xml-escape": "^1.1.0",
|
||||
"zxcvbn": "^4.4.2"
|
||||
@@ -77,10 +77,10 @@
|
||||
"apollo-link": "^1.2.14",
|
||||
"apollo-link-http": "^1.5.17",
|
||||
"apollo-link-ws": "^1.0.20",
|
||||
"axios": "^0.21.4",
|
||||
"axios": "^0.25.0",
|
||||
"chai": "^4.2.0",
|
||||
"chai-http": "^4.3.0",
|
||||
"concurrently": "^5.2.0",
|
||||
"concurrently": "^7.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^7.16.0",
|
||||
"http-proxy-middleware": "^1.0.6",
|
||||
|
||||
Generated
+21328
-9317
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,6 @@
|
||||
"hold-event": "^0.1.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"rainbowvis.js": "^1.0.1",
|
||||
"three": "^0.134.0"
|
||||
"three": "^0.136.0"
|
||||
}
|
||||
}
|
||||
|
||||
+884
-360
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@
|
||||
"dev": "cross-env ALLOW_LOCAL_NETWORK=true node src/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"knex": "^0.95.7",
|
||||
"knex": "^1.0.1",
|
||||
"node-fetch": "^2.6.1",
|
||||
"pg": "^8.6.0",
|
||||
"private-ip": "^2.3.3"
|
||||
|
||||
@@ -7,7 +7,7 @@ const fs = require( 'fs' )
|
||||
let shouldExit = false
|
||||
const HEALTHCHECK_FILE_PATH = '/tmp/last_successful_query'
|
||||
|
||||
const { makeNetworkRequest, isLocalNetworkUrl } = require( './webhookCaller' )
|
||||
const { makeNetworkRequest } = require( './webhookCaller' )
|
||||
|
||||
async function startTask() {
|
||||
let { rows } = await knex.raw( `
|
||||
|
||||
Reference in New Issue
Block a user