@alis-build/alis-open-options-v1 1.21.0 → 1.22.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.
@@ -1,7 +1,37 @@
1
- // @generated by protoc-gen-es v2.13.0 with parameter "target=js+dts,import_extension=js,json_types=true"
1
+ // @generated by protoc-gen-es v2.16.0 with parameter "target=js+dts,import_extension=js,json_types=true"
2
2
  // @generated from file alis/open/options/v1/options.proto (package alis.open.options.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
+ // Custom options that control how alis code generators treat a proto file,
6
+ // currently JSON Schema (Draft 2020-12) generation by
7
+ // `protoc-gen-go-jsonschema`.
8
+ //
9
+ // Three extensions, each at field number 1001 of its descriptor options
10
+ // message, carry the options:
11
+ //
12
+ // - `(alis.open.options.v1.file)` (`FileOptions`): turns schema generation on
13
+ // for every message in the file.
14
+ // - `(alis.open.options.v1.message)` (`MessageOptions`): overrides the file
15
+ // default for one message and declares schema-level oneof groups.
16
+ // - `(alis.open.options.v1.field)` (`FieldOptions`): adds JSON Schema keywords
17
+ // to a field, such as `title`, `pattern`, `format`, numeric and length
18
+ // bounds, `enum`, `default` and `examples`.
19
+ //
20
+ // ```proto
21
+ // import "alis/open/options/v1/options.proto";
22
+ //
23
+ // option (alis.open.options.v1.file).json_schema.generate = true;
24
+ //
25
+ // message Contact {
26
+ // string email = 1 [(alis.open.options.v1.field).json_schema = {
27
+ // format: "email"
28
+ // }];
29
+ // }
30
+ // ```
31
+ //
32
+ // A message referenced by a generating message is always generated, even if
33
+ // it opts out, so that `$ref` pointers resolve.
34
+
5
35
  import type { GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
6
36
  import type { Message } from "@bufbuild/protobuf";
7
37
  import type { FieldOptions as FieldOptions$1, FileOptions as FileOptions$1, MessageOptions as MessageOptions$1 } from "@bufbuild/protobuf/wkt";
@@ -12,20 +42,30 @@ import type { FieldOptions as FieldOptions$1, FileOptions as FileOptions$1, Mess
12
42
  export declare const file_alis_open_options_v1_options: GenFile;
13
43
 
14
44
  /**
45
+ * FileOptions carries file-level options consumed by alis code generators.
46
+ *
15
47
  * @generated from message alis.open.options.v1.FileOptions
16
48
  */
17
49
  export declare type FileOptions = Message<"alis.open.options.v1.FileOptions"> & {
18
50
  /**
51
+ * Options controlling JSON Schema (Draft 2020-12) generation for this
52
+ * file, consumed by protoc-gen-go-jsonschema.
53
+ *
19
54
  * @generated from field: alis.open.options.v1.FileOptions.JsonSchema json_schema = 1;
20
55
  */
21
56
  jsonSchema?: FileOptions_JsonSchema | undefined;
22
57
  };
23
58
 
24
59
  /**
60
+ * FileOptions carries file-level options consumed by alis code generators.
61
+ *
25
62
  * @generated from message alis.open.options.v1.FileOptions
26
63
  */
27
64
  export declare type FileOptionsJson = {
28
65
  /**
66
+ * Options controlling JSON Schema (Draft 2020-12) generation for this
67
+ * file, consumed by protoc-gen-go-jsonschema.
68
+ *
29
69
  * @generated from field: alis.open.options.v1.FileOptions.JsonSchema json_schema = 1;
30
70
  */
31
71
  jsonSchema?: FileOptions_JsonSchemaJson;
@@ -38,20 +78,34 @@ export declare type FileOptionsJson = {
38
78
  export declare const FileOptionsSchema: GenMessage<FileOptions, {jsonType: FileOptionsJson}>;
39
79
 
40
80
  /**
81
+ * JsonSchema holds the file-level JSON Schema generation options.
82
+ *
41
83
  * @generated from message alis.open.options.v1.FileOptions.JsonSchema
42
84
  */
43
85
  export declare type FileOptions_JsonSchema = Message<"alis.open.options.v1.FileOptions.JsonSchema"> & {
44
86
  /**
87
+ * If true, schemas are generated for every message in this file unless a
88
+ * message explicitly sets its own `generate = false`. Messages referenced
89
+ * by a generating message (field dependencies and nested messages) are
90
+ * always generated regardless, so that `$ref` pointers resolve.
91
+ *
45
92
  * @generated from field: bool generate = 1;
46
93
  */
47
94
  generate: boolean;
48
95
  };
49
96
 
50
97
  /**
98
+ * JsonSchema holds the file-level JSON Schema generation options.
99
+ *
51
100
  * @generated from message alis.open.options.v1.FileOptions.JsonSchema
52
101
  */
53
102
  export declare type FileOptions_JsonSchemaJson = {
54
103
  /**
104
+ * If true, schemas are generated for every message in this file unless a
105
+ * message explicitly sets its own `generate = false`. Messages referenced
106
+ * by a generating message (field dependencies and nested messages) are
107
+ * always generated regardless, so that `$ref` pointers resolve.
108
+ *
55
109
  * @generated from field: bool generate = 1;
56
110
  */
57
111
  generate?: boolean;
@@ -64,20 +118,32 @@ export declare type FileOptions_JsonSchemaJson = {
64
118
  export declare const FileOptions_JsonSchemaSchema: GenMessage<FileOptions_JsonSchema, {jsonType: FileOptions_JsonSchemaJson}>;
65
119
 
66
120
  /**
121
+ * MessageOptions carries message-level options consumed by alis code
122
+ * generators.
123
+ *
67
124
  * @generated from message alis.open.options.v1.MessageOptions
68
125
  */
69
126
  export declare type MessageOptions = Message<"alis.open.options.v1.MessageOptions"> & {
70
127
  /**
128
+ * Options controlling JSON Schema (Draft 2020-12) generation for this
129
+ * message, consumed by protoc-gen-go-jsonschema.
130
+ *
71
131
  * @generated from field: alis.open.options.v1.MessageOptions.JsonSchema json_schema = 1;
72
132
  */
73
133
  jsonSchema?: MessageOptions_JsonSchema | undefined;
74
134
  };
75
135
 
76
136
  /**
137
+ * MessageOptions carries message-level options consumed by alis code
138
+ * generators.
139
+ *
77
140
  * @generated from message alis.open.options.v1.MessageOptions
78
141
  */
79
142
  export declare type MessageOptionsJson = {
80
143
  /**
144
+ * Options controlling JSON Schema (Draft 2020-12) generation for this
145
+ * message, consumed by protoc-gen-go-jsonschema.
146
+ *
81
147
  * @generated from field: alis.open.options.v1.MessageOptions.JsonSchema json_schema = 1;
82
148
  */
83
149
  jsonSchema?: MessageOptions_JsonSchemaJson;
@@ -90,30 +156,84 @@ export declare type MessageOptionsJson = {
90
156
  export declare const MessageOptionsSchema: GenMessage<MessageOptions, {jsonType: MessageOptionsJson}>;
91
157
 
92
158
  /**
159
+ * JsonSchema holds the message-level JSON Schema generation options.
160
+ *
93
161
  * @generated from message alis.open.options.v1.MessageOptions.JsonSchema
94
162
  */
95
163
  export declare type MessageOptions_JsonSchema = Message<"alis.open.options.v1.MessageOptions.JsonSchema"> & {
96
164
  /**
165
+ * Explicitly enables or disables schema generation for this message,
166
+ * overriding the file-level default. When unset, the file-level default
167
+ * applies — so setting other options here (such as `oneof`) does not
168
+ * change whether the message generates. An explicit false is still
169
+ * overridden when the message is referenced by a generating message (as a
170
+ * field dependency or nested message): generation is forced so that
171
+ * `$ref` pointers resolve. `optional` is required for that distinction —
172
+ * without presence, an explicit false is indistinguishable from unset.
173
+ *
97
174
  * @generated from field: optional bool generate = 1;
98
175
  */
99
176
  generate?: boolean | undefined;
100
177
 
101
178
  /**
179
+ * Declares oneof groups over this message's fields for schema purposes.
180
+ *
181
+ * Each entry names a set of fields (by proto field name) that are
182
+ * mutually exclusive. If `required` is true, exactly one of the listed
183
+ * fields must be set.
184
+ *
185
+ * The referenced names may be members of a proto `oneof` block, or
186
+ * ordinary singular fields treated as a virtual oneof (the same pattern
187
+ * as `buf.validate.message.oneof`). Repeated and map fields are not
188
+ * permitted as members.
189
+ *
190
+ * A group may deliberately cover only a subset of a proto `oneof`'s
191
+ * members: the schema then narrows the contract (like enum_int narrows a
192
+ * proto enum), and with `required: true` a value that sets an uncovered
193
+ * variant fails schema validation even though it is a legal proto value.
194
+ *
102
195
  * @generated from field: repeated alis.open.options.v1.MessageOptions.JsonSchema.Oneof oneof = 2;
103
196
  */
104
197
  oneof: MessageOptions_JsonSchema_Oneof[];
105
198
  };
106
199
 
107
200
  /**
201
+ * JsonSchema holds the message-level JSON Schema generation options.
202
+ *
108
203
  * @generated from message alis.open.options.v1.MessageOptions.JsonSchema
109
204
  */
110
205
  export declare type MessageOptions_JsonSchemaJson = {
111
206
  /**
207
+ * Explicitly enables or disables schema generation for this message,
208
+ * overriding the file-level default. When unset, the file-level default
209
+ * applies — so setting other options here (such as `oneof`) does not
210
+ * change whether the message generates. An explicit false is still
211
+ * overridden when the message is referenced by a generating message (as a
212
+ * field dependency or nested message): generation is forced so that
213
+ * `$ref` pointers resolve. `optional` is required for that distinction —
214
+ * without presence, an explicit false is indistinguishable from unset.
215
+ *
112
216
  * @generated from field: optional bool generate = 1;
113
217
  */
114
218
  generate?: boolean;
115
219
 
116
220
  /**
221
+ * Declares oneof groups over this message's fields for schema purposes.
222
+ *
223
+ * Each entry names a set of fields (by proto field name) that are
224
+ * mutually exclusive. If `required` is true, exactly one of the listed
225
+ * fields must be set.
226
+ *
227
+ * The referenced names may be members of a proto `oneof` block, or
228
+ * ordinary singular fields treated as a virtual oneof (the same pattern
229
+ * as `buf.validate.message.oneof`). Repeated and map fields are not
230
+ * permitted as members.
231
+ *
232
+ * A group may deliberately cover only a subset of a proto `oneof`'s
233
+ * members: the schema then narrows the contract (like enum_int narrows a
234
+ * proto enum), and with `required: true` a value that sets an uncovered
235
+ * variant fails schema validation even though it is a legal proto value.
236
+ *
117
237
  * @generated from field: repeated alis.open.options.v1.MessageOptions.JsonSchema.Oneof oneof = 2;
118
238
  */
119
239
  oneof?: MessageOptions_JsonSchema_OneofJson[];
@@ -126,30 +246,50 @@ export declare type MessageOptions_JsonSchemaJson = {
126
246
  export declare const MessageOptions_JsonSchemaSchema: GenMessage<MessageOptions_JsonSchema, {jsonType: MessageOptions_JsonSchemaJson}>;
127
247
 
128
248
  /**
249
+ * Oneof declares a mutually-exclusive group of fields on the enclosing
250
+ * message.
251
+ *
129
252
  * @generated from message alis.open.options.v1.MessageOptions.JsonSchema.Oneof
130
253
  */
131
254
  export declare type MessageOptions_JsonSchema_Oneof = Message<"alis.open.options.v1.MessageOptions.JsonSchema.Oneof"> & {
132
255
  /**
256
+ * Proto field names that participate in this oneof group. Must name
257
+ * fields defined on the enclosing message; must be at least two names;
258
+ * must not include repeated or map fields.
259
+ *
133
260
  * @generated from field: repeated string fields = 1;
134
261
  */
135
262
  fields: string[];
136
263
 
137
264
  /**
265
+ * If true, exactly one of `fields` must be set. If false or unset,
266
+ * at most one may be set.
267
+ *
138
268
  * @generated from field: optional bool required = 2;
139
269
  */
140
270
  required?: boolean | undefined;
141
271
  };
142
272
 
143
273
  /**
274
+ * Oneof declares a mutually-exclusive group of fields on the enclosing
275
+ * message.
276
+ *
144
277
  * @generated from message alis.open.options.v1.MessageOptions.JsonSchema.Oneof
145
278
  */
146
279
  export declare type MessageOptions_JsonSchema_OneofJson = {
147
280
  /**
281
+ * Proto field names that participate in this oneof group. Must name
282
+ * fields defined on the enclosing message; must be at least two names;
283
+ * must not include repeated or map fields.
284
+ *
148
285
  * @generated from field: repeated string fields = 1;
149
286
  */
150
287
  fields?: string[];
151
288
 
152
289
  /**
290
+ * If true, exactly one of `fields` must be set. If false or unset,
291
+ * at most one may be set.
292
+ *
153
293
  * @generated from field: optional bool required = 2;
154
294
  */
155
295
  required?: boolean;
@@ -162,20 +302,30 @@ export declare type MessageOptions_JsonSchema_OneofJson = {
162
302
  export declare const MessageOptions_JsonSchema_OneofSchema: GenMessage<MessageOptions_JsonSchema_Oneof, {jsonType: MessageOptions_JsonSchema_OneofJson}>;
163
303
 
164
304
  /**
305
+ * FieldOptions carries field-level options consumed by alis code generators.
306
+ *
165
307
  * @generated from message alis.open.options.v1.FieldOptions
166
308
  */
167
309
  export declare type FieldOptions = Message<"alis.open.options.v1.FieldOptions"> & {
168
310
  /**
311
+ * Options controlling how this field appears in generated JSON Schemas,
312
+ * consumed by protoc-gen-go-jsonschema.
313
+ *
169
314
  * @generated from field: alis.open.options.v1.FieldOptions.JsonSchema json_schema = 1;
170
315
  */
171
316
  jsonSchema?: FieldOptions_JsonSchema | undefined;
172
317
  };
173
318
 
174
319
  /**
320
+ * FieldOptions carries field-level options consumed by alis code generators.
321
+ *
175
322
  * @generated from message alis.open.options.v1.FieldOptions
176
323
  */
177
324
  export declare type FieldOptionsJson = {
178
325
  /**
326
+ * Options controlling how this field appears in generated JSON Schemas,
327
+ * consumed by protoc-gen-go-jsonschema.
328
+ *
179
329
  * @generated from field: alis.open.options.v1.FieldOptions.JsonSchema json_schema = 1;
180
330
  */
181
331
  jsonSchema?: FieldOptions_JsonSchemaJson;
@@ -188,330 +338,610 @@ export declare type FieldOptionsJson = {
188
338
  export declare const FieldOptionsSchema: GenMessage<FieldOptions, {jsonType: FieldOptionsJson}>;
189
339
 
190
340
  /**
341
+ * JsonSchema holds the field-level JSON Schema generation options. Unless a
342
+ * field's comment says otherwise, an option applies to the field's own
343
+ * schema for singular fields, and to each element or value for repeated and
344
+ * map fields; on message-typed fields, options are emitted as sibling
345
+ * keywords next to the field's `$ref` (JSON Schema Draft 2020-12
346
+ * semantics).
347
+ *
191
348
  * @generated from message alis.open.options.v1.FieldOptions.JsonSchema
192
349
  */
193
350
  export declare type FieldOptions_JsonSchema = Message<"alis.open.options.v1.FieldOptions.JsonSchema"> & {
194
351
  /**
352
+ * Short human-readable title for the field. Emitted as JSON Schema
353
+ * `title`, overriding the title derived from the first paragraph of the
354
+ * field's leading comment. Applies to all field types.
355
+ *
195
356
  * @generated from field: optional string title = 1;
196
357
  */
197
358
  title?: string | undefined;
198
359
 
199
360
  /**
361
+ * Human-readable description of the field. Emitted as JSON Schema
362
+ * `description`, overriding the description derived from the field's
363
+ * leading comment. Applies to all field types.
364
+ *
200
365
  * @generated from field: optional string description = 2;
201
366
  */
202
367
  description?: string | undefined;
203
368
 
204
369
  /**
370
+ * Excludes the field from the generated schema entirely: no property is
371
+ * emitted and the field never appears in `required`. Applies to all
372
+ * field types, including oneof members.
373
+ *
205
374
  * @generated from field: optional bool ignore = 3;
206
375
  */
207
376
  ignore?: boolean | undefined;
208
377
 
209
378
  /**
379
+ * Regular expression the value must match, e.g. "^[A-Z]+$". Emitted as
380
+ * JSON Schema `pattern`. Applies to string values; on repeated and map
381
+ * fields it applies to each element or value.
382
+ *
210
383
  * @generated from field: optional string pattern = 4;
211
384
  */
212
385
  pattern?: string | undefined;
213
386
 
214
387
  /**
388
+ * Semantic format annotation such as "email", "uuid", "ipv4", "uri", or
389
+ * "date-time". Emitted as JSON Schema `format`. Most validators treat
390
+ * this as an annotation, not an assertion. Applies to string values; on
391
+ * repeated and map fields it applies to each element or value.
392
+ *
215
393
  * @generated from field: optional string format = 5;
216
394
  */
217
395
  format?: string | undefined;
218
396
 
219
397
  /**
398
+ * Encoding of binary content stored in a string, e.g. "base64". Emitted
399
+ * as JSON Schema `contentEncoding`. bytes fields default to "base64";
400
+ * setting this overrides that default.
401
+ *
220
402
  * @generated from field: optional string content_encoding = 6;
221
403
  */
222
404
  contentEncoding?: string | undefined;
223
405
 
224
406
  /**
407
+ * Media type of the field's (decoded) content, e.g. "application/json".
408
+ * Emitted as JSON Schema `contentMediaType`.
409
+ *
225
410
  * @generated from field: optional string content_media_type = 7;
226
411
  */
227
412
  contentMediaType?: string | undefined;
228
413
 
229
414
  /**
415
+ * Minimum string length in characters. Emitted as JSON Schema
416
+ * `minLength`. Applies to string values; on repeated and map fields it
417
+ * applies to each element or value.
418
+ *
230
419
  * @generated from field: optional int64 min_length = 8;
231
420
  */
232
421
  minLength?: bigint | undefined;
233
422
 
234
423
  /**
424
+ * Maximum string length in characters. Emitted as JSON Schema
425
+ * `maxLength`. Applies to string values; on repeated and map fields it
426
+ * applies to each element or value.
427
+ *
235
428
  * @generated from field: optional int64 max_length = 9;
236
429
  */
237
430
  maxLength?: bigint | undefined;
238
431
 
239
432
  /**
433
+ * Inclusive lower bound for numeric values, unless `exclusive_minimum`
434
+ * is set. Emitted as JSON Schema `minimum`. Applies to numeric values;
435
+ * on repeated and map fields it applies to each element or value.
436
+ *
240
437
  * @generated from field: optional double minimum = 10;
241
438
  */
242
439
  minimum?: number | undefined;
243
440
 
244
441
  /**
442
+ * Inclusive upper bound for numeric values, unless `exclusive_maximum`
443
+ * is set. Emitted as JSON Schema `maximum`. Applies to numeric values;
444
+ * on repeated and map fields it applies to each element or value.
445
+ *
245
446
  * @generated from field: optional double maximum = 11;
246
447
  */
247
448
  maximum?: number | undefined;
248
449
 
249
450
  /**
451
+ * If true, the `minimum` value is emitted as JSON Schema
452
+ * `exclusiveMinimum` instead of `minimum` (the bound itself is not an
453
+ * allowed value). Requires `minimum` to be set.
454
+ *
250
455
  * @generated from field: optional bool exclusive_minimum = 12;
251
456
  */
252
457
  exclusiveMinimum?: boolean | undefined;
253
458
 
254
459
  /**
460
+ * If true, the `maximum` value is emitted as JSON Schema
461
+ * `exclusiveMaximum` instead of `maximum` (the bound itself is not an
462
+ * allowed value). Requires `maximum` to be set.
463
+ *
255
464
  * @generated from field: optional bool exclusive_maximum = 13;
256
465
  */
257
466
  exclusiveMaximum?: boolean | undefined;
258
467
 
259
468
  /**
469
+ * Minimum number of elements in a repeated field. Emitted as JSON Schema
470
+ * `minItems` on the array itself.
471
+ *
260
472
  * @generated from field: optional int64 min_items = 14;
261
473
  */
262
474
  minItems?: bigint | undefined;
263
475
 
264
476
  /**
477
+ * Maximum number of elements in a repeated field. Emitted as JSON Schema
478
+ * `maxItems` on the array itself.
479
+ *
265
480
  * @generated from field: optional int64 max_items = 15;
266
481
  */
267
482
  maxItems?: bigint | undefined;
268
483
 
269
484
  /**
485
+ * If true, all elements of a repeated field must be distinct. Emitted as
486
+ * JSON Schema `uniqueItems` on the array itself.
487
+ *
270
488
  * @generated from field: optional bool unique_items = 16;
271
489
  */
272
490
  uniqueItems?: boolean | undefined;
273
491
 
274
492
  /**
493
+ * Minimum number of entries in a map field. Emitted as JSON Schema
494
+ * `minProperties` on the object itself.
495
+ *
275
496
  * @generated from field: optional int64 min_properties = 17;
276
497
  */
277
498
  minProperties?: bigint | undefined;
278
499
 
279
500
  /**
501
+ * Maximum number of entries in a map field. Emitted as JSON Schema
502
+ * `maxProperties` on the object itself.
503
+ *
280
504
  * @generated from field: optional int64 max_properties = 18;
281
505
  */
282
506
  maxProperties?: bigint | undefined;
283
507
 
284
508
  /**
509
+ * Restricts a string or bytes field's value to a fixed set. Emitted as
510
+ * JSON Schema `enum`. On repeated and map fields the set applies to each
511
+ * element or value. Setting more than one enum_* variant, or using this
512
+ * variant on a field that is not string or bytes, is an error at
513
+ * generation time.
514
+ *
285
515
  * @generated from field: repeated string enum_string = 19;
286
516
  */
287
517
  enumString: string[];
288
518
 
289
519
  /**
520
+ * Restricts an integer field's value to a fixed set. Emitted as JSON
521
+ * Schema `enum`. Applies to integer fields (int32/int64/uint*\/sint*\/
522
+ * fixed*) and proto enum fields, where the values must be a subset of the
523
+ * enum's declared numeric values. On repeated and map fields the set
524
+ * applies to each element or value. Setting more than one enum_* variant,
525
+ * or using this variant on a non-integer field, is an error at generation
526
+ * time. Cannot express uint64 values above 2^63-1.
527
+ *
290
528
  * @generated from field: repeated int64 enum_int = 20;
291
529
  */
292
530
  enumInt: bigint[];
293
531
 
294
532
  /**
533
+ * Restricts a float or double field's value to a fixed set. Emitted as
534
+ * JSON Schema `enum`. On repeated and map fields the set applies to each
535
+ * element or value. Setting more than one enum_* variant, or using this
536
+ * variant on a non-numeric field, is an error at generation time.
537
+ *
295
538
  * @generated from field: repeated double enum_number = 21;
296
539
  */
297
540
  enumNumber: number[];
298
541
 
299
542
  /**
543
+ * Marks the field as deprecated. Emitted as JSON Schema `deprecated`.
544
+ * Applies to the field's schema root: on repeated and map fields it marks
545
+ * the array or object itself, not its elements.
546
+ *
300
547
  * @generated from field: optional bool deprecated = 22;
301
548
  */
302
549
  deprecated?: boolean | undefined;
303
550
 
304
551
  /**
552
+ * Marks the field as read-only. Emitted as JSON Schema `readOnly`.
553
+ * Applies to the field's schema root, like `deprecated`.
554
+ *
305
555
  * @generated from field: optional bool read_only = 23;
306
556
  */
307
557
  readOnly?: boolean | undefined;
308
558
 
309
559
  /**
560
+ * Marks the field as write-only. Emitted as JSON Schema `writeOnly`.
561
+ * Applies to the field's schema root, like `deprecated`.
562
+ *
310
563
  * @generated from field: optional bool write_only = 24;
311
564
  */
312
565
  writeOnly?: boolean | undefined;
313
566
 
314
567
  /**
568
+ * Requires numeric values to be a multiple of this number. Emitted as
569
+ * JSON Schema `multipleOf`. Numeric fields only; must be greater than 0.
570
+ * On repeated and map fields it applies to each element or value.
571
+ *
315
572
  * @generated from field: optional double multiple_of = 25;
316
573
  */
317
574
  multipleOf?: number | undefined;
318
575
 
319
576
  /**
577
+ * Default value for a string or bytes field. Emitted as JSON Schema
578
+ * `default`. Only valid on singular fields of those types: using it on a
579
+ * repeated, map, message-typed, or non-string field, or setting more than
580
+ * one default_* variant, is an error at generation time.
581
+ *
320
582
  * @generated from field: optional string default_string = 26;
321
583
  */
322
584
  defaultString?: string | undefined;
323
585
 
324
586
  /**
587
+ * Default value for an integer or proto enum field. Emitted as JSON
588
+ * Schema `default`. Only valid on singular fields of those types: using
589
+ * it on a repeated, map, message-typed, or non-integer field, or setting
590
+ * more than one default_* variant, is an error at generation time.
591
+ *
325
592
  * @generated from field: optional int64 default_int = 27;
326
593
  */
327
594
  defaultInt?: bigint | undefined;
328
595
 
329
596
  /**
597
+ * Default value for a float or double field. Emitted as JSON Schema
598
+ * `default`. Only valid on singular fields of those types: using it on a
599
+ * repeated, map, message-typed, or non-numeric field, or setting more
600
+ * than one default_* variant, is an error at generation time.
601
+ *
330
602
  * @generated from field: optional double default_number = 28;
331
603
  */
332
604
  defaultNumber?: number | undefined;
333
605
 
334
606
  /**
607
+ * Default value for a bool field. Emitted as JSON Schema `default`. Only
608
+ * valid on singular bool fields: using it on a repeated, map,
609
+ * message-typed, or non-bool field, or setting more than one default_*
610
+ * variant, is an error at generation time.
611
+ *
335
612
  * @generated from field: optional bool default_bool = 29;
336
613
  */
337
614
  defaultBool?: boolean | undefined;
338
615
 
339
616
  /**
617
+ * Example values for a string or bytes field. Emitted as JSON Schema
618
+ * `examples`. Only valid on singular fields of those types, same rules as
619
+ * default_string.
620
+ *
340
621
  * @generated from field: repeated string examples_string = 30;
341
622
  */
342
623
  examplesString: string[];
343
624
 
344
625
  /**
626
+ * Example values for an integer or proto enum field. Emitted as JSON
627
+ * Schema `examples`. Only valid on singular fields of those types, same
628
+ * rules as default_int.
629
+ *
345
630
  * @generated from field: repeated int64 examples_int = 31;
346
631
  */
347
632
  examplesInt: bigint[];
348
633
 
349
634
  /**
635
+ * Example values for a float or double field. Emitted as JSON Schema
636
+ * `examples`. Only valid on singular fields of those types, same rules as
637
+ * default_number. There is deliberately no examples_bool: a boolean
638
+ * example carries no information.
639
+ *
350
640
  * @generated from field: repeated double examples_number = 32;
351
641
  */
352
642
  examplesNumber: number[];
353
643
  };
354
644
 
355
645
  /**
646
+ * JsonSchema holds the field-level JSON Schema generation options. Unless a
647
+ * field's comment says otherwise, an option applies to the field's own
648
+ * schema for singular fields, and to each element or value for repeated and
649
+ * map fields; on message-typed fields, options are emitted as sibling
650
+ * keywords next to the field's `$ref` (JSON Schema Draft 2020-12
651
+ * semantics).
652
+ *
356
653
  * @generated from message alis.open.options.v1.FieldOptions.JsonSchema
357
654
  */
358
655
  export declare type FieldOptions_JsonSchemaJson = {
359
656
  /**
657
+ * Short human-readable title for the field. Emitted as JSON Schema
658
+ * `title`, overriding the title derived from the first paragraph of the
659
+ * field's leading comment. Applies to all field types.
660
+ *
360
661
  * @generated from field: optional string title = 1;
361
662
  */
362
663
  title?: string;
363
664
 
364
665
  /**
666
+ * Human-readable description of the field. Emitted as JSON Schema
667
+ * `description`, overriding the description derived from the field's
668
+ * leading comment. Applies to all field types.
669
+ *
365
670
  * @generated from field: optional string description = 2;
366
671
  */
367
672
  description?: string;
368
673
 
369
674
  /**
675
+ * Excludes the field from the generated schema entirely: no property is
676
+ * emitted and the field never appears in `required`. Applies to all
677
+ * field types, including oneof members.
678
+ *
370
679
  * @generated from field: optional bool ignore = 3;
371
680
  */
372
681
  ignore?: boolean;
373
682
 
374
683
  /**
684
+ * Regular expression the value must match, e.g. "^[A-Z]+$". Emitted as
685
+ * JSON Schema `pattern`. Applies to string values; on repeated and map
686
+ * fields it applies to each element or value.
687
+ *
375
688
  * @generated from field: optional string pattern = 4;
376
689
  */
377
690
  pattern?: string;
378
691
 
379
692
  /**
693
+ * Semantic format annotation such as "email", "uuid", "ipv4", "uri", or
694
+ * "date-time". Emitted as JSON Schema `format`. Most validators treat
695
+ * this as an annotation, not an assertion. Applies to string values; on
696
+ * repeated and map fields it applies to each element or value.
697
+ *
380
698
  * @generated from field: optional string format = 5;
381
699
  */
382
700
  format?: string;
383
701
 
384
702
  /**
703
+ * Encoding of binary content stored in a string, e.g. "base64". Emitted
704
+ * as JSON Schema `contentEncoding`. bytes fields default to "base64";
705
+ * setting this overrides that default.
706
+ *
385
707
  * @generated from field: optional string content_encoding = 6;
386
708
  */
387
709
  contentEncoding?: string;
388
710
 
389
711
  /**
712
+ * Media type of the field's (decoded) content, e.g. "application/json".
713
+ * Emitted as JSON Schema `contentMediaType`.
714
+ *
390
715
  * @generated from field: optional string content_media_type = 7;
391
716
  */
392
717
  contentMediaType?: string;
393
718
 
394
719
  /**
720
+ * Minimum string length in characters. Emitted as JSON Schema
721
+ * `minLength`. Applies to string values; on repeated and map fields it
722
+ * applies to each element or value.
723
+ *
395
724
  * @generated from field: optional int64 min_length = 8;
396
725
  */
397
726
  minLength?: string;
398
727
 
399
728
  /**
729
+ * Maximum string length in characters. Emitted as JSON Schema
730
+ * `maxLength`. Applies to string values; on repeated and map fields it
731
+ * applies to each element or value.
732
+ *
400
733
  * @generated from field: optional int64 max_length = 9;
401
734
  */
402
735
  maxLength?: string;
403
736
 
404
737
  /**
738
+ * Inclusive lower bound for numeric values, unless `exclusive_minimum`
739
+ * is set. Emitted as JSON Schema `minimum`. Applies to numeric values;
740
+ * on repeated and map fields it applies to each element or value.
741
+ *
405
742
  * @generated from field: optional double minimum = 10;
406
743
  */
407
744
  minimum?: number | "NaN" | "Infinity" | "-Infinity";
408
745
 
409
746
  /**
747
+ * Inclusive upper bound for numeric values, unless `exclusive_maximum`
748
+ * is set. Emitted as JSON Schema `maximum`. Applies to numeric values;
749
+ * on repeated and map fields it applies to each element or value.
750
+ *
410
751
  * @generated from field: optional double maximum = 11;
411
752
  */
412
753
  maximum?: number | "NaN" | "Infinity" | "-Infinity";
413
754
 
414
755
  /**
756
+ * If true, the `minimum` value is emitted as JSON Schema
757
+ * `exclusiveMinimum` instead of `minimum` (the bound itself is not an
758
+ * allowed value). Requires `minimum` to be set.
759
+ *
415
760
  * @generated from field: optional bool exclusive_minimum = 12;
416
761
  */
417
762
  exclusiveMinimum?: boolean;
418
763
 
419
764
  /**
765
+ * If true, the `maximum` value is emitted as JSON Schema
766
+ * `exclusiveMaximum` instead of `maximum` (the bound itself is not an
767
+ * allowed value). Requires `maximum` to be set.
768
+ *
420
769
  * @generated from field: optional bool exclusive_maximum = 13;
421
770
  */
422
771
  exclusiveMaximum?: boolean;
423
772
 
424
773
  /**
774
+ * Minimum number of elements in a repeated field. Emitted as JSON Schema
775
+ * `minItems` on the array itself.
776
+ *
425
777
  * @generated from field: optional int64 min_items = 14;
426
778
  */
427
779
  minItems?: string;
428
780
 
429
781
  /**
782
+ * Maximum number of elements in a repeated field. Emitted as JSON Schema
783
+ * `maxItems` on the array itself.
784
+ *
430
785
  * @generated from field: optional int64 max_items = 15;
431
786
  */
432
787
  maxItems?: string;
433
788
 
434
789
  /**
790
+ * If true, all elements of a repeated field must be distinct. Emitted as
791
+ * JSON Schema `uniqueItems` on the array itself.
792
+ *
435
793
  * @generated from field: optional bool unique_items = 16;
436
794
  */
437
795
  uniqueItems?: boolean;
438
796
 
439
797
  /**
798
+ * Minimum number of entries in a map field. Emitted as JSON Schema
799
+ * `minProperties` on the object itself.
800
+ *
440
801
  * @generated from field: optional int64 min_properties = 17;
441
802
  */
442
803
  minProperties?: string;
443
804
 
444
805
  /**
806
+ * Maximum number of entries in a map field. Emitted as JSON Schema
807
+ * `maxProperties` on the object itself.
808
+ *
445
809
  * @generated from field: optional int64 max_properties = 18;
446
810
  */
447
811
  maxProperties?: string;
448
812
 
449
813
  /**
814
+ * Restricts a string or bytes field's value to a fixed set. Emitted as
815
+ * JSON Schema `enum`. On repeated and map fields the set applies to each
816
+ * element or value. Setting more than one enum_* variant, or using this
817
+ * variant on a field that is not string or bytes, is an error at
818
+ * generation time.
819
+ *
450
820
  * @generated from field: repeated string enum_string = 19;
451
821
  */
452
822
  enumString?: string[];
453
823
 
454
824
  /**
825
+ * Restricts an integer field's value to a fixed set. Emitted as JSON
826
+ * Schema `enum`. Applies to integer fields (int32/int64/uint*\/sint*\/
827
+ * fixed*) and proto enum fields, where the values must be a subset of the
828
+ * enum's declared numeric values. On repeated and map fields the set
829
+ * applies to each element or value. Setting more than one enum_* variant,
830
+ * or using this variant on a non-integer field, is an error at generation
831
+ * time. Cannot express uint64 values above 2^63-1.
832
+ *
455
833
  * @generated from field: repeated int64 enum_int = 20;
456
834
  */
457
835
  enumInt?: string[];
458
836
 
459
837
  /**
838
+ * Restricts a float or double field's value to a fixed set. Emitted as
839
+ * JSON Schema `enum`. On repeated and map fields the set applies to each
840
+ * element or value. Setting more than one enum_* variant, or using this
841
+ * variant on a non-numeric field, is an error at generation time.
842
+ *
460
843
  * @generated from field: repeated double enum_number = 21;
461
844
  */
462
845
  enumNumber?: (number | "NaN" | "Infinity" | "-Infinity")[];
463
846
 
464
847
  /**
848
+ * Marks the field as deprecated. Emitted as JSON Schema `deprecated`.
849
+ * Applies to the field's schema root: on repeated and map fields it marks
850
+ * the array or object itself, not its elements.
851
+ *
465
852
  * @generated from field: optional bool deprecated = 22;
466
853
  */
467
854
  deprecated?: boolean;
468
855
 
469
856
  /**
857
+ * Marks the field as read-only. Emitted as JSON Schema `readOnly`.
858
+ * Applies to the field's schema root, like `deprecated`.
859
+ *
470
860
  * @generated from field: optional bool read_only = 23;
471
861
  */
472
862
  readOnly?: boolean;
473
863
 
474
864
  /**
865
+ * Marks the field as write-only. Emitted as JSON Schema `writeOnly`.
866
+ * Applies to the field's schema root, like `deprecated`.
867
+ *
475
868
  * @generated from field: optional bool write_only = 24;
476
869
  */
477
870
  writeOnly?: boolean;
478
871
 
479
872
  /**
873
+ * Requires numeric values to be a multiple of this number. Emitted as
874
+ * JSON Schema `multipleOf`. Numeric fields only; must be greater than 0.
875
+ * On repeated and map fields it applies to each element or value.
876
+ *
480
877
  * @generated from field: optional double multiple_of = 25;
481
878
  */
482
879
  multipleOf?: number | "NaN" | "Infinity" | "-Infinity";
483
880
 
484
881
  /**
882
+ * Default value for a string or bytes field. Emitted as JSON Schema
883
+ * `default`. Only valid on singular fields of those types: using it on a
884
+ * repeated, map, message-typed, or non-string field, or setting more than
885
+ * one default_* variant, is an error at generation time.
886
+ *
485
887
  * @generated from field: optional string default_string = 26;
486
888
  */
487
889
  defaultString?: string;
488
890
 
489
891
  /**
892
+ * Default value for an integer or proto enum field. Emitted as JSON
893
+ * Schema `default`. Only valid on singular fields of those types: using
894
+ * it on a repeated, map, message-typed, or non-integer field, or setting
895
+ * more than one default_* variant, is an error at generation time.
896
+ *
490
897
  * @generated from field: optional int64 default_int = 27;
491
898
  */
492
899
  defaultInt?: string;
493
900
 
494
901
  /**
902
+ * Default value for a float or double field. Emitted as JSON Schema
903
+ * `default`. Only valid on singular fields of those types: using it on a
904
+ * repeated, map, message-typed, or non-numeric field, or setting more
905
+ * than one default_* variant, is an error at generation time.
906
+ *
495
907
  * @generated from field: optional double default_number = 28;
496
908
  */
497
909
  defaultNumber?: number | "NaN" | "Infinity" | "-Infinity";
498
910
 
499
911
  /**
912
+ * Default value for a bool field. Emitted as JSON Schema `default`. Only
913
+ * valid on singular bool fields: using it on a repeated, map,
914
+ * message-typed, or non-bool field, or setting more than one default_*
915
+ * variant, is an error at generation time.
916
+ *
500
917
  * @generated from field: optional bool default_bool = 29;
501
918
  */
502
919
  defaultBool?: boolean;
503
920
 
504
921
  /**
922
+ * Example values for a string or bytes field. Emitted as JSON Schema
923
+ * `examples`. Only valid on singular fields of those types, same rules as
924
+ * default_string.
925
+ *
505
926
  * @generated from field: repeated string examples_string = 30;
506
927
  */
507
928
  examplesString?: string[];
508
929
 
509
930
  /**
931
+ * Example values for an integer or proto enum field. Emitted as JSON
932
+ * Schema `examples`. Only valid on singular fields of those types, same
933
+ * rules as default_int.
934
+ *
510
935
  * @generated from field: repeated int64 examples_int = 31;
511
936
  */
512
937
  examplesInt?: string[];
513
938
 
514
939
  /**
940
+ * Example values for a float or double field. Emitted as JSON Schema
941
+ * `examples`. Only valid on singular fields of those types, same rules as
942
+ * default_number. There is deliberately no examples_bool: a boolean
943
+ * example carries no information.
944
+ *
515
945
  * @generated from field: repeated double examples_number = 32;
516
946
  */
517
947
  examplesNumber?: (number | "NaN" | "Infinity" | "-Infinity")[];
@@ -524,16 +954,45 @@ export declare type FieldOptions_JsonSchemaJson = {
524
954
  export declare const FieldOptions_JsonSchemaSchema: GenMessage<FieldOptions_JsonSchema, {jsonType: FieldOptions_JsonSchemaJson}>;
525
955
 
526
956
  /**
957
+ * File-level alis options.
958
+ *
959
+ * Usage: option (alis.open.options.v1.file).json_schema.generate = true;
960
+ *
527
961
  * @generated from extension: alis.open.options.v1.FileOptions file = 1001;
528
962
  */
529
963
  export declare const file: GenExtension<FileOptions$1, FileOptions>;
530
964
 
531
965
  /**
966
+ * Message-level alis options.
967
+ *
968
+ * Usage:
969
+ * option (alis.open.options.v1.message).json_schema.generate = true;
970
+ * option (alis.open.options.v1.message).json_schema.oneof = {
971
+ * fields: ["field_a", "field_b", "field_c"],
972
+ * required: true
973
+ * };
974
+ *
532
975
  * @generated from extension: alis.open.options.v1.MessageOptions message = 1001;
533
976
  */
534
977
  export declare const message: GenExtension<MessageOptions$1, MessageOptions>;
535
978
 
536
979
  /**
980
+ * Field-level alis options.
981
+ *
982
+ * Usage:
983
+ * string email = 1 [
984
+ * (alis.open.options.v1.field).json_schema = {
985
+ * format: "email",
986
+ * title: "Primary Email"
987
+ * }
988
+ * ];
989
+ *
990
+ * string region = 2 [
991
+ * (alis.open.options.v1.field).json_schema = {
992
+ * enum_string: ["ALL", "EXPORT", "LOCAL"]
993
+ * }
994
+ * ];
995
+ *
537
996
  * @generated from extension: alis.open.options.v1.FieldOptions field = 1001;
538
997
  */
539
998
  export declare const field: GenExtension<FieldOptions$1, FieldOptions>;
@@ -1,7 +1,37 @@
1
- // @generated by protoc-gen-es v2.13.0 with parameter "target=js+dts,import_extension=js,json_types=true"
1
+ // @generated by protoc-gen-es v2.16.0 with parameter "target=js+dts,import_extension=js,json_types=true"
2
2
  // @generated from file alis/open/options/v1/options.proto (package alis.open.options.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
+ // Custom options that control how alis code generators treat a proto file,
6
+ // currently JSON Schema (Draft 2020-12) generation by
7
+ // `protoc-gen-go-jsonschema`.
8
+ //
9
+ // Three extensions, each at field number 1001 of its descriptor options
10
+ // message, carry the options:
11
+ //
12
+ // - `(alis.open.options.v1.file)` (`FileOptions`): turns schema generation on
13
+ // for every message in the file.
14
+ // - `(alis.open.options.v1.message)` (`MessageOptions`): overrides the file
15
+ // default for one message and declares schema-level oneof groups.
16
+ // - `(alis.open.options.v1.field)` (`FieldOptions`): adds JSON Schema keywords
17
+ // to a field, such as `title`, `pattern`, `format`, numeric and length
18
+ // bounds, `enum`, `default` and `examples`.
19
+ //
20
+ // ```proto
21
+ // import "alis/open/options/v1/options.proto";
22
+ //
23
+ // option (alis.open.options.v1.file).json_schema.generate = true;
24
+ //
25
+ // message Contact {
26
+ // string email = 1 [(alis.open.options.v1.field).json_schema = {
27
+ // format: "email"
28
+ // }];
29
+ // }
30
+ // ```
31
+ //
32
+ // A message referenced by a generating message is always generated, even if
33
+ // it opts out, so that `$ref` pointers resolve.
34
+
5
35
  import { extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
6
36
  import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
7
37
 
@@ -61,18 +91,47 @@ export const FieldOptions_JsonSchemaSchema = /*@__PURE__*/
61
91
  messageDesc(file_alis_open_options_v1_options, 2, 0);
62
92
 
63
93
  /**
94
+ * File-level alis options.
95
+ *
96
+ * Usage: option (alis.open.options.v1.file).json_schema.generate = true;
97
+ *
64
98
  * @generated from extension: alis.open.options.v1.FileOptions file = 1001;
65
99
  */
66
100
  export const file = /*@__PURE__*/
67
101
  extDesc(file_alis_open_options_v1_options, 0);
68
102
 
69
103
  /**
104
+ * Message-level alis options.
105
+ *
106
+ * Usage:
107
+ * option (alis.open.options.v1.message).json_schema.generate = true;
108
+ * option (alis.open.options.v1.message).json_schema.oneof = {
109
+ * fields: ["field_a", "field_b", "field_c"],
110
+ * required: true
111
+ * };
112
+ *
70
113
  * @generated from extension: alis.open.options.v1.MessageOptions message = 1001;
71
114
  */
72
115
  export const message = /*@__PURE__*/
73
116
  extDesc(file_alis_open_options_v1_options, 1);
74
117
 
75
118
  /**
119
+ * Field-level alis options.
120
+ *
121
+ * Usage:
122
+ * string email = 1 [
123
+ * (alis.open.options.v1.field).json_schema = {
124
+ * format: "email",
125
+ * title: "Primary Email"
126
+ * }
127
+ * ];
128
+ *
129
+ * string region = 2 [
130
+ * (alis.open.options.v1.field).json_schema = {
131
+ * enum_string: ["ALL", "EXPORT", "LOCAL"]
132
+ * }
133
+ * ];
134
+ *
76
135
  * @generated from extension: alis.open.options.v1.FieldOptions field = 1001;
77
136
  */
78
137
  export const field = /*@__PURE__*/
package/package.json CHANGED
@@ -23,5 +23,5 @@
23
23
  },
24
24
  "type": "module",
25
25
  "types": "./index.d.ts",
26
- "version": "1.21.0"
26
+ "version": "1.22.0"
27
27
  }