glitch-javascript-sdk 3.1.4 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +739 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Multiplayer.d.ts +871 -0
- package/dist/esm/api/RedditSubreddits.d.ts +35 -0
- package/dist/esm/api/Scheduler.d.ts +17 -1
- package/dist/esm/api/ServerOperations.d.ts +7 -0
- package/dist/esm/api/Titles.d.ts +84 -0
- package/dist/esm/api/index.d.ts +6 -0
- package/dist/esm/constants/HttpMethods.d.ts +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +739 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/MultiplayerRoute.d.ts +7 -0
- package/dist/esm/routes/RedditSubredditsRoute.d.ts +7 -0
- package/dist/esm/routes/ServerOperationsRoute.d.ts +7 -0
- package/dist/esm/util/Requests.d.ts +1 -0
- package/dist/index.d.ts +1012 -1
- package/package.json +4 -1
- package/src/api/Multiplayer.ts +1012 -0
- package/src/api/RedditSubreddits.ts +53 -0
- package/src/api/Scheduler.ts +23 -1
- package/src/api/ServerOperations.ts +16 -0
- package/src/api/Titles.ts +109 -0
- package/src/api/index.ts +7 -1
- package/src/constants/HttpMethods.ts +2 -1
- package/src/index.ts +7 -1
- package/src/routes/MultiplayerRoute.ts +46 -0
- package/src/routes/RedditSubredditsRoute.ts +14 -0
- package/src/routes/SchedulerRoute.ts +2 -0
- package/src/routes/ServerOperationsRoute.ts +17 -0
- package/src/routes/TitlesRoute.ts +12 -1
- package/src/util/Requests.ts +21 -1
package/dist/index.d.ts
CHANGED
|
@@ -3968,6 +3968,41 @@ declare class SocialPosts {
|
|
|
3968
3968
|
}): AxiosPromise<Response<T>>;
|
|
3969
3969
|
}
|
|
3970
3970
|
|
|
3971
|
+
type GameReviewRecommendation = 'recommended' | 'not_recommended' | 'neutral';
|
|
3972
|
+
type GameReviewSentiment = 'positive' | 'mixed' | 'negative';
|
|
3973
|
+
type GameReviewVoteType = 'helpful' | 'funny' | 'detailed' | 'not_helpful';
|
|
3974
|
+
type GameReviewReportReason = 'abuse' | 'spam' | 'off_topic' | 'manipulation' | 'hate' | 'personal_info' | 'other';
|
|
3975
|
+
interface GameReviewRatings {
|
|
3976
|
+
gameplay?: GameReviewSentiment;
|
|
3977
|
+
performance?: GameReviewSentiment;
|
|
3978
|
+
value?: GameReviewSentiment;
|
|
3979
|
+
content?: GameReviewSentiment;
|
|
3980
|
+
multiplayer?: GameReviewSentiment;
|
|
3981
|
+
monetization?: GameReviewSentiment;
|
|
3982
|
+
stability?: GameReviewSentiment;
|
|
3983
|
+
localization?: GameReviewSentiment;
|
|
3984
|
+
accessibility?: GameReviewSentiment;
|
|
3985
|
+
}
|
|
3986
|
+
interface CreateGameReviewRequest {
|
|
3987
|
+
recommendation: GameReviewRecommendation;
|
|
3988
|
+
title: string;
|
|
3989
|
+
body: string;
|
|
3990
|
+
review_type?: 'first_impression' | 'full_review' | 'bug_performance_warning' | 'early_access_feedback' | 'multiplayer_community_feedback' | 'monetization_pricing_feedback' | 'changed_opinion_after_update';
|
|
3991
|
+
liked?: string;
|
|
3992
|
+
needs_work?: string;
|
|
3993
|
+
audience?: string;
|
|
3994
|
+
language?: string;
|
|
3995
|
+
game_version?: string;
|
|
3996
|
+
platform?: string;
|
|
3997
|
+
acquisition_type?: 'purchased' | 'free_to_play' | 'free_copy' | 'promotional_key' | 'beta_key' | 'demo' | 'external_verified';
|
|
3998
|
+
received_for_free?: boolean;
|
|
3999
|
+
early_access?: boolean;
|
|
4000
|
+
current_version_review?: boolean;
|
|
4001
|
+
main_negative_reason?: 'bugs_crashes' | 'bad_performance' | 'not_enough_content' | 'misleading_marketing' | 'price_value' | 'monetization' | 'community_toxicity' | 'developer_business_decision' | 'localization' | 'server_network' | 'gameplay_design' | 'not_my_type' | 'other';
|
|
4002
|
+
change_reason?: string;
|
|
4003
|
+
ratings?: GameReviewRatings;
|
|
4004
|
+
}
|
|
4005
|
+
type UpdateGameReviewRequest = Partial<CreateGameReviewRequest>;
|
|
3971
4006
|
declare class Titles {
|
|
3972
4007
|
/**
|
|
3973
4008
|
* List all the Titles.
|
|
@@ -4675,6 +4710,55 @@ declare class Titles {
|
|
|
4675
4710
|
static wishlistConversions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4676
4711
|
static wishlistGeo<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4677
4712
|
static wishlistDevices<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4713
|
+
/**
|
|
4714
|
+
* List public reviews for a title.
|
|
4715
|
+
*
|
|
4716
|
+
* @param title_id The UUID of the title.
|
|
4717
|
+
* @param params Optional filters: recommendation, language, current_version_only,
|
|
4718
|
+
* verified_only, platform, acquisition_type, complaint, playtime, sort, per_page.
|
|
4719
|
+
*/
|
|
4720
|
+
static listReviews<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4721
|
+
/**
|
|
4722
|
+
* Get aggregate review scores and structured praise/complaint summaries.
|
|
4723
|
+
*/
|
|
4724
|
+
static reviewSummary<T>(title_id: string, params?: {
|
|
4725
|
+
language?: string;
|
|
4726
|
+
}): AxiosPromise<Response<T>>;
|
|
4727
|
+
/**
|
|
4728
|
+
* Create the current user's review for a title. The backend verifies play/purchase eligibility.
|
|
4729
|
+
*/
|
|
4730
|
+
static createReview<T>(title_id: string, data: CreateGameReviewRequest): AxiosPromise<Response<T>>;
|
|
4731
|
+
/**
|
|
4732
|
+
* View a single review, including revision history when the backend includes it.
|
|
4733
|
+
*/
|
|
4734
|
+
static viewReview<T>(review_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4735
|
+
/**
|
|
4736
|
+
* Update the current user's review and preserve a backend revision trail.
|
|
4737
|
+
*/
|
|
4738
|
+
static updateReview<T>(review_id: string, data: UpdateGameReviewRequest): AxiosPromise<Response<T>>;
|
|
4739
|
+
/**
|
|
4740
|
+
* Delete the current user's review, or a title admin's moderated review.
|
|
4741
|
+
*/
|
|
4742
|
+
static deleteReview<T>(review_id: string): AxiosPromise<Response<T>>;
|
|
4743
|
+
/**
|
|
4744
|
+
* Vote on a review as helpful, funny, detailed, or not helpful.
|
|
4745
|
+
*/
|
|
4746
|
+
static voteReview<T>(review_id: string, vote_type: GameReviewVoteType): AxiosPromise<Response<T>>;
|
|
4747
|
+
/**
|
|
4748
|
+
* Report a review for moderation.
|
|
4749
|
+
*/
|
|
4750
|
+
static reportReview<T>(review_id: string, data: {
|
|
4751
|
+
reason: GameReviewReportReason;
|
|
4752
|
+
notes?: string;
|
|
4753
|
+
}): AxiosPromise<Response<T>>;
|
|
4754
|
+
/**
|
|
4755
|
+
* Create or update the title developer's official response to a review.
|
|
4756
|
+
*/
|
|
4757
|
+
static respondToReview<T>(review_id: string, data: {
|
|
4758
|
+
body: string;
|
|
4759
|
+
linked_patch_note_id?: string;
|
|
4760
|
+
issue_marked_fixed?: boolean;
|
|
4761
|
+
}): AxiosPromise<Response<T>>;
|
|
4678
4762
|
}
|
|
4679
4763
|
|
|
4680
4764
|
declare class Campaigns {
|
|
@@ -6982,7 +7066,7 @@ declare class Scheduler {
|
|
|
6982
7066
|
*/
|
|
6983
7067
|
static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6984
7068
|
/**
|
|
6985
|
-
* Get
|
|
7069
|
+
* Get subreddit recommendations for a scheduler.
|
|
6986
7070
|
*
|
|
6987
7071
|
* @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
|
|
6988
7072
|
*
|
|
@@ -7001,6 +7085,22 @@ declare class Scheduler {
|
|
|
7001
7085
|
* @returns promise
|
|
7002
7086
|
*/
|
|
7003
7087
|
static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7088
|
+
/**
|
|
7089
|
+
* Match the scheduler title to indexed Reddit communities.
|
|
7090
|
+
*
|
|
7091
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
7092
|
+
* @param data Optional post context and filters.
|
|
7093
|
+
* @returns promise
|
|
7094
|
+
*/
|
|
7095
|
+
static getRedditSubredditMatches<T>(scheduler_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7096
|
+
/**
|
|
7097
|
+
* Position a registered game for a subreddit and optionally prepare Reddit draft content.
|
|
7098
|
+
*
|
|
7099
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
7100
|
+
* @param data The target subreddit and optional post context.
|
|
7101
|
+
* @returns promise
|
|
7102
|
+
*/
|
|
7103
|
+
static getRedditSubredditPositioning<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7004
7104
|
/**
|
|
7005
7105
|
* Get all posts and comments for a scheduler.
|
|
7006
7106
|
*
|
|
@@ -7088,6 +7188,39 @@ declare class Scheduler {
|
|
|
7088
7188
|
static getTikTokRecommendedKeywords<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7089
7189
|
}
|
|
7090
7190
|
|
|
7191
|
+
declare class RedditSubreddits {
|
|
7192
|
+
/**
|
|
7193
|
+
* Search indexed Reddit communities for game marketing research.
|
|
7194
|
+
*
|
|
7195
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/indexRedditSubreddits
|
|
7196
|
+
*/
|
|
7197
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7198
|
+
/**
|
|
7199
|
+
* Get an analyzed subreddit record by display name.
|
|
7200
|
+
*
|
|
7201
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/showRedditSubreddit
|
|
7202
|
+
*/
|
|
7203
|
+
static show<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7204
|
+
/**
|
|
7205
|
+
* Match a game concept to relevant Reddit communities.
|
|
7206
|
+
*
|
|
7207
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/matchRedditSubreddits
|
|
7208
|
+
*/
|
|
7209
|
+
static match<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7210
|
+
/**
|
|
7211
|
+
* Admin-only ingestion of subreddit metadata and rules.
|
|
7212
|
+
*
|
|
7213
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/ingestRedditSubreddits
|
|
7214
|
+
*/
|
|
7215
|
+
static ingest<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7216
|
+
/**
|
|
7217
|
+
* Admin-only refresh for one subreddit.
|
|
7218
|
+
*
|
|
7219
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/refreshRedditSubreddit
|
|
7220
|
+
*/
|
|
7221
|
+
static refresh<T>(subreddit: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7222
|
+
}
|
|
7223
|
+
|
|
7091
7224
|
declare class Funnel {
|
|
7092
7225
|
/**
|
|
7093
7226
|
* Get funnel metrics.
|
|
@@ -8091,6 +8224,880 @@ declare class Crm {
|
|
|
8091
8224
|
static deleteContact<T>(contact_id: string): AxiosPromise<Response<T>>;
|
|
8092
8225
|
}
|
|
8093
8226
|
|
|
8227
|
+
type MultiplayerLobbyType = 'public' | 'invisible' | 'friends_only' | 'private';
|
|
8228
|
+
type MultiplayerLobbyState = 'waiting' | 'ready' | 'in_game' | 'closed';
|
|
8229
|
+
type MultiplayerLobbyMemberStatus = 'joined' | 'left' | 'disconnected' | 'kicked' | 'banned';
|
|
8230
|
+
type MultiplayerLobbyMessageType = 'chat' | 'binary' | 'system' | 'ready' | 'invite' | 'kick' | 'voice';
|
|
8231
|
+
type MultiplayerServerType = 'dedicated' | 'listen' | 'relay';
|
|
8232
|
+
type MultiplayerServerStatus = 'active' | 'available' | 'draining' | 'offline';
|
|
8233
|
+
type MultiplayerTransport = 'udp' | 'tcp' | 'webrtc' | 'relay';
|
|
8234
|
+
type MultiplayerSessionState = 'reserved' | 'active' | 'released' | 'expired';
|
|
8235
|
+
type MultiplayerAuthTicketStatus = 'active' | 'consumed' | 'revoked' | 'expired';
|
|
8236
|
+
type MultiplayerFavoriteKind = 'favorite' | 'history';
|
|
8237
|
+
type MultiplayerVoiceProvider = 'glitch_relay' | 'external';
|
|
8238
|
+
type MultiplayerVoiceTopology = 'lobby' | 'server' | 'party' | 'proximity';
|
|
8239
|
+
type MultiplayerVoiceState = 'active' | 'closed';
|
|
8240
|
+
type MultiplayerVoiceCodec = 'opus' | 'pcm16' | 'aac';
|
|
8241
|
+
type MultiplayerVoiceParticipantStatus = 'joined' | 'left' | 'muted' | 'kicked';
|
|
8242
|
+
type MultiplayerVoicePacketType = 'audio' | 'speaking' | 'mute_state' | 'offer' | 'answer' | 'ice' | 'control';
|
|
8243
|
+
type MultiplayerMetadata = Record<string, any>;
|
|
8244
|
+
interface MultiplayerLobbyMember {
|
|
8245
|
+
id: string;
|
|
8246
|
+
lobby_id: string;
|
|
8247
|
+
player_id: string;
|
|
8248
|
+
user_id?: string | null;
|
|
8249
|
+
display_name?: string | null;
|
|
8250
|
+
status: MultiplayerLobbyMemberStatus;
|
|
8251
|
+
ready: boolean;
|
|
8252
|
+
member_data: MultiplayerMetadata;
|
|
8253
|
+
joined_at?: string | null;
|
|
8254
|
+
last_seen_at?: string | null;
|
|
8255
|
+
left_at?: string | null;
|
|
8256
|
+
}
|
|
8257
|
+
interface MultiplayerServer {
|
|
8258
|
+
id: string;
|
|
8259
|
+
title_id: string;
|
|
8260
|
+
name: string;
|
|
8261
|
+
server_type: MultiplayerServerType;
|
|
8262
|
+
status: MultiplayerServerStatus;
|
|
8263
|
+
region?: string | null;
|
|
8264
|
+
build_version?: string | null;
|
|
8265
|
+
host?: string | null;
|
|
8266
|
+
game_port?: number | null;
|
|
8267
|
+
query_port?: number | null;
|
|
8268
|
+
transport: MultiplayerTransport;
|
|
8269
|
+
connection_uri?: string | null;
|
|
8270
|
+
max_players: number;
|
|
8271
|
+
current_players: number;
|
|
8272
|
+
bot_players: number;
|
|
8273
|
+
secure: boolean;
|
|
8274
|
+
password_protected: boolean;
|
|
8275
|
+
private: boolean;
|
|
8276
|
+
tags: string[];
|
|
8277
|
+
rules: MultiplayerMetadata;
|
|
8278
|
+
metadata: MultiplayerMetadata;
|
|
8279
|
+
last_heartbeat_at?: string | null;
|
|
8280
|
+
expires_at?: string | null;
|
|
8281
|
+
created_at?: string | null;
|
|
8282
|
+
updated_at?: string | null;
|
|
8283
|
+
}
|
|
8284
|
+
interface MultiplayerLobby {
|
|
8285
|
+
id: string;
|
|
8286
|
+
title_id: string;
|
|
8287
|
+
server_id?: string | null;
|
|
8288
|
+
owner_player_id: string;
|
|
8289
|
+
owner_user_id?: string | null;
|
|
8290
|
+
lobby_type: MultiplayerLobbyType;
|
|
8291
|
+
state: MultiplayerLobbyState;
|
|
8292
|
+
joinable: boolean;
|
|
8293
|
+
max_members: number;
|
|
8294
|
+
member_count: number;
|
|
8295
|
+
region?: string | null;
|
|
8296
|
+
game_mode?: string | null;
|
|
8297
|
+
map_name?: string | null;
|
|
8298
|
+
skill_band?: number | null;
|
|
8299
|
+
metadata: MultiplayerMetadata;
|
|
8300
|
+
last_activity_at?: string | null;
|
|
8301
|
+
expires_at?: string | null;
|
|
8302
|
+
created_at?: string | null;
|
|
8303
|
+
updated_at?: string | null;
|
|
8304
|
+
members?: MultiplayerLobbyMember[];
|
|
8305
|
+
server?: MultiplayerServer | null;
|
|
8306
|
+
}
|
|
8307
|
+
interface MultiplayerLobbyMessage {
|
|
8308
|
+
id: string;
|
|
8309
|
+
lobby_id: string;
|
|
8310
|
+
player_id: string;
|
|
8311
|
+
user_id?: string | null;
|
|
8312
|
+
message_type: MultiplayerLobbyMessageType;
|
|
8313
|
+
payload: MultiplayerMetadata;
|
|
8314
|
+
sequence: number;
|
|
8315
|
+
created_at?: string | null;
|
|
8316
|
+
updated_at?: string | null;
|
|
8317
|
+
}
|
|
8318
|
+
interface MultiplayerSession {
|
|
8319
|
+
id: string;
|
|
8320
|
+
title_id: string;
|
|
8321
|
+
server_id?: string | null;
|
|
8322
|
+
lobby_id?: string | null;
|
|
8323
|
+
player_id: string;
|
|
8324
|
+
user_id?: string | null;
|
|
8325
|
+
state: MultiplayerSessionState;
|
|
8326
|
+
connection_payload: MultiplayerMetadata;
|
|
8327
|
+
last_heartbeat_at?: string | null;
|
|
8328
|
+
expires_at?: string | null;
|
|
8329
|
+
started_at?: string | null;
|
|
8330
|
+
ended_at?: string | null;
|
|
8331
|
+
created_at?: string | null;
|
|
8332
|
+
updated_at?: string | null;
|
|
8333
|
+
}
|
|
8334
|
+
interface MultiplayerAuthTicket {
|
|
8335
|
+
id: string;
|
|
8336
|
+
title_id: string;
|
|
8337
|
+
player_id: string;
|
|
8338
|
+
user_id?: string | null;
|
|
8339
|
+
remote_identity?: string | null;
|
|
8340
|
+
status: MultiplayerAuthTicketStatus;
|
|
8341
|
+
issued_at?: string | null;
|
|
8342
|
+
expires_at?: string | null;
|
|
8343
|
+
consumed_at?: string | null;
|
|
8344
|
+
created_at?: string | null;
|
|
8345
|
+
updated_at?: string | null;
|
|
8346
|
+
}
|
|
8347
|
+
interface MultiplayerServerFavorite {
|
|
8348
|
+
id: string;
|
|
8349
|
+
title_id: string;
|
|
8350
|
+
server_id?: string | null;
|
|
8351
|
+
user_id?: string | null;
|
|
8352
|
+
player_id: string;
|
|
8353
|
+
kind: MultiplayerFavoriteKind;
|
|
8354
|
+
name?: string | null;
|
|
8355
|
+
host?: string | null;
|
|
8356
|
+
game_port?: number | null;
|
|
8357
|
+
query_port?: number | null;
|
|
8358
|
+
metadata: MultiplayerMetadata;
|
|
8359
|
+
last_played_at?: string | null;
|
|
8360
|
+
created_at?: string | null;
|
|
8361
|
+
updated_at?: string | null;
|
|
8362
|
+
}
|
|
8363
|
+
interface MultiplayerVoiceParticipant {
|
|
8364
|
+
id: string;
|
|
8365
|
+
voice_room_id: string;
|
|
8366
|
+
player_id: string;
|
|
8367
|
+
user_id?: string | null;
|
|
8368
|
+
display_name?: string | null;
|
|
8369
|
+
status: MultiplayerVoiceParticipantStatus;
|
|
8370
|
+
muted: boolean;
|
|
8371
|
+
deafened: boolean;
|
|
8372
|
+
speaking: boolean;
|
|
8373
|
+
last_sequence: number;
|
|
8374
|
+
metadata: MultiplayerMetadata;
|
|
8375
|
+
joined_at?: string | null;
|
|
8376
|
+
last_heartbeat_at?: string | null;
|
|
8377
|
+
left_at?: string | null;
|
|
8378
|
+
expires_at?: string | null;
|
|
8379
|
+
created_at?: string | null;
|
|
8380
|
+
updated_at?: string | null;
|
|
8381
|
+
}
|
|
8382
|
+
interface MultiplayerVoiceRoom {
|
|
8383
|
+
id: string;
|
|
8384
|
+
title_id: string;
|
|
8385
|
+
lobby_id?: string | null;
|
|
8386
|
+
server_id?: string | null;
|
|
8387
|
+
owner_player_id: string;
|
|
8388
|
+
owner_user_id?: string | null;
|
|
8389
|
+
provider: MultiplayerVoiceProvider;
|
|
8390
|
+
topology: MultiplayerVoiceTopology;
|
|
8391
|
+
state: MultiplayerVoiceState;
|
|
8392
|
+
region?: string | null;
|
|
8393
|
+
codec: MultiplayerVoiceCodec;
|
|
8394
|
+
sample_rate: number;
|
|
8395
|
+
bitrate: number;
|
|
8396
|
+
frame_duration_ms: 10 | 20 | 40 | 60;
|
|
8397
|
+
channels: 1 | 2;
|
|
8398
|
+
max_participants: number;
|
|
8399
|
+
participant_count: number;
|
|
8400
|
+
recording_allowed: boolean;
|
|
8401
|
+
moderation_enabled: boolean;
|
|
8402
|
+
connection_config: MultiplayerMetadata;
|
|
8403
|
+
metadata: MultiplayerMetadata;
|
|
8404
|
+
last_activity_at?: string | null;
|
|
8405
|
+
expires_at?: string | null;
|
|
8406
|
+
created_at?: string | null;
|
|
8407
|
+
updated_at?: string | null;
|
|
8408
|
+
participants?: MultiplayerVoiceParticipant[];
|
|
8409
|
+
}
|
|
8410
|
+
interface MultiplayerVoicePacket {
|
|
8411
|
+
id: string;
|
|
8412
|
+
voice_room_id: string;
|
|
8413
|
+
participant_id?: string | null;
|
|
8414
|
+
player_id: string;
|
|
8415
|
+
packet_type: MultiplayerVoicePacketType;
|
|
8416
|
+
payload: string;
|
|
8417
|
+
sequence: number;
|
|
8418
|
+
duration_ms?: number | null;
|
|
8419
|
+
sent_at?: string | null;
|
|
8420
|
+
created_at?: string | null;
|
|
8421
|
+
updated_at?: string | null;
|
|
8422
|
+
}
|
|
8423
|
+
interface MultiplayerLobbySearchParams {
|
|
8424
|
+
region?: string;
|
|
8425
|
+
game_mode?: string;
|
|
8426
|
+
map_name?: string;
|
|
8427
|
+
lobby_type?: MultiplayerLobbyType;
|
|
8428
|
+
skill_band?: number;
|
|
8429
|
+
limit?: number;
|
|
8430
|
+
}
|
|
8431
|
+
interface MultiplayerCreateLobbyRequest {
|
|
8432
|
+
player_id?: string;
|
|
8433
|
+
display_name?: string;
|
|
8434
|
+
member_data?: MultiplayerMetadata;
|
|
8435
|
+
lobby_type?: MultiplayerLobbyType;
|
|
8436
|
+
state?: MultiplayerLobbyState;
|
|
8437
|
+
joinable?: boolean;
|
|
8438
|
+
max_members?: number;
|
|
8439
|
+
region?: string;
|
|
8440
|
+
game_mode?: string;
|
|
8441
|
+
map_name?: string;
|
|
8442
|
+
skill_band?: number;
|
|
8443
|
+
metadata?: MultiplayerMetadata;
|
|
8444
|
+
expires_at?: string;
|
|
8445
|
+
}
|
|
8446
|
+
interface MultiplayerJoinLobbyRequest {
|
|
8447
|
+
player_id?: string;
|
|
8448
|
+
display_name?: string;
|
|
8449
|
+
ready?: boolean;
|
|
8450
|
+
member_data?: MultiplayerMetadata;
|
|
8451
|
+
}
|
|
8452
|
+
interface MultiplayerLeaveLobbyRequest {
|
|
8453
|
+
player_id?: string;
|
|
8454
|
+
}
|
|
8455
|
+
interface MultiplayerUpdateLobbyRequest {
|
|
8456
|
+
player_id?: string;
|
|
8457
|
+
lobby_type?: MultiplayerLobbyType;
|
|
8458
|
+
state?: MultiplayerLobbyState;
|
|
8459
|
+
joinable?: boolean;
|
|
8460
|
+
max_members?: number;
|
|
8461
|
+
region?: string;
|
|
8462
|
+
game_mode?: string;
|
|
8463
|
+
map_name?: string;
|
|
8464
|
+
skill_band?: number;
|
|
8465
|
+
metadata?: MultiplayerMetadata;
|
|
8466
|
+
expires_at?: string;
|
|
8467
|
+
}
|
|
8468
|
+
interface MultiplayerSetLobbyServerRequest {
|
|
8469
|
+
player_id?: string;
|
|
8470
|
+
server_id: string;
|
|
8471
|
+
state?: MultiplayerLobbyState;
|
|
8472
|
+
joinable?: boolean;
|
|
8473
|
+
}
|
|
8474
|
+
interface MultiplayerLobbyMessagesParams {
|
|
8475
|
+
after_sequence?: number;
|
|
8476
|
+
limit?: number;
|
|
8477
|
+
}
|
|
8478
|
+
interface MultiplayerSendLobbyMessageRequest {
|
|
8479
|
+
player_id?: string;
|
|
8480
|
+
message_type?: MultiplayerLobbyMessageType;
|
|
8481
|
+
payload: MultiplayerMetadata;
|
|
8482
|
+
}
|
|
8483
|
+
interface MultiplayerServerBrowserParams {
|
|
8484
|
+
region?: string;
|
|
8485
|
+
build_version?: string;
|
|
8486
|
+
transport?: MultiplayerTransport;
|
|
8487
|
+
status?: MultiplayerServerStatus;
|
|
8488
|
+
secure?: boolean;
|
|
8489
|
+
include_private?: boolean;
|
|
8490
|
+
limit?: number;
|
|
8491
|
+
}
|
|
8492
|
+
interface MultiplayerRegisterServerRequest {
|
|
8493
|
+
name: string;
|
|
8494
|
+
server_type?: MultiplayerServerType;
|
|
8495
|
+
status?: MultiplayerServerStatus;
|
|
8496
|
+
region?: string;
|
|
8497
|
+
build_version?: string;
|
|
8498
|
+
host?: string;
|
|
8499
|
+
game_port?: number;
|
|
8500
|
+
query_port?: number;
|
|
8501
|
+
transport?: MultiplayerTransport;
|
|
8502
|
+
connection_uri?: string;
|
|
8503
|
+
max_players?: number;
|
|
8504
|
+
current_players?: number;
|
|
8505
|
+
bot_players?: number;
|
|
8506
|
+
secure?: boolean;
|
|
8507
|
+
password_protected?: boolean;
|
|
8508
|
+
private?: boolean;
|
|
8509
|
+
tags?: string[];
|
|
8510
|
+
rules?: MultiplayerMetadata;
|
|
8511
|
+
metadata?: MultiplayerMetadata;
|
|
8512
|
+
expires_at?: string;
|
|
8513
|
+
}
|
|
8514
|
+
interface MultiplayerRegisterServerResponse {
|
|
8515
|
+
server: MultiplayerServer;
|
|
8516
|
+
server_token: string;
|
|
8517
|
+
}
|
|
8518
|
+
interface MultiplayerServerHeartbeatRequest {
|
|
8519
|
+
server_token: string;
|
|
8520
|
+
status?: MultiplayerServerStatus;
|
|
8521
|
+
current_players?: number;
|
|
8522
|
+
bot_players?: number;
|
|
8523
|
+
rules?: MultiplayerMetadata;
|
|
8524
|
+
metadata?: MultiplayerMetadata;
|
|
8525
|
+
}
|
|
8526
|
+
interface MultiplayerReserveServerRequest {
|
|
8527
|
+
player_id?: string;
|
|
8528
|
+
lobby_id?: string;
|
|
8529
|
+
ttl_minutes?: number;
|
|
8530
|
+
}
|
|
8531
|
+
interface MultiplayerReserveServerResponse {
|
|
8532
|
+
session: MultiplayerSession;
|
|
8533
|
+
reservation_token: string;
|
|
8534
|
+
}
|
|
8535
|
+
interface MultiplayerSessionHeartbeatRequest {
|
|
8536
|
+
reservation_token: string;
|
|
8537
|
+
state?: Extract<MultiplayerSessionState, 'reserved' | 'active'>;
|
|
8538
|
+
ttl_minutes?: number;
|
|
8539
|
+
}
|
|
8540
|
+
interface MultiplayerSessionReleaseRequest {
|
|
8541
|
+
reservation_token: string;
|
|
8542
|
+
}
|
|
8543
|
+
interface MultiplayerIssueAuthTicketRequest {
|
|
8544
|
+
player_id?: string;
|
|
8545
|
+
remote_identity?: string;
|
|
8546
|
+
ttl_minutes?: number;
|
|
8547
|
+
}
|
|
8548
|
+
interface MultiplayerIssueAuthTicketResponse {
|
|
8549
|
+
ticket: MultiplayerAuthTicket;
|
|
8550
|
+
auth_ticket: string;
|
|
8551
|
+
}
|
|
8552
|
+
interface MultiplayerValidateAuthTicketRequest {
|
|
8553
|
+
auth_ticket: string;
|
|
8554
|
+
remote_identity?: string;
|
|
8555
|
+
consume?: boolean;
|
|
8556
|
+
}
|
|
8557
|
+
interface MultiplayerValidateAuthTicketForServerRequest extends MultiplayerValidateAuthTicketRequest {
|
|
8558
|
+
server_token: string;
|
|
8559
|
+
}
|
|
8560
|
+
interface MultiplayerValidateAuthTicketResponse {
|
|
8561
|
+
valid: boolean;
|
|
8562
|
+
ticket: MultiplayerAuthTicket;
|
|
8563
|
+
}
|
|
8564
|
+
interface MultiplayerFavoritesParams {
|
|
8565
|
+
player_id?: string;
|
|
8566
|
+
kind?: MultiplayerFavoriteKind;
|
|
8567
|
+
}
|
|
8568
|
+
interface MultiplayerFavoriteRequest {
|
|
8569
|
+
player_id?: string;
|
|
8570
|
+
server_id?: string;
|
|
8571
|
+
kind?: MultiplayerFavoriteKind;
|
|
8572
|
+
name?: string;
|
|
8573
|
+
host?: string;
|
|
8574
|
+
game_port?: number;
|
|
8575
|
+
query_port?: number;
|
|
8576
|
+
metadata?: MultiplayerMetadata;
|
|
8577
|
+
last_played_at?: string;
|
|
8578
|
+
}
|
|
8579
|
+
interface MultiplayerDeleteFavoriteParams {
|
|
8580
|
+
player_id?: string;
|
|
8581
|
+
}
|
|
8582
|
+
interface MultiplayerDeleteFavoriteResponse {
|
|
8583
|
+
deleted: boolean;
|
|
8584
|
+
}
|
|
8585
|
+
interface MultiplayerVoiceRoomListParams {
|
|
8586
|
+
lobby_id?: string;
|
|
8587
|
+
server_id?: string;
|
|
8588
|
+
provider?: MultiplayerVoiceProvider;
|
|
8589
|
+
topology?: MultiplayerVoiceTopology;
|
|
8590
|
+
state?: MultiplayerVoiceState;
|
|
8591
|
+
region?: string;
|
|
8592
|
+
limit?: number;
|
|
8593
|
+
}
|
|
8594
|
+
interface MultiplayerCreateVoiceRoomRequest {
|
|
8595
|
+
player_id?: string;
|
|
8596
|
+
display_name?: string;
|
|
8597
|
+
lobby_id?: string;
|
|
8598
|
+
server_id?: string;
|
|
8599
|
+
provider?: MultiplayerVoiceProvider;
|
|
8600
|
+
topology?: MultiplayerVoiceTopology;
|
|
8601
|
+
state?: MultiplayerVoiceState;
|
|
8602
|
+
region?: string;
|
|
8603
|
+
codec?: MultiplayerVoiceCodec;
|
|
8604
|
+
sample_rate?: number;
|
|
8605
|
+
bitrate?: number;
|
|
8606
|
+
frame_duration_ms?: 10 | 20 | 40 | 60;
|
|
8607
|
+
channels?: 1 | 2;
|
|
8608
|
+
max_participants?: number;
|
|
8609
|
+
recording_allowed?: boolean;
|
|
8610
|
+
moderation_enabled?: boolean;
|
|
8611
|
+
connection_config?: MultiplayerMetadata;
|
|
8612
|
+
metadata?: MultiplayerMetadata;
|
|
8613
|
+
ttl_minutes?: number;
|
|
8614
|
+
expires_at?: string;
|
|
8615
|
+
}
|
|
8616
|
+
interface MultiplayerUpdateVoiceRoomRequest {
|
|
8617
|
+
player_id?: string;
|
|
8618
|
+
state?: MultiplayerVoiceState;
|
|
8619
|
+
max_participants?: number;
|
|
8620
|
+
recording_allowed?: boolean;
|
|
8621
|
+
moderation_enabled?: boolean;
|
|
8622
|
+
connection_config?: MultiplayerMetadata;
|
|
8623
|
+
metadata?: MultiplayerMetadata;
|
|
8624
|
+
expires_at?: string;
|
|
8625
|
+
}
|
|
8626
|
+
interface MultiplayerJoinVoiceRoomRequest {
|
|
8627
|
+
player_id?: string;
|
|
8628
|
+
display_name?: string;
|
|
8629
|
+
metadata?: MultiplayerMetadata;
|
|
8630
|
+
ttl_minutes?: number;
|
|
8631
|
+
}
|
|
8632
|
+
interface MultiplayerVoiceRoomTokenResponse {
|
|
8633
|
+
voice_room: MultiplayerVoiceRoom;
|
|
8634
|
+
participant: MultiplayerVoiceParticipant;
|
|
8635
|
+
voice_token: string;
|
|
8636
|
+
}
|
|
8637
|
+
interface MultiplayerVoiceHeartbeatRequest {
|
|
8638
|
+
voice_token: string;
|
|
8639
|
+
muted?: boolean;
|
|
8640
|
+
deafened?: boolean;
|
|
8641
|
+
speaking?: boolean;
|
|
8642
|
+
last_sequence?: number;
|
|
8643
|
+
ttl_minutes?: number;
|
|
8644
|
+
}
|
|
8645
|
+
interface MultiplayerVoiceLeaveRequest {
|
|
8646
|
+
voice_token: string;
|
|
8647
|
+
}
|
|
8648
|
+
interface MultiplayerVoicePacketRequest {
|
|
8649
|
+
voice_token: string;
|
|
8650
|
+
packet_type?: MultiplayerVoicePacketType;
|
|
8651
|
+
payload: string;
|
|
8652
|
+
duration_ms?: number;
|
|
8653
|
+
}
|
|
8654
|
+
interface MultiplayerVoicePollRequest {
|
|
8655
|
+
voice_token: string;
|
|
8656
|
+
after_sequence?: number;
|
|
8657
|
+
limit?: number;
|
|
8658
|
+
exclude_self?: boolean;
|
|
8659
|
+
}
|
|
8660
|
+
/**
|
|
8661
|
+
* Steam-style multiplayer APIs for Glitch titles.
|
|
8662
|
+
*
|
|
8663
|
+
* The multiplayer surface is split into three groups:
|
|
8664
|
+
* lobby coordination, voice coordination, server browser/reservations, and short-lived auth tickets.
|
|
8665
|
+
* User JWTs can infer the player from the authenticated user. Title-token clients
|
|
8666
|
+
* and game clients without a Glitch user session should pass a stable `player_id`.
|
|
8667
|
+
* Dedicated servers use `server_token` on heartbeat and server-side ticket validation
|
|
8668
|
+
* so they do not need to hold a user JWT or title token.
|
|
8669
|
+
*
|
|
8670
|
+
* These endpoints are intentionally database-agnostic from the SDK's point of view:
|
|
8671
|
+
* callers work with public identifiers, metadata objects, and lifecycle events,
|
|
8672
|
+
* while the backend owns how those records are stored.
|
|
8673
|
+
*/
|
|
8674
|
+
declare class Multiplayer {
|
|
8675
|
+
/**
|
|
8676
|
+
* Search joinable, non-expired lobbies for a title.
|
|
8677
|
+
*
|
|
8678
|
+
* Filters are exact-match except `skill_band`, which the backend can use for
|
|
8679
|
+
* near sorting. Default results exclude full, closed, unjoinable, and expired
|
|
8680
|
+
* lobbies. Lifecycle context: clients usually call this before `joinLobby`;
|
|
8681
|
+
* joins create a `lobby.joined` event on the backend.
|
|
8682
|
+
*
|
|
8683
|
+
* @param title_id Title UUID.
|
|
8684
|
+
* @param params Optional filters such as region, game mode, map, lobby type, skill band, and limit.
|
|
8685
|
+
* @example
|
|
8686
|
+
* Multiplayer.searchLobbies('title-uuid', {
|
|
8687
|
+
* region: 'us-central',
|
|
8688
|
+
* game_mode: 'ranked_duos',
|
|
8689
|
+
* skill_band: 1840,
|
|
8690
|
+
* limit: 25
|
|
8691
|
+
* });
|
|
8692
|
+
*/
|
|
8693
|
+
static searchLobbies<T = MultiplayerLobby[]>(title_id: string, params?: MultiplayerLobbySearchParams): AxiosPromise<Response<T>>;
|
|
8694
|
+
/**
|
|
8695
|
+
* Create a lobby and insert the owner as the first joined member.
|
|
8696
|
+
*
|
|
8697
|
+
* Use this when matchmaking has no suitable lobby, when a player invites
|
|
8698
|
+
* friends, or when a party needs pre-game setup before server assignment.
|
|
8699
|
+
* Lifecycle events: `lobby.created`, then `lobby.joined` for the owner.
|
|
8700
|
+
*
|
|
8701
|
+
* @param title_id Title UUID.
|
|
8702
|
+
* @param data Lobby configuration and optional owner/member metadata.
|
|
8703
|
+
* @example
|
|
8704
|
+
* Multiplayer.createLobby('title-uuid', {
|
|
8705
|
+
* player_id: 'steam:76561198000000000',
|
|
8706
|
+
* display_name: 'CinderAce',
|
|
8707
|
+
* lobby_type: 'public',
|
|
8708
|
+
* max_members: 4,
|
|
8709
|
+
* region: 'us-central',
|
|
8710
|
+
* game_mode: 'ranked_duos',
|
|
8711
|
+
* metadata: { playlist: 'ranked', allow_voice: true }
|
|
8712
|
+
* });
|
|
8713
|
+
*/
|
|
8714
|
+
static createLobby<T = MultiplayerLobby>(title_id: string, data: MultiplayerCreateLobbyRequest): AxiosPromise<Response<T>>;
|
|
8715
|
+
/**
|
|
8716
|
+
* Retrieve a lobby with members and assigned server information when present.
|
|
8717
|
+
*
|
|
8718
|
+
* Call this after lobby lifecycle notifications such as `lobby.joined`,
|
|
8719
|
+
* `lobby.updated`, `lobby.owner_transferred`, or `lobby.server_assigned`.
|
|
8720
|
+
*
|
|
8721
|
+
* @param title_id Title UUID.
|
|
8722
|
+
* @param lobby_id Lobby UUID.
|
|
8723
|
+
*/
|
|
8724
|
+
static showLobby<T = MultiplayerLobby>(title_id: string, lobby_id: string): AxiosPromise<Response<T>>;
|
|
8725
|
+
/**
|
|
8726
|
+
* Join a lobby or refresh an existing membership.
|
|
8727
|
+
*
|
|
8728
|
+
* This call is idempotent for a player already in the lobby and can update
|
|
8729
|
+
* display name, ready state, or member metadata. It returns 409 when the lobby
|
|
8730
|
+
* is full, closed, expired, or not joinable. Lifecycle event: `lobby.joined`.
|
|
8731
|
+
*
|
|
8732
|
+
* @param title_id Title UUID.
|
|
8733
|
+
* @param lobby_id Lobby UUID.
|
|
8734
|
+
* @param data Player identity and optional member metadata.
|
|
8735
|
+
* @example
|
|
8736
|
+
* Multiplayer.joinLobby('title-uuid', 'lobby-uuid', {
|
|
8737
|
+
* player_id: 'steam:76561198000000001',
|
|
8738
|
+
* display_name: 'Nova',
|
|
8739
|
+
* ready: false,
|
|
8740
|
+
* member_data: { character: 'Ash', rank: 1799 }
|
|
8741
|
+
* });
|
|
8742
|
+
*/
|
|
8743
|
+
static joinLobby<T = MultiplayerLobbyMember>(title_id: string, lobby_id: string, data: MultiplayerJoinLobbyRequest): AxiosPromise<Response<T>>;
|
|
8744
|
+
/**
|
|
8745
|
+
* Leave a lobby.
|
|
8746
|
+
*
|
|
8747
|
+
* If the owner leaves, ownership transfers to the oldest remaining joined
|
|
8748
|
+
* member. If no members remain, the lobby closes. Lifecycle events:
|
|
8749
|
+
* `lobby.left`, optionally `lobby.owner_transferred` or `lobby.updated`.
|
|
8750
|
+
*
|
|
8751
|
+
* @param title_id Title UUID.
|
|
8752
|
+
* @param lobby_id Lobby UUID.
|
|
8753
|
+
* @param data Optional player_id for title-token clients.
|
|
8754
|
+
*/
|
|
8755
|
+
static leaveLobby<T = MultiplayerLobbyMember | null>(title_id: string, lobby_id: string, data?: MultiplayerLeaveLobbyRequest): AxiosPromise<Response<T>>;
|
|
8756
|
+
/**
|
|
8757
|
+
* Update lobby metadata, visibility, joinability, limits, or state.
|
|
8758
|
+
*
|
|
8759
|
+
* This is owner-only. `max_members` cannot be lower than the current member
|
|
8760
|
+
* count. Keep metadata low-frequency and mostly search/display oriented.
|
|
8761
|
+
* Lifecycle event: `lobby.updated`.
|
|
8762
|
+
*
|
|
8763
|
+
* @param title_id Title UUID.
|
|
8764
|
+
* @param lobby_id Lobby UUID.
|
|
8765
|
+
* @param data Owner identity plus fields to update.
|
|
8766
|
+
*/
|
|
8767
|
+
static updateLobby<T = MultiplayerLobby>(title_id: string, lobby_id: string, data: MultiplayerUpdateLobbyRequest): AxiosPromise<Response<T>>;
|
|
8768
|
+
/**
|
|
8769
|
+
* Assign a registered game server to a lobby.
|
|
8770
|
+
*
|
|
8771
|
+
* This owner-only handoff mirrors Steam's SetLobbyGameServer flow. Clients
|
|
8772
|
+
* should react by reserving or connecting to the assigned server, then
|
|
8773
|
+
* optionally leaving the lobby. Lifecycle event: `lobby.server_assigned`.
|
|
8774
|
+
*
|
|
8775
|
+
* @param title_id Title UUID.
|
|
8776
|
+
* @param lobby_id Lobby UUID.
|
|
8777
|
+
* @param data Server UUID and optional lobby state/joinability updates.
|
|
8778
|
+
*/
|
|
8779
|
+
static setLobbyServer<T = MultiplayerLobby>(title_id: string, lobby_id: string, data: MultiplayerSetLobbyServerRequest): AxiosPromise<Response<T>>;
|
|
8780
|
+
/**
|
|
8781
|
+
* List ordered low-bandwidth lobby messages.
|
|
8782
|
+
*
|
|
8783
|
+
* Use `after_sequence` to poll for messages missed during reconnects or after
|
|
8784
|
+
* a realtime `lobby.message_sent` event. This channel is for chat and control
|
|
8785
|
+
* messages, not gameplay, positional data, or voice streaming.
|
|
8786
|
+
*
|
|
8787
|
+
* @param title_id Title UUID.
|
|
8788
|
+
* @param lobby_id Lobby UUID.
|
|
8789
|
+
* @param params Optional sequence cursor and limit.
|
|
8790
|
+
*/
|
|
8791
|
+
static listLobbyMessages<T = MultiplayerLobbyMessage[]>(title_id: string, lobby_id: string, params?: MultiplayerLobbyMessagesParams): AxiosPromise<Response<T>>;
|
|
8792
|
+
/**
|
|
8793
|
+
* Send a low-bandwidth message to all lobby members.
|
|
8794
|
+
*
|
|
8795
|
+
* Payloads are capped at 4KB by the backend. Use this for chat, ready signals,
|
|
8796
|
+
* invite/kick control messages, and owner-arbitrated choices. Lifecycle event:
|
|
8797
|
+
* `lobby.message_sent`.
|
|
8798
|
+
*
|
|
8799
|
+
* @param title_id Title UUID.
|
|
8800
|
+
* @param lobby_id Lobby UUID.
|
|
8801
|
+
* @param data Message type, sender identity, and JSON payload.
|
|
8802
|
+
* @example
|
|
8803
|
+
* Multiplayer.sendLobbyMessage('title-uuid', 'lobby-uuid', {
|
|
8804
|
+
* player_id: 'steam:76561198000000000',
|
|
8805
|
+
* message_type: 'ready',
|
|
8806
|
+
* payload: { ready: true }
|
|
8807
|
+
* });
|
|
8808
|
+
*/
|
|
8809
|
+
static sendLobbyMessage<T = MultiplayerLobbyMessage>(title_id: string, lobby_id: string, data: MultiplayerSendLobbyMessageRequest): AxiosPromise<Response<T>>;
|
|
8810
|
+
/**
|
|
8811
|
+
* List active/non-expired voice rooms for a title.
|
|
8812
|
+
*
|
|
8813
|
+
* Rooms can be attached to a lobby, a server, a party, or a proximity group.
|
|
8814
|
+
* Use this to discover existing voice state before joining. Lifecycle context:
|
|
8815
|
+
* realtime transports should mirror `voice.room_created`, `voice.room_updated`,
|
|
8816
|
+
* `voice.joined`, and `voice.left`.
|
|
8817
|
+
*
|
|
8818
|
+
* @param title_id Title UUID.
|
|
8819
|
+
* @param params Optional room filters such as lobby_id, server_id, provider, topology, state, region, and limit.
|
|
8820
|
+
*/
|
|
8821
|
+
static listVoiceRooms<T = MultiplayerVoiceRoom[]>(title_id: string, params?: MultiplayerVoiceRoomListParams): AxiosPromise<Response<T>>;
|
|
8822
|
+
/**
|
|
8823
|
+
* Create a voice room and join the creator as the first participant.
|
|
8824
|
+
*
|
|
8825
|
+
* The backend returns `voice_token` once. Keep it client-side and use it for
|
|
8826
|
+
* voice heartbeat, packet send, packet polling, and leave calls. `glitch_relay`
|
|
8827
|
+
* can carry base64 Opus frames for prototypes, small-party fallback, or
|
|
8828
|
+
* signaling. For production-scale audio, set `provider: 'external'` and reuse
|
|
8829
|
+
* the room/token contract with WebRTC, an SFU, Vivox, Steam Networking, or an
|
|
8830
|
+
* engine-native transport. Lifecycle events: `voice.room_created`,
|
|
8831
|
+
* `voice.joined`.
|
|
8832
|
+
*
|
|
8833
|
+
* @param title_id Title UUID.
|
|
8834
|
+
* @param data Voice codec, topology, linked lobby/server, and owner metadata.
|
|
8835
|
+
* @example
|
|
8836
|
+
* const { data } = await Multiplayer.createVoiceRoom('title-uuid', {
|
|
8837
|
+
* player_id: 'steam:76561198000000000',
|
|
8838
|
+
* display_name: 'CinderAce',
|
|
8839
|
+
* lobby_id: 'lobby-uuid',
|
|
8840
|
+
* provider: 'glitch_relay',
|
|
8841
|
+
* topology: 'lobby',
|
|
8842
|
+
* codec: 'opus',
|
|
8843
|
+
* sample_rate: 48000,
|
|
8844
|
+
* frame_duration_ms: 20,
|
|
8845
|
+
* channels: 1,
|
|
8846
|
+
* metadata: { push_to_talk: true }
|
|
8847
|
+
* });
|
|
8848
|
+
*/
|
|
8849
|
+
static createVoiceRoom<T = MultiplayerVoiceRoomTokenResponse>(title_id: string, data: MultiplayerCreateVoiceRoomRequest): AxiosPromise<Response<T>>;
|
|
8850
|
+
/**
|
|
8851
|
+
* Retrieve a voice room with participant media states.
|
|
8852
|
+
*
|
|
8853
|
+
* Use this after `voice.joined`, `voice.heartbeat`, `voice.left`, or
|
|
8854
|
+
* `voice.room_updated` to refresh in-game UI such as speaker lists, mute
|
|
8855
|
+
* icons, or team voice controls.
|
|
8856
|
+
*
|
|
8857
|
+
* @param title_id Title UUID.
|
|
8858
|
+
* @param voice_room_id Voice room UUID.
|
|
8859
|
+
*/
|
|
8860
|
+
static showVoiceRoom<T = MultiplayerVoiceRoom>(title_id: string, voice_room_id: string): AxiosPromise<Response<T>>;
|
|
8861
|
+
/**
|
|
8862
|
+
* Update owner-controlled voice room state.
|
|
8863
|
+
*
|
|
8864
|
+
* Owner-only. Use this to close a room, adjust capacity, update moderation
|
|
8865
|
+
* flags, or provide external provider connection details. The backend rejects
|
|
8866
|
+
* lowering `max_participants` below the current participant count. Lifecycle
|
|
8867
|
+
* event: `voice.room_updated`.
|
|
8868
|
+
*
|
|
8869
|
+
* @param title_id Title UUID.
|
|
8870
|
+
* @param voice_room_id Voice room UUID.
|
|
8871
|
+
* @param data Owner player identity and room fields to update.
|
|
8872
|
+
*/
|
|
8873
|
+
static updateVoiceRoom<T = MultiplayerVoiceRoom>(title_id: string, voice_room_id: string, data: MultiplayerUpdateVoiceRoomRequest): AxiosPromise<Response<T>>;
|
|
8874
|
+
/**
|
|
8875
|
+
* Join a voice room and receive a participant-scoped token.
|
|
8876
|
+
*
|
|
8877
|
+
* Rejoining with the same player is idempotent and rotates the token. The
|
|
8878
|
+
* token is used by participant endpoints instead of requiring a user JWT or
|
|
8879
|
+
* title token on every media request. Returns 409 when the room is closed,
|
|
8880
|
+
* expired, or full. Lifecycle event: `voice.joined`.
|
|
8881
|
+
*
|
|
8882
|
+
* @param title_id Title UUID.
|
|
8883
|
+
* @param voice_room_id Voice room UUID.
|
|
8884
|
+
* @param data Player identity, display name, metadata, and token TTL.
|
|
8885
|
+
*/
|
|
8886
|
+
static joinVoiceRoom<T = MultiplayerVoiceRoomTokenResponse>(title_id: string, voice_room_id: string, data: MultiplayerJoinVoiceRoomRequest): AxiosPromise<Response<T>>;
|
|
8887
|
+
/**
|
|
8888
|
+
* Heartbeat voice participant state.
|
|
8889
|
+
*
|
|
8890
|
+
* Call every 10-30 seconds and whenever mute/deafen/speaking state changes.
|
|
8891
|
+
* `last_sequence` tells the backend how far this participant has processed
|
|
8892
|
+
* ordered packets. Expired participants are rejected with 409. Lifecycle event:
|
|
8893
|
+
* `voice.heartbeat`.
|
|
8894
|
+
*
|
|
8895
|
+
* @param data Participant voice token and mutable media state.
|
|
8896
|
+
*/
|
|
8897
|
+
static heartbeatVoice<T = MultiplayerVoiceParticipant>(data: MultiplayerVoiceHeartbeatRequest): AxiosPromise<Response<T>>;
|
|
8898
|
+
/**
|
|
8899
|
+
* Leave the current voice room for a participant token.
|
|
8900
|
+
*
|
|
8901
|
+
* This is idempotent for disconnect cleanup: room participant count is
|
|
8902
|
+
* decremented once, room ownership is transferred when possible, and an
|
|
8903
|
+
* empty room closes. The token remains valid only for retrying this leave
|
|
8904
|
+
* call; heartbeat, send, and poll calls reject left participants. Lifecycle
|
|
8905
|
+
* event: `voice.left`.
|
|
8906
|
+
*
|
|
8907
|
+
* @param data Participant voice token.
|
|
8908
|
+
*/
|
|
8909
|
+
static leaveVoice<T = MultiplayerVoiceParticipant>(data: MultiplayerVoiceLeaveRequest): AxiosPromise<Response<T>>;
|
|
8910
|
+
/**
|
|
8911
|
+
* Send one ordered voice-room packet.
|
|
8912
|
+
*
|
|
8913
|
+
* `audio` packets should contain compact compressed frames such as base64 Opus
|
|
8914
|
+
* at 48kHz mono/20ms. `offer`, `answer`, and `ice` packets support WebRTC
|
|
8915
|
+
* signaling. `control`, `speaking`, and `mute_state` packets are for custom
|
|
8916
|
+
* engine state. Audio payloads are capped at 16KB; non-audio packets at 4KB.
|
|
8917
|
+
* Muted participants cannot send audio. Lifecycle event: `voice.packet_sent`.
|
|
8918
|
+
*
|
|
8919
|
+
* @param data Participant token, packet type, payload, and optional duration.
|
|
8920
|
+
* @example
|
|
8921
|
+
* await Multiplayer.sendVoicePacket({
|
|
8922
|
+
* voice_token: voiceToken,
|
|
8923
|
+
* packet_type: 'audio',
|
|
8924
|
+
* payload: base64OpusFrame,
|
|
8925
|
+
* duration_ms: 20
|
|
8926
|
+
* });
|
|
8927
|
+
*/
|
|
8928
|
+
static sendVoicePacket<T = MultiplayerVoicePacket>(data: MultiplayerVoicePacketRequest): AxiosPromise<Response<T>>;
|
|
8929
|
+
/**
|
|
8930
|
+
* Poll ordered voice-room packets after a known sequence.
|
|
8931
|
+
*
|
|
8932
|
+
* Defaults to excluding packets sent by the caller. Use the highest returned
|
|
8933
|
+
* sequence as the next `after_sequence` cursor. This is useful for fallback
|
|
8934
|
+
* relay, WebRTC signaling, reconnect recovery, and small-party prototypes.
|
|
8935
|
+
* Lifecycle event: `voice.packet_polled`.
|
|
8936
|
+
*
|
|
8937
|
+
* @param data Participant token, optional sequence cursor, limit, and self-exclusion flag.
|
|
8938
|
+
*/
|
|
8939
|
+
static pollVoicePackets<T = MultiplayerVoicePacket[]>(data: MultiplayerVoicePollRequest): AxiosPromise<Response<T>>;
|
|
8940
|
+
/**
|
|
8941
|
+
* Browse public, joinable multiplayer servers for a title.
|
|
8942
|
+
*
|
|
8943
|
+
* Default results exclude private, draining, offline, stale, expired, and full
|
|
8944
|
+
* servers. Title administrators can pass `include_private` to inspect servers
|
|
8945
|
+
* that normal clients cannot join.
|
|
8946
|
+
*
|
|
8947
|
+
* @param title_id Title UUID.
|
|
8948
|
+
* @param params Optional server browser filters.
|
|
8949
|
+
*/
|
|
8950
|
+
static browseServers<T = MultiplayerServer[]>(title_id: string, params?: MultiplayerServerBrowserParams): AxiosPromise<Response<T>>;
|
|
8951
|
+
/**
|
|
8952
|
+
* Register or refresh a multiplayer server and receive a one-time server token.
|
|
8953
|
+
*
|
|
8954
|
+
* Store `server_token` only on the server process. The backend stores only a
|
|
8955
|
+
* hash and will not return the plain token again. Counts are validated so
|
|
8956
|
+
* `current_players + bot_players` cannot exceed `max_players`. Lifecycle event:
|
|
8957
|
+
* `server.registered`.
|
|
8958
|
+
*
|
|
8959
|
+
* @param title_id Title UUID.
|
|
8960
|
+
* @param data Server browser, connection, rule, and capacity metadata.
|
|
8961
|
+
* @example
|
|
8962
|
+
* Multiplayer.registerServer('title-uuid', {
|
|
8963
|
+
* name: 'Ranked US Central 01',
|
|
8964
|
+
* server_type: 'dedicated',
|
|
8965
|
+
* status: 'active',
|
|
8966
|
+
* host: '203.0.113.42',
|
|
8967
|
+
* game_port: 7777,
|
|
8968
|
+
* query_port: 27015,
|
|
8969
|
+
* transport: 'udp',
|
|
8970
|
+
* max_players: 16,
|
|
8971
|
+
* secure: true,
|
|
8972
|
+
* tags: ['ranked', 'duos']
|
|
8973
|
+
* });
|
|
8974
|
+
*/
|
|
8975
|
+
static registerServer<T = MultiplayerRegisterServerResponse>(title_id: string, data: MultiplayerRegisterServerRequest): AxiosPromise<Response<T>>;
|
|
8976
|
+
/**
|
|
8977
|
+
* Heartbeat a multiplayer server with its dedicated `server_token`.
|
|
8978
|
+
*
|
|
8979
|
+
* Call every 30-60 seconds and whenever player counts, rules, or metadata
|
|
8980
|
+
* change. Stale servers are hidden from default browsing and reservation.
|
|
8981
|
+
* This endpoint is for dedicated/listen server processes and does not require
|
|
8982
|
+
* a user JWT. Lifecycle event: `server.heartbeat`.
|
|
8983
|
+
*
|
|
8984
|
+
* @param title_id Title UUID.
|
|
8985
|
+
* @param server_id Server UUID.
|
|
8986
|
+
* @param data Server token and optional mutable server state.
|
|
8987
|
+
*/
|
|
8988
|
+
static heartbeatServer<T = MultiplayerServer>(title_id: string, server_id: string, data: MultiplayerServerHeartbeatRequest): AxiosPromise<Response<T>>;
|
|
8989
|
+
/**
|
|
8990
|
+
* Reserve a short-lived slot on a multiplayer server before connecting.
|
|
8991
|
+
*
|
|
8992
|
+
* Reservations protect capacity during game handoff. The backend rejects stale,
|
|
8993
|
+
* private, full, draining, offline, expired, or duplicate open reservations.
|
|
8994
|
+
* The plain `reservation_token` is returned once and is used for session
|
|
8995
|
+
* heartbeat/release calls. Lifecycle event: `server.reserved`.
|
|
8996
|
+
*
|
|
8997
|
+
* @param title_id Title UUID.
|
|
8998
|
+
* @param server_id Server UUID.
|
|
8999
|
+
* @param data Optional player/lobby identity and reservation TTL.
|
|
9000
|
+
*/
|
|
9001
|
+
static reserveServer<T = MultiplayerReserveServerResponse>(title_id: string, server_id: string, data?: MultiplayerReserveServerRequest): AxiosPromise<Response<T>>;
|
|
9002
|
+
/**
|
|
9003
|
+
* Heartbeat an open multiplayer session reservation.
|
|
9004
|
+
*
|
|
9005
|
+
* Use this after a successful reservation while the client is connecting or
|
|
9006
|
+
* playing. Expired sessions are marked expired and capacity is recovered before
|
|
9007
|
+
* the backend returns 409. Lifecycle events: `session.heartbeat` or
|
|
9008
|
+
* `session.expired`.
|
|
9009
|
+
*
|
|
9010
|
+
* @param data Reservation token and optional state/TTL.
|
|
9011
|
+
*/
|
|
9012
|
+
static heartbeatSession<T = MultiplayerSession>(data: MultiplayerSessionHeartbeatRequest): AxiosPromise<Response<T>>;
|
|
9013
|
+
/**
|
|
9014
|
+
* Release an open multiplayer session reservation.
|
|
9015
|
+
*
|
|
9016
|
+
* Call this on normal disconnect, failed connection attempts, or shutdown so
|
|
9017
|
+
* server capacity is decremented promptly. The backend makes release safe to
|
|
9018
|
+
* call more than once for an already closed reservation. Lifecycle event:
|
|
9019
|
+
* `session.released`.
|
|
9020
|
+
*
|
|
9021
|
+
* @param data Reservation token returned by `reserveServer`.
|
|
9022
|
+
*/
|
|
9023
|
+
static releaseSession<T = MultiplayerSession>(data: MultiplayerSessionReleaseRequest): AxiosPromise<Response<T>>;
|
|
9024
|
+
/**
|
|
9025
|
+
* Issue a short-lived multiplayer auth ticket for a player.
|
|
9026
|
+
*
|
|
9027
|
+
* The plain `auth_ticket` is returned once and only a hash is stored by the
|
|
9028
|
+
* backend. Use this for P2P or dedicated-server admission before game traffic
|
|
9029
|
+
* begins. `remote_identity` can bind the ticket to a server or validator.
|
|
9030
|
+
* Lifecycle event: `auth_ticket.issued`.
|
|
9031
|
+
*
|
|
9032
|
+
* @param title_id Title UUID.
|
|
9033
|
+
* @param data Player identity, optional remote identity, and TTL.
|
|
9034
|
+
*/
|
|
9035
|
+
static issueAuthTicket<T = MultiplayerIssueAuthTicketResponse>(title_id: string, data?: MultiplayerIssueAuthTicketRequest): AxiosPromise<Response<T>>;
|
|
9036
|
+
/**
|
|
9037
|
+
* Validate a multiplayer auth ticket from a trusted title/user context.
|
|
9038
|
+
*
|
|
9039
|
+
* Pass `consume: true` for one-time tickets to prevent replay. Dedicated
|
|
9040
|
+
* servers should usually call `validateAuthTicketForServer` so they can use
|
|
9041
|
+
* `server_token` instead of a title token or user JWT. Lifecycle event:
|
|
9042
|
+
* `auth_ticket.validated`.
|
|
9043
|
+
*
|
|
9044
|
+
* @param title_id Title UUID.
|
|
9045
|
+
* @param data Ticket, optional remote identity check, and consume flag.
|
|
9046
|
+
*/
|
|
9047
|
+
static validateAuthTicket<T = MultiplayerValidateAuthTicketResponse>(title_id: string, data: MultiplayerValidateAuthTicketRequest): AxiosPromise<Response<T>>;
|
|
9048
|
+
/**
|
|
9049
|
+
* Validate an auth ticket as a dedicated server.
|
|
9050
|
+
*
|
|
9051
|
+
* This server-token endpoint lets a dedicated server admit players without
|
|
9052
|
+
* holding a user JWT or title token. Pass `consume: true` to prevent replay.
|
|
9053
|
+
* Lifecycle event: `auth_ticket.validated`.
|
|
9054
|
+
*
|
|
9055
|
+
* @param title_id Title UUID.
|
|
9056
|
+
* @param server_id Server UUID.
|
|
9057
|
+
* @param data Server token, player auth ticket, optional remote identity, and consume flag.
|
|
9058
|
+
*/
|
|
9059
|
+
static validateAuthTicketForServer<T = MultiplayerValidateAuthTicketResponse>(title_id: string, server_id: string, data: MultiplayerValidateAuthTicketForServerRequest): AxiosPromise<Response<T>>;
|
|
9060
|
+
/**
|
|
9061
|
+
* List a player's server favorites or history entries.
|
|
9062
|
+
*
|
|
9063
|
+
* Use this for Steam-like favorites and recent servers tabs. Title-token
|
|
9064
|
+
* clients should pass `player_id`; user JWT clients default to the user UUID.
|
|
9065
|
+
*
|
|
9066
|
+
* @param title_id Title UUID.
|
|
9067
|
+
* @param params Optional player and favorite/history filter.
|
|
9068
|
+
*/
|
|
9069
|
+
static listFavorites<T = MultiplayerServerFavorite[]>(title_id: string, params?: MultiplayerFavoritesParams): AxiosPromise<Response<T>>;
|
|
9070
|
+
/**
|
|
9071
|
+
* Add or update a favorite/history server entry for a player.
|
|
9072
|
+
*
|
|
9073
|
+
* Provide `server_id` for a registered Glitch server, or `host` plus
|
|
9074
|
+
* `game_port` for a direct/community server. Lifecycle event:
|
|
9075
|
+
* `favorite.upserted`.
|
|
9076
|
+
*
|
|
9077
|
+
* @param title_id Title UUID.
|
|
9078
|
+
* @param data Favorite/history target and optional metadata.
|
|
9079
|
+
*/
|
|
9080
|
+
static addFavorite<T = MultiplayerServerFavorite>(title_id: string, data: MultiplayerFavoriteRequest): AxiosPromise<Response<T>>;
|
|
9081
|
+
/**
|
|
9082
|
+
* Delete a player's favorite/history server entry.
|
|
9083
|
+
*
|
|
9084
|
+
* The SDK sends optional `player_id` as a query parameter because the shared
|
|
9085
|
+
* request helper treats DELETE payloads as query params. This maps cleanly to
|
|
9086
|
+
* the backend's optional player identity validation for title-token clients.
|
|
9087
|
+
* Lifecycle event: `favorite.deleted`.
|
|
9088
|
+
*
|
|
9089
|
+
* @param title_id Title UUID.
|
|
9090
|
+
* @param favorite_id Favorite/history UUID.
|
|
9091
|
+
* @param params Optional player_id for title-token clients.
|
|
9092
|
+
*/
|
|
9093
|
+
static deleteFavorite<T = MultiplayerDeleteFavoriteResponse>(title_id: string, favorite_id: string, params?: MultiplayerDeleteFavoriteParams): AxiosPromise<Response<T>>;
|
|
9094
|
+
}
|
|
9095
|
+
|
|
9096
|
+
declare class ServerOperations {
|
|
9097
|
+
static listDeployments<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9098
|
+
static updatePolicy<T>(title_id: string, build_id: string, data: object): AxiosPromise<Response<T>>;
|
|
9099
|
+
}
|
|
9100
|
+
|
|
8094
9101
|
interface Route {
|
|
8095
9102
|
url: string;
|
|
8096
9103
|
method: string;
|
|
@@ -8109,6 +9116,7 @@ declare class Requests {
|
|
|
8109
9116
|
static get<T>(url: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
8110
9117
|
static post<T>(url: string, data: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
8111
9118
|
static put<T>(url: string, data: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9119
|
+
static patch<T>(url: string, data: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
8112
9120
|
static delete<T>(url: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
8113
9121
|
static uploadFile<T>(url: string, filename: string, file: File | Blob, data?: any, params?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
|
|
8114
9122
|
static uploadBlob<T>(url: string, filename: string, blob: Blob, data?: any, params?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
|
|
@@ -8430,6 +9438,7 @@ declare class Glitch {
|
|
|
8430
9438
|
PlayTests: typeof PlayTests;
|
|
8431
9439
|
Media: typeof Media;
|
|
8432
9440
|
Scheduler: typeof Scheduler;
|
|
9441
|
+
RedditSubreddits: typeof RedditSubreddits;
|
|
8433
9442
|
Funnel: typeof Funnel;
|
|
8434
9443
|
SocialStats: typeof SocialStats;
|
|
8435
9444
|
WebsiteAnalytics: typeof WebsiteAnalytics;
|
|
@@ -8442,6 +9451,8 @@ declare class Glitch {
|
|
|
8442
9451
|
DiscordMarketplace: typeof DiscordMarketplace;
|
|
8443
9452
|
Education: typeof Education;
|
|
8444
9453
|
Crm: typeof Crm;
|
|
9454
|
+
Multiplayer: typeof Multiplayer;
|
|
9455
|
+
ServerOperations: typeof ServerOperations;
|
|
8445
9456
|
};
|
|
8446
9457
|
static util: {
|
|
8447
9458
|
Requests: typeof Requests;
|