@stackone/cli 1.9.3 → 1.10.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
@@ -111,6 +111,138 @@ Options:
111
111
 
112
112
  Note: The file extension of a connector file needs to be `.s1.yaml`. The file extension can be omitted.
113
113
 
114
+ ### `run`
115
+
116
+ Execute a connector action locally with full control over connector configuration, account details, and execution parameters. This command is ideal for testing and debugging connectors during development.
117
+
118
+ ```bash
119
+ stackone run --connector path/to/connector.s1.yaml --account-id <account-id> --profile <profile-label>
120
+ ```
121
+
122
+ **Options:**
123
+
124
+ - `--connector <connector>` - Path to the connector file to run, or inline connector YAML string
125
+ - `--action <action>` - Path to an action file or inline action YAML code to add to the connector
126
+ - `--action-id <action-id>` - Specific action ID to execute. If not provided, the last action in the connector will be executed
127
+ - `--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`)
129
+ - `--params <params>` - Path to a JSON file with action parameters or inline JSON string (see Parameters Format below)
130
+ - `--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`)
132
+ - `-o, --output-file <output-file>` - File path to write the execution output to (JSON format)
133
+ - `-d, --debug` - Enable debug mode to include execution steps and detailed information in the output
134
+
135
+ **Usage Examples:**
136
+
137
+ 1. **Run with account from API:**
138
+
139
+ ```bash
140
+ stackone run --connector connector.s1.yaml --account-id acc_123 --profile production
141
+ ```
142
+
143
+ 2. **Run with local account file & credentials:**
144
+
145
+ ```bash
146
+ stackone run --connector connector.s1.yaml --account account.json --credentials credentials.json
147
+ ```
148
+
149
+ 3. **Run with inline account data:**
150
+
151
+ ```bash
152
+ stackone run --connector connector.s1.yaml --account '{"auth_config_key":"basic","credentials":{"username":"user","password":"pass"}}'
153
+ ```
154
+
155
+ 4. **Run specific action with parameters:**
156
+
157
+ ```bash
158
+ stackone run --connector connector.s1.yaml --action-id list_employees --account-id acc_123 --profile production --params params.json
159
+ ```
160
+
161
+ 5. **Run with custom action file:**
162
+
163
+ ```bash
164
+ stackone run --connector connector.s1.yaml --action custom-action.yaml --account account.json
165
+ ```
166
+
167
+ 6. **Run with debug mode and output to file:**
168
+
169
+ ```bash
170
+ stackone run --connector connector.s1.yaml --account-id acc_123 --profile production --debug --output-file result.json
171
+ ```
172
+
173
+ **Account Format** (JSON):
174
+
175
+ When using `--account` with a file or inline JSON, use this structure:
176
+
177
+ ```json
178
+ {
179
+ "auth_config_key": "basic",
180
+ "environment": "production",
181
+ "organization_id": "org_123",
182
+ "account_id": "acc_456",
183
+ "project_id": "proj_789"
184
+ }
185
+ ```
186
+
187
+ All fields are optional except for `auth_config_key`.
188
+
189
+ **Credentials Format** (JSON):
190
+
191
+ When using `--credentials`, provide a key-value object:
192
+
193
+ ```json
194
+ {
195
+ "api_key": "your_api_key",
196
+ "username": "your_username",
197
+ "password": "your_password"
198
+ }
199
+ ```
200
+
201
+ Note: Credentials provided via `--credentials` will merge with and override credentials from `--account` or `--account-id`.
202
+
203
+ **Parameters Format** (JSON):
204
+
205
+ When using `--params`, provide parameters for path, query, headers, and body:
206
+
207
+ ```json
208
+ {
209
+ "path": {
210
+ "id": "employee_123"
211
+ },
212
+ "queryParams": {
213
+ "page": "1",
214
+ "page_size": "10"
215
+ },
216
+ "header": {
217
+ "X-Custom-Header": "value"
218
+ },
219
+ "body": {
220
+ "name": "John Doe",
221
+ "email": "john@example.com"
222
+ }
223
+ }
224
+ ```
225
+
226
+ All fields are optional and default to empty objects `{}`.
227
+
228
+ **Requirements:**
229
+
230
+ - Either `--account` or `--account-id` must be provided
231
+ - When using `--account-id`, the `--profile` option is required
232
+ - When using `--action`, the `--connector` option is required
233
+ - A valid connector is required (via `--connector` or inferred from action)
234
+
235
+ **Features:**
236
+
237
+ - **Flexible connector loading**: Load from file path or provide inline YAML
238
+ - **Dynamic action injection**: Add custom actions to existing connectors on-the-fly
239
+ - **Multiple authentication methods**: Use API-fetched accounts or local account data
240
+ - **Credential override**: Merge or override credentials at runtime
241
+ - **Comprehensive parameters**: Support for path params, query params, headers, and body
242
+ - **Debug mode**: Get detailed execution information including step-by-step processing
243
+ - **Output redirection**: Save results to file for further processing or analysis
244
+ - **Error handling**: Clear error messages with execution details when actions fail
245
+
114
246
  ### `version`
115
247
 
116
248
  Show CLI version information. If a new version is available, it will prompt you to update:
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`__commonJSMin`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`__toESM`,{enumerable:!0,get:function(){return c}});
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./cliCore-DVRzfEhV.cjs`),t=new e.CLI;t.run();
2
+ const e=require(`./cliCore-CnIBp2pi.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-_ngOl27x.js";const t=new e;t.run();
2
+ import{CLI as e}from"./cliCore-vfAofbYA.js";const t=new e;t.run();