@quiltdata/benchling-webhook 0.7.4-20251107T053446Z → 0.7.4-20251113T165616Z
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/README.md +6 -4
- package/dist/bin/cli.js +34 -24
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/commands/get-env.d.ts +16 -0
- package/dist/bin/commands/get-env.d.ts.map +1 -0
- package/dist/bin/commands/get-env.js +210 -0
- package/dist/bin/commands/get-env.js.map +1 -0
- package/dist/bin/commands/infer-quilt-config.d.ts +3 -2
- package/dist/bin/commands/infer-quilt-config.d.ts.map +1 -1
- package/dist/bin/commands/infer-quilt-config.js +39 -65
- package/dist/bin/commands/infer-quilt-config.js.map +1 -1
- package/dist/bin/commands/install.d.ts +57 -0
- package/dist/bin/commands/install.d.ts.map +1 -0
- package/dist/bin/commands/install.js +166 -0
- package/dist/bin/commands/install.js.map +1 -0
- package/dist/bin/commands/setup-wizard.d.ts +12 -2
- package/dist/bin/commands/setup-wizard.d.ts.map +1 -1
- package/dist/bin/commands/setup-wizard.js +123 -131
- package/dist/bin/commands/setup-wizard.js.map +1 -1
- package/dist/bin/commands/sync-secrets.d.ts +6 -3
- package/dist/bin/commands/sync-secrets.d.ts.map +1 -1
- package/dist/bin/commands/sync-secrets.js +14 -6
- package/dist/bin/commands/sync-secrets.js.map +1 -1
- package/dist/lib/context-detector.d.ts +33 -0
- package/dist/lib/context-detector.d.ts.map +1 -0
- package/dist/lib/context-detector.js +224 -0
- package/dist/lib/context-detector.js.map +1 -0
- package/dist/lib/interfaces/config-storage.d.ts +80 -0
- package/dist/lib/interfaces/config-storage.d.ts.map +1 -0
- package/dist/lib/interfaces/config-storage.js +9 -0
- package/dist/lib/interfaces/config-storage.js.map +1 -0
- package/dist/lib/next-steps-generator.d.ts +53 -0
- package/dist/lib/next-steps-generator.d.ts.map +1 -0
- package/dist/lib/next-steps-generator.js +180 -0
- package/dist/lib/next-steps-generator.js.map +1 -0
- package/dist/lib/types/next-steps.d.ts +93 -0
- package/dist/lib/types/next-steps.d.ts.map +1 -0
- package/dist/lib/types/next-steps.js +8 -0
- package/dist/lib/types/next-steps.js.map +1 -0
- package/dist/lib/utils/stack-inference.d.ts +28 -0
- package/dist/lib/utils/stack-inference.d.ts.map +1 -1
- package/dist/lib/utils/stack-inference.js +61 -0
- package/dist/lib/utils/stack-inference.js.map +1 -1
- package/dist/lib/xdg-base.d.ts +306 -0
- package/dist/lib/xdg-base.d.ts.map +1 -0
- package/dist/lib/xdg-base.js +440 -0
- package/dist/lib/xdg-base.js.map +1 -0
- package/dist/lib/xdg-config.d.ts +54 -187
- package/dist/lib/xdg-config.d.ts.map +1 -1
- package/dist/lib/xdg-config.js +83 -342
- package/dist/lib/xdg-config.js.map +1 -1
- package/dist/package.json +5 -4
- package/dist/scripts/list-quilt-stacks.d.ts +14 -0
- package/dist/scripts/list-quilt-stacks.d.ts.map +1 -0
- package/dist/scripts/list-quilt-stacks.js +96 -0
- package/dist/scripts/list-quilt-stacks.js.map +1 -0
- package/env.template +79 -0
- package/package.json +5 -4
- package/dist/bin/commands/config-show.d.ts +0 -14
- package/dist/bin/commands/config-show.d.ts.map +0 -1
- package/dist/bin/commands/config-show.js +0 -24
- package/dist/bin/commands/config-show.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Install Command - Setup + Deploy Orchestration
|
|
4
|
+
*
|
|
5
|
+
* Implements the default CLI workflow that chains setup wizard and deployment.
|
|
6
|
+
* Users can opt out of deployment via --setup-only flag or skip confirmation via --yes.
|
|
7
|
+
*
|
|
8
|
+
* @module commands/install
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Options for install command
|
|
12
|
+
*/
|
|
13
|
+
export interface InstallCommandOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Configuration profile name
|
|
16
|
+
* @default "default"
|
|
17
|
+
*/
|
|
18
|
+
profile?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Base profile to inherit from
|
|
21
|
+
*/
|
|
22
|
+
inheritFrom?: string;
|
|
23
|
+
/**
|
|
24
|
+
* AWS credentials profile
|
|
25
|
+
*/
|
|
26
|
+
awsProfile?: string;
|
|
27
|
+
/**
|
|
28
|
+
* AWS region
|
|
29
|
+
*/
|
|
30
|
+
awsRegion?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Skip deployment step (setup only)
|
|
33
|
+
*/
|
|
34
|
+
setupOnly?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Skip confirmation prompts (auto-deploy)
|
|
37
|
+
*/
|
|
38
|
+
yes?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Non-interactive mode
|
|
41
|
+
*/
|
|
42
|
+
nonInteractive?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Install command - orchestrates setup → deploy workflow
|
|
46
|
+
*
|
|
47
|
+
* This is the default CLI command that provides a seamless installation experience:
|
|
48
|
+
* 1. Runs setup wizard to configure the application
|
|
49
|
+
* 2. Prompts user to deploy (unless --yes or --setup-only)
|
|
50
|
+
* 3. Executes deployment if confirmed
|
|
51
|
+
* 4. Displays appropriate next steps
|
|
52
|
+
*
|
|
53
|
+
* @param options - Install command options
|
|
54
|
+
* @throws Error if setup fails or deployment fails
|
|
55
|
+
*/
|
|
56
|
+
export declare function installCommand(options?: InstallCommandOptions): Promise<void>;
|
|
57
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../bin/commands/install.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAQH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAyIvF"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Install Command - Setup + Deploy Orchestration
|
|
5
|
+
*
|
|
6
|
+
* Implements the default CLI workflow that chains setup wizard and deployment.
|
|
7
|
+
* Users can opt out of deployment via --setup-only flag or skip confirmation via --yes.
|
|
8
|
+
*
|
|
9
|
+
* @module commands/install
|
|
10
|
+
*/
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.installCommand = installCommand;
|
|
16
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
17
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
+
const setup_wizard_1 = require("./setup-wizard");
|
|
19
|
+
const deploy_1 = require("./deploy");
|
|
20
|
+
const next_steps_generator_1 = require("../../lib/next-steps-generator");
|
|
21
|
+
/**
|
|
22
|
+
* Install command - orchestrates setup → deploy workflow
|
|
23
|
+
*
|
|
24
|
+
* This is the default CLI command that provides a seamless installation experience:
|
|
25
|
+
* 1. Runs setup wizard to configure the application
|
|
26
|
+
* 2. Prompts user to deploy (unless --yes or --setup-only)
|
|
27
|
+
* 3. Executes deployment if confirmed
|
|
28
|
+
* 4. Displays appropriate next steps
|
|
29
|
+
*
|
|
30
|
+
* @param options - Install command options
|
|
31
|
+
* @throws Error if setup fails or deployment fails
|
|
32
|
+
*/
|
|
33
|
+
async function installCommand(options = {}) {
|
|
34
|
+
const { profile = "default", inheritFrom, awsProfile, awsRegion, setupOnly = false, yes = false, nonInteractive = false, } = options;
|
|
35
|
+
// Validate flags
|
|
36
|
+
validateFlags({ setupOnly, yes });
|
|
37
|
+
// Step 1: Run setup wizard
|
|
38
|
+
console.log(chalk_1.default.blue("\n═══════════════════════════════════════════════════════════\n"));
|
|
39
|
+
console.log(chalk_1.default.bold("Step 1: Configuration Setup\n"));
|
|
40
|
+
let setupResult;
|
|
41
|
+
try {
|
|
42
|
+
setupResult = await (0, setup_wizard_1.setupWizardCommand)({
|
|
43
|
+
profile,
|
|
44
|
+
inheritFrom,
|
|
45
|
+
awsProfile,
|
|
46
|
+
awsRegion,
|
|
47
|
+
nonInteractive,
|
|
48
|
+
isPartOfInstall: true, // Suppress next steps from setup wizard
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const err = error;
|
|
53
|
+
console.error(chalk_1.default.red(`\n✗ Setup failed: ${err.message}`));
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
// Check setup success
|
|
57
|
+
if (!setupResult.success) {
|
|
58
|
+
throw new Error("Setup failed. Please check the errors above and try again.");
|
|
59
|
+
}
|
|
60
|
+
console.log(chalk_1.default.green("\n✓ Setup complete!\n"));
|
|
61
|
+
// Step 2: Determine if we should deploy
|
|
62
|
+
if (setupOnly) {
|
|
63
|
+
// User explicitly requested setup only
|
|
64
|
+
console.log(chalk_1.default.blue("═══════════════════════════════════════════════════════════\n"));
|
|
65
|
+
console.log(chalk_1.default.yellow("Deployment skipped (--setup-only flag).\n"));
|
|
66
|
+
// Show next steps for manual deployment
|
|
67
|
+
const nextSteps = (0, next_steps_generator_1.generateNextSteps)({
|
|
68
|
+
profile: setupResult.profile,
|
|
69
|
+
stage: determineStage(setupResult.profile),
|
|
70
|
+
skipDeployment: true,
|
|
71
|
+
});
|
|
72
|
+
console.log(nextSteps);
|
|
73
|
+
console.log();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// Step 3: Prompt for deployment (unless --yes)
|
|
77
|
+
let shouldDeploy = yes;
|
|
78
|
+
if (!yes && !nonInteractive) {
|
|
79
|
+
console.log(chalk_1.default.blue("═══════════════════════════════════════════════════════════\n"));
|
|
80
|
+
console.log(chalk_1.default.bold("Step 2: Deployment\n"));
|
|
81
|
+
const answers = await inquirer_1.default.prompt([
|
|
82
|
+
{
|
|
83
|
+
type: "confirm",
|
|
84
|
+
name: "shouldDeploy",
|
|
85
|
+
message: "Deploy to AWS now?",
|
|
86
|
+
default: true,
|
|
87
|
+
},
|
|
88
|
+
]);
|
|
89
|
+
shouldDeploy = answers.shouldDeploy;
|
|
90
|
+
}
|
|
91
|
+
if (!shouldDeploy) {
|
|
92
|
+
// User declined deployment
|
|
93
|
+
console.log(chalk_1.default.blue("\n═══════════════════════════════════════════════════════════\n"));
|
|
94
|
+
console.log(chalk_1.default.yellow("Deployment skipped.\n"));
|
|
95
|
+
// Show next steps for manual deployment
|
|
96
|
+
const nextSteps = (0, next_steps_generator_1.generateNextSteps)({
|
|
97
|
+
profile: setupResult.profile,
|
|
98
|
+
stage: determineStage(setupResult.profile),
|
|
99
|
+
skipDeployment: true,
|
|
100
|
+
});
|
|
101
|
+
console.log(nextSteps);
|
|
102
|
+
console.log();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// Step 4: Execute deployment
|
|
106
|
+
console.log(chalk_1.default.blue("\n═══════════════════════════════════════════════════════════\n"));
|
|
107
|
+
console.log(chalk_1.default.bold("Step 2: Deployment\n"));
|
|
108
|
+
console.log("Deploying to AWS... This may take 5-10 minutes.\n");
|
|
109
|
+
const stage = determineStage(setupResult.profile);
|
|
110
|
+
try {
|
|
111
|
+
await (0, deploy_1.deployCommand)({
|
|
112
|
+
profile: setupResult.profile,
|
|
113
|
+
stage,
|
|
114
|
+
yes: true, // Skip deploy command's own confirmation
|
|
115
|
+
});
|
|
116
|
+
// Step 5: Show success message and next steps
|
|
117
|
+
console.log(chalk_1.default.blue("\n═══════════════════════════════════════════════════════════\n"));
|
|
118
|
+
console.log(chalk_1.default.green.bold("✓ Installation Complete!\n"));
|
|
119
|
+
// Note: Deploy command shows its own outputs and next steps
|
|
120
|
+
// We don't need to duplicate that here
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
const err = error;
|
|
124
|
+
console.error(chalk_1.default.red(`\n✗ Deployment failed: ${err.message}`));
|
|
125
|
+
// Show recovery next steps
|
|
126
|
+
console.log(chalk_1.default.blue("\n═══════════════════════════════════════════════════════════\n"));
|
|
127
|
+
console.log(chalk_1.default.yellow("Setup was successful, but deployment failed.\n"));
|
|
128
|
+
const nextSteps = (0, next_steps_generator_1.generateNextSteps)({
|
|
129
|
+
profile: setupResult.profile,
|
|
130
|
+
stage,
|
|
131
|
+
deployment: {
|
|
132
|
+
success: false,
|
|
133
|
+
error: err.message,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
console.log(nextSteps);
|
|
137
|
+
console.log();
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Determine deployment stage from profile name
|
|
143
|
+
*
|
|
144
|
+
* @param profile - Profile name
|
|
145
|
+
* @returns Deployment stage (dev or prod)
|
|
146
|
+
*/
|
|
147
|
+
function determineStage(profile) {
|
|
148
|
+
if (profile === "prod") {
|
|
149
|
+
return "prod";
|
|
150
|
+
}
|
|
151
|
+
// Default and all other profiles deploy to dev
|
|
152
|
+
return "dev";
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Validate flag combinations
|
|
156
|
+
*
|
|
157
|
+
* @param options - Options to validate
|
|
158
|
+
* @throws Error if invalid flag combination
|
|
159
|
+
*/
|
|
160
|
+
function validateFlags(options) {
|
|
161
|
+
if (options.setupOnly && options.yes) {
|
|
162
|
+
throw new Error("Cannot use both --setup-only and --yes flags. " +
|
|
163
|
+
"Use --setup-only to skip deployment, or --yes to auto-deploy.");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../bin/commands/install.ts"],"names":[],"mappings":";;AACA;;;;;;;GAOG;;;;;AA6DH,wCAyIC;AApMD,wDAAgC;AAChC,kDAA0B;AAC1B,iDAAuE;AACvE,qCAAyC;AACzC,yEAAmE;AA2CnE;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,cAAc,CAAC,UAAiC,EAAE;IACpE,MAAM,EACF,OAAO,GAAG,SAAS,EACnB,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,GAAG,KAAK,EACjB,GAAG,GAAG,KAAK,EACX,cAAc,GAAG,KAAK,GACzB,GAAG,OAAO,CAAC;IAEZ,iBAAiB;IACjB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IAElC,2BAA2B;IAC3B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC,CAAC;IAC3F,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAEzD,IAAI,WAA8B,CAAC;IAEnC,IAAI,CAAC;QACD,WAAW,GAAG,MAAM,IAAA,iCAAkB,EAAC;YACnC,OAAO;YACP,WAAW;YACX,UAAU;YACV,SAAS;YACT,cAAc;YACd,eAAe,EAAE,IAAI,EAAE,wCAAwC;SAClE,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,KAAc,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,qBAAqB,GAAG,CAAC,OAAO,EAAE,CA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uCAAuC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,KAAc,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,0BAA0B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAElE,2BAA2B;QAC3B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC,CAAC;QAC3F,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAC,CAAC;QAE5E,MAAM,SAAS,GAAG,IAAA,wCAAiB,EAAC;YAChC,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,KAAK;YACL,UAAU,EAAE;gBACR,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,GAAG,CAAC,OAAO;aACrB;SACJ,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,CAAC,GAAG,EAAE,CAAC;QAEd,MAAM,KAAK,CAAC;IAChB,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,OAAe;IACnC,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,+CAA+C;IAC/C,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAAC,OAA6C;IAChE,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACX,gDAAgD;YAC5C,+DAA+D,CACtE,CAAC;IACN,CAAC;AACL,CAAC"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @module commands/setup-wizard
|
|
15
15
|
*/
|
|
16
|
+
import { ProfileConfig } from "../../lib/types/config";
|
|
16
17
|
/**
|
|
17
18
|
* Install wizard options
|
|
18
19
|
*/
|
|
@@ -24,12 +25,21 @@ export interface InstallWizardOptions {
|
|
|
24
25
|
skipSecretsSync?: boolean;
|
|
25
26
|
awsProfile?: string;
|
|
26
27
|
awsRegion?: string;
|
|
28
|
+
isPartOfInstall?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Setup wizard result (for Phase 3)
|
|
32
|
+
*/
|
|
33
|
+
export interface SetupWizardResult {
|
|
34
|
+
success: boolean;
|
|
35
|
+
profile: string;
|
|
36
|
+
config: ProfileConfig;
|
|
27
37
|
}
|
|
28
38
|
/**
|
|
29
39
|
* Setup wizard command handler
|
|
30
40
|
*
|
|
31
41
|
* @param options - Wizard options
|
|
32
|
-
* @returns Promise that resolves
|
|
42
|
+
* @returns Promise that resolves with setup result
|
|
33
43
|
*/
|
|
34
|
-
export declare function setupWizardCommand(options?: InstallWizardOptions): Promise<
|
|
44
|
+
export declare function setupWizardCommand(options?: InstallWizardOptions): Promise<SetupWizardResult>;
|
|
35
45
|
//# sourceMappingURL=setup-wizard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-wizard.d.ts","sourceRoot":"","sources":["../../../bin/commands/setup-wizard.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"setup-wizard.d.ts","sourceRoot":"","sources":["../../../bin/commands/setup-wizard.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAQH,OAAO,EAAE,aAAa,EAAoB,MAAM,wBAAwB,CAAC;AAylBzE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;CACzB;AAiND;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAevG"}
|
|
@@ -60,6 +60,7 @@ const xdg_config_1 = require("../../lib/xdg-config");
|
|
|
60
60
|
const infer_quilt_config_1 = require("../commands/infer-quilt-config");
|
|
61
61
|
const sqs_1 = require("../../lib/utils/sqs");
|
|
62
62
|
const manifest_1 = require("./manifest");
|
|
63
|
+
const next_steps_generator_1 = require("../../lib/next-steps-generator");
|
|
63
64
|
// =============================================================================
|
|
64
65
|
// VALIDATION FUNCTIONS (from scripts/config/validator.ts)
|
|
65
66
|
// =============================================================================
|
|
@@ -286,66 +287,64 @@ async function runConfigWizard(options = {}) {
|
|
|
286
287
|
}
|
|
287
288
|
return finalConfig;
|
|
288
289
|
}
|
|
289
|
-
//
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
290
|
+
// Always prompt for Quilt configuration (use existing/inferred values as defaults)
|
|
291
|
+
console.log("Step 1: Quilt Configuration\n");
|
|
292
|
+
const quiltAnswers = await inquirer_1.default.prompt([
|
|
293
|
+
{
|
|
294
|
+
type: "input",
|
|
295
|
+
name: "stackArn",
|
|
296
|
+
message: "Quilt Stack ARN:",
|
|
297
|
+
default: config.quilt?.stackArn,
|
|
298
|
+
validate: (input) => input.trim().length > 0 && input.startsWith("arn:aws:cloudformation:") ||
|
|
299
|
+
"Stack ARN is required and must start with arn:aws:cloudformation:",
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
type: "input",
|
|
303
|
+
name: "catalog",
|
|
304
|
+
message: "Quilt Catalog URL (domain or full URL):",
|
|
305
|
+
default: config.quilt?.catalog,
|
|
306
|
+
validate: (input) => {
|
|
307
|
+
const trimmed = input.trim();
|
|
308
|
+
if (trimmed.length === 0) {
|
|
309
|
+
return "Catalog URL is required";
|
|
310
|
+
}
|
|
311
|
+
return true;
|
|
300
312
|
},
|
|
301
|
-
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
message: "Quilt Catalog URL (domain or full URL):",
|
|
305
|
-
default: config.quilt?.catalog,
|
|
306
|
-
validate: (input) => {
|
|
307
|
-
const trimmed = input.trim();
|
|
308
|
-
if (trimmed.length === 0) {
|
|
309
|
-
return "Catalog URL is required";
|
|
310
|
-
}
|
|
311
|
-
return true;
|
|
312
|
-
},
|
|
313
|
-
filter: (input) => {
|
|
314
|
-
// Strip protocol if present, store only domain
|
|
315
|
-
return input.trim().replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
316
|
-
},
|
|
313
|
+
filter: (input) => {
|
|
314
|
+
// Strip protocol if present, store only domain
|
|
315
|
+
return input.trim().replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
317
316
|
},
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
type: "input",
|
|
320
|
+
name: "database",
|
|
321
|
+
message: "Quilt Athena Database:",
|
|
322
|
+
default: config.quilt?.database || "quilt_catalog",
|
|
323
|
+
validate: (input) => input.trim().length > 0 || "Database name is required",
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
type: "input",
|
|
327
|
+
name: "queueUrl",
|
|
328
|
+
message: "SQS Queue URL:",
|
|
329
|
+
default: config.quilt?.queueUrl,
|
|
330
|
+
validate: (input) => {
|
|
331
|
+
return (0, sqs_1.isQueueUrl)(input) ||
|
|
332
|
+
"Queue URL is required and must look like https://sqs.<region>.amazonaws.com/<account>/<queue>";
|
|
334
333
|
},
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
334
|
+
},
|
|
335
|
+
]);
|
|
336
|
+
// Extract region and account ID from stack ARN
|
|
337
|
+
// ARN format: arn:aws:cloudformation:REGION:ACCOUNT_ID:stack/STACK_NAME/STACK_ID
|
|
338
|
+
const arnMatch = quiltAnswers.stackArn.match(/^arn:aws:cloudformation:([^:]+):(\d{12}):/);
|
|
339
|
+
const quiltRegion = arnMatch ? arnMatch[1] : "us-east-1";
|
|
340
|
+
awsAccountId = arnMatch ? arnMatch[2] : undefined;
|
|
341
|
+
config.quilt = {
|
|
342
|
+
stackArn: quiltAnswers.stackArn,
|
|
343
|
+
catalog: quiltAnswers.catalog,
|
|
344
|
+
database: quiltAnswers.database,
|
|
345
|
+
queueUrl: quiltAnswers.queueUrl,
|
|
346
|
+
region: quiltRegion,
|
|
347
|
+
};
|
|
349
348
|
// Prompt for Benchling configuration
|
|
350
349
|
console.log("\nStep 2: Benchling Configuration\n");
|
|
351
350
|
// First, get tenant
|
|
@@ -482,7 +481,8 @@ async function runConfigWizard(options = {}) {
|
|
|
482
481
|
type: "input",
|
|
483
482
|
name: "region",
|
|
484
483
|
message: "AWS Deployment Region:",
|
|
485
|
-
|
|
484
|
+
// Prefer inferred region from Quilt stack, then existing deployment config, then fallback
|
|
485
|
+
default: config.quilt?.region || config.deployment?.region || "us-east-1",
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
488
|
type: "input",
|
|
@@ -554,88 +554,84 @@ async function runConfigWizard(options = {}) {
|
|
|
554
554
|
* 6. Sync secrets to AWS Secrets Manager
|
|
555
555
|
*/
|
|
556
556
|
async function runInstallWizard(options = {}) {
|
|
557
|
-
const { profile = "default", inheritFrom, nonInteractive = false, skipValidation = false, skipSecretsSync = false, awsProfile, awsRegion
|
|
557
|
+
const { profile = "default", inheritFrom, nonInteractive = false, skipValidation = false, skipSecretsSync = false, awsProfile, awsRegion, // NO DEFAULT - let inferQuiltConfig fetch region from catalog's config.json
|
|
558
|
+
isPartOfInstall = false, // NEW: Default to false for backward compatibility
|
|
559
|
+
} = options;
|
|
558
560
|
const xdg = new xdg_config_1.XDGConfig();
|
|
559
561
|
console.log("\n╔═══════════════════════════════════════════════════════════╗");
|
|
560
562
|
console.log("║ Benchling Webhook Setup (v0.7.0) ║");
|
|
561
563
|
console.log("╚═══════════════════════════════════════════════════════════╝\n");
|
|
562
|
-
// Step 1: Load existing configuration (if profile exists)
|
|
564
|
+
// Step 1: Load existing configuration (if profile exists) - for suggestions only
|
|
563
565
|
let existingConfig;
|
|
564
|
-
// Determine if we should inherit from 'default' when profile is not 'default'
|
|
565
|
-
const shouldInheritFromDefault = profile !== "default" && !inheritFrom;
|
|
566
|
-
const effectiveInheritFrom = inheritFrom || (shouldInheritFromDefault ? "default" : undefined);
|
|
567
566
|
if (xdg.profileExists(profile)) {
|
|
568
567
|
console.log(`Loading existing configuration for profile: ${profile}\n`);
|
|
569
568
|
try {
|
|
570
|
-
existingConfig =
|
|
571
|
-
? xdg.readProfileWithInheritance(profile, effectiveInheritFrom)
|
|
572
|
-
: xdg.readProfile(profile);
|
|
569
|
+
existingConfig = xdg.readProfile(profile);
|
|
573
570
|
}
|
|
574
571
|
catch (error) {
|
|
575
572
|
console.warn(`Warning: Could not load existing config: ${error.message}`);
|
|
576
573
|
}
|
|
577
574
|
}
|
|
578
|
-
else if (
|
|
579
|
-
//
|
|
580
|
-
console.log(`Creating new profile '${profile}'
|
|
575
|
+
else if (inheritFrom) {
|
|
576
|
+
// Only use explicit inheritFrom if specified (for suggestions)
|
|
577
|
+
console.log(`Creating new profile '${profile}' with suggestions from '${inheritFrom}'\n`);
|
|
581
578
|
try {
|
|
582
|
-
existingConfig = xdg.readProfile(
|
|
579
|
+
existingConfig = xdg.readProfile(inheritFrom);
|
|
583
580
|
}
|
|
584
581
|
catch (error) {
|
|
585
|
-
throw new Error(`Base profile '${
|
|
582
|
+
throw new Error(`Base profile '${inheritFrom}' not found: ${error.message}`);
|
|
586
583
|
}
|
|
587
584
|
}
|
|
588
|
-
// Step 2:
|
|
585
|
+
// Step 2: Always infer Quilt configuration from AWS (provides suggestions)
|
|
589
586
|
let quiltConfig = existingConfig?.quilt || {};
|
|
590
587
|
let inferredAccountId;
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
588
|
+
console.log("Step 1: Inferring Quilt configuration from AWS...\n");
|
|
589
|
+
try {
|
|
590
|
+
const inferenceResult = await (0, infer_quilt_config_1.inferQuiltConfig)({
|
|
591
|
+
region: awsRegion,
|
|
592
|
+
profile: awsProfile,
|
|
593
|
+
interactive: !nonInteractive,
|
|
594
|
+
});
|
|
595
|
+
// Merge inferred config with existing (inferred takes precedence as fresher data)
|
|
596
|
+
quiltConfig = {
|
|
597
|
+
...quiltConfig,
|
|
598
|
+
...inferenceResult,
|
|
599
|
+
};
|
|
600
|
+
inferredAccountId = inferenceResult.account;
|
|
601
|
+
console.log("✓ Quilt configuration inferred\n");
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
console.error(`Failed to infer Quilt configuration: ${error.message}`);
|
|
605
|
+
if (nonInteractive) {
|
|
606
|
+
throw error;
|
|
602
607
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
default: true,
|
|
614
|
-
},
|
|
615
|
-
]);
|
|
616
|
-
if (!continueManually) {
|
|
617
|
-
throw new Error("Setup aborted by user");
|
|
618
|
-
}
|
|
608
|
+
const { continueManually } = await inquirer_1.default.prompt([
|
|
609
|
+
{
|
|
610
|
+
type: "confirm",
|
|
611
|
+
name: "continueManually",
|
|
612
|
+
message: "Continue and enter Quilt configuration manually?",
|
|
613
|
+
default: true,
|
|
614
|
+
},
|
|
615
|
+
]);
|
|
616
|
+
if (!continueManually) {
|
|
617
|
+
throw new Error("Setup aborted by user");
|
|
619
618
|
}
|
|
620
619
|
}
|
|
621
|
-
// Merge inferred
|
|
620
|
+
// Merge inferred/existing config as suggestions for the wizard
|
|
622
621
|
const partialConfig = {
|
|
623
622
|
...existingConfig,
|
|
624
|
-
quilt:
|
|
625
|
-
...existingConfig?.quilt,
|
|
626
|
-
...quiltConfig,
|
|
627
|
-
},
|
|
623
|
+
quilt: quiltConfig,
|
|
628
624
|
// Pass through inferred account ID for deployment config
|
|
629
625
|
deployment: {
|
|
630
626
|
...existingConfig?.deployment,
|
|
631
627
|
account: existingConfig?.deployment?.account || inferredAccountId,
|
|
632
628
|
},
|
|
633
629
|
};
|
|
634
|
-
// Step 3: Run interactive wizard for
|
|
630
|
+
// Step 3: Run interactive wizard for all configuration (with inferred/existing values as suggestions)
|
|
635
631
|
const config = await runConfigWizard({
|
|
636
632
|
existingConfig: partialConfig,
|
|
637
633
|
nonInteractive,
|
|
638
|
-
inheritFrom
|
|
634
|
+
inheritFrom, // Only pass explicit inheritFrom, not auto-derived
|
|
639
635
|
});
|
|
640
636
|
// Step 4: Validate configuration
|
|
641
637
|
if (!skipValidation) {
|
|
@@ -688,7 +684,8 @@ async function runInstallWizard(options = {}) {
|
|
|
688
684
|
await syncSecretsToAWS({
|
|
689
685
|
profile,
|
|
690
686
|
awsProfile,
|
|
691
|
-
region
|
|
687
|
+
// Use the deployment region from config (which defaults to Quilt stack region)
|
|
688
|
+
region: config.deployment?.region,
|
|
692
689
|
force: true,
|
|
693
690
|
});
|
|
694
691
|
console.log("✓ Secrets synced to AWS Secrets Manager\n");
|
|
@@ -699,29 +696,24 @@ async function runInstallWizard(options = {}) {
|
|
|
699
696
|
console.warn(chalk_1.default.cyan(` npm run setup:sync-secrets -- --profile ${profile}\n`));
|
|
700
697
|
}
|
|
701
698
|
}
|
|
702
|
-
// Step 7: Display next steps
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
console.log(
|
|
713
|
-
console.log(" 2. Test integration: npm run test:dev\n");
|
|
714
|
-
}
|
|
715
|
-
else if (profile === "prod") {
|
|
716
|
-
console.log(" 1. Deploy to AWS: npm run deploy:prod");
|
|
717
|
-
console.log(" 2. Test integration: npm run test:prod\n");
|
|
718
|
-
}
|
|
719
|
-
else {
|
|
720
|
-
// For custom profiles, show the full command
|
|
721
|
-
console.log(` 1. Deploy to AWS: npx benchling-webhook deploy --profile ${profile} --stage ${profile}`);
|
|
722
|
-
console.log(` 2. Test integration: npm run test:${profile}\n`);
|
|
699
|
+
// Step 7: Display next steps (only if NOT part of install command)
|
|
700
|
+
if (!isPartOfInstall) {
|
|
701
|
+
console.log("╔═══════════════════════════════════════════════════════════╗");
|
|
702
|
+
console.log("║ Setup Complete! ║");
|
|
703
|
+
console.log("╚═══════════════════════════════════════════════════════════╝\n");
|
|
704
|
+
// Use next steps generator (Phase 2: with context detection)
|
|
705
|
+
const nextSteps = (0, next_steps_generator_1.generateNextSteps)({
|
|
706
|
+
profile,
|
|
707
|
+
stage: profile === "prod" ? "prod" : "dev",
|
|
708
|
+
});
|
|
709
|
+
console.log(nextSteps + "\n");
|
|
723
710
|
}
|
|
724
|
-
|
|
711
|
+
// Return result for install command orchestration
|
|
712
|
+
return {
|
|
713
|
+
success: true,
|
|
714
|
+
profile,
|
|
715
|
+
config,
|
|
716
|
+
};
|
|
725
717
|
}
|
|
726
718
|
// =============================================================================
|
|
727
719
|
// CLI COMMAND EXPORT
|
|
@@ -730,11 +722,11 @@ async function runInstallWizard(options = {}) {
|
|
|
730
722
|
* Setup wizard command handler
|
|
731
723
|
*
|
|
732
724
|
* @param options - Wizard options
|
|
733
|
-
* @returns Promise that resolves
|
|
725
|
+
* @returns Promise that resolves with setup result
|
|
734
726
|
*/
|
|
735
727
|
async function setupWizardCommand(options = {}) {
|
|
736
728
|
try {
|
|
737
|
-
await runInstallWizard(options);
|
|
729
|
+
return await runInstallWizard(options);
|
|
738
730
|
}
|
|
739
731
|
catch (error) {
|
|
740
732
|
// Handle user cancellation (Ctrl+C) gracefully
|