@budibase/server 1.2.37 → 1.2.38

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 (268) hide show
  1. package/builder/assets/{index.3ce7fa08.js → index.47bfb9a6.js} +1 -1
  2. package/builder/index.html +1 -1
  3. package/coverage/clover.xml +2 -2
  4. package/coverage/coverage-final.json +13 -13
  5. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  6. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  7. package/coverage/lcov-report/api/controllers/automation.js.html +3 -3
  8. package/coverage/lcov-report/api/controllers/backup.js.html +3 -3
  9. package/coverage/lcov-report/api/controllers/cloud.js.html +4 -4
  10. package/coverage/lcov-report/api/controllers/component.js.html +3 -3
  11. package/coverage/lcov-report/api/controllers/datasource.js.html +3 -3
  12. package/coverage/lcov-report/api/controllers/dev.js.html +4 -4
  13. package/coverage/lcov-report/api/controllers/index.html +1 -1
  14. package/coverage/lcov-report/api/controllers/integration.js.html +3 -3
  15. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  17. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  20. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  23. package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  25. package/coverage/lcov-report/api/controllers/row/internal.js.html +3 -3
  26. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  30. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  34. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  37. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  39. package/coverage/lcov-report/api/controllers/view/index.js.html +3 -3
  40. package/coverage/lcov-report/api/controllers/view/utils.js.html +5 -5
  41. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  43. package/coverage/lcov-report/api/index.html +1 -1
  44. package/coverage/lcov-report/api/index.js.html +1 -1
  45. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  46. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  47. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  48. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  49. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  50. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  51. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  52. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/index.html +1 -1
  56. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/utils/index.html +1 -1
  70. package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  73. package/coverage/lcov-report/automations/actions.js.html +1 -1
  74. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  75. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  76. package/coverage/lcov-report/automations/index.html +1 -1
  77. package/coverage/lcov-report/automations/index.js.html +1 -1
  78. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  79. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  80. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  81. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  82. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  83. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  84. package/coverage/lcov-report/automations/steps/index.html +1 -1
  85. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  86. package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
  87. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  88. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  95. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  96. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  97. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  98. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  99. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  100. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  101. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  102. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  103. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  104. package/coverage/lcov-report/constants/index.html +1 -1
  105. package/coverage/lcov-report/constants/index.js.html +1 -1
  106. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  107. package/coverage/lcov-report/constants/screens.js.html +1 -1
  108. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  109. package/coverage/lcov-report/db/index.html +1 -1
  110. package/coverage/lcov-report/db/index.js.html +1 -1
  111. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  112. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  113. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  114. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +3 -3
  115. package/coverage/lcov-report/db/newid.js.html +1 -1
  116. package/coverage/lcov-report/db/utils.js.html +39 -39
  117. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  118. package/coverage/lcov-report/events/index.html +1 -1
  119. package/coverage/lcov-report/events/index.js.html +1 -1
  120. package/coverage/lcov-report/events/utils.js.html +1 -1
  121. package/coverage/lcov-report/index.html +1 -1
  122. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  123. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  124. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  125. package/coverage/lcov-report/middleware/builder.js.html +3 -3
  126. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  127. package/coverage/lcov-report/middleware/index.html +1 -1
  128. package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
  129. package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
  130. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  131. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  132. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  133. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  134. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  135. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  136. package/coverage/lcov-report/utilities/global.js.html +1 -1
  137. package/coverage/lcov-report/utilities/index.html +1 -1
  138. package/coverage/lcov-report/utilities/index.js.html +1 -1
  139. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  140. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  141. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  142. package/coverage/lcov-report/utilities/routing/index.js.html +3 -3
  143. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  144. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  145. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  146. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  147. package/coverage/lcov-report/utilities/security.js.html +9 -9
  148. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  149. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  150. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  151. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  152. package/coverage/lcov-report/utilities/users.js.html +1 -1
  153. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  154. package/dist/api/controllers/analytics.js +1 -1
  155. package/dist/api/controllers/application.js +8 -8
  156. package/dist/api/controllers/automation.js +2 -2
  157. package/dist/api/controllers/backup.js +2 -2
  158. package/dist/api/controllers/cloud.js +3 -3
  159. package/dist/api/controllers/component.js +2 -2
  160. package/dist/api/controllers/datasource.js +2 -2
  161. package/dist/api/controllers/deploy/index.js +6 -6
  162. package/dist/api/controllers/dev.js +3 -3
  163. package/dist/api/controllers/integration.js +2 -2
  164. package/dist/api/controllers/public/utils.js +1 -1
  165. package/dist/api/controllers/row/ExternalRequest.js +3 -3
  166. package/dist/api/controllers/row/internal.js +2 -2
  167. package/dist/api/controllers/static/index.js +2 -2
  168. package/dist/api/controllers/view/index.js +2 -2
  169. package/dist/api/controllers/view/utils.js +3 -3
  170. package/dist/db/linkedRows/linkUtils.js +2 -2
  171. package/dist/db/utils.js +37 -37
  172. package/dist/db/views/staticViews.js +4 -4
  173. package/dist/definitions/automations.js +6 -6
  174. package/dist/definitions/datasource.js +6 -70
  175. package/dist/integrations/airtable.js +13 -13
  176. package/dist/integrations/arangodb.js +8 -8
  177. package/dist/integrations/base/sql.js +28 -28
  178. package/dist/integrations/base/sqlTable.js +4 -4
  179. package/dist/integrations/couchdb.js +8 -8
  180. package/dist/integrations/dynamodb.js +21 -21
  181. package/dist/integrations/elasticsearch.js +12 -12
  182. package/dist/integrations/firebase.js +12 -12
  183. package/dist/integrations/googlesheets.js +14 -14
  184. package/dist/integrations/index.js +34 -34
  185. package/dist/integrations/microsoftSqlServer.js +14 -14
  186. package/dist/integrations/mongodb.js +9 -9
  187. package/dist/integrations/mysql.js +13 -13
  188. package/dist/integrations/oracle.js +13 -13
  189. package/dist/integrations/postgres.js +15 -15
  190. package/dist/integrations/redis.js +10 -10
  191. package/dist/integrations/rest.js +15 -14
  192. package/dist/integrations/s3.js +2 -2
  193. package/dist/integrations/snowflake.js +5 -5
  194. package/dist/integrations/utils.js +14 -14
  195. package/dist/middleware/builder.js +2 -2
  196. package/dist/migrations/functions/appUrls.js +2 -2
  197. package/dist/migrations/functions/backfill/app/queries.js +3 -1
  198. package/dist/migrations/functions/backfill/app.js +1 -1
  199. package/dist/migrations/functions/backfill/global/users.js +1 -1
  200. package/dist/package.json +6 -6
  201. package/dist/tests/utilities/TestConfiguration.js +2 -2
  202. package/dist/threads/automation.js +2 -2
  203. package/dist/tsconfig.build.tsbuildinfo +1 -1
  204. package/dist/utilities/routing/index.js +2 -2
  205. package/dist/utilities/security.js +8 -8
  206. package/package.json +7 -7
  207. package/src/api/controllers/analytics.ts +2 -2
  208. package/src/api/controllers/application.ts +9 -9
  209. package/src/api/controllers/automation.js +2 -2
  210. package/src/api/controllers/backup.js +2 -2
  211. package/src/api/controllers/cloud.js +3 -3
  212. package/src/api/controllers/component.js +2 -2
  213. package/src/api/controllers/datasource.js +2 -2
  214. package/src/api/controllers/deploy/index.ts +7 -7
  215. package/src/api/controllers/dev.js +3 -3
  216. package/src/api/controllers/integration.js +2 -2
  217. package/src/api/controllers/public/utils.ts +2 -2
  218. package/src/api/controllers/query/import/sources/openapi2.ts +1 -1
  219. package/src/api/controllers/query/import/sources/openapi3.ts +1 -1
  220. package/src/api/controllers/row/ExternalRequest.ts +5 -7
  221. package/src/api/controllers/row/internal.js +2 -2
  222. package/src/api/controllers/static/index.ts +2 -2
  223. package/src/api/controllers/view/index.js +2 -2
  224. package/src/api/controllers/view/utils.js +4 -4
  225. package/src/db/linkedRows/linkUtils.js +2 -2
  226. package/src/db/utils.js +38 -38
  227. package/src/db/views/staticViews.js +4 -9
  228. package/src/definitions/automations.ts +2 -2
  229. package/src/definitions/common.ts +14 -65
  230. package/src/definitions/datasource.ts +5 -250
  231. package/src/integrations/airtable.ts +16 -16
  232. package/src/integrations/arangodb.ts +11 -11
  233. package/src/integrations/base/sql.ts +16 -16
  234. package/src/integrations/base/sqlTable.ts +1 -6
  235. package/src/integrations/base/utils.ts +1 -2
  236. package/src/integrations/couchdb.ts +11 -11
  237. package/src/integrations/dynamodb.ts +24 -24
  238. package/src/integrations/elasticsearch.ts +15 -15
  239. package/src/integrations/firebase.ts +15 -15
  240. package/src/integrations/googlesheets.ts +19 -18
  241. package/src/integrations/index.ts +34 -34
  242. package/src/integrations/microsoftSqlServer.ts +19 -18
  243. package/src/integrations/mongodb.ts +12 -12
  244. package/src/integrations/mysql.ts +19 -18
  245. package/src/integrations/oracle.ts +16 -16
  246. package/src/integrations/postgres.ts +20 -20
  247. package/src/integrations/queries/sql.ts +1 -2
  248. package/src/integrations/redis.ts +10 -14
  249. package/src/integrations/rest.ts +22 -20
  250. package/src/integrations/s3.ts +2 -3
  251. package/src/integrations/snowflake.ts +5 -5
  252. package/src/integrations/tests/sql.spec.js +7 -7
  253. package/src/integrations/utils.ts +8 -9
  254. package/src/middleware/builder.js +2 -2
  255. package/src/migrations/functions/appUrls.ts +2 -2
  256. package/src/migrations/functions/backfill/app/queries.ts +3 -2
  257. package/src/migrations/functions/backfill/app.ts +1 -1
  258. package/src/migrations/functions/backfill/global/users.ts +1 -1
  259. package/src/migrations/functions/tests/appUrls.spec.js +3 -3
  260. package/src/migrations/tests/index.spec.ts +2 -2
  261. package/src/tests/utilities/TestConfiguration.js +2 -2
  262. package/src/threads/automation.ts +3 -3
  263. package/src/utilities/routing/index.js +2 -2
  264. package/src/utilities/security.js +8 -8
  265. package/dist/integrations/base/IntegrationBase.js +0 -2
  266. package/dist/integrations/base/datasourcePlus.js +0 -2
  267. package/src/integrations/base/IntegrationBase.ts +0 -6
  268. package/src/integrations/base/datasourcePlus.ts +0 -13
@@ -1,12 +1,13 @@
1
1
  import {
2
- DatasourceFieldTypes,
2
+ DatasourceFieldType,
3
3
  Integration,
4
+ QueryType,
5
+ Table,
6
+ TableSchema,
4
7
  QueryJson,
5
- QueryTypes,
6
- } from "../definitions/datasource"
8
+ DatasourcePlus,
9
+ } from "@budibase/types"
7
10
  import { OAuth2Client } from "google-auth-library"
8
- import { DatasourcePlus } from "./base/datasourcePlus"
9
- import { Table, TableSchema } from "../definitions/common"
10
11
  import { buildExternalTableId } from "./utils"
11
12
  import { DataSourceOperation, FieldTypes } from "../constants"
12
13
  import { GoogleSpreadsheet } from "google-spreadsheet"
@@ -53,59 +54,59 @@ module GoogleSheetsModule {
53
54
  datasource: {
54
55
  spreadsheetId: {
55
56
  display: "Google Sheet URL",
56
- type: DatasourceFieldTypes.STRING,
57
+ type: DatasourceFieldType.STRING,
57
58
  required: true,
58
59
  },
59
60
  },
60
61
  query: {
61
62
  create: {
62
- type: QueryTypes.FIELDS,
63
+ type: QueryType.FIELDS,
63
64
  fields: {
64
65
  sheet: {
65
- type: DatasourceFieldTypes.STRING,
66
+ type: DatasourceFieldType.STRING,
66
67
  required: true,
67
68
  },
68
69
  row: {
69
- type: QueryTypes.JSON,
70
+ type: QueryType.JSON,
70
71
  required: true,
71
72
  },
72
73
  },
73
74
  },
74
75
  read: {
75
- type: QueryTypes.FIELDS,
76
+ type: QueryType.FIELDS,
76
77
  fields: {
77
78
  sheet: {
78
- type: DatasourceFieldTypes.STRING,
79
+ type: DatasourceFieldType.STRING,
79
80
  required: true,
80
81
  },
81
82
  },
82
83
  },
83
84
  update: {
84
- type: QueryTypes.FIELDS,
85
+ type: QueryType.FIELDS,
85
86
  fields: {
86
87
  sheet: {
87
- type: DatasourceFieldTypes.STRING,
88
+ type: DatasourceFieldType.STRING,
88
89
  required: true,
89
90
  },
90
91
  rowIndex: {
91
- type: DatasourceFieldTypes.STRING,
92
+ type: DatasourceFieldType.STRING,
92
93
  required: true,
93
94
  },
94
95
  row: {
95
- type: QueryTypes.JSON,
96
+ type: QueryType.JSON,
96
97
  required: true,
97
98
  },
98
99
  },
99
100
  },
100
101
  delete: {
101
- type: QueryTypes.FIELDS,
102
+ type: QueryType.FIELDS,
102
103
  fields: {
103
104
  sheet: {
104
- type: DatasourceFieldTypes.STRING,
105
+ type: DatasourceFieldType.STRING,
105
106
  required: true,
106
107
  },
107
108
  rowIndex: {
108
- type: DatasourceFieldTypes.NUMBER,
109
+ type: DatasourceFieldType.NUMBER,
109
110
  required: true,
110
111
  },
111
112
  },
@@ -13,54 +13,54 @@ const googlesheets = require("./googlesheets")
13
13
  const firebase = require("./firebase")
14
14
  const redis = require("./redis")
15
15
  const snowflake = require("./snowflake")
16
- const { SourceNames } = require("../definitions/datasource")
16
+ const { SourceName } = require("@budibase/types")
17
17
  const environment = require("../environment")
18
18
 
19
19
  const DEFINITIONS = {
20
- [SourceNames.POSTGRES]: postgres.schema,
21
- [SourceNames.DYNAMODB]: dynamodb.schema,
22
- [SourceNames.MONGODB]: mongodb.schema,
23
- [SourceNames.ELASTICSEARCH]: elasticsearch.schema,
24
- [SourceNames.COUCHDB]: couchdb.schema,
25
- [SourceNames.SQL_SERVER]: sqlServer.schema,
26
- [SourceNames.S3]: s3.schema,
27
- [SourceNames.AIRTABLE]: airtable.schema,
28
- [SourceNames.MYSQL]: mysql.schema,
29
- [SourceNames.ARANGODB]: arangodb.schema,
30
- [SourceNames.REST]: rest.schema,
31
- [SourceNames.FIRESTORE]: firebase.schema,
32
- [SourceNames.REDIS]: redis.schema,
33
- [SourceNames.SNOWFLAKE]: snowflake.schema,
20
+ [SourceName.POSTGRES]: postgres.schema,
21
+ [SourceName.DYNAMODB]: dynamodb.schema,
22
+ [SourceName.MONGODB]: mongodb.schema,
23
+ [SourceName.ELASTICSEARCH]: elasticsearch.schema,
24
+ [SourceName.COUCHDB]: couchdb.schema,
25
+ [SourceName.SQL_SERVER]: sqlServer.schema,
26
+ [SourceName.S3]: s3.schema,
27
+ [SourceName.AIRTABLE]: airtable.schema,
28
+ [SourceName.MYSQL]: mysql.schema,
29
+ [SourceName.ARANGODB]: arangodb.schema,
30
+ [SourceName.REST]: rest.schema,
31
+ [SourceName.FIRESTORE]: firebase.schema,
32
+ [SourceName.REDIS]: redis.schema,
33
+ [SourceName.SNOWFLAKE]: snowflake.schema,
34
34
  }
35
35
 
36
36
  const INTEGRATIONS = {
37
- [SourceNames.POSTGRES]: postgres.integration,
38
- [SourceNames.DYNAMODB]: dynamodb.integration,
39
- [SourceNames.MONGODB]: mongodb.integration,
40
- [SourceNames.ELASTICSEARCH]: elasticsearch.integration,
41
- [SourceNames.COUCHDB]: couchdb.integration,
42
- [SourceNames.SQL_SERVER]: sqlServer.integration,
43
- [SourceNames.S3]: s3.integration,
44
- [SourceNames.AIRTABLE]: airtable.integration,
45
- [SourceNames.MYSQL]: mysql.integration,
46
- [SourceNames.ARANGODB]: arangodb.integration,
47
- [SourceNames.REST]: rest.integration,
48
- [SourceNames.FIRESTORE]: firebase.integration,
49
- [SourceNames.GOOGLE_SHEETS]: googlesheets.integration,
50
- [SourceNames.REDIS]: redis.integration,
51
- [SourceNames.FIREBASE]: firebase.integration,
52
- [SourceNames.SNOWFLAKE]: snowflake.integration,
37
+ [SourceName.POSTGRES]: postgres.integration,
38
+ [SourceName.DYNAMODB]: dynamodb.integration,
39
+ [SourceName.MONGODB]: mongodb.integration,
40
+ [SourceName.ELASTICSEARCH]: elasticsearch.integration,
41
+ [SourceName.COUCHDB]: couchdb.integration,
42
+ [SourceName.SQL_SERVER]: sqlServer.integration,
43
+ [SourceName.S3]: s3.integration,
44
+ [SourceName.AIRTABLE]: airtable.integration,
45
+ [SourceName.MYSQL]: mysql.integration,
46
+ [SourceName.ARANGODB]: arangodb.integration,
47
+ [SourceName.REST]: rest.integration,
48
+ [SourceName.FIRESTORE]: firebase.integration,
49
+ [SourceName.GOOGLE_SHEETS]: googlesheets.integration,
50
+ [SourceName.REDIS]: redis.integration,
51
+ [SourceName.FIREBASE]: firebase.integration,
52
+ [SourceName.SNOWFLAKE]: snowflake.integration,
53
53
  }
54
54
 
55
55
  // optionally add oracle integration if the oracle binary can be installed
56
56
  if (process.arch && !process.arch.startsWith("arm")) {
57
57
  const oracle = require("./oracle")
58
- DEFINITIONS[SourceNames.ORACLE] = oracle.schema
59
- INTEGRATIONS[SourceNames.ORACLE] = oracle.integration
58
+ DEFINITIONS[SourceName.ORACLE] = oracle.schema
59
+ INTEGRATIONS[SourceName.ORACLE] = oracle.integration
60
60
  }
61
61
 
62
62
  if (environment.SELF_HOSTED) {
63
- DEFINITIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.schema
63
+ DEFINITIONS[SourceName.GOOGLE_SHEETS] = googlesheets.schema
64
64
  }
65
65
 
66
66
  module.exports = {
@@ -1,20 +1,21 @@
1
1
  import {
2
- DatasourceFieldTypes,
2
+ DatasourceFieldType,
3
3
  Integration,
4
4
  Operation,
5
+ Table,
6
+ TableSchema,
5
7
  QueryJson,
6
- QueryTypes,
8
+ QueryType,
7
9
  SqlQuery,
8
- } from "../definitions/datasource"
10
+ DatasourcePlus,
11
+ } from "@budibase/types"
9
12
  import {
10
13
  getSqlQuery,
11
14
  buildExternalTableId,
12
15
  convertSqlType,
13
16
  finaliseExternalTables,
14
- SqlClients,
17
+ SqlClient,
15
18
  } from "./utils"
16
- import { DatasourcePlus } from "./base/datasourcePlus"
17
- import { Table, TableSchema } from "../definitions/common"
18
19
 
19
20
  module MSSQLModule {
20
21
  const sqlServer = require("mssql")
@@ -47,48 +48,48 @@ module MSSQLModule {
47
48
  type: "Relational",
48
49
  datasource: {
49
50
  user: {
50
- type: DatasourceFieldTypes.STRING,
51
+ type: DatasourceFieldType.STRING,
51
52
  required: true,
52
53
  default: "localhost",
53
54
  },
54
55
  password: {
55
- type: DatasourceFieldTypes.PASSWORD,
56
+ type: DatasourceFieldType.PASSWORD,
56
57
  required: true,
57
58
  },
58
59
  server: {
59
- type: DatasourceFieldTypes.STRING,
60
+ type: DatasourceFieldType.STRING,
60
61
  default: "localhost",
61
62
  },
62
63
  port: {
63
- type: DatasourceFieldTypes.NUMBER,
64
+ type: DatasourceFieldType.NUMBER,
64
65
  required: false,
65
66
  default: 1433,
66
67
  },
67
68
  database: {
68
- type: DatasourceFieldTypes.STRING,
69
+ type: DatasourceFieldType.STRING,
69
70
  default: "root",
70
71
  },
71
72
  schema: {
72
- type: DatasourceFieldTypes.STRING,
73
+ type: DatasourceFieldType.STRING,
73
74
  default: DEFAULT_SCHEMA,
74
75
  },
75
76
  encrypt: {
76
- type: DatasourceFieldTypes.BOOLEAN,
77
+ type: DatasourceFieldType.BOOLEAN,
77
78
  default: true,
78
79
  },
79
80
  },
80
81
  query: {
81
82
  create: {
82
- type: QueryTypes.SQL,
83
+ type: QueryType.SQL,
83
84
  },
84
85
  read: {
85
- type: QueryTypes.SQL,
86
+ type: QueryType.SQL,
86
87
  },
87
88
  update: {
88
- type: QueryTypes.SQL,
89
+ type: QueryType.SQL,
89
90
  },
90
91
  delete: {
91
- type: QueryTypes.SQL,
92
+ type: QueryType.SQL,
92
93
  },
93
94
  },
94
95
  }
@@ -111,7 +112,7 @@ module MSSQLModule {
111
112
  "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'"
112
113
 
113
114
  constructor(config: MSSQLConfig) {
114
- super(SqlClients.MS_SQL)
115
+ super(SqlClient.MS_SQL)
115
116
  this.config = config
116
117
  const clientCfg = {
117
118
  ...this.config,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Integration,
3
- DatasourceFieldTypes,
4
- QueryTypes,
5
- } from "../definitions/datasource"
6
- import { IntegrationBase } from "./base/IntegrationBase"
3
+ DatasourceFieldType,
4
+ QueryType,
5
+ IntegrationBase,
6
+ } from "@budibase/types"
7
7
  import {
8
8
  MongoClient,
9
9
  ObjectID,
@@ -29,38 +29,38 @@ module MongoDBModule {
29
29
  "MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.",
30
30
  datasource: {
31
31
  connectionString: {
32
- type: DatasourceFieldTypes.STRING,
32
+ type: DatasourceFieldType.STRING,
33
33
  required: true,
34
34
  default: "mongodb://localhost:27017",
35
35
  },
36
36
  db: {
37
- type: DatasourceFieldTypes.STRING,
37
+ type: DatasourceFieldType.STRING,
38
38
  required: true,
39
39
  },
40
40
  },
41
41
  query: {
42
42
  create: {
43
- type: QueryTypes.JSON,
43
+ type: QueryType.JSON,
44
44
  },
45
45
  read: {
46
- type: QueryTypes.JSON,
46
+ type: QueryType.JSON,
47
47
  },
48
48
  update: {
49
- type: QueryTypes.JSON,
49
+ type: QueryType.JSON,
50
50
  },
51
51
  delete: {
52
- type: QueryTypes.JSON,
52
+ type: QueryType.JSON,
53
53
  },
54
54
  },
55
55
  extra: {
56
56
  collection: {
57
57
  displayName: "Collection",
58
- type: DatasourceFieldTypes.STRING,
58
+ type: DatasourceFieldType.STRING,
59
59
  required: true,
60
60
  },
61
61
  actionTypes: {
62
62
  displayName: "Action Types",
63
- type: DatasourceFieldTypes.LIST,
63
+ type: DatasourceFieldType.LIST,
64
64
  required: true,
65
65
  data: {
66
66
  read: ["find", "findOne", "findOneAndUpdate", "count", "distinct"],
@@ -1,19 +1,20 @@
1
1
  import {
2
2
  Integration,
3
- DatasourceFieldTypes,
4
- QueryTypes,
3
+ DatasourceFieldType,
4
+ QueryType,
5
5
  QueryJson,
6
6
  SqlQuery,
7
- } from "../definitions/datasource"
8
- import { Table, TableSchema } from "../definitions/common"
7
+ Table,
8
+ TableSchema,
9
+ DatasourcePlus,
10
+ } from "@budibase/types"
9
11
  import {
10
12
  getSqlQuery,
11
- SqlClients,
13
+ SqlClient,
12
14
  buildExternalTableId,
13
15
  convertSqlType,
14
16
  finaliseExternalTables,
15
17
  } from "./utils"
16
- import { DatasourcePlus } from "./base/datasourcePlus"
17
18
  import dayjs from "dayjs"
18
19
  const { NUMBER_REGEX } = require("../utilities")
19
20
 
@@ -41,51 +42,51 @@ module MySQLModule {
41
42
  "MySQL Database Service is a fully managed database service to deploy cloud-native applications. ",
42
43
  datasource: {
43
44
  host: {
44
- type: DatasourceFieldTypes.STRING,
45
+ type: DatasourceFieldType.STRING,
45
46
  default: "localhost",
46
47
  required: true,
47
48
  },
48
49
  port: {
49
- type: DatasourceFieldTypes.NUMBER,
50
+ type: DatasourceFieldType.NUMBER,
50
51
  default: 3306,
51
52
  required: false,
52
53
  },
53
54
  user: {
54
- type: DatasourceFieldTypes.STRING,
55
+ type: DatasourceFieldType.STRING,
55
56
  default: "root",
56
57
  required: true,
57
58
  },
58
59
  password: {
59
- type: DatasourceFieldTypes.PASSWORD,
60
+ type: DatasourceFieldType.PASSWORD,
60
61
  default: "root",
61
62
  required: true,
62
63
  },
63
64
  database: {
64
- type: DatasourceFieldTypes.STRING,
65
+ type: DatasourceFieldType.STRING,
65
66
  required: true,
66
67
  },
67
68
  ssl: {
68
- type: DatasourceFieldTypes.OBJECT,
69
+ type: DatasourceFieldType.OBJECT,
69
70
  required: false,
70
71
  },
71
72
  rejectUnauthorized: {
72
- type: DatasourceFieldTypes.BOOLEAN,
73
+ type: DatasourceFieldType.BOOLEAN,
73
74
  default: true,
74
75
  required: false,
75
76
  },
76
77
  },
77
78
  query: {
78
79
  create: {
79
- type: QueryTypes.SQL,
80
+ type: QueryType.SQL,
80
81
  },
81
82
  read: {
82
- type: QueryTypes.SQL,
83
+ type: QueryType.SQL,
83
84
  },
84
85
  update: {
85
- type: QueryTypes.SQL,
86
+ type: QueryType.SQL,
86
87
  },
87
88
  delete: {
88
- type: QueryTypes.SQL,
89
+ type: QueryType.SQL,
89
90
  },
90
91
  },
91
92
  }
@@ -119,7 +120,7 @@ module MySQLModule {
119
120
  public schemaErrors: Record<string, string> = {}
120
121
 
121
122
  constructor(config: MySQLConfig) {
122
- super(SqlClients.MY_SQL)
123
+ super(SqlClient.MY_SQL)
123
124
  this.config = config
124
125
  if (config.ssl && Object.keys(config.ssl).length === 0) {
125
126
  delete config.ssl
@@ -1,17 +1,19 @@
1
1
  import {
2
- DatasourceFieldTypes,
2
+ DatasourceFieldType,
3
3
  Integration,
4
4
  Operation,
5
5
  QueryJson,
6
- QueryTypes,
6
+ QueryType,
7
7
  SqlQuery,
8
- } from "../definitions/datasource"
8
+ Table,
9
+ DatasourcePlus,
10
+ } from "@budibase/types"
9
11
  import {
10
12
  buildExternalTableId,
11
13
  convertSqlType,
12
14
  finaliseExternalTables,
13
15
  getSqlQuery,
14
- SqlClients,
16
+ SqlClient,
15
17
  } from "./utils"
16
18
  import oracledb, {
17
19
  BindParameters,
@@ -21,8 +23,6 @@ import oracledb, {
21
23
  Result,
22
24
  } from "oracledb"
23
25
  import Sql from "./base/sql"
24
- import { Table } from "../definitions/common"
25
- import { DatasourcePlus } from "./base/datasourcePlus"
26
26
  import { FieldTypes } from "../constants"
27
27
 
28
28
  module OracleModule {
@@ -45,40 +45,40 @@ module OracleModule {
45
45
  "Oracle Database is an object-relational database management system developed by Oracle Corporation",
46
46
  datasource: {
47
47
  host: {
48
- type: DatasourceFieldTypes.STRING,
48
+ type: DatasourceFieldType.STRING,
49
49
  default: "localhost",
50
50
  required: true,
51
51
  },
52
52
  port: {
53
- type: DatasourceFieldTypes.NUMBER,
53
+ type: DatasourceFieldType.NUMBER,
54
54
  required: true,
55
55
  default: 1521,
56
56
  },
57
57
  database: {
58
- type: DatasourceFieldTypes.STRING,
58
+ type: DatasourceFieldType.STRING,
59
59
  required: true,
60
60
  },
61
61
  user: {
62
- type: DatasourceFieldTypes.STRING,
62
+ type: DatasourceFieldType.STRING,
63
63
  required: true,
64
64
  },
65
65
  password: {
66
- type: DatasourceFieldTypes.PASSWORD,
66
+ type: DatasourceFieldType.PASSWORD,
67
67
  required: true,
68
68
  },
69
69
  },
70
70
  query: {
71
71
  create: {
72
- type: QueryTypes.SQL,
72
+ type: QueryType.SQL,
73
73
  },
74
74
  read: {
75
- type: QueryTypes.SQL,
75
+ type: QueryType.SQL,
76
76
  },
77
77
  update: {
78
- type: QueryTypes.SQL,
78
+ type: QueryType.SQL,
79
79
  },
80
80
  delete: {
81
- type: QueryTypes.SQL,
81
+ type: QueryType.SQL,
82
82
  },
83
83
  },
84
84
  }
@@ -172,7 +172,7 @@ module OracleModule {
172
172
  OR cons.status IS NULL)
173
173
  `
174
174
  constructor(config: OracleConfig) {
175
- super(SqlClients.ORACLE)
175
+ super(SqlClient.ORACLE)
176
176
  this.config = config
177
177
  }
178
178
 
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  Integration,
3
- DatasourceFieldTypes,
4
- QueryTypes,
3
+ DatasourceFieldType,
4
+ QueryType,
5
5
  QueryJson,
6
6
  SqlQuery,
7
- } from "../definitions/datasource"
8
- import { Table } from "../definitions/common"
7
+ Table,
8
+ DatasourcePlus,
9
+ } from "@budibase/types"
9
10
  import {
10
11
  getSqlQuery,
11
12
  buildExternalTableId,
12
13
  convertSqlType,
13
14
  finaliseExternalTables,
14
- SqlClients,
15
+ SqlClient,
15
16
  } from "./utils"
16
- import { DatasourcePlus } from "./base/datasourcePlus"
17
17
 
18
18
  module PostgresModule {
19
19
  const { Client, types } = require("pg")
@@ -52,63 +52,63 @@ module PostgresModule {
52
52
  "PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.",
53
53
  datasource: {
54
54
  host: {
55
- type: DatasourceFieldTypes.STRING,
55
+ type: DatasourceFieldType.STRING,
56
56
  default: "localhost",
57
57
  required: true,
58
58
  },
59
59
  port: {
60
- type: DatasourceFieldTypes.NUMBER,
60
+ type: DatasourceFieldType.NUMBER,
61
61
  required: true,
62
62
  default: 5432,
63
63
  },
64
64
  database: {
65
- type: DatasourceFieldTypes.STRING,
65
+ type: DatasourceFieldType.STRING,
66
66
  default: "postgres",
67
67
  required: true,
68
68
  },
69
69
  user: {
70
- type: DatasourceFieldTypes.STRING,
70
+ type: DatasourceFieldType.STRING,
71
71
  default: "root",
72
72
  required: true,
73
73
  },
74
74
  password: {
75
- type: DatasourceFieldTypes.PASSWORD,
75
+ type: DatasourceFieldType.PASSWORD,
76
76
  default: "root",
77
77
  required: true,
78
78
  },
79
79
  schema: {
80
- type: DatasourceFieldTypes.STRING,
80
+ type: DatasourceFieldType.STRING,
81
81
  default: "public",
82
82
  required: true,
83
83
  },
84
84
  ssl: {
85
- type: DatasourceFieldTypes.BOOLEAN,
85
+ type: DatasourceFieldType.BOOLEAN,
86
86
  default: false,
87
87
  required: false,
88
88
  },
89
89
  rejectUnauthorized: {
90
- type: DatasourceFieldTypes.BOOLEAN,
90
+ type: DatasourceFieldType.BOOLEAN,
91
91
  default: false,
92
92
  required: false,
93
93
  },
94
94
  ca: {
95
- type: DatasourceFieldTypes.LONGFORM,
95
+ type: DatasourceFieldType.LONGFORM,
96
96
  default: false,
97
97
  required: false,
98
98
  },
99
99
  },
100
100
  query: {
101
101
  create: {
102
- type: QueryTypes.SQL,
102
+ type: QueryType.SQL,
103
103
  },
104
104
  read: {
105
- type: QueryTypes.SQL,
105
+ type: QueryType.SQL,
106
106
  },
107
107
  update: {
108
- type: QueryTypes.SQL,
108
+ type: QueryType.SQL,
109
109
  },
110
110
  delete: {
111
- type: QueryTypes.SQL,
111
+ type: QueryType.SQL,
112
112
  },
113
113
  },
114
114
  }
@@ -133,7 +133,7 @@ module PostgresModule {
133
133
  `
134
134
 
135
135
  constructor(config: PostgresConfig) {
136
- super(SqlClients.POSTGRES)
136
+ super(SqlClient.POSTGRES)
137
137
  this.config = config
138
138
 
139
139
  let newConfig = {
@@ -1,6 +1,5 @@
1
1
  import { findHBSBlocks, processStringSync } from "@budibase/string-templates"
2
- import { Integration } from "../../definitions/datasource"
3
- import { DatasourcePlus } from "../base/datasourcePlus"
2
+ import { DatasourcePlus } from "@budibase/types"
4
3
 
5
4
  const CONST_CHAR_REGEX = new RegExp("'[^']*'", "g")
6
5