@geekmidas/cli 0.47.0 → 0.48.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/cli",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
@@ -51,8 +51,8 @@
51
51
  "@geekmidas/constructs": "~0.7.0",
52
52
  "@geekmidas/envkit": "~0.6.0",
53
53
  "@geekmidas/errors": "~0.1.0",
54
- "@geekmidas/schema": "~0.1.0",
55
- "@geekmidas/logger": "~0.4.0"
54
+ "@geekmidas/logger": "~0.4.0",
55
+ "@geekmidas/schema": "~0.1.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/lodash.kebabcase": "^4.1.9",
@@ -5,7 +5,7 @@
5
5
  * Authentication: Bearer token from hpanel.hostinger.com/profile/api
6
6
  */
7
7
 
8
- const HOSTINGER_API_BASE = 'https://api.hostinger.com';
8
+ const HOSTINGER_API_BASE = 'https://developers.hostinger.com';
9
9
 
10
10
  /**
11
11
  * DNS record types supported by Hostinger
@@ -30,8 +30,8 @@ export interface DnsRecord {
30
30
  type: DnsRecordType;
31
31
  /** TTL in seconds */
32
32
  ttl: number;
33
- /** Record values (e.g., ['1.2.3.4'] for A record) */
34
- records: string[];
33
+ /** Record values */
34
+ records: Array<{ content: string }>;
35
35
  }
36
36
 
37
37
  /**
@@ -148,7 +148,7 @@ export class HostingerApi {
148
148
  name: string;
149
149
  type: DnsRecordType;
150
150
  ttl: number;
151
- records: string[];
151
+ records: Array<{ content: string }>;
152
152
  }>;
153
153
  }
154
154
 
@@ -249,7 +249,7 @@ export class HostingerApi {
249
249
  name: subdomain,
250
250
  type: 'A',
251
251
  ttl,
252
- records: [ip],
252
+ records: [{ content: ip }],
253
253
  },
254
254
  ]);
255
255
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { lookup } from 'node:dns/promises';
8
8
  import { getHostingerToken, storeHostingerToken } from '../../auth/credentials';
9
- import type { DnsConfig, DnsProvider } from '../../workspace/types';
9
+ import type { DnsConfig } from '../../workspace/types';
10
10
  import { HostingerApi } from './hostinger-api';
11
11
 
12
12
  const logger = console;
@@ -164,7 +164,6 @@ export function printDnsRecordsSimple(
164
164
  */
165
165
  async function promptForToken(message: string): Promise<string> {
166
166
  const { stdin, stdout } = await import('node:process');
167
- const readline = await import('node:readline/promises');
168
167
 
169
168
  if (!stdin.isTTY) {
170
169
  throw new Error('Interactive input required for Hostinger token.');
@@ -294,7 +293,7 @@ async function createHostingerRecords(
294
293
  name: record.subdomain,
295
294
  type: 'A',
296
295
  ttl,
297
- records: [record.value],
296
+ records: [{ content: record.value }],
298
297
  },
299
298
  ]);
300
299
 
