@budibase/types 3.4.24 → 3.5.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.
- package/dist/api/web/app/automation.d.ts +3 -1
- package/dist/api/web/app/query.d.ts +1 -1
- package/dist/api/web/app/rows/search.d.ts +2 -8
- package/dist/documents/app/automation/StepInputsOutputs.d.ts +13 -2
- package/dist/documents/app/automation/automation.d.ts +2 -9
- package/dist/documents/app/automation/schema.d.ts +5 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +3 -3
- package/dist/sdk/db.d.ts +1 -1
- package/dist/sdk/row.d.ts +1 -1
- package/dist/ui/stores/automations.d.ts +4 -3
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AutomationJob } from "../../../sdk/automations";
|
|
1
2
|
import { Automation, AutomationActionStepId, AutomationLogPage, AutomationResults, AutomationStatus, AutomationStepDefinition, AutomationTriggerDefinition, AutomationTriggerStepId, DidNotTriggerResponse, Row } from "../../../documents";
|
|
2
3
|
import { DocumentDestroyResponse } from "@budibase/nano";
|
|
3
4
|
export type GetAutomationTriggerDefinitionsResponse = Record<keyof typeof AutomationTriggerStepId, AutomationTriggerDefinition>;
|
|
@@ -53,5 +54,6 @@ export interface TestAutomationRequest {
|
|
|
53
54
|
row?: Row;
|
|
54
55
|
oldRow?: Row;
|
|
55
56
|
}
|
|
56
|
-
export type TestAutomationResponse = AutomationResults | DidNotTriggerResponse;
|
|
57
57
|
export declare function isDidNotTriggerResponse(response: TestAutomationResponse): response is DidNotTriggerResponse;
|
|
58
|
+
export declare function isAutomationResults(response: TestAutomationResponse): response is AutomationResults;
|
|
59
|
+
export type TestAutomationResponse = AutomationResults | DidNotTriggerResponse | AutomationJob;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmptyFilterOption } from "../../../../sdk";
|
|
2
2
|
import { Row } from "../../../../documents";
|
|
3
|
-
import { PaginationResponse, SortOrder
|
|
3
|
+
import { PaginationResponse, SortOrder } from "../../../../api/web/pagination";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
declare const searchRowRequest: z.ZodObject<{
|
|
6
6
|
query: z.ZodOptional<z.ZodObject<{
|
|
@@ -57,7 +57,6 @@ declare const searchRowRequest: z.ZodObject<{
|
|
|
57
57
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
58
58
|
sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
59
|
sortOrder: z.ZodOptional<z.ZodNativeEnum<typeof SortOrder>>;
|
|
60
|
-
sortType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof SortType>>>;
|
|
61
60
|
version: z.ZodOptional<z.ZodString>;
|
|
62
61
|
disableEscaping: z.ZodOptional<z.ZodBoolean>;
|
|
63
62
|
countRows: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -85,7 +84,6 @@ declare const searchRowRequest: z.ZodObject<{
|
|
|
85
84
|
paginate?: boolean | undefined;
|
|
86
85
|
bookmark?: string | number | null | undefined;
|
|
87
86
|
sortOrder?: SortOrder | undefined;
|
|
88
|
-
sortType?: SortType | null | undefined;
|
|
89
87
|
disableEscaping?: boolean | undefined;
|
|
90
88
|
countRows?: boolean | undefined;
|
|
91
89
|
}, {
|
|
@@ -112,7 +110,6 @@ declare const searchRowRequest: z.ZodObject<{
|
|
|
112
110
|
paginate?: boolean | undefined;
|
|
113
111
|
bookmark?: string | number | null | undefined;
|
|
114
112
|
sortOrder?: SortOrder | undefined;
|
|
115
|
-
sortType?: SortType | null | undefined;
|
|
116
113
|
disableEscaping?: boolean | undefined;
|
|
117
114
|
countRows?: boolean | undefined;
|
|
118
115
|
}>;
|
|
@@ -171,7 +168,6 @@ export declare const searchRowRequestValidator: z.ZodObject<{
|
|
|
171
168
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
172
169
|
sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
173
170
|
sortOrder: z.ZodOptional<z.ZodNativeEnum<typeof SortOrder>>;
|
|
174
|
-
sortType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof SortType>>>;
|
|
175
171
|
version: z.ZodOptional<z.ZodString>;
|
|
176
172
|
disableEscaping: z.ZodOptional<z.ZodBoolean>;
|
|
177
173
|
countRows: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -199,7 +195,6 @@ export declare const searchRowRequestValidator: z.ZodObject<{
|
|
|
199
195
|
paginate?: boolean | undefined;
|
|
200
196
|
bookmark?: string | number | null | undefined;
|
|
201
197
|
sortOrder?: SortOrder | undefined;
|
|
202
|
-
sortType?: SortType | null | undefined;
|
|
203
198
|
disableEscaping?: boolean | undefined;
|
|
204
199
|
countRows?: boolean | undefined;
|
|
205
200
|
}, {
|
|
@@ -226,12 +221,11 @@ export declare const searchRowRequestValidator: z.ZodObject<{
|
|
|
226
221
|
paginate?: boolean | undefined;
|
|
227
222
|
bookmark?: string | number | null | undefined;
|
|
228
223
|
sortOrder?: SortOrder | undefined;
|
|
229
|
-
sortType?: SortType | null | undefined;
|
|
230
224
|
disableEscaping?: boolean | undefined;
|
|
231
225
|
countRows?: boolean | undefined;
|
|
232
226
|
}>;
|
|
233
227
|
export type SearchRowRequest = z.infer<typeof searchRowRequest>;
|
|
234
|
-
export type SearchViewRowRequest = Pick<SearchRowRequest, "sort" | "sortOrder" | "
|
|
228
|
+
export type SearchViewRowRequest = Pick<SearchRowRequest, "sort" | "sortOrder" | "limit" | "bookmark" | "paginate" | "query" | "countRows">;
|
|
235
229
|
export interface SearchRowResponse {
|
|
236
230
|
rows: Row[];
|
|
237
231
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Table } from "@budibase/types";
|
|
1
2
|
import { SortOrder } from "../../../api";
|
|
2
3
|
import { SearchFilters, EmptyFilterOption, BasicOperator, LogicalOperator } from "../../../sdk";
|
|
3
4
|
import { HttpMethod } from "../query";
|
|
@@ -237,11 +238,21 @@ export type RowUpdatedTriggerOutputs = {
|
|
|
237
238
|
row: Row;
|
|
238
239
|
id: string;
|
|
239
240
|
revision?: string;
|
|
241
|
+
oldRow?: Row;
|
|
240
242
|
};
|
|
241
243
|
export type WebhookTriggerInputs = {
|
|
242
244
|
schemaUrl: string;
|
|
243
245
|
triggerUrl: string;
|
|
244
246
|
};
|
|
245
|
-
export type WebhookTriggerOutputs = {
|
|
246
|
-
|
|
247
|
+
export type WebhookTriggerOutputs = Record<string, any> & {
|
|
248
|
+
body: Record<string, any>;
|
|
249
|
+
};
|
|
250
|
+
export type RowActionTriggerInputs = {
|
|
251
|
+
tableId: string;
|
|
252
|
+
};
|
|
253
|
+
export type RowActionTriggerOutputs = {
|
|
254
|
+
row: Row;
|
|
255
|
+
id: string;
|
|
256
|
+
revision?: string;
|
|
257
|
+
table: Table;
|
|
247
258
|
};
|
|
@@ -58,6 +58,7 @@ export declare enum AutomationActionStepId {
|
|
|
58
58
|
EXECUTE_BASH = "EXECUTE_BASH",
|
|
59
59
|
OUTGOING_WEBHOOK = "OUTGOING_WEBHOOK",
|
|
60
60
|
EXECUTE_SCRIPT = "EXECUTE_SCRIPT",
|
|
61
|
+
EXECUTE_SCRIPT_V2 = "EXECUTE_SCRIPT_V2",
|
|
61
62
|
EXECUTE_QUERY = "EXECUTE_QUERY",
|
|
62
63
|
SERVER_LOG = "SERVER_LOG",
|
|
63
64
|
DELAY = "DELAY",
|
|
@@ -114,15 +115,7 @@ export interface Automation extends Document {
|
|
|
114
115
|
internal?: boolean;
|
|
115
116
|
type?: string;
|
|
116
117
|
disabled?: boolean;
|
|
117
|
-
testData?:
|
|
118
|
-
row?: Row;
|
|
119
|
-
meta: {
|
|
120
|
-
[key: string]: unknown;
|
|
121
|
-
};
|
|
122
|
-
id: string;
|
|
123
|
-
revision: string;
|
|
124
|
-
oldRow?: Row;
|
|
125
|
-
};
|
|
118
|
+
testData?: AutomationTriggerResultOutputs;
|
|
126
119
|
}
|
|
127
120
|
export interface BaseIOStructure {
|
|
128
121
|
type?: AutomationIOType;
|
|
@@ -8,6 +8,7 @@ export type ActionImplementations<T extends Hosting> = {
|
|
|
8
8
|
[AutomationActionStepId.DELETE_ROW]: ActionImplementation<DeleteRowStepInputs, DeleteRowStepOutputs>;
|
|
9
9
|
[AutomationActionStepId.EXECUTE_QUERY]: ActionImplementation<ExecuteQueryStepInputs, ExecuteQueryStepOutputs>;
|
|
10
10
|
[AutomationActionStepId.EXECUTE_SCRIPT]: ActionImplementation<ExecuteScriptStepInputs, ExecuteScriptStepOutputs>;
|
|
11
|
+
[AutomationActionStepId.EXECUTE_SCRIPT_V2]: ActionImplementation<ExecuteScriptStepInputs, ExecuteScriptStepOutputs>;
|
|
11
12
|
[AutomationActionStepId.FILTER]: ActionImplementation<FilterStepInputs, FilterStepOutputs>;
|
|
12
13
|
[AutomationActionStepId.QUERY_ROWS]: ActionImplementation<QueryRowsStepInputs, QueryRowsStepOutputs>;
|
|
13
14
|
[AutomationActionStepId.SEND_EMAIL_SMTP]: ActionImplementation<SmtpEmailStepInputs, BaseAutomationOutputs>;
|
|
@@ -34,6 +35,7 @@ export interface AutomationStepSchemaBase {
|
|
|
34
35
|
type: AutomationStepType;
|
|
35
36
|
internal?: boolean;
|
|
36
37
|
deprecated?: boolean;
|
|
38
|
+
new?: boolean;
|
|
37
39
|
blockToLoop?: string;
|
|
38
40
|
schema: {
|
|
39
41
|
inputs: InputOutputBlock;
|
|
@@ -42,7 +44,7 @@ export interface AutomationStepSchemaBase {
|
|
|
42
44
|
custom?: boolean;
|
|
43
45
|
features?: Partial<Record<AutomationFeature, boolean>>;
|
|
44
46
|
}
|
|
45
|
-
export type AutomationStepInputs<T extends AutomationActionStepId> = T extends AutomationActionStepId.COLLECT ? CollectStepInputs : T extends AutomationActionStepId.CREATE_ROW ? CreateRowStepInputs : T extends AutomationActionStepId.DELAY ? DelayStepInputs : T extends AutomationActionStepId.DELETE_ROW ? DeleteRowStepInputs : T extends AutomationActionStepId.EXECUTE_QUERY ? ExecuteQueryStepInputs : T extends AutomationActionStepId.EXECUTE_SCRIPT ? ExecuteScriptStepInputs : T extends AutomationActionStepId.FILTER ? FilterStepInputs : T extends AutomationActionStepId.QUERY_ROWS ? QueryRowsStepInputs : T extends AutomationActionStepId.SEND_EMAIL_SMTP ? SmtpEmailStepInputs : T extends AutomationActionStepId.SERVER_LOG ? ServerLogStepInputs : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN ? TriggerAutomationStepInputs : T extends AutomationActionStepId.UPDATE_ROW ? UpdateRowStepInputs : T extends AutomationActionStepId.OUTGOING_WEBHOOK ? OutgoingWebhookStepInputs : T extends AutomationActionStepId.discord ? DiscordStepInputs : T extends AutomationActionStepId.slack ? SlackStepInputs : T extends AutomationActionStepId.zapier ? ZapierStepInputs : T extends AutomationActionStepId.integromat ? MakeIntegrationInputs : T extends AutomationActionStepId.n8n ? n8nStepInputs : T extends AutomationActionStepId.EXECUTE_BASH ? BashStepInputs : T extends AutomationActionStepId.OPENAI ? OpenAIStepInputs : T extends AutomationActionStepId.LOOP ? LoopStepInputs : T extends AutomationActionStepId.BRANCH ? BranchStepInputs : never;
|
|
47
|
+
export type AutomationStepInputs<T extends AutomationActionStepId> = T extends AutomationActionStepId.COLLECT ? CollectStepInputs : T extends AutomationActionStepId.CREATE_ROW ? CreateRowStepInputs : T extends AutomationActionStepId.DELAY ? DelayStepInputs : T extends AutomationActionStepId.DELETE_ROW ? DeleteRowStepInputs : T extends AutomationActionStepId.EXECUTE_QUERY ? ExecuteQueryStepInputs : T extends AutomationActionStepId.EXECUTE_SCRIPT ? ExecuteScriptStepInputs : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2 ? ExecuteScriptStepInputs : T extends AutomationActionStepId.FILTER ? FilterStepInputs : T extends AutomationActionStepId.QUERY_ROWS ? QueryRowsStepInputs : T extends AutomationActionStepId.SEND_EMAIL_SMTP ? SmtpEmailStepInputs : T extends AutomationActionStepId.SERVER_LOG ? ServerLogStepInputs : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN ? TriggerAutomationStepInputs : T extends AutomationActionStepId.UPDATE_ROW ? UpdateRowStepInputs : T extends AutomationActionStepId.OUTGOING_WEBHOOK ? OutgoingWebhookStepInputs : T extends AutomationActionStepId.discord ? DiscordStepInputs : T extends AutomationActionStepId.slack ? SlackStepInputs : T extends AutomationActionStepId.zapier ? ZapierStepInputs : T extends AutomationActionStepId.integromat ? MakeIntegrationInputs : T extends AutomationActionStepId.n8n ? n8nStepInputs : T extends AutomationActionStepId.EXECUTE_BASH ? BashStepInputs : T extends AutomationActionStepId.OPENAI ? OpenAIStepInputs : T extends AutomationActionStepId.LOOP ? LoopStepInputs : T extends AutomationActionStepId.BRANCH ? BranchStepInputs : never;
|
|
46
48
|
export type AutomationStepOutputs<T extends AutomationActionStepId> = T extends AutomationActionStepId.COLLECT ? CollectStepOutputs : T extends AutomationActionStepId.CREATE_ROW ? CreateRowStepOutputs : T extends AutomationActionStepId.DELAY ? DelayStepOutputs : T extends AutomationActionStepId.DELETE_ROW ? DeleteRowStepOutputs : T extends AutomationActionStepId.EXECUTE_QUERY ? ExecuteQueryStepOutputs : T extends AutomationActionStepId.EXECUTE_SCRIPT ? ExecuteScriptStepOutputs : T extends AutomationActionStepId.FILTER ? FilterStepOutputs : T extends AutomationActionStepId.QUERY_ROWS ? QueryRowsStepOutputs : T extends AutomationActionStepId.SEND_EMAIL_SMTP ? BaseAutomationOutputs : T extends AutomationActionStepId.SERVER_LOG ? ServerLogStepOutputs : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN ? TriggerAutomationStepOutputs : T extends AutomationActionStepId.UPDATE_ROW ? UpdateRowStepOutputs : T extends AutomationActionStepId.OUTGOING_WEBHOOK ? ExternalAppStepOutputs : T extends AutomationActionStepId.discord ? ExternalAppStepOutputs : T extends AutomationActionStepId.slack ? ExternalAppStepOutputs : T extends AutomationActionStepId.zapier ? ZapierStepOutputs : T extends AutomationActionStepId.integromat ? ExternalAppStepOutputs : T extends AutomationActionStepId.n8n ? ExternalAppStepOutputs : T extends AutomationActionStepId.EXECUTE_BASH ? BashStepOutputs : T extends AutomationActionStepId.OPENAI ? OpenAIStepOutputs : T extends AutomationActionStepId.LOOP ? BaseAutomationOutputs : never;
|
|
47
49
|
export interface AutomationStepSchema<TStep extends AutomationActionStepId> extends AutomationStepSchemaBase {
|
|
48
50
|
id: string;
|
|
@@ -55,6 +57,7 @@ export type DelayStep = AutomationStepSchema<AutomationActionStepId.DELAY>;
|
|
|
55
57
|
export type DeleteRowStep = AutomationStepSchema<AutomationActionStepId.DELETE_ROW>;
|
|
56
58
|
export type ExecuteQueryStep = AutomationStepSchema<AutomationActionStepId.EXECUTE_QUERY>;
|
|
57
59
|
export type ExecuteScriptStep = AutomationStepSchema<AutomationActionStepId.EXECUTE_SCRIPT>;
|
|
60
|
+
export type ExecuteScriptV2Step = AutomationStepSchema<AutomationActionStepId.EXECUTE_SCRIPT_V2>;
|
|
58
61
|
export type FilterStep = AutomationStepSchema<AutomationActionStepId.FILTER>;
|
|
59
62
|
export type QueryRowsStep = AutomationStepSchema<AutomationActionStepId.QUERY_ROWS>;
|
|
60
63
|
export type SendEmailSmtpStep = AutomationStepSchema<AutomationActionStepId.SEND_EMAIL_SMTP>;
|
|
@@ -71,7 +74,7 @@ export type ExecuteBashStep = AutomationStepSchema<AutomationActionStepId.EXECUT
|
|
|
71
74
|
export type OpenAIStep = AutomationStepSchema<AutomationActionStepId.OPENAI>;
|
|
72
75
|
export type LoopStep = AutomationStepSchema<AutomationActionStepId.LOOP>;
|
|
73
76
|
export type BranchStep = AutomationStepSchema<AutomationActionStepId.BRANCH>;
|
|
74
|
-
export type AutomationStep = CollectStep | CreateRowStep | DelayStep | DeleteRowStep | ExecuteQueryStep | ExecuteScriptStep | FilterStep | QueryRowsStep | SendEmailSmtpStep | ServerLogStep | TriggerAutomationRunStep | UpdateRowStep | OutgoingWebhookStep | DiscordStep | SlackStep | ZapierStep | IntegromatStep | N8nStep | LoopStep | ExecuteBashStep | OpenAIStep | BranchStep;
|
|
77
|
+
export type AutomationStep = CollectStep | CreateRowStep | DelayStep | DeleteRowStep | ExecuteQueryStep | ExecuteScriptStep | ExecuteScriptV2Step | FilterStep | QueryRowsStep | SendEmailSmtpStep | ServerLogStep | TriggerAutomationRunStep | UpdateRowStep | OutgoingWebhookStep | DiscordStep | SlackStep | ZapierStep | IntegromatStep | N8nStep | LoopStep | ExecuteBashStep | OpenAIStep | BranchStep;
|
|
75
78
|
export declare function isBranchStep(step: AutomationStep | AutomationTrigger): step is BranchStep;
|
|
76
79
|
export declare function isTrigger(step: AutomationStep | AutomationTrigger): step is AutomationTrigger;
|
|
77
80
|
export declare function isRowUpdateTrigger(step: AutomationStep | AutomationTrigger): step is RowUpdatedTrigger;
|