@mailmodo/cli 0.0.20-beta.pr23.33 → 0.0.20
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.
|
@@ -52,7 +52,7 @@ export default class Settings extends BaseCommand {
|
|
|
52
52
|
const key = flags.set.slice(0, eqIndex).trim();
|
|
53
53
|
const propKey = settingKeyToProp(key);
|
|
54
54
|
const value = flags.set.slice(eqIndex + 1).trim();
|
|
55
|
-
if (!(propKey in project)
|
|
55
|
+
if (!(propKey in project)) {
|
|
56
56
|
this.error(`Unknown setting: ${key}`);
|
|
57
57
|
}
|
|
58
58
|
project[propKey] =
|
|
@@ -73,11 +73,7 @@ export default class Settings extends BaseCommand {
|
|
|
73
73
|
const domainVerified = await this.fetchDomainVerified(project.domain);
|
|
74
74
|
this.log(`\n Current settings for ${chalk.bold(project.name || 'project')}:\n`);
|
|
75
75
|
for (const [group, keys] of Object.entries(SETTINGS_GROUPS)) {
|
|
76
|
-
const availableKeys = keys.filter((key) =>
|
|
77
|
-
if (group === 'brand' && key === 'logo_file')
|
|
78
|
-
return true;
|
|
79
|
-
return settingKeyToProp(key) in project;
|
|
80
|
-
});
|
|
76
|
+
const availableKeys = keys.filter((key) => settingKeyToProp(key) in project);
|
|
81
77
|
if (availableKeys.length === 0) {
|
|
82
78
|
const hint = SETUP_HINTS[settingKeyToProp(keys[0])];
|
|
83
79
|
if (hint) {
|
|
@@ -102,8 +98,7 @@ export default class Settings extends BaseCommand {
|
|
|
102
98
|
}
|
|
103
99
|
this.log(` ${key.padEnd(16)} ${displayValue}`);
|
|
104
100
|
}
|
|
105
|
-
const missingKeys = keys.filter((key) => !(settingKeyToProp(key) in project)
|
|
106
|
-
!(group === 'brand' && key === 'logo_file'));
|
|
101
|
+
const missingKeys = keys.filter((key) => !(settingKeyToProp(key) in project));
|
|
107
102
|
for (const key of missingKeys) {
|
|
108
103
|
const hint = SETUP_HINTS[settingKeyToProp(key)];
|
|
109
104
|
if (hint) {
|
|
@@ -130,10 +125,6 @@ export default class Settings extends BaseCommand {
|
|
|
130
125
|
return;
|
|
131
126
|
const editPropKey = settingKeyToProp(editKey);
|
|
132
127
|
if (!(editPropKey in project)) {
|
|
133
|
-
if (editKey === 'logo_file') {
|
|
134
|
-
await this.handleLogoUpload(yamlConfig);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
128
|
const hint = SETUP_HINTS[editPropKey];
|
|
138
129
|
if (hint) {
|
|
139
130
|
this.log(`\n ${editKey} is not configured yet. Run ${chalk.cyan(hint)} to set it up.\n`);
|
|
@@ -261,16 +252,8 @@ export default class Settings extends BaseCommand {
|
|
|
261
252
|
}
|
|
262
253
|
await this.ensureAuth();
|
|
263
254
|
const fileBuffer = await readFile(resolvedPath);
|
|
264
|
-
const ext = resolvedPath.split('.').pop()?.toLowerCase();
|
|
265
|
-
const mimeTypes = {
|
|
266
|
-
png: 'image/png',
|
|
267
|
-
jpg: 'image/jpeg',
|
|
268
|
-
jpeg: 'image/jpeg',
|
|
269
|
-
svg: 'image/svg+xml',
|
|
270
|
-
};
|
|
271
|
-
const mimeType = mimeTypes[ext ?? ''] ?? 'application/octet-stream';
|
|
272
255
|
const formData = new FormData();
|
|
273
|
-
formData.append('logo', new Blob([new Uint8Array(fileBuffer)]
|
|
256
|
+
formData.append('logo', new Blob([new Uint8Array(fileBuffer)]), logoPath.split(/[/\\]/).pop() || 'logo.png');
|
|
274
257
|
const response = await this.apiClient.postFormData(API_ENDPOINTS.ASSETS_LOGO, formData);
|
|
275
258
|
if (!response.ok) {
|
|
276
259
|
this.handleApiError(response);
|
package/oclif.manifest.json
CHANGED