@budibase/server 2.7.20-alpha.2 → 2.7.21-alpha.0

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/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.7.20-alpha.2",
4
+ "version": "2.7.21-alpha.0",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -46,12 +46,12 @@
46
46
  "license": "GPL-3.0",
47
47
  "dependencies": {
48
48
  "@apidevtools/swagger-parser": "10.0.3",
49
- "@budibase/backend-core": "2.7.20-alpha.2",
50
- "@budibase/client": "2.7.20-alpha.2",
51
- "@budibase/pro": "2.7.20-alpha.2",
52
- "@budibase/shared-core": "2.7.20-alpha.2",
53
- "@budibase/string-templates": "2.7.20-alpha.2",
54
- "@budibase/types": "2.7.20-alpha.2",
49
+ "@budibase/backend-core": "2.7.21-alpha.0",
50
+ "@budibase/client": "2.7.21-alpha.0",
51
+ "@budibase/pro": "2.7.21-alpha.0",
52
+ "@budibase/shared-core": "2.7.21-alpha.0",
53
+ "@budibase/string-templates": "2.7.21-alpha.0",
54
+ "@budibase/types": "2.7.21-alpha.0",
55
55
  "@bull-board/api": "3.7.0",
56
56
  "@bull-board/koa": "3.9.4",
57
57
  "@elastic/elasticsearch": "7.10.0",
@@ -195,5 +195,5 @@
195
195
  }
196
196
  }
197
197
  },
198
- "gitHead": "c8f23a7511efa6fd996aa2d28f2c864a8c14627d"
198
+ "gitHead": "d2b209177c3b1daf3008be0c5f57ca0c919a48cb"
199
199
  }
@@ -1,53 +1,54 @@
1
1
  import env from "../../environment"
2
2
  import {
3
+ createAllSearchIndex,
3
4
  createLinkView,
4
5
  createRoutingView,
5
- createAllSearchIndex,
6
6
  } from "../../db/views/staticViews"
7
- import { createApp, deleteApp } from "../../utilities/fileSystem"
8
7
  import {
8
+ backupClientLibrary,
9
+ createApp,
10
+ deleteApp,
11
+ revertClientLibrary,
12
+ updateClientLibrary,
13
+ } from "../../utilities/fileSystem"
14
+ import {
15
+ AppStatus,
16
+ DocumentType,
9
17
  generateAppID,
18
+ generateDevAppID,
10
19
  getLayoutParams,
11
20
  getScreenParams,
12
- generateDevAppID,
13
- DocumentType,
14
- AppStatus,
15
21
  } from "../../db/utils"
16
22
  import {
17
- db as dbCore,
18
- roles,
19
23
  cache,
20
- tenancy,
21
24
  context,
25
+ db as dbCore,
26
+ env as envCore,
27
+ ErrorCode,
22
28
  events,
23
29
  migrations,
24
30
  objectStore,
25
- ErrorCode,
26
- env as envCore,
31
+ roles,
32
+ tenancy,
27
33
  } from "@budibase/backend-core"
28
34
  import { USERS_TABLE_SCHEMA } from "../../constants"
29
35
  import {
30
- DEFAULT_BB_DATASOURCE_ID,
31
36
  buildDefaultDocs,
37
+ DEFAULT_BB_DATASOURCE_ID,
32
38
  } from "../../db/defaultData/datasource_bb_default"
33
39
  import { removeAppFromUserRoles } from "../../utilities/workerRequests"
34
- import { stringToReadStream, isQsTrue } from "../../utilities"
35
- import { getLocksById, doesUserHaveLock } from "../../utilities/redis"
36
- import {
37
- updateClientLibrary,
38
- backupClientLibrary,
39
- revertClientLibrary,
40
- } from "../../utilities/fileSystem"
40
+ import { stringToReadStream } from "../../utilities"
41
+ import { doesUserHaveLock, getLocksById } from "../../utilities/redis"
41
42
  import { cleanupAutomations } from "../../automations/utils"
42
43
  import { checkAppMetadata } from "../../automations/logging"
43
44
  import { getUniqueRows } from "../../utilities/usageQuota/rows"
44
- import { quotas, groups } from "@budibase/pro"
45
+ import { groups, licensing, quotas } from "@budibase/pro"
45
46
  import {
46
47
  App,
47
48
  Layout,
48
- Screen,
49
49
  MigrationType,
50
- Database,
50
+ PlanType,
51
+ Screen,
51
52
  UserCtx,
52
53
  } from "@budibase/types"
53
54
  import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts"
@@ -207,6 +208,7 @@ export async function fetchAppPackage(ctx: UserCtx) {
207
208
  let application = await db.get(DocumentType.APP_METADATA)
208
209
  const layouts = await getLayouts()
209
210
  let screens = await getScreens()
211
+ const license = await licensing.getLicense()
210
212
 
211
213
  // Enrich plugin URLs
212
214
  application.usedPlugins = objectStore.enrichPluginURLs(
@@ -227,6 +229,7 @@ export async function fetchAppPackage(ctx: UserCtx) {
227
229
 
228
230
  ctx.body = {
229
231
  application: { ...application, upgradableVersion: envCore.VERSION },
232
+ licenseType: license?.plan.type || PlanType.FREE,
230
233
  screens,
231
234
  layouts,
232
235
  clientLibPath,