@redocly/openapi-core 0.0.0-snapshot.1747233436 → 0.0.0-snapshot.1747918074

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.
Files changed (92) hide show
  1. package/lib/bundle.d.ts +1 -1
  2. package/lib/config/all.d.ts.map +1 -1
  3. package/lib/config/all.js +3 -0
  4. package/lib/config/all.js.map +1 -1
  5. package/lib/config/config-resolvers.d.ts.map +1 -1
  6. package/lib/config/config-resolvers.js.map +1 -1
  7. package/lib/config/minimal.d.ts.map +1 -1
  8. package/lib/config/minimal.js +3 -0
  9. package/lib/config/minimal.js.map +1 -1
  10. package/lib/config/recommended-strict.d.ts.map +1 -1
  11. package/lib/config/recommended-strict.js +3 -0
  12. package/lib/config/recommended-strict.js.map +1 -1
  13. package/lib/config/recommended.d.ts.map +1 -1
  14. package/lib/config/recommended.js +3 -0
  15. package/lib/config/recommended.js.map +1 -1
  16. package/lib/config/spec.d.ts.map +1 -1
  17. package/lib/config/spec.js +3 -0
  18. package/lib/config/spec.js.map +1 -1
  19. package/lib/config/types.d.ts +0 -14
  20. package/lib/config/types.d.ts.map +1 -1
  21. package/lib/config/utils.d.ts +2 -4
  22. package/lib/config/utils.d.ts.map +1 -1
  23. package/lib/config/utils.js +6 -68
  24. package/lib/config/utils.js.map +1 -1
  25. package/lib/index.d.ts +2 -2
  26. package/lib/index.d.ts.map +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/oas-types.d.ts +392 -1
  29. package/lib/oas-types.d.ts.map +1 -1
  30. package/lib/rules/arazzo/index.d.ts.map +1 -1
  31. package/lib/rules/arazzo/index.js +6 -0
  32. package/lib/rules/arazzo/index.js.map +1 -1
  33. package/lib/rules/common/assertions/asserts.d.ts +0 -1
  34. package/lib/rules/common/assertions/asserts.d.ts.map +1 -1
  35. package/lib/rules/common/assertions/asserts.js +0 -13
  36. package/lib/rules/common/assertions/asserts.js.map +1 -1
  37. package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +1 -1
  38. package/lib/rules/common/no-invalid-parameter-examples.js +2 -3
  39. package/lib/rules/common/no-invalid-parameter-examples.js.map +1 -1
  40. package/lib/rules/common/no-invalid-schema-examples.d.ts.map +1 -1
  41. package/lib/rules/common/no-invalid-schema-examples.js +2 -3
  42. package/lib/rules/common/no-invalid-schema-examples.js.map +1 -1
  43. package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +1 -1
  44. package/lib/rules/oas3/no-invalid-media-type-examples.js +2 -3
  45. package/lib/rules/oas3/no-invalid-media-type-examples.js.map +1 -1
  46. package/lib/rules/respect/no-x-security-scheme-name-in-workflow.d.ts +3 -0
  47. package/lib/rules/respect/no-x-security-scheme-name-in-workflow.d.ts.map +1 -0
  48. package/lib/rules/respect/no-x-security-scheme-name-in-workflow.js +21 -0
  49. package/lib/rules/respect/no-x-security-scheme-name-in-workflow.js.map +1 -0
  50. package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts +3 -0
  51. package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts.map +1 -0
  52. package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
  53. package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js.map +1 -0
  54. package/lib/rules/respect/x-security-scheme-required-values.d.ts +3 -0
  55. package/lib/rules/respect/x-security-scheme-required-values.d.ts.map +1 -0
  56. package/lib/rules/respect/x-security-scheme-required-values.js +60 -0
  57. package/lib/rules/respect/x-security-scheme-required-values.js.map +1 -0
  58. package/lib/rules/utils.d.ts +0 -1
  59. package/lib/rules/utils.d.ts.map +1 -1
  60. package/lib/rules/utils.js +1 -11
  61. package/lib/rules/utils.js.map +1 -1
  62. package/lib/types/arazzo.d.ts.map +1 -1
  63. package/lib/types/arazzo.js +21 -2
  64. package/lib/types/arazzo.js.map +1 -1
  65. package/lib/types/oas2.d.ts +84 -3
  66. package/lib/types/oas2.d.ts.map +1 -1
  67. package/lib/types/oas2.js.map +1 -1
  68. package/lib/types/oas3.d.ts +158 -3
  69. package/lib/types/oas3.d.ts.map +1 -1
  70. package/lib/types/oas3.js +5 -5
  71. package/lib/types/oas3.js.map +1 -1
  72. package/lib/types/oas3_1.d.ts +161 -3
  73. package/lib/types/oas3_1.d.ts.map +1 -1
  74. package/lib/types/oas3_1.js +1 -1
  75. package/lib/types/oas3_1.js.map +1 -1
  76. package/lib/types/redocly-yaml.d.ts +1 -7
  77. package/lib/types/redocly-yaml.d.ts.map +1 -1
  78. package/lib/types/redocly-yaml.js +4 -741
  79. package/lib/types/redocly-yaml.js.map +1 -1
  80. package/lib/typings/arazzo.d.ts +40 -0
  81. package/lib/typings/arazzo.d.ts.map +1 -1
  82. package/lib/typings/arazzo.js.map +1 -1
  83. package/lib/typings/openapi.d.ts +44 -15
  84. package/lib/typings/openapi.d.ts.map +1 -1
  85. package/lib/utils.d.ts +0 -4
  86. package/lib/utils.d.ts.map +1 -1
  87. package/lib/utils.js +0 -19
  88. package/lib/utils.js.map +1 -1
  89. package/lib/visitors.d.ts +6 -6
  90. package/lib/visitors.d.ts.map +1 -1
  91. package/lib/visitors.js.map +1 -1
  92. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { rootRedoclyConfigSchema } from '@redocly/config';
2
2
  import { listOf } from './index.js';
3
3
  import { SpecVersion, getTypes } from '../oas-types.js';
4
- import { isCustomRuleId, omitObjectProps, pickObjectProps } from '../utils.js';
4
+ import { isCustomRuleId } from '../utils.js';
5
5
  import { getNodeTypesFromJSONSchema } from './json-schema-adapter.js';
6
6
  import { normalizeTypes } from '../types/index.js';
7
7
  const builtInOAS2Rules = [
@@ -140,6 +140,9 @@ const builtInArazzo1Rules = [
140
140
  'requestBody-replacements-unique',
141
141
  'no-criteria-xpath',
142
142
  'criteria-unique',
143
+ 'no-x-security-scheme-name-without-openapi',
144
+ 'x-security-scheme-required-values',
145
+ 'no-x-security-scheme-name-in-workflow',
143
146
  ];
144
147
  const builtInOverlay1Rules = ['info-contact'];
145
148
  const builtInRules = [
@@ -151,122 +154,6 @@ const builtInRules = [
151
154
  ...builtInOverlay1Rules,
152
155
  'struct',
153
156
  ];
154
- const oas2NodeTypesList = [
155
- 'Root',
156
- 'Tag',
157
- 'TagList',
158
- 'ExternalDocs',
159
- 'SecurityRequirement',
160
- 'SecurityRequirementList',
161
- 'Info',
162
- 'Contact',
163
- 'License',
164
- 'Paths',
165
- 'PathItem',
166
- 'Parameter',
167
- 'ParameterList',
168
- 'ParameterItems',
169
- 'Operation',
170
- 'Example',
171
- 'ExamplesMap',
172
- 'Examples',
173
- 'Header',
174
- 'Responses',
175
- 'Response',
176
- 'Schema',
177
- 'Xml',
178
- 'SchemaProperties',
179
- 'NamedSchemas',
180
- 'NamedResponses',
181
- 'NamedParameters',
182
- 'NamedSecuritySchemes',
183
- 'SecurityScheme',
184
- 'TagGroup',
185
- 'TagGroups',
186
- 'EnumDescriptions',
187
- 'Logo',
188
- 'XCodeSample',
189
- 'XCodeSampleList',
190
- 'XServer',
191
- 'XServerList',
192
- ];
193
- const oas3NodeTypesList = [
194
- 'Root',
195
- 'Tag',
196
- 'TagList',
197
- 'ExternalDocs',
198
- 'Server',
199
- 'ServerList',
200
- 'ServerVariable',
201
- 'ServerVariablesMap',
202
- 'SecurityRequirement',
203
- 'SecurityRequirementList',
204
- 'Info',
205
- 'Contact',
206
- 'License',
207
- 'Paths',
208
- 'PathItem',
209
- 'Parameter',
210
- 'ParameterList',
211
- 'Operation',
212
- 'Callback',
213
- 'CallbacksMap',
214
- 'RequestBody',
215
- 'MediaTypesMap',
216
- 'MediaType',
217
- 'Example',
218
- 'ExamplesMap',
219
- 'Encoding',
220
- 'EncodingMap',
221
- 'Header',
222
- 'HeadersMap',
223
- 'Responses',
224
- 'Response',
225
- 'Link',
226
- 'LinksMap',
227
- 'Schema',
228
- 'Xml',
229
- 'SchemaProperties',
230
- 'DiscriminatorMapping',
231
- 'Discriminator',
232
- 'Components',
233
- 'NamedSchemas',
234
- 'NamedResponses',
235
- 'NamedParameters',
236
- 'NamedExamples',
237
- 'NamedRequestBodies',
238
- 'NamedHeaders',
239
- 'NamedSecuritySchemes',
240
- 'NamedLinks',
241
- 'NamedCallbacks',
242
- 'ImplicitFlow',
243
- 'PasswordFlow',
244
- 'ClientCredentials',
245
- 'AuthorizationCode',
246
- 'OAuth2Flows',
247
- 'SecurityScheme',
248
- 'TagGroup',
249
- 'TagGroups',
250
- 'EnumDescriptions',
251
- 'Logo',
252
- 'XCodeSample',
253
- 'XCodeSampleList',
254
- 'XUsePkce',
255
- 'WebhooksMap',
256
- ];
257
- const oas3_1NodeTypesList = [
258
- 'Root',
259
- 'Schema',
260
- 'SchemaProperties',
261
- 'PatternProperties',
262
- 'Info',
263
- 'License',
264
- 'Components',
265
- 'NamedPathItems',
266
- 'SecurityScheme',
267
- 'Operation',
268
- 'DependentRequired',
269
- ];
270
157
  const ConfigStyleguide = {
271
158
  properties: {
272
159
  extends: {
@@ -301,8 +188,6 @@ const createConfigRoot = (nodeTypes) => ({
301
188
  ...nodeTypes.rootRedoclyConfigSchema.properties,
302
189
  ...ConfigStyleguide.properties,
303
190
  apis: 'ConfigApis', // Override apis with internal format
304
- 'features.openapi': 'ConfigReferenceDocs', // deprecated
305
- 'features.mockServer': 'ConfigMockServer', // deprecated
306
191
  telemetry: { enum: ['on', 'off'] },
307
192
  resolve: {
308
193
  properties: {
@@ -320,15 +205,7 @@ const createConfigApisProperties = (nodeTypes) => ({
320
205
  ...nodeTypes['rootRedoclyConfigSchema.apis_additionalProperties'],
321
206
  properties: {
322
207
  ...nodeTypes['rootRedoclyConfigSchema.apis_additionalProperties']?.properties,
323
- labels: {
324
- type: 'array',
325
- items: {
326
- type: 'string',
327
- },
328
- },
329
208
  ...ConfigStyleguide.properties,
330
- 'features.openapi': 'ConfigReferenceDocs', // deprecated
331
- 'features.mockServer': 'ConfigMockServer', // deprecated
332
209
  },
333
210
  });
334
211
  const ConfigHTTP = {
@@ -425,7 +302,6 @@ const AssertionDefinitionAssertions = {
425
302
  requireAny: { type: 'array', items: { type: 'string' } },
426
303
  disallowed: { type: 'array', items: { type: 'string' } },
427
304
  defined: { type: 'boolean' },
428
- // undefined: { type: 'boolean' }, // TODO: Remove `undefined` assertion from codebase overall
429
305
  nonEmpty: { type: 'boolean' },
430
306
  minLength: { type: 'integer' },
431
307
  maxLength: { type: 'integer' },
@@ -469,568 +345,6 @@ const Assert = {
469
345
  },
470
346
  required: ['subject', 'assertions'],
471
347
  };
472
- const ConfigLanguage = {
473
- properties: {
474
- label: { type: 'string' },
475
- lang: {
476
- enum: [
477
- 'curl',
478
- 'C#',
479
- 'Go',
480
- 'Java',
481
- 'Java8+Apache',
482
- 'JavaScript',
483
- 'Node.js',
484
- 'PHP',
485
- 'Python',
486
- 'R',
487
- 'Ruby',
488
- ],
489
- },
490
- },
491
- required: ['lang'],
492
- };
493
- const ConfigLabels = {
494
- properties: {
495
- enum: { type: 'string' },
496
- enumSingleValue: { type: 'string' },
497
- enumArray: { type: 'string' },
498
- default: { type: 'string' },
499
- deprecated: { type: 'string' },
500
- example: { type: 'string' },
501
- examples: { type: 'string' },
502
- nullable: { type: 'string' },
503
- recursive: { type: 'string' },
504
- arrayOf: { type: 'string' },
505
- webhook: { type: 'string' },
506
- authorizations: { type: 'string' },
507
- tryItAuthBasicUsername: { type: 'string' },
508
- tryItAuthBasicPassword: { type: 'string' },
509
- },
510
- };
511
- const ConfigSidebarLinks = {
512
- properties: {
513
- beforeInfo: listOf('CommonConfigSidebarLinks'),
514
- end: listOf('CommonConfigSidebarLinks'),
515
- },
516
- };
517
- const CommonConfigSidebarLinks = {
518
- properties: {
519
- label: { type: 'string' },
520
- link: { type: 'string' },
521
- target: { type: 'string' },
522
- },
523
- required: ['label', 'link'],
524
- };
525
- const CommonThemeColors = {
526
- properties: {
527
- main: { type: 'string' },
528
- light: { type: 'string' },
529
- dark: { type: 'string' },
530
- contrastText: { type: 'string' },
531
- },
532
- };
533
- const CommonColorProps = {
534
- properties: {
535
- backgroundColor: { type: 'string' },
536
- borderColor: { type: 'string' },
537
- color: { type: 'string' },
538
- tabTextColor: { type: 'string' },
539
- },
540
- };
541
- const BorderThemeColors = {
542
- properties: pickObjectProps(CommonThemeColors.properties, ['light', 'dark']),
543
- };
544
- const HttpColors = {
545
- properties: {
546
- basic: { type: 'string' },
547
- delete: { type: 'string' },
548
- get: { type: 'string' },
549
- head: { type: 'string' },
550
- link: { type: 'string' },
551
- options: { type: 'string' },
552
- patch: { type: 'string' },
553
- post: { type: 'string' },
554
- put: { type: 'string' },
555
- },
556
- };
557
- const ResponseColors = {
558
- properties: {
559
- error: 'CommonColorProps',
560
- info: 'CommonColorProps',
561
- redirect: 'CommonColorProps',
562
- success: 'CommonColorProps',
563
- },
564
- };
565
- const SecondaryColors = {
566
- properties: omitObjectProps(CommonThemeColors.properties, ['dark']),
567
- };
568
- const TextThemeColors = {
569
- properties: {
570
- primary: { type: 'string' },
571
- secondary: { type: 'string' },
572
- light: { type: 'string' },
573
- },
574
- };
575
- const ThemeColors = {
576
- properties: {
577
- accent: 'CommonThemeColors',
578
- border: 'BorderThemeColors',
579
- error: 'CommonThemeColors',
580
- http: 'HttpColors',
581
- primary: 'CommonThemeColors',
582
- responses: 'ResponseColors',
583
- secondary: 'SecondaryColors',
584
- success: 'CommonThemeColors',
585
- text: 'TextThemeColors',
586
- tonalOffset: { type: 'number' },
587
- warning: 'CommonThemeColors',
588
- },
589
- };
590
- const SizeProps = {
591
- properties: {
592
- fontSize: { type: 'string' },
593
- padding: { type: 'string' },
594
- minWidth: { type: 'string' },
595
- },
596
- };
597
- const Sizes = {
598
- properties: {
599
- small: 'SizeProps',
600
- medium: 'SizeProps',
601
- large: 'SizeProps',
602
- xlarge: 'SizeProps',
603
- },
604
- };
605
- const FontConfig = {
606
- properties: {
607
- fontFamily: { type: 'string' },
608
- fontSize: { type: 'string' },
609
- fontWeight: { type: 'string' },
610
- lineHeight: { type: 'string' },
611
- },
612
- };
613
- const ButtonsConfig = {
614
- properties: {
615
- ...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
616
- borderRadius: { type: 'string' },
617
- hoverStyle: { type: 'string' },
618
- boxShadow: { type: 'string' },
619
- hoverBoxShadow: { type: 'string' },
620
- sizes: 'Sizes',
621
- },
622
- };
623
- const BadgeFontConfig = {
624
- properties: pickObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
625
- };
626
- const BadgeSizes = {
627
- properties: {
628
- medium: 'BadgeFontConfig',
629
- small: 'BadgeFontConfig',
630
- },
631
- };
632
- const HttpBadgesConfig = {
633
- properties: {
634
- ...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
635
- borderRadius: { type: 'string' },
636
- color: { type: 'string' },
637
- sizes: 'BadgeSizes',
638
- },
639
- };
640
- const LabelControls = {
641
- properties: {
642
- top: { type: 'string' },
643
- width: { type: 'string' },
644
- height: { type: 'string' },
645
- },
646
- };
647
- const Panels = {
648
- properties: {
649
- borderRadius: { type: 'string' },
650
- backgroundColor: { type: 'string' },
651
- },
652
- };
653
- const TryItButton = {
654
- properties: {
655
- fullWidth: { type: 'boolean' },
656
- },
657
- };
658
- const ConfigThemeComponents = {
659
- properties: {
660
- buttons: 'ButtonsConfig',
661
- httpBadges: 'HttpBadgesConfig',
662
- layoutControls: 'LabelControls',
663
- panels: 'Panels',
664
- tryItButton: 'TryItButton',
665
- tryItSendButton: 'TryItButton',
666
- },
667
- };
668
- const Breakpoints = {
669
- properties: {
670
- small: { type: 'string' },
671
- medium: { type: 'string' },
672
- large: { type: 'string' },
673
- },
674
- };
675
- const StackedConfig = {
676
- properties: {
677
- maxWidth: 'Breakpoints',
678
- },
679
- };
680
- const ThreePanelConfig = {
681
- properties: {
682
- maxWidth: 'Breakpoints',
683
- middlePanelMaxWidth: 'Breakpoints',
684
- },
685
- };
686
- const Layout = {
687
- properties: {
688
- showDarkRightPanel: { type: 'boolean' },
689
- stacked: 'StackedConfig',
690
- 'three-panel': 'ThreePanelConfig',
691
- },
692
- };
693
- const SchemaColorsConfig = {
694
- properties: {
695
- backgroundColor: { type: 'string' },
696
- border: { type: 'string' },
697
- },
698
- };
699
- const ConfigThemeSchema = {
700
- properties: {
701
- breakFieldNames: { type: 'boolean' },
702
- caretColor: { type: 'string' },
703
- caretSize: { type: 'string' },
704
- constraints: 'SchemaColorsConfig',
705
- defaultDetailsWidth: { type: 'string' },
706
- examples: 'SchemaColorsConfig',
707
- labelsTextSize: { type: 'string' },
708
- linesColor: { type: 'string' },
709
- nestedBackground: { type: 'string' },
710
- nestingSpacing: { type: 'string' },
711
- requireLabelColor: { type: 'string' },
712
- typeNameColor: { type: 'string' },
713
- typeTitleColor: { type: 'string' },
714
- },
715
- };
716
- const GroupItemsConfig = {
717
- properties: {
718
- subItemsColor: { type: 'string' },
719
- textTransform: { type: 'string' },
720
- fontWeight: { type: 'string' },
721
- },
722
- };
723
- const Level1Items = {
724
- properties: pickObjectProps(GroupItemsConfig.properties, ['textTransform']),
725
- };
726
- const SpacingConfig = {
727
- properties: {
728
- unit: { type: 'number' },
729
- paddingHorizontal: { type: 'string' },
730
- paddingVertical: { type: 'string' },
731
- offsetTop: { type: 'string' },
732
- offsetLeft: { type: 'string' },
733
- offsetNesting: { type: 'string' },
734
- },
735
- };
736
- const Sidebar = {
737
- properties: {
738
- ...omitObjectProps(FontConfig.properties, ['fontWeight', 'lineHeight']),
739
- activeBgColor: { type: 'string' },
740
- activeTextColor: { type: 'string' },
741
- backgroundColor: { type: 'string' },
742
- borderRadius: { type: 'string' },
743
- breakPath: { type: 'boolean' },
744
- caretColor: { type: 'string' },
745
- caretSize: { type: 'string' },
746
- groupItems: 'GroupItemsConfig',
747
- level1items: 'Level1Items',
748
- rightLineColor: { type: 'string' },
749
- separatorLabelColor: { type: 'string' },
750
- showAtBreakpoint: { type: 'string' },
751
- spacing: 'SpacingConfig',
752
- textColor: { type: 'string' },
753
- width: { type: 'string' },
754
- },
755
- };
756
- const Heading = {
757
- properties: {
758
- ...FontConfig.properties,
759
- color: { type: 'string' },
760
- transform: { type: 'string' },
761
- },
762
- };
763
- const CodeConfig = {
764
- properties: {
765
- ...FontConfig.properties,
766
- backgroundColor: { type: 'string' },
767
- color: { type: 'string' },
768
- wordBreak: {
769
- enum: [
770
- 'break-all',
771
- 'break-word',
772
- 'keep-all',
773
- 'normal',
774
- 'revert',
775
- 'unset',
776
- 'inherit',
777
- 'initial',
778
- ],
779
- },
780
- wrap: { type: 'boolean' },
781
- },
782
- };
783
- const HeadingsConfig = {
784
- properties: omitObjectProps(FontConfig.properties, ['fontSize']),
785
- };
786
- const LinksConfig = {
787
- properties: {
788
- color: { type: 'string' },
789
- hover: { type: 'string' },
790
- textDecoration: { type: 'string' },
791
- hoverTextDecoration: { type: 'string' },
792
- visited: { type: 'string' },
793
- },
794
- };
795
- const Typography = {
796
- properties: {
797
- code: 'CodeConfig',
798
- fieldName: 'FontConfig',
799
- ...pickObjectProps(FontConfig.properties, ['fontSize', 'fontFamily']),
800
- fontWeightBold: { type: 'string' },
801
- fontWeightLight: { type: 'string' },
802
- fontWeightRegular: { type: 'string' },
803
- heading1: 'Heading',
804
- heading2: 'Heading',
805
- heading3: 'Heading',
806
- headings: 'HeadingsConfig',
807
- lineHeight: { type: 'string' },
808
- links: 'LinksConfig',
809
- optimizeSpeed: { type: 'boolean' },
810
- rightPanelHeading: 'Heading',
811
- smoothing: { enum: ['auto', 'none', 'antialiased', 'subpixel-antialiased', 'grayscale'] },
812
- },
813
- };
814
- const TokenProps = {
815
- properties: {
816
- color: { type: 'string' },
817
- ...omitObjectProps(FontConfig.properties, ['fontWeight']),
818
- },
819
- };
820
- const CodeBlock = {
821
- properties: {
822
- backgroundColor: { type: 'string' },
823
- borderRadius: { type: 'string' },
824
- tokens: 'TokenProps',
825
- },
826
- };
827
- const ConfigThemeLogo = {
828
- properties: {
829
- gutter: { type: 'string' },
830
- maxHeight: { type: 'string' },
831
- maxWidth: { type: 'string' },
832
- },
833
- };
834
- const Fab = {
835
- properties: {
836
- backgroundColor: { type: 'string' },
837
- color: { type: 'string' },
838
- },
839
- };
840
- const ButtonOverrides = {
841
- properties: {
842
- custom: { type: 'string' },
843
- },
844
- };
845
- const Overrides = {
846
- properties: {
847
- DownloadButton: 'ButtonOverrides',
848
- NextSectionButton: 'ButtonOverrides',
849
- },
850
- };
851
- const RightPanel = {
852
- properties: {
853
- backgroundColor: { type: 'string' },
854
- panelBackgroundColor: { type: 'string' },
855
- panelControlsBackgroundColor: { type: 'string' },
856
- showAtBreakpoint: { type: 'string' },
857
- textColor: { type: 'string' },
858
- width: { type: 'string' },
859
- },
860
- };
861
- const Shape = {
862
- properties: { borderRadius: { type: 'string' } },
863
- };
864
- const ThemeSpacing = {
865
- properties: {
866
- sectionHorizontal: { type: 'number' },
867
- sectionVertical: { type: 'number' },
868
- unit: { type: 'number' },
869
- },
870
- };
871
- const ConfigTheme = {
872
- properties: {
873
- breakpoints: 'Breakpoints',
874
- codeBlock: 'CodeBlock',
875
- colors: 'ThemeColors',
876
- components: 'ConfigThemeComponents',
877
- layout: 'Layout',
878
- logo: 'ConfigThemeLogo',
879
- fab: 'Fab',
880
- overrides: 'Overrides',
881
- rightPanel: 'RightPanel',
882
- schema: 'ConfigThemeSchema',
883
- shape: 'Shape',
884
- sidebar: 'Sidebar',
885
- spacing: 'ThemeSpacing',
886
- typography: 'Typography',
887
- links: { properties: { color: { type: 'string' } } }, // deprecated
888
- codeSample: { properties: { backgroundColor: { type: 'string' } } }, // deprecated
889
- },
890
- };
891
- const GenerateCodeSamples = {
892
- properties: {
893
- skipOptionalParameters: { type: 'boolean' },
894
- languages: listOf('ConfigLanguage'),
895
- },
896
- required: ['languages'],
897
- };
898
- // TODO: deprecated
899
- const ConfigReferenceDocs = {
900
- properties: {
901
- theme: 'ConfigTheme', // FIXME: theme is deprecated (2.0)
902
- corsProxyUrl: { type: 'string' },
903
- ctrlFHijack: { type: 'boolean' },
904
- defaultSampleLanguage: { type: 'string' },
905
- disableDeepLinks: { type: 'boolean' },
906
- disableSearch: { type: 'boolean' },
907
- disableSidebar: { type: 'boolean' },
908
- downloadDefinitionUrl: { type: 'string' },
909
- expandDefaultServerVariables: { type: 'boolean' },
910
- enumSkipQuotes: { type: 'boolean' },
911
- expandDefaultRequest: { type: 'boolean' },
912
- expandDefaultResponse: { type: 'boolean' },
913
- expandResponses: { type: 'string' },
914
- expandSingleSchemaField: { type: 'boolean' },
915
- generateCodeSamples: 'GenerateCodeSamples',
916
- generatedPayloadSamplesMaxDepth: { type: 'number' },
917
- hideDownloadButton: { type: 'boolean' },
918
- hideHostname: { type: 'boolean' },
919
- hideInfoSection: { type: 'boolean' },
920
- hideLoading: { type: 'boolean' },
921
- hideLogo: { type: 'boolean' },
922
- hideRequestPayloadSample: { type: 'boolean' },
923
- hideRightPanel: { type: 'boolean' },
924
- hideSchemaPattern: { type: 'boolean' },
925
- hideSchemaTitles: { type: 'boolean' },
926
- hideSingleRequestSampleTab: { type: 'boolean' },
927
- hideSecuritySection: { type: 'boolean' },
928
- hideTryItPanel: { type: 'boolean' },
929
- hideFab: { type: 'boolean' },
930
- hideOneOfDescription: { type: 'boolean' },
931
- htmlTemplate: { type: 'string' },
932
- jsonSampleExpandLevel: (value) => {
933
- if (typeof value === 'number') {
934
- return { type: 'number', minimum: 1 };
935
- }
936
- else {
937
- return { type: 'string' };
938
- }
939
- },
940
- labels: 'ConfigLabels',
941
- layout: { enum: ['stacked', 'three-panel'] },
942
- maxDisplayedEnumValues: { type: 'number' },
943
- menuToggle: { type: 'boolean' },
944
- nativeScrollbars: { type: 'boolean' },
945
- noAutoAuth: { type: 'boolean' }, // deprecated
946
- oAuth2RedirectURI: { type: 'string' },
947
- onDeepLinkClick: { type: 'object' },
948
- onlyRequiredInSamples: { type: 'boolean' },
949
- pagination: { enum: ['none', 'section', 'item'] },
950
- pathInMiddlePanel: { type: 'boolean' },
951
- payloadSampleIdx: { type: 'number', minimum: 0 },
952
- requestInterceptor: { type: 'object' },
953
- requiredPropsFirst: { type: 'boolean' },
954
- routingBasePath: { type: 'string' },
955
- routingStrategy: { type: 'string' }, // deprecated
956
- samplesTabsMaxCount: { type: 'number' },
957
- schemaExpansionLevel: (value) => {
958
- if (typeof value === 'number') {
959
- return { type: 'number', minimum: 0 };
960
- }
961
- else {
962
- return { type: 'string' };
963
- }
964
- },
965
- schemaDefinitionsTagName: { type: 'string' },
966
- minCharacterLengthToInitSearch: { type: 'number', minimum: 1 },
967
- maxResponseHeadersToShowInTryIt: { type: 'number', minimum: 0 },
968
- scrollYOffset: (value) => {
969
- if (typeof value === 'number') {
970
- return { type: 'number' };
971
- }
972
- else {
973
- return { type: 'string' };
974
- }
975
- },
976
- searchAutoExpand: { type: 'boolean' },
977
- searchFieldLevelBoost: { type: 'number', minimum: 0 },
978
- searchMaxDepth: { type: 'number', minimum: 1 },
979
- searchMode: { enum: ['default', 'path-only'] },
980
- searchOperationTitleBoost: { type: 'number' },
981
- searchTagTitleBoost: { type: 'number' },
982
- sendXUserAgentInTryIt: { type: 'boolean' },
983
- showChangeLayoutButton: { type: 'boolean' },
984
- showConsole: { type: 'boolean' }, // deprecated
985
- showExtensions: (value) => {
986
- if (typeof value === 'boolean') {
987
- return { type: 'boolean' };
988
- }
989
- else {
990
- return {
991
- type: 'array',
992
- items: {
993
- type: 'string',
994
- },
995
- };
996
- }
997
- },
998
- showNextButton: { type: 'boolean' },
999
- showRightPanelToggle: { type: 'boolean' },
1000
- showSecuritySchemeType: { type: 'boolean' },
1001
- showWebhookVerb: { type: 'boolean' },
1002
- showObjectSchemaExamples: { type: 'boolean' },
1003
- disableTryItRequestUrlEncoding: { type: 'boolean' },
1004
- sidebarLinks: 'ConfigSidebarLinks',
1005
- sideNavStyle: { enum: ['summary-only', 'path-first', 'id-only', 'path-only'] },
1006
- simpleOneOfTypeLabel: { type: 'boolean' },
1007
- sortEnumValuesAlphabetically: { type: 'boolean' },
1008
- sortOperationsAlphabetically: { type: 'boolean' },
1009
- sortPropsAlphabetically: { type: 'boolean' },
1010
- sortTagsAlphabetically: { type: 'boolean' },
1011
- suppressWarnings: { type: 'boolean' }, // deprecated
1012
- unstable_externalDescription: { type: 'boolean' }, // deprecated
1013
- unstable_ignoreMimeParameters: { type: 'boolean' },
1014
- untrustedDefinition: { type: 'boolean' },
1015
- mockServer: {
1016
- properties: {
1017
- url: { type: 'string' },
1018
- position: { enum: ['first', 'last', 'replace', 'off'] },
1019
- description: { type: 'string' },
1020
- },
1021
- },
1022
- showAccessMode: { type: 'boolean' },
1023
- preserveOriginalExtensionsName: { type: 'boolean' },
1024
- markdownHeadingsAnchorLevel: { type: 'number' },
1025
- },
1026
- additionalProperties: {},
1027
- };
1028
- const ConfigMockServer = {
1029
- properties: {
1030
- strictExamples: { type: 'boolean' },
1031
- errorIfForcedExampleNotFound: { type: 'boolean' },
1032
- },
1033
- };
1034
348
  export function createConfigTypes(extraSchemas, config) {
1035
349
  const nodeNames = Object.values(SpecVersion).flatMap((version) => {
1036
350
  const types = config?.styleguide
@@ -1052,62 +366,11 @@ const CoreConfigTypes = {
1052
366
  Assert,
1053
367
  ConfigApis,
1054
368
  ConfigStyleguide,
1055
- ConfigReferenceDocs,
1056
- ConfigMockServer,
1057
369
  ConfigHTTP,
1058
- ConfigLanguage,
1059
- ConfigLabels,
1060
- ConfigSidebarLinks,
1061
- CommonConfigSidebarLinks,
1062
- ConfigTheme,
1063
370
  AssertDefinition,
1064
- ThemeColors,
1065
- CommonThemeColors,
1066
- BorderThemeColors,
1067
- HttpColors,
1068
- ResponseColors,
1069
- SecondaryColors,
1070
- TextThemeColors,
1071
- Sizes,
1072
- ButtonsConfig,
1073
- CommonColorProps,
1074
- BadgeFontConfig,
1075
- BadgeSizes,
1076
- HttpBadgesConfig,
1077
- LabelControls,
1078
- Panels,
1079
- TryItButton,
1080
- Breakpoints,
1081
- StackedConfig,
1082
- ThreePanelConfig,
1083
- SchemaColorsConfig,
1084
- SizeProps,
1085
- Level1Items,
1086
- SpacingConfig,
1087
- FontConfig,
1088
- CodeConfig,
1089
- HeadingsConfig,
1090
- LinksConfig,
1091
- TokenProps,
1092
- CodeBlock,
1093
- ConfigThemeLogo,
1094
- Fab,
1095
- ButtonOverrides,
1096
- Overrides,
1097
371
  ObjectRule,
1098
372
  Schema,
1099
- RightPanel,
1100
373
  Rules,
1101
- Shape,
1102
- ThemeSpacing,
1103
- GenerateCodeSamples,
1104
- GroupItemsConfig,
1105
- ConfigThemeComponents,
1106
- Layout,
1107
- ConfigThemeSchema,
1108
- Sidebar,
1109
- Heading,
1110
- Typography,
1111
374
  AssertionDefinitionAssertions,
1112
375
  };
1113
376
  export const ConfigTypes = createConfigTypes(rootRedoclyConfigSchema);