@budibase/server 2.5.5-alpha.4 → 2.5.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.841e62d8.css → index.7f9a008b.css} +3 -3
- package/builder/assets/index.f493a2b3.js +1817 -0
- package/builder/index.html +2 -2
- package/dist/api/routes/index.js +0 -2
- package/dist/app.js +11 -2
- package/dist/elasticApm.js +14 -0
- package/dist/environment.js +1 -0
- package/dist/integrations/microsoftSqlServer.js +2 -5
- package/dist/integrations/mysql.js +3 -5
- package/dist/integrations/postgres.js +5 -7
- package/dist/integrations/redis.js +0 -7
- package/dist/integrations/rest.js +0 -4
- package/dist/migrations/functions/usageQuotas/syncApps.js +1 -1
- package/dist/migrations/functions/usageQuotas/syncRows.js +2 -1
- package/dist/package.json +14 -13
- package/dist/startup.js +27 -29
- package/dist/threads/automation.js +3 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +15 -14
- package/scripts/dev/manage.js +0 -2
- package/scripts/integrations/mssql/data/entrypoint.sh +0 -1
- package/scripts/integrations/mssql/data/setup.sql +17 -17
- package/scripts/integrations/mysql/init.sql +1 -1
- package/scripts/integrations/postgres/init.sql +0 -1
- package/scripts/likeCypress.ts +35 -0
- package/src/api/routes/index.ts +0 -2
- package/src/api/routes/tests/automation.spec.js +2 -5
- package/src/api/routes/tests/user.spec.js +13 -61
- package/src/app.ts +13 -2
- package/src/elasticApm.ts +10 -0
- package/src/environment.ts +1 -0
- package/src/integrations/microsoftSqlServer.ts +2 -5
- package/src/integrations/mysql.ts +3 -5
- package/src/integrations/postgres.ts +5 -7
- package/src/integrations/redis.ts +0 -8
- package/src/integrations/rest.ts +0 -3
- package/src/migrations/functions/usageQuotas/syncApps.ts +1 -1
- package/src/migrations/functions/usageQuotas/syncRows.ts +3 -2
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +2 -2
- package/src/startup.ts +33 -34
- package/src/tests/jestEnv.ts +1 -0
- package/src/tests/jestSetup.ts +1 -0
- package/src/tests/logging.ts +34 -0
- package/src/threads/automation.ts +4 -16
- package/builder/assets/index.c176beea.js +0 -1776
- package/dist/api/controllers/ops.js +0 -40
- package/dist/api/routes/ops.js +0 -52
- package/src/api/controllers/ops.ts +0 -32
- package/src/api/routes/ops.ts +0 -30
|
@@ -1,40 +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
|
-
exports.error = exports.alert = exports.log = void 0;
|
|
13
|
-
const backend_core_1 = require("@budibase/backend-core");
|
|
14
|
-
function log(ctx) {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const body = ctx.request.body;
|
|
17
|
-
console.trace(body.message, body.data);
|
|
18
|
-
console.debug(body.message, body.data);
|
|
19
|
-
console.info(body.message, body.data);
|
|
20
|
-
console.warn(body.message, body.data);
|
|
21
|
-
console.error(body.message, body.data);
|
|
22
|
-
ctx.status = 204;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
exports.log = log;
|
|
26
|
-
function alert(ctx) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const body = ctx.request.body;
|
|
29
|
-
backend_core_1.logging.logAlert(body.message, new Error(body.message));
|
|
30
|
-
ctx.status = 204;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
exports.alert = alert;
|
|
34
|
-
function error(ctx) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const body = ctx.request.body;
|
|
37
|
-
throw new Error(body.message);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
exports.error = error;
|
package/dist/api/routes/ops.js
DELETED
|
@@ -1,52 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.errorValidator = exports.logsValidator = void 0;
|
|
30
|
-
const router_1 = __importDefault(require("@koa/router"));
|
|
31
|
-
const controller = __importStar(require("../controllers/ops"));
|
|
32
|
-
const backend_core_1 = require("@budibase/backend-core");
|
|
33
|
-
const joi_1 = __importDefault(require("joi"));
|
|
34
|
-
function logsValidator() {
|
|
35
|
-
return backend_core_1.middleware.joiValidator.body(joi_1.default.object({
|
|
36
|
-
message: joi_1.default.string().required(),
|
|
37
|
-
data: joi_1.default.object(),
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
exports.logsValidator = logsValidator;
|
|
41
|
-
function errorValidator() {
|
|
42
|
-
return backend_core_1.middleware.joiValidator.body(joi_1.default.object({
|
|
43
|
-
message: joi_1.default.string().required(),
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
exports.errorValidator = errorValidator;
|
|
47
|
-
const router = new router_1.default();
|
|
48
|
-
router
|
|
49
|
-
.post("/api/ops/log", logsValidator(), controller.log)
|
|
50
|
-
.post("/api/ops/error", errorValidator(), controller.error)
|
|
51
|
-
.post("/api/ops/alert", errorValidator(), controller.alert);
|
|
52
|
-
exports.default = router;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Ctx } from "@budibase/types"
|
|
2
|
-
import { logging } from "@budibase/backend-core"
|
|
3
|
-
|
|
4
|
-
interface LogRequest {
|
|
5
|
-
message: string
|
|
6
|
-
data?: any
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface ErrorRequest {
|
|
10
|
-
message: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export async function log(ctx: Ctx<LogRequest>) {
|
|
14
|
-
const body = ctx.request.body
|
|
15
|
-
console.trace(body.message, body.data)
|
|
16
|
-
console.debug(body.message, body.data)
|
|
17
|
-
console.info(body.message, body.data)
|
|
18
|
-
console.warn(body.message, body.data)
|
|
19
|
-
console.error(body.message, body.data)
|
|
20
|
-
ctx.status = 204
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export async function alert(ctx: Ctx<ErrorRequest>) {
|
|
24
|
-
const body = ctx.request.body
|
|
25
|
-
logging.logAlert(body.message, new Error(body.message))
|
|
26
|
-
ctx.status = 204
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function error(ctx: Ctx<ErrorRequest>) {
|
|
30
|
-
const body = ctx.request.body
|
|
31
|
-
throw new Error(body.message)
|
|
32
|
-
}
|
package/src/api/routes/ops.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import Router from "@koa/router"
|
|
2
|
-
import * as controller from "../controllers/ops"
|
|
3
|
-
import { middleware } from "@budibase/backend-core"
|
|
4
|
-
import Joi from "joi"
|
|
5
|
-
|
|
6
|
-
export function logsValidator() {
|
|
7
|
-
return middleware.joiValidator.body(
|
|
8
|
-
Joi.object({
|
|
9
|
-
message: Joi.string().required(),
|
|
10
|
-
data: Joi.object(),
|
|
11
|
-
})
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function errorValidator() {
|
|
16
|
-
return middleware.joiValidator.body(
|
|
17
|
-
Joi.object({
|
|
18
|
-
message: Joi.string().required(),
|
|
19
|
-
})
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const router: Router = new Router()
|
|
24
|
-
|
|
25
|
-
router
|
|
26
|
-
.post("/api/ops/log", logsValidator(), controller.log)
|
|
27
|
-
.post("/api/ops/error", errorValidator(), controller.error)
|
|
28
|
-
.post("/api/ops/alert", errorValidator(), controller.alert)
|
|
29
|
-
|
|
30
|
-
export default router
|