@budibase/types 2.32.15 → 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
  }
@@ -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
@@ -135,6 +135,8 @@ __export(src_exports, {
135
135
  VirtualDocumentType: () => VirtualDocumentType,
136
136
  WebhookActionType: () => WebhookActionType,
137
137
  canGroupBy: () => canGroupBy,
138
+ getDocumentType: () => getDocumentType,
139
+ getVirtualDocumentType: () => getVirtualDocumentType,
138
140
  isAIConfig: () => isAIConfig,
139
141
  isAppBackupMetadata: () => isAppBackupMetadata,
140
142
  isCloudAccount: () => isCloudAccount,
@@ -796,6 +798,7 @@ var FeatureFlag = /* @__PURE__ */ ((FeatureFlag2) => {
796
798
  FeatureFlag2["PER_CREATOR_PER_USER_PRICE_ALERT"] = "PER_CREATOR_PER_USER_PRICE_ALERT";
797
799
  FeatureFlag2["AI_CUSTOM_CONFIGS"] = "AI_CUSTOM_CONFIGS";
798
800
  FeatureFlag2["ENRICHED_RELATIONSHIPS"] = "ENRICHED_RELATIONSHIPS";
801
+ FeatureFlag2["TABLES_DEFAULT_ADMIN"] = "TABLES_DEFAULT_ADMIN";
799
802
  return FeatureFlag2;
800
803
  })(FeatureFlag || {});
801
804
 
@@ -1201,6 +1204,15 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
1201
1204
  DocumentType2["ROW_ACTIONS"] = "ra";
1202
1205
  return DocumentType2;
1203
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
+ }
1204
1216
  var DocumentTypesToImport = [
1205
1217
  "role" /* ROLE */,
1206
1218
  "datasource" /* DATASOURCE */,
@@ -1225,6 +1237,15 @@ var VirtualDocumentType = /* @__PURE__ */ ((VirtualDocumentType2) => {
1225
1237
  VirtualDocumentType2["ROW_ACTION"] = "row_action";
1226
1238
  return VirtualDocumentType2;
1227
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
+ }
1228
1249
 
1229
1250
  // src/documents/app/backup.ts
1230
1251
  var AppBackupType = /* @__PURE__ */ ((AppBackupType2) => {
@@ -1510,6 +1531,8 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1510
1531
  VirtualDocumentType,
1511
1532
  WebhookActionType,
1512
1533
  canGroupBy,
1534
+ getDocumentType,
1535
+ getVirtualDocumentType,
1513
1536
  isAIConfig,
1514
1537
  isAppBackupMetadata,
1515
1538
  isCloudAccount,