@budibase/types 2.31.3 → 2.31.7

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.
@@ -9,6 +9,7 @@ export interface RowActionResponse extends RowActionData {
9
9
  id: string;
10
10
  tableId: string;
11
11
  automationId: string;
12
+ allowedViews: string[] | undefined;
12
13
  }
13
14
  export interface RowActionsResponse {
14
15
  actions: Record<string, RowActionResponse>;
@@ -1,8 +1,17 @@
1
1
  import { Document } from "../document";
2
2
  export interface TableRowActions extends Document {
3
3
  _id: string;
4
- actions: Record<string, {
5
- name: string;
6
- automationId: string;
7
- }>;
4
+ actions: Record<string, RowActionData>;
5
+ }
6
+ export interface RowActionData {
7
+ name: string;
8
+ automationId: string;
9
+ permissions: {
10
+ table: {
11
+ runAllowed: boolean;
12
+ };
13
+ views: Record<string, {
14
+ runAllowed: boolean;
15
+ }>;
16
+ };
8
17
  }
@@ -29,8 +29,24 @@ export interface View {
29
29
  meta?: ViewTemplateOpts;
30
30
  groupBy?: string;
31
31
  }
32
- export type ViewUIFieldMetadata = UIFieldMetadata & {
32
+ export type ViewFieldMetadata = UIFieldMetadata & {
33
33
  readonly?: boolean;
34
+ columns?: Record<string, RelationSchemaField>;
35
+ };
36
+ export type RelationSchemaField = {
37
+ visible?: boolean;
38
+ readonly?: boolean;
39
+ };
40
+ export declare enum CalculationType {
41
+ SUM = "sum",
42
+ AVG = "avg",
43
+ COUNT = "count",
44
+ MIN = "min",
45
+ MAX = "max"
46
+ }
47
+ export type ViewCalculationFieldMetadata = ViewFieldMetadata & {
48
+ calculationType: CalculationType;
49
+ field: string;
34
50
  };
35
51
  export interface ViewV2 {
36
52
  version: 2;
@@ -44,7 +60,7 @@ export interface ViewV2 {
44
60
  order?: SortOrder;
45
61
  type?: SortType;
46
62
  };
47
- schema?: Record<string, ViewUIFieldMetadata>;
63
+ schema?: Record<string, ViewFieldMetadata | ViewCalculationFieldMetadata>;
48
64
  }
49
65
  export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema;
50
66
  export interface ViewCountOrSumSchema {
package/dist/index.js CHANGED
@@ -53,6 +53,7 @@ __export(src_exports, {
53
53
  BasicOperator: () => BasicOperator,
54
54
  BodyType: () => BodyType,
55
55
  BreakdownQuotaName: () => BreakdownQuotaName,
56
+ CalculationType: () => CalculationType,
56
57
  CommandWord: () => CommandWord,
57
58
  ConfigType: () => ConfigType,
58
59
  ConstantQuotaName: () => ConstantQuotaName,
@@ -771,6 +772,7 @@ var TenantResolutionStrategy = /* @__PURE__ */ ((TenantResolutionStrategy2) => {
771
772
  var FeatureFlag = /* @__PURE__ */ ((FeatureFlag2) => {
772
773
  FeatureFlag2["PER_CREATOR_PER_USER_PRICE"] = "PER_CREATOR_PER_USER_PRICE";
773
774
  FeatureFlag2["PER_CREATOR_PER_USER_PRICE_ALERT"] = "PER_CREATOR_PER_USER_PRICE_ALERT";
775
+ FeatureFlag2["ENRICHED_RELATIONSHIPS"] = "ENRICHED_RELATIONSHIPS";
774
776
  return FeatureFlag2;
775
777
  })(FeatureFlag || {});
776
778
 
@@ -1097,6 +1099,14 @@ function isManyToOne(field) {
1097
1099
  }
1098
1100
 
1099
1101
  // src/documents/app/view.ts
1102
+ var CalculationType = /* @__PURE__ */ ((CalculationType2) => {
1103
+ CalculationType2["SUM"] = "sum";
1104
+ CalculationType2["AVG"] = "avg";
1105
+ CalculationType2["COUNT"] = "count";
1106
+ CalculationType2["MIN"] = "min";
1107
+ CalculationType2["MAX"] = "max";
1108
+ return CalculationType2;
1109
+ })(CalculationType || {});
1100
1110
  var ViewCalculation = /* @__PURE__ */ ((ViewCalculation2) => {
1101
1111
  ViewCalculation2["SUM"] = "sum";
1102
1112
  ViewCalculation2["COUNT"] = "count";
@@ -1372,6 +1382,7 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1372
1382
  BasicOperator,
1373
1383
  BodyType,
1374
1384
  BreakdownQuotaName,
1385
+ CalculationType,
1375
1386
  CommandWord,
1376
1387
  ConfigType,
1377
1388
  ConstantQuotaName,