@gbl-uzh/platform 0.4.13 → 0.4.16
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/LICENSE.md +1 -1
- package/dist/index.d.ts +7 -1473
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -2012
- package/dist/index.js.map +1 -0
- package/dist/lib/SSELink.d.ts +9 -0
- package/dist/lib/SSELink.d.ts.map +1 -0
- package/dist/lib/SSELink.js +24 -0
- package/dist/lib/SSELink.js.map +1 -0
- package/dist/lib/apollo.d.ts +3 -4
- package/dist/lib/apollo.d.ts.map +1 -0
- package/dist/lib/apollo.js +50 -108
- package/dist/lib/apollo.js.map +1 -0
- package/dist/lib/constants.d.ts +8 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +11 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/pubsub.d.ts +5 -0
- package/dist/lib/pubsub.d.ts.map +1 -0
- package/dist/lib/pubsub.js +6 -0
- package/dist/lib/pubsub.js.map +1 -0
- package/dist/lib/util.d.ts +12 -13
- package/dist/lib/util.d.ts.map +1 -0
- package/dist/lib/util.js +63 -105
- package/dist/lib/util.js.map +1 -0
- package/dist/nexus.d.ts +11 -42
- package/dist/nexus.d.ts.map +1 -0
- package/dist/nexus.js +22 -2605
- package/dist/nexus.js.map +1 -0
- package/dist/ops/FGameData.graphql +1 -0
- package/dist/ops/FPeriodData.graphql +1 -0
- package/dist/ops/FPlayerData.graphql +0 -4
- package/dist/ops/FSegmentData.graphql +1 -0
- package/dist/ops/FStoryElementData.graphql +7 -0
- package/dist/ops/MActivateNextSegment.graphql +0 -3
- package/dist/ops/MAddGamePeriod.graphql +2 -2
- package/dist/ops/MUpdatePlayerData.graphql +1 -3
- package/dist/ops/QGame.graphql +2 -3
- package/dist/ops/QPastResults.graphql +0 -3
- package/dist/ops/QResult.graphql +4 -5
- package/dist/ops/QSpecificResults.graphql +11 -0
- package/dist/ops/QStoryElements.graphql +7 -0
- package/dist/schema.prisma +2 -3
- package/dist/services/AccountService.d.ts +65 -0
- package/dist/services/AccountService.d.ts.map +1 -0
- package/dist/services/AccountService.js +70 -0
- package/dist/services/AccountService.js.map +1 -0
- package/dist/services/EventService.d.ts +13 -0
- package/dist/services/EventService.d.ts.map +1 -0
- package/dist/services/EventService.js +180 -0
- package/dist/services/EventService.js.map +1 -0
- package/dist/services/GameService.d.ts +670 -0
- package/dist/services/GameService.d.ts.map +1 -0
- package/dist/services/GameService.js +1191 -0
- package/dist/services/GameService.js.map +1 -0
- package/dist/services/PlayService.d.ts +630 -0
- package/dist/services/PlayService.d.ts.map +1 -0
- package/dist/services/PlayService.js +534 -0
- package/dist/services/PlayService.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Achievement.d.ts +4 -0
- package/dist/types/Achievement.d.ts.map +1 -0
- package/dist/types/Achievement.js +35 -0
- package/dist/types/Achievement.js.map +1 -0
- package/dist/types/Game.d.ts +5 -0
- package/dist/types/Game.d.ts.map +1 -0
- package/dist/types/Game.js +85 -0
- package/dist/types/Game.js.map +1 -0
- package/dist/types/LearningElement.d.ts +5 -0
- package/dist/types/LearningElement.d.ts.map +1 -0
- package/dist/types/LearningElement.js +55 -0
- package/dist/types/LearningElement.js.map +1 -0
- package/dist/types/Mutation.d.ts +10 -0
- package/dist/types/Mutation.d.ts.map +1 -0
- package/dist/types/Mutation.js +194 -0
- package/dist/types/Mutation.js.map +1 -0
- package/dist/types/Player.d.ts +9 -0
- package/dist/types/Player.d.ts.map +1 -0
- package/dist/types/Player.js +139 -0
- package/dist/types/Player.js.map +1 -0
- package/dist/types/Query.d.ts +3 -0
- package/dist/types/Query.d.ts.map +1 -0
- package/dist/types/Query.js +91 -0
- package/dist/types/Query.js.map +1 -0
- package/dist/types/StoryElement.d.ts +3 -0
- package/dist/types/StoryElement.d.ts.map +1 -0
- package/dist/types/StoryElement.js +27 -0
- package/dist/types/StoryElement.js.map +1 -0
- package/dist/types/Subscription.d.ts +3 -0
- package/dist/types/Subscription.d.ts.map +1 -0
- package/dist/types/Subscription.js +35 -0
- package/dist/types/Subscription.js.map +1 -0
- package/dist/types.d.ts +139 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +26 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -38
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { objectType, intArg, nonNull, idArg, stringArg } from 'nexus';
|
|
2
|
+
import { getGames, getGame, getLearningElements, getStoryElements } from '../services/GameService.js';
|
|
3
|
+
import { getPlayerResult, getPlayerData, getLearningElement, getPlayerResults, getSpecificResults, getPastResults } from '../services/PlayService.js';
|
|
4
|
+
import { Game } from './Game.js';
|
|
5
|
+
import { LearningElement, LearningElementState } from './LearningElement.js';
|
|
6
|
+
import { PlayerState, Player, PlayerResult } from './Player.js';
|
|
7
|
+
import { StoryElement } from './StoryElement.js';
|
|
8
|
+
|
|
9
|
+
function generateBaseQueries() {
|
|
10
|
+
return objectType({
|
|
11
|
+
name: 'Query',
|
|
12
|
+
definition(t) {
|
|
13
|
+
t.list.nonNull.field('games', {
|
|
14
|
+
type: Game,
|
|
15
|
+
async resolve(_, args, ctx) {
|
|
16
|
+
return getGames(args, ctx);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
t.field('game', {
|
|
20
|
+
type: Game,
|
|
21
|
+
args: {
|
|
22
|
+
id: intArg(),
|
|
23
|
+
},
|
|
24
|
+
async resolve(_, args, ctx) {
|
|
25
|
+
return getGame(args, ctx);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
t.field('result', {
|
|
29
|
+
type: PlayerState,
|
|
30
|
+
async resolve(_, args, ctx) {
|
|
31
|
+
return getPlayerResult({ gameId: ctx.user.gameId, playerId: ctx.user.sub }, ctx);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
t.field('self', {
|
|
35
|
+
type: Player,
|
|
36
|
+
async resolve(_, args, ctx) {
|
|
37
|
+
if (!ctx.user)
|
|
38
|
+
return null;
|
|
39
|
+
return getPlayerData({ playerId: ctx.user.sub }, ctx);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
t.list.nonNull.field('learningElements', {
|
|
43
|
+
type: LearningElement,
|
|
44
|
+
async resolve(_, args, ctx) {
|
|
45
|
+
return getLearningElements(args, ctx);
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
t.field('learningElement', {
|
|
49
|
+
type: LearningElementState,
|
|
50
|
+
args: {
|
|
51
|
+
id: nonNull(idArg()),
|
|
52
|
+
},
|
|
53
|
+
async resolve(_, args, ctx) {
|
|
54
|
+
return getLearningElement(args, ctx);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
t.list.nonNull.field('results', {
|
|
58
|
+
type: PlayerResult,
|
|
59
|
+
async resolve(_, args, ctx) {
|
|
60
|
+
return getPlayerResults(args, ctx);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
t.list.nonNull.field('specificResults', {
|
|
64
|
+
type: PlayerResult,
|
|
65
|
+
args: {
|
|
66
|
+
gameId: nonNull(intArg()),
|
|
67
|
+
type: nonNull(stringArg()),
|
|
68
|
+
},
|
|
69
|
+
async resolve(_, args, ctx) {
|
|
70
|
+
return getSpecificResults(args, ctx);
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
t.list.nonNull.field('pastResults', {
|
|
74
|
+
type: PlayerResult,
|
|
75
|
+
async resolve(_, args, ctx) {
|
|
76
|
+
return getPastResults(args, ctx);
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
t.list.nonNull.field('storyElements', {
|
|
80
|
+
type: StoryElement,
|
|
81
|
+
async resolve(_, args, ctx) {
|
|
82
|
+
return getStoryElements(args, ctx);
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const Query = generateBaseQueries();
|
|
89
|
+
|
|
90
|
+
export { Query, generateBaseQueries };
|
|
91
|
+
//# sourceMappingURL=Query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Query.js","sources":["../../src/types/Query.ts"],"sourcesContent":[null],"names":["GameService.getGames","GameService.getGame","PlayService.getPlayerResult","PlayService.getPlayerData","GameService.getLearningElements","PlayService.getLearningElement","PlayService.getPlayerResults","PlayService.getSpecificResults","PlayService.getPastResults","GameService.getStoryElements"],"mappings":";;;;;;;;SAQgB,mBAAmB,GAAA;AACjC,IAAA,OAAO,UAAU,CAAC;AAChB,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,UAAU,CAAC,CAAC,EAAA;YACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE;AAC5B,gBAAA,IAAI,EAAE,IAAI;AACV,gBAAA,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;oBACxB,OAAOA,QAAoB,CAAC,IAAI,EAAE,GAAG,CAAC;iBACvC;AACF,aAAA,CAAC;AAEF,YAAA,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;AACd,gBAAA,IAAI,EAAE,IAAI;AACV,gBAAA,IAAI,EAAE;oBACJ,EAAE,EAAE,MAAM,EAAE;AACb,iBAAA;AACD,gBAAA,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;oBACxB,OAAOC,OAAmB,CAAC,IAAI,EAAE,GAAG,CAAC;iBACtC;AACF,aAAA,CAAC;AAEF,YAAA,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;AAChB,gBAAA,IAAI,EAAE,WAAW;AACjB,gBAAA,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;oBACxB,OAAOC,eAA2B,CAChC,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAA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AC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE;AACtC,gBAAA,IAAI,EAAE,YAAY;AAClB,gBAAA,IAAI,EAAE;AACJ,oBAAA,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AACzB,oBAAA,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;AAC3B,iBAAA;AACD,gBAAA,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;oBACxB,OAAOC,kBAA8B,CAAC,IAAI,EAAE,GAAG,CAAC;iBACjD;AACF,aAAA,CAAC;YAEF,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE;AAClC,gBAAA,IAAI,EAAE,YAAY;AAClB,gBAAA,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;oBACxB,OAAOC,cAA0B,CAAC,IAAI,EAAE,GAAG,CAAC;iBAC7C;AACF,aAAA,CAAC;YAEF,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE;AACpC,gBAAA,IAAI,EAAE,YAAY;AAClB,gBAAA,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;oBACxB,OAAOC,gBAA4B,CAAC,IAAI,EAAE,GAAG,CAAC;iBAC/C;AACF,aAAA,CAAC;SACH;AACF,KAAA,CAAC;AACJ;AAEa,MAAA,KAAK,GAAG,mBAAmB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoryElement.d.ts","sourceRoot":"","sources":["../../src/types/StoryElement.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,mEAG3B,CAAA;AAEF,eAAO,MAAM,YAAY,iEAmBvB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as DB from '@prisma/client';
|
|
2
|
+
import { enumType, objectType } from 'nexus';
|
|
3
|
+
|
|
4
|
+
const StoryElementType = enumType({
|
|
5
|
+
name: 'StoryElementType',
|
|
6
|
+
members: Object.values(DB.StoryElementType),
|
|
7
|
+
});
|
|
8
|
+
const StoryElement = objectType({
|
|
9
|
+
name: 'StoryElement',
|
|
10
|
+
definition(t) {
|
|
11
|
+
t.nonNull.id('id');
|
|
12
|
+
t.nonNull.field('type', {
|
|
13
|
+
type: StoryElementType,
|
|
14
|
+
});
|
|
15
|
+
t.nonNull.string('title');
|
|
16
|
+
t.string('content');
|
|
17
|
+
t.field('contentRole', {
|
|
18
|
+
type: 'JSONObject',
|
|
19
|
+
});
|
|
20
|
+
t.field('reward', {
|
|
21
|
+
type: 'JSONObject',
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { StoryElement, StoryElementType };
|
|
27
|
+
//# sourceMappingURL=StoryElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoryElement.js","sources":["../../src/types/StoryElement.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAIO,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AACvC,IAAA,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC;AAC5C,CAAA;AAEM,MAAM,YAAY,GAAG,UAAU,CAAC;AACrC,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,UAAU,CAAC,CAAC,EAAA;AACV,QAAA,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC;AAElB,QAAA,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE;AACtB,YAAA,IAAI,EAAE,gBAAgB;AACvB,SAAA,CAAC;AACF,QAAA,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;AAEzB,QAAA,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;AACnB,QAAA,CAAC,CAAC,KAAK,CAAC,aAAa,EAAE;AACrB,YAAA,IAAI,EAAE,YAAY;AACnB,SAAA,CAAC;AAEF,QAAA,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;AAChB,YAAA,IAAI,EAAE,YAAY;AACnB,SAAA,CAAC;KACH;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../src/types/Subscription.ts"],"names":[],"mappings":"AAIA,wBAAgB,yBAAyB,4DA2BxC;AAED,eAAO,MAAM,YAAY,yDAA8B,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { subscriptionType } from 'nexus';
|
|
2
|
+
import { pubSub } from '../lib/pubsub.js';
|
|
3
|
+
import { Event } from '../nexus.js';
|
|
4
|
+
|
|
5
|
+
function generateBaseSubscriptions() {
|
|
6
|
+
return subscriptionType({
|
|
7
|
+
definition(t) {
|
|
8
|
+
t.list.nonNull.field('eventsGlobal', {
|
|
9
|
+
type: Event,
|
|
10
|
+
async subscribe(_, args, ctx) {
|
|
11
|
+
return pubSub.subscribe('global:events');
|
|
12
|
+
},
|
|
13
|
+
async resolve(payload) {
|
|
14
|
+
return payload;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
t.list.nonNull.field('eventsUser', {
|
|
18
|
+
type: Event,
|
|
19
|
+
async subscribe(_, args, ctx) {
|
|
20
|
+
if (ctx.user) {
|
|
21
|
+
return pubSub.subscribe('user:events', String(ctx.user.sub));
|
|
22
|
+
}
|
|
23
|
+
return pubSub.subscribe('user:events', 'anonymous');
|
|
24
|
+
},
|
|
25
|
+
async resolve(payload) {
|
|
26
|
+
return payload;
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const Subscription = generateBaseSubscriptions();
|
|
33
|
+
|
|
34
|
+
export { Subscription, generateBaseSubscriptions };
|
|
35
|
+
//# sourceMappingURL=Subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscription.js","sources":["../../src/types/Subscription.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;SAIgB,yBAAyB,GAAA;AACvC,IAAA,OAAO,gBAAgB,CAAC;AACtB,QAAA,UAAU,CAAC,CAAC,EAAA;YACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE;AACnC,gBAAA,IAAI,EAAE,KAAK;AACX,gBAAA,MAAM,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;AAC1B,oBAAA,OAAO,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;iBACzC;gBACD,MAAM,OAAO,CAAC,OAAO,EAAA;AACnB,oBAAA,OAAO,OAAc;iBACtB;AACF,aAAA,CAAC;YACF,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE;AACjC,gBAAA,IAAI,EAAE,KAAK;AACX,gBAAA,MAAM,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAA;AAC1B,oBAAA,IAAI,GAAG,CAAC,IAAI,EAAE;AACZ,wBAAA,OAAO,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;oBAG9D,OAAO,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,WAAW,CAAC;iBACpD;gBACD,MAAM,OAAO,CAAC,OAAO,EAAA;AACnB,oBAAA,OAAO,OAAc;iBACtB;AACF,aAAA,CAAC;SACH;AACF,KAAA,CAAC;AACJ;AAEa,MAAA,YAAY,GAAG,yBAAyB;;;;"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { NextPageContext } from 'next';
|
|
2
|
+
import type yup from 'yup';
|
|
3
|
+
export declare enum UserRole {
|
|
4
|
+
PLAYER = "PLAYER",
|
|
5
|
+
ADMIN = "ADMIN"
|
|
6
|
+
}
|
|
7
|
+
export type UpdatePlayerDataArgs<PlayerFactsType> = {
|
|
8
|
+
name?: string;
|
|
9
|
+
facts: PlayerFactsType;
|
|
10
|
+
};
|
|
11
|
+
export declare enum LearningElementState {
|
|
12
|
+
NEW = "NEW",
|
|
13
|
+
ATTEMPTED = "ATTEMPTED",
|
|
14
|
+
SOLVED = "SOLVED"
|
|
15
|
+
}
|
|
16
|
+
export type Notification<NotificationType> = {
|
|
17
|
+
type: NotificationType;
|
|
18
|
+
sub?: string;
|
|
19
|
+
facts?: any;
|
|
20
|
+
};
|
|
21
|
+
export type Event<EventType> = {
|
|
22
|
+
type: EventType;
|
|
23
|
+
sub?: string;
|
|
24
|
+
facts?: any;
|
|
25
|
+
};
|
|
26
|
+
export type OutputFactsUser<FactsType, NotificationType, EventType> = {
|
|
27
|
+
result: FactsType;
|
|
28
|
+
isDirty?: boolean;
|
|
29
|
+
extras?: any;
|
|
30
|
+
actions?: any[];
|
|
31
|
+
notifications?: Notification<NotificationType>[];
|
|
32
|
+
events?: Event<EventType>[];
|
|
33
|
+
};
|
|
34
|
+
export type OutputFacts<FactsType, NotificationType, EventType> = {
|
|
35
|
+
resultFacts: FactsType;
|
|
36
|
+
actions?: any[];
|
|
37
|
+
extras?: any;
|
|
38
|
+
events?: Event<EventType>[];
|
|
39
|
+
notifications?: Notification<NotificationType>[];
|
|
40
|
+
};
|
|
41
|
+
export type Action<ActionType, PayloadType, PrismaType> = {
|
|
42
|
+
type: ActionType;
|
|
43
|
+
payload: PayloadType;
|
|
44
|
+
ctx?: CtxWithPrisma<PrismaType>;
|
|
45
|
+
};
|
|
46
|
+
export type PayloadPeriodInitialisation<PeriodFactsType, PeriodSegmentFactsType> = {
|
|
47
|
+
periodIx: number;
|
|
48
|
+
periodFacts: PeriodFactsType;
|
|
49
|
+
previousPeriodFacts?: PeriodFactsType;
|
|
50
|
+
previousSegmentFacts?: PeriodSegmentFactsType;
|
|
51
|
+
};
|
|
52
|
+
export type PayloadPeriodConsolidation<PeriodSegmentFactsType> = {
|
|
53
|
+
periodIx: number;
|
|
54
|
+
previousSegmentFacts?: PeriodSegmentFactsType;
|
|
55
|
+
};
|
|
56
|
+
export type PayloadPeriodResult<PeriodFactsType, PlayerRoleType> = {
|
|
57
|
+
playerRole: PlayerRoleType;
|
|
58
|
+
periodFacts: PeriodFactsType;
|
|
59
|
+
};
|
|
60
|
+
export type PayloadPeriodResultEnd<ResultsFactsType, PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType> = {
|
|
61
|
+
segmentEndResults: ResultsFactsType;
|
|
62
|
+
periodFacts: PeriodFactsType;
|
|
63
|
+
segmentFacts: PeriodSegmentFactsType;
|
|
64
|
+
playerRole: PlayerRoleType;
|
|
65
|
+
playerLevel: number;
|
|
66
|
+
playerExperience: number;
|
|
67
|
+
consolidationDecisions: any;
|
|
68
|
+
periodIx: number;
|
|
69
|
+
segmentIx: number;
|
|
70
|
+
};
|
|
71
|
+
export type PayloadSegment<PeriodFactsType, PeriodSegmentFactsType> = {
|
|
72
|
+
segmentIx: number;
|
|
73
|
+
segmentCount: number;
|
|
74
|
+
periodIx: number;
|
|
75
|
+
periodFacts: PeriodFactsType;
|
|
76
|
+
previousSegmentFacts?: PeriodSegmentFactsType;
|
|
77
|
+
};
|
|
78
|
+
export type PayloadSegmentResult<PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType> = {
|
|
79
|
+
playerRole: PlayerRoleType;
|
|
80
|
+
periodFacts: PeriodFactsType;
|
|
81
|
+
segmentFacts: PeriodSegmentFactsType;
|
|
82
|
+
nextSegmentFacts?: PeriodSegmentFactsType;
|
|
83
|
+
segmentIx: number;
|
|
84
|
+
};
|
|
85
|
+
interface Period<FactsType, PeriodFactsType, PeriodSegmentFactsType, NotificationType, EventType, PrismaType> {
|
|
86
|
+
initialize: (facts: FactsType, payload: PayloadPeriodInitialisation<PeriodFactsType, PeriodSegmentFactsType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
87
|
+
consolidate: (facts: FactsType, payload: PayloadPeriodConsolidation<PeriodSegmentFactsType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
88
|
+
}
|
|
89
|
+
interface PeriodResult<FactsType, ResultFactsType, PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType, NotificationType, EventType, PrismaType> {
|
|
90
|
+
initialize: (facts: FactsType, payload: PayloadPeriodResult<PeriodFactsType, PlayerRoleType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
91
|
+
start: (facts: FactsType, payload: PayloadPeriodResult<PeriodFactsType, PlayerRoleType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
92
|
+
end: (facts: FactsType, payload: PayloadPeriodResultEnd<ResultFactsType, PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
93
|
+
}
|
|
94
|
+
interface Segment<FactsType, PeriodFactsType, PeriodSegmentFactsType, NotificationType, EventType, PrismaType> {
|
|
95
|
+
initialize: (facts: FactsType, payload: PayloadSegment<PeriodFactsType, PeriodSegmentFactsType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
96
|
+
}
|
|
97
|
+
interface SegmentResult<FactsType, PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType, NotificationType, EventType, PrismaType> {
|
|
98
|
+
initialize: (facts: FactsType, payload: PayloadSegmentResult<PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
99
|
+
start: (facts: FactsType, payload: PayloadSegmentResult<PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
100
|
+
end: (facts: FactsType, payload: PayloadSegmentResult<PeriodFactsType, PeriodSegmentFactsType, PlayerRoleType>) => OutputFacts<FactsType, NotificationType, EventType>;
|
|
101
|
+
}
|
|
102
|
+
interface Reducer<StateType, ActionType, PayloadType, NotificationType, EventType, PrismaType> {
|
|
103
|
+
apply: (state: StateType, action: Action<ActionType, PayloadType, PrismaType>) => OutputFactsUser<StateType, NotificationType, EventType>;
|
|
104
|
+
ActionTypes: Record<string, string>;
|
|
105
|
+
}
|
|
106
|
+
interface Services<PrismaType> {
|
|
107
|
+
Actions: Reducer<any, any, any, any, any, PrismaType>;
|
|
108
|
+
Period: Period<any, any, any, any, any, PrismaType>;
|
|
109
|
+
PeriodResult: PeriodResult<any, any, any, any, any, any, any, PrismaType>;
|
|
110
|
+
Segment: Segment<any, any, any, any, any, PrismaType>;
|
|
111
|
+
SegmentResult: SegmentResult<any, any, any, any, any, any, PrismaType>;
|
|
112
|
+
}
|
|
113
|
+
export interface CtxWithPrisma<PrismaType> extends NextPageContext {
|
|
114
|
+
prisma: PrismaType;
|
|
115
|
+
user: {
|
|
116
|
+
sub: string;
|
|
117
|
+
role: UserRole;
|
|
118
|
+
gameId?: number;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export interface CtxWithFacts<FactsType, PrismaType> {
|
|
122
|
+
services: Services<PrismaType>;
|
|
123
|
+
}
|
|
124
|
+
export interface CtxWithFactsAndSchema<FactsType, PrismaType> {
|
|
125
|
+
schema: yup.Schema<FactsType>;
|
|
126
|
+
services: Services<PrismaType>;
|
|
127
|
+
}
|
|
128
|
+
export declare enum BaseGlobalNotificationType {
|
|
129
|
+
PERIOD_ACTIVATED = "PERIOD_ACTIVATED",
|
|
130
|
+
SEGMENT_ACTIVATED = "SEGMENT_ACTIVATED"
|
|
131
|
+
}
|
|
132
|
+
export declare enum BaseUserNotificationType {
|
|
133
|
+
LEARNING_ELEMENT_SOLVED = "LEARNING_ELEMENT_SOLVED",
|
|
134
|
+
LEARNING_ELEMENT_INCORRECT = "LEARNING_ELEMENT_INCORRECT",
|
|
135
|
+
ACHIEVEMENT_RECEIVED = "ACHIEVEMENT_RECEIVED",
|
|
136
|
+
LEVEL_UP = "LEVEL_UP"
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=types.d.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EAAE,UAAU;IAC1D,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAA;CAC/B;AAED,oBAAY,0BAA0B;IACpC,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,wBAAwB;IAClC,uBAAuB,4BAA4B;IACnD,0BAA0B,+BAA+B;IACzD,oBAAoB,yBAAyB;IAC7C,QAAQ,aAAa;CACtB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var UserRole;
|
|
2
|
+
(function (UserRole) {
|
|
3
|
+
UserRole["PLAYER"] = "PLAYER";
|
|
4
|
+
UserRole["ADMIN"] = "ADMIN";
|
|
5
|
+
})(UserRole || (UserRole = {}));
|
|
6
|
+
var LearningElementState;
|
|
7
|
+
(function (LearningElementState) {
|
|
8
|
+
LearningElementState["NEW"] = "NEW";
|
|
9
|
+
LearningElementState["ATTEMPTED"] = "ATTEMPTED";
|
|
10
|
+
LearningElementState["SOLVED"] = "SOLVED";
|
|
11
|
+
})(LearningElementState || (LearningElementState = {}));
|
|
12
|
+
var BaseGlobalNotificationType;
|
|
13
|
+
(function (BaseGlobalNotificationType) {
|
|
14
|
+
BaseGlobalNotificationType["PERIOD_ACTIVATED"] = "PERIOD_ACTIVATED";
|
|
15
|
+
BaseGlobalNotificationType["SEGMENT_ACTIVATED"] = "SEGMENT_ACTIVATED";
|
|
16
|
+
})(BaseGlobalNotificationType || (BaseGlobalNotificationType = {}));
|
|
17
|
+
var BaseUserNotificationType;
|
|
18
|
+
(function (BaseUserNotificationType) {
|
|
19
|
+
BaseUserNotificationType["LEARNING_ELEMENT_SOLVED"] = "LEARNING_ELEMENT_SOLVED";
|
|
20
|
+
BaseUserNotificationType["LEARNING_ELEMENT_INCORRECT"] = "LEARNING_ELEMENT_INCORRECT";
|
|
21
|
+
BaseUserNotificationType["ACHIEVEMENT_RECEIVED"] = "ACHIEVEMENT_RECEIVED";
|
|
22
|
+
BaseUserNotificationType["LEVEL_UP"] = "LEVEL_UP";
|
|
23
|
+
})(BaseUserNotificationType || (BaseUserNotificationType = {}));
|
|
24
|
+
|
|
25
|
+
export { BaseGlobalNotificationType, BaseUserNotificationType, LearningElementState, UserRole };
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":[null],"names":[],"mappings":"IAGY;AAAZ,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;IAOW;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA;IAgPW;AAAZ,CAAA,UAAY,0BAA0B,EAAA;AACpC,IAAA,0BAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACrC,IAAA,0BAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACzC,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,GAGrC,EAAA,CAAA,CAAA;IAEW;AAAZ,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,yBAAA,CAAA,GAAA,yBAAmD;AACnD,IAAA,wBAAA,CAAA,4BAAA,CAAA,GAAA,4BAAyD;AACzD,IAAA,wBAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C;AAC7C,IAAA,wBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,GAKnC,EAAA,CAAA,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gbl-uzh/platform",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"license": "LGPL-3.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,57 +8,61 @@
|
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"nanoid": "
|
|
11
|
+
"nanoid": "5.0.8",
|
|
12
12
|
"random-js": "2.1.0",
|
|
13
|
-
"winston": "3.
|
|
13
|
+
"winston": "3.17.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
16
|
+
"@rollup/plugin-node-resolve": "~15.3.0",
|
|
17
|
+
"@rollup/plugin-typescript": "~12.1.1",
|
|
18
18
|
"@types/jest": "^29.2.2",
|
|
19
|
-
"@types/
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
19
|
+
"@types/jsonwebtoken": "^9.0.6",
|
|
20
|
+
"@types/node": "^20.17.6",
|
|
21
|
+
"@types/ramda": "^0.30.2",
|
|
22
|
+
"@types/react": "^18.3.12",
|
|
23
|
+
"cross-env": "~7.0.3",
|
|
24
|
+
"fs-extra": "~11.2.0",
|
|
25
|
+
"jest": "~29.7.0",
|
|
26
|
+
"npm-run-all": "~4.1.5",
|
|
27
|
+
"rollup": "~4.25.0",
|
|
28
|
+
"rollup-plugin-copy": "~3.5.0",
|
|
29
|
+
"ts-jest": "~29.2.5",
|
|
30
|
+
"tsx": "~4.19.2",
|
|
31
|
+
"typescript": "~5.6.3"
|
|
28
32
|
},
|
|
29
33
|
"peerDependencies": {
|
|
30
|
-
"@apollo/client": "3.
|
|
31
|
-
"@prisma/client": "5.
|
|
32
|
-
"
|
|
33
|
-
"graphql": "16.
|
|
34
|
-
"graphql-scalars": "1.
|
|
35
|
-
"graphql-sse": "2.
|
|
36
|
-
"graphql-yoga": "4.0.4",
|
|
37
|
-
"jsonwebtoken": "9.0.2",
|
|
38
|
-
"next": "
|
|
39
|
-
"next-auth": "4.
|
|
40
|
-
"nexus": "1.3.0",
|
|
41
|
-
"nookies": "2.5.2",
|
|
42
|
-
"prisma": "5.
|
|
43
|
-
"ramda": "0.
|
|
44
|
-
"react": "18.
|
|
45
|
-
"yup": "1.
|
|
34
|
+
"@apollo/client": "^3.11.10",
|
|
35
|
+
"@prisma/client": "^5.22.0",
|
|
36
|
+
"dayjs": "^1.11.13",
|
|
37
|
+
"graphql": "^16.9.0",
|
|
38
|
+
"graphql-scalars": "^1.23.0",
|
|
39
|
+
"graphql-sse": "^2.5.3",
|
|
40
|
+
"graphql-yoga": "^4.0.4",
|
|
41
|
+
"jsonwebtoken": "^9.0.2",
|
|
42
|
+
"next": "^15.0.3",
|
|
43
|
+
"next-auth": "^4.24.10",
|
|
44
|
+
"nexus": "^1.3.0",
|
|
45
|
+
"nookies": "^2.5.2",
|
|
46
|
+
"prisma": "^5.22.0",
|
|
47
|
+
"ramda": "^0.30.1",
|
|
48
|
+
"react": "^18.3.1",
|
|
49
|
+
"yup": "^1.4.0"
|
|
46
50
|
},
|
|
47
51
|
"scripts": {
|
|
48
|
-
"build": "
|
|
49
|
-
"build:nexus": "
|
|
50
|
-
"build:ts": "cross-env NODE_ENV=production
|
|
51
|
-
"dev": "cross-env NODE_ENV=development
|
|
52
|
-
"generate": "prisma generate"
|
|
53
|
-
"prebuild": "npm run generate"
|
|
52
|
+
"build": "run-s generate build:nexus build:ts",
|
|
53
|
+
"build:nexus": "tsx src/nexus.ts",
|
|
54
|
+
"build:ts": "cross-env NODE_ENV=production rollup -c",
|
|
55
|
+
"dev": "cross-env NODE_ENV=development rollup -c --watch",
|
|
56
|
+
"generate": "prisma generate"
|
|
54
57
|
},
|
|
55
58
|
"engines": {
|
|
56
|
-
"node": "
|
|
59
|
+
"node": "=20"
|
|
57
60
|
},
|
|
58
61
|
"volta": {
|
|
59
62
|
"extends": "../../package.json"
|
|
60
63
|
},
|
|
61
64
|
"prisma": {
|
|
62
65
|
"schema": "public/schema.prisma"
|
|
63
|
-
}
|
|
66
|
+
},
|
|
67
|
+
"type": "module"
|
|
64
68
|
}
|