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 | |
Coordinates | Stores value in GeoJSON format | none | "string" or "object" or "tuple" | strings: "12.12421,65.21312", tuple: [12.12421, 65.21312] or object: { lat: 12.12421, lon: 65.21312 } | ||
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 | |
DeepReverseSingleReference | ✅ | Stores an array of ids connected to a given item through n-to-n relationship | see docs | none | n/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 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 | ||
EnumMultiple | Stores an array of predefined strings | an array of allowed string values. See docs | none | ["cat", "dog", "bee"] - See docs | ||
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 | "file", "url" or "path" | 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"} | ||
Money | Keeps float value and provides ability to format as string with decode method | none | null or "string" | 1, 15.99, 34.234 | ||
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" | |
StructuredArray | An array of objects. Each object has the same defined field structure | Record<string, Field> See docs | none | [{name: "pen", price: 1.0}, {name: "apple", price: 0}]. See docs | ||
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 | ||
Uuid | Stores an automatically generated UUID string | none | none | "9c990663-91f8-431c-8bdd-0f9b1d2541b3" | ||
Url | Accepts 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
File Metadata
- Mime Type
- text/plain
- Expires
- Thu, Mar 27, 03:30 (19 h, 38 m)
- Storage Engine
- blob
- Storage Format
- Raw Data
- Storage Handle
- 619415
- Default Alt Text
- field-types.remarkup (20 KB)