@wispbit/local 1.0.25 → 1.0.27

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 (48) hide show
  1. package/dist/cli.js +1190 -638
  2. package/dist/cli.js.map +4 -4
  3. package/dist/index.js +10 -3857
  4. package/dist/index.js.map +4 -4
  5. package/dist/package.json +3 -2
  6. package/dist/src/api/WispbitApiClient.d.ts +185 -0
  7. package/dist/src/api/WispbitApiClient.d.ts.map +1 -0
  8. package/dist/src/cli.d.ts.map +1 -1
  9. package/dist/src/environment/Config.d.ts +15 -5
  10. package/dist/src/environment/Config.d.ts.map +1 -1
  11. package/dist/src/providers/ViolationValidationProvider.d.ts +7 -11
  12. package/dist/src/providers/ViolationValidationProvider.d.ts.map +1 -1
  13. package/dist/src/providers/WispbitRuleProvider.d.ts +0 -16
  14. package/dist/src/providers/WispbitRuleProvider.d.ts.map +1 -1
  15. package/dist/src/providers/WispbitViolationValidationProvider.d.ts +4 -7
  16. package/dist/src/providers/WispbitViolationValidationProvider.d.ts.map +1 -1
  17. package/dist/src/schemas.d.ts +13 -514
  18. package/dist/src/schemas.d.ts.map +1 -1
  19. package/dist/src/steps/ExecutionEventEmitter.d.ts +37 -2
  20. package/dist/src/steps/ExecutionEventEmitter.d.ts.map +1 -1
  21. package/dist/src/steps/FileExecutionContext.d.ts +14 -5
  22. package/dist/src/steps/FileExecutionContext.d.ts.map +1 -1
  23. package/dist/src/steps/FileFilterStep.d.ts +0 -7
  24. package/dist/src/steps/FileFilterStep.d.ts.map +1 -1
  25. package/dist/src/steps/GotoDefinitionStep.d.ts.map +1 -1
  26. package/dist/src/steps/LLMStep.d.ts +0 -10
  27. package/dist/src/steps/LLMStep.d.ts.map +1 -1
  28. package/dist/src/steps/RuleExecutor.d.ts +5 -1
  29. package/dist/src/steps/RuleExecutor.d.ts.map +1 -1
  30. package/dist/src/test/TestExecutor.d.ts +6 -1
  31. package/dist/src/test/TestExecutor.d.ts.map +1 -1
  32. package/dist/src/types.d.ts +1 -5
  33. package/dist/src/types.d.ts.map +1 -1
  34. package/dist/src/utils/debugLogger.d.ts +6 -0
  35. package/dist/src/utils/debugLogger.d.ts.map +1 -0
  36. package/dist/src/utils/formatters.d.ts.map +1 -1
  37. package/dist/src/utils/git.d.ts +31 -2
  38. package/dist/src/utils/git.d.ts.map +1 -1
  39. package/dist/src/utils/git.test.d.ts +2 -0
  40. package/dist/src/utils/git.test.d.ts.map +1 -0
  41. package/dist/src/utils/patternMatching.d.ts +2 -0
  42. package/dist/src/utils/patternMatching.d.ts.map +1 -0
  43. package/dist/src/utils/validateRule.d.ts +37 -1
  44. package/dist/src/utils/validateRule.d.ts.map +1 -1
  45. package/dist/src/validationSchemas.d.ts +553 -0
  46. package/dist/src/validationSchemas.d.ts.map +1 -0
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +5 -4
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wispbit/local",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "bin": {
@@ -52,16 +52,17 @@
52
52
  "dotenv": "^16.3.1",
53
53
  "glob": "^10.4.5",
54
54
  "google-protobuf": "^3.20.1",
55
+ "ignore": "^7.0.5",
55
56
  "jest-diff": "^30.2.0",
56
57
  "js-yaml": "^4.1.0",
57
58
  "keyv": "^5.5.3",
58
59
  "keyv-file": "^5.2.0",
59
60
  "latest-version": "^9.0.0",
60
61
  "meow": "^14.0.0",
61
- "minimatch": "^9.0.3",
62
62
  "openai": "4.91.0",
