@mailmodo/cli 0.0.50-beta.pr52.80 → 0.0.51-beta.pr53.81

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.
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,74 @@
1
+ import { Flags } from '@oclif/core';
2
+ import chalk from 'chalk';
3
+ import { BaseCommand } from '../../lib/base-command.js';
4
+ import { API_ENDPOINTS } 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('npm install @mailmodo/sdk')}\n`);
47
+ this.log(` ${chalk.dim("import { track, identify } from '@mailmodo/sdk'")}\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
+ }
@@ -26,6 +26,7 @@ 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";
29
30
  SEQUENCES_VALIDATE: "/sequences/validate";
30
31
  }>;
31
32
  export declare const LOGIN_URL = "https://app-vertex-debug.azurewebsites.net/signup.html";
@@ -32,6 +32,7 @@ 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',
35
36
  SEQUENCES_VALIDATE: '/sequences/validate',
36
37
  });
37
38
  const DEV_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup.html';
@@ -289,19 +289,13 @@
289
289
  "index.js"
290
290
  ]
291
291
  },
292
- "edit": {
292
+ "emails": {
293
293
  "aliases": [],
294
- "args": {
295
- "id": {
296
- "description": "Email template ID to edit",
297
- "name": "id",
298
- "required": true
299
- }
300
- },
301
- "description": "Edit an email using AI-assisted natural language changes",
294
+ "args": {},
295
+ "description": "List and view configured email sequences",
302
296
  "examples": [
303
- "<%= config.bin %> edit welcome",
304
- "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
297
+ "<%= config.bin %> emails",
298
+ "<%= config.bin %> emails --json"
305
299
  ],
306
300
  "flags": {
307
301
  "json": {
@@ -316,18 +310,11 @@
316
310
  "name": "yes",
317
311
  "allowNo": false,
318
312
  "type": "boolean"
319
- },
320
- "change": {
321
- "description": "Natural language description of the change",
322
- "name": "change",
323
- "hasDynamicHelp": false,
324
- "multiple": false,
325
- "type": "option"
326
313
  }
327
314
  },
328
315
  "hasDynamicHelp": false,
329
316
  "hiddenAliases": [],
330
- "id": "edit",
317
+ "id": "emails",
331
318
  "pluginAlias": "@mailmodo/cli",
332
319
  "pluginName": "@mailmodo/cli",
333
320
  "pluginType": "core",
@@ -337,17 +324,23 @@
337
324
  "relativePath": [
338
325
  "dist",
339
326
  "commands",
340
- "edit",
327
+ "emails",
341
328
  "index.js"
342
329
  ]
343
330
  },
344
- "emails": {
331
+ "edit": {
345
332
  "aliases": [],
346
- "args": {},
347
- "description": "List and view configured email sequences",
333
+ "args": {
334
+ "id": {
335
+ "description": "Email template ID to edit",
336
+ "name": "id",
337
+ "required": true
338
+ }
339
+ },
340
+ "description": "Edit an email using AI-assisted natural language changes",
348
341
  "examples": [
349
- "<%= config.bin %> emails",
350
- "<%= config.bin %> emails --json"
342
+ "<%= config.bin %> edit welcome",
343
+ "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
351
344
  ],
352
345
  "flags": {
353
346
  "json": {
@@ -362,11 +355,18 @@
362
355
  "name": "yes",
363
356
  "allowNo": false,
364
357
  "type": "boolean"
358
+ },
359
+ "change": {
360
+ "description": "Natural language description of the change",
361
+ "name": "change",
362
+ "hasDynamicHelp": false,
363
+ "multiple": false,
364
+ "type": "option"
365
365
  }
366
366
  },
367
367
  "hasDynamicHelp": false,
368
368
  "hiddenAliases": [],
369
- "id": "emails",
369
+ "id": "edit",
370
370
  "pluginAlias": "@mailmodo/cli",
371
371
  "pluginName": "@mailmodo/cli",
372
372
  "pluginType": "core",
@@ -376,7 +376,7 @@
376
376
  "relativePath": [
377
377
  "dist",
378
378
  "commands",
379
- "emails",
379
+ "edit",
380
380
  "index.js"
381
381
  ]
382
382
  },
@@ -631,14 +631,14 @@
631
631
  "index.js"
632
632
  ]
633
633
  },
634
- "settings": {
634
+ "sdk": {
635
635
  "aliases": [],
636
636
  "args": {},
637
- "description": "View and update project settings",
637
+ "description": "Show the SDK track() / identify() reference for deployed sequences",
638
638
  "examples": [
639
- "<%= config.bin %> settings",
640
- "<%= config.bin %> settings --set brand_color=#0F3460",
641
- "<%= config.bin %> settings --json"
639
+ "<%= config.bin %> sdk",
640
+ "<%= config.bin %> sdk --sequence-id a1b2c3d4",
641
+ "<%= config.bin %> sdk --json"
642
642
  ],
643
643
  "flags": {
644
644
  "json": {
@@ -654,9 +654,9 @@
654
654
  "allowNo": false,
655
655
  "type": "boolean"
656
656
  },
657
- "set": {
658
- "description": "Set a setting (format: key=value)",
659
- "name": "set",
657
+ "sequence-id": {
658
+ "description": "Limit output to a single active sequence by ID (default: all active sequences)",
659
+ "name": "sequence-id",
660
660
  "hasDynamicHelp": false,
661
661
  "multiple": false,
662
662
  "type": "option"
@@ -664,7 +664,7 @@
664
664
  },
665
665
  "hasDynamicHelp": false,
666
666
  "hiddenAliases": [],
667
- "id": "settings",
667
+ "id": "sdk",
668
668
  "pluginAlias": "@mailmodo/cli",
669
669
  "pluginName": "@mailmodo/cli",
670
670
  "pluginType": "core",
@@ -674,7 +674,7 @@
674
674
  "relativePath": [
675
675
  "dist",
676
676
  "commands",
677
- "settings",
677
+ "sdk",
678
678
  "index.js"
679
679
  ]
680
680
  },
@@ -716,7 +716,54 @@
716
716
  "status",
717
717
  "index.js"
718
718
  ]
719
+ },
720
+ "settings": {
721
+ "aliases": [],
722
+ "args": {},
723
+ "description": "View and update project settings",
724
+ "examples": [
725
+ "<%= config.bin %> settings",
726
+ "<%= config.bin %> settings --set brand_color=#0F3460",
727
+ "<%= config.bin %> settings --json"
728
+ ],
729
+ "flags": {
730
+ "json": {
731
+ "description": "Output as JSON",
732
+ "name": "json",
733
+ "allowNo": false,
734
+ "type": "boolean"
735
+ },
736
+ "yes": {
737
+ "char": "y",
738
+ "description": "Skip confirmation prompts",
739
+ "name": "yes",
740
+ "allowNo": false,
741
+ "type": "boolean"
742
+ },
743
+ "set": {
744
+ "description": "Set a setting (format: key=value)",
745
+ "name": "set",
746
+ "hasDynamicHelp": false,
747
+ "multiple": false,
748
+ "type": "option"
749
+ }
750
+ },
751
+ "hasDynamicHelp": false,
752
+ "hiddenAliases": [],
753
+ "id": "settings",
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
+ "settings",
764
+ "index.js"
765
+ ]
719
766
  }
720
767
  },
721
- "version": "0.0.50-beta.pr52.80"
768
+ "version": "0.0.51-beta.pr53.81"
722
769
  }
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.50-beta.pr52.80",
4
+ "version": "0.0.51-beta.pr53.81",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"