@gbl-uzh/platform 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/index.d.ts +11 -9
  2. package/dist/nexus.d.ts +4 -24
  3. package/dist/nexus.js +74 -104
  4. package/dist/ops/FGameData.graphql +7 -0
  5. package/dist/ops/FLearningElementData.graphql +10 -0
  6. package/dist/ops/FPeriodData.graphql +14 -0
  7. package/dist/ops/FPlayerActionData.graphql +9 -0
  8. package/dist/ops/FPlayerData.graphql +36 -0
  9. package/dist/ops/FResultData.graphql +17 -0
  10. package/dist/ops/FSegmentData.graphql +15 -0
  11. package/dist/ops/MActivateNextPeriod.graphql +11 -0
  12. package/dist/ops/MActivateNextSegment.graphql +14 -0
  13. package/dist/ops/MAddGamePeriod.graphql +7 -0
  14. package/dist/ops/MAddPeriodSegment.graphql +19 -0
  15. package/dist/ops/MAttemptLearningElement.graphql +18 -0
  16. package/dist/ops/MCreateGame.graphql +7 -0
  17. package/dist/ops/MLoginAsTeam.graphql +7 -0
  18. package/dist/ops/MMarkStoryElement.graphql +6 -0
  19. package/dist/ops/MPerformAction.graphql +7 -0
  20. package/dist/ops/MSaveConsolidationDecision.graphql +8 -0
  21. package/dist/ops/MUpdatePlayerData.graphql +12 -0
  22. package/dist/ops/MUpdateReadyState.graphql +6 -0
  23. package/dist/ops/QGame.graphql +37 -0
  24. package/dist/ops/QGames.graphql +7 -0
  25. package/dist/ops/QLearningElement.graphql +19 -0
  26. package/dist/ops/QLearningElements.graphql +7 -0
  27. package/dist/ops/QPastResults.graphql +40 -0
  28. package/dist/ops/QResult.graphql +53 -0
  29. package/dist/ops/QResults.graphql +12 -0
  30. package/dist/ops/QSelf.graphql +7 -0
  31. package/dist/ops/SGlobalEvents.graphql +5 -0
  32. package/dist/ops/SUserEvents.graphql +5 -0
  33. package/dist/schema.prisma +1 -1
  34. package/package.json +11 -9
  35. package/dist/generated/ops.d.ts +0 -1555
  36. package/dist/generated/ops.js +0 -168
@@ -0,0 +1,17 @@
1
+ fragment ResultData on PlayerResult {
2
+ id
3
+
4
+ type
5
+
6
+ facts
7
+
8
+ period {
9
+ id
10
+ index
11
+ }
12
+
13
+ segment {
14
+ id
15
+ index
16
+ }
17
+ }
@@ -0,0 +1,15 @@
1
+ fragment SegmentData on PeriodSegment {
2
+ id
3
+
4
+ index
5
+
6
+ facts
7
+
8
+ learningElements {
9
+ id
10
+ }
11
+
12
+ storyElements {
13
+ id
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ #import "./FGameData.graphql"
2
+ #import "./FPeriodData.graphql"
3
+
4
+ mutation ActivateNextPeriod($gameId: Int!) {
5
+ activateNextPeriod(gameId: $gameId) {
6
+ ...GameData
7
+ periods {
8
+ ...PeriodData
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,14 @@
1
+ #import "./FPeriodData.graphql"
2
+ #import "./FPlayerData.graphql"
3
+
4
+ mutation ActivateNextSegment($gameId: Int!) {
5
+ activateNextSegment(gameId: $gameId) {
6
+ ...GameData
7
+ periods {
8
+ ...PeriodData
9
+ }
10
+ players {
11
+ ...PlayerData
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,7 @@
1
+ #import "./FPeriodData.graphql"
2
+
3
+ mutation AddGamePeriod($gameId: Int!, $facts: PeriodFactsInput!) {
4
+ addGamePeriod(gameId: $gameId, facts: $facts) {
5
+ ...PeriodData
6
+ }
7
+ }
@@ -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,7 @@
1
+ #import "./FGameData.graphql"
2
+
3
+ mutation CreateGame($name: String!, $playerCount: Int!) {
4
+ createGame(name: $name, playerCount: $playerCount) {
5
+ ...GameData
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ #import "./FPlayerData.graphql"
2
+
3
+ mutation LoginAsTeam($token: String!) {
4
+ loginAsTeam(token: $token) {
5
+ ...PlayerData
6
+ }
7
+ }
@@ -0,0 +1,6 @@
1
+ mutation MarkStoryElement($elementId: ID!) {
2
+ markStoryElement(elementId: $elementId) {
3
+ id
4
+ visitedStoryElementIds
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ #import "./FResultData.graphql"
2
+
3
+ mutation PerformAction($type: String!, $payload: String!) {
4
+ performAction(type: $type, payload: $payload) {
5
+ ...ResultData
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ mutation SaveConsolidationDecision($payload: String!) {
2
+ saveConsolidationDecision(payload: $payload) {
3
+ id
4
+
5
+ type
6
+ facts
7
+ }
8
+ }
@@ -0,0 +1,12 @@
1
+ #import "./FPlayerData.graphql"
2
+
3
+ mutation UpdatePlayerData(
4
+ $name: String
5
+ $avatar: String
6
+ $color: String
7
+ $facts: String
8
+ ) {
9
+ updatePlayerData(name: $name, avatar: $avatar, color: $color, facts: $facts) {
10
+ ...PlayerData
11
+ }
12
+ }
@@ -0,0 +1,6 @@
1
+ mutation UpdateReadyState($isReady: Boolean!) {
2
+ updateReadyState(isReady: $isReady) {
3
+ id
4
+ isReady
5
+ }
6
+ }
@@ -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,7 @@
1
+ #import "./FGameData.graphql"
2
+
3
+ query Games {
4
+ games {
5
+ ...GameData
6
+ }
7
+ }
@@ -0,0 +1,19 @@
1
+ #import "./FLearningElementData.graphql"
2
+
3
+ query LearningElement($id: ID!) {
4
+ learningElement(id: $id) {
5
+ id
6
+
7
+ element {
8
+ ...LearningElementData
9
+
10
+ options {
11
+ content
12
+ }
13
+ }
14
+
15
+ state
16
+
17
+ solution
18
+ }
19
+ }
@@ -0,0 +1,7 @@
1
+ #import "./FLearningElementData.graphql"
2
+
3
+ query LearningElements {
4
+ learningElements {
5
+ ...LearningElementData
6
+ }
7
+ }
@@ -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
+ }
@@ -0,0 +1,12 @@
1
+ #import "./FResultData.graphql"
2
+
3
+ query Results {
4
+ results {
5
+ ...ResultData
6
+ player {
7
+ id
8
+
9
+ name
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ #import "./FPlayerData.graphql"
2
+
3
+ query Self {
4
+ self {
5
+ ...PlayerData
6
+ }
7
+ }
@@ -0,0 +1,5 @@
1
+ subscription GlobalEvents {
2
+ eventsGlobal {
3
+ type
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ subscription UserEvents {
2
+ eventsUser {
3
+ type
4
+ }
5
+ }
@@ -6,7 +6,7 @@ datasource db {
6
6
 
7
7
  generator client {
8
8
  provider = "prisma-client-js"
9
- previewFeatures = ["interactiveTransactions"]
9
+ previewFeatures = ["fullTextSearch", "fullTextIndex", "postgresqlExtensions", "fieldReference", "orderByNulls", "extendedWhereUnique"]
10
10
  }
11
11
 
12
12
  model Account {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gbl-uzh/platform",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
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,23 +32,25 @@
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
- "prisma": "4.6.1",
39
+ "prisma": "4.8.0",
38
40
  "rollup-plugin-copy": "3.4.0",
39
41
  "ts-jest": "29.0.3",
40
42
  "ts-node": "10.9.1",
41
- "tsup": "6.4.0",
42
- "typescript": "4.8.4"
43
+ "tsup": "6.5.0",
44
+ "typescript": "4.9.4"
43
45
  },
44
46
  "peerDependencies": {
45
47
  "@apollo/client": "^3.7.0",
46
- "@prisma/client": "4.6.1",
48
+ "@prisma/client": "^4.8.0",
47
49
  "@uzh-bf/design-system": "^0.0.79",
48
50
  "graphql": "^16.6.0",
49
51
  "graphql-scalars": "^1.19.0",
50
- "graphql-yoga": "^3.0.0-next.4",
51
- "jsonwebtoken": "^8.5.1",
52
+ "graphql-yoga": "^3.0.0",
53
+ "jsonwebtoken": "^9.0.0",
52
54
  "next": "^13.0.0",
53
55
  "nexus": "^1.3.0",
54
56
  "nookies": "^2.5.2",