entityType.createcommandsince 0.1
Declares a kind of entity, its fields, and whether its entities can hold knowledge.
Request
umwelt call story.umw entityType.create '{
"projectId": "ball",
"id": "person",
"name": "Person",
"kind": "agent"
}'Request
const result = await client.entityTypeCreate({ projectId: 'ball', id: 'person', name: 'Person', kind: 'agent' });Request
var result = engine.EntityTypeCreate(new CreateEntityTypeInput
{
ProjectId = "ball",
Id = "person",
Name = "Person",
Kind = EntityKind.Agent,
});Response
{
"kind": "agent",
"id": "person",
"projectId": "ball",
"name": "Person",
"fields": []
}Payload
| Field | Type | Description |
|---|---|---|
projectIdrequired | string | The project to write to. |
id | string | Its id. Generated when absent. |
namerequired | string | Its name. |
kindrequired | "agent" | "group" | "other" | agent (a person, an NPC, a reader) and group (a guild, a council) can hold knowledge. other (a place, an object) can only be talked about. |
fields | FieldDef[]default [] | The fields its entities carry: id, key, label, type and constraints. |
Result
| Field | Type | Description |
|---|---|---|
idalways | string | The type’s id. |
projectIdalways | string | The project it belongs to. |
namealways | string | Its name. |
kindalways | "agent" | "group" | "other" | agent and group can hold knowledge; other can only be talked about. |
fields | FieldDef[] | The fields its entities carry. |
Rules
Only agents and groups hold. A Holding, Awareness or Disposition whose holder is of kind other is refused.
Errors
VALIDATION_FAILEDThe payload is malformed.CONFLICTAn entity type with that id exists.NOT_FOUNDThe project does not exist.HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.Every code is listed in Errors.
See also
Was this page helpful?