@budibase/server 1.0.219-alpha.7 → 1.0.219

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 (257) hide show
  1. package/__mocks__/node-fetch.ts +0 -9
  2. package/builder/assets/index.1c640a53.js +1316 -0
  3. package/builder/assets/index.24307ca0.css +6 -0
  4. package/builder/assets/{vendor.001dcf8c.js → vendor.9bf2fcb4.js} +163 -163
  5. package/builder/index.html +3 -3
  6. package/coverage/clover.xml +794 -868
  7. package/coverage/coverage-final.json +26 -26
  8. package/coverage/lcov-report/api/controllers/apikeys.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 +12 -111
  11. package/coverage/lcov-report/api/controllers/backup.js.html +6 -9
  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 +16 -16
  15. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/index.html +21 -21
  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/validation.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  25. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  26. package/coverage/lcov-report/api/controllers/row/external.js.html +17 -47
  27. package/coverage/lcov-report/api/controllers/row/index.html +34 -34
  28. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +11 -95
  30. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/utils.js.html +8 -17
  32. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  40. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  42. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  45. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  46. package/coverage/lcov-report/api/index.html +15 -15
  47. package/coverage/lcov-report/api/index.js.html +13 -22
  48. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  49. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  50. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  51. package/coverage/lcov-report/api/routes/automation.js.html +2 -32
  52. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/index.html +1 -1
  59. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/utils/index.html +1 -1
  73. package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  76. package/coverage/lcov-report/automations/actions.js.html +1 -1
  77. package/coverage/lcov-report/automations/automationUtils.js.html +12 -57
  78. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  79. package/coverage/lcov-report/automations/index.html +17 -17
  80. package/coverage/lcov-report/automations/index.js.html +1 -1
  81. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  82. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  83. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  84. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  85. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  86. package/coverage/lcov-report/automations/steps/filter.js.html +34 -58
  87. package/coverage/lcov-report/automations/steps/index.html +11 -11
  88. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  97. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  98. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  99. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  100. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  101. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  102. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  103. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  104. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  105. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  106. package/coverage/lcov-report/automations/triggers.js.html +4 -4
  107. package/coverage/lcov-report/constants/index.html +1 -1
  108. package/coverage/lcov-report/constants/index.js.html +1 -1
  109. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  110. package/coverage/lcov-report/constants/screens.js.html +1 -1
  111. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  112. package/coverage/lcov-report/db/index.html +14 -14
  113. package/coverage/lcov-report/db/index.js.html +1 -1
  114. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  115. package/coverage/lcov-report/db/linkedRows/index.html +13 -13
  116. package/coverage/lcov-report/db/linkedRows/index.js.html +7 -10
  117. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  118. package/coverage/lcov-report/db/newid.js.html +2 -2
  119. package/coverage/lcov-report/db/utils.js.html +51 -27
  120. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  121. package/coverage/lcov-report/events/index.html +1 -1
  122. package/coverage/lcov-report/events/index.js.html +1 -1
  123. package/coverage/lcov-report/events/utils.js.html +1 -1
  124. package/coverage/lcov-report/index.html +74 -74
  125. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  126. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  127. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  128. package/coverage/lcov-report/middleware/builder.js.html +12 -12
  129. package/coverage/lcov-report/middleware/currentapp.js.html +33 -33
  130. package/coverage/lcov-report/middleware/index.html +1 -1
  131. package/coverage/lcov-report/middleware/joi-validator.js.html +10 -10
  132. package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
  133. package/coverage/lcov-report/middleware/resourceId.js.html +7 -7
  134. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  135. package/coverage/lcov-report/middleware/utils.js.html +2 -2
  136. package/coverage/lcov-report/threads/automation.js.html +9 -18
  137. package/coverage/lcov-report/threads/index.html +25 -25
  138. package/coverage/lcov-report/threads/query.js.html +76 -283
  139. package/coverage/lcov-report/threads/utils.js.html +4 -4
  140. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  141. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  142. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  143. package/coverage/lcov-report/utilities/global.js.html +14 -14
  144. package/coverage/lcov-report/utilities/index.html +1 -1
  145. package/coverage/lcov-report/utilities/index.js.html +9 -9
  146. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +2 -2
  147. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  148. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  149. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  150. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  151. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  152. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  153. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  154. package/coverage/lcov-report/utilities/security.js.html +2 -2
  155. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  156. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  157. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  158. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  159. package/coverage/lcov-report/utilities/users.js.html +1 -1
  160. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  161. package/coverage/lcov.info +1425 -1553
  162. package/dist/api/controllers/application.js +15 -18
  163. package/dist/api/controllers/automation.js +2 -28
  164. package/dist/api/controllers/backup.js +2 -3
  165. package/dist/api/controllers/query/index.js +0 -25
  166. package/dist/api/controllers/row/external.js +7 -19
  167. package/dist/api/controllers/row/internalSearch.js +1 -22
  168. package/dist/api/controllers/row/utils.js +0 -3
  169. package/dist/api/index.js +1 -4
  170. package/dist/api/routes/automation.js +0 -2
  171. package/dist/automations/automationUtils.js +4 -16
  172. package/dist/automations/steps/filter.js +29 -38
  173. package/dist/automations/triggers.js +1 -1
  174. package/dist/db/linkedRows/index.js +0 -1
  175. package/dist/db/utils.js +31 -4
  176. package/dist/definitions/datasource.js +0 -1
  177. package/dist/environment.js +0 -1
  178. package/dist/integrations/airtable.js +0 -1
  179. package/dist/integrations/arangodb.js +0 -1
  180. package/dist/integrations/base/sql.js +3 -20
  181. package/dist/integrations/couchdb.js +0 -1
  182. package/dist/integrations/dynamodb.js +0 -1
  183. package/dist/integrations/elasticsearch.js +0 -1
  184. package/dist/integrations/firebase.js +0 -1
  185. package/dist/integrations/googlesheets.js +0 -1
  186. package/dist/integrations/index.js +0 -4
  187. package/dist/integrations/microsoftSqlServer.js +1 -2
  188. package/dist/integrations/mongodb.js +0 -1
  189. package/dist/integrations/mysql.js +1 -2
  190. package/dist/integrations/oracle.js +0 -1
  191. package/dist/integrations/postgres.js +1 -2
  192. package/dist/integrations/queries/sql.js +0 -3
  193. package/dist/integrations/redis.js +0 -1
  194. package/dist/integrations/rest.js +1 -2
  195. package/dist/integrations/s3.js +0 -1
  196. package/dist/package.json +6 -7
  197. package/dist/tests/utilities/TestConfiguration.js +6 -19
  198. package/dist/threads/automation.js +3 -6
  199. package/dist/threads/index.js +1 -15
  200. package/dist/threads/query.js +8 -54
  201. package/dist/tsconfig.build.tsbuildinfo +1 -1
  202. package/dist/utilities/fileSystem/index.js +6 -16
  203. package/package.json +7 -8
  204. package/src/api/controllers/application.ts +14 -18
  205. package/src/api/controllers/automation.js +2 -35
  206. package/src/api/controllers/backup.js +2 -3
  207. package/src/api/controllers/query/index.ts +1 -29
  208. package/src/api/controllers/row/external.js +9 -19
  209. package/src/api/controllers/row/internalSearch.js +0 -28
  210. package/src/api/controllers/row/utils.js +0 -3
  211. package/src/api/index.js +1 -4
  212. package/src/api/routes/automation.js +0 -10
  213. package/src/api/routes/tests/query.spec.js +0 -166
  214. package/src/automations/automationUtils.js +4 -19
  215. package/src/automations/steps/filter.js +28 -36
  216. package/src/automations/tests/filter.spec.js +1 -2
  217. package/src/automations/triggers.js +1 -1
  218. package/src/db/linkedRows/index.js +0 -1
  219. package/src/db/utils.js +13 -5
  220. package/src/definitions/common.ts +0 -1
  221. package/src/definitions/datasource.ts +0 -2
  222. package/src/environment.js +0 -1
  223. package/src/integrations/airtable.ts +0 -1
  224. package/src/integrations/arangodb.ts +0 -1
  225. package/src/integrations/base/sql.ts +11 -25
  226. package/src/integrations/couchdb.ts +0 -1
  227. package/src/integrations/dynamodb.ts +0 -1
  228. package/src/integrations/elasticsearch.ts +0 -1
  229. package/src/integrations/firebase.ts +0 -1
  230. package/src/integrations/googlesheets.ts +0 -1
  231. package/src/integrations/index.ts +0 -4
  232. package/src/integrations/microsoftSqlServer.ts +0 -2
  233. package/src/integrations/mongodb.ts +0 -1
  234. package/src/integrations/mysql.ts +0 -2
  235. package/src/integrations/oracle.ts +0 -1
  236. package/src/integrations/postgres.ts +0 -2
  237. package/src/integrations/queries/sql.ts +1 -3
  238. package/src/integrations/redis.ts +0 -1
  239. package/src/integrations/rest.ts +1 -2
  240. package/src/integrations/s3.ts +0 -1
  241. package/src/integrations/tests/rest.spec.js +1 -16
  242. package/src/migrations/tests/index.spec.ts +2 -18
  243. package/src/module.d.ts +0 -2
  244. package/src/tests/utilities/TestConfiguration.js +3 -22
  245. package/src/threads/automation.js +3 -6
  246. package/src/threads/index.ts +1 -5
  247. package/src/threads/query.js +10 -79
  248. package/src/utilities/fileSystem/index.js +8 -22
  249. package/builder/assets/index.5a233c3d.js +0 -977
  250. package/builder/assets/index.7786f497.css +0 -6
  251. package/dist/automations/logging/index.js +0 -70
  252. package/dist/integrations/snowflake.js +0 -102
  253. package/scripts/integrations/oracle/instantclient/linux/arm64/basiclite-19.10.zip +0 -0
  254. package/scripts/integrations/oracle/instantclient/linux/arm64/install.sh +0 -23
  255. package/scripts/integrations/oracle/instantclient/linux/install.sh +0 -10
  256. package/src/automations/logging/index.ts +0 -35
  257. package/src/integrations/snowflake.ts +0 -99
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.checkAppMetadata = exports.storeLog = void 0;
36
- const env = __importStar(require("../../environment"));
37
- const pro_1 = require("@budibase/pro");
38
- const backend_core_1 = require("@budibase/backend-core");
39
- function storeLog(automation, results) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- // can disable this if un-needed in self-host, also only do this for prod apps
42
- if (env.DISABLE_AUTOMATION_LOGS) {
43
- return;
44
- }
45
- yield pro_1.automations.logs.storeLog(automation, results);
46
- });
47
- }
48
- exports.storeLog = storeLog;
49
- function checkAppMetadata(apps) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- const maxStartDate = yield pro_1.automations.logs.oldestLogDate();
52
- for (let metadata of apps) {
53
- if (!metadata.automationErrors) {
54
- continue;
55
- }
56
- for (let [key, errors] of Object.entries(metadata.automationErrors)) {
57
- const updated = [];
58
- for (let error of errors) {
59
- const startDate = error.split(backend_core_1.db.SEPARATOR)[2];
60
- if (startDate > maxStartDate) {
61
- updated.push(error);
62
- }
63
- }
64
- metadata.automationErrors[key] = updated;
65
- }
66
- }
67
- return apps;
68
- });
69
- }
70
- exports.checkAppMetadata = checkAppMetadata;
@@ -1,102 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const datasource_1 = require("../definitions/datasource");
13
- const snowflake_promise_1 = require("snowflake-promise");
14
- var SnowflakeModule;
15
- (function (SnowflakeModule) {
16
- const SCHEMA = {
17
- docs: "https://developers.snowflake.com/",
18
- description: "Snowflake is a solution for data warehousing, data lakes, data engineering, data science, data application development, and securely sharing and consuming shared data.",
19
- friendlyName: "Snowflake",
20
- type: "Relational",
21
- datasource: {
22
- account: {
23
- type: "string",
24
- required: true,
25
- },
26
- username: {
27
- type: "string",
28
- required: true,
29
- },
30
- password: {
31
- type: "password",
32
- required: true,
33
- },
34
- warehouse: {
35
- type: "string",
36
- required: true,
37
- },
38
- database: {
39
- type: "string",
40
- required: true,
41
- },
42
- schema: {
43
- type: "string",
44
- required: true,
45
- },
46
- },
47
- query: {
48
- create: {
49
- type: datasource_1.QueryTypes.SQL,
50
- },
51
- read: {
52
- type: datasource_1.QueryTypes.SQL,
53
- },
54
- update: {
55
- type: datasource_1.QueryTypes.SQL,
56
- },
57
- delete: {
58
- type: datasource_1.QueryTypes.SQL,
59
- },
60
- },
61
- };
62
- class SnowflakeIntegration {
63
- constructor(config) {
64
- this.client = new snowflake_promise_1.Snowflake(config);
65
- }
66
- internalQuery(query) {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- yield this.client.connect();
69
- try {
70
- return yield this.client.execute(query.sql);
71
- }
72
- catch (err) {
73
- throw (err === null || err === void 0 ? void 0 : err.message.split(":")[1]) || (err === null || err === void 0 ? void 0 : err.message);
74
- }
75
- });
76
- }
77
- create(query) {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- return this.internalQuery(query);
80
- });
81
- }
82
- read(query) {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- return this.internalQuery(query);
85
- });
86
- }
87
- update(query) {
88
- return __awaiter(this, void 0, void 0, function* () {
89
- return this.internalQuery(query);
90
- });
91
- }
92
- delete(query) {
93
- return __awaiter(this, void 0, void 0, function* () {
94
- return this.internalQuery(query);
95
- });
96
- }
97
- }
98
- module.exports = {
99
- schema: SCHEMA,
100
- integration: SnowflakeIntegration,
101
- };
102
- })(SnowflakeModule || (SnowflakeModule = {}));
@@ -1,23 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Must be root to continue
4
- if [[ $(id -u) -ne 0 ]] ; then echo "Please run as root" ; exit 1 ; fi
5
-
6
- # Allow for re-runs
7
- rm -rf /opt/oracle
8
-
9
- echo "Installing oracle instant client"
10
-
11
- # copy and unzip package
12
- mkdir -p /opt/oracle
13
- cp scripts/integrations/oracle/instantclient/linux/arm64/basiclite-19.10.zip /opt/oracle
14
- cd /opt/oracle
15
- unzip -qq basiclite-19.10.zip -d .
16
- rm *.zip
17
- mv instantclient* instantclient
18
-
19
- # update runtime link path
20
- sh -c "echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient.conf"
21
- ldconfig /etc/ld.so.conf.d
22
-
23
- echo "Installation complete"
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
- SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"
3
- if [[ $TARGETARCH == arm* ]] ;
4
- then
5
- echo "Installing ARM Oracle instant client..."
6
- $SCRIPT_DIR/arm64/install.sh
7
- else
8
- echo "Installing x86-64 Oracle instant client..."
9
- $SCRIPT_DIR/x86-64/install.sh
10
- fi
@@ -1,35 +0,0 @@
1
- import * as env from "../../environment"
2
- import { AutomationResults, Automation, App } from "@budibase/types"
3
- import { automations } from "@budibase/pro"
4
- import { db as dbUtils } from "@budibase/backend-core"
5
-
6
- export async function storeLog(
7
- automation: Automation,
8
- results: AutomationResults
9
- ) {
10
- // can disable this if un-needed in self-host, also only do this for prod apps
11
- if (env.DISABLE_AUTOMATION_LOGS) {
12
- return
13
- }
14
- await automations.logs.storeLog(automation, results)
15
- }
16
-
17
- export async function checkAppMetadata(apps: App[]) {
18
- const maxStartDate = await automations.logs.oldestLogDate()
19
- for (let metadata of apps) {
20
- if (!metadata.automationErrors) {
21
- continue
22
- }
23
- for (let [key, errors] of Object.entries(metadata.automationErrors)) {
24
- const updated = []
25
- for (let error of errors) {
26
- const startDate = error.split(dbUtils.SEPARATOR)[2]
27
- if (startDate > maxStartDate) {
28
- updated.push(error)
29
- }
30
- }
31
- metadata.automationErrors[key] = updated
32
- }
33
- }
34
- return apps
35
- }
@@ -1,99 +0,0 @@
1
- import { Integration, QueryTypes, SqlQuery } from "../definitions/datasource"
2
- import { Snowflake } from "snowflake-promise"
3
-
4
- module SnowflakeModule {
5
- interface SnowflakeConfig {
6
- account: string
7
- username: string
8
- password: string
9
- warehouse: string
10
- database: string
11
- schema: string
12
- }
13
-
14
- const SCHEMA: Integration = {
15
- docs: "https://developers.snowflake.com/",
16
- description:
17
- "Snowflake is a solution for data warehousing, data lakes, data engineering, data science, data application development, and securely sharing and consuming shared data.",
18
- friendlyName: "Snowflake",
19
- type: "Relational",
20
- datasource: {
21
- account: {
22
- type: "string",
23
- required: true,
24
- },
25
- username: {
26
- type: "string",
27
- required: true,
28
- },
29
- password: {
30
- type: "password",
31
- required: true,
32
- },
33
- warehouse: {
34
- type: "string",
35
- required: true,
36
- },
37
- database: {
38
- type: "string",
39
- required: true,
40
- },
41
- schema: {
42
- type: "string",
43
- required: true,
44
- },
45
- },
46
- query: {
47
- create: {
48
- type: QueryTypes.SQL,
49
- },
50
- read: {
51
- type: QueryTypes.SQL,
52
- },
53
- update: {
54
- type: QueryTypes.SQL,
55
- },
56
- delete: {
57
- type: QueryTypes.SQL,
58
- },
59
- },
60
- }
61
-
62
- class SnowflakeIntegration {
63
- private client: Snowflake
64
-
65
- constructor(config: SnowflakeConfig) {
66
- this.client = new Snowflake(config)
67
- }
68
-
69
- async internalQuery(query: SqlQuery) {
70
- await this.client.connect()
71
- try {
72
- return await this.client.execute(query.sql)
73
- } catch (err: any) {
74
- throw err?.message.split(":")[1] || err?.message
75
- }
76
- }
77
-
78
- async create(query: SqlQuery) {
79
- return this.internalQuery(query)
80
- }
81
-
82
- async read(query: SqlQuery) {
83
- return this.internalQuery(query)
84
- }
85
-
86
- async update(query: SqlQuery) {
87
- return this.internalQuery(query)
88
- }
89
-
90
- async delete(query: SqlQuery) {
91
- return this.internalQuery(query)
92
- }
93
- }
94
-
95
- module.exports = {
96
- schema: SCHEMA,
97
- integration: SnowflakeIntegration,
98
- }
99
- }