@solidactions/cli 0.1.0 → 0.2.1

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 CHANGED
@@ -39,6 +39,7 @@ solidactions deploy <project-name> <path>
39
39
  | `schedule:set <project> <cron>` | Set a cron schedule for a workflow |
40
40
  | `schedule:list <project>` | List schedules for a project |
41
41
  | `schedule:delete <project> <id>` | Delete a schedule |
42
+ | `webhooks <project>` | List webhook URLs for a project |
42
43
 
43
44
  See [docs/cli.md](docs/cli.md) for full documentation.
44
45
 
@@ -259,7 +259,7 @@ async function deploy(projectName, sourcePath, options = {}) {
259
259
  process.exit(1);
260
260
  }
261
261
  const sourceDir = sourcePath ? path_1.default.resolve(sourcePath) : process.cwd();
262
- const environment = options.env || 'production';
262
+ const environment = options.env || 'dev';
263
263
  if (!fs_1.default.existsSync(sourceDir)) {
264
264
  console.error(chalk_1.default.red(`Source directory not found: ${sourceDir}`));
265
265
  process.exit(1);
@@ -31,7 +31,7 @@ async function envPull(projectName, options = {}) {
31
31
  console.error(chalk_1.default.red('Not initialized. Run "solidactions init <api-key>" first.'));
32
32
  process.exit(1);
33
33
  }
34
- const environment = options.env || 'production';
34
+ const environment = options.env || 'dev';
35
35
  // Build the project slug for lookup
36
36
  const projectSlug = environment === 'production'
37
37
  ? projectName
@@ -52,7 +52,7 @@ async function init(apiKey, options) {
52
52
  host = 'http://localhost:8000';
53
53
  }
54
54
  else {
55
- host = 'https://solidactions.io';
55
+ host = 'https://app.solidactions.com';
56
56
  }
57
57
  // Validate API key format (should be a Sanctum token)
58
58
  if (!apiKey || apiKey.trim().length === 0) {
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.webhookList = webhookList;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const init_1 = require("./init");
10
+ async function webhookList(projectName, options = {}) {
11
+ const config = (0, init_1.getConfig)();
12
+ if (!config?.apiKey) {
13
+ console.error(chalk_1.default.red('Not initialized. Run "solidactions init <api-key>" first.'));
14
+ process.exit(1);
15
+ }
16
+ const environment = options.env || 'dev';
17
+ const projectSlug = environment === 'production' ? projectName : `${projectName}-${environment}`;
18
+ console.log(chalk_1.default.blue(`Webhooks for project "${projectName}"${environment !== 'production' ? ` (${environment})` : ''}:`));
19
+ try {
20
+ const params = {};
21
+ if (options.showSecrets) {
22
+ params.show_secrets = 'true';
23
+ }
24
+ const response = await axios_1.default.get(`${config.host}/api/v1/projects/${projectSlug}/webhooks`, {
25
+ headers: {
26
+ 'Authorization': `Bearer ${config.apiKey}`,
27
+ 'Accept': 'application/json',
28
+ },
29
+ params,
30
+ });
31
+ const webhooks = response.data || [];
32
+ if (webhooks.length === 0) {
33
+ console.log(chalk_1.default.yellow('No webhooks found for project "' + projectName + '".'));
34
+ return;
35
+ }
36
+ console.log('');
37
+ if (options.showSecrets) {
38
+ console.log(chalk_1.default.gray('WORKFLOW'.padEnd(30) + 'URL'.padEnd(60) + 'SECRET'));
39
+ console.log(chalk_1.default.gray('-'.repeat(120)));
40
+ }
41
+ else {
42
+ console.log(chalk_1.default.gray('WORKFLOW'.padEnd(30) + 'URL'));
43
+ console.log(chalk_1.default.gray('-'.repeat(90)));
44
+ }
45
+ for (const webhook of webhooks) {
46
+ const name = webhook.name || webhook.slug || '?';
47
+ const url = webhook.url || '?';
48
+ let line = name.padEnd(30) + chalk_1.default.cyan(url.padEnd(60));
49
+ if (options.showSecrets) {
50
+ const secret = webhook.secret || '-';
51
+ line += chalk_1.default.gray(secret);
52
+ }
53
+ console.log(line);
54
+ }
55
+ console.log('');
56
+ console.log(chalk_1.default.gray(`${webhooks.length} webhook(s)`));
57
+ }
58
+ catch (error) {
59
+ if (error.response) {
60
+ if (error.response.status === 401) {
61
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions init <api-key>" to re-configure.'));
62
+ }
63
+ else if (error.response.status === 404) {
64
+ console.error(chalk_1.default.red(`Project "${projectName}" not found.`));
65
+ }
66
+ else {
67
+ console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
68
+ }
69
+ }
70
+ else {
71
+ console.error(chalk_1.default.red('Connection failed:'), error.message);
72
+ }
73
+ process.exit(1);
74
+ }
75
+ }
package/dist/index.js CHANGED
@@ -17,11 +17,12 @@ const env_pull_1 = require("./commands/env-pull");
17
17
  const schedule_set_1 = require("./commands/schedule-set");
18
18
  const schedule_list_1 = require("./commands/schedule-list");
19
19
  const schedule_delete_1 = require("./commands/schedule-delete");
20
+ const webhooks_1 = require("./commands/webhooks");
20
21
  const program = new commander_1.Command();
21
22
  program
22
23
  .name('solidactions')
23
24
  .description('SolidActions CLI - Deploy and manage workflow automation')
24
- .version('0.1.0');
25
+ .version('0.2.1');
25
26
  // =============================================================================
26
27
  // Authentication & Configuration
27
28
  // =============================================================================
@@ -54,7 +55,7 @@ program
54
55
  .description('Deploy a project to SolidActions')
55
56
  .argument('<project-name>', 'Project name (will be created if it doesn\'t exist)')
56
57
  .argument('[path]', 'Source directory to deploy (defaults to current directory)')
57
- .option('-e, --env <environment>', 'Target environment (production/staging/dev)', 'production')
58
+ .option('-e, --env <environment>', 'Target environment (production/staging/dev)', 'dev')
58
59
  .option('--create', 'Create environment project if it doesn\'t exist')
59
60
  .action((projectName, path, options) => {
60
61
  (0, deploy_1.deploy)(projectName, path, options);
@@ -153,7 +154,7 @@ program
153
154
  .command('env:pull')
154
155
  .description('Pull resolved environment variables to a local file')
155
156
  .argument('<project>', 'Project name')
156
- .option('-e, --env <environment>', 'Environment (production/staging/dev)', 'production')
157
+ .option('-e, --env <environment>', 'Environment (production/staging/dev)', 'dev')
157
158
  .option('-o, --output <file>', 'Output file path (defaults to .env or .env.{environment})')
158
159
  .option('-y, --yes', 'Skip confirmation for secrets')
159
160
  .action((project, options) => {
@@ -188,4 +189,16 @@ program
188
189
  .action((project, scheduleId, options) => {
189
190
  (0, schedule_delete_1.scheduleDelete)(project, scheduleId, options);
190
191
  });
192
+ // =============================================================================
193
+ // Webhooks
194
+ // =============================================================================
195
+ program
196
+ .command('webhooks')
197
+ .description('List webhook URLs for a project')
198
+ .argument('<project>', 'Project name')
199
+ .option('-e, --env <environment>', 'Environment (production/staging/dev)')
200
+ .option('--show-secrets', 'Show webhook secrets')
201
+ .action((project, options) => {
202
+ (0, webhooks_1.webhookList)(project, options);
203
+ });
191
204
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidactions/cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "SolidActions CLI - Deploy and manage workflow automation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {