@budibase/server 2.6.19-alpha.40 → 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 +36 -16
- package/dist/automation.js.map +3 -3
- package/dist/index.js +85 -49
- package/dist/index.js.map +3 -3
- package/dist/query.js +24 -14
- 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/query.js
CHANGED
|
@@ -1687,7 +1687,6 @@ var init_environment2 = __esm({
|
|
|
1687
1687
|
REDIS_URL: process.env.REDIS_URL || "localhost:6379",
|
|
1688
1688
|
REDIS_PASSWORD: process.env.REDIS_PASSWORD,
|
|
1689
1689
|
REDIS_CLUSTERED: process.env.REDIS_CLUSTERED,
|
|
1690
|
-
MOCK_REDIS: process.env.MOCK_REDIS,
|
|
1691
1690
|
MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
|
|
1692
1691
|
MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
|
|
1693
1692
|
AWS_REGION: process.env.AWS_REGION,
|
|
@@ -1714,6 +1713,7 @@ var init_environment2 = __esm({
|
|
|
1714
1713
|
GLOBAL_BUCKET_NAME: process.env.GLOBAL_BUCKET_NAME || DefaultBucketName.GLOBAL,
|
|
1715
1714
|
PLUGIN_BUCKET_NAME: process.env.PLUGIN_BUCKET_NAME || DefaultBucketName.PLUGINS,
|
|
1716
1715
|
USE_COUCH: process.env.USE_COUCH || true,
|
|
1716
|
+
MOCK_REDIS: process.env.MOCK_REDIS,
|
|
1717
1717
|
DEFAULT_LICENSE: process.env.DEFAULT_LICENSE,
|
|
1718
1718
|
SERVICE: process.env.SERVICE || "budibase",
|
|
1719
1719
|
LOG_LEVEL: process.env.LOG_LEVEL || "info",
|
|
@@ -2589,7 +2589,7 @@ function getRedisOptions() {
|
|
|
2589
2589
|
opts.port = port;
|
|
2590
2590
|
opts.password = password;
|
|
2591
2591
|
}
|
|
2592
|
-
return { opts, host, port, redisProtocolUrl };
|
|
2592
|
+
return { opts, host, port: parseInt(port), redisProtocolUrl };
|
|
2593
2593
|
}
|
|
2594
2594
|
function addDbPrefix(db, key) {
|
|
2595
2595
|
if (key.includes(db)) {
|
|
@@ -2698,6 +2698,7 @@ function connectionError(selectDb, timeout2, err) {
|
|
|
2698
2698
|
}, RETRY_PERIOD_MS);
|
|
2699
2699
|
}
|
|
2700
2700
|
function init2(selectDb = DEFAULT_SELECT_DB) {
|
|
2701
|
+
const RedisCore = environment_default2.MOCK_REDIS ? MockRedis : import_ioredis.default;
|
|
2701
2702
|
let timeout2;
|
|
2702
2703
|
CLOSED = false;
|
|
2703
2704
|
let client3 = pickClient(selectDb);
|
|
@@ -2705,7 +2706,7 @@ function init2(selectDb = DEFAULT_SELECT_DB) {
|
|
|
2705
2706
|
return;
|
|
2706
2707
|
}
|
|
2707
2708
|
if (environment_default2.MOCK_REDIS) {
|
|
2708
|
-
CLIENTS[selectDb] = new
|
|
2709
|
+
CLIENTS[selectDb] = new RedisCore(getRedisOptions());
|
|
2709
2710
|
}
|
|
2710
2711
|
timeout2 = setTimeout(() => {
|
|
2711
2712
|
if (!CONNECTED) {
|
|
@@ -2721,11 +2722,11 @@ function init2(selectDb = DEFAULT_SELECT_DB) {
|
|
|
2721
2722
|
}
|
|
2722
2723
|
const { redisProtocolUrl, opts, host, port } = getRedisOptions();
|
|
2723
2724
|
if (CLUSTERED) {
|
|
2724
|
-
client3 = new
|
|
2725
|
+
client3 = new RedisCore.Cluster([{ host, port }], opts);
|
|
2725
2726
|
} else if (redisProtocolUrl) {
|
|
2726
|
-
client3 = new
|
|
2727
|
+
client3 = new RedisCore(redisProtocolUrl);
|
|
2727
2728
|
} else {
|
|
2728
|
-
client3 = new
|
|
2729
|
+
client3 = new RedisCore(opts);
|
|
2729
2730
|
}
|
|
2730
2731
|
client3.on("end", (err) => {
|
|
2731
2732
|
if (environment_default2.isTest()) {
|
|
@@ -2789,13 +2790,14 @@ function promisifyStream(stream3, client3) {
|
|
|
2789
2790
|
});
|
|
2790
2791
|
});
|
|
2791
2792
|
}
|
|
2792
|
-
var
|
|
2793
|
+
var import_ioredis, MockRedis, RETRY_PERIOD_MS, STARTUP_TIMEOUT_MS, CLUSTERED, DEFAULT_SELECT_DB, CLOSED, CLIENTS, CONNECTED, RedisWrapper, redis_default;
|
|
2793
2794
|
var init_redis = __esm({
|
|
2794
2795
|
"../backend-core/src/redis/redis.ts"() {
|
|
2795
2796
|
init_environment2();
|
|
2797
|
+
import_ioredis = __toESM(require("ioredis"));
|
|
2796
2798
|
init_utils2();
|
|
2797
2799
|
init_timers2();
|
|
2798
|
-
|
|
2800
|
+
MockRedis = require("ioredis-mock");
|
|
2799
2801
|
RETRY_PERIOD_MS = 2e3;
|
|
2800
2802
|
STARTUP_TIMEOUT_MS = 5e3;
|
|
2801
2803
|
CLUSTERED = environment_default2.REDIS_CLUSTERED;
|
|
@@ -17797,7 +17799,7 @@ var firebase_default = {
|
|
|
17797
17799
|
|
|
17798
17800
|
// src/integrations/redis.ts
|
|
17799
17801
|
init_src();
|
|
17800
|
-
var
|
|
17802
|
+
var import_ioredis2 = __toESM(require("ioredis"));
|
|
17801
17803
|
var SCHEMA14 = {
|
|
17802
17804
|
docs: "https://redis.io/docs/",
|
|
17803
17805
|
description: "Redis is a caching tool, providing powerful key-value store capabilities.",
|
|
@@ -17878,7 +17880,7 @@ var SCHEMA14 = {
|
|
|
17878
17880
|
var RedisIntegration = class {
|
|
17879
17881
|
constructor(config) {
|
|
17880
17882
|
this.config = config;
|
|
17881
|
-
this.client = new
|
|
17883
|
+
this.client = new import_ioredis2.default({
|
|
17882
17884
|
host: this.config.host,
|
|
17883
17885
|
port: this.config.port,
|
|
17884
17886
|
username: this.config.username,
|
|
@@ -17942,7 +17944,13 @@ var RedisIntegration = class {
|
|
|
17942
17944
|
}
|
|
17943
17945
|
const pipeline = this.client.pipeline(pipelineCommands);
|
|
17944
17946
|
const result = await pipeline.exec();
|
|
17945
|
-
return result.map((output) =>
|
|
17947
|
+
return result == null ? void 0 : result.map((output) => {
|
|
17948
|
+
if (typeof output === "string") {
|
|
17949
|
+
return output;
|
|
17950
|
+
} else if (Array.isArray(output)) {
|
|
17951
|
+
return output[1];
|
|
17952
|
+
}
|
|
17953
|
+
});
|
|
17946
17954
|
});
|
|
17947
17955
|
}
|
|
17948
17956
|
};
|
|
@@ -20951,6 +20959,7 @@ init_src();
|
|
|
20951
20959
|
|
|
20952
20960
|
// ../pro/packages/pro/src/utilities/delay.ts
|
|
20953
20961
|
async function backOff(fn, errMsg) {
|
|
20962
|
+
let error;
|
|
20954
20963
|
let attempts = 5, success = false, response, first = true;
|
|
20955
20964
|
for (; attempts > 0; attempts--) {
|
|
20956
20965
|
try {
|
|
@@ -20962,10 +20971,11 @@ async function backOff(fn, errMsg) {
|
|
|
20962
20971
|
success = true;
|
|
20963
20972
|
break;
|
|
20964
20973
|
} catch (err) {
|
|
20974
|
+
error = err;
|
|
20965
20975
|
}
|
|
20966
20976
|
}
|
|
20967
20977
|
if (!success) {
|
|
20968
|
-
logging_exports.logAlert(`Failed to backoff`,
|
|
20978
|
+
logging_exports.logAlert(`Failed to backoff: ${errMsg}`, error);
|
|
20969
20979
|
}
|
|
20970
20980
|
return response;
|
|
20971
20981
|
}
|
|
@@ -23995,14 +24005,14 @@ async function fetch17(type) {
|
|
|
23995
24005
|
}
|
|
23996
24006
|
}
|
|
23997
24007
|
async function processUploaded(plugin, source) {
|
|
23998
|
-
var _a;
|
|
24008
|
+
var _a, _b;
|
|
23999
24009
|
const { metadata, directory } = await fileUpload(plugin);
|
|
24000
24010
|
plugin_exports.validate(metadata == null ? void 0 : metadata.schema);
|
|
24001
24011
|
if (!environment_default.SELF_HOSTED && ((_a = metadata == null ? void 0 : metadata.schema) == null ? void 0 : _a.type) !== "component" /* COMPONENT */) {
|
|
24002
24012
|
throw new Error("Only component plugins are supported outside of self-host");
|
|
24003
24013
|
}
|
|
24004
24014
|
const doc = await sdk_exports.plugins.storePlugin(metadata, directory, source);
|
|
24005
|
-
clientAppSocket.emit("plugin-update", { name: doc.name, hash: doc.hash });
|
|
24015
|
+
(_b = clientAppSocket) == null ? void 0 : _b.emit("plugin-update", { name: doc.name, hash: doc.hash });
|
|
24006
24016
|
return doc;
|
|
24007
24017
|
}
|
|
24008
24018
|
|