From 4577ac2609f4a861505bc41f4293f482db251cdc Mon Sep 17 00:00:00 2001 From: Vitor Date: Fri, 15 Jul 2022 21:47:05 +0100 Subject: [PATCH] feat(APIConnection): add `ConnectionService` to `type` (#491) * feat: add `ConnectionService` to `APIConnection#type` * feat: add `epicgames` * feat: add old connections * refactor: capitalization * feat: add missing `SamsungGalaxy` --- deno/payloads/v10/user.ts | 22 +++++++++++++++++++++- deno/payloads/v9/user.ts | 22 +++++++++++++++++++++- payloads/v10/user.ts | 22 +++++++++++++++++++++- payloads/v9/user.ts | 22 +++++++++++++++++++++- 4 files changed, 84 insertions(+), 4 deletions(-) diff --git a/deno/payloads/v10/user.ts b/deno/payloads/v10/user.ts index 2225edb73..cfa02cc0c 100644 --- a/deno/payloads/v10/user.ts +++ b/deno/payloads/v10/user.ts @@ -178,8 +178,10 @@ export interface APIConnection { name: string; /** * The service of the connection + * + * See https://discord.com/developers/docs/resources/user#connection-object-services */ - type: string; + type: ConnectionService; /** * Whether the connection is revoked */ @@ -210,6 +212,24 @@ export interface APIConnection { visibility: ConnectionVisibility; } +export enum ConnectionService { + BattleNet = 'battlenet', + EpicGames = 'epicgames', + Facebook = 'facebook', + GitHub = 'github', + LeagueOfLegends = 'leagueoflegends', + PlayStationNetwork = 'playstation', + Reddit = 'reddit', + SamsungGalaxy = 'samsunggalaxy', + Spotify = 'spotify', + Skype = 'skype', + Steam = 'steam', + Twitch = 'twitch', + Twitter = 'twitter', + Xbox = 'xbox', + YouTube = 'youtube', +} + export enum ConnectionVisibility { /** * Invisible to everyone except the user themselves diff --git a/deno/payloads/v9/user.ts b/deno/payloads/v9/user.ts index 2225edb73..cfa02cc0c 100644 --- a/deno/payloads/v9/user.ts +++ b/deno/payloads/v9/user.ts @@ -178,8 +178,10 @@ export interface APIConnection { name: string; /** * The service of the connection + * + * See https://discord.com/developers/docs/resources/user#connection-object-services */ - type: string; + type: ConnectionService; /** * Whether the connection is revoked */ @@ -210,6 +212,24 @@ export interface APIConnection { visibility: ConnectionVisibility; } +export enum ConnectionService { + BattleNet = 'battlenet', + EpicGames = 'epicgames', + Facebook = 'facebook', + GitHub = 'github', + LeagueOfLegends = 'leagueoflegends', + PlayStationNetwork = 'playstation', + Reddit = 'reddit', + SamsungGalaxy = 'samsunggalaxy', + Spotify = 'spotify', + Skype = 'skype', + Steam = 'steam', + Twitch = 'twitch', + Twitter = 'twitter', + Xbox = 'xbox', + YouTube = 'youtube', +} + export enum ConnectionVisibility { /** * Invisible to everyone except the user themselves diff --git a/payloads/v10/user.ts b/payloads/v10/user.ts index 84cb0d6c0..b4546ce03 100644 --- a/payloads/v10/user.ts +++ b/payloads/v10/user.ts @@ -178,8 +178,10 @@ export interface APIConnection { name: string; /** * The service of the connection + * + * See https://discord.com/developers/docs/resources/user#connection-object-services */ - type: string; + type: ConnectionService; /** * Whether the connection is revoked */ @@ -210,6 +212,24 @@ export interface APIConnection { visibility: ConnectionVisibility; } +export enum ConnectionService { + BattleNet = 'battlenet', + EpicGames = 'epicgames', + Facebook = 'facebook', + GitHub = 'github', + LeagueOfLegends = 'leagueoflegends', + PlayStationNetwork = 'playstation', + Reddit = 'reddit', + SamsungGalaxy = 'samsunggalaxy', + Spotify = 'spotify', + Skype = 'skype', + Steam = 'steam', + Twitch = 'twitch', + Twitter = 'twitter', + Xbox = 'xbox', + YouTube = 'youtube', +} + export enum ConnectionVisibility { /** * Invisible to everyone except the user themselves diff --git a/payloads/v9/user.ts b/payloads/v9/user.ts index 84cb0d6c0..b4546ce03 100644 --- a/payloads/v9/user.ts +++ b/payloads/v9/user.ts @@ -178,8 +178,10 @@ export interface APIConnection { name: string; /** * The service of the connection + * + * See https://discord.com/developers/docs/resources/user#connection-object-services */ - type: string; + type: ConnectionService; /** * Whether the connection is revoked */ @@ -210,6 +212,24 @@ export interface APIConnection { visibility: ConnectionVisibility; } +export enum ConnectionService { + BattleNet = 'battlenet', + EpicGames = 'epicgames', + Facebook = 'facebook', + GitHub = 'github', + LeagueOfLegends = 'leagueoflegends', + PlayStationNetwork = 'playstation', + Reddit = 'reddit', + SamsungGalaxy = 'samsunggalaxy', + Spotify = 'spotify', + Skype = 'skype', + Steam = 'steam', + Twitch = 'twitch', + Twitter = 'twitter', + Xbox = 'xbox', + YouTube = 'youtube', +} + export enum ConnectionVisibility { /** * Invisible to everyone except the user themselves