Field

Field

Represents a Field in a Type

Constructor

new Field(berryfi, data)

Source:
Properties:
Name Type Attributes Description
berryfi Berryfi The Berryfi client instance. Circular reference.
parentType Type The Type this Field is a child of
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 field
Parameters:
Name Type Description
berryfi Berryfi The Berryfi client instance
data object The data to populate this field

Extends

Members

booleans :object

Source:
Overrides:
Returns an object of true/false booleans based on the flag value
Type:
  • object

collection :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/collection?' value
Type:
  • boolean

color :string

Source:
Overrides:
String - Returns 'fibery/meta' → 'ui/color' value
Type:
  • string

created :Date

Source:
Overrides:
Date - Returns the creation date, based on the ID (UUID v1)
Type:
  • Date

defaultValue :string

Source:
Overrides:
String|Object - Returns 'fibery/meta' → 'fibery/default-value' value
Type:
  • string

domain :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/domain?' value
Type:
  • boolean

(abstract) flag :number

Source:
Overrides:
The flags value for this thing. Is set when loaded by Berryfi.pull()
Type:
  • number

hasModificationDate :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/modification-date?' value
Type:
  • boolean

icon :string

Source:
Overrides:
String - Returns 'fibery/meta' → 'ui/mixin-icon' value
Type:
  • string

isApp :boolean

Source:
Overrides:
Boolean - Check if this is a user created App
Type:
  • boolean

isAuxiliary :boolean

Source:
Overrides:
Boolean - Check if this is a Fibery helper type or field
Type:
  • boolean

isAuxiliaryField :boolean

Source:
Overrides:
Boolean - Check if this is a Fibery helper field
Type:
  • boolean

isAuxiliaryType :boolean

Source:
Overrides:
Boolean - Check if this is a Fibery helper type
Type:
  • boolean

isEntity :boolean

Source:
Overrides:
Boolean - Check if this is an entity
Type:
  • boolean

isField :boolean

Source:
Overrides:
Boolean - Check if this is a field inside a Type
Type:
  • boolean

isId :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/id?' value
Type:
  • boolean

isPrimitive :boolean

Source:
Overrides:
Boolean - Check if this is a primitive Fibery type
Type:
  • boolean

isPublicId :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/public-id?' value
Type:
  • boolean

isReadOnly :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/readonly?' value
Type:
  • boolean

isSecure :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/secure?' value
Type:
  • boolean

isType :boolean

Source:
Overrides:
Boolean - Check if this is a Type inside an App
Type:
  • boolean

isUserCreated :boolean

Source:
Overrides:
Boolean - Check if this type is directly created by a user
Type:
  • boolean

mixin :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'app/mixin?' value
Type:
  • boolean

mixinCreateRelation :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'app/mixin-create-relation?' value
Type:
  • boolean

mixins :object

Source:
Overrides:
Object - Returns 'fibery/meta' → 'app/mixins' value
Type:
  • object

objectEditorOrder :number

Source:
Overrides:
Number - Returns 'fibery/meta' → 'ui/object-editor-order' value
Type:
  • number

precision :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'ui/precision' value
Type:
  • boolean

primitive :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/primitive?' value
Type:
  • boolean

relation :string

Source:
Overrides:
String - Returns 'fibery/meta' → 'fibery/relation' value
Type:
  • string

required :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/required?' value
Type:
  • boolean

showInMenu :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'ui/show-in-menu?' value
Type:
  • boolean

title :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'ui/title?' value
Type:
  • boolean

unique :boolean

Source:
Overrides:
Boolean - Returns 'fibery/meta' → 'fibery/unique?' value
Type:
  • boolean

unit :string

Source:
Overrides:
String - Returns 'fibery/meta' → 'ui/number-unit' value
Type:
  • string

Methods

toFibery() → {object}

Source:
Overrides:
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