@buildnbuzz/buzzform 0.1.0 → 0.1.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.
package/dist/schema.js CHANGED
@@ -20,9 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/schema/index.ts
21
21
  var schema_exports = {};
22
22
  __export(schema_exports, {
23
- applyCustomValidation: () => applyCustomValidation,
24
23
  coerceToDate: () => coerceToDate,
25
24
  coerceToNumber: () => coerceToNumber,
25
+ collectFieldValidators: () => collectFieldValidators,
26
26
  createArrayFieldSchema: () => createArrayFieldSchema,
27
27
  createArrayHelpers: () => createArrayHelpers,
28
28
  createCheckboxFieldSchema: () => createCheckboxFieldSchema,
@@ -44,6 +44,8 @@ __export(schema_exports, {
44
44
  generateFieldId: () => generateFieldId,
45
45
  getNestedValue: () => getNestedValue,
46
46
  getPatternErrorMessage: () => getPatternErrorMessage,
47
+ getSiblingData: () => getSiblingData,
48
+ getValueByPath: () => getValueByPath,
47
49
  isFileLike: () => isFileLike,
48
50
  isFileTypeAccepted: () => isFileTypeAccepted,
49
51
  makeOptional: () => makeOptional,
@@ -77,59 +79,90 @@ function extractValidationConfig(validate) {
77
79
  }
78
80
  return { fn: void 0, isLive: false };
79
81
  }
80
- function applyCustomValidation(schema, field, fieldPath = "") {
81
- if (!("validate" in field)) {
82
- return schema;
82
+ function collectFieldValidators(fields, basePath = "") {
83
+ const validators = [];
84
+ for (const field of fields) {
85
+ if ("name" in field && field.name) {
86
+ const fieldPath = basePath ? `${basePath}.${field.name}` : field.name;
87
+ if ("validate" in field && field.validate) {
88
+ const config = extractValidationConfig(field.validate);
89
+ if (config.fn) {
90
+ validators.push({
91
+ path: fieldPath,
92
+ fn: config.fn
93
+ });
94
+ }
95
+ }
96
+ if (field.type === "group" && "fields" in field) {
97
+ validators.push(...collectFieldValidators(field.fields, fieldPath));
98
+ }
99
+ }
100
+ if (field.type === "row" && "fields" in field) {
101
+ validators.push(...collectFieldValidators(field.fields, basePath));
102
+ }
103
+ if (field.type === "collapsible" && "fields" in field) {
104
+ validators.push(...collectFieldValidators(field.fields, basePath));
105
+ }
106
+ if (field.type === "tabs" && "tabs" in field) {
107
+ for (const tab of field.tabs) {
108
+ const tabPath = tab.name ? basePath ? `${basePath}.${tab.name}` : tab.name : basePath;
109
+ validators.push(...collectFieldValidators(tab.fields, tabPath));
110
+ }
111
+ }
83
112
  }
84
- const fieldWithValidate = field;
85
- if (!fieldWithValidate.validate) {
86
- return schema;
113
+ return validators;
114
+ }
115
+ function getSiblingData(data, path) {
116
+ const parts = path.split(".");
117
+ if (parts.length <= 1) {
118
+ return data;
87
119
  }
88
- const config = extractValidationConfig(fieldWithValidate.validate);
89
- if (!config.fn) {
90
- return schema;
120
+ const parentParts = parts.slice(0, -1);
121
+ let current = data;
122
+ for (const part of parentParts) {
123
+ if (current && typeof current === "object" && current !== null) {
124
+ current = current[part];
125
+ } else {
126
+ return {};
127
+ }
91
128
  }
92
- return schema.superRefine(async (val, ctx) => {
93
- const result = await config.fn(val, {
94
- data: {},
95
- siblingData: {},
96
- path: fieldPath.split(".")
97
- });
98
- if (result !== true) {
99
- ctx.addIssue({
100
- code: import_zod.z.ZodIssueCode.custom,
101
- message: typeof result === "string" ? result : "Validation failed"
102
- });
129
+ if (current && typeof current === "object" && current !== null) {
130
+ return current;
131
+ }
132
+ return {};
133
+ }
134
+ function getValueByPath(data, path) {
135
+ const parts = path.split(".");
136
+ let current = data;
137
+ for (const part of parts) {
138
+ if (current && typeof current === "object" && current !== null) {
139
+ current = current[part];
140
+ } else {
141
+ return void 0;
103
142
  }
104
- });
143
+ }
144
+ return current;
105
145
  }
106
146
  function makeOptional(schema, fieldType) {
107
147
  switch (fieldType) {
108
- // String types: allow empty string
109
148
  case "text":
110
149
  case "textarea":
111
150
  case "email":
112
151
  case "password":
113
152
  return schema.optional().or(import_zod.z.literal(""));
114
- // Nullable types
115
153
  case "number":
116
154
  case "date":
117
155
  case "select":
118
156
  case "radio":
119
157
  return schema.optional().nullable();
120
- // Boolean types: always have a value
121
158
  case "checkbox":
122
159
  case "switch":
123
160
  return schema;
124
- // Booleans are never "optional" in the traditional sense
125
- // Array types
126
161
  case "tags":
127
162
  case "array":
128
163
  return schema.optional().default([]);
129
- // Upload
130
164
  case "upload":
131
165
  return schema.optional().nullable();
132
- // Default
133
166
  default:
134
167
  return schema.optional();
135
168
  }
@@ -186,25 +219,25 @@ function isFileTypeAccepted(file, accept) {
186
219
 
187
220
  // src/schema/builders/text.ts
188
221
  function createTextFieldSchema(field) {
189
- let schema = import_zod2.z.string();
222
+ let schema = import_zod2.z.string({ error: "This field is required" });
190
223
  if ("pattern" in field && field.pattern) {
191
224
  const pattern = typeof field.pattern === "string" ? new RegExp(field.pattern) : field.pattern;
192
225
  schema = schema.regex(pattern, {
193
- message: getPatternErrorMessage(field.pattern)
226
+ error: getPatternErrorMessage(field.pattern)
194
227
  });
195
228
  }
196
229
  if (field.minLength) {
197
230
  schema = schema.min(field.minLength, {
198
- message: `Must be at least ${field.minLength} characters`
231
+ error: `Must be at least ${field.minLength} characters`
199
232
  });
200
233
  }
201
234
  if (field.maxLength) {
202
235
  schema = schema.max(field.maxLength, {
203
- message: `Must be no more than ${field.maxLength} characters`
236
+ error: `Must be no more than ${field.maxLength} characters`
204
237
  });
205
238
  }
206
239
  if (field.required) {
207
- schema = schema.min(1, { message: "This field is required" });
240
+ schema = schema.min(1, { error: "This field is required" });
208
241
  }
209
242
  let finalSchema = schema;
210
243
  if ("trim" in field && field.trim) {
@@ -212,67 +245,63 @@ function createTextFieldSchema(field) {
212
245
  return typeof val === "string" ? val.trim() : val;
213
246
  }, schema);
214
247
  }
215
- finalSchema = applyCustomValidation(finalSchema, field, field.name);
216
248
  if (!field.required) {
217
249
  return makeOptional(finalSchema, field.type);
218
250
  }
219
251
  return finalSchema;
220
252
  }
221
253
  function createEmailFieldSchema(field) {
222
- let schema = import_zod2.z.string().email({ message: "Invalid email address" });
254
+ let schema = import_zod2.z.email({ error: "Invalid email address" });
223
255
  if (field.minLength) {
224
256
  schema = schema.min(field.minLength, {
225
- message: `Must be at least ${field.minLength} characters`
257
+ error: `Must be at least ${field.minLength} characters`
226
258
  });
227
259
  }
228
260
  if (field.maxLength) {
229
261
  schema = schema.max(field.maxLength, {
230
- message: `Must be no more than ${field.maxLength} characters`
262
+ error: `Must be no more than ${field.maxLength} characters`
231
263
  });
232
264
  }
233
265
  if (field.required) {
234
- schema = schema.min(1, { message: "Email is required" });
266
+ schema = schema.min(1, { error: "Email is required" });
235
267
  }
236
- const finalSchema = applyCustomValidation(schema, field, field.name);
237
268
  if (!field.required) {
238
- return makeOptional(finalSchema, "email");
269
+ return makeOptional(schema, "email");
239
270
  }
240
- return finalSchema;
271
+ return schema;
241
272
  }
242
273
  function createPasswordFieldSchema(field) {
243
- let schema = import_zod2.z.string();
274
+ let schema = import_zod2.z.string({ error: "Password is required" });
244
275
  if (field.minLength) {
245
276
  schema = schema.min(field.minLength, {
246
- message: `Password must be at least ${field.minLength} characters`
277
+ error: `Password must be at least ${field.minLength} characters`
247
278
  });
248
279
  }
249
280
  if (field.maxLength) {
250
281
  schema = schema.max(field.maxLength, {
251
- message: `Password must be no more than ${field.maxLength} characters`
282
+ error: `Password must be no more than ${field.maxLength} characters`
252
283
  });
253
284
  }
254
285
  if (field.required) {
255
- schema = schema.min(1, { message: "Password is required" });
286
+ schema = schema.min(1, { error: "Password is required" });
256
287
  }
257
- const finalSchema = applyCustomValidation(schema, field, field.name);
258
288
  if (!field.required) {
259
- return makeOptional(finalSchema, "password");
289
+ return makeOptional(schema, "password");
260
290
  }
261
- return finalSchema;
291
+ return schema;
262
292
  }
263
293
 
264
294
  // src/schema/builders/number.ts
265
295
  var import_zod3 = require("zod");
266
296
  function createNumberFieldSchema(field) {
267
- let numSchema = import_zod3.z.number({ invalid_type_error: "Must be a number" });
297
+ let numSchema = import_zod3.z.number({ error: "Must be a number" });
268
298
  if (field.min !== void 0) {
269
299
  numSchema = numSchema.min(field.min, `Must be at least ${field.min}`);
270
300
  }
271
301
  if (field.max !== void 0) {
272
302
  numSchema = numSchema.max(field.max, `Must be at most ${field.max}`);
273
303
  }
274
- let schema = import_zod3.z.preprocess(coerceToNumber, numSchema);
275
- schema = applyCustomValidation(schema, field, field.name);
304
+ const schema = import_zod3.z.preprocess(coerceToNumber, numSchema);
276
305
  if (field.required) {
277
306
  return schema;
278
307
  }
@@ -291,21 +320,20 @@ function createDateFieldSchema(field) {
291
320
  const isDatetime = field.type === "datetime";
292
321
  const minDate = toDate(field.minDate);
293
322
  const maxDate = toDate(field.maxDate);
294
- let dateSchema = import_zod4.z.date({ invalid_type_error: "Please enter a valid date" });
323
+ let dateSchema = import_zod4.z.date({ error: "Please enter a valid date" });
295
324
  if (minDate) {
296
325
  const formattedDate = isDatetime ? minDate.toLocaleString() : minDate.toDateString();
297
326
  dateSchema = dateSchema.min(minDate, {
298
- message: `Date must be on or after ${formattedDate}`
327
+ error: `Date must be on or after ${formattedDate}`
299
328
  });
300
329
  }
301
330
  if (maxDate) {
302
331
  const formattedDate = isDatetime ? maxDate.toLocaleString() : maxDate.toDateString();
303
332
  dateSchema = dateSchema.max(maxDate, {
304
- message: `Date must be on or before ${formattedDate}`
333
+ error: `Date must be on or before ${formattedDate}`
305
334
  });
306
335
  }
307
- let schema = import_zod4.z.preprocess(coerceToDate, dateSchema);
308
- schema = applyCustomValidation(schema, field, field.name);
336
+ const schema = import_zod4.z.preprocess(coerceToDate, dateSchema);
309
337
  if (field.required) {
310
338
  return schema.refine(
311
339
  (val) => val instanceof Date && !isNaN(val.getTime()),
@@ -317,18 +345,21 @@ function createDateFieldSchema(field) {
317
345
 
318
346
  // src/schema/builders/select.ts
319
347
  var import_zod5 = require("zod");
320
- var selectValueSchema = import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()]);
348
+ var selectValueSchema = import_zod5.z.union([
349
+ import_zod5.z.string({ error: "Please select an option" }),
350
+ import_zod5.z.number({ error: "Please select an option" }),
351
+ import_zod5.z.boolean({ error: "Please select an option" })
352
+ ], { error: "Please select an option" });
321
353
  function createSelectFieldSchema(field) {
322
354
  if (field.hasMany) {
323
- let arraySchema = import_zod5.z.array(selectValueSchema);
355
+ let arraySchema = import_zod5.z.array(selectValueSchema, { error: "Invalid selection" });
324
356
  if (field.required) {
325
357
  arraySchema = arraySchema.min(1, "Select at least one option");
326
358
  }
327
- const schema2 = applyCustomValidation(arraySchema, field, field.name);
328
359
  if (!field.required) {
329
- return schema2.optional().default([]);
360
+ return arraySchema.optional().default([]);
330
361
  }
331
- return schema2;
362
+ return arraySchema;
332
363
  }
333
364
  let schema = selectValueSchema;
334
365
  if (field.required) {
@@ -337,7 +368,6 @@ function createSelectFieldSchema(field) {
337
368
  "Please select an option"
338
369
  );
339
370
  }
340
- schema = applyCustomValidation(schema, field, field.name);
341
371
  if (!field.required) {
342
372
  return makeOptional(schema, "select");
343
373
  }
@@ -351,7 +381,6 @@ function createRadioFieldSchema(field) {
351
381
  "Please select an option"
352
382
  );
353
383
  }
354
- schema = applyCustomValidation(schema, field, field.name);
355
384
  if (!field.required) {
356
385
  return makeOptional(schema, "radio");
357
386
  }
@@ -361,146 +390,113 @@ function createRadioFieldSchema(field) {
361
390
  // src/schema/builders/boolean.ts
362
391
  var import_zod6 = require("zod");
363
392
  function createCheckboxFieldSchema(field) {
364
- let schema = import_zod6.z.boolean();
393
+ let schema = import_zod6.z.boolean({ error: "Invalid value" });
365
394
  if (field.required) {
366
- schema = import_zod6.z.boolean().refine((val) => val === true, {
367
- message: "This field is required"
395
+ schema = import_zod6.z.boolean({ error: "This field is required" }).refine((val) => val === true, {
396
+ error: "This field is required"
368
397
  });
369
398
  }
370
- return applyCustomValidation(schema, field, field.name);
399
+ return schema;
371
400
  }
372
401
  function createSwitchFieldSchema(field) {
373
- let schema = import_zod6.z.boolean();
402
+ let schema = import_zod6.z.boolean({ error: "Invalid value" });
374
403
  if (field.required) {
375
- schema = import_zod6.z.boolean().refine((val) => val === true, {
376
- message: "This field is required"
404
+ schema = import_zod6.z.boolean({ error: "This field is required" }).refine((val) => val === true, {
405
+ error: "This field is required"
377
406
  });
378
407
  }
379
- return applyCustomValidation(schema, field, field.name);
408
+ return schema;
380
409
  }
381
410
 
382
411
  // src/schema/builders/upload.ts
383
412
  var import_zod7 = require("zod");
384
- function validateSingleFile(value, field) {
385
- if (value === null || value === void 0 || value === "") {
386
- return { valid: true };
387
- }
388
- if (typeof value === "string") {
389
- return { valid: true };
413
+ function matchesMimePattern(fileType, pattern) {
414
+ const normalizedPattern = pattern.toLowerCase().trim();
415
+ const normalizedType = fileType.toLowerCase();
416
+ if (normalizedPattern.endsWith("/*")) {
417
+ const category = normalizedPattern.replace("/*", "");
418
+ return normalizedType.startsWith(category + "/");
390
419
  }
391
- if (!isFileLike(value)) {
392
- return { valid: false, message: "Invalid file" };
420
+ if (normalizedPattern.startsWith(".")) {
421
+ return true;
393
422
  }
394
- if (field.maxSize && value.size > field.maxSize) {
423
+ return normalizedType === normalizedPattern;
424
+ }
425
+ function isFileTypeAccepted2(file, acceptPatterns) {
426
+ if (!file.type) return true;
427
+ return acceptPatterns.some((pattern) => matchesMimePattern(file.type, pattern));
428
+ }
429
+ function createUploadFieldSchema(field) {
430
+ let fileSchema = import_zod7.z.file({ error: "Please select a file" });
431
+ if (field.maxSize) {
395
432
  const sizeMB = (field.maxSize / 1024 / 1024).toFixed(1);
396
- return {
397
- valid: false,
398
- message: `File must be smaller than ${sizeMB}MB`
399
- };
433
+ fileSchema = fileSchema.max(field.maxSize, {
434
+ error: `File must be smaller than ${sizeMB}MB`
435
+ });
400
436
  }
401
437
  const accept = field.ui?.accept;
402
438
  if (accept && accept !== "*") {
403
- if (!isFileTypeAccepted(value, accept)) {
404
- return {
405
- valid: false,
406
- message: `File type not allowed. Accepted: ${accept}`
407
- };
439
+ const acceptPatterns = accept.split(",").map((t) => t.trim());
440
+ const hasWildcard = acceptPatterns.some((p) => p.includes("*") || p.startsWith("."));
441
+ if (hasWildcard) {
442
+ fileSchema = fileSchema.refine(
443
+ (file) => isFileTypeAccepted2(file, acceptPatterns),
444
+ `File type not allowed. Accepted: ${accept}`
445
+ );
446
+ } else {
447
+ fileSchema = fileSchema.mime(acceptPatterns, {
448
+ error: `File type not allowed. Accepted: ${accept}`
449
+ });
408
450
  }
409
451
  }
410
- return { valid: true };
411
- }
412
- function createUploadFieldSchema(field) {
452
+ const fileOrUrl = import_zod7.z.union([
453
+ fileSchema,
454
+ import_zod7.z.string({ error: "Invalid file" })
455
+ ], { error: "Please select a file" });
413
456
  if (field.hasMany) {
414
- const schema2 = import_zod7.z.array(import_zod7.z.any()).superRefine((files, ctx) => {
415
- for (let i = 0; i < files.length; i++) {
416
- const file = files[i];
417
- const result = validateSingleFile(file, field);
418
- if (!result.valid) {
419
- ctx.addIssue({
420
- code: import_zod7.z.ZodIssueCode.custom,
421
- message: result.message || "Invalid file",
422
- path: [i]
423
- });
424
- }
425
- }
426
- if (field.required) {
427
- const validFiles = files.filter((f) => f !== null && f !== void 0);
428
- if (validFiles.length === 0) {
429
- ctx.addIssue({
430
- code: import_zod7.z.ZodIssueCode.custom,
431
- message: "At least one file is required"
432
- });
433
- }
434
- }
435
- if (field.minFiles !== void 0 && field.minFiles > 0) {
436
- const validFiles = files.filter((f) => f !== null && f !== void 0);
437
- if (validFiles.length < field.minFiles) {
438
- ctx.addIssue({
439
- code: import_zod7.z.ZodIssueCode.custom,
440
- message: `At least ${field.minFiles} file(s) required`
441
- });
442
- }
443
- }
444
- if (field.maxFiles !== void 0) {
445
- const validFiles = files.filter((f) => f !== null && f !== void 0);
446
- if (validFiles.length > field.maxFiles) {
447
- ctx.addIssue({
448
- code: import_zod7.z.ZodIssueCode.custom,
449
- message: `Maximum ${field.maxFiles} file(s) allowed`
450
- });
451
- }
452
- }
453
- });
454
- if (!field.required) {
455
- return schema2.optional().default([]);
456
- }
457
- return schema2;
458
- }
459
- const schema = import_zod7.z.any().superRefine((value, ctx) => {
460
- if (field.required && (value === null || value === void 0 || value === "")) {
461
- ctx.addIssue({
462
- code: import_zod7.z.ZodIssueCode.custom,
463
- message: "File is required"
457
+ let arraySchema = import_zod7.z.array(fileOrUrl, { error: "Invalid files" });
458
+ if (field.minFiles !== void 0 && field.minFiles > 0) {
459
+ arraySchema = arraySchema.min(field.minFiles, {
460
+ error: `At least ${field.minFiles} file(s) required`
464
461
  });
465
- return;
466
462
  }
467
- if (value === null || value === void 0 || value === "") {
468
- return;
463
+ if (field.maxFiles !== void 0) {
464
+ arraySchema = arraySchema.max(field.maxFiles, {
465
+ error: `Maximum ${field.maxFiles} file(s) allowed`
466
+ });
469
467
  }
470
- const result = validateSingleFile(value, field);
471
- if (!result.valid) {
472
- ctx.addIssue({
473
- code: import_zod7.z.ZodIssueCode.custom,
474
- message: result.message || "Invalid file"
468
+ if (field.required) {
469
+ arraySchema = arraySchema.min(1, {
470
+ error: "At least one file is required"
475
471
  });
472
+ return arraySchema;
476
473
  }
477
- });
478
- if (!field.required) {
479
- return schema.optional().nullable();
474
+ return arraySchema.optional().default([]);
480
475
  }
481
- return schema;
476
+ if (field.required) {
477
+ return fileOrUrl;
478
+ }
479
+ return fileOrUrl.optional().nullable();
482
480
  }
483
481
 
484
482
  // src/schema/builders/tags.ts
485
483
  var import_zod8 = require("zod");
486
484
  function createTagsFieldSchema(field) {
487
- const tagSchema = import_zod8.z.string();
488
- let schema = import_zod8.z.array(tagSchema);
485
+ const tagSchema = import_zod8.z.string({ error: "Invalid tag" });
486
+ let schema = import_zod8.z.array(tagSchema, { error: "Invalid tags" });
489
487
  if (field.minTags !== void 0) {
490
488
  schema = schema.min(field.minTags, `At least ${field.minTags} tag(s) required`);
491
489
  }
492
490
  if (field.maxTags !== void 0) {
493
491
  schema = schema.max(field.maxTags, `Maximum ${field.maxTags} tag(s) allowed`);
494
492
  }
495
- let finalSchema = applyCustomValidation(schema, field, field.name);
496
493
  if (field.required) {
497
- finalSchema = finalSchema.refine(
494
+ return schema.refine(
498
495
  (arr) => Array.isArray(arr) && arr.length > 0,
499
496
  "At least one tag is required"
500
497
  );
501
- return finalSchema;
502
498
  }
503
- return finalSchema.optional().default([]);
499
+ return schema.optional().default([]);
504
500
  }
505
501
 
506
502
  // src/schema/builders/composite.ts
@@ -539,7 +535,6 @@ function fieldToZod(field) {
539
535
  return field.schema;
540
536
  }
541
537
  switch (field.type) {
542
- // Text-based fields
543
538
  case "text":
544
539
  return createTextFieldSchema(field);
545
540
  case "email":
@@ -548,35 +543,27 @@ function fieldToZod(field) {
548
543
  return createPasswordFieldSchema(field);
549
544
  case "textarea":
550
545
  return createTextFieldSchema(field);
551
- // Number
552
546
  case "number":
553
547
  return createNumberFieldSchema(field);
554
- // Date
555
548
  case "date":
556
549
  case "datetime":
557
550
  return createDateFieldSchema(field);
558
- // Selection
559
551
  case "select":
560
552
  return createSelectFieldSchema(field);
561
553
  case "radio":
562
554
  return createRadioFieldSchema(field);
563
- // Boolean
564
555
  case "checkbox":
565
556
  return createCheckboxFieldSchema(field);
566
557
  case "switch":
567
558
  return createSwitchFieldSchema(field);
568
- // Upload
569
559
  case "upload":
570
560
  return createUploadFieldSchema(field);
571
- // Tags
572
561
  case "tags":
573
562
  return createTagsFieldSchema(field);
574
- // Composite (recursive)
575
563
  case "array":
576
564
  return createArrayFieldSchema(field, fieldsToZodSchema);
577
565
  case "group":
578
566
  return createGroupFieldSchema(field, fieldsToZodSchema);
579
- // Layout fields don't produce schemas directly
580
567
  case "row":
581
568
  case "collapsible":
582
569
  case "tabs":
@@ -736,9 +723,9 @@ function formatBytes(bytes, decimals = 2) {
736
723
  }
737
724
  // Annotate the CommonJS export names for ESM import in node:
738
725
  0 && (module.exports = {
739
- applyCustomValidation,
740
726
  coerceToDate,
741
727
  coerceToNumber,
728
+ collectFieldValidators,
742
729
  createArrayFieldSchema,
743
730
  createArrayHelpers,
744
731
  createCheckboxFieldSchema,
@@ -760,6 +747,8 @@ function formatBytes(bytes, decimals = 2) {
760
747
  generateFieldId,
761
748
  getNestedValue,
762
749
  getPatternErrorMessage,
750
+ getSiblingData,
751
+ getValueByPath,
763
752
  isFileLike,
764
753
  isFileTypeAccepted,
765
754
  makeOptional,