@budibase/server 3.26.3 → 3.27.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.
Files changed (124) hide show
  1. package/builder/assets/{easymde-C9bKjJHx.js → easymde-C34suCbf.js} +1 -1
  2. package/builder/assets/{index-BKCzmkUd.js → index-DmmWAnIF.js} +5 -5
  3. package/builder/index.html +1 -1
  4. package/client/budibase-client.js +1 -1
  5. package/client/chunks/{Accordion-BbdcSnjO.js → Accordion-DlzwXUof.js} +1 -1
  6. package/client/chunks/{ApexChart-8WneJgfP.js → ApexChart-pwWkXq9W.js} +2 -2
  7. package/client/chunks/{AreaChart-B7Zg7AkW.js → AreaChart-BeICLlJD.js} +2 -2
  8. package/client/chunks/{AttachmentField-bGTHSVSc.js → AttachmentField-Dsc9lL6d.js} +2 -2
  9. package/client/chunks/{AttachmentSingleField-D35q3Dvz.js → AttachmentSingleField-BLmg9Q6P.js} +2 -2
  10. package/client/chunks/{BBReferenceField-DzjDpEYt.js → BBReferenceField-sCmVQug-.js} +3 -3
  11. package/client/chunks/{BBReferenceSingleField-DqfZ19kA.js → BBReferenceSingleField-Bc6yhE2j.js} +2 -2
  12. package/client/chunks/{BackgroundImage-FnghCpoD.js → BackgroundImage-BHOTtcEL.js} +1 -1
  13. package/client/chunks/{BarChart-DApIxJRn.js → BarChart-Cuk8Rlpg.js} +2 -2
  14. package/client/chunks/{BigIntField-gOcuVwBi.js → BigIntField-v39Z2fPq.js} +2 -2
  15. package/client/chunks/{BooleanField-GNzZiA4c.js → BooleanField-M6s2UJzd.js} +2 -2
  16. package/client/chunks/{Button-DQfl9hGj.js → Button-ZPr1XAlI.js} +1 -1
  17. package/client/chunks/{ButtonGroup-C1lns7Ot.js → ButtonGroup-Dm6k4y_e.js} +2 -2
  18. package/client/chunks/{CandleStickChart-Db0k5x8x.js → CandleStickChart-BujvyNTa.js} +2 -2
  19. package/client/chunks/{Card-glnffoHJ.js → Card-svA_TChk.js} +1 -1
  20. package/client/chunks/{CardHorizontal-BhpVI5LB.js → CardHorizontal-CtbFvR9x.js} +1 -1
  21. package/client/chunks/{CardStat-Dyf-uiix.js → CardStat-D6GSBMkQ.js} +1 -1
  22. package/client/chunks/{CardsBlock-BvywZI6v.js → CardsBlock-DDF_hd8U.js} +2 -2
  23. package/client/chunks/{ChartBlock-CppL455M.js → ChartBlock-D7rC6s_M.js} +1 -1
  24. package/client/chunks/{Chatbox-BCb8_Ln6.js → Chatbox-DUjY3CSE.js} +1 -1
  25. package/client/chunks/{CheckboxGroup-CLZ7Jr33.js → CheckboxGroup-BvxrArqf.js} +1 -1
  26. package/client/chunks/{CodeGenerator-wP4rJaBG.js → CodeGenerator-SS5eL9Vr.js} +1 -1
  27. package/client/chunks/{CodeScannerField-B5jtPryV.js → CodeScannerField-BLJCEXMU.js} +4 -4
  28. package/client/chunks/{CollapsedButtonGroup-7Gx77vhe.js → CollapsedButtonGroup-BP1hpuwy.js} +2 -2
  29. package/client/chunks/{Container-To4fINkM.js → Container-C-baGg8T.js} +1 -1
  30. package/client/chunks/{DataProvider-Ch5KDV1y.js → DataProvider-DapC8hR2.js} +1 -1
  31. package/client/chunks/{DatePicker-C_gbW7gS.js → DatePicker-BWAY9T8b.js} +1 -1
  32. package/client/chunks/{DatePicker-DC3I27eF.js → DatePicker-CV0rau4q.js} +2 -2
  33. package/client/chunks/{DateRangePicker-BO2K9Put.js → DateRangePicker-D-RAozdJ.js} +2 -2
  34. package/client/chunks/{DateTimeField-oJD_-Bbz.js → DateTimeField-BSx8TjhT.js} +3 -3
  35. package/client/chunks/{Divider-wF7v0zR3.js → Divider-CnrAdXfW.js} +1 -1
  36. package/client/chunks/{DonutChart-BiQLWKv8.js → DonutChart-xkty4tC-.js} +2 -2
  37. package/client/chunks/{DynamicFilter-Bs8Pwu4z.js → DynamicFilter-BL6NjCRS.js} +4 -4
  38. package/client/chunks/{Embed-CfDG9EVu.js → Embed-Cx_CgqEA.js} +2 -2
  39. package/client/chunks/{EmbeddedMap-CRAvWEkD.js → EmbeddedMap-C8zE0li6.js} +2 -2
  40. package/client/chunks/{Field-D9iGng_I.js → Field-1Gfnwgm_.js} +3 -3
  41. package/client/chunks/{FieldGroup-zm-407yR.js → FieldGroup-Dx8BGj3u.js} +2 -2
  42. package/client/chunks/{Filter-CNXdIVd8.js → Filter-CANc_ZKw.js} +8 -8
  43. package/client/chunks/{Form-SeqWjQna.js → Form-D8GpafBC.js} +2 -2
  44. package/client/chunks/{FormBlock-BM2_FFsy.js → FormBlock-pIuUvyOH.js} +3 -3
  45. package/client/chunks/{FormBlockComponent-C9Sg58KC.js → FormBlockComponent-QGu9KzJf.js} +1 -1
  46. package/client/chunks/{FormStep-x5Ihb5o4.js → FormStep-CtzQfVx4.js} +2 -2
  47. package/client/chunks/{GaugeChart-hBLYS5pY.js → GaugeChart-UzXACHzo.js} +2 -2
  48. package/client/chunks/{GridBlock-CDkg9CQe.js → GridBlock-_hRuiZL_.js} +7 -7
  49. package/client/chunks/{Heading-lWqywCDT.js → Heading-C4SH-IRz.js} +1 -1
  50. package/client/chunks/{HistogramChart-DTg5GfG7.js → HistogramChart-tmtXOAhl.js} +2 -2
  51. package/client/chunks/{Icon-BvbAlwYl.js → Icon-DNwXEBxL.js} +2 -2
  52. package/client/chunks/{IconV2-Bu0t4SHF.js → IconV2-DWuaDiwf.js} +2 -2
  53. package/client/chunks/{Image-GZo_uOEf.js → Image-BuJlHqAn.js} +2 -2
  54. package/client/chunks/{InnerForm-BKBgok9R.js → InnerForm-C_M-M6eW.js} +1 -1
  55. package/client/chunks/{Item-ByYDu0aS.js → Item-DuGLnVNk.js} +1 -1
  56. package/client/chunks/{JSONField-DqsMOG6r.js → JSONField-CoGDm4yG.js} +3 -3
  57. package/client/chunks/{Layout-BLHzB4eO.js → Layout-yuve3iYB.js} +4 -4
  58. package/client/chunks/{LineChart-DOrc1iZC.js → LineChart-WmoeTueH.js} +2 -2
  59. package/client/chunks/{Link-B3TEhV9b.js → Link-C_B_zmum.js} +1 -1
  60. package/client/chunks/{LongFormField-7DzfuT9z.js → LongFormField-KBBPOV8G.js} +4 -4
  61. package/client/chunks/{MarkdownViewer-C_xqulx0.js → MarkdownViewer-DwEeDvaR.js} +2 -2
  62. package/client/chunks/{Modal-Cy09kC5q.js → Modal-BXYdWZyL.js} +1 -1
  63. package/client/chunks/{MultiFieldSelect-B57ntjAD.js → MultiFieldSelect-qbxBjY3A.js} +4 -4
  64. package/client/chunks/{MultiStepFormblock-4cQNF0C9.js → MultiStepFormblock-Cje0YDrU.js} +2 -2
  65. package/client/chunks/{Multiselect-CCi7OFsZ.js → Multiselect-AcZM12iI.js} +1 -1
  66. package/client/chunks/{Navigation-JFvPD8vt.js → Navigation-C98D6uBD.js} +1 -1
  67. package/client/chunks/{NumberField-B28Twnl2.js → NumberField-B3JPOOSc.js} +2 -2
  68. package/client/chunks/{OptionsField-BSToXCPm.js → OptionsField-rfk05Q4r.js} +3 -3
  69. package/client/chunks/{PDF-D9MoeJ_P.js → PDF-CyLVAsU6.js} +1 -1
  70. package/client/chunks/{PDFTable-DW-Y815R.js → PDFTable-D7j8n1PU.js} +1 -1
  71. package/client/chunks/{PasswordField-CA3gyDFs.js → PasswordField-BVgdB9Ua.js} +2 -2
  72. package/client/chunks/{PieChart-DKDRVo7P.js → PieChart-DwyvwE_n.js} +2 -2
  73. package/client/chunks/{Placeholder-DaIadqKC.js → Placeholder-Cex9OEvZ.js} +1 -1
  74. package/client/chunks/{RadioGroup-BgLT083b.js → RadioGroup-foocZD5R.js} +1 -1
  75. package/client/chunks/{RatingField-v_PNIygH.js → RatingField-DtDh9esj.js} +2 -2
  76. package/client/chunks/{RelationshipField-B6x8pT7r.js → RelationshipField-B0AhNIAi.js} +3 -3
  77. package/client/chunks/{Repeater-hG4Ox2h6.js → Repeater-Bx8oOoDm.js} +3 -3
  78. package/client/chunks/{RepeaterBlock-LNEujcpn.js → RepeaterBlock-DS_SPIxa.js} +2 -2
  79. package/client/chunks/{RowExplorer-Da8kpq8E.js → RowExplorer-D3mkNhUu.js} +1 -1
  80. package/client/chunks/{S3Upload-CdrgNZ_z.js → S3Upload-D-ceG4MJ.js} +2 -2
  81. package/client/chunks/{ScreenSlot-hGV3_D09.js → ScreenSlot-0lHlLEy9.js} +1 -1
  82. package/client/chunks/{Section-D4jj8IXl.js → Section-Dwf2Fr2E.js} +2 -2
  83. package/client/chunks/{SidePanel-BxTYP8nW.js → SidePanel-CQcOnEVB.js} +1 -1
  84. package/client/chunks/{SignatureField-B8KVt5KJ.js → SignatureField-Br5Lgl8b.js} +2 -2
  85. package/client/chunks/{SingleRowProvider-CT6_XVFp.js → SingleRowProvider-BOBZHf4Y.js} +1 -1
  86. package/client/chunks/{Slider-D4iRb5Pq.js → Slider-BlSOc4ns.js} +2 -2
  87. package/client/chunks/{SpectrumCard-DN72Wfev.js → SpectrumCard-DoABPAhN.js} +1 -1
  88. package/client/chunks/{StackedList-wX0cz5JC.js → StackedList-DXtZ8YN4.js} +1 -1
  89. package/client/chunks/{StringField-C5eIBlxU.js → StringField-2blWK2_6.js} +2 -2
  90. package/client/chunks/{Table-BAyePfxz.js → Table-CVu30F6W.js} +2 -2
  91. package/client/chunks/{TableBlock-Fn3m_Cal.js → TableBlock-BycIg_wG.js} +2 -2
  92. package/client/chunks/{Tag-Ccvq-o8T.js → Tag-CKQcnq9s.js} +1 -1
  93. package/client/chunks/{Text-B3ptOepW.js → Text-B3WF1hIP.js} +1 -1
  94. package/client/chunks/{Text-2gTwGeM-.js → Text-C7pPzB1Q.js} +1 -1
  95. package/client/chunks/{TextArea--crnNy6C.js → TextArea-CtxfP53j.js} +1 -1
  96. package/client/chunks/{UserAvatar-Cq7DStfS.js → UserAvatar-Be7JQUjU.js} +2 -2
  97. package/client/chunks/{___vite-browser-external_commonjs-proxy-C-WedIVs.js → ___vite-browser-external_commonjs-proxy-DnybQQXm.js} +1 -1
  98. package/client/chunks/{apexcharts.common-CjVwBkpW.js → apexcharts.common-CMEj47za.js} +1 -1
  99. package/client/chunks/{blocks-CsX4cNiY.js → blocks-0VbVwG54.js} +1 -1
  100. package/client/chunks/{easymde-DXXt6saJ.js → easymde-C7dhNFOb.js} +2 -2
  101. package/client/chunks/{index-DO9Qg5Hf.js → index-BvK0UCZu.js} +4 -5
  102. package/client/chunks/{index-C8V57NJY.js → index-DLmNnf83.js} +1 -1
  103. package/client/chunks/{table-BiFg41zj.js → table-C2-1UQAK.js} +1 -1
  104. package/client/chunks/{users-C-HZcRMi.js → users-C_X-gAar.js} +1 -1
  105. package/client/chunks/{utc-C1HXJ2Hm.js → utc-BksX2e0i.js} +1 -1
  106. package/dist/automation.js +4 -4
  107. package/dist/automation.js.map +2 -2
  108. package/dist/index.js +157 -157
  109. package/dist/index.js.map +2 -2
  110. package/dist/query.js +4 -4
  111. package/dist/query.js.map +2 -2
  112. package/dist/yarn.lock +309 -67
  113. package/package.json +3 -4
  114. package/src/api/controllers/assets.ts +2 -1
  115. package/src/api/controllers/dev.ts +3 -1
  116. package/src/api/controllers/static/index.ts +3 -1
  117. package/src/api/controllers/view/viewsV2.ts +1 -1
  118. package/src/api/routes/assets.ts +2 -1
  119. package/src/api/routes/dev.ts +3 -3
  120. package/src/api/routes/static.ts +5 -3
  121. package/src/api/utils.ts +5 -1
  122. package/src/constants/paths.ts +1 -1
  123. package/src/sdk/workspace/rows/queryUtils.ts +1 -0
  124. package/src/sdk/workspace/tables/duplicate.ts +1 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "3.26.3",
4
+ "version": "3.27.0",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -61,7 +61,7 @@
61
61
  "@elastic/elasticsearch": "7.10.0",
62
62
  "@google-cloud/firestore": "7.8.0",
63
63
  "@koa/cors": "5.0.0",
64
- "@koa/router": "13.1.1",
64
+ "@koa/router": "15.3.0",
65
65
  "@octokit/rest": "^20.0.0",
66
66
  "@socket.io/redis-adapter": "^8.2.1",
67
67
  "@types/xml2js": "^0.4.14",
@@ -148,7 +148,6 @@
148
148
  "@types/koa": "2.13.4",
149
149
  "@types/koa-send": "^4.1.6",
150
150
  "@types/koa__cors": "5.0.0",
151
- "@types/koa__router": "12.0.4",
152
151
  "@types/lodash": "4.14.200",
153
152
  "@types/mailparser": "^3.4.6",
154
153
  "@types/mssql": "9.1.5",
@@ -226,5 +225,5 @@
226
225
  }
227
226
  }
228
227
  },
229
- "gitHead": "69ab5e17bf9ccdac19b3bccd30352b936942129a"
228
+ "gitHead": "7fc04647584c83a2d70f302fa88f2569580f7539"
230
229
  }
@@ -8,5 +8,6 @@ import send from "koa-send"
8
8
  export const serveBuilderAssets = async function (ctx: Ctx<void, void>) {
9
9
  let topLevelPath = env.isDev() ? DEV_ASSET_PATH : TOP_LEVEL_PATH
10
10
  const builderPath = join(topLevelPath, "builder")
11
- await send(ctx, ctx.file, { root: builderPath })
11
+ const file = ctx.file || "index.html"
12
+ await send(ctx, file, { root: builderPath })
12
13
  }
@@ -17,7 +17,9 @@ async function redirect(
17
17
  method: "GET" | "POST" | "DELETE",
18
18
  path = "global"
19
19
  ) {
20
- const { devPath } = ctx.params
20
+ const devPath = Array.isArray(ctx.params.devPath)
21
+ ? ctx.params.devPath.join("/")
22
+ : ctx.params.devPath
21
23
  const queryString = ctx.originalUrl.split("?")[1] || ""
22
24
  const response = await fetch(
23
25
  checkSlashesInUrl(
@@ -406,7 +406,9 @@ export const serveClientLibrary = async function (
406
406
  }
407
407
 
408
408
  export const serve3rdPartyFile = async function (ctx: Ctx) {
409
- const { file } = ctx.params
409
+ const file = Array.isArray(ctx.params.file)
410
+ ? ctx.params.file.join("/")
411
+ : ctx.params.file
410
412
 
411
413
  const workspaceId = context.getWorkspaceId()
412
414
  if (!workspaceId) {
@@ -205,7 +205,7 @@ async function handleViewEvents(existingView: ViewV2, view: ViewV2) {
205
205
  for (const column in view.schema[key]?.columns ?? []) {
206
206
  // if the new column is visible and it wasn't before
207
207
  if (
208
- !existingView?.schema?.[key].columns?.[column].visible &&
208
+ !existingView?.schema?.[key].columns?.[column]?.visible &&
209
209
  view.schema?.[key].columns?.[column].visible
210
210
  ) {
211
211
  // new view join exposing a column
@@ -6,6 +6,7 @@ const router: Router = new Router()
6
6
 
7
7
  addFileManagement(router)
8
8
 
9
- router.get("/builder/:file*", serveBuilderAssets)
9
+ router.get("/builder", serveBuilderAssets)
10
+ router.get("/builder/*file", serveBuilderAssets)
10
11
 
11
12
  export default router
@@ -4,9 +4,9 @@ import { builderRoutes, publicRoutes } from "./endpointGroups"
4
4
 
5
5
  function redirectPath(path: string) {
6
6
  publicRoutes
7
- .get(`/api/${path}/:devPath(.*)`, controller.buildRedirectGet(path))
8
- .post(`/api/${path}/:devPath(.*)`, controller.buildRedirectPost(path))
9
- .delete(`/api/${path}/:devPath(.*)`, controller.buildRedirectDelete(path))
7
+ .get(`/api/${path}/*devPath`, controller.buildRedirectGet(path))
8
+ .post(`/api/${path}/*devPath`, controller.buildRedirectPost(path))
9
+ .delete(`/api/${path}/*devPath`, controller.buildRedirectDelete(path))
10
10
  }
11
11
 
12
12
  if (env.isDev() || env.isTest()) {
@@ -18,7 +18,7 @@ router
18
18
  ctx.redirect("/builder/bblogo.png")
19
19
  })
20
20
  .get("/api/assets/:appId/client", controller.serveClientLibrary)
21
- .get("/api/assets/:appId/:file(.*)", controller.serve3rdPartyFile)
21
+ .get("/api/assets/:appId/*file", controller.serve3rdPartyFile)
22
22
  .get("/api/apps/:appId/manifest.json", controller.servePwaManifest)
23
23
  .post("/api/attachments/process", authorized(BUILDER), controller.uploadFile)
24
24
  .post("/api/pwa/process-zip", authorized(BUILDER), controller.processPWAZip)
@@ -35,8 +35,10 @@ router
35
35
  controller.serveBuilderPreview
36
36
  )
37
37
  .get("/app/service-worker.js", controller.serveServiceWorker)
38
- .get("/app/:appUrl/:path*", controller.serveApp)
39
- .get(`/${devAppIdPath}/:path*`, controller.serveApp)
38
+ .get("/app/:appUrl", controller.serveApp)
39
+ .get("/app/:appUrl/*path", controller.serveApp)
40
+ .get(`/${devAppIdPath}`, controller.serveApp)
41
+ .get(`/${devAppIdPath}/*path`, controller.serveApp)
40
42
  .post(
41
43
  "/api/attachments/:datasourceId/url",
42
44
  recaptcha,
package/src/api/utils.ts CHANGED
@@ -6,7 +6,11 @@ import Router from "@koa/router"
6
6
  export function addFileManagement(router: Router) {
7
7
  /* istanbul ignore next */
8
8
  router.param("file", async (file: any, ctx: any, next: () => void) => {
9
- ctx.file = file && file.includes(".") ? file : "index.html"
9
+ const normalizedFile = Array.isArray(file) ? file.join("/") : file
10
+ ctx.file =
11
+ normalizedFile && normalizedFile.includes(".")
12
+ ? normalizedFile
13
+ : "index.html"
10
14
  if (!ctx.file.startsWith("budibase-client")) {
11
15
  return next()
12
16
  }
@@ -1,3 +1,3 @@
1
1
  import { DocumentType } from "@budibase/types"
2
2
 
3
- export const devAppIdPath = `:appId(${DocumentType.WORKSPACE_DEV}_.+)`
3
+ export const devAppIdPath = `${DocumentType.WORKSPACE_DEV}_:appId`
@@ -68,6 +68,7 @@ export const getQueryableFields = async (
68
68
  continue
69
69
  }
70
70
  if (isRelationship) {
71
+ result.push(field)
71
72
  try {
72
73
  const relatedTable = await sdk.tables.getTable(subSchema.tableId)
73
74
  const relatedFields = await extractTableFields(
@@ -23,6 +23,7 @@ export async function duplicate(table: Table, userId?: string): Promise<Table> {
23
23
  sourceType: table.sourceType,
24
24
  sourceId: table.sourceId,
25
25
  schema: { ...table.schema },
26
+ primaryDisplay: table.primaryDisplay,
26
27
  views: {},
27
28
  indexes: table.indexes ? { ...table.indexes } : undefined,
28
29
  // Don't include any data/rows - this is intentionally empty