Skip to content

Commit

Permalink
refactor: applu some requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vvito7 committed Jul 15, 2022
1 parent 89b2f67 commit 5eda23f
Show file tree
Hide file tree
Showing 36 changed files with 1,472 additions and 1,392 deletions.
45 changes: 45 additions & 0 deletions deno/payloads/v10/achievement.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Types extracted from https://discord.com/developers/docs/game-sdk/achievements
*/

import type { Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';

export interface APIAchievement {
/**
* Unique id of the application
*/
application_id: Snowflake;
/**
* Name of this achievement
*/
name: string;
/**
* Localization dictionary for the `name` field
*/
name_localizations: LocalizationMap | null;
/**
* The description of this achievement
*/
description: string;
/**
* Localization dictionary for the `description` field
*/
description_localizations: LocalizationMap | null;
/**
* Whether this achievement is secret
*/
secret: boolean;
/**
* Whether this achievement is secure
*/
secure: boolean;
/**
* Unique id of this achievement
*/
id: Snowflake;
/**
* The achievement icon hash
*/
icon_hash: string;
}
86 changes: 86 additions & 0 deletions deno/payloads/v10/lobby.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* Types extracted from https://discord.com/developers/docs/game-sdk/lobbies
*/

import type { Snowflake } from '../../globals.ts';

export interface APILobby {
/**
* Unique id of this lobby
*/
id: Snowflake;
/**
* The type of this lobby (whether it is private or public)
*
* @default Private
*/
type: LobbyType;
/**
* The user id of the lobby owner
*/
owner_id: Snowflake;
/**
* The password of this lobby
*/
secret: string;
/**
* The maximum capacity of this lobby
*
* @default 16
*/
capacity: number;
/**
* Whether this lobby can be joined
*/
locked: boolean;
/**
* Unique id of the application
*/
application_id: Snowflake;
/**
* Metadata for this lobby. key/value pairs with type `string`
*
* @default {}
*/
metadata: Record<string, string>;
/**
* The region of this lobby. Defaults the region of the requesting server's IP address
*/
region: LobbyRegion;
}

export enum LobbyRegion {
Atlanta = 'atlanta',
Brazil = 'brazil',
Bucharest = 'bucharest',
BuenosAires = 'buenos-aires',
Dubai = 'dubai',
Finland = 'finland',
Hongkong = 'hongkong',
India = 'india',
Japan = 'japan',
Madrid = 'madrid',
Milan = 'milan',
Montreal = 'montreal',
Newark = 'newark',
Rotterdam = 'rotterdam',
Russia = 'russia',
SantaClara = 'santa-clara',
Santiago = 'santiago',
Seattle = 'seattle',
Singapore = 'singapore',
SouthKorea = 'south-korea',
SouthAfrica = 'southafrica',
StPete = 'st-pete',
Stockholm = 'stockholm',
Sydney = 'sydney',
UsCentral = 'us-central',
UsEast = 'us-east',
UsSouth = 'us-south',
UsWest = 'us-west',
}

export enum LobbyType {
Private = 1,
Public,
}
4 changes: 3 additions & 1 deletion deno/payloads/v10/mod.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
export * from '../common.ts';
export * from './achievement.ts';
export * from './application.ts';
export * from './auditLog.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gamesdk.ts';
export * from './gateway.ts';
export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './lobby.ts';
export * from './oauth2.ts';
export * from './permissions.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './store.ts';
export * from './teams.ts';
export * from './template.ts';
export * from './user.ts';
Expand Down
124 changes: 4 additions & 120 deletions deno/payloads/v9/gamesdk.ts → deno/payloads/v10/store.ts
Original file line number Diff line number Diff line change
@@ -1,126 +1,10 @@
/**
* Types extracted from https://discord.com/developers/docs/game-sdk/sdk-starter-guide
* Types extracted from https://discord.com/developers/docs/game-sdk/store
*/

import type { Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';

export interface APIAchievement {
/**
* Unique id of the application
*/
application_id: Snowflake;
/**
* Name of this achievement
*/
name: string;
/**
* Localization dictionary for the `name` field
*/
name_localizations: LocalizationMap | null;
/**
* The description of this achievement
*/
description: string;
/**
* Localization dictionary for the `description` field
*/
description_localizations: keyof LocalizationMap | null;
/**
* Whether this achievement is secret
*/
secret: boolean;
/**
* Whether this achievement is secure
*/
secure: boolean;
/**
* Unique id of this achievement
*/
id: Snowflake;
/**
* The achievement icon hash
*/
icon_hash: string;
}

export interface APILobby {
/**
* Unique id of this lobby
*/
id: Snowflake;
/**
* The type of this lobby (whether it is private or public)
*/
type: LobbyType;
/**
* The user id of the lobby owner
*/
owner_id: Snowflake;
/**
* The password of this lobby
*/
secret: string;
/**
* The maximum capacity of this lobby
*
* @default 16
*/
capacity: number;
/**
* Whether this lobby can be joined
*/
locked: boolean;
/**
* Unique id of the application
*/
application_id: Snowflake;
/**
* Metadata for this lobby. key/value pairs with type `string`
*/
metadata: Record<string, string>;
/**
* The region of this lobby. Defaults the region of the requesting server's IP address
*/
region: LobbyRegion;
}

export enum LobbyRegion {
Atlanta = 'atlanta',
Brazil = 'brazil',
Bucharest = 'bucharest',
BuenosAires = 'buenos-aires',
Dubai = 'dubai',
Finland = 'finland',
Hongkong = 'hongkong',
India = 'india',
Japan = 'japan',
Madrid = 'madrid',
Milan = 'milan',
Montreal = 'montreal',
Newark = 'newark',
Rotterdam = 'rotterdam',
Russia = 'russia',
SantaClara = 'santa-clara',
Santiago = 'santiago',
Seattle = 'seattle',
Singapore = 'singapore',
SouthKorea = 'south-korea',
SouthAfrica = 'southafrica',
StPete = 'st-pete',
Stockholm = 'stockholm',
Sydney = 'sydney',
UsCentral = 'us-central',
UsEast = 'us-east',
UsSouth = 'us-south',
UsWest = 'us-west',
}

export enum LobbyType {
Private = 1,
Public,
}

export interface APISKU {
/**
* Unique id of this SKU
Expand Down Expand Up @@ -185,7 +69,7 @@ export interface APISKU {
/**
* @unstable This field is missing documentation
*/
locales: LocalizationMap[];
locales: keyof LocalizationMap[];
/**
* @unstable This field is missing documentation
*/
Expand All @@ -200,13 +84,13 @@ export enum SKUType {
/**
* The SKU is a DLC
*/
Dlc,
DLC,
/**
* The SKU is consumable (in-app purchase)
*/
Consumable,
/**
* The SKU is a bundle (comprising by `Application`, `Dlc` and `Consumable` all together)
* The SKU is a bundle (comprising by `Application`, `DLC` and `Consumable` all together)
*/
Bundle,
}
Expand Down
45 changes: 45 additions & 0 deletions deno/payloads/v9/achievement.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Types extracted from https://discord.com/developers/docs/game-sdk/achievements
*/

import type { Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';

export interface APIAchievement {
/**
* Unique id of the application
*/
application_id: Snowflake;
/**
* Name of this achievement
*/
name: string;
/**
* Localization dictionary for the `name` field
*/
name_localizations: LocalizationMap | null;
/**
* The description of this achievement
*/
description: string;
/**
* Localization dictionary for the `description` field
*/
description_localizations: LocalizationMap | null;
/**
* Whether this achievement is secret
*/
secret: boolean;
/**
* Whether this achievement is secure
*/
secure: boolean;
/**
* Unique id of this achievement
*/
id: Snowflake;
/**
* The achievement icon hash
*/
icon_hash: string;
}

0 comments on commit 5eda23f

Please sign in to comment.