@redocly/openapi-core 2.12.6 → 2.13.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.
Files changed (111) hide show
  1. package/lib/bundle/bundle-visitor.d.ts +1 -1
  2. package/lib/bundle/bundle-visitor.d.ts.map +1 -1
  3. package/lib/bundle/bundle-visitor.js +26 -1
  4. package/lib/bundle/bundle-visitor.js.map +1 -1
  5. package/lib/config/all.d.ts.map +1 -1
  6. package/lib/config/all.js +7 -0
  7. package/lib/config/all.js.map +1 -1
  8. package/lib/config/builtIn.d.ts.map +1 -1
  9. package/lib/config/builtIn.js +5 -0
  10. package/lib/config/builtIn.js.map +1 -1
  11. package/lib/config/config-resolvers.d.ts.map +1 -1
  12. package/lib/config/config-resolvers.js +18 -6
  13. package/lib/config/config-resolvers.js.map +1 -1
  14. package/lib/config/config.d.ts +2 -2
  15. package/lib/config/config.d.ts.map +1 -1
  16. package/lib/config/config.js +21 -0
  17. package/lib/config/config.js.map +1 -1
  18. package/lib/config/minimal.d.ts.map +1 -1
  19. package/lib/config/minimal.js +7 -0
  20. package/lib/config/minimal.js.map +1 -1
  21. package/lib/config/recommended-strict.d.ts.map +1 -1
  22. package/lib/config/recommended-strict.js +7 -0
  23. package/lib/config/recommended-strict.js.map +1 -1
  24. package/lib/config/recommended.d.ts.map +1 -1
  25. package/lib/config/recommended.js +7 -0
  26. package/lib/config/recommended.js.map +1 -1
  27. package/lib/config/rules.d.ts +2 -2
  28. package/lib/config/rules.d.ts.map +1 -1
  29. package/lib/config/rules.js.map +1 -1
  30. package/lib/config/spec.d.ts.map +1 -1
  31. package/lib/config/spec.js +7 -0
  32. package/lib/config/spec.js.map +1 -1
  33. package/lib/config/types.d.ts +8 -2
  34. package/lib/config/types.d.ts.map +1 -1
  35. package/lib/config/utils.d.ts +2 -2
  36. package/lib/config/utils.d.ts.map +1 -1
  37. package/lib/config/utils.js +9 -0
  38. package/lib/config/utils.js.map +1 -1
  39. package/lib/decorators/openrpc/index.d.ts +2 -0
  40. package/lib/decorators/openrpc/index.d.ts.map +1 -0
  41. package/lib/decorators/openrpc/index.js +2 -0
  42. package/lib/decorators/openrpc/index.js.map +1 -0
  43. package/lib/detect-spec.d.ts +1 -1
  44. package/lib/detect-spec.d.ts.map +1 -1
  45. package/lib/detect-spec.js +7 -0
  46. package/lib/detect-spec.js.map +1 -1
  47. package/lib/index.d.ts +3 -1
  48. package/lib/index.d.ts.map +1 -1
  49. package/lib/index.js +1 -0
  50. package/lib/index.js.map +1 -1
  51. package/lib/lint.d.ts.map +1 -1
  52. package/lib/lint.js.map +1 -1
  53. package/lib/oas-types.d.ts +108 -4
  54. package/lib/oas-types.d.ts.map +1 -1
  55. package/lib/oas-types.js +3 -0
  56. package/lib/oas-types.js.map +1 -1
  57. package/lib/rules/common/struct.d.ts +2 -2
  58. package/lib/rules/common/struct.d.ts.map +1 -1
  59. package/lib/rules/common/struct.js.map +1 -1
  60. package/lib/rules/openrpc/index.d.ts +4 -0
  61. package/lib/rules/openrpc/index.d.ts.map +1 -0
  62. package/lib/rules/openrpc/index.js +20 -0
  63. package/lib/rules/openrpc/index.js.map +1 -0
  64. package/lib/rules/openrpc/no-unused-components.d.ts +3 -0
  65. package/lib/rules/openrpc/no-unused-components.d.ts.map +1 -0
  66. package/lib/rules/openrpc/no-unused-components.js +82 -0
  67. package/lib/rules/openrpc/no-unused-components.js.map +1 -0
  68. package/lib/rules/openrpc/spec-no-duplicated-method-params.d.ts +3 -0
  69. package/lib/rules/openrpc/spec-no-duplicated-method-params.d.ts.map +1 -0
  70. package/lib/rules/openrpc/spec-no-duplicated-method-params.js +28 -0
  71. package/lib/rules/openrpc/spec-no-duplicated-method-params.js.map +1 -0
  72. package/lib/rules/openrpc/spec-no-required-params-after-optional.d.ts +3 -0
  73. package/lib/rules/openrpc/spec-no-required-params-after-optional.d.ts.map +1 -0
  74. package/lib/rules/openrpc/spec-no-required-params-after-optional.js +31 -0
  75. package/lib/rules/openrpc/spec-no-required-params-after-optional.js.map +1 -0
  76. package/lib/types/asyncapi2.d.ts +0 -5
  77. package/lib/types/asyncapi2.d.ts.map +1 -1
  78. package/lib/types/asyncapi2.js +1 -100
  79. package/lib/types/asyncapi2.js.map +1 -1
  80. package/lib/types/asyncapi3.d.ts.map +1 -1
  81. package/lib/types/asyncapi3.js +2 -1
  82. package/lib/types/asyncapi3.js.map +1 -1
  83. package/lib/types/json-schema-draft7.shared.d.ts +7 -0
  84. package/lib/types/json-schema-draft7.shared.d.ts.map +1 -0
  85. package/lib/types/json-schema-draft7.shared.js +101 -0
  86. package/lib/types/json-schema-draft7.shared.js.map +1 -0
  87. package/lib/types/oas3.d.ts.map +1 -1
  88. package/lib/types/oas3.js +1 -0
  89. package/lib/types/oas3.js.map +1 -1
  90. package/lib/types/oas3_1.d.ts.map +1 -1
  91. package/lib/types/oas3_1.js +1 -0
  92. package/lib/types/oas3_1.js.map +1 -1
  93. package/lib/types/oas3_2.d.ts.map +1 -1
  94. package/lib/types/oas3_2.js +1 -0
  95. package/lib/types/oas3_2.js.map +1 -1
  96. package/lib/types/openrpc.d.ts +104 -0
  97. package/lib/types/openrpc.d.ts.map +1 -0
  98. package/lib/types/openrpc.js +206 -0
  99. package/lib/types/openrpc.js.map +1 -0
  100. package/lib/types/redocly-yaml.d.ts +2 -0
  101. package/lib/types/redocly-yaml.d.ts.map +1 -1
  102. package/lib/types/redocly-yaml.js +11 -0
  103. package/lib/types/redocly-yaml.js.map +1 -1
  104. package/lib/typings/openrpc.d.ts +110 -0
  105. package/lib/typings/openrpc.d.ts.map +1 -0
  106. package/lib/typings/openrpc.js +2 -0
  107. package/lib/typings/openrpc.js.map +1 -0
  108. package/lib/visitors.d.ts +34 -0
  109. package/lib/visitors.d.ts.map +1 -1
  110. package/lib/visitors.js.map +1 -1
  111. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- import type { BuiltInAsync2RuleId, BuiltInAsync3RuleId, BuiltInArazzo1RuleId, BuiltInOAS2RuleId, BuiltInOAS3RuleId, BuiltInOverlay1RuleId, BuiltInCommonRuleId } from './types/redocly-yaml.js';
