@answerlayer/cli 0.2.6 → 0.2.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.
package/README.md CHANGED
@@ -119,6 +119,10 @@ cancelled:
119
119
 
120
120
  ```bash
121
121
  answerlayer pipelines revisions validate <pipeline-id> <revision-id> --wait --json
122
+ answerlayer pipelines revisions connection-test <pipeline-id> <revision-id> --wait --json
123
+ answerlayer pipelines revisions probe <pipeline-id> <revision-id> \
124
+ --request-limit 2 --row-limit 100 --byte-limit 1048576 \
125
+ --runtime-limit 60 --wait --json
122
126
  answerlayer pipelines revisions promote <pipeline-id> <revision-id> --json
123
127
  ```
124
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@answerlayer/cli",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Open-source command line client for the AnswerLayer API.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -180,7 +180,8 @@ to see exact flags before using one:
180
180
  - `dashboards`, `tiles` — build and read dashboards
181
181
  - `documents` — upload business-context docs and link them to connections
182
182
  - `connections` — create / test / inspect schema
183
- - `pipelines` — create, inspect, update, enable, disable, and archive pipelines;
183
+ - `pipelines` — create, inspect, update, validate, connection-test, probe,
184
+ promote, enable, disable, and archive pipelines;
184
185
  upload immutable packages; list, inspect, diff, validate, promote, and roll
185
186
  back revisions; and run/retry/cancel exact revisions. Use `--wait --json` for
186
187
  automation. Never put credentials or CA material in package configuration;
@@ -196,6 +197,9 @@ to see exact flags before using one:
196
197
  - **Read freely, but confirm before writes.** `create`, `update`, `delete`,
197
198
  `revoke`, `approve`, `deploy`, and `assign`/`unassign` change state — show the
198
199
  user what you're about to run and get a yes first.
200
+ - Pipeline `connection-test` and `probe` commands access live customer systems
201
+ and data. Show the exact revision and probe limits and get confirmation before
202
+ running either command, even though they cannot publish production tables.
199
203
  - If a command fails with a `403` / missing-scope error, the API key lacks a
200
204
  scope (e.g. `inquiry:execute`, `query:execute`, `connection:read`). Tell the
201
205
  user which scope to add to their key.
package/src/cli.js CHANGED
@@ -333,6 +333,33 @@ async function handlePipelineRevisions(client, base, positionals, parsed, io) {
333
333
  pipelinePath,
334
334
  );
335
335
  }
336
+ if (action === "connection-test" || action === "test-connection") {
337
+ return requestWaitAndPrint(
338
+ client,
339
+ "POST",
340
+ `${revisionPath}/connection-test`,
341
+ parsed,
342
+ io,
343
+ pipelinePath,
344
+ );
345
+ }
346
+ if (action === "probe" || action === "dry-run") {
347
+ const body = {
348
+ request_limit: requiredBoundedFlag(parsed.flags.requestLimit, "request-limit", 1, 100),
349
+ row_limit: requiredBoundedFlag(parsed.flags.rowLimit, "row-limit", 1, 100000),
350
+ byte_limit: requiredBoundedFlag(parsed.flags.byteLimit, "byte-limit", 1024, 100 * 1024 * 1024),
351
+ runtime_limit_seconds: requiredBoundedFlag(parsed.flags.runtimeLimit, "runtime-limit", 1, 900),
352
+ };
353
+ return requestWaitAndPrint(
354
+ client,
355
+ "POST",
356
+ `${revisionPath}/probe`,
357
+ parsed,
358
+ io,
359
+ pipelinePath,
360
+ { body },
361
+ );
362
+ }
336
363
  if (action === "promote") {
337
364
  return requestAndPrint(client, "POST", `${revisionPath}/promote`, parsed, io);
338
365
  }
@@ -1727,8 +1754,9 @@ async function requestWaitAndPrint(
1727
1754
  parsed,
1728
1755
  io,
1729
1756
  pipelinePath,
1757
+ options = {},
1730
1758
  ) {
1731
- let result = await client.rawRequest(method, pathName);
1759
+ let result = await client.rawRequest(method, pathName, { body: options.body });
1732
1760
  if (parsed.flags.wait) {
1733
1761
  result = await waitForPipelineRun(client, result, parsed.flags, io, pipelinePath);
1734
1762
  }
@@ -2072,6 +2100,14 @@ function parseBoundedInteger(value, name, minimum, maximum) {
2072
2100
  return parsed;
2073
2101
  }
2074
2102
 
2103
+ function requiredBoundedFlag(value, name, minimum, maximum) {
2104
+ const first = firstValue(value);
2105
+ if (first === undefined || first === "") {
2106
+ throw usage(`pipelines revisions probe requires --${name}`);
2107
+ }
2108
+ return parseBoundedInteger(first, name, minimum, maximum);
2109
+ }
2110
+
2075
2111
  function requirePositional(positionals, index, label) {
2076
2112
  const value = positionals[index];
2077
2113
  if (!value) throw usage(`Missing ${label}`);
@@ -2190,7 +2226,7 @@ Usage:
2190
2226
  Core:
2191
2227
  answerlayer api-keys list|create|revoke
2192
2228
  answerlayer pipelines list|create|get|update|enable|disable|archive
2193
- answerlayer pipelines revisions list|get|push|validate|promote|diff|rollback <pipeline-id> [revision-id]
2229
+ answerlayer pipelines revisions list|get|push|validate|connection-test|probe|promote|diff|rollback <pipeline-id> [revision-id]
2194
2230
  answerlayer pipelines runs start|get|retry|cancel <pipeline-id> [run-id]
2195
2231
  answerlayer connections supported|list|get|create|update|delete|schema|test
2196
2232
  answerlayer metadata structure|tables|columns|pii-summary|pii-settings|detect-pii
@@ -2266,6 +2302,10 @@ Pipeline options:
2266
2302
  --wait Poll validation or execution to a terminal state.
2267
2303
  --wait-timeout <sec> Maximum wait time. Default: 600.
2268
2304
  --poll-interval <sec> Poll interval. Default: 2.
2305
+ --request-limit <n> Probe dataset/request ceiling (1-100; required).
2306
+ --row-limit <n> Probe row ceiling (1-100000; required).
2307
+ --byte-limit <n> Probe decoded-byte ceiling (1024-104857600; required).
2308
+ --runtime-limit <sec> Probe runtime ceiling (1-900; required).
2269
2309
 
2270
2310
  SQL options:
2271
2311
  --sql, -q <sql> SQL text.