GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - i11v/effect-jmap: TypeScript JMAP protocol for Mail (RFC 8621) implementation

BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.entire
.entire
 
 
.github
.github
 
 
.husky
.husky
 
 
docs
docs
 
 
jmap-spec @ 15479d0
jmap-spec @ 15479d0
 
 
scripts
scripts
 
 
src
src
 
 
test-data/generated
test-data/generated
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.nvmrc
.nvmrc
 
 
.releaserc.json
.releaserc.json
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
commitlint.config.js
commitlint.config.js
 
 
docker-compose.test.yml
docker-compose.test.yml
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
tsconfig.json
tsconfig.json
 
 
vitest.config.ts
vitest.config.ts
 
 

Repository files navigation

Effect JMAP

A TypeScript implementation of the JMAP protocol for Mail (RFC 8621).

Features

  • Implements RFC 8621 JMAP for Mail with session discovery and batch optimization
  • Built on Effect-TS for type-safe error handling and composable operations

Installation

pnpm add effect-jmap

Quick Start

The simplest way to use effect-jmap is with the Promise-based client — no Effect knowledge required:

import { createJMAPClient } from 'effect-jmap'

const client = await createJMAPClient(
  'https://api.fastmail.com/jmap/session',
  'your-bearer-token-here'
)

// Account ID is auto-discovered
const mailboxes = await client.mailbox.getAll()
console.log(`Found ${mailboxes.length} mailboxes`)

// Query emails
const emails = await client.email.query({
  accountId: client.accountId,
  filter: { inMailbox: 'inbox-id' },
  limit: 10,
})

// Clean up when done
await client.dispose()

Using with Effect

For full control using Effect-TS layers and services:

import { Effect } from 'effect'
import {
  JMAPLive,
  MailboxService,
  JMAPClientService
} from 'effect-jmap'

// Create a complete layer with one function call
const mainLayer = JMAPLive(
  'https://api.fastmail.com/jmap/session',
  'your-bearer-token-here'
)

const program = Effect.gen(function* () {
  const jmapClient = yield* JMAPClientService
  const sessionInfo = yield* jmapClient.getSession
  const accountId = Object.keys(sessionInfo.accounts)[0]

  const mailboxService = yield* MailboxService
  const mailboxes = yield* mailboxService.getAll(accountId)

  console.log(`Found ${mailboxes.length} mailboxes`)
})

Effect.runPromise(program.pipe(Effect.provide(mainLayer)))

Advanced Usage

For fine-grained control over the HTTP client, JMAP client configuration, or specific service layers, you can manually compose layers:

import { Effect, Layer } from 'effect'
import { NodeHttpClient } from '@effect/platform-node'
import {
  createJMAPClientLayer,
  defaultConfig,
  AppLive,
  MailboxService,
  JMAPClientService
} from 'effect-jmap'

// Option 1: Manual layer composition
const mainLayer = Layer.mergeAll(
  NodeHttpClient.layerUndici,
  createJMAPClientLayer(sessionUrl, bearerToken),
  AppLive  // Includes all services + IdGenerator
)

// Option 2: With custom configuration
const customConfig = {
  ...defaultConfig(sessionUrl, bearerToken),
  timeout: 60000,
  maxRetries: 5,
  userAgent: 'my-app/1.0'
}

const customLayer = Layer.mergeAll(
  NodeHttpClient.layerUndici,
  createJMAPClientLayerWithConfig(customConfig),
  AppLive
)

// Use the same program as above
Effect.runPromise(program.pipe(Effect.provide(mainLayer)))

Contributing

Commit Convention

This project uses Conventional Commits. All commits must follow this format:

<type>(<scope>): <description>

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Adding or updating tests
  • build: Build system changes
  • ci: CI configuration changes
  • chore: Maintenance tasks

Commits are validated automatically via husky and commitlint.

Automated Releases

This project uses semantic-release for automated versioning and npm publishing:

  • Pushes to main trigger the release workflow
  • Version bumps are determined by commit types:
    • fix: commits trigger a patch release (1.0.x)
    • feat: commits trigger a minor release (1.x.0)
    • BREAKING CHANGE: in commit body triggers a major release (x.0.0)
  • Changelog is generated automatically
  • GitHub releases are created with release notes
  • Package is published to npm automatically

Required Secrets

For the automated release workflow, configure these repository secrets:

  • NPM_TOKEN: npm access token with publish permissions

About

TypeScript JMAP protocol for Mail (RFC 8621) implementation

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.