Skip to content

Add an Outlook template generated from Microsoft Graph's OpenAPI description - #326

Merged
tnkuehne merged 8 commits into
feat/google-sheets-templatefrom
feat/outlook-template
Nov 23, 2026
Merged

tnkuehne merged 8 commits into
feat/google-sheets-templatefrom
feat/outlook-template

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Outlook mail and calendars are the Microsoft counterpart to Gmail and Google Calendar, and no template covers them yet. The OpenAPI generator from #322 and the Microsoft login of the OneDrive template cover most of it. What remains is the list of operations and two things Graph's description needs.

What changes

Outlook template (templates/outlook)

  • Methods: 68 typed methods for the signed-in user's mailbox. scripts/operations.ts names the Graph operation behind each one.
    • Mail: messages, MIME content, delta, drafts, send, reply, reply all and forward (direct and as drafts), move, copy, and attachments.
    • Folders and rules: mail folders, child folders and their messages, and inbox rules.
    • Calendar: calendars, events and calendar views, recurring instances, meeting responses (accept, tentative, decline, cancel, forward), reminders, findMeetingTimes and getSchedule.
    • Contacts and settings: contacts and contact folders, mailbox settings, and categories.
  • Approvals: each user's approval level decides when a method asks.
    • Send: sending, replying and forwarding mail, creating events (which invites attendees), and answering, cancelling or forwarding meetings.
    • Update: inbox rules, which can forward mail, and mailbox settings, which include automatic replies.
    • Create: drafts, folders, contacts and calendars.
    • findMeetingTimes and getSchedule read through a POST and never ask.
  • Scopes: Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, Contacts.ReadWrite and MailboxSettings.ReadWrite, from the managed Microsoft client or the organization's own Entra app. An account connected with fewer permissions gets permission_required.
  • Results and limits: the same as OneDrive: graph_error, throttling, too_large over 8 MiB, and paging through nextLink.
  • Icon: a plain envelope icon, not Microsoft's logo.
  • template.md describes setup, well-known folder names, OData options, action bodies, approvals, results and how to offer more operations.

OpenAPI generator

  • read rule: rules can mark POST operations that only read, such as getSchedule.
  • body/result rule: rules can name the schemas a body or result can be, where Graph only names their common base. addAttachment and getAttachment use file, item and reference attachments, so contentBytes is typed.
  • navigation rule: rules can keep named navigation properties, typed with their concrete schemas. Outlook's Message.attachments carries file, item and reference attachments inline, for sendMail and drafts.
  • description rule: rules can replace an operation's description. Graph attaches the text of other operations to some Outlook ones: me.ListMessages says "Get open extension" and me.CreateEvents says "Create multi-value extended property". Seven methods use it.

Managed OAuth tests

  • Outlook runs through the managed OAuth tests next to OneDrive.

Managed OAuth

A managed microsoft client only grants the scopes its scopes setting allows. Installations that offer managed OAuth for Microsoft must allow these five scopes, next to OneDrive's Files.ReadWrite.All from #322.

Notes

  • Action bodies: they use the parameter names of Graph's description, which are PascalCase, such as { Message, SaveToSentItems } for sendMail. Graph's own SDKs send these names.

Connection page

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

1280 px 390 px

Testing

  • pnpm check
  • Generator: tests for read and description rules.
  • Outlook template against a mocked Graph:
    • typed requests and URLs;
    • paging;
    • MIME content;
    • getSchedule never asking;
    • drafts running at once, and sendMail and deletions asking, then running after approval;
    • each approval level;
    • missing permissions, with and without the Graph resource prefix;
    • Graph errors, throttling and oversized responses;
    • token refresh, outages and callback checks.
  • Type tests: the README example compiles; a missing ID and wrong query types don't.
  • Managed OAuth and catalog tests: pass with Outlook.
  • Not tested against a live Microsoft account.

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

The PR appears safe to merge; no new actionable issue was established.

Summary

Adds 68 typed Outlook methods, Microsoft account connections, approval controls, and managed OAuth tests. The OpenAPI generator gains rules for read-only POSTs, concrete body and result types, kept navigation fields, and descriptions.

  • Outlook apps can call typed methods for mail, calendars, contacts, and settings.
  • Outlook asks before methods send messages or make protected changes.
  • Each signed-in user can connect and use their own Microsoft account.
  • The template generator can describe Outlook’s read-only actions and concrete attachment types.
  • Managed Microsoft OAuth can allow the scopes Outlook needs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[App calls Outlook method] --> B[Check request arguments]
  B --> C[Check current user's connection]
  C --> D{Change needs approval?}
  D -->|Yes, no answer| E[Ask user]
  E --> A
  D -->|Declined| F[Return declined]
  D -->|Approved or not needed| G[Send request to Microsoft Graph]
  G --> H[Return bounded data or error]
Loading

Reviews (16) · Last reviewed commit: "Fit kept navigation fields into the type..." · Reviewed by Greptile

@tnkuehne
tnkuehne added this pull request to stack #320 November 23, 2026 00:53
@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 0c01043 Nov 23 2026, 10:35 AM

@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 5f8dcab to 298a635 Compare November 23, 2026 00:59
Comment thread templates/outlook/src/api.ts Resolved
Comment thread templates/outlook/src/api.ts Resolved
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 298a635 to dddb4c0 Compare November 23, 2026 01:08
Comment thread templates/outlook/src/api.ts Resolved
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from dddb4c0 to 65c0f89 Compare November 23, 2026 01:22
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch 2 times, most recently from d937d34 to 35c504a Compare November 23, 2026 01:31
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 35c504a to 8f30fac Compare November 23, 2026 01:44
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 8f30fac to 2e839db Compare November 23, 2026 02:01
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 2e839db to 57fd290 Compare November 23, 2026 02:22
Comment thread templates/outlook/src/run.ts Resolved
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from a885982 to 3dace2a Compare November 23, 2026 08:32
Comment thread templates/outlook/scripts/operations.ts Resolved
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 3dace2a to 279bce9 Compare November 23, 2026 09:16
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 279bce9 to c5999cd Compare November 23, 2026 09:24
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from c5999cd to 08974b2 Compare November 23, 2026 09:33
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 08974b2 to 4c53198 Compare November 23, 2026 10:05
@tnkuehne

Copy link
Copy Markdown
Contributor Author

@greptileai review

@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 4c53198 to f024b3e Compare November 23, 2026 10:16
…ription

The new template offers 68 typed methods for Outlook's operations of
Microsoft Graph: messages, drafts, replies and attachments, mail folders and
rules, calendars, events and meeting responses, free/busy times, contacts
and mailbox settings. It uses the same Microsoft login as OneDrive.

Sending, replying, forwarding, creating events, which invites attendees, and
answering or cancelling meetings count as send; changes ask for approval by
each user's level. OpenAPI rules can mark POST operations that only read,
such as getSchedule, and replace descriptions where Graph's text describes
another operation.
Graph describes attachments by their base type, which has no content. Rules
can now name the schemas a body or result can be, and Outlook's
addAttachment and getAttachment take and return file, item and reference
attachments, with a file's contentBytes. Later pages of calendarView and the
other pageable methods need only their address.
Graph accepts a message's attachments inline, but they are a navigation
property, which the types leave out. Rules can now keep named navigation
properties, typed with the schemas their values can be, and Outlook's
messages keep their file, item and reference attachments.
@tnkuehne
tnkuehne force-pushed the feat/outlook-template branch from 66abc0c to 0c01043 Compare November 23, 2026 10:34
@tnkuehne
tnkuehne merged commit 56b1ca1 into main Nov 23, 2026
14 of 15 checks passed
@tnkuehne
tnkuehne deleted the feat/outlook-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