@budibase/server 1.0.81 → 1.0.82

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 (201) hide show
  1. package/builder/assets/{index.f89561ac.js → index.5d245850.js} +140 -139
  2. package/builder/assets/{index.dd19c61c.css → index.7c8961b4.css} +2 -2
  3. package/builder/index.html +2 -2
  4. package/coverage/clover.xml +10 -5
  5. package/coverage/coverage-final.json +2 -2
  6. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  7. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/application.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
  15. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/index.html +1 -1
  17. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query/index.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  25. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  26. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/external.js.html +5 -5
  28. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
  30. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  39. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  40. package/coverage/lcov-report/api/controllers/table/internal.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/table/utils.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  45. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  46. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  47. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  48. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  49. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  50. package/coverage/lcov-report/api/index.html +1 -1
  51. package/coverage/lcov-report/api/index.js.html +1 -1
  52. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/application.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/index.html +1 -1
  64. package/coverage/lcov-report/api/routes/index.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/row.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  76. package/coverage/lcov-report/api/routes/static.js.html +1 -1
  77. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  78. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  79. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  80. package/coverage/lcov-report/api/routes/utils/index.html +1 -1
  81. package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
  82. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  83. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  84. package/coverage/lcov-report/automations/actions.js.html +1 -1
  85. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  86. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  87. package/coverage/lcov-report/automations/index.html +1 -1
  88. package/coverage/lcov-report/automations/index.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/createRow.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  97. package/coverage/lcov-report/automations/steps/index.html +1 -1
  98. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  99. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  100. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  101. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  102. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  103. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  104. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  105. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  106. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  107. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  108. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  109. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  110. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  111. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  112. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  113. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  114. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  115. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  116. package/coverage/lcov-report/automations/utils.js.html +1 -1
  117. package/coverage/lcov-report/constants/index.html +1 -1
  118. package/coverage/lcov-report/constants/index.js.html +1 -1
  119. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  120. package/coverage/lcov-report/constants/screens.js.html +1 -1
  121. package/coverage/lcov-report/db/client.js.html +1 -1
  122. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  123. package/coverage/lcov-report/db/index.html +1 -1
  124. package/coverage/lcov-report/db/index.js.html +1 -1
  125. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  126. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  127. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  128. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  129. package/coverage/lcov-report/db/newid.js.html +1 -1
  130. package/coverage/lcov-report/db/utils.js.html +1 -1
  131. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  132. package/coverage/lcov-report/events/index.html +1 -1
  133. package/coverage/lcov-report/events/index.js.html +1 -1
  134. package/coverage/lcov-report/events/utils.js.html +1 -1
  135. package/coverage/lcov-report/index.html +18 -18
  136. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  137. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  138. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  139. package/coverage/lcov-report/middleware/authorized.js.html +1 -1
  140. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  141. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  142. package/coverage/lcov-report/middleware/index.html +1 -1
  143. package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
  144. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  145. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  146. package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
  147. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  148. package/coverage/lcov-report/threads/automation.js.html +1 -1
  149. package/coverage/lcov-report/threads/index.html +1 -1
  150. package/coverage/lcov-report/threads/index.js.html +1 -1
  151. package/coverage/lcov-report/threads/query.js.html +1 -1
  152. package/coverage/lcov-report/threads/utils.js.html +1 -1
  153. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  154. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  155. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  156. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  157. package/coverage/lcov-report/utilities/global.js.html +1 -1
  158. package/coverage/lcov-report/utilities/index.html +18 -18
  159. package/coverage/lcov-report/utilities/index.js.html +34 -10
  160. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  161. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  162. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  163. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  164. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  165. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  166. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  167. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  168. package/coverage/lcov-report/utilities/security.js.html +1 -1
  169. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  170. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  171. package/coverage/lcov-report/utilities/usageQuota/index.js.html +1 -1
  172. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  173. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  174. package/coverage/lcov-report/utilities/users.js.html +1 -1
  175. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  176. package/coverage/lcov.info +17 -6
  177. package/dist/api/controllers/public/rows.js +2 -1
  178. package/dist/api/controllers/row/external.js +4 -4
  179. package/dist/api/routes/public/applications.js +1 -8
  180. package/dist/api/routes/public/queries.js +1 -8
  181. package/dist/api/routes/public/tables.js +1 -8
  182. package/dist/api/routes/public/users.js +1 -8
  183. package/dist/package.json +4 -4
  184. package/dist/tsconfig.tsbuildinfo +1 -1
  185. package/dist/utilities/index.js +7 -0
  186. package/package.json +5 -5
  187. package/scripts/docs/toSwagger.js +1 -1
  188. package/specs/openapi.json +429 -48
  189. package/specs/openapi.yaml +337 -32
  190. package/specs/resources/application.js +6 -0
  191. package/specs/resources/query.js +6 -0
  192. package/specs/resources/table.js +6 -0
  193. package/specs/resources/user.js +6 -0
  194. package/src/api/controllers/public/rows.ts +2 -1
  195. package/src/api/controllers/row/external.js +4 -4
  196. package/src/api/routes/public/applications.ts +1 -8
  197. package/src/api/routes/public/queries.ts +1 -8
  198. package/src/api/routes/public/tables.ts +1 -8
  199. package/src/api/routes/public/users.ts +1 -8
  200. package/src/definitions/openapi.ts +194 -12
  201. package/src/utilities/index.js +8 -0
