@budibase/types 3.7.5 → 3.8.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.
@@ -1,4 +1,14 @@
1
1
  import { EnrichedBinding } from "../../ui";
2
+ export interface Message {
3
+ role: "system" | "user";
4
+ content: string;
5
+ }
6
+ export interface ChatCompletionRequest {
7
+ messages: Message[];
8
+ }
9
+ export interface ChatCompletionResponse {
10
+ message?: string;
11
+ }
2
12
  export interface GenerateJsRequest {
3
13
  prompt: string;
4
14
  bindings?: EnrichedBinding[];
@@ -6,3 +16,9 @@ export interface GenerateJsRequest {
6
16
  export interface GenerateJsResponse {
7
17
  code: string;
8
18
  }
19
+ export interface GenerateCronRequest {
20
+ prompt: string;
21
+ }
22
+ export interface GenerateCronResponse {
23
+ message?: string;
24
+ }
@@ -249,6 +249,7 @@ export type WebhookTriggerOutputs = Record<string, any> & {
249
249
  };
250
250
  export type RowActionTriggerInputs = {
251
251
  tableId: string;
252
+ rowActionId: string;
252
253
  };
253
254
  export type RowActionTriggerOutputs = {
254
255
  row: Row;
@@ -126,18 +126,17 @@ export interface BaseIOStructure {
126
126
  dependsOn?: string;
127
127
  enum?: string[];
128
128
  pretty?: string[];
129
- properties?: {
130
- [key: string]: BaseIOStructure;
131
- };
129
+ properties?: AutomationIOProps;
132
130
  required?: string[];
133
131
  readonly?: true;
134
132
  }
135
133
  export interface InputOutputBlock {
136
- properties: {
137
- [key: string]: BaseIOStructure;
138
- };
134
+ properties: AutomationIOProps;
139
135
  required?: string[];
140
136
  }
137
+ export interface AutomationIOProps {
138
+ [key: string]: BaseIOStructure;
139
+ }
141
140
  export declare enum AutomationFeature {
142
141
  LOOPING = "LOOPING"
143
142
  }
@@ -1,6 +1,6 @@
1
1
  import { Hosting } from "../../../sdk";
2
- import { AutomationActionStepId, ActionImplementation, AutomationStepType, AutomationFeature, InputOutputBlock, AutomationTriggerStepId, AutomationEventType } 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, CronTriggerInputs, RowUpdatedTriggerInputs, RowCreatedTriggerInputs, RowDeletedTriggerInputs, BranchStepInputs, BaseAutomationOutputs, AppActionTriggerOutputs, CronTriggerOutputs, RowDeletedTriggerOutputs, RowCreatedTriggerOutputs, RowUpdatedTriggerOutputs, WebhookTriggerOutputs } from "./StepInputsOutputs";
2
+ import { AutomationActionStepId, ActionImplementation, AutomationStepType, AutomationFeature, InputOutputBlock, AutomationTriggerStepId, AutomationEventType, AutomationIOType } 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, CronTriggerInputs, RowUpdatedTriggerInputs, RowCreatedTriggerInputs, RowDeletedTriggerInputs, BranchStepInputs, BaseAutomationOutputs, AppActionTriggerOutputs, CronTriggerOutputs, RowDeletedTriggerOutputs, RowCreatedTriggerOutputs, RowUpdatedTriggerOutputs, WebhookTriggerOutputs, RowActionTriggerInputs } from "./StepInputsOutputs";
4
4
  export type ActionImplementations<T extends Hosting> = {
5
5
  [AutomationActionStepId.COLLECT]: ActionImplementation<CollectStepInputs, CollectStepOutputs>;
6
6
  [AutomationActionStepId.CREATE_ROW]: ActionImplementation<CreateRowStepInputs, CreateRowStepOutputs>;
@@ -80,6 +80,10 @@ export declare function isTrigger(step: AutomationStep | AutomationTrigger): ste
80
80
  export declare function isRowUpdateTrigger(step: AutomationStep | AutomationTrigger): step is RowUpdatedTrigger;
81
81
  export declare function isRowSaveTrigger(step: AutomationStep | AutomationTrigger): step is RowSavedTrigger;
82
82
  export declare function isAppTrigger(step: AutomationStep | AutomationTrigger): step is AppActionTrigger;
83
+ export declare function isFilterStep(step: AutomationStep | AutomationTrigger): step is FilterStep;
84
+ export declare function isLoopStep(step: AutomationStep | AutomationTrigger): step is LoopStep;
85
+ export declare function isActionStep(step: AutomationStep | AutomationTrigger): step is AutomationStep;
86
+ export declare function isCronTrigger(trigger: AutomationStep | AutomationTrigger): trigger is CronTrigger;
83
87
  type EmptyInputs = {};
84
88
  export type AutomationStepDefinition = Omit<AutomationStep, "id" | "inputs"> & {
85
89
  inputs: EmptyInputs;
@@ -89,7 +93,9 @@ export type AutomationTriggerDefinition = Omit<AutomationTrigger, "id" | "inputs
89
93
  inputs: EmptyInputs;
90
94
  deprecated?: boolean;
91
95
  };
92
- export type AutomationTriggerInputs<T extends AutomationTriggerStepId> = T extends AutomationTriggerStepId.APP ? void | Record<string, any> : 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;
96
+ export type AutomationTriggerInputs<T extends AutomationTriggerStepId> = T extends AutomationTriggerStepId.APP ? void | (Record<string, any> & {
97
+ fields?: Record<string, AutomationIOType>;
98
+ }) : T extends AutomationTriggerStepId.CRON ? CronTriggerInputs : T extends AutomationTriggerStepId.ROW_ACTION ? RowActionTriggerInputs : 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;
93
99
  export type AutomationTriggerOutputs<T extends AutomationTriggerStepId> = T extends AutomationTriggerStepId.APP ? AppActionTriggerOutputs : T extends AutomationTriggerStepId.CRON ? CronTriggerOutputs : T extends AutomationTriggerStepId.ROW_ACTION ? Record<string, any> : T extends AutomationTriggerStepId.ROW_DELETED ? RowDeletedTriggerOutputs : T extends AutomationTriggerStepId.ROW_SAVED ? RowCreatedTriggerOutputs : T extends AutomationTriggerStepId.ROW_UPDATED ? RowUpdatedTriggerOutputs : T extends AutomationTriggerStepId.WEBHOOK ? WebhookTriggerOutputs : never;
94
100
  export interface AutomationTriggerSchema<TTrigger extends AutomationTriggerStepId> extends AutomationStepSchemaBase {
95
101
  id: string;
@@ -97,7 +103,7 @@ export interface AutomationTriggerSchema<TTrigger extends AutomationTriggerStepI
97
103
  event?: AutomationEventType;
98
104
  cronJobId?: string;
99
105
  stepId: TTrigger;
100
- inputs: AutomationTriggerInputs<TTrigger> & Record<string, any>;
106
+ inputs: AutomationTriggerInputs<AutomationTriggerStepId>;
101
107
  }
102
108
  export type AutomationTrigger = AppActionTrigger | CronTrigger | RowActionTrigger | RowDeletedTrigger | RowSavedTrigger | RowUpdatedTrigger | WebhookTrigger;
103
109
  export type AppActionTrigger = AutomationTriggerSchema<AutomationTriggerStepId.APP>;
@@ -98,7 +98,7 @@ export interface SCIMInnerConfig {
98
98
  }
99
99
  export interface SCIMConfig extends Config<SCIMInnerConfig> {
100
100
  }
101
- export type AIProvider = "OpenAI" | "Anthropic" | "AzureOpenAI" | "TogetherAI" | "Custom";
101
+ export type AIProvider = "OpenAI" | "Anthropic" | "AzureOpenAI" | "TogetherAI" | "Custom" | "BudibaseAI";
102
102
  export interface ProviderConfig {
103
103
  provider: AIProvider;
104
104
  isDefault: boolean;