@stripe/extensibility-jsonschema-tools 1.0.0 → 1.0.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/index.d.ts CHANGED
@@ -279,6 +279,23 @@ declare interface MetadataValueRequireExplicitPolicyInput$2 {
279
279
 
280
280
 
281
281
 
282
+ /**
283
+ * Controls whether a type-level annotation can flow from a base declaration to
284
+ * a derived declaration during semantic analysis.
285
+ *
286
+ * @public
287
+ */
288
+ declare type AnnotationInheritancePolicy$1 = "local-wins" | "never";
289
+
290
+ /**
291
+ * Controls whether a type-level annotation can flow from a base declaration to
292
+ * a derived declaration during semantic analysis.
293
+ *
294
+ * @public
295
+ */
296
+ declare type AnnotationInheritancePolicy_2 = "local-wins" | "never";
297
+
298
+
282
299
  /**
283
300
  * Registration for mapping a built-in TSDoc tag onto a custom constraint when
284
301
  * it is used on a particular custom type.
@@ -364,24 +381,6 @@ declare interface Category {
364
381
  }
365
382
 
366
383
 
367
- /**
368
- * Complete constraint configuration for a FormSpec project.
369
- *
370
- * @public
371
- */
372
- declare interface ConstraintConfig {
373
- /** Field type constraints */
374
- fieldTypes?: FieldTypeConstraints;
375
- /** Layout and structure constraints */
376
- layout?: LayoutConstraints;
377
- /** UI Schema feature constraints */
378
- uiSchema?: UISchemaConstraints;
379
- /** Field configuration option constraints */
380
- fieldOptions?: FieldOptionConstraints;
381
- /** Control options constraints */
382
- controlOptions?: ControlOptionConstraints;
383
- }
384
-
385
384
  /**
386
385
  * Semantic metadata for ordered custom constraints that should participate in
387
386
  * the generic contradiction/broadening logic.
@@ -480,7 +479,7 @@ declare interface ControlElement {
480
479
  }
481
480
 
482
481
  /**
483
- * Control options constraints - control which JSONForms Control.options are allowed.
482
+ * Control options constraints - control which JSON Forms Control.options are allowed.
484
483
  * These are renderer-specific options that may not be universally supported.
485
484
  *
486
485
  * @public
@@ -511,6 +510,19 @@ declare interface ControlOptionConstraints {
511
510
  declare interface CustomAnnotationRegistration_2 {
512
511
  /** The annotation name, unique within the extension. */
513
512
  readonly annotationName: string;
513
+ /**
514
+ * Optional type-level inheritance behavior for semantic consumers.
515
+ *
516
+ * `"local-wins"` means a derived declaration inherits this annotation from
517
+ * its base declaration only when the derived declaration does not provide the
518
+ * same extension annotation identity locally. Omitted registrations behave as
519
+ * `"never"`.
520
+ */
521
+ readonly inheritFromBase?: AnnotationInheritancePolicy$1;
522
+ /**
523
+ * Optional editor documentation for the annotation's TSDoc authoring tag.
524
+ */
525
+ readonly tagDocumentation?: CustomAnnotationTagDocumentation$1;
514
526
  /**
515
527
  * Optionally converts the annotation value into JSON Schema keywords.
516
528
  * If omitted, the annotation has no JSON Schema representation (UI-only).
@@ -529,6 +541,19 @@ declare interface CustomAnnotationRegistration_2 {
529
541
  declare interface CustomAnnotationRegistration_3 {
530
542
  /** The annotation name, unique within the extension. */
531
543
  readonly annotationName: string;
544
+ /**
545
+ * Optional type-level inheritance behavior for semantic consumers.
546
+ *
547
+ * `"local-wins"` means a derived declaration inherits this annotation from
548
+ * its base declaration only when the derived declaration does not provide the
549
+ * same extension annotation identity locally. Omitted registrations behave as
550
+ * `"never"`.
551
+ */
552
+ readonly inheritFromBase?: AnnotationInheritancePolicy_2;
553
+ /**
554
+ * Optional editor documentation for the annotation's TSDoc authoring tag.
555
+ */
556
+ readonly tagDocumentation?: CustomAnnotationTagDocumentation_2;
532
557
  /**
533
558
  * Optionally converts the annotation value into JSON Schema keywords.
534
559
  * If omitted, the annotation has no JSON Schema representation (UI-only).
@@ -536,6 +561,56 @@ declare interface CustomAnnotationRegistration_3 {
536
561
  readonly toJsonSchema?: (value: ExtensionPayloadValue_2, vendorPrefix: string) => Record<string, unknown>;
537
562
  }
538
563
 
564
+ /**
565
+ * Documentation text for an extension annotation's TSDoc authoring tag.
566
+ *
567
+ * These strings are consumed by editor integrations for completion details and
568
+ * hover text. They do not affect annotation parsing, inheritance, or schema
569
+ * emission.
570
+ *
571
+ * @public
572
+ */
573
+ declare interface CustomAnnotationTagDocumentation$1 {
574
+ /** Completion detail shown beside the annotation tag. */
575
+ readonly completionDetail?: string;
576
+ /**
577
+ * Label for the payload portion of the annotation tag signature.
578
+ *
579
+ * The payload remains the full authored text after the tag name, so this can
580
+ * describe single-argument or multi-argument annotation syntaxes.
581
+ */
582
+ readonly payloadLabel?: string;
583
+ /** Short hover summary shown for the annotation tag. */
584
+ readonly hoverSummary?: string;
585
+ /** Full markdown hover body for the annotation tag. */
586
+ readonly hoverMarkdown?: string;
587
+ }
588
+
589
+ /**
590
+ * Documentation text for an extension annotation's TSDoc authoring tag.
591
+ *
592
+ * These strings are consumed by editor integrations for completion details and
593
+ * hover text. They do not affect annotation parsing, inheritance, or schema
594
+ * emission.
595
+ *
596
+ * @public
597
+ */
598
+ declare interface CustomAnnotationTagDocumentation_2 {
599
+ /** Completion detail shown beside the annotation tag. */
600
+ readonly completionDetail?: string;
601
+ /**
602
+ * Label for the payload portion of the annotation tag signature.
603
+ *
604
+ * The payload remains the full authored text after the tag name, so this can
605
+ * describe single-argument or multi-argument annotation syntaxes.
606
+ */
607
+ readonly payloadLabel?: string;
608
+ /** Short hover summary shown for the annotation tag. */
609
+ readonly hoverSummary?: string;
610
+ /** Full markdown hover body for the annotation tag. */
611
+ readonly hoverMarkdown?: string;
612
+ }
613
+
539
614
 
540
615
  /**
541
616
  * Registration for a custom constraint that maps to JSON Schema keywords.
@@ -795,6 +870,24 @@ declare interface DiscriminatorResolutionOptions {
795
870
  readonly apiNamePrefix?: string | undefined;
796
871
  }
797
872
 
873
+ /**
874
+ * Complete DSL policy for a FormSpec project.
875
+ *
876
+ * @public
877
+ */
878
+ declare interface DSLPolicy {
879
+ /** Field type constraints */
880
+ fieldTypes?: FieldTypeConstraints;
881
+ /** Layout and structure constraints */
882
+ layout?: LayoutConstraints;
883
+ /** UI schema feature constraints */
884
+ uiSchema?: UISchemaConstraints;
885
+ /** Field configuration option constraints */
886
+ fieldOptions?: FieldOptionConstraints;
887
+ /** Control options constraints */
888
+ controlOptions?: ControlOptionConstraints;
889
+ }
890
+
798
891
 
799
892
  /**
800
893
  * Enum-member display names remain unset unless authored explicitly.
@@ -1169,8 +1262,7 @@ declare interface FieldTypeConstraints {
1169
1262
 
1170
1263
 
1171
1264
  /**
1172
- * Top-level FormSpec configuration file structure.
1173
- * The .formspec.yml file uses this structure.
1265
+ * Top-level FormSpec configuration structure.
1174
1266
  *
1175
1267
  * @public
1176
1268
  */
@@ -1180,9 +1272,11 @@ declare interface FormSpecConfig {
1180
1272
  * annotations, and vocabulary keywords.
1181
1273
  */
1182
1274
  readonly extensions?: readonly ExtensionDefinition_3[];
1183
- /** Constraint surface configuration — controls which field types,
1184
- * layouts, UI features, and field/control options are allowed. */
1185
- readonly constraints?: ConstraintConfig;
1275
+ /**
1276
+ * DSL-policy surface configuration controlling which field types,
1277
+ * layouts, UI features, and field/control options are allowed.
1278
+ */
1279
+ readonly constraints?: DSLPolicy;
1186
1280
  /**
1187
1281
  * Metadata inference and naming policy. Controls how apiName,
1188
1282
  * displayName, and plural forms are derived when not authored.
@@ -1202,6 +1296,11 @@ declare interface FormSpecConfig {
1202
1296
  * @defaultValue "enum"
1203
1297
  */
1204
1298
  readonly enumSerialization?: "enum" | "oneOf" | "smart-size";
1299
+ /**
1300
+ * JSON Schema serialization settings for vocabulary and dialect emission.
1301
+ * PR-1 stores and resolves this block; PR-2 consumes it.
1302
+ */
1303
+ readonly serialization?: FormSpecSerializationConfig;
1205
1304
  /**
1206
1305
  * Per-package configuration overrides for monorepos.
1207
1306
  * Keys are glob patterns matched against file paths relative to
@@ -1217,14 +1316,31 @@ declare interface FormSpecConfig {
1217
1316
  * @public
1218
1317
  */
1219
1318
  declare interface FormSpecPackageOverride {
1220
- /** Override constraint surface for this package. */
1221
- readonly constraints?: ConstraintConfig;
1319
+ /** Override DSL policy for this package. */
1320
+ readonly constraints?: DSLPolicy;
1222
1321
  /** Override enum serialization for this package. */
1223
1322
  readonly enumSerialization?: "enum" | "oneOf" | "smart-size";
1224
1323
  /** Override metadata policy for this package. */
1225
1324
  readonly metadata?: MetadataPolicyInput_2;
1226
1325
  }
1227
1326
 
1327
+ /**
1328
+ * Forward-looking JSON Schema serialization settings.
1329
+ *
1330
+ * These values are currently carried through configuration for future
1331
+ * vocabulary and dialect emission.
1332
+ *
1333
+ * @public
1334
+ */
1335
+ declare interface FormSpecSerializationConfig {
1336
+ /** Base URL used to construct default FormSpec vocabulary URLs. */
1337
+ readonly vocabularyBaseUrl?: string;
1338
+ /** Per-vocabulary URL overrides keyed by vocabulary identifier. */
1339
+ readonly vocabularyUrls?: Readonly<Record<string, string>>;
1340
+ /** Explicit FormSpec dialect URL override. */
1341
+ readonly dialectUrl?: string;
1342
+ }
1343
+
1228
1344
  /**
1229
1345
  * Options for generating schemas from a decorated class.
1230
1346
  *
@@ -1391,6 +1507,8 @@ declare interface JsonSchema2020 {
1391
1507
  description?: string;
1392
1508
  /** Default value suggested for the schema node. */
1393
1509
  default?: unknown;
1510
+ /** Documentation example values (from one or more `@example` tags). */
1511
+ examples?: unknown[];
1394
1512
  /** Whether the schema node is deprecated. */
1395
1513
  deprecated?: boolean;
1396
1514
  /** Additional vendor-prefixed extension keywords. */
@@ -1430,7 +1548,7 @@ declare interface LayoutConstraints {
1430
1548
  }
1431
1549
 
1432
1550
  /**
1433
- * JSONForms layout type constraints.
1551
+ * JSON Forms layout type constraints.
1434
1552
  *
1435
1553
  * @public
1436
1554
  */
@@ -1826,7 +1944,7 @@ declare interface RuleConditionSchema {
1826
1944
  }
1827
1945
 
1828
1946
  /**
1829
- * JSONForms rule constraints.
1947
+ * JSON Forms rule constraints.
1830
1948
  *
1831
1949
  * @public
1832
1950
  */
@@ -1853,7 +1971,7 @@ declare interface RuleConstraints {
1853
1971
  declare type RuleEffect = "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
1854
1972
 
1855
1973
  /**
1856
- * JSONForms rule effect constraints.
1974
+ * JSON Forms rule effect constraints.
1857
1975
  *
1858
1976
  * @public
1859
1977
  */
@@ -1880,8 +1998,10 @@ declare interface SchemaBasedCondition {
1880
1998
  readonly schema: RuleConditionSchema;
1881
1999
  }
1882
2000
 
2001
+ /* Excluded from this release type: SetupDiagnostic */
2002
+
1883
2003
  /**
1884
- * Severity level for constraint violations.
2004
+ * Severity level for DSL-policy violations.
1885
2005
  * - "error": Violation fails validation
1886
2006
  * - "warn": Violation emits warning but passes
1887
2007
  * - "off": Feature is allowed (no violation)
@@ -1953,7 +2073,7 @@ declare interface StaticSchemaGenerationOptions {
1953
2073
  declare type UISchema = VerticalLayout | HorizontalLayout | GroupLayout | Categorization;
1954
2074
 
1955
2075
  /**
1956
- * UI Schema feature constraints - control JSONForms-specific features.
2076
+ * UI schema feature constraints - control JSON Forms-specific features.
1957
2077
  *
1958
2078
  * @public
1959
2079
  */
@@ -2036,6 +2156,14 @@ declare function _generateSchemas(options: Omit<GenerateSchemasOptions, 'errorRe
2036
2156
  */
2037
2157
  declare function _fixupDecimalPathConstraints(schema: JsonSchema2020): JsonSchema2020;
2038
2158
 
2159
+ /**
2160
+ * Controls whether a type-level annotation can flow from a base declaration to
2161
+ * a derived declaration during semantic analysis.
2162
+ *
2163
+ * @public
2164
+ */
2165
+ declare type AnnotationInheritancePolicy = "local-wins" | "never";
2166
+
2039
2167
  /**
2040
2168
  * Registration for mapping a built-in TSDoc tag onto a custom constraint when
2041
2169
  * it is used on a particular custom type.
@@ -2115,6 +2243,19 @@ declare interface ConstraintTagRegistration {
2115
2243
  declare interface CustomAnnotationRegistration {
2116
2244
  /** The annotation name, unique within the extension. */
2117
2245
  readonly annotationName: string;
2246
+ /**
2247
+ * Optional type-level inheritance behavior for semantic consumers.
2248
+ *
2249
+ * `"local-wins"` means a derived declaration inherits this annotation from
2250
+ * its base declaration only when the derived declaration does not provide the
2251
+ * same extension annotation identity locally. Omitted registrations behave as
2252
+ * `"never"`.
2253
+ */
2254
+ readonly inheritFromBase?: AnnotationInheritancePolicy;
2255
+ /**
2256
+ * Optional editor documentation for the annotation's TSDoc authoring tag.
2257
+ */
2258
+ readonly tagDocumentation?: CustomAnnotationTagDocumentation;
2118
2259
  /**
2119
2260
  * Optionally converts the annotation value into JSON Schema keywords.
2120
2261
  * If omitted, the annotation has no JSON Schema representation (UI-only).
@@ -2122,6 +2263,31 @@ declare interface CustomAnnotationRegistration {
2122
2263
  readonly toJsonSchema?: (value: ExtensionPayloadValue, vendorPrefix: string) => Record<string, unknown>;
2123
2264
  }
2124
2265
 
2266
+ /**
2267
+ * Documentation text for an extension annotation's TSDoc authoring tag.
2268
+ *
2269
+ * These strings are consumed by editor integrations for completion details and
2270
+ * hover text. They do not affect annotation parsing, inheritance, or schema
2271
+ * emission.
2272
+ *
2273
+ * @public
2274
+ */
2275
+ declare interface CustomAnnotationTagDocumentation {
2276
+ /** Completion detail shown beside the annotation tag. */
2277
+ readonly completionDetail?: string;
2278
+ /**
2279
+ * Label for the payload portion of the annotation tag signature.
2280
+ *
2281
+ * The payload remains the full authored text after the tag name, so this can
2282
+ * describe single-argument or multi-argument annotation syntaxes.
2283
+ */
2284
+ readonly payloadLabel?: string;
2285
+ /** Short hover summary shown for the annotation tag. */
2286
+ readonly hoverSummary?: string;
2287
+ /** Full markdown hover body for the annotation tag. */
2288
+ readonly hoverMarkdown?: string;
2289
+ }
2290
+
2125
2291
  /* Excluded from this release type: CustomConstraintNode */
2126
2292
 
2127
2293
  /**