63
63
  "ora": "^9.0.0",
64
64
  "p-limit": "^6.1.0",
65
+ "p-retry": "^6.2.1",
65
66
  "pretty-format": "^30.2.0",
66
67
  "semver": "^7.7.3",
67
68
  "tree-sitter-graphql": "github:joowani/tree-sitter-graphql#c3898a14e872a72726a3e981e647e5456812bd78",
@@ -0,0 +1,185 @@
1
+ import { z } from "zod";
2
+ import { ValidateViolationResponseSchema } from "powerlint/validationSchemas";
3
+ /**
4
+ * Request/Response schemas for Wispbit API endpoints
5
+ */
6
+ export declare const InitializeRequestSchema: z.ZodObject<{
7
+ repository_url: z.ZodString;
8
+ powerlint_version: z.ZodString;
9
+ schema_version: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ repository_url: string;
12
+ powerlint_version: string;
13
+ schema_version: string;
14
+ }, {
15
+ repository_url: string;
16
+ powerlint_version: string;
17
+ schema_version: string;
18
+ }>;
19
+ export declare const InitializeResponseSchema: z.ZodObject<{
20
+ configured: z.ZodBoolean;
21
+ invalid_api_key: z.ZodOptional<z.ZodBoolean>;
22
+ is_valid_repository: z.ZodOptional<z.ZodBoolean>;
23
+ config: z.ZodOptional<z.ZodObject<{
24
+ ignored_globs: z.ZodArray<z.ZodString, "many">;
25
+ }, "strip", z.ZodTypeAny, {
26
+ ignored_globs: string[];
27
+ }, {
28
+ ignored_globs: string[];
29
+ }>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ configured: boolean;
32
+ invalid_api_key?: boolean | undefined;
33
+ is_valid_repository?: boolean | undefined;
34
+ config?: {
35
+ ignored_globs: string[];
36
+ } | undefined;
37
+ }, {
38
+ configured: boolean;
39
+ invalid_api_key?: boolean | undefined;
40
+ is_valid_repository?: boolean | undefined;
41
+ config?: {
42
+ ignored_globs: string[];
43
+ } | undefined;
44
+ }>;
45
+ export type InitializeRequest = z.infer<typeof InitializeRequestSchema>;
46
+ export type InitializeResponse = z.infer<typeof InitializeResponseSchema>;
47
+ export declare const GetRulesRequestSchema: z.ZodObject<{
48
+ repository_url: z.ZodString;
49
+ rule_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
50
+ schema_version: z.ZodString;
51
+ powerlint_version: z.ZodString;
52
+ }, "strip", z.ZodTypeAny, {
53
+ repository_url: string;
54
+ powerlint_version: string;
55
+ schema_version: string;
56
+ rule_ids?: string[] | undefined;
57
+ }, {
58
+ repository_url: string;
59
+ powerlint_version: string;
60
+ schema_version: string;
61
+ rule_ids?: string[] | undefined;
62
+ }>;
63
+ export declare const GetRulesResponseSchema: z.ZodObject<{
64
+ rules: z.ZodArray<z.ZodObject<{
65
+ id: z.ZodString;
66
+ internalId: z.ZodString;
67
+ internalVersionId: z.ZodString;
68
+ message: z.ZodString;
69
+ prompt: z.ZodString;
70
+ severity: z.ZodEnum<["suggestion", "violation"]>;
71
+ schema: z.ZodAny;
72
+ }, "strip", z.ZodTypeAny, {
73
+ message: string;
74
+ id: string;
75
+ internalId: string;
76
+ internalVersionId: string;
77
+ prompt: string;
78
+ severity: "suggestion" | "violation";
79
+ schema?: any;
80
+ }, {
81
+ message: string;
82
+ id: string;
83
+ internalId: string;
84
+ internalVersionId: string;
85
+ prompt: string;
86
+ severity: "suggestion" | "violation";
87
+ schema?: any;
88
+ }>, "many">;
89
+ }, "strip", z.ZodTypeAny, {
90
+ rules: {
91
+ message: string;
92
+ id: string;
93
+ internalId: string;
94
+ internalVersionId: string;
95
+ prompt: string;
96
+ severity: "suggestion" | "violation";
97
+ schema?: any;
98
+ }[];
99
+ }, {
100
+ rules: {
101
+ message: string;
102
+ id: string;
103
+ internalId: string;
104
+ internalVersionId: string;
105
+ prompt: string;
106
+ severity: "suggestion" | "violation";
107
+ schema?: any;
108
+ }[];
109
+ }>;
110
+ export type GetRulesRequest = z.infer<typeof GetRulesRequestSchema>;
111
+ export type GetRulesResponse = z.infer<typeof GetRulesResponseSchema>;
112
+ export declare const ValidateViolationRequestSchema: z.ZodObject<{
113
+ rule: z.ZodObject<{
114
+ internalId: z.ZodString;
115
+ internalVersionId: z.ZodString;
116
+ contents: z.ZodString;
117
+ }, "strip", z.ZodTypeAny, {
118
+ internalId: string;
119
+ internalVersionId: string;
120
+ contents: string;
121
+ }, {
122
+ internalId: string;
123
+ internalVersionId: string;
124
+ contents: string;
125
+ }>;
126
+ matches: z.ZodArray<z.ZodAny, "many">;
127
+ powerlint_version: z.ZodString;
128
+ schema_version: z.ZodString;
129
+ }, "strip", z.ZodTypeAny, {
130
+ powerlint_version: string;
131
+ schema_version: string;
132
+ rule: {
133
+ internalId: string;
134
+ internalVersionId: string;
135
+ contents: string;
136
+ };
137
+ matches: any[];
138
+ }, {
139
+ powerlint_version: string;
140
+ schema_version: string;
141
+ rule: {
142
+ internalId: string;
143
+ internalVersionId: string;
144
+ contents: string;
145
+ };
146
+ matches: any[];
147
+ }>;
148
+ export type ValidateViolationRequest = z.infer<typeof ValidateViolationRequestSchema>;
149
+ export type ValidateViolationResponse = z.infer<typeof ValidateViolationResponseSchema>;
150
+ /**
151
+ * Configuration for the Wispbit API client
152
+ */
153
+ export interface WispbitApiClientConfig {
154
+ baseUrl: string;
155
+ apiKey: string;
156
+ }
157
+ /**
158
+ * Unified API client for all Wispbit API calls with automatic retry logic
159
+ */
160
+ export declare class WispbitApiClient {
161
+ private baseUrl;
162
+ private apiKey;
163
+ constructor(config: WispbitApiClientConfig);
164
+ /**
165
+ * Make a request to the Wispbit API with retry logic
166
+ */
167
+ private request;
168
+ /**
169
+ * Initialize PowerLint configuration with Wispbit
170
+ */
171
+ initialize(request: InitializeRequest): Promise<InitializeResponse>;
172
+ /**
173
+ * Get rules from Wispbit Cloud
174
+ */
175
+ getRules(request: GetRulesRequest): Promise<GetRulesResponse>;
176
+ /**
177
+ * Validate violations with Wispbit
178
+ */
179
+ validateViolation(request: ValidateViolationRequest): Promise<ValidateViolationResponse>;
180
+ /**
181
+ * Validate violations with Wispbit (internal endpoint for testing)
182
+ */
183
+ validateViolationInternal(request: ValidateViolationRequest): Promise<ValidateViolationResponse>;
184
+ }
185
+ //# sourceMappingURL=WispbitApiClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WispbitApiClient.d.ts","sourceRoot":"","sources":["../../../src/api/WispbitApiClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAA;A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OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKnE;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAS9F;;OAEG;IACG,yBAAyB,CAC7B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;CAQtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AAkBA,OAAO,EAAE,KAAK,EAAgC,MAAM,iBAAiB,CAAA;AAsHrE;;GAEG;AACH,wBAAsB,eAAe,kBAcpC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAA;IACpC,OAAO,EAAE,KAAK,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AAkBA,OAAO,EAAE,KAAK,EAAgC,MAAM,iBAAiB,CAAA;AAgIrE;;GAEG;AACH,wBAAsB,eAAe,kBAcpC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAA;IACpC,OAAO,EAAE,KAAK,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
@@ -1,3 +1,4 @@
1
+ import { WispbitApiClient } from "powerlint/api/WispbitApiClient";
1
2
  import { PowerLintConfig } from "powerlint/config";
