@gbl-uzh/platform 0.4.47 → 0.4.49
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/nexus.js +1 -1
- package/dist/ops/QResult.graphql +1 -0
- package/dist/services/PlayService.d.ts.map +1 -1
- package/dist/services/PlayService.js +3 -6
- package/dist/services/PlayService.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Game.d.ts +9 -0
- package/dist/types/Game.d.ts.map +1 -1
- package/dist/types/Game.js +39 -27
- package/dist/types/Game.js.map +1 -1
- package/package.json +1 -1
package/dist/types/Game.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export declare const GameStatus: import("nexus/dist/core.js").NexusEnumTypeDef<"GameStatus">;
|
|
2
|
+
export interface GenerateBaseGameOpts {
|
|
3
|
+
resolveNextAutoContinueAt?: (parent: any, args: any, ctx: any, info: any) => Date | null | Promise<Date | null>;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Factory that returns the base `Game` objectType with an optional
|
|
7
|
+
* custom resolver for `nextAutoContinueAt`. Games that don't need the
|
|
8
|
+
* field get a default `() => null` resolver.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateBaseGame(opts?: GenerateBaseGameOpts): import("nexus/dist/core.js").NexusObjectTypeDef<"Game">;
|
|
2
11
|
export declare const Game: import("nexus/dist/core.js").NexusObjectTypeDef<"Game">;
|
|
3
12
|
export declare const Period: import("nexus/dist/core.js").NexusObjectTypeDef<"Period">;
|
|
4
13
|
export declare const PeriodSegment: import("nexus/dist/core.js").NexusObjectTypeDef<"PeriodSegment">;
|
package/dist/types/Game.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Game.d.ts","sourceRoot":"","sources":["../../src/types/Game.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU,6DAGrB,CAAA;AAEF,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Game.d.ts","sourceRoot":"","sources":["../../src/types/Game.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU,6DAGrB,CAAA;AAEF,MAAM,WAAW,oBAAoB;IACnC,yBAAyB,CAAC,EAAE,CAC1B,MAAM,EAAE,GAAG,EACX,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,GAAG,KACN,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;CACxC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,oBAAoB,2DAmC3D;AAED,eAAO,MAAM,IAAI,yDAAqB,CAAA;AAEtC,eAAO,MAAM,MAAM,2DA0BjB,CAAA;AAEF,eAAO,MAAM,aAAa,kEA+BxB,CAAA"}
|
package/dist/types/Game.js
CHANGED
|
@@ -1,38 +1,50 @@
|
|
|
1
1
|
import * as DB from '@prisma/client';
|
|
2
2
|
import { enumType, objectType } from 'nexus';
|
|
3
3
|
import { LearningElement } from './LearningElement.js';
|
|
4
|
-
import {
|
|
4
|
+
import { PlayerAction, PlayerResult, Player } from './Player.js';
|
|
5
5
|
import { StoryElement } from './StoryElement.js';
|
|
6
6
|
|
|
7
7
|
const GameStatus = enumType({
|
|
8
8
|
name: 'GameStatus',
|
|
9
9
|
members: Object.values(DB.GameStatus),
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
t
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Factory that returns the base `Game` objectType with an optional
|
|
13
|
+
* custom resolver for `nextAutoContinueAt`. Games that don't need the
|
|
14
|
+
* field get a default `() => null` resolver.
|
|
15
|
+
*/
|
|
16
|
+
function generateBaseGame(opts) {
|
|
17
|
+
return objectType({
|
|
18
|
+
name: 'Game',
|
|
19
|
+
definition(t) {
|
|
20
|
+
t.nonNull.id('id');
|
|
21
|
+
t.nonNull.field('status', {
|
|
22
|
+
type: GameStatus,
|
|
23
|
+
});
|
|
24
|
+
t.nonNull.string('name');
|
|
25
|
+
t.nonNull.int('version');
|
|
26
|
+
t.int('activePeriodIx');
|
|
27
|
+
t.field('activePeriod', {
|
|
28
|
+
type: Period,
|
|
29
|
+
});
|
|
30
|
+
t.int('activeSegmentIx');
|
|
31
|
+
t.nonNull.list.nonNull.field('players', {
|
|
32
|
+
type: Player,
|
|
33
|
+
});
|
|
34
|
+
t.nonNull.list.nonNull.field('periods', {
|
|
35
|
+
type: Period,
|
|
36
|
+
});
|
|
37
|
+
t.nonNull.field('facts', {
|
|
38
|
+
type: 'JSONObject',
|
|
39
|
+
});
|
|
40
|
+
t.nullable.field('nextAutoContinueAt', {
|
|
41
|
+
type: 'DateTime',
|
|
42
|
+
resolve: opts?.resolveNextAutoContinueAt ?? (() => null),
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const Game = generateBaseGame();
|
|
36
48
|
const Period = objectType({
|
|
37
49
|
name: 'Period',
|
|
38
50
|
definition(t) {
|
|
@@ -85,5 +97,5 @@ const PeriodSegment = objectType({
|
|
|
85
97
|
},
|
|
86
98
|
});
|
|
87
99
|
|
|
88
|
-
export { Game, GameStatus, Period, PeriodSegment };
|
|
100
|
+
export { Game, GameStatus, Period, PeriodSegment, generateBaseGame };
|
|
89
101
|
//# sourceMappingURL=Game.js.map
|
package/dist/types/Game.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Game.js","sources":["../../src/types/Game.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAOO,MAAM,UAAU,GAAG,QAAQ,CAAC;AACjC,IAAA,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC;AACtC,CAAA;
|
|
1
|
+
{"version":3,"file":"Game.js","sources":["../../src/types/Game.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAOO,MAAM,UAAU,GAAG,QAAQ,CAAC;AACjC,IAAA,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC;AACtC,CAAA;AAWD;;;;AAIG;AACG,SAAU,gBAAgB,CAAC,IAA2B,EAAA;AAC1D,IAAA,OAAO,UAAU,CAAC;AAChB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,UAAU,CAAC,CAAC,EAAA;AACV,YAAA,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC;AAElB,YAAA,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;AACxB,gBAAA,IAAI,EAAE,UAAU;AACjB,aAAA,CAAC;AACF,YAAA,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AACxB,YAAA,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;AACxB,YAAA,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;AACvB,YAAA,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE;AACtB,gBAAA,IAAI,EAAE,MAAM;AACb,aAAA,CAAC;AAEF,YAAA,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC;YAExB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE;AACtC,gBAAA,IAAI,EAAE,MAAM;AACb,aAAA,CAAC;YACF,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,S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