driftdetect-detectors 0.1.0
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/accessibility/alt-text.d.ts +63 -0
- package/dist/accessibility/alt-text.d.ts.map +1 -0
- package/dist/accessibility/alt-text.js +100 -0
- package/dist/accessibility/alt-text.js.map +1 -0
- package/dist/accessibility/aria-roles.d.ts +65 -0
- package/dist/accessibility/aria-roles.d.ts.map +1 -0
- package/dist/accessibility/aria-roles.js +87 -0
- package/dist/accessibility/aria-roles.js.map +1 -0
- package/dist/accessibility/focus-management.d.ts +62 -0
- package/dist/accessibility/focus-management.d.ts.map +1 -0
- package/dist/accessibility/focus-management.js +88 -0
- package/dist/accessibility/focus-management.js.map +1 -0
- package/dist/accessibility/heading-hierarchy.d.ts +66 -0
- package/dist/accessibility/heading-hierarchy.d.ts.map +1 -0
- package/dist/accessibility/heading-hierarchy.js +94 -0
- package/dist/accessibility/heading-hierarchy.js.map +1 -0
- package/dist/accessibility/index.d.ts +25 -0
- package/dist/accessibility/index.d.ts.map +1 -0
- package/dist/accessibility/index.js +21 -0
- package/dist/accessibility/index.js.map +1 -0
- package/dist/accessibility/keyboard-nav.d.ts +63 -0
- package/dist/accessibility/keyboard-nav.d.ts.map +1 -0
- package/dist/accessibility/keyboard-nav.js +86 -0
- package/dist/accessibility/keyboard-nav.js.map +1 -0
- package/dist/accessibility/semantic-html.d.ts +76 -0
- package/dist/accessibility/semantic-html.d.ts.map +1 -0
- package/dist/accessibility/semantic-html.js +204 -0
- package/dist/accessibility/semantic-html.js.map +1 -0
- package/dist/api/client-patterns.d.ts +121 -0
- package/dist/api/client-patterns.d.ts.map +1 -0
- package/dist/api/client-patterns.js +478 -0
- package/dist/api/client-patterns.js.map +1 -0
- package/dist/api/error-format.d.ts +140 -0
- package/dist/api/error-format.d.ts.map +1 -0
- package/dist/api/error-format.js +614 -0
- package/dist/api/error-format.js.map +1 -0
- package/dist/api/http-methods.d.ts +255 -0
- package/dist/api/http-methods.d.ts.map +1 -0
- package/dist/api/http-methods.js +890 -0
- package/dist/api/http-methods.js.map +1 -0
- package/dist/api/index.d.ts +16 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +37 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/pagination.d.ts +133 -0
- package/dist/api/pagination.d.ts.map +1 -0
- package/dist/api/pagination.js +521 -0
- package/dist/api/pagination.js.map +1 -0
- package/dist/api/response-envelope.d.ts +261 -0
- package/dist/api/response-envelope.d.ts.map +1 -0
- package/dist/api/response-envelope.js +1050 -0
- package/dist/api/response-envelope.js.map +1 -0
- package/dist/api/retry-patterns.d.ts +117 -0
- package/dist/api/retry-patterns.d.ts.map +1 -0
- package/dist/api/retry-patterns.js +480 -0
- package/dist/api/retry-patterns.js.map +1 -0
- package/dist/api/route-structure.d.ts +128 -0
- package/dist/api/route-structure.d.ts.map +1 -0
- package/dist/api/route-structure.js +738 -0
- package/dist/api/route-structure.js.map +1 -0
- package/dist/auth/audit-logging.d.ts +80 -0
- package/dist/auth/audit-logging.d.ts.map +1 -0
- package/dist/auth/audit-logging.js +370 -0
- package/dist/auth/audit-logging.js.map +1 -0
- package/dist/auth/index.d.ts +33 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +49 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/middleware-usage.d.ts +65 -0
- package/dist/auth/middleware-usage.d.ts.map +1 -0
- package/dist/auth/middleware-usage.js +192 -0
- package/dist/auth/middleware-usage.js.map +1 -0
- package/dist/auth/permission-checks.d.ts +60 -0
- package/dist/auth/permission-checks.d.ts.map +1 -0
- package/dist/auth/permission-checks.js +159 -0
- package/dist/auth/permission-checks.js.map +1 -0
- package/dist/auth/rbac-patterns.d.ts +68 -0
- package/dist/auth/rbac-patterns.d.ts.map +1 -0
- package/dist/auth/rbac-patterns.js +143 -0
- package/dist/auth/rbac-patterns.js.map +1 -0
- package/dist/auth/resource-ownership.d.ts +77 -0
- package/dist/auth/resource-ownership.d.ts.map +1 -0
- package/dist/auth/resource-ownership.js +324 -0
- package/dist/auth/resource-ownership.js.map +1 -0
- package/dist/auth/token-handling.d.ts +64 -0
- package/dist/auth/token-handling.d.ts.map +1 -0
- package/dist/auth/token-handling.js +151 -0
- package/dist/auth/token-handling.js.map +1 -0
- package/dist/base/ast-detector.d.ts +421 -0
- package/dist/base/ast-detector.d.ts.map +1 -0
- package/dist/base/ast-detector.js +699 -0
- package/dist/base/ast-detector.js.map +1 -0
- package/dist/base/base-detector.d.ts +366 -0
- package/dist/base/base-detector.d.ts.map +1 -0
- package/dist/base/base-detector.js +170 -0
- package/dist/base/base-detector.js.map +1 -0
- package/dist/base/index.d.ts +12 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +17 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/regex-detector.d.ts +421 -0
- package/dist/base/regex-detector.d.ts.map +1 -0
- package/dist/base/regex-detector.js +537 -0
- package/dist/base/regex-detector.js.map +1 -0
- package/dist/base/structural-detector.d.ts +424 -0
- package/dist/base/structural-detector.d.ts.map +1 -0
- package/dist/base/structural-detector.js +731 -0
- package/dist/base/structural-detector.js.map +1 -0
- package/dist/base/types.d.ts +53 -0
- package/dist/base/types.d.ts.map +1 -0
- package/dist/base/types.js +5 -0
- package/dist/base/types.js.map +1 -0
- package/dist/components/component-structure.d.ts +163 -0
- package/dist/components/component-structure.d.ts.map +1 -0
- package/dist/components/component-structure.js +500 -0
- package/dist/components/component-structure.js.map +1 -0
- package/dist/components/composition.d.ts +287 -0
- package/dist/components/composition.d.ts.map +1 -0
- package/dist/components/composition.js +1123 -0
- package/dist/components/composition.js.map +1 -0
- package/dist/components/duplicate-detection.d.ts +251 -0
- package/dist/components/duplicate-detection.d.ts.map +1 -0
- package/dist/components/duplicate-detection.js +804 -0
- package/dist/components/duplicate-detection.js.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +51 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/near-duplicate.d.ts +402 -0
- package/dist/components/near-duplicate.d.ts.map +1 -0
- package/dist/components/near-duplicate.js +1090 -0
- package/dist/components/near-duplicate.js.map +1 -0
- package/dist/components/props-patterns.d.ts +194 -0
- package/dist/components/props-patterns.d.ts.map +1 -0
- package/dist/components/props-patterns.js +795 -0
- package/dist/components/props-patterns.js.map +1 -0
- package/dist/components/ref-forwarding.d.ts +250 -0
- package/dist/components/ref-forwarding.d.ts.map +1 -0
- package/dist/components/ref-forwarding.js +832 -0
- package/dist/components/ref-forwarding.js.map +1 -0
- package/dist/components/state-patterns.d.ts +291 -0
- package/dist/components/state-patterns.d.ts.map +1 -0
- package/dist/components/state-patterns.js +970 -0
- package/dist/components/state-patterns.js.map +1 -0
- package/dist/config/config-validation.d.ts +74 -0
- package/dist/config/config-validation.d.ts.map +1 -0
- package/dist/config/config-validation.js +446 -0
- package/dist/config/config-validation.js.map +1 -0
- package/dist/config/default-values.d.ts +72 -0
- package/dist/config/default-values.d.ts.map +1 -0
- package/dist/config/default-values.js +386 -0
- package/dist/config/default-values.js.map +1 -0
- package/dist/config/env-naming.d.ts +73 -0
- package/dist/config/env-naming.d.ts.map +1 -0
- package/dist/config/env-naming.js +429 -0
- package/dist/config/env-naming.js.map +1 -0
- package/dist/config/environment-detection.d.ts +72 -0
- package/dist/config/environment-detection.d.ts.map +1 -0
- package/dist/config/environment-detection.js +400 -0
- package/dist/config/environment-detection.js.map +1 -0
- package/dist/config/feature-flags.d.ts +72 -0
- package/dist/config/feature-flags.d.ts.map +1 -0
- package/dist/config/feature-flags.js +384 -0
- package/dist/config/feature-flags.js.map +1 -0
- package/dist/config/index.d.ts +27 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +43 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/required-optional.d.ts +71 -0
- package/dist/config/required-optional.d.ts.map +1 -0
- package/dist/config/required-optional.js +344 -0
- package/dist/config/required-optional.js.map +1 -0
- package/dist/data-access/connection-pooling.d.ts +63 -0
- package/dist/data-access/connection-pooling.d.ts.map +1 -0
- package/dist/data-access/connection-pooling.js +297 -0
- package/dist/data-access/connection-pooling.js.map +1 -0
- package/dist/data-access/dto-patterns.d.ts +64 -0
- package/dist/data-access/dto-patterns.d.ts.map +1 -0
- package/dist/data-access/dto-patterns.js +291 -0
- package/dist/data-access/dto-patterns.js.map +1 -0
- package/dist/data-access/index.d.ts +31 -0
- package/dist/data-access/index.d.ts.map +1 -0
- package/dist/data-access/index.js +49 -0
- package/dist/data-access/index.js.map +1 -0
- package/dist/data-access/n-plus-one.d.ts +60 -0
- package/dist/data-access/n-plus-one.d.ts.map +1 -0
- package/dist/data-access/n-plus-one.js +264 -0
- package/dist/data-access/n-plus-one.js.map +1 -0
- package/dist/data-access/query-patterns.d.ts +64 -0
- package/dist/data-access/query-patterns.d.ts.map +1 -0
- package/dist/data-access/query-patterns.js +314 -0
- package/dist/data-access/query-patterns.js.map +1 -0
- package/dist/data-access/repository-pattern.d.ts +62 -0
- package/dist/data-access/repository-pattern.d.ts.map +1 -0
- package/dist/data-access/repository-pattern.js +257 -0
- package/dist/data-access/repository-pattern.js.map +1 -0
- package/dist/data-access/transaction-patterns.d.ts +61 -0
- package/dist/data-access/transaction-patterns.d.ts.map +1 -0
- package/dist/data-access/transaction-patterns.js +277 -0
- package/dist/data-access/transaction-patterns.js.map +1 -0
- package/dist/data-access/validation-patterns.d.ts +62 -0
- package/dist/data-access/validation-patterns.d.ts.map +1 -0
- package/dist/data-access/validation-patterns.js +301 -0
- package/dist/data-access/validation-patterns.js.map +1 -0
- package/dist/documentation/deprecation.d.ts +62 -0
- package/dist/documentation/deprecation.d.ts.map +1 -0
- package/dist/documentation/deprecation.js +83 -0
- package/dist/documentation/deprecation.js.map +1 -0
- package/dist/documentation/example-code.d.ts +64 -0
- package/dist/documentation/example-code.d.ts.map +1 -0
- package/dist/documentation/example-code.js +79 -0
- package/dist/documentation/example-code.js.map +1 -0
- package/dist/documentation/index.d.ts +22 -0
- package/dist/documentation/index.d.ts.map +1 -0
- package/dist/documentation/index.js +19 -0
- package/dist/documentation/index.js.map +1 -0
- package/dist/documentation/jsdoc-patterns.d.ts +72 -0
- package/dist/documentation/jsdoc-patterns.d.ts.map +1 -0
- package/dist/documentation/jsdoc-patterns.js +92 -0
- package/dist/documentation/jsdoc-patterns.js.map +1 -0
- package/dist/documentation/readme-structure.d.ts +67 -0
- package/dist/documentation/readme-structure.d.ts.map +1 -0
- package/dist/documentation/readme-structure.js +76 -0
- package/dist/documentation/readme-structure.js.map +1 -0
- package/dist/documentation/todo-patterns.d.ts +67 -0
- package/dist/documentation/todo-patterns.d.ts.map +1 -0
- package/dist/documentation/todo-patterns.js +73 -0
- package/dist/documentation/todo-patterns.js.map +1 -0
- package/dist/errors/async-errors.d.ts +72 -0
- package/dist/errors/async-errors.d.ts.map +1 -0
- package/dist/errors/async-errors.js +214 -0
- package/dist/errors/async-errors.js.map +1 -0
- package/dist/errors/circuit-breaker.d.ts +53 -0
- package/dist/errors/circuit-breaker.d.ts.map +1 -0
- package/dist/errors/circuit-breaker.js +241 -0
- package/dist/errors/circuit-breaker.js.map +1 -0
- package/dist/errors/error-codes.d.ts +73 -0
- package/dist/errors/error-codes.d.ts.map +1 -0
- package/dist/errors/error-codes.js +211 -0
- package/dist/errors/error-codes.js.map +1 -0
- package/dist/errors/error-logging.d.ts +73 -0
- package/dist/errors/error-logging.d.ts.map +1 -0
- package/dist/errors/error-logging.js +256 -0
- package/dist/errors/error-logging.js.map +1 -0
- package/dist/errors/error-propagation.d.ts +73 -0
- package/dist/errors/error-propagation.d.ts.map +1 -0
- package/dist/errors/error-propagation.js +244 -0
- package/dist/errors/error-propagation.js.map +1 -0
- package/dist/errors/exception-hierarchy.d.ts +75 -0
- package/dist/errors/exception-hierarchy.d.ts.map +1 -0
- package/dist/errors/exception-hierarchy.js +259 -0
- package/dist/errors/exception-hierarchy.js.map +1 -0
- package/dist/errors/index.d.ts +31 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +49 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/try-catch-placement.d.ts +73 -0
- package/dist/errors/try-catch-placement.d.ts.map +1 -0
- package/dist/errors/try-catch-placement.js +214 -0
- package/dist/errors/try-catch-placement.js.map +1 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/context-fields.d.ts +48 -0
- package/dist/logging/context-fields.d.ts.map +1 -0
- package/dist/logging/context-fields.js +160 -0
- package/dist/logging/context-fields.js.map +1 -0
- package/dist/logging/correlation-ids.d.ts +44 -0
- package/dist/logging/correlation-ids.d.ts.map +1 -0
- package/dist/logging/correlation-ids.js +144 -0
- package/dist/logging/correlation-ids.js.map +1 -0
- package/dist/logging/health-checks.d.ts +45 -0
- package/dist/logging/health-checks.d.ts.map +1 -0
- package/dist/logging/health-checks.js +165 -0
- package/dist/logging/health-checks.js.map +1 -0
- package/dist/logging/index.d.ts +31 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +49 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/log-levels.d.ts +46 -0
- package/dist/logging/log-levels.d.ts.map +1 -0
- package/dist/logging/log-levels.js +178 -0
- package/dist/logging/log-levels.js.map +1 -0
- package/dist/logging/metric-naming.d.ts +46 -0
- package/dist/logging/metric-naming.d.ts.map +1 -0
- package/dist/logging/metric-naming.js +157 -0
- package/dist/logging/metric-naming.js.map +1 -0
- package/dist/logging/pii-redaction.d.ts +44 -0
- package/dist/logging/pii-redaction.d.ts.map +1 -0
- package/dist/logging/pii-redaction.js +166 -0
- package/dist/logging/pii-redaction.js.map +1 -0
- package/dist/logging/structured-format.d.ts +53 -0
- package/dist/logging/structured-format.d.ts.map +1 -0
- package/dist/logging/structured-format.js +235 -0
- package/dist/logging/structured-format.js.map +1 -0
- package/dist/performance/bundle-size.d.ts +79 -0
- package/dist/performance/bundle-size.d.ts.map +1 -0
- package/dist/performance/bundle-size.js +276 -0
- package/dist/performance/bundle-size.js.map +1 -0
- package/dist/performance/caching-patterns.d.ts +78 -0
- package/dist/performance/caching-patterns.d.ts.map +1 -0
- package/dist/performance/caching-patterns.js +257 -0
- package/dist/performance/caching-patterns.js.map +1 -0
- package/dist/performance/code-splitting.d.ts +86 -0
- package/dist/performance/code-splitting.d.ts.map +1 -0
- package/dist/performance/code-splitting.js +447 -0
- package/dist/performance/code-splitting.js.map +1 -0
- package/dist/performance/debounce-throttle.d.ts +75 -0
- package/dist/performance/debounce-throttle.d.ts.map +1 -0
- package/dist/performance/debounce-throttle.js +232 -0
- package/dist/performance/debounce-throttle.js.map +1 -0
- package/dist/performance/index.d.ts +28 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +39 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/lazy-loading.d.ts +75 -0
- package/dist/performance/lazy-loading.d.ts.map +1 -0
- package/dist/performance/lazy-loading.js +233 -0
- package/dist/performance/lazy-loading.js.map +1 -0
- package/dist/performance/memoization.d.ts +75 -0
- package/dist/performance/memoization.d.ts.map +1 -0
- package/dist/performance/memoization.js +251 -0
- package/dist/performance/memoization.js.map +1 -0
- package/dist/registry/detector-registry.d.ts +266 -0
- package/dist/registry/detector-registry.d.ts.map +1 -0
- package/dist/registry/detector-registry.js +526 -0
- package/dist/registry/detector-registry.js.map +1 -0
- package/dist/registry/index.d.ts +10 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +10 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/loader.d.ts +232 -0
- package/dist/registry/loader.d.ts.map +1 -0
- package/dist/registry/loader.js +419 -0
- package/dist/registry/loader.js.map +1 -0
- package/dist/registry/types.d.ts +111 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +19 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/security/csp-headers.d.ts +78 -0
- package/dist/security/csp-headers.d.ts.map +1 -0
- package/dist/security/csp-headers.js +401 -0
- package/dist/security/csp-headers.js.map +1 -0
- package/dist/security/csrf-protection.d.ts +72 -0
- package/dist/security/csrf-protection.d.ts.map +1 -0
- package/dist/security/csrf-protection.js +344 -0
- package/dist/security/csrf-protection.js.map +1 -0
- package/dist/security/index.d.ts +30 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +48 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/input-sanitization.d.ts +74 -0
- package/dist/security/input-sanitization.d.ts.map +1 -0
- package/dist/security/input-sanitization.js +373 -0
- package/dist/security/input-sanitization.js.map +1 -0
- package/dist/security/rate-limiting.d.ts +81 -0
- package/dist/security/rate-limiting.d.ts.map +1 -0
- package/dist/security/rate-limiting.js +535 -0
- package/dist/security/rate-limiting.js.map +1 -0
- package/dist/security/secret-management.d.ts +83 -0
- package/dist/security/secret-management.d.ts.map +1 -0
- package/dist/security/secret-management.js +547 -0
- package/dist/security/secret-management.js.map +1 -0
- package/dist/security/sql-injection.d.ts +76 -0
- package/dist/security/sql-injection.d.ts.map +1 -0
- package/dist/security/sql-injection.js +383 -0
- package/dist/security/sql-injection.js.map +1 -0
- package/dist/security/xss-prevention.d.ts +80 -0
- package/dist/security/xss-prevention.d.ts.map +1 -0
- package/dist/security/xss-prevention.js +416 -0
- package/dist/security/xss-prevention.js.map +1 -0
- package/dist/structural/barrel-exports.d.ts +178 -0
- package/dist/structural/barrel-exports.d.ts.map +1 -0
- package/dist/structural/barrel-exports.js +553 -0
- package/dist/structural/barrel-exports.js.map +1 -0
- package/dist/structural/circular-deps.d.ts +140 -0
- package/dist/structural/circular-deps.d.ts.map +1 -0
- package/dist/structural/circular-deps.js +422 -0
- package/dist/structural/circular-deps.js.map +1 -0
- package/dist/structural/co-location.d.ts +202 -0
- package/dist/structural/co-location.d.ts.map +1 -0
- package/dist/structural/co-location.js +640 -0
- package/dist/structural/co-location.js.map +1 -0
- package/dist/structural/directory-structure.d.ts +151 -0
- package/dist/structural/directory-structure.d.ts.map +1 -0
- package/dist/structural/directory-structure.js +457 -0
- package/dist/structural/directory-structure.js.map +1 -0
- package/dist/structural/file-naming.d.ts +61 -0
- package/dist/structural/file-naming.d.ts.map +1 -0
- package/dist/structural/file-naming.js +231 -0
- package/dist/structural/file-naming.js.map +1 -0
- package/dist/structural/import-ordering.d.ts +212 -0
- package/dist/structural/import-ordering.d.ts.map +1 -0
- package/dist/structural/import-ordering.js +821 -0
- package/dist/structural/import-ordering.js.map +1 -0
- package/dist/structural/index.d.ts +23 -0
- package/dist/structural/index.d.ts.map +1 -0
- package/dist/structural/index.js +26 -0
- package/dist/structural/index.js.map +1 -0
- package/dist/structural/module-boundaries.d.ts +164 -0
- package/dist/structural/module-boundaries.d.ts.map +1 -0
- package/dist/structural/module-boundaries.js +616 -0
- package/dist/structural/module-boundaries.js.map +1 -0
- package/dist/structural/package-boundaries.d.ts +182 -0
- package/dist/structural/package-boundaries.d.ts.map +1 -0
- package/dist/structural/package-boundaries.js +602 -0
- package/dist/structural/package-boundaries.js.map +1 -0
- package/dist/styling/class-naming.d.ts +263 -0
- package/dist/styling/class-naming.d.ts.map +1 -0
- package/dist/styling/class-naming.js +892 -0
- package/dist/styling/class-naming.js.map +1 -0
- package/dist/styling/color-usage.d.ts +213 -0
- package/dist/styling/color-usage.d.ts.map +1 -0
- package/dist/styling/color-usage.js +732 -0
- package/dist/styling/color-usage.js.map +1 -0
- package/dist/styling/design-tokens.d.ts +212 -0
- package/dist/styling/design-tokens.d.ts.map +1 -0
- package/dist/styling/design-tokens.js +748 -0
- package/dist/styling/design-tokens.js.map +1 -0
- package/dist/styling/index.d.ts +16 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +56 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/responsive.d.ts +304 -0
- package/dist/styling/responsive.d.ts.map +1 -0
- package/dist/styling/responsive.js +888 -0
- package/dist/styling/responsive.js.map +1 -0
- package/dist/styling/spacing-scale.d.ts +248 -0
- package/dist/styling/spacing-scale.d.ts.map +1 -0
- package/dist/styling/spacing-scale.js +865 -0
- package/dist/styling/spacing-scale.js.map +1 -0
- package/dist/styling/tailwind-patterns.d.ts +305 -0
- package/dist/styling/tailwind-patterns.d.ts.map +1 -0
- package/dist/styling/tailwind-patterns.js +1181 -0
- package/dist/styling/tailwind-patterns.js.map +1 -0
- package/dist/styling/typography.d.ts +281 -0
- package/dist/styling/typography.d.ts.map +1 -0
- package/dist/styling/typography.js +1004 -0
- package/dist/styling/typography.js.map +1 -0
- package/dist/styling/z-index-scale.d.ts +270 -0
- package/dist/styling/z-index-scale.d.ts.map +1 -0
- package/dist/styling/z-index-scale.js +714 -0
- package/dist/styling/z-index-scale.js.map +1 -0
- package/dist/testing/co-location.d.ts +42 -0
- package/dist/testing/co-location.d.ts.map +1 -0
- package/dist/testing/co-location.js +134 -0
- package/dist/testing/co-location.js.map +1 -0
- package/dist/testing/describe-naming.d.ts +47 -0
- package/dist/testing/describe-naming.d.ts.map +1 -0
- package/dist/testing/describe-naming.js +150 -0
- package/dist/testing/describe-naming.js.map +1 -0
- package/dist/testing/file-naming.d.ts +44 -0
- package/dist/testing/file-naming.d.ts.map +1 -0
- package/dist/testing/file-naming.js +131 -0
- package/dist/testing/file-naming.js.map +1 -0
- package/dist/testing/fixture-patterns.d.ts +52 -0
- package/dist/testing/fixture-patterns.d.ts.map +1 -0
- package/dist/testing/fixture-patterns.js +228 -0
- package/dist/testing/fixture-patterns.js.map +1 -0
- package/dist/testing/index.d.ts +31 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +49 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-patterns.d.ts +53 -0
- package/dist/testing/mock-patterns.d.ts.map +1 -0
- package/dist/testing/mock-patterns.js +264 -0
- package/dist/testing/mock-patterns.js.map +1 -0
- package/dist/testing/setup-teardown.d.ts +55 -0
- package/dist/testing/setup-teardown.d.ts.map +1 -0
- package/dist/testing/setup-teardown.js +262 -0
- package/dist/testing/setup-teardown.js.map +1 -0
- package/dist/testing/test-structure.d.ts +51 -0
- package/dist/testing/test-structure.d.ts.map +1 -0
- package/dist/testing/test-structure.js +225 -0
- package/dist/testing/test-structure.js.map +1 -0
- package/dist/types/any-usage.d.ts +99 -0
- package/dist/types/any-usage.d.ts.map +1 -0
- package/dist/types/any-usage.js +641 -0
- package/dist/types/any-usage.js.map +1 -0
- package/dist/types/file-location.d.ts +76 -0
- package/dist/types/file-location.d.ts.map +1 -0
- package/dist/types/file-location.js +395 -0
- package/dist/types/file-location.js.map +1 -0
- package/dist/types/generic-patterns.d.ts +97 -0
- package/dist/types/generic-patterns.d.ts.map +1 -0
- package/dist/types/generic-patterns.js +615 -0
- package/dist/types/generic-patterns.js.map +1 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +43 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface-vs-type.d.ts +81 -0
- package/dist/types/interface-vs-type.d.ts.map +1 -0
- package/dist/types/interface-vs-type.js +440 -0
- package/dist/types/interface-vs-type.js.map +1 -0
- package/dist/types/naming-conventions.d.ts +84 -0
- package/dist/types/naming-conventions.d.ts.map +1 -0
- package/dist/types/naming-conventions.js +455 -0
- package/dist/types/naming-conventions.js.map +1 -0
- package/dist/types/type-assertions.d.ts +98 -0
- package/dist/types/type-assertions.d.ts.map +1 -0
- package/dist/types/type-assertions.js +639 -0
- package/dist/types/type-assertions.js.map +1 -0
- package/dist/types/utility-types.d.ts +110 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/types/utility-types.js +547 -0
- package/dist/types/utility-types.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Correlation IDs Detector - Request correlation ID pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Detects correlation ID patterns including:
|
|
5
|
+
* - Request tracing
|
|
6
|
+
* - Distributed tracing
|
|
7
|
+
* - Correlation propagation
|
|
8
|
+
*
|
|
9
|
+
* @requirements 15.4 - Correlation ID patterns
|
|
10
|
+
*/
|
|
11
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Patterns (JavaScript/TypeScript + Python)
|
|
14
|
+
// ============================================================================
|
|
15
|
+
export const CORRELATION_ID_PATTERNS = [
|
|
16
|
+
// Both languages
|
|
17
|
+
/correlationId/gi,
|
|
18
|
+
/correlation_id/gi,
|
|
19
|
+
/x-correlation-id/gi,
|
|
20
|
+
];
|
|
21
|
+
export const TRACE_ID_PATTERNS = [
|
|
22
|
+
// Both languages
|
|
23
|
+
/traceId/gi,
|
|
24
|
+
/trace_id/gi,
|
|
25
|
+
/x-trace-id/gi,
|
|
26
|
+
/traceparent/gi,
|
|
27
|
+
// Python OpenTelemetry
|
|
28
|
+
/get_current_span/gi,
|
|
29
|
+
/trace\.get_current_span/gi,
|
|
30
|
+
];
|
|
31
|
+
export const SPAN_ID_PATTERNS = [
|
|
32
|
+
// Both languages
|
|
33
|
+
/spanId/gi,
|
|
34
|
+
/span_id/gi,
|
|
35
|
+
/x-span-id/gi,
|
|
36
|
+
];
|
|
37
|
+
export const REQUEST_ID_PATTERNS = [
|
|
38
|
+
// Both languages
|
|
39
|
+
/requestId/gi,
|
|
40
|
+
/request_id/gi,
|
|
41
|
+
/x-request-id/gi,
|
|
42
|
+
];
|
|
43
|
+
export const PROPAGATION_PATTERNS = [
|
|
44
|
+
// JavaScript/TypeScript
|
|
45
|
+
/propagate\s*\(/gi,
|
|
46
|
+
/inject\s*\([^)]*context/gi,
|
|
47
|
+
/extract\s*\([^)]*context/gi,
|
|
48
|
+
/AsyncLocalStorage/gi,
|
|
49
|
+
// Python
|
|
50
|
+
/contextvars/gi,
|
|
51
|
+
/ContextVar/gi,
|
|
52
|
+
/copy_context/gi,
|
|
53
|
+
];
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// Analysis Functions
|
|
56
|
+
// ============================================================================
|
|
57
|
+
export function shouldExcludeFile(filePath) {
|
|
58
|
+
const excludePatterns = [
|
|
59
|
+
/\.test\.[jt]sx?$/,
|
|
60
|
+
/\.spec\.[jt]sx?$/,
|
|
61
|
+
/__tests__\//,
|
|
62
|
+
/\.d\.ts$/,
|
|
63
|
+
/node_modules\//,
|
|
64
|
+
];
|
|
65
|
+
return excludePatterns.some((p) => p.test(filePath));
|
|
66
|
+
}
|
|
67
|
+
function detectPatterns(content, patterns, type) {
|
|
68
|
+
const results = [];
|
|
69
|
+
const lines = content.split('\n');
|
|
70
|
+
for (let i = 0; i < lines.length; i++) {
|
|
71
|
+
const line = lines[i];
|
|
72
|
+
for (const pattern of patterns) {
|
|
73
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
74
|
+
let match;
|
|
75
|
+
while ((match = regex.exec(line)) !== null) {
|
|
76
|
+
results.push({
|
|
77
|
+
type,
|
|
78
|
+
line: i + 1,
|
|
79
|
+
column: match.index + 1,
|
|
80
|
+
match: match[0],
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return results;
|
|
86
|
+
}
|
|
87
|
+
export function analyzeCorrelationIds(content, filePath) {
|
|
88
|
+
if (shouldExcludeFile(filePath)) {
|
|
89
|
+
return {
|
|
90
|
+
patterns: [],
|
|
91
|
+
hasCorrelationId: false,
|
|
92
|
+
hasDistributedTracing: false,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const patterns = [
|
|
96
|
+
...detectPatterns(content, CORRELATION_ID_PATTERNS, 'correlation-id'),
|
|
97
|
+
...detectPatterns(content, TRACE_ID_PATTERNS, 'trace-id'),
|
|
98
|
+
...detectPatterns(content, SPAN_ID_PATTERNS, 'span-id'),
|
|
99
|
+
...detectPatterns(content, REQUEST_ID_PATTERNS, 'request-id'),
|
|
100
|
+
...detectPatterns(content, PROPAGATION_PATTERNS, 'propagation'),
|
|
101
|
+
];
|
|
102
|
+
const hasCorrelationId = patterns.some((p) => p.type === 'correlation-id' || p.type === 'request-id');
|
|
103
|
+
const hasDistributedTracing = patterns.some((p) => p.type === 'trace-id' || p.type === 'span-id');
|
|
104
|
+
return {
|
|
105
|
+
patterns,
|
|
106
|
+
hasCorrelationId,
|
|
107
|
+
hasDistributedTracing,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
// ============================================================================
|
|
111
|
+
// Detector Class
|
|
112
|
+
// ============================================================================
|
|
113
|
+
export class CorrelationIdsDetector extends RegexDetector {
|
|
114
|
+
id = 'logging/correlation-ids';
|
|
115
|
+
name = 'Correlation IDs Detector';
|
|
116
|
+
description = 'Detects request correlation ID patterns';
|
|
117
|
+
category = 'logging';
|
|
118
|
+
subcategory = 'correlation-ids';
|
|
119
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
120
|
+
async detect(context) {
|
|
121
|
+
if (!this.supportsLanguage(context.language)) {
|
|
122
|
+
return this.createEmptyResult();
|
|
123
|
+
}
|
|
124
|
+
const analysis = analyzeCorrelationIds(context.content, context.file);
|
|
125
|
+
if (analysis.patterns.length === 0) {
|
|
126
|
+
return this.createEmptyResult();
|
|
127
|
+
}
|
|
128
|
+
const confidence = 0.9;
|
|
129
|
+
return this.createResult([], [], confidence, {
|
|
130
|
+
custom: {
|
|
131
|
+
patterns: analysis.patterns,
|
|
132
|
+
hasCorrelationId: analysis.hasCorrelationId,
|
|
133
|
+
hasDistributedTracing: analysis.hasDistributedTracing,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
generateQuickFix(_violation) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export function createCorrelationIdsDetector() {
|
|
142
|
+
return new CorrelationIdsDetector();
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=correlation-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-ids.js","sourceRoot":"","sources":["../../src/logging/correlation-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AA2B1D,+EAA+E;AAC/E,4CAA4C;AAC5C,+EAA+E;AAE/E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;IAClB,oBAAoB;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iBAAiB;IACjB,WAAW;IACX,YAAY;IACZ,cAAc;IACd,eAAe;IACf,uBAAuB;IACvB,oBAAoB;IACpB,2BAA2B;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,UAAU;IACV,WAAW;IACX,aAAa;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,iBAAiB;IACjB,aAAa;IACb,cAAc;IACd,gBAAgB;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,wBAAwB;IACxB,kBAAkB;IAClB,2BAA2B;IAC3B,4BAA4B;IAC5B,qBAAqB;IACrB,SAAS;IACT,eAAe;IACf,cAAc;IACd,gBAAgB;CACjB,CAAC;AAEF,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,MAAM,eAAe,GAAG;QACtB,kBAAkB;QAClB,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,gBAAgB;KACjB,CAAC;IACF,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,cAAc,CACrB,OAAe,EACf,QAAkB,EAClB,IAA8B;IAE9B,MAAM,OAAO,GAA+B,EAAE,CAAC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,CAAC;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE;YAC3C,MAAM,EAAE;gBACN,QAAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;gBAC3C,qBAAqB,EAAE,QAAQ,CAAC,qBAAqB;aACtD;SACF,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CAAC,UAAqB;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,UAAU,4BAA4B;IAC1C,OAAO,IAAI,sBAAsB,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health Checks Detector - Health check pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Detects health check patterns including:
|
|
5
|
+
* - Liveness probes
|
|
6
|
+
* - Readiness probes
|
|
7
|
+
* - Health endpoints
|
|
8
|
+
*
|
|
9
|
+
* @requirements 15.7 - Health check patterns
|
|
10
|
+
*/
|
|
11
|
+
import type { Violation, QuickFix, PatternCategory, Language } from 'driftdetect-core';
|
|
12
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
13
|
+
import type { DetectionContext, DetectionResult } from '../base/base-detector.js';
|
|
14
|
+
export type HealthCheckPatternType = 'health-endpoint' | 'liveness-probe' | 'readiness-probe' | 'health-check-function' | 'dependency-check';
|
|
15
|
+
export interface HealthCheckPatternInfo {
|
|
16
|
+
type: HealthCheckPatternType;
|
|
17
|
+
line: number;
|
|
18
|
+
column: number;
|
|
19
|
+
match: string;
|
|
20
|
+
}
|
|
21
|
+
export interface HealthCheckAnalysis {
|
|
22
|
+
patterns: HealthCheckPatternInfo[];
|
|
23
|
+
hasHealthEndpoint: boolean;
|
|
24
|
+
hasLivenessProbe: boolean;
|
|
25
|
+
hasReadinessProbe: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const HEALTH_ENDPOINT_PATTERNS: RegExp[];
|
|
28
|
+
export declare const LIVENESS_PROBE_PATTERNS: RegExp[];
|
|
29
|
+
export declare const READINESS_PROBE_PATTERNS: RegExp[];
|
|
30
|
+
export declare const HEALTH_CHECK_FUNCTION_PATTERNS: RegExp[];
|
|
31
|
+
export declare const DEPENDENCY_CHECK_PATTERNS: RegExp[];
|
|
32
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
33
|
+
export declare function analyzeHealthChecks(content: string, filePath: string): HealthCheckAnalysis;
|
|
34
|
+
export declare class HealthChecksDetector extends RegexDetector {
|
|
35
|
+
readonly id = "logging/health-checks";
|
|
36
|
+
readonly name = "Health Checks Detector";
|
|
37
|
+
readonly description = "Detects health check patterns";
|
|
38
|
+
readonly category: PatternCategory;
|
|
39
|
+
readonly subcategory = "health-checks";
|
|
40
|
+
readonly supportedLanguages: Language[];
|
|
41
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
42
|
+
generateQuickFix(_violation: Violation): QuickFix | null;
|
|
43
|
+
}
|
|
44
|
+
export declare function createHealthChecksDetector(): HealthChecksDetector;
|
|
45
|
+
//# sourceMappingURL=health-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-checks.d.ts","sourceRoot":"","sources":["../../src/logging/health-checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAMlF,MAAM,MAAM,sBAAsB,GAC9B,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,uBAAuB,GACvB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,IA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ness probes
|
|
7
|
+
* - Health endpoints
|
|
8
|
+
*
|
|
9
|
+
* @requirements 15.7 - Health check patterns
|
|
10
|
+
*/
|
|
11
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Patterns (JavaScript/TypeScript + Python)
|
|
14
|
+
// ============================================================================
|
|
15
|
+
export const HEALTH_ENDPOINT_PATTERNS = [
|
|
16
|
+
// Both languages - URL patterns
|
|
17
|
+
/['"`]\/health['"`]/gi,
|
|
18
|
+
/['"`]\/healthz['"`]/gi,
|
|
19
|
+
/['"`]\/health\/live['"`]/gi,
|
|
20
|
+
/['"`]\/health\/ready['"`]/gi,
|
|
21
|
+
/['"`]\/_health['"`]/gi,
|
|
22
|
+
// Python FastAPI
|
|
23
|
+
/@(?:app|router)\.get\s*\(\s*['"`]\/health/gi,
|
|
24
|
+
];
|
|
25
|
+
export const LIVENESS_PROBE_PATTERNS = [
|
|
26
|
+
// Both languages
|
|
27
|
+
/liveness/gi,
|
|
28
|
+
/\/live/gi,
|
|
29
|
+
/isAlive/gi,
|
|
30
|
+
/livenessProbe/gi,
|
|
31
|
+
// Python
|
|
32
|
+
/is_alive/gi,
|
|
33
|
+
/liveness_probe/gi,
|
|
34
|
+
];
|
|
35
|
+
export const READINESS_PROBE_PATTERNS = [
|
|
36
|
+
// Both languages
|
|
37
|
+
/readiness/gi,
|
|
38
|
+
/\/ready/gi,
|
|
39
|
+
/isReady/gi,
|
|
40
|
+
/readinessProbe/gi,
|
|
41
|
+
// Python
|
|
42
|
+
/is_ready/gi,
|
|
43
|
+
/readiness_probe/gi,
|
|
44
|
+
];
|
|
45
|
+
export const HEALTH_CHECK_FUNCTION_PATTERNS = [
|
|
46
|
+
// JavaScript/TypeScript
|
|
47
|
+
/healthCheck\s*\(/gi,
|
|
48
|
+
/checkHealth\s*\(/gi,
|
|
49
|
+
/getHealth\s*\(/gi,
|
|
50
|
+
/healthStatus\s*\(/gi,
|
|
51
|
+
// Python
|
|
52
|
+
/health_check\s*\(/gi,
|
|
53
|
+
/check_health\s*\(/gi,
|
|
54
|
+
/get_health\s*\(/gi,
|
|
55
|
+
/health_status\s*\(/gi,
|
|
56
|
+
/async def health/gi,
|
|
57
|
+
];
|
|
58
|
+
export const DEPENDENCY_CHECK_PATTERNS = [
|
|
59
|
+
// JavaScript/TypeScript
|
|
60
|
+
/checkDatabase\s*\(/gi,
|
|
61
|
+
/checkRedis\s*\(/gi,
|
|
62
|
+
/checkDependencies\s*\(/gi,
|
|
63
|
+
/pingDatabase\s*\(/gi,
|
|
64
|
+
// Python
|
|
65
|
+
/check_database\s*\(/gi,
|
|
66
|
+
/check_redis\s*\(/gi,
|
|
67
|
+
/check_dependencies\s*\(/gi,
|
|
68
|
+
/ping_database\s*\(/gi,
|
|
69
|
+
/\.ping\s*\(/gi,
|
|
70
|
+
];
|
|
71
|
+
// ============================================================================
|
|
72
|
+
// Analysis Functions
|
|
73
|
+
// ============================================================================
|
|
74
|
+
export function shouldExcludeFile(filePath) {
|
|
75
|
+
const excludePatterns = [
|
|
76
|
+
/\.test\.[jt]sx?$/,
|
|
77
|
+
/\.spec\.[jt]sx?$/,
|
|
78
|
+
/__tests__\//,
|
|
79
|
+
/\.d\.ts$/,
|
|
80
|
+
/node_modules\//,
|
|
81
|
+
];
|
|
82
|
+
return excludePatterns.some((p) => p.test(filePath));
|
|
83
|
+
}
|
|
84
|
+
function detectPatterns(content, patterns, type) {
|
|
85
|
+
const results = [];
|
|
86
|
+
const lines = content.split('\n');
|
|
87
|
+
for (let i = 0; i < lines.length; i++) {
|
|
88
|
+
const line = lines[i];
|
|
89
|
+
for (const pattern of patterns) {
|
|
90
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
91
|
+
let match;
|
|
92
|
+
while ((match = regex.exec(line)) !== null) {
|
|
93
|
+
results.push({
|
|
94
|
+
type,
|
|
95
|
+
line: i + 1,
|
|
96
|
+
column: match.index + 1,
|
|
97
|
+
match: match[0],
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return results;
|
|
103
|
+
}
|
|
104
|
+
export function analyzeHealthChecks(content, filePath) {
|
|
105
|
+
if (shouldExcludeFile(filePath)) {
|
|
106
|
+
return {
|
|
107
|
+
patterns: [],
|
|
108
|
+
hasHealthEndpoint: false,
|
|
109
|
+
hasLivenessProbe: false,
|
|
110
|
+
hasReadinessProbe: false,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const patterns = [
|
|
114
|
+
...detectPatterns(content, HEALTH_ENDPOINT_PATTERNS, 'health-endpoint'),
|
|
115
|
+
...detectPatterns(content, LIVENESS_PROBE_PATTERNS, 'liveness-probe'),
|
|
116
|
+
...detectPatterns(content, READINESS_PROBE_PATTERNS, 'readiness-probe'),
|
|
117
|
+
...detectPatterns(content, HEALTH_CHECK_FUNCTION_PATTERNS, 'health-check-function'),
|
|
118
|
+
...detectPatterns(content, DEPENDENCY_CHECK_PATTERNS, 'dependency-check'),
|
|
119
|
+
];
|
|
120
|
+
const hasHealthEndpoint = patterns.some((p) => p.type === 'health-endpoint');
|
|
121
|
+
const hasLivenessProbe = patterns.some((p) => p.type === 'liveness-probe');
|
|
122
|
+
const hasReadinessProbe = patterns.some((p) => p.type === 'readiness-probe');
|
|
123
|
+
return {
|
|
124
|
+
patterns,
|
|
125
|
+
hasHealthEndpoint,
|
|
126
|
+
hasLivenessProbe,
|
|
127
|
+
hasReadinessProbe,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
// ============================================================================
|
|
131
|
+
// Detector Class
|
|
132
|
+
// ============================================================================
|
|
133
|
+
export class HealthChecksDetector extends RegexDetector {
|
|
134
|
+
id = 'logging/health-checks';
|
|
135
|
+
name = 'Health Checks Detector';
|
|
136
|
+
description = 'Detects health check patterns';
|
|
137
|
+
category = 'logging';
|
|
138
|
+
subcategory = 'health-checks';
|
|
139
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
140
|
+
async detect(context) {
|
|
141
|
+
if (!this.supportsLanguage(context.language)) {
|
|
142
|
+
return this.createEmptyResult();
|
|
143
|
+
}
|
|
144
|
+
const analysis = analyzeHealthChecks(context.content, context.file);
|
|
145
|
+
if (analysis.patterns.length === 0) {
|
|
146
|
+
return this.createEmptyResult();
|
|
147
|
+
}
|
|
148
|
+
const confidence = 0.9;
|
|
149
|
+
return this.createResult([], [], confidence, {
|
|
150
|
+
custom: {
|
|
151
|
+
patterns: analysis.patterns,
|
|
152
|
+
hasHealthEndpoint: analysis.hasHealthEndpoint,
|
|
153
|
+
hasLivenessProbe: analysis.hasLivenessProbe,
|
|
154
|
+
hasReadinessProbe: analysis.hasReadinessProbe,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
generateQuickFix(_violation) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export function createHealthChecksDetector() {
|
|
163
|
+
return new HealthChecksDetector();
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=health-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-checks.js","sourceRoot":"","sources":["../../src/logging/health-checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AA4B1D,+EAA+E;AAC/E,4CAA4C;AAC5C,+EAA+E;AAE/E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,gCAAgC;IAChC,sBAAsB;IACtB,uBAAuB;IACvB,4BAA4B;IAC5B,6BAA6B;IAC7B,uBAAuB;IACvB,iBAAiB;IACjB,6CAA6C;CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,iBAAiB;IACjB,YAAY;IACZ,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,SAAS;IACT,YAAY;IACZ,kBAAkB;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,w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gBAC7C,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;gBAC3C,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;aAC9C;SACF,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CAAC,UAAqB;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,IAAI,oBAAoB,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging detectors module exports
|
|
3
|
+
*
|
|
4
|
+
* Detects logging and observability patterns including:
|
|
5
|
+
* - Structured logging format
|
|
6
|
+
* - Log levels
|
|
7
|
+
* - Context fields
|
|
8
|
+
* - Correlation IDs
|
|
9
|
+
* - PII redaction
|
|
10
|
+
* - Metric naming
|
|
11
|
+
* - Health checks
|
|
12
|
+
*
|
|
13
|
+
* @requirements 15.1-15.7 - Logging patterns
|
|
14
|
+
*/
|
|
15
|
+
export { type StructuredFormatPatternType, type StructuredFormatPatternInfo, type StructuredFormatAnalysis, JSON_LOGGING_PATTERNS, KEY_VALUE_LOGGING_PATTERNS, WINSTON_PATTERNS, PINO_PATTERNS, BUNYAN_PATTERNS, CONSOLE_LOG_PATTERNS, shouldExcludeFile as shouldExcludeStructuredFile, detectJSONLogging, detectWinstonLogger, detectPinoLogger, detectConsoleLog, analyzeStructuredFormat, StructuredFormatDetector, createStructuredFormatDetector, } from './structured-format.js';
|
|
16
|
+
export { type LogLevelPatternType, type LogLevelPatternInfo, type LogLevelAnalysis, DEBUG_LEVEL_PATTERNS, INFO_LEVEL_PATTERNS, WARN_LEVEL_PATTERNS, ERROR_LEVEL_PATTERNS, FATAL_LEVEL_PATTERNS, TRACE_LEVEL_PATTERNS, LEVEL_CONFIG_PATTERNS, shouldExcludeFile as shouldExcludeLogLevelFile, analyzeLogLevels, LogLevelsDetector, createLogLevelsDetector, } from './log-levels.js';
|
|
17
|
+
export { type ContextFieldPatternType, type ContextFieldPatternInfo, type ContextFieldAnalysis, REQUEST_ID_PATTERNS as CONTEXT_REQUEST_ID_PATTERNS, USER_ID_PATTERNS as CONTEXT_USER_ID_PATTERNS, TIMESTAMP_PATTERNS, SERVICE_NAME_PATTERNS, CUSTOM_CONTEXT_PATTERNS, shouldExcludeFile as shouldExcludeContextFile, analyzeContextFields, ContextFieldsDetector, createContextFieldsDetector, } from './context-fields.js';
|
|
18
|
+
export { type CorrelationIdPatternType, type CorrelationIdPatternInfo, type CorrelationIdAnalysis, CORRELATION_ID_PATTERNS, TRACE_ID_PATTERNS, SPAN_ID_PATTERNS, REQUEST_ID_PATTERNS, PROPAGATION_PATTERNS, shouldExcludeFile as shouldExcludeCorrelationFile, analyzeCorrelationIds, CorrelationIdsDetector, createCorrelationIdsDetector, } from './correlation-ids.js';
|
|
19
|
+
export { type PIIRedactionPatternType, type PIIRedactionPatternInfo, type PIIRedactionAnalysis, REDACT_FUNCTION_PATTERNS, MASK_FUNCTION_PATTERNS, SANITIZE_FUNCTION_PATTERNS, SENSITIVE_FIELD_PATTERNS, REDACTION_CONFIG_PATTERNS, shouldExcludeFile as shouldExcludePIIFile, analyzePIIRedaction, PIIRedactionDetector, createPIIRedactionDetector, } from './pii-redaction.js';
|
|
20
|
+
export { type MetricNamingPatternType, type MetricNamingPatternInfo, type MetricNamingAnalysis, COUNTER_METRIC_PATTERNS, GAUGE_METRIC_PATTERNS, HISTOGRAM_METRIC_PATTERNS, SUMMARY_METRIC_PATTERNS, METRIC_PREFIX_PATTERNS, shouldExcludeFile as shouldExcludeMetricFile, analyzeMetricNaming, MetricNamingDetector, createMetricNamingDetector, } from './metric-naming.js';
|
|
21
|
+
export { type HealthCheckPatternType, type HealthCheckPatternInfo, type HealthCheckAnalysis, HEALTH_ENDPOINT_PATTERNS, LIVENESS_PROBE_PATTERNS, READINESS_PROBE_PATTERNS, HEALTH_CHECK_FUNCTION_PATTERNS, DEPENDENCY_CHECK_PATTERNS, shouldExcludeFile as shouldExcludeHealthFile, analyzeHealthChecks, HealthChecksDetector, createHealthChecksDetector, } from './health-checks.js';
|
|
22
|
+
export declare function createAllLoggingDetectors(): {
|
|
23
|
+
structuredFormat: import("./structured-format.js").StructuredFormatDetector;
|
|
24
|
+
logLevels: import("./log-levels.js").LogLevelsDetector;
|
|
25
|
+
contextFields: import("./context-fields.js").ContextFieldsDetector;
|
|
26
|
+
correlationIds: import("./correlation-ids.js").CorrelationIdsDetector;
|
|
27
|
+
piiRedaction: import("./pii-redaction.js").PIIRedactionDetector;
|
|
28
|
+
metricNaming: import("./metric-naming.js").MetricNamingDetector;
|
|
29
|
+
healthChecks: import("./health-checks.js").HealthChecksDetector;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,iBAAiB,IAAI,2BAA2B,EAChD,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,IAAI,yBAAyB,EAC9C,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAu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wBAAgB,yBAAyB;;;;;;;;EAUxC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging detectors module exports
|
|
3
|
+
*
|
|
4
|
+
* Detects logging and observability patterns including:
|
|
5
|
+
* - Structured logging format
|
|
6
|
+
* - Log levels
|
|
7
|
+
* - Context fields
|
|
8
|
+
* - Correlation IDs
|
|
9
|
+
* - PII redaction
|
|
10
|
+
* - Metric naming
|
|
11
|
+
* - Health checks
|
|
12
|
+
*
|
|
13
|
+
* @requirements 15.1-15.7 - Logging patterns
|
|
14
|
+
*/
|
|
15
|
+
// Structured Format Detector
|
|
16
|
+
export { JSON_LOGGING_PATTERNS, KEY_VALUE_LOGGING_PATTERNS, WINSTON_PATTERNS, PINO_PATTERNS, BUNYAN_PATTERNS, CONSOLE_LOG_PATTERNS, shouldExcludeFile as shouldExcludeStructuredFile, detectJSONLogging, detectWinstonLogger, detectPinoLogger, detectConsoleLog, analyzeStructuredFormat, StructuredFormatDetector, createStructuredFormatDetector, } from './structured-format.js';
|
|
17
|
+
// Log Levels Detector
|
|
18
|
+
export { DEBUG_LEVEL_PATTERNS, INFO_LEVEL_PATTERNS, WARN_LEVEL_PATTERNS, ERROR_LEVEL_PATTERNS, FATAL_LEVEL_PATTERNS, TRACE_LEVEL_PATTERNS, LEVEL_CONFIG_PATTERNS, shouldExcludeFile as shouldExcludeLogLevelFile, analyzeLogLevels, LogLevelsDetector, createLogLevelsDetector, } from './log-levels.js';
|
|
19
|
+
// Context Fields Detector
|
|
20
|
+
export { REQUEST_ID_PATTERNS as CONTEXT_REQUEST_ID_PATTERNS, USER_ID_PATTERNS as CONTEXT_USER_ID_PATTERNS, TIMESTAMP_PATTERNS, SERVICE_NAME_PATTERNS, CUSTOM_CONTEXT_PATTERNS, shouldExcludeFile as shouldExcludeContextFile, analyzeContextFields, ContextFieldsDetector, createContextFieldsDetector, } from './context-fields.js';
|
|
21
|
+
// Correlation IDs Detector
|
|
22
|
+
export { CORRELATION_ID_PATTERNS, TRACE_ID_PATTERNS, SPAN_ID_PATTERNS, REQUEST_ID_PATTERNS, PROPAGATION_PATTERNS, shouldExcludeFile as shouldExcludeCorrelationFile, analyzeCorrelationIds, CorrelationIdsDetector, createCorrelationIdsDetector, } from './correlation-ids.js';
|
|
23
|
+
// PII Redaction Detector
|
|
24
|
+
export { REDACT_FUNCTION_PATTERNS, MASK_FUNCTION_PATTERNS, SANITIZE_FUNCTION_PATTERNS, SENSITIVE_FIELD_PATTERNS, REDACTION_CONFIG_PATTERNS, shouldExcludeFile as shouldExcludePIIFile, analyzePIIRedaction, PIIRedactionDetector, createPIIRedactionDetector, } from './pii-redaction.js';
|
|
25
|
+
// Metric Naming Detector
|
|
26
|
+
export { COUNTER_METRIC_PATTERNS, GAUGE_METRIC_PATTERNS, HISTOGRAM_METRIC_PATTERNS, SUMMARY_METRIC_PATTERNS, METRIC_PREFIX_PATTERNS, shouldExcludeFile as shouldExcludeMetricFile, analyzeMetricNaming, MetricNamingDetector, createMetricNamingDetector, } from './metric-naming.js';
|
|
27
|
+
// Health Checks Detector
|
|
28
|
+
export { HEALTH_ENDPOINT_PATTERNS, LIVENESS_PROBE_PATTERNS, READINESS_PROBE_PATTERNS, HEALTH_CHECK_FUNCTION_PATTERNS, DEPENDENCY_CHECK_PATTERNS, shouldExcludeFile as shouldExcludeHealthFile, analyzeHealthChecks, HealthChecksDetector, createHealthChecksDetector, } from './health-checks.js';
|
|
29
|
+
// Import factory functions for createAllLoggingDetectors
|
|
30
|
+
import { createStructuredFormatDetector } from './structured-format.js';
|
|
31
|
+
import { createLogLevelsDetector } from './log-levels.js';
|
|
32
|
+
import { createContextFieldsDetector } from './context-fields.js';
|
|
33
|
+
import { createCorrelationIdsDetector } from './correlation-ids.js';
|
|
34
|
+
import { createPIIRedactionDetector } from './pii-redaction.js';
|
|
35
|
+
import { createMetricNamingDetector } from './metric-naming.js';
|
|
36
|
+
import { createHealthChecksDetector } from './health-checks.js';
|
|
37
|
+
// Convenience factory for all logging detectors
|
|
38
|
+
export function createAllLoggingDetectors() {
|
|
39
|
+
return {
|
|
40
|
+
structuredFormat: createStructuredFormatDetector(),
|
|
41
|
+
logLevels: createLogLevelsDetector(),
|
|
42
|
+
contextFields: createContextFieldsDetector(),
|
|
43
|
+
correlationIds: createCorrelationIdsDetector(),
|
|
44
|
+
piiRedaction: createPIIRedactionDetector(),
|
|
45
|
+
metricNaming: createMetricNamingDetector(),
|
|
46
|
+
healthChecks: createHealthChecksDetector(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,6BAA6B;AAC7B,OAAO,EAIL,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,iBAAiB,IAAI,2BAA2B,EAChD,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAEhC,sBAAsB;AACtB,OAAO,EAIL,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,IAAI,yBAAyB,EAC9C,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,0BAA0B;AAC1B,OAAO,EAIL,mBAAmB,IAAI,2BAA2B,EAClD,gBAAgB,IAAI,wBAAwB,EAC5C,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,IAAI,wBAAwB,EAC7C,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAE7B,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,OAAO;QACL,gBAAgB,EAAE,8BAA8B,EAAE;QAClD,SAAS,EAAE,uBAAuB,EAAE;QACpC,aAAa,EAAE,2BAA2B,EAAE;QAC5C,cAAc,EAAE,4BAA4B,EAAE;QAC9C,YAAY,EAAE,0BAA0B,EAAE;QAC1C,YAAY,EAAE,0BAA0B,EAAE;QAC1C,YAAY,EAAE,0BAA0B,EAAE;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log Levels Detector - Log level usage pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Detects log level patterns including:
|
|
5
|
+
* - Debug, info, warn, error levels
|
|
6
|
+
* - Log level configuration
|
|
7
|
+
* - Appropriate level usage
|
|
8
|
+
*
|
|
9
|
+
* @requirements 15.2 - Log level patterns
|
|
10
|
+
*/
|
|
11
|
+
import type { Violation, QuickFix, PatternCategory, Language } from 'driftdetect-core';
|
|
12
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
13
|
+
import type { DetectionContext, DetectionResult } from '../base/base-detector.js';
|
|
14
|
+
export type LogLevelPatternType = 'debug-level' | 'info-level' | 'warn-level' | 'error-level' | 'fatal-level' | 'trace-level' | 'level-config';
|
|
15
|
+
export interface LogLevelPatternInfo {
|
|
16
|
+
type: LogLevelPatternType;
|
|
17
|
+
line: number;
|
|
18
|
+
column: number;
|
|
19
|
+
match: string;
|
|
20
|
+
}
|
|
21
|
+
export interface LogLevelAnalysis {
|
|
22
|
+
patterns: LogLevelPatternInfo[];
|
|
23
|
+
levelCounts: Record<string, number>;
|
|
24
|
+
hasLevelConfig: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const DEBUG_LEVEL_PATTERNS: RegExp[];
|
|
27
|
+
export declare const INFO_LEVEL_PATTERNS: RegExp[];
|
|
28
|
+
export declare const WARN_LEVEL_PATTERNS: RegExp[];
|
|
29
|
+
export declare const ERROR_LEVEL_PATTERNS: RegExp[];
|
|
30
|
+
export declare const FATAL_LEVEL_PATTERNS: RegExp[];
|
|
31
|
+
export declare const TRACE_LEVEL_PATTERNS: RegExp[];
|
|
32
|
+
export declare const LEVEL_CONFIG_PATTERNS: RegExp[];
|
|
33
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
34
|
+
export declare function analyzeLogLevels(content: string, filePath: string): LogLevelAnalysis;
|
|
35
|
+
export declare class LogLevelsDetector extends RegexDetector {
|
|
36
|
+
readonly id = "logging/log-levels";
|
|
37
|
+
readonly name = "Log Levels Detector";
|
|
38
|
+
readonly description = "Detects log level usage patterns";
|
|
39
|
+
readonly category: PatternCategory;
|
|
40
|
+
readonly subcategory = "log-levels";
|
|
41
|
+
readonly supportedLanguages: Language[];
|
|
42
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
43
|
+
generateQuickFix(_violation: Violation): QuickFix | null;
|
|
44
|
+
}
|
|
45
|
+
export declare function createLogLevelsDetector(): LogLevelsDetector;
|
|
46
|
+
//# sourceMappingURL=log-levels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-levels.d.ts","sourceRoot":"","sources":["../../src/logging/log-levels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAMlF,MAAM,MAAM,mBAAmB,GAC3B,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,aAAa,GACb,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM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