@stackone/cli 1.10.1 → 1.12.0

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
@@ -91,6 +91,127 @@ stackone push --api-key <your-api-key> --api-url <api-url> path/to/connector.s1.
91
91
  - **File validation**: Checks that the file exists and is a valid connector before attempting upload
92
92
  - **Batch upload**: Supports uploading multiple connectors from a directory
93
93
 
94
+ ### `drop`
95
+
96
+ Drop (delete) a specific connector version from the StackOne API registry. This command can use either a configuration profile created with the `init` command or provide credentials directly via command-line options.
97
+
98
+ ```bash
99
+ stackone drop <connector> --profile <profile-label>
100
+ ```
101
+
102
+ or using direct credentials:
103
+
104
+ ```bash
105
+ stackone drop <connector> --api-key <your-api-key>
106
+ ```
107
+
108
+ or with custom API URL:
109
+
110
+ ```bash
111
+ stackone drop <connector> --api-key <your-api-key> --api-url <api-url>
112
+ ```
113
+
114
+ **Arguments:**
115
+
116
+ - `<connector>` - The connector identifier in the format `provider_key@version` (e.g., `my-provider@1.0.0`)
117
+
118
+ **Options:**
119
+
120
+ - `-p, --profile <label>` - Configuration profile to use
121
+ - `--api-key <api-key>` - API key to use for authentication (alternative to using a profile)
122
+ - `--api-url <api-url>` - API URL to use (defaults to `https://api.stackone.com` if not specified)
123
+
124
+ **Note:** You must provide either `--profile` or `--api-key`. If using `--api-key`, the `--api-url` option is optional and will default to the production API URL.
125
+
126
+ **Features:**
127
+
128
+ - **Flexible authentication**: Use either a saved profile or provide credentials directly
129
+ - **Profile validation**: Ensures the specified profile exists before attempting deletion (when using `--profile`)
130
+ - **Precise targeting**: Delete specific connector versions without affecting other versions
131
+ - **Clear feedback**: Informative success and error messages with color-coded output
132
+
133
+ ### `get`
134
+
135
+ Get (download) a connector from the StackOne registry. This command can use either a configuration profile created with the `init` command or provide credentials directly via command-line options.
136
+
137
+ ```bash
138
+ stackone get --connector my-provider@1.0.0 --profile <profile-label>
139
+ ```
140
+
141
+ or using direct credentials:
142
+
143
+ ```bash
144
+ stackone get --connector my-provider@1.0.0 --api-key <your-api-key>
145
+ ```
146
+
147
+ or fetch from an account:
148
+
149
+ ```bash
150
+ stackone get --account-id acc_123 --profile <profile-label>
151
+ ```
152
+
153
+ **Options:**
154
+
155
+ - `--connector <connector>` - Connector identifier in format `provider_key@version` (e.g., `my-provider@1.0.0`)
156
+ - `--account-id <account-id>` - Account ID to fetch the connector from
157
+ - `-f, --format <format>` - Output format: `yaml` or `json` (default: `yaml`)
158
+ - `-o, --output-file <output-file>` - File path to write the connector to (if not specified, outputs to stdout)
159
+ - `-p, --profile <label>` - Configuration profile to use
160
+ - `--api-key <api-key>` - API key to use for authentication (alternative to using a profile)
161
+ - `--api-url <api-url>` - API URL to use (defaults to `https://api.stackone.com` if not specified)
162
+
163
+ **Note:**
164
+
165
+ - You must provide either `--profile` or `--api-key`. If using `--api-key`, the `--api-url` option is optional and will default to the production API URL.
166
+ - You must provide either `--connector` or `--account-id`, but not both.
167
+
168
+ **Usage Examples:**
169
+
170
+ 1. **Get connector from registry with profile:**
171
+
172
+ ```bash
173
+ stackone get --connector my-provider@1.0.0 --profile production
174
+ ```
175
+
176
+ 2. **Get connector from registry with API key:**
177
+
178
+ ```bash
179
+ stackone get --connector my-provider@1.0.0 --api-key your-api-key
180
+ ```
181
+
182
+ 3. **Get connector from account:**
183
+
184
+ ```bash
185
+ stackone get --account-id acc_123 --profile production
186
+ ```
187
+
188
+ 4. **Get connector in JSON format:**
189
+
190
+ ```bash
191
+ stackone get --connector my-provider@1.0.0 --profile production --format json
192
+ ```
193
+
194
+ 5. **Get connector and save to file:**
195
+
196
+ ```bash
197
+ stackone get --connector my-provider@1.0.0 --profile production --output-file my-connector.s1.yaml
198
+ ```
199
+
200
+ 6. **Get connector with custom API URL:**
201
+
202
+ ```bash
203
+ stackone get --connector my-provider@1.0.0 --api-key your-api-key --api-url https://staging.api.stackone.com
204
+ ```
205
+
206
+ **Features:**
207
+
208
+ - **Flexible authentication**: Use either a saved profile or provide credentials directly
209
+ - **Multiple sources**: Fetch connectors from registry by identifier or from specific accounts
210
+ - **Format conversion**: Output in YAML (default) or JSON format
211
+ - **File output**: Save to file or output to stdout for piping
212
+ - **Profile validation**: Ensures the specified profile exists before fetching (when using `--profile`)
213
+ - **Clear feedback**: Informative success and error messages with color-coded output
214
+
94
215
  ### `validate`
