@cakemail-org/cakemail-cli 1.3.0 → 1.7.0
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/README.md +312 -12
- package/dist/cli.js +59 -8
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +15 -7
- package/dist/client.js.map +1 -1
- package/dist/commands/account.d.ts +5 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +231 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/attributes.d.ts.map +1 -1
- package/dist/commands/attributes.js +43 -15
- package/dist/commands/attributes.js.map +1 -1
- package/dist/commands/campaigns.d.ts.map +1 -1
- package/dist/commands/campaigns.js +255 -26
- package/dist/commands/campaigns.js.map +1 -1
- package/dist/commands/config.d.ts +8 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +294 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/contacts.d.ts.map +1 -1
- package/dist/commands/contacts.js +321 -47
- package/dist/commands/contacts.js.map +1 -1
- package/dist/commands/interests.d.ts +5 -0
- package/dist/commands/interests.d.ts.map +1 -0
- package/dist/commands/interests.js +172 -0
- package/dist/commands/interests.js.map +1 -0
- package/dist/commands/lists.d.ts.map +1 -1
- package/dist/commands/lists.js +165 -30
- package/dist/commands/lists.js.map +1 -1
- package/dist/commands/logs.d.ts +5 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +237 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/reports.d.ts.map +1 -1
- package/dist/commands/reports.js +90 -13
- package/dist/commands/reports.js.map +1 -1
- package/dist/commands/segments.d.ts.map +1 -1
- package/dist/commands/segments.js +59 -21
- package/dist/commands/segments.js.map +1 -1
- package/dist/commands/senders.d.ts.map +1 -1
- package/dist/commands/senders.js +46 -12
- package/dist/commands/senders.js.map +1 -1
- package/dist/commands/suppressed.d.ts.map +1 -1
- package/dist/commands/suppressed.js +20 -6
- package/dist/commands/suppressed.js.map +1 -1
- package/dist/commands/tags.d.ts +5 -0
- package/dist/commands/tags.d.ts.map +1 -0
- package/dist/commands/tags.js +124 -0
- package/dist/commands/tags.js.map +1 -0
- package/dist/commands/templates.d.ts.map +1 -1
- package/dist/commands/templates.js +11 -3
- package/dist/commands/templates.js.map +1 -1
- package/dist/commands/transactional-templates.d.ts +5 -0
- package/dist/commands/transactional-templates.d.ts.map +1 -0
- package/dist/commands/transactional-templates.js +354 -0
- package/dist/commands/transactional-templates.js.map +1 -0
- package/dist/types/profile.d.ts +92 -0
- package/dist/types/profile.d.ts.map +1 -0
- package/dist/types/profile.js +119 -0
- package/dist/types/profile.js.map +1 -0
- package/dist/utils/auth.d.ts +33 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +226 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/config-file.d.ts +99 -0
- package/dist/utils/config-file.d.ts.map +1 -0
- package/dist/utils/config-file.js +259 -0
- package/dist/utils/config-file.js.map +1 -0
- package/dist/utils/config.d.ts +13 -2
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +82 -8
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/confirm.d.ts +38 -0
- package/dist/utils/confirm.d.ts.map +1 -0
- package/dist/utils/confirm.js +124 -0
- package/dist/utils/confirm.js.map +1 -0
- package/dist/utils/defaults.d.ts +39 -0
- package/dist/utils/defaults.d.ts.map +1 -0
- package/dist/utils/defaults.js +195 -0
- package/dist/utils/defaults.js.map +1 -0
- package/dist/utils/errors.d.ts +67 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +395 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/interactive.d.ts +97 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/interactive.js +265 -0
- package/dist/utils/interactive.js.map +1 -0
- package/dist/utils/list-defaults.d.ts +33 -0
- package/dist/utils/list-defaults.d.ts.map +1 -0
- package/dist/utils/list-defaults.js +52 -0
- package/dist/utils/list-defaults.js.map +1 -0
- package/dist/utils/output.d.ts +72 -2
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +407 -38
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/progress.d.ts +139 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +216 -0
- package/dist/utils/progress.js.map +1 -0
- package/package.json +19 -3
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { displayError, validate } from '../utils/errors.js';
|
|
4
|
+
import { confirmDelete } from '../utils/confirm.js';
|
|
5
|
+
import { autoDetectList } from '../utils/defaults.js';
|
|
6
|
+
export function createTransactionalTemplatesCommand(client, formatter) {
|
|
7
|
+
const templates = new Command('transactional-templates')
|
|
8
|
+
.description('Manage transactional email templates');
|
|
9
|
+
// List transactional templates
|
|
10
|
+
templates
|
|
11
|
+
.command('list [list-id]')
|
|
12
|
+
.description('List transactional email templates (auto-detects if only one list exists)')
|
|
13
|
+
.option('-p, --page <number>', 'Page number')
|
|
14
|
+
.option('--per-page <number>', 'Results per page')
|
|
15
|
+
.option('--with-count', 'Include total count')
|
|
16
|
+
.action(async (listId, options) => {
|
|
17
|
+
// Auto-detect list ID if not provided
|
|
18
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
19
|
+
if (!detectedListId) {
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
const spinner = ora('Fetching transactional templates...').start();
|
|
23
|
+
try {
|
|
24
|
+
const params = {
|
|
25
|
+
listId: detectedListId
|
|
26
|
+
};
|
|
27
|
+
if (options.page)
|
|
28
|
+
params.page = parseInt(options.page);
|
|
29
|
+
if (options.perPage)
|
|
30
|
+
params.perPage = parseInt(options.perPage);
|
|
31
|
+
if (options.withCount)
|
|
32
|
+
params.withCount = true;
|
|
33
|
+
const data = await client.sdk.transactionalEmailService.listTransactionalEmailTemplates(params);
|
|
34
|
+
spinner.stop();
|
|
35
|
+
formatter.output(data);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
spinner.stop();
|
|
39
|
+
displayError(error, {
|
|
40
|
+
command: 'transactional-templates list',
|
|
41
|
+
operation: 'list templates'
|
|
42
|
+
});
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
// Show transactional template
|
|
47
|
+
templates
|
|
48
|
+
.command('show [list-id] <template-id>')
|
|
49
|
+
.description('Show transactional email template details (auto-detects if only one list exists)')
|
|
50
|
+
.action(async (listId, templateId) => {
|
|
51
|
+
// Auto-detect list ID if not provided
|
|
52
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
53
|
+
if (!detectedListId) {
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
const spinner = ora(`Fetching template ${templateId}...`).start();
|
|
57
|
+
try {
|
|
58
|
+
const data = await client.sdk.transactionalEmailService.showTransactionalEmailTemplate({
|
|
59
|
+
listId: detectedListId,
|
|
60
|
+
transactionalEmailTemplateId: parseInt(templateId)
|
|
61
|
+
});
|
|
62
|
+
spinner.stop();
|
|
63
|
+
formatter.output(data);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
spinner.stop();
|
|
67
|
+
displayError(error, {
|
|
68
|
+
command: 'transactional-templates show',
|
|
69
|
+
resource: 'template',
|
|
70
|
+
resourceId: templateId,
|
|
71
|
+
operation: 'fetch'
|
|
72
|
+
});
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
// Create transactional template
|
|
77
|
+
templates
|
|
78
|
+
.command('create [list-id]')
|
|
79
|
+
.description('Create a transactional email template (auto-detects if only one list exists)')
|
|
80
|
+
.requiredOption('-n, --name <name>', 'Template name')
|
|
81
|
+
.requiredOption('-s, --subject <subject>', 'Email subject')
|
|
82
|
+
.requiredOption('--html <html>', 'HTML content')
|
|
83
|
+
.option('--text <text>', 'Plain text content')
|
|
84
|
+
.option('--sender-id <id>', 'Sender ID')
|
|
85
|
+
.option('--tracking <tracking>', 'Tracking settings (open, click)')
|
|
86
|
+
.action(async (listId, options) => {
|
|
87
|
+
// Auto-detect list ID if not provided
|
|
88
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
89
|
+
if (!detectedListId) {
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
const spinner = ora('Creating transactional template...').start();
|
|
93
|
+
try {
|
|
94
|
+
const payload = {
|
|
95
|
+
name: options.name,
|
|
96
|
+
subject: options.subject,
|
|
97
|
+
html: options.html
|
|
98
|
+
};
|
|
99
|
+
if (options.text)
|
|
100
|
+
payload.text = options.text;
|
|
101
|
+
if (options.senderId)
|
|
102
|
+
payload.sender_id = parseInt(options.senderId);
|
|
103
|
+
if (options.tracking)
|
|
104
|
+
payload.tracking = options.tracking;
|
|
105
|
+
const data = await client.sdk.transactionalEmailService.createTransactionalEmailTemplate({
|
|
106
|
+
listId: detectedListId,
|
|
107
|
+
requestBody: payload
|
|
108
|
+
});
|
|
109
|
+
spinner.stop();
|
|
110
|
+
formatter.success('Transactional template created successfully');
|
|
111
|
+
formatter.output(data);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
spinner.stop();
|
|
115
|
+
displayError(error, {
|
|
116
|
+
command: 'transactional-templates create',
|
|
117
|
+
operation: 'create template'
|
|
118
|
+
});
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
// Update transactional template
|
|
123
|
+
templates
|
|
124
|
+
.command('update [list-id] <template-id>')
|
|
125
|
+
.description('Update a transactional email template (auto-detects if only one list exists)')
|
|
126
|
+
.option('-n, --name <name>', 'Template name')
|
|
127
|
+
.option('-s, --subject <subject>', 'Email subject')
|
|
128
|
+
.option('--html <html>', 'HTML content')
|
|
129
|
+
.option('--text <text>', 'Plain text content')
|
|
130
|
+
.option('--sender-id <id>', 'Sender ID')
|
|
131
|
+
.option('--tracking <tracking>', 'Tracking settings')
|
|
132
|
+
.action(async (listId, templateId, options) => {
|
|
133
|
+
// Auto-detect list ID if not provided
|
|
134
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
135
|
+
if (!detectedListId) {
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}
|
|
138
|
+
const spinner = ora(`Updating template ${templateId}...`).start();
|
|
139
|
+
try {
|
|
140
|
+
const payload = {};
|
|
141
|
+
if (options.name)
|
|
142
|
+
payload.name = options.name;
|
|
143
|
+
if (options.subject)
|
|
144
|
+
payload.subject = options.subject;
|
|
145
|
+
if (options.html)
|
|
146
|
+
payload.html = options.html;
|
|
147
|
+
if (options.text)
|
|
148
|
+
payload.text = options.text;
|
|
149
|
+
if (options.senderId)
|
|
150
|
+
payload.sender_id = parseInt(options.senderId);
|
|
151
|
+
if (options.tracking)
|
|
152
|
+
payload.tracking = options.tracking;
|
|
153
|
+
const data = await client.sdk.transactionalEmailService.updateTransactionalEmailTemplate({
|
|
154
|
+
listId: detectedListId,
|
|
155
|
+
transactionalEmailTemplateId: parseInt(templateId),
|
|
156
|
+
requestBody: payload
|
|
157
|
+
});
|
|
158
|
+
spinner.stop();
|
|
159
|
+
formatter.success('Template updated successfully');
|
|
160
|
+
formatter.output(data);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
spinner.stop();
|
|
164
|
+
displayError(error, {
|
|
165
|
+
command: 'transactional-templates update',
|
|
166
|
+
resource: 'template',
|
|
167
|
+
resourceId: templateId,
|
|
168
|
+
operation: 'update'
|
|
169
|
+
});
|
|
170
|
+
process.exit(1);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
// Delete transactional template
|
|
174
|
+
templates
|
|
175
|
+
.command('delete [list-id] <template-id>')
|
|
176
|
+
.description('Delete a transactional email template (auto-detects if only one list exists)')
|
|
177
|
+
.option('-f, --force', 'Skip confirmation prompt')
|
|
178
|
+
.action(async (listId, templateId, options) => {
|
|
179
|
+
// Auto-detect list ID if not provided
|
|
180
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
181
|
+
if (!detectedListId) {
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
// Interactive confirmation (unless --force is used)
|
|
185
|
+
if (!options.force) {
|
|
186
|
+
const confirmed = await confirmDelete('transactional template', templateId, [
|
|
187
|
+
'Template will be permanently deleted',
|
|
188
|
+
'This action cannot be undone'
|
|
189
|
+
]);
|
|
190
|
+
if (!confirmed) {
|
|
191
|
+
formatter.info('Deletion cancelled');
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const spinner = ora(`Deleting template ${templateId}...`).start();
|
|
196
|
+
try {
|
|
197
|
+
await client.sdk.transactionalEmailService.deleteTransactionalEmailTemplate({
|
|
198
|
+
listId: detectedListId,
|
|
199
|
+
transactionalEmailTemplateId: parseInt(templateId)
|
|
200
|
+
});
|
|
201
|
+
spinner.stop();
|
|
202
|
+
formatter.success('Template deleted successfully');
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
spinner.stop();
|
|
206
|
+
displayError(error, {
|
|
207
|
+
command: 'transactional-templates delete',
|
|
208
|
+
resource: 'template',
|
|
209
|
+
resourceId: templateId,
|
|
210
|
+
operation: 'delete'
|
|
211
|
+
});
|
|
212
|
+
process.exit(1);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
// Send transactional email
|
|
216
|
+
templates
|
|
217
|
+
.command('send [list-id] <template-id>')
|
|
218
|
+
.description('Send a transactional email from template (auto-detects if only one list exists)')
|
|
219
|
+
.option('-c, --contact-id <id>', 'Contact ID to send to')
|
|
220
|
+
.option('-e, --email <email>', 'Email address to send to (alternative to contact-id)')
|
|
221
|
+
.option('--variables <json>', 'Template variables as JSON')
|
|
222
|
+
.action(async (listId, templateId, options) => {
|
|
223
|
+
// Auto-detect list ID if not provided
|
|
224
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
225
|
+
if (!detectedListId) {
|
|
226
|
+
process.exit(1);
|
|
227
|
+
}
|
|
228
|
+
// Validate that either contact-id or email is provided
|
|
229
|
+
if (!options.contactId && !options.email) {
|
|
230
|
+
formatter.error('Either --contact-id or --email is required');
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
const spinner = ora('Sending transactional email...').start();
|
|
234
|
+
try {
|
|
235
|
+
const payload = {};
|
|
236
|
+
if (options.contactId) {
|
|
237
|
+
payload.contact_id = parseInt(options.contactId);
|
|
238
|
+
}
|
|
239
|
+
else if (options.email) {
|
|
240
|
+
payload.email = options.email;
|
|
241
|
+
}
|
|
242
|
+
if (options.variables) {
|
|
243
|
+
payload.variables = JSON.parse(options.variables);
|
|
244
|
+
}
|
|
245
|
+
const data = await client.sdk.transactionalEmailService.sendTransactionalEmail({
|
|
246
|
+
listId: detectedListId,
|
|
247
|
+
transactionalEmailTemplateId: parseInt(templateId),
|
|
248
|
+
requestBody: payload
|
|
249
|
+
});
|
|
250
|
+
spinner.stop();
|
|
251
|
+
formatter.success('Transactional email sent successfully');
|
|
252
|
+
formatter.output(data);
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
spinner.stop();
|
|
256
|
+
displayError(error, {
|
|
257
|
+
command: 'transactional-templates send',
|
|
258
|
+
resource: 'template',
|
|
259
|
+
resourceId: templateId,
|
|
260
|
+
operation: 'send email'
|
|
261
|
+
});
|
|
262
|
+
process.exit(1);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
// Send test email
|
|
266
|
+
templates
|
|
267
|
+
.command('test [list-id] <template-id>')
|
|
268
|
+
.description('Send a test transactional email (auto-detects if only one list exists)')
|
|
269
|
+
.requiredOption('-e, --email <email>', 'Email address to send test to')
|
|
270
|
+
.option('--variables <json>', 'Template variables as JSON')
|
|
271
|
+
.action(async (listId, templateId, options) => {
|
|
272
|
+
// Auto-detect list ID if not provided
|
|
273
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
274
|
+
if (!detectedListId) {
|
|
275
|
+
process.exit(1);
|
|
276
|
+
}
|
|
277
|
+
// Validate email
|
|
278
|
+
const emailValidation = validate.email(options.email);
|
|
279
|
+
if (!emailValidation.valid) {
|
|
280
|
+
formatter.error(emailValidation.error);
|
|
281
|
+
process.exit(1);
|
|
282
|
+
}
|
|
283
|
+
const spinner = ora('Sending test email...').start();
|
|
284
|
+
try {
|
|
285
|
+
const payload = {
|
|
286
|
+
email: options.email
|
|
287
|
+
};
|
|
288
|
+
if (options.variables) {
|
|
289
|
+
payload.variables = JSON.parse(options.variables);
|
|
290
|
+
}
|
|
291
|
+
const data = await client.sdk.transactionalEmailService.sendTestTransactionalEmail({
|
|
292
|
+
listId: detectedListId,
|
|
293
|
+
transactionalEmailTemplateId: parseInt(templateId),
|
|
294
|
+
requestBody: payload
|
|
295
|
+
});
|
|
296
|
+
spinner.stop();
|
|
297
|
+
formatter.success(`Test email sent to ${options.email}`);
|
|
298
|
+
formatter.output(data);
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
spinner.stop();
|
|
302
|
+
displayError(error, {
|
|
303
|
+
command: 'transactional-templates test',
|
|
304
|
+
resource: 'template',
|
|
305
|
+
resourceId: templateId,
|
|
306
|
+
operation: 'send test'
|
|
307
|
+
});
|
|
308
|
+
process.exit(1);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
// Render template
|
|
312
|
+
templates
|
|
313
|
+
.command('render [list-id] <template-id>')
|
|
314
|
+
.description('Render a transactional email template (auto-detects if only one list exists)')
|
|
315
|
+
.option('-c, --contact-id <id>', 'Contact ID for personalization')
|
|
316
|
+
.option('--variables <json>', 'Template variables as JSON')
|
|
317
|
+
.action(async (listId, templateId, options) => {
|
|
318
|
+
// Auto-detect list ID if not provided
|
|
319
|
+
const detectedListId = await autoDetectList(client, formatter, listId, { useCache: true });
|
|
320
|
+
if (!detectedListId) {
|
|
321
|
+
process.exit(1);
|
|
322
|
+
}
|
|
323
|
+
const spinner = ora('Rendering template...').start();
|
|
324
|
+
try {
|
|
325
|
+
const payload = {};
|
|
326
|
+
if (options.contactId) {
|
|
327
|
+
payload.contact_id = parseInt(options.contactId);
|
|
328
|
+
}
|
|
329
|
+
if (options.variables) {
|
|
330
|
+
payload.variables = JSON.parse(options.variables);
|
|
331
|
+
}
|
|
332
|
+
const html = await client.sdk.transactionalEmailService.renderTransactionalEmailTemplate({
|
|
333
|
+
listId: detectedListId,
|
|
334
|
+
transactionalEmailTemplateId: parseInt(templateId),
|
|
335
|
+
requestBody: payload
|
|
336
|
+
});
|
|
337
|
+
spinner.stop();
|
|
338
|
+
formatter.success('Template rendered successfully');
|
|
339
|
+
console.log(html);
|
|
340
|
+
}
|
|
341
|
+
catch (error) {
|
|
342
|
+
spinner.stop();
|
|
343
|
+
displayError(error, {
|
|
344
|
+
command: 'transactional-templates render',
|
|
345
|
+
resource: 'template',
|
|
346
|
+
resourceId: templateId,
|
|
347
|
+
operation: 'render'
|
|
348
|
+
});
|
|
349
|
+
process.exit(1);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
return templates;
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=transactional-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactional-templates.js","sourceRoot":"","sources":["../../src/commands/transactional-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAA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CAAgC,CAAC;gBACvF,MAAM,EAAE,cAAc;gBACtB,4BAA4B,EAAE,QAAQ,CAAC,UAAU,CAAC;gBAClD,WAAW,EAAE,OAAO;aACrB,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,SAAS,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;YACpD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,YAAY,CAAC,KAAK,EAAE;gBAClB,OAAO,EAAE,gCAAgC;gBACzC,QAAQ,EAAE,UAAU;gBACpB,UAAU,EAAE,UAAU;gBACtB,SAAS,EAAE,QAAQ;aACpB,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile System Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the profile-based UX system that adapts CLI behavior
|
|
5
|
+
* based on user type (developer vs marketer vs balanced)
|
|
6
|
+
*/
|
|
7
|
+
export type ProfileType = 'developer' | 'marketer' | 'balanced';
|
|
8
|
+
export type OutputFormat = 'json' | 'table' | 'compact';
|
|
9
|
+
export type ColorScheme = 'none' | 'minimal' | 'moderate' | 'rich';
|
|
10
|
+
export type DateFormat = 'iso8601' | 'friendly' | 'relative';
|
|
11
|
+
export type InteractiveMode = boolean | 'auto';
|
|
12
|
+
/**
|
|
13
|
+
* Output configuration for profile
|
|
14
|
+
*/
|
|
15
|
+
export interface OutputConfig {
|
|
16
|
+
/** Output format: json, table, or compact */
|
|
17
|
+
format: OutputFormat;
|
|
18
|
+
/** Color scheme: none, minimal, moderate, or rich */
|
|
19
|
+
colors: ColorScheme;
|
|
20
|
+
/** Pretty-print JSON output */
|
|
21
|
+
pretty_print: boolean;
|
|
22
|
+
/** Show tips and hints */
|
|
23
|
+
show_tips: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Behavior configuration for profile
|
|
27
|
+
*/
|
|
28
|
+
export interface BehaviorConfig {
|
|
29
|
+
/** Enable interactive prompts for missing fields */
|
|
30
|
+
interactive_prompts: InteractiveMode;
|
|
31
|
+
/** Require confirmation for destructive operations */
|
|
32
|
+
confirm_destructive: boolean;
|
|
33
|
+
/** Auto-open browser for preview commands */
|
|
34
|
+
auto_open_browser: boolean;
|
|
35
|
+
/** Show progress indicators */
|
|
36
|
+
show_progress: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Display configuration for profile
|
|
40
|
+
*/
|
|
41
|
+
export interface DisplayConfig {
|
|
42
|
+
/** Date format: iso8601, friendly, or relative */
|
|
43
|
+
date_format: DateFormat;
|
|
44
|
+
/** Show IDs in output */
|
|
45
|
+
show_ids: boolean;
|
|
46
|
+
/** Show API details in errors */
|
|
47
|
+
show_api_details: boolean;
|
|
48
|
+
/** Verbose error messages with technical details */
|
|
49
|
+
verbose_errors: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Complete profile configuration
|
|
53
|
+
*/
|
|
54
|
+
export interface ProfileConfig {
|
|
55
|
+
output: OutputConfig;
|
|
56
|
+
behavior: BehaviorConfig;
|
|
57
|
+
display: DisplayConfig;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Developer profile: JSON output, minimal interactivity, scriptable
|
|
61
|
+
*/
|
|
62
|
+
export declare const DEVELOPER_PROFILE: ProfileConfig;
|
|
63
|
+
/**
|
|
64
|
+
* Marketer profile: Compact output, rich interactivity, guided workflows
|
|
65
|
+
*/
|
|
66
|
+
export declare const MARKETER_PROFILE: ProfileConfig;
|
|
67
|
+
/**
|
|
68
|
+
* Balanced profile: Mix of both workflows, context-dependent
|
|
69
|
+
*/
|
|
70
|
+
export declare const BALANCED_PROFILE: ProfileConfig;
|
|
71
|
+
/**
|
|
72
|
+
* Get default profile configuration by type
|
|
73
|
+
*/
|
|
74
|
+
export declare function getDefaultProfile(type: ProfileType): ProfileConfig;
|
|
75
|
+
/**
|
|
76
|
+
* Profile descriptions for display in prompts
|
|
77
|
+
*/
|
|
78
|
+
export declare const PROFILE_DESCRIPTIONS: {
|
|
79
|
+
developer: {
|
|
80
|
+
name: string;
|
|
81
|
+
description: string[];
|
|
82
|
+
};
|
|
83
|
+
marketer: {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string[];
|
|
86
|
+
};
|
|
87
|
+
balanced: {
|
|
88
|
+
name: string;
|
|
89
|
+
description: string[];
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/types/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAEnE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,MAAM,EAAE,YAAY,CAAC;IAErB,qDAAqD;IACrD,MAAM,EAAE,WAAW,CAAC;IAEpB,+BAA+B;IAC/B,YAAY,EAAE,OAAO,CAAC;IAEtB,0BAA0B;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,mBAAmB,EAAE,eAAe,CAAC;IAErC,sDAAsD;IACtD,mBAAmB,EAAE,OAAO,CAAC;IAE7B,6CAA6C;IAC7C,iBAAiB,EAAE,OAAO,CAAC;IAE3B,+BAA+B;IAC/B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,WAAW,EAAE,UAAU,CAAC;IAExB,yBAAyB;IACzB,QAAQ,EAAE,OAAO,CAAC;IAElB,iCAAiC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAE1B,oDAAoD;IACpD,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAmB/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAmB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAmB9B,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAWlE;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;CAwBhC,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile System Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the profile-based UX system that adapts CLI behavior
|
|
5
|
+
* based on user type (developer vs marketer vs balanced)
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Developer profile: JSON output, minimal interactivity, scriptable
|
|
9
|
+
*/
|
|
10
|
+
export const DEVELOPER_PROFILE = {
|
|
11
|
+
output: {
|
|
12
|
+
format: 'json',
|
|
13
|
+
colors: 'minimal',
|
|
14
|
+
pretty_print: false,
|
|
15
|
+
show_tips: false,
|
|
16
|
+
},
|
|
17
|
+
behavior: {
|
|
18
|
+
interactive_prompts: false,
|
|
19
|
+
confirm_destructive: false,
|
|
20
|
+
auto_open_browser: false,
|
|
21
|
+
show_progress: false,
|
|
22
|
+
},
|
|
23
|
+
display: {
|
|
24
|
+
date_format: 'iso8601',
|
|
25
|
+
show_ids: true,
|
|
26
|
+
show_api_details: true,
|
|
27
|
+
verbose_errors: true,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Marketer profile: Compact output, rich interactivity, guided workflows
|
|
32
|
+
*/
|
|
33
|
+
export const MARKETER_PROFILE = {
|
|
34
|
+
output: {
|
|
35
|
+
format: 'compact',
|
|
36
|
+
colors: 'rich',
|
|
37
|
+
pretty_print: true,
|
|
38
|
+
show_tips: true,
|
|
39
|
+
},
|
|
40
|
+
behavior: {
|
|
41
|
+
interactive_prompts: true,
|
|
42
|
+
confirm_destructive: true,
|
|
43
|
+
auto_open_browser: true,
|
|
44
|
+
show_progress: true,
|
|
45
|
+
},
|
|
46
|
+
display: {
|
|
47
|
+
date_format: 'relative',
|
|
48
|
+
show_ids: false,
|
|
49
|
+
show_api_details: false,
|
|
50
|
+
verbose_errors: false,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Balanced profile: Mix of both workflows, context-dependent
|
|
55
|
+
*/
|
|
56
|
+
export const BALANCED_PROFILE = {
|
|
57
|
+
output: {
|
|
58
|
+
format: 'table',
|
|
59
|
+
colors: 'moderate',
|
|
60
|
+
pretty_print: true,
|
|
61
|
+
show_tips: true,
|
|
62
|
+
},
|
|
63
|
+
behavior: {
|
|
64
|
+
interactive_prompts: 'auto',
|
|
65
|
+
confirm_destructive: true,
|
|
66
|
+
auto_open_browser: false,
|
|
67
|
+
show_progress: true,
|
|
68
|
+
},
|
|
69
|
+
display: {
|
|
70
|
+
date_format: 'friendly',
|
|
71
|
+
show_ids: true,
|
|
72
|
+
show_api_details: false,
|
|
73
|
+
verbose_errors: false,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Get default profile configuration by type
|
|
78
|
+
*/
|
|
79
|
+
export function getDefaultProfile(type) {
|
|
80
|
+
switch (type) {
|
|
81
|
+
case 'developer':
|
|
82
|
+
return DEVELOPER_PROFILE;
|
|
83
|
+
case 'marketer':
|
|
84
|
+
return MARKETER_PROFILE;
|
|
85
|
+
case 'balanced':
|
|
86
|
+
return BALANCED_PROFILE;
|
|
87
|
+
default:
|
|
88
|
+
return BALANCED_PROFILE;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Profile descriptions for display in prompts
|
|
93
|
+
*/
|
|
94
|
+
export const PROFILE_DESCRIPTIONS = {
|
|
95
|
+
developer: {
|
|
96
|
+
name: '👨💻 Developer/Technical user',
|
|
97
|
+
description: [
|
|
98
|
+
'Scripting and automation',
|
|
99
|
+
'JSON output and piping',
|
|
100
|
+
'Minimal interactivity',
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
marketer: {
|
|
104
|
+
name: '📊 Marketer/Business user',
|
|
105
|
+
description: [
|
|
106
|
+
'Campaign management',
|
|
107
|
+
'Visual formatting and guides',
|
|
108
|
+
'Interactive workflows',
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
balanced: {
|
|
112
|
+
name: '🔄 Both/Balanced',
|
|
113
|
+
description: [
|
|
114
|
+
'Mix of technical and business tasks',
|
|
115
|
+
'Flexible workflow',
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/types/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwEH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC9C,MAAM,EAAE;QACN,MAAM,EA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U,iBAAiB,CAAC,IAAiB;IACjD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW;YACd,OAAO,iBAAiB,CAAC;QAC3B,KAAK,UAAU;YACb,OAAO,gBAAgB,CAAC;QAC1B,KAAK,UAAU;YACb,OAAO,gBAAgB,CAAC;QAC1B;YACE,OAAO,gBAAgB,CAAC;IAC5B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE;QACT,IAAI,EAAE,gCAAgC;QACtC,WAAW,EAAE;YACX,0BAA0B;YAC1B,wBAAwB;YACxB,uBAAuB;SACxB;KACF;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE;YACX,qBAAqB;YACrB,8BAA8B;YAC9B,uBAAuB;SACxB;KACF;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE;YACX,qCAAqC;YACrC,mBAAmB;SACpB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ProfileType } from '../types/profile.js';
|
|
2
|
+
export interface Credentials {
|
|
3
|
+
email: string;
|
|
4
|
+
password: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Prompts the user to select their profile type
|
|
8
|
+
*/
|
|
9
|
+
export declare function promptForProfile(): Promise<ProfileType>;
|
|
10
|
+
/**
|
|
11
|
+
* Prompts the user for their Cakemail credentials
|
|
12
|
+
*/
|
|
13
|
+
export declare function promptForCredentials(): Promise<Credentials>;
|
|
14
|
+
/**
|
|
15
|
+
* Tests credentials by attempting to authenticate with the API
|
|
16
|
+
* Returns token information if successful
|
|
17
|
+
*/
|
|
18
|
+
export declare function testCredentials(email: string, password: string): Promise<{
|
|
19
|
+
valid: boolean;
|
|
20
|
+
accessToken?: string;
|
|
21
|
+
refreshToken?: string;
|
|
22
|
+
expiresIn?: number;
|
|
23
|
+
accounts?: number[];
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Saves credentials to .env file in current working directory
|
|
27
|
+
*/
|
|
28
|
+
export declare function saveCredentials(email: string, password: string, accountId?: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Interactive authentication flow - prompts for credentials and saves them
|
|
31
|
+
*/
|
|
32
|
+
export declare function authenticateInteractively(): Promise<Credentials>;
|
|
33
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAGxE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,WAAW,CAAC,CA2B7D;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,WAAW,CAAC,CAkCjE;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9E,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC,CAoCD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAkCzF;AAED;;GAEG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,WAAW,CAAC,CAiGtE"}
|