google-mcp-suite 1.17.0 → 1.18.1
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/ADOPTING.md +2 -2
- package/README.md +5 -5
- package/dist/calendar/entities/AclRole.d.ts +32 -0
- package/dist/calendar/entities/AclRole.d.ts.map +1 -0
- package/dist/calendar/entities/AclRole.js +31 -0
- package/dist/calendar/entities/AclRole.js.map +1 -0
- package/dist/calendar/entities/AclRule.d.ts +38 -0
- package/dist/calendar/entities/AclRule.d.ts.map +1 -0
- package/dist/calendar/entities/AclRule.js +23 -0
- package/dist/calendar/entities/AclRule.js.map +1 -0
- package/dist/calendar/entities/AclScope.d.ts +63 -0
- package/dist/calendar/entities/AclScope.d.ts.map +1 -0
- package/dist/calendar/entities/AclScope.js +54 -0
- package/dist/calendar/entities/AclScope.js.map +1 -0
- package/dist/calendar/entities/CalendarListEntry.d.ts.map +1 -1
- package/dist/calendar/entities/CalendarListEntry.js +2 -1
- package/dist/calendar/entities/CalendarListEntry.js.map +1 -1
- package/dist/calendar/index.js +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/instructions.d.ts.map +1 -1
- package/dist/calendar/instructions.js +9 -1
- package/dist/calendar/instructions.js.map +1 -1
- package/dist/calendar/lib/acl.d.ts +19 -0
- package/dist/calendar/lib/acl.d.ts.map +1 -0
- package/dist/calendar/lib/acl.js +33 -0
- package/dist/calendar/lib/acl.js.map +1 -0
- package/dist/calendar/lib/roles.d.ts +12 -0
- package/dist/calendar/lib/roles.d.ts.map +1 -0
- package/dist/calendar/lib/roles.js +38 -0
- package/dist/calendar/lib/roles.js.map +1 -0
- package/dist/calendar/methods/add_acl_rule/handler.d.ts +5 -0
- package/dist/calendar/methods/add_acl_rule/handler.d.ts.map +1 -0
- package/dist/calendar/methods/add_acl_rule/handler.js +13 -0
- package/dist/calendar/methods/add_acl_rule/handler.js.map +1 -0
- package/dist/calendar/methods/add_acl_rule/index.d.ts +61 -0
- package/dist/calendar/methods/add_acl_rule/index.d.ts.map +1 -0
- package/dist/calendar/methods/add_acl_rule/index.js +35 -0
- package/dist/calendar/methods/add_acl_rule/index.js.map +1 -0
- package/dist/calendar/methods/add_acl_rule/schema.d.ts +47 -0
- package/dist/calendar/methods/add_acl_rule/schema.d.ts.map +1 -0
- package/dist/calendar/methods/add_acl_rule/schema.js +21 -0
- package/dist/calendar/methods/add_acl_rule/schema.js.map +1 -0
- package/dist/calendar/methods/delete_acl_rule/handler.d.ts +5 -0
- package/dist/calendar/methods/delete_acl_rule/handler.d.ts.map +1 -0
- package/dist/calendar/methods/delete_acl_rule/handler.js +6 -0
- package/dist/calendar/methods/delete_acl_rule/handler.js.map +1 -0
- package/dist/calendar/methods/delete_acl_rule/index.d.ts +18 -0
- package/dist/calendar/methods/delete_acl_rule/index.d.ts.map +1 -0
- package/dist/calendar/methods/delete_acl_rule/index.js +26 -0
- package/dist/calendar/methods/delete_acl_rule/index.js.map +1 -0
- package/dist/calendar/methods/delete_acl_rule/schema.d.ts +13 -0
- package/dist/calendar/methods/delete_acl_rule/schema.d.ts.map +1 -0
- package/dist/calendar/methods/delete_acl_rule/schema.js +18 -0
- package/dist/calendar/methods/delete_acl_rule/schema.js.map +1 -0
- package/dist/calendar/methods/get_acl_rule/handler.d.ts +5 -0
- package/dist/calendar/methods/get_acl_rule/handler.d.ts.map +1 -0
- package/dist/calendar/methods/get_acl_rule/handler.js +9 -0
- package/dist/calendar/methods/get_acl_rule/handler.js.map +1 -0
- package/dist/calendar/methods/get_acl_rule/index.d.ts +31 -0
- package/dist/calendar/methods/get_acl_rule/index.d.ts.map +1 -0
- package/dist/calendar/methods/get_acl_rule/index.js +22 -0
- package/dist/calendar/methods/get_acl_rule/index.js.map +1 -0
- package/dist/calendar/methods/get_acl_rule/schema.d.ts +29 -0
- package/dist/calendar/methods/get_acl_rule/schema.d.ts.map +1 -0
- package/dist/calendar/methods/get_acl_rule/schema.js +15 -0
- package/dist/calendar/methods/get_acl_rule/schema.js.map +1 -0
- package/dist/calendar/methods/list_acl_rules/handler.d.ts +5 -0
- package/dist/calendar/methods/list_acl_rules/handler.d.ts.map +1 -0
- package/dist/calendar/methods/list_acl_rules/handler.js +15 -0
- package/dist/calendar/methods/list_acl_rules/handler.js.map +1 -0
- package/dist/calendar/methods/list_acl_rules/index.d.ts +38 -0
- package/dist/calendar/methods/list_acl_rules/index.d.ts.map +1 -0
- package/dist/calendar/methods/list_acl_rules/index.js +24 -0
- package/dist/calendar/methods/list_acl_rules/index.js.map +1 -0
- package/dist/calendar/methods/list_acl_rules/schema.d.ts +38 -0
- package/dist/calendar/methods/list_acl_rules/schema.d.ts.map +1 -0
- package/dist/calendar/methods/list_acl_rules/schema.js +34 -0
- package/dist/calendar/methods/list_acl_rules/schema.js.map +1 -0
- package/dist/calendar/methods/list_event_instances/schema.d.ts.map +1 -1
- package/dist/calendar/methods/list_event_instances/schema.js +2 -1
- package/dist/calendar/methods/list_event_instances/schema.js.map +1 -1
- package/dist/calendar/methods/patch_acl_rule/handler.d.ts +5 -0
- package/dist/calendar/methods/patch_acl_rule/handler.d.ts.map +1 -0
- package/dist/calendar/methods/patch_acl_rule/handler.js +12 -0
- package/dist/calendar/methods/patch_acl_rule/handler.js.map +1 -0
- package/dist/calendar/methods/patch_acl_rule/index.d.ts +62 -0
- package/dist/calendar/methods/patch_acl_rule/index.d.ts.map +1 -0
- package/dist/calendar/methods/patch_acl_rule/index.js +34 -0
- package/dist/calendar/methods/patch_acl_rule/index.js.map +1 -0
- package/dist/calendar/methods/patch_acl_rule/schema.d.ts +48 -0
- package/dist/calendar/methods/patch_acl_rule/schema.d.ts.map +1 -0
- package/dist/calendar/methods/patch_acl_rule/schema.js +23 -0
- package/dist/calendar/methods/patch_acl_rule/schema.js.map +1 -0
- package/dist/calendar/methods/registry.d.ts +195 -0
- package/dist/calendar/methods/registry.d.ts.map +1 -1
- package/dist/calendar/methods/registry.js +20 -0
- package/dist/calendar/methods/registry.js.map +1 -1
- package/dist/calendar/methods/update_acl_rule/handler.d.ts +5 -0
- package/dist/calendar/methods/update_acl_rule/handler.d.ts.map +1 -0
- package/dist/calendar/methods/update_acl_rule/handler.js +12 -0
- package/dist/calendar/methods/update_acl_rule/handler.js.map +1 -0
- package/dist/calendar/methods/update_acl_rule/index.d.ts +71 -0
- package/dist/calendar/methods/update_acl_rule/index.d.ts.map +1 -0
- package/dist/calendar/methods/update_acl_rule/index.js +43 -0
- package/dist/calendar/methods/update_acl_rule/index.js.map +1 -0
- package/dist/calendar/methods/update_acl_rule/schema.d.ts +48 -0
- package/dist/calendar/methods/update_acl_rule/schema.d.ts.map +1 -0
- package/dist/calendar/methods/update_acl_rule/schema.js +23 -0
- package/dist/calendar/methods/update_acl_rule/schema.js.map +1 -0
- package/package.json +3 -3
package/ADOPTING.md
CHANGED
|
@@ -19,8 +19,8 @@ the differences are concrete:
|
|
|
19
19
|
|
|
20
20
|
- **MCP and then some.** The Gmail, Calendar, and Drive servers expose
|
|
21
21
|
Google's curated MCP toolset *plus* the broader REST method surface;
|
|
22
|
-
Sheets and Docs are REST-sourced throughout: [
|
|
23
|
-
across Gmail (33), Calendar (
|
|
22
|
+
Sheets and Docs are REST-sourced throughout: [184 operations](./README.md#services)
|
|
23
|
+
across Gmail (33), Calendar (31), Drive (35), Sheets (76), and Docs (9). Each
|
|
24
24
|
service's `CAPABILITIES.md` enumerates its operations with provenance.
|
|
25
25
|
Built-in connectors document a narrower surface; as of this writing,
|
|
26
26
|
Anthropic documents its claude.ai Gmail connector as searching, reading,
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<strong>Google Workspace MCP servers you can read in an afternoon, one per service.</strong><br />
|
|
17
|
-
The curated <a href="https://modelcontextprotocol.io/">MCP</a> toolset plus the broader REST surface for Gmail, Google Calendar, Google Drive, Google Docs, and Google Sheets, one server per service per account: <strong>
|
|
17
|
+
The curated <a href="https://modelcontextprotocol.io/">MCP</a> toolset plus the broader REST surface for Gmail, Google Calendar, Google Drive, Google Docs, and Google Sheets, one server per service per account: <strong>184 self-describing operations</strong> across five Google services, so an AI agent (Claude, Cursor, or any MCP client) can do (nearly) anything your accounts can, on several accounts at once, and never on the wrong one. Every operation cites its Google reference page and validates input and output; test coverage is pinned at 100%.
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
20
|
<p align="center">
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</p>
|
|
31
31
|
|
|
32
32
|
<p align="center">
|
|
33
|
-
<sub><strong>
|
|
33
|
+
<sub><strong>184 operations</strong> ship today: <strong>Gmail</strong> (<a href="./src/gmail/CAPABILITIES.md">33</a>), <strong>Calendar</strong> (<a href="./src/calendar/CAPABILITIES.md">31</a>), <strong>Sheets</strong> (<a href="./src/sheets/CAPABILITIES.md">76</a>), <strong>Docs</strong> (<a href="./src/docs/CAPABILITIES.md">9</a>), and <strong>Drive</strong> (<a href="./src/drive/CAPABILITIES.md">35</a>).</sub>
|
|
34
34
|
</p>
|
|
35
35
|
|
|
36
36
|
<p align="center"><sub><strong>Replacing a built-in connector?</strong> Hand your agent <a href="./ADOPTING.md">ADOPTING.md</a>: the playbook to adopt, supersede, verify, and decommission.</sub></p>
|
|
@@ -46,7 +46,7 @@ The design has two internal concepts and nothing else:
|
|
|
46
46
|
|
|
47
47
|
That is the whole surface. Read one operation folder and you understand all of them.
|
|
48
48
|
|
|
49
|
-
- **REST plus MCP in one surface.** Each server exposes the curated MCP toolset *and* the broader REST method set of its Google API, so an agent gets far more than a thin slice. Gmail ships with [33 operations](./src/gmail/CAPABILITIES.md) (10 curated MCP tools plus 23 REST methods), Calendar with [
|
|
49
|
+
- **REST plus MCP in one surface.** Each server exposes the curated MCP toolset *and* the broader REST method set of its Google API, so an agent gets far more than a thin slice. Gmail ships with [33 operations](./src/gmail/CAPABILITIES.md) (10 curated MCP tools plus 23 REST methods), Calendar with [31](./src/calendar/CAPABILITIES.md) (8 plus 23), Drive with [35](./src/drive/CAPABILITIES.md) (8 plus 27), Sheets with [76](./src/sheets/CAPABILITIES.md), and Docs with [9](./src/docs/CAPABILITIES.md) (Sheets and Docs are REST-sourced throughout; Google published no MCP toolset for either when they shipped, though previews now exist); the split is explained in [MCP, and then some](#mcp-and-then-some).
|
|
50
50
|
- **The folder tree mirrors Google's docs.** A Google tools-list reference page becomes a `tools/` folder; a Google REST method reference page becomes a `methods/` folder. If you can find the operation in Google's docs, you can find it in this repo.
|
|
51
51
|
|
|
52
52
|
| Google's reference page | This repo's folder |
|
|
@@ -62,7 +62,7 @@ One package, one version: everything compiles into `google-mcp-suite`, which shi
|
|
|
62
62
|
|
|
63
63
|
## MCP, and then some
|
|
64
64
|
|
|
65
|
-
This is an MCP server, and deliberately more than one. Google publishes an MCP toolset for some services, but that toolset is a small slice of what each API can do; you cannot fully instrument an account with it alone. Calendar makes the gap concrete: Google's curated Calendar toolset is 8 tools; the API has
|
|
65
|
+
This is an MCP server, and deliberately more than one. Google publishes an MCP toolset for some services, but that toolset is a small slice of what each API can do; you cannot fully instrument an account with it alone. Calendar makes the gap concrete: Google's curated Calendar toolset is 8 tools; the API has 31 worth having, and this server ships all of them. The goal here is to **fully empower an agent across several Google accounts and services**, so each server exposes two surfaces under one wire protocol:
|
|
66
66
|
|
|
67
67
|
- **`tools/`** mirrors Google's **MCP toolset** reference, verbatim.
|
|
68
68
|
- **`methods/`** covers the broader **REST** reference, the operations the MCP toolset omits.
|
|
@@ -186,7 +186,7 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full task list, [AGENTS.md](./A
|
|
|
186
186
|
| Service | Status | Operations |
|
|
187
187
|
|---|---|---|
|
|
188
188
|
| **Gmail** | ✅ Implemented | [33 operations](./src/gmail/CAPABILITIES.md): threads, messages, drafts, labels, filters, attachments |
|
|
189
|
-
| **Calendar** | ✅ Implemented | [
|
|
189
|
+
| **Calendar** | ✅ Implemented | [31 operations](./src/calendar/CAPABILITIES.md): events, calendars, sharing, free/busy, meeting-time suggestions |
|
|
190
190
|
| **Sheets** | ✅ Implemented | [76 operations](./src/sheets/CAPABILITIES.md): spreadsheets, values, batch and data-filter reads/writes, developer metadata, sheet management, dimension layout and groups, named ranges, formatting, banding and borders, cell content and merges, sorting, filters, data transformations, conditional format rules, data validation, protected ranges, every ordinary-grid chart family, slicers, and embedded-object layout |
|
|
191
191
|
| **Docs** | ✅ Implemented | [9 operations](./src/docs/CAPABILITIES.md): document reads and creation, curated text editing and styling |
|
|
192
192
|
| **Drive** | ✅ Implemented | [35 operations](./src/drive/CAPABILITIES.md): files, search, content, comments, revisions, shared drives |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The level of access an access control rule grants to its scope, from no
|
|
4
|
+
* access at all up to manager access over the calendar's own sharing.
|
|
5
|
+
*
|
|
6
|
+
* `writer` and `writerWithoutPrivateAccess` differ on two axes. The latter
|
|
7
|
+
* reads and writes only the events that are not private, seeing private ones
|
|
8
|
+
* as opaque busy blocks, so it is a narrower grant than its name suggests:
|
|
9
|
+
* the restriction is on writing as well as reading. Only `writer`
|
|
10
|
+
* additionally carries read access to the calendar's own ACLs, which is why
|
|
11
|
+
* listing a calendar's rules needs `writer` or `owner` and a `reader` grant is
|
|
12
|
+
* not enough. `owner` is the escalation to watch, carrying every
|
|
13
|
+
* `writer` permission plus the ability to modify other users' access levels,
|
|
14
|
+
* so a rule granting it hands over control of the calendar's sharing. It is
|
|
15
|
+
* distinct from the calendar's data owner, of which there is exactly one.
|
|
16
|
+
*
|
|
17
|
+
* Ordered least to most access, and sourced from the discovery document
|
|
18
|
+
* rather than the bundled client types, which omit
|
|
19
|
+
* `writerWithoutPrivateAccess`.
|
|
20
|
+
*
|
|
21
|
+
* @see https://developers.google.com/workspace/calendar/api/concepts/sharing
|
|
22
|
+
*/
|
|
23
|
+
export declare const AclRole: z.ZodEnum<{
|
|
24
|
+
freeBusyReader: "freeBusyReader";
|
|
25
|
+
none: "none";
|
|
26
|
+
owner: "owner";
|
|
27
|
+
reader: "reader";
|
|
28
|
+
writer: "writer";
|
|
29
|
+
writerWithoutPrivateAccess: "writerWithoutPrivateAccess";
|
|
30
|
+
}>;
|
|
31
|
+
export type AclRole = z.infer<typeof AclRole>;
|
|
32
|
+
//# sourceMappingURL=AclRole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AclRole.d.ts","sourceRoot":"","sources":["../../../src/calendar/entities/AclRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,OAAO;;;;;;;EAOlB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The level of access an access control rule grants to its scope, from no
|
|
4
|
+
* access at all up to manager access over the calendar's own sharing.
|
|
5
|
+
*
|
|
6
|
+
* `writer` and `writerWithoutPrivateAccess` differ on two axes. The latter
|
|
7
|
+
* reads and writes only the events that are not private, seeing private ones
|
|
8
|
+
* as opaque busy blocks, so it is a narrower grant than its name suggests:
|
|
9
|
+
* the restriction is on writing as well as reading. Only `writer`
|
|
10
|
+
* additionally carries read access to the calendar's own ACLs, which is why
|
|
11
|
+
* listing a calendar's rules needs `writer` or `owner` and a `reader` grant is
|
|
12
|
+
* not enough. `owner` is the escalation to watch, carrying every
|
|
13
|
+
* `writer` permission plus the ability to modify other users' access levels,
|
|
14
|
+
* so a rule granting it hands over control of the calendar's sharing. It is
|
|
15
|
+
* distinct from the calendar's data owner, of which there is exactly one.
|
|
16
|
+
*
|
|
17
|
+
* Ordered least to most access, and sourced from the discovery document
|
|
18
|
+
* rather than the bundled client types, which omit
|
|
19
|
+
* `writerWithoutPrivateAccess`.
|
|
20
|
+
*
|
|
21
|
+
* @see https://developers.google.com/workspace/calendar/api/concepts/sharing
|
|
22
|
+
*/
|
|
23
|
+
export const AclRole = z.enum([
|
|
24
|
+
'none',
|
|
25
|
+
'freeBusyReader',
|
|
26
|
+
'reader',
|
|
27
|
+
'writerWithoutPrivateAccess',
|
|
28
|
+
'writer',
|
|
29
|
+
'owner',
|
|
30
|
+
]);
|
|
31
|
+
//# sourceMappingURL=AclRole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AclRole.js","sourceRoot":"","sources":["../../../src/calendar/entities/AclRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC;IAC5B,MAAM;IACN,gBAAgB;IAChB,QAAQ;IACR,4BAA4B;IAC5B,QAAQ;IACR,OAAO;CACR,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * The level of access an access control rule grants to its scope, from no\n * access at all up to manager access over the calendar's own sharing.\n *\n * `writer` and `writerWithoutPrivateAccess` differ on two axes. The latter\n * reads and writes only the events that are not private, seeing private ones\n * as opaque busy blocks, so it is a narrower grant than its name suggests:\n * the restriction is on writing as well as reading. Only `writer`\n * additionally carries read access to the calendar's own ACLs, which is why\n * listing a calendar's rules needs `writer` or `owner` and a `reader` grant is\n * not enough. `owner` is the escalation to watch, carrying every\n * `writer` permission plus the ability to modify other users' access levels,\n * so a rule granting it hands over control of the calendar's sharing. It is\n * distinct from the calendar's data owner, of which there is exactly one.\n *\n * Ordered least to most access, and sourced from the discovery document\n * rather than the bundled client types, which omit\n * `writerWithoutPrivateAccess`.\n *\n * @see https://developers.google.com/workspace/calendar/api/concepts/sharing\n */\nexport const AclRole = z.enum([\n 'none',\n 'freeBusyReader',\n 'reader',\n 'writerWithoutPrivateAccess',\n 'writer',\n 'owner',\n]);\n\nexport type AclRole = z.infer<typeof AclRole>;\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* One rule on a calendar's access control list: a single grant pairing a
|
|
4
|
+
* role with the scope it is granted to. The rules of a calendar are what
|
|
5
|
+
* "sharing a calendar" consists of.
|
|
6
|
+
*
|
|
7
|
+
* Google spells the rule's own identifier `id` on the resource, while the
|
|
8
|
+
* path parameter that addresses it is `ruleId`; both spellings are kept as
|
|
9
|
+
* their source uses them. The identifier is derived from the scope
|
|
10
|
+
* (`user:someone@example.com`, `domain:example.com`, or the bare `default`),
|
|
11
|
+
* so it can be constructed when the scope is already known rather than
|
|
12
|
+
* looked up.
|
|
13
|
+
*
|
|
14
|
+
* @see https://developers.google.com/workspace/calendar/api/concepts/sharing
|
|
15
|
+
*/
|
|
16
|
+
export declare const AclRule: z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
freeBusyReader: "freeBusyReader";
|
|
20
|
+
none: "none";
|
|
21
|
+
owner: "owner";
|
|
22
|
+
reader: "reader";
|
|
23
|
+
writer: "writer";
|
|
24
|
+
writerWithoutPrivateAccess: "writerWithoutPrivateAccess";
|
|
25
|
+
}>>;
|
|
26
|
+
scope: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"default">;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
type: z.ZodEnum<{
|
|
30
|
+
domain: "domain";
|
|
31
|
+
group: "group";
|
|
32
|
+
user: "user";
|
|
33
|
+
}>;
|
|
34
|
+
value: z.ZodString;
|
|
35
|
+
}, z.core.$strict>], "type">>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type AclRule = z.infer<typeof AclRule>;
|
|
38
|
+
//# sourceMappingURL=AclRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AclRule.d.ts","sourceRoot":"","sources":["../../../src/calendar/entities/AclRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;iBAMlB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AclRole } from './AclRole.js';
|
|
3
|
+
import { AclScope } from './AclScope.js';
|
|
4
|
+
/**
|
|
5
|
+
* One rule on a calendar's access control list: a single grant pairing a
|
|
6
|
+
* role with the scope it is granted to. The rules of a calendar are what
|
|
7
|
+
* "sharing a calendar" consists of.
|
|
8
|
+
*
|
|
9
|
+
* Google spells the rule's own identifier `id` on the resource, while the
|
|
10
|
+
* path parameter that addresses it is `ruleId`; both spellings are kept as
|
|
11
|
+
* their source uses them. The identifier is derived from the scope
|
|
12
|
+
* (`user:someone@example.com`, `domain:example.com`, or the bare `default`),
|
|
13
|
+
* so it can be constructed when the scope is already known rather than
|
|
14
|
+
* looked up.
|
|
15
|
+
*
|
|
16
|
+
* @see https://developers.google.com/workspace/calendar/api/concepts/sharing
|
|
17
|
+
*/
|
|
18
|
+
export const AclRule = z.object({
|
|
19
|
+
id: z.string().describe('Identifier of the access control rule.'),
|
|
20
|
+
role: AclRole.optional().describe('The role assigned to the scope.'),
|
|
21
|
+
scope: AclScope.optional().describe('The extent to which calendar access is granted by this rule.'),
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=AclRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AclRule.js","sourceRoot":"","sources":["../../../src/calendar/entities/AclRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IACjE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACpE,KAAK,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACjC,8DAA8D,CAC/D;CACF,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { AclRole } from './AclRole.js';\nimport { AclScope } from './AclScope.js';\n\n/**\n * One rule on a calendar's access control list: a single grant pairing a\n * role with the scope it is granted to. The rules of a calendar are what\n * \"sharing a calendar\" consists of.\n *\n * Google spells the rule's own identifier `id` on the resource, while the\n * path parameter that addresses it is `ruleId`; both spellings are kept as\n * their source uses them. The identifier is derived from the scope\n * (`user:someone@example.com`, `domain:example.com`, or the bare `default`),\n * so it can be constructed when the scope is already known rather than\n * looked up.\n *\n * @see https://developers.google.com/workspace/calendar/api/concepts/sharing\n */\nexport const AclRule = z.object({\n id: z.string().describe('Identifier of the access control rule.'),\n role: AclRole.optional().describe('The role assigned to the scope.'),\n scope: AclScope.optional().describe(\n 'The extent to which calendar access is granted by this rule.',\n ),\n});\n\nexport type AclRule = z.infer<typeof AclRule>;\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The scope types that name a principal, and so require a value. The union's
|
|
4
|
+
* named branch is built from this rather than repeating the list, so a new
|
|
5
|
+
* scope type cannot be accepted on input while the output projection silently
|
|
6
|
+
* drops it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NamedAclScopeType: z.ZodEnum<{
|
|
9
|
+
domain: "domain";
|
|
10
|
+
group: "group";
|
|
11
|
+
user: "user";
|
|
12
|
+
}>;
|
|
13
|
+
export type NamedAclScopeType = z.infer<typeof NamedAclScopeType>;
|
|
14
|
+
/**
|
|
15
|
+
* The kinds of principal a sharing rule can name, the public scope included.
|
|
16
|
+
*
|
|
17
|
+
* Exported separately from AclScope because AclScope is a union and so has no
|
|
18
|
+
* single `shape` to read the type list from; the projection narrows against
|
|
19
|
+
* this (EXTENDING.md, "Enum policy": the allowed list derives from the entity).
|
|
20
|
+
* Derived from NamedAclScopeType so the two stay one vocabulary.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AclScopeType: z.ZodEnum<{
|
|
23
|
+
default: "default";
|
|
24
|
+
domain: "domain";
|
|
25
|
+
group: "group";
|
|
26
|
+
user: "user";
|
|
27
|
+
}>;
|
|
28
|
+
export type AclScopeType = z.infer<typeof AclScopeType>;
|
|
29
|
+
/**
|
|
30
|
+
* The extent to which calendar access is granted by an access control rule:
|
|
31
|
+
* who the rule is about.
|
|
32
|
+
*
|
|
33
|
+
* A discriminated union rather than one object with an optional `value`,
|
|
34
|
+
* because the two shapes genuinely differ: `default` is the public scope and
|
|
35
|
+
* takes no value, while `user`, `group`, and `domain` each name a principal
|
|
36
|
+
* and require one. Modeling it as a union is what makes the emitted JSON
|
|
37
|
+
* Schema (`oneOf`, each branch with its own `required`) match what the server
|
|
38
|
+
* actually accepts; a refinement would validate at runtime but advertise the
|
|
39
|
+
* wider shape to every MCP client, so an agent would build a call the schema
|
|
40
|
+
* told it was legal and then be rejected.
|
|
41
|
+
*
|
|
42
|
+
* The pairing is enforced rather than merely documented because Google does
|
|
43
|
+
* not enforce it, and its failure mode is severe: sending a value alongside
|
|
44
|
+
* type `default` is accepted, the value is discarded for
|
|
45
|
+
* `__public_principal__`, and the calendar becomes public. Verified against
|
|
46
|
+
* the live API, not inferred.
|
|
47
|
+
*
|
|
48
|
+
* Both branches are strict, per EXTENDING.md's strict-input rule.
|
|
49
|
+
*
|
|
50
|
+
* @see https://developers.google.com/workspace/calendar/api/concepts/sharing
|
|
51
|
+
*/
|
|
52
|
+
export declare const AclScope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"default">;
|
|
54
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
55
|
+
type: z.ZodEnum<{
|
|
56
|
+
domain: "domain";
|
|
57
|
+
group: "group";
|
|
58
|
+
user: "user";
|
|
59
|
+
}>;
|
|
60
|
+
value: z.ZodString;
|
|
61
|
+
}, z.core.$strict>], "type">;
|
|
62
|
+
export type AclScope = z.infer<typeof AclScope>;
|
|
63
|
+
//# sourceMappingURL=AclScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AclScope.d.ts","sourceRoot":"","sources":["../../../src/calendar/entities/AclScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAAsC,CAAC;AAErE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;EAAoD,CAAC;AAE9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;4BAgBnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The scope types that name a principal, and so require a value. The union's
|
|
4
|
+
* named branch is built from this rather than repeating the list, so a new
|
|
5
|
+
* scope type cannot be accepted on input while the output projection silently
|
|
6
|
+
* drops it.
|
|
7
|
+
*/
|
|
8
|
+
export const NamedAclScopeType = z.enum(['user', 'group', 'domain']);
|
|
9
|
+
/**
|
|
10
|
+
* The kinds of principal a sharing rule can name, the public scope included.
|
|
11
|
+
*
|
|
12
|
+
* Exported separately from AclScope because AclScope is a union and so has no
|
|
13
|
+
* single `shape` to read the type list from; the projection narrows against
|
|
14
|
+
* this (EXTENDING.md, "Enum policy": the allowed list derives from the entity).
|
|
15
|
+
* Derived from NamedAclScopeType so the two stay one vocabulary.
|
|
16
|
+
*/
|
|
17
|
+
export const AclScopeType = z.enum(['default', ...NamedAclScopeType.options]);
|
|
18
|
+
/**
|
|
19
|
+
* The extent to which calendar access is granted by an access control rule:
|
|
20
|
+
* who the rule is about.
|
|
21
|
+
*
|
|
22
|
+
* A discriminated union rather than one object with an optional `value`,
|
|
23
|
+
* because the two shapes genuinely differ: `default` is the public scope and
|
|
24
|
+
* takes no value, while `user`, `group`, and `domain` each name a principal
|
|
25
|
+
* and require one. Modeling it as a union is what makes the emitted JSON
|
|
26
|
+
* Schema (`oneOf`, each branch with its own `required`) match what the server
|
|
27
|
+
* actually accepts; a refinement would validate at runtime but advertise the
|
|
28
|
+
* wider shape to every MCP client, so an agent would build a call the schema
|
|
29
|
+
* told it was legal and then be rejected.
|
|
30
|
+
*
|
|
31
|
+
* The pairing is enforced rather than merely documented because Google does
|
|
32
|
+
* not enforce it, and its failure mode is severe: sending a value alongside
|
|
33
|
+
* type `default` is accepted, the value is discarded for
|
|
34
|
+
* `__public_principal__`, and the calendar becomes public. Verified against
|
|
35
|
+
* the live API, not inferred.
|
|
36
|
+
*
|
|
37
|
+
* Both branches are strict, per EXTENDING.md's strict-input rule.
|
|
38
|
+
*
|
|
39
|
+
* @see https://developers.google.com/workspace/calendar/api/concepts/sharing
|
|
40
|
+
*/
|
|
41
|
+
export const AclScope = z.discriminatedUnion('type', [
|
|
42
|
+
z.strictObject({
|
|
43
|
+
type: z
|
|
44
|
+
.literal('default')
|
|
45
|
+
.describe('The public scope: access is granted to any user, authenticated or not.'),
|
|
46
|
+
}),
|
|
47
|
+
z.strictObject({
|
|
48
|
+
type: NamedAclScopeType.describe('The type of the scope: a single user, a group, or a whole domain.'),
|
|
49
|
+
value: z
|
|
50
|
+
.string()
|
|
51
|
+
.describe('The email address of a user or group, or the name of a domain, depending on the scope type.'),
|
|
52
|
+
}),
|
|
53
|
+
]);
|
|
54
|
+
//# sourceMappingURL=AclScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AclScope.js","sourceRoot":"","sources":["../../../src/calendar/entities/AclScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAIrE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AAI9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACnD,CAAC,CAAC,YAAY,CAAC;QACb,IAAI,EAAE,CAAC;aACJ,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CAAC,wEAAwE,CAAC;KACtF,CAAC;IACF,CAAC,CAAC,YAAY,CAAC;QACb,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAC9B,mEAAmE,CACpE;QACD,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,CACP,6FAA6F,CAC9F;KACJ,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * The scope types that name a principal, and so require a value. The union's\n * named branch is built from this rather than repeating the list, so a new\n * scope type cannot be accepted on input while the output projection silently\n * drops it.\n */\nexport const NamedAclScopeType = z.enum(['user', 'group', 'domain']);\n\nexport type NamedAclScopeType = z.infer<typeof NamedAclScopeType>;\n\n/**\n * The kinds of principal a sharing rule can name, the public scope included.\n *\n * Exported separately from AclScope because AclScope is a union and so has no\n * single `shape` to read the type list from; the projection narrows against\n * this (EXTENDING.md, \"Enum policy\": the allowed list derives from the entity).\n * Derived from NamedAclScopeType so the two stay one vocabulary.\n */\nexport const AclScopeType = z.enum(['default', ...NamedAclScopeType.options]);\n\nexport type AclScopeType = z.infer<typeof AclScopeType>;\n\n/**\n * The extent to which calendar access is granted by an access control rule:\n * who the rule is about.\n *\n * A discriminated union rather than one object with an optional `value`,\n * because the two shapes genuinely differ: `default` is the public scope and\n * takes no value, while `user`, `group`, and `domain` each name a principal\n * and require one. Modeling it as a union is what makes the emitted JSON\n * Schema (`oneOf`, each branch with its own `required`) match what the server\n * actually accepts; a refinement would validate at runtime but advertise the\n * wider shape to every MCP client, so an agent would build a call the schema\n * told it was legal and then be rejected.\n *\n * The pairing is enforced rather than merely documented because Google does\n * not enforce it, and its failure mode is severe: sending a value alongside\n * type `default` is accepted, the value is discarded for\n * `__public_principal__`, and the calendar becomes public. Verified against\n * the live API, not inferred.\n *\n * Both branches are strict, per EXTENDING.md's strict-input rule.\n *\n * @see https://developers.google.com/workspace/calendar/api/concepts/sharing\n */\nexport const AclScope = z.discriminatedUnion('type', [\n z.strictObject({\n type: z\n .literal('default')\n .describe('The public scope: access is granted to any user, authenticated or not.'),\n }),\n z.strictObject({\n type: NamedAclScopeType.describe(\n 'The type of the scope: a single user, a group, or a whole domain.',\n ),\n value: z\n .string()\n .describe(\n 'The email address of a user or group, or the name of a domain, depending on the scope type.',\n ),\n }),\n]);\n\nexport type AclScope = z.infer<typeof AclScope>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarListEntry.d.ts","sourceRoot":"","sources":["../../../src/calendar/entities/CalendarListEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"CalendarListEntry.d.ts","sourceRoot":"","sources":["../../../src/calendar/entities/CalendarListEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iBAqD5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { EFFECTIVE_ROLES, listRoles } from '../lib/roles.js';
|
|
2
3
|
import { Reminder } from './Reminder.js';
|
|
3
4
|
/**
|
|
4
5
|
* A calendar as it appears on the user's calendar list: the per-user view
|
|
@@ -30,7 +31,7 @@ export const CalendarListEntry = z.object({
|
|
|
30
31
|
accessRole: z
|
|
31
32
|
.string()
|
|
32
33
|
.optional()
|
|
33
|
-
.describe(
|
|
34
|
+
.describe(`The user's effective access role on this calendar. One of: ${listRoles(EFFECTIVE_ROLES)}.`),
|
|
34
35
|
colorId: z
|
|
35
36
|
.string()
|
|
36
37
|
.optional()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarListEntry.js","sourceRoot":"","sources":["../../../src/calendar/entities/CalendarListEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACjE,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,8EAA8E,CAAC;IAC3F,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC3E,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IACrE,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,oEAAoE,CAAC;IACjF,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"CalendarListEntry.js","sourceRoot":"","sources":["../../../src/calendar/entities/CalendarListEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACjE,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,8EAA8E,CAAC;IAC3F,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC3E,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IACrE,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,oEAAoE,CAAC;IACjF,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,8DAA8D,SAAS,CAAC,eAAe,CAAC,GAAG,CAC5F;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,0GAA0G,CAC3G;IACH,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yFAAyF,CAC1F;IACH,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,+FAA+F,CAChG;IACH,MAAM,EAAE,CAAC;SACN,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,8EAA8E,CAAC;IAC3F,QAAQ,EAAE,CAAC;SACR,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,2DAA2D,CAAC;IACxE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACxF,gBAAgB,EAAE,CAAC;SAChB,KAAK,CAAC,QAAQ,CAAC;SACf,QAAQ,EAAE;SACV,QAAQ,CAAC,uDAAuD,CAAC;CACrE,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { EFFECTIVE_ROLES, listRoles } from '../lib/roles.js';\nimport { Reminder } from './Reminder.js';\n\n/**\n * A calendar as it appears on the user's calendar list: the per-user view\n * (title override, colors, visibility, access role, default reminders)\n * layered on top of a calendar. Distinct from entities/Calendar, the\n * calendar's own metadata.\n *\n * Field docs use `.describe()` so they reach the wire JSON Schema an MCP\n * client reads.\n *\n * @see https://developers.google.com/workspace/calendar/api/v3/reference/calendarList\n */\nexport const CalendarListEntry = z.object({\n id: z.string().describe('Identifier of the calendar.'),\n summary: z.string().optional().describe('Title of the calendar.'),\n summaryOverride: z\n .string()\n .optional()\n .describe(\"The title the user has set for this calendar, overriding the calendar's own.\"),\n description: z.string().optional().describe('Description of the calendar.'),\n location: z\n .string()\n .optional()\n .describe('Geographic location of the calendar as free-form text.'),\n timeZone: z\n .string()\n .optional()\n .describe('The time zone of the calendar, as an IANA Time Zone Database name.'),\n accessRole: z\n .string()\n .optional()\n .describe(\n `The user's effective access role on this calendar. One of: ${listRoles(EFFECTIVE_ROLES)}.`,\n ),\n colorId: z\n .string()\n .optional()\n .describe(\n 'The color of the calendar: an ID referring to an entry in the calendar section of the colors definition.',\n ),\n backgroundColor: z\n .string()\n .optional()\n .describe(\n 'The main color of the calendar in the hexadecimal format \"#0088aa\"; supersedes colorId.',\n ),\n foregroundColor: z\n .string()\n .optional()\n .describe(\n 'The foreground color of the calendar in the hexadecimal format \"#ffffff\"; supersedes colorId.',\n ),\n hidden: z\n .boolean()\n .optional()\n .describe('Whether the calendar has been hidden from the list. Only returned when true.'),\n selected: z\n .boolean()\n .optional()\n .describe('Whether the calendar content shows up in the calendar UI.'),\n primary: z.boolean().optional().describe(\"Whether this is the user's primary calendar.\"),\n defaultReminders: z\n .array(Reminder)\n .optional()\n .describe('The default reminders the user has for this calendar.'),\n});\n\nexport type CalendarListEntry = z.infer<typeof CalendarListEntry>;\n"]}
|
package/dist/calendar/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { tools } from './tools/registry.js';
|
|
|
14
14
|
await server({
|
|
15
15
|
name: 'calendar',
|
|
16
16
|
title: 'Google Calendar (google-mcp-suite)',
|
|
17
|
-
description: 'Per-account Google Calendar MCP server: events, calendars, free/busy, and meeting-time suggestions.',
|
|
17
|
+
description: 'Per-account Google Calendar MCP server: events, calendars, sharing, free/busy, and meeting-time suggestions.',
|
|
18
18
|
instructions,
|
|
19
19
|
operations: mergeOperations(tools, methods),
|
|
20
20
|
client: async (account) => calendar({ version: 'v3', auth: await authorizedClient(account) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/calendar/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,iFAAiF;AACjF,oFAAoF;AACpF,qFAAqF;AACrF,gFAAgF;AAChF,8DAA8D;AAC9D,MAAM,MAAM,CAAC;IACX,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,oCAAoC;IAC3C,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/calendar/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,iFAAiF;AACjF,oFAAoF;AACpF,qFAAqF;AACrF,gFAAgF;AAChF,8DAA8D;AAC9D,MAAM,MAAM,CAAC;IACX,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,oCAAoC;IAC3C,WAAW,EACT,8GAA8G;IAChH,YAAY;IACZ,UAAU,EAAE,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC;IAC3C,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7F,OAAO,EAAE,WAAW;IACpB,gBAAgB,EAAE,cAAc;CACjC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { calendar } from '@googleapis/calendar';\nimport { authorizedClient, isInvalidGrant, runAuthFlow } from '../auth/oauth.js';\nimport { mergeOperations } from '../lib/operation.js';\nimport { server } from '../lib/server.js';\nimport { instructions } from './instructions.js';\nimport { methods } from './methods/registry.js';\nimport { tools } from './tools/registry.js';\n\n// Cloning this for a new service? Add that service's OAuth scopes to `SCOPES` in\n// src/auth/config.ts BEFORE the first auth. The scope union is front-loaded so each\n// account consents once, and Google only re-issues a refresh token on a fresh grant;\n// adding a scope later forces re-consent of every account. Nothing in this file\n// references scopes, which is exactly why it is easy to miss.\nawait server({\n name: 'calendar',\n title: 'Google Calendar (google-mcp-suite)',\n description:\n 'Per-account Google Calendar MCP server: events, calendars, sharing, free/busy, and meeting-time suggestions.',\n instructions,\n operations: mergeOperations(tools, methods),\n client: async (account) => calendar({ version: 'v3', auth: await authorizedClient(account) }),\n runAuth: runAuthFlow,\n staleCredentials: isInvalidGrant,\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/calendar/instructions.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/calendar/instructions.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,QAoByC,CAAC"}
|
|
@@ -15,5 +15,13 @@ export const instructions = identityInstructions('Google account') +
|
|
|
15
15
|
'attendees can email guests, controlled by notificationLevel on tools and ' +
|
|
16
16
|
'sendUpdates on methods. suggest_time refuses to answer, rather than ' +
|
|
17
17
|
"proposing slots that may conflict, when any requested calendar's " +
|
|
18
|
-
'free/busy is unreadable.'
|
|
18
|
+
'free/busy is unreadable. Calendar sharing is a list of access control ' +
|
|
19
|
+
'rules, read with list_acl_rules and get_acl_rule and changed with ' +
|
|
20
|
+
'add_acl_rule, update_acl_rule, patch_acl_rule, and delete_acl_rule. ' +
|
|
21
|
+
'A rule ID derives from its scope, and granting owner lets that scope ' +
|
|
22
|
+
"change the calendar's own sharing. The three writes other than " +
|
|
23
|
+
'delete_acl_rule take sendNotifications, which Google enables by default, ' +
|
|
24
|
+
'so sharing notifications remain enabled unless it is passed as false; ' +
|
|
25
|
+
'access removal never notifies. A scope of type default is the public ' +
|
|
26
|
+
'scope and carries no value, while the other types require one.';
|
|
19
27
|
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/calendar/instructions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,YAAY,GACvB,oBAAoB,CAAC,gBAAgB,CAAC;IACtC,sBAAsB,CAAC;QACrB,KAAK,EAAE,wCAAwC;QAC/C,OAAO,EAAE,kCAAkC;KAC5C,CAAC;IACF,4BAA4B,EAAE;IAC9B,qEAAqE;IACrE,wEAAwE;IACxE,2EAA2E;IAC3E,sEAAsE;IACtE,mEAAmE;IACnE,
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/calendar/instructions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,YAAY,GACvB,oBAAoB,CAAC,gBAAgB,CAAC;IACtC,sBAAsB,CAAC;QACrB,KAAK,EAAE,wCAAwC;QAC/C,OAAO,EAAE,kCAAkC;KAC5C,CAAC;IACF,4BAA4B,EAAE;IAC9B,qEAAqE;IACrE,wEAAwE;IACxE,2EAA2E;IAC3E,sEAAsE;IACtE,mEAAmE;IACnE,wEAAwE;IACxE,oEAAoE;IACpE,sEAAsE;IACtE,uEAAuE;IACvE,iEAAiE;IACjE,2EAA2E;IAC3E,wEAAwE;IACxE,uEAAuE;IACvE,gEAAgE,CAAC","sourcesContent":["/**\n * Served in the MCP initialize result; see `ServerOptions.instructions` in\n * src/lib/server.ts. A standalone module so tests can pin the content without\n * booting the server (index.ts's import side effect is `await server()`).\n */\nimport {\n identityInstructions,\n untrustedContentInstructions,\n vocabularyInstructions,\n} from '../lib/instructions.js';\n\nexport const instructions =\n identityInstructions('Google account') +\n vocabularyInstructions({\n tools: 'startTime, pageSize, notificationLevel',\n methods: 'timeMin, maxResults, sendUpdates',\n }) +\n untrustedContentInstructions() +\n 'Event start and end take exactly one of date (all-day) or dateTime ' +\n '(timed); timeZone is required for recurring events. Writes that touch ' +\n 'attendees can email guests, controlled by notificationLevel on tools and ' +\n 'sendUpdates on methods. suggest_time refuses to answer, rather than ' +\n \"proposing slots that may conflict, when any requested calendar's \" +\n 'free/busy is unreadable. Calendar sharing is a list of access control ' +\n 'rules, read with list_acl_rules and get_acl_rule and changed with ' +\n 'add_acl_rule, update_acl_rule, patch_acl_rule, and delete_acl_rule. ' +\n 'A rule ID derives from its scope, and granting owner lets that scope ' +\n \"change the calendar's own sharing. The three writes other than \" +\n 'delete_acl_rule take sendNotifications, which Google enables by default, ' +\n 'so sharing notifications remain enabled unless it is passed as false; ' +\n 'access removal never notifies. A scope of type default is the public ' +\n 'scope and carries no value, while the other types require one.';\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { calendar_v3 } from '@googleapis/calendar';
|
|
2
|
+
import type { AclRule } from '../entities/AclRule.js';
|
|
3
|
+
/**
|
|
4
|
+
* Project a REST ACL rule onto the AclRule shape, cleaning nulls to
|
|
5
|
+
* undefined and narrowing the output enums (EXTENDING.md, "Enum policy").
|
|
6
|
+
*
|
|
7
|
+
* `type` discriminates AclScope, so an unrecognized type drops the whole scope
|
|
8
|
+
* rather than emitting a scope that matches neither branch: the field goes
|
|
9
|
+
* absent instead of the object going malformed. A caller that sees a rule with
|
|
10
|
+
* a role but no scope is looking at a scope type this surface predates.
|
|
11
|
+
*
|
|
12
|
+
* The scope is also normalized onto whichever branch it belongs to, so a
|
|
13
|
+
* projection can never produce a rule that fails its own schema: `default`
|
|
14
|
+
* drops the `__public_principal__` value Google reports, and a named type
|
|
15
|
+
* arriving without one drops the scope on the same "absent, never wrong"
|
|
16
|
+
* ground as an unknown type.
|
|
17
|
+
*/
|
|
18
|
+
export declare function projectAclRule(data: calendar_v3.Schema$AclRule): AclRule;
|
|
19
|
+
//# sourceMappingURL=acl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acl.d.ts","sourceRoot":"","sources":["../../../src/calendar/lib/acl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,cAAc,GAAG,OAAO,CAMxE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { narrow } from '../../lib/utils/narrow.js';
|
|
2
|
+
import { AclRole } from '../entities/AclRole.js';
|
|
3
|
+
import { AclScopeType } from '../entities/AclScope.js';
|
|
4
|
+
/**
|
|
5
|
+
* Project a REST ACL rule onto the AclRule shape, cleaning nulls to
|
|
6
|
+
* undefined and narrowing the output enums (EXTENDING.md, "Enum policy").
|
|
7
|
+
*
|
|
8
|
+
* `type` discriminates AclScope, so an unrecognized type drops the whole scope
|
|
9
|
+
* rather than emitting a scope that matches neither branch: the field goes
|
|
10
|
+
* absent instead of the object going malformed. A caller that sees a rule with
|
|
11
|
+
* a role but no scope is looking at a scope type this surface predates.
|
|
12
|
+
*
|
|
13
|
+
* The scope is also normalized onto whichever branch it belongs to, so a
|
|
14
|
+
* projection can never produce a rule that fails its own schema: `default`
|
|
15
|
+
* drops the `__public_principal__` value Google reports, and a named type
|
|
16
|
+
* arriving without one drops the scope on the same "absent, never wrong"
|
|
17
|
+
* ground as an unknown type.
|
|
18
|
+
*/
|
|
19
|
+
export function projectAclRule(data) {
|
|
20
|
+
return {
|
|
21
|
+
id: data.id ?? '',
|
|
22
|
+
role: narrow(data.role, AclRole.options),
|
|
23
|
+
scope: projectAclScope(narrow(data.scope?.type, AclScopeType.options), data.scope?.value),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function projectAclScope(type, value) {
|
|
27
|
+
if (type === undefined)
|
|
28
|
+
return undefined;
|
|
29
|
+
if (type === 'default')
|
|
30
|
+
return { type };
|
|
31
|
+
return value === undefined || value === null ? undefined : { type, value };
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=acl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acl.js","sourceRoot":"","sources":["../../../src/calendar/lib/acl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAiB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAAC,IAAgC;IAC7D,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC;QACxC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;KAC1F,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CACtB,IAA8B,EAC9B,KAAgC;IAEhC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACxC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7E,CAAC","sourcesContent":["import type { calendar_v3 } from '@googleapis/calendar';\nimport { narrow } from '../../lib/utils/narrow.js';\nimport { AclRole } from '../entities/AclRole.js';\nimport type { AclRule } from '../entities/AclRule.js';\nimport { type AclScope, AclScopeType } from '../entities/AclScope.js';\n\n/**\n * Project a REST ACL rule onto the AclRule shape, cleaning nulls to\n * undefined and narrowing the output enums (EXTENDING.md, \"Enum policy\").\n *\n * `type` discriminates AclScope, so an unrecognized type drops the whole scope\n * rather than emitting a scope that matches neither branch: the field goes\n * absent instead of the object going malformed. A caller that sees a rule with\n * a role but no scope is looking at a scope type this surface predates.\n *\n * The scope is also normalized onto whichever branch it belongs to, so a\n * projection can never produce a rule that fails its own schema: `default`\n * drops the `__public_principal__` value Google reports, and a named type\n * arriving without one drops the scope on the same \"absent, never wrong\"\n * ground as an unknown type.\n */\nexport function projectAclRule(data: calendar_v3.Schema$AclRule): AclRule {\n return {\n id: data.id ?? '',\n role: narrow(data.role, AclRole.options),\n scope: projectAclScope(narrow(data.scope?.type, AclScopeType.options), data.scope?.value),\n };\n}\n\nfunction projectAclScope(\n type: AclScopeType | undefined,\n value: string | null | undefined,\n): AclScope | undefined {\n if (type === undefined) return undefined;\n if (type === 'default') return { type };\n return value === undefined || value === null ? undefined : { type, value };\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AclRole } from '../entities/AclRole.js';
|
|
2
|
+
/** `none, freeBusyReader, reader, ...`: the bare vocabulary, in order. */
|
|
3
|
+
export declare function listRoles(roles?: readonly AclRole[]): string;
|
|
4
|
+
/** `none (no access), freeBusyReader (free/busy only), ...`: each role glossed. */
|
|
5
|
+
export declare function describeRoles(roles?: readonly AclRole[]): string;
|
|
6
|
+
/**
|
|
7
|
+
* The roles that can appear as an effective `accessRole` on a calendar you can
|
|
8
|
+
* already see. `none` cannot: a calendar on your list grants at least
|
|
9
|
+
* free/busy.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EFFECTIVE_ROLES: readonly AclRole[];
|
|
12
|
+
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/calendar/lib/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAwBjD,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,KAAK,GAAE,SAAS,OAAO,EAAoB,GAAG,MAAM,CAE7E;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,KAAK,GAAE,SAAS,OAAO,EAAoB,GAAG,MAAM,CAIjF;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EAE7C,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AclRole } from '../entities/AclRole.js';
|
|
2
|
+
/**
|
|
3
|
+
* What each access role actually grants, in one clause, sourced from Google's
|
|
4
|
+
* calendar-sharing concepts page.
|
|
5
|
+
*
|
|
6
|
+
* Keyed by `AclRole`, so adding a role to the enum without describing it here
|
|
7
|
+
* is a compile error rather than prose that silently goes stale. That matters
|
|
8
|
+
* because the vocabulary is restated on four agent-facing surfaces, and the
|
|
9
|
+
* last role Google added reached the enum while every description kept the old
|
|
10
|
+
* list.
|
|
11
|
+
*
|
|
12
|
+
* @see https://developers.google.com/workspace/calendar/api/concepts/sharing
|
|
13
|
+
*/
|
|
14
|
+
const ROLE_GLOSS = {
|
|
15
|
+
none: 'no access',
|
|
16
|
+
freeBusyReader: 'free/busy only',
|
|
17
|
+
reader: 'event details, with private events hidden',
|
|
18
|
+
writerWithoutPrivateAccess: 'read and write only the events that are not private, seeing private ones as busy blocks',
|
|
19
|
+
writer: "read and write everything, plus read access to the calendar's own sharing",
|
|
20
|
+
owner: "everything writer grants, plus the ability to change other users' access",
|
|
21
|
+
};
|
|
22
|
+
/** `none, freeBusyReader, reader, ...`: the bare vocabulary, in order. */
|
|
23
|
+
export function listRoles(roles = AclRole.options) {
|
|
24
|
+
return roles.join(', ');
|
|
25
|
+
}
|
|
26
|
+
/** `none (no access), freeBusyReader (free/busy only), ...`: each role glossed. */
|
|
27
|
+
export function describeRoles(roles = AclRole.options) {
|
|
28
|
+
const described = roles.map((role) => `${role} (${ROLE_GLOSS[role]})`);
|
|
29
|
+
const last = described.pop();
|
|
30
|
+
return described.length > 0 ? `${described.join(', ')}, or ${last}` : `${last}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The roles that can appear as an effective `accessRole` on a calendar you can
|
|
34
|
+
* already see. `none` cannot: a calendar on your list grants at least
|
|
35
|
+
* free/busy.
|
|
36
|
+
*/
|
|
37
|
+
export const EFFECTIVE_ROLES = AclRole.options.filter((role) => role !== 'none');
|
|
38
|
+
//# sourceMappingURL=roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../../src/calendar/lib/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,GAA4B;IAC1C,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,gBAAgB;IAChC,MAAM,EAAE,2CAA2C;IACnD,0BAA0B,EACxB,yFAAyF;IAC3F,MAAM,EAAE,2EAA2E;IACnF,KAAK,EAAE,0EAA0E;CAClF,CAAC;AAEF,0EAA0E;AAC1E,MAAM,UAAU,SAAS,CAAC,KAAK,GAAuB,OAAO,CAAC,OAAO;IACnE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,aAAa,CAAC,KAAK,GAAuB,OAAO,CAAC,OAAO;IACvE,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvE,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;IAC7B,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC;AAClF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAuB,OAAO,CAAC,OAAO,CAAC,MAAM,CACvE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,MAAM,CAC1B,CAAC","sourcesContent":["import { AclRole } from '../entities/AclRole.js';\n\n/**\n * What each access role actually grants, in one clause, sourced from Google's\n * calendar-sharing concepts page.\n *\n * Keyed by `AclRole`, so adding a role to the enum without describing it here\n * is a compile error rather than prose that silently goes stale. That matters\n * because the vocabulary is restated on four agent-facing surfaces, and the\n * last role Google added reached the enum while every description kept the old\n * list.\n *\n * @see https://developers.google.com/workspace/calendar/api/concepts/sharing\n */\nconst ROLE_GLOSS: Record<AclRole, string> = {\n none: 'no access',\n freeBusyReader: 'free/busy only',\n reader: 'event details, with private events hidden',\n writerWithoutPrivateAccess:\n 'read and write only the events that are not private, seeing private ones as busy blocks',\n writer: \"read and write everything, plus read access to the calendar's own sharing\",\n owner: \"everything writer grants, plus the ability to change other users' access\",\n};\n\n/** `none, freeBusyReader, reader, ...`: the bare vocabulary, in order. */\nexport function listRoles(roles: readonly AclRole[] = AclRole.options): string {\n return roles.join(', ');\n}\n\n/** `none (no access), freeBusyReader (free/busy only), ...`: each role glossed. */\nexport function describeRoles(roles: readonly AclRole[] = AclRole.options): string {\n const described = roles.map((role) => `${role} (${ROLE_GLOSS[role]})`);\n const last = described.pop();\n return described.length > 0 ? `${described.join(', ')}, or ${last}` : `${last}`;\n}\n\n/**\n * The roles that can appear as an effective `accessRole` on a calendar you can\n * already see. `none` cannot: a calendar on your list grants at least\n * free/busy.\n */\nexport const EFFECTIVE_ROLES: readonly AclRole[] = AclRole.options.filter(\n (role) => role !== 'none',\n);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { calendar_v3 } from '@googleapis/calendar';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { schema } from './schema.js';
|
|
4
|
+
export declare function handler(calendar: calendar_v3.Calendar, args: z.infer<typeof schema.input>): Promise<z.infer<typeof schema.output>>;
|
|
5
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/calendar/methods/add_acl_rule/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAC9B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAWxC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { forGoogle } from '../../../lib/optionality.js';
|
|
2
|
+
import { projectAclRule } from '../../lib/acl.js';
|
|
3
|
+
export async function handler(calendar, args) {
|
|
4
|
+
const { data } = await calendar.acl.insert(forGoogle({
|
|
5
|
+
calendarId: args.calendarId ?? 'primary',
|
|
6
|
+
sendNotifications: args.sendNotifications,
|
|
7
|
+
// The scope union guarantees the type/value pairing Google accepts but
|
|
8
|
+
// does not enforce, so it crosses the boundary as it stands.
|
|
9
|
+
requestBody: { role: args.role, scope: args.scope },
|
|
10
|
+
}));
|
|
11
|
+
return projectAclRule(data);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=handler.js.map
|