@wraps.dev/cli 2.17.4 → 2.17.6
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
CHANGED
|
@@ -4447,6 +4447,26 @@ function applyConfigUpdates(existingConfig, updates) {
|
|
|
4447
4447
|
...result.smtpCredentials,
|
|
4448
4448
|
...value
|
|
4449
4449
|
};
|
|
4450
|
+
} else if (key === "inbound" && typeof value === "object") {
|
|
4451
|
+
result.inbound = {
|
|
4452
|
+
...result.inbound,
|
|
4453
|
+
...value
|
|
4454
|
+
};
|
|
4455
|
+
} else if (key === "alerts" && typeof value === "object") {
|
|
4456
|
+
const alertUpdate = value;
|
|
4457
|
+
result.alerts = {
|
|
4458
|
+
...result.alerts,
|
|
4459
|
+
...alertUpdate,
|
|
4460
|
+
thresholds: {
|
|
4461
|
+
...result.alerts?.thresholds,
|
|
4462
|
+
...alertUpdate.thresholds
|
|
4463
|
+
}
|
|
4464
|
+
};
|
|
4465
|
+
} else if (key === "userWebhook" && typeof value === "object") {
|
|
4466
|
+
result.userWebhook = {
|
|
4467
|
+
...result.userWebhook,
|
|
4468
|
+
...value
|
|
4469
|
+
};
|
|
4450
4470
|
} else {
|
|
4451
4471
|
result[key] = value;
|
|
4452
4472
|
}
|
|
@@ -4517,22 +4537,39 @@ function addServiceToConnection(accountId, region, provider, service, config2, p
|
|
|
4517
4537
|
}
|
|
4518
4538
|
return metadata;
|
|
4519
4539
|
}
|
|
4540
|
+
function shallowMergeWithNestedObjects(existing, updates) {
|
|
4541
|
+
const result = { ...existing };
|
|
4542
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
4543
|
+
if (value === void 0) {
|
|
4544
|
+
continue;
|
|
4545
|
+
}
|
|
4546
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
4547
|
+
result[key] = {
|
|
4548
|
+
...existing[key],
|
|
4549
|
+
...value
|
|
4550
|
+
};
|
|
4551
|
+
} else {
|
|
4552
|
+
result[key] = value;
|
|
4553
|
+
}
|
|
4554
|
+
}
|
|
4555
|
+
return result;
|
|
4556
|
+
}
|
|
4520
4557
|
function updateServiceConfig(metadata, service, config2) {
|
|
4521
4558
|
if (service === "email" && metadata.services.email) {
|
|
4522
|
-
metadata.services.email.config =
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4559
|
+
metadata.services.email.config = applyConfigUpdates(
|
|
4560
|
+
metadata.services.email.config,
|
|
4561
|
+
config2
|
|
4562
|
+
);
|
|
4526
4563
|
} else if (service === "sms" && metadata.services.sms) {
|
|
4527
|
-
metadata.services.sms.config =
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4564
|
+
metadata.services.sms.config = shallowMergeWithNestedObjects(
|
|
4565
|
+
metadata.services.sms.config,
|
|
4566
|
+
config2
|
|
4567
|
+
);
|
|
4531
4568
|
} else if (service === "cdn" && metadata.services.cdn) {
|
|
4532
|
-
metadata.services.cdn.config =
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4569
|
+
metadata.services.cdn.config = shallowMergeWithNestedObjects(
|
|
4570
|
+
metadata.services.cdn.config,
|
|
4571
|
+
config2
|
|
4572
|
+
);
|
|
4536
4573
|
} else {
|
|
4537
4574
|
throw new Error(`${service} service not configured in metadata`);
|
|
4538
4575
|
}
|
|
@@ -5290,6 +5327,170 @@ var init_output = __esm({
|
|
|
5290
5327
|
}
|
|
5291
5328
|
});
|
|
5292
5329
|
|
|
5330
|
+
// src/utils/shared/pulumi.ts
|
|
5331
|
+
var pulumi_exports = {};
|
|
5332
|
+
__export(pulumi_exports, {
|
|
5333
|
+
checkPulumiInstalled: () => checkPulumiInstalled,
|
|
5334
|
+
clearStackLocks: () => clearStackLocks,
|
|
5335
|
+
ensurePulumiInstalled: () => ensurePulumiInstalled,
|
|
5336
|
+
previewWithResourceChanges: () => previewWithResourceChanges,
|
|
5337
|
+
withLockRetry: () => withLockRetry
|
|
5338
|
+
});
|
|
5339
|
+
import { exec } from "child_process";
|
|
5340
|
+
import { existsSync as existsSync6, readdirSync as readdirSync2 } from "fs";
|
|
5341
|
+
import { homedir as homedir3 } from "os";
|
|
5342
|
+
import { dirname as dirname2, join as join7 } from "path";
|
|
5343
|
+
import { promisify } from "util";
|
|
5344
|
+
import { PulumiCommand } from "@pulumi/pulumi/automation/index.js";
|
|
5345
|
+
function findSdkInstalledPulumi() {
|
|
5346
|
+
const versionsDir = join7(homedir3(), ".pulumi", "versions");
|
|
5347
|
+
if (!existsSync6(versionsDir)) return;
|
|
5348
|
+
const versions = readdirSync2(versionsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort().reverse();
|
|
5349
|
+
for (const version of versions) {
|
|
5350
|
+
const binPath = join7(versionsDir, version, "bin", "pulumi");
|
|
5351
|
+
if (existsSync6(binPath)) return dirname2(binPath);
|
|
5352
|
+
}
|
|
5353
|
+
return;
|
|
5354
|
+
}
|
|
5355
|
+
async function checkPulumiInstalled() {
|
|
5356
|
+
try {
|
|
5357
|
+
await execAsync("pulumi version");
|
|
5358
|
+
return true;
|
|
5359
|
+
} catch {
|
|
5360
|
+
const binDir = findSdkInstalledPulumi();
|
|
5361
|
+
if (binDir) {
|
|
5362
|
+
process.env.PATH = `${binDir}:${process.env.PATH}`;
|
|
5363
|
+
return true;
|
|
5364
|
+
}
|
|
5365
|
+
return false;
|
|
5366
|
+
}
|
|
5367
|
+
}
|
|
5368
|
+
async function ensurePulumiInstalled() {
|
|
5369
|
+
const isInstalled = await checkPulumiInstalled();
|
|
5370
|
+
if (!isInstalled) {
|
|
5371
|
+
try {
|
|
5372
|
+
const cmd = await PulumiCommand.install();
|
|
5373
|
+
const binDir = dirname2(cmd.command);
|
|
5374
|
+
process.env.PATH = `${binDir}:${process.env.PATH}`;
|
|
5375
|
+
return true;
|
|
5376
|
+
} catch (_error) {
|
|
5377
|
+
throw errors.pulumiNotInstalled();
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5380
|
+
return false;
|
|
5381
|
+
}
|
|
5382
|
+
function mapOperationType(op) {
|
|
5383
|
+
switch (op) {
|
|
5384
|
+
case "create":
|
|
5385
|
+
return "create";
|
|
5386
|
+
case "update":
|
|
5387
|
+
return "update";
|
|
5388
|
+
case "delete":
|
|
5389
|
+
return "delete";
|
|
5390
|
+
case "replace":
|
|
5391
|
+
case "create-replacement":
|
|
5392
|
+
case "delete-replaced":
|
|
5393
|
+
return "replace";
|
|
5394
|
+
case "same":
|
|
5395
|
+
case "read":
|
|
5396
|
+
return "same";
|
|
5397
|
+
default:
|
|
5398
|
+
return "same";
|
|
5399
|
+
}
|
|
5400
|
+
}
|
|
5401
|
+
async function previewWithResourceChanges(stack, options) {
|
|
5402
|
+
const resourceChanges = [];
|
|
5403
|
+
const seenResources = /* @__PURE__ */ new Set();
|
|
5404
|
+
const result = await stack.preview({
|
|
5405
|
+
diff: options?.diff ?? true,
|
|
5406
|
+
onEvent: (event) => {
|
|
5407
|
+
if (event.resourcePreEvent) {
|
|
5408
|
+
const metadata = event.resourcePreEvent.metadata;
|
|
5409
|
+
if (metadata) {
|
|
5410
|
+
const resourceKey = `${metadata.type}::${metadata.urn}`;
|
|
5411
|
+
if (seenResources.has(resourceKey)) {
|
|
5412
|
+
return;
|
|
5413
|
+
}
|
|
5414
|
+
seenResources.add(resourceKey);
|
|
5415
|
+
if (metadata.type === "pulumi:pulumi:Stack") {
|
|
5416
|
+
return;
|
|
5417
|
+
}
|
|
5418
|
+
const operation = mapOperationType(metadata.op || "same");
|
|
5419
|
+
const urnParts = metadata.urn?.split("::") || [];
|
|
5420
|
+
const name = urnParts.at(-1) || metadata.urn || "unknown";
|
|
5421
|
+
const diffs = [];
|
|
5422
|
+
if (metadata.diffs && metadata.diffs.length > 0) {
|
|
5423
|
+
for (const diff of metadata.diffs) {
|
|
5424
|
+
diffs.push(diff);
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
resourceChanges.push({
|
|
5428
|
+
name,
|
|
5429
|
+
type: metadata.type || "unknown",
|
|
5430
|
+
operation,
|
|
5431
|
+
diffs: diffs.length > 0 ? diffs : void 0
|
|
5432
|
+
});
|
|
5433
|
+
}
|
|
5434
|
+
}
|
|
5435
|
+
}
|
|
5436
|
+
});
|
|
5437
|
+
return {
|
|
5438
|
+
...result,
|
|
5439
|
+
resourceChanges
|
|
5440
|
+
};
|
|
5441
|
+
}
|
|
5442
|
+
async function clearStackLocks(accountId, region) {
|
|
5443
|
+
const backendUrl = process.env.PULUMI_BACKEND_URL || "";
|
|
5444
|
+
if (backendUrl.startsWith("s3://")) {
|
|
5445
|
+
const { clearS3StackLocks: clearS3StackLocks2 } = await Promise.resolve().then(() => (init_s3_state(), s3_state_exports));
|
|
5446
|
+
return clearS3StackLocks2(accountId, region);
|
|
5447
|
+
}
|
|
5448
|
+
const { clearLocalStackLocks: clearLocalStackLocks2 } = await Promise.resolve().then(() => (init_fs(), fs_exports));
|
|
5449
|
+
return clearLocalStackLocks2();
|
|
5450
|
+
}
|
|
5451
|
+
async function withLockRetry(fn, options) {
|
|
5452
|
+
try {
|
|
5453
|
+
return await fn();
|
|
5454
|
+
} catch (error) {
|
|
5455
|
+
if (!(error instanceof Error)) {
|
|
5456
|
+
throw error;
|
|
5457
|
+
}
|
|
5458
|
+
const parsed = parsePulumiError(error);
|
|
5459
|
+
if (parsed.code !== "STACK_LOCKED") {
|
|
5460
|
+
throw error;
|
|
5461
|
+
}
|
|
5462
|
+
const clack51 = await import("@clack/prompts");
|
|
5463
|
+
const pc54 = (await import("picocolors")).default;
|
|
5464
|
+
if (options.autoConfirm) {
|
|
5465
|
+
clack51.log.warn(
|
|
5466
|
+
"Stack is locked from a previous interrupted run. Auto-clearing..."
|
|
5467
|
+
);
|
|
5468
|
+
} else {
|
|
5469
|
+
const shouldClear = await clack51.confirm({
|
|
5470
|
+
message: `Stack is locked from a previous interrupted run. ${pc54.yellow("Clear the stale lock and retry?")}`,
|
|
5471
|
+
initialValue: true
|
|
5472
|
+
});
|
|
5473
|
+
if (clack51.isCancel(shouldClear) || !shouldClear) {
|
|
5474
|
+
throw errors.stackLocked();
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5477
|
+
const cleared = await clearStackLocks(options.accountId, options.region);
|
|
5478
|
+
clack51.log.info(
|
|
5479
|
+
`Cleared ${cleared} lock file${cleared === 1 ? "" : "s"}. Retrying...`
|
|
5480
|
+
);
|
|
5481
|
+
return fn();
|
|
5482
|
+
}
|
|
5483
|
+
}
|
|
5484
|
+
var execAsync;
|
|
5485
|
+
var init_pulumi = __esm({
|
|
5486
|
+
"src/utils/shared/pulumi.ts"() {
|
|
5487
|
+
"use strict";
|
|
5488
|
+
init_esm_shims();
|
|
5489
|
+
init_errors();
|
|
5490
|
+
execAsync = promisify(exec);
|
|
5491
|
+
}
|
|
5492
|
+
});
|
|
5493
|
+
|
|
5293
5494
|
// src/constants.ts
|
|
5294
5495
|
function getDefaultRegion() {
|
|
5295
5496
|
return process.env.AWS_REGION || DEFAULT_AWS_REGION;
|
|
@@ -10092,161 +10293,10 @@ init_fs();
|
|
|
10092
10293
|
init_json_output();
|
|
10093
10294
|
init_metadata();
|
|
10094
10295
|
init_output();
|
|
10296
|
+
init_pulumi();
|
|
10095
10297
|
import * as clack9 from "@clack/prompts";
|
|
10096
10298
|
import * as pulumi from "@pulumi/pulumi";
|
|
10097
10299
|
import pc10 from "picocolors";
|
|
10098
|
-
|
|
10099
|
-
// src/utils/shared/pulumi.ts
|
|
10100
|
-
init_esm_shims();
|
|
10101
|
-
init_errors();
|
|
10102
|
-
import { exec } from "child_process";
|
|
10103
|
-
import { existsSync as existsSync6, readdirSync as readdirSync2 } from "fs";
|
|
10104
|
-
import { homedir as homedir3 } from "os";
|
|
10105
|
-
import { dirname as dirname2, join as join7 } from "path";
|
|
10106
|
-
import { promisify } from "util";
|
|
10107
|
-
import { PulumiCommand } from "@pulumi/pulumi/automation/index.js";
|
|
10108
|
-
var execAsync = promisify(exec);
|
|
10109
|
-
function findSdkInstalledPulumi() {
|
|
10110
|
-
const versionsDir = join7(homedir3(), ".pulumi", "versions");
|
|
10111
|
-
if (!existsSync6(versionsDir)) return;
|
|
10112
|
-
const versions = readdirSync2(versionsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort().reverse();
|
|
10113
|
-
for (const version of versions) {
|
|
10114
|
-
const binPath = join7(versionsDir, version, "bin", "pulumi");
|
|
10115
|
-
if (existsSync6(binPath)) return dirname2(binPath);
|
|
10116
|
-
}
|
|
10117
|
-
return;
|
|
10118
|
-
}
|
|
10119
|
-
async function checkPulumiInstalled() {
|
|
10120
|
-
try {
|
|
10121
|
-
await execAsync("pulumi version");
|
|
10122
|
-
return true;
|
|
10123
|
-
} catch {
|
|
10124
|
-
const binDir = findSdkInstalledPulumi();
|
|
10125
|
-
if (binDir) {
|
|
10126
|
-
process.env.PATH = `${binDir}:${process.env.PATH}`;
|
|
10127
|
-
return true;
|
|
10128
|
-
}
|
|
10129
|
-
return false;
|
|
10130
|
-
}
|
|
10131
|
-
}
|
|
10132
|
-
async function ensurePulumiInstalled() {
|
|
10133
|
-
const isInstalled = await checkPulumiInstalled();
|
|
10134
|
-
if (!isInstalled) {
|
|
10135
|
-
try {
|
|
10136
|
-
const cmd = await PulumiCommand.install();
|
|
10137
|
-
const binDir = dirname2(cmd.command);
|
|
10138
|
-
process.env.PATH = `${binDir}:${process.env.PATH}`;
|
|
10139
|
-
return true;
|
|
10140
|
-
} catch (_error) {
|
|
10141
|
-
throw errors.pulumiNotInstalled();
|
|
10142
|
-
}
|
|
10143
|
-
}
|
|
10144
|
-
return false;
|
|
10145
|
-
}
|
|
10146
|
-
function mapOperationType(op) {
|
|
10147
|
-
switch (op) {
|
|
10148
|
-
case "create":
|
|
10149
|
-
return "create";
|
|
10150
|
-
case "update":
|
|
10151
|
-
return "update";
|
|
10152
|
-
case "delete":
|
|
10153
|
-
return "delete";
|
|
10154
|
-
case "replace":
|
|
10155
|
-
case "create-replacement":
|
|
10156
|
-
case "delete-replaced":
|
|
10157
|
-
return "replace";
|
|
10158
|
-
case "same":
|
|
10159
|
-
case "read":
|
|
10160
|
-
return "same";
|
|
10161
|
-
default:
|
|
10162
|
-
return "same";
|
|
10163
|
-
}
|
|
10164
|
-
}
|
|
10165
|
-
async function previewWithResourceChanges(stack, options) {
|
|
10166
|
-
const resourceChanges = [];
|
|
10167
|
-
const seenResources = /* @__PURE__ */ new Set();
|
|
10168
|
-
const result = await stack.preview({
|
|
10169
|
-
diff: options?.diff ?? true,
|
|
10170
|
-
onEvent: (event) => {
|
|
10171
|
-
if (event.resourcePreEvent) {
|
|
10172
|
-
const metadata = event.resourcePreEvent.metadata;
|
|
10173
|
-
if (metadata) {
|
|
10174
|
-
const resourceKey = `${metadata.type}::${metadata.urn}`;
|
|
10175
|
-
if (seenResources.has(resourceKey)) {
|
|
10176
|
-
return;
|
|
10177
|
-
}
|
|
10178
|
-
seenResources.add(resourceKey);
|
|
10179
|
-
if (metadata.type === "pulumi:pulumi:Stack") {
|
|
10180
|
-
return;
|
|
10181
|
-
}
|
|
10182
|
-
const operation = mapOperationType(metadata.op || "same");
|
|
10183
|
-
const urnParts = metadata.urn?.split("::") || [];
|
|
10184
|
-
const name = urnParts.at(-1) || metadata.urn || "unknown";
|
|
10185
|
-
const diffs = [];
|
|
10186
|
-
if (metadata.diffs && metadata.diffs.length > 0) {
|
|
10187
|
-
for (const diff of metadata.diffs) {
|
|
10188
|
-
diffs.push(diff);
|
|
10189
|
-
}
|
|
10190
|
-
}
|
|
10191
|
-
resourceChanges.push({
|
|
10192
|
-
name,
|
|
10193
|
-
type: metadata.type || "unknown",
|
|
10194
|
-
operation,
|
|
10195
|
-
diffs: diffs.length > 0 ? diffs : void 0
|
|
10196
|
-
});
|
|
10197
|
-
}
|
|
10198
|
-
}
|
|
10199
|
-
}
|
|
10200
|
-
});
|
|
10201
|
-
return {
|
|
10202
|
-
...result,
|
|
10203
|
-
resourceChanges
|
|
10204
|
-
};
|
|
10205
|
-
}
|
|
10206
|
-
async function clearStackLocks(accountId, region) {
|
|
10207
|
-
const backendUrl = process.env.PULUMI_BACKEND_URL || "";
|
|
10208
|
-
if (backendUrl.startsWith("s3://")) {
|
|
10209
|
-
const { clearS3StackLocks: clearS3StackLocks2 } = await Promise.resolve().then(() => (init_s3_state(), s3_state_exports));
|
|
10210
|
-
return clearS3StackLocks2(accountId, region);
|
|
10211
|
-
}
|
|
10212
|
-
const { clearLocalStackLocks: clearLocalStackLocks2 } = await Promise.resolve().then(() => (init_fs(), fs_exports));
|
|
10213
|
-
return clearLocalStackLocks2();
|
|
10214
|
-
}
|
|
10215
|
-
async function withLockRetry(fn, options) {
|
|
10216
|
-
try {
|
|
10217
|
-
return await fn();
|
|
10218
|
-
} catch (error) {
|
|
10219
|
-
if (!(error instanceof Error)) {
|
|
10220
|
-
throw error;
|
|
10221
|
-
}
|
|
10222
|
-
const parsed = parsePulumiError(error);
|
|
10223
|
-
if (parsed.code !== "STACK_LOCKED") {
|
|
10224
|
-
throw error;
|
|
10225
|
-
}
|
|
10226
|
-
const clack51 = await import("@clack/prompts");
|
|
10227
|
-
const pc54 = (await import("picocolors")).default;
|
|
10228
|
-
if (options.autoConfirm) {
|
|
10229
|
-
clack51.log.warn(
|
|
10230
|
-
"Stack is locked from a previous interrupted run. Auto-clearing..."
|
|
10231
|
-
);
|
|
10232
|
-
} else {
|
|
10233
|
-
const shouldClear = await clack51.confirm({
|
|
10234
|
-
message: `Stack is locked from a previous interrupted run. ${pc54.yellow("Clear the stale lock and retry?")}`,
|
|
10235
|
-
initialValue: true
|
|
10236
|
-
});
|
|
10237
|
-
if (clack51.isCancel(shouldClear) || !shouldClear) {
|
|
10238
|
-
throw errors.stackLocked();
|
|
10239
|
-
}
|
|
10240
|
-
}
|
|
10241
|
-
const cleared = await clearStackLocks(options.accountId, options.region);
|
|
10242
|
-
clack51.log.info(
|
|
10243
|
-
`Cleared ${cleared} lock file${cleared === 1 ? "" : "s"}. Retrying...`
|
|
10244
|
-
);
|
|
10245
|
-
return fn();
|
|
10246
|
-
}
|
|
10247
|
-
}
|
|
10248
|
-
|
|
10249
|
-
// src/commands/cdn/destroy.ts
|
|
10250
10300
|
async function cdnDestroy(options) {
|
|
10251
10301
|
await ensurePulumiInstalled();
|
|
10252
10302
|
const startTime = Date.now();
|
|
@@ -11411,6 +11461,7 @@ init_json_output();
|
|
|
11411
11461
|
init_metadata();
|
|
11412
11462
|
init_output();
|
|
11413
11463
|
init_prompts();
|
|
11464
|
+
init_pulumi();
|
|
11414
11465
|
async function promptCdnPreset() {
|
|
11415
11466
|
const starterInfo = getPresetInfo2("starter");
|
|
11416
11467
|
const productionInfo = getPresetInfo2("production");
|
|
@@ -12160,6 +12211,7 @@ init_fs();
|
|
|
12160
12211
|
init_json_output();
|
|
12161
12212
|
init_metadata();
|
|
12162
12213
|
init_output();
|
|
12214
|
+
init_pulumi();
|
|
12163
12215
|
import * as clack11 from "@clack/prompts";
|
|
12164
12216
|
import * as pulumi6 from "@pulumi/pulumi";
|
|
12165
12217
|
import pc12 from "picocolors";
|
|
@@ -12337,6 +12389,7 @@ init_fs();
|
|
|
12337
12389
|
init_json_output();
|
|
12338
12390
|
init_metadata();
|
|
12339
12391
|
init_output();
|
|
12392
|
+
init_pulumi();
|
|
12340
12393
|
async function cdnSync(options) {
|
|
12341
12394
|
await ensurePulumiInstalled();
|
|
12342
12395
|
const startTime = Date.now();
|
|
@@ -12517,6 +12570,7 @@ init_fs();
|
|
|
12517
12570
|
init_json_output();
|
|
12518
12571
|
init_metadata();
|
|
12519
12572
|
init_output();
|
|
12573
|
+
init_pulumi();
|
|
12520
12574
|
async function cdnUpgrade(options) {
|
|
12521
12575
|
await ensurePulumiInstalled();
|
|
12522
12576
|
const startTime = Date.now();
|
|
@@ -12820,6 +12874,7 @@ init_fs();
|
|
|
12820
12874
|
init_json_output();
|
|
12821
12875
|
init_metadata();
|
|
12822
12876
|
init_output();
|
|
12877
|
+
init_pulumi();
|
|
12823
12878
|
import * as clack14 from "@clack/prompts";
|
|
12824
12879
|
import * as pulumi9 from "@pulumi/pulumi";
|
|
12825
12880
|
import pc15 from "picocolors";
|
|
@@ -17198,6 +17253,7 @@ init_fs();
|
|
|
17198
17253
|
init_json_output();
|
|
17199
17254
|
init_metadata();
|
|
17200
17255
|
init_output();
|
|
17256
|
+
init_pulumi();
|
|
17201
17257
|
async function config(options) {
|
|
17202
17258
|
const startTime = Date.now();
|
|
17203
17259
|
if (!isJsonMode()) {
|
|
@@ -17488,6 +17544,7 @@ init_json_output();
|
|
|
17488
17544
|
init_metadata();
|
|
17489
17545
|
init_output();
|
|
17490
17546
|
init_prompts();
|
|
17547
|
+
init_pulumi();
|
|
17491
17548
|
|
|
17492
17549
|
// src/utils/shared/scanner.ts
|
|
17493
17550
|
init_esm_shims();
|
|
@@ -18084,6 +18141,7 @@ init_fs();
|
|
|
18084
18141
|
init_json_output();
|
|
18085
18142
|
init_metadata();
|
|
18086
18143
|
init_output();
|
|
18144
|
+
init_pulumi();
|
|
18087
18145
|
import * as clack18 from "@clack/prompts";
|
|
18088
18146
|
import * as pulumi15 from "@pulumi/pulumi";
|
|
18089
18147
|
import pc19 from "picocolors";
|
|
@@ -18156,6 +18214,10 @@ async function emailDestroy(options) {
|
|
|
18156
18214
|
);
|
|
18157
18215
|
}
|
|
18158
18216
|
const progress = new DeploymentProgress();
|
|
18217
|
+
await progress.execute("Checking Pulumi CLI installation", async () => {
|
|
18218
|
+
const { ensurePulumiInstalled: ensurePulumiInstalled2 } = await Promise.resolve().then(() => (init_pulumi(), pulumi_exports));
|
|
18219
|
+
await ensurePulumiInstalled2();
|
|
18220
|
+
});
|
|
18159
18221
|
const identity = await progress.execute(
|
|
18160
18222
|
"Validating AWS credentials",
|
|
18161
18223
|
async () => validateAWSCredentials()
|
|
@@ -19562,6 +19624,7 @@ init_json_output();
|
|
|
19562
19624
|
init_metadata();
|
|
19563
19625
|
init_output();
|
|
19564
19626
|
init_prompts();
|
|
19627
|
+
init_pulumi();
|
|
19565
19628
|
async function inboundInit(options) {
|
|
19566
19629
|
if (!isJsonMode()) {
|
|
19567
19630
|
clack20.intro(
|
|
@@ -20716,6 +20779,7 @@ init_json_output();
|
|
|
20716
20779
|
init_metadata();
|
|
20717
20780
|
init_output();
|
|
20718
20781
|
init_prompts();
|
|
20782
|
+
init_pulumi();
|
|
20719
20783
|
async function init2(options) {
|
|
20720
20784
|
const startTime = Date.now();
|
|
20721
20785
|
if (!isJsonMode()) {
|
|
@@ -21323,6 +21387,7 @@ init_fs();
|
|
|
21323
21387
|
init_json_output();
|
|
21324
21388
|
init_metadata();
|
|
21325
21389
|
init_output();
|
|
21390
|
+
init_pulumi();
|
|
21326
21391
|
import * as clack24 from "@clack/prompts";
|
|
21327
21392
|
import * as pulumi18 from "@pulumi/pulumi";
|
|
21328
21393
|
import pc25 from "picocolors";
|
|
@@ -21527,6 +21592,7 @@ init_fs();
|
|
|
21527
21592
|
init_json_output();
|
|
21528
21593
|
init_metadata();
|
|
21529
21594
|
init_output();
|
|
21595
|
+
init_pulumi();
|
|
21530
21596
|
import * as clack25 from "@clack/prompts";
|
|
21531
21597
|
import * as pulumi19 from "@pulumi/pulumi";
|
|
21532
21598
|
import pc26 from "picocolors";
|
|
@@ -23476,6 +23542,7 @@ init_json_output();
|
|
|
23476
23542
|
init_metadata();
|
|
23477
23543
|
init_output();
|
|
23478
23544
|
init_prompts();
|
|
23545
|
+
init_pulumi();
|
|
23479
23546
|
async function upgrade(options) {
|
|
23480
23547
|
const startTime = Date.now();
|
|
23481
23548
|
let upgradeAction = "";
|
|
@@ -23676,13 +23743,17 @@ ${pc30.bold("Current Configuration:")}
|
|
|
23676
23743
|
hint: metadata.provider === "vercel" ? `Currently: Vercel (${metadata.vercel?.teamSlug || "configured"})` : `Currently: ${metadata.provider} \u2192 Switch to Vercel OIDC, etc.`
|
|
23677
23744
|
}
|
|
23678
23745
|
);
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23684
|
-
|
|
23685
|
-
|
|
23746
|
+
if (options.action) {
|
|
23747
|
+
upgradeAction = options.action;
|
|
23748
|
+
} else {
|
|
23749
|
+
upgradeAction = await clack29.select({
|
|
23750
|
+
message: "What would you like to do?",
|
|
23751
|
+
options: upgradeOptions
|
|
23752
|
+
});
|
|
23753
|
+
if (clack29.isCancel(upgradeAction)) {
|
|
23754
|
+
clack29.cancel("Upgrade cancelled.");
|
|
23755
|
+
process.exit(0);
|
|
23756
|
+
}
|
|
23686
23757
|
}
|
|
23687
23758
|
let updatedConfig = { ...config2 };
|
|
23688
23759
|
let newPreset = metadata.services.email?.preset;
|
|
@@ -23712,13 +23783,18 @@ ${pc30.bold("Current Configuration:")}
|
|
|
23712
23783
|
clack29.log.warn("Already on highest preset (Enterprise)");
|
|
23713
23784
|
process.exit(0);
|
|
23714
23785
|
}
|
|
23715
|
-
|
|
23716
|
-
|
|
23717
|
-
options
|
|
23718
|
-
}
|
|
23719
|
-
|
|
23720
|
-
|
|
23721
|
-
|
|
23786
|
+
let selectedPreset;
|
|
23787
|
+
if (options.preset) {
|
|
23788
|
+
selectedPreset = options.preset;
|
|
23789
|
+
} else {
|
|
23790
|
+
selectedPreset = await clack29.select({
|
|
23791
|
+
message: "Select new preset:",
|
|
23792
|
+
options: availablePresets
|
|
23793
|
+
});
|
|
23794
|
+
if (clack29.isCancel(selectedPreset)) {
|
|
23795
|
+
clack29.cancel("Upgrade cancelled.");
|
|
23796
|
+
process.exit(0);
|
|
23797
|
+
}
|
|
23722
23798
|
}
|
|
23723
23799
|
const presetConfig = getPreset(selectedPreset);
|
|
23724
23800
|
updatedConfig = applyConfigUpdates(config2, presetConfig);
|
|
@@ -24735,13 +24811,15 @@ ${pc30.bold("SMTP Credentials for Legacy Systems")}
|
|
|
24735
24811
|
"Credentials will be shown ONCE after deployment - save them immediately!"
|
|
24736
24812
|
);
|
|
24737
24813
|
console.log("");
|
|
24738
|
-
|
|
24739
|
-
|
|
24740
|
-
|
|
24741
|
-
|
|
24742
|
-
|
|
24743
|
-
clack29.
|
|
24744
|
-
|
|
24814
|
+
if (!options.yes) {
|
|
24815
|
+
const confirmCreate = await clack29.confirm({
|
|
24816
|
+
message: "Create SMTP credentials?",
|
|
24817
|
+
initialValue: true
|
|
24818
|
+
});
|
|
24819
|
+
if (clack29.isCancel(confirmCreate) || !confirmCreate) {
|
|
24820
|
+
clack29.log.info("SMTP credentials not created.");
|
|
24821
|
+
process.exit(0);
|
|
24822
|
+
}
|
|
24745
24823
|
}
|
|
24746
24824
|
updatedConfig = {
|
|
24747
24825
|
...config2,
|
|
@@ -25054,7 +25132,7 @@ ${pc30.bold("Cost Impact:")}`);
|
|
|
25054
25132
|
throw new Error(`Pulumi upgrade failed: ${msg}`);
|
|
25055
25133
|
}
|
|
25056
25134
|
let dnsAutoCreated = false;
|
|
25057
|
-
if (outputs.domain && outputs.dkimTokens && outputs.dkimTokens.length > 0) {
|
|
25135
|
+
if (!isJsonMode() && outputs.domain && outputs.dkimTokens && outputs.dkimTokens.length > 0) {
|
|
25058
25136
|
let dnsProvider = metadata.services.email?.dnsProvider;
|
|
25059
25137
|
if (!dnsProvider) {
|
|
25060
25138
|
const availableProviders = await progress.execute(
|
|
@@ -27878,6 +27956,7 @@ init_json_output();
|
|
|
27878
27956
|
init_metadata();
|
|
27879
27957
|
init_output();
|
|
27880
27958
|
init_prompts();
|
|
27959
|
+
init_pulumi();
|
|
27881
27960
|
function buildConsolePolicyDocument(emailConfig, smsConfig) {
|
|
27882
27961
|
const statements = [];
|
|
27883
27962
|
statements.push({
|
|
@@ -31761,6 +31840,7 @@ init_aws();
|
|
|
31761
31840
|
init_fs();
|
|
31762
31841
|
init_metadata();
|
|
31763
31842
|
init_output();
|
|
31843
|
+
init_pulumi();
|
|
31764
31844
|
async function dashboard(options) {
|
|
31765
31845
|
await ensurePulumiInstalled();
|
|
31766
31846
|
clack36.intro(pc39.bold("Wraps Dashboard"));
|
|
@@ -31995,6 +32075,7 @@ init_aws();
|
|
|
31995
32075
|
init_fs();
|
|
31996
32076
|
init_json_output();
|
|
31997
32077
|
init_output();
|
|
32078
|
+
init_pulumi();
|
|
31998
32079
|
import * as clack38 from "@clack/prompts";
|
|
31999
32080
|
import * as pulumi23 from "@pulumi/pulumi";
|
|
32000
32081
|
import pc41 from "picocolors";
|
|
@@ -32944,6 +33025,7 @@ init_fs();
|
|
|
32944
33025
|
init_json_output();
|
|
32945
33026
|
init_metadata();
|
|
32946
33027
|
init_output();
|
|
33028
|
+
init_pulumi();
|
|
32947
33029
|
async function smsDestroy(options) {
|
|
32948
33030
|
await ensurePulumiInstalled();
|
|
32949
33031
|
const startTime = Date.now();
|
|
@@ -33177,6 +33259,7 @@ init_json_output();
|
|
|
33177
33259
|
init_metadata();
|
|
33178
33260
|
init_output();
|
|
33179
33261
|
init_prompts();
|
|
33262
|
+
init_pulumi();
|
|
33180
33263
|
|
|
33181
33264
|
// src/utils/sms/costs.ts
|
|
33182
33265
|
init_esm_shims();
|
|
@@ -34236,6 +34319,7 @@ init_fs();
|
|
|
34236
34319
|
init_json_output();
|
|
34237
34320
|
init_metadata();
|
|
34238
34321
|
init_output();
|
|
34322
|
+
init_pulumi();
|
|
34239
34323
|
import * as clack42 from "@clack/prompts";
|
|
34240
34324
|
import * as pulumi27 from "@pulumi/pulumi";
|
|
34241
34325
|
import pc45 from "picocolors";
|
|
@@ -34358,6 +34442,7 @@ init_fs();
|
|
|
34358
34442
|
init_json_output();
|
|
34359
34443
|
init_metadata();
|
|
34360
34444
|
init_output();
|
|
34445
|
+
init_pulumi();
|
|
34361
34446
|
async function smsSync(options) {
|
|
34362
34447
|
await ensurePulumiInstalled();
|
|
34363
34448
|
const startTime = Date.now();
|
|
@@ -34795,6 +34880,7 @@ init_json_output();
|
|
|
34795
34880
|
init_metadata();
|
|
34796
34881
|
init_output();
|
|
34797
34882
|
init_prompts();
|
|
34883
|
+
init_pulumi();
|
|
34798
34884
|
async function smsUpgrade(options) {
|
|
34799
34885
|
const startTime = Date.now();
|
|
34800
34886
|
let upgradeAction = "";
|
|
@@ -36769,6 +36855,12 @@ args.options([
|
|
|
36769
36855
|
description: "Resend verification code",
|
|
36770
36856
|
defaultValue: false
|
|
36771
36857
|
},
|
|
36858
|
+
// Email upgrade options
|
|
36859
|
+
{
|
|
36860
|
+
name: "action",
|
|
36861
|
+
description: "Upgrade action (preset, smtp-credentials, events, archiving, etc.)",
|
|
36862
|
+
defaultValue: void 0
|
|
36863
|
+
},
|
|
36772
36864
|
// Email test options
|
|
36773
36865
|
{
|
|
36774
36866
|
name: "scenario",
|
|
@@ -37120,7 +37212,9 @@ async function run() {
|
|
|
37120
37212
|
region: flags.region,
|
|
37121
37213
|
yes: flags.yes,
|
|
37122
37214
|
preview: flags.preview,
|
|
37123
|
-
json: flags.json
|
|
37215
|
+
json: flags.json,
|
|
37216
|
+
action: flags.action,
|
|
37217
|
+
preset: flags.preset
|
|
37124
37218
|
});
|
|
37125
37219
|
break;
|
|
37126
37220
|
case "restore":
|