@mailmodo/cli 0.0.51-beta.pr53.82 → 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
|
|
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 ??
|
|
290
|
-
this.log(` ${chalk.dim(
|
|
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)}`);
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -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'";
|
package/dist/lib/constants.js
CHANGED
|
@@ -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}'`;
|
package/oclif.manifest.json
CHANGED
|
@@ -426,45 +426,6 @@
|
|
|
426
426
|
"index.js"
|
|
427
427
|
]
|
|
428
428
|
},
|
|
429
|
-
"login": {
|
|
430
|
-
"aliases": [],
|
|
431
|
-
"args": {},
|
|
432
|
-
"description": "Authenticate with Mailmodo using your API key",
|
|
433
|
-
"examples": [
|
|
434
|
-
"<%= config.bin %> login",
|
|
435
|
-
"MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
|
|
436
|
-
],
|
|
437
|
-
"flags": {
|
|
438
|
-
"json": {
|
|
439
|
-
"description": "Output as JSON",
|
|
440
|
-
"name": "json",
|
|
441
|
-
"allowNo": false,
|
|
442
|
-
"type": "boolean"
|
|
443
|
-
},
|
|
444
|
-
"yes": {
|
|
445
|
-
"char": "y",
|
|
446
|
-
"description": "Skip confirmation prompts",
|
|
447
|
-
"name": "yes",
|
|
448
|
-
"allowNo": false,
|
|
449
|
-
"type": "boolean"
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
"hasDynamicHelp": false,
|
|
453
|
-
"hiddenAliases": [],
|
|
454
|
-
"id": "login",
|
|
455
|
-
"pluginAlias": "@mailmodo/cli",
|
|
456
|
-
"pluginName": "@mailmodo/cli",
|
|
457
|
-
"pluginType": "core",
|
|
458
|
-
"strict": true,
|
|
459
|
-
"enableJsonFlag": false,
|
|
460
|
-
"isESM": true,
|
|
461
|
-
"relativePath": [
|
|
462
|
-
"dist",
|
|
463
|
-
"commands",
|
|
464
|
-
"login",
|
|
465
|
-
"index.js"
|
|
466
|
-
]
|
|
467
|
-
},
|
|
468
429
|
"logout": {
|
|
469
430
|
"aliases": [],
|
|
470
431
|
"args": {},
|
|
@@ -573,19 +534,13 @@
|
|
|
573
534
|
"index.js"
|
|
574
535
|
]
|
|
575
536
|
},
|
|
576
|
-
"
|
|
537
|
+
"login": {
|
|
577
538
|
"aliases": [],
|
|
578
|
-
"args": {
|
|
579
|
-
|
|
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",
|
|
539
|
+
"args": {},
|
|
540
|
+
"description": "Authenticate with Mailmodo using your API key",
|
|
585
541
|
"examples": [
|
|
586
|
-
"<%= config.bin %>
|
|
587
|
-
"<%= config.bin %>
|
|
588
|
-
"<%= config.bin %> preview welcome --send me@example.com"
|
|
542
|
+
"<%= config.bin %> login",
|
|
543
|
+
"MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
|
|
589
544
|
],
|
|
590
545
|
"flags": {
|
|
591
546
|
"json": {
|
|
@@ -600,24 +555,11 @@
|
|
|
600
555
|
"name": "yes",
|
|
601
556
|
"allowNo": false,
|
|
602
557
|
"type": "boolean"
|
|
603
|
-
},
|
|
604
|
-
"send": {
|
|
605
|
-
"description": "Send test email to this address",
|
|
606
|
-
"name": "send",
|
|
607
|
-
"hasDynamicHelp": false,
|
|
608
|
-
"multiple": false,
|
|
609
|
-
"type": "option"
|
|
610
|
-
},
|
|
611
|
-
"text": {
|
|
612
|
-
"description": "Output plain text version (for AI agents)",
|
|
613
|
-
"name": "text",
|
|
614
|
-
"allowNo": false,
|
|
615
|
-
"type": "boolean"
|
|
616
558
|
}
|
|
617
559
|
},
|
|
618
560
|
"hasDynamicHelp": false,
|
|
619
561
|
"hiddenAliases": [],
|
|
620
|
-
"id": "
|
|
562
|
+
"id": "login",
|
|
621
563
|
"pluginAlias": "@mailmodo/cli",
|
|
622
564
|
"pluginName": "@mailmodo/cli",
|
|
623
565
|
"pluginType": "core",
|
|
@@ -627,18 +569,23 @@
|
|
|
627
569
|
"relativePath": [
|
|
628
570
|
"dist",
|
|
629
571
|
"commands",
|
|
630
|
-
"
|
|
572
|
+
"login",
|
|
631
573
|
"index.js"
|
|
632
574
|
]
|
|
633
575
|
},
|
|
634
|
-
"
|
|
576
|
+
"preview": {
|
|
635
577
|
"aliases": [],
|
|
636
|
-
"args": {
|
|
637
|
-
|
|
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",
|
|
638
585
|
"examples": [
|
|
639
|
-
"<%= config.bin %>
|
|
640
|
-
"<%= config.bin %>
|
|
641
|
-
"<%= config.bin %>
|
|
586
|
+
"<%= config.bin %> preview welcome",
|
|
587
|
+
"<%= config.bin %> preview welcome --text",
|
|
588
|
+
"<%= config.bin %> preview welcome --send me@example.com"
|
|
642
589
|
],
|
|
643
590
|
"flags": {
|
|
644
591
|
"json": {
|
|
@@ -654,17 +601,23 @@
|
|
|
654
601
|
"allowNo": false,
|
|
655
602
|
"type": "boolean"
|
|
656
603
|
},
|
|
657
|
-
"
|
|
658
|
-
"description": "
|
|
659
|
-
"name": "
|
|
604
|
+
"send": {
|
|
605
|
+
"description": "Send test email to this address",
|
|
606
|
+
"name": "send",
|
|
660
607
|
"hasDynamicHelp": false,
|
|
661
608
|
"multiple": false,
|
|
662
609
|
"type": "option"
|
|
610
|
+
},
|
|
611
|
+
"text": {
|
|
612
|
+
"description": "Output plain text version (for AI agents)",
|
|
613
|
+
"name": "text",
|
|
614
|
+
"allowNo": false,
|
|
615
|
+
"type": "boolean"
|
|
663
616
|
}
|
|
664
617
|
},
|
|
665
618
|
"hasDynamicHelp": false,
|
|
666
619
|
"hiddenAliases": [],
|
|
667
|
-
"id": "
|
|
620
|
+
"id": "preview",
|
|
668
621
|
"pluginAlias": "@mailmodo/cli",
|
|
669
622
|
"pluginName": "@mailmodo/cli",
|
|
670
623
|
"pluginType": "core",
|
|
@@ -674,17 +627,18 @@
|
|
|
674
627
|
"relativePath": [
|
|
675
628
|
"dist",
|
|
676
629
|
"commands",
|
|
677
|
-
"
|
|
630
|
+
"preview",
|
|
678
631
|
"index.js"
|
|
679
632
|
]
|
|
680
633
|
},
|
|
681
|
-
"
|
|
634
|
+
"settings": {
|
|
682
635
|
"aliases": [],
|
|
683
636
|
"args": {},
|
|
684
|
-
"description": "View
|
|
637
|
+
"description": "View and update project settings",
|
|
685
638
|
"examples": [
|
|
686
|
-
"<%= config.bin %>
|
|
687
|
-
"<%= config.bin %>
|
|
639
|
+
"<%= config.bin %> settings",
|
|
640
|
+
"<%= config.bin %> settings --set brand_color=#0F3460",
|
|
641
|
+
"<%= config.bin %> settings --json"
|
|
688
642
|
],
|
|
689
643
|
"flags": {
|
|
690
644
|
"json": {
|
|
@@ -699,11 +653,18 @@
|
|
|
699
653
|
"name": "yes",
|
|
700
654
|
"allowNo": false,
|
|
701
655
|
"type": "boolean"
|
|
656
|
+
},
|
|
657
|
+
"set": {
|
|
658
|
+
"description": "Set a setting (format: key=value)",
|
|
659
|
+
"name": "set",
|
|
660
|
+
"hasDynamicHelp": false,
|
|
661
|
+
"multiple": false,
|
|
662
|
+
"type": "option"
|
|
702
663
|
}
|
|
703
664
|
},
|
|
704
665
|
"hasDynamicHelp": false,
|
|
705
666
|
"hiddenAliases": [],
|
|
706
|
-
"id": "
|
|
667
|
+
"id": "settings",
|
|
707
668
|
"pluginAlias": "@mailmodo/cli",
|
|
708
669
|
"pluginName": "@mailmodo/cli",
|
|
709
670
|
"pluginType": "core",
|
|
@@ -713,18 +674,17 @@
|
|
|
713
674
|
"relativePath": [
|
|
714
675
|
"dist",
|
|
715
676
|
"commands",
|
|
716
|
-
"
|
|
677
|
+
"settings",
|
|
717
678
|
"index.js"
|
|
718
679
|
]
|
|
719
680
|
},
|
|
720
|
-
"
|
|
681
|
+
"status": {
|
|
721
682
|
"aliases": [],
|
|
722
683
|
"args": {},
|
|
723
|
-
"description": "View and
|
|
684
|
+
"description": "View email performance metrics and quota usage",
|
|
724
685
|
"examples": [
|
|
725
|
-
"<%= config.bin %>
|
|
726
|
-
"<%= config.bin %>
|
|
727
|
-
"<%= config.bin %> settings --json"
|
|
686
|
+
"<%= config.bin %> status",
|
|
687
|
+
"<%= config.bin %> status --json"
|
|
728
688
|
],
|
|
729
689
|
"flags": {
|
|
730
690
|
"json": {
|
|
@@ -739,18 +699,11 @@
|
|
|
739
699
|
"name": "yes",
|
|
740
700
|
"allowNo": false,
|
|
741
701
|
"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
702
|
}
|
|
750
703
|
},
|
|
751
704
|
"hasDynamicHelp": false,
|
|
752
705
|
"hiddenAliases": [],
|
|
753
|
-
"id": "
|
|
706
|
+
"id": "status",
|
|
754
707
|
"pluginAlias": "@mailmodo/cli",
|
|
755
708
|
"pluginName": "@mailmodo/cli",
|
|
756
709
|
"pluginType": "core",
|
|
@@ -760,10 +713,10 @@
|
|
|
760
713
|
"relativePath": [
|
|
761
714
|
"dist",
|
|
762
715
|
"commands",
|
|
763
|
-
"
|
|
716
|
+
"status",
|
|
764
717
|
"index.js"
|
|
765
718
|
]
|
|
766
719
|
}
|
|
767
720
|
},
|
|
768
|
-
"version": "0.0.51-beta.
|
|
721
|
+
"version": "0.0.51-beta.pr54.83"
|
|
769
722
|
}
|
package/package.json
CHANGED
|
@@ -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
|
-
}
|