@@ -677,10 +677,10 @@ export class DokployApi {
677
677
  * This should be called after DNS records are created and propagated.
678
678
  * It triggers Let's Encrypt certificate generation for HTTPS domains.
679
679
  *
680
- * @param domainId - The domain ID to validate
680
+ * @param domain - The domain hostname to validate (e.g., 'api.example.com')
681
681
  */
682
- async validateDomain(domainId: string): Promise<void> {
683
- await this.post('domain.validateDomain', { domainId });
682
+ async validateDomain(domain: string): Promise<{ isValid: boolean; resolvedIp: string }> {
683
+ return this.post<{ isValid: boolean; resolvedIp: string }>('domain.validateDomain', { domain });
684
684
  }
685
685
 
686
686
  /**
@@ -1291,18 +1291,22 @@ export async function workspaceDeployCommand(
1291
1291
  );
1292
1292
 
1293
1293
  // Validate domains to trigger SSL certificate generation
1294
- if (dnsResult?.success && appDomainIds.size > 0) {
1294
+ if (dnsResult?.success && appHostnames.size > 0) {
1295
1295
  logger.log('\n🔒 Validating domains for SSL certificates...');
1296
- for (const [appName, domainId] of appDomainIds) {
1296
+ for (const [appName, hostname] of appHostnames) {
1297
1297
  try {
1298
- await api.validateDomain(domainId);
1299
- logger.log(` ✓ ${appName}: SSL validation triggered`);
1298
+ const result = await api.validateDomain(hostname);
1299
+ if (result.isValid) {
1300
+ logger.log(` ✓ ${appName}: ${hostname} → ${result.resolvedIp}`);
1301
+ } else {
1302
+ logger.log(` ⚠ ${appName}: ${hostname} not valid`);
1303
+ }
1300
1304
  } catch (validationError) {
1301
1305
  const message =
1302
1306
  validationError instanceof Error
1303
1307
  ? validationError.message
1304
1308
  : 'Unknown error';
1305
- logger.log(` ⚠ ${appName}: SSL validation failed - ${message}`);
1309
+ logger.log(` ⚠ ${appName}: validation failed - ${message}`);
1306
1310
  }
1307
1311
  }
1308
1312
  }
@@ -321,8 +321,8 @@ ENV NODE_ENV=production
321
321
  ENV PORT=${port}
322
322
 
323
323
  # Health check
324
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
325
- CMD wget -q --spider http://localhost:${port}${healthCheckPath} || exit 1
324
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
325
+ CMD wget -qO- http://localhost:${port}${healthCheckPath} > /dev/null 2>&1 || exit 1
326
326
 
327
327
  # Switch to non-root user
328
328
  USER hono
@@ -413,8 +413,8 @@ COPY --from=builder --chown=hono:nodejs /app/.gkm/server/dist/server.mjs ./
413
413
  ENV NODE_ENV=production
414
414
  ENV PORT=${port}
415
415
 
416
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
417
- CMD wget -q --spider http://localhost:${port}${healthCheckPath} || exit 1
416
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
417
+ CMD wget -qO- http://localhost:${port}${healthCheckPath} > /dev/null 2>&1 || exit 1
418
418
 
419
419
  USER hono
420
420
 
@@ -452,8 +452,8 @@ ENV NODE_ENV=production
452
452
  ENV PORT=${port}
453
453
 
454
454
  # Health check
455
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
456
- CMD wget -q --spider http://localhost:${port}${healthCheckPath} || exit 1
455
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
456
+ CMD wget -qO- http://localhost:${port}${healthCheckPath} > /dev/null 2>&1 || exit 1
457
457
 
458
458
  # Switch to non-root user
459
459
  USER hono
@@ -682,10 +682,6 @@ COPY --from=builder --chown=nextjs:nodejs /app/${appPath}/.next/standalone ./
682
682
  COPY --from=builder --chown=nextjs:nodejs /app/${appPath}/.next/static ./${appPath}/.next/static
683
683
  COPY --from=builder --chown=nextjs:nodejs /app/${appPath}/public ./${appPath}/public
684
684
 
685
- # Health check
686
- HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \\
687
- CMD wget -q --spider http://localhost:${port}/ || exit 1
688
-
689
685
  USER nextjs
690
686
 
691
687
  EXPOSE ${port}
@@ -790,8 +786,8 @@ COPY --from=builder --chown=hono:nodejs /app/${appPath}/.gkm/server/dist/server.
790
786
  ENV NODE_ENV=production
791
787
  ENV PORT=${port}
792
788
 
793
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
794
- CMD wget -q --spider http://localhost:${port}${healthCheckPath} || exit 1
789
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
790
+ CMD wget -qO- http://localhost:${port}${healthCheckPath} > /dev/null 2>&1 || exit 1
795
791
 
796
792
  USER hono
797
793
 
@@ -930,8 +926,8 @@ COPY --from=builder --chown=app:nodejs /app/${appPath}/dist/index.mjs ./
930
926
  ENV NODE_ENV=production
931
927
  ENV PORT=${port}
932
928
 
933
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
934
- CMD wget -q --spider http://localhost:${port}${healthCheckPath} || exit 1
929
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
930
+ CMD wget -qO- http://localhost:${port}${healthCheckPath} > /dev/null 2>&1 || exit 1
935
931
 
936
932
  USER app
937
933