@budibase/backend-core 2.19.4 → 2.19.6

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/index.js CHANGED
@@ -54531,6 +54531,7 @@ var AutomationActionStepId = /* @__PURE__ */ ((AutomationActionStepId2) => {
54531
54531
  AutomationActionStepId2["slack"] = "slack";
54532
54532
  AutomationActionStepId2["zapier"] = "zapier";
54533
54533
  AutomationActionStepId2["integromat"] = "integromat";
54534
+ AutomationActionStepId2["n8n"] = "n8n";
54534
54535
  return AutomationActionStepId2;
54535
54536
  })(AutomationActionStepId || {});
54536
54537
  var AutomationStepIdArray = [
@@ -54706,6 +54707,7 @@ var Header = /* @__PURE__ */ ((Header2) => {
54706
54707
  Header2["CORRELATION_ID"] = "x-budibase-correlation-id";
54707
54708
  Header2["AUTHORIZATION"] = "authorization";
54708
54709
  Header2["MIGRATING_APP"] = "x-budibase-migrating-app";
54710
+ Header2["COOKIE"] = "cookie";
54709
54711
  return Header2;
54710
54712
  })(Header || {});
54711
54713
 
@@ -54781,6 +54783,7 @@ var NoEmptyFilterStrings = [
54781
54783
  var utils_exports = {};
54782
54784
  __export(utils_exports, {
54783
54785
  filterValueToLabel: () => filterValueToLabel,
54786
+ hasSchema: () => hasSchema,
54784
54787
  parallelForeach: () => parallelForeach,
54785
54788
  unreachable: () => unreachable
54786
54789
  });
@@ -54825,6 +54828,9 @@ function filterValueToLabel() {
54825
54828
  {}
54826
54829
  );
54827
54830
  }
54831
+ function hasSchema(test) {
54832
+ return typeof test === "object" && !Array.isArray(test) && test !== null && !(test instanceof Date) && Object.keys(test).length > 0;
54833
+ }
54828
54834
 
54829
54835
  // ../shared-core/src/sdk/index.ts
54830
54836
  var sdk_exports = {};
@@ -56318,9 +56324,10 @@ __export(correlation_exports, {
56318
56324
  var correlator = require("correlation-id");
56319
56325
  var setHeader = (headers) => {
56320
56326
  const correlationId = correlator.getId();
56321
- if (correlationId) {
56322
- headers["x-budibase-correlation-id" /* CORRELATION_ID */] = correlationId;
56327
+ if (!correlationId) {
56328
+ return;
56323
56329
  }
56330
+ headers["x-budibase-correlation-id" /* CORRELATION_ID */] = correlationId;
56324
56331
  };
56325
56332
  function getId() {
56326
56333
  return correlator.getId();
@@ -61256,25 +61263,33 @@ var checkInstallVersion = async () => {
61256
61263
  const install = await getInstall();
61257
61264
  const currentVersion = install.version;
61258
61265
  const newVersion = environment_default.VERSION;
61259
- if (currentVersion !== newVersion) {
61260
- const isUpgrade = import_semver.default.gt(newVersion, currentVersion);
61261
- const isDowngrade = import_semver.default.lt(newVersion, currentVersion);
61262
- const success = await updateVersion(newVersion);
61263
- if (success) {
61264
- await doInIdentityContext(
61265
- {
61266
- _id: install.installId,
61267
- type: "installation" /* INSTALLATION */
61268
- },
61269
- async () => {
61270
- if (isUpgrade) {
61271
- await installation_default.upgraded(currentVersion, newVersion);
61272
- } else if (isDowngrade) {
61273
- await installation_default.downgraded(currentVersion, newVersion);
61266
+ try {
61267
+ if (currentVersion !== newVersion) {
61268
+ const isUpgrade = import_semver.default.gt(newVersion, currentVersion);
61269
+ const isDowngrade = import_semver.default.lt(newVersion, currentVersion);
61270
+ const success = await updateVersion(newVersion);
61271
+ if (success) {
61272
+ await doInIdentityContext(
61273
+ {
61274
+ _id: install.installId,
61275
+ type: "installation" /* INSTALLATION */
61276
+ },
61277
+ async () => {
61278
+ if (isUpgrade) {
61279
+ await installation_default.upgraded(currentVersion, newVersion);
61280
+ } else if (isDowngrade) {
61281
+ await installation_default.downgraded(currentVersion, newVersion);
61282
+ }
61274
61283
  }
61275
- }
61276
- );
61277
- await identification_default.identifyInstallationGroup(install.installId);
61284
+ );
61285
+ await identification_default.identifyInstallationGroup(install.installId);
61286
+ }
61287
+ }
61288
+ } catch (err) {
61289
+ if (err?.message?.includes("Invalid Version")) {
61290
+ logAlert(`Invalid version "${newVersion}" - is it semver?`);
61291
+ } else {
61292
+ logAlert("Failed to retrieve version", err);
61278
61293
  }
61279
61294
  }
61280
61295
  };
@@ -62167,7 +62182,7 @@ var run2 = async (count, timestamp) => {
62167
62182
  };
62168
62183
  var previewed = async (datasource2, query) => {
62169
62184
  const properties = {
62170
- queryId: query._id,
62185
+ queryId: query.queryId,
62171
62186
  datasourceId: datasource2._id,
62172
62187
  source: datasource2.source,
62173
62188
  queryVerb: query.queryVerb