@playcademy/sdk 0.0.8 → 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/dist/index.d.ts +829 -75
- package/dist/index.js +660 -240
- package/dist/server.d.ts +309 -16
- package/dist/server.js +321 -5
- package/dist/types.d.ts +991 -253
- package/package.json +13 -10
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { InferSelectModel } from 'drizzle-orm';
|
|
1
2
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
3
|
import * as drizzle_zod from 'drizzle-zod';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import * as _playcademy_realtime_server_types from '@playcademy/realtime/server/types';
|
|
6
|
+
import { OrganizationConfig, CourseConfig, ComponentConfig, ResourceConfig, ComponentResourceConfig } from '@playcademy/timeback/types';
|
|
5
7
|
|
|
6
8
|
declare const userRoleEnum: drizzle_orm_pg_core.PgEnum<["admin", "player", "developer"]>;
|
|
7
9
|
declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
@@ -216,101 +218,6 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
216
218
|
dialect: "pg";
|
|
217
219
|
}>;
|
|
218
220
|
|
|
219
|
-
declare const developerKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
220
|
-
name: "developer_keys";
|
|
221
|
-
schema: undefined;
|
|
222
|
-
columns: {
|
|
223
|
-
id: drizzle_orm_pg_core.PgColumn<{
|
|
224
|
-
name: "id";
|
|
225
|
-
tableName: "developer_keys";
|
|
226
|
-
dataType: "string";
|
|
227
|
-
columnType: "PgUUID";
|
|
228
|
-
data: string;
|
|
229
|
-
driverParam: string;
|
|
230
|
-
notNull: true;
|
|
231
|
-
hasDefault: true;
|
|
232
|
-
isPrimaryKey: true;
|
|
233
|
-
isAutoincrement: false;
|
|
234
|
-
hasRuntimeDefault: false;
|
|
235
|
-
enumValues: undefined;
|
|
236
|
-
baseColumn: never;
|
|
237
|
-
identity: undefined;
|
|
238
|
-
generated: undefined;
|
|
239
|
-
}, {}, {}>;
|
|
240
|
-
userId: drizzle_orm_pg_core.PgColumn<{
|
|
241
|
-
name: "user_id";
|
|
242
|
-
tableName: "developer_keys";
|
|
243
|
-
dataType: "string";
|
|
244
|
-
columnType: "PgText";
|
|
245
|
-
data: string;
|
|
246
|
-
driverParam: string;
|
|
247
|
-
notNull: true;
|
|
248
|
-
hasDefault: false;
|
|
249
|
-
isPrimaryKey: false;
|
|
250
|
-
isAutoincrement: false;
|
|
251
|
-
hasRuntimeDefault: false;
|
|
252
|
-
enumValues: [string, ...string[]];
|
|
253
|
-
baseColumn: never;
|
|
254
|
-
identity: undefined;
|
|
255
|
-
generated: undefined;
|
|
256
|
-
}, {}, {}>;
|
|
257
|
-
label: drizzle_orm_pg_core.PgColumn<{
|
|
258
|
-
name: "label";
|
|
259
|
-
tableName: "developer_keys";
|
|
260
|
-
dataType: "string";
|
|
261
|
-
columnType: "PgVarchar";
|
|
262
|
-
data: string;
|
|
263
|
-
driverParam: string;
|
|
264
|
-
notNull: false;
|
|
265
|
-
hasDefault: false;
|
|
266
|
-
isPrimaryKey: false;
|
|
267
|
-
isAutoincrement: false;
|
|
268
|
-
hasRuntimeDefault: false;
|
|
269
|
-
enumValues: [string, ...string[]];
|
|
270
|
-
baseColumn: never;
|
|
271
|
-
identity: undefined;
|
|
272
|
-
generated: undefined;
|
|
273
|
-
}, {}, {
|
|
274
|
-
length: 255;
|
|
275
|
-
}>;
|
|
276
|
-
keyHash: drizzle_orm_pg_core.PgColumn<{
|
|
277
|
-
name: "key_hash";
|
|
278
|
-
tableName: "developer_keys";
|
|
279
|
-
dataType: "string";
|
|
280
|
-
columnType: "PgText";
|
|
281
|
-
data: string;
|
|
282
|
-
driverParam: string;
|
|
283
|
-
notNull: true;
|
|
284
|
-
hasDefault: false;
|
|
285
|
-
isPrimaryKey: false;
|
|
286
|
-
isAutoincrement: false;
|
|
287
|
-
hasRuntimeDefault: false;
|
|
288
|
-
enumValues: [string, ...string[]];
|
|
289
|
-
baseColumn: never;
|
|
290
|
-
identity: undefined;
|
|
291
|
-
generated: undefined;
|
|
292
|
-
}, {}, {}>;
|
|
293
|
-
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
294
|
-
name: "created_at";
|
|
295
|
-
tableName: "developer_keys";
|
|
296
|
-
dataType: "date";
|
|
297
|
-
columnType: "PgTimestamp";
|
|
298
|
-
data: Date;
|
|
299
|
-
driverParam: string;
|
|
300
|
-
notNull: true;
|
|
301
|
-
hasDefault: true;
|
|
302
|
-
isPrimaryKey: false;
|
|
303
|
-
isAutoincrement: false;
|
|
304
|
-
hasRuntimeDefault: false;
|
|
305
|
-
enumValues: undefined;
|
|
306
|
-
baseColumn: never;
|
|
307
|
-
identity: undefined;
|
|
308
|
-
generated: undefined;
|
|
309
|
-
}, {}, {}>;
|
|
310
|
-
};
|
|
311
|
-
dialect: "pg";
|
|
312
|
-
}>;
|
|
313
|
-
|
|
314
221
|
type GameMetadata = {
|
|
315
222
|
description?: string;
|
|
316
223
|
emoji?: string;
|
|
@@ -2393,8 +2300,117 @@ declare const playerCharacterAccessories: drizzle_orm_pg_core.PgTableWithColumns
|
|
|
2393
2300
|
};
|
|
2394
2301
|
dialect: "pg";
|
|
2395
2302
|
}>;
|
|
2303
|
+
declare const gameTimebackIntegrations: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2304
|
+
name: "game_timeback_integrations";
|
|
2305
|
+
schema: undefined;
|
|
2306
|
+
columns: {
|
|
2307
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
2308
|
+
name: "id";
|
|
2309
|
+
tableName: "game_timeback_integrations";
|
|
2310
|
+
dataType: "string";
|
|
2311
|
+
columnType: "PgUUID";
|
|
2312
|
+
data: string;
|
|
2313
|
+
driverParam: string;
|
|
2314
|
+
notNull: true;
|
|
2315
|
+
hasDefault: true;
|
|
2316
|
+
isPrimaryKey: true;
|
|
2317
|
+
isAutoincrement: false;
|
|
2318
|
+
hasRuntimeDefault: false;
|
|
2319
|
+
enumValues: undefined;
|
|
2320
|
+
baseColumn: never;
|
|
2321
|
+
identity: undefined;
|
|
2322
|
+
generated: undefined;
|
|
2323
|
+
}, {}, {}>;
|
|
2324
|
+
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
2325
|
+
name: "game_id";
|
|
2326
|
+
tableName: "game_timeback_integrations";
|
|
2327
|
+
dataType: "string";
|
|
2328
|
+
columnType: "PgUUID";
|
|
2329
|
+
data: string;
|
|
2330
|
+
driverParam: string;
|
|
2331
|
+
notNull: true;
|
|
2332
|
+
hasDefault: false;
|
|
2333
|
+
isPrimaryKey: false;
|
|
2334
|
+
isAutoincrement: false;
|
|
2335
|
+
hasRuntimeDefault: false;
|
|
2336
|
+
enumValues: undefined;
|
|
2337
|
+
baseColumn: never;
|
|
2338
|
+
identity: undefined;
|
|
2339
|
+
generated: undefined;
|
|
2340
|
+
}, {}, {}>;
|
|
2341
|
+
courseId: drizzle_orm_pg_core.PgColumn<{
|
|
2342
|
+
name: "course_id";
|
|
2343
|
+
tableName: "game_timeback_integrations";
|
|
2344
|
+
dataType: "string";
|
|
2345
|
+
columnType: "PgText";
|
|
2346
|
+
data: string;
|
|
2347
|
+
driverParam: string;
|
|
2348
|
+
notNull: true;
|
|
2349
|
+
hasDefault: false;
|
|
2350
|
+
isPrimaryKey: false;
|
|
2351
|
+
isAutoincrement: false;
|
|
2352
|
+
hasRuntimeDefault: false;
|
|
2353
|
+
enumValues: [string, ...string[]];
|
|
2354
|
+
baseColumn: never;
|
|
2355
|
+
identity: undefined;
|
|
2356
|
+
generated: undefined;
|
|
2357
|
+
}, {}, {}>;
|
|
2358
|
+
lastVerifiedAt: drizzle_orm_pg_core.PgColumn<{
|
|
2359
|
+
name: "last_verified_at";
|
|
2360
|
+
tableName: "game_timeback_integrations";
|
|
2361
|
+
dataType: "date";
|
|
2362
|
+
columnType: "PgTimestamp";
|
|
2363
|
+
data: Date;
|
|
2364
|
+
driverParam: string;
|
|
2365
|
+
notNull: false;
|
|
2366
|
+
hasDefault: false;
|
|
2367
|
+
isPrimaryKey: false;
|
|
2368
|
+
isAutoincrement: false;
|
|
2369
|
+
hasRuntimeDefault: false;
|
|
2370
|
+
enumValues: undefined;
|
|
2371
|
+
baseColumn: never;
|
|
2372
|
+
identity: undefined;
|
|
2373
|
+
generated: undefined;
|
|
2374
|
+
}, {}, {}>;
|
|
2375
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
2376
|
+
name: "created_at";
|
|
2377
|
+
tableName: "game_timeback_integrations";
|
|
2378
|
+
dataType: "date";
|
|
2379
|
+
columnType: "PgTimestamp";
|
|
2380
|
+
data: Date;
|
|
2381
|
+
driverParam: string;
|
|
2382
|
+
notNull: true;
|
|
2383
|
+
hasDefault: true;
|
|
2384
|
+
isPrimaryKey: false;
|
|
2385
|
+
isAutoincrement: false;
|
|
2386
|
+
hasRuntimeDefault: false;
|
|
2387
|
+
enumValues: undefined;
|
|
2388
|
+
baseColumn: never;
|
|
2389
|
+
identity: undefined;
|
|
2390
|
+
generated: undefined;
|
|
2391
|
+
}, {}, {}>;
|
|
2392
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
2393
|
+
name: "updated_at";
|
|
2394
|
+
tableName: "game_timeback_integrations";
|
|
2395
|
+
dataType: "date";
|
|
2396
|
+
columnType: "PgTimestamp";
|
|
2397
|
+
data: Date;
|
|
2398
|
+
driverParam: string;
|
|
2399
|
+
notNull: true;
|
|
2400
|
+
hasDefault: true;
|
|
2401
|
+
isPrimaryKey: false;
|
|
2402
|
+
isAutoincrement: false;
|
|
2403
|
+
hasRuntimeDefault: false;
|
|
2404
|
+
enumValues: undefined;
|
|
2405
|
+
baseColumn: never;
|
|
2406
|
+
identity: undefined;
|
|
2407
|
+
generated: undefined;
|
|
2408
|
+
}, {}, {}>;
|
|
2409
|
+
};
|
|
2410
|
+
dialect: "pg";
|
|
2411
|
+
}>;
|
|
2396
2412
|
|
|
2397
|
-
declare const
|
|
2413
|
+
declare const achievementScopeEnum: drizzle_orm_pg_core.PgEnum<["daily", "weekly", "monthly", "yearly", "game", "global", "map", "level", "event"]>;
|
|
2398
2414
|
declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2399
2415
|
name: "achievements";
|
|
2400
2416
|
schema: undefined;
|
|
@@ -2454,19 +2470,19 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2454
2470
|
identity: undefined;
|
|
2455
2471
|
generated: undefined;
|
|
2456
2472
|
}, {}, {}>;
|
|
2457
|
-
|
|
2458
|
-
name: "
|
|
2473
|
+
scope: drizzle_orm_pg_core.PgColumn<{
|
|
2474
|
+
name: "scope";
|
|
2459
2475
|
tableName: "achievements";
|
|
2460
2476
|
dataType: "string";
|
|
2461
2477
|
columnType: "PgEnumColumn";
|
|
2462
|
-
data: "daily" | "weekly";
|
|
2478
|
+
data: "map" | "game" | "level" | "daily" | "weekly" | "monthly" | "yearly" | "global" | "event";
|
|
2463
2479
|
driverParam: string;
|
|
2464
2480
|
notNull: true;
|
|
2465
2481
|
hasDefault: false;
|
|
2466
2482
|
isPrimaryKey: false;
|
|
2467
2483
|
isAutoincrement: false;
|
|
2468
2484
|
hasRuntimeDefault: false;
|
|
2469
|
-
enumValues: ["daily", "weekly"];
|
|
2485
|
+
enumValues: ["daily", "weekly", "monthly", "yearly", "game", "global", "map", "level", "event"];
|
|
2470
2486
|
baseColumn: never;
|
|
2471
2487
|
identity: undefined;
|
|
2472
2488
|
generated: undefined;
|
|
@@ -2488,8 +2504,8 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2488
2504
|
identity: undefined;
|
|
2489
2505
|
generated: undefined;
|
|
2490
2506
|
}, {}, {}>;
|
|
2491
|
-
|
|
2492
|
-
name: "
|
|
2507
|
+
limit: drizzle_orm_pg_core.PgColumn<{
|
|
2508
|
+
name: "limit";
|
|
2493
2509
|
tableName: "achievements";
|
|
2494
2510
|
dataType: "number";
|
|
2495
2511
|
columnType: "PgInteger";
|
|
@@ -2541,8 +2557,8 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2541
2557
|
identity: undefined;
|
|
2542
2558
|
generated: undefined;
|
|
2543
2559
|
}, {}, {}>;
|
|
2544
|
-
|
|
2545
|
-
name: "
|
|
2560
|
+
target: drizzle_orm_pg_core.PgColumn<{
|
|
2561
|
+
name: "target";
|
|
2546
2562
|
tableName: "achievements";
|
|
2547
2563
|
dataType: "json";
|
|
2548
2564
|
columnType: "PgJsonb";
|
|
@@ -2612,77 +2628,362 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2612
2628
|
};
|
|
2613
2629
|
dialect: "pg";
|
|
2614
2630
|
}>;
|
|
2615
|
-
declare const
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2631
|
+
declare const notifications: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2632
|
+
name: "notifications";
|
|
2633
|
+
schema: undefined;
|
|
2634
|
+
columns: {
|
|
2635
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
2636
|
+
name: "id";
|
|
2637
|
+
tableName: "notifications";
|
|
2638
|
+
dataType: "string";
|
|
2639
|
+
columnType: "PgUUID";
|
|
2640
|
+
data: string;
|
|
2641
|
+
driverParam: string;
|
|
2642
|
+
notNull: true;
|
|
2643
|
+
hasDefault: true;
|
|
2644
|
+
isPrimaryKey: true;
|
|
2645
|
+
isAutoincrement: false;
|
|
2646
|
+
hasRuntimeDefault: false;
|
|
2647
|
+
enumValues: undefined;
|
|
2648
|
+
baseColumn: never;
|
|
2649
|
+
identity: undefined;
|
|
2650
|
+
generated: undefined;
|
|
2651
|
+
}, {}, {}>;
|
|
2652
|
+
userId: drizzle_orm_pg_core.PgColumn<{
|
|
2653
|
+
name: "user_id";
|
|
2654
|
+
tableName: "notifications";
|
|
2655
|
+
dataType: "string";
|
|
2656
|
+
columnType: "PgText";
|
|
2657
|
+
data: string;
|
|
2658
|
+
driverParam: string;
|
|
2659
|
+
notNull: true;
|
|
2660
|
+
hasDefault: false;
|
|
2661
|
+
isPrimaryKey: false;
|
|
2662
|
+
isAutoincrement: false;
|
|
2663
|
+
hasRuntimeDefault: false;
|
|
2664
|
+
enumValues: [string, ...string[]];
|
|
2665
|
+
baseColumn: never;
|
|
2666
|
+
identity: undefined;
|
|
2667
|
+
generated: undefined;
|
|
2668
|
+
}, {}, {}>;
|
|
2669
|
+
type: drizzle_orm_pg_core.PgColumn<{
|
|
2670
|
+
name: "type";
|
|
2671
|
+
tableName: "notifications";
|
|
2672
|
+
dataType: "string";
|
|
2673
|
+
columnType: "PgVarchar";
|
|
2674
|
+
data: string;
|
|
2675
|
+
driverParam: string;
|
|
2676
|
+
notNull: true;
|
|
2677
|
+
hasDefault: false;
|
|
2678
|
+
isPrimaryKey: false;
|
|
2679
|
+
isAutoincrement: false;
|
|
2680
|
+
hasRuntimeDefault: false;
|
|
2681
|
+
enumValues: [string, ...string[]];
|
|
2682
|
+
baseColumn: never;
|
|
2683
|
+
identity: undefined;
|
|
2684
|
+
generated: undefined;
|
|
2685
|
+
}, {}, {
|
|
2686
|
+
length: 50;
|
|
2687
|
+
}>;
|
|
2688
|
+
title: drizzle_orm_pg_core.PgColumn<{
|
|
2689
|
+
name: "title";
|
|
2690
|
+
tableName: "notifications";
|
|
2691
|
+
dataType: "string";
|
|
2692
|
+
columnType: "PgVarchar";
|
|
2693
|
+
data: string;
|
|
2694
|
+
driverParam: string;
|
|
2695
|
+
notNull: true;
|
|
2696
|
+
hasDefault: false;
|
|
2697
|
+
isPrimaryKey: false;
|
|
2698
|
+
isAutoincrement: false;
|
|
2699
|
+
hasRuntimeDefault: false;
|
|
2700
|
+
enumValues: [string, ...string[]];
|
|
2701
|
+
baseColumn: never;
|
|
2702
|
+
identity: undefined;
|
|
2703
|
+
generated: undefined;
|
|
2704
|
+
}, {}, {
|
|
2705
|
+
length: 255;
|
|
2706
|
+
}>;
|
|
2707
|
+
message: drizzle_orm_pg_core.PgColumn<{
|
|
2708
|
+
name: "message";
|
|
2709
|
+
tableName: "notifications";
|
|
2710
|
+
dataType: "string";
|
|
2711
|
+
columnType: "PgText";
|
|
2712
|
+
data: string;
|
|
2713
|
+
driverParam: string;
|
|
2714
|
+
notNull: true;
|
|
2715
|
+
hasDefault: false;
|
|
2716
|
+
isPrimaryKey: false;
|
|
2717
|
+
isAutoincrement: false;
|
|
2718
|
+
hasRuntimeDefault: false;
|
|
2719
|
+
enumValues: [string, ...string[]];
|
|
2720
|
+
baseColumn: never;
|
|
2721
|
+
identity: undefined;
|
|
2722
|
+
generated: undefined;
|
|
2723
|
+
}, {}, {}>;
|
|
2724
|
+
data: drizzle_orm_pg_core.PgColumn<{
|
|
2725
|
+
name: "data";
|
|
2726
|
+
tableName: "notifications";
|
|
2727
|
+
dataType: "json";
|
|
2728
|
+
columnType: "PgJsonb";
|
|
2729
|
+
data: unknown;
|
|
2730
|
+
driverParam: unknown;
|
|
2731
|
+
notNull: true;
|
|
2732
|
+
hasDefault: true;
|
|
2733
|
+
isPrimaryKey: false;
|
|
2734
|
+
isAutoincrement: false;
|
|
2735
|
+
hasRuntimeDefault: false;
|
|
2736
|
+
enumValues: undefined;
|
|
2737
|
+
baseColumn: never;
|
|
2738
|
+
identity: undefined;
|
|
2739
|
+
generated: undefined;
|
|
2740
|
+
}, {}, {}>;
|
|
2741
|
+
priority: drizzle_orm_pg_core.PgColumn<{
|
|
2742
|
+
name: "priority";
|
|
2743
|
+
tableName: "notifications";
|
|
2744
|
+
dataType: "string";
|
|
2745
|
+
columnType: "PgEnumColumn";
|
|
2746
|
+
data: "low" | "normal" | "high" | "urgent";
|
|
2747
|
+
driverParam: string;
|
|
2748
|
+
notNull: true;
|
|
2749
|
+
hasDefault: true;
|
|
2750
|
+
isPrimaryKey: false;
|
|
2751
|
+
isAutoincrement: false;
|
|
2752
|
+
hasRuntimeDefault: false;
|
|
2753
|
+
enumValues: ["low", "normal", "high", "urgent"];
|
|
2754
|
+
baseColumn: never;
|
|
2755
|
+
identity: undefined;
|
|
2756
|
+
generated: undefined;
|
|
2757
|
+
}, {}, {}>;
|
|
2758
|
+
status: drizzle_orm_pg_core.PgColumn<{
|
|
2759
|
+
name: "status";
|
|
2760
|
+
tableName: "notifications";
|
|
2761
|
+
dataType: "string";
|
|
2762
|
+
columnType: "PgEnumColumn";
|
|
2763
|
+
data: "pending" | "delivered" | "seen" | "clicked" | "dismissed" | "expired";
|
|
2764
|
+
driverParam: string;
|
|
2765
|
+
notNull: true;
|
|
2766
|
+
hasDefault: true;
|
|
2767
|
+
isPrimaryKey: false;
|
|
2768
|
+
isAutoincrement: false;
|
|
2769
|
+
hasRuntimeDefault: false;
|
|
2770
|
+
enumValues: ["pending", "delivered", "seen", "clicked", "dismissed", "expired"];
|
|
2771
|
+
baseColumn: never;
|
|
2772
|
+
identity: undefined;
|
|
2773
|
+
generated: undefined;
|
|
2774
|
+
}, {}, {}>;
|
|
2775
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
2776
|
+
name: "created_at";
|
|
2777
|
+
tableName: "notifications";
|
|
2778
|
+
dataType: "date";
|
|
2779
|
+
columnType: "PgTimestamp";
|
|
2780
|
+
data: Date;
|
|
2781
|
+
driverParam: string;
|
|
2782
|
+
notNull: true;
|
|
2783
|
+
hasDefault: true;
|
|
2784
|
+
isPrimaryKey: false;
|
|
2785
|
+
isAutoincrement: false;
|
|
2786
|
+
hasRuntimeDefault: false;
|
|
2787
|
+
enumValues: undefined;
|
|
2788
|
+
baseColumn: never;
|
|
2789
|
+
identity: undefined;
|
|
2790
|
+
generated: undefined;
|
|
2791
|
+
}, {}, {}>;
|
|
2792
|
+
deliveredAt: drizzle_orm_pg_core.PgColumn<{
|
|
2793
|
+
name: "delivered_at";
|
|
2794
|
+
tableName: "notifications";
|
|
2795
|
+
dataType: "date";
|
|
2796
|
+
columnType: "PgTimestamp";
|
|
2797
|
+
data: Date;
|
|
2798
|
+
driverParam: string;
|
|
2799
|
+
notNull: false;
|
|
2800
|
+
hasDefault: false;
|
|
2801
|
+
isPrimaryKey: false;
|
|
2802
|
+
isAutoincrement: false;
|
|
2803
|
+
hasRuntimeDefault: false;
|
|
2804
|
+
enumValues: undefined;
|
|
2805
|
+
baseColumn: never;
|
|
2806
|
+
identity: undefined;
|
|
2807
|
+
generated: undefined;
|
|
2808
|
+
}, {}, {}>;
|
|
2809
|
+
seenAt: drizzle_orm_pg_core.PgColumn<{
|
|
2810
|
+
name: "seen_at";
|
|
2811
|
+
tableName: "notifications";
|
|
2812
|
+
dataType: "date";
|
|
2813
|
+
columnType: "PgTimestamp";
|
|
2814
|
+
data: Date;
|
|
2815
|
+
driverParam: string;
|
|
2816
|
+
notNull: false;
|
|
2817
|
+
hasDefault: false;
|
|
2818
|
+
isPrimaryKey: false;
|
|
2819
|
+
isAutoincrement: false;
|
|
2820
|
+
hasRuntimeDefault: false;
|
|
2821
|
+
enumValues: undefined;
|
|
2822
|
+
baseColumn: never;
|
|
2823
|
+
identity: undefined;
|
|
2824
|
+
generated: undefined;
|
|
2825
|
+
}, {}, {}>;
|
|
2826
|
+
clickedAt: drizzle_orm_pg_core.PgColumn<{
|
|
2827
|
+
name: "clicked_at";
|
|
2828
|
+
tableName: "notifications";
|
|
2829
|
+
dataType: "date";
|
|
2830
|
+
columnType: "PgTimestamp";
|
|
2831
|
+
data: Date;
|
|
2832
|
+
driverParam: string;
|
|
2833
|
+
notNull: false;
|
|
2834
|
+
hasDefault: false;
|
|
2835
|
+
isPrimaryKey: false;
|
|
2836
|
+
isAutoincrement: false;
|
|
2837
|
+
hasRuntimeDefault: false;
|
|
2838
|
+
enumValues: undefined;
|
|
2839
|
+
baseColumn: never;
|
|
2840
|
+
identity: undefined;
|
|
2841
|
+
generated: undefined;
|
|
2842
|
+
}, {}, {}>;
|
|
2843
|
+
expiresAt: drizzle_orm_pg_core.PgColumn<{
|
|
2844
|
+
name: "expires_at";
|
|
2845
|
+
tableName: "notifications";
|
|
2846
|
+
dataType: "date";
|
|
2847
|
+
columnType: "PgTimestamp";
|
|
2848
|
+
data: Date;
|
|
2849
|
+
driverParam: string;
|
|
2850
|
+
notNull: false;
|
|
2851
|
+
hasDefault: false;
|
|
2852
|
+
isPrimaryKey: false;
|
|
2853
|
+
isAutoincrement: false;
|
|
2854
|
+
hasRuntimeDefault: false;
|
|
2855
|
+
enumValues: undefined;
|
|
2856
|
+
baseColumn: never;
|
|
2857
|
+
identity: undefined;
|
|
2858
|
+
generated: undefined;
|
|
2859
|
+
}, {}, {}>;
|
|
2860
|
+
method: drizzle_orm_pg_core.PgColumn<{
|
|
2861
|
+
name: "method";
|
|
2862
|
+
tableName: "notifications";
|
|
2863
|
+
dataType: "string";
|
|
2864
|
+
columnType: "PgVarchar";
|
|
2865
|
+
data: string;
|
|
2866
|
+
driverParam: string;
|
|
2867
|
+
notNull: false;
|
|
2868
|
+
hasDefault: false;
|
|
2869
|
+
isPrimaryKey: false;
|
|
2870
|
+
isAutoincrement: false;
|
|
2871
|
+
hasRuntimeDefault: false;
|
|
2872
|
+
enumValues: [string, ...string[]];
|
|
2873
|
+
baseColumn: never;
|
|
2874
|
+
identity: undefined;
|
|
2875
|
+
generated: undefined;
|
|
2876
|
+
}, {}, {
|
|
2877
|
+
length: 50;
|
|
2878
|
+
}>;
|
|
2879
|
+
clickUrl: drizzle_orm_pg_core.PgColumn<{
|
|
2880
|
+
name: "click_url";
|
|
2881
|
+
tableName: "notifications";
|
|
2882
|
+
dataType: "string";
|
|
2883
|
+
columnType: "PgText";
|
|
2884
|
+
data: string;
|
|
2885
|
+
driverParam: string;
|
|
2886
|
+
notNull: false;
|
|
2887
|
+
hasDefault: false;
|
|
2888
|
+
isPrimaryKey: false;
|
|
2889
|
+
isAutoincrement: false;
|
|
2890
|
+
hasRuntimeDefault: false;
|
|
2891
|
+
enumValues: [string, ...string[]];
|
|
2892
|
+
baseColumn: never;
|
|
2893
|
+
identity: undefined;
|
|
2894
|
+
generated: undefined;
|
|
2895
|
+
}, {}, {}>;
|
|
2896
|
+
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
2897
|
+
name: "metadata";
|
|
2898
|
+
tableName: "notifications";
|
|
2899
|
+
dataType: "json";
|
|
2900
|
+
columnType: "PgJsonb";
|
|
2901
|
+
data: unknown;
|
|
2902
|
+
driverParam: unknown;
|
|
2903
|
+
notNull: true;
|
|
2904
|
+
hasDefault: true;
|
|
2905
|
+
isPrimaryKey: false;
|
|
2906
|
+
isAutoincrement: false;
|
|
2907
|
+
hasRuntimeDefault: false;
|
|
2908
|
+
enumValues: undefined;
|
|
2909
|
+
baseColumn: never;
|
|
2910
|
+
identity: undefined;
|
|
2911
|
+
generated: undefined;
|
|
2912
|
+
}, {}, {}>;
|
|
2913
|
+
};
|
|
2914
|
+
dialect: "pg";
|
|
2915
|
+
}>;
|
|
2916
|
+
declare const DeveloperStatusResponseSchema: z.ZodObject<{
|
|
2917
|
+
status: z.ZodEnum<["none", "pending", "approved"]>;
|
|
2918
|
+
}, "strip", z.ZodTypeAny, {
|
|
2919
|
+
status: "none" | "pending" | "approved";
|
|
2920
|
+
}, {
|
|
2921
|
+
status: "none" | "pending" | "approved";
|
|
2922
|
+
}>;
|
|
2923
|
+
declare const UpsertGameMetadataSchema: z.ZodEffects<z.ZodObject<{
|
|
2924
|
+
displayName: z.ZodString;
|
|
2925
|
+
mapElementId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2926
|
+
platform: z.ZodEnum<["web", "godot", "unity"]>;
|
|
2927
|
+
metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
2928
|
+
gameType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["hosted", "external"]>>>;
|
|
2929
|
+
externalUrl: z.ZodOptional<z.ZodString>;
|
|
2930
|
+
}, "strip", z.ZodTypeAny, {
|
|
2931
|
+
displayName: string;
|
|
2932
|
+
gameType: "hosted" | "external";
|
|
2933
|
+
platform: "web" | "godot" | "unity";
|
|
2934
|
+
metadata: Record<string, unknown>;
|
|
2935
|
+
externalUrl?: string | undefined;
|
|
2936
|
+
mapElementId?: string | null | undefined;
|
|
2937
|
+
}, {
|
|
2938
|
+
displayName: string;
|
|
2939
|
+
platform: "web" | "godot" | "unity";
|
|
2940
|
+
gameType?: "hosted" | "external" | undefined;
|
|
2941
|
+
externalUrl?: string | undefined;
|
|
2942
|
+
mapElementId?: string | null | undefined;
|
|
2943
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2944
|
+
}>, {
|
|
2945
|
+
displayName: string;
|
|
2946
|
+
gameType: "hosted" | "external";
|
|
2947
|
+
platform: "web" | "godot" | "unity";
|
|
2948
|
+
metadata: Record<string, unknown>;
|
|
2949
|
+
externalUrl?: string | undefined;
|
|
2950
|
+
mapElementId?: string | null | undefined;
|
|
2951
|
+
}, {
|
|
2952
|
+
displayName: string;
|
|
2953
|
+
platform: "web" | "godot" | "unity";
|
|
2954
|
+
gameType?: "hosted" | "external" | undefined;
|
|
2955
|
+
externalUrl?: string | undefined;
|
|
2956
|
+
mapElementId?: string | null | undefined;
|
|
2957
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2958
|
+
}>;
|
|
2959
|
+
declare const ManifestV1Schema: z.ZodObject<{
|
|
2960
|
+
version: z.ZodString;
|
|
2961
|
+
bootMode: z.ZodEnum<["iframe", "module"]>;
|
|
2962
|
+
entryPoint: z.ZodEffects<z.ZodString, string, string>;
|
|
2963
|
+
/**
|
|
2964
|
+
* An array of relative paths to CSS stylesheets.
|
|
2965
|
+
* Currently, this property is ONLY utilized by the 'module' boot mode
|
|
2966
|
+
* (`apps/cademy/src/lib/loader/boot-module.ts`) to load external
|
|
2967
|
+
* stylesheets into the game's shadow DOM.
|
|
2968
|
+
*
|
|
2969
|
+
* This property is under review for potential deprecation and removal.
|
|
2970
|
+
* The 'module' boot mode itself has not yet seen significant adoption
|
|
2971
|
+
* or clear use-cases, and if support for module loading is removed in
|
|
2972
|
+
* the future, this 'styles' property would become obsolete.
|
|
2973
|
+
*
|
|
2974
|
+
* If module-based games need styling, alternative approaches might involve
|
|
2975
|
+
* bundling CSS within their JavaScript or managing style injection internally.
|
|
2976
|
+
*/
|
|
2977
|
+
styles: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodString, "many">>, string[] | undefined, string[] | undefined>;
|
|
2978
|
+
/**
|
|
2979
|
+
* Specifies the game or development platform.
|
|
2980
|
+
* Current values include 'web', 'godot', and 'unity'.
|
|
2981
|
+
* The default in the database is 'web'.
|
|
2982
|
+
*
|
|
2983
|
+
* IMPORTANT: This property is NOT CURRENTLY USED by the core loader
|
|
2984
|
+
* or runtime systems in any functional way. It is present in the manifest
|
|
2985
|
+
* but does not drive any specific behavior in `boot-iframe.ts` or
|
|
2986
|
+
* `boot-module.ts` beyond being a piece of metadata.
|
|
2686
2987
|
*
|
|
2687
2988
|
* Potential Future Uses (Speculative):
|
|
2688
2989
|
* - Analytics: Could be used to gather stats on platform popularity/usage.
|
|
@@ -3009,11 +3310,83 @@ declare const UpdateShopListingSchema: z.ZodObject<{
|
|
|
3009
3310
|
availableFrom?: Date | null | undefined;
|
|
3010
3311
|
availableUntil?: Date | null | undefined;
|
|
3011
3312
|
}>;
|
|
3313
|
+
|
|
3314
|
+
declare enum AchievementCompletionType {
|
|
3315
|
+
TIME_PLAYED_SESSION = "time_played_session",
|
|
3316
|
+
INTERACTION = "interaction",
|
|
3317
|
+
LEADERBOARD_RANK = "leaderboard_rank",
|
|
3318
|
+
FIRST_SCORE = "first_score",
|
|
3319
|
+
PERSONAL_BEST = "personal_best"
|
|
3320
|
+
}
|
|
3321
|
+
type AchievementScopeType = (typeof achievementScopeEnum.enumValues)[number];
|
|
3322
|
+
type Achievement = typeof achievements.$inferSelect;
|
|
3323
|
+
/**
|
|
3324
|
+
* Current-scope achievement with computed status and window metadata
|
|
3325
|
+
*/
|
|
3326
|
+
interface AchievementCurrent {
|
|
3327
|
+
id: string;
|
|
3328
|
+
title: string;
|
|
3329
|
+
description?: string | null;
|
|
3330
|
+
scope: AchievementScopeType;
|
|
3331
|
+
rewardCredits: number;
|
|
3332
|
+
limit: number;
|
|
3333
|
+
completionType: AchievementCompletionType;
|
|
3334
|
+
completionConfig: Record<string, unknown>;
|
|
3335
|
+
target: Record<string, unknown>;
|
|
3336
|
+
active: boolean;
|
|
3337
|
+
createdAt?: Date;
|
|
3338
|
+
updatedAt?: Date;
|
|
3339
|
+
status: 'available' | 'completed';
|
|
3340
|
+
scopeKey: string;
|
|
3341
|
+
windowStart: string;
|
|
3342
|
+
windowEnd: string;
|
|
3343
|
+
}
|
|
3012
3344
|
/**
|
|
3013
|
-
* Achievement
|
|
3345
|
+
* Achievement claim history entry
|
|
3346
|
+
* Used in GET /api/achievements/history
|
|
3014
3347
|
*/
|
|
3015
|
-
|
|
3016
|
-
|
|
3348
|
+
interface AchievementHistoryEntry {
|
|
3349
|
+
achievementId: string;
|
|
3350
|
+
title: string;
|
|
3351
|
+
rewardCredits: number;
|
|
3352
|
+
createdAt: string;
|
|
3353
|
+
scopeKey: string;
|
|
3354
|
+
}
|
|
3355
|
+
/**
|
|
3356
|
+
* Achievement progress submission response
|
|
3357
|
+
* Used in POST /api/achievements/progress
|
|
3358
|
+
*/
|
|
3359
|
+
interface AchievementProgressResponse {
|
|
3360
|
+
achievementId: string;
|
|
3361
|
+
status: 'completed' | 'already_completed';
|
|
3362
|
+
rewardCredits: number;
|
|
3363
|
+
scopeKey: string;
|
|
3364
|
+
createdAt: string;
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
declare enum NotificationType {
|
|
3368
|
+
ACHIEVEMENT = "achievement",
|
|
3369
|
+
SYSTEM = "system",
|
|
3370
|
+
PROMO = "promo"
|
|
3371
|
+
}
|
|
3372
|
+
declare enum NotificationStatus {
|
|
3373
|
+
PENDING = "pending",
|
|
3374
|
+
DELIVERED = "delivered",
|
|
3375
|
+
SEEN = "seen",
|
|
3376
|
+
CLICKED = "clicked",
|
|
3377
|
+
DISMISSED = "dismissed",
|
|
3378
|
+
EXPIRED = "expired"
|
|
3379
|
+
}
|
|
3380
|
+
type Notification = InferSelectModel<typeof notifications>;
|
|
3381
|
+
interface NotificationStats {
|
|
3382
|
+
total: number;
|
|
3383
|
+
delivered: number;
|
|
3384
|
+
seen: number;
|
|
3385
|
+
clicked: number;
|
|
3386
|
+
dismissed: number;
|
|
3387
|
+
expired: number;
|
|
3388
|
+
clickThroughRate: number;
|
|
3389
|
+
}
|
|
3017
3390
|
|
|
3018
3391
|
type CharacterComponent = typeof characterComponents.$inferSelect;
|
|
3019
3392
|
type PlayerCharacter = typeof playerCharacters.$inferSelect & {
|
|
@@ -3036,6 +3409,17 @@ type Game = HostedGame | ExternalGame;
|
|
|
3036
3409
|
type GameSession = typeof gameSessions.$inferSelect;
|
|
3037
3410
|
type GameStateData = Record<string, unknown>;
|
|
3038
3411
|
type UpsertGameMetadataInput = z.infer<typeof UpsertGameMetadataSchema>;
|
|
3412
|
+
/**
|
|
3413
|
+
* Response from backend deployment API
|
|
3414
|
+
*/
|
|
3415
|
+
interface BackendDeploymentResponse {
|
|
3416
|
+
/** Unique deployment ID */
|
|
3417
|
+
deploymentId: string;
|
|
3418
|
+
/** Backend API URL */
|
|
3419
|
+
url: string;
|
|
3420
|
+
/** Deployment timestamp */
|
|
3421
|
+
deployedAt: string;
|
|
3422
|
+
}
|
|
3039
3423
|
type Item = typeof items.$inferSelect;
|
|
3040
3424
|
type InventoryItem = typeof inventoryItems.$inferSelect;
|
|
3041
3425
|
type Currency = typeof currencies.$inferSelect;
|
|
@@ -3107,6 +3491,8 @@ interface UserInfo {
|
|
|
3107
3491
|
given_name?: string;
|
|
3108
3492
|
/** Optional family name (last name) */
|
|
3109
3493
|
family_name?: string;
|
|
3494
|
+
/** TimeBack student ID (if user has TimeBack integration) */
|
|
3495
|
+
timeback_id?: string;
|
|
3110
3496
|
/** Additional user attributes from the identity provider */
|
|
3111
3497
|
[key: string]: unknown;
|
|
3112
3498
|
}
|
|
@@ -3178,8 +3564,6 @@ interface GameLeaderboardEntry {
|
|
|
3178
3564
|
gameSlug: string;
|
|
3179
3565
|
}
|
|
3180
3566
|
|
|
3181
|
-
type DeveloperKey = typeof developerKeys.$inferSelect;
|
|
3182
|
-
|
|
3183
3567
|
type UserLevel = typeof userLevels.$inferSelect;
|
|
3184
3568
|
type LevelConfig = typeof levelConfigs.$inferSelect;
|
|
3185
3569
|
type UserLevelWithConfig = UserLevel & {
|
|
@@ -3307,6 +3691,7 @@ interface SpriteTemplateData {
|
|
|
3307
3691
|
};
|
|
3308
3692
|
};
|
|
3309
3693
|
}
|
|
3694
|
+
type GameTimebackIntegration = typeof gameTimebackIntegrations.$inferSelect;
|
|
3310
3695
|
type TodayXpResponse = {
|
|
3311
3696
|
xp: number;
|
|
3312
3697
|
date: string;
|
|
@@ -3320,50 +3705,158 @@ type XpHistoryResponse = {
|
|
|
3320
3705
|
xp: number;
|
|
3321
3706
|
}>;
|
|
3322
3707
|
};
|
|
3323
|
-
|
|
3324
|
-
type
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
}
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3708
|
+
type TimebackSubject = 'Reading' | 'Language' | 'Vocabulary' | 'Social Studies' | 'Writing' | 'Science' | 'FastMath' | 'Math' | 'None';
|
|
3709
|
+
type TimebackSetupRequest = {
|
|
3710
|
+
gameId: string;
|
|
3711
|
+
config: {
|
|
3712
|
+
organization: {
|
|
3713
|
+
name: string;
|
|
3714
|
+
type: string;
|
|
3715
|
+
identifier: string;
|
|
3716
|
+
};
|
|
3717
|
+
course: {
|
|
3718
|
+
title: string;
|
|
3719
|
+
subjects: string[];
|
|
3720
|
+
grades: number[];
|
|
3721
|
+
courseCode: string;
|
|
3722
|
+
level: string;
|
|
3723
|
+
gradingScheme: string;
|
|
3724
|
+
metadata?: Record<string, unknown>;
|
|
3725
|
+
};
|
|
3726
|
+
component: {
|
|
3727
|
+
title: string;
|
|
3728
|
+
sortOrder: number;
|
|
3729
|
+
prerequisites: string[];
|
|
3730
|
+
prerequisiteCriteria: string;
|
|
3731
|
+
};
|
|
3732
|
+
resource: {
|
|
3733
|
+
title: string;
|
|
3734
|
+
vendorResourceId: string;
|
|
3735
|
+
vendorId: string;
|
|
3736
|
+
applicationId: string;
|
|
3737
|
+
roles: string[];
|
|
3738
|
+
importance: string;
|
|
3739
|
+
metadata: {
|
|
3740
|
+
type?: string;
|
|
3741
|
+
launchUrl?: string;
|
|
3742
|
+
toolProvider?: string;
|
|
3743
|
+
instructionalMethod?: string;
|
|
3744
|
+
subject?: string;
|
|
3745
|
+
grades?: number[];
|
|
3746
|
+
language?: string;
|
|
3747
|
+
xp?: number;
|
|
3748
|
+
[key: string]: unknown;
|
|
3749
|
+
};
|
|
3750
|
+
};
|
|
3751
|
+
componentResource: {
|
|
3752
|
+
title: string;
|
|
3753
|
+
sortOrder: number;
|
|
3754
|
+
lessonType: string | null;
|
|
3755
|
+
};
|
|
3756
|
+
};
|
|
3757
|
+
verbose?: boolean;
|
|
3758
|
+
};
|
|
3759
|
+
type TimebackSetupResponse = {
|
|
3760
|
+
integration: GameTimebackIntegration;
|
|
3761
|
+
courseId: string;
|
|
3762
|
+
verbose?: {
|
|
3763
|
+
course: unknown;
|
|
3764
|
+
component: unknown;
|
|
3765
|
+
resource: unknown;
|
|
3766
|
+
componentResource: unknown;
|
|
3767
|
+
};
|
|
3768
|
+
};
|
|
3769
|
+
type TimebackVerifyResponse = {
|
|
3770
|
+
status: 'success' | 'error';
|
|
3771
|
+
integration: GameTimebackIntegration;
|
|
3772
|
+
resources: {
|
|
3773
|
+
course: {
|
|
3774
|
+
found: boolean;
|
|
3775
|
+
data?: unknown;
|
|
3776
|
+
};
|
|
3777
|
+
component: {
|
|
3778
|
+
found: boolean;
|
|
3779
|
+
data?: unknown;
|
|
3780
|
+
};
|
|
3781
|
+
resource: {
|
|
3782
|
+
found: boolean;
|
|
3783
|
+
data?: unknown;
|
|
3784
|
+
};
|
|
3785
|
+
componentResource: {
|
|
3786
|
+
found: boolean;
|
|
3787
|
+
data?: unknown;
|
|
3788
|
+
};
|
|
3789
|
+
};
|
|
3790
|
+
errors?: string[];
|
|
3791
|
+
};
|
|
3792
|
+
type RecordProgressRequest = {
|
|
3793
|
+
gameId: string;
|
|
3794
|
+
studentId: string;
|
|
3795
|
+
progressData: {
|
|
3796
|
+
sensorUrl?: string;
|
|
3797
|
+
subject?: TimebackSubject;
|
|
3798
|
+
appName?: string;
|
|
3799
|
+
score?: number;
|
|
3800
|
+
totalQuestions?: number;
|
|
3801
|
+
correctQuestions?: number;
|
|
3802
|
+
xpEarned?: number;
|
|
3803
|
+
masteredUnits?: number;
|
|
3804
|
+
attemptNumber?: number;
|
|
3805
|
+
activityId?: string;
|
|
3806
|
+
activityName?: string;
|
|
3807
|
+
courseId?: string;
|
|
3808
|
+
classId?: string;
|
|
3809
|
+
courseName?: string;
|
|
3810
|
+
studentEmail?: string;
|
|
3811
|
+
};
|
|
3812
|
+
};
|
|
3813
|
+
type RecordProgressResponse = {
|
|
3814
|
+
status: 'ok';
|
|
3815
|
+
courseId: string;
|
|
3816
|
+
};
|
|
3817
|
+
type RecordSessionEndRequest = {
|
|
3818
|
+
gameId: string;
|
|
3819
|
+
studentId: string;
|
|
3820
|
+
sessionData: {
|
|
3821
|
+
sensorUrl?: string;
|
|
3822
|
+
subject?: TimebackSubject;
|
|
3823
|
+
appName?: string;
|
|
3824
|
+
activeTimeSeconds: number;
|
|
3825
|
+
inactiveTimeSeconds?: number;
|
|
3826
|
+
wasteTimeSeconds?: number;
|
|
3827
|
+
activityId?: string;
|
|
3828
|
+
activityName?: string;
|
|
3829
|
+
courseId?: string;
|
|
3830
|
+
courseName?: string;
|
|
3831
|
+
studentEmail?: string;
|
|
3832
|
+
};
|
|
3833
|
+
};
|
|
3834
|
+
type RecordSessionEndResponse = {
|
|
3835
|
+
status: 'ok';
|
|
3836
|
+
courseId: string;
|
|
3837
|
+
};
|
|
3838
|
+
type AwardXpRequest = {
|
|
3839
|
+
gameId: string;
|
|
3840
|
+
studentId: string;
|
|
3841
|
+
xpAmount: number;
|
|
3842
|
+
metadata: {
|
|
3843
|
+
sensorUrl: string;
|
|
3844
|
+
subject: TimebackSubject;
|
|
3845
|
+
appName: string;
|
|
3846
|
+
reason: string;
|
|
3847
|
+
activityId?: string;
|
|
3848
|
+
activityName?: string;
|
|
3849
|
+
courseId?: string;
|
|
3850
|
+
courseName?: string;
|
|
3851
|
+
studentEmail?: string;
|
|
3852
|
+
bonusType?: string;
|
|
3853
|
+
};
|
|
3854
|
+
};
|
|
3855
|
+
type AwardXpResponse = {
|
|
3856
|
+
status: 'ok';
|
|
3857
|
+
courseId: string;
|
|
3858
|
+
xpAwarded: number;
|
|
3859
|
+
};
|
|
3367
3860
|
|
|
3368
3861
|
declare const AuthProvider: {
|
|
3369
3862
|
readonly TIMEBACK: "TIMEBACK";
|
|
@@ -3454,6 +3947,144 @@ type XpSummaryResponse = {
|
|
|
3454
3947
|
total: TotalXpResponse;
|
|
3455
3948
|
};
|
|
3456
3949
|
|
|
3950
|
+
/**
|
|
3951
|
+
* @fileoverview Server SDK Type Definitions
|
|
3952
|
+
*
|
|
3953
|
+
* TypeScript type definitions for the server-side Playcademy SDK.
|
|
3954
|
+
* Includes configuration types, client state, and re-exported TimeBack types.
|
|
3955
|
+
*/
|
|
3956
|
+
|
|
3957
|
+
/**
|
|
3958
|
+
* TimeBack integration configuration for Playcademy config file
|
|
3959
|
+
*/
|
|
3960
|
+
interface TimebackIntegrationConfig {
|
|
3961
|
+
/** Organization overrides */
|
|
3962
|
+
organization?: Partial<OrganizationConfig>;
|
|
3963
|
+
/** Course configuration (subjects and grades REQUIRED) */
|
|
3964
|
+
course: CourseConfig;
|
|
3965
|
+
/** Component overrides */
|
|
3966
|
+
component?: Partial<ComponentConfig>;
|
|
3967
|
+
/** Resource overrides */
|
|
3968
|
+
resource?: Partial<ResourceConfig>;
|
|
3969
|
+
/** Component-Resource link overrides */
|
|
3970
|
+
componentResource?: Partial<ComponentResourceConfig>;
|
|
3971
|
+
}
|
|
3972
|
+
/**
|
|
3973
|
+
* Integrations configuration
|
|
3974
|
+
*/
|
|
3975
|
+
interface IntegrationsConfig {
|
|
3976
|
+
/** TimeBack integration (optional) */
|
|
3977
|
+
timeback?: TimebackIntegrationConfig;
|
|
3978
|
+
}
|
|
3979
|
+
/**
|
|
3980
|
+
* Unified Playcademy configuration
|
|
3981
|
+
* Used for playcademy.config.{js,json}
|
|
3982
|
+
*/
|
|
3983
|
+
interface PlaycademyConfig {
|
|
3984
|
+
/** Game name */
|
|
3985
|
+
name: string;
|
|
3986
|
+
/** Game description */
|
|
3987
|
+
description?: string;
|
|
3988
|
+
/** Game emoji icon */
|
|
3989
|
+
emoji?: string;
|
|
3990
|
+
/** Build command to run before deployment */
|
|
3991
|
+
buildCommand?: string[];
|
|
3992
|
+
/** Path to build output */
|
|
3993
|
+
buildPath?: string;
|
|
3994
|
+
/** Game type */
|
|
3995
|
+
gameType?: 'hosted' | 'external';
|
|
3996
|
+
/** External URL (for external games) */
|
|
3997
|
+
externalUrl?: string;
|
|
3998
|
+
/** Game platform */
|
|
3999
|
+
platform?: 'web' | 'unity' | 'godot';
|
|
4000
|
+
/** Backend configuration */
|
|
4001
|
+
backend?: {
|
|
4002
|
+
/** Custom API routes directory (defaults to 'api') */
|
|
4003
|
+
directory?: string;
|
|
4004
|
+
};
|
|
4005
|
+
/** External integrations */
|
|
4006
|
+
integrations?: IntegrationsConfig;
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
/**
|
|
4010
|
+
* Configuration options for initializing a PlaycademyClient instance.
|
|
4011
|
+
*
|
|
4012
|
+
* @example
|
|
4013
|
+
* ```typescript
|
|
4014
|
+
* const config: PlaycademyServerClientConfig = {
|
|
4015
|
+
* apiKey: process.env.PLAYCADEMY_API_KEY!,
|
|
4016
|
+
* gameId: 'my-math-game',
|
|
4017
|
+
* configPath: './playcademy.config.js'
|
|
4018
|
+
* }
|
|
4019
|
+
* ```
|
|
4020
|
+
*/
|
|
4021
|
+
interface PlaycademyServerClientConfig {
|
|
4022
|
+
/**
|
|
4023
|
+
* Playcademy API key for server-to-server authentication.
|
|
4024
|
+
* Obtain from the Playcademy developer dashboard.
|
|
4025
|
+
*/
|
|
4026
|
+
apiKey: string;
|
|
4027
|
+
/**
|
|
4028
|
+
* Optional path to playcademy.config.js file.
|
|
4029
|
+
* If not provided, searches current directory and up to 3 parent directories.
|
|
4030
|
+
* Ignored if `config` is provided directly.
|
|
4031
|
+
*
|
|
4032
|
+
* @example './config/playcademy.config.js'
|
|
4033
|
+
*/
|
|
4034
|
+
configPath?: string;
|
|
4035
|
+
/**
|
|
4036
|
+
* Optional config object (for edge environments without filesystem).
|
|
4037
|
+
* If provided, skips filesystem-based config loading.
|
|
4038
|
+
*
|
|
4039
|
+
* @example { name: 'My Game', integrations: { timeback: {...} } }
|
|
4040
|
+
*/
|
|
4041
|
+
config?: PlaycademyConfig;
|
|
4042
|
+
/**
|
|
4043
|
+
* Optional base URL for Playcademy API.
|
|
4044
|
+
* Defaults to environment variables or 'https://hub.playcademy.com'.
|
|
4045
|
+
*
|
|
4046
|
+
* @example 'http://localhost:3000' for local development
|
|
4047
|
+
*/
|
|
4048
|
+
baseUrl?: string;
|
|
4049
|
+
/**
|
|
4050
|
+
* Optional game ID.
|
|
4051
|
+
* If not provided, will attempt to fetch from API using the API token.
|
|
4052
|
+
*
|
|
4053
|
+
* @example 'my-math-game'
|
|
4054
|
+
*/
|
|
4055
|
+
gameId?: string;
|
|
4056
|
+
}
|
|
4057
|
+
/**
|
|
4058
|
+
* Internal state maintained by the PlaycademyClient instance.
|
|
4059
|
+
*
|
|
4060
|
+
* @internal
|
|
4061
|
+
*/
|
|
4062
|
+
interface PlaycademyServerClientState {
|
|
4063
|
+
/** API key for authentication */
|
|
4064
|
+
apiKey: string;
|
|
4065
|
+
/** Base URL for API requests */
|
|
4066
|
+
baseUrl: string;
|
|
4067
|
+
/** Game identifier */
|
|
4068
|
+
gameId: string;
|
|
4069
|
+
/** Loaded game configuration from playcademy.config.js */
|
|
4070
|
+
config: PlaycademyConfig;
|
|
4071
|
+
/**
|
|
4072
|
+
* TimeBack course ID fetched from the Playcademy API.
|
|
4073
|
+
* Used for all TimeBack event recording.
|
|
4074
|
+
*/
|
|
4075
|
+
courseId?: string;
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
/**
|
|
4079
|
+
* Backend deployment bundle for uploading to Playcademy platform
|
|
4080
|
+
*/
|
|
4081
|
+
interface BackendDeploymentBundle {
|
|
4082
|
+
/** Bundled JavaScript code ready for deployment */
|
|
4083
|
+
code: string;
|
|
4084
|
+
/** Game configuration */
|
|
4085
|
+
config: PlaycademyConfig;
|
|
4086
|
+
}
|
|
4087
|
+
|
|
3457
4088
|
interface UserScore {
|
|
3458
4089
|
id: string;
|
|
3459
4090
|
score: number;
|
|
@@ -3665,8 +4296,9 @@ type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
|
3665
4296
|
* Provides namespaced access to all platform features including games, users, inventory, and more.
|
|
3666
4297
|
*/
|
|
3667
4298
|
declare class PlaycademyClient {
|
|
3668
|
-
|
|
3669
|
-
|
|
4299
|
+
baseUrl: string;
|
|
4300
|
+
gameUrl?: string;
|
|
4301
|
+
private authStrategy;
|
|
3670
4302
|
private gameId?;
|
|
3671
4303
|
private config;
|
|
3672
4304
|
private listeners;
|
|
@@ -3677,8 +4309,9 @@ declare class PlaycademyClient {
|
|
|
3677
4309
|
* Creates a new PlaycademyClient instance.
|
|
3678
4310
|
*
|
|
3679
4311
|
* @param config - Optional configuration object
|
|
3680
|
-
* @param config.baseUrl - Base URL
|
|
4312
|
+
* @param config.baseUrl - Base URL (e.g., 'https://hub.playcademy.com' or '/'). SDK automatically appends /api
|
|
3681
4313
|
* @param config.token - Authentication token
|
|
4314
|
+
* @param config.tokenType - Optional token type (auto-detected if not provided)
|
|
3682
4315
|
* @param config.gameId - Game ID for automatic session management
|
|
3683
4316
|
* @param config.autoStartSession - Automatically start a game session?
|
|
3684
4317
|
*/
|
|
@@ -3686,10 +4319,19 @@ declare class PlaycademyClient {
|
|
|
3686
4319
|
/**
|
|
3687
4320
|
* Gets the effective base URL for API requests.
|
|
3688
4321
|
* Converts relative URLs to absolute URLs in browser environments.
|
|
4322
|
+
* Note: baseUrl already includes /api suffix from constructor.
|
|
3689
4323
|
*
|
|
3690
|
-
* @returns The complete base URL for API requests
|
|
4324
|
+
* @returns The complete base URL for API requests (with /api suffix)
|
|
3691
4325
|
*/
|
|
3692
4326
|
getBaseUrl(): string;
|
|
4327
|
+
/**
|
|
4328
|
+
* Gets the effective game backend URL for integration requests.
|
|
4329
|
+
* Throws if gameUrl is not configured.
|
|
4330
|
+
*
|
|
4331
|
+
* @returns The complete game backend URL for API requests (with /api suffix)
|
|
4332
|
+
* @throws PlaycademyError if gameUrl is not set
|
|
4333
|
+
*/
|
|
4334
|
+
private getGameBackendUrl;
|
|
3693
4335
|
/**
|
|
3694
4336
|
* Simple ping method for testing connectivity.
|
|
3695
4337
|
*
|
|
@@ -3701,8 +4343,15 @@ declare class PlaycademyClient {
|
|
|
3701
4343
|
* Emits an 'authChange' event when the token changes.
|
|
3702
4344
|
*
|
|
3703
4345
|
* @param token - The authentication token, or null to clear
|
|
4346
|
+
* @param tokenType - Optional token type (auto-detected if not provided)
|
|
4347
|
+
*/
|
|
4348
|
+
setToken(token: string | null, tokenType?: TokenType): void;
|
|
4349
|
+
/**
|
|
4350
|
+
* Gets the current token type.
|
|
4351
|
+
*
|
|
4352
|
+
* @returns The token type
|
|
3704
4353
|
*/
|
|
3705
|
-
|
|
4354
|
+
getTokenType(): TokenType;
|
|
3706
4355
|
/**
|
|
3707
4356
|
* Gets the current authentication token.
|
|
3708
4357
|
*
|
|
@@ -3770,7 +4419,7 @@ declare class PlaycademyClient {
|
|
|
3770
4419
|
*/
|
|
3771
4420
|
private emit;
|
|
3772
4421
|
/**
|
|
3773
|
-
* Makes an authenticated HTTP request to the API.
|
|
4422
|
+
* Makes an authenticated HTTP request to the platform API.
|
|
3774
4423
|
*
|
|
3775
4424
|
* @param path - API endpoint path
|
|
3776
4425
|
* @param method - HTTP method
|
|
@@ -3779,6 +4428,17 @@ declare class PlaycademyClient {
|
|
|
3779
4428
|
* @returns Promise resolving to the response data
|
|
3780
4429
|
*/
|
|
3781
4430
|
protected request<T>(path: string, method: Method, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
4431
|
+
/**
|
|
4432
|
+
* Makes an authenticated HTTP request to the game's backend Worker.
|
|
4433
|
+
* Uses gameUrl if set, otherwise falls back to platform API.
|
|
4434
|
+
*
|
|
4435
|
+
* @param path - API endpoint path
|
|
4436
|
+
* @param method - HTTP method
|
|
4437
|
+
* @param body - Request body (optional)
|
|
4438
|
+
* @param headers - Additional headers (optional)
|
|
4439
|
+
* @returns Promise resolving to the response data
|
|
4440
|
+
*/
|
|
4441
|
+
protected requestGameBackend<T>(path: string, method: Method, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
3782
4442
|
/**
|
|
3783
4443
|
* Ensures a gameId is available, throwing an error if not.
|
|
3784
4444
|
*
|
|
@@ -3807,9 +4467,23 @@ declare class PlaycademyClient {
|
|
|
3807
4467
|
}) => Promise<{
|
|
3808
4468
|
success: boolean;
|
|
3809
4469
|
token?: string;
|
|
4470
|
+
user?: {
|
|
4471
|
+
id: string;
|
|
4472
|
+
email: string;
|
|
4473
|
+
};
|
|
4474
|
+
expiresAt?: string;
|
|
3810
4475
|
error?: string;
|
|
3811
4476
|
}>;
|
|
3812
4477
|
logout: () => Promise<void>;
|
|
4478
|
+
apiKeys: {
|
|
4479
|
+
create: (options?: {
|
|
4480
|
+
name?: string;
|
|
4481
|
+
expiresIn?: number | null;
|
|
4482
|
+
permissions?: Record<string, string[]>;
|
|
4483
|
+
}) => Promise<BetterAuthApiKeyResponse>;
|
|
4484
|
+
list: () => Promise<BetterAuthApiKey[]>;
|
|
4485
|
+
revoke: (keyId: string) => Promise<void>;
|
|
4486
|
+
};
|
|
3813
4487
|
};
|
|
3814
4488
|
/** Identity provider connection methods (connect external accounts) */
|
|
3815
4489
|
identity: {
|
|
@@ -3860,7 +4534,7 @@ declare class PlaycademyClient {
|
|
|
3860
4534
|
};
|
|
3861
4535
|
leaderboard: {
|
|
3862
4536
|
get: (gameId: string, options?: {
|
|
3863
|
-
limit
|
|
4537
|
+
limit?: number;
|
|
3864
4538
|
offset?: number;
|
|
3865
4539
|
}) => Promise<LeaderboardEntry[]>;
|
|
3866
4540
|
};
|
|
@@ -3892,27 +4566,13 @@ declare class PlaycademyClient {
|
|
|
3892
4566
|
get: () => Promise<DeveloperStatusValue>;
|
|
3893
4567
|
};
|
|
3894
4568
|
games: {
|
|
3895
|
-
|
|
3896
|
-
|
|
4569
|
+
deploy: {
|
|
4570
|
+
frontend: (slug: string, metadata: UpsertGameMetadataInput, file: File | Blob | null, hooks?: DevUploadHooks) => Promise<Game>;
|
|
4571
|
+
backend: (slug: string, bundle: BackendDeploymentBundle) => Promise<BackendDeploymentResponse>;
|
|
4572
|
+
};
|
|
4573
|
+
upsert: (slug: string, metadata: UpsertGameMetadataInput) => Promise<Game>;
|
|
3897
4574
|
delete: (gameId: string) => Promise<void>;
|
|
3898
4575
|
};
|
|
3899
|
-
keys: {
|
|
3900
|
-
create: (label?: string) => Promise<{
|
|
3901
|
-
id: string;
|
|
3902
|
-
createdAt: Date;
|
|
3903
|
-
userId: string;
|
|
3904
|
-
label: string | null;
|
|
3905
|
-
keyHash: string;
|
|
3906
|
-
}>;
|
|
3907
|
-
list: () => Promise<{
|
|
3908
|
-
id: string;
|
|
3909
|
-
createdAt: Date;
|
|
3910
|
-
userId: string;
|
|
3911
|
-
label: string | null;
|
|
3912
|
-
keyHash: string;
|
|
3913
|
-
}[]>;
|
|
3914
|
-
revoke: (keyId: string) => Promise<void>;
|
|
3915
|
-
};
|
|
3916
4576
|
items: {
|
|
3917
4577
|
create: (gameId: string, slug: string, itemData: Omit<InsertItemInput, "slug" | "gameId">) => Promise<Item>;
|
|
3918
4578
|
update: (gameId: string, itemId: string, updates: UpdateItemInput) => Promise<Item>;
|
|
@@ -3932,8 +4592,8 @@ declare class PlaycademyClient {
|
|
|
3932
4592
|
};
|
|
3933
4593
|
/** Map methods (elements) */
|
|
3934
4594
|
maps: {
|
|
3935
|
-
get: (identifier: string) => Promise<MapData>;
|
|
3936
|
-
elements: (mapId: string) => Promise<MapElementWithGame[]>;
|
|
4595
|
+
get: (identifier: string, options?: TTLCacheConfig) => Promise<MapData>;
|
|
4596
|
+
elements: (mapId: string, options?: TTLCacheConfig) => Promise<MapElementWithGame[]>;
|
|
3937
4597
|
objects: {
|
|
3938
4598
|
list: (mapId: string) => Promise<MapObjectWithItem[]>;
|
|
3939
4599
|
create: (mapId: string, objectData: CreateMapObjectData) => Promise<MapObjectWithItem>;
|
|
@@ -4108,6 +4768,16 @@ declare class PlaycademyClient {
|
|
|
4108
4768
|
};
|
|
4109
4769
|
/** TimeBack XP methods (today, total, history) */
|
|
4110
4770
|
timeback: {
|
|
4771
|
+
recordProgress: (progressData: RecordProgressRequest["progressData"]) => Promise<RecordProgressResponse>;
|
|
4772
|
+
recordSessionEnd: (sessionData: RecordSessionEndRequest["sessionData"]) => Promise<RecordSessionEndResponse>;
|
|
4773
|
+
awardXP: (xpAmount: number, metadata: AwardXpRequest["metadata"]) => Promise<AwardXpResponse>;
|
|
4774
|
+
management: {
|
|
4775
|
+
setup: (request: TimebackSetupRequest) => Promise<TimebackSetupResponse>;
|
|
4776
|
+
verify: (gameId: string) => Promise<TimebackVerifyResponse>;
|
|
4777
|
+
cleanup: (gameId: string) => Promise<void>;
|
|
4778
|
+
get: (gameId: string) => Promise<GameTimebackIntegration | null>;
|
|
4779
|
+
getConfig: (gameId: string) => Promise<TimebackSetupRequest["config"]>;
|
|
4780
|
+
};
|
|
4111
4781
|
xp: {
|
|
4112
4782
|
today: (options?: {
|
|
4113
4783
|
date?: string;
|
|
@@ -4189,6 +4859,33 @@ declare class PlaycademyClient {
|
|
|
4189
4859
|
submit: (achievementId: string) => Promise<AchievementProgressResponse>;
|
|
4190
4860
|
};
|
|
4191
4861
|
};
|
|
4862
|
+
/** Notifications methods (list, update status, stats) */
|
|
4863
|
+
notifications: {
|
|
4864
|
+
list: (queryOptions?: {
|
|
4865
|
+
status?: NotificationStatus;
|
|
4866
|
+
type?: NotificationType;
|
|
4867
|
+
limit?: number;
|
|
4868
|
+
offset?: number;
|
|
4869
|
+
}, cacheOptions?: TTLCacheConfig) => Promise<Notification[]>;
|
|
4870
|
+
markAsSeen: (notificationId: string) => Promise<Notification>;
|
|
4871
|
+
markAsClicked: (notificationId: string) => Promise<Notification>;
|
|
4872
|
+
dismiss: (notificationId: string) => Promise<Notification>;
|
|
4873
|
+
stats: {
|
|
4874
|
+
get: (queryOptions?: {
|
|
4875
|
+
from?: string;
|
|
4876
|
+
to?: string;
|
|
4877
|
+
}, cacheOptions?: TTLCacheConfig) => Promise<NotificationStats>;
|
|
4878
|
+
};
|
|
4879
|
+
};
|
|
4880
|
+
/** Backend methods for calling custom game API routes */
|
|
4881
|
+
backend: {
|
|
4882
|
+
get<T = unknown>(path: string, headers?: Record<string, string>): Promise<T>;
|
|
4883
|
+
post<T = unknown>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
4884
|
+
put<T = unknown>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
4885
|
+
patch<T = unknown>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
4886
|
+
delete<T = unknown>(path: string, headers?: Record<string, string>): Promise<T>;
|
|
4887
|
+
request<T = unknown>(path: string, method: Method, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
4888
|
+
};
|
|
4192
4889
|
/** Auto-initializes a PlaycademyClient with context from the environment */
|
|
4193
4890
|
static init: typeof init;
|
|
4194
4891
|
/** Authenticates a user with email and password */
|
|
@@ -4199,14 +4896,18 @@ declare class PlaycademyClient {
|
|
|
4199
4896
|
};
|
|
4200
4897
|
}
|
|
4201
4898
|
|
|
4899
|
+
type TokenType = 'session' | 'apiKey' | 'gameJwt';
|
|
4202
4900
|
interface ClientConfig {
|
|
4203
4901
|
baseUrl: string;
|
|
4902
|
+
gameUrl?: string;
|
|
4204
4903
|
token?: string;
|
|
4904
|
+
tokenType?: TokenType;
|
|
4205
4905
|
gameId?: string;
|
|
4206
4906
|
autoStartSession?: boolean;
|
|
4207
4907
|
}
|
|
4208
4908
|
interface InitPayload {
|
|
4209
4909
|
baseUrl: string;
|
|
4910
|
+
gameUrl?: string;
|
|
4210
4911
|
token: string;
|
|
4211
4912
|
gameId: string;
|
|
4212
4913
|
realtimeUrl?: string;
|
|
@@ -4409,6 +5110,43 @@ type DevUploadHooks = {
|
|
|
4409
5110
|
onEvent?: (e: DevUploadEvent) => void;
|
|
4410
5111
|
onClose?: () => void;
|
|
4411
5112
|
};
|
|
5113
|
+
/**
|
|
5114
|
+
* Better-auth sign-in response
|
|
5115
|
+
*/
|
|
5116
|
+
interface BetterAuthSignInResponse {
|
|
5117
|
+
token: string;
|
|
5118
|
+
user: {
|
|
5119
|
+
id: string;
|
|
5120
|
+
email: string;
|
|
5121
|
+
};
|
|
5122
|
+
expiresAt: string;
|
|
5123
|
+
}
|
|
5124
|
+
/**
|
|
5125
|
+
* Better-auth API key creation response
|
|
5126
|
+
*/
|
|
5127
|
+
interface BetterAuthApiKeyResponse {
|
|
5128
|
+
apiKey: string;
|
|
5129
|
+
key: {
|
|
5130
|
+
id: string;
|
|
5131
|
+
name: string | null;
|
|
5132
|
+
expiresAt: string | null;
|
|
5133
|
+
createdAt: string;
|
|
5134
|
+
};
|
|
5135
|
+
}
|
|
5136
|
+
/**
|
|
5137
|
+
* Better-auth API key list item
|
|
5138
|
+
*/
|
|
5139
|
+
interface BetterAuthApiKey {
|
|
5140
|
+
id: string;
|
|
5141
|
+
name: string | null;
|
|
5142
|
+
start: string;
|
|
5143
|
+
enabled: boolean;
|
|
5144
|
+
expiresAt: string | null;
|
|
5145
|
+
createdAt: string;
|
|
5146
|
+
updatedAt: string;
|
|
5147
|
+
lastRequest: string | null;
|
|
5148
|
+
requestCount: number;
|
|
5149
|
+
}
|
|
4412
5150
|
|
|
4413
5151
|
export { PlaycademyClient };
|
|
4414
|
-
export type { Achievement, AchievementCurrent, AchievementProgressResponse, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, CharacterComponent, CharacterComponentWithSpriteUrl, ClientConfig, ClientEvents, Currency, DevUploadEvent, DevUploadHooks,
|
|
5152
|
+
export type { Achievement, AchievementCurrent, AchievementProgressResponse, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, CharacterComponent, CharacterComponentWithSpriteUrl, ClientConfig, ClientEvents, Currency, DevUploadEvent, DevUploadHooks, DeveloperStatusResponse, EventListeners, ExternalGame, Game, GameContextPayload, GameLeaderboardEntry, GameSession, GameStateData, GameTokenResponse, GameUser, HostedGame, HostedGameWithManifest, InitPayload, InventoryItem, InventoryItemWithItem, InventoryMutationResponse, Item, KeyEventPayload, LeaderboardEntry, LevelConfig, LoginResponse, ManifestV1, Map, MapElement, MapElementWithGame, MapObject, MapObjectWithItem, PlaycademyServerClientConfig, PlaycademyServerClientState, PlayerCharacter, ShopCurrency, ShopDisplayItem, ShopViewResponse, SpriteTemplate, SpriteTemplateData, StartSessionResponse, TelemetryPayload, TodayXpResponse, TokenRefreshPayload, TokenType, TotalXpResponse, User, UserInfo, UserLevel, UserLevelWithConfig, UserRank, UserRankResponse, UserRoleEnumType, UserScore$1 as UserScore, XpHistoryResponse };
|