google-mcp-suite 1.16.0 → 1.18.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.
Files changed (111) hide show
  1. package/ADOPTING.md +2 -2
  2. package/README.md +5 -5
  3. package/dist/calendar/entities/AclRole.d.ts +31 -0
  4. package/dist/calendar/entities/AclRole.d.ts.map +1 -0
  5. package/dist/calendar/entities/AclRole.js +30 -0
  6. package/dist/calendar/entities/AclRole.js.map +1 -0
  7. package/dist/calendar/entities/AclRule.d.ts +38 -0
  8. package/dist/calendar/entities/AclRule.d.ts.map +1 -0
  9. package/dist/calendar/entities/AclRule.js +23 -0
  10. package/dist/calendar/entities/AclRule.js.map +1 -0
  11. package/dist/calendar/entities/AclScope.d.ts +50 -0
  12. package/dist/calendar/entities/AclScope.d.ts.map +1 -0
  13. package/dist/calendar/entities/AclScope.js +48 -0
  14. package/dist/calendar/entities/AclScope.js.map +1 -0
  15. package/dist/calendar/instructions.d.ts.map +1 -1
  16. package/dist/calendar/instructions.js +9 -1
  17. package/dist/calendar/instructions.js.map +1 -1
  18. package/dist/calendar/lib/acl.d.ts +19 -0
  19. package/dist/calendar/lib/acl.d.ts.map +1 -0
  20. package/dist/calendar/lib/acl.js +33 -0
  21. package/dist/calendar/lib/acl.js.map +1 -0
  22. package/dist/calendar/methods/add_acl_rule/handler.d.ts +5 -0
  23. package/dist/calendar/methods/add_acl_rule/handler.d.ts.map +1 -0
  24. package/dist/calendar/methods/add_acl_rule/handler.js +13 -0
  25. package/dist/calendar/methods/add_acl_rule/handler.js.map +1 -0
  26. package/dist/calendar/methods/add_acl_rule/index.d.ts +60 -0
  27. package/dist/calendar/methods/add_acl_rule/index.d.ts.map +1 -0
  28. package/dist/calendar/methods/add_acl_rule/index.js +33 -0
  29. package/dist/calendar/methods/add_acl_rule/index.js.map +1 -0
  30. package/dist/calendar/methods/add_acl_rule/schema.d.ts +47 -0
  31. package/dist/calendar/methods/add_acl_rule/schema.d.ts.map +1 -0
  32. package/dist/calendar/methods/add_acl_rule/schema.js +20 -0
  33. package/dist/calendar/methods/add_acl_rule/schema.js.map +1 -0
  34. package/dist/calendar/methods/delete_acl_rule/handler.d.ts +5 -0
  35. package/dist/calendar/methods/delete_acl_rule/handler.d.ts.map +1 -0
  36. package/dist/calendar/methods/delete_acl_rule/handler.js +6 -0
  37. package/dist/calendar/methods/delete_acl_rule/handler.js.map +1 -0
  38. package/dist/calendar/methods/delete_acl_rule/index.d.ts +18 -0
  39. package/dist/calendar/methods/delete_acl_rule/index.d.ts.map +1 -0
  40. package/dist/calendar/methods/delete_acl_rule/index.js +26 -0
  41. package/dist/calendar/methods/delete_acl_rule/index.js.map +1 -0
  42. package/dist/calendar/methods/delete_acl_rule/schema.d.ts +13 -0
  43. package/dist/calendar/methods/delete_acl_rule/schema.d.ts.map +1 -0
  44. package/dist/calendar/methods/delete_acl_rule/schema.js +18 -0
  45. package/dist/calendar/methods/delete_acl_rule/schema.js.map +1 -0
  46. package/dist/calendar/methods/get_acl_rule/handler.d.ts +5 -0
  47. package/dist/calendar/methods/get_acl_rule/handler.d.ts.map +1 -0
  48. package/dist/calendar/methods/get_acl_rule/handler.js +9 -0
  49. package/dist/calendar/methods/get_acl_rule/handler.js.map +1 -0
  50. package/dist/calendar/methods/get_acl_rule/index.d.ts +31 -0
  51. package/dist/calendar/methods/get_acl_rule/index.d.ts.map +1 -0
  52. package/dist/calendar/methods/get_acl_rule/index.js +22 -0
  53. package/dist/calendar/methods/get_acl_rule/index.js.map +1 -0
  54. package/dist/calendar/methods/get_acl_rule/schema.d.ts +29 -0
  55. package/dist/calendar/methods/get_acl_rule/schema.d.ts.map +1 -0
  56. package/dist/calendar/methods/get_acl_rule/schema.js +15 -0
  57. package/dist/calendar/methods/get_acl_rule/schema.js.map +1 -0
  58. package/dist/calendar/methods/list_acl_rules/handler.d.ts +5 -0
  59. package/dist/calendar/methods/list_acl_rules/handler.d.ts.map +1 -0
  60. package/dist/calendar/methods/list_acl_rules/handler.js +15 -0
  61. package/dist/calendar/methods/list_acl_rules/handler.js.map +1 -0
  62. package/dist/calendar/methods/list_acl_rules/index.d.ts +38 -0
  63. package/dist/calendar/methods/list_acl_rules/index.d.ts.map +1 -0
  64. package/dist/calendar/methods/list_acl_rules/index.js +24 -0
  65. package/dist/calendar/methods/list_acl_rules/index.js.map +1 -0
  66. package/dist/calendar/methods/list_acl_rules/schema.d.ts +38 -0
  67. package/dist/calendar/methods/list_acl_rules/schema.d.ts.map +1 -0
  68. package/dist/calendar/methods/list_acl_rules/schema.js +34 -0
  69. package/dist/calendar/methods/list_acl_rules/schema.js.map +1 -0
  70. package/dist/calendar/methods/patch_acl_rule/handler.d.ts +5 -0
  71. package/dist/calendar/methods/patch_acl_rule/handler.d.ts.map +1 -0
  72. package/dist/calendar/methods/patch_acl_rule/handler.js +12 -0
  73. package/dist/calendar/methods/patch_acl_rule/handler.js.map +1 -0
  74. package/dist/calendar/methods/patch_acl_rule/index.d.ts +61 -0
  75. package/dist/calendar/methods/patch_acl_rule/index.d.ts.map +1 -0
  76. package/dist/calendar/methods/patch_acl_rule/index.js +33 -0
  77. package/dist/calendar/methods/patch_acl_rule/index.js.map +1 -0
  78. package/dist/calendar/methods/patch_acl_rule/schema.d.ts +48 -0
  79. package/dist/calendar/methods/patch_acl_rule/schema.d.ts.map +1 -0
  80. package/dist/calendar/methods/patch_acl_rule/schema.js +23 -0
  81. package/dist/calendar/methods/patch_acl_rule/schema.js.map +1 -0
  82. package/dist/calendar/methods/registry.d.ts +195 -0
  83. package/dist/calendar/methods/registry.d.ts.map +1 -1
  84. package/dist/calendar/methods/registry.js +20 -0
  85. package/dist/calendar/methods/registry.js.map +1 -1
  86. package/dist/calendar/methods/update_acl_rule/handler.d.ts +5 -0
  87. package/dist/calendar/methods/update_acl_rule/handler.d.ts.map +1 -0
  88. package/dist/calendar/methods/update_acl_rule/handler.js +12 -0
  89. package/dist/calendar/methods/update_acl_rule/handler.js.map +1 -0
  90. package/dist/calendar/methods/update_acl_rule/index.d.ts +71 -0
  91. package/dist/calendar/methods/update_acl_rule/index.d.ts.map +1 -0
  92. package/dist/calendar/methods/update_acl_rule/index.js +43 -0
  93. package/dist/calendar/methods/update_acl_rule/index.js.map +1 -0
  94. package/dist/calendar/methods/update_acl_rule/schema.d.ts +48 -0
  95. package/dist/calendar/methods/update_acl_rule/schema.d.ts.map +1 -0
  96. package/dist/calendar/methods/update_acl_rule/schema.js +23 -0
  97. package/dist/calendar/methods/update_acl_rule/schema.js.map +1 -0
  98. package/dist/gmail/methods/download_attachment/handler.d.ts.map +1 -1
  99. package/dist/gmail/methods/download_attachment/handler.js +17 -1
  100. package/dist/gmail/methods/download_attachment/handler.js.map +1 -1
  101. package/dist/gmail/methods/download_attachment/index.d.ts +6 -2
  102. package/dist/gmail/methods/download_attachment/index.d.ts.map +1 -1
  103. package/dist/gmail/methods/download_attachment/index.js +4 -2
  104. package/dist/gmail/methods/download_attachment/index.js.map +1 -1
  105. package/dist/gmail/methods/download_attachment/schema.d.ts +3 -1
  106. package/dist/gmail/methods/download_attachment/schema.d.ts.map +1 -1
  107. package/dist/gmail/methods/download_attachment/schema.js +15 -1
  108. package/dist/gmail/methods/download_attachment/schema.js.map +1 -1
  109. package/dist/gmail/methods/registry.d.ts +3 -1
  110. package/dist/gmail/methods/registry.d.ts.map +1 -1
  111. 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: [178 operations](./README.md#services)
23
- across Gmail (33), Calendar (25), Drive (35), Sheets (76), and Docs (9). Each
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>178 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%.
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>178 operations</strong> ship today: <strong>Gmail</strong> (<a href="./src/gmail/CAPABILITIES.md">33</a>), <strong>Calendar</strong> (<a href="./src/calendar/CAPABILITIES.md">25</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>
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 [25](./src/calendar/CAPABILITIES.md) (8 plus 17), 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).
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 25 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:
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 | [25 operations](./src/calendar/CAPABILITIES.md): events, calendars, free/busy, meeting-time suggestions |
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,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` both read and write, and differ on
7
+ * two axes: the latter hides the details of private events the way `reader`
8
+ * does, and only `writer` additionally carries read access to the calendar's
9
+ * own ACLs, which is why listing a calendar's rules needs `writer` or `owner`
10
+ * and a `reader` grant is not enough. `owner` is the escalation to watch,
11
+ * carrying every
12
+ * `writer` permission plus the ability to modify other users' access levels,
13
+ * so a rule granting it hands over control of the calendar's sharing. It is
14
+ * distinct from the calendar's data owner, of which there is exactly one.
15
+ *
16
+ * Ordered least to most access, and sourced from the discovery document
17
+ * rather than the bundled client types, which omit
18
+ * `writerWithoutPrivateAccess`.
19
+ *
20
+ * @see https://developers.google.com/workspace/calendar/api/concepts/sharing
21
+ */
22
+ export declare const AclRole: z.ZodEnum<{
23
+ freeBusyReader: "freeBusyReader";
24
+ none: "none";
25
+ owner: "owner";
26
+ reader: "reader";
27
+ writer: "writer";
28
+ writerWithoutPrivateAccess: "writerWithoutPrivateAccess";
29
+ }>;
30
+ export type AclRole = z.infer<typeof AclRole>;
31
+ //# 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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO;;;;;;;EAOlB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC"}
@@ -0,0 +1,30 @@
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` both read and write, and differ on
7
+ * two axes: the latter hides the details of private events the way `reader`
8
+ * does, and only `writer` additionally carries read access to the calendar's
9
+ * own ACLs, which is why listing a calendar's rules needs `writer` or `owner`
10
+ * and a `reader` grant is not enough. `owner` is the escalation to watch,
11
+ * carrying every
12
+ * `writer` permission plus the ability to modify other users' access levels,
13
+ * so a rule granting it hands over control of the calendar's sharing. It is
14
+ * distinct from the calendar's data owner, of which there is exactly one.
15
+ *
16
+ * Ordered least to most access, and sourced from the discovery document
17
+ * rather than the bundled client types, which omit
18
+ * `writerWithoutPrivateAccess`.
19
+ *
20
+ * @see https://developers.google.com/workspace/calendar/api/concepts/sharing
21
+ */
22
+ export const AclRole = z.enum([
23
+ 'none',
24
+ 'freeBusyReader',
25
+ 'reader',
26
+ 'writerWithoutPrivateAccess',
27
+ 'writer',
28
+ 'owner',
29
+ ]);
30
+ //# 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;;;;;;;;;;;;;;;;;;;GAmBG;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` both read and write, and differ on\n * two axes: the latter hides the details of private events the way `reader`\n * does, and only `writer` additionally carries read access to the calendar's\n * own ACLs, which is why listing a calendar's rules needs `writer` or `owner`\n * and a `reader` grant is not enough. `owner` is the escalation to watch,\n * 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,50 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The kinds of principal a sharing rule can name.
4
+ *
5
+ * Exported separately from AclScope because AclScope is a union and so has no
6
+ * single `shape` to read the type list from; the projection narrows against
7
+ * this (EXTENDING.md, "Enum policy": the allowed list derives from the entity).
8
+ */
9
+ export declare const AclScopeType: z.ZodEnum<{
10
+ default: "default";
11
+ domain: "domain";
12
+ group: "group";
13
+ user: "user";
14
+ }>;
15
+ export type AclScopeType = z.infer<typeof AclScopeType>;
16
+ /**
17
+ * The extent to which calendar access is granted by an access control rule:
18
+ * who the rule is about.
19
+ *
20
+ * A discriminated union rather than one object with an optional `value`,
21
+ * because the two shapes genuinely differ: `default` is the public scope and
22
+ * takes no value, while `user`, `group`, and `domain` each name a principal
23
+ * and require one. Modeling it as a union is what makes the emitted JSON
24
+ * Schema (`oneOf`, each branch with its own `required`) match what the server
25
+ * actually accepts; a refinement would validate at runtime but advertise the
26
+ * wider shape to every MCP client, so an agent would build a call the schema
27
+ * told it was legal and then be rejected.
28
+ *
29
+ * The pairing is enforced rather than merely documented because Google does
30
+ * not enforce it, and its failure mode is severe: sending a value alongside
31
+ * type `default` is accepted, the value is discarded for
32
+ * `__public_principal__`, and the calendar becomes public. Verified against
33
+ * the live API, not inferred.
34
+ *
35
+ * Both branches are strict, per EXTENDING.md's strict-input rule.
36
+ *
37
+ * @see https://developers.google.com/workspace/calendar/api/concepts/sharing
38
+ */
39
+ export declare const AclScope: z.ZodDiscriminatedUnion<[z.ZodObject<{
40
+ type: z.ZodLiteral<"default">;
41
+ }, z.core.$strict>, z.ZodObject<{
42
+ type: z.ZodEnum<{
43
+ domain: "domain";
44
+ group: "group";
45
+ user: "user";
46
+ }>;
47
+ value: z.ZodString;
48
+ }, z.core.$strict>], "type">;
49
+ export type AclScope = z.infer<typeof AclScope>;
50
+ //# 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;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;EAAiD,CAAC;AAE3E,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,48 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The kinds of principal a sharing rule can name.
4
+ *
5
+ * Exported separately from AclScope because AclScope is a union and so has no
6
+ * single `shape` to read the type list from; the projection narrows against
7
+ * this (EXTENDING.md, "Enum policy": the allowed list derives from the entity).
8
+ */
9
+ export const AclScopeType = z.enum(['default', 'user', 'group', 'domain']);
10
+ /**
11
+ * The extent to which calendar access is granted by an access control rule:
12
+ * who the rule is about.
13
+ *
14
+ * A discriminated union rather than one object with an optional `value`,
15
+ * because the two shapes genuinely differ: `default` is the public scope and
16
+ * takes no value, while `user`, `group`, and `domain` each name a principal
17
+ * and require one. Modeling it as a union is what makes the emitted JSON
18
+ * Schema (`oneOf`, each branch with its own `required`) match what the server
19
+ * actually accepts; a refinement would validate at runtime but advertise the
20
+ * wider shape to every MCP client, so an agent would build a call the schema
21
+ * told it was legal and then be rejected.
22
+ *
23
+ * The pairing is enforced rather than merely documented because Google does
24
+ * not enforce it, and its failure mode is severe: sending a value alongside
25
+ * type `default` is accepted, the value is discarded for
26
+ * `__public_principal__`, and the calendar becomes public. Verified against
27
+ * the live API, not inferred.
28
+ *
29
+ * Both branches are strict, per EXTENDING.md's strict-input rule.
30
+ *
31
+ * @see https://developers.google.com/workspace/calendar/api/concepts/sharing
32
+ */
33
+ export const AclScope = z.discriminatedUnion('type', [
34
+ z.strictObject({
35
+ type: z
36
+ .literal('default')
37
+ .describe('The public scope: access is granted to any user, authenticated or not.'),
38
+ }),
39
+ z.strictObject({
40
+ type: z
41
+ .enum(['user', 'group', 'domain'])
42
+ .describe('The type of the scope: a single user, a group, or a whole domain.'),
43
+ value: z
44
+ .string()
45
+ .describe('The email address of a user or group, or the name of a domain, depending on the scope type.'),
46
+ }),
47
+ ]);
48
+ //# 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;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAI3E;;;;;;;;;;;;;;;;;;;;;;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,CAAC;aACJ,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;aACjC,QAAQ,CAAC,mEAAmE,CAAC;QAChF,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 kinds of principal a sharing rule can name.\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 */\nexport const AclScopeType = z.enum(['default', 'user', 'group', 'domain']);\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: z\n .enum(['user', 'group', 'domain'])\n .describe('The type of the scope: a single user, a group, or a whole domain.'),\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":"instructions.d.ts","sourceRoot":"","sources":["../../src/calendar/instructions.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,QAYG,CAAC"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/calendar/instructions.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,QAoByB,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. The access control rules that constitute ' +
19
+ 'calendar sharing are read with list_acl_rules and changed with ' +
20
+ 'add_acl_rule, update_acl_rule, patch_acl_rule, and delete_acl_rule, of ' +
21
+ 'which the first three take sendNotifications; a ' +
22
+ 'rule ID derives from its scope, granting owner lets the grantee change ' +
23
+ "the calendar's own sharing, and sendNotifications defaults to true, so a " +
24
+ 'write sends sharing notifications unless it is passed as false, though ' +
25
+ 'never on access removal. A scope of type default is the public scope and ' +
26
+ 'carries no value; 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,0BAA0B,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.';\n"]}
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,oEAAoE;IACpE,iEAAiE;IACjE,yEAAyE;IACzE,kDAAkD;IAClD,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,2EAA2E;IAC3E,gDAAgD,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. The access control rules that constitute ' +\n 'calendar sharing are read with list_acl_rules and changed with ' +\n 'add_acl_rule, update_acl_rule, patch_acl_rule, and delete_acl_rule, of ' +\n 'which the first three take sendNotifications; a ' +\n 'rule ID derives from its scope, granting owner lets the grantee change ' +\n \"the calendar's own sharing, and sendNotifications defaults to true, so a \" +\n 'write sends sharing notifications unless it is passed as false, though ' +\n 'never on access removal. A scope of type default is the public scope and ' +\n 'carries no value; 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,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/calendar/methods/add_acl_rule/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,QAA8B,EAC9B,IAAkC;IAElC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,MAAM,CACxC,SAAS,CAAC;QACR,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;QACxC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,uEAAuE;QACvE,6DAA6D;QAC7D,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;KACpD,CAAC,CACH,CAAC;IACF,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { calendar_v3 } from '@googleapis/calendar';\nimport type { z } from 'zod';\nimport { forGoogle } from '../../../lib/optionality.js';\nimport { projectAclRule } from '../../lib/acl.js';\nimport type { schema } from './schema.js';\n\nexport async function handler(\n calendar: calendar_v3.Calendar,\n args: z.infer<typeof schema.input>,\n): Promise<z.infer<typeof schema.output>> {\n const { data } = await calendar.acl.insert(\n forGoogle({\n calendarId: args.calendarId ?? 'primary',\n sendNotifications: args.sendNotifications,\n // The scope union guarantees the type/value pairing Google accepts but\n // does not enforce, so it crosses the boundary as it stands.\n requestBody: { role: args.role, scope: args.scope },\n }),\n );\n return projectAclRule(data);\n}\n"]}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Grants access to a calendar. Destructive under the rubric's
3
+ * standing-side-effect cluster (the `create_filter` and
4
+ * `sheets/add_protected_range` precedents): the grant keeps conferring access
5
+ * until something revokes it, so it is not merely additive, and `owner` hands
6
+ * the grantee control of this calendar's sharing.
7
+ *
8
+ * Open-world because `sendNotifications` defaults to true at Google, so a
9
+ * grant emails the scope, which may be an address outside the organization
10
+ * entirely. Pass `sendNotifications: false` to grant silently.
11
+ *
12
+ * A rule's id derives from its scope, so granting a scope that already has a
13
+ * rule replaces that rule's role rather than adding a second one, and does not
14
+ * conflict. Verified against the live API rather than inferred: a second
15
+ * insert for the same scope returned the same rule id with the new role, and
16
+ * the calendar was left with one rule for that scope.
17
+ */
18
+ export declare const add_acl_rule: import("../../../lib/operation.js").Operation<import("@googleapis/calendar").calendar_v3.Calendar, import("zod").ZodObject<{
19
+ role: import("zod").ZodEnum<{
20
+ freeBusyReader: "freeBusyReader";
21
+ none: "none";
22
+ owner: "owner";
23
+ reader: "reader";
24
+ writer: "writer";
25
+ writerWithoutPrivateAccess: "writerWithoutPrivateAccess";
26
+ }>;
27
+ scope: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
28
+ type: import("zod").ZodLiteral<"default">;
29
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
30
+ type: import("zod").ZodEnum<{
31
+ domain: "domain";
32
+ group: "group";
33
+ user: "user";
34
+ }>;
35
+ value: import("zod").ZodString;
36
+ }, import("zod/v4/core").$strict>], "type">;
37
+ calendarId: import("zod").ZodOptional<import("zod").ZodString>;
38
+ sendNotifications: import("zod").ZodOptional<import("zod").ZodBoolean>;
39
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
40
+ id: import("zod").ZodString;
41
+ role: import("zod").ZodOptional<import("zod").ZodEnum<{
42
+ freeBusyReader: "freeBusyReader";
43
+ none: "none";
44
+ owner: "owner";
45
+ reader: "reader";
46
+ writer: "writer";
47
+ writerWithoutPrivateAccess: "writerWithoutPrivateAccess";
48
+ }>>;
49
+ scope: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
50
+ type: import("zod").ZodLiteral<"default">;
51
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
52
+ type: import("zod").ZodEnum<{
53
+ domain: "domain";
54
+ group: "group";
55
+ user: "user";
56
+ }>;
57
+ value: import("zod").ZodString;
58
+ }, import("zod/v4/core").$strict>], "type">>;
59
+ }, import("zod/v4/core").$strip>>;
60
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calendar/methods/add_acl_rule/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAYvB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { calendarOperation } from '../../operation.js';
2
+ import { handler } from './handler.js';
3
+ import { schema } from './schema.js';
4
+ /**
5
+ * Grants access to a calendar. Destructive under the rubric's
6
+ * standing-side-effect cluster (the `create_filter` and
7
+ * `sheets/add_protected_range` precedents): the grant keeps conferring access
8
+ * until something revokes it, so it is not merely additive, and `owner` hands
9
+ * the grantee control of this calendar's sharing.
10
+ *
11
+ * Open-world because `sendNotifications` defaults to true at Google, so a
12
+ * grant emails the scope, which may be an address outside the organization
13
+ * entirely. Pass `sendNotifications: false` to grant silently.
14
+ *
15
+ * A rule's id derives from its scope, so granting a scope that already has a
16
+ * rule replaces that rule's role rather than adding a second one, and does not
17
+ * conflict. Verified against the live API rather than inferred: a second
18
+ * insert for the same scope returned the same rule id with the new role, and
19
+ * the calendar was left with one rule for that scope.
20
+ */
21
+ export const add_acl_rule = calendarOperation({
22
+ description: 'Share a calendar by adding a rule to its access control list, granting a role (none, freeBusyReader, reader, writerWithoutPrivateAccess, writer, or owner) to a scope (a user, a group, a domain, or the public). Sends the grantee a sharing notification unless sendNotifications is false.',
23
+ annotations: {
24
+ readOnlyHint: false,
25
+ destructiveHint: true,
26
+ idempotentHint: false,
27
+ openWorldHint: true,
28
+ },
29
+ source: 'https://developers.google.com/workspace/calendar/api/v3/reference/acl/insert',
30
+ schema,
31
+ handler,
32
+ });
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/calendar/methods/add_acl_rule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;IAC5C,WAAW,EACT,+RAA+R;IACjS,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,IAAI;KACpB;IACD,MAAM,EAAE,8EAA8E;IACtF,MAAM;IACN,OAAO;CACR,CAAC,CAAC","sourcesContent":["import { calendarOperation } from '../../operation.js';\nimport { handler } from './handler.js';\nimport { schema } from './schema.js';\n\n/**\n * Grants access to a calendar. Destructive under the rubric's\n * standing-side-effect cluster (the `create_filter` and\n * `sheets/add_protected_range` precedents): the grant keeps conferring access\n * until something revokes it, so it is not merely additive, and `owner` hands\n * the grantee control of this calendar's sharing.\n *\n * Open-world because `sendNotifications` defaults to true at Google, so a\n * grant emails the scope, which may be an address outside the organization\n * entirely. Pass `sendNotifications: false` to grant silently.\n *\n * A rule's id derives from its scope, so granting a scope that already has a\n * rule replaces that rule's role rather than adding a second one, and does not\n * conflict. Verified against the live API rather than inferred: a second\n * insert for the same scope returned the same rule id with the new role, and\n * the calendar was left with one rule for that scope.\n */\nexport const add_acl_rule = calendarOperation({\n description:\n 'Share a calendar by adding a rule to its access control list, granting a role (none, freeBusyReader, reader, writerWithoutPrivateAccess, writer, or owner) to a scope (a user, a group, a domain, or the public). Sends the grantee a sharing notification unless sendNotifications is false.',\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n source: 'https://developers.google.com/workspace/calendar/api/v3/reference/acl/insert',\n schema,\n handler,\n});\n"]}
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ export declare const schema: {
3
+ input: z.ZodObject<{
4
+ role: z.ZodEnum<{
5
+ freeBusyReader: "freeBusyReader";
6
+ none: "none";
7
+ owner: "owner";
8
+ reader: "reader";
9
+ writer: "writer";
10
+ writerWithoutPrivateAccess: "writerWithoutPrivateAccess";
11
+ }>;
12
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ type: z.ZodLiteral<"default">;
14
+ }, z.core.$strict>, z.ZodObject<{
15
+ type: z.ZodEnum<{
16
+ domain: "domain";
17
+ group: "group";
18
+ user: "user";
19
+ }>;
20
+ value: z.ZodString;
21
+ }, z.core.$strict>], "type">;
22
+ calendarId: z.ZodOptional<z.ZodString>;
23
+ sendNotifications: z.ZodOptional<z.ZodBoolean>;
24
+ }, z.core.$strict>;
25
+ output: z.ZodObject<{
26
+ id: z.ZodString;
27
+ role: z.ZodOptional<z.ZodEnum<{
28
+ freeBusyReader: "freeBusyReader";
29
+ none: "none";
30
+ owner: "owner";
31
+ reader: "reader";
32
+ writer: "writer";
33
+ writerWithoutPrivateAccess: "writerWithoutPrivateAccess";
34
+ }>>;
35
+ scope: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
36
+ type: z.ZodLiteral<"default">;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ type: z.ZodEnum<{
39
+ domain: "domain";
40
+ group: "group";
41
+ user: "user";
42
+ }>;
43
+ value: z.ZodString;
44
+ }, z.core.$strict>], "type">>;
45
+ }, z.core.$strip>;
46
+ };
47
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/calendar/methods/add_acl_rule/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,MAAM;IACjB,KAAK;;;;;;;;;;;;;;;;;;;;;;IAgBL,MAAM;;;;;;;;;;;;;;;;;;;;;CACP,CAAC"}