@sfdxy/mule-lint 1.16.2 → 1.16.3

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 (49) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/rules/documentation/DisplayNameRule.d.ts +17 -0
  3. package/dist/src/rules/documentation/DisplayNameRule.d.ts.map +1 -0
  4. package/dist/src/rules/documentation/DisplayNameRule.js +46 -0
  5. package/dist/src/rules/documentation/DisplayNameRule.js.map +1 -0
  6. package/dist/src/rules/index.d.ts.map +1 -1
  7. package/dist/src/rules/index.js +21 -12
  8. package/dist/src/rules/index.js.map +1 -1
  9. package/dist/src/rules/logging/ExcessiveLoggersRule.d.ts +16 -0
  10. package/dist/src/rules/logging/ExcessiveLoggersRule.d.ts.map +1 -0
  11. package/dist/src/rules/logging/ExcessiveLoggersRule.js +45 -0
  12. package/dist/src/rules/logging/ExcessiveLoggersRule.js.map +1 -0
  13. package/dist/src/rules/operations/CommentedCodeRule.d.ts +17 -0
  14. package/dist/src/rules/operations/CommentedCodeRule.d.ts.map +1 -0
  15. package/dist/src/rules/operations/CommentedCodeRule.js +58 -0
  16. package/dist/src/rules/operations/CommentedCodeRule.js.map +1 -0
  17. package/dist/src/rules/operations/UnusedFlowRule.d.ts +17 -0
  18. package/dist/src/rules/operations/UnusedFlowRule.d.ts.map +1 -0
  19. package/dist/src/rules/operations/UnusedFlowRule.js +80 -0
  20. package/dist/src/rules/operations/UnusedFlowRule.js.map +1 -0
  21. package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts +16 -0
  22. package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts.map +1 -0
  23. package/dist/src/rules/performance/ReconnectionStrategyRule.js +60 -0
  24. package/dist/src/rules/performance/ReconnectionStrategyRule.js.map +1 -0
  25. package/dist/src/rules/security/EncryptionKeyInLogsRule.d.ts +17 -0
  26. package/dist/src/rules/security/EncryptionKeyInLogsRule.d.ts.map +1 -0
  27. package/dist/src/rules/security/EncryptionKeyInLogsRule.js +46 -0
  28. package/dist/src/rules/security/EncryptionKeyInLogsRule.js.map +1 -0
  29. package/dist/src/rules/standards/ApiKitValidationRule.d.ts +16 -0
  30. package/dist/src/rules/standards/ApiKitValidationRule.d.ts.map +1 -0
  31. package/dist/src/rules/standards/ApiKitValidationRule.js +39 -0
  32. package/dist/src/rules/standards/ApiKitValidationRule.js.map +1 -0
  33. package/dist/src/rules/standards/AutoDiscoveryRule.d.ts +16 -0
  34. package/dist/src/rules/standards/AutoDiscoveryRule.d.ts.map +1 -0
  35. package/dist/src/rules/standards/AutoDiscoveryRule.js +47 -0
  36. package/dist/src/rules/standards/AutoDiscoveryRule.js.map +1 -0
  37. package/dist/src/rules/standards/CronExternalizedRule.d.ts +16 -0
  38. package/dist/src/rules/standards/CronExternalizedRule.d.ts.map +1 -0
  39. package/dist/src/rules/standards/CronExternalizedRule.js +32 -0
  40. package/dist/src/rules/standards/CronExternalizedRule.js.map +1 -0
  41. package/dist/src/rules/standards/HttpPortPlaceholderRule.d.ts +16 -0
  42. package/dist/src/rules/standards/HttpPortPlaceholderRule.d.ts.map +1 -0
  43. package/dist/src/rules/standards/HttpPortPlaceholderRule.js +34 -0
  44. package/dist/src/rules/standards/HttpPortPlaceholderRule.js.map +1 -0
  45. package/package.json +1 -1
  46. package/dist/src/rules/operations/OperationsRules.d.ts +0 -137
  47. package/dist/src/rules/operations/OperationsRules.d.ts.map +0 -1
  48. package/dist/src/rules/operations/OperationsRules.js +0 -442
  49. package/dist/src/rules/operations/OperationsRules.js.map +0 -1
@@ -0,0 +1,16 @@
1
+ import { ValidationContext, Issue } from '../../types';
2
+ import { BaseRule } from '../base/BaseRule';
3
+ /**
4
+ * API-005: APIKit Validation
5
+ *
6
+ * APIs should use APIKit for auto-generated implementation interfaces.
7
+ */
8
+ export declare class ApiKitValidationRule extends BaseRule {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ severity: "info";
13
+ category: "standards";
14
+ validate(doc: Document, _context: ValidationContext): Issue[];
15
+ }
16
+ //# sourceMappingURL=ApiKitValidationRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiKitValidationRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/standards/ApiKitValidationRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAC9C,EAAE,SAAa;IACf,IAAI,SAAuB;IAC3B,WAAW,SAA0D;IACrE,QAAQ,EAAG,MAAM,CAAU;IAC3B,QAAQ,EAAG,WAAW,CAAU;IAEhC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;CAoChE"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiKitValidationRule = void 0;
4
+ const BaseRule_1 = require("../base/BaseRule");
5
+ /**
6
+ * API-005: APIKit Validation
7
+ *
8
+ * APIs should use APIKit for auto-generated implementation interfaces.
9
+ */
10
+ class ApiKitValidationRule extends BaseRule_1.BaseRule {
11
+ id = 'API-005';
12
+ name = 'APIKit Validation';
13
+ description = 'APIs should use APIKit for implementation interfaces';
14
+ severity = 'info';
15
+ category = 'standards';
16
+ validate(doc, _context) {
17
+ const issues = [];
18
+ // Check if this appears to be an API project (has HTTP listener)
19
+ const hasHttpListener = this.exists('//*[local-name()="listener"]', doc);
20
+ if (!hasHttpListener) {
21
+ return issues;
22
+ }
23
+ // Check for APIKit router
24
+ const hasApiKitRouter = this.exists('//*[local-name()="router"]', doc);
25
+ const hasApiKitConfig = this.exists('//*[local-name()="config" and contains(@name, "api")]', doc);
26
+ if (!hasApiKitRouter && !hasApiKitConfig) {
27
+ // Only flag if this looks like an interface file
28
+ const hasMainFlow = this.exists('//*[local-name()="flow" and (contains(@name, "-main") or contains(@name, "-api"))]', doc);
29
+ if (hasMainFlow) {
30
+ issues.push(this.createFileIssue('Consider using APIKit to auto-generate the implementation interface', {
31
+ suggestion: 'APIKit provides consistent API implementation patterns',
32
+ }));
33
+ }
34
+ }
35
+ return issues;
36
+ }
37
+ }
38
+ exports.ApiKitValidationRule = ApiKitValidationRule;
39
+ //# sourceMappingURL=ApiKitValidationRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiKitValidationRule.js","sourceRoot":"","sources":["../../../../src/rules/standards/ApiKitValidationRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,mBAAQ;IAC9C,EAAE,GAAG,SAAS,CAAC;IACf,IAAI,GAAG,mBAAmB,CAAC;IAC3B,WAAW,GAAG,sDAAsD,CAAC;IACrE,QAAQ,GAAG,MAAe,CAAC;IAC3B,QAAQ,GAAG,WAAoB,CAAC;IAEhC,QAAQ,CAAC,GAAa,EAAE,QAA2B;QAC/C,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,iEAAiE;QACjE,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,8BAA8B,EAAE,GAAG,CAAC,CAAC;QACzE,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,OAAO,MAAM,CAAC;QAClB,CAAC;QAED,0BAA0B;QAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;QACvE,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAC/B,uDAAuD,EACvD,GAAG,CACN,CAAC;QAEF,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,EAAE,CAAC;YACvC,iDAAiD;YACjD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAC3B,oFAAoF,EACpF,GAAG,CACN,CAAC;YACF,IAAI,WAAW,EAAE,CAAC;gBACd,MAAM,CAAC,IAAI,CACP,IAAI,CAAC,eAAe,CAChB,qEAAqE,EACrE;oBACI,UAAU,EAAE,wDAAwD;iBACvE,CACJ,CACJ,CAAC;YACN,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA3CD,oDA2CC"}
@@ -0,0 +1,16 @@
1
+ import { ValidationContext, Issue } from '../../types';
2
+ import { BaseRule } from '../base/BaseRule';
3
+ /**
4
+ * OPS-001: Auto-Discovery Configuration
5
+ *
6
+ * APIs should have auto-discovery configured for API Manager integration.
7
+ */
8
+ export declare class AutoDiscoveryRule extends BaseRule {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ severity: "info";
13
+ category: "standards";
14
+ validate(doc: Document, _context: ValidationContext): Issue[];
15
+ }
16
+ //# sourceMappingURL=AutoDiscoveryRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoDiscoveryRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/standards/AutoDiscoveryRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC3C,EAAE,SAAa;IACf,IAAI,SAAkC;IACtC,WAAW,SAAgE;IAC3E,QAAQ,EAAG,MAAM,CAAU;IAC3B,QAAQ,EAAG,WAAW,CAAU;IAEhC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;CA2ChE"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AutoDiscoveryRule = void 0;
4
+ const BaseRule_1 = require("../base/BaseRule");
5
+ /**
6
+ * OPS-001: Auto-Discovery Configuration
7
+ *
8
+ * APIs should have auto-discovery configured for API Manager integration.
9
+ */
10
+ class AutoDiscoveryRule extends BaseRule_1.BaseRule {
11
+ id = 'OPS-001';
12
+ name = 'Auto-Discovery Configuration';
13
+ description = 'APIs should have auto-discovery configured for API Manager';
14
+ severity = 'info';
15
+ category = 'standards';
16
+ validate(doc, _context) {
17
+ const issues = [];
18
+ // Check if this is an API (has APIKit router or HTTP listener)
19
+ const hasApiKitRouter = this.exists('//*[local-name()="router"]', doc);
20
+ const hasHttpListener = this.exists('//*[local-name()="listener"]', doc);
21
+ if (!hasApiKitRouter && !hasHttpListener) {
22
+ return issues; // Not an API, skip
23
+ }
24
+ // Check for auto-discovery configuration
25
+ const hasAutoDiscovery = this.exists('//*[local-name()="api-autodiscovery"]', doc);
26
+ if (!hasAutoDiscovery && hasApiKitRouter) {
27
+ issues.push(this.createFileIssue('API has no auto-discovery configuration for API Manager', {
28
+ suggestion: 'Add <api-gateway:autodiscovery> for API Manager integration',
29
+ }));
30
+ }
31
+ // If auto-discovery exists, check it uses placeholders
32
+ if (hasAutoDiscovery) {
33
+ const autodiscoveryNodes = this.select('//*[local-name()="api-autodiscovery"]', doc);
34
+ for (const node of autodiscoveryNodes) {
35
+ const apiId = this.getAttribute(node, 'apiId');
36
+ if (apiId && !apiId.includes('${')) {
37
+ issues.push(this.createIssue(node, 'Auto-discovery apiId should use a property placeholder', {
38
+ suggestion: 'Use apiId="${api.id}" instead of hardcoded value',
39
+ }));
40
+ }
41
+ }
42
+ }
43
+ return issues;
44
+ }
45
+ }
46
+ exports.AutoDiscoveryRule = AutoDiscoveryRule;
47
+ //# sourceMappingURL=AutoDiscoveryRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoDiscoveryRule.js","sourceRoot":"","sources":["../../../../src/rules/standards/AutoDiscoveryRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;GAIG;AACH,MAAa,iBAAkB,SAAQ,mBAAQ;IAC3C,EAAE,GAAG,SAAS,CAAC;IACf,IAAI,GAAG,8BAA8B,CAAC;IACt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ACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAlDD,8CAkDC"}
@@ -0,0 +1,16 @@
1
+ import { ValidationContext, Issue } from '../../types';
2
+ import { BaseRule } from '../base/BaseRule';
3
+ /**
4
+ * OPS-003: Cron Expression Externalized
5
+ *
6
+ * Cron expressions in schedulers should use property placeholders.
7
+ */
8
+ export declare class CronExternalizedRule extends BaseRule {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ severity: "warning";
13
+ category: "standards";
14
+ validate(doc: Document, _context: ValidationContext): Issue[];
15
+ }
16
+ //# sourceMappingURL=CronExternalizedRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronExternalizedRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/standards/CronExternalizedRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAC9C,EAAE,SAAa;IACf,IAAI,SAAkC;IACtC,WAAW,SAAuD;IAClE,QAAQ,EAAG,SAAS,CAAU;IAC9B,QAAQ,EAAG,WAAW,CAAU;IAEhC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;CAqBhE"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CronExternalizedRule = void 0;
4
+ const BaseRule_1 = require("../base/BaseRule");
5
+ /**
6
+ * OPS-003: Cron Expression Externalized
7
+ *
8
+ * Cron expressions in schedulers should use property placeholders.
9
+ */
10
+ class CronExternalizedRule extends BaseRule_1.BaseRule {
11
+ id = 'OPS-003';
12
+ name = 'Externalized Cron Expression';
13
+ description = 'Cron expressions should use property placeholders';
14
+ severity = 'warning';
15
+ category = 'standards';
16
+ validate(doc, _context) {
17
+ const issues = [];
18
+ // Find scheduler cron expressions
19
+ const cronNodes = this.select('//*[local-name()="cron"]', doc);
20
+ for (const node of cronNodes) {
21
+ const expression = this.getAttribute(node, 'expression');
22
+ if (expression && !expression.includes('${')) {
23
+ issues.push(this.createIssue(node, `Hardcoded cron expression: "${expression}"`, {
24
+ suggestion: 'Use expression="${scheduler.cron}" to allow environment-specific scheduling',
25
+ }));
26
+ }
27
+ }
28
+ return issues;
29
+ }
30
+ }
31
+ exports.CronExternalizedRule = CronExternalizedRule;
32
+ //# sourceMappingURL=CronExternalizedRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronExternalizedRule.js","sourceRoot":"","sources":["../../../../src/rules/standards/CronExternalizedRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,mBAAQ;IAC9C,EAAE,GAAG,SAAS,CAAC;IACf,IAAI,GAAG,8BAA8B,CAAC;IACtC,WAAW,GAAG,mDAAmD,CAAC;IAClE,QAAQ,GAAG,SAAkB,CAAC;IAC9B,QAAQ,GAAG,WAAoB,CAAC;IAEhC,QAAQ,CAAC,GAAa,EAAE,QAA2B;QAC/C,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,kCAAkC;QAClC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;QAE/D,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAEzD,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3C,MAAM,CAAC,IAAI,CACP,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,+BAA+B,UAAU,GAAG,EAAE;oBACjE,UAAU,EACN,6EAA6E;iBACpF,CAAC,CACL,CAAC;YACN,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA5BD,oDA4BC"}
@@ -0,0 +1,16 @@
1
+ import { ValidationContext, Issue } from '../../types';
2
+ import { BaseRule } from '../base/BaseRule';
3
+ /**
4
+ * OPS-002: HTTP Port Placeholder
5
+ *
6
+ * HTTP listener ports should use property placeholders, not hardcoded values.
7
+ */
8
+ export declare class HttpPortPlaceholderRule extends BaseRule {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ severity: "warning";
13
+ category: "standards";
14
+ validate(doc: Document, _context: ValidationContext): Issue[];
15
+ }
16
+ //# sourceMappingURL=HttpPortPlaceholderRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpPortPlaceholderRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/standards/HttpPortPlaceholderRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,QAAQ;IACjD,EAAE,SAAa;IACf,IAAI,SAA2B;IAC/B,WAAW,SAA0D;IACrE,QAAQ,EAAG,SAAS,CAAU;IAC9B,QAAQ,EAAG,WAAW,CAAU;IAEhC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;CAsBhE"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpPortPlaceholderRule = void 0;
4
+ const BaseRule_1 = require("../base/BaseRule");
5
+ /**
6
+ * OPS-002: HTTP Port Placeholder
7
+ *
8
+ * HTTP listener ports should use property placeholders, not hardcoded values.
9
+ */
10
+ class HttpPortPlaceholderRule extends BaseRule_1.BaseRule {
11
+ id = 'OPS-002';
12
+ name = 'HTTP Port Placeholder';
13
+ description = 'HTTP listener ports should use property placeholders';
14
+ severity = 'warning';
15
+ category = 'standards';
16
+ validate(doc, _context) {
17
+ const issues = [];
18
+ // Check HTTP listener configurations
19
+ const listenerConfigs = this.select('//*[local-name()="listener-config"]', doc);
20
+ for (const config of listenerConfigs) {
21
+ const port = this.getAttribute(config, 'port');
22
+ if (port && /^\d+$/.test(port)) {
23
+ // Port is a hardcoded number
24
+ const name = this.getNameAttribute(config) ?? 'HTTP Listener Config';
25
+ issues.push(this.createIssue(config, `HTTP config "${name}" has hardcoded port "${port}"`, {
26
+ suggestion: 'Use port="${http.port}" or similar placeholder',
27
+ }));
28
+ }
29
+ }
30
+ return issues;
31
+ }
32
+ }
33
+ exports.HttpPortPlaceholderRule = HttpPortPlaceholderRule;
34
+ //# sourceMappingURL=HttpPortPlaceholderRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpPortPlaceholderRule.js","sourceRoot":"","sources":["../../../../src/rules/standards/HttpPortPlaceholderRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,mBAAQ;IACjD,EAAE,GAAG,SAAS,CAAC;IACf,IAAI,GAAG,uBAAuB,CAAC;IAC/B,WAAW,GAAG,sDAAsD,CAAC;IACrE,QAAQ,GAAG,SAAkB,CAAC;IAC9B,QAAQ,GAAG,WAAoB,CAAC;IAEhC,QAAQ,CAAC,GAAa,EAAE,QAA2B;QAC/C,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,qCAAqC;QACrC,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;QAEhF,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;YACnC,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAE/C,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7B,6BAA6B;gBAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,sBAAsB,CAAC;gBACrE,MAAM,CAAC,IAAI,CACP,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,gBAAgB,IAAI,yBAAyB,IAAI,GAAG,EAAE;oBAC3E,UAAU,EAAE,gDAAgD;iBAC/D,CAAC,CACL,CAAC;YACN,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA7BD,0DA6BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfdxy/mule-lint",
3
- "version": "1.16.2",
3
+ "version": "1.16.3",
4
4
  "description": "Static analysis tool for MuleSoft applications - supports humans, AI agents, and CI/CD pipelines",
