@budibase/types 2.33.14 → 3.0.1

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,15 +1,15 @@
1
1
  interface RowActionData {
2
2
  name: string;
3
3
  }
4
- export interface CreateRowActionRequest extends RowActionData {
4
+ interface RowActionPermissionsData {
5
+ allowedSources: string[] | undefined;
5
6
  }
6
- export interface UpdateRowActionRequest extends RowActionData {
7
+ export interface CreateRowActionRequest extends RowActionData {
7
8
  }
8
- export interface RowActionResponse extends RowActionData {
9
+ export interface RowActionResponse extends RowActionData, RowActionPermissionsData {
9
10
  id: string;
10
11
  tableId: string;
11
12
  automationId: string;
12
- allowedSources: string[] | undefined;
13
13
  }
14
14
  export interface RowActionsResponse {
15
15
  actions: Record<string, RowActionResponse>;
@@ -17,4 +17,6 @@ export interface RowActionsResponse {
17
17
  export interface RowActionTriggerRequest {
18
18
  rowId: string;
19
19
  }
20
+ export interface RowActionPermissionsResponse extends RowActionPermissionsData {
21
+ }
20
22
  export {};
@@ -6,10 +6,8 @@ export interface CreateAppRequest {
6
6
  useTemplate?: string;
7
7
  templateName?: string;
8
8
  templateKey?: string;
9
- templateFile?: string;
10
- includeSampleData?: boolean;
9
+ fileToImport?: string;
11
10
  encryptionPassword?: string;
12
- templateString?: string;
13
11
  file?: {
14
12
  path: string;
15
13
  };
@@ -2,21 +2,6 @@ import { DocumentDestroyResponse } from "@budibase/nano";
2
2
  import { Automation } from "../../documents";
3
3
  export interface DeleteAutomationResponse extends DocumentDestroyResponse {
4
4
  }
5
- export interface AutomationBuilderData {
6
- displayName: string;
7
- triggerInfo?: {
8
- type: string;
9
- table: {
10
- id: string;
11
- name: string;
12
- };
13
- rowAction: {
14
- id: string;
15
- name: string;
16
- };
17
- };
18
- }
19
5
  export interface FetchAutomationResponse {
20
6
  automations: Automation[];
21
- builderData?: Record<string, AutomationBuilderData>;
22
7
  }
@@ -1,11 +1,11 @@
1
1
  import { Role, RoleUIMetadata } from "../../documents";
2
- import { PermissionLevel } from "../../sdk";
2
+ import { PermissionLevel, BuiltinPermissionID } from "../../sdk";
3
3
  export interface SaveRoleRequest {
4
4
  _id?: string;
5
5
  _rev?: string;
6
6
  name: string;
7
7
  inherits?: string | string[];
8
- permissionId: string;
8
+ permissionId?: BuiltinPermissionID;
9
9
  permissions?: Record<string, PermissionLevel[]>;
10
10
  version?: string;
11
11
  uiMetadata?: RoleUIMetadata;
@@ -1,16 +1,30 @@
1
1
  import { FieldType } from "../../documents";
2
- import { EmptyFilterOption, FilterGroupLogicalOperator, SearchFilters } from "../../sdk";
3
- export type LegacyFilter = {
4
- operator: keyof SearchFilters | "rangeLow" | "rangeHigh";
5
- onEmptyFilter?: EmptyFilterOption;
2
+ import { EmptyFilterOption, UILogicalOperator, BasicOperator, RangeOperator, ArrayOperator } from "../../sdk";
3
+ type AllOr = {
4
+ operator: "allOr";
5
+ };
6
+ type OnEmptyFilter = {
7
+ onEmptyFilter: EmptyFilterOption;
8
+ };
9
+ export type SearchFilter = {
10
+ operator: BasicOperator | RangeOperator | ArrayOperator | "rangeLow" | "rangeHigh";
6
11
  field: string;
7
- type?: FieldType;
8
12
  value: any;
13
+ type?: FieldType;
9
14
  externalType?: string;
15
+ noValue?: boolean;
16
+ valueType?: string;
17
+ formulaType?: string;
10
18
  };
19
+ export type LegacyFilter = AllOr | OnEmptyFilter | SearchFilter;
11
20
  export type SearchFilterGroup = {
12
- logicalOperator: FilterGroupLogicalOperator;
13
- onEmptyFilter?: EmptyFilterOption;
21
+ logicalOperator?: UILogicalOperator;
14
22
  groups?: SearchFilterGroup[];
15
23
  filters?: LegacyFilter[];
16
24
  };
25
+ export type UISearchFilter = {
26
+ logicalOperator?: UILogicalOperator;
27
+ onEmptyFilter?: EmptyFilterOption;
28
+ groups?: SearchFilterGroup[];
29
+ };
30
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare const enum EventType {
2
+ ROW_SAVE = "row:save",
3
+ ROW_UPDATE = "row:update",
4
+ ROW_DELETE = "row:delete",
5
+ TABLE_SAVE = "table:save",
6
+ TABLE_UPDATED = "table:updated",
7
+ TABLE_DELETE = "table:delete"
8
+ }
@@ -1 +1,2 @@
1
1
  export * from "./installation";
2
+ export * from "./events";
@@ -20,9 +20,9 @@ export type ActionImplementations<T extends Hosting> = {
20
20
  [AutomationActionStepId.zapier]: ActionImplementation<ZapierStepInputs, ZapierStepOutputs>;
21
21
  [AutomationActionStepId.integromat]: ActionImplementation<MakeIntegrationInputs, ExternalAppStepOutputs>;
22
22
  [AutomationActionStepId.n8n]: ActionImplementation<n8nStepInputs, ExternalAppStepOutputs>;
23
+ [AutomationActionStepId.OPENAI]: ActionImplementation<OpenAIStepInputs, OpenAIStepOutputs>;
23
24
  } & (T extends "self" ? {
24
25
  [AutomationActionStepId.EXECUTE_BASH]: ActionImplementation<BashStepInputs, BashStepOutputs>;
25
- [AutomationActionStepId.OPENAI]: ActionImplementation<OpenAIStepInputs, OpenAIStepOutputs>;
26
26
  } : {});
27
27
  export interface AutomationStepSchemaBase {
28
28
  name: string;
@@ -17,3 +17,4 @@ export * from "./component";
17
17
  export * from "./sqlite";
18
18
  export * from "./snippet";
19
19
  export * from "./rowAction";
20
+ export * from "./theme";
@@ -1,12 +1,12 @@
1
1
  import { Document } from "../document";
2
- import { PermissionLevel } from "../../sdk";
2
+ import { PermissionLevel, BuiltinPermissionID } from "../../sdk";
3
3
  export interface RoleUIMetadata {
4
4
  displayName?: string;
5
5
  color?: string;
6
6
  description?: string;
7
7
  }
8
8
  export interface Role extends Document {
9
- permissionId: string;
9
+ permissionId: BuiltinPermissionID;
10
10
  inherits?: string | string[];
11
11
  permissions: Record<string, PermissionLevel[]>;
12
12
  version?: string;
@@ -4,7 +4,6 @@ export interface TableRowActions extends Document {
4
4
  actions: Record<string, RowActionData>;
5
5
  }
6
6
  export interface RowActionData {
7
- name: string;
8
7
  automationId: string;
9
8
  permissions: RowActionPermissions;
10
9
  }
@@ -140,6 +140,14 @@ export interface ArrayFieldMetadata extends BaseFieldSchema {
140
140
  };
141
141
  default?: string[];
142
142
  }
143
+ export interface BooleanFieldMetadata extends BaseFieldSchema {
144
+ type: FieldType.BOOLEAN;
145
+ default?: string;
146
+ }
147
+ export interface BigIntFieldMetadata extends BaseFieldSchema {
148
+ type: FieldType.BIGINT;
149
+ default?: string;
150
+ }
143
151
  interface BaseFieldSchema extends UIFieldMetadata {
144
152
  type: FieldType;
145
153
  name: string;
@@ -151,9 +159,9 @@ interface BaseFieldSchema extends UIFieldMetadata {
151
159
  subtype?: never;
152
160
  }
153
161
  interface OtherFieldMetadata extends BaseFieldSchema {
154
- type: Exclude<FieldType, FieldType.DATETIME | FieldType.LINK | FieldType.AUTO | FieldType.FORMULA | FieldType.AI | FieldType.NUMBER | FieldType.LONGFORM | FieldType.BB_REFERENCE | FieldType.BB_REFERENCE_SINGLE | FieldType.ATTACHMENTS | FieldType.STRING | FieldType.ARRAY | FieldType.OPTIONS>;
162
+ type: Exclude<FieldType, FieldType.DATETIME | FieldType.LINK | FieldType.AUTO | FieldType.FORMULA | FieldType.AI | FieldType.NUMBER | FieldType.LONGFORM | FieldType.BB_REFERENCE | FieldType.BB_REFERENCE_SINGLE | FieldType.ATTACHMENTS | FieldType.STRING | FieldType.ARRAY | FieldType.OPTIONS | FieldType.BOOLEAN | FieldType.BIGINT>;
155
163
  }
156
- export type FieldSchema = OtherFieldMetadata | DateFieldMetadata | RelationshipFieldMetadata | AutoColumnFieldMetadata | FormulaFieldMetadata | AIFieldMetadata | NumberFieldMetadata | LongFormFieldMetadata | StringFieldMetadata | BBReferenceFieldMetadata | JsonFieldMetadata | AttachmentFieldMetadata | BBReferenceSingleFieldMetadata | ArrayFieldMetadata | OptionsFieldMetadata;
164
+ export type FieldSchema = OtherFieldMetadata | DateFieldMetadata | RelationshipFieldMetadata | AutoColumnFieldMetadata | FormulaFieldMetadata | AIFieldMetadata | NumberFieldMetadata | LongFormFieldMetadata | StringFieldMetadata | BBReferenceFieldMetadata | JsonFieldMetadata | AttachmentFieldMetadata | BBReferenceSingleFieldMetadata | ArrayFieldMetadata | OptionsFieldMetadata | BooleanFieldMetadata | BigIntFieldMetadata;
157
165
  export interface TableSchema {
158
166
  [key: string]: FieldSchema;
159
167
  }
@@ -0,0 +1,13 @@
1
+ export declare enum Theme {
2
+ LIGHTEST = "lightest",
3
+ LIGHT = "light",
4
+ DARK = "dark",
5
+ DARKEST = "darkest",
6
+ NORD = "nord",
7
+ MIDNIGHT = "midnight"
8
+ }
9
+ export type ThemeMeta = {
10
+ id: string;
11
+ name: string;
12
+ base?: Theme;
13
+ };
@@ -1,4 +1,4 @@
1
- import { LegacyFilter, SearchFilterGroup, SortOrder, SortType } from "../../api";
1
+ import { LegacyFilter, UISearchFilter, SortOrder, SortType } from "../../api";
2
2
  import { UIFieldMetadata } from "./table";
3
3
  import { Document } from "../document";
4
4
  import { DBView, SearchFilters } from "../../sdk";
@@ -42,10 +42,10 @@ export interface NumericCalculationFieldMetadata extends BasicViewFieldMetadata
42
42
  }
43
43
  export interface CountCalculationFieldMetadata extends BasicViewFieldMetadata {
44
44
  calculationType: CalculationType.COUNT;
45
+ field: string;
45
46
  }
46
47
  export interface CountDistinctCalculationFieldMetadata extends CountCalculationFieldMetadata {
47
48
  distinct: true;
48
- field: string;
49
49
  }
50
50
  export type ViewCalculationFieldMetadata = NumericCalculationFieldMetadata | CountCalculationFieldMetadata | CountDistinctCalculationFieldMetadata;
51
51
  export type ViewFieldMetadata = BasicViewFieldMetadata | ViewCalculationFieldMetadata;
@@ -67,7 +67,7 @@ export interface ViewV2 {
67
67
  primaryDisplay?: string;
68
68
  tableId: string;
69
69
  query?: LegacyFilter[] | SearchFilters;
70
- queryUI?: SearchFilterGroup;
70
+ queryUI?: UISearchFilter;
71
71
  sort?: {
72
72
  field: string;
73
73
  order?: SortOrder;
package/dist/index.js CHANGED
@@ -54,6 +54,7 @@ __export(src_exports, {
54
54
  BasicOperator: () => BasicOperator,
55
55
  BodyType: () => BodyType,
56
56
  BreakdownQuotaName: () => BreakdownQuotaName,
57
+ BuiltinPermissionID: () => BuiltinPermissionID,
57
58
  CalculationType: () => CalculationType,
58
59
  CommandWord: () => CommandWord,
59
60
  ConfigType: () => ConfigType,
@@ -66,10 +67,10 @@ __export(src_exports, {
66
67
  EmptyFilterOption: () => EmptyFilterOption,
67
68
  Event: () => Event,
68
69
  EventPublishType: () => EventPublishType,
70
+ EventType: () => EventType,
69
71
  Feature: () => Feature,
70
72
  FeatureFlag: () => FeatureFlag,
71
73
  FieldType: () => FieldType,
72
- FilterGroupLogicalOperator: () => FilterGroupLogicalOperator,
73
74
  FilterType: () => FilterType,
74
75
  FormulaType: () => FormulaType,
75
76
  GroupByTypes: () => GroupByTypes,
@@ -130,6 +131,8 @@ __export(src_exports, {
130
131
  StaticQuotaName: () => StaticQuotaName,
131
132
  TableSourceType: () => TableSourceType,
132
133
  TenantResolutionStrategy: () => TenantResolutionStrategy,
134
+ Theme: () => Theme,
135
+ UILogicalOperator: () => UILogicalOperator,
133
136
  UNICODE_MAX: () => UNICODE_MAX,
134
137
  UserGroupSyncEvents: () => UserGroupSyncEvents,
135
138
  UserStatus: () => UserStatus,
@@ -142,6 +145,8 @@ __export(src_exports, {
142
145
  getVirtualDocumentType: () => getVirtualDocumentType,
143
146
  isAIConfig: () => isAIConfig,
144
147
  isAppBackupMetadata: () => isAppBackupMetadata,
148
+ isArraySearchOperator: () => isArraySearchOperator,
149
+ isBasicSearchOperator: () => isBasicSearchOperator,
145
150
  isCloudAccount: () => isCloudAccount,
146
151
  isConstantQuota: () => isConstantQuota,
147
152
  isCreatePasswordAccount: () => isCreatePasswordAccount,
@@ -155,6 +160,7 @@ __export(src_exports, {
155
160
  isOIDCConfig: () => isOIDCConfig,
156
161
  isOneToMany: () => isOneToMany,
157
162
  isPasswordAccount: () => isPasswordAccount,
163
+ isRangeSearchOperator: () => isRangeSearchOperator,
158
164
  isRelationshipField: () => isRelationshipField,
159
165
  isSCIMConfig: () => isSCIMConfig,
160
166
  isSMTPConfig: () => isSMTPConfig,
@@ -739,7 +745,16 @@ var LogicalOperator = /* @__PURE__ */ ((LogicalOperator2) => {
739
745
  return LogicalOperator2;
740
746
  })(LogicalOperator || {});
741
747
  function isLogicalSearchOperator(value) {
742
- return value === "$and" /* AND */ || value === "$or" /* OR */;
748
+ return Object.values(LogicalOperator).includes(value);
749
+ }
750
+ function isBasicSearchOperator(value) {
751
+ return Object.values(BasicOperator).includes(value);
752
+ }
753
+ function isArraySearchOperator(value) {
754
+ return Object.values(ArrayOperator).includes(value);
755
+ }
756
+ function isRangeSearchOperator(value) {
757
+ return Object.values(RangeOperator).includes(value);
743
758
  }
744
759
  var InternalSearchFilterOperator = /* @__PURE__ */ ((InternalSearchFilterOperator2) => {
745
760
  InternalSearchFilterOperator2["COMPLEX_ID_OPERATOR"] = "_complexIdOperator";
@@ -750,11 +765,11 @@ var EmptyFilterOption = /* @__PURE__ */ ((EmptyFilterOption2) => {
750
765
  EmptyFilterOption2["RETURN_NONE"] = "none";
751
766
  return EmptyFilterOption2;
752
767
  })(EmptyFilterOption || {});
753
- var FilterGroupLogicalOperator = /* @__PURE__ */ ((FilterGroupLogicalOperator2) => {
754
- FilterGroupLogicalOperator2["ALL"] = "all";
755
- FilterGroupLogicalOperator2["ANY"] = "any";
756
- return FilterGroupLogicalOperator2;
757
- })(FilterGroupLogicalOperator || {});
768
+ var UILogicalOperator = /* @__PURE__ */ ((UILogicalOperator2) => {
769
+ UILogicalOperator2["ALL"] = "all";
770
+ UILogicalOperator2["ANY"] = "any";
771
+ return UILogicalOperator2;
772
+ })(UILogicalOperator || {});
758
773
  var SqlClient = /* @__PURE__ */ ((SqlClient2) => {
759
774
  SqlClient2["MS_SQL"] = "mssql";
760
775
  SqlClient2["POSTGRES"] = "pg";
@@ -870,6 +885,14 @@ var PermissionLevel = /* @__PURE__ */ ((PermissionLevel2) => {
870
885
  PermissionLevel2["ADMIN"] = "admin";
871
886
  return PermissionLevel2;
872
887
  })(PermissionLevel || {});
888
+ var BuiltinPermissionID = /* @__PURE__ */ ((BuiltinPermissionID2) => {
889
+ BuiltinPermissionID2["PUBLIC"] = "public";
890
+ BuiltinPermissionID2["READ_ONLY"] = "read_only";
891
+ BuiltinPermissionID2["WRITE"] = "write";
892
+ BuiltinPermissionID2["ADMIN"] = "admin";
893
+ BuiltinPermissionID2["POWER"] = "power";
894
+ return BuiltinPermissionID2;
895
+ })(BuiltinPermissionID || {});
873
896
  var PermissionType = /* @__PURE__ */ ((PermissionType2) => {
874
897
  PermissionType2["APP"] = "app";
875
898
  PermissionType2["TABLE"] = "table";
@@ -1318,6 +1341,17 @@ var SQLiteType = /* @__PURE__ */ ((SQLiteType2) => {
1318
1341
  return SQLiteType2;
1319
1342
  })(SQLiteType || {});
1320
1343
 
1344
+ // src/documents/app/theme.ts
1345
+ var Theme = /* @__PURE__ */ ((Theme2) => {
1346
+ Theme2["LIGHTEST"] = "lightest";
1347
+ Theme2["LIGHT"] = "light";
1348
+ Theme2["DARK"] = "dark";
1349
+ Theme2["DARKEST"] = "darkest";
1350
+ Theme2["NORD"] = "nord";
1351
+ Theme2["MIDNIGHT"] = "midnight";
1352
+ return Theme2;
1353
+ })(Theme || {});
1354
+
1321
1355
  // src/documents/global/config.ts
1322
1356
  var isSettingsConfig = (config) => config.type === "settings" /* SETTINGS */;
1323
1357
  var isSMTPConfig = (config) => config.type === "smtp" /* SMTP */;
@@ -1448,6 +1482,17 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1448
1482
  MaintenanceType2["SQS_MISSING"] = "sqs_missing";
1449
1483
  return MaintenanceType2;
1450
1484
  })(MaintenanceType || {});
1485
+
1486
+ // src/core/events.ts
1487
+ var EventType = /* @__PURE__ */ ((EventType2) => {
1488
+ EventType2["ROW_SAVE"] = "row:save";
1489
+ EventType2["ROW_UPDATE"] = "row:update";
1490
+ EventType2["ROW_DELETE"] = "row:delete";
1491
+ EventType2["TABLE_SAVE"] = "table:save";
1492
+ EventType2["TABLE_UPDATED"] = "table:updated";
1493
+ EventType2["TABLE_DELETE"] = "table:delete";
1494
+ return EventType2;
1495
+ })(EventType || {});
1451
1496
  // Annotate the CommonJS export names for ESM import in node:
1452
1497
  0 && (module.exports = {
1453
1498
  AIOperationEnum,
@@ -1484,6 +1529,7 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1484
1529
  BasicOperator,
1485
1530
  BodyType,
1486
1531
  BreakdownQuotaName,
1532
+ BuiltinPermissionID,
1487
1533
  CalculationType,
1488
1534
  CommandWord,
1489
1535
  ConfigType,
@@ -1496,10 +1542,10 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1496
1542
  EmptyFilterOption,
1497
1543
  Event,
1498
1544
  EventPublishType,
1545
+ EventType,
1499
1546
  Feature,
1500
1547
  FeatureFlag,
1501
1548
  FieldType,
1502
- FilterGroupLogicalOperator,
1503
1549
  FilterType,
1504
1550
  FormulaType,
1505
1551
  GroupByTypes,
@@ -1560,6 +1606,8 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1560
1606
  StaticQuotaName,
1561
1607
  TableSourceType,
1562
1608
  TenantResolutionStrategy,
1609
+ Theme,
1610
+ UILogicalOperator,
1563
1611
  UNICODE_MAX,
1564
1612
  UserGroupSyncEvents,
1565
1613
  UserStatus,
@@ -1572,6 +1620,8 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1572
1620
  getVirtualDocumentType,
1573
1621
  isAIConfig,
1574
1622
  isAppBackupMetadata,
1623
+ isArraySearchOperator,
1624
+ isBasicSearchOperator,
1575
1625
  isCloudAccount,
1576
1626
  isConstantQuota,
1577
1627
  isCreatePasswordAccount,
@@ -1585,6 +1635,7 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1585
1635
  isOIDCConfig,
1586
1636
  isOneToMany,
1587
1637
  isPasswordAccount,
1638
+ isRangeSearchOperator,
1588
1639
  isRelationshipField,
1589
1640
  isSCIMConfig,
1590
1641
  isSMTPConfig,