@budibase/server 2.5.5 → 2.5.6-alpha.10
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.5c1a6913.js +1776 -0
- package/builder/assets/index.c0265b74.css +6 -0
- package/builder/index.html +2 -2
- package/dist/api/controllers/automation.js +13 -7
- package/dist/api/controllers/ops.js +40 -0
- package/dist/api/controllers/plugin/index.js +6 -37
- package/dist/api/controllers/table/utils.js +2 -1
- package/dist/api/controllers/user.js +1 -83
- package/dist/api/routes/index.js +2 -0
- package/dist/api/routes/ops.js +52 -0
- package/dist/api/routes/user.js +0 -1
- package/dist/app.js +4 -13
- 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/environment.js +0 -1
- package/dist/events/docUpdates/index.js +17 -0
- package/dist/events/docUpdates/processors.js +18 -0
- package/dist/events/docUpdates/syncUsers.js +49 -0
- package/dist/events/index.js +3 -0
- package/dist/integrations/index.js +3 -3
- package/dist/integrations/microsoftSqlServer.js +5 -2
- package/dist/integrations/mysql.js +5 -3
- package/dist/integrations/postgres.js +7 -5
- package/dist/integrations/redis.js +7 -0
- package/dist/integrations/rest.js +4 -0
- package/dist/migrations/functions/usageQuotas/syncApps.js +1 -1
- package/dist/migrations/functions/usageQuotas/syncRows.js +1 -2
- package/dist/package.json +15 -15
- package/dist/sdk/app/applications/sync.js +117 -23
- 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/sdk/users/utils.js +21 -4
- package/dist/startup.js +31 -28
- package/dist/threads/automation.js +16 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/plugin.js +33 -23
- package/dist/utilities/global.js +17 -12
- package/dist/watch.js +2 -2
- package/dist/websockets/client.js +14 -0
- package/dist/websockets/grid.js +60 -0
- package/dist/websockets/index.js +17 -0
- package/dist/websockets/websocket.js +78 -0
- package/jest.config.ts +3 -3
- package/nodemon.json +7 -3
- package/package.json +16 -16
- package/scripts/dev/manage.js +2 -0
- package/scripts/integrations/mssql/data/entrypoint.sh +1 -0
- package/scripts/integrations/mssql/data/setup.sql +17 -17
- package/scripts/integrations/mysql/init.sql +1 -1
- package/scripts/integrations/postgres/init.sql +1 -0
- package/src/api/controllers/automation.ts +12 -6
- package/src/api/controllers/ops.ts +32 -0
- package/src/api/controllers/plugin/index.ts +8 -45
- package/src/api/controllers/row/internal.ts +9 -10
- package/src/api/controllers/row/utils.ts +2 -2
- package/src/api/controllers/table/utils.ts +2 -1
- package/src/api/controllers/user.ts +10 -96
- package/src/api/routes/index.ts +2 -0
- package/src/api/routes/ops.ts +30 -0
- package/src/api/routes/tests/automation.spec.js +7 -4
- package/src/api/routes/tests/user.spec.js +48 -37
- package/src/api/routes/user.ts +0 -5
- package/src/app.ts +4 -15
- 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/environment.ts +0 -1
- package/src/events/docUpdates/index.ts +1 -0
- package/src/events/docUpdates/processors.ts +14 -0
- package/src/events/docUpdates/syncUsers.ts +35 -0
- package/src/events/index.ts +1 -0
- package/src/integrations/index.ts +3 -3
- package/src/integrations/microsoftSqlServer.ts +5 -2
- package/src/integrations/mysql.ts +5 -3
- package/src/integrations/postgres.ts +7 -5
- package/src/integrations/redis.ts +8 -0
- package/src/integrations/rest.ts +3 -0
- package/src/migrations/functions/usageQuotas/syncApps.ts +1 -1
- package/src/migrations/functions/usageQuotas/syncRows.ts +2 -3
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +2 -2
- package/src/sdk/app/applications/sync.ts +129 -22
- package/src/sdk/app/applications/tests/sync.spec.ts +137 -0
- 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/sdk/users/tests/utils.spec.ts +1 -32
- package/src/sdk/users/utils.ts +23 -5
- package/src/startup.ts +36 -34
- package/src/tests/jestEnv.ts +0 -1
- package/src/tests/jestSetup.ts +0 -1
- package/src/tests/utilities/TestConfiguration.ts +28 -0
- package/src/tests/utilities/structures.ts +25 -17
- package/src/threads/automation.ts +18 -6
- package/src/utilities/fileSystem/plugin.ts +13 -4
- package/src/utilities/global.ts +21 -16
- package/src/watch.ts +2 -2
- package/src/websockets/client.ts +11 -0
- package/src/websockets/grid.ts +55 -0
- package/src/websockets/index.ts +14 -0
- package/src/websockets/websocket.ts +83 -0
- package/tsconfig.json +1 -7
- package/builder/assets/index.7f9a008b.css +0 -6
- package/builder/assets/index.f493a2b3.js +0 -1817
- package/dist/elasticApm.js +0 -14
- package/dist/websocket.js +0 -22
- package/scripts/likeCypress.ts +0 -35
- package/src/elasticApm.ts +0 -10
- package/src/tests/logging.ts +0 -34
- package/src/websocket.ts +0 -26
package/dist/elasticApm.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const elastic_apm_node_1 = __importDefault(require("elastic-apm-node"));
|
|
7
|
-
// enable APM if configured
|
|
8
|
-
if (process.env.ELASTIC_APM_ENABLED) {
|
|
9
|
-
console.log("Starting elastic-apm-node");
|
|
10
|
-
elastic_apm_node_1.default.start({
|
|
11
|
-
serviceName: process.env.SERVICE,
|
|
12
|
-
environment: process.env.BUDIBASE_ENVIRONMENT,
|
|
13
|
-
});
|
|
14
|
-
}
|
package/dist/websocket.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClientAppSocket = exports.initialise = void 0;
|
|
4
|
-
const socket_io_1 = require("socket.io");
|
|
5
|
-
class Websocket {
|
|
6
|
-
constructor(server, path) {
|
|
7
|
-
this.socketServer = new socket_io_1.Server(server, {
|
|
8
|
-
path,
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
// Emit an event to all sockets
|
|
12
|
-
emit(event, payload) {
|
|
13
|
-
this.socketServer.sockets.emit(event, payload);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
// Likely to be more socket instances in future
|
|
17
|
-
let ClientAppSocket;
|
|
18
|
-
exports.ClientAppSocket = ClientAppSocket;
|
|
19
|
-
const initialise = (server) => {
|
|
20
|
-
exports.ClientAppSocket = ClientAppSocket = new Websocket(server, "/socket/client");
|
|
21
|
-
};
|
|
22
|
-
exports.initialise = initialise;
|
package/scripts/likeCypress.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/******************************************************
|
|
2
|
-
* This script just makes it easy to re-create *
|
|
3
|
-
* a cypress like environment for testing the backend *
|
|
4
|
-
******************************************************/
|
|
5
|
-
import path from "path"
|
|
6
|
-
const tmpdir = path.join(require("os").tmpdir(), ".budibase")
|
|
7
|
-
|
|
8
|
-
const SERVER_PORT = "4100"
|
|
9
|
-
const WORKER_PORT = "4200"
|
|
10
|
-
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
process.env.NODE_ENV = "cypress"
|
|
13
|
-
process.env.ENABLE_ANALYTICS = "0"
|
|
14
|
-
process.env.JWT_SECRET = "budibase"
|
|
15
|
-
process.env.COUCH_URL = `leveldb://${tmpdir}/.data/`
|
|
16
|
-
process.env.SELF_HOSTED = "1"
|
|
17
|
-
process.env.WORKER_URL = `http://localhost:${WORKER_PORT}/`
|
|
18
|
-
process.env.MINIO_URL = `http://localhost:4004`
|
|
19
|
-
process.env.MINIO_ACCESS_KEY = "budibase"
|
|
20
|
-
process.env.MINIO_SECRET_KEY = "budibase"
|
|
21
|
-
process.env.COUCH_DB_USER = "budibase"
|
|
22
|
-
process.env.COUCH_DB_PASSWORD = "budibase"
|
|
23
|
-
process.env.INTERNAL_API_KEY = "budibase"
|
|
24
|
-
process.env.ALLOW_DEV_AUTOMATIONS = "1"
|
|
25
|
-
|
|
26
|
-
// don't make this a variable or top level require
|
|
27
|
-
// it will cause environment module to be loaded prematurely
|
|
28
|
-
|
|
29
|
-
// override the port with the worker port temporarily
|
|
30
|
-
process.env.PORT = WORKER_PORT
|
|
31
|
-
const worker = require("../../worker/src/index")
|
|
32
|
-
|
|
33
|
-
// override the port with the server port
|
|
34
|
-
process.env.PORT = SERVER_PORT
|
|
35
|
-
const server = require("../src/app")
|
package/src/elasticApm.ts
DELETED
package/src/tests/logging.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export enum LogLevel {
|
|
2
|
-
TRACE = "trace",
|
|
3
|
-
DEBUG = "debug",
|
|
4
|
-
INFO = "info",
|
|
5
|
-
WARN = "warn",
|
|
6
|
-
ERROR = "error",
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const LOG_INDEX: { [key in LogLevel]: number } = {
|
|
10
|
-
[LogLevel.TRACE]: 1,
|
|
11
|
-
[LogLevel.DEBUG]: 2,
|
|
12
|
-
[LogLevel.INFO]: 3,
|
|
13
|
-
[LogLevel.WARN]: 4,
|
|
14
|
-
[LogLevel.ERROR]: 5,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const setIndex = LOG_INDEX[process.env.LOG_LEVEL as LogLevel]
|
|
18
|
-
|
|
19
|
-
if (setIndex > LOG_INDEX.trace) {
|
|
20
|
-
global.console.trace = jest.fn()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (setIndex > LOG_INDEX.debug) {
|
|
24
|
-
global.console.debug = jest.fn()
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (setIndex > LOG_INDEX.info) {
|
|
28
|
-
global.console.info = jest.fn()
|
|
29
|
-
global.console.log = jest.fn()
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (setIndex > LOG_INDEX.warn) {
|
|
33
|
-
global.console.warn = jest.fn()
|
|
34
|
-
}
|
package/src/websocket.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Server } from "socket.io"
|
|
2
|
-
import http from "http"
|
|
3
|
-
|
|
4
|
-
class Websocket {
|
|
5
|
-
socketServer: Server
|
|
6
|
-
|
|
7
|
-
constructor(server: http.Server, path: string) {
|
|
8
|
-
this.socketServer = new Server(server, {
|
|
9
|
-
path,
|
|
10
|
-
})
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Emit an event to all sockets
|
|
14
|
-
emit(event: string, payload: any) {
|
|
15
|
-
this.socketServer.sockets.emit(event, payload)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Likely to be more socket instances in future
|
|
20
|
-
let ClientAppSocket: Websocket
|
|
21
|
-
|
|
22
|
-
export const initialise = (server: http.Server) => {
|
|
23
|
-
ClientAppSocket = new Websocket(server, "/socket/client")
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { ClientAppSocket }
|