2
3
  import { Environment } from "powerlint/environment/Environment";
3
4
  export interface InitializeResult {
@@ -12,7 +13,11 @@ export declare class Config {
12
13
  private config;
13
14
  private apiKey;
14
15
  private baseUrl;
15
- constructor(config: Partial<PowerLintConfig>);
16
+ private apiClient;
17
+ private useInternalEndpoint;
18
+ constructor(config: Partial<PowerLintConfig>, options?: {
19
+ useInternalEndpoint?: boolean;
20
+ });
16
21
  getIgnoredGlobs(): string[];
17
22
  /**
18
23
  * Get the Wispbit API key
@@ -24,6 +29,11 @@ export declare class Config {
24
29
  * @returns The base URL
25
30
  */
26
31
  getBaseUrl(): string;
32
+ /**
33
+ * Get the Wispbit API client
34
+ * @returns The API client instance
35
+ */
36
+ getApiClient(): WispbitApiClient;
27
37
  /**
28
38
  * Get the local PowerLint version
29
39
  * @returns The current PowerLint version
@@ -34,10 +44,6 @@ export declare class Config {
34
44
  * @returns The schema version
35
45
  */
36
46
  getSchemaVersion(): string;
37
- /**
38
- * Validate API key with Wispbit API
39
- */
40
- private static validateApiKey;
41
47
  /**
42
48
  * Initialize configuration without network validation (for testing)
43
49
  * @param options Optional configuration options
@@ -65,5 +71,9 @@ export declare class Config {
65
71
  * Check if PowerLint is configured (has valid API key)
66
72
  */
67
73
  isConfigured(): boolean;
74
+ /**
75
+ * Check if the internal validation endpoint should be used
76
+ */
77
+ shouldUseInternalEndpoint(): boolean;
68
78
  }
69
79
  //# sourceMappingURL=Config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/environment/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAG/D,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,MAAM,CAAC,EAAE;QACP,aAA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ValidationProvider {
8
8
  * @param params Validation parameters
9
9
  * @returns Promise that resolves to validation results
10
10
  */
11
- validateViolations(params: ViolationValidationParams): Promise<ViolationValidationResult[]>;
11
+ validateViolations(params: ViolationValidationParams): Promise<ViolationValidationResponse>;
12
12
  }