2
- import type { Oas3Rule, Oas3Preprocessor, Oas2Rule, Oas2Preprocessor, Async2Preprocessor, Async2Rule, Async3Preprocessor, Async3Rule, Arazzo1Preprocessor, Arazzo1Rule, Overlay1Preprocessor, Overlay1Rule } from './visitors.js';
3
- export declare const specVersions: readonly ["oas2", "oas3_0", "oas3_1", "oas3_2", "async2", "async3", "arazzo1", "overlay1"];
1
+ import type { BuiltInAsync2RuleId, BuiltInAsync3RuleId, BuiltInArazzo1RuleId, BuiltInOAS2RuleId, BuiltInOAS3RuleId, BuiltInOverlay1RuleId, BuiltInCommonRuleId, BuiltInOpenRpc1RuleId } from './types/redocly-yaml.js';
2
+ import type { Oas3Rule, Oas3Preprocessor, Oas2Rule, Oas2Preprocessor, Async2Preprocessor, Async2Rule, Async3Preprocessor, Async3Rule, Arazzo1Preprocessor, Arazzo1Rule, Overlay1Preprocessor, Overlay1Rule, OpenRpc1Preprocessor, OpenRpc1Rule } from './visitors.js';
3
+ export declare const specVersions: readonly ["oas2", "oas3_0", "oas3_1", "oas3_2", "async2", "async3", "arazzo1", "overlay1", "openrpc1"];
4
4
  export type SpecVersion = typeof specVersions[number];
