@mailmodo/cli 0.0.56-beta.pr58.103 → 0.0.56-beta.pr58.105

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.
@@ -1,4 +1,9 @@
1
1
  import chalk from 'chalk';
2
+ const TIME_W = 18;
3
+ const EMAIL_W = 24;
4
+ const SEQ_W = 12;
5
+ const STATUS_W = 14;
6
+ const CONTACT_COL = TIME_W + EMAIL_W + SEQ_W + STATUS_W;
2
7
  function statusColor(status) {
3
8
  switch (status) {
4
9
  case 'bounced':
@@ -19,25 +24,31 @@ function statusColor(status) {
19
24
  }
20
25
  }
21
26
  }
27
+ function truncate(s, width) {
28
+ return s.length > width ? s.slice(0, width - 1) + '…' : s;
29
+ }
30
+ function shortSeq(id) {
31
+ return id.length > 8 ? id.slice(0, 8) + '…' : id;
32
+ }
22
33
  export function renderEntries(ctx, data) {
23
34
  const { entries, limit, page, total } = data;
24
- ctx.log(`\n ${'Time'.padEnd(22)}${'Email'.padEnd(24)}${'Sequence'.padEnd(20)}${'Status'.padEnd(12)}Contact`);
25
- ctx.log(` ${''.repeat(90)}`);
35
+ ctx.log(`\n ${'Time'.padEnd(TIME_W)}${'Email'.padEnd(EMAIL_W)}` +
36
+ `${'Sequence'.padEnd(SEQ_W)}${'Status'.padEnd(STATUS_W)}Contact`);
37
+ ctx.log(` ${'─'.repeat(CONTACT_COL + 28)}`);
26
38
  if (!entries?.length) {
27
39
  ctx.log(` ${chalk.dim('No entries found.')}`);
28
40
  ctx.log('');
29
41
  return;
30
42
  }
31
43
  for (const entry of entries) {
32
- const time = (entry.timestamp || '').padEnd(22);
33
- const emailId = (entry.emailId || '').padEnd(24);
34
- const seqId = (entry.sequenceId || '').padEnd(20);
35
- const colorFn = statusColor(entry.status);
36
- const status = colorFn((entry.status || '').padEnd(12));
37
- ctx.log(` ${time}${emailId}${seqId}${status}${entry.contact || ''}`);
44
+ const time = (entry.timestamp || '').padEnd(TIME_W);
45
+ const email = truncate(entry.emailId || '', EMAIL_W - 2).padEnd(EMAIL_W);
46
+ const seq = chalk.dim(shortSeq(entry.sequenceId || '').padEnd(SEQ_W));
47
+ const status = statusColor(entry.status)((entry.status || '').padEnd(STATUS_W));
48
+ ctx.log(` ${time}${email}${seq}${status}${entry.contact || ''}`);
38
49
  if (entry.reason) {
39
50
  const label = entry.status === 'skipped' ? 'condition not met' : 'reason';
40
- ctx.log(` ${' '.repeat(78)}${chalk.dim(`(${label}: ${entry.reason})`)}`);
51
+ ctx.log(` ${' '.repeat(CONTACT_COL)}${chalk.dim(`└ ${label}: ${entry.reason}`)}`);
41
52
  }
42
53
  }
43
54
  const totalPages = Math.ceil(total / limit);
@@ -465,44 +465,6 @@
465
465
  "index.js"
466
466
  ]
467
467
  },
468
- "logout": {
469
- "aliases": [],
470
- "args": {},
471
- "description": "Sign out by removing saved credentials from this machine",
472
- "examples": [
473
- "<%= config.bin %> logout"
474
- ],
475
- "flags": {
476
- "json": {
477
- "description": "Output as JSON",
478
- "name": "json",
479
- "allowNo": false,
480
- "type": "boolean"
481
- },
482
- "yes": {
483
- "char": "y",
484
- "description": "Skip confirmation prompts",
485
- "name": "yes",
486
- "allowNo": false,
487
- "type": "boolean"
488
- }
489
- },
490
- "hasDynamicHelp": false,
491
- "hiddenAliases": [],
492
- "id": "logout",
493
- "pluginAlias": "@mailmodo/cli",
494
- "pluginName": "@mailmodo/cli",
495
- "pluginType": "core",
496
- "strict": true,
497
- "enableJsonFlag": false,
498
- "isESM": true,
499
- "relativePath": [
500
- "dist",
501
- "commands",
502
- "logout",
503
- "index.js"
504
- ]
505
- },
506
468
  "logs": {
507
469
  "aliases": [],
508
470
  "args": {},
@@ -573,6 +535,44 @@
573
535
  "index.js"
574
536
  ]
575
537
  },
538
+ "logout": {
539
+ "aliases": [],
540
+ "args": {},
541
+ "description": "Sign out by removing saved credentials from this machine",
542
+ "examples": [
543
+ "<%= config.bin %> logout"
544
+ ],
545
+ "flags": {
546
+ "json": {
547
+ "description": "Output as JSON",
548
+ "name": "json",
549
+ "allowNo": false,
550
+ "type": "boolean"
551
+ },
552
+ "yes": {
553
+ "char": "y",
554
+ "description": "Skip confirmation prompts",
555
+ "name": "yes",
556
+ "allowNo": false,
557
+ "type": "boolean"
558
+ }
559
+ },
560
+ "hasDynamicHelp": false,
561
+ "hiddenAliases": [],
562
+ "id": "logout",
563
+ "pluginAlias": "@mailmodo/cli",
564
+ "pluginName": "@mailmodo/cli",
565
+ "pluginType": "core",
566
+ "strict": true,
567
+ "enableJsonFlag": false,
568
+ "isESM": true,
569
+ "relativePath": [
570
+ "dist",
571
+ "commands",
572
+ "logout",
573
+ "index.js"
574
+ ]
575
+ },
576
576
  "preview": {
577
577
  "aliases": [],
578
578
  "args": {
@@ -932,5 +932,5 @@
932
932
  ]
933
933
  }
934
934
  },
935
- "version": "0.0.56-beta.pr58.103"
935
+ "version": "0.0.56-beta.pr58.105"
936
936
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mailmodo/cli",
3
3
  "description": "Email lifecycle automation for the AI-native builder generation.",
4
- "version": "0.0.56-beta.pr58.103",
4
+ "version": "0.0.56-beta.pr58.105",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"