@univerjs/protocol 0.1.20 → 0.1.22

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,950 +0,0 @@
1
- import type { Duration } from "../google/protobuf/duration";
2
- export declare const protobufPackage = "validate";
3
- /** WellKnownRegex contain some well-known patterns. */
4
- export declare enum KnownRegex {
5
- UNKNOWN = 0,
6
- /** HTTP_HEADER_NAME - HTTP header name as defined by RFC 7230. */
7
- HTTP_HEADER_NAME = 1,
8
- /** HTTP_HEADER_VALUE - HTTP header value as defined by RFC 7230. */
9
- HTTP_HEADER_VALUE = 2,
10
- UNRECOGNIZED = -1
11
- }
12
- /**
13
- * FieldRules encapsulates the rules for each type of field. Depending on the
14
- * field, the correct set should be used to ensure proper validations.
15
- */
16
- export interface FieldRules {
17
- message?: MessageRules | undefined;
18
- /** Scalar Field Types */
19
- float?: FloatRules | undefined;
20
- double?: DoubleRules | undefined;
21
- int32?: Int32Rules | undefined;
22
- int64?: Int64Rules | undefined;
23
- uint32?: UInt32Rules | undefined;
24
- uint64?: UInt64Rules | undefined;
25
- sint32?: SInt32Rules | undefined;
26
- sint64?: SInt64Rules | undefined;
27
- fixed32?: Fixed32Rules | undefined;
28
- fixed64?: Fixed64Rules | undefined;
29
- sfixed32?: SFixed32Rules | undefined;
30
- sfixed64?: SFixed64Rules | undefined;
31
- bool?: BoolRules | undefined;
32
- string?: StringRules | undefined;
33
- bytes?: BytesRules | undefined;
34
- /** Complex Field Types */
35
- enum?: EnumRules | undefined;
36
- repeated?: RepeatedRules | undefined;
37
- map?: MapRules | undefined;
38
- /** Well-Known Field Types */
39
- any?: AnyRules | undefined;
40
- duration?: DurationRules | undefined;
41
- timestamp?: TimestampRules | undefined;
42
- }
43
- /** FloatRules describes the constraints applied to `float` values */
44
- export interface FloatRules {
45
- /** Const specifies that this field must be exactly the specified value */
46
- const?: number | undefined;
47
- /**
48
- * Lt specifies that this field must be less than the specified value,
49
- * exclusive
50
- */
51
- lt?: number | undefined;
52
- /**
53
- * Lte specifies that this field must be less than or equal to the
54
- * specified value, inclusive
55
- */
56
- lte?: number | undefined;
57
- /**
58
- * Gt specifies that this field must be greater than the specified value,
59
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
60
- * range is reversed.
61
- */
62
- gt?: number | undefined;
63
- /**
64
- * Gte specifies that this field must be greater than or equal to the
65
- * specified value, inclusive. If the value of Gte is larger than a
66
- * specified Lt or Lte, the range is reversed.
67
- */
68
- gte?: number | undefined;
69
- /**
70
- * In specifies that this field must be equal to one of the specified
71
- * values
72
- */
73
- in: number[];
74
- /**
75
- * NotIn specifies that this field cannot be equal to one of the specified
76
- * values
77
- */
78
- notIn: number[];
79
- /**
80
- * IgnoreEmpty specifies that the validation rules of this field should be
81
- * evaluated only if the field is not empty
82
- */
83
- ignoreEmpty?: boolean | undefined;
84
- }
85
- /** DoubleRules describes the constraints applied to `double` values */
86
- export interface DoubleRules {
87
- /** Const specifies that this field must be exactly the specified value */
88
- const?: number | undefined;
89
- /**
90
- * Lt specifies that this field must be less than the specified value,
91
- * exclusive
92
- */
93
- lt?: number | undefined;
94
- /**
95
- * Lte specifies that this field must be less than or equal to the
96
- * specified value, inclusive
97
- */
98
- lte?: number | undefined;
99
- /**
100
- * Gt specifies that this field must be greater than the specified value,
101
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
102
- * range is reversed.
103
- */
104
- gt?: number | undefined;
105
- /**
106
- * Gte specifies that this field must be greater than or equal to the
107
- * specified value, inclusive. If the value of Gte is larger than a
108
- * specified Lt or Lte, the range is reversed.
109
- */
110
- gte?: number | undefined;
111
- /**
112
- * In specifies that this field must be equal to one of the specified
113
- * values
114
- */
115
- in: number[];
116
- /**
117
- * NotIn specifies that this field cannot be equal to one of the specified
118
- * values
119
- */
120
- notIn: number[];
121
- /**
122
- * IgnoreEmpty specifies that the validation rules of this field should be
123
- * evaluated only if the field is not empty
124
- */
125
- ignoreEmpty?: boolean | undefined;
126
- }
127
- /** Int32Rules describes the constraints applied to `int32` values */
128
- export interface Int32Rules {
129
- /** Const specifies that this field must be exactly the specified value */
130
- const?: number | undefined;
131
- /**
132
- * Lt specifies that this field must be less than the specified value,
133
- * exclusive
134
- */
135
- lt?: number | undefined;
136
- /**
137
- * Lte specifies that this field must be less than or equal to the
138
- * specified value, inclusive
139
- */
140
- lte?: number | undefined;
141
- /**
142
- * Gt specifies that this field must be greater than the specified value,
143
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
144
- * range is reversed.
145
- */
146
- gt?: number | undefined;
147
- /**
148
- * Gte specifies that this field must be greater than or equal to the
149
- * specified value, inclusive. If the value of Gte is larger than a
150
- * specified Lt or Lte, the range is reversed.
151
- */
152
- gte?: number | undefined;
153
- /**
154
- * In specifies that this field must be equal to one of the specified
155
- * values
156
- */
157
- in: number[];
158
- /**
159
- * NotIn specifies that this field cannot be equal to one of the specified
160
- * values
161
- */
162
- notIn: number[];
163
- /**
164
- * IgnoreEmpty specifies that the validation rules of this field should be
165
- * evaluated only if the field is not empty
166
- */
167
- ignoreEmpty?: boolean | undefined;
168
- }
169
- /** Int64Rules describes the constraints applied to `int64` values */
170
- export interface Int64Rules {
171
- /** Const specifies that this field must be exactly the specified value */
172
- const?: number | undefined;
173
- /**
174
- * Lt specifies that this field must be less than the specified value,
175
- * exclusive
176
- */
177
- lt?: number | undefined;
178
- /**
179
- * Lte specifies that this field must be less than or equal to the
180
- * specified value, inclusive
181
- */
182
- lte?: number | undefined;
183
- /**
184
- * Gt specifies that this field must be greater than the specified value,
185
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
186
- * range is reversed.
187
- */
188
- gt?: number | undefined;
189
- /**
190
- * Gte specifies that this field must be greater than or equal to the
191
- * specified value, inclusive. If the value of Gte is larger than a
192
- * specified Lt or Lte, the range is reversed.
193
- */
194
- gte?: number | undefined;
195
- /**
196
- * In specifies that this field must be equal to one of the specified
197
- * values
198
- */
199
- in: number[];
200
- /**
201
- * NotIn specifies that this field cannot be equal to one of the specified
202
- * values
203
- */
204
- notIn: number[];
205
- /**
206
- * IgnoreEmpty specifies that the validation rules of this field should be
207
- * evaluated only if the field is not empty
208
- */
209
- ignoreEmpty?: boolean | undefined;
210
- }
211
- /** UInt32Rules describes the constraints applied to `uint32` values */
212
- export interface UInt32Rules {
213
- /** Const specifies that this field must be exactly the specified value */
214
- const?: number | undefined;
215
- /**
216
- * Lt specifies that this field must be less than the specified value,
217
- * exclusive
218
- */
219
- lt?: number | undefined;
220
- /**
221
- * Lte specifies that this field must be less than or equal to the
222
- * specified value, inclusive
223
- */
224
- lte?: number | undefined;
225
- /**
226
- * Gt specifies that this field must be greater than the specified value,
227
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
228
- * range is reversed.
229
- */
230
- gt?: number | undefined;
231
- /**
232
- * Gte specifies that this field must be greater than or equal to the
233
- * specified value, inclusive. If the value of Gte is larger than a
234
- * specified Lt or Lte, the range is reversed.
235
- */
236
- gte?: number | undefined;
237
- /**
238
- * In specifies that this field must be equal to one of the specified
239
- * values
240
- */
241
- in: number[];
242
- /**
243
- * NotIn specifies that this field cannot be equal to one of the specified
244
- * values
245
- */
246
- notIn: number[];
247
- /**
248
- * IgnoreEmpty specifies that the validation rules of this field should be
249
- * evaluated only if the field is not empty
250
- */
251
- ignoreEmpty?: boolean | undefined;
252
- }
253
- /** UInt64Rules describes the constraints applied to `uint64` values */
254
- export interface UInt64Rules {
255
- /** Const specifies that this field must be exactly the specified value */
256
- const?: number | undefined;
257
- /**
258
- * Lt specifies that this field must be less than the specified value,
259
- * exclusive
260
- */
261
- lt?: number | undefined;
262
- /**
263
- * Lte specifies that this field must be less than or equal to the
264
- * specified value, inclusive
265
- */
266
- lte?: number | undefined;
267
- /**
268
- * Gt specifies that this field must be greater than the specified value,
269
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
270
- * range is reversed.
271
- */
272
- gt?: number | undefined;
273
- /**
274
- * Gte specifies that this field must be greater than or equal to the
275
- * specified value, inclusive. If the value of Gte is larger than a
276
- * specified Lt or Lte, the range is reversed.
277
- */
278
- gte?: number | undefined;
279
- /**
280
- * In specifies that this field must be equal to one of the specified
281
- * values
282
- */
283
- in: number[];
284
- /**
285
- * NotIn specifies that this field cannot be equal to one of the specified
286
- * values
287
- */
288
- notIn: number[];
289
- /**
290
- * IgnoreEmpty specifies that the validation rules of this field should be
291
- * evaluated only if the field is not empty
292
- */
293
- ignoreEmpty?: boolean | undefined;
294
- }
295
- /** SInt32Rules describes the constraints applied to `sint32` values */
296
- export interface SInt32Rules {
297
- /** Const specifies that this field must be exactly the specified value */
298
- const?: number | undefined;
299
- /**
300
- * Lt specifies that this field must be less than the specified value,
301
- * exclusive
302
- */
303
- lt?: number | undefined;
304
- /**
305
- * Lte specifies that this field must be less than or equal to the
306
- * specified value, inclusive
307
- */
308
- lte?: number | undefined;
309
- /**
310
- * Gt specifies that this field must be greater than the specified value,
311
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
312
- * range is reversed.
313
- */
314
- gt?: number | undefined;
315
- /**
316
- * Gte specifies that this field must be greater than or equal to the
317
- * specified value, inclusive. If the value of Gte is larger than a
318
- * specified Lt or Lte, the range is reversed.
319
- */
320
- gte?: number | undefined;
321
- /**
322
- * In specifies that this field must be equal to one of the specified
323
- * values
324
- */
325
- in: number[];
326
- /**
327
- * NotIn specifies that this field cannot be equal to one of the specified
328
- * values
329
- */
330
- notIn: number[];
331
- /**
332
- * IgnoreEmpty specifies that the validation rules of this field should be
333
- * evaluated only if the field is not empty
334
- */
335
- ignoreEmpty?: boolean | undefined;
336
- }
337
- /** SInt64Rules describes the constraints applied to `sint64` values */
338
- export interface SInt64Rules {
339
- /** Const specifies that this field must be exactly the specified value */
340
- const?: number | undefined;
341
- /**
342
- * Lt specifies that this field must be less than the specified value,
343
- * exclusive
344
- */
345
- lt?: number | undefined;
346
- /**
347
- * Lte specifies that this field must be less than or equal to the
348
- * specified value, inclusive
349
- */
350
- lte?: number | undefined;
351
- /**
352
- * Gt specifies that this field must be greater than the specified value,
353
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
354
- * range is reversed.
355
- */
356
- gt?: number | undefined;
357
- /**
358
- * Gte specifies that this field must be greater than or equal to the
359
- * specified value, inclusive. If the value of Gte is larger than a
360
- * specified Lt or Lte, the range is reversed.
361
- */
362
- gte?: number | undefined;
363
- /**
364
- * In specifies that this field must be equal to one of the specified
365
- * values
366
- */
367
- in: number[];
368
- /**
369
- * NotIn specifies that this field cannot be equal to one of the specified
370
- * values
371
- */
372
- notIn: number[];
373
- /**
374
- * IgnoreEmpty specifies that the validation rules of this field should be
375
- * evaluated only if the field is not empty
376
- */
377
- ignoreEmpty?: boolean | undefined;
378
- }
379
- /** Fixed32Rules describes the constraints applied to `fixed32` values */
380
- export interface Fixed32Rules {
381
- /** Const specifies that this field must be exactly the specified value */
382
- const?: number | undefined;
383
- /**
384
- * Lt specifies that this field must be less than the specified value,
385
- * exclusive
386
- */
387
- lt?: number | undefined;
388
- /**
389
- * Lte specifies that this field must be less than or equal to the
390
- * specified value, inclusive
391
- */
392
- lte?: number | undefined;
393
- /**
394
- * Gt specifies that this field must be greater than the specified value,
395
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
396
- * range is reversed.
397
- */
398
- gt?: number | undefined;
399
- /**
400
- * Gte specifies that this field must be greater than or equal to the
401
- * specified value, inclusive. If the value of Gte is larger than a
402
- * specified Lt or Lte, the range is reversed.
403
- */
404
- gte?: number | undefined;
405
- /**
406
- * In specifies that this field must be equal to one of the specified
407
- * values
408
- */
409
- in: number[];
410
- /**
411
- * NotIn specifies that this field cannot be equal to one of the specified
412
- * values
413
- */
414
- notIn: number[];
415
- /**
416
- * IgnoreEmpty specifies that the validation rules of this field should be
417
- * evaluated only if the field is not empty
418
- */
419
- ignoreEmpty?: boolean | undefined;
420
- }
421
- /** Fixed64Rules describes the constraints applied to `fixed64` values */
422
- export interface Fixed64Rules {
423
- /** Const specifies that this field must be exactly the specified value */
424
- const?: number | undefined;
425
- /**
426
- * Lt specifies that this field must be less than the specified value,
427
- * exclusive
428
- */
429
- lt?: number | undefined;
430
- /**
431
- * Lte specifies that this field must be less than or equal to the
432
- * specified value, inclusive
433
- */
434
- lte?: number | undefined;
435
- /**
436
- * Gt specifies that this field must be greater than the specified value,
437
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
438
- * range is reversed.
439
- */
440
- gt?: number | undefined;
441
- /**
442
- * Gte specifies that this field must be greater than or equal to the
443
- * specified value, inclusive. If the value of Gte is larger than a
444
- * specified Lt or Lte, the range is reversed.
445
- */
446
- gte?: number | undefined;
447
- /**
448
- * In specifies that this field must be equal to one of the specified
449
- * values
450
- */
451
- in: number[];
452
- /**
453
- * NotIn specifies that this field cannot be equal to one of the specified
454
- * values
455
- */
456
- notIn: number[];
457
- /**
458
- * IgnoreEmpty specifies that the validation rules of this field should be
459
- * evaluated only if the field is not empty
460
- */
461
- ignoreEmpty?: boolean | undefined;
462
- }
463
- /** SFixed32Rules describes the constraints applied to `sfixed32` values */
464
- export interface SFixed32Rules {
465
- /** Const specifies that this field must be exactly the specified value */
466
- const?: number | undefined;
467
- /**
468
- * Lt specifies that this field must be less than the specified value,
469
- * exclusive
470
- */
471
- lt?: number | undefined;
472
- /**
473
- * Lte specifies that this field must be less than or equal to the
474
- * specified value, inclusive
475
- */
476
- lte?: number | undefined;
477
- /**
478
- * Gt specifies that this field must be greater than the specified value,
479
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
480
- * range is reversed.
481
- */
482
- gt?: number | undefined;
483
- /**
484
- * Gte specifies that this field must be greater than or equal to the
485
- * specified value, inclusive. If the value of Gte is larger than a
486
- * specified Lt or Lte, the range is reversed.
487
- */
488
- gte?: number | undefined;
489
- /**
490
- * In specifies that this field must be equal to one of the specified
491
- * values
492
- */
493
- in: number[];
494
- /**
495
- * NotIn specifies that this field cannot be equal to one of the specified
496
- * values
497
- */
498
- notIn: number[];
499
- /**
500
- * IgnoreEmpty specifies that the validation rules of this field should be
501
- * evaluated only if the field is not empty
502
- */
503
- ignoreEmpty?: boolean | undefined;
504
- }
505
- /** SFixed64Rules describes the constraints applied to `sfixed64` values */
506
- export interface SFixed64Rules {
507
- /** Const specifies that this field must be exactly the specified value */
508
- const?: number | undefined;
509
- /**
510
- * Lt specifies that this field must be less than the specified value,
511
- * exclusive
512
- */
513
- lt?: number | undefined;
514
- /**
515
- * Lte specifies that this field must be less than or equal to the
516
- * specified value, inclusive
517
- */
518
- lte?: number | undefined;
519
- /**
520
- * Gt specifies that this field must be greater than the specified value,
521
- * exclusive. If the value of Gt is larger than a specified Lt or Lte, the
522
- * range is reversed.
523
- */
524
- gt?: number | undefined;
525
- /**
526
- * Gte specifies that this field must be greater than or equal to the
527
- * specified value, inclusive. If the value of Gte is larger than a
528
- * specified Lt or Lte, the range is reversed.
529
- */
530
- gte?: number | undefined;
531
- /**
532
- * In specifies that this field must be equal to one of the specified
533
- * values
534
- */
535
- in: number[];
536
- /**
537
- * NotIn specifies that this field cannot be equal to one of the specified
538
- * values
539
- */
540
- notIn: number[];
541
- /**
542
- * IgnoreEmpty specifies that the validation rules of this field should be
543
- * evaluated only if the field is not empty
544
- */
545
- ignoreEmpty?: boolean | undefined;
546
- }
547
- /** BoolRules describes the constraints applied to `bool` values */
548
- export interface BoolRules {
549
- /** Const specifies that this field must be exactly the specified value */
550
- const?: boolean | undefined;
551
- }
552
- /** StringRules describe the constraints applied to `string` values */
553
- export interface StringRules {
554
- /** Const specifies that this field must be exactly the specified value */
555
- const?: string | undefined;
556
- /**
557
- * Len specifies that this field must be the specified number of
558
- * characters (Unicode code points). Note that the number of
559
- * characters may differ from the number of bytes in the string.
560
- */
561
- len?: number | undefined;
562
- /**
563
- * MinLen specifies that this field must be the specified number of
564
- * characters (Unicode code points) at a minimum. Note that the number of
565
- * characters may differ from the number of bytes in the string.
566
- */
567
- minLen?: number | undefined;
568
- /**
569
- * MaxLen specifies that this field must be the specified number of
570
- * characters (Unicode code points) at a maximum. Note that the number of
571
- * characters may differ from the number of bytes in the string.
572
- */
573
- maxLen?: number | undefined;
574
- /**
575
- * LenBytes specifies that this field must be the specified number of bytes
576
- * at a minimum
577
- */
578
- lenBytes?: number | undefined;
579
- /**
580
- * MinBytes specifies that this field must be the specified number of bytes
581
- * at a minimum
582
- */
583
- minBytes?: number | undefined;
584
- /**
585
- * MaxBytes specifies that this field must be the specified number of bytes
586
- * at a maximum
587
- */
588
- maxBytes?: number | undefined;
589
- /**
590
- * Pattern specifes that this field must match against the specified
591
- * regular expression (RE2 syntax). The included expression should elide
592
- * any delimiters.
593
- */
594
- pattern?: string | undefined;
595
- /**
596
- * Prefix specifies that this field must have the specified substring at
597
- * the beginning of the string.
598
- */
599
- prefix?: string | undefined;
600
- /**
601
- * Suffix specifies that this field must have the specified substring at
602
- * the end of the string.
603
- */
604
- suffix?: string | undefined;
605
- /**
606
- * Contains specifies that this field must have the specified substring
607
- * anywhere in the string.
608
- */
609
- contains?: string | undefined;
610
- /**
611
- * NotContains specifies that this field cannot have the specified substring
612
- * anywhere in the string.
613
- */
614
- notContains?: string | undefined;
615
- /**
616
- * In specifies that this field must be equal to one of the specified
617
- * values
618
- */
619
- in: string[];
620
- /**
621
- * NotIn specifies that this field cannot be equal to one of the specified
622
- * values
623
- */
624
- notIn: string[];
625
- /**
626
- * Email specifies that the field must be a valid email address as
627
- * defined by RFC 5322
628
- */
629
- email?: boolean | undefined;
630
- /**
631
- * Hostname specifies that the field must be a valid hostname as
632
- * defined by RFC 1034. This constraint does not support
633
- * internationalized domain names (IDNs).
634
- */
635
- hostname?: boolean | undefined;
636
- /**
637
- * Ip specifies that the field must be a valid IP (v4 or v6) address.
638
- * Valid IPv6 addresses should not include surrounding square brackets.
639
- */
640
- ip?: boolean | undefined;
641
- /** Ipv4 specifies that the field must be a valid IPv4 address. */
642
- ipv4?: boolean | undefined;
643
- /**
644
- * Ipv6 specifies that the field must be a valid IPv6 address. Valid
645
- * IPv6 addresses should not include surrounding square brackets.
646
- */
647
- ipv6?: boolean | undefined;
648
- /**
649
- * Uri specifies that the field must be a valid, absolute URI as defined
650
- * by RFC 3986
651
- */
652
- uri?: boolean | undefined;
653
- /**
654
- * UriRef specifies that the field must be a valid URI as defined by RFC
655
- * 3986 and may be relative or absolute.
656
- */
657
- uriRef?: boolean | undefined;
658
- /**
659
- * Address specifies that the field must be either a valid hostname as
660
- * defined by RFC 1034 (which does not support internationalized domain
661
- * names or IDNs), or it can be a valid IP (v4 or v6).
662
- */
663
- address?: boolean | undefined;
664
- /**
665
- * Uuid specifies that the field must be a valid UUID as defined by
666
- * RFC 4122
667
- */
668
- uuid?: boolean | undefined;
669
- /** WellKnownRegex specifies a common well known pattern defined as a regex. */
670
- wellKnownRegex?: KnownRegex | undefined;
671
- /**
672
- * This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable
673
- * strict header validation.
674
- * By default, this is true, and HTTP header validations are RFC-compliant.
675
- * Setting to false will enable a looser validations that only disallows
676
- * \r\n\0 characters, which can be used to bypass header matching rules.
677
- */
678
- strict?: boolean | undefined;
679
- /**
680
- * IgnoreEmpty specifies that the validation rules of this field should be
681
- * evaluated only if the field is not empty
682
- */
683
- ignoreEmpty?: boolean | undefined;
684
- }
685
- /** BytesRules describe the constraints applied to `bytes` values */
686
- export interface BytesRules {
687
- /** Const specifies that this field must be exactly the specified value */
688
- const?: Uint8Array | undefined;
689
- /** Len specifies that this field must be the specified number of bytes */
690
- len?: number | undefined;
691
- /**
692
- * MinLen specifies that this field must be the specified number of bytes
693
- * at a minimum
694
- */
695
- minLen?: number | undefined;
696
- /**
697
- * MaxLen specifies that this field must be the specified number of bytes
698
- * at a maximum
699
- */
700
- maxLen?: number | undefined;
701
- /**
702
- * Pattern specifes that this field must match against the specified
703
- * regular expression (RE2 syntax). The included expression should elide
704
- * any delimiters.
705
- */
706
- pattern?: string | undefined;
707
- /**
708
- * Prefix specifies that this field must have the specified bytes at the
709
- * beginning of the string.
710
- */
711
- prefix?: Uint8Array | undefined;
712
- /**
713
- * Suffix specifies that this field must have the specified bytes at the
714
- * end of the string.
715
- */
716
- suffix?: Uint8Array | undefined;
717
- /**
718
- * Contains specifies that this field must have the specified bytes
719
- * anywhere in the string.
720
- */
721
- contains?: Uint8Array | undefined;
722
- /**
723
- * In specifies that this field must be equal to one of the specified
724
- * values
725
- */
726
- in: Uint8Array[];
727
- /**
728
- * NotIn specifies that this field cannot be equal to one of the specified
729
- * values
730
- */
731
- notIn: Uint8Array[];
732
- /**
733
- * Ip specifies that the field must be a valid IP (v4 or v6) address in
734
- * byte format
735
- */
736
- ip?: boolean | undefined;
737
- /**
738
- * Ipv4 specifies that the field must be a valid IPv4 address in byte
739
- * format
740
- */
741
- ipv4?: boolean | undefined;
742
- /**
743
- * Ipv6 specifies that the field must be a valid IPv6 address in byte
744
- * format
745
- */
746
- ipv6?: boolean | undefined;
747
- /**
748
- * IgnoreEmpty specifies that the validation rules of this field should be
749
- * evaluated only if the field is not empty
750
- */
751
- ignoreEmpty?: boolean | undefined;
752
- }
753
- /** EnumRules describe the constraints applied to enum values */
754
- export interface EnumRules {
755
- /** Const specifies that this field must be exactly the specified value */
756
- const?: number | undefined;
757
- /**
758
- * DefinedOnly specifies that this field must be only one of the defined
759
- * values for this enum, failing on any undefined value.
760
- */
761
- definedOnly?: boolean | undefined;
762
- /**
763
- * In specifies that this field must be equal to one of the specified
764
- * values
765
- */
766
- in: number[];
767
- /**
768
- * NotIn specifies that this field cannot be equal to one of the specified
769
- * values
770
- */
771
- notIn: number[];
772
- }
773
- /**
774
- * MessageRules describe the constraints applied to embedded message values.
775
- * For message-type fields, validation is performed recursively.
776
- */
777
- export interface MessageRules {
778
- /**
779
- * Skip specifies that the validation rules of this field should not be
780
- * evaluated
781
- */
782
- skip?: boolean | undefined;
783
- /** Required specifies that this field must be set */
784
- required?: boolean | undefined;
785
- }
786
- /** RepeatedRules describe the constraints applied to `repeated` values */
787
- export interface RepeatedRules {
788
- /**
789
- * MinItems specifies that this field must have the specified number of
790
- * items at a minimum
791
- */
792
- minItems?: number | undefined;
793
- /**
794
- * MaxItems specifies that this field must have the specified number of
795
- * items at a maximum
796
- */
797
- maxItems?: number | undefined;
798
- /**
799
- * Unique specifies that all elements in this field must be unique. This
800
- * contraint is only applicable to scalar and enum types (messages are not
801
- * supported).
802
- */
803
- unique?: boolean | undefined;
804
- /**
805
- * Items specifies the contraints to be applied to each item in the field.
806
- * Repeated message fields will still execute validation against each item
807
- * unless skip is specified here.
808
- */
809
- items?: FieldRules | undefined;
810
- /**
811
- * IgnoreEmpty specifies that the validation rules of this field should be
812
- * evaluated only if the field is not empty
813
- */
814
- ignoreEmpty?: boolean | undefined;
815
- }
816
- /** MapRules describe the constraints applied to `map` values */
817
- export interface MapRules {
818
- /**
819
- * MinPairs specifies that this field must have the specified number of
820
- * KVs at a minimum
821
- */
822
- minPairs?: number | undefined;
823
- /**
824
- * MaxPairs specifies that this field must have the specified number of
825
- * KVs at a maximum
826
- */
827
- maxPairs?: number | undefined;
828
- /**
829
- * NoSparse specifies values in this field cannot be unset. This only
830
- * applies to map's with message value types.
831
- */
832
- noSparse?: boolean | undefined;
833
- /** Keys specifies the constraints to be applied to each key in the field. */
834
- keys?: FieldRules | undefined;
835
- /**
836
- * Values specifies the constraints to be applied to the value of each key
837
- * in the field. Message values will still have their validations evaluated
838
- * unless skip is specified here.
839
- */
840
- values?: FieldRules | undefined;
841
- /**
842
- * IgnoreEmpty specifies that the validation rules of this field should be
843
- * evaluated only if the field is not empty
844
- */
845
- ignoreEmpty?: boolean | undefined;
846
- }
847
- /**
848
- * AnyRules describe constraints applied exclusively to the
849
- * `google.protobuf.Any` well-known type
850
- */
851
- export interface AnyRules {
852
- /** Required specifies that this field must be set */
853
- required?: boolean | undefined;
854
- /**
855
- * In specifies that this field's `type_url` must be equal to one of the
856
- * specified values.
857
- */
858
- in: string[];
859
- /**
860
- * NotIn specifies that this field's `type_url` must not be equal to any of
861
- * the specified values.
862
- */
863
- notIn: string[];
864
- }
865
- /**
866
- * DurationRules describe the constraints applied exclusively to the
867
- * `google.protobuf.Duration` well-known type
868
- */
869
- export interface DurationRules {
870
- /** Required specifies that this field must be set */
871
- required?: boolean | undefined;
872
- /** Const specifies that this field must be exactly the specified value */
873
- const?: Duration | undefined;
874
- /**
875
- * Lt specifies that this field must be less than the specified value,
876
- * exclusive
877
- */
878
- lt?: Duration | undefined;
879
- /**
880
- * Lt specifies that this field must be less than the specified value,
881
- * inclusive
882
- */
883
- lte?: Duration | undefined;
884
- /**
885
- * Gt specifies that this field must be greater than the specified value,
886
- * exclusive
887
- */
888
- gt?: Duration | undefined;
889
- /**
890
- * Gte specifies that this field must be greater than the specified value,
891
- * inclusive
892
- */
893
- gte?: Duration | undefined;
894
- /**
895
- * In specifies that this field must be equal to one of the specified
896
- * values
897
- */
898
- in: Duration[];
899
- /**
900
- * NotIn specifies that this field cannot be equal to one of the specified
901
- * values
902
- */
903
- notIn: Duration[];
904
- }
905
- /**
906
- * TimestampRules describe the constraints applied exclusively to the
907
- * `google.protobuf.Timestamp` well-known type
908
- */
909
- export interface TimestampRules {
910
- /** Required specifies that this field must be set */
911
- required?: boolean | undefined;
912
- /** Const specifies that this field must be exactly the specified value */
913
- const?: Date | undefined;
914
- /**
915
- * Lt specifies that this field must be less than the specified value,
916
- * exclusive
917
- */
918
- lt?: Date | undefined;
919
- /**
920
- * Lte specifies that this field must be less than the specified value,
921
- * inclusive
922
- */
923
- lte?: Date | undefined;
924
- /**
925
- * Gt specifies that this field must be greater than the specified value,
926
- * exclusive
927
- */
928
- gt?: Date | undefined;
929
- /**
930
- * Gte specifies that this field must be greater than the specified value,
931
- * inclusive
932
- */
933
- gte?: Date | undefined;
934
- /**
935
- * LtNow specifies that this must be less than the current time. LtNow
936
- * can only be used with the Within rule.
937
- */
938
- ltNow?: boolean | undefined;
939
- /**
940
- * GtNow specifies that this must be greater than the current time. GtNow
941
- * can only be used with the Within rule.
942
- */
943
- gtNow?: boolean | undefined;
944
- /**
945
- * Within specifies that this field must be within this duration of the
946
- * current time. This constraint can be used alone or with the LtNow and
947
- * GtNow rules.
948
- */
949
- within?: Duration | undefined;
950
- }