Skip to content

Add a Google Calendar template generated from Google's API description - #324

Merged
tnkuehne merged 1 commit into
feat/onedrive-templatefrom
feat/google-calendar-template
Nov 23, 2026
Merged

tnkuehne merged 1 commit into
feat/onedrive-templatefrom
feat/google-calendar-template

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Google Calendar is one of the most requested integrations, and none of the templates covers it yet. Google publishes a Discovery document for it, which the generator from #319 already reads. A calendar template therefore needs only its rules and the template code around the generated API.

What changes

Google Calendar template (templates/google-calendar)

  • Methods: all 38 methods of the Google Calendar API as typed methods with field selections: events and recurring instances, calendars, the calendar list, sharing (ACL), settings, colors, free/busy times, and push notification channels. None is left out.
  • Approvals: each user's approval level decides when a method asks, as in the other templates.
    • eventsInsert is send: it adds the event to its guests' calendars and, with sendUpdates, emails them.
    • Quick-add, imported private copies and new calendars are create.
    • Changing, moving, sharing, clearing and deleting are updates or deletions.
  • Scope: https://www.googleapis.com/auth/calendar, which covers every method. An account connected with fewer scopes gets permission_required.
  • OAuth: the organization's own Google OAuth client only (GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET), like Gmail. The scope is sensitive, so a managed client would need Google's verification.
  • Results: calendar_error carries Google's message, status and reasons. Rate limits, missing scopes, revoked tokens and responses over 8 MiB are handled as in Gmail.
  • Icon: a plain calendar icon, not Google's logo.
  • template.md describes setup, method names, selections, approvals, results and how to regenerate.

Generator

  • read rule: discovery rules accept read for methods that only read through a POST, such as freebusy.query. Those methods never ask.

Catalog tests

  • Template list: the catalog tests compare against the template directories in the repository instead of a fixed list of four, so adding a template doesn't change them.

Connection page

New page, connected state, with the same approval form as the other templates.

1280 px 390 px

Testing

  • pnpm check
  • Generator: a test for the read rule.
  • Calendar template against a mocked Google:
    • typed requests with fields URLs and undefined arguments left out;
    • invitations asking as send;
    • quick-add running at once by default and asking at all_changes;
    • freebusyQuery never asking;
    • each approval level;
    • Google errors, rate limits and missing scopes;
    • oversized responses;
    • token refresh, outages and callback checks.
  • Type tests: the README example compiles; unknown fields, missing selections, a missing calendar and wrong choices don't.
  • Catalog and template install tests: pass with the new template.
  • Not tested against a live Google account.

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

The PR appears safe to merge with the required query-argument checks from dependent PR #325.

Summary

Adds a personal Google Calendar template with 38 typed methods, field selections and per-user approvals.

  • Apps can connect a user's Google account and call typed Calendar methods.
  • The generator can include read-only methods that use POST.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Calendar method"] --> B["Build request and field selection"]
  B --> C{"Changes data?"}
  C -- No --> F["Send with the user's Google token"]
  C -- Yes --> D{"Approval needed?"}
  D -- No --> F
  D -- Yes --> E["Ask the user"]
  E -- Accepted --> F
  E -- Declined --> G["Return declined"]
  F --> H["Return selected data or an error"]
Loading

Reviews (15) · Last reviewed commit: "Add a Google Calendar template generated..." · Reviewed by Greptile

@tnkuehne
tnkuehne added this pull request to stack #320 November 23, 2026 00:29
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs 615a3e6 Nov 23 2026, 10:35 AM

@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch from d1334cc to 59b623a Compare November 23, 2026 00:36
@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch 2 times, most recently from 3dd0c71 to e6485f6 Compare November 23, 2026 00:59
@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch 2 times, most recently from 82b324e to 24561f6 Compare November 23, 2026 01:31
@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch from 24561f6 to 343ec4a Compare November 23, 2026 01:43
@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch 2 times, most recently from d409637 to bac9637 Compare November 23, 2026 02:22
@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch 5 times, most recently from f0a4a53 to 1f681b3 Compare November 23, 2026 10:05
@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch from 1f681b3 to 8ef345e Compare November 23, 2026 10:16
The new template offers every method of the Google Calendar API as a typed
method with field selections, generated like the Gmail template: events and
recurring instances, calendars and the calendar list, sharing, settings,
free/busy times and push notifications.

Changes ask for approval by each user's level. Creating an event with guests
counts as send, since it adds the event to their calendars and can email
them. The discovery generator gains a read rule for methods such as
freebusy.query, which read through a POST. The catalog tests list the
templates the repository has instead of a fixed set.
@tnkuehne
tnkuehne force-pushed the feat/google-calendar-template branch from 8ef345e to 615a3e6 Compare November 23, 2026 10:34
@tnkuehne
tnkuehne merged commit 6f9f545 into main Nov 23, 2026
17 of 21 checks passed
@tnkuehne
tnkuehne deleted the feat/google-calendar-template branch November 23, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant