Data model of the konsumation apps
- AttributeDefinition
- description
- name
- id
- unit
- unit
- schemaVersion
- serial
- validFrom
- fractionalDigits
- fractionalDigits
- order
- value
- date
- Base
- Category
- SCHEMA_VERSION_2
- SCHEMA_VERSION_3
- SCHEMA_VERSION_CURRENT
- Master
- Meter
- Note
- toText
- Value
Type: Object
-
type
string -
isKey
boolean -
isForeign
boolean do we represent a foreign entity -
writable
boolean -
mandatory
boolean -
default
any? the default value
Type: AttributeDefinition
Type: AttributeDefinition
Type: AttributeDefinition
Type: AttributeDefinition
Returns string
Type: string?
Type: AttributeDefinition
Type: AttributeDefinition
Type: AttributeDefinition
Type: AttributeDefinition
Type: number?
Type: AttributeDefinition
Type: AttributeDefinition
Type: AttributeDefinition
Is the given attribute defined in the target. Some attributes are inherited from parent object and therfore not defined in the target.
-
name
string
Returns boolean
Object keys are the mapped external attribute names.
-
mapping
Returns Object
Object keys are the mapped external attribute names but only for local (not isForeign) ones.
-
mapping
Returns Object
Sets values with external attribute names.
-
values
Object
Returns string
Attribute definitions.
Returns Object
Maping of attribute names from internal (javascript) to external (database).
Returns Object
Extends Base
Value Category.
-
attributes
Object
Type: string
Type: string?
Type: number?
Type: string?
Type: string?
Write into store.
-
context
any
Delete Category from store.
-
context
any
List assigned meters.
-
context
any -
options
Object?
Returns AsyncIterable<Meter>
Deliver Meter for a given name.
-
context
any -
name
string
Returns Promise<(Meter | undefined)>
Currently active Meter.
-
context
any
Returns Promise<(Meter | undefined)>
Add a meter to the category;
-
context
any -
attributes
Object
Returns Meter
Delete a meter.
-
context
any -
name
string
Returns Promise<any>
All notes from all meters.
-
context
any
Returns AsyncIterable<Note>
Deliver Value for a given date.
-
context
any -
name
string
Returns Promise<(Note | undefined)>
All values from all meters.
-
context
any
Returns AsyncIterable<Value>
Deliver Value for a given date.
-
context
any -
date
Date
Returns Promise<(Value | undefined)>
Get the latest value.
-
context
any
Returns Promise<({date: Date, value: number} | undefined)>
Add a value to the active meter.
Returns Promise<any>
Delete a value from the active meter.
-
context
any -
date
Date
Returns Promise<any>
Text representation.
-
context
any
Returns AsyncIterable<string>
Name of the type in text dump
Returns string
Schema with type + name
Type: string
Values are attached to the meter. Value dates may be given as iso date.
Type: string
Schema version for newly created databases
Extends Base
-
values
-
schemaVersion
string
Write attributes store.
-
context
any
Add a category.
-
context
any -
attributes
Object
Returns Category
-
context
any
Returns AsyncIterable<Category>
-
context
any -
name
string
Returns Promise<(Category | undefined)>
Create text representation
-
context
(optional, defaultthis.context
)
Returns AsyncIterable<string>
-
input
AsyncIterable<Uint8Array>
Extends Base
-
attributes
Object
Type: string
Type: Category
Type: string?
Type: string?
Type: Date
-
context
any
-
context
any
-
context
any
Returns AsyncIterable<Value>
Deliver value for a given date.
-
context
any -
date
Date
Returns Promise<(Value | undefined)>
Add a new value.
Delete a value.
-
context
any -
date
Date
Returns Promise<void>
Get the latest value.
-
context
any
Returns Promise<(Value | undefined)>
List assigned Notes.
-
context
any -
options
Object?
Returns AsyncIterable<Note>
Deliver Note for a given name.
-
context
any -
name
string
Returns Promise<(Note | undefined)>
Add a note to the meter;
-
context
any -
attributes
Object
Returns Note
delete a note.
-
context
any -
name
string
Returns Promise<void>
Text representation.
-
context
any
Returns AsyncIterable<string>
Name of the type in text dump.
Returns string
Name of the parents type.
Returns string
Extends Base
-
attributes
Object
Type: string
Type: string?
Type: Meter
Write into store.
-
context
any
Delete from store.
-
context
any
Text representation.
-
context
any
Returns AsyncIterable<string>
Name of the type in text dump.
Returns string
Name of the parents type.
Returns string
Text representation.
Returns AsyncIterable<string>
Extends Base
-
attributes
Object
Type: Meter
Type: Date
Type: number
Write into store.
-
context
any
Delete from store.
-
context
any
Text representation.
-
context
any
Returns AsyncIterable<string>
Name of the type in text dump
Returns string
Name of the parents type.
Returns string
With npm do:
npm install @konsumation/model
BSD-2-Clause