@wraps.dev/cli 2.21.6 → 2.21.11
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/api-lambda.zip +0 -0
- package/dist/cli.js +40 -59
- package/dist/cli.js.map +1 -1
- package/dist/lambda/event-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/.bundled +1 -1
- package/dist/lambda/sms-event-processor/.bundled +1 -1
- package/dist/selfhost-migrations/0000_absent_rogue.sql +203 -0
- package/dist/selfhost-migrations/0001_polite_maverick.sql +17 -0
- package/dist/selfhost-migrations/0002_perpetual_scorpion.sql +1 -0
- package/dist/selfhost-migrations/0003_wealthy_absorbing_man.sql +1 -0
- package/dist/selfhost-migrations/0004_opposite_blur.sql +1 -0
- package/dist/selfhost-migrations/0005_clear_terror.sql +4 -0
- package/dist/selfhost-migrations/0006_soft_black_widow.sql +20 -0
- package/dist/selfhost-migrations/0007_dazzling_saracen.sql +124 -0
- package/dist/selfhost-migrations/0008_broad_hannibal_king.sql +33 -0
- package/dist/selfhost-migrations/0009_bouncy_mystique.sql +73 -0
- package/dist/selfhost-migrations/0010_cheerful_valeria_richards.sql +18 -0
- package/dist/selfhost-migrations/0011_absent_thunderbolts.sql +2 -0
- package/dist/selfhost-migrations/0012_demonic_donald_blake.sql +1 -0
- package/dist/selfhost-migrations/0013_nifty_preak.sql +143 -0
- package/dist/selfhost-migrations/0014_hesitant_beast.sql +2 -0
- package/dist/selfhost-migrations/0015_blue_giant_girl.sql +1 -0
- package/dist/selfhost-migrations/0016_cooing_overlord.sql +1 -0
- package/dist/selfhost-migrations/0017_tranquil_ender_wiggin.sql +11 -0
- package/dist/selfhost-migrations/0018_talented_groot.sql +8 -0
- package/dist/selfhost-migrations/0019_ambitious_devos.sql +3 -0
- package/dist/selfhost-migrations/0020_misty_master_mold.sql +95 -0
- package/dist/selfhost-migrations/0021_regular_harrier.sql +14 -0
- package/dist/selfhost-migrations/0022_sour_blizzard.sql +10 -0
- package/dist/selfhost-migrations/0023_flawless_psynapse.sql +1 -0
- package/dist/selfhost-migrations/0024_premium_blindfold.sql +1 -0
- package/dist/selfhost-migrations/0025_unusual_santa_claus.sql +1 -0
- package/dist/selfhost-migrations/0026_volatile_pandemic.sql +2 -0
- package/dist/selfhost-migrations/0027_workable_logan.sql +4 -0
- package/dist/selfhost-migrations/0028_familiar_prodigy.sql +1 -0
- package/dist/selfhost-migrations/0029_cute_maddog.sql +13 -0
- package/dist/selfhost-migrations/0030_adorable_scarecrow.sql +1 -0
- package/dist/selfhost-migrations/0031_material_slapstick.sql +10 -0
- package/dist/selfhost-migrations/0032_hot_dust.sql +11 -0
- package/dist/selfhost-migrations/0033_slow_deathbird.sql +1 -0
- package/dist/selfhost-migrations/0034_lush_rafael_vega.sql +12 -0
- package/dist/selfhost-migrations/0035_normal_red_hulk.sql +8 -0
- package/dist/selfhost-migrations/0036_marvelous_ezekiel.sql +1 -0
- package/dist/selfhost-migrations/0037_swift_talisman.sql +8 -0
- package/dist/selfhost-migrations/0038_first_mandroid.sql +1 -0
- package/dist/selfhost-migrations/0039_fixed_stryfe.sql +1 -0
- package/dist/selfhost-migrations/0040_add_channel_check_constraints.sql +2 -0
- package/dist/selfhost-migrations/0041_black_spencer_smythe.sql +1 -0
- package/dist/selfhost-migrations/0042_plain_marvel_zombies.sql +2 -0
- package/dist/selfhost-migrations/0043_curved_champions.sql +1 -0
- package/dist/selfhost-migrations/0044_clean_iceman.sql +1 -0
- package/dist/selfhost-migrations/0045_condemned_steel_serpent.sql +1 -0
- package/dist/selfhost-migrations/0046_steep_ultimo.sql +2 -0
- package/dist/selfhost-migrations/0047_empty_sleepwalker.sql +2 -0
- package/dist/selfhost-migrations/0048_cheerful_multiple_man.sql +1 -0
- package/dist/selfhost-migrations/0049_nostalgic_loki.sql +3 -0
- package/dist/selfhost-migrations/0050_add_engagement_metadata.sql +4 -0
- package/dist/selfhost-migrations/0051_odd_marrow.sql +2 -0
- package/dist/selfhost-migrations/0052_redundant_siren.sql +5 -0
- package/dist/selfhost-migrations/0053_soft_carnage.sql +31 -0
- package/dist/selfhost-migrations/0054_blushing_vin_gonzales.sql +1 -0
- package/dist/selfhost-migrations/0055_broadcast_resume_columns.sql +12 -0
- package/dist/selfhost-migrations/0056_broadcast_resume_dedup_cleanup.sql +31 -0
- package/dist/selfhost-migrations/0057_audit_log_actoremail_jsonb.sql +5 -0
- package/dist/selfhost-migrations/meta/0000_snapshot.json +1311 -0
- package/dist/selfhost-migrations/meta/0001_snapshot.json +1454 -0
- package/dist/selfhost-migrations/meta/0002_snapshot.json +1460 -0
- package/dist/selfhost-migrations/meta/0003_snapshot.json +1467 -0
- package/dist/selfhost-migrations/meta/0004_snapshot.json +1473 -0
- package/dist/selfhost-migrations/meta/0005_snapshot.json +1499 -0
- package/dist/selfhost-migrations/meta/0006_snapshot.json +1617 -0
- package/dist/selfhost-migrations/meta/0007_snapshot.json +2581 -0
- package/dist/selfhost-migrations/meta/0008_snapshot.json +2861 -0
- package/dist/selfhost-migrations/meta/0009_snapshot.json +3447 -0
- package/dist/selfhost-migrations/meta/0010_snapshot.json +3586 -0
- package/dist/selfhost-migrations/meta/0011_snapshot.json +3600 -0
- package/dist/selfhost-migrations/meta/0012_snapshot.json +3607 -0
- package/dist/selfhost-migrations/meta/0013_snapshot.json +4697 -0
- package/dist/selfhost-migrations/meta/0014_snapshot.json +4704 -0
- package/dist/selfhost-migrations/meta/0015_snapshot.json +4697 -0
- package/dist/selfhost-migrations/meta/0016_snapshot.json +4703 -0
- package/dist/selfhost-migrations/meta/0017_snapshot.json +4769 -0
- package/dist/selfhost-migrations/meta/0018_snapshot.json +4821 -0
- package/dist/selfhost-migrations/meta/0019_snapshot.json +4840 -0
- package/dist/selfhost-migrations/meta/0020_snapshot.json +5602 -0
- package/dist/selfhost-migrations/meta/0021_snapshot.json +5729 -0
- package/dist/selfhost-migrations/meta/0022_snapshot.json +5792 -0
- package/dist/selfhost-migrations/meta/0023_snapshot.json +5799 -0
- package/dist/selfhost-migrations/meta/0024_snapshot.json +5821 -0
- package/dist/selfhost-migrations/meta/0025_snapshot.json +5831 -0
- package/dist/selfhost-migrations/meta/0026_snapshot.json +5844 -0
- package/dist/selfhost-migrations/meta/0027_snapshot.json +5864 -0
- package/dist/selfhost-migrations/meta/0028_snapshot.json +5871 -0
- package/dist/selfhost-migrations/meta/0029_snapshot.json +5984 -0
- package/dist/selfhost-migrations/meta/0030_snapshot.json +5990 -0
- package/dist/selfhost-migrations/meta/0031_snapshot.json +5950 -0
- package/dist/selfhost-migrations/meta/0032_snapshot.json +6042 -0
- package/dist/selfhost-migrations/meta/0033_snapshot.json +6057 -0
- package/dist/selfhost-migrations/meta/0034_snapshot.json +6130 -0
- package/dist/selfhost-migrations/meta/0035_snapshot.json +6195 -0
- package/dist/selfhost-migrations/meta/0036_snapshot.json +6201 -0
- package/dist/selfhost-migrations/meta/0037_snapshot.json +6265 -0
- package/dist/selfhost-migrations/meta/0038_snapshot.json +6271 -0
- package/dist/selfhost-migrations/meta/0039_snapshot.json +6278 -0
- package/dist/selfhost-migrations/meta/0041_snapshot.json +6284 -0
- package/dist/selfhost-migrations/meta/0042_snapshot.json +6297 -0
- package/dist/selfhost-migrations/meta/0043_snapshot.json +6297 -0
- package/dist/selfhost-migrations/meta/0044_snapshot.json +6297 -0
- package/dist/selfhost-migrations/meta/0045_snapshot.json +6303 -0
- package/dist/selfhost-migrations/meta/0046_snapshot.json +6315 -0
- package/dist/selfhost-migrations/meta/0047_snapshot.json +6330 -0
- package/dist/selfhost-migrations/meta/0048_snapshot.json +6336 -0
- package/dist/selfhost-migrations/meta/0049_snapshot.json +6366 -0
- package/dist/selfhost-migrations/meta/0050_snapshot.json +6390 -0
- package/dist/selfhost-migrations/meta/0051_snapshot.json +6403 -0
- package/dist/selfhost-migrations/meta/0052_snapshot.json +6470 -0
- package/dist/selfhost-migrations/meta/0053_snapshot.json +6470 -0
- package/dist/selfhost-migrations/meta/0054_snapshot.json +6646 -0
- package/dist/selfhost-migrations/meta/0055_snapshot.json +6677 -0
- package/dist/selfhost-migrations/meta/0056_snapshot.json +6677 -0
- package/dist/selfhost-migrations/meta/0057_snapshot.json +6674 -0
- package/dist/selfhost-migrations/meta/_journal.json +412 -0
- package/package.json +7 -4
|
Binary file
|
package/dist/cli.js
CHANGED
|
@@ -10356,7 +10356,7 @@ var init_update = __esm({
|
|
|
10356
10356
|
// src/cli.ts
|
|
10357
10357
|
init_esm_shims();
|
|
10358
10358
|
import { readFileSync as readFileSync3 } from "fs";
|
|
10359
|
-
import { dirname as
|
|
10359
|
+
import { dirname as dirname7, join as join24 } from "path";
|
|
10360
10360
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
10361
10361
|
import * as clack61 from "@clack/prompts";
|
|
10362
10362
|
import pc65 from "picocolors";
|
|
@@ -26214,7 +26214,7 @@ async function findCliNodeModules() {
|
|
|
26214
26214
|
const paths = [];
|
|
26215
26215
|
try {
|
|
26216
26216
|
const { createRequire } = await import("module");
|
|
26217
|
-
const { dirname:
|
|
26217
|
+
const { dirname: dirname8 } = await import("path");
|
|
26218
26218
|
for (const base of [
|
|
26219
26219
|
// The current file's location (works when running from source)
|
|
26220
26220
|
import.meta.url,
|
|
@@ -26224,7 +26224,7 @@ async function findCliNodeModules() {
|
|
|
26224
26224
|
try {
|
|
26225
26225
|
const req = createRequire(base);
|
|
26226
26226
|
const reactPkg = req.resolve("react/package.json");
|
|
26227
|
-
const reactNodeModules = join12(
|
|
26227
|
+
const reactNodeModules = join12(dirname8(reactPkg), "..");
|
|
26228
26228
|
if (existsSync10(join12(reactNodeModules, "react"))) {
|
|
26229
26229
|
paths.push(reactNodeModules);
|
|
26230
26230
|
break;
|
|
@@ -33221,10 +33221,9 @@ function buildConsolePolicyDocument2(emailConfig, smsConfig) {
|
|
|
33221
33221
|
|
|
33222
33222
|
// src/commands/selfhost/deploy.ts
|
|
33223
33223
|
init_esm_shims();
|
|
33224
|
-
import { execSync as execSync2 } from "child_process";
|
|
33225
33224
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
33226
|
-
import {
|
|
33227
|
-
import { join as join20 } from "path";
|
|
33225
|
+
import { existsSync as existsSync18 } from "fs";
|
|
33226
|
+
import { dirname as dirname5, join as join20 } from "path";
|
|
33228
33227
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
33229
33228
|
import * as clack43 from "@clack/prompts";
|
|
33230
33229
|
import * as pulumi26 from "@pulumi/pulumi";
|
|
@@ -33493,7 +33492,9 @@ init_metadata();
|
|
|
33493
33492
|
init_output();
|
|
33494
33493
|
init_pulumi();
|
|
33495
33494
|
var __filename2 = fileURLToPath5(import.meta.url);
|
|
33496
|
-
var
|
|
33495
|
+
var cliDir = dirname5(__filename2);
|
|
33496
|
+
var bundledLambdaZip = join20(cliDir, "api-lambda.zip");
|
|
33497
|
+
var bundledMigrationsDir = join20(cliDir, "selfhost-migrations");
|
|
33497
33498
|
async function selfhostDeploy(options) {
|
|
33498
33499
|
const startTime = Date.now();
|
|
33499
33500
|
if (!isJsonMode()) {
|
|
@@ -33604,22 +33605,12 @@ async function selfhostDeploy(options) {
|
|
|
33604
33605
|
process.exit(0);
|
|
33605
33606
|
}
|
|
33606
33607
|
}
|
|
33607
|
-
|
|
33608
|
-
|
|
33609
|
-
|
|
33610
|
-
|
|
33611
|
-
|
|
33612
|
-
|
|
33613
|
-
});
|
|
33614
|
-
const lambdaZipPath = join20(repoRoot, "apps/api/lambda.zip");
|
|
33615
|
-
const distDir = join20(repoRoot, "apps/api/dist");
|
|
33616
|
-
await progress.execute("Packaging Lambda", async () => {
|
|
33617
|
-
writeFileSync(join20(distDir, "package.json"), '{"type":"module"}\n');
|
|
33618
|
-
execSync2("/bin/sh -c 'zip -r ../lambda.zip .'", {
|
|
33619
|
-
cwd: distDir,
|
|
33620
|
-
stdio: childStdio
|
|
33621
|
-
});
|
|
33622
|
-
});
|
|
33608
|
+
if (!existsSync18(bundledLambdaZip)) {
|
|
33609
|
+
throw new Error(
|
|
33610
|
+
`Bundled API lambda not found at ${bundledLambdaZip}. Run 'pnpm build' in the CLI package to generate it.`
|
|
33611
|
+
);
|
|
33612
|
+
}
|
|
33613
|
+
const lambdaZipPath = bundledLambdaZip;
|
|
33623
33614
|
if (!resolvedDatabaseUrl) {
|
|
33624
33615
|
const neonProject = await progress.execute(
|
|
33625
33616
|
"Provisioning Neon PostgreSQL database",
|
|
@@ -33669,14 +33660,14 @@ async function selfhostDeploy(options) {
|
|
|
33669
33660
|
savedMetadata.timestamp = deployedAt;
|
|
33670
33661
|
await saveConnectionMetadata(savedMetadata);
|
|
33671
33662
|
await progress.execute("Running database migrations", async () => {
|
|
33672
|
-
|
|
33673
|
-
|
|
33674
|
-
|
|
33675
|
-
|
|
33676
|
-
|
|
33677
|
-
|
|
33678
|
-
|
|
33679
|
-
|
|
33663
|
+
const { neonConfig, Pool } = await import("@neondatabase/serverless");
|
|
33664
|
+
const { drizzle } = await import("drizzle-orm/neon-serverless");
|
|
33665
|
+
const { migrate } = await import("drizzle-orm/neon-serverless/migrator");
|
|
33666
|
+
neonConfig.poolQueryViaFetch = true;
|
|
33667
|
+
const pool = new Pool({ connectionString: databaseUrl });
|
|
33668
|
+
const db = drizzle(pool);
|
|
33669
|
+
await migrate(db, { migrationsFolder: bundledMigrationsDir });
|
|
33670
|
+
await pool.end();
|
|
33680
33671
|
});
|
|
33681
33672
|
const createStack = async () => {
|
|
33682
33673
|
await ensurePulumiWorkDir({
|
|
@@ -33985,9 +33976,8 @@ Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
33985
33976
|
|
|
33986
33977
|
// src/commands/selfhost/upgrade.ts
|
|
33987
33978
|
init_esm_shims();
|
|
33988
|
-
import {
|
|
33989
|
-
import {
|
|
33990
|
-
import { join as join21 } from "path";
|
|
33979
|
+
import { existsSync as existsSync19 } from "fs";
|
|
33980
|
+
import { dirname as dirname6, join as join21 } from "path";
|
|
33991
33981
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
33992
33982
|
import * as clack46 from "@clack/prompts";
|
|
33993
33983
|
import * as pulumi27 from "@pulumi/pulumi";
|
|
@@ -34002,7 +33992,8 @@ init_output();
|
|
|
34002
33992
|
init_pulumi();
|
|
34003
33993
|
init_region_resolver();
|
|
34004
33994
|
var __filename3 = fileURLToPath6(import.meta.url);
|
|
34005
|
-
var
|
|
33995
|
+
var cliDir2 = dirname6(__filename3);
|
|
33996
|
+
var bundledLambdaZip2 = join21(cliDir2, "api-lambda.zip");
|
|
34006
33997
|
async function selfhostUpgrade(options) {
|
|
34007
33998
|
const startTime = Date.now();
|
|
34008
33999
|
if (!isJsonMode()) {
|
|
@@ -34049,22 +34040,12 @@ async function selfhostUpgrade(options) {
|
|
|
34049
34040
|
}
|
|
34050
34041
|
const config2 = selfhostService.config;
|
|
34051
34042
|
const stackName = selfhostService.pulumiStackName || `wraps-selfhost-${identity.accountId}-${region}`;
|
|
34052
|
-
|
|
34053
|
-
|
|
34054
|
-
|
|
34055
|
-
|
|
34056
|
-
|
|
34057
|
-
|
|
34058
|
-
});
|
|
34059
|
-
const lambdaZipPath = join21(repoRoot2, "apps/api/lambda.zip");
|
|
34060
|
-
const distDir = join21(repoRoot2, "apps/api/dist");
|
|
34061
|
-
await progress.execute("Packaging Lambda", async () => {
|
|
34062
|
-
writeFileSync2(join21(distDir, "package.json"), '{"type":"module"}\n');
|
|
34063
|
-
execSync3("/bin/sh -c 'zip -r ../lambda.zip .'", {
|
|
34064
|
-
cwd: distDir,
|
|
34065
|
-
stdio: childStdio
|
|
34066
|
-
});
|
|
34067
|
-
});
|
|
34043
|
+
if (!existsSync19(bundledLambdaZip2)) {
|
|
34044
|
+
throw new Error(
|
|
34045
|
+
`Bundled API lambda not found at ${bundledLambdaZip2}. Run 'pnpm build' in the CLI package to generate it.`
|
|
34046
|
+
);
|
|
34047
|
+
}
|
|
34048
|
+
const lambdaZipPath = bundledLambdaZip2;
|
|
34068
34049
|
const createStack = async () => {
|
|
34069
34050
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
34070
34051
|
const stack = await pulumi27.automation.LocalWorkspace.createOrSelectStack(
|
|
@@ -41432,7 +41413,7 @@ async function telemetryStatus() {
|
|
|
41432
41413
|
|
|
41433
41414
|
// src/commands/workflow/init.ts
|
|
41434
41415
|
init_esm_shims();
|
|
41435
|
-
import { existsSync as
|
|
41416
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync2, writeFileSync } from "fs";
|
|
41436
41417
|
import { join as join22 } from "path";
|
|
41437
41418
|
import * as clack60 from "@clack/prompts";
|
|
41438
41419
|
import pc63 from "picocolors";
|
|
@@ -41534,11 +41515,11 @@ async function workflowInit(options = {}) {
|
|
|
41534
41515
|
const wrapsDir = join22(process.cwd(), "wraps");
|
|
41535
41516
|
const workflowsDir = join22(wrapsDir, "workflows");
|
|
41536
41517
|
const configPath = join22(wrapsDir, "wraps.config.ts");
|
|
41537
|
-
if (
|
|
41518
|
+
if (existsSync20(workflowsDir)) {
|
|
41538
41519
|
clack60.log.info(
|
|
41539
41520
|
`Workflows directory already exists at ${pc63.cyan("wraps/workflows/")}`
|
|
41540
41521
|
);
|
|
41541
|
-
const files =
|
|
41522
|
+
const files = existsSync20(join22(workflowsDir, "cart-recovery.ts")) || existsSync20(join22(workflowsDir, "welcome-sequence.ts"));
|
|
41542
41523
|
if (files && !options.yes) {
|
|
41543
41524
|
const shouldContinue = await clack60.confirm({
|
|
41544
41525
|
message: "Example files may already exist. Overwrite them?",
|
|
@@ -41558,19 +41539,19 @@ async function workflowInit(options = {}) {
|
|
|
41558
41539
|
mkdirSync2(workflowsDir, { recursive: true });
|
|
41559
41540
|
s.stop("Created wraps/workflows/");
|
|
41560
41541
|
s.start("Scaffolding example workflows...");
|
|
41561
|
-
|
|
41542
|
+
writeFileSync(
|
|
41562
41543
|
join22(workflowsDir, "cart-recovery.ts"),
|
|
41563
41544
|
EXAMPLE_CASCADE_WORKFLOW,
|
|
41564
41545
|
"utf-8"
|
|
41565
41546
|
);
|
|
41566
|
-
|
|
41547
|
+
writeFileSync(
|
|
41567
41548
|
join22(workflowsDir, "welcome-sequence.ts"),
|
|
41568
41549
|
EXAMPLE_WELCOME_WORKFLOW,
|
|
41569
41550
|
"utf-8"
|
|
41570
41551
|
);
|
|
41571
41552
|
s.stop("Created 2 example workflows");
|
|
41572
|
-
if (!
|
|
41573
|
-
|
|
41553
|
+
if (!existsSync20(configPath)) {
|
|
41554
|
+
writeFileSync(configPath, EXAMPLE_CONFIG, "utf-8");
|
|
41574
41555
|
clack60.log.info(`Created ${pc63.cyan("wraps/wraps.config.ts")}`);
|
|
41575
41556
|
}
|
|
41576
41557
|
clack60.log.success(
|
|
@@ -41782,7 +41763,7 @@ if (nodeMajorVersion < 20) {
|
|
|
41782
41763
|
process.exit(1);
|
|
41783
41764
|
}
|
|
41784
41765
|
var __filename4 = fileURLToPath8(import.meta.url);
|
|
41785
|
-
var __dirname3 =
|
|
41766
|
+
var __dirname3 = dirname7(__filename4);
|
|
41786
41767
|
var packageJson = JSON.parse(
|
|
41787
41768
|
readFileSync3(join24(__dirname3, "../package.json"), "utf-8")
|
|
41788
41769
|
);
|