@gbl-uzh/platform 0.4.10 → 0.4.12
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 +30 -0
- package/dist/index.js +28 -0
- package/dist/nexus.js +40 -0
- package/dist/ops/FSegmentData.graphql +2 -0
- package/dist/ops/MAddCountdown.graphql +3 -0
- package/dist/ops/QGame.graphql +6 -1
- package/dist/ops/QResult.graphql +1 -0
- package/dist/ops-b9a51fd0.d.ts +166 -0
- package/dist/schema.prisma +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ declare function loginAsTeam({ token }: LoginAsTeamArgs, ctx: CtxWithPrisma<Pris
|
|
|
122
122
|
}, unknown> & {})[];
|
|
123
123
|
} & _prisma_client_runtime.GetResult<{
|
|
124
124
|
id: string;
|
|
125
|
+
number: number;
|
|
125
126
|
name: string;
|
|
126
127
|
avatar: string;
|
|
127
128
|
location: string;
|
|
@@ -191,6 +192,7 @@ declare function createGame({ name, playerCount }: CreateGameArgs, ctx: Context$
|
|
|
191
192
|
}): Promise<{
|
|
192
193
|
players: (_prisma_client_runtime.GetResult<{
|
|
193
194
|
id: string;
|
|
195
|
+
number: number;
|
|
194
196
|
name: string;
|
|
195
197
|
avatar: string;
|
|
196
198
|
location: string;
|
|
@@ -262,6 +264,7 @@ declare function addGamePeriod<TFacts>({ gameId, facts }: AddGamePeriodArgs<TFac
|
|
|
262
264
|
id: number;
|
|
263
265
|
index: number;
|
|
264
266
|
facts: DB.Prisma.JsonValue;
|
|
267
|
+
countdownExpiresAt: Date | null;
|
|
265
268
|
periodId: number;
|
|
266
269
|
periodIx: number;
|
|
267
270
|
gameId: number;
|
|
@@ -312,6 +315,7 @@ declare function addPeriodSegment<TFacts>({ gameId, periodIx, facts, learningEle
|
|
|
312
315
|
id: number;
|
|
313
316
|
index: number;
|
|
314
317
|
facts: DB.Prisma.JsonValue;
|
|
318
|
+
countdownExpiresAt: Date | null;
|
|
315
319
|
periodId: number;
|
|
316
320
|
periodIx: number;
|
|
317
321
|
gameId: number;
|
|
@@ -328,6 +332,7 @@ declare function activateNextPeriod({ gameId }: ActivateNextPeriodArgs, ctx: Con
|
|
|
328
332
|
id: number;
|
|
329
333
|
index: number;
|
|
330
334
|
facts: DB.Prisma.JsonValue;
|
|
335
|
+
countdownExpiresAt: Date | null;
|
|
331
336
|
periodId: number;
|
|
332
337
|
periodIx: number;
|
|
333
338
|
gameId: number;
|
|
@@ -375,6 +380,7 @@ declare function activateNextSegment({ gameId }: ActivateSegmentArgs, ctx: Conte
|
|
|
375
380
|
id: number;
|
|
376
381
|
index: number;
|
|
377
382
|
facts: DB.Prisma.JsonValue;
|
|
383
|
+
countdownExpiresAt: Date | null;
|
|
378
384
|
periodId: number;
|
|
379
385
|
periodIx: number;
|
|
380
386
|
gameId: number;
|
|
@@ -395,6 +401,7 @@ declare function activateNextSegment({ gameId }: ActivateSegmentArgs, ctx: Conte
|
|
|
395
401
|
}, unknown> & {})[];
|
|
396
402
|
players: (_prisma_client_runtime.GetResult<{
|
|
397
403
|
id: string;
|
|
404
|
+
number: number;
|
|
398
405
|
name: string;
|
|
399
406
|
avatar: string;
|
|
400
407
|
location: string;
|
|
@@ -438,6 +445,7 @@ declare function activateNextSegment({ gameId }: ActivateSegmentArgs, ctx: Conte
|
|
|
438
445
|
id: number;
|
|
439
446
|
index: number;
|
|
440
447
|
facts: DB.Prisma.JsonValue;
|
|
448
|
+
countdownExpiresAt: Date | null;
|
|
441
449
|
periodId: number;
|
|
442
450
|
periodIx: number;
|
|
443
451
|
gameId: number;
|
|
@@ -450,6 +458,7 @@ declare function activateNextSegment({ gameId }: ActivateSegmentArgs, ctx: Conte
|
|
|
450
458
|
id: number;
|
|
451
459
|
index: number;
|
|
452
460
|
facts: DB.Prisma.JsonValue;
|
|
461
|
+
countdownExpiresAt: Date | null;
|
|
453
462
|
periodId: number;
|
|
454
463
|
periodIx: number;
|
|
455
464
|
gameId: number;
|
|
@@ -470,6 +479,7 @@ declare function activateNextSegment({ gameId }: ActivateSegmentArgs, ctx: Conte
|
|
|
470
479
|
}, unknown> & {})[];
|
|
471
480
|
players: (_prisma_client_runtime.GetResult<{
|
|
472
481
|
id: string;
|
|
482
|
+
number: number;
|
|
473
483
|
name: string;
|
|
474
484
|
avatar: string;
|
|
475
485
|
location: string;
|
|
@@ -517,6 +527,7 @@ declare function activateNextSegment({ gameId }: ActivateSegmentArgs, ctx: Conte
|
|
|
517
527
|
id: number;
|
|
518
528
|
index: number;
|
|
519
529
|
facts: DB.Prisma.JsonValue;
|
|
530
|
+
countdownExpiresAt: Date | null;
|
|
520
531
|
periodId: number;
|
|
521
532
|
periodIx: number;
|
|
522
533
|
gameId: number;
|
|
@@ -569,6 +580,7 @@ declare function updatePlayerData({ name, avatar, color, facts }: UpdatePlayerDa
|
|
|
569
580
|
}, unknown> & {})[];
|
|
570
581
|
} & _prisma_client_runtime.GetResult<{
|
|
571
582
|
id: string;
|
|
583
|
+
number: number;
|
|
572
584
|
name: string;
|
|
573
585
|
avatar: string;
|
|
574
586
|
location: string;
|
|
@@ -620,6 +632,7 @@ declare function getGame(args: any, ctx: Context$1): Promise<({
|
|
|
620
632
|
}, unknown> & {})[];
|
|
621
633
|
} & _prisma_client_runtime.GetResult<{
|
|
622
634
|
id: string;
|
|
635
|
+
number: number;
|
|
623
636
|
name: string;
|
|
624
637
|
avatar: string;
|
|
625
638
|
location: string;
|
|
@@ -666,6 +679,7 @@ declare function getGame(args: any, ctx: Context$1): Promise<({
|
|
|
666
679
|
id: number;
|
|
667
680
|
index: number;
|
|
668
681
|
facts: DB.Prisma.JsonValue;
|
|
682
|
+
countdownExpiresAt: Date | null;
|
|
669
683
|
periodId: number;
|
|
670
684
|
periodIx: number;
|
|
671
685
|
gameId: number;
|
|
@@ -689,6 +703,7 @@ declare function getGame(args: any, ctx: Context$1): Promise<({
|
|
|
689
703
|
id: number;
|
|
690
704
|
index: number;
|
|
691
705
|
facts: DB.Prisma.JsonValue;
|
|
706
|
+
countdownExpiresAt: Date | null;
|
|
692
707
|
periodId: number;
|
|
693
708
|
periodIx: number;
|
|
694
709
|
gameId: number;
|
|
@@ -700,6 +715,7 @@ declare function getGame(args: any, ctx: Context$1): Promise<({
|
|
|
700
715
|
id: number;
|
|
701
716
|
index: number;
|
|
702
717
|
facts: DB.Prisma.JsonValue;
|
|
718
|
+
countdownExpiresAt: Date | null;
|
|
703
719
|
periodId: number;
|
|
704
720
|
periodIx: number;
|
|
705
721
|
gameId: number;
|
|
@@ -924,6 +940,7 @@ declare function getPlayerResult(args: GetPlayerResultArgs, ctx: Context): Promi
|
|
|
924
940
|
id: number;
|
|
925
941
|
index: number;
|
|
926
942
|
facts: DB.Prisma.JsonValue;
|
|
943
|
+
countdownExpiresAt: Date | null;
|
|
927
944
|
periodId: number;
|
|
928
945
|
periodIx: number;
|
|
929
946
|
gameId: number;
|
|
@@ -956,6 +973,7 @@ declare function getPlayerResult(args: GetPlayerResultArgs, ctx: Context): Promi
|
|
|
956
973
|
id: number;
|
|
957
974
|
index: number;
|
|
958
975
|
facts: DB.Prisma.JsonValue;
|
|
976
|
+
countdownExpiresAt: Date | null;
|
|
959
977
|
periodId: number;
|
|
960
978
|
periodIx: number;
|
|
961
979
|
gameId: number;
|
|
@@ -1000,6 +1018,7 @@ declare function getPlayerResult(args: GetPlayerResultArgs, ctx: Context): Promi
|
|
|
1000
1018
|
id: number;
|
|
1001
1019
|
index: number;
|
|
1002
1020
|
facts: DB.Prisma.JsonValue;
|
|
1021
|
+
countdownExpiresAt: Date | null;
|
|
1003
1022
|
periodId: number;
|
|
1004
1023
|
periodIx: number;
|
|
1005
1024
|
gameId: number;
|
|
@@ -1063,6 +1082,7 @@ declare function getPlayerResult(args: GetPlayerResultArgs, ctx: Context): Promi
|
|
|
1063
1082
|
}, unknown> & {})[];
|
|
1064
1083
|
} & _prisma_client_runtime.GetResult<{
|
|
1065
1084
|
id: string;
|
|
1085
|
+
number: number;
|
|
1066
1086
|
name: string;
|
|
1067
1087
|
avatar: string;
|
|
1068
1088
|
location: string;
|
|
@@ -1112,6 +1132,7 @@ declare function getPlayerResult(args: GetPlayerResultArgs, ctx: Context): Promi
|
|
|
1112
1132
|
id: number;
|
|
1113
1133
|
index: number;
|
|
1114
1134
|
facts: DB.Prisma.JsonValue;
|
|
1135
|
+
countdownExpiresAt: Date | null;
|
|
1115
1136
|
periodId: number;
|
|
1116
1137
|
periodIx: number;
|
|
1117
1138
|
gameId: number;
|
|
@@ -1180,6 +1201,7 @@ declare function getPlayerData(args: GetPlayerDataArgs, ctx: Context): Promise<(
|
|
|
1180
1201
|
}, unknown> & {})[];
|
|
1181
1202
|
} & _prisma_client_runtime.GetResult<{
|
|
1182
1203
|
id: string;
|
|
1204
|
+
number: number;
|
|
1183
1205
|
name: string;
|
|
1184
1206
|
avatar: string;
|
|
1185
1207
|
location: string;
|
|
@@ -1244,6 +1266,7 @@ interface MarkStoryElementArgs {
|
|
|
1244
1266
|
}
|
|
1245
1267
|
declare function markStoryElement(args: MarkStoryElementArgs, ctx: Context): Promise<(_prisma_client_runtime.GetResult<{
|
|
1246
1268
|
id: string;
|
|
1269
|
+
number: number;
|
|
1247
1270
|
name: string;
|
|
1248
1271
|
avatar: string;
|
|
1249
1272
|
location: string;
|
|
@@ -1292,6 +1315,7 @@ declare function getPlayerResults(args: any, ctx: Context): Promise<({
|
|
|
1292
1315
|
}, unknown> & {};
|
|
1293
1316
|
player: _prisma_client_runtime.GetResult<{
|
|
1294
1317
|
id: string;
|
|
1318
|
+
number: number;
|
|
1295
1319
|
name: string;
|
|
1296
1320
|
avatar: string;
|
|
1297
1321
|
location: string;
|
|
@@ -1316,6 +1340,7 @@ declare function getPlayerResults(args: any, ctx: Context): Promise<({
|
|
|
1316
1340
|
id: number;
|
|
1317
1341
|
index: number;
|
|
1318
1342
|
facts: DB.Prisma.JsonValue;
|
|
1343
|
+
countdownExpiresAt: Date | null;
|
|
1319
1344
|
periodId: number;
|
|
1320
1345
|
periodIx: number;
|
|
1321
1346
|
gameId: number;
|
|
@@ -1358,6 +1383,7 @@ declare function getPastResults(args: any, ctx: Context): Promise<({
|
|
|
1358
1383
|
}, unknown> & {};
|
|
1359
1384
|
} & _prisma_client_runtime.GetResult<{
|
|
1360
1385
|
id: string;
|
|
1386
|
+
number: number;
|
|
1361
1387
|
name: string;
|
|
1362
1388
|
avatar: string;
|
|
1363
1389
|
location: string;
|
|
@@ -1393,6 +1419,7 @@ declare function getPastResults(args: any, ctx: Context): Promise<({
|
|
|
1393
1419
|
}, unknown> & {})[] | null>;
|
|
1394
1420
|
declare function updateReadyState(args: any, ctx: Context): Promise<_prisma_client_runtime.GetResult<{
|
|
1395
1421
|
id: string;
|
|
1422
|
+
number: number;
|
|
1396
1423
|
name: string;
|
|
1397
1424
|
avatar: string;
|
|
1398
1425
|
location: string;
|
|
@@ -1413,7 +1440,9 @@ declare function updateReadyState(args: any, ctx: Context): Promise<_prisma_clie
|
|
|
1413
1440
|
createdAt: Date;
|
|
1414
1441
|
updatedAt: Date;
|
|
1415
1442
|
}, unknown> & {}>;
|
|
1443
|
+
declare function addCountdown(args: any, ctx: Context): Promise<true | null>;
|
|
1416
1444
|
|
|
1445
|
+
declare const PlayService_addCountdown: typeof addCountdown;
|
|
1417
1446
|
declare const PlayService_attemptLearningElement: typeof attemptLearningElement;
|
|
1418
1447
|
declare const PlayService_getLearningElement: typeof getLearningElement;
|
|
1419
1448
|
declare const PlayService_getPastResults: typeof getPastResults;
|
|
@@ -1427,6 +1456,7 @@ declare const PlayService_saveDecisions: typeof saveDecisions;
|
|
|
1427
1456
|
declare const PlayService_updateReadyState: typeof updateReadyState;
|
|
1428
1457
|
declare namespace PlayService {
|
|
1429
1458
|
export {
|
|
1459
|
+
PlayService_addCountdown as addCountdown,
|
|
1430
1460
|
PlayService_attemptLearningElement as attemptLearningElement,
|
|
1431
1461
|
PlayService_getLearningElement as getLearningElement,
|
|
1432
1462
|
PlayService_getPastResults as getPastResults,
|
package/dist/index.js
CHANGED
|
@@ -397,6 +397,7 @@ async function createGame({ name, playerCount }, ctx, { roleAssigner }) {
|
|
|
397
397
|
facts: {},
|
|
398
398
|
token: (0, import_nanoid.nanoid)(),
|
|
399
399
|
role: roleAssigner(ix),
|
|
400
|
+
number: playerCount - ix,
|
|
400
401
|
name: `Team ${playerCount - ix}`,
|
|
401
402
|
level: {
|
|
402
403
|
connect: {
|
|
@@ -1087,6 +1088,9 @@ async function getGame(args, ctx) {
|
|
|
1087
1088
|
include: {
|
|
1088
1089
|
level: true,
|
|
1089
1090
|
achievements: true
|
|
1091
|
+
},
|
|
1092
|
+
orderBy: {
|
|
1093
|
+
number: "asc"
|
|
1090
1094
|
}
|
|
1091
1095
|
},
|
|
1092
1096
|
periods: {
|
|
@@ -1495,6 +1499,7 @@ function computeSegmentEndResults(game, ctx, { reducers }) {
|
|
|
1495
1499
|
// src/services/PlayService.ts
|
|
1496
1500
|
var PlayService_exports = {};
|
|
1497
1501
|
__export(PlayService_exports, {
|
|
1502
|
+
addCountdown: () => addCountdown,
|
|
1498
1503
|
attemptLearningElement: () => attemptLearningElement,
|
|
1499
1504
|
getLearningElement: () => getLearningElement,
|
|
1500
1505
|
getPastResults: () => getPastResults,
|
|
@@ -1970,6 +1975,29 @@ async function updateReadyState(args, ctx) {
|
|
|
1970
1975
|
}
|
|
1971
1976
|
});
|
|
1972
1977
|
}
|
|
1978
|
+
async function addCountdown(args, ctx) {
|
|
1979
|
+
const currentGame = await ctx.prisma.game.findUnique({
|
|
1980
|
+
where: { id: args.gameId },
|
|
1981
|
+
include: {
|
|
1982
|
+
activePeriod: {
|
|
1983
|
+
include: {
|
|
1984
|
+
activeSegment: true
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
});
|
|
1989
|
+
if (!currentGame?.activePeriod?.activeSegment)
|
|
1990
|
+
return null;
|
|
1991
|
+
await ctx.prisma.periodSegment.update({
|
|
1992
|
+
where: {
|
|
1993
|
+
id: currentGame.activePeriod.activeSegment.id
|
|
1994
|
+
},
|
|
1995
|
+
data: {
|
|
1996
|
+
countdownExpiresAt: new Date(Date.now() + args.seconds * 1e3)
|
|
1997
|
+
}
|
|
1998
|
+
});
|
|
1999
|
+
return true;
|
|
2000
|
+
}
|
|
1973
2001
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1974
2002
|
0 && (module.exports = {
|
|
1975
2003
|
AccountService,
|
package/dist/nexus.js
CHANGED
|
@@ -171,6 +171,7 @@ var Player = (0, import_nexus3.objectType)({
|
|
|
171
171
|
definition(t) {
|
|
172
172
|
t.nonNull.id("id");
|
|
173
173
|
t.nonNull.boolean("isReady");
|
|
174
|
+
t.nonNull.int("number");
|
|
174
175
|
t.nonNull.string("name");
|
|
175
176
|
t.nonNull.string("avatar");
|
|
176
177
|
t.nonNull.string("location");
|
|
@@ -369,6 +370,9 @@ var PeriodSegment = (0, import_nexus5.objectType)({
|
|
|
369
370
|
t.nonNull.id("id");
|
|
370
371
|
t.nonNull.int("index");
|
|
371
372
|
t.nonNull.int("periodIx");
|
|
373
|
+
t.field("countdownExpiresAt", {
|
|
374
|
+
type: "DateTime"
|
|
375
|
+
});
|
|
372
376
|
t.nonNull.list.nonNull.field("actions", {
|
|
373
377
|
type: PlayerAction
|
|
374
378
|
});
|
|
@@ -688,6 +692,7 @@ async function createGame({ name, playerCount }, ctx, { roleAssigner }) {
|
|
|
688
692
|
facts: {},
|
|
689
693
|
token: (0, import_nanoid.nanoid)(),
|
|
690
694
|
role: roleAssigner(ix),
|
|
695
|
+
number: playerCount - ix,
|
|
691
696
|
name: `Team ${playerCount - ix}`,
|
|
692
697
|
level: {
|
|
693
698
|
connect: {
|
|
@@ -1378,6 +1383,9 @@ async function getGame(args, ctx) {
|
|
|
1378
1383
|
include: {
|
|
1379
1384
|
level: true,
|
|
1380
1385
|
achievements: true
|
|
1386
|
+
},
|
|
1387
|
+
orderBy: {
|
|
1388
|
+
number: "asc"
|
|
1381
1389
|
}
|
|
1382
1390
|
},
|
|
1383
1391
|
periods: {
|
|
@@ -2234,6 +2242,29 @@ async function updateReadyState(args, ctx) {
|
|
|
2234
2242
|
}
|
|
2235
2243
|
});
|
|
2236
2244
|
}
|
|
2245
|
+
async function addCountdown(args, ctx) {
|
|
2246
|
+
const currentGame = await ctx.prisma.game.findUnique({
|
|
2247
|
+
where: { id: args.gameId },
|
|
2248
|
+
include: {
|
|
2249
|
+
activePeriod: {
|
|
2250
|
+
include: {
|
|
2251
|
+
activeSegment: true
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
});
|
|
2256
|
+
if (!currentGame?.activePeriod?.activeSegment)
|
|
2257
|
+
return null;
|
|
2258
|
+
await ctx.prisma.periodSegment.update({
|
|
2259
|
+
where: {
|
|
2260
|
+
id: currentGame.activePeriod.activeSegment.id
|
|
2261
|
+
},
|
|
2262
|
+
data: {
|
|
2263
|
+
countdownExpiresAt: new Date(Date.now() + args.seconds * 1e3)
|
|
2264
|
+
}
|
|
2265
|
+
});
|
|
2266
|
+
return true;
|
|
2267
|
+
}
|
|
2237
2268
|
|
|
2238
2269
|
// src/types/Mutation.ts
|
|
2239
2270
|
var defaultReducers = {};
|
|
@@ -2418,6 +2449,15 @@ function generateBaseMutations({
|
|
|
2418
2449
|
);
|
|
2419
2450
|
}
|
|
2420
2451
|
});
|
|
2452
|
+
t.boolean("addCountdown", {
|
|
2453
|
+
args: {
|
|
2454
|
+
gameId: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)()),
|
|
2455
|
+
seconds: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)())
|
|
2456
|
+
},
|
|
2457
|
+
async resolve(_, args, ctx) {
|
|
2458
|
+
return addCountdown(args, ctx);
|
|
2459
|
+
}
|
|
2460
|
+
});
|
|
2421
2461
|
}
|
|
2422
2462
|
});
|
|
2423
2463
|
}
|
package/dist/ops/QGame.graphql
CHANGED
|
@@ -8,6 +8,10 @@ query Game($id: Int) {
|
|
|
8
8
|
activePeriod {
|
|
9
9
|
id
|
|
10
10
|
activeSegmentIx
|
|
11
|
+
activeSegment {
|
|
12
|
+
id
|
|
13
|
+
countdownExpiresAt
|
|
14
|
+
}
|
|
11
15
|
segments {
|
|
12
16
|
id
|
|
13
17
|
}
|
|
@@ -16,12 +20,13 @@ query Game($id: Int) {
|
|
|
16
20
|
...PeriodData
|
|
17
21
|
}
|
|
18
22
|
players {
|
|
19
|
-
|
|
23
|
+
id
|
|
20
24
|
|
|
21
25
|
isReady
|
|
22
26
|
|
|
23
27
|
role
|
|
24
28
|
|
|
29
|
+
number
|
|
25
30
|
name
|
|
26
31
|
avatar
|
|
27
32
|
location
|
package/dist/ops/QResult.graphql
CHANGED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
type Maybe<T> = T | null;
|
|
2
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
3
|
+
type Scalars = {
|
|
4
|
+
ID: string;
|
|
5
|
+
String: string;
|
|
6
|
+
Boolean: boolean;
|
|
7
|
+
Int: number;
|
|
8
|
+
Float: number;
|
|
9
|
+
/** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
|
|
10
|
+
DateTime: any;
|
|
11
|
+
/** The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
|
|
12
|
+
JSONObject: any;
|
|
13
|
+
};
|
|
14
|
+
type Achievement = {
|
|
15
|
+
__typename?: 'Achievement';
|
|
16
|
+
description: Scalars['String'];
|
|
17
|
+
id: Scalars['ID'];
|
|
18
|
+
image?: Maybe<Scalars['String']>;
|
|
19
|
+
name: Scalars['String'];
|
|
20
|
+
reward?: Maybe<Scalars['JSONObject']>;
|
|
21
|
+
when: AchievementFrequency;
|
|
22
|
+
};
|
|
23
|
+
declare enum AchievementFrequency {
|
|
24
|
+
Each = "EACH",
|
|
25
|
+
First = "FIRST"
|
|
26
|
+
}
|
|
27
|
+
type AchievementInstance = {
|
|
28
|
+
__typename?: 'AchievementInstance';
|
|
29
|
+
achievement: Achievement;
|
|
30
|
+
count: Scalars['Int'];
|
|
31
|
+
id: Scalars['Int'];
|
|
32
|
+
};
|
|
33
|
+
type Game = {
|
|
34
|
+
__typename?: 'Game';
|
|
35
|
+
activePeriod?: Maybe<Period>;
|
|
36
|
+
activePeriodIx?: Maybe<Scalars['Int']>;
|
|
37
|
+
id: Scalars['ID'];
|
|
38
|
+
name: Scalars['String'];
|
|
39
|
+
periods: Array<Period>;
|
|
40
|
+
players: Array<Player>;
|
|
41
|
+
segments: Array<PeriodSegment>;
|
|
42
|
+
status: GameStatus;
|
|
43
|
+
};
|
|
44
|
+
declare enum GameStatus {
|
|
45
|
+
Completed = "COMPLETED",
|
|
46
|
+
Consolidation = "CONSOLIDATION",
|
|
47
|
+
Paused = "PAUSED",
|
|
48
|
+
Preparation = "PREPARATION",
|
|
49
|
+
Results = "RESULTS",
|
|
50
|
+
Running = "RUNNING",
|
|
51
|
+
Scheduled = "SCHEDULED"
|
|
52
|
+
}
|
|
53
|
+
type LearningAnswerOption = {
|
|
54
|
+
__typename?: 'LearningAnswerOption';
|
|
55
|
+
content: Scalars['String'];
|
|
56
|
+
correct: Scalars['Boolean'];
|
|
57
|
+
id: Scalars['ID'];
|
|
58
|
+
};
|
|
59
|
+
type LearningElement = {
|
|
60
|
+
__typename?: 'LearningElement';
|
|
61
|
+
feedback?: Maybe<Scalars['String']>;
|
|
62
|
+
id: Scalars['ID'];
|
|
63
|
+
motivation?: Maybe<Scalars['String']>;
|
|
64
|
+
options: Array<LearningAnswerOption>;
|
|
65
|
+
question: Scalars['String'];
|
|
66
|
+
reward?: Maybe<Scalars['JSONObject']>;
|
|
67
|
+
title: Scalars['String'];
|
|
68
|
+
};
|
|
69
|
+
type Period = {
|
|
70
|
+
__typename?: 'Period';
|
|
71
|
+
actions: Array<PlayerAction>;
|
|
72
|
+
activeSegment?: Maybe<PeriodSegment>;
|
|
73
|
+
activeSegmentIx?: Maybe<Scalars['Int']>;
|
|
74
|
+
facts: Scalars['JSONObject'];
|
|
75
|
+
id: Scalars['ID'];
|
|
76
|
+
index: Scalars['Int'];
|
|
77
|
+
results: Array<PlayerResult>;
|
|
78
|
+
segments: Array<PeriodSegment>;
|
|
79
|
+
};
|
|
80
|
+
type PeriodSegment = {
|
|
81
|
+
__typename?: 'PeriodSegment';
|
|
82
|
+
actions: Array<PlayerAction>;
|
|
83
|
+
facts: Scalars['JSONObject'];
|
|
84
|
+
id: Scalars['ID'];
|
|
85
|
+
index: Scalars['Int'];
|
|
86
|
+
learningElements: Array<LearningElement>;
|
|
87
|
+
periodIx: Scalars['Int'];
|
|
88
|
+
results: Array<PlayerResult>;
|
|
89
|
+
storyElements: Array<StoryElement>;
|
|
90
|
+
};
|
|
91
|
+
type Player = {
|
|
92
|
+
__typename?: 'Player';
|
|
93
|
+
achievementIds: Array<Scalars['String']>;
|
|
94
|
+
achievementKeys: Array<Scalars['String']>;
|
|
95
|
+
achievements: Array<AchievementInstance>;
|
|
96
|
+
avatar: Scalars['String'];
|
|
97
|
+
color: Scalars['String'];
|
|
98
|
+
completedLearningElementIds: Array<Scalars['Int']>;
|
|
99
|
+
completedLearningElements: Array<LearningElement>;
|
|
100
|
+
experience: Scalars['Int'];
|
|
101
|
+
experienceToNext: Scalars['Int'];
|
|
102
|
+
facts: Scalars['JSONObject'];
|
|
103
|
+
id: Scalars['ID'];
|
|
104
|
+
isReady: Scalars['Boolean'];
|
|
105
|
+
level: PlayerLevel;
|
|
106
|
+
levelIx: Scalars['Int'];
|
|
107
|
+
location: Scalars['String'];
|
|
108
|
+
name: Scalars['String'];
|
|
109
|
+
role: Scalars['String'];
|
|
110
|
+
token: Scalars['String'];
|
|
111
|
+
tutorialCompleted: Scalars['Boolean'];
|
|
112
|
+
visitedStoryElementIds: Array<Scalars['Int']>;
|
|
113
|
+
visitedStoryElements: Array<StoryElement>;
|
|
114
|
+
};
|
|
115
|
+
type PlayerAction = {
|
|
116
|
+
__typename?: 'PlayerAction';
|
|
117
|
+
facts?: Maybe<Scalars['JSONObject']>;
|
|
118
|
+
id: Scalars['ID'];
|
|
119
|
+
period: Period;
|
|
120
|
+
periodIx: Scalars['Int'];
|
|
121
|
+
player: Player;
|
|
122
|
+
segment?: Maybe<PeriodSegment>;
|
|
123
|
+
segmentIx?: Maybe<Scalars['Int']>;
|
|
124
|
+
type: Scalars['String'];
|
|
125
|
+
};
|
|
126
|
+
declare enum PlayerDecisionType {
|
|
127
|
+
Consolidation = "CONSOLIDATION",
|
|
128
|
+
Preparation = "PREPARATION"
|
|
129
|
+
}
|
|
130
|
+
type PlayerLevel = {
|
|
131
|
+
__typename?: 'PlayerLevel';
|
|
132
|
+
description: Scalars['String'];
|
|
133
|
+
id: Scalars['ID'];
|
|
134
|
+
index: Scalars['Int'];
|
|
135
|
+
requiredXP: Scalars['Int'];
|
|
136
|
+
};
|
|
137
|
+
type PlayerResult = {
|
|
138
|
+
__typename?: 'PlayerResult';
|
|
139
|
+
facts?: Maybe<Scalars['JSONObject']>;
|
|
140
|
+
id: Scalars['ID'];
|
|
141
|
+
period: Period;
|
|
142
|
+
player: Player;
|
|
143
|
+
segment?: Maybe<PeriodSegment>;
|
|
144
|
+
type?: Maybe<PlayerResultType>;
|
|
145
|
+
};
|
|
146
|
+
declare enum PlayerResultType {
|
|
147
|
+
PeriodEnd = "PERIOD_END",
|
|
148
|
+
PeriodStart = "PERIOD_START",
|
|
149
|
+
SegmentEnd = "SEGMENT_END",
|
|
150
|
+
SegmentStart = "SEGMENT_START"
|
|
151
|
+
}
|
|
152
|
+
type StoryElement = {
|
|
153
|
+
__typename?: 'StoryElement';
|
|
154
|
+
content?: Maybe<Scalars['String']>;
|
|
155
|
+
contentRole?: Maybe<Scalars['String']>;
|
|
156
|
+
id: Scalars['ID'];
|
|
157
|
+
reward?: Maybe<Scalars['JSONObject']>;
|
|
158
|
+
title: Scalars['String'];
|
|
159
|
+
type: StoryElementType;
|
|
160
|
+
};
|
|
161
|
+
declare enum StoryElementType {
|
|
162
|
+
Generic = "GENERIC",
|
|
163
|
+
RoleBased = "ROLE_BASED"
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export { Game as G, PlayerDecisionType as P, Period as a };
|
package/dist/schema.prisma
CHANGED
|
@@ -151,6 +151,8 @@ model PeriodSegment {
|
|
|
151
151
|
|
|
152
152
|
facts Json
|
|
153
153
|
|
|
154
|
+
countdownExpiresAt DateTime?
|
|
155
|
+
|
|
154
156
|
actions PlayerAction[]
|
|
155
157
|
results PlayerResult[]
|
|
156
158
|
|
|
@@ -179,6 +181,7 @@ model PeriodSegment {
|
|
|
179
181
|
model Player {
|
|
180
182
|
id String @id @default(uuid()) @db.Uuid
|
|
181
183
|
|
|
184
|
+
number Int @default(-1)
|
|
182
185
|
name String @default("Anonymous")
|
|
183
186
|
avatar String @default("")
|
|
184
187
|
location String @default("")
|