@budibase/types 3.42.0 → 3.44.0

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,10 +1,6 @@
1
1
  import { Optional } from "../../../shared";
2
- import { Agent, AgentSharePointKnowledgeSourceScope, AgentKnowledgeSourceSyncRunStatus, AgentOperation, ChatApp, ChatConversation, ChatConversationRequest, CreateChatConversationRequest, KnowledgeBaseFile } from "../../../documents";
2
+ import { Agent, AgentSharePointKnowledgeSourceScope, AgentKnowledgeSourceSyncRunStatus, AgentOperation, ChatConversationRequest, KnowledgeBaseFile } from "../../../documents";
3
3
  export type ChatAgentRequest = ChatConversationRequest;
4
- export type FetchAgentHistoryResponse = ChatConversation[];
5
- export type { CreateChatConversationRequest };
6
- export type CreateChatAppRequest = Omit<ChatApp, "_id" | "_rev" | "createdAt" | "updatedAt">;
7
- export type UpdateChatAppRequest = Omit<ChatApp, "createdAt" | "updatedAt">;
8
4
  export interface FetchAgentsResponse {
9
5
  agents: Agent[];
10
6
  }
@@ -94,33 +90,32 @@ export interface DisconnectAgentSharePointSiteResponse {
94
90
  disconnected: true;
95
91
  siteId: string;
96
92
  }
97
- export interface FetchChatAppAgentsResponse {
98
- agents: Pick<Agent, "_id" | "name" | "icon" | "iconColor" | "live">[];
99
- }
100
- interface ConfigureAgentDeploymentChannelRequest {
101
- chatAppId?: string;
102
- }
103
93
  interface ConfigureAgentDeploymentChannelResponse {
104
94
  success: boolean;
105
- chatAppId: string;
106
- }
107
- export type SyncAgentDiscordCommandsRequest = ConfigureAgentDeploymentChannelRequest;
108
- export interface SyncAgentDiscordCommandsResponse extends ConfigureAgentDeploymentChannelResponse {
109
- interactionsEndpointUrl: string;
110
- inviteUrl: string;
111
95
  }
112
- export type ProvisionAgentMSTeamsChannelRequest = ConfigureAgentDeploymentChannelRequest;
96
+ export type ProvisionAgentMSTeamsChannelRequest = Record<string, never>;
113
97
  export interface ProvisionAgentMSTeamsChannelResponse extends ConfigureAgentDeploymentChannelResponse {
114
98
  messagingEndpointUrl: string;
115
99
  }
116
- export type ProvisionAgentSlackChannelRequest = ConfigureAgentDeploymentChannelRequest;
100
+ export type ProvisionAgentSlackChannelRequest = Record<string, never>;
117
101
  export interface ProvisionAgentSlackChannelResponse extends ConfigureAgentDeploymentChannelResponse {
118
102
  messagingEndpointUrl: string;
119
103
  }
