Models
Models API contains all base types of the GNX
library. It is technically the core of the library.
🧪 Types
GUID
The GUID
type is a string that represents a unique identifier. It is used to identify a model in the database.
Id
The Id
type is a string that represents a unique identifier. It is used to identify a model in the database.
ServiceParamsWithId
The ServiceParamsWithId
type is used to pass the id
parameter to the service methods.
ServiceParamsWithEntity
The ServiceParamsWithEntity
type is used to pass the entity
parameter to the service methods.
SequelizeEntity
The SequelizeEntity
type is used to pass the entity
parameter to the service methods.
TypegooseEntity
The TypegooseEntity
type is used to pass the entity
parameter to the service methods.
🧪 Interfaces
Entity
The Entity
interface is the base interface for all models. It contains the createdAt
and updatedAt
fields.
Schema
The Schema
interface is the base interface for all schemas. It contains the field
and allowNull
fields.
Pagination
The Pagination
interface is the base interface for all paginated responses. It contains the data
, total
, page
and limit
fields.
PaginationType
The PaginationType
interface is the base interface for all paginated requests. It contains the page
and limit
fields.
ExcludeFields
The ExcludeFields
interface is the base interface for all excluded fields.
GenericService
The GenericService
interface is the base interface for all services. It contains the basic CRUD operations and the getSchema
method.
ServiceParams
The ServiceParams
interface is the base interface for all service parameters. It contains the id
and entity
fields.
⚠️ Exceptions
GNXError
The GNXError
interface is the base interface for all exceptions. It contains the message
and errorType
fields.
GNXErrorTypes
The GNXErrorTypes
enum is the base enum for all exceptions. It contains the message
and errorType
fields.