Regenerate definitions

This commit is contained in:
Roj Serbest 2021-11-18 14:10:39 +03:00
parent fffc137940
commit 51a4903331
2 changed files with 312 additions and 0 deletions

View File

@ -341,6 +341,37 @@
}
]
},
{
"id": "c92c1e11",
"name": "ErrorDefinition",
"description": "The object ErrorDefinition contains information about an error that the server is capable of returning if a method fails to execute.",
"parameters": [
{
"name": "id",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The ID of the ErrorDefinition, which is a crc32 hash of the following value; <ProtocolVersion>:<ErrorName>:<ErrorCode> (1.0:InternalServerError:16384)"
},
{
"name": "name",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The name of the error, this is a unique value."
},
{
"name": "description",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "A description of the error"
},
{
"name": "error_code",
"types": [{ "type": "integer", "vector": false }],
"required": true,
"description": "The error code, this is a unique value."
}
]
},
{
"id": "4182559c",
"name": "HelpDocument",
@ -366,6 +397,117 @@
}
]
},
{
"id": "defe580e",
"name": "MethodDefinition",
"description": "The object MethodDefinition contains information about method, namespace, permission requirements and the parameters it accepts",
"parameters": [
{
"name": "id",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "A crc32 hash of the methods's ID following the value; <ProtocolVersion>:<MethodName> eg; 1.0:timelime.compose"
},
{
"name": "namespace",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The namespace of the method e.g., timeline, network, etc."
},
{
"name": "method_name",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The name of the method without the namespace compose, like, repost, etc."
},
{
"name": "method",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The full name of the method with the leading namespace e.g. timeline.compose, timeline.like"
},
{
"name": "description",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The description of the method"
},
{
"name": "permission_requirements",
"types": [{ "type": "string", "vector": true }],
"required": true,
"description": "The array of permission requirements for this method"
},
{
"name": "return_types",
"types": [{ "type": "TypeDefinition", "vector": true }],
"required": true,
"description": "An array of possible return types"
}
]
},
{
"id": "91eed71b",
"name": "ObjectDefinition",
"description": "The object ObjectDefinition explains the structure of a object that the server could return or work with.",
"parameters": [
{
"name": "id",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "A crc32 hash of the object's ID following the value; <ProtocolVersion>:<ObjectName> eg; 1.0:Peer"
},
{
"name": "name",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The name of the object"
},
{
"name": "description",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "A description of the object"
},
{
"name": "parameters",
"types": [{ "type": "ParameterDefinition", "vector": true }],
"required": true,
"description": "An array of ParameterDefinitions explaining the object structure"
}
]
},
{
"id": "5ffe4dc4",
"name": "ParameterDefinition",
"description": "The object ParameterDefinition contains information about the parameters used and or available, usually represented within an array; this object indicates the availabe types, name, description and requirement of the parameter. This can be applied to object property structures or method parameters",
"parameters": [
{
"name": "name",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The name of the parameter"
},
{
"name": "types",
"types": [{ "type": "TypeDefinition", "vector": true }],
"required": true,
"description": "An array of types that are used for this parameter"
},
{
"name": "required",
"types": [{ "type": "boolean", "vector": false }],
"required": true,
"description": "Indicates if this parameter is required or not, for objects this will always be true."
},
{
"name": "description",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The description of the parameter"
}
]
},
{
"id": "1483f7dc",
"name": "Peer",
@ -624,6 +766,37 @@
}
]
},
{
"id": "2b598a3b",
"name": "ProtocolDefinitions",
"description": "The ProtocolDefinitions object contains object definitions of what the server's version of the protocol has defined and what their use cases are. Much like a documentation representation in a object structure that can be understood by clients which allows for constructors during runtime.",
"parameters": [
{
"name": "version",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The version of the protocol being used by the server, eg; 1.0"
},
{
"name": "errors",
"types": [{ "type": "ErrorDefinition", "vector": true }],
"required": true,
"description": "A list of error definitions defined by the server and protocol with their respective error codes and descriptions"
},
{
"name": "objects",
"types": [{ "type": "ObjectDefinition", "vector": true }],
"required": true,
"description": "A list of object definitions defined by the server and protocol with their respective descriptions, names and parameters."
},
{
"name": "methods",
"types": [{ "type": "MethodDefinition", "vector": true }],
"required": true,
"description": "A list of method definitions defined by the server and protocol with their respective descriptions, names and parameters."
}
]
},
{
"id": "456ff4c6",
"name": "ServerInformation",
@ -726,6 +899,12 @@
"required": true,
"description": "An array of flags that has been set to this session"
},
{
"name": "permissions",
"types": [{ "type": "string", "vector": true }],
"required": true,
"description": "An array of permission sets that has been set to this session"
},
{
"name": "authenticated",
"types": [{ "type": "boolean", "vector": false }],
@ -817,6 +996,63 @@
"description": "The value of the entity, for styling entities such as BOLD, ITALIC, etc. this value will be null, but for values such as MENTION, HASHTAG & URL the value will contain the respective value for the entity, for example a URL entity will contain a value of a http URL"
}
]
},
{
"id": "14789bf7",
"name": "TypeDefinition",
"description": "The object TypeDefinition contains information about the defined type, the vector property can indicate if the type is being represented is a vector (list/array) and should be iterated",
"parameters": [
{
"name": "type",
"types": [{ "type": "string", "vector": false }],
"required": true,
"description": "The type of the value, can either be a builtin type or one of the pre-defined object being represented as a string, eg; string, Peer, null"
},
{
"name": "vector",
"types": [{ "type": "boolean", "vector": false }],
"required": true,
"description": "An array of types that are used for this parameterIndicates if the type is represented as a vector or not (List/Array)"
}
]
}
],
"methods": [
{
"id": "a3cbf337",
"namespace": "account",
"method_name": "clear_profile_biography",
"method": "clear_profile_biography",
"description": "Clears the biography set to the user profile",
"permission_requirements": ["USER", "PROXY", "BOT"],
"parameters": [
{
"name": "session_identification",
"types": [{ "type": "SessionIdentification", "vector": false }],
"required": true,
"description": null
}
],
"possible_error_codes": [8711, 16384, 8456, 8461, 8708, 8714, 8714],
"return_types": [{ "type": "boolean", "vector": false }]
},
{
"id": "56e78bd0",
"namespace": "account",
"method_name": "clear_profile_location",
"method": "clear_profile_location",
"description": "Clears the users profile location",
"permission_requirements": ["USER", "PROXY", "BOT"],
"parameters": [
{
"name": "session_identification",
"types": [{ "type": "SessionIdentification", "vector": false }],
"required": true,
"description": null
}
],
"possible_error_codes": [8711, 16384, 8456, 8461, 8708, 8714, 8714],
"return_types": [{ "type": "boolean", "vector": false }]
}
]
}

View File

@ -24,6 +24,18 @@ export interface Document {
flags: string[];
}
// The object ErrorDefinition contains information about an error that the server is capable of returning if a method fails to execute.
export interface ErrorDefinition {
// The ID of the ErrorDefinition, which is a crc32 hash of the following value; <ProtocolVersion>:<ErrorName>:<ErrorCode> (1.0:InternalServerError:16384)
id: string;
// The name of the error, this is a unique value.
name: string;
// A description of the error
description: string;
// The error code, this is a unique value.
error_code: number;
}
// A help document is often retrieved from the server as a way to represent a document to the user for multiple purposes, from quick guides to server announcements or the legal documents required to be shown to the user before they register an account to the network.
export interface HelpDocument {
// The ID of the document, if the document gets updated then the ID will change
@ -34,6 +46,48 @@ export interface HelpDocument {
entities: TextEntity[];
}
// The object MethodDefinition contains information about method, namespace, permission requirements and the parameters it accepts
export interface MethodDefinition {
// A crc32 hash of the methods's ID following the value; <ProtocolVersion>:<MethodName> eg; 1.0:timelime.compose
id: string;
// The namespace of the method e.g., timeline, network, etc.
namespace: string;
// The name of the method without the namespace compose, like, repost, etc.
method_name: string;
// The full name of the method with the leading namespace e.g. timeline.compose, timeline.like
method: string;
// The description of the method
description: string;
// The array of permission requirements for this method
permission_requirements: string[];
// An array of possible return types
return_types: TypeDefinition[];
}
// The object ObjectDefinition explains the structure of a object that the server could return or work with.
export interface ObjectDefinition {
// A crc32 hash of the object's ID following the value; <ProtocolVersion>:<ObjectName> eg; 1.0:Peer
id: string;
// The name of the object
name: string;
// A description of the object
description: string;
// An array of ParameterDefinitions explaining the object structure
parameters: ParameterDefinition[];
}
// The object ParameterDefinition contains information about the parameters used and or available, usually represented within an array; this object indicates the availabe types, name, description and requirement of the parameter. This can be applied to object property structures or method parameters
export interface ParameterDefinition {
// The name of the parameter
name: string;
// An array of types that are used for this parameter
types: TypeDefinition[];
// Indicates if this parameter is required or not, for objects this will always be true.
required: boolean;
// The description of the parameter
description: string;
}
// A peer object provides a basic description and identification a peer entity that can contain information used to identify a peer on the client or basic flags and properties of the peer to pre-determine what actions are available for a peer.
export interface Peer {
// The ID of the document, if the document gets updated then the ID will change
@ -110,6 +164,18 @@ export interface Profile {
display_picture_sizes: DisplayPictureSize[];
}
// The ProtocolDefinitions object contains object definitions of what the server's version of the protocol has defined and what their use cases are. Much like a documentation representation in a object structure that can be understood by clients which allows for constructors during runtime.
export interface ProtocolDefinitions {
// The version of the protocol being used by the server, eg; 1.0
version: string;
// A list of error definitions defined by the server and protocol with their respective error codes and descriptions
errors: ErrorDefinition[];
// A list of object definitions defined by the server and protocol with their respective descriptions, names and parameters.
objects: ObjectDefinition[];
// A list of method definitions defined by the server and protocol with their respective descriptions, names and parameters.
methods: MethodDefinition[];
}
// The ServerInformation object is a simple object that gives details about the server's attributes and limits or location of other servers that the client should communicate to for other purposes such as a CDN.
export interface ServerInformation {
// The name of the network, eg; "Socialvoid"
@ -146,6 +212,8 @@ export interface Session {
id: string;
// An array of flags that has been set to this session
flags: string[];
// An array of permission sets that has been set to this session
permissions: string[];
// Indicates if the session is currently authenticated to a user
authenticated: boolean;
// The Unix Timestamp for when this session was first created
@ -181,3 +249,11 @@ export interface TextEntity {
// The value of the entity, for styling entities such as BOLD, ITALIC, etc. this value will be null, but for values such as MENTION, HASHTAG & URL the value will contain the respective value for the entity, for example a URL entity will contain a value of a http URL
value: string | null;
}
// The object TypeDefinition contains information about the defined type, the vector property can indicate if the type is being represented is a vector (list/array) and should be iterated
export interface TypeDefinition {
// The type of the value, can either be a builtin type or one of the pre-defined object being represented as a string, eg; string, Peer, null
type: string;
// An array of types that are used for this parameterIndicates if the type is represented as a vector or not (List/Array)
vector: boolean;
}