@budibase/types 3.2.14 → 3.2.17

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,26 @@
1
+ import { SearchFilters } from "../../../../sdk";
2
+ import { Row } from "../../../../documents";
3
+ import { SortOrder } from "../../../../api/web/pagination";
4
+ import { ReadStream } from "fs";
5
+ export * from "./search";
6
+ export interface SaveRowRequest extends Row {
7
+ }
8
+ export interface PatchRowRequest extends Row {
9
+ _id: string;
10
+ _rev: string;
11
+ tableId: string;
12
+ }
13
+ export interface PatchRowResponse extends Row {
14
+ }
15
+ export interface ExportRowsRequest {
16
+ rows?: string[];
17
+ columns?: string[];
18
+ query?: SearchFilters;
19
+ sort?: string;
20
+ sortOrder?: SortOrder;
21
+ delimiter?: string;
22
+ customHeaders?: {
23
+ [key: string]: string;
24
+ };
25
+ }
26
+ export type ExportRowsResponse = ReadStream;
@@ -0,0 +1,240 @@
1
+ import { EmptyFilterOption } from "../../../../sdk";
2
+ import { Row } from "../../../../documents";
3
+ import { PaginationResponse, SortOrder, SortType } from "../../../../api/web/pagination";
4
+ import { z } from "zod";
5
+ declare const searchRowRequest: z.ZodObject<{
6
+ query: z.ZodOptional<z.ZodObject<{
7
+ equal: z.ZodTypeAny;
8
+ notEqual: z.ZodTypeAny;
9
+ empty: z.ZodTypeAny;
10
+ notEmpty: z.ZodTypeAny;
11
+ fuzzy: z.ZodTypeAny;
12
+ string: z.ZodTypeAny;
13
+ range: z.ZodTypeAny;
14
+ contains: z.ZodTypeAny;
15
+ notContains: z.ZodTypeAny;
16
+ containsAny: z.ZodTypeAny;
17
+ oneOf: z.ZodTypeAny;
18
+ $and: z.ZodTypeAny;
19
+ $or: z.ZodTypeAny;
20
+ allOr: z.ZodOptional<z.ZodBoolean>;
21
+ onEmptyFilter: z.ZodOptional<z.ZodNativeEnum<typeof EmptyFilterOption>>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ allOr?: boolean | undefined;
24
+ onEmptyFilter?: EmptyFilterOption | undefined;
25
+ equal?: any;
26
+ notEqual?: any;
27
+ empty?: any;
28
+ notEmpty?: any;
29
+ fuzzy?: any;
30
+ string?: any;
31
+ range?: any;
32
+ contains?: any;
33
+ notContains?: any;
34
+ containsAny?: any;
35
+ oneOf?: any;
36
+ $and?: any;
37
+ $or?: any;
38
+ }, {
39
+ allOr?: boolean | undefined;
40
+ onEmptyFilter?: EmptyFilterOption | undefined;
41
+ equal?: any;
42
+ notEqual?: any;
43
+ empty?: any;
44
+ notEmpty?: any;
45
+ fuzzy?: any;
46
+ string?: any;
47
+ range?: any;
48
+ contains?: any;
49
+ notContains?: any;
50
+ containsAny?: any;
51
+ oneOf?: any;
52
+ $and?: any;
53
+ $or?: any;
54
+ }>>;
55
+ paginate: z.ZodOptional<z.ZodBoolean>;
56
+ bookmark: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
57
+ limit: z.ZodOptional<z.ZodNumber>;
58
+ sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
+ sortOrder: z.ZodOptional<z.ZodNativeEnum<typeof SortOrder>>;
60
+ sortType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof SortType>>>;
61
+ version: z.ZodOptional<z.ZodString>;
62
+ disableEscaping: z.ZodOptional<z.ZodBoolean>;
63
+ countRows: z.ZodOptional<z.ZodBoolean>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ version?: string | undefined;
66
+ query?: {
67
+ allOr?: boolean | undefined;
68
+ onEmptyFilter?: EmptyFilterOption | undefined;
69
+ equal?: any;
70
+ notEqual?: any;
71
+ empty?: any;
72
+ notEmpty?: any;
73
+ fuzzy?: any;
74
+ string?: any;
75
+ range?: any;
76
+ contains?: any;
77
+ notContains?: any;
78
+ containsAny?: any;
79
+ oneOf?: any;
80
+ $and?: any;
81
+ $or?: any;
82
+ } | undefined;
83
+ sort?: string | null | undefined;
84
+ limit?: number | undefined;
85
+ paginate?: boolean | undefined;
86
+ bookmark?: string | number | null | undefined;
87
+ sortOrder?: SortOrder | undefined;
88
+ sortType?: SortType | null | undefined;
89
+ disableEscaping?: boolean | undefined;
90
+ countRows?: boolean | undefined;
91
+ }, {
92
+ version?: string | undefined;
93
+ query?: {
94
+ allOr?: boolean | undefined;
95
+ onEmptyFilter?: EmptyFilterOption | undefined;
96
+ equal?: any;
97
+ notEqual?: any;
98
+ empty?: any;
99
+ notEmpty?: any;
100
+ fuzzy?: any;
101
+ string?: any;
102
+ range?: any;
103
+ contains?: any;
104
+ notContains?: any;
105
+ containsAny?: any;
106
+ oneOf?: any;
107
+ $and?: any;
108
+ $or?: any;
109
+ } | undefined;
110
+ sort?: string | null | undefined;
111
+ limit?: number | undefined;
112
+ paginate?: boolean | undefined;
113
+ bookmark?: string | number | null | undefined;
114
+ sortOrder?: SortOrder | undefined;
115
+ sortType?: SortType | null | undefined;
116
+ disableEscaping?: boolean | undefined;
117
+ countRows?: boolean | undefined;
118
+ }>;
119
+ export declare const searchRowRequestValidator: z.ZodObject<{
120
+ query: z.ZodOptional<z.ZodObject<{
121
+ equal: z.ZodTypeAny;
122
+ notEqual: z.ZodTypeAny;
123
+ empty: z.ZodTypeAny;
124
+ notEmpty: z.ZodTypeAny;
125
+ fuzzy: z.ZodTypeAny;
126
+ string: z.ZodTypeAny;
127
+ range: z.ZodTypeAny;
128
+ contains: z.ZodTypeAny;
129
+ notContains: z.ZodTypeAny;
130
+ containsAny: z.ZodTypeAny;
131
+ oneOf: z.ZodTypeAny;
132
+ $and: z.ZodTypeAny;
133
+ $or: z.ZodTypeAny;
134
+ allOr: z.ZodOptional<z.ZodBoolean>;
135
+ onEmptyFilter: z.ZodOptional<z.ZodNativeEnum<typeof EmptyFilterOption>>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ allOr?: boolean | undefined;
138
+ onEmptyFilter?: EmptyFilterOption | undefined;
139
+ equal?: any;
140
+ notEqual?: any;
141
+ empty?: any;
142
+ notEmpty?: any;
143
+ fuzzy?: any;
144
+ string?: any;
145
+ range?: any;
146
+ contains?: any;
147
+ notContains?: any;
148
+ containsAny?: any;
149
+ oneOf?: any;
150
+ $and?: any;
151
+ $or?: any;
152
+ }, {
153
+ allOr?: boolean | undefined;
154
+ onEmptyFilter?: EmptyFilterOption | undefined;
155
+ equal?: any;
156
+ notEqual?: any;
157
+ empty?: any;
158
+ notEmpty?: any;
159
+ fuzzy?: any;
160
+ string?: any;
161
+ range?: any;
162
+ contains?: any;
163
+ notContains?: any;
164
+ containsAny?: any;
165
+ oneOf?: any;
166
+ $and?: any;
167
+ $or?: any;
168
+ }>>;
169
+ paginate: z.ZodOptional<z.ZodBoolean>;
170
+ bookmark: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
171
+ limit: z.ZodOptional<z.ZodNumber>;
172
+ sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
173
+ sortOrder: z.ZodOptional<z.ZodNativeEnum<typeof SortOrder>>;
174
+ sortType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof SortType>>>;
175
+ version: z.ZodOptional<z.ZodString>;
176
+ disableEscaping: z.ZodOptional<z.ZodBoolean>;
177
+ countRows: z.ZodOptional<z.ZodBoolean>;
178
+ }, "strip", z.ZodTypeAny, {
179
+ version?: string | undefined;
180
+ query?: {
181
+ allOr?: boolean | undefined;
182
+ onEmptyFilter?: EmptyFilterOption | undefined;
183
+ equal?: any;
184
+ notEqual?: any;
185
+ empty?: any;
186
+ notEmpty?: any;
187
+ fuzzy?: any;
188
+ string?: any;
189
+ range?: any;
190
+ contains?: any;
191
+ notContains?: any;
192
+ containsAny?: any;
193
+ oneOf?: any;
194
+ $and?: any;
195
+ $or?: any;
196
+ } | undefined;
197
+ sort?: string | null | undefined;
198
+ limit?: number | undefined;
199
+ paginate?: boolean | undefined;
200
+ bookmark?: string | number | null | undefined;
201
+ sortOrder?: SortOrder | undefined;
202
+ sortType?: SortType | null | undefined;
203
+ disableEscaping?: boolean | undefined;
204
+ countRows?: boolean | undefined;
205
+ }, {
206
+ version?: string | undefined;
207
+ query?: {
208
+ allOr?: boolean | undefined;
209
+ onEmptyFilter?: EmptyFilterOption | undefined;
210
+ equal?: any;
211
+ notEqual?: any;
212
+ empty?: any;
213
+ notEmpty?: any;
214
+ fuzzy?: any;
215
+ string?: any;
216
+ range?: any;
217
+ contains?: any;
218
+ notContains?: any;
219
+ containsAny?: any;
220
+ oneOf?: any;
221
+ $and?: any;
222
+ $or?: any;
223
+ } | undefined;
224
+ sort?: string | null | undefined;
225
+ limit?: number | undefined;
226
+ paginate?: boolean | undefined;
227
+ bookmark?: string | number | null | undefined;
228
+ sortOrder?: SortOrder | undefined;
229
+ sortType?: SortType | null | undefined;
230
+ disableEscaping?: boolean | undefined;
231
+ countRows?: boolean | undefined;
232
+ }>;
233
+ export type SearchRowRequest = z.infer<typeof searchRowRequest>;
234
+ export type SearchViewRowRequest = Pick<SearchRowRequest, "sort" | "sortOrder" | "sortType" | "limit" | "bookmark" | "paginate" | "query" | "countRows">;
235
+ export interface SearchRowResponse {
236
+ rows: Row[];
237
+ }
238
+ export interface PaginatedSearchRowResponse extends SearchRowResponse, PaginationResponse {
239
+ }
240
+ export {};
@@ -148,7 +148,8 @@ export declare enum AutomationFeature {
148
148
  LOOPING = "LOOPING"
149
149
  }
