@budibase/types 2.30.2 → 2.30.4

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.
@@ -0,0 +1,234 @@
1
+ import { SortOrder } from "../../../api";
2
+ import { SearchFilters, EmptyFilterOption } from "../../../sdk";
3
+ import { HttpMethod } from "../query";
4
+ import { Row } from "../row";
5
+ import { LoopStepType, EmailAttachment, AutomationResults } from "./automation";
6
+ import { AutomationStep, AutomationStepOutputs } from "./schema";
7
+ export type BaseAutomationOutputs = {
8
+ success?: boolean;
9
+ response?: {
10
+ [key: string]: any;
11
+ message?: string;
12
+ };
13
+ };
14
+ export type ExternalAppStepOutputs = {
15
+ httpStatus?: number;
16
+ response: string;
17
+ success: boolean;
18
+ };
19
+ export type BashStepInputs = {
20
+ code: string;
21
+ };
22
+ export type BashStepOutputs = BaseAutomationOutputs & {
23
+ stdout?: string;
24
+ };
25
+ export type CollectStepInputs = {
26
+ collection: string;
27
+ };
28
+ export type CollectStepOutputs = BaseAutomationOutputs & {
29
+ value?: any;
30
+ };
31
+ export type CreateRowStepInputs = {
32
+ row: Row;
33
+ };
34
+ export type CreateRowStepOutputs = BaseAutomationOutputs & {
35
+ row?: Row;
36
+ id?: string;
37
+ revision?: string;
38
+ };
39
+ export type DelayStepInputs = {
40
+ time: number;
41
+ };
42
+ export type DelayStepOutputs = BaseAutomationOutputs;
43
+ export type DeleteRowStepInputs = {
44
+ tableId: string;
45
+ id: string;
46
+ revision?: string;
47
+ };
48
+ export type DeleteRowStepOutputs = BaseAutomationOutputs & {
49
+ row?: Row;
50
+ };
51
+ export type DiscordStepInputs = {
52
+ url: string;
53
+ username?: string;
54
+ avatar_url?: string;
55
+ content: string;
56
+ };
57
+ export type ExecuteQueryStepInputs = {
58
+ query: {
59
+ queryId: string;
60
+ };
61
+ };
62
+ export type ExecuteQueryStepOutputs = BaseAutomationOutputs & {
63
+ info?: any;
64
+ };
65
+ export type ExecuteScriptStepInputs = {
66
+ code: string;
67
+ };
68
+ export type ExecuteScriptStepOutputs = BaseAutomationOutputs & {
69
+ value?: string;
70
+ };
71
+ export type FilterStepInputs = {
72
+ field: any;
73
+ condition: string;
74
+ value: any;
75
+ };
76
+ export type FilterStepOutputs = BaseAutomationOutputs & {
77
+ result: boolean;
78
+ refValue?: any;
79
+ comparisonValue?: any;
80
+ };
81
+ export type LoopStepInputs = {
82
+ option: LoopStepType;
83
+ binding: any;
84
+ iterations?: number;
85
+ failure?: string;
86
+ };
87
+ export type LoopStepOutputs = {
88
+ items: AutomationStepOutputs[];
89
+ success: boolean;
90
+ iterations: number;
91
+ };
92
+ export type BranchStepInputs = {
93
+ branches: Branch[];
94
+ children?: Record<string, AutomationStep[]>;
95
+ };
96
+ export type Branch = {
97
+ name: string;
98
+ condition: SearchFilters;
99
+ };
100
+ export type MakeIntegrationInputs = {
101
+ url: string;
102
+ body: any;
103
+ };
104
+ export type n8nStepInputs = {
105
+ url: string;
106
+ method: HttpMethod;
107
+ authorization: string;
108
+ body: any;
109
+ };
110
+ export type OpenAIStepInputs = {
111
+ prompt: string;
112
+ model: Model;
113
+ };
114
+ declare enum Model {
115
+ GPT_35_TURBO = "gpt-3.5-turbo",
116
+ GPT_4 = "gpt-4"
117
+ }
118
+ export type OpenAIStepOutputs = Omit<BaseAutomationOutputs, "response"> & {
119
+ response?: string | null;
120
+ };
121
+ export type QueryRowsStepInputs = {
122
+ tableId: string;
123
+ filters?: SearchFilters;
124
+ "filters-def"?: any;
125
+ sortColumn?: string;
126
+ sortOrder?: SortOrder;
127
+ limit?: number;
128
+ onEmptyFilter?: EmptyFilterOption;
129
+ };
130
+ export type QueryRowsStepOutputs = BaseAutomationOutputs & {
131
+ rows?: Row[];
132
+ };
133
+ export type SmtpEmailStepInputs = {
134
+ to: string;
135
+ from: string;
136
+ subject: string;
137
+ contents: string;
138
+ cc: string;
139
+ bcc: string;
140
+ addInvite?: boolean;
141
+ startTime: Date;
142
+ endTime: Date;
143
+ summary: string;
144
+ location?: string;
145
+ url?: string;
146
+ attachments?: EmailAttachment[];
147
+ };
148
+ export type SmtpEmailStepOutputs = BaseAutomationOutputs;
149
+ export type ServerLogStepInputs = {
150
+ text: string;
151
+ };
152
+ export type ServerLogStepOutputs = BaseAutomationOutputs & {
153
+ message: string;
154
+ };
155
+ export type SlackStepInputs = {
156
+ url: string;
157
+ text: string;
158
+ };
159
+ export type TriggerAutomationStepInputs = {
160
+ automation: {
161
+ automationId: string;
162
+ };
163
+ timeout: number;
164
+ };
165
+ export type TriggerAutomationStepOutputs = BaseAutomationOutputs & {
166
+ value?: AutomationResults["steps"];
167
+ };
168
+ export type UpdateRowStepInputs = {
169
+ meta: Record<string, any>;
170
+ row: Row;
171
+ rowId: string;
172
+ };
173
+ export type UpdateRowStepOutputs = BaseAutomationOutputs & {
174
+ row?: Row;
175
+ id?: string;
176
+ revision?: string;
177
+ };
178
+ export type ZapierStepInputs = {
179
+ url: string;
180
+ body: any;
181
+ };
182
+ export type ZapierStepOutputs = Omit<ExternalAppStepOutputs, "response"> & {
183
+ response: string;
184
+ };
185
+ declare enum RequestType {
186
+ POST = "POST",
187
+ GET = "GET",
188
+ PUT = "PUT",
189
+ DELETE = "DELETE",
190
+ PATCH = "PATCH"
191
+ }
192
+ export type OutgoingWebhookStepInputs = {
193
+ requestMethod: RequestType;
194
+ url: string;
195
+ requestBody: string;
196
+ headers: string;
197
+ };
198
+ export type AppActionTriggerInputs = {
199
+ fields: object;
200
+ };
201
+ export type AppActionTriggerOutputs = {
202
+ fields: object;
203
+ };
204
+ export type CronTriggerInputs = {
205
+ cron: string;
206
+ };
207
+ export type CronTriggerOutputs = {
208
+ timestamp: number;
209
+ };
210
+ export type RowDeletedTriggerInputs = {
211
+ tableId: string;
212
+ };
213
+ export type RowDeletedTriggerOutputs = {
214
+ row: Row;
215
+ };
216
+ export type RowCreatedTriggerInputs = {
217
+ tableId: string;
218
+ filters?: SearchFilters;
219
+ };
220
+ export type RowCreatedTriggerOutputs = {
221
+ row: Row;
222
+ id: string;
223
+ revision: string;
224
+ };
225
+ export type RowUpdatedTriggerInputs = {
226
+ tableId: string;
227
+ filters?: SearchFilters;
228
+ };
229
+ export type RowUpdatedTriggerOutputs = {
230
+ row: Row;
231
+ id: string;
232
+ revision?: string;
233
+ };
234
+ export {};
@@ -4,6 +4,7 @@ import { User } from "../../global";
4
4
  import { ReadStream } from "fs";
