@w6w/cli 0.6.0 → 0.9.8

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
@@ -7,7 +7,9 @@ auth, output formatting and exit codes. No business logic, no client-side pollin
7
7
  retries. Everything it can do, the HTTP API can do — the CLI just makes it typeable.
8
8
 
9
9
  - **License:** MIT (see [LICENSE](./LICENSE)).
10
- - **Version:** `0.1.1`.
10
+ - **Version:** `0.9.7`. Needs Node.js 18 or later.
11
+ - **Guides:** [docs.w6w.io/clients/cli](https://docs.w6w.io/clients/cli/), with a
12
+ [command reference](https://docs.w6w.io/clients/cli/commands/).
11
13
 
12
14
  ## Install
13
15
 
@@ -16,8 +18,8 @@ npm install -g @w6w/cli
16
18
  w6w --help
17
19
  ```
18
20
 
19
- `@w6w/cli`, `@w6w/sdk` and the Python `w6w` package share one version number and are released
20
- together. A given version means the same set of operations in every language.
21
+ `@w6w/cli`, `@w6w/sdk`, `@w6w/react` and the Python `w6w` package share one version number and are
22
+ released together. A given version means the same set of operations in every language.
21
23
 
22
24
  ## Configuration
23
25
 
@@ -43,28 +45,53 @@ server reachable, which is exactly when people need them most.
43
45
  ## Usage
44
46
 
45
47
  ```bash
46
- w6w me # who am I, and which component versions am I talking to?
48
+ w6w me # who am I, and which CLI version is this? (alias: info)
47
49
 
48
50
  # Discover what you can run — a `conn_…`, `wf_…`, `fn_…` or `ep_…` id.
49
- w6w connections list
51
+ w6w connections list # short forms: `w6w conn ls`, `w6w wf ls`, `w6w docs ls`
50
52
  w6w workflows list
53
+ w6w functions list
51
54
 
52
55
  # Run a connection action: a `conn_…` id needs --action.
53
56
  w6w run conn_01H… --action send_email --payload '{"to":"a@b.com"}'
54
57
 
55
- # A function or an endpoint runs the same way, with no --action.
56
- w6w run fn_normalize_address --payload '{"address":"1 Infinite Loop"}'
58
+ # …or name the app, when you have exactly one connection for it.
59
+ w6w run --app sendgrid --action send_email --payload '{"to":"a@b.com"}'
60
+
61
+ # A Function or an Endpoint runs the same way, with no --action — by id, or by key
62
+ # with an `fn:` / `ep:` / `wf:` prefix.
63
+ w6w run fn_01H… --payload '{"address":"1 Infinite Loop"}'
64
+ w6w run fn:normalize-address --payload '{"address":"1 Infinite Loop"}'
57
65
 
58
66
  # `w6w run wf_…` dispatches a workflow like anything else and always queues it.
59
67
  # `w6w workflows run` is the typed path, and the only one that can wait:
60
- w6w workflows run wf_01H… --wait
68
+ w6w workflows run wf_01H… --wait --input '{"email":"a@b.com"}'
69
+ w6w workflows cancel run_01H…
61
70
 
62
71
  # Documents and vars are plain CRUD; the key/name is positional, the rest are flags.
63
72
  w6w documents create welcome --content "# Hi"
64
73
  w6w vars create greeting --type string --value hello
74
+
75
+ # Your account's members and invites (writes need the owner or admin role).
76
+ w6w team members
77
+ w6w team invite --email dev@example.com --role member
65
78
  ```
66
79
 
67
- Add `--json` to any command for raw JSON instead of a table — the shape to script against.
80
+ Add `--json` to any command for raw JSON instead of a table — the shape to script against. Errors go
81
+ to stderr as `w6w: <message>`; colour is used only on a terminal and is turned off by `--no-color`
82
+ or `NO_COLOR`.
83
+
84
+ ### Known limitations
85
+
86
+ A few flags that `--help` lists aren't applied yet:
87
+
88
+ - `functions run` / `endpoints run` read neither `--id-or-key` nor `--inputs` / `--input`, and
89
+ reject `--payload`. Pass the key positionally, and send input with
90
+ `w6w run fn:<key> --payload '…'` (or `ep:<key>`).
91
+ - `workflows run` ignores `--var` and `--trigger`.
92
+ - `workflows update` ignores `--if-unmodified-since`, so the save always wins.
93
+ - `team --help` still says the routes return `404`; they are live and work.
94
+ - `functions delete` needs the Function archived first, which the CLI can't do yet.
68
95
 
69
96
  ## Help
70
97
 
@@ -77,18 +104,18 @@ w6w documents create --help # arguments, flags, examples
77
104
  w6w help documents create # the same thing, spelled the other way
78
105
  ```
79
106
 
80
- Help is **generated** from the machine-readable surface contract all three w6w wrappers implement,
81
- so the CLI cannot document an operation it does not have, or omit one it does. A bare `w6w` prints
82
- the root help and exits `0`.
107
+ Help is **generated** from the machine-readable surface contract every contract lane implements, so
108
+ the CLI cannot document an operation it does not have, or omit one it does. A bare `w6w` prints the
109
+ root help and exits `0`.
83
110
 
84
111
  ## Exit codes
85
112
 
86
- | Code | Meaning |
87
- | ---- | ------------------------------------------------------------------------ |
88
- | `0` | Success — including help, and including a _queued_ or _running_ workflow |
89
- | `1` | Usage error — unknown command, missing argument, bad flag |
90
- | `2` | API error — 4xx/5xx from the server, including auth failure |
91
- | `3` | Run failure — `--wait` returned a run with status `failed` |
113
+ | Code | Meaning |
114
+ | ---- | -------------------------------------------------------------------------------------------------------- |
115
+ | `0` | Success — including help, and including a _queued_ or _running_ workflow |
116
+ | `1` | Usage or configuration error — unknown command, missing argument, bad flag or JSON, no base URL or token |
117
+ | `2` | API error — 4xx/5xx from the server, including auth failure, or the server could not be reached |
118
+ | `3` | Run failure — `--wait` returned a run with status `failed` |
92
119
 
93
120
  Code `3` exists so `w6w workflows run --wait` is usable in CI without parsing stdout. Keeping it
94
121
  distinct from `2` matters: a failed workflow and an unreachable API demand opposite responses, and a
@@ -97,18 +124,17 @@ script that cannot tell them apart will retry the wrong one.
97
124
  ## The surface
98
125
 
99
126
  What commands exist is not decided in this repo. It is defined by the shared machine-readable
100
- contract `endpoints.json`, which sits beside this repo alongside its two sibling wrapper repos and
101
- which each wrapper's conformance test reads directly — the same file, never a vendored copy. A
102
- command missing from a wrapper is a failing test, not a preference.
127
+ contract `endpoints.json`, which sits at the root of this repo, one directory up, and which each
128
+ contract lane's conformance test reads directly — the same file, never a vendored copy. A command
129
+ missing from a wrapper is a failing test, not a preference.
103
130
 
104
- Some operations are marked `planned` in that contract: they are implemented and unit-tested here,
105
- but the corresponding server route is not live yet, so calling them against a server today returns
106
- `404`. Their help says so. The marker records **server** readiness, not CLI completeness.
131
+ An operation marked `planned` in that contract is implemented and unit-tested here ahead of its
132
+ server route, and its help says so. The marker records **server** readiness, not CLI completeness.
107
133
 
108
134
  ## Versioning
109
135
 
110
- The version is a shared fact across all three wrappers, so a release may go out for this package
111
- even when nothing in it changed — a divergent version is far more expensive than an empty release.
136
+ The version is a shared fact across all four packages, so a release may go out for this package even
137
+ when nothing in it changed — a divergent version is far more expensive than an empty release.
112
138
 
113
139
  Below `1.0.0`, **breaking changes may land in a minor bump.** That grace ends at `1.0.0`; do not
114
140
  plan around it.
package/dist/mod.js CHANGED
@@ -51,7 +51,7 @@ export { COMMAND_PATHS, EXIT_CODES, GLOBAL_FLAGS, HELP_TREE } from "./src/help.g
51
51
  * The explicit `: string` annotation is required, not decorative: JSR publishes
52
52
  * this file as TypeScript source and rejects inferred public types.
53
53
  */
54
- export const VERSION = "0.6.0";
54
+ export const VERSION = "0.9.8";
55
55
  /** `w6w help <command>` is accepted as an alias for `w6w <command> --help`. */
56
56
  const HELP_COMMAND = "help";
57
57
  /**
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `w6w functions …` — the Function definition lifecycle at the command line.
3
+ *
4
+ * Five commands, **one SDK call each**. `functions run` is deliberately NOT
5
+ * here: it lives in `src/commands/named-run.ts` beside `endpoints run`, because
6
+ * the two share their whole shape (a name, a JSON input, an unwrapped output)
7
+ * and splitting them by domain would put one of a matched pair in each file.
8
+ * The registry is keyed by command path, so a caller sees one `w6w functions`
9
+ * group either way.
10
+ *
11
+ * This group mirrors `w6w workflows` op for op, minus two things the server
12
+ * does not have on this domain:
13
+ *
14
+ * - **No `--project`.** `GET /functions` reads no `?project=` at all, so a flag
15
+ * here would be one the server ignores — the same reason `w6w vars` refuses
16
+ * it while `w6w documents` takes it.
17
+ * - **No archive step.** A Function deletes in one call.
18
+ *
19
+ * `create` and `update` are the same upsert route: `create` mints the required
20
+ * `fn_…` id, `update` pins the one you addressed, and `update` is therefore a
21
+ * FULL REPLACEMENT — `w6w functions get <id> --json` is where the definition to
22
+ * edit comes from.
23
+ *
24
+ * @module
25
+ */
26
+ import type { CommandRegistry } from "../../mod.ts";
27
+ export declare const FUNCTION_COMMANDS: CommandRegistry;
28
+ //# sourceMappingURL=functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/commands/functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAkC,eAAe,EAAE,MAAM,cAAc,CAAC;AAoGpF,eAAO,MAAM,iBAAiB,EAAE,eAM/B,CAAC"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * `w6w functions …` — the Function definition lifecycle at the command line.
3
+ *
4
+ * Five commands, **one SDK call each**. `functions run` is deliberately NOT
5
+ * here: it lives in `src/commands/named-run.ts` beside `endpoints run`, because
6
+ * the two share their whole shape (a name, a JSON input, an unwrapped output)
7
+ * and splitting them by domain would put one of a matched pair in each file.
8
+ * The registry is keyed by command path, so a caller sees one `w6w functions`
9
+ * group either way.
10
+ *
11
+ * This group mirrors `w6w workflows` op for op, minus two things the server
12
+ * does not have on this domain:
13
+ *
14
+ * - **No `--project`.** `GET /functions` reads no `?project=` at all, so a flag
15
+ * here would be one the server ignores — the same reason `w6w vars` refuses
16
+ * it while `w6w documents` takes it.
17
+ * - **No archive step.** A Function deletes in one call.
18
+ *
19
+ * `create` and `update` are the same upsert route: `create` mints the required
20
+ * `fn_…` id, `update` pins the one you addressed, and `update` is therefore a
21
+ * FULL REPLACEMENT — `w6w functions get <id> --json` is where the definition to
22
+ * edit comes from.
23
+ *
24
+ * @module
25
+ */
26
+ import { argument, noExtraArguments, requiredFlag, table, usageError } from "./shared.js";
27
+ /**
28
+ * `--definition <json>` as the object the write routes take.
29
+ *
30
+ * The same rule `w6w workflows` applies, and deliberately a second copy rather
31
+ * than a shared helper: the two groups' definitions are different documents
32
+ * with different validators, and a shared parser is a seam for one domain's
33
+ * rules to start describing the other's errors.
34
+ */
35
+ function definition(context) {
36
+ const text = requiredFlag(context, "definition", "--definition <json>");
37
+ let parsed;
38
+ try {
39
+ parsed = JSON.parse(text);
40
+ }
41
+ catch {
42
+ throw usageError(context, "`--definition` must be valid JSON.");
43
+ }
44
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
45
+ throw usageError(context, "`--definition` must be a JSON object.");
46
+ }
47
+ return parsed;
48
+ }
49
+ /** One Function, as a table row. */
50
+ function row(fn) {
51
+ // `valid` is rendered as a word rather than a boolean: this column answers
52
+ // "can I run this?", and `false` in a table of ids reads like a missing value.
53
+ return [fn.id, fn.key, fn.valid ? "runnable" : "draft", fn.updatedAt];
54
+ }
55
+ /** The listing: one line per Function, or a line saying there are none. */
56
+ function renderList(fns, styles) {
57
+ if (fns.length === 0)
58
+ return styles.dim("No functions.");
59
+ return table(["ID", "KEY", "STATE", "UPDATED"], fns.map(row), styles);
60
+ }
61
+ /** One Function in full — the JSON is what the reader came for. */
62
+ function renderDetail(detail, styles) {
63
+ const key = typeof detail.function.key === "string" ? detail.function.key : "";
64
+ const state = detail.valid ? "runnable" : "draft";
65
+ return [
66
+ `${styles.bold(key)} ${styles.dim(`(${state})`)}`,
67
+ "",
68
+ JSON.stringify(detail.function, null, 2),
69
+ ].join("\n");
70
+ }
71
+ /** The confirmation for a write: what changed, and how to address it next time. */
72
+ function renderSave(verb, saved, styles) {
73
+ return `${verb} ${styles.bold(saved.key)} ${styles.dim(`(${saved.id})`)}`;
74
+ }
75
+ const list = async (context) => {
76
+ noExtraArguments(context, 0);
77
+ const fns = await context.client().functions.list();
78
+ context.out.emit(fns, (styles) => renderList(fns, styles));
79
+ };
80
+ const get = async (context) => {
81
+ const id = argument(context, 0, "a function id or key (see: `w6w functions list`)");
82
+ noExtraArguments(context, 1);
83
+ const detail = await context.client().functions.get(id);
84
+ context.out.emit(detail, (styles) => renderDetail(detail, styles));
85
+ };
86
+ const create = async (context) => {
87
+ noExtraArguments(context, 0);
88
+ const saved = await context.client().functions.create(definition(context));
89
+ context.out.emit(saved, (styles) => renderSave("Created", saved, styles));
90
+ };
91
+ const update = async (context) => {
92
+ const id = argument(context, 0, "a function id or key (see: `w6w functions list`)");
93
+ noExtraArguments(context, 1);
94
+ const saved = await context.client().functions.update(id, definition(context));
95
+ context.out.emit(saved, (styles) => renderSave("Updated", saved, styles));
96
+ };
97
+ /**
98
+ * `w6w functions delete <id>` — one call, no confirmation prompt.
99
+ *
100
+ * Nothing checks for callers first, here or server-side: a Function may be
101
+ * referenced by an Endpoint, a Workflow step, or another Function's `impl`, and
102
+ * those references break at call time rather than at delete time. This lane is
103
+ * non-interactive by construction, so it does not ask — it reports, and the
104
+ * caller decides before typing it.
105
+ */
106
+ const remove = async (context) => {
107
+ const id = argument(context, 0, "a function id or key (see: `w6w functions list`)");
108
+ noExtraArguments(context, 1);
109
+ await context.client().functions.delete(id);
110
+ // `null` rather than the server's `{ok: true}`: the SDK unwraps a delete to
111
+ // nothing, and `--json` must not invent a body the wrapper does not have.
112
+ context.out.emit(null, (styles) => styles.dim(`Deleted ${id}.`));
113
+ };
114
+ export const FUNCTION_COMMANDS = {
115
+ "functions list": list,
116
+ "functions get": get,
117
+ "functions create": create,
118
+ "functions update": update,
119
+ "functions delete": remove,
120
+ };
121
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/commands/functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1F;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,OAAuB;IACzC,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,qBAAqB,CAAC,CAAC;IACxE,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,UAAU,CAAC,OAAO,EAAE,oCAA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EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,GAAG;IACpB,kBAAkB,EAAE,MAAM;IAC1B,kBAAkB,EAAE,MAAM;IAC1B,kBAAkB,EAAE,MAAM;CAC3B,CAAC"}
@@ -20,9 +20,11 @@ export { DOCUMENT_COMMANDS } from "./documents.ts";
20
20
  export { VAR_COMMANDS } from "./vars.ts";
21
21
  export { ME_COMMANDS } from "./me.ts";
22
22
  export { CONNECTION_COMMANDS } from "./connections.ts";
23
+ export { FUNCTION_COMMANDS } from "./functions.ts";
23
24
  export { NAMED_RUN_COMMANDS } from "./named-run.ts";
24
25
  export { WORKFLOW_COMMANDS } from "./workflows.ts";
25
26
  export { RUN_COMMANDS } from "./run.ts";
27
+ export { TEAM_COMMANDS } from "./team.ts";
26
28
  /** Every wired command, keyed by canonical command path. */
27
29
  export declare const COMMANDS: CommandRegistry;
28
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AASpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,EAAE,eAQtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAWpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,EAAE,eAUtB,CAAC"}
@@ -19,16 +19,20 @@ import { DOCUMENT_COMMANDS } from "./documents.js";
19
19
  import { VAR_COMMANDS } from "./vars.js";
20
20
  import { ME_COMMANDS } from "./me.js";
21
21
  import { CONNECTION_COMMANDS } from "./connections.js";
22
+ import { FUNCTION_COMMANDS } from "./functions.js";
22
23
  import { NAMED_RUN_COMMANDS } from "./named-run.js";
23
24
  import { WORKFLOW_COMMANDS } from "./workflows.js";
24
25
  import { RUN_COMMANDS } from "./run.js";
26
+ import { TEAM_COMMANDS } from "./team.js";
25
27
  export { DOCUMENT_COMMANDS } from "./documents.js";
26
28
  export { VAR_COMMANDS } from "./vars.js";
27
29
  export { ME_COMMANDS } from "./me.js";
28
30
  export { CONNECTION_COMMANDS } from "./connections.js";
31
+ export { FUNCTION_COMMANDS } from "./functions.js";
29
32
  export { NAMED_RUN_COMMANDS } from "./named-run.js";
30
33
  export { WORKFLOW_COMMANDS } from "./workflows.js";
31
34
  export { RUN_COMMANDS } from "./run.js";
35
+ export { TEAM_COMMANDS } from "./team.js";
32
36
  /** Every wired command, keyed by canonical command path. */
33
37
  export const COMMANDS = {
34
38
  ...DOCUMENT_COMMANDS,
@@ -36,7 +40,9 @@ export const COMMANDS = {
36
40
  ...ME_COMMANDS,
37
41
  ...CONNECTION_COMMANDS,
38
42
  ...WORKFLOW_COMMANDS,
43
+ ...FUNCTION_COMMANDS,
39
44
  ...NAMED_RUN_COMMANDS,
40
45
  ...RUN_COMMANDS,
46
+ ...TEAM_COMMANDS,
41
47
  };
42
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB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AO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACvC,GAAG,iBAAiB;IACpB,GAAG,YAAY;IACf,GAAG,WAAW;IACd,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,iBAAiB;IACpB,GAAG,kBAAkB;IACrB,GAAG,YAAY;IACf,GAAG,aAAa;CACjB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `w6w team …` — the caller's account team at the command line.
3
+ *
4
+ * Six commands, **one SDK call each**. Nothing here composes two requests,
5
+ * filters a list or resolves an id by scanning: a wrapper that has to compose
6
+ * two calls is describing an operation that belongs in the API
7
+ * (`README.md`, "What a wrapper is"), and the CLI is a wrapper like the other
8
+ * two.
9
+ *
10
+ * Every handler does the same four steps, in order: read its own arguments,
11
+ * call one method on `client.team`, render, return. Errors are not caught here
12
+ * — `main()` reports a throw once, on stderr, and maps it to an exit code
13
+ * through `src/exit.ts`, so an `ApiError` exits 2 and a usage error exits 1
14
+ * without any command deciding that for itself.
15
+ *
16
+ * **No `--project` anywhere in this group.** Team membership is account-wide,
17
+ * not project-scoped — unlike `w6w documents`, which takes the flag on every
18
+ * command.
19
+ *
20
+ * @module
21
+ */
22
+ import type { CommandRegistry } from "../../mod.ts";
23
+ /**
24
+ * The six `w6w team` commands, keyed by the canonical command path.
25
+ *
26
+ * The keys are the generated help tree's `path` values joined by a space,
27
+ * which are `endpoints.json`'s `naming.cli` spellings —
28
+ * `tests/cmd_team_test.ts` asserts the two sets are the same, so a command
29
+ * cannot be registered under a name the help does not document, or
30
+ * documented under a name nothing runs.
31
+ */
32
+ export declare const TEAM_COMMANDS: CommandRegistry;
33
+ //# sourceMappingURL=team.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../../src/commands/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,cAAc,CAAC;AAuGpE;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,eAO3B,CAAC"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * `w6w team …` — the caller's account team at the command line.
3
+ *
4
+ * Six commands, **one SDK call each**. Nothing here composes two requests,
5
+ * filters a list or resolves an id by scanning: a wrapper that has to compose
6
+ * two calls is describing an operation that belongs in the API
7
+ * (`README.md`, "What a wrapper is"), and the CLI is a wrapper like the other
8
+ * two.
9
+ *
10
+ * Every handler does the same four steps, in order: read its own arguments,
11
+ * call one method on `client.team`, render, return. Errors are not caught here
12
+ * — `main()` reports a throw once, on stderr, and maps it to an exit code
13
+ * through `src/exit.ts`, so an `ApiError` exits 2 and a usage error exits 1
14
+ * without any command deciding that for itself.
15
+ *
16
+ * **No `--project` anywhere in this group.** Team membership is account-wide,
17
+ * not project-scoped — unlike `w6w documents`, which takes the flag on every
18
+ * command.
19
+ *
20
+ * @module
21
+ */
22
+ import { argument, noExtraArguments, requiredFlag, table, textFlag } from "./shared.js";
23
+ /** One team member, as a table row. */
24
+ function memberRow(member) {
25
+ return [member.userId, member.email ?? "—", member.displayName ?? "—", member.role];
26
+ }
27
+ /** The roster: one line per member. There is always at least one — the owner. */
28
+ function renderMembers(members, styles) {
29
+ return table(["USER ID", "EMAIL", "NAME", "ROLE"], members.map(memberRow), styles);
30
+ }
31
+ const members = async (context) => {
32
+ noExtraArguments(context, 0);
33
+ const roster = await context.client().team.members();
34
+ context.out.emit(roster, (styles) => renderMembers(roster, styles));
35
+ };
36
+ /**
37
+ * `w6w team invite [--email <email>] [--role <role>]` — both flags optional.
38
+ *
39
+ * Omitting `--email` mints an OPEN invite: a shareable link with no target
40
+ * address. Omitting `--role` leaves it to the server's own default
41
+ * (`"member"`). The one-time `token`/`redemptionLink` this prints are never
42
+ * fetchable again — a caller that loses this output has to revoke and
43
+ * re-invite.
44
+ */
45
+ const invite = async (context) => {
46
+ noExtraArguments(context, 0);
47
+ const input = {};
48
+ const email = textFlag(context, "email");
49
+ if (email !== undefined)
50
+ input.email = email;
51
+ const role = textFlag(context, "role");
52
+ if (role !== undefined)
53
+ input.role = role;
54
+ const created = await context.client().team.invite(input);
55
+ context.out.emit(created, (styles) => {
56
+ const target = created.email ?? styles.dim("(open invite — no target email)");
57
+ const heading = `Invited ${styles.bold(target)} ${styles.dim(`(${created.id})`)}`;
58
+ return [heading, `Redemption link: ${created.redemptionLink}`].join("\n");
59
+ });
60
+ };
61
+ /** `w6w team invites` — the open (pending, unrevoked, unexpired) ones only. */
62
+ const invites = async (context) => {
63
+ noExtraArguments(context, 0);
64
+ const pending = await context.client().team.invites();
65
+ context.out.emit(pending, (styles) => {
66
+ if (pending.length === 0)
67
+ return styles.dim("No open invites.");
68
+ return table(["ID", "EMAIL", "ROLE", "EXPIRES"], pending.map((inv) => [
69
+ inv.id,
70
+ inv.email ?? styles.dim("(open)"),
71
+ inv.role ?? "—",
72
+ inv.expiresAt ?? "—",
73
+ ]), styles);
74
+ });
75
+ };
76
+ /**
77
+ * `w6w team revoke-invite <id>` — and **nothing on stdout**.
78
+ *
79
+ * The server answers `{ok:true}`; the wrapper contract unwraps that to
80
+ * nothing at all, so the only machine-readable part of the answer is the exit
81
+ * code. `--json` suppresses the human confirmation, printing an empty stdout
82
+ * rather than a payload the contract says does not exist.
83
+ */
84
+ const revokeInvite = async (context) => {
85
+ const id = argument(context, 0, "an invite id (see: `w6w team invites`)");
86
+ noExtraArguments(context, 1);
87
+ await context.client().team.revokeInvite(id);
88
+ context.out.note(`Revoked ${id}.`);
89
+ };
90
+ /**
91
+ * `w6w team set-role <userId> --role <role>` — the userId is positional, the
92
+ * new role is a required flag.
93
+ */
94
+ const setRole = async (context) => {
95
+ const userId = argument(context, 0, "a member's user id (see: `w6w team members`)");
96
+ noExtraArguments(context, 1);
97
+ const role = requiredFlag(context, "role", "--role <role>");
98
+ const member = await context.client().team.setRole(userId, role);
99
+ context.out.emit(member, (styles) => `Set ${styles.bold(member.userId)} to ${styles.bold(member.role)}.`);
100
+ };
101
+ /** `w6w team remove-member <userId>` — and **nothing on stdout**, same shape as `revoke-invite`. */
102
+ const removeMember = async (context) => {
103
+ const userId = argument(context, 0, "a member's user id (see: `w6w team members`)");
104
+ noExtraArguments(context, 1);
105
+ await context.client().team.removeMember(userId);
106
+ context.out.note(`Removed ${userId}.`);
107
+ };
108
+ /**
109
+ * The six `w6w team` commands, keyed by the canonical command path.
110
+ *
111
+ * The keys are the generated help tree's `path` values joined by a space,
112
+ * which are `endpoints.json`'s `naming.cli` spellings —
113
+ * `tests/cmd_team_test.ts` asserts the two sets are the same, so a command
114
+ * cannot be registered under a name the help does not document, or
115
+ * documented under a name nothing runs.
116
+ */
117
+ export const TEAM_COMMANDS = {
118
+ "team members": members,
119
+ "team invite": invite,
120
+ "team invites": invites,
121
+ "team revoke-invite": revokeInvite,
122
+ "team set-role": setRole,
123
+ "team remove-member": removeMember,
124
+ };
125
+ //# sourceMappingURL=team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../../../src/commands/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExF,uCAAuC;AACvC,SAAS,SAAS,CAAC,MAAkB;IACnC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,GAAG,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACtF,CAAC;AAED,iFAAiF;AACjF,SAAS,aAAa,CAAC,OAAqB,EAAE,MAAc;IAC1D,OAAO,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,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B,EAAE,YAAY;IAClC,eAAe,EAAE,OAAO;IACxB,oBAAoB,EAAE,YAAY;CACnC,CAAC"}
@@ -1,11 +1,28 @@
1
1
  /**
2
- * `w6w workflows …` — list definitions and start runs (D4).
2
+ * `w6w workflows …` — list definitions, start runs (D4), cancel them, and
3
+ * edit the definitions themselves.
3
4
  *
4
- * Two commands. `list` exists so a caller can find a `wf_…` id to pass to
5
+ * Eight commands. `list` exists so a caller can find a `wf_…` id to pass to
5
6
  * `w6w run` or to this group's own `run`; `run` is the typed path with
6
7
  * `--wait` and `--input`, kept alongside the unified `w6w run` because
7
8
  * `?wait=`, `variables`, `trigger` and `input` have no slot in that
8
- * operation's three-field shape.
9
+ * operation's three-field shape. `cancel` is addressed by the RUN id `run`
10
+ * hands back, not by the workflow id every other command here takes.
11
+ * `get`, `create`, `update`, `archive` and `delete` are the definition
12
+ * lifecycle.
13
+ *
14
+ * **A definition arrives as `--definition <json>`, not `--file <path>`.** This
15
+ * lane reads no files: `--payload`, `--input` and `--content` are all
16
+ * command-line strings already, the CLI runs with no `--allow-read`, and
17
+ * `--definition "$(cat wf.json)"` is one shell idiom rather than a new
18
+ * permission and a new class of error (missing file, unreadable file, file that
19
+ * is not JSON) for every command that writes.
20
+ *
21
+ * **`create` and `update` are one route.** The server has a single upsert; what
22
+ * separates the two commands is that `create` mints the required id and
23
+ * `update` pins the one you addressed. Consequently `update` is a FULL
24
+ * REPLACEMENT — `w6w workflows get <id> --json` is where the definition to edit
25
+ * comes from.
9
26
  *
10
27
  * @module
11
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAkC,eAAe,EAAE,MAAM,cAAc,CAAC;AA8FpF,eAAO,MAAM,iBAAiB,EAAE,eAG/B,CAAC"}
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAkC,eAAe,EAAE,MAAM,cAAc,CAAC;AA2NpF,eAAO,MAAM,iBAAiB,EAAE,eAS/B,CAAC"}