flowstride 1.0.2 → 1.0.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.
Files changed (2) hide show
  1. package/dist/cli/index.js +26 -33
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -52,7 +52,7 @@ const program = new commander_1.Command();
52
52
  program
53
53
  .name("flowstride")
54
54
  .description("Flowstride: The Enterprise Flow-First Automation CLI")
55
- .version("1.0.2");
55
+ .version("1.0.6");
56
56
  program
57
57
  .command("init")
58
58
  .description("Initialise a new Flowstride workspace in the current directory")
@@ -66,11 +66,9 @@ program
66
66
  console.log(chalk_1.default.bold.blue("\n🌐 Flowstride Enterprise Cloud Sync\n"));
67
67
  const userEmail = await (0, prompts_1.input)({ message: "Enter your Flowstride email:" });
68
68
  const userPass = await (0, prompts_1.password)({ message: "Enter your password:" });
69
- // Silently grab the computer's hostname without bothering the user
70
69
  const deviceName = os.hostname();
71
70
  const spinner = (0, ora_1.default)("Authenticating with Cloud...").start();
72
71
  try {
73
- // 1. Authenticate with Next.js Server
74
72
  const authString = Buffer.from(`${userEmail}:${userPass}`).toString("base64");
75
73
  const response = await fetch("https://cloud.flowstride.io/api/auth/cli-sync", {
76
74
  method: "POST",
@@ -86,7 +84,6 @@ program
86
84
  process.exit(1);
87
85
  }
88
86
  spinner.succeed(chalk_1.default.green("Authentication Successful!"));
89
- // 2. Save Machine Token Locally
90
87
  const configDir = path.join(os.homedir(), ".flowstride");
91
88
  if (!fs.existsSync(configDir)) {
92
89
  fs.mkdirSync(configDir, { recursive: true });
@@ -100,11 +97,10 @@ program
100
97
  }, null, 2));
101
98
  console.log(chalk_1.default.gray(`\nCredentials saved to ${credentialsPath}`));
102
99
  console.log(chalk_1.default.bold.green(`\nāœ… Machine synchronized with Flowstride Enterprise.`));
103
- // 3. The Auto-Installer Logic
104
- if (data.githubToken) {
100
+ if (data.githubToken || data.isProEligible) {
105
101
  console.log(chalk_1.default.yellow(`\nāš™ļø System Check: You have access to Enterprise features (AI Healing, Parallel Workers).`));
106
102
  const localPackageJsonPath = path.join(process.cwd(), "package.json");
107
- const nodeModulesPath = path.join(process.cwd(), "node_modules", "@flowstride", "pro");
103
+ const nodeModulesPath = path.join(process.cwd(), "node_modules", "@heroamogs", "pro");
108
104
  if (fs.existsSync(localPackageJsonPath) &&
109
105
  !fs.existsSync(nodeModulesPath)) {
110
106
  const installPro = await (0, prompts_1.confirm)({
@@ -112,44 +108,41 @@ program
112
108
  default: true,
113
109
  });
114
110
  if (installPro) {
115
- const installSpinner = (0, ora_1.default)("Configuring secure registry and installing @flowstride/pro...").start();
116
- const npmrcPath = path.join(process.cwd(), ".npmrc");
117
- let originalNpmrc = "";
111
+ const installSpinner = (0, ora_1.default)("Downloading Enterprise Engine via secure proxy...").start();
112
+ const tarballPath = path.join(process.cwd(), "flowstride-pro.tgz");
118
113
  try {
119
- // A. Backup existing .npmrc if it exists
120
- if (fs.existsSync(npmrcPath)) {
121
- originalNpmrc = fs.readFileSync(npmrcPath, "utf8");
114
+ const tarballResponse = await fetch("https://cloud.flowstride.io/api/workspace/download-pro", {
115
+ method: "GET",
116
+ headers: {
117
+ Authorization: `Bearer ${data.machineToken}`,
118
+ },
119
+ });
120
+ if (!tarballResponse.ok) {
121
+ throw new Error(`Secure proxy rejected request: ${tarballResponse.statusText}`);
122
122
  }
123
- // B. Write the temporary GitHub configuration
124
- const tempNpmrcContent = `
125
- @flowstride:registry=https://npm.pkg.github.com
126
- //npm.pkg.github.com/:_authToken=${data.githubToken}
127
- `;
128
- fs.writeFileSync(npmrcPath, (originalNpmrc ? originalNpmrc + "\n" : "") + tempNpmrcContent);
129
- // C. Run the silent install
130
- (0, child_process_1.execSync)("npm install @flowstride/pro --save-dev", {
131
- stdio: "ignore",
123
+ const buffer = await tarballResponse.arrayBuffer();
124
+ fs.writeFileSync(tarballPath, Buffer.from(buffer));
125
+ installSpinner.stop();
126
+ console.log(chalk_1.default.cyan("Starting secure local install..."));
127
+ (0, child_process_1.execSync)("npm install ./flowstride-pro.tgz --save-dev", {
128
+ stdio: "inherit",
132
129
  cwd: process.cwd(),
133
130
  });
134
- installSpinner.succeed(chalk_1.default.green("Enterprise Engine installed successfully!"));
131
+ console.log(chalk_1.default.green("\nāœ… Enterprise Engine installed successfully!"));
135
132
  }
136
133
  catch (installError) {
137
- installSpinner.fail(chalk_1.default.red("Failed to install the Enterprise Engine automatically."));
138
- console.error(chalk_1.default.gray("You may need to install it manually."));
134
+ installSpinner.stop();
135
+ console.log(chalk_1.default.red("\nāœ– Failed to install the Enterprise Engine automatically."));
136
+ console.error(chalk_1.default.gray(String(installError)));
139
137
  }
140
138
  finally {
141
- // D. Secure Cleanup: Remove the token from .npmrc
142
- if (originalNpmrc) {
143
- fs.writeFileSync(npmrcPath, originalNpmrc); // Restore original
144
- }
145
- else {
146
- if (fs.existsSync(npmrcPath))
147
- fs.unlinkSync(npmrcPath); // Delete if we created it
139
+ if (fs.existsSync(tarballPath)) {
140
+ fs.unlinkSync(tarballPath);
148
141
  }
149
142
  }
150
143
  }
151
144
  else {
152
- console.log(chalk_1.default.gray(`\nSkipped installation. You can run 'npm install @flowstride/pro --save-dev' manually later.`));
145
+ console.log(chalk_1.default.gray(`\nSkipped installation.`));
153
146
  }
154
147
  }
155
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowstride",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "description": "An opensource flowfirst test automation framework",
5
5
  "workspaces": [
6
6
  "packages/flowstride_report"