@budibase/worker 3.9.0 → 3.9.2
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": "3.9.
|
|
4
|
+
"version": "3.9.2",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"bcrypt": "5.1.0",
|
|
51
51
|
"bcryptjs": "2.4.3",
|
|
52
52
|
"bull": "4.10.1",
|
|
53
|
-
"dd-trace": "5.
|
|
53
|
+
"dd-trace": "5.47.0",
|
|
54
54
|
"dotenv": "8.6.0",
|
|
55
55
|
"email-validator": "^2.0.4",
|
|
56
56
|
"global-agent": "3.0.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "f9927b35b3939f1b96eb911d820ba5b06f288cd6"
|
|
124
124
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
auth as authCore,
|
|
9
9
|
} from "@budibase/backend-core"
|
|
10
10
|
import env from "../../../environment"
|
|
11
|
-
import { groups } from "@budibase/pro"
|
|
11
|
+
import { ai, groups } from "@budibase/pro"
|
|
12
12
|
import {
|
|
13
13
|
DevInfo,
|
|
14
14
|
FetchAPIKeyResponse,
|
|
@@ -115,11 +115,20 @@ export async function getSelf(ctx: UserCtx<void, GetGlobalSelfResponse>) {
|
|
|
115
115
|
|
|
116
116
|
// add the feature flags for this tenant
|
|
117
117
|
const flags = await features.flags.fetch()
|
|
118
|
+
const llmConfig = await ai.getLLMConfig()
|
|
119
|
+
const sanitisedLLMConfig = llmConfig
|
|
120
|
+
? {
|
|
121
|
+
provider: llmConfig.provider,
|
|
122
|
+
model: llmConfig.model,
|
|
123
|
+
measureUsage: llmConfig.measureUsage,
|
|
124
|
+
}
|
|
125
|
+
: undefined
|
|
118
126
|
|
|
119
127
|
ctx.body = {
|
|
120
128
|
...enrichedUser,
|
|
121
129
|
...sessionAttributes,
|
|
122
130
|
flags,
|
|
131
|
+
llm: sanitisedLLMConfig,
|
|
123
132
|
}
|
|
124
133
|
}
|
|
125
134
|
|
|
@@ -648,7 +648,7 @@ describe("scim", () => {
|
|
|
648
648
|
budibaseUserId: user.id,
|
|
649
649
|
email: user.emails![0].value,
|
|
650
650
|
}
|
|
651
|
-
mocks.accounts.
|
|
651
|
+
mocks.accounts.getAccountByTenantId.mockResolvedValue(account)
|
|
652
652
|
|
|
653
653
|
await deleteScimUser(user.id, {
|
|
654
654
|
expect: {
|
|
@@ -284,7 +284,7 @@ describe("/api/global/users", () => {
|
|
|
284
284
|
|
|
285
285
|
it("should not be able to create user with the same email as an account", async () => {
|
|
286
286
|
const user = structures.users.user()
|
|
287
|
-
const account = structures.accounts.
|
|
287
|
+
const account = structures.accounts.accountDetail()
|
|
288
288
|
accounts.getAccount.mockReturnValueOnce(Promise.resolve(account))
|
|
289
289
|
|
|
290
290
|
const response = await config.api.users.saveUser(user, 400)
|
|
@@ -743,7 +743,9 @@ describe("/api/global/users", () => {
|
|
|
743
743
|
it("should not be able to destroy account owner", async () => {
|
|
744
744
|
const user = await config.createUser()
|
|
745
745
|
const account = structures.accounts.cloudAccount()
|
|
746
|
-
accounts.
|
|
746
|
+
accounts.getAccountByTenantId.mockReturnValueOnce(
|
|
747
|
+
Promise.resolve(account)
|
|
748
|
+
)
|
|
747
749
|
|
|
748
750
|
const response = await config.api.users.deleteUser(user._id!, 400)
|
|
749
751
|
|
|
@@ -754,7 +756,9 @@ describe("/api/global/users", () => {
|
|
|
754
756
|
const user = await config.user!
|
|
755
757
|
const account = structures.accounts.cloudAccount()
|
|
756
758
|
account.email = user.email
|
|
757
|
-
accounts.
|
|
759
|
+
accounts.getAccountByTenantId.mockReturnValueOnce(
|
|
760
|
+
Promise.resolve(account)
|
|
761
|
+
)
|
|
758
762
|
|
|
759
763
|
const response = await config.api.users.deleteUser(user._id!, 400)
|
|
760
764
|
|