summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-09-22 07:35:18 +0200
committerRory& <root@rory.gay>2026-09-22 07:35:18 +0200
commit404da008ba40b98cf3f270504b95ef0586e7df91 (patch)
treeef4b5d7cd2e3faa7dcc2114549ad7e6774a9b541
parentInitial avatar decorations work (diff)
downloadserver-ts-404da008ba40b98cf3f270504b95ef0586e7df91.tar.xz
Export spacebar specific schemas
-rw-r--r--assets/openapi.json674
-rw-r--r--assets/schemas.json656
-rw-r--r--src/database/entities/AvatarDecoration.ts9
-rw-r--r--src/schemas/api/index.ts1
-rw-r--r--src/schemas/api/spacebar/index.ts23
5 files changed, 782 insertions, 581 deletions
diff --git a/assets/openapi.json b/assets/openapi.json

index e9c892ee2..eb5234e6d 100644 --- a/assets/openapi.json +++ b/assets/openapi.json
@@ -1026,18 +1026,6 @@ "$ref": "#/components/schemas/PublicInvite" } }, - "PublicAvatarDecorationListResponse": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PublicAvatarDecoration" - } - }, - "PrivateAvatarDecorationListResponse": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PrivateAvatarDecoration" - } - }, "FieldErrorResponse": { "type": "object", "properties": { @@ -7283,6 +7271,348 @@ "version" ] }, + "AttachmentListResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/components/schemas/PublicAttachment" + }, + "message_reference": { + "$ref": "#/components/schemas/MessageReferenceIds" + } + }, + "additionalProperties": false, + "required": [ + "attachment", + "message_reference" + ] + } + }, + "total": { + "type": "integer" + } + }, + "required": [ + "items", + "total" + ] + }, + "PublicAvatarDecorationListResponse": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublicAvatarDecorationResponse" + } + }, + "PrivateAvatarDecorationListResponse": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PrivateAvatarDecorationResponse" + } + }, + "PublicAvatarDecorationResponse": { + "type": "object", + "properties": { + "id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "approved": { + "type": "boolean" + }, + "uploader": { + "$ref": "#/components/schemas/PartialUser" + }, + "public": { + "type": "boolean" + }, + "available": { + "type": "boolean" + } + }, + "required": [ + "approved", + "available", + "id", + "public", + "uploader" + ] + }, + "PrivateAvatarDecorationResponse": { + "type": "object", + "properties": { + "allowed_user_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_role_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "approved": { + "type": "boolean" + }, + "uploader": { + "$ref": "#/components/schemas/PartialUser" + }, + "public": { + "type": "boolean" + }, + "available": { + "type": "boolean" + } + }, + "required": [ + "allowed_guild_ids", + "allowed_role_ids", + "allowed_user_ids", + "approved", + "available", + "id", + "public", + "uploader" + ] + }, + "UpdateAvatarDecorationSchema": { + "type": "object", + "properties": { + "public": { + "type": "boolean" + }, + "allowed_user_ids": { + "type": "object", + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "allowed_guild_ids": { + "type": "object", + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "allowed_role_ids": { + "type": "object", + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + }, + "GifIntegrationsResponse": { + "type": "object", + "properties": { + "providers": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "available": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "available" + ] + } + } + }, + "required": [ + "providers" + ] + }, + "SpacebarVersionResponse": { + "type": "object", + "properties": { + "implementation": { + "type": "string" + }, + "version": { + "type": "object", + "properties": { + "rev": { + "type": [ + "null", + "string" + ] + }, + "lastModified": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "lastModified", + "rev" + ] + } + }, + "required": [ + "implementation", + "version" + ] + }, + "SpacebarWellKnownLegacyResponse": { + "type": "object", + "properties": { + "api": { + "type": "string" + } + }, + "required": [ + "api" + ] + }, + "SpacebarWellKnownClientResponse": { + "type": "object", + "properties": { + "api": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + }, + "apiVersions": { + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "active": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "active", + "default" + ] + } + }, + "additionalProperties": false, + "required": [ + "apiVersions", + "baseUrl" + ] + }, + "cdn": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "baseUrl" + ] + }, + "gateway": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + }, + "encoding": { + "type": "array", + "items": { + "type": "string" + } + }, + "compression": { + "type": "array", + "items": { + "type": [ + "null", + "string" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "baseUrl", + "compression", + "encoding" + ] + }, + "admin": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "baseUrl" + ] + } + }, + "required": [ + "api", + "cdn", + "gateway" + ] + }, "IdentifySchema": { "type": "object", "properties": { @@ -7804,197 +8134,6 @@ "sub" ] }, - "AttachmentListResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "attachment": { - "$ref": "#/components/schemas/PublicAttachment" - }, - "message_reference": { - "$ref": "#/components/schemas/MessageReferenceIds" - } - }, - "additionalProperties": false, - "required": [ - "attachment", - "message_reference" - ] - } - }, - "total": { - "type": "integer" - } - }, - "required": [ - "items", - "total" - ] - }, - "GifIntegrationsResponse": { - "type": "object", - "properties": { - "providers": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "available": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "available" - ] - } - } - }, - "required": [ - "providers" - ] - }, - "SpacebarVersionResponse": { - "type": "object", - "properties": { - "implementation": { - "type": "string" - }, - "version": { - "type": "object", - "properties": { - "rev": { - "type": [ - "null", - "string" - ] - }, - "lastModified": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "lastModified", - "rev" - ] - } - }, - "required": [ - "implementation", - "version" - ] - }, - "SpacebarWellKnownLegacyResponse": { - "type": "object", - "properties": { - "api": { - "type": "string" - } - }, - "required": [ - "api" - ] - }, - "SpacebarWellKnownClientResponse": { - "type": "object", - "properties": { - "api": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - }, - "apiVersions": { - "type": "object", - "properties": { - "default": { - "type": "string" - }, - "active": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "required": [ - "active", - "default" - ] - } - }, - "additionalProperties": false, - "required": [ - "apiVersions", - "baseUrl" - ] - }, - "cdn": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "baseUrl" - ] - }, - "gateway": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - }, - "encoding": { - "type": "array", - "items": { - "type": "string" - } - }, - "compression": { - "type": "array", - "items": { - "type": [ - "null", - "string" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "baseUrl", - "compression", - "encoding" - ] - }, - "admin": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "baseUrl" - ] - } - }, - "required": [ - "api", - "cdn", - "gateway" - ] - }, "ApplicationCommandOption": { "type": "object", "properties": { @@ -13732,83 +13871,6 @@ 3 ] }, - "PublicAvatarDecoration": { - "type": "object", - "properties": { - "id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "approved": { - "type": "boolean" - }, - "uploader": { - "$ref": "#/components/schemas/PartialUser" - }, - "public": { - "type": "boolean" - }, - "available": { - "type": "boolean" - } - }, - "required": [ - "approved", - "available", - "id", - "public", - "uploader" - ] - }, - "PrivateAvatarDecoration": { - "type": "object", - "properties": { - "allowed_user_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "allowed_guild_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "allowed_role_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "approved": { - "type": "boolean" - }, - "uploader": { - "$ref": "#/components/schemas/PartialUser" - }, - "public": { - "type": "boolean" - }, - "available": { - "type": "boolean" - } - }, - "required": [ - "allowed_guild_ids", - "allowed_role_ids", - "allowed_user_ids", - "approved", - "available", - "id", - "public", - "uploader" - ] - }, "ErrorList": { "type": "object" }, @@ -31483,6 +31545,58 @@ ] } }, + "/_spacebar/api/v1/avatar_decorations/{id}/": { + "patch": { + "security": [ + { + "bearer": [] + } + ], + "description": "Get available avatar decorations", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAvatarDecorationSchema" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicAvatarDecorationListResponse" + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "id" + } + ], + "tags": [ + "_spacebar" + ], + "x-badges": [ + { + "label": "Spacebar-only", + "color": "red" + } + ] + } + }, "/_spacebar/api/schemas.json/": { "get": { "security": [ diff --git a/assets/schemas.json b/assets/schemas.json
index 2ac0c2d16..e08fc88b1 100644 --- a/assets/schemas.json +++ b/assets/schemas.json
@@ -1048,20 +1048,6 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "PublicAvatarDecorationListResponse": { - "type": "array", - "items": { - "$ref": "#/definitions/PublicAvatarDecoration" - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "PrivateAvatarDecorationListResponse": { - "type": "array", - "items": { - "$ref": "#/definitions/PrivateAvatarDecoration" - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, "FieldErrorResponse": { "type": "object", "properties": { @@ -7803,6 +7789,366 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "AttachmentListResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/PublicAttachment" + }, + "message_reference": { + "$ref": "#/definitions/MessageReferenceIds" + } + }, + "additionalProperties": false, + "required": [ + "attachment", + "message_reference" + ] + } + }, + "total": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "items", + "total" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "PublicAvatarDecorationListResponse": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicAvatarDecorationResponse" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "PrivateAvatarDecorationListResponse": { + "type": "array", + "items": { + "$ref": "#/definitions/PrivateAvatarDecorationResponse" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "PublicAvatarDecorationResponse": { + "type": "object", + "properties": { + "id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "approved": { + "type": "boolean" + }, + "uploader": { + "$ref": "#/definitions/PartialUser" + }, + "public": { + "type": "boolean" + }, + "available": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "approved", + "available", + "id", + "public", + "uploader" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "PrivateAvatarDecorationResponse": { + "type": "object", + "properties": { + "allowed_user_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_role_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "approved": { + "type": "boolean" + }, + "uploader": { + "$ref": "#/definitions/PartialUser" + }, + "public": { + "type": "boolean" + }, + "available": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "allowed_guild_ids", + "allowed_role_ids", + "allowed_user_ids", + "approved", + "available", + "id", + "public", + "uploader" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "UpdateAvatarDecorationSchema": { + "type": "object", + "properties": { + "public": { + "type": "boolean" + }, + "allowed_user_ids": { + "type": "object", + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "allowed_guild_ids": { + "type": "object", + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "allowed_role_ids": { + "type": "object", + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GifIntegrationsResponse": { + "type": "object", + "properties": { + "providers": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "available": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "available" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "providers" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "SpacebarVersionResponse": { + "type": "object", + "properties": { + "implementation": { + "type": "string" + }, + "version": { + "type": "object", + "properties": { + "rev": { + "type": [ + "null", + "string" + ] + }, + "lastModified": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "lastModified", + "rev" + ] + } + }, + "additionalProperties": false, + "required": [ + "implementation", + "version" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "SpacebarWellKnownLegacyResponse": { + "type": "object", + "properties": { + "api": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "api" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "SpacebarWellKnownClientResponse": { + "type": "object", + "properties": { + "api": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + }, + "apiVersions": { + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "active": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "active", + "default" + ] + } + }, + "additionalProperties": false, + "required": [ + "apiVersions", + "baseUrl" + ] + }, + "cdn": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "baseUrl" + ] + }, + "gateway": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + }, + "encoding": { + "type": "array", + "items": { + "type": "string" + } + }, + "compression": { + "type": "array", + "items": { + "type": [ + "null", + "string" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "baseUrl", + "compression", + "encoding" + ] + }, + "admin": { + "type": "object", + "properties": { + "baseUrl": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "baseUrl" + ] + } + }, + "additionalProperties": false, + "required": [ + "api", + "cdn", + "gateway" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "IdentifySchema": { "type": "object", "properties": { @@ -8348,207 +8694,6 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "AttachmentListResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "attachment": { - "$ref": "#/definitions/PublicAttachment" - }, - "message_reference": { - "$ref": "#/definitions/MessageReferenceIds" - } - }, - "additionalProperties": false, - "required": [ - "attachment", - "message_reference" - ] - } - }, - "total": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "items", - "total" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "GifIntegrationsResponse": { - "type": "object", - "properties": { - "providers": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "available": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "available" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "providers" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "SpacebarVersionResponse": { - "type": "object", - "properties": { - "implementation": { - "type": "string" - }, - "version": { - "type": "object", - "properties": { - "rev": { - "type": [ - "null", - "string" - ] - }, - "lastModified": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "lastModified", - "rev" - ] - } - }, - "additionalProperties": false, - "required": [ - "implementation", - "version" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "SpacebarWellKnownLegacyResponse": { - "type": "object", - "properties": { - "api": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "api" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "SpacebarWellKnownClientResponse": { - "type": "object", - "properties": { - "api": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - }, - "apiVersions": { - "type": "object", - "properties": { - "default": { - "type": "string" - }, - "active": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "required": [ - "active", - "default" - ] - } - }, - "additionalProperties": false, - "required": [ - "apiVersions", - "baseUrl" - ] - }, - "cdn": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "baseUrl" - ] - }, - "gateway": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - }, - "encoding": { - "type": "array", - "items": { - "type": "string" - } - }, - "compression": { - "type": "array", - "items": { - "type": [ - "null", - "string" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "baseUrl", - "compression", - "encoding" - ] - }, - "admin": { - "type": "object", - "properties": { - "baseUrl": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "baseUrl" - ] - } - }, - "additionalProperties": false, - "required": [ - "api", - "cdn", - "gateway" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "ApplicationCommandOption": { "type": "object", "properties": { @@ -14639,87 +14784,6 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "PublicAvatarDecoration": { - "type": "object", - "properties": { - "id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "approved": { - "type": "boolean" - }, - "uploader": { - "$ref": "#/definitions/PartialUser" - }, - "public": { - "type": "boolean" - }, - "available": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "approved", - "available", - "id", - "public", - "uploader" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "PrivateAvatarDecoration": { - "type": "object", - "properties": { - "allowed_user_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "allowed_guild_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "allowed_role_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "approved": { - "type": "boolean" - }, - "uploader": { - "$ref": "#/definitions/PartialUser" - }, - "public": { - "type": "boolean" - }, - "available": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "allowed_guild_ids", - "allowed_role_ids", - "allowed_user_ids", - "approved", - "available", - "id", - "public", - "uploader" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "ErrorList": { "type": "object", "additionalProperties": false, diff --git a/src/database/entities/AvatarDecoration.ts b/src/database/entities/AvatarDecoration.ts
index 695de8850..97bd13415 100644 --- a/src/database/entities/AvatarDecoration.ts +++ b/src/database/entities/AvatarDecoration.ts
@@ -17,8 +17,7 @@ */ import { Column, Entity, Index, JoinColumn, ManyToOne, RelationId } from "typeorm"; -import { AvatarDecorationData } from "@spacebar/schemas"; -import { PublicAvatarDecoration } from "@spacebar/schemas/api/spacebar/AvatarDecorations"; +import { AvatarDecorationData, PublicAvatarDecorationResponse } from "@spacebar/schemas"; import { BaseClass } from "./BaseClass"; import { User } from "./User"; @@ -62,13 +61,13 @@ export class AvatarDecorations extends BaseClass { } satisfies AvatarDecorationData; } - toPublicAvatarDecoration(opts?: {available: boolean}): PublicAvatarDecoration { + toPublicAvatarDecoration(opts?: { available: boolean }): PublicAvatarDecorationResponse { return { id: this.id, approved: this.approved, uploader: this.uploader.toPartialUser(), public: this.public, - available: opts?.available ?? this.public - } satisfies PublicAvatarDecoration; + available: opts?.available ?? this.public, + } satisfies PublicAvatarDecorationResponse; } } diff --git a/src/schemas/api/index.ts b/src/schemas/api/index.ts
index 42888e435..1c6c251d4 100644 --- a/src/schemas/api/index.ts +++ b/src/schemas/api/index.ts
@@ -23,4 +23,5 @@ export * from "./guilds"; export * from "./integrations"; export * from "./messages"; export * from "./reports"; +export * from "./spacebar"; export * from "./users"; diff --git a/src/schemas/api/spacebar/index.ts b/src/schemas/api/spacebar/index.ts new file mode 100644
index 000000000..a973fdb80 --- /dev/null +++ b/src/schemas/api/spacebar/index.ts
@@ -0,0 +1,23 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +export * from "./AttachmentListResponse"; +export * from "./AvatarDecorations"; +export * from "./Integrations"; +export * from "./Version"; +export * from "./WellKnown";