@mailmodo/cli 0.0.29-beta.pr31.48 → 0.0.29-beta.pr31.49
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/api-client.d.ts +2 -0
- package/dist/lib/api-client.js +20 -2
- package/dist/lib/base-command.js +5 -5
- package/oclif.manifest.json +82 -82
- package/package.json +1 -1
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface ApiRequestDebugInfo {
|
|
|
12
12
|
responseSummary?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface ApiResponse<T = Record<string, unknown>> {
|
|
15
|
+
/** Warning string from the API when the user's card is expiring or has issues. */
|
|
16
|
+
addCardWarning?: string;
|
|
15
17
|
data: T;
|
|
16
18
|
/** Populated for tracing; especially useful when `ok` is false. */
|
|
17
19
|
debug?: ApiRequestDebugInfo;
|
package/dist/lib/api-client.js
CHANGED
|
@@ -14,6 +14,12 @@ import { fetchFileNoAuth, fetchFileWithBearerAuth, } from './fetch-file.js';
|
|
|
14
14
|
* indicating the API may not be available, rather than a raw stack trace.
|
|
15
15
|
*/
|
|
16
16
|
const RESPONSE_BODY_DEBUG_MAX = 800;
|
|
17
|
+
function extractAddCardWarning(data) {
|
|
18
|
+
const raw = data;
|
|
19
|
+
return typeof raw.addCardWarning === 'string'
|
|
20
|
+
? raw.addCardWarning
|
|
21
|
+
: undefined;
|
|
22
|
+
}
|
|
17
23
|
function summarizeResponseBody(data) {
|
|
18
24
|
if (data === null || data === undefined)
|
|
19
25
|
return undefined;
|
|
@@ -90,7 +96,13 @@ export class ApiClient {
|
|
|
90
96
|
status: response.status,
|
|
91
97
|
};
|
|
92
98
|
}
|
|
93
|
-
|
|
99
|
+
const addCardWarning = extractAddCardWarning(data);
|
|
100
|
+
return {
|
|
101
|
+
...(addCardWarning === undefined ? {} : { addCardWarning }),
|
|
102
|
+
data: data,
|
|
103
|
+
ok: true,
|
|
104
|
+
status: response.status,
|
|
105
|
+
};
|
|
94
106
|
}
|
|
95
107
|
catch (error) {
|
|
96
108
|
const err = error;
|
|
@@ -164,7 +176,13 @@ export class ApiClient {
|
|
|
164
176
|
status: response.status,
|
|
165
177
|
};
|
|
166
178
|
}
|
|
167
|
-
|
|
179
|
+
const addCardWarning = extractAddCardWarning(data);
|
|
180
|
+
return {
|
|
181
|
+
...(addCardWarning === undefined ? {} : { addCardWarning }),
|
|
182
|
+
data: data,
|
|
183
|
+
ok: true,
|
|
184
|
+
status: response.status,
|
|
185
|
+
};
|
|
168
186
|
}
|
|
169
187
|
catch (error) {
|
|
170
188
|
const err = error;
|
package/dist/lib/base-command.js
CHANGED
|
@@ -63,12 +63,12 @@ export class BaseCommand extends Command {
|
|
|
63
63
|
color: 'cyan',
|
|
64
64
|
text: options.text,
|
|
65
65
|
}).start();
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
spinner.stop();
|
|
66
|
+
const result = await work().finally(() => spinner.stop());
|
|
67
|
+
const warning = result.addCardWarning;
|
|
68
|
+
if (typeof warning === 'string' && warning) {
|
|
69
|
+
this.warn(warning);
|
|
71
70
|
}
|
|
71
|
+
return result;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Loads and returns the mailmodo.yaml configuration from the current directory.
|
package/oclif.manifest.json
CHANGED
|
@@ -76,6 +76,67 @@
|
|
|
76
76
|
"index.js"
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
+
"contacts": {
|
|
80
|
+
"aliases": [],
|
|
81
|
+
"args": {},
|
|
82
|
+
"description": "Manage contacts — search, export, or delete",
|
|
83
|
+
"examples": [
|
|
84
|
+
"<%= config.bin %> contacts",
|
|
85
|
+
"<%= config.bin %> contacts --search sarah@example.com",
|
|
86
|
+
"<%= config.bin %> contacts --export # GDPR CSV → contacts.csv",
|
|
87
|
+
"<%= config.bin %> contacts --delete sarah@example.com"
|
|
88
|
+
],
|
|
89
|
+
"flags": {
|
|
90
|
+
"json": {
|
|
91
|
+
"description": "Output as JSON",
|
|
92
|
+
"name": "json",
|
|
93
|
+
"allowNo": false,
|
|
94
|
+
"type": "boolean"
|
|
95
|
+
},
|
|
96
|
+
"yes": {
|
|
97
|
+
"char": "y",
|
|
98
|
+
"description": "Skip confirmation prompts",
|
|
99
|
+
"name": "yes",
|
|
100
|
+
"allowNo": false,
|
|
101
|
+
"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
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"hasDynamicHelp": false,
|
|
125
|
+
"hiddenAliases": [],
|
|
126
|
+
"id": "contacts",
|
|
127
|
+
"pluginAlias": "@mailmodo/cli",
|
|
128
|
+
"pluginName": "@mailmodo/cli",
|
|
129
|
+
"pluginType": "core",
|
|
130
|
+
"strict": true,
|
|
131
|
+
"enableJsonFlag": false,
|
|
132
|
+
"isESM": true,
|
|
133
|
+
"relativePath": [
|
|
134
|
+
"dist",
|
|
135
|
+
"commands",
|
|
136
|
+
"contacts",
|
|
137
|
+
"index.js"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
79
140
|
"deploy": {
|
|
80
141
|
"aliases": [],
|
|
81
142
|
"args": {},
|
|
@@ -304,67 +365,6 @@
|
|
|
304
365
|
"index.js"
|
|
305
366
|
]
|
|
306
367
|
},
|
|
307
|
-
"contacts": {
|
|
308
|
-
"aliases": [],
|
|
309
|
-
"args": {},
|
|
310
|
-
"description": "Manage contacts — search, export, or delete",
|
|
311
|
-
"examples": [
|
|
312
|
-
"<%= config.bin %> contacts",
|
|
313
|
-
"<%= config.bin %> contacts --search sarah@example.com",
|
|
314
|
-
"<%= config.bin %> contacts --export # GDPR CSV → contacts.csv",
|
|
315
|
-
"<%= config.bin %> contacts --delete sarah@example.com"
|
|
316
|
-
],
|
|
317
|
-
"flags": {
|
|
318
|
-
"json": {
|
|
319
|
-
"description": "Output as JSON",
|
|
320
|
-
"name": "json",
|
|
321
|
-
"allowNo": false,
|
|
322
|
-
"type": "boolean"
|
|
323
|
-
},
|
|
324
|
-
"yes": {
|
|
325
|
-
"char": "y",
|
|
326
|
-
"description": "Skip confirmation prompts",
|
|
327
|
-
"name": "yes",
|
|
328
|
-
"allowNo": false,
|
|
329
|
-
"type": "boolean"
|
|
330
|
-
},
|
|
331
|
-
"delete": {
|
|
332
|
-
"description": "GDPR hard delete a contact by email",
|
|
333
|
-
"name": "delete",
|
|
334
|
-
"hasDynamicHelp": false,
|
|
335
|
-
"multiple": false,
|
|
336
|
-
"type": "option"
|
|
337
|
-
},
|
|
338
|
-
"export": {
|
|
339
|
-
"description": "Export all contacts as GDPR-compliant CSV (writes contacts.csv in the current directory)",
|
|
340
|
-
"name": "export",
|
|
341
|
-
"allowNo": false,
|
|
342
|
-
"type": "boolean"
|
|
343
|
-
},
|
|
344
|
-
"search": {
|
|
345
|
-
"description": "Search for a contact by email",
|
|
346
|
-
"name": "search",
|
|
347
|
-
"hasDynamicHelp": false,
|
|
348
|
-
"multiple": false,
|
|
349
|
-
"type": "option"
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
"hasDynamicHelp": false,
|
|
353
|
-
"hiddenAliases": [],
|
|
354
|
-
"id": "contacts",
|
|
355
|
-
"pluginAlias": "@mailmodo/cli",
|
|
356
|
-
"pluginName": "@mailmodo/cli",
|
|
357
|
-
"pluginType": "core",
|
|
358
|
-
"strict": true,
|
|
359
|
-
"enableJsonFlag": false,
|
|
360
|
-
"isESM": true,
|
|
361
|
-
"relativePath": [
|
|
362
|
-
"dist",
|
|
363
|
-
"commands",
|
|
364
|
-
"contacts",
|
|
365
|
-
"index.js"
|
|
366
|
-
]
|
|
367
|
-
},
|
|
368
368
|
"login": {
|
|
369
369
|
"aliases": [],
|
|
370
370
|
"args": {},
|
|
@@ -570,14 +570,13 @@
|
|
|
570
570
|
"index.js"
|
|
571
571
|
]
|
|
572
572
|
},
|
|
573
|
-
"
|
|
573
|
+
"status": {
|
|
574
574
|
"aliases": [],
|
|
575
575
|
"args": {},
|
|
576
|
-
"description": "View and
|
|
576
|
+
"description": "View email performance metrics and quota usage",
|
|
577
577
|
"examples": [
|
|
578
|
-
"<%= config.bin %>
|
|
579
|
-
"<%= config.bin %>
|
|
580
|
-
"<%= config.bin %> settings --json"
|
|
578
|
+
"<%= config.bin %> status",
|
|
579
|
+
"<%= config.bin %> status --json"
|
|
581
580
|
],
|
|
582
581
|
"flags": {
|
|
583
582
|
"json": {
|
|
@@ -592,18 +591,11 @@
|
|
|
592
591
|
"name": "yes",
|
|
593
592
|
"allowNo": false,
|
|
594
593
|
"type": "boolean"
|
|
595
|
-
},
|
|
596
|
-
"set": {
|
|
597
|
-
"description": "Set a setting (format: key=value)",
|
|
598
|
-
"name": "set",
|
|
599
|
-
"hasDynamicHelp": false,
|
|
600
|
-
"multiple": false,
|
|
601
|
-
"type": "option"
|
|
602
594
|
}
|
|
603
595
|
},
|
|
604
596
|
"hasDynamicHelp": false,
|
|
605
597
|
"hiddenAliases": [],
|
|
606
|
-
"id": "
|
|
598
|
+
"id": "status",
|
|
607
599
|
"pluginAlias": "@mailmodo/cli",
|
|
608
600
|
"pluginName": "@mailmodo/cli",
|
|
609
601
|
"pluginType": "core",
|
|
@@ -613,17 +605,18 @@
|
|
|
613
605
|
"relativePath": [
|
|
614
606
|
"dist",
|
|
615
607
|
"commands",
|
|
616
|
-
"
|
|
608
|
+
"status",
|
|
617
609
|
"index.js"
|
|
618
610
|
]
|
|
619
611
|
},
|
|
620
|
-
"
|
|
612
|
+
"settings": {
|
|
621
613
|
"aliases": [],
|
|
622
614
|
"args": {},
|
|
623
|
-
"description": "View
|
|
615
|
+
"description": "View and update project settings",
|
|
624
616
|
"examples": [
|
|
625
|
-
"<%= config.bin %>
|
|
626
|
-
"<%= config.bin %>
|
|
617
|
+
"<%= config.bin %> settings",
|
|
618
|
+
"<%= config.bin %> settings --set brand_color=#0F3460",
|
|
619
|
+
"<%= config.bin %> settings --json"
|
|
627
620
|
],
|
|
628
621
|
"flags": {
|
|
629
622
|
"json": {
|
|
@@ -638,11 +631,18 @@
|
|
|
638
631
|
"name": "yes",
|
|
639
632
|
"allowNo": false,
|
|
640
633
|
"type": "boolean"
|
|
634
|
+
},
|
|
635
|
+
"set": {
|
|
636
|
+
"description": "Set a setting (format: key=value)",
|
|
637
|
+
"name": "set",
|
|
638
|
+
"hasDynamicHelp": false,
|
|
639
|
+
"multiple": false,
|
|
640
|
+
"type": "option"
|
|
641
641
|
}
|
|
642
642
|
},
|
|
643
643
|
"hasDynamicHelp": false,
|
|
644
644
|
"hiddenAliases": [],
|
|
645
|
-
"id": "
|
|
645
|
+
"id": "settings",
|
|
646
646
|
"pluginAlias": "@mailmodo/cli",
|
|
647
647
|
"pluginName": "@mailmodo/cli",
|
|
648
648
|
"pluginType": "core",
|
|
@@ -652,10 +652,10 @@
|
|
|
652
652
|
"relativePath": [
|
|
653
653
|
"dist",
|
|
654
654
|
"commands",
|
|
655
|
-
"
|
|
655
|
+
"settings",
|
|
656
656
|
"index.js"
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
"version": "0.0.29-beta.pr31.
|
|
660
|
+
"version": "0.0.29-beta.pr31.49"
|
|
661
661
|
}
|
package/package.json
CHANGED