@mailmodo/cli 0.0.51-beta.pr53.84 → 0.0.51-beta.pr54.83

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.
@@ -2,7 +2,7 @@ import { Flags } from '@oclif/core';
2
2
  import { confirm, input } from '@inquirer/prompts';
3
3
  import chalk from 'chalk';
4
4
  import { BaseCommand } from '../../lib/base-command.js';
5
- import { API_ENDPOINTS, DEFAULT_BRAND_COLOR, SDK_IMPORT_SNIPPET, SDK_INSTALL_COMMAND, } from '../../lib/constants.js';
5
+ import { API_ENDPOINTS, DEFAULT_BRAND_COLOR } from '../../lib/constants.js';
6
6
  import { ERRORS, INFO, pauseAlready, pauseSuccess, PROMPTS, resumeAlready, resumeSuccess, SEPARATOR, } from '../../lib/messages.js';
7
7
  import { loadTemplate, } from '../../lib/yaml-config.js';
8
8
  export default class Deploy extends BaseCommand {
@@ -286,8 +286,8 @@ export default class Deploy extends BaseCommand {
286
286
  this.log(` ${SEPARATOR}`);
287
287
  this.log(` ${chalk.bold('ADD THIS TO YOUR APP (one-time only):')}`);
288
288
  this.log(` ${SEPARATOR}\n`);
289
- this.log(` ${chalk.cyan(sdkSnippet.install ?? SDK_INSTALL_COMMAND)}\n`);
290
- this.log(` ${chalk.dim(SDK_IMPORT_SNIPPET)}\n`);
289
+ this.log(` ${chalk.cyan(sdkSnippet.install ?? 'npm install @mailmodo/sdk')}\n`);
290
+ this.log(` ${chalk.dim("import { track, identify } from '@mailmodo/sdk'")}\n`);
291
291
  if (sdkSnippet.examples) {
292
292
  this.log(` ${chalk.dim('// Example usage:')}`);
293
293
  this.log(` ${chalk.dim(sdkSnippet.examples.track)}`);
@@ -26,7 +26,6 @@ export declare const API_ENDPOINTS: Readonly<{
26
26
  PREVIEW: "/preview";
27
27
  SEQUENCES: "/sequences";
28
28
  SEQUENCES_DEPLOY: "/sequences/deploy";
29
- SEQUENCES_SDK: "/sequences/sdk";
30
29
  SEQUENCES_VALIDATE: "/sequences/validate";
31
30
  }>;
32
31
  export declare const LOGIN_URL = "https://app-vertex-debug.azurewebsites.net/signup.html";
@@ -34,6 +33,3 @@ export declare const PREVIEW_PORT = 3421;
34
33
  export declare const DEFAULT_BRAND_COLOR = "#1A56DB";
35
34
  export declare const TEMPLATES_DIR = "mailmodo";
36
35
  export declare const YAML_FILE = "mailmodo.yaml";
37
- export declare const SDK_PACKAGE_NAME = "@mailmodo/sdk";
38
- export declare const SDK_INSTALL_COMMAND = "npm install @mailmodo/sdk";
39
- export declare const SDK_IMPORT_SNIPPET = "import { track, identify } from '@mailmodo/sdk'";
@@ -32,7 +32,6 @@ export const API_ENDPOINTS = Object.freeze({
32
32
  PREVIEW: '/preview',
33
33
  SEQUENCES: '/sequences',
34
34
  SEQUENCES_DEPLOY: '/sequences/deploy',
35
- SEQUENCES_SDK: '/sequences/sdk',
36
35
  SEQUENCES_VALIDATE: '/sequences/validate',
37
36
  });
38
37
  const DEV_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup.html';
@@ -45,6 +44,3 @@ export const PREVIEW_PORT = 3421;
45
44
  export const DEFAULT_BRAND_COLOR = '#1A56DB';
46
45
  export const TEMPLATES_DIR = 'mailmodo';
47
46
  export const YAML_FILE = 'mailmodo.yaml';
48
- export const SDK_PACKAGE_NAME = '@mailmodo/sdk';
49
- export const SDK_INSTALL_COMMAND = `npm install ${SDK_PACKAGE_NAME}`;
50
- export const SDK_IMPORT_SNIPPET = `import { track, identify } from '${SDK_PACKAGE_NAME}'`;
@@ -426,13 +426,12 @@
426
426
  "index.js"
427
427
  ]
428
428
  },
429
- "login": {
429
+ "logout": {
430
430
  "aliases": [],
431
431
  "args": {},
432
- "description": "Authenticate with Mailmodo using your API key",
432
+ "description": "Sign out by removing saved credentials from this machine",
433
433
  "examples": [
434
- "<%= config.bin %> login",
435
- "MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
434
+ "<%= config.bin %> logout"
436
435
  ],
437
436
  "flags": {
438
437
  "json": {
@@ -451,7 +450,7 @@
451
450
  },
452
451
  "hasDynamicHelp": false,
453
452
  "hiddenAliases": [],
454
- "id": "login",
453
+ "id": "logout",
455
454
  "pluginAlias": "@mailmodo/cli",
456
455
  "pluginName": "@mailmodo/cli",
457
456
  "pluginType": "core",
@@ -461,16 +460,19 @@
461
460
  "relativePath": [
462
461
  "dist",
463
462
  "commands",
464
- "login",
463
+ "logout",
465
464
  "index.js"
466
465
  ]
467
466
  },
468
- "logout": {
467
+ "logs": {
469
468
  "aliases": [],
470
469
  "args": {},
471
- "description": "Sign out by removing saved credentials from this machine",
470
+ "description": "View email send logs and delivery events",
472
471
  "examples": [
473
- "<%= config.bin %> logout"
472
+ "<%= config.bin %> logs",
473
+ "<%= config.bin %> logs --email sarah@example.com",
474
+ "<%= config.bin %> logs --failed",
475
+ "<%= config.bin %> logs --json"
474
476
  ],
475
477
  "flags": {
476
478
  "json": {
@@ -485,11 +487,40 @@
485
487
  "name": "yes",
486
488
  "allowNo": false,
487
489
  "type": "boolean"
490
+ },
491
+ "email": {
492
+ "description": "Filter logs by contact email",
493
+ "name": "email",
494
+ "hasDynamicHelp": false,
495
+ "multiple": false,
496
+ "type": "option"
497
+ },
498
+ "failed": {
499
+ "description": "Show only failed/bounced events",
500
+ "name": "failed",
501
+ "allowNo": false,
502
+ "type": "boolean"
503
+ },
504
+ "limit": {
505
+ "description": "Entries per page (max 200)",
506
+ "name": "limit",
507
+ "default": 50,
508
+ "hasDynamicHelp": false,
509
+ "multiple": false,
510
+ "type": "option"
511
+ },
512
+ "page": {
513
+ "description": "Page number",
514
+ "name": "page",
515
+ "default": 1,
516
+ "hasDynamicHelp": false,
517
+ "multiple": false,
518
+ "type": "option"
488
519
  }
489
520
  },
490
521
  "hasDynamicHelp": false,
491
522
  "hiddenAliases": [],
492
- "id": "logout",
523
+ "id": "logs",
493
524
  "pluginAlias": "@mailmodo/cli",
494
525
  "pluginName": "@mailmodo/cli",
495
526
  "pluginType": "core",
@@ -499,23 +530,17 @@
499
530
  "relativePath": [
500
531
  "dist",
501
532
  "commands",
502
- "logout",
533
+ "logs",
503
534
  "index.js"
504
535
  ]
505
536
  },
506
- "preview": {
537
+ "login": {
507
538
  "aliases": [],
508
- "args": {
509
- "id": {
510
- "description": "Email template ID to preview",
511
- "name": "id"
512
- }
513
- },
514
- "description": "Preview an email in browser, as text, or send a test",
539
+ "args": {},
540
+ "description": "Authenticate with Mailmodo using your API key",
515
541
  "examples": [
516
- "<%= config.bin %> preview welcome",
517
- "<%= config.bin %> preview welcome --text",
518
- "<%= config.bin %> preview welcome --send me@example.com"
542
+ "<%= config.bin %> login",
543
+ "MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
519
544
  ],
520
545
  "flags": {
521
546
  "json": {
@@ -530,24 +555,11 @@
530
555
  "name": "yes",
531
556
  "allowNo": false,
532
557
  "type": "boolean"
533
- },
534
- "send": {
535
- "description": "Send test email to this address",
536
- "name": "send",
537
- "hasDynamicHelp": false,
538
- "multiple": false,
539
- "type": "option"
540
- },
541
- "text": {
542
- "description": "Output plain text version (for AI agents)",
543
- "name": "text",
544
- "allowNo": false,
545
- "type": "boolean"
546
558
  }
547
559
  },
548
560
  "hasDynamicHelp": false,
549
561
  "hiddenAliases": [],
550
- "id": "preview",
562
+ "id": "login",
551
563
  "pluginAlias": "@mailmodo/cli",
552
564
  "pluginName": "@mailmodo/cli",
553
565
  "pluginType": "core",
@@ -557,18 +569,23 @@
557
569
  "relativePath": [
558
570
  "dist",
559
571
  "commands",
560
- "preview",
572
+ "login",
561
573
  "index.js"
562
574
  ]
563
575
  },
564
- "sdk": {
576
+ "preview": {
565
577
  "aliases": [],
566
- "args": {},
567
- "description": "Show the SDK track() / identify() reference for deployed sequences",
578
+ "args": {
579
+ "id": {
580
+ "description": "Email template ID to preview",
581
+ "name": "id"
582
+ }
583
+ },
584
+ "description": "Preview an email in browser, as text, or send a test",
568
585
  "examples": [
569
- "<%= config.bin %> sdk",
570
- "<%= config.bin %> sdk --sequence-id a1b2c3d4",
571
- "<%= config.bin %> sdk --json"
586
+ "<%= config.bin %> preview welcome",
587
+ "<%= config.bin %> preview welcome --text",
588
+ "<%= config.bin %> preview welcome --send me@example.com"
572
589
  ],
573
590
  "flags": {
574
591
  "json": {
@@ -584,17 +601,23 @@
584
601
  "allowNo": false,
585
602
  "type": "boolean"
586
603
  },
587
- "sequence-id": {
588
- "description": "Limit output to a single active sequence by ID (default: all active sequences)",
589
- "name": "sequence-id",
604
+ "send": {
605
+ "description": "Send test email to this address",
606
+ "name": "send",
590
607
  "hasDynamicHelp": false,
591
608
  "multiple": false,
592
609
  "type": "option"
610
+ },
611
+ "text": {
612
+ "description": "Output plain text version (for AI agents)",
613
+ "name": "text",
614
+ "allowNo": false,
615
+ "type": "boolean"
593
616
  }
594
617
  },
595
618
  "hasDynamicHelp": false,
596
619
  "hiddenAliases": [],
597
- "id": "sdk",
620
+ "id": "preview",
598
621
  "pluginAlias": "@mailmodo/cli",
599
622
  "pluginName": "@mailmodo/cli",
600
623
  "pluginType": "core",
@@ -604,7 +627,7 @@
604
627
  "relativePath": [
605
628
  "dist",
606
629
  "commands",
607
- "sdk",
630
+ "preview",
608
631
  "index.js"
609
632
  ]
610
633
  },
@@ -693,77 +716,7 @@
693
716
  "status",
694
717
  "index.js"
695
718
  ]
696
- },
697
- "logs": {
698
- "aliases": [],
699
- "args": {},
700
- "description": "View email send logs and delivery events",
701
- "examples": [
702
- "<%= config.bin %> logs",
703
- "<%= config.bin %> logs --email sarah@example.com",
704
- "<%= config.bin %> logs --failed",
705
- "<%= config.bin %> logs --json"
706
- ],
707
- "flags": {
708
- "json": {
709
- "description": "Output as JSON",
710
- "name": "json",
711
- "allowNo": false,
712
- "type": "boolean"
713
- },
714
- "yes": {
715
- "char": "y",
716
- "description": "Skip confirmation prompts",
717
- "name": "yes",
718
- "allowNo": false,
719
- "type": "boolean"
720
- },
721
- "email": {
722
- "description": "Filter logs by contact email",
723
- "name": "email",
724
- "hasDynamicHelp": false,
725
- "multiple": false,
726
- "type": "option"
727
- },
728
- "failed": {
729
- "description": "Show only failed/bounced events",
730
- "name": "failed",
731
- "allowNo": false,
732
- "type": "boolean"
733
- },
734
- "limit": {
735
- "description": "Entries per page (max 200)",
736
- "name": "limit",
737
- "default": 50,
738
- "hasDynamicHelp": false,
739
- "multiple": false,
740
- "type": "option"
741
- },
742
- "page": {
743
- "description": "Page number",
744
- "name": "page",
745
- "default": 1,
746
- "hasDynamicHelp": false,
747
- "multiple": false,
748
- "type": "option"
749
- }
750
- },
751
- "hasDynamicHelp": false,
752
- "hiddenAliases": [],
753
- "id": "logs",
754
- "pluginAlias": "@mailmodo/cli",
755
- "pluginName": "@mailmodo/cli",
756
- "pluginType": "core",
757
- "strict": true,
758
- "enableJsonFlag": false,
759
- "isESM": true,
760
- "relativePath": [
761
- "dist",
762
- "commands",
763
- "logs",
764
- "index.js"
765
- ]
766
719
  }
767
720
  },
768
- "version": "0.0.51-beta.pr53.84"
721
+ "version": "0.0.51-beta.pr54.83"
769
722
  }
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.51-beta.pr53.84",
4
+ "version": "0.0.51-beta.pr54.83",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"
@@ -1,14 +0,0 @@
1
- import { BaseCommand } from '../../lib/base-command.js';
2
- export default class Sdk extends BaseCommand {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- 'sequence-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
- yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
- };
10
- run(): Promise<void>;
11
- private renderSnippets;
12
- private renderSequenceBlock;
13
- private renderCallBlock;
14
- }
@@ -1,74 +0,0 @@
1
- import { Flags } from '@oclif/core';
2
- import chalk from 'chalk';
3
- import { BaseCommand } from '../../lib/base-command.js';
4
- import { API_ENDPOINTS, SDK_IMPORT_SNIPPET, SDK_INSTALL_COMMAND, } from '../../lib/constants.js';
5
- import { SEPARATOR } from '../../lib/messages.js';
6
- export default class Sdk extends BaseCommand {
7
- static description = 'Show the SDK track() / identify() reference for deployed sequences';
8
- static examples = [
9
- '<%= config.bin %> sdk',
10
- '<%= config.bin %> sdk --sequence-id a1b2c3d4',
11
- '<%= config.bin %> sdk --json',
12
- ];
13
- static flags = {
14
- ...BaseCommand.baseFlags,
15
- 'sequence-id': Flags.string({
16
- description: 'Limit output to a single active sequence by ID (default: all active sequences)',
17
- }),
18
- };
19
- async run() {
20
- const { flags } = await this.parse(Sdk);
21
- await this.ensureAuth();
22
- const params = flags['sequence-id']
23
- ? { sequenceId: flags['sequence-id'] }
24
- : undefined;
25
- const response = await this.withApiSpinner({ json: flags.json, text: ' Loading SDK reference...' }, () => this.apiClient.get(API_ENDPOINTS.SEQUENCES_SDK, params));
26
- if (!response.ok) {
27
- this.handleApiError(response);
28
- }
29
- if (flags.json) {
30
- this.log(JSON.stringify(response.data, null, 2));
31
- return;
32
- }
33
- this.renderSnippets(response.data);
34
- }
35
- renderSnippets(data) {
36
- const snippets = data.sdkSnippets ?? [];
37
- if (snippets.length === 0) {
38
- this.log(`\n ${chalk.dim('No active deployed sequences.')}`);
39
- this.log(` Run ${chalk.cyan('mailmodo deploy')} to deploy one.\n`);
40
- return;
41
- }
42
- this.log(`\n ${chalk.bold(String(snippets.length))} active ${snippets.length === 1 ? 'sequence' : 'sequences'}:\n`);
43
- this.log(` ${SEPARATOR}`);
44
- this.log(` ${chalk.bold('SDK EVENT REFERENCE')}`);
45
- this.log(` ${SEPARATOR}\n`);
46
- this.log(` ${chalk.cyan(SDK_INSTALL_COMMAND)}\n`);
47
- this.log(` ${chalk.dim(SDK_IMPORT_SNIPPET)}\n`);
48
- for (const [index, snippet] of snippets.entries()) {
49
- this.renderSequenceBlock(snippet);
50
- if (index < snippets.length - 1)
51
- this.log('');
52
- }
53
- this.log(` ${SEPARATOR}\n`);
54
- }
55
- renderSequenceBlock(snippet) {
56
- const productName = snippet.productName || 'Unnamed sequence';
57
- this.log(` ${chalk.bold(productName)} ${chalk.dim(`(${snippet.sequenceId})`)}`);
58
- const trackCalls = [...new Set(snippet.sdkSnippet?.trackCalls ?? [])];
59
- const identifyCalls = [...new Set(snippet.sdkSnippet?.identifyCalls ?? [])];
60
- this.renderCallBlock('// track() calls', trackCalls);
61
- this.renderCallBlock('// identify() calls', identifyCalls);
62
- if (trackCalls.length === 0 && identifyCalls.length === 0) {
63
- this.log(` ${chalk.dim('No track() or identify() calls available.')}`);
64
- }
65
- }
66
- renderCallBlock(label, calls) {
67
- if (calls.length === 0)
68
- return;
69
- this.log(` ${chalk.dim(label)}`);
70
- for (const call of calls) {
71
- this.log(` ${chalk.dim(call)}`);
72
- }
73
- }
74
- }