@pb33f/cowboy-components 0.3.2 → 0.3.4
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/components/manage-ruleset/manage-ruleset.css.js +14 -3
- package/dist/components/manage-ruleset/manage-ruleset.d.ts +3 -0
- package/dist/components/manage-ruleset/manage-ruleset.js +85 -2
- package/dist/components/manage-ruleset/rule-input.js +8 -1
- package/dist/components/manage-ruleset/rule.css.js +3 -1
- package/dist/components/manage-ruleset/rule.js +42 -3
- package/dist/components/model-renderer/schema.js +10 -0
- package/dist/components/paginator/paginator-navigator.js +3 -0
- package/dist/components/paginator/paginator.css.js +5 -2
- package/dist/components/paginator/paginator.d.ts +1 -0
- package/dist/components/paginator/paginator.js +9 -3
- package/dist/components/problems-overview/diagnostic-evaluation.js +0 -3
- package/dist/components/problems-overview/problem-overview-group.d.ts +2 -0
- package/dist/components/problems-overview/problem-overview-group.js +15 -2
- package/dist/components/problems-overview/problems-overview.js +8 -2
- package/dist/components/the-doctor/sparks.d.ts +17 -0
- package/dist/components/the-doctor/sparks.js +81 -0
- package/dist/components/the-doctor/the-doctor.css.js +74 -26
- package/dist/components/the-doctor/the-doctor.d.ts +31 -1
- package/dist/components/the-doctor/the-doctor.js +234 -32
- package/dist/cowboy-components.umd.cjs +1793 -1642
- package/dist/events/doctor.d.ts +6 -2
- package/dist/events/doctor.js +1 -0
- package/dist/model/channels.d.ts +11 -0
- package/dist/model/channels.js +11 -0
- package/dist/model/errors.d.ts +1 -1
- package/dist/services/header-service.d.ts +5 -0
- package/dist/services/header-service.js +16 -0
- package/dist/services/linting-service.d.ts +1 -1
- package/dist/services/linting-service.js +19 -9
- package/package.json +1 -1
package/dist/events/doctor.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ProblemItem } from "../components/problem-list/problem-item.js";
|
|
2
|
-
import { Problem } from "../model/problem.js";
|
|
3
2
|
import { RuleComponent } from "../components/manage-ruleset/rule.js";
|
|
4
3
|
import { RuleAction, RuleConfig, RuleSet } from "../model/vacuum_rule.js";
|
|
5
4
|
import { Toast } from "../model/toast.js";
|
|
@@ -18,6 +17,7 @@ export declare const ProblemSearchFilterChanged: string;
|
|
|
18
17
|
export declare const RuleViolationClicked: string;
|
|
19
18
|
export declare const RemoveFunctionOption: string;
|
|
20
19
|
export declare const RulesetDirty: string;
|
|
20
|
+
export declare const SeverityChanged: string;
|
|
21
21
|
export declare const RuleNameUpdated: string;
|
|
22
22
|
export declare const RuleActionFunctionOptionAdded: string;
|
|
23
23
|
export declare const BuiltInRulesetChanged: string;
|
|
@@ -60,6 +60,7 @@ export interface NodeReferenceEvent {
|
|
|
60
60
|
export interface NodeClickedEvent {
|
|
61
61
|
nodeHashId: string;
|
|
62
62
|
first?: boolean;
|
|
63
|
+
noState?: boolean;
|
|
63
64
|
}
|
|
64
65
|
export interface ProblemLabelViewFilterChangedEvent {
|
|
65
66
|
label: string;
|
|
@@ -92,6 +93,9 @@ export interface RulesetChangedEvent {
|
|
|
92
93
|
export interface RuleDirtyEvent {
|
|
93
94
|
rule: RuleComponent;
|
|
94
95
|
}
|
|
96
|
+
export interface SeverityChangedEvent {
|
|
97
|
+
severity: string;
|
|
98
|
+
}
|
|
95
99
|
export interface RuleActionDirtyEvent {
|
|
96
100
|
ruleAction: RuleActionComponent;
|
|
97
101
|
}
|
|
@@ -136,8 +140,8 @@ export declare enum ActiveView {
|
|
|
136
140
|
Ruleset = "ruleset"
|
|
137
141
|
}
|
|
138
142
|
export interface HistoryState {
|
|
139
|
-
problem: Problem;
|
|
140
143
|
rule: string;
|
|
141
144
|
page: number;
|
|
142
145
|
view: ActiveView;
|
|
146
|
+
activeNode: string;
|
|
143
147
|
}
|
package/dist/events/doctor.js
CHANGED
|
@@ -11,6 +11,7 @@ export const ProblemSearchFilterChanged = "problemSearchFilterChanged";
|
|
|
11
11
|
export const RuleViolationClicked = "ruleViolationClicked";
|
|
12
12
|
export const RemoveFunctionOption = "removeFunctionOption";
|
|
13
13
|
export const RulesetDirty = "rulesetDirty";
|
|
14
|
+
export const SeverityChanged = "severityChanged";
|
|
14
15
|
export const RuleNameUpdated = "ruleNameUpdated";
|
|
15
16
|
export const RuleActionFunctionOptionAdded = "ruleActionFunctionOptionAdded";
|
|
16
17
|
export const BuiltInRulesetChanged = "builtInRulesetChanged";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DoctorServiceChannel = "doctor-service";
|
|
2
|
+
export declare const SpecStreamChannel = "spec-stream";
|
|
3
|
+
export declare const TopicPrefix = "/t/";
|
|
4
|
+
export declare const QueuePrefix = "/q/";
|
|
5
|
+
export declare function isBrokerResponse(obj: any): obj is BrokerResponse;
|
|
6
|
+
export interface BrokerResponse {
|
|
7
|
+
broker: string;
|
|
8
|
+
}
|
|
9
|
+
export declare enum Command {
|
|
10
|
+
WhoAmI = "whoami"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const DoctorServiceChannel = "doctor-service";
|
|
2
|
+
export const SpecStreamChannel = "spec-stream";
|
|
3
|
+
export const TopicPrefix = "/t/";
|
|
4
|
+
export const QueuePrefix = "/q/";
|
|
5
|
+
export function isBrokerResponse(obj) {
|
|
6
|
+
return typeof obj === 'object' && obj !== null && typeof obj.broker === 'string';
|
|
7
|
+
}
|
|
8
|
+
export var Command;
|
|
9
|
+
(function (Command) {
|
|
10
|
+
Command["WhoAmI"] = "whoami";
|
|
11
|
+
})(Command || (Command = {}));
|
package/dist/model/errors.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class HeaderService {
|
|
2
|
+
static buildDefaultHeaders(broker) {
|
|
3
|
+
const headers = {};
|
|
4
|
+
HeaderService.addBrokerHeader(headers, broker);
|
|
5
|
+
HeaderService.addJSONHeader(headers);
|
|
6
|
+
return headers;
|
|
7
|
+
}
|
|
8
|
+
static addBrokerHeader(headers, broker) {
|
|
9
|
+
if (broker) {
|
|
10
|
+
headers['x-pb33f-broker'] = broker;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
static addJSONHeader(headers) {
|
|
14
|
+
headers['Content-Type'] = 'application/json';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -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): Promise<Problem[]>;
|
|
8
|
+
static lintFile(file: string, brokerId?: string, url?: string): Promise<Problem[]>;
|
|
9
9
|
static fetchAllHowToFix(): Promise<HowToFix[]>;
|
|
10
10
|
static fetchStatistics(): Promise<DrDiagnostics>;
|
|
11
11
|
static startSession(): Promise<Session>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Problem } from "../model/problem.js";
|
|
2
|
+
import { HeaderService } from "./header-service";
|
|
2
3
|
export class LintingService {
|
|
3
4
|
static compareProblems(a, b) {
|
|
4
5
|
if (a.startLineNumber < b.startLineNumber) {
|
|
@@ -18,17 +19,26 @@ export class LintingService {
|
|
|
18
19
|
}
|
|
19
20
|
return 0;
|
|
20
21
|
}
|
|
21
|
-
static async lintFile(file) {
|
|
22
|
+
static async lintFile(file, brokerId, url) {
|
|
22
23
|
return new Promise(async (resolve, reject) => {
|
|
23
24
|
try {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
const headers = HeaderService.buildDefaultHeaders(brokerId);
|
|
26
|
+
let lintResults;
|
|
27
|
+
if (!url) {
|
|
28
|
+
lintResults = await fetch(LintingService.doctorEndpoint + '/lint-lsp', {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
credentials: 'include',
|
|
31
|
+
headers: headers,
|
|
32
|
+
body: file
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
lintResults = await fetch(LintingService.doctorEndpoint + '/lint-lsp?url=' + encodeURIComponent(url), {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
credentials: 'include',
|
|
39
|
+
headers: headers,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
32
42
|
const apiResult = await lintResults.json();
|
|
33
43
|
if (!apiResult) {
|
|
34
44
|
reject([]);
|
package/package.json
CHANGED