diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-18 23:45:29 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-18 23:45:29 +1100 |
commit | b74453d802d8a616d97b9e06f152f6fc2d041405 (patch) | |
tree | d9feb794d785f8a63a55514090be967ca87ef81c /src/util/schemas | |
parent | Whoops (diff) | |
download | server-b74453d802d8a616d97b9e06f152f6fc2d041405.tar.xz |
Refactor applications
Diffstat (limited to 'src/util/schemas')
-rw-r--r-- | src/util/schemas/ApplicationCreateSchema.ts | 4 | ||||
-rw-r--r-- | src/util/schemas/ApplicationModifySchema.ts | 14 | ||||
-rw-r--r-- | src/util/schemas/BotModifySchema.ts | 4 | ||||
-rw-r--r-- | src/util/schemas/Validator.ts | 1 | ||||
-rw-r--r-- | src/util/schemas/index.ts | 5 |
5 files changed, 27 insertions, 1 deletions
diff --git a/src/util/schemas/ApplicationCreateSchema.ts b/src/util/schemas/ApplicationCreateSchema.ts new file mode 100644 index 00000000..6a021b46 --- /dev/null +++ b/src/util/schemas/ApplicationCreateSchema.ts @@ -0,0 +1,4 @@ +export interface ApplicationCreateSchema { + name: string; + team_id?: string | number; +} \ No newline at end of file diff --git a/src/util/schemas/ApplicationModifySchema.ts b/src/util/schemas/ApplicationModifySchema.ts new file mode 100644 index 00000000..ab23d57e --- /dev/null +++ b/src/util/schemas/ApplicationModifySchema.ts @@ -0,0 +1,14 @@ +export interface ApplicationModifySchema { + description?: string; + icon?: string; + interactions_endpoint_url?: string; + max_participants?: number | null; + name?: string; + privacy_policy_url?: string; + role_connections_verification_url?: string; + tags?: string[]; + terms_of_service_url?: string; + bot_public?: boolean; + bot_require_code_grant?: boolean; + flags?: number; +} \ No newline at end of file diff --git a/src/util/schemas/BotModifySchema.ts b/src/util/schemas/BotModifySchema.ts new file mode 100644 index 00000000..b801ab27 --- /dev/null +++ b/src/util/schemas/BotModifySchema.ts @@ -0,0 +1,4 @@ +export interface BotModifySchema { + avatar?: string; + username?: string; +} \ No newline at end of file diff --git a/src/util/schemas/Validator.ts b/src/util/schemas/Validator.ts index e85cdf7b..9b7f0eca 100644 --- a/src/util/schemas/Validator.ts +++ b/src/util/schemas/Validator.ts @@ -22,6 +22,7 @@ export const ajv = new Ajv({ messages: true, strict: true, strictRequired: true, + allowUnionTypes: true, }); addFormats(ajv); diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts index 780022c6..58565496 100644 --- a/src/util/schemas/index.ts +++ b/src/util/schemas/index.ts @@ -45,4 +45,7 @@ export * from "./UserGuildSettingsSchema"; export * from "./GatewayPayloadSchema"; export * from "./RolePositionUpdateSchema"; export * from "./ChannelReorderSchema"; -export * from "./UserSettingsSchema"; \ No newline at end of file +export * from "./UserSettingsSchema"; +export * from "./BotModifySchema"; +export * from "./ApplicationModifySchema"; +export * from "./ApplicationCreateSchema"; \ No newline at end of file |