@@ -142,3 +142,10 @@ exports.formatBytes = bytes => {
142
142
  }
143
143
  return `${size.toFixed(size < 10 && unit > 0 ? 1 : 0)}${units[unit]}`;
144
144
  };
145
+ exports.convertBookmark = bookmark => {
146
+ const IS_NUMBER = /^\d+\.?\d*$/;
147
+ if (typeof bookmark === "string" && bookmark.match(IS_NUMBER)) {
148
+ return parseFloat(bookmark);
149
+ }
150
+ return bookmark;
151
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "1.0.81",
4
+ "version": "1.0.82",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -71,9 +71,9 @@
71
71
  "license": "GPL-3.0",
72
72
  "dependencies": {
73
73
  "@apidevtools/swagger-parser": "^10.0.3",
74
- "@budibase/backend-core": "^1.0.81",
75
- "@budibase/client": "^1.0.81",
76
- "@budibase/string-templates": "^1.0.81",
74
+ "@budibase/backend-core": "^1.0.82",
75
+ "@budibase/client": "^1.0.82",
76
+ "@budibase/string-templates": "^1.0.82",
77
77
  "@bull-board/api": "^3.7.0",
78
78
  "@bull-board/koa": "^3.7.0",
79
79
  "@elastic/elasticsearch": "7.10.0",
@@ -175,5 +175,5 @@
175
175
  "optionalDependencies": {
176
176
  "oracledb": "^5.3.0"
177
177
  },
178
- "gitHead": "60fae11087000f6e76be33e7b469776d323a871d"
178
+ "gitHead": "66b565b0712acc5a3df988b8e0108a90f0d094c8"
179
179
  }
@@ -51,7 +51,7 @@ function extractPaths(apidocJson) {
51
51
  // Surrounds URL parameters with curly brackets -> :email with {email}
52
52
  let pathKeys = []
53
53
  for (let j = 1; j < matches.length; j++) {
54
- let key = matches[j].substr(1)
54
+ let key = matches[j].slice(1)
55
55
  url = url.replace(matches[j], "{" + key + "}")
56
56
  pathKeys.push(key)
57
57
  }
@@ -503,6 +503,71 @@
503
503
  "data"
504
504
  ]
505
505
  },
