@gbl-uzh/platform 0.3.0 → 0.3.1
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 +3 -3
- package/dist/index.js +11 -0
- package/dist/lib/apollo.js +4 -0
- package/dist/lib/util.js +4 -0
- package/dist/nexus.js +11 -0
- package/package.json +16 -16
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ interface CreateLoginTokenArgs {
|
|
|
81
81
|
token?: string;
|
|
82
82
|
gameId?: number;
|
|
83
83
|
}
|
|
84
|
-
declare function createLoginToken({ sub, role, ...extra }: CreateLoginTokenArgs):
|
|
84
|
+
declare function createLoginToken({ sub, role, ...extra }: CreateLoginTokenArgs): any;
|
|
85
85
|
interface LoginAsTeamArgs {
|
|
86
86
|
token: string;
|
|
87
87
|
}
|
|
@@ -351,10 +351,10 @@ declare function getPlayerResult(args: GetPlayerResultArgs, ctx: Context): Promi
|
|
|
351
351
|
visitedStoryElements: _prisma_client.StoryElement[];
|
|
352
352
|
};
|
|
353
353
|
}) | null;
|
|
354
|
-
previousResults: _prisma_client.PrismaPromise<(_prisma_client.PlayerResult & {
|
|
354
|
+
previousResults: _prisma_client.Prisma.PrismaPromise<(_prisma_client.PlayerResult & {
|
|
355
355
|
period: _prisma_client.Period;
|
|
356
356
|
})[]>;
|
|
357
|
-
transactions: _prisma_client.PrismaPromise<_prisma_client.PlayerAction[]>;
|
|
357
|
+
transactions: _prisma_client.Prisma.PrismaPromise<_prisma_client.PlayerAction[]>;
|
|
358
358
|
} | null>;
|
|
359
359
|
interface GetPlayerDataArgs {
|
|
360
360
|
playerId: string;
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -757,6 +761,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
757
761
|
},
|
|
758
762
|
data: {
|
|
759
763
|
results: {
|
|
764
|
+
// compute SEGMENT_END results using model
|
|
760
765
|
update: results
|
|
761
766
|
}
|
|
762
767
|
},
|
|
@@ -789,6 +794,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
789
794
|
);
|
|
790
795
|
await Promise.all(promises);
|
|
791
796
|
const result = await ctx.prisma.$transaction([
|
|
797
|
+
// update the status and active period of the current game
|
|
792
798
|
ctx.prisma.game.update({
|
|
793
799
|
where: {
|
|
794
800
|
id: gameId
|
|
@@ -813,6 +819,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
813
819
|
}
|
|
814
820
|
}
|
|
815
821
|
}),
|
|
822
|
+
// create PERIOD_END results based on the previous SEGMENT_END results
|
|
816
823
|
ctx.prisma.period.update({
|
|
817
824
|
where: {
|
|
818
825
|
gameId_index: {
|
|
@@ -849,6 +856,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
849
856
|
{ reducers }
|
|
850
857
|
);
|
|
851
858
|
const result = await ctx.prisma.$transaction([
|
|
859
|
+
// update the status and active period of the current game
|
|
852
860
|
ctx.prisma.game.update({
|
|
853
861
|
where: {
|
|
854
862
|
id: gameId
|
|
@@ -864,6 +872,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
864
872
|
status: "PREPARATION" /* Preparation */
|
|
865
873
|
}
|
|
866
874
|
}),
|
|
875
|
+
// create PERIOD_START results based on the previous PERIOD_END results
|
|
867
876
|
ctx.prisma.period.update({
|
|
868
877
|
where: {
|
|
869
878
|
gameId_index: {
|
|
@@ -943,6 +952,7 @@ async function activateNextSegment({ gameId }, ctx, { reducers }) {
|
|
|
943
952
|
status: "RUNNING" /* Running */
|
|
944
953
|
}
|
|
945
954
|
}),
|
|
955
|
+
// update the active segment of the current period
|
|
946
956
|
ctx.prisma.period.update({
|
|
947
957
|
where: {
|
|
948
958
|
gameId_index: {
|
|
@@ -963,6 +973,7 @@ async function activateNextSegment({ gameId }, ctx, { reducers }) {
|
|
|
963
973
|
}
|
|
964
974
|
}
|
|
965
975
|
}),
|
|
976
|
+
// SEGMENT INITIALIZATION
|
|
966
977
|
ctx.prisma.periodSegment.update({
|
|
967
978
|
where: {
|
|
968
979
|
gameId_periodIx_index: {
|
package/dist/lib/apollo.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/lib/util.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/nexus.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -1043,6 +1047,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
1043
1047
|
},
|
|
1044
1048
|
data: {
|
|
1045
1049
|
results: {
|
|
1050
|
+
// compute SEGMENT_END results using model
|
|
1046
1051
|
update: results
|
|
1047
1052
|
}
|
|
1048
1053
|
},
|
|
@@ -1075,6 +1080,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
1075
1080
|
);
|
|
1076
1081
|
await Promise.all(promises);
|
|
1077
1082
|
const result = await ctx.prisma.$transaction([
|
|
1083
|
+
// update the status and active period of the current game
|
|
1078
1084
|
ctx.prisma.game.update({
|
|
1079
1085
|
where: {
|
|
1080
1086
|
id: gameId
|
|
@@ -1099,6 +1105,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
1099
1105
|
}
|
|
1100
1106
|
}
|
|
1101
1107
|
}),
|
|
1108
|
+
// create PERIOD_END results based on the previous SEGMENT_END results
|
|
1102
1109
|
ctx.prisma.period.update({
|
|
1103
1110
|
where: {
|
|
1104
1111
|
gameId_index: {
|
|
@@ -1135,6 +1142,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
1135
1142
|
{ reducers }
|
|
1136
1143
|
);
|
|
1137
1144
|
const result = await ctx.prisma.$transaction([
|
|
1145
|
+
// update the status and active period of the current game
|
|
1138
1146
|
ctx.prisma.game.update({
|
|
1139
1147
|
where: {
|
|
1140
1148
|
id: gameId
|
|
@@ -1150,6 +1158,7 @@ async function activateNextPeriod({ gameId }, ctx, { reducers }) {
|
|
|
1150
1158
|
status: "PREPARATION" /* Preparation */
|
|
1151
1159
|
}
|
|
1152
1160
|
}),
|
|
1161
|
+
// create PERIOD_START results based on the previous PERIOD_END results
|
|
1153
1162
|
ctx.prisma.period.update({
|
|
1154
1163
|
where: {
|
|
1155
1164
|
gameId_index: {
|
|
@@ -1229,6 +1238,7 @@ async function activateNextSegment({ gameId }, ctx, { reducers }) {
|
|
|
1229
1238
|
status: "RUNNING" /* Running */
|
|
1230
1239
|
}
|
|
1231
1240
|
}),
|
|
1241
|
+
// update the active segment of the current period
|
|
1232
1242
|
ctx.prisma.period.update({
|
|
1233
1243
|
where: {
|
|
1234
1244
|
gameId_index: {
|
|
@@ -1249,6 +1259,7 @@ async function activateNextSegment({ gameId }, ctx, { reducers }) {
|
|
|
1249
1259
|
}
|
|
1250
1260
|
}
|
|
1251
1261
|
}),
|
|
1262
|
+
// SEGMENT INITIALIZATION
|
|
1252
1263
|
ctx.prisma.periodSegment.update({
|
|
1253
1264
|
where: {
|
|
1254
1265
|
gameId_periodIx_index: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gbl-uzh/platform",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "LGPL-3.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,31 +21,31 @@
|
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@graphql-codegen/cli": "2.
|
|
25
|
-
"@graphql-codegen/fragment-matcher": "
|
|
26
|
-
"@graphql-codegen/introspection": "
|
|
27
|
-
"@graphql-codegen/typed-document-node": "
|
|
28
|
-
"@graphql-codegen/typescript": "
|
|
29
|
-
"@graphql-codegen/typescript-operations": "
|
|
30
|
-
"@graphql-codegen/typescript-resolvers": "
|
|
24
|
+
"@graphql-codegen/cli": "3.2.2",
|
|
25
|
+
"@graphql-codegen/fragment-matcher": "4.0.1",
|
|
26
|
+
"@graphql-codegen/introspection": "3.0.1",
|
|
27
|
+
"@graphql-codegen/typed-document-node": "3.0.2",
|
|
28
|
+
"@graphql-codegen/typescript": "3.0.2",
|
|
29
|
+
"@graphql-codegen/typescript-operations": "3.0.2",
|
|
30
|
+
"@graphql-codegen/typescript-resolvers": "3.1.1",
|
|
31
31
|
"@tsconfig/node18": "1.0.1",
|
|
32
|
-
"@tsconfig/recommended": "1.0.
|
|
32
|
+
"@tsconfig/recommended": "1.0.2",
|
|
33
33
|
"@types/jest": "^29.2.2",
|
|
34
34
|
"@types/node": "^18.11.9",
|
|
35
35
|
"cross-env": "7.0.3",
|
|
36
36
|
"fs-extra": "11.1.0",
|
|
37
|
-
"jest": "29.
|
|
37
|
+
"jest": "29.5.0",
|
|
38
38
|
"npm-run-all": "4.1.5",
|
|
39
|
-
"prisma": "4.
|
|
39
|
+
"prisma": "4.11.0",
|
|
40
40
|
"rollup-plugin-copy": "3.4.0",
|
|
41
|
-
"ts-jest": "29.0.
|
|
41
|
+
"ts-jest": "29.0.5",
|
|
42
42
|
"ts-node": "10.9.1",
|
|
43
|
-
"tsup": "6.
|
|
44
|
-
"typescript": "4.9.
|
|
43
|
+
"tsup": "6.6.3",
|
|
44
|
+
"typescript": "4.9.5"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@apollo/client": "^3.7.0",
|
|
48
|
-
"@prisma/client": "^4.
|
|
48
|
+
"@prisma/client": "^4.11.0",
|
|
49
49
|
"@uzh-bf/design-system": "^1.0.0",
|
|
50
50
|
"graphql": "^16.6.0",
|
|
51
51
|
"graphql-scalars": "^1.19.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"nookies": "^2.5.2",
|
|
57
57
|
"ramda": "^0.28.0",
|
|
58
58
|
"react": "^18.0.0",
|
|
59
|
-
"yup": "^1.0.0
|
|
59
|
+
"yup": "^1.0.0"
|
|
60
60
|
},
|
|
61
61
|
"volta": {
|
|
62
62
|
"extends": "../../package.json"
|