RedPlanetHQ / RedPlanetHQ/core

New Integration: OneDrive

Open
#486 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue integration new-feature new-integration
Dominant language
TypeScript
Stars
2k
Forks
194
Avg merge
12m
Merged PRs (30d)
2

Description

Description

Add OneDrive integration to sync files, folders, and document activity into CORE via Microsoft Graph API.

Reference Implementations

Existing Integrations (use as templates)
  • integrations/google-docs/ - Similar cloud document integration
  • integrations/google-sheets/ - Google Workspace file integration
  • integrations/github/ - For webhook and event patterns
Required Files Structure
integrations/onedrive/
├── src/
│   ├── index.ts          # Main entry, OAuth spec
│   ├── schedule.ts       # Sync logic
│   ├── utils.ts          # Microsoft Graph API utilities
│   ├── account-create.ts # OAuth setup
│   └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md

OneDrive API Integration (via Microsoft Graph)

OAuth Setup
  • Use OAuth 2.0 with Microsoft Identity Platform
  • Microsoft Graph base URL: https://graph.microsoft.com/v1.0
  • Required scopes:
    • Files.Read - Read user's files
    • Files.Read.All - Read all files user can access
    • Files.ReadWrite - Read and write user's files
    • User.Read - Read user profile
    • offline_access - Refresh tokens for long-lived access
Key Endpoints
  • GET /me/drive - Get current user's OneDrive
  • GET /me/drive/root/children - List items in root folder
  • GET /me/drive/items/{item-id} - Get item metadata
  • GET /me/drive/items/{item-id}/children - List folder contents
  • GET /me/drive/root:/{path} - Access items by path
  • GET /me/drive/items/{item-id}/content - Download file content
  • GET /drives/{drive-id}/items/{item-id} - Access shared drives
  • GET /me/drive/items/{item-id}/delta - Track changes (delta sync)
  • POST /subscriptions - Create webhook subscriptions for change notifications
Core Resources
  • Drive - Logical container of files (document library or user's OneDrive)
  • DriveItem - Item within a drive (document, photo, video, folder)

Events to Track

  1. Files - File created, modified, renamed, deleted, moved
  2. Folders - Folder created, renamed, deleted, reorganized
  3. Sharing - Files shared, permissions changed
  4. Versions - File version history changes
  5. Sync Activity - Delta changes for incremental sync

Implementation Tasks

  • Set up basic integration structure following integrations/github/src/index.ts pattern
  • Implement OAuth 2.0 flow with Microsoft Identity Platform in account-create.ts
  • Create API utilities in utils.ts for Microsoft Graph API
  • Implement sync logic in schedule.ts using delta queries for incremental sync
  • Set up webhook subscriptions for real-time change notifications
  • Convert OneDrive events to CORE activity format
  • Add error handling and rate limiting
  • Create integration documentation
  • Add to integrations/README.md

Technical Notes

  • OneDrive is accessed through the Microsoft Graph API, not a standalone API
  • URL pattern: https://graph.microsoft.com/v1.0/{root-resource}/{onedrive-resource}
  • Delta queries (/delta endpoint) enable efficient incremental sync
  • Webhook subscriptions require a publicly accessible notification URL
  • Both personal OneDrive and OneDrive for Business are supported
  • The same API can access SharePoint document libraries

Resources

Labels

enhancement, integration, new-feature

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing integrations/google-docs/, integrations/google-sheets/, and integrations/github/src/index.ts, then map the required files under integrations/onedrive/. Review the Microsoft Graph OAuth, delta, and subscription requirements before implementing. Done means the listed OAuth, sync, webhook, activity, error-handling, documentation, and integrations/README.md tasks are complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.