@budibase/server 2.5.6-alpha.4 → 2.5.6-alpha.5
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.
- package/builder/assets/{index.58b41739.js → index.564a7c4f.js} +243 -243
- package/builder/assets/{index.841e62d8.css → index.9e886d0a.css} +1 -1
- package/builder/index.html +2 -2
- package/dist/api/controllers/automation.js +13 -7
- package/dist/api/controllers/plugin/index.js +4 -35
- package/dist/automations/actions.js +32 -6
- package/dist/automations/index.js +3 -2
- package/dist/automations/steps/bash.js +6 -6
- package/dist/automations/steps/createRow.js +11 -11
- package/dist/automations/steps/delay.js +3 -3
- package/dist/automations/steps/deleteRow.js +8 -8
- package/dist/automations/steps/discord.js +8 -8
- package/dist/automations/steps/executeQuery.js +9 -9
- package/dist/automations/steps/executeScript.js +6 -6
- package/dist/automations/steps/filter.js +6 -6
- package/dist/automations/steps/integromat.js +10 -10
- package/dist/automations/steps/loop.js +9 -9
- package/dist/automations/steps/outgoingWebhook.js +10 -10
- package/dist/automations/steps/queryRows.js +14 -14
- package/dist/automations/steps/sendSmtpEmail.js +9 -9
- package/dist/automations/steps/serverLog.js +4 -4
- package/dist/automations/steps/slack.js +6 -6
- package/dist/automations/steps/updateRow.js +11 -11
- package/dist/automations/steps/zapier.js +9 -9
- package/dist/automations/triggerInfo/app.js +5 -5
- package/dist/automations/triggerInfo/cron.js +4 -4
- package/dist/automations/triggerInfo/rowDeleted.js +5 -5
- package/dist/automations/triggerInfo/rowSaved.js +7 -7
- package/dist/automations/triggerInfo/rowUpdated.js +7 -7
- package/dist/automations/triggerInfo/webhook.js +6 -6
- package/dist/integrations/index.js +3 -3
- package/dist/package.json +7 -7
- package/dist/sdk/index.js +2 -0
- package/dist/sdk/plugins/index.js +27 -0
- package/dist/sdk/plugins/plugins.js +53 -0
- package/dist/threads/automation.js +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/plugin.js +33 -23
- package/dist/watch.js +2 -2
- package/package.json +8 -8
- package/src/api/controllers/automation.ts +12 -6
- package/src/api/controllers/plugin/index.ts +6 -43
- package/src/api/routes/tests/automation.spec.js +2 -2
- package/src/automations/actions.ts +56 -24
- package/src/automations/index.ts +1 -1
- package/src/automations/steps/bash.ts +10 -7
- package/src/automations/steps/createRow.ts +15 -12
- package/src/automations/steps/delay.ts +6 -4
- package/src/automations/steps/deleteRow.ts +12 -9
- package/src/automations/steps/discord.ts +10 -8
- package/src/automations/steps/executeQuery.ts +13 -10
- package/src/automations/steps/executeScript.ts +10 -7
- package/src/automations/steps/filter.ts +8 -6
- package/src/automations/steps/integromat.ts +12 -10
- package/src/automations/steps/loop.ts +16 -10
- package/src/automations/steps/outgoingWebhook.ts +14 -11
- package/src/automations/steps/queryRows.ts +18 -15
- package/src/automations/steps/sendSmtpEmail.ts +11 -9
- package/src/automations/steps/serverLog.ts +6 -4
- package/src/automations/steps/slack.ts +8 -6
- package/src/automations/steps/updateRow.ts +15 -12
- package/src/automations/steps/zapier.ts +11 -9
- package/src/automations/tests/utilities/index.ts +2 -2
- package/src/automations/triggerInfo/app.ts +8 -5
- package/src/automations/triggerInfo/cron.ts +7 -4
- package/src/automations/triggerInfo/rowDeleted.ts +8 -5
- package/src/automations/triggerInfo/rowSaved.ts +10 -7
- package/src/automations/triggerInfo/rowUpdated.ts +10 -7
- package/src/automations/triggerInfo/webhook.ts +9 -6
- package/src/integrations/index.ts +3 -3
- package/src/sdk/index.ts +2 -0
- package/src/sdk/plugins/index.ts +5 -0
- package/src/sdk/plugins/plugins.ts +41 -0
- package/src/tests/utilities/structures.ts +25 -17
- package/src/threads/automation.ts +2 -2
- package/src/utilities/fileSystem/plugin.ts +13 -4
- package/src/watch.ts +2 -2
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.5.6-alpha.
|
|
4
|
+
"version": "2.5.6-alpha.4",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"license": "GPL-3.0",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
48
|
-
"@budibase/backend-core": "2.5.6-alpha.
|
|
49
|
-
"@budibase/client": "2.5.6-alpha.
|
|
50
|
-
"@budibase/pro": "2.5.6-alpha.
|
|
51
|
-
"@budibase/shared-core": "2.5.6-alpha.
|
|
52
|
-
"@budibase/string-templates": "2.5.6-alpha.
|
|
53
|
-
"@budibase/types": "2.5.6-alpha.
|
|
48
|
+
"@budibase/backend-core": "2.5.6-alpha.4",
|
|
49
|
+
"@budibase/client": "2.5.6-alpha.4",
|
|
50
|
+
"@budibase/pro": "2.5.6-alpha.4",
|
|
51
|
+
"@budibase/shared-core": "2.5.6-alpha.4",
|
|
52
|
+
"@budibase/string-templates": "2.5.6-alpha.4",
|
|
53
|
+
"@budibase/types": "2.5.6-alpha.4",
|
|
54
54
|
"@bull-board/api": "3.7.0",
|
|
55
55
|
"@bull-board/koa": "3.9.4",
|
|
56
56
|
"@elastic/elasticsearch": "7.10.0",
|
package/dist/sdk/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const datasources_1 = __importDefault(require("./app/datasources"));
|
|
|
11
11
|
const queries_1 = __importDefault(require("./app/queries"));
|
|
12
12
|
const rows_1 = __importDefault(require("./app/rows"));
|
|
13
13
|
const users_1 = __importDefault(require("./users"));
|
|
14
|
+
const plugins_1 = __importDefault(require("./plugins"));
|
|
14
15
|
const sdk = {
|
|
15
16
|
backups: backups_1.default,
|
|
16
17
|
tables: tables_1.default,
|
|
@@ -20,6 +21,7 @@ const sdk = {
|
|
|
20
21
|
users: users_1.default,
|
|
21
22
|
datasources: datasources_1.default,
|
|
22
23
|
queries: queries_1.default,
|
|
24
|
+
plugins: plugins_1.default,
|
|
23
25
|
};
|
|
24
26
|
// default export for TS
|
|
25
27
|
exports.default = sdk;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const plugins = __importStar(require("./plugins"));
|
|
27
|
+
exports.default = Object.assign({}, plugins);
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.processUploaded = exports.fetch = void 0;
|
|
16
|
+
const types_1 = require("@budibase/types");
|
|
17
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
18
|
+
const file_1 = require("../../api/controllers/plugin/file");
|
|
19
|
+
const environment_1 = __importDefault(require("../../environment"));
|
|
20
|
+
const websocket_1 = require("../../websocket");
|
|
21
|
+
const pro_1 = require("@budibase/pro");
|
|
22
|
+
function fetch(type) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const db = backend_core_1.tenancy.getGlobalDB();
|
|
25
|
+
const response = yield db.allDocs(backend_core_1.db.getPluginParams(null, {
|
|
26
|
+
include_docs: true,
|
|
27
|
+
}));
|
|
28
|
+
let plugins = response.rows.map((row) => row.doc);
|
|
29
|
+
plugins = backend_core_1.objectStore.enrichPluginURLs(plugins);
|
|
30
|
+
if (type) {
|
|
31
|
+
return plugins.filter((plugin) => { var _a; return ((_a = plugin.schema) === null || _a === void 0 ? void 0 : _a.type) === type; });
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return plugins;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.fetch = fetch;
|
|
39
|
+
function processUploaded(plugin, source) {
|
|
40
|
+
var _a;
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const { metadata, directory } = yield (0, file_1.fileUpload)(plugin);
|
|
43
|
+
backend_core_1.plugins.validate(metadata === null || metadata === void 0 ? void 0 : metadata.schema);
|
|
44
|
+
// Only allow components in cloud
|
|
45
|
+
if (!environment_1.default.SELF_HOSTED && ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.schema) === null || _a === void 0 ? void 0 : _a.type) !== types_1.PluginType.COMPONENT) {
|
|
46
|
+
throw new Error("Only component plugins are supported outside of self-host");
|
|
47
|
+
}
|
|
48
|
+
const doc = yield pro_1.sdk.plugins.storePlugin(metadata, directory, source);
|
|
49
|
+
websocket_1.ClientAppSocket.emit("plugin-update", { name: doc.name, hash: doc.hash });
|
|
50
|
+
return doc;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.processUploaded = processUploaded;
|
|
@@ -52,8 +52,8 @@ const string_templates_1 = require("@budibase/string-templates");
|
|
|
52
52
|
const fp_1 = require("lodash/fp");
|
|
53
53
|
const sdkUtils = __importStar(require("../sdk/utils"));
|
|
54
54
|
const environment_1 = __importDefault(require("../environment"));
|
|
55
|
-
const FILTER_STEP_ID = actions.
|
|
56
|
-
const LOOP_STEP_ID = actions.
|
|
55
|
+
const FILTER_STEP_ID = actions.BUILTIN_ACTION_DEFINITIONS.FILTER.stepId;
|
|
56
|
+
const LOOP_STEP_ID = actions.BUILTIN_ACTION_DEFINITIONS.LOOP.stepId;
|
|
57
57
|
const CRON_STEP_ID = triggerInfo_1.definitions.CRON.stepId;
|
|
58
58
|
const STOPPED_STATUS = { success: true, status: types_1.AutomationStatus.STOPPED };
|
|
59
59
|
function getLoopIterations(loopStep, input) {
|