0.22.2 • Published 4 years ago

coderitter-api v0.22.2

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

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: Uses ChangeDescriptions of the package mega-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.

0.22.2

4 years ago

0.21.6

4 years ago

0.21.5

4 years ago

0.22.1

4 years ago

0.22.0

4 years ago

0.21.4

4 years ago

0.21.3

4 years ago

0.21.2

4 years ago

0.21.1

4 years ago

0.21.0

4 years ago

0.20.1

4 years ago

0.20.0

4 years ago

0.19.0

4 years ago

0.18.0

4 years ago

0.20.2

4 years ago

0.17.0

4 years ago

0.16.1

4 years ago

0.15.0

4 years ago

0.16.0

4 years ago

0.14.1

4 years ago

0.14.0

4 years ago

0.13.1

4 years ago

0.13.2

4 years ago

0.13.0

4 years ago

0.12.0

4 years ago

0.11.4

4 years ago

0.11.0

4 years ago

0.11.1

4 years ago

0.11.2

4 years ago

0.11.3

4 years ago

0.10.10

4 years ago

0.10.9

4 years ago

0.10.7

4 years ago

0.10.8

4 years ago

0.10.6

4 years ago

0.10.5

4 years ago

0.10.4

4 years ago

0.10.3

4 years ago

0.10.2

4 years ago

0.10.0

4 years ago

0.10.1

4 years ago

0.9.0

4 years ago

0.8.2

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.3.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.0

4 years ago