Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flowfuse/flowfuse

Package Overview
Dependencies
Maintainers
2
Versions
964
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flowfuse/flowfuse - npm Package Compare versions

Comparing version 1.15.1-a295288-202401040927.0 to 1.15.1-c64aa28-202401091513.0

forge/auditLog/device.js

2

forge/auditLog/index.js
const fp = require('fastify-plugin')
const application = require('./application')
const device = require('./device')
const formatters = require('./formatters')

@@ -17,2 +18,3 @@ const platform = require('./platform')

Platform: platform.getLoggers(app),
Device: device.getLoggers(app),
formatters

@@ -19,0 +21,0 @@ }

@@ -77,3 +77,12 @@ function encodeBody (body) {

addToLog(app, 'team', TeamId, event, body)
},
deviceLog: async function (app, DeviceId, UserId, event, body) {
await app.db.models.AuditLog.create({
entityType: 'device',
entityId: DeviceId,
UserId,
event,
body: encodeBody(body)
})
}
}

@@ -56,2 +56,9 @@ /**

},
forDevice: async (deviceId, pagination = {}) => {
const where = {
entityId: deviceId.toString(),
entityType: 'device'
}
return M.AuditLog.forEntity(where, pagination)
},
forEntity: async (where = {}, pagination = {}) => {

@@ -58,0 +65,0 @@ const limit = parseInt(pagination.limit) || 1000

@@ -126,5 +126,7 @@ const { generateToken } = require('../../../db/utils')

await app.auditLog.Team.team.device.remoteAccess.enabled(request.session.User, tunnelStatus, team, request.device)
await app.auditLog.Device.device.remoteAccess.enabled(request.session.User, tunnelStatus, request.device)
reply.code(503).send(tunnelStatus) // Service Unavailable
} else {
await app.auditLog.Team.team.device.remoteAccess.enabled(request.session.User, null, team, request.device)
await app.auditLog.Device.device.remoteAccess.enabled(request.session.User, null, request.device)
reply.send(tunnelStatus)

@@ -136,2 +138,3 @@ }

await app.auditLog.Team.team.device.remoteAccess.disabled(request.session.User, null, team, request.device)
await app.auditLog.Device.device.remoteAccess.disabled(request.session.User, null, request.device)
reply.send({ enabled: false })

@@ -138,0 +141,0 @@ }

@@ -79,2 +79,3 @@ const { Roles } = require('./roles.js')

'device:snapshot:set-target': { description: 'Set Device Target Snapshot', role: Roles.Member },
'device:audit-log': { description: 'View a Device Audit Log', role: Roles.Viewer },

@@ -81,0 +82,0 @@ // Project Types

@@ -0,1 +1,3 @@

const { Op } = require('sequelize')
module.exports = async function (app) {

@@ -5,2 +7,8 @@ async function getStats () {

const projectStateCounts = await app.db.models.Project.count({ attributes: ['state'], group: 'state' })
const teamTypeCounts = await app.db.models.Team.count({ attributes: ['TeamTypeId'], group: 'TeamTypeId' })
const teamTypes = await app.db.models.TeamType.findAll({ attributes: ['id', 'name'] })
const teamTypesMap = {}
teamTypes.forEach(tt => {
teamTypesMap[tt.id] = tt.name
})
const license = await app.license.get() || app.license.defaults

@@ -10,11 +18,13 @@ const result = {

maxUsers: license.users,
deviceCount: await app.db.models.Device.count(),
maxDevices: license.devices,
adminCount: 0,
inviteCount: await app.db.models.Invitation.count(),
adminCount: 0,
teamCount: await app.db.models.Team.count(),
maxTeams: license.teams,
teamsByType: {},
instanceCount: 0,
maxInstances: license.projects,
instancesByState: {}
instancesByState: {},
deviceCount: await app.db.models.Device.count(),
maxDevices: license.devices,
devicesByMode: {}
}

@@ -32,2 +42,24 @@ userCount.forEach(u => {

})
teamTypeCounts.forEach(teamTypeCount => {
result.teamsByType[teamTypesMap[teamTypeCount.TeamTypeId]] = teamTypeCount.count
})
const deviceModeCounts = await app.db.models.Device.count({ attributes: ['mode'], group: 'mode' })
deviceModeCounts.forEach(mode => {
result.devicesByMode[mode.mode] = mode.count
})
const now = Date.now()
const devicesByLastSeenNever = await app.db.models.Device.count({ where: { lastSeenAt: null } })
const devicesByLastSeenDay = await app.db.models.Device.count({ where: { lastSeenAt: { [Op.gte]: new Date(now - 1000 * 60 * 60 * 24) } } })
const devicesByLastSeenWeek = await app.db.models.Device.count({ where: { lastSeenAt: { [Op.gte]: new Date(now - 1000 * 60 * 60 * 24 * 7) } } })
const devicesByLastSeenMonth = await app.db.models.Device.count({ where: { lastSeenAt: { [Op.gte]: new Date(now - 1000 * 60 * 60 * 24 * 7 * 4) } } })
result.devicesByLastSeen = {
never: devicesByLastSeenNever,
day: devicesByLastSeenDay,
week: devicesByLastSeenWeek - devicesByLastSeenDay,
month: devicesByLastSeenMonth - devicesByLastSeenWeek,
older: result.deviceCount - devicesByLastSeenNever - devicesByLastSeenMonth
}
if (app.billing) {

@@ -39,2 +71,8 @@ const teamStateCounts = await app.db.models.Subscription.count({ attributes: ['status'], group: 'status' })

})
const trialStats = await app.db.models.Subscription.count({ where: { status: 'trial' }, attributes: ['trialStatus'], group: 'trialStatus' })
result.trialsByState = {}
trialStats.forEach(trialStat => {
result.trialsByState[trialStat.trialStatus] = trialStat.count
})
}

@@ -41,0 +79,0 @@ return result

@@ -237,2 +237,3 @@ const semver = require('semver')

await app.auditLog.Project.project.device.assigned(actionedBy, null, device.Project, device)
await app.auditLog.Device.device.assigned(actionedBy, null, device.Project, device)
}

@@ -477,2 +478,3 @@ const response = app.db.views.Device.device(device)

await app.auditLog.Project.project.device.assigned(request.session.User, null, assignToProject, updatedDevice)
await app.auditLog.Device.device.assigned(request.session.User, null, assignToProject, updatedDevice)
break

@@ -482,2 +484,3 @@ case 'assigned-to-application':

await app.auditLog.Application.application.device.assigned(request.session.User, null, assignToApplication, updatedDevice)
await app.auditLog.Device.device.assigned(request.session.User, null, assignToApplication, updatedDevice)
break

@@ -517,2 +520,3 @@ }

app.auditLog.Team.team.device.credentialsGenerated(request.session.User, null, request.device?.Team, request.device)
app.auditLog.Device.device.credentials.generated(request.session.User, null, request.device)
reply.send(credentials)

@@ -656,4 +660,6 @@ })

await app.auditLog.Team.team.device.developerMode.enabled(request.session.User, null, request.device.Team, request.device)
await app.auditLog.Device.device.developerMode.enabled(request.session.User, null, request.device)
} else {
await app.auditLog.Team.team.device.developerMode.disabled(request.session.User, null, request.device.Team, request.device)
await app.auditLog.Device.device.developerMode.disabled(request.session.User, null, request.device)
}

@@ -740,2 +746,44 @@ reply.send({ mode: request.body.mode })

/**
* @name /api/v1/devices/:id/audit-log
* @memberof forge.routes.api.devices
*/
app.get('/:deviceId/audit-log', {
preHandler: app.needsPermission('device:audit-log'),
schema: {
summary: '',
tags: ['Devices'],
params: {
type: 'object',
properties: {
deviceId: { type: 'string' }
}
},
query: {
allOf: [
{ $ref: 'PaginationParams' },
{ $ref: 'AuditLogQueryParams' }
]
},
response: {
200: {
type: 'object',
properties: {
meta: { $ref: 'PaginationMeta' },
count: { type: 'number' },
log: { $ref: 'AuditLogEntryList' }
}
},
'4xx': {
$ref: 'APIError'
}
}
}
}, async (request, reply) => {
const paginationOptions = app.getPaginationOptions(request)
const logEntries = await app.db.models.AuditLog.forDevice(request.device.id, paginationOptions)
const result = app.db.views.AuditLog.auditLog(logEntries)
reply.send(result)
})
async function assignDeviceToProject (device, project) {

@@ -742,0 +790,0 @@ await device.setProject(project)

2

frontend/dist/app/runtime.js

@@ -1,1 +0,1 @@

!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bcaf1993-55f0-41e5-981d-a47e57d80c87",e._sentryDebugIdIdentifier="sentry-dbid-bcaf1993-55f0-41e5-981d-a47e57d80c87")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"a2952882ac7a525cf374daea4b7503c10d2d2d44"},function(){"use strict";var e,t,n,r,o,u={},i={};function f(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return u[e](n,n.exports,f),n.loaded=!0,n.exports}f.m=u,e=[],f.O=function(t,n,r,o){if(!n){var u=1/0;for(d=0;d<e.length;d++){n=e[d][0],r=e[d][1],o=e[d][2];for(var i=!0,a=0;a<n.length;a++)(!1&o||u>=o)&&Object.keys(f.O).every((function(e){return f.O[e](n[a])}))?n.splice(a--,1):(i=!1,o<u&&(u=o));if(i){e.splice(d--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},f.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);f.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach((function(t){u[t]=function(){return e[t]}}));return u.default=function(){return e},f.d(o,u),o},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce((function(t,n){return f.f[n](e,t),t}),[]))},f.u=function(e){return"async-vendors.js"},f.miniCssF=function(e){},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="@flowfuse/flowfuse:",f.l=function(e,t,n,u){if(r[e])r[e].push(t);else{var i,a;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var l=c[d];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,f.nc&&i.setAttribute("nonce",f.nc),i.setAttribute("data-webpack",o+n),i.src=e),r[e]=[t];var s=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),a&&document.head.appendChild(i)}},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/app/",function(){f.b=document.baseURI||self.location.href;var e={666:0};f.f.j=function(t,n){var r=f.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else if(666!=t){var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var u=f.p+f.u(t),i=new Error;f.l(u,(function(n){if(f.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),u=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+u+")",i.name="ChunkLoadError",i.type=o,i.request=u,r[1](i)}}),"chunk-"+t,t)}else e[t]=0},f.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,u=n[0],i=n[1],a=n[2],c=0;if(u.some((function(t){return 0!==e[t]}))){for(r in i)f.o(i,r)&&(f.m[r]=i[r]);if(a)var d=a(f)}for(t&&t(n);c<u.length;c++)o=u[c],f.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return f.O(d)},n=self.webpackChunk_flowfuse_flowfuse=self.webpackChunk_flowfuse_flowfuse||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),f.nc=void 0}();
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bcaf1993-55f0-41e5-981d-a47e57d80c87",e._sentryDebugIdIdentifier="sentry-dbid-bcaf1993-55f0-41e5-981d-a47e57d80c87")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"c64aa2807ec852d006190baa9bcf536f1783d5e7"},function(){"use strict";var e,t,n,r,o,u={},i={};function f(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return u[e](n,n.exports,f),n.loaded=!0,n.exports}f.m=u,e=[],f.O=function(t,n,r,o){if(!n){var u=1/0;for(d=0;d<e.length;d++){n=e[d][0],r=e[d][1],o=e[d][2];for(var i=!0,a=0;a<n.length;a++)(!1&o||u>=o)&&Object.keys(f.O).every((function(e){return f.O[e](n[a])}))?n.splice(a--,1):(i=!1,o<u&&(u=o));if(i){e.splice(d--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},f.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);f.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach((function(t){u[t]=function(){return e[t]}}));return u.default=function(){return e},f.d(o,u),o},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce((function(t,n){return f.f[n](e,t),t}),[]))},f.u=function(e){return"async-vendors.js"},f.miniCssF=function(e){},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="@flowfuse/flowfuse:",f.l=function(e,t,n,u){if(r[e])r[e].push(t);else{var i,a;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var l=c[d];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,f.nc&&i.setAttribute("nonce",f.nc),i.setAttribute("data-webpack",o+n),i.src=e),r[e]=[t];var s=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),a&&document.head.appendChild(i)}},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/app/",function(){f.b=document.baseURI||self.location.href;var e={666:0};f.f.j=function(t,n){var r=f.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else if(666!=t){var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var u=f.p+f.u(t),i=new Error;f.l(u,(function(n){if(f.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),u=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+u+")",i.name="ChunkLoadError",i.type=o,i.request=u,r[1](i)}}),"chunk-"+t,t)}else e[t]=0},f.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,u=n[0],i=n[1],a=n[2],c=0;if(u.some((function(t){return 0!==e[t]}))){for(r in i)f.o(i,r)&&(f.m[r]=i[r]);if(a)var d=a(f)}for(t&&t(n);c<u.length;c++)o=u[c],f.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return f.O(d)},n=self.webpackChunk_flowfuse_flowfuse=self.webpackChunk_flowfuse_flowfuse||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),f.nc=void 0}();

@@ -17,16 +17,1 @@ /*!

/*! #__NO_SIDE_EFFECTS__ */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
{
"name": "@flowfuse/flowfuse",
"version": "1.15.1-a295288-202401040927.0",
"version": "1.15.1-c64aa28-202401091513.0",
"description": "An open source low-code development platform",

@@ -25,3 +25,3 @@ "homepage": "https://flowfuse.com",

"repl": "node forge/app.js --repl",
"build": "webpack -c ./config/webpack.config.js",
"build": "webpack --mode=production -c ./config/webpack.config.js",
"serve": "npm-run-all --parallel build-watch start-watch",

@@ -78,3 +78,3 @@ "serve-repl": "npm-run-all --parallel build-watch start-watch-repl",

"@sentry/profiling-node": "^1.2.1",
"@sentry/vue": "^7.72.0",
"@sentry/vue": "^7.91.0",
"@sentry/webpack-plugin": "^2.7.1",

@@ -105,4 +105,4 @@ "axios": "^1.4.0",

"uuid": "^9.0.0",
"vue": "^3.3.4",
"vue-router": "^4.2.2",
"vue": "^3.4.5",
"vue-router": "^4.2.5",
"vuex": "^4.1.0",

@@ -115,5 +115,5 @@ "yaml": "^2.3.1",

"@babel/preset-env": "^7.22.15",
"@vitejs/plugin-vue": "^4.3.4",
"@vitejs/plugin-vue": "^5.0.2",
"@vitest/coverage-istanbul": "^1.1.0",
"@vue/test-utils": "^2.4.1",
"@vue/test-utils": "^2.4.3",
"autoprefixer": "^10.4.15",

@@ -135,3 +135,3 @@ "babel-loader": "^9.1.3",

"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.17.0",
"eslint-plugin-vue": "^9.19.2",
"file-loader": "^6.2.0",

@@ -160,4 +160,4 @@ "html-link-extractor": "^1.0.5",

"vitest": "^1.1.0",
"vue-loader": "^17.2.2",
"vue-template-compiler": "^2.7.14",
"vue-loader": "^17.4.2",
"vue-template-compiler": "^2.7.16",
"webpack": "^5.88.2",

@@ -164,0 +164,0 @@ "webpack-cli": "^5.1.4",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc