@budibase/server 1.3.21 → 1.3.22-alpha.1

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 (310) hide show
  1. package/__mocks__/mongodb.ts +1 -1
  2. package/builder/assets/index.96c69636.js +1008 -0
  3. package/builder/assets/index.c167b5c3.css +6 -0
  4. package/builder/index.html +2 -4
  5. package/coverage/clover.xml +308 -338
  6. package/coverage/coverage-final.json +19 -21
  7. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/auth.js.html +41 -8
  9. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/datasource.js.html +73 -34
  13. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/index.html +27 -57
  15. package/coverage/lcov-report/api/controllers/integration.js.html +6 -6
  16. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  17. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  21. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  23. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/row/external.js.html +2 -2
  25. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  26. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/utils.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 +1 -1
  40. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  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 +13 -13
  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 +2 -2
  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 +9 -9
  70. package/coverage/lcov-report/api/routes/utils/validators.js.html +75 -12
  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 +14 -14
  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 +1 -1
  115. package/coverage/lcov-report/db/newid.js.html +2 -2
  116. package/coverage/lcov-report/db/utils.js.html +30 -18
  117. package/coverage/lcov-report/events/AutomationEmitter.js.html +3 -3
  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 +44 -44
  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 +12 -12
  126. package/coverage/lcov-report/middleware/currentapp.js.html +46 -40
  127. package/coverage/lcov-report/middleware/index.html +15 -15
  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 +7 -7
  131. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  132. package/coverage/lcov-report/middleware/utils.js.html +2 -2
  133. package/coverage/lcov-report/utilities/budibaseDir.js.html +3 -3
  134. package/coverage/lcov-report/utilities/centralPath.js.html +4 -4
  135. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  136. package/coverage/lcov-report/utilities/global.js.html +16 -16
  137. package/coverage/lcov-report/utilities/index.html +15 -15
  138. package/coverage/lcov-report/utilities/index.js.html +24 -24
  139. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +2 -2
  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 +1 -1
  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 +2 -2
  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 +32 -8
  154. package/coverage/lcov.info +521 -558
  155. package/dist/api/controllers/application.js +5 -5
  156. package/dist/api/controllers/auth.js +9 -0
  157. package/dist/api/controllers/component.js +19 -6
  158. package/dist/api/controllers/datasource.js +21 -8
  159. package/dist/api/controllers/deploy/index.js +1 -8
  160. package/dist/api/controllers/integration.js +4 -4
  161. package/dist/{migrations/functions/usageQuotas/syncDevelopers.js → api/controllers/plugin/file.js} +13 -13
  162. package/dist/api/controllers/plugin/github.js +69 -0
  163. package/dist/api/controllers/plugin/index.js +144 -0
  164. package/dist/api/controllers/plugin/npm.js +58 -0
  165. package/dist/api/controllers/plugin/uploaders.js +11 -0
  166. package/dist/{migrations/functions/usageQuotas/syncPublishedApps.js → api/controllers/plugin/url.js} +13 -15
  167. package/dist/api/controllers/plugin/utils.js +26 -0
  168. package/dist/api/controllers/row/external.js +1 -1
  169. package/dist/api/controllers/screen.js +62 -14
  170. package/dist/api/controllers/static/index.js +1 -0
  171. package/dist/api/controllers/static/templates/BudibaseApp.svelte +10 -0
  172. package/dist/api/controllers/static/templates/preview.hbs +5 -1
  173. package/dist/api/index.js +1 -1
  174. package/dist/api/routes/application.js +3 -2
  175. package/dist/api/routes/index.js +2 -0
  176. package/dist/{migrations/functions/publishedAppsQuota.js → api/routes/plugin.js} +13 -21
  177. package/dist/api/routes/public/rows.js +1 -82
  178. package/dist/api/routes/public/tables.js +1 -1
  179. package/dist/api/routes/table.js +1 -1
  180. package/dist/api/routes/utils/validators.js +20 -2
  181. package/dist/app.js +16 -1
  182. package/dist/db/utils.js +3 -0
  183. package/dist/environment.js +1 -0
  184. package/dist/integrations/airtable.js +126 -129
  185. package/dist/integrations/arangodb.js +86 -89
  186. package/dist/integrations/base/query.js +2 -2
  187. package/dist/integrations/base/sqlTable.js +3 -1
  188. package/dist/integrations/couchdb.js +80 -83
  189. package/dist/integrations/dynamodb.js +161 -164
  190. package/dist/integrations/elasticsearch.js +135 -138
  191. package/dist/integrations/firebase.js +154 -157
  192. package/dist/integrations/googlesheets.js +323 -327
  193. package/dist/integrations/index.js +99 -51
  194. package/dist/integrations/microsoftSqlServer.js +240 -243
  195. package/dist/integrations/mongodb.js +239 -242
  196. package/dist/integrations/mysql.js +215 -219
  197. package/dist/integrations/oracle.js +318 -322
  198. package/dist/integrations/postgres.js +262 -265
  199. package/dist/integrations/redis.js +134 -139
  200. package/dist/integrations/rest.js +289 -292
  201. package/dist/integrations/s3.js +61 -64
  202. package/dist/integrations/snowflake.js +83 -86
  203. package/dist/middleware/currentapp.js +2 -0
  204. package/dist/migrations/functions/backfill/global.js +0 -3
  205. package/dist/migrations/index.js +0 -10
  206. package/dist/package.json +9 -6
  207. package/dist/tests/utilities/TestConfiguration.js +1 -1
  208. package/dist/threads/query.js +2 -2
  209. package/dist/tsconfig.build.tsbuildinfo +1 -1
  210. package/dist/utilities/fileSystem/index.js +105 -1
  211. package/dist/utilities/workerRequests.js +4 -0
  212. package/dist/watch.js +77 -0
  213. package/dist/websocket.js +22 -0
  214. package/package.json +10 -7
  215. package/scripts/dev/manage.js +4 -0
  216. package/scripts/localdomain.js +3 -1
  217. package/specs/openapi.json +115 -112
  218. package/specs/openapi.yaml +96 -94
  219. package/specs/resources/misc.js +116 -0
  220. package/specs/resources/query.js +1 -1
  221. package/src/api/controllers/application.ts +1 -2
  222. package/src/api/controllers/auth.js +11 -0
  223. package/src/api/controllers/component.ts +57 -0
  224. package/src/api/controllers/datasource.js +21 -8
  225. package/src/api/controllers/deploy/index.ts +1 -6
  226. package/src/api/controllers/integration.js +4 -4
  227. package/src/api/controllers/plugin/file.ts +15 -0
  228. package/src/api/controllers/plugin/github.ts +75 -0
  229. package/src/api/controllers/plugin/index.ts +134 -0
  230. package/src/api/controllers/plugin/npm.ts +56 -0
  231. package/src/api/controllers/plugin/uploaders.ts +4 -0
  232. package/src/api/controllers/plugin/url.ts +12 -0
  233. package/src/api/controllers/plugin/utils.ts +19 -0
  234. package/src/api/controllers/public/mapping/types.ts +8 -0
  235. package/src/api/controllers/row/external.js +1 -1
  236. package/src/api/controllers/screen.ts +122 -0
  237. package/src/api/controllers/static/index.ts +1 -1
  238. package/src/api/controllers/static/templates/BudibaseApp.svelte +10 -0
  239. package/src/api/controllers/static/templates/preview.hbs +5 -1
  240. package/src/api/index.js +1 -1
  241. package/src/api/routes/application.ts +13 -2
  242. package/src/api/routes/index.ts +2 -0
  243. package/src/api/routes/plugin.ts +14 -0
  244. package/src/api/routes/public/rows.ts +1 -82
  245. package/src/api/routes/public/tables.ts +1 -1
  246. package/src/api/routes/table.js +1 -1
  247. package/src/api/routes/tests/query.spec.js +8 -25
  248. package/src/api/routes/tests/user.spec.js +0 -2
  249. package/src/api/routes/utils/validators.js +26 -5
  250. package/src/app.ts +25 -2
  251. package/src/db/utils.js +4 -0
  252. package/src/definitions/openapi.ts +56 -55
  253. package/src/environment.js +1 -0
  254. package/src/integrations/airtable.ts +116 -118
  255. package/src/integrations/arangodb.ts +87 -89
  256. package/src/integrations/base/query.ts +2 -2
  257. package/src/integrations/base/sqlTable.ts +3 -1
  258. package/src/integrations/couchdb.ts +83 -89
  259. package/src/integrations/dynamodb.ts +173 -175
  260. package/src/integrations/elasticsearch.ts +120 -122
  261. package/src/integrations/firebase.ts +157 -159
  262. package/src/integrations/googlesheets.ts +328 -338
  263. package/src/integrations/index.ts +64 -21
  264. package/src/integrations/microsoftSqlServer.ts +249 -251
  265. package/src/integrations/mongodb.ts +261 -258
  266. package/src/integrations/mysql.ts +229 -234
  267. package/src/integrations/oracle.ts +373 -380
  268. package/src/integrations/postgres.ts +264 -268
  269. package/src/integrations/redis.ts +128 -132
  270. package/src/integrations/rest.ts +324 -329
  271. package/src/integrations/s3.ts +68 -71
  272. package/src/integrations/snowflake.ts +80 -82
  273. package/src/integrations/tests/{airtable.spec.js → airtable.spec.ts} +21 -18
  274. package/src/integrations/tests/{arangodb.spec.js → arangodb.spec.ts} +12 -9
  275. package/src/integrations/tests/{couchdb.spec.js → couchdb.spec.ts} +33 -27
  276. package/src/integrations/tests/{dynamodb.spec.js → dynamodb.spec.ts} +45 -41
  277. package/src/integrations/tests/{elasticsearch.spec.js → elasticsearch.spec.ts} +22 -21
  278. package/src/integrations/tests/{firebase.spec.js → firebase.spec.ts} +33 -28
  279. package/src/integrations/tests/{microsoftSqlServer.spec.js → microsoftSqlServer.spec.ts} +12 -11
  280. package/src/integrations/tests/{mongo.spec.js → mongo.spec.ts} +46 -35
  281. package/src/integrations/tests/{mysql.spec.js → mysql.spec.ts} +17 -15
  282. package/src/integrations/tests/{oracle.spec.js → oracle.spec.ts} +19 -17
  283. package/src/integrations/tests/{postgres.spec.js → postgres.spec.ts} +19 -17
  284. package/src/integrations/tests/{redis.spec.js → redis.spec.ts} +27 -18
  285. package/src/integrations/tests/{rest.spec.js → rest.spec.ts} +22 -14
  286. package/src/integrations/tests/{s3.spec.js → s3.spec.ts} +10 -8
  287. package/src/integrations/tests/{sql.spec.js → sql.spec.ts} +228 -177
  288. package/src/middleware/currentapp.js +2 -0
  289. package/src/migrations/functions/backfill/global.ts +0 -3
  290. package/src/migrations/index.ts +0 -16
  291. package/src/module.d.ts +2 -0
  292. package/src/tests/utilities/TestConfiguration.js +1 -1
  293. package/src/threads/query.ts +2 -2
  294. package/src/utilities/fileSystem/index.js +123 -0
  295. package/src/utilities/workerRequests.js +8 -0
  296. package/src/watch.ts +38 -0
  297. package/src/websocket.ts +26 -0
  298. package/builder/assets/index.8d12d461.css +0 -6
  299. package/builder/assets/index.d354271c.js +0 -879
  300. package/builder/assets/vendor.5e1fe644.css +0 -1
  301. package/builder/assets/vendor.67dbd8fa.js +0 -248
  302. package/coverage/lcov-report/api/controllers/component.js.html +0 -199
  303. package/coverage/lcov-report/api/controllers/screen.js.html +0 -259
  304. package/dist/migrations/functions/developerQuota.js +0 -49
  305. package/src/api/controllers/component.js +0 -38
  306. package/src/api/controllers/screen.js +0 -58
  307. package/src/migrations/functions/developerQuota.ts +0 -15
  308. package/src/migrations/functions/publishedAppsQuota.ts +0 -13
  309. package/src/migrations/functions/usageQuotas/syncDevelopers.ts +0 -19
  310. package/src/migrations/functions/usageQuotas/syncPublishedApps.ts +0 -21
@@ -1,15 +1,16 @@
1
- const AWS = require("aws-sdk")
2
- const DynamoDBIntegration = require("../dynamodb")
1
+ import { default as DynamoDBIntegration } from "../dynamodb"
3
2
  jest.mock("aws-sdk")
4
3
 
5
4
  class TestConfiguration {
6
- constructor(config = {}) {
7
- this.integration = new DynamoDBIntegration.integration(config)
5
+ integration: any
6
+
7
+ constructor(config: any = {}) {
8
+ this.integration = new DynamoDBIntegration.integration(config)
8
9
  }
9
10
  }
10
11
 
11
12
  describe("DynamoDB Integration", () => {
12
- let config
13
+ let config: any
13
14
  let tableName = "Users"
14
15
 
15
16
  beforeEach(() => {
@@ -17,25 +18,25 @@ describe("DynamoDB Integration", () => {
17
18
  })
18
19
 
19
20
  it("calls the create method with the correct params", async () => {
20
- const response = await config.integration.create({
21
+ const response = await config.integration.create({
21
22
  table: tableName,
22
23
  json: {
23
- Name: "John"
24
- }
24
+ Name: "John",
25
+ },
25
26
  })
26
27
  expect(config.integration.client.put).toHaveBeenCalledWith({
27
28
  TableName: tableName,
28
- Name: "John"
29
+ Name: "John",
29
30
  })
30
31
  })
31
32
 
32
33
  it("calls the read method with the correct params", async () => {
33
34
  const indexName = "Test"
34
35
 
35
- const response = await config.integration.read({
36
+ const response = await config.integration.read({
36
37
  table: tableName,
37
- index: indexName,
38
- json: {}
38
+ index: indexName,
39
+ json: {},
39
40
  })
40
41
  expect(config.integration.client.query).toHaveBeenCalledWith({
41
42
  TableName: tableName,
@@ -47,57 +48,59 @@ describe("DynamoDB Integration", () => {
47
48
  it("calls the scan method with the correct params", async () => {
48
49
  const indexName = "Test"
49
50
 
50
- const response = await config.integration.scan({
51
+ const response = await config.integration.scan({
51
52
  table: tableName,
52
- index: indexName,
53
- json: {}
53
+ index: indexName,
54
+ json: {},
54
55
  })
55
56
  expect(config.integration.client.scan).toHaveBeenCalledWith({
56
57
  TableName: tableName,
57
58
  IndexName: indexName,
58
59
  })
59
- expect(response).toEqual([{
60
- Name: "test"
61
- }])
60
+ expect(response).toEqual([
61
+ {
62
+ Name: "test",
63
+ },
64
+ ])
62
65
  })
63
66
 
64
67
  it("calls the get method with the correct params", async () => {
65
- const response = await config.integration.get({
68
+ const response = await config.integration.get({
66
69
  table: tableName,
67
70
  json: {
68
- Id: 123
69
- }
71
+ Id: 123,
72
+ },
70
73
  })
71
74
 
72
75
  expect(config.integration.client.get).toHaveBeenCalledWith({
73
76
  TableName: tableName,
74
- Id: 123
77
+ Id: 123,
75
78
  })
76
79
  })
77
80
 
78
81
  it("calls the update method with the correct params", async () => {
79
- const response = await config.integration.update({
82
+ const response = await config.integration.update({
80
83
  table: tableName,
81
84
  json: {
82
- Name: "John"
83
- }
85
+ Name: "John",
86
+ },
84
87
  })
85
88
  expect(config.integration.client.update).toHaveBeenCalledWith({
86
89
  TableName: tableName,
87
- Name: "John"
90
+ Name: "John",
88
91
  })
89
92
  })
90
93
 
91
94
  it("calls the delete method with the correct params", async () => {
92
- const response = await config.integration.delete({
95
+ const response = await config.integration.delete({
93
96
  table: tableName,
94
97
  json: {
95
- Name: "John"
96
- }
98
+ Name: "John",
99
+ },
97
100
  })
98
101
  expect(config.integration.client.delete).toHaveBeenCalledWith({
99
102
  TableName: tableName,
100
- Name: "John"
103
+ Name: "John",
101
104
  })
102
105
  })
103
106
 
@@ -105,14 +108,14 @@ describe("DynamoDB Integration", () => {
105
108
  const config = {
106
109
  region: "us-east-1",
107
110
  accessKeyId: "test",
108
- secretAccessKeyId: "test"
111
+ secretAccessKey: "test",
109
112
  }
110
113
 
111
- const integration = new DynamoDBIntegration.integration(config)
114
+ const integration: any = new DynamoDBIntegration.integration(config)
112
115
 
113
116
  expect(integration.config).toEqual({
114
117
  currentClockSkew: true,
115
- ...config
118
+ ...config,
116
119
  })
117
120
  })
118
121
 
@@ -120,16 +123,16 @@ describe("DynamoDB Integration", () => {
120
123
  const config = {
121
124
  region: "us-east-1",
122
125
  accessKeyId: "test",
123
- secretAccessKeyId: "test",
124
- endpoint: "localhost:8080"
126
+ secretAccessKey: "test",
127
+ endpoint: "localhost:8080",
125
128
  }
126
129
 
127
- const integration = new DynamoDBIntegration.integration(config)
130
+ const integration: any = new DynamoDBIntegration.integration(config)
128
131
 
129
132
  expect(integration.config).toEqual({
130
133
  region: "us-east-1",
131
134
  currentClockSkew: true,
132
- endpoint: "localhost:8080"
135
+ endpoint: "localhost:8080",
133
136
  })
134
137
  })
135
138
 
@@ -137,15 +140,16 @@ describe("DynamoDB Integration", () => {
137
140
  const config = {
138
141
  region: "us-east-1",
139
142
  accessKeyId: "test",
140
- secretAccessKeyId: "test",
141
- endpoint: "dynamodb.aws.foo.net"
143
+ secretAccessKey: "test",
144
+ endpoint: "dynamodb.aws.foo.net",
142
145
  }
143
146
 
144
147
  const integration = new DynamoDBIntegration.integration(config)
145
148
 
149
+ // @ts-ignore
146
150
  expect(integration.config).toEqual({
147
151
  currentClockSkew: true,
148
- ...config
152
+ ...config,
149
153
  })
150
154
  })
151
- })
155
+ })
@@ -1,15 +1,16 @@
1
- const elasticsearch = require("@elastic/elasticsearch")
2
- const ElasticSearchIntegration = require("../elasticsearch")
1
+ import { default as ElasticSearchIntegration } from "../elasticsearch"
3
2
  jest.mock("@elastic/elasticsearch")
4
3
 
5
4
  class TestConfiguration {
6
- constructor(config = {}) {
7
- this.integration = new ElasticSearchIntegration.integration(config)
5
+ integration: any
6
+
7
+ constructor(config: any = {}) {
8
+ this.integration = new ElasticSearchIntegration.integration(config)
8
9
  }
9
10
  }
10
11
 
11
12
  describe("Elasticsearch Integration", () => {
12
- let config
13
+ let config: any
13
14
  let indexName = "Users"
14
15
 
15
16
  beforeEach(() => {
@@ -18,15 +19,15 @@ describe("Elasticsearch Integration", () => {
18
19
 
19
20
  it("calls the create method with the correct params", async () => {
20
21
  const body = {
21
- name: "Hello"
22
+ name: "Hello",
22
23
  }
23
- const response = await config.integration.create({
24
+ const response = await config.integration.create({
24
25
  index: indexName,
25
- json: body
26
+ json: body,
26
27
  })
27
28
  expect(config.integration.client.index).toHaveBeenCalledWith({
28
29
  index: indexName,
29
- body
30
+ body,
30
31
  })
31
32
  })
32
33
 
@@ -34,43 +35,43 @@ describe("Elasticsearch Integration", () => {
34
35
  const body = {
35
36
  query: {
36
37
  term: {
37
- name: "kimchy"
38
- }
39
- }
38
+ name: "kimchy",
39
+ },
40
+ },
40
41
  }
41
- const response = await config.integration.read({
42
+ const response = await config.integration.read({
42
43
  index: indexName,
43
- json: body
44
+ json: body,
44
45
  })
45
46
  expect(config.integration.client.search).toHaveBeenCalledWith({
46
47
  index: indexName,
47
- body
48
+ body,
48
49
  })
49
50
  expect(response).toEqual(expect.any(Array))
50
51
  })
51
52
 
52
53
  it("calls the update method with the correct params", async () => {
53
54
  const body = {
54
- name: "updated"
55
+ name: "updated",
55
56
  }
56
57
 
57
- const response = await config.integration.update({
58
+ const response = await config.integration.update({
58
59
  id: "1234",
59
60
  index: indexName,
60
- json: body
61
+ json: body,
61
62
  })
62
63
 
63
64
  expect(config.integration.client.update).toHaveBeenCalledWith({
64
65
  id: "1234",
65
66
  index: indexName,
66
- body
67
+ body,
67
68
  })
68
69
  expect(response).toEqual(expect.any(Array))
69
70
  })
70
71
 
71
72
  it("calls the delete method with the correct params", async () => {
72
73
  const body = {
73
- id: "1234"
74
+ id: "1234",
74
75
  }
75
76
 
76
77
  const response = await config.integration.delete(body)
@@ -78,4 +79,4 @@ describe("Elasticsearch Integration", () => {
78
79
  expect(config.integration.client.delete).toHaveBeenCalledWith(body)
79
80
  expect(response).toEqual(expect.any(Array))
80
81
  })
81
- })
82
+ })
@@ -1,92 +1,97 @@
1
- const firebase = require("@google-cloud/firestore")
2
- const FirebaseIntegration = require("../firebase")
1
+ import { default as FirebaseIntegration } from "../firebase"
3
2
  jest.mock("@google-cloud/firestore")
4
3
 
5
4
  class TestConfiguration {
6
- constructor(config = {}) {
7
- this.integration = new FirebaseIntegration.integration(config)
5
+ integration: any
6
+
7
+ constructor(config: any = {}) {
8
+ this.integration = new FirebaseIntegration.integration(config)
8
9
  }
9
10
  }
10
11
 
11
12
  describe("Firebase Integration", () => {
12
- let config
13
+ let config: any
13
14
  let tableName = "Users"
14
15
 
15
16
  beforeEach(() => {
16
17
  config = new TestConfiguration({
17
- serviceAccount: "{}"
18
+ serviceAccount: "{}",
18
19
  })
19
20
  })
20
21
 
21
22
  it("calls the create method with the correct params", async () => {
22
- await config.integration.create({
23
+ await config.integration.create({
23
24
  table: tableName,
24
25
  json: {
25
- Name: "Test Name"
26
+ Name: "Test Name",
26
27
  },
27
28
  extra: {
28
- collection: "test"
29
- }
29
+ collection: "test",
30
+ },
30
31
  })
31
32
  expect(config.integration.client.collection).toHaveBeenCalledWith("test")
32
- expect(config.integration.client.set).toHaveBeenCalledWith({
33
+ expect(config.integration.client.set).toHaveBeenCalledWith({
33
34
  Name: "Test Name",
34
- id: "test_id"
35
+ id: "test_id",
35
36
  })
36
37
  })
37
38
 
38
39
  it("calls the read method with the correct params", async () => {
39
- const response = await config.integration.read({
40
+ const response = await config.integration.read({
40
41
  table: tableName,
41
42
  json: {
42
- Name: "Test"
43
+ Name: "Test",
43
44
  },
44
45
  extra: {
45
46
  collection: "test",
46
47
  filterField: "field",
47
48
  filter: "==",
48
49
  filterValue: "value",
49
- }
50
+ },
50
51
  })
51
52
  expect(config.integration.client.collection).toHaveBeenCalledWith("test")
52
- expect(config.integration.client.where).toHaveBeenCalledWith("field", "==", "value")
53
- expect(response).toEqual([{ result: "test"}])
53
+ expect(config.integration.client.where).toHaveBeenCalledWith(
54
+ "field",
55
+ "==",
56
+ "value"
57
+ )
58
+ expect(response).toEqual([{ result: "test" }])
54
59
  })
55
60
 
56
61
  it("calls the update method with the correct params", async () => {
57
- const response = await config.integration.update({
62
+ const response = await config.integration.update({
58
63
  table: tableName,
59
64
  json: {
60
65
  id: "test",
61
- Name: "Test"
66
+ Name: "Test",
62
67
  },
63
68
  extra: {
64
- collection: "test"
65
- }
69
+ collection: "test",
70
+ },
66
71
  })
67
72
  expect(config.integration.client.collection).toHaveBeenCalledWith("test")
68
73
  expect(config.integration.client.update).toHaveBeenCalledWith({
69
74
  Name: "Test",
70
- id: "test"
75
+ id: "test",
71
76
  })
72
77
  expect(response).toEqual({
73
- result: "test"
78
+ result: "test",
74
79
  })
75
80
  })
76
81
 
77
82
  it("calls the delete method with the correct params", async () => {
78
- const response = await config.integration.delete({
83
+ const response = await config.integration.delete({
79
84
  table: tableName,
80
85
  json: {
81
86
  id: "test",
82
- Name: "Test"
87
+ Name: "Test",
83
88
  },
84
89
  extra: {
85
- collection: "test"
86
- }
90
+ collection: "test",
91
+ },
87
92
  })
88
93
  expect(config.integration.client.collection).toHaveBeenCalledWith("test")
89
94
  expect(config.integration.client.doc).toHaveBeenCalledWith("test")
90
95
  expect(config.integration.client.delete).toHaveBeenCalled()
91
96
  })
92
- })
97
+ })
@@ -1,15 +1,16 @@
1
- const sqlServer = require("mssql")
2
- const MSSQLIntegration = require("../microsoftSqlServer")
1
+ import { default as MSSQLIntegration } from "../microsoftSqlServer"
3
2
  jest.mock("mssql")
4
3
 
5
4
  class TestConfiguration {
6
- constructor(config = {}) {
7
- this.integration = new MSSQLIntegration.integration(config)
5
+ integration: any
6
+
7
+ constructor(config: any = {}) {
8
+ this.integration = new MSSQLIntegration.integration(config)
8
9
  }
9
10
  }
10
11
 
11
12
  describe("MS SQL Server Integration", () => {
12
- let config
13
+ let config: any
13
14
 
14
15
  beforeEach(async () => {
15
16
  config = new TestConfiguration()
@@ -23,7 +24,7 @@ describe("MS SQL Server Integration", () => {
23
24
  it("calls the create method with the correct params", async () => {
24
25
  const sql = "insert into users (name, age) values ('Joe', 123);"
25
26
  const response = await config.integration.create({
26
- sql
27
+ sql,
27
28
  })
28
29
  expect(config.integration.client.request).toHaveBeenCalledWith()
29
30
  expect(response[0]).toEqual(sql)
@@ -32,7 +33,7 @@ describe("MS SQL Server Integration", () => {
32
33
  it("calls the read method with the correct params", async () => {
33
34
  const sql = "select * from users;"
34
35
  const response = await config.integration.read({
35
- sql
36
+ sql,
36
37
  })
37
38
  expect(config.integration.client.request).toHaveBeenCalledWith()
38
39
  expect(response[0]).toEqual(sql)
@@ -45,11 +46,11 @@ describe("MS SQL Server Integration", () => {
45
46
  })
46
47
 
47
48
  it("returns the correct response when the create response has no rows", async () => {
48
- const sql = "insert into users (name, age) values ('Joe', 123);"
49
- const response = await config.integration.create({
50
- sql
49
+ const sql = "insert into users (name, age) values ('Joe', 123);"
50
+ const response = await config.integration.create({
51
+ sql,
51
52
  })
52
53
  expect(response[0]).toEqual(sql)
53
54
  })
54
55
  })
55
- })
56
+ })