ante-erp-cli 1.11.50 → 1.11.52

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/bin/ante-cli.js CHANGED
@@ -90,6 +90,7 @@ program
90
90
  .description('Update ANTE CLI tool to latest version')
91
91
  .option('--check', 'Check for updates without installing')
92
92
  .option('--force', 'Skip confirmation prompt')
93
+ .option('-y, --yes', 'Skip confirmation prompt (alias for --force)')
93
94
  .action(updateCli);
94
95
 
95
96
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ante-erp-cli",
3
- "version": "1.11.50",
3
+ "version": "1.11.52",
4
4
  "description": "Comprehensive CLI tool for managing ANTE ERP self-hosted installations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -318,6 +318,7 @@ export async function install(options) {
318
318
  const host = detectedIP || 'localhost';
319
319
  const frontendPort = parseInt(options.port) || 8080;
320
320
  const apiPort = 3001;
321
+ const backendClientPort = 4001;
321
322
  const gateAppPort = 8081;
322
323
  const guardianAppPort = 8082;
323
324
  const facialWebPort = 8083;
@@ -329,6 +330,7 @@ export async function install(options) {
329
330
  preset: 'enterprise', // Always install all features
330
331
  frontendDomain: buildURL(host, frontendPort),
331
332
  apiDomain: buildURL(host, apiPort),
333
+ clientApiDomain: buildURL(host, backendClientPort),
332
334
  gateAppDomain: buildURL(host, gateAppPort),
333
335
  guardianAppDomain: buildURL(host, guardianAppPort),
334
336
  facialAppDomain: buildURL(host, facialWebPort),
@@ -336,6 +338,7 @@ export async function install(options) {
336
338
  clientAppDomain: buildURL(host, clientAppPort),
337
339
  frontendPort,
338
340
  apiPort,
341
+ backendClientPort,
339
342
  gateAppPort,
340
343
  guardianAppPort,
341
344
  facialWebPort,
@@ -362,6 +365,7 @@ export async function install(options) {
362
365
  console.log(chalk.cyan(' POS App:'), chalk.white(config.posAppDomain));
363
366
  console.log(chalk.cyan(' Client App:'), chalk.white(config.clientAppDomain));
364
367
  console.log(chalk.cyan(' API:'), chalk.white(config.apiDomain));
368
+ console.log(chalk.cyan(' Client API:'), chalk.white(config.clientApiDomain));
365
369
  console.log();
366
370
 
367
371
  // Auto-backup existing config if exists (no prompt)
@@ -437,6 +441,7 @@ export async function install(options) {
437
441
  const dockerCompose = generateDockerCompose({
438
442
  frontendPort: config.frontendPort,
439
443
  backendPort: config.apiPort,
444
+ backendClientPort: config.backendClientPort,
440
445
  gateAppPort: config.gateAppPort,
441
446
  guardianAppPort: config.guardianAppPort,
442
447
  facialWebPort: config.facialWebPort,
@@ -457,6 +462,7 @@ export async function install(options) {
457
462
  socketUrl: config.apiDomain,
458
463
  frontendPort: config.frontendPort,
459
464
  backendPort: config.apiPort,
465
+ backendClientPort: config.backendClientPort,
460
466
  gateAppPort: config.gateAppPort,
461
467
  guardianAppPort: config.guardianAppPort,
462
468
  facialWebPort: config.facialWebPort,
@@ -467,6 +473,7 @@ export async function install(options) {
467
473
  facialWebUrl: config.facialAppDomain,
468
474
  posAppUrl: config.posAppDomain,
469
475
  clientAppUrl: config.clientAppDomain,
476
+ clientApiUrl: config.clientApiDomain,
470
477
  companyId: config.companyId,
471
478
  installGate: config.installGate,
472
479
  installGuardian: config.installGuardian,
@@ -74,8 +74,11 @@ export async function updateCli(options) {
74
74
  return;
75
75
  }
76
76
 
77
- // Confirmation prompt
78
- if (!options.force) {
77
+ // Confirmation prompt (skip if --force/--yes flag or non-interactive mode)
78
+ const isInteractive = process.stdin.isTTY && process.stdout.isTTY;
79
+ const skipPrompt = options.force || options.yes || !isInteractive;
80
+
81
+ if (!skipPrompt) {
79
82
  const { confirm } = await inquirer.prompt([
80
83
  {
81
84
  type: 'confirm',
@@ -89,6 +92,8 @@ export async function updateCli(options) {
89
92
  console.log(chalk.gray('\nUpdate cancelled.\n'));
90
93
  return;
91
94
  }
95
+ } else if (!isInteractive) {
96
+ console.log(chalk.gray('Non-interactive mode detected, proceeding with update...'));
92
97
  }
93
98
 
94
99
  // Perform update
@@ -24,10 +24,11 @@ function detectInstalledApps(composeFile) {
24
24
  hasGuardianApp: composeContent.includes('guardian-app:') || composeContent.includes('container_name: ante-guardian-app'),
25
25
  hasFacialWeb: composeContent.includes('facial-web:') || composeContent.includes('container_name: ante-facial-web'),
26
26
  hasPosApp: composeContent.includes('pos-app:') || composeContent.includes('container_name: ante-pos'),
27
- hasClientApp: composeContent.includes('client-app:') || composeContent.includes('container_name: ante-client')
27
+ hasClientApp: composeContent.includes('client-app:') || composeContent.includes('container_name: ante-client'),
28
+ hasBackendClient: composeContent.includes('backend-client:') || composeContent.includes('container_name: ante-backend-client')
28
29
  };
29
30
  } catch {
30
- return { hasGateApp: false, hasGuardianApp: false, hasFacialWeb: false, hasPosApp: false, hasClientApp: false };
31
+ return { hasGateApp: false, hasGuardianApp: false, hasFacialWeb: false, hasPosApp: false, hasClientApp: false, hasBackendClient: false };
31
32
  }
32
33
  }
33
34
 
@@ -80,6 +81,7 @@ function updateDockerCompose(composeFile, envFile, newServices) {
80
81
  const newCompose = generateDockerCompose({
81
82
  frontendPort: parseInt(envConfig.FRONTEND_PORT) || 8080,
82
83
  backendPort: parseInt(envConfig.BACKEND_PORT) || 3001,
84
+ backendClientPort: parseInt(envConfig.BACKEND_CLIENT_PORT) || 4001,
83
85
  gateAppPort: parseInt(envConfig.GATE_APP_PORT) || 8081,
84
86
  guardianAppPort: parseInt(envConfig.GUARDIAN_APP_PORT) || 8082,
85
87
  facialWebPort: parseInt(envConfig.FACIAL_WEB_PORT) || 8083,
@@ -228,6 +230,20 @@ COMPANY_ID=1
228
230
  } else {
229
231
  envContent += `CLIENT_APP_URL=http://localhost:9005\n`;
230
232
  }
233
+
234
+ // Add backend-client port (always installed with client-app)
235
+ if (envContent.includes('# BACKEND_CLIENT_PORT=')) {
236
+ envContent = envContent.replace(/# BACKEND_CLIENT_PORT=\d+/, 'BACKEND_CLIENT_PORT=4001');
237
+ } else if (!envContent.includes('BACKEND_CLIENT_PORT=')) {
238
+ envContent += `BACKEND_CLIENT_PORT=4001\n`;
239
+ }
240
+
241
+ // Add client API URL
242
+ if (envContent.includes('# CLIENT_API_URL=')) {
243
+ envContent = envContent.replace(/# CLIENT_API_URL=.*/, 'CLIENT_API_URL=http://localhost:4001');
244
+ } else if (!envContent.includes('CLIENT_API_URL=')) {
245
+ envContent += `CLIENT_API_URL=http://localhost:4001\n`;
246
+ }
231
247
  }
232
248
 
233
249
  // Add COMPANY_ID if missing and any new service is being added
@@ -330,6 +346,7 @@ function refreshDockerCompose(composeFile, envFile) {
330
346
  const newCompose = generateDockerCompose({
331
347
  frontendPort: parseInt(envConfig.FRONTEND_PORT) || 8080,
332
348
  backendPort: parseInt(envConfig.BACKEND_PORT) || 3001,
349
+ backendClientPort: parseInt(envConfig.BACKEND_CLIENT_PORT) || 4001,
333
350
  gateAppPort: parseInt(envConfig.GATE_APP_PORT) || 8081,
334
351
  guardianAppPort: parseInt(envConfig.GUARDIAN_APP_PORT) || 8082,
335
352
  facialWebPort: parseInt(envConfig.FACIAL_WEB_PORT) || 8083,
@@ -7,6 +7,7 @@ export function generateDockerCompose(options = {}) {
7
7
  const {
8
8
  frontendPort = 8080,
9
9
  backendPort = 3001,
10
+ backendClientPort = 4001,
10
11
  gateAppPort = 8081,
11
12
  guardianAppPort = 8082,
12
13
  facialWebPort = 8083,
@@ -315,16 +316,54 @@ ${installGate ? `
315
316
  max-size: "10m"
316
317
  max-file: "3"
317
318
  ` : ''}${installClient ? `
318
- # ANTE Client App
319
+ # ANTE Backend Client (Client Portal API)
320
+ backend-client:
321
+ image: ghcr.io/gtplusnet/ante-self-hosted-backend-client:latest
322
+ container_name: ante-backend-client
323
+ restart: unless-stopped
324
+ depends_on:
325
+ backend:
326
+ condition: service_healthy
327
+ environment:
328
+ NODE_ENV: production
329
+ CLIENT_BACKEND_PORT: 4001
330
+ DATABASE_URL: postgresql://ante:\${DB_PASSWORD}@postgres:5432/ante_db?schema=public&connection_limit=10
331
+ DIRECT_URL: postgresql://ante:\${DB_PASSWORD}@postgres:5432/ante_db?schema=public
332
+ REDIS_HOST: redis
333
+ REDIS_PORT: 6379
334
+ REDIS_PASSWORD: \${REDIS_PASSWORD}
335
+ REDIS_DB: 0
336
+ REDIS_TLS: "false"
337
+ CUSTOMER_APP_JWT_SECRET: \${CUSTOMER_APP_JWT_SECRET}
338
+ ENCRYPTION_KEY: \${ENCRYPTION_KEY}
339
+ TZ: \${TZ:-Asia/Manila}
340
+ ports:
341
+ - "${backendClientPort}:4001"
342
+ networks:
343
+ - ante-network
344
+ healthcheck:
345
+ test: ["CMD", "curl", "-f", "http://localhost:4001/health"]
346
+ interval: 30s
347
+ timeout: 10s
348
+ retries: 3
349
+ start_period: 30s
350
+ logging:
351
+ driver: "json-file"
352
+ options:
353
+ max-size: "10m"
354
+ max-file: "3"
355
+
356
+ # ANTE Client App (Frontend)
319
357
  client-app:
320
358
  image: ghcr.io/gtplusnet/ante-self-hosted-ante-client:latest
321
359
  container_name: ante-client
322
360
  restart: unless-stopped
323
361
  depends_on:
324
- backend:
362
+ backend-client:
325
363
  condition: service_healthy
326
364
  environment:
327
- - VITE_API_URL=\${API_URL:-http://localhost:${backendPort}}
365
+ - API_URL=\${CLIENT_API_URL:-http://localhost:${backendClientPort}}
366
+ - VITE_API_URL=\${CLIENT_API_URL:-http://localhost:${backendClientPort}}
328
367
  - VITE_APP_NAME=ANTE Client Portal
329
368
  - VITE_APP_VERSION=\${VERSION:-1.0.0}
330
369
  ports:
@@ -11,6 +11,7 @@ export function generateEnv(credentials, options = {}) {
11
11
  socketUrl = 'http://localhost:3001', // WebSocket uses same port as backend
12
12
  frontendPort = 8080,
13
13
  backendPort = 3001,
14
+ backendClientPort = 4001,
14
15
  gateAppPort = 8081,
15
16
  guardianAppPort = 8082,
16
17
  facialWebPort = 8083,
@@ -21,6 +22,7 @@ export function generateEnv(credentials, options = {}) {
21
22
  facialWebUrl = 'http://localhost:8083',
22
23
  posAppUrl = 'http://localhost:8084',
23
24
  clientAppUrl = 'http://localhost:9005',
25
+ clientApiUrl = 'http://localhost:4001',
24
26
  companyId = 1,
25
27
  installGate = false,
26
28
  installGuardian = false,
@@ -72,6 +74,7 @@ SOCKET_URL=${socketUrl}
72
74
  # ------------------------------------------------------------------------------
73
75
  FRONTEND_PORT=${frontendPort}
74
76
  BACKEND_PORT=${backendPort}
77
+ ${installClient ? `BACKEND_CLIENT_PORT=${backendClientPort}` : '# BACKEND_CLIENT_PORT=4001'}
75
78
  ${installGate ? `GATE_APP_PORT=${gateAppPort}` : '# GATE_APP_PORT=8081'}
76
79
  ${installGuardian ? `GUARDIAN_APP_PORT=${guardianAppPort}` : '# GUARDIAN_APP_PORT=8082'}
77
80
  ${installFacial ? `FACIAL_WEB_PORT=${facialWebPort}` : '# FACIAL_WEB_PORT=8083'}
@@ -88,6 +91,7 @@ ${installGuardian ? `GUARDIAN_APP_URL=${guardianAppUrl}` : '# GUARDIAN_APP_URL=h
88
91
  ${installFacial ? `FACIAL_WEB_URL=${facialWebUrl}` : '# FACIAL_WEB_URL=http://localhost:8083'}
89
92
  ${installPos ? `POS_APP_URL=${posAppUrl}` : '# POS_APP_URL=http://localhost:8084'}
90
93
  ${installClient ? `CLIENT_APP_URL=${clientAppUrl}` : '# CLIENT_APP_URL=http://localhost:9005'}
94
+ ${installClient ? `CLIENT_API_URL=${clientApiUrl}` : '# CLIENT_API_URL=http://localhost:4001'}
91
95
 
92
96
  ` : ''}# ------------------------------------------------------------------------------
93
97
  # EMAIL CONFIGURATION