Packages

@prood/types

Unified data model — domain types, adapter interfaces, and provider contracts.

@prood/types is the shared vocabulary for all Prood packages. It contains TypeScript interfaces and types only — no runtime code, no dependencies.

Installation

Workspace package. Available from the source repo for now.

Already included as a dependency of @prood/commerce, @prood/platform, and @prood/ui.

Domain types

Catalog

ts
import type {
  Product,
  ProductVariant,
  Category,
  Brand,
  SearchResult,
  SearchParams,
} from '@prood/types'

Cart & checkout

ts
import type {
  Cart,
  CartItem,
  CartTotals,
  ShippingMethod,
  PaymentMethod,
  Address,
  CustomerInfo,
} from '@prood/types'

Orders

ts
import type {
  Order,
  OrderItem,
  OrderStatus,
  FulfillmentStatus,
} from '@prood/types'

Store & customers

import type { StoreInfo, Customer, Country } from '@prood/types'

Adapter interfaces

ts
import type {
  CommerceAdapter,
  CatalogAdapter,
  CartAdapter,
  CheckoutAdapter,
  OrdersAdapter,
  CustomersAdapter,
  StoreAdapter,
} from '@prood/types'

Implement these to create a custom commerce backend adapter.

Provider interfaces

ts
import type {
  PaymentProvider,
  PaymentSession,
  CreatePaymentSessionInput,
  RefundInput,
  PaymentWebhookEvent,
  StorageProvider,
  UploadInput,
  UploadResult,
} from '@prood/types'

Error handling

ts
import { CommerceError, toErrorResponse } from '@prood/types'

// Throw structured errors
throw new CommerceError('Product not found', 'NOT_FOUND', 404)

// Convert to HTTP response
const { status, body } = toErrorResponse(err)
// body: { code: 'NOT_FOUND', message: 'Product not found' }

Admin types

Input/output types for dashboard and admin API operations:

ts
import type {
  CreateProductInput,
  UpdateProductInput,
  DashboardStats,
  FulfillOrderInput,
  RefundOrderInput,
} from '@prood/types'

Specialized domains

Types for advanced commerce patterns:

ts
import type {
  ReturnRequest,
} from '@prood/types'

Package structure

Drag to pan · Scroll to zoom