Skip to content

Commit ea08615

Browse files
author
Vitor
committed
refactor: applu some requested changes
1 parent 96eef0a commit ea08615

36 files changed

+1472
-1392
lines changed

deno/payloads/v10/achievement.ts

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Types extracted from https://discord.com/developers/docs/game-sdk/achievements
3+
*/
4+
5+
import type { Snowflake } from '../../globals.ts';
6+
import type { LocalizationMap } from '../common.ts';
7+
8+
export interface APIAchievement {
9+
/**
10+
* Unique id of the application
11+
*/
12+
application_id: Snowflake;
13+
/**
14+
* Name of this achievement
15+
*/
16+
name: string;
17+
/**
18+
* Localization dictionary for the `name` field
19+
*/
20+
name_localizations: LocalizationMap | null;
21+
/**
22+
* The description of this achievement
23+
*/
24+
description: string;
25+
/**
26+
* Localization dictionary for the `description` field
27+
*/
28+
description_localizations: LocalizationMap | null;
29+
/**
30+
* Whether this achievement is secret
31+
*/
32+
secret: boolean;
33+
/**
34+
* Whether this achievement is secure
35+
*/
36+
secure: boolean;
37+
/**
38+
* Unique id of this achievement
39+
*/
40+
id: Snowflake;
41+
/**
42+
* The achievement icon hash
43+
*/
44+
icon_hash: string;
45+
}

deno/payloads/v10/lobby.ts

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/**
2+
* Types extracted from https://discord.com/developers/docs/game-sdk/lobbies
3+
*/
4+
5+
import type { Snowflake } from '../../globals.ts';
6+
7+
export interface APILobby {
8+
/**
9+
* Unique id of this lobby
10+
*/
11+
id: Snowflake;
12+
/**
13+
* The type of this lobby (whether it is private or public)
14+
*
15+
* @default Private
16+
*/
17+
type: LobbyType;
18+
/**
19+
* The user id of the lobby owner
20+
*/
21+
owner_id: Snowflake;
22+
/**
23+
* The password of this lobby
24+
*/
25+
secret: string;
26+
/**
27+
* The maximum capacity of this lobby
28+
*
29+
* @default 16
30+
*/
31+
capacity: number;
32+
/**
33+
* Whether this lobby can be joined
34+
*/
35+
locked: boolean;
36+
/**
37+
* Unique id of the application
38+
*/
39+
application_id: Snowflake;
40+
/**
41+
* Metadata for this lobby. key/value pairs with type `string`
42+
*
43+
* @default {}
44+
*/
45+
metadata: Record<string, string>;
46+
/**
47+
* The region of this lobby. Defaults the region of the requesting server's IP address
48+
*/
49+
region: LobbyRegion;
50+
}
51+
52+
export enum LobbyRegion {
53+
Atlanta = 'atlanta',
54+
Brazil = 'brazil',
55+
Bucharest = 'bucharest',
56+
BuenosAires = 'buenos-aires',
57+
Dubai = 'dubai',
58+
Finland = 'finland',
59+
Hongkong = 'hongkong',
60+
India = 'india',
61+
Japan = 'japan',
62+
Madrid = 'madrid',
63+
Milan = 'milan',
64+
Montreal = 'montreal',
65+
Newark = 'newark',
66+
Rotterdam = 'rotterdam',
67+
Russia = 'russia',
68+
SantaClara = 'santa-clara',
69+
Santiago = 'santiago',
70+
Seattle = 'seattle',
71+
Singapore = 'singapore',
72+
SouthKorea = 'south-korea',
73+
SouthAfrica = 'southafrica',
74+
StPete = 'st-pete',
75+
Stockholm = 'stockholm',
76+
Sydney = 'sydney',
77+
UsCentral = 'us-central',
78+
UsEast = 'us-east',
79+
UsSouth = 'us-south',
80+
UsWest = 'us-west',
81+
}
82+
83+
export enum LobbyType {
84+
Private = 1,
85+
Public,
86+
}

deno/payloads/v10/mod.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
export * from '../common.ts';
2+
export * from './achievement.ts';
23
export * from './application.ts';
34
export * from './auditLog.ts';
45
export * from './channel.ts';
56
export * from './emoji.ts';
6-
export * from './gamesdk.ts';
77
export * from './gateway.ts';
88
export * from './guild.ts';
99
export * from './guildScheduledEvent.ts';
1010
export * from './interactions.ts';
1111
export * from './invite.ts';
12+
export * from './lobby.ts';
1213
export * from './oauth2.ts';
1314
export * from './permissions.ts';
1415
export * from './stageInstance.ts';
1516
export * from './sticker.ts';
17+
export * from './store.ts';
1618
export * from './teams.ts';
1719
export * from './template.ts';
1820
export * from './user.ts';

deno/payloads/v9/gamesdk.ts deno/payloads/v10/store.ts

+4-120
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,10 @@
11
/**
2-
* Types extracted from https://discord.com/developers/docs/game-sdk/sdk-starter-guide
2+
* Types extracted from https://discord.com/developers/docs/game-sdk/store
33
*/
44

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

