@budibase/types 2.32.14 → 2.32.16

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,4 +1,7 @@
1
1
  import { PermissionLevel } from "../../../sdk";
2
+ export interface FetchResourcePermissionInfoResponse {
3
+ [key: string]: Record<string, string>;
4
+ }
2
5
  export interface ResourcePermissionInfo {
3
6
  role: string;
4
7
  permissionType: string;
@@ -16,7 +19,8 @@ export interface AddedPermission {
16
19
  error?: string;
17
20
  reason?: string;
18
21
  }
19
- export type AddPermissionResponse = AddedPermission[];
22
+ export interface AddPermissionResponse {
23
+ }
20
24
  export interface AddPermissionRequest {
21
25
  roleId: string;
22
26
  resourceId: string;
@@ -24,5 +28,5 @@ export interface AddPermissionRequest {
24
28
  }
25
29
  export interface RemovePermissionRequest extends AddPermissionRequest {
26
30
  }
27
- export interface RemovePermissionResponse extends AddPermissionResponse {
31
+ export interface RemovePermissionResponse {
28
32
  }
@@ -117,6 +117,10 @@ export declare enum FieldType {
117
117
  BB_REFERENCE_SINGLE = "bb_reference_single"
118
118
  }
119
119
  export declare const JsonTypes: FieldType[];
120
+ export declare const NumericTypes: FieldType[];
121
+ export declare function isNumeric(type: FieldType): boolean;
122
+ export declare const GroupByTypes: FieldType[];
123
+ export declare function canGroupBy(type: FieldType): boolean;
120
124
  export interface RowAttachment {
121
125
  size: number;
122
126
  name: string;
@@ -39,6 +39,7 @@ export declare enum DocumentType {
39
39
  SCIM_LOG = "scimlog",
40
40
  ROW_ACTIONS = "ra"
41
41
  }
42
+ export declare function getDocumentType(id: string): DocumentType | undefined;
42
43
  export declare const DocumentTypesToImport: DocumentType[];
43
44
  export declare enum InternalTable {
44
45
  USER_METADATA = "ta_users"
@@ -47,6 +48,7 @@ export declare enum VirtualDocumentType {
47
48
  VIEW = "view",
48
49
  ROW_ACTION = "row_action"
49
50
  }
51
+ export declare function getVirtualDocumentType(id: string): VirtualDocumentType | undefined;
50
52
  export interface Document {
51
53
  _id?: string;
52
54
  _rev?: string;
package/dist/index.js CHANGED
@@ -71,6 +71,7 @@ __export(src_exports, {
71
71
  FilterGroupLogicalOperator: () => FilterGroupLogicalOperator,
72
72
  FilterType: () => FilterType,
73
73
  FormulaType: () => FormulaType,
74
+ GroupByTypes: () => GroupByTypes,
74
75
  GroupType: () => GroupType,
75
76
  Hosting: () => Hosting,
76
77
  HttpMethod: () => HttpMethod,
@@ -90,6 +91,7 @@ __export(src_exports, {
90
91
  MigrationName: () => MigrationName,
91
92
  MigrationType: () => MigrationType,
92
93
  MonthlyQuotaName: () => MonthlyQuotaName,
94
+ NumericTypes: () => NumericTypes,
93
95
  Operation: () => Operation,
94
96
  PASSWORD_REPLACEMENT: () => PASSWORD_REPLACEMENT,
95
97
  PLUGIN_TYPE_ARR: () => PLUGIN_TYPE_ARR,
@@ -132,6 +134,9 @@ __export(src_exports, {
132
134
  ViewV2Type: () => ViewV2Type,
133
135
  VirtualDocumentType: () => VirtualDocumentType,
134
136
  WebhookActionType: () => WebhookActionType,
137
+ canGroupBy: () => canGroupBy,
138
+ getDocumentType: () => getDocumentType,
139
+ getVirtualDocumentType: () => getVirtualDocumentType,
135
140
  isAIConfig: () => isAIConfig,
136
141
  isAppBackupMetadata: () => isAppBackupMetadata,
137
142
  isCloudAccount: () => isCloudAccount,
@@ -143,6 +148,7 @@ __export(src_exports, {
143
148
  isManyToMany: () => isManyToMany,
144
149
  isManyToOne: () => isManyToOne,
145
150
  isMonthlyQuota: () => isMonthlyQuota,
151
+ isNumeric: () => isNumeric,
146
152
  isOIDCConfig: () => isOIDCConfig,
147
153
  isOneToMany: () => isOneToMany,
148
154
  isPasswordAccount: () => isPasswordAccount,
@@ -792,6 +798,7 @@ var FeatureFlag = /* @__PURE__ */ ((FeatureFlag2) => {
792
798
  FeatureFlag2["PER_CREATOR_PER_USER_PRICE_ALERT"] = "PER_CREATOR_PER_USER_PRICE_ALERT";
793
799
  FeatureFlag2["AI_CUSTOM_CONFIGS"] = "AI_CUSTOM_CONFIGS";
794
800
  FeatureFlag2["ENRICHED_RELATIONSHIPS"] = "ENRICHED_RELATIONSHIPS";
801
+ FeatureFlag2["TABLES_DEFAULT_ADMIN"] = "TABLES_DEFAULT_ADMIN";
795
802
  return FeatureFlag2;
796
803
  })(FeatureFlag || {});
797
804
 
@@ -1069,6 +1076,22 @@ var JsonTypes = [
1069
1076
  "json" /* JSON */,
1070
1077
  "array" /* ARRAY */
1071
1078
  ];
1079
+ var NumericTypes = ["number" /* NUMBER */, "bigint" /* BIGINT */];
1080
+ function isNumeric(type) {
1081
+ return NumericTypes.includes(type);
1082
+ }
1083
+ var GroupByTypes = [
1084
+ "string" /* STRING */,
1085
+ "longform" /* LONGFORM */,
1086
+ "options" /* OPTIONS */,
1087
+ "number" /* NUMBER */,
1088
+ "boolean" /* BOOLEAN */,
1089
+ "datetime" /* DATETIME */,
1090
+ "bigint" /* BIGINT */
1091
+ ];
1092
+ function canGroupBy(type) {
1093
+ return GroupByTypes.includes(type);
1094
+ }
1072
1095
 
1073
1096
  // src/documents/app/table/constants.ts
1074
1097
  var RelationshipType = /* @__PURE__ */ ((RelationshipType2) => {
@@ -1181,6 +1204,15 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
1181
1204
  DocumentType2["ROW_ACTIONS"] = "ra";
1182
1205
  return DocumentType2;
1183
1206
  })(DocumentType || {});
1207
+ var sortedDocumentTypes = Object.values(DocumentType).sort(
1208
+ (a, b) => b.length - a.length
1209
+ // descending
1210
+ );
1211
+ function getDocumentType(id) {
1212
+ return sortedDocumentTypes.find(
1213
+ (docType) => id.startsWith(`${docType}${SEPARATOR}`)
1214
+ );
1215
+ }
1184
1216
  var DocumentTypesToImport = [
1185
1217
  "role" /* ROLE */,
1186
1218
  "datasource" /* DATASOURCE */,
@@ -1205,6 +1237,15 @@ var VirtualDocumentType = /* @__PURE__ */ ((VirtualDocumentType2) => {
1205
1237
  VirtualDocumentType2["ROW_ACTION"] = "row_action";
1206
1238
  return VirtualDocumentType2;
1207
1239
  })(VirtualDocumentType || {});
1240
+ var sortedVirtualDocumentTypes = Object.values(VirtualDocumentType).sort(
1241
+ (a, b) => b.length - a.length
1242
+ // descending
1243
+ );
1244
+ function getVirtualDocumentType(id) {
1245
+ return sortedVirtualDocumentTypes.find(
1246
+ (docType) => id.startsWith(`${docType}${SEPARATOR}`)
1247
+ );
1248
+ }
1208
1249
 
1209
1250
  // src/documents/app/backup.ts
1210
1251
  var AppBackupType = /* @__PURE__ */ ((AppBackupType2) => {
@@ -1426,6 +1467,7 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1426
1467
  FilterGroupLogicalOperator,
1427
1468
  FilterType,
1428
1469
  FormulaType,
1470
+ GroupByTypes,
1429
1471
  GroupType,
1430
1472
  Hosting,
1431
1473
  HttpMethod,
@@ -1445,6 +1487,7 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1445
1487
  MigrationName,
1446
1488
  MigrationType,
1447
1489
  MonthlyQuotaName,
1490
+ NumericTypes,
1448
1491
  Operation,
1449
1492
  PASSWORD_REPLACEMENT,
1450
1493
  PLUGIN_TYPE_ARR,
@@ -1487,6 +1530,9 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1487
1530
  ViewV2Type,
1488
1531
  VirtualDocumentType,
1489
1532
  WebhookActionType,
1533
+ canGroupBy,
1534
+ getDocumentType,
1535
+ getVirtualDocumentType,
1490
1536
  isAIConfig,
1491
1537
  isAppBackupMetadata,
1492
1538
  isCloudAccount,
@@ -1498,6 +1544,7 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1498
1544
  isManyToMany,
1499
1545
  isManyToOne,
1500
1546
  isMonthlyQuota,
1547
+ isNumeric,
1501
1548
  isOIDCConfig,
1502
1549
  isOneToMany,
1503
1550
  isPasswordAccount,