@edgible-team/cli 1.0.1 → 1.2.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/LICENSE +16 -0
- package/README.md +114 -1
- package/dist/client/api-client.d.ts +575 -0
- package/dist/client/api-client.d.ts.map +1 -0
- package/dist/client/api-client.js +196 -2
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/commands/agent.d.ts +3 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +18 -34
- package/dist/commands/ai.d.ts +3 -0
- package/dist/commands/ai.d.ts.map +1 -0
- package/dist/commands/ai.js +1661 -275
- package/dist/commands/application.d.ts +6 -0
- package/dist/commands/application.d.ts.map +1 -0
- package/dist/commands/application.js +377 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/base/BaseCommand.d.ts +53 -0
- package/dist/commands/base/BaseCommand.d.ts.map +1 -0
- package/dist/commands/base/CommandHandler.d.ts +28 -0
- package/dist/commands/base/CommandHandler.d.ts.map +1 -0
- package/dist/commands/base/command-wrapper.d.ts +21 -0
- package/dist/commands/base/command-wrapper.d.ts.map +1 -0
- package/dist/commands/base/middleware.d.ts +34 -0
- package/dist/commands/base/middleware.d.ts.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/connectivity.d.ts +3 -0
- package/dist/commands/connectivity.d.ts.map +1 -0
- package/dist/commands/debug.d.ts +3 -0
- package/dist/commands/debug.d.ts.map +1 -0
- package/dist/commands/debug.js +336 -0
- package/dist/commands/discover.d.ts +3 -0
- package/dist/commands/discover.d.ts.map +1 -0
- package/dist/commands/examples/migrated-command-example.d.ts +31 -0
- package/dist/commands/examples/migrated-command-example.d.ts.map +1 -0
- package/dist/commands/gateway.d.ts +6 -0
- package/dist/commands/gateway.d.ts.map +1 -0
- package/dist/commands/managedGateway.d.ts +6 -0
- package/dist/commands/managedGateway.d.ts.map +1 -0
- package/dist/commands/managedGateway.js +132 -0
- package/dist/commands/utils/config-validator.d.ts +29 -0
- package/dist/commands/utils/config-validator.d.ts.map +1 -0
- package/dist/commands/utils/gateway-prompt.d.ts +23 -0
- package/dist/commands/utils/gateway-prompt.d.ts.map +1 -0
- package/dist/commands/utils/input-parser.d.ts +34 -0
- package/dist/commands/utils/input-parser.d.ts.map +1 -0
- package/dist/commands/utils/output-formatter.d.ts +62 -0
- package/dist/commands/utils/output-formatter.d.ts.map +1 -0
- package/dist/config/app-config.d.ts +44 -0
- package/dist/config/app-config.d.ts.map +1 -0
- package/dist/detection/SystemCapabilityDetector.d.ts +139 -0
- package/dist/detection/SystemCapabilityDetector.d.ts.map +1 -0
- package/dist/detection/ToolDetector.d.ts +16 -0
- package/dist/detection/ToolDetector.d.ts.map +1 -0
- package/dist/detection/WorkloadDetector.d.ts +62 -0
- package/dist/detection/WorkloadDetector.d.ts.map +1 -0
- package/dist/detection/tools.d.ts +16 -0
- package/dist/detection/tools.d.ts.map +1 -0
- package/dist/detection/tools.js +305 -0
- package/dist/di/bindings.d.ts +15 -0
- package/dist/di/bindings.d.ts.map +1 -0
- package/dist/di/container.d.ts +44 -0
- package/dist/di/container.d.ts.map +1 -0
- package/dist/di/types.d.ts +23 -0
- package/dist/di/types.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -1
- package/dist/interfaces/IDaemonManager.d.ts +67 -0
- package/dist/interfaces/IDaemonManager.d.ts.map +1 -0
- package/dist/repositories/config-repository.d.ts +46 -0
- package/dist/repositories/config-repository.d.ts.map +1 -0
- package/dist/repositories/gateway-repository.d.ts +37 -0
- package/dist/repositories/gateway-repository.d.ts.map +1 -0
- package/dist/services/AgentStatusManager.d.ts +30 -0
- package/dist/services/AgentStatusManager.d.ts.map +1 -0
- package/dist/services/ConnectivityTester.d.ts +30 -0
- package/dist/services/ConnectivityTester.d.ts.map +1 -0
- package/dist/services/DependencyInstaller.d.ts +32 -0
- package/dist/services/DependencyInstaller.d.ts.map +1 -0
- package/dist/services/LocalAgentManager.d.ts +220 -0
- package/dist/services/LocalAgentManager.d.ts.map +1 -0
- package/dist/services/LocalAgentManager.js +3 -5
- package/dist/services/application/ApplicationService.d.ts +54 -0
- package/dist/services/application/ApplicationService.d.ts.map +1 -0
- package/dist/services/application/ApplicationService.js +10 -3
- package/dist/services/auth/AuthService.d.ts +42 -0
- package/dist/services/auth/AuthService.d.ts.map +1 -0
- package/dist/services/aws.d.ts +136 -0
- package/dist/services/aws.d.ts.map +1 -0
- package/dist/services/aws.js +2 -2
- package/dist/services/daemon/DaemonManagerFactory.d.ts +17 -0
- package/dist/services/daemon/DaemonManagerFactory.d.ts.map +1 -0
- package/dist/services/daemon/DockerDaemonManager.d.ts +26 -0
- package/dist/services/daemon/DockerDaemonManager.d.ts.map +1 -0
- package/dist/services/daemon/LaunchdDaemonManager.d.ts +20 -0
- package/dist/services/daemon/LaunchdDaemonManager.d.ts.map +1 -0
- package/dist/services/daemon/LaunchdDaemonManager.js +54 -6
- package/dist/services/daemon/PodmanDaemonManager.d.ts +24 -0
- package/dist/services/daemon/PodmanDaemonManager.d.ts.map +1 -0
- package/dist/services/daemon/SystemdDaemonManager.d.ts +20 -0
- package/dist/services/daemon/SystemdDaemonManager.d.ts.map +1 -0
- package/dist/services/daemon/WindowsServiceDaemonManager.d.ts +19 -0
- package/dist/services/daemon/WindowsServiceDaemonManager.d.ts.map +1 -0
- package/dist/services/daemon/index.d.ts +7 -0
- package/dist/services/daemon/index.d.ts.map +1 -0
- package/dist/services/edgible.d.ts +304 -0
- package/dist/services/edgible.d.ts.map +1 -0
- package/dist/services/edgible.js +53 -4
- package/dist/services/gateway/GatewayService.d.ts +88 -0
- package/dist/services/gateway/GatewayService.d.ts.map +1 -0
- package/dist/state/config.d.ts +96 -0
- package/dist/state/config.d.ts.map +1 -0
- package/dist/types/AgentConfig.d.ts +126 -0
- package/dist/types/AgentConfig.d.ts.map +1 -0
- package/dist/types/AgentStatus.d.ts +30 -0
- package/dist/types/AgentStatus.d.ts.map +1 -0
- package/dist/types/ApiClient.d.ts +36 -0
- package/dist/types/ApiClient.d.ts.map +1 -0
- package/dist/types/ApiRequests.d.ts +269 -0
- package/dist/types/ApiRequests.d.ts.map +1 -0
- package/dist/types/ApiResponses.d.ts +348 -0
- package/dist/types/ApiResponses.d.ts.map +1 -0
- package/dist/types/Application.d.ts +13 -0
- package/dist/types/Application.d.ts.map +1 -0
- package/dist/types/CaddyJson.d.ts +231 -0
- package/dist/types/CaddyJson.d.ts.map +1 -0
- package/dist/types/DeviceMetrics.d.ts +95 -0
- package/dist/types/DeviceMetrics.d.ts.map +1 -0
- package/dist/types/DeviceMetrics.js +5 -0
- package/dist/types/LogAggregation.d.ts +106 -0
- package/dist/types/LogAggregation.d.ts.map +1 -0
- package/dist/types/LogAggregation.js +5 -0
- package/dist/types/LogEntry.d.ts +60 -0
- package/dist/types/LogEntry.d.ts.map +1 -0
- package/dist/types/LogEntry.js +5 -0
- package/dist/types/UnifiedAgentStatus.d.ts +28 -0
- package/dist/types/UnifiedAgentStatus.d.ts.map +1 -0
- package/dist/types/WireGuard.d.ts +36 -0
- package/dist/types/WireGuard.d.ts.map +1 -0
- package/dist/types/Workload.d.ts +9 -0
- package/dist/types/Workload.d.ts.map +1 -0
- package/dist/types/agent.d.ts +120 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/command-options.d.ts +115 -0
- package/dist/types/command-options.d.ts.map +1 -0
- package/dist/types/connectivity.d.ts +80 -0
- package/dist/types/connectivity.d.ts.map +1 -0
- package/dist/types/errors.d.ts +97 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/gateway-types.d.ts +46 -0
- package/dist/types/gateway-types.d.ts.map +1 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/models/ApplicationData.d.ts +78 -0
- package/dist/types/models/ApplicationData.d.ts.map +1 -0
- package/dist/types/models/CertificateData.d.ts +44 -0
- package/dist/types/models/CertificateData.d.ts.map +1 -0
- package/dist/types/models/DeviceData.d.ts +29 -0
- package/dist/types/models/DeviceData.d.ts.map +1 -0
- package/dist/types/models/DevicePoolData.d.ts +47 -0
- package/dist/types/models/DevicePoolData.d.ts.map +1 -0
- package/dist/types/models/LifecycleEvent.d.ts +27 -0
- package/dist/types/models/LifecycleEvent.d.ts.map +1 -0
- package/dist/types/models/LifecycleEvent.js +5 -0
- package/dist/types/models/OrganizationData.d.ts +53 -0
- package/dist/types/models/OrganizationData.d.ts.map +1 -0
- package/dist/types/models/OrganizationInviteData.d.ts +39 -0
- package/dist/types/models/OrganizationInviteData.d.ts.map +1 -0
- package/dist/types/models/ProviderConfiguration.d.ts +37 -0
- package/dist/types/models/ProviderConfiguration.d.ts.map +1 -0
- package/dist/types/models/ResourceData.d.ts +18 -0
- package/dist/types/models/ResourceData.d.ts.map +1 -0
- package/dist/types/models/ServiceResourceData.d.ts +5 -0
- package/dist/types/models/ServiceResourceData.d.ts.map +1 -0
- package/dist/types/models/UserData.d.ts +12 -0
- package/dist/types/models/UserData.d.ts.map +1 -0
- package/dist/types/route.d.ts +67 -0
- package/dist/types/route.d.ts.map +1 -0
- package/dist/types/validation/schemas.d.ts +606 -0
- package/dist/types/validation/schemas.d.ts.map +1 -0
- package/dist/types/validation/schemas.js +46 -4
- package/dist/types/validation.d.ts +68 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/utils/FileIntegrityManager.d.ts +37 -0
- package/dist/utils/FileIntegrityManager.d.ts.map +1 -0
- package/dist/utils/PathMigration.d.ts +45 -0
- package/dist/utils/PathMigration.d.ts.map +1 -0
- package/dist/utils/PathResolver.d.ts +76 -0
- package/dist/utils/PathResolver.d.ts.map +1 -0
- package/dist/utils/PlatformDetector.d.ts +60 -0
- package/dist/utils/PlatformDetector.d.ts.map +1 -0
- package/dist/utils/console-logger.d.ts +37 -0
- package/dist/utils/console-logger.d.ts.map +1 -0
- package/dist/utils/docker-compose-parser.d.ts +28 -0
- package/dist/utils/docker-compose-parser.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +63 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/health-checker.d.ts +34 -0
- package/dist/utils/health-checker.d.ts.map +1 -0
- package/dist/utils/json-logger.d.ts +23 -0
- package/dist/utils/json-logger.d.ts.map +1 -0
- package/dist/utils/log-formatter.d.ts +85 -0
- package/dist/utils/log-formatter.d.ts.map +1 -0
- package/dist/utils/log-formatter.js +39 -11
- package/dist/utils/logger.d.ts +34 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/network-utils.d.ts +56 -0
- package/dist/utils/network-utils.d.ts.map +1 -0
- package/dist/utils/output.d.ts +73 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/passwordValidation.d.ts +32 -0
- package/dist/utils/passwordValidation.d.ts.map +1 -0
- package/dist/utils/progress.d.ts +74 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/sudo-checker.d.ts +9 -0
- package/dist/utils/sudo-checker.d.ts.map +1 -0
- package/dist/utils/urls.d.ts +19 -0
- package/dist/utils/urls.d.ts.map +1 -0
- package/dist/utils/urls.js +3 -3
- package/dist/utils/validation.d.ts +19 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/validation/schemas.d.ts +197 -0
- package/dist/validation/schemas.d.ts.map +1 -0
- package/dist/validation/schemas.js +1 -1
- package/dist/validation/validator.d.ts +22 -0
- package/dist/validation/validator.d.ts.map +1 -0
- package/package.json +9 -4
- package/recipes/compose/open-webui/.env +1 -0
- package/recipes/compose/open-webui/docker-compose.yml +17 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
3
|
// This file is copied from backend during build. Changes will be overwritten.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.GetResourceSchema = exports.UpdateResourceSchema = exports.CreateResourceSchema = exports.CreateDeviceWithOrphanedOrganizationSchema = exports.GetChallengeSessionSchema = exports.ForceChangePasswordSchema = exports.RefreshTokenSchema = exports.AuthenticateSchema = exports.LinkOrganizationSchema = exports.UpdateResourceLimitsSchema = exports.CreateBillingOrganizationSchema = exports.AdoptOrganizationSchema = exports.CancelInviteSchema = exports.DeclineInviteSchema = exports.AcceptInviteSchema = exports.CreateOrganizationInviteSchema = exports.GetDeviceSchema = exports.UpdateDeviceSchema = exports.CreateDeviceSchema = exports.RefreshCertificatePathSchema = exports.GetCertificatePathSchema = exports.GetCertificatesPathSchema = exports.GetApplicationSchema = exports.UpdateApplicationSchema = exports.CreateApplicationSchema = exports.GetUserSchema = exports.UpdateUserSchema = exports.CreateUserSchema = exports.GetOrganizationSchema = exports.UpdateOrganizationSchema = exports.CreateOrganizationSchema = void 0;
|
|
5
|
+
exports.CreateLifecycleEventSchema = exports.PostDevicePoolTrafficSchema = exports.CheckApplicationReachabilitySchema = exports.GetResourceSchema = exports.UpdateResourceSchema = exports.CreateResourceSchema = exports.CreateDeviceWithOrphanedOrganizationSchema = exports.GetChallengeSessionSchema = exports.ForceChangePasswordSchema = exports.RefreshTokenSchema = exports.AuthenticateSchema = exports.LinkOrganizationSchema = exports.UpdateResourceLimitsSchema = exports.CreateBillingOrganizationSchema = exports.AdoptOrganizationSchema = exports.CancelInviteSchema = exports.DeclineInviteSchema = exports.AcceptInviteSchema = exports.CreateOrganizationInviteSchema = exports.GetDeviceSchema = exports.UpdateDeviceSchema = exports.CreateDeviceSchema = exports.RefreshCertificatePathSchema = exports.GetCertificatePathSchema = exports.GetCertificatesPathSchema = exports.GetApplicationSchema = exports.UpdateApplicationSchema = exports.CreateApplicationSchema = exports.GetUserSchema = exports.UpdateUserSchema = exports.CreateUserSchema = exports.GetOrganizationSchema = exports.UpdateOrganizationSchema = exports.CreateOrganizationSchema = void 0;
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
7
|
// Organization validation schemas
|
|
8
8
|
exports.CreateOrganizationSchema = zod_1.z.object({
|
|
@@ -39,10 +39,17 @@ exports.CreateApplicationSchema = zod_1.z.object({
|
|
|
39
39
|
name: zod_1.z.string().min(1, 'Name is required').max(100, 'Name must be 100 characters or less'),
|
|
40
40
|
description: zod_1.z.string().max(500).optional(),
|
|
41
41
|
organizationId: zod_1.z.string().min(1, 'Organization ID is required'),
|
|
42
|
-
environment: zod_1.z.enum(['development', 'staging', '
|
|
42
|
+
environment: zod_1.z.enum(['development', 'staging', 'prod']).default('development'),
|
|
43
43
|
configuration: zod_1.z.object({
|
|
44
44
|
port: zod_1.z.number().int().min(1).max(65535, 'Port must be between 1 and 65535'),
|
|
45
45
|
protocol: zod_1.z.enum(['http', 'https', 'tcp', 'udp']),
|
|
46
|
+
command: zod_1.z.string().optional(),
|
|
47
|
+
workingDirectory: zod_1.z.string().optional(),
|
|
48
|
+
env: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
49
|
+
logFile: zod_1.z.string().optional(),
|
|
50
|
+
healthCheckPath: zod_1.z.string().optional(),
|
|
51
|
+
dockerComposePath: zod_1.z.string().optional(),
|
|
52
|
+
systemdService: zod_1.z.string().optional(),
|
|
46
53
|
}),
|
|
47
54
|
hostnames: zod_1.z
|
|
48
55
|
.array(zod_1.z
|
|
@@ -52,12 +59,15 @@ exports.CreateApplicationSchema = zod_1.z.object({
|
|
|
52
59
|
deviceIds: zod_1.z.array(zod_1.z.string().min(1)).min(1, 'At least one device ID is required'),
|
|
53
60
|
gatewayIds: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
54
61
|
useManagedGateway: zod_1.z.boolean().optional(),
|
|
55
|
-
subtype: zod_1.z.enum(['local-preexisting', 'managed-docker', 'systemd', 'docker-compose']),
|
|
62
|
+
subtype: zod_1.z.enum(['local-preexisting', 'managed-docker', 'systemd', 'docker-compose', 'managed-process']),
|
|
56
63
|
});
|
|
64
|
+
// IP address or CIDR block validation
|
|
65
|
+
const IPOrCIDRSchema = zod_1.z.string().regex(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\/(?:[0-9]|[1-2][0-9]|3[0-2]))?$/, 'Invalid IP address or CIDR block (e.g., 192.168.1.0/24 or 10.0.0.1)');
|
|
57
66
|
exports.UpdateApplicationSchema = zod_1.z.object({
|
|
58
67
|
name: zod_1.z.string().min(1).max(100).optional(),
|
|
59
68
|
description: zod_1.z.string().max(500).optional(),
|
|
60
|
-
environment: zod_1.z.enum(['development', 'staging', '
|
|
69
|
+
environment: zod_1.z.enum(['development', 'staging', 'prod']).optional(),
|
|
70
|
+
allowedSourceIPs: zod_1.z.array(IPOrCIDRSchema).optional(),
|
|
61
71
|
});
|
|
62
72
|
exports.GetApplicationSchema = zod_1.z.object({
|
|
63
73
|
applicationId: zod_1.z.string().min(1, 'Application ID is required'),
|
|
@@ -215,4 +225,36 @@ exports.UpdateResourceSchema = zod_1.z.object({
|
|
|
215
225
|
exports.GetResourceSchema = zod_1.z.object({
|
|
216
226
|
resourceId: zod_1.z.string().min(1, 'Resource ID is required'),
|
|
217
227
|
});
|
|
228
|
+
// Application reachability validation schemas
|
|
229
|
+
exports.CheckApplicationReachabilitySchema = zod_1.z.object({
|
|
230
|
+
applicationId: zod_1.z.string().min(1, 'Application ID is required'),
|
|
231
|
+
});
|
|
232
|
+
// Device pool traffic validation schemas
|
|
233
|
+
exports.PostDevicePoolTrafficSchema = zod_1.z.object({
|
|
234
|
+
ingressBytes: zod_1.z.number().nonnegative('ingressBytes must be non-negative'),
|
|
235
|
+
egressBytes: zod_1.z.number().nonnegative('egressBytes must be non-negative'),
|
|
236
|
+
});
|
|
237
|
+
// Lifecycle event validation schemas
|
|
238
|
+
exports.CreateLifecycleEventSchema = zod_1.z.object({
|
|
239
|
+
eventType: zod_1.z.enum([
|
|
240
|
+
'application_ip_whitelist_updated',
|
|
241
|
+
'application_started',
|
|
242
|
+
'application_stopped',
|
|
243
|
+
'application_config_updated',
|
|
244
|
+
'device_config_updated',
|
|
245
|
+
'device_wireguard_config_updated'
|
|
246
|
+
]),
|
|
247
|
+
organizationId: zod_1.z.string().min(1, 'Organization ID is required'),
|
|
248
|
+
applicationId: zod_1.z.string().min(1).optional(),
|
|
249
|
+
deviceId: zod_1.z.string().min(1).optional(),
|
|
250
|
+
eventAction: zod_1.z.string().min(1, 'Event action is required'),
|
|
251
|
+
message: zod_1.z.string().min(1, 'Message is required'),
|
|
252
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
253
|
+
source: zod_1.z.enum(['backend', 'agent']),
|
|
254
|
+
sourceDetails: zod_1.z.object({
|
|
255
|
+
deviceType: zod_1.z.enum(['gateway', 'serving']).optional(),
|
|
256
|
+
userId: zod_1.z.string().optional(),
|
|
257
|
+
requestId: zod_1.z.string().optional(),
|
|
258
|
+
}).optional(),
|
|
259
|
+
});
|
|
218
260
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AgentStatus } from './agent';
|
|
2
|
+
import { ConnectivityReport } from './connectivity';
|
|
3
|
+
import { LocalAgentHealthStatus } from './agent';
|
|
4
|
+
export interface ApplicationSetupResult {
|
|
5
|
+
application: Application;
|
|
6
|
+
localAgentStatus: AgentStatus;
|
|
7
|
+
connectivityTest: ConnectivityReport;
|
|
8
|
+
healthValidation: LocalAgentHealthStatus;
|
|
9
|
+
setupComplete: boolean;
|
|
10
|
+
warnings: string[];
|
|
11
|
+
errors: string[];
|
|
12
|
+
duration: number;
|
|
13
|
+
timestamp: Date;
|
|
14
|
+
}
|
|
15
|
+
export interface ValidationResult {
|
|
16
|
+
success: boolean;
|
|
17
|
+
checks: ValidationCheck[];
|
|
18
|
+
overall: 'pass' | 'fail' | 'warn';
|
|
19
|
+
message?: string;
|
|
20
|
+
recommendations: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface ValidationCheck {
|
|
23
|
+
name: string;
|
|
24
|
+
status: 'pass' | 'fail' | 'warn' | 'skip';
|
|
25
|
+
message?: string;
|
|
26
|
+
details?: any;
|
|
27
|
+
duration?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface Application {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
workloadId: string;
|
|
33
|
+
servingIp: string;
|
|
34
|
+
port: number;
|
|
35
|
+
protocol: string;
|
|
36
|
+
status: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
gatewayId?: string;
|
|
40
|
+
localPort?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface Workload {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
status: string;
|
|
47
|
+
image?: string;
|
|
48
|
+
ports?: PortMapping[];
|
|
49
|
+
ip?: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface PortMapping {
|
|
53
|
+
hostIp?: string;
|
|
54
|
+
hostPort?: number;
|
|
55
|
+
containerPort: number;
|
|
56
|
+
protocol: 'tcp' | 'udp';
|
|
57
|
+
}
|
|
58
|
+
export interface Gateway {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
publicIp: string;
|
|
62
|
+
privateIp?: string;
|
|
63
|
+
region: string;
|
|
64
|
+
status: string;
|
|
65
|
+
deviceId: string;
|
|
66
|
+
ec2InstanceId?: string;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/types/validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,WAAW,CAAC;IAC9B,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC;CACzB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface FileIntegrityCheck {
|
|
2
|
+
isValid: boolean;
|
|
3
|
+
checksum: string;
|
|
4
|
+
size: number;
|
|
5
|
+
lastModified: number;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class FileIntegrityManager {
|
|
9
|
+
/**
|
|
10
|
+
* Check file integrity with multiple validation methods
|
|
11
|
+
*/
|
|
12
|
+
static checkFileIntegrity(filePath: string): Promise<FileIntegrityCheck>;
|
|
13
|
+
/**
|
|
14
|
+
* Safely read JSON file with integrity check
|
|
15
|
+
*/
|
|
16
|
+
static readJsonFileSafely(filePath: string): Promise<{
|
|
17
|
+
data: any;
|
|
18
|
+
isValid: boolean;
|
|
19
|
+
error?: string;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Safely write JSON file with atomic operation
|
|
23
|
+
*/
|
|
24
|
+
static writeJsonFileSafely(filePath: string, data: any): Promise<{
|
|
25
|
+
success: boolean;
|
|
26
|
+
error?: string;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Clean up corrupted files
|
|
30
|
+
*/
|
|
31
|
+
static cleanupCorruptedFiles(directory: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Create file lock to prevent concurrent access
|
|
34
|
+
*/
|
|
35
|
+
static withFileLock<T>(filePath: string, operation: () => Promise<T>): Promise<T>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=FileIntegrityManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileIntegrityManager.d.ts","sourceRoot":"","sources":["../../src/utils/FileIntegrityManager.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,oBAAoB;IAC/B;;OAEG;WACU,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAuE9E;;OAEG;WACU,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IA6B3G;;OAEG;WACU,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IA8C5G;;OAEG;WACU,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BpE;;OAEG;WACU,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAyCxF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PathMigration utility handles migration from legacy ~/.edgible paths
|
|
3
|
+
* to the new XDG/platform-specific paths.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PathMigration {
|
|
6
|
+
/**
|
|
7
|
+
* Check if legacy paths exist
|
|
8
|
+
*/
|
|
9
|
+
static hasLegacyPaths(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Get the legacy config path
|
|
12
|
+
*/
|
|
13
|
+
static getLegacyConfigPath(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get the legacy agent path
|
|
16
|
+
*/
|
|
17
|
+
static getLegacyAgentPath(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Migrate configuration from legacy paths to new paths
|
|
20
|
+
*
|
|
21
|
+
* @returns true if migration was successful or not needed, false if migration failed
|
|
22
|
+
*/
|
|
23
|
+
static migrateConfig(): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Migrate agent data from legacy paths to new paths
|
|
26
|
+
*
|
|
27
|
+
* @returns true if migration was successful or not needed, false if migration failed
|
|
28
|
+
*/
|
|
29
|
+
static migrateAgentData(): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Perform full migration from legacy paths to new paths
|
|
32
|
+
*
|
|
33
|
+
* @returns Migration result with details
|
|
34
|
+
*/
|
|
35
|
+
static migrate(): Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
migrated: string[];
|
|
38
|
+
errors: string[];
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Copy directory recursively
|
|
42
|
+
*/
|
|
43
|
+
private static copyDirectory;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=PathMigration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathMigration.d.ts","sourceRoot":"","sources":["../../src/utils/PathMigration.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,OAAO;IAKhC;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,MAAM;IAIpC;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,MAAM;IAInC;;;;OAIG;WACU,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAkD9C;;;;OAIG;WACU,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IA+BjD;;;;OAIG;WACU,OAAO,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAwC3F;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;CA2B7B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PathResolver provides centralized path management following industry standards:
|
|
3
|
+
* - XDG Base Directory specification on Linux
|
|
4
|
+
* - Platform-specific conventions on macOS and Windows
|
|
5
|
+
* - Proper handling of sudo contexts (preserves real user)
|
|
6
|
+
*/
|
|
7
|
+
export declare class PathResolver {
|
|
8
|
+
/**
|
|
9
|
+
* Get the real user's home directory, even when running under sudo.
|
|
10
|
+
* Detects the actual user via SUDO_USER environment variable.
|
|
11
|
+
*
|
|
12
|
+
* @returns The real user's home directory path
|
|
13
|
+
*/
|
|
14
|
+
static getRealUserHome(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Get the user-level data directory for CLI configuration and data.
|
|
17
|
+
* Follows XDG Base Directory spec on Linux, platform conventions elsewhere.
|
|
18
|
+
*
|
|
19
|
+
* @returns The user data directory path
|
|
20
|
+
*/
|
|
21
|
+
static getUserDataPath(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the system-level data directory for agent services.
|
|
24
|
+
* Used when the agent runs as a system service (systemd, launchd, etc.)
|
|
25
|
+
*
|
|
26
|
+
* @returns The system data directory path
|
|
27
|
+
*/
|
|
28
|
+
static getSystemDataPath(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get the agent configuration directory path.
|
|
31
|
+
* For CLI: returns user data path + '/agent'
|
|
32
|
+
* For system services: returns system data path + '/agent'
|
|
33
|
+
*
|
|
34
|
+
* @param useSystemPath - If true, use system path; otherwise use user path
|
|
35
|
+
* @returns The agent configuration directory path
|
|
36
|
+
*/
|
|
37
|
+
static getAgentConfigPath(useSystemPath?: boolean): string;
|
|
38
|
+
/**
|
|
39
|
+
* Get the CLI configuration file path.
|
|
40
|
+
*
|
|
41
|
+
* @returns The CLI config.json file path
|
|
42
|
+
*/
|
|
43
|
+
static getCliConfigPath(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get the agent configuration file path.
|
|
46
|
+
*
|
|
47
|
+
* @param useSystemPath - If true, use system path; otherwise use user path
|
|
48
|
+
* @returns The agent.config.json file path
|
|
49
|
+
*/
|
|
50
|
+
static getAgentConfigFilePath(useSystemPath?: boolean): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get the agent status file path.
|
|
53
|
+
*
|
|
54
|
+
* @param useSystemPath - If true, use system path; otherwise use user path
|
|
55
|
+
* @returns The status.json file path
|
|
56
|
+
*/
|
|
57
|
+
static getAgentStatusPath(useSystemPath?: boolean): string;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the agent config path based on installation type.
|
|
60
|
+
* For systemd/launchd/windows-service: uses system path
|
|
61
|
+
* For docker/podman: uses system path (mounted in container)
|
|
62
|
+
* Otherwise: uses user path
|
|
63
|
+
*
|
|
64
|
+
* @param installationType - The agent installation type
|
|
65
|
+
* @returns The appropriate agent config path
|
|
66
|
+
*/
|
|
67
|
+
static resolveAgentConfigPath(installationType?: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve the agent config file path based on installation type.
|
|
70
|
+
*
|
|
71
|
+
* @param installationType - The agent installation type
|
|
72
|
+
* @returns The appropriate agent config file path
|
|
73
|
+
*/
|
|
74
|
+
static resolveAgentConfigFilePath(installationType?: string): string;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=PathResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathResolver.d.ts","sourceRoot":"","sources":["../../src/utils/PathResolver.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,qBAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM;IAkDhC;;;;;OAKG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM;IAyBhC;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,IAAI,MAAM;IAmBlC;;;;;;;OAOG;IACH,MAAM,CAAC,kBAAkB,CAAC,aAAa,GAAE,OAAe,GAAG,MAAM;IAKjE;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,IAAI,MAAM;IAKjC;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,aAAa,GAAE,OAAe,GAAG,MAAM;IAKrE;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CAAC,aAAa,GAAE,OAAe,GAAG,MAAM;IAKjE;;;;;;;;OAQG;IACH,MAAM,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAShE;;;;;OAKG;IACH,MAAM,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;CAQrE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type Platform = 'linux' | 'darwin' | 'win32';
|
|
2
|
+
export type InstallationType = 'systemd' | 'launchd' | 'windows-service' | 'docker' | 'podman';
|
|
3
|
+
export interface InstallOption {
|
|
4
|
+
type: InstallationType;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
requires: string[];
|
|
8
|
+
pros: string[];
|
|
9
|
+
cons: string[];
|
|
10
|
+
bestFor: string;
|
|
11
|
+
available: boolean;
|
|
12
|
+
requiresRoot: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class PlatformDetector {
|
|
15
|
+
/**
|
|
16
|
+
* Get the current platform
|
|
17
|
+
*/
|
|
18
|
+
static getPlatform(): Platform;
|
|
19
|
+
/**
|
|
20
|
+
* Check if running as root/administrator
|
|
21
|
+
*/
|
|
22
|
+
static isRoot(): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Check if systemd is available (Linux)
|
|
25
|
+
*/
|
|
26
|
+
static hasSystemd(): Promise<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* Check if launchd is available (macOS)
|
|
29
|
+
*/
|
|
30
|
+
static hasLaunchd(): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Check if Docker is available
|
|
33
|
+
*/
|
|
34
|
+
static hasDocker(): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Check if Podman is available
|
|
37
|
+
*/
|
|
38
|
+
static hasPodman(): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Check if Node.js is available
|
|
41
|
+
*/
|
|
42
|
+
static hasNode(): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Get the path to Node.js executable
|
|
45
|
+
*/
|
|
46
|
+
static getNodePath(): Promise<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Get all available installation options for the current platform
|
|
49
|
+
*/
|
|
50
|
+
static getAvailableOptions(): Promise<InstallOption[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Get the recommended installation type for the current platform
|
|
53
|
+
*/
|
|
54
|
+
static getRecommendedType(): Promise<InstallationType | null>;
|
|
55
|
+
/**
|
|
56
|
+
* Get installation requirements message for when not running as root
|
|
57
|
+
*/
|
|
58
|
+
static getRootRequirementMessage(): string;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=PlatformDetector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformDetector.d.ts","sourceRoot":"","sources":["../../src/utils/PlatformDetector.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,QAAQ;IAO9B;;OAEG;WACU,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAiBvC;;OAEG;WACU,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAa3C;;OAEG;WACU,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAW3C;;OAEG;WACU,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAW1C;;OAEG;WACU,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAS1C;;OAEG;WACU,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IASxC;;OAEG;WACU,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAY3C;;OAEG;WACU,mBAAmB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAoF5D;;OAEG;WACU,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAmCnE;;OAEG;IACH,MAAM,CAAC,yBAAyB,IAAI,MAAM;CAS3C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Logger, LogLevel } from './logger';
|
|
2
|
+
/**
|
|
3
|
+
* Console logger implementation
|
|
4
|
+
* Formats and outputs logs to console with colors and formatting
|
|
5
|
+
*/
|
|
6
|
+
export declare class ConsoleLogger implements Logger {
|
|
7
|
+
private level;
|
|
8
|
+
private colorEnabled;
|
|
9
|
+
private plain;
|
|
10
|
+
constructor(options?: {
|
|
11
|
+
level?: LogLevel;
|
|
12
|
+
colorEnabled?: boolean;
|
|
13
|
+
plain?: boolean;
|
|
14
|
+
});
|
|
15
|
+
setLevel(level: LogLevel): void;
|
|
16
|
+
getLevel(): LogLevel;
|
|
17
|
+
setColorEnabled(enabled: boolean): void;
|
|
18
|
+
setPlain(plain: boolean): void;
|
|
19
|
+
debug(message: string, ...args: unknown[]): void;
|
|
20
|
+
info(message: string, ...args: unknown[]): void;
|
|
21
|
+
warn(message: string, ...args: unknown[]): void;
|
|
22
|
+
error(message: string, ...args: unknown[]): void;
|
|
23
|
+
private shouldLog;
|
|
24
|
+
private log;
|
|
25
|
+
private logPlain;
|
|
26
|
+
private logFormatted;
|
|
27
|
+
private getPrefix;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get or create default logger instance
|
|
31
|
+
*/
|
|
32
|
+
export declare function getLogger(): Logger;
|
|
33
|
+
/**
|
|
34
|
+
* Set default logger instance (useful for testing)
|
|
35
|
+
*/
|
|
36
|
+
export declare function setLogger(logger: Logger): void;
|
|
37
|
+
//# sourceMappingURL=console-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-logger.d.ts","sourceRoot":"","sources":["../../src/utils/console-logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAA6B,MAAM,UAAU,CAAC;AAEvE;;;GAGG;AACH,qBAAa,aAAc,YAAW,MAAM;IAC1C,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,KAAK,CAAkB;gBAEnB,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO;IAMvF,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B,QAAQ,IAAI,QAAQ;IAIpB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIvC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAI9B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMhD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMhD,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,GAAG;IAeX,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,SAAS;CAkBlB;AAOD;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAKlC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE9C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to parse docker-compose.yml files and extract container/port information
|
|
3
|
+
*/
|
|
4
|
+
export interface ContainerPort {
|
|
5
|
+
host: number;
|
|
6
|
+
container: number;
|
|
7
|
+
protocol: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ContainerInfo {
|
|
10
|
+
name: string;
|
|
11
|
+
ports: ContainerPort[];
|
|
12
|
+
}
|
|
13
|
+
export interface DockerComposeParseResult {
|
|
14
|
+
containers: ContainerInfo[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parse a docker-compose file and extract container and port information
|
|
18
|
+
* @param filePath Path to the docker-compose.yml or docker-compose.yaml file
|
|
19
|
+
* @returns Structured data containing containers and their ports
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseDockerComposeFile(filePath: string): DockerComposeParseResult;
|
|
22
|
+
/**
|
|
23
|
+
* Find docker-compose file in the current directory or specified path
|
|
24
|
+
* @param providedPath Optional path provided by user
|
|
25
|
+
* @returns Path to docker-compose file or null if not found
|
|
26
|
+
*/
|
|
27
|
+
export declare function findDockerComposeFile(providedPath?: string): string | null;
|
|
28
|
+
//# sourceMappingURL=docker-compose-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-compose-parser.d.ts","sourceRoot":"","sources":["../../src/utils/docker-compose-parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,wBAAwB,CA4EjF;AA6CD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqB1E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exit codes following Unix conventions
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ExitCode {
|
|
5
|
+
SUCCESS = 0,
|
|
6
|
+
ERROR = 1,
|
|
7
|
+
USAGE_ERROR = 2,
|
|
8
|
+
CONFIG_ERROR = 3,
|
|
9
|
+
NETWORK_ERROR = 4
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* CLI Error classes for better error handling
|
|
13
|
+
*/
|
|
14
|
+
export declare class CLIError extends Error {
|
|
15
|
+
readonly exitCode: ExitCode;
|
|
16
|
+
readonly showHelp: boolean;
|
|
17
|
+
constructor(message: string, exitCode?: ExitCode, showHelp?: boolean);
|
|
18
|
+
}
|
|
19
|
+
export declare class ValidationError extends CLIError {
|
|
20
|
+
constructor(message: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class ConfigError extends CLIError {
|
|
23
|
+
constructor(message: string);
|
|
24
|
+
}
|
|
25
|
+
export declare class NetworkError extends CLIError {
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Centralized error handler with consistent output
|
|
30
|
+
*/
|
|
31
|
+
export declare class ErrorHandler {
|
|
32
|
+
private static colorEnabled;
|
|
33
|
+
/**
|
|
34
|
+
* Configure color output
|
|
35
|
+
*/
|
|
36
|
+
static setColorEnabled(enabled: boolean): void;
|
|
37
|
+
/**
|
|
38
|
+
* Handle and display error with consistent format
|
|
39
|
+
*/
|
|
40
|
+
static handleError(error: unknown): void;
|
|
41
|
+
/**
|
|
42
|
+
* Display validation error
|
|
43
|
+
*/
|
|
44
|
+
static handleValidationError(message: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Display network error
|
|
47
|
+
*/
|
|
48
|
+
static handleNetworkError(message: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Display configuration error
|
|
51
|
+
*/
|
|
52
|
+
static handleConfigError(message: string): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Wrapper for async command handlers with error handling
|
|
56
|
+
*/
|
|
57
|
+
export declare function withErrorHandling<T extends any[]>(handler: (...args: T) => Promise<void>): (...args: T) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Wrap a command action with standardized error handling
|
|
60
|
+
* Use this for all command actions to ensure consistent error handling
|
|
61
|
+
*/
|
|
62
|
+
export declare function wrapCommandAction<T extends any[]>(action: (...args: T) => Promise<void>): (...args: T) => Promise<void>;
|
|
63
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,QAAQ;IAClB,OAAO,IAAI;IACX,KAAK,IAAI;IACT,WAAW,IAAI;IACf,YAAY,IAAI;IAChB,aAAa,IAAI;CAClB;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;aAGf,QAAQ,EAAE,QAAQ;aAClB,QAAQ,EAAE,OAAO;gBAFjC,OAAO,EAAE,MAAM,EACC,QAAQ,GAAE,QAAyB,EACnC,QAAQ,GAAE,OAAe;CAK5C;AAED,qBAAa,eAAgB,SAAQ,QAAQ;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,WAAY,SAAQ,QAAQ;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAA6C;IAExE;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI9C;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAkBxC;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKnD;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMhD;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAKhD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,GAAG,EAAE,EAC/C,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GACrC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAQ/B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,GAAG,EAAE,EAC/C,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GACpC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAE/B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HttpTestResult, TestOptions } from '../types/connectivity';
|
|
2
|
+
import { HealthCheckConfig } from '../types/agent';
|
|
3
|
+
export declare class HealthChecker {
|
|
4
|
+
/**
|
|
5
|
+
* Perform HTTP health check
|
|
6
|
+
*/
|
|
7
|
+
static checkHttpHealth(url: string, config: HealthCheckConfig, options?: TestOptions): Promise<HttpTestResult>;
|
|
8
|
+
/**
|
|
9
|
+
* Evaluate HTTP response for health check
|
|
10
|
+
*/
|
|
11
|
+
private static evaluateHealthResponse;
|
|
12
|
+
/**
|
|
13
|
+
* Generate error message for failed health check
|
|
14
|
+
*/
|
|
15
|
+
private static generateHealthErrorMessage;
|
|
16
|
+
/**
|
|
17
|
+
* Perform multiple health checks with retries
|
|
18
|
+
*/
|
|
19
|
+
static performHealthChecks(url: string, config: HealthCheckConfig, options?: TestOptions): Promise<HttpTestResult[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Check if a service is responding to basic connectivity
|
|
22
|
+
*/
|
|
23
|
+
static checkBasicConnectivity(host: string, port: number, protocol?: 'http' | 'https'): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Generate health check summary
|
|
26
|
+
*/
|
|
27
|
+
static generateHealthSummary(results: HttpTestResult[]): {
|
|
28
|
+
overall: boolean;
|
|
29
|
+
successRate: number;
|
|
30
|
+
averageResponseTime: number;
|
|
31
|
+
errors: string[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=health-checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-checker.d.ts","sourceRoot":"","sources":["../../src/utils/health-checker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,qBAAa,aAAa;IACxB;;OAEG;WACU,eAAe,CAC1B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,cAAc,CAAC;IAqD1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IA4BrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IA0BzC;;OAEG;WACU,mBAAmB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,cAAc,EAAE,CAAC;IAqB5B;;OAEG;WACU,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,GAAG,OAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAUtH;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG;QACvD,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB;CAeF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Logger, LogLevel } from './logger';
|
|
2
|
+
/**
|
|
3
|
+
* JSON logger implementation for scripting and automation
|
|
4
|
+
* Outputs structured JSON logs that can be easily parsed
|
|
5
|
+
*/
|
|
6
|
+
export declare class JsonLogger implements Logger {
|
|
7
|
+
private level;
|
|
8
|
+
private outputStream;
|
|
9
|
+
constructor(options?: {
|
|
10
|
+
level?: LogLevel;
|
|
11
|
+
outputStream?: NodeJS.WriteStream;
|
|
12
|
+
});
|
|
13
|
+
setLevel(level: LogLevel): void;
|
|
14
|
+
getLevel(): LogLevel;
|
|
15
|
+
debug(message: string, ...args: unknown[]): void;
|
|
16
|
+
info(message: string, ...args: unknown[]): void;
|
|
17
|
+
warn(message: string, ...args: unknown[]): void;
|
|
18
|
+
error(message: string, ...args: unknown[]): void;
|
|
19
|
+
private shouldLog;
|
|
20
|
+
private log;
|
|
21
|
+
private getLevelName;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=json-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-logger.d.ts","sourceRoot":"","sources":["../../src/utils/json-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE5C;;;GAGG;AACH,qBAAa,UAAW,YAAW,MAAM;IACvC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,YAAY,CAAqB;gBAE7B,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;KAAO;IAKjF,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B,QAAQ,IAAI,QAAQ;IAIpB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMhD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMhD,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,GAAG;IAYX,OAAO,CAAC,YAAY;CAgBrB"}
|