gws-axi 0.2.0 → 0.3.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 +41 -10
- package/dist/src/commands/calendar/create.d.ts +2 -0
- package/dist/src/commands/calendar/create.js +247 -0
- package/dist/src/commands/calendar/create.js.map +1 -0
- package/dist/src/commands/calendar/dateish.d.ts +14 -0
- package/dist/src/commands/calendar/dateish.js +19 -0
- package/dist/src/commands/calendar/dateish.js.map +1 -1
- package/dist/src/commands/calendar/delete.d.ts +2 -0
- package/dist/src/commands/calendar/delete.js +97 -0
- package/dist/src/commands/calendar/delete.js.map +1 -0
- package/dist/src/commands/calendar/get.js +12 -16
- package/dist/src/commands/calendar/get.js.map +1 -1
- package/dist/src/commands/calendar/respond.d.ts +2 -0
- package/dist/src/commands/calendar/respond.js +156 -0
- package/dist/src/commands/calendar/respond.js.map +1 -0
- package/dist/src/commands/calendar/update.d.ts +2 -0
- package/dist/src/commands/calendar/update.js +279 -0
- package/dist/src/commands/calendar/update.js.map +1 -0
- package/dist/src/commands/calendar.js +8 -4
- package/dist/src/commands/calendar.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Agent-ergonomic CLI for Google Workspace — Gmail, Calendar, Docs, Drive, and S
|
|
|
4
4
|
|
|
5
5
|
Designed for use by AI agents. Every response is structured, every error names a specific fix, and write operations lock to the explicit account when multiple are authenticated — so two agents in parallel sessions can't silently touch the wrong mailbox.
|
|
6
6
|
|
|
7
|
-
> **Status
|
|
7
|
+
> **Status (v0.3):** **Calendar is complete** — all 9 subcommands (5 reads + 4 writes) are implemented. Gmail, Docs, Drive, and Slides are scaffolded stubs that exercise auth + account resolution but return `NOT_IMPLEMENTED` on their concrete operations. Auth, doctor (with live per-account API probes), and multi-account management are stable.
|
|
8
8
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
@@ -37,16 +37,46 @@ Typical flow: set project → enable APIs → create OAuth client → download J
|
|
|
37
37
|
|
|
38
38
|
Every subcommand supports `--help`. The bare `gws-axi` command prints current state, authenticated accounts, and top suggestions.
|
|
39
39
|
|
|
40
|
+
### Home / auth / health
|
|
41
|
+
|
|
40
42
|
```bash
|
|
41
|
-
gws-axi # home view
|
|
42
|
-
gws-axi calendar events # list upcoming events
|
|
43
|
-
gws-axi calendar events --query standup # full-text search
|
|
44
|
-
gws-axi calendar events --fields attendees,location
|
|
43
|
+
gws-axi # home view — current state + suggestions
|
|
45
44
|
gws-axi auth accounts # list authenticated Google accounts
|
|
46
|
-
gws-axi auth login --account <email> # add another account
|
|
47
|
-
gws-axi
|
|
45
|
+
gws-axi auth login --account <email> # add another account (prepare + --wait)
|
|
46
|
+
gws-axi auth use <email> # set the default account
|
|
47
|
+
gws-axi doctor # prerequisites + setup + live API probes
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
### Calendar reads
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
gws-axi calendar events # upcoming 7 days on primary
|
|
54
|
+
gws-axi calendar events --from 2026-04-20T00:00 --to 2026-04-27T00:00
|
|
55
|
+
gws-axi calendar events --fields attendees,location,status
|
|
56
|
+
gws-axi calendar get <event-id> # full detail + attendees
|
|
57
|
+
gws-axi calendar get <event-id> --full # don't truncate description
|
|
58
|
+
gws-axi calendar calendars # list calendars accessible to this account
|
|
59
|
+
gws-axi calendar search --query "standup" # primary calendar by default
|
|
60
|
+
gws-axi calendar search --query "chris" --include-shared # include delegated + subscribed
|
|
61
|
+
gws-axi calendar freebusy --calendars primary,team@jarv.us # cross-calendar availability
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Calendar writes
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gws-axi calendar create \
|
|
68
|
+
--summary "Team sync" --start 2026-04-22T14:00 --duration 30m
|
|
69
|
+
|
|
70
|
+
gws-axi calendar update <event-id> \
|
|
71
|
+
--summary "Team sync (rescheduled)" --start 2026-04-22T15:00
|
|
72
|
+
|
|
73
|
+
gws-axi calendar delete <event-id> # idempotent (404/410 → noop)
|
|
74
|
+
|
|
75
|
+
gws-axi calendar respond <event-id> --response accepted
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Writes default `--send-updates` to `none` so agent-created events don't spam attendees. Pass `--send-updates all` for production-style invite behavior.
|
|
79
|
+
|
|
50
80
|
### Multi-account with write protection
|
|
51
81
|
|
|
52
82
|
gws-axi supports multiple Google accounts under one OAuth client. When two or more are authenticated, write operations require `--account <email>` explicitly — silent wrong-account mutations are impossible:
|
|
@@ -77,10 +107,11 @@ help[2]:
|
|
|
77
107
|
- [`docs/design.md`](https://github.com/JarvusInnovations/gws-axi/blob/main/docs/design.md) — architecture, auth model, doctor tiers, command surface
|
|
78
108
|
- [`docs/shared-client-future.md`](https://github.com/JarvusInnovations/gws-axi/blob/main/docs/shared-client-future.md) — why BYO-only for v1, what a shared-client public distribution would involve
|
|
79
109
|
|
|
80
|
-
## Known issues
|
|
110
|
+
## Known issues & roadmap
|
|
81
111
|
|
|
82
|
-
- **Testing-mode tokens expire every 7 days.** Google's OAuth policy. Re-run `gws-axi auth login --wait` when it happens. A future `gws-axi auth publish` helper will walk single-developer verification to eliminate this.
|
|
83
|
-
- **
|
|
112
|
+
- **Testing-mode tokens expire every 7 days.** Google's OAuth policy for unpublished apps. Re-run `gws-axi auth login --account <email>` + `auth login --wait` when it happens. A future `gws-axi auth publish` helper will walk single-developer verification to eliminate this.
|
|
113
|
+
- **Gmail, Docs, Drive, Slides**: not yet implemented. Stubs exercise auth + account resolution so write-protection errors still surface correctly; actual operations return `NOT_IMPLEMENTED`. Gmail is next.
|
|
114
|
+
- **Tests**: not yet — coming alongside Gmail.
|
|
84
115
|
|
|
85
116
|
## Contributing
|
|
86
117
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const CREATE_HELP = "usage: gws-axi calendar create --summary <text> --start <iso> [flags]\nflags[13]:\n --summary <text> REQUIRED \u2014 event title\n --start <iso> REQUIRED \u2014 event start (ISO datetime or YYYY-MM-DD for all-day)\n --end <iso> End time (default: start + 1h for timed, start + 1d for all-day)\n --duration <h|m> Alternative to --end, e.g. \"1h\", \"30m\", \"90m\", \"1h30m\"\n --all-day Treat --start as a date (not datetime); all-day event\n --description <text> Multi-line ok; pass via shell heredoc or quoted string\n --location <text> Freeform location string\n --attendees <emails> Comma-separated emails (no spaces). Invites sent per --send-updates\n --timezone <tz> IANA TZ (e.g. America/New_York) for timed events (default: calendar's tz)\n --recurrence <rrule> RFC 5545 RRULE (e.g. \"RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR\")\n --send-updates <mode> none | all | externalOnly (default: none \u2014 agent-safe)\n --calendar <id> Calendar to write to (default: primary)\n --account <email> REQUIRED when 2+ accounts are authenticated\nexamples:\n gws-axi calendar create --summary \"Team sync\" --start 2026-04-22T14:00 --duration 30m\n gws-axi calendar create --summary \"Holiday\" --start 2026-05-26 --all-day\n gws-axi calendar create --summary \"1:1\" --start 2026-04-22T10:00 --end 2026-04-22T10:30 --attendees alice@x.com,bob@x.com --send-updates all\nnotes:\n --send-updates defaults to \"none\" so agent-created events don't spam\n invited guests with notifications unless explicitly requested. Pass\n --send-updates all for production-style invite behavior.\noutput:\n Returns the newly-created event's key fields (id, summary, start, end,\n organizer, attendees count, htmlLink) plus an `action: created` line.\n";
|
|
2
|
+
export declare function calendarCreateCommand(account: string, args: string[]): Promise<string>;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { AxiError } from "axi-sdk-js";
|
|
2
|
+
import { calendarClient, translateGoogleError } from "../../google/client.js";
|
|
3
|
+
import { joinBlocks, renderObject } from "../../output/index.js";
|
|
4
|
+
import { formatEventTime, parseDateishFlag } from "./dateish.js";
|
|
5
|
+
export const CREATE_HELP = `usage: gws-axi calendar create --summary <text> --start <iso> [flags]
|
|
6
|
+
flags[13]:
|
|
7
|
+
--summary <text> REQUIRED — event title
|
|
8
|
+
--start <iso> REQUIRED — event start (ISO datetime or YYYY-MM-DD for all-day)
|
|
9
|
+
--end <iso> End time (default: start + 1h for timed, start + 1d for all-day)
|
|
10
|
+
--duration <h|m> Alternative to --end, e.g. "1h", "30m", "90m", "1h30m"
|
|
11
|
+
--all-day Treat --start as a date (not datetime); all-day event
|
|
12
|
+
--description <text> Multi-line ok; pass via shell heredoc or quoted string
|
|
13
|
+
--location <text> Freeform location string
|
|
14
|
+
--attendees <emails> Comma-separated emails (no spaces). Invites sent per --send-updates
|
|
15
|
+
--timezone <tz> IANA TZ (e.g. America/New_York) for timed events (default: calendar's tz)
|
|
16
|
+
--recurrence <rrule> RFC 5545 RRULE (e.g. "RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR")
|
|
17
|
+
--send-updates <mode> none | all | externalOnly (default: none — agent-safe)
|
|
18
|
+
--calendar <id> Calendar to write to (default: primary)
|
|
19
|
+
--account <email> REQUIRED when 2+ accounts are authenticated
|
|
20
|
+
examples:
|
|
21
|
+
gws-axi calendar create --summary "Team sync" --start 2026-04-22T14:00 --duration 30m
|
|
22
|
+
gws-axi calendar create --summary "Holiday" --start 2026-05-26 --all-day
|
|
23
|
+
gws-axi calendar create --summary "1:1" --start 2026-04-22T10:00 --end 2026-04-22T10:30 --attendees alice@x.com,bob@x.com --send-updates all
|
|
24
|
+
notes:
|
|
25
|
+
--send-updates defaults to "none" so agent-created events don't spam
|
|
26
|
+
invited guests with notifications unless explicitly requested. Pass
|
|
27
|
+
--send-updates all for production-style invite behavior.
|
|
28
|
+
output:
|
|
29
|
+
Returns the newly-created event's key fields (id, summary, start, end,
|
|
30
|
+
organizer, attendees count, htmlLink) plus an \`action: created\` line.
|
|
31
|
+
`;
|
|
32
|
+
function parseDurationMs(value) {
|
|
33
|
+
// Accept forms like "90m", "1h", "1h30m", "45min"
|
|
34
|
+
const re = /^(?:(\d+)h)?(?:(\d+)(?:m|min)?)?$/i;
|
|
35
|
+
const m = value.trim().match(re);
|
|
36
|
+
if (!m || (!m[1] && !m[2])) {
|
|
37
|
+
throw new AxiError(`Cannot parse duration: ${value}`, "VALIDATION_ERROR", ["Use forms like 1h, 30m, 90m, or 1h30m"]);
|
|
38
|
+
}
|
|
39
|
+
const hours = parseInt(m[1] ?? "0", 10);
|
|
40
|
+
const minutes = parseInt(m[2] ?? "0", 10);
|
|
41
|
+
return (hours * 60 + minutes) * 60 * 1000;
|
|
42
|
+
}
|
|
43
|
+
function parseFlags(args) {
|
|
44
|
+
const flags = {
|
|
45
|
+
summary: undefined,
|
|
46
|
+
start: undefined,
|
|
47
|
+
end: undefined,
|
|
48
|
+
duration: undefined,
|
|
49
|
+
allDay: false,
|
|
50
|
+
description: undefined,
|
|
51
|
+
location: undefined,
|
|
52
|
+
attendees: [],
|
|
53
|
+
timezone: undefined,
|
|
54
|
+
recurrence: undefined,
|
|
55
|
+
sendUpdates: "none",
|
|
56
|
+
calendar: "primary",
|
|
57
|
+
};
|
|
58
|
+
for (let i = 0; i < args.length; i++) {
|
|
59
|
+
const arg = args[i];
|
|
60
|
+
const next = args[i + 1];
|
|
61
|
+
switch (arg) {
|
|
62
|
+
case "--summary":
|
|
63
|
+
flags.summary = next;
|
|
64
|
+
i++;
|
|
65
|
+
break;
|
|
66
|
+
case "--start":
|
|
67
|
+
flags.start = next;
|
|
68
|
+
i++;
|
|
69
|
+
break;
|
|
70
|
+
case "--end":
|
|
71
|
+
flags.end = next;
|
|
72
|
+
i++;
|
|
73
|
+
break;
|
|
74
|
+
case "--duration":
|
|
75
|
+
flags.duration = next;
|
|
76
|
+
i++;
|
|
77
|
+
break;
|
|
78
|
+
case "--all-day":
|
|
79
|
+
flags.allDay = true;
|
|
80
|
+
break;
|
|
81
|
+
case "--description":
|
|
82
|
+
flags.description = next;
|
|
83
|
+
i++;
|
|
84
|
+
break;
|
|
85
|
+
case "--location":
|
|
86
|
+
flags.location = next;
|
|
87
|
+
i++;
|
|
88
|
+
break;
|
|
89
|
+
case "--attendees":
|
|
90
|
+
flags.attendees = next.split(",").map((s) => s.trim()).filter(Boolean);
|
|
91
|
+
i++;
|
|
92
|
+
break;
|
|
93
|
+
case "--timezone":
|
|
94
|
+
flags.timezone = next;
|
|
95
|
+
i++;
|
|
96
|
+
break;
|
|
97
|
+
case "--recurrence":
|
|
98
|
+
flags.recurrence = next;
|
|
99
|
+
i++;
|
|
100
|
+
break;
|
|
101
|
+
case "--send-updates":
|
|
102
|
+
if (next === "all" || next === "externalOnly" || next === "none") {
|
|
103
|
+
flags.sendUpdates = next;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
throw new AxiError(`Invalid --send-updates value: ${next}`, "VALIDATION_ERROR", ["Valid values: none, all, externalOnly"]);
|
|
107
|
+
}
|
|
108
|
+
i++;
|
|
109
|
+
break;
|
|
110
|
+
case "--calendar":
|
|
111
|
+
flags.calendar = next;
|
|
112
|
+
i++;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return flags;
|
|
117
|
+
}
|
|
118
|
+
/** Format a Date to `YYYY-MM-DD` in local time. */
|
|
119
|
+
function toDateOnly(d) {
|
|
120
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
121
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
122
|
+
}
|
|
123
|
+
function buildEventBody(flags) {
|
|
124
|
+
if (!flags.summary) {
|
|
125
|
+
throw new AxiError("--summary is required", "VALIDATION_ERROR", [
|
|
126
|
+
"Pass --summary 'Event title'",
|
|
127
|
+
]);
|
|
128
|
+
}
|
|
129
|
+
if (!flags.start) {
|
|
130
|
+
throw new AxiError("--start is required", "VALIDATION_ERROR", [
|
|
131
|
+
"Pass --start 2026-04-22T14:00 (timed) or --start 2026-04-22 --all-day",
|
|
132
|
+
]);
|
|
133
|
+
}
|
|
134
|
+
const body = {
|
|
135
|
+
summary: flags.summary,
|
|
136
|
+
};
|
|
137
|
+
if (flags.description !== undefined)
|
|
138
|
+
body.description = flags.description;
|
|
139
|
+
if (flags.location !== undefined)
|
|
140
|
+
body.location = flags.location;
|
|
141
|
+
if (flags.attendees.length > 0) {
|
|
142
|
+
body.attendees = flags.attendees.map((email) => ({ email }));
|
|
143
|
+
}
|
|
144
|
+
if (flags.recurrence) {
|
|
145
|
+
const line = flags.recurrence.startsWith("RRULE:")
|
|
146
|
+
? flags.recurrence
|
|
147
|
+
: `RRULE:${flags.recurrence}`;
|
|
148
|
+
body.recurrence = [line];
|
|
149
|
+
}
|
|
150
|
+
if (flags.allDay) {
|
|
151
|
+
// All-day events use the date field; Google expects exclusive end date,
|
|
152
|
+
// so default end = start + 1 day if neither --end nor --duration given.
|
|
153
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(flags.start)) {
|
|
154
|
+
throw new AxiError("--all-day requires --start in YYYY-MM-DD form", "VALIDATION_ERROR", [`Got: ${flags.start}`]);
|
|
155
|
+
}
|
|
156
|
+
body.start = { date: flags.start };
|
|
157
|
+
let endDate;
|
|
158
|
+
if (flags.end) {
|
|
159
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(flags.end)) {
|
|
160
|
+
throw new AxiError("--all-day requires --end in YYYY-MM-DD form", "VALIDATION_ERROR", [`Got: ${flags.end}`]);
|
|
161
|
+
}
|
|
162
|
+
endDate = flags.end;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
// Google's all-day end date is exclusive — default to start + 1 day
|
|
166
|
+
const d = new Date(`${flags.start}T00:00:00`);
|
|
167
|
+
d.setDate(d.getDate() + 1);
|
|
168
|
+
endDate = toDateOnly(d);
|
|
169
|
+
}
|
|
170
|
+
body.end = { date: endDate };
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// Timed event: parse via parseDateishFlag (handles ISO, local, date-only)
|
|
174
|
+
const startIso = parseDateishFlag(flags.start);
|
|
175
|
+
let endIso;
|
|
176
|
+
if (flags.end) {
|
|
177
|
+
endIso = parseDateishFlag(flags.end);
|
|
178
|
+
}
|
|
179
|
+
else if (flags.duration) {
|
|
180
|
+
const ms = parseDurationMs(flags.duration);
|
|
181
|
+
endIso = new Date(new Date(startIso).getTime() + ms).toISOString();
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
// Default: 1 hour after start
|
|
185
|
+
endIso = new Date(new Date(startIso).getTime() + 60 * 60 * 1000).toISOString();
|
|
186
|
+
}
|
|
187
|
+
body.start = flags.timezone
|
|
188
|
+
? { dateTime: startIso, timeZone: flags.timezone }
|
|
189
|
+
: { dateTime: startIso };
|
|
190
|
+
body.end = flags.timezone
|
|
191
|
+
? { dateTime: endIso, timeZone: flags.timezone }
|
|
192
|
+
: { dateTime: endIso };
|
|
193
|
+
}
|
|
194
|
+
return body;
|
|
195
|
+
}
|
|
196
|
+
export async function calendarCreateCommand(account, args) {
|
|
197
|
+
const flags = parseFlags(args);
|
|
198
|
+
const body = buildEventBody(flags);
|
|
199
|
+
const api = await calendarClient(account);
|
|
200
|
+
let created;
|
|
201
|
+
try {
|
|
202
|
+
const res = await api.events.insert({
|
|
203
|
+
calendarId: flags.calendar,
|
|
204
|
+
requestBody: body,
|
|
205
|
+
sendUpdates: flags.sendUpdates,
|
|
206
|
+
});
|
|
207
|
+
created = res.data;
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
throw translateGoogleError(err, {
|
|
211
|
+
account,
|
|
212
|
+
operation: "calendar.events.insert",
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const blocks = [];
|
|
216
|
+
blocks.push(renderObject({
|
|
217
|
+
action: "created",
|
|
218
|
+
account,
|
|
219
|
+
calendar: flags.calendar,
|
|
220
|
+
}));
|
|
221
|
+
const attendees = created.attendees ?? [];
|
|
222
|
+
const event = {
|
|
223
|
+
id: created.id ?? "",
|
|
224
|
+
summary: created.summary ?? "",
|
|
225
|
+
start: formatEventTime(created.start),
|
|
226
|
+
end: formatEventTime(created.end),
|
|
227
|
+
status: created.status ?? "",
|
|
228
|
+
organizer: created.organizer?.email ?? "",
|
|
229
|
+
attendee_count: attendees.length,
|
|
230
|
+
send_updates: flags.sendUpdates,
|
|
231
|
+
};
|
|
232
|
+
if (created.location)
|
|
233
|
+
event.location = created.location;
|
|
234
|
+
if (created.htmlLink)
|
|
235
|
+
event.html_link = created.htmlLink;
|
|
236
|
+
if (created.recurrence?.length)
|
|
237
|
+
event.recurrence = created.recurrence;
|
|
238
|
+
blocks.push(renderObject({ event }));
|
|
239
|
+
const suggestions = [];
|
|
240
|
+
suggestions.push(`Run \`gws-axi calendar get ${created.id} --calendar ${flags.calendar}\` to view full details`);
|
|
241
|
+
if (attendees.length > 0 && flags.sendUpdates === "none") {
|
|
242
|
+
suggestions.push(`Attendees were NOT notified (--send-updates none). Run \`calendar update ${created.id} --send-updates all\` to resend`);
|
|
243
|
+
}
|
|
244
|
+
blocks.push(renderObject({ help: suggestions }));
|
|
245
|
+
return joinBlocks(...blocks);
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/calendar/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1B,CAAC;AAiBF,SAAS,eAAe,CAAC,KAAa;IACpC,kDAAkD;IAClD,MAAM,EAAE,GAAG,oCAAoC,CAAC;IAChD,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAA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MAAM,IAAI,EAAE;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACzC,cAAc,EAAE,SAAS,CAAC,MAAM;QAChC,YAAY,EAAE,KAAK,CAAC,WAAW;KAChC,CAAC;IACF,IAAI,OAAO,CAAC,QAAQ;QAAE,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACxD,IAAI,OAAO,CAAC,QAAQ;QAAE,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;IACzD,IAAI,OAAO,CAAC,UAAU,EAAE,MAAM;QAAE,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAErC,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,WAAW,CAAC,IAAI,CACd,8BAA8B,OAAO,CAAC,EAAE,eAAe,KAAK,CAAC,QAAQ,yBAAyB,CAC/F,CAAC;IACF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;QACzD,WAAW,CAAC,IAAI,CACd,4EAA4E,OAAO,CAAC,EAAE,iCAAiC,CACxH,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAEjD,OAAO,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -16,6 +16,20 @@
|
|
|
16
16
|
* `timeMin` / `timeMax` parameters.
|
|
17
17
|
*/
|
|
18
18
|
export declare function parseDateishFlag(value: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Format a Google Calendar dateTime/date field for detail-view output.
|
|
21
|
+
* Timed events: datetime + "(IANA tz)" suffix when timeZone is set.
|
|
22
|
+
* All-day events: "YYYY-MM-DD (all-day)".
|
|
23
|
+
* Missing/empty: empty string.
|
|
24
|
+
*
|
|
25
|
+
* Use for single-event detail views (get, create, update, respond).
|
|
26
|
+
* List views should stick to offset-only for compact columns.
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatEventTime(value: {
|
|
29
|
+
dateTime?: string | null;
|
|
30
|
+
date?: string | null;
|
|
31
|
+
timeZone?: string | null;
|
|
32
|
+
} | null | undefined): string;
|
|
19
33
|
/**
|
|
20
34
|
* Convert a UTC timestamp string (e.g. "2026-04-22T13:00:00Z") to an ISO
|
|
21
35
|
* string with the system's local timezone offset (e.g.
|
|
@@ -40,6 +40,25 @@ export function parseDateishFlag(value) {
|
|
|
40
40
|
}
|
|
41
41
|
return parsed.toISOString();
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Format a Google Calendar dateTime/date field for detail-view output.
|
|
45
|
+
* Timed events: datetime + "(IANA tz)" suffix when timeZone is set.
|
|
46
|
+
* All-day events: "YYYY-MM-DD (all-day)".
|
|
47
|
+
* Missing/empty: empty string.
|
|
48
|
+
*
|
|
49
|
+
* Use for single-event detail views (get, create, update, respond).
|
|
50
|
+
* List views should stick to offset-only for compact columns.
|
|
51
|
+
*/
|
|
52
|
+
export function formatEventTime(value) {
|
|
53
|
+
if (!value)
|
|
54
|
+
return "";
|
|
55
|
+
if (value.dateTime) {
|
|
56
|
+
return value.timeZone ? `${value.dateTime} (${value.timeZone})` : value.dateTime;
|
|
57
|
+
}
|
|
58
|
+
if (value.date)
|
|
59
|
+
return `${value.date} (all-day)`;
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
43
62
|
/**
|
|
44
63
|
* Convert a UTC timestamp string (e.g. "2026-04-22T13:00:00Z") to an ISO
|
|
45
64
|
* string with the system's local timezone offset (e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateish.js","sourceRoot":"","sources":["../../../../src/commands/calendar/dateish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ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ACL,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE;QACjE,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE;QACrE,SAAS,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const DELETE_HELP = "usage: gws-axi calendar delete <event-id> [flags]\nargs[1]:\n <event-id> Event ID to delete\nflags[4]:\n --calendar <id> Calendar containing the event (default: primary)\n --send-updates <mode> none | all | externalOnly (default: none)\n --account <email> REQUIRED when 2+ accounts are authenticated\n --yes Don't warn; just delete (no-op currently \u2014 writes\n are already explicit via --account + this command)\nexamples:\n gws-axi calendar delete abc_123\n gws-axi calendar delete abc_123 --send-updates all --calendar team@jarv.us\nnotes:\n Idempotent: deleting an already-deleted or non-existent event returns\n exit 0 with `action: noop` rather than an error. If you need a hard\n guarantee the event existed before deletion, run `calendar get` first.\n";
|
|
2
|
+
export declare function calendarDeleteCommand(account: string, args: string[]): Promise<string>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { AxiError } from "axi-sdk-js";
|
|
2
|
+
import { calendarClient, translateGoogleError } from "../../google/client.js";
|
|
3
|
+
import { renderObject } from "../../output/index.js";
|
|
4
|
+
export const DELETE_HELP = `usage: gws-axi calendar delete <event-id> [flags]
|
|
5
|
+
args[1]:
|
|
6
|
+
<event-id> Event ID to delete
|
|
7
|
+
flags[4]:
|
|
8
|
+
--calendar <id> Calendar containing the event (default: primary)
|
|
9
|
+
--send-updates <mode> none | all | externalOnly (default: none)
|
|
10
|
+
--account <email> REQUIRED when 2+ accounts are authenticated
|
|
11
|
+
--yes Don't warn; just delete (no-op currently — writes
|
|
12
|
+
are already explicit via --account + this command)
|
|
13
|
+
examples:
|
|
14
|
+
gws-axi calendar delete abc_123
|
|
15
|
+
gws-axi calendar delete abc_123 --send-updates all --calendar team@jarv.us
|
|
16
|
+
notes:
|
|
17
|
+
Idempotent: deleting an already-deleted or non-existent event returns
|
|
18
|
+
exit 0 with \`action: noop\` rather than an error. If you need a hard
|
|
19
|
+
guarantee the event existed before deletion, run \`calendar get\` first.
|
|
20
|
+
`;
|
|
21
|
+
function parseFlags(args) {
|
|
22
|
+
let eventId;
|
|
23
|
+
let calendar = "primary";
|
|
24
|
+
let sendUpdates = "none";
|
|
25
|
+
for (let i = 0; i < args.length; i++) {
|
|
26
|
+
const arg = args[i];
|
|
27
|
+
const next = args[i + 1];
|
|
28
|
+
switch (arg) {
|
|
29
|
+
case "--calendar":
|
|
30
|
+
calendar = next;
|
|
31
|
+
i++;
|
|
32
|
+
break;
|
|
33
|
+
case "--send-updates":
|
|
34
|
+
if (next === "all" || next === "externalOnly" || next === "none") {
|
|
35
|
+
sendUpdates = next;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
throw new AxiError(`Invalid --send-updates value: ${next}`, "VALIDATION_ERROR", ["Valid values: none, all, externalOnly"]);
|
|
39
|
+
}
|
|
40
|
+
i++;
|
|
41
|
+
break;
|
|
42
|
+
case "--yes":
|
|
43
|
+
// no-op — reserved for future confirmation prompts
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
if (!arg.startsWith("--") && eventId === undefined) {
|
|
47
|
+
eventId = arg;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!eventId) {
|
|
52
|
+
throw new AxiError("Missing event ID argument", "VALIDATION_ERROR", [
|
|
53
|
+
"Usage: gws-axi calendar delete <event-id> [flags]",
|
|
54
|
+
"Get an ID from `gws-axi calendar events`",
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
return { eventId, calendar, sendUpdates };
|
|
58
|
+
}
|
|
59
|
+
export async function calendarDeleteCommand(account, args) {
|
|
60
|
+
const flags = parseFlags(args);
|
|
61
|
+
const api = await calendarClient(account);
|
|
62
|
+
try {
|
|
63
|
+
await api.events.delete({
|
|
64
|
+
calendarId: flags.calendar,
|
|
65
|
+
eventId: flags.eventId,
|
|
66
|
+
sendUpdates: flags.sendUpdates,
|
|
67
|
+
});
|
|
68
|
+
return renderObject({
|
|
69
|
+
action: "deleted",
|
|
70
|
+
account,
|
|
71
|
+
calendar: flags.calendar,
|
|
72
|
+
event_id: flags.eventId,
|
|
73
|
+
send_updates: flags.sendUpdates,
|
|
74
|
+
help: [
|
|
75
|
+
`Run \`gws-axi calendar events --calendar ${flags.calendar}\` to verify`,
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
const translated = translateGoogleError(err, {
|
|
81
|
+
account,
|
|
82
|
+
operation: "calendar.events.delete",
|
|
83
|
+
});
|
|
84
|
+
if (translated.code === "NOT_FOUND" || translated.code === "GOOGLE_API_ERROR_410") {
|
|
85
|
+
// 404 or 410 (gone) — already deleted. Idempotent success.
|
|
86
|
+
return renderObject({
|
|
87
|
+
action: "noop",
|
|
88
|
+
account,
|
|
89
|
+
calendar: flags.calendar,
|
|
90
|
+
event_id: flags.eventId,
|
|
91
|
+
reason: "event was already deleted or never existed",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
throw translated;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/calendar/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAu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|
import { AxiError } from "axi-sdk-js";
|
|
2
2
|
import { calendarClient, translateGoogleError } from "../../google/client.js";
|
|
3
3
|
import { field, joinBlocks, renderHelp, renderList, renderObject, } from "../../output/index.js";
|
|
4
|
+
import { formatEventTime } from "./dateish.js";
|
|
4
5
|
export const GET_HELP = `usage: gws-axi calendar get <event-id> [flags]
|
|
5
6
|
args[1]:
|
|
6
7
|
<event-id> Event ID (from \`calendar events\` output)
|
|
@@ -45,16 +46,6 @@ function parseFlags(args) {
|
|
|
45
46
|
}
|
|
46
47
|
return { eventId, flags };
|
|
47
48
|
}
|
|
48
|
-
function formatTime(value) {
|
|
49
|
-
if (!value)
|
|
50
|
-
return "";
|
|
51
|
-
if (value.dateTime) {
|
|
52
|
-
return value.timeZone ? `${value.dateTime} (${value.timeZone})` : value.dateTime;
|
|
53
|
-
}
|
|
54
|
-
if (value.date)
|
|
55
|
-
return `${value.date} (all-day)`;
|
|
56
|
-
return "";
|
|
57
|
-
}
|
|
58
49
|
function truncate(value, max) {
|
|
59
50
|
if (!value)
|
|
60
51
|
return { value: "", truncated: false, total: 0 };
|
|
@@ -93,17 +84,17 @@ export async function calendarGetCommand(account, args) {
|
|
|
93
84
|
throw translated;
|
|
94
85
|
}
|
|
95
86
|
const blocks = [];
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
blocks.push(renderObject(
|
|
87
|
+
// Always include the calendar in the header so agents can correlate
|
|
88
|
+
// across calendars in batch work without needing to remember which
|
|
89
|
+
// --calendar flag they passed.
|
|
90
|
+
blocks.push(renderObject({ account, calendar: flags.calendar }));
|
|
100
91
|
const descResult = truncate(event.description ?? "", flags.full ? 1_000_000 : 500);
|
|
101
92
|
const details = {
|
|
102
93
|
id: event.id ?? "",
|
|
103
94
|
summary: event.summary ?? "",
|
|
104
95
|
status: event.status ?? "",
|
|
105
|
-
start:
|
|
106
|
-
end:
|
|
96
|
+
start: formatEventTime(event.start),
|
|
97
|
+
end: formatEventTime(event.end),
|
|
107
98
|
creator: event.creator?.email ?? "",
|
|
108
99
|
organizer: event.organizer?.email ?? "",
|
|
109
100
|
};
|
|
@@ -163,6 +154,11 @@ export async function calendarGetCommand(account, args) {
|
|
|
163
154
|
}
|
|
164
155
|
}
|
|
165
156
|
const suggestions = [];
|
|
157
|
+
if (event.status === "cancelled") {
|
|
158
|
+
// Google tombstones deleted events (they return 200 with status=cancelled
|
|
159
|
+
// rather than 404). Make sure agents don't misread this as "event exists".
|
|
160
|
+
suggestions.push(`This event is CANCELLED (tombstoned by a prior delete). It won't appear in \`calendar events\` or in Google Calendar's UI. To restore, create a new event with \`gws-axi calendar create --account ${account} --calendar ${flags.calendar} ...\`.`);
|
|
161
|
+
}
|
|
166
162
|
if (descResult.truncated || attendees.length > 20) {
|
|
167
163
|
suggestions.push(`Run with --full to see complete description and all attendees`);
|
|
168
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/calendar/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,KAAK,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/calendar/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,KAAK,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;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
|
|
|
1
|
+
export declare const RESPOND_HELP = "usage: gws-axi calendar respond <event-id> --response <status> [flags]\nargs[1]:\n <event-id> Event ID you've been invited to\nflags[4]:\n --response <status> REQUIRED: accepted | tentative | declined | needsAction\n --comment <text> Optional comment (visible to the organizer)\n --calendar <id> Calendar containing the event (default: primary)\n --send-updates <mode> none | all | externalOnly (default: all \u2014 notifies organizer)\n --account <email> REQUIRED when 2+ accounts are authenticated\nexamples:\n gws-axi calendar respond abc_123 --response accepted\n gws-axi calendar respond abc_123 --response declined --comment \"Timezone conflict\"\n gws-axi calendar respond abc_123 --response tentative --send-updates none\nnotes:\n Updates the `self: true` attendee's responseStatus via events.patch.\n The event must already have you listed as an attendee \u2014 you can't RSVP\n to something you weren't invited to. If you're the sole organizer of\n a single-person event, there's no attendee to update (use calendar\n update to change the event itself).\n Default --send-updates is \"all\" (organizer expects to know your\n response) \u2014 differs from create/update/delete which default to \"none\".\n";
|
|
2
|
+
export declare function calendarRespondCommand(account: string, args: string[]): Promise<string>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { AxiError } from "axi-sdk-js";
|
|
2
|
+
import { calendarClient, translateGoogleError } from "../../google/client.js";
|
|
3
|
+
import { renderObject } from "../../output/index.js";
|
|
4
|
+
export const RESPOND_HELP = `usage: gws-axi calendar respond <event-id> --response <status> [flags]
|
|
5
|
+
args[1]:
|
|
6
|
+
<event-id> Event ID you've been invited to
|
|
7
|
+
flags[4]:
|
|
8
|
+
--response <status> REQUIRED: accepted | tentative | declined | needsAction
|
|
9
|
+
--comment <text> Optional comment (visible to the organizer)
|
|
10
|
+
--calendar <id> Calendar containing the event (default: primary)
|
|
11
|
+
--send-updates <mode> none | all | externalOnly (default: all — notifies organizer)
|
|
12
|
+
--account <email> REQUIRED when 2+ accounts are authenticated
|
|
13
|
+
examples:
|
|
14
|
+
gws-axi calendar respond abc_123 --response accepted
|
|
15
|
+
gws-axi calendar respond abc_123 --response declined --comment "Timezone conflict"
|
|
16
|
+
gws-axi calendar respond abc_123 --response tentative --send-updates none
|
|
17
|
+
notes:
|
|
18
|
+
Updates the \`self: true\` attendee's responseStatus via events.patch.
|
|
19
|
+
The event must already have you listed as an attendee — you can't RSVP
|
|
20
|
+
to something you weren't invited to. If you're the sole organizer of
|
|
21
|
+
a single-person event, there's no attendee to update (use calendar
|
|
22
|
+
update to change the event itself).
|
|
23
|
+
Default --send-updates is "all" (organizer expects to know your
|
|
24
|
+
response) — differs from create/update/delete which default to "none".
|
|
25
|
+
`;
|
|
26
|
+
const VALID_RESPONSES = [
|
|
27
|
+
"accepted",
|
|
28
|
+
"tentative",
|
|
29
|
+
"declined",
|
|
30
|
+
"needsAction",
|
|
31
|
+
];
|
|
32
|
+
function parseFlags(args) {
|
|
33
|
+
let eventId;
|
|
34
|
+
let response;
|
|
35
|
+
let comment;
|
|
36
|
+
let calendar = "primary";
|
|
37
|
+
let sendUpdates = "all";
|
|
38
|
+
for (let i = 0; i < args.length; i++) {
|
|
39
|
+
const arg = args[i];
|
|
40
|
+
const next = args[i + 1];
|
|
41
|
+
switch (arg) {
|
|
42
|
+
case "--response":
|
|
43
|
+
if (!VALID_RESPONSES.includes(next)) {
|
|
44
|
+
throw new AxiError(`Invalid --response value: ${next}`, "VALIDATION_ERROR", [`Valid values: ${VALID_RESPONSES.join(", ")}`]);
|
|
45
|
+
}
|
|
46
|
+
response = next;
|
|
47
|
+
i++;
|
|
48
|
+
break;
|
|
49
|
+
case "--comment":
|
|
50
|
+
comment = next;
|
|
51
|
+
i++;
|
|
52
|
+
break;
|
|
53
|
+
case "--calendar":
|
|
54
|
+
calendar = next;
|
|
55
|
+
i++;
|
|
56
|
+
break;
|
|
57
|
+
case "--send-updates":
|
|
58
|
+
if (next === "all" || next === "externalOnly" || next === "none") {
|
|
59
|
+
sendUpdates = next;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
throw new AxiError(`Invalid --send-updates value: ${next}`, "VALIDATION_ERROR", ["Valid values: none, all, externalOnly"]);
|
|
63
|
+
}
|
|
64
|
+
i++;
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
if (!arg.startsWith("--") && eventId === undefined) {
|
|
68
|
+
eventId = arg;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!eventId) {
|
|
73
|
+
throw new AxiError("Missing event ID argument", "VALIDATION_ERROR", ["Usage: gws-axi calendar respond <event-id> --response <status>"]);
|
|
74
|
+
}
|
|
75
|
+
if (!response) {
|
|
76
|
+
throw new AxiError("--response is required", "VALIDATION_ERROR", [`Valid values: ${VALID_RESPONSES.join(", ")}`]);
|
|
77
|
+
}
|
|
78
|
+
return { eventId, response, comment, calendar, sendUpdates };
|
|
79
|
+
}
|
|
80
|
+
export async function calendarRespondCommand(account, args) {
|
|
81
|
+
const flags = parseFlags(args);
|
|
82
|
+
const api = await calendarClient(account);
|
|
83
|
+
// Fetch the event so we can find the self-attendee and produce the
|
|
84
|
+
// updated attendees array.
|
|
85
|
+
let existing;
|
|
86
|
+
try {
|
|
87
|
+
const res = await api.events.get({
|
|
88
|
+
calendarId: flags.calendar,
|
|
89
|
+
eventId: flags.eventId,
|
|
90
|
+
});
|
|
91
|
+
existing = res.data;
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
const translated = translateGoogleError(err, {
|
|
95
|
+
account,
|
|
96
|
+
operation: "calendar.events.get",
|
|
97
|
+
});
|
|
98
|
+
if (translated.code === "NOT_FOUND") {
|
|
99
|
+
throw new AxiError(`Event '${flags.eventId}' not found in calendar '${flags.calendar}'`, "EVENT_NOT_FOUND", [
|
|
100
|
+
`Verify the ID with \`gws-axi calendar events --calendar ${flags.calendar}\``,
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
throw translated;
|
|
104
|
+
}
|
|
105
|
+
const attendees = existing.attendees ?? [];
|
|
106
|
+
if (attendees.length === 0) {
|
|
107
|
+
throw new AxiError(`Event '${flags.eventId}' has no attendees — you can't RSVP to it`, "NOT_AN_INVITEE", [
|
|
108
|
+
"If this is your own single-person event, use `calendar update` to change it directly",
|
|
109
|
+
]);
|
|
110
|
+
}
|
|
111
|
+
const selfIndex = attendees.findIndex((a) => a.self === true);
|
|
112
|
+
if (selfIndex < 0) {
|
|
113
|
+
throw new AxiError(`${account} is not an attendee of event '${flags.eventId}' — can't RSVP`, "NOT_AN_INVITEE", [
|
|
114
|
+
"RSVP only works for events where you are a direct attendee",
|
|
115
|
+
"Verify with `gws-axi calendar get " + flags.eventId + "`",
|
|
116
|
+
]);
|
|
117
|
+
}
|
|
118
|
+
const previousResponse = attendees[selfIndex].responseStatus ?? "needsAction";
|
|
119
|
+
const updatedAttendees = attendees.map((a, i) => i === selfIndex
|
|
120
|
+
? {
|
|
121
|
+
...a,
|
|
122
|
+
responseStatus: flags.response,
|
|
123
|
+
...(flags.comment !== undefined ? { comment: flags.comment } : {}),
|
|
124
|
+
}
|
|
125
|
+
: a);
|
|
126
|
+
let updated;
|
|
127
|
+
try {
|
|
128
|
+
const res = await api.events.patch({
|
|
129
|
+
calendarId: flags.calendar,
|
|
130
|
+
eventId: flags.eventId,
|
|
131
|
+
requestBody: { attendees: updatedAttendees },
|
|
132
|
+
sendUpdates: flags.sendUpdates,
|
|
133
|
+
});
|
|
134
|
+
updated = res.data;
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
throw translateGoogleError(err, {
|
|
138
|
+
account,
|
|
139
|
+
operation: "calendar.events.patch",
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return renderObject({
|
|
143
|
+
action: "responded",
|
|
144
|
+
account,
|
|
145
|
+
calendar: flags.calendar,
|
|
146
|
+
event_id: updated.id ?? flags.eventId,
|
|
147
|
+
summary: updated.summary ?? "",
|
|
148
|
+
previous_response: previousResponse,
|
|
149
|
+
new_response: flags.response,
|
|
150
|
+
send_updates: flags.sendUpdates,
|
|
151
|
+
help: [
|
|
152
|
+
`Run \`gws-axi calendar get ${flags.eventId} --calendar ${flags.calendar}\` to verify`,
|
|
153
|
+
],
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=respond.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respond.js","sourceRoot":"","sources":["../../../../src/commands/calendar/respond.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB3B,CAAC;AAGF,MAAM,eAAe,GAAqB;IACxC,UAAU;IACV,WAAW;IACX,UAAU;IACV,aAAa;CACd,CAAC;AAUF,SAAS,UAAU,CAAC,IAAc;IAChC,IAAI,OAA2B,CAAC;IAChC,IAAI,QAAoC,CAAC;IACzC,IAAI,OAA2B,CAAC;IAChC,IAAI,QAAQ,GAAG,SAAS,CAAC;IACzB,IAAI,WAAW,GAAoC,KAAK,CAAC;IAEzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,YAAY;gBACf,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAsB,CAAC,EAAE,CAAC;oBACtD,MAAM,IAAI,QAAQ,CAChB,6BAA6B,IAAI,EAAE,EACnC,kBAAkB,EAClB,CAAC,iBAAiB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAChD,CAAC;gBACJ,CAAC;gBACD,QAAQ,GAAG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O,CAAC,OAAO,IAAI,EAAE;QAC9B,iBAAiB,EAAE,gBAAgB;QACnC,YAAY,EAAE,KAAK,CAAC,QAAQ;QAC5B,YAAY,EAAE,KAAK,CAAC,WAAW;QAC/B,IAAI,EAAE;YACJ,8BAA8B,KAAK,CAAC,OAAO,eAAe,KAAK,CAAC,QAAQ,cAAc;SACvF;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const UPDATE_HELP = "usage: gws-axi calendar update <event-id> [flags]\nargs[1]:\n <event-id> Event ID to update (from `calendar events` or `calendar get`)\nflags[12]:\n --summary <text> New event title\n --start <iso> New start time (ISO datetime or YYYY-MM-DD for all-day)\n --end <iso> New end time\n --duration <h|m> Set end relative to (new or existing) start, e.g. \"1h\"\n --description <text> Replace description (pass empty string to clear)\n --location <text> Replace location\n --add-attendees <es> Comma-separated emails to add (merges with existing)\n --remove-attendees <es> Comma-separated emails to remove\n --replace-attendees <es> Comma-separated emails \u2014 REPLACES entire attendee list\n --send-updates <mode> none | all | externalOnly (default: none)\n --calendar <id> Calendar containing the event (default: primary)\n --account <email> REQUIRED when 2+ accounts are authenticated\nexamples:\n gws-axi calendar update abc_123 --summary \"Team sync (rescheduled)\"\n gws-axi calendar update abc_123 --start 2026-04-22T15:00 --duration 30m\n gws-axi calendar update abc_123 --add-attendees eve@x.com --send-updates all\nnotes:\n Uses events.patch \u2014 only specified fields change; everything else stays\n as-is. If --start is given without --end or --duration, --end stays put\n (might produce a negative-duration event \u2014 the API will reject).\n For attendee changes: --add/--remove merge with the existing list via a\n read-modify-write (two API calls); --replace-attendees overwrites in one.\n";
|
|
2
|
+
export declare function calendarUpdateCommand(account: string, args: string[]): Promise<string>;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { AxiError } from "axi-sdk-js";
|
|
2
|
+
import { calendarClient, translateGoogleError } from "../../google/client.js";
|
|
3
|
+
import { joinBlocks, renderObject } from "../../output/index.js";
|
|
4
|
+
import { formatEventTime, parseDateishFlag } from "./dateish.js";
|
|
5
|
+
export const UPDATE_HELP = `usage: gws-axi calendar update <event-id> [flags]
|
|
6
|
+
args[1]:
|
|
7
|
+
<event-id> Event ID to update (from \`calendar events\` or \`calendar get\`)
|
|
8
|
+
flags[12]:
|
|
9
|
+
--summary <text> New event title
|
|
10
|
+
--start <iso> New start time (ISO datetime or YYYY-MM-DD for all-day)
|
|
11
|
+
--end <iso> New end time
|
|
12
|
+
--duration <h|m> Set end relative to (new or existing) start, e.g. "1h"
|
|
13
|
+
--description <text> Replace description (pass empty string to clear)
|
|
14
|
+
--location <text> Replace location
|
|
15
|
+
--add-attendees <es> Comma-separated emails to add (merges with existing)
|
|
16
|
+
--remove-attendees <es> Comma-separated emails to remove
|
|
17
|
+
--replace-attendees <es> Comma-separated emails — REPLACES entire attendee list
|
|
18
|
+
--send-updates <mode> none | all | externalOnly (default: none)
|
|
19
|
+
--calendar <id> Calendar containing the event (default: primary)
|
|
20
|
+
--account <email> REQUIRED when 2+ accounts are authenticated
|
|
21
|
+
examples:
|
|
22
|
+
gws-axi calendar update abc_123 --summary "Team sync (rescheduled)"
|
|
23
|
+
gws-axi calendar update abc_123 --start 2026-04-22T15:00 --duration 30m
|
|
24
|
+
gws-axi calendar update abc_123 --add-attendees eve@x.com --send-updates all
|
|
25
|
+
notes:
|
|
26
|
+
Uses events.patch — only specified fields change; everything else stays
|
|
27
|
+
as-is. If --start is given without --end or --duration, --end stays put
|
|
28
|
+
(might produce a negative-duration event — the API will reject).
|
|
29
|
+
For attendee changes: --add/--remove merge with the existing list via a
|
|
30
|
+
read-modify-write (two API calls); --replace-attendees overwrites in one.
|
|
31
|
+
`;
|
|
32
|
+
function parseDurationMs(value) {
|
|
33
|
+
const re = /^(?:(\d+)h)?(?:(\d+)(?:m|min)?)?$/i;
|
|
34
|
+
const m = value.trim().match(re);
|
|
35
|
+
if (!m || (!m[1] && !m[2])) {
|
|
36
|
+
throw new AxiError(`Cannot parse duration: ${value}`, "VALIDATION_ERROR", ["Use forms like 1h, 30m, 90m, or 1h30m"]);
|
|
37
|
+
}
|
|
38
|
+
return ((parseInt(m[1] ?? "0", 10) * 60 + parseInt(m[2] ?? "0", 10)) * 60 * 1000);
|
|
39
|
+
}
|
|
40
|
+
function parseFlags(args) {
|
|
41
|
+
let eventId;
|
|
42
|
+
const flags = {
|
|
43
|
+
addAttendees: [],
|
|
44
|
+
removeAttendees: [],
|
|
45
|
+
replaceAttendees: undefined,
|
|
46
|
+
sendUpdates: "none",
|
|
47
|
+
calendar: "primary",
|
|
48
|
+
};
|
|
49
|
+
for (let i = 0; i < args.length; i++) {
|
|
50
|
+
const arg = args[i];
|
|
51
|
+
const next = args[i + 1];
|
|
52
|
+
switch (arg) {
|
|
53
|
+
case "--summary":
|
|
54
|
+
flags.summary = next;
|
|
55
|
+
i++;
|
|
56
|
+
break;
|
|
57
|
+
case "--start":
|
|
58
|
+
flags.start = next;
|
|
59
|
+
i++;
|
|
60
|
+
break;
|
|
61
|
+
case "--end":
|
|
62
|
+
flags.end = next;
|
|
63
|
+
i++;
|
|
64
|
+
break;
|
|
65
|
+
case "--duration":
|
|
66
|
+
flags.duration = next;
|
|
67
|
+
i++;
|
|
68
|
+
break;
|
|
69
|
+
case "--description":
|
|
70
|
+
flags.description = next;
|
|
71
|
+
i++;
|
|
72
|
+
break;
|
|
73
|
+
case "--location":
|
|
74
|
+
flags.location = next;
|
|
75
|
+
i++;
|
|
76
|
+
break;
|
|
77
|
+
case "--add-attendees":
|
|
78
|
+
flags.addAttendees = next.split(",").map((s) => s.trim()).filter(Boolean);
|
|
79
|
+
i++;
|
|
80
|
+
break;
|
|
81
|
+
case "--remove-attendees":
|
|
82
|
+
flags.removeAttendees = next.split(",").map((s) => s.trim()).filter(Boolean);
|
|
83
|
+
i++;
|
|
84
|
+
break;
|
|
85
|
+
case "--replace-attendees":
|
|
86
|
+
flags.replaceAttendees = next.split(",").map((s) => s.trim()).filter(Boolean);
|
|
87
|
+
i++;
|
|
88
|
+
break;
|
|
89
|
+
case "--timezone":
|
|
90
|
+
flags.timezone = next;
|
|
91
|
+
i++;
|
|
92
|
+
break;
|
|
93
|
+
case "--send-updates":
|
|
94
|
+
if (next === "all" || next === "externalOnly" || next === "none") {
|
|
95
|
+
flags.sendUpdates = next;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
throw new AxiError(`Invalid --send-updates value: ${next}`, "VALIDATION_ERROR", ["Valid values: none, all, externalOnly"]);
|
|
99
|
+
}
|
|
100
|
+
i++;
|
|
101
|
+
break;
|
|
102
|
+
case "--calendar":
|
|
103
|
+
flags.calendar = next;
|
|
104
|
+
i++;
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
if (!arg.startsWith("--") && eventId === undefined) {
|
|
108
|
+
eventId = arg;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (!eventId) {
|
|
113
|
+
throw new AxiError("Missing event ID argument", "VALIDATION_ERROR", [
|
|
114
|
+
"Usage: gws-axi calendar update <event-id> [flags]",
|
|
115
|
+
"Get an ID from `gws-axi calendar events`",
|
|
116
|
+
]);
|
|
117
|
+
}
|
|
118
|
+
return { ...flags, eventId };
|
|
119
|
+
}
|
|
120
|
+
function buildPatchBody(flags, existing) {
|
|
121
|
+
const body = {};
|
|
122
|
+
if (flags.summary !== undefined)
|
|
123
|
+
body.summary = flags.summary;
|
|
124
|
+
if (flags.description !== undefined)
|
|
125
|
+
body.description = flags.description;
|
|
126
|
+
if (flags.location !== undefined)
|
|
127
|
+
body.location = flags.location;
|
|
128
|
+
// Time handling: we need to know if the EXISTING event is all-day or timed
|
|
129
|
+
// to parse flags.start/end correctly.
|
|
130
|
+
const existingIsAllDay = Boolean(existing.start?.date);
|
|
131
|
+
if (flags.start !== undefined || flags.end !== undefined || flags.duration !== undefined) {
|
|
132
|
+
if (existingIsAllDay) {
|
|
133
|
+
if (flags.start !== undefined) {
|
|
134
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(flags.start)) {
|
|
135
|
+
throw new AxiError("Existing event is all-day; --start must be YYYY-MM-DD", "VALIDATION_ERROR", [`Got: ${flags.start}`]);
|
|
136
|
+
}
|
|
137
|
+
body.start = { date: flags.start };
|
|
138
|
+
}
|
|
139
|
+
if (flags.end !== undefined) {
|
|
140
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(flags.end)) {
|
|
141
|
+
throw new AxiError("Existing event is all-day; --end must be YYYY-MM-DD", "VALIDATION_ERROR", [`Got: ${flags.end}`]);
|
|
142
|
+
}
|
|
143
|
+
body.end = { date: flags.end };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
if (flags.start !== undefined) {
|
|
148
|
+
const startIso = parseDateishFlag(flags.start);
|
|
149
|
+
body.start = flags.timezone
|
|
150
|
+
? { dateTime: startIso, timeZone: flags.timezone }
|
|
151
|
+
: { dateTime: startIso };
|
|
152
|
+
}
|
|
153
|
+
if (flags.end !== undefined) {
|
|
154
|
+
const endIso = parseDateishFlag(flags.end);
|
|
155
|
+
body.end = flags.timezone
|
|
156
|
+
? { dateTime: endIso, timeZone: flags.timezone }
|
|
157
|
+
: { dateTime: endIso };
|
|
158
|
+
}
|
|
159
|
+
else if (flags.duration !== undefined) {
|
|
160
|
+
const ms = parseDurationMs(flags.duration);
|
|
161
|
+
const baseStartIso = body.start?.dateTime ??
|
|
162
|
+
existing.start?.dateTime;
|
|
163
|
+
if (!baseStartIso) {
|
|
164
|
+
throw new AxiError("Cannot compute --duration — no known start time", "VALIDATION_ERROR", ["Pass --start or ensure the event has a dateTime start"]);
|
|
165
|
+
}
|
|
166
|
+
const endIso = new Date(new Date(baseStartIso).getTime() + ms).toISOString();
|
|
167
|
+
body.end = flags.timezone
|
|
168
|
+
? { dateTime: endIso, timeZone: flags.timezone }
|
|
169
|
+
: { dateTime: endIso };
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// Attendees
|
|
174
|
+
if (flags.replaceAttendees !== undefined) {
|
|
175
|
+
body.attendees = flags.replaceAttendees.map((email) => ({ email }));
|
|
176
|
+
}
|
|
177
|
+
else if (flags.addAttendees.length > 0 || flags.removeAttendees.length > 0) {
|
|
178
|
+
const existingAttendees = existing.attendees ?? [];
|
|
179
|
+
const removeSet = new Set(flags.removeAttendees.map((e) => e.toLowerCase()));
|
|
180
|
+
const keptExisting = existingAttendees.filter((a) => !(a.email && removeSet.has(a.email.toLowerCase())));
|
|
181
|
+
const existingEmails = new Set(keptExisting
|
|
182
|
+
.map((a) => a.email?.toLowerCase())
|
|
183
|
+
.filter((e) => typeof e === "string"));
|
|
184
|
+
const additions = flags.addAttendees
|
|
185
|
+
.filter((e) => !existingEmails.has(e.toLowerCase()))
|
|
186
|
+
.map((email) => ({ email }));
|
|
187
|
+
body.attendees = [...keptExisting, ...additions];
|
|
188
|
+
}
|
|
189
|
+
return body;
|
|
190
|
+
}
|
|
191
|
+
export async function calendarUpdateCommand(account, args) {
|
|
192
|
+
const flags = parseFlags(args);
|
|
193
|
+
// Sanity check: the user passed at least one mutating flag.
|
|
194
|
+
const hasChanges = flags.summary !== undefined ||
|
|
195
|
+
flags.description !== undefined ||
|
|
196
|
+
flags.location !== undefined ||
|
|
197
|
+
flags.start !== undefined ||
|
|
198
|
+
flags.end !== undefined ||
|
|
199
|
+
flags.duration !== undefined ||
|
|
200
|
+
flags.addAttendees.length > 0 ||
|
|
201
|
+
flags.removeAttendees.length > 0 ||
|
|
202
|
+
flags.replaceAttendees !== undefined;
|
|
203
|
+
if (!hasChanges) {
|
|
204
|
+
throw new AxiError("No update flags provided — nothing to change", "VALIDATION_ERROR", [
|
|
205
|
+
"Pass at least one of --summary, --start, --end, --duration,",
|
|
206
|
+
"--description, --location, --add-attendees, --remove-attendees,",
|
|
207
|
+
"or --replace-attendees",
|
|
208
|
+
]);
|
|
209
|
+
}
|
|
210
|
+
const api = await calendarClient(account);
|
|
211
|
+
// Fetch existing event — needed to detect all-day vs timed, and to merge
|
|
212
|
+
// attendee add/remove lists correctly.
|
|
213
|
+
let existing;
|
|
214
|
+
try {
|
|
215
|
+
const res = await api.events.get({
|
|
216
|
+
calendarId: flags.calendar,
|
|
217
|
+
eventId: flags.eventId,
|
|
218
|
+
});
|
|
219
|
+
existing = res.data;
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
const translated = translateGoogleError(err, {
|
|
223
|
+
account,
|
|
224
|
+
operation: "calendar.events.get",
|
|
225
|
+
});
|
|
226
|
+
if (translated.code === "NOT_FOUND") {
|
|
227
|
+
throw new AxiError(`Event '${flags.eventId}' not found in calendar '${flags.calendar}'`, "EVENT_NOT_FOUND", [
|
|
228
|
+
`Verify the ID with \`gws-axi calendar events --calendar ${flags.calendar}\``,
|
|
229
|
+
]);
|
|
230
|
+
}
|
|
231
|
+
throw translated;
|
|
232
|
+
}
|
|
233
|
+
const body = buildPatchBody(flags, existing);
|
|
234
|
+
let updated;
|
|
235
|
+
try {
|
|
236
|
+
const res = await api.events.patch({
|
|
237
|
+
calendarId: flags.calendar,
|
|
238
|
+
eventId: flags.eventId,
|
|
239
|
+
requestBody: body,
|
|
240
|
+
sendUpdates: flags.sendUpdates,
|
|
241
|
+
});
|
|
242
|
+
updated = res.data;
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
throw translateGoogleError(err, {
|
|
246
|
+
account,
|
|
247
|
+
operation: "calendar.events.patch",
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
const blocks = [];
|
|
251
|
+
const changedFields = Object.keys(body);
|
|
252
|
+
blocks.push(renderObject({
|
|
253
|
+
action: "updated",
|
|
254
|
+
account,
|
|
255
|
+
calendar: flags.calendar,
|
|
256
|
+
fields_changed: changedFields,
|
|
257
|
+
send_updates: flags.sendUpdates,
|
|
258
|
+
}));
|
|
259
|
+
const attendees = updated.attendees ?? [];
|
|
260
|
+
blocks.push(renderObject({
|
|
261
|
+
event: {
|
|
262
|
+
id: updated.id ?? "",
|
|
263
|
+
summary: updated.summary ?? "",
|
|
264
|
+
start: formatEventTime(updated.start),
|
|
265
|
+
end: formatEventTime(updated.end),
|
|
266
|
+
status: updated.status ?? "",
|
|
267
|
+
attendee_count: attendees.length,
|
|
268
|
+
html_link: updated.htmlLink ?? "",
|
|
269
|
+
},
|
|
270
|
+
}));
|
|
271
|
+
const suggestions = [];
|
|
272
|
+
suggestions.push(`Run \`gws-axi calendar get ${updated.id} --calendar ${flags.calendar}\` to view full updated event`);
|
|
273
|
+
if (flags.sendUpdates === "none" && attendees.length > 0) {
|
|
274
|
+
suggestions.push(`Attendees were NOT notified of this change (--send-updates none). Run the same command with --send-updates all to resend invitations`);
|
|
275
|
+
}
|
|
276
|
+
blocks.push(renderObject({ help: suggestions }));
|
|
277
|
+
return joinBlocks(...blocks);
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/calendar/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1B,CAAC;AAkBF,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,EAAE,GAAG,oCAAoC,CAAC;IAChD,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,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CAAC,MAAM,IAAI,EAAE;YAC5B,cAAc,EAAE,SAAS,CAAC,MAAM;YAChC,SAAS,EAAE,OAAO,CAAC,QAAQ,IAAI,EAAE;SAClC;KACF,CAAC,CACH,CAAC;IAEF,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,WAAW,CAAC,IAAI,CACd,8BAA8B,OAAO,CAAC,EAAE,eAAe,KAAK,CAAC,QAAQ,+BAA+B,CACrG,CAAC;IACF,IAAI,KAAK,CAAC,WAAW,KAAK,MAAM,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,WAAW,CAAC,IAAI,CACd,sIAAsI,CACvI,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAEjD,OAAO,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { AxiError } from "axi-sdk-js";
|
|
2
2
|
import { resolveAccount } from "../google/account.js";
|
|
3
3
|
import { calendarCalendarsCommand, CALENDARS_HELP } from "./calendar/calendars.js";
|
|
4
|
+
import { calendarCreateCommand, CREATE_HELP } from "./calendar/create.js";
|
|
5
|
+
import { calendarDeleteCommand, DELETE_HELP } from "./calendar/delete.js";
|
|
4
6
|
import { calendarEventsCommand, EVENTS_HELP } from "./calendar/events.js";
|
|
5
7
|
import { calendarFreebusyCommand, FREEBUSY_HELP } from "./calendar/freebusy.js";
|
|
6
8
|
import { calendarGetCommand, GET_HELP } from "./calendar/get.js";
|
|
9
|
+
import { calendarRespondCommand, RESPOND_HELP } from "./calendar/respond.js";
|
|
7
10
|
import { calendarSearchCommand, SEARCH_HELP } from "./calendar/search.js";
|
|
11
|
+
import { calendarUpdateCommand, UPDATE_HELP } from "./calendar/update.js";
|
|
8
12
|
const SUBCOMMANDS = [
|
|
9
13
|
{ name: "events", mutation: false, help: EVENTS_HELP, handler: calendarEventsCommand },
|
|
10
14
|
{ name: "get", mutation: false, help: GET_HELP, handler: calendarGetCommand },
|
|
11
15
|
{ name: "calendars", mutation: false, help: CALENDARS_HELP, handler: calendarCalendarsCommand },
|
|
12
16
|
{ name: "search", mutation: false, help: SEARCH_HELP, handler: calendarSearchCommand },
|
|
13
17
|
{ name: "freebusy", mutation: false, help: FREEBUSY_HELP, handler: calendarFreebusyCommand },
|
|
14
|
-
{ name: "create", mutation: true, help:
|
|
15
|
-
{ name: "update", mutation: true, help:
|
|
16
|
-
{ name: "delete", mutation: true, help:
|
|
17
|
-
{ name: "respond", mutation: true, help:
|
|
18
|
+
{ name: "create", mutation: true, help: CREATE_HELP, handler: calendarCreateCommand },
|
|
19
|
+
{ name: "update", mutation: true, help: UPDATE_HELP, handler: calendarUpdateCommand },
|
|
20
|
+
{ name: "delete", mutation: true, help: DELETE_HELP, handler: calendarDeleteCommand },
|
|
21
|
+
{ name: "respond", mutation: true, help: RESPOND_HELP, handler: calendarRespondCommand },
|
|
18
22
|
];
|
|
19
23
|
const SUB_BY_NAME = Object.fromEntries(SUBCOMMANDS.map((s) => [s.name, s]));
|
|
20
24
|
function parseAccountFlag(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/commands/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,qBAAqB,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D,CACF,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gws-axi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "AXI-compliant Google Workspace CLI — token-efficient TOON output, agent-guided auth setup, unified interface for Gmail, Calendar, Docs, Drive, Slides",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|