8-
export interface APIAchievement {
9-
/**
10-
* Unique id of the application
11-
*/
12-
application_id: Snowflake;
13-
/**
14-
* Name of this achievement
15-
*/
16-
name: string;
17-
/**
18-
* Localization dictionary for the `name` field
19-
*/
20-
name_localizations: LocalizationMap | null;
21-
/**
22-
* The description of this achievement
23-
*/
24-
description: string;
25-
/**
26-
* Localization dictionary for the `description` field
27-
*/
28-
description_localizations: keyof LocalizationMap | null;
29-
/**
30-
* Whether this achievement is secret
31-
*/
32-
secret: boolean;
33-
/**
34-
* Whether this achievement is secure
35-
*/
36-
secure: boolean;
37-
/**
38-
* Unique id of this achievement
39-
*/
40-
id: Snowflake;
41-
/**
42-
* The achievement icon hash
43-
*/
44-
icon_hash: string;
45-
}
46-
47-
export interface APILobby {
48-
/**
49-
* Unique id of this lobby
50-
*/
51-
id: Snowflake;
52-
/**
53-
* The type of this lobby (whether it is private or public)
54-
*/
55-
type: LobbyType;
56-
/**
57-
* The user id of the lobby owner
58-
*/
59-
owner_id: Snowflake;
60-
/**
61-
* The password of this lobby
62-
*/
63-
secret: string;
64-
/**
65-
* The maximum capacity of this lobby
66-
*
67-
* @default 16
68-
*/
69-
capacity: number;
70-
/**
71-
* Whether this lobby can be joined
72-
*/
73-
locked: boolean;
74-
/**
75-
* Unique id of the application
76-
*/
77-
application_id: Snowflake;
78-
/**
79-
* Metadata for this lobby. key/value pairs with type `string`
80-
*/
81-
metadata: Record<string, string>;
82-
/**
83-
* The region of this lobby. Defaults the region of the requesting server's IP address
84-
*/
85-
region: LobbyRegion;
86-
}
87-
88-
export enum LobbyRegion {
89-
Atlanta = 'atlanta',
90-
Brazil = 'brazil',
91-
Bucharest = 'bucharest',
92-
BuenosAires = 'buenos-aires',
93-
Dubai = 'dubai',
94-
Finland = 'finland',
95-
Hongkong = 'hongkong',
96-
India = 'india',
97-
Japan = 'japan',
98-
Madrid = 'madrid',
99-
Milan = 'milan',
100-
Montreal = 'montreal',
101-
Newark = 'newark',
102-
Rotterdam = 'rotterdam',
103-
Russia = 'russia',
104-
SantaClara = 'santa-clara',
105-
Santiago = 'santiago',
106-
Seattle = 'seattle',
107-
Singapore = 'singapore',
108-
SouthKorea = 'south-korea',
109-
SouthAfrica = 'southafrica',
110-
StPete = 'st-pete',
111-
Stockholm = 'stockholm',
112-
Sydney = 'sydney',
113-
UsCentral = 'us-central',
114-
UsEast = 'us-east',
115-
UsSouth = 'us-south',
116-
UsWest = 'us-west',
117-
}
118-
119-
export enum LobbyType {
120-
Private = 1,
121-
Public,
122-
}
123-
1248
export interface APISKU {
1259
/**
12610
* Unique id of this SKU
@@ -185,7 +69,7 @@ export interface APISKU {
18569
/**
18670
* @unstable This field is missing documentation
18771
*/
188-
locales: LocalizationMap[];
72+
locales: keyof LocalizationMap[];
18973
/**
19074
* @unstable This field is missing documentation
19175
*/
@@ -200,13 +84,13 @@ export enum SKUType {
20084
/**
20185
* The SKU is a DLC
20286
*/
203-
Dlc,
87+
DLC,
20488
/**
20589
* The SKU is consumable (in-app purchase)
20690
*/
20791
Consumable,
20892
/**
209-
* The SKU is a bundle (comprising by `Application`, `Dlc` and `Consumable` all together)
93+
* The SKU is a bundle (comprising by `Application`, `DLC` and `Consumable` all together)
21094
*/
21195
Bundle,
21296
}

deno/payloads/v9/achievement.ts

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Types extracted from https://discord.com/developers/docs/game-sdk/achievements
3+
*/
4+
5+
import type { Snowflake } from '../../globals.ts';
6+
import type { LocalizationMap } from '../common.ts';
7+
8+
export interface APIAchievement {
9+
/**
10+
* Unique id of the application
11+
*/
12+
application_id: Snowflake;
13+
/**
14+
* Name of this achievement
15+
*/
16+
name: string;
17+
/**
18+
* Localization dictionary for the `name` field
19+
*/
20+
name_localizations: LocalizationMap | null;
21+
/**
22+
* The description of this achievement
23+
*/
24+
description: string;
25+
/**
26+
* Localization dictionary for the `description` field
27+
*/
28+
description_localizations: LocalizationMap | null;
29+
/**
30+
* Whether this achievement is secret
31+
*/
32+
secret: boolean;
33+
/**
34+
* Whether this achievement is secure
35+
*/
36+
secure: boolean;
37+
/**
38+
* Unique id of this achievement
39+
*/
40+
id: Snowflake;
41+
/**
42+
* The achievement icon hash
43+
*/
44+
icon_hash: string;
45+
}

0 commit comments

Comments
 (0)