monday-cli 0.3.0 → 0.5.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/CHANGELOG.md +719 -0
- package/README.md +208 -36
- package/dist/api/assets.d.ts +326 -0
- package/dist/api/assets.d.ts.map +1 -0
- package/dist/api/assets.js +519 -0
- package/dist/api/assets.js.map +1 -0
- package/dist/api/column-types.d.ts +13 -7
- package/dist/api/column-types.d.ts.map +1 -1
- package/dist/api/column-types.js +7 -3
- package/dist/api/column-types.js.map +1 -1
- package/dist/api/column-values.d.ts +8 -1
- package/dist/api/column-values.d.ts.map +1 -1
- package/dist/api/column-values.js +16 -6
- package/dist/api/column-values.js.map +1 -1
- package/dist/api/documents.d.ts +1652 -0
- package/dist/api/documents.d.ts.map +1 -0
- package/dist/api/documents.js +2411 -0
- package/dist/api/documents.js.map +1 -0
- package/dist/api/item-watch.d.ts +263 -0
- package/dist/api/item-watch.d.ts.map +1 -0
- package/dist/api/item-watch.js +709 -0
- package/dist/api/item-watch.js.map +1 -0
- package/dist/api/multipart-transport.d.ts +223 -0
- package/dist/api/multipart-transport.d.ts.map +1 -0
- package/dist/api/multipart-transport.js +274 -0
- package/dist/api/multipart-transport.js.map +1 -0
- package/dist/api/parallel-dispatch.d.ts +155 -0
- package/dist/api/parallel-dispatch.d.ts.map +1 -0
- package/dist/api/parallel-dispatch.js +243 -0
- package/dist/api/parallel-dispatch.js.map +1 -0
- package/dist/api/partial-success-bulk.d.ts +118 -60
- package/dist/api/partial-success-bulk.d.ts.map +1 -1
- package/dist/api/partial-success-bulk.js +137 -79
- package/dist/api/partial-success-bulk.js.map +1 -1
- package/dist/api/partial-success-mutation.d.ts +13 -1
- package/dist/api/partial-success-mutation.d.ts.map +1 -1
- package/dist/api/partial-success-mutation.js +5 -1
- package/dist/api/partial-success-mutation.js.map +1 -1
- package/dist/api/raw-write.d.ts +13 -4
- package/dist/api/raw-write.d.ts.map +1 -1
- package/dist/api/raw-write.js +22 -11
- package/dist/api/raw-write.js.map +1 -1
- package/dist/api/resolve-client.d.ts +11 -0
- package/dist/api/resolve-client.d.ts.map +1 -1
- package/dist/api/resolve-client.js +9 -1
- package/dist/api/resolve-client.js.map +1 -1
- package/dist/api/teams.d.ts +657 -0
- package/dist/api/teams.d.ts.map +1 -0
- package/dist/api/teams.js +880 -0
- package/dist/api/teams.js.map +1 -0
- package/dist/cli/run.d.ts +20 -0
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +1 -0
- package/dist/cli/run.js.map +1 -1
- package/dist/commands/board/column-create.d.ts +6 -5
- package/dist/commands/board/column-create.d.ts.map +1 -1
- package/dist/commands/board/column-create.js +9 -6
- package/dist/commands/board/column-create.js.map +1 -1
- package/dist/commands/completion.d.ts +188 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +418 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/doc/append-markdown.d.ts +117 -0
- package/dist/commands/doc/append-markdown.d.ts.map +1 -0
- package/dist/commands/doc/append-markdown.js +253 -0
- package/dist/commands/doc/append-markdown.js.map +1 -0
- package/dist/commands/doc/block-create.d.ts +114 -0
- package/dist/commands/doc/block-create.d.ts.map +1 -0
- package/dist/commands/doc/block-create.js +206 -0
- package/dist/commands/doc/block-create.js.map +1 -0
- package/dist/commands/doc/block-delete.d.ts +72 -0
- package/dist/commands/doc/block-delete.d.ts.map +1 -0
- package/dist/commands/doc/block-delete.js +161 -0
- package/dist/commands/doc/block-delete.js.map +1 -0
- package/dist/commands/doc/block-update.d.ts +75 -0
- package/dist/commands/doc/block-update.d.ts.map +1 -0
- package/dist/commands/doc/block-update.js +162 -0
- package/dist/commands/doc/block-update.js.map +1 -0
- package/dist/commands/doc/create-in-workspace.d.ts +76 -0
- package/dist/commands/doc/create-in-workspace.d.ts.map +1 -0
- package/dist/commands/doc/create-in-workspace.js +164 -0
- package/dist/commands/doc/create-in-workspace.js.map +1 -0
- package/dist/commands/doc/create-on-column.d.ts +71 -0
- package/dist/commands/doc/create-on-column.d.ts.map +1 -0
- package/dist/commands/doc/create-on-column.js +146 -0
- package/dist/commands/doc/create-on-column.js.map +1 -0
- package/dist/commands/doc/delete.d.ts +68 -0
- package/dist/commands/doc/delete.d.ts.map +1 -0
- package/dist/commands/doc/delete.js +146 -0
- package/dist/commands/doc/delete.js.map +1 -0
- package/dist/commands/doc/duplicate.d.ts +101 -0
- package/dist/commands/doc/duplicate.d.ts.map +1 -0
- package/dist/commands/doc/duplicate.js +191 -0
- package/dist/commands/doc/duplicate.js.map +1 -0
- package/dist/commands/doc/get.d.ts +46 -0
- package/dist/commands/doc/get.d.ts.map +1 -0
- package/dist/commands/doc/get.js +95 -0
- package/dist/commands/doc/get.js.map +1 -0
- package/dist/commands/doc/import-html.d.ts +125 -0
- package/dist/commands/doc/import-html.d.ts.map +1 -0
- package/dist/commands/doc/import-html.js +273 -0
- package/dist/commands/doc/import-html.js.map +1 -0
- package/dist/commands/doc/list.d.ts +86 -0
- package/dist/commands/doc/list.d.ts.map +1 -0
- package/dist/commands/doc/list.js +217 -0
- package/dist/commands/doc/list.js.map +1 -0
- package/dist/commands/doc/rename.d.ts +60 -0
- package/dist/commands/doc/rename.d.ts.map +1 -0
- package/dist/commands/doc/rename.js +135 -0
- package/dist/commands/doc/rename.js.map +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +162 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/item/create.js +2 -2
- package/dist/commands/item/update.d.ts +1 -0
- package/dist/commands/item/update.d.ts.map +1 -1
- package/dist/commands/item/update.js +61 -0
- package/dist/commands/item/update.js.map +1 -1
- package/dist/commands/item/upload.d.ts +108 -0
- package/dist/commands/item/upload.d.ts.map +1 -0
- package/dist/commands/item/upload.js +370 -0
- package/dist/commands/item/upload.js.map +1 -0
- package/dist/commands/item/watch.d.ts +90 -0
- package/dist/commands/item/watch.d.ts.map +1 -0
- package/dist/commands/item/watch.js +342 -0
- package/dist/commands/item/watch.js.map +1 -0
- package/dist/commands/update/create.d.ts.map +1 -1
- package/dist/commands/update/create.js +6 -4
- package/dist/commands/update/create.js.map +1 -1
- package/dist/commands/update/edit.d.ts +4 -2
- package/dist/commands/update/edit.d.ts.map +1 -1
- package/dist/commands/update/edit.js +10 -6
- package/dist/commands/update/edit.js.map +1 -1
- package/dist/commands/update/reply.d.ts +4 -2
- package/dist/commands/update/reply.d.ts.map +1 -1
- package/dist/commands/update/reply.js +10 -6
- package/dist/commands/update/reply.js.map +1 -1
- package/dist/commands/update/upload.d.ts +69 -0
- package/dist/commands/update/upload.d.ts.map +1 -0
- package/dist/commands/update/upload.js +235 -0
- package/dist/commands/update/upload.js.map +1 -0
- package/dist/commands/user/_team-membership.d.ts +10 -0
- package/dist/commands/user/_team-membership.d.ts.map +1 -0
- package/dist/commands/user/_team-membership.js +88 -0
- package/dist/commands/user/_team-membership.js.map +1 -0
- package/dist/commands/user/team-add-members.d.ts +81 -0
- package/dist/commands/user/team-add-members.d.ts.map +1 -0
- package/dist/commands/user/team-add-members.js +186 -0
- package/dist/commands/user/team-add-members.js.map +1 -0
- package/dist/commands/user/team-create.d.ts +82 -0
- package/dist/commands/user/team-create.d.ts.map +1 -0
- package/dist/commands/user/team-create.js +206 -0
- package/dist/commands/user/team-create.js.map +1 -0
- package/dist/commands/user/team-delete.d.ts +56 -0
- package/dist/commands/user/team-delete.d.ts.map +1 -0
- package/dist/commands/user/team-delete.js +137 -0
- package/dist/commands/user/team-delete.js.map +1 -0
- package/dist/commands/user/team-get.d.ts +41 -0
- package/dist/commands/user/team-get.d.ts.map +1 -0
- package/dist/commands/user/team-get.js +87 -0
- package/dist/commands/user/team-get.js.map +1 -0
- package/dist/commands/user/team-list.d.ts +39 -0
- package/dist/commands/user/team-list.d.ts.map +1 -0
- package/dist/commands/user/team-list.js +90 -0
- package/dist/commands/user/team-list.js.map +1 -0
- package/dist/commands/user/team-remove-members.d.ts +71 -0
- package/dist/commands/user/team-remove-members.d.ts.map +1 -0
- package/dist/commands/user/team-remove-members.js +176 -0
- package/dist/commands/user/team-remove-members.js.map +1 -0
- package/dist/types/ids.d.ts +8 -0
- package/dist/types/ids.d.ts.map +1 -1
- package/dist/types/ids.js +53 -5
- package/dist/types/ids.js.map +1 -1
- package/dist/utils/mime.d.ts +24 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +64 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/output/envelope.d.ts +30 -0
- package/dist/utils/output/envelope.d.ts.map +1 -1
- package/dist/utils/output/envelope.js +26 -0
- package/dist/utils/output/envelope.js.map +1 -1
- package/dist/utils/output/ndjson.d.ts +25 -0
- package/dist/utils/output/ndjson.d.ts.map +1 -1
- package/dist/utils/output/ndjson.js +12 -0
- package/dist/utils/output/ndjson.js.map +1 -1
- package/dist/utils/parse-brand-list.d.ts +95 -0
- package/dist/utils/parse-brand-list.d.ts.map +1 -0
- package/dist/utils/parse-brand-list.js +96 -0
- package/dist/utils/parse-brand-list.js.map +1 -0
- package/dist/utils/signal.d.ts +42 -0
- package/dist/utils/signal.d.ts.map +1 -0
- package/dist/utils/signal.js +45 -0
- package/dist/utils/signal.js.map +1 -0
- package/dist/utils/source-content.d.ts +93 -0
- package/dist/utils/source-content.d.ts.map +1 -0
- package/dist/utils/source-content.js +120 -0
- package/dist/utils/source-content.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday item watch <iid>` — polling-based event stream over the
|
|
3
|
+
* v0.3-M24 `item-history-projection.ts` projector. Runtime body
|
|
4
|
+
* shipped at v0.4-M29 IMPL (`7b83a3a` + round-1 fix-ups). Pinned
|
|
5
|
+
* per cli-design §13 v0.4 entry + §14.4 closure (`31713fb`) +
|
|
6
|
+
* v0.4-plan §3 M29.
|
|
7
|
+
*
|
|
8
|
+
* **What this verb answers:** "wait for changes on this item + emit
|
|
9
|
+
* them as they arrive". Single CLI invocation polls Monday's
|
|
10
|
+
* `boards(ids:){ activity_logs(item_ids:, from:, limit:) }` surface
|
|
11
|
+
* each tick, projects new rows through the M24 projector, emits one
|
|
12
|
+
* NDJSON record per new event plus a session-summary trailer on exit.
|
|
13
|
+
*
|
|
14
|
+
* **GraphQL operation:** `ItemWatchPoll` (one per poll tick;
|
|
15
|
+
* R-NEW-37 W2 audit-point — operationName pinned in
|
|
16
|
+
* `WATCH_POLL_QUERY` literal at `src/api/item-watch.ts`).
|
|
17
|
+
*
|
|
18
|
+
* **Action shape (M29 IMPL).** Item-board lookup via
|
|
19
|
+
* `lookupItemBoard` → `watchItem` polling loop with NDJSON
|
|
20
|
+
* `onEvent` streaming hook + per-event projection via M24's
|
|
21
|
+
* `projectActivityLogRow` → trailer-meta emit on graceful exit.
|
|
22
|
+
* SIGINT graceful drain via `ctx.signal` (the same AbortSignal seam
|
|
23
|
+
* M22 status uses). The polling loop owns:
|
|
24
|
+
*
|
|
25
|
+
* - Cadence (default 30s; range 1s–1h; `--interval <ms>`).
|
|
26
|
+
* - Watermark advance (last-seen-event-id; `--since <event-id>`
|
|
27
|
+
* bootstraps).
|
|
28
|
+
* - Circuit breaker (reactive on Monday wire errors; trip after 5
|
|
29
|
+
* consecutive failures; per-failure warnings accumulate on
|
|
30
|
+
* `WatchItemResult.warnings` and fold into the trailer's
|
|
31
|
+
* `_meta.warnings` slot at session end per cli-design §6.3 —
|
|
32
|
+
* NOT interleaved with event lines).
|
|
33
|
+
* - Limit enforcement (`--max-events <n>` / `--max-duration
|
|
34
|
+
* <seconds>`).
|
|
35
|
+
* - `--once` short-circuit (drain backlog and exit; do NOT poll).
|
|
36
|
+
*
|
|
37
|
+
* **Output:** NDJSON only at v0.4-M29 — `--json` / `--table` /
|
|
38
|
+
* `--output` global flags ignored (this is a streaming verb).
|
|
39
|
+
* Trailer-meta carries seven M29-specific slots:
|
|
40
|
+
* `events_emitted` + `polls_made` + `failed_polls` +
|
|
41
|
+
* `watch_duration_seconds` + `last_seen_event_id` +
|
|
42
|
+
* `circuit_broken_at` + `exit_reason`. Plus the standard §6.3
|
|
43
|
+
* `_meta.warnings[]` slot collects any `WatchSessionWarning`
|
|
44
|
+
* records the polling loop accumulated (poll_failed,
|
|
45
|
+
* circuit_breaker_armed, unknown_event_kind) — warnings are NOT
|
|
46
|
+
* interleaved with event lines.
|
|
47
|
+
*
|
|
48
|
+
* Idempotent: yes (pure read; re-running with the same `--since` is
|
|
49
|
+
* safe).
|
|
50
|
+
*/
|
|
51
|
+
import { z } from 'zod';
|
|
52
|
+
import { type CommandModule } from '../types.js';
|
|
53
|
+
import { type HistoryEvent } from '../../api/item-history-projection.js';
|
|
54
|
+
/**
|
|
55
|
+
* Argv input schema for `monday item watch <iid>`. Validates at the
|
|
56
|
+
* parse boundary; the action body consumes the validated shape
|
|
57
|
+
* directly (no defensive re-checks).
|
|
58
|
+
*
|
|
59
|
+
* Mutual-exclusion rules (superRefine):
|
|
60
|
+
*
|
|
61
|
+
* - `--once` is incompatible with `--max-events` / `--max-duration`.
|
|
62
|
+
* `--once` already pins the exit (drain then return); a max-event
|
|
63
|
+
* ceiling would be redundant and a max-duration ceiling could
|
|
64
|
+
* race the backlog drain.
|
|
65
|
+
* - `--interval <ms>` requires the bare-integer ms form; the closure
|
|
66
|
+
* pins ms semantics (not bare seconds) to disambiguate 30 vs
|
|
67
|
+
* 30000 unambiguously. Range 1000–3600000 (1s–1h).
|
|
68
|
+
*/
|
|
69
|
+
declare const inputSchema: z.ZodObject<{
|
|
70
|
+
iid: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
|
|
71
|
+
interval: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
72
|
+
since: z.ZodOptional<z.ZodString>;
|
|
73
|
+
once: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
maxEvents: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
75
|
+
maxDuration: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
76
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodEnum<{
|
|
77
|
+
unknown: "unknown";
|
|
78
|
+
update_column_value: "update_column_value";
|
|
79
|
+
create_column: "create_column";
|
|
80
|
+
create_group: "create_group";
|
|
81
|
+
update_board_name: "update_board_name";
|
|
82
|
+
update_board_nickname: "update_board_nickname";
|
|
83
|
+
board_workspace_id_changed: "board_workspace_id_changed";
|
|
84
|
+
update_posted: "update_posted";
|
|
85
|
+
update_replied: "update_replied";
|
|
86
|
+
}>>>>;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
export declare const itemWatchCommand: CommandModule<z.infer<typeof inputSchema>, HistoryEvent>;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../src/commands/item/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAsBnE,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,sCAAsC,CAAC;AAkD9C;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;kBAsEb,CAAC;AAEL,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAC1C,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,YAAY,CA8Lb,CAAC"}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday item watch <iid>` — polling-based event stream over the
|
|
3
|
+
* v0.3-M24 `item-history-projection.ts` projector. Runtime body
|
|
4
|
+
* shipped at v0.4-M29 IMPL (`7b83a3a` + round-1 fix-ups). Pinned
|
|
5
|
+
* per cli-design §13 v0.4 entry + §14.4 closure (`31713fb`) +
|
|
6
|
+
* v0.4-plan §3 M29.
|
|
7
|
+
*
|
|
8
|
+
* **What this verb answers:** "wait for changes on this item + emit
|
|
9
|
+
* them as they arrive". Single CLI invocation polls Monday's
|
|
10
|
+
* `boards(ids:){ activity_logs(item_ids:, from:, limit:) }` surface
|
|
11
|
+
* each tick, projects new rows through the M24 projector, emits one
|
|
12
|
+
* NDJSON record per new event plus a session-summary trailer on exit.
|
|
13
|
+
*
|
|
14
|
+
* **GraphQL operation:** `ItemWatchPoll` (one per poll tick;
|
|
15
|
+
* R-NEW-37 W2 audit-point — operationName pinned in
|
|
16
|
+
* `WATCH_POLL_QUERY` literal at `src/api/item-watch.ts`).
|
|
17
|
+
*
|
|
18
|
+
* **Action shape (M29 IMPL).** Item-board lookup via
|
|
19
|
+
* `lookupItemBoard` → `watchItem` polling loop with NDJSON
|
|
20
|
+
* `onEvent` streaming hook + per-event projection via M24's
|
|
21
|
+
* `projectActivityLogRow` → trailer-meta emit on graceful exit.
|
|
22
|
+
* SIGINT graceful drain via `ctx.signal` (the same AbortSignal seam
|
|
23
|
+
* M22 status uses). The polling loop owns:
|
|
24
|
+
*
|
|
25
|
+
* - Cadence (default 30s; range 1s–1h; `--interval <ms>`).
|
|
26
|
+
* - Watermark advance (last-seen-event-id; `--since <event-id>`
|
|
27
|
+
* bootstraps).
|
|
28
|
+
* - Circuit breaker (reactive on Monday wire errors; trip after 5
|
|
29
|
+
* consecutive failures; per-failure warnings accumulate on
|
|
30
|
+
* `WatchItemResult.warnings` and fold into the trailer's
|
|
31
|
+
* `_meta.warnings` slot at session end per cli-design §6.3 —
|
|
32
|
+
* NOT interleaved with event lines).
|
|
33
|
+
* - Limit enforcement (`--max-events <n>` / `--max-duration
|
|
34
|
+
* <seconds>`).
|
|
35
|
+
* - `--once` short-circuit (drain backlog and exit; do NOT poll).
|
|
36
|
+
*
|
|
37
|
+
* **Output:** NDJSON only at v0.4-M29 — `--json` / `--table` /
|
|
38
|
+
* `--output` global flags ignored (this is a streaming verb).
|
|
39
|
+
* Trailer-meta carries seven M29-specific slots:
|
|
40
|
+
* `events_emitted` + `polls_made` + `failed_polls` +
|
|
41
|
+
* `watch_duration_seconds` + `last_seen_event_id` +
|
|
42
|
+
* `circuit_broken_at` + `exit_reason`. Plus the standard §6.3
|
|
43
|
+
* `_meta.warnings[]` slot collects any `WatchSessionWarning`
|
|
44
|
+
* records the polling loop accumulated (poll_failed,
|
|
45
|
+
* circuit_breaker_armed, unknown_event_kind) — warnings are NOT
|
|
46
|
+
* interleaved with event lines.
|
|
47
|
+
*
|
|
48
|
+
* Idempotent: yes (pure read; re-running with the same `--since` is
|
|
49
|
+
* safe).
|
|
50
|
+
*/
|
|
51
|
+
import { z } from 'zod';
|
|
52
|
+
import { ensureSubcommand } from '../types.js';
|
|
53
|
+
import { parseArgv } from '../parse-argv.js';
|
|
54
|
+
import { resolveClient } from '../../api/resolve-client.js';
|
|
55
|
+
import { lookupItemBoard } from '../../api/item-board-lookup.js';
|
|
56
|
+
import { SourceAggregator } from '../../api/source-aggregator.js';
|
|
57
|
+
import { buildStreamingTrailerMeta, startNdjsonStream, } from '../../utils/output/ndjson.js';
|
|
58
|
+
import { collectSecrets } from '../../cli/envelope-out.js';
|
|
59
|
+
import { ApiError } from '../../utils/errors.js';
|
|
60
|
+
import { ItemIdSchema } from '../../types/ids.js';
|
|
61
|
+
import { CIRCUIT_BREAKER_CONSECUTIVE_FAILS, DEFAULT_WATCH_INTERVAL_MS, MAX_WATCH_INTERVAL_MS, MIN_WATCH_INTERVAL_MS, watchItem, } from '../../api/item-watch.js';
|
|
62
|
+
import { historyEventSchema, } from '../../api/item-history-projection.js';
|
|
63
|
+
/**
|
|
64
|
+
* The `--include` flag accepts a comma-separated list of literal kind
|
|
65
|
+
* values from the M24 closed event-kind taxonomy (9 kinds). Mirrors
|
|
66
|
+
* `item history`'s `--kinds` enum verbatim — forward-compat at the
|
|
67
|
+
* argv boundary even though v0.4-M29 only emits activity-log-sourced
|
|
68
|
+
* kinds (the projector's `update_posted` / `update_replied` variants
|
|
69
|
+
* are from the updates source, which v0.4-M29 doesn't poll; agents
|
|
70
|
+
* passing those kinds get no events at v0.4 but the argv accepts them
|
|
71
|
+
* for v0.5+ comment-polling compatibility).
|
|
72
|
+
*/
|
|
73
|
+
const WATCH_KIND_LITERALS = [
|
|
74
|
+
'update_column_value',
|
|
75
|
+
'create_column',
|
|
76
|
+
'create_group',
|
|
77
|
+
'update_board_name',
|
|
78
|
+
'update_board_nickname',
|
|
79
|
+
'board_workspace_id_changed',
|
|
80
|
+
'update_posted',
|
|
81
|
+
'update_replied',
|
|
82
|
+
'unknown',
|
|
83
|
+
];
|
|
84
|
+
const watchKindSchema = z.enum(WATCH_KIND_LITERALS);
|
|
85
|
+
/**
|
|
86
|
+
* Parses `--include <list>` (comma-separated; commander hands it over
|
|
87
|
+
* as a raw string). Empty entries filtered before validation so
|
|
88
|
+
* `--include update_column_value,` doesn't raise `usage_error`. Empty
|
|
89
|
+
* arrays after the filter raise `usage_error` rather than silently
|
|
90
|
+
* meaning "include everything" — an agent passing `--include ,,` is
|
|
91
|
+
* almost certainly bug, not intent.
|
|
92
|
+
*/
|
|
93
|
+
const includeListSchema = z
|
|
94
|
+
.string()
|
|
95
|
+
.transform((raw) => raw.split(',').map((s) => s.trim()).filter((s) => s.length > 0))
|
|
96
|
+
.pipe(z.array(watchKindSchema).min(1));
|
|
97
|
+
/**
|
|
98
|
+
* Event-ID validator for `--since <event-id>`. Numeric string per
|
|
99
|
+
* Monday's `ActivityLogType.id` shape (NON_NULL String at the wire
|
|
100
|
+
* level but always digits in practice per the M24 probe). Open shape
|
|
101
|
+
* (no length cap) — Monday's event IDs are typically 13+ digits.
|
|
102
|
+
*/
|
|
103
|
+
const eventIdSchema = z
|
|
104
|
+
.string()
|
|
105
|
+
.min(1)
|
|
106
|
+
.regex(/^\d+$/u, { message: 'must be a numeric event ID (digits only)' });
|
|
107
|
+
/**
|
|
108
|
+
* Argv input schema for `monday item watch <iid>`. Validates at the
|
|
109
|
+
* parse boundary; the action body consumes the validated shape
|
|
110
|
+
* directly (no defensive re-checks).
|
|
111
|
+
*
|
|
112
|
+
* Mutual-exclusion rules (superRefine):
|
|
113
|
+
*
|
|
114
|
+
* - `--once` is incompatible with `--max-events` / `--max-duration`.
|
|
115
|
+
* `--once` already pins the exit (drain then return); a max-event
|
|
116
|
+
* ceiling would be redundant and a max-duration ceiling could
|
|
117
|
+
* race the backlog drain.
|
|
118
|
+
* - `--interval <ms>` requires the bare-integer ms form; the closure
|
|
119
|
+
* pins ms semantics (not bare seconds) to disambiguate 30 vs
|
|
120
|
+
* 30000 unambiguously. Range 1000–3600000 (1s–1h).
|
|
121
|
+
*/
|
|
122
|
+
const inputSchema = z
|
|
123
|
+
.object({
|
|
124
|
+
iid: ItemIdSchema,
|
|
125
|
+
/**
|
|
126
|
+
* Polling cadence in milliseconds. Default
|
|
127
|
+
* {@link DEFAULT_WATCH_INTERVAL_MS} (30000ms / 30s) per cli-design
|
|
128
|
+
* §14.4 closure. Range {@link MIN_WATCH_INTERVAL_MS} (1000ms /
|
|
129
|
+
* 1s; faster trips Monday's request-rate concerns + the
|
|
130
|
+
* propagation-lag floor) to {@link MAX_WATCH_INTERVAL_MS}
|
|
131
|
+
* (3600000ms / 1h; slower crosses the "no longer a watch" line —
|
|
132
|
+
* use `cron + monday item history` for hourly cadences).
|
|
133
|
+
*/
|
|
134
|
+
interval: z.coerce
|
|
135
|
+
.number()
|
|
136
|
+
.int()
|
|
137
|
+
.min(MIN_WATCH_INTERVAL_MS)
|
|
138
|
+
.max(MAX_WATCH_INTERVAL_MS)
|
|
139
|
+
.optional(),
|
|
140
|
+
/**
|
|
141
|
+
* Last-seen-event-id watermark for session restart. One-shot
|
|
142
|
+
* bootstrap — the runtime looks up the event's `created_at`
|
|
143
|
+
* once, sets the initial poll-from timestamp, emits any backlog
|
|
144
|
+
* past the watermark, then enters the polling loop. Distinct
|
|
145
|
+
* from a full `--resume <token>` mechanism (still open per
|
|
146
|
+
* cli-design §14.6).
|
|
147
|
+
*/
|
|
148
|
+
since: eventIdSchema.optional(),
|
|
149
|
+
/**
|
|
150
|
+
* Drain backlog from `--since` (or recent N if no `--since`) and
|
|
151
|
+
* exit without polling. Distinct from `--max-events 1` which
|
|
152
|
+
* waits for the NEXT event.
|
|
153
|
+
*/
|
|
154
|
+
once: z.boolean().optional(),
|
|
155
|
+
/**
|
|
156
|
+
* Cap on emitted events. Session exits with
|
|
157
|
+
* `exit_reason: 'max_events'` once the count is reached
|
|
158
|
+
* (success envelope).
|
|
159
|
+
*/
|
|
160
|
+
maxEvents: z.coerce.number().int().positive().optional(),
|
|
161
|
+
/**
|
|
162
|
+
* Wall-clock ceiling in seconds. Session exits with
|
|
163
|
+
* `exit_reason: 'max_duration'` once the duration is reached
|
|
164
|
+
* (current in-flight poll completes first).
|
|
165
|
+
*/
|
|
166
|
+
maxDuration: z.coerce.number().int().positive().optional(),
|
|
167
|
+
/**
|
|
168
|
+
* Comma-separated list of event kinds to retain. Filter applied
|
|
169
|
+
* at projection time (Monday doesn't expose a server-side filter
|
|
170
|
+
* on `activity_logs.event`). Accepts all 9 M24 kinds for
|
|
171
|
+
* forward-compat; v0.4-M29 only emits activity-log-sourced
|
|
172
|
+
* kinds.
|
|
173
|
+
*/
|
|
174
|
+
include: includeListSchema.optional(),
|
|
175
|
+
})
|
|
176
|
+
.strict()
|
|
177
|
+
.superRefine((value, ctx) => {
|
|
178
|
+
if (value.once === true && value.maxEvents !== undefined) {
|
|
179
|
+
ctx.addIssue({
|
|
180
|
+
code: 'custom',
|
|
181
|
+
message: '--once is incompatible with --max-events (pick one)',
|
|
182
|
+
path: ['once'],
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
if (value.once === true && value.maxDuration !== undefined) {
|
|
186
|
+
ctx.addIssue({
|
|
187
|
+
code: 'custom',
|
|
188
|
+
message: '--once is incompatible with --max-duration (pick one)',
|
|
189
|
+
path: ['once'],
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
export const itemWatchCommand = {
|
|
194
|
+
name: 'item.watch',
|
|
195
|
+
summary: 'Poll Monday for activity-log events on an item; stream NDJSON as they arrive',
|
|
196
|
+
examples: [
|
|
197
|
+
'monday item watch 1234567890',
|
|
198
|
+
'monday item watch 1234567890 --interval 60000 # 60s cadence',
|
|
199
|
+
'monday item watch 1234567890 --since 999999 # resume from event-id',
|
|
200
|
+
'monday item watch 1234567890 --once # drain backlog + exit',
|
|
201
|
+
'monday item watch 1234567890 --max-events 10',
|
|
202
|
+
'monday item watch 1234567890 --max-duration 3600 # 1h ceiling',
|
|
203
|
+
'monday item watch 1234567890 --include update_column_value,update_posted',
|
|
204
|
+
],
|
|
205
|
+
idempotent: true,
|
|
206
|
+
inputSchema,
|
|
207
|
+
// Mirrors M24 `item history`: the output schema describes the
|
|
208
|
+
// per-event record shape an agent sees on the NDJSON stream — NOT
|
|
209
|
+
// the session-summary trailer (the trailer-meta shape is documented
|
|
210
|
+
// in output-shapes.md + cli-design §4.3, but a streaming verb has no
|
|
211
|
+
// buffered `data` payload). `monday schema item.watch` reflects
|
|
212
|
+
// the event-record shape so agents pin their per-line parsers
|
|
213
|
+
// against the same discriminated-union taxonomy `item history`
|
|
214
|
+
// uses.
|
|
215
|
+
outputSchema: historyEventSchema,
|
|
216
|
+
attach: (program, ctx) => {
|
|
217
|
+
const noun = ensureSubcommand(program, 'item', 'Item commands');
|
|
218
|
+
noun
|
|
219
|
+
.command('watch <iid>')
|
|
220
|
+
.description(itemWatchCommand.summary)
|
|
221
|
+
.option('--interval <ms>', `polling cadence in milliseconds (${String(MIN_WATCH_INTERVAL_MS)}–${String(MAX_WATCH_INTERVAL_MS)}, default ${String(DEFAULT_WATCH_INTERVAL_MS)})`)
|
|
222
|
+
.option('--since <event-id>', 'resume from a previous session\'s last-seen-event-id (numeric ID from trailer-meta)')
|
|
223
|
+
.option('--once', 'drain backlog from --since (or recent events) and exit without polling')
|
|
224
|
+
.option('--max-events <n>', 'exit cleanly after emitting N events')
|
|
225
|
+
.option('--max-duration <seconds>', 'exit cleanly after N wall-clock seconds')
|
|
226
|
+
.option('--include <list>', 'comma-separated event kinds to retain (e.g. update_column_value,update_posted)')
|
|
227
|
+
.addHelpText('after', [
|
|
228
|
+
'',
|
|
229
|
+
'Examples:',
|
|
230
|
+
...itemWatchCommand.examples.map((e) => ` ${e}`),
|
|
231
|
+
'',
|
|
232
|
+
`NOTE: emits NDJSON only (one event per line + trailing meta).`,
|
|
233
|
+
`Default cadence ${String(DEFAULT_WATCH_INTERVAL_MS)}ms (${String(DEFAULT_WATCH_INTERVAL_MS / 1000)}s); circuit-breaker trips after`,
|
|
234
|
+
`${String(CIRCUIT_BREAKER_CONSECUTIVE_FAILS)} consecutive failed polls. Resume across sessions via`,
|
|
235
|
+
'--since <event-id> from the prior trailer-meta\'s last_seen_event_id.',
|
|
236
|
+
'SIGINT triggers a graceful drain + trailer emit + exit 130.',
|
|
237
|
+
'',
|
|
238
|
+
'Monday\'s activity_logs has an empirically-measured propagation lag',
|
|
239
|
+
'>30s on freshly-edited boards (M24 pre-flight finding 2026-05-11);',
|
|
240
|
+
'cadence faster than 30s would generate polls against unpropagated data.',
|
|
241
|
+
'',
|
|
242
|
+
].join('\n'))
|
|
243
|
+
.action(async (iid, rawOpts) => {
|
|
244
|
+
const merged = { ...rawOpts, iid };
|
|
245
|
+
const parsed = parseArgv(itemWatchCommand.inputSchema, merged);
|
|
246
|
+
const { client, apiVersion } = resolveClient(ctx, program.opts());
|
|
247
|
+
// Item-board lookup short-circuits a missing-item watch with
|
|
248
|
+
// `not_found` before the polling loop spins up. The lookup is
|
|
249
|
+
// a single wire call; SourceAggregator records it as `'live'`
|
|
250
|
+
// so the trailer's `meta.source` stays correct if a future
|
|
251
|
+
// cache layer lifts in here.
|
|
252
|
+
const { boardId } = await lookupItemBoard({
|
|
253
|
+
client,
|
|
254
|
+
itemId: parsed.iid,
|
|
255
|
+
});
|
|
256
|
+
const aggregator = new SourceAggregator();
|
|
257
|
+
aggregator.record('live', null);
|
|
258
|
+
const stream = startNdjsonStream({
|
|
259
|
+
stream: ctx.stdout,
|
|
260
|
+
secrets: collectSecrets(ctx.env, ctx.runtimeSecrets),
|
|
261
|
+
project: (event) => event,
|
|
262
|
+
});
|
|
263
|
+
const result = await watchItem({
|
|
264
|
+
client,
|
|
265
|
+
itemId: parsed.iid,
|
|
266
|
+
boardId,
|
|
267
|
+
intervalMs: parsed.interval ?? DEFAULT_WATCH_INTERVAL_MS,
|
|
268
|
+
...(parsed.since === undefined ? {} : { since: parsed.since }),
|
|
269
|
+
...(parsed.once === undefined ? {} : { once: parsed.once }),
|
|
270
|
+
...(parsed.maxEvents === undefined ? {} : { maxEvents: parsed.maxEvents }),
|
|
271
|
+
...(parsed.maxDuration === undefined ? {} : { maxDurationSeconds: parsed.maxDuration }),
|
|
272
|
+
...(parsed.include === undefined ? {} : { includeKinds: parsed.include }),
|
|
273
|
+
signal: ctx.signal,
|
|
274
|
+
onEvent: stream.onItem,
|
|
275
|
+
});
|
|
276
|
+
aggregator.record(result.source, null);
|
|
277
|
+
const aggregated = aggregator.result('live');
|
|
278
|
+
// `WatchSessionWarning` already structurally satisfies the
|
|
279
|
+
// §6.1 `Warning` shape (code + message + details); the
|
|
280
|
+
// trailer slot accepts the superset directly.
|
|
281
|
+
const trailerWarnings = result.warnings;
|
|
282
|
+
stream.writeTrailer(buildStreamingTrailerMeta({
|
|
283
|
+
ctx: {
|
|
284
|
+
cliVersion: ctx.cliVersion,
|
|
285
|
+
requestId: ctx.requestId,
|
|
286
|
+
clock: ctx.clock,
|
|
287
|
+
},
|
|
288
|
+
apiVersion,
|
|
289
|
+
source: aggregated.source,
|
|
290
|
+
cacheAgeSeconds: aggregated.cacheAgeSeconds,
|
|
291
|
+
result: {
|
|
292
|
+
// `has_more` reflects "the source still has events past
|
|
293
|
+
// this session's exit point" — true for ceiling-driven
|
|
294
|
+
// exits (max_events / max_duration / signal) where the
|
|
295
|
+
// agent might re-invoke with --since; false for
|
|
296
|
+
// once_complete (the backlog was the whole window) and
|
|
297
|
+
// circuit_broken (the session failed, not the source
|
|
298
|
+
// running out).
|
|
299
|
+
hasMore: result.exit_reason === 'max_events' ||
|
|
300
|
+
result.exit_reason === 'max_duration' ||
|
|
301
|
+
result.exit_reason === 'signal',
|
|
302
|
+
totalReturned: result.events_emitted,
|
|
303
|
+
complexity: null,
|
|
304
|
+
},
|
|
305
|
+
session: {
|
|
306
|
+
eventsEmitted: result.events_emitted,
|
|
307
|
+
pollsMade: result.polls_made,
|
|
308
|
+
failedPolls: result.failed_polls,
|
|
309
|
+
watchDurationSeconds: result.watch_duration_seconds,
|
|
310
|
+
lastSeenEventId: result.last_seen_event_id,
|
|
311
|
+
circuitBrokenAt: result.circuit_broken_at,
|
|
312
|
+
exitReason: result.exit_reason,
|
|
313
|
+
},
|
|
314
|
+
warnings: trailerWarnings,
|
|
315
|
+
}));
|
|
316
|
+
// Circuit-broken exit surfaces as a §6.5 failure envelope on
|
|
317
|
+
// stderr AFTER the trailer emitted on stdout. The Monday code
|
|
318
|
+
// that tripped the breaker lives on the last `poll_failed`
|
|
319
|
+
// warning's `details.monday_code` slot (no other source: the
|
|
320
|
+
// ApiError thrown by `client.raw` was caught + converted to a
|
|
321
|
+
// warning inside `watchItem`).
|
|
322
|
+
if (result.exit_reason === 'circuit_broken') {
|
|
323
|
+
const lastPollFailed = [...result.warnings]
|
|
324
|
+
.reverse()
|
|
325
|
+
.find((w) => w.code === 'poll_failed');
|
|
326
|
+
/* c8 ignore next 2 — defensive: circuit_broken always
|
|
327
|
+
trips off a poll_failed accumulation; the find always
|
|
328
|
+
succeeds in production. */
|
|
329
|
+
const mondayCode = lastPollFailed?.details.monday_code ??
|
|
330
|
+
'complexity_exceeded';
|
|
331
|
+
throw new ApiError(mondayCode, `watch session tripped the circuit breaker after ${String(result.failed_polls)} failed polls (${String(CIRCUIT_BREAKER_CONSECUTIVE_FAILS)} consecutive)`, {
|
|
332
|
+
details: {
|
|
333
|
+
failed_polls: result.failed_polls,
|
|
334
|
+
circuit_broken_at: result.circuit_broken_at,
|
|
335
|
+
events_emitted: result.events_emitted,
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
//# sourceMappingURL=watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../../src/commands/item/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EACL,iCAAiC,EACjC,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,SAAS,GAEV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,GAEnB,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,mBAAmB,GAAG;IAC1B,qBAAqB;IACrB,eAAe;I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;;;;;;;;GAyBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AA2BnE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;kBAW1B,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,QAAA,MAAM,WAAW;;;kBAKN,CAAC;AAQZ,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAC7C,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/update/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AA2BnE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;kBAW1B,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,QAAA,MAAM,WAAW;;;kBAKN,CAAC;AAQZ,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAC7C,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,kBAAkB,CAoHnB,CAAC"}
|
|
@@ -32,7 +32,7 @@ import { ItemIdSchema, UpdateIdSchema } from '../../types/ids.js';
|
|
|
32
32
|
import { parseArgv } from '../parse-argv.js';
|
|
33
33
|
import { ApiError } from '../../utils/errors.js';
|
|
34
34
|
import { unwrapOrThrow } from '../../utils/parse-boundary.js';
|
|
35
|
-
import {
|
|
35
|
+
import { readSourceContent } from '../../utils/source-content.js';
|
|
36
36
|
import { UPDATE_FIELDS_FRAGMENT } from '../../api/update-mutation-result.js';
|
|
37
37
|
import { assertResponseFieldPresent } from '../../api/response-root.js';
|
|
38
38
|
const CREATE_UPDATE_MUTATION = `
|
|
@@ -100,10 +100,12 @@ export const updateCreateCommand = {
|
|
|
100
100
|
...opts,
|
|
101
101
|
});
|
|
102
102
|
const { client, globalFlags, apiVersion, toEmit } = resolveClient(ctx, program.opts());
|
|
103
|
-
const body = await
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
const body = await readSourceContent({
|
|
104
|
+
inline: parsed.body,
|
|
105
|
+
file: globalFlags.bodyFile,
|
|
106
106
|
stdin: ctx.stdin,
|
|
107
|
+
inlineFlagName: '--body',
|
|
108
|
+
fileFlagName: '--body-file',
|
|
107
109
|
verbHint: 'monday update create requires either --body <md> or ' +
|
|
108
110
|
'--body-file <path>. Use --body-file - to read from stdin.',
|
|
109
111
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/update/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/update/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAC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CAAC;IACD,OAAO,aAAa,CAClB,wBAAwB,CAAC,SAAS,CAAC,GAAG,CAAC,EACvC;QACE,OAAO,EAAE,uDAAuD,MAAM,EAAE;QACxE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;KAC7B,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* `v0.2-plan.md` §3 M13).
|
|
5
5
|
*
|
|
6
6
|
* Mutates via Monday's `edit_update(id, body)`. Body sources match
|
|
7
|
-
* `update create` / `update reply` — the shared `
|
|
8
|
-
* helper
|
|
7
|
+
* `update create` / `update reply` — the shared `readSourceContent`
|
|
8
|
+
* helper (lifted at v0.5-M37 IMPL kickoff per R-v0.5-NEW-18 from
|
|
9
|
+
* the prior M13-specific `readUpdateBody`) handles --body /
|
|
10
|
+
* --body-file / `--body-file -` for stdin.
|
|
9
11
|
*
|
|
10
12
|
* Idempotent: yes — re-running with the same body is a server-side
|
|
11
13
|
* no-op (Monday's edit_update writes the new body verbatim).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/commands/update/edit.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/commands/update/edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAOnE,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAC;AAW7C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;kBAAyB,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAEhD,QAAA,MAAM,WAAW;;;kBAKN,CAAC;AAQZ,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAC3C,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,gBAAgB,CAuHjB,CAAC"}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* `v0.2-plan.md` §3 M13).
|
|
5
5
|
*
|
|
6
6
|
* Mutates via Monday's `edit_update(id, body)`. Body sources match
|
|
7
|
-
* `update create` / `update reply` — the shared `
|
|
8
|
-
* helper
|
|
7
|
+
* `update create` / `update reply` — the shared `readSourceContent`
|
|
8
|
+
* helper (lifted at v0.5-M37 IMPL kickoff per R-v0.5-NEW-18 from
|
|
9
|
+
* the prior M13-specific `readUpdateBody`) handles --body /
|
|
10
|
+
* --body-file / `--body-file -` for stdin.
|
|
9
11
|
*
|
|
10
12
|
* Idempotent: yes — re-running with the same body is a server-side
|
|
11
13
|
* no-op (Monday's edit_update writes the new body verbatim).
|
|
@@ -17,7 +19,7 @@ import { resolveClient } from '../../api/resolve-client.js';
|
|
|
17
19
|
import { UpdateIdSchema } from '../../types/ids.js';
|
|
18
20
|
import { parseArgv } from '../parse-argv.js';
|
|
19
21
|
import { unwrapOrThrow } from '../../utils/parse-boundary.js';
|
|
20
|
-
import {
|
|
22
|
+
import { readSourceContent } from '../../utils/source-content.js';
|
|
21
23
|
import { projectMutationUpdate, UPDATE_FIELDS_FRAGMENT, updateProjectionSchema, } from '../../api/update-mutation-result.js';
|
|
22
24
|
import { assertResponseFieldPresent } from '../../api/response-root.js';
|
|
23
25
|
const EDIT_UPDATE_MUTATION = `
|
|
@@ -67,10 +69,12 @@ export const updateEditCommand = {
|
|
|
67
69
|
...opts,
|
|
68
70
|
});
|
|
69
71
|
const { client, globalFlags, apiVersion, toEmit } = resolveClient(ctx, program.opts());
|
|
70
|
-
const body = await
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
const body = await readSourceContent({
|
|
73
|
+
inline: parsed.body,
|
|
74
|
+
file: globalFlags.bodyFile,
|
|
73
75
|
stdin: ctx.stdin,
|
|
76
|
+
inlineFlagName: '--body',
|
|
77
|
+
fileFlagName: '--body-file',
|
|
74
78
|
verbHint: 'monday update edit requires either --body <md> or ' +
|
|
75
79
|
'--body-file <path>. Use --body-file - to read from stdin.',
|
|
76
80
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/commands/update/edit.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/commands/update/edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,GAEvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,oBAAoB,GAAG;;;QAGrB,sBAAsB;;;CAG7B,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAI7D,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAA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AAM,CAAC,QAAQ,EAAE;gBACvC,IAAI,EACF,wDAAwD;oBACxD,yDAAyD;oBACzD,iCAAiC;aACpC,CACF,CAAC;YACF,6DAA6D;YAC7D,qDAAqD;YACrD,0BAA0B;YAC1B,MAAM,SAAS,GAAG,qBAAqB,CAAC;gBACtC,GAAG,EAAE,IAAI,CAAC,WAAW;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,YAAY,EAAE,aAAa;aAC5B,CAAC,CAAC;YAEH,YAAY,CAAC;gBACX,GAAG;gBACH,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,iBAAiB,CAAC,YAAY;gBACtC,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE;gBAC3B,QAAQ,EAAE,EAAE;gBACZ,GAAG,MAAM,CAAC,QAAQ,CAAC;gBACnB,MAAM,EAAE,MAAM;gBACd,eAAe,EAAE,IAAI;aACtB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAC"}
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
* the parent update.
|
|
10
10
|
*
|
|
11
11
|
* **Body sources** (mutually exclusive — same shape as `update
|
|
12
|
-
* create`'s plumbing, lifted into `
|
|
13
|
-
*
|
|
12
|
+
* create`'s plumbing, lifted into the universal `readSourceContent`
|
|
13
|
+
* helper at `src/utils/source-content.ts` per R-v0.5-NEW-18 at
|
|
14
|
+
* v0.5-M37 IMPL kickoff; the M13-specific `readUpdateBody` shape
|
|
15
|
+
* lived at `src/commands/update/body-source.ts` until the lift):
|
|
14
16
|
* - `--body <md>` — inline markdown.
|
|
15
17
|
* - `--body-file <path>` — read from disk.
|
|
16
18
|
* - `--body-file -` — read from stdin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../src/commands/update/reply.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../src/commands/update/reply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAsBnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;kBAEzB,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,QAAA,MAAM,WAAW;;;kBAKN,CAAC;AAQZ,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAC5C,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,iBAAiB,CA+HlB,CAAC"}
|