npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

convocore-types

v2.0.0

Published

TypeScript types, utilities, and Zod schemas for ConvoCore

Readme

ConvoCore Types

A comprehensive TypeScript package providing types, utility functions, and Zod schemas for ConvoCore applications. Fully typed, tree-shakeable, and optimized for modern TypeScript projects.

npm version License: MIT

📦 Installation

pnpm add convocore-types
# or
npm install convocore-types
# or
yarn add convocore-types

✨ Features

  • 🎯 800+ TypeScript Types - Comprehensive type definitions organized by domain
  • 🛡️ Zod Schemas - Runtime validation schemas with type inference
  • 🔧 Utility Functions - Helper functions for API responses, validation, and common operations
  • 📦 Tree Shakeable - Import only what you need with optimized exports
  • 🚀 Zero Config - Ready to use out of the box
  • 💪 Fully Typed - 100% TypeScript with complete IntelliSense support
  • Optimized - Small bundle size (48.8 kB), minimal dependencies

🏗️ Module Structure

The package is organized into logical domains for easy navigation:

Types

  • /types/auth - Authentication & authorization (User, Role, Permission, Team, Session)
  • /types/content - Messaging & content (Message, Conversation, Channel, Thread)
  • /types/api - HTTP & API (Request/Response, Webhooks, WebSockets)
  • /types/database - Database & ORM (Entities, Queries, Migrations)
  • /types/ui - UI & frontend (Theme, Layout, Components)
  • /types/config - Configuration (AppConfig, FeatureFlags, Settings)
  • /types/utils - Advanced utility types (100+ TypeScript helpers)

Schemas

  • /schemas/auth - Zod validation schemas for auth types
  • /schemas - Legacy schemas for backwards compatibility

Utils

  • /utils - Utility functions (API helpers, validation, async utilities)

🚀 Quick Start

import { 
  User, 
  Message, 
  ApiResponse,
  createSuccessResponse,
  UserSchema,
  z
} from 'convocore-types';

// Use types
const user: User = {
  id: '123',
  email: '[email protected]',
  name: 'John Doe',
  status: 'active',
  isVerified: true,
  isActive: true,
  createdAt: new Date(),
  updatedAt: new Date(),
};

// Validate with Zod
const result = UserSchema.safeParse(userData);
if (result.success) {
  console.log('Valid user:', result.data);
}

// Create API responses
const response = createSuccessResponse(user, 'User retrieved successfully');

📚 Usage Examples

Authentication Types

import { 
  User, 
  Team, 
  LoginRequest, 
  Session,
  UserProfile 
} from 'convocore-types/types/auth';

const loginData: LoginRequest = {
  email: '[email protected]',
  password: 'SecurePassword123',
  rememberMe: true,
};

Content & Messaging

import { 
  Message, 
  Conversation, 
  Channel,
  Reaction,
  Attachment 
} from 'convocore-types/types/content';

const message: Message = {
  id: '1',
  content: 'Hello, world!',
  type: 'text',
  authorId: 'user-123',
  channelId: 'channel-456',
  mentions: [],
  attachments: [],
  reactions: [],
  isEdited: false,
  isDeleted: false,
  createdAt: new Date(),
  updatedAt: new Date(),
};

API & HTTP Types

import { 
  ApiResponse,
  PaginatedResponse,
  WebhookEvent,
  HttpMethod,
  createSuccessResponse,
  createPaginatedResponse 
} from 'convocore-types';

// Create responses
const success = createSuccessResponse({ id: 1, name: 'Test' });
const paginated = createPaginatedResponse(items, 1, 10, 100);

Zod Schema Validation

import { 
  UserSchema,
  TeamSchema,
  LoginRequestSchema,
  validateEmail,
  validatePassword 
} from 'convocore-types/schemas/auth';

// Validate login data
const loginResult = LoginRequestSchema.safeParse({
  email: '[email protected]',
  password: 'SecurePass123',
});

if (loginResult.success) {
  // Data is valid and typed
  const { email, password } = loginResult.data;
}

// Use validation utilities
if (validateEmail('[email protected]')) {
  // Email is valid
}

Utility Functions

import { 
  createSuccessResponse,
  createErrorResponse,
  validateWithSchema,
  debounce,
  throttle,
  retry,
  formatBytes,
  slugify,
  sleep 
} from 'convocore-types/utils';

// API helpers
const success = createSuccessResponse(data, 'Operation successful');
const error = createErrorResponse('Not found', 'Resource not found');

// Validation
const result = validateWithSchema(UserSchema, userData);

// Async utilities
await sleep(1000);
const data = await retry(() => fetchData(), { retries: 3 });

// Formatting
const size = formatBytes(1024 * 1024); // "1 MB"
const slug = slugify('Hello World!'); // "hello-world"

// Debounce/Throttle
const debouncedFn = debounce(handleInput, 300);
const throttledFn = throttle(handleScroll, 100);

Advanced Utility Types

import { 
  DeepPartial,
  DeepReadonly,
  RequiredFields,
  PickByType,
  Path,
  Jsonify 
} from 'convocore-types/types/utils';

// Make all properties optional (including nested)
type PartialUser = DeepPartial<User>;

// Make specific fields required
type RequiredEmailUser = RequiredFields<Partial<User>, 'email' | 'name'>;

// Pick properties by type
type StringFields = PickByType<User, string>;

// Type-safe path access
type UserPaths = Path<User>; // 'id' | 'email' | 'name' | ...

Database Types

import { 
  BaseEntity,
  DatabaseConfig,
  Migration,
  QueryBuilder 
} from 'convocore-types/types/database';

interface Product extends BaseEntity {
  name: string;
  price: number;
}

// Product automatically has: id, createdAt, updatedAt, deletedAt

UI Types

import { 
  Theme,
  Layout,
  FormField,
  ButtonStyles 
} from 'convocore-types/types/ui';

const theme: Theme = {
  id: 'dark',
  name: 'Dark Theme',
  colors: { /* ... */ },
  typography: { /* ... */ },
  // ... other theme properties
};

Configuration

import { 
  AppConfig,
  FeatureFlags,
  DatabaseSettings 
} from 'convocore-types/types/config';

const config: AppConfig = {
  app: {
    name: 'MyApp',
    version: '1.0.0',
    // ... other settings
  },
  features: {
    authentication: true,
    twoFactorAuth: false,
    // ... other feature flags
  },
  // ... other config
};

📖 Import Paths

The package supports both main exports and submodule imports for optimal tree-shaking:

// Main export (includes everything)
import { User, UserSchema, createSuccessResponse } from 'convocore-types';

// Submodule imports (tree-shakeable)
import { User } from 'convocore-types/types/auth';
import { Message } from 'convocore-types/types/content';
import { ApiResponse } from 'convocore-types/types/api';
import { UserSchema } from 'convocore-types/schemas/auth';
import { createSuccessResponse } from 'convocore-types/utils';

🎯 Type Inference

Use Zod's type inference to automatically generate TypeScript types:

import { z } from 'convocore-types';
import { UserSchema } from 'convocore-types/schemas/auth';

// Infer the type from the schema
type User = z.infer<typeof UserSchema>;

// Now you have a fully typed User without importing the type separately
const user: User = {
  id: '123',
  email: '[email protected]',
  // ... TypeScript knows all the required fields
};

🛠️ Development

# Install dependencies
pnpm install

# Build the package
pnpm run build

# Watch mode
pnpm run dev

# Clean dist folder
pnpm run clean

📝 Type Coverage

  • Authentication: 50+ types (User, Role, Permission, Team, Session, OAuth)
  • Content: 40+ types (Message, Conversation, Channel, Thread, Reaction)
  • API: 60+ types (HTTP, Webhooks, WebSocket, File Upload, Batch Operations)
  • Database: 30+ types (Entities, Queries, Migrations, Transactions)
  • UI: 25+ types (Theme, Layout, Components, Forms, State Management)
  • Config: 20+ types (AppConfig, FeatureFlags, Integrations, User Preferences)
  • Utils: 100+ advanced TypeScript utility types

⚡ Performance & Optimization

  • Small Bundle: 48.8 kB gzipped
  • Tree Shakeable: Import only what you need
  • Zero Runtime Overhead: Pure TypeScript types have no runtime cost
  • Optimized Exports: Submodule imports for maximum tree-shaking
  • Type-Only Imports: Use import type for zero-cost type imports
// Type-only import (no runtime code)
import type { User } from 'convocore-types';

// Runtime import (includes Zod schema)
import { UserSchema } from 'convocore-types/schemas/auth';

🤝 Contributing

Contributions are welcome! This package is designed to be comprehensive and cover all common use cases.

📄 License

MIT © ConvoCore

🔗 Links

📊 Package Stats

  • Version: 1.0.1
  • Dependencies: zod (only runtime dependency)
  • TypeScript: ✅ Fully typed
  • Bundle Size: 48.8 kB
  • Files: 50+ compiled files
  • Types: 800+ interfaces and types

🎉 What's New in v1.0.1

  • ✅ Optimized export paths for better tree-shaking
  • ✅ Submodule imports support (convocore-types/types/auth, etc.)
  • ✅ Comprehensive authentication schemas with Zod
  • ✅ Utility functions for API responses and validation
  • ✅ 100+ advanced TypeScript utility types
  • ✅ Full IntelliSense support for all modules
  • ✅ Tested and production-ready

Made with ❤️ for the TypeScript community