@budibase/worker 1.2.13 → 1.2.14

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "1.2.13",
4
+ "version": "1.2.14",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -35,10 +35,10 @@
35
35
  "author": "Budibase",
36
36
  "license": "GPL-3.0",
37
37
  "dependencies": {
38
- "@budibase/backend-core": "^1.2.13",
39
- "@budibase/pro": "1.2.12",
40
- "@budibase/string-templates": "^1.2.13",
41
- "@budibase/types": "^1.2.13",
38
+ "@budibase/backend-core": "^1.2.14",
39
+ "@budibase/pro": "1.2.13",
40
+ "@budibase/string-templates": "^1.2.14",
41
+ "@budibase/types": "^1.2.14",
42
42
  "@koa/router": "8.0.8",
43
43
  "@sentry/node": "6.17.7",
44
44
  "@techpass/passport-openidconnect": "0.3.2",
@@ -101,5 +101,5 @@
101
101
  "./scripts/jestSetup.js"
102
102
  ]
103
103
  },
104
- "gitHead": "e621f6075692dbf38e824fe569616de51d7206cb"
104
+ "gitHead": "24d1c27760855f14f6893c2f0d5cb696b2cbc2ca"
105
105
  }
@@ -6,7 +6,6 @@ const templateRoutes = require("./global/templates")
6
6
  const emailRoutes = require("./global/email")
7
7
  const authRoutes = require("./global/auth")
8
8
  const roleRoutes = require("./global/roles")
9
- const sessionRoutes = require("./global/sessions")
10
9
  const environmentRoutes = require("./system/environment")
11
10
  const tenantsRoutes = require("./system/tenants")
12
11
  const statusRoutes = require("./system/status")
@@ -23,7 +22,6 @@ exports.routes = [
23
22
  templateRoutes,
24
23
  tenantsRoutes,
25
24
  emailRoutes,
26
- sessionRoutes,
27
25
  roleRoutes,
28
26
  environmentRoutes,
29
27
  statusRoutes,
@@ -1,37 +0,0 @@
1
- const {
2
- getAllSessions,
3
- getUserSessions,
4
- invalidateSessions,
5
- } = require("@budibase/backend-core/sessions")
6
-
7
- exports.fetch = async ctx => {
8
- ctx.body = await getAllSessions()
9
- }
10
-
11
- exports.find = async ctx => {
12
- const { userId } = ctx.params
13
- const sessions = await getUserSessions(userId)
14
- ctx.body = sessions.map(session => session.value)
15
- }
16
-
17
- exports.invalidateUser = async ctx => {
18
- const { userId } = ctx.params
19
- await invalidateSessions(userId)
20
- ctx.body = {
21
- message: "User sessions invalidated",
22
- }
23
- }
24
-
25
- exports.selfSessions = async ctx => {
26
- const userId = ctx.user._id
27
- ctx.body = await getUserSessions(userId)
28
- }
29
-
30
- exports.invalidateSession = async ctx => {
31
- const userId = ctx.user._id
32
- const { sessionId } = ctx.params
33
- await invalidateSessions(userId, sessionId)
34
- ctx.body = {
35
- message: "Session invalidated successfully.",
36
- }
37
- }
@@ -1,14 +0,0 @@
1
- const Router = require("@koa/router")
2
- const controller = require("../../controllers/global/sessions")
3
- const { adminOnly } = require("@budibase/backend-core/auth")
4
-
5
- const router = Router()
6
-
7
- router
8
- .get("/api/global/sessions", adminOnly, controller.fetch)
9
- .get("/api/global/sessions/self", controller.selfSessions)
10
- .get("/api/global/sessions/:userId", adminOnly, controller.find)
11
- .delete("/api/global/sessions/:userId", adminOnly, controller.invalidateUser)
12
- .delete("/api/global/sessions/self/:sessionId", controller.invalidateSession)
13
-
14
- module.exports = router