95
216
 
96
217
  Validate a StackOne connector file:
@@ -119,57 +240,97 @@ Execute a connector action locally with full control over connector configuratio
119
240
  stackone run --connector path/to/connector.s1.yaml --account-id <account-id> --profile <profile-label>
120
241
  ```
121
242
 
243
+ or using direct credentials:
244
+
245
+ ```bash
246
+ stackone run --account-id <account-id> --api-key <your-api-key>
247
+ ```
248
+
122
249
  **Options:**
123
250
 
124
- - `--connector <connector>` - Path to the connector file to run, or inline connector YAML string
251
+ - `--connector <connector>` - Path to the connector file to run, inline connector YAML string, or connector identifier in format `provider_key@version` to fetch from registry (optional when using `--account-id`, the connector will be fetched from account API)
125
252
  - `--action <action>` - Path to an action file or inline action YAML code to add to the connector
126
253
  - `--action-id <action-id>` - Specific action ID to execute. If not provided, the last action in the connector will be executed
127
254
  - `--account <account>` - Path to a JSON file with account details or inline JSON string (see Account Format below)
128
- - `--account-id <account-id>` - Account ID to fetch from StackOne API (requires `--profile`)
255
+ - `--account-id <account-id>` - Account ID to fetch from StackOne API (requires either `--profile` or `--api-key`). When provided without `--connector`, the connector will also be fetched from the API
129
256
  - `--params <params>` - Path to a JSON file with action parameters or inline JSON string (see Parameters Format below)
130
257
  - `--credentials <credentials>` - Path to a JSON file with credentials or inline JSON string (see Credentials Format below)
131
- - `-p, --profile <label>` - Configuration profile to use (required when using `--account-id`)
258
+ - `-p, --profile <label>` - Configuration profile to use
259
+ - `--api-key <api-key>` - API key to use for authentication (alternative to using a profile)
260
+ - `--api-url <api-url>` - API URL to use (defaults to `https://api.stackone.com` if not specified)
132
261
  - `-o, --output-file <output-file>` - File path to write the execution output to (JSON format)
133
262
  - `-d, --debug` - Enable debug mode to include execution steps and detailed information in the output
134
263
 
264
+ **Note:** You must provide either `--profile` or `--api-key` when using `--account-id`. If using `--api-key`, the `--api-url` option is optional and will default to the production API URL.
265
+
135
266
  **Usage Examples:**
136
267
 
137
- 1. **Run with account from API:**
268
+ 1. **Run with account from API using profile (connector fetched automatically):**
138
269
 
139
270
  ```bash
140
- stackone run --connector connector.s1.yaml --account-id acc_123 --profile production
271
+ stackone run --account-id acc_123 --profile production
141
272
  ```
142
273
 
143
- 2. **Run with local account file & credentials:**
274
+ 2. **Run with account from API using API key (connector fetched automatically):**
144
275
 
145
276
  ```bash
146
- stackone run --connector connector.s1.yaml --account account.json --credentials credentials.json
277
+ stackone run --account-id acc_123 --api-key your-api-key
147
278
  ```
148
279
 
149
- 3. **Run with inline account data:**
280
+ 3. **Run with custom API URL:**
150
281
 
