@gbl-uzh/platform 0.2.12 → 0.2.14
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 +5 -3
- package/dist/nexus.js +2 -2
- package/dist/ops/FGameData.graphql +7 -0
- package/dist/ops/FLearningElementData.graphql +10 -0
- package/dist/ops/FPeriodData.graphql +14 -0
- package/dist/ops/FPlayerActionData.graphql +9 -0
- package/dist/ops/FPlayerData.graphql +36 -0
- package/dist/ops/FResultData.graphql +17 -0
- package/dist/ops/FSegmentData.graphql +15 -0
- package/dist/ops/MActivateNextPeriod.graphql +11 -0
- package/dist/ops/MActivateNextSegment.graphql +14 -0
- package/dist/ops/MAddGamePeriod.graphql +7 -0
- package/dist/ops/MAddPeriodSegment.graphql +19 -0
- package/dist/ops/MAttemptLearningElement.graphql +18 -0
- package/dist/ops/MCreateGame.graphql +7 -0
- package/dist/ops/MLoginAsTeam.graphql +7 -0
- package/dist/ops/MMarkStoryElement.graphql +6 -0
- package/dist/ops/MPerformAction.graphql +7 -0
- package/dist/ops/MSaveConsolidationDecision.graphql +8 -0
- package/dist/ops/MUpdatePlayerData.graphql +12 -0
- package/dist/ops/MUpdateReadyState.graphql +6 -0
- package/dist/ops/QGame.graphql +37 -0
- package/dist/ops/QGames.graphql +7 -0
- package/dist/ops/QLearningElement.graphql +19 -0
- package/dist/ops/QLearningElements.graphql +7 -0
- package/dist/ops/QPastResults.graphql +40 -0
- package/dist/ops/QResult.graphql +53 -0
- package/dist/ops/QResults.graphql +12 -0
- package/dist/ops/QSelf.graphql +7 -0
- package/dist/ops/SGlobalEvents.graphql +5 -0
- package/dist/ops/SUserEvents.graphql +5 -0
- package/package.json +5 -3
- package/dist/generated/ops.d.ts +0 -1555
- package/dist/generated/ops.js +0 -168
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,6 @@ import { PrismaClient } from '@prisma/client';
|
|
|
3
3
|
import { NextPageContext } from 'next';
|
|
4
4
|
import * as yup from 'yup';
|
|
5
5
|
import yup__default from 'yup';
|
|
6
|
-
import { PlayerDecisionType } from './generated/ops.js';
|
|
7
|
-
import 'graphql';
|
|
8
|
-
import '@graphql-typed-document-node/core';
|
|
9
6
|
|
|
10
7
|
declare enum UserRole {
|
|
11
8
|
PLAYER = "PLAYER",
|
|
@@ -288,6 +285,11 @@ declare namespace GameService {
|
|
|
288
285
|
};
|
|
289
286
|
}
|
|
290
287
|
|
|
288
|
+
declare enum PlayerDecisionType {
|
|
289
|
+
Consolidation = "CONSOLIDATION",
|
|
290
|
+
Preparation = "PREPARATION"
|
|
291
|
+
}
|
|
292
|
+
|
|
291
293
|
type Context = CtxWithPrisma<PrismaClient>;
|
|
292
294
|
interface PerformActionArgs<ActionTypes> {
|
|
293
295
|
gameId: number;
|
package/dist/nexus.js
CHANGED
|
@@ -326,10 +326,10 @@ var Game = (0, import_nexus5.objectType)({
|
|
|
326
326
|
t.field("activePeriod", {
|
|
327
327
|
type: Period
|
|
328
328
|
});
|
|
329
|
-
t.
|
|
329
|
+
t.list.nonNull.field("players", {
|
|
330
330
|
type: Player
|
|
331
331
|
});
|
|
332
|
-
t.
|
|
332
|
+
t.list.nonNull.field("periods", {
|
|
333
333
|
type: Period
|
|
334
334
|
});
|
|
335
335
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
fragment PlayerData on Player {
|
|
2
|
+
id
|
|
3
|
+
|
|
4
|
+
isReady
|
|
5
|
+
|
|
6
|
+
role
|
|
7
|
+
|
|
8
|
+
name
|
|
9
|
+
avatar
|
|
10
|
+
location
|
|
11
|
+
color
|
|
12
|
+
|
|
13
|
+
facts
|
|
14
|
+
|
|
15
|
+
experience
|
|
16
|
+
experienceToNext
|
|
17
|
+
|
|
18
|
+
achievementKeys
|
|
19
|
+
achievements {
|
|
20
|
+
id
|
|
21
|
+
count
|
|
22
|
+
|
|
23
|
+
achievement {
|
|
24
|
+
id
|
|
25
|
+
name
|
|
26
|
+
description
|
|
27
|
+
image
|
|
28
|
+
reward
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
level {
|
|
33
|
+
id
|
|
34
|
+
index
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#import "./FSegmentData.graphql"
|
|
2
|
+
|
|
3
|
+
mutation AddPeriodSegment(
|
|
4
|
+
$gameId: Int!
|
|
5
|
+
$periodIx: Int!
|
|
6
|
+
$facts: PeriodSegmentFactsInput!
|
|
7
|
+
$storyElements: [String]
|
|
8
|
+
$learningElements: [String]
|
|
9
|
+
) {
|
|
10
|
+
addPeriodSegment(
|
|
11
|
+
gameId: $gameId
|
|
12
|
+
periodIx: $periodIx
|
|
13
|
+
facts: $facts
|
|
14
|
+
storyElements: $storyElements
|
|
15
|
+
learningElements: $learningElements
|
|
16
|
+
) {
|
|
17
|
+
...SegmentData
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
mutation AttemptLearningElement($elementId: ID!, $selection: String!) {
|
|
2
|
+
attemptLearningElement(elementId: $elementId, selection: $selection) {
|
|
3
|
+
id
|
|
4
|
+
|
|
5
|
+
pointsAchieved
|
|
6
|
+
pointsMax
|
|
7
|
+
|
|
8
|
+
element {
|
|
9
|
+
id
|
|
10
|
+
feedback
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
player {
|
|
14
|
+
id
|
|
15
|
+
completedLearningElementIds
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#import "./FGameData.graphql"
|
|
2
|
+
#import "./FPeriodData.graphql"
|
|
3
|
+
#import "./FPlayerData.graphql"
|
|
4
|
+
|
|
5
|
+
query Game($id: Int) {
|
|
6
|
+
game(id: $id) {
|
|
7
|
+
...GameData
|
|
8
|
+
activePeriod {
|
|
9
|
+
id
|
|
10
|
+
activeSegmentIx
|
|
11
|
+
segments {
|
|
12
|
+
id
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
periods {
|
|
16
|
+
...PeriodData
|
|
17
|
+
}
|
|
18
|
+
players {
|
|
19
|
+
id
|
|
20
|
+
|
|
21
|
+
isReady
|
|
22
|
+
|
|
23
|
+
role
|
|
24
|
+
|
|
25
|
+
name
|
|
26
|
+
avatar
|
|
27
|
+
location
|
|
28
|
+
color
|
|
29
|
+
|
|
30
|
+
facts
|
|
31
|
+
|
|
32
|
+
experience
|
|
33
|
+
experienceToNext
|
|
34
|
+
token
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#import "./FResultData.graphql"
|
|
2
|
+
|
|
3
|
+
query PastResults {
|
|
4
|
+
result {
|
|
5
|
+
currentGame {
|
|
6
|
+
id
|
|
7
|
+
status
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
pastResults {
|
|
11
|
+
...ResultData
|
|
12
|
+
player {
|
|
13
|
+
id
|
|
14
|
+
|
|
15
|
+
role
|
|
16
|
+
|
|
17
|
+
name
|
|
18
|
+
avatar
|
|
19
|
+
color
|
|
20
|
+
|
|
21
|
+
facts
|
|
22
|
+
|
|
23
|
+
experience
|
|
24
|
+
experienceToNext
|
|
25
|
+
|
|
26
|
+
level {
|
|
27
|
+
id
|
|
28
|
+
index
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
completedLearningElementIds
|
|
32
|
+
visitedStoryElementIds
|
|
33
|
+
}
|
|
34
|
+
period {
|
|
35
|
+
id
|
|
36
|
+
index
|
|
37
|
+
facts
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#import "./FResultData.graphql"
|
|
2
|
+
#import "./FPeriodData.graphql"
|
|
3
|
+
#import "./FPlayerData.graphql"
|
|
4
|
+
#import "./FPlayerActionData.graphql"
|
|
5
|
+
|
|
6
|
+
query Result {
|
|
7
|
+
result {
|
|
8
|
+
playerResult {
|
|
9
|
+
...ResultData
|
|
10
|
+
player {
|
|
11
|
+
id
|
|
12
|
+
completedLearningElementIds
|
|
13
|
+
visitedStoryElementIds
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
previousResults {
|
|
17
|
+
...ResultData
|
|
18
|
+
}
|
|
19
|
+
currentGame {
|
|
20
|
+
id
|
|
21
|
+
status
|
|
22
|
+
periods {
|
|
23
|
+
...PeriodData
|
|
24
|
+
}
|
|
25
|
+
activePeriod {
|
|
26
|
+
...PeriodData
|
|
27
|
+
activeSegment {
|
|
28
|
+
id
|
|
29
|
+
index
|
|
30
|
+
facts
|
|
31
|
+
learningElements {
|
|
32
|
+
id
|
|
33
|
+
title
|
|
34
|
+
}
|
|
35
|
+
storyElements {
|
|
36
|
+
id
|
|
37
|
+
type
|
|
38
|
+
title
|
|
39
|
+
content
|
|
40
|
+
contentRole
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
transactions {
|
|
46
|
+
...PlayerActionData
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
self {
|
|
51
|
+
...PlayerData
|
|
52
|
+
}
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gbl-uzh/platform",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"build": "npm-run-all build:nexus build:graphql build:ts build:copy",
|
|
13
13
|
"build:nexus": "ts-node --esm --transpile-only src/nexus.ts",
|
|
14
14
|
"build:graphql": "graphql-codegen --config codegen.ts",
|
|
15
|
-
"build:ts": "NODE_ENV=production tsup",
|
|
15
|
+
"build:ts": "cross-env NODE_ENV=production tsup",
|
|
16
16
|
"build:copy": "ts-node src/lib/copy.ts",
|
|
17
|
-
"dev": "NODE_ENV=development tsup --watch",
|
|
17
|
+
"dev": "cross-env NODE_ENV=development tsup --watch",
|
|
18
18
|
"generate": "prisma generate"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"@tsconfig/recommended": "1.0.1",
|
|
33
33
|
"@types/jest": "^29.2.2",
|
|
34
34
|
"@types/node": "^18.11.9",
|
|
35
|
+
"cross-env": "7.0.3",
|
|
36
|
+
"fs-extra": "11.1.0",
|
|
35
37
|
"jest": "29.3.1",
|
|
36
38
|
"npm-run-all": "4.1.5",
|
|
37
39
|
"prisma": "4.8.0",
|