@mailmodo/cli 0.0.21-beta.pr23.39 → 0.0.21

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.
@@ -5,8 +5,6 @@ export default class Logs extends BaseCommand {
5
5
  static flags: {
6
6
  email: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  failed: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
- limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
9
- page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
8
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
9
  yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
10
  };
@@ -17,22 +17,11 @@ export default class Logs extends BaseCommand {
17
17
  default: false,
18
18
  description: 'Show only failed/bounced events',
19
19
  }),
20
- limit: Flags.integer({
21
- default: 50,
22
- description: 'Entries per page (max 200)',
23
- }),
24
- page: Flags.integer({
25
- default: 1,
26
- description: 'Page number',
27
- }),
28
20
  };
29
21
  async run() {
30
22
  const { flags } = await this.parse(Logs);
31
23
  await this.ensureAuth();
32
- const params = {
33
- limit: String(flags.limit),
34
- page: String(flags.page),
35
- };
24
+ const params = {};
36
25
  if (flags.email)
37
26
  params.email = flags.email;
38
27
  if (flags.failed)
@@ -41,7 +30,7 @@ export default class Logs extends BaseCommand {
41
30
  if (!response.ok) {
42
31
  this.handleApiError(response);
43
32
  }
44
- const { entries, limit, page, total } = response.data;
33
+ const { entries } = response.data;
45
34
  if (flags.json) {
46
35
  this.log(JSON.stringify(response.data, null, 2));
47
36
  return;
@@ -60,11 +49,6 @@ export default class Logs extends BaseCommand {
60
49
  this.log(` ${' '.repeat(52)}${chalk.dim(`(reason: ${entry.reason})`)}`);
61
50
  }
62
51
  }
63
- const totalPages = Math.ceil(total / limit);
64
- this.log(`\n Page ${page} of ${totalPages} · ${total} total entries`);
65
- if (page < totalPages) {
66
- this.log(` ${chalk.dim(`Next: --page ${page + 1}`)}`);
67
- }
68
52
  }
69
53
  else {
70
54
  this.log(` ${chalk.dim('No log entries found.')}`);
@@ -8,8 +8,6 @@ export default class Settings extends BaseCommand {
8
8
  yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
9
  };
10
10
  run(): Promise<void>;
11
- private applySetFlag;
12
- private displaySettingsGroup;
13
11
  /**
14
12
  * Prompts the user to pick a setting key to edit and dispatches
15
13
  * to the appropriate handler for that key.
@@ -43,85 +43,73 @@ export default class Settings extends BaseCommand {
43
43
  async run() {
44
44
  const { flags } = await this.parse(Settings);
45
45
  const yamlConfig = await this.ensureYaml();
46
+ const { project } = yamlConfig;
46
47
  if (flags.set) {
47
- await this.applySetFlag(flags.set, yamlConfig, flags.json ?? false);
48
+ const eqIndex = flags.set.indexOf('=');
49
+ if (eqIndex === -1) {
50
+ this.error('Invalid format. Use --set key=value (e.g., --set brand_color=#0F3460)');
51
+ }
52
+ const key = flags.set.slice(0, eqIndex).trim();
53
+ const propKey = settingKeyToProp(key);
54
+ const value = flags.set.slice(eqIndex + 1).trim();
55
+ if (!(propKey in project)) {
56
+ this.error(`Unknown setting: ${key}`);
57
+ }
58
+ project[propKey] =
59
+ propKey === 'monthlyCap' ? Number(value) : value;
60
+ await saveYaml(yamlConfig);
61
+ if (flags.json) {
62
+ this.log(JSON.stringify({ [propKey]: value, status: 'updated' }, null, 2));
63
+ return;
64
+ }
65
+ this.log(`\n ${chalk.green('✓')} ${key} updated to ${chalk.cyan(value)}`);
66
+ this.log(` Run ${chalk.cyan("'mailmodo deploy'")} to apply.\n`);
48
67
  return;
49
68
  }
50
69
  if (flags.json) {
51
- this.log(JSON.stringify({ settings: yamlConfig.project }, null, 2));
70
+ this.log(JSON.stringify({ settings: project }, null, 2));
52
71
  return;
53
72
  }
54
- const domainVerified = await this.fetchDomainVerified(yamlConfig.project.domain);
55
- this.log(`\n Current settings for ${chalk.bold(yamlConfig.project.name || 'project')}:\n`);
73
+ const domainVerified = await this.fetchDomainVerified(project.domain);
74
+ this.log(`\n Current settings for ${chalk.bold(project.name || 'project')}:\n`);
56
75
  for (const [group, keys] of Object.entries(SETTINGS_GROUPS)) {
57
- this.displaySettingsGroup(group, keys, yamlConfig.project, domainVerified);
58
- }
59
- if (!flags.yes) {
60
- await this.promptEditSetting(yamlConfig);
61
- }
62
- }
63
- async applySetFlag(setFlag, yamlConfig, isJson) {
64
- const { project } = yamlConfig;
65
- const eqIndex = setFlag.indexOf('=');
66
- if (eqIndex === -1) {
67
- this.error('Invalid format. Use --set key=value (e.g., --set brand_color=#0F3460)');
68
- }
69
- const key = setFlag.slice(0, eqIndex).trim();
70
- const propKey = settingKeyToProp(key);
71
- const value = setFlag.slice(eqIndex + 1).trim();
72
- if (!(propKey in project) && key !== 'logo_file') {
73
- this.error(`Unknown setting: ${key}`);
74
- }
75
- project[propKey] =
76
- propKey === 'monthlyCap' ? Number(value) : value;
77
- await saveYaml(yamlConfig);
78
- if (isJson) {
79
- this.log(JSON.stringify({ [propKey]: value, status: 'updated' }, null, 2));
80
- return;
81
- }
82
- this.log(`\n ${chalk.green('✓')} ${key} updated to ${chalk.cyan(value)}`);
83
- this.log(` Run ${chalk.cyan("'mailmodo deploy'")} to apply.\n`);
84
- }
85
- displaySettingsGroup(group, keys, project, domainVerified) {
86
- const availableKeys = keys.filter((key) => {
87
- if (group === 'brand' && key === 'logo_file')
88
- return true;
89
- return settingKeyToProp(key) in project;
90
- });
91
- const groupTitle = ` ${chalk.bold(group.charAt(0).toUpperCase() + group.slice(1))}`;
92
- if (availableKeys.length === 0) {
93
- const hint = SETUP_HINTS[settingKeyToProp(keys[0])];
94
- if (hint) {
95
- this.log(groupTitle);
96
- this.log(` ${'─'.repeat(49)}`);
97
- this.log(` ${chalk.dim(`Run ${hint} to configure.`)}`);
98
- this.log('');
76
+ const availableKeys = keys.filter((key) => settingKeyToProp(key) in project);
77
+ if (availableKeys.length === 0) {
78
+ const hint = SETUP_HINTS[settingKeyToProp(keys[0])];
79
+ if (hint) {
80
+ this.log(` ${chalk.bold(group.charAt(0).toUpperCase() + group.slice(1))}`);
81
+ this.log(` ${'─'.repeat(49)}`);
82
+ this.log(` ${chalk.dim(`Run ${hint} to configure.`)}`);
83
+ this.log('');
84
+ }
85
+ continue;
99
86
  }
100
- return;
101
- }
102
- this.log(groupTitle);
103
- this.log(` ${'─'.repeat(49)}`);
104
- for (const key of availableKeys) {
105
- const propKey = settingKeyToProp(key);
106
- const value = project[propKey];
107
- let displayValue = value ? String(value) : chalk.dim('(not set)');
108
- if (key === 'domain' && value && domainVerified === true) {
109
- displayValue += ` ${chalk.green(' verified')}`;
87
+ this.log(` ${chalk.bold(group.charAt(0).toUpperCase() + group.slice(1))}`);
88
+ this.log(` ${'─'.repeat(49)}`);
89
+ for (const key of availableKeys) {
90
+ const propKey = settingKeyToProp(key);
91
+ const value = project[propKey];
92
+ let displayValue = value ? String(value) : chalk.dim('(not set)');
93
+ if (key === 'domain' && value && domainVerified === true) {
94
+ displayValue += ` ${chalk.green(' verified')}`;
95
+ }
96
+ else if (key === 'domain' && value && domainVerified === false) {
97
+ displayValue += ` ${chalk.red('✗ not verified')}`;
98
+ }
99
+ this.log(` ${key.padEnd(16)} ${displayValue}`);
110
100
  }
111
- else if (key === 'domain' && value && domainVerified === false) {
112
- displayValue += ` ${chalk.red('✗ not verified')}`;
101
+ const missingKeys = keys.filter((key) => !(settingKeyToProp(key) in project));
102
+ for (const key of missingKeys) {
103
+ const hint = SETUP_HINTS[settingKeyToProp(key)];
104
+ if (hint) {
105
+ this.log(` ${key.padEnd(16)} ${chalk.dim(`(run ${hint} to set up)`)}`);
106
+ }
113
107
  }
114
- this.log(` ${key.padEnd(16)} ${displayValue}`);
108
+ this.log('');
115
109
  }
116
- const missingKeys = keys.filter((key) => !(settingKeyToProp(key) in project) &&
117
- !(group === 'brand' && key === 'logo_file'));
118
- for (const key of missingKeys) {
119
- const hint = SETUP_HINTS[settingKeyToProp(key)];
120
- if (hint) {
121
- this.log(` ${key.padEnd(16)} ${chalk.dim(`(run ${hint} to set up)`)}`);
122
- }
110
+ if (!flags.yes) {
111
+ await this.promptEditSetting(yamlConfig);
123
112
  }
124
- this.log('');
125
113
  }
126
114
  /**
127
115
  * Prompts the user to pick a setting key to edit and dispatches
@@ -137,10 +125,6 @@ export default class Settings extends BaseCommand {
137
125
  return;
138
126
  const editPropKey = settingKeyToProp(editKey);
139
127
  if (!(editPropKey in project)) {
140
- if (editKey === 'logo_file') {
141
- await this.handleLogoUpload(yamlConfig);
142
- return;
143
- }
144
128
  const hint = SETUP_HINTS[editPropKey];
145
129
  if (hint) {
146
130
  this.log(`\n ${editKey} is not configured yet. Run ${chalk.cyan(hint)} to set it up.\n`);
@@ -268,16 +252,8 @@ export default class Settings extends BaseCommand {
268
252
  }
269
253
  await this.ensureAuth();
270
254
  const fileBuffer = await readFile(resolvedPath);
271
- const ext = resolvedPath.split('.').pop()?.toLowerCase();
272
- const mimeTypes = {
273
- png: 'image/png',
274
- jpg: 'image/jpeg',
275
- jpeg: 'image/jpeg',
276
- svg: 'image/svg+xml',
277
- };
278
- const mimeType = mimeTypes[ext ?? ''] ?? 'application/octet-stream';
279
255
  const formData = new FormData();
280
- formData.append('logo', new Blob([new Uint8Array(fileBuffer)], { type: mimeType }), logoPath.split(/[/\\]/).pop() || 'logo.png');
256
+ formData.append('logo', new Blob([new Uint8Array(fileBuffer)]), logoPath.split(/[/\\]/).pop() || 'logo.png');
281
257
  const response = await this.apiClient.postFormData(API_ENDPOINTS.ASSETS_LOGO, formData);
282
258
  if (!response.ok) {
283
259
  this.handleApiError(response);
@@ -455,22 +455,6 @@
455
455
  "name": "failed",
456
456
  "allowNo": false,
457
457
  "type": "boolean"
458
- },
459
- "limit": {
460
- "description": "Entries per page (max 200)",
461
- "name": "limit",
462
- "default": 50,
463
- "hasDynamicHelp": false,
464
- "multiple": false,
465
- "type": "option"
466
- },
467
- "page": {
468
- "description": "Page number",
469
- "name": "page",
470
- "default": 1,
471
- "hasDynamicHelp": false,
472
- "multiple": false,
473
- "type": "option"
474
458
  }
475
459
  },
476
460
  "hasDynamicHelp": false,
@@ -634,5 +618,5 @@
634
618
  ]
635
619
  }
636
620
  },
637
- "version": "0.0.21-beta.pr23.39"
621
+ "version": "0.0.21"
638
622
  }
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.21-beta.pr23.39",
4
+ "version": "0.0.21",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"