5
- export type SpecMajorVersion = 'oas2' | 'oas3' | 'async2' | 'async3' | 'arazzo1' | 'overlay1';
5
+ export type SpecMajorVersion = 'oas2' | 'oas3' | 'async2' | 'async3' | 'arazzo1' | 'overlay1' | 'openrpc1';
6
6
  export type RuleMap<Key extends string, RuleConfig, T> = Record<T extends 'built-in' ? Key : string, RuleConfig>;
7
7
  export type Oas3RuleSet<T = undefined> = RuleMap<BuiltInOAS3RuleId | BuiltInCommonRuleId | 'assertions', Oas3Rule, T>;
8
8
  export type Oas2RuleSet<T = undefined> = RuleMap<BuiltInOAS2RuleId | BuiltInCommonRuleId | 'assertions', Oas2Rule, T>;
@@ -10,18 +10,21 @@ export type Async2RuleSet<T = undefined> = RuleMap<BuiltInAsync2RuleId | BuiltIn
10
10
  export type Async3RuleSet<T = undefined> = RuleMap<BuiltInAsync3RuleId | BuiltInCommonRuleId | 'assertions', Async3Rule, T>;
11
11
  export type Arazzo1RuleSet<T = undefined> = RuleMap<BuiltInArazzo1RuleId | BuiltInCommonRuleId | 'assertions', Arazzo1Rule, T>;
12
12
  export type Overlay1RuleSet<T = undefined> = RuleMap<BuiltInOverlay1RuleId | BuiltInCommonRuleId | 'assertions', Overlay1Rule, T>;
13
+ export type OpenRpc1RuleSet<T = undefined> = RuleMap<BuiltInOpenRpc1RuleId | BuiltInCommonRuleId | 'assertions', OpenRpc1Rule, T>;
13
14
  export type Oas3PreprocessorsSet = Record<string, Oas3Preprocessor>;
14
15
  export type Oas2PreprocessorsSet = Record<string, Oas2Preprocessor>;
15
16
  export type Async2PreprocessorsSet = Record<string, Async2Preprocessor>;
16
17
  export type Async3PreprocessorsSet = Record<string, Async3Preprocessor>;
17
18
  export type Arazzo1PreprocessorsSet = Record<string, Arazzo1Preprocessor>;
18
19
  export type Overlay1PreprocessorsSet = Record<string, Overlay1Preprocessor>;
20
+ export type OpenRpc1PreprocessorsSet = Record<string, OpenRpc1Preprocessor>;
19
21
  export type Oas3DecoratorsSet = Record<string, Oas3Preprocessor>;
20
22
  export type Oas2DecoratorsSet = Record<string, Oas2Preprocessor>;
21
23
  export type Async2DecoratorsSet = Record<string, Async2Preprocessor>;
22
24
  export type Async3DecoratorsSet = Record<string, Async3Preprocessor>;
23
25
  export type Arazzo1DecoratorsSet = Record<string, Arazzo1Preprocessor>;
24
26
  export type Overlay1DecoratorsSet = Record<string, Overlay1Preprocessor>;
