A list of all schemas and how they're used.
Schemas may have the following types, specified as the "type"
:
json-table
A table containing stored JSON entries.json-view
A view of JSON data which is generated at runtime.blob-view
A view of binary blobs which is generated at runtime.dbmethod
A callable method defined on a database.
Schemas contain the following standard attributes:
id
The ID of the schema (e.g."ctzn.network/post"
).title
A human-readable title for the schema.description
A human-readable description of the schema.type
A string identifying what type of information the schema represents.keyTemplate
An array defining how to generate keys in the table, used whentype
is"json-table"
. See "Key Templates" below.definition
An object defining the schema, used whentype
is"json-table"
,"json-view"
, or"dbmethod"
. In the case ofjson-table
, defines the record schema. In the case ofjson-view
anddbmethod
, defines the schema of a response. Is a JSON Schema.parameters
An object defining call parameters, used whentype
is"json-view"
,"blob-view"
, or"dbmethod"
. Is a JSON Schema.
Key templates are used to automatically generate the keys in a table. They are an array of objects. If the array has multiple items, they represent segments which are concatenated together (useful for generating compound keys).
Here are some example key templates:
[{"type": "auto"}] // an auto-generated key
[{"type": "json-pointer", "value": "/username"}] // a key generated from the record data
[{"type": "string", "value": "profile"}] // a fixed-string key
// a compound key generated from the record data:
[
{"type": "json-pointer", "value": "/username"},
{"type": "string", "value": ":"},
{"type": "json-pointer", "value": "/pagename"}
]
The objects in a key template fit the following shape:
type
The type of template segment. Must be one of:"auto"
An auto-generated string which is guaranteed to monotonically increase."json-pointer"
A json-pointer which references a value in the data. Must resolve to a literal (string, number, boolean) and not an object or array."string"
A fixed string value.
value
The value of the segment, depending on the type.- When
type = json-pointer
, a json-pointer to the record attribute which will be used as the key. - When
type = string
, a string which will always be inserted in that segment.
- When
ctzn.network/dbmethod-call
A method-call to be handled by some databasectzn.network/dbmethod-result
The result of a method-call which has been handled by some database
ctzn.network/user
Record of a hosted user or community
ctzn.network/account
Internal record of a hosted userctzn.network/account-session
Internal record of a login sessionctzn.network/index-state
Record of indexing statesctzn.network/user-db-idx
Index that maps user db URLs to DNS-IDs
ctzn.network/profile
Record of user info (name, description, etc)ctzn.network/post
A single postctzn.network/comment
A comment on some itemctzn.network/reaction
A reaction-string attached to some URLctzn.network/follow
Record of following another userctzn.network/community-membership
Record of membership in a community
ctzn.network/index-state
Record of indexing statesctzn.network/follow-idx
Index of follows by followed users & selfctzn.network/thread-idx
Index of 'self' reply-posts by followed users & selfctzn.network/reaction-idx
Index of reactions by followed users & selfctzn.network/notification-idx
Index of notification activity by followed users & self
ctzn.network/profile
Record of community info (name, description, etc)ctzn.network/community-member
Record of member usersctzn.network/community-role
Role definition in the communityctzn.network/community-ban
Record of a ban from the communityctzn.network/index-state
Record of indexing statesctzn.network/feed-idx
Index of content in the community feedctzn.network/follow-idx
Index of follows by community membersctzn.network/thread-idx
Index of community reply-posts by community membersctzn.network/reaction-idx
Index of reactions by community membersctzn.network/notification-idx
Index of notification activity by community members
ctzn.network/avatar-view
The avatar image of a given user.ctzn.network/blob-view
A generic binary-blob getter.ctzn.network/comment-view
Get a comment-record.ctzn.network/community-user-permission-view
Get a user's permission in a community.ctzn.network/community-user-permissions-view
Get multiple of a user's permissions in a community.ctzn.network/feed-view
Get the content in a user's feed.ctzn.network/followers-view
Get multiple known followers of a user.ctzn.network/notifications-view
Get notification records of a user.ctzn.network/notifications-cleared-at-view
Get the "notifications cleared at" timestap record of auser.ctzn.network/notifications-count-view
Count the notification records of a user.ctzn.network/post-view
Get a post-record.ctzn.network/posts-view
Get multiple post-records for a user.ctzn.network/profile-view
Get the profile-record of a user.ctzn.network/reactions-to-view
Get the reaction-records for a given subject.ctzn.network/thread-view
Get a post-record and any relevant comment records.
See the permissions document.
See the dbmethods document.