summary refs log tree commit diff
path: root/src/schemas/api/developers
diff options
context:
space:
mode:
Diffstat (limited to 'src/schemas/api/developers')
-rw-r--r--src/schemas/api/developers/Application.ts62
-rw-r--r--src/schemas/api/developers/Team.ts9
-rw-r--r--src/schemas/api/developers/index.ts2
3 files changed, 73 insertions, 0 deletions
diff --git a/src/schemas/api/developers/Application.ts b/src/schemas/api/developers/Application.ts
new file mode 100644

index 00000000..8ef679e2 --- /dev/null +++ b/src/schemas/api/developers/Application.ts
@@ -0,0 +1,62 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 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 interface ApplicationCommand { + id: string; + application_id: string; + name: string; + description: string; + options?: ApplicationCommandOption[]; +} + +export interface ApplicationCommandOption { + type: ApplicationCommandOptionType; + name: string; + description: string; + required?: boolean; + choices?: ApplicationCommandOptionChoice[]; + options?: ApplicationCommandOption[]; +} + +export interface ApplicationCommandOptionChoice { + name: string; + value: string | number; +} + +export enum ApplicationCommandOptionType { + SUB_COMMAND = 1, + SUB_COMMAND_GROUP = 2, + STRING = 3, + INTEGER = 4, + BOOLEAN = 5, + USER = 6, + CHANNEL = 7, + ROLE = 8, +} + +export interface ApplicationCommandInteractionData { + id: string; + name: string; + options?: ApplicationCommandInteractionDataOption[]; +} + +export interface ApplicationCommandInteractionDataOption { + name: string; + value?: unknown; + options?: ApplicationCommandInteractionDataOption[]; +} diff --git a/src/schemas/api/developers/Team.ts b/src/schemas/api/developers/Team.ts new file mode 100644
index 00000000..94ddb8a5 --- /dev/null +++ b/src/schemas/api/developers/Team.ts
@@ -0,0 +1,9 @@ +export enum TeamMemberState { + INVITED = 1, + ACCEPTED = 2, +} +export enum TeamMemberRole { + ADMIN = "admin", + DEVELOPER = "developer", + READ_ONLY = "read_only", +} \ No newline at end of file diff --git a/src/schemas/api/developers/index.ts b/src/schemas/api/developers/index.ts
index 10717b78..e9443067 100644 --- a/src/schemas/api/developers/index.ts +++ b/src/schemas/api/developers/index.ts
@@ -15,5 +15,7 @@ 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 "./Application"; export * from "./ApplicationCreateSchema"; export * from "./ApplicationModifySchema"; +export * from "./Team";