Page MenuHomeSealhub

field-types.remarkup
No OneTemporary

Authored By
Unknown
Size
21 KB
Referenced Files
None
Subscribers
None

field-types.remarkup

Built-in Fields

Below is a list of field types that Sealious comes packaged with. You can also
create your own field types - see
./creating-field-types.remarkup.

NameIs Higher Order (Hybrid)Has attachmentsDescriptionConstructor paramsFormat paramsExample valid values
Booleantrue or flasenonenone"true", "false", true, false, 0, 1
CachedValue✅Remember a value and only recalculate it when some event occurssee docssame as the extended fieldsame as the extended field
ColorStores a color as stringnonenone"#ff000", "red"
ControlAccess✅Controls who can display and/or edit the given fieldsee docssame as the extended fieldsame as the extended field
CoordinatesStores value in GeoJSON formatnone"string" or "object" or "tuple"strings: "12.12421,65.21312", tuple: [12.12421, 65.21312] or object: { lat: 12.12421, lon: 65.21312 }
DateStores a date, as in a day in calendar, without time.nonenone"2020-12-31"
DatetimeStores a timestamp as ms since epoch. Timezone-independent.nonenull or "human_readable"1610214993421
DerivedValue✅Calculates a value based on other fields within the same item and stores it.see docssame as the extended fieldsame as the extended field
DeepReverseSingleReference✅Stores an array of ids connected to a given item through n-to-n relationshipsee docsnonen/a - the values are generated automatically
DisallowUpdate✅Allows to set the value once and then disallow any changes to it.one argument - the extended field - a Field instancesame as the extended fieldsame as the extended field
EmailAn email addressnonenone"user@example.com"
EnumAllows only values from a predefined listan array of allowed values or a function that takes an app instance and returns an array of allowed valuesnoneas defined in constructor params
EnumMultipleStores an array of predefined stringsan array of allowed string values. See docsnone["cat", "dog", "bee"] - See docs
FileAny kind of filenonenonea photo, a movie, a pdf
FloatAny real numbernonenone1, 1.5, -10, 3.1415926
HtmlTakes text containing HTML and sanitizes it to prevent js injectionnone"original" or "safe""<h1>Hello, world</h1>"
ImageAn image. Can be scaled to different sizes automaticallynone"file", "url" or "path"a JPG file
IntAn integer. Takes only whole numbers{min: number, max: number}none1, 2, -10, 10000
ItemDraft✅An object of field values for another collection. Used to store drafts of items in other collectionscollection: Collectionnone{title: "Article draft"}
JsonObjectTakes in arbitrary objects. Could be unsafe, requires investigation.nonenone{a: "A"}
MoneyKeeps float value and provides ability to format as string with decode methodnonenull or "string"1, 15.99, 34.234
PasswordA hashed password. Used in the users collectionnonenone"alamakota123"
Required✅Wrapper that makes the wrapped field required.Warning: this is a function, not a class. Argument: child_field: Fieldsame as extended fieldsame as extended field, except for lack of value or null, which will be rejected
ReverseSingleReference✅A list of all items from a given collection that point to this item in a given fieldsee docsnonen/a
SecretTokenAttaches a secret token when creating an item. The token cannot be read without SuperContextnonenonen/a
SessionIDBasically a mutable uuidnonenonen/a - the values are generated automatically
SettableBy✅Wraps a field and makes it editable only to users matching a given Policychild_field: Field, policy: Policysame as extended fieldsame as extended field
SingleReference✅References another item from given collectionthe target collection as stringnone"umvg6-\_1"
StructuredArray✅can haveAn array of objects. Each object has the same defined field structureRecord<string, Field> See docsnone[{name: "pen", price: 1.0}, {name: "apple", price: 0}]. See docs
TextA text field{full_text_search: boolean, min_length: number, max_length: number}"original" or "safe" (no value means "safe")"Hello, world"
ValueExistingInCollectionAccepts as a value only values that exist as values of other field in other collectionfield: string, collection: string, include_forbidden: booleansame as target fieldsame as for target field
ValueNotExistingInCollectionOpposite to ValueExistingInCollection. Only not-yet-seen values are acceptedas abovesame as target fieldsame as target field
UuidStores an automatically generated UUID stringnonenone"9c990663-91f8-431c-8bdd-0f9b1d2541b3"
UrlAccepts valid url links. You can also put some restrictions regardless valid domains and protocols{ allowed_origins: ["https://www.sealcode.it/"], allowed_protocols: ["https"] } (see docs)https://example.com/

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 7, 16:08 (15 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1181872
Default Alt Text
field-types.remarkup (21 KB)

Event Timeline