@budibase/server 1.3.15-alpha.0 → 1.3.15-alpha.3
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.b266d29f.js → index.e1d89439.js} +288 -288
- package/builder/assets/{index.f5c54dd2.css → index.ecdac070.css} +2 -2
- package/builder/index.html +2 -2
- package/coverage/clover.xml +21 -21
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/screen.js.html +5 -2
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +1 -1
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +1 -1
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +1 -1
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +34 -34
- package/dist/api/controllers/plugin/file.js +24 -0
- package/dist/api/controllers/plugin/github.js +69 -0
- package/dist/api/controllers/{plugin.js → plugin/index.js} +87 -14
- package/dist/api/controllers/plugin/npm.js +58 -0
- package/dist/api/controllers/plugin/uploaders.js +11 -0
- package/dist/api/controllers/plugin/url.js +24 -0
- package/dist/api/controllers/plugin/utils.js +26 -0
- package/dist/api/controllers/screen.js +1 -0
- package/dist/api/controllers/static/templates/preview.hbs +3 -1
- package/dist/api/routes/plugin.js +1 -0
- package/dist/app.js +2 -0
- package/dist/integrations/base/sqlTable.js +3 -1
- package/dist/package.json +7 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/index.js +56 -12
- package/dist/websocket.js +22 -0
- package/package.json +8 -7
- package/src/api/controllers/plugin/file.ts +15 -0
- package/src/api/controllers/plugin/github.ts +75 -0
- package/src/api/controllers/plugin/index.ts +206 -0
- package/src/api/controllers/plugin/npm.ts +56 -0
- package/src/api/controllers/plugin/uploaders.ts +4 -0
- package/src/api/controllers/plugin/url.ts +12 -0
- package/src/api/controllers/plugin/utils.ts +19 -0
- package/src/api/controllers/screen.js +1 -0
- package/src/api/controllers/static/templates/preview.hbs +3 -1
- package/src/api/routes/plugin.ts +1 -0
- package/src/app.ts +2 -0
- package/src/integrations/base/sqlTable.ts +3 -1
- package/src/module.d.ts +1 -0
- package/src/utilities/fileSystem/index.js +72 -12
- package/src/websocket.ts +26 -0
- package/src/api/controllers/plugin.ts +0 -110
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
exports.urlUpload = void 0;
|
|
13
|
+
const utils_1 = require("./utils");
|
|
14
|
+
const fileSystem_1 = require("../../../utilities/fileSystem");
|
|
15
|
+
function urlUpload(url, name = "", headers = {}) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
if (!url.includes(".tar.gz")) {
|
|
18
|
+
throw new Error("Plugin must be compressed into a gzipped tarball.");
|
|
19
|
+
}
|
|
20
|
+
const path = yield (0, utils_1.downloadUnzipTarball)(url, name, headers);
|
|
21
|
+
return yield (0, fileSystem_1.getPluginMetadata)(path);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports.urlUpload = urlUpload;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
exports.downloadUnzipTarball = void 0;
|
|
13
|
+
const fileSystem_1 = require("../../../utilities/fileSystem");
|
|
14
|
+
function downloadUnzipTarball(url, name, headers = {}) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
const path = (0, fileSystem_1.createTempFolder)(name);
|
|
18
|
+
yield (0, fileSystem_1.downloadTarballDirect)(url, path, headers);
|
|
19
|
+
return path;
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
throw new Error(e.message);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.downloadUnzipTarball = downloadUnzipTarball;
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
previewDevice,
|
|
68
68
|
navigation,
|
|
69
69
|
hiddenComponentIds,
|
|
70
|
-
usedPlugins
|
|
70
|
+
usedPlugins,
|
|
71
|
+
location
|
|
71
72
|
} = parsed
|
|
72
73
|
|
|
73
74
|
// Set some flags so the app knows we're in the builder
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
window["##BUDIBASE_PREVIEW_NAVIGATION##"] = navigation
|
|
84
85
|
window["##BUDIBASE_HIDDEN_COMPONENT_IDS##"] = hiddenComponentIds
|
|
85
86
|
window["##BUDIBASE_USED_PLUGINS##"] = usedPlugins
|
|
87
|
+
window["##BUDIBASE_LOCATION##"] = location
|
|
86
88
|
|
|
87
89
|
// Initialise app
|
|
88
90
|
try {
|
|
@@ -33,6 +33,7 @@ const permissions_1 = require("@budibase/backend-core/permissions");
|
|
|
33
33
|
const router = new router_1.default();
|
|
34
34
|
router
|
|
35
35
|
.post("/api/plugin/upload", (0, authorized_1.default)(permissions_1.BUILDER), controller.upload)
|
|
36
|
+
.post("/api/plugin", (0, authorized_1.default)(permissions_1.BUILDER), controller.create)
|
|
36
37
|
.get("/api/plugin", (0, authorized_1.default)(permissions_1.BUILDER), controller.fetch)
|
|
37
38
|
.delete("/api/plugin/:pluginId", (0, authorized_1.default)(permissions_1.BUILDER), controller.destroy);
|
|
38
39
|
exports.default = router;
|
package/dist/app.js
CHANGED
|
@@ -66,6 +66,7 @@ const migrations = __importStar(require("./migrations"));
|
|
|
66
66
|
const backend_core_1 = require("@budibase/backend-core");
|
|
67
67
|
const workerRequests_1 = require("./utilities/workerRequests");
|
|
68
68
|
const watch_1 = require("./watch");
|
|
69
|
+
const websocket_1 = require("./websocket");
|
|
69
70
|
const app = new Koa();
|
|
70
71
|
// set up top level koa middleware
|
|
71
72
|
app.use(koaBody({
|
|
@@ -99,6 +100,7 @@ if (env.isProd()) {
|
|
|
99
100
|
}
|
|
100
101
|
const server = http.createServer(app.callback());
|
|
101
102
|
destroyable(server);
|
|
103
|
+
(0, websocket_1.initialise)(server);
|
|
102
104
|
let shuttingDown = false, errCode = 0;
|
|
103
105
|
server.on("close", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
104
106
|
// already in process
|
|
@@ -82,7 +82,9 @@ function generateSchema(schema, table, tables, oldTable = null, renamed) {
|
|
|
82
82
|
// need to check if any columns have been deleted
|
|
83
83
|
if (oldTable) {
|
|
84
84
|
const deletedColumns = Object.entries(oldTable.schema)
|
|
85
|
-
.filter(([key, schema]) => schema.type !== FieldTypes.LINK &&
|
|
85
|
+
.filter(([key, schema]) => schema.type !== FieldTypes.LINK &&
|
|
86
|
+
schema.type !== FieldTypes.FORMULA &&
|
|
87
|
+
table.schema[key] == null)
|
|
86
88
|
.map(([key]) => key);
|
|
87
89
|
deletedColumns.forEach(key => {
|
|
88
90
|
if ((renamed === null || renamed === void 0 ? void 0 : renamed.old) === key) {
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.15-alpha.2",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"license": "GPL-3.0",
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
80
|
-
"@budibase/backend-core": "
|
|
81
|
-
"@budibase/client": "
|
|
82
|
-
"@budibase/pro": "1.3.
|
|
83
|
-
"@budibase/string-templates": "
|
|
84
|
-
"@budibase/types": "
|
|
80
|
+
"@budibase/backend-core": "1.3.15-alpha.2",
|
|
81
|
+
"@budibase/client": "1.3.15-alpha.2",
|
|
82
|
+
"@budibase/pro": "1.3.15-alpha.2",
|
|
83
|
+
"@budibase/string-templates": "1.3.15-alpha.2",
|
|
84
|
+
"@budibase/types": "1.3.15-alpha.2",
|
|
85
85
|
"@bull-board/api": "3.7.0",
|
|
86
86
|
"@bull-board/koa": "3.9.4",
|
|
87
87
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -139,6 +139,7 @@
|
|
|
139
139
|
"redis": "4",
|
|
140
140
|
"server-destroy": "1.0.1",
|
|
141
141
|
"snowflake-promise": "^4.5.0",
|
|
142
|
+
"socket.io": "^4.5.1",
|
|
142
143
|
"svelte": "3.49.0",
|
|
143
144
|
"swagger-parser": "10.0.3",
|
|
144
145
|
"tar": "6.1.11",
|