@redocly/config-rules-builder 0.1.6 → 0.2.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/README.md +37 -14
- package/dist/components/AssertionsEditor.d.ts +3 -3
- package/dist/components/ConfigPreview.d.ts +1 -1
- package/dist/components/ImportPanel.d.ts +1 -1
- package/dist/components/Modal.d.ts +1 -1
- package/dist/components/ProblemsPanel.d.ts +1 -1
- package/dist/components/RuleCard.d.ts +3 -3
- package/dist/components/RuleList.d.ts +3 -3
- package/dist/components/RulesBuilder.d.ts +2 -2
- package/dist/components/SpecPanel.d.ts +2 -2
- package/dist/components/SubjectEditor.d.ts +2 -2
- package/dist/components/controls/SeverityPill.d.ts +1 -1
- package/dist/components/controls/primitives.d.ts +16 -16
- package/dist/config-rules-builder.js +1057 -1760
- package/dist/config-rules-builder.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/engine/__tests__/fixtures/sample-spec.d.ts +1 -0
- package/dist/engine/evaluate.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/normalize.d.ts +27 -27
- package/dist/state.d.ts +1 -1
- package/dist/styles.d.ts +1 -1
- package/dist/validation.d.ts +1 -1
- package/dist/yaml/parse.d.ts +1 -1
- package/dist/yaml/serialize.d.ts +1 -1
- package/package.json +4 -5
- package/dist/default-spec.d.ts +0 -1
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionKey, CasingStyle } from './types';
|
|
1
|
+
import type { AssertionKey, CasingStyle } from './types';
|
|
2
2
|
export declare const CASING_STYLES: CasingStyle[];
|
|
3
3
|
export declare const NODE_TYPES: string[];
|
|
4
4
|
export type AssertionValueKind = 'casing' | 'text' | 'regex' | 'stringList' | 'number' | 'boolean' | 'refValue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SAMPLE_SPEC = "openapi: 3.1.0\ninfo:\n title: Redocly Cafe\n version: 1.0.0\ntags:\n - name: Menu\n description: Manage the menu.\n - name: Orders\n description: Manage orders.\npaths:\n /menu:\n get:\n tags: [Menu]\n summary: List menu items\n responses:\n '200':\n description: The menu.\n post:\n tags: [Menu]\n summary: Create a menu item\n responses:\n '201':\n description: Created.\n '400':\n description: Invalid item.\n /orders:\n get:\n tags: [Orders]\n summary: List orders\n responses:\n '200':\n description: The orders.\n /orders/{orderId}:\n delete:\n tags: [Orders]\n summary: Cancel an order\n responses:\n '204':\n description: Cancelled.\n";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EvaluationResult, NamedRule } from '../types';
|
|
1
|
+
import type { EvaluationResult, NamedRule } from '../types';
|
|
2
2
|
export declare function evaluateRules(specText: string, rules: NamedRule[], fileName?: string): Promise<EvaluationResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,4 @@ export { RulesBuilder, type RulesBuilderProps } from './components/RulesBuilder'
|
|
|
2
2
|
export { evaluateRules } from './engine/evaluate';
|
|
3
3
|
export { serializeRules } from './yaml/serialize';
|
|
4
4
|
export { parseImportedRules, type ImportResult } from './yaml/parse';
|
|
5
|
-
export { DEFAULT_SPEC } from './default-spec';
|
|
6
5
|
export type { AssertionKey, AssertionObject, CasingStyle, ConfigurableRule, EvaluationResult, HostAdapters, MatchedNode, NamedRule, ProblemInfo, Severity, SubjectObject, WhereObject, } from './types';
|
package/dist/normalize.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { ConfigurableRule, SubjectObject } from './types';
|
|
1
|
+
import type { ConfigurableRule, SubjectObject } from './types';
|
|
2
2
|
export declare function pruneRule(rule: ConfigurableRule): {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
subject: {
|
|
4
|
+
type: string;
|
|
5
|
+
property?: string | string[] | undefined;
|
|
6
|
+
filterInParentKeys?: string[] | undefined;
|
|
7
|
+
filterOutParentKeys?: string[] | undefined;
|
|
8
|
+
matchParentKeys?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
assertions: import("./types").AssertionObject;
|
|
7
11
|
where?: {
|
|
8
12
|
subject: {
|
|
9
|
-
matchParentKeys?: string | undefined;
|
|
10
|
-
filterOutParentKeys?: string[] | undefined;
|
|
11
|
-
filterInParentKeys?: string[] | undefined;
|
|
12
|
-
property?: string | string[] | undefined;
|
|
13
13
|
type: string;
|
|
14
|
+
property?: string | string[] | undefined;
|
|
15
|
+
filterInParentKeys?: string[] | undefined;
|
|
16
|
+
filterOutParentKeys?: string[] | undefined;
|
|
17
|
+
matchParentKeys?: string | undefined;
|
|
14
18
|
};
|
|
15
|
-
assertions: import(
|
|
19
|
+
assertions: import("./types").AssertionObject;
|
|
16
20
|
}[] | undefined;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
property?: string | string[] | undefined;
|
|
22
|
-
type: string;
|
|
23
|
-
};
|
|
24
|
-
assertions: import('./types').AssertionObject;
|
|
21
|
+
message?: string | undefined;
|
|
22
|
+
suggest?: string[] | undefined;
|
|
23
|
+
reference?: string | undefined;
|
|
24
|
+
severity?: "off" | "warn" | undefined;
|
|
25
25
|
};
|
|
26
26
|
export declare function pruneWhere(where: ConfigurableRule['where']): {
|
|
27
27
|
subject: {
|
|
28
|
-
matchParentKeys?: string | undefined;
|
|
29
|
-
filterOutParentKeys?: string[] | undefined;
|
|
30
|
-
filterInParentKeys?: string[] | undefined;
|
|
31
|
-
property?: string | string[] | undefined;
|
|
32
28
|
type: string;
|
|
29
|
+
property?: string | string[] | undefined;
|
|
30
|
+
filterInParentKeys?: string[] | undefined;
|
|
31
|
+
filterOutParentKeys?: string[] | undefined;
|
|
32
|
+
matchParentKeys?: string | undefined;
|
|
33
33
|
};
|
|
34
|
-
assertions: import(
|
|
34
|
+
assertions: import("./types").AssertionObject;
|
|
35
35
|
}[] | undefined;
|
|
36
36
|
export declare function cleanSubject(subject: SubjectObject): {
|
|
37
|
-
matchParentKeys?: string | undefined;
|
|
38
|
-
filterOutParentKeys?: string[] | undefined;
|
|
39
|
-
filterInParentKeys?: string[] | undefined;
|
|
40
|
-
property?: string | string[] | undefined;
|
|
41
37
|
type: string;
|
|
38
|
+
property?: string | string[] | undefined;
|
|
39
|
+
filterInParentKeys?: string[] | undefined;
|
|
40
|
+
filterOutParentKeys?: string[] | undefined;
|
|
41
|
+
matchParentKeys?: string | undefined;
|
|
42
42
|
};
|
|
43
43
|
export declare function ruleId(name: string, index: number): string;
|
package/dist/state.d.ts
CHANGED
package/dist/styles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Severity } from './types';
|
|
1
|
+
import type { Severity } from './types';
|
|
2
2
|
export declare const FONT_FAMILY = "var(--font-family-base, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)";
|
|
3
3
|
export declare const MONO_FONT_FAMILY = "var(--font-family-monospaced, 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, Monaco, 'Courier New', monospace)";
|
|
4
4
|
export type SectionTone = 'subject' | 'where' | 'assert' | 'message' | 'suggest';
|
package/dist/validation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableRule, SubjectObject } from './types';
|
|
1
|
+
import type { ConfigurableRule, SubjectObject } from './types';
|
|
2
2
|
export type RuleErrors = Record<string, string>;
|
|
3
3
|
export declare function hasSubjectProperty(subject: SubjectObject): boolean;
|
|
4
4
|
export declare function validateRule(name: string, rule: ConfigurableRule): RuleErrors;
|
package/dist/yaml/parse.d.ts
CHANGED
package/dist/yaml/serialize.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { NamedRule } from '../types';
|
|
1
|
+
import type { NamedRule } from '../types';
|
|
2
2
|
export declare function serializeRules(rules: NamedRule[]): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/config-rules-builder",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Visual builder for Redocly configurable rules (rule/*) with live matching against an OpenAPI document",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"redocly",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@codemirror/language": "^6.11.3",
|
|
37
37
|
"@codemirror/state": "^6.5.2",
|
|
38
38
|
"@codemirror/view": "^6.25.1",
|
|
39
|
-
"@redocly/openapi-core": "2.
|
|
39
|
+
"@redocly/openapi-core": "2.73.0",
|
|
40
40
|
"js-yaml": "4.3.2",
|
|
41
41
|
"yaml-ast-parser": "0.0.43"
|
|
42
42
|
},
|
|
@@ -56,16 +56,15 @@
|
|
|
56
56
|
"styled-components": "^6.4.2",
|
|
57
57
|
"typescript": "6.0.3",
|
|
58
58
|
"vite": "8.3.3",
|
|
59
|
-
"vite-plugin-dts": "4.5.4",
|
|
60
59
|
"vitest": "4.1.11"
|
|
61
60
|
},
|
|
62
61
|
"scripts": {
|
|
63
62
|
"clean": "rm -rf dist dist-demo",
|
|
64
|
-
"build": "pnpm run clean && vite build",
|
|
63
|
+
"build": "pnpm run clean && vite build && tsgo -p tsconfig.build.json",
|
|
65
64
|
"dev": "vite --config vite.demo.config.ts",
|
|
66
65
|
"build:demo": "vite build --config vite.demo.config.ts",
|
|
67
66
|
"preview": "vite preview --config vite.demo.config.ts",
|
|
68
67
|
"test": "vitest run",
|
|
69
|
-
"ts:check": "
|
|
68
|
+
"ts:check": "tsgo --noEmit"
|
|
70
69
|
}
|
|
71
70
|
}
|
package/dist/default-spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_SPEC: string;
|