@pb33f/cowboy-components 0.1.16 → 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/dist/assets/rule-documentation.worker-D39NS8Lx.js +1 -0
- package/dist/components/editor/editor.d.ts +2 -0
- package/dist/components/editor/editor.js +6 -4
- package/dist/components/error-banner/error-banner.css.js +1 -1
- package/dist/components/manage-ruleset/function-option.css.d.ts +2 -0
- package/dist/components/manage-ruleset/function-option.css.js +38 -0
- package/dist/components/manage-ruleset/function-option.d.ts +19 -0
- package/dist/components/manage-ruleset/function-option.js +117 -0
- package/dist/components/manage-ruleset/manage-ruleset.css.d.ts +2 -0
- package/dist/components/manage-ruleset/manage-ruleset.css.js +75 -0
- package/dist/components/manage-ruleset/manage-ruleset.d.ts +66 -0
- package/dist/components/manage-ruleset/manage-ruleset.js +597 -0
- package/dist/components/manage-ruleset/rule-action.css.d.ts +2 -0
- package/dist/components/manage-ruleset/rule-action.css.js +56 -0
- package/dist/components/manage-ruleset/rule-action.d.ts +37 -0
- package/dist/components/manage-ruleset/rule-action.js +351 -0
- package/dist/components/manage-ruleset/rule-input.d.ts +38 -0
- package/dist/components/manage-ruleset/rule-input.js +296 -0
- package/dist/components/manage-ruleset/rule.css.d.ts +2 -0
- package/dist/components/manage-ruleset/rule.css.js +117 -0
- package/dist/components/manage-ruleset/rule.d.ts +31 -0
- package/dist/components/manage-ruleset/rule.js +153 -0
- package/dist/components/problem-list/details-drawer.d.ts +2 -1
- package/dist/components/problem-list/details-drawer.js +7 -0
- package/dist/components/problem-list/filter.css.js +2 -3
- package/dist/components/problem-list/problem-item.css.js +1 -3
- package/dist/components/problem-list/problem-item.js +1 -1
- package/dist/components/problem-list/problem-list.css.js +0 -10
- package/dist/components/problem-list/problem-list.js +0 -1
- package/dist/components/problems-overview/document-statistic.css.js +0 -1
- package/dist/components/problems-overview/problem-overview-group.css.js +1 -3
- package/dist/components/problems-overview/problem-overview-group.js +2 -2
- package/dist/components/problems-overview/problem-statistics.css.js +0 -5
- package/dist/components/problems-overview/problems-overview.css.js +0 -4
- package/dist/components/the-doctor/the-doctor.css.js +99 -27
- package/dist/components/the-doctor/the-doctor.d.ts +66 -8
- package/dist/components/the-doctor/the-doctor.js +668 -63
- package/dist/components/toast/toast-component.css.d.ts +2 -0
- package/dist/components/toast/toast-component.css.js +151 -0
- package/dist/components/toast/toast-component.d.ts +19 -0
- package/dist/components/toast/toast-component.js +116 -0
- package/dist/components/toast/toast-manager.d.ts +13 -0
- package/dist/components/toast/toast-manager.js +54 -0
- package/dist/cowboy-components.umd.cjs +1375 -372
- package/dist/css/button.css.js +46 -0
- package/dist/css/dialog.css.d.ts +2 -0
- package/dist/css/dialog.css.js +11 -0
- package/dist/css/forms.css.d.ts +2 -0
- package/dist/css/forms.css.js +123 -0
- package/dist/css/modal.css.d.ts +2 -0
- package/dist/css/modal.css.js +15 -0
- package/dist/css/pb33f-theme.css +1 -0
- package/dist/css/radiogroups.css.d.ts +2 -0
- package/dist/css/radiogroups.css.js +26 -0
- package/dist/css/spinner.css.d.ts +2 -0
- package/dist/css/spinner.css.js +42 -0
- package/dist/events/doctor.d.ts +61 -3
- package/dist/events/doctor.js +14 -1
- package/dist/model/errors.d.ts +10 -0
- package/dist/model/rule_documentation.d.ts +8 -2
- package/dist/model/rule_documentation.js +5 -1
- package/dist/model/toast.d.ts +15 -0
- package/dist/model/toast.js +9 -0
- package/dist/model/vacuum_rule.d.ts +58 -0
- package/dist/model/vacuum_rule.js +1 -0
- package/dist/services/linting-service.d.ts +1 -1
- package/dist/services/linting-service.js +2 -6
- package/dist/services/ruleset-service.d.ts +17 -0
- package/dist/services/ruleset-service.js +316 -0
- package/dist/style.css +1 -1
- package/dist/workers/rule-documentation.worker.d.ts +7 -4
- package/dist/workers/rule-documentation.worker.js +93 -2
- package/package.json +1 -1
- package/dist/assets/rule-documentation.worker-BFIxMBU8.js +0 -1
package/dist/css/button.css.js
CHANGED
|
@@ -9,7 +9,25 @@ export default css `
|
|
|
9
9
|
min-height: 20px;
|
|
10
10
|
margin-top: 5px;
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
sl-tooltip::part(base){
|
|
14
|
+
font-family: var(--font-stack), monospace;
|
|
15
|
+
font-size: 0.7rem;
|
|
16
|
+
}
|
|
12
17
|
|
|
18
|
+
|
|
19
|
+
sl-tooltip::part(body){
|
|
20
|
+
font-family: var(--font-stack), monospace;
|
|
21
|
+
font-size: 0.9rem;
|
|
22
|
+
background-color: var(--background-color);
|
|
23
|
+
color: var(--font-color);
|
|
24
|
+
border: 1px dashed var(--secondary-color);
|
|
25
|
+
border-radius: 0;
|
|
26
|
+
}
|
|
27
|
+
sl-tooltip::part(base__arrow){
|
|
28
|
+
background-color: var(--secondary-color);
|
|
29
|
+
}
|
|
30
|
+
|
|
13
31
|
sl-button::part(label){
|
|
14
32
|
|
|
15
33
|
}
|
|
@@ -31,4 +49,32 @@ export default css `
|
|
|
31
49
|
color: var(--background-color);
|
|
32
50
|
}
|
|
33
51
|
|
|
52
|
+
sl-switch::part(base) {
|
|
53
|
+
font-family: var(--font-stack), monospace;
|
|
54
|
+
font-size: 0.7rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
sl-button.danger::part(base){
|
|
59
|
+
border: 1px solid var(--error-color);
|
|
60
|
+
border-radius: 0;
|
|
61
|
+
font-family: var(--font-stack), monospace;
|
|
62
|
+
background-color: var(--background-color);
|
|
63
|
+
color: var(--error-color);
|
|
64
|
+
min-height: 20px;
|
|
65
|
+
margin-top: 5px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
sl-button.danger::part(base):hover{
|
|
69
|
+
font-family: var(--font-stack), monospace;
|
|
70
|
+
background-color: var(--error-color);
|
|
71
|
+
color: var(--background-color);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
sl-button.danger::part(base):active{
|
|
75
|
+
border: 1px solid var(--warn-color);
|
|
76
|
+
background-color: var(--warn-color);
|
|
77
|
+
color: var(--background-color);
|
|
78
|
+
}
|
|
79
|
+
|
|
34
80
|
`;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
.label-on-left {
|
|
5
|
+
--label-width: 3.75rem;
|
|
6
|
+
--gap-width: 1rem;
|
|
7
|
+
}
|
|
8
|
+
.label-on-left + .label-on-left {
|
|
9
|
+
margin-top: 15px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.checkbox-label {
|
|
13
|
+
width: 95px;
|
|
14
|
+
display: inline-block;
|
|
15
|
+
text-align: center;
|
|
16
|
+
font-size: 0.8rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.checkbox {
|
|
20
|
+
margin: 15px 0 15px 0 ;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
sl-checkbox {
|
|
24
|
+
margin-right: 10px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
sl-checkbox::part(control) {
|
|
28
|
+
border-radius: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
sl-checkbox::part(label) {
|
|
32
|
+
font-family: var(--font-stack), monospace;
|
|
33
|
+
font-size: 0.8rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.label-on-left::part(form-control) {
|
|
37
|
+
display: grid;
|
|
38
|
+
grid: auto / 70px 1fr;
|
|
39
|
+
gap: var(--sl-spacing-3x-small) 30px;
|
|
40
|
+
align-items: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.label-on-left::part(form-control-label) {
|
|
44
|
+
text-align: right;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.label-on-left::part(form-control-help-text) {
|
|
48
|
+
grid-column-start: 2;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
sl-input::part(form-control-label) {
|
|
52
|
+
font-family: var(--font-stack), monospace;
|
|
53
|
+
font-size: 0.8rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
sl-input::part(base) {
|
|
57
|
+
border-radius: 0;
|
|
58
|
+
font-family: var(--font-stack), monospace;
|
|
59
|
+
font-size: 0.8rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
sl-textarea::part(base) {
|
|
63
|
+
border-radius: 0;
|
|
64
|
+
font-family: var(--font-stack), monospace;
|
|
65
|
+
font-size: 0.8rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
sl-textarea::part(form-control-label) {
|
|
69
|
+
font-family: var(--font-stack), monospace;
|
|
70
|
+
font-size: 0.8rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
sl-select::part(form-control-label) {
|
|
74
|
+
font-family: var(--font-stack), monospace;
|
|
75
|
+
font-size: 0.8rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
sl-select::part(form-control) {
|
|
79
|
+
border-radius: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
sl-select::part(combobox) {
|
|
83
|
+
border-radius: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
sl-select::part(display-input) {
|
|
87
|
+
font-family: var(--font-stack), monospace;
|
|
88
|
+
font-size: 0.8rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
sl-option {
|
|
92
|
+
--sl-color-primary-600: var(--primary-color);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
sl-option::part(label) {
|
|
96
|
+
font-family: var(--font-stack), monospace;
|
|
97
|
+
font-size: 0.8rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
sl-select::part(base) {
|
|
102
|
+
font-family: var(--font-stack), monospace;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
sl-select::part(listbox) {
|
|
106
|
+
font-family: var(--font-stack), monospace;
|
|
107
|
+
}
|
|
108
|
+
sl-radio-group::part(label) {
|
|
109
|
+
font-family: var(--font-stack), monospace;
|
|
110
|
+
font-size: 0.8rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
sl-radio-group::part(form-control-label) {
|
|
114
|
+
font-family: var(--font-stack), monospace;
|
|
115
|
+
font-size: 0.8rem;
|
|
116
|
+
}
|
|
117
|
+
sl-radio::part(base) {
|
|
118
|
+
font-family: var(--font-stack), monospace;
|
|
119
|
+
font-size: 0.8rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
sl-dialog::part(panel) {
|
|
5
|
+
border: 1px dashed var(--secondary-color);
|
|
6
|
+
border-radius: 0;
|
|
7
|
+
background-color: var(--background-color)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
sl-dialog::part(body) {
|
|
12
|
+
background-color: var(--background-color)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
`;
|
package/dist/css/pb33f-theme.css
CHANGED
|
@@ -142,6 +142,7 @@ html {
|
|
|
142
142
|
--error-color: #ff3c74;
|
|
143
143
|
--error-font-color: #ff246b;
|
|
144
144
|
--error-color-lowalpha: rgba(255, 60, 116, 0.4);
|
|
145
|
+
--error-color-dark: #250911;
|
|
145
146
|
--error-color-loweralpha: rgba(255, 60, 116, 0.2);
|
|
146
147
|
--error-color-verylowalpha: #0c0000;
|
|
147
148
|
--progress-bar-background: #0a0a0a;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
sl-radio-group::part(form-control) {
|
|
5
|
+
font-family: var(--font-stack), monospace;
|
|
6
|
+
font-size: 0.9rem;
|
|
7
|
+
}
|
|
8
|
+
sl-radio-group::part(form-control-label) {
|
|
9
|
+
font-family: var(--font-stack), monospace;
|
|
10
|
+
font-size: 0.8rem;
|
|
11
|
+
}
|
|
12
|
+
sl-radio-group::part(form-control-help-text) {
|
|
13
|
+
font-family: var(--font-stack), monospace;
|
|
14
|
+
font-size: 0.7rem;
|
|
15
|
+
}
|
|
16
|
+
sl-radio-button::part(button) {
|
|
17
|
+
font-family: var(--font-stack), monospace;
|
|
18
|
+
font-size: 0.8rem;
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
--sl-color-primary-600: var(--primary-color);
|
|
21
|
+
height: 30px;
|
|
22
|
+
min-height: 1px;
|
|
23
|
+
margin-top: 8px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
.spin {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 35px;
|
|
7
|
+
height: 25px;
|
|
8
|
+
}
|
|
9
|
+
.spin:after {
|
|
10
|
+
content: " ";
|
|
11
|
+
display: block;
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
width: 0;
|
|
14
|
+
height: 0;
|
|
15
|
+
margin: 8px;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
border: 10px solid var(--primary-color);
|
|
18
|
+
border-color: var(--primary-color) transparent var(--primary-color) transparent;
|
|
19
|
+
animation: spinner 1.2s infinite;
|
|
20
|
+
}
|
|
21
|
+
.pb33f-loader {
|
|
22
|
+
display: block;
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 60px;
|
|
26
|
+
margin-top: 20px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes spinner {
|
|
30
|
+
0% {
|
|
31
|
+
transform: rotate(0);
|
|
32
|
+
animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
|
|
33
|
+
}
|
|
34
|
+
50% {
|
|
35
|
+
transform: rotate(900deg);
|
|
36
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
37
|
+
}
|
|
38
|
+
100% {
|
|
39
|
+
transform: rotate(1800deg);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;
|
package/dist/events/doctor.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { ProblemItem } from "../components/problem-list/problem-item";
|
|
2
|
-
import { Problem } from "../model/problem";
|
|
1
|
+
import { ProblemItem } from "../components/problem-list/problem-item.js";
|
|
2
|
+
import { Problem } from "../model/problem.js";
|
|
3
|
+
import { RuleComponent } from "../components/manage-ruleset/rule.js";
|
|
4
|
+
import { RuleAction, RuleConfig, RuleSet } from "../model/vacuum_rule.js";
|
|
5
|
+
import { Toast } from "../model/toast.js";
|
|
6
|
+
import { RuleActionComponent } from "../components/manage-ruleset/rule-action";
|
|
3
7
|
export declare const EditorUpdated: string;
|
|
4
8
|
export declare const EditorClicked: string;
|
|
5
9
|
export declare const ProblemClicked: string;
|
|
@@ -10,7 +14,19 @@ export declare const ProblemSortFilterChanged: string;
|
|
|
10
14
|
export declare const ProblemRuleFilterChanged: string;
|
|
11
15
|
export declare const ProblemRuleFilterChangedManual: string;
|
|
12
16
|
export declare const ProblemSearchFilterChanged: string;
|
|
17
|
+
export declare const RuleViolationClicked: string;
|
|
18
|
+
export declare const RemoveFunctionOption: string;
|
|
19
|
+
export declare const RulesetDirty: string;
|
|
20
|
+
export declare const RuleNameUpdated: string;
|
|
21
|
+
export declare const RuleActionFunctionOptionAdded: string;
|
|
22
|
+
export declare const BuiltInRulesetChanged: string;
|
|
23
|
+
export declare const CustomRulesetEnabled: string;
|
|
24
|
+
export declare const RulesetSaved: string;
|
|
13
25
|
export declare const RuleClicked: string;
|
|
26
|
+
export declare const ExportRuleset: string;
|
|
27
|
+
export declare const RuleActionDirty: string;
|
|
28
|
+
export declare const AddToast: string;
|
|
29
|
+
export declare const ToastExpired: string;
|
|
14
30
|
export declare const MessageEvent: string;
|
|
15
31
|
export interface ProblemLabelViewFilterChangedEvent {
|
|
16
32
|
label: string;
|
|
@@ -30,18 +46,60 @@ export interface MainViewSlideChangedEvent {
|
|
|
30
46
|
}
|
|
31
47
|
export interface EditorUpdatedEvent {
|
|
32
48
|
content: string;
|
|
49
|
+
id: string;
|
|
50
|
+
}
|
|
51
|
+
export interface CustomRulesetEnabledEvent {
|
|
52
|
+
rules: RuleComponent[];
|
|
53
|
+
ruleConfig: RuleConfig | null;
|
|
54
|
+
}
|
|
55
|
+
export interface RulesetChangedEvent {
|
|
56
|
+
ruleset: string;
|
|
57
|
+
}
|
|
58
|
+
export interface RuleDirtyEvent {
|
|
59
|
+
rule: RuleComponent;
|
|
60
|
+
}
|
|
61
|
+
export interface RuleActionDirtyEvent {
|
|
62
|
+
ruleAction: RuleActionComponent;
|
|
63
|
+
}
|
|
64
|
+
export interface RulesetSavedEvent {
|
|
65
|
+
rules: RuleSet;
|
|
66
|
+
returnedRules: RuleSet;
|
|
67
|
+
config: RuleConfig | null;
|
|
68
|
+
}
|
|
69
|
+
export interface RuleNameUpdatedEvent {
|
|
70
|
+
name: string;
|
|
71
|
+
}
|
|
72
|
+
export interface RuleActionFunctionOptionAddedEvent {
|
|
73
|
+
action: RuleAction;
|
|
74
|
+
key: string;
|
|
75
|
+
value: string;
|
|
76
|
+
}
|
|
77
|
+
export interface RuleActionFunctionOptionRemovedEvent {
|
|
78
|
+
action: RuleAction;
|
|
79
|
+
key: string;
|
|
80
|
+
value: string;
|
|
33
81
|
}
|
|
34
82
|
export interface EditorClickedEvent {
|
|
35
83
|
line: number | undefined;
|
|
36
84
|
column: number | undefined;
|
|
37
85
|
}
|
|
86
|
+
export interface RuleClickedEvent {
|
|
87
|
+
ruleId: string;
|
|
88
|
+
}
|
|
38
89
|
export interface ProblemClickedEvent {
|
|
39
90
|
problem: ProblemItem;
|
|
40
91
|
launchedFromProblems: boolean;
|
|
41
92
|
}
|
|
93
|
+
export interface ToastExpiredEvent {
|
|
94
|
+
toastId: string;
|
|
95
|
+
}
|
|
96
|
+
export interface AddToastEvent {
|
|
97
|
+
toast: Toast;
|
|
98
|
+
}
|
|
42
99
|
export declare enum ActiveView {
|
|
43
100
|
Problems = "problems",
|
|
44
|
-
Overview = "overview"
|
|
101
|
+
Overview = "overview",
|
|
102
|
+
Ruleset = "ruleset"
|
|
45
103
|
}
|
|
46
104
|
export interface HistoryState {
|
|
47
105
|
problem: Problem;
|
package/dist/events/doctor.js
CHANGED
|
@@ -8,10 +8,23 @@ export const ProblemSortFilterChanged = "problemSortFilterChanged";
|
|
|
8
8
|
export const ProblemRuleFilterChanged = "problemRuleFilterChanged";
|
|
9
9
|
export const ProblemRuleFilterChangedManual = "problemRuleFilterChangedManual";
|
|
10
10
|
export const ProblemSearchFilterChanged = "problemSearchFilterChanged";
|
|
11
|
-
export const
|
|
11
|
+
export const RuleViolationClicked = "ruleViolationClicked";
|
|
12
|
+
export const RemoveFunctionOption = "removeFunctionOption";
|
|
13
|
+
export const RulesetDirty = "rulesetDirty";
|
|
14
|
+
export const RuleNameUpdated = "ruleNameUpdated";
|
|
15
|
+
export const RuleActionFunctionOptionAdded = "ruleActionFunctionOptionAdded";
|
|
16
|
+
export const BuiltInRulesetChanged = "builtInRulesetChanged";
|
|
17
|
+
export const CustomRulesetEnabled = "customRulesetEnabled";
|
|
18
|
+
export const RulesetSaved = "rulesetSaved";
|
|
19
|
+
export const RuleClicked = "rulesetRuleClicked";
|
|
20
|
+
export const ExportRuleset = "exportRuleset";
|
|
21
|
+
export const RuleActionDirty = "ruleActionDirty";
|
|
22
|
+
export const AddToast = "addToast";
|
|
23
|
+
export const ToastExpired = "toastExpired";
|
|
12
24
|
export const MessageEvent = "message";
|
|
13
25
|
export var ActiveView;
|
|
14
26
|
(function (ActiveView) {
|
|
15
27
|
ActiveView["Problems"] = "problems";
|
|
16
28
|
ActiveView["Overview"] = "overview";
|
|
29
|
+
ActiveView["Ruleset"] = "ruleset";
|
|
17
30
|
})(ActiveView || (ActiveView = {}));
|
package/dist/model/errors.d.ts
CHANGED
|
@@ -4,4 +4,14 @@ export interface PlatformError {
|
|
|
4
4
|
statusL: number;
|
|
5
5
|
title: string;
|
|
6
6
|
type: string;
|
|
7
|
+
body: any;
|
|
8
|
+
}
|
|
9
|
+
export interface RuleError {
|
|
10
|
+
ruleId: string;
|
|
11
|
+
ruleError: string;
|
|
12
|
+
function?: string;
|
|
13
|
+
functionOption?: string;
|
|
14
|
+
line?: number;
|
|
15
|
+
startCol?: number;
|
|
16
|
+
endCol?: number;
|
|
7
17
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export declare const enum DocumentationType {
|
|
2
|
+
RULE = "rule",
|
|
3
|
+
FUNCTION = "function"
|
|
4
|
+
}
|
|
5
|
+
export interface DoctorDocumentation {
|
|
6
|
+
ruleId?: string;
|
|
7
|
+
functionId?: string;
|
|
3
8
|
category: string;
|
|
4
9
|
body?: string;
|
|
10
|
+
type: DocumentationType;
|
|
5
11
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum ToastType {
|
|
2
|
+
ERROR = "error",
|
|
3
|
+
WARNING = "warning",
|
|
4
|
+
SUCCESS = "success",
|
|
5
|
+
INFO = "info",
|
|
6
|
+
SCOREUP = "scoreup",
|
|
7
|
+
SCOREDOWN = "scoredown"
|
|
8
|
+
}
|
|
9
|
+
export interface Toast {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
type: ToastType;
|
|
13
|
+
time?: string;
|
|
14
|
+
body: any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var ToastType;
|
|
2
|
+
(function (ToastType) {
|
|
3
|
+
ToastType["ERROR"] = "error";
|
|
4
|
+
ToastType["WARNING"] = "warning";
|
|
5
|
+
ToastType["SUCCESS"] = "success";
|
|
6
|
+
ToastType["INFO"] = "info";
|
|
7
|
+
ToastType["SCOREUP"] = "scoreup";
|
|
8
|
+
ToastType["SCOREDOWN"] = "scoredown";
|
|
9
|
+
})(ToastType || (ToastType = {}));
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface Rule {
|
|
2
|
+
id?: string;
|
|
3
|
+
active?: boolean;
|
|
4
|
+
description?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
given?: string[] | string;
|
|
7
|
+
formats?: string[];
|
|
8
|
+
resolved?: boolean;
|
|
9
|
+
recommended?: boolean;
|
|
10
|
+
type?: string;
|
|
11
|
+
severity?: string;
|
|
12
|
+
then?: RuleAction[] | RuleAction;
|
|
13
|
+
category?: RuleCategory;
|
|
14
|
+
howToFix?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RuleAction {
|
|
17
|
+
field?: string;
|
|
18
|
+
function?: string;
|
|
19
|
+
functionOptions?: Map<string, any> | any;
|
|
20
|
+
}
|
|
21
|
+
export interface RuleCategory {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface RuleSet {
|
|
27
|
+
id?: string;
|
|
28
|
+
owner?: string;
|
|
29
|
+
uri?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
documentationUrl?: string;
|
|
32
|
+
rules: Map<string, Rule>;
|
|
33
|
+
extends?: string | [string, string];
|
|
34
|
+
}
|
|
35
|
+
export interface RuleConfig {
|
|
36
|
+
ruleMapping: Map<string, boolean>;
|
|
37
|
+
allRulesSwitch: boolean;
|
|
38
|
+
returnedRuleset?: any;
|
|
39
|
+
}
|
|
40
|
+
export interface RuleFunctionProperty {
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
}
|
|
44
|
+
export interface RuleFunctionSchema {
|
|
45
|
+
name?: string;
|
|
46
|
+
required?: string[];
|
|
47
|
+
requiresField?: boolean;
|
|
48
|
+
properties?: RuleFunctionProperty[];
|
|
49
|
+
minProperties?: number;
|
|
50
|
+
maxProperties?: number;
|
|
51
|
+
errorMessage?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface RulesetRenderMap {
|
|
54
|
+
ruleId: string;
|
|
55
|
+
line: number;
|
|
56
|
+
start: number;
|
|
57
|
+
end: number;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import { Session } from "../model/session.js";
|
|
|
5
5
|
export declare class LintingService {
|
|
6
6
|
static doctorEndpoint: string;
|
|
7
7
|
static compareProblems(a: Problem, b: Problem): number;
|
|
8
|
-
static lintFile(file: string
|
|
8
|
+
static lintFile(file: string): Promise<Problem[]>;
|
|
9
9
|
static fetchAllHowToFix(): Promise<HowToFix[]>;
|
|
10
10
|
static fetchStatistics(): Promise<DrDiagnostics>;
|
|
11
11
|
static startSession(): Promise<Session>;
|
|
@@ -18,14 +18,10 @@ export class LintingService {
|
|
|
18
18
|
}
|
|
19
19
|
return 0;
|
|
20
20
|
}
|
|
21
|
-
static async lintFile(file
|
|
21
|
+
static async lintFile(file) {
|
|
22
22
|
return new Promise(async (resolve, reject) => {
|
|
23
23
|
try {
|
|
24
|
-
|
|
25
|
-
if (OWASP) {
|
|
26
|
-
query = '?owasp=true';
|
|
27
|
-
}
|
|
28
|
-
const lintResults = await fetch(LintingService.doctorEndpoint + '/lint-lsp' + query, {
|
|
24
|
+
const lintResults = await fetch(LintingService.doctorEndpoint + '/lint-lsp', {
|
|
29
25
|
method: 'POST',
|
|
30
26
|
credentials: 'include',
|
|
31
27
|
headers: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RuleFunctionSchema, RuleSet, RulesetRenderMap } from "../model/vacuum_rule.js";
|
|
2
|
+
export declare class RulesetService {
|
|
3
|
+
static doctorEndpoint: string;
|
|
4
|
+
static checkRules(ruleset: RuleSet): void;
|
|
5
|
+
static getDefaultRuleset(): Promise<RuleSet>;
|
|
6
|
+
static getOWASPRuleset(): Promise<RuleSet>;
|
|
7
|
+
static getAllRuleset(): Promise<RuleSet>;
|
|
8
|
+
static getFunctions(): Promise<string[]>;
|
|
9
|
+
static getFunctionSchema(functionId: string): Promise<RuleFunctionSchema>;
|
|
10
|
+
static applyRuleset(ruleset: string): Promise<RuleSet>;
|
|
11
|
+
static convertToJSON(ruleset: string): Promise<RuleSet>;
|
|
12
|
+
static getSessionRuleset(): Promise<RuleSet>;
|
|
13
|
+
static getSessionRulesetAsYAML(): Promise<string>;
|
|
14
|
+
static getSessionRulesetMap(): Promise<RulesetRenderMap[]>;
|
|
15
|
+
static validateRuleset(body: string, returnJSON?: boolean): Promise<any>;
|
|
16
|
+
static resetSessionRuleset(): Promise<null>;
|
|
17
|
+
}
|