@withone/cli 1.13.5 → 1.13.7
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.
|
@@ -301,26 +301,30 @@ function isActionAllowed(actionId, allowedActionIds) {
|
|
|
301
301
|
return allowedActionIds.includes("*") || allowedActionIds.includes(actionId);
|
|
302
302
|
}
|
|
303
303
|
function buildActionKnowledgeWithGuidance(knowledge, method, platform, actionId) {
|
|
304
|
-
return
|
|
304
|
+
return `CLI EXECUTION GUIDE (read this FIRST)
|
|
305
|
+
========================================
|
|
306
|
+
To execute this action, use the One CLI with SEPARATE flags for each parameter type.
|
|
307
|
+
Do NOT pass path variables or query parameters in the -d body flag \u2014 this causes 403 errors.
|
|
305
308
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
+
PARAMETER \u2192 FLAG MAPPING:
|
|
310
|
+
- Path variables (URL placeholders like {userId}, {id}) \u2192 --path-vars '{"userId": "me"}'
|
|
311
|
+
- Query parameters (filtering, pagination, format) \u2192 --query-params '{"key": "value"}'
|
|
312
|
+
- For repeated params, use arrays: --query-params '{"metadataHeaders": ["From", "Subject"]}'
|
|
313
|
+
- Request body (POST/PUT/PATCH payload) \u2192 -d '{"field": "value"}'
|
|
309
314
|
|
|
310
|
-
|
|
311
|
-
- **Query parameters** (filtering, pagination, format options) \u2192 \`--query-params '{"key": "value"}'\`
|
|
312
|
-
- For repeated params, use arrays: \`--query-params '{"metadataHeaders": ["From", "Subject"]}'\`
|
|
313
|
-
- **Request body** (POST/PUT/PATCH data) \u2192 \`-d '{"field": "value"}'\`
|
|
314
|
-
|
|
315
|
-
Do NOT pass path variables or query parameters in the -d body flag \u2014 they will be ignored.
|
|
316
|
-
|
|
317
|
-
EXAMPLE COMMAND:
|
|
315
|
+
EXAMPLE:
|
|
318
316
|
one --agent actions execute ${platform} ${actionId} <connectionKey> \\
|
|
319
317
|
--path-vars '{ ... }' \\
|
|
320
318
|
--query-params '{ ... }' \\
|
|
321
319
|
-d '{ ... }'
|
|
322
320
|
|
|
323
|
-
|
|
321
|
+
Omit any flag not needed (e.g., omit --path-vars if URL has no placeholders, omit -d for GET).
|
|
322
|
+
|
|
323
|
+
Read the API documentation below to identify which parameters are path variables, query parameters, or body fields, then map them to the correct flags above.
|
|
324
|
+
|
|
325
|
+
========================================
|
|
326
|
+
|
|
327
|
+
${knowledge}`;
|
|
324
328
|
}
|
|
325
329
|
|
|
326
330
|
// src/lib/flow-engine.ts
|
|
@@ -658,7 +662,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
|
|
|
658
662
|
if (flowStack.includes(resolvedKey)) {
|
|
659
663
|
throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
|
|
660
664
|
}
|
|
661
|
-
const { loadFlow: loadFlow2 } = await import("./flow-runner-
|
|
665
|
+
const { loadFlow: loadFlow2 } = await import("./flow-runner-5ZBACWKL.js");
|
|
662
666
|
const subFlow = loadFlow2(resolvedKey);
|
|
663
667
|
const subContext = await executeFlow(
|
|
664
668
|
subFlow,
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
loadFlow,
|
|
12
12
|
resolveFlowPath,
|
|
13
13
|
saveFlow
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-T54OTDAW.js";
|
|
15
15
|
|
|
16
16
|
// src/index.ts
|
|
17
17
|
import { createRequire as createRequire2 } from "module";
|
|
@@ -1301,8 +1301,11 @@ async function connectionListCommand(options) {
|
|
|
1301
1301
|
spinner5.start("Loading connections...");
|
|
1302
1302
|
try {
|
|
1303
1303
|
const allConnections = await api.listConnections();
|
|
1304
|
+
const ac = getAccessControlFromAllSources();
|
|
1305
|
+
const allowedKeys = ac.connectionKeys || ["*"];
|
|
1306
|
+
const accessFiltered = allowedKeys.includes("*") ? allConnections : allConnections.filter((conn) => allowedKeys.includes(conn.key));
|
|
1304
1307
|
const searchQuery = options?.search?.toLowerCase();
|
|
1305
|
-
const filtered = searchQuery ?
|
|
1308
|
+
const filtered = searchQuery ? accessFiltered.filter((conn) => conn.platform.toLowerCase().includes(searchQuery)) : accessFiltered;
|
|
1306
1309
|
if (isAgentMode()) {
|
|
1307
1310
|
const limit = options?.limit ? parseInt(options.limit, 10) : 20;
|
|
1308
1311
|
const limited = filtered.slice(0, limit);
|