npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

m365-copilot-api-plugins-graph

v0.2.0

Published

A TypeSpec library that provides pre-built Microsoft Graph API plugins for Microsoft 365 Copilot and other applications. This library includes ready-to-use API definitions for common Microsoft Graph operations like email management and task handling.

Readme

Microsoft Graph API Plugins for TypeSpec

A TypeSpec library that provides pre-built Microsoft Graph API plugins for Microsoft 365 Copilot and other applications. This library includes ready-to-use API definitions for common Microsoft Graph operations like email management and task handling.

Features

  • 📧 Mail Operations: Send emails through Microsoft Graph API
  • Task Management: Manage To-Do tasks and task lists
  • 🔧 TypeSpec Integration: Built with TypeSpec for type-safe API definitions
  • 🤖 Copilot Ready: Designed for Microsoft 365 Copilot integration
  • 📊 Adaptive Cards: Includes pre-built adaptive card templates

Installation

npm install m365-copilot-api-plugins-graph

Peer Dependencies

Make sure you have the following TypeSpec packages installed:

npm install @typespec/http @typespec/openapi @typespec/openapi3

Usage

Basic Setup

Import the library in your TypeSpec project:

import "m365-copilot-api-plugins-graph";

Available Operations

Mail Operations

  • Send Email: Send emails using the Microsoft Graph API with support for:
    • HTML and text content
    • Multiple recipients (To, CC)
    • Custom subjects and body content
    • Automatic saving to Sent Items

Task Operations

  • Get Task Lists: Retrieve all To-Do task lists for the current user
  • Get Tasks: Fetch tasks from specific task lists
  • Create Tasks: Add new tasks to task lists
  • Update Tasks: Modify existing tasks
  • Delete Tasks: Remove tasks from task lists

Authentication

This library uses Microsoft Graph API authentication. Make sure your application has the appropriate permissions:

Required Scopes for Mail

  • Mail.Send - Send emails on behalf of the user
  • Mail.ReadWrite - Read and write access to user mailboxes

Required Scopes for Tasks

  • Tasks.ReadWrite - Read and write access to user tasks

Example Usage

The library provides TypeSpec definitions that can be compiled to OpenAPI specifications for use in various applications, including Microsoft 365 Copilot plugins.

Sending an Email

{
  "message": {
    "subject": "Hello from TypeSpec!",
    "body": {
      "contentType": "html",
      "content": "<h1>Hello World</h1>"
    },
    "toRecipients": [
      {
        "emailAddress": {
          "address": "[email protected]",
          "name": "John Doe"
        }
      }
    ]
  },
  "saveToSentItems": true
}

Building

# Install dependencies
npm install

# Build the library
npm run build

# Run TypeSpec compilation
npm run build:tsp

# Run tests
npm test

Development

# Watch for changes
npm run watch

# Lint code
npm run lint

# Format code
npm run format

Project Structure

lib/
├── main.tsp      # Main TypeSpec entry point
├── mail.tsp      # Mail operations and models
├── tasks.tsp     # Task operations and models
├── models.tsp    # Shared data models
└── auth.tsp      # Authentication definitions

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Ensure your commit messages follow Conventional Commits
  6. Submit a pull request

Commit Message Format

This project uses Conventional Commits to ensure consistent and meaningful commit messages. All commits must follow this format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Supported Types

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Examples

feat: add email attachment support
fix(auth): resolve token refresh issue
docs: update API usage examples
test: add unit tests for task operations

Enforcement

  • Pre-commit hooks: Commit messages are validated locally using commitlint
  • CI/CD: Pull requests are automatically validated for conventional commit format
  • Release automation: Semantic versioning and changelog generation depend on conventional commits