Socket
Book a DemoInstallSign in
Socket

cca-entities

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cca-entities

Entities

0.2.22
latest
npmnpm
Version published
Weekly downloads
245
497.56%
Maintainers
1
Weekly downloads
 
Created
Source

Below is a short Markdown documentation that outlines the entities and their relationships:

Entities Documentation

This documentation provides a brief overview of the TypeORM entities used in this project. Each entity extends a common BaseEntity and uses decorators from TypeORM and AutoMapper for mapping and database configuration.

AuthEntity

  • Table Name: auth
  • Purpose: Stores authentication-related data.
  • Key Fields:
    • email: A unique email address.
    • password: User password (not selected by default).
    • refreshToken: Token used for refreshing authentication (not selected by default).
    • role: Enum value from UserRole (default: GUEST).
  • Relations:
    • user: One-to-one relation with UserEntity (eagerly loaded, cascades on delete).

UserEntity

  • Table Name: users
  • Purpose: Represents user profiles.
  • Key Fields:
    • email: Unique email address (indexed).
    • name: User’s name.
    • role: Enum value from UserRole (default: GUEST).
    • profileImageUrl: Optional URL for the profile image.
    • isActive: Indicates if the user is active.
    • lastLoginAt: Timestamp of the last login (not selected by default).
  • Relations:
    • auth: One-to-one relation with AuthEntity.
    • posts: One-to-many relation with PostEntity.
    • images: One-to-many relation with ImageEntity.

CategoryEntity

  • Table Name: categories
  • Purpose: Represents content categories.
  • Key Fields:
    • name: Unique category name.
    • slug: URL-friendly unique identifier.
    • description: Optional text describing the category.
    • featuredImage: Optional image for the category.
    • level: Indicates the category level.
  • Tree Structure:
    • parent: Self-referencing parent category (closure-table tree).
    • children: Self-referencing child categories.
  • Relations:
    • image: One-to-one relation with ImageEntity.
    • posts: Many-to-many relation with PostEntity.

PostEntity

  • Table Name: posts
  • Purpose: Represents blog posts or articles.
  • Key Fields:
    • title: Title of the post.
    • slug: Unique URL-friendly identifier.
    • content: Main content of the post.
    • excerpt: Short excerpt from the content.
    • published: Boolean flag indicating if the post is published.
    • featuredImage: Optional image URL.
    • publishedAt: Timestamp when the post was published.
  • Relations:
    • author: Many-to-one relation with UserEntity (author details).
    • images: One-to-many relation with ImageEntity.
    • categories: Many-to-many relation with CategoryEntity.

ImageEntity

  • Table Name: images
  • Purpose: Stores image data associated with posts, users, or categories.
  • Key Fields:
    • title: Title of the image.
    • description: Optional description.
    • originalUrl, thumbUrl, smUrl, mdUrl, lgUrl, xlUrl: URLs for various image sizes.
    • imageId: Unique identifier for the image.
  • Relations:
    • author: Many-to-one relation with UserEntity.
    • category: One-to-one relation with CategoryEntity (if applicable).
    • post: Many-to-one relation with PostEntity.

UserRole Enum

  • Values:
    • ADMIN
    • USER
    • GUEST

This enum is used across several entities to define the user’s access level and role.

This brief documentation provides a high-level overview of the key entities, their main fields, and relationships. For more detailed information on field types, configurations, or relationships, please refer to the inline comments and TypeORM documentation.

FAQs

Package last updated on 21 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.