120
- export type ProvisionAgentTelegramChannelRequest = ConfigureAgentDeploymentChannelRequest;
121
- export interface ProvisionAgentTelegramChannelResponse extends ConfigureAgentDeploymentChannelResponse {
104
+ export type CreateAgentSlackAppRequest = Record<string, never>;
105
+ export interface CreateAgentSlackAppResponse extends ConfigureAgentDeploymentChannelResponse {
106
+ appId: string;
107
+ oauthAuthorizeUrl: string;
122
108
  messagingEndpointUrl: string;
123
- warning?: string;
109
+ }
110
+ export interface SlackAppConfigResponse {
111
+ configured: boolean;
112
+ updatedAt?: string;
113
+ expiresAt?: string;
114
+ needsReconfiguration?: boolean;
115
+ }
116
+ export interface SaveSlackAppConfigRequest {
117
+ configToken: string;
118
+ refreshToken: string;
124
119
  }
125
120
  export interface ToggleAgentDeploymentRequest {
126
121
  enabled: boolean;
@@ -138,3 +133,4 @@ export type AgentOperationConfigRequest = Pick<AgentOperation, "name" | "live" |
138
133
  export type CreateAgentOperationRequest = AgentOperationConfigRequest & Pick<AgentOperation, "id">;
139
134
  export type UpdateAgentOperationRequest = Partial<AgentOperationConfigRequest>;
140
135
  export type AgentOperationMutationResponse = Omit<Agent, "knowledgeSources" | "knowledgeBases">;
136
+ export {};
@@ -16,6 +16,7 @@ export * from "./permission";
16
16
  export * from "./query";
17
17
  export * from "./recaptcha";
18
18
  export * from "./resource";
19
+ export * from "./restTemplate";
19
20
  export * from "./role";
20
21
  export * from "./rowAction";
21
22
  export * from "./rows";
@@ -1,5 +1,6 @@
1
1
  import { Datasource, ImportEndpoint, Query, QueryPreview, QuerySchema, SecurityScheme } from "../../../documents";
2
2
  import { OpenAPIServer } from "../../../ui/rest";
3
+ import type { CustomRestTemplateId } from "../../../ui/rest";
3
4
  export type FetchQueriesResponse = Query[];
4
5
  export interface SaveQueryRequest extends Query {
5
6
  }
@@ -9,12 +10,14 @@ export interface ImportRestQueryRequest {
9
10
  datasourceId?: string;
10
11
  data?: string;
11
12
  url?: string;
13
+ restTemplateId?: CustomRestTemplateId;
12
14
  datasource: Datasource;
13
15
  selectedEndpointId?: string;
14
16
  }
15
17
  export interface ImportRestQueryInfoRequest {
16
18
  data?: string;
17
19
  url?: string;
20
+ restTemplateId?: CustomRestTemplateId;
18
21
  }
19
22
  export interface ImportRestQueryInfoResponse {
20
23
  name: string;
@@ -0,0 +1,15 @@
1
+ import type { RestTemplate } from "../../../ui/rest";
2
+ export interface UploadCustomRestTemplateRequest {
3
+ name: string;
4
+ description: string;
5
+ }
6
+ export interface UploadCustomRestTemplateResponse {
7
+ template: RestTemplate;
8
+ }
9
+ export interface UpdateCustomRestTemplateResponse {
10
+ template: RestTemplate;
11
+ }
12
+ export type FetchCustomRestTemplatesResponse = RestTemplate[];
13
+ export interface DeleteCustomRestTemplateResponse {
14
+ message: string;
15
+ }
@@ -74,18 +74,6 @@ export interface PublishedWorkspaceData {
74
74
  export interface FetchPublishedAppsResponse {
75
75
  apps: PublishedWorkspaceData[];
76
76
  }
77
- export interface PublishedChatAppData {
78
- appId: string;
79
- chatAppId: string;
80
- agentId: string;
81
- agentName: string;
82
- name: string;
83
- url: string;
84
- updatedAt?: string;
85
- }
86
- export interface FetchPublishedChatAppsResponse {
87
- chatApps: PublishedChatAppData[];
88
- }
89
77
  export interface UpdateWorkspaceRequest extends Partial<Workspace> {
90
78
  }
91
79
  export interface UpdateWorkspaceResponse extends Workspace {
@@ -38,9 +38,9 @@ export declare enum DocumentType {
38
38
  OAUTH2_CONFIG = "oauth2",
39
39
  OAUTH2_CONFIG_LOG = "oauth2log",
40
40
  AGENT = "agent",
41
- CHAT_APP = "chatapp",
42
41
  CHAT_CONVERSATION = "chatconvo",
43
42
  CHAT_IDENTITY_LINK = "chatidentitylink",
43
+ SLACK_APP_CONFIG = "slackappconfig",
44
44
  AGENT_TOOL_SOURCE = "agenttoolsource",
45
45
  AGENT_FILE = "agentfile",
46
46
  AGENT_LOG_SESSION = "agentlogsession",
@@ -57,6 +57,7 @@ export declare enum DocumentType {
57
57
  WORKSPACE_APP = "workspace_app",
58
58
  WORKSPACE_FAVOURITE = "workspace_favourite",
59
59
  PROJECT = "project",
60
+ REST_TEMPLATE = "rest_template",
60
61
  AUTO_COLUMN_STATE = "autocolumn_state",
61
62
  ESCALATION_CONTEXT = "escalation_context",
62
63
  ESCALATION_NOTIFICATION = "escalation_notification"
@@ -10,6 +10,16 @@ export declare enum ToolType {
10
10
  SEARCH = "SEARCH",
11
11
  ESCALATION = "ESCALATION"
12
12
  }
13
+ export declare enum ToolExecutionPrincipal {
14
+ REQUESTER = "requester",
15
+ ADMIN = "admin"
16
+ }
17
+ export type ToolExecutionPolicy = {
18
+ mode: "admin";
19
+ } | {
20
+ mode: "configurable";
21
+ defaultPrincipal: ToolExecutionPrincipal;
22
+ };
13
23
  export interface ToolMetadata {
14
24
  name: string;
15
25
  readableName?: string;
@@ -17,38 +27,31 @@ export interface ToolMetadata {
17
27
  sourceType: ToolType;
18
28
  sourceLabel?: string;
19
29
  sourceIconType?: string;
30
+ executionPolicy: ToolExecutionPolicy;
20
31
  }
21
32
  interface ChatAgentIntegration {
22
- chatAppId?: string;
23
33
  idleTimeoutMinutes?: number;
24
34
  requireUserLink?: boolean;
25
35
  }
26
- export interface DiscordAgentIntegration extends ChatAgentIntegration {
27
- applicationId?: string;
28
- publicKey?: string;
29
- botToken?: string;
30
- guildId?: string;
31
- interactionsEndpointUrl?: string;
32
- }
33
36
  export interface MSTeamsAgentIntegration extends ChatAgentIntegration {
34
37
  appId?: string;
35
38
  appPassword?: string;
36
39
  tenantId?: string;
37
40
  teamId?: string;
38
41
  messagingEndpointUrl?: string;
42
+ appPackageVersion?: string;
39
43
  }
40
44
  export interface SlackAgentIntegration extends ChatAgentIntegration {
45
+ appId?: string;
46
+ clientId?: string;
47
+ clientSecret?: string;
41
48
  botToken?: string;
49
+ botUserId?: string;
42
50
  signingSecret?: string;
51
+ teamName?: string;
43
52
  messagingEndpointUrl?: string;
44
53
  teamId?: string;
45
54
  }
46
- export interface TelegramAgentIntegration extends ChatAgentIntegration {
47
- botToken?: string;
48
- webhookSecretToken?: string;
49
- botUserName?: string;
50
- messagingEndpointUrl?: string;
51
- }
52
55
  export declare enum AgentKnowledgeSourceType {
53
56
  SHAREPOINT = "sharepoint"
54
57
  }
@@ -101,12 +104,33 @@ export interface AgentEscalationConfig {
101
104
  recipients?: EscalationRecipient[];
102
105
  delay?: number;
103
106
  }
107
+ export interface AgentOperationToolConfig {
108
+ toolName: string;
109
+ executionPrincipal: ToolExecutionPrincipal;
110
+ }
111
+ export interface AgentRequester {
112
+ userId: string;
113
+ authorization: {
114
+ mode: "current";
115
+ } | {
116
+ mode: "preview";
117
+ roleId: string;
118
+ };
119
+ }
120
+ export interface AgentExecutionContext {
121
+ tenantId: string;
122
+ workspaceId: string;
123
+ agentId: string;
124
+ operationId: string;
125
+ conversationId: string;
126
+ requester: AgentRequester;
127
+ }
104
128
  export interface AgentOperation {
105
129
  id: string;
106
130
  name: string;
107
131
  live: boolean;
108
132
  promptInstructions?: string;
109
- enabledTools?: string[];
133
+ enabledTools?: AgentOperationToolConfig[];
110
134
  knowledgeBases?: string[];
111
135
  knowledgeSources?: AgentKnowledgeSource[];
112
136
  allowKnowledgeSourceDownload: boolean;
@@ -124,10 +148,8 @@ export interface Agent extends Document {
124
148
  icon?: string;
125
149
  iconColor?: string;
126
150
  createdBy?: string;
127
- discordIntegration?: DiscordAgentIntegration;
128
151
  MSTeamsIntegration?: MSTeamsAgentIntegration;
129
152
  slackIntegration?: SlackAgentIntegration;
130
- telegramIntegration?: TelegramAgentIntegration;
131
153
  }
132
154
  export interface AgentMessageRagSource {
133
155
  sourceId: string;
@@ -1,38 +1,17 @@
1
1
  import { AgentMessageMetadata, Document } from "../../";
2
2
  import type { UIMessage } from "ai";
3
3
  export declare enum AgentChannelProvider {
4
- DISCORD = "discord",
5
4
  MSTEAMS = "msteams",
6
- SLACK = "slack",
7
- TELEGRAM = "telegram"
5
+ SLACK = "slack"
8
6
  }
9
7
  export type ChatIdentityLinkProvider = AgentChannelProvider;
10
8
  /** Maps provider to deployment UI channel id (e.g. MSTeams for display) */
11
9
  export declare const DEPLOYMENT_CHANNEL_IDS: Record<AgentChannelProvider, string>;
12
10
  export declare const DEPLOYMENT_ID_TO_PROVIDER: Record<string, AgentChannelProvider>;
13
- export interface ConversationStarter {
14
- prompt: string;
15
- }
16
- export interface ChatAppAgent {
17
- agentId: string;
18
- isEnabled: boolean;
19
- isDefault: boolean;
20
- roleId?: string;
21
- conversationStarters?: ConversationStarter[];
22
- }
23
- export interface ChatApp extends Document {
24
- title?: string;
25
- greeting?: string;
26
- description?: string;
27
- agents: ChatAppAgent[];
28
- live?: boolean;
29
- settings?: Record<string, any>;
30
- }
31
11
  export interface ChatConversationChannel {
32
12
  provider: AgentChannelProvider;
33
13
  conversationId?: string;
34
14
  conversationType?: string;
35
- guildId?: string;
36
15
  teamId?: string;
37
16
  tenantId?: string;
38
17
  channelId?: string;
@@ -42,13 +21,12 @@ export interface ChatConversationChannel {
42
21
  serviceUrl?: string;
43
22
  }
44
23
  export interface ChatConversationRequest extends Document {
45
- chatAppId: string;
46
24
  agentId: string;
47
25
  title?: string;
48
26
  messages: UIMessage<AgentMessageMetadata>[];
49
27
  timezone?: string;
50
- transient?: boolean;
51
28
  isPreview?: boolean;
29
+ previewRoleId?: string;
52
30
  sessionId?: string;
53
31
  channel?: ChatConversationChannel;
54
32
  }
@@ -59,7 +37,6 @@ export interface WebhookChatCompleteResult {
59
37
  allowKnowledgeSourceDownload?: boolean;
60
38
  title?: string;
61
39
  }
62
- export type CreateChatConversationRequest = Pick<ChatConversationRequest, "chatAppId" | "agentId" | "title">;
63
40
  export type DraftChatConversation = Omit<ChatConversationRequest, "agentId"> & {
64
41
  agentId?: string;
65
42
  };
@@ -75,7 +52,6 @@ export interface ChatIdentityLink extends Document {
75
52
  linkedBy?: string;
76
53
  externalUserName?: string;
77
54
  teamId?: string;
78
- guildId?: string;
79
55
  providerTenantId?: string;
80
56
  serviceUrl?: string;
81
57
  }
@@ -67,9 +67,7 @@ export interface EscalationResult {
67
67
  export declare enum EscalationNotificationChannel {
68
68
  BUDIBASE = "budibase",
69
69
  SLACK = "slack",
70
- MSTEAMS = "msteams",
71
- DISCORD = "discord",
72
- TELEGRAM = "telegram"
70
+ MSTEAMS = "msteams"
73
71
  }
74
72
  export declare enum EscalationAction {
75
73
  APPROVE = "esc_approve",
@@ -10,10 +10,12 @@ export * from "./metadata";
10
10
  export * from "./oauth2";
11
11
  export * from "./project";
12
12
  export * from "./query";
13
+ export * from "./restTemplate";
13
14
  export * from "./role";
14
15
  export * from "./row";
15
16
  export * from "./rowAction";
16
17
  export * from "./screen";
18
+ export * from "./slack";
17
19
  export * from "./snippet";
18
20
  export * from "./sqlite";
19
21
  export * from "./table";
@@ -1,4 +1,5 @@
1
1
  import { Document } from "../document";
2
+ import { JSONValue } from "../../core";
2
3
  import { RestAuthType } from "./datasource";
3
4
  import { Row } from "./row";
4
5
  import type { RestTemplateId } from "../../ui";
@@ -67,6 +68,20 @@ export declare enum BodyType {
67
68
  JSON = "json",
68
69
  TEXT = "text"
69
70
  }
71
+ export declare const SecretTag: {
72
+ BASIC: string;
73
+ BEARER: string;
74
+ OAUTH2: string;
75
+ GENERIC: string;
76
+ };
77
+ export interface RestRequestPreview {
78
+ url: string;
79
+ path: string;
80
+ method: string;
81
+ headers: Record<string, string>;
82
+ params: Record<string, string>;
83
+ body?: JSONValue;
84
+ }
70
85
  export interface RestQueryFields {
71
86
  path?: string;
72
87
  rawPath?: string;
@@ -0,0 +1,12 @@
1
+ import type { CustomRestTemplateId } from "../../ui/rest";
2
+ import type { Document } from "../document";
3
+ export type CustomRestTemplateFileExtension = "json" | "yaml";
4
+ export interface CustomRestTemplateDocument extends Document {
5
+ _id: CustomRestTemplateId;
6
+ restTemplateId: CustomRestTemplateId;
7
+ name: string;
8
+ description: string;
9
+ objectStoreKey: string;
10
+ fileExtension: CustomRestTemplateFileExtension;
11
+ operationsCount: number;
12
+ }
@@ -0,0 +1,8 @@
1
+ import type { Document } from "../document";
2
+ export interface SlackAppConfig extends Document {
3
+ configToken: string;
4
+ refreshToken?: string;
5
+ expiresAt?: string;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ }