@game-infra/api-schemas-core 0.0.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.
@@ -0,0 +1,420 @@
1
+ import { ContractNoBody } from "@toad-contracts/valibot";
2
+ /**
3
+ * Typed endpoint contracts for the generic service API.
4
+ *
5
+ * Each `defineApiContract` replaces the old `paths.ts` constant + `pathResolvers.ts`
6
+ * function pair: `pathResolver` builds the URL, and `mapApiContractToPath(contract)`
7
+ * derives the `:param` route pattern. Path params are validated as strings; wire these
8
+ * into a Hono app with `@toad-contracts/hono` and into a client with
9
+ * `@toad-contracts/frontend-http-client`.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { authLoginContract, gameEntityLoadContract } from '@game-infra/api-schemas-core'
14
+ *
15
+ * authLoginContract.pathResolver({}) // '/auth/login'
16
+ * gameEntityLoadContract.pathResolver({ gameId: 'g1', entityType: 'item', entityId: 'e1' })
17
+ * // '/games/g1/entities/item/e1'
18
+ * ```
19
+ */
20
+ export declare const authRegisterContract: {
21
+ readonly method: "post";
22
+ readonly pathResolver: () => string;
23
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
24
+ readonly email: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>]>;
25
+ readonly username: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 3, undefined>, import("valibot").MaxLengthAction<string, 64, undefined>]>;
26
+ readonly password: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 6, undefined>, import("valibot").MaxLengthAction<string, 128, undefined>]>;
27
+ }, undefined>;
28
+ readonly responsesByStatusCode: {
29
+ 200: import("valibot").ObjectSchema<{
30
+ readonly success: import("valibot").BooleanSchema<undefined>;
31
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
32
+ } & {
33
+ token: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
34
+ userId: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
35
+ username: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
36
+ }, undefined>;
37
+ };
38
+ };
39
+ export declare const authLoginContract: {
40
+ readonly method: "post";
41
+ readonly pathResolver: () => string;
42
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
43
+ readonly identifier: import("valibot").StringSchema<undefined>;
44
+ readonly password: import("valibot").StringSchema<undefined>;
45
+ }, undefined>;
46
+ readonly responsesByStatusCode: {
47
+ 200: import("valibot").ObjectSchema<{
48
+ readonly success: import("valibot").BooleanSchema<undefined>;
49
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
50
+ } & {
51
+ token: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
52
+ userId: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
53
+ username: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
54
+ }, undefined>;
55
+ };
56
+ };
57
+ export declare const authValidateContract: {
58
+ readonly method: "post";
59
+ readonly pathResolver: () => string;
60
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
61
+ readonly token: import("valibot").StringSchema<undefined>;
62
+ }, undefined>;
63
+ readonly responsesByStatusCode: {
64
+ 200: import("valibot").ObjectSchema<{
65
+ readonly success: import("valibot").BooleanSchema<undefined>;
66
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
67
+ } & {
68
+ valid: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
69
+ userId: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
70
+ username: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
71
+ }, undefined>;
72
+ };
73
+ };
74
+ export declare const authValidateServiceTokenContract: {
75
+ readonly method: "get";
76
+ readonly pathResolver: () => string;
77
+ readonly responsesByStatusCode: {
78
+ 200: import("valibot").ObjectSchema<{
79
+ readonly success: import("valibot").BooleanSchema<undefined>;
80
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
81
+ } & {
82
+ valid: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
83
+ }, undefined>;
84
+ };
85
+ };
86
+ export declare const savegameSaveContract: {
87
+ readonly method: "put";
88
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
89
+ readonly userId: import("valibot").StringSchema<undefined>;
90
+ readonly gameId: import("valibot").StringSchema<undefined>;
91
+ readonly saveSlot: import("valibot").StringSchema<undefined>;
92
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
93
+ readonly pathResolver: ({ userId, gameId, saveSlot }: {
94
+ userId: string;
95
+ gameId: string;
96
+ saveSlot: string;
97
+ }) => string;
98
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
99
+ readonly gameVersion: import("valibot").StringSchema<undefined>;
100
+ readonly compressedData: import("valibot").StringSchema<undefined>;
101
+ }, undefined>;
102
+ readonly responsesByStatusCode: {
103
+ 200: import("valibot").ObjectSchema<{
104
+ readonly success: import("valibot").BooleanSchema<undefined>;
105
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
106
+ }, undefined>;
107
+ };
108
+ };
109
+ export declare const savegameLoadContract: {
110
+ readonly method: "get";
111
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
112
+ readonly userId: import("valibot").StringSchema<undefined>;
113
+ readonly gameId: import("valibot").StringSchema<undefined>;
114
+ readonly saveSlot: import("valibot").StringSchema<undefined>;
115
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
116
+ readonly pathResolver: ({ userId, gameId, saveSlot }: {
117
+ userId: string;
118
+ gameId: string;
119
+ saveSlot: string;
120
+ }) => string;
121
+ readonly responsesByStatusCode: {
122
+ 200: import("valibot").ObjectSchema<{
123
+ readonly success: import("valibot").BooleanSchema<undefined>;
124
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
125
+ } & {
126
+ compressedData: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
127
+ gameVersion: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
128
+ updatedAt: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
129
+ }, undefined>;
130
+ };
131
+ };
132
+ export declare const savegameListSlotsContract: {
133
+ readonly method: "get";
134
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
135
+ readonly userId: import("valibot").StringSchema<undefined>;
136
+ readonly gameId: import("valibot").StringSchema<undefined>;
137
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
138
+ readonly pathResolver: ({ userId, gameId }: {
139
+ userId: string;
140
+ gameId: string;
141
+ }) => string;
142
+ readonly responsesByStatusCode: {
143
+ 200: import("valibot").ObjectSchema<{
144
+ readonly success: import("valibot").BooleanSchema<undefined>;
145
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
146
+ } & {
147
+ slots: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
148
+ readonly saveSlot: import("valibot").NumberSchema<undefined>;
149
+ readonly gameVersion: import("valibot").StringSchema<undefined>;
150
+ readonly updatedAt: import("valibot").StringSchema<undefined>;
151
+ }, undefined>, undefined>, undefined>;
152
+ }, undefined>;
153
+ };
154
+ };
155
+ export declare const gameEntitySaveContract: {
156
+ readonly method: "post";
157
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
158
+ readonly gameId: import("valibot").StringSchema<undefined>;
159
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
160
+ readonly pathResolver: ({ gameId }: {
161
+ gameId: string;
162
+ }) => string;
163
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
164
+ readonly entityId: import("valibot").StringSchema<undefined>;
165
+ readonly entityType: import("valibot").StringSchema<undefined>;
166
+ readonly entityData: import("valibot").StringSchema<undefined>;
167
+ }, undefined>;
168
+ readonly responsesByStatusCode: {
169
+ 200: import("valibot").ObjectSchema<{
170
+ readonly success: import("valibot").BooleanSchema<undefined>;
171
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
172
+ } & {
173
+ entityId: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
174
+ }, undefined>;
175
+ };
176
+ };
177
+ export declare const gameEntityUpdateContract: {
178
+ readonly method: "put";
179
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
180
+ readonly gameId: import("valibot").StringSchema<undefined>;
181
+ readonly entityType: import("valibot").StringSchema<undefined>;
182
+ readonly entityId: import("valibot").StringSchema<undefined>;
183
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
184
+ readonly pathResolver: ({ gameId, entityType, entityId }: {
185
+ gameId: string;
186
+ entityType: string;
187
+ entityId: string;
188
+ }) => string;
189
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
190
+ readonly entityId: import("valibot").StringSchema<undefined>;
191
+ readonly entityType: import("valibot").StringSchema<undefined>;
192
+ readonly entityData: import("valibot").StringSchema<undefined>;
193
+ }, undefined>;
194
+ readonly responsesByStatusCode: {
195
+ 200: import("valibot").ObjectSchema<{
196
+ readonly success: import("valibot").BooleanSchema<undefined>;
197
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
198
+ } & {
199
+ entityId: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
200
+ }, undefined>;
201
+ };
202
+ };
203
+ export declare const gameEntityLoadContract: {
204
+ readonly method: "get";
205
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
206
+ readonly gameId: import("valibot").StringSchema<undefined>;
207
+ readonly entityType: import("valibot").StringSchema<undefined>;
208
+ readonly entityId: import("valibot").StringSchema<undefined>;
209
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
210
+ readonly pathResolver: ({ gameId, entityType, entityId }: {
211
+ gameId: string;
212
+ entityType: string;
213
+ entityId: string;
214
+ }) => string;
215
+ readonly responsesByStatusCode: {
216
+ 200: import("valibot").ObjectSchema<{
217
+ readonly success: import("valibot").BooleanSchema<undefined>;
218
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
219
+ } & {
220
+ entityId: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
221
+ entityType: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
222
+ entityData: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
223
+ updatedAt: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
224
+ }, undefined>;
225
+ };
226
+ };
227
+ export declare const gameEntityListContract: {
228
+ readonly method: "get";
229
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
230
+ readonly gameId: import("valibot").StringSchema<undefined>;
231
+ readonly entityType: import("valibot").StringSchema<undefined>;
232
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
233
+ readonly pathResolver: ({ gameId, entityType }: {
234
+ gameId: string;
235
+ entityType: string;
236
+ }) => string;
237
+ readonly responsesByStatusCode: {
238
+ 200: import("valibot").ObjectSchema<{
239
+ readonly success: import("valibot").BooleanSchema<undefined>;
240
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
241
+ } & {
242
+ entities: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
243
+ readonly entityId: import("valibot").StringSchema<undefined>;
244
+ readonly entityType: import("valibot").StringSchema<undefined>;
245
+ readonly updatedAt: import("valibot").StringSchema<undefined>;
246
+ }, undefined>, undefined>, undefined>;
247
+ }, undefined>;
248
+ };
249
+ };
250
+ export declare const gameEntityListAllContract: {
251
+ readonly method: "get";
252
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
253
+ readonly gameId: import("valibot").StringSchema<undefined>;
254
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
255
+ readonly pathResolver: ({ gameId }: {
256
+ gameId: string;
257
+ }) => string;
258
+ readonly responsesByStatusCode: {
259
+ 200: import("valibot").ObjectSchema<{
260
+ readonly success: import("valibot").BooleanSchema<undefined>;
261
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
262
+ } & {
263
+ entities: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
264
+ readonly entityId: import("valibot").StringSchema<undefined>;
265
+ readonly entityType: import("valibot").StringSchema<undefined>;
266
+ readonly updatedAt: import("valibot").StringSchema<undefined>;
267
+ }, undefined>, undefined>, undefined>;
268
+ }, undefined>;
269
+ };
270
+ };
271
+ export declare const gameEntityDeleteContract: {
272
+ readonly method: "delete";
273
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
274
+ readonly gameId: import("valibot").StringSchema<undefined>;
275
+ readonly entityType: import("valibot").StringSchema<undefined>;
276
+ readonly entityId: import("valibot").StringSchema<undefined>;
277
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
278
+ readonly pathResolver: ({ gameId, entityType, entityId }: {
279
+ gameId: string;
280
+ entityType: string;
281
+ entityId: string;
282
+ }) => string;
283
+ readonly responsesByStatusCode: {
284
+ 200: import("valibot").ObjectSchema<{
285
+ readonly success: import("valibot").BooleanSchema<undefined>;
286
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
287
+ }, undefined>;
288
+ };
289
+ };
290
+ export declare const gameEntityBulkSaveContract: {
291
+ readonly method: "post";
292
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
293
+ readonly gameId: import("valibot").StringSchema<undefined>;
294
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
295
+ readonly pathResolver: ({ gameId }: {
296
+ gameId: string;
297
+ }) => string;
298
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
299
+ readonly entities: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
300
+ readonly entityId: import("valibot").StringSchema<undefined>;
301
+ readonly entityType: import("valibot").StringSchema<undefined>;
302
+ readonly entityData: import("valibot").StringSchema<undefined>;
303
+ }, undefined>, undefined>;
304
+ }, undefined>;
305
+ readonly responsesByStatusCode: {
306
+ 200: import("valibot").ObjectSchema<{
307
+ readonly success: import("valibot").BooleanSchema<undefined>;
308
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
309
+ } & {
310
+ savedCount: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
311
+ }, undefined>;
312
+ };
313
+ };
314
+ export declare const backupTriggerContract: {
315
+ readonly method: "post";
316
+ readonly pathResolver: () => string;
317
+ readonly requestBodySchema: typeof ContractNoBody;
318
+ readonly responsesByStatusCode: {
319
+ 200: import("valibot").ObjectSchema<{
320
+ readonly success: import("valibot").BooleanSchema<undefined>;
321
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
322
+ } & {
323
+ storageId: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
324
+ filename: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
325
+ recordCount: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
326
+ size: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
327
+ }, undefined>;
328
+ };
329
+ };
330
+ export declare const backupListContract: {
331
+ readonly method: "get";
332
+ readonly pathResolver: () => string;
333
+ readonly responsesByStatusCode: {
334
+ 200: import("valibot").ObjectSchema<{
335
+ readonly success: import("valibot").BooleanSchema<undefined>;
336
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
337
+ } & {
338
+ backups: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
339
+ readonly storageId: import("valibot").StringSchema<undefined>;
340
+ readonly filename: import("valibot").StringSchema<undefined>;
341
+ readonly recordCount: import("valibot").NumberSchema<undefined>;
342
+ readonly size: import("valibot").NumberSchema<undefined>;
343
+ readonly createdAt: import("valibot").StringSchema<undefined>;
344
+ readonly gameId: import("valibot").StringSchema<undefined>;
345
+ }, undefined>, undefined>, undefined>;
346
+ }, undefined>;
347
+ };
348
+ };
349
+ export declare const backupRestoreContract: {
350
+ readonly method: "post";
351
+ readonly pathResolver: () => string;
352
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
353
+ readonly storageId: import("valibot").StringSchema<undefined>;
354
+ readonly gameId: import("valibot").StringSchema<undefined>;
355
+ }, undefined>;
356
+ readonly responsesByStatusCode: {
357
+ 200: import("valibot").ObjectSchema<{
358
+ readonly success: import("valibot").BooleanSchema<undefined>;
359
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
360
+ } & {
361
+ restoredCount: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
362
+ preRestoreBackupStorageId: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
363
+ }, undefined>;
364
+ };
365
+ };
366
+ export declare const backupDownloadContract: {
367
+ readonly method: "get";
368
+ readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
369
+ readonly storageId: import("valibot").StringSchema<undefined>;
370
+ }, undefined> & import("@toad-contracts/valibot").StandardObjectKeysV1<unknown, unknown>;
371
+ readonly pathResolver: ({ storageId }: {
372
+ storageId: string;
373
+ }) => string;
374
+ readonly responsesByStatusCode: {
375
+ 200: import("valibot").ObjectSchema<{
376
+ readonly success: import("valibot").BooleanSchema<undefined>;
377
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
378
+ } & {
379
+ backup: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
380
+ readonly storageId: import("valibot").StringSchema<undefined>;
381
+ readonly filename: import("valibot").StringSchema<undefined>;
382
+ readonly recordCount: import("valibot").NumberSchema<undefined>;
383
+ readonly size: import("valibot").NumberSchema<undefined>;
384
+ readonly createdAt: import("valibot").StringSchema<undefined>;
385
+ readonly gameId: import("valibot").StringSchema<undefined>;
386
+ }, undefined>, undefined>;
387
+ }, undefined>;
388
+ };
389
+ };
390
+ export declare const feedbackSubmitContract: {
391
+ readonly method: "post";
392
+ readonly pathResolver: () => string;
393
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
394
+ readonly type: import("valibot").PicklistSchema<("bug" | "general" | "suggestion")[], undefined>;
395
+ readonly content: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 5000, undefined>]>;
396
+ readonly email: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>]>, undefined>;
397
+ readonly gameVersion: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
398
+ readonly browser: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
399
+ readonly platform: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
400
+ }, undefined>;
401
+ readonly responsesByStatusCode: {
402
+ 200: import("valibot").ObjectSchema<{
403
+ readonly success: import("valibot").BooleanSchema<undefined>;
404
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
405
+ } & {
406
+ message: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
407
+ }, undefined>;
408
+ };
409
+ };
410
+ export declare const heartbeatContract: {
411
+ readonly method: "get";
412
+ readonly pathResolver: () => string;
413
+ readonly responsesByStatusCode: {
414
+ 200: import("valibot").ObjectSchema<{
415
+ readonly success: import("valibot").BooleanSchema<undefined>;
416
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
417
+ }, undefined>;
418
+ };
419
+ };
420
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,MAAM,yBAAyB,CAAC;AAoC5F;;;;;;;;;;;;;;;;;GAiBG;AAMH,eAAO,MAAM,oBAAoB;;;;;;;;;QAIN,GAAG;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;QAIH,GAAG;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;QAIN,GAAG;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;QAGlB,GAAG;;;;;;;CAC5B,CAAC;AAWH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;QAMN,GAAG;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;QAKN,GAAG;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;QAIX,GAAG;;;;;;;;;;;CAC5B,CAAC;AAYH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;QAKR,GAAG;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;QAMV,GAAG;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;QAKR,GAAG;;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;QAIR,GAAG;;;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;QAIX,GAAG;;;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;QAKV,GAAG;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;QAKZ,GAAG;;;;;;;CAC5B,CAAC;AAMH,eAAO,MAAM,qBAAqB;;;;;QAIP,GAAG;;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;QAGJ,GAAG;;;;;;;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;QAIP,GAAG;;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;QAIR,GAAG;;;;;;;;;;;;;;CAC5B,CAAC;AAMH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;QAIR,GAAG;;;;;;;CAC5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;QAGH,GAAG;;;;;CAC5B,CAAC"}
@@ -0,0 +1,168 @@
1
+ import { ContractNoBody, defineApiContract, withObjectKeys } from "@toad-contracts/valibot";
2
+ import { object, string } from "valibot";
3
+ import { LoginRequestSchema, LoginResponseSchema, RegisterRequestSchema, RegisterResponseSchema, ValidateServiceTokenResponseSchema, ValidateTokenRequestSchema, ValidateTokenResponseSchema, } from "./auth.js";
4
+ import { DownloadBackupResponseSchema, ListBackupsResponseSchema, RestoreBackupRequestSchema, RestoreBackupResponseSchema, TriggerBackupResponseSchema, } from "./backup.js";
5
+ import { ApiResponseSchema } from "./common.js";
6
+ import { FeedbackSubmitRequestSchema, FeedbackSubmitResponseSchema } from "./feedback.js";
7
+ import { GameEntityBulkSaveRequestSchema, GameEntityBulkSaveResponseSchema, GameEntityDeleteResponseSchema, GameEntityListResponseSchema, GameEntityLoadResponseSchema, GameEntitySaveRequestSchema, GameEntitySaveResponseSchema, } from "./gameEntity.js";
8
+ import { SavegameListSlotsResponseSchema, SavegameLoadResponseSchema, SavegameSaveRequestSchema, SavegameSaveResponseSchema, } from "./savegame.js";
9
+ /**
10
+ * Typed endpoint contracts for the generic service API.
11
+ *
12
+ * Each `defineApiContract` replaces the old `paths.ts` constant + `pathResolvers.ts`
13
+ * function pair: `pathResolver` builds the URL, and `mapApiContractToPath(contract)`
14
+ * derives the `:param` route pattern. Path params are validated as strings; wire these
15
+ * into a Hono app with `@toad-contracts/hono` and into a client with
16
+ * `@toad-contracts/frontend-http-client`.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * import { authLoginContract, gameEntityLoadContract } from '@game-infra/api-schemas-core'
21
+ *
22
+ * authLoginContract.pathResolver({}) // '/auth/login'
23
+ * gameEntityLoadContract.pathResolver({ gameId: 'g1', entityType: 'item', entityId: 'e1' })
24
+ * // '/games/g1/entities/item/e1'
25
+ * ```
26
+ */
27
+ // ============================================================================
28
+ // Auth
29
+ // ============================================================================
30
+ export const authRegisterContract = defineApiContract({
31
+ method: "post",
32
+ pathResolver: () => "/auth/register",
33
+ requestBodySchema: RegisterRequestSchema,
34
+ responsesByStatusCode: { 200: RegisterResponseSchema },
35
+ });
36
+ export const authLoginContract = defineApiContract({
37
+ method: "post",
38
+ pathResolver: () => "/auth/login",
39
+ requestBodySchema: LoginRequestSchema,
40
+ responsesByStatusCode: { 200: LoginResponseSchema },
41
+ });
42
+ export const authValidateContract = defineApiContract({
43
+ method: "post",
44
+ pathResolver: () => "/auth/validate",
45
+ requestBodySchema: ValidateTokenRequestSchema,
46
+ responsesByStatusCode: { 200: ValidateTokenResponseSchema },
47
+ });
48
+ export const authValidateServiceTokenContract = defineApiContract({
49
+ method: "get",
50
+ pathResolver: () => "/auth/validate-service-token",
51
+ responsesByStatusCode: { 200: ValidateServiceTokenResponseSchema },
52
+ });
53
+ // ============================================================================
54
+ // Savegame (save/load share one path, disambiguated by method)
55
+ // ============================================================================
56
+ const savegameSlotParams = withObjectKeys(object({ userId: string(), gameId: string(), saveSlot: string() }));
57
+ const savegameListParams = withObjectKeys(object({ userId: string(), gameId: string() }));
58
+ export const savegameSaveContract = defineApiContract({
59
+ method: "put",
60
+ requestPathParamsSchema: savegameSlotParams,
61
+ pathResolver: ({ userId, gameId, saveSlot }) => `/users/${userId}/games/${gameId}/saves/${saveSlot}`,
62
+ requestBodySchema: SavegameSaveRequestSchema,
63
+ responsesByStatusCode: { 200: SavegameSaveResponseSchema },
64
+ });
65
+ export const savegameLoadContract = defineApiContract({
66
+ method: "get",
67
+ requestPathParamsSchema: savegameSlotParams,
68
+ pathResolver: ({ userId, gameId, saveSlot }) => `/users/${userId}/games/${gameId}/saves/${saveSlot}`,
69
+ responsesByStatusCode: { 200: SavegameLoadResponseSchema },
70
+ });
71
+ export const savegameListSlotsContract = defineApiContract({
72
+ method: "get",
73
+ requestPathParamsSchema: savegameListParams,
74
+ pathResolver: ({ userId, gameId }) => `/users/${userId}/games/${gameId}/saves`,
75
+ responsesByStatusCode: { 200: SavegameListSlotsResponseSchema },
76
+ });
77
+ // ============================================================================
78
+ // Game entities (update/load/delete share one path, disambiguated by method)
79
+ // ============================================================================
80
+ const gameEntityGameParams = withObjectKeys(object({ gameId: string() }));
81
+ const gameEntityTypeParams = withObjectKeys(object({ gameId: string(), entityType: string() }));
82
+ const gameEntityItemParams = withObjectKeys(object({ gameId: string(), entityType: string(), entityId: string() }));
83
+ export const gameEntitySaveContract = defineApiContract({
84
+ method: "post",
85
+ requestPathParamsSchema: gameEntityGameParams,
86
+ pathResolver: ({ gameId }) => `/games/${gameId}/entities`,
87
+ requestBodySchema: GameEntitySaveRequestSchema,
88
+ responsesByStatusCode: { 200: GameEntitySaveResponseSchema },
89
+ });
90
+ export const gameEntityUpdateContract = defineApiContract({
91
+ method: "put",
92
+ requestPathParamsSchema: gameEntityItemParams,
93
+ pathResolver: ({ gameId, entityType, entityId }) => `/games/${gameId}/entities/${entityType}/${entityId}`,
94
+ requestBodySchema: GameEntitySaveRequestSchema,
95
+ responsesByStatusCode: { 200: GameEntitySaveResponseSchema },
96
+ });
97
+ export const gameEntityLoadContract = defineApiContract({
98
+ method: "get",
99
+ requestPathParamsSchema: gameEntityItemParams,
100
+ pathResolver: ({ gameId, entityType, entityId }) => `/games/${gameId}/entities/${entityType}/${entityId}`,
101
+ responsesByStatusCode: { 200: GameEntityLoadResponseSchema },
102
+ });
103
+ export const gameEntityListContract = defineApiContract({
104
+ method: "get",
105
+ requestPathParamsSchema: gameEntityTypeParams,
106
+ pathResolver: ({ gameId, entityType }) => `/games/${gameId}/entities/${entityType}`,
107
+ responsesByStatusCode: { 200: GameEntityListResponseSchema },
108
+ });
109
+ export const gameEntityListAllContract = defineApiContract({
110
+ method: "get",
111
+ requestPathParamsSchema: gameEntityGameParams,
112
+ pathResolver: ({ gameId }) => `/games/${gameId}/entities`,
113
+ responsesByStatusCode: { 200: GameEntityListResponseSchema },
114
+ });
115
+ export const gameEntityDeleteContract = defineApiContract({
116
+ method: "delete",
117
+ requestPathParamsSchema: gameEntityItemParams,
118
+ pathResolver: ({ gameId, entityType, entityId }) => `/games/${gameId}/entities/${entityType}/${entityId}`,
119
+ responsesByStatusCode: { 200: GameEntityDeleteResponseSchema },
120
+ });
121
+ export const gameEntityBulkSaveContract = defineApiContract({
122
+ method: "post",
123
+ requestPathParamsSchema: gameEntityGameParams,
124
+ pathResolver: ({ gameId }) => `/games/${gameId}/entities/bulk`,
125
+ requestBodySchema: GameEntityBulkSaveRequestSchema,
126
+ responsesByStatusCode: { 200: GameEntityBulkSaveResponseSchema },
127
+ });
128
+ // ============================================================================
129
+ // Admin backup
130
+ // ============================================================================
131
+ export const backupTriggerContract = defineApiContract({
132
+ method: "post",
133
+ pathResolver: () => "/admin/backup/trigger",
134
+ requestBodySchema: ContractNoBody,
135
+ responsesByStatusCode: { 200: TriggerBackupResponseSchema },
136
+ });
137
+ export const backupListContract = defineApiContract({
138
+ method: "get",
139
+ pathResolver: () => "/admin/backup",
140
+ responsesByStatusCode: { 200: ListBackupsResponseSchema },
141
+ });
142
+ export const backupRestoreContract = defineApiContract({
143
+ method: "post",
144
+ pathResolver: () => "/admin/backup/restore",
145
+ requestBodySchema: RestoreBackupRequestSchema,
146
+ responsesByStatusCode: { 200: RestoreBackupResponseSchema },
147
+ });
148
+ export const backupDownloadContract = defineApiContract({
149
+ method: "get",
150
+ requestPathParamsSchema: withObjectKeys(object({ storageId: string() })),
151
+ pathResolver: ({ storageId }) => `/admin/backup/${storageId}/download`,
152
+ responsesByStatusCode: { 200: DownloadBackupResponseSchema },
153
+ });
154
+ // ============================================================================
155
+ // Feedback + heartbeat
156
+ // ============================================================================
157
+ export const feedbackSubmitContract = defineApiContract({
158
+ method: "post",
159
+ pathResolver: () => "/feedback",
160
+ requestBodySchema: FeedbackSubmitRequestSchema,
161
+ responsesByStatusCode: { 200: FeedbackSubmitResponseSchema },
162
+ });
163
+ export const heartbeatContract = defineApiContract({
164
+ method: "get",
165
+ pathResolver: () => "/heartbeat",
166
+ responsesByStatusCode: { 200: ApiResponseSchema },
167
+ });
168
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,kCAAkC,EAClC,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,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AAG,EAAE,CAAC,YAAY;IAChC,qBAAqB,EAAE,EAAE,GAAG,EAAE,iBAAiB,EAAE;CAClD,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { type InferOutput } from "valibot";
2
+ /**
3
+ * Feedback type enum
4
+ */
5
+ export declare const FeedbackType: {
6
+ readonly BUG: "bug";
7
+ readonly SUGGESTION: "suggestion";
8
+ readonly GENERAL: "general";
9
+ };
10
+ /**
11
+ * Union of the feedback type values: `"bug" | "suggestion" | "general"`.
12
+ */
13
+ export type FeedbackType = (typeof FeedbackType)[keyof typeof FeedbackType];
14
+ /**
15
+ * Feedback submit request schema
16
+ */
17
+ export declare const FeedbackSubmitRequestSchema: import("valibot").ObjectSchema<{
18
+ readonly type: import("valibot").PicklistSchema<("bug" | "general" | "suggestion")[], undefined>;
19
+ readonly content: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 5000, undefined>]>;
20
+ readonly email: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>]>, undefined>;
21
+ readonly gameVersion: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
22
+ readonly browser: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
23
+ readonly platform: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
24
+ }, undefined>;
25
+ export type FeedbackSubmitRequest = InferOutput<typeof FeedbackSubmitRequestSchema>;
26
+ /**
27
+ * Feedback submit response schema
28
+ */
29
+ export declare const FeedbackSubmitResponseSchema: import("valibot").ObjectSchema<{
30
+ readonly success: import("valibot").BooleanSchema<undefined>;
31
+ readonly error: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
32
+ } & {
33
+ message: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
34
+ }, undefined>;
35
+ export type FeedbackSubmitResponse = InferOutput<typeof FeedbackSubmitResponseSchema>;
36
+ //# sourceMappingURL=feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../src/feedback.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EASjB,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,eAAO,MAAM,YAAY;aACvB,GAAG,EAAE,KAAK;aACV,UAAU,EAAE,YAAY;aACxB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;aAOtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;aAEvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,4BAA4B,CAAC,CAAC"}