5
5
  "author": "Avinava",
6
6
  "license": "MIT",
@@ -1,137 +0,0 @@
1
- import { ValidationContext, Issue } from '../../types';
2
- import { BaseRule } from '../base/BaseRule';
3
- /**
4
- * RES-001: Reconnection Strategy
5
- *
6
- * Connectors should have reconnection strategies configured for resilience.
7
- */
8
- export declare class ReconnectionStrategyRule extends BaseRule {
9
- id: string;
10
- name: string;
11
- description: string;
12
- severity: "warning";
13
- category: "performance";
14
- validate(doc: Document, _context: ValidationContext): Issue[];
15
- }
16
- /**
17
- * OPS-001: Auto-Discovery Configuration
18
- *
19
- * APIs should have auto-discovery configured for API Manager integration.
20
- */
21
- export declare class AutoDiscoveryRule extends BaseRule {
22
- id: string;
23
- name: string;
24
- description: string;
25
- severity: "info";
26
- category: "standards";
27
- validate(doc: Document, _context: ValidationContext): Issue[];
28
- }
29
- /**
30
- * OPS-002: HTTP Port Placeholder
31
- *
32
- * HTTP listener ports should use property placeholders, not hardcoded values.
33
- */
34
- export declare class HttpPortPlaceholderRule extends BaseRule {
35
- id: string;
36
- name: string;
37
- description: string;
38
- severity: "warning";
39
- category: "standards";
40
- validate(doc: Document, _context: ValidationContext): Issue[];
41
- }
42
- /**
43
- * SEC-006: Encryption Key in Logs
44
- *
45
- * Encryption keys and sensitive credentials should not appear in log statements.
46
- */
47
- export declare class EncryptionKeyInLogsRule extends BaseRule {
48
- id: string;
49
- name: string;
50
- description: string;
51
- severity: "error";
52
- category: "security";
53
- private sensitivePatterns;
54
- validate(doc: Document, _context: ValidationContext): Issue[];
55
- }
56
- /**
57
- * HYG-001: Excessive Loggers
58
- *
59
- * Flows should not have too many loggers which can impact performance.
60
- */
61
- export declare class ExcessiveLoggersRule extends BaseRule {
62
- id: string;
63
- name: string;
64
- description: string;
65
- severity: "warning";
66
- category: "logging";
67
- validate(doc: Document, context: ValidationContext): Issue[];
68
- }
69
- /**
70
- * HYG-002: Commented Code Detection
71
- *
72
- * Detects potentially commented-out code blocks in Mule configurations.
73
- */
74
- export declare class CommentedCodeRule extends BaseRule {
75
- id: string;
76
- name: string;
77
- description: string;
78
- severity: "info";
79
- category: "standards";
80
- private codePatterns;
81
- validate(doc: Document, _context: ValidationContext): Issue[];
82
- }
83
- /**
84
- * OPS-003: Cron Expression Externalized
85
- *
86
- * Cron expressions in schedulers should use property placeholders.
87
- */
88
- export declare class CronExternalizedRule extends BaseRule {
89
- id: string;
90
- name: string;
91
- description: string;
92
- severity: "warning";
93
- category: "standards";
94
- validate(doc: Document, _context: ValidationContext): Issue[];
95
- }
96
- /**
97
- * API-005: APIKit Validation
98
- *
99
- * APIs should use APIKit for auto-generated implementation interfaces.
100
- */
101
- export declare class ApiKitValidationRule extends BaseRule {
102
- id: string;
103
- name: string;
104
- description: string;
105
- severity: "info";
106
- category: "standards";
107
- validate(doc: Document, _context: ValidationContext): Issue[];
108
- }
109
- /**
110
- * HYG-003: Unused Flow Detection
111
- *
112
- * Detects flows that are never referenced by flow-ref.
113
- */
114
- export declare class UnusedFlowRule extends BaseRule {
115
- id: string;
116
- name: string;
117
- description: string;
118
- severity: "warning";
119
- category: "standards";
120
- validate(doc: Document, _context: ValidationContext): Issue[];
121
- private isExternallyReferenced;
122
- }
123
- /**
124
- * DOC-001: Display Name Enforcement
125
- *
126
- * Key components should have meaningful doc:name attributes, not defaults.
127
- */
128
- export declare class DisplayNameRule extends BaseRule {
129
- id: string;
130
- name: string;
131
- description: string;
132
- severity: "info";
133
- category: "documentation";
134
- private componentDefaults;
135
- validate(doc: Document, _context: ValidationContext): Issue[];
136
- }
137
- //# sourceMappingURL=OperationsRules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OperationsRules.d.ts","sourceRoot":"","sources":["../../../../src/rules/operations/OperationsRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,QAAQ;IAClD,EAAE,SAAa;IACf,IAAI,SAA2B;IAC/B,WAAW,SAA+D;IAC1E,QAAQ,EAAG,SAAS,CAAU;IAC9B,QAAQ,EAAG,aAAa,CAAU;IAElC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;CAmEhE;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC3C,EAAE,SAAa;IACf,IAAI,SAAkC;IACtC,WAAW,SAAgE;IAC3E,QAAQ,EAAG,MAAM,CAAU;IAC3B,QAAQ,EAAG,WAAW,CAAU;IAEhC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;CA2ChE;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,QAAQ;IACjD,EAAE,SAAa;IACf,IAAI,SAA2B;IAC/B,WAAW,SAA0D;IACrE,QAAQ,EAAG,SAAS,CAAU;IAC9B,QAAQ,EAAG,WAAW,CAAU;IAEhC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,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