150
150
  export declare enum AutomationStepStatus {
151
- NO_ITERATIONS = "no_iterations"
151
+ NO_ITERATIONS = "no_iterations",
152
+ MAX_ITERATIONS = "max_iterations_reached"
152
153
  }
153
154
  export declare enum AutomationStatus {
154
155
  SUCCESS = "success",
package/dist/index.js CHANGED
@@ -171,7 +171,8 @@ __export(src_exports, {
171
171
  isStaticQuota: () => isStaticQuota,
172
172
  isUser: () => isUser,
173
173
  isVerifiableSSOProvider: () => isVerifiableSSOProvider,
174
- prefixed: () => prefixed
174
+ prefixed: () => prefixed,
175
+ searchRowRequestValidator: () => searchRowRequestValidator
175
176
  });
176
177
  module.exports = __toCommonJS(src_exports);
177
178
 
@@ -834,12 +835,11 @@ var TenantResolutionStrategy = /* @__PURE__ */ ((TenantResolutionStrategy2) => {
834
835
 
835
836
  // src/sdk/featureFlag.ts
836
837
  var FeatureFlag = /* @__PURE__ */ ((FeatureFlag2) => {
837
- FeatureFlag2["PER_CREATOR_PER_USER_PRICE"] = "PER_CREATOR_PER_USER_PRICE";
838
- FeatureFlag2["PER_CREATOR_PER_USER_PRICE_ALERT"] = "PER_CREATOR_PER_USER_PRICE_ALERT";
839
838
  FeatureFlag2["AUTOMATION_BRANCHING"] = "AUTOMATION_BRANCHING";
840
839
  FeatureFlag2["AI_CUSTOM_CONFIGS"] = "AI_CUSTOM_CONFIGS";
841
840
  FeatureFlag2["DEFAULT_VALUES"] = "DEFAULT_VALUES";
842
841
  FeatureFlag2["BUDIBASE_AI"] = "BUDIBASE_AI";
842
+ FeatureFlag2["USE_ZOD_VALIDATOR"] = "USE_ZOD_VALIDATOR";
843
843
  return FeatureFlag2;
844
844
  })(FeatureFlag || {});
845
845
 
@@ -1029,6 +1029,7 @@ var AutomationFeature = /* @__PURE__ */ ((AutomationFeature2) => {
1029
1029
  })(AutomationFeature || {});
1030
1030
  var AutomationStepStatus = /* @__PURE__ */ ((AutomationStepStatus2) => {
1031
1031
  AutomationStepStatus2["NO_ITERATIONS"] = "no_iterations";
1032
+ AutomationStepStatus2["MAX_ITERATIONS"] = "max_iterations_reached";
1032
1033
  return AutomationStepStatus2;
1033
1034
  })(AutomationStepStatus || {});
1034
1035
  var AutomationStatus = /* @__PURE__ */ ((AutomationStatus2) => {
@@ -1442,18 +1443,6 @@ var PingSource = /* @__PURE__ */ ((PingSource2) => {
1442
1443
  return PingSource2;
1443
1444
  })(PingSource || {});
1444
1445
 
1445
- // src/api/web/global/auditLogs.ts
1446
- var AuditLogResourceStatus = /* @__PURE__ */ ((AuditLogResourceStatus2) => {
1447
- AuditLogResourceStatus2["DELETED"] = "deleted";
1448
- return AuditLogResourceStatus2;
1449
- })(AuditLogResourceStatus || {});
1450
-
1451
- // src/api/web/global/events.ts
1452
- var EventPublishType = /* @__PURE__ */ ((EventPublishType2) => {
1453
- EventPublishType2["ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED"] = "environment_variable_upgrade_panel_opened";
1454
- return EventPublishType2;
1455
- })(EventPublishType || {});
1456
-
1457
1446
  // src/api/web/pagination.ts
1458
1447
  var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
1459
1448
  SortOrder2["ASCENDING"] = "ascending";
@@ -1466,6 +1455,72 @@ var SortType = /* @__PURE__ */ ((SortType2) => {
1466
1455
  return SortType2;
1467
1456
  })(SortType || {});
1468
1457
 
1458
+ // src/api/web/app/rows/search.ts
1459
+ var import_zod = require("zod");
1460
+ var fieldKey = import_zod.z.string().refine((s) => s !== "_complexIdOperator" /* COMPLEX_ID_OPERATOR */, {
1461
+ message: `Key '${"_complexIdOperator" /* COMPLEX_ID_OPERATOR */}' is not allowed`
1462
+ });
1463
+ var stringBasicFilter = import_zod.z.record(fieldKey, import_zod.z.string());
1464
+ var basicFilter = import_zod.z.record(fieldKey, import_zod.z.any());
1465
+ var arrayFilter = import_zod.z.record(fieldKey, import_zod.z.union([import_zod.z.any().array(), import_zod.z.string()]));
1466
+ var logicFilter = import_zod.z.lazy(
1467
+ () => import_zod.z.object({
1468
+ conditions: import_zod.z.array(import_zod.z.object(queryFilterValidation))
1469
+ })
1470
+ );
1471
+ var stringOrNumber = import_zod.z.union([import_zod.z.string(), import_zod.z.number()]);
1472
+ var queryFilterValidation = {
1473
+ ["string" /* STRING */]: stringBasicFilter.optional(),
1474
+ ["fuzzy" /* FUZZY */]: stringBasicFilter.optional(),
1475
+ ["range" /* RANGE */]: import_zod.z.record(
1476
+ fieldKey,
1477
+ import_zod.z.union([
1478
+ import_zod.z.object({ high: stringOrNumber, low: stringOrNumber }),
1479
+ import_zod.z.object({ high: stringOrNumber }),
1480
+ import_zod.z.object({ low: stringOrNumber })
1481
+ ])
1482
+ ).optional(),
1483
+ ["equal" /* EQUAL */]: basicFilter.optional(),
1484
+ ["notEqual" /* NOT_EQUAL */]: basicFilter.optional(),
1485
+ ["empty" /* EMPTY */]: basicFilter.optional(),
1486
+ ["notEmpty" /* NOT_EMPTY */]: basicFilter.optional(),
1487
+ ["oneOf" /* ONE_OF */]: arrayFilter.optional(),
1488
+ ["contains" /* CONTAINS */]: arrayFilter.optional(),
1489
+ ["notContains" /* NOT_CONTAINS */]: arrayFilter.optional(),
1490
+ ["containsAny" /* CONTAINS_ANY */]: arrayFilter.optional(),
1491
+ ["$and" /* AND */]: logicFilter.optional(),
1492
+ ["$or" /* OR */]: logicFilter.optional()
1493
+ };
1494
+ var searchRowRequest = import_zod.z.object({
1495
+ query: import_zod.z.object({
1496
+ allOr: import_zod.z.boolean().optional(),
1497
+ onEmptyFilter: import_zod.z.nativeEnum(EmptyFilterOption).optional(),
1498
+ ...queryFilterValidation
1499
+ }).optional(),
1500
+ paginate: import_zod.z.boolean().optional(),
1501
+ bookmark: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]).nullish(),
1502
+ limit: import_zod.z.number().optional(),
1503
+ sort: import_zod.z.string().nullish(),
1504
+ sortOrder: import_zod.z.nativeEnum(SortOrder).optional(),
1505
+ sortType: import_zod.z.nativeEnum(SortType).nullish(),
1506
+ version: import_zod.z.string().optional(),
1507
+ disableEscaping: import_zod.z.boolean().optional(),
1508
+ countRows: import_zod.z.boolean().optional()
1509
+ });
1510
+ var searchRowRequestValidator = searchRowRequest;
1511
+
1512
+ // src/api/web/global/auditLogs.ts
1513
+ var AuditLogResourceStatus = /* @__PURE__ */ ((AuditLogResourceStatus2) => {
1514
+ AuditLogResourceStatus2["DELETED"] = "deleted";
1515
+ return AuditLogResourceStatus2;
1516
+ })(AuditLogResourceStatus || {});
1517
+
1518
+ // src/api/web/global/events.ts
1519
+ var EventPublishType = /* @__PURE__ */ ((EventPublishType2) => {
1520
+ EventPublishType2["ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED"] = "environment_variable_upgrade_panel_opened";
1521
+ return EventPublishType2;
1522
+ })(EventPublishType || {});
1523
+
1469
1524
  // src/core/installation.ts
1470
1525
  var ServiceType = /* @__PURE__ */ ((ServiceType2) => {
1471
1526
  ServiceType2["WORKER"] = "worker";
@@ -1640,6 +1695,7 @@ var EventType = /* @__PURE__ */ ((EventType2) => {
1640
1695
  isStaticQuota,
1641
1696
  isUser,
1642
1697
  isVerifiableSSOProvider,
1643
- prefixed
1698
+ prefixed,
1699
+ searchRowRequestValidator
1644
1700
  });
1645
1701
  //# sourceMappingURL=index.js.map