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.
Name | Is Higher Order (Hybrid) | Has attachments | Description | Constructor params | Format params | Example valid values |
---|---|---|---|---|---|---|
Boolean | true or flase | none | none | "true", "false", true, false, 0, 1 | ||
CachedValue | ✅ | Remember a value and only recalculate it when some event occurs | see docs | same as the extended field | same as the extended field | |
Color | Stores a color as string | none | none | "#ff000", "red" | ||
ControlAccess | ✅ | Controls who can display and/or edit the given field | see docs | same as the extended field | same as the extended field | |
Date | Stores a date, as in a day in calendar, without time. | none | none | "2020-12-31" | ||
Datetime | Stores a timestamp as ms since epoch. Timezone-independent. | none | null or "human_readable" | 1610214993421 | ||
DerivedValue | ✅ | Calculates a value based on other fields within the same item and stores it. | see docs | same as the extended field | same as the extended field | |
DisallowUpdate | ✅ | Allows to set the value once and then disallow any changes to it. | one argument - the extended field - a Field instance | same as the extended field | same as the extended field | |
An email address | none | none | "user@example.com" | |||
Enum | Allows only values from a predefined list | an array of allowed values or a function that takes an app instance and returns an array of allowed values | none | as defined in constructor params | ||
File | Any kind of file | none | none | a photo, a movie, a pdf | ||
Float | Any real number | none | none | 1, 1.5, -10, 3.1415926 | ||
Html | Takes text containing HTML and sanitizes it to prevent js injection | none | "original" or "safe" | "<h1>Hello, world</h1>" | ||
Image | An image. Can be scaled to different sizes automatically | none | one of the image formats defined in config | a JPG file | ||
Int | An integer. Takes only whole numbers | {min: number, max: number} | none | 1, 2, -10, 10000 | ||
JsonObject | Takes in arbitrary objects. Could be unsafe, requires investigation. | none | none | {a: "A"} | ||
Password | A hashed password. Used in the users collection | none | none | "alamakota123" | ||
Required | ✅ | Wrapper that makes the wrapped field required. | Warning: this is a function, not a class. Argument: child_field: Field | same as extended field | same 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 field | see docs | none | n/a | |
SecretToken | Attaches a secret token when creating an item. The token cannot be read without SuperContext | none | none | n/a | ||
SessionID | Basically a mutable uuid | none | none | n/a - the values are generated automatically | ||
SettableBy | ✅ | Wraps a field and makes it editable only to users matching a given Policy | child_field: Field, policy: Policy | same as extended field | same as extended field | |
SingleReference | ✅ | References another item from given collection | the target collection as string | none | "umvg6-\_1" | |
Text | A text field | {full_text_search: boolean, min_length: number, max_length: number} | "original" or "safe" (no value means "safe") | "Hello, world" | ||
ValueExistingInCollection | Accepts as a value only values that exist as values of other field in other collection | field: string, collection: string, include_forbidden: boolean | same as target field | same as for target field | ||
ValueNotExistingInCollection | Opposite to ValueExistingInCollection. Only not-yet-seen values are accepted | as above | same as target field | same as target field | ||
File Metadata
File Metadata
- Mime Type
- text/plain
- Expires
- Wed, May 7, 19:48 (1 d, 1 h)
- Storage Engine
- blob
- Storage Format
- Raw Data
- Storage Handle
- 632629
- Default Alt Text
- field-types.remarkup (12 KB)