@budibase/backend-core 2.19.5 → 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
@@ -54783,6 +54783,7 @@ var NoEmptyFilterStrings = [
54783
54783
  var utils_exports = {};
54784
54784
  __export(utils_exports, {
54785
54785
  filterValueToLabel: () => filterValueToLabel,
54786
+ hasSchema: () => hasSchema,
54786
54787
  parallelForeach: () => parallelForeach,
54787
54788
  unreachable: () => unreachable
54788
54789
  });
@@ -54827,6 +54828,9 @@ function filterValueToLabel() {
54827
54828
  {}
54828
54829
  );
54829
54830
  }
54831
+ function hasSchema(test) {
54832
+ return typeof test === "object" && !Array.isArray(test) && test !== null && !(test instanceof Date) && Object.keys(test).length > 0;
54833
+ }
54830
54834
 
54831
54835
  // ../shared-core/src/sdk/index.ts
54832
54836
  var sdk_exports = {};
@@ -61259,25 +61263,33 @@ var checkInstallVersion = async () => {
61259
61263
  const install = await getInstall();
61260
61264
  const currentVersion = install.version;
61261
61265
  const newVersion = environment_default.VERSION;
61262
- if (currentVersion !== newVersion) {
61263
- const isUpgrade = import_semver.default.gt(newVersion, currentVersion);
61264
- const isDowngrade = import_semver.default.lt(newVersion, currentVersion);
61265
- const success = await updateVersion(newVersion);
61266
- if (success) {
61267
- await doInIdentityContext(
61268
- {
61269
- _id: install.installId,
61270
- type: "installation" /* INSTALLATION */
61271
- },
61272
- async () => {
61273
- if (isUpgrade) {
61274
- await installation_default.upgraded(currentVersion, newVersion);
61275
- } else if (isDowngrade) {
61276
- 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
+ }
61277
61283
  }
61278
- }
61279
- );
61280
- 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);
61281
61293
  }
61282
61294
  }
61283
61295
  };
@@ -62170,7 +62182,7 @@ var run2 = async (count, timestamp) => {
62170
62182
  };
62171
62183
  var previewed = async (datasource2, query) => {
62172
62184
  const properties = {
62173
- queryId: query._id,
62185
+ queryId: query.queryId,
62174
62186
  datasourceId: datasource2._id,
62175
62187
  source: datasource2.source,
62176
62188
  queryVerb: query.queryVerb