@wraps.dev/cli 2.17.5 → 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
|
@@ -5327,6 +5327,170 @@ var init_output = __esm({
|
|
|
5327
5327
|
}
|
|
5328
5328
|
});
|
|
5329
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
|
+
|
|
5330
5494
|
// src/constants.ts
|
|
5331
5495
|
function getDefaultRegion() {
|
|
5332
5496
|
return process.env.AWS_REGION || DEFAULT_AWS_REGION;
|
|
@@ -10129,161 +10293,10 @@ init_fs();
|
|
|
10129
10293
|
init_json_output();
|
|
10130
10294
|
init_metadata();
|
|
10131
10295
|
init_output();
|
|
10296
|
+
init_pulumi();
|
|
10132
10297
|
import * as clack9 from "@clack/prompts";
|
|
10133
10298
|
import * as pulumi from "@pulumi/pulumi";
|
|
10134
10299
|
import pc10 from "picocolors";
|
|
10135
|
-
|
|
10136
|
-
// src/utils/shared/pulumi.ts
|
|
10137
|
-
init_esm_shims();
|
|
10138
|
-
init_errors();
|
|
10139
|
-
import { exec } from "child_process";
|
|
10140
|
-
import { existsSync as existsSync6, readdirSync as readdirSync2 } from "fs";
|
|
10141
|
-
import { homedir as homedir3 } from "os";
|
|
10142
|
-
import { dirname as dirname2, join as join7 } from "path";
|
|
10143
|
-
import { promisify } from "util";
|
|
10144
|
-
import { PulumiCommand } from "@pulumi/pulumi/automation/index.js";
|
|
10145
|
-
var execAsync = promisify(exec);
|
|
10146
|
-
function findSdkInstalledPulumi() {
|
|
10147
|
-
const versionsDir = join7(homedir3(), ".pulumi", "versions");
|
|
10148
|
-
if (!existsSync6(versionsDir)) return;
|
|
10149
|
-
const versions = readdirSync2(versionsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort().reverse();
|
|
10150
|
-
for (const version of versions) {
|
|
10151
|
-
const binPath = join7(versionsDir, version, "bin", "pulumi");
|
|
10152
|
-
if (existsSync6(binPath)) return dirname2(binPath);
|
|
10153
|
-
}
|
|
10154
|
-
return;
|
|
10155
|
-
}
|
|
10156
|
-
async function checkPulumiInstalled() {
|
|
10157
|
-
try {
|
|
10158
|
-
await execAsync("pulumi version");
|
|
10159
|
-
return true;
|
|
10160
|
-
} catch {
|
|
10161
|
-
const binDir = findSdkInstalledPulumi();
|
|
10162
|
-
if (binDir) {
|
|
10163
|
-
process.env.PATH = `${binDir}:${process.env.PATH}`;
|
|
10164
|
-
return true;
|
|
10165
|
-
}
|
|
10166
|
-
return false;
|
|
10167
|
-
}
|
|
10168
|
-
}
|
|
10169
|
-
async function ensurePulumiInstalled() {
|
|
10170
|
-
const isInstalled = await checkPulumiInstalled();
|
|
10171
|
-
if (!isInstalled) {
|
|
10172
|
-
try {
|
|
10173
|
-
const cmd = await PulumiCommand.install();
|
|
10174
|
-
const binDir = dirname2(cmd.command);
|
|
10175
|
-
process.env.PATH = `${binDir}:${process.env.PATH}`;
|
|
10176
|
-
return true;
|
|
10177
|
-
} catch (_error) {
|
|
10178
|
-
throw errors.pulumiNotInstalled();
|
|
10179
|
-
}
|
|
10180
|
-
}
|
|
10181
|
-
return false;
|
|
10182
|
-
}
|
|
10183
|
-
function mapOperationType(op) {
|
|
10184
|
-
switch (op) {
|
|
10185
|
-
case "create":
|
|
10186
|
-
return "create";
|
|
10187
|
-
case "update":
|
|
10188
|
-
return "update";
|
|
10189
|
-
case "delete":
|
|
10190
|
-
return "delete";
|
|
10191
|
-
case "replace":
|
|
10192
|
-
case "create-replacement":
|
|
10193
|
-
case "delete-replaced":
|
|
10194
|
-
return "replace";
|
|
10195
|
-
case "same":
|
|
10196
|
-
case "read":
|
|
10197
|
-
return "same";
|
|
10198
|
-
default:
|
|
10199
|
-
return "same";
|
|
10200
|
-
}
|
|
10201
|
-
}
|
|
10202
|
-
async function previewWithResourceChanges(stack, options) {
|
|
10203
|
-
const resourceChanges = [];
|
|
10204
|
-
const seenResources = /* @__PURE__ */ new Set();
|
|
10205
|
-
const result = await stack.preview({
|
|
10206
|
-
diff: options?.diff ?? true,
|
|
10207
|
-
onEvent: (event) => {
|
|
10208
|
-
if (event.resourcePreEvent) {
|
|
10209
|
-
const metadata = event.resourcePreEvent.metadata;
|
|
10210
|
-
if (metadata) {
|
|
10211
|
-
const resourceKey = `${metadata.type}::${metadata.urn}`;
|
|
10212
|
-
if (seenResources.has(resourceKey)) {
|
|
10213
|
-
return;
|
|
10214
|
-
}
|
|
10215
|
-
seenResources.add(resourceKey);
|
|
10216
|
-
if (metadata.type === "pulumi:pulumi:Stack") {
|
|
10217
|
-
return;
|
|
10218
|
-
}
|
|
10219
|
-
const operation = mapOperationType(metadata.op || "same");
|
|
10220
|
-
const urnParts = metadata.urn?.split("::") || [];
|
|
10221
|
-
const name = urnParts.at(-1) || metadata.urn || "unknown";
|
|
10222
|
-
const diffs = [];
|
|
10223
|
-
if (metadata.diffs && metadata.diffs.length > 0) {
|
|
10224
|
-
for (const diff of metadata.diffs) {
|
|
10225
|
-
diffs.push(diff);
|
|
10226
|
-
}
|
|
10227
|
-
}
|
|
10228
|
-
resourceChanges.push({
|
|
10229
|
-
name,
|
|
10230
|
-
type: metadata.type || "unknown",
|
|
10231
|
-
operation,
|
|
10232
|
-
diffs: diffs.length > 0 ? diffs : void 0
|
|
10233
|
-
});
|
|
10234
|
-
}
|
|
10235
|
-
}
|
|
10236
|
-
}
|
|
10237
|
-
});
|
|
10238
|
-
return {
|
|
10239
|
-
...result,
|
|
10240
|
-
resourceChanges
|
|
10241
|
-
};
|
|
10242
|
-
}
|
|
10243
|
-
async function clearStackLocks(accountId, region) {
|
|
10244
|
-
const backendUrl = process.env.PULUMI_BACKEND_URL || "";
|
|
10245
|
-
if (backendUrl.startsWith("s3://")) {
|
|
10246
|
-
const { clearS3StackLocks: clearS3StackLocks2 } = await Promise.resolve().then(() => (init_s3_state(), s3_state_exports));
|
|
10247
|
-
return clearS3StackLocks2(accountId, region);
|
|
10248
|
-
}
|
|
10249
|
-
const { clearLocalStackLocks: clearLocalStackLocks2 } = await Promise.resolve().then(() => (init_fs(), fs_exports));
|
|
10250
|
-
return clearLocalStackLocks2();
|
|
10251
|
-
}
|
|
10252
|
-
async function withLockRetry(fn, options) {
|
|
10253
|
-
try {
|
|
10254
|
-
return await fn();
|
|
10255
|
-
} catch (error) {
|
|
10256
|
-
if (!(error instanceof Error)) {
|
|
10257
|
-
throw error;
|
|
10258
|
-
}
|
|
10259
|
-
const parsed = parsePulumiError(error);
|
|
10260
|
-
if (parsed.code !== "STACK_LOCKED") {
|
|
10261
|
-
throw error;
|
|
10262
|
-
}
|
|
10263
|
-
const clack51 = await import("@clack/prompts");
|
|
10264
|
-
const pc54 = (await import("picocolors")).default;
|
|
10265
|
-
if (options.autoConfirm) {
|
|
10266
|
-
clack51.log.warn(
|
|
10267
|
-
"Stack is locked from a previous interrupted run. Auto-clearing..."
|
|
10268
|
-
);
|
|
10269
|
-
} else {
|
|
10270
|
-
const shouldClear = await clack51.confirm({
|
|
10271
|
-
message: `Stack is locked from a previous interrupted run. ${pc54.yellow("Clear the stale lock and retry?")}`,
|
|
10272
|
-
initialValue: true
|
|
10273
|
-
});
|
|
10274
|
-
if (clack51.isCancel(shouldClear) || !shouldClear) {
|
|
10275
|
-
throw errors.stackLocked();
|
|
10276
|
-
}
|
|
10277
|
-
}
|
|
10278
|
-
const cleared = await clearStackLocks(options.accountId, options.region);
|
|
10279
|
-
clack51.log.info(
|
|
10280
|
-
`Cleared ${cleared} lock file${cleared === 1 ? "" : "s"}. Retrying...`
|
|
10281
|
-
);
|
|
10282
|
-
return fn();
|
|
10283
|
-
}
|
|
10284
|
-
}
|
|
10285
|
-
|
|
10286
|
-
// src/commands/cdn/destroy.ts
|
|
10287
10300
|
async function cdnDestroy(options) {
|
|
10288
10301
|
await ensurePulumiInstalled();
|
|
10289
10302
|
const startTime = Date.now();
|
|
@@ -11448,6 +11461,7 @@ init_json_output();
|
|
|
11448
11461
|
init_metadata();
|
|
11449
11462
|
init_output();
|
|
11450
11463
|
init_prompts();
|
|
11464
|
+
init_pulumi();
|
|
11451
11465
|
async function promptCdnPreset() {
|
|
11452
11466
|
const starterInfo = getPresetInfo2("starter");
|
|
11453
11467
|
const productionInfo = getPresetInfo2("production");
|
|
@@ -12197,6 +12211,7 @@ init_fs();
|
|
|
12197
12211
|
init_json_output();
|
|
12198
12212
|
init_metadata();
|
|
12199
12213
|
init_output();
|
|
12214
|
+
init_pulumi();
|
|
12200
12215
|
import * as clack11 from "@clack/prompts";
|
|
12201
12216
|
import * as pulumi6 from "@pulumi/pulumi";
|
|
12202
12217
|
import pc12 from "picocolors";
|
|
@@ -12374,6 +12389,7 @@ init_fs();
|
|
|
12374
12389
|
init_json_output();
|
|
12375
12390
|
init_metadata();
|
|
12376
12391
|
init_output();
|
|
12392
|
+
init_pulumi();
|
|
12377
12393
|
async function cdnSync(options) {
|
|
12378
12394
|
await ensurePulumiInstalled();
|
|
12379
12395
|
const startTime = Date.now();
|
|
@@ -12554,6 +12570,7 @@ init_fs();
|
|
|
12554
12570
|
init_json_output();
|
|
12555
12571
|
init_metadata();
|
|
12556
12572
|
init_output();
|
|
12573
|
+
init_pulumi();
|
|
12557
12574
|
async function cdnUpgrade(options) {
|
|
12558
12575
|
await ensurePulumiInstalled();
|
|
12559
12576
|
const startTime = Date.now();
|
|
@@ -12857,6 +12874,7 @@ init_fs();
|
|
|
12857
12874
|
init_json_output();
|
|
12858
12875
|
init_metadata();
|
|
12859
12876
|
init_output();
|
|
12877
|
+
init_pulumi();
|
|
12860
12878
|
import * as clack14 from "@clack/prompts";
|
|
12861
12879
|
import * as pulumi9 from "@pulumi/pulumi";
|
|
12862
12880
|
import pc15 from "picocolors";
|
|
@@ -17235,6 +17253,7 @@ init_fs();
|
|
|
17235
17253
|
init_json_output();
|
|
17236
17254
|
init_metadata();
|
|
17237
17255
|
init_output();
|
|
17256
|
+
init_pulumi();
|
|
17238
17257
|
async function config(options) {
|
|
17239
17258
|
const startTime = Date.now();
|
|
17240
17259
|
if (!isJsonMode()) {
|
|
@@ -17525,6 +17544,7 @@ init_json_output();
|
|
|
17525
17544
|
init_metadata();
|
|
17526
17545
|
init_output();
|
|
17527
17546
|
init_prompts();
|
|
17547
|
+
init_pulumi();
|
|
17528
17548
|
|
|
17529
17549
|
// src/utils/shared/scanner.ts
|
|
17530
17550
|
init_esm_shims();
|
|
@@ -18121,6 +18141,7 @@ init_fs();
|
|
|
18121
18141
|
init_json_output();
|
|
18122
18142
|
init_metadata();
|
|
18123
18143
|
init_output();
|
|
18144
|
+
init_pulumi();
|
|
18124
18145
|
import * as clack18 from "@clack/prompts";
|
|
18125
18146
|
import * as pulumi15 from "@pulumi/pulumi";
|
|
18126
18147
|
import pc19 from "picocolors";
|
|
@@ -18193,6 +18214,10 @@ async function emailDestroy(options) {
|
|
|
18193
18214
|
);
|
|
18194
18215
|
}
|
|
18195
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
|
+
});
|
|
18196
18221
|
const identity = await progress.execute(
|
|
18197
18222
|
"Validating AWS credentials",
|
|
18198
18223
|
async () => validateAWSCredentials()
|
|
@@ -19599,6 +19624,7 @@ init_json_output();
|
|
|
19599
19624
|
init_metadata();
|
|
19600
19625
|
init_output();
|
|
19601
19626
|
init_prompts();
|
|
19627
|
+
init_pulumi();
|
|
19602
19628
|
async function inboundInit(options) {
|
|
19603
19629
|
if (!isJsonMode()) {
|
|
19604
19630
|
clack20.intro(
|
|
@@ -20753,6 +20779,7 @@ init_json_output();
|
|
|
20753
20779
|
init_metadata();
|
|
20754
20780
|
init_output();
|
|
20755
20781
|
init_prompts();
|
|
20782
|
+
init_pulumi();
|
|
20756
20783
|
async function init2(options) {
|
|
20757
20784
|
const startTime = Date.now();
|
|
20758
20785
|
if (!isJsonMode()) {
|
|
@@ -21360,6 +21387,7 @@ init_fs();
|
|
|
21360
21387
|
init_json_output();
|
|
21361
21388
|
init_metadata();
|
|
21362
21389
|
init_output();
|
|
21390
|
+
init_pulumi();
|
|
21363
21391
|
import * as clack24 from "@clack/prompts";
|
|
21364
21392
|
import * as pulumi18 from "@pulumi/pulumi";
|
|
21365
21393
|
import pc25 from "picocolors";
|
|
@@ -21564,6 +21592,7 @@ init_fs();
|
|
|
21564
21592
|
init_json_output();
|
|
21565
21593
|
init_metadata();
|
|
21566
21594
|
init_output();
|
|
21595
|
+
init_pulumi();
|
|
21567
21596
|
import * as clack25 from "@clack/prompts";
|
|
21568
21597
|
import * as pulumi19 from "@pulumi/pulumi";
|
|
21569
21598
|
import pc26 from "picocolors";
|
|
@@ -23513,6 +23542,7 @@ init_json_output();
|
|
|
23513
23542
|
init_metadata();
|
|
23514
23543
|
init_output();
|
|
23515
23544
|
init_prompts();
|
|
23545
|
+
init_pulumi();
|
|
23516
23546
|
async function upgrade(options) {
|
|
23517
23547
|
const startTime = Date.now();
|
|
23518
23548
|
let upgradeAction = "";
|
|
@@ -23713,13 +23743,17 @@ ${pc30.bold("Current Configuration:")}
|
|
|
23713
23743
|
hint: metadata.provider === "vercel" ? `Currently: Vercel (${metadata.vercel?.teamSlug || "configured"})` : `Currently: ${metadata.provider} \u2192 Switch to Vercel OIDC, etc.`
|
|
23714
23744
|
}
|
|
23715
23745
|
);
|
|
23716
|
-
|
|
23717
|
-
|
|
23718
|
-
|
|
23719
|
-
|
|
23720
|
-
|
|
23721
|
-
|
|
23722
|
-
|
|
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
|
+
}
|
|
23723
23757
|
}
|
|
23724
23758
|
let updatedConfig = { ...config2 };
|
|
23725
23759
|
let newPreset = metadata.services.email?.preset;
|
|
@@ -23749,13 +23783,18 @@ ${pc30.bold("Current Configuration:")}
|
|
|
23749
23783
|
clack29.log.warn("Already on highest preset (Enterprise)");
|
|
23750
23784
|
process.exit(0);
|
|
23751
23785
|
}
|
|
23752
|
-
|
|
23753
|
-
|
|
23754
|
-
options
|
|
23755
|
-
}
|
|
23756
|
-
|
|
23757
|
-
|
|
23758
|
-
|
|
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
|
+
}
|
|
23759
23798
|
}
|
|
23760
23799
|
const presetConfig = getPreset(selectedPreset);
|
|
23761
23800
|
updatedConfig = applyConfigUpdates(config2, presetConfig);
|
|
@@ -24772,13 +24811,15 @@ ${pc30.bold("SMTP Credentials for Legacy Systems")}
|
|
|
24772
24811
|
"Credentials will be shown ONCE after deployment - save them immediately!"
|
|
24773
24812
|
);
|
|
24774
24813
|
console.log("");
|
|
24775
|
-
|
|
24776
|
-
|
|
24777
|
-
|
|
24778
|
-
|
|
24779
|
-
|
|
24780
|
-
clack29.
|
|
24781
|
-
|
|
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
|
+
}
|
|
24782
24823
|
}
|
|
24783
24824
|
updatedConfig = {
|
|
24784
24825
|
...config2,
|
|
@@ -25091,7 +25132,7 @@ ${pc30.bold("Cost Impact:")}`);
|
|
|
25091
25132
|
throw new Error(`Pulumi upgrade failed: ${msg}`);
|
|
25092
25133
|
}
|
|
25093
25134
|
let dnsAutoCreated = false;
|
|
25094
|
-
if (outputs.domain && outputs.dkimTokens && outputs.dkimTokens.length > 0) {
|
|
25135
|
+
if (!isJsonMode() && outputs.domain && outputs.dkimTokens && outputs.dkimTokens.length > 0) {
|
|
25095
25136
|
let dnsProvider = metadata.services.email?.dnsProvider;
|
|
25096
25137
|
if (!dnsProvider) {
|
|
25097
25138
|
const availableProviders = await progress.execute(
|
|
@@ -27915,6 +27956,7 @@ init_json_output();
|
|
|
27915
27956
|
init_metadata();
|
|
27916
27957
|
init_output();
|
|
27917
27958
|
init_prompts();
|
|
27959
|
+
init_pulumi();
|
|
27918
27960
|
function buildConsolePolicyDocument(emailConfig, smsConfig) {
|
|
27919
27961
|
const statements = [];
|
|
27920
27962
|
statements.push({
|
|
@@ -31798,6 +31840,7 @@ init_aws();
|
|
|
31798
31840
|
init_fs();
|
|
31799
31841
|
init_metadata();
|
|
31800
31842
|
init_output();
|
|
31843
|
+
init_pulumi();
|
|
31801
31844
|
async function dashboard(options) {
|
|
31802
31845
|
await ensurePulumiInstalled();
|
|
31803
31846
|
clack36.intro(pc39.bold("Wraps Dashboard"));
|
|
@@ -32032,6 +32075,7 @@ init_aws();
|
|
|
32032
32075
|
init_fs();
|
|
32033
32076
|
init_json_output();
|
|
32034
32077
|
init_output();
|
|
32078
|
+
init_pulumi();
|
|
32035
32079
|
import * as clack38 from "@clack/prompts";
|
|
32036
32080
|
import * as pulumi23 from "@pulumi/pulumi";
|
|
32037
32081
|
import pc41 from "picocolors";
|
|
@@ -32981,6 +33025,7 @@ init_fs();
|
|
|
32981
33025
|
init_json_output();
|
|
32982
33026
|
init_metadata();
|
|
32983
33027
|
init_output();
|
|
33028
|
+
init_pulumi();
|
|
32984
33029
|
async function smsDestroy(options) {
|
|
32985
33030
|
await ensurePulumiInstalled();
|
|
32986
33031
|
const startTime = Date.now();
|
|
@@ -33214,6 +33259,7 @@ init_json_output();
|
|
|
33214
33259
|
init_metadata();
|
|
33215
33260
|
init_output();
|
|
33216
33261
|
init_prompts();
|
|
33262
|
+
init_pulumi();
|
|
33217
33263
|
|
|
33218
33264
|
// src/utils/sms/costs.ts
|
|
33219
33265
|
init_esm_shims();
|
|
@@ -34273,6 +34319,7 @@ init_fs();
|
|
|
34273
34319
|
init_json_output();
|
|
34274
34320
|
init_metadata();
|
|
34275
34321
|
init_output();
|
|
34322
|
+
init_pulumi();
|
|
34276
34323
|
import * as clack42 from "@clack/prompts";
|
|
34277
34324
|
import * as pulumi27 from "@pulumi/pulumi";
|
|
34278
34325
|
import pc45 from "picocolors";
|
|
@@ -34395,6 +34442,7 @@ init_fs();
|
|
|
34395
34442
|
init_json_output();
|
|
34396
34443
|
init_metadata();
|
|
34397
34444
|
init_output();
|
|
34445
|
+
init_pulumi();
|
|
34398
34446
|
async function smsSync(options) {
|
|
34399
34447
|
await ensurePulumiInstalled();
|
|
34400
34448
|
const startTime = Date.now();
|
|
@@ -34832,6 +34880,7 @@ init_json_output();
|
|
|
34832
34880
|
init_metadata();
|
|
34833
34881
|
init_output();
|
|
34834
34882
|
init_prompts();
|
|
34883
|
+
init_pulumi();
|
|
34835
34884
|
async function smsUpgrade(options) {
|
|
34836
34885
|
const startTime = Date.now();
|
|
34837
34886
|
let upgradeAction = "";
|
|
@@ -36806,6 +36855,12 @@ args.options([
|
|
|
36806
36855
|
description: "Resend verification code",
|
|
36807
36856
|
defaultValue: false
|
|
36808
36857
|
},
|
|
36858
|
+
// Email upgrade options
|
|
36859
|
+
{
|
|
36860
|
+
name: "action",
|
|
36861
|
+
description: "Upgrade action (preset, smtp-credentials, events, archiving, etc.)",
|
|
36862
|
+
defaultValue: void 0
|
|
36863
|
+
},
|
|
36809
36864
|
// Email test options
|
|
36810
36865
|
{
|
|
36811
36866
|
name: "scenario",
|
|
@@ -37157,7 +37212,9 @@ async function run() {
|
|
|
37157
37212
|
region: flags.region,
|
|
37158
37213
|
yes: flags.yes,
|
|
37159
37214
|
preview: flags.preview,
|
|
37160
|
-
json: flags.json
|
|
37215
|
+
json: flags.json,
|
|
37216
|
+
action: flags.action,
|
|
37217
|
+
preset: flags.preset
|
|
37161
37218
|
});
|
|
37162
37219
|
break;
|
|
37163
37220
|
case "restore":
|