ante-erp-cli 1.11.37 → 1.11.38

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
@@ -324,6 +324,11 @@ program
324
324
  .description('Configure frontend and API domains')
325
325
  .option('--frontend <url>', 'Frontend domain/URL')
326
326
  .option('--api <url>', 'API domain/URL')
327
+ .option('--gate <url>', 'Gate App domain/URL (non-interactive mode)')
328
+ .option('--guardian <url>', 'Guardian App domain/URL (non-interactive mode)')
329
+ .option('--facial <url>', 'Facial Web domain/URL (non-interactive mode)')
330
+ .option('--pos <url>', 'POS App domain/URL (non-interactive mode)')
331
+ .option('--client <url>', 'Client App domain/URL (non-interactive mode)')
327
332
  .option('--detect', 'Auto-detect public IP address')
328
333
  .option('--ssl, --enable-ssl', 'Enable SSL certificate (Let\'s Encrypt)')
329
334
  .option('--email <email>', 'Email for SSL certificate notifications')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ante-erp-cli",
3
- "version": "1.11.37",
3
+ "version": "1.11.38",
4
4
  "description": "Comprehensive CLI tool for managing ANTE ERP self-hosted installations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -611,6 +611,73 @@ export async function setDomain(options) {
611
611
  console.log(chalk.red(`Error: Invalid API URL - ${apiValidation}`));
612
612
  process.exit(1);
613
613
  }
614
+
615
+ // Handle app URLs: use CLI options if provided, otherwise read from existing .env
616
+ if (hasGateApp) {
617
+ gateAppUrl = options.gate ? sanitizeUrl(options.gate) : getEnvValue(envPath, 'GATE_APP_URL');
618
+ if (gateAppUrl) {
619
+ const validation = validateUrl(gateAppUrl);
620
+ if (validation !== true) {
621
+ console.log(chalk.red(`Error: Invalid Gate App URL - ${validation}`));
622
+ process.exit(1);
623
+ }
624
+ }
625
+ }
626
+
627
+ if (hasGuardianApp) {
628
+ guardianAppUrl = options.guardian ? sanitizeUrl(options.guardian) : getEnvValue(envPath, 'GUARDIAN_APP_URL');
629
+ if (guardianAppUrl) {
630
+ const validation = validateUrl(guardianAppUrl);
631
+ if (validation !== true) {
632
+ console.log(chalk.red(`Error: Invalid Guardian App URL - ${validation}`));
633
+ process.exit(1);
634
+ }
635
+ }
636
+ }
637
+
638
+ if (hasFacialWeb) {
639
+ facialWebUrl = options.facial ? sanitizeUrl(options.facial) : getEnvValue(envPath, 'FACIAL_WEB_URL');
640
+ if (facialWebUrl) {
641
+ const validation = validateUrl(facialWebUrl);
642
+ if (validation !== true) {
643
+ console.log(chalk.red(`Error: Invalid Facial Web URL - ${validation}`));
644
+ process.exit(1);
645
+ }
646
+ }
647
+ }
648
+
649
+ if (hasPosApp) {
650
+ posAppUrl = options.pos ? sanitizeUrl(options.pos) : getEnvValue(envPath, 'POS_APP_URL');
651
+ if (posAppUrl) {
652
+ const validation = validateUrl(posAppUrl);
653
+ if (validation !== true) {
654
+ console.log(chalk.red(`Error: Invalid POS App URL - ${validation}`));
655
+ process.exit(1);
656
+ }
657
+ }
658
+ }
659
+
660
+ if (hasClientApp) {
661
+ clientAppUrl = options.client ? sanitizeUrl(options.client) : getEnvValue(envPath, 'CLIENT_APP_URL');
662
+ if (clientAppUrl) {
663
+ const validation = validateUrl(clientAppUrl);
664
+ if (validation !== true) {
665
+ console.log(chalk.red(`Error: Invalid Client App URL - ${validation}`));
666
+ process.exit(1);
667
+ }
668
+ }
669
+ }
670
+
671
+ // Show what will be configured in non-interactive mode
672
+ console.log(chalk.cyan('\nšŸ“‹ Non-interactive mode configuration:\n'));
673
+ console.log(chalk.gray(` Frontend: ${frontendUrl}`));
674
+ console.log(chalk.gray(` API: ${apiUrl}`));
675
+ if (hasGateApp && gateAppUrl) console.log(chalk.gray(` Gate App: ${gateAppUrl}`));
676
+ if (hasGuardianApp && guardianAppUrl) console.log(chalk.gray(` Guardian App: ${guardianAppUrl}`));
677
+ if (hasFacialWeb && facialWebUrl) console.log(chalk.gray(` Facial Web: ${facialWebUrl}`));
678
+ if (hasPosApp && posAppUrl) console.log(chalk.gray(` POS App: ${posAppUrl}`));
679
+ if (hasClientApp && clientAppUrl) console.log(chalk.gray(` Client App: ${clientAppUrl}`));
680
+ console.log('');
614
681
  }
615
682
 
616
683
  // Update .env file