@mailmodo/cli 0.0.44 → 0.0.45
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.
- package/dist/lib/messages.d.ts +1 -0
- package/dist/lib/messages.js +3 -0
- package/dist/lib/yaml-config.d.ts +2 -1
- package/dist/lib/yaml-config.js +6 -4
- package/oclif.manifest.json +62 -62
- package/package.json +1 -1
package/dist/lib/messages.d.ts
CHANGED
|
@@ -34,4 +34,5 @@ export declare const INFO: {
|
|
|
34
34
|
readonly DOMAIN_PENDING_VERIFICATION: `Your domain is not verified yet. Please verify it first. Run ${string} to check the status.`;
|
|
35
35
|
readonly SEQUENCES_NOT_DEPLOYED: `Sequences saved but ${string}.`;
|
|
36
36
|
};
|
|
37
|
+
export declare function yamlParseError(detail: string): string;
|
|
37
38
|
export declare function recordLabel(index: number): string;
|
package/dist/lib/messages.js
CHANGED
|
@@ -34,6 +34,9 @@ export const INFO = {
|
|
|
34
34
|
DOMAIN_PENDING_VERIFICATION: `Your domain is not verified yet. Please verify it first. Run ${chalk.cyan('mailmodo domain --verify')} to check the status.`,
|
|
35
35
|
SEQUENCES_NOT_DEPLOYED: `Sequences saved but ${chalk.yellow('NOT deployed')}.`,
|
|
36
36
|
};
|
|
37
|
+
export function yamlParseError(detail) {
|
|
38
|
+
return `mailmodo.yaml has invalid YAML syntax:\n${detail}`;
|
|
39
|
+
}
|
|
37
40
|
export function recordLabel(index) {
|
|
38
41
|
const labels = ['DKIM', 'DMARC', 'Return Path'];
|
|
39
42
|
return labels[index] || `Record ${index + 1}`;
|
|
@@ -40,7 +40,8 @@ export interface MailmodoYaml {
|
|
|
40
40
|
*
|
|
41
41
|
* @param {string} [cwd] - Directory containing mailmodo.yaml. Defaults to process.cwd().
|
|
42
42
|
* @returns {Promise<MailmodoYaml | null>} The parsed configuration with project
|
|
43
|
-
* settings and email array, or null if the file doesn't exist
|
|
43
|
+
* settings and email array, or null if the file doesn't exist. Throws a
|
|
44
|
+
* formatted Error with the line number if the file contains invalid YAML syntax.
|
|
44
45
|
*/
|
|
45
46
|
export declare function loadYaml(cwd?: string): Promise<MailmodoYaml | null>;
|
|
46
47
|
/**
|
package/dist/lib/yaml-config.js
CHANGED
|
@@ -3,24 +3,26 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { dump, load } from 'js-yaml';
|
|
5
5
|
import { TEMPLATES_DIR, YAML_FILE } from './constants.js';
|
|
6
|
+
import { yamlParseError } from './messages.js';
|
|
6
7
|
/**
|
|
7
8
|
* Loads and parses the mailmodo.yaml configuration file from the specified
|
|
8
9
|
* directory (or current working directory).
|
|
9
10
|
*
|
|
10
11
|
* @param {string} [cwd] - Directory containing mailmodo.yaml. Defaults to process.cwd().
|
|
11
12
|
* @returns {Promise<MailmodoYaml | null>} The parsed configuration with project
|
|
12
|
-
* settings and email array, or null if the file doesn't exist
|
|
13
|
+
* settings and email array, or null if the file doesn't exist. Throws a
|
|
14
|
+
* formatted Error with the line number if the file contains invalid YAML syntax.
|
|
13
15
|
*/
|
|
14
16
|
export async function loadYaml(cwd) {
|
|
15
17
|
const filePath = join(cwd || process.cwd(), YAML_FILE);
|
|
16
18
|
if (!existsSync(filePath))
|
|
17
19
|
return null;
|
|
20
|
+
const content = await readFile(filePath, 'utf8');
|
|
18
21
|
try {
|
|
19
|
-
const content = await readFile(filePath, 'utf8');
|
|
20
22
|
return load(content);
|
|
21
23
|
}
|
|
22
|
-
catch {
|
|
23
|
-
|
|
24
|
+
catch (error) {
|
|
25
|
+
throw new Error(yamlParseError(error.message));
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
/**
|
package/oclif.manifest.json
CHANGED
|
@@ -76,15 +76,13 @@
|
|
|
76
76
|
"index.js"
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"deploy": {
|
|
80
80
|
"aliases": [],
|
|
81
81
|
"args": {},
|
|
82
|
-
"description": "
|
|
82
|
+
"description": "Deploy email sequences and verify sending domain",
|
|
83
83
|
"examples": [
|
|
84
|
-
"<%= config.bin %>
|
|
85
|
-
"<%= config.bin %>
|
|
86
|
-
"<%= config.bin %> contacts --export # GDPR CSV → contacts.csv",
|
|
87
|
-
"<%= config.bin %> contacts --delete sarah@example.com"
|
|
84
|
+
"<%= config.bin %> deploy",
|
|
85
|
+
"<%= config.bin %> deploy --yes"
|
|
88
86
|
],
|
|
89
87
|
"flags": {
|
|
90
88
|
"json": {
|
|
@@ -99,31 +97,11 @@
|
|
|
99
97
|
"name": "yes",
|
|
100
98
|
"allowNo": false,
|
|
101
99
|
"type": "boolean"
|
|
102
|
-
},
|
|
103
|
-
"delete": {
|
|
104
|
-
"description": "GDPR hard delete a contact by email",
|
|
105
|
-
"name": "delete",
|
|
106
|
-
"hasDynamicHelp": false,
|
|
107
|
-
"multiple": false,
|
|
108
|
-
"type": "option"
|
|
109
|
-
},
|
|
110
|
-
"export": {
|
|
111
|
-
"description": "Export all contacts as GDPR-compliant CSV (writes contacts.csv in the current directory)",
|
|
112
|
-
"name": "export",
|
|
113
|
-
"allowNo": false,
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
|
-
"search": {
|
|
117
|
-
"description": "Search for a contact by email",
|
|
118
|
-
"name": "search",
|
|
119
|
-
"hasDynamicHelp": false,
|
|
120
|
-
"multiple": false,
|
|
121
|
-
"type": "option"
|
|
122
100
|
}
|
|
123
101
|
},
|
|
124
102
|
"hasDynamicHelp": false,
|
|
125
103
|
"hiddenAliases": [],
|
|
126
|
-
"id": "
|
|
104
|
+
"id": "deploy",
|
|
127
105
|
"pluginAlias": "@mailmodo/cli",
|
|
128
106
|
"pluginName": "@mailmodo/cli",
|
|
129
107
|
"pluginType": "core",
|
|
@@ -133,17 +111,19 @@
|
|
|
133
111
|
"relativePath": [
|
|
134
112
|
"dist",
|
|
135
113
|
"commands",
|
|
136
|
-
"
|
|
114
|
+
"deploy",
|
|
137
115
|
"index.js"
|
|
138
116
|
]
|
|
139
117
|
},
|
|
140
|
-
"
|
|
118
|
+
"contacts": {
|
|
141
119
|
"aliases": [],
|
|
142
120
|
"args": {},
|
|
143
|
-
"description": "
|
|
121
|
+
"description": "Manage contacts — search, export, or delete",
|
|
144
122
|
"examples": [
|
|
145
|
-
"<%= config.bin %>
|
|
146
|
-
"<%= config.bin %>
|
|
123
|
+
"<%= config.bin %> contacts",
|
|
124
|
+
"<%= config.bin %> contacts --search sarah@example.com",
|
|
125
|
+
"<%= config.bin %> contacts --export # GDPR CSV → contacts.csv",
|
|
126
|
+
"<%= config.bin %> contacts --delete sarah@example.com"
|
|
147
127
|
],
|
|
148
128
|
"flags": {
|
|
149
129
|
"json": {
|
|
@@ -158,11 +138,31 @@
|
|
|
158
138
|
"name": "yes",
|
|
159
139
|
"allowNo": false,
|
|
160
140
|
"type": "boolean"
|
|
141
|
+
},
|
|
142
|
+
"delete": {
|
|
143
|
+
"description": "GDPR hard delete a contact by email",
|
|
144
|
+
"name": "delete",
|
|
145
|
+
"hasDynamicHelp": false,
|
|
146
|
+
"multiple": false,
|
|
147
|
+
"type": "option"
|
|
148
|
+
},
|
|
149
|
+
"export": {
|
|
150
|
+
"description": "Export all contacts as GDPR-compliant CSV (writes contacts.csv in the current directory)",
|
|
151
|
+
"name": "export",
|
|
152
|
+
"allowNo": false,
|
|
153
|
+
"type": "boolean"
|
|
154
|
+
},
|
|
155
|
+
"search": {
|
|
156
|
+
"description": "Search for a contact by email",
|
|
157
|
+
"name": "search",
|
|
158
|
+
"hasDynamicHelp": false,
|
|
159
|
+
"multiple": false,
|
|
160
|
+
"type": "option"
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
163
|
"hasDynamicHelp": false,
|
|
164
164
|
"hiddenAliases": [],
|
|
165
|
-
"id": "
|
|
165
|
+
"id": "contacts",
|
|
166
166
|
"pluginAlias": "@mailmodo/cli",
|
|
167
167
|
"pluginName": "@mailmodo/cli",
|
|
168
168
|
"pluginType": "core",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"relativePath": [
|
|
173
173
|
"dist",
|
|
174
174
|
"commands",
|
|
175
|
-
"
|
|
175
|
+
"contacts",
|
|
176
176
|
"index.js"
|
|
177
177
|
]
|
|
178
178
|
},
|
|
@@ -228,13 +228,19 @@
|
|
|
228
228
|
"index.js"
|
|
229
229
|
]
|
|
230
230
|
},
|
|
231
|
-
"
|
|
231
|
+
"edit": {
|
|
232
232
|
"aliases": [],
|
|
233
|
-
"args": {
|
|
234
|
-
|
|
233
|
+
"args": {
|
|
234
|
+
"id": {
|
|
235
|
+
"description": "Email template ID to edit",
|
|
236
|
+
"name": "id",
|
|
237
|
+
"required": true
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"description": "Edit an email using AI-assisted natural language changes",
|
|
235
241
|
"examples": [
|
|
236
|
-
"<%= config.bin %>
|
|
237
|
-
"<%= config.bin %>
|
|
242
|
+
"<%= config.bin %> edit welcome",
|
|
243
|
+
"<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
|
|
238
244
|
],
|
|
239
245
|
"flags": {
|
|
240
246
|
"json": {
|
|
@@ -249,11 +255,18 @@
|
|
|
249
255
|
"name": "yes",
|
|
250
256
|
"allowNo": false,
|
|
251
257
|
"type": "boolean"
|
|
258
|
+
},
|
|
259
|
+
"change": {
|
|
260
|
+
"description": "Natural language description of the change",
|
|
261
|
+
"name": "change",
|
|
262
|
+
"hasDynamicHelp": false,
|
|
263
|
+
"multiple": false,
|
|
264
|
+
"type": "option"
|
|
252
265
|
}
|
|
253
266
|
},
|
|
254
267
|
"hasDynamicHelp": false,
|
|
255
268
|
"hiddenAliases": [],
|
|
256
|
-
"id": "
|
|
269
|
+
"id": "edit",
|
|
257
270
|
"pluginAlias": "@mailmodo/cli",
|
|
258
271
|
"pluginName": "@mailmodo/cli",
|
|
259
272
|
"pluginType": "core",
|
|
@@ -263,23 +276,17 @@
|
|
|
263
276
|
"relativePath": [
|
|
264
277
|
"dist",
|
|
265
278
|
"commands",
|
|
266
|
-
"
|
|
279
|
+
"edit",
|
|
267
280
|
"index.js"
|
|
268
281
|
]
|
|
269
282
|
},
|
|
270
|
-
"
|
|
283
|
+
"emails": {
|
|
271
284
|
"aliases": [],
|
|
272
|
-
"args": {
|
|
273
|
-
|
|
274
|
-
"description": "Email template ID to edit",
|
|
275
|
-
"name": "id",
|
|
276
|
-
"required": true
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
"description": "Edit an email using AI-assisted natural language changes",
|
|
285
|
+
"args": {},
|
|
286
|
+
"description": "List and view configured email sequences",
|
|
280
287
|
"examples": [
|
|
281
|
-
"<%= config.bin %>
|
|
282
|
-
"<%= config.bin %>
|
|
288
|
+
"<%= config.bin %> emails",
|
|
289
|
+
"<%= config.bin %> emails --json"
|
|
283
290
|
],
|
|
284
291
|
"flags": {
|
|
285
292
|
"json": {
|
|
@@ -294,18 +301,11 @@
|
|
|
294
301
|
"name": "yes",
|
|
295
302
|
"allowNo": false,
|
|
296
303
|
"type": "boolean"
|
|
297
|
-
},
|
|
298
|
-
"change": {
|
|
299
|
-
"description": "Natural language description of the change",
|
|
300
|
-
"name": "change",
|
|
301
|
-
"hasDynamicHelp": false,
|
|
302
|
-
"multiple": false,
|
|
303
|
-
"type": "option"
|
|
304
304
|
}
|
|
305
305
|
},
|
|
306
306
|
"hasDynamicHelp": false,
|
|
307
307
|
"hiddenAliases": [],
|
|
308
|
-
"id": "
|
|
308
|
+
"id": "emails",
|
|
309
309
|
"pluginAlias": "@mailmodo/cli",
|
|
310
310
|
"pluginName": "@mailmodo/cli",
|
|
311
311
|
"pluginType": "core",
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
"relativePath": [
|
|
316
316
|
"dist",
|
|
317
317
|
"commands",
|
|
318
|
-
"
|
|
318
|
+
"emails",
|
|
319
319
|
"index.js"
|
|
320
320
|
]
|
|
321
321
|
},
|
|
@@ -657,5 +657,5 @@
|
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
"version": "0.0.
|
|
660
|
+
"version": "0.0.45"
|
|
661
661
|
}
|