27
+ export type OpenRpc1DecoratorsSet = Record<string, OpenRpc1Preprocessor>;
25
28
  export declare function getTypes(spec: SpecVersion): Record<string, import("./index.js").NodeType> | {
26
29
  readonly Root: import("./index.js").NodeType;
27
30
  readonly Tag: import("./index.js").NodeType;
@@ -572,5 +575,106 @@ export declare function getTypes(spec: SpecVersion): Record<string, import("./in
572
575
  };
573
576
  readonly XUsePkce: import("./index.js").NodeType;
574
577
  readonly WebhooksMap: import("./index.js").NodeType;
578
+ } | {
579
+ readonly Root: import("./index.js").NodeType;
580
+ readonly Info: import("./index.js").NodeType;
581
+ readonly Contact: import("./index.js").NodeType;
582
+ readonly License: import("./index.js").NodeType;
583
+ readonly Server: import("./index.js").NodeType;
584
+ readonly ServerList: {
585
+ name: string;
586
+ properties: {};
587
+ items: string;
588
+ };
589
+ readonly ServerVariable: import("./index.js").NodeType;
590
+ readonly ServerVariablesMap: {
591
+ name: string;
592
+ properties: {};
593
+ additionalProperties: () => string;
594
+ };
595
+ readonly Method: import("./index.js").NodeType;
596
+ readonly MethodList: {
597
+ name: string;
598
+ properties: {};
599
+ items: string;
600
+ };
601
+ readonly ContentDescriptor: import("./index.js").NodeType;
602
+ readonly ContentDescriptorList: {
603
+ name: string;
604
+ properties: {};
605
+ items: string;
606
+ };
607
+ readonly ExamplePairing: import("./index.js").NodeType;
608
+ readonly ExamplePairingList: {
609
+ name: string;
610
+ properties: {};
611
+ items: string;
612
+ };
613
+ readonly Example: import("./index.js").NodeType;
614
+ readonly ExampleList: {
615
+ name: string;
616
+ properties: {};
617
+ items: string;
618
+ };
619
+ readonly Link: import("./index.js").NodeType;
620
+ readonly LinkList: {
621
+ name: string;
622
+ properties: {};
623
+ items: string;
624
+ };
625
+ readonly ErrorObject: import("./index.js").NodeType;
626
+ readonly ErrorList: {
627
+ name: string;
628
+ properties: {};
629
+ items: string;
630
+ };
631
+ readonly Components: import("./index.js").NodeType;
632
+ readonly Tag: import("./index.js").NodeType;
633
+ readonly TagList: {
634
+ name: string;
635
+ properties: {};
636
+ items: string;
637
+ };
638
+ readonly ExternalDocs: import("./index.js").NodeType;
639
+ readonly Schema: import("./index.js").NodeType;
640
+ readonly SchemaProperties: import("./index.js").NodeType;
641
+ readonly Dependencies: import("./index.js").NodeType;
642
+ readonly DiscriminatorMapping: import("./index.js").NodeType;
643
+ readonly Discriminator: import("./index.js").NodeType;
644
+ readonly NamedContentDescriptors: {
645
+ name: string;
646
+ properties: {};
647
+ additionalProperties: () => string;
648
+ };
649
+ readonly NamedSchemas: {
650
+ name: string;
651
+ properties: {};
652
+ additionalProperties: () => string;
653
+ };
654
+ readonly NamedExamples: {
655
+ name: string;
656
+ properties: {};
657
+ additionalProperties: () => string;
658
+ };
659
+ readonly NamedLinks: {
660
+ name: string;
661
+ properties: {};
662
+ additionalProperties: () => string;
663
+ };
664
+ readonly NamedErrors: {
665
+ name: string;
666
+ properties: {};
667
+ additionalProperties: () => string;
668
+ };
669
+ readonly NamedExamplePairingObjects: {
670
+ name: string;
671
+ properties: {};
672
+ additionalProperties: () => string;
673
+ };
674
+ readonly NamedTags: {
675
+ name: string;
676
+ properties: {};
677
+ additionalProperties: () => string;
678
+ };
575
679
  };
576
680
  //# sourceMappingURL=oas-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oas-types.d.ts","sourceRoot":"","sources":["../src/oas-types.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,YAAY,4FASf,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAa9F,MAAM,MAAM,OAAO,CAAC,GAAG,SAAS,MAAM,EAAE,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEzC"}
package/lib/oas-types.js CHANGED
@@ -6,6 +6,7 @@ import { AsyncApi2Types } from './types/asyncapi2.js';
6
6
  import { AsyncApi3Types } from './types/asyncapi3.js';
7
7
  import { Arazzo1Types } from './types/arazzo.js';
8
8
  import { Overlay1Types } from './types/overlay.js';
9
+ import { OpenRpcTypes } from './types/openrpc.js';
9
10
  export const specVersions = [
10
11
  'oas2',
11
12
  'oas3_0',
@@ -15,6 +16,7 @@ export const specVersions = [
15
16
  'async3',
16
17
  'arazzo1',
17
18
  'overlay1',
19
+ 'openrpc1',
18
20
  ];
19
21
  const typesMap = {
20
22
  oas2: Oas2Types,
@@ -25,6 +27,7 @@ const typesMap = {
25
27
  async3: AsyncApi3Types,
26
28
  arazzo1: Arazzo1Types,
27
29
  overlay1: Overlay1Types,
30
+ openrpc1: OpenRpcTypes,
28
31
  };
29
32
  export function getTypes(spec) {
30
33
  return typesMap[spec];
@@ -1 +1 @@
1
- {"version":3,"file":"oas-types.js","sourceRoot":"","sources":["../src/oas-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA0BnD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;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AAE,YAAY;IACrB,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,YAAY;CACvB,CAAC;AA4DF,MAAM,UAAU,QAAQ,CAAC,IAAiB;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { Oas3Rule, Oas2Rule, Async2Rule, Async3Rule, Arazzo1Rule, Overlay1Rule } from '../../visitors.js';
2
- export declare const Struct: Oas3Rule | Oas2Rule | Async2Rule | Async3Rule | Arazzo1Rule | Overlay1Rule;
1
+ import type { Oas3Rule, Oas2Rule, Async2Rule, Async3Rule, Arazzo1Rule, Overlay1Rule, OpenRpc1Rule } from '../../visitors.js';
2
+ export declare const Struct: Oas3Rule | Oas2Rule | Async2Rule | Async3Rule | Arazzo1Rule | Overlay1Rule | OpenRpc1Rule;
3
3
  //# sourceMappingURL=struct.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"struct.d.ts","sourceRoot":"","sources":["../../../src/rules/common/struct.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,MAAM,EACf,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,UAAU,GACV,WAAW,GACX,YAgKH,CAAC"}
1
+ {"version":3,"file":"struct.d.ts","sourceRoot":"","sources":["../../../src/rules/common/struct.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,MAAM,EACf,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAgKH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../src/rules/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I,OAAO,UAAU,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC3C,IAAI,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACxC,MAAM,CAAC;4BACL,OAAO,EAAE,oBAAoB,QAAQ,2CAA2C,UAAU,CAAC,OAAO,EAAE;4BACpG,IAAI,EAAE,WAAW;4BACjB,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;yBACrC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { OpenRpc1RuleSet } from '../../oas-types.js';
2
+ export declare const rules: OpenRpc1RuleSet<'built-in'>;
3
+ export declare const preprocessors: {};
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/openrpc/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,KAAK,EAAE,eAAe,CAAC,UAAU,CAS7C,CAAC;AAEF,eAAO,MAAM,aAAa,IAAK,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Struct } from '../common/struct.js';
2
+ import { NoUnresolvedRefs } from '../common/no-unresolved-refs.js';
3
+ import { Assertions } from '../common/assertions/index.js';
4
+ import { NoUnusedComponents } from './no-unused-components.js';
5
+ import { NoDuplicatedMethodParams } from './spec-no-duplicated-method-params.js';
6
+ import { NoRequiredParamsAfterOptional } from './spec-no-required-params-after-optional.js';
7
+ import { InfoLicense } from '../common/info-license.js';
8
+ import { InfoContact } from '../common/info-contact.js';
9
+ export const rules = {
10
+ struct: Struct,
11
+ 'no-unresolved-refs': NoUnresolvedRefs,
12
+ assertions: Assertions,
13
+ 'info-license': InfoLicense,
14
+ 'no-unused-components': NoUnusedComponents,
15
+ 'info-contact': InfoContact,
16
+ 'spec-no-duplicated-method-params': NoDuplicatedMethodParams,
17
+ 'spec-no-required-params-after-optional': NoRequiredParamsAfterOptional,
18
+ };
19
+ export const preprocessors = {};
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/openrpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAKxD,MAAM,CAAC,MAAM,KAAK,GAAgC;IAChD,MAAM,EAAE,MAAsB;IAC9B,oBAAoB,EAAE,gBAAgC;IACtD,UAAU,EAAE,UAA0B;IACtC,cAAc,EAAE,WAA2B;IAC3C,sBAAsB,EAAE,kBAAkB;IAC1C,cAAc,EAAE,WAA2B;IAC3C,kCAAkC,EAAE,wBAAwB;IAC5D,wCAAwC,EAAE,6BAA6B;CACxE,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { OpenRpc1Rule } from '../../visitors.js';
2
+ export declare const NoUnusedComponents: OpenRpc1Rule;
3
+ //# sourceMappingURL=no-unused-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-unused-components.d.ts","sourceRoot":"","sources":["../../../src/rules/openrpc/no-unused-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,kBAAkB,EAAE,YAmFhC,CAAC"}
@@ -0,0 +1,82 @@
1
+ export const NoUnusedComponents = () => {
2
+ const components = new Map();
3
+ function registerComponent(location, name) {
4
+ components.set(location.absolutePointer, {
5
+ used: components.get(location.absolutePointer)?.used || false,
6
+ location,
7
+ name,
8
+ });
9
+ }
10
+ return {
11
+ ref(ref, { type, resolve, key, location }) {
12
+ if ([
13
+ 'Schema',
14
+ 'ContentDescriptor',
15
+ 'Example',
16
+ 'Link',
17
+ 'ErrorObject',
18
+ 'ExamplePairing',
19
+ 'Tag',
20
+ ].includes(type.name)) {
21
+ const resolvedRef = resolve(ref);
22
+ if (!resolvedRef.location)
23
+ return;
24
+ components.set(resolvedRef.location.absolutePointer, {
25
+ used: true,
26
+ name: key.toString(),
27
+ location,
28
+ });
29
+ }
30
+ },
31
+ Root: {
32
+ leave(_, { report }) {
33
+ components.forEach((usageInfo) => {
34
+ if (!usageInfo.used) {
35
+ report({
36
+ message: `Component: "${usageInfo.name}" is never used.`,
37
+ location: usageInfo.location.key(),
38
+ });
39
+ }
40
+ });
41
+ },
42
+ },
43
+ NamedSchemas: {
44
+ Schema(schema, { location, key }) {
45
+ if (!schema.allOf) {
46
+ registerComponent(location, key.toString());
47
+ }
48
+ },
49
+ },
50
+ NamedContentDescriptors: {
51
+ ContentDescriptor(_node, { location, key }) {
52
+ registerComponent(location, key.toString());
53
+ },
54
+ },
55
+ NamedExamples: {
56
+ Example(_node, { location, key }) {
57
+ registerComponent(location, key.toString());
58
+ },
59
+ },
60
+ NamedLinks: {
61
+ Link(_node, { location, key }) {
62
+ registerComponent(location, key.toString());
63
+ },
64
+ },
65
+ NamedErrors: {
66
+ ErrorObject(_node, { location, key }) {
67
+ registerComponent(location, key.toString());
68
+ },
69
+ },
70
+ NamedExamplePairingObjects: {
71
+ ExamplePairing(_node, { location, key }) {
72
+ registerComponent(location, key.toString());
73
+ },
74
+ },
75
+ NamedTags: {
76
+ Tag(_node, { location, key }) {
77
+ registerComponent(location, key.toString());
78
+ },
79
+ },
80
+ };
81
+ };
82
+ //# sourceMappingURL=no-unused-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-unused-components.js","sourceRoot":"","sources":["../../../src/rules/openrpc/no-unused-components.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,kBAAkB,GAAiB,GAAG,EAAE;IACnD,MAAM,UAAU,GAAG,IAAI,GAAG,EAA+D,CAAC;IAE1F,SAAS,iBAAiB,CAAC,QAAkB,EAAE,IAAY;QACzD,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,eAAe,EAAE;YACvC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,IAAI,IAAI,KAAK;YAC7D,QAAQ;YACR,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,GAAG,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE;YACvC,IACE;gBACE,QAAQ;gBACR,mBAAmB;gBACnB,SAAS;gBACT,MAAM;gBACN,aAAa;gBACb,gBAAgB;gBAChB,KAAK;aACN,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EACrB,CAAC;gBACD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;gBACjC,IAAI,CAAC,WAAW,CAAC,QAAQ;oBAAE,OAAO;gBAClC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,eAAe,EAAE;oBACnD,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE;oBACpB,QAAQ;iBACT,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,IAAI,EAAE;YACJ,KAAK,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE;gBACjB,UAAU,CAAC,OAA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K,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;gBACrC,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC9C,CAAC;SACF;QACD,SAAS,EAAE;YACT,GAAG,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;gBAC1B,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC9C,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { OpenRpc1Rule } from '../../visitors.js';
2
+ export declare const NoDuplicatedMethodParams: OpenRpc1Rule;
3
+ //# sourceMappingURL=spec-no-duplicated-method-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-no-duplicated-method-params.d.ts","sourceRoot":"","sources":["../../../src/rules/openrpc/spec-no-duplicated-method-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,wBAAwB,EAAE,YA2BtC,CAAC"}
@@ -0,0 +1,28 @@
1
+ export const NoDuplicatedMethodParams = () => {
2
+ return {
3
+ Method: {
4
+ leave(method, { report, resolve, location }) {
5
+ if (!method.params || !Array.isArray(method.params))
6
+ return;
7
+ const seenParams = new Set();
8
+ method.params.forEach((paramOrRef, index) => {
9
+ const resolved = resolve(paramOrRef);
10
+ if (!resolved.node)
11
+ return;
12
+ const param = resolved.node;
13
+ const paramName = param.name;
14
+ if (!paramName)
15
+ return;
16
+ if (seenParams.has(paramName)) {
17
+ report({
18
+ message: `Parameter names must be unique. Duplicate parameter name '${param.name}' found.`,
19
+ location: location.child([index, 'name']),
20
+ });
21
+ }
22
+ seenParams.add(paramName);
23
+ });
24
+ },
25
+ },
26
+ };
27
+ };
28
+ //# sourceMappingURL=spec-no-duplicated-method-params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-no-duplicated-method-params.js","sourceRoot":"","sources":["../../../src/rules/openrpc/spec-no-duplicated-method-params.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAiB,GAAG,EAAE;IACzD,OAAO;QACL,MAAM,EAAE;YACN,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;gBACzC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;oBAAE,OAAO;gBAE5D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;gBAErC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;oBAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;oBACrC,IAAI,CAAC,QAAQ,CAAC,IAAI;wBAAE,OAAO;oBAE3B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC;oBAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;oBAC7B,IAAI,CAAC,SAAS;wBAAE,OAAO;oBAEvB,IAAI,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC9B,MAAM,CAAC;4BACL,OAAO,EAAE,6DAA6D,KAAK,CAAC,IAAI,UAAU;4BAC1F,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;yBAC1C,CAAC,CAAC;oBACL,CAAC;oBACD,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { OpenRpc1Rule } from '../../visitors.js';
2
+ export declare const NoRequiredParamsAfterOptional: OpenRpc1Rule;
3
+ //# sourceMappingURL=spec-no-required-params-after-optional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-no-required-params-after-optional.d.ts","sourceRoot":"","sources":["../../../src/rules/openrpc/spec-no-required-params-after-optional.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,6BAA6B,EAAE,YA8B3C,CAAC"}
@@ -0,0 +1,31 @@
1
+ export const NoRequiredParamsAfterOptional = () => {
2
+ return {
3
+ Method: {
4
+ leave(method, { report, resolve, location }) {
5
+ if (!method.params || !Array.isArray(method.params))
6
+ return;
7
+ let foundOptional = false;
8
+ method.params.forEach((paramOrRef, index) => {
9
+ const resolved = resolve(paramOrRef);
10
+ if (!resolved.node)
11
+ return;
12
+ const param = resolved.node;
13
+ const paramName = param.name;
14
+ if (!paramName)
15
+ return;
16
+ const isRequired = param.required === true;
17
+ if (!isRequired) {
18
+ foundOptional = true;
19
+ }
20
+ else if (foundOptional) {
21
+ report({
22
+ message: `Required parameter '${param.name}' must be positioned before optional parameters.`,
23
+ location: location.child([index, 'name']),
24
+ });
25
+ }
26
+ });
27
+ },
28
+ },
29
+ };
30
+ };
31
+ //# sourceMappingURL=spec-no-required-params-after-optional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-no-required-params-after-optional.js","sourceRoot":"","sources":["../../../src/rules/openrpc/spec-no-required-params-after-optional.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAiB,GAAG,EAAE;IAC9D,OAAO;QACL,MAAM,EAAE;YACN,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;gBACzC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;oBAAE,OAAO;gBAE5D,IAAI,aAAa,GAAG,KAAK,CAAC;gBAE1B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;oBAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;oBACrC,IAAI,CAAC,QAAQ,CAAC,IAAI;wBAAE,OAAO;oBAE3B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC;oBAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;oBAC7B,IAAI,CAAC,SAAS;wBAAE,OAAO;oBAEvB,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;oBAE3C,IAAI,CAAC,UAAU,EAAE,CAAC;wBAChB,aAAa,GAAG,IAAI,CAAC;oBACvB,CAAC;yBAAM,IAAI,aAAa,EAAE,CAAC;wBACzB,MAAM,CAAC;4BACL,OAAO,EAAE,uBAAuB,KAAK,CAAC,IAAI,kDAAkD;4BAC5F,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;yBAC1C,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -7,12 +7,7 @@ export declare const Contact: NodeType;
7
7
  export declare const License: NodeType;
8
8
  export declare const CorrelationId: NodeType;
9
9
  export declare const MessageExample: NodeType;
10
- export declare const Schema: NodeType;
11
- export declare const SchemaProperties: NodeType;
12
- export declare const DiscriminatorMapping: NodeType;
13
- export declare const Discriminator: NodeType;
14
10
  export declare const SecuritySchemeFlows: NodeType;
15
- export declare const Dependencies: NodeType;
16
11
  export declare const AsyncApi2Bindings: Record<string, NodeType>;
17
12
  export declare const AsyncApi2Types: Record<string, NodeType>;
18
13
  //# sourceMappingURL=asyncapi2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asyncapi2.d.ts","sourceRoot":"","sources":["../../src/types/asyncapi2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY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F,eAAO,MAAM,cAAc,EAAE,QAO5B,CAAC;AA0DF,eAAO,MAAM,mBAAmB,EAAE,QAOjC,CAAC;AAyeF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA8EtD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAiDnD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { listOf, mapOf } from './index.js';
2
- import { isMappingRef } from '../ref-utils.js';
2
+ import { Dependencies, Discriminator, DiscriminatorMapping, Schema, SchemaProperties, } from './json-schema-draft7.shared.js';
3
3
  const Root = {
4
4
  properties: {
5
5
  asyncapi: null, // TODO: validate semver format and supported version
@@ -304,99 +304,6 @@ export const MessageExample = {
304
304
  headers: { type: 'object' },
305
305
  },
306
306
  };
307
- export const Schema = {
308
- properties: {
309
- $id: { type: 'string' },
310
- $schema: { type: 'string' },
311
- definitions: 'NamedSchemas',
312
- externalDocs: 'ExternalDocs',
313
- discriminator: 'Discriminator',
314
- myArbitraryKeyword: { type: 'boolean' },
315
- title: { type: 'string' },
316
- multipleOf: { type: 'number', minimum: 0 },
317
- maximum: { type: 'number' },
318
- minimum: { type: 'number' },
319
- exclusiveMaximum: { type: 'number' },
320
- exclusiveMinimum: { type: 'number' },
321
- maxLength: { type: 'integer', minimum: 0 },
322
- minLength: { type: 'integer', minimum: 0 },
323
- pattern: { type: 'string' },
324
- maxItems: { type: 'integer', minimum: 0 },
325
- minItems: { type: 'integer', minimum: 0 },
326
- uniqueItems: { type: 'boolean' },
327
- maxProperties: { type: 'integer', minimum: 0 },
328
- minProperties: { type: 'integer', minimum: 0 },
329
- required: { type: 'array', items: { type: 'string' } },
330
- enum: { type: 'array' },
331
- type: (value) => {
332
- return Array.isArray(value)
333
- ? {
334
- type: 'array',
335
- items: { enum: ['object', 'array', 'string', 'number', 'integer', 'boolean', 'null'] },
336
- }
337
- : {
338
- enum: ['object', 'array', 'string', 'number', 'integer', 'boolean', 'null'],
339
- };
340
- },
341
- allOf: listOf('Schema'),
342
- anyOf: listOf('Schema'),
343
- oneOf: listOf('Schema'),
344
- not: 'Schema',
345
- if: 'Schema',
346
- then: 'Schema',
347
- else: 'Schema',
348
- contains: 'Schema',
349
- patternProperties: { type: 'object' },
350
- propertyNames: 'Schema',
351
- properties: 'SchemaProperties',
352
- items: (value) => {
353
- return Array.isArray(value) ? listOf('Schema') : 'Schema';
354
- },
355
- additionalProperties: (value) => {
356
- return typeof value === 'boolean' ? { type: 'boolean' } : 'Schema';
357
- },
358
- description: { type: 'string' },
359
- format: { type: 'string' },
360
- contentEncoding: { type: 'string' },
361
- contentMediaType: { type: 'string' },
362
- default: null,
363
- readOnly: { type: 'boolean' },
364
- writeOnly: { type: 'boolean' },
365
- examples: { type: 'array' },
366
- example: { isExample: true },
367
- deprecated: { type: 'boolean' },
368
- const: null,
369
- $comment: { type: 'string' },
370
- additionalItems: (value) => {
371
- return typeof value === 'boolean' ? { type: 'boolean' } : 'Schema';
372
- },
373
- dependencies: 'Dependencies',
374
- },
375
- };
376
- export const SchemaProperties = {
377
- properties: {},
378
- additionalProperties: (value) => {
379
- return typeof value === 'boolean' ? { type: 'boolean' } : 'Schema';
380
- },
381
- };
382
- export const DiscriminatorMapping = {
383
- properties: {},
384
- additionalProperties: (value) => {
385
- if (isMappingRef(value)) {
386
- return { type: 'string', directResolveAs: 'Schema' };
387
- }
388
- else {
389
- return { type: 'string' };
390
- }
391
- },
392
- };
393
- export const Discriminator = {
394
- properties: {
395
- propertyName: { type: 'string' },
396
- mapping: 'DiscriminatorMapping',
397
- },
398
- required: ['propertyName'],
399
- };
400
307
  const Components = {
401
308
  properties: {
402
309
  messages: 'NamedMessages',
@@ -517,12 +424,6 @@ const SecurityScheme = {
517
424
  },
518
425
  extensionsPrefix: 'x-',
519
426
  };
520
- export const Dependencies = {
521
- properties: {},
522
- additionalProperties: (value) => {
523
- return Array.isArray(value) ? { type: 'array', items: { type: 'string' } } : 'Schema';
524
- },
525
- };
526
427
  // --- Per-protocol node types
527
428
  // http
528
429
  const HttpChannelBinding = {