506
+ "applicationSearch": {
507
+ "type": "object",
508
+ "properties": {
509
+ "data": {
510
+ "type": "array",
511
+ "items": {
512
+ "type": "object",
513
+ "properties": {
514
+ "name": {
515
+ "description": "The name of the app.",
516
+ "type": "string"
517
+ },
518
+ "url": {
519
+ "description": "The URL by which the app is accessed, this must be URL encoded.",
520
+ "type": "string"
521
+ },
522
+ "_id": {
523
+ "description": "The ID of the app.",
524
+ "type": "string"
525
+ },
526
+ "status": {
527
+ "description": "The status of the app, stating it if is the development or published version.",
528
+ "type": "string",
529
+ "enum": [
530
+ "development",
531
+ "published"
532
+ ]
533
+ },
534
+ "createdAt": {
535
+ "description": "States when the app was created, will be constant. Stored in ISO format.",
536
+ "type": "string"
537
+ },
538
+ "updatedAt": {
539
+ "description": "States the last time the app was updated - stored in ISO format.",
540
+ "type": "string"
541
+ },
542
+ "version": {
543
+ "description": "States the version of the Budibase client this app is currently based on.",
544
+ "type": "string"
545
+ },
546
+ "tenantId": {
547
+ "description": "In a multi-tenant environment this will state the tenant this app is within.",
548
+ "type": "string"
549
+ },
550
+ "lockedBy": {
551
+ "description": "The user this app is currently being built by.",
552
+ "type": "object"
553
+ }
554
+ },
555
+ "required": [
556
+ "_id",
557
+ "name",
558
+ "url",
559
+ "status",
560
+ "createdAt",
561
+ "updatedAt",
562
+ "version"
563
+ ]
564
+ }
565
+ }
566
+ },
567
+ "required": [
568
+ "data"
569
+ ]
570
+ },
506
571
  "row": {
507
572
  "description": "The row to be created/updated, based on the table schema.",
508
573
  "type": "object",
@@ -980,6 +1045,221 @@
980
1045
  "data"
981
1046
  ]
982
1047
  },
1048
+ "tableSearch": {
1049
+ "type": "object",
1050
+ "properties": {
1051
+ "data": {
1052
+ "type": "array",
1053
+ "items": {
1054
+ "description": "The table to be created/updated.",
1055
+ "type": "object",
1056
+ "required": [
1057
+ "name",
1058
+ "schema",
1059
+ "_id"
1060
+ ],
1061
+ "properties": {
1062
+ "name": {
1063
+ "description": "The name of the table.",
1064
+ "type": "string"
1065
+ },
1066
+ "primaryDisplay": {
1067
+ "type": "string",
1068
+ "description": "The name of the column which should be used in relationship tags when relating to this table."
1069
+ },
1070
+ "schema": {
1071
+ "type": "object",
1072
+ "additionalProperties": {
1073
+ "oneOf": [
1074
+ {
1075
+ "type": "object",
1076
+ "properties": {
1077
+ "type": {
1078
+ "type": "string",
1079
+ "enum": [
1080
+ "link"
1081
+ ],
1082
+ "description": "A relationship column."
1083
+ },
1084
+ "constraints": {
1085
+ "type": "object",
1086
+ "description": "A constraint can be applied to the column which will be validated against when a row is saved.",
1087
+ "properties": {
1088
+ "type": {
1089
+ "type": "string",
1090
+ "enum": [
1091
+ "string",
1092
+ "number",
1093
+ "object",
1094
+ "boolean"
1095
+ ]
1096
+ },
1097
+ "presence": {
1098
+ "type": "boolean",
1099
+ "description": "Defines whether the column is required or not."
1100
+ }
1101
+ }
1102
+ },
1103
+ "name": {
1104
+ "type": "string",
1105
+ "description": "The name of the column."
1106
+ },
1107
+ "autocolumn": {
1108
+ "type": "boolean",
1109
+ "description": "Defines whether the column is automatically generated."
1110
+ },
1111
+ "fieldName": {
1112
+ "type": "string",
1113
+ "description": "The name of the column which a relationship column is related to in another table."
1114
+ },
1115
+ "tableId": {
1116
+ "type": "string",
1117
+ "description": "The ID of the table which a relationship column is related to."
1118
+ },
1119
+ "relationshipType": {
1120
+ "type": "string",
1121
+ "enum": [
1122
+ "one-to-many",
1123
+ "many-to-one",
1124
+ "many-to-many"
1125
+ ],
1126
+ "description": "Defines the type of relationship that this column will be used for."
1127
+ },
1128
+ "through": {
1129
+ "type": "string",
1130
+ "description": "When using a SQL table that contains many to many relationships this defines the table the relationships are linked through."
1131
+ },
1132
+ "foreignKey": {
1133
+ "type": "string",
1134
+ "description": "When using a SQL table that contains a one to many relationship this defines the foreign key."
1135
+ },
1136
+ "throughFrom": {
1137
+ "type": "string",
1138
+ "description": "When using a SQL table that utilises a through table, this defines the primary key in the through table for this table."
1139
+ },
1140
+ "throughTo": {
1141
+ "type": "string",
1142
+ "description": "When using a SQL table that utilises a through table, this defines the primary key in the through table for the related table."
1143
+ }
1144
+ }
1145
+ },
1146
+ {
1147
+ "type": "object",
1148
+ "properties": {
1149
+ "type": {
1150
+ "type": "string",
1151
+ "enum": [
1152
+ "formula"
1153
+ ],
1154
+ "description": "A formula column."
1155
+ },
1156
+ "constraints": {
1157
+ "type": "object",
1158
+ "description": "A constraint can be applied to the column which will be validated against when a row is saved.",
1159
+ "properties": {
1160
+ "type": {
1161
+ "type": "string",
1162
+ "enum": [
1163
+ "string",
1164
+ "number",
1165
+ "object",
1166
+ "boolean"
1167
+ ]
1168
+ },
1169
+ "presence": {
1170
+ "type": "boolean",
1171
+ "description": "Defines whether the column is required or not."
1172
+ }
1173
+ }
1174
+ },
1175
+ "name": {
1176
+ "type": "string",
1177
+ "description": "The name of the column."
1178
+ },
1179
+ "autocolumn": {
1180
+ "type": "boolean",
1181
+ "description": "Defines whether the column is automatically generated."
1182
+ },
1183
+ "formula": {
1184
+ "type": "string",
1185
+ "description": "Defines a Handlebars or JavaScript formula to use, note that Javascript formulas are expected to be provided in the base64 format."
1186
+ },
1187
+ "formulaType": {
1188
+ "type": "string",
1189
+ "enum": [
1190
+ "static",
1191
+ "dynamic"
1192
+ ],
1193
+ "description": "Defines whether this is a static or dynamic formula."
1194
+ }
1195
+ }
1196
+ },
1197
+ {
1198
+ "type": "object",
1199
+ "properties": {
1200
+ "type": {
1201
+ "type": "string",
1202
+ "enum": [
1203
+ "string",
1204
+ "longform",
1205
+ "options",
1206
+ "number",
1207
+ "boolean",
1208
+ "array",
1209
+ "datetime",
1210
+ "attachment",
1211
+ "link",
1212
+ "formula",
1213
+ "auto",
1214
+ "json",
1215
+ "internal"
1216
+ ],
1217
+ "description": "Defines the type of the column, most explain themselves, a link column is a relationship."
1218
+ },
1219
+ "constraints": {
1220
+ "type": "object",
1221
+ "description": "A constraint can be applied to the column which will be validated against when a row is saved.",
1222
+ "properties": {
1223
+ "type": {
1224
+ "type": "string",
1225
+ "enum": [
1226
+ "string",
1227
+ "number",
1228
+ "object",
1229
+ "boolean"
1230
+ ]
1231
+ },
1232
+ "presence": {
1233
+ "type": "boolean",
1234
+ "description": "Defines whether the column is required or not."
1235
+ }
1236
+ }
1237
+ },
1238
+ "name": {
1239
+ "type": "string",
1240
+ "description": "The name of the column."
1241
+ },
1242
+ "autocolumn": {
1243
+ "type": "boolean",
1244
+ "description": "Defines whether the column is automatically generated."
1245
+ }
1246
+ }
1247
+ }
1248
+ ]
1249
+ }
1250
+ },
1251
+ "_id": {
1252
+ "description": "The ID of the table.",
1253
+ "type": "string"
1254
+ }
1255
+ }
1256
+ }
1257
+ }
1258
+ },
1259
+ "required": [
1260
+ "data"
1261
+ ]
1262
+ },
983
1263
  "executeQuery": {
984
1264
  "description": "The query body must contain the required parameters for the query, this depends on query type, setup and bindings.",
985
1265
  "type": "object",
@@ -1074,6 +1354,71 @@
1074
1354
  "_id"
1075
1355
  ]
1076
1356
  },
1357
+ "querySearch": {
1358
+ "type": "object",
1359
+ "properties": {
1360
+ "data": {
1361
+ "type": "array",
1362
+ "items": {
1363
+ "type": "object",
1364
+ "properties": {
1365
+ "_id": {
1366
+ "description": "The ID of the query.",
1367
+ "type": "string"
1368
+ },
1369
+ "datasourceId": {
1370
+ "description": "The ID of the data source the query belongs to.",
1371
+ "type": "string"
1372
+ },
1373
+ "parameters": {
1374
+ "description": "The bindings which are required to perform this query.",
1375
+ "type": "array",
1376
+ "items": {
1377
+ "type": "string"
1378
+ }
1379
+ },
1380
+ "fields": {
1381
+ "description": "The fields that are used to perform this query, e.g. the sql statement",
1382
+ "type": "object"
1383
+ },
1384
+ "queryVerb": {
1385
+ "description": "The verb that describes this query.",
1386
+ "enum": [
1387
+ "create",
1388
+ "read",
1389
+ "update",
1390
+ "delete"
1391
+ ]
1392
+ },
1393
+ "name": {
1394
+ "description": "The name of the query.",
1395
+ "type": "string"
1396
+ },
1397
+ "schema": {
1398
+ "description": "The schema of the data returned when the query is executed.",
1399
+ "type": "object"
1400
+ },
1401
+ "transformer": {
1402
+ "description": "The JavaScript transformer function, applied after the query responds with data.",
1403
+ "type": "string"
1404
+ },
1405
+ "readable": {
1406
+ "description": "Whether the query has readable data.",
1407
+ "type": "boolean"
1408
+ }
1409
+ },
1410
+ "required": [
1411
+ "name",
1412
+ "schema",
1413
+ "_id"
1414
+ ]
1415
+ }
1416
+ }
1417
+ },
1418
+ "required": [
1419
+ "data"
1420
+ ]
1421
+ },
1077
1422
  "user": {
1078
1423
  "type": "object",
1079
1424
  "properties": {
@@ -1215,6 +1560,86 @@
1215
1560
  "data"
1216
1561
  ]
1217
1562
  },
1563
+ "userSearch": {
1564
+ "type": "object",
1565
+ "properties": {
1566
+ "data": {
1567
+ "type": "array",
1568
+ "items": {
1569
+ "type": "object",
1570
+ "properties": {
1571
+ "email": {
1572
+ "description": "The email address of the user, this must be unique.",
1573
+ "type": "string"
1574
+ },
1575
+ "password": {
1576
+ "description": "The password of the user if using password based login - this will never be returned. This can be left out of subsequent requests (updates) and will be enriched back into the user structure.",
1577
+ "type": "string"
1578
+ },
1579
+ "status": {
1580
+ "description": "The status of the user, if they are active.",
1581
+ "type": "string",
1582
+ "enum": [
1583
+ "active"
1584
+ ]
1585
+ },
1586
+ "firstName": {
1587
+ "description": "The first name of the user",
1588
+ "type": "string"
1589
+ },
1590
+ "lastName": {
1591
+ "description": "The last name of the user",
1592
+ "type": "string"
1593
+ },
1594
+ "forceResetPassword": {
1595
+ "description": "If set to true forces the user to reset their password on first login.",
1596
+ "type": "boolean"
1597
+ },
1598
+ "builder": {
1599
+ "description": "Describes if the user is a builder user or not.",
1600
+ "type": "object",
1601
+ "properties": {
1602
+ "global": {
1603
+ "description": "If set to true the user will be able to build any app in the system.",
1604
+ "type": "boolean"
1605
+ }
1606
+ }
1607
+ },
1608
+ "admin": {
1609
+ "description": "Describes if the user is an admin user or not.",
1610
+ "type": "object",
1611
+ "properties": {
1612
+ "global": {
1613
+ "description": "If set to true the user will be able to administrate the system.",
1614
+ "type": "boolean"
1615
+ }
1616
+ }
1617
+ },
1618
+ "roles": {
1619
+ "description": "Contains the roles of the user per app (assuming they are not a builder user).",
1620
+ "type": "object",
1621
+ "additionalProperties": {
1622
+ "type": "string",
1623
+ "description": "A map of app ID (production app ID, minus the _dev component) to a role ID, e.g. ADMIN."
1624
+ }
1625
+ },
1626
+ "_id": {
1627
+ "description": "The ID of the user.",
1628
+ "type": "string"
1629
+ }
1630
+ },
1631
+ "required": [
1632
+ "email",
1633
+ "roles",
1634
+ "_id"
1635
+ ]
1636
+ }
1637
+ }
1638
+ },
1639
+ "required": [
1640
+ "data"
1641
+ ]
1642
+ },
1218
1643
  "nameSearch": {
1219
1644
  "type": "object",
1220
1645
  "properties": {
@@ -1399,18 +1824,7 @@
1399
1824
  "content": {
1400
1825
  "application/json": {
1401
1826
  "schema": {
1402
- "type": "object",
1403
- "required": [
1404
- "data"
1405
- ],
1406
- "properties": {
1407
- "data": {
1408
- "type": "array",
1409
- "items": {
1410
- "$ref": "#/components/schemas/application"
1411
- }
1412
- }
1413
- }
1827
+ "$ref": "#/components/schemas/applicationSearch"
1414
1828
  },
1415
1829
  "examples": {
1416
1830
  "applications": {
@@ -1498,18 +1912,7 @@
1498
1912
  "content": {
1499
1913
  "application/json": {
1500
1914
  "schema": {
1501
- "type": "object",
1502
- "required": [
1503
- "data"
1504
- ],
1505
- "properties": {
1506
- "data": {
1507
- "type": "array",
1508
- "items": {
1509
- "$ref": "#/components/schemas/query"
1510
- }
1511
- }
1512
- }
1915
+ "$ref": "#/components/schemas/querySearch"
1513
1916
  },
1514
1917
  "examples": {
1515
1918
  "queries": {
@@ -2025,18 +2428,7 @@
2025
2428
  "content": {
2026
2429
  "application/json": {
2027
2430
  "schema": {
2028
- "type": "object",
2029
- "required": [
2030
- "data"
2031
- ],
2032
- "properties": {
2033
- "data": {
2034
- "type": "array",
2035
- "items": {
2036
- "$ref": "#/components/schemas/table"
2037
- }
2038
- }
2039
- }
2431
+ "$ref": "#/components/schemas/tableSearch"
2040
2432
  },
2041
2433
  "examples": {
2042
2434
  "tables": {
@@ -2203,18 +2595,7 @@
2203
2595
  "content": {
2204
2596
  "application/json": {
2205
2597
  "schema": {
2206
- "type": "object",
2207
- "required": [
2208
- "data"
2209
- ],
2210
- "properties": {
2211
- "data": {
2212
- "type": "array",
2213
- "items": {
2214
- "$ref": "#/components/schemas/user"
2215
- }
2216
- }
2217
- }
2598
+ "$ref": "#/components/schemas/userSearch"
2218
2599
  },
2219
2600
  "examples": {
2220
2601
  "users": {