@simplens/onboard 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +331 -214
  2. package/dist/__tests__/env-config.test.d.ts +2 -0
  3. package/dist/__tests__/env-config.test.d.ts.map +1 -0
  4. package/dist/__tests__/env-config.test.js +23 -0
  5. package/dist/__tests__/env-config.test.js.map +1 -0
  6. package/dist/__tests__/infra-prompts.test.d.ts +2 -0
  7. package/dist/__tests__/infra-prompts.test.d.ts.map +1 -0
  8. package/dist/__tests__/infra-prompts.test.js +43 -0
  9. package/dist/__tests__/infra-prompts.test.js.map +1 -0
  10. package/dist/__tests__/infra.test.d.ts +2 -0
  11. package/dist/__tests__/infra.test.d.ts.map +1 -0
  12. package/dist/__tests__/infra.test.js +14 -0
  13. package/dist/__tests__/infra.test.js.map +1 -0
  14. package/dist/__tests__/nginx.test.d.ts +2 -0
  15. package/dist/__tests__/nginx.test.d.ts.map +1 -0
  16. package/dist/__tests__/nginx.test.js +16 -0
  17. package/dist/__tests__/nginx.test.js.map +1 -0
  18. package/dist/env-config.d.ts +27 -12
  19. package/dist/env-config.d.ts.map +1 -1
  20. package/dist/env-config.js +253 -128
  21. package/dist/env-config.js.map +1 -1
  22. package/dist/index.js +340 -69
  23. package/dist/index.js.map +1 -1
  24. package/dist/infra.d.ts +19 -8
  25. package/dist/infra.d.ts.map +1 -1
  26. package/dist/infra.js +267 -128
  27. package/dist/infra.js.map +1 -1
  28. package/dist/plugins.d.ts +5 -10
  29. package/dist/plugins.d.ts.map +1 -1
  30. package/dist/plugins.js +75 -44
  31. package/dist/plugins.js.map +1 -1
  32. package/dist/services.d.ts +1 -23
  33. package/dist/services.d.ts.map +1 -1
  34. package/dist/services.js +47 -62
  35. package/dist/services.js.map +1 -1
  36. package/dist/templates.d.ts +2 -1
  37. package/dist/templates.d.ts.map +1 -1
  38. package/dist/templates.js +203 -191
  39. package/dist/templates.js.map +1 -1
  40. package/dist/types/domain.d.ts +2 -0
  41. package/dist/types/domain.d.ts.map +1 -1
  42. package/dist/ui.d.ts +45 -0
  43. package/dist/ui.d.ts.map +1 -0
  44. package/dist/ui.js +93 -0
  45. package/dist/ui.js.map +1 -0
  46. package/dist/utils/logger.d.ts +1 -0
  47. package/dist/utils/logger.d.ts.map +1 -1
  48. package/dist/utils/logger.js +32 -7
  49. package/dist/utils/logger.js.map +1 -1
  50. package/dist/utils.d.ts +8 -0
  51. package/dist/utils.d.ts.map +1 -1
  52. package/dist/utils.js +66 -2
  53. package/dist/utils.js.map +1 -1
  54. package/dist/validators.d.ts +1 -52
  55. package/dist/validators.d.ts.map +1 -1
  56. package/dist/validators.js +10 -57
  57. package/dist/validators.js.map +1 -1
  58. package/package.json +3 -5
  59. package/src/__tests__/env-config.test.ts +28 -0
  60. package/src/__tests__/errors.test.ts +187 -187
  61. package/src/__tests__/infra-prompts.test.ts +54 -0
  62. package/src/__tests__/infra.test.ts +15 -0
  63. package/src/__tests__/utils.test.ts +142 -142
  64. package/src/__tests__/validators.test.ts +195 -195
  65. package/src/config/constants.ts +86 -86
  66. package/src/config/index.ts +1 -1
  67. package/src/env-config.ts +455 -311
  68. package/src/index.ts +534 -202
  69. package/src/infra.ts +404 -245
  70. package/src/plugins.ts +221 -190
  71. package/src/services.ts +175 -190
  72. package/src/templates.ts +209 -196
  73. package/src/types/domain.ts +129 -127
  74. package/src/types/errors.ts +173 -173
  75. package/src/types/index.ts +2 -2
  76. package/src/ui.ts +91 -0
  77. package/src/utils/index.ts +1 -1
  78. package/src/utils/logger.ts +144 -118
  79. package/src/utils.ts +183 -105
  80. package/src/validators.ts +145 -192
  81. package/tsconfig.json +18 -18
  82. package/vitest.config.ts +22 -22
package/src/templates.ts CHANGED
@@ -1,196 +1,209 @@
1
- // Docker Compose templates as constants
2
-
3
- export const INFRA_COMPOSE_TEMPLATE = `
4
- services:
5
- # ============================================
6
- # Infrastructure Services
7
- # ============================================
8
- mongo:
9
- image: mongo:7.0
10
- container_name: mongo
11
- command: [ "--replSet", "rs0", "--bind_ip_all", "--port", "27017" ]
12
- ports:
13
- - 27017:27017
14
- healthcheck:
15
- test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo:27017'}]}) }" | mongosh --port 27017 --quiet
16
- interval: 5s
17
- timeout: 30s
18
- start_period: 0s
19
- start_interval: 1s
20
- retries: 30
21
- volumes:
22
- - "mongo_data:/data/db"
23
- - "mongo_config:/data/configdb"
24
-
25
- kafka:
26
- image: apache/kafka-native
27
- container_name: kafka
28
- ports:
29
- - "9092:9092"
30
- environment:
31
- # Configure listeners for both docker and host communication
32
- KAFKA_LISTENERS: CONTROLLER://localhost:9091,HOST://0.0.0.0:9092,DOCKER://0.0.0.0:9093
33
- KAFKA_ADVERTISED_LISTENERS: HOST://kafka:9092,DOCKER://kafka:9093
34
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,DOCKER:PLAINTEXT,HOST:PLAINTEXT
35
-
36
- # Settings required for KRaft mode
37
- KAFKA_NODE_ID: 1
38
- KAFKA_PROCESS_ROLES: broker,controller
39
- KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
40
- KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9091
41
-
42
- # Listener to use for broker-to-broker communication
43
- KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
44
-
45
- # Required for a single node cluster
46
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
47
-
48
- # Disable auto-topic creation - API server will create topics with correct partitions
49
- KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
50
- volumes:
51
- - "kafka_data:/var/lib/kafka/data"
52
-
53
- kafka-ui:
54
- image: kafbat/kafka-ui:main
55
- container_name: kafka-ui
56
- ports:
57
- - 8080:8080
58
- environment:
59
- DYNAMIC_CONFIG_ENABLED: "true"
60
- KAFKA_CLUSTERS_0_NAME: local
61
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9093
62
- depends_on:
63
- - kafka
64
-
65
- redis:
66
- image: redis:7-alpine
67
- container_name: redis
68
- ports:
69
- - "6379:6379"
70
- command: redis-server --appendonly yes
71
- volumes:
72
- - "redis_data:/data"
73
- healthcheck:
74
- test: [ "CMD", "redis-cli", "ping" ]
75
- interval: 5s
76
- timeout: 3s
77
- retries: 5
78
-
79
- # ============================================
80
- # Observability Services
81
- # ============================================
82
-
83
- loki:
84
- image: grafana/loki:2.9.0
85
- container_name: loki
86
- ports:
87
- - "3100:3100"
88
- command: -config.file=/etc/loki/local-config.yaml
89
- volumes:
90
- - "loki_data:/loki"
91
- healthcheck:
92
- test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ]
93
- interval: 10s
94
- timeout: 5s
95
- retries: 5
96
-
97
- grafana:
98
- image: grafana/grafana:10.2.0
99
- container_name: grafana
100
- ports:
101
- - "3001:3000"
102
- environment:
103
- - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
104
- - GF_AUTH_ANONYMOUS_ENABLED=true
105
- - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
106
- - GF_SECURITY_ADMIN_PASSWORD=admin
107
- volumes:
108
- - "grafana_data:/var/lib/grafana"
109
- depends_on:
110
- loki:
111
- condition: service_healthy
112
-
113
- volumes:
114
- mongo_data:
115
- mongo_config:
116
- kafka_data:
117
- redis_data:
118
- loki_data:
119
- grafana_data:
120
- `;
121
-
122
- export const APP_COMPOSE_TEMPLATE = `services:
123
- api:
124
- image: ghcr.io/simplenotificationsystem/simplens-core:latest
125
- container_name: api
126
- ports:
127
- - 3000:3000
128
- env_file:
129
- - .env
130
- volumes:
131
- - plugin-data:/app/.plugins
132
- - ./simplens.config.yaml:/app/simplens.config.yaml:ro
133
- command: [ "node", "dist/api/server.js" ]
134
- restart: unless-stopped
135
- healthcheck:
136
- test: [ "CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))" ]
137
- interval: 30s
138
- timeout: 10s
139
- retries: 3
140
- start_period: 10s
141
-
142
- worker:
143
- image: ghcr.io/simplenotificationsystem/simplens-core:latest
144
- env_file:
145
- - .env
146
- command: [ "node", "dist/workers/worker.js" ]
147
- restart: unless-stopped
148
-
149
- notification_processor:
150
- image: ghcr.io/simplenotificationsystem/simplens-core:latest
151
- env_file:
152
- - .env
153
- volumes:
154
- - plugin-data:/app/.plugins
155
- - ./simplens.config.yaml:/app/simplens.config.yaml:ro
156
- command: [ "node", "dist/processors/unified/unified.processor.js" ]
157
- depends_on:
158
- api:
159
- condition: service_healthy
160
- restart: unless-stopped
161
-
162
- delayed_processor:
163
- image: ghcr.io/simplenotificationsystem/simplens-core:latest
164
- env_file:
165
- - .env
166
- command: [ "node", "dist/processors/delayed/delayed.processor.js" ]
167
- restart: unless-stopped
168
-
169
- recovery:
170
- image: ghcr.io/simplenotificationsystem/simplens-core:latest
171
- env_file:
172
- - .env
173
- command: [ "node", "dist/workers/recovery/recovery.service.js" ]
174
- restart: unless-stopped
175
-
176
- dashboard:
177
- image: ghcr.io/simplenotificationsystem/simplens-dashboard:latest
178
- ports:
179
- - 3002:3002
180
- container_name: dashboard
181
- env_file:
182
- - .env
183
- environment:
184
- PORT: \${DASHBOARD_PORT:-3002}
185
- API_BASE_URL: http://api:\${PORT:-3000}
186
- WEBHOOK_HOST: dashboard
187
- WEBHOOK_PORT: \${DASHBOARD_PORT:-3002}
188
- restart: unless-stopped
189
-
190
- volumes:
191
- plugin-data:
192
-
193
- networks:
194
- default:
195
- name: simplens
196
- `;
1
+ // Docker Compose templates as constants
2
+
3
+ export const INFRA_COMPOSE_TEMPLATE = `
4
+ services:
5
+ # ============================================
6
+ # Infrastructure Services
7
+ # ============================================
8
+ mongo:
9
+ image: mongo:7.0
10
+ container_name: mongo
11
+ command: [ "--replSet", "rs0", "--bind_ip_all", "--port", "27017" ]
12
+ ports:
13
+ - 27017:27017
14
+ healthcheck:
15
+ test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo:27017'}]}) }" | mongosh --port 27017 --quiet
16
+ interval: 5s
17
+ timeout: 30s
18
+ start_period: 0s
19
+ start_interval: 1s
20
+ retries: 30
21
+ volumes:
22
+ - "mongo_data:/data/db"
23
+ - "mongo_config:/data/configdb"
24
+
25
+ kafka:
26
+ image: apache/kafka-native
27
+ container_name: kafka
28
+ ports:
29
+ - "9092:9092"
30
+ environment:
31
+ # Configure listeners for both docker and host communication
32
+ KAFKA_LISTENERS: CONTROLLER://localhost:9091,HOST://0.0.0.0:9092,DOCKER://0.0.0.0:9093
33
+ KAFKA_ADVERTISED_LISTENERS: HOST://kafka:9092,DOCKER://kafka:9093
34
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,DOCKER:PLAINTEXT,HOST:PLAINTEXT
35
+
36
+ # Settings required for KRaft mode
37
+ KAFKA_NODE_ID: 1
38
+ KAFKA_PROCESS_ROLES: broker,controller
39
+ KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
40
+ KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9091
41
+
42
+ # Listener to use for broker-to-broker communication
43
+ KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
44
+
45
+ # Required for a single node cluster
46
+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
47
+
48
+ # Disable auto-topic creation - API server will create topics with correct partitions
49
+ KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
50
+ volumes:
51
+ - "kafka_data:/var/lib/kafka/data"
52
+
53
+ kafka-ui:
54
+ image: kafbat/kafka-ui:main
55
+ container_name: kafka-ui
56
+ ports:
57
+ - 8080:8080
58
+ environment:
59
+ DYNAMIC_CONFIG_ENABLED: "true"
60
+ KAFKA_CLUSTERS_0_NAME: local
61
+ KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9093
62
+ depends_on:
63
+ - kafka
64
+
65
+ redis:
66
+ image: redis:7-alpine
67
+ container_name: redis
68
+ ports:
69
+ - "6379:6379"
70
+ command: redis-server --appendonly yes
71
+ volumes:
72
+ - "redis_data:/data"
73
+ healthcheck:
74
+ test: [ "CMD", "redis-cli", "ping" ]
75
+ interval: 5s
76
+ timeout: 3s
77
+ retries: 5
78
+
79
+ # ============================================
80
+ # Observability Services
81
+ # ============================================
82
+
83
+ loki:
84
+ image: grafana/loki:2.9.0
85
+ container_name: loki
86
+ ports:
87
+ - "3100:3100"
88
+ command: -config.file=/etc/loki/local-config.yaml
89
+ volumes:
90
+ - "loki_data:/loki"
91
+ healthcheck:
92
+ test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ]
93
+ interval: 10s
94
+ timeout: 5s
95
+ retries: 5
96
+
97
+ grafana:
98
+ image: grafana/grafana:10.2.0
99
+ container_name: grafana
100
+ ports:
101
+ - "3001:3000"
102
+ environment:
103
+ - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
104
+ - GF_AUTH_ANONYMOUS_ENABLED=true
105
+ - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
106
+ - GF_SECURITY_ADMIN_PASSWORD=admin
107
+ volumes:
108
+ - "grafana_data:/var/lib/grafana"
109
+ depends_on:
110
+ loki:
111
+ condition: service_healthy
112
+
113
+ volumes:
114
+ mongo_data:
115
+ mongo_config:
116
+ kafka_data:
117
+ redis_data:
118
+ loki_data:
119
+ grafana_data:
120
+ `;
121
+
122
+ export const APP_COMPOSE_TEMPLATE = `services:
123
+ api:
124
+ image: ghcr.io/simplenotificationsystem/simplens-core:\${CORE_VERSION:-latest}
125
+ container_name: api
126
+ ports:
127
+ - 3000:3000
128
+ env_file:
129
+ - .env
130
+ volumes:
131
+ - plugin-data:/app/.plugins
132
+ - ./simplens.config.yaml:/app/simplens.config.yaml:ro
133
+ command: [ "node", "dist/api/server.js" ]
134
+ restart: unless-stopped
135
+ healthcheck:
136
+ test: [ "CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))" ]
137
+ interval: 30s
138
+ timeout: 10s
139
+ retries: 3
140
+ start_period: 10s
141
+
142
+ worker:
143
+ image: ghcr.io/simplenotificationsystem/simplens-core:\${CORE_VERSION:-latest}
144
+ env_file:
145
+ - .env
146
+ command: [ "node", "dist/workers/worker.js" ]
147
+ restart: unless-stopped
148
+
149
+ notification_processor:
150
+ image: ghcr.io/simplenotificationsystem/simplens-core:\${CORE_VERSION:-latest}
151
+ env_file:
152
+ - .env
153
+ volumes:
154
+ - plugin-data:/app/.plugins
155
+ - ./simplens.config.yaml:/app/simplens.config.yaml:ro
156
+ command: [ "node", "dist/processors/unified/unified.processor.js" ]
157
+ depends_on:
158
+ api:
159
+ condition: service_healthy
160
+ restart: unless-stopped
161
+
162
+ delayed_processor:
163
+ image: ghcr.io/simplenotificationsystem/simplens-core:\${CORE_VERSION:-latest}
164
+ env_file:
165
+ - .env
166
+ command: [ "node", "dist/processors/delayed/delayed.processor.js" ]
167
+ restart: unless-stopped
168
+
169
+ recovery:
170
+ image: ghcr.io/simplenotificationsystem/simplens-core:\${CORE_VERSION:-latest}
171
+ env_file:
172
+ - .env
173
+ command: [ "node", "dist/workers/recovery/recovery.service.js" ]
174
+ restart: unless-stopped
175
+
176
+ dashboard:
177
+ image: ghcr.io/simplenotificationsystem/simplens-dashboard:\${DASHBOARD_VERSION:-latest}
178
+ ports:
179
+ - 3002:3002
180
+ container_name: dashboard
181
+ env_file:
182
+ - .env
183
+ environment:
184
+ PORT: \${DASHBOARD_PORT:-3002}
185
+ API_BASE_URL: http://api:\${PORT:-3000}
186
+ WEBHOOK_HOST: dashboard
187
+ WEBHOOK_PORT: \${DASHBOARD_PORT:-3002}
188
+ NEXT_PUBLIC_BASE_PATH: \${BASE_PATH:-}
189
+ restart: unless-stopped
190
+
191
+ volumes:
192
+ plugin-data:
193
+
194
+ networks:
195
+ default:
196
+ name: simplens
197
+ `;
198
+
199
+ export const APP_NGINX_SERVICE_TEMPLATE = ` nginx:
200
+ image: nginx:alpine
201
+ container_name: nginx
202
+ ports:
203
+ - "80:80"
204
+ volumes:
205
+ - "./nginx.conf:/etc/nginx/conf.d/default.conf:ro"
206
+ depends_on:
207
+ - api
208
+ - dashboard
209
+ restart: unless-stopped`;
@@ -1,127 +1,129 @@
1
- /**
2
- * Domain type definitions for the onboarding system
3
- */
4
-
5
- /**
6
- * Plugin information returned by config-gen
7
- */
8
- export interface PluginInfo {
9
- /** Package name (e.g., '@simplens/nodemailer-gmail') */
10
- package: string;
11
- /** Display name */
12
- name: string;
13
- /** Description of what the plugin does */
14
- description: string;
15
- }
16
-
17
- /**
18
- * Infrastructure service option
19
- */
20
- export interface InfraService {
21
- /** Display name (e.g., 'MongoDB (Database)') */
22
- name: string;
23
- /** Service identifier (e.g., 'mongo') */
24
- value: string;
25
- /** Whether checked by default */
26
- checked: boolean;
27
- }
28
-
29
- /**
30
- * Environment variable definition
31
- */
32
- export interface EnvVariable {
33
- /** Environment variable key */
34
- key: string;
35
- /** Current or default value */
36
- value: string;
37
- /** Optional description/comment */
38
- description?: string;
39
- /** Whether this variable is required */
40
- required: boolean;
41
- }
42
-
43
- /**
44
- * Setup options provided via CLI or prompts
45
- */
46
- export interface SetupOptions {
47
- /** Whether to setup infrastructure services */
48
- infra: boolean;
49
- /** Environment configuration mode */
50
- envMode: 'default' | 'interactive';
51
- /** Target directory for setup */
52
- targetDir: string;
53
- }
54
-
55
- /**
56
- * Service definition for docker-compose generation
57
- */
58
- export interface ServiceDefinition {
59
- /** Service identifier */
60
- id: string;
61
- /** Display name */
62
- name: string;
63
- /** Docker compose YAML block */
64
- dockerCompose: string;
65
- /** Required volumes */
66
- volumes: string[];
67
- /** Service dependencies */
68
- dependencies?: string[];
69
- /** Whether service has health check */
70
- healthCheck?: boolean;
71
- }
72
-
73
- /**
74
- * SimplensConfig YAML structure
75
- */
76
- export interface SimplensConfig {
77
- providers: ProviderConfig[];
78
- }
79
-
80
- /**
81
- * Provider configuration in simplens.config.yaml
82
- */
83
- export interface ProviderConfig {
84
- /** Package name */
85
- package: string;
86
- /** Provider ID */
87
- id: string;
88
- /** Required credentials as key-value pairs */
89
- credentials: Record<string, string>;
90
- /** Optional configuration */
91
- optionalConfig?: Record<string, string | number | boolean>;
92
- }
93
-
94
- /**
95
- * Docker compose file structure (simplified)
96
- */
97
- export interface DockerComposeFile {
98
- services: Record<string, DockerService>;
99
- volumes?: Record<string, DockerVolume>;
100
- networks?: Record<string, DockerNetwork>;
101
- }
102
-
103
- export interface DockerService {
104
- image: string;
105
- container_name?: string;
106
- ports?: string[];
107
- environment?: Record<string, string> | string[];
108
- volumes?: string[];
109
- command?: string | string[];
110
- depends_on?: string[] | Record<string, { condition: string }>;
111
- healthcheck?: {
112
- test: string | string[];
113
- interval?: string;
114
- timeout?: string;
115
- retries?: number;
116
- start_period?: string;
117
- };
118
- }
119
-
120
- export interface DockerVolume {
121
- driver?: string;
122
- driver_opts?: Record<string, string>;
123
- }
124
-
125
- export interface DockerNetwork {
126
- driver?: string;
127
- }
1
+ /**
2
+ * Domain type definitions for the onboarding system
3
+ */
4
+
5
+ /**
6
+ * Plugin information returned by config-gen
7
+ */
8
+ export interface PluginInfo {
9
+ /** Package name (e.g., '@simplens/nodemailer-gmail') */
10
+ package: string;
11
+ /** Display name */
12
+ name: string;
13
+ /** Description of what the plugin does */
14
+ description: string;
15
+ }
16
+
17
+ /**
18
+ * Infrastructure service option
19
+ */
20
+ export interface InfraService {
21
+ /** Display name (e.g., 'MongoDB (Database)') */
22
+ name: string;
23
+ /** Service identifier (e.g., 'mongo') */
24
+ value: string;
25
+ /** Whether checked by default */
26
+ checked: boolean;
27
+ }
28
+
29
+ /**
30
+ * Environment variable definition
31
+ */
32
+ export interface EnvVariable {
33
+ /** Environment variable key */
34
+ key: string;
35
+ /** Current or default value */
36
+ value: string;
37
+ /** Optional description/comment */
38
+ description?: string;
39
+ /** Whether this variable is required */
40
+ required: boolean;
41
+ }
42
+
43
+ /**
44
+ * Setup options provided via CLI or prompts
45
+ */
46
+ export interface SetupOptions {
47
+ /** Whether to setup infrastructure services */
48
+ infra: boolean;
49
+ /** Environment configuration mode */
50
+ envMode: 'default' | 'interactive';
51
+ /** Target directory for setup */
52
+ targetDir: string;
53
+ /** Dashboard base path (empty string means root) */
54
+ basePath: string;
55
+ }
56
+
57
+ /**
58
+ * Service definition for docker-compose generation
59
+ */
60
+ export interface ServiceDefinition {
61
+ /** Service identifier */
62
+ id: string;
63
+ /** Display name */
64
+ name: string;
65
+ /** Docker compose YAML block */
66
+ dockerCompose: string;
67
+ /** Required volumes */
68
+ volumes: string[];
69
+ /** Service dependencies */
70
+ dependencies?: string[];
71
+ /** Whether service has health check */
72
+ healthCheck?: boolean;
73
+ }
74
+
75
+ /**
76
+ * SimplensConfig YAML structure
77
+ */
78
+ export interface SimplensConfig {
79
+ providers: ProviderConfig[];
80
+ }
81
+
82
+ /**
83
+ * Provider configuration in simplens.config.yaml
84
+ */
85
+ export interface ProviderConfig {
86
+ /** Package name */
87
+ package: string;
88
+ /** Provider ID */
89
+ id: string;
90
+ /** Required credentials as key-value pairs */
91
+ credentials: Record<string, string>;
92
+ /** Optional configuration */
93
+ optionalConfig?: Record<string, string | number | boolean>;
94
+ }
95
+
96
+ /**
97
+ * Docker compose file structure (simplified)
98
+ */
99
+ export interface DockerComposeFile {
100
+ services: Record<string, DockerService>;
101
+ volumes?: Record<string, DockerVolume>;
102
+ networks?: Record<string, DockerNetwork>;
103
+ }
104
+
105
+ export interface DockerService {
106
+ image: string;
107
+ container_name?: string;
108
+ ports?: string[];
109
+ environment?: Record<string, string> | string[];
110
+ volumes?: string[];
111
+ command?: string | string[];
112
+ depends_on?: string[] | Record<string, { condition: string }>;
113
+ healthcheck?: {
114
+ test: string | string[];
115
+ interval?: string;
116
+ timeout?: string;
117
+ retries?: number;
118
+ start_period?: string;
119
+ };
120
+ }
121
+
122
+ export interface DockerVolume {
123
+ driver?: string;
124
+ driver_opts?: Record<string, string>;
125
+ }
126
+
127
+ export interface DockerNetwork {
128
+ driver?: string;
129
+ }