@withone/cli 1.43.4 → 1.43.6

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/bin/cli.js CHANGED
@@ -1,3 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import '../dist/index.js';
3
+ import { program } from '../dist/index.js';
4
+
5
+ program.parse();
@@ -281,6 +281,7 @@ var OneApi = class {
281
281
  "x-one-connection-key": args.connectionKey,
282
282
  "x-one-action-id": action._id,
283
283
  "Content-Type": contentType,
284
+ Accept: "application/json, text/event-stream, */*",
284
285
  ...args.headers
285
286
  };
286
287
  const finalActionPath = args.pathVariables ? replacePathVariables(action.path, args.pathVariables) : action.path;
@@ -1111,7 +1112,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
1111
1112
  if (flowStack.includes(resolvedKey)) {
1112
1113
  throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
1113
1114
  }
1114
- const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-XSJ4US5S.js");
1115
+ const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-EXZ77YLF.js");
1115
1116
  const { flow: subFlow, rootDir: subRootDir } = loadFlowWithMeta2(resolvedKey);
1116
1117
  const subContext = await executeFlow(
1117
1118
  subFlow,
@@ -11,7 +11,7 @@ import {
11
11
  saveFlow,
12
12
  summarizeFlowInputs,
13
13
  walkSteps
14
- } from "./chunk-EMAQVPRD.js";
14
+ } from "./chunk-YGOS6KEC.js";
15
15
  import "./chunk-44CV5IMX.js";
16
16
  export {
17
17
  FlowRunner,
package/dist/index.d.ts CHANGED
@@ -1 +1,5 @@
1
- #!/usr/bin/env node
1
+ import { Command } from 'commander';
2
+
3
+ declare const program: Command;
4
+
5
+ export { program };
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  import {
3
2
  ApiError,
4
3
  FLOW_SCHEMA,
@@ -18,7 +17,7 @@ import {
18
17
  resolveFlowPath,
19
18
  saveFlow,
20
19
  validateActionInput
21
- } from "./chunk-EMAQVPRD.js";
20
+ } from "./chunk-YGOS6KEC.js";
22
21
  import {
23
22
  memSqlCommand
24
23
  } from "./chunk-3ZJVO4GP.js";
@@ -114,7 +113,7 @@ import {
114
113
  writeConfig
115
114
  } from "./chunk-AU2ZEEMS.js";
116
115
 
117
- // src/index.ts
116
+ // src/cli.ts
118
117
  import { createRequire as createRequire2 } from "module";
119
118
  import path12 from "path";
120
119
  import { Command } from "commander";
@@ -485,7 +484,7 @@ async function configCommand() {
485
484
  let isValid = false;
486
485
  try {
487
486
  const api = new OneApi(apiKey, `${normalized}/v1`);
488
- isValid = await api.validateApiKey();
487
+ isValid = Boolean(await api.validateApiKey());
489
488
  } catch (err) {
490
489
  spinner5.stop("Connection failed");
491
490
  const msg = err instanceof Error ? err.message : String(err);
@@ -521,7 +520,7 @@ async function configCommand() {
521
520
  let isValid = false;
522
521
  try {
523
522
  const api = new OneApi(apiKey, "https://api.withone.ai/v1");
524
- isValid = await api.validateApiKey();
523
+ isValid = Boolean(await api.validateApiKey());
525
524
  } catch (err) {
526
525
  spinner5.stop("Connection failed");
527
526
  const msg = err instanceof Error ? err.message : String(err);
@@ -2865,7 +2864,11 @@ async function actionsExecuteParallelCommand() {
2865
2864
  else headers = r.value;
2866
2865
  }
2867
2866
  if (actionDetails && !flags.skipValidation && segErrors.length === 0) {
2868
- const validation = validateActionInput(actionDetails, { data, pathVariables, queryParams });
2867
+ const validation = validateActionInput(actionDetails, {
2868
+ data,
2869
+ pathVariables,
2870
+ queryParams
2871
+ });
2869
2872
  if (!validation.valid) {
2870
2873
  for (const m of validation.missing) {
2871
2874
  segErrors.push(`Missing ${m.flag} "${m.param}"${m.description ? ` \u2014 ${m.description}` : ""}`);
@@ -10628,7 +10631,7 @@ async function logoutCommand() {
10628
10631
  p9.outro("Logged out.");
10629
10632
  }
10630
10633
 
10631
- // src/index.ts
10634
+ // src/cli.ts
10632
10635
  var require3 = createRequire2(import.meta.url);
10633
10636
  var { version } = require3("../package.json");
10634
10637
  var program = new Command();
@@ -11064,4 +11067,6 @@ program.command("add [platform]").description("Shortcut for: connection add").ac
11064
11067
  program.command("list").alias("ls").description("Shortcut for: connection list").option("-s, --search <query>", "Filter connections by platform name").option("-l, --limit <n>", "Max connections to return (agent mode default: 20)").action(async (options) => {
11065
11068
  await connectionListCommand(options);
11066
11069
  });
11067
- program.parse();
11070
+ export {
11071
+ program
11072
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "1.43.4",
3
+ "version": "1.43.6",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [
@@ -12,12 +12,19 @@
12
12
  "bin": {
13
13
  "one": "./bin/cli.js"
14
14
  },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ }
20
+ },
15
21
  "scripts": {
16
22
  "build": "tsup",
17
23
  "dev": "tsup --watch",
18
24
  "start": "node bin/cli.js",
19
25
  "typecheck": "tsc --noEmit",
20
- "test": "tsx --test \"src/**/*.test.ts\""
26
+ "test": "tsx --test \"src/**/*.test.ts\"",
27
+ "prepare": "tsup"
21
28
  },
22
29
  "dependencies": {
23
30
  "@clack/prompts": "^0.9.1",