@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApolloLink, FetchResult, Observable, Operation } from '@apollo/client/core';
|
|
2
|
+
import { ClientOptions } from 'graphql-sse';
|
|
3
|
+
declare class SSELink extends ApolloLink {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(options: ClientOptions);
|
|
6
|
+
request(operation: Operation): Observable<FetchResult>;
|
|
7
|
+
}
|
|
8
|
+
export default SSELink;
|
|
9
|
+
//# sourceMappingURL=SSELink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSELink.d.ts","sourceRoot":"","sources":["../../src/lib/SSELink.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACV,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAU,aAAa,EAAgB,MAAM,aAAa,CAAA;AAEjE,cAAM,OAAQ,SAAQ,UAAU;IAC9B,OAAO,CAAC,MAAM,CAAQ;gBAEV,OAAO,EAAE,aAAa;IAKlB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAYvE;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ApolloLink, Observable } from '@apollo/client/core';
|
|
2
|
+
import { print } from 'graphql';
|
|
3
|
+
import { createClient } from 'graphql-sse';
|
|
4
|
+
|
|
5
|
+
// ref: https://the-guild.dev/graphql/sse/recipes#with-apollo
|
|
6
|
+
class SSELink extends ApolloLink {
|
|
7
|
+
client;
|
|
8
|
+
constructor(options) {
|
|
9
|
+
super();
|
|
10
|
+
this.client = createClient(options);
|
|
11
|
+
}
|
|
12
|
+
request(operation) {
|
|
13
|
+
return new Observable((sink) => {
|
|
14
|
+
return this.client.subscribe({ ...operation, query: print(operation.query) }, {
|
|
15
|
+
next: sink.next.bind(sink),
|
|
16
|
+
complete: sink.complete.bind(sink),
|
|
17
|
+
error: sink.error.bind(sink),
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { SSELink as default };
|
|
24
|
+
//# sourceMappingURL=SSELink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSELink.js","sources":["../../src/lib/SSELink.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;AAWA,MAAM,OAAQ,SAAQ,UAAU,CAAA;AACtB,IAAA,MAAM;AAEd,IAAA,WAAA,CAAY,OAAsB,EAAA;AAChC,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC;;AAGrB,IAAA,OAAO,CAAC,SAAoB,EAAA;AAC1C,QAAA,OAAO,IAAI,UAAU,CAAC,CAAC,IAAI,KAAI;AAC7B,YAAA,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAC1B,EAAE,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,EAC/C;gBACE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAClC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7B,aAAA,CACF;AACH,SAAC,CAAC;;AAEL;;;;"}
|
package/dist/lib/apollo.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
declare function initializeApollo(initialState?: null): any;
|
|
2
|
-
declare function useApollo(initialState: any): any;
|
|
3
|
-
|
|
4
|
-
export { initializeApollo, useApollo };
|
|
1
|
+
export declare function initializeApollo(initialState?: null): any;
|
|
2
|
+
export declare function useApollo(initialState: any): any;
|
|
3
|
+
//# sourceMappingURL=apollo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apollo.d.ts","sourceRoot":"","sources":["../../src/lib/apollo.ts"],"names":[],"mappings":"AAoDA,wBAAgB,gBAAgB,CAAC,YAAY,OAAO,OAcnD;AAED,wBAAgB,SAAS,CAAC,YAAY,KAAA,OAGrC"}
|
package/dist/lib/apollo.js
CHANGED
|
@@ -1,119 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
import { ApolloClient, InMemoryCache, split } from '@apollo/client';
|
|
2
|
+
import { HttpLink } from '@apollo/client/link/http';
|
|
3
|
+
import { getMainDefinition } from '@apollo/client/utilities';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import SSELink from './SSELink.js';
|
|
29
6
|
|
|
30
|
-
|
|
31
|
-
var apollo_exports = {};
|
|
32
|
-
__export(apollo_exports, {
|
|
33
|
-
initializeApollo: () => initializeApollo,
|
|
34
|
-
useApollo: () => useApollo
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(apollo_exports);
|
|
37
|
-
var import_client = require("@apollo/client");
|
|
38
|
-
var import_http = require("@apollo/client/link/http");
|
|
39
|
-
var import_utilities = require("@apollo/client/utilities");
|
|
40
|
-
var import_node_assert = __toESM(require("assert"));
|
|
41
|
-
var import_react = require("react");
|
|
42
|
-
|
|
43
|
-
// src/lib/SSELink.ts
|
|
44
|
-
var import_core = require("@apollo/client/core");
|
|
45
|
-
var import_graphql = require("graphql");
|
|
46
|
-
var import_graphql_sse = require("graphql-sse");
|
|
47
|
-
var SSELink = class extends import_core.ApolloLink {
|
|
48
|
-
client;
|
|
49
|
-
constructor(options) {
|
|
50
|
-
super();
|
|
51
|
-
this.client = (0, import_graphql_sse.createClient)(options);
|
|
52
|
-
}
|
|
53
|
-
request(operation) {
|
|
54
|
-
return new import_core.Observable((sink) => {
|
|
55
|
-
return this.client.subscribe(
|
|
56
|
-
{ ...operation, query: (0, import_graphql.print)(operation.query) },
|
|
57
|
-
{
|
|
58
|
-
next: sink.next.bind(sink),
|
|
59
|
-
complete: sink.complete.bind(sink),
|
|
60
|
-
error: sink.error.bind(sink)
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var SSELink_default = SSELink;
|
|
67
|
-
|
|
68
|
-
// src/lib/apollo.ts
|
|
69
|
-
var apolloClient;
|
|
7
|
+
let apolloClient;
|
|
70
8
|
function createIsomorphLink() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
url: process.env.NEXT_PUBLIC_API_URL,
|
|
80
|
-
credentials: "same-origin"
|
|
9
|
+
const isBrowser = typeof window !== 'undefined';
|
|
10
|
+
const apiUrl = process.env.NEXT_PUBLIC_API_URL;
|
|
11
|
+
if (typeof apiUrl !== 'string' || !apiUrl) {
|
|
12
|
+
throw new Error('NEXT_PUBLIC_API_URL is not set');
|
|
13
|
+
}
|
|
14
|
+
let httpLink = new HttpLink({
|
|
15
|
+
uri: apiUrl,
|
|
16
|
+
credentials: 'same-origin',
|
|
81
17
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
18
|
+
// on the client, differentiate between links for query/mutation and subscriptions
|
|
19
|
+
if (isBrowser) {
|
|
20
|
+
const sseLink = new SSELink({
|
|
21
|
+
url: apiUrl,
|
|
22
|
+
credentials: 'same-origin',
|
|
23
|
+
});
|
|
24
|
+
// swap out the http link with a split based on operation type
|
|
25
|
+
// use websocket link for subscriptions, http link for remainder
|
|
26
|
+
httpLink = split(({ query }) => {
|
|
27
|
+
const { kind, operation } = getMainDefinition(query);
|
|
28
|
+
return kind === 'OperationDefinition' && operation === 'subscription';
|
|
29
|
+
}, sseLink, httpLink);
|
|
30
|
+
}
|
|
31
|
+
return httpLink;
|
|
92
32
|
}
|
|
93
33
|
function createApolloClient() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
34
|
+
return new ApolloClient({
|
|
35
|
+
ssrMode: typeof window === 'undefined',
|
|
36
|
+
link: createIsomorphLink(),
|
|
37
|
+
cache: new InMemoryCache(),
|
|
38
|
+
});
|
|
99
39
|
}
|
|
100
40
|
function initializeApollo(initialState = null) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
41
|
+
const _apolloClient = apolloClient ?? createApolloClient();
|
|
42
|
+
// If your page has Next.js data fetching methods that use Apollo Client, the initial state
|
|
43
|
+
// gets hydrated here
|
|
44
|
+
if (initialState) {
|
|
45
|
+
_apolloClient.cache.restore(initialState);
|
|
46
|
+
}
|
|
47
|
+
// For SSG and SSR always create a new Apollo Client
|
|
48
|
+
if (typeof window === 'undefined')
|
|
49
|
+
return _apolloClient;
|
|
50
|
+
// Create the Apollo Client once in the client
|
|
51
|
+
if (!apolloClient)
|
|
52
|
+
apolloClient = _apolloClient;
|
|
106
53
|
return _apolloClient;
|
|
107
|
-
if (!apolloClient)
|
|
108
|
-
apolloClient = _apolloClient;
|
|
109
|
-
return _apolloClient;
|
|
110
54
|
}
|
|
111
55
|
function useApollo(initialState) {
|
|
112
|
-
|
|
113
|
-
|
|
56
|
+
const store = useMemo(() => initializeApollo(initialState), [initialState]);
|
|
57
|
+
return store;
|
|
114
58
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
useApollo
|
|
119
|
-
});
|
|
59
|
+
|
|
60
|
+
export { initializeApollo, useApollo };
|
|
61
|
+
//# sourceMappingURL=apollo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apollo.js","sources":["../../src/lib/apollo.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAOA,IAAI,YAAY;AAEhB,SAAS,kBAAkB,G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E,QAAA,OAAO,aAAa;;AAEvD,IAAA,IAAI,CAAC,YAAY;QAAE,YAAY,GAAG,aAAa;AAE/C,IAAA,OAAO,aAAa;AACtB;AAEM,SAAU,SAAS,CAAC,YAAY,EAAA;AACpC,IAAA,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;AAC3E,IAAA,OAAO,KAAK;AACd;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;CAMlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,QAAA,MAAM,MAAM,gBAQV,CAAA;AAEF,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import winston from 'winston';
|
|
2
|
+
|
|
3
|
+
const logger = winston.createLogger({
|
|
4
|
+
level: process.env.NODE_ENV === 'development' ? 'debug' : 'info',
|
|
5
|
+
format: winston.format.combine(winston.format.timestamp(), winston.format.json()),
|
|
6
|
+
defaultMeta: { service: '@gbl-uzh/platform' },
|
|
7
|
+
transports: [new winston.transports.Console()],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { logger as default };
|
|
11
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sources":["../../src/lib/logger.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;AAClC,IAAA,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM;IAChE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAC1B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CACtB;AACD,IAAA,WAAW,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;IAC7C,UAAU,EAAE,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;AAC/C,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pubsub.d.ts","sourceRoot":"","sources":["../../src/lib/pubsub.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;qBACA,CAAC,KAAK,EAAE,GAAG,CAAC;mBACd,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC;EAC1C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pubsub.js","sources":["../../src/lib/pubsub.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEa,MAAA,MAAM,GAAG,YAAY;;;;"}
|
package/dist/lib/util.d.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import * as DB from '@prisma/client';
|
|
2
|
-
|
|
3
|
-
declare function
|
|
4
|
-
declare function
|
|
5
|
-
declare function
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
declare function computePercentChange(newValue:
|
|
9
|
-
declare function withPercentChange(value:
|
|
10
|
-
declare enum STATUS {
|
|
2
|
+
export declare function setDifference(a: any, b: any, filterNoId?: boolean): any;
|
|
3
|
+
export declare function setIntersection(a: any, b: any): any;
|
|
4
|
+
export declare function debugLog(...args: any[]): void;
|
|
5
|
+
export declare function diceRoll(seeds?: number[]): number;
|
|
6
|
+
export declare function computeScenarioOutcome(trend: number, gap: number, diceRoll: number): number;
|
|
7
|
+
export declare function standardDeviation(arr: number[]): number;
|
|
8
|
+
export declare function computePercentChange(newValue: number, oldValue: number): number;
|
|
9
|
+
export declare function withPercentChange(value: number, percentChange: number): number;
|
|
10
|
+
export declare enum STATUS {
|
|
11
11
|
ACTIVE = "ACTIVE",
|
|
12
12
|
PAUSED = "PAUSED",
|
|
13
13
|
SCHEDULED = "SCHEDULED",
|
|
14
14
|
COMPLETED = "COMPLETED",
|
|
15
15
|
RESULTS = "RESULTS"
|
|
16
16
|
}
|
|
17
|
-
declare function computePeriodStatus(game: DB.Game, periodIndex: number): string;
|
|
18
|
-
declare function computeSegmentStatus(game: DB.Game, period: DB.Period, segmentIndex: number): string;
|
|
19
|
-
|
|
20
|
-
export { STATUS, computePercentChange, computePeriodStatus, computeScenarioOutcome, computeSegmentStatus, debugLog, diceRoll, setDifference, setIntersection, withPercentChange };
|
|
17
|
+
export declare function computePeriodStatus(game: DB.Game, periodIndex: number): string;
|
|
18
|
+
export declare function computeSegmentStatus(game: DB.Game, period: DB.Period, segmentIndex: number): string;
|
|
19
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/lib/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAIpC,wBAAgB,aAAa,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,UAAU,UAAQ,OAKrD;AAED,wBAAgB,eAAe,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,OAInC;AAED,wBAAgB,QAAQ,CAAC,GAAG,IAAI,OAAA,QAI/B;AAED,wBAAgB,QAAQ,CAAC,KAAK,GAAE,MAAM,EAAO,UAG5C;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,UAGjB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,UAM9C;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAEtE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAErE;AAED,oBAAY,MAAM;IAChB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,WAAW,EAAE,MAAM,GAClB,MAAM,CAmBR;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,MAAM,EAAE,EAAE,CAAC,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,MAAM,CAgBR"}
|
package/dist/lib/util.js
CHANGED
|
@@ -1,123 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
import * as DB from '@prisma/client';
|
|
2
|
+
import { MersenneTwister19937, integer } from 'random-js';
|
|
3
|
+
import util from 'util';
|
|
29
4
|
|
|
30
|
-
// src/lib/util.ts
|
|
31
|
-
var util_exports = {};
|
|
32
|
-
__export(util_exports, {
|
|
33
|
-
STATUS: () => STATUS,
|
|
34
|
-
computePercentChange: () => computePercentChange,
|
|
35
|
-
computePeriodStatus: () => computePeriodStatus,
|
|
36
|
-
computeScenarioOutcome: () => computeScenarioOutcome,
|
|
37
|
-
computeSegmentStatus: () => computeSegmentStatus,
|
|
38
|
-
debugLog: () => debugLog,
|
|
39
|
-
diceRoll: () => diceRoll,
|
|
40
|
-
setDifference: () => setDifference,
|
|
41
|
-
setIntersection: () => setIntersection,
|
|
42
|
-
withPercentChange: () => withPercentChange
|
|
43
|
-
});
|
|
44
|
-
module.exports = __toCommonJS(util_exports);
|
|
45
|
-
var DB = __toESM(require("@prisma/client"));
|
|
46
|
-
var import_random_js = require("random-js");
|
|
47
|
-
var import_util = __toESM(require("util"));
|
|
48
5
|
function setDifference(a, b, filterNoId = false) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
6
|
+
if (!b)
|
|
7
|
+
return a;
|
|
8
|
+
const A = a || [];
|
|
9
|
+
const B = new Set(b.map((item) => item.id));
|
|
10
|
+
return A.filter((item) => !B.has(item.id) || (filterNoId && !item.id));
|
|
54
11
|
}
|
|
55
12
|
function setIntersection(a, b) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
13
|
+
if (!a || !b)
|
|
14
|
+
return [];
|
|
15
|
+
const B = new Set(b.map((item) => item.id));
|
|
16
|
+
return a.filter((item) => B.has(item.id) && item.id);
|
|
60
17
|
}
|
|
61
18
|
function debugLog(...args) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
19
|
+
if (process.env.NODE_ENV === 'development') {
|
|
20
|
+
console.log(util.inspect(args, { showHidden: false, depth: null }));
|
|
21
|
+
}
|
|
65
22
|
}
|
|
66
23
|
function diceRoll(seeds = []) {
|
|
67
|
-
|
|
68
|
-
|
|
24
|
+
const rng = MersenneTwister19937.seedWithArray(seeds);
|
|
25
|
+
return integer(1, 6)(rng);
|
|
69
26
|
}
|
|
70
|
-
function computeScenarioOutcome(trend, gap,
|
|
71
|
-
|
|
27
|
+
function computeScenarioOutcome(trend, gap, diceRoll) {
|
|
28
|
+
return trend + (diceRoll - 7) * gap;
|
|
29
|
+
}
|
|
30
|
+
function standardDeviation(arr) {
|
|
31
|
+
const num = arr.length;
|
|
32
|
+
const mean = arr.reduce((acc, value) => acc + value, 0) / num;
|
|
33
|
+
const variance = arr.reduce((acc, value) => acc + Math.pow(value - mean, 2), 0) / (num - 1);
|
|
34
|
+
return Math.sqrt(variance);
|
|
72
35
|
}
|
|
73
36
|
function computePercentChange(newValue, oldValue) {
|
|
74
|
-
|
|
37
|
+
return (newValue - oldValue) / oldValue;
|
|
75
38
|
}
|
|
76
39
|
function withPercentChange(value, percentChange) {
|
|
77
|
-
|
|
40
|
+
return value * (1 + percentChange);
|
|
78
41
|
}
|
|
79
|
-
var STATUS
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})(STATUS || {});
|
|
42
|
+
var STATUS;
|
|
43
|
+
(function (STATUS) {
|
|
44
|
+
STATUS["ACTIVE"] = "ACTIVE";
|
|
45
|
+
STATUS["PAUSED"] = "PAUSED";
|
|
46
|
+
STATUS["SCHEDULED"] = "SCHEDULED";
|
|
47
|
+
STATUS["COMPLETED"] = "COMPLETED";
|
|
48
|
+
STATUS["RESULTS"] = "RESULTS";
|
|
49
|
+
})(STATUS || (STATUS = {}));
|
|
87
50
|
function computePeriodStatus(game, periodIndex) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
51
|
+
if (typeof game.activePeriodIx === 'number' &&
|
|
52
|
+
game.status === DB.GameStatus.RESULTS
|
|
53
|
+
? game.activePeriodIx - 1 === periodIndex
|
|
54
|
+
: game.activePeriodIx === periodIndex) {
|
|
55
|
+
if (game.status === DB.GameStatus.PAUSED)
|
|
56
|
+
return STATUS.PAUSED;
|
|
57
|
+
if (game.status === DB.GameStatus.RESULTS)
|
|
58
|
+
return STATUS.RESULTS;
|
|
59
|
+
return STATUS.ACTIVE;
|
|
60
|
+
}
|
|
61
|
+
if (typeof game.activePeriodIx === 'number' &&
|
|
62
|
+
game.activePeriodIx <= periodIndex)
|
|
63
|
+
return STATUS.SCHEDULED;
|
|
64
|
+
return STATUS.COMPLETED;
|
|
98
65
|
}
|
|
99
66
|
function computeSegmentStatus(game, period, segmentIndex) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
67
|
+
if (![
|
|
68
|
+
DB.GameStatus.PAUSED,
|
|
69
|
+
DB.GameStatus.PREPARATION,
|
|
70
|
+
DB.GameStatus.CONSOLIDATION,
|
|
71
|
+
DB.GameStatus.RESULTS,
|
|
72
|
+
].includes(game.status) &&
|
|
73
|
+
period.activeSegmentIx === segmentIndex)
|
|
74
|
+
return STATUS.ACTIVE;
|
|
75
|
+
if (period.activeSegmentIx > -2 && period.activeSegmentIx < segmentIndex)
|
|
76
|
+
return STATUS.SCHEDULED;
|
|
77
|
+
return STATUS.COMPLETED;
|
|
110
78
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
computePercentChange,
|
|
115
|
-
computePeriodStatus,
|
|
116
|
-
computeScenarioOutcome,
|
|
117
|
-
computeSegmentStatus,
|
|
118
|
-
debugLog,
|
|
119
|
-
diceRoll,
|
|
120
|
-
setDifference,
|
|
121
|
-
setIntersection,
|
|
122
|
-
withPercentChange
|
|
123
|
-
});
|
|
79
|
+
|
|
80
|
+
export { STATUS, computePercentChange, computePeriodStatus, computeScenarioOutcome, computeSegmentStatus, debugLog, diceRoll, setDifference, setIntersection, standardDeviation, withPercentChange };
|
|
81
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../src/lib/util.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIM,SAAU,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,KAAK,EAAA;AACpD,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,CAAC;AAChB,IAAA,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;AACjB,IAAA,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,IAAA,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,UAAU,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxE;AAEgB,SAAA,eAAe,CAAC,CAAC,EAAE,CAAC,EAAA;AAClC,IAAA,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,EAAE;AACvB,IAAA,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI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ACb,MAAiB,EACjB,YAAoB,EAAA;AAEpB,IAAA,IACE,CAAC;QACC,EAAE,CAAC,UAAU,CAAC,MAAM;QACpB,EAAE,CAAC,UAAU,CAAC,WAAW;QACzB,EAAE,CAAC,UAAU,CAAC,aAAa;QAC3B,EAAE,CAAC,UAAU,CAAC,OAAO;AACtB,KAAA,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAa,CAAC;QAC9B,MAAM,CAAC,eAAe,KAAK,YAAY;QAEvC,OAAO,MAAM,CAAC,MAAM;IAEtB,IAAI,MAAM,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,eAAe,GAAG,YAAY;QACtE,OAAO,MAAM,CAAC,SAAS;IAEzB,OAAO,MAAM,CAAC,SAAS;AACzB;;;;"}
|
package/dist/nexus.d.ts
CHANGED
|
@@ -1,42 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
interface GenerateBaseMutationsArgs {
|
|
14
|
-
reducers?: any;
|
|
15
|
-
schemas?: any;
|
|
16
|
-
inputTypes?: any;
|
|
17
|
-
roleAssigner?: (ix: number) => void;
|
|
18
|
-
}
|
|
19
|
-
declare function generateBaseMutations<PeriodFacts, PeriodSegmentFacts>({ reducers, roleAssigner, schemas, inputTypes, }?: GenerateBaseMutationsArgs): nexus_dist_core.NexusObjectTypeDef<"Mutation">;
|
|
20
|
-
declare const Mutation: nexus_dist_core.NexusObjectTypeDef<"Mutation">;
|
|
21
|
-
|
|
22
|
-
declare const PlayerDecisionType: nexus_dist_core.NexusEnumTypeDef<"PlayerDecisionType">;
|
|
23
|
-
declare const PlayerResultType: nexus_dist_core.NexusEnumTypeDef<"PlayerResultType">;
|
|
24
|
-
declare const PlayerLevel: nexus_dist_core.NexusObjectTypeDef<"PlayerLevel">;
|
|
25
|
-
declare const PlayerState: nexus_dist_core.NexusObjectTypeDef<"PlayerState">;
|
|
26
|
-
declare const Player: nexus_dist_core.NexusObjectTypeDef<"Player">;
|
|
27
|
-
declare const PlayerResult: nexus_dist_core.NexusObjectTypeDef<"PlayerResult">;
|
|
28
|
-
declare const PlayerAction: nexus_dist_core.NexusObjectTypeDef<"PlayerAction">;
|
|
29
|
-
declare const PlayerDecision: nexus_dist_core.NexusObjectTypeDef<"PlayerDecision">;
|
|
30
|
-
|
|
31
|
-
declare function generateBaseQueries(): nexus_dist_core.NexusObjectTypeDef<"Query">;
|
|
32
|
-
declare const Query: nexus_dist_core.NexusObjectTypeDef<"Query">;
|
|
33
|
-
|
|
34
|
-
declare function generateBaseSubscriptions(): nexus_dist_core.NexusObjectTypeDef<string>;
|
|
35
|
-
declare const Subscription: nexus_dist_core.NexusObjectTypeDef<string>;
|
|
36
|
-
|
|
37
|
-
declare const JsonScalar: nexus_dist_core.AllNexusOutputTypeDefs;
|
|
38
|
-
declare const DateScalar: nexus_dist_core.AllNexusOutputTypeDefs;
|
|
39
|
-
declare const UserRole: nexus_dist_core.NexusEnumTypeDef<"UserRole">;
|
|
40
|
-
declare const Event: nexus_dist_core.NexusObjectTypeDef<"Event">;
|
|
41
|
-
|
|
42
|
-
export { DateScalar, Event, Game, GameStatus, JsonScalar, LearningAnswerOption, LearningElement, LearningElementAttempt, LearningElementState, Mutation, Period, PeriodSegment, Player, PlayerAction, PlayerDecision, PlayerDecisionType, PlayerLevel, PlayerResult, PlayerResultType, PlayerState, Query, Subscription, UserRole, generateBaseMutations, generateBaseQueries, generateBaseSubscriptions };
|
|
1
|
+
export declare const JsonScalar: import("nexus/dist/core.js").AllNexusOutputTypeDefs;
|
|
2
|
+
export declare const DateScalar: import("nexus/dist/core.js").AllNexusOutputTypeDefs;
|
|
3
|
+
export declare const UserRole: import("nexus/dist/core.js").NexusEnumTypeDef<"UserRole">;
|
|
4
|
+
export declare const Event: import("nexus/dist/core.js").NexusObjectTypeDef<"Event">;
|
|
5
|
+
export * from './types/Game.js';
|
|
6
|
+
export * from './types/LearningElement.js';
|
|
7
|
+
export * from './types/Mutation.js';
|
|
8
|
+
export * from './types/Player.js';
|
|
9
|
+
export * from './types/Query.js';
|
|
10
|
+
export * from './types/Subscription.js';
|
|
11
|
+
//# sourceMappingURL=nexus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../src/nexus.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,qDAA4C,CAAA;AACnE,eAAO,MAAM,UAAU,qDAA0C,CAAA;AAEjE,eAAO,MAAM,QAAQ,2DAGnB,CAAA;AAEF,eAAO,MAAM,KAAK,0DAKhB,CAAA;AAEF,cAAc,iBAAiB,CAAA;AAC/B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA"}
|