@budibase/types 3.5.3 → 3.7.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.
@@ -3,6 +3,7 @@ import { OfflineLicense, PlanType } from "../../sdk";
3
3
  import { ISO8601 } from "../../shared";
4
4
  export interface GetLicenseRequest {
5
5
  quotaUsage?: QuotaUsage;
6
+ tenantId?: string;
6
7
  install: {
7
8
  id: string;
8
9
  tenantId: string;
@@ -1,5 +1,7 @@
1
+ import { EnrichedBinding } from "../../ui";
1
2
  export interface GenerateJsRequest {
2
3
  prompt: string;
4
+ bindings?: EnrichedBinding[];
3
5
  }
4
6
  export interface GenerateJsResponse {
5
7
  code: string;
@@ -1,9 +1,52 @@
1
- interface OAuth2Config {
1
+ import { OAuth2CredentialsMethod, OAuth2GrantType } from "@budibase/types";
2
+ export interface OAuth2ConfigResponse {
3
+ _id: string;
4
+ _rev: string;
2
5
  name: string;
6
+ url: string;
7
+ clientId: string;
8
+ clientSecret: string;
9
+ method: OAuth2CredentialsMethod;
10
+ grantType: OAuth2GrantType;
3
11
  }
4
12
  export interface FetchOAuth2ConfigsResponse {
5
- configs: OAuth2Config[];
13
+ configs: (OAuth2ConfigResponse & {
14
+ lastUsage?: string;
15
+ })[];
6
16
  }
7
- export interface CreateOAuth2ConfigRequest extends OAuth2Config {
17
+ export interface InsertOAuth2ConfigRequest {
18
+ name: string;
19
+ url: string;
20
+ clientId: string;
21
+ clientSecret: string;
22
+ method: OAuth2CredentialsMethod;
23
+ grantType: OAuth2GrantType;
24
+ }
25
+ export interface InsertOAuth2ConfigResponse {
26
+ config: OAuth2ConfigResponse;
27
+ }
28
+ export interface UpdateOAuth2ConfigRequest {
29
+ _id: string;
30
+ _rev: string;
31
+ name: string;
32
+ url: string;
33
+ clientId: string;
34
+ clientSecret: string;
35
+ method: OAuth2CredentialsMethod;
36
+ grantType: OAuth2GrantType;
37
+ }
38
+ export interface UpdateOAuth2ConfigResponse {
39
+ config: OAuth2ConfigResponse;
40
+ }
41
+ export interface ValidateConfigRequest {
42
+ _id?: string;
43
+ url: string;
44
+ clientId: string;
45
+ clientSecret: string;
46
+ method: OAuth2CredentialsMethod;
47
+ grantType: OAuth2GrantType;
48
+ }
49
+ export interface ValidateConfigResponse {
50
+ valid: boolean;
51
+ message?: string;
8
52
  }
9
- export {};
@@ -20,8 +20,6 @@ declare const searchRowRequest: z.ZodObject<{
20
20
  allOr: z.ZodOptional<z.ZodBoolean>;
21
21
  onEmptyFilter: z.ZodOptional<z.ZodNativeEnum<typeof EmptyFilterOption>>;
22
22
  }, "strip", z.ZodTypeAny, {
23
- allOr?: boolean | undefined;
24
- onEmptyFilter?: EmptyFilterOption | undefined;
25
23
  equal?: any;
26
24
  notEqual?: any;
27
25
  empty?: any;
@@ -33,11 +31,11 @@ declare const searchRowRequest: z.ZodObject<{
33
31
  notContains?: any;
34
32
  containsAny?: any;
35
33
  oneOf?: any;
34
+ allOr?: boolean | undefined;
35
+ onEmptyFilter?: EmptyFilterOption | undefined;
36
36
  $and?: any;
37
37
  $or?: any;
38
38
  }, {
39
- allOr?: boolean | undefined;
40
- onEmptyFilter?: EmptyFilterOption | undefined;
41
39
  equal?: any;
42
40
  notEqual?: any;
43
41
  empty?: any;
@@ -49,6 +47,8 @@ declare const searchRowRequest: z.ZodObject<{
49
47
  notContains?: any;
50
48
  containsAny?: any;
51
49
  oneOf?: any;
50
+ allOr?: boolean | undefined;
51
+ onEmptyFilter?: EmptyFilterOption | undefined;
52
52
  $and?: any;
53
53
  $or?: any;
54
54
  }>>;
@@ -63,11 +63,7 @@ declare const searchRowRequest: z.ZodObject<{
63
63
  countRows: z.ZodOptional<z.ZodBoolean>;
64
64
  }, "strip", z.ZodTypeAny, {
65
65
  version?: string | undefined;
66
- limit?: number | undefined;
67
- sort?: string | null | undefined;
68
66
  query?: {
69
- allOr?: boolean | undefined;
70
- onEmptyFilter?: EmptyFilterOption | undefined;
71
67
  equal?: any;
72
68
  notEqual?: any;
73
69
  empty?: any;
@@ -79,9 +75,13 @@ declare const searchRowRequest: z.ZodObject<{
79
75
  notContains?: any;
80
76
  containsAny?: any;
81
77
  oneOf?: any;
78
+ allOr?: boolean | undefined;
79
+ onEmptyFilter?: EmptyFilterOption | undefined;
82
80
  $and?: any;
83
81
  $or?: any;
84
82
  } | undefined;
83
+ sort?: string | null | undefined;
84
+ limit?: number | undefined;
85
85
  paginate?: boolean | undefined;
86
86
  bookmark?: string | number | null | undefined;
87
87
  sortOrder?: SortOrder | undefined;
@@ -90,11 +90,7 @@ declare const searchRowRequest: z.ZodObject<{
90
90
  countRows?: boolean | undefined;
91
91
  }, {
92
92
  version?: string | undefined;
93
- limit?: number | undefined;
94
- sort?: string | null | undefined;
95
93
  query?: {
96
- allOr?: boolean | undefined;
97
- onEmptyFilter?: EmptyFilterOption | undefined;
98
94
  equal?: any;
99
95
  notEqual?: any;
100
96
  empty?: any;
@@ -106,9 +102,13 @@ declare const searchRowRequest: z.ZodObject<{
106
102
  notContains?: any;
107
103
  containsAny?: any;
108
104
  oneOf?: any;
105
+ allOr?: boolean | undefined;
106
+ onEmptyFilter?: EmptyFilterOption | undefined;
109
107
  $and?: any;
110
108
  $or?: any;
111
109
  } | undefined;
110
+ sort?: string | null | undefined;
111
+ limit?: number | undefined;
112
112
  paginate?: boolean | undefined;
113
113
  bookmark?: string | number | null | undefined;
114
114
  sortOrder?: SortOrder | undefined;
@@ -134,8 +134,6 @@ export declare const searchRowRequestValidator: z.ZodObject<{
134
134
  allOr: z.ZodOptional<z.ZodBoolean>;
135
135
  onEmptyFilter: z.ZodOptional<z.ZodNativeEnum<typeof EmptyFilterOption>>;
136
136
  }, "strip", z.ZodTypeAny, {
137
- allOr?: boolean | undefined;
138
- onEmptyFilter?: EmptyFilterOption | undefined;
139
137
  equal?: any;
140
138
  notEqual?: any;
141
139
  empty?: any;
@@ -147,11 +145,11 @@ export declare const searchRowRequestValidator: z.ZodObject<{
147
145
  notContains?: any;
148
146
  containsAny?: any;
149
147
  oneOf?: any;
148
+ allOr?: boolean | undefined;
149
+ onEmptyFilter?: EmptyFilterOption | undefined;
150
150
  $and?: any;
151
151
  $or?: any;
152
152
  }, {
153
- allOr?: boolean | undefined;
154
- onEmptyFilter?: EmptyFilterOption | undefined;
155
153
  equal?: any;
156
154
  notEqual?: any;
157
155
  empty?: any;
@@ -163,6 +161,8 @@ export declare const searchRowRequestValidator: z.ZodObject<{
163
161
  notContains?: any;
164
162
  containsAny?: any;
165
163
  oneOf?: any;
164
+ allOr?: boolean | undefined;
165
+ onEmptyFilter?: EmptyFilterOption | undefined;
166
166
  $and?: any;
167
167
  $or?: any;
168
168
  }>>;
@@ -177,11 +177,7 @@ export declare const searchRowRequestValidator: z.ZodObject<{
177
177
  countRows: z.ZodOptional<z.ZodBoolean>;
178
178
  }, "strip", z.ZodTypeAny, {
179
179
  version?: string | undefined;
180
- limit?: number | undefined;
181
- sort?: string | null | undefined;
182
180
  query?: {
183
- allOr?: boolean | undefined;
184
- onEmptyFilter?: EmptyFilterOption | undefined;
185
181
  equal?: any;
186
182
  notEqual?: any;
187
183
  empty?: any;
@@ -193,9 +189,13 @@ export declare const searchRowRequestValidator: z.ZodObject<{
193
189
  notContains?: any;
194
190
  containsAny?: any;
195
191
  oneOf?: any;
192
+ allOr?: boolean | undefined;
193
+ onEmptyFilter?: EmptyFilterOption | undefined;
196
194
  $and?: any;
197
195
  $or?: any;
198
196
  } | undefined;
197
+ sort?: string | null | undefined;
198
+ limit?: number | undefined;
199
199
  paginate?: boolean | undefined;
200
200
  bookmark?: string | number | null | undefined;
201
201
  sortOrder?: SortOrder | undefined;
@@ -204,11 +204,7 @@ export declare const searchRowRequestValidator: z.ZodObject<{
204
204
  countRows?: boolean | undefined;
205
205
  }, {
206
206
  version?: string | undefined;
207
- limit?: number | undefined;
208
- sort?: string | null | undefined;
209
207
  query?: {
210
- allOr?: boolean | undefined;
211
- onEmptyFilter?: EmptyFilterOption | undefined;
212
208
  equal?: any;
213
209
  notEqual?: any;
214
210
  empty?: any;
@@ -220,9 +216,13 @@ export declare const searchRowRequestValidator: z.ZodObject<{
220
216
  notContains?: any;
221
217
  containsAny?: any;
222
218
  oneOf?: any;
219
+ allOr?: boolean | undefined;
220
+ onEmptyFilter?: EmptyFilterOption | undefined;
223
221
  $and?: any;
224
222
  $or?: any;
225
223
  } | undefined;
224
+ sort?: string | null | undefined;
225
+ limit?: number | undefined;
226
226
  paginate?: boolean | undefined;
227
227
  bookmark?: string | number | null | undefined;
228
228
  sortOrder?: SortOrder | undefined;
@@ -33,9 +33,12 @@ interface ChecklistItem {
33
33
  label: string;
34
34
  link: string;
35
35
  }
36
+ interface SmtpChecklistItem extends ChecklistItem {
37
+ fallback?: boolean;
38
+ }
36
39
  export interface ConfigChecklistResponse {
37
40
  apps: ChecklistItem;
38
- smtp: ChecklistItem;
41
+ smtp: SmtpChecklistItem;
39
42
  adminUser: ChecklistItem;
40
43
  sso: ChecklistItem;
41
44
  branding: SettingsBrandingConfig;
@@ -19,9 +19,13 @@ export type SearchFilter = {
19
19
  export type LegacyFilter = AllOr | OnEmptyFilter | SearchFilter;
20
20
  export type SearchFilterGroup = {
21
21
  logicalOperator?: UILogicalOperator;
22
- groups?: SearchFilterGroup[];
22
+ } & ({
23
+ groups?: (SearchFilterGroup | UISearchFilter)[];
24
+ filters?: never;
25
+ } | {
23
26
  filters?: LegacyFilter[];
24
- };
27
+ groups?: never;
28
+ });
25
29
  export type UISearchFilter = {
26
30
  logicalOperator?: UILogicalOperator;
27
31
  onEmptyFilter?: EmptyFilterOption;
@@ -29,6 +29,7 @@ export interface App extends Document {
29
29
  snippets?: Snippet[];
30
30
  creationVersion?: string;
31
31
  updatedBy?: string;
32
+ scripts?: AppScript[];
32
33
  }
33
34
  export interface AppInstance {
34
35
  _id: string;
@@ -73,3 +74,9 @@ export interface AppFeatures {
73
74
  export interface AutomationSettings {
74
75
  chainAutomations?: boolean;
75
76
  }
77
+ export interface AppScript {
78
+ id: string;
79
+ name: string;
80
+ location: "Head" | "Body";
81
+ html?: string;
82
+ }
@@ -15,7 +15,8 @@ export interface Datasource extends Document {
15
15
  }
16
16
  export declare enum RestAuthType {
17
17
  BASIC = "basic",
18
- BEARER = "bearer"
18
+ BEARER = "bearer",
19
+ OAUTH2 = "oauth2"
19
20
  }
20
21
  export interface RestBasicAuthConfig {
21
22
  username: string;
@@ -24,12 +25,19 @@ export interface RestBasicAuthConfig {
24
25
  export interface RestBearerAuthConfig {
25
26
  token: string;
26
27
  }
27
- export interface RestAuthConfig {
28
+ export interface BasicRestAuthConfig {
28
29
  _id: string;
29
30
  name: string;
30
- type: RestAuthType;
31
- config: RestBasicAuthConfig | RestBearerAuthConfig;
31
+ type: RestAuthType.BASIC;
32
+ config: RestBasicAuthConfig;
32
33
  }
34
+ export interface BearerRestAuthConfig {
35
+ _id: string;
36
+ name: string;
37
+ type: RestAuthType.BEARER;
38
+ config: RestBearerAuthConfig;
39
+ }
40
+ export type RestAuthConfig = BasicRestAuthConfig | BearerRestAuthConfig;
33
41
  export interface DynamicVariable {
34
42
  name: string;
35
43
  queryId: string;
@@ -1,7 +1,16 @@
1
1
  import { Document } from "../document";
2
- export interface OAuth2Config {
3
- name: string;
2
+ export declare enum OAuth2CredentialsMethod {
3
+ HEADER = "HEADER",
4
+ BODY = "BODY"
5
+ }
6
+ export declare enum OAuth2GrantType {
7
+ CLIENT_CREDENTIALS = "client_credentials"
4
8
  }
5
- export interface OAuth2Configs extends Document {
6
- configs: Record<string, OAuth2Config>;
9
+ export interface OAuth2Config extends Document {
10
+ name: string;
11
+ url: string;
12
+ clientId: string;
13
+ clientSecret: string;
14
+ method: OAuth2CredentialsMethod;
15
+ grantType: OAuth2GrantType;
7
16
  }
@@ -1,4 +1,5 @@
1
1
  import { Document } from "../document";
2
+ import { RestAuthType } from "./datasource";
2
3
  import { Row } from "./row";
3
4
  export interface QuerySchema {
4
5
  name?: string;
@@ -52,6 +53,7 @@ export interface RestQueryFields {
52
53
  bodyType?: BodyType;
53
54
  method?: string;
54
55
  authConfigId?: string;
56
+ authConfigType?: RestAuthType;
55
57
  pagination?: PaginationConfig;
56
58
  paginationValues?: PaginationValues;
57
59
  }
@@ -115,15 +115,15 @@ export interface FieldConstraints {
115
115
  message?: string;
116
116
  };
117
117
  numericality?: {
118
- greaterThanOrEqualTo: string | null;
119
- lessThanOrEqualTo: string | null;
118
+ greaterThanOrEqualTo?: string | null;
119
+ lessThanOrEqualTo?: string | null;
120
120
  };
121
121
  presence?: boolean | {
122
122
  allowEmpty?: boolean;
123
123
  };
124
124
  datetime?: {
125
- latest: string;
126
- earliest: string;
125
+ latest?: string;
126
+ earliest?: string;
127
127
  };
128
128
  }
129
129
  export interface OptionsFieldMetadata extends BaseFieldSchema {
@@ -149,7 +149,7 @@ export interface BigIntFieldMetadata extends BaseFieldSchema {
149
149
  type: FieldType.BIGINT;
150
150
  default?: string;
151
151
  }
152
- interface BaseFieldSchema extends UIFieldMetadata {
152
+ export interface BaseFieldSchema extends UIFieldMetadata {
153
153
  type: FieldType;
154
154
  name: string;
155
155
  sortable?: boolean;
@@ -38,7 +38,8 @@ export declare enum DocumentType {
38
38
  APP_MIGRATION_METADATA = "_design/migrations",
39
39
  SCIM_LOG = "scimlog",
40
40
  ROW_ACTIONS = "ra",
41
- OAUTH2_CONFIG = "oauth2"
41
+ OAUTH2_CONFIG = "oauth2",
42
+ OAUTH2_CONFIG_LOG = "oauth2log"
42
43
  }
43
44
  export declare function getDocumentType(id: string): DocumentType | undefined;
44
45
  export declare const DocumentTypesToImport: DocumentType[];
@@ -14,6 +14,7 @@ export interface SMTPInnerConfig {
14
14
  pass: string;
15
15
  };
16
16
  connectionTimeout?: any;
17
+ fallback?: boolean;
17
18
  }
18
19
  export interface SMTPConfig extends Config<SMTPInnerConfig> {
19
20
  }
@@ -97,17 +98,19 @@ export interface SCIMInnerConfig {
97
98
  }
98
99
  export interface SCIMConfig extends Config<SCIMInnerConfig> {
99
100
  }
100
- export type AIProvider = "OpenAI" | "Anthropic" | "TogetherAI" | "Custom";
101
+ export type AIProvider = "OpenAI" | "Anthropic" | "AzureOpenAI" | "TogetherAI" | "Custom";
102
+ export interface ProviderConfig {
103
+ provider: AIProvider;
104
+ isDefault: boolean;
105
+ isBudibaseAI?: boolean;
106
+ name: string;
107
+ active: boolean;
108
+ baseUrl?: string;
109
+ apiKey?: string;
110
+ defaultModel?: string;
111
+ }
101
112
  export interface AIInnerConfig {
102
- [key: string]: {
103
- provider: AIProvider;
104
- isDefault: boolean;
105
- name: string;
106
- active: boolean;
107
- baseUrl?: string;
108
- apiKey?: string;
109
- defaultModel?: string;
110
- };
113
+ [key: string]: ProviderConfig;
111
114
  }
112
115
  export interface AIConfig extends Config<AIInnerConfig> {
113
116
  }
@@ -1,4 +1,5 @@
1
1
  import { Document } from "../document";
2
+ import { ContextUser } from "../../sdk";
2
3
  export interface SSOProfileJson {
3
4
  email?: string;
4
5
  picture?: string;
@@ -24,7 +25,7 @@ export interface UserSSO {
24
25
  };
25
26
  }
26
27
  export type SSOUser = User & UserSSO;
27
- export declare function isSSOUser(user: User): user is SSOUser;
28
+ export declare function isSSOUser(user: User | ContextUser): user is SSOUser;
28
29
  export interface UserIdentifier {
29
30
  userId: string;
30
31
  email: string;