@fzgame/sdk 0.0.0-stage → 0.1.0
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/LICENSE +15 -0
- package/README.md +138 -2
- package/dist/index.d.mts +981 -0
- package/dist/index.d.ts +981 -0
- package/dist/index.js +117 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +74 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react.d.mts +11 -0
- package/dist/react.d.ts +11 -0
- package/dist/react.js +115 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +81 -0
- package/dist/react.mjs.map +1 -0
- package/package.json +91 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,981 @@
|
|
|
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"]["AppGameInstance"];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
401: components["responses"]["Unauthorized"];
|
|
86
|
+
403: components["responses"]["Forbidden"];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
"/sdk/login": {
|
|
91
|
+
/** Identify or create a player (SDK) */
|
|
92
|
+
post: {
|
|
93
|
+
requestBody?: {
|
|
94
|
+
content: {
|
|
95
|
+
"application/json": components["schemas"]["IdentifyPlayerDto"];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
responses: {
|
|
99
|
+
401: components["responses"]["Unauthorized"];
|
|
100
|
+
403: components["responses"]["Forbidden"];
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
"/sdk/players/{id}": {
|
|
105
|
+
/** Get player by id (SDK) */
|
|
106
|
+
get: {
|
|
107
|
+
parameters: {
|
|
108
|
+
path: {
|
|
109
|
+
id: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
responses: {
|
|
113
|
+
401: components["responses"]["Unauthorized"];
|
|
114
|
+
403: components["responses"]["Forbidden"];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/** Update the profile of a player (SDK) */
|
|
118
|
+
put: {
|
|
119
|
+
parameters: {
|
|
120
|
+
path: {
|
|
121
|
+
id: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
requestBody?: {
|
|
125
|
+
content: {
|
|
126
|
+
"application/json": components["schemas"]["UpdatePlayerDto"];
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
responses: {
|
|
130
|
+
401: components["responses"]["Unauthorized"];
|
|
131
|
+
403: components["responses"]["Forbidden"];
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
/** Delete a player (SDK) */
|
|
135
|
+
delete: {
|
|
136
|
+
parameters: {
|
|
137
|
+
path: {
|
|
138
|
+
id: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
responses: {
|
|
142
|
+
401: components["responses"]["Unauthorized"];
|
|
143
|
+
403: components["responses"]["Forbidden"];
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
"/sdk/players/{id}/logout": {
|
|
148
|
+
/** End every live play session of a player (SDK) */
|
|
149
|
+
post: {
|
|
150
|
+
parameters: {
|
|
151
|
+
path: {
|
|
152
|
+
id: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
responses: {
|
|
156
|
+
401: components["responses"]["Unauthorized"];
|
|
157
|
+
403: components["responses"]["Forbidden"];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
"/sessions": {
|
|
162
|
+
/** Create a play session (SDK) */
|
|
163
|
+
post: {
|
|
164
|
+
requestBody?: {
|
|
165
|
+
content: {
|
|
166
|
+
"application/json": components["schemas"]["CreatePlaySessionDto"];
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
responses: {
|
|
170
|
+
401: components["responses"]["Unauthorized"];
|
|
171
|
+
403: components["responses"]["Forbidden"];
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
"/sessions/{token}": {
|
|
176
|
+
/** Get play session by token (SDK / iframe) */
|
|
177
|
+
get: {
|
|
178
|
+
parameters: {
|
|
179
|
+
path: {
|
|
180
|
+
token: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
responses: {
|
|
184
|
+
401: components["responses"]["Unauthorized"];
|
|
185
|
+
403: components["responses"]["Forbidden"];
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
/** Update play session (SDK) */
|
|
189
|
+
put: {
|
|
190
|
+
requestBody?: {
|
|
191
|
+
content: {
|
|
192
|
+
"application/json": components["schemas"]["UpdatePlaySessionDto"];
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
responses: {
|
|
196
|
+
401: components["responses"]["Unauthorized"];
|
|
197
|
+
403: components["responses"]["Forbidden"];
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
"/sessions/{token}/pause": {
|
|
202
|
+
/** Pause a playing session */
|
|
203
|
+
post: {
|
|
204
|
+
responses: {
|
|
205
|
+
401: components["responses"]["Unauthorized"];
|
|
206
|
+
403: components["responses"]["Forbidden"];
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
"/sessions/{token}/resume": {
|
|
211
|
+
/** Resume a paused session */
|
|
212
|
+
post: {
|
|
213
|
+
responses: {
|
|
214
|
+
401: components["responses"]["Unauthorized"];
|
|
215
|
+
403: components["responses"]["Forbidden"];
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
"/sessions/{token}/start": {
|
|
220
|
+
/** Start play session */
|
|
221
|
+
post: {
|
|
222
|
+
responses: {
|
|
223
|
+
401: components["responses"]["Unauthorized"];
|
|
224
|
+
403: components["responses"]["Forbidden"];
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
"/sessions/{token}/finish": {
|
|
229
|
+
/** Finish play session */
|
|
230
|
+
post: {
|
|
231
|
+
requestBody?: {
|
|
232
|
+
content: {
|
|
233
|
+
"application/json": components["schemas"]["UpdateScoreDto"];
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
responses: {
|
|
237
|
+
401: components["responses"]["Unauthorized"];
|
|
238
|
+
403: components["responses"]["Forbidden"];
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
"/sessions/{token}/abort": {
|
|
243
|
+
/** Abort play session */
|
|
244
|
+
post: {
|
|
245
|
+
responses: {
|
|
246
|
+
401: components["responses"]["Unauthorized"];
|
|
247
|
+
403: components["responses"]["Forbidden"];
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
"/sessions/{token}/score": {
|
|
252
|
+
/** Update session score */
|
|
253
|
+
post: {
|
|
254
|
+
requestBody?: {
|
|
255
|
+
content: {
|
|
256
|
+
"application/json": components["schemas"]["UpdateScoreDto"];
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
responses: {
|
|
260
|
+
401: components["responses"]["Unauthorized"];
|
|
261
|
+
403: components["responses"]["Forbidden"];
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
"/games/runtime/sessions": {
|
|
266
|
+
/** Fetch or create a play session from gameInstanceId + player token */
|
|
267
|
+
post: {
|
|
268
|
+
requestBody?: {
|
|
269
|
+
content: {
|
|
270
|
+
"application/json": components["schemas"]["CreateRuntimeSessionDto"];
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
responses: {
|
|
274
|
+
401: components["responses"]["Unauthorized"];
|
|
275
|
+
403: components["responses"]["Forbidden"];
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
"/games/runtime/sessions/{token}": {
|
|
280
|
+
/** Get a play session by token */
|
|
281
|
+
get: {
|
|
282
|
+
parameters: {
|
|
283
|
+
path: {
|
|
284
|
+
token: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
responses: {
|
|
288
|
+
401: components["responses"]["Unauthorized"];
|
|
289
|
+
403: components["responses"]["Forbidden"];
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
"/games/runtime/sessions/{token}/emit": {
|
|
294
|
+
/** Emit a lifecycle event against a play session */
|
|
295
|
+
post: {
|
|
296
|
+
parameters: {
|
|
297
|
+
path: {
|
|
298
|
+
token: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
requestBody?: {
|
|
302
|
+
content: {
|
|
303
|
+
"application/json": components["schemas"]["RuntimeEmitDto"];
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
responses: {
|
|
307
|
+
401: components["responses"]["Unauthorized"];
|
|
308
|
+
403: components["responses"]["Forbidden"];
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
"/games/runtime/sessions/{token}/snapshot": {
|
|
313
|
+
/** Persist a local game snapshot on the play session */
|
|
314
|
+
put: {
|
|
315
|
+
parameters: {
|
|
316
|
+
path: {
|
|
317
|
+
token: string;
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
requestBody?: {
|
|
321
|
+
content: {
|
|
322
|
+
"application/json": components["schemas"]["RuntimeSnapshotDto"];
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
responses: {
|
|
326
|
+
401: components["responses"]["Unauthorized"];
|
|
327
|
+
403: components["responses"]["Forbidden"];
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
interface components {
|
|
334
|
+
schemas: {
|
|
335
|
+
App: {
|
|
336
|
+
id: string;
|
|
337
|
+
/** Format: date-time */
|
|
338
|
+
createdAt: string;
|
|
339
|
+
/** Format: date-time */
|
|
340
|
+
updatedAt: string;
|
|
341
|
+
/** Format: date-time */
|
|
342
|
+
deletedAt: string | null;
|
|
343
|
+
spaceId: string;
|
|
344
|
+
space?: components["schemas"]["Space"];
|
|
345
|
+
name: string;
|
|
346
|
+
/** @enum {string} */
|
|
347
|
+
status: "ACTIVE" | "DISABLED" | "ARCHIVED";
|
|
348
|
+
clientId: string;
|
|
349
|
+
description: string | null;
|
|
350
|
+
logoUrl: string | null;
|
|
351
|
+
settings: Record<string, unknown> | null;
|
|
352
|
+
ownerId: string;
|
|
353
|
+
owner?: components["schemas"]["Users"];
|
|
354
|
+
credentials?: components["schemas"]["AppCredential"][];
|
|
355
|
+
players?: components["schemas"]["AppPlayer"][];
|
|
356
|
+
playSessions?: components["schemas"]["AppPlaySession"][];
|
|
357
|
+
gameInstances?: components["schemas"]["AppGameInstance"][];
|
|
358
|
+
webhooks?: components["schemas"]["Webhook"][];
|
|
359
|
+
};
|
|
360
|
+
Space: {
|
|
361
|
+
id: string;
|
|
362
|
+
/** Format: date-time */
|
|
363
|
+
createdAt: string;
|
|
364
|
+
/** Format: date-time */
|
|
365
|
+
updatedAt: string;
|
|
366
|
+
/** Format: date-time */
|
|
367
|
+
deletedAt: string | null;
|
|
368
|
+
name: string;
|
|
369
|
+
spaceKey: string;
|
|
370
|
+
image: string | null;
|
|
371
|
+
description: string | null;
|
|
372
|
+
ownerId: string | null;
|
|
373
|
+
owner?: components["schemas"]["Users"];
|
|
374
|
+
userSpaces?: components["schemas"]["UserSpace"][];
|
|
375
|
+
invites?: components["schemas"]["SpaceInvite"][];
|
|
376
|
+
app?: components["schemas"]["App"][];
|
|
377
|
+
appCredentials?: components["schemas"]["AppCredential"][];
|
|
378
|
+
appPlaySessions?: components["schemas"]["AppPlaySession"][];
|
|
379
|
+
appGameInstances?: components["schemas"]["AppGameInstance"][];
|
|
380
|
+
appPlayers?: components["schemas"]["AppPlayer"][];
|
|
381
|
+
privateGames?: components["schemas"]["Game"][];
|
|
382
|
+
webhooks?: components["schemas"]["Webhook"][];
|
|
383
|
+
webhookDeliveries?: components["schemas"]["WebhookDelivery"][];
|
|
384
|
+
gitConnectors?: components["schemas"]["GitConnector"][];
|
|
385
|
+
gitSources?: components["schemas"]["GitSource"][];
|
|
386
|
+
deployments?: components["schemas"]["Deployment"][];
|
|
387
|
+
};
|
|
388
|
+
Users: {
|
|
389
|
+
id: string;
|
|
390
|
+
name: string;
|
|
391
|
+
email: string;
|
|
392
|
+
emailVerified: boolean;
|
|
393
|
+
image: string | null;
|
|
394
|
+
/** Format: date-time */
|
|
395
|
+
createdAt: string;
|
|
396
|
+
/** Format: date-time */
|
|
397
|
+
updatedAt: string;
|
|
398
|
+
/** Format: date-time */
|
|
399
|
+
deletedAt: string | null;
|
|
400
|
+
twoFactorEnabled: boolean | null;
|
|
401
|
+
sessions?: components["schemas"]["Session"][];
|
|
402
|
+
accounts?: components["schemas"]["Account"][];
|
|
403
|
+
twofactors?: components["schemas"]["TwoFactor"][];
|
|
404
|
+
/** Format: date-time */
|
|
405
|
+
birthDate: string | null;
|
|
406
|
+
};
|
|
407
|
+
Session: {
|
|
408
|
+
id: string;
|
|
409
|
+
/** Format: date-time */
|
|
410
|
+
expiresAt: string;
|
|
411
|
+
token: string;
|
|
412
|
+
/** Format: date-time */
|
|
413
|
+
createdAt: string;
|
|
414
|
+
/** Format: date-time */
|
|
415
|
+
updatedAt: string;
|
|
416
|
+
ipAddress: string | null;
|
|
417
|
+
userAgent: string | null;
|
|
418
|
+
userId: string;
|
|
419
|
+
users?: components["schemas"]["Users"];
|
|
420
|
+
};
|
|
421
|
+
Account: {
|
|
422
|
+
id: string;
|
|
423
|
+
accountId: string;
|
|
424
|
+
providerId: string;
|
|
425
|
+
userId: string;
|
|
426
|
+
users?: components["schemas"]["Users"];
|
|
427
|
+
accessToken: string | null;
|
|
428
|
+
refreshToken: string | null;
|
|
429
|
+
idToken: string | null;
|
|
430
|
+
/** Format: date-time */
|
|
431
|
+
accessTokenExpiresAt: string | null;
|
|
432
|
+
/** Format: date-time */
|
|
433
|
+
refreshTokenExpiresAt: string | null;
|
|
434
|
+
scope: string | null;
|
|
435
|
+
password: string | null;
|
|
436
|
+
issuer: string | null;
|
|
437
|
+
/** Format: date-time */
|
|
438
|
+
createdAt: string;
|
|
439
|
+
/** Format: date-time */
|
|
440
|
+
updatedAt: string;
|
|
441
|
+
};
|
|
442
|
+
TwoFactor: {
|
|
443
|
+
id: string;
|
|
444
|
+
secret: string;
|
|
445
|
+
backupCodes: string;
|
|
446
|
+
userId: string;
|
|
447
|
+
users?: components["schemas"]["Users"];
|
|
448
|
+
};
|
|
449
|
+
UserSpace: {
|
|
450
|
+
id: string;
|
|
451
|
+
/** Format: date-time */
|
|
452
|
+
createdAt: string;
|
|
453
|
+
/** Format: date-time */
|
|
454
|
+
updatedAt: string;
|
|
455
|
+
/** Format: date-time */
|
|
456
|
+
deletedAt: string | null;
|
|
457
|
+
spaceId: string;
|
|
458
|
+
space?: components["schemas"]["Space"];
|
|
459
|
+
userId: string;
|
|
460
|
+
user?: components["schemas"]["Users"];
|
|
461
|
+
/** @enum {string} */
|
|
462
|
+
role: "ADMIN" | "DEVELOPER" | "EDITOR";
|
|
463
|
+
/** @enum {string} */
|
|
464
|
+
auth: "OWNER" | "MEMBER";
|
|
465
|
+
};
|
|
466
|
+
SpaceInvite: {
|
|
467
|
+
id: string;
|
|
468
|
+
/** Format: date-time */
|
|
469
|
+
createdAt: string;
|
|
470
|
+
/** Format: date-time */
|
|
471
|
+
updatedAt: string;
|
|
472
|
+
/** Format: date-time */
|
|
473
|
+
deletedAt: string | null;
|
|
474
|
+
email: string;
|
|
475
|
+
token: string;
|
|
476
|
+
/** @enum {string} */
|
|
477
|
+
role: "ADMIN" | "DEVELOPER" | "EDITOR";
|
|
478
|
+
/** Format: date-time */
|
|
479
|
+
expiresAt: string;
|
|
480
|
+
/** Format: date-time */
|
|
481
|
+
acceptedAt: string | null;
|
|
482
|
+
/** Format: date-time */
|
|
483
|
+
revokedAt: string | null;
|
|
484
|
+
spaceId: string;
|
|
485
|
+
space?: components["schemas"]["Space"];
|
|
486
|
+
inviterId: string | null;
|
|
487
|
+
inviter?: components["schemas"]["Users"];
|
|
488
|
+
};
|
|
489
|
+
AppCredential: {
|
|
490
|
+
id: string;
|
|
491
|
+
/** Format: date-time */
|
|
492
|
+
createdAt: string;
|
|
493
|
+
/** Format: date-time */
|
|
494
|
+
updatedAt: string;
|
|
495
|
+
/** Format: date-time */
|
|
496
|
+
deletedAt: string | null;
|
|
497
|
+
spaceId: string;
|
|
498
|
+
space?: components["schemas"]["Space"];
|
|
499
|
+
appId: string;
|
|
500
|
+
app?: components["schemas"]["App"];
|
|
501
|
+
clientSecret: string;
|
|
502
|
+
/** Format: date-time */
|
|
503
|
+
expiresAt: string | null;
|
|
504
|
+
/** @enum {string} */
|
|
505
|
+
role: "ADMIN" | "DEVELOPER" | "EDITOR";
|
|
506
|
+
creatorId: string | null;
|
|
507
|
+
creator?: components["schemas"]["Users"];
|
|
508
|
+
};
|
|
509
|
+
AppPlaySession: {
|
|
510
|
+
id: string;
|
|
511
|
+
/** Format: date-time */
|
|
512
|
+
createdAt: string;
|
|
513
|
+
/** Format: date-time */
|
|
514
|
+
updatedAt: string;
|
|
515
|
+
/** Format: date-time */
|
|
516
|
+
deletedAt: string | null;
|
|
517
|
+
spaceId: string;
|
|
518
|
+
space?: components["schemas"]["Space"];
|
|
519
|
+
appId: string;
|
|
520
|
+
app?: components["schemas"]["App"];
|
|
521
|
+
/** @enum {string} */
|
|
522
|
+
status: "CREATED" | "READY" | "PLAYING" | "PAUSED" | "FINISHED" | "ABORTED" | "EXPIRED";
|
|
523
|
+
token: string;
|
|
524
|
+
playerId: string;
|
|
525
|
+
player?: components["schemas"]["AppPlayer"];
|
|
526
|
+
gameInstanceId: string;
|
|
527
|
+
gameInstance?: components["schemas"]["AppGameInstance"];
|
|
528
|
+
/** Format: date-time */
|
|
529
|
+
startedAt: string | null;
|
|
530
|
+
/** Format: date-time */
|
|
531
|
+
finishedAt: string | null;
|
|
532
|
+
/** Format: date-time */
|
|
533
|
+
abortedAt: string | null;
|
|
534
|
+
/** Format: date-time */
|
|
535
|
+
expiresAt: string | null;
|
|
536
|
+
/** Format: float */
|
|
537
|
+
score: number | null;
|
|
538
|
+
result: Record<string, unknown> | null;
|
|
539
|
+
metadata: Record<string, unknown> | null;
|
|
540
|
+
};
|
|
541
|
+
AppPlayer: {
|
|
542
|
+
id: string;
|
|
543
|
+
/** Format: date-time */
|
|
544
|
+
createdAt: string;
|
|
545
|
+
/** Format: date-time */
|
|
546
|
+
updatedAt: string;
|
|
547
|
+
/** Format: date-time */
|
|
548
|
+
deletedAt: string | null;
|
|
549
|
+
spaceId: string;
|
|
550
|
+
space?: components["schemas"]["Space"];
|
|
551
|
+
appId: string;
|
|
552
|
+
app?: components["schemas"]["App"];
|
|
553
|
+
identity: string;
|
|
554
|
+
/** @enum {string} */
|
|
555
|
+
type: "ANONYMOUS" | "IDENTIFIED";
|
|
556
|
+
externalId: string | null;
|
|
557
|
+
displayName: string | null;
|
|
558
|
+
avatarUrl: string | null;
|
|
559
|
+
metadata: Record<string, unknown> | null;
|
|
560
|
+
/** Format: date-time */
|
|
561
|
+
bannedAt: string | null;
|
|
562
|
+
playSessions?: components["schemas"]["AppPlaySession"][];
|
|
563
|
+
};
|
|
564
|
+
AppGameInstance: {
|
|
565
|
+
id: string;
|
|
566
|
+
/** Format: date-time */
|
|
567
|
+
createdAt: string;
|
|
568
|
+
/** Format: date-time */
|
|
569
|
+
updatedAt: string;
|
|
570
|
+
/** Format: date-time */
|
|
571
|
+
deletedAt: string | null;
|
|
572
|
+
spaceId: string;
|
|
573
|
+
space?: components["schemas"]["Space"];
|
|
574
|
+
appId: string;
|
|
575
|
+
app?: components["schemas"]["App"];
|
|
576
|
+
name: string;
|
|
577
|
+
/** @enum {string} */
|
|
578
|
+
status: "DRAFT" | "PUBLISHED" | "ARCHIVED";
|
|
579
|
+
resolvedUrl: string | null;
|
|
580
|
+
/** Format: date-time */
|
|
581
|
+
resolvedAt: string | null;
|
|
582
|
+
unlockToken: string | null;
|
|
583
|
+
overrides: Record<string, unknown> | null;
|
|
584
|
+
gameId: string;
|
|
585
|
+
game?: components["schemas"]["Game"];
|
|
586
|
+
playSessions?: components["schemas"]["AppPlaySession"][];
|
|
587
|
+
};
|
|
588
|
+
Game: {
|
|
589
|
+
id: string;
|
|
590
|
+
/** Format: date-time */
|
|
591
|
+
createdAt: string;
|
|
592
|
+
/** Format: date-time */
|
|
593
|
+
updatedAt: string;
|
|
594
|
+
/** Format: date-time */
|
|
595
|
+
deletedAt: string | null;
|
|
596
|
+
name: string;
|
|
597
|
+
slug: string;
|
|
598
|
+
/** Format: int32 */
|
|
599
|
+
version: number;
|
|
600
|
+
/** @enum {string} */
|
|
601
|
+
status: "DRAFT" | "ACTIVED" | "ARCHIVED";
|
|
602
|
+
description: string | null;
|
|
603
|
+
coverImageUrl: string | null;
|
|
604
|
+
screenshots: Record<string, unknown>;
|
|
605
|
+
entryPointUrl: string | null;
|
|
606
|
+
backendUrl: string | null;
|
|
607
|
+
/** @enum {string} */
|
|
608
|
+
origin: "OFFICAL" | "DEVELOPER" | "SPACE_PRIVATE";
|
|
609
|
+
configSchema: Record<string, unknown> | null;
|
|
610
|
+
creatorId: string | null;
|
|
611
|
+
creator?: components["schemas"]["Users"];
|
|
612
|
+
spaceId: string | null;
|
|
613
|
+
space?: components["schemas"]["Space"];
|
|
614
|
+
productionDeploymentId: string | null;
|
|
615
|
+
productionDeployment?: components["schemas"]["Deployment"];
|
|
616
|
+
deployments?: components["schemas"]["Deployment"][];
|
|
617
|
+
instances?: components["schemas"]["AppGameInstance"][];
|
|
618
|
+
gitSources?: components["schemas"]["GitSource"][];
|
|
619
|
+
};
|
|
620
|
+
Deployment: {
|
|
621
|
+
id: string;
|
|
622
|
+
/** Format: date-time */
|
|
623
|
+
createdAt: string;
|
|
624
|
+
/** Format: date-time */
|
|
625
|
+
updatedAt: string;
|
|
626
|
+
/** Format: date-time */
|
|
627
|
+
deletedAt: string | null;
|
|
628
|
+
gitSourceId: string | null;
|
|
629
|
+
gitSource?: components["schemas"]["GitSource"];
|
|
630
|
+
gameId: string;
|
|
631
|
+
game?: components["schemas"]["Game"];
|
|
632
|
+
productionFor?: components["schemas"]["Game"];
|
|
633
|
+
spaceId: string | null;
|
|
634
|
+
space?: components["schemas"]["Space"];
|
|
635
|
+
/** @enum {string} */
|
|
636
|
+
status: "QUEUED" | "BUILDING" | "READY" | "ERROR" | "CANCELED";
|
|
637
|
+
commitSha: string;
|
|
638
|
+
commitMessage: string | null;
|
|
639
|
+
branch: string | null;
|
|
640
|
+
authorName: string | null;
|
|
641
|
+
authorEmail: string | null;
|
|
642
|
+
version: string;
|
|
643
|
+
versionLabel: string | null;
|
|
644
|
+
manifest: Record<string, unknown> | null;
|
|
645
|
+
entryPointUrl: string | null;
|
|
646
|
+
backendUrl: string | null;
|
|
647
|
+
assetBaseUrl: string | null;
|
|
648
|
+
configSchema: Record<string, unknown> | null;
|
|
649
|
+
buildMeta: Record<string, unknown> | null;
|
|
650
|
+
registryLinks: Record<string, unknown> | null;
|
|
651
|
+
errorMessage: string | null;
|
|
652
|
+
logsUrl: string | null;
|
|
653
|
+
triggeredById: string | null;
|
|
654
|
+
triggeredBy?: components["schemas"]["Users"];
|
|
655
|
+
/** @enum {string|null} */
|
|
656
|
+
triggerSource: "GIT_PUSH" | "MANUAL" | "API" | "ROLLBACK" | "MANIFEST_SYNC" | null;
|
|
657
|
+
ciRunnerId: string | null;
|
|
658
|
+
ciRunner?: components["schemas"]["CiRunner"];
|
|
659
|
+
/** Format: date-time */
|
|
660
|
+
startedAt: string | null;
|
|
661
|
+
/** Format: date-time */
|
|
662
|
+
finishedAt: string | null;
|
|
663
|
+
};
|
|
664
|
+
GitSource: {
|
|
665
|
+
id: string;
|
|
666
|
+
/** Format: date-time */
|
|
667
|
+
createdAt: string;
|
|
668
|
+
/** Format: date-time */
|
|
669
|
+
updatedAt: string;
|
|
670
|
+
/** Format: date-time */
|
|
671
|
+
deletedAt: string | null;
|
|
672
|
+
/** @enum {string} */
|
|
673
|
+
provider: "GITHUB" | "GITLAB" | "BITBUCKET" | "GITEA" | "GENERIC";
|
|
674
|
+
repoUrl: string;
|
|
675
|
+
/** @enum {string} */
|
|
676
|
+
status: "UNKNOWN" | "AVAILABLE" | "NOT_FOUND" | "UNAUTHORIZED" | "UNREACHABLE";
|
|
677
|
+
owner: string | null;
|
|
678
|
+
repo: string | null;
|
|
679
|
+
defaultBranch: string;
|
|
680
|
+
rootDirectory: string;
|
|
681
|
+
manifestPath: string;
|
|
682
|
+
autoDeployEnabled: boolean;
|
|
683
|
+
productionBranch: string;
|
|
684
|
+
authType: string | null;
|
|
685
|
+
authSecretId: string | null;
|
|
686
|
+
webhookId: string | null;
|
|
687
|
+
lastCommitSha: string | null;
|
|
688
|
+
lastCommitMessage: string | null;
|
|
689
|
+
/** Format: date-time */
|
|
690
|
+
lastCommitAt: string | null;
|
|
691
|
+
/** Format: date-time */
|
|
692
|
+
installedAt: string;
|
|
693
|
+
/** Format: date-time */
|
|
694
|
+
lastSyncedAt: string | null;
|
|
695
|
+
/** Format: date-time */
|
|
696
|
+
lastManifestAt: string | null;
|
|
697
|
+
lastManifest: Record<string, unknown> | null;
|
|
698
|
+
connectorId: string | null;
|
|
699
|
+
connector?: components["schemas"]["GitConnector"];
|
|
700
|
+
gameId: string | null;
|
|
701
|
+
game?: components["schemas"]["Game"];
|
|
702
|
+
creatorId: string | null;
|
|
703
|
+
creator?: components["schemas"]["Users"];
|
|
704
|
+
deployments?: components["schemas"]["Deployment"][];
|
|
705
|
+
spaceId: string | null;
|
|
706
|
+
space?: components["schemas"]["Space"];
|
|
707
|
+
};
|
|
708
|
+
GitConnector: {
|
|
709
|
+
id: string;
|
|
710
|
+
/** Format: date-time */
|
|
711
|
+
createdAt: string;
|
|
712
|
+
/** Format: date-time */
|
|
713
|
+
updatedAt: string;
|
|
714
|
+
/** Format: date-time */
|
|
715
|
+
deletedAt: string | null;
|
|
716
|
+
/** @enum {string} */
|
|
717
|
+
provider: "GITHUB" | "GITLAB" | "BITBUCKET" | "GITEA" | "GENERIC";
|
|
718
|
+
/** @enum {string} */
|
|
719
|
+
status: "UNKNOWN" | "AVAILABLE" | "NOT_FOUND" | "UNAUTHORIZED" | "UNREACHABLE";
|
|
720
|
+
accountLogin: string;
|
|
721
|
+
accountId: string;
|
|
722
|
+
accountAvatarUrl: string | null;
|
|
723
|
+
accountType: string | null;
|
|
724
|
+
installationId: string | null;
|
|
725
|
+
/** Format: date-time */
|
|
726
|
+
tokenExpiresAt: string | null;
|
|
727
|
+
scopes: string | null;
|
|
728
|
+
/** Format: date-time */
|
|
729
|
+
lastSyncedAt: string | null;
|
|
730
|
+
creatorId: string | null;
|
|
731
|
+
creator?: components["schemas"]["Users"];
|
|
732
|
+
gitSources?: components["schemas"]["GitSource"][];
|
|
733
|
+
spaceId: string | null;
|
|
734
|
+
space?: components["schemas"]["Space"];
|
|
735
|
+
};
|
|
736
|
+
CiRunner: {
|
|
737
|
+
id: string;
|
|
738
|
+
/** Format: date-time */
|
|
739
|
+
createdAt: string;
|
|
740
|
+
/** Format: date-time */
|
|
741
|
+
updatedAt: string;
|
|
742
|
+
/** Format: date-time */
|
|
743
|
+
deletedAt: string | null;
|
|
744
|
+
name: string;
|
|
745
|
+
runnerKey: string;
|
|
746
|
+
/** @enum {string} */
|
|
747
|
+
status: "DISCONNECTED" | "CONNECTED" | "BUSY";
|
|
748
|
+
/** Format: date-time */
|
|
749
|
+
lastSeenAt: string | null;
|
|
750
|
+
lastError: string | null;
|
|
751
|
+
hostname: string | null;
|
|
752
|
+
version: string | null;
|
|
753
|
+
creatorId: string | null;
|
|
754
|
+
creator?: components["schemas"]["Users"];
|
|
755
|
+
deployments?: components["schemas"]["Deployment"][];
|
|
756
|
+
};
|
|
757
|
+
Webhook: {
|
|
758
|
+
id: string;
|
|
759
|
+
/** Format: date-time */
|
|
760
|
+
createdAt: string;
|
|
761
|
+
/** Format: date-time */
|
|
762
|
+
updatedAt: string;
|
|
763
|
+
/** Format: date-time */
|
|
764
|
+
deletedAt: string | null;
|
|
765
|
+
spaceId: string;
|
|
766
|
+
space?: components["schemas"]["Space"];
|
|
767
|
+
appId: string | null;
|
|
768
|
+
app?: components["schemas"]["App"];
|
|
769
|
+
creatorId: string | null;
|
|
770
|
+
creator?: components["schemas"]["Users"];
|
|
771
|
+
url: string;
|
|
772
|
+
secret: string | null;
|
|
773
|
+
enabled: boolean;
|
|
774
|
+
/** @enum {string} */
|
|
775
|
+
events: "SESSION_CREATED" | "SESSION_STARTED" | "SESSION_FINISHED" | "SESSION_ABORTED" | "SCORE_UPDATED" | "CUSTOM";
|
|
776
|
+
headers: Record<string, unknown> | null;
|
|
777
|
+
/** Format: date-time */
|
|
778
|
+
lastDeliveryAt: string | null;
|
|
779
|
+
/** Format: int32 */
|
|
780
|
+
lastStatus: number | null;
|
|
781
|
+
deliveries?: components["schemas"]["WebhookDelivery"][];
|
|
782
|
+
};
|
|
783
|
+
WebhookDelivery: {
|
|
784
|
+
id: string;
|
|
785
|
+
/** Format: date-time */
|
|
786
|
+
createdAt: string;
|
|
787
|
+
/** Format: date-time */
|
|
788
|
+
updatedAt: string;
|
|
789
|
+
/** Format: date-time */
|
|
790
|
+
deletedAt: string | null;
|
|
791
|
+
spaceId: string;
|
|
792
|
+
space?: components["schemas"]["Space"];
|
|
793
|
+
webhookId: string;
|
|
794
|
+
webhook?: components["schemas"]["Webhook"];
|
|
795
|
+
/** @enum {string} */
|
|
796
|
+
event: "SESSION_CREATED" | "SESSION_STARTED" | "SESSION_FINISHED" | "SESSION_ABORTED" | "SCORE_UPDATED" | "CUSTOM";
|
|
797
|
+
/** @enum {string} */
|
|
798
|
+
status: "PENDING" | "SUCCESS" | "FAILED";
|
|
799
|
+
payload: Record<string, unknown>;
|
|
800
|
+
/** Format: int32 */
|
|
801
|
+
attempts: number;
|
|
802
|
+
/** Format: int32 */
|
|
803
|
+
maxAttempts: number;
|
|
804
|
+
/** Format: date-time */
|
|
805
|
+
nextAttemptAt: string | null;
|
|
806
|
+
/** Format: date-time */
|
|
807
|
+
deliveredAt: string | null;
|
|
808
|
+
/** Format: int32 */
|
|
809
|
+
statusCode: number | null;
|
|
810
|
+
/** Format: int32 */
|
|
811
|
+
durationMs: number | null;
|
|
812
|
+
error: string | null;
|
|
813
|
+
responseBody: string | null;
|
|
814
|
+
};
|
|
815
|
+
PagedGameInstance: {
|
|
816
|
+
/** @description Page info */
|
|
817
|
+
pageInfo: components["schemas"]["PageInfo"];
|
|
818
|
+
/** @description Array of resource items for the current page */
|
|
819
|
+
data: components["schemas"]["AppGameInstance"][];
|
|
820
|
+
};
|
|
821
|
+
PageInfo: {
|
|
822
|
+
/**
|
|
823
|
+
* @description Cursor for the next page (cursor-based pagination)
|
|
824
|
+
* @example eyJpZCI6IjEyMyJ9
|
|
825
|
+
*/
|
|
826
|
+
endCursor?: string;
|
|
827
|
+
/**
|
|
828
|
+
* @description Current page number (offset-based pagination)
|
|
829
|
+
* @example 1
|
|
830
|
+
*/
|
|
831
|
+
page?: number;
|
|
832
|
+
/**
|
|
833
|
+
* @description Number of items per page
|
|
834
|
+
* @example 20
|
|
835
|
+
*/
|
|
836
|
+
limit: number;
|
|
837
|
+
/**
|
|
838
|
+
* @description Total number of items across all pages
|
|
839
|
+
* @example 145
|
|
840
|
+
*/
|
|
841
|
+
total?: number;
|
|
842
|
+
/**
|
|
843
|
+
* @description Total number of pages
|
|
844
|
+
* @example 8
|
|
845
|
+
*/
|
|
846
|
+
totalPages?: number;
|
|
847
|
+
/**
|
|
848
|
+
* @description Whether there is a next page
|
|
849
|
+
* @example true
|
|
850
|
+
*/
|
|
851
|
+
hasNextPage: boolean;
|
|
852
|
+
/**
|
|
853
|
+
* @description Whether there is a previous page
|
|
854
|
+
* @example false
|
|
855
|
+
*/
|
|
856
|
+
hasPreviousPage: boolean;
|
|
857
|
+
};
|
|
858
|
+
IdentifyPlayerDto: {
|
|
859
|
+
identity?: string;
|
|
860
|
+
/** @enum {string} */
|
|
861
|
+
type?: "ANONYMOUS" | "IDENTIFIED";
|
|
862
|
+
externalId?: string;
|
|
863
|
+
displayName?: string;
|
|
864
|
+
avatarUrl?: string;
|
|
865
|
+
metadata?: Record<string, unknown>;
|
|
866
|
+
};
|
|
867
|
+
UpdatePlayerDto: {
|
|
868
|
+
externalId?: string;
|
|
869
|
+
displayName?: string;
|
|
870
|
+
avatarUrl?: string;
|
|
871
|
+
metadata?: Record<string, unknown>;
|
|
872
|
+
};
|
|
873
|
+
CreatePlaySessionDto: {
|
|
874
|
+
playerId: string;
|
|
875
|
+
gameInstanceId: string;
|
|
876
|
+
metadata?: Record<string, unknown>;
|
|
877
|
+
/**
|
|
878
|
+
* Format: date-time
|
|
879
|
+
* @description Session lifetime deadline (ISO 8601). Defaults to the server TTL.
|
|
880
|
+
*/
|
|
881
|
+
expiresAt?: string;
|
|
882
|
+
};
|
|
883
|
+
UpdatePlaySessionDto: {
|
|
884
|
+
/**
|
|
885
|
+
* @description Only transitions allowed by the session lifecycle are accepted
|
|
886
|
+
* @enum {string}
|
|
887
|
+
*/
|
|
888
|
+
status?: "CREATED" | "READY" | "PLAYING" | "PAUSED" | "FINISHED" | "ABORTED" | "EXPIRED";
|
|
889
|
+
score?: number;
|
|
890
|
+
result?: Record<string, unknown>;
|
|
891
|
+
metadata?: Record<string, unknown>;
|
|
892
|
+
};
|
|
893
|
+
UpdateScoreDto: {
|
|
894
|
+
score: number;
|
|
895
|
+
result?: Record<string, unknown>;
|
|
896
|
+
};
|
|
897
|
+
CreateRuntimeSessionDto: {
|
|
898
|
+
gameInstanceId: string;
|
|
899
|
+
playerToken: string;
|
|
900
|
+
};
|
|
901
|
+
RuntimeEmitDto: {
|
|
902
|
+
/** @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`. */
|
|
903
|
+
type: string;
|
|
904
|
+
payload?: Record<string, unknown>;
|
|
905
|
+
};
|
|
906
|
+
RuntimeSnapshotDto: {
|
|
907
|
+
state: Record<string, unknown>;
|
|
908
|
+
};
|
|
909
|
+
};
|
|
910
|
+
responses: {
|
|
911
|
+
/** @description Unauthorized access */
|
|
912
|
+
Unauthorized: {
|
|
913
|
+
content: {
|
|
914
|
+
"application/json": {
|
|
915
|
+
/** @example 401 */
|
|
916
|
+
statusCode?: number;
|
|
917
|
+
/** @example Unauthorized */
|
|
918
|
+
message?: string;
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
};
|
|
922
|
+
/** @description Forbidden */
|
|
923
|
+
Forbidden: {
|
|
924
|
+
content: {
|
|
925
|
+
"application/json": {
|
|
926
|
+
/** @example 403 */
|
|
927
|
+
statusCode?: number;
|
|
928
|
+
/** @example Forbidden */
|
|
929
|
+
message?: string;
|
|
930
|
+
};
|
|
931
|
+
};
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
parameters: never;
|
|
935
|
+
requestBodies: never;
|
|
936
|
+
headers: never;
|
|
937
|
+
pathItems: never;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
type operations = Record<string, never>;
|
|
941
|
+
|
|
942
|
+
/** Header names the server reads app credentials from (`apps/server/src/auth/auth.guard.ts`). */
|
|
943
|
+
declare const APP_KEY_HEADER = "x-app-key";
|
|
944
|
+
declare const APP_SECRET_HEADER = "x-app-secret";
|
|
945
|
+
type InitOptions = {
|
|
946
|
+
/** Base URL of the API, without a trailing slash. */
|
|
947
|
+
apiUrl: string;
|
|
948
|
+
/** Sent as `x-app-key`: the app's `id`, which the auth guard looks the app up by. */
|
|
949
|
+
appKey?: string;
|
|
950
|
+
/** Sent as `x-app-secret`: one of the app's credential `clientSecret` values. */
|
|
951
|
+
appSecret?: string;
|
|
952
|
+
/** Abort a request after this many milliseconds. `0` or unset means no timeout. */
|
|
953
|
+
timeoutMs?: number;
|
|
954
|
+
/** Override the fetch implementation, for a Node polyfill or a test. */
|
|
955
|
+
fetch?: typeof globalThis.fetch;
|
|
956
|
+
};
|
|
957
|
+
/** Thrown when a request is made before any credentials were configured. */
|
|
958
|
+
declare class SdkNotInitializedError extends Error {
|
|
959
|
+
constructor();
|
|
960
|
+
}
|
|
961
|
+
declare class SdkConfigError extends Error {
|
|
962
|
+
constructor(message: string);
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* A client with its own base URL and credentials. Use this when a process serves
|
|
966
|
+
* more than one app: each client is independent, so one tenant's configuration
|
|
967
|
+
* cannot overwrite another's.
|
|
968
|
+
*/
|
|
969
|
+
declare function createSdkClient(options: InitOptions): Client<paths>;
|
|
970
|
+
/**
|
|
971
|
+
* Process-wide client configured by `initializeSDK` or `<SDKInitializer>`.
|
|
972
|
+
*
|
|
973
|
+
* Before the first initialization every access throws `SdkNotInitializedError`,
|
|
974
|
+
* so a mis-ordered import fails where it happens instead of sending a request to
|
|
975
|
+
* a placeholder origin.
|
|
976
|
+
*/
|
|
977
|
+
declare const fetchClient: Client<paths>;
|
|
978
|
+
/** Configure the process-wide client and return it. */
|
|
979
|
+
declare function initializeSDK(options: InitOptions): Client<paths>;
|
|
980
|
+
|
|
981
|
+
export { APP_KEY_HEADER, APP_SECRET_HEADER, type InitOptions, SdkConfigError, SdkNotInitializedError, type components, createSdkClient, fetchClient, initializeSDK, type operations, type paths };
|