speedruncom.js 1.0.0 → 1.1.1

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.
@@ -1,923 +0,0 @@
1
- import * as Enums from '../enums.js';
2
- import * as Interfaces from '../interfaces.js';
3
- /**
4
- * Logs in. If 2FA is enabled first provide `name` & `password` then check `tokenChallengeSent` and repeat w/ token.
5
- * Recommended to use `login(username password)` and `setToken(token)` for automatic Client authentication.
6
- */
7
- export interface PutAuthLogin {
8
- name: string;
9
- password: string;
10
- /**
11
- * On second attempt if 2FA is enabled.
12
- */
13
- token: string;
14
- }
15
- /**
16
- * Gets information about the current user's session.
17
- * Most notably `csrfToken`, required for `PutRunSettings`, `PutConversation`, `PutConversationMessage`, `PutConversationLeave` and `PutConversationReport.
18
- */
19
- export interface GetSession {
20
- }
21
- /**
22
- * todo test which credentials this is for
23
- */
24
- export interface PutSessionPing {
25
- }
26
- /**
27
- * Gets a game, series, or your account's audit log.
28
- * If getting a game or series audit log, you must be a Super Moderator for it.
29
- * If getting your account's audit log, you cannot be banned.
30
- */
31
- export interface GetAuditLogList {
32
- /**
33
- * A single `EventType` string enum to filter by.
34
- */
35
- eventType?: Enums.EventType;
36
- page?: number;
37
- gameId?: string;
38
- seriesId?: string;
39
- /**
40
- * Every change that has happened to this user's account.
41
- */
42
- userId?: string;
43
- }
44
- /**
45
- * Get a game's settings. Must be at least a verifier on the game.
46
- */
47
- export interface GetGameSettings {
48
- gameId: string;
49
- }
50
- /**
51
- * Set a game's settings. Must be at least a moderator on the game.
52
- */
53
- export interface PutGameSettings {
54
- /**
55
- * Must be provided even though `settings` contains `id`.
56
- */
57
- gameId: string;
58
- settings: Interfaces.GameSettings;
59
- }
60
- /**
61
- * Creates a new category.
62
- */
63
- export interface PutCategory {
64
- gameId: string;
65
- category: Interfaces.Category;
66
- }
67
- /**
68
- * Updates an existing category.
69
- */
70
- export interface PutCategoryUpdate {
71
- gameId: string;
72
- categoryId: string;
73
- category: Interfaces.Category;
74
- }
75
- /**
76
- * Archives a category.
77
- */
78
- export interface PutCategoryArchive {
79
- gameId: string;
80
- categoryId: string;
81
- }
82
- /**
83
- * Restores an archived category.
84
- */
85
- export interface PutCategoryRestore {
86
- gameId: string;
87
- categoryId: string;
88
- }
89
- /**
90
- * Re-orders categories.
91
- */
92
- export interface PutCategoryOrder {
93
- gameId: string;
94
- categoryId: string;
95
- }
96
- /**
97
- * Creates a new level.
98
- */
99
- export interface PutLevel {
100
- gameId: string;
101
- level: Interfaces.Level;
102
- }
103
- /**
104
- * Updates an existing level.
105
- */
106
- export interface PutLevelUpdate {
107
- gameId: string;
108
- levelId: string;
109
- level: Interfaces.Level;
110
- }
111
- /**
112
- * Archives a level.
113
- */
114
- export interface PutLevelArchive {
115
- gameId: string;
116
- levelId: string;
117
- }
118
- /**
119
- * Restores an archived level.
120
- */
121
- export interface PutLevelRestore {
122
- gameId: string;
123
- levelId: string;
124
- }
125
- /**
126
- * Re-orders levels.
127
- */
128
- export interface PutLevelOrder {
129
- gameId: string;
130
- levelId: string;
131
- }
132
- /**
133
- * Creates a new variable.
134
- */
135
- export interface PutVariable {
136
- gameId: string;
137
- variable: Interfaces.Variable;
138
- values: Interfaces.Value[];
139
- }
140
- /**
141
- * Updates an existing variable.
142
- */
143
- export interface PutVariableUpdate {
144
- gameId: string;
145
- variableId: string;
146
- /**
147
- * The new variable settings for the variable you are updating.
148
- */
149
- variable: Interfaces.Variable;
150
- values: Interfaces.Value[];
151
- }
152
- /**
153
- * Archives a variable.
154
- */
155
- export interface PutVariableArchive {
156
- gameId: string;
157
- variableId: string;
158
- }
159
- /**
160
- * Restores an archived variable.
161
- */
162
- export interface PutVariableRestore {
163
- gameId: string;
164
- variableId: string;
165
- }
166
- /**
167
- * Re-orders variables. NOTE: only all subcategories OR all annotations are taken at once.
168
- */
169
- export interface PutVariableOrder {
170
- gameId: string;
171
- variableId: string;
172
- }
173
- /**
174
- * Puts a variable's default value on all runs in the variable's scope.
175
- */
176
- export interface PutVariableApplyDefault {
177
- gameId: string;
178
- variableId: string;
179
- }
180
- /**
181
- * Posts a news item to a game.
182
- */
183
- export interface PutNews {
184
- gameId: string;
185
- userId: string;
186
- title: string;
187
- body: string;
188
- date: number;
189
- }
190
- /**
191
- * Updates a news item.
192
- */
193
- export interface PutNewsUpdate {
194
- newsId: string;
195
- userId: string;
196
- title: string;
197
- body: string;
198
- date: number;
199
- }
200
- /**
201
- * Deletes a news item.
202
- */
203
- export interface PutNewsDelete {
204
- newsId: string;
205
- }
206
- /**
207
- * Posts a guide item to a game.
208
- */
209
- export interface PutGuide {
210
- gameId: string;
211
- userId: string;
212
- name: string;
213
- text: string;
214
- date: number;
215
- }
216
- /**
217
- * Updates a guide item.
218
- */
219
- export interface PutGuideUpdate {
220
- guideId: string;
221
- userId: string;
222
- name: string;
223
- text: string;
224
- date: number;
225
- }
226
- /**
227
- * Deletes a guide item.
228
- */
229
- export interface PutGuideDelete {
230
- guideId: string;
231
- }
232
- /**
233
- * Posts a resource item to a game.
234
- */
235
- export interface PutResource {
236
- gameId: string;
237
- /**
238
- * Manager ID
239
- */
240
- userId: string;
241
- /**
242
- * Comma-separated list of usernames
243
- */
244
- authorNames: string;
245
- date: number;
246
- name: string;
247
- description: string;
248
- type: Enums.ResourceType;
249
- link?: string;
250
- uploadFilename?: string;
251
- /**
252
- * Ex. data:application/json;base64examplebase64data
253
- */
254
- uploadContent?: string;
255
- }
256
- /**
257
- * Updates a resource item.
258
- */
259
- export interface PutResourceUpdate {
260
- gameId: string;
261
- /**
262
- * Manager ID
263
- */
264
- userId: string;
265
- /**
266
- * Comma-separated list of usernames
267
- */
268
- authorNames: string;
269
- date: number;
270
- name: string;
271
- description: string;
272
- type: Enums.ResourceType;
273
- link?: string;
274
- uploadFilename?: string;
275
- /**
276
- * Ex. data:application/json;base64examplebase64data
277
- */
278
- uploadContent?: string;
279
- }
280
- /**
281
- * Deletes a resource item.
282
- */
283
- export interface PutResourceDelete {
284
- resourceId: string;
285
- }
286
- /**
287
- * Get moderation games and stats for the logged in user.
288
- * If the user is not logged in, the response is void.
289
- */
290
- export interface GetModerationGames {
291
- }
292
- /**
293
- * Get data for runs waiting in the moderation queue for a game.
294
- */
295
- export interface GetModerationRuns {
296
- gameId: string;
297
- search?: string;
298
- verified?: Enums.RunStatus;
299
- verifiedById?: string;
300
- ideoState?: Enums.VideoState;
301
- page?: number;
302
- limit?: number;
303
- }
304
- /**
305
- * Assigns a verifier to a run.
306
- */
307
- export interface PutRunAssignee {
308
- assigneeId: string;
309
- runId: string;
310
- }
311
- export interface PutRunDelete {
312
- gameId: string;
313
- runId: string;
314
- }
315
- /**
316
- * Assigns a verification level `RunStatus` to a run.
317
- */
318
- export interface PutRunVerification {
319
- runId: string;
320
- verified: Enums.RunStatus;
321
- }
322
- /**
323
- * Assigns a video-at-risk state to a run.
324
- */
325
- export interface PutRunVideoState {
326
- runId: string;
327
- videoState: Enums.VideoState;
328
- }
329
- /**
330
- * Gets a run's settings.
331
- * TODO: check specific details on who can use
332
- */
333
- export interface GetRunSettings {
334
- runId: string;
335
- }
336
- /**
337
- * Sets a run's settings or submit a new run if `settings.runId` is exempted.
338
- */
339
- export interface PutRunSettings {
340
- /**
341
- * May be retrieved by `GetSession`.
342
- */
343
- csrfToken: string;
344
- /**
345
- * Existing run settings if `runId: string; is not None` otherwise new run's settings.
346
- */
347
- settings: Interfaces.RunSettings;
348
- /**
349
- * If the run should be automatically verified after editing or not. - only works for game moderators.
350
- */
351
- autoverify: boolean;
352
- }
353
- /**
354
- * Gets conversations the user is involved in.
355
- */
356
- export interface GetConversations {
357
- }
358
- /**
359
- * Gets messages from a given conversation.
360
- */
361
- export interface GetConversationMessages {
362
- conversationId: string;
363
- }
364
- /**
365
- * Creates a new conversation. May include several users.
366
- * If the conversation already exists the message is sent to the existing conversation.
367
- * NOTE: if the conversation exists but the user has left it they will _not_ rejoin the conversation.
368
- */
369
- export interface PutConversation {
370
- /**
371
- * May be retrieved by `GetSession`.
372
- */
373
- csrfToken: string;
374
- /**
375
- * A list of other users to add to the conversation.
376
- */
377
- recipientIds: string[];
378
- /**
379
- * Content of the initial message.
380
- */
381
- text: string;
382
- }
383
- /**
384
- * Sends a message to a conversation.
385
- */
386
- export interface PutConversationMessage {
387
- /**
388
- * May be retrieved by `GetSession`.
389
- */
390
- csrfToken: string;
391
- conversationId: string;
392
- text: string;
393
- }
394
- /**
395
- * Leaves a conversation.
396
- */
397
- export interface PutConversationLeave {
398
- /**
399
- * May be retrieved by `GetSession`.
400
- */
401
- csrfToken: string;
402
- conversationId: string;
403
- }
404
- /**
405
- * Reports a conversation.
406
- */
407
- export interface PutConversationReport {
408
- /**
409
- * May be retrieved by `GetSession`.
410
- */
411
- csrfToken: string;
412
- conversationId: string;
413
- /**
414
- * User description of the report
415
- */
416
- text: string;
417
- }
418
- /**
419
- * Gets your notifications.
420
- */
421
- export interface GetNotifications {
422
- }
423
- /**
424
- * Marks all notifications as read.
425
- */
426
- export interface PutNotificationsRead {
427
- }
428
- /**
429
- * Follow a game.
430
- */
431
- export interface PutGameFollower {
432
- gameId: string;
433
- /**
434
- * Your `userId`.
435
- */
436
- userId: string;
437
- }
438
- /**
439
- * Unfollow a game.
440
- */
441
- export interface PutGameFollowerDelete {
442
- gameId: string;
443
- /**
444
- * Your `userId`.
445
- */
446
- userId: string;
447
- }
448
- /**
449
- * Follow a user.
450
- */
451
- export interface PutUserFollower {
452
- userId: string;
453
- }
454
- /**
455
- * Unfollow a user.
456
- */
457
- export interface PutUserFollowerDelete {
458
- userId: string;
459
- }
460
- /**
461
- * Gets a user's settings.
462
- */
463
- export interface GetUserSettings {
464
- /**
465
- * Your user page URL for your account.
466
- */
467
- userUrl: string;
468
- }
469
- /**
470
- * Sets a user's settings.
471
- */
472
- export interface PutUserSettings {
473
- /**
474
- * Your user page URL for your account.
475
- */
476
- userUrl: string;
477
- settings: Interfaces.UserSettings;
478
- }
479
- /**
480
- * Sets the run featured on a user's profile.
481
- */
482
- export interface PutUserUpdateFeaturedRun {
483
- /**
484
- * Your user page URL for your account.
485
- */
486
- userUrl: string;
487
- /**
488
- * If omitted clears the full game featured run.
489
- */
490
- fullRunId?: string;
491
- /**
492
- * If omitted clears the level featured run.
493
- */
494
- levelRunId?: string;
495
- }
496
- /**
497
- * Updates the order of games displayed on your profile.
498
- * Note that having multiple GameOrderGroups is a Supporter-only feature. The default group has fixed id of `default`.
499
- */
500
- export interface PutUserUpdateGameOrdering {
501
- /**
502
- * Your user page URL for your account.
503
- */
504
- userUrl: string;
505
- groups: Interfaces.GameOrderGroup;
506
- }
507
- /**
508
- * Get a user's API key (the authorization method for API version 1).
509
- */
510
- export interface GetUserApiKey {
511
- userId: string;
512
- /**
513
- * Returns a new API key if `true`.
514
- */
515
- regenerate: boolean;
516
- }
517
- export interface GetUserFollowers {
518
- userId: string;
519
- limit?: number;
520
- page?: number;
521
- }
522
- export interface GetUserFollowingGames {
523
- userId: string;
524
- limit?: number;
525
- page?: number;
526
- }
527
- export interface GetUserFollowingUsers {
528
- userId: string;
529
- limit?: number;
530
- page?: number;
531
- }
532
- /**
533
- * Get a list of games that a user has boosted.
534
- */
535
- export interface GetUserGameBoostData {
536
- userId: string;
537
- }
538
- /**
539
- * Get a user's exported data.
540
- */
541
- export interface GetUserDataExport {
542
- userId: string;
543
- }
544
- /**
545
- * Reorder a your account's followed games.
546
- */
547
- export interface PutGameFollowerOrder {
548
- /**
549
- * List of `gameId`s in the order they should be in
550
- */
551
- gameId: string[];
552
- userId: string;
553
- }
554
- /**
555
- * Submits a site article.
556
- */
557
- export interface PutArticleSubmission {
558
- title: string;
559
- summary: string;
560
- body: string;
561
- game?: string;
562
- publishTags?: string[];
563
- }
564
- /**
565
- * Checks the comment permissions on an item.
566
- */
567
- export interface GetCommentable {
568
- itemId: string;
569
- itemType: Enums.ItemType;
570
- }
571
- /**
572
- * Posts a comment on an item.
573
- */
574
- export interface PutComment {
575
- itemId: string;
576
- itemType: Enums.ItemType;
577
- text: string;
578
- }
579
- /**
580
- * Adds or removes a like to a comment.
581
- */
582
- export interface PutLike {
583
- /**
584
- * ID 0f the item you are liking or removing your like from.
585
- */
586
- itemId: string;
587
- /**
588
- * `ItemType` of the item you are liking or removing your like from.
589
- */
590
- itemType: Enums.ItemType;
591
- /**
592
- * Whether you are liking a comment (`true`) or removing your like from a comment (`false`).
593
- *
594
- * `false` when exempted.
595
- */
596
- like?: boolean;
597
- }
598
- /**
599
- * Updates commentable settings on an item.
600
- */
601
- export interface PutCommentableSettings {
602
- /**
603
- * ID of the item you are modifying the comment settings on.
604
- */
605
- itemId: string;
606
- /**
607
- * `itemType` of the item you are modifying the comment settings on.
608
- */
609
- itemType: Enums.ItemType;
610
- disabled: boolean;
611
- locked: boolean;
612
- }
613
- /**
614
- * Gets whether a set of threads have been read by the user.
615
- */
616
- export interface GetThreadReadStatus {
617
- /**
618
- * List of thread IDs to get read status from.
619
- */
620
- threadIds: string[];
621
- }
622
- /**
623
- * Sets a thread as read by the user.
624
- */
625
- export interface PutThreadRead {
626
- threadId: string;
627
- }
628
- /**
629
- * Gets whether a set of forums have been read by the user.
630
- */
631
- export interface GetForumReadStatus {
632
- /**
633
- * List of forum IDs to get read status from.
634
- */
635
- forumIds: string[];
636
- }
637
- /**
638
- * Gets a user game or series' theme. # TODO: check noargs & series
639
- */
640
- export interface GetThemeSettings {
641
- userId?: string;
642
- gameId?: string;
643
- seriesId?: string;
644
- }
645
- /**
646
- * Sets a user, game, or series' theme.
647
- */
648
- export interface PutThemeSettings {
649
- userId?: string;
650
- gameId?: string;
651
- seriesId?: string;
652
- settings: Interfaces.ThemeSettings;
653
- }
654
- /**
655
- * Gets supporter data for your account.
656
- */
657
- export interface GetUserSupporterData {
658
- /**
659
- * Your user page URL for your account.
660
- */
661
- userUrl: string;
662
- }
663
- /**
664
- * Get data used to construct a payment form.
665
- */
666
- export interface PutUserSupporterNewSubscription {
667
- planKey?: Enums.SupportPlanPeriod;
668
- userUrl?: string;
669
- }
670
- /**
671
- * Adds a boost to a game.
672
- */
673
- export interface PutGameBoostGrant {
674
- gameId: string;
675
- anonymous: boolean;
676
- }
677
- /**
678
- * Sends a request for contact to SRC for collaboration.
679
- */
680
- export interface PutAdvertiseContact {
681
- name: string;
682
- company: string;
683
- email: string;
684
- message: string;
685
- }
686
- /**
687
- * Gets tickets submitted by you.
688
- */
689
- export interface GetTickets {
690
- /**
691
- * list of ticket IDs to fetch
692
- */
693
- ticketIds: string[];
694
- /**
695
- * list of `TicketQueueType` to filter by
696
- */
697
- queues: Enums.TicketQueueType[];
698
- /**
699
- * list of `TicketType`
700
- */
701
- types: Enums.TicketType[];
702
- /**
703
- * list of `TicketStatus`
704
- */
705
- statuses: Enums.TicketStatus[];
706
- /**
707
- * List of `userId`s. Must only have your `userId`.
708
- */
709
- requestorIds: string[];
710
- search: string;
711
- }
712
- /**
713
- * Gets settings of a series.
714
- */
715
- export interface GetSeriesSettings {
716
- seriesId: string;
717
- }
718
- /**
719
- * Gets blocks of you blocking a user and users blocking you.
720
- */
721
- export interface GetUserBlocks {
722
- }
723
- /**
724
- * Blocks or unblocks a user on your account.
725
- */
726
- export interface PutUserBlock {
727
- /**
728
- * Whether or not you are blocking (`true`) or unblocking (`false`) the user.
729
- */
730
- block: boolean;
731
- /**
732
- * `userId` of you are blocking.
733
- */
734
- blockeeId: string;
735
- }
736
- /**
737
- * Add a new game.
738
- */
739
- export interface PutGame {
740
- name: string;
741
- releaseDate: number;
742
- /**
743
- * list of `GameType`
744
- */
745
- gameTypeIds: string[];
746
- /**
747
- * If one of the GameTypes supports a baseGame then this can be included with a game id.
748
- */
749
- baseGame: string;
750
- seriesId: string;
751
- }
752
- /**
753
- * Add a moderator to a game.
754
- */
755
- export interface PutGameModerator {
756
- gameId: string;
757
- userId: string;
758
- level: Enums.GamePowerLevel;
759
- }
760
- /**
761
- * Remove a moderator from a game.
762
- * TODO: test `level` necessity & enum type
763
- */
764
- export interface PutGameModeratorDelete {
765
- gameId: string;
766
- userId: string;
767
- }
768
- /**
769
- * Add an existing game to a series.
770
- */
771
- export interface PutSeriesGame {
772
- seriesId: string;
773
- gameId: string;
774
- }
775
- /**
776
- * Remove a game from a series.
777
- *
778
- * Does not delete the game.
779
- */
780
- export interface PutSeriesGameDelete {
781
- seriesId: string;
782
- gameId: string;
783
- }
784
- export interface PutSeriesModerator extends Interfaces.SeriesModerator {
785
- }
786
- export interface PutSeriesModeratorUpdate extends Interfaces.SeriesModerator {
787
- }
788
- export interface PutSeriesModeratorDelete extends Interfaces.SeriesModerator {
789
- }
790
- export interface PutSeriesSettings {
791
- seriesId: string;
792
- settings: Interfaces.SeriesSettings;
793
- }
794
- /**
795
- * Submits support tickets.
796
- */
797
- export interface PutTicket {
798
- /**
799
- * a JSON string of ticket data
800
- */
801
- metadata: string;
802
- /**
803
- * TODO: check TicketType vs TicketQueue Type
804
- */
805
- type: Enums.TicketType;
806
- }
807
- export interface PutTicketNote {
808
- ticketId: string;
809
- note: string;
810
- /**
811
- * Whether the note is a message to the user. `false` only permitted for admins.
812
- */
813
- isMessage: string;
814
- }
815
- /**
816
- * Modifies a user's social connection.
817
- * todo verification?
818
- */
819
- export interface PutUserSocialConnection {
820
- userId: string;
821
- networkId: Enums.SocialConnection;
822
- value: string;
823
- }
824
- /**
825
- * Remove a user's social connection.
826
- */
827
- export interface PutUserSocialConnectionDelete {
828
- userId: string;
829
- networkId: Enums.SocialConnection;
830
- }
831
- /**
832
- * Undocumented.
833
- */
834
- export interface PutUserSocialConnectionSsoExchange {
835
- userId: string;
836
- provider: string;
837
- state: string;
838
- code: string;
839
- }
840
- /**
841
- * Update a user's password.
842
- */
843
- export interface PutUserUpdatePassword {
844
- userUrl: string;
845
- oldPassword: string;
846
- newPassword: string;
847
- }
848
- /**
849
- * Update a user's email.
850
- * First you send userUrl email and password. SRC will respond with `tokenChallengeSent: true`
851
- * Afterwards you send the above data again but this time with `token` set.
852
- */
853
- export interface PutUserUpdateEmail {
854
- /**
855
- * Your user page URL for your account.
856
- */
857
- userUrl: string;
858
- /**
859
- * The **new** email you want to have for the account.
860
- */
861
- email: string;
862
- token?: string;
863
- password: string;
864
- }
865
- /**
866
- * Updates your name.
867
- * You must wait 60 days after changing your name to change it again.
868
- */
869
- export interface PutUserUpdateName {
870
- /**
871
- * Your user page URL for your account.
872
- */
873
- userUrl: string;
874
- newName: string;
875
- /**
876
- * Whether or not
877
- */
878
- acceptTerms: boolean;
879
- }
880
- export interface PutUserDelete {
881
- userUrl: string;
882
- password: string;
883
- }
884
- /**
885
- * Delete a comment.
886
- */
887
- export interface PutCommentDelete {
888
- commentId: string;
889
- }
890
- /**
891
- * Restores a deleted comment
892
- */
893
- export interface PutCommentRestore {
894
- commentId: string;
895
- }
896
- /**
897
- * Create a new thread on a forum.
898
- */
899
- export interface PutThread {
900
- forumId: string;
901
- name: string;
902
- body: string;
903
- }
904
- /**
905
- * Locks or unlocks a thread.
906
- */
907
- export interface PutThreadLocked {
908
- threadId: string;
909
- locked: boolean;
910
- }
911
- /**
912
- * Pins or un-pins a thread.
913
- */
914
- export interface PutThreadSticky {
915
- threadId: string;
916
- sticky: boolean;
917
- }
918
- /**
919
- * Delete a thread.
920
- */
921
- export interface PutThreadDelete {
922
- threadId: string;
923
- }