151
282
  ```bash
152
- stackone run --connector connector.s1.yaml --account '{"auth_config_key":"basic","credentials":{"username":"user","password":"pass"}}'
283
+ stackone run --account-id acc_123 --api-key your-api-key --api-url https://staging.api.stackone.com
284
+ ```
285
+
286
+ 4. **Run with connector identifier from registry:**
287
+
288
+ ```bash
289
+ stackone run --connector my-provider@1.0.0 --account account.json --api-key your-api-key
290
+ ```
291
+
292
+ 5. **Run with connector from registry and account from API:**
293
+
294
+ ```bash
295
+ stackone run --connector my-provider@1.0.0 --account-id acc_123 --profile production
296
+ ```
297
+
298
+ 6. **Run with account from API and specific connector file:**
299
+
300
+ ```bash
301
+ stackone run --connector connector.s1.yaml --account-id acc_123 --profile production
153
302
  ```
154
303
 
155
- 4. **Run specific action with parameters:**
304
+ 7. **Run with local account file & credentials:**
156
305
 
157
306
  ```bash
158
- stackone run --connector connector.s1.yaml --action-id list_employees --account-id acc_123 --profile production --params params.json
307
+ stackone run --connector connector.s1.yaml --account account.json --credentials credentials.json
159
308
  ```
160
309
 
161
- 5. **Run with custom action file:**
310
+ 8. **Run with inline account data:**
162
311
 
163
312
  ```bash
164
- stackone run --connector connector.s1.yaml --action custom-action.yaml --account account.json
313
+ stackone run --connector connector.s1.yaml --account '{"auth_config_key":"basic","credentials":{"username":"user","password":"pass"}}'
165
314
  ```
166
315
 
167
- 6. **Run with debug mode and output to file:**
316
+ 9. **Run specific action with parameters using API key (connector auto-fetched):**
168
317
 
169
318
  ```bash
170
- stackone run --connector connector.s1.yaml --account-id acc_123 --profile production --debug --output-file result.json
319
+ stackone run --action-id list_employees --account-id acc_123 --api-key your-api-key --params params.json
171
320
  ```
172
321
 
322
+ 10. **Run with custom action file:**
323
+
324
+ ```bash
325
+ stackone run --connector connector.s1.yaml --action custom-action.yaml --account account.json
326
+ ```
327
+
328
+ 11. **Run with debug mode and output to file (connector auto-fetched):**
329
+
330
+ ```bash
331
+ stackone run --account-id acc_123 --profile production --debug --output-file result.json
332
+ ```
333
+
173
334
  **Account Format** (JSON):
174
335
 
175
336
  When using `--account` with a file or inline JSON, use this structure:
@@ -228,13 +389,19 @@ All fields are optional and default to empty objects `{}`.
228
389
  **Requirements:**
229
390
 
230
391
  - Either `--account` or `--account-id` must be provided
231
- - When using `--account-id`, the `--profile` option is required
392
+ - When using `--account-id`, either `--profile` or `--api-key` is required
393
+ - When using connector identifier format (`provider_key@version`), either `--profile` or `--api-key` is required
394
+ - You must provide either `--profile` or `--api-key`, not both
232
395
  - When using `--action`, the `--connector` option is required
233
- - A valid connector is required (via `--connector` or inferred from action)
396
+ - A connector can be provided via:
397
+ - `--connector` with a file path or inline YAML
398
+ - `--connector` with identifier format (`provider_key@version`) to fetch from registry
399
+ - Automatically fetched from account API when using `--account-id` without `--connector`
234
400
 
235
401
  **Features:**
236
402
 
237
- - **Flexible connector loading**: Load from file path or provide inline YAML
403
+ - **Flexible connector loading**: Load from file path, provide inline YAML, fetch from registry using `provider_key@version` identifier, or auto-fetch from API using account ID
404
+ - **Flexible authentication**: Use either a saved profile or provide credentials directly via command-line options
238
405
  - **Dynamic action injection**: Add custom actions to existing connectors on-the-fly
239
406
  - **Multiple authentication methods**: Use API-fetched accounts or local account data
240
407
  - **Credential override**: Merge or override credentials at runtime
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./cliCore-CnIBp2pi.cjs`),t=new e.CLI;t.run();
2
+ const e=require(`./cliCore-CdUkuL9P.cjs`),t=new e.CLI;t.run();
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{CLI as e}from"./cliCore-vfAofbYA.js";const t=new e;t.run();
2
+ import{CLI as e}from"./cliCore-C6WfW_Zy.js";const t=new e;t.run();