@budibase/server 2.6.19-alpha.41 → 2.6.19-alpha.42
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/dist/automation.js +33 -15
- package/dist/automation.js.map +3 -3
- package/dist/index.js +82 -48
- package/dist/index.js.map +3 -3
- package/dist/query.js +21 -13
- package/dist/query.js.map +3 -3
- package/package.json +9 -10
- package/src/api/controllers/datasource.ts +24 -18
- package/src/api/controllers/plugin/index.ts +1 -1
- package/src/api/controllers/table/index.ts +2 -2
- package/src/api/controllers/view/index.ts +2 -2
- package/src/api/routes/datasource.ts +2 -2
- package/src/api/routes/tests/view.spec.js +4 -3
- package/src/integration-test/postgres.spec.ts +5 -5
- package/src/integrations/redis.ts +7 -1
- package/src/sdk/plugins/plugins.ts +1 -1
- package/src/threads/automation.ts +9 -1
- package/src/utilities/redis.ts +9 -4
- package/src/websockets/builder.ts +4 -4
- package/src/websockets/index.ts +10 -6
package/dist/automation.js
CHANGED
|
@@ -1795,7 +1795,6 @@ var init_environment3 = __esm({
|
|
|
1795
1795
|
REDIS_URL: process.env.REDIS_URL || "localhost:6379",
|
|
1796
1796
|
REDIS_PASSWORD: process.env.REDIS_PASSWORD,
|
|
1797
1797
|
REDIS_CLUSTERED: process.env.REDIS_CLUSTERED,
|
|
1798
|
-
MOCK_REDIS: process.env.MOCK_REDIS,
|
|
1799
1798
|
MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
|
|
1800
1799
|
MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
|
|
1801
1800
|
AWS_REGION: process.env.AWS_REGION,
|
|
@@ -1822,6 +1821,7 @@ var init_environment3 = __esm({
|
|
|
1822
1821
|
GLOBAL_BUCKET_NAME: process.env.GLOBAL_BUCKET_NAME || DefaultBucketName.GLOBAL,
|
|
1823
1822
|
PLUGIN_BUCKET_NAME: process.env.PLUGIN_BUCKET_NAME || DefaultBucketName.PLUGINS,
|
|
1824
1823
|
USE_COUCH: process.env.USE_COUCH || true,
|
|
1824
|
+
MOCK_REDIS: process.env.MOCK_REDIS,
|
|
1825
1825
|
DEFAULT_LICENSE: process.env.DEFAULT_LICENSE,
|
|
1826
1826
|
SERVICE: process.env.SERVICE || "budibase",
|
|
1827
1827
|
LOG_LEVEL: process.env.LOG_LEVEL || "info",
|
|
@@ -2697,7 +2697,7 @@ function getRedisOptions() {
|
|
|
2697
2697
|
opts.port = port;
|
|
2698
2698
|
opts.password = password;
|
|
2699
2699
|
}
|
|
2700
|
-
return { opts, host, port, redisProtocolUrl };
|
|
2700
|
+
return { opts, host, port: parseInt(port), redisProtocolUrl };
|
|
2701
2701
|
}
|
|
2702
2702
|
function addDbPrefix(db2, key) {
|
|
2703
2703
|
if (key.includes(db2)) {
|
|
@@ -2806,6 +2806,7 @@ function connectionError(selectDb, timeout2, err) {
|
|
|
2806
2806
|
}, RETRY_PERIOD_MS);
|
|
2807
2807
|
}
|
|
2808
2808
|
function init2(selectDb = DEFAULT_SELECT_DB) {
|
|
2809
|
+
const RedisCore = environment_default2.MOCK_REDIS ? MockRedis : import_ioredis.default;
|
|
2809
2810
|
let timeout2;
|
|
2810
2811
|
CLOSED = false;
|
|
2811
2812
|
let client3 = pickClient(selectDb);
|
|
@@ -2813,7 +2814,7 @@ function init2(selectDb = DEFAULT_SELECT_DB) {
|
|
|
2813
2814
|
return;
|
|
2814
2815
|
}
|
|
2815
2816
|
if (environment_default2.MOCK_REDIS) {
|
|
2816
|
-
CLIENTS[selectDb] = new
|
|
2817
|
+
CLIENTS[selectDb] = new RedisCore(getRedisOptions());
|
|
2817
2818
|
}
|
|
2818
2819
|
timeout2 = setTimeout(() => {
|
|
2819
2820
|
if (!CONNECTED) {
|
|
@@ -2829,11 +2830,11 @@ function init2(selectDb = DEFAULT_SELECT_DB) {
|
|
|
2829
2830
|
}
|
|
2830
2831
|
const { redisProtocolUrl, opts, host, port } = getRedisOptions();
|
|
2831
2832
|
if (CLUSTERED) {
|
|
2832
|
-
client3 = new
|
|
2833
|
+
client3 = new RedisCore.Cluster([{ host, port }], opts);
|
|
2833
2834
|
} else if (redisProtocolUrl) {
|
|
2834
|
-
client3 = new
|
|
2835
|
+
client3 = new RedisCore(redisProtocolUrl);
|
|
2835
2836
|
} else {
|
|
2836
|
-
client3 = new
|
|
2837
|
+
client3 = new RedisCore(opts);
|
|
2837
2838
|
}
|
|
2838
2839
|
client3.on("end", (err) => {
|
|
2839
2840
|
if (environment_default2.isTest()) {
|
|
@@ -2897,13 +2898,14 @@ function promisifyStream(stream3, client3) {
|
|
|
2897
2898
|
});
|
|
2898
2899
|
});
|
|
2899
2900
|
}
|
|
2900
|
-
var
|
|
2901
|
+
var import_ioredis, MockRedis, RETRY_PERIOD_MS, STARTUP_TIMEOUT_MS, CLUSTERED, DEFAULT_SELECT_DB, CLOSED, CLIENTS, CONNECTED, RedisWrapper, redis_default;
|
|
2901
2902
|
var init_redis = __esm({
|
|
2902
2903
|
"../backend-core/src/redis/redis.ts"() {
|
|
2903
2904
|
init_environment3();
|
|
2905
|
+
import_ioredis = __toESM(require("ioredis"));
|
|
2904
2906
|
init_utils2();
|
|
2905
2907
|
init_timers2();
|
|
2906
|
-
|
|
2908
|
+
MockRedis = require("ioredis-mock");
|
|
2907
2909
|
RETRY_PERIOD_MS = 2e3;
|
|
2908
2910
|
STARTUP_TIMEOUT_MS = 5e3;
|
|
2909
2911
|
CLUSTERED = environment_default2.REDIS_CLUSTERED;
|
|
@@ -11524,6 +11526,7 @@ var init_src2 = __esm({
|
|
|
11524
11526
|
init_cache();
|
|
11525
11527
|
init_objectStore2();
|
|
11526
11528
|
init_redis2();
|
|
11529
|
+
init_redis2();
|
|
11527
11530
|
init_redlockImpl();
|
|
11528
11531
|
init_utils5();
|
|
11529
11532
|
init_errors3();
|
|
@@ -24390,11 +24393,11 @@ var init_firebase = __esm({
|
|
|
24390
24393
|
});
|
|
24391
24394
|
|
|
24392
24395
|
// src/integrations/redis.ts
|
|
24393
|
-
var
|
|
24396
|
+
var import_ioredis2, SCHEMA14, RedisIntegration, redis_default2;
|
|
24394
24397
|
var init_redis4 = __esm({
|
|
24395
24398
|
"src/integrations/redis.ts"() {
|
|
24396
24399
|
init_src();
|
|
24397
|
-
|
|
24400
|
+
import_ioredis2 = __toESM(require("ioredis"));
|
|
24398
24401
|
SCHEMA14 = {
|
|
24399
24402
|
docs: "https://redis.io/docs/",
|
|
24400
24403
|
description: "Redis is a caching tool, providing powerful key-value store capabilities.",
|
|
@@ -24475,7 +24478,7 @@ var init_redis4 = __esm({
|
|
|
24475
24478
|
RedisIntegration = class {
|
|
24476
24479
|
constructor(config) {
|
|
24477
24480
|
this.config = config;
|
|
24478
|
-
this.client = new
|
|
24481
|
+
this.client = new import_ioredis2.default({
|
|
24479
24482
|
host: this.config.host,
|
|
24480
24483
|
port: this.config.port,
|
|
24481
24484
|
username: this.config.username,
|
|
@@ -24539,7 +24542,13 @@ var init_redis4 = __esm({
|
|
|
24539
24542
|
}
|
|
24540
24543
|
const pipeline = this.client.pipeline(pipelineCommands);
|
|
24541
24544
|
const result = await pipeline.exec();
|
|
24542
|
-
return result.map((output) =>
|
|
24545
|
+
return result == null ? void 0 : result.map((output) => {
|
|
24546
|
+
if (typeof output === "string") {
|
|
24547
|
+
return output;
|
|
24548
|
+
} else if (Array.isArray(output)) {
|
|
24549
|
+
return output[1];
|
|
24550
|
+
}
|
|
24551
|
+
});
|
|
24543
24552
|
});
|
|
24544
24553
|
}
|
|
24545
24554
|
};
|
|
@@ -25990,6 +25999,7 @@ var init_redis5 = __esm({
|
|
|
25990
25999
|
"src/utilities/redis.ts"() {
|
|
25991
26000
|
init_src2();
|
|
25992
26001
|
init_utils13();
|
|
26002
|
+
init_environment();
|
|
25993
26003
|
}
|
|
25994
26004
|
});
|
|
25995
26005
|
|
|
@@ -26361,6 +26371,7 @@ var init_websockets = __esm({
|
|
|
26361
26371
|
init_client2();
|
|
26362
26372
|
init_grid();
|
|
26363
26373
|
init_builder2();
|
|
26374
|
+
init_environment();
|
|
26364
26375
|
}
|
|
26365
26376
|
});
|
|
26366
26377
|
|
|
@@ -26389,14 +26400,14 @@ async function fetch16(type) {
|
|
|
26389
26400
|
}
|
|
26390
26401
|
}
|
|
26391
26402
|
async function processUploaded(plugin, source) {
|
|
26392
|
-
var _a;
|
|
26403
|
+
var _a, _b;
|
|
26393
26404
|
const { metadata, directory } = await fileUpload(plugin);
|
|
26394
26405
|
plugin_exports.validate(metadata == null ? void 0 : metadata.schema);
|
|
26395
26406
|
if (!environment_default.SELF_HOSTED && ((_a = metadata == null ? void 0 : metadata.schema) == null ? void 0 : _a.type) !== "component" /* COMPONENT */) {
|
|
26396
26407
|
throw new Error("Only component plugins are supported outside of self-host");
|
|
26397
26408
|
}
|
|
26398
26409
|
const doc = await sdk_exports.plugins.storePlugin(metadata, directory, source);
|
|
26399
|
-
clientAppSocket.emit("plugin-update", { name: doc.name, hash: doc.hash });
|
|
26410
|
+
(_b = clientAppSocket) == null ? void 0 : _b.emit("plugin-update", { name: doc.name, hash: doc.hash });
|
|
26400
26411
|
return doc;
|
|
26401
26412
|
}
|
|
26402
26413
|
var init_plugins4 = __esm({
|
|
@@ -32042,10 +32053,17 @@ function getLoopIterations(loopStep) {
|
|
|
32042
32053
|
if (!binding) {
|
|
32043
32054
|
return 0;
|
|
32044
32055
|
}
|
|
32056
|
+
const isString = typeof binding === "string";
|
|
32057
|
+
try {
|
|
32058
|
+
if (isString) {
|
|
32059
|
+
binding = JSON.parse(binding);
|
|
32060
|
+
}
|
|
32061
|
+
} catch (err) {
|
|
32062
|
+
}
|
|
32045
32063
|
if (Array.isArray(binding)) {
|
|
32046
32064
|
return binding.length;
|
|
32047
32065
|
}
|
|
32048
|
-
if (
|
|
32066
|
+
if (isString) {
|
|
32049
32067
|
return stringSplit(binding).length;
|
|
32050
32068
|
}
|
|
32051
32069
|
return 0;
|