# OpenTypes — Full agent reference

> Complete reference for the OpenTypes registry: every available schema, its install command, dependencies, and full source code. Generated from `registry.json` and the source files in `packages/registry/src/types`, `packages/registry/src/schemas`, and `packages/registry/src/examples`.

## What is OpenTypes

OpenTypes is a community-driven registry of reusable TypeScript types with optional Zod v4 validators. Schemas are distributed via the shadcn CLI and are dropped directly into a consumer's project — there is no runtime dependency on OpenTypes itself.

## When to use this

Use OpenTypes whenever a task requires a validation schema for a common domain. Before hand-writing a Zod schema for one of the categories listed below, install the corresponding OpenTypes schema instead.

Categories: analytics, api, auth, aws, common, discord, ecommerce, forms, github, google, i18n, infrastructure, logging, notification, openai, sendgrid, seo, slack, social, stripe, twilio.

## Installing schemas

Prerequisites: `zod@^4` in the consumer project.

Configure the registry once in `components.json`:

```json
{
  "registries": {
    "@open-types": "https://open-types.dev/r/{name}.json"
  }
}
```

Install commands:

```bash
# TypeScript types only
npx shadcn add @open-types/<schema-name>

# TypeScript types + Zod v4 validators
npx shadcn add @open-types/<schema-name>-zod
```

Dependencies between schemas are resolved automatically — installing `user-zod` also installs `address-zod`.

## Schemas

### Address

- Name: `address`
- Categories: common
- Description: Postal address validation with US zip code, ISO country code, and partial variant.
- Install (types only): `npx shadcn add @open-types/address`
- Install (with Zod): `npx shadcn add @open-types/address-zod`
- Install (with examples): `npx shadcn add @open-types/address-examples`
- Detail page: https://open-types.dev/types/address
- Markdown: https://open-types.dev/types/address.md

#### Types

```typescript
export interface Address {
  street: string;
  street2?: string;
  city: string;
  state: string;
  postalCode: string;
  country: string;
}

export type PartialAddress = Partial<Address>;
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Address, PartialAddress } from "../types/address";

const US_ZIP_REGEX = /^\d{5}(-\d{4})?$/;
const ISO_COUNTRY_REGEX = /^[A-Za-z]{2}$/;

export const addressSchema = z.object({
  street: z.string().min(1, { error: "Street is required" }),
  street2: z.string().optional(),
  city: z.string().min(1, { error: "City is required" }),
  state: z.string().min(1, { error: "State is required" }),
  postalCode: z
    .string()
    .regex(US_ZIP_REGEX, { error: "Invalid US zip code (e.g. 12345 or 12345-6789)" }),
  country: z
    .string()
    .regex(ISO_COUNTRY_REGEX, { error: "Country must be a 2-letter ISO code" })
    .transform((val) => val.toUpperCase()),
}) satisfies z.ZodType<Address>;

export const partialAddressSchema = addressSchema.partial();

export type { Address, PartialAddress } from "../types/address";
```

#### Examples

```typescript
// Source: hand-crafted
import type { Address, PartialAddress } from "../types/address";

const minimal = {
  street: "123 Main St",
  city: "Springfield",
  state: "IL",
  postalCode: "62704",
  country: "US",
} as const satisfies Address;

export const addressExamples = {
  minimal,
  full: {
    street: "1600 Pennsylvania Avenue NW",
    street2: "West Wing, Suite 100",
    city: "Washington",
    state: "DC",
    postalCode: "20500-0001",
    country: "US",
  } satisfies Address,
  zipPlusFour: { ...minimal, postalCode: "62704-1234" } satisfies Address,
  lowercaseCountry: { ...minimal, country: "us" } satisfies Address,
} as const;

export const partialAddressExamples = {
  empty: {} satisfies PartialAddress,
  cityOnly: { city: "Springfield" } satisfies PartialAddress,
  full: addressExamples.full satisfies PartialAddress,
} as const;
```

### API Key

- Name: `api-key`
- Categories: api
- Description: API key with scopes, creation date, expiration, and last-used tracking.
- Install (types only): `npx shadcn add @open-types/api-key`
- Install (with Zod): `npx shadcn add @open-types/api-key-zod`
- Install (with examples): `npx shadcn add @open-types/api-key-examples`
- Detail page: https://open-types.dev/types/api-key
- Markdown: https://open-types.dev/types/api-key.md

#### Types

```typescript
export interface APIKey {
  id: string;
  key: string;
  name?: string;
  scopes?: string[];
  created_at: string;
  expires_at?: string;
  last_used_at?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { APIKey } from "../types/api-key";

export const apiKeySchema = z.object({
  id: z.string().min(1, { error: "API key ID is required" }),
  key: z.string().min(1, { error: "API key value is required" }),
  name: z.string().optional(),
  scopes: z.array(z.string().min(1, { error: "Scope cannot be empty" })).optional(),
  created_at: z.iso.datetime({ error: "Invalid created_at timestamp" }),
  expires_at: z.iso.datetime({ error: "Invalid expires_at timestamp" }).optional(),
  last_used_at: z.iso.datetime({ error: "Invalid last_used_at timestamp" }).optional(),
}) satisfies z.ZodType<APIKey>;

export type { APIKey } from "../types/api-key";
```

#### Examples

```typescript
// Source: hand-crafted
import type { APIKey } from "../types/api-key";

export const apiKeyExamples = {
  full: {
    id: "key_01HABCDEF0123456789ABCDE",
    key: "sk_live_abcdefghijklmnopqrstuvwxyz0123456789",
    name: "Production server",
    scopes: ["read", "write"],
    created_at: "2026-04-13T18:30:00Z",
    expires_at: "2027-04-13T18:30:00Z",
    last_used_at: "2026-05-16T09:15:00Z",
  } satisfies APIKey,
  minimal: {
    id: "key_minimal_001",
    key: "sk_test_minimal_token_value",
    created_at: "2026-05-16T18:30:00Z",
  } satisfies APIKey,
  readOnlyExpired: {
    id: "key_readonly_002",
    key: "sk_test_readonly_token",
    name: "Reporting bot",
    scopes: ["read"],
    created_at: "2025-01-01T00:00:00Z",
    expires_at: "2025-12-31T23:59:59Z",
    last_used_at: "2025-12-31T18:30:00Z",
  } satisfies APIKey,
  neverUsed: {
    id: "key_unused_003",
    key: "sk_test_unused_token",
    name: "Standby key",
    scopes: ["admin"],
    created_at: "2026-05-16T18:30:00Z",
  } satisfies APIKey,
  multiScope: {
    id: "key_multi_004",
    key: "sk_live_multi_scope_token",
    name: "CI pipeline",
    scopes: ["read", "write", "deploy:create", "audit:read"],
    created_at: "2026-01-01T00:00:00Z",
    last_used_at: "2026-05-16T18:30:00Z",
  } satisfies APIKey,
} as const;
```

### API Response

- Name: `api-response`
- Categories: api
- Description: Discriminated union API response with success/error variants and factory functions.
- Depends on: `@open-types/pagination`
- Install (types only): `npx shadcn add @open-types/api-response`
- Install (with Zod): `npx shadcn add @open-types/api-response-zod`
- Install (with examples): `npx shadcn add @open-types/api-response-examples`
- Detail page: https://open-types.dev/types/api-response
- Markdown: https://open-types.dev/types/api-response.md

#### Types

```typescript
import type { PaginationResponse } from "./pagination";

export interface ApiErrorItem {
  code: string;
  message: string;
  field?: string;
  details?: Record<string, unknown>;
}

export interface ApiSuccessResponse<T = unknown> {
  success: true;
  data: T;
  pagination?: PaginationResponse;
  meta?: Record<string, unknown>;
}

export interface ApiErrorResponse {
  success: false;
  errors: ApiErrorItem[];
}

export type ApiResponse = ApiSuccessResponse | ApiErrorResponse;
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  ApiErrorItem,
  ApiSuccessResponse,
  ApiErrorResponse,
  ApiResponse,
} from "../types/api-response";
import { paginationResponseSchema } from "./pagination";

export const apiErrorItemSchema = z.object({
  code: z.string().min(1, { error: "Error code is required" }),
  message: z.string().min(1, { error: "Error message is required" }),
  field: z.string().optional(),
  details: z.record(z.string(), z.any()).optional(),
}) satisfies z.ZodType<ApiErrorItem>;

export const apiSuccessResponseSchema = z.object({
  success: z.literal(true),
  data: z.unknown(),
  pagination: paginationResponseSchema.optional(),
  meta: z.record(z.string(), z.any()).optional(),
}) satisfies z.ZodType<ApiSuccessResponse>;

export const apiErrorResponseSchema = z.object({
  success: z.literal(false),
  errors: z
    .array(apiErrorItemSchema)
    .min(1, { error: "At least one error is required" }),
}) satisfies z.ZodType<ApiErrorResponse>;

export const apiResponseSchema = z.discriminatedUnion("success", [
  apiSuccessResponseSchema,
  apiErrorResponseSchema,
]);

/**
 * Factory: create a typed success response schema for a specific data shape.
 */
export function createSuccessResponseSchema<T extends z.ZodType>(dataSchema: T) {
  return z.object({
    success: z.literal(true),
    data: dataSchema,
    pagination: paginationResponseSchema.optional(),
    meta: z.record(z.string(), z.any()).optional(),
  });
}

/**
 * Factory: create a standard error response schema.
 */
export function createErrorResponseSchema() {
  return apiErrorResponseSchema;
}

export type {
  ApiErrorItem,
  ApiSuccessResponse,
  ApiErrorResponse,
  ApiResponse,
} from "../types/api-response";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  ApiErrorItem,
  ApiSuccessResponse,
  ApiErrorResponse,
  ApiResponse,
} from "../types/api-response";
import { paginationResponseExamples } from "./pagination.examples";

export const apiErrorItemExamples = {
  validation: {
    code: "validation_failed",
    message: "Email is required",
    field: "email",
  } satisfies ApiErrorItem,
  notFound: {
    code: "not_found",
    message: "Resource not found",
  } satisfies ApiErrorItem,
  withDetails: {
    code: "rate_limited",
    message: "Too many requests",
    details: { retry_after: 60, limit: 100 },
  } satisfies ApiErrorItem,
} as const;

export const apiSuccessResponseExamples = {
  singleObject: {
    success: true,
    data: { id: "user_321", name: "Jenny Rosen" },
  } satisfies ApiSuccessResponse,
  paginated: {
    success: true,
    data: [{ id: "1" }, { id: "2" }, { id: "3" }],
    pagination: paginationResponseExamples.middlePage,
  } satisfies ApiSuccessResponse,
  withMeta: {
    success: true,
    data: { value: 42 },
    meta: { requestId: "req_abc123", duration_ms: 12 },
  } satisfies ApiSuccessResponse,
  nullishData: { success: true, data: null } satisfies ApiSuccessResponse,
} as const;

export const apiErrorResponseExamples = {
  validation: {
    success: false,
    errors: [apiErrorItemExamples.validation],
  } satisfies ApiErrorResponse,
  multipleErrors: {
    success: false,
    errors: [
      apiErrorItemExamples.validation,
      { code: "validation_failed", message: "Password is too short", field: "password" },
    ],
  } satisfies ApiErrorResponse,
  rateLimited: {
    success: false,
    errors: [apiErrorItemExamples.withDetails],
  } satisfies ApiErrorResponse,
} as const;

export const apiResponseExamples = {
  success: apiSuccessResponseExamples.singleObject satisfies ApiResponse,
  paginatedSuccess: apiSuccessResponseExamples.paginated satisfies ApiResponse,
  validationError: apiErrorResponseExamples.validation satisfies ApiResponse,
  rateLimited: apiErrorResponseExamples.rateLimited satisfies ApiResponse,
} as const;
```

### Audit Log

- Name: `audit-log`
- Categories: logging
- Description: Audit trail entry with actor, resource, action, changes, and IP tracking.
- Install (types only): `npx shadcn add @open-types/audit-log`
- Install (with Zod): `npx shadcn add @open-types/audit-log-zod`
- Install (with examples): `npx shadcn add @open-types/audit-log-examples`
- Detail page: https://open-types.dev/types/audit-log
- Markdown: https://open-types.dev/types/audit-log.md

#### Types

```typescript
export type AuditLogAction = "create" | "read" | "update" | "delete";

export interface AuditLogChange {
  old?: unknown;
  new?: unknown;
}

export interface AuditLogEntry {
  id: string;
  action: AuditLogAction;
  actor_id: string;
  actor_type?: string;
  resource_type: string;
  resource_id: string;
  changes?: Record<string, AuditLogChange>;
  ip_address?: string;
  user_agent?: string;
  timestamp: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  AuditLogAction,
  AuditLogChange,
  AuditLogEntry,
} from "../types/audit-log";

export const auditLogActionSchema = z.enum([
  "create",
  "read",
  "update",
  "delete",
]) satisfies z.ZodType<AuditLogAction>;

export const auditLogChangeSchema = z.object({
  old: z.unknown().optional(),
  new: z.unknown().optional(),
}) satisfies z.ZodType<AuditLogChange>;

export const auditLogEntrySchema = z.object({
  id: z.string().min(1, { error: "Audit log ID is required" }),
  action: auditLogActionSchema,
  actor_id: z.string().min(1, { error: "Actor ID is required" }),
  actor_type: z.string().optional(),
  resource_type: z.string().min(1, { error: "Resource type is required" }),
  resource_id: z.string().min(1, { error: "Resource ID is required" }),
  changes: z.record(z.string(), auditLogChangeSchema).optional(),
  ip_address: z.string().optional(),
  user_agent: z.string().optional(),
  timestamp: z.iso.datetime({ error: "Invalid timestamp" }),
}) satisfies z.ZodType<AuditLogEntry>;

export type { AuditLogAction, AuditLogChange, AuditLogEntry } from "../types/audit-log";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  AuditLogAction,
  AuditLogChange,
  AuditLogEntry,
} from "../types/audit-log";

export const auditLogActionExamples = {
  create: "create",
  read: "read",
  update: "update",
  delete: "delete",
} as const satisfies Record<string, AuditLogAction>;

export const auditLogChangeExamples = {
  oldAndNew: { old: "viewer", new: "admin" } satisfies AuditLogChange,
  newOnly: { new: "active" } satisfies AuditLogChange,
  oldOnly: { old: "draft" } satisfies AuditLogChange,
  empty: {} satisfies AuditLogChange,
} as const;

const updateEntry = {
  id: "audit_01HABCDEF0123456789ABCDE",
  action: "update",
  actor_id: "user_321",
  actor_type: "user",
  resource_type: "user",
  resource_id: "user_555",
  changes: {
    role: { old: "viewer", new: "admin" },
    isActive: { old: false, new: true },
  },
  ip_address: "203.0.113.42",
  user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  timestamp: "2026-05-16T18:30:00Z",
} as const satisfies AuditLogEntry;

export const auditLogEntryExamples = {
  update: updateEntry,
  create: {
    ...updateEntry,
    id: "audit_create_001",
    action: "create",
    resource_id: "user_new_001",
    changes: { email: { new: "new@example.com" }, name: { new: "New User" } },
  } satisfies AuditLogEntry,
  delete: {
    ...updateEntry,
    id: "audit_delete_002",
    action: "delete",
    resource_id: "user_deleted_002",
  } satisfies AuditLogEntry,
  read: {
    ...updateEntry,
    id: "audit_read_003",
    action: "read",
    actor_type: "api_key",
    actor_id: "key_001",
  } satisfies AuditLogEntry,
  serviceAccount: {
    ...updateEntry,
    id: "audit_svc_004",
    actor_type: "service_account",
    actor_id: "svc_billing",
  } satisfies AuditLogEntry,
  minimal: {
    id: "audit_min_005",
    action: "read",
    actor_id: "user_321",
    resource_type: "report",
    resource_id: "report_001",
    timestamp: "2026-05-16T18:30:00Z",
  } satisfies AuditLogEntry,
} as const;
```

### AWS API Gateway Event

- Name: `aws-api-gateway-event`
- Categories: aws
- Description: AWS API Gateway v1 proxy event with headers, params, body, and request context.
- Install (types only): `npx shadcn add @open-types/aws-api-gateway-event`
- Install (with Zod): `npx shadcn add @open-types/aws-api-gateway-event-zod`
- Install (with examples): `npx shadcn add @open-types/aws-api-gateway-event-examples`
- Detail page: https://open-types.dev/types/aws-api-gateway-event
- Markdown: https://open-types.dev/types/aws-api-gateway-event.md

#### Types

```typescript
export interface AWSAPIGatewayRequestIdentity {
  sourceIp: string;
  userAgent: string;
}

export interface AWSAPIGatewayRequestContext {
  accountId: string;
  apiId: string;
  httpMethod: string;
  identity: AWSAPIGatewayRequestIdentity;
  path: string;
  protocol: string;
  requestId: string;
  requestTimeEpoch: number;
  resourceId: string;
  resourcePath: string;
  stage: string;
}

export interface AWSAPIGatewayEvent {
  resource: string;
  path: string;
  httpMethod: string;
  headers: Record<string, string> | null;
  queryStringParameters: Record<string, string> | null;
  pathParameters: Record<string, string> | null;
  stageVariables: Record<string, string> | null;
  requestContext: AWSAPIGatewayRequestContext;
  body: string | null;
  isBase64Encoded: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  AWSAPIGatewayRequestIdentity,
  AWSAPIGatewayRequestContext,
  AWSAPIGatewayEvent,
} from "../types/aws-api-gateway-event";

export const awsApiGatewayRequestIdentitySchema = z.object({
  sourceIp: z.string(),
  userAgent: z.string(),
}) satisfies z.ZodType<AWSAPIGatewayRequestIdentity>;

export const awsApiGatewayRequestContextSchema = z.object({
  accountId: z.string(),
  apiId: z.string(),
  httpMethod: z.string(),
  identity: awsApiGatewayRequestIdentitySchema,
  path: z.string(),
  protocol: z.string(),
  requestId: z.string(),
  requestTimeEpoch: z.number(),
  resourceId: z.string(),
  resourcePath: z.string(),
  stage: z.string(),
}) satisfies z.ZodType<AWSAPIGatewayRequestContext>;

export const awsApiGatewayEventSchema = z.object({
  resource: z.string(),
  path: z.string(),
  httpMethod: z.string(),
  headers: z.record(z.string(), z.string()).nullable(),
  queryStringParameters: z.record(z.string(), z.string()).nullable(),
  pathParameters: z.record(z.string(), z.string()).nullable(),
  stageVariables: z.record(z.string(), z.string()).nullable(),
  requestContext: awsApiGatewayRequestContextSchema,
  body: z.string().nullable(),
  isBase64Encoded: z.boolean(),
}) satisfies z.ZodType<AWSAPIGatewayEvent>;

export type {
  AWSAPIGatewayRequestIdentity,
  AWSAPIGatewayRequestContext,
  AWSAPIGatewayEvent,
} from "../types/aws-api-gateway-event";
```

#### Examples

```typescript
// Source: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format
// Captured: 2026-05
import type {
  AWSAPIGatewayRequestIdentity,
  AWSAPIGatewayRequestContext,
  AWSAPIGatewayEvent,
} from "../types/aws-api-gateway-event";

const identity = {
  sourceIp: "203.0.113.10",
  userAgent: "curl/8.7.1",
} as const satisfies AWSAPIGatewayRequestIdentity;

export const awsApiGatewayRequestIdentityExamples = {
  curl: identity,
  browser: {
    sourceIp: "198.51.100.7",
    userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15",
  } satisfies AWSAPIGatewayRequestIdentity,
} as const;

const requestContext = {
  accountId: "123456789012",
  apiId: "a1b2c3d4e5",
  httpMethod: "GET",
  identity,
  path: "/prod/orders/42",
  protocol: "HTTP/1.1",
  requestId: "c0ffee12-3456-7890-abcd-ef1234567890",
  requestTimeEpoch: 1713012345678,
  resourceId: "abc123",
  resourcePath: "/orders/{id}",
  stage: "prod",
} as const satisfies AWSAPIGatewayRequestContext;

export const awsApiGatewayRequestContextExamples = {
  get: requestContext,
  post: {
    ...requestContext,
    httpMethod: "POST",
    path: "/prod/orders",
    resourcePath: "/orders",
  } satisfies AWSAPIGatewayRequestContext,
} as const;

const getEvent = {
  resource: "/orders/{id}",
  path: "/prod/orders/42",
  httpMethod: "GET",
  headers: {
    Accept: "application/json",
    Host: "a1b2c3d4e5.execute-api.us-east-1.amazonaws.com",
  },
  queryStringParameters: { include: "items" },
  pathParameters: { id: "42" },
  stageVariables: { environment: "production" },
  requestContext,
  body: null,
  isBase64Encoded: false,
} as const satisfies AWSAPIGatewayEvent;

export const awsApiGatewayEventExamples = {
  get: getEvent,
  postWithBody: {
    ...getEvent,
    resource: "/orders",
    path: "/prod/orders",
    httpMethod: "POST",
    headers: { "Content-Type": "application/json" },
    queryStringParameters: null,
    pathParameters: null,
    body: '{"item":"sku_123","quantity":2}',
    requestContext: awsApiGatewayRequestContextExamples.post,
  } satisfies AWSAPIGatewayEvent,
  base64Body: {
    ...getEvent,
    httpMethod: "PUT",
    body: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
    isBase64Encoded: true,
  } satisfies AWSAPIGatewayEvent,
  allNullCollections: {
    ...getEvent,
    headers: null,
    queryStringParameters: null,
    pathParameters: null,
    stageVariables: null,
    body: null,
  } satisfies AWSAPIGatewayEvent,
} as const;
```

### AWS API Gateway V2 Event

- Name: `aws-api-gateway-v2-event`
- Categories: aws
- Description: AWS API Gateway v2 HTTP event with simplified routing and request context.
- Install (types only): `npx shadcn add @open-types/aws-api-gateway-v2-event`
- Install (with Zod): `npx shadcn add @open-types/aws-api-gateway-v2-event-zod`
- Install (with examples): `npx shadcn add @open-types/aws-api-gateway-v2-event-examples`
- Detail page: https://open-types.dev/types/aws-api-gateway-v2-event
- Markdown: https://open-types.dev/types/aws-api-gateway-v2-event.md

#### Types

```typescript
export interface AWSAPIGatewayV2Http {
  method: string;
  path: string;
  protocol: string;
  sourceIp: string;
  userAgent: string;
}

export interface AWSAPIGatewayV2RequestContext {
  accountId: string;
  apiId: string;
  domainName: string;
  domainPrefix: string;
  http: AWSAPIGatewayV2Http;
  requestId: string;
  routeKey: string;
  stage: string;
  time: string;
  timeEpoch: number;
}

export interface AWSAPIGatewayV2Event {
  version: "2.0";
  routeKey: string;
  rawPath: string;
  rawQueryString: string;
  headers: Record<string, string>;
  queryStringParameters?: Record<string, string>;
  pathParameters?: Record<string, string>;
  body?: string | null;
  isBase64Encoded: boolean;
  requestContext: AWSAPIGatewayV2RequestContext;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  AWSAPIGatewayV2Http,
  AWSAPIGatewayV2RequestContext,
  AWSAPIGatewayV2Event,
} from "../types/aws-api-gateway-v2-event";

export const awsApiGatewayV2HttpSchema = z.object({
  method: z.string(),
  path: z.string(),
  protocol: z.string(),
  sourceIp: z.string(),
  userAgent: z.string(),
}) satisfies z.ZodType<AWSAPIGatewayV2Http>;

export const awsApiGatewayV2RequestContextSchema = z.object({
  accountId: z.string(),
  apiId: z.string(),
  domainName: z.string(),
  domainPrefix: z.string(),
  http: awsApiGatewayV2HttpSchema,
  requestId: z.string(),
  routeKey: z.string(),
  stage: z.string(),
  time: z.string(),
  timeEpoch: z.number(),
}) satisfies z.ZodType<AWSAPIGatewayV2RequestContext>;

export const awsApiGatewayV2EventSchema = z.object({
  version: z.literal("2.0"),
  routeKey: z.string(),
  rawPath: z.string(),
  rawQueryString: z.string(),
  headers: z.record(z.string(), z.string()),
  queryStringParameters: z.record(z.string(), z.string()).optional(),
  pathParameters: z.record(z.string(), z.string()).optional(),
  body: z.string().nullable().optional(),
  isBase64Encoded: z.boolean(),
  requestContext: awsApiGatewayV2RequestContextSchema,
}) satisfies z.ZodType<AWSAPIGatewayV2Event>;

export type {
  AWSAPIGatewayV2Http,
  AWSAPIGatewayV2RequestContext,
  AWSAPIGatewayV2Event,
} from "../types/aws-api-gateway-v2-event";
```

#### Examples

```typescript
// Source: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
// Captured: 2026-05
import type {
  AWSAPIGatewayV2Http,
  AWSAPIGatewayV2RequestContext,
  AWSAPIGatewayV2Event,
} from "../types/aws-api-gateway-v2-event";

const http = {
  method: "POST",
  path: "/checkout",
  protocol: "HTTP/1.1",
  sourceIp: "198.51.100.42",
  userAgent: "Amazon CloudFront",
} as const satisfies AWSAPIGatewayV2Http;

export const awsApiGatewayV2HttpExamples = {
  post: http,
  get: { ...http, method: "GET", path: "/health" } satisfies AWSAPIGatewayV2Http,
  delete: { ...http, method: "DELETE", path: "/checkout/123" } satisfies AWSAPIGatewayV2Http,
} as const;

const requestContext = {
  accountId: "123456789012",
  apiId: "wxyz9876",
  domainName: "wxyz9876.execute-api.us-west-2.amazonaws.com",
  domainPrefix: "wxyz9876",
  http,
  requestId: "JfJ3ci7lvHcEMGg=",
  routeKey: "POST /checkout",
  stage: "$default",
  time: "13/Apr/2026:18:24:31 +0000",
  timeEpoch: 1776104671000,
} as const satisfies AWSAPIGatewayV2RequestContext;

export const awsApiGatewayV2RequestContextExamples = {
  default: requestContext,
  productionStage: { ...requestContext, stage: "production" } satisfies AWSAPIGatewayV2RequestContext,
} as const;

const minimal = {
  version: "2.0",
  routeKey: "POST /checkout",
  rawPath: "/checkout",
  rawQueryString: "coupon=SPRING26",
  headers: {
    host: "wxyz9876.execute-api.us-west-2.amazonaws.com",
    "content-type": "application/json",
  },
  isBase64Encoded: false,
  requestContext,
} as const satisfies AWSAPIGatewayV2Event;

export const awsApiGatewayV2EventExamples = {
  minimal,
  full: {
    ...minimal,
    queryStringParameters: { coupon: "SPRING26" },
    pathParameters: { proxy: "checkout" },
    body: '{"cartId":"cart_123"}',
  } satisfies AWSAPIGatewayV2Event,
  base64Body: {
    ...minimal,
    body: "eyJjYXJ0SWQiOiJjYXJ0XzEyMyJ9",
    isBase64Encoded: true,
  } satisfies AWSAPIGatewayV2Event,
  nullBody: { ...minimal, body: null } satisfies AWSAPIGatewayV2Event,
  rootRoute: {
    ...minimal,
    routeKey: "$default",
    rawPath: "/",
    rawQueryString: "",
  } satisfies AWSAPIGatewayV2Event,
} as const;
```

### AWS DynamoDB Stream Event

- Name: `aws-dynamodb-stream-event`
- Categories: aws
- Description: AWS DynamoDB Streams event with record changes, keys, and stream view type.
- Install (types only): `npx shadcn add @open-types/aws-dynamodb-stream-event`
- Install (with Zod): `npx shadcn add @open-types/aws-dynamodb-stream-event-zod`
- Install (with examples): `npx shadcn add @open-types/aws-dynamodb-stream-event-examples`
- Detail page: https://open-types.dev/types/aws-dynamodb-stream-event
- Markdown: https://open-types.dev/types/aws-dynamodb-stream-event.md

#### Types

```typescript
export type AWSDynamoDBStreamViewType =
  | "KEYS_ONLY"
  | "NEW_IMAGE"
  | "OLD_IMAGE"
  | "NEW_AND_OLD_IMAGES";

export interface AWSDynamoDBStreamRecord {
  Keys: Record<string, Record<string, unknown>>;
  NewImage?: Record<string, Record<string, unknown>>;
  OldImage?: Record<string, Record<string, unknown>>;
  SequenceNumber: string;
  SizeBytes: number;
  StreamViewType: AWSDynamoDBStreamViewType;
}

export type AWSDynamoDBEventName = "INSERT" | "MODIFY" | "REMOVE";

export interface AWSDynamoDBEventRecord {
  eventID: string;
  eventName: AWSDynamoDBEventName;
  eventVersion: string;
  eventSource: string;
  awsRegion: string;
  dynamodb: AWSDynamoDBStreamRecord;
}

export interface AWSDynamoDBStreamEvent {
  Records: AWSDynamoDBEventRecord[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  AWSDynamoDBStreamViewType,
  AWSDynamoDBStreamRecord,
  AWSDynamoDBEventName,
  AWSDynamoDBEventRecord,
  AWSDynamoDBStreamEvent,
} from "../types/aws-dynamodb-stream-event";

export const awsDynamoDbStreamViewTypeSchema = z.enum([
  "KEYS_ONLY",
  "NEW_IMAGE",
  "OLD_IMAGE",
  "NEW_AND_OLD_IMAGES",
]) satisfies z.ZodType<AWSDynamoDBStreamViewType>;

export const awsDynamoDbStreamRecordSchema = z.object({
  Keys: z.record(z.string(), z.record(z.string(), z.unknown())),
  NewImage: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
  OldImage: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
  SequenceNumber: z.string(),
  SizeBytes: z.number(),
  StreamViewType: awsDynamoDbStreamViewTypeSchema,
}) satisfies z.ZodType<AWSDynamoDBStreamRecord>;

export const awsDynamoDbEventNameSchema = z.enum([
  "INSERT",
  "MODIFY",
  "REMOVE",
]) satisfies z.ZodType<AWSDynamoDBEventName>;

export const awsDynamoDbEventRecordSchema = z.object({
  eventID: z.string(),
  eventName: awsDynamoDbEventNameSchema,
  eventVersion: z.string(),
  eventSource: z.string(),
  awsRegion: z.string(),
  dynamodb: awsDynamoDbStreamRecordSchema,
}) satisfies z.ZodType<AWSDynamoDBEventRecord>;

export const awsDynamoDbStreamEventSchema = z.object({
  Records: z.array(awsDynamoDbEventRecordSchema),
}) satisfies z.ZodType<AWSDynamoDBStreamEvent>;

export type {
  AWSDynamoDBStreamViewType,
  AWSDynamoDBStreamRecord,
  AWSDynamoDBEventName,
  AWSDynamoDBEventRecord,
  AWSDynamoDBStreamEvent,
} from "../types/aws-dynamodb-stream-event";
```

#### Examples

```typescript
// Source: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#with-ddb-create-test-function
// Captured: 2026-05
import type {
  AWSDynamoDBStreamViewType,
  AWSDynamoDBStreamRecord,
  AWSDynamoDBEventName,
  AWSDynamoDBEventRecord,
  AWSDynamoDBStreamEvent,
} from "../types/aws-dynamodb-stream-event";

export const awsDynamoDbStreamViewTypeExamples = {
  keysOnly: "KEYS_ONLY",
  newImage: "NEW_IMAGE",
  oldImage: "OLD_IMAGE",
  newAndOld: "NEW_AND_OLD_IMAGES",
} as const satisfies Record<string, AWSDynamoDBStreamViewType>;

export const awsDynamoDbEventNameExamples = {
  insert: "INSERT",
  modify: "MODIFY",
  remove: "REMOVE",
} as const satisfies Record<string, AWSDynamoDBEventName>;

const modifyRecord = {
  Keys: { id: { S: "user#42" } },
  NewImage: {
    id: { S: "user#42" },
    status: { S: "active" },
  },
  OldImage: {
    id: { S: "user#42" },
    status: { S: "pending" },
  },
  SequenceNumber: "111",
  SizeBytes: 82,
  StreamViewType: "NEW_AND_OLD_IMAGES",
} as const satisfies AWSDynamoDBStreamRecord;

export const awsDynamoDbStreamRecordExamples = {
  modify: modifyRecord,
  insert: {
    Keys: { id: { S: "user#43" } },
    NewImage: { id: { S: "user#43" }, status: { S: "pending" } },
    SequenceNumber: "112",
    SizeBytes: 64,
    StreamViewType: "NEW_IMAGE",
  } satisfies AWSDynamoDBStreamRecord,
  remove: {
    Keys: { id: { S: "user#44" } },
    OldImage: { id: { S: "user#44" }, status: { S: "active" } },
    SequenceNumber: "113",
    SizeBytes: 48,
    StreamViewType: "OLD_IMAGE",
  } satisfies AWSDynamoDBStreamRecord,
  keysOnly: {
    Keys: { id: { S: "user#45" }, sort: { N: "1" } },
    SequenceNumber: "114",
    SizeBytes: 24,
    StreamViewType: "KEYS_ONLY",
  } satisfies AWSDynamoDBStreamRecord,
} as const;

const modifyEvent = {
  eventID: "1",
  eventName: "MODIFY",
  eventVersion: "1.1",
  eventSource: "aws:dynamodb",
  awsRegion: "eu-west-1",
  dynamodb: modifyRecord,
} as const satisfies AWSDynamoDBEventRecord;

export const awsDynamoDbEventRecordExamples = {
  modify: modifyEvent,
  insert: {
    ...modifyEvent,
    eventID: "2",
    eventName: "INSERT",
    dynamodb: awsDynamoDbStreamRecordExamples.insert,
  } satisfies AWSDynamoDBEventRecord,
  remove: {
    ...modifyEvent,
    eventID: "3",
    eventName: "REMOVE",
    dynamodb: awsDynamoDbStreamRecordExamples.remove,
  } satisfies AWSDynamoDBEventRecord,
} as const;

export const awsDynamoDbStreamEventExamples = {
  single: { Records: [modifyEvent] } satisfies AWSDynamoDBStreamEvent,
  mixed: {
    Records: [
      awsDynamoDbEventRecordExamples.insert,
      awsDynamoDbEventRecordExamples.modify,
      awsDynamoDbEventRecordExamples.remove,
    ],
  } satisfies AWSDynamoDBStreamEvent,
} as const;
```

### AWS S3 Event

- Name: `aws-s3-event`
- Categories: aws
- Description: AWS S3 event notification with bucket and object details per record.
- Install (types only): `npx shadcn add @open-types/aws-s3-event`
- Install (with Zod): `npx shadcn add @open-types/aws-s3-event-zod`
- Install (with examples): `npx shadcn add @open-types/aws-s3-event-examples`
- Detail page: https://open-types.dev/types/aws-s3-event
- Markdown: https://open-types.dev/types/aws-s3-event.md

#### Types

```typescript
export interface AWSS3Bucket {
  name: string;
  arn: string;
}

export interface AWSS3Object {
  key: string;
  size: number;
  eTag: string;
  sequencer: string;
}

export interface AWSS3Detail {
  bucket: AWSS3Bucket;
  object: AWSS3Object;
}

export interface AWSS3EventRecord {
  eventVersion: string;
  eventSource: string;
  awsRegion: string;
  eventTime: string;
  eventName: string;
  s3: AWSS3Detail;
}

export interface AWSS3Event {
  Records: AWSS3EventRecord[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  AWSS3Bucket,
  AWSS3Object,
  AWSS3Detail,
  AWSS3EventRecord,
  AWSS3Event,
} from "../types/aws-s3-event";

export const awsS3BucketSchema = z.object({
  name: z.string(),
  arn: z.string(),
}) satisfies z.ZodType<AWSS3Bucket>;

export const awsS3ObjectSchema = z.object({
  key: z.string(),
  size: z.number(),
  eTag: z.string(),
  sequencer: z.string(),
}) satisfies z.ZodType<AWSS3Object>;

export const awsS3DetailSchema = z.object({
  bucket: awsS3BucketSchema,
  object: awsS3ObjectSchema,
}) satisfies z.ZodType<AWSS3Detail>;

export const awsS3EventRecordSchema = z.object({
  eventVersion: z.string(),
  eventSource: z.string(),
  awsRegion: z.string(),
  eventTime: z.string(),
  eventName: z.string(),
  s3: awsS3DetailSchema,
}) satisfies z.ZodType<AWSS3EventRecord>;

export const awsS3EventSchema = z.object({
  Records: z.array(awsS3EventRecordSchema),
}) satisfies z.ZodType<AWSS3Event>;

export type {
  AWSS3Bucket,
  AWSS3Object,
  AWSS3Detail,
  AWSS3EventRecord,
  AWSS3Event,
} from "../types/aws-s3-event";
```

#### Examples

```typescript
// Source: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-content-structure.html
// Captured: 2026-05
import type {
  AWSS3Bucket,
  AWSS3Object,
  AWSS3Detail,
  AWSS3EventRecord,
  AWSS3Event,
} from "../types/aws-s3-event";

const bucket = {
  name: "photo-uploads-prod",
  arn: "arn:aws:s3:::photo-uploads-prod",
} as const satisfies AWSS3Bucket;

export const awsS3BucketExamples = {
  prod: bucket,
  staging: {
    name: "photo-uploads-staging",
    arn: "arn:aws:s3:::photo-uploads-staging",
  } satisfies AWSS3Bucket,
} as const;

const object = {
  key: "users/42/avatar.png",
  size: 204800,
  eTag: "9b2cf535f27731c974343645a3985328",
  sequencer: "0065B0D8F26D9A5C1F",
} as const satisfies AWSS3Object;

export const awsS3ObjectExamples = {
  smallAvatar: object,
  largeUpload: { ...object, key: "exports/2026-05-16.csv", size: 104857600 } satisfies AWSS3Object,
  emptyObject: { ...object, key: "tombstone.txt", size: 0 } satisfies AWSS3Object,
} as const;

const detail = { bucket, object } as const satisfies AWSS3Detail;

export const awsS3DetailExamples = {
  smallAvatar: detail,
} as const;

const putRecord = {
  eventVersion: "2.1",
  eventSource: "aws:s3",
  awsRegion: "us-east-1",
  eventTime: "2026-04-13T18:31:22.123Z",
  eventName: "ObjectCreated:Put",
  s3: detail,
} as const satisfies AWSS3EventRecord;

export const awsS3EventRecordExamples = {
  put: putRecord,
  delete: {
    ...putRecord,
    eventName: "ObjectRemoved:Delete",
  } satisfies AWSS3EventRecord,
  copy: { ...putRecord, eventName: "ObjectCreated:Copy" } satisfies AWSS3EventRecord,
  multipartComplete: {
    ...putRecord,
    eventName: "ObjectCreated:CompleteMultipartUpload",
  } satisfies AWSS3EventRecord,
} as const;

export const awsS3EventExamples = {
  single: { Records: [putRecord] } satisfies AWSS3Event,
  batch: {
    Records: [putRecord, awsS3EventRecordExamples.delete, awsS3EventRecordExamples.copy],
  } satisfies AWSS3Event,
} as const;
```

### AWS SNS Event

- Name: `aws-sns-event`
- Categories: aws
- Description: AWS SNS event with message records, topic ARN, and message attributes.
- Install (types only): `npx shadcn add @open-types/aws-sns-event`
- Install (with Zod): `npx shadcn add @open-types/aws-sns-event-zod`
- Install (with examples): `npx shadcn add @open-types/aws-sns-event-examples`
- Detail page: https://open-types.dev/types/aws-sns-event
- Markdown: https://open-types.dev/types/aws-sns-event.md

#### Types

```typescript
export interface AWSSNSMessageAttribute {
  Type: string;
  Value: string;
}

export interface AWSSNSMessage {
  Type: string;
  MessageId: string;
  TopicArn: string;
  Subject: string | null;
  Message: string;
  Timestamp: string;
  SignatureVersion: string;
  Signature: string;
  SigningCertUrl: string;
  UnsubscribeUrl: string;
  MessageAttributes: Record<string, AWSSNSMessageAttribute>;
}

export interface AWSSNSEventRecord {
  EventVersion: string;
  EventSubscriptionArn: string;
  EventSource: string;
  Sns: AWSSNSMessage;
}

export interface AWSSNSEvent {
  Records: AWSSNSEventRecord[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  AWSSNSMessageAttribute,
  AWSSNSMessage,
  AWSSNSEventRecord,
  AWSSNSEvent,
} from "../types/aws-sns-event";

export const awsSnsMessageAttributeSchema = z.object({
  Type: z.string(),
  Value: z.string(),
}) satisfies z.ZodType<AWSSNSMessageAttribute>;

export const awsSnsMessageSchema = z.object({
  Type: z.string(),
  MessageId: z.string(),
  TopicArn: z.string(),
  Subject: z.string().nullable(),
  Message: z.string(),
  Timestamp: z.string(),
  SignatureVersion: z.string(),
  Signature: z.string(),
  SigningCertUrl: z.string(),
  UnsubscribeUrl: z.string(),
  MessageAttributes: z.record(z.string(), awsSnsMessageAttributeSchema),
}) satisfies z.ZodType<AWSSNSMessage>;

export const awsSnsEventRecordSchema = z.object({
  EventVersion: z.string(),
  EventSubscriptionArn: z.string(),
  EventSource: z.string(),
  Sns: awsSnsMessageSchema,
}) satisfies z.ZodType<AWSSNSEventRecord>;

export const awsSnsEventSchema = z.object({
  Records: z.array(awsSnsEventRecordSchema),
}) satisfies z.ZodType<AWSSNSEvent>;

export type {
  AWSSNSMessageAttribute,
  AWSSNSMessage,
  AWSSNSEventRecord,
  AWSSNSEvent,
} from "../types/aws-sns-event";
```

#### Examples

```typescript
// Source: https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html#with-sns-create-test-function
// Captured: 2026-05
import type {
  AWSSNSMessageAttribute,
  AWSSNSMessage,
  AWSSNSEventRecord,
  AWSSNSEvent,
} from "../types/aws-sns-event";

const eventTypeAttr = {
  Type: "String",
  Value: "billing.invoice.created",
} as const satisfies AWSSNSMessageAttribute;

export const awsSnsMessageAttributeExamples = {
  string: eventTypeAttr,
  number: { Type: "Number", Value: "42" } satisfies AWSSNSMessageAttribute,
  arrayJson: {
    Type: "String.Array",
    Value: '["tag1","tag2"]',
  } satisfies AWSSNSMessageAttribute,
} as const;

const notification = {
  Type: "Notification",
  MessageId: "95df01b4-ee98-5cb9-9903-4c221d41eb5e",
  TopicArn: "arn:aws:sns:us-east-1:123456789012:billing-events",
  Subject: "Invoice created",
  Message: '{"invoiceId":"inv_123","status":"created"}',
  Timestamp: "2026-04-13T18:45:00.000Z",
  SignatureVersion: "1",
  Signature: "EXAMPLElDMO3T0exampleSignature==",
  SigningCertUrl: "https://sns.us-east-1.amazonaws.com/SimpleNotificationService.pem",
  UnsubscribeUrl: "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:123456789012:billing-events:sub-123",
  MessageAttributes: { eventType: eventTypeAttr },
} as const satisfies AWSSNSMessage;

export const awsSnsMessageExamples = {
  notification,
  noSubject: { ...notification, Subject: null } satisfies AWSSNSMessage,
  plainText: {
    ...notification,
    MessageId: "abcdef01-2345-6789-abcd-ef0123456789",
    Subject: "Welcome",
    Message: "Welcome to our service!",
    MessageAttributes: {},
  } satisfies AWSSNSMessage,
} as const;

const eventRecord = {
  EventVersion: "1.0",
  EventSubscriptionArn: "arn:aws:sns:us-east-1:123456789012:billing-events:2bcfbf39-05c3-41de-9991-61f12EXAMPLE",
  EventSource: "aws:sns",
  Sns: notification,
} as const satisfies AWSSNSEventRecord;

export const awsSnsEventRecordExamples = {
  notification: eventRecord,
  plainText: { ...eventRecord, Sns: awsSnsMessageExamples.plainText } satisfies AWSSNSEventRecord,
} as const;

export const awsSnsEventExamples = {
  single: { Records: [eventRecord] } satisfies AWSSNSEvent,
  batch: {
    Records: [eventRecord, awsSnsEventRecordExamples.plainText],
  } satisfies AWSSNSEvent,
} as const;
```

### AWS SQS Event

- Name: `aws-sqs-event`
- Categories: aws
- Description: AWS SQS event with message records, attributes, and source ARN.
- Install (types only): `npx shadcn add @open-types/aws-sqs-event`
- Install (with Zod): `npx shadcn add @open-types/aws-sqs-event-zod`
- Install (with examples): `npx shadcn add @open-types/aws-sqs-event-examples`
- Detail page: https://open-types.dev/types/aws-sqs-event
- Markdown: https://open-types.dev/types/aws-sqs-event.md

#### Types

```typescript
export interface AWSSQSMessageAttribute {
  stringValue?: string;
  dataType: string;
}

export interface AWSSQSRecord {
  messageId: string;
  receiptHandle: string;
  body: string;
  attributes: Record<string, string>;
  messageAttributes: Record<string, AWSSQSMessageAttribute>;
  md5OfBody: string;
  eventSource: string;
  eventSourceARN: string;
  awsRegion: string;
}

export interface AWSSQSEvent {
  Records: AWSSQSRecord[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  AWSSQSMessageAttribute,
  AWSSQSRecord,
  AWSSQSEvent,
} from "../types/aws-sqs-event";

export const awsSqsMessageAttributeSchema = z.object({
  stringValue: z.string().optional(),
  dataType: z.string(),
}) satisfies z.ZodType<AWSSQSMessageAttribute>;

export const awsSqsRecordSchema = z.object({
  messageId: z.string(),
  receiptHandle: z.string(),
  body: z.string(),
  attributes: z.record(z.string(), z.string()),
  messageAttributes: z.record(z.string(), awsSqsMessageAttributeSchema),
  md5OfBody: z.string(),
  eventSource: z.string(),
  eventSourceARN: z.string(),
  awsRegion: z.string(),
}) satisfies z.ZodType<AWSSQSRecord>;

export const awsSqsEventSchema = z.object({
  Records: z.array(awsSqsRecordSchema),
}) satisfies z.ZodType<AWSSQSEvent>;

export type {
  AWSSQSMessageAttribute,
  AWSSQSRecord,
  AWSSQSEvent,
} from "../types/aws-sqs-event";
```

#### Examples

```typescript
// Source: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#example-standard-queue-message-event
// Captured: 2026-05
import type {
  AWSSQSMessageAttribute,
  AWSSQSRecord,
  AWSSQSEvent,
} from "../types/aws-sqs-event";

const stringAttr = {
  stringValue: "order.created",
  dataType: "String",
} as const satisfies AWSSQSMessageAttribute;

export const awsSqsMessageAttributeExamples = {
  string: stringAttr,
  number: {
    stringValue: "42",
    dataType: "Number",
  } satisfies AWSSQSMessageAttribute,
  binary: { dataType: "Binary" } satisfies AWSSQSMessageAttribute,
} as const;

const record = {
  messageId: "6f7e1df9-8b8d-4f0f-88a9-b4cf9eb7f5b8",
  receiptHandle: "AQEBJQxO6qexampleReceiptHandle==",
  body: '{"orderId":"ord_123","status":"created"}',
  attributes: {
    ApproximateReceiveCount: "1",
    SentTimestamp: "1776105100000",
    SenderId: "AIDAEXAMPLE123456789",
  },
  messageAttributes: { eventType: stringAttr },
  md5OfBody: "098f6bcd4621d373cade4e832627b4f6",
  eventSource: "aws:sqs",
  eventSourceARN: "arn:aws:sqs:us-east-1:123456789012:orders-queue",
  awsRegion: "us-east-1",
} as const satisfies AWSSQSRecord;

export const awsSqsRecordExamples = {
  standard: record,
  fifo: {
    ...record,
    messageId: "fifo-message-id-001",
    eventSourceARN: "arn:aws:sqs:us-east-1:123456789012:orders-queue.fifo",
    attributes: {
      ...record.attributes,
      MessageGroupId: "tenant-42",
      MessageDeduplicationId: "ord_123-2026-05-16",
    },
  } satisfies AWSSQSRecord,
  retry: {
    ...record,
    attributes: { ...record.attributes, ApproximateReceiveCount: "5" },
  } satisfies AWSSQSRecord,
  noMessageAttributes: { ...record, messageAttributes: {} } satisfies AWSSQSRecord,
} as const;

export const awsSqsEventExamples = {
  single: { Records: [record] } satisfies AWSSQSEvent,
  batch: {
    Records: [
      record,
      { ...record, messageId: "b3e1d2f4-2a3b-4c5d-6e7f-8a9b0c1d2e3f" },
      { ...record, messageId: "c4e2d3f5-3b4c-5d6e-7f8a-9b0c1d2e3f4a" },
    ],
  } satisfies AWSSQSEvent,
} as const;
```

### Bulk Operation

- Name: `bulk-operation`
- Categories: api
- Description: Bulk API operation request and response with per-operation status tracking.
- Install (types only): `npx shadcn add @open-types/bulk-operation`
- Install (with Zod): `npx shadcn add @open-types/bulk-operation-zod`
- Install (with examples): `npx shadcn add @open-types/bulk-operation-examples`
- Detail page: https://open-types.dev/types/bulk-operation
- Markdown: https://open-types.dev/types/bulk-operation.md

#### Types

```typescript
export type BulkOperationMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";

export interface BulkOperationRequest {
  id: string;
  method: BulkOperationMethod;
  path: string;
  body?: Record<string, unknown>;
}

export interface BulkOperationResult {
  id: string;
  status: number;
  body?: Record<string, unknown>;
  error?: string;
}

export interface BulkOperation {
  operations: BulkOperationRequest[];
}

export interface BulkOperationResponse {
  results: BulkOperationResult[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  BulkOperation,
  BulkOperationMethod,
  BulkOperationRequest,
  BulkOperationResponse,
  BulkOperationResult,
} from "../types/bulk-operation";

export const bulkOperationMethodSchema = z.enum([
  "GET",
  "POST",
  "PUT",
  "PATCH",
  "DELETE",
]) satisfies z.ZodType<BulkOperationMethod>;

export const bulkOperationRequestSchema = z.object({
  id: z.string().min(1, { error: "Operation ID is required" }),
  method: bulkOperationMethodSchema,
  path: z.string().min(1, { error: "Path is required" }),
  body: z.record(z.string(), z.unknown()).optional(),
}) satisfies z.ZodType<BulkOperationRequest>;

export const bulkOperationResultSchema = z.object({
  id: z.string().min(1, { error: "Result ID is required" }),
  status: z
    .number()
    .int()
    .min(100, { error: "Status must be a valid HTTP status code" })
    .max(599, { error: "Status must be a valid HTTP status code" }),
  body: z.record(z.string(), z.unknown()).optional(),
  error: z.string().optional(),
}) satisfies z.ZodType<BulkOperationResult>;

export const bulkOperationSchema = z.object({
  operations: z
    .array(bulkOperationRequestSchema)
    .min(1, { error: "At least one operation is required" }),
}) satisfies z.ZodType<BulkOperation>;

export const bulkOperationResponseSchema = z.object({
  results: z.array(bulkOperationResultSchema),
}) satisfies z.ZodType<BulkOperationResponse>;

export type {
  BulkOperation,
  BulkOperationMethod,
  BulkOperationRequest,
  BulkOperationResponse,
  BulkOperationResult,
} from "../types/bulk-operation";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after Shopify/Stripe-style batch APIs
import type {
  BulkOperationMethod,
  BulkOperationRequest,
  BulkOperationResult,
  BulkOperation,
  BulkOperationResponse,
} from "../types/bulk-operation";

export const bulkOperationMethodExamples = {
  get: "GET",
  post: "POST",
  put: "PUT",
  patch: "PATCH",
  delete: "DELETE",
} as const satisfies Record<string, BulkOperationMethod>;

const createOrder = {
  id: "op_1",
  method: "POST",
  path: "/v1/orders",
  body: { customer: "cus_321", items: [{ sku: "sku_abc", quantity: 2 }] },
} as const satisfies BulkOperationRequest;

const fetchOrder = {
  id: "op_2",
  method: "GET",
  path: "/v1/orders/ord_42",
} as const satisfies BulkOperationRequest;

const deleteOrder = {
  id: "op_3",
  method: "DELETE",
  path: "/v1/orders/ord_43",
} as const satisfies BulkOperationRequest;

export const bulkOperationRequestExamples = {
  create: createOrder,
  fetch: fetchOrder,
  remove: deleteOrder,
  update: {
    id: "op_4",
    method: "PATCH",
    path: "/v1/orders/ord_44",
    body: { status: "fulfilled" },
  } satisfies BulkOperationRequest,
} as const;

export const bulkOperationResultExamples = {
  ok: {
    id: "op_1",
    status: 201,
    body: { id: "ord_new", status: "created" },
  } satisfies BulkOperationResult,
  noContent: { id: "op_3", status: 204 } satisfies BulkOperationResult,
  failure: {
    id: "op_2",
    status: 404,
    error: "Order not found",
  } satisfies BulkOperationResult,
  validation: {
    id: "op_5",
    status: 422,
    body: { errors: [{ field: "quantity", message: "must be positive" }] },
    error: "Validation failed",
  } satisfies BulkOperationResult,
} as const;

export const bulkOperationExamples = {
  mixedMethods: {
    operations: [createOrder, fetchOrder, deleteOrder],
  } satisfies BulkOperation,
  singleOp: { operations: [createOrder] } satisfies BulkOperation,
} as const;

export const bulkOperationResponseExamples = {
  mixed: {
    results: [
      bulkOperationResultExamples.ok,
      bulkOperationResultExamples.failure,
      bulkOperationResultExamples.noContent,
    ],
  } satisfies BulkOperationResponse,
  empty: { results: [] } satisfies BulkOperationResponse,
} as const;
```

### Cache-Control

- Name: `cache-control`
- Categories: api
- Description: Cache-Control header directives with max-age, stale-while-revalidate, and immutable.
- Install (types only): `npx shadcn add @open-types/cache-control`
- Install (with Zod): `npx shadcn add @open-types/cache-control-zod`
- Install (with examples): `npx shadcn add @open-types/cache-control-examples`
- Detail page: https://open-types.dev/types/cache-control
- Markdown: https://open-types.dev/types/cache-control.md

#### Types

```typescript
export interface CacheControlDirectives {
  public?: boolean;
  private?: boolean;
  no_cache?: boolean;
  no_store?: boolean;
  max_age?: number;
  s_maxage?: number;
  must_revalidate?: boolean;
  proxy_revalidate?: boolean;
  immutable?: boolean;
  stale_while_revalidate?: number;
  stale_if_error?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { CacheControlDirectives } from "../types/cache-control";

export const cacheControlDirectivesSchema = z.object({
  public: z.boolean().optional(),
  private: z.boolean().optional(),
  no_cache: z.boolean().optional(),
  no_store: z.boolean().optional(),
  max_age: z.number().optional(),
  s_maxage: z.number().optional(),
  must_revalidate: z.boolean().optional(),
  proxy_revalidate: z.boolean().optional(),
  immutable: z.boolean().optional(),
  stale_while_revalidate: z.number().optional(),
  stale_if_error: z.number().optional(),
}) satisfies z.ZodType<CacheControlDirectives>;

export type { CacheControlDirectives } from "../types/cache-control";
```

#### Examples

```typescript
// Source: https://datatracker.ietf.org/doc/html/rfc9111#name-cache-control
// Captured: 2026-05
import type { CacheControlDirectives } from "../types/cache-control";

export const cacheControlDirectivesExamples = {
  publicCdn: {
    public: true,
    max_age: 3600,
    s_maxage: 86400,
    stale_while_revalidate: 86400,
  } satisfies CacheControlDirectives,
  privateUser: {
    private: true,
    max_age: 0,
    must_revalidate: true,
  } satisfies CacheControlDirectives,
  noStore: { no_store: true, no_cache: true } satisfies CacheControlDirectives,
  immutable: {
    public: true,
    max_age: 31_536_000,
    immutable: true,
  } satisfies CacheControlDirectives,
  staleIfError: {
    public: true,
    max_age: 600,
    stale_if_error: 86400,
    proxy_revalidate: true,
  } satisfies CacheControlDirectives,
  empty: {} satisfies CacheControlDirectives,
} as const;
```

### Cart Item

- Name: `cart-item`
- Categories: ecommerce
- Description: Shopping cart item and full cart validation with currency and quantity constraints.
- Depends on: `@open-types/product`
- Install (types only): `npx shadcn add @open-types/cart-item`
- Install (with Zod): `npx shadcn add @open-types/cart-item-zod`
- Install (with examples): `npx shadcn add @open-types/cart-item-examples`
- Detail page: https://open-types.dev/types/cart-item
- Markdown: https://open-types.dev/types/cart-item.md

#### Types

```typescript
import type { CurrencyCode } from "./product";

export interface CartItem {
  productId: string;
  name: string;
  quantity: number;
  unitPrice: number;
  currency?: CurrencyCode;
  variant?: string;
  imageUrl?: string;
}

export interface Cart {
  items: CartItem[];
  currency?: CurrencyCode;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { CartItem, Cart } from "../types/cart-item";
import { currencyCodeSchema } from "./product";

export const cartItemSchema = z.object({
  productId: z.uuid({ error: "Invalid product ID" }),
  name: z.string().min(1, { error: "Item name is required" }),
  quantity: z
    .number()
    .int({ error: "Quantity must be a whole number" })
    .min(1, { error: "Quantity must be at least 1" })
    .max(999, { error: "Quantity must be at most 999" }),
  unitPrice: z
    .number()
    .positive({ error: "Unit price must be positive" })
    .multipleOf(0.01, { error: "Unit price must have at most 2 decimal places" }),
  currency: currencyCodeSchema,
  variant: z.string().optional(),
  imageUrl: z.url({ error: "Image URL must be a valid URL" }).optional(),
}) satisfies z.ZodType<CartItem>;

export const cartSchema = z.object({
  items: z
    .array(cartItemSchema)
    .min(1, { error: "Cart must have at least one item" }),
  currency: currencyCodeSchema,
}) satisfies z.ZodType<Cart>;

export type { CartItem, Cart } from "../types/cart-item";
```

#### Examples

```typescript
// Source: hand-crafted
import type { CartItem, Cart } from "../types/cart-item";

const widget = {
  productId: "11111111-2222-4333-8444-555555555551",
  name: "Premium Widget",
  quantity: 2,
  unitPrice: 29.99,
  currency: "USD",
} as const satisfies CartItem;

const ebook = {
  productId: "44444444-4444-4333-8444-555555555554",
  name: "E-Book Bundle",
  quantity: 1,
  unitPrice: 19.99,
  currency: "USD",
  imageUrl: "https://cdn.example.com/products/ebook.png",
} as const satisfies CartItem;

const tShirt = {
  productId: "55555555-5555-4333-8444-555555555555",
  name: "Logo T-Shirt",
  quantity: 3,
  unitPrice: 24.0,
  currency: "USD",
  variant: "size:L,color:black",
  imageUrl: "https://cdn.example.com/products/tshirt-black-l.jpg",
} as const satisfies CartItem;

export const cartItemExamples = {
  basic: widget,
  withVariant: tShirt,
  digital: ebook,
  largeQuantity: { ...widget, quantity: 100 } satisfies CartItem,
} as const;

export const cartExamples = {
  multi: { items: [widget, tShirt, ebook], currency: "USD" } satisfies Cart,
  single: { items: [widget] } satisfies Cart,
  digitalOnly: { items: [ebook], currency: "USD" } satisfies Cart,
} as const;
```

### Contact Form

- Name: `contact-form`
- Categories: forms
- Description: Contact form validation with name, email, subject, message, and optional phone (E.164).
- Install (types only): `npx shadcn add @open-types/contact-form`
- Install (with Zod): `npx shadcn add @open-types/contact-form-zod`
- Install (with examples): `npx shadcn add @open-types/contact-form-examples`
- Detail page: https://open-types.dev/types/contact-form
- Markdown: https://open-types.dev/types/contact-form.md

#### Types

```typescript
export interface ContactForm {
  name: string;
  email: string;
  subject: string;
  message: string;
  phone?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { ContactForm } from "../types/contact-form";

const E164_REGEX = /^\+[1-9]\d{1,14}$/;

export const contactFormSchema = z.object({
  name: z.string().min(1, { error: "Name is required" }),
  email: z.email({ error: "Invalid email address" }),
  subject: z.string().min(1, { error: "Subject is required" }),
  message: z
    .string()
    .min(10, { error: "Message must be at least 10 characters" })
    .max(5000, { error: "Message must be at most 5000 characters" }),
  phone: z
    .string()
    .regex(E164_REGEX, { error: "Phone must be in E.164 format (e.g. +14155551234)" })
    .optional(),
}) satisfies z.ZodType<ContactForm>;

export type { ContactForm } from "../types/contact-form";
```

#### Examples

```typescript
// Source: hand-crafted
import type { ContactForm } from "../types/contact-form";

export const contactFormExamples = {
  minimal: {
    name: "Jenny Rosen",
    email: "jenny@example.com",
    subject: "Question about pricing",
    message: "Could you share an enterprise quote for 50 seats?",
  } satisfies ContactForm,
  withPhone: {
    name: "Alex Patel",
    email: "alex@example.com",
    subject: "Demo request",
    message: "Looking for a 30-minute demo next week.",
    phone: "+14155551234",
  } satisfies ContactForm,
  bugReport: {
    name: "Sam Lee",
    email: "sam@example.com",
    subject: "Bug: login fails on Safari",
    message: "Steps to reproduce: open login, click submit, page hangs.",
  } satisfies ContactForm,
} as const;
```

### Cookie

- Name: `cookie`
- Categories: api
- Description: HTTP cookie with name, value, domain, path, SameSite, and security flags.
- Install (types only): `npx shadcn add @open-types/cookie`
- Install (with Zod): `npx shadcn add @open-types/cookie-zod`
- Install (with examples): `npx shadcn add @open-types/cookie-examples`
- Detail page: https://open-types.dev/types/cookie
- Markdown: https://open-types.dev/types/cookie.md

#### Types

```typescript
export type CookieSameSite = "strict" | "lax" | "none";

export interface CookieOptions {
  name: string;
  value: string;
  domain?: string;
  path?: string;
  expires?: string;
  max_age?: number;
  secure?: boolean;
  http_only?: boolean;
  same_site?: CookieSameSite;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { CookieOptions, CookieSameSite } from "../types/cookie";

export const cookieSameSiteSchema = z.enum(["strict", "lax", "none"]) satisfies z.ZodType<CookieSameSite>;

export const cookieOptionsSchema = z.object({
  name: z.string(),
  value: z.string(),
  domain: z.string().optional(),
  path: z.string().optional(),
  expires: z.string().optional(),
  max_age: z.number().optional(),
  secure: z.boolean().optional(),
  http_only: z.boolean().optional(),
  same_site: cookieSameSiteSchema.optional(),
}) satisfies z.ZodType<CookieOptions>;

export type { CookieOptions, CookieSameSite } from "../types/cookie";
```

#### Examples

```typescript
// Source: https://datatracker.ietf.org/doc/html/rfc6265bis-15
// Captured: 2026-05
import type {
  CookieSameSite,
  CookieOptions,
} from "../types/cookie";

export const cookieSameSiteExamples = {
  strict: "strict",
  lax: "lax",
  none: "none",
} as const satisfies Record<string, CookieSameSite>;

export const cookieOptionsExamples = {
  session: {
    name: "session_id",
    value: "abc123xyz",
    path: "/",
    secure: true,
    http_only: true,
    same_site: "lax",
  } satisfies CookieOptions,
  longLived: {
    name: "remember_me",
    value: "remember-token-xyz",
    domain: ".example.com",
    path: "/",
    expires: "2027-05-16T18:30:00Z",
    max_age: 31_536_000,
    secure: true,
    http_only: true,
    same_site: "lax",
  } satisfies CookieOptions,
  csrf: {
    name: "csrf_token",
    value: "9f8b7c6d-5e4f-3a2b",
    path: "/",
    secure: true,
    http_only: false,
    same_site: "strict",
  } satisfies CookieOptions,
  thirdPartyTracking: {
    name: "_ga",
    value: "GA1.2.1234567890.1712948400",
    domain: ".example.com",
    path: "/",
    max_age: 63_072_000,
    secure: true,
    same_site: "none",
  } satisfies CookieOptions,
  minimal: { name: "lang", value: "en" } satisfies CookieOptions,
} as const;
```

### CORS Config

- Name: `cors-config`
- Categories: api
- Description: CORS configuration with allowed origins, methods, headers, and credentials.
- Install (types only): `npx shadcn add @open-types/cors-config`
- Install (with Zod): `npx shadcn add @open-types/cors-config-zod`
- Install (with examples): `npx shadcn add @open-types/cors-config-examples`
- Detail page: https://open-types.dev/types/cors-config
- Markdown: https://open-types.dev/types/cors-config.md

#### Types

```typescript
export interface CORSConfig {
  allow_origin: string | string[];
  allow_methods?: string[];
  allow_headers?: string[];
  expose_headers?: string[];
  allow_credentials?: boolean;
  max_age?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { CORSConfig } from "../types/cors-config";

export const corsConfigSchema = z.object({
  allow_origin: z.union([z.string(), z.array(z.string())]),
  allow_methods: z.array(z.string()).optional(),
  allow_headers: z.array(z.string()).optional(),
  expose_headers: z.array(z.string()).optional(),
  allow_credentials: z.boolean().optional(),
  max_age: z.number().optional(),
}) satisfies z.ZodType<CORSConfig>;

export type { CORSConfig } from "../types/cors-config";
```

#### Examples

```typescript
// Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
// Captured: 2026-05
import type { CORSConfig } from "../types/cors-config";

export const corsConfigExamples = {
  wildcard: {
    allow_origin: "*",
    allow_methods: ["GET", "POST", "OPTIONS"],
    allow_headers: ["Content-Type", "Authorization"],
    max_age: 86400,
  } satisfies CORSConfig,
  explicitOrigins: {
    allow_origin: ["https://app.example.com", "https://admin.example.com"],
    allow_methods: ["GET", "POST", "PUT", "PATCH", "DELETE"],
    allow_headers: ["Content-Type", "Authorization", "X-Request-Id"],
    expose_headers: ["X-Request-Id", "X-RateLimit-Remaining"],
    allow_credentials: true,
    max_age: 3600,
  } satisfies CORSConfig,
  publicApi: {
    allow_origin: "*",
    allow_methods: ["GET"],
  } satisfies CORSConfig,
  singleOrigin: {
    allow_origin: "https://app.example.com",
    allow_credentials: true,
  } satisfies CORSConfig,
} as const;
```

### Cron Job

- Name: `cron-job`
- Categories: infrastructure
- Description: Cron job with schedule expression, timezone, and run tracking.
- Install (types only): `npx shadcn add @open-types/cron-job`
- Install (with Zod): `npx shadcn add @open-types/cron-job-zod`
- Install (with examples): `npx shadcn add @open-types/cron-job-examples`
- Detail page: https://open-types.dev/types/cron-job
- Markdown: https://open-types.dev/types/cron-job.md

#### Types

```typescript
export interface CronSchedule {
  expression: string;
  timezone?: string;
}

export interface CronJob {
  name: string;
  schedule: CronSchedule;
  command?: string;
  enabled: boolean;
  last_run?: string;
  next_run?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { CronJob, CronSchedule } from "../types/cron-job";

export const cronScheduleSchema = z.object({
  expression: z.string().min(1, { error: "Cron expression is required" }),
  timezone: z.string().optional(),
}) satisfies z.ZodType<CronSchedule>;

export const cronJobSchema = z.object({
  name: z.string().min(1, { error: "Job name is required" }),
  schedule: cronScheduleSchema,
  command: z.string().optional(),
  enabled: z.boolean(),
  last_run: z.iso.datetime({ error: "Invalid last_run timestamp" }).optional(),
  next_run: z.iso.datetime({ error: "Invalid next_run timestamp" }).optional(),
}) satisfies z.ZodType<CronJob>;

export type { CronJob, CronSchedule } from "../types/cron-job";
```

#### Examples

```typescript
// Source: hand-crafted
import type { CronSchedule, CronJob } from "../types/cron-job";

export const cronScheduleExamples = {
  everyMinute: { expression: "* * * * *" } satisfies CronSchedule,
  hourly: { expression: "0 * * * *", timezone: "UTC" } satisfies CronSchedule,
  dailyMidnight: { expression: "0 0 * * *", timezone: "America/New_York" } satisfies CronSchedule,
  weeklyMonday: { expression: "0 9 * * MON", timezone: "Europe/London" } satisfies CronSchedule,
  monthlyFirst: { expression: "0 0 1 * *", timezone: "UTC" } satisfies CronSchedule,
} as const;

const nightlyBackup = {
  name: "nightly-backup",
  schedule: { expression: "0 2 * * *", timezone: "UTC" },
  command: "node scripts/backup.js",
  enabled: true,
  last_run: "2026-05-16T02:00:00Z",
  next_run: "2026-05-17T02:00:00Z",
} as const satisfies CronJob;

export const cronJobExamples = {
  nightlyBackup,
  disabled: { ...nightlyBackup, name: "old-cleanup", enabled: false } satisfies CronJob,
  neverRun: {
    name: "new-job",
    schedule: { expression: "0 9 * * MON" },
    enabled: true,
    next_run: "2026-05-18T09:00:00Z",
  } satisfies CronJob,
  minimal: {
    name: "ping",
    schedule: { expression: "* * * * *" },
    enabled: true,
  } satisfies CronJob,
} as const;
```

### CSP Header

- Name: `csp-header`
- Categories: api
- Description: Content-Security-Policy directives with source lists and boolean flags.
- Install (types only): `npx shadcn add @open-types/csp-header`
- Install (with Zod): `npx shadcn add @open-types/csp-header-zod`
- Install (with examples): `npx shadcn add @open-types/csp-header-examples`
- Detail page: https://open-types.dev/types/csp-header
- Markdown: https://open-types.dev/types/csp-header.md

#### Types

```typescript
export interface CSPDirectives {
  default_src?: string[];
  script_src?: string[];
  style_src?: string[];
  img_src?: string[];
  font_src?: string[];
  connect_src?: string[];
  media_src?: string[];
  object_src?: string[];
  frame_src?: string[];
  child_src?: string[];
  worker_src?: string[];
  form_action?: string[];
  frame_ancestors?: string[];
  base_uri?: string[];
  report_uri?: string[];
  report_to?: string[];
  upgrade_insecure_requests?: boolean;
  block_all_mixed_content?: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { CSPDirectives } from "../types/csp-header";

export const cspDirectivesSchema = z.object({
  default_src: z.array(z.string()).optional(),
  script_src: z.array(z.string()).optional(),
  style_src: z.array(z.string()).optional(),
  img_src: z.array(z.string()).optional(),
  font_src: z.array(z.string()).optional(),
  connect_src: z.array(z.string()).optional(),
  media_src: z.array(z.string()).optional(),
  object_src: z.array(z.string()).optional(),
  frame_src: z.array(z.string()).optional(),
  child_src: z.array(z.string()).optional(),
  worker_src: z.array(z.string()).optional(),
  form_action: z.array(z.string()).optional(),
  frame_ancestors: z.array(z.string()).optional(),
  base_uri: z.array(z.string()).optional(),
  report_uri: z.array(z.string()).optional(),
  report_to: z.array(z.string()).optional(),
  upgrade_insecure_requests: z.boolean().optional(),
  block_all_mixed_content: z.boolean().optional(),
}) satisfies z.ZodType<CSPDirectives>;

export type { CSPDirectives } from "../types/csp-header";
```

#### Examples

```typescript
// Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
// Captured: 2026-05
import type { CSPDirectives } from "../types/csp-header";

export const cspDirectivesExamples = {
  strict: {
    default_src: ["'self'"],
    script_src: ["'self'", "'sha256-abc123='"],
    style_src: ["'self'", "'unsafe-inline'"],
    img_src: ["'self'", "data:", "https://cdn.example.com"],
    font_src: ["'self'", "https://fonts.gstatic.com"],
    connect_src: ["'self'", "https://api.example.com"],
    object_src: ["'none'"],
    frame_ancestors: ["'none'"],
    base_uri: ["'self'"],
    upgrade_insecure_requests: true,
    report_uri: ["https://report.example.com/csp"],
    report_to: ["csp-endpoint"],
  } satisfies CSPDirectives,
  reportOnly: {
    default_src: ["'self'"],
    report_uri: ["https://report.example.com/csp-report-only"],
  } satisfies CSPDirectives,
  iframeEmbedFriendly: {
    default_src: ["'self'"],
    frame_src: ["https://embed.youtube.com", "https://player.vimeo.com"],
    child_src: ["https://embed.youtube.com"],
    media_src: ["'self'", "https://cdn.example.com"],
  } satisfies CSPDirectives,
  empty: {} satisfies CSPDirectives,
  blockAllMixed: {
    default_src: ["'self'"],
    block_all_mixed_content: true,
  } satisfies CSPDirectives,
} as const;
```

### Cursor Pagination

- Name: `cursor-pagination`
- Categories: api
- Description: Cursor-based pagination request and response with next cursor and has-more flag.
- Install (types only): `npx shadcn add @open-types/cursor-pagination`
- Install (with Zod): `npx shadcn add @open-types/cursor-pagination-zod`
- Install (with examples): `npx shadcn add @open-types/cursor-pagination-examples`
- Detail page: https://open-types.dev/types/cursor-pagination
- Markdown: https://open-types.dev/types/cursor-pagination.md

#### Types

```typescript
export interface CursorPaginationRequest {
  cursor?: string;
  limit?: number;
}

export interface CursorPaginationResponse {
  items: unknown[];
  next_cursor: string | null;
  has_more: boolean;
  total?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  CursorPaginationRequest,
  CursorPaginationResponse,
} from "../types/cursor-pagination";

export const cursorPaginationRequestSchema = z.object({
  cursor: z.string().optional(),
  limit: z
    .number()
    .int()
    .min(1, { error: "Limit must be at least 1" })
    .max(100, { error: "Limit must be at most 100" })
    .default(20)
    .optional(),
}) satisfies z.ZodType<CursorPaginationRequest>;

export const cursorPaginationResponseSchema = z.object({
  items: z.array(z.unknown()),
  next_cursor: z.string().nullable(),
  has_more: z.boolean(),
  total: z.number().int().min(0).optional(),
}) satisfies z.ZodType<CursorPaginationResponse>;

export type {
  CursorPaginationRequest,
  CursorPaginationResponse,
} from "../types/cursor-pagination";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  CursorPaginationRequest,
  CursorPaginationResponse,
} from "../types/cursor-pagination";

export const cursorPaginationRequestExamples = {
  empty: {} satisfies CursorPaginationRequest,
  firstPage: { limit: 50 } satisfies CursorPaginationRequest,
  next: { cursor: "eyJpZCI6MTAwfQ==", limit: 50 } satisfies CursorPaginationRequest,
  cursorOnly: { cursor: "Y3Vyc29yOnYyOnByZXY=" } satisfies CursorPaginationRequest,
  maxLimit: { limit: 100 } satisfies CursorPaginationRequest,
} as const;

export const cursorPaginationResponseExamples = {
  hasMore: {
    items: [{ id: "1" }, { id: "2" }, { id: "3" }],
    next_cursor: "eyJpZCI6Mn0=",
    has_more: true,
  } satisfies CursorPaginationResponse,
  hasMoreWithTotal: {
    items: [{ id: "1" }, { id: "2" }],
    next_cursor: "eyJpZCI6Mn0=",
    has_more: true,
    total: 482,
  } satisfies CursorPaginationResponse,
  exhausted: {
    items: [{ id: "100" }, { id: "101" }],
    next_cursor: null,
    has_more: false,
  } satisfies CursorPaginationResponse,
  empty: {
    items: [],
    next_cursor: null,
    has_more: false,
    total: 0,
  } satisfies CursorPaginationResponse,
} as const;
```

### Date Range

- Name: `date-range`
- Categories: common
- Description: Date range with start, end, and optional timezone.
- Install (types only): `npx shadcn add @open-types/date-range`
- Install (with Zod): `npx shadcn add @open-types/date-range-zod`
- Install (with examples): `npx shadcn add @open-types/date-range-examples`
- Detail page: https://open-types.dev/types/date-range
- Markdown: https://open-types.dev/types/date-range.md

#### Types

```typescript
export interface DateRange {
  start: string;
  end: string;
  timezone?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { DateRange } from "../types/date-range";

export const dateRangeSchema = z.object({
  start: z.string().min(1, { error: "Start date is required" }),
  end: z.string().min(1, { error: "End date is required" }),
  timezone: z.string().optional(),
}) satisfies z.ZodType<DateRange>;

export type { DateRange } from "../types/date-range";
```

#### Examples

```typescript
// Source: hand-crafted
import type { DateRange } from "../types/date-range";

export const dateRangeExamples = {
  oneDay: {
    start: "2026-05-16T00:00:00Z",
    end: "2026-05-17T00:00:00Z",
  } satisfies DateRange,
  workWeek: {
    start: "2026-05-11T00:00:00Z",
    end: "2026-05-15T23:59:59Z",
    timezone: "America/New_York",
  } satisfies DateRange,
  quarter: {
    start: "2026-04-01T00:00:00Z",
    end: "2026-06-30T23:59:59Z",
    timezone: "UTC",
  } satisfies DateRange,
  dateOnly: { start: "2026-05-16", end: "2026-05-23" } satisfies DateRange,
  withTokyoTz: {
    start: "2026-05-16T09:00:00+09:00",
    end: "2026-05-16T17:00:00+09:00",
    timezone: "Asia/Tokyo",
  } satisfies DateRange,
} as const;
```

### Discord Interaction

- Name: `discord-interaction`
- Categories: discord
- Description: Discord interaction with slash command data, guild, and user context.
- Depends on: `@open-types/discord-shared`
- Install (types only): `npx shadcn add @open-types/discord-interaction`
- Install (with Zod): `npx shadcn add @open-types/discord-interaction-zod`
- Install (with examples): `npx shadcn add @open-types/discord-interaction-examples`
- Detail page: https://open-types.dev/types/discord-interaction
- Markdown: https://open-types.dev/types/discord-interaction.md

#### Types

```typescript
import type { DiscordUser } from "./discord-shared";

export interface DiscordInteractionOptionValue {
  name: string;
  type: number;
  value?: unknown;
}

export interface DiscordInteractionData {
  id: string;
  name: string;
  type: number;
  options?: DiscordInteractionOptionValue[];
}

export interface DiscordInteraction {
  id: string;
  application_id: string;
  type: number;
  data?: DiscordInteractionData;
  guild_id?: string;
  channel_id?: string;
  user?: DiscordUser;
  token: string;
  version: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  DiscordInteractionOptionValue,
  DiscordInteractionData,
  DiscordInteraction,
} from "../types/discord-interaction";
import { discordUserSchema } from "./discord-shared";

export const discordInteractionOptionValueSchema = z.object({
  name: z.string(),
  type: z.number(),
  value: z.unknown().optional(),
}) satisfies z.ZodType<DiscordInteractionOptionValue>;

export const discordInteractionDataSchema = z.object({
  id: z.string(),
  name: z.string(),
  type: z.number(),
  options: z.array(discordInteractionOptionValueSchema).optional(),
}) satisfies z.ZodType<DiscordInteractionData>;

export const discordInteractionSchema = z.object({
  id: z.string(),
  application_id: z.string(),
  type: z.number(),
  data: discordInteractionDataSchema.optional(),
  guild_id: z.string().optional(),
  channel_id: z.string().optional(),
  user: discordUserSchema.optional(),
  token: z.string(),
  version: z.number(),
}) satisfies z.ZodType<DiscordInteraction>;

export type {
  DiscordInteractionOptionValue,
  DiscordInteractionData,
  DiscordInteraction,
} from "../types/discord-interaction";
```

#### Examples

```typescript
// Source: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
// Captured: 2026-05
import type {
  DiscordInteractionOptionValue,
  DiscordInteractionData,
  DiscordInteraction,
} from "../types/discord-interaction";
import { discordIds, discordUserOpenTypes } from "./shared/discord.examples";

const optionEnv = {
  name: "environment",
  type: 3,
  value: "production",
} as const satisfies DiscordInteractionOptionValue;

export const discordInteractionOptionValueExamples = {
  string: optionEnv,
  integer: { name: "count", type: 4, value: 5 } satisfies DiscordInteractionOptionValue,
  boolean: { name: "confirm", type: 5, value: true } satisfies DiscordInteractionOptionValue,
  subcommand: { name: "logs", type: 1 } satisfies DiscordInteractionOptionValue,
} as const;

const data = {
  id: "4444444444",
  name: "deploy",
  type: 1,
  options: [optionEnv],
} as const satisfies DiscordInteractionData;

export const discordInteractionDataExamples = {
  slashWithOptions: data,
  slashNoOptions: { id: "4444444445", name: "ping", type: 1 } satisfies DiscordInteractionData,
  buttonComponent: { id: "4444444446", name: "approve_btn", type: 2 } satisfies DiscordInteractionData,
} as const;

const slashInteraction = {
  id: discordIds.interaction,
  application_id: discordIds.application,
  type: 2,
  data,
  guild_id: discordIds.guild,
  channel_id: discordIds.channel,
  user: discordUserOpenTypes,
  token: "interaction_token",
  version: 1,
} as const satisfies DiscordInteraction;

export const discordInteractionExamples = {
  slash: slashInteraction,
  ping: {
    id: discordIds.interaction,
    application_id: discordIds.application,
    type: 1,
    token: "ping_token",
    version: 1,
  } satisfies DiscordInteraction,
  componentInteraction: {
    ...slashInteraction,
    id: "5555555556",
    type: 3,
    data: discordInteractionDataExamples.buttonComponent,
  } satisfies DiscordInteraction,
  dm: {
    ...slashInteraction,
    id: "5555555557",
    guild_id: undefined,
    channel_id: undefined,
  } satisfies DiscordInteraction,
} as const;
```

### Discord Message

- Name: `discord-message`
- Categories: discord
- Description: Discord message with author, embeds, attachments, and mentions.
- Depends on: `@open-types/discord-shared`
- Install (types only): `npx shadcn add @open-types/discord-message`
- Install (with Zod): `npx shadcn add @open-types/discord-message-zod`
- Install (with examples): `npx shadcn add @open-types/discord-message-examples`
- Detail page: https://open-types.dev/types/discord-message
- Markdown: https://open-types.dev/types/discord-message.md

#### Types

```typescript
import type { DiscordUser } from "./discord-shared";

export interface DiscordEmbedField {
  name: string;
  value: string;
  inline?: boolean;
}

export interface DiscordEmbed {
  title?: string;
  description?: string;
  url?: string;
  color?: number;
  timestamp?: string;
  fields?: DiscordEmbedField[];
}

export interface DiscordAttachment {
  id: string;
  filename: string;
  size: number;
  url: string;
  content_type?: string;
}

export interface DiscordMessage {
  id: string;
  channel_id: string;
  author: DiscordUser;
  content: string;
  timestamp: string;
  edited_timestamp: string | null;
  tts: boolean;
  mention_everyone: boolean;
  mentions: DiscordUser[];
  attachments: DiscordAttachment[];
  embeds: DiscordEmbed[];
  pinned: boolean;
  type: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  DiscordEmbedField,
  DiscordEmbed,
  DiscordAttachment,
  DiscordMessage,
} from "../types/discord-message";
import { discordUserSchema } from "./discord-shared";

export const discordEmbedFieldSchema = z.object({
  name: z.string(),
  value: z.string(),
  inline: z.boolean().optional(),
}) satisfies z.ZodType<DiscordEmbedField>;

export const discordEmbedSchema = z.object({
  title: z.string().optional(),
  description: z.string().optional(),
  url: z.string().optional(),
  color: z.number().optional(),
  timestamp: z.string().optional(),
  fields: z.array(discordEmbedFieldSchema).optional(),
}) satisfies z.ZodType<DiscordEmbed>;

export const discordAttachmentSchema = z.object({
  id: z.string(),
  filename: z.string(),
  size: z.number(),
  url: z.string(),
  content_type: z.string().optional(),
}) satisfies z.ZodType<DiscordAttachment>;

export const discordMessageSchema = z.object({
  id: z.string(),
  channel_id: z.string(),
  author: discordUserSchema,
  content: z.string(),
  timestamp: z.string(),
  edited_timestamp: z.string().nullable(),
  tts: z.boolean(),
  mention_everyone: z.boolean(),
  mentions: z.array(discordUserSchema),
  attachments: z.array(discordAttachmentSchema),
  embeds: z.array(discordEmbedSchema),
  pinned: z.boolean(),
  type: z.number(),
}) satisfies z.ZodType<DiscordMessage>;

export type {
  DiscordEmbedField,
  DiscordEmbed,
  DiscordAttachment,
  DiscordMessage,
} from "../types/discord-message";
```

#### Examples

```typescript
// Source: https://discord.com/developers/docs/resources/channel#message-object
// Captured: 2026-05
import type {
  DiscordEmbedField,
  DiscordEmbed,
  DiscordAttachment,
  DiscordMessage,
} from "../types/discord-message";
import {
  discordIds,
  discordUserOpenTypes,
  discordUserHuman,
} from "./shared/discord.examples";

const embedFieldEnv = {
  name: "Environment",
  value: "production",
  inline: true,
} as const satisfies DiscordEmbedField;

export const discordEmbedFieldExamples = {
  inline: embedFieldEnv,
  block: { name: "Notes", value: "Release notes attached." } satisfies DiscordEmbedField,
  longValue: {
    name: "Changelog",
    value: "- Added: foo\n- Fixed: bar\n- Removed: legacy code",
  } satisfies DiscordEmbedField,
} as const;

const embedDeploy = {
  title: "Deploy complete",
  description: "The latest release is live.",
  url: "https://open-types.dev",
  color: 5763719,
  timestamp: "2026-04-13T10:00:00.000Z",
  fields: [embedFieldEnv],
} as const satisfies DiscordEmbed;

export const discordEmbedExamples = {
  full: embedDeploy,
  empty: {} satisfies DiscordEmbed,
  titleOnly: { title: "Heads up!" } satisfies DiscordEmbed,
  multiField: {
    ...embedDeploy,
    fields: [embedFieldEnv, discordEmbedFieldExamples.block],
  } satisfies DiscordEmbed,
} as const;

const attachmentText = {
  id: "2222222222",
  filename: "release-notes.txt",
  size: 2048,
  url: "https://cdn.discordapp.com/attachments/222/release-notes.txt",
  content_type: "text/plain",
} as const satisfies DiscordAttachment;

export const discordAttachmentExamples = {
  text: attachmentText,
  image: {
    id: "2222222223",
    filename: "screenshot.png",
    size: 102400,
    url: "https://cdn.discordapp.com/attachments/222/screenshot.png",
    content_type: "image/png",
  } satisfies DiscordAttachment,
  noContentType: {
    id: "2222222224",
    filename: "data.bin",
    size: 8192,
    url: "https://cdn.discordapp.com/attachments/222/data.bin",
  } satisfies DiscordAttachment,
} as const;

const message = {
  id: discordIds.messageId,
  channel_id: discordIds.channel,
  author: discordUserOpenTypes,
  content: "Deployment finished successfully.",
  timestamp: "2026-04-13T10:00:00.000Z",
  edited_timestamp: null,
  tts: false,
  mention_everyone: false,
  mentions: [discordUserOpenTypes],
  attachments: [attachmentText],
  embeds: [embedDeploy],
  pinned: false,
  type: 0,
} as const satisfies DiscordMessage;

export const discordMessageExamples = {
  rich: message,
  plain: {
    ...message,
    id: "3333333334",
    content: "hello",
    mentions: [],
    attachments: [],
    embeds: [],
  } satisfies DiscordMessage,
  edited: {
    ...message,
    id: "3333333335",
    edited_timestamp: "2026-04-13T10:05:00.000Z",
  } satisfies DiscordMessage,
  fromHuman: {
    ...message,
    id: "3333333336",
    author: discordUserHuman,
    content: "I deployed it manually",
    mentions: [],
    attachments: [],
    embeds: [],
  } satisfies DiscordMessage,
  pinned: { ...message, id: "3333333337", pinned: true } satisfies DiscordMessage,
} as const;
```

### Discord Shared

- Name: `discord-shared`
- Categories: discord
- Description: Common Discord types: User, Guild, and Channel.
- Install (types only): `npx shadcn add @open-types/discord-shared`
- Install (with Zod): `npx shadcn add @open-types/discord-shared-zod`
- Install (with examples): `npx shadcn add @open-types/discord-shared-examples`
- Detail page: https://open-types.dev/types/discord-shared
- Markdown: https://open-types.dev/types/discord-shared.md

#### Types

```typescript
export interface DiscordUser {
  id: string;
  username: string;
  discriminator: string;
  avatar: string | null;
  bot?: boolean;
  system?: boolean;
  public_flags?: number;
}

export interface DiscordGuild {
  id: string;
  name: string;
  icon: string | null;
  owner_id: string;
  member_count?: number;
}

export interface DiscordChannel {
  id: string;
  type: number;
  guild_id?: string;
  name?: string | null;
  topic?: string | null;
  position?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  DiscordUser,
  DiscordGuild,
  DiscordChannel,
} from "../types/discord-shared";

export const discordUserSchema = z.object({
  id: z.string(),
  username: z.string(),
  discriminator: z.string(),
  avatar: z.string().nullable(),
  bot: z.boolean().optional(),
  system: z.boolean().optional(),
  public_flags: z.number().optional(),
}) satisfies z.ZodType<DiscordUser>;

export const discordGuildSchema = z.object({
  id: z.string(),
  name: z.string(),
  icon: z.string().nullable(),
  owner_id: z.string(),
  member_count: z.number().optional(),
}) satisfies z.ZodType<DiscordGuild>;

export const discordChannelSchema = z.object({
  id: z.string(),
  type: z.number(),
  guild_id: z.string().optional(),
  name: z.string().nullable().optional(),
  topic: z.string().nullable().optional(),
  position: z.number().optional(),
}) satisfies z.ZodType<DiscordChannel>;

export type {
  DiscordUser,
  DiscordGuild,
  DiscordChannel,
} from "../types/discord-shared";
```

#### Examples

```typescript
// Source: https://discord.com/developers/docs/resources/user, /guild, /channel
// Captured: 2026-05
import type {
  DiscordUser,
  DiscordGuild,
  DiscordChannel,
} from "../types/discord-shared";
import {
  discordIds,
  discordUserOpenTypes,
  discordUserHuman,
} from "./shared/discord.examples";

export const discordUserExamples = {
  bot: discordUserOpenTypes,
  human: discordUserHuman,
  nullAvatar: { ...discordUserOpenTypes, avatar: null } satisfies DiscordUser,
  systemUser: {
    id: "643945264868098049",
    username: "Discord",
    discriminator: "0000",
    avatar: null,
    system: true,
  } satisfies DiscordUser,
} as const;

export const discordGuildExamples = {
  full: {
    id: discordIds.guild,
    name: "Open Types",
    icon: "guild_icon_hash",
    owner_id: discordIds.user,
    member_count: 42,
  } satisfies DiscordGuild,
  nullIcon: {
    id: discordIds.guild,
    name: "Open Types",
    icon: null,
    owner_id: discordIds.user,
  } satisfies DiscordGuild,
  largeServer: {
    id: "111122223333444455",
    name: "Big Community",
    icon: "big_icon_hash",
    owner_id: discordIds.user,
    member_count: 25000,
  } satisfies DiscordGuild,
} as const;

export const discordChannelExamples = {
  textChannel: {
    id: discordIds.channel,
    type: 0,
    guild_id: discordIds.guild,
    name: "general",
    topic: "Registry updates",
    position: 1,
  } satisfies DiscordChannel,
  voiceChannel: {
    id: "1111111112",
    type: 2,
    guild_id: discordIds.guild,
    name: "voice-1",
    position: 2,
  } satisfies DiscordChannel,
  dmChannel: { id: "1111111113", type: 1 } satisfies DiscordChannel,
  announcement: {
    id: "1111111114",
    type: 5,
    guild_id: discordIds.guild,
    name: "announcements",
    topic: null,
    position: 0,
  } satisfies DiscordChannel,
  minimal: { id: "1111111115", type: 0 } satisfies DiscordChannel,
} as const;
```

### Discord Webhook Message

- Name: `discord-webhook-message`
- Categories: discord
- Description: Discord incoming webhook message with content, embeds, and username override.
- Depends on: `@open-types/discord-message`
- Install (types only): `npx shadcn add @open-types/discord-webhook-message`
- Install (with Zod): `npx shadcn add @open-types/discord-webhook-message-zod`
- Install (with examples): `npx shadcn add @open-types/discord-webhook-message-examples`
- Detail page: https://open-types.dev/types/discord-webhook-message
- Markdown: https://open-types.dev/types/discord-webhook-message.md

#### Types

```typescript
import type { DiscordEmbed } from "./discord-message";

export interface DiscordWebhookMessage {
  content?: string;
  username?: string;
  avatar_url?: string;
  tts?: boolean;
  embeds?: DiscordEmbed[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { DiscordWebhookMessage } from "../types/discord-webhook-message";
import { discordEmbedSchema } from "./discord-message";

export const discordWebhookMessageSchema = z.object({
  content: z.string().optional(),
  username: z.string().optional(),
  avatar_url: z.string().optional(),
  tts: z.boolean().optional(),
  embeds: z.array(discordEmbedSchema).optional(),
}) satisfies z.ZodType<DiscordWebhookMessage>;

export type { DiscordWebhookMessage } from "../types/discord-webhook-message";
```

#### Examples

```typescript
// Source: https://discord.com/developers/docs/resources/webhook#execute-webhook
// Captured: 2026-05
import type { DiscordWebhookMessage } from "../types/discord-webhook-message";

export const discordWebhookMessageExamples = {
  rich: {
    content: "Build completed successfully.",
    username: "Open Types Bot",
    avatar_url: "https://cdn.discordapp.com/embed/avatars/0.png",
    tts: false,
    embeds: [
      {
        title: "Build status",
        description: "All checks passed.",
        url: "https://open-types.dev",
        color: 5763719,
        timestamp: "2026-04-13T10:00:00.000Z",
        fields: [{ name: "Branch", value: "main", inline: true }],
      },
    ],
  } satisfies DiscordWebhookMessage,
  contentOnly: { content: "Deploy succeeded" } satisfies DiscordWebhookMessage,
  embedOnly: {
    username: "CI",
    embeds: [{ title: "Failure", description: "tests failed", color: 15158332 }],
  } satisfies DiscordWebhookMessage,
  ttsAlert: {
    content: "Production is down!",
    username: "PagerBot",
    tts: true,
  } satisfies DiscordWebhookMessage,
  empty: {} satisfies DiscordWebhookMessage,
} as const;
```

### Email Message

- Name: `email-message`
- Categories: common
- Description: Email message with recipients, subject, body (text/HTML), and attachments.
- Install (types only): `npx shadcn add @open-types/email-message`
- Install (with Zod): `npx shadcn add @open-types/email-message-zod`
- Install (with examples): `npx shadcn add @open-types/email-message-examples`
- Detail page: https://open-types.dev/types/email-message
- Markdown: https://open-types.dev/types/email-message.md

#### Types

```typescript
export interface EmailAttachment {
  filename: string;
  content_type: string;
  size: number;
}

export interface EmailMessage {
  from: string;
  to: string[];
  cc?: string[];
  bcc?: string[];
  subject: string;
  text?: string;
  html?: string;
  reply_to?: string;
  attachments?: EmailAttachment[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { EmailAttachment, EmailMessage } from "../types/email-message";

export const emailAttachmentSchema = z.object({
  filename: z.string().min(1, { error: "Attachment filename is required" }),
  content_type: z.string().min(1, { error: "Attachment content type is required" }),
  size: z.number().int({ error: "Attachment size must be a whole number" }).min(0, {
    error: "Attachment size cannot be negative",
  }),
}) satisfies z.ZodType<EmailAttachment>;

export const emailMessageSchema = z.object({
  from: z.string().email({ error: "From must be a valid email address" }),
  to: z
    .array(z.string().email({ error: "Recipient must be a valid email address" }))
    .min(1, { error: "At least one recipient is required" }),
  cc: z.array(z.string().email({ error: "CC recipient must be a valid email address" })).optional(),
  bcc: z
    .array(z.string().email({ error: "BCC recipient must be a valid email address" }))
    .optional(),
  subject: z.string().min(1, { error: "Subject is required" }),
  text: z.string().optional(),
  html: z.string().optional(),
  reply_to: z.string().email({ error: "Reply-to must be a valid email address" }).optional(),
  attachments: z.array(emailAttachmentSchema).optional(),
}) satisfies z.ZodType<EmailMessage>;

export type { EmailAttachment, EmailMessage } from "../types/email-message";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  EmailAttachment,
  EmailMessage,
} from "../types/email-message";

const receiptPdf = {
  filename: "receipt.pdf",
  content_type: "application/pdf",
  size: 24_500,
} as const satisfies EmailAttachment;

export const emailAttachmentExamples = {
  pdf: receiptPdf,
  image: {
    filename: "screenshot.png",
    content_type: "image/png",
    size: 102_400,
  } satisfies EmailAttachment,
  zip: {
    filename: "export.zip",
    content_type: "application/zip",
    size: 5_242_880,
  } satisfies EmailAttachment,
} as const;

const transactional = {
  from: "no-reply@example.com",
  to: ["customer@example.com"],
  subject: "Your order has shipped",
  text: "Your order #1001 is on its way.",
  html: "<p>Your order <strong>#1001</strong> is on its way.</p>",
  reply_to: "support@example.com",
  attachments: [receiptPdf],
} as const satisfies EmailMessage;

export const emailMessageExamples = {
  transactional,
  plainText: {
    from: "alerts@example.com",
    to: ["oncall@example.com"],
    subject: "Production alert",
    text: "Service X is degraded.",
  } satisfies EmailMessage,
  broadcastWithCcBcc: {
    from: "newsletter@example.com",
    to: ["customer-a@example.com", "customer-b@example.com"],
    cc: ["editor@example.com"],
    bcc: ["archive@example.com"],
    subject: "Weekly update",
    html: "<h1>Weekly update</h1><p>Highlights below.</p>",
  } satisfies EmailMessage,
  htmlOnly: {
    from: "marketing@example.com",
    to: ["lead@example.com"],
    subject: "Special offer",
    html: "<p>Save 20% this week.</p>",
  } satisfies EmailMessage,
} as const;
```

### Feature Flag

- Name: `feature-flag`
- Categories: infrastructure
- Description: Feature flag with variants, targeting rules, and evaluation result.
- Install (types only): `npx shadcn add @open-types/feature-flag`
- Install (with Zod): `npx shadcn add @open-types/feature-flag-zod`
- Install (with examples): `npx shadcn add @open-types/feature-flag-examples`
- Detail page: https://open-types.dev/types/feature-flag
- Markdown: https://open-types.dev/types/feature-flag.md

#### Types

```typescript
export type FeatureFlagOperator =
  | "eq"
  | "neq"
  | "in"
  | "nin"
  | "gt"
  | "lt"
  | "gte"
  | "lte"
  | "contains";

export interface FeatureFlagRule {
  attribute: string;
  operator: FeatureFlagOperator;
  value: unknown;
}

export interface FeatureFlagVariant {
  key: string;
  value: unknown;
  weight?: number;
}

export interface FeatureFlag {
  key: string;
  enabled: boolean;
  description?: string;
  variants?: FeatureFlagVariant[];
  rules?: FeatureFlagRule[];
}

export interface FeatureFlagEvaluation {
  key: string;
  enabled: boolean;
  variant?: string;
  reason?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  FeatureFlag,
  FeatureFlagEvaluation,
  FeatureFlagOperator,
  FeatureFlagRule,
  FeatureFlagVariant,
} from "../types/feature-flag";

export const featureFlagOperatorSchema = z.enum([
  "eq",
  "neq",
  "in",
  "nin",
  "gt",
  "lt",
  "gte",
  "lte",
  "contains",
]) satisfies z.ZodType<FeatureFlagOperator>;

export const featureFlagRuleSchema = z.object({
  attribute: z.string().min(1, { error: "Attribute is required" }),
  operator: featureFlagOperatorSchema,
  value: z.unknown(),
}) satisfies z.ZodType<FeatureFlagRule>;

export const featureFlagVariantSchema = z.object({
  key: z.string().min(1, { error: "Variant key is required" }),
  value: z.unknown(),
  weight: z.number().min(0, { error: "Weight must be greater than or equal to 0" }).optional(),
}) satisfies z.ZodType<FeatureFlagVariant>;

export const featureFlagSchema = z.object({
  key: z.string().min(1, { error: "Feature flag key is required" }),
  enabled: z.boolean(),
  description: z.string().optional(),
  variants: z.array(featureFlagVariantSchema).optional(),
  rules: z.array(featureFlagRuleSchema).optional(),
}) satisfies z.ZodType<FeatureFlag>;

export const featureFlagEvaluationSchema = z.object({
  key: z.string().min(1, { error: "Feature flag key is required" }),
  enabled: z.boolean(),
  variant: z.string().optional(),
  reason: z.string().optional(),
}) satisfies z.ZodType<FeatureFlagEvaluation>;

export type {
  FeatureFlag,
  FeatureFlagEvaluation,
  FeatureFlagOperator,
  FeatureFlagRule,
  FeatureFlagVariant,
} from "../types/feature-flag";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after LaunchDarkly/GrowthBook/Unleash payloads
import type {
  FeatureFlagOperator,
  FeatureFlagRule,
  FeatureFlagVariant,
  FeatureFlag,
  FeatureFlagEvaluation,
} from "../types/feature-flag";

export const featureFlagOperatorExamples = {
  eq: "eq",
  neq: "neq",
  in: "in",
  nin: "nin",
  gt: "gt",
  lt: "lt",
  gte: "gte",
  lte: "lte",
  contains: "contains",
} as const satisfies Record<string, FeatureFlagOperator>;

const ruleOrgIn = {
  attribute: "org_id",
  operator: "in",
  value: ["org_001", "org_002"],
} as const satisfies FeatureFlagRule;

const ruleEmailDomain = {
  attribute: "email",
  operator: "contains",
  value: "@example.com",
} as const satisfies FeatureFlagRule;

export const featureFlagRuleExamples = {
  orgIn: ruleOrgIn,
  emailContains: ruleEmailDomain,
  versionGte: { attribute: "app_version", operator: "gte", value: "2.0.0" } satisfies FeatureFlagRule,
  planEquals: { attribute: "plan", operator: "eq", value: "pro" } satisfies FeatureFlagRule,
} as const;

const variantOn = { key: "on", value: true, weight: 70 } as const satisfies FeatureFlagVariant;
const variantOff = { key: "off", value: false, weight: 30 } as const satisfies FeatureFlagVariant;

export const featureFlagVariantExamples = {
  on: variantOn,
  off: variantOff,
  control: { key: "control", value: "A" } satisfies FeatureFlagVariant,
  treatment: { key: "treatment", value: "B", weight: 50 } satisfies FeatureFlagVariant,
} as const;

export const featureFlagExamples = {
  simpleBoolean: {
    key: "new-checkout-flow",
    enabled: true,
    description: "Enable the rewritten checkout flow.",
  } satisfies FeatureFlag,
  withRules: {
    key: "beta-features",
    enabled: true,
    description: "Beta features gated to specific orgs.",
    rules: [ruleOrgIn, ruleEmailDomain],
  } satisfies FeatureFlag,
  abTest: {
    key: "checkout-experiment",
    enabled: true,
    description: "A/B test for checkout button color.",
    variants: [variantOn, variantOff],
  } satisfies FeatureFlag,
  fullyTargeted: {
    key: "enterprise-features",
    enabled: true,
    description: "Enterprise tier features.",
    variants: [featureFlagVariantExamples.control, featureFlagVariantExamples.treatment],
    rules: [{ attribute: "plan", operator: "eq", value: "enterprise" }],
  } satisfies FeatureFlag,
  disabled: { key: "old-feature", enabled: false } satisfies FeatureFlag,
} as const;

export const featureFlagEvaluationExamples = {
  enabled: {
    key: "new-checkout-flow",
    enabled: true,
    reason: "rule_matched",
  } satisfies FeatureFlagEvaluation,
  withVariant: {
    key: "checkout-experiment",
    enabled: true,
    variant: "on",
    reason: "variant_assigned",
  } satisfies FeatureFlagEvaluation,
  disabled: {
    key: "old-feature",
    enabled: false,
    reason: "flag_disabled",
  } satisfies FeatureFlagEvaluation,
  defaulted: { key: "missing-flag", enabled: false } satisfies FeatureFlagEvaluation,
} as const;
```

### Feedback Form

- Name: `feedback-form`
- Categories: forms
- Description: Feedback form with rating (1-5), message, email, and category.
- Install (types only): `npx shadcn add @open-types/feedback-form`
- Install (with Zod): `npx shadcn add @open-types/feedback-form-zod`
- Install (with examples): `npx shadcn add @open-types/feedback-form-examples`
- Detail page: https://open-types.dev/types/feedback-form
- Markdown: https://open-types.dev/types/feedback-form.md

#### Types

```typescript
export interface FeedbackForm {
  rating: number;
  message?: string;
  email?: string;
  category?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { FeedbackForm } from "../types/feedback-form";

export const feedbackFormSchema = z.object({
  rating: z.number().int({ error: "Rating must be a whole number" }).min(1, {
    error: "Rating must be at least 1",
  }).max(5, { error: "Rating must be at most 5" }),
  message: z.string().optional(),
  email: z.string().email({ error: "Email must be a valid email address" }).optional(),
  category: z.string().optional(),
}) satisfies z.ZodType<FeedbackForm>;

export type { FeedbackForm } from "../types/feedback-form";
```

#### Examples

```typescript
// Source: hand-crafted
import type { FeedbackForm } from "../types/feedback-form";

export const feedbackFormExamples = {
  fiveStarFull: {
    rating: 5,
    message: "Loved the new dashboard - much faster than before.",
    email: "jenny@example.com",
    category: "feature",
  } satisfies FeedbackForm,
  oneStarBug: {
    rating: 1,
    message: "Login keeps failing on Safari.",
    email: "bug-reporter@example.com",
    category: "bug",
  } satisfies FeedbackForm,
  ratingOnly: { rating: 4 } satisfies FeedbackForm,
  anonymousIdea: {
    rating: 3,
    message: "Would love a dark mode option.",
    category: "idea",
  } satisfies FeedbackForm,
  noCategory: {
    rating: 4,
    message: "Generally happy with the product.",
    email: "happy@example.com",
  } satisfies FeedbackForm,
} as const;
```

### File Upload

- Name: `file-upload`
- Categories: common
- Description: File upload metadata with name, size, MIME type, and URL.
- Install (types only): `npx shadcn add @open-types/file-upload`
- Install (with Zod): `npx shadcn add @open-types/file-upload-zod`
- Install (with examples): `npx shadcn add @open-types/file-upload-examples`
- Detail page: https://open-types.dev/types/file-upload
- Markdown: https://open-types.dev/types/file-upload.md

#### Types

```typescript
export interface FileUpload {
  name: string;
  size: number;
  type: string;
  url?: string;
  last_modified?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { FileUpload } from "../types/file-upload";

export const fileUploadSchema = z.object({
  name: z.string().min(1, { error: "File name is required" }),
  size: z.number().int({ error: "File size must be a whole number" }).min(0, {
    error: "File size cannot be negative",
  }),
  type: z.string().min(1, { error: "File type is required" }),
  url: z.url({ error: "File URL must be a valid URL" }).optional(),
  last_modified: z.number().int({ error: "Last modified must be a whole number" }).optional(),
}) satisfies z.ZodType<FileUpload>;

export type { FileUpload } from "../types/file-upload";
```

#### Examples

```typescript
// Source: hand-crafted
import type { FileUpload } from "../types/file-upload";

export const fileUploadExamples = {
  image: {
    name: "avatar.png",
    size: 102_400,
    type: "image/png",
    url: "https://cdn.example.com/uploads/avatar.png",
    last_modified: 1712948400000,
  } satisfies FileUpload,
  pdf: {
    name: "receipt.pdf",
    size: 24_500,
    type: "application/pdf",
    url: "https://cdn.example.com/uploads/receipt.pdf",
  } satisfies FileUpload,
  largeVideo: {
    name: "demo.mp4",
    size: 1_073_741_824,
    type: "video/mp4",
    url: "https://cdn.example.com/uploads/demo.mp4",
    last_modified: 1712948400000,
  } satisfies FileUpload,
  inMemory: {
    name: "notes.txt",
    size: 512,
    type: "text/plain",
  } satisfies FileUpload,
  zeroByte: { name: "empty.log", size: 0, type: "text/plain" } satisfies FileUpload,
} as const;
```

### Geolocation

- Name: `geolocation`
- Categories: common
- Description: Geographic coordinates with latitude, longitude, altitude, and accuracy.
- Install (types only): `npx shadcn add @open-types/geolocation`
- Install (with Zod): `npx shadcn add @open-types/geolocation-zod`
- Install (with examples): `npx shadcn add @open-types/geolocation-examples`
- Detail page: https://open-types.dev/types/geolocation
- Markdown: https://open-types.dev/types/geolocation.md

#### Types

```typescript
export interface Geolocation {
  latitude: number;
  longitude: number;
  altitude?: number;
  accuracy?: number;
  heading?: number;
  speed?: number;
  timestamp?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Geolocation } from "../types/geolocation";

export const geolocationSchema = z.object({
  latitude: z.number().min(-90, { error: "Latitude must be at least -90" }).max(90, {
    error: "Latitude must be at most 90",
  }),
  longitude: z.number().min(-180, { error: "Longitude must be at least -180" }).max(180, {
    error: "Longitude must be at most 180",
  }),
  altitude: z.number().optional(),
  accuracy: z.number().min(0, { error: "Accuracy cannot be negative" }).optional(),
  heading: z.number().min(0, { error: "Heading must be at least 0" }).max(360, {
    error: "Heading must be at most 360",
  }).optional(),
  speed: z.number().min(0, { error: "Speed cannot be negative" }).optional(),
  timestamp: z.number().optional(),
}) satisfies z.ZodType<Geolocation>;

export type { Geolocation } from "../types/geolocation";
```

#### Examples

```typescript
// Source: hand-crafted; coords correspond to public landmarks
import type { Geolocation } from "../types/geolocation";

export const geolocationExamples = {
  fullGps: {
    latitude: 37.7749,
    longitude: -122.4194,
    altitude: 16,
    accuracy: 5,
    heading: 270,
    speed: 1.4,
    timestamp: 1712948400000,
  } satisfies Geolocation,
  minimal: { latitude: 51.5074, longitude: -0.1278 } satisfies Geolocation,
  highAltitude: {
    latitude: 27.9881,
    longitude: 86.9250,
    altitude: 8848,
    accuracy: 10,
  } satisfies Geolocation,
  stationary: {
    latitude: 35.6762,
    longitude: 139.6503,
    accuracy: 3,
    speed: 0,
    timestamp: 1712948400000,
  } satisfies Geolocation,
  southernHemisphere: {
    latitude: -33.8688,
    longitude: 151.2093,
    accuracy: 8,
  } satisfies Geolocation,
} as const;
```

### GitHub Deployment Event

- Name: `github-deployment-event`
- Categories: github
- Description: GitHub deployment webhook payload with environment, ref, and creator tracking.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-deployment-event`
- Install (with Zod): `npx shadcn add @open-types/github-deployment-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-deployment-event-examples`
- Detail page: https://open-types.dev/types/github-deployment-event
- Markdown: https://open-types.dev/types/github-deployment-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
} from "./github-shared";

export interface GitHubDeployment {
  url: string;
  id: number;
  node_id: string;
  sha: string;
  ref: string;
  task: string;
  environment: string;
  description: string | null;
  creator: GitHubUser;
  created_at: string;
  updated_at: string;
  payload: Record<string, unknown>;
}

export interface GitHubDeploymentEvent {
  action: "created";
  deployment: GitHubDeployment;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubDeployment,
  GitHubDeploymentEvent,
} from "../types/github-deployment-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
} from "./github-shared";

export const githubDeploymentPayloadSchema = z.record(
  z.string(),
  z.unknown()
) satisfies z.ZodType<Record<string, unknown>>;

export const githubDeploymentActionSchema = z.enum([
  "created",
]) satisfies z.ZodType<GitHubDeploymentEvent["action"]>;

export const githubDeploymentSchema = z.object({
  url: z.string(),
  id: z.number().int(),
  node_id: z.string(),
  sha: z.string(),
  ref: z.string(),
  task: z.string(),
  environment: z.string(),
  description: z.string().nullable(),
  creator: githubUserSchema,
  created_at: z.string(),
  updated_at: z.string(),
  payload: githubDeploymentPayloadSchema,
}) satisfies z.ZodType<GitHubDeployment>;

export const githubDeploymentEventSchema = z.object({
  action: githubDeploymentActionSchema,
  deployment: githubDeploymentSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
}) satisfies z.ZodType<GitHubDeploymentEvent>;

export type {
  GitHubDeployment,
  GitHubDeploymentEvent,
} from "../types/github-deployment-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#deployment
// Captured: 2026-05
import type {
  GitHubDeployment,
  GitHubDeploymentEvent,
} from "../types/github-deployment-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";

const deployment = {
  url: "https://api.github.com/repos/octocat/Hello-World/deployments/42",
  id: 42,
  node_id: "MDEwOkRlcGxveW1lbnQxMA==",
  sha: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  ref: "main",
  task: "deploy",
  environment: "production",
  description: "Deploy to production",
  creator: githubUserOctocat,
  created_at: "2024-09-12T10:15:30Z",
  updated_at: "2024-09-12T10:15:32Z",
  payload: { auto_merge: false, required_contexts: [] as string[] },
} as const satisfies GitHubDeployment;

export const githubDeploymentExamples = {
  minimal: deployment,
  noDescription: { ...deployment, description: null } satisfies GitHubDeployment,
  emptyPayload: { ...deployment, payload: {} } satisfies GitHubDeployment,
  richPayload: {
    ...deployment,
    payload: {
      auto_merge: true,
      required_contexts: ["ci/test", "ci/lint"],
      transient_environment: false,
      production_environment: true,
    },
  } satisfies GitHubDeployment,
} as const;

const minimal = {
  action: "created",
  deployment,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubDeploymentEvent;

export const githubDeploymentEventExamples = {
  minimal,
  full: { ...minimal, organization: githubOrganizationGitHub } satisfies GitHubDeploymentEvent,
} as const;
```

### GitHub Fork Event

- Name: `github-fork-event`
- Categories: github
- Description: GitHub fork webhook payload with forkee repository details.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-fork-event`
- Install (with Zod): `npx shadcn add @open-types/github-fork-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-fork-event-examples`
- Detail page: https://open-types.dev/types/github-fork-event
- Markdown: https://open-types.dev/types/github-fork-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
} from "./github-shared";

export interface GitHubForkEvent {
  forkee: GitHubRepository;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { GitHubForkEvent } from "../types/github-fork-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
} from "./github-shared";

export const githubForkEventSchema = z.object({
  forkee: githubRepositorySchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
}) satisfies z.ZodType<GitHubForkEvent>;

export type { GitHubForkEvent } from "../types/github-fork-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#fork
// Captured: 2026-05
import type { GitHubForkEvent } from "../types/github-fork-event";
import type { GitHubRepository } from "../types/github-shared";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";

const forkeeRepository = {
  id: 186853002,
  node_id: "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
  name: "Hello-World",
  full_name: "new-owner/Hello-World",
  private: false,
  owner: {
    login: "new-owner",
    id: 21031067,
    node_id: "MDQ6VXNlcjIxMDMxMDY3",
    avatar_url: "https://avatars.githubusercontent.com/u/21031067?v=4",
    url: "https://api.github.com/users/new-owner",
    html_url: "https://github.com/new-owner",
    type: "User",
    site_admin: false,
  },
  html_url: "https://github.com/new-owner/Hello-World",
  description: "Forked for experiments",
  fork: true,
  url: "https://api.github.com/repos/new-owner/Hello-World",
  default_branch: "main",
} as const satisfies GitHubRepository;

const minimal = {
  forkee: forkeeRepository,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubForkEvent;

export const githubForkEventExamples = {
  minimal,
  full: { ...minimal, organization: githubOrganizationGitHub } satisfies GitHubForkEvent,
  intoPrivate: {
    ...minimal,
    forkee: { ...forkeeRepository, private: true } satisfies GitHubRepository,
  } satisfies GitHubForkEvent,
} as const;
```

### GitHub Issue Comment Event

- Name: `github-issue-comment-event`
- Categories: github
- Description: GitHub issue_comment webhook payload with comment body, author association, and edit tracking.
- Depends on: `@open-types/github-shared`, `@open-types/github-issues-event`
- Install (types only): `npx shadcn add @open-types/github-issue-comment-event`
- Install (with Zod): `npx shadcn add @open-types/github-issue-comment-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-issue-comment-event-examples`
- Detail page: https://open-types.dev/types/github-issue-comment-event
- Markdown: https://open-types.dev/types/github-issue-comment-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubAuthorAssociation,
} from "./github-shared";
import type { GitHubIssue } from "./github-issues-event";

export type GitHubIssueCommentAction = "created" | "deleted" | "edited";

export interface GitHubIssueComment {
  id: number;
  node_id: string;
  user: GitHubUser;
  created_at: string;
  updated_at: string;
  body: string | null;
  html_url: string;
  url: string;
  author_association: GitHubAuthorAssociation;
}

export interface GitHubIssueCommentChanges {
  body?: { from: string };
}

export interface GitHubIssueCommentEvent {
  action: GitHubIssueCommentAction;
  issue: GitHubIssue;
  comment: GitHubIssueComment;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
  changes?: GitHubIssueCommentChanges;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubIssueCommentAction,
  GitHubIssueComment,
  GitHubIssueCommentChanges,
  GitHubIssueCommentEvent,
} from "../types/github-issue-comment-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
  githubAuthorAssociationSchema,
} from "./github-shared";
import { githubIssueSchema } from "./github-issues-event";

export const githubIssueCommentActionSchema = z.enum([
  "created",
  "deleted",
  "edited",
]);

export const githubIssueCommentSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  user: githubUserSchema,
  created_at: z.string(),
  updated_at: z.string(),
  body: z.string().nullable(),
  html_url: z.string(),
  url: z.string(),
  author_association: githubAuthorAssociationSchema,
}) satisfies z.ZodType<GitHubIssueComment>;

export const githubIssueCommentChangesSchema = z.object({
  body: z.object({ from: z.string() }).optional(),
}) satisfies z.ZodType<GitHubIssueCommentChanges>;

export const githubIssueCommentEventSchema = z.object({
  action: githubIssueCommentActionSchema,
  issue: githubIssueSchema,
  comment: githubIssueCommentSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
  changes: githubIssueCommentChangesSchema.optional(),
}) satisfies z.ZodType<GitHubIssueCommentEvent>;

export type {
  GitHubIssueCommentAction,
  GitHubIssueComment,
  GitHubIssueCommentChanges,
  GitHubIssueCommentEvent,
} from "../types/github-issue-comment-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment
// Captured: 2026-05
import type {
  GitHubIssueComment,
  GitHubIssueCommentChanges,
  GitHubIssueCommentEvent,
} from "../types/github-issue-comment-event";
import {
  githubUserOctocat,
  githubUserBot,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";
import { githubIssueExamples } from "./github-issues-event.examples";

const comment = {
  id: 1,
  node_id: "MDEyOklzc3VlQ29tbWVudDE=",
  user: githubUserOctocat,
  created_at: "2024-09-12T10:30:00Z",
  updated_at: "2024-09-12T10:30:00Z",
  body: "Me too",
  html_url: "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
  url: "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
  author_association: "COLLABORATOR",
} as const satisfies GitHubIssueComment;

export const githubIssueCommentExamples = {
  minimal: comment,
  fromOwner: { ...comment, author_association: "OWNER" } satisfies GitHubIssueComment,
  fromContributor: {
    ...comment,
    author_association: "CONTRIBUTOR",
  } satisfies GitHubIssueComment,
  deletedBody: { ...comment, body: null } satisfies GitHubIssueComment,
  byBot: { ...comment, user: githubUserBot, author_association: "NONE" } satisfies GitHubIssueComment,
} as const;

export const githubIssueCommentChangesExamples = {
  body: { body: { from: "Original comment" } } satisfies GitHubIssueCommentChanges,
  empty: {} satisfies GitHubIssueCommentChanges,
} as const;

const created = {
  action: "created",
  issue: githubIssueExamples.minimal,
  comment,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubIssueCommentEvent;

export const githubIssueCommentEventExamples = {
  created,
  edited: {
    ...created,
    action: "edited",
    changes: { body: { from: "Original comment" } },
  } satisfies GitHubIssueCommentEvent,
  deleted: {
    ...created,
    action: "deleted",
    comment: { ...comment, body: null },
  } satisfies GitHubIssueCommentEvent,
  onClosedIssue: {
    ...created,
    issue: githubIssueExamples.closed,
  } satisfies GitHubIssueCommentEvent,
  inOrg: {
    ...created,
    organization: githubOrganizationGitHub,
  } satisfies GitHubIssueCommentEvent,
} as const;
```

### GitHub Issues Event

- Name: `github-issues-event`
- Categories: github
- Description: GitHub issues webhook payload with labels, milestones, assignees, and state tracking.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-issues-event`
- Install (with Zod): `npx shadcn add @open-types/github-issues-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-issues-event-examples`
- Detail page: https://open-types.dev/types/github-issues-event
- Markdown: https://open-types.dev/types/github-issues-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubLabel,
  GitHubMilestone,
} from "./github-shared";

export type GitHubIssuesAction =
  | "assigned"
  | "closed"
  | "deleted"
  | "demilestoned"
  | "edited"
  | "labeled"
  | "locked"
  | "milestoned"
  | "opened"
  | "pinned"
  | "reopened"
  | "transferred"
  | "unassigned"
  | "unlabeled"
  | "unlocked"
  | "unpinned";

export interface GitHubIssue {
  id: number;
  node_id: string;
  number: number;
  title: string;
  user: GitHubUser;
  labels: GitHubLabel[];
  state: "open" | "closed";
  locked: boolean;
  assignees: GitHubUser[];
  milestone: GitHubMilestone | null;
  comments: number;
  created_at: string;
  updated_at: string;
  closed_at: string | null;
  body: string | null;
  state_reason?: string | null;
  html_url: string;
  url: string;
}

export interface GitHubIssuesChanges {
  title?: { from: string };
  body?: { from: string };
}

export interface GitHubIssuesEvent {
  action: GitHubIssuesAction;
  issue: GitHubIssue;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
  label?: GitHubLabel;
  assignee?: GitHubUser;
  milestone?: GitHubMilestone;
  changes?: GitHubIssuesChanges;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubIssuesAction,
  GitHubIssue,
  GitHubIssuesChanges,
  GitHubIssuesEvent,
} from "../types/github-issues-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
  githubLabelSchema,
  githubMilestoneSchema,
} from "./github-shared";

export const githubIssuesActionSchema = z.enum([
  "assigned",
  "closed",
  "deleted",
  "demilestoned",
  "edited",
  "labeled",
  "locked",
  "milestoned",
  "opened",
  "pinned",
  "reopened",
  "transferred",
  "unassigned",
  "unlabeled",
  "unlocked",
  "unpinned",
]);

export const githubIssueSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  number: z.number().int(),
  title: z.string(),
  user: githubUserSchema,
  labels: z.array(githubLabelSchema),
  state: z.enum(["open", "closed"]),
  locked: z.boolean(),
  assignees: z.array(githubUserSchema),
  milestone: githubMilestoneSchema.nullable(),
  comments: z.number().int(),
  created_at: z.string(),
  updated_at: z.string(),
  closed_at: z.string().nullable(),
  body: z.string().nullable(),
  state_reason: z.string().nullable().optional(),
  html_url: z.string(),
  url: z.string(),
}) satisfies z.ZodType<GitHubIssue>;

export const githubIssuesChangesSchema = z.object({
  title: z.object({ from: z.string() }).optional(),
  body: z.object({ from: z.string() }).optional(),
}) satisfies z.ZodType<GitHubIssuesChanges>;

export const githubIssuesEventSchema = z.object({
  action: githubIssuesActionSchema,
  issue: githubIssueSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
  label: githubLabelSchema.optional(),
  assignee: githubUserSchema.optional(),
  milestone: githubMilestoneSchema.optional(),
  changes: githubIssuesChangesSchema.optional(),
}) satisfies z.ZodType<GitHubIssuesEvent>;

export type {
  GitHubIssuesAction,
  GitHubIssue,
  GitHubIssuesChanges,
  GitHubIssuesEvent,
} from "../types/github-issues-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#issues
// Captured: 2026-05
import type {
  GitHubIssue,
  GitHubIssuesChanges,
  GitHubIssuesEvent,
} from "../types/github-issues-event";
import {
  githubUserOctocat,
  githubUserBot,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
  githubLabelBug,
  githubMilestoneV1,
} from "./shared/github.examples";

const issueMinimal = {
  id: 1,
  node_id: "MDU6SXNzdWUx",
  number: 1347,
  title: "Found a bug",
  user: githubUserOctocat,
  labels: [],
  state: "open",
  locked: false,
  assignees: [],
  milestone: null,
  comments: 0,
  created_at: "2024-09-10T13:45:00Z",
  updated_at: "2024-09-12T10:30:00Z",
  closed_at: null,
  body: "I'm having a problem with this.",
  html_url: "https://github.com/octocat/Hello-World/issues/1347",
  url: "https://api.github.com/repos/octocat/Hello-World/issues/1347",
} as const satisfies GitHubIssue;

const issueFull = {
  ...issueMinimal,
  labels: [githubLabelBug],
  assignees: [githubUserOctocat],
  milestone: githubMilestoneV1,
  comments: 3,
  state_reason: null,
} as const satisfies GitHubIssue;

const issueClosed = {
  ...issueFull,
  state: "closed",
  closed_at: "2024-09-12T11:00:00Z",
  state_reason: "completed",
} as const satisfies GitHubIssue;

export const githubIssueExamples = {
  minimal: issueMinimal,
  full: issueFull,
  closed: issueClosed,
  notPlanned: { ...issueClosed, state_reason: "not_planned" } satisfies GitHubIssue,
  emptyBody: { ...issueMinimal, body: null } satisfies GitHubIssue,
  locked: { ...issueMinimal, locked: true } satisfies GitHubIssue,
} as const;

export const githubIssuesChangesExamples = {
  title: { title: { from: "Bug" } } satisfies GitHubIssuesChanges,
  body: { body: { from: "Original body" } } satisfies GitHubIssuesChanges,
  both: {
    title: { from: "Old title" },
    body: { from: "Old body" },
  } satisfies GitHubIssuesChanges,
  empty: {} satisfies GitHubIssuesChanges,
} as const;

const opened = {
  action: "opened",
  issue: issueMinimal,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubIssuesEvent;

export const githubIssuesEventExamples = {
  opened,
  closed: {
    ...opened,
    action: "closed",
    issue: issueClosed,
  } satisfies GitHubIssuesEvent,
  reopened: { ...opened, action: "reopened" } satisfies GitHubIssuesEvent,
  labeled: {
    ...opened,
    action: "labeled",
    issue: { ...issueMinimal, labels: [githubLabelBug] },
    label: githubLabelBug,
  } satisfies GitHubIssuesEvent,
  assigned: {
    ...opened,
    action: "assigned",
    issue: { ...issueMinimal, assignees: [githubUserOctocat] },
    assignee: githubUserOctocat,
  } satisfies GitHubIssuesEvent,
  milestoned: {
    ...opened,
    action: "milestoned",
    issue: { ...issueMinimal, milestone: githubMilestoneV1 },
    milestone: githubMilestoneV1,
  } satisfies GitHubIssuesEvent,
  edited: {
    ...opened,
    action: "edited",
    changes: { title: { from: "Original title" } },
  } satisfies GitHubIssuesEvent,
  openedByBot: {
    ...opened,
    issue: { ...issueMinimal, user: githubUserBot },
    sender: githubUserBot,
  } satisfies GitHubIssuesEvent,
  withinOrg: { ...opened, organization: githubOrganizationGitHub } satisfies GitHubIssuesEvent,
} as const;
```

### GitHub Ping Event

- Name: `github-ping-event`
- Categories: github
- Description: GitHub ping webhook payload with zen message and hook configuration.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-ping-event`
- Install (with Zod): `npx shadcn add @open-types/github-ping-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-ping-event-examples`
- Detail page: https://open-types.dev/types/github-ping-event
- Markdown: https://open-types.dev/types/github-ping-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
} from "./github-shared";

export interface GitHubHookConfig {
  content_type?: string;
  insecure_ssl?: string;
  url?: string;
}

export interface GitHubHook {
  type: string;
  id: number;
  name: string;
  active: boolean;
  events: string[];
  config: GitHubHookConfig;
  created_at: string;
  updated_at: string;
}

export interface GitHubPingEvent {
  zen: string;
  hook_id: number;
  hook: GitHubHook;
  repository?: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubHookConfig,
  GitHubHook,
  GitHubPingEvent,
} from "../types/github-ping-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
} from "./github-shared";

export const githubHookConfigSchema = z.object({
  content_type: z.string().optional(),
  insecure_ssl: z.string().optional(),
  url: z.string().optional(),
}) satisfies z.ZodType<GitHubHookConfig>;

export const githubHookSchema = z.object({
  type: z.string(),
  id: z.number().int(),
  name: z.string(),
  active: z.boolean(),
  events: z.array(z.string()),
  config: githubHookConfigSchema,
  created_at: z.string(),
  updated_at: z.string(),
}) satisfies z.ZodType<GitHubHook>;

export const githubPingEventSchema = z.object({
  zen: z.string(),
  hook_id: z.number().int(),
  hook: githubHookSchema,
  repository: githubRepositorySchema.optional(),
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
}) satisfies z.ZodType<GitHubPingEvent>;

export type {
  GitHubHookConfig,
  GitHubHook,
  GitHubPingEvent,
} from "../types/github-ping-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#ping
// Captured: 2026-05
import type {
  GitHubHookConfig,
  GitHubHook,
  GitHubPingEvent,
} from "../types/github-ping-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";

const hookConfig = {
  content_type: "json",
  insecure_ssl: "0",
  url: "https://example.com/webhook",
} as const satisfies GitHubHookConfig;

export const githubHookConfigExamples = {
  full: hookConfig,
  contentTypeOnly: { content_type: "json" } satisfies GitHubHookConfig,
  empty: {} satisfies GitHubHookConfig,
} as const;

const hook = {
  type: "Repository",
  id: 12345678,
  name: "web",
  active: true,
  events: ["push", "pull_request"],
  config: hookConfig,
  created_at: "2024-09-12T10:15:30Z",
  updated_at: "2024-09-12T10:15:30Z",
} as const satisfies GitHubHook;

export const githubHookExamples = {
  minimal: hook,
  allEvents: {
    ...hook,
    events: ["*"],
  } satisfies GitHubHook,
} as const;

const minimal = {
  zen: "Non-blocking is better than blocking.",
  hook_id: 12345678,
  hook,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubPingEvent;

export const githubPingEventExamples = {
  minimal,
  full: {
    ...minimal,
    organization: githubOrganizationGitHub,
  } satisfies GitHubPingEvent,
  orgHook: (() => {
    const { repository, ...rest } = minimal;
    return { ...rest, organization: githubOrganizationGitHub } satisfies GitHubPingEvent;
  })(),
} as const;
```

### GitHub Pull Request Event

- Name: `github-pull-request-event`
- Categories: github
- Description: GitHub pull_request webhook payload with branches, labels, reviewers, and changes tracking.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-pull-request-event`
- Install (with Zod): `npx shadcn add @open-types/github-pull-request-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-pull-request-event-examples`
- Detail page: https://open-types.dev/types/github-pull-request-event
- Markdown: https://open-types.dev/types/github-pull-request-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubLabel,
  GitHubMilestone,
} from "./github-shared";

export type GitHubPullRequestAction =
  | "assigned"
  | "auto_merge_disabled"
  | "auto_merge_enabled"
  | "closed"
  | "converted_to_draft"
  | "demilestoned"
  | "dequeued"
  | "edited"
  | "enqueued"
  | "labeled"
  | "locked"
  | "milestoned"
  | "opened"
  | "ready_for_review"
  | "reopened"
  | "review_request_removed"
  | "review_requested"
  | "synchronize"
  | "unassigned"
  | "unlabeled"
  | "unlocked";

export interface GitHubPullRequestBranch {
  label: string;
  ref: string;
  sha: string;
  user: GitHubUser;
  repo: GitHubRepository | null;
}

export interface GitHubPullRequest {
  id: number;
  node_id: string;
  number: number;
  state: "open" | "closed";
  locked: boolean;
  title: string;
  user: GitHubUser;
  body: string | null;
  created_at: string;
  updated_at: string;
  closed_at: string | null;
  merged_at: string | null;
  merge_commit_sha: string | null;
  head: GitHubPullRequestBranch;
  base: GitHubPullRequestBranch;
  draft: boolean;
  merged: boolean;
  mergeable: boolean | null;
  mergeable_state?: string;
  merged_by?: GitHubUser | null;
  comments?: number;
  review_comments?: number;
  commits?: number;
  additions?: number;
  deletions?: number;
  changed_files?: number;
  labels: GitHubLabel[];
  milestone: GitHubMilestone | null;
  assignee: GitHubUser | null;
  assignees: GitHubUser[];
  requested_reviewers: GitHubUser[];
  html_url: string;
  url: string;
}

export interface GitHubPullRequestChanges {
  title?: { from: string };
  body?: { from: string };
}

export interface GitHubPullRequestEvent {
  action: GitHubPullRequestAction;
  number: number;
  pull_request: GitHubPullRequest;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
  label?: GitHubLabel;
  changes?: GitHubPullRequestChanges;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubPullRequestAction,
  GitHubPullRequestBranch,
  GitHubPullRequest,
  GitHubPullRequestChanges,
  GitHubPullRequestEvent,
} from "../types/github-pull-request-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
  githubLabelSchema,
  githubMilestoneSchema,
} from "./github-shared";

export const githubPullRequestActionSchema = z.enum([
  "assigned",
  "auto_merge_disabled",
  "auto_merge_enabled",
  "closed",
  "converted_to_draft",
  "demilestoned",
  "dequeued",
  "edited",
  "enqueued",
  "labeled",
  "locked",
  "milestoned",
  "opened",
  "ready_for_review",
  "reopened",
  "review_request_removed",
  "review_requested",
  "synchronize",
  "unassigned",
  "unlabeled",
  "unlocked",
]);

export const githubPullRequestBranchSchema = z.object({
  label: z.string(),
  ref: z.string(),
  sha: z.string(),
  user: githubUserSchema,
  repo: githubRepositorySchema.nullable(),
}) satisfies z.ZodType<GitHubPullRequestBranch>;

export const githubPullRequestSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  number: z.number().int(),
  state: z.enum(["open", "closed"]),
  locked: z.boolean(),
  title: z.string(),
  user: githubUserSchema,
  body: z.string().nullable(),
  created_at: z.string(),
  updated_at: z.string(),
  closed_at: z.string().nullable(),
  merged_at: z.string().nullable(),
  merge_commit_sha: z.string().nullable(),
  head: githubPullRequestBranchSchema,
  base: githubPullRequestBranchSchema,
  draft: z.boolean(),
  merged: z.boolean(),
  mergeable: z.boolean().nullable(),
  mergeable_state: z.string().optional(),
  merged_by: githubUserSchema.nullable().optional(),
  comments: z.number().int().optional(),
  review_comments: z.number().int().optional(),
  commits: z.number().int().optional(),
  additions: z.number().int().optional(),
  deletions: z.number().int().optional(),
  changed_files: z.number().int().optional(),
  labels: z.array(githubLabelSchema),
  milestone: githubMilestoneSchema.nullable(),
  assignee: githubUserSchema.nullable(),
  assignees: z.array(githubUserSchema),
  requested_reviewers: z.array(githubUserSchema),
  html_url: z.string(),
  url: z.string(),
}) satisfies z.ZodType<GitHubPullRequest>;

export const githubPullRequestChangesSchema = z.object({
  title: z.object({ from: z.string() }).optional(),
  body: z.object({ from: z.string() }).optional(),
}) satisfies z.ZodType<GitHubPullRequestChanges>;

export const githubPullRequestEventSchema = z.object({
  action: githubPullRequestActionSchema,
  number: z.number().int(),
  pull_request: githubPullRequestSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
  label: githubLabelSchema.optional(),
  changes: githubPullRequestChangesSchema.optional(),
}) satisfies z.ZodType<GitHubPullRequestEvent>;

export type {
  GitHubPullRequestAction,
  GitHubPullRequestBranch,
  GitHubPullRequest,
  GitHubPullRequestChanges,
  GitHubPullRequestEvent,
} from "../types/github-pull-request-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
// Captured: 2026-05
import type {
  GitHubPullRequestBranch,
  GitHubPullRequest,
  GitHubPullRequestChanges,
  GitHubPullRequestEvent,
} from "../types/github-pull-request-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
  githubLabelBug,
  githubMilestoneV1,
} from "./shared/github.examples";

const headBranch = {
  label: "octocat:feature-branch",
  ref: "feature-branch",
  sha: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  user: githubUserOctocat,
  repo: githubRepositoryHelloWorld,
} as const satisfies GitHubPullRequestBranch;

const baseBranch = {
  label: "octocat:main",
  ref: "main",
  sha: "6113728f27ae82c7b1a177c8d03f9e96e0adf246",
  user: githubUserOctocat,
  repo: githubRepositoryHelloWorld,
} as const satisfies GitHubPullRequestBranch;

const forkHeadBranch = {
  label: "contributor:feature",
  ref: "feature",
  sha: "abc123def456abc123def456abc123def456abc1",
  user: { ...githubUserOctocat, login: "contributor", id: 42 },
  repo: null,
} as const satisfies GitHubPullRequestBranch;

export const githubPullRequestBranchExamples = {
  head: headBranch,
  base: baseBranch,
  deletedFork: forkHeadBranch,
} as const;

const pullRequestOpen = {
  id: 1,
  node_id: "MDExOlB1bGxSZXF1ZXN0MQ==",
  number: 1347,
  state: "open",
  locked: false,
  title: "Amazing new feature",
  user: githubUserOctocat,
  body: "Please pull these awesome changes in!",
  created_at: "2024-09-10T13:45:00Z",
  updated_at: "2024-09-12T10:30:00Z",
  closed_at: null,
  merged_at: null,
  merge_commit_sha: null,
  head: headBranch,
  base: baseBranch,
  draft: false,
  merged: false,
  mergeable: true,
  labels: [],
  milestone: null,
  assignee: null,
  assignees: [],
  requested_reviewers: [],
  html_url: "https://github.com/octocat/Hello-World/pull/1347",
  url: "https://api.github.com/repos/octocat/Hello-World/pulls/1347",
} as const satisfies GitHubPullRequest;

const pullRequestFull = {
  ...pullRequestOpen,
  mergeable_state: "clean",
  merged_by: null,
  comments: 4,
  review_comments: 2,
  commits: 5,
  additions: 120,
  deletions: 14,
  changed_files: 6,
  labels: [githubLabelBug],
  milestone: githubMilestoneV1,
  assignee: githubUserOctocat,
  assignees: [githubUserOctocat],
  requested_reviewers: [githubUserOctocat],
} as const satisfies GitHubPullRequest;

const pullRequestMerged = {
  ...pullRequestFull,
  state: "closed",
  closed_at: "2024-09-12T11:00:00Z",
  merged_at: "2024-09-12T11:00:00Z",
  merge_commit_sha: "7e1f3a2c4d5e6f7081929394a5b6c7d8e9f0a1b2",
  merged: true,
  mergeable: null,
  mergeable_state: "clean",
  merged_by: githubUserOctocat,
} as const satisfies GitHubPullRequest;

const pullRequestDraft = {
  ...pullRequestOpen,
  draft: true,
  mergeable: null,
} as const satisfies GitHubPullRequest;

export const githubPullRequestExamples = {
  open: pullRequestOpen,
  full: pullRequestFull,
  merged: pullRequestMerged,
  draft: pullRequestDraft,
  fromFork: {
    ...pullRequestOpen,
    head: forkHeadBranch,
  } satisfies GitHubPullRequest,
  closedUnmerged: {
    ...pullRequestOpen,
    state: "closed",
    closed_at: "2024-09-12T11:00:00Z",
  } satisfies GitHubPullRequest,
} as const;

export const githubPullRequestChangesExamples = {
  title: { title: { from: "Original title" } } satisfies GitHubPullRequestChanges,
  body: { body: { from: "Original body" } } satisfies GitHubPullRequestChanges,
  empty: {} satisfies GitHubPullRequestChanges,
} as const;

const opened = {
  action: "opened",
  number: 1347,
  pull_request: pullRequestOpen,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubPullRequestEvent;

export const githubPullRequestEventExamples = {
  opened,
  closed: {
    ...opened,
    action: "closed",
    pull_request: pullRequestMerged,
  } satisfies GitHubPullRequestEvent,
  reopened: { ...opened, action: "reopened" } satisfies GitHubPullRequestEvent,
  synchronize: { ...opened, action: "synchronize" } satisfies GitHubPullRequestEvent,
  readyForReview: {
    ...opened,
    action: "ready_for_review",
    pull_request: { ...pullRequestOpen, draft: false },
  } satisfies GitHubPullRequestEvent,
  convertedToDraft: {
    ...opened,
    action: "converted_to_draft",
    pull_request: pullRequestDraft,
  } satisfies GitHubPullRequestEvent,
  labeled: {
    ...opened,
    action: "labeled",
    pull_request: { ...pullRequestOpen, labels: [githubLabelBug] },
    label: githubLabelBug,
  } satisfies GitHubPullRequestEvent,
  edited: {
    ...opened,
    action: "edited",
    changes: { title: { from: "Original title" } },
  } satisfies GitHubPullRequestEvent,
  reviewRequested: {
    ...opened,
    action: "review_requested",
    pull_request: { ...pullRequestOpen, requested_reviewers: [githubUserOctocat] },
  } satisfies GitHubPullRequestEvent,
  withinOrg: { ...opened, organization: githubOrganizationGitHub } satisfies GitHubPullRequestEvent,
} as const;
```

### GitHub Pull Request Review Event

- Name: `github-pull-request-review-event`
- Categories: github
- Description: GitHub pull_request_review webhook payload with review state, author association, and approval tracking.
- Depends on: `@open-types/github-shared`, `@open-types/github-pull-request-event`
- Install (types only): `npx shadcn add @open-types/github-pull-request-review-event`
- Install (with Zod): `npx shadcn add @open-types/github-pull-request-review-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-pull-request-review-event-examples`
- Detail page: https://open-types.dev/types/github-pull-request-review-event
- Markdown: https://open-types.dev/types/github-pull-request-review-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubAuthorAssociation,
} from "./github-shared";
import type { GitHubPullRequest } from "./github-pull-request-event";

export type GitHubPullRequestReviewAction = "submitted" | "edited" | "dismissed";

export type GitHubPullRequestReviewState =
  | "approved"
  | "changes_requested"
  | "commented"
  | "dismissed";

export interface GitHubPullRequestReview {
  id: number;
  node_id: string;
  user: GitHubUser;
  body: string | null;
  commit_id: string;
  submitted_at: string;
  state: GitHubPullRequestReviewState;
  html_url: string;
  author_association: GitHubAuthorAssociation;
}

export interface GitHubPullRequestReviewChanges {
  body?: { from: string };
}

export interface GitHubPullRequestReviewEvent {
  action: GitHubPullRequestReviewAction;
  review: GitHubPullRequestReview;
  pull_request: GitHubPullRequest;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
  changes?: GitHubPullRequestReviewChanges;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubPullRequestReviewAction,
  GitHubPullRequestReviewState,
  GitHubPullRequestReview,
  GitHubPullRequestReviewChanges,
  GitHubPullRequestReviewEvent,
} from "../types/github-pull-request-review-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
  githubAuthorAssociationSchema,
} from "./github-shared";
import { githubPullRequestSchema } from "./github-pull-request-event";

export const githubPullRequestReviewActionSchema = z.enum([
  "submitted",
  "edited",
  "dismissed",
]);

export const githubPullRequestReviewStateSchema = z.enum([
  "approved",
  "changes_requested",
  "commented",
  "dismissed",
]);

export const githubPullRequestReviewSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  user: githubUserSchema,
  body: z.string().nullable(),
  commit_id: z.string(),
  submitted_at: z.string(),
  state: githubPullRequestReviewStateSchema,
  html_url: z.string(),
  author_association: githubAuthorAssociationSchema,
}) satisfies z.ZodType<GitHubPullRequestReview>;

export const githubPullRequestReviewChangesSchema = z.object({
  body: z.object({ from: z.string() }).optional(),
}) satisfies z.ZodType<GitHubPullRequestReviewChanges>;

export const githubPullRequestReviewEventSchema = z.object({
  action: githubPullRequestReviewActionSchema,
  review: githubPullRequestReviewSchema,
  pull_request: githubPullRequestSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
  changes: githubPullRequestReviewChangesSchema.optional(),
}) satisfies z.ZodType<GitHubPullRequestReviewEvent>;

export type {
  GitHubPullRequestReviewAction,
  GitHubPullRequestReviewState,
  GitHubPullRequestReview,
  GitHubPullRequestReviewChanges,
  GitHubPullRequestReviewEvent,
} from "../types/github-pull-request-review-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review
// Captured: 2026-05
import type {
  GitHubPullRequestReview,
  GitHubPullRequestReviewChanges,
  GitHubPullRequestReviewEvent,
} from "../types/github-pull-request-review-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";
import { githubPullRequestExamples } from "./github-pull-request-event.examples";

const approvedReview = {
  id: 80,
  node_id: "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=",
  user: githubUserOctocat,
  body: "Looks good to me!",
  commit_id: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  submitted_at: "2024-09-12T10:45:00Z",
  state: "approved",
  html_url: "https://github.com/octocat/Hello-World/pull/1347#pullrequestreview-80",
  author_association: "MEMBER",
} as const satisfies GitHubPullRequestReview;

export const githubPullRequestReviewExamples = {
  approved: approvedReview,
  changesRequested: {
    ...approvedReview,
    state: "changes_requested",
    body: "Please address the comments below.",
  } satisfies GitHubPullRequestReview,
  commented: {
    ...approvedReview,
    state: "commented",
    body: "Some thoughts inline.",
  } satisfies GitHubPullRequestReview,
  dismissed: {
    ...approvedReview,
    state: "dismissed",
    body: null,
  } satisfies GitHubPullRequestReview,
  emptyBody: { ...approvedReview, body: null } satisfies GitHubPullRequestReview,
} as const;

export const githubPullRequestReviewChangesExamples = {
  body: { body: { from: "Original review body" } } satisfies GitHubPullRequestReviewChanges,
  empty: {} satisfies GitHubPullRequestReviewChanges,
} as const;

const submitted = {
  action: "submitted",
  review: approvedReview,
  pull_request: githubPullRequestExamples.open,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubPullRequestReviewEvent;

export const githubPullRequestReviewEventExamples = {
  submitted,
  edited: {
    ...submitted,
    action: "edited",
    changes: { body: { from: "Original review" } },
  } satisfies GitHubPullRequestReviewEvent,
  dismissed: {
    ...submitted,
    action: "dismissed",
    review: { ...approvedReview, state: "dismissed", body: null },
  } satisfies GitHubPullRequestReviewEvent,
  inOrg: {
    ...submitted,
    organization: githubOrganizationGitHub,
  } satisfies GitHubPullRequestReviewEvent,
  changesRequested: {
    ...submitted,
    review: {
      ...approvedReview,
      state: "changes_requested",
      body: "Please address the comments.",
    },
  } satisfies GitHubPullRequestReviewEvent,
} as const;
```

### GitHub Push Event

- Name: `github-push-event`
- Categories: github
- Description: GitHub push webhook payload with commits, pusher, and ref tracking.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-push-event`
- Install (with Zod): `npx shadcn add @open-types/github-push-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-push-event-examples`
- Detail page: https://open-types.dev/types/github-push-event
- Markdown: https://open-types.dev/types/github-push-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
} from "./github-shared";

export interface GitHubCommitAuthor {
  name: string;
  email: string;
  username?: string;
}

export interface GitHubCommit {
  id: string;
  tree_id: string;
  distinct: boolean;
  message: string;
  timestamp: string;
  url: string;
  author: GitHubCommitAuthor;
  committer: GitHubCommitAuthor;
  added: string[];
  removed: string[];
  modified: string[];
}

export interface GitHubPusher {
  name: string;
  email: string | null;
}

export interface GitHubPushEvent {
  ref: string;
  before: string;
  after: string;
  created: boolean;
  deleted: boolean;
  forced: boolean;
  compare: string;
  commits: GitHubCommit[];
  head_commit: GitHubCommit | null;
  repository: GitHubRepository;
  pusher: GitHubPusher;
  sender: GitHubUser;
  organization?: GitHubOrganization;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubCommitAuthor,
  GitHubCommit,
  GitHubPusher,
  GitHubPushEvent,
} from "../types/github-push-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
} from "./github-shared";

export const githubCommitAuthorSchema = z.object({
  name: z.string(),
  email: z.string(),
  username: z.string().optional(),
}) satisfies z.ZodType<GitHubCommitAuthor>;

export const githubCommitSchema = z.object({
  id: z.string(),
  tree_id: z.string(),
  distinct: z.boolean(),
  message: z.string(),
  timestamp: z.string(),
  url: z.string(),
  author: githubCommitAuthorSchema,
  committer: githubCommitAuthorSchema,
  added: z.array(z.string()),
  removed: z.array(z.string()),
  modified: z.array(z.string()),
}) satisfies z.ZodType<GitHubCommit>;

export const githubPusherSchema = z.object({
  name: z.string(),
  email: z.string().nullable(),
}) satisfies z.ZodType<GitHubPusher>;

export const githubPushEventSchema = z.object({
  ref: z.string(),
  before: z.string(),
  after: z.string(),
  created: z.boolean(),
  deleted: z.boolean(),
  forced: z.boolean(),
  compare: z.string(),
  commits: z.array(githubCommitSchema),
  head_commit: githubCommitSchema.nullable(),
  repository: githubRepositorySchema,
  pusher: githubPusherSchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
}) satisfies z.ZodType<GitHubPushEvent>;

export type {
  GitHubCommitAuthor,
  GitHubCommit,
  GitHubPusher,
  GitHubPushEvent,
} from "../types/github-push-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#push
// Captured: 2026-05
import type {
  GitHubCommitAuthor,
  GitHubCommit,
  GitHubPusher,
  GitHubPushEvent,
} from "../types/github-push-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";

const ZERO_SHA = "0000000000000000000000000000000000000000";

const commitAuthorOctocat = {
  name: "Monalisa Octocat",
  email: "octocat@github.com",
  username: "octocat",
} as const satisfies GitHubCommitAuthor;

const commitAuthorDeployBot = {
  name: "deploy-bot",
  email: "bot@example.com",
} as const satisfies GitHubCommitAuthor;

const commitBugfix = {
  id: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  tree_id: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  distinct: true,
  message: "Fix all the bugs",
  timestamp: "2011-04-14T16:00:49+02:00",
  url: "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
  author: commitAuthorOctocat,
  committer: commitAuthorOctocat,
  added: ["src/index.ts"],
  removed: [],
  modified: ["README.md"],
} as const satisfies GitHubCommit;

const commitRefactor = {
  id: "7e1f3a2c4d5e6f7081929394a5b6c7d8e9f0a1b2",
  tree_id: "7e1f3a2c4d5e6f7081929394a5b6c7d8e9f0a1b2",
  distinct: true,
  message: "Refactor commit pipeline\n\nExtract helper functions for clarity.",
  timestamp: "2024-09-12T10:15:30Z",
  url: "https://api.github.com/repos/octocat/Hello-World/commits/7e1f3a2c4d5e6f7081929394a5b6c7d8e9f0a1b2",
  author: commitAuthorDeployBot,
  committer: commitAuthorOctocat,
  added: ["lib/pipeline.ts", "lib/util.ts"],
  removed: ["lib/legacy.ts"],
  modified: ["lib/index.ts", "package.json"],
} as const satisfies GitHubCommit;

export const githubCommitAuthorExamples = {
  withUsername: commitAuthorOctocat,
  withoutUsername: commitAuthorDeployBot,
} as const;

export const githubCommitExamples = {
  minimal: commitBugfix,
  full: commitRefactor,
} as const;

export const githubPusherExamples = {
  withEmail: { name: "octocat", email: "octocat@github.com" } satisfies GitHubPusher,
  nullEmail: { name: "deploy-key", email: null } satisfies GitHubPusher,
} as const;

const pushMinimal = {
  ref: "refs/heads/main",
  before: "6113728f27ae82c7b1a177c8d03f9e96e0adf246",
  after: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  created: false,
  deleted: false,
  forced: false,
  compare: "https://github.com/octocat/Hello-World/compare/6113728f27ae...6dcb09b5b578",
  commits: [commitBugfix],
  head_commit: commitBugfix,
  repository: githubRepositoryHelloWorld,
  pusher: { name: "octocat", email: "octocat@github.com" },
  sender: githubUserOctocat,
} as const satisfies GitHubPushEvent;

export const githubPushEventExamples = {
  minimal: pushMinimal,
  full: {
    ...pushMinimal,
    commits: [commitBugfix, commitRefactor],
    head_commit: commitRefactor,
    organization: githubOrganizationGitHub,
  } satisfies GitHubPushEvent,
  branchCreate: {
    ...pushMinimal,
    created: true,
    before: ZERO_SHA,
  } satisfies GitHubPushEvent,
  branchDelete: {
    ...pushMinimal,
    deleted: true,
    after: ZERO_SHA,
    commits: [],
    head_commit: null,
  } satisfies GitHubPushEvent,
  forced: { ...pushMinimal, forced: true } satisfies GitHubPushEvent,
} as const;
```

### GitHub Release Event

- Name: `github-release-event`
- Categories: github
- Description: GitHub release webhook payload with assets, tag tracking, and draft/prerelease flags.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-release-event`
- Install (with Zod): `npx shadcn add @open-types/github-release-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-release-event-examples`
- Detail page: https://open-types.dev/types/github-release-event
- Markdown: https://open-types.dev/types/github-release-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
} from "./github-shared";

export interface GitHubReleaseAsset {
  url: string;
  browser_download_url: string;
  id: number;
  node_id: string;
  name: string;
  label: string | null;
  state: string;
  content_type: string;
  size: number;
  download_count: number;
  created_at: string;
  updated_at: string;
}

export interface GitHubRelease {
  url: string;
  html_url: string;
  id: number;
  node_id: string;
  tag_name: string;
  target_commitish: string;
  name: string | null;
  body: string | null;
  draft: boolean;
  prerelease: boolean;
  created_at: string;
  published_at: string | null;
  author: GitHubUser;
  assets: GitHubReleaseAsset[];
}

export type GitHubReleaseEventAction =
  | "published"
  | "unpublished"
  | "created"
  | "edited"
  | "deleted"
  | "prereleased"
  | "released";

export interface GitHubReleaseEvent {
  action: GitHubReleaseEventAction;
  release: GitHubRelease;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubReleaseAsset,
  GitHubRelease,
  GitHubReleaseEventAction,
  GitHubReleaseEvent,
} from "../types/github-release-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
} from "./github-shared";

export const githubReleaseAssetSchema = z.object({
  url: z.string(),
  browser_download_url: z.string(),
  id: z.number().int(),
  node_id: z.string(),
  name: z.string(),
  label: z.string().nullable(),
  state: z.string(),
  content_type: z.string(),
  size: z.number().int(),
  download_count: z.number().int(),
  created_at: z.string(),
  updated_at: z.string(),
}) satisfies z.ZodType<GitHubReleaseAsset>;

export const githubReleaseSchema = z.object({
  url: z.string(),
  html_url: z.string(),
  id: z.number().int(),
  node_id: z.string(),
  tag_name: z.string(),
  target_commitish: z.string(),
  name: z.string().nullable(),
  body: z.string().nullable(),
  draft: z.boolean(),
  prerelease: z.boolean(),
  created_at: z.string(),
  published_at: z.string().nullable(),
  author: githubUserSchema,
  assets: z.array(githubReleaseAssetSchema),
}) satisfies z.ZodType<GitHubRelease>;

export const githubReleaseEventActionSchema = z.enum([
  "published",
  "unpublished",
  "created",
  "edited",
  "deleted",
  "prereleased",
  "released",
]) satisfies z.ZodType<GitHubReleaseEventAction>;

export const githubReleaseEventSchema = z.object({
  action: githubReleaseEventActionSchema,
  release: githubReleaseSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
}) satisfies z.ZodType<GitHubReleaseEvent>;

export type {
  GitHubReleaseAsset,
  GitHubRelease,
  GitHubReleaseEventAction,
  GitHubReleaseEvent,
} from "../types/github-release-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#release
// Captured: 2026-05
import type {
  GitHubReleaseAsset,
  GitHubRelease,
  GitHubReleaseEvent,
} from "../types/github-release-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";

const tarballAsset = {
  url: "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
  browser_download_url: "https://github.com/octocat/Hello-World/releases/download/v1.0.0/source.tar.gz",
  id: 1,
  node_id: "MDEyOlJlbGVhc2VBc3NldDE=",
  name: "source.tar.gz",
  label: null,
  state: "uploaded",
  content_type: "application/gzip",
  size: 1024,
  download_count: 0,
  created_at: "2024-09-12T10:15:30Z",
  updated_at: "2024-09-12T10:15:31Z",
} as const satisfies GitHubReleaseAsset;

const binaryAsset = {
  url: "https://api.github.com/repos/octocat/Hello-World/releases/assets/2",
  browser_download_url: "https://github.com/octocat/Hello-World/releases/download/v1.0.0/app-linux-x64",
  id: 2,
  node_id: "MDEyOlJlbGVhc2VBc3NldDI=",
  name: "app-linux-x64",
  label: "Linux x86_64 binary",
  state: "uploaded",
  content_type: "application/octet-stream",
  size: 8_421_376,
  download_count: 142,
  created_at: "2024-09-12T10:16:00Z",
  updated_at: "2024-09-12T10:16:05Z",
} as const satisfies GitHubReleaseAsset;

export const githubReleaseAssetExamples = {
  source: tarballAsset,
  labeled: binaryAsset,
} as const;

const release = {
  url: "https://api.github.com/repos/octocat/Hello-World/releases/1",
  html_url: "https://github.com/octocat/Hello-World/releases/tag/v1.0.0",
  id: 1,
  node_id: "MDc6UmVsZWFzZTE=",
  tag_name: "v1.0.0",
  target_commitish: "main",
  name: "v1.0.0",
  body: "Initial public release.",
  draft: false,
  prerelease: false,
  created_at: "2024-09-12T10:15:30Z",
  published_at: "2024-09-12T10:20:00Z",
  author: githubUserOctocat,
  assets: [tarballAsset],
} as const satisfies GitHubRelease;

export const githubReleaseExamples = {
  minimal: release,
  draft: {
    ...release,
    draft: true,
    published_at: null,
  } satisfies GitHubRelease,
  prerelease: {
    ...release,
    tag_name: "v1.0.0-rc.1",
    name: "v1.0.0 RC 1",
    prerelease: true,
  } satisfies GitHubRelease,
  multipleAssets: {
    ...release,
    assets: [tarballAsset, binaryAsset],
  } satisfies GitHubRelease,
  noName: { ...release, name: null, body: null } satisfies GitHubRelease,
} as const;

const minimal = {
  action: "published",
  release,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubReleaseEvent;

export const githubReleaseEventExamples = {
  minimal,
  full: {
    ...minimal,
    organization: githubOrganizationGitHub,
  } satisfies GitHubReleaseEvent,
  edited: { ...minimal, action: "edited" } satisfies GitHubReleaseEvent,
  deleted: { ...minimal, action: "deleted" } satisfies GitHubReleaseEvent,
  prereleased: {
    ...minimal,
    action: "prereleased",
    release: {
      ...release,
      tag_name: "v1.0.0-beta.1",
      prerelease: true,
    },
  } satisfies GitHubReleaseEvent,
} as const;
```

### GitHub Shared

- Name: `github-shared`
- Categories: github
- Description: Common GitHub webhook types: User, Repository, Organization, Label, Milestone, and AuthorAssociation.
- Install (types only): `npx shadcn add @open-types/github-shared`
- Install (with Zod): `npx shadcn add @open-types/github-shared-zod`
- Install (with examples): `npx shadcn add @open-types/github-shared-examples`
- Detail page: https://open-types.dev/types/github-shared
- Markdown: https://open-types.dev/types/github-shared.md

#### Types

```typescript
export interface GitHubUser {
  login: string;
  id: number;
  node_id: string;
  avatar_url: string;
  url: string;
  html_url: string;
  type: string;
  site_admin: boolean;
}

export interface GitHubRepository {
  id: number;
  node_id: string;
  name: string;
  full_name: string;
  private: boolean;
  owner: GitHubUser;
  html_url: string;
  description: string | null;
  fork: boolean;
  url: string;
  default_branch: string;
}

export interface GitHubOrganization {
  login: string;
  id: number;
  node_id: string;
  url: string;
  avatar_url: string;
  description: string | null;
}

export interface GitHubLabel {
  id: number;
  node_id: string;
  url: string;
  name: string;
  color: string;
  description: string | null;
  default: boolean;
}

export type GitHubMilestoneState = "open" | "closed";

export interface GitHubMilestone {
  id: number;
  node_id: string;
  number: number;
  title: string;
  description: string | null;
  state: GitHubMilestoneState;
  open_issues: number;
  closed_issues: number;
  created_at: string;
  updated_at: string;
  closed_at: string | null;
  due_on: string | null;
}

export type GitHubAuthorAssociation =
  | "COLLABORATOR"
  | "CONTRIBUTOR"
  | "FIRST_TIMER"
  | "FIRST_TIME_CONTRIBUTOR"
  | "MANNEQUIN"
  | "MEMBER"
  | "NONE"
  | "OWNER";
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubLabel,
  GitHubMilestone,
  GitHubAuthorAssociation,
} from "../types/github-shared";

export const githubUserSchema = z.object({
  login: z.string(),
  id: z.number().int(),
  node_id: z.string(),
  avatar_url: z.string(),
  url: z.string(),
  html_url: z.string(),
  type: z.string(),
  site_admin: z.boolean(),
}) satisfies z.ZodType<GitHubUser>;

export const githubRepositorySchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  name: z.string(),
  full_name: z.string(),
  private: z.boolean(),
  owner: githubUserSchema,
  html_url: z.string(),
  description: z.string().nullable(),
  fork: z.boolean(),
  url: z.string(),
  default_branch: z.string(),
}) satisfies z.ZodType<GitHubRepository>;

export const githubOrganizationSchema = z.object({
  login: z.string(),
  id: z.number().int(),
  node_id: z.string(),
  url: z.string(),
  avatar_url: z.string(),
  description: z.string().nullable(),
}) satisfies z.ZodType<GitHubOrganization>;

export const githubLabelSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  url: z.string(),
  name: z.string(),
  color: z.string(),
  description: z.string().nullable(),
  default: z.boolean(),
}) satisfies z.ZodType<GitHubLabel>;

export const githubMilestoneSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  number: z.number().int(),
  title: z.string(),
  description: z.string().nullable(),
  state: z.enum(["open", "closed"]),
  open_issues: z.number().int(),
  closed_issues: z.number().int(),
  created_at: z.string(),
  updated_at: z.string(),
  closed_at: z.string().nullable(),
  due_on: z.string().nullable(),
}) satisfies z.ZodType<GitHubMilestone>;

export const githubAuthorAssociationSchema = z.enum([
  "COLLABORATOR",
  "CONTRIBUTOR",
  "FIRST_TIMER",
  "FIRST_TIME_CONTRIBUTOR",
  "MANNEQUIN",
  "MEMBER",
  "NONE",
  "OWNER",
]) satisfies z.ZodType<GitHubAuthorAssociation>;

export type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubLabel,
  GitHubMilestone,
  GitHubMilestoneState,
  GitHubAuthorAssociation,
} from "../types/github-shared";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#webhook-payload-object-common-properties
// Captured: 2026-05
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubLabel,
  GitHubMilestone,
  GitHubAuthorAssociation,
} from "../types/github-shared";
import {
  githubUserOctocat,
  githubUserBot,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
  githubLabelBug,
  githubMilestoneV1,
} from "./shared/github.examples";

export const githubUserExamples = {
  human: githubUserOctocat,
  bot: githubUserBot,
  siteAdmin: { ...githubUserOctocat, site_admin: true } satisfies GitHubUser,
} as const;

export const githubRepositoryExamples = {
  public: githubRepositoryHelloWorld,
  private: { ...githubRepositoryHelloWorld, private: true } satisfies GitHubRepository,
  fork: { ...githubRepositoryHelloWorld, fork: true } satisfies GitHubRepository,
  noDescription: {
    ...githubRepositoryHelloWorld,
    description: null,
  } satisfies GitHubRepository,
} as const;

export const githubOrganizationExamples = {
  minimal: githubOrganizationGitHub,
  noDescription: {
    ...githubOrganizationGitHub,
    description: null,
  } satisfies GitHubOrganization,
} as const;

export const githubLabelExamples = {
  bug: githubLabelBug,
  custom: {
    id: 208045947,
    node_id: "MDU6TGFiZWwyMDgwNDU5NDc=",
    url: "https://api.github.com/repos/octocat/Hello-World/labels/enhancement",
    name: "enhancement",
    color: "a2eeef",
    description: null,
    default: false,
  } satisfies GitHubLabel,
} as const;

export const githubMilestoneExamples = {
  open: githubMilestoneV1,
  closed: {
    ...githubMilestoneV1,
    state: "closed",
    closed_at: "2014-03-03T18:58:10Z",
    due_on: null,
  } satisfies GitHubMilestone,
} as const;

export const githubAuthorAssociationExamples = {
  owner: "OWNER",
  member: "MEMBER",
  collaborator: "COLLABORATOR",
  contributor: "CONTRIBUTOR",
  firstTimer: "FIRST_TIMER",
  firstTimeContributor: "FIRST_TIME_CONTRIBUTOR",
  mannequin: "MANNEQUIN",
  none: "NONE",
} as const satisfies Record<string, GitHubAuthorAssociation>;
```

### GitHub Star Event

- Name: `github-star-event`
- Categories: github
- Description: GitHub star webhook payload with created/deleted action and timestamp.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-star-event`
- Install (with Zod): `npx shadcn add @open-types/github-star-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-star-event-examples`
- Detail page: https://open-types.dev/types/github-star-event
- Markdown: https://open-types.dev/types/github-star-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
} from "./github-shared";

export type GitHubStarEventAction = "created" | "deleted";

export interface GitHubStarEvent {
  action: GitHubStarEventAction;
  starred_at: string | null;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubStarEventAction,
  GitHubStarEvent,
} from "../types/github-star-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
} from "./github-shared";

export const githubStarEventActionSchema = z.enum([
  "created",
  "deleted",
]) satisfies z.ZodType<GitHubStarEventAction>;

export const githubStarEventSchema = z.object({
  action: githubStarEventActionSchema,
  starred_at: z.string().nullable(),
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
}) satisfies z.ZodType<GitHubStarEvent>;

export type {
  GitHubStarEventAction,
  GitHubStarEvent,
} from "../types/github-star-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#star
// Captured: 2026-05
import type { GitHubStarEvent } from "../types/github-star-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";

const created = {
  action: "created",
  starred_at: "2024-09-12T14:23:09Z",
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubStarEvent;

export const githubStarEventExamples = {
  created,
  deleted: {
    ...created,
    action: "deleted",
    starred_at: null,
  } satisfies GitHubStarEvent,
  inOrg: { ...created, organization: githubOrganizationGitHub } satisfies GitHubStarEvent,
} as const;
```

### GitHub Workflow Run Event

- Name: `github-workflow-run-event`
- Categories: github
- Description: GitHub workflow_run webhook payload with run status, conclusion, and workflow tracking.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/github-workflow-run-event`
- Install (with Zod): `npx shadcn add @open-types/github-workflow-run-event-zod`
- Install (with examples): `npx shadcn add @open-types/github-workflow-run-event-examples`
- Detail page: https://open-types.dev/types/github-workflow-run-event
- Markdown: https://open-types.dev/types/github-workflow-run-event.md

#### Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
} from "./github-shared";

export interface GitHubWorkflowRun {
  id: number;
  node_id: string;
  name: string;
  head_branch: string;
  head_sha: string;
  run_number: number;
  event: string;
  status: string | null;
  conclusion: string | null;
  workflow_id: number;
  url: string;
  html_url: string;
  created_at: string;
  updated_at: string;
  run_attempt: number;
  run_started_at: string;
}

export interface GitHubWorkflow {
  id: number;
  node_id: string;
  name: string;
  path: string;
  state: string;
  created_at: string;
  updated_at: string;
}

export type GitHubWorkflowRunEventAction =
  | "requested"
  | "completed"
  | "in_progress";

export interface GitHubWorkflowRunEvent {
  action: GitHubWorkflowRunEventAction;
  workflow_run: GitHubWorkflowRun;
  workflow: GitHubWorkflow;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubWorkflowRun,
  GitHubWorkflow,
  GitHubWorkflowRunEventAction,
  GitHubWorkflowRunEvent,
} from "../types/github-workflow-run-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
} from "./github-shared";

export const githubWorkflowRunSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  name: z.string(),
  head_branch: z.string(),
  head_sha: z.string(),
  run_number: z.number().int(),
  event: z.string(),
  status: z.string().nullable(),
  conclusion: z.string().nullable(),
  workflow_id: z.number().int(),
  url: z.string(),
  html_url: z.string(),
  created_at: z.string(),
  updated_at: z.string(),
  run_attempt: z.number().int(),
  run_started_at: z.string(),
}) satisfies z.ZodType<GitHubWorkflowRun>;

export const githubWorkflowSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  name: z.string(),
  path: z.string(),
  state: z.string(),
  created_at: z.string(),
  updated_at: z.string(),
}) satisfies z.ZodType<GitHubWorkflow>;

export const githubWorkflowRunEventActionSchema = z.enum([
  "requested",
  "completed",
  "in_progress",
]) satisfies z.ZodType<GitHubWorkflowRunEventAction>;

export const githubWorkflowRunEventSchema = z.object({
  action: githubWorkflowRunEventActionSchema,
  workflow_run: githubWorkflowRunSchema,
  workflow: githubWorkflowSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
}) satisfies z.ZodType<GitHubWorkflowRunEvent>;

export type {
  GitHubWorkflowRun,
  GitHubWorkflow,
  GitHubWorkflowRunEventAction,
  GitHubWorkflowRunEvent,
} from "../types/github-workflow-run-event";
```

#### Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_run
// Captured: 2026-05
import type {
  GitHubWorkflowRun,
  GitHubWorkflow,
  GitHubWorkflowRunEvent,
} from "../types/github-workflow-run-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";

const workflowRunInProgress = {
  id: 9876543210,
  node_id: "WFR_kwLOABCDEF",
  name: "CI",
  head_branch: "main",
  head_sha: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  run_number: 42,
  event: "push",
  status: "in_progress",
  conclusion: null,
  workflow_id: 161335,
  url: "https://api.github.com/repos/octocat/Hello-World/actions/runs/9876543210",
  html_url: "https://github.com/octocat/Hello-World/actions/runs/9876543210",
  created_at: "2024-09-12T10:15:30Z",
  updated_at: "2024-09-12T10:15:35Z",
  run_attempt: 1,
  run_started_at: "2024-09-12T10:15:32Z",
} as const satisfies GitHubWorkflowRun;

const workflowRunSuccess = {
  ...workflowRunInProgress,
  status: "completed",
  conclusion: "success",
  updated_at: "2024-09-12T10:20:10Z",
} as const satisfies GitHubWorkflowRun;

export const githubWorkflowRunExamples = {
  inProgress: workflowRunInProgress,
  success: workflowRunSuccess,
  failure: {
    ...workflowRunSuccess,
    conclusion: "failure",
  } satisfies GitHubWorkflowRun,
  retry: { ...workflowRunSuccess, run_attempt: 2 } satisfies GitHubWorkflowRun,
} as const;

const workflow = {
  id: 161335,
  node_id: "MDg6V29ya2Zsb3cxNjEzMzU=",
  name: "CI",
  path: ".github/workflows/ci.yml",
  state: "active",
  created_at: "2020-01-08T23:48:37.000Z",
  updated_at: "2020-01-08T23:50:21.000Z",
} as const satisfies GitHubWorkflow;

export const githubWorkflowExamples = {
  active: workflow,
  disabled: { ...workflow, state: "disabled_manually" } satisfies GitHubWorkflow,
} as const;

const minimal = {
  action: "requested",
  workflow_run: workflowRunInProgress,
  workflow,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubWorkflowRunEvent;

export const githubWorkflowRunEventExamples = {
  minimal,
  inProgress: {
    ...minimal,
    action: "in_progress",
  } satisfies GitHubWorkflowRunEvent,
  completed: {
    ...minimal,
    action: "completed",
    workflow_run: workflowRunSuccess,
  } satisfies GitHubWorkflowRunEvent,
  full: {
    ...minimal,
    action: "completed",
    workflow_run: workflowRunSuccess,
    organization: githubOrganizationGitHub,
  } satisfies GitHubWorkflowRunEvent,
} as const;
```

### Google OAuth ID Token

- Name: `google-oauth-id-token`
- Categories: google
- Description: Google OAuth2 ID token claims with email, name, picture, and verification.
- Install (types only): `npx shadcn add @open-types/google-oauth-id-token`
- Install (with Zod): `npx shadcn add @open-types/google-oauth-id-token-zod`
- Install (with examples): `npx shadcn add @open-types/google-oauth-id-token-examples`
- Detail page: https://open-types.dev/types/google-oauth-id-token
- Markdown: https://open-types.dev/types/google-oauth-id-token.md

#### Types

```typescript
export interface GoogleOAuthIdToken {
  iss: string;
  azp: string;
  aud: string;
  sub: string;
  email?: string;
  email_verified?: boolean;
  name?: string;
  picture?: string;
  given_name?: string;
  family_name?: string;
  locale?: string;
  iat: number;
  exp: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { GoogleOAuthIdToken } from "../types/google-oauth-id-token";

export const googleOAuthIdTokenSchema = z.object({
  iss: z.string().min(1, { error: "Issuer is required" }),
  azp: z.string().min(1, { error: "Authorized party is required" }),
  aud: z.string().min(1, { error: "Audience is required" }),
  sub: z.string().min(1, { error: "Subject is required" }),
  email: z.email({ error: "Email must be a valid email address" }).optional(),
  email_verified: z.boolean().optional(),
  name: z.string().optional(),
  picture: z.url({ error: "Picture must be a valid URL" }).optional(),
  given_name: z.string().optional(),
  family_name: z.string().optional(),
  locale: z.string().optional(),
  iat: z.number().int({ error: "Issued at must be a whole number" }),
  exp: z.number().int({ error: "Expiration must be a whole number" }),
}) satisfies z.ZodType<GoogleOAuthIdToken>;

export type { GoogleOAuthIdToken } from "../types/google-oauth-id-token";
```

#### Examples

```typescript
// Source: https://developers.google.com/identity/openid-connect/openid-connect#an-id-tokens-payload
// Captured: 2026-05
import type { GoogleOAuthIdToken } from "../types/google-oauth-id-token";

const fullProfile = {
  iss: "https://accounts.google.com",
  azp: "1234567890-abcdefghijklmnopqrstuvwxyz12345.apps.googleusercontent.com",
  aud: "1234567890-abcdefghijklmnopqrstuvwxyz12345.apps.googleusercontent.com",
  sub: "104564094328765432109",
  email: "jenny.rosen@example.com",
  email_verified: true,
  name: "Jenny Rosen",
  picture: "https://lh3.googleusercontent.com/a/avatar-jenny",
  given_name: "Jenny",
  family_name: "Rosen",
  locale: "en",
  iat: 1712948400,
  exp: 1712952000,
} as const satisfies GoogleOAuthIdToken;

export const googleOAuthIdTokenExamples = {
  fullProfile,
  noProfileScopes: {
    iss: "https://accounts.google.com",
    azp: fullProfile.azp,
    aud: fullProfile.aud,
    sub: fullProfile.sub,
    iat: fullProfile.iat,
    exp: fullProfile.exp,
  } satisfies GoogleOAuthIdToken,
  emailOnly: {
    iss: "https://accounts.google.com",
    azp: fullProfile.azp,
    aud: fullProfile.aud,
    sub: fullProfile.sub,
    email: "user@example.com",
    email_verified: true,
    iat: fullProfile.iat,
    exp: fullProfile.exp,
  } satisfies GoogleOAuthIdToken,
  unverifiedEmail: {
    ...fullProfile,
    sub: "104564094328765432110",
    email: "unverified@example.com",
    email_verified: false,
  } satisfies GoogleOAuthIdToken,
  hostedDomain: {
    ...fullProfile,
    sub: "104564094328765432111",
    email: "engineer@company.com",
    locale: "en-GB",
  } satisfies GoogleOAuthIdToken,
} as const;
```

### GraphQL Error

- Name: `graphql-error`
- Categories: api
- Description: GraphQL error and response types with locations, path, and extensions.
- Install (types only): `npx shadcn add @open-types/graphql-error`
- Install (with Zod): `npx shadcn add @open-types/graphql-error-zod`
- Install (with examples): `npx shadcn add @open-types/graphql-error-examples`
- Detail page: https://open-types.dev/types/graphql-error
- Markdown: https://open-types.dev/types/graphql-error.md

#### Types

```typescript
export interface GraphQLErrorLocation {
  line: number;
  column: number;
}

export interface GraphQLError {
  message: string;
  locations?: GraphQLErrorLocation[];
  path?: (string | number)[];
  extensions?: Record<string, unknown>;
}

export interface GraphQLResponse {
  data?: Record<string, unknown> | null;
  errors?: GraphQLError[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  GraphQLError,
  GraphQLErrorLocation,
  GraphQLResponse,
} from "../types/graphql-error";

export const graphQLErrorLocationSchema = z.object({
  line: z.number().int().min(1, { error: "Line must be at least 1" }),
  column: z.number().int().min(1, { error: "Column must be at least 1" }),
}) satisfies z.ZodType<GraphQLErrorLocation>;

export const graphQLErrorSchema = z.object({
  message: z.string().min(1, { error: "Error message is required" }),
  locations: z.array(graphQLErrorLocationSchema).optional(),
  path: z.array(z.union([z.string(), z.number()])).optional(),
  extensions: z.record(z.string(), z.unknown()).optional(),
}) satisfies z.ZodType<GraphQLError>;

export const graphQLResponseSchema = z.object({
  data: z.record(z.string(), z.unknown()).nullable().optional(),
  errors: z.array(graphQLErrorSchema).optional(),
}) satisfies z.ZodType<GraphQLResponse>;

export type {
  GraphQLError,
  GraphQLErrorLocation,
  GraphQLResponse,
} from "../types/graphql-error";
```

#### Examples

```typescript
// Source: https://spec.graphql.org/October2021/#sec-Errors
// Captured: 2026-05
import type {
  GraphQLErrorLocation,
  GraphQLError,
  GraphQLResponse,
} from "../types/graphql-error";

const location = { line: 4, column: 3 } as const satisfies GraphQLErrorLocation;

export const graphQLErrorLocationExamples = {
  topLevel: { line: 1, column: 1 } satisfies GraphQLErrorLocation,
  nested: location,
  deep: { line: 42, column: 18 } satisfies GraphQLErrorLocation,
} as const;

const fieldError = {
  message: "Cannot return null for non-nullable field User.email",
  locations: [location],
  path: ["user", "email"],
  extensions: { code: "INTERNAL_SERVER_ERROR" },
} as const satisfies GraphQLError;

export const graphQLErrorExamples = {
  fieldError,
  syntax: {
    message: 'Syntax Error: Unexpected token "}"',
    locations: [{ line: 6, column: 1 }],
  } satisfies GraphQLError,
  unauthorized: {
    message: "Unauthorized",
    path: ["createOrder"],
    extensions: { code: "UNAUTHENTICATED", classification: "AuthenticationError" },
  } satisfies GraphQLError,
  arrayPath: {
    message: "Item validation failed",
    path: ["orders", 2, "items", 0, "quantity"],
    extensions: { code: "BAD_USER_INPUT" },
  } satisfies GraphQLError,
} as const;

export const graphQLResponseExamples = {
  errorOnly: { errors: [fieldError] } satisfies GraphQLResponse,
  partial: {
    data: { user: { id: "user_321", name: "Jenny Rosen", email: null } },
    errors: [fieldError],
  } satisfies GraphQLResponse,
  success: {
    data: { user: { id: "user_321", name: "Jenny Rosen" } },
  } satisfies GraphQLResponse,
  nullData: { data: null, errors: [fieldError] } satisfies GraphQLResponse,
  empty: {} satisfies GraphQLResponse,
} as const;
```

### Health Check

- Name: `health-check`
- Categories: infrastructure
- Description: Service health check with status, individual checks, and duration.
- Install (types only): `npx shadcn add @open-types/health-check`
- Install (with Zod): `npx shadcn add @open-types/health-check-zod`
- Install (with examples): `npx shadcn add @open-types/health-check-examples`
- Detail page: https://open-types.dev/types/health-check
- Markdown: https://open-types.dev/types/health-check.md

#### Types

```typescript
export type HealthCheckStatus = "healthy" | "unhealthy" | "starting" | "none";

export interface HealthCheckEntry {
  name: string;
  status: HealthCheckStatus;
  duration_ms?: number;
  output?: string;
}

export interface HealthCheckResult {
  status: HealthCheckStatus;
  checks?: HealthCheckEntry[];
  timestamp?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  HealthCheckEntry,
  HealthCheckResult,
  HealthCheckStatus,
} from "../types/health-check";

export const healthCheckStatusSchema = z.enum([
  "healthy",
  "unhealthy",
  "starting",
  "none",
]) satisfies z.ZodType<HealthCheckStatus>;

export const healthCheckEntrySchema = z.object({
  name: z.string().min(1, { error: "Check name is required" }),
  status: healthCheckStatusSchema,
  duration_ms: z
    .number()
    .int()
    .min(0, { error: "Duration must be greater than or equal to 0" })
    .optional(),
  output: z.string().optional(),
}) satisfies z.ZodType<HealthCheckEntry>;

export const healthCheckResultSchema = z.object({
  status: healthCheckStatusSchema,
  checks: z.array(healthCheckEntrySchema).optional(),
  timestamp: z.iso.datetime({ error: "Invalid timestamp" }).optional(),
}) satisfies z.ZodType<HealthCheckResult>;

export type {
  HealthCheckEntry,
  HealthCheckResult,
  HealthCheckStatus,
} from "../types/health-check";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after Kubernetes liveness/readiness conventions
import type {
  HealthCheckStatus,
  HealthCheckEntry,
  HealthCheckResult,
} from "../types/health-check";

export const healthCheckStatusExamples = {
  healthy: "healthy",
  unhealthy: "unhealthy",
  starting: "starting",
  none: "none",
} as const satisfies Record<string, HealthCheckStatus>;

const dbHealthy = {
  name: "database",
  status: "healthy",
  duration_ms: 12,
  output: "SELECT 1 returned in 12ms",
} as const satisfies HealthCheckEntry;

const cacheHealthy = {
  name: "cache",
  status: "healthy",
  duration_ms: 3,
} as const satisfies HealthCheckEntry;

const queueDown = {
  name: "queue",
  status: "unhealthy",
  duration_ms: 5_001,
  output: "Connection refused after 5000ms",
} as const satisfies HealthCheckEntry;

export const healthCheckEntryExamples = {
  databaseHealthy: dbHealthy,
  cacheHealthy,
  queueDown,
  minimal: { name: "self", status: "healthy" } satisfies HealthCheckEntry,
  starting: { name: "migrator", status: "starting" } satisfies HealthCheckEntry,
} as const;

export const healthCheckResultExamples = {
  allHealthy: {
    status: "healthy",
    checks: [dbHealthy, cacheHealthy],
    timestamp: "2026-05-16T18:30:00Z",
  } satisfies HealthCheckResult,
  oneDegraded: {
    status: "unhealthy",
    checks: [dbHealthy, queueDown],
    timestamp: "2026-05-16T18:30:00Z",
  } satisfies HealthCheckResult,
  starting: {
    status: "starting",
    checks: [{ name: "migrator", status: "starting" }],
    timestamp: "2026-05-16T18:30:00Z",
  } satisfies HealthCheckResult,
  topLevelOnly: { status: "healthy" } satisfies HealthCheckResult,
} as const;
```

### JWT Claims

- Name: `jwt-claims`
- Categories: auth
- Description: Standard JWT claims (RFC 7519) with issuer, subject, audience, and expiration.
- Install (types only): `npx shadcn add @open-types/jwt-claims`
- Install (with Zod): `npx shadcn add @open-types/jwt-claims-zod`
- Install (with examples): `npx shadcn add @open-types/jwt-claims-examples`
- Detail page: https://open-types.dev/types/jwt-claims
- Markdown: https://open-types.dev/types/jwt-claims.md

#### Types

```typescript
export interface JWTClaims {
  iss?: string;
  sub?: string;
  aud?: string | string[];
  exp?: number;
  nbf?: number;
  iat?: number;
  jti?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { JWTClaims } from "../types/jwt-claims";

export const jwtClaimsSchema = z.object({
  iss: z.string().optional(),
  sub: z.string().optional(),
  aud: z.union([z.string(), z.array(z.string())]).optional(),
  exp: z.number().int().optional(),
  nbf: z.number().int().optional(),
  iat: z.number().int().optional(),
  jti: z.string().optional(),
}).passthrough() satisfies z.ZodType<JWTClaims>;

export type { JWTClaims } from "../types/jwt-claims";
```

#### Examples

```typescript
// Source: https://datatracker.ietf.org/doc/html/rfc7519#section-4.1
// Captured: 2026-05
import type { JWTClaims } from "../types/jwt-claims";

export const jwtClaimsExamples = {
  empty: {} satisfies JWTClaims,
  standardAccessToken: {
    iss: "https://auth.example.com",
    sub: "user_321",
    aud: "https://api.example.com",
    exp: 1712952000,
    nbf: 1712948400,
    iat: 1712948400,
    jti: "9f8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
  } satisfies JWTClaims,
  multipleAudiences: {
    iss: "https://auth.example.com",
    sub: "user_321",
    aud: ["https://api.example.com", "https://admin.example.com"],
    exp: 1712952000,
    iat: 1712948400,
  } satisfies JWTClaims,
  refreshTokenClaims: {
    iss: "https://auth.example.com",
    sub: "user_321",
    exp: 1715540400,
    iat: 1712948400,
    jti: "refresh-9f8b7c6d-5e4f-3a2b",
  } satisfies JWTClaims,
  serviceToService: {
    iss: "https://service-a",
    sub: "service-a",
    aud: "https://service-b",
    exp: 1712952000,
    iat: 1712948400,
  } satisfies JWTClaims,
} as const;
```

### Locale

- Name: `locale`
- Categories: i18n
- Description: Locale with language, region, script, text direction, and display names.
- Install (types only): `npx shadcn add @open-types/locale`
- Install (with Zod): `npx shadcn add @open-types/locale-zod`
- Install (with examples): `npx shadcn add @open-types/locale-examples`
- Detail page: https://open-types.dev/types/locale
- Markdown: https://open-types.dev/types/locale.md

#### Types

```typescript
export type TextDirection = "ltr" | "rtl";

export interface Locale {
  code: string;
  language: string;
  region?: string;
  script?: string;
  direction?: TextDirection;
  name: string;
  native_name?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Locale, TextDirection } from "../types/locale";

export const textDirectionSchema = z.enum(["ltr", "rtl"]) satisfies z.ZodType<TextDirection>;

export const localeSchema = z.object({
  code: z.string().min(1, { error: "Locale code is required" }),
  language: z.string().min(1, { error: "Language is required" }),
  region: z.string().min(1, { error: "Region cannot be empty" }).optional(),
  script: z.string().min(1, { error: "Script cannot be empty" }).optional(),
  direction: textDirectionSchema.optional(),
  name: z.string().min(1, { error: "Name is required" }),
  native_name: z.string().min(1, { error: "Native name cannot be empty" }).optional(),
}) satisfies z.ZodType<Locale>;

export type { Locale, TextDirection } from "../types/locale";
```

#### Examples

```typescript
// Source: hand-crafted; based on BCP-47 tags
import type { Locale, TextDirection } from "../types/locale";

export const textDirectionExamples = {
  ltr: "ltr",
  rtl: "rtl",
} as const satisfies Record<string, TextDirection>;

export const localeExamples = {
  enUS: {
    code: "en-US",
    language: "en",
    region: "US",
    direction: "ltr",
    name: "English (United States)",
    native_name: "English (United States)",
  } satisfies Locale,
  esES: {
    code: "es-ES",
    language: "es",
    region: "ES",
    direction: "ltr",
    name: "Spanish (Spain)",
    native_name: "Español (España)",
  } satisfies Locale,
  arSA: {
    code: "ar-SA",
    language: "ar",
    region: "SA",
    direction: "rtl",
    name: "Arabic (Saudi Arabia)",
    native_name: "العربية (المملكة العربية السعودية)",
  } satisfies Locale,
  heIL: {
    code: "he-IL",
    language: "he",
    region: "IL",
    direction: "rtl",
    name: "Hebrew (Israel)",
    native_name: "עברית (ישראל)",
  } satisfies Locale,
  zhHansCN: {
    code: "zh-Hans-CN",
    language: "zh",
    script: "Hans",
    region: "CN",
    direction: "ltr",
    name: "Chinese (Simplified, China)",
    native_name: "中文（简体，中国）",
  } satisfies Locale,
  enLanguageOnly: {
    code: "en",
    language: "en",
    name: "English",
  } satisfies Locale,
} as const;
```

### Log Entry

- Name: `log-entry`
- Categories: logging
- Description: Structured log entry with level, message, service, trace ID, and error details.
- Install (types only): `npx shadcn add @open-types/log-entry`
- Install (with Zod): `npx shadcn add @open-types/log-entry-zod`
- Install (with examples): `npx shadcn add @open-types/log-entry-examples`
- Detail page: https://open-types.dev/types/log-entry
- Markdown: https://open-types.dev/types/log-entry.md

#### Types

```typescript
export type LogLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal";

export interface LogError {
  name: string;
  message: string;
  stack?: string;
}

export interface LogEntry {
  level: LogLevel;
  message: string;
  timestamp: string;
  service?: string;
  context?: Record<string, unknown>;
  error?: LogError;
  trace_id?: string;
  span_id?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { LogEntry, LogError, LogLevel } from "../types/log-entry";

export const logLevelSchema = z.enum([
  "trace",
  "debug",
  "info",
  "warn",
  "error",
  "fatal",
]) satisfies z.ZodType<LogLevel>;

export const logErrorSchema = z.object({
  name: z.string().min(1, { error: "Error name is required" }),
  message: z.string().min(1, { error: "Error message is required" }),
  stack: z.string().optional(),
}) satisfies z.ZodType<LogError>;

export const logEntrySchema = z.object({
  level: logLevelSchema,
  message: z.string().min(1, { error: "Log message is required" }),
  timestamp: z.iso.datetime({ error: "Invalid timestamp" }),
  service: z.string().optional(),
  context: z.record(z.string(), z.unknown()).optional(),
  error: logErrorSchema.optional(),
  trace_id: z.string().optional(),
  span_id: z.string().optional(),
}) satisfies z.ZodType<LogEntry>;

export type { LogEntry, LogError, LogLevel } from "../types/log-entry";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after pino/winston JSON output and OpenTelemetry conventions
import type {
  LogLevel,
  LogError,
  LogEntry,
} from "../types/log-entry";

export const logLevelExamples = {
  trace: "trace",
  debug: "debug",
  info: "info",
  warn: "warn",
  error: "error",
  fatal: "fatal",
} as const satisfies Record<string, LogLevel>;

const validationError = {
  name: "ValidationError",
  message: "email is required",
  stack: "ValidationError: email is required\n    at validate (/app/src/validate.ts:42:11)",
} as const satisfies LogError;

export const logErrorExamples = {
  validation: validationError,
  noStack: { name: "TimeoutError", message: "Request timed out after 30s" } satisfies LogError,
  minimal: { name: "Error", message: "Something went wrong" } satisfies LogError,
} as const;

const infoEntry = {
  level: "info",
  message: "Request handled",
  timestamp: "2026-05-16T18:30:00.000Z",
  service: "api",
  context: { method: "GET", path: "/v1/users", status: 200, duration_ms: 12 },
  trace_id: "4bf92f3577b34da6a3ce929d0e0e4736",
  span_id: "00f067aa0ba902b7",
} as const satisfies LogEntry;

export const logEntryExamples = {
  info: infoEntry,
  warn: { ...infoEntry, level: "warn", message: "Slow query", context: { duration_ms: 1850 } } satisfies LogEntry,
  errorWithStack: {
    ...infoEntry,
    level: "error",
    message: "Failed to validate input",
    error: validationError,
    context: { request_id: "req_abc" },
  } satisfies LogEntry,
  fatal: {
    ...infoEntry,
    level: "fatal",
    message: "Out of memory",
    error: { name: "FatalError", message: "JavaScript heap out of memory" },
  } satisfies LogEntry,
  debug: { ...infoEntry, level: "debug", message: "cache miss" } satisfies LogEntry,
  minimal: {
    level: "info",
    message: "boot",
    timestamp: "2026-05-16T18:30:00.000Z",
  } satisfies LogEntry,
} as const;
```

### Login Credentials

- Name: `login-credentials`
- Categories: auth
- Description: Email and password login form validation with optional rememberMe.
- Install (types only): `npx shadcn add @open-types/login-credentials`
- Install (with Zod): `npx shadcn add @open-types/login-credentials-zod`
- Install (with examples): `npx shadcn add @open-types/login-credentials-examples`
- Detail page: https://open-types.dev/types/login-credentials
- Markdown: https://open-types.dev/types/login-credentials.md

#### Types

```typescript
export interface LoginCredentials {
  email: string;
  password: string;
  rememberMe?: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { LoginCredentials } from "../types/login-credentials";

export const loginCredentialsSchema = z.object({
  email: z.email({ error: "Invalid email address" }),
  password: z
    .string()
    .min(8, { error: "Password must be at least 8 characters" }),
  rememberMe: z.boolean().default(false),
}) satisfies z.ZodType<LoginCredentials>;

export type { LoginCredentials } from "../types/login-credentials";
```

#### Examples

```typescript
// Source: hand-crafted
import type { LoginCredentials } from "../types/login-credentials";

export const loginCredentialsExamples = {
  basic: {
    email: "jenny@example.com",
    password: "correct-horse-battery-staple",
  } satisfies LoginCredentials,
  rememberMe: {
    email: "alex@example.com",
    password: "P@ssw0rd-1234-secure",
    rememberMe: true,
  } satisfies LoginCredentials,
  sessionOnly: {
    email: "sam@example.com",
    password: "another-good-passphrase-99",
    rememberMe: false,
  } satisfies LoginCredentials,
} as const;
```

### Money

- Name: `money`
- Categories: common
- Description: Monetary amount with currency code (ISO 4217) and optional formatted string.
- Install (types only): `npx shadcn add @open-types/money`
- Install (with Zod): `npx shadcn add @open-types/money-zod`
- Install (with examples): `npx shadcn add @open-types/money-examples`
- Detail page: https://open-types.dev/types/money
- Markdown: https://open-types.dev/types/money.md

#### Types

```typescript
export interface Money {
  amount: number;
  currency: string;
  formatted?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Money } from "../types/money";

const ISO_CURRENCY_REGEX = /^[A-Z]{3}$/;

export const moneySchema = z.object({
  amount: z.number(),
  currency: z
    .string()
    .transform((value) => value.toUpperCase())
    .pipe(
      z.string().regex(ISO_CURRENCY_REGEX, {
        error: "Currency must be a 3-letter ISO code",
      })
    ),
  formatted: z.string().optional(),
}) satisfies z.ZodType<Money>;

export type { Money } from "../types/money";
```

#### Examples

```typescript
// Source: hand-crafted
import type { Money } from "../types/money";

export const moneyExamples = {
  usd: { amount: 19_99, currency: "USD", formatted: "$19.99" } satisfies Money,
  eur: { amount: 99_00, currency: "EUR" } satisfies Money,
  jpyZeroDecimal: { amount: 12500, currency: "JPY", formatted: "¥12,500" } satisfies Money,
  zero: { amount: 0, currency: "USD" } satisfies Money,
  negative: { amount: -250, currency: "USD", formatted: "-$2.50" } satisfies Money,
  large: { amount: 999_999_999, currency: "USD" } satisfies Money,
} as const;
```

### Newsletter Subscription

- Name: `newsletter-subscription`
- Categories: forms
- Description: Newsletter subscription with email, name, source, and subscription date.
- Install (types only): `npx shadcn add @open-types/newsletter-subscription`
- Install (with Zod): `npx shadcn add @open-types/newsletter-subscription-zod`
- Install (with examples): `npx shadcn add @open-types/newsletter-subscription-examples`
- Detail page: https://open-types.dev/types/newsletter-subscription
- Markdown: https://open-types.dev/types/newsletter-subscription.md

#### Types

```typescript
export interface NewsletterSubscription {
  email: string;
  name?: string;
  source?: string;
  subscribed_at?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { NewsletterSubscription } from "../types/newsletter-subscription";

export const newsletterSubscriptionSchema = z.object({
  email: z.string().email({ error: "Email must be a valid email address" }),
  name: z.string().optional(),
  source: z.string().optional(),
  subscribed_at: z.string().optional(),
}) satisfies z.ZodType<NewsletterSubscription>;

export type { NewsletterSubscription } from "../types/newsletter-subscription";
```

#### Examples

```typescript
// Source: hand-crafted
import type { NewsletterSubscription } from "../types/newsletter-subscription";

export const newsletterSubscriptionExamples = {
  full: {
    email: "jenny@example.com",
    name: "Jenny Rosen",
    source: "homepage-footer",
    subscribed_at: "2026-05-16T18:30:00Z",
  } satisfies NewsletterSubscription,
  minimal: { email: "lead@example.com" } satisfies NewsletterSubscription,
  fromBlogPost: {
    email: "reader@example.com",
    source: "blog/why-opentypes",
    subscribed_at: "2026-05-16T18:30:00Z",
  } satisfies NewsletterSubscription,
  withName: {
    email: "alex@example.com",
    name: "Alex Patel",
  } satisfies NewsletterSubscription,
} as const;
```

### OAuth2 Authorization Request

- Name: `oauth2-authorization-request`
- Categories: auth
- Description: OAuth 2.0 authorization request parameters with response type, client ID, and scope.
- Install (types only): `npx shadcn add @open-types/oauth2-authorization-request`
- Install (with Zod): `npx shadcn add @open-types/oauth2-authorization-request-zod`
- Install (with examples): `npx shadcn add @open-types/oauth2-authorization-request-examples`
- Detail page: https://open-types.dev/types/oauth2-authorization-request
- Markdown: https://open-types.dev/types/oauth2-authorization-request.md

#### Types

```typescript
export interface OAuth2AuthorizationRequest {
  response_type: string;
  client_id: string;
  redirect_uri?: string;
  scope?: string;
  state?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { OAuth2AuthorizationRequest } from "../types/oauth2-authorization-request";

export const oauth2AuthorizationRequestSchema = z.object({
  response_type: z.string(),
  client_id: z.string(),
  redirect_uri: z.string().optional(),
  scope: z.string().optional(),
  state: z.string().optional(),
}) satisfies z.ZodType<OAuth2AuthorizationRequest>;

export type { OAuth2AuthorizationRequest } from "../types/oauth2-authorization-request";
```

#### Examples

```typescript
// Source: https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.1
// Captured: 2026-05
import type { OAuth2AuthorizationRequest } from "../types/oauth2-authorization-request";

export const oauth2AuthorizationRequestExamples = {
  authCodeFlow: {
    response_type: "code",
    client_id: "client-1234567890abcdef",
    redirect_uri: "https://app.example.com/callback",
    scope: "openid email profile",
    state: "xyz-csrf-token-9876",
  } satisfies OAuth2AuthorizationRequest,
  implicitFlow: {
    response_type: "token",
    client_id: "client-1234567890abcdef",
    redirect_uri: "https://app.example.com/callback",
    scope: "read:profile",
    state: "abc-csrf-token-1234",
  } satisfies OAuth2AuthorizationRequest,
  minimalAuthCode: {
    response_type: "code",
    client_id: "client-1234567890abcdef",
  } satisfies OAuth2AuthorizationRequest,
  pkceFlow: {
    response_type: "code",
    client_id: "spa-client",
    redirect_uri: "https://app.example.com/callback",
    scope: "openid profile",
    state: "pkce-state-456",
  } satisfies OAuth2AuthorizationRequest,
} as const;
```

### OAuth2 Token Response

- Name: `oauth2-token-response`
- Categories: auth
- Description: OAuth 2.0 token endpoint response with access token, type, and optional refresh token.
- Install (types only): `npx shadcn add @open-types/oauth2-token-response`
- Install (with Zod): `npx shadcn add @open-types/oauth2-token-response-zod`
- Install (with examples): `npx shadcn add @open-types/oauth2-token-response-examples`
- Detail page: https://open-types.dev/types/oauth2-token-response
- Markdown: https://open-types.dev/types/oauth2-token-response.md

#### Types

```typescript
export interface OAuth2TokenResponse {
  access_token: string;
  token_type: string;
  expires_in?: number;
  refresh_token?: string;
  scope?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { OAuth2TokenResponse } from "../types/oauth2-token-response";

export const oauth2TokenResponseSchema = z.object({
  access_token: z.string(),
  token_type: z.string(),
  expires_in: z.number().int().optional(),
  refresh_token: z.string().optional(),
  scope: z.string().optional(),
}) satisfies z.ZodType<OAuth2TokenResponse>;

export type { OAuth2TokenResponse } from "../types/oauth2-token-response";
```

#### Examples

```typescript
// Source: https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
// Captured: 2026-05
import type { OAuth2TokenResponse } from "../types/oauth2-token-response";

export const oauth2TokenResponseExamples = {
  bearerFull: {
    access_token: "2YotnFZFEjr1zCsicMWpAA",
    token_type: "Bearer",
    expires_in: 3600,
    refresh_token: "tGzv3JOkF0XG5Qx2TlKWIA",
    scope: "read write profile",
  } satisfies OAuth2TokenResponse,
  bearerMinimal: {
    access_token: "abc123XYZ.def456UVW",
    token_type: "Bearer",
  } satisfies OAuth2TokenResponse,
  shortLived: {
    access_token: "short-lived-token-001",
    token_type: "Bearer",
    expires_in: 60,
  } satisfies OAuth2TokenResponse,
  noRefresh: {
    access_token: "client-credentials-token-xyz",
    token_type: "Bearer",
    expires_in: 3600,
    scope: "api:read",
  } satisfies OAuth2TokenResponse,
  mac: {
    access_token: "mac-style-token",
    token_type: "mac",
    expires_in: 7200,
  } satisfies OAuth2TokenResponse,
} as const;
```

### Open Graph

- Name: `open-graph`
- Categories: seo
- Description: Open Graph meta tags with title, type, images, and site metadata.
- Install (types only): `npx shadcn add @open-types/open-graph`
- Install (with Zod): `npx shadcn add @open-types/open-graph-zod`
- Install (with examples): `npx shadcn add @open-types/open-graph-examples`
- Detail page: https://open-types.dev/types/open-graph
- Markdown: https://open-types.dev/types/open-graph.md

#### Types

```typescript
export interface OpenGraphImage {
  url: string;
  width?: number;
  height?: number;
  alt?: string;
  type?: string;
}

export interface OpenGraphMeta {
  title: string;
  type?: string;
  url?: string;
  description?: string;
  site_name?: string;
  locale?: string;
  images?: OpenGraphImage[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { OpenGraphImage, OpenGraphMeta } from "../types/open-graph";

export const openGraphImageSchema = z.object({
  url: z.string(),
  width: z.number().optional(),
  height: z.number().optional(),
  alt: z.string().optional(),
  type: z.string().optional(),
}) satisfies z.ZodType<OpenGraphImage>;

export const openGraphMetaSchema = z.object({
  title: z.string(),
  type: z.string().optional(),
  url: z.string().optional(),
  description: z.string().optional(),
  site_name: z.string().optional(),
  locale: z.string().optional(),
  images: z.array(openGraphImageSchema).optional(),
}) satisfies z.ZodType<OpenGraphMeta>;

export type { OpenGraphImage, OpenGraphMeta } from "../types/open-graph";
```

#### Examples

```typescript
// Source: https://ogp.me/
// Captured: 2026-05
import type {
  OpenGraphImage,
  OpenGraphMeta,
} from "../types/open-graph";

const heroImage = {
  url: "https://open-types.dev/og-image.png",
  width: 1200,
  height: 630,
  alt: "OpenTypes hero image",
  type: "image/png",
} as const satisfies OpenGraphImage;

export const openGraphImageExamples = {
  hero: heroImage,
  minimal: { url: "https://open-types.dev/icon.png" } satisfies OpenGraphImage,
  squareAvatar: {
    url: "https://open-types.dev/avatar.jpg",
    width: 400,
    height: 400,
    type: "image/jpeg",
  } satisfies OpenGraphImage,
} as const;

export const openGraphMetaExamples = {
  article: {
    title: "Why we built OpenTypes",
    type: "article",
    url: "https://open-types.dev/blog/why",
    description: "A community-curated registry of TypeScript types for everyday data shapes.",
    site_name: "OpenTypes",
    locale: "en_US",
    images: [heroImage],
  } satisfies OpenGraphMeta,
  website: {
    title: "OpenTypes",
    type: "website",
    url: "https://open-types.dev",
    description: "Open-source TypeScript type registry.",
    site_name: "OpenTypes",
  } satisfies OpenGraphMeta,
  minimal: { title: "OpenTypes" } satisfies OpenGraphMeta,
  multiImage: {
    title: "Gallery",
    type: "article",
    url: "https://open-types.dev/gallery",
    images: [heroImage, openGraphImageExamples.squareAvatar],
  } satisfies OpenGraphMeta,
} as const;
```

### OpenAI Chat Completion

- Name: `openai-chat-completion`
- Categories: openai
- Description: OpenAI Chat Completion response with choices, messages, tool calls, and usage.
- Depends on: `@open-types/openai-shared`
- Install (types only): `npx shadcn add @open-types/openai-chat-completion`
- Install (with Zod): `npx shadcn add @open-types/openai-chat-completion-zod`
- Install (with examples): `npx shadcn add @open-types/openai-chat-completion-examples`
- Detail page: https://open-types.dev/types/openai-chat-completion
- Markdown: https://open-types.dev/types/openai-chat-completion.md

#### Types

```typescript
import type { OpenAIUsage } from "./openai-shared";

export type OpenAIChatMessageRole = "system" | "user" | "assistant" | "tool";

export interface OpenAIToolCallFunction {
  name: string;
  arguments: string;
}

export interface OpenAIToolCall {
  id: string;
  type: "function";
  function: OpenAIToolCallFunction;
}

export interface OpenAIChatMessage {
  role: OpenAIChatMessageRole;
  content: string | null;
  name?: string;
  tool_calls?: OpenAIToolCall[];
}

export type OpenAIFinishReason =
  | "stop"
  | "length"
  | "tool_calls"
  | "content_filter";

export interface OpenAIChatCompletionChoice {
  index: number;
  message: OpenAIChatMessage;
  finish_reason: OpenAIFinishReason | null;
}

export interface OpenAIChatCompletion {
  id: string;
  object: "chat.completion";
  created: number;
  model: string;
  choices: OpenAIChatCompletionChoice[];
  usage: OpenAIUsage;
  system_fingerprint: string | null;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  OpenAIChatMessageRole,
  OpenAIToolCallFunction,
  OpenAIToolCall,
  OpenAIChatMessage,
  OpenAIFinishReason,
  OpenAIChatCompletionChoice,
  OpenAIChatCompletion,
} from "../types/openai-chat-completion";
import { openAIUsageSchema } from "./openai-shared";

export const openAIChatMessageRoleSchema = z.enum([
  "system",
  "user",
  "assistant",
  "tool",
]) satisfies z.ZodType<OpenAIChatMessageRole>;

export const openAIToolCallFunctionSchema = z.object({
  name: z.string(),
  arguments: z.string(),
}) satisfies z.ZodType<OpenAIToolCallFunction>;

export const openAIToolCallSchema = z.object({
  id: z.string(),
  type: z.literal("function"),
  function: openAIToolCallFunctionSchema,
}) satisfies z.ZodType<OpenAIToolCall>;

export const openAIChatMessageSchema = z.object({
  role: openAIChatMessageRoleSchema,
  content: z.string().nullable(),
  name: z.string().optional(),
  tool_calls: z.array(openAIToolCallSchema).optional(),
}) satisfies z.ZodType<OpenAIChatMessage>;

export const openAIFinishReasonSchema = z.enum([
  "stop",
  "length",
  "tool_calls",
  "content_filter",
]) satisfies z.ZodType<OpenAIFinishReason>;

export const openAIChatCompletionChoiceSchema = z.object({
  index: z.number(),
  message: openAIChatMessageSchema,
  finish_reason: openAIFinishReasonSchema.nullable(),
}) satisfies z.ZodType<OpenAIChatCompletionChoice>;

export const openAIChatCompletionSchema = z.object({
  id: z.string(),
  object: z.literal("chat.completion"),
  created: z.number(),
  model: z.string(),
  choices: z.array(openAIChatCompletionChoiceSchema),
  usage: openAIUsageSchema,
  system_fingerprint: z.string().nullable(),
}) satisfies z.ZodType<OpenAIChatCompletion>;

export type {
  OpenAIChatMessageRole,
  OpenAIToolCallFunction,
  OpenAIToolCall,
  OpenAIChatMessage,
  OpenAIFinishReason,
  OpenAIChatCompletionChoice,
  OpenAIChatCompletion,
} from "../types/openai-chat-completion";
```

#### Examples

```typescript
// Source: https://platform.openai.com/docs/api-reference/chat/object
// Captured: 2026-05
import type {
  OpenAIChatMessageRole,
  OpenAIToolCallFunction,
  OpenAIToolCall,
  OpenAIChatMessage,
  OpenAIFinishReason,
  OpenAIChatCompletionChoice,
  OpenAIChatCompletion,
} from "../types/openai-chat-completion";

export const openAIChatMessageRoleExamples = {
  system: "system",
  user: "user",
  assistant: "assistant",
  tool: "tool",
} as const satisfies Record<string, OpenAIChatMessageRole>;

export const openAIFinishReasonExamples = {
  stop: "stop",
  length: "length",
  toolCalls: "tool_calls",
  contentFilter: "content_filter",
} as const satisfies Record<string, OpenAIFinishReason>;

const toolCallFunctionGetWeather = {
  name: "get_current_weather",
  arguments: '{"location":"San Francisco, CA","unit":"celsius"}',
} as const satisfies OpenAIToolCallFunction;

export const openAIToolCallFunctionExamples = {
  weather: toolCallFunctionGetWeather,
  emptyArgs: { name: "ping", arguments: "{}" } satisfies OpenAIToolCallFunction,
  complexArgs: {
    name: "create_event",
    arguments: '{"title":"Standup","start":"2026-05-16T10:00:00Z","attendees":["a@b.c","x@y.z"]}',
  } satisfies OpenAIToolCallFunction,
} as const;

const toolCallWeather = {
  id: "call_abc123",
  type: "function",
  function: toolCallFunctionGetWeather,
} as const satisfies OpenAIToolCall;

export const openAIToolCallExamples = {
  weather: toolCallWeather,
  ping: {
    id: "call_xyz789",
    type: "function",
    function: { name: "ping", arguments: "{}" },
  } satisfies OpenAIToolCall,
} as const;

const assistantMessage = {
  role: "assistant",
  content: "Hello! How can I help you today?",
} as const satisfies OpenAIChatMessage;

const toolCallingAssistantMessage = {
  role: "assistant",
  content: null,
  tool_calls: [toolCallWeather],
} as const satisfies OpenAIChatMessage;

export const openAIChatMessageExamples = {
  assistantText: assistantMessage,
  system: { role: "system", content: "You are a helpful assistant." } satisfies OpenAIChatMessage,
  user: { role: "user", content: "What is the weather in SF?" } satisfies OpenAIChatMessage,
  toolResult: {
    role: "tool",
    content: '{"temperature":18,"unit":"celsius"}',
    name: "get_current_weather",
  } satisfies OpenAIChatMessage,
  assistantToolCall: toolCallingAssistantMessage,
  assistantEmpty: { role: "assistant", content: null } satisfies OpenAIChatMessage,
} as const;

const choiceStop = {
  index: 0,
  message: assistantMessage,
  finish_reason: "stop",
} as const satisfies OpenAIChatCompletionChoice;

export const openAIChatCompletionChoiceExamples = {
  stop: choiceStop,
  length: { ...choiceStop, finish_reason: "length" } satisfies OpenAIChatCompletionChoice,
  contentFilter: { ...choiceStop, finish_reason: "content_filter" } satisfies OpenAIChatCompletionChoice,
  toolCalls: {
    index: 0,
    message: toolCallingAssistantMessage,
    finish_reason: "tool_calls",
  } satisfies OpenAIChatCompletionChoice,
  inProgress: { ...choiceStop, finish_reason: null } satisfies OpenAIChatCompletionChoice,
} as const;

const baseCompletion = {
  id: "chatcmpl-9ABCDe1F2gh3iJK4lmnOPq5rStU6V",
  object: "chat.completion",
  created: 1715865000,
  model: "gpt-4o-mini-2024-07-18",
  choices: [choiceStop],
  usage: { prompt_tokens: 9, completion_tokens: 12, total_tokens: 21 },
  system_fingerprint: "fp_44709d6fcb",
} as const satisfies OpenAIChatCompletion;

export const openAIChatCompletionExamples = {
  helloWorld: baseCompletion,
  toolCalling: {
    ...baseCompletion,
    id: "chatcmpl-9ABCDeToolCalling00000000000",
    choices: [openAIChatCompletionChoiceExamples.toolCalls],
    usage: { prompt_tokens: 82, completion_tokens: 24, total_tokens: 106 },
  } satisfies OpenAIChatCompletion,
  lengthCutoff: {
    ...baseCompletion,
    id: "chatcmpl-9ABCDeLengthCutoff0000000000",
    choices: [openAIChatCompletionChoiceExamples.length],
    usage: { prompt_tokens: 12, completion_tokens: 4096, total_tokens: 4108 },
  } satisfies OpenAIChatCompletion,
  contentFiltered: {
    ...baseCompletion,
    id: "chatcmpl-9ABCDeFiltered000000000000000",
    choices: [openAIChatCompletionChoiceExamples.contentFilter],
  } satisfies OpenAIChatCompletion,
  noFingerprint: {
    ...baseCompletion,
    id: "chatcmpl-9ABCDeNoFingerprint0000000000",
    system_fingerprint: null,
  } satisfies OpenAIChatCompletion,
  multiChoice: {
    ...baseCompletion,
    id: "chatcmpl-9ABCDeMultiChoice0000000000000",
    choices: [
      choiceStop,
      { ...choiceStop, index: 1, message: { role: "assistant", content: "Hi there!" } },
    ],
  } satisfies OpenAIChatCompletion,
} as const;
```

### OpenAI Chat Completion Chunk

- Name: `openai-chat-completion-chunk`
- Categories: openai
- Description: OpenAI Chat Completion streaming chunk with delta content and tool call fragments.
- Install (types only): `npx shadcn add @open-types/openai-chat-completion-chunk`
- Install (with Zod): `npx shadcn add @open-types/openai-chat-completion-chunk-zod`
- Install (with examples): `npx shadcn add @open-types/openai-chat-completion-chunk-examples`
- Detail page: https://open-types.dev/types/openai-chat-completion-chunk
- Markdown: https://open-types.dev/types/openai-chat-completion-chunk.md

#### Types

```typescript
export interface OpenAIToolCallChunkFunction {
  name?: string;
  arguments?: string;
}

export interface OpenAIToolCallChunk {
  index: number;
  id?: string;
  type?: "function";
  function?: OpenAIToolCallChunkFunction;
}

export interface OpenAIChatCompletionChunkDelta {
  role?: "system" | "user" | "assistant" | "tool";
  content?: string | null;
  tool_calls?: OpenAIToolCallChunk[];
}

export interface OpenAIChatCompletionChunkChoice {
  index: number;
  delta: OpenAIChatCompletionChunkDelta;
  finish_reason: string | null;
}

export interface OpenAIChatCompletionChunk {
  id: string;
  object: "chat.completion.chunk";
  created: number;
  model: string;
  choices: OpenAIChatCompletionChunkChoice[];
  system_fingerprint: string | null;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  OpenAIToolCallChunkFunction,
  OpenAIToolCallChunk,
  OpenAIChatCompletionChunkDelta,
  OpenAIChatCompletionChunkChoice,
  OpenAIChatCompletionChunk,
} from "../types/openai-chat-completion-chunk";

export const openAIToolCallChunkFunctionSchema = z.object({
  name: z.string().optional(),
  arguments: z.string().optional(),
}) satisfies z.ZodType<OpenAIToolCallChunkFunction>;

export const openAIToolCallChunkSchema = z.object({
  index: z.number(),
  id: z.string().optional(),
  type: z.literal("function").optional(),
  function: openAIToolCallChunkFunctionSchema.optional(),
}) satisfies z.ZodType<OpenAIToolCallChunk>;

export const openAIChatCompletionChunkDeltaSchema = z.object({
  role: z.enum(["system", "user", "assistant", "tool"]).optional(),
  content: z.string().nullable().optional(),
  tool_calls: z.array(openAIToolCallChunkSchema).optional(),
}) satisfies z.ZodType<OpenAIChatCompletionChunkDelta>;

export const openAIChatCompletionChunkChoiceSchema = z.object({
  index: z.number(),
  delta: openAIChatCompletionChunkDeltaSchema,
  finish_reason: z.string().nullable(),
}) satisfies z.ZodType<OpenAIChatCompletionChunkChoice>;

export const openAIChatCompletionChunkSchema = z.object({
  id: z.string(),
  object: z.literal("chat.completion.chunk"),
  created: z.number(),
  model: z.string(),
  choices: z.array(openAIChatCompletionChunkChoiceSchema),
  system_fingerprint: z.string().nullable(),
}) satisfies z.ZodType<OpenAIChatCompletionChunk>;

export type {
  OpenAIToolCallChunkFunction,
  OpenAIToolCallChunk,
  OpenAIChatCompletionChunkDelta,
  OpenAIChatCompletionChunkChoice,
  OpenAIChatCompletionChunk,
} from "../types/openai-chat-completion-chunk";
```

#### Examples

```typescript
// Source: https://platform.openai.com/docs/api-reference/chat-streaming/streaming
// Captured: 2026-05
import type {
  OpenAIToolCallChunkFunction,
  OpenAIToolCallChunk,
  OpenAIChatCompletionChunkDelta,
  OpenAIChatCompletionChunkChoice,
  OpenAIChatCompletionChunk,
} from "../types/openai-chat-completion-chunk";

export const openAIToolCallChunkFunctionExamples = {
  empty: {} satisfies OpenAIToolCallChunkFunction,
  nameOnly: { name: "get_current_weather" } satisfies OpenAIToolCallChunkFunction,
  argsFragment: { arguments: '{"location":' } satisfies OpenAIToolCallChunkFunction,
  full: {
    name: "get_current_weather",
    arguments: '{"location":"SF"}',
  } satisfies OpenAIToolCallChunkFunction,
} as const;

const toolCallStart = {
  index: 0,
  id: "call_abc123",
  type: "function",
  function: { name: "get_current_weather", arguments: "" },
} as const satisfies OpenAIToolCallChunk;

const toolCallContinuation = {
  index: 0,
  function: { arguments: '{"location":"San Francisco' },
} as const satisfies OpenAIToolCallChunk;

export const openAIToolCallChunkExamples = {
  start: toolCallStart,
  continuation: toolCallContinuation,
  indexOnly: { index: 1 } satisfies OpenAIToolCallChunk,
} as const;

export const openAIChatCompletionChunkDeltaExamples = {
  initialRole: { role: "assistant", content: "" } satisfies OpenAIChatCompletionChunkDelta,
  contentChunk: { content: "Hello" } satisfies OpenAIChatCompletionChunkDelta,
  emptyDelta: {} satisfies OpenAIChatCompletionChunkDelta,
  toolCallStart: {
    role: "assistant",
    content: null,
    tool_calls: [toolCallStart],
  } satisfies OpenAIChatCompletionChunkDelta,
  toolCallStream: { tool_calls: [toolCallContinuation] } satisfies OpenAIChatCompletionChunkDelta,
} as const;

const choiceStart = {
  index: 0,
  delta: { role: "assistant", content: "" },
  finish_reason: null,
} as const satisfies OpenAIChatCompletionChunkChoice;

const choiceFinish = {
  index: 0,
  delta: {},
  finish_reason: "stop",
} as const satisfies OpenAIChatCompletionChunkChoice;

export const openAIChatCompletionChunkChoiceExamples = {
  start: choiceStart,
  contentChunk: {
    index: 0,
    delta: { content: "Hello" },
    finish_reason: null,
  } satisfies OpenAIChatCompletionChunkChoice,
  finish: choiceFinish,
  toolCallsFinish: { ...choiceFinish, finish_reason: "tool_calls" } satisfies OpenAIChatCompletionChunkChoice,
} as const;

const baseChunk = {
  id: "chatcmpl-9ABCDe1F2gh3iJK4lmnOPq5rStU6V",
  object: "chat.completion.chunk",
  created: 1715865000,
  model: "gpt-4o-mini-2024-07-18",
  choices: [choiceStart],
  system_fingerprint: "fp_44709d6fcb",
} as const satisfies OpenAIChatCompletionChunk;

export const openAIChatCompletionChunkExamples = {
  start: baseChunk,
  contentChunk: {
    ...baseChunk,
    choices: [openAIChatCompletionChunkChoiceExamples.contentChunk],
  } satisfies OpenAIChatCompletionChunk,
  finish: { ...baseChunk, choices: [choiceFinish] } satisfies OpenAIChatCompletionChunk,
  toolCallsFinish: {
    ...baseChunk,
    choices: [openAIChatCompletionChunkChoiceExamples.toolCallsFinish],
  } satisfies OpenAIChatCompletionChunk,
  noFingerprint: {
    ...baseChunk,
    system_fingerprint: null,
  } satisfies OpenAIChatCompletionChunk,
} as const;
```

### OpenAI Embedding

- Name: `openai-embedding`
- Categories: openai
- Description: OpenAI Embedding response with vector data, model, and usage statistics.
- Install (types only): `npx shadcn add @open-types/openai-embedding`
- Install (with Zod): `npx shadcn add @open-types/openai-embedding-zod`
- Install (with examples): `npx shadcn add @open-types/openai-embedding-examples`
- Detail page: https://open-types.dev/types/openai-embedding
- Markdown: https://open-types.dev/types/openai-embedding.md

#### Types

```typescript
export interface OpenAIEmbeddingData {
  object: "embedding";
  embedding: number[];
  index: number;
}

export interface OpenAIEmbeddingUsage {
  prompt_tokens: number;
  total_tokens: number;
}

export interface OpenAIEmbeddingResponse {
  object: "list";
  data: OpenAIEmbeddingData[];
  model: string;
  usage: OpenAIEmbeddingUsage;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  OpenAIEmbeddingData,
  OpenAIEmbeddingUsage,
  OpenAIEmbeddingResponse,
} from "../types/openai-embedding";

export const openAIEmbeddingDataSchema = z.object({
  object: z.literal("embedding"),
  embedding: z.array(z.number()),
  index: z.number(),
}) satisfies z.ZodType<OpenAIEmbeddingData>;

export const openAIEmbeddingUsageSchema = z.object({
  prompt_tokens: z.number(),
  total_tokens: z.number(),
}) satisfies z.ZodType<OpenAIEmbeddingUsage>;

export const openAIEmbeddingResponseSchema = z.object({
  object: z.literal("list"),
  data: z.array(openAIEmbeddingDataSchema),
  model: z.string(),
  usage: openAIEmbeddingUsageSchema,
}) satisfies z.ZodType<OpenAIEmbeddingResponse>;

export type {
  OpenAIEmbeddingData,
  OpenAIEmbeddingUsage,
  OpenAIEmbeddingResponse,
} from "../types/openai-embedding";
```

#### Examples

```typescript
// Source: https://platform.openai.com/docs/api-reference/embeddings/object
// Captured: 2026-05
import type {
  OpenAIEmbeddingData,
  OpenAIEmbeddingUsage,
  OpenAIEmbeddingResponse,
} from "../types/openai-embedding";

const embeddingVector = [
  0.0023064255, -0.009327292, -0.0028842222, 0.013485645, 0.012367213,
  -0.014902353, 0.018745321, -0.0067324252, 0.027810302, 0.0091241245,
];

const dataItemFirst = {
  object: "embedding",
  embedding: embeddingVector,
  index: 0,
} as const satisfies OpenAIEmbeddingData;

const dataItemSecond = {
  object: "embedding",
  embedding: embeddingVector.map((v) => v * -1),
  index: 1,
} as const satisfies OpenAIEmbeddingData;

export const openAIEmbeddingDataExamples = {
  single: dataItemFirst,
  second: dataItemSecond,
  empty: { object: "embedding", embedding: [], index: 0 } satisfies OpenAIEmbeddingData,
} as const;

export const openAIEmbeddingUsageExamples = {
  small: { prompt_tokens: 8, total_tokens: 8 } satisfies OpenAIEmbeddingUsage,
  batch: { prompt_tokens: 142, total_tokens: 142 } satisfies OpenAIEmbeddingUsage,
} as const;

export const openAIEmbeddingResponseExamples = {
  single: {
    object: "list",
    data: [dataItemFirst],
    model: "text-embedding-3-small",
    usage: { prompt_tokens: 8, total_tokens: 8 },
  } satisfies OpenAIEmbeddingResponse,
  batch: {
    object: "list",
    data: [dataItemFirst, dataItemSecond],
    model: "text-embedding-3-large",
    usage: { prompt_tokens: 16, total_tokens: 16 },
  } satisfies OpenAIEmbeddingResponse,
  empty: {
    object: "list",
    data: [],
    model: "text-embedding-3-small",
    usage: { prompt_tokens: 0, total_tokens: 0 },
  } satisfies OpenAIEmbeddingResponse,
} as const;
```

### OpenAI Error

- Name: `openai-error`
- Categories: openai
- Description: OpenAI API error response with message, type, param, and code.
- Install (types only): `npx shadcn add @open-types/openai-error`
- Install (with Zod): `npx shadcn add @open-types/openai-error-zod`
- Install (with examples): `npx shadcn add @open-types/openai-error-examples`
- Detail page: https://open-types.dev/types/openai-error
- Markdown: https://open-types.dev/types/openai-error.md

#### Types

```typescript
export interface OpenAIErrorDetail {
  message: string;
  type: string;
  param: string | null;
  code: string | null;
}

export interface OpenAIErrorResponse {
  error: OpenAIErrorDetail;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { OpenAIErrorDetail, OpenAIErrorResponse } from "../types/openai-error";

export const openAIErrorDetailSchema = z.object({
  message: z.string(),
  type: z.string(),
  param: z.string().nullable(),
  code: z.string().nullable(),
}) satisfies z.ZodType<OpenAIErrorDetail>;

export const openAIErrorResponseSchema = z.object({
  error: openAIErrorDetailSchema,
}) satisfies z.ZodType<OpenAIErrorResponse>;

export type { OpenAIErrorDetail, OpenAIErrorResponse } from "../types/openai-error";
```

#### Examples

```typescript
// Source: https://platform.openai.com/docs/guides/error-codes/api-errors
// Captured: 2026-05
import type {
  OpenAIErrorDetail,
  OpenAIErrorResponse,
} from "../types/openai-error";

export const openAIErrorDetailExamples = {
  invalidApiKey: {
    message: "Incorrect API key provided: sk-***. You can find your API key at https://platform.openai.com/account/api-keys.",
    type: "invalid_request_error",
    param: null,
    code: "invalid_api_key",
  } satisfies OpenAIErrorDetail,
  rateLimit: {
    message: "Rate limit reached for requests",
    type: "requests",
    param: null,
    code: "rate_limit_exceeded",
  } satisfies OpenAIErrorDetail,
  contextLength: {
    message: "This model's maximum context length is 128000 tokens.",
    type: "invalid_request_error",
    param: "messages",
    code: "context_length_exceeded",
  } satisfies OpenAIErrorDetail,
  serverError: {
    message: "The server had an error while processing your request.",
    type: "server_error",
    param: null,
    code: null,
  } satisfies OpenAIErrorDetail,
} as const;

export const openAIErrorResponseExamples = {
  invalidApiKey: { error: openAIErrorDetailExamples.invalidApiKey } satisfies OpenAIErrorResponse,
  rateLimit: { error: openAIErrorDetailExamples.rateLimit } satisfies OpenAIErrorResponse,
  contextLength: { error: openAIErrorDetailExamples.contextLength } satisfies OpenAIErrorResponse,
  serverError: { error: openAIErrorDetailExamples.serverError } satisfies OpenAIErrorResponse,
} as const;
```

### OpenAI Model

- Name: `openai-model`
- Categories: openai
- Description: OpenAI Model metadata with ID, ownership, and creation timestamp.
- Install (types only): `npx shadcn add @open-types/openai-model`
- Install (with Zod): `npx shadcn add @open-types/openai-model-zod`
- Install (with examples): `npx shadcn add @open-types/openai-model-examples`
- Detail page: https://open-types.dev/types/openai-model
- Markdown: https://open-types.dev/types/openai-model.md

#### Types

```typescript
export interface OpenAIModel {
  id: string;
  object: "model";
  created: number;
  owned_by: string;
}

export interface OpenAIModelList {
  object: "list";
  data: OpenAIModel[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { OpenAIModel, OpenAIModelList } from "../types/openai-model";

export const openAIModelSchema = z.object({
  id: z.string(),
  object: z.literal("model"),
  created: z.number(),
  owned_by: z.string(),
}) satisfies z.ZodType<OpenAIModel>;

export const openAIModelListSchema = z.object({
  object: z.literal("list"),
  data: z.array(openAIModelSchema),
}) satisfies z.ZodType<OpenAIModelList>;

export type { OpenAIModel, OpenAIModelList } from "../types/openai-model";
```

#### Examples

```typescript
// Source: https://platform.openai.com/docs/api-reference/models/object
// Captured: 2026-05
import type { OpenAIModel, OpenAIModelList } from "../types/openai-model";

const gpt4o = {
  id: "gpt-4o",
  object: "model",
  created: 1715367049,
  owned_by: "system",
} as const satisfies OpenAIModel;

const gpt4oMini = {
  id: "gpt-4o-mini",
  object: "model",
  created: 1721172741,
  owned_by: "system",
} as const satisfies OpenAIModel;

const fineTuned = {
  id: "ft:gpt-4o-mini-2024-07-18:my-org::AbCdEfGh",
  object: "model",
  created: 1722400000,
  owned_by: "my-org",
} as const satisfies OpenAIModel;

export const openAIModelExamples = {
  gpt4o,
  gpt4oMini,
  fineTuned,
  embedding: {
    id: "text-embedding-3-small",
    object: "model",
    created: 1705948997,
    owned_by: "system",
  } satisfies OpenAIModel,
} as const;

export const openAIModelListExamples = {
  single: { object: "list", data: [gpt4o] } satisfies OpenAIModelList,
  multiple: {
    object: "list",
    data: [gpt4o, gpt4oMini, fineTuned],
  } satisfies OpenAIModelList,
  empty: { object: "list", data: [] } satisfies OpenAIModelList,
} as const;
```

### OpenAI Shared

- Name: `openai-shared`
- Categories: openai
- Description: Common OpenAI types: token usage tracking for prompt and completion.
- Install (types only): `npx shadcn add @open-types/openai-shared`
- Install (with Zod): `npx shadcn add @open-types/openai-shared-zod`
- Install (with examples): `npx shadcn add @open-types/openai-shared-examples`
- Detail page: https://open-types.dev/types/openai-shared
- Markdown: https://open-types.dev/types/openai-shared.md

#### Types

```typescript
export interface OpenAIUsage {
  prompt_tokens: number;
  completion_tokens: number;
  total_tokens: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { OpenAIUsage } from "../types/openai-shared";

export const openAIUsageSchema = z.object({
  prompt_tokens: z.number(),
  completion_tokens: z.number(),
  total_tokens: z.number(),
}) satisfies z.ZodType<OpenAIUsage>;

export type { OpenAIUsage } from "../types/openai-shared";
```

#### Examples

```typescript
// Source: https://platform.openai.com/docs/api-reference/chat/object
// Captured: 2026-05
import type { OpenAIUsage } from "../types/openai-shared";

export const openAIUsageExamples = {
  small: { prompt_tokens: 9, completion_tokens: 12, total_tokens: 21 } satisfies OpenAIUsage,
  conversation: {
    prompt_tokens: 482,
    completion_tokens: 304,
    total_tokens: 786,
  } satisfies OpenAIUsage,
  zero: { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 } satisfies OpenAIUsage,
} as const;
```

### Order

- Name: `order`
- Categories: ecommerce
- Description: E-commerce order with line items, shipping/billing addresses, status tracking, and totals.
- Depends on: `@open-types/address`, `@open-types/cart-item`
- Install (types only): `npx shadcn add @open-types/order`
- Install (with Zod): `npx shadcn add @open-types/order-zod`
- Install (with examples): `npx shadcn add @open-types/order-examples`
- Detail page: https://open-types.dev/types/order
- Markdown: https://open-types.dev/types/order.md

#### Types

```typescript
import type { Address } from "./address";
import type { CartItem } from "./cart-item";
import type { CurrencyCode } from "./product";

export type OrderStatus =
  | "pending"
  | "confirmed"
  | "processing"
  | "shipped"
  | "delivered"
  | "cancelled"
  | "refunded";

export interface Order {
  id: string;
  items: CartItem[];
  shippingAddress: Address;
  billingAddress?: Address;
  subtotal: number;
  tax: number;
  shippingCost?: number;
  discount?: number;
  total: number;
  currency?: CurrencyCode;
  status?: OrderStatus;
  notes?: string;
  createdAt: string;
  updatedAt: string;
}

export type OrderCreate = Omit<Order, "id" | "createdAt" | "updatedAt">;
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Order, OrderCreate, OrderStatus } from "../types/order";
import { addressSchema } from "./address";
import { cartItemSchema } from "./cart-item";
import { currencyCodeSchema } from "./product";

export const orderStatusSchema = z.enum([
  "pending",
  "confirmed",
  "processing",
  "shipped",
  "delivered",
  "cancelled",
  "refunded",
]);

export const orderSchema = z.object({
  id: z.uuid({ error: "Invalid order ID" }),
  items: z
    .array(cartItemSchema)
    .min(1, { error: "Order must have at least one item" }),
  shippingAddress: addressSchema,
  billingAddress: addressSchema.optional(),
  subtotal: z
    .number()
    .min(0, { error: "Subtotal cannot be negative" })
    .multipleOf(0.01),
  tax: z
    .number()
    .min(0, { error: "Tax cannot be negative" })
    .multipleOf(0.01),
  shippingCost: z
    .number()
    .min(0, { error: "Shipping cost cannot be negative" })
    .multipleOf(0.01)
    .default(0),
  discount: z
    .number()
    .min(0, { error: "Discount cannot be negative" })
    .multipleOf(0.01)
    .default(0),
  total: z
    .number()
    .min(0, { error: "Total cannot be negative" })
    .multipleOf(0.01),
  currency: currencyCodeSchema,
  status: orderStatusSchema.default("pending"),
  notes: z.string().max(1000, { error: "Notes must be at most 1000 characters" }).optional(),
  createdAt: z.iso.datetime({ error: "Invalid datetime" }),
  updatedAt: z.iso.datetime({ error: "Invalid datetime" }),
}) satisfies z.ZodType<Order>;

export const orderCreateSchema = orderSchema.omit({
  id: true,
  createdAt: true,
  updatedAt: true,
});

export type { Order, OrderCreate, OrderStatus } from "../types/order";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  OrderStatus,
  Order,
  OrderCreate,
} from "../types/order";
import { cartItemExamples } from "./cart-item.examples";
import { addressExamples } from "./address.examples";

export const orderStatusExamples = {
  pending: "pending",
  confirmed: "confirmed",
  processing: "processing",
  shipped: "shipped",
  delivered: "delivered",
  cancelled: "cancelled",
  refunded: "refunded",
} as const satisfies Record<string, OrderStatus>;

const placed = {
  id: "aaaaaaaa-1111-4111-8111-111111111111",
  items: [cartItemExamples.basic, cartItemExamples.withVariant],
  shippingAddress: addressExamples.minimal,
  billingAddress: addressExamples.full,
  subtotal: 131.98,
  tax: 11.55,
  shippingCost: 5.99,
  discount: 0,
  total: 149.52,
  currency: "USD",
  status: "confirmed",
  notes: "Ring doorbell on arrival.",
  createdAt: "2026-05-16T18:30:00.000Z",
  updatedAt: "2026-05-16T18:32:15.000Z",
} as const satisfies Order;

export const orderExamples = {
  placed,
  shipped: {
    ...placed,
    id: "bbbbbbbb-2222-4222-8222-222222222222",
    status: "shipped",
    updatedAt: "2026-05-17T10:00:00.000Z",
  } satisfies Order,
  delivered: {
    ...placed,
    id: "cccccccc-3333-4333-8333-333333333333",
    status: "delivered",
    updatedAt: "2026-05-19T16:42:00.000Z",
  } satisfies Order,
  cancelled: {
    ...placed,
    id: "dddddddd-4444-4444-8444-444444444444",
    status: "cancelled",
    updatedAt: "2026-05-16T18:45:00.000Z",
  } satisfies Order,
  refunded: {
    ...placed,
    id: "eeeeeeee-5555-4555-8555-555555555555",
    status: "refunded",
    updatedAt: "2026-05-20T09:00:00.000Z",
  } satisfies Order,
  minimal: {
    id: "ffffffff-6666-4666-8666-666666666666",
    items: [cartItemExamples.basic],
    shippingAddress: addressExamples.minimal,
    subtotal: 59.98,
    tax: 5.25,
    total: 65.23,
    createdAt: "2026-05-16T18:30:00.000Z",
    updatedAt: "2026-05-16T18:30:00.000Z",
  } satisfies Order,
  digitalOnly: {
    ...placed,
    id: "99999999-7777-4777-8777-777777777777",
    items: [cartItemExamples.digital],
    subtotal: 19.99,
    tax: 1.75,
    shippingCost: 0,
    total: 21.74,
    notes: undefined,
  } satisfies Order,
} as const;

export const orderCreateExamples = {
  basic: {
    items: [cartItemExamples.basic],
    shippingAddress: addressExamples.minimal,
    subtotal: 59.98,
    tax: 5.25,
    total: 65.23,
    status: "pending",
  } satisfies OrderCreate,
} as const;
```

### Pagination

- Name: `pagination`
- Categories: api
- Description: Pagination request parameters and paginated response metadata.
- Install (types only): `npx shadcn add @open-types/pagination`
- Install (with Zod): `npx shadcn add @open-types/pagination-zod`
- Install (with examples): `npx shadcn add @open-types/pagination-examples`
- Detail page: https://open-types.dev/types/pagination
- Markdown: https://open-types.dev/types/pagination.md

#### Types

```typescript
export type SortOrder = "asc" | "desc";

export interface Pagination {
  page?: number;
  pageSize?: number;
  sortBy?: string;
  sortOrder?: SortOrder;
}

export interface PaginationResponse {
  totalItems: number;
  totalPages: number;
  currentPage: number;
  pageSize: number;
  hasNextPage: boolean;
  hasPreviousPage: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Pagination, PaginationResponse, SortOrder } from "../types/pagination";

export const paginationSchema = z.object({
  page: z.number().int().min(1, { error: "Page must be at least 1" }).default(1),
  pageSize: z
    .number()
    .int()
    .min(1, { error: "Page size must be at least 1" })
    .max(100, { error: "Page size must be at most 100" })
    .default(20),
  sortBy: z.string().optional(),
  sortOrder: z.enum(["asc", "desc"]).default("asc").optional(),
}) satisfies z.ZodType<Pagination>;

export const paginationResponseSchema = z.object({
  totalItems: z.number().int().min(0),
  totalPages: z.number().int().min(0),
  currentPage: z.number().int().min(1),
  pageSize: z.number().int().min(1),
  hasNextPage: z.boolean(),
  hasPreviousPage: z.boolean(),
}) satisfies z.ZodType<PaginationResponse>;

export type { Pagination, PaginationResponse, SortOrder } from "../types/pagination";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  SortOrder,
  Pagination,
  PaginationResponse,
} from "../types/pagination";

// SortOrder has no exported schema; values appear as a string union inside paginationSchema.
// Kept as a typed helper rather than a `*Examples` const so the fixture guard doesn't look
// for a non-existent sortOrderSchema.
export const sortOrderValues: readonly SortOrder[] = ["asc", "desc"];

export const paginationExamples = {
  empty: {} satisfies Pagination,
  firstPage: { page: 1, pageSize: 20 } satisfies Pagination,
  sorted: { page: 2, pageSize: 50, sortBy: "created_at", sortOrder: "desc" } satisfies Pagination,
  sortedAsc: { page: 1, pageSize: 100, sortBy: "name", sortOrder: "asc" } satisfies Pagination,
  maxPageSize: { page: 1, pageSize: 100 } satisfies Pagination,
} as const;

export const paginationResponseExamples = {
  middlePage: {
    totalItems: 482,
    totalPages: 25,
    currentPage: 5,
    pageSize: 20,
    hasNextPage: true,
    hasPreviousPage: true,
  } satisfies PaginationResponse,
  firstPage: {
    totalItems: 482,
    totalPages: 25,
    currentPage: 1,
    pageSize: 20,
    hasNextPage: true,
    hasPreviousPage: false,
  } satisfies PaginationResponse,
  lastPage: {
    totalItems: 482,
    totalPages: 25,
    currentPage: 25,
    pageSize: 20,
    hasNextPage: false,
    hasPreviousPage: true,
  } satisfies PaginationResponse,
  empty: {
    totalItems: 0,
    totalPages: 0,
    currentPage: 1,
    pageSize: 20,
    hasNextPage: false,
    hasPreviousPage: false,
  } satisfies PaginationResponse,
} as const;
```

### Payment Method

- Name: `payment-method`
- Categories: ecommerce
- Description: Payment method with card details, type, and billing address.
- Depends on: `@open-types/address`
- Install (types only): `npx shadcn add @open-types/payment-method`
- Install (with Zod): `npx shadcn add @open-types/payment-method-zod`
- Install (with examples): `npx shadcn add @open-types/payment-method-examples`
- Detail page: https://open-types.dev/types/payment-method
- Markdown: https://open-types.dev/types/payment-method.md

#### Types

```typescript
import type { Address } from "./address";

export interface PaymentCard {
  brand: string;
  last4: string;
  exp_month: number;
  exp_year: number;
}

export type PaymentMethodType = "card" | "bank_account" | "paypal";

export interface PaymentMethodBillingDetails {
  name?: string;
  email?: string;
  phone?: string;
  address?: Address;
}

export interface PaymentMethod {
  id: string;
  type: PaymentMethodType;
  card?: PaymentCard;
  billing_details?: PaymentMethodBillingDetails;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  PaymentCard,
  PaymentMethod,
  PaymentMethodBillingDetails,
  PaymentMethodType,
} from "../types/payment-method";
import { addressSchema } from "./address";

export const paymentMethodTypeSchema = z.enum(["card", "bank_account", "paypal"]) satisfies z.ZodType<PaymentMethodType>;

export const paymentCardSchema = z.object({
  brand: z.string().min(1, { error: "Card brand is required" }),
  last4: z.string().regex(/^\d{4}$/, { error: "Last 4 digits must be exactly 4 numbers" }),
  exp_month: z.number().int({ error: "Expiration month must be a whole number" }).min(1, {
    error: "Expiration month must be between 1 and 12",
  }).max(12, { error: "Expiration month must be between 1 and 12" }),
  exp_year: z.number().int({ error: "Expiration year must be a whole number" }).min(2020, {
    error: "Expiration year must be 2020 or later",
  }),
}) satisfies z.ZodType<PaymentCard>;

export const paymentMethodBillingDetailsSchema = z.object({
  name: z.string().optional(),
  email: z.string().email({ error: "Billing email must be a valid email address" }).optional(),
  phone: z.string().optional(),
  address: addressSchema.optional(),
}) satisfies z.ZodType<PaymentMethodBillingDetails>;

export const paymentMethodSchema = z.object({
  id: z.string().min(1, { error: "Payment method ID is required" }),
  type: paymentMethodTypeSchema,
  card: paymentCardSchema.optional(),
  billing_details: paymentMethodBillingDetailsSchema.optional(),
}) satisfies z.ZodType<PaymentMethod>;

export type {
  PaymentCard,
  PaymentMethod,
  PaymentMethodBillingDetails,
  PaymentMethodType,
} from "../types/payment-method";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  PaymentCard,
  PaymentMethodType,
  PaymentMethodBillingDetails,
  PaymentMethod,
} from "../types/payment-method";
import { addressExamples } from "./address.examples";

export const paymentMethodTypeExamples = {
  card: "card",
  bankAccount: "bank_account",
  paypal: "paypal",
} as const satisfies Record<string, PaymentMethodType>;

const visaCard = {
  brand: "visa",
  last4: "4242",
  exp_month: 12,
  exp_year: 2028,
} as const satisfies PaymentCard;

export const paymentCardExamples = {
  visa: visaCard,
  mastercard: {
    brand: "mastercard",
    last4: "5454",
    exp_month: 3,
    exp_year: 2027,
  } satisfies PaymentCard,
  amex: {
    brand: "amex",
    last4: "8431",
    exp_month: 6,
    exp_year: 2026,
  } satisfies PaymentCard,
} as const;

const fullBilling = {
  name: "Jenny Rosen",
  email: "jenny@example.com",
  phone: "+14155551234",
  address: addressExamples.minimal,
} as const satisfies PaymentMethodBillingDetails;

export const paymentMethodBillingDetailsExamples = {
  full: fullBilling,
  nameOnly: { name: "Jenny Rosen" } satisfies PaymentMethodBillingDetails,
  empty: {} satisfies PaymentMethodBillingDetails,
} as const;

const cardMethod = {
  id: "pm_01HABCDEF0123456789ABCDE",
  type: "card",
  card: visaCard,
  billing_details: fullBilling,
} as const satisfies PaymentMethod;

export const paymentMethodExamples = {
  cardFull: cardMethod,
  cardMinimal: {
    id: "pm_min_001",
    type: "card",
    card: visaCard,
  } satisfies PaymentMethod,
  bankAccount: {
    id: "pm_bank_002",
    type: "bank_account",
    billing_details: { name: "Acme Corp", email: "billing@acme.example" },
  } satisfies PaymentMethod,
  paypal: {
    id: "pm_paypal_003",
    type: "paypal",
    billing_details: { email: "jenny@example.com" },
  } satisfies PaymentMethod,
} as const;
```

### Problem Details

- Name: `problem-details`
- Categories: api
- Description: RFC 7807 Problem Details for HTTP APIs with type, title, status, and detail.
- Install (types only): `npx shadcn add @open-types/problem-details`
- Install (with Zod): `npx shadcn add @open-types/problem-details-zod`
- Install (with examples): `npx shadcn add @open-types/problem-details-examples`
- Detail page: https://open-types.dev/types/problem-details
- Markdown: https://open-types.dev/types/problem-details.md

#### Types

```typescript
export interface ProblemDetails {
  type?: string;
  title?: string;
  status?: number;
  detail?: string;
  instance?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { ProblemDetails } from "../types/problem-details";

export const problemDetailsSchema = z
  .object({
    type: z.string().optional(),
    title: z.string().optional(),
    status: z
      .number()
      .int()
      .min(100, { error: "Status must be a valid HTTP status code" })
      .max(599, { error: "Status must be a valid HTTP status code" })
      .optional(),
    detail: z.string().optional(),
    instance: z.string().optional(),
  })
  .passthrough() satisfies z.ZodType<ProblemDetails>;

export type { ProblemDetails } from "../types/problem-details";
```

#### Examples

```typescript
// Source: https://datatracker.ietf.org/doc/html/rfc9457
// Captured: 2026-05
import type { ProblemDetails } from "../types/problem-details";

export const problemDetailsExamples = {
  validation: {
    type: "https://example.com/problems/validation",
    title: "Your request parameters didn't validate.",
    status: 422,
    detail: "Field 'email' is required.",
    instance: "/orders/12345",
  } satisfies ProblemDetails,
  unauthorized: {
    type: "https://example.com/problems/unauthorized",
    title: "Unauthorized",
    status: 401,
    detail: "Missing or invalid bearer token.",
  } satisfies ProblemDetails,
  notFound: {
    type: "about:blank",
    title: "Not Found",
    status: 404,
    instance: "/customers/cus_doesnotexist",
  } satisfies ProblemDetails,
  serverError: {
    title: "Internal Server Error",
    status: 500,
  } satisfies ProblemDetails,
  minimal: { title: "Bad Request" } satisfies ProblemDetails,
} as const;
```

### Product

- Name: `product`
- Categories: ecommerce
- Description: E-commerce product with pricing, inventory, dimensions, and create/update variants.
- Install (types only): `npx shadcn add @open-types/product`
- Install (with Zod): `npx shadcn add @open-types/product-zod`
- Install (with examples): `npx shadcn add @open-types/product-examples`
- Detail page: https://open-types.dev/types/product
- Markdown: https://open-types.dev/types/product.md

#### Types

```typescript
export type CurrencyCode = string;

export type DimensionsUnit = "cm" | "in" | "m" | "ft";

export interface Dimensions {
  length: number;
  width: number;
  height: number;
  unit?: DimensionsUnit;
}

export interface Product {
  id: string;
  name: string;
  description?: string;
  price: number;
  compareAtPrice?: number;
  currency?: CurrencyCode;
  sku: string;
  stock: number;
  categories?: string[];
  tags?: string[];
  isActive?: boolean;
  weight?: number;
  dimensions?: Dimensions;
}

export type ProductCreate = Omit<Product, "id">;

export type ProductUpdate = Partial<ProductCreate>;
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  CurrencyCode,
  Dimensions,
  Product,
  ProductCreate,
  ProductUpdate,
} from "../types/product";

const ISO_CURRENCY_REGEX = /^[A-Z]{3}$/;

export const currencyCodeSchema = z
  .string()
  .regex(ISO_CURRENCY_REGEX, { error: "Currency must be a 3-letter ISO code (e.g. USD)" })
  .default("USD");

export const dimensionsSchema = z.object({
  length: z.number().positive({ error: "Length must be positive" }),
  width: z.number().positive({ error: "Width must be positive" }),
  height: z.number().positive({ error: "Height must be positive" }),
  unit: z.enum(["cm", "in", "m", "ft"]).default("cm"),
}) satisfies z.ZodType<Dimensions>;

export const productSchema = z.object({
  id: z.uuid({ error: "Invalid product ID" }),
  name: z.string().min(1, { error: "Product name is required" }),
  description: z.string().optional(),
  price: z
    .number()
    .positive({ error: "Price must be positive" })
    .multipleOf(0.01, { error: "Price must have at most 2 decimal places" }),
  compareAtPrice: z
    .number()
    .positive({ error: "Compare-at price must be positive" })
    .multipleOf(0.01)
    .optional(),
  currency: currencyCodeSchema,
  sku: z.string().min(1, { error: "SKU is required" }),
  stock: z
    .number()
    .int({ error: "Stock must be a whole number" })
    .min(0, { error: "Stock cannot be negative" }),
  categories: z.array(z.string()).default([]),
  tags: z.array(z.string()).default([]),
  isActive: z.boolean().default(true),
  weight: z.number().positive({ error: "Weight must be positive" }).optional(),
  dimensions: dimensionsSchema.optional(),
}) satisfies z.ZodType<Product>;

export const productCreateSchema = productSchema.omit({ id: true });

export const productUpdateSchema = productSchema.omit({ id: true }).partial();

export type {
  CurrencyCode,
  DimensionsUnit,
  Dimensions,
  Product,
  ProductCreate,
  ProductUpdate,
} from "../types/product";
```

#### Examples

```typescript
// Source: hand-crafted
import type {
  CurrencyCode,
  DimensionsUnit,
  Dimensions,
  Product,
  ProductCreate,
  ProductUpdate,
} from "../types/product";

export const currencyCodeExamples = {
  usd: "USD",
  eur: "EUR",
  jpy: "JPY",
  gbp: "GBP",
} as const satisfies Record<string, CurrencyCode>;

export const dimensionsExamples = {
  cm: { length: 30, width: 20, height: 5, unit: "cm" } satisfies Dimensions,
  inches: { length: 12, width: 8, height: 2, unit: "in" } satisfies Dimensions,
  noUnit: { length: 1, width: 1, height: 1 } satisfies Dimensions,
  metric: { length: 1, width: 0.5, height: 0.3, unit: "m" } satisfies Dimensions,
} as const;

const widget = {
  id: "11111111-2222-4333-8444-555555555551",
  name: "Premium Widget",
  description: "A high-quality widget engineered for daily use.",
  price: 29.99,
  compareAtPrice: 39.99,
  currency: "USD",
  sku: "WIDGET-PREMIUM-001",
  stock: 142,
  categories: ["widgets", "premium"],
  tags: ["new", "featured", "best-seller"],
  isActive: true,
  weight: 0.5,
  dimensions: dimensionsExamples.cm,
} as const satisfies Product;

export const productExamples = {
  full: widget,
  minimal: {
    id: "22222222-2222-4333-8444-555555555552",
    name: "Basic Item",
    price: 9.99,
    sku: "ITEM-BASIC-002",
    stock: 0,
  } satisfies Product,
  outOfStock: { ...widget, id: "33333333-3333-4333-8444-555555555553", stock: 0, isActive: false } satisfies Product,
  digital: {
    id: "44444444-4444-4333-8444-555555555554",
    name: "E-Book Bundle",
    price: 19.99,
    currency: "USD",
    sku: "EBOOK-BUNDLE-001",
    stock: 9999,
    tags: ["digital", "download"],
    isActive: true,
  } satisfies Product,
} as const;

export const dimensionUnitValues: readonly DimensionsUnit[] = ["cm", "in", "m", "ft"];

export const productCreateExamples = {
  newWidget: {
    name: "New Widget",
    price: 24.99,
    currency: "USD",
    sku: "WIDGET-NEW-001",
    stock: 100,
    isActive: true,
  } satisfies ProductCreate,
} as const;

export const productUpdateExamples = {
  priceOnly: { price: 24.99 } satisfies ProductUpdate,
  restock: { stock: 200, isActive: true } satisfies ProductUpdate,
  empty: {} satisfies ProductUpdate,
} as const;
```

### Push Notification

- Name: `push-notification`
- Categories: notification
- Description: Web/mobile push notification with title, body, actions, and data payload.
- Install (types only): `npx shadcn add @open-types/push-notification`
- Install (with Zod): `npx shadcn add @open-types/push-notification-zod`
- Install (with examples): `npx shadcn add @open-types/push-notification-examples`
- Detail page: https://open-types.dev/types/push-notification
- Markdown: https://open-types.dev/types/push-notification.md

#### Types

```typescript
export interface PushNotificationAction {
  action: string;
  title: string;
  icon?: string;
}

export interface PushNotification {
  title: string;
  body?: string;
  icon?: string;
  badge?: string;
  image?: string;
  tag?: string;
  data?: Record<string, unknown>;
  actions?: PushNotificationAction[];
  url?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  PushNotification,
  PushNotificationAction,
} from "../types/push-notification";

export const pushNotificationActionSchema = z.object({
  action: z.string().min(1, { error: "Action is required" }),
  title: z.string().min(1, { error: "Action title is required" }),
  icon: z.url({ error: "Action icon must be a valid URL" }).optional(),
}) satisfies z.ZodType<PushNotificationAction>;

export const pushNotificationSchema = z.object({
  title: z.string().min(1, { error: "Title is required" }),
  body: z.string().optional(),
  icon: z.url({ error: "Icon must be a valid URL" }).optional(),
  badge: z.url({ error: "Badge must be a valid URL" }).optional(),
  image: z.url({ error: "Image must be a valid URL" }).optional(),
  tag: z.string().optional(),
  data: z.record(z.string(), z.unknown()).optional(),
  actions: z.array(pushNotificationActionSchema).optional(),
  url: z.url({ error: "URL must be a valid URL" }).optional(),
}) satisfies z.ZodType<PushNotification>;

export type {
  PushNotification,
  PushNotificationAction,
} from "../types/push-notification";
```

#### Examples

```typescript
// Source: https://developer.mozilla.org/en-US/docs/Web/API/Notification
// Captured: 2026-05
import type {
  PushNotificationAction,
  PushNotification,
} from "../types/push-notification";

const replyAction = {
  action: "reply",
  title: "Reply",
  icon: "https://cdn.example.com/icons/reply.png",
} as const satisfies PushNotificationAction;

const dismissAction = {
  action: "dismiss",
  title: "Dismiss",
} as const satisfies PushNotificationAction;

export const pushNotificationActionExamples = {
  reply: replyAction,
  dismiss: dismissAction,
  view: {
    action: "view",
    title: "View",
    icon: "https://cdn.example.com/icons/view.png",
  } satisfies PushNotificationAction,
} as const;

const message = {
  title: "New message from Jenny",
  body: "Hey, can you take a look at the PR when you get a chance?",
  icon: "https://cdn.example.com/icons/message.png",
  badge: "https://cdn.example.com/icons/badge.png",
  image: "https://cdn.example.com/images/preview.png",
  tag: "message-thread-123",
  data: { thread_id: "thread_123", sender_id: "user_321" },
  actions: [replyAction, dismissAction],
  url: "https://app.example.com/threads/thread_123",
} as const satisfies PushNotification;

export const pushNotificationExamples = {
  message,
  alertOnly: {
    title: "Production alert",
    body: "Service X is degraded.",
    tag: "ops-alert",
    url: "https://status.example.com",
  } satisfies PushNotification,
  silentDataMessage: {
    title: "Sync",
    data: { sync_id: "sync_001" },
  } satisfies PushNotification,
  minimal: { title: "Hello" } satisfies PushNotification,
  promotional: {
    title: "20% off this week",
    body: "Limited-time sale on all widgets.",
    image: "https://cdn.example.com/images/sale-banner.png",
    url: "https://shop.example.com/sale",
  } satisfies PushNotification,
} as const;
```

### Rate Limit Headers

- Name: `rate-limit-headers`
- Categories: api
- Description: API rate limit headers with limit, remaining, reset, and retry-after.
- Install (types only): `npx shadcn add @open-types/rate-limit-headers`
- Install (with Zod): `npx shadcn add @open-types/rate-limit-headers-zod`
- Install (with examples): `npx shadcn add @open-types/rate-limit-headers-examples`
- Detail page: https://open-types.dev/types/rate-limit-headers
- Markdown: https://open-types.dev/types/rate-limit-headers.md

#### Types

```typescript
export interface RateLimitHeaders {
  limit: number;
  remaining: number;
  reset: number;
  retry_after?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { RateLimitHeaders } from "../types/rate-limit-headers";

export const rateLimitHeadersSchema = z.object({
  limit: z.number().int().min(0, { error: "Limit must be greater than or equal to 0" }),
  remaining: z
    .number()
    .int()
    .min(0, { error: "Remaining must be greater than or equal to 0" }),
  reset: z.number().int().gt(0, { error: "Reset must be greater than 0" }),
  retry_after: z.number().int().min(0).optional(),
}) satisfies z.ZodType<RateLimitHeaders>;

export type { RateLimitHeaders } from "../types/rate-limit-headers";
```

#### Examples

```typescript
// Source: https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-ratelimit-headers
// Captured: 2026-05
import type { RateLimitHeaders } from "../types/rate-limit-headers";

export const rateLimitHeadersExamples = {
  underLimit: {
    limit: 100,
    remaining: 42,
    reset: 1712948460,
  } satisfies RateLimitHeaders,
  exhausted: {
    limit: 100,
    remaining: 0,
    reset: 1712948460,
    retry_after: 60,
  } satisfies RateLimitHeaders,
  burstQuota: {
    limit: 1000,
    remaining: 999,
    reset: 1712948700,
  } satisfies RateLimitHeaders,
  oneRemaining: {
    limit: 60,
    remaining: 1,
    reset: 1712948460,
  } satisfies RateLimitHeaders,
} as const;
```

### reCAPTCHA Response

- Name: `recaptcha-response`
- Categories: google
- Description: Google reCAPTCHA verification response with score, action, and error codes.
- Install (types only): `npx shadcn add @open-types/recaptcha-response`
- Install (with Zod): `npx shadcn add @open-types/recaptcha-response-zod`
- Install (with examples): `npx shadcn add @open-types/recaptcha-response-examples`
- Detail page: https://open-types.dev/types/recaptcha-response
- Markdown: https://open-types.dev/types/recaptcha-response.md

#### Types

```typescript
export interface ReCAPTCHAResponse {
  success: boolean;
  challenge_ts?: string;
  hostname?: string;
  score?: number;
  action?: string;
  error_codes?: string[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { ReCAPTCHAResponse } from "../types/recaptcha-response";

export const recaptchaResponseSchema = z.object({
  success: z.boolean(),
  challenge_ts: z.string().optional(),
  hostname: z.string().optional(),
  score: z.number().min(0, { error: "Score must be at least 0" }).max(1, {
    error: "Score must be at most 1",
  }).optional(),
  action: z.string().optional(),
  error_codes: z.array(z.string().min(1, { error: "Error code cannot be empty" })).optional(),
}) satisfies z.ZodType<ReCAPTCHAResponse>;

export type { ReCAPTCHAResponse } from "../types/recaptcha-response";
```

#### Examples

```typescript
// Source: https://developers.google.com/recaptcha/docs/verify
// Captured: 2026-05
import type { ReCAPTCHAResponse } from "../types/recaptcha-response";

export const recaptchaResponseExamples = {
  v2Success: {
    success: true,
    challenge_ts: "2026-04-13T18:30:00Z",
    hostname: "open-types.dev",
  } satisfies ReCAPTCHAResponse,
  v3HighScore: {
    success: true,
    challenge_ts: "2026-04-13T18:30:00Z",
    hostname: "open-types.dev",
    score: 0.9,
    action: "submit_contact",
  } satisfies ReCAPTCHAResponse,
  v3LowScore: {
    success: true,
    challenge_ts: "2026-04-13T18:30:00Z",
    hostname: "open-types.dev",
    score: 0.1,
    action: "submit_contact",
  } satisfies ReCAPTCHAResponse,
  failureInvalidToken: {
    success: false,
    error_codes: ["invalid-input-response"],
  } satisfies ReCAPTCHAResponse,
  failureMissingSecret: {
    success: false,
    error_codes: ["missing-input-secret", "missing-input-response"],
  } satisfies ReCAPTCHAResponse,
  failureTimeoutOrDuplicate: {
    success: false,
    error_codes: ["timeout-or-duplicate"],
  } satisfies ReCAPTCHAResponse,
} as const;
```

### Register

- Name: `register`
- Categories: auth
- Description: User registration with strong password policy and confirmation matching.
- Install (types only): `npx shadcn add @open-types/register`
- Install (with Zod): `npx shadcn add @open-types/register-zod`
- Install (with examples): `npx shadcn add @open-types/register-examples`
- Detail page: https://open-types.dev/types/register
- Markdown: https://open-types.dev/types/register.md

#### Types

```typescript
export interface Register {
  email: string;
  password: string;
  confirmPassword: string;
  name: string;
  tosAccepted: true;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Register } from "../types/register";

const STRONG_PASSWORD_REGEX =
  /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,128}$/;

export const registerSchema = z
  .object({
    email: z.email({ error: "Invalid email address" }),
    password: z
      .string()
      .min(8, { error: "Password must be at least 8 characters" })
      .max(128, { error: "Password must be at most 128 characters" })
      .regex(STRONG_PASSWORD_REGEX, {
        error:
          "Password must contain at least one uppercase letter, one lowercase letter, one digit, and one special character",
      }),
    confirmPassword: z.string(),
    name: z.string().min(1, { error: "Name is required" }),
    tosAccepted: z.literal(true, {
      error: "You must accept the Terms of Service",
    }),
  })
  .refine((data) => data.password === data.confirmPassword, {
    error: "Passwords do not match",
    path: ["confirmPassword"],
  }) satisfies z.ZodType<Register>;

export type { Register } from "../types/register";
```

#### Examples

```typescript
// Source: hand-crafted
import type { Register } from "../types/register";

export const registerExamples = {
  jenny: {
    email: "jenny@example.com",
    password: "Str0ng!Pass-word",
    confirmPassword: "Str0ng!Pass-word",
    name: "Jenny Rosen",
    tosAccepted: true,
  } satisfies Register,
  alex: {
    email: "alex.patel@example.com",
    password: "C0mplex#PWord-2026",
    confirmPassword: "C0mplex#PWord-2026",
    name: "Alex Patel",
    tosAccepted: true,
  } satisfies Register,
  longName: {
    email: "name@example.com",
    password: "An0ther$Strong-One",
    confirmPassword: "An0ther$Strong-One",
    name: "María José García-Martínez de la Vega",
    tosAccepted: true,
  } satisfies Register,
} as const;
```

### Review

- Name: `review`
- Categories: ecommerce
- Description: Product review with rating (1-5), title, body, and verified purchase flag.
- Install (types only): `npx shadcn add @open-types/review`
- Install (with Zod): `npx shadcn add @open-types/review-zod`
- Install (with examples): `npx shadcn add @open-types/review-examples`
- Detail page: https://open-types.dev/types/review
- Markdown: https://open-types.dev/types/review.md

#### Types

```typescript
export interface Review {
  id: string;
  rating: number;
  title?: string;
  body?: string;
  author: string;
  product_id: string;
  created_at: string;
  verified_purchase: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Review } from "../types/review";

export const reviewSchema = z.object({
  id: z.string().min(1, { error: "Review ID is required" }),
  rating: z.number().int({ error: "Rating must be a whole number" }).min(1, {
    error: "Rating must be at least 1",
  }).max(5, { error: "Rating must be at most 5" }),
  title: z.string().max(200, { error: "Title must be at most 200 characters" }).optional(),
  body: z.string().max(5000, { error: "Body must be at most 5000 characters" }).optional(),
  author: z.string().min(1, { error: "Author is required" }),
  product_id: z.string().min(1, { error: "Product ID is required" }),
  created_at: z.string().min(1, { error: "Created at is required" }),
  verified_purchase: z.boolean(),
}) satisfies z.ZodType<Review>;

export type { Review } from "../types/review";
```

#### Examples

```typescript
// Source: hand-crafted
import type { Review } from "../types/review";

const positive = {
  id: "rev_01HABCDEF0123456789ABCDE",
  rating: 5,
  title: "Exactly what I needed",
  body: "Arrived on time and works perfectly. Highly recommended.",
  author: "Jenny R.",
  product_id: "prod_widget_001",
  created_at: "2026-05-16T18:30:00Z",
  verified_purchase: true,
} as const satisfies Review;

export const reviewExamples = {
  fiveStarVerified: positive,
  oneStar: {
    ...positive,
    id: "rev_one_star_002",
    rating: 1,
    title: "Did not work",
    body: "Arrived broken, would not turn on.",
    author: "Alex P.",
    verified_purchase: false,
  } satisfies Review,
  threeStar: {
    ...positive,
    id: "rev_three_star_003",
    rating: 3,
    title: "Mixed feelings",
    body: "Build quality is solid but the docs are confusing.",
    author: "Sam L.",
  } satisfies Review,
  minimal: {
    id: "rev_min_004",
    rating: 4,
    author: "Anonymous",
    product_id: "prod_widget_001",
    created_at: "2026-05-16T18:30:00Z",
    verified_purchase: false,
  } satisfies Review,
  titleOnly: {
    ...positive,
    id: "rev_title_005",
    rating: 5,
    title: "Great!",
    body: undefined,
  } satisfies Review,
} as const;
```

### RSS Feed Item

- Name: `rss-feed-item`
- Categories: social
- Description: RSS/Atom feed and item with title, link, enclosure, and categories.
- Install (types only): `npx shadcn add @open-types/rss-feed-item`
- Install (with Zod): `npx shadcn add @open-types/rss-feed-item-zod`
- Install (with examples): `npx shadcn add @open-types/rss-feed-item-examples`
- Detail page: https://open-types.dev/types/rss-feed-item
- Markdown: https://open-types.dev/types/rss-feed-item.md

#### Types

```typescript
export interface RSSEnclosure {
  url: string;
  type: string;
  length?: number;
}

export interface RSSFeedItem {
  title?: string;
  link?: string;
  description?: string;
  pubDate?: string;
  guid?: string;
  author?: string;
  categories?: string[];
  enclosure?: RSSEnclosure;
}

export interface RSSFeed {
  title: string;
  link: string;
  description: string;
  language?: string;
  items: RSSFeedItem[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { RSSFeed, RSSFeedItem, RSSEnclosure } from "../types/rss-feed-item";

export const rssEnclosureSchema = z.object({
  url: z.url({ error: "Enclosure URL must be a valid URL" }),
  type: z.string().min(1, { error: "Enclosure type is required" }),
  length: z.number().int({ error: "Enclosure length must be a whole number" }).min(0, {
    error: "Enclosure length cannot be negative",
  }).optional(),
}) satisfies z.ZodType<RSSEnclosure>;

export const rssFeedItemSchema = z.object({
  title: z.string().optional(),
  link: z.url({ error: "Item link must be a valid URL" }).optional(),
  description: z.string().optional(),
  pubDate: z.string().optional(),
  guid: z.string().optional(),
  author: z.string().optional(),
  categories: z.array(z.string().min(1, { error: "Category cannot be empty" })).optional(),
  enclosure: rssEnclosureSchema.optional(),
}) satisfies z.ZodType<RSSFeedItem>;

export const rssFeedSchema = z.object({
  title: z.string().min(1, { error: "Feed title is required" }),
  link: z.url({ error: "Feed link must be a valid URL" }),
  description: z.string().min(1, { error: "Feed description is required" }),
  language: z.string().optional(),
  items: z.array(rssFeedItemSchema),
}) satisfies z.ZodType<RSSFeed>;

export type { RSSFeed, RSSFeedItem, RSSEnclosure } from "../types/rss-feed-item";
```

#### Examples

```typescript
// Source: https://www.rssboard.org/rss-specification
// Captured: 2026-05
import type {
  RSSEnclosure,
  RSSFeedItem,
  RSSFeed,
} from "../types/rss-feed-item";

const podcastEnclosure = {
  url: "https://cdn.example.com/podcasts/ep42.mp3",
  type: "audio/mpeg",
  length: 18_350_000,
} as const satisfies RSSEnclosure;

export const rssEnclosureExamples = {
  podcast: podcastEnclosure,
  videoNoLength: {
    url: "https://cdn.example.com/videos/intro.mp4",
    type: "video/mp4",
  } satisfies RSSEnclosure,
  image: {
    url: "https://cdn.example.com/images/cover.jpg",
    type: "image/jpeg",
    length: 92_341,
  } satisfies RSSEnclosure,
} as const;

const blogItem = {
  title: "Why we built OpenTypes",
  link: "https://open-types.dev/blog/why",
  description: "A community-curated registry of TypeScript types for everyday data shapes.",
  pubDate: "Fri, 16 May 2026 18:30:00 +0000",
  guid: "https://open-types.dev/blog/why",
  author: "marco@open-types.dev (Marco Tisi)",
  categories: ["typescript", "registry", "announcements"],
} as const satisfies RSSFeedItem;

export const rssFeedItemExamples = {
  blogPost: blogItem,
  podcastEpisode: {
    title: "Episode 42: Type design",
    link: "https://open-types.dev/podcast/42",
    description: "Designing types for the open web.",
    pubDate: "Fri, 16 May 2026 18:30:00 +0000",
    guid: "ep-42-2026-05-16",
    enclosure: podcastEnclosure,
  } satisfies RSSFeedItem,
  minimal: { title: "Untitled" } satisfies RSSFeedItem,
  empty: {} satisfies RSSFeedItem,
} as const;

export const rssFeedExamples = {
  blog: {
    title: "OpenTypes Blog",
    link: "https://open-types.dev/blog",
    description: "Updates from the OpenTypes registry.",
    language: "en-US",
    items: [blogItem, rssFeedItemExamples.podcastEpisode],
  } satisfies RSSFeed,
  empty: {
    title: "OpenTypes Blog",
    link: "https://open-types.dev/blog",
    description: "Updates from the OpenTypes registry.",
    items: [],
  } satisfies RSSFeed,
} as const;
```

### Segment Identify

- Name: `segment-identify`
- Categories: analytics
- Description: Segment analytics identify call with user traits and context.
- Install (types only): `npx shadcn add @open-types/segment-identify`
- Install (with Zod): `npx shadcn add @open-types/segment-identify-zod`
- Install (with examples): `npx shadcn add @open-types/segment-identify-examples`
- Detail page: https://open-types.dev/types/segment-identify
- Markdown: https://open-types.dev/types/segment-identify.md

#### Types

```typescript
export interface SegmentIdentifyCall {
  userId?: string;
  anonymousId?: string;
  traits?: Record<string, unknown>;
  context?: Record<string, unknown>;
  timestamp?: string;
  integrations?: Record<string, boolean>;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { SegmentIdentifyCall } from "../types/segment-identify";

export const segmentIdentifyCallSchema = z.object({
  userId: z.string().optional(),
  anonymousId: z.string().optional(),
  traits: z.record(z.string(), z.unknown()).optional(),
  context: z.record(z.string(), z.unknown()).optional(),
  timestamp: z.iso.datetime({ error: "Invalid timestamp" }).optional(),
  integrations: z.record(z.string(), z.boolean()).optional(),
}) satisfies z.ZodType<SegmentIdentifyCall>;

export type { SegmentIdentifyCall } from "../types/segment-identify";
```

#### Examples

```typescript
// Source: https://segment.com/docs/connections/spec/identify/
// Captured: 2026-05
import type { SegmentIdentifyCall } from "../types/segment-identify";

const identified = {
  userId: "97980cfea0067",
  traits: {
    email: "jenny.rosen@example.com",
    name: "Jenny Rosen",
    plan: "pro",
    company: { name: "Open Types", industry: "Software" },
  },
  context: {
    ip: "203.0.113.42",
    library: { name: "analytics.js", version: "5.10.0" },
  },
  timestamp: "2026-04-13T18:30:00.000Z",
  integrations: { All: true, Intercom: true, Salesforce: false },
} as const satisfies SegmentIdentifyCall;

export const segmentIdentifyCallExamples = {
  identified,
  anonymous: {
    anonymousId: "anon_1234567890",
    traits: { email: "lead@example.com" },
  } satisfies SegmentIdentifyCall,
  upgradePlan: {
    userId: "user_777",
    traits: { plan: "team", upgraded_at: "2026-04-13T18:30:00.000Z" },
    integrations: { All: false, Webhook: true },
  } satisfies SegmentIdentifyCall,
  minimal: { userId: "user_321" } satisfies SegmentIdentifyCall,
  aliasFromAnon: {
    userId: "user_321",
    anonymousId: "anon_1234567890",
    traits: { email: "linked@example.com" },
  } satisfies SegmentIdentifyCall,
} as const;
```

### Segment Track

- Name: `segment-track`
- Categories: analytics
- Description: Segment analytics track call with event, properties, and context.
- Install (types only): `npx shadcn add @open-types/segment-track`
- Install (with Zod): `npx shadcn add @open-types/segment-track-zod`
- Install (with examples): `npx shadcn add @open-types/segment-track-examples`
- Detail page: https://open-types.dev/types/segment-track
- Markdown: https://open-types.dev/types/segment-track.md

#### Types

```typescript
export interface SegmentTrackCall {
  userId?: string;
  anonymousId?: string;
  event: string;
  properties?: Record<string, unknown>;
  context?: Record<string, unknown>;
  timestamp?: string;
  integrations?: Record<string, boolean>;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { SegmentTrackCall } from "../types/segment-track";

export const segmentTrackCallSchema = z.object({
  userId: z.string().optional(),
  anonymousId: z.string().optional(),
  event: z.string().min(1, { error: "Event is required" }),
  properties: z.record(z.string(), z.unknown()).optional(),
  context: z.record(z.string(), z.unknown()).optional(),
  timestamp: z.iso.datetime({ error: "Invalid timestamp" }).optional(),
  integrations: z.record(z.string(), z.boolean()).optional(),
}) satisfies z.ZodType<SegmentTrackCall>;

export type { SegmentTrackCall } from "../types/segment-track";
```

#### Examples

```typescript
// Source: https://segment.com/docs/connections/spec/track/
// Captured: 2026-05
import type { SegmentTrackCall } from "../types/segment-track";

const ordered = {
  userId: "97980cfea0067",
  event: "Order Completed",
  properties: {
    order_id: "ord_5051",
    total: 99.99,
    currency: "USD",
    items: [{ sku: "sku_abc", quantity: 1, price: 99.99 }],
  },
  context: {
    library: { name: "analytics.js", version: "5.10.0" },
    page: { path: "/checkout/complete", url: "https://example.com/checkout/complete" },
    userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  },
  timestamp: "2026-04-13T18:30:00.000Z",
  integrations: { All: true, "Google Analytics": true, Mixpanel: false },
} as const satisfies SegmentTrackCall;

export const segmentTrackCallExamples = {
  orderCompleted: ordered,
  anonymous: {
    anonymousId: "anon_1234567890",
    event: "Product Viewed",
    properties: { product_id: "sku_abc", name: "Pro Plan" },
  } satisfies SegmentTrackCall,
  signupStarted: {
    anonymousId: "anon_2222222222",
    event: "Signup Started",
    properties: { plan: "free" },
    timestamp: "2026-04-13T18:00:00.000Z",
  } satisfies SegmentTrackCall,
  minimalIdentified: {
    userId: "user_321",
    event: "Page Viewed",
  } satisfies SegmentTrackCall,
  serverSide: {
    userId: "user_777",
    event: "Subscription Renewed",
    properties: { plan: "team", amount: 49 },
    integrations: { All: false, Webhook: true },
  } satisfies SegmentTrackCall,
} as const;
```

### SendGrid Event Webhook

- Name: `sendgrid-event-webhook`
- Categories: sendgrid
- Description: SendGrid event webhook with delivery, engagement, and compliance events.
- Install (types only): `npx shadcn add @open-types/sendgrid-event-webhook`
- Install (with Zod): `npx shadcn add @open-types/sendgrid-event-webhook-zod`
- Install (with examples): `npx shadcn add @open-types/sendgrid-event-webhook-examples`
- Detail page: https://open-types.dev/types/sendgrid-event-webhook
- Markdown: https://open-types.dev/types/sendgrid-event-webhook.md

#### Types

```typescript
export type SendGridEventType =
  | "processed"
  | "dropped"
  | "delivered"
  | "deferred"
  | "bounce"
  | "open"
  | "click"
  | "spam_report"
  | "unsubscribe"
  | "group_unsubscribe"
  | "group_resubscribe";

export interface SendGridEvent {
  email: string;
  timestamp: number;
  event: SendGridEventType;
  sg_event_id: string;
  sg_message_id?: string;
  category?: string | string[];
  reason?: string;
  url?: string;
  useragent?: string;
  ip?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { SendGridEvent, SendGridEventType } from "../types/sendgrid-event-webhook";

export const sendGridEventTypeSchema = z.enum([
  "processed",
  "dropped",
  "delivered",
  "deferred",
  "bounce",
  "open",
  "click",
  "spam_report",
  "unsubscribe",
  "group_unsubscribe",
  "group_resubscribe",
]) satisfies z.ZodType<SendGridEventType>;

export const sendGridEventSchema = z.object({
  email: z.string(),
  timestamp: z.number(),
  event: sendGridEventTypeSchema,
  sg_event_id: z.string(),
  sg_message_id: z.string().optional(),
  category: z.union([z.string(), z.array(z.string())]).optional(),
  reason: z.string().optional(),
  url: z.string().optional(),
  useragent: z.string().optional(),
  ip: z.string().optional(),
}) satisfies z.ZodType<SendGridEvent>;

export type { SendGridEvent, SendGridEventType } from "../types/sendgrid-event-webhook";
```

#### Examples

```typescript
// Source: https://docs.sendgrid.com/for-developers/tracking-events/event
// Captured: 2026-05
import type {
  SendGridEventType,
  SendGridEvent,
} from "../types/sendgrid-event-webhook";

export const sendGridEventTypeExamples = {
  processed: "processed",
  dropped: "dropped",
  delivered: "delivered",
  deferred: "deferred",
  bounce: "bounce",
  open: "open",
  click: "click",
  spamReport: "spam_report",
  unsubscribe: "unsubscribe",
  groupUnsubscribe: "group_unsubscribe",
  groupResubscribe: "group_resubscribe",
} as const satisfies Record<string, SendGridEventType>;

const baseEvent = {
  email: "customer@example.com",
  timestamp: 1712948400,
  event: "processed",
  sg_event_id: "sg_event_id_abc123",
  sg_message_id: "filter0123.0001.5BB9D6E0.0",
} as const satisfies SendGridEvent;

export const sendGridEventExamples = {
  processed: baseEvent,
  delivered: { ...baseEvent, event: "delivered", sg_event_id: "sg_event_delivered_001" } satisfies SendGridEvent,
  bounce: {
    ...baseEvent,
    event: "bounce",
    sg_event_id: "sg_event_bounce_001",
    reason: "550 5.1.1 The email account that you tried to reach does not exist",
  } satisfies SendGridEvent,
  click: {
    ...baseEvent,
    event: "click",
    sg_event_id: "sg_event_click_001",
    url: "https://open-types.dev/welcome",
    useragent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
    ip: "203.0.113.42",
  } satisfies SendGridEvent,
  open: {
    ...baseEvent,
    event: "open",
    sg_event_id: "sg_event_open_001",
    useragent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X)",
    ip: "198.51.100.21",
  } satisfies SendGridEvent,
  unsubscribe: {
    ...baseEvent,
    event: "unsubscribe",
    sg_event_id: "sg_event_unsub_001",
    category: "marketing",
  } satisfies SendGridEvent,
  spamReport: {
    ...baseEvent,
    event: "spam_report",
    sg_event_id: "sg_event_spam_001",
    category: ["marketing", "newsletter"],
  } satisfies SendGridEvent,
  dropped: {
    ...baseEvent,
    event: "dropped",
    sg_event_id: "sg_event_drop_001",
    reason: "Invalid SMTPAPI header",
  } satisfies SendGridEvent,
} as const;
```

### SendGrid Mail

- Name: `sendgrid-mail`
- Categories: sendgrid
- Description: SendGrid v3 mail send request with personalizations, content, and recipients.
- Install (types only): `npx shadcn add @open-types/sendgrid-mail`
- Install (with Zod): `npx shadcn add @open-types/sendgrid-mail-zod`
- Install (with examples): `npx shadcn add @open-types/sendgrid-mail-examples`
- Detail page: https://open-types.dev/types/sendgrid-mail
- Markdown: https://open-types.dev/types/sendgrid-mail.md

#### Types

```typescript
export interface SendGridEmailAddress {
  email: string;
  name?: string;
}

export interface SendGridPersonalization {
  to: SendGridEmailAddress[];
  cc?: SendGridEmailAddress[];
  bcc?: SendGridEmailAddress[];
  subject?: string;
}

export interface SendGridContent {
  type: string;
  value: string;
}

export interface SendGridMailRequest {
  personalizations: SendGridPersonalization[];
  from: SendGridEmailAddress;
  reply_to?: SendGridEmailAddress;
  subject: string;
  content: SendGridContent[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  SendGridContent,
  SendGridEmailAddress,
  SendGridMailRequest,
  SendGridPersonalization,
} from "../types/sendgrid-mail";

export const sendGridEmailAddressSchema = z.object({
  email: z.string(),
  name: z.string().optional(),
}) satisfies z.ZodType<SendGridEmailAddress>;

export const sendGridPersonalizationSchema = z.object({
  to: z.array(sendGridEmailAddressSchema),
  cc: z.array(sendGridEmailAddressSchema).optional(),
  bcc: z.array(sendGridEmailAddressSchema).optional(),
  subject: z.string().optional(),
}) satisfies z.ZodType<SendGridPersonalization>;

export const sendGridContentSchema = z.object({
  type: z.string(),
  value: z.string(),
}) satisfies z.ZodType<SendGridContent>;

export const sendGridMailRequestSchema = z.object({
  personalizations: z.array(sendGridPersonalizationSchema),
  from: sendGridEmailAddressSchema,
  reply_to: sendGridEmailAddressSchema.optional(),
  subject: z.string(),
  content: z.array(sendGridContentSchema),
}) satisfies z.ZodType<SendGridMailRequest>;

export type {
  SendGridContent,
  SendGridEmailAddress,
  SendGridMailRequest,
  SendGridPersonalization,
} from "../types/sendgrid-mail";
```

#### Examples

```typescript
// Source: https://docs.sendgrid.com/api-reference/mail-send/mail-send
// Captured: 2026-05
import type {
  SendGridEmailAddress,
  SendGridPersonalization,
  SendGridContent,
  SendGridMailRequest,
} from "../types/sendgrid-mail";

const from = { email: "no-reply@example.com", name: "Open Types" } as const satisfies SendGridEmailAddress;
const customer = { email: "customer@example.com", name: "Jenny Rosen" } as const satisfies SendGridEmailAddress;

export const sendGridEmailAddressExamples = {
  withName: from,
  noName: { email: "alerts@example.com" } satisfies SendGridEmailAddress,
  customer,
} as const;

const personalizationSingle = {
  to: [customer],
  subject: "Your receipt",
} as const satisfies SendGridPersonalization;

export const sendGridPersonalizationExamples = {
  single: personalizationSingle,
  withCcAndBcc: {
    to: [customer],
    cc: [{ email: "team@example.com" }],
    bcc: [{ email: "compliance@example.com" }],
    subject: "Your receipt",
  } satisfies SendGridPersonalization,
  multipleTo: {
    to: [customer, { email: "support@example.com" }],
    subject: "Weekly update",
  } satisfies SendGridPersonalization,
} as const;

const contentText = { type: "text/plain", value: "Thanks for your order." } as const satisfies SendGridContent;
const contentHtml = {
  type: "text/html",
  value: "<p>Thanks for your <strong>order</strong>.</p>",
} as const satisfies SendGridContent;

export const sendGridContentExamples = {
  text: contentText,
  html: contentHtml,
} as const;

export const sendGridMailRequestExamples = {
  minimal: {
    personalizations: [personalizationSingle],
    from,
    subject: "Your receipt",
    content: [contentText],
  } satisfies SendGridMailRequest,
  multipart: {
    personalizations: [personalizationSingle],
    from,
    reply_to: { email: "support@example.com", name: "Open Types Support" },
    subject: "Your receipt",
    content: [contentText, contentHtml],
  } satisfies SendGridMailRequest,
  marketingBatch: {
    personalizations: [
      sendGridPersonalizationExamples.multipleTo,
      { to: [{ email: "vip@example.com", name: "VIP" }], subject: "VIP exclusive" },
    ],
    from,
    subject: "Weekly update",
    content: [contentHtml],
  } satisfies SendGridMailRequest,
} as const;
```

### Server-Sent Event

- Name: `server-sent-event`
- Categories: api
- Description: Server-Sent Event fields: id, event type, data, and retry interval.
- Install (types only): `npx shadcn add @open-types/server-sent-event`
- Install (with Zod): `npx shadcn add @open-types/server-sent-event-zod`
- Install (with examples): `npx shadcn add @open-types/server-sent-event-examples`
- Detail page: https://open-types.dev/types/server-sent-event
- Markdown: https://open-types.dev/types/server-sent-event.md

#### Types

```typescript
export interface ServerSentEvent {
  id?: string;
  event?: string;
  data: string;
  retry?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { ServerSentEvent } from "../types/server-sent-event";

export const serverSentEventSchema = z.object({
  id: z.string().optional(),
  event: z.string().optional(),
  data: z.string(),
  retry: z.number().int().min(0, { error: "Retry must be greater than or equal to 0" }).optional(),
}) satisfies z.ZodType<ServerSentEvent>;

export type { ServerSentEvent } from "../types/server-sent-event";
```

#### Examples

```typescript
// Source: https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
// Captured: 2026-05
import type { ServerSentEvent } from "../types/server-sent-event";

export const serverSentEventExamples = {
  dataOnly: { data: "ping" } satisfies ServerSentEvent,
  named: { event: "userJoined", data: '{"userId":"user_321"}' } satisfies ServerSentEvent,
  withId: {
    id: "msg-101",
    event: "message",
    data: "Hello, world!",
  } satisfies ServerSentEvent,
  withRetry: {
    event: "reconnect",
    data: "",
    retry: 5000,
  } satisfies ServerSentEvent,
  multilineData: {
    id: "msg-102",
    event: "message",
    data: "Line one\nLine two\nLine three",
  } satisfies ServerSentEvent,
  fullFields: {
    id: "msg-103",
    event: "progress",
    data: '{"percent":42}',
    retry: 10000,
  } satisfies ServerSentEvent,
} as const;
```

### Session

- Name: `session`
- Categories: auth
- Description: User session with ID, expiration, IP address, and user agent tracking.
- Install (types only): `npx shadcn add @open-types/session`
- Install (with Zod): `npx shadcn add @open-types/session-zod`
- Install (with examples): `npx shadcn add @open-types/session-examples`
- Detail page: https://open-types.dev/types/session
- Markdown: https://open-types.dev/types/session.md

#### Types

```typescript
export interface Session {
  id: string;
  user_id: string;
  expires_at: string;
  created_at: string;
  ip_address?: string;
  user_agent?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { Session } from "../types/session";

export const sessionSchema = z.object({
  id: z.string(),
  user_id: z.string(),
  expires_at: z.string(),
  created_at: z.string(),
  ip_address: z.string().optional(),
  user_agent: z.string().optional(),
}) satisfies z.ZodType<Session>;

export type { Session } from "../types/session";
```

#### Examples

```typescript
// Source: hand-crafted
import type { Session } from "../types/session";

export const sessionExamples = {
  webBrowser: {
    id: "sess_01HABCDEF0123456789ABCDE",
    user_id: "user_321",
    expires_at: "2026-05-23T18:30:00Z",
    created_at: "2026-05-16T18:30:00Z",
    ip_address: "203.0.113.42",
    user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15",
  } satisfies Session,
  mobile: {
    id: "sess_01HMOBILE123456789ABCDEF",
    user_id: "user_321",
    expires_at: "2026-06-15T18:30:00Z",
    created_at: "2026-05-16T18:30:00Z",
    ip_address: "198.51.100.7",
    user_agent: "OpenTypesApp/2.1.0 (iPhone; iOS 17.3)",
  } satisfies Session,
  apiToken: {
    id: "sess_api_abcdef0123456789",
    user_id: "service_account_42",
    expires_at: "2027-05-16T18:30:00Z",
    created_at: "2026-05-16T18:30:00Z",
  } satisfies Session,
  ipv6: {
    id: "sess_01HIPV6_0123456789ABCDEF",
    user_id: "user_555",
    expires_at: "2026-05-23T18:30:00Z",
    created_at: "2026-05-16T18:30:00Z",
    ip_address: "2001:db8::1",
    user_agent: "curl/8.7.1",
  } satisfies Session,
} as const;
```

### Shared Discord Examples

- Name: `shared-discord`
- Categories: discord
- Description: Shared example fixtures for Discord schemas.
- Depends on: `@open-types/discord-shared`
- Install (types only): `npx shadcn add @open-types/shared-discord`
- Install (with Zod): `npx shadcn add @open-types/shared-discord-zod`
- Install (with examples): `npx shadcn add @open-types/shared-discord-examples`
- Detail page: https://open-types.dev/types/shared-discord
- Markdown: https://open-types.dev/types/shared-discord.md

### Shared GitHub Examples

- Name: `shared-github`
- Categories: github
- Description: Shared example fixtures for GitHub schemas.
- Depends on: `@open-types/github-shared`
- Install (types only): `npx shadcn add @open-types/shared-github`
- Install (with Zod): `npx shadcn add @open-types/shared-github-zod`
- Install (with examples): `npx shadcn add @open-types/shared-github-examples`
- Detail page: https://open-types.dev/types/shared-github
- Markdown: https://open-types.dev/types/shared-github.md

### Shared Slack Examples

- Name: `shared-slack`
- Categories: slack
- Description: Shared example fixtures for Slack schemas.
- Depends on: `@open-types/slack-shared`
- Install (types only): `npx shadcn add @open-types/shared-slack`
- Install (with Zod): `npx shadcn add @open-types/shared-slack-zod`
- Install (with examples): `npx shadcn add @open-types/shared-slack-examples`
- Detail page: https://open-types.dev/types/shared-slack
- Markdown: https://open-types.dev/types/shared-slack.md

### Shared Stripe Examples

- Name: `shared-stripe`
- Categories: stripe
- Description: Shared example fixtures for Stripe schemas.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/shared-stripe`
- Install (with Zod): `npx shadcn add @open-types/shared-stripe-zod`
- Install (with examples): `npx shadcn add @open-types/shared-stripe-examples`
- Detail page: https://open-types.dev/types/shared-stripe
- Markdown: https://open-types.dev/types/shared-stripe.md

### Shipping Rate

- Name: `shipping-rate`
- Categories: ecommerce
- Description: Shipping rate with amount, currency, carrier, and estimated delivery days.
- Install (types only): `npx shadcn add @open-types/shipping-rate`
- Install (with Zod): `npx shadcn add @open-types/shipping-rate-zod`
- Install (with examples): `npx shadcn add @open-types/shipping-rate-examples`
- Detail page: https://open-types.dev/types/shipping-rate
- Markdown: https://open-types.dev/types/shipping-rate.md

#### Types

```typescript
export interface ShippingRate {
  id: string;
  name: string;
  amount: number;
  currency: string;
  estimated_days?: number;
  carrier?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { ShippingRate } from "../types/shipping-rate";

const ISO_CURRENCY_REGEX = /^[A-Z]{3}$/;

export const shippingRateSchema = z.object({
  id: z.string().min(1, { error: "Shipping rate ID is required" }),
  name: z.string().min(1, { error: "Shipping rate name is required" }),
  amount: z.number().min(0, { error: "Amount cannot be negative" }),
  currency: z.string().regex(ISO_CURRENCY_REGEX, {
    error: "Currency must be a 3-letter ISO code",
  }),
  estimated_days: z.number().int({ error: "Estimated days must be a whole number" }).min(1, {
    error: "Estimated days must be at least 1",
  }).optional(),
  carrier: z.string().optional(),
}) satisfies z.ZodType<ShippingRate>;

export type { ShippingRate } from "../types/shipping-rate";
```

#### Examples

```typescript
// Source: hand-crafted
import type { ShippingRate } from "../types/shipping-rate";

export const shippingRateExamples = {
  standard: {
    id: "ship_standard_001",
    name: "Standard Shipping",
    amount: 5.99,
    currency: "USD",
    estimated_days: 5,
    carrier: "USPS",
  } satisfies ShippingRate,
  express: {
    id: "ship_express_002",
    name: "Express Shipping",
    amount: 14.99,
    currency: "USD",
    estimated_days: 2,
    carrier: "FedEx",
  } satisfies ShippingRate,
  overnight: {
    id: "ship_overnight_003",
    name: "Overnight",
    amount: 29.99,
    currency: "USD",
    estimated_days: 1,
    carrier: "UPS",
  } satisfies ShippingRate,
  free: {
    id: "ship_free_004",
    name: "Free Shipping",
    amount: 0,
    currency: "USD",
    estimated_days: 7,
  } satisfies ShippingRate,
  minimal: {
    id: "ship_min_005",
    name: "Pickup",
    amount: 0,
    currency: "USD",
  } satisfies ShippingRate,
} as const;
```

### Sitemap Entry

- Name: `sitemap-entry`
- Categories: seo
- Description: XML sitemap URL entry with lastmod, changefreq, and priority.
- Install (types only): `npx shadcn add @open-types/sitemap-entry`
- Install (with Zod): `npx shadcn add @open-types/sitemap-entry-zod`
- Install (with examples): `npx shadcn add @open-types/sitemap-entry-examples`
- Detail page: https://open-types.dev/types/sitemap-entry
- Markdown: https://open-types.dev/types/sitemap-entry.md

#### Types

```typescript
export type SitemapChangeFreq =
  | "always"
  | "hourly"
  | "daily"
  | "weekly"
  | "monthly"
  | "yearly"
  | "never";

export interface SitemapEntry {
  loc: string;
  lastmod?: string;
  changefreq?: SitemapChangeFreq;
  priority?: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { SitemapChangeFreq, SitemapEntry } from "../types/sitemap-entry";

export const sitemapChangeFreqSchema = z.enum([
  "always",
  "hourly",
  "daily",
  "weekly",
  "monthly",
  "yearly",
  "never",
]) satisfies z.ZodType<SitemapChangeFreq>;

export const sitemapEntrySchema = z.object({
  loc: z.string(),
  lastmod: z.string().optional(),
  changefreq: sitemapChangeFreqSchema.optional(),
  priority: z
    .number()
    .min(0, { error: "Priority must be between 0.0 and 1.0" })
    .max(1, { error: "Priority must be between 0.0 and 1.0" })
    .optional(),
}) satisfies z.ZodType<SitemapEntry>;

export type { SitemapChangeFreq, SitemapEntry } from "../types/sitemap-entry";
```

#### Examples

```typescript
// Source: https://www.sitemaps.org/protocol.html
// Captured: 2026-05
import type {
  SitemapChangeFreq,
  SitemapEntry,
} from "../types/sitemap-entry";

export const sitemapChangeFreqExamples = {
  always: "always",
  hourly: "hourly",
  daily: "daily",
  weekly: "weekly",
  monthly: "monthly",
  yearly: "yearly",
  never: "never",
} as const satisfies Record<string, SitemapChangeFreq>;

export const sitemapEntryExamples = {
  homepage: {
    loc: "https://open-types.dev/",
    lastmod: "2026-05-16",
    changefreq: "daily",
    priority: 1.0,
  } satisfies SitemapEntry,
  article: {
    loc: "https://open-types.dev/blog/why",
    lastmod: "2026-04-13T18:30:00+00:00",
    changefreq: "monthly",
    priority: 0.6,
  } satisfies SitemapEntry,
  staticPage: {
    loc: "https://open-types.dev/about",
    lastmod: "2025-12-01",
    changefreq: "yearly",
    priority: 0.4,
  } satisfies SitemapEntry,
  minimal: { loc: "https://open-types.dev/legal" } satisfies SitemapEntry,
  archived: {
    loc: "https://open-types.dev/v1",
    changefreq: "never",
    priority: 0.1,
  } satisfies SitemapEntry,
} as const;
```

### Slack Interaction Payload

- Name: `slack-interaction-payload`
- Categories: slack
- Description: Slack interaction payload for block actions, view submissions, and shortcuts.
- Depends on: `@open-types/slack-shared`
- Install (types only): `npx shadcn add @open-types/slack-interaction-payload`
- Install (with Zod): `npx shadcn add @open-types/slack-interaction-payload-zod`
- Install (with examples): `npx shadcn add @open-types/slack-interaction-payload-examples`
- Detail page: https://open-types.dev/types/slack-interaction-payload
- Markdown: https://open-types.dev/types/slack-interaction-payload.md

#### Types

```typescript
import type { SlackUser, SlackChannel } from "./slack-shared";

export interface SlackActionUser {
  id: SlackUser["id"];
  name: SlackUser["name"];
  team_id: SlackUser["team_id"];
}

export interface SlackActionChannel {
  id: SlackChannel["id"];
  name: SlackChannel["name"];
}

export interface SlackAction {
  action_id: string;
  type: string;
  value?: string;
  block_id: string;
}

export type SlackInteractionType =
  | "block_actions"
  | "view_submission"
  | "shortcut";

export interface SlackInteractionPayload {
  type: SlackInteractionType;
  trigger_id: string;
  user: SlackActionUser;
  channel?: SlackActionChannel;
  actions?: SlackAction[];
  response_url?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  SlackActionUser,
  SlackActionChannel,
  SlackAction,
  SlackInteractionType,
  SlackInteractionPayload,
} from "../types/slack-interaction-payload";
import {
  slackUserSchema,
  slackChannelSchema,
} from "./slack-shared";

export const slackActionUserSchema = slackUserSchema.pick({
  id: true,
  name: true,
  team_id: true,
}) satisfies z.ZodType<SlackActionUser>;

export const slackActionChannelSchema = slackChannelSchema.pick({
  id: true,
  name: true,
}) satisfies z.ZodType<SlackActionChannel>;

export const slackActionSchema = z.object({
  action_id: z.string(),
  type: z.string(),
  value: z.string().optional(),
  block_id: z.string(),
}) satisfies z.ZodType<SlackAction>;

export const slackInteractionTypeSchema = z.enum([
  "block_actions",
  "view_submission",
  "shortcut",
]) satisfies z.ZodType<SlackInteractionType>;

export const slackInteractionPayloadSchema = z.object({
  type: slackInteractionTypeSchema,
  trigger_id: z.string(),
  user: slackActionUserSchema,
  channel: slackActionChannelSchema.optional(),
  actions: z.array(slackActionSchema).optional(),
  response_url: z.string().optional(),
}) satisfies z.ZodType<SlackInteractionPayload>;

export type {
  SlackActionUser,
  SlackActionChannel,
  SlackAction,
  SlackInteractionType,
  SlackInteractionPayload,
} from "../types/slack-interaction-payload";
```

#### Examples

```typescript
// Source: https://api.slack.com/reference/interaction-payloads
// Captured: 2026-05
import type {
  SlackActionUser,
  SlackActionChannel,
  SlackAction,
  SlackInteractionType,
  SlackInteractionPayload,
} from "../types/slack-interaction-payload";
import { slackIds } from "./shared/slack.examples";

const actionUser = {
  id: slackIds.user,
  name: "marco",
  team_id: slackIds.team,
} as const satisfies SlackActionUser;

export const slackActionUserExamples = {
  marco: actionUser,
  alex: {
    id: "U87654321",
    name: "alex",
    team_id: slackIds.team,
  } satisfies SlackActionUser,
} as const;

const actionChannel = {
  id: slackIds.channel,
  name: "engineering",
} as const satisfies SlackActionChannel;

export const slackActionChannelExamples = {
  engineering: actionChannel,
  deployments: { id: slackIds.channel, name: "deployments" } satisfies SlackActionChannel,
} as const;

const approveAction = {
  action_id: "approve_deploy",
  type: "button",
  value: "deploy-42",
  block_id: "approval_actions",
} as const satisfies SlackAction;

export const slackActionExamples = {
  buttonApprove: approveAction,
  buttonDeny: {
    action_id: "deny_deploy",
    type: "button",
    value: "deploy-42",
    block_id: "approval_actions",
  } satisfies SlackAction,
  selectMenuChange: {
    action_id: "select_environment",
    type: "static_select",
    block_id: "select_block",
  } satisfies SlackAction,
} as const;

export const slackInteractionTypeExamples = {
  blockActions: "block_actions",
  viewSubmission: "view_submission",
  shortcut: "shortcut",
} as const satisfies Record<string, SlackInteractionType>;

const blockActions = {
  type: "block_actions",
  trigger_id: "12466734323.1395872398.abc123def456",
  user: actionUser,
  channel: actionChannel,
  actions: [approveAction],
  response_url: "https://hooks.slack.com/actions/T12345678/1234/abcdef",
} as const satisfies SlackInteractionPayload;

export const slackInteractionPayloadExamples = {
  blockActions,
  shortcut: {
    type: "shortcut",
    trigger_id: "12466734323.1395872398.abc123def456",
    user: actionUser,
  } satisfies SlackInteractionPayload,
  viewSubmission: {
    type: "view_submission",
    trigger_id: "12466734323.1395872398.abc123def456",
    user: actionUser,
  } satisfies SlackInteractionPayload,
  multiAction: {
    ...blockActions,
    actions: [approveAction, slackActionExamples.buttonDeny],
  } satisfies SlackInteractionPayload,
} as const;
```

### Slack Message Event

- Name: `slack-message-event`
- Categories: slack
- Description: Slack message event callback with user, text, channel, and timestamps.
- Depends on: `@open-types/slack-shared`
- Install (types only): `npx shadcn add @open-types/slack-message-event`
- Install (with Zod): `npx shadcn add @open-types/slack-message-event-zod`
- Install (with examples): `npx shadcn add @open-types/slack-message-event-examples`
- Detail page: https://open-types.dev/types/slack-message-event
- Markdown: https://open-types.dev/types/slack-message-event.md

#### Types

```typescript
import type { SlackUser, SlackChannel } from "./slack-shared";

export interface SlackMessageInner {
  type: string;
  user: SlackUser["id"];
  text: string;
  ts: string;
  channel: SlackChannel["id"];
  event_ts: string;
}

export interface SlackMessageEvent {
  token: string;
  team_id: SlackUser["team_id"];
  event: SlackMessageInner;
  type: "event_callback";
  event_id: string;
  event_time: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  SlackMessageInner,
  SlackMessageEvent,
} from "../types/slack-message-event";

export const slackMessageInnerSchema = z.object({
  type: z.string(),
  user: z.string(),
  text: z.string(),
  ts: z.string(),
  channel: z.string(),
  event_ts: z.string(),
}) satisfies z.ZodType<SlackMessageInner>;

export const slackMessageEventSchema = z.object({
  token: z.string(),
  team_id: z.string(),
  event: slackMessageInnerSchema,
  type: z.enum(["event_callback"]),
  event_id: z.string(),
  event_time: z.number().int(),
}) satisfies z.ZodType<SlackMessageEvent>;

export type {
  SlackMessageInner,
  SlackMessageEvent,
} from "../types/slack-message-event";
```

#### Examples

```typescript
// Source: https://api.slack.com/events/message
// Captured: 2026-05
import type {
  SlackMessageInner,
  SlackMessageEvent,
} from "../types/slack-message-event";
import { slackIds } from "./shared/slack.examples";

const innerMessage = {
  type: "message",
  user: slackIds.user,
  text: "Deploy completed successfully",
  ts: "1712333110.123456",
  channel: slackIds.channel,
  event_ts: "1712333110.123456",
} as const satisfies SlackMessageInner;

export const slackMessageInnerExamples = {
  plain: innerMessage,
  withEmoji: {
    ...innerMessage,
    text: "Deploy complete :rocket:",
  } satisfies SlackMessageInner,
  longText: {
    ...innerMessage,
    text: "Deploy started at 09:00 UTC, succeeded after 4 minutes. Logs at https://example.com/runs/42.",
  } satisfies SlackMessageInner,
} as const;

const eventCallback = {
  token: "legacy-verification-token",
  team_id: slackIds.team,
  event: innerMessage,
  type: "event_callback",
  event_id: "Ev03Q7K6M1AB",
  event_time: 1712333110,
} as const satisfies SlackMessageEvent;

export const slackMessageEventExamples = {
  callback: eventCallback,
  withEmoji: {
    ...eventCallback,
    event: slackMessageInnerExamples.withEmoji,
    event_id: "Ev03Q7K6M1AC",
  } satisfies SlackMessageEvent,
  longText: {
    ...eventCallback,
    event: slackMessageInnerExamples.longText,
    event_id: "Ev03Q7K6M1AD",
  } satisfies SlackMessageEvent,
} as const;
```

### Slack Shared

- Name: `slack-shared`
- Categories: slack
- Description: Common Slack types: user and channel identification.
- Install (types only): `npx shadcn add @open-types/slack-shared`
- Install (with Zod): `npx shadcn add @open-types/slack-shared-zod`
- Install (with examples): `npx shadcn add @open-types/slack-shared-examples`
- Detail page: https://open-types.dev/types/slack-shared
- Markdown: https://open-types.dev/types/slack-shared.md

#### Types

```typescript
export interface SlackUser {
  id: string;
  team_id: string;
  name: string;
  real_name?: string;
}

export interface SlackChannel {
  id: string;
  name: string;
  is_channel: boolean;
  is_group: boolean;
  is_im: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { SlackUser, SlackChannel } from "../types/slack-shared";

export const slackUserSchema = z.object({
  id: z.string(),
  team_id: z.string(),
  name: z.string(),
  real_name: z.string().optional(),
}) satisfies z.ZodType<SlackUser>;

export const slackChannelSchema = z.object({
  id: z.string(),
  name: z.string(),
  is_channel: z.boolean(),
  is_group: z.boolean(),
  is_im: z.boolean(),
}) satisfies z.ZodType<SlackChannel>;

export type { SlackUser, SlackChannel } from "../types/slack-shared";
```

#### Examples

```typescript
// Source: https://api.slack.com/types/user, https://api.slack.com/types/channel
// Captured: 2026-05
import type { SlackUser, SlackChannel } from "../types/slack-shared";
import {
  slackIds,
  slackUserMarco,
  slackChannelEngineering,
} from "./shared/slack.examples";

export const slackUserExamples = {
  withRealName: slackUserMarco,
  noRealName: {
    id: "U87654321",
    team_id: slackIds.team,
    name: "alex",
  } satisfies SlackUser,
} as const;

export const slackChannelExamples = {
  publicChannel: slackChannelEngineering,
  dm: {
    id: slackIds.channelDm,
    name: "directmessage",
    is_channel: false,
    is_group: false,
    is_im: true,
  } satisfies SlackChannel,
  privateGroup: {
    id: slackIds.channelPrivate,
    name: "leadership",
    is_channel: false,
    is_group: true,
    is_im: false,
  } satisfies SlackChannel,
} as const;
```

### Slack Slash Command

- Name: `slack-slash-command`
- Categories: slack
- Description: Slack slash command payload with user, channel, command text, and response URL.
- Depends on: `@open-types/slack-shared`
- Install (types only): `npx shadcn add @open-types/slack-slash-command`
- Install (with Zod): `npx shadcn add @open-types/slack-slash-command-zod`
- Install (with examples): `npx shadcn add @open-types/slack-slash-command-examples`
- Detail page: https://open-types.dev/types/slack-slash-command
- Markdown: https://open-types.dev/types/slack-slash-command.md

#### Types

```typescript
import type { SlackUser, SlackChannel } from "./slack-shared";

export interface SlackSlashCommand {
  token: string;
  team_id: SlackUser["team_id"];
  team_domain: string;
  channel_id: SlackChannel["id"];
  channel_name: SlackChannel["name"];
  user_id: SlackUser["id"];
  user_name: SlackUser["name"];
  command: string;
  text: string;
  trigger_id: string;
  response_url: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { SlackSlashCommand } from "../types/slack-slash-command";

export const slackSlashCommandSchema = z.object({
  token: z.string(),
  team_id: z.string(),
  team_domain: z.string(),
  channel_id: z.string(),
  channel_name: z.string(),
  user_id: z.string(),
  user_name: z.string(),
  command: z.string(),
  text: z.string(),
  trigger_id: z.string(),
  response_url: z.string(),
}) satisfies z.ZodType<SlackSlashCommand>;

export type { SlackSlashCommand } from "../types/slack-slash-command";
```

#### Examples

```typescript
// Source: https://api.slack.com/interactivity/slash-commands#app_command_handling
// Captured: 2026-05
import type { SlackSlashCommand } from "../types/slack-slash-command";
import { slackIds } from "./shared/slack.examples";

const deploy = {
  token: "legacy-verification-token",
  team_id: slackIds.team,
  team_domain: "opentypes",
  channel_id: slackIds.channel,
  channel_name: "deployments",
  user_id: slackIds.user,
  user_name: "marco",
  command: "/deploy",
  text: "production api",
  trigger_id: "13345224609.738474920.8088930838d88f008e0",
  response_url: "https://hooks.slack.com/commands/T12345678/1234/abcdef",
} as const satisfies SlackSlashCommand;

export const slackSlashCommandExamples = {
  deploy,
  emptyText: { ...deploy, text: "" } satisfies SlackSlashCommand,
  help: { ...deploy, command: "/help", text: "" } satisfies SlackSlashCommand,
  remind: {
    ...deploy,
    command: "/remind",
    text: 'me to deploy in 1 hour',
  } satisfies SlackSlashCommand,
} as const;
```

### Social Media Post

- Name: `social-media-post`
- Categories: social
- Description: Social media post with author, content, media attachments, and engagement metrics.
- Install (types only): `npx shadcn add @open-types/social-media-post`
- Install (with Zod): `npx shadcn add @open-types/social-media-post-zod`
- Install (with examples): `npx shadcn add @open-types/social-media-post-examples`
- Detail page: https://open-types.dev/types/social-media-post
- Markdown: https://open-types.dev/types/social-media-post.md

#### Types

```typescript
export type SocialMediaAttachmentType = "image" | "video" | "gif" | "link";

export interface SocialMediaAttachment {
  type: SocialMediaAttachmentType;
  url: string;
  alt?: string;
  width?: number;
  height?: number;
  thumbnail_url?: string;
}

export interface SocialMediaAuthor {
  id: string;
  username: string;
  display_name: string;
  avatar_url?: string;
  verified?: boolean;
}

export interface SocialMediaPost {
  id: string;
  author: SocialMediaAuthor;
  content: string;
  created_at: string;
  likes?: number;
  reposts?: number;
  replies?: number;
  media?: SocialMediaAttachment[];
  url?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  SocialMediaAttachment,
  SocialMediaAttachmentType,
  SocialMediaAuthor,
  SocialMediaPost,
} from "../types/social-media-post";

export const socialMediaAttachmentTypeSchema = z.enum(["image", "video", "gif", "link"]) satisfies z.ZodType<SocialMediaAttachmentType>;

export const socialMediaAttachmentSchema = z.object({
  type: socialMediaAttachmentTypeSchema,
  url: z.url({ error: "Attachment URL must be a valid URL" }),
  alt: z.string().optional(),
  width: z.number().int({ error: "Width must be a whole number" }).min(0, {
    error: "Width cannot be negative",
  }).optional(),
  height: z.number().int({ error: "Height must be a whole number" }).min(0, {
    error: "Height cannot be negative",
  }).optional(),
  thumbnail_url: z.url({ error: "Thumbnail URL must be a valid URL" }).optional(),
}) satisfies z.ZodType<SocialMediaAttachment>;

export const socialMediaAuthorSchema = z.object({
  id: z.string().min(1, { error: "Author id is required" }),
  username: z.string().min(1, { error: "Username is required" }),
  display_name: z.string().min(1, { error: "Display name is required" }),
  avatar_url: z.url({ error: "Avatar URL must be a valid URL" }).optional(),
  verified: z.boolean().optional(),
}) satisfies z.ZodType<SocialMediaAuthor>;

export const socialMediaPostSchema = z.object({
  id: z.string().min(1, { error: "Post id is required" }),
  author: socialMediaAuthorSchema,
  content: z.string().min(1, { error: "Content is required" }),
  created_at: z.string().min(1, { error: "Created at is required" }),
  likes: z.number().int({ error: "Likes must be a whole number" }).min(0, {
    error: "Likes cannot be negative",
  }).optional(),
  reposts: z.number().int({ error: "Reposts must be a whole number" }).min(0, {
    error: "Reposts cannot be negative",
  }).optional(),
  replies: z.number().int({ error: "Replies must be a whole number" }).min(0, {
    error: "Replies cannot be negative",
  }).optional(),
  media: z.array(socialMediaAttachmentSchema).optional(),
  url: z.url({ error: "Post URL must be a valid URL" }).optional(),
}) satisfies z.ZodType<SocialMediaPost>;

export type {
  SocialMediaAttachment,
  SocialMediaAttachmentType,
  SocialMediaAuthor,
  SocialMediaPost,
} from "../types/social-media-post";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after Twitter/X, Bluesky, and Mastodon post shapes
import type {
  SocialMediaAttachmentType,
  SocialMediaAttachment,
  SocialMediaAuthor,
  SocialMediaPost,
} from "../types/social-media-post";

export const socialMediaAttachmentTypeExamples = {
  image: "image",
  video: "video",
  gif: "gif",
  link: "link",
} as const satisfies Record<string, SocialMediaAttachmentType>;

const imageAttachment = {
  type: "image",
  url: "https://cdn.example.com/images/photo.jpg",
  alt: "A sunset over the city skyline.",
  width: 1600,
  height: 900,
  thumbnail_url: "https://cdn.example.com/images/photo-thumb.jpg",
} as const satisfies SocialMediaAttachment;

const videoAttachment = {
  type: "video",
  url: "https://cdn.example.com/videos/demo.mp4",
  width: 1920,
  height: 1080,
  thumbnail_url: "https://cdn.example.com/videos/demo-poster.jpg",
} as const satisfies SocialMediaAttachment;

export const socialMediaAttachmentExamples = {
  image: imageAttachment,
  video: videoAttachment,
  gif: {
    type: "gif",
    url: "https://cdn.example.com/gifs/celebrate.gif",
    width: 480,
    height: 270,
  } satisfies SocialMediaAttachment,
  link: {
    type: "link",
    url: "https://open-types.dev/blog/why",
    thumbnail_url: "https://open-types.dev/og-image.png",
  } satisfies SocialMediaAttachment,
} as const;

const author = {
  id: "user_321",
  username: "open_types",
  display_name: "OpenTypes",
  avatar_url: "https://cdn.example.com/avatars/open-types.png",
  verified: true,
} as const satisfies SocialMediaAuthor;

export const socialMediaAuthorExamples = {
  verified: author,
  unverified: {
    id: "user_555",
    username: "newcomer",
    display_name: "Newcomer",
  } satisfies SocialMediaAuthor,
  noAvatar: {
    id: "user_666",
    username: "spartan",
    display_name: "Spartan",
    verified: false,
  } satisfies SocialMediaAuthor,
} as const;

const textPost = {
  id: "post_01HABCDEF0123456789ABCDE",
  author,
  content: "Excited to announce real-payload test fixtures for every schema in the registry.",
  created_at: "2026-05-16T18:30:00Z",
  likes: 482,
  reposts: 79,
  replies: 12,
  url: "https://example.com/open_types/posts/01HABCDEF",
} as const satisfies SocialMediaPost;

export const socialMediaPostExamples = {
  text: textPost,
  withImage: {
    ...textPost,
    id: "post_image_002",
    content: "Sunset photo of the day:",
    media: [imageAttachment],
  } satisfies SocialMediaPost,
  withVideo: {
    ...textPost,
    id: "post_video_003",
    content: "Watch the new release demo:",
    media: [videoAttachment],
  } satisfies SocialMediaPost,
  threadParent: {
    ...textPost,
    id: "post_thread_004",
    content: "1/ A thread about real payload testing:",
    likes: 1024,
    reposts: 320,
    replies: 88,
  } satisfies SocialMediaPost,
  minimal: {
    id: "post_min_005",
    author,
    content: "hello",
    created_at: "2026-05-16T18:30:00Z",
  } satisfies SocialMediaPost,
} as const;
```

### Stripe Charge

- Name: `stripe-charge`
- Categories: stripe
- Description: Stripe Charge with amount, payment status, refund state, and receipt.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-charge`
- Install (with Zod): `npx shadcn add @open-types/stripe-charge-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-charge-examples`
- Detail page: https://open-types.dev/types/stripe-charge
- Markdown: https://open-types.dev/types/stripe-charge.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export type StripeChargeStatus = "succeeded" | "pending" | "failed";

export interface StripeCharge {
  id: string;
  object: "charge";
  amount: number;
  currency: string;
  customer: string | null;
  description: string | null;
  paid: boolean;
  refunded: boolean;
  status: StripeChargeStatus;
  payment_intent: string | null;
  receipt_url: string | null;
  metadata: StripeMetadata;
  created: number;
  livemode: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { StripeCharge, StripeChargeStatus } from "../types/stripe-charge";
import { stripeMetadataSchema } from "./stripe-shared";

export const stripeChargeStatusSchema = z.enum([
  "succeeded",
  "pending",
  "failed",
]) satisfies z.ZodType<StripeChargeStatus>;

export const stripeChargeSchema = z.object({
  id: z.string(),
  object: z.literal("charge"),
  amount: z.number(),
  currency: z.string(),
  customer: z.string().nullable(),
  description: z.string().nullable(),
  paid: z.boolean(),
  refunded: z.boolean(),
  status: stripeChargeStatusSchema,
  payment_intent: z.string().nullable(),
  receipt_url: z.string().nullable(),
  metadata: stripeMetadataSchema,
  created: z.number(),
  livemode: z.boolean(),
}) satisfies z.ZodType<StripeCharge>;

export type { StripeCharge, StripeChargeStatus } from "../types/stripe-charge";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/charges/object
// Captured: 2026-05
import type {
  StripeCharge,
  StripeChargeStatus,
} from "../types/stripe-charge";
import { stripeIds } from "./shared/stripe.examples";

const succeeded = {
  id: stripeIds.charge,
  object: "charge",
  amount: 2000,
  currency: "usd",
  customer: stripeIds.customer,
  description: "Charge for Order #1001",
  paid: true,
  refunded: false,
  status: "succeeded",
  payment_intent: stripeIds.paymentIntent,
  receipt_url: "https://pay.stripe.com/receipts/acct_123/ch_123/rcpt_123",
  metadata: { order_id: "ord_1001" },
  created: 1712948400,
  livemode: false,
} as const satisfies StripeCharge;

export const stripeChargeStatusExamples = {
  succeeded: "succeeded",
  pending: "pending",
  failed: "failed",
} as const satisfies Record<string, StripeChargeStatus>;

export const stripeChargeExamples = {
  succeeded,
  failed: {
    ...succeeded,
    id: "ch_3Ot91g2eZvKYlo2Cfail00001",
    status: "failed",
    paid: false,
    receipt_url: null,
  } satisfies StripeCharge,
  pending: {
    ...succeeded,
    id: "ch_3Ot91g2eZvKYlo2Cpend00001",
    status: "pending",
    paid: false,
  } satisfies StripeCharge,
  refunded: {
    ...succeeded,
    id: "ch_3Ot91g2eZvKYlo2Crfd000001",
    refunded: true,
  } satisfies StripeCharge,
  guest: {
    ...succeeded,
    id: "ch_3Ot91g2eZvKYlo2Cguest0001",
    customer: null,
    description: null,
    payment_intent: null,
  } satisfies StripeCharge,
} as const;
```

### Stripe Checkout Session

- Name: `stripe-checkout-session`
- Categories: stripe
- Description: Stripe Checkout Session with payment status, mode, and customer details.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-checkout-session`
- Install (with Zod): `npx shadcn add @open-types/stripe-checkout-session-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-checkout-session-examples`
- Detail page: https://open-types.dev/types/stripe-checkout-session
- Markdown: https://open-types.dev/types/stripe-checkout-session.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export type StripeCheckoutSessionStatus = "open" | "complete" | "expired";

export type StripePaymentStatus = "paid" | "unpaid" | "no_payment_required";

export type StripeCheckoutSessionMode = "payment" | "setup" | "subscription";

export interface StripeCheckoutSession {
  id: string;
  object: "checkout.session";
  amount_total: number | null;
  currency: string | null;
  customer: string | null;
  customer_email: string | null;
  mode: StripeCheckoutSessionMode;
  payment_intent: string | null;
  payment_status: StripePaymentStatus;
  status: StripeCheckoutSessionStatus | null;
  success_url: string | null;
  cancel_url: string | null;
  url: string | null;
  metadata: StripeMetadata;
  created: number;
  livemode: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  StripeCheckoutSession,
  StripeCheckoutSessionMode,
  StripeCheckoutSessionStatus,
  StripePaymentStatus,
} from "../types/stripe-checkout-session";
import { stripeMetadataSchema } from "./stripe-shared";

export const stripeCheckoutSessionStatusSchema = z.enum([
  "open",
  "complete",
  "expired",
]) satisfies z.ZodType<StripeCheckoutSessionStatus>;

export const stripePaymentStatusSchema = z.enum([
  "paid",
  "unpaid",
  "no_payment_required",
]) satisfies z.ZodType<StripePaymentStatus>;

export const stripeCheckoutSessionModeSchema = z.enum([
  "payment",
  "setup",
  "subscription",
]) satisfies z.ZodType<StripeCheckoutSessionMode>;

export const stripeCheckoutSessionSchema = z.object({
  id: z.string(),
  object: z.literal("checkout.session"),
  amount_total: z.number().nullable(),
  currency: z.string().nullable(),
  customer: z.string().nullable(),
  customer_email: z.string().nullable(),
  mode: stripeCheckoutSessionModeSchema,
  payment_intent: z.string().nullable(),
  payment_status: stripePaymentStatusSchema,
  status: stripeCheckoutSessionStatusSchema.nullable(),
  success_url: z.string().nullable(),
  cancel_url: z.string().nullable(),
  url: z.string().nullable(),
  metadata: stripeMetadataSchema,
  created: z.number(),
  livemode: z.boolean(),
}) satisfies z.ZodType<StripeCheckoutSession>;

export type {
  StripeCheckoutSession,
  StripeCheckoutSessionMode,
  StripeCheckoutSessionStatus,
  StripePaymentStatus,
} from "../types/stripe-checkout-session";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/checkout/sessions/object
// Captured: 2026-05
import type {
  StripeCheckoutSession,
  StripeCheckoutSessionStatus,
  StripeCheckoutSessionMode,
  StripePaymentStatus,
} from "../types/stripe-checkout-session";
import { stripeIds } from "./shared/stripe.examples";

const completedPayment = {
  id: stripeIds.checkoutSession,
  object: "checkout.session",
  amount_total: 5000,
  currency: "usd",
  customer: stripeIds.customer,
  customer_email: "customer@example.com",
  mode: "payment",
  payment_intent: stripeIds.paymentIntent,
  payment_status: "paid",
  status: "complete",
  success_url: "https://example.com/success",
  cancel_url: "https://example.com/cancel",
  url: null,
  metadata: { cart_id: "cart_789" },
  created: 1712948400,
  livemode: false,
} as const satisfies StripeCheckoutSession;

export const stripeCheckoutSessionStatusExamples = {
  open: "open",
  complete: "complete",
  expired: "expired",
} as const satisfies Record<string, StripeCheckoutSessionStatus>;

export const stripeCheckoutSessionModeExamples = {
  payment: "payment",
  setup: "setup",
  subscription: "subscription",
} as const satisfies Record<string, StripeCheckoutSessionMode>;

export const stripePaymentStatusExamples = {
  paid: "paid",
  unpaid: "unpaid",
  noPaymentRequired: "no_payment_required",
} as const satisfies Record<string, StripePaymentStatus>;

export const stripeCheckoutSessionExamples = {
  completedPayment,
  openSubscription: {
    ...completedPayment,
    id: "cs_test_open_subscription_001",
    mode: "subscription",
    payment_intent: null,
    payment_status: "unpaid",
    status: "open",
    amount_total: null,
    currency: null,
    url: "https://checkout.stripe.com/c/pay/cs_test_open_subscription_001",
  } satisfies StripeCheckoutSession,
  expiredSession: {
    ...completedPayment,
    id: "cs_test_expired_session_002",
    status: "expired",
    payment_status: "unpaid",
    payment_intent: null,
    url: null,
  } satisfies StripeCheckoutSession,
  setupMode: {
    ...completedPayment,
    id: "cs_test_setup_mode_003",
    mode: "setup",
    payment_intent: null,
    payment_status: "no_payment_required",
    amount_total: null,
  } satisfies StripeCheckoutSession,
  noStatus: {
    ...completedPayment,
    status: null,
    success_url: null,
    cancel_url: null,
  } satisfies StripeCheckoutSession,
} as const;
```

### Stripe Customer

- Name: `stripe-customer`
- Categories: stripe
- Description: Stripe Customer with email, address, phone, and metadata.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-customer`
- Install (with Zod): `npx shadcn add @open-types/stripe-customer-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-customer-examples`
- Detail page: https://open-types.dev/types/stripe-customer
- Markdown: https://open-types.dev/types/stripe-customer.md

#### Types

```typescript
import type { StripeAddress, StripeMetadata } from "./stripe-shared";

export interface StripeCustomer {
  id: string;
  object: "customer";
  email: string | null;
  name: string | null;
  phone: string | null;
  address: StripeAddress | null;
  description: string | null;
  metadata: StripeMetadata;
  created: number;
  livemode: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { StripeCustomer } from "../types/stripe-customer";
import {
  stripeAddressSchema,
  stripeMetadataSchema,
} from "./stripe-shared";

export const stripeCustomerSchema = z.object({
  id: z.string(),
  object: z.literal("customer"),
  email: z.string().nullable(),
  name: z.string().nullable(),
  phone: z.string().nullable(),
  address: stripeAddressSchema.nullable(),
  description: z.string().nullable(),
  metadata: stripeMetadataSchema,
  created: z.number(),
  livemode: z.boolean(),
}) satisfies z.ZodType<StripeCustomer>;

export type { StripeCustomer } from "../types/stripe-customer";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/customers/object
// Captured: 2026-05
import type { StripeCustomer } from "../types/stripe-customer";
import { stripeIds, stripeAddressSF } from "./shared/stripe.examples";

const full = {
  id: stripeIds.customer,
  object: "customer",
  email: "customer@example.com",
  name: "Jenny Rosen",
  phone: "+14155550123",
  address: stripeAddressSF,
  description: "VIP customer",
  metadata: { crm_id: "crm_123" },
  created: 1712948400,
  livemode: false,
} as const satisfies StripeCustomer;

export const stripeCustomerExamples = {
  full,
  minimal: {
    ...full,
    id: "cus_Q1w2E3r4T5y6min",
    email: null,
    name: null,
    phone: null,
    address: null,
    description: null,
    metadata: {},
  } satisfies StripeCustomer,
  livemode: { ...full, livemode: true } satisfies StripeCustomer,
  emailOnly: {
    ...full,
    id: "cus_Q1w2E3r4T5y6email",
    name: null,
    phone: null,
    address: null,
    description: null,
  } satisfies StripeCustomer,
} as const;
```

### Stripe Event

- Name: `stripe-event`
- Categories: stripe
- Description: Stripe webhook event wrapper with versioned data object and request tracking.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-event`
- Install (with Zod): `npx shadcn add @open-types/stripe-event-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-event-examples`
- Detail page: https://open-types.dev/types/stripe-event
- Markdown: https://open-types.dev/types/stripe-event.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export interface StripeEventData {
  object: Record<string, unknown>;
  previous_attributes?: Record<string, unknown>;
}

export interface StripeEventRequest {
  id: string | null;
  idempotency_key: string | null;
}

export interface StripeEvent {
  id: string;
  object: "event";
  api_version: string | null;
  created: number;
  data: StripeEventData;
  livemode: boolean;
  pending_webhooks: number;
  request: StripeEventRequest | null;
  type: string;
}

export type { StripeMetadata };
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  StripeEvent,
  StripeEventData,
  StripeEventRequest,
} from "../types/stripe-event";

export const stripeEventDataSchema = z.object({
  object: z.record(z.string(), z.unknown()),
  previous_attributes: z.record(z.string(), z.unknown()).optional(),
}) satisfies z.ZodType<StripeEventData>;

export const stripeEventRequestSchema = z.object({
  id: z.string().nullable(),
  idempotency_key: z.string().nullable(),
}) satisfies z.ZodType<StripeEventRequest>;

export const stripeEventSchema = z.object({
  id: z.string(),
  object: z.literal("event"),
  api_version: z.string().nullable(),
  created: z.number(),
  data: stripeEventDataSchema,
  livemode: z.boolean(),
  pending_webhooks: z.number(),
  request: stripeEventRequestSchema.nullable(),
  type: z.string(),
}) satisfies z.ZodType<StripeEvent>;

export type {
  StripeEvent,
  StripeEventData,
  StripeEventRequest,
} from "../types/stripe-event";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/events/object
// Captured: 2026-05
import type {
  StripeEventData,
  StripeEventRequest,
  StripeEvent,
} from "../types/stripe-event";
import { stripeIds } from "./shared/stripe.examples";

const paymentIntentObject = {
  id: stripeIds.paymentIntent,
  object: "payment_intent",
  amount: 2000,
  currency: "usd",
  metadata: { order_id: "ord_123" },
} as const;

export const stripeEventDataExamples = {
  withPrevious: {
    object: paymentIntentObject,
    previous_attributes: { status: "requires_payment_method" },
  } satisfies StripeEventData,
  withoutPrevious: { object: paymentIntentObject } satisfies StripeEventData,
  emptyPrevious: {
    object: paymentIntentObject,
    previous_attributes: {},
  } satisfies StripeEventData,
} as const;

export const stripeEventRequestExamples = {
  full: {
    id: stripeIds.request,
    idempotency_key: "stripe-demo-key-123",
  } satisfies StripeEventRequest,
  bothNull: { id: null, idempotency_key: null } satisfies StripeEventRequest,
  noIdempotencyKey: { id: stripeIds.request, idempotency_key: null } satisfies StripeEventRequest,
} as const;

const baseEvent = {
  id: stripeIds.event,
  object: "event",
  api_version: "2023-10-16",
  created: 1712948400,
  data: stripeEventDataExamples.withPrevious,
  livemode: false,
  pending_webhooks: 2,
  request: stripeEventRequestExamples.full,
  type: "payment_intent.succeeded",
} as const satisfies StripeEvent;

export const stripeEventExamples = {
  paymentIntentSucceeded: baseEvent,
  paymentIntentFailed: {
    ...baseEvent,
    id: "evt_1Ot8q12eZvKYlo2Cfail0001",
    type: "payment_intent.payment_failed",
    data: {
      object: { ...paymentIntentObject, status: "requires_payment_method" },
      previous_attributes: { status: "processing" },
    },
  } satisfies StripeEvent,
  invoicePaid: {
    ...baseEvent,
    id: "evt_1Ot8q12eZvKYlo2Cinv0002",
    type: "invoice.paid",
    data: {
      object: {
        id: stripeIds.invoice,
        object: "invoice",
        status: "paid",
        amount_paid: 2500,
      },
    },
    request: stripeEventRequestExamples.bothNull,
  } satisfies StripeEvent,
  customerCreated: {
    ...baseEvent,
    id: "evt_1Ot8q12eZvKYlo2Ccus0003",
    type: "customer.created",
    request: null,
    api_version: null,
    livemode: true,
    pending_webhooks: 0,
    data: { object: { id: stripeIds.customer, object: "customer" } },
  } satisfies StripeEvent,
} as const;
```

### Stripe Invoice

- Name: `stripe-invoice`
- Categories: stripe
- Description: Stripe Invoice with amounts, payment status, and billing period tracking.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-invoice`
- Install (with Zod): `npx shadcn add @open-types/stripe-invoice-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-invoice-examples`
- Detail page: https://open-types.dev/types/stripe-invoice
- Markdown: https://open-types.dev/types/stripe-invoice.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export type StripeInvoiceStatus = "draft" | "open" | "paid" | "uncollectible" | "void";

export interface StripeInvoice {
  id: string;
  object: "invoice";
  customer: string | null;
  subscription: string | null;
  status: StripeInvoiceStatus | null;
  amount_due: number;
  amount_paid: number;
  amount_remaining: number;
  currency: string;
  due_date: number | null;
  paid: boolean;
  period_start: number;
  period_end: number;
  hosted_invoice_url: string | null;
  invoice_pdf: string | null;
  metadata: StripeMetadata;
  created: number;
  livemode: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { StripeInvoice, StripeInvoiceStatus } from "../types/stripe-invoice";
import { stripeMetadataSchema } from "./stripe-shared";

export const stripeInvoiceStatusSchema = z.enum([
  "draft",
  "open",
  "paid",
  "uncollectible",
  "void",
]) satisfies z.ZodType<StripeInvoiceStatus>;

export const stripeInvoiceSchema = z.object({
  id: z.string(),
  object: z.literal("invoice"),
  customer: z.string().nullable(),
  subscription: z.string().nullable(),
  status: stripeInvoiceStatusSchema.nullable(),
  amount_due: z.number(),
  amount_paid: z.number(),
  amount_remaining: z.number(),
  currency: z.string(),
  due_date: z.number().nullable(),
  paid: z.boolean(),
  period_start: z.number(),
  period_end: z.number(),
  hosted_invoice_url: z.string().nullable(),
  invoice_pdf: z.string().nullable(),
  metadata: stripeMetadataSchema,
  created: z.number(),
  livemode: z.boolean(),
}) satisfies z.ZodType<StripeInvoice>;

export type { StripeInvoice, StripeInvoiceStatus } from "../types/stripe-invoice";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/invoices/object
// Captured: 2026-05
import type {
  StripeInvoice,
  StripeInvoiceStatus,
} from "../types/stripe-invoice";
import { stripeIds } from "./shared/stripe.examples";

const open = {
  id: stripeIds.invoice,
  object: "invoice",
  customer: stripeIds.customer,
  subscription: stripeIds.subscription,
  status: "open",
  amount_due: 2500,
  amount_paid: 0,
  amount_remaining: 2500,
  currency: "usd",
  due_date: 1713034800,
  paid: false,
  period_start: 1712948400,
  period_end: 1715626800,
  hosted_invoice_url: "https://invoice.stripe.com/i/acct_123/test_456",
  invoice_pdf: "https://pay.stripe.com/invoice/acct_123/pdf_456",
  metadata: { billing_cycle: "april-2024" },
  created: 1712948400,
  livemode: false,
} as const satisfies StripeInvoice;

export const stripeInvoiceStatusExamples = {
  draft: "draft",
  open: "open",
  paid: "paid",
  uncollectible: "uncollectible",
  void: "void",
} as const satisfies Record<string, StripeInvoiceStatus>;

export const stripeInvoiceExamples = {
  open,
  paid: {
    ...open,
    id: "in_1Ot8xP2eZvKYlo2Cpaid23456",
    status: "paid",
    amount_paid: 2500,
    amount_remaining: 0,
    paid: true,
    due_date: null,
  } satisfies StripeInvoice,
  draft: {
    ...open,
    id: "in_1Ot8xP2eZvKYlo2Cdraft0001",
    status: "draft",
    hosted_invoice_url: null,
    invoice_pdf: null,
  } satisfies StripeInvoice,
  uncollectible: {
    ...open,
    id: "in_1Ot8xP2eZvKYlo2Cuncl00001",
    status: "uncollectible",
  } satisfies StripeInvoice,
  voided: {
    ...open,
    id: "in_1Ot8xP2eZvKYlo2Cvoid00001",
    status: "void",
    paid: false,
    amount_remaining: 0,
  } satisfies StripeInvoice,
  oneOff: {
    ...open,
    id: "in_1Ot8xP2eZvKYlo2Coneoff001",
    customer: null,
    subscription: null,
    status: null,
  } satisfies StripeInvoice,
} as const;
```

### Stripe Payment Intent

- Name: `stripe-payment-intent`
- Categories: stripe
- Description: Stripe PaymentIntent with amount, currency, status lifecycle, and metadata.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-payment-intent`
- Install (with Zod): `npx shadcn add @open-types/stripe-payment-intent-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-payment-intent-examples`
- Detail page: https://open-types.dev/types/stripe-payment-intent
- Markdown: https://open-types.dev/types/stripe-payment-intent.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export type StripePaymentIntentStatus =
  | "requires_payment_method"
  | "requires_confirmation"
  | "requires_action"
  | "processing"
  | "requires_capture"
  | "canceled"
  | "succeeded";

export interface StripePaymentIntent {
  id: string;
  object: "payment_intent";
  amount: number;
  amount_received: number;
  currency: string;
  status: StripePaymentIntentStatus;
  client_secret: string | null;
  payment_method: string | null;
  description: string | null;
  metadata: StripeMetadata;
  created: number;
  livemode: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  StripePaymentIntent,
  StripePaymentIntentStatus,
} from "../types/stripe-payment-intent";
import { stripeMetadataSchema } from "./stripe-shared";

export const stripePaymentIntentStatusSchema = z.enum([
  "requires_payment_method",
  "requires_confirmation",
  "requires_action",
  "processing",
  "requires_capture",
  "canceled",
  "succeeded",
]) satisfies z.ZodType<StripePaymentIntentStatus>;

export const stripePaymentIntentSchema = z.object({
  id: z.string(),
  object: z.literal("payment_intent"),
  amount: z.number(),
  amount_received: z.number(),
  currency: z.string(),
  status: stripePaymentIntentStatusSchema,
  client_secret: z.string().nullable(),
  payment_method: z.string().nullable(),
  description: z.string().nullable(),
  metadata: stripeMetadataSchema,
  created: z.number(),
  livemode: z.boolean(),
}) satisfies z.ZodType<StripePaymentIntent>;

export type {
  StripePaymentIntent,
  StripePaymentIntentStatus,
} from "../types/stripe-payment-intent";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/payment_intents/object
// Captured: 2026-05
import type {
  StripePaymentIntent,
  StripePaymentIntentStatus,
} from "../types/stripe-payment-intent";
import { stripeIds } from "./shared/stripe.examples";

const succeeded = {
  id: stripeIds.paymentIntent,
  object: "payment_intent",
  amount: 2000,
  amount_received: 2000,
  currency: "usd",
  status: "succeeded",
  client_secret: `${stripeIds.paymentIntent}_secret_987`,
  payment_method: stripeIds.paymentMethod,
  description: "Order #1001",
  metadata: { order_id: "ord_1001" },
  created: 1712948400,
  livemode: false,
} as const satisfies StripePaymentIntent;

export const stripePaymentIntentStatusExamples = {
  requiresPaymentMethod: "requires_payment_method",
  requiresConfirmation: "requires_confirmation",
  requiresAction: "requires_action",
  processing: "processing",
  requiresCapture: "requires_capture",
  canceled: "canceled",
  succeeded: "succeeded",
} as const satisfies Record<string, StripePaymentIntentStatus>;

export const stripePaymentIntentExamples = {
  succeeded,
  requiresPaymentMethod: {
    ...succeeded,
    id: "pi_3Ot8pL2eZvKYlo2C0req5678",
    status: "requires_payment_method",
    amount_received: 0,
    client_secret: null,
    payment_method: null,
    description: null,
  } satisfies StripePaymentIntent,
  requiresAction: {
    ...succeeded,
    id: "pi_3Ot8pL2eZvKYlo2C0act9012",
    status: "requires_action",
    amount_received: 0,
  } satisfies StripePaymentIntent,
  processing: {
    ...succeeded,
    id: "pi_3Ot8pL2eZvKYlo2C0prc3456",
    status: "processing",
    amount_received: 0,
  } satisfies StripePaymentIntent,
  livemode: { ...succeeded, livemode: true } satisfies StripePaymentIntent,
  emptyMetadata: { ...succeeded, metadata: {} } satisfies StripePaymentIntent,
} as const;
```

### Stripe Price

- Name: `stripe-price`
- Categories: stripe
- Description: Stripe Price with unit amount, currency, recurring interval, and product link.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-price`
- Install (with Zod): `npx shadcn add @open-types/stripe-price-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-price-examples`
- Detail page: https://open-types.dev/types/stripe-price
- Markdown: https://open-types.dev/types/stripe-price.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export type StripePriceType = "one_time" | "recurring";

export type StripeRecurringInterval = "day" | "week" | "month" | "year";

export interface StripeRecurring {
  interval: StripeRecurringInterval;
  interval_count: number;
}

export interface StripePrice {
  id: string;
  object: "price";
  active: boolean;
  currency: string;
  unit_amount: number | null;
  type: StripePriceType;
  recurring: StripeRecurring | null;
  product: string;
  metadata: StripeMetadata;
  created: number;
  livemode: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  StripePrice,
  StripePriceType,
  StripeRecurring,
  StripeRecurringInterval,
} from "../types/stripe-price";
import { stripeMetadataSchema } from "./stripe-shared";

export const stripePriceTypeSchema = z.enum([
  "one_time",
  "recurring",
]) satisfies z.ZodType<StripePriceType>;

export const stripeRecurringIntervalSchema = z.enum([
  "day",
  "week",
  "month",
  "year",
]) satisfies z.ZodType<StripeRecurringInterval>;

export const stripeRecurringSchema = z.object({
  interval: stripeRecurringIntervalSchema,
  interval_count: z.number(),
}) satisfies z.ZodType<StripeRecurring>;

export const stripePriceSchema = z.object({
  id: z.string(),
  object: z.literal("price"),
  active: z.boolean(),
  currency: z.string(),
  unit_amount: z.number().nullable(),
  type: stripePriceTypeSchema,
  recurring: stripeRecurringSchema.nullable(),
  product: z.string(),
  metadata: stripeMetadataSchema,
  created: z.number(),
  livemode: z.boolean(),
}) satisfies z.ZodType<StripePrice>;

export type {
  StripePrice,
  StripePriceType,
  StripeRecurring,
  StripeRecurringInterval,
} from "../types/stripe-price";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/prices/object
// Captured: 2026-05
import type {
  StripeRecurring,
  StripeRecurringInterval,
  StripePrice,
  StripePriceType,
} from "../types/stripe-price";
import { stripeIds } from "./shared/stripe.examples";

const monthly = {
  interval: "month",
  interval_count: 1,
} as const satisfies StripeRecurring;

export const stripeRecurringIntervalExamples = {
  day: "day",
  week: "week",
  month: "month",
  year: "year",
} as const satisfies Record<string, StripeRecurringInterval>;

export const stripeRecurringExamples = {
  monthly,
  annual: { interval: "year", interval_count: 1 } satisfies StripeRecurring,
  quarterly: { interval: "month", interval_count: 3 } satisfies StripeRecurring,
  weekly: { interval: "week", interval_count: 1 } satisfies StripeRecurring,
  daily: { interval: "day", interval_count: 1 } satisfies StripeRecurring,
} as const;

export const stripePriceTypeExamples = {
  oneTime: "one_time",
  recurring: "recurring",
} as const satisfies Record<string, StripePriceType>;

const recurringPro = {
  id: stripeIds.price,
  object: "price",
  active: true,
  currency: "usd",
  unit_amount: 2900,
  type: "recurring",
  recurring: monthly,
  product: stripeIds.product,
  metadata: { tier: "pro" },
  created: 1712948400,
  livemode: false,
} as const satisfies StripePrice;

export const stripePriceExamples = {
  recurringPro,
  oneTime: {
    ...recurringPro,
    id: "price_1Ot90A2eZvKYlo2Conetime01",
    type: "one_time",
    recurring: null,
  } satisfies StripePrice,
  inactive: { ...recurringPro, active: false } satisfies StripePrice,
  freeTier: {
    ...recurringPro,
    id: "price_1Ot90A2eZvKYlo2Cfree00001",
    unit_amount: null,
  } satisfies StripePrice,
  annual: {
    ...recurringPro,
    id: "price_1Ot90A2eZvKYlo2Cannual001",
    unit_amount: 29000,
    recurring: { interval: "year", interval_count: 1 },
  } satisfies StripePrice,
} as const;
```

### Stripe Refund

- Name: `stripe-refund`
- Categories: stripe
- Description: Stripe Refund with amount, status, reason, and linked charge/payment intent.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-refund`
- Install (with Zod): `npx shadcn add @open-types/stripe-refund-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-refund-examples`
- Detail page: https://open-types.dev/types/stripe-refund
- Markdown: https://open-types.dev/types/stripe-refund.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export type StripeRefundStatus = "succeeded" | "pending" | "failed" | "canceled";

export interface StripeRefund {
  id: string;
  object: "refund";
  amount: number;
  charge: string | null;
  currency: string;
  payment_intent: string | null;
  reason: string | null;
  status: StripeRefundStatus;
  metadata: StripeMetadata;
  created: number;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { StripeRefund, StripeRefundStatus } from "../types/stripe-refund";
import { stripeMetadataSchema } from "./stripe-shared";

export const stripeRefundStatusSchema = z.enum([
  "succeeded",
  "pending",
  "failed",
  "canceled",
]) satisfies z.ZodType<StripeRefundStatus>;

export const stripeRefundSchema = z.object({
  id: z.string(),
  object: z.literal("refund"),
  amount: z.number(),
  charge: z.string().nullable(),
  currency: z.string(),
  payment_intent: z.string().nullable(),
  reason: z.string().nullable(),
  status: stripeRefundStatusSchema,
  metadata: stripeMetadataSchema,
  created: z.number(),
}) satisfies z.ZodType<StripeRefund>;

export type { StripeRefund, StripeRefundStatus } from "../types/stripe-refund";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/refunds/object
// Captured: 2026-05
import type {
  StripeRefund,
  StripeRefundStatus,
} from "../types/stripe-refund";
import { stripeIds } from "./shared/stripe.examples";

const succeeded = {
  id: stripeIds.refund,
  object: "refund",
  amount: 2000,
  charge: stripeIds.charge,
  currency: "usd",
  payment_intent: stripeIds.paymentIntent,
  reason: "requested_by_customer",
  status: "succeeded",
  metadata: { return_id: "ret_789" },
  created: 1712948400,
} as const satisfies StripeRefund;

export const stripeRefundStatusExamples = {
  succeeded: "succeeded",
  pending: "pending",
  failed: "failed",
  canceled: "canceled",
} as const satisfies Record<string, StripeRefundStatus>;

export const stripeRefundExamples = {
  succeeded,
  pending: {
    ...succeeded,
    id: "re_3Ot93K2eZvKYlo2Cpending01",
    status: "pending",
  } satisfies StripeRefund,
  failed: {
    ...succeeded,
    id: "re_3Ot93K2eZvKYlo2Cfailed001",
    status: "failed",
  } satisfies StripeRefund,
  fraudulent: {
    ...succeeded,
    id: "re_3Ot93K2eZvKYlo2Cfraud0001",
    reason: "fraudulent",
  } satisfies StripeRefund,
  duplicate: {
    ...succeeded,
    id: "re_3Ot93K2eZvKYlo2Cdup000001",
    reason: "duplicate",
  } satisfies StripeRefund,
  detached: {
    ...succeeded,
    id: "re_3Ot93K2eZvKYlo2Cdetach001",
    charge: null,
    payment_intent: null,
    reason: null,
  } satisfies StripeRefund,
} as const;
```

### Stripe Shared

- Name: `stripe-shared`
- Categories: stripe
- Description: Common Stripe types: metadata record and address structure.
- Install (types only): `npx shadcn add @open-types/stripe-shared`
- Install (with Zod): `npx shadcn add @open-types/stripe-shared-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-shared-examples`
- Detail page: https://open-types.dev/types/stripe-shared
- Markdown: https://open-types.dev/types/stripe-shared.md

#### Types

```typescript
export type StripeMetadata = Record<string, string>;

export interface StripeAddress {
  line1: string | null;
  line2: string | null;
  city: string | null;
  state: string | null;
  postal_code: string | null;
  country: string | null;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { StripeAddress, StripeMetadata } from "../types/stripe-shared";

export const stripeMetadataSchema = z.record(z.string(), z.string()) satisfies z.ZodType<StripeMetadata>;

export const stripeAddressSchema = z.object({
  line1: z.string().nullable(),
  line2: z.string().nullable(),
  city: z.string().nullable(),
  state: z.string().nullable(),
  postal_code: z.string().nullable(),
  country: z.string().nullable(),
}) satisfies z.ZodType<StripeAddress>;

export type { StripeAddress, StripeMetadata } from "../types/stripe-shared";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/metadata, https://docs.stripe.com/api/customers/object#customer_object-address
// Captured: 2026-05
import type { StripeAddress, StripeMetadata } from "../types/stripe-shared";
import { stripeAddressSF, stripeAddressEmpty } from "./shared/stripe.examples";

export const stripeMetadataExamples = {
  empty: {} satisfies StripeMetadata,
  orderTagging: { order_id: "ord_123", customer_tier: "gold" } satisfies StripeMetadata,
  crmLink: { crm_id: "crm_123", segment: "enterprise" } satisfies StripeMetadata,
} as const;

export const stripeAddressExamples = {
  full: stripeAddressSF,
  allNull: stripeAddressEmpty,
  international: {
    line1: "1 Infinite Loop",
    line2: null,
    city: "Cupertino",
    state: "CA",
    postal_code: "95014",
    country: "US",
  } satisfies StripeAddress,
} as const;
```

### Stripe Subscription

- Name: `stripe-subscription`
- Categories: stripe
- Description: Stripe Subscription with status lifecycle, billing periods, and item details.
- Depends on: `@open-types/stripe-shared`
- Install (types only): `npx shadcn add @open-types/stripe-subscription`
- Install (with Zod): `npx shadcn add @open-types/stripe-subscription-zod`
- Install (with examples): `npx shadcn add @open-types/stripe-subscription-examples`
- Detail page: https://open-types.dev/types/stripe-subscription
- Markdown: https://open-types.dev/types/stripe-subscription.md

#### Types

```typescript
import type { StripeMetadata } from "./stripe-shared";

export type StripeSubscriptionStatus =
  | "incomplete"
  | "incomplete_expired"
  | "trialing"
  | "active"
  | "past_due"
  | "canceled"
  | "unpaid"
  | "paused";

export interface StripeSubscriptionItem {
  id: string;
  object: "subscription_item";
  price: string;
  quantity: number;
}

export interface StripeSubscriptionItems {
  data: StripeSubscriptionItem[];
}

export interface StripeSubscription {
  id: string;
  object: "subscription";
  customer: string;
  status: StripeSubscriptionStatus;
  current_period_start: number;
  current_period_end: number;
  cancel_at_period_end: boolean;
  canceled_at: number | null;
  items: StripeSubscriptionItems;
  metadata: StripeMetadata;
  created: number;
  livemode: boolean;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  StripeSubscription,
  StripeSubscriptionItem,
  StripeSubscriptionItems,
  StripeSubscriptionStatus,
} from "../types/stripe-subscription";
import { stripeMetadataSchema } from "./stripe-shared";

export const stripeSubscriptionStatusSchema = z.enum([
  "incomplete",
  "incomplete_expired",
  "trialing",
  "active",
  "past_due",
  "canceled",
  "unpaid",
  "paused",
]) satisfies z.ZodType<StripeSubscriptionStatus>;

export const stripeSubscriptionItemSchema = z.object({
  id: z.string(),
  object: z.literal("subscription_item"),
  price: z.string(),
  quantity: z.number(),
}) satisfies z.ZodType<StripeSubscriptionItem>;

export const stripeSubscriptionItemsSchema = z.object({
  data: z.array(stripeSubscriptionItemSchema),
}) satisfies z.ZodType<StripeSubscriptionItems>;

export const stripeSubscriptionSchema = z.object({
  id: z.string(),
  object: z.literal("subscription"),
  customer: z.string(),
  status: stripeSubscriptionStatusSchema,
  current_period_start: z.number(),
  current_period_end: z.number(),
  cancel_at_period_end: z.boolean(),
  canceled_at: z.number().nullable(),
  items: stripeSubscriptionItemsSchema,
  metadata: stripeMetadataSchema,
  created: z.number(),
  livemode: z.boolean(),
}) satisfies z.ZodType<StripeSubscription>;

export type {
  StripeSubscription,
  StripeSubscriptionItem,
  StripeSubscriptionItems,
  StripeSubscriptionStatus,
} from "../types/stripe-subscription";
```

#### Examples

```typescript
// Source: https://docs.stripe.com/api/subscriptions/object
// Captured: 2026-05
import type {
  StripeSubscriptionItem,
  StripeSubscriptionItems,
  StripeSubscription,
  StripeSubscriptionStatus,
} from "../types/stripe-subscription";
import { stripeIds } from "./shared/stripe.examples";

const itemPro = {
  id: stripeIds.subscriptionItem,
  object: "subscription_item",
  price: stripeIds.price,
  quantity: 2,
} as const satisfies StripeSubscriptionItem;

const itemAddon = {
  id: "si_Q7w8E9r0T1y2U3",
  object: "subscription_item",
  price: "price_1Ot90A2eZvKYlo2Caddon456",
  quantity: 5,
} as const satisfies StripeSubscriptionItem;

export const stripeSubscriptionItemExamples = {
  pro: itemPro,
  addon: itemAddon,
  single: { ...itemPro, quantity: 1 } satisfies StripeSubscriptionItem,
} as const;

export const stripeSubscriptionItemsExamples = {
  single: { data: [itemPro] } satisfies StripeSubscriptionItems,
  multiple: { data: [itemPro, itemAddon] } satisfies StripeSubscriptionItems,
  empty: { data: [] } satisfies StripeSubscriptionItems,
} as const;

export const stripeSubscriptionStatusExamples = {
  incomplete: "incomplete",
  incompleteExpired: "incomplete_expired",
  trialing: "trialing",
  active: "active",
  pastDue: "past_due",
  canceled: "canceled",
  unpaid: "unpaid",
  paused: "paused",
} as const satisfies Record<string, StripeSubscriptionStatus>;

const active = {
  id: stripeIds.subscription,
  object: "subscription",
  customer: stripeIds.customer,
  status: "active",
  current_period_start: 1712948400,
  current_period_end: 1715626800,
  cancel_at_period_end: false,
  canceled_at: null,
  items: { data: [itemPro] },
  metadata: { plan: "pro" },
  created: 1712948400,
  livemode: false,
} as const satisfies StripeSubscription;

export const stripeSubscriptionExamples = {
  active,
  trialing: { ...active, status: "trialing" } satisfies StripeSubscription,
  pastDue: { ...active, status: "past_due" } satisfies StripeSubscription,
  scheduledCancellation: {
    ...active,
    cancel_at_period_end: true,
  } satisfies StripeSubscription,
  canceled: {
    ...active,
    id: "sub_1Ot8y92eZvKYlo2Cend99999",
    status: "canceled",
    cancel_at_period_end: true,
    canceled_at: 1714000000,
  } satisfies StripeSubscription,
  multiItem: {
    ...active,
    id: "sub_1Ot8y92eZvKYlo2Cmulti0001",
    items: { data: [itemPro, itemAddon] },
  } satisfies StripeSubscription,
} as const;
```

### Structured Data

- Name: `structured-data`
- Categories: seo
- Description: JSON-LD structured data with Thing base type and BreadcrumbList.
- Install (types only): `npx shadcn add @open-types/structured-data`
- Install (with Zod): `npx shadcn add @open-types/structured-data-zod`
- Install (with examples): `npx shadcn add @open-types/structured-data-examples`
- Detail page: https://open-types.dev/types/structured-data
- Markdown: https://open-types.dev/types/structured-data.md

#### Types

```typescript
export interface JsonLdBreadcrumbItem {
  "@type": "ListItem";
  position: number;
  name: string;
  item?: string;
}

export interface JsonLdBreadcrumbList {
  "@context"?: string;
  "@type": "BreadcrumbList";
  itemListElement: JsonLdBreadcrumbItem[];
}

export interface JsonLdThing {
  "@context"?: string;
  "@type": string;
  name?: string;
  description?: string;
  url?: string;
  image?: string;
  [key: string]: unknown;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  JsonLdBreadcrumbItem,
  JsonLdBreadcrumbList,
  JsonLdThing,
} from "../types/structured-data";

export const jsonLdBreadcrumbItemSchema = z.object({
  "@type": z.literal("ListItem"),
  position: z.number(),
  name: z.string(),
  item: z.string().optional(),
}) satisfies z.ZodType<JsonLdBreadcrumbItem>;

export const jsonLdBreadcrumbListSchema = z.object({
  "@context": z.string().optional(),
  "@type": z.literal("BreadcrumbList"),
  itemListElement: z.array(jsonLdBreadcrumbItemSchema),
}) satisfies z.ZodType<JsonLdBreadcrumbList>;

export const jsonLdThingSchema = z
  .object({
    "@context": z.string().optional(),
    "@type": z.string(),
    name: z.string().optional(),
    description: z.string().optional(),
    url: z.string().optional(),
    image: z.string().optional(),
  })
  .passthrough() satisfies z.ZodType<JsonLdThing>;

export type {
  JsonLdBreadcrumbItem,
  JsonLdBreadcrumbList,
  JsonLdThing,
} from "../types/structured-data";
```

#### Examples

```typescript
// Source: https://schema.org/, https://developers.google.com/search/docs/appearance/structured-data
// Captured: 2026-05
import type {
  JsonLdBreadcrumbItem,
  JsonLdBreadcrumbList,
  JsonLdThing,
} from "../types/structured-data";

const breadcrumbHome = {
  "@type": "ListItem",
  position: 1,
  name: "Home",
  item: "https://open-types.dev/",
} as const satisfies JsonLdBreadcrumbItem;

const breadcrumbBlog = {
  "@type": "ListItem",
  position: 2,
  name: "Blog",
  item: "https://open-types.dev/blog",
} as const satisfies JsonLdBreadcrumbItem;

const breadcrumbCurrent = {
  "@type": "ListItem",
  position: 3,
  name: "Why we built OpenTypes",
} as const satisfies JsonLdBreadcrumbItem;

export const jsonLdBreadcrumbItemExamples = {
  home: breadcrumbHome,
  section: breadcrumbBlog,
  currentWithoutItem: breadcrumbCurrent,
} as const;

export const jsonLdBreadcrumbListExamples = {
  standard: {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    itemListElement: [breadcrumbHome, breadcrumbBlog, breadcrumbCurrent],
  } satisfies JsonLdBreadcrumbList,
  twoLevel: {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    itemListElement: [breadcrumbHome, breadcrumbBlog],
  } satisfies JsonLdBreadcrumbList,
  noContext: {
    "@type": "BreadcrumbList",
    itemListElement: [breadcrumbHome],
  } satisfies JsonLdBreadcrumbList,
} as const;

export const jsonLdThingExamples = {
  organization: {
    "@context": "https://schema.org",
    "@type": "Organization",
    name: "OpenTypes",
    description: "Community-curated TypeScript type registry.",
    url: "https://open-types.dev",
    image: "https://open-types.dev/og-image.png",
    sameAs: ["https://github.com/marcotisi/opentypes"],
  } satisfies JsonLdThing,
  article: {
    "@context": "https://schema.org",
    "@type": "Article",
    name: "Why we built OpenTypes",
    description: "Origin story for the OpenTypes registry.",
    url: "https://open-types.dev/blog/why",
    author: { "@type": "Person", name: "Marco Tisi" },
    datePublished: "2026-05-16",
  } satisfies JsonLdThing,
  product: {
    "@context": "https://schema.org",
    "@type": "Product",
    name: "Premium Widget",
    description: "A high-quality widget.",
    image: "https://cdn.example.com/products/widget.jpg",
    offers: { "@type": "Offer", price: "29.99", priceCurrency: "USD" },
  } satisfies JsonLdThing,
  minimal: { "@type": "Thing" } satisfies JsonLdThing,
} as const;
```

### Toast Notification

- Name: `toast-notification`
- Categories: notification
- Description: In-app toast notification with variant, duration, and dismissible flag.
- Install (types only): `npx shadcn add @open-types/toast-notification`
- Install (with Zod): `npx shadcn add @open-types/toast-notification-zod`
- Install (with examples): `npx shadcn add @open-types/toast-notification-examples`
- Detail page: https://open-types.dev/types/toast-notification
- Markdown: https://open-types.dev/types/toast-notification.md

#### Types

```typescript
export type ToastVariant = "info" | "success" | "warning" | "error";

export interface ToastAction {
  label: string;
  url?: string;
}

export interface ToastNotification {
  id?: string;
  variant: ToastVariant;
  title: string;
  description?: string;
  duration?: number;
  dismissible?: boolean;
  action?: ToastAction;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  ToastAction,
  ToastNotification,
  ToastVariant,
} from "../types/toast-notification";

export const toastVariantSchema = z.enum(["info", "success", "warning", "error"]) satisfies z.ZodType<ToastVariant>;

export const toastActionSchema = z.object({
  label: z.string().min(1, { error: "Action label is required" }),
  url: z.url({ error: "Action URL must be a valid URL" }).optional(),
}) satisfies z.ZodType<ToastAction>;

export const toastNotificationSchema = z.object({
  id: z.string().optional(),
  variant: toastVariantSchema,
  title: z.string().min(1, { error: "Title is required" }),
  description: z.string().optional(),
  duration: z.number().int({ error: "Duration must be a whole number" }).min(0, {
    error: "Duration cannot be negative",
  }).optional(),
  dismissible: z.boolean().optional(),
  action: toastActionSchema.optional(),
}) satisfies z.ZodType<ToastNotification>;

export type {
  ToastAction,
  ToastNotification,
  ToastVariant,
} from "../types/toast-notification";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after sonner/shadcn-ui toast props
import type {
  ToastVariant,
  ToastAction,
  ToastNotification,
} from "../types/toast-notification";

export const toastVariantExamples = {
  info: "info",
  success: "success",
  warning: "warning",
  error: "error",
} as const satisfies Record<string, ToastVariant>;

export const toastActionExamples = {
  withUrl: { label: "View details", url: "https://app.example.com/items/42" } satisfies ToastAction,
  labelOnly: { label: "Undo" } satisfies ToastAction,
  retry: { label: "Retry", url: "https://app.example.com/retry" } satisfies ToastAction,
} as const;

export const toastNotificationExamples = {
  successFull: {
    id: "toast_01HABCDEF",
    variant: "success",
    title: "Saved",
    description: "Your changes were saved successfully.",
    duration: 4000,
    dismissible: true,
    action: { label: "Undo" },
  } satisfies ToastNotification,
  errorPersistent: {
    variant: "error",
    title: "Failed to save",
    description: "An unexpected error occurred. Please try again.",
    duration: 0,
    dismissible: true,
    action: { label: "Retry", url: "https://app.example.com/retry" },
  } satisfies ToastNotification,
  warningWithUrl: {
    variant: "warning",
    title: "Quota almost reached",
    description: "You have used 95% of your monthly quota.",
    action: { label: "Upgrade", url: "https://app.example.com/billing" },
  } satisfies ToastNotification,
  infoMinimal: {
    variant: "info",
    title: "Heads up",
  } satisfies ToastNotification,
  ephemeral: {
    variant: "info",
    title: "Copied to clipboard",
    duration: 1500,
    dismissible: false,
  } satisfies ToastNotification,
} as const;
```

### Translation Entry

- Name: `translation-entry`
- Categories: i18n
- Description: Translation key-value entry with namespace, locale, and placeholders.
- Install (types only): `npx shadcn add @open-types/translation-entry`
- Install (with Zod): `npx shadcn add @open-types/translation-entry-zod`
- Install (with examples): `npx shadcn add @open-types/translation-entry-examples`
- Detail page: https://open-types.dev/types/translation-entry
- Markdown: https://open-types.dev/types/translation-entry.md

#### Types

```typescript
export interface TranslationEntry {
  key: string;
  value: string;
  namespace?: string;
  locale?: string;
  description?: string;
  placeholders?: string[];
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { TranslationEntry } from "../types/translation-entry";

export const translationEntrySchema = z.object({
  key: z.string().min(1, { error: "Key is required" }),
  value: z.string(),
  namespace: z.string().min(1, { error: "Namespace cannot be empty" }).optional(),
  locale: z.string().min(1, { error: "Locale cannot be empty" }).optional(),
  description: z.string().optional(),
  placeholders: z.array(z.string().min(1, { error: "Placeholder cannot be empty" })).optional(),
}) satisfies z.ZodType<TranslationEntry>;

export type { TranslationEntry } from "../types/translation-entry";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after i18next/Format.JS message catalogs
import type { TranslationEntry } from "../types/translation-entry";

export const translationEntryExamples = {
  simple: {
    key: "common.welcome",
    value: "Welcome back!",
    locale: "en-US",
  } satisfies TranslationEntry,
  withPlaceholders: {
    key: "checkout.greeting",
    value: "Hi {name}, you have {count} items in your cart.",
    namespace: "checkout",
    locale: "en-US",
    description: "Greeting shown on the checkout page.",
    placeholders: ["name", "count"],
  } satisfies TranslationEntry,
  rtlArabic: {
    key: "common.welcome",
    value: "مرحبًا بعودتك!",
    locale: "ar-SA",
    description: "Welcome message in Arabic.",
  } satisfies TranslationEntry,
  german: {
    key: "common.welcome",
    value: "Willkommen zurück!",
    locale: "de-DE",
  } satisfies TranslationEntry,
  pluralForm: {
    key: "cart.items_plural",
    value: "{count, plural, =0 {No items} one {# item} other {# items}}",
    namespace: "cart",
    locale: "en-US",
    placeholders: ["count"],
  } satisfies TranslationEntry,
  minimal: { key: "noop", value: "" } satisfies TranslationEntry,
} as const;
```

### Twilio SMS Message

- Name: `twilio-sms-message`
- Categories: twilio
- Description: Twilio SMS message with status, direction, pricing, and segment tracking.
- Install (types only): `npx shadcn add @open-types/twilio-sms-message`
- Install (with Zod): `npx shadcn add @open-types/twilio-sms-message-zod`
- Install (with examples): `npx shadcn add @open-types/twilio-sms-message-examples`
- Detail page: https://open-types.dev/types/twilio-sms-message
- Markdown: https://open-types.dev/types/twilio-sms-message.md

#### Types

```typescript
export type TwilioSMSStatus =
  | "queued"
  | "sending"
  | "sent"
  | "delivered"
  | "failed"
  | "undelivered";

export type TwilioSMSDirection =
  | "inbound"
  | "outbound-api"
  | "outbound-call"
  | "outbound-reply";

export interface TwilioSMSMessage {
  sid: string;
  account_sid: string;
  from: string;
  to: string;
  body: string;
  status: TwilioSMSStatus;
  direction: TwilioSMSDirection;
  date_created: string;
  date_updated: string;
  date_sent: string | null;
  num_segments: string;
  num_media: string;
  price: string | null;
  price_unit: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type {
  TwilioSMSDirection,
  TwilioSMSMessage,
  TwilioSMSStatus,
} from "../types/twilio-sms-message";

export const twilioSMSStatusSchema = z.enum([
  "queued",
  "sending",
  "sent",
  "delivered",
  "failed",
  "undelivered",
]) satisfies z.ZodType<TwilioSMSStatus>;

export const twilioSMSDirectionSchema = z.enum([
  "inbound",
  "outbound-api",
  "outbound-call",
  "outbound-reply",
]) satisfies z.ZodType<TwilioSMSDirection>;

export const twilioSMSMessageSchema = z.object({
  sid: z.string(),
  account_sid: z.string(),
  from: z.string(),
  to: z.string(),
  body: z.string(),
  status: twilioSMSStatusSchema,
  direction: twilioSMSDirectionSchema,
  date_created: z.string(),
  date_updated: z.string(),
  date_sent: z.string().nullable(),
  num_segments: z.string(),
  num_media: z.string(),
  price: z.string().nullable(),
  price_unit: z.string(),
}) satisfies z.ZodType<TwilioSMSMessage>;

export type {
  TwilioSMSDirection,
  TwilioSMSMessage,
  TwilioSMSStatus,
} from "../types/twilio-sms-message";
```

#### Examples

```typescript
// Source: https://www.twilio.com/docs/sms/api/message-resource
// Captured: 2026-05
import type {
  TwilioSMSStatus,
  TwilioSMSDirection,
  TwilioSMSMessage,
} from "../types/twilio-sms-message";

export const twilioSMSStatusExamples = {
  queued: "queued",
  sending: "sending",
  sent: "sent",
  delivered: "delivered",
  failed: "failed",
  undelivered: "undelivered",
} as const satisfies Record<string, TwilioSMSStatus>;

export const twilioSMSDirectionExamples = {
  inbound: "inbound",
  outboundApi: "outbound-api",
  outboundCall: "outbound-call",
  outboundReply: "outbound-reply",
} as const satisfies Record<string, TwilioSMSDirection>;

const delivered = {
  sid: "SMabcdef0123456789abcdef0123456789",
  account_sid: "ACabcdef0123456789abcdef0123456789",
  from: "+14155551234",
  to: "+14155555678",
  body: "Your verification code is 4827",
  status: "delivered",
  direction: "outbound-api",
  date_created: "Tue, 13 Apr 2026 18:00:00 +0000",
  date_updated: "Tue, 13 Apr 2026 18:00:02 +0000",
  date_sent: "Tue, 13 Apr 2026 18:00:01 +0000",
  num_segments: "1",
  num_media: "0",
  price: "-0.00750",
  price_unit: "USD",
} as const satisfies TwilioSMSMessage;

export const twilioSMSMessageExamples = {
  delivered,
  queued: {
    ...delivered,
    sid: "SMqueued12345678901234567890123456",
    status: "queued",
    date_sent: null,
    price: null,
  } satisfies TwilioSMSMessage,
  failed: {
    ...delivered,
    sid: "SMfailed12345678901234567890123456",
    status: "failed",
    date_sent: null,
    price: null,
  } satisfies TwilioSMSMessage,
  inbound: {
    ...delivered,
    sid: "SMinbound1234567890123456789012345",
    direction: "inbound",
    from: "+14155555678",
    to: "+14155551234",
    body: "STOP",
  } satisfies TwilioSMSMessage,
  mms: {
    ...delivered,
    sid: "SMmms123456789012345678901234567890",
    body: "See attached.",
    num_segments: "1",
    num_media: "2",
    price: "-0.02000",
  } satisfies TwilioSMSMessage,
  longSegmented: {
    ...delivered,
    sid: "SMlong12345678901234567890123456789",
    body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. ".repeat(6),
    num_segments: "3",
    price: "-0.02250",
  } satisfies TwilioSMSMessage,
} as const;
```

### Twilio Webhook

- Name: `twilio-webhook`
- Categories: twilio
- Description: Twilio SMS webhook callback with message SID, status, and sender details.
- Install (types only): `npx shadcn add @open-types/twilio-webhook`
- Install (with Zod): `npx shadcn add @open-types/twilio-webhook-zod`
- Install (with examples): `npx shadcn add @open-types/twilio-webhook-examples`
- Detail page: https://open-types.dev/types/twilio-webhook
- Markdown: https://open-types.dev/types/twilio-webhook.md

#### Types

```typescript
export interface TwilioSMSWebhook {
  MessageSid: string;
  AccountSid: string;
  From: string;
  To: string;
  Body: string;
  NumMedia: string;
  NumSegments: string;
  SmsStatus: string;
  ApiVersion: string;
  MessageStatus?: string;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { TwilioSMSWebhook } from "../types/twilio-webhook";

export const twilioSMSWebhookSchema = z.object({
  MessageSid: z.string(),
  AccountSid: z.string(),
  From: z.string(),
  To: z.string(),
  Body: z.string(),
  NumMedia: z.string(),
  NumSegments: z.string(),
  SmsStatus: z.string(),
  ApiVersion: z.string(),
  MessageStatus: z.string().optional(),
}) satisfies z.ZodType<TwilioSMSWebhook>;

export type { TwilioSMSWebhook } from "../types/twilio-webhook";
```

#### Examples

```typescript
// Source: https://www.twilio.com/docs/sms/twiml#twilios-request-to-your-application
// Captured: 2026-05
import type { TwilioSMSWebhook } from "../types/twilio-webhook";

const inbound = {
  MessageSid: "SMabcdef0123456789abcdef0123456789",
  AccountSid: "ACabcdef0123456789abcdef0123456789",
  From: "+14155555678",
  To: "+14155551234",
  Body: "Hello from the SMS gateway",
  NumMedia: "0",
  NumSegments: "1",
  SmsStatus: "received",
  ApiVersion: "2010-04-01",
} as const satisfies TwilioSMSWebhook;

export const twilioSMSWebhookExamples = {
  inbound,
  inboundWithStatus: { ...inbound, MessageStatus: "received" } satisfies TwilioSMSWebhook,
  mms: {
    ...inbound,
    MessageSid: "SMmms0123456789abcdef0123456789ab",
    NumMedia: "1",
    Body: "Check out this photo",
  } satisfies TwilioSMSWebhook,
  longText: {
    ...inbound,
    MessageSid: "SMlong0123456789abcdef0123456789a",
    Body: "Reply STOP to opt out. ".repeat(8),
    NumSegments: "3",
  } satisfies TwilioSMSWebhook,
  deliveryStatus: {
    ...inbound,
    MessageSid: "SMdlv0123456789abcdef0123456789ab",
    Body: "",
    SmsStatus: "delivered",
    MessageStatus: "delivered",
  } satisfies TwilioSMSWebhook,
} as const;
```

### User

- Name: `user`
- Categories: auth
- Description: User profile with role-based access, optional address, and create/update variants.
- Depends on: `@open-types/address`
- Install (types only): `npx shadcn add @open-types/user`
- Install (with Zod): `npx shadcn add @open-types/user-zod`
- Install (with examples): `npx shadcn add @open-types/user-examples`
- Detail page: https://open-types.dev/types/user
- Markdown: https://open-types.dev/types/user.md

#### Types

```typescript
import type { Address } from "./address";

export type UserRole = "admin" | "user" | "moderator" | "viewer";

export interface User {
  id: string;
  email: string;
  name: string;
  role?: UserRole;
  avatar?: string;
  address?: Address;
  bio?: string;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export type UserCreate = Omit<User, "id" | "createdAt" | "updatedAt">;

export type UserUpdate = Partial<UserCreate>;
```

#### Zod validator

```typescript
import * as z from "zod";
import type { User, UserCreate, UserUpdate, UserRole } from "../types/user";
import { addressSchema } from "./address";

export const userRoleSchema = z.enum(["admin", "user", "moderator", "viewer"]);

export const userSchema = z.object({
  id: z.uuid({ error: "Invalid user ID" }),
  email: z.email({ error: "Invalid email address" }),
  name: z.string().min(1, { error: "Name is required" }),
  role: userRoleSchema.default("user"),
  avatar: z.url({ error: "Avatar must be a valid URL" }).optional(),
  address: addressSchema.optional(),
  bio: z.string().max(500, { error: "Bio must be at most 500 characters" }).optional(),
  isActive: z.boolean(),
  createdAt: z.iso.datetime({ error: "Invalid datetime" }),
  updatedAt: z.iso.datetime({ error: "Invalid datetime" }),
}) satisfies z.ZodType<User>;

export const userCreateSchema = userSchema.omit({
  id: true,
  createdAt: true,
  updatedAt: true,
});

export const userUpdateSchema = userSchema
  .omit({ id: true, createdAt: true, updatedAt: true })
  .partial();

export type { User, UserCreate, UserUpdate, UserRole } from "../types/user";
```

#### Examples

```typescript
// Source: hand-crafted
import type { User, UserCreate, UserUpdate, UserRole } from "../types/user";
import { addressExamples } from "./address.examples";

export const userRoleExamples = {
  admin: "admin",
  user: "user",
  moderator: "moderator",
  viewer: "viewer",
} as const satisfies Record<string, UserRole>;

const jenny = {
  id: "9f8b7c6d-5e4f-4a2b-9c0d-1e8f7a6b5c4d",
  email: "jenny@example.com",
  name: "Jenny Rosen",
  role: "user",
  avatar: "https://cdn.example.com/avatars/jenny.png",
  address: addressExamples.minimal,
  bio: "Engineer at OpenTypes.",
  isActive: true,
  createdAt: "2026-01-01T00:00:00.000Z",
  updatedAt: "2026-05-16T18:30:00.000Z",
} as const satisfies User;

export const userExamples = {
  fullProfile: jenny,
  admin: { ...jenny, id: "11111111-2222-4333-8444-555555555555", role: "admin", email: "admin@example.com" } satisfies User,
  moderator: {
    ...jenny,
    id: "22222222-3333-4444-8555-666666666666",
    role: "moderator",
    email: "mod@example.com",
  } satisfies User,
  viewer: {
    ...jenny,
    id: "33333333-4444-4555-8666-777777777777",
    role: "viewer",
    email: "viewer@example.com",
  } satisfies User,
  minimal: {
    id: "44444444-5555-4666-8777-888888888888",
    email: "min@example.com",
    name: "Min User",
    isActive: true,
    createdAt: "2026-05-16T18:30:00.000Z",
    updatedAt: "2026-05-16T18:30:00.000Z",
  } satisfies User,
  deactivated: {
    ...jenny,
    id: "55555555-6666-4777-8888-999999999999",
    email: "old@example.com",
    isActive: false,
  } satisfies User,
} as const;

export const userCreateExamples = {
  basic: {
    email: "new@example.com",
    name: "New User",
    isActive: true,
  } satisfies UserCreate,
  fullProfile: {
    email: "rich@example.com",
    name: "Rich User",
    role: "user",
    avatar: "https://cdn.example.com/avatars/rich.png",
    bio: "Active community member.",
    isActive: true,
  } satisfies UserCreate,
} as const;

export const userUpdateExamples = {
  bioOnly: { bio: "Updated bio text." } satisfies UserUpdate,
  promote: { role: "admin" } satisfies UserUpdate,
  deactivate: { isActive: false } satisfies UserUpdate,
  empty: {} satisfies UserUpdate,
} as const;
```

### Webhook Delivery

- Name: `webhook-delivery`
- Categories: api
- Description: Webhook delivery record with event, payload, signature, and delivery status.
- Install (types only): `npx shadcn add @open-types/webhook-delivery`
- Install (with Zod): `npx shadcn add @open-types/webhook-delivery-zod`
- Install (with examples): `npx shadcn add @open-types/webhook-delivery-examples`
- Detail page: https://open-types.dev/types/webhook-delivery
- Markdown: https://open-types.dev/types/webhook-delivery.md

#### Types

```typescript
export type WebhookDeliveryStatus = "pending" | "delivered" | "failed";

export interface WebhookDelivery {
  id: string;
  event: string;
  timestamp: string;
  payload: Record<string, unknown>;
  url: string;
  signature?: string;
  attempt: number;
  max_attempts: number;
  status: WebhookDeliveryStatus;
}
```

#### Zod validator

```typescript
import * as z from "zod";
import type { WebhookDelivery, WebhookDeliveryStatus } from "../types/webhook-delivery";

export const webhookDeliveryStatusSchema = z.enum([
  "pending",
  "delivered",
  "failed",
]) satisfies z.ZodType<WebhookDeliveryStatus>;

export const webhookDeliverySchema = z.object({
  id: z.string().min(1, { error: "Webhook delivery ID is required" }),
  event: z.string().min(1, { error: "Event is required" }),
  timestamp: z.iso.datetime({ error: "Invalid timestamp" }),
  payload: z.record(z.string(), z.unknown()),
  url: z.url({ error: "Webhook URL must be valid" }),
  signature: z.string().optional(),
  attempt: z.number().int().min(0, { error: "Attempt must be greater than or equal to 0" }),
  max_attempts: z.number().int().min(1, { error: "Max attempts must be at least 1" }),
  status: webhookDeliveryStatusSchema,
}) satisfies z.ZodType<WebhookDelivery>;

export type { WebhookDelivery, WebhookDeliveryStatus } from "../types/webhook-delivery";
```

#### Examples

```typescript
// Source: hand-crafted; modeled after Stripe/GitHub webhook delivery records
import type {
  WebhookDeliveryStatus,
  WebhookDelivery,
} from "../types/webhook-delivery";

export const webhookDeliveryStatusExamples = {
  pending: "pending",
  delivered: "delivered",
  failed: "failed",
} as const satisfies Record<string, WebhookDeliveryStatus>;

const delivered = {
  id: "del_01HABCDEF0123456789ABCDE",
  event: "order.created",
  timestamp: "2026-05-16T18:30:00Z",
  payload: { order_id: "ord_42", total: 9999 },
  url: "https://example.com/webhooks/orders",
  signature: "t=1715865000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd",
  attempt: 1,
  max_attempts: 5,
  status: "delivered",
} as const satisfies WebhookDelivery;

export const webhookDeliveryExamples = {
  delivered,
  pending: {
    ...delivered,
    id: "del_pending_001",
    status: "pending",
    attempt: 0,
  } satisfies WebhookDelivery,
  retrying: {
    ...delivered,
    id: "del_retry_002",
    status: "failed",
    attempt: 3,
  } satisfies WebhookDelivery,
  exhausted: {
    ...delivered,
    id: "del_exhausted_003",
    status: "failed",
    attempt: 5,
  } satisfies WebhookDelivery,
  noSignature: {
    ...delivered,
    id: "del_nosig_004",
    signature: undefined,
  } satisfies WebhookDelivery,
} as const;
```
