@dreamboard-games/api-client 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.
Files changed (87) hide show
  1. package/LICENSE +89 -0
  2. package/NOTICE +1 -0
  3. package/dist/@tanstack/react-query.gen.d.ts +1037 -0
  4. package/dist/@tanstack/react-query.gen.d.ts.map +1 -0
  5. package/dist/@tanstack/react-query.gen.js +1016 -0
  6. package/dist/client/client.gen.d.ts +3 -0
  7. package/dist/client/client.gen.d.ts.map +1 -0
  8. package/dist/client/client.gen.js +235 -0
  9. package/dist/client/index.d.ts +9 -0
  10. package/dist/client/index.d.ts.map +1 -0
  11. package/dist/client/index.js +6 -0
  12. package/dist/client/types.gen.d.ts +118 -0
  13. package/dist/client/types.gen.d.ts.map +1 -0
  14. package/dist/client/types.gen.js +2 -0
  15. package/dist/client/utils.gen.d.ts +34 -0
  16. package/dist/client/utils.gen.d.ts.map +1 -0
  17. package/dist/client/utils.gen.js +233 -0
  18. package/dist/client.gen.d.ts +13 -0
  19. package/dist/client.gen.d.ts.map +1 -0
  20. package/dist/client.gen.js +3 -0
  21. package/dist/core/auth.gen.d.ts +19 -0
  22. package/dist/core/auth.gen.d.ts.map +1 -0
  23. package/dist/core/auth.gen.js +14 -0
  24. package/dist/core/bodySerializer.gen.d.ts +26 -0
  25. package/dist/core/bodySerializer.gen.d.ts.map +1 -0
  26. package/dist/core/bodySerializer.gen.js +57 -0
  27. package/dist/core/params.gen.d.ts +44 -0
  28. package/dist/core/params.gen.d.ts.map +1 -0
  29. package/dist/core/params.gen.js +100 -0
  30. package/dist/core/pathSerializer.gen.d.ts +34 -0
  31. package/dist/core/pathSerializer.gen.d.ts.map +1 -0
  32. package/dist/core/pathSerializer.gen.js +114 -0
  33. package/dist/core/queryKeySerializer.gen.d.ts +19 -0
  34. package/dist/core/queryKeySerializer.gen.d.ts.map +1 -0
  35. package/dist/core/queryKeySerializer.gen.js +99 -0
  36. package/dist/core/serverSentEvents.gen.d.ts +72 -0
  37. package/dist/core/serverSentEvents.gen.d.ts.map +1 -0
  38. package/dist/core/serverSentEvents.gen.js +136 -0
  39. package/dist/core/types.gen.d.ts +79 -0
  40. package/dist/core/types.gen.d.ts.map +1 -0
  41. package/dist/core/types.gen.js +2 -0
  42. package/dist/core/utils.gen.d.ts +20 -0
  43. package/dist/core/utils.gen.d.ts.map +1 -0
  44. package/dist/core/utils.gen.js +87 -0
  45. package/dist/generated/problem-types.gen.d.ts +26 -0
  46. package/dist/generated/problem-types.gen.d.ts.map +1 -0
  47. package/dist/generated/problem-types.gen.js +23 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +4 -0
  51. package/dist/sdk.gen.d.ts +364 -0
  52. package/dist/sdk.gen.d.ts.map +1 -0
  53. package/dist/sdk.gen.js +634 -0
  54. package/dist/source-revisions.d.ts +27 -0
  55. package/dist/source-revisions.d.ts.map +1 -0
  56. package/dist/source-revisions.js +174 -0
  57. package/dist/storage-paths.d.ts +17 -0
  58. package/dist/storage-paths.d.ts.map +1 -0
  59. package/dist/storage-paths.js +16 -0
  60. package/dist/types.gen.d.ts +5007 -0
  61. package/dist/types.gen.d.ts.map +1 -0
  62. package/dist/types.gen.js +2 -0
  63. package/dist/zod.gen.d.ts +37398 -0
  64. package/dist/zod.gen.d.ts.map +1 -0
  65. package/dist/zod.gen.js +2396 -0
  66. package/package.json +105 -0
  67. package/src/@tanstack/react-query.gen.ts +1114 -0
  68. package/src/client/client.gen.ts +311 -0
  69. package/src/client/index.ts +25 -0
  70. package/src/client/types.gen.ts +241 -0
  71. package/src/client/utils.gen.ts +332 -0
  72. package/src/client.gen.ts +16 -0
  73. package/src/core/auth.gen.ts +42 -0
  74. package/src/core/bodySerializer.gen.ts +100 -0
  75. package/src/core/params.gen.ts +176 -0
  76. package/src/core/pathSerializer.gen.ts +181 -0
  77. package/src/core/queryKeySerializer.gen.ts +136 -0
  78. package/src/core/serverSentEvents.gen.ts +265 -0
  79. package/src/core/types.gen.ts +118 -0
  80. package/src/core/utils.gen.ts +143 -0
  81. package/src/generated/problem-types.gen.ts +35 -0
  82. package/src/index.ts +7 -0
  83. package/src/sdk.gen.ts +709 -0
  84. package/src/source-revisions.ts +283 -0
  85. package/src/storage-paths.ts +19 -0
  86. package/src/types.gen.ts +5486 -0
  87. package/src/zod.gen.ts +2705 -0