13
13
  /**
14
14
  * Parameters for violation validation
@@ -20,17 +20,13 @@ export interface ViolationValidationParams {
20
20
  matches: Match[];
21
21
  }
22
22
  /**
23
- * Result of violation validation for a single match
23
+ * Response from violation validation
24
24
  */
25
- export interface ViolationValidationResult {
26
- /** The match ID that was validated */
27
- matchId: string;
28
- /** Whether this is a valid violation */
29
- isViolation: boolean;
30
- /** Explanation of the validation decision */
31
- reason: string;
32
- /** Confidence score (0-1) */
33
- confidence: number;
25
+ export interface ViolationValidationResponse {
26
+ /** Matches that are valid violations */
27
+ validMatches: Match[];
28
+ /** Matches that are not violations */
29
+ skippedMatches: Match[];
34
30
  }
35
31
  /**
36
32
  * Configuration interface for violation validation providers
@@ -1 +1 @@
1
- {"version":3,"file":"ViolationValidationProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ViolationValidationProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAA;CAC5F;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,uCAAuC;IACvC,IAAI,EAAE,IAAI,CAAA;IACV,8BAA8B;IAC9B,OAAO,EAAE,KAAK,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,WAAW,EAAE,OAAO,CAAA;IACpB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB"}
1
+ {"version":3,"file":"ViolationValidationProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ViolationValidationProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;CAC5F;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,uCAAuC;IACvC,IAAI,EAAE,IAAI,CAAA;IACV,8BAA8B;IAC9B,OAAO,EAAE,KAAK,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,wCAAwC;IACxC,YAAY,EAAE,KAAK,EAAE,CAAA;IACrB,sCAAsC;IACtC,cAAc,EAAE,KAAK,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB"}
@@ -9,10 +9,6 @@ export declare class WispbitRuleProvider implements RuleProvider {
9
9
  private config;
10
10
  private environment;
11
11
  constructor(config: Config, environment: Environment);
12
- /**
13
- * Make a request to the Wispbit API
14
- */
15
- private makeApiRequest;
16
12
  /**
17
13
  * Get the repository URL for API requests
18
14
  */
@@ -29,17 +25,5 @@ export declare class WispbitRuleProvider implements RuleProvider {
29
25
  * Fetch rules from Wispbit Cloud API
30
26
  */
31
27
  private fetchRules;
32
- /**
33
- * Create a new rule in Wispbit Cloud
34
- */
35
- createRule(_rule: Rule): Promise<string>;
36
- /**
37
- * Update an existing rule in Wispbit Cloud
38
- */
39
- updateRule(_ruleId: string, _rule: Rule): Promise<void>;
40
- /**
41
- * Delete a rule from Wispbit Cloud
42
- */
43
- deleteRule(_ruleId: string): Promise<void>;
44
28
  }
45
29
  //# sourceMappingURL=WispbitRuleProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WispbitRuleProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/WispbitRuleProvider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAc3C;;GAEG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,WAAW,CAAa;gBAEpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;IAKpD;;OAEG;YACW,cAAc;IAqB5B;;OAEG;YACW,gBAAgB;IAU9B;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjD;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAIrC;;OAEG;YACW,UAAU;IA0CxB;;OAEG;IACG,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9C;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIjD"}
1
+ {"version":3,"file":"WispbitRuleProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/WispbitRuleProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C;;GAEG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,WAAW,CAAa;gBAEpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;IAKpD;;OAEG;YACW,gBAAgB;IAU9B;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjD;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAIrC;;OAEG;YACW,UAAU;CAuBzB"}
@@ -1,15 +1,12 @@
1
1
  import type { Config } from "powerlint/environment/Config";
2
- import type { ViolationValidationProvider, ViolationValidationParams, ViolationValidationResult } from "powerlint/providers/ViolationValidationProvider";
2
+ import type { ViolationValidationProvider, ViolationValidationParams, ViolationValidationResponse } from "powerlint/providers/ViolationValidationProvider";
3
3
  /**
4
4
  * Violation validation provider that uses Wispbit's specialized validation endpoint
5
5
  */
6
6
  export declare class WispbitViolationValidationProvider implements ViolationValidationProvider {
7
7
  private config;
8
- constructor(config: Config);
9
- validateViolations(params: ViolationValidationParams): Promise<ViolationValidationResult[]>;
10
- /**
11
- * Generate a unique ID for a single match
12
- */
13
- private generateMatchId;
8
+ private useInternalEndpoint;
9
+ constructor(config: Config, useInternalEndpoint?: boolean);
10
+ validateViolations(params: ViolationValidationParams): Promise<ViolationValidationResponse>;
14
11
  }
15
12
  //# sourceMappingURL=WispbitViolationValidationProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WispbitViolationValidationProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/WispbitViolationValidationProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,iDAAiD,CAAA;AAIxD;;GAEG;AACH,qBAAa,kCAAmC,YAAW,2BAA2B;IACpF,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,MAAM;IAIpB,kBAAkB,CACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,yBAAyB,EAAE,CAAC;IA0DvC;;OAEG;IACH,OAAO,CAAC,eAAe;CAWxB"}
1
+ {"version":3,"file":"WispbitViolationValidationProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/WispbitViolationValidationProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,iDAAiD,CAAA;AAExD;;GAEG;AACH,qBAAa,kCAAmC,YAAW,2BAA2B;IACpF,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,mBAAmB,CAAS;gBAExB,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAE,OAAe;IAK1D,kBAAkB,CACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,2BAA2B,CAAC;CAyBxC"}