@pb33f/cowboy-components 0.1.6 → 0.1.8

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.
@@ -16,6 +16,7 @@ export declare const DiagnosticBag = "pb33f-doctor-diagnostic";
16
16
  export declare const OWASPBag = "pb33f-doctor-owasp";
17
17
  export declare const DefaultDocument = "document";
18
18
  export declare const DocumentProblems = "problems";
19
+ export declare const DoctorEndpoint = "doctor-endpoint";
19
20
  export declare class TheDoctor extends LitElement {
20
21
  static styles: import("lit").CSSResult[];
21
22
  overviewPanel: SlTab;
@@ -23,6 +24,7 @@ export declare class TheDoctor extends LitElement {
23
24
  tabGroup: SlTabGroup;
24
25
  owaspSwitch: SlSwitch;
25
26
  private unavailable;
27
+ doctorEndpoint: string;
26
28
  private errorBanner;
27
29
  private bagManager;
28
30
  private readonly editor;
@@ -42,8 +44,7 @@ export declare class TheDoctor extends LitElement {
42
44
  private OWASPEnabled;
43
45
  private readonly statusBar;
44
46
  private session;
45
- private doctorEndpoint;
46
- constructor();
47
+ constructor(doctorEndpoint?: string);
47
48
  ruleGroupClicked(event: CustomEvent<ProblemRuleFilterChangedEvent>): void;
48
49
  ruleDocsClicked(event: CustomEvent<ProblemDrawerEvent>): void;
49
50
  private lintSpec;
@@ -32,13 +32,12 @@ export const DiagnosticBag = "pb33f-doctor-diagnostic";
32
32
  export const OWASPBag = "pb33f-doctor-owasp";
33
33
  export const DefaultDocument = "document";
34
34
  export const DocumentProblems = "problems";
35
+ export const DoctorEndpoint = "doctor-endpoint";
35
36
  let TheDoctor = class TheDoctor extends LitElement {
36
- constructor() {
37
+ constructor(doctorEndpoint = "https://doctor.pb33f.io") {
37
38
  super();
38
39
  this.debounceTime = 300;
39
40
  this.bounceId = 0;
40
- //private doctorEndpoint: string = "https://doctor.pb33f.io";
41
- this.doctorEndpoint = "http://localhost:9090";
42
41
  // create a stateful bag manager
43
42
  this.bagManager = CreateBagManager(true);
44
43
  this.bagManager.loadStatefulBags().then(this.loadState.bind(this));
@@ -50,6 +49,14 @@ let TheDoctor = class TheDoctor extends LitElement {
50
49
  this.statusBar = new StatusBar();
51
50
  this.ruleDocsWorker = new RuleDocumentationWorker();
52
51
  this.unavailable = false;
52
+ // extract the doctor endpoint from session storage.
53
+ const sessionEndpoint = sessionStorage.getItem(DoctorEndpoint);
54
+ if (sessionEndpoint) {
55
+ this.doctorEndpoint = sessionEndpoint;
56
+ }
57
+ else {
58
+ this.doctorEndpoint = doctorEndpoint;
59
+ }
53
60
  // TODO: make this configurable
54
61
  this.editor.language = "yaml";
55
62
  //@ts-ignore
@@ -335,6 +342,9 @@ __decorate([
335
342
  __decorate([
336
343
  property({ type: Boolean })
337
344
  ], TheDoctor.prototype, "unavailable", void 0);
345
+ __decorate([
346
+ property()
347
+ ], TheDoctor.prototype, "doctorEndpoint", void 0);
338
348
  TheDoctor = __decorate([
339
349
  customElement("pb33f-doctor")
340
350
  ], TheDoctor);