@wraps.dev/cli 2.17.9 → 2.17.12
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/cli.js +62 -37
- package/dist/cli.js.map +1 -1
- package/dist/console/assets/{index-DYY5rtzO.css → index-DF7apuYC.css} +1 -1
- package/dist/console/index.html +2 -2
- package/dist/lambda/event-processor/.bundled +1 -1
- package/dist/lambda/event-processor/index.js +3 -1
- package/dist/lambda/event-processor/index.ts +10 -1
- package/dist/lambda/inbound-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/index.js +58 -56
- package/dist/lambda/inbound-processor/index.ts +11 -2
- package/dist/lambda/sms-event-processor/.bundled +1 -1
- package/dist/lambda/sms-event-processor/index.js +3 -1
- package/dist/lambda/sms-event-processor/index.ts +10 -1
- package/package.json +3 -3
- /package/dist/console/assets/{index-Wy-UKvho.js → index-CNn3fWLq.js} +0 -0
package/dist/cli.js
CHANGED
|
@@ -5263,6 +5263,10 @@ var init_output = __esm({
|
|
|
5263
5263
|
*/
|
|
5264
5264
|
start(message) {
|
|
5265
5265
|
if (this.silent) return;
|
|
5266
|
+
if (this.currentSpinner) {
|
|
5267
|
+
this.currentSpinner.stop("");
|
|
5268
|
+
this.currentSpinner = null;
|
|
5269
|
+
}
|
|
5266
5270
|
this.currentSpinner = clack8.spinner();
|
|
5267
5271
|
this.currentSpinner.start(message);
|
|
5268
5272
|
}
|
|
@@ -23494,47 +23498,66 @@ async function pushToSES(templates, progress) {
|
|
|
23494
23498
|
UpdateTemplateCommand
|
|
23495
23499
|
} = await import("@aws-sdk/client-ses");
|
|
23496
23500
|
const ses = new SESClient6({ region });
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23501
|
+
try {
|
|
23502
|
+
progress.start(
|
|
23503
|
+
`Pushing ${templates.length} template${templates.length === 1 ? "" : "s"} to SES`
|
|
23504
|
+
);
|
|
23505
|
+
const settled = await Promise.allSettled(
|
|
23506
|
+
templates.map(async (t) => {
|
|
23507
|
+
const templateData = {
|
|
23508
|
+
TemplateName: t.sesTemplateName,
|
|
23509
|
+
SubjectPart: t.subject,
|
|
23510
|
+
HtmlPart: t.compiledHtml,
|
|
23511
|
+
TextPart: t.compiledText
|
|
23512
|
+
};
|
|
23513
|
+
let exists = false;
|
|
23514
|
+
try {
|
|
23515
|
+
await ses.send(
|
|
23516
|
+
new GetTemplateCommand({ TemplateName: t.sesTemplateName })
|
|
23517
|
+
);
|
|
23518
|
+
exists = true;
|
|
23519
|
+
} catch (err) {
|
|
23520
|
+
const e = err;
|
|
23521
|
+
if (e.name !== "TemplateDoesNotExistException") {
|
|
23522
|
+
throw err;
|
|
23523
|
+
}
|
|
23516
23524
|
}
|
|
23517
|
-
|
|
23518
|
-
|
|
23519
|
-
|
|
23525
|
+
if (exists) {
|
|
23526
|
+
await ses.send(new UpdateTemplateCommand({ Template: templateData }));
|
|
23527
|
+
} else {
|
|
23528
|
+
await ses.send(new CreateTemplateCommand({ Template: templateData }));
|
|
23529
|
+
}
|
|
23530
|
+
return { slug: t.slug };
|
|
23531
|
+
})
|
|
23532
|
+
);
|
|
23533
|
+
const failures = [];
|
|
23534
|
+
for (let i = 0; i < templates.length; i++) {
|
|
23535
|
+
const result = settled[i];
|
|
23536
|
+
if (result.status === "fulfilled") {
|
|
23537
|
+
results.push({ slug: result.value.slug, success: true });
|
|
23520
23538
|
} else {
|
|
23521
|
-
|
|
23539
|
+
const msg = result.reason instanceof Error ? result.reason.message : String(result.reason);
|
|
23540
|
+
results.push({ slug: templates[i].slug, success: false });
|
|
23541
|
+
failures.push(`${templates[i].slug}: ${msg}`);
|
|
23522
23542
|
}
|
|
23523
|
-
|
|
23524
|
-
|
|
23525
|
-
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
if (result.status === "fulfilled") {
|
|
23530
|
-
results.push({ slug: result.value.slug, success: true });
|
|
23543
|
+
}
|
|
23544
|
+
const successCount = results.filter((r) => r.success).length;
|
|
23545
|
+
if (failures.length === 0) {
|
|
23546
|
+
progress.succeed(
|
|
23547
|
+
`Pushed ${successCount} template${successCount === 1 ? "" : "s"} to SES`
|
|
23548
|
+
);
|
|
23531
23549
|
} else {
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23550
|
+
progress.succeed(
|
|
23551
|
+
`Pushed ${successCount}/${templates.length} templates to SES`
|
|
23552
|
+
);
|
|
23553
|
+
for (const f of failures) {
|
|
23554
|
+
progress.fail(`SES push failed: ${f}`);
|
|
23555
|
+
}
|
|
23535
23556
|
}
|
|
23557
|
+
return results;
|
|
23558
|
+
} finally {
|
|
23559
|
+
ses.destroy();
|
|
23536
23560
|
}
|
|
23537
|
-
return results;
|
|
23538
23561
|
}
|
|
23539
23562
|
async function fetchRemoteTemplateSlugs(token, progress) {
|
|
23540
23563
|
if (!token) {
|
|
@@ -23633,8 +23656,9 @@ async function pushToAPI(templates, token, progress, force) {
|
|
|
23633
23656
|
throw new Error(`API returned ${resp.status}: ${body}`);
|
|
23634
23657
|
}
|
|
23635
23658
|
} catch (err) {
|
|
23659
|
+
const cause = err instanceof Error && err.cause instanceof Error ? `: ${err.cause.message}` : "";
|
|
23636
23660
|
const msg = err instanceof Error ? err.message : String(err);
|
|
23637
|
-
progress.fail(`Dashboard sync failed: ${msg}`);
|
|
23661
|
+
progress.fail(`Dashboard sync failed: ${msg}${cause}`);
|
|
23638
23662
|
for (const t of templates) {
|
|
23639
23663
|
results.push({ slug: t.slug, success: false });
|
|
23640
23664
|
}
|
|
@@ -23678,9 +23702,10 @@ async function pushToAPI(templates, token, progress, force) {
|
|
|
23678
23702
|
throw new Error(`API returned ${resp.status}: ${body}`);
|
|
23679
23703
|
}
|
|
23680
23704
|
} catch (err) {
|
|
23705
|
+
const cause = err instanceof Error && err.cause instanceof Error ? `: ${err.cause.message}` : "";
|
|
23681
23706
|
const msg = err instanceof Error ? err.message : String(err);
|
|
23682
23707
|
results.push({ slug: t.slug, success: false });
|
|
23683
|
-
progress.fail(`Dashboard sync failed for ${t.slug}: ${msg}`);
|
|
23708
|
+
progress.fail(`Dashboard sync failed for ${t.slug}: ${msg}${cause}`);
|
|
23684
23709
|
}
|
|
23685
23710
|
}
|
|
23686
23711
|
return results;
|