5
5
  import { Row } from "../row";
6
6
  import { Table } from "../table";
7
+ import { AutomationStep, AutomationTrigger } from "./schema";
7
8
  export declare enum AutomationIOType {
8
9
  OBJECT = "object",
9
10
  STRING = "string",
@@ -66,6 +67,7 @@ export declare enum AutomationActionStepId {
66
67
  COLLECT = "COLLECT",
67
68
  OPENAI = "OPENAI",
68
69
  TRIGGER_AUTOMATION_RUN = "TRIGGER_AUTOMATION_RUN",
70
+ BRANCH = "BRANCH",
69
71
  discord = "discord",
70
72
  slack = "slack",
71
73
  zapier = "zapier",
@@ -141,39 +143,9 @@ export interface InputOutputBlock {
141
143
  };
142
144
  required?: string[];
143
145
  }
144
- export interface AutomationStepSchema {
145
- name: string;
146
- stepTitle?: string;
147
- tagline: string;
148
- icon: string;
149
- description: string;
150
- type: AutomationStepType;
151
- internal?: boolean;
152
- deprecated?: boolean;
153
- stepId: AutomationTriggerStepId | AutomationActionStepId;
154
- blockToLoop?: string;
155
- inputs: Record<string, any>;
156
- schema: {
157
- inputs: InputOutputBlock;
158
- outputs: InputOutputBlock;
159
- };
160
- custom?: boolean;
161
- features?: Partial<Record<AutomationFeature, boolean>>;
162
- }
163
146
  export declare enum AutomationFeature {
164
147
  LOOPING = "LOOPING"
165
148
  }
166
- export interface AutomationStep extends AutomationStepSchema {
167
- id: string;
168
- }
169
- export interface AutomationTriggerSchema extends AutomationStepSchema {
170
- type: AutomationStepType.TRIGGER;
171
- event?: string;
172
- cronJobId?: string;
173
- }
174
- export interface AutomationTrigger extends AutomationTriggerSchema {
175
- id: string;
176
- }
177
149
  export declare enum AutomationStepStatus {
178
150
  NO_ITERATIONS = "no_iterations"
179
151
  }
@@ -1,2 +1,3 @@
1
1
  export * from "./automation";
2
2
  export * from "./schema";
3
+ export * from "./StepInputsOutputs";
@@ -1,8 +1,6 @@
1
- import { SortOrder } from "../../../api";
2
- import { EmptyFilterOption, Hosting, SearchFilters } from "../../../sdk";
3
- import { HttpMethod } from "../query";
4
- import { Row } from "../row";
5
- import { AutomationActionStepId, AutomationResults, EmailAttachment, LoopStepType, ActionImplementation } from "./automation";
1
+ import { Hosting } from "../../../sdk";
2
+ import { AutomationActionStepId, ActionImplementation, AutomationStepType, AutomationFeature, InputOutputBlock, AutomationTriggerStepId } from "./automation";
3
+ import { CollectStepInputs, CollectStepOutputs, CreateRowStepInputs, CreateRowStepOutputs, DelayStepInputs, DelayStepOutputs, DeleteRowStepInputs, DeleteRowStepOutputs, ExecuteQueryStepInputs, ExecuteQueryStepOutputs, ExecuteScriptStepInputs, ExecuteScriptStepOutputs, FilterStepInputs, FilterStepOutputs, QueryRowsStepInputs, QueryRowsStepOutputs, SmtpEmailStepInputs, ServerLogStepInputs, ServerLogStepOutputs, TriggerAutomationStepInputs, TriggerAutomationStepOutputs, UpdateRowStepInputs, UpdateRowStepOutputs, OutgoingWebhookStepInputs, ExternalAppStepOutputs, DiscordStepInputs, SlackStepInputs, ZapierStepInputs, ZapierStepOutputs, MakeIntegrationInputs, n8nStepInputs, BashStepInputs, BashStepOutputs, OpenAIStepInputs, OpenAIStepOutputs, LoopStepInputs, AppActionTriggerInputs, CronTriggerInputs, RowUpdatedTriggerInputs, RowCreatedTriggerInputs, RowDeletedTriggerInputs, BranchStepInputs, BaseAutomationOutputs } from "./StepInputsOutputs";
6
4
  export type ActionImplementations<T extends Hosting> = {
7
5
  [AutomationActionStepId.COLLECT]: ActionImplementation<CollectStepInputs, CollectStepOutputs>;
8
6
  [AutomationActionStepId.CREATE_ROW]: ActionImplementation<CreateRowStepInputs, CreateRowStepOutputs>;
@@ -26,186 +24,75 @@ export type ActionImplementations<T extends Hosting> = {
26
24
  [AutomationActionStepId.EXECUTE_BASH]: ActionImplementation<BashStepInputs, BashStepOutputs>;
27
25
  [AutomationActionStepId.OPENAI]: ActionImplementation<OpenAIStepInputs, OpenAIStepOutputs>;
28
26
  } : {});
29
- export type BaseAutomationOutputs = {
30
- success?: boolean;
31
- response?: {
32
- [key: string]: any;
33
- message?: string;
27
+ export interface AutomationStepSchemaBase {
28
+ name: string;
29
+ stepTitle?: string;
30
+ tagline: string;
31
+ icon: string;
32
+ description: string;
33
+ type: AutomationStepType;
34
+ internal?: boolean;
35
+ deprecated?: boolean;
36
+ blockToLoop?: string;
37
+ schema: {
38
+ inputs: InputOutputBlock;
39
+ outputs: InputOutputBlock;
34
40
  };
35
- };
36
- export type ExternalAppStepOutputs = {
37
- httpStatus?: number;
38
- response: string;
39
- success: boolean;
40
- };
41
- export type BashStepInputs = {
42
- code: string;
43
- };
44
- export type BashStepOutputs = BaseAutomationOutputs & {
45
- stdout?: string;
46
- };
47
- export type CollectStepInputs = {
48
- collection: string;
49
- };
50
- export type CollectStepOutputs = BaseAutomationOutputs & {
51
- value?: any;
52
- };
53
- export type CreateRowStepInputs = {
54
- row: Row;
55
- };
56
- export type CreateRowStepOutputs = BaseAutomationOutputs & {
57
- row?: Row;
58
- id?: string;
59
- revision?: string;
60
- };
61
- export type DelayStepInputs = {
62
- time: number;
63
- };
64
- export type DelayStepOutputs = BaseAutomationOutputs;
65
- export type DeleteRowStepInputs = {
66
- tableId: string;
41
+ custom?: boolean;
42
+ features?: Partial<Record<AutomationFeature, boolean>>;
43
+ }
44
+ export type AutomationStepOutputs = CollectStepOutputs | CreateRowStepOutputs | DelayStepOutputs | DeleteRowStepOutputs | ExecuteQueryStepOutputs | ExecuteScriptStepOutputs | FilterStepOutputs | QueryRowsStepOutputs | BaseAutomationOutputs | BashStepOutputs | ExternalAppStepOutputs | OpenAIStepOutputs | ServerLogStepOutputs | TriggerAutomationStepOutputs | UpdateRowStepOutputs | ZapierStepOutputs;
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;
46
+ export interface AutomationStepSchema<TStep extends AutomationActionStepId> extends AutomationStepSchemaBase {
67
47
  id: string;
68
- revision?: string;
69
- };
70
- export type DeleteRowStepOutputs = BaseAutomationOutputs & {
71
- row?: Row;
72
- };
73
- export type DiscordStepInputs = {
74
- url: string;
75
- username?: string;
76
- avatar_url?: string;
77
- content: string;
78
- };
79
- export type ExecuteQueryStepInputs = {
80
- query: {
81
- queryId: string;
82
- };
83
- };
84
- export type ExecuteQueryStepOutputs = BaseAutomationOutputs & {
85
- info?: any;
86
- };
87
- export type ExecuteScriptStepInputs = {
88
- code: string;
89
- };
90
- export type ExecuteScriptStepOutputs = BaseAutomationOutputs & {
91
- value?: string;
92
- };
93
- export type FilterStepInputs = {
94
- field: any;
95
- condition: string;
96
- value: any;
97
- };
98
- export type FilterStepOutputs = BaseAutomationOutputs & {
99
- result: boolean;
100
- refValue?: any;
101
- comparisonValue?: any;
102
- };
103
- export type LoopStepInputs = {
104
- option: LoopStepType;
105
- binding: any;
106
- iterations?: number;
107
- failure?: string;
108
- };
109
- export type LoopStepOutputs = {
110
- items: string;
111
- success: boolean;
112
- iterations: number;
113
- };
114
- export type MakeIntegrationInputs = {
115
- url: string;
116
- body: any;
117
- };
118
- export type n8nStepInputs = {
119
- url: string;
120
- method: HttpMethod;
121
- authorization: string;
122
- body: any;
123
- };
124
- export type OpenAIStepInputs = {
125
- prompt: string;
126
- model: Model;
127
- };
128
- declare enum Model {
129
- GPT_35_TURBO = "gpt-3.5-turbo",
130
- GPT_4 = "gpt-4"
48
+ stepId: TStep;
49
+ inputs: AutomationStepInputs<TStep> & Record<string, any>;
131
50
  }
132
- export type OpenAIStepOutputs = Omit<BaseAutomationOutputs, "response"> & {
133
- response?: string | null;
134
- };
135
- export type QueryRowsStepInputs = {
136
- tableId: string;
137
- filters?: SearchFilters;
138
- "filters-def"?: any;
139
- sortColumn?: string;
140
- sortOrder?: SortOrder;
141
- limit?: number;
142
- onEmptyFilter?: EmptyFilterOption;
143
- };
144
- export type QueryRowsStepOutputs = BaseAutomationOutputs & {
145
- rows?: Row[];
146
- };
147
- export type SmtpEmailStepInputs = {
148
- to: string;
149
- from: string;
150
- subject: string;
151
- contents: string;
152
- cc: string;
153
- bcc: string;
154
- addInvite?: boolean;
155
- startTime: Date;
156
- endTime: Date;
157
- summary: string;
158
- location?: string;
159
- url?: string;
160
- attachments?: EmailAttachment[];
161
- };
162
- export type ServerLogStepInputs = {
163
- text: string;
164
- };
165
- export type ServerLogStepOutputs = BaseAutomationOutputs & {
166
- message: string;
167
- };
168
- export type SlackStepInputs = {
169
- url: string;
170
- text: string;
171
- };
172
- export type TriggerAutomationStepInputs = {
173
- automation: {
174
- automationId: string;
175
- };
176
- timeout: number;
177
- };
178
- export type TriggerAutomationStepOutputs = BaseAutomationOutputs & {
179
- value?: AutomationResults["steps"];
180
- };
181
- export type UpdateRowStepInputs = {
182
- meta: Record<string, any>;
183
- row: Row;
184
- rowId: string;
185
- };
186
- export type UpdateRowStepOutputs = BaseAutomationOutputs & {
187
- row?: Row;
188
- id?: string;
189
- revision?: string;
190
- };
191
- export type ZapierStepInputs = {
192
- url: string;
193
- body: any;
194
- };
195
- export type ZapierStepOutputs = Omit<ExternalAppStepOutputs, "response"> & {
196
- response: string;
197
- };
198
- declare enum RequestType {
199
- POST = "POST",
200
- GET = "GET",
201
- PUT = "PUT",
202
- DELETE = "DELETE",
203
- PATCH = "PATCH"
51
+ export type CollectStep = AutomationStepSchema<AutomationActionStepId.COLLECT>;
52
+ export type CreateRowStep = AutomationStepSchema<AutomationActionStepId.CREATE_ROW>;
53
+ export type DelayStep = AutomationStepSchema<AutomationActionStepId.DELAY>;
54
+ export type DeleteRowStep = AutomationStepSchema<AutomationActionStepId.DELETE_ROW>;
55
+ export type ExecuteQueryStep = AutomationStepSchema<AutomationActionStepId.EXECUTE_QUERY>;
56
+ export type ExecuteScriptStep = AutomationStepSchema<AutomationActionStepId.EXECUTE_SCRIPT>;
57
+ export type FilterStep = AutomationStepSchema<AutomationActionStepId.FILTER>;
58
+ export type QueryRowsStep = AutomationStepSchema<AutomationActionStepId.QUERY_ROWS>;
59
+ export type SendEmailSmtpStep = AutomationStepSchema<AutomationActionStepId.SEND_EMAIL_SMTP>;
60
+ export type ServerLogStep = AutomationStepSchema<AutomationActionStepId.SERVER_LOG>;
61
+ export type TriggerAutomationRunStep = AutomationStepSchema<AutomationActionStepId.TRIGGER_AUTOMATION_RUN>;
62
+ export type UpdateRowStep = AutomationStepSchema<AutomationActionStepId.UPDATE_ROW>;
63
+ export type OutgoingWebhookStep = AutomationStepSchema<AutomationActionStepId.OUTGOING_WEBHOOK>;
64
+ export type DiscordStep = AutomationStepSchema<AutomationActionStepId.discord>;
65
+ export type SlackStep = AutomationStepSchema<AutomationActionStepId.slack>;
66
+ export type ZapierStep = AutomationStepSchema<AutomationActionStepId.zapier>;
67
+ export type IntegromatStep = AutomationStepSchema<AutomationActionStepId.integromat>;
68
+ export type N8nStep = AutomationStepSchema<AutomationActionStepId.n8n>;
69
+ export type ExecuteBashStep = AutomationStepSchema<AutomationActionStepId.EXECUTE_BASH>;
70
+ export type OpenAIStep = AutomationStepSchema<AutomationActionStepId.OPENAI>;
71
+ export type LoopStep = AutomationStepSchema<AutomationActionStepId.LOOP>;
72
+ export type BranchStep = AutomationStepSchema<AutomationActionStepId.BRANCH>;
73
+ 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;
74
+ type EmptyInputs = {};
75
+ export type AutomationStepDefinition = Omit<AutomationStep, "id" | "inputs"> & {
76
+ inputs: EmptyInputs;
77
+ };
78
+ export type AutomationTriggerDefinition = Omit<AutomationTrigger, "id" | "inputs"> & {
79
+ inputs: EmptyInputs;
80
+ };
81
+ export type AutomationTriggerInputs<T extends AutomationTriggerStepId> = T extends AutomationTriggerStepId.APP ? AppActionTriggerInputs : T extends AutomationTriggerStepId.CRON ? CronTriggerInputs : T extends AutomationTriggerStepId.ROW_ACTION ? Record<string, any> : T extends AutomationTriggerStepId.ROW_DELETED ? RowDeletedTriggerInputs : T extends AutomationTriggerStepId.ROW_SAVED ? RowCreatedTriggerInputs : T extends AutomationTriggerStepId.ROW_UPDATED ? RowUpdatedTriggerInputs : T extends AutomationTriggerStepId.WEBHOOK ? Record<string, any> : never;
82
+ export interface AutomationTriggerSchema<TTrigger extends AutomationTriggerStepId> extends AutomationStepSchemaBase {
83
+ id: string;
84
+ type: AutomationStepType.TRIGGER;
85
+ event?: string;
86
+ cronJobId?: string;
87
+ stepId: TTrigger;
88
+ inputs: AutomationTriggerInputs<TTrigger> & Record<string, any>;
204
89
  }
205
- export type OutgoingWebhookStepInputs = {
206
- requestMethod: RequestType;
207
- url: string;
208
- requestBody: string;
209
- headers: string;
210
- };
90
+ export type AutomationTrigger = AppActionTrigger | CronTrigger | RowActionTrigger | RowDeletedTrigger | RowSavedTrigger | RowUpdatedTrigger | WebhookTrigger;
91
+ export type AppActionTrigger = AutomationTriggerSchema<AutomationTriggerStepId.APP>;
92
+ export type CronTrigger = AutomationTriggerSchema<AutomationTriggerStepId.CRON>;
93
+ export type RowActionTrigger = AutomationTriggerSchema<AutomationTriggerStepId.ROW_ACTION>;
94
+ export type RowDeletedTrigger = AutomationTriggerSchema<AutomationTriggerStepId.ROW_DELETED>;
95
+ export type RowSavedTrigger = AutomationTriggerSchema<AutomationTriggerStepId.ROW_SAVED>;
96
+ export type RowUpdatedTrigger = AutomationTriggerSchema<AutomationTriggerStepId.ROW_UPDATED>;
97
+ export type WebhookTrigger = AutomationTriggerSchema<AutomationTriggerStepId.WEBHOOK>;
211
98
  export {};
@@ -121,7 +121,7 @@ export interface RowAttachment {
121
121
  size: number;
122
122
  name: string;
123
123
  extension: string;
124
- key: string;
124
+ key?: string;
125
125
  url?: string;
126
126
  }
127
127
  export interface Row extends Document {
@@ -79,7 +79,6 @@ export interface FormulaFieldMetadata extends BaseFieldSchema {
79
79
  type: FieldType.FORMULA;
80
80
  formula: string;
81
81
  formulaType?: FormulaType;
82
- default?: string;
83
82
  }
84
83
  export interface BBReferenceFieldMetadata extends Omit<BaseFieldSchema, "subtype"> {
85
84
  type: FieldType.BB_REFERENCE;
package/dist/index.js CHANGED
@@ -769,7 +769,6 @@ var TenantResolutionStrategy = /* @__PURE__ */ ((TenantResolutionStrategy2) => {
769
769
 
770
770
  // src/sdk/featureFlag.ts
771
771
  var FeatureFlag = /* @__PURE__ */ ((FeatureFlag2) => {
772
- FeatureFlag2["LICENSING"] = "LICENSING";
773
772
  FeatureFlag2["PER_CREATOR_PER_USER_PRICE"] = "PER_CREATOR_PER_USER_PRICE";
774
773
  FeatureFlag2["PER_CREATOR_PER_USER_PRICE_ALERT"] = "PER_CREATOR_PER_USER_PRICE_ALERT";
775
774
  return FeatureFlag2;
@@ -935,6 +934,7 @@ var AutomationActionStepId = /* @__PURE__ */ ((AutomationActionStepId2) => {
935
934
  AutomationActionStepId2["COLLECT"] = "COLLECT";
936
935
  AutomationActionStepId2["OPENAI"] = "OPENAI";
937
936
  AutomationActionStepId2["TRIGGER_AUTOMATION_RUN"] = "TRIGGER_AUTOMATION_RUN";
937
+ AutomationActionStepId2["BRANCH"] = "BRANCH";
938
938
  AutomationActionStepId2["discord"] = "discord";
939
939
  AutomationActionStepId2["slack"] = "slack";
940
940
  AutomationActionStepId2["zapier"] = "zapier";