package/src/sdk.gen.ts ADDED
@@ -0,0 +1,709 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { Client, Options as Options2, TDataShape } from './client/index.js';
4
+ import { client } from './client.gen.js';
5
+ import type { AddSeatData, AddSeatErrors, AddSeatResponses, AssignSeatData, AssignSeatErrors, AssignSeatResponses, CancelGameRunData, CancelGameRunErrors, CancelGameRunResponses, CreateAuthoringStateData, CreateAuthoringStateErrors, CreateAuthoringStateResponses, CreateDemoGameSessionData, CreateDemoGameSessionErrors, CreateDemoGameSessionResponses, CreateGameData, CreateGameErrors, CreateGameResponses, CreateGameRuleData, CreateGameRuleErrors, CreateGameRuleResponses, CreateGameRunData, CreateGameRunErrors, CreateGameRunResponses, CreateSessionData, CreateSessionErrors, CreateSessionFromReducerSnapshotData, CreateSessionFromReducerSnapshotErrors, CreateSessionFromReducerSnapshotResponses, CreateSessionResponses, CreateSourceBlobUploadSessionData, CreateSourceBlobUploadSessionErrors, CreateSourceBlobUploadSessionResponses, CreateSourceRevisionData, CreateSourceRevisionErrors, CreateSourceRevisionResponses, DeleteGameData, DeleteGameErrors, DeleteGameResponses, DescribePlayerActionData, DescribePlayerActionErrors, DescribePlayerActionResponses, DisconnectSessionEventsData, DisconnectSessionEventsErrors, DisconnectSessionEventsResponses, DownloadGameSourcesData, DownloadGameSourcesErrors, DownloadGameSourcesResponses, EnsureDevCompileData, EnsureDevCompileErrors, EnsureDevCompileResponses, ExtractGameSpecData, ExtractGameSpecErrors, ExtractGameSpecResponses, FetchUiBundleData, FetchUiBundleErrors, FetchUiBundleResponses, FindManifestsData, FindManifestsErrors, FindManifestsResponses, GetActiveJobData, GetActiveJobErrors, GetActiveJobResponses, GetApiVersionData, GetApiVersionResponses, GetAuthoringHeadData, GetAuthoringHeadErrors, GetAuthoringHeadResponses, GetCompiledResultData, GetCompiledResultErrors, GetCompiledResultResponses, GetDemoGameData, GetDemoGameErrors, GetDemoGameResponses, GetDemoGameThumbnailData, GetDemoGameThumbnailErrors, GetDemoGameThumbnailResponses, GetGameBySlugData, GetGameBySlugErrors, GetGameBySlugResponses, GetGameData, GetGameErrors, GetGameResponses, GetGameRuleData, GetGameRuleErrors, GetGameRuleResponses, GetGameScriptsData, GetGameScriptsErrors, GetGameScriptsResponses, GetGameSourcesData, GetGameSourcesErrors, GetGameSourcesResponses, GetJobData, GetJobErrors, GetJobResponses, GetLatestCompiledResultData, GetLatestCompiledResultErrors, GetLatestCompiledResultResponses, GetLatestGameRuleData, GetLatestGameRuleErrors, GetLatestGameRuleResponses, GetManifestData, GetManifestErrors, GetManifestResponses, GetPlayerActionTargetsData, GetPlayerActionTargetsErrors, GetPlayerActionTargetsResponses, GetSessionByShortCodeData, GetSessionByShortCodeErrors, GetSessionByShortCodeResponses, GetSessionSnapshotData, GetSessionSnapshotErrors, GetSessionSnapshotResponses, HealthCheckData, HealthCheckResponses, ListCompiledResultsData, ListCompiledResultsErrors, ListCompiledResultsResponses, ListDemoGamesData, ListDemoGamesErrors, ListDemoGamesResponses, ListGameRulesData, ListGameRulesErrors, ListGameRulesResponses, ListGamesData, ListGamesErrors, ListGamesResponses, ListPlayerActionsData, ListPlayerActionsErrors, ListPlayerActionsResponses, QueryWorkshopRulebookData, QueryWorkshopRulebookErrors, QueryWorkshopRulebookResponses, QueueCompiledResultJobData, QueueCompiledResultJobErrors, QueueCompiledResultJobResponses, RemoveSeatData, RemoveSeatErrors, RemoveSeatResponses, RestoreHistoryData, RestoreHistoryErrors, RestoreHistoryResponses, SaveManifestData, SaveManifestErrors, SaveManifestResponses, StartGameData, StartGameErrors, StartGameResponses, SubmitPlayerActionData, SubmitPlayerActionErrors, SubmitPlayerActionResponses, SubscribeToGameLogsData, SubscribeToGameLogsErrors, SubscribeToGameLogsResponses, SubscribeToJobEventsData, SubscribeToJobEventsErrors, SubscribeToJobEventsResponses, SubscribeToSessionEventsData, SubscribeToSessionEventsErrors, SubscribeToSessionEventsResponses, UnassignSeatData, UnassignSeatErrors, UnassignSeatResponses, UpdateGameData, UpdateGameErrors, UpdateGameResponses, UpdateSeatData, UpdateSeatErrors, UpdateSeatResponses, ValidatePlayerActionData, ValidatePlayerActionErrors, ValidatePlayerActionResponses } from './types.gen.js';
6
+
7
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
8
+ /**
9
+ * You can provide a client instance returned by `createClient()` instead of
10
+ * individual options. This might be also useful if you want to implement a
11
+ * custom client.
12
+ */
13
+ client?: Client;
14
+ /**
15
+ * You can pass arbitrary values through the `meta` object. This can be
16
+ * used to access values that aren't defined as part of the SDK function.
17
+ */
18
+ meta?: Record<string, unknown>;
19
+ };
20
+
21
+ /**
22
+ * Health check endpoint
23
+ *
24
+ * Returns a simple health check message
25
+ */
26
+ export const healthCheck = <ThrowOnError extends boolean = false>(options?: Options<HealthCheckData, ThrowOnError>) => (options?.client ?? client).get<HealthCheckResponses, unknown, ThrowOnError>({
27
+ security: [{ scheme: 'bearer', type: 'http' }],
28
+ url: '/',
29
+ ...options
30
+ });
31
+
32
+ /**
33
+ * Get backend version metadata
34
+ *
35
+ * Returns backend revision metadata and the UI SDK version expected by the backend runtime.
36
+ */
37
+ export const getApiVersion = <ThrowOnError extends boolean = false>(options?: Options<GetApiVersionData, ThrowOnError>) => (options?.client ?? client).get<GetApiVersionResponses, unknown, ThrowOnError>({
38
+ security: [{ scheme: 'bearer', type: 'http' }],
39
+ url: '/api/version',
40
+ ...options
41
+ });
42
+
43
+ /**
44
+ * List user's games
45
+ *
46
+ * Retrieve a list of all games owned by the authenticated user
47
+ */
48
+ export const listGames = <ThrowOnError extends boolean = false>(options?: Options<ListGamesData, ThrowOnError>) => (options?.client ?? client).get<ListGamesResponses, ListGamesErrors, ThrowOnError>({
49
+ security: [{ scheme: 'bearer', type: 'http' }],
50
+ url: '/api/games',
51
+ ...options
52
+ });
53
+
54
+ /**
55
+ * Create a new game
56
+ *
57
+ * Create a new game definition
58
+ */
59
+ export const createGame = <ThrowOnError extends boolean = false>(options: Options<CreateGameData, ThrowOnError>) => (options.client ?? client).post<CreateGameResponses, CreateGameErrors, ThrowOnError>({
60
+ security: [{ scheme: 'bearer', type: 'http' }],
61
+ url: '/api/games',
62
+ ...options,
63
+ headers: {
64
+ 'Content-Type': 'application/json',
65
+ ...options.headers
66
+ }
67
+ });
68
+
69
+ /**
70
+ * Extract a structured game spec
71
+ *
72
+ * Extract a normalized structured game spec from pasted rule text.
73
+ */
74
+ export const extractGameSpec = <ThrowOnError extends boolean = false>(options: Options<ExtractGameSpecData, ThrowOnError>) => (options.client ?? client).post<ExtractGameSpecResponses, ExtractGameSpecErrors, ThrowOnError>({
75
+ security: [{ scheme: 'bearer', type: 'http' }],
76
+ url: '/api/games/extract-spec',
77
+ ...options,
78
+ headers: {
79
+ 'Content-Type': 'application/json',
80
+ ...options.headers
81
+ }
82
+ });
83
+
84
+ /**
85
+ * Delete game
86
+ *
87
+ * Delete a game definition permanently
88
+ */
89
+ export const deleteGame = <ThrowOnError extends boolean = false>(options: Options<DeleteGameData, ThrowOnError>) => (options.client ?? client).delete<DeleteGameResponses, DeleteGameErrors, ThrowOnError>({
90
+ security: [{ scheme: 'bearer', type: 'http' }],
91
+ url: '/api/games/{gameId}',
92
+ ...options
93
+ });
94
+
95
+ /**
96
+ * Get game by ID
97
+ *
98
+ * Retrieve a specific game definition by its ID
99
+ */
100
+ export const getGame = <ThrowOnError extends boolean = false>(options: Options<GetGameData, ThrowOnError>) => (options.client ?? client).get<GetGameResponses, GetGameErrors, ThrowOnError>({
101
+ security: [{ scheme: 'bearer', type: 'http' }],
102
+ url: '/api/games/{gameId}',
103
+ ...options
104
+ });
105
+
106
+ /**
107
+ * Update game
108
+ *
109
+ * Update an existing game definition
110
+ */
111
+ export const updateGame = <ThrowOnError extends boolean = false>(options: Options<UpdateGameData, ThrowOnError>) => (options.client ?? client).put<UpdateGameResponses, UpdateGameErrors, ThrowOnError>({
112
+ security: [{ scheme: 'bearer', type: 'http' }],
113
+ url: '/api/games/{gameId}',
114
+ ...options,
115
+ headers: {
116
+ 'Content-Type': 'application/json',
117
+ ...options.headers
118
+ }
119
+ });
120
+
121
+ /**
122
+ * Get game by slug
123
+ *
124
+ * Retrieve a specific game definition by its slug
125
+ */
126
+ export const getGameBySlug = <ThrowOnError extends boolean = false>(options: Options<GetGameBySlugData, ThrowOnError>) => (options.client ?? client).get<GetGameBySlugResponses, GetGameBySlugErrors, ThrowOnError>({
127
+ security: [{ scheme: 'bearer', type: 'http' }],
128
+ url: '/api/games/slug/{slug}',
129
+ ...options
130
+ });
131
+
132
+ /**
133
+ * Query rulebook text by title
134
+ *
135
+ * Search ranked rulebook candidates for the provided title, try up to the top 3 matches, and return extracted text from the first valid PDF found.
136
+ */
137
+ export const queryWorkshopRulebook = <ThrowOnError extends boolean = false>(options: Options<QueryWorkshopRulebookData, ThrowOnError>) => (options.client ?? client).get<QueryWorkshopRulebookResponses, QueryWorkshopRulebookErrors, ThrowOnError>({
138
+ security: [{ scheme: 'bearer', type: 'http' }],
139
+ url: '/api/workshop/query',
140
+ ...options
141
+ });
142
+
143
+ /**
144
+ * Find manifests for game
145
+ *
146
+ * Retrieve a list of manifest versions for a game, ordered by version descending (newest first)
147
+ */
148
+ export const findManifests = <ThrowOnError extends boolean = false>(options: Options<FindManifestsData, ThrowOnError>) => (options.client ?? client).get<FindManifestsResponses, FindManifestsErrors, ThrowOnError>({
149
+ security: [{ scheme: 'bearer', type: 'http' }],
150
+ url: '/api/games/{gameId}/manifests',
151
+ ...options
152
+ });
153
+
154
+ /**
155
+ * Save game manifest
156
+ *
157
+ * Create a new versioned manifest for a game. Each save creates a new version with automatic version numbering.
158
+ */
159
+ export const saveManifest = <ThrowOnError extends boolean = false>(options: Options<SaveManifestData, ThrowOnError>) => (options.client ?? client).post<SaveManifestResponses, SaveManifestErrors, ThrowOnError>({
160
+ security: [{ scheme: 'bearer', type: 'http' }],
161
+ url: '/api/games/{gameId}/manifests',
162
+ ...options,
163
+ headers: {
164
+ 'Content-Type': 'application/json',
165
+ ...options.headers
166
+ }
167
+ });
168
+
169
+ /**
170
+ * Get manifest by ID
171
+ *
172
+ * Retrieve a specific manifest version by its ID with full board manifest details
173
+ */
174
+ export const getManifest = <ThrowOnError extends boolean = false>(options: Options<GetManifestData, ThrowOnError>) => (options.client ?? client).get<GetManifestResponses, GetManifestErrors, ThrowOnError>({
175
+ security: [{ scheme: 'bearer', type: 'http' }],
176
+ url: '/api/manifests/{manifestId}',
177
+ ...options
178
+ });
179
+
180
+ /**
181
+ * Get latest compiled result for a game
182
+ *
183
+ * Return the most recent compiled result for the specified game.
184
+ */
185
+ export const getLatestCompiledResult = <ThrowOnError extends boolean = false>(options: Options<GetLatestCompiledResultData, ThrowOnError>) => (options.client ?? client).get<GetLatestCompiledResultResponses, GetLatestCompiledResultErrors, ThrowOnError>({
186
+ security: [{ scheme: 'bearer', type: 'http' }],
187
+ url: '/api/games/{gameId}/compiled-results/latest',
188
+ ...options
189
+ });
190
+
191
+ /**
192
+ * List compiled results for a game
193
+ *
194
+ * Retrieve a list of compiled results for a game, ordered by creation date descending (newest first). Includes both successful and failed compilations.
195
+ */
196
+ export const listCompiledResults = <ThrowOnError extends boolean = false>(options: Options<ListCompiledResultsData, ThrowOnError>) => (options.client ?? client).get<ListCompiledResultsResponses, ListCompiledResultsErrors, ThrowOnError>({
197
+ security: [{ scheme: 'bearer', type: 'http' }],
198
+ url: '/api/games/{gameId}/compiled-results',
199
+ ...options
200
+ });
201
+
202
+ /**
203
+ * Queue a compile job for an authoring state
204
+ *
205
+ * Queue an asynchronous compile for a specific authoring state. Poll `/api/jobs/{jobId}` and fetch the final compiled result by ID when the job completes.
206
+ */
207
+ export const queueCompiledResultJob = <ThrowOnError extends boolean = false>(options: Options<QueueCompiledResultJobData, ThrowOnError>) => (options.client ?? client).post<QueueCompiledResultJobResponses, QueueCompiledResultJobErrors, ThrowOnError>({
208
+ security: [{ scheme: 'bearer', type: 'http' }],
209
+ url: '/api/games/{gameId}/compiled-results',
210
+ ...options,
211
+ headers: {
212
+ 'Content-Type': 'application/json',
213
+ ...options.headers
214
+ }
215
+ });
216
+
217
+ /**
218
+ * Ensure a private dev compile exists
219
+ *
220
+ * Reuse or create a session-scoped dev compilation for the provided workspace fingerprint without advancing the canonical authored head.
221
+ */
222
+ export const ensureDevCompile = <ThrowOnError extends boolean = false>(options: Options<EnsureDevCompileData, ThrowOnError>) => (options.client ?? client).post<EnsureDevCompileResponses, EnsureDevCompileErrors, ThrowOnError>({
223
+ security: [{ scheme: 'bearer', type: 'http' }],
224
+ url: '/api/games/{gameId}/dev-compiles/ensure',
225
+ ...options,
226
+ headers: {
227
+ 'Content-Type': 'application/json',
228
+ ...options.headers
229
+ }
230
+ });
231
+
232
+ /**
233
+ * Get compiled result by ID
234
+ *
235
+ * Fetch a specific compiled result for a game, including failed results and diagnostics.
236
+ */
237
+ export const getCompiledResult = <ThrowOnError extends boolean = false>(options: Options<GetCompiledResultData, ThrowOnError>) => (options.client ?? client).get<GetCompiledResultResponses, GetCompiledResultErrors, ThrowOnError>({
238
+ security: [{ scheme: 'bearer', type: 'http' }],
239
+ url: '/api/games/{gameId}/compiled-results/{compiledResultId}',
240
+ ...options
241
+ });
242
+
243
+ /**
244
+ * Download authored game source files
245
+ *
246
+ * Download the authored source files for the current authoring head as a ZIP archive.
247
+ */
248
+ export const downloadGameSources = <ThrowOnError extends boolean = false>(options: Options<DownloadGameSourcesData, ThrowOnError>) => (options.client ?? client).get<DownloadGameSourcesResponses, DownloadGameSourcesErrors, ThrowOnError>({
249
+ security: [{ scheme: 'bearer', type: 'http' }],
250
+ url: '/api/games/{gameId}/download',
251
+ ...options
252
+ });
253
+
254
+ /**
255
+ * Get authored game source files
256
+ *
257
+ * Retrieve authored source files as JSON for the selected authoring state. If no authoring state is provided, the current authoring head is used.
258
+ */
259
+ export const getGameSources = <ThrowOnError extends boolean = false>(options: Options<GetGameSourcesData, ThrowOnError>) => (options.client ?? client).get<GetGameSourcesResponses, GetGameSourcesErrors, ThrowOnError>({
260
+ security: [{ scheme: 'bearer', type: 'http' }],
261
+ url: '/api/games/{gameId}/sources',
262
+ ...options
263
+ });
264
+
265
+ /**
266
+ * Create a source revision for a game
267
+ *
268
+ * Create a new authored source revision from a hash-addressed change set. The request must be based on the current head revision for the game.
269
+ */
270
+ export const createSourceRevision = <ThrowOnError extends boolean = false>(options: Options<CreateSourceRevisionData, ThrowOnError>) => (options.client ?? client).post<CreateSourceRevisionResponses, CreateSourceRevisionErrors, ThrowOnError>({
271
+ security: [{ scheme: 'bearer', type: 'http' }],
272
+ url: '/api/games/{gameId}/source-revisions',
273
+ ...options,
274
+ headers: {
275
+ 'Content-Type': 'application/json',
276
+ ...options.headers
277
+ }
278
+ });
279
+
280
+ /**
281
+ * Create direct-upload targets for source blobs
282
+ *
283
+ * Create a direct-upload session for one or more source blobs referenced by a forthcoming source revision.
284
+ */
285
+ export const createSourceBlobUploadSession = <ThrowOnError extends boolean = false>(options: Options<CreateSourceBlobUploadSessionData, ThrowOnError>) => (options.client ?? client).post<CreateSourceBlobUploadSessionResponses, CreateSourceBlobUploadSessionErrors, ThrowOnError>({
286
+ security: [{ scheme: 'bearer', type: 'http' }],
287
+ url: '/api/games/{gameId}/source-blobs/upload-sessions',
288
+ ...options,
289
+ headers: {
290
+ 'Content-Type': 'application/json',
291
+ ...options.headers
292
+ }
293
+ });
294
+
295
+ /**
296
+ * Get current authoring head for a game
297
+ *
298
+ * Retrieve the current remote authoring head for the specified game.
299
+ */
300
+ export const getAuthoringHead = <ThrowOnError extends boolean = false>(options: Options<GetAuthoringHeadData, ThrowOnError>) => (options.client ?? client).get<GetAuthoringHeadResponses, GetAuthoringHeadErrors, ThrowOnError>({
301
+ security: [{ scheme: 'bearer', type: 'http' }],
302
+ url: '/api/games/{gameId}/authoring/head',
303
+ ...options
304
+ });
305
+
306
+ /**
307
+ * Advance the authoring head for a game
308
+ *
309
+ * Create a new immutable authoring state and make it the current authoring head for the specified game.
310
+ */
311
+ export const createAuthoringState = <ThrowOnError extends boolean = false>(options: Options<CreateAuthoringStateData, ThrowOnError>) => (options.client ?? client).post<CreateAuthoringStateResponses, CreateAuthoringStateErrors, ThrowOnError>({
312
+ security: [{ scheme: 'bearer', type: 'http' }],
313
+ url: '/api/games/{gameId}/authoring/states',
314
+ ...options,
315
+ headers: {
316
+ 'Content-Type': 'application/json',
317
+ ...options.headers
318
+ }
319
+ });
320
+
321
+ /**
322
+ * Get game scripts
323
+ *
324
+ * Retrieve all compiled app and UI scripts for a specific manifest
325
+ */
326
+ export const getGameScripts = <ThrowOnError extends boolean = false>(options: Options<GetGameScriptsData, ThrowOnError>) => (options.client ?? client).get<GetGameScriptsResponses, GetGameScriptsErrors, ThrowOnError>({
327
+ security: [{ scheme: 'bearer', type: 'http' }],
328
+ url: '/api/games/{gameId}/scripts',
329
+ ...options
330
+ });
331
+
332
+ /**
333
+ * Get active job for a game
334
+ *
335
+ * Returns the currently active (PENDING or RUNNING) job for a game, if any. Jobs older than 15 minutes are considered stale and ignored.
336
+ */
337
+ export const getActiveJob = <ThrowOnError extends boolean = false>(options: Options<GetActiveJobData, ThrowOnError>) => (options.client ?? client).get<GetActiveJobResponses, GetActiveJobErrors, ThrowOnError>({
338
+ security: [{ scheme: 'bearer', type: 'http' }],
339
+ url: '/api/games/{gameId}/jobs/active',
340
+ ...options
341
+ });
342
+
343
+ /**
344
+ * Get job details
345
+ *
346
+ * Fetch details for a specific async job, including ordered user-facing tasks.
347
+ */
348
+ export const getJob = <ThrowOnError extends boolean = false>(options: Options<GetJobData, ThrowOnError>) => (options.client ?? client).get<GetJobResponses, GetJobErrors, ThrowOnError>({
349
+ security: [{ scheme: 'bearer', type: 'http' }],
350
+ url: '/api/jobs/{jobId}',
351
+ ...options
352
+ });
353
+
354
+ /**
355
+ * Subscribe to job details (SSE)
356
+ *
357
+ * Server-Sent Events stream for curated job snapshots. Every connection starts with a `job.snapshot` event.
358
+ */
359
+ export const subscribeToJobEvents = <ThrowOnError extends boolean = false>(options: Options<SubscribeToJobEventsData, ThrowOnError>) => (options.client ?? client).sse.get<SubscribeToJobEventsResponses, SubscribeToJobEventsErrors, ThrowOnError>({
360
+ security: [{ scheme: 'bearer', type: 'http' }],
361
+ url: '/api/jobs/{jobId}/events',
362
+ ...options
363
+ });
364
+
365
+ /**
366
+ * Create a game build run
367
+ *
368
+ * Create a new game draft build job from a structured game spec.
369
+ */
370
+ export const createGameRun = <ThrowOnError extends boolean = false>(options: Options<CreateGameRunData, ThrowOnError>) => (options.client ?? client).post<CreateGameRunResponses, CreateGameRunErrors, ThrowOnError>({
371
+ security: [{ scheme: 'bearer', type: 'http' }],
372
+ url: '/api/runs',
373
+ ...options,
374
+ headers: {
375
+ 'Content-Type': 'application/json',
376
+ ...options.headers
377
+ }
378
+ });
379
+
380
+ /**
381
+ * Cancel a game build run
382
+ *
383
+ * Request cancellation of an active game draft build job.
384
+ */
385
+ export const cancelGameRun = <ThrowOnError extends boolean = false>(options: Options<CancelGameRunData, ThrowOnError>) => (options.client ?? client).post<CancelGameRunResponses, CancelGameRunErrors, ThrowOnError>({
386
+ security: [{ scheme: 'bearer', type: 'http' }],
387
+ url: '/api/runs/{jobId}/cancel',
388
+ ...options
389
+ });
390
+
391
+ /**
392
+ * List game rules for a game
393
+ *
394
+ * Retrieve a list of rule versions for a game, ordered by version descending (newest first)
395
+ */
396
+ export const listGameRules = <ThrowOnError extends boolean = false>(options: Options<ListGameRulesData, ThrowOnError>) => (options.client ?? client).get<ListGameRulesResponses, ListGameRulesErrors, ThrowOnError>({
397
+ security: [{ scheme: 'bearer', type: 'http' }],
398
+ url: '/api/games/{gameId}/rules',
399
+ ...options
400
+ });
401
+
402
+ /**
403
+ * Create a new game rule
404
+ *
405
+ * Create a new versioned rule for a game. Each save creates a new version with automatic version numbering.
406
+ */
407
+ export const createGameRule = <ThrowOnError extends boolean = false>(options: Options<CreateGameRuleData, ThrowOnError>) => (options.client ?? client).post<CreateGameRuleResponses, CreateGameRuleErrors, ThrowOnError>({
408
+ security: [{ scheme: 'bearer', type: 'http' }],
409
+ url: '/api/games/{gameId}/rules',
410
+ ...options,
411
+ headers: {
412
+ 'Content-Type': 'application/json',
413
+ ...options.headers
414
+ }
415
+ });
416
+
417
+ /**
418
+ * Get the latest game rule
419
+ *
420
+ * Retrieve the most recent rule version for a game with full details including the complete rule text
421
+ */
422
+ export const getLatestGameRule = <ThrowOnError extends boolean = false>(options: Options<GetLatestGameRuleData, ThrowOnError>) => (options.client ?? client).get<GetLatestGameRuleResponses, GetLatestGameRuleErrors, ThrowOnError>({
423
+ security: [{ scheme: 'bearer', type: 'http' }],
424
+ url: '/api/games/{gameId}/rules/latest',
425
+ ...options
426
+ });
427
+
428
+ /**
429
+ * Get game rule by ID
430
+ *
431
+ * Retrieve a specific game rule version by its ID with full details
432
+ */
433
+ export const getGameRule = <ThrowOnError extends boolean = false>(options: Options<GetGameRuleData, ThrowOnError>) => (options.client ?? client).get<GetGameRuleResponses, GetGameRuleErrors, ThrowOnError>({
434
+ security: [{ scheme: 'bearer', type: 'http' }],
435
+ url: '/api/rules/{ruleId}',
436
+ ...options
437
+ });
438
+
439
+ /**
440
+ * Create a new game session
441
+ *
442
+ * Create a new game session in lobby phase with initial seat configuration
443
+ */
444
+ export const createSession = <ThrowOnError extends boolean = false>(options: Options<CreateSessionData, ThrowOnError>) => (options.client ?? client).post<CreateSessionResponses, CreateSessionErrors, ThrowOnError>({
445
+ security: [{ scheme: 'bearer', type: 'http' }],
446
+ url: '/api/games/{gameId}/sessions',
447
+ ...options,
448
+ headers: {
449
+ 'Content-Type': 'application/json',
450
+ ...options.headers
451
+ }
452
+ });
453
+
454
+ /**
455
+ * Create a session from a reducer snapshot
456
+ *
457
+ * Create an auto-assigned gameplay session from a reducer-native snapshot produced by the CLI scenario harness.
458
+ */
459
+ export const createSessionFromReducerSnapshot = <ThrowOnError extends boolean = false>(options: Options<CreateSessionFromReducerSnapshotData, ThrowOnError>) => (options.client ?? client).post<CreateSessionFromReducerSnapshotResponses, CreateSessionFromReducerSnapshotErrors, ThrowOnError>({
460
+ security: [{ scheme: 'bearer', type: 'http' }],
461
+ url: '/api/games/{gameId}/sessions/from-reducer-snapshot',
462
+ ...options,
463
+ headers: {
464
+ 'Content-Type': 'application/json',
465
+ ...options.headers
466
+ }
467
+ });
468
+
469
+ /**
470
+ * Get session by short code
471
+ *
472
+ * Look up and hydrate a session using its memorable short code.
473
+ */
474
+ export const getSessionByShortCode = <ThrowOnError extends boolean = false>(options: Options<GetSessionByShortCodeData, ThrowOnError>) => (options.client ?? client).get<GetSessionByShortCodeResponses, GetSessionByShortCodeErrors, ThrowOnError>({
475
+ security: [{ scheme: 'bearer', type: 'http' }],
476
+ url: '/api/sessions/code/{shortCode}',
477
+ ...options
478
+ });
479
+
480
+ /**
481
+ * Get a session snapshot
482
+ *
483
+ * Return the canonical selected-perspective session snapshot for first render or explicit resync.
484
+ */
485
+ export const getSessionSnapshot = <ThrowOnError extends boolean = false>(options: Options<GetSessionSnapshotData, ThrowOnError>) => (options.client ?? client).get<GetSessionSnapshotResponses, GetSessionSnapshotErrors, ThrowOnError>({
486
+ security: [{ scheme: 'bearer', type: 'http' }],
487
+ url: '/api/sessions/{sessionId}/snapshot',
488
+ ...options
489
+ });
490
+
491
+ /**
492
+ * Subscribe to selected-perspective session events (SSE)
493
+ *
494
+ * Server-Sent Events stream for one selected host perspective. Every connection starts with a `session.snapshot` event.
495
+ */
496
+ export const subscribeToSessionEvents = <ThrowOnError extends boolean = false>(options: Options<SubscribeToSessionEventsData, ThrowOnError>) => (options.client ?? client).sse.get<SubscribeToSessionEventsResponses, SubscribeToSessionEventsErrors, ThrowOnError>({
497
+ security: [{ scheme: 'bearer', type: 'http' }],
498
+ url: '/api/sessions/{sessionId}/events',
499
+ ...options
500
+ });
501
+
502
+ /**
503
+ * Release a session events stream slot
504
+ *
505
+ * Best-effort disconnect signal used by browser tabs during unload and reconnect transitions so stale event stream slots are released promptly.
506
+ */
507
+ export const disconnectSessionEvents = <ThrowOnError extends boolean = false>(options: Options<DisconnectSessionEventsData, ThrowOnError>) => (options.client ?? client).post<DisconnectSessionEventsResponses, DisconnectSessionEventsErrors, ThrowOnError>({
508
+ security: [{ scheme: 'bearer', type: 'http' }],
509
+ url: '/api/sessions/{sessionId}/events/disconnect',
510
+ ...options
511
+ });
512
+
513
+ /**
514
+ * Subscribe to game logs (SSE)
515
+ *
516
+ * Server-Sent Events stream for real-time game engine console logs (stdout/stderr). Supports log replay via lastLogId query parameter for reconnection.
517
+ */
518
+ export const subscribeToGameLogs = <ThrowOnError extends boolean = false>(options: Options<SubscribeToGameLogsData, ThrowOnError>) => (options.client ?? client).sse.get<SubscribeToGameLogsResponses, SubscribeToGameLogsErrors, ThrowOnError>({
519
+ security: [{ scheme: 'bearer', type: 'http' }],
520
+ url: '/api/sessions/{sessionId}/logs',
521
+ ...options
522
+ });
523
+
524
+ /**
525
+ * Start the game
526
+ *
527
+ * Transition session from lobby to gameplay phase (host only)
528
+ */
529
+ export const startGame = <ThrowOnError extends boolean = false>(options: Options<StartGameData, ThrowOnError>) => (options.client ?? client).post<StartGameResponses, StartGameErrors, ThrowOnError>({
530
+ security: [{ scheme: 'bearer', type: 'http' }],
531
+ url: '/api/sessions/{sessionId}/start',
532
+ ...options
533
+ });
534
+
535
+ /**
536
+ * List current actions for a selected player
537
+ *
538
+ * Returns the current server-authored descriptors and action-set revision for the selected player.
539
+ */
540
+ export const listPlayerActions = <ThrowOnError extends boolean = false>(options: Options<ListPlayerActionsData, ThrowOnError>) => (options.client ?? client).get<ListPlayerActionsResponses, ListPlayerActionsErrors, ThrowOnError>({
541
+ security: [{ scheme: 'bearer', type: 'http' }],
542
+ url: '/api/sessions/{sessionId}/players/{playerId}/actions',
543
+ ...options
544
+ });
545
+
546
+ /**
547
+ * Describe one current action
548
+ *
549
+ * Returns the full current descriptor and action-set revision for one selected-player interaction.
550
+ */
551
+ export const describePlayerAction = <ThrowOnError extends boolean = false>(options: Options<DescribePlayerActionData, ThrowOnError>) => (options.client ?? client).get<DescribePlayerActionResponses, DescribePlayerActionErrors, ThrowOnError>({
552
+ security: [{ scheme: 'bearer', type: 'http' }],
553
+ url: '/api/sessions/{sessionId}/players/{playerId}/actions/{interactionId}',
554
+ ...options
555
+ });
556
+
557
+ /**
558
+ * Describe the current valid target/domain values for one action input
559
+ *
560
+ * Returns the current server-authored input domain for a selected-player action input.
561
+ */
562
+ export const getPlayerActionTargets = <ThrowOnError extends boolean = false>(options: Options<GetPlayerActionTargetsData, ThrowOnError>) => (options.client ?? client).get<GetPlayerActionTargetsResponses, GetPlayerActionTargetsErrors, ThrowOnError>({
563
+ security: [{ scheme: 'bearer', type: 'http' }],
564
+ url: '/api/sessions/{sessionId}/players/{playerId}/actions/{interactionId}/targets/{inputKey}',
565
+ ...options
566
+ });
567
+
568
+ /**
569
+ * Validate collector-shaped action inputs
570
+ *
571
+ * Validates one selected-player action using collector-shaped inputs. Path fields are authoritative; clients do not send a GameInput envelope.
572
+ */
573
+ export const validatePlayerAction = <ThrowOnError extends boolean = false>(options: Options<ValidatePlayerActionData, ThrowOnError>) => (options.client ?? client).post<ValidatePlayerActionResponses, ValidatePlayerActionErrors, ThrowOnError>({
574
+ security: [{ scheme: 'bearer', type: 'http' }],
575
+ url: '/api/sessions/{sessionId}/players/{playerId}/actions/{interactionId}/validate',
576
+ ...options,
577
+ headers: {
578
+ 'Content-Type': 'application/json',
579
+ ...options.headers
580
+ }
581
+ });
582
+
583
+ /**
584
+ * Submit collector-shaped action inputs
585
+ *
586
+ * Submits one selected-player action using collector-shaped inputs. Path fields are authoritative; clients do not send a GameInput envelope.
587
+ */
588
+ export const submitPlayerAction = <ThrowOnError extends boolean = false>(options: Options<SubmitPlayerActionData, ThrowOnError>) => (options.client ?? client).post<SubmitPlayerActionResponses, SubmitPlayerActionErrors, ThrowOnError>({
589
+ security: [{ scheme: 'bearer', type: 'http' }],
590
+ url: '/api/sessions/{sessionId}/players/{playerId}/actions/{interactionId}/submit',
591
+ ...options,
592
+ headers: {
593
+ 'Content-Type': 'application/json',
594
+ ...options.headers
595
+ }
596
+ });
597
+
598
+ /**
599
+ * Add a seat to the lobby
600
+ *
601
+ * Add a new seat to the lobby (host only, up to maxPlayers)
602
+ */
603
+ export const addSeat = <ThrowOnError extends boolean = false>(options: Options<AddSeatData, ThrowOnError>) => (options.client ?? client).post<AddSeatResponses, AddSeatErrors, ThrowOnError>({
604
+ security: [{ scheme: 'bearer', type: 'http' }],
605
+ url: '/api/sessions/{sessionId}/seats',
606
+ ...options
607
+ });
608
+
609
+ /**
610
+ * Remove a seat from the lobby
611
+ *
612
+ * Remove a seat from the lobby (host only, down to minPlayers)
613
+ */
614
+ export const removeSeat = <ThrowOnError extends boolean = false>(options: Options<RemoveSeatData, ThrowOnError>) => (options.client ?? client).delete<RemoveSeatResponses, RemoveSeatErrors, ThrowOnError>({
615
+ security: [{ scheme: 'bearer', type: 'http' }],
616
+ url: '/api/sessions/{sessionId}/seats/{playerId}',
617
+ ...options
618
+ });
619
+
620
+ /**
621
+ * Update seat settings
622
+ *
623
+ * Update seat display name and/or player color. User must be assigned to the seat.
624
+ */
625
+ export const updateSeat = <ThrowOnError extends boolean = false>(options: Options<UpdateSeatData, ThrowOnError>) => (options.client ?? client).patch<UpdateSeatResponses, UpdateSeatErrors, ThrowOnError>({
626
+ security: [{ scheme: 'bearer', type: 'http' }],
627
+ url: '/api/sessions/{sessionId}/seats/{playerId}',
628
+ ...options,
629
+ headers: {
630
+ 'Content-Type': 'application/json',
631
+ ...options.headers
632
+ }
633
+ });
634
+
635
+ /**
636
+ * Assign a seat to current user
637
+ *
638
+ * Assign the current authenticated user to a specific seat
639
+ */
640
+ export const assignSeat = <ThrowOnError extends boolean = false>(options: Options<AssignSeatData, ThrowOnError>) => (options.client ?? client).post<AssignSeatResponses, AssignSeatErrors, ThrowOnError>({
641
+ security: [{ scheme: 'bearer', type: 'http' }],
642
+ url: '/api/sessions/{sessionId}/seats/{playerId}/assign',
643
+ ...options
644
+ });
645
+
646
+ /**
647
+ * Restore game state from history
648
+ *
649
+ * Restore the game to a previous state from history (host only)
650
+ */
651
+ export const restoreHistory = <ThrowOnError extends boolean = false>(options: Options<RestoreHistoryData, ThrowOnError>) => (options.client ?? client).post<RestoreHistoryResponses, RestoreHistoryErrors, ThrowOnError>({
652
+ security: [{ scheme: 'bearer', type: 'http' }],
653
+ url: '/api/sessions/{sessionId}/history/restore',
654
+ ...options,
655
+ headers: {
656
+ 'Content-Type': 'application/json',
657
+ ...options.headers
658
+ }
659
+ });
660
+
661
+ /**
662
+ * Unassign a seat
663
+ *
664
+ * Unassign the current user from a specific seat
665
+ */
666
+ export const unassignSeat = <ThrowOnError extends boolean = false>(options: Options<UnassignSeatData, ThrowOnError>) => (options.client ?? client).post<UnassignSeatResponses, UnassignSeatErrors, ThrowOnError>({
667
+ security: [{ scheme: 'bearer', type: 'http' }],
668
+ url: '/api/sessions/{sessionId}/seats/{playerId}/unassign',
669
+ ...options
670
+ });
671
+
672
+ /**
673
+ * Fetch UI bundle
674
+ *
675
+ * Fetch and return the HTML content of a UI bundle from Supabase storage based on the last compiled UI result
676
+ */
677
+ export const fetchUiBundle = <ThrowOnError extends boolean = false>(options?: Options<FetchUiBundleData, ThrowOnError>) => (options?.client ?? client).get<FetchUiBundleResponses, FetchUiBundleErrors, ThrowOnError>({
678
+ security: [{ scheme: 'bearer', type: 'http' }],
679
+ url: '/api/ui-bundles/fetch',
680
+ ...options
681
+ });
682
+
683
+ /**
684
+ * List demo games
685
+ *
686
+ * List bundled demo games that can be opened without a normal user account.
687
+ */
688
+ export const listDemoGames = <ThrowOnError extends boolean = false>(options?: Options<ListDemoGamesData, ThrowOnError>) => (options?.client ?? client).get<ListDemoGamesResponses, ListDemoGamesErrors, ThrowOnError>({ url: '/api/demo-games', ...options });
689
+
690
+ /**
691
+ * Get demo game
692
+ *
693
+ * Return registration and playability metadata for a bundled demo game.
694
+ */
695
+ export const getDemoGame = <ThrowOnError extends boolean = false>(options: Options<GetDemoGameData, ThrowOnError>) => (options.client ?? client).get<GetDemoGameResponses, GetDemoGameErrors, ThrowOnError>({ url: '/api/demo-games/{slug}', ...options });
696
+
697
+ /**
698
+ * Get demo game thumbnail
699
+ *
700
+ * Return the static thumbnail image for an active bundled demo game.
701
+ */
702
+ export const getDemoGameThumbnail = <ThrowOnError extends boolean = false>(options: Options<GetDemoGameThumbnailData, ThrowOnError>) => (options.client ?? client).get<GetDemoGameThumbnailResponses, GetDemoGameThumbnailErrors, ThrowOnError>({ url: '/api/demo-games/{slug}/thumbnail', ...options });
703
+
704
+ /**
705
+ * Create demo session
706
+ *
707
+ * Create a fresh guest-play session for a bundled demo game.
708
+ */
709
+ export const createDemoGameSession = <ThrowOnError extends boolean = false>(options: Options<CreateDemoGameSessionData, ThrowOnError>) => (options.client ?? client).post<CreateDemoGameSessionResponses, CreateDemoGameSessionErrors, ThrowOnError>({ url: '/api/demo-games/{slug}/sessions', ...options });