@jterrats/smart-deployment 1.0.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.
- package/README.md +193 -0
- package/lib/ai/agentforce-error-handler.d.ts +81 -0
- package/lib/ai/agentforce-error-handler.js +196 -0
- package/lib/ai/agentforce-error-handler.js.map +1 -0
- package/lib/ai/agentforce-priority-service.d.ts +82 -0
- package/lib/ai/agentforce-priority-service.js +257 -0
- package/lib/ai/agentforce-priority-service.js.map +1 -0
- package/lib/ai/agentforce-service.d.ts +99 -0
- package/lib/ai/agentforce-service.js +300 -0
- package/lib/ai/agentforce-service.js.map +1 -0
- package/lib/ai/circuit-breaker.d.ts +115 -0
- package/lib/ai/circuit-breaker.js +277 -0
- package/lib/ai/circuit-breaker.js.map +1 -0
- package/lib/ai/dependency-inference-service.d.ts +76 -0
- package/lib/ai/dependency-inference-service.js +220 -0
- package/lib/ai/dependency-inference-service.js.map +1 -0
- package/lib/ai/llm-provider-factory.d.ts +15 -0
- package/lib/ai/llm-provider-factory.js +36 -0
- package/lib/ai/llm-provider-factory.js.map +1 -0
- package/lib/ai/llm-provider.d.ts +27 -0
- package/lib/ai/llm-provider.js +2 -0
- package/lib/ai/llm-provider.js.map +1 -0
- package/lib/ai/openai-service.d.ts +20 -0
- package/lib/ai/openai-service.js +89 -0
- package/lib/ai/openai-service.js.map +1 -0
- package/lib/ai/prompt-builder.d.ts +79 -0
- package/lib/ai/prompt-builder.js +180 -0
- package/lib/ai/prompt-builder.js.map +1 -0
- package/lib/ai/response-parser.d.ts +67 -0
- package/lib/ai/response-parser.js +234 -0
- package/lib/ai/response-parser.js.map +1 -0
- package/lib/ai/wave-validation-service.d.ts +111 -0
- package/lib/ai/wave-validation-service.js +381 -0
- package/lib/ai/wave-validation-service.js.map +1 -0
- package/lib/analysis/analysis-reporter.d.ts +56 -0
- package/lib/analysis/analysis-reporter.js +170 -0
- package/lib/analysis/analysis-reporter.js.map +1 -0
- package/lib/analytics/error-analytics.d.ts +80 -0
- package/lib/analytics/error-analytics.js +162 -0
- package/lib/analytics/error-analytics.js.map +1 -0
- package/lib/commands/analyze.d.ts +49 -0
- package/lib/commands/analyze.js +232 -0
- package/lib/commands/analyze.js.map +1 -0
- package/lib/commands/config.d.ts +42 -0
- package/lib/commands/config.js +219 -0
- package/lib/commands/config.js.map +1 -0
- package/lib/commands/resume.d.ts +26 -0
- package/lib/commands/resume.js +69 -0
- package/lib/commands/resume.js.map +1 -0
- package/lib/commands/start.d.ts +70 -0
- package/lib/commands/start.js +659 -0
- package/lib/commands/start.js.map +1 -0
- package/lib/commands/status.d.ts +37 -0
- package/lib/commands/status.js +69 -0
- package/lib/commands/status.js.map +1 -0
- package/lib/commands/validate.d.ts +33 -0
- package/lib/commands/validate.js +66 -0
- package/lib/commands/validate.js.map +1 -0
- package/lib/config/repo-config.d.ts +22 -0
- package/lib/config/repo-config.js +31 -0
- package/lib/config/repo-config.js.map +1 -0
- package/lib/constants/agentforce-limits.d.ts +174 -0
- package/lib/constants/agentforce-limits.js +262 -0
- package/lib/constants/agentforce-limits.js.map +1 -0
- package/lib/constants/api-version.d.ts +70 -0
- package/lib/constants/api-version.js +122 -0
- package/lib/constants/api-version.js.map +1 -0
- package/lib/constants/deployment-order.d.ts +68 -0
- package/lib/constants/deployment-order.js +162 -0
- package/lib/constants/deployment-order.js.map +1 -0
- package/lib/constants/salesforce-limits.d.ts +107 -0
- package/lib/constants/salesforce-limits.js +104 -0
- package/lib/constants/salesforce-limits.js.map +1 -0
- package/lib/dependencies/circular-dependency-detector.d.ts +137 -0
- package/lib/dependencies/circular-dependency-detector.js +329 -0
- package/lib/dependencies/circular-dependency-detector.js.map +1 -0
- package/lib/dependencies/cycle-remediation-planner.d.ts +50 -0
- package/lib/dependencies/cycle-remediation-planner.js +192 -0
- package/lib/dependencies/cycle-remediation-planner.js.map +1 -0
- package/lib/dependencies/dependency-cache.d.ts +134 -0
- package/lib/dependencies/dependency-cache.js +303 -0
- package/lib/dependencies/dependency-cache.js.map +1 -0
- package/lib/dependencies/dependency-depth-calculator.d.ts +145 -0
- package/lib/dependencies/dependency-depth-calculator.js +368 -0
- package/lib/dependencies/dependency-depth-calculator.js.map +1 -0
- package/lib/dependencies/dependency-graph-builder.d.ts +151 -0
- package/lib/dependencies/dependency-graph-builder.js +411 -0
- package/lib/dependencies/dependency-graph-builder.js.map +1 -0
- package/lib/dependencies/dependency-impact-analyzer.d.ts +145 -0
- package/lib/dependencies/dependency-impact-analyzer.js +330 -0
- package/lib/dependencies/dependency-impact-analyzer.js.map +1 -0
- package/lib/dependencies/dependency-merger.d.ts +122 -0
- package/lib/dependencies/dependency-merger.js +245 -0
- package/lib/dependencies/dependency-merger.js.map +1 -0
- package/lib/dependencies/dependency-resolver.d.ts +157 -0
- package/lib/dependencies/dependency-resolver.js +298 -0
- package/lib/dependencies/dependency-resolver.js.map +1 -0
- package/lib/dependencies/dependency-validator.d.ts +123 -0
- package/lib/dependencies/dependency-validator.js +291 -0
- package/lib/dependencies/dependency-validator.js.map +1 -0
- package/lib/dependencies/graph-visualizer.d.ts +110 -0
- package/lib/dependencies/graph-visualizer.js +262 -0
- package/lib/dependencies/graph-visualizer.js.map +1 -0
- package/lib/dependencies/heuristic-inference.d.ts +136 -0
- package/lib/dependencies/heuristic-inference.js +430 -0
- package/lib/dependencies/heuristic-inference.js.map +1 -0
- package/lib/deployment/cycle-source-editor.d.ts +34 -0
- package/lib/deployment/cycle-source-editor.js +121 -0
- package/lib/deployment/cycle-source-editor.js.map +1 -0
- package/lib/deployment/deployment-error-handler.d.ts +38 -0
- package/lib/deployment/deployment-error-handler.js +79 -0
- package/lib/deployment/deployment-error-handler.js.map +1 -0
- package/lib/deployment/deployment-reporter.d.ts +63 -0
- package/lib/deployment/deployment-reporter.js +150 -0
- package/lib/deployment/deployment-reporter.js.map +1 -0
- package/lib/deployment/deployment-state-summary.d.ts +38 -0
- package/lib/deployment/deployment-state-summary.js +209 -0
- package/lib/deployment/deployment-state-summary.js.map +1 -0
- package/lib/deployment/deployment-status-service.d.ts +36 -0
- package/lib/deployment/deployment-status-service.js +128 -0
- package/lib/deployment/deployment-status-service.js.map +1 -0
- package/lib/deployment/deployment-tracker.d.ts +42 -0
- package/lib/deployment/deployment-tracker.js +79 -0
- package/lib/deployment/deployment-tracker.js.map +1 -0
- package/lib/deployment/deployment-validation-service.d.ts +28 -0
- package/lib/deployment/deployment-validation-service.js +161 -0
- package/lib/deployment/deployment-validation-service.js.map +1 -0
- package/lib/deployment/retry-handler.d.ts +37 -0
- package/lib/deployment/retry-handler.js +86 -0
- package/lib/deployment/retry-handler.js.map +1 -0
- package/lib/deployment/sf-cli-integration.d.ts +42 -0
- package/lib/deployment/sf-cli-integration.js +105 -0
- package/lib/deployment/sf-cli-integration.js.map +1 -0
- package/lib/deployment/state-manager.d.ts +61 -0
- package/lib/deployment/state-manager.js +83 -0
- package/lib/deployment/state-manager.js.map +1 -0
- package/lib/deployment/test-executor.d.ts +41 -0
- package/lib/deployment/test-executor.js +87 -0
- package/lib/deployment/test-executor.js.map +1 -0
- package/lib/errors/base-error.d.ts +24 -0
- package/lib/errors/base-error.js +66 -0
- package/lib/errors/base-error.js.map +1 -0
- package/lib/errors/dependency-error.d.ts +37 -0
- package/lib/errors/dependency-error.js +76 -0
- package/lib/errors/dependency-error.js.map +1 -0
- package/lib/errors/deployment-error.d.ts +55 -0
- package/lib/errors/deployment-error.js +132 -0
- package/lib/errors/deployment-error.js.map +1 -0
- package/lib/errors/index.d.ts +45 -0
- package/lib/errors/index.js +71 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/errors/network-error.d.ts +53 -0
- package/lib/errors/network-error.js +111 -0
- package/lib/errors/network-error.js.map +1 -0
- package/lib/errors/parsing-error.d.ts +41 -0
- package/lib/errors/parsing-error.js +69 -0
- package/lib/errors/parsing-error.js.map +1 -0
- package/lib/errors/validation-error-reporter.d.ts +34 -0
- package/lib/errors/validation-error-reporter.js +99 -0
- package/lib/errors/validation-error-reporter.js.map +1 -0
- package/lib/errors/validation-error.d.ts +58 -0
- package/lib/errors/validation-error.js +131 -0
- package/lib/errors/validation-error.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/monitoring/performance-monitor.d.ts +98 -0
- package/lib/monitoring/performance-monitor.js +260 -0
- package/lib/monitoring/performance-monitor.js.map +1 -0
- package/lib/parsers/apex-class-parser.d.ts +47 -0
- package/lib/parsers/apex-class-parser.js +368 -0
- package/lib/parsers/apex-class-parser.js.map +1 -0
- package/lib/parsers/apex-trigger-parser.d.ts +48 -0
- package/lib/parsers/apex-trigger-parser.js +229 -0
- package/lib/parsers/apex-trigger-parser.js.map +1 -0
- package/lib/parsers/aura-parser.d.ts +55 -0
- package/lib/parsers/aura-parser.js +229 -0
- package/lib/parsers/aura-parser.js.map +1 -0
- package/lib/parsers/bot-parser.d.ts +65 -0
- package/lib/parsers/bot-parser.js +225 -0
- package/lib/parsers/bot-parser.js.map +1 -0
- package/lib/parsers/custom-metadata-parser.d.ts +94 -0
- package/lib/parsers/custom-metadata-parser.js +199 -0
- package/lib/parsers/custom-metadata-parser.js.map +1 -0
- package/lib/parsers/custom-object-parser.d.ts +62 -0
- package/lib/parsers/custom-object-parser.js +297 -0
- package/lib/parsers/custom-object-parser.js.map +1 -0
- package/lib/parsers/email-template-parser.d.ts +64 -0
- package/lib/parsers/email-template-parser.js +238 -0
- package/lib/parsers/email-template-parser.js.map +1 -0
- package/lib/parsers/error-resilient-parser.d.ts +110 -0
- package/lib/parsers/error-resilient-parser.js +277 -0
- package/lib/parsers/error-resilient-parser.js.map +1 -0
- package/lib/parsers/flexipage-parser.d.ts +64 -0
- package/lib/parsers/flexipage-parser.js +196 -0
- package/lib/parsers/flexipage-parser.js.map +1 -0
- package/lib/parsers/flow-parser.d.ts +54 -0
- package/lib/parsers/flow-parser.js +287 -0
- package/lib/parsers/flow-parser.js.map +1 -0
- package/lib/parsers/genai-prompt-parser.d.ts +67 -0
- package/lib/parsers/genai-prompt-parser.js +160 -0
- package/lib/parsers/genai-prompt-parser.js.map +1 -0
- package/lib/parsers/layout-parser.d.ts +64 -0
- package/lib/parsers/layout-parser.js +267 -0
- package/lib/parsers/layout-parser.js.map +1 -0
- package/lib/parsers/lwc-parser.d.ts +60 -0
- package/lib/parsers/lwc-parser.js +264 -0
- package/lib/parsers/lwc-parser.js.map +1 -0
- package/lib/parsers/permission-set-parser.d.ts +86 -0
- package/lib/parsers/permission-set-parser.js +152 -0
- package/lib/parsers/permission-set-parser.js.map +1 -0
- package/lib/parsers/profile-parser.d.ts +81 -0
- package/lib/parsers/profile-parser.js +141 -0
- package/lib/parsers/profile-parser.js.map +1 -0
- package/lib/parsers/visualforce-parser.d.ts +47 -0
- package/lib/parsers/visualforce-parser.js +180 -0
- package/lib/parsers/visualforce-parser.js.map +1 -0
- package/lib/provisioning/data-provisioner.d.ts +88 -0
- package/lib/provisioning/data-provisioner.js +257 -0
- package/lib/provisioning/data-provisioner.js.map +1 -0
- package/lib/scanner/custom-structure-scanner.d.ts +66 -0
- package/lib/scanner/custom-structure-scanner.js +229 -0
- package/lib/scanner/custom-structure-scanner.js.map +1 -0
- package/lib/scanner/forceignore-parser.d.ts +69 -0
- package/lib/scanner/forceignore-parser.js +195 -0
- package/lib/scanner/forceignore-parser.js.map +1 -0
- package/lib/scanner/metadata-format-scanner.d.ts +77 -0
- package/lib/scanner/metadata-format-scanner.js +282 -0
- package/lib/scanner/metadata-format-scanner.js.map +1 -0
- package/lib/scanner/monorepo-scanner.d.ts +71 -0
- package/lib/scanner/monorepo-scanner.js +225 -0
- package/lib/scanner/monorepo-scanner.js.map +1 -0
- package/lib/scanner/project-validator.d.ts +55 -0
- package/lib/scanner/project-validator.js +235 -0
- package/lib/scanner/project-validator.js.map +1 -0
- package/lib/scanner/sfdx-project-detector.d.ts +86 -0
- package/lib/scanner/sfdx-project-detector.js +240 -0
- package/lib/scanner/sfdx-project-detector.js.map +1 -0
- package/lib/scanner/structure-validator.d.ts +64 -0
- package/lib/scanner/structure-validator.js +296 -0
- package/lib/scanner/structure-validator.js.map +1 -0
- package/lib/services/metadata-scanner-service.d.ts +64 -0
- package/lib/services/metadata-scanner-service.js +651 -0
- package/lib/services/metadata-scanner-service.js.map +1 -0
- package/lib/types/agentforce.d.ts +157 -0
- package/lib/types/agentforce.js +2 -0
- package/lib/types/agentforce.js.map +1 -0
- package/lib/types/dependency.d.ts +98 -0
- package/lib/types/dependency.js +5 -0
- package/lib/types/dependency.js.map +1 -0
- package/lib/types/deployment-plan.d.ts +81 -0
- package/lib/types/deployment-plan.js +6 -0
- package/lib/types/deployment-plan.js.map +1 -0
- package/lib/types/deployment.d.ts +88 -0
- package/lib/types/deployment.js +5 -0
- package/lib/types/deployment.js.map +1 -0
- package/lib/types/graph.d.ts +35 -0
- package/lib/types/graph.js +5 -0
- package/lib/types/graph.js.map +1 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/index.js +17 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/metadata.d.ts +101 -0
- package/lib/types/metadata.js +13 -0
- package/lib/types/metadata.js.map +1 -0
- package/lib/types/project.d.ts +156 -0
- package/lib/types/project.js +56 -0
- package/lib/types/project.js.map +1 -0
- package/lib/types/salesforce/apex.d.ts +94 -0
- package/lib/types/salesforce/apex.js +6 -0
- package/lib/types/salesforce/apex.js.map +1 -0
- package/lib/types/salesforce/aura.d.ts +150 -0
- package/lib/types/salesforce/aura.js +6 -0
- package/lib/types/salesforce/aura.js.map +1 -0
- package/lib/types/salesforce/bot.d.ts +293 -0
- package/lib/types/salesforce/bot.js +6 -0
- package/lib/types/salesforce/bot.js.map +1 -0
- package/lib/types/salesforce/common.d.ts +15 -0
- package/lib/types/salesforce/common.js +5 -0
- package/lib/types/salesforce/common.js.map +1 -0
- package/lib/types/salesforce/custom-metadata.d.ts +92 -0
- package/lib/types/salesforce/custom-metadata.js +6 -0
- package/lib/types/salesforce/custom-metadata.js.map +1 -0
- package/lib/types/salesforce/email.d.ts +56 -0
- package/lib/types/salesforce/email.js +6 -0
- package/lib/types/salesforce/email.js.map +1 -0
- package/lib/types/salesforce/flexipage.d.ts +149 -0
- package/lib/types/salesforce/flexipage.js +6 -0
- package/lib/types/salesforce/flexipage.js.map +1 -0
- package/lib/types/salesforce/flow.d.ts +516 -0
- package/lib/types/salesforce/flow.js +6 -0
- package/lib/types/salesforce/flow.js.map +1 -0
- package/lib/types/salesforce/genai.d.ts +67 -0
- package/lib/types/salesforce/genai.js +6 -0
- package/lib/types/salesforce/genai.js.map +1 -0
- package/lib/types/salesforce/index.d.ts +27 -0
- package/lib/types/salesforce/index.js +43 -0
- package/lib/types/salesforce/index.js.map +1 -0
- package/lib/types/salesforce/layout.d.ts +236 -0
- package/lib/types/salesforce/layout.js +6 -0
- package/lib/types/salesforce/layout.js.map +1 -0
- package/lib/types/salesforce/lwc.d.ts +123 -0
- package/lib/types/salesforce/lwc.js +6 -0
- package/lib/types/salesforce/lwc.js.map +1 -0
- package/lib/types/salesforce/object.d.ts +427 -0
- package/lib/types/salesforce/object.js +6 -0
- package/lib/types/salesforce/object.js.map +1 -0
- package/lib/types/salesforce/parser-types.d.ts +79 -0
- package/lib/types/salesforce/parser-types.js +80 -0
- package/lib/types/salesforce/parser-types.js.map +1 -0
- package/lib/types/salesforce/permission.d.ts +289 -0
- package/lib/types/salesforce/permission.js +6 -0
- package/lib/types/salesforce/permission.js.map +1 -0
- package/lib/types/salesforce/resource.d.ts +93 -0
- package/lib/types/salesforce/resource.js +6 -0
- package/lib/types/salesforce/resource.js.map +1 -0
- package/lib/types/salesforce/visualforce.d.ts +70 -0
- package/lib/types/salesforce/visualforce.js +6 -0
- package/lib/types/salesforce/visualforce.js.map +1 -0
- package/lib/utils/cache-manager.d.ts +158 -0
- package/lib/utils/cache-manager.js +429 -0
- package/lib/utils/cache-manager.js.map +1 -0
- package/lib/utils/deployment-plan-manager.d.ts +40 -0
- package/lib/utils/deployment-plan-manager.js +183 -0
- package/lib/utils/deployment-plan-manager.js.map +1 -0
- package/lib/utils/error-aggregator.d.ts +117 -0
- package/lib/utils/error-aggregator.js +268 -0
- package/lib/utils/error-aggregator.js.map +1 -0
- package/lib/utils/file-system.d.ts +62 -0
- package/lib/utils/file-system.js +167 -0
- package/lib/utils/file-system.js.map +1 -0
- package/lib/utils/functional.d.ts +52 -0
- package/lib/utils/functional.js +61 -0
- package/lib/utils/functional.js.map +1 -0
- package/lib/utils/graph-algorithms.d.ts +53 -0
- package/lib/utils/graph-algorithms.js +177 -0
- package/lib/utils/graph-algorithms.js.map +1 -0
- package/lib/utils/logger.d.ts +154 -0
- package/lib/utils/logger.js +327 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/network-handler.d.ts +64 -0
- package/lib/utils/network-handler.js +147 -0
- package/lib/utils/network-handler.js.map +1 -0
- package/lib/utils/performance.d.ts +148 -0
- package/lib/utils/performance.js +294 -0
- package/lib/utils/performance.js.map +1 -0
- package/lib/utils/string.d.ts +197 -0
- package/lib/utils/string.js +331 -0
- package/lib/utils/string.js.map +1 -0
- package/lib/utils/xml.d.ts +97 -0
- package/lib/utils/xml.js +227 -0
- package/lib/utils/xml.js.map +1 -0
- package/lib/validators/xml-metadata-validator.d.ts +106 -0
- package/lib/validators/xml-metadata-validator.js +509 -0
- package/lib/validators/xml-metadata-validator.js.map +1 -0
- package/lib/waves/priority-wave-generator-ai.d.ts +85 -0
- package/lib/waves/priority-wave-generator-ai.js +191 -0
- package/lib/waves/priority-wave-generator-ai.js.map +1 -0
- package/lib/waves/priority-wave-generator.d.ts +47 -0
- package/lib/waves/priority-wave-generator.js +88 -0
- package/lib/waves/priority-wave-generator.js.map +1 -0
- package/lib/waves/test-optimizer.d.ts +155 -0
- package/lib/waves/test-optimizer.js +290 -0
- package/lib/waves/test-optimizer.js.map +1 -0
- package/lib/waves/wave-builder.d.ts +147 -0
- package/lib/waves/wave-builder.js +286 -0
- package/lib/waves/wave-builder.js.map +1 -0
- package/lib/waves/wave-diff-generator.d.ts +17 -0
- package/lib/waves/wave-diff-generator.js +6 -0
- package/lib/waves/wave-diff-generator.js.map +1 -0
- package/lib/waves/wave-executor.d.ts +33 -0
- package/lib/waves/wave-executor.js +50 -0
- package/lib/waves/wave-executor.js.map +1 -0
- package/lib/waves/wave-merger.d.ts +96 -0
- package/lib/waves/wave-merger.js +181 -0
- package/lib/waves/wave-merger.js.map +1 -0
- package/lib/waves/wave-metadata-generator.d.ts +13 -0
- package/lib/waves/wave-metadata-generator.js +12 -0
- package/lib/waves/wave-metadata-generator.js.map +1 -0
- package/lib/waves/wave-splitter.d.ts +154 -0
- package/lib/waves/wave-splitter.js +307 -0
- package/lib/waves/wave-splitter.js.map +1 -0
- package/lib/waves/wave-validator.d.ts +17 -0
- package/lib/waves/wave-validator.js +15 -0
- package/lib/waves/wave-validator.js.map +1 -0
- package/messages/analyze.json +18 -0
- package/messages/config.json +29 -0
- package/messages/resume.json +9 -0
- package/messages/start.json +24 -0
- package/messages/status.json +8 -0
- package/messages/validate.json +9 -0
- package/npm-shrinkwrap.json +25676 -0
- package/oclif.lock +11988 -0
- package/oclif.manifest.json +589 -0
- package/package.json +224 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Functional Programming Utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Executes functions left-to-right
|
|
6
|
+
*
|
|
7
|
+
* @ac US-001-AC-1
|
|
8
|
+
*/
|
|
9
|
+
export declare function pipe<InitialValue, FinalValue>(firstTransform: (input: InitialValue) => FinalValue | Promise<FinalValue>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
10
|
+
export declare function pipe<InitialValue, AfterFirst, FinalValue>(firstTransform: (input: InitialValue) => AfterFirst | Promise<AfterFirst>, secondTransform: (input: AfterFirst) => FinalValue | Promise<FinalValue>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
11
|
+
export declare function pipe<InitialValue, AfterFirst, AfterSecond, FinalValue>(firstTransform: (input: InitialValue) => AfterFirst | Promise<AfterFirst>, secondTransform: (input: AfterFirst) => AfterSecond | Promise<AfterSecond>, thirdTransform: (input: AfterSecond) => FinalValue | Promise<FinalValue>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
12
|
+
export declare function pipe<InitialValue, AfterFirst, AfterSecond, AfterThird, FinalValue>(firstTransform: (input: InitialValue) => AfterFirst | Promise<AfterFirst>, secondTransform: (input: AfterFirst) => AfterSecond | Promise<AfterSecond>, thirdTransform: (input: AfterSecond) => AfterThird | Promise<AfterThird>, fourthTransform: (input: AfterThird) => FinalValue | Promise<FinalValue>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
13
|
+
/**
|
|
14
|
+
* Executes functions right-to-left
|
|
15
|
+
*
|
|
16
|
+
* @ac US-001-AC-2
|
|
17
|
+
*/
|
|
18
|
+
export declare function compose<InitialValue, FinalValue>(firstTransform: (input: InitialValue) => FinalValue | Promise<FinalValue>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
19
|
+
export declare function compose<InitialValue, AfterFirst, FinalValue>(firstTransform: (input: AfterFirst) => FinalValue | Promise<FinalValue>, secondTransform: (input: InitialValue) => AfterFirst | Promise<AfterFirst>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
20
|
+
export declare function compose<InitialValue, AfterFirst, AfterSecond, FinalValue>(firstTransform: (input: AfterSecond) => FinalValue | Promise<FinalValue>, secondTransform: (input: AfterFirst) => AfterSecond | Promise<AfterSecond>, thirdTransform: (input: InitialValue) => AfterFirst | Promise<AfterFirst>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
21
|
+
export declare function compose<InitialValue, AfterFirst, AfterSecond, AfterThird, FinalValue>(firstTransform: (input: AfterThird) => FinalValue | Promise<FinalValue>, secondTransform: (input: AfterSecond) => AfterThird | Promise<AfterThird>, thirdTransform: (input: AfterFirst) => AfterSecond | Promise<AfterSecond>, fourthTransform: (input: InitialValue) => AfterFirst | Promise<AfterFirst>): (input: InitialValue) => FinalValue | Promise<FinalValue>;
|
|
22
|
+
/**
|
|
23
|
+
* Enables partial application
|
|
24
|
+
*
|
|
25
|
+
* @ac US-001-AC-3
|
|
26
|
+
*/
|
|
27
|
+
export declare function curry<FirstParameter, ReturnValue>(originalFunction: (first: FirstParameter) => ReturnValue): (first: FirstParameter) => ReturnValue;
|
|
28
|
+
export declare function curry<FirstParameter, SecondParameter, ReturnValue>(originalFunction: (first: FirstParameter, second: SecondParameter) => ReturnValue): {
|
|
29
|
+
(first: FirstParameter): (second: SecondParameter) => ReturnValue;
|
|
30
|
+
(first: FirstParameter, second: SecondParameter): ReturnValue;
|
|
31
|
+
};
|
|
32
|
+
export declare function curry<FirstParameter, SecondParameter, ThirdParameter, ReturnValue>(originalFunction: (first: FirstParameter, second: SecondParameter, third: ThirdParameter) => ReturnValue): {
|
|
33
|
+
(first: FirstParameter): {
|
|
34
|
+
(second: SecondParameter): (third: ThirdParameter) => ReturnValue;
|
|
35
|
+
(second: SecondParameter, third: ThirdParameter): ReturnValue;
|
|
36
|
+
};
|
|
37
|
+
(first: FirstParameter, second: SecondParameter): (third: ThirdParameter) => ReturnValue;
|
|
38
|
+
(first: FirstParameter, second: SecondParameter, third: ThirdParameter): ReturnValue;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Memoization options
|
|
42
|
+
*/
|
|
43
|
+
export type MemoizeOptions = {
|
|
44
|
+
maxSize?: number;
|
|
45
|
+
keyGenerator?: (...parameters: unknown[]) => string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Caches results based on arguments
|
|
49
|
+
*
|
|
50
|
+
* @ac US-001-AC-4
|
|
51
|
+
*/
|
|
52
|
+
export declare function memoize<ExpensiveFunction extends (...parameters: any[]) => any>(expensiveFunction: ExpensiveFunction, options?: MemoizeOptions): ExpensiveFunction;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Functional Programming Utilities
|
|
3
|
+
*/
|
|
4
|
+
export function pipe(...transformations) {
|
|
5
|
+
if (transformations.length === 0) {
|
|
6
|
+
return (input) => input;
|
|
7
|
+
}
|
|
8
|
+
return (initialValue) => {
|
|
9
|
+
let currentValue = initialValue;
|
|
10
|
+
for (const transform of transformations) {
|
|
11
|
+
if (currentValue instanceof Promise) {
|
|
12
|
+
currentValue = currentValue.then(transform);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
currentValue = transform(currentValue);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return currentValue;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function compose(...transformations) {
|
|
22
|
+
return pipe(...transformations.reverse());
|
|
23
|
+
}
|
|
24
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument */
|
|
25
|
+
export function curry(originalFunction) {
|
|
26
|
+
return function curriedFunction(...providedParameters) {
|
|
27
|
+
if (providedParameters.length >= originalFunction.length) {
|
|
28
|
+
return originalFunction(...providedParameters);
|
|
29
|
+
}
|
|
30
|
+
return (...remainingParameters) => curriedFunction(...providedParameters, ...remainingParameters);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Caches results based on arguments
|
|
35
|
+
*
|
|
36
|
+
* @ac US-001-AC-4
|
|
37
|
+
*/
|
|
38
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment */
|
|
39
|
+
export function memoize(expensiveFunction, options = {}) {
|
|
40
|
+
const { maxSize = Infinity, keyGenerator = JSON.stringify } = options;
|
|
41
|
+
const cachedResults = new Map();
|
|
42
|
+
const accessOrder = [];
|
|
43
|
+
return ((...parameters) => {
|
|
44
|
+
const cacheKey = keyGenerator(...parameters);
|
|
45
|
+
if (cachedResults.has(cacheKey)) {
|
|
46
|
+
return cachedResults.get(cacheKey);
|
|
47
|
+
}
|
|
48
|
+
const computedValue = expensiveFunction(...parameters);
|
|
49
|
+
if (cachedResults.size >= maxSize) {
|
|
50
|
+
const oldestKey = accessOrder.shift();
|
|
51
|
+
if (oldestKey !== undefined) {
|
|
52
|
+
cachedResults.delete(oldestKey);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
cachedResults.set(cacheKey, computedValue);
|
|
56
|
+
accessOrder.push(cacheKey);
|
|
57
|
+
return computedValue;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment */
|
|
61
|
+
//# sourceMappingURL=functional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functional.js","sourceRoot":"","sources":["../../src/utils/functional.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyBH,MAAM,UAAU,IAAI,CAAC,GAAG,eAAmD;IACzE,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO,CAAC,YAAqB,EAAE,EAAE;QAC/B,IAAI,YAAY,GAAY,YAAY,CAAC;QAEzC,KAAK,MAAM,SAAS,IAAI,eAAe,EAAE,CAAC;YACxC,IAAI,YAAY,YAAY,OAAO,EAAE,CAAC;gBACpC,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC9C,CAAC;iBAAM,CAAC;gBACN,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAyBD,MAAM,UAAU,OAAO,CAAC,GAAG,eAAmD;IAC5E,OAAO,IAAI,CAAC,GAAI,eAAe,CAAC,OAAO,EAAoC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,QAAQ,EAAE,aAAa,CAAC,CAAC;QAC3C,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE3B,OAAO,aAAa,CAAC;IACvB,CAAC,CAAsB,CAAC;AAC1B,CAAC;AACD,2KAA2K"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Algorithms for Dependency Analysis
|
|
3
|
+
*
|
|
4
|
+
* Provides efficient algorithms for analyzing metadata dependency graphs:
|
|
5
|
+
* - Topological sorting for deployment ordering
|
|
6
|
+
* - Cycle detection for identifying circular dependencies
|
|
7
|
+
* - Depth calculation for determining deployment waves
|
|
8
|
+
* - Path finding for dependency tracing
|
|
9
|
+
*/
|
|
10
|
+
export type NodeId = string;
|
|
11
|
+
export type GraphNode = {
|
|
12
|
+
nodeId: NodeId;
|
|
13
|
+
dependencies: Set<NodeId>;
|
|
14
|
+
};
|
|
15
|
+
export type DependencyGraph = Map<NodeId, GraphNode>;
|
|
16
|
+
export type CycleDetectionResult = {
|
|
17
|
+
hasCycles: boolean;
|
|
18
|
+
cycles: NodeId[][];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Performs topological sort using Kahn's algorithm (BFS-based)
|
|
22
|
+
*
|
|
23
|
+
* @ac US-002-AC-1
|
|
24
|
+
* @param dependencyGraph - Graph where edges represent dependencies
|
|
25
|
+
* @returns Array of node IDs in topological order (dependencies first)
|
|
26
|
+
*/
|
|
27
|
+
export declare function topologicalSort(dependencyGraph: DependencyGraph): NodeId[];
|
|
28
|
+
/**
|
|
29
|
+
* Detects cycles using Depth-First Search with color marking
|
|
30
|
+
*
|
|
31
|
+
* @ac US-002-AC-2
|
|
32
|
+
* @param dependencyGraph - Graph to analyze for cycles
|
|
33
|
+
* @returns Detection result with all found cycles
|
|
34
|
+
*/
|
|
35
|
+
export declare function detectCycles(dependencyGraph: DependencyGraph): CycleDetectionResult;
|
|
36
|
+
/**
|
|
37
|
+
* Calculates dependency depth (longest path from root)
|
|
38
|
+
*
|
|
39
|
+
* @ac US-002-AC-3
|
|
40
|
+
* @param dependencyGraph - Graph to analyze
|
|
41
|
+
* @returns Map of node ID to its depth level
|
|
42
|
+
*/
|
|
43
|
+
export declare function calculateDepth(dependencyGraph: DependencyGraph): Map<NodeId, number>;
|
|
44
|
+
/**
|
|
45
|
+
* Finds shortest path between two nodes using BFS
|
|
46
|
+
*
|
|
47
|
+
* @ac US-002-AC-4
|
|
48
|
+
* @param dependencyGraph - Graph to search
|
|
49
|
+
* @param startNodeId - Starting node
|
|
50
|
+
* @param targetNodeId - Target node to find
|
|
51
|
+
* @returns Array representing path from start to target, or null if no path exists
|
|
52
|
+
*/
|
|
53
|
+
export declare function findPath(dependencyGraph: DependencyGraph, startNodeId: NodeId, targetNodeId: NodeId): NodeId[] | null;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Algorithms for Dependency Analysis
|
|
3
|
+
*
|
|
4
|
+
* Provides efficient algorithms for analyzing metadata dependency graphs:
|
|
5
|
+
* - Topological sorting for deployment ordering
|
|
6
|
+
* - Cycle detection for identifying circular dependencies
|
|
7
|
+
* - Depth calculation for determining deployment waves
|
|
8
|
+
* - Path finding for dependency tracing
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Performs topological sort using Kahn's algorithm (BFS-based)
|
|
12
|
+
*
|
|
13
|
+
* @ac US-002-AC-1
|
|
14
|
+
* @param dependencyGraph - Graph where edges represent dependencies
|
|
15
|
+
* @returns Array of node IDs in topological order (dependencies first)
|
|
16
|
+
*/
|
|
17
|
+
export function topologicalSort(dependencyGraph) {
|
|
18
|
+
const sortedNodes = [];
|
|
19
|
+
const remainingDependencies = new Map();
|
|
20
|
+
const readyQueue = [];
|
|
21
|
+
// Initialize: copy all dependencies
|
|
22
|
+
for (const [nodeId, graphNode] of dependencyGraph) {
|
|
23
|
+
remainingDependencies.set(nodeId, new Set(graphNode.dependencies));
|
|
24
|
+
}
|
|
25
|
+
// Find all nodes with no dependencies (ready to process)
|
|
26
|
+
for (const [nodeId, dependencies] of remainingDependencies) {
|
|
27
|
+
if (dependencies.size === 0) {
|
|
28
|
+
readyQueue.push(nodeId);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Process nodes in topological order
|
|
32
|
+
while (readyQueue.length > 0) {
|
|
33
|
+
const currentNodeId = readyQueue.shift();
|
|
34
|
+
sortedNodes.push(currentNodeId);
|
|
35
|
+
// Remove this node from all other nodes' dependencies
|
|
36
|
+
for (const [nodeId, dependencies] of remainingDependencies) {
|
|
37
|
+
if (dependencies.has(currentNodeId)) {
|
|
38
|
+
dependencies.delete(currentNodeId);
|
|
39
|
+
// If node now has no dependencies, add to ready queue
|
|
40
|
+
if (dependencies.size === 0 && !sortedNodes.includes(nodeId)) {
|
|
41
|
+
readyQueue.push(nodeId);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return sortedNodes;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Detects cycles using Depth-First Search with color marking
|
|
50
|
+
*
|
|
51
|
+
* @ac US-002-AC-2
|
|
52
|
+
* @param dependencyGraph - Graph to analyze for cycles
|
|
53
|
+
* @returns Detection result with all found cycles
|
|
54
|
+
*/
|
|
55
|
+
export function detectCycles(dependencyGraph) {
|
|
56
|
+
const visitedNodes = new Set();
|
|
57
|
+
const recursionStack = new Set();
|
|
58
|
+
const discoveredCycles = [];
|
|
59
|
+
const pathToNode = [];
|
|
60
|
+
function depthFirstSearch(currentNodeId) {
|
|
61
|
+
visitedNodes.add(currentNodeId);
|
|
62
|
+
recursionStack.add(currentNodeId);
|
|
63
|
+
pathToNode.push(currentNodeId);
|
|
64
|
+
const currentNode = dependencyGraph.get(currentNodeId);
|
|
65
|
+
if (currentNode) {
|
|
66
|
+
for (const dependencyId of currentNode.dependencies) {
|
|
67
|
+
if (!visitedNodes.has(dependencyId)) {
|
|
68
|
+
if (depthFirstSearch(dependencyId)) {
|
|
69
|
+
return true; // Cycle found in subtree
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (recursionStack.has(dependencyId)) {
|
|
73
|
+
// Found a cycle!
|
|
74
|
+
const cycleStartIndex = pathToNode.indexOf(dependencyId);
|
|
75
|
+
const cycleNodes = pathToNode.slice(cycleStartIndex);
|
|
76
|
+
discoveredCycles.push(cycleNodes);
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
recursionStack.delete(currentNodeId);
|
|
82
|
+
pathToNode.pop();
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
for (const [nodeId] of dependencyGraph) {
|
|
86
|
+
if (!visitedNodes.has(nodeId)) {
|
|
87
|
+
depthFirstSearch(nodeId);
|
|
88
|
+
pathToNode.length = 0; // Clear path for next component
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
hasCycles: discoveredCycles.length > 0,
|
|
93
|
+
cycles: discoveredCycles,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Calculates dependency depth (longest path from root)
|
|
98
|
+
*
|
|
99
|
+
* @ac US-002-AC-3
|
|
100
|
+
* @param dependencyGraph - Graph to analyze
|
|
101
|
+
* @returns Map of node ID to its depth level
|
|
102
|
+
*/
|
|
103
|
+
export function calculateDepth(dependencyGraph) {
|
|
104
|
+
const depthMap = new Map();
|
|
105
|
+
const visitedNodes = new Set();
|
|
106
|
+
function calculateNodeDepth(nodeId) {
|
|
107
|
+
if (depthMap.has(nodeId)) {
|
|
108
|
+
return depthMap.get(nodeId);
|
|
109
|
+
}
|
|
110
|
+
if (visitedNodes.has(nodeId)) {
|
|
111
|
+
// Circular dependency, return large number
|
|
112
|
+
return Infinity;
|
|
113
|
+
}
|
|
114
|
+
visitedNodes.add(nodeId);
|
|
115
|
+
const currentNode = dependencyGraph.get(nodeId);
|
|
116
|
+
if (!currentNode || currentNode.dependencies.size === 0) {
|
|
117
|
+
depthMap.set(nodeId, 0);
|
|
118
|
+
visitedNodes.delete(nodeId);
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
let maximumDepth = 0;
|
|
122
|
+
for (const dependencyId of currentNode.dependencies) {
|
|
123
|
+
const dependencyDepth = calculateNodeDepth(dependencyId);
|
|
124
|
+
maximumDepth = Math.max(maximumDepth, dependencyDepth + 1);
|
|
125
|
+
}
|
|
126
|
+
depthMap.set(nodeId, maximumDepth);
|
|
127
|
+
visitedNodes.delete(nodeId);
|
|
128
|
+
return maximumDepth;
|
|
129
|
+
}
|
|
130
|
+
for (const [nodeId] of dependencyGraph) {
|
|
131
|
+
if (!depthMap.has(nodeId)) {
|
|
132
|
+
calculateNodeDepth(nodeId);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return depthMap;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Finds shortest path between two nodes using BFS
|
|
139
|
+
*
|
|
140
|
+
* @ac US-002-AC-4
|
|
141
|
+
* @param dependencyGraph - Graph to search
|
|
142
|
+
* @param startNodeId - Starting node
|
|
143
|
+
* @param targetNodeId - Target node to find
|
|
144
|
+
* @returns Array representing path from start to target, or null if no path exists
|
|
145
|
+
*/
|
|
146
|
+
export function findPath(dependencyGraph, startNodeId, targetNodeId) {
|
|
147
|
+
if (startNodeId === targetNodeId) {
|
|
148
|
+
return [startNodeId];
|
|
149
|
+
}
|
|
150
|
+
const visitedNodes = new Set();
|
|
151
|
+
const searchQueue = [
|
|
152
|
+
{ currentNodeId: startNodeId, pathSoFar: [startNodeId] },
|
|
153
|
+
];
|
|
154
|
+
while (searchQueue.length > 0) {
|
|
155
|
+
const { currentNodeId, pathSoFar } = searchQueue.shift();
|
|
156
|
+
if (visitedNodes.has(currentNodeId)) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
visitedNodes.add(currentNodeId);
|
|
160
|
+
const currentNode = dependencyGraph.get(currentNodeId);
|
|
161
|
+
if (!currentNode)
|
|
162
|
+
continue;
|
|
163
|
+
for (const dependencyId of currentNode.dependencies) {
|
|
164
|
+
if (dependencyId === targetNodeId) {
|
|
165
|
+
return [...pathSoFar, dependencyId];
|
|
166
|
+
}
|
|
167
|
+
if (!visitedNodes.has(dependencyId)) {
|
|
168
|
+
searchQueue.push({
|
|
169
|
+
currentNodeId: dependencyId,
|
|
170
|
+
pathSoFar: [...pathSoFar, dependencyId],
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=graph-algorithms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-algorithms.js","sourceRoot":"","sources":["../../src/utils/graph-algorithms.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,eAAgC;IAC9D,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC7D,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,oCAAoC;IACpC,KAAK,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,eAAe,EAAE,CAAC;QAClD,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,yDAAyD;IACzD,KAAK,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,qBAAqB,EAAE,CAAC;QAC3D,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC5B,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QA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I,GAAG,EAAU,CAAC;IACvC,MAAM,WAAW,GAA0D;QACzE,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE;KACzD,CAAC;IAEF,OAAO,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,KAAK,EAAG,CAAC;QAE1D,IAAI,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;YACpC,SAAS;QACX,CAAC;QAED,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAEhC,MAAM,WAAW,GAAG,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACvD,IAAI,CAAC,WAAW;YAAE,SAAS;QAE3B,KAAK,MAAM,YAAY,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC;YACpD,IAAI,YAAY,KAAK,YAAY,EAAE,CAAC;gBAClC,OAAO,CAAC,GAAG,SAAS,EAAE,YAAY,CAAC,CAAC;YACtC,CAAC;YAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBACpC,WAAW,CAAC,IAAI,CAAC;oBACf,aAAa,EAAE,YAAY;oBAC3B,SAAS,EAAE,CAAC,GAAG,SAAS,EAAE,YAAY,CAAC;iBACxC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log levels in order of severity
|
|
3
|
+
*/
|
|
4
|
+
export declare enum LogLevel {
|
|
5
|
+
DEBUG = "DEBUG",
|
|
6
|
+
INFO = "INFO",
|
|
7
|
+
WARN = "WARN",
|
|
8
|
+
ERROR = "ERROR"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Log entry structure
|
|
12
|
+
*/
|
|
13
|
+
export type LogEntry = {
|
|
14
|
+
timestamp: string;
|
|
15
|
+
level: LogLevel;
|
|
16
|
+
component: string;
|
|
17
|
+
message: string;
|
|
18
|
+
context?: Record<string, unknown>;
|
|
19
|
+
duration?: number;
|
|
20
|
+
error?: {
|
|
21
|
+
name: string;
|
|
22
|
+
message: string;
|
|
23
|
+
stack?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Logger configuration
|
|
28
|
+
*/
|
|
29
|
+
export type LoggerConfig = {
|
|
30
|
+
/** Component name for context */
|
|
31
|
+
component: string;
|
|
32
|
+
/** Minimum log level to record */
|
|
33
|
+
level: LogLevel;
|
|
34
|
+
/** Enable console output */
|
|
35
|
+
logToConsole: boolean;
|
|
36
|
+
/** Enable file output */
|
|
37
|
+
logToFile: boolean;
|
|
38
|
+
/** Directory for log files */
|
|
39
|
+
logDirectory?: string;
|
|
40
|
+
/** Format: 'json' or 'text' */
|
|
41
|
+
format: 'json' | 'text';
|
|
42
|
+
/** Max log file size in MB before rotation */
|
|
43
|
+
maxLogFileSizeMB: number;
|
|
44
|
+
/** Max number of rotated log files to keep */
|
|
45
|
+
maxLogFiles: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Performance timer for measuring operation duration
|
|
49
|
+
*/
|
|
50
|
+
export declare class PerformanceTimer {
|
|
51
|
+
private startTime;
|
|
52
|
+
private label;
|
|
53
|
+
constructor(label: string);
|
|
54
|
+
end(): number;
|
|
55
|
+
getLabel(): string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Singleton Logger with file rotation and structured logging
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const logger = Logger.getInstance({ component: 'MyComponent' });
|
|
63
|
+
* logger.info('Operation started', { userId: 123 });
|
|
64
|
+
* logger.error('Operation failed', { error, userId: 123 });
|
|
65
|
+
*
|
|
66
|
+
* const timer = logger.startTimer('expensive-operation');
|
|
67
|
+
* // ... do work ...
|
|
68
|
+
* logger.info('Operation completed', { duration: timer.end() });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare class Logger {
|
|
72
|
+
private static instances;
|
|
73
|
+
private config;
|
|
74
|
+
private logFilePath?;
|
|
75
|
+
private writeQueue;
|
|
76
|
+
/**
|
|
77
|
+
* Private constructor - use getInstance() instead
|
|
78
|
+
*/
|
|
79
|
+
private constructor();
|
|
80
|
+
/**
|
|
81
|
+
* Get logger instance for component (one instance per component)
|
|
82
|
+
*/
|
|
83
|
+
static getInstance(config: Partial<LoggerConfig> & {
|
|
84
|
+
component: string;
|
|
85
|
+
}): Logger;
|
|
86
|
+
/**
|
|
87
|
+
* Reset all instances (for testing)
|
|
88
|
+
*/
|
|
89
|
+
static resetInstances(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Log debug message
|
|
92
|
+
*/
|
|
93
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Log info message
|
|
96
|
+
*/
|
|
97
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
98
|
+
/**
|
|
99
|
+
* Log warning message
|
|
100
|
+
*/
|
|
101
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
102
|
+
/**
|
|
103
|
+
* Log error message
|
|
104
|
+
*/
|
|
105
|
+
error(message: string, context?: Record<string, unknown>): void;
|
|
106
|
+
/**
|
|
107
|
+
* Log with timer duration
|
|
108
|
+
*/
|
|
109
|
+
logWithDuration(level: LogLevel, message: string, timer: PerformanceTimer, context?: Record<string, unknown>): void;
|
|
110
|
+
/**
|
|
111
|
+
* Update logger configuration
|
|
112
|
+
*/
|
|
113
|
+
configure(config: Partial<Omit<LoggerConfig, 'component'>>): void;
|
|
114
|
+
/**
|
|
115
|
+
* Get current configuration
|
|
116
|
+
*/
|
|
117
|
+
getConfig(): Readonly<LoggerConfig>;
|
|
118
|
+
/**
|
|
119
|
+
* Flush any pending writes (useful for testing)
|
|
120
|
+
*/
|
|
121
|
+
flush(): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Core logging method
|
|
124
|
+
*/
|
|
125
|
+
private log;
|
|
126
|
+
/**
|
|
127
|
+
* Log to console with color coding
|
|
128
|
+
*/
|
|
129
|
+
private logToConsoleOutput;
|
|
130
|
+
/**
|
|
131
|
+
* Log to file asynchronously (queued to prevent race conditions)
|
|
132
|
+
*/
|
|
133
|
+
private logToFileAsync;
|
|
134
|
+
/**
|
|
135
|
+
* Check file size and rotate if needed
|
|
136
|
+
*/
|
|
137
|
+
private rotateIfNeeded;
|
|
138
|
+
/**
|
|
139
|
+
* Rotate log file
|
|
140
|
+
*/
|
|
141
|
+
private rotateLogFile;
|
|
142
|
+
/**
|
|
143
|
+
* Format log entry based on configured format
|
|
144
|
+
*/
|
|
145
|
+
private formatEntry;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Get or create logger instance
|
|
149
|
+
*/
|
|
150
|
+
export declare function getLogger(component: string, config?: Partial<Omit<LoggerConfig, 'component'>>): Logger;
|
|
151
|
+
/**
|
|
152
|
+
* Create a performance timer for measuring operation duration
|
|
153
|
+
*/
|
|
154
|
+
export declare function startTimer(label: string): PerformanceTimer;
|