@budibase/shared-core 2.29.24 → 2.29.26

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.
@@ -1,3 +1,3 @@
1
- export declare const CONSTANT_INTERNAL_ROW_COLS: readonly ["_id", "_rev", "type", "createdAt", "updatedAt", "tableId"];
2
- export declare const CONSTANT_EXTERNAL_ROW_COLS: readonly ["_id", "_rev", "tableId"];
1
+ export declare const PROTECTED_INTERNAL_COLUMNS: readonly ["_id", "_rev", "type", "createdAt", "updatedAt", "tableId"];
2
+ export declare const PROTECTED_EXTERNAL_COLUMNS: readonly ["_id", "_rev", "tableId"];
3
3
  export declare function isInternalColumnName(name: string): boolean;
package/dist/index.js CHANGED
@@ -10013,13 +10013,13 @@ __export(src_exports, {
10013
10013
  BpmStatusKey: () => BpmStatusKey,
10014
10014
  BpmStatusValue: () => BpmStatusValue,
10015
10015
  BuilderSocketEvent: () => BuilderSocketEvent,
10016
- CONSTANT_EXTERNAL_ROW_COLS: () => CONSTANT_EXTERNAL_ROW_COLS,
10017
- CONSTANT_INTERNAL_ROW_COLS: () => CONSTANT_INTERNAL_ROW_COLS,
10018
10016
  DEFAULT_BB_DATASOURCE_ID: () => DEFAULT_BB_DATASOURCE_ID,
10019
10017
  GridSocketEvent: () => GridSocketEvent,
10020
10018
  Header: () => Header,
10021
10019
  InvalidFileExtensions: () => InvalidFileExtensions,
10022
10020
  OperatorOptions: () => OperatorOptions,
10021
+ PROTECTED_EXTERNAL_COLUMNS: () => PROTECTED_EXTERNAL_COLUMNS,
10022
+ PROTECTED_INTERNAL_COLUMNS: () => PROTECTED_INTERNAL_COLUMNS,
10023
10023
  REBOOT_CRON: () => REBOOT_CRON,
10024
10024
  SWITCHABLE_TYPES: () => SWITCHABLE_TYPES,
10025
10025
  SocketEvent: () => SocketEvent,
@@ -10105,6 +10105,7 @@ var AutomationTriggerStepId = /* @__PURE__ */ ((AutomationTriggerStepId2) => {
10105
10105
  AutomationTriggerStepId2["WEBHOOK"] = "WEBHOOK";
10106
10106
  AutomationTriggerStepId2["APP"] = "APP";
10107
10107
  AutomationTriggerStepId2["CRON"] = "CRON";
10108
+ AutomationTriggerStepId2["ROW_ACTION"] = "ROW_ACTION";
10108
10109
  return AutomationTriggerStepId2;
10109
10110
  })(AutomationTriggerStepId || {});
10110
10111
  var AutomationActionStepId = /* @__PURE__ */ ((AutomationActionStepId2) => {
@@ -10190,7 +10191,7 @@ var SWITCHABLE_TYPES = {
10190
10191
  };
10191
10192
 
10192
10193
  // src/constants/rows.ts
10193
- var CONSTANT_INTERNAL_ROW_COLS = [
10194
+ var PROTECTED_INTERNAL_COLUMNS = [
10194
10195
  "_id",
10195
10196
  "_rev",
10196
10197
  "type",
@@ -10198,9 +10199,9 @@ var CONSTANT_INTERNAL_ROW_COLS = [
10198
10199
  "updatedAt",
10199
10200
  "tableId"
10200
10201
  ];
10201
- var CONSTANT_EXTERNAL_ROW_COLS = ["_id", "_rev", "tableId"];
10202
+ var PROTECTED_EXTERNAL_COLUMNS = ["_id", "_rev", "tableId"];
10202
10203
  function isInternalColumnName(name) {
10203
- return CONSTANT_INTERNAL_ROW_COLS.includes(name);
10204
+ return PROTECTED_INTERNAL_COLUMNS.includes(name);
10204
10205
  }
10205
10206
 
10206
10207
  // src/constants/index.ts
@@ -10928,7 +10929,7 @@ var runQuery = (docs, query) => {
10928
10929
  if (Array.isArray(docValue)) {
10929
10930
  return docValue.length === 0;
10930
10931
  }
10931
- if (typeof docValue === "object") {
10932
+ if (docValue && typeof docValue === "object") {
10932
10933
  return Object.keys(docValue).length === 0;
10933
10934
  }
10934
10935
  return docValue == null;
@@ -11114,6 +11115,7 @@ function hasSchema(test) {
11114
11115
  var sdk_exports = {};
11115
11116
  __export(sdk_exports, {
11116
11117
  applications: () => applications_exports,
11118
+ automations: () => automations_exports,
11117
11119
  users: () => users_exports
11118
11120
  });
11119
11121
 
@@ -11150,6 +11152,21 @@ function getProdAppID(appId) {
11150
11152
  return `${APP_PREFIX}${rest}`;
11151
11153
  }
11152
11154
 
11155
+ // src/sdk/documents/automations.ts
11156
+ var automations_exports = {};
11157
+ __export(automations_exports, {
11158
+ isAppAction: () => isAppAction,
11159
+ isRowAction: () => isRowAction
11160
+ });
11161
+ function isRowAction(automation) {
11162
+ const result = automation.definition.trigger?.stepId === "ROW_ACTION" /* ROW_ACTION */;
11163
+ return result;
11164
+ }
11165
+ function isAppAction(automation) {
11166
+ const result = automation.definition.trigger?.stepId === "APP" /* APP */;
11167
+ return result;
11168
+ }
11169
+
11153
11170
  // src/sdk/documents/users.ts
11154
11171
  var users_exports = {};
11155
11172
  __export(users_exports, {
@@ -11307,7 +11324,7 @@ function canBeDisplayColumn(type) {
11307
11324
  function canBeSortColumn(type) {
11308
11325
  return !!allowSortColumnByType[type];
11309
11326
  }
11310
- function findDuplicateInternalColumns(table) {
11327
+ function findDuplicateInternalColumns(table, opts) {
11311
11328
  const casedKeys = Object.keys(table.schema);
11312
11329
  const uncasedKeys = casedKeys.map((colName) => colName.toLowerCase());
11313
11330
  const set = new Set(uncasedKeys);
@@ -11320,9 +11337,11 @@ function findDuplicateInternalColumns(table) {
11320
11337
  }
11321
11338
  }
11322
11339
  }
11323
- for (let internalColumn of CONSTANT_INTERNAL_ROW_COLS) {
11324
- if (casedKeys.find((key) => key === internalColumn)) {
11325
- duplicates.push(internalColumn);
11340
+ if (!opts?.ignoreProtectedColumnNames) {
11341
+ for (let internalColumn of PROTECTED_INTERNAL_COLUMNS) {
11342
+ if (casedKeys.find((key) => key === internalColumn)) {
11343
+ duplicates.push(internalColumn);
11344
+ }
11326
11345
  }
11327
11346
  }
11328
11347
  return duplicates;
@@ -11334,13 +11353,13 @@ function findDuplicateInternalColumns(table) {
11334
11353
  BpmStatusKey,
11335
11354
  BpmStatusValue,
11336
11355
  BuilderSocketEvent,
11337
- CONSTANT_EXTERNAL_ROW_COLS,
11338
- CONSTANT_INTERNAL_ROW_COLS,
11339
11356
  DEFAULT_BB_DATASOURCE_ID,
11340
11357
  GridSocketEvent,
11341
11358
  Header,
11342
11359
  InvalidFileExtensions,
11343
11360
  OperatorOptions,
11361
+ PROTECTED_EXTERNAL_COLUMNS,
11362
+ PROTECTED_INTERNAL_COLUMNS,
11344
11363
  REBOOT_CRON,
11345
11364
  SWITCHABLE_TYPES,
11346
11365
  SocketEvent,