@solidactions/cli 0.2.1 → 0.2.4

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.
@@ -35,8 +35,12 @@ async function envList(projectName, options = {}) {
35
35
  try {
36
36
  if (projectName) {
37
37
  // List project variable mappings
38
- console.log(chalk_1.default.blue(`Environment variables for project "${projectName}":`));
39
- const response = await axios_1.default.get(`${config.host}/api/v1/projects/${projectName}/variable-mappings`, {
38
+ const environment = options.env || 'dev';
39
+ const projectSlug = environment === 'production'
40
+ ? projectName
41
+ : `${projectName}-${environment}`;
42
+ console.log(chalk_1.default.blue(`Environment variables for project "${projectName}" (${environment}):`));
43
+ const response = await axios_1.default.get(`${config.host}/api/v1/projects/${projectSlug}/variable-mappings`, {
40
44
  headers: {
41
45
  'Authorization': `Bearer ${config.apiKey}`,
42
46
  'Accept': 'application/json',
@@ -164,7 +168,7 @@ async function envList(projectName, options = {}) {
164
168
  console.error(chalk_1.default.red('Authentication failed. Run "solidactions init <api-key>" to re-configure.'));
165
169
  }
166
170
  else if (error.response.status === 404) {
167
- console.error(chalk_1.default.red(projectName ? `Project "${projectName}" not found.` : 'Resource not found.'));
171
+ console.error(chalk_1.default.red(projectName ? `Project "${projectName}" not found for the specified environment.` : 'Resource not found.'));
168
172
  }
169
173
  else {
170
174
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
@@ -13,7 +13,11 @@ async function run(projectName, workflowName, options) {
13
13
  console.error(chalk_1.default.red('Not initialized. Run "solidactions init <api-key>" first.'));
14
14
  process.exit(1);
15
15
  }
16
- console.log(chalk_1.default.blue(`Running workflow "${workflowName}" in project "${projectName}"...`));
16
+ const environment = options.env || 'dev';
17
+ const projectSlug = environment === 'production'
18
+ ? projectName
19
+ : `${projectName}-${environment}`;
20
+ console.log(chalk_1.default.blue(`Running workflow "${workflowName}" in project "${projectName}" (${environment})...`));
17
21
  let inputData = {};
18
22
  if (options.input) {
19
23
  try {
@@ -25,7 +29,7 @@ async function run(projectName, workflowName, options) {
25
29
  }
26
30
  }
27
31
  try {
28
- const response = await axios_1.default.post(`${config.host}/api/v1/projects/${projectName}/workflows/${workflowName}/trigger`, { input: inputData }, {
32
+ const response = await axios_1.default.post(`${config.host}/api/v1/projects/${projectSlug}/workflows/${workflowName}/trigger`, { input: inputData }, {
29
33
  headers: {
30
34
  'Authorization': `Bearer ${config.apiKey}`,
31
35
  'Accept': 'application/json',
package/dist/index.js CHANGED
@@ -76,6 +76,7 @@ program
76
76
  .description('Trigger a workflow run')
77
77
  .argument('<project>', 'Project name')
78
78
  .argument('<workflow>', 'Workflow name')
79
+ .option('-e, --env <environment>', 'Environment (production/staging/dev)', 'dev')
79
80
  .option('-i, --input <json>', 'JSON input for the workflow')
80
81
  .option('-w, --wait', 'Wait for the workflow to complete')
81
82
  .action((project, workflow, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidactions/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.4",
4
4
  "description": "SolidActions CLI - Deploy and manage workflow automation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {