@budibase/types 3.5.2 → 3.6.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.
@@ -0,0 +1,8 @@
1
+ import { EnrichedBinding } from "../../ui";
2
+ export interface GenerateJsRequest {
3
+ prompt: string;
4
+ bindings?: EnrichedBinding[];
5
+ }
6
+ export interface GenerateJsResponse {
7
+ code: string;
8
+ }
@@ -1,21 +1,22 @@
1
- export * from "./backup";
2
- export * from "./datasource";
3
- export * from "./view";
4
- export * from "./rows";
5
- export * from "./table";
6
- export * from "./permission";
1
+ export * from "./application";
7
2
  export * from "./attachment";
8
- export * from "./user";
9
- export * from "./rowAction";
10
3
  export * from "./automation";
4
+ export * from "./backup";
11
5
  export * from "./component";
6
+ export * from "./datasource";
7
+ export * from "./deployment";
12
8
  export * from "./integration";
9
+ export * from "./layout";
13
10
  export * from "./metadata";
11
+ export * from "./oauth2";
12
+ export * from "./permission";
14
13
  export * from "./query";
15
- export * from "./screen";
16
- export * from "./application";
17
- export * from "./layout";
18
- export * from "./deployment";
19
14
  export * from "./role";
20
- export * from "./webhook";
15
+ export * from "./rowAction";
16
+ export * from "./rows";
17
+ export * from "./screen";
21
18
  export * from "./static";
19
+ export * from "./table";
20
+ export * from "./user";
21
+ export * from "./view";
22
+ export * from "./webhook";
@@ -0,0 +1,46 @@
1
+ import { OAuth2CredentialsMethod } from "@budibase/types";
2
+ export interface OAuth2ConfigResponse {
3
+ _id: string;
4
+ _rev: string;
5
+ name: string;
6
+ url: string;
7
+ clientId: string;
8
+ clientSecret: string;
9
+ method: OAuth2CredentialsMethod;
10
+ }
11
+ export interface FetchOAuth2ConfigsResponse {
12
+ configs: OAuth2ConfigResponse[];
13
+ }
14
+ export interface InsertOAuth2ConfigRequest {
15
+ name: string;
16
+ url: string;
17
+ clientId: string;
18
+ clientSecret: string;
19
+ method: OAuth2CredentialsMethod;
20
+ }
21
+ export interface InsertOAuth2ConfigResponse {
22
+ config: OAuth2ConfigResponse;
23
+ }
24
+ export interface UpdateOAuth2ConfigRequest {
25
+ _id: string;
26
+ _rev: string;
27
+ name: string;
28
+ url: string;
29
+ clientId: string;
30
+ clientSecret: string;
31
+ method: OAuth2CredentialsMethod;
32
+ }
33
+ export interface UpdateOAuth2ConfigResponse {
34
+ config: OAuth2ConfigResponse;
35
+ }
36
+ export interface ValidateConfigRequest {
37
+ _id?: string;
38
+ url: string;
39
+ clientId: string;
40
+ clientSecret: string;
41
+ method: OAuth2CredentialsMethod;
42
+ }
43
+ export interface ValidateConfigResponse {
44
+ valid: boolean;
45
+ message?: string;
46
+ }
@@ -1,6 +1,6 @@
1
1
  import { EmptyFilterOption } from "../../../../sdk";
2
2
  import { Row } from "../../../../documents";
3
- import { PaginationResponse, SortOrder } from "../../../../api/web/pagination";
3
+ import { PaginationResponse, SortOrder, SortType } from "../../../../api/web/pagination";
4
4
  import { z } from "zod";
5
5
  declare const searchRowRequest: z.ZodObject<{
6
6
  query: z.ZodOptional<z.ZodObject<{
@@ -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
  }>>;
@@ -57,14 +57,13 @@ 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>>>;
60
61
  version: z.ZodOptional<z.ZodString>;
61
62
  disableEscaping: z.ZodOptional<z.ZodBoolean>;
62
63
  countRows: z.ZodOptional<z.ZodBoolean>;
63
64
  }, "strip", z.ZodTypeAny, {
64
65
  version?: string | undefined;
65
66
  query?: {
66
- allOr?: boolean | undefined;
67
- onEmptyFilter?: EmptyFilterOption | undefined;
68
67
  equal?: any;
69
68
  notEqual?: any;
70
69
  empty?: any;
@@ -76,6 +75,8 @@ declare const searchRowRequest: z.ZodObject<{
76
75
  notContains?: any;
77
76
  containsAny?: any;
78
77
  oneOf?: any;
78
+ allOr?: boolean | undefined;
79
+ onEmptyFilter?: EmptyFilterOption | undefined;
79
80
  $and?: any;
80
81
  $or?: any;
81
82
  } | undefined;
@@ -84,13 +85,12 @@ declare const searchRowRequest: z.ZodObject<{
84
85
  paginate?: boolean | undefined;
85
86
  bookmark?: string | number | null | undefined;
86
87
  sortOrder?: SortOrder | undefined;
88
+ sortType?: SortType | null | undefined;
87
89
  disableEscaping?: boolean | undefined;
88
90
  countRows?: boolean | undefined;
89
91
  }, {
90
92
  version?: string | undefined;
91
93
  query?: {
92
- allOr?: boolean | undefined;
93
- onEmptyFilter?: EmptyFilterOption | undefined;
94
94
  equal?: any;
95
95
  notEqual?: any;
96
96
  empty?: any;
@@ -102,6 +102,8 @@ declare const searchRowRequest: z.ZodObject<{
102
102
  notContains?: any;
103
103
  containsAny?: any;
104
104
  oneOf?: any;
105
+ allOr?: boolean | undefined;
106
+ onEmptyFilter?: EmptyFilterOption | undefined;
105
107
  $and?: any;
106
108
  $or?: any;
107
109
  } | undefined;
@@ -110,6 +112,7 @@ declare const searchRowRequest: z.ZodObject<{
110
112
  paginate?: boolean | undefined;
111
113
  bookmark?: string | number | null | undefined;
112
114
  sortOrder?: SortOrder | undefined;
115
+ sortType?: SortType | null | undefined;
113
116
  disableEscaping?: boolean | undefined;
114
117
  countRows?: boolean | undefined;
115
118
  }>;
@@ -131,8 +134,6 @@ export declare const searchRowRequestValidator: z.ZodObject<{
131
134
  allOr: z.ZodOptional<z.ZodBoolean>;
132
135
  onEmptyFilter: z.ZodOptional<z.ZodNativeEnum<typeof EmptyFilterOption>>;
133
136
  }, "strip", z.ZodTypeAny, {
134
- allOr?: boolean | undefined;
135
- onEmptyFilter?: EmptyFilterOption | undefined;
136
137
  equal?: any;
137
138
  notEqual?: any;
138
139
  empty?: any;
@@ -144,11 +145,11 @@ export declare const searchRowRequestValidator: z.ZodObject<{
144
145
  notContains?: any;
145
146
  containsAny?: any;
146
147
  oneOf?: any;
148
+ allOr?: boolean | undefined;
149
+ onEmptyFilter?: EmptyFilterOption | undefined;
147
150
  $and?: any;
148
151
  $or?: any;
149
152
  }, {
150
- allOr?: boolean | undefined;
151
- onEmptyFilter?: EmptyFilterOption | undefined;
152
153
  equal?: any;
153
154
  notEqual?: any;
154
155
  empty?: any;
@@ -160,6 +161,8 @@ export declare const searchRowRequestValidator: z.ZodObject<{
160
161
  notContains?: any;
161
162
  containsAny?: any;
162
163
  oneOf?: any;
164
+ allOr?: boolean | undefined;
165
+ onEmptyFilter?: EmptyFilterOption | undefined;
163
166
  $and?: any;
164
167
  $or?: any;
165
168
  }>>;
@@ -168,14 +171,13 @@ export declare const searchRowRequestValidator: z.ZodObject<{
168
171
  limit: z.ZodOptional<z.ZodNumber>;
169
172
  sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
170
173
  sortOrder: z.ZodOptional<z.ZodNativeEnum<typeof SortOrder>>;
174
+ sortType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof SortType>>>;
171
175
  version: z.ZodOptional<z.ZodString>;
172
176
  disableEscaping: z.ZodOptional<z.ZodBoolean>;
173
177
  countRows: z.ZodOptional<z.ZodBoolean>;
174
178
  }, "strip", z.ZodTypeAny, {
175
179
  version?: string | undefined;
176
180
  query?: {
177
- allOr?: boolean | undefined;
178
- onEmptyFilter?: EmptyFilterOption | undefined;
179
181
  equal?: any;
180
182
  notEqual?: any;
181
183
  empty?: any;
@@ -187,6 +189,8 @@ export declare const searchRowRequestValidator: z.ZodObject<{
187
189
  notContains?: any;
188
190
  containsAny?: any;
189
191
  oneOf?: any;
192
+ allOr?: boolean | undefined;
193
+ onEmptyFilter?: EmptyFilterOption | undefined;
190
194
  $and?: any;
191
195
  $or?: any;
192
196
  } | undefined;
@@ -195,13 +199,12 @@ export declare const searchRowRequestValidator: z.ZodObject<{
195
199
  paginate?: boolean | undefined;
196
200
  bookmark?: string | number | null | undefined;
197
201
  sortOrder?: SortOrder | undefined;
202
+ sortType?: SortType | null | undefined;
198
203
  disableEscaping?: boolean | undefined;
199
204
  countRows?: boolean | undefined;
200
205
  }, {
201
206
  version?: string | undefined;
202
207
  query?: {
203
- allOr?: boolean | undefined;
204
- onEmptyFilter?: EmptyFilterOption | undefined;
205
208
  equal?: any;
206
209
  notEqual?: any;
207
210
  empty?: any;
@@ -213,6 +216,8 @@ export declare const searchRowRequestValidator: z.ZodObject<{
213
216
  notContains?: any;
214
217
  containsAny?: any;
215
218
  oneOf?: any;
219
+ allOr?: boolean | undefined;
220
+ onEmptyFilter?: EmptyFilterOption | undefined;
216
221
  $and?: any;
217
222
  $or?: any;
218
223
  } | undefined;
@@ -221,11 +226,12 @@ export declare const searchRowRequestValidator: z.ZodObject<{
221
226
  paginate?: boolean | undefined;
222
227
  bookmark?: string | number | null | undefined;
223
228
  sortOrder?: SortOrder | undefined;
229
+ sortType?: SortType | null | undefined;
224
230
  disableEscaping?: boolean | undefined;
225
231
  countRows?: boolean | undefined;
226
232
  }>;
227
233
  export type SearchRowRequest = z.infer<typeof searchRowRequest>;
228
- export type SearchViewRowRequest = Pick<SearchRowRequest, "sort" | "sortOrder" | "limit" | "bookmark" | "paginate" | "query" | "countRows">;
234
+ export type SearchViewRowRequest = Pick<SearchRowRequest, "sort" | "sortOrder" | "sortType" | "limit" | "bookmark" | "paginate" | "query" | "countRows">;
229
235
  export interface SearchRowResponse {
230
236
  rows: Row[];
231
237
  }
@@ -1,3 +1,4 @@
1
+ export * from "./ai";
1
2
  export * from "./analytics";
2
3
  export * from "./auth";
3
4
  export * from "./user";
@@ -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;
@@ -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,22 +1,23 @@
1
+ export * from "../document";
1
2
  export * from "./app";
2
3
  export * from "./automation";
4
+ export * from "./backup";
5
+ export * from "./component";
3
6
  export * from "./datasource";
7
+ export * from "./deployment";
4
8
  export * from "./layout";
9
+ export * from "./links";
10
+ export * from "./metadata";
11
+ export * from "./oauth2";
5
12
  export * from "./query";
6
13
  export * from "./role";
7
- export * from "./table";
8
- export * from "./screen";
9
- export * from "./view";
10
- export * from "../document";
11
14
  export * from "./row";
12
- export * from "./user";
13
- export * from "./backup";
14
- export * from "./webhook";
15
- export * from "./links";
16
- export * from "./component";
17
- export * from "./sqlite";
18
- export * from "./snippet";
19
15
  export * from "./rowAction";
16
+ export * from "./screen";
17
+ export * from "./snippet";
18
+ export * from "./sqlite";
19
+ export * from "./table";
20
20
  export * from "./theme";
21
- export * from "./deployment";
22
- export * from "./metadata";
21
+ export * from "./user";
22
+ export * from "./view";
23
+ export * from "./webhook";
@@ -0,0 +1,12 @@
1
+ import { Document } from "../document";
2
+ export declare enum OAuth2CredentialsMethod {
3
+ HEADER = "HEADER",
4
+ BODY = "BODY"
5
+ }
6
+ export interface OAuth2Config extends Document {
7
+ name: string;
8
+ url: string;
9
+ clientId: string;
10
+ clientSecret: string;
11
+ method: OAuth2CredentialsMethod;
12
+ }
@@ -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;
@@ -37,7 +37,8 @@ export declare enum DocumentType {
37
37
  AUDIT_LOG = "al",
38
38
  APP_MIGRATION_METADATA = "_design/migrations",
39
39
  SCIM_LOG = "scimlog",
40
- ROW_ACTIONS = "ra"
40
+ ROW_ACTIONS = "ra",
41
+ OAUTH2_CONFIG = "oauth2"
41
42
  }
42
43
  export declare function getDocumentType(id: string): DocumentType | undefined;
43
44
  export declare const DocumentTypesToImport: DocumentType[];
@@ -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;