Constructor
new BaseType(berryfi, data)
- Source:
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
berryfi |
Berryfi | The Berryfi client instance. Circular reference. | |
name |
string | The Fibery name of this type. 'some/name' | |
meta |
object | The Fibery meta of this type | |
id |
string | The ID of this tupe. If App, ID is the app's label. | |
flag |
number | The flag value for this type | |
label |
string | A readable name, often the one shown in Fibery's UI | |
type |
string |
<optional> |
The Fibery type. Only present in Fields. |
fields |
Array.<object> |
<optional> |
The Fibery Fields array if this is a non-primitive Type. |
Creates a new primitive field
Parameters:
| Name | Type | Description |
|---|---|---|
berryfi |
Berryfi | The Berryfi client |
data |
object | The data directfly from Fibery |
Members
booleans :object
- Source:
Returns an object of true/false booleans based on the flag value
Type:
- object
collection :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/collection?' value
Type:
- boolean
color :string
- Source:
String - Returns 'fibery/meta' → 'ui/color' value
Type:
- string
created :Date
- Source:
Date - Returns the creation date, based on the ID (UUID v1)
Type:
- Date
defaultValue :string
- Source:
String|Object - Returns 'fibery/meta' → 'fibery/default-value' value
Type:
- string
domain :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/domain?' value
Type:
- boolean
(abstract) flag :number
- Source:
The flags value for this thing. Is set when loaded by Berryfi.pull()
Type:
- number
hasModificationDate :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/modification-date?' value
Type:
- boolean
icon :string
- Source:
String - Returns 'fibery/meta' → 'ui/mixin-icon' value
Type:
- string
isApp :boolean
- Source:
Boolean - Check if this is a user created App
Type:
- boolean
isAuxiliary :boolean
- Source:
Boolean - Check if this is a Fibery helper type or field
Type:
- boolean
isAuxiliaryField :boolean
- Source:
Boolean - Check if this is a Fibery helper field
Type:
- boolean
isAuxiliaryType :boolean
- Source:
Boolean - Check if this is a Fibery helper type
Type:
- boolean
isEntity :boolean
- Source:
Boolean - Check if this is an entity
Type:
- boolean
isField :boolean
- Source:
Boolean - Check if this is a field inside a Type
Type:
- boolean
isId :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/id?' value
Type:
- boolean
isPrimitive :boolean
- Source:
Boolean - Check if this is a primitive Fibery type
Type:
- boolean
isPublicId :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/public-id?' value
Type:
- boolean
isReadOnly :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/readonly?' value
Type:
- boolean
isSecure :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/secure?' value
Type:
- boolean
isType :boolean
- Source:
Boolean - Check if this is a Type inside an App
Type:
- boolean
isUserCreated :boolean
- Source:
Boolean - Check if this type is directly created by a user
Type:
- boolean
mixin :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'app/mixin?' value
Type:
- boolean
mixinCreateRelation :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'app/mixin-create-relation?' value
Type:
- boolean
mixins :object
- Source:
Object - Returns 'fibery/meta' → 'app/mixins' value
Type:
- object
objectEditorOrder :number
- Source:
Number - Returns 'fibery/meta' → 'ui/object-editor-order' value
Type:
- number
precision :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'ui/precision' value
Type:
- boolean
primitive :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/primitive?' value
Type:
- boolean
relation :string
- Source:
String - Returns 'fibery/meta' → 'fibery/relation' value
Type:
- string
required :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/required?' value
Type:
- boolean
showInMenu :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'ui/show-in-menu?' value
Type:
- boolean
title :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'ui/title?' value
Type:
- boolean
unique :boolean
- Source:
Boolean - Returns 'fibery/meta' → 'fibery/unique?' value
Type:
- boolean
unit :string
- Source:
String - Returns 'fibery/meta' → 'ui/number-unit' value
Type:
- string
Methods
toFibery() → {object}
- Source:
Converts the data of this to a valid Fibery schema
Example
const data = primitive.toFibery();
console.log(data);
/*
{
"fibery/name": "fibery/modification-date",
"fibery/type": "fibery/date-time",
"fibery/meta": {
"fibery/modification-date?": true,
"fibery/required?": true,
"fibery/readonly?": true,
"fibery/default-value": "$now",
"fibery/secured?": false
},
"fibery/id": "de64a8e4-a781-11ea-a8a7-539d334de305"
}
Returns:
- Type
- object