@budibase/types 3.10.5 → 3.10.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.
- package/dist/api/web/ai.d.ts +30 -4
- package/dist/api/web/app/automation.d.ts +3 -2
- package/dist/api/web/app/query.d.ts +1 -1
- package/dist/api/web/global/agents.d.ts +4 -0
- package/dist/api/web/global/index.d.ts +1 -0
- package/dist/documents/app/automation/StepInputsOutputs.d.ts +2 -1
- package/dist/documents/app/automation/automation.d.ts +6 -3
- package/dist/documents/app/layout.d.ts +9 -4
- package/dist/documents/document.d.ts +2 -1
- package/dist/documents/global/agents.d.ts +5 -0
- package/dist/documents/global/index.d.ts +1 -0
- package/dist/index.js +13 -13
- package/dist/index.js.map +4 -4
- package/dist/sdk/featureFlag.d.ts +1 -0
- package/package.json +2 -2
package/dist/api/web/ai.d.ts
CHANGED
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
import openai from "openai";
|
|
2
2
|
import { EnrichedBinding } from "../../ui";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
export interface SystemMessage {
|
|
5
|
+
role: "system";
|
|
5
6
|
content: string;
|
|
6
7
|
}
|
|
8
|
+
export interface UserMessage {
|
|
9
|
+
role: "user";
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AssistantMessage {
|
|
13
|
+
role: "assistant";
|
|
14
|
+
content: string | null;
|
|
15
|
+
tool_calls?: openai.ChatCompletionMessageToolCall[];
|
|
16
|
+
}
|
|
17
|
+
export interface ToolMessage {
|
|
18
|
+
role: "tool";
|
|
19
|
+
tool_call_id: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
export type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage;
|
|
23
|
+
export type Tool<T extends z.ZodType = z.ZodType> = Required<ToolArgs<T>>;
|
|
24
|
+
export interface ToolArgs<T extends z.ZodType> {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
parameters?: T;
|
|
28
|
+
handler: (args: z.infer<T>) => Promise<string>;
|
|
29
|
+
strict?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function newTool<T extends z.ZodType>(tool: ToolArgs<T>): Tool<T>;
|
|
7
32
|
export type ResponseFormat = "text" | "json" | openai.ResponseFormatJSONSchema;
|
|
8
33
|
export interface ChatCompletionRequest {
|
|
9
34
|
messages: Message[];
|
|
10
35
|
format?: ResponseFormat;
|
|
36
|
+
useTools?: boolean;
|
|
11
37
|
}
|
|
12
38
|
export interface ChatCompletionResponse {
|
|
13
|
-
|
|
14
|
-
tokensUsed
|
|
39
|
+
messages: Message[];
|
|
40
|
+
tokensUsed: number;
|
|
15
41
|
}
|
|
16
42
|
export interface GenerateJsRequest {
|
|
17
43
|
prompt: string;
|
|
@@ -42,7 +42,7 @@ export interface ClearAutomationLogResponse {
|
|
|
42
42
|
message: string;
|
|
43
43
|
}
|
|
44
44
|
export interface TriggerAutomationRequest {
|
|
45
|
-
fields
|
|
45
|
+
fields?: Record<string, any>;
|
|
46
46
|
timestamp?: number;
|
|
47
47
|
timeout: number;
|
|
48
48
|
}
|
|
@@ -50,7 +50,8 @@ export type TriggerAutomationResponse = Record<string, any> | undefined;
|
|
|
50
50
|
export interface TestAutomationRequest {
|
|
51
51
|
id?: string;
|
|
52
52
|
revision?: string;
|
|
53
|
-
|
|
53
|
+
timeout?: number;
|
|
54
|
+
fields?: Record<string, any>;
|
|
54
55
|
row?: Row;
|
|
55
56
|
oldRow?: Row;
|
|
56
57
|
}
|
|
@@ -32,7 +32,7 @@ export interface PreviewQueryResponse {
|
|
|
32
32
|
extra: any;
|
|
33
33
|
}
|
|
34
34
|
export interface ExecuteQueryRequest {
|
|
35
|
-
parameters?: Record<string, string>;
|
|
35
|
+
parameters?: Record<string, string | number | null>;
|
|
36
36
|
pagination?: any;
|
|
37
37
|
}
|
|
38
38
|
export type ExecuteV1QueryResponse = Record<string, any>[];
|
|
@@ -171,10 +171,11 @@ export type TriggerAutomationStepInputs = {
|
|
|
171
171
|
automation: {
|
|
172
172
|
automationId: string;
|
|
173
173
|
};
|
|
174
|
-
timeout
|
|
174
|
+
timeout?: number;
|
|
175
175
|
};
|
|
176
176
|
export type TriggerAutomationStepOutputs = BaseAutomationOutputs & {
|
|
177
177
|
value?: AutomationResults["steps"];
|
|
178
|
+
status: AutomationResults["status"];
|
|
178
179
|
};
|
|
179
180
|
export type UpdateRowStepInputs = {
|
|
180
181
|
meta: Record<string, any>;
|
|
@@ -13,6 +13,7 @@ export declare enum AutomationIOType {
|
|
|
13
13
|
ARRAY = "array",
|
|
14
14
|
JSON = "json",
|
|
15
15
|
DATE = "date",
|
|
16
|
+
DATETIME = "datetime",
|
|
16
17
|
ATTACHMENT = "attachment"
|
|
17
18
|
}
|
|
18
19
|
export declare enum AutomationCustomIOType {
|
|
@@ -151,10 +152,12 @@ export declare enum AutomationStatus {
|
|
|
151
152
|
ERROR = "error",
|
|
152
153
|
STOPPED = "stopped",
|
|
153
154
|
STOPPED_ERROR = "stopped_error",
|
|
154
|
-
NO_CONDITION_MET = "No branch condition met"
|
|
155
|
+
NO_CONDITION_MET = "No branch condition met",
|
|
156
|
+
TIMED_OUT = "timed_out"
|
|
155
157
|
}
|
|
156
158
|
export declare enum AutomationStoppedReason {
|
|
157
|
-
TRIGGER_FILTER_NOT_MET = "Automation did not run. Filter conditions in trigger were not met."
|
|
159
|
+
TRIGGER_FILTER_NOT_MET = "Automation did not run. Filter conditions in trigger were not met.",
|
|
160
|
+
TIMED_OUT = "Automation timed out."
|
|
158
161
|
}
|
|
159
162
|
export interface AutomationStepResultOutputs {
|
|
160
163
|
success: boolean;
|
|
@@ -179,7 +182,7 @@ export interface AutomationTriggerResult {
|
|
|
179
182
|
}
|
|
180
183
|
export interface AutomationResults {
|
|
181
184
|
automationId?: string;
|
|
182
|
-
status
|
|
185
|
+
status: AutomationStatus;
|
|
183
186
|
trigger: AutomationTriggerResult;
|
|
184
187
|
steps: [AutomationTriggerResult, ...AutomationStepResult[]];
|
|
185
188
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Document } from "../document";
|
|
2
2
|
export interface Layout extends Document {
|
|
3
|
-
componentLibraries
|
|
4
|
-
title
|
|
5
|
-
favicon
|
|
6
|
-
stylesheets
|
|
3
|
+
componentLibraries?: string[];
|
|
4
|
+
title?: string;
|
|
5
|
+
favicon?: string;
|
|
6
|
+
stylesheets?: string[];
|
|
7
7
|
props: any;
|
|
8
8
|
layoutId?: string;
|
|
9
9
|
name?: string;
|
|
10
|
+
navigation?: string;
|
|
11
|
+
pageWidth?: string;
|
|
12
|
+
embedded?: boolean;
|
|
13
|
+
logoUrl?: string;
|
|
14
|
+
hideTitle?: boolean;
|
|
10
15
|
}
|
|
@@ -39,7 +39,8 @@ export declare enum DocumentType {
|
|
|
39
39
|
SCIM_LOG = "scimlog",
|
|
40
40
|
ROW_ACTIONS = "ra",
|
|
41
41
|
OAUTH2_CONFIG = "oauth2",
|
|
42
|
-
OAUTH2_CONFIG_LOG = "oauth2log"
|
|
42
|
+
OAUTH2_CONFIG_LOG = "oauth2log",
|
|
43
|
+
AGENT_CHAT = "agentchat"
|
|
43
44
|
}
|
|
44
45
|
export declare function getDocumentType(id: string): DocumentType | undefined;
|
|
45
46
|
export declare const DocumentTypesToImport: DocumentType[];
|