@budibase/server 0.0.32 → 0.0.999-alpha.30

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 (977) hide show
  1. package/.dockerignore +6 -0
  2. package/.yarnrc +1 -0
  3. package/Dockerfile +41 -0
  4. package/LICENSE +391 -377
  5. package/__mocks__/@elastic/elasticsearch.ts +24 -0
  6. package/__mocks__/@google-cloud/firestore.ts +36 -0
  7. package/__mocks__/@sendgrid/mail.ts +22 -0
  8. package/__mocks__/airtable.ts +8 -0
  9. package/__mocks__/arangojs.ts +24 -0
  10. package/__mocks__/aws-sdk.ts +80 -0
  11. package/__mocks__/mongodb.ts +39 -0
  12. package/__mocks__/mssql.ts +24 -0
  13. package/__mocks__/mysql2/promise.ts +17 -0
  14. package/__mocks__/mysql2.ts +14 -0
  15. package/__mocks__/node-fetch.ts +201 -0
  16. package/__mocks__/oracledb.ts +31 -0
  17. package/__mocks__/pg.ts +30 -0
  18. package/babel.config.js +3 -0
  19. package/build/entitlements.mac.plist +14 -0
  20. package/build/icon.icns +0 -0
  21. package/build/icon.png +0 -0
  22. package/build/icons/512x512.png +0 -0
  23. package/build/pouchdb.js +9 -0
  24. package/builder/assets/auth0-logo.6fa5973f.png +0 -0
  25. package/builder/assets/backups-default.8c011f1b.png +0 -0
  26. package/builder/assets/bb-emblem.05f7ae7a.svg +80 -0
  27. package/builder/assets/bb-space-man.5be51a45.svg +290 -0
  28. package/builder/assets/bb-spaceship.8f6e81e1.svg +227 -0
  29. package/builder/assets/bg.29e85dd5.png +0 -0
  30. package/builder/assets/blankScreenPreview.72634dd1.png +0 -0
  31. package/builder/assets/bulgaria.bd68393d.png +0 -0
  32. package/builder/assets/covanta.72c46c1e.png +0 -0
  33. package/builder/assets/discord.c14881e9.svg +10 -0
  34. package/builder/assets/google-logo.c16467b8.png +0 -0
  35. package/builder/assets/index.c0265b74.css +6 -0
  36. package/builder/assets/index.c977bf31.js +1776 -0
  37. package/builder/assets/integromat.42212f11.png +0 -0
  38. package/builder/assets/listScreenPreview.599c0aae.png +0 -0
  39. package/builder/assets/microsoft-logo.07033b2a.png +0 -0
  40. package/builder/assets/oidc-logo.cb2fff74.png +0 -0
  41. package/builder/assets/okta-logo.61437d3d.png +0 -0
  42. package/builder/assets/onelogin-logo.181cc193.png +0 -0
  43. package/builder/assets/oracle.66592424.png +0 -0
  44. package/builder/assets/remixicon.0ac8bc3c.ttf +0 -0
  45. package/builder/assets/remixicon.64bb3a0f.eot +0 -0
  46. package/builder/assets/remixicon.a10268fe.svg +6835 -0
  47. package/builder/assets/remixicon.c2dacfbc.woff +0 -0
  48. package/builder/assets/remixicon.e61f0d10.woff2 +0 -0
  49. package/builder/assets/schnellecke.cf1837a8.png +0 -0
  50. package/builder/assets/slack.1e1f7cfb.svg +33 -0
  51. package/builder/assets/zapier.3fbd8f5c.png +0 -0
  52. package/builder/index.html +10 -13
  53. package/dist/api/controllers/analytics.js +46 -0
  54. package/dist/api/controllers/apikeys.js +72 -0
  55. package/dist/api/controllers/application.js +575 -0
  56. package/dist/api/controllers/auth.js +80 -0
  57. package/dist/api/controllers/automation.js +303 -0
  58. package/dist/api/controllers/backup.js +37 -0
  59. package/dist/api/controllers/cloud.js +130 -0
  60. package/dist/api/controllers/component.js +59 -0
  61. package/dist/api/controllers/datasource.js +306 -0
  62. package/dist/api/controllers/deploy/Deployment.js +53 -0
  63. package/dist/api/controllers/deploy/index.js +198 -0
  64. package/dist/api/controllers/dev.js +146 -0
  65. package/dist/api/controllers/integration.js +28 -0
  66. package/dist/api/controllers/layout.js +49 -0
  67. package/dist/api/controllers/metadata.js +63 -0
  68. package/dist/api/controllers/migrations.js +29 -0
  69. package/dist/api/controllers/ops.js +40 -0
  70. package/dist/api/controllers/permission.js +162 -0
  71. package/dist/api/controllers/plugin/file.js +24 -0
  72. package/dist/api/controllers/plugin/github.js +69 -0
  73. package/dist/api/controllers/plugin/index.js +112 -0
  74. package/dist/api/controllers/plugin/npm.js +58 -0
  75. package/dist/api/controllers/plugin/uploaders.js +11 -0
  76. package/dist/api/controllers/plugin/url.js +24 -0
  77. package/dist/api/controllers/plugin/utils.js +27 -0
  78. package/dist/api/controllers/public/applications.js +146 -0
  79. package/dist/api/controllers/public/mapping/applications.js +29 -0
  80. package/dist/api/controllers/public/mapping/index.js +11 -0
  81. package/dist/api/controllers/public/mapping/queries.js +36 -0
  82. package/dist/api/controllers/public/mapping/rows.js +24 -0
  83. package/dist/api/controllers/public/mapping/tables.js +23 -0
  84. package/dist/api/controllers/public/mapping/types.js +2 -0
  85. package/dist/api/controllers/public/mapping/users.js +29 -0
  86. package/dist/api/controllers/public/metrics.js +113 -0
  87. package/dist/api/controllers/public/queries.js +58 -0
  88. package/dist/api/controllers/public/rows.js +120 -0
  89. package/dist/api/controllers/public/tables.js +95 -0
  90. package/dist/api/controllers/public/users.js +93 -0
  91. package/dist/api/controllers/public/utils.js +56 -0
  92. package/dist/api/controllers/query/import/index.js +87 -0
  93. package/dist/api/controllers/query/import/sources/base/index.js +75 -0
  94. package/dist/api/controllers/query/import/sources/base/openapi.js +42 -0
  95. package/dist/api/controllers/query/import/sources/curl.js +99 -0
  96. package/dist/api/controllers/query/import/sources/openapi2.js +145 -0
  97. package/dist/api/controllers/query/import/sources/openapi3.js +177 -0
  98. package/dist/api/controllers/query/import/sources/tests/openapi2/data/crud/crud.json +253 -0
  99. package/dist/api/controllers/query/import/sources/tests/openapi2/data/petstore/petstore.json +1054 -0
  100. package/dist/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.json +253 -0
  101. package/dist/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.json +1225 -0
  102. package/dist/api/controllers/query/index.js +299 -0
  103. package/dist/api/controllers/query/validation.js +53 -0
  104. package/dist/api/controllers/role.js +109 -0
  105. package/dist/api/controllers/routing.js +105 -0
  106. package/dist/api/controllers/row/ExternalRequest.js +676 -0
  107. package/dist/api/controllers/row/external.js +339 -0
  108. package/dist/api/controllers/row/index.js +203 -0
  109. package/dist/api/controllers/row/internal.js +502 -0
  110. package/dist/api/controllers/row/internalSearch.js +28 -0
  111. package/dist/api/controllers/row/staticFormula.js +165 -0
  112. package/dist/api/controllers/row/utils.js +183 -0
  113. package/dist/api/controllers/screen.js +110 -0
  114. package/dist/api/controllers/script.js +30 -0
  115. package/dist/api/controllers/static/index.js +268 -0
  116. package/dist/api/controllers/static/templates/BudibaseApp.svelte +135 -0
  117. package/dist/api/controllers/static/templates/app.hbs +13 -0
  118. package/dist/api/controllers/static/templates/preview.hbs +117 -0
  119. package/dist/api/controllers/table/bulkFormula.js +173 -0
  120. package/dist/api/controllers/table/external.js +279 -0
  121. package/dist/api/controllers/table/index.js +179 -0
  122. package/dist/api/controllers/table/internal.js +194 -0
  123. package/dist/api/controllers/table/utils.js +374 -0
  124. package/dist/api/controllers/templates.js +56 -0
  125. package/dist/api/controllers/user.js +124 -0
  126. package/dist/api/controllers/view/exporters.js +44 -0
  127. package/dist/api/controllers/view/index.js +193 -0
  128. package/dist/api/controllers/view/utils.js +177 -0
  129. package/dist/api/controllers/view/viewBuilder.js +158 -0
  130. package/dist/api/controllers/webhook.js +134 -0
  131. package/dist/api/index.js +56 -0
  132. package/dist/api/routes/analytics.js +34 -0
  133. package/dist/api/routes/apikeys.js +37 -0
  134. package/dist/api/routes/application.js +48 -0
  135. package/dist/api/routes/auth.js +33 -0
  136. package/dist/api/routes/automation.js +50 -0
  137. package/dist/api/routes/backup.js +35 -0
  138. package/dist/api/routes/cloud.js +39 -0
  139. package/dist/api/routes/component.js +35 -0
  140. package/dist/api/routes/datasource.js +43 -0
  141. package/dist/api/routes/deploy.js +37 -0
  142. package/dist/api/routes/dev.js +49 -0
  143. package/dist/api/routes/index.js +77 -0
  144. package/dist/api/routes/integration.js +37 -0
  145. package/dist/api/routes/layout.js +37 -0
  146. package/dist/api/routes/metadata.js +40 -0
  147. package/dist/api/routes/migrations.js +36 -0
  148. package/dist/api/routes/ops.js +52 -0
  149. package/dist/api/routes/permission.js +44 -0
  150. package/dist/api/routes/plugin.js +39 -0
  151. package/dist/api/routes/public/applications.js +174 -0
  152. package/dist/api/routes/public/index.js +131 -0
  153. package/dist/api/routes/public/metrics.js +30 -0
  154. package/dist/api/routes/public/middleware/mapper.js +97 -0
  155. package/dist/api/routes/public/queries.js +72 -0
  156. package/dist/api/routes/public/rows.js +158 -0
  157. package/dist/api/routes/public/tables.js +152 -0
  158. package/dist/api/routes/public/users.js +135 -0
  159. package/dist/api/routes/public/utils/Endpoint.js +36 -0
  160. package/dist/api/routes/query.js +47 -0
  161. package/dist/api/routes/role.js +40 -0
  162. package/dist/api/routes/routing.js +39 -0
  163. package/dist/api/routes/row.js +239 -0
  164. package/dist/api/routes/screen.js +39 -0
  165. package/dist/api/routes/script.js +35 -0
  166. package/dist/api/routes/static.js +80 -0
  167. package/dist/api/routes/table.js +163 -0
  168. package/dist/api/routes/templates.js +37 -0
  169. package/dist/api/routes/user.js +43 -0
  170. package/dist/api/routes/utils/validators.js +238 -0
  171. package/dist/api/routes/view.js +42 -0
  172. package/dist/api/routes/webhook.js +43 -0
  173. package/dist/app.js +132 -0
  174. package/dist/automations/actions.js +137 -0
  175. package/dist/automations/automationUtils.js +173 -0
  176. package/dist/automations/bullboard.js +71 -0
  177. package/dist/automations/index.js +43 -0
  178. package/dist/automations/logging/index.js +53 -0
  179. package/dist/automations/steps/bash.js +111 -0
  180. package/dist/automations/steps/createRow.js +108 -0
  181. package/dist/automations/steps/delay.js +53 -0
  182. package/dist/automations/steps/deleteRow.js +96 -0
  183. package/dist/automations/steps/discord.js +116 -0
  184. package/dist/automations/steps/executeQuery.js +134 -0
  185. package/dist/automations/steps/executeScript.js +106 -0
  186. package/dist/automations/steps/filter.js +112 -0
  187. package/dist/automations/steps/integromat.js +119 -0
  188. package/dist/automations/steps/loop.js +54 -0
  189. package/dist/automations/steps/outgoingWebhook.js +166 -0
  190. package/dist/automations/steps/queryRows.js +216 -0
  191. package/dist/automations/steps/sendSmtpEmail.js +115 -0
  192. package/dist/automations/steps/serverLog.js +65 -0
  193. package/dist/automations/steps/slack.js +98 -0
  194. package/dist/automations/steps/updateRow.js +144 -0
  195. package/dist/automations/steps/utils.js +56 -0
  196. package/dist/automations/steps/zapier.js +117 -0
  197. package/dist/automations/triggerInfo/app.js +36 -0
  198. package/dist/automations/triggerInfo/cron.js +35 -0
  199. package/dist/automations/triggerInfo/index.js +40 -0
  200. package/dist/automations/triggerInfo/rowDeleted.js +36 -0
  201. package/dist/automations/triggerInfo/rowSaved.js +44 -0
  202. package/dist/automations/triggerInfo/rowUpdated.js +44 -0
  203. package/dist/automations/triggerInfo/webhook.js +40 -0
  204. package/dist/automations/triggers.js +180 -0
  205. package/dist/automations/utils.js +264 -0
  206. package/dist/constants/definitions.js +2 -0
  207. package/dist/constants/index.js +181 -0
  208. package/dist/constants/layouts.js +148 -0
  209. package/dist/constants/screens.js +51 -0
  210. package/dist/db/defaultData/datasource_bb_default.js +574 -0
  211. package/dist/db/defaultData/employeeImport.js +155 -0
  212. package/dist/db/defaultData/expensesImport.js +117 -0
  213. package/dist/db/defaultData/inventoryImport.js +109 -0
  214. package/dist/db/defaultData/jobsImport.js +152 -0
  215. package/dist/db/dynamoClient.js +124 -0
  216. package/dist/db/inMemoryView.js +62 -0
  217. package/dist/db/index.js +43 -0
  218. package/dist/db/linkedRows/LinkController.js +392 -0
  219. package/dist/db/linkedRows/LinkDocument.js +33 -0
  220. package/dist/db/linkedRows/index.js +206 -0
  221. package/dist/db/linkedRows/linkUtils.js +131 -0
  222. package/dist/db/newid.js +7 -0
  223. package/dist/db/utils.js +247 -0
  224. package/dist/db/views/staticViews.js +144 -0
  225. package/dist/ddApm.js +11 -0
  226. package/dist/definitions/automations.js +8 -0
  227. package/dist/definitions/common.js +2 -0
  228. package/dist/definitions/datasource.js +7 -0
  229. package/dist/definitions/openapi.js +6 -0
  230. package/dist/environment.js +113 -0
  231. package/dist/events/AutomationEmitter.js +53 -0
  232. package/dist/events/BudibaseEmitter.js +25 -0
  233. package/dist/events/docUpdates/index.js +17 -0
  234. package/dist/events/docUpdates/processors.js +18 -0
  235. package/dist/events/docUpdates/syncUsers.js +49 -0
  236. package/dist/events/index.js +11 -0
  237. package/dist/events/utils.js +43 -0
  238. package/dist/index.js +16 -0
  239. package/dist/integrations/airtable.js +147 -0
  240. package/dist/integrations/arangodb.js +103 -0
  241. package/dist/integrations/base/query.js +32 -0
  242. package/dist/integrations/base/sql.js +600 -0
  243. package/dist/integrations/base/sqlTable.js +160 -0
  244. package/dist/integrations/base/types.js +2 -0
  245. package/dist/integrations/couchdb.js +125 -0
  246. package/dist/integrations/dynamodb.js +194 -0
  247. package/dist/integrations/elasticsearch.js +186 -0
  248. package/dist/integrations/firebase.js +174 -0
  249. package/dist/integrations/googlesheets.js +455 -0
  250. package/dist/integrations/index.js +135 -0
  251. package/dist/integrations/microsoftSqlServer.js +273 -0
  252. package/dist/integrations/mongodb.js +614 -0
  253. package/dist/integrations/mysql.js +256 -0
  254. package/dist/integrations/oracle.js +375 -0
  255. package/dist/integrations/postgres.js +300 -0
  256. package/dist/integrations/queries/sql.js +84 -0
  257. package/dist/integrations/redis.js +168 -0
  258. package/dist/integrations/rest.js +400 -0
  259. package/dist/integrations/s3.js +237 -0
  260. package/dist/integrations/snowflake.js +99 -0
  261. package/dist/integrations/utils.js +295 -0
  262. package/dist/middleware/appInfo.js +22 -0
  263. package/dist/middleware/authorized.js +112 -0
  264. package/dist/middleware/builder.js +93 -0
  265. package/dist/middleware/currentapp.js +103 -0
  266. package/dist/middleware/joi-validator.js +43 -0
  267. package/dist/middleware/publicApi.js +25 -0
  268. package/dist/middleware/resourceId.js +59 -0
  269. package/dist/middleware/selfhost.js +24 -0
  270. package/dist/middleware/utils.js +8 -0
  271. package/dist/migrations/functions/appUrls.js +42 -0
  272. package/dist/migrations/functions/backfill/app/automations.js +31 -0
  273. package/dist/migrations/functions/backfill/app/datasources.js +28 -0
  274. package/dist/migrations/functions/backfill/app/layouts.js +33 -0
  275. package/dist/migrations/functions/backfill/app/queries.js +50 -0
  276. package/dist/migrations/functions/backfill/app/roles.js +28 -0
  277. package/dist/migrations/functions/backfill/app/screens.js +28 -0
  278. package/dist/migrations/functions/backfill/app/tables.js +37 -0
  279. package/dist/migrations/functions/backfill/app.js +176 -0
  280. package/dist/migrations/functions/backfill/global/configs.js +67 -0
  281. package/dist/migrations/functions/backfill/global/quotas.js +60 -0
  282. package/dist/migrations/functions/backfill/global/users.js +50 -0
  283. package/dist/migrations/functions/backfill/global.js +205 -0
  284. package/dist/migrations/functions/backfill/index.js +32 -0
  285. package/dist/migrations/functions/backfill/installation.js +80 -0
  286. package/dist/migrations/functions/syncQuotas.js +50 -0
  287. package/dist/migrations/functions/tableSettings.js +130 -0
  288. package/dist/migrations/functions/usageQuotas/index.js +16 -0
  289. package/dist/migrations/functions/usageQuotas/syncApps.js +25 -0
  290. package/dist/migrations/functions/usageQuotas/syncPlugins.js +23 -0
  291. package/dist/migrations/functions/usageQuotas/syncRows.js +33 -0
  292. package/dist/migrations/functions/userEmailViewCasing.js +24 -0
  293. package/dist/migrations/index.js +111 -0
  294. package/dist/migrations/tests/helpers.js +72 -0
  295. package/dist/migrations/tests/structures.js +37 -0
  296. package/dist/package.json +180 -0
  297. package/dist/sdk/app/applications/index.js +28 -0
  298. package/dist/sdk/app/applications/sync.js +164 -0
  299. package/dist/sdk/app/applications/utils.js +21 -0
  300. package/dist/sdk/app/automations/index.js +29 -0
  301. package/dist/sdk/app/automations/webhook.js +54 -0
  302. package/dist/sdk/app/backups/constants.js +6 -0
  303. package/dist/sdk/app/backups/exports.js +184 -0
  304. package/dist/sdk/app/backups/imports.js +170 -0
  305. package/dist/sdk/app/backups/index.js +29 -0
  306. package/dist/sdk/app/backups/statistics.js +73 -0
  307. package/dist/sdk/app/datasources/datasources.js +166 -0
  308. package/dist/sdk/app/datasources/index.js +27 -0
  309. package/dist/sdk/app/queries/index.js +27 -0
  310. package/dist/sdk/app/queries/queries.js +60 -0
  311. package/dist/sdk/app/rows/attachments.js +61 -0
  312. package/dist/sdk/app/rows/index.js +28 -0
  313. package/dist/sdk/app/rows/rows.js +30 -0
  314. package/dist/sdk/app/tables/index.js +65 -0
  315. package/dist/sdk/index.js +27 -0
  316. package/dist/sdk/plugins/index.js +27 -0
  317. package/dist/sdk/plugins/plugins.js +53 -0
  318. package/dist/sdk/users/index.js +27 -0
  319. package/dist/sdk/users/utils.js +87 -0
  320. package/dist/sdk/utils/index.js +29 -0
  321. package/dist/startup.js +158 -0
  322. package/dist/threads/automation.js +449 -0
  323. package/dist/threads/definitions.js +2 -0
  324. package/dist/threads/index.js +137 -0
  325. package/dist/threads/query.js +265 -0
  326. package/dist/threads/utils.js +122 -0
  327. package/dist/tsconfig.build.tsbuildinfo +1 -0
  328. package/dist/utilities/appDirectoryTemplate/package.json +10 -0
  329. package/dist/utilities/budibaseDir.js +5 -0
  330. package/dist/utilities/centralPath.js +27 -0
  331. package/dist/utilities/fileSystem/app.js +88 -0
  332. package/dist/utilities/fileSystem/clientLibrary.js +138 -0
  333. package/dist/utilities/fileSystem/filesystem.js +180 -0
  334. package/dist/utilities/fileSystem/index.js +21 -0
  335. package/dist/utilities/fileSystem/plugin.js +76 -0
  336. package/dist/utilities/fileSystem/processor.js +34 -0
  337. package/dist/utilities/fileSystem/template.js +47 -0
  338. package/dist/utilities/global.js +149 -0
  339. package/dist/utilities/index.js +143 -0
  340. package/dist/utilities/redis.js +117 -0
  341. package/dist/utilities/retry.js +30 -0
  342. package/dist/utilities/routing/index.js +39 -0
  343. package/dist/utilities/rowProcessor/index.js +284 -0
  344. package/dist/utilities/rowProcessor/map.js +99 -0
  345. package/dist/utilities/rowProcessor/utils.js +88 -0
  346. package/dist/utilities/schema.js +108 -0
  347. package/dist/utilities/scriptRunner.js +26 -0
  348. package/dist/utilities/security.js +57 -0
  349. package/dist/utilities/statusCodes.js +9 -0
  350. package/dist/utilities/usageQuota/rows.js +88 -0
  351. package/dist/utilities/usageQuota/usageQuoteReset.js +16 -0
  352. package/dist/utilities/users.js +57 -0
  353. package/dist/utilities/workerRequests.js +171 -0
  354. package/dist/watch.js +53 -0
  355. package/dist/websockets/client.js +14 -0
  356. package/dist/websockets/grid.js +60 -0
  357. package/dist/websockets/index.js +17 -0
  358. package/dist/websockets/websocket.js +78 -0
  359. package/docker_run.sh +7 -0
  360. package/jest-testcontainers-config.js +8 -0
  361. package/jest.config.ts +52 -0
  362. package/nodemon.json +10 -0
  363. package/package.json +166 -31
  364. package/pm2.config.js +9 -0
  365. package/scripts/account.js +8 -0
  366. package/scripts/dev/manage.js +119 -0
  367. package/scripts/docs/README.md +31 -0
  368. package/scripts/docs/generate.js +74 -0
  369. package/scripts/docs/toSwagger.js +320 -0
  370. package/scripts/exportAppTemplate.js +64 -0
  371. package/scripts/integrations/customer-categories/docker-compose.yml +28 -0
  372. package/scripts/integrations/customer-categories/init.sql +41 -0
  373. package/scripts/integrations/customer-categories/reset.sh +3 -0
  374. package/scripts/integrations/mssql/data/Dockerfile +9 -0
  375. package/scripts/integrations/mssql/data/entrypoint.sh +25 -0
  376. package/scripts/integrations/mssql/data/setup.sql +80 -0
  377. package/scripts/integrations/mssql/docker-compose.yaml +12 -0
  378. package/scripts/integrations/mssql/reset.sh +3 -0
  379. package/scripts/integrations/mysql/docker-compose.yaml +21 -0
  380. package/scripts/integrations/mysql/init.sql +32 -0
  381. package/scripts/integrations/mysql/reset.sh +3 -0
  382. package/scripts/integrations/oracle/docker-compose.yml +19 -0
  383. package/scripts/integrations/oracle/instantclient/linux/arm64/basiclite-19.10.zip +0 -0
  384. package/scripts/integrations/oracle/instantclient/linux/arm64/install.sh +23 -0
  385. package/scripts/integrations/oracle/instantclient/linux/install.sh +10 -0
  386. package/scripts/integrations/oracle/instantclient/linux/x86-64/basiclite-21.4.zip +0 -0
  387. package/scripts/integrations/oracle/instantclient/linux/x86-64/install.sh +23 -0
  388. package/scripts/integrations/oracle/oracle.md +90 -0
  389. package/scripts/integrations/pg-json/docker-compose.yml +28 -0
  390. package/scripts/integrations/pg-json/init.sql +22 -0
  391. package/scripts/integrations/pg-json/reset.sh +3 -0
  392. package/scripts/integrations/postgres/docker-compose.yml +28 -0
  393. package/scripts/integrations/postgres/emp-skill.sql +46 -0
  394. package/scripts/integrations/postgres/emp-territory.sql +32 -0
  395. package/scripts/integrations/postgres/init.sql +57 -0
  396. package/scripts/integrations/postgres/reset.sh +3 -0
  397. package/scripts/integrations/service-vehicles/docker-compose.yml +28 -0
  398. package/scripts/integrations/service-vehicles/init.sql +52 -0
  399. package/scripts/integrations/service-vehicles/reset.sh +3 -0
  400. package/scripts/load/create-many-apps.js +24 -0
  401. package/scripts/load/create-many-rows.js +30 -0
  402. package/scripts/load/utils.js +66 -0
  403. package/scripts/localdomain.js +52 -0
  404. package/scripts/multiTenancy.js +8 -0
  405. package/scripts/selfhost.js +8 -0
  406. package/scripts/test.sh +14 -0
  407. package/scripts/watchtower-hooks/post-check.sh +1 -0
  408. package/scripts/watchtower-hooks/post-update.sh +1 -0
  409. package/scripts/watchtower-hooks/pre-check.sh +1 -0
  410. package/scripts/watchtower-hooks/pre-update.sh +1 -0
  411. package/specs/generate.ts +92 -0
  412. package/specs/openapi.json +2782 -0
  413. package/specs/openapi.yaml +2111 -0
  414. package/specs/parameters.ts +59 -0
  415. package/specs/resources/application.ts +137 -0
  416. package/specs/resources/index.ts +26 -0
  417. package/specs/resources/metrics.ts +81 -0
  418. package/specs/resources/misc.ts +128 -0
  419. package/specs/resources/query.ts +217 -0
  420. package/specs/resources/row.ts +124 -0
  421. package/specs/resources/table.ts +197 -0
  422. package/specs/resources/user.ts +132 -0
  423. package/specs/resources/utils/Resource.ts +39 -0
  424. package/specs/resources/utils/index.ts +11 -0
  425. package/specs/security.ts +7 -0
  426. package/src/api/controllers/analytics.ts +35 -0
  427. package/src/api/controllers/apikeys.ts +54 -0
  428. package/src/api/controllers/application.ts +633 -0
  429. package/src/api/controllers/auth.ts +72 -0
  430. package/src/api/controllers/automation.ts +302 -0
  431. package/src/api/controllers/backup.ts +21 -0
  432. package/src/api/controllers/cloud.ts +119 -0
  433. package/src/api/controllers/component.ts +58 -0
  434. package/src/api/controllers/datasource.ts +351 -0
  435. package/src/api/controllers/deploy/Deployment.ts +59 -0
  436. package/src/api/controllers/deploy/index.ts +203 -0
  437. package/src/api/controllers/dev.ts +129 -0
  438. package/src/api/controllers/integration.ts +13 -0
  439. package/src/api/controllers/layout.ts +47 -0
  440. package/src/api/controllers/metadata.ts +42 -0
  441. package/src/api/controllers/migrations.ts +14 -0
  442. package/src/api/controllers/ops.ts +32 -0
  443. package/src/api/controllers/permission.ts +178 -0
  444. package/src/api/controllers/plugin/file.ts +15 -0
  445. package/src/api/controllers/plugin/github.ts +75 -0
  446. package/src/api/controllers/plugin/index.ts +101 -0
  447. package/src/api/controllers/plugin/npm.ts +56 -0
  448. package/src/api/controllers/plugin/uploaders.ts +4 -0
  449. package/src/api/controllers/plugin/url.ts +12 -0
  450. package/src/api/controllers/plugin/utils.ts +17 -0
  451. package/src/api/controllers/public/applications.ts +100 -0
  452. package/src/api/controllers/public/mapping/applications.ts +32 -0
  453. package/src/api/controllers/public/mapping/index.ts +13 -0
  454. package/src/api/controllers/public/mapping/queries.ts +39 -0
  455. package/src/api/controllers/public/mapping/rows.ts +31 -0
  456. package/src/api/controllers/public/mapping/tables.ts +26 -0
  457. package/src/api/controllers/public/mapping/types.ts +21 -0
  458. package/src/api/controllers/public/mapping/users.ts +32 -0
  459. package/src/api/controllers/public/metrics.ts +251 -0
  460. package/src/api/controllers/public/queries.ts +20 -0
  461. package/src/api/controllers/public/rows.ts +81 -0
  462. package/src/api/controllers/public/tables.ts +56 -0
  463. package/src/api/controllers/public/users.ts +80 -0
  464. package/src/api/controllers/public/utils.ts +45 -0
  465. package/src/api/controllers/query/import/index.ts +96 -0
  466. package/src/api/controllers/query/import/sources/base/index.ts +98 -0
  467. package/src/api/controllers/query/import/sources/base/openapi.ts +24 -0
  468. package/src/api/controllers/query/import/sources/curl.ts +106 -0
  469. package/src/api/controllers/query/import/sources/openapi2.ts +167 -0
  470. package/src/api/controllers/query/import/sources/openapi3.ts +209 -0
  471. package/src/api/controllers/query/import/sources/tests/curl/curl.spec.js +103 -0
  472. package/src/api/controllers/query/import/sources/tests/curl/data/delete.txt +1 -0
  473. package/src/api/controllers/query/import/sources/tests/curl/data/empty-body.txt +2 -0
  474. package/src/api/controllers/query/import/sources/tests/curl/data/get.txt +1 -0
  475. package/src/api/controllers/query/import/sources/tests/curl/data/headers.txt +3 -0
  476. package/src/api/controllers/query/import/sources/tests/curl/data/patch.txt +2 -0
  477. package/src/api/controllers/query/import/sources/tests/curl/data/path.txt +1 -0
  478. package/src/api/controllers/query/import/sources/tests/curl/data/post.txt +2 -0
  479. package/src/api/controllers/query/import/sources/tests/curl/data/put.txt +2 -0
  480. package/src/api/controllers/query/import/sources/tests/curl/data/query.txt +1 -0
  481. package/src/api/controllers/query/import/sources/tests/openapi2/data/crud/crud.json +253 -0
  482. package/src/api/controllers/query/import/sources/tests/openapi2/data/crud/crud.yaml +160 -0
  483. package/src/api/controllers/query/import/sources/tests/openapi2/data/petstore/petstore.json +1054 -0
  484. package/src/api/controllers/query/import/sources/tests/openapi2/data/petstore/petstore.yaml +711 -0
  485. package/src/api/controllers/query/import/sources/tests/openapi2/openapi2.spec.js +238 -0
  486. package/src/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.json +253 -0
  487. package/src/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.yaml +153 -0
  488. package/src/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.json +1225 -0
  489. package/src/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.yaml +804 -0
  490. package/src/api/controllers/query/import/sources/tests/openapi3/openapi3.spec.js +240 -0
  491. package/src/api/controllers/query/import/tests/index.spec.js +162 -0
  492. package/src/api/controllers/query/index.ts +307 -0
  493. package/src/api/controllers/query/validation.ts +50 -0
  494. package/src/api/controllers/role.ts +104 -0
  495. package/src/api/controllers/routing.ts +95 -0
  496. package/src/api/controllers/row/ExternalRequest.ts +821 -0
  497. package/src/api/controllers/row/external.ts +304 -0
  498. package/src/api/controllers/row/index.ts +162 -0
  499. package/src/api/controllers/row/internal.ts +500 -0
  500. package/src/api/controllers/row/internalSearch.ts +18 -0
  501. package/src/api/controllers/row/staticFormula.ts +170 -0
  502. package/src/api/controllers/row/utils.ts +156 -0
  503. package/src/api/controllers/screen.ts +126 -0
  504. package/src/api/controllers/script.ts +12 -0
  505. package/src/api/controllers/static/index.ts +241 -0
  506. package/src/api/controllers/static/templates/BudibaseApp.svelte +135 -0
  507. package/src/api/controllers/static/templates/app.hbs +13 -0
  508. package/src/api/controllers/static/templates/preview.hbs +117 -0
  509. package/src/api/controllers/table/bulkFormula.ts +188 -0
  510. package/src/api/controllers/table/external.ts +364 -0
  511. package/src/api/controllers/table/index.ts +143 -0
  512. package/src/api/controllers/table/internal.ts +191 -0
  513. package/src/api/controllers/table/tests/utils.spec.ts +97 -0
  514. package/src/api/controllers/table/utils.ts +422 -0
  515. package/src/api/controllers/templates.ts +43 -0
  516. package/src/api/controllers/user.ts +97 -0
  517. package/src/api/controllers/view/exporters.ts +43 -0
  518. package/src/api/controllers/view/index.ts +192 -0
  519. package/src/api/controllers/view/tests/__snapshots__/viewBuilder.spec.js.snap +147 -0
  520. package/src/api/controllers/view/tests/viewBuilder.spec.js +65 -0
  521. package/src/api/controllers/view/utils.ts +165 -0
  522. package/src/api/controllers/view/viewBuilder.ts +203 -0
  523. package/src/api/controllers/webhook.ts +100 -0
  524. package/src/api/index.ts +63 -0
  525. package/src/api/routes/analytics.ts +9 -0
  526. package/src/api/routes/apikeys.ts +12 -0
  527. package/src/api/routes/application.ts +57 -0
  528. package/src/api/routes/auth.ts +8 -0
  529. package/src/api/routes/automation.ts +87 -0
  530. package/src/api/routes/backup.ts +14 -0
  531. package/src/api/routes/cloud.ts +18 -0
  532. package/src/api/routes/component.ts +14 -0
  533. package/src/api/routes/datasource.ts +60 -0
  534. package/src/api/routes/deploy.ts +20 -0
  535. package/src/api/routes/dev.ts +38 -0
  536. package/src/api/routes/index.ts +73 -0
  537. package/src/api/routes/integration.ts +16 -0
  538. package/src/api/routes/layout.ts +16 -0
  539. package/src/api/routes/metadata.ts +38 -0
  540. package/src/api/routes/migrations.ts +14 -0
  541. package/src/api/routes/ops.ts +30 -0
  542. package/src/api/routes/permission.ts +41 -0
  543. package/src/api/routes/plugin.ts +22 -0
  544. package/src/api/routes/public/applications.ts +195 -0
  545. package/src/api/routes/public/index.ts +145 -0
  546. package/src/api/routes/public/metrics.ts +28 -0
  547. package/src/api/routes/public/middleware/mapper.ts +85 -0
  548. package/src/api/routes/public/queries.ts +76 -0
  549. package/src/api/routes/public/rows.ts +171 -0
  550. package/src/api/routes/public/tables.ts +167 -0
  551. package/src/api/routes/public/tests/compare.spec.ts +185 -0
  552. package/src/api/routes/public/tests/metrics.spec.js +34 -0
  553. package/src/api/routes/public/tests/users.spec.js +38 -0
  554. package/src/api/routes/public/tests/utils.ts +45 -0
  555. package/src/api/routes/public/users.ts +142 -0
  556. package/src/api/routes/public/utils/Endpoint.ts +51 -0
  557. package/src/api/routes/query.ts +61 -0
  558. package/src/api/routes/role.ts +24 -0
  559. package/src/api/routes/routing.ts +14 -0
  560. package/src/api/routes/row.ts +266 -0
  561. package/src/api/routes/screen.ts +23 -0
  562. package/src/api/routes/script.ts +10 -0
  563. package/src/api/routes/static.ts +65 -0
  564. package/src/api/routes/table.ts +170 -0
  565. package/src/api/routes/templates.ts +16 -0
  566. package/src/api/routes/tests/__snapshots__/datasource.spec.ts.snap +93 -0
  567. package/src/api/routes/tests/__snapshots__/view.spec.js.snap +38 -0
  568. package/src/api/routes/tests/analytics.spec.js +62 -0
  569. package/src/api/routes/tests/apikeys.spec.js +59 -0
  570. package/src/api/routes/tests/appSync.spec.ts +31 -0
  571. package/src/api/routes/tests/application.spec.ts +327 -0
  572. package/src/api/routes/tests/auth.spec.js +24 -0
  573. package/src/api/routes/tests/automation.spec.js +349 -0
  574. package/src/api/routes/tests/backup.spec.ts +45 -0
  575. package/src/api/routes/tests/cloud.spec.ts +54 -0
  576. package/src/api/routes/tests/component.spec.js +32 -0
  577. package/src/api/routes/tests/data/budibase-component-1.0.1.tgz +0 -0
  578. package/src/api/routes/tests/data/comment-box-1.0.2.tar.gz +0 -0
  579. package/src/api/routes/tests/data/export-test.tar.gz +0 -0
  580. package/src/api/routes/tests/data/export.txt +1 -0
  581. package/src/api/routes/tests/data/old-app.txt +3 -0
  582. package/src/api/routes/tests/datasource.spec.ts +238 -0
  583. package/src/api/routes/tests/dev.spec.js +40 -0
  584. package/src/api/routes/tests/environmentVariables.spec.ts +144 -0
  585. package/src/api/routes/tests/integration.spec.js +52 -0
  586. package/src/api/routes/tests/internalSearch.spec.js +197 -0
  587. package/src/api/routes/tests/layout.spec.js +59 -0
  588. package/src/api/routes/tests/metadata.spec.js +65 -0
  589. package/src/api/routes/tests/misc.spec.js +91 -0
  590. package/src/api/routes/tests/permissions.spec.js +133 -0
  591. package/src/api/routes/tests/plugin.spec.ts +179 -0
  592. package/src/api/routes/tests/query.seq.spec.js +538 -0
  593. package/src/api/routes/tests/role.spec.js +131 -0
  594. package/src/api/routes/tests/routing.spec.js +116 -0
  595. package/src/api/routes/tests/row.spec.js +573 -0
  596. package/src/api/routes/tests/screen.spec.js +103 -0
  597. package/src/api/routes/tests/static.spec.js +140 -0
  598. package/src/api/routes/tests/table.spec.js +302 -0
  599. package/src/api/routes/tests/templates.spec.js +24 -0
  600. package/src/api/routes/tests/user.spec.js +208 -0
  601. package/src/api/routes/tests/utilities/TestFunctions.ts +177 -0
  602. package/src/api/routes/tests/utilities/index.ts +96 -0
  603. package/src/api/routes/tests/view.spec.js +419 -0
  604. package/src/api/routes/tests/webhook.spec.js +134 -0
  605. package/src/api/routes/user.ts +46 -0
  606. package/src/api/routes/utils/validators.ts +240 -0
  607. package/src/api/routes/view.ts +34 -0
  608. package/src/api/routes/webhook.ts +27 -0
  609. package/src/app.ts +114 -0
  610. package/src/automations/actions.ts +109 -0
  611. package/src/automations/automationUtils.ts +163 -0
  612. package/src/automations/bullboard.ts +38 -0
  613. package/src/automations/index.ts +26 -0
  614. package/src/automations/logging/index.ts +38 -0
  615. package/src/automations/steps/bash.ts +81 -0
  616. package/src/automations/steps/createRow.ts +102 -0
  617. package/src/automations/steps/delay.ts +46 -0
  618. package/src/automations/steps/deleteRow.ts +91 -0
  619. package/src/automations/steps/discord.ts +106 -0
  620. package/src/automations/steps/executeQuery.ts +98 -0
  621. package/src/automations/steps/executeScript.ts +83 -0
  622. package/src/automations/steps/filter.ts +105 -0
  623. package/src/automations/steps/integromat.ts +110 -0
  624. package/src/automations/steps/loop.ts +58 -0
  625. package/src/automations/steps/outgoingWebhook.ts +141 -0
  626. package/src/automations/steps/queryRows.ts +196 -0
  627. package/src/automations/steps/sendSmtpEmail.ts +92 -0
  628. package/src/automations/steps/serverLog.ts +59 -0
  629. package/src/automations/steps/slack.ts +87 -0
  630. package/src/automations/steps/updateRow.ts +121 -0
  631. package/src/automations/steps/utils.ts +46 -0
  632. package/src/automations/steps/zapier.ts +108 -0
  633. package/src/automations/tests/automation.spec.ts +99 -0
  634. package/src/automations/tests/bash.spec.js +34 -0
  635. package/src/automations/tests/createRow.spec.ts +46 -0
  636. package/src/automations/tests/delay.spec.js +16 -0
  637. package/src/automations/tests/deleteRow.spec.ts +55 -0
  638. package/src/automations/tests/discord.spec.js +27 -0
  639. package/src/automations/tests/executeQuery.spec.js +48 -0
  640. package/src/automations/tests/executeScript.spec.js +48 -0
  641. package/src/automations/tests/filter.spec.js +49 -0
  642. package/src/automations/tests/loop.spec.ts +45 -0
  643. package/src/automations/tests/outgoingWebhook.spec.js +39 -0
  644. package/src/automations/tests/queryRows.spec.js +117 -0
  645. package/src/automations/tests/sendSmtpEmail.spec.js +71 -0
  646. package/src/automations/tests/serverLog.spec.js +22 -0
  647. package/src/automations/tests/updateRow.spec.js +44 -0
  648. package/src/automations/tests/utilities/index.ts +60 -0
  649. package/src/automations/tests/zapier.spec.js +27 -0
  650. package/src/automations/triggerInfo/app.ts +40 -0
  651. package/src/automations/triggerInfo/cron.ts +39 -0
  652. package/src/automations/triggerInfo/index.ts +15 -0
  653. package/src/automations/triggerInfo/rowDeleted.ts +40 -0
  654. package/src/automations/triggerInfo/rowSaved.ts +48 -0
  655. package/src/automations/triggerInfo/rowUpdated.ts +48 -0
  656. package/src/automations/triggerInfo/webhook.ts +44 -0
  657. package/src/automations/triggers.ts +156 -0
  658. package/src/automations/unitTests/automationUtils.spec.ts +133 -0
  659. package/src/automations/utils.ts +267 -0
  660. package/src/constants/definitions.ts +42 -0
  661. package/src/constants/index.ts +183 -0
  662. package/src/constants/layouts.ts +147 -0
  663. package/src/constants/screens.ts +48 -0
  664. package/src/db/defaultData/datasource_bb_default.ts +654 -0
  665. package/src/db/defaultData/employeeImport.ts +152 -0
  666. package/src/db/defaultData/expensesImport.ts +114 -0
  667. package/src/db/defaultData/inventoryImport.ts +106 -0
  668. package/src/db/defaultData/jobsImport.ts +158 -0
  669. package/src/db/dynamoClient.ts +147 -0
  670. package/src/db/inMemoryView.ts +55 -0
  671. package/src/db/index.ts +16 -0
  672. package/src/db/linkedRows/LinkController.ts +445 -0
  673. package/src/db/linkedRows/LinkDocument.ts +60 -0
  674. package/src/db/linkedRows/index.ts +217 -0
  675. package/src/db/linkedRows/linkUtils.ts +125 -0
  676. package/src/db/newid.ts +5 -0
  677. package/src/db/tests/linkController.spec.js +236 -0
  678. package/src/db/tests/linkTests.spec.js +65 -0
  679. package/src/db/utils.ts +272 -0
  680. package/src/db/views/staticViews.ts +132 -0
  681. package/src/ddApm.ts +7 -0
  682. package/src/definitions/automations.ts +33 -0
  683. package/src/definitions/common.ts +54 -0
  684. package/src/definitions/datasource.ts +9 -0
  685. package/src/definitions/openapi.ts +1233 -0
  686. package/src/environment.ts +125 -0
  687. package/src/events/AutomationEmitter.ts +58 -0
  688. package/src/events/BudibaseEmitter.ts +29 -0
  689. package/src/events/docUpdates/index.ts +1 -0
  690. package/src/events/docUpdates/processors.ts +14 -0
  691. package/src/events/docUpdates/syncUsers.ts +35 -0
  692. package/src/events/index.ts +6 -0
  693. package/src/events/utils.ts +78 -0
  694. package/src/index.ts +16 -0
  695. package/src/integration-test/postgres.spec.ts +1026 -0
  696. package/src/integrations/airtable.ts +148 -0
  697. package/src/integrations/arangodb.ts +110 -0
  698. package/src/integrations/base/query.ts +18 -0
  699. package/src/integrations/base/sql.ts +651 -0
  700. package/src/integrations/base/sqlTable.ts +202 -0
  701. package/src/integrations/base/types.ts +134 -0
  702. package/src/integrations/couchdb.ts +133 -0
  703. package/src/integrations/dynamodb.ts +220 -0
  704. package/src/integrations/elasticsearch.ts +187 -0
  705. package/src/integrations/firebase.ts +187 -0
  706. package/src/integrations/googlesheets.ts +511 -0
  707. package/src/integrations/index.ts +125 -0
  708. package/src/integrations/microsoftSqlServer.ts +312 -0
  709. package/src/integrations/mongodb.ts +638 -0
  710. package/src/integrations/mysql.ts +300 -0
  711. package/src/integrations/oracle.ts +435 -0
  712. package/src/integrations/postgres.ts +336 -0
  713. package/src/integrations/queries/sql.ts +81 -0
  714. package/src/integrations/redis.ts +163 -0
  715. package/src/integrations/rest.ts +436 -0
  716. package/src/integrations/s3.ts +260 -0
  717. package/src/integrations/snowflake.ts +97 -0
  718. package/src/integrations/tests/TestConfiguration.js +0 -0
  719. package/src/integrations/tests/airtable.spec.ts +75 -0
  720. package/src/integrations/tests/arangodb.spec.ts +38 -0
  721. package/src/integrations/tests/couchdb.spec.ts +86 -0
  722. package/src/integrations/tests/dynamodb.spec.ts +155 -0
  723. package/src/integrations/tests/elasticsearch.spec.ts +82 -0
  724. package/src/integrations/tests/firebase.spec.ts +97 -0
  725. package/src/integrations/tests/googlesheets.spec.ts +126 -0
  726. package/src/integrations/tests/microsoftSqlServer.spec.ts +56 -0
  727. package/src/integrations/tests/mongo.spec.ts +334 -0
  728. package/src/integrations/tests/mysql.spec.ts +133 -0
  729. package/src/integrations/tests/oracle.spec.ts +96 -0
  730. package/src/integrations/tests/postgres.spec.ts +81 -0
  731. package/src/integrations/tests/redis.spec.ts +88 -0
  732. package/src/integrations/tests/rest.spec.ts +595 -0
  733. package/src/integrations/tests/s3.spec.ts +112 -0
  734. package/src/integrations/tests/sql.spec.ts +639 -0
  735. package/src/integrations/utils.ts +330 -0
  736. package/src/middleware/appInfo.ts +20 -0
  737. package/src/middleware/authorized.ts +131 -0
  738. package/src/middleware/builder.ts +97 -0
  739. package/src/middleware/currentapp.ts +112 -0
  740. package/src/middleware/joi-validator.ts +40 -0
  741. package/src/middleware/publicApi.ts +21 -0
  742. package/src/middleware/resourceId.ts +66 -0
  743. package/src/middleware/selfhost.ts +12 -0
  744. package/src/middleware/tests/authorized.spec.js +163 -0
  745. package/src/middleware/tests/currentapp.spec.js +207 -0
  746. package/src/middleware/tests/resourceId.spec.js +105 -0
  747. package/src/middleware/tests/selfhost.spec.js +43 -0
  748. package/src/middleware/utils.ts +9 -0
  749. package/src/migrations/functions/appUrls.ts +27 -0
  750. package/src/migrations/functions/backfill/app/automations.ts +26 -0
  751. package/src/migrations/functions/backfill/app/datasources.ts +22 -0
  752. package/src/migrations/functions/backfill/app/layouts.ts +29 -0
  753. package/src/migrations/functions/backfill/app/queries.ts +47 -0
  754. package/src/migrations/functions/backfill/app/roles.ts +22 -0
  755. package/src/migrations/functions/backfill/app/screens.ts +22 -0
  756. package/src/migrations/functions/backfill/app/tables.ts +27 -0
  757. package/src/migrations/functions/backfill/app.ts +149 -0
  758. package/src/migrations/functions/backfill/global/configs.ts +73 -0
  759. package/src/migrations/functions/backfill/global/quotas.ts +60 -0
  760. package/src/migrations/functions/backfill/global/users.ts +49 -0
  761. package/src/migrations/functions/backfill/global.ts +213 -0
  762. package/src/migrations/functions/backfill/index.ts +7 -0
  763. package/src/migrations/functions/backfill/installation.ts +50 -0
  764. package/src/migrations/functions/syncQuotas.ts +15 -0
  765. package/src/migrations/functions/tableSettings.ts +145 -0
  766. package/src/migrations/functions/tests/appUrls.spec.js +26 -0
  767. package/src/migrations/functions/tests/syncQuotas.spec.js +26 -0
  768. package/src/migrations/functions/tests/tableSettings.spec.ts +144 -0
  769. package/src/migrations/functions/tests/userEmailViewCasing.spec.js +34 -0
  770. package/src/migrations/functions/usageQuotas/index.ts +3 -0
  771. package/src/migrations/functions/usageQuotas/syncApps.ts +14 -0
  772. package/src/migrations/functions/usageQuotas/syncPlugins.ts +10 -0
  773. package/src/migrations/functions/usageQuotas/syncRows.ts +27 -0
  774. package/src/migrations/functions/usageQuotas/tests/syncApps.spec.ts +35 -0
  775. package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +53 -0
  776. package/src/migrations/functions/userEmailViewCasing.ts +13 -0
  777. package/src/migrations/index.ts +115 -0
  778. package/src/migrations/tests/helpers.ts +40 -0
  779. package/src/migrations/tests/index.spec.ts +142 -0
  780. package/src/migrations/tests/structures.ts +67 -0
  781. package/src/sdk/app/applications/index.ts +7 -0
  782. package/src/sdk/app/applications/sync.ts +168 -0
  783. package/src/sdk/app/applications/tests/sync.spec.ts +137 -0
  784. package/src/sdk/app/applications/utils.ts +17 -0
  785. package/src/sdk/app/automations/index.ts +5 -0
  786. package/src/sdk/app/automations/webhook.ts +43 -0
  787. package/src/sdk/app/backups/constants.ts +3 -0
  788. package/src/sdk/app/backups/exports.ts +195 -0
  789. package/src/sdk/app/backups/imports.ts +185 -0
  790. package/src/sdk/app/backups/index.ts +9 -0
  791. package/src/sdk/app/backups/statistics.ts +69 -0
  792. package/src/sdk/app/datasources/datasources.ts +162 -0
  793. package/src/sdk/app/datasources/index.ts +5 -0
  794. package/src/sdk/app/queries/index.ts +5 -0
  795. package/src/sdk/app/queries/queries.ts +50 -0
  796. package/src/sdk/app/rows/attachments.ts +60 -0
  797. package/src/sdk/app/rows/index.ts +7 -0
  798. package/src/sdk/app/rows/rows.ts +18 -0
  799. package/src/sdk/app/tables/index.ts +63 -0
  800. package/src/sdk/index.ts +24 -0
  801. package/src/sdk/plugins/index.ts +5 -0
  802. package/src/sdk/plugins/plugins.ts +41 -0
  803. package/src/sdk/tests/attachments.spec.ts +76 -0
  804. package/src/sdk/users/index.ts +5 -0
  805. package/src/sdk/users/tests/utils.spec.ts +128 -0
  806. package/src/sdk/users/utils.ts +93 -0
  807. package/src/sdk/utils/index.ts +16 -0
  808. package/src/startup.ts +138 -0
  809. package/src/tests/jestEnv.ts +11 -0
  810. package/src/tests/jestSetup.ts +22 -0
  811. package/src/tests/utilities/TestConfiguration.ts +768 -0
  812. package/src/tests/utilities/controllers.ts +14 -0
  813. package/src/tests/utilities/index.ts +11 -0
  814. package/src/tests/utilities/structures.ts +289 -0
  815. package/src/threads/automation.ts +502 -0
  816. package/src/threads/definitions.ts +21 -0
  817. package/src/threads/index.ts +111 -0
  818. package/src/threads/query.ts +305 -0
  819. package/src/threads/utils.ts +96 -0
  820. package/src/utilities/appDirectoryTemplate/package.json +10 -0
  821. package/src/utilities/budibaseDir.ts +3 -0
  822. package/src/utilities/centralPath.ts +22 -0
  823. package/src/utilities/fileSystem/app.ts +79 -0
  824. package/src/utilities/fileSystem/clientLibrary.ts +154 -0
  825. package/src/utilities/fileSystem/filesystem.ts +168 -0
  826. package/src/utilities/fileSystem/index.ts +5 -0
  827. package/src/utilities/fileSystem/plugin.ts +73 -0
  828. package/src/utilities/fileSystem/processor.ts +19 -0
  829. package/src/utilities/fileSystem/template.ts +36 -0
  830. package/src/utilities/global.ts +153 -0
  831. package/src/utilities/index.ts +134 -0
  832. package/src/utilities/redis.ts +88 -0
  833. package/src/utilities/retry.ts +18 -0
  834. package/src/utilities/routing/index.ts +32 -0
  835. package/src/utilities/rowProcessor/index.ts +279 -0
  836. package/src/utilities/rowProcessor/map.ts +96 -0
  837. package/src/utilities/rowProcessor/tests/utils.spec.ts +57 -0
  838. package/src/utilities/rowProcessor/utils.ts +96 -0
  839. package/src/utilities/schema.ts +141 -0
  840. package/src/utilities/scriptRunner.ts +28 -0
  841. package/src/utilities/security.ts +65 -0
  842. package/{utilities/statusCodes.js → src/utilities/statusCodes.ts} +1 -1
  843. package/src/utilities/tests/test.csv +4 -0
  844. package/src/utilities/usageQuota/rows.ts +80 -0
  845. package/src/utilities/usageQuota/usageQuoteReset.ts +18 -0
  846. package/src/utilities/users.ts +49 -0
  847. package/src/utilities/workerRequests.ts +188 -0
  848. package/src/watch.ts +37 -0
  849. package/src/websockets/client.ts +11 -0
  850. package/src/websockets/grid.ts +55 -0
  851. package/src/websockets/index.ts +14 -0
  852. package/src/websockets/websocket.ts +83 -0
  853. package/tsconfig.build.json +28 -0
  854. package/tsconfig.json +22 -0
  855. package/app.js +0 -20
  856. package/appPackages/_master/access_levels.json +0 -175
  857. package/appPackages/_master/appDefinition.json +0 -527
  858. package/appPackages/_master/main.js +0 -125
  859. package/appPackages/_master/node_modules/.yarn-integrity +0 -20
  860. package/appPackages/_master/node_modules/@budibase/materialdesign-components/README.md +0 -33
  861. package/appPackages/_master/node_modules/@budibase/materialdesign-components/components.json +0 -249
  862. package/appPackages/_master/node_modules/@budibase/materialdesign-components/dist/index.js +0 -11282
  863. package/appPackages/_master/node_modules/@budibase/materialdesign-components/dist/index.js.map +0 -1
  864. package/appPackages/_master/node_modules/@budibase/materialdesign-components/package.json +0 -50
  865. package/appPackages/_master/node_modules/@budibase/standard-components/README.md +0 -33
  866. package/appPackages/_master/node_modules/@budibase/standard-components/components.json +0 -239
  867. package/appPackages/_master/node_modules/@budibase/standard-components/dist/generators.js +0 -198
  868. package/appPackages/_master/node_modules/@budibase/standard-components/dist/index.js +0 -3460
  869. package/appPackages/_master/node_modules/@budibase/standard-components/dist/index.js.map +0 -1
  870. package/appPackages/_master/node_modules/@budibase/standard-components/package.json +0 -38
  871. package/appPackages/_master/package-lock.json +0 -247
  872. package/appPackages/_master/package.json +0 -14
  873. package/appPackages/_master/pages/main/page.json +0 -199
  874. package/appPackages/_master/pages/main/screens/Apps List.json +0 -131
  875. package/appPackages/_master/pages/main/screens/Manage App.json +0 -292
  876. package/appPackages/_master/pages/main/screens/New App.json +0 -410
  877. package/appPackages/_master/pages/main/screens/New Instance.json +0 -227
  878. package/appPackages/_master/pages/unauthenticated/page.json +0 -83
  879. package/appPackages/_master/plugins.js +0 -3
  880. package/appPackages/_master/public/_shared/budibase-logo.png +0 -0
  881. package/appPackages/_master/public/main/budibase-client.js +0 -25115
  882. package/appPackages/_master/public/main/budibase-client.js.map +0 -1
  883. package/appPackages/_master/public/main/index.html +0 -48
  884. package/appPackages/_master/public/main/index.js +0 -3397
  885. package/appPackages/_master/public/main/index.js.map +0 -1
  886. package/appPackages/_master/public/unauthenticated/budibase-client.js +0 -25115
  887. package/appPackages/_master/public/unauthenticated/budibase-client.js.map +0 -1
  888. package/appPackages/_master/public/unauthenticated/index.html +0 -40
  889. package/appPackages/_master/public/unauthenticated/index.js +0 -3397
  890. package/appPackages/_master/public/unauthenticated/index.js.map +0 -1
  891. package/appPackages/_master/yarn.lock +0 -13
  892. package/builder/__app.html +0 -22
  893. package/builder/assets/budibase-emblem-white.svg +0 -29
  894. package/builder/assets/budibase-logo-only.png +0 -0
  895. package/builder/assets/budibase-logo-white.png +0 -0
  896. package/builder/assets/budibase-logo.png +0 -0
  897. package/builder/assets/javascript-logo.svg +0 -1
  898. package/builder/assets/roboto-v20-latin-ext_latin-300.woff +0 -0
  899. package/builder/assets/roboto-v20-latin-ext_latin-300.woff2 +0 -0
  900. package/builder/assets/roboto-v20-latin-ext_latin-500.woff +0 -0
  901. package/builder/assets/roboto-v20-latin-ext_latin-500.woff2 +0 -0
  902. package/builder/assets/roboto-v20-latin-ext_latin-700.woff +0 -0
  903. package/builder/assets/roboto-v20-latin-ext_latin-700.woff2 +0 -0
  904. package/builder/assets/roboto-v20-latin-ext_latin-900.woff +0 -0
  905. package/builder/assets/roboto-v20-latin-ext_latin-900.woff2 +0 -0
  906. package/builder/assets/roboto-v20-latin-ext_latin-regular.woff +0 -0
  907. package/builder/assets/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
  908. package/builder/budibase-client.esm.mjs +0 -24948
  909. package/builder/budibase.css +0 -120
  910. package/builder/bundle.css +0 -70
  911. package/builder/bundle.css.map +0 -146
  912. package/builder/bundle.js +0 -99294
  913. package/builder/bundle.js.map +0 -1
  914. package/builder/codemirror.css +0 -349
  915. package/builder/favicon.png +0 -0
  916. package/builder/flatpickr.css +0 -784
  917. package/builder/fonts.css +0 -47
  918. package/builder/global.css +0 -111
  919. package/builder/monokai.css +0 -41
  920. package/builder/uikit.min.css +0 -1
  921. package/config.contributors.js +0 -13
  922. package/config.dev.js +0 -13
  923. package/config.sample.js +0 -33
  924. package/index.js +0 -24
  925. package/initialise/buildAppContext.js +0 -11
  926. package/initialise/createInstanceDb.js +0 -37
  927. package/initialise/createMasterDb.js +0 -34
  928. package/initialise/initialiseBudibase.js +0 -1
  929. package/initialise/initialiseRuntimePackages.js +0 -42
  930. package/middleware/routeHandlers/aggregatesPost.js +0 -12
  931. package/middleware/routeHandlers/appDefault.js +0 -21
  932. package/middleware/routeHandlers/authenticate.js +0 -15
  933. package/middleware/routeHandlers/changeMyPassword.js +0 -9
  934. package/middleware/routeHandlers/createTemporaryAccess.js +0 -17
  935. package/middleware/routeHandlers/createUser.js +0 -10
  936. package/middleware/routeHandlers/deleteRecord.js +0 -9
  937. package/middleware/routeHandlers/disableUser.js +0 -11
  938. package/middleware/routeHandlers/enableUser.js +0 -6
  939. package/middleware/routeHandlers/executeAction.js +0 -9
  940. package/middleware/routeHandlers/getAccessLevels.js +0 -6
  941. package/middleware/routeHandlers/getRecord.js +0 -15
  942. package/middleware/routeHandlers/getUsers.js +0 -6
  943. package/middleware/routeHandlers/helpers.js +0 -15
  944. package/middleware/routeHandlers/index.js +0 -45
  945. package/middleware/routeHandlers/listRecordsGet.js +0 -8
  946. package/middleware/routeHandlers/listRecordsPost.js +0 -12
  947. package/middleware/routeHandlers/lookupField.js +0 -14
  948. package/middleware/routeHandlers/postFiles.js +0 -13
  949. package/middleware/routeHandlers/saveAppHierarchy.js +0 -6
  950. package/middleware/routeHandlers/saveRecord.js +0 -6
  951. package/middleware/routeHandlers/setPasswordFromTemporaryCode.js +0 -20
  952. package/middleware/routeHandlers/upgradeData.js +0 -11
  953. package/middleware/routers.js +0 -330
  954. package/middleware/session.js +0 -24
  955. package/utilities/budibaseApi.js +0 -84
  956. package/utilities/builder/buildPage.js +0 -164
  957. package/utilities/builder/componentLibraryInfo.js +0 -77
  958. package/utilities/builder/convertCssToFiles.js +0 -43
  959. package/utilities/builder/deleteCodeMeta.js +0 -9
  960. package/utilities/builder/getPages.js +0 -20
  961. package/utilities/builder/index.js +0 -165
  962. package/utilities/builder/index.template.html +0 -44
  963. package/utilities/builder/listScreens.js +0 -48
  964. package/utilities/builder/publicPath.js +0 -3
  965. package/utilities/builder/saveBackend.js +0 -28
  966. package/utilities/constructHierarchy.js +0 -8
  967. package/utilities/createAppPackage.js +0 -101
  968. package/utilities/databaseManager.js +0 -4
  969. package/utilities/datastore.js +0 -2
  970. package/utilities/exceptions.js +0 -16
  971. package/utilities/injectedPlugins/createUser.js +0 -19
  972. package/utilities/injectedPlugins/disableUser.js +0 -3
  973. package/utilities/injectedPlugins/enableUser.js +0 -3
  974. package/utilities/injectedPlugins/index.js +0 -76
  975. package/utilities/masterAppInternal.js +0 -384
  976. package/utilities/runtimePackages.js +0 -34
  977. package/utilities/targzAppPackage.js +0 -119
@@ -0,0 +1,2111 @@
1
+ openapi: 3.0.0
2
+ info:
3
+ title: Budibase API
4
+ description: The public API for Budibase apps and its services.
5
+ version: 1.0.0
6
+ servers:
7
+ - url: https://budibase.app/api/public/v1
8
+ description: Budibase Cloud API
9
+ - url: "{protocol}://{hostname}/api/public/v1"
10
+ description: Budibase self hosted API
11
+ variables:
12
+ protocol:
13
+ default: http
14
+ description: Whether HTTP or HTTPS should be used to communicate with your
15
+ Budibase instance.
16
+ hostname:
17
+ default: localhost:10000
18
+ description: The URL of your Budibase instance.
19
+ components:
20
+ parameters:
21
+ tableId:
22
+ in: path
23
+ name: tableId
24
+ required: true
25
+ description: The ID of the table which this request is targeting.
26
+ schema:
27
+ type: string
28
+ rowId:
29
+ in: path
30
+ name: rowId
31
+ required: true
32
+ description: The ID of the row which this request is targeting.
33
+ schema:
34
+ type: string
35
+ appId:
36
+ in: header
37
+ name: x-budibase-app-id
38
+ required: true
39
+ description: The ID of the app which this request is targeting.
40
+ schema:
41
+ type: string
42
+ appIdUrl:
43
+ in: path
44
+ name: appId
45
+ required: true
46
+ description: The ID of the app which this request is targeting.
47
+ schema:
48
+ type: string
49
+ queryId:
50
+ in: path
51
+ name: queryId
52
+ required: true
53
+ description: The ID of the query which this request is targeting.
54
+ schema:
55
+ type: string
56
+ userId:
57
+ in: path
58
+ name: userId
59
+ required: true
60
+ description: The ID of the user which this request is targeting.
61
+ schema:
62
+ type: string
63
+ examples:
64
+ application:
65
+ value:
66
+ data:
67
+ _id: app_metadata
68
+ appId: app_dev_957b12f943d348faa61db7e18e088d0f
69
+ version: 1.0.58-alpha.0
70
+ name: App name
71
+ url: /app-url
72
+ tenantId: default
73
+ updatedAt: 2022-02-22T13:00:54.035Z
74
+ createdAt: 2022-02-11T18:02:26.961Z
75
+ status: development
76
+ applications:
77
+ value:
78
+ data:
79
+ - _id: app_metadata
80
+ appId: app_dev_957b12f943d348faa61db7e18e088d0f
81
+ version: 1.0.58-alpha.0
82
+ name: App name
83
+ url: /app-url
84
+ tenantId: default
85
+ updatedAt: 2022-02-22T13:00:54.035Z
86
+ createdAt: 2022-02-11T18:02:26.961Z
87
+ status: development
88
+ deploymentOutput:
89
+ value:
90
+ data:
91
+ _id: ef12381f934b4f129675cdbb76eff3c2
92
+ status: SUCCESS
93
+ appUrl: /app-url
94
+ inputRow:
95
+ value:
96
+ _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
97
+ type: row
98
+ tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70
99
+ name: Mike
100
+ age: 30
101
+ relationship:
102
+ - ro_ta_...
103
+ row:
104
+ value:
105
+ data:
106
+ _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
107
+ type: row
108
+ tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70
109
+ name: Mike
110
+ age: 30
111
+ relationship:
112
+ - primaryDisplay: Joe
113
+ _id: ro_ta_...
114
+ enrichedRow:
115
+ value:
116
+ data:
117
+ _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
118
+ name: eg
119
+ tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70
120
+ type: row
121
+ relationship:
122
+ - _id: ro_ta_users_us_8f3d717147d74d759d8cef5b6712062f
123
+ name: Joe
124
+ tableId: ta_users
125
+ internal:
126
+ - _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
127
+ primaryDisplay: eg
128
+ rows:
129
+ value:
130
+ data:
131
+ - _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
132
+ type: row
133
+ tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70
134
+ name: Mike
135
+ age: 30
136
+ relationship:
137
+ - primaryDisplay: Joe
138
+ _id: ro_ta_...
139
+ hasNextPage: true
140
+ bookmark: 10
141
+ table:
142
+ value:
143
+ data:
144
+ _id: ta_5b1649e42a5b41dea4ef7742a36a7a70
145
+ name: People
146
+ schema:
147
+ name:
148
+ type: string
149
+ name: name
150
+ age:
151
+ type: number
152
+ name: age
153
+ relationship:
154
+ type: link
155
+ name: relationship
156
+ tableId: ta_...
157
+ fieldName: relatedColumn
158
+ relationshipType: many-to-many
159
+ tables:
160
+ value:
161
+ data:
162
+ - _id: ta_5b1649e42a5b41dea4ef7742a36a7a70
163
+ name: People
164
+ schema:
165
+ name:
166
+ type: string
167
+ name: name
168
+ age:
169
+ type: number
170
+ name: age
171
+ relationship:
172
+ type: link
173
+ name: relationship
174
+ tableId: ta_...
175
+ fieldName: relatedColumn
176
+ relationshipType: many-to-many
177
+ query:
178
+ value:
179
+ data:
180
+ _id: query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e
181
+ datasourceId: datasource_plus_4d8be0c506b9465daf4bf84d890fdab6
182
+ parameters: []
183
+ fields:
184
+ sql: select * from persons
185
+ queryVerb: read
186
+ name: Help
187
+ schema:
188
+ personid:
189
+ name: personid
190
+ type: string
191
+ lastname:
192
+ name: lastname
193
+ type: string
194
+ firstname:
195
+ name: firstname
196
+ type: string
197
+ address:
198
+ name: address
199
+ type: string
200
+ city:
201
+ name: city
202
+ type: string
203
+ transformer: return data
204
+ readable: true
205
+ queries:
206
+ value:
207
+ data:
208
+ - _id: query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e
209
+ datasourceId: datasource_plus_4d8be0c506b9465daf4bf84d890fdab6
210
+ parameters: []
211
+ fields:
212
+ sql: select * from persons
213
+ queryVerb: read
214
+ name: Help
215
+ schema:
216
+ personid:
217
+ name: personid
218
+ type: string
219
+ lastname:
220
+ name: lastname
221
+ type: string
222
+ firstname:
223
+ name: firstname
224
+ type: string
225
+ address:
226
+ name: address
227
+ type: string
228
+ city:
229
+ name: city
230
+ type: string
231
+ transformer: return data
232
+ readable: true
233
+ restResponse:
234
+ value:
235
+ data:
236
+ - value: <html lang='en-GB'></html>
237
+ pagination:
238
+ cursor: "2"
239
+ raw: <html lang='en-GB'></html>
240
+ headers:
241
+ content-type: text/html; charset=ISO-8859-1
242
+ sqlResponse:
243
+ value:
244
+ data:
245
+ - personid: 1
246
+ lastname: Hughes
247
+ firstname: Mike
248
+ address: 123 Fake Street
249
+ city: Belfast
250
+ - personid: 2
251
+ lastname: Smith
252
+ firstname: John
253
+ address: 64 Updown Road
254
+ city: Dublin
255
+ user:
256
+ value:
257
+ data:
258
+ _id: us_693a73206518477283a8d5ae31103252
259
+ email: test@test.com
260
+ roles:
261
+ app_957b12f943d348faa61db7e18e088d0f: BASIC
262
+ builder:
263
+ global: false
264
+ admin:
265
+ global: true
266
+ tenantId: default
267
+ status: active
268
+ budibaseAccess: true
269
+ csrfToken: 9c70291d-7137-48f9-9166-99ab5473a3d4
270
+ userId: us_693a73206518477283a8d5ae31103252
271
+ roleId: ADMIN
272
+ role:
273
+ _id: ADMIN
274
+ name: Admin
275
+ permissionId: admin
276
+ inherits: POWER
277
+ users:
278
+ value:
279
+ data:
280
+ - _id: us_693a73206518477283a8d5ae31103252
281
+ email: test@test.com
282
+ roles:
283
+ app_957b12f943d348faa61db7e18e088d0f: BASIC
284
+ builder:
285
+ global: false
286
+ admin:
287
+ global: true
288
+ tenantId: default
289
+ status: active
290
+ budibaseAccess: true
291
+ csrfToken: 9c70291d-7137-48f9-9166-99ab5473a3d4
292
+ userId: us_693a73206518477283a8d5ae31103252
293
+ roleId: ADMIN
294
+ role:
295
+ _id: ADMIN
296
+ name: Admin
297
+ permissionId: admin
298
+ inherits: POWER
299
+ metrics:
300
+ value: >
301
+ # HELP budibase_os_uptime Time in seconds that the host operating system
302
+ has been up.
303
+
304
+ # TYPE budibase_os_uptime counter
305
+
306
+ budibase_os_uptime 54958
307
+
308
+ # HELP budibase_os_free_mem Bytes of memory free for usage on the host operating system.
309
+
310
+ # TYPE budibase_os_free_mem gauge
311
+
312
+ budibase_os_free_mem 804507648
313
+
314
+ # HELP budibase_os_total_mem Total bytes of memory on the host operating system.
315
+
316
+ # TYPE budibase_os_total_mem gauge
317
+
318
+ budibase_os_total_mem 16742404096
319
+
320
+ # HELP budibase_os_used_mem Total bytes of memory in use on the host operating system.
321
+
322
+ # TYPE budibase_os_used_mem gauge
323
+
324
+ budibase_os_used_mem 15937896448
325
+
326
+ # HELP budibase_os_load1 Host operating system load average.
327
+
328
+ # TYPE budibase_os_load1 gauge
329
+
330
+ budibase_os_load1 1.91
331
+
332
+ # HELP budibase_os_load5 Host operating system load average.
333
+
334
+ # TYPE budibase_os_load5 gauge
335
+
336
+ budibase_os_load5 1.75
337
+
338
+ # HELP budibase_os_load15 Host operating system load average.
339
+
340
+ # TYPE budibase_os_load15 gauge
341
+
342
+ budibase_os_load15 1.56
343
+
344
+ # HELP budibase_tenant_user_count The number of users created.
345
+
346
+ # TYPE budibase_tenant_user_count gauge
347
+
348
+ budibase_tenant_user_count 1
349
+
350
+ # HELP budibase_tenant_app_count The number of apps created by a user.
351
+
352
+ # TYPE budibase_tenant_app_count gauge
353
+
354
+ budibase_tenant_app_count 2
355
+
356
+ # HELP budibase_tenant_production_app_count The number of apps a user has published.
357
+
358
+ # TYPE budibase_tenant_production_app_count gauge
359
+
360
+ budibase_tenant_production_app_count 1
361
+
362
+ # HELP budibase_tenant_dev_app_count The number of apps a user has unpublished in development.
363
+
364
+ # TYPE budibase_tenant_dev_app_count gauge
365
+
366
+ budibase_tenant_dev_app_count 1
367
+
368
+ # HELP budibase_tenant_db_count The number of couchdb databases including global tables such as _users.
369
+
370
+ # TYPE budibase_tenant_db_count gauge
371
+
372
+ budibase_tenant_db_count 3
373
+
374
+ # HELP budibase_quota_usage_apps The number of apps created.
375
+
376
+ # TYPE budibase_quota_usage_apps gauge
377
+
378
+ budibase_quota_usage_apps 1
379
+
380
+ # HELP budibase_quota_limit_apps The limit on the number of apps that can be created.
381
+
382
+ # TYPE budibase_quota_limit_apps gauge
383
+
384
+ budibase_quota_limit_apps 9007199254740991
385
+
386
+ # HELP budibase_quota_usage_rows The number of database rows used from the quota.
387
+
388
+ # TYPE budibase_quota_usage_rows gauge
389
+
390
+ budibase_quota_usage_rows 0
391
+
392
+ # HELP budibase_quota_limit_rows The limit on the number of rows that can be created.
393
+
394
+ # TYPE budibase_quota_limit_rows gauge
395
+
396
+ budibase_quota_limit_rows 9007199254740991
397
+
398
+ # HELP budibase_quota_usage_plugins The number of plugins in use.
399
+
400
+ # TYPE budibase_quota_usage_plugins gauge
401
+
402
+ budibase_quota_usage_plugins 0
403
+
404
+ # HELP budibase_quota_limit_plugins The limit on the number of plugins that can be created.
405
+
406
+ # TYPE budibase_quota_limit_plugins gauge
407
+
408
+ budibase_quota_limit_plugins 9007199254740991
409
+
410
+ # HELP budibase_quota_usage_user_groups The number of user groups created.
411
+
412
+ # TYPE budibase_quota_usage_user_groups gauge
413
+
414
+ budibase_quota_usage_user_groups 0
415
+
416
+ # HELP budibase_quota_limit_user_groups The limit on the number of user groups that can be created.
417
+
418
+ # TYPE budibase_quota_limit_user_groups gauge
419
+
420
+ budibase_quota_limit_user_groups 9007199254740991
421
+
422
+ # HELP budibase_quota_usage_queries The number of queries used in the current month.
423
+
424
+ # TYPE budibase_quota_usage_queries gauge
425
+
426
+ budibase_quota_usage_queries 0
427
+
428
+ # HELP budibase_quota_limit_queries The limit on the number of queries for the current month.
429
+
430
+ # TYPE budibase_quota_limit_queries gauge
431
+
432
+ budibase_quota_limit_queries 9007199254740991
433
+
434
+ # HELP budibase_quota_usage_automations The number of automations used in the current month.
435
+
436
+ # TYPE budibase_quota_usage_automations gauge
437
+
438
+ budibase_quota_usage_automations 0
439
+
440
+ # HELP budibase_quota_limit_automations The limit on the number of automations that can be created.
441
+
442
+ # TYPE budibase_quota_limit_automations gauge
443
+
444
+ budibase_quota_limit_automations 9007199254740991
445
+ securitySchemes:
446
+ ApiKeyAuth:
447
+ type: apiKey
448
+ in: header
449
+ name: x-budibase-api-key
450
+ description: Your individual API key, this will provide access based on the
451
+ configured RBAC settings of your user.
452
+ schemas:
453
+ application:
454
+ type: object
455
+ properties:
456
+ name:
457
+ description: The name of the app.
458
+ type: string
459
+ url:
460
+ description: The URL by which the app is accessed, this must be URL encoded.
461
+ type: string
462
+ required:
463
+ - name
464
+ applicationOutput:
465
+ type: object
466
+ properties:
467
+ data:
468
+ type: object
469
+ properties:
470
+ name:
471
+ description: The name of the app.
472
+ type: string
473
+ url:
474
+ description: The URL by which the app is accessed, this must be URL encoded.
475
+ type: string
476
+ _id:
477
+ description: The ID of the app.
478
+ type: string
479
+ status:
480
+ description: The status of the app, stating it if is the development or
481
+ published version.
482
+ type: string
483
+ enum:
484
+ - development
485
+ - published
486
+ createdAt:
487
+ description: States when the app was created, will be constant. Stored in ISO
488
+ format.
489
+ type: string
490
+ updatedAt:
491
+ description: States the last time the app was updated - stored in ISO format.
492
+ type: string
493
+ version:
494
+ description: States the version of the Budibase client this app is currently
495
+ based on.
496
+ type: string
497
+ tenantId:
498
+ description: In a multi-tenant environment this will state the tenant this app
499
+ is within.
500
+ type: string
501
+ lockedBy:
502
+ description: The user this app is currently being built by.
503
+ type: object
504
+ required:
505
+ - _id
506
+ - name
507
+ - url
508
+ - status
509
+ - createdAt
510
+ - updatedAt
511
+ - version
512
+ required:
513
+ - data
514
+ applicationSearch:
515
+ type: object
516
+ properties:
517
+ data:
518
+ type: array
519
+ items:
520
+ type: object
521
+ properties:
522
+ name:
523
+ description: The name of the app.
524
+ type: string
525
+ url:
526
+ description: The URL by which the app is accessed, this must be URL encoded.
527
+ type: string
528
+ _id:
529
+ description: The ID of the app.
530
+ type: string
531
+ status:
532
+ description: The status of the app, stating it if is the development or
533
+ published version.
534
+ type: string
535
+ enum:
536
+ - development
537
+ - published
538
+ createdAt:
539
+ description: States when the app was created, will be constant. Stored in ISO
540
+ format.
541
+ type: string
542
+ updatedAt:
543
+ description: States the last time the app was updated - stored in ISO format.
544
+ type: string
545
+ version:
546
+ description: States the version of the Budibase client this app is currently
547
+ based on.
548
+ type: string
549
+ tenantId:
550
+ description: In a multi-tenant environment this will state the tenant this app
551
+ is within.
552
+ type: string
553
+ lockedBy:
554
+ description: The user this app is currently being built by.
555
+ type: object
556
+ required:
557
+ - _id
558
+ - name
559
+ - url
560
+ - status
561
+ - createdAt
562
+ - updatedAt
563
+ - version
564
+ required:
565
+ - data
566
+ deploymentOutput:
567
+ type: object
568
+ properties:
569
+ data:
570
+ type: object
571
+ properties:
572
+ _id:
573
+ description: The ID of the app.
574
+ type: string
575
+ status:
576
+ description: Status of the deployment, whether it succeeded or failed
577
+ type: string
578
+ enum:
579
+ - SUCCESS
580
+ - FAILURE
581
+ appUrl:
582
+ description: The URL of the published app
583
+ type: string
584
+ required:
585
+ - _id
586
+ - status
587
+ - appUrl
588
+ required:
589
+ - data
590
+ row:
591
+ description: The row to be created/updated, based on the table schema.
592
+ type: object
593
+ additionalProperties:
594
+ description: Key value properties of any type, depending on the table schema.
595
+ searchOutput:
596
+ type: object
597
+ required:
598
+ - data
599
+ properties:
600
+ data:
601
+ description: An array of rows, these will each contain an _id field which can be
602
+ used to update or delete them.
603
+ type: array
604
+ items:
605
+ type: object
606
+ bookmark:
607
+ description: If pagination in use, this should be provided.
608
+ oneOf:
609
+ - type: string
610
+ - type: integer
611
+ hasNextPage:
612
+ description: If pagination in use, this will determine if there is another page
613
+ to fetch.
614
+ type: boolean
615
+ rowOutput:
616
+ type: object
617
+ properties:
618
+ data:
619
+ description: The row to be created/updated, based on the table schema.
620
+ type: object
621
+ additionalProperties:
622
+ description: Key value properties of any type, depending on the table schema.
623
+ properties:
624
+ _id:
625
+ description: The ID of the row.
626
+ type: string
627
+ tableId:
628
+ description: The ID of the table this row comes from.
629
+ type: string
630
+ required:
631
+ - tableId
632
+ - _id
633
+ required:
634
+ - data
635
+ table:
636
+ description: The table to be created/updated.
637
+ type: object
638
+ required:
639
+ - name
640
+ - schema
641
+ properties:
642
+ name:
643
+ description: The name of the table.
644
+ type: string
645
+ primaryDisplay:
646
+ type: string
647
+ description: The name of the column which should be used in relationship tags
648
+ when relating to this table.
649
+ schema:
650
+ type: object
651
+ additionalProperties:
652
+ oneOf:
653
+ - type: object
654
+ properties:
655
+ type:
656
+ type: string
657
+ enum:
658
+ - link
659
+ description: A relationship column.
660
+ constraints:
661
+ type: object
662
+ description: A constraint can be applied to the column which will be validated
663
+ against when a row is saved.
664
+ properties:
665
+ type:
666
+ type: string
667
+ enum:
668
+ - string
669
+ - number
670
+ - object
671
+ - boolean
672
+ presence:
673
+ type: boolean
674
+ description: Defines whether the column is required or not.
675
+ name:
676
+ type: string
677
+ description: The name of the column.
678
+ autocolumn:
679
+ type: boolean
680
+ description: Defines whether the column is automatically generated.
681
+ fieldName:
682
+ type: string
683
+ description: The name of the column which a relationship column is related to in
684
+ another table.
685
+ tableId:
686
+ type: string
687
+ description: The ID of the table which a relationship column is related to.
688
+ relationshipType:
689
+ type: string
690
+ enum:
691
+ - one-to-many
692
+ - many-to-one
693
+ - many-to-many
694
+ description: Defines the type of relationship that this column will be used for.
695
+ through:
696
+ type: string
697
+ description: When using a SQL table that contains many to many relationships
698
+ this defines the table the relationships are linked
699
+ through.
700
+ foreignKey:
701
+ type: string
702
+ description: When using a SQL table that contains a one to many relationship
703
+ this defines the foreign key.
704
+ throughFrom:
705
+ type: string
706
+ description: When using a SQL table that utilises a through table, this defines
707
+ the primary key in the through table for this table.
708
+ throughTo:
709
+ type: string
710
+ description: When using a SQL table that utilises a through table, this defines
711
+ the primary key in the through table for the related
712
+ table.
713
+ - type: object
714
+ properties:
715
+ type:
716
+ type: string
717
+ enum:
718
+ - formula
719
+ description: A formula column.
720
+ constraints:
721
+ type: object
722
+ description: A constraint can be applied to the column which will be validated
723
+ against when a row is saved.
724
+ properties:
725
+ type:
726
+ type: string
727
+ enum:
728
+ - string
729
+ - number
730
+ - object
731
+ - boolean
732
+ presence:
733
+ type: boolean
734
+ description: Defines whether the column is required or not.
735
+ name:
736
+ type: string
737
+ description: The name of the column.
738
+ autocolumn:
739
+ type: boolean
740
+ description: Defines whether the column is automatically generated.
741
+ formula:
742
+ type: string
743
+ description: Defines a Handlebars or JavaScript formula to use, note that
744
+ Javascript formulas are expected to be provided in the
745
+ base64 format.
746
+ formulaType:
747
+ type: string
748
+ enum:
749
+ - static
750
+ - dynamic
751
+ description: Defines whether this is a static or dynamic formula.
752
+ - type: object
753
+ properties:
754
+ type:
755
+ type: string
756
+ enum:
757
+ - string
758
+ - longform
759
+ - options
760
+ - number
761
+ - boolean
762
+ - array
763
+ - datetime
764
+ - attachment
765
+ - link
766
+ - formula
767
+ - auto
768
+ - json
769
+ - internal
770
+ - barcodeqr
771
+ description: Defines the type of the column, most explain themselves, a link
772
+ column is a relationship.
773
+ constraints:
774
+ type: object
775
+ description: A constraint can be applied to the column which will be validated
776
+ against when a row is saved.
777
+ properties:
778
+ type:
779
+ type: string
780
+ enum:
781
+ - string
782
+ - number
783
+ - object
784
+ - boolean
785
+ presence:
786
+ type: boolean
787
+ description: Defines whether the column is required or not.
788
+ name:
789
+ type: string
790
+ description: The name of the column.
791
+ autocolumn:
792
+ type: boolean
793
+ description: Defines whether the column is automatically generated.
794
+ tableOutput:
795
+ type: object
796
+ properties:
797
+ data:
798
+ description: The table to be created/updated.
799
+ type: object
800
+ required:
801
+ - name
802
+ - schema
803
+ - _id
804
+ properties:
805
+ name:
806
+ description: The name of the table.
807
+ type: string
808
+ primaryDisplay:
809
+ type: string
810
+ description: The name of the column which should be used in relationship tags
811
+ when relating to this table.
812
+ schema:
813
+ type: object
814
+ additionalProperties:
815
+ oneOf:
816
+ - type: object
817
+ properties:
818
+ type:
819
+ type: string
820
+ enum:
821
+ - link
822
+ description: A relationship column.
823
+ constraints:
824
+ type: object
825
+ description: A constraint can be applied to the column which will be validated
826
+ against when a row is saved.
827
+ properties:
828
+ type:
829
+ type: string
830
+ enum:
831
+ - string
832
+ - number
833
+ - object
834
+ - boolean
835
+ presence:
836
+ type: boolean
837
+ description: Defines whether the column is required or not.
838
+ name:
839
+ type: string
840
+ description: The name of the column.
841
+ autocolumn:
842
+ type: boolean
843
+ description: Defines whether the column is automatically generated.
844
+ fieldName:
845
+ type: string
846
+ description: The name of the column which a relationship column is related to in
847
+ another table.
848
+ tableId:
849
+ type: string
850
+ description: The ID of the table which a relationship column is related to.
851
+ relationshipType:
852
+ type: string
853
+ enum:
854
+ - one-to-many
855
+ - many-to-one
856
+ - many-to-many
857
+ description: Defines the type of relationship that this column will be used for.
858
+ through:
859
+ type: string
860
+ description: When using a SQL table that contains many to many relationships
861
+ this defines the table the relationships are linked
862
+ through.
863
+ foreignKey:
864
+ type: string
865
+ description: When using a SQL table that contains a one to many relationship
866
+ this defines the foreign key.
867
+ throughFrom:
868
+ type: string
869
+ description: When using a SQL table that utilises a through table, this defines
870
+ the primary key in the through table for this table.
871
+ throughTo:
872
+ type: string
873
+ description: When using a SQL table that utilises a through table, this defines
874
+ the primary key in the through table for the related
875
+ table.
876
+ - type: object
877
+ properties:
878
+ type:
879
+ type: string
880
+ enum:
881
+ - formula
882
+ description: A formula column.
883
+ constraints:
884
+ type: object
885
+ description: A constraint can be applied to the column which will be validated
886
+ against when a row is saved.
887
+ properties:
888
+ type:
889
+ type: string
890
+ enum:
891
+ - string
892
+ - number
893
+ - object
894
+ - boolean
895
+ presence:
896
+ type: boolean
897
+ description: Defines whether the column is required or not.
898
+ name:
899
+ type: string
900
+ description: The name of the column.
901
+ autocolumn:
902
+ type: boolean
903
+ description: Defines whether the column is automatically generated.
904
+ formula:
905
+ type: string
906
+ description: Defines a Handlebars or JavaScript formula to use, note that
907
+ Javascript formulas are expected to be provided in the
908
+ base64 format.
909
+ formulaType:
910
+ type: string
911
+ enum:
912
+ - static
913
+ - dynamic
914
+ description: Defines whether this is a static or dynamic formula.
915
+ - type: object
916
+ properties:
917
+ type:
918
+ type: string
919
+ enum:
920
+ - string
921
+ - longform
922
+ - options
923
+ - number
924
+ - boolean
925
+ - array
926
+ - datetime
927
+ - attachment
928
+ - link
929
+ - formula
930
+ - auto
931
+ - json
932
+ - internal
933
+ - barcodeqr
934
+ description: Defines the type of the column, most explain themselves, a link
935
+ column is a relationship.
936
+ constraints:
937
+ type: object
938
+ description: A constraint can be applied to the column which will be validated
939
+ against when a row is saved.
940
+ properties:
941
+ type:
942
+ type: string
943
+ enum:
944
+ - string
945
+ - number
946
+ - object
947
+ - boolean
948
+ presence:
949
+ type: boolean
950
+ description: Defines whether the column is required or not.
951
+ name:
952
+ type: string
953
+ description: The name of the column.
954
+ autocolumn:
955
+ type: boolean
956
+ description: Defines whether the column is automatically generated.
957
+ _id:
958
+ description: The ID of the table.
959
+ type: string
960
+ required:
961
+ - data
962
+ tableSearch:
963
+ type: object
964
+ properties:
965
+ data:
966
+ type: array
967
+ items:
968
+ description: The table to be created/updated.
969
+ type: object
970
+ required:
971
+ - name
972
+ - schema
973
+ - _id
974
+ properties:
975
+ name:
976
+ description: The name of the table.
977
+ type: string
978
+ primaryDisplay:
979
+ type: string
980
+ description: The name of the column which should be used in relationship tags
981
+ when relating to this table.
982
+ schema:
983
+ type: object
984
+ additionalProperties:
985
+ oneOf:
986
+ - type: object
987
+ properties:
988
+ type:
989
+ type: string
990
+ enum:
991
+ - link
992
+ description: A relationship column.
993
+ constraints:
994
+ type: object
995
+ description: A constraint can be applied to the column which will be validated
996
+ against when a row is saved.
997
+ properties:
998
+ type:
999
+ type: string
1000
+ enum:
1001
+ - string
1002
+ - number
1003
+ - object
1004
+ - boolean
1005
+ presence:
1006
+ type: boolean
1007
+ description: Defines whether the column is required or not.
1008
+ name:
1009
+ type: string
1010
+ description: The name of the column.
1011
+ autocolumn:
1012
+ type: boolean
1013
+ description: Defines whether the column is automatically generated.
1014
+ fieldName:
1015
+ type: string
1016
+ description: The name of the column which a relationship column is related to in
1017
+ another table.
1018
+ tableId:
1019
+ type: string
1020
+ description: The ID of the table which a relationship column is related to.
1021
+ relationshipType:
1022
+ type: string
1023
+ enum:
1024
+ - one-to-many
1025
+ - many-to-one
1026
+ - many-to-many
1027
+ description: Defines the type of relationship that this column will be used for.
1028
+ through:
1029
+ type: string
1030
+ description: When using a SQL table that contains many to many relationships
1031
+ this defines the table the relationships are linked
1032
+ through.
1033
+ foreignKey:
1034
+ type: string
1035
+ description: When using a SQL table that contains a one to many relationship
1036
+ this defines the foreign key.
1037
+ throughFrom:
1038
+ type: string
1039
+ description: When using a SQL table that utilises a through table, this defines
1040
+ the primary key in the through table for this table.
1041
+ throughTo:
1042
+ type: string
1043
+ description: When using a SQL table that utilises a through table, this defines
1044
+ the primary key in the through table for the related
1045
+ table.
1046
+ - type: object
1047
+ properties:
1048
+ type:
1049
+ type: string
1050
+ enum:
1051
+ - formula
1052
+ description: A formula column.
1053
+ constraints:
1054
+ type: object
1055
+ description: A constraint can be applied to the column which will be validated
1056
+ against when a row is saved.
1057
+ properties:
1058
+ type:
1059
+ type: string
1060
+ enum:
1061
+ - string
1062
+ - number
1063
+ - object
1064
+ - boolean
1065
+ presence:
1066
+ type: boolean
1067
+ description: Defines whether the column is required or not.
1068
+ name:
1069
+ type: string
1070
+ description: The name of the column.
1071
+ autocolumn:
1072
+ type: boolean
1073
+ description: Defines whether the column is automatically generated.
1074
+ formula:
1075
+ type: string
1076
+ description: Defines a Handlebars or JavaScript formula to use, note that
1077
+ Javascript formulas are expected to be provided in
1078
+ the base64 format.
1079
+ formulaType:
1080
+ type: string
1081
+ enum:
1082
+ - static
1083
+ - dynamic
1084
+ description: Defines whether this is a static or dynamic formula.
1085
+ - type: object
1086
+ properties:
1087
+ type:
1088
+ type: string
1089
+ enum:
1090
+ - string
1091
+ - longform
1092
+ - options
1093
+ - number
1094
+ - boolean
1095
+ - array
1096
+ - datetime
1097
+ - attachment
1098
+ - link
1099
+ - formula
1100
+ - auto
1101
+ - json
1102
+ - internal
1103
+ - barcodeqr
1104
+ description: Defines the type of the column, most explain themselves, a link
1105
+ column is a relationship.
1106
+ constraints:
1107
+ type: object
1108
+ description: A constraint can be applied to the column which will be validated
1109
+ against when a row is saved.
1110
+ properties:
1111
+ type:
1112
+ type: string
1113
+ enum:
1114
+ - string
1115
+ - number
1116
+ - object
1117
+ - boolean
1118
+ presence:
1119
+ type: boolean
1120
+ description: Defines whether the column is required or not.
1121
+ name:
1122
+ type: string
1123
+ description: The name of the column.
1124
+ autocolumn:
1125
+ type: boolean
1126
+ description: Defines whether the column is automatically generated.
1127
+ _id:
1128
+ description: The ID of the table.
1129
+ type: string
1130
+ required:
1131
+ - data
1132
+ executeQuery:
1133
+ description: The parameters required for executing a query.
1134
+ type: object
1135
+ properties:
1136
+ parameters:
1137
+ type: object
1138
+ description: This contains the required parameters for the query, this depends
1139
+ on query type, setup and bindings.
1140
+ additionalProperties:
1141
+ description: Key value properties of any type, depending on the query output
1142
+ schema.
1143
+ pagination:
1144
+ type: object
1145
+ description: For supported query types (currently on REST) pagination can be
1146
+ performed using these properties.
1147
+ properties:
1148
+ page:
1149
+ type: string
1150
+ description: The page which has been returned from a previous query.
1151
+ limit:
1152
+ type: number
1153
+ description: The number of rows to return per page.
1154
+ executeQueryOutput:
1155
+ type: object
1156
+ properties:
1157
+ data:
1158
+ description: The data response from the query.
1159
+ type: array
1160
+ items:
1161
+ type: object
1162
+ extra:
1163
+ description: Extra information that is not part of the main data, e.g. headers.
1164
+ type: object
1165
+ properties:
1166
+ headers:
1167
+ description: If carrying out a REST request, this will contain the response
1168
+ headers.
1169
+ type: object
1170
+ raw:
1171
+ description: The raw query response, as a string.
1172
+ type: string
1173
+ pagination:
1174
+ description: If pagination is supported, this will contain the bookmark/anchor
1175
+ information for it.
1176
+ type: object
1177
+ required:
1178
+ - data
1179
+ query:
1180
+ type: object
1181
+ properties:
1182
+ _id:
1183
+ description: The ID of the query.
1184
+ type: string
1185
+ datasourceId:
1186
+ description: The ID of the datasource the query belongs to.
1187
+ type: string
1188
+ parameters:
1189
+ description: The bindings which are required to perform this query.
1190
+ type: array
1191
+ items:
1192
+ type: string
1193
+ fields:
1194
+ description: The fields that are used to perform this query, e.g. the sql
1195
+ statement
1196
+ type: object
1197
+ queryVerb:
1198
+ description: The verb that describes this query.
1199
+ enum:
1200
+ - create
1201
+ - read
1202
+ - update
1203
+ - delete
1204
+ name:
1205
+ description: The name of the query.
1206
+ type: string
1207
+ schema:
1208
+ description: The schema of the data returned when the query is executed.
1209
+ type: object
1210
+ transformer:
1211
+ description: The JavaScript transformer function, applied after the query
1212
+ responds with data.
1213
+ type: string
1214
+ readable:
1215
+ description: Whether the query has readable data.
1216
+ type: boolean
1217
+ required:
1218
+ - name
1219
+ - schema
1220
+ - _id
1221
+ querySearch:
1222
+ type: object
1223
+ properties:
1224
+ data:
1225
+ type: array
1226
+ items:
1227
+ type: object
1228
+ properties:
1229
+ _id:
1230
+ description: The ID of the query.
1231
+ type: string
1232
+ datasourceId:
1233
+ description: The ID of the datasource the query belongs to.
1234
+ type: string
1235
+ parameters:
1236
+ description: The bindings which are required to perform this query.
1237
+ type: array
1238
+ items:
1239
+ type: string
1240
+ fields:
1241
+ description: The fields that are used to perform this query, e.g. the sql
1242
+ statement
1243
+ type: object
1244
+ queryVerb:
1245
+ description: The verb that describes this query.
1246
+ enum:
1247
+ - create
1248
+ - read
1249
+ - update
1250
+ - delete
1251
+ name:
1252
+ description: The name of the query.
1253
+ type: string
1254
+ schema:
1255
+ description: The schema of the data returned when the query is executed.
1256
+ type: object
1257
+ transformer:
1258
+ description: The JavaScript transformer function, applied after the query
1259
+ responds with data.
1260
+ type: string
1261
+ readable:
1262
+ description: Whether the query has readable data.
1263
+ type: boolean
1264
+ required:
1265
+ - name
1266
+ - schema
1267
+ - _id
1268
+ required:
1269
+ - data
1270
+ user:
1271
+ type: object
1272
+ properties:
1273
+ email:
1274
+ description: The email address of the user, this must be unique.
1275
+ type: string
1276
+ password:
1277
+ description: The password of the user if using password based login - this will
1278
+ never be returned. This can be left out of subsequent requests
1279
+ (updates) and will be enriched back into the user structure.
1280
+ type: string
1281
+ status:
1282
+ description: The status of the user, if they are active.
1283
+ type: string
1284
+ enum:
1285
+ - active
1286
+ firstName:
1287
+ description: The first name of the user
1288
+ type: string
1289
+ lastName:
1290
+ description: The last name of the user
1291
+ type: string
1292
+ forceResetPassword:
1293
+ description: If set to true forces the user to reset their password on first
1294
+ login.
1295
+ type: boolean
1296
+ builder:
1297
+ description: Describes if the user is a builder user or not.
1298
+ type: object
1299
+ properties:
1300
+ global:
1301
+ description: If set to true the user will be able to build any app in the
1302
+ system.
1303
+ type: boolean
1304
+ admin:
1305
+ description: Describes if the user is an admin user or not.
1306
+ type: object
1307
+ properties:
1308
+ global:
1309
+ description: If set to true the user will be able to administrate the system.
1310
+ type: boolean
1311
+ roles:
1312
+ description: Contains the roles of the user per app (assuming they are not a
1313
+ builder user).
1314
+ type: object
1315
+ additionalProperties:
1316
+ type: string
1317
+ description: A map of app ID (production app ID, minus the _dev component) to a
1318
+ role ID, e.g. ADMIN.
1319
+ required:
1320
+ - email
1321
+ - roles
1322
+ userOutput:
1323
+ type: object
1324
+ properties:
1325
+ data:
1326
+ type: object
1327
+ properties:
1328
+ email:
1329
+ description: The email address of the user, this must be unique.
1330
+ type: string
1331
+ password:
1332
+ description: The password of the user if using password based login - this will
1333
+ never be returned. This can be left out of subsequent requests
1334
+ (updates) and will be enriched back into the user structure.
1335
+ type: string
1336
+ status:
1337
+ description: The status of the user, if they are active.
1338
+ type: string
1339
+ enum:
1340
+ - active
1341
+ firstName:
1342
+ description: The first name of the user
1343
+ type: string
1344
+ lastName:
1345
+ description: The last name of the user
1346
+ type: string
1347
+ forceResetPassword:
1348
+ description: If set to true forces the user to reset their password on first
1349
+ login.
1350
+ type: boolean
1351
+ builder:
1352
+ description: Describes if the user is a builder user or not.
1353
+ type: object
1354
+ properties:
1355
+ global:
1356
+ description: If set to true the user will be able to build any app in the
1357
+ system.
1358
+ type: boolean
1359
+ admin:
1360
+ description: Describes if the user is an admin user or not.
1361
+ type: object
1362
+ properties:
1363
+ global:
1364
+ description: If set to true the user will be able to administrate the system.
1365
+ type: boolean
1366
+ roles:
1367
+ description: Contains the roles of the user per app (assuming they are not a
1368
+ builder user).
1369
+ type: object
1370
+ additionalProperties:
1371
+ type: string
1372
+ description: A map of app ID (production app ID, minus the _dev component) to a
1373
+ role ID, e.g. ADMIN.
1374
+ _id:
1375
+ description: The ID of the user.
1376
+ type: string
1377
+ required:
1378
+ - email
1379
+ - roles
1380
+ - _id
1381
+ required:
1382
+ - data
1383
+ userSearch:
1384
+ type: object
1385
+ properties:
1386
+ data:
1387
+ type: array
1388
+ items:
1389
+ type: object
1390
+ properties:
1391
+ email:
1392
+ description: The email address of the user, this must be unique.
1393
+ type: string
1394
+ password:
1395
+ description: The password of the user if using password based login - this will
1396
+ never be returned. This can be left out of subsequent requests
1397
+ (updates) and will be enriched back into the user structure.
1398
+ type: string
1399
+ status:
1400
+ description: The status of the user, if they are active.
1401
+ type: string
1402
+ enum:
1403
+ - active
1404
+ firstName:
1405
+ description: The first name of the user
1406
+ type: string
1407
+ lastName:
1408
+ description: The last name of the user
1409
+ type: string
1410
+ forceResetPassword:
1411
+ description: If set to true forces the user to reset their password on first
1412
+ login.
1413
+ type: boolean
1414
+ builder:
1415
+ description: Describes if the user is a builder user or not.
1416
+ type: object
1417
+ properties:
1418
+ global:
1419
+ description: If set to true the user will be able to build any app in the
1420
+ system.
1421
+ type: boolean
1422
+ admin:
1423
+ description: Describes if the user is an admin user or not.
1424
+ type: object
1425
+ properties:
1426
+ global:
1427
+ description: If set to true the user will be able to administrate the system.
1428
+ type: boolean
1429
+ roles:
1430
+ description: Contains the roles of the user per app (assuming they are not a
1431
+ builder user).
1432
+ type: object
1433
+ additionalProperties:
1434
+ type: string
1435
+ description: A map of app ID (production app ID, minus the _dev component) to a
1436
+ role ID, e.g. ADMIN.
1437
+ _id:
1438
+ description: The ID of the user.
1439
+ type: string
1440
+ required:
1441
+ - email
1442
+ - roles
1443
+ - _id
1444
+ required:
1445
+ - data
1446
+ rowSearch:
1447
+ type: object
1448
+ properties:
1449
+ query:
1450
+ type: object
1451
+ properties:
1452
+ allOr:
1453
+ type: boolean
1454
+ description: Specifies that a row should be returned if it satisfies any of the
1455
+ specified options, rather than requiring it to fulfill all the
1456
+ search parameters. This defaults to false, meaning AND logic
1457
+ will be used.
1458
+ string:
1459
+ type: object
1460
+ example:
1461
+ columnName1: value
1462
+ columnName2: value
1463
+ description: A map of field name to the string to search for, this will look for
1464
+ rows that have a value starting with the string value.
1465
+ additionalProperties:
1466
+ type: string
1467
+ description: The value to search for in the column.
1468
+ fuzzy:
1469
+ type: object
1470
+ description: A fuzzy search, only supported by internal tables.
1471
+ range:
1472
+ type: object
1473
+ description: Searches within a range, the format of this must be in the format
1474
+ of an object with a "low" and "high" property.
1475
+ example:
1476
+ columnName1:
1477
+ low: 10
1478
+ high: 20
1479
+ equal:
1480
+ type: object
1481
+ description: Searches for rows that have a column value that is exactly the
1482
+ value set.
1483
+ notEqual:
1484
+ type: object
1485
+ description: Searches for any row which does not contain the specified column
1486
+ value.
1487
+ empty:
1488
+ type: object
1489
+ description: Searches for rows which do not contain the specified column. The
1490
+ object should simply contain keys of the column names, these can
1491
+ map to any value.
1492
+ example:
1493
+ columnName1: ""
1494
+ notEmpty:
1495
+ type: object
1496
+ description: Searches for rows which have the specified column.
1497
+ oneOf:
1498
+ type: object
1499
+ description: Searches for rows which have a column value that is any of the
1500
+ specified values. The format of this must be columnName ->
1501
+ [value1, value2].
1502
+ paginate:
1503
+ type: boolean
1504
+ description: Enables pagination, by default this is disabled.
1505
+ bookmark:
1506
+ oneOf:
1507
+ - type: string
1508
+ - type: integer
1509
+ description: If retrieving another page, the bookmark from the previous request
1510
+ must be supplied.
1511
+ limit:
1512
+ type: integer
1513
+ description: The maximum number of rows to return, useful when paginating, for
1514
+ internal tables this will be limited to 1000, for SQL tables it will
1515
+ be 5000.
1516
+ sort:
1517
+ type: object
1518
+ description: A set of parameters describing the sort behaviour of the search.
1519
+ properties:
1520
+ order:
1521
+ type: string
1522
+ enum:
1523
+ - ascending
1524
+ - descending
1525
+ description: The order of the sort, by default this is ascending.
1526
+ column:
1527
+ type: string
1528
+ description: The name of the column by which the rows will be sorted.
1529
+ type:
1530
+ type: string
1531
+ enum:
1532
+ - string
1533
+ - number
1534
+ description: Defines whether the column should be treated as a string or as
1535
+ numbers when sorting.
1536
+ required:
1537
+ - query
1538
+ nameSearch:
1539
+ type: object
1540
+ properties:
1541
+ name:
1542
+ type: string
1543
+ description: The name to be used when searching - this will be used in a case
1544
+ insensitive starts with match.
1545
+ required:
1546
+ - name
1547
+ security:
1548
+ - ApiKeyAuth: []
1549
+ paths:
1550
+ /applications:
1551
+ post:
1552
+ operationId: appCreate
1553
+ summary: Create an application
1554
+ tags:
1555
+ - applications
1556
+ parameters:
1557
+ - $ref: "#/components/parameters/appId"
1558
+ requestBody:
1559
+ required: true
1560
+ content:
1561
+ application/json:
1562
+ schema:
1563
+ $ref: "#/components/schemas/application"
1564
+ responses:
1565
+ "200":
1566
+ description: Returns the created application.
1567
+ content:
1568
+ application/json:
1569
+ schema:
1570
+ $ref: "#/components/schemas/applicationOutput"
1571
+ examples:
1572
+ application:
1573
+ $ref: "#/components/examples/application"
1574
+ "/applications/{appId}":
1575
+ put:
1576
+ operationId: appUpdate
1577
+ summary: Update an application
1578
+ tags:
1579
+ - applications
1580
+ parameters:
1581
+ - $ref: "#/components/parameters/appIdUrl"
1582
+ requestBody:
1583
+ required: true
1584
+ content:
1585
+ application/json:
1586
+ schema:
1587
+ $ref: "#/components/schemas/application"
1588
+ responses:
1589
+ "200":
1590
+ description: Returns the updated application.
1591
+ content:
1592
+ application/json:
1593
+ schema:
1594
+ $ref: "#/components/schemas/applicationOutput"
1595
+ examples:
1596
+ application:
1597
+ $ref: "#/components/examples/application"
1598
+ delete:
1599
+ operationId: appDestroy
1600
+ summary: Delete an application
1601
+ tags:
1602
+ - applications
1603
+ parameters:
1604
+ - $ref: "#/components/parameters/appIdUrl"
1605
+ responses:
1606
+ "200":
1607
+ description: Returns the deleted application.
1608
+ content:
1609
+ application/json:
1610
+ schema:
1611
+ $ref: "#/components/schemas/applicationOutput"
1612
+ examples:
1613
+ application:
1614
+ $ref: "#/components/examples/application"
1615
+ get:
1616
+ operationId: appGetById
1617
+ summary: Retrieve an application
1618
+ tags:
1619
+ - applications
1620
+ parameters:
1621
+ - $ref: "#/components/parameters/appIdUrl"
1622
+ responses:
1623
+ "200":
1624
+ description: Returns the retrieved application.
1625
+ content:
1626
+ application/json:
1627
+ schema:
1628
+ $ref: "#/components/schemas/applicationOutput"
1629
+ examples:
1630
+ application:
1631
+ $ref: "#/components/examples/application"
1632
+ "/applications/{appId}/unpublish":
1633
+ post:
1634
+ operationId: appUnpublish
1635
+ summary: Unpublish an application
1636
+ tags:
1637
+ - applications
1638
+ parameters:
1639
+ - $ref: "#/components/parameters/appIdUrl"
1640
+ responses:
1641
+ "204":
1642
+ description: The app was published successfully.
1643
+ "/applications/{appId}/publish":
1644
+ post:
1645
+ operationId: appPublish
1646
+ summary: Unpublish an application
1647
+ tags:
1648
+ - applications
1649
+ parameters:
1650
+ - $ref: "#/components/parameters/appIdUrl"
1651
+ responses:
1652
+ "200":
1653
+ description: Returns the deployment object.
1654
+ content:
1655
+ application/json:
1656
+ schema:
1657
+ $ref: "#/components/schemas/deploymentOutput"
1658
+ examples:
1659
+ deployment:
1660
+ $ref: "#/components/examples/deploymentOutput"
1661
+ /applications/search:
1662
+ post:
1663
+ operationId: appSearch
1664
+ summary: Search for applications
1665
+ description: Based on application properties (currently only name) search for
1666
+ applications.
1667
+ tags:
1668
+ - applications
1669
+ requestBody:
1670
+ required: true
1671
+ content:
1672
+ application/json:
1673
+ schema:
1674
+ $ref: "#/components/schemas/nameSearch"
1675
+ responses:
1676
+ "200":
1677
+ description: Returns the applications that were found based on the search
1678
+ parameters.
1679
+ content:
1680
+ application/json:
1681
+ schema:
1682
+ $ref: "#/components/schemas/applicationSearch"
1683
+ examples:
1684
+ applications:
1685
+ $ref: "#/components/examples/applications"
1686
+ /metrics:
1687
+ get:
1688
+ operationId: metricsGet
1689
+ summary: Retrieve Budibase tenant metrics
1690
+ description: Output metrics in OpenMetrics format compatible with Prometheus
1691
+ tags:
1692
+ - metrics
1693
+ responses:
1694
+ "200":
1695
+ description: Returns tenant metrics.
1696
+ content:
1697
+ text/plain:
1698
+ schema:
1699
+ type: string
1700
+ examples:
1701
+ metrics:
1702
+ $ref: "#/components/examples/metrics"
1703
+ "/queries/{queryId}":
1704
+ post:
1705
+ operationId: queryExecute
1706
+ summary: Execute a query
1707
+ description: Queries which have been created within a Budibase app can be
1708
+ executed using this,
1709
+ tags:
1710
+ - queries
1711
+ parameters:
1712
+ - $ref: "#/components/parameters/queryId"
1713
+ - $ref: "#/components/parameters/appId"
1714
+ requestBody:
1715
+ required: true
1716
+ content:
1717
+ application/json:
1718
+ schema:
1719
+ $ref: "#/components/schemas/executeQuery"
1720
+ responses:
1721
+ "200":
1722
+ description: Returns the result of the query execution.
1723
+ content:
1724
+ application/json:
1725
+ schema:
1726
+ $ref: "#/components/schemas/executeQueryOutput"
1727
+ examples:
1728
+ REST:
1729
+ $ref: "#/components/examples/restResponse"
1730
+ SQL:
1731
+ $ref: "#/components/examples/sqlResponse"
1732
+ /queries/search:
1733
+ post:
1734
+ operationId: querySearch
1735
+ summary: Search for queries
1736
+ description: Based on query properties (currently only name) search for queries.
1737
+ tags:
1738
+ - queries
1739
+ parameters:
1740
+ - $ref: "#/components/parameters/appId"
1741
+ requestBody:
1742
+ required: true
1743
+ content:
1744
+ application/json:
1745
+ schema:
1746
+ $ref: "#/components/schemas/nameSearch"
1747
+ responses:
1748
+ "200":
1749
+ description: Returns the queries found based on the search parameters.
1750
+ content:
1751
+ application/json:
1752
+ schema:
1753
+ $ref: "#/components/schemas/querySearch"
1754
+ examples:
1755
+ queries:
1756
+ $ref: "#/components/examples/queries"
1757
+ "/tables/{tableId}/rows":
1758
+ post:
1759
+ operationId: rowCreate
1760
+ summary: Create a row
1761
+ description: Creates a row within the specified table.
1762
+ tags:
1763
+ - rows
1764
+ parameters:
1765
+ - $ref: "#/components/parameters/tableId"
1766
+ - $ref: "#/components/parameters/appId"
1767
+ requestBody:
1768
+ required: true
1769
+ content:
1770
+ application/json:
1771
+ schema:
1772
+ $ref: "#/components/schemas/row"
1773
+ examples:
1774
+ row:
1775
+ $ref: "#/components/examples/inputRow"
1776
+ responses:
1777
+ "200":
1778
+ description: Returns the created row, including the ID which has been generated
1779
+ for it. This can be found in the Budibase portal, viewed under the
1780
+ developer information.
1781
+ content:
1782
+ application/json:
1783
+ schema:
1784
+ $ref: "#/components/schemas/rowOutput"
1785
+ examples:
1786
+ row:
1787
+ $ref: "#/components/examples/row"
1788
+ "/tables/{tableId}/rows/{rowId}":
1789
+ put:
1790
+ operationId: rowUpdate
1791
+ summary: Update a row
1792
+ description: Updates a row within the specified table.
1793
+ tags:
1794
+ - rows
1795
+ parameters:
1796
+ - $ref: "#/components/parameters/tableId"
1797
+ - $ref: "#/components/parameters/rowId"
1798
+ - $ref: "#/components/parameters/appId"
1799
+ requestBody:
1800
+ required: true
1801
+ content:
1802
+ application/json:
1803
+ schema:
1804
+ $ref: "#/components/schemas/row"
1805
+ examples:
1806
+ row:
1807
+ $ref: "#/components/examples/inputRow"
1808
+ responses:
1809
+ "200":
1810
+ description: Returns the created row, including the ID which has been generated
1811
+ for it.
1812
+ content:
1813
+ application/json:
1814
+ schema:
1815
+ $ref: "#/components/schemas/rowOutput"
1816
+ examples:
1817
+ row:
1818
+ $ref: "#/components/examples/row"
1819
+ delete:
1820
+ operationId: rowDestroy
1821
+ summary: Delete a row
1822
+ description: Deletes a row within the specified table.
1823
+ tags:
1824
+ - rows
1825
+ parameters:
1826
+ - $ref: "#/components/parameters/tableId"
1827
+ - $ref: "#/components/parameters/rowId"
1828
+ - $ref: "#/components/parameters/appId"
1829
+ responses:
1830
+ "200":
1831
+ description: Returns the deleted row, including the ID which has been generated
1832
+ for it.
1833
+ content:
1834
+ application/json:
1835
+ schema:
1836
+ $ref: "#/components/schemas/rowOutput"
1837
+ examples:
1838
+ row:
1839
+ $ref: "#/components/examples/row"
1840
+ get:
1841
+ operationId: rowGetById
1842
+ summary: Retrieve a row
1843
+ description: This gets a single row, it will be enriched with the full related
1844
+ rows, rather than the squashed "primaryDisplay" format returned by the
1845
+ search endpoint.
1846
+ tags:
1847
+ - rows
1848
+ parameters:
1849
+ - $ref: "#/components/parameters/tableId"
1850
+ - $ref: "#/components/parameters/rowId"
1851
+ - $ref: "#/components/parameters/appId"
1852
+ responses:
1853
+ "200":
1854
+ description: Returns the retrieved row.
1855
+ content:
1856
+ application/json:
1857
+ schema:
1858
+ $ref: "#/components/schemas/rowOutput"
1859
+ examples:
1860
+ enrichedRow:
1861
+ $ref: "#/components/examples/enrichedRow"
1862
+ "/tables/{tableId}/rows/search":
1863
+ post:
1864
+ operationId: rowSearch
1865
+ summary: Search for rows
1866
+ tags:
1867
+ - rows
1868
+ parameters:
1869
+ - $ref: "#/components/parameters/tableId"
1870
+ - $ref: "#/components/parameters/appId"
1871
+ requestBody:
1872
+ required: true
1873
+ content:
1874
+ application/json:
1875
+ schema:
1876
+ $ref: "#/components/schemas/rowSearch"
1877
+ responses:
1878
+ "200":
1879
+ description: The response will contain an array of rows that match the search
1880
+ parameters.
1881
+ content:
1882
+ application/json:
1883
+ schema:
1884
+ $ref: "#/components/schemas/searchOutput"
1885
+ examples:
1886
+ search:
1887
+ $ref: "#/components/examples/rows"
1888
+ /tables:
1889
+ post:
1890
+ operationId: tableCreate
1891
+ summary: Create a table
1892
+ description: Create a table, this could be internal or external.
1893
+ tags:
1894
+ - tables
1895
+ parameters:
1896
+ - $ref: "#/components/parameters/appId"
1897
+ requestBody:
1898
+ content:
1899
+ application/json:
1900
+ schema:
1901
+ $ref: "#/components/schemas/table"
1902
+ examples:
1903
+ table:
1904
+ $ref: "#/components/examples/table"
1905
+ responses:
1906
+ "200":
1907
+ description: Returns the created table, including the ID which has been
1908
+ generated for it. This can be internal or external datasources.
1909
+ content:
1910
+ application/json:
1911
+ schema:
1912
+ $ref: "#/components/schemas/tableOutput"
1913
+ examples:
1914
+ table:
1915
+ $ref: "#/components/examples/table"
1916
+ "/tables/{tableId}":
1917
+ put:
1918
+ operationId: tableUpdate
1919
+ summary: Update a table
1920
+ description: Update a table, this could be internal or external.
1921
+ tags:
1922
+ - tables
1923
+ parameters:
1924
+ - $ref: "#/components/parameters/tableId"
1925
+ - $ref: "#/components/parameters/appId"
1926
+ requestBody:
1927
+ content:
1928
+ application/json:
1929
+ schema:
1930
+ $ref: "#/components/schemas/table"
1931
+ examples:
1932
+ table:
1933
+ $ref: "#/components/examples/table"
1934
+ responses:
1935
+ "200":
1936
+ description: Returns the updated table.
1937
+ content:
1938
+ application/json:
1939
+ schema:
1940
+ $ref: "#/components/schemas/tableOutput"
1941
+ examples:
1942
+ table:
1943
+ $ref: "#/components/examples/table"
1944
+ delete:
1945
+ operationId: tableDestroy
1946
+ summary: Delete a table
1947
+ description: Delete a table, this could be internal or external.
1948
+ tags:
1949
+ - tables
1950
+ parameters:
1951
+ - $ref: "#/components/parameters/tableId"
1952
+ - $ref: "#/components/parameters/appId"
1953
+ responses:
1954
+ "200":
1955
+ description: Returns the deleted table.
1956
+ content:
1957
+ application/json:
1958
+ schema:
1959
+ $ref: "#/components/schemas/tableOutput"
1960
+ examples:
1961
+ table:
1962
+ $ref: "#/components/examples/table"
1963
+ get:
1964
+ operationId: tableGetById
1965
+ summary: Retrieve a table
1966
+ description: Lookup a table, this could be internal or external.
1967
+ tags:
1968
+ - tables
1969
+ parameters:
1970
+ - $ref: "#/components/parameters/tableId"
1971
+ - $ref: "#/components/parameters/appId"
1972
+ responses:
1973
+ "200":
1974
+ description: Returns the retrieved table.
1975
+ content:
1976
+ application/json:
1977
+ schema:
1978
+ $ref: "#/components/schemas/tableOutput"
1979
+ examples:
1980
+ table:
1981
+ $ref: "#/components/examples/table"
1982
+ /tables/search:
1983
+ post:
1984
+ operationId: tableSearch
1985
+ summary: Search for tables
1986
+ description: Based on table properties (currently only name) search for tables.
1987
+ This could be an internal or an external table.
1988
+ tags:
1989
+ - tables
1990
+ parameters:
1991
+ - $ref: "#/components/parameters/appId"
1992
+ requestBody:
1993
+ required: true
1994
+ content:
1995
+ application/json:
1996
+ schema:
1997
+ $ref: "#/components/schemas/nameSearch"
1998
+ responses:
1999
+ "200":
2000
+ description: Returns the found tables, based on the search parameters.
2001
+ content:
2002
+ application/json:
2003
+ schema:
2004
+ $ref: "#/components/schemas/tableSearch"
2005
+ examples:
2006
+ tables:
2007
+ $ref: "#/components/examples/tables"
2008
+ /users:
2009
+ post:
2010
+ operationId: userCreate
2011
+ summary: Create a user
2012
+ tags:
2013
+ - users
2014
+ requestBody:
2015
+ required: true
2016
+ content:
2017
+ application/json:
2018
+ schema:
2019
+ $ref: "#/components/schemas/user"
2020
+ responses:
2021
+ "200":
2022
+ description: Returns the created user.
2023
+ content:
2024
+ application/json:
2025
+ schema:
2026
+ $ref: "#/components/schemas/userOutput"
2027
+ examples:
2028
+ user:
2029
+ $ref: "#/components/examples/user"
2030
+ "/users/{userId}":
2031
+ put:
2032
+ operationId: userUpdate
2033
+ summary: Update a user
2034
+ tags:
2035
+ - users
2036
+ parameters:
2037
+ - $ref: "#/components/parameters/userId"
2038
+ requestBody:
2039
+ required: true
2040
+ content:
2041
+ application/json:
2042
+ schema:
2043
+ $ref: "#/components/schemas/user"
2044
+ responses:
2045
+ "200":
2046
+ description: Returns the updated user.
2047
+ content:
2048
+ application/json:
2049
+ schema:
2050
+ $ref: "#/components/schemas/userOutput"
2051
+ examples:
2052
+ user:
2053
+ $ref: "#/components/examples/user"
2054
+ delete:
2055
+ operationId: userDestroy
2056
+ summary: Delete a user
2057
+ tags:
2058
+ - users
2059
+ parameters:
2060
+ - $ref: "#/components/parameters/userId"
2061
+ responses:
2062
+ "200":
2063
+ description: Returns the deleted user.
2064
+ content:
2065
+ application/json:
2066
+ schema:
2067
+ $ref: "#/components/schemas/userOutput"
2068
+ examples:
2069
+ user:
2070
+ $ref: "#/components/examples/user"
2071
+ get:
2072
+ operationId: userGetById
2073
+ summary: Retrieve a user
2074
+ tags:
2075
+ - users
2076
+ parameters:
2077
+ - $ref: "#/components/parameters/userId"
2078
+ responses:
2079
+ "200":
2080
+ description: Returns the retrieved user.
2081
+ content:
2082
+ application/json:
2083
+ schema:
2084
+ $ref: "#/components/schemas/userOutput"
2085
+ examples:
2086
+ user:
2087
+ $ref: "#/components/examples/user"
2088
+ /users/search:
2089
+ post:
2090
+ operationId: userSearch
2091
+ summary: Search for users
2092
+ description: Based on user properties (currently only name) search for users.
2093
+ tags:
2094
+ - users
2095
+ requestBody:
2096
+ required: true
2097
+ content:
2098
+ application/json:
2099
+ schema:
2100
+ $ref: "#/components/schemas/nameSearch"
2101
+ responses:
2102
+ "200":
2103
+ description: Returns the found users based on search parameters.
2104
+ content:
2105
+ application/json:
2106
+ schema:
2107
+ $ref: "#/components/schemas/userSearch"
2108
+ examples:
2109
+ users:
2110
+ $ref: "#/components/examples/users"
2111
+ tags: []