Bakery Resources
Resource Type | Description |
---|---|
resource_client | Client resource. At least one client is required. |
resource_module | Module resource. |
resource_entity | Entity resource |
resource_user | User resource |
resource_module
id
Type: int
, computed, immutable
ID of the module.
identifier
Type: string
Identifier of the module.
type
Type: string
, immutable, default: "module"
(optional) Type of the module.
icon
Type: string
, default: "question"
(optional) Icon of the module.
title
Type: string
, default: ""
(optional) Title definition.
fields
Type: list(schema)
, default: []
(optional) List of field definitions.
-
id
Type:
int
, computed, immutableID of the field.
-
configKey
Type:
string
(optional) Only needed when the field is going to be or was renamed. This ensures that the correct field in the system is matched to this field configuration.
-
identifier
Type:
string
Identifier of the field.
-
type
Type:
string
, default:"text"
(optional) Type of the field.
-
options
Type:
object(schema)
, default:{}
(optional) Field options.
layouts
Type: map
, default: {}
(optional) Layouts of the module, where keys correspond to layout types and values to layout specs.
options
Type: object(schema)
, default: {}
(optional) Options for the module.
-
single_entity
Type:
bool
, default:false
(optional) Prevents showing the index layout and always opens the first entity found.
-
two_factor
Type:
object(schema)
(optional)
-
type
Type:
string
2fa type (e.g.
"email"
). -
view
Type:
Entity
Entity of type
view
to use for the 2fa notification.
-
-
offline
Type:
object
(optional) Options for the offline mode.
-
enabled
Type:
bool
, default:false
Whether the module is available offline.
-
download
Type:
object
Options for the download.
-
trigger
Type:
string
Trigger for the download. One of
"manual"
,"auto"
. -
filters
Type:
object[][]
Filters for the entities when downloading. Defaults to no filters, meaning all entities the user has access to are downloaded.
-
pages
Type:
int
Number of pages to download. If set to
-1
, all pages are downloaded.
-
-
Examples
Invoice module
[ { "resource_module": "invoices", "resource": { "identifier": "invoices", "title": "number", "icon": "file-text", "fields": [ { "identifier": "customer", "type": "select", "options": { "references": "customers" } }, { "identifier": "number", "type": "increment" }, { "identifier": "dueDate", "type": "date" }, { "identifier": "items", "type": "list", "options": { "fields": [ { "identifier": "amount", "type": "text" }, { "identifier": "product", "type": "select", "options": { "references": "products" } } ] } } ], "layouts": { "detail": { "tabs": [ { "identifier": "general", "rows": [ { "cols": [ { "components": [ { "type": "field_group", "options": { "fields": [ "customer", "number", "dueDate", "items" ] } } ] } ] } ] } ] } } } }]
resource_client
id
Type: int
, computed, immutable
ID of the client.
module
Type: string
Module identifier of the client.
fields
Type: object(schema)
, default: []
(optional) List of field attributes. Schema: generated from the module’s fields during the planning phase.
global
Type: bool
, immutable, default: false
(optional) Whether this client is a global client that demands ID 0
.
hostnames
Type: list(string)
, default: []
(optional) List of hostnames that belong to this client.
Examples
Client entity
[ { "resource_entity": "client", "resource": { "module": "clients", "fields": { "name": "Strawberry", "description": "Strawberry client" }, "hostnames": ["strawberry.brezel.io"] } }]
Global client entity
[ { "resource_entity": "global_client", "resource": { "module": "clients", "fields": { "name": "Strawberry", "description": "Strawberry client" }, "global": true } }]
resource_entity
id
Type: int
, computed, immutable
ID of the entity.
module
Type: string
Module identifier of the entity.
client
Type: Entity
, default: current global client
(optional) Client of the entity.
fields
Type: object(schema)
, default: []
(optional) List of field attributes. Schema: generated from the module’s fields during the planning phase.
Examples
Invoice entity
[ { "resource_entity": "invoice", "resource": { "module": "invoices", "fields": { "dueDate": "2069-06-09", "positions": [ { "amount": 10, "product": { "id": "${resource_entity.pretzel.id}" } } ] } } }]
resource_user
id
Type: int
, computed, immutable
ID of the user.
module
Type: string
Module identifier of the user.
client
Type: Entity
, default: current global client
(optional) Client of the user.
root
Type: bool
, default: false
(optional) Whether this user is a root user.
fields
Type: object(schema)
, default: []
(optional) List of field attributes. Schema: generated from the module’s fields during the planning phase.
Examples
User entity
[ { "resource_user": "admin", "resource": { "module": "users", "fields": { "email": "admin@brezel.io" } } }]