@budibase/backend-core 2.32.11 → 2.32.13
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/dist/index.js +504 -172
- package/dist/index.js.map +4 -4
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +4 -4
- package/dist/plugins.js.meta.json +1 -1
- package/dist/src/db/couch/DatabaseImpl.js +10 -2
- package/dist/src/db/couch/DatabaseImpl.js.map +1 -1
- package/dist/src/features/features.d.ts +47 -0
- package/dist/src/features/features.js +269 -0
- package/dist/src/features/features.js.map +1 -0
- package/dist/src/features/index.d.ts +2 -39
- package/dist/src/features/index.js +6 -235
- package/dist/src/features/index.js.map +1 -1
- package/dist/src/features/tests/utils.d.ts +3 -0
- package/dist/src/features/tests/utils.js +56 -0
- package/dist/src/features/tests/utils.js.map +1 -0
- package/dist/src/middleware/passport/sso/sso.js +0 -25
- package/dist/src/middleware/passport/sso/sso.js.map +1 -1
- package/dist/src/sql/sql.js +93 -35
- package/dist/src/sql/sql.js.map +1 -1
- package/dist/src/users/users.js +8 -1
- package/dist/src/users/users.js.map +1 -1
- package/dist/tests/core/utilities/structures/accounts.d.ts +1 -6
- package/dist/tests/core/utilities/structures/accounts.js +4 -58
- package/dist/tests/core/utilities/structures/accounts.js.map +1 -1
- package/dist/tests/core/utilities/structures/users.js +2 -5
- package/dist/tests/core/utilities/structures/users.js.map +1 -1
- package/package.json +4 -4
- package/src/db/couch/DatabaseImpl.ts +12 -2
- package/src/features/features.ts +300 -0
- package/src/features/index.ts +2 -281
- package/src/features/tests/utils.ts +64 -0
- package/src/middleware/passport/sso/sso.ts +0 -24
- package/src/sql/sql.ts +107 -36
- package/src/users/users.ts +10 -2
- package/tests/core/utilities/structures/accounts.ts +1 -66
- package/tests/core/utilities/structures/users.ts +0 -5
|
@@ -6,9 +6,6 @@ import {
|
|
|
6
6
|
AccountSSOProviderType,
|
|
7
7
|
AuthType,
|
|
8
8
|
CloudAccount,
|
|
9
|
-
CreateAccount,
|
|
10
|
-
CreatePassswordAccount,
|
|
11
|
-
CreateVerifiableSSOAccount,
|
|
12
9
|
Hosting,
|
|
13
10
|
SSOAccount,
|
|
14
11
|
} from "@budibase/types"
|
|
@@ -19,6 +16,7 @@ export const account = (partial: Partial<Account> = {}): Account => {
|
|
|
19
16
|
accountId: uuid(),
|
|
20
17
|
tenantId: generator.word(),
|
|
21
18
|
email: generator.email({ domain: "example.com" }),
|
|
19
|
+
accountName: generator.word(),
|
|
22
20
|
tenantName: generator.word(),
|
|
23
21
|
hosting: Hosting.SELF,
|
|
24
22
|
createdAt: Date.now(),
|
|
@@ -61,10 +59,8 @@ export function ssoAccount(account: Account = cloudAccount()): SSOAccount {
|
|
|
61
59
|
accessToken: generator.string(),
|
|
62
60
|
refreshToken: generator.string(),
|
|
63
61
|
},
|
|
64
|
-
pictureUrl: generator.url(),
|
|
65
62
|
provider: provider(),
|
|
66
63
|
providerType: providerType(),
|
|
67
|
-
thirdPartyProfile: {},
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
|
|
@@ -78,68 +74,7 @@ export function verifiableSsoAccount(
|
|
|
78
74
|
accessToken: generator.string(),
|
|
79
75
|
refreshToken: generator.string(),
|
|
80
76
|
},
|
|
81
|
-
pictureUrl: generator.url(),
|
|
82
77
|
provider: AccountSSOProvider.MICROSOFT,
|
|
83
78
|
providerType: AccountSSOProviderType.MICROSOFT,
|
|
84
|
-
thirdPartyProfile: { id: "abc123" },
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
|
-
|
|
88
|
-
export const cloudCreateAccount: CreatePassswordAccount = {
|
|
89
|
-
email: "cloud@budibase.com",
|
|
90
|
-
tenantId: "cloud",
|
|
91
|
-
hosting: Hosting.CLOUD,
|
|
92
|
-
authType: AuthType.PASSWORD,
|
|
93
|
-
password: "Password123!",
|
|
94
|
-
tenantName: "cloud",
|
|
95
|
-
name: "Budi Armstrong",
|
|
96
|
-
size: "10+",
|
|
97
|
-
profession: "Software Engineer",
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export const cloudSSOCreateAccount: CreateAccount = {
|
|
101
|
-
email: "cloud-sso@budibase.com",
|
|
102
|
-
tenantId: "cloud-sso",
|
|
103
|
-
hosting: Hosting.CLOUD,
|
|
104
|
-
authType: AuthType.SSO,
|
|
105
|
-
tenantName: "cloudsso",
|
|
106
|
-
name: "Budi Armstrong",
|
|
107
|
-
size: "10+",
|
|
108
|
-
profession: "Software Engineer",
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export const cloudVerifiableSSOCreateAccount: CreateVerifiableSSOAccount = {
|
|
112
|
-
email: "cloud-sso@budibase.com",
|
|
113
|
-
tenantId: "cloud-sso",
|
|
114
|
-
hosting: Hosting.CLOUD,
|
|
115
|
-
authType: AuthType.SSO,
|
|
116
|
-
tenantName: "cloudsso",
|
|
117
|
-
name: "Budi Armstrong",
|
|
118
|
-
size: "10+",
|
|
119
|
-
profession: "Software Engineer",
|
|
120
|
-
provider: AccountSSOProvider.MICROSOFT,
|
|
121
|
-
thirdPartyProfile: { id: "abc123" },
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export const selfCreateAccount: CreatePassswordAccount = {
|
|
125
|
-
email: "self@budibase.com",
|
|
126
|
-
tenantId: "self",
|
|
127
|
-
hosting: Hosting.SELF,
|
|
128
|
-
authType: AuthType.PASSWORD,
|
|
129
|
-
password: "Password123!",
|
|
130
|
-
tenantName: "self",
|
|
131
|
-
name: "Budi Armstrong",
|
|
132
|
-
size: "10+",
|
|
133
|
-
profession: "Software Engineer",
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export const selfSSOCreateAccount: CreateAccount = {
|
|
137
|
-
email: "self-sso@budibase.com",
|
|
138
|
-
tenantId: "self-sso",
|
|
139
|
-
hosting: Hosting.SELF,
|
|
140
|
-
authType: AuthType.SSO,
|
|
141
|
-
tenantName: "selfsso",
|
|
142
|
-
name: "Budi Armstrong",
|
|
143
|
-
size: "10+",
|
|
144
|
-
profession: "Software Engineer",
|
|
145
|
-
}
|
|
@@ -25,7 +25,6 @@ export const user = (userProps?: Partial<Omit<User, "userId">>): User => {
|
|
|
25
25
|
roles: { app_test: "admin" },
|
|
26
26
|
firstName: generator.first(),
|
|
27
27
|
lastName: generator.last(),
|
|
28
|
-
pictureUrl: "http://example.com",
|
|
29
28
|
tenantId: tenant.id(),
|
|
30
29
|
...userProps,
|
|
31
30
|
}
|
|
@@ -86,9 +85,5 @@ export function ssoUser(
|
|
|
86
85
|
oauth2: opts.details?.oauth2,
|
|
87
86
|
provider: opts.details?.provider!,
|
|
88
87
|
providerType: opts.details?.providerType!,
|
|
89
|
-
thirdPartyProfile: {
|
|
90
|
-
email: base.email,
|
|
91
|
-
picture: base.pictureUrl,
|
|
92
|
-
},
|
|
93
88
|
}
|
|
94
89
|
}
|