@deep/nest-kit
    Preparing search index...

    Class IdService

    An IdService is a service within your application that provides methods to generate unique IDs for entities and other data objects.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get delimiter(): ":" | ":test:" | ":dev:" | ":stage:"

      Returns a delimiter string based on the current environment. This delimiter is used in constructing the entity IDs. The delimiter is ':dev:' for development environments, :stage:' for staging environments and ':' for other environments.

      This allows for better differentiation and traceability of entities across various environments.

      Returns ":" | ":test:" | ":dev:" | ":stage:"

    Methods

    • Generates unique id for entity

      Parameters

      • prefix: string

        entity id prefix in database (e.g. 'u' for users)

      • Optionalapp: string

        app shortname (e.g. 'js')

      Returns string

      id in format 'jsu:xxxxxxxxxxx' or 'jsu:stage:xxxxxxxxxxx' for staging environment

    • Generates unique id with length 11

      Parameters

      • Optionalsize: number

      Returns string

      id in format 'xxxxxxxxxxx'