@withone/cli 1.41.0 → 1.42.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
@@ -349,6 +349,22 @@ one sync run stripe --full-refresh
349
349
 
350
350
  Change hooks (`onInsert`, `onUpdate`, `onChange`) fire per-page during sync — pipe to a shell command, a flow, or an event log. Root-array responses (e.g. Hacker News `/v0/topstories.json` → `[9129911, 9129199, ...]`) are supported by setting `resultsPath` to `""`, `"$"`, or `"."`; primitive elements are auto-wrapped as `{ [idField]: value }`. Run `one guide sync` for the full reference.
351
351
 
352
+ ### `one relay`
353
+
354
+ Receive webhooks from platforms and forward them to any connected platform via passthrough actions.
355
+
356
+ ```bash
357
+ one relay platforms # List relay-capable platforms + event type counts
358
+ one relay event-types <platform> # List supported event types for a platform
359
+ one relay create --connection-key <key> --create-webhook --event-filters '["event.type"]'
360
+ one relay activate <id> --actions '<json>' # Attach passthrough forwarding actions
361
+ one relay list # List existing relay endpoints
362
+ one relay events --platform <p> # Inspect received events
363
+ one relay deliveries --endpoint-id <id> # Check delivery status
364
+ ```
365
+
366
+ Start with `one relay platforms` to discover which platforms support relay at all, then drill into `event-types <platform>` for the specific events. Run `one guide relay` for the full reference including `--metadata` requirements per platform.
367
+
352
368
  ### `one guide [topic]`
353
369
 
354
370
  Get the full CLI usage guide, designed for AI agents that only have the binary (no MCP, no IDE skills).
@@ -442,6 +442,9 @@ var OneApi = class {
442
442
  async listRelayEventTypes(platform) {
443
443
  return this.requestFull({ path: "/webhooks/relay/event-types", queryParams: { platform } });
444
444
  }
445
+ async listRelayPlatforms() {
446
+ return this.requestFull({ path: "/webhooks/relay/platforms" });
447
+ }
445
448
  async waitForConnection(platform, timeoutMs = 5 * 60 * 1e3, pollIntervalMs = 5e3, onPoll) {
446
449
  const startTime = Date.now();
447
450
  const existingConnections = await this.listConnections();
@@ -1137,7 +1140,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
1137
1140
  if (flowStack.includes(resolvedKey)) {
1138
1141
  throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
1139
1142
  }
1140
- const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-26LNPU4F.js");
1143
+ const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-Y2CXXU3U.js");
1141
1144
  const { flow: subFlow, rootDir: subRootDir } = loadFlowWithMeta2(resolvedKey);
1142
1145
  const subContext = await executeFlow(
1143
1146
  subFlow,
@@ -11,7 +11,7 @@ import {
11
11
  saveFlow,
12
12
  summarizeFlowInputs,
13
13
  walkSteps
14
- } from "./chunk-A5AFLKCQ.js";
14
+ } from "./chunk-PK2RAVAF.js";
15
15
  export {
16
16
  FlowRunner,
17
17
  collectStepTypes,
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  resolveFlowPath,
20
20
  saveFlow,
21
21
  validateActionInput
22
- } from "./chunk-A5AFLKCQ.js";
22
+ } from "./chunk-PK2RAVAF.js";
23
23
 
24
24
  // src/index.ts
25
25
  import { createRequire as createRequire2 } from "module";
@@ -4643,6 +4643,42 @@ async function relayDeliveriesCommand(options) {
4643
4643
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
4644
4644
  }
4645
4645
  }
4646
+ async function relayPlatformsCommand() {
4647
+ const { apiKey } = getConfig3();
4648
+ const api = new OneApi(apiKey, getApiBase());
4649
+ const spinner6 = createSpinner();
4650
+ spinner6.start("Loading relay-capable platforms...");
4651
+ try {
4652
+ const platforms = await api.listRelayPlatforms();
4653
+ if (isAgentMode()) {
4654
+ json({ platforms });
4655
+ return;
4656
+ }
4657
+ spinner6.stop(`${platforms.length} relay-capable platform${platforms.length === 1 ? "" : "s"} found`);
4658
+ if (platforms.length === 0) {
4659
+ console.log("\n No relay-capable platforms available.\n");
4660
+ return;
4661
+ }
4662
+ console.log();
4663
+ printTable(
4664
+ [
4665
+ { key: "platform", label: "Platform" },
4666
+ { key: "eventTypeCount", label: "Event types", color: pc8.dim }
4667
+ ],
4668
+ platforms.map((p10) => ({ platform: p10.platform, eventTypeCount: String(p10.eventTypeCount) }))
4669
+ );
4670
+ console.log();
4671
+ console.log(
4672
+ pc8.dim(
4673
+ ` Run ${pc8.cyan("one relay event-types <platform>")} to see the full event list for a platform.
4674
+ `
4675
+ )
4676
+ );
4677
+ } catch (error2) {
4678
+ spinner6.stop("Failed to load relay platforms");
4679
+ error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
4680
+ }
4681
+ }
4646
4682
  async function relayEventTypesCommand(platform) {
4647
4683
  const { apiKey } = getConfig3();
4648
4684
  const api = new OneApi(apiKey, getApiBase());
@@ -7395,7 +7431,7 @@ function getApi() {
7395
7431
  if (!apiKey) {
7396
7432
  error('No API key configured. Run "one init" first.');
7397
7433
  }
7398
- return new OneApi(apiKey);
7434
+ return new OneApi(apiKey, getApiBase());
7399
7435
  }
7400
7436
  async function syncProfilesCommand(platform) {
7401
7437
  const profiles = listBuiltinProfiles(platform);
@@ -8314,6 +8350,7 @@ Receive webhooks from platforms (Stripe, GitHub, Airtable, Attio, Google Calenda
8314
8350
 
8315
8351
  **Quick start:**
8316
8352
  \`\`\`bash
8353
+ one --agent relay platforms # See relay-capable platforms
8317
8354
  one --agent relay event-types <platform> # See available events
8318
8355
  one --agent relay create --connection-key <key> --create-webhook --event-filters '["event.type"]'
8319
8356
  one --agent relay activate <id> --actions '[{"type":"passthrough","actionId":"...","connectionKey":"...","body":{...}}]'
@@ -8459,6 +8496,7 @@ Webhook relay receives events from platforms (Stripe, GitHub, Airtable, Attio, G
8459
8496
  ## Commands
8460
8497
 
8461
8498
  \`\`\`bash
8499
+ one --agent relay platforms # List relay-capable platforms + event type counts
8462
8500
  one --agent relay event-types <platform> # List available events
8463
8501
  one --agent relay create --connection-key <key> --create-webhook --event-filters '["event.type"]'
8464
8502
  one --agent relay activate <id> --actions '<json>' # Add forwarding actions
@@ -8473,7 +8511,7 @@ one --agent relay deliveries --endpoint-id <id> # Check delivery status
8473
8511
 
8474
8512
  ## Building a Relay
8475
8513
 
8476
- 1. **Discover connections** \u2014 identify source and destination platforms
8514
+ 1. **Discover connections** \u2014 identify source and destination platforms. Use \`one --agent relay platforms\` to see which platforms support relay at all before digging into a specific one.
8477
8515
  2. **Get event types** \u2014 \`one --agent relay event-types <platform>\`
8478
8516
  3. **Get source knowledge** \u2014 understand the incoming webhook payload shape (\`{{payload.*}}\` paths)
8479
8517
  4. **Get destination knowledge** \u2014 understand the outgoing API body shape
@@ -9472,6 +9510,7 @@ program.name("one").option("--agent", "Machine-readable JSON output (no colors,
9472
9510
  one cache update-all Re-fetch fresh data for all cached entries
9473
9511
 
9474
9512
  Webhook Relay:
9513
+ one relay platforms List platforms that support relay + event type counts
9475
9514
  one relay create Create a relay endpoint for a connection
9476
9515
  one relay list List relay endpoints
9477
9516
  one relay activate <id> Activate with passthrough actions
@@ -9775,6 +9814,9 @@ relay.command("deliveries").description("List delivery attempts for an endpoint
9775
9814
  relay.command("event-types <platform>").description("List supported webhook event types for a platform").action(async (platform) => {
9776
9815
  await relayEventTypesCommand(platform);
9777
9816
  });
9817
+ relay.command("platforms").description("List all platforms that support webhook relay, with their event type counts").action(async () => {
9818
+ await relayPlatformsCommand();
9819
+ });
9778
9820
  registerSyncCommands(program);
9779
9821
  var cache = program.command("cache").description("Manage the local knowledge and search cache");
9780
9822
  cache.command("clear [actionId]").description("Clear all cached data, or a specific action by ID").action(async (actionId) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [
@@ -16,6 +16,14 @@ one --agent connection list
16
16
 
17
17
  Identify source (sends webhooks) and destination (receives forwarded data). Note both connection keys.
18
18
 
19
+ If you're unsure whether the source platform supports relay at all, list relay-capable platforms first:
20
+
21
+ ```bash
22
+ one --agent relay platforms
23
+ ```
24
+
25
+ This returns `[{ "platform": "<name>", "eventTypeCount": <n> }, ...]` for every platform that One can receive webhooks from. If your source isn't in the list, relay won't work for it.
26
+
19
27
  ### Step 2: Get event types
20
28
 
21
29
  ```bash
@@ -173,6 +181,13 @@ one --agent relay activate <relay-id> --actions '[{
173
181
  }]'
174
182
  ```
175
183
 
184
+ ## Discovery Commands
185
+
186
+ ```bash
187
+ one --agent relay platforms # All relay-capable platforms + event type counts
188
+ one --agent relay event-types <platform> # Event types for a specific platform
189
+ ```
190
+
176
191
  ## Management Commands
177
192
 
178
193
  ```bash