@budibase/worker 2.8.18-alpha.0 → 2.8.18

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": "2.8.18-alpha.0",
4
+ "version": "2.8.18",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -38,10 +38,10 @@
38
38
  "author": "Budibase",
39
39
  "license": "GPL-3.0",
40
40
  "dependencies": {
41
- "@budibase/backend-core": "2.8.18-alpha.0",
42
- "@budibase/pro": "2.8.18-alpha.0",
43
- "@budibase/string-templates": "2.8.18-alpha.0",
44
- "@budibase/types": "2.8.18-alpha.0",
41
+ "@budibase/backend-core": "2.8.18",
42
+ "@budibase/pro": "2.8.18",
43
+ "@budibase/string-templates": "2.8.18",
44
+ "@budibase/types": "2.8.18",
45
45
  "@koa/router": "8.0.8",
46
46
  "@sentry/node": "6.17.7",
47
47
  "@techpass/passport-openidconnect": "0.3.2",
@@ -104,5 +104,5 @@
104
104
  "typescript": "4.7.3",
105
105
  "update-dotenv": "1.1.1"
106
106
  },
107
- "gitHead": "6e359b00d71205692a6e4edafa71fd6fecb66084"
107
+ "gitHead": "38d2a24ac7392c2d8df507bf82fbb53e6da16527"
108
108
  }
@@ -1,6 +1,6 @@
1
1
  import { sendEmail as sendEmailFn } from "../../../utilities/email"
2
2
  import { tenancy } from "@budibase/backend-core"
3
- import { BBContext, User } from "@budibase/types"
3
+ import { BBContext } from "@budibase/types"
4
4
 
5
5
  export async function sendEmail(ctx: BBContext) {
6
6
  let {
@@ -16,10 +16,10 @@ export async function sendEmail(ctx: BBContext) {
16
16
  automation,
17
17
  invite,
18
18
  } = ctx.request.body
19
- let user: any
19
+ let user
20
20
  if (userId) {
21
21
  const db = tenancy.getGlobalDB()
22
- user = await db.get<User>(userId)
22
+ user = await db.get(userId)
23
23
  }
24
24
  const response = await sendEmailFn(email, purpose, {
25
25
  workspaceId,
@@ -35,7 +35,7 @@ export async function find(ctx: BBContext) {
35
35
  const appId = ctx.params.appId
36
36
  await context.doInAppContext(dbCore.getDevAppID(appId), async () => {
37
37
  const db = context.getAppDB()
38
- const app = await db.get<App>(dbCore.DocumentType.APP_METADATA)
38
+ const app = await db.get(dbCore.DocumentType.APP_METADATA)
39
39
  ctx.body = {
40
40
  roles: await roles.getAllRoles(),
41
41
  name: app.name,
@@ -44,7 +44,7 @@ export async function generateAPIKey(ctx: any) {
44
44
  const id = dbCore.generateDevInfoID(userId)
45
45
  let devInfo
46
46
  try {
47
- devInfo = await db.get<any>(id)
47
+ devInfo = await db.get(id)
48
48
  } catch (err) {
49
49
  devInfo = { _id: id, userId }
50
50
  }
@@ -412,7 +412,7 @@ export const inviteAccept = async (
412
412
 
413
413
  const saved = await userSdk.save(request)
414
414
  const db = tenancy.getGlobalDB()
415
- const user = await db.get<User>(saved._id)
415
+ const user = await db.get(saved._id)
416
416
  await events.user.inviteAccepted(user)
417
417
  return saved
418
418
  })
@@ -16,9 +16,6 @@ import licenseRoutes from "./global/license"
16
16
  import migrationRoutes from "./system/migrations"
17
17
  import accountRoutes from "./system/accounts"
18
18
  import restoreRoutes from "./system/restore"
19
- import systemLogRoutes from "./system/logs"
20
-
21
- import env from "../../environment"
22
19
 
23
20
  export const routes: Router[] = [
24
21
  configRoutes,
@@ -41,7 +38,3 @@ export const routes: Router[] = [
41
38
  eventRoutes,
42
39
  pro.scim,
43
40
  ]
44
-
45
- if (env.SELF_HOSTED) {
46
- routes.push(systemLogRoutes)
47
- }
@@ -1,13 +0,0 @@
1
- import { UserCtx } from "@budibase/types"
2
- import { installation, logging } from "@budibase/backend-core"
3
-
4
- export async function getLogs(ctx: UserCtx) {
5
- const logReadStream = logging.system.getLogReadStream()
6
-
7
- const { installId } = await installation.getInstall()
8
-
9
- const fileName = `${installId}-${Date.now()}.log`
10
-
11
- ctx.set("content-disposition", `attachment; filename=${fileName}`)
12
- ctx.body = logReadStream
13
- }
@@ -1,9 +0,0 @@
1
- import Router from "@koa/router"
2
- import { middleware } from "@budibase/backend-core"
3
- import * as controller from "../../controllers/system/logs"
4
-
5
- const router: Router = new Router()
6
-
7
- router.get("/api/system/logs", middleware.adminOnly, controller.getLogs)
8
-
9
- export default router