open-index/open-npm huggingface dataset:
npm package: @pixelmeet/errors
Description: Shared error classes for PixelMeet services
Latest version: 0.8.5

# @pixelmeet/errors

Shared error classes for PixelMeet backend services.

## Installation

```bash
pnpm add @pixelmeet/errors
```

## Usage

```typescript
import { NotFoundError, ValidationError, AppError } from '@pixelmeet/errors'

// Throw a not found error
throw new NotFoundError('User not found')

// Throw a validation error with issues
throw new ValidationError('Invalid input', [
  { path: 'email', message: 'Invalid email format', code: 'invalid_string' }
])

// Custom error with status code
throw new AppError('Something went wrong', 500, 'INTERNAL_ERROR')
```

## Available Errors

| Error Class | Status Code | Error Code |
|-------------|-------------|------------|
| `AppError` | configurable | configurable |
| `BadRequestError` | 400 | BAD_REQUEST |
| `ValidationError` | 400 | VALIDATION_ERROR |
| `UnauthorizedError` | 401 | UNAUTHORIZED |
| `NotFoundError` | 404 | NOT_FOUND |
| `ConflictError` | 409 | CONFLICT |
| `ResourceAlreadyExistsError` | 409 | CONFLICT |
| `PresignedUrlGenerationError` | 500 | PRESIGNED_URL_ERROR |

## Zod Integration

`ValidationError` automatically extracts issues from Zod errors:

```typescript
import { ValidationError } from '@pixelmeet/errors'
import { z } from 'zod'

try {
  schema.parse(data)
} catch (error) {
  throw new ValidationError('Validation failed', undefined, error)
  // error.issues will be populated from the ZodError
}
```

## Peer Dependencies

- `zod` ^3.0.0 || ^4.0.0
npm package: @pixelmeet/types
Description: Shared types and constants for PixelMeet services
Latest version: 0.7.4

# @pixelmeet/types

Shared types and constants for PixelMeet backend services.

## Installation

```bash
pnpm add @pixelmeet/types
```

## Usage

```typescript
import { HTTP_STATUS, SUCCESS_MESSAGES } from '@pixelmeet/types'

res.status(HTTP_STATUS.OK).json({
  message: SUCCESS_MESSAGES.SUCCESS,
  data: result
})
```

## Constants

### HTTP_STATUS

| Name | Value |
|------|-------|
| OK | 200 |
| CREATED | 201 |
| NO_CONTENT | 204 |
| BAD_REQUEST | 400 |
| UNAUTHORIZED | 401 |
| FORBIDDEN | 403 |
| NOT_FOUND | 404 |
| CONFLICT | 409 |
| INTERNAL_SERVER_ERROR | 500 |

### SUCCESS_MESSAGES

| Name | Value |
|------|-------|
| SUCCESS | "Operation successful" |
| CREATED | "Resource created successfully" |
| UPDATED | "Resource updated successfully" |
| DELETED | "Resource deleted successfully" |

## Notification Types

```typescript
import type { NotificationMessage, OTPVerificationEmail } from '@pixelmeet/types'

const notification: OTPVerificationEmail = {
  type: 'OTPSend',
  payload: {
    to: 'user@example.com',
    template: 'OTPSend',
    from: 'noreply@pixelmeet.com',
    fromName: 'PixelMeet',
    otp: '123456'
  }
}
```
npm package: @pixelmeet/utils
Description: Shared utilities for PixelMeet services
Latest version: 0.3.2

# @pixelmeet/utils

Shared utilities for PixelMeet backend services.

## Installation

```bash
pnpm add @pixelmeet/utils
```

## Usage

### Logger

```typescript
import { createLogger } from '@pixelmeet/utils'

const logger = createLogger({
  serviceName: 'user-service',
  nodeEnv: process.env.NODE_ENV,
  logLevel: process.env.LOG_LEVEL || 'info',
})

logger.info({ userId: '123' }, 'User created')
logger.error({ err: error }, 'Failed to process request')
```

### Logger Configuration

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| serviceName | string | required | Service name for log identification |
| nodeEnv | string | 'production' | Environment mode |
| logLevel | string | 'info' | Log level (trace, debug, info, warn, error, fatal) |
| logFile | string | logs/{serviceName}.log | Log file path |
| hostname | string | auto | Override hostname in logs |
| enableConsole | boolean | true | Enable console output |
| enableFile | boolean | true in production | Enable file output |

### Request ID

```typescript
import { genReqId } from '@pixelmeet/utils'
import pinoHttp from 'pino-http'

app.use(pinoHttp({
  logger,
  genReqId
}))
```

## Peer Dependencies

- `pino` ^9.0.0
- `pino-pretty` ^13.0.0