@fzgame/sdk 0.0.0-stage → 0.3.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.
@@ -0,0 +1,1381 @@
1
+ import { Client } from 'openapi-fetch';
2
+
3
+ /**
4
+ * This file was auto-generated by openapi-typescript.
5
+ * Do not make direct changes to the file.
6
+ */
7
+
8
+
9
+ interface paths {
10
+ "/sdk/app/current": {
11
+ /** Resolve current SDK app */
12
+ get: {
13
+ responses: {
14
+ 200: {
15
+ content: {
16
+ "application/json": components["schemas"]["App"];
17
+ };
18
+ };
19
+ 401: components["responses"]["Unauthorized"];
20
+ 403: components["responses"]["Forbidden"];
21
+ };
22
+ };
23
+ };
24
+ "/sdk/game-instances": {
25
+ /** List published game instances for SDK / iframe */
26
+ get: {
27
+ parameters: {
28
+ query?: {
29
+ page?: string;
30
+ cursor?: string;
31
+ limit?: string;
32
+ order?: string;
33
+ sortBy?: string;
34
+ cursorField?: string;
35
+ search?: string;
36
+ filter?: string;
37
+ include?: string;
38
+ searchField?: string;
39
+ };
40
+ };
41
+ responses: {
42
+ 200: {
43
+ content: {
44
+ "application/json": components["schemas"]["PagedGameInstance"];
45
+ };
46
+ };
47
+ 401: components["responses"]["Unauthorized"];
48
+ 403: components["responses"]["Forbidden"];
49
+ };
50
+ };
51
+ };
52
+ "/sdk/game-instances/{id}": {
53
+ /** Get published game instance (SDK) */
54
+ get: {
55
+ parameters: {
56
+ path: {
57
+ id: string;
58
+ };
59
+ };
60
+ responses: {
61
+ 200: {
62
+ content: {
63
+ "application/json": components["schemas"]["AppGameInstance"];
64
+ };
65
+ };
66
+ 401: components["responses"]["Unauthorized"];
67
+ 403: components["responses"]["Forbidden"];
68
+ };
69
+ };
70
+ };
71
+ "/pub/game-instances/{id}": {
72
+ /** Public game instance detail */
73
+ get: {
74
+ parameters: {
75
+ path: {
76
+ id: string;
77
+ };
78
+ };
79
+ responses: {
80
+ 200: {
81
+ content: {
82
+ "application/json": components["schemas"]["PublicGameInstance"];
83
+ };
84
+ };
85
+ 401: components["responses"]["Unauthorized"];
86
+ 403: components["responses"]["Forbidden"];
87
+ };
88
+ };
89
+ };
90
+ "/pub/categories": {
91
+ /** Public game category feed */
92
+ get: {
93
+ responses: {
94
+ 200: {
95
+ content: {
96
+ "application/json": components["schemas"]["CategoryFeed"];
97
+ };
98
+ };
99
+ 401: components["responses"]["Unauthorized"];
100
+ 403: components["responses"]["Forbidden"];
101
+ };
102
+ };
103
+ };
104
+ "/pub/categories/{id}/games": {
105
+ /** Public games in a category */
106
+ get: {
107
+ parameters: {
108
+ query?: {
109
+ page?: string;
110
+ cursor?: string;
111
+ limit?: string;
112
+ order?: string;
113
+ sortBy?: string;
114
+ cursorField?: string;
115
+ search?: string;
116
+ filter?: string;
117
+ include?: string;
118
+ searchField?: string;
119
+ };
120
+ path: {
121
+ id: string;
122
+ };
123
+ };
124
+ responses: {
125
+ 200: {
126
+ content: {
127
+ "application/json": components["schemas"]["PagedGame"];
128
+ };
129
+ };
130
+ 401: components["responses"]["Unauthorized"];
131
+ 403: components["responses"]["Forbidden"];
132
+ };
133
+ };
134
+ };
135
+ "/pub/game-instances/{id}/leaderboard/players": {
136
+ /** Public top score per player for a published game instance */
137
+ get: {
138
+ parameters: {
139
+ query?: {
140
+ page?: number;
141
+ limit?: number;
142
+ };
143
+ path: {
144
+ id: string;
145
+ };
146
+ };
147
+ responses: {
148
+ 200: {
149
+ content: {
150
+ "application/json": components["schemas"]["PagedPlayerLeaderboard"];
151
+ };
152
+ };
153
+ 401: components["responses"]["Unauthorized"];
154
+ 403: components["responses"]["Forbidden"];
155
+ };
156
+ };
157
+ };
158
+ "/pub/game-instances/{id}/leaderboard/sessions": {
159
+ /** Public top scoring play sessions for a published game instance */
160
+ get: {
161
+ parameters: {
162
+ query?: {
163
+ page?: number;
164
+ limit?: number;
165
+ };
166
+ path: {
167
+ id: string;
168
+ };
169
+ };
170
+ responses: {
171
+ 200: {
172
+ content: {
173
+ "application/json": components["schemas"]["PagedSessionLeaderboard"];
174
+ };
175
+ };
176
+ 401: components["responses"]["Unauthorized"];
177
+ 403: components["responses"]["Forbidden"];
178
+ };
179
+ };
180
+ };
181
+ "/pub/games/{id}/leaderboard/players": {
182
+ /** Public top score per player across the published instances of a game */
183
+ get: {
184
+ parameters: {
185
+ query?: {
186
+ page?: number;
187
+ limit?: number;
188
+ };
189
+ path: {
190
+ id: string;
191
+ };
192
+ };
193
+ responses: {
194
+ 200: {
195
+ content: {
196
+ "application/json": components["schemas"]["PagedPlayerLeaderboard"];
197
+ };
198
+ };
199
+ 401: components["responses"]["Unauthorized"];
200
+ 403: components["responses"]["Forbidden"];
201
+ };
202
+ };
203
+ };
204
+ "/pub/games/{id}/leaderboard/sessions": {
205
+ /** Public top scoring play sessions across the published instances of a game */
206
+ get: {
207
+ parameters: {
208
+ query?: {
209
+ page?: number;
210
+ limit?: number;
211
+ };
212
+ path: {
213
+ id: string;
214
+ };
215
+ };
216
+ responses: {
217
+ 200: {
218
+ content: {
219
+ "application/json": components["schemas"]["PagedSessionLeaderboard"];
220
+ };
221
+ };
222
+ 401: components["responses"]["Unauthorized"];
223
+ 403: components["responses"]["Forbidden"];
224
+ };
225
+ };
226
+ };
227
+ "/sdk/login": {
228
+ /** Identify or create a player (SDK) */
229
+ post: {
230
+ requestBody?: {
231
+ content: {
232
+ "application/json": components["schemas"]["IdentifyPlayerDto"];
233
+ };
234
+ };
235
+ responses: {
236
+ 201: {
237
+ content: {
238
+ "application/json": components["schemas"]["PlayerLoginResponse"];
239
+ };
240
+ };
241
+ 401: components["responses"]["Unauthorized"];
242
+ 403: components["responses"]["Forbidden"];
243
+ };
244
+ };
245
+ };
246
+ "/sdk/players/{id}": {
247
+ /** Get player by id (SDK) */
248
+ get: {
249
+ parameters: {
250
+ path: {
251
+ id: string;
252
+ };
253
+ };
254
+ responses: {
255
+ 200: {
256
+ content: {
257
+ "application/json": components["schemas"]["AppPlayer"];
258
+ };
259
+ };
260
+ 401: components["responses"]["Unauthorized"];
261
+ 403: components["responses"]["Forbidden"];
262
+ };
263
+ };
264
+ /** Update the profile of a player (SDK) */
265
+ put: {
266
+ parameters: {
267
+ path: {
268
+ id: string;
269
+ };
270
+ };
271
+ requestBody?: {
272
+ content: {
273
+ "application/json": components["schemas"]["UpdatePlayerDto"];
274
+ };
275
+ };
276
+ responses: {
277
+ 200: {
278
+ content: {
279
+ "application/json": components["schemas"]["AppPlayer"];
280
+ };
281
+ };
282
+ 401: components["responses"]["Unauthorized"];
283
+ 403: components["responses"]["Forbidden"];
284
+ };
285
+ };
286
+ /** Delete a player (SDK) */
287
+ delete: {
288
+ parameters: {
289
+ path: {
290
+ id: string;
291
+ };
292
+ };
293
+ responses: {
294
+ 200: {
295
+ content: {
296
+ "application/json": components["schemas"]["AppPlayer"];
297
+ };
298
+ };
299
+ 401: components["responses"]["Unauthorized"];
300
+ 403: components["responses"]["Forbidden"];
301
+ };
302
+ };
303
+ };
304
+ "/sdk/players/{id}/logout": {
305
+ /** End every live play session of a player (SDK) */
306
+ post: {
307
+ parameters: {
308
+ path: {
309
+ id: string;
310
+ };
311
+ };
312
+ responses: {
313
+ 201: {
314
+ content: {
315
+ "application/json": components["schemas"]["PlayerLogoutResponse"];
316
+ };
317
+ };
318
+ 401: components["responses"]["Unauthorized"];
319
+ 403: components["responses"]["Forbidden"];
320
+ };
321
+ };
322
+ };
323
+ "/sdk/sessions": {
324
+ /** Create a play session (SDK) */
325
+ post: {
326
+ requestBody?: {
327
+ content: {
328
+ "application/json": components["schemas"]["CreatePlaySessionDto"];
329
+ };
330
+ };
331
+ responses: {
332
+ 201: {
333
+ content: {
334
+ "application/json": components["schemas"]["AppPlaySession"];
335
+ };
336
+ };
337
+ 401: components["responses"]["Unauthorized"];
338
+ 403: components["responses"]["Forbidden"];
339
+ };
340
+ };
341
+ };
342
+ "/sdk/sessions/active": {
343
+ /** Get the newest live session of a player (SDK) */
344
+ get: {
345
+ parameters: {
346
+ query?: {
347
+ playerId?: string;
348
+ gameInstanceId?: string;
349
+ };
350
+ };
351
+ responses: {
352
+ 200: {
353
+ content: {
354
+ "application/json": components["schemas"]["ActivePlaySession"];
355
+ };
356
+ };
357
+ 401: components["responses"]["Unauthorized"];
358
+ 403: components["responses"]["Forbidden"];
359
+ };
360
+ };
361
+ };
362
+ "/sdk/sessions/{token}": {
363
+ /** Get play session by token (SDK / iframe) */
364
+ get: {
365
+ parameters: {
366
+ path: {
367
+ token: string;
368
+ };
369
+ };
370
+ responses: {
371
+ 200: {
372
+ content: {
373
+ "application/json": components["schemas"]["AppPlaySession"];
374
+ };
375
+ };
376
+ 401: components["responses"]["Unauthorized"];
377
+ 403: components["responses"]["Forbidden"];
378
+ };
379
+ };
380
+ /** Update play session (SDK) */
381
+ put: {
382
+ requestBody?: {
383
+ content: {
384
+ "application/json": components["schemas"]["UpdatePlaySessionDto"];
385
+ };
386
+ };
387
+ responses: {
388
+ 200: {
389
+ content: {
390
+ "application/json": components["schemas"]["AppPlaySession"];
391
+ };
392
+ };
393
+ 401: components["responses"]["Unauthorized"];
394
+ 403: components["responses"]["Forbidden"];
395
+ };
396
+ };
397
+ };
398
+ "/sdk/sessions/{token}/pause": {
399
+ /** Pause a playing session */
400
+ post: {
401
+ responses: {
402
+ 201: {
403
+ content: {
404
+ "application/json": components["schemas"]["AppPlaySession"];
405
+ };
406
+ };
407
+ 401: components["responses"]["Unauthorized"];
408
+ 403: components["responses"]["Forbidden"];
409
+ };
410
+ };
411
+ };
412
+ "/sdk/sessions/{token}/resume": {
413
+ /** Resume a paused session */
414
+ post: {
415
+ responses: {
416
+ 201: {
417
+ content: {
418
+ "application/json": components["schemas"]["AppPlaySession"];
419
+ };
420
+ };
421
+ 401: components["responses"]["Unauthorized"];
422
+ 403: components["responses"]["Forbidden"];
423
+ };
424
+ };
425
+ };
426
+ "/sdk/sessions/{token}/start": {
427
+ /** Start play session */
428
+ post: {
429
+ responses: {
430
+ 201: {
431
+ content: {
432
+ "application/json": components["schemas"]["AppPlaySession"];
433
+ };
434
+ };
435
+ 401: components["responses"]["Unauthorized"];
436
+ 403: components["responses"]["Forbidden"];
437
+ };
438
+ };
439
+ };
440
+ "/sdk/sessions/{token}/finish": {
441
+ /** Finish play session */
442
+ post: {
443
+ requestBody?: {
444
+ content: {
445
+ "application/json": components["schemas"]["UpdateScoreDto"];
446
+ };
447
+ };
448
+ responses: {
449
+ 201: {
450
+ content: {
451
+ "application/json": components["schemas"]["AppPlaySession"];
452
+ };
453
+ };
454
+ 401: components["responses"]["Unauthorized"];
455
+ 403: components["responses"]["Forbidden"];
456
+ };
457
+ };
458
+ };
459
+ "/sdk/sessions/{token}/abort": {
460
+ /** Abort play session */
461
+ post: {
462
+ responses: {
463
+ 201: {
464
+ content: {
465
+ "application/json": components["schemas"]["AppPlaySession"];
466
+ };
467
+ };
468
+ 401: components["responses"]["Unauthorized"];
469
+ 403: components["responses"]["Forbidden"];
470
+ };
471
+ };
472
+ };
473
+ "/sdk/sessions/{token}/score": {
474
+ /** Update session score */
475
+ post: {
476
+ requestBody?: {
477
+ content: {
478
+ "application/json": components["schemas"]["UpdateScoreDto"];
479
+ };
480
+ };
481
+ responses: {
482
+ 201: {
483
+ content: {
484
+ "application/json": components["schemas"]["AppPlaySession"];
485
+ };
486
+ };
487
+ 401: components["responses"]["Unauthorized"];
488
+ 403: components["responses"]["Forbidden"];
489
+ };
490
+ };
491
+ };
492
+ "/games/runtime/sessions": {
493
+ /** Fetch or create a play session from gameInstanceId + player access token */
494
+ post: {
495
+ requestBody?: {
496
+ content: {
497
+ "application/json": components["schemas"]["CreateRuntimeSessionDto"];
498
+ };
499
+ };
500
+ responses: {
501
+ 201: {
502
+ content: {
503
+ "application/json": components["schemas"]["AppPlaySession"];
504
+ };
505
+ };
506
+ 401: components["responses"]["Unauthorized"];
507
+ 403: components["responses"]["Forbidden"];
508
+ };
509
+ };
510
+ };
511
+ "/games/runtime/sessions/{token}": {
512
+ /** Get a play session by token */
513
+ get: {
514
+ parameters: {
515
+ path: {
516
+ token: string;
517
+ };
518
+ };
519
+ responses: {
520
+ 200: {
521
+ content: {
522
+ "application/json": components["schemas"]["AppPlaySession"];
523
+ };
524
+ };
525
+ 401: components["responses"]["Unauthorized"];
526
+ 403: components["responses"]["Forbidden"];
527
+ };
528
+ };
529
+ };
530
+ "/games/runtime/sessions/{token}/emit": {
531
+ /** Emit a lifecycle event against a play session */
532
+ post: {
533
+ parameters: {
534
+ path: {
535
+ token: string;
536
+ };
537
+ };
538
+ requestBody?: {
539
+ content: {
540
+ "application/json": components["schemas"]["RuntimeEmitDto"];
541
+ };
542
+ };
543
+ responses: {
544
+ 201: {
545
+ content: {
546
+ "application/json": components["schemas"]["AppPlaySession"];
547
+ };
548
+ };
549
+ 401: components["responses"]["Unauthorized"];
550
+ 403: components["responses"]["Forbidden"];
551
+ };
552
+ };
553
+ };
554
+ "/games/runtime/sessions/{token}/snapshot": {
555
+ /** Persist a local game snapshot on the play session */
556
+ put: {
557
+ parameters: {
558
+ path: {
559
+ token: string;
560
+ };
561
+ };
562
+ requestBody?: {
563
+ content: {
564
+ "application/json": components["schemas"]["RuntimeSnapshotDto"];
565
+ };
566
+ };
567
+ responses: {
568
+ 200: {
569
+ content: {
570
+ "application/json": components["schemas"]["AppPlaySession"];
571
+ };
572
+ };
573
+ 401: components["responses"]["Unauthorized"];
574
+ 403: components["responses"]["Forbidden"];
575
+ };
576
+ };
577
+ };
578
+ "/games/runtime/handler": {
579
+ /** Run a game handler against a finish payload (studio testing; no play session) */
580
+ post: {
581
+ requestBody?: {
582
+ content: {
583
+ "application/json": components["schemas"]["RuntimeHandlerDto"];
584
+ };
585
+ };
586
+ responses: {
587
+ 401: components["responses"]["Unauthorized"];
588
+ 403: components["responses"]["Forbidden"];
589
+ };
590
+ };
591
+ };
592
+ }
593
+
594
+ interface components {
595
+ schemas: {
596
+ App: {
597
+ id: string;
598
+ /** Format: date-time */
599
+ createdAt: string;
600
+ /** Format: date-time */
601
+ updatedAt: string;
602
+ /** Format: date-time */
603
+ deletedAt: string | null;
604
+ spaceId: string;
605
+ space?: components["schemas"]["Space"];
606
+ name: string;
607
+ /** @enum {string} */
608
+ status: "ACTIVE" | "DISABLED" | "ARCHIVED";
609
+ clientId: string;
610
+ description: string | null;
611
+ logoUrl: string | null;
612
+ settings: Record<string, unknown> | null;
613
+ ownerId: string;
614
+ owner?: components["schemas"]["Users"];
615
+ credentials?: components["schemas"]["AppCredential"][];
616
+ players?: components["schemas"]["AppPlayer"][];
617
+ playSessions?: components["schemas"]["AppPlaySession"][];
618
+ gameInstances?: components["schemas"]["AppGameInstance"][];
619
+ webhooks?: components["schemas"]["Webhook"][];
620
+ };
621
+ Space: {
622
+ id: string;
623
+ /** Format: date-time */
624
+ createdAt: string;
625
+ /** Format: date-time */
626
+ updatedAt: string;
627
+ /** Format: date-time */
628
+ deletedAt: string | null;
629
+ name: string;
630
+ spaceKey: string;
631
+ image: string | null;
632
+ description: string | null;
633
+ ownerId: string | null;
634
+ owner?: components["schemas"]["Users"];
635
+ userSpaces?: components["schemas"]["UserSpace"][];
636
+ invites?: components["schemas"]["SpaceInvite"][];
637
+ app?: components["schemas"]["App"][];
638
+ appCredentials?: components["schemas"]["AppCredential"][];
639
+ appPlaySessions?: components["schemas"]["AppPlaySession"][];
640
+ appGameInstances?: components["schemas"]["AppGameInstance"][];
641
+ appPlayers?: components["schemas"]["AppPlayer"][];
642
+ privateGames?: components["schemas"]["Game"][];
643
+ webhooks?: components["schemas"]["Webhook"][];
644
+ webhookDeliveries?: components["schemas"]["WebhookDelivery"][];
645
+ gitConnectors?: components["schemas"]["GitConnector"][];
646
+ gitSources?: components["schemas"]["GitSource"][];
647
+ deployments?: components["schemas"]["Deployment"][];
648
+ ciRunners?: components["schemas"]["CiRunner"][];
649
+ };
650
+ Users: {
651
+ id: string;
652
+ name: string;
653
+ email: string;
654
+ emailVerified: boolean;
655
+ image: string | null;
656
+ /** Format: date-time */
657
+ createdAt: string;
658
+ /** Format: date-time */
659
+ updatedAt: string;
660
+ /** Format: date-time */
661
+ deletedAt: string | null;
662
+ twoFactorEnabled: boolean | null;
663
+ sessions?: components["schemas"]["Session"][];
664
+ accounts?: components["schemas"]["Account"][];
665
+ twofactors?: components["schemas"]["TwoFactor"][];
666
+ /** Format: date-time */
667
+ birthDate: string | null;
668
+ };
669
+ Session: {
670
+ id: string;
671
+ /** Format: date-time */
672
+ expiresAt: string;
673
+ token: string;
674
+ /** Format: date-time */
675
+ createdAt: string;
676
+ /** Format: date-time */
677
+ updatedAt: string;
678
+ ipAddress: string | null;
679
+ userAgent: string | null;
680
+ userId: string;
681
+ users?: components["schemas"]["Users"];
682
+ };
683
+ Account: {
684
+ id: string;
685
+ accountId: string;
686
+ providerId: string;
687
+ userId: string;
688
+ users?: components["schemas"]["Users"];
689
+ accessToken: string | null;
690
+ refreshToken: string | null;
691
+ idToken: string | null;
692
+ /** Format: date-time */
693
+ accessTokenExpiresAt: string | null;
694
+ /** Format: date-time */
695
+ refreshTokenExpiresAt: string | null;
696
+ scope: string | null;
697
+ password: string | null;
698
+ issuer: string | null;
699
+ /** Format: date-time */
700
+ createdAt: string;
701
+ /** Format: date-time */
702
+ updatedAt: string;
703
+ };
704
+ TwoFactor: {
705
+ id: string;
706
+ secret: string;
707
+ backupCodes: string;
708
+ userId: string;
709
+ users?: components["schemas"]["Users"];
710
+ verified: boolean;
711
+ /** Format: int32 */
712
+ failedVerificationCount: number;
713
+ /** Format: date-time */
714
+ lockedUntil: string | null;
715
+ };
716
+ UserSpace: {
717
+ id: string;
718
+ /** Format: date-time */
719
+ createdAt: string;
720
+ /** Format: date-time */
721
+ updatedAt: string;
722
+ /** Format: date-time */
723
+ deletedAt: string | null;
724
+ spaceId: string;
725
+ space?: components["schemas"]["Space"];
726
+ userId: string;
727
+ user?: components["schemas"]["Users"];
728
+ /** @enum {string} */
729
+ role: "ADMIN" | "DEVELOPER" | "EDITOR";
730
+ /** @enum {string} */
731
+ auth: "OWNER" | "MEMBER";
732
+ };
733
+ SpaceInvite: {
734
+ id: string;
735
+ /** Format: date-time */
736
+ createdAt: string;
737
+ /** Format: date-time */
738
+ updatedAt: string;
739
+ /** Format: date-time */
740
+ deletedAt: string | null;
741
+ email: string;
742
+ token: string;
743
+ /** @enum {string} */
744
+ role: "ADMIN" | "DEVELOPER" | "EDITOR";
745
+ /** Format: date-time */
746
+ expiresAt: string;
747
+ /** Format: date-time */
748
+ acceptedAt: string | null;
749
+ /** Format: date-time */
750
+ revokedAt: string | null;
751
+ spaceId: string;
752
+ space?: components["schemas"]["Space"];
753
+ inviterId: string | null;
754
+ inviter?: components["schemas"]["Users"];
755
+ };
756
+ AppCredential: {
757
+ id: string;
758
+ /** Format: date-time */
759
+ createdAt: string;
760
+ /** Format: date-time */
761
+ updatedAt: string;
762
+ /** Format: date-time */
763
+ deletedAt: string | null;
764
+ spaceId: string;
765
+ space?: components["schemas"]["Space"];
766
+ appId: string;
767
+ app?: components["schemas"]["App"];
768
+ clientSecret: string;
769
+ /** Format: date-time */
770
+ expiresAt: string | null;
771
+ /** @enum {string} */
772
+ role: "ADMIN" | "DEVELOPER" | "EDITOR";
773
+ creatorId: string | null;
774
+ creator?: components["schemas"]["Users"];
775
+ };
776
+ AppPlaySession: {
777
+ id: string;
778
+ /** Format: date-time */
779
+ createdAt: string;
780
+ /** Format: date-time */
781
+ updatedAt: string;
782
+ /** Format: date-time */
783
+ deletedAt: string | null;
784
+ spaceId: string;
785
+ space?: components["schemas"]["Space"];
786
+ appId: string;
787
+ app?: components["schemas"]["App"];
788
+ /** @enum {string} */
789
+ status: "CREATED" | "READY" | "PLAYING" | "PAUSED" | "FINISHED" | "ABORTED" | "EXPIRED";
790
+ token: string;
791
+ playerId: string;
792
+ player?: components["schemas"]["AppPlayer"];
793
+ gameInstanceId: string;
794
+ gameInstance?: components["schemas"]["AppGameInstance"];
795
+ /** Format: date-time */
796
+ startedAt: string | null;
797
+ /** Format: date-time */
798
+ finishedAt: string | null;
799
+ /** Format: date-time */
800
+ abortedAt: string | null;
801
+ /** Format: date-time */
802
+ expiresAt: string | null;
803
+ /** Format: float */
804
+ score: number | null;
805
+ result: Record<string, unknown> | null;
806
+ metadata: Record<string, unknown> | null;
807
+ };
808
+ AppPlayer: {
809
+ id: string;
810
+ /** Format: date-time */
811
+ createdAt: string;
812
+ /** Format: date-time */
813
+ updatedAt: string;
814
+ /** Format: date-time */
815
+ deletedAt: string | null;
816
+ spaceId: string;
817
+ space?: components["schemas"]["Space"];
818
+ appId: string;
819
+ app?: components["schemas"]["App"];
820
+ identity: string;
821
+ /** @enum {string} */
822
+ type: "ANONYMOUS" | "IDENTIFIED";
823
+ externalId: string | null;
824
+ displayName: string | null;
825
+ avatarUrl: string | null;
826
+ metadata: Record<string, unknown> | null;
827
+ /** Format: date-time */
828
+ bannedAt: string | null;
829
+ playSessions?: components["schemas"]["AppPlaySession"][];
830
+ };
831
+ AppGameInstance: {
832
+ id: string;
833
+ /** Format: date-time */
834
+ createdAt: string;
835
+ /** Format: date-time */
836
+ updatedAt: string;
837
+ /** Format: date-time */
838
+ deletedAt: string | null;
839
+ spaceId: string;
840
+ space?: components["schemas"]["Space"];
841
+ appId: string;
842
+ app?: components["schemas"]["App"];
843
+ name: string;
844
+ /** @enum {string} */
845
+ status: "DRAFT" | "PUBLISHED" | "ARCHIVED";
846
+ resolvedUrl: string | null;
847
+ /** Format: date-time */
848
+ resolvedAt: string | null;
849
+ unlockToken: string | null;
850
+ overrides: Record<string, unknown> | null;
851
+ gameId: string;
852
+ game?: components["schemas"]["Game"];
853
+ playSessions?: components["schemas"]["AppPlaySession"][];
854
+ };
855
+ Game: {
856
+ id: string;
857
+ /** Format: date-time */
858
+ createdAt: string;
859
+ /** Format: date-time */
860
+ updatedAt: string;
861
+ /** Format: date-time */
862
+ deletedAt: string | null;
863
+ name: string;
864
+ slug: string;
865
+ /** Format: int32 */
866
+ version: number;
867
+ /** @enum {string} */
868
+ status: "DRAFT" | "ACTIVED" | "ARCHIVED";
869
+ description: string | null;
870
+ coverImageUrl: string | null;
871
+ screenshots: Record<string, unknown>;
872
+ entryPointUrl: string | null;
873
+ backendUrl: string | null;
874
+ /** @enum {string} */
875
+ origin: "OFFICAL" | "DEVELOPER" | "SPACE_PRIVATE";
876
+ configSchema: Record<string, unknown> | null;
877
+ categoryId: string | null;
878
+ category?: components["schemas"]["GameCategory"];
879
+ creatorId: string | null;
880
+ creator?: components["schemas"]["Users"];
881
+ spaceId: string | null;
882
+ space?: components["schemas"]["Space"];
883
+ productionDeploymentId: string | null;
884
+ productionDeployment?: components["schemas"]["Deployment"];
885
+ deployments?: components["schemas"]["Deployment"][];
886
+ instances?: components["schemas"]["AppGameInstance"][];
887
+ gitSources?: components["schemas"]["GitSource"][];
888
+ };
889
+ GameCategory: {
890
+ id: string;
891
+ /** Format: date-time */
892
+ createdAt: string;
893
+ /** Format: date-time */
894
+ updatedAt: string;
895
+ /** Format: date-time */
896
+ deletedAt: string | null;
897
+ name: string;
898
+ slug: string;
899
+ description: string | null;
900
+ /** Format: int32 */
901
+ sortOrder: number;
902
+ games?: components["schemas"]["Game"][];
903
+ };
904
+ Deployment: {
905
+ id: string;
906
+ /** Format: date-time */
907
+ createdAt: string;
908
+ /** Format: date-time */
909
+ updatedAt: string;
910
+ /** Format: date-time */
911
+ deletedAt: string | null;
912
+ gitSourceId: string | null;
913
+ gitSource?: components["schemas"]["GitSource"];
914
+ gameId: string;
915
+ game?: components["schemas"]["Game"];
916
+ productionFor?: components["schemas"]["Game"];
917
+ spaceId: string | null;
918
+ space?: components["schemas"]["Space"];
919
+ /** @enum {string} */
920
+ status: "QUEUED" | "BUILDING" | "READY" | "ERROR" | "CANCELED";
921
+ commitSha: string;
922
+ commitMessage: string | null;
923
+ branch: string | null;
924
+ authorName: string | null;
925
+ authorEmail: string | null;
926
+ version: string;
927
+ versionLabel: string | null;
928
+ manifest: Record<string, unknown> | null;
929
+ entryPointUrl: string | null;
930
+ backendUrl: string | null;
931
+ assetBaseUrl: string | null;
932
+ configSchema: Record<string, unknown> | null;
933
+ buildMeta: Record<string, unknown> | null;
934
+ registryLinks: Record<string, unknown> | null;
935
+ errorMessage: string | null;
936
+ logsUrl: string | null;
937
+ triggeredById: string | null;
938
+ triggeredBy?: components["schemas"]["Users"];
939
+ /** @enum {string|null} */
940
+ triggerSource: "GIT_PUSH" | "MANUAL" | "API" | "ROLLBACK" | "MANIFEST_SYNC" | null;
941
+ ciRunnerId: string | null;
942
+ ciRunner?: components["schemas"]["CiRunner"];
943
+ /** Format: date-time */
944
+ startedAt: string | null;
945
+ /** Format: date-time */
946
+ finishedAt: string | null;
947
+ };
948
+ GitSource: {
949
+ id: string;
950
+ /** Format: date-time */
951
+ createdAt: string;
952
+ /** Format: date-time */
953
+ updatedAt: string;
954
+ /** Format: date-time */
955
+ deletedAt: string | null;
956
+ /** @enum {string} */
957
+ provider: "GITHUB" | "GITLAB" | "BITBUCKET" | "GITEA" | "GENERIC";
958
+ repoUrl: string;
959
+ /** @enum {string} */
960
+ status: "UNKNOWN" | "AVAILABLE" | "NOT_FOUND" | "UNAUTHORIZED" | "UNREACHABLE";
961
+ owner: string | null;
962
+ repo: string | null;
963
+ defaultBranch: string;
964
+ rootDirectory: string;
965
+ manifestPath: string;
966
+ autoDeployEnabled: boolean;
967
+ productionBranch: string;
968
+ authType: string | null;
969
+ authSecretId: string | null;
970
+ webhookId: string | null;
971
+ lastCommitSha: string | null;
972
+ lastCommitMessage: string | null;
973
+ /** Format: date-time */
974
+ lastCommitAt: string | null;
975
+ /** Format: date-time */
976
+ installedAt: string;
977
+ /** Format: date-time */
978
+ lastSyncedAt: string | null;
979
+ /** Format: date-time */
980
+ lastManifestAt: string | null;
981
+ lastManifest: Record<string, unknown> | null;
982
+ connectorId: string | null;
983
+ connector?: components["schemas"]["GitConnector"];
984
+ gameId: string | null;
985
+ game?: components["schemas"]["Game"];
986
+ creatorId: string | null;
987
+ creator?: components["schemas"]["Users"];
988
+ deployments?: components["schemas"]["Deployment"][];
989
+ spaceId: string | null;
990
+ space?: components["schemas"]["Space"];
991
+ };
992
+ GitConnector: {
993
+ id: string;
994
+ /** Format: date-time */
995
+ createdAt: string;
996
+ /** Format: date-time */
997
+ updatedAt: string;
998
+ /** Format: date-time */
999
+ deletedAt: string | null;
1000
+ /** @enum {string} */
1001
+ provider: "GITHUB" | "GITLAB" | "BITBUCKET" | "GITEA" | "GENERIC";
1002
+ /** @enum {string} */
1003
+ status: "UNKNOWN" | "AVAILABLE" | "NOT_FOUND" | "UNAUTHORIZED" | "UNREACHABLE";
1004
+ accountLogin: string;
1005
+ accountId: string;
1006
+ accountAvatarUrl: string | null;
1007
+ accountType: string | null;
1008
+ installationId: string | null;
1009
+ /** Format: date-time */
1010
+ tokenExpiresAt: string | null;
1011
+ scopes: string | null;
1012
+ /** Format: date-time */
1013
+ lastSyncedAt: string | null;
1014
+ creatorId: string | null;
1015
+ creator?: components["schemas"]["Users"];
1016
+ gitSources?: components["schemas"]["GitSource"][];
1017
+ spaceId: string | null;
1018
+ space?: components["schemas"]["Space"];
1019
+ };
1020
+ CiRunner: {
1021
+ id: string;
1022
+ /** Format: date-time */
1023
+ createdAt: string;
1024
+ /** Format: date-time */
1025
+ updatedAt: string;
1026
+ /** Format: date-time */
1027
+ deletedAt: string | null;
1028
+ name: string;
1029
+ runnerKey: string;
1030
+ /** @enum {string} */
1031
+ status: "DISCONNECTED" | "CONNECTED" | "BUSY";
1032
+ /** Format: date-time */
1033
+ lastSeenAt: string | null;
1034
+ lastError: string | null;
1035
+ hostname: string | null;
1036
+ version: string | null;
1037
+ creatorId: string | null;
1038
+ creator?: components["schemas"]["Users"];
1039
+ spaceId: string | null;
1040
+ space?: components["schemas"]["Space"];
1041
+ deployments?: components["schemas"]["Deployment"][];
1042
+ };
1043
+ Webhook: {
1044
+ id: string;
1045
+ /** Format: date-time */
1046
+ createdAt: string;
1047
+ /** Format: date-time */
1048
+ updatedAt: string;
1049
+ /** Format: date-time */
1050
+ deletedAt: string | null;
1051
+ spaceId: string;
1052
+ space?: components["schemas"]["Space"];
1053
+ appId: string | null;
1054
+ app?: components["schemas"]["App"];
1055
+ creatorId: string | null;
1056
+ creator?: components["schemas"]["Users"];
1057
+ url: string;
1058
+ secret: string | null;
1059
+ enabled: boolean;
1060
+ /** @enum {string} */
1061
+ events: "SESSION_CREATED" | "SESSION_STARTED" | "SESSION_FINISHED" | "SESSION_ABORTED" | "SCORE_UPDATED" | "CUSTOM";
1062
+ headers: Record<string, unknown> | null;
1063
+ /** Format: date-time */
1064
+ lastDeliveryAt: string | null;
1065
+ /** Format: int32 */
1066
+ lastStatus: number | null;
1067
+ deliveries?: components["schemas"]["WebhookDelivery"][];
1068
+ };
1069
+ WebhookDelivery: {
1070
+ id: string;
1071
+ /** Format: date-time */
1072
+ createdAt: string;
1073
+ /** Format: date-time */
1074
+ updatedAt: string;
1075
+ /** Format: date-time */
1076
+ deletedAt: string | null;
1077
+ spaceId: string;
1078
+ space?: components["schemas"]["Space"];
1079
+ webhookId: string;
1080
+ webhook?: components["schemas"]["Webhook"];
1081
+ /** @enum {string} */
1082
+ event: "SESSION_CREATED" | "SESSION_STARTED" | "SESSION_FINISHED" | "SESSION_ABORTED" | "SCORE_UPDATED" | "CUSTOM";
1083
+ /** @enum {string} */
1084
+ status: "PENDING" | "SUCCESS" | "FAILED";
1085
+ payload: Record<string, unknown>;
1086
+ /** Format: int32 */
1087
+ attempts: number;
1088
+ /** Format: int32 */
1089
+ maxAttempts: number;
1090
+ /** Format: date-time */
1091
+ nextAttemptAt: string | null;
1092
+ /** Format: date-time */
1093
+ deliveredAt: string | null;
1094
+ /** Format: int32 */
1095
+ statusCode: number | null;
1096
+ /** Format: int32 */
1097
+ durationMs: number | null;
1098
+ error: string | null;
1099
+ responseBody: string | null;
1100
+ };
1101
+ PagedGameInstance: {
1102
+ /** @description Page info */
1103
+ pageInfo: components["schemas"]["PageInfo"];
1104
+ /** @description Array of resource items for the current page */
1105
+ data: components["schemas"]["AppGameInstance"][];
1106
+ };
1107
+ PageInfo: {
1108
+ /**
1109
+ * @description Cursor for the next page (cursor-based pagination)
1110
+ * @example eyJpZCI6IjEyMyJ9
1111
+ */
1112
+ endCursor?: string;
1113
+ /**
1114
+ * @description Current page number (offset-based pagination)
1115
+ * @example 1
1116
+ */
1117
+ page?: number;
1118
+ /**
1119
+ * @description Number of items per page
1120
+ * @example 20
1121
+ */
1122
+ limit: number;
1123
+ /**
1124
+ * @description Total number of items across all pages
1125
+ * @example 145
1126
+ */
1127
+ total?: number;
1128
+ /**
1129
+ * @description Total number of pages
1130
+ * @example 8
1131
+ */
1132
+ totalPages?: number;
1133
+ /**
1134
+ * @description Whether there is a next page
1135
+ * @example true
1136
+ */
1137
+ hasNextPage: boolean;
1138
+ /**
1139
+ * @description Whether there is a previous page
1140
+ * @example false
1141
+ */
1142
+ hasPreviousPage: boolean;
1143
+ };
1144
+ PublicGameInstance: {
1145
+ id: string;
1146
+ /** Format: date-time */
1147
+ createdAt: string;
1148
+ /** Format: date-time */
1149
+ updatedAt: string;
1150
+ spaceId: string;
1151
+ appId: string;
1152
+ name: string;
1153
+ /** @enum {string} */
1154
+ status: "DRAFT" | "PUBLISHED" | "ARCHIVED";
1155
+ resolvedUrl: string | null;
1156
+ /** Format: date-time */
1157
+ resolvedAt: string | null;
1158
+ overrides: Record<string, unknown> | null;
1159
+ gameId: string;
1160
+ game: components["schemas"]["Game"];
1161
+ editorUrl: string | null;
1162
+ };
1163
+ CategoryFeed: {
1164
+ data: components["schemas"]["CategorySummary"][];
1165
+ };
1166
+ CategorySummary: {
1167
+ id: string;
1168
+ name: string;
1169
+ slug: string;
1170
+ description?: string | null;
1171
+ sortOrder: number;
1172
+ /** @description Published games in this category */
1173
+ gameCount: number;
1174
+ };
1175
+ PagedGame: {
1176
+ /** @description Page info */
1177
+ pageInfo: components["schemas"]["PageInfo"];
1178
+ /** @description Array of resource items for the current page */
1179
+ data: components["schemas"]["Game"][];
1180
+ };
1181
+ PagedPlayerLeaderboard: {
1182
+ /** @description Page info */
1183
+ pageInfo: components["schemas"]["PageInfo"];
1184
+ /** @description Array of resource items for the current page */
1185
+ data: components["schemas"]["PlayerLeaderboardEntry"][];
1186
+ };
1187
+ PlayerLeaderboardEntry: {
1188
+ /** @description Rank on the requested page (1-based) */
1189
+ rank: number;
1190
+ player: components["schemas"]["LeaderboardPlayer"];
1191
+ score: number;
1192
+ /** @description Session that holds the player best score */
1193
+ sessionId: string;
1194
+ /** Format: date-time */
1195
+ finishedAt: string | null;
1196
+ };
1197
+ LeaderboardPlayer: {
1198
+ id: string;
1199
+ displayName: string | null;
1200
+ avatarUrl: string | null;
1201
+ };
1202
+ PagedSessionLeaderboard: {
1203
+ /** @description Page info */
1204
+ pageInfo: components["schemas"]["PageInfo"];
1205
+ /** @description Array of resource items for the current page */
1206
+ data: components["schemas"]["SessionLeaderboardEntry"][];
1207
+ };
1208
+ SessionLeaderboardEntry: {
1209
+ /** @description Rank on the requested page (1-based) */
1210
+ rank: number;
1211
+ sessionId: string;
1212
+ player: components["schemas"]["LeaderboardPlayer"];
1213
+ score: number;
1214
+ /** Format: date-time */
1215
+ finishedAt: string | null;
1216
+ };
1217
+ IdentifyPlayerDto: {
1218
+ identity?: string;
1219
+ /** @enum {string} */
1220
+ type?: "ANONYMOUS" | "IDENTIFIED";
1221
+ externalId?: string;
1222
+ displayName?: string;
1223
+ avatarUrl?: string;
1224
+ metadata?: Record<string, unknown>;
1225
+ };
1226
+ PlayerLoginResponse: {
1227
+ player: components["schemas"]["AppPlayer"];
1228
+ /** @description Signed player access token (JWT). Pass it to the game as the `playerAccessToken` query parameter; `POST /games/runtime/sessions` verifies it. */
1229
+ playerAccessToken: string;
1230
+ };
1231
+ UpdatePlayerDto: {
1232
+ externalId?: string;
1233
+ displayName?: string;
1234
+ avatarUrl?: string;
1235
+ metadata?: Record<string, unknown>;
1236
+ };
1237
+ PlayerLogoutResponse: {
1238
+ playerId: string;
1239
+ /** @description Live play sessions expired by the logout */
1240
+ revokedSessions: number;
1241
+ };
1242
+ CreatePlaySessionDto: {
1243
+ playerId: string;
1244
+ gameInstanceId: string;
1245
+ metadata?: Record<string, unknown>;
1246
+ /**
1247
+ * Format: date-time
1248
+ * @description Session lifetime deadline (ISO 8601). Defaults to the server TTL.
1249
+ */
1250
+ expiresAt?: string;
1251
+ };
1252
+ ActivePlaySession: {
1253
+ /** @description The newest live session, or null when the player has none. */
1254
+ session?: components["schemas"]["AppPlaySession"];
1255
+ };
1256
+ UpdatePlaySessionDto: {
1257
+ /**
1258
+ * @description Only transitions allowed by the session lifecycle are accepted
1259
+ * @enum {string}
1260
+ */
1261
+ status?: "CREATED" | "READY" | "PLAYING" | "PAUSED" | "FINISHED" | "ABORTED" | "EXPIRED";
1262
+ score?: number;
1263
+ result?: Record<string, unknown>;
1264
+ metadata?: Record<string, unknown>;
1265
+ };
1266
+ UpdateScoreDto: {
1267
+ score: number;
1268
+ result?: Record<string, unknown>;
1269
+ };
1270
+ CreateRuntimeSessionDto: {
1271
+ gameInstanceId: string;
1272
+ /** @description The `playerAccessToken` returned by `POST /sdk/login`. */
1273
+ playerAccessToken: string;
1274
+ };
1275
+ RuntimeEmitDto: {
1276
+ /** @description Session event. The lifecycle names (`LIFECYCLE_EVENTS` in `src/game/lifecycle.ts`: ready, start, pause, finish, abort, score, snapshot) move the session status; any other string is accepted as a custom event, leaves the status alone, and is stored as the session `lastEvent`. */
1277
+ type: string;
1278
+ payload?: Record<string, unknown>;
1279
+ };
1280
+ RuntimeSnapshotDto: {
1281
+ state: Record<string, unknown>;
1282
+ };
1283
+ RuntimeHandlerDto: {
1284
+ /** @description Published game id. Loads handler/index.js from the registry. */
1285
+ gameId?: string;
1286
+ /** @description Handler source for local studio testing. Takes precedence over gameId. */
1287
+ source?: string;
1288
+ /** @description Finish payload: { score, result, config } */
1289
+ payload?: Record<string, unknown>;
1290
+ };
1291
+ };
1292
+ responses: {
1293
+ /** @description Unauthorized access */
1294
+ Unauthorized: {
1295
+ content: {
1296
+ "application/json": {
1297
+ /** @example 401 */
1298
+ statusCode?: number;
1299
+ /** @example Unauthorized */
1300
+ message?: string;
1301
+ };
1302
+ };
1303
+ };
1304
+ /** @description Forbidden */
1305
+ Forbidden: {
1306
+ content: {
1307
+ "application/json": {
1308
+ /** @example 403 */
1309
+ statusCode?: number;
1310
+ /** @example Forbidden */
1311
+ message?: string;
1312
+ };
1313
+ };
1314
+ };
1315
+ };
1316
+ parameters: never;
1317
+ requestBodies: never;
1318
+ headers: never;
1319
+ pathItems: never;
1320
+ }
1321
+
1322
+ type operations = Record<string, never>;
1323
+
1324
+ /** Header names the server reads app credentials from (`apps/server/src/auth/auth.guard.ts`). */
1325
+ declare const APP_KEY_HEADER = "x-app-key";
1326
+ declare const APP_SECRET_HEADER = "x-app-secret";
1327
+ type InitOptions = {
1328
+ /** Base URL of the API, without a trailing slash. */
1329
+ apiUrl: string;
1330
+ /** Sent as `x-app-key`: the app's `id`, which the auth guard looks the app up by. */
1331
+ appKey?: string;
1332
+ /** Sent as `x-app-secret`: one of the app's credential `clientSecret` values. */
1333
+ appSecret?: string;
1334
+ /** Abort a request after this many milliseconds. `0` or unset means no timeout. */
1335
+ timeoutMs?: number;
1336
+ /** Override the fetch implementation, for a Node polyfill or a test. */
1337
+ fetch?: typeof globalThis.fetch;
1338
+ };
1339
+ /** Thrown when a request is made before any credentials were configured. */
1340
+ declare class SdkNotInitializedError extends Error {
1341
+ constructor();
1342
+ }
1343
+ declare class SdkConfigError extends Error {
1344
+ constructor(message: string);
1345
+ }
1346
+ /**
1347
+ * A client with its own base URL and credentials. Use this when a process serves
1348
+ * more than one app: each client is independent, so one tenant's configuration
1349
+ * cannot overwrite another's.
1350
+ */
1351
+ declare function createSdkClient(options: InitOptions): Client<paths>;
1352
+ /**
1353
+ * Process-wide client configured by `initializeSDK` or `<SDKInitializer>`.
1354
+ *
1355
+ * Before the first initialization every access throws `SdkNotInitializedError`,
1356
+ * so a mis-ordered import fails where it happens instead of sending a request to
1357
+ * a placeholder origin.
1358
+ */
1359
+ declare const fetchClient: Client<paths>;
1360
+ /** Configure the process-wide client and return it. */
1361
+ declare function initializeSDK(options: InitOptions): Client<paths>;
1362
+ /** A game instance from `GET /sdk/game-instances`, as generated from the OpenAPI document. */
1363
+ type GameInstance = components['schemas']['AppGameInstance'];
1364
+ type ResolveGameUrlOptions = {
1365
+ /** API base URL the frame calls. Defaults to the `apiUrl` passed to `initializeSDK`. */
1366
+ apiUrl?: string;
1367
+ /** Config to hand the game as `gameSetting`. Defaults to the instance overrides. */
1368
+ config?: Record<string, unknown> | null;
1369
+ };
1370
+ /**
1371
+ * Build the URL the host loads in an iframe or webview from the game instance
1372
+ * and the token `POST /sdk/login` returned. It appends `apiUrl`,
1373
+ * `gameInstanceId`, `playerAccessToken`, and `gameSetting`.
1374
+ *
1375
+ * `apiUrl` defaults to the one given to `initializeSDK`. A caller that uses
1376
+ * `createSdkClient` instead must pass `{ apiUrl }`, because that client is not
1377
+ * the process-wide one.
1378
+ */
1379
+ declare function resolveGameURL(gameInstance: GameInstance, playerAccessToken: string, options?: ResolveGameUrlOptions): string;
1380
+
1381
+ export { APP_KEY_HEADER, APP_SECRET_HEADER, type GameInstance, type InitOptions, type ResolveGameUrlOptions, SdkConfigError, SdkNotInitializedError, type components, createSdkClient, fetchClient, initializeSDK, type operations, type paths, resolveGameURL };