open-index/open-npm huggingface dataset:
npm package: @peterest/shared-types
Description: Shared types and DTOs for My PaaS
Latest version: 1.0.0

# Shared Types Library

This library contains shared types, DTOs, and enums used across the My PaaS microservices.

## Structure

- **auth/**: Authentication-related DTOs (LoginDto, SignUpDto)
- **instances/**: Instance-related types (CreateInstanceDto, UpdateInstanceDto, Instance entity, InstanceStatus enum)
- **users/**: User-related DTOs (CreateUserDto)

## Usage

Import types from the main package:

```typescript
import { 
  CreateInstanceDto, 
  UpdateInstanceDto, 
  InstanceStatus,
  LoginDto,
  SignUpDto,
  CreateUserDto 
} from '@my-paas/shared-types';
```

## Benefits

- **Type Safety**: Ensures consistent types across services
- **DRY Principle**: Eliminates duplicate type definitions
- **Maintainability**: Single source of truth for shared types
- **Consistency**: Guarantees both services use the same validation rules and data structures

## Building

```bash
npm run build
```

This will compile TypeScript to JavaScript and generate type declarations in the `dist/` directory.
npm package: @peterest/shared-utils
Description: Shared utilities for My PaaS applications
Latest version: 1.0.0

# Shared Utils Library

A collection of common utilities that can be shared across all applications in the My PaaS monorepo.

## Installation

This library is part of the monorepo and can be used by other applications by adding it as a dependency.

## Available Utilities

### CryptoService

Password hashing and verification using bcrypt.

```typescript
import { CryptoService } from '@my-paas/shared-utils';

// Hash a password
const hashedPassword = await CryptoService.hashPassword('myPassword123');

// Compare passwords
const isValid = await CryptoService.comparePassword('myPassword123', hashedPassword);

// Generate salt
const salt = await CryptoService.generateSalt(10);

// Get salt rounds from hash
const rounds = CryptoService.getSaltRounds(hashedPassword);
```

### ValidationService

Common validation functions for data validation.

```typescript
import { ValidationService } from '@my-paas/shared-utils';

// Email validation
const isValidEmail = ValidationService.isValidEmail('user@example.com');

// Password strength validation
const isValidPassword = ValidationService.isValidPassword('MyPassword123');

// UUID validation
const isValidUUID = ValidationService.isValidUUID('123e4567-e89b-12d3-a456-426614174000');

// URL validation
const isValidURL = ValidationService.isValidURL('https://example.com');

// Phone number validation
const isValidPhone = ValidationService.isValidPhoneNumber('+1234567890');
```

### StringUtils

String manipulation and formatting utilities.

```typescript
import { StringUtils } from '@my-paas/shared-utils';

// Generate random string
const randomString = StringUtils.generateRandomString(10);

// Case conversions
const camelCase = StringUtils.toCamelCase('hello world');
const kebabCase = StringUtils.toKebabCase('HelloWorld');
const snakeCase = StringUtils.toSnakeCase('Hello World');

// String manipulation
const capitalized = StringUtils.capitalize('hello');
const truncated = StringUtils.truncate('Very long string', 10);
const slugified = StringUtils.slugify('Hello World!');
```

## Development

### Building the library

```bash
cd libs/shared-utils
npm install
npm run build
```

### Running tests

```bash
npm test
```

### Development mode

```bash
npm run dev
```

## Usage in other applications

To use this library in other applications within the monorepo:

1. Add it as a dependency in the application's `package.json`:
```json
{
  "dependencies": {
    "@my-paas/shared-utils": "file:../libs/shared-utils"
  }
}
```

2. Import and use the utilities:
```typescript
import { CryptoService, ValidationService, StringUtils } from '@my-paas/shared-utils';
```