coderitter-api v0.22.2
Coderitter API
This package contains the core files usable both in the server and client applications.
Install
npm install coderitter-api
Overview
This package exposes the content of the following packages.
Result
The Coderitter API style defines a result object which is sent back to the requesting client.
class Result<T> {
type: string
value!: T
mismatch!: Mismatch
remoteError!: string
IsudInterface (insert, select, update, delete)
The interface IsudInterface
defines the basic ISUD methods. They are using the Coderitter API options and result objects. If its appropriate then use this as a starting point.
interface IsudInterface<T> {
insert(options: DbInsertOptions): Promise<Result<DbInsertResult<T>>>
select(options?: DbSelectOptions): Promise<Result<DbSelectResult<T>>>
update(options?: DbUpdateOptions): Promise<Result<DbUpdateResult>>
delete(options?: DbDeleteOptions): Promise<Result<DbDeleteResult>>
}
We do not use CRUD (create, read, update, delete) terms here because we are in the realm of the database.
CrudInterface (create, read, update, delete)
The interface CrudInterface
defines the basic CRUD methods. They are using the Coderitter API options and result objects. If its appropriate then use this as a starting point.
interface CrudInterface<T> {
create(options: LogicCreateOptions<T>): Promise<Result<LogicCreateResult>>
read(options?: LogicReadOptions): Promise<Result<LogicReadResult<T>>>
update(options: LogicUpdateOptions<T>): Promise<Result<LogicUpdateResult>>
delete(options: LogicDeleteOptions): Promise<Result<LogicDeleteResult>>
}
Component
Visual components always use a model according to the MVC pattern to describe the data which is displayed in the component. The class Component
is be used as the base class for component models.
class Component {
componentId?: string
usedEntities: ChangeDescription[] = []
It contains
componentId
: A unique id to identify that instance of that certain component type. This is useful in React for example.usedEntites
: UsesChangeDescription
s of the packagemega-nice-change-event
to describe the component's displayed entities which it wants to be informed of its changes.
EventBus
A very simple and event bus implementation to be used to spead change events both on the server and on the client.
FormTranslationVisitor
A visitor for any form element of mega-nice-form
which translates the path of such an element to a title.
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago