OneDrive

Lightweight, dependency-free Microsoft Graph OneDrive emulator for parlel-pool.

Default port: 4622

Quick Start

Start the server in-process:

import { OnedriveServer } from "./services/onedrive/src/server.js";

const server = new OnedriveServer(4622);
await server.start();

Connect with the real @microsoft/microsoft-graph-client client by pointing its Graph base URL at the emulator:

import { Client } from "@microsoft/microsoft-graph-client";

const client = Client.init({
  baseUrl: "http://127.0.0.1:4622/v1.0",
  authProvider: (done) => done(null, "parlel-token"),
});

const root = await client.api("/me/drive/root").get();
await client.api("/me/drive/root:/hello.txt:/content").put("hello");

Health and reset endpoints:

curl http://127.0.0.1:4622/_parlel/health
curl -X POST http://127.0.0.1:4622/_parlel/reset

Implemented Operations

Discovery and users:

Drive item CRUD and addressing:

Children and OData collection options:

Content and uploads:

Actions and collections:

Permissions and sharing:

Thumbnails:

Subscriptions and batch:

Parlel control endpoints:

The same routes are accepted under /beta and under /drives/{drive-id} where Graph exposes drive-scoped item routes.

Support Matrix

FeatureStatusNotes
Microsoft Graph REST shapeSupportedJSON resources, OData collections, Graph error envelopes.
@microsoft/microsoft-graph-client request buildersSupportedUse Client.init({ baseUrl: "http://127.0.0.1:4622/v1.0" }).
In-memory drive/items/permissions/subscriptionsSupportedEphemeral; reset with POST /_parlel/reset.
Small file upload/downloadSupportedPUT/GET .../content.
Path-addressed upload/downloadSupportedroot:/path:/content.
Resumable upload sessionsSupportedLocal upload URL, Content-Range, partial 202, final item response.
Async copy operationSupportedCompletes immediately and can be polled.
OData query optionsSupportedMinimal $top, $skip, $count, $orderby, $select, $filter, $search.
ThumbnailsSupportedDeterministic fake metadata/content.
Webhook subscriptionsSupportedStored only; no outbound webhook delivery.
Authentication/authorizationIntentionally unsupportedTokens are ignored for zero-cost local testing.
Real Microsoft storage, sharing emails, virus scanning, Office conversionIntentionally unsupportedNo external side effects.
Multi-tenant persistenceIntentionally unsupportedSingle local user and drive only.

Error Shapes

Errors use Microsoft Graph-style envelopes:

{
  "error": {
    "code": "itemNotFound",
    "message": "Item not found",
    "innerError": {
      "date": "2026-06-11T00:00:00.000Z",
      "request-id": "req_...",
      "client-request-id": "..."
    }
  }
}

Common returned errors:

StatusCodeWhen
400invalidRequestInvalid JSON, missing name, folder content download, root rename/delete, missing Content-Range.
404itemNotFoundMissing drive item, permission, share, operation, upload session, or special folder.
404Request_ResourceNotFoundUnknown route or user.
405Request_BadRequestUnsupported method for an existing route.
409nameAlreadyExistsChild create conflict without @microsoft.graph.conflictBehavior.
500InternalServerErrorUnexpected emulator failures.
<!-- parlel:testenv:start -->

Configuration — test.env

Copy these into your test.env (used by the bridge sidecar flow). Tokens are Parlel's seeded test credentials — any non-empty value is accepted by the emulator, so you rarely need to change them. Swap in real credentials only when pointing at the live service in prod.env.

ONEDRIVE_EMULATOR_HOST=http://parlel-bridge:4622
MICROSOFT_GRAPH_BASE_URL=http://parlel-bridge:4622/v1.0
AZURE_TENANT_ID=parlel
AZURE_CLIENT_ID=parlel
AZURE_CLIENT_SECRET=parlel
<!-- parlel:testenv:end -->