APM_INSTANCE |
Default value : Symbol('APM_INSTANCE')
|
APM_TRANSACTION_DECORATOR |
Default value : Symbol('APM_TRANSACTION_DECORATOR')
|
CONSTANTS |
Type : object
|
Default value : {
/** tbl game join code length */
LIVE_GAME_JOIN_CODE_LENGTH: 6,
/** spl game join code length */
SELF_PACED_LIVE_GAME_JOIN_CODE_LENGTH: 5,
/** sp game join code length */
SELF_PACED_GAME_JOIN_CODE_LENGTH: 8,
/** class score multiplier */
CLASS_SCORE_MULTIPLIER: 15,
/** tbl game permanent code length */
LIVE_GAME_PERMANENT_CODE_LENGTH: 27,
/** spl game permanent code length */
SELF_PACED_LIVE_PERMANENT_CODE_LENGTH: 28,
/** sp game permanent code length */
SELF_PACED_GAME_PERMANENT_CODE_LENGTH: 29,
/** max attempts to search uniqu codes */
SEARCH_UNIQUE_MAX_ATTEMPTS: 30,
/** Math Runner game code length */
MATH_RUNNER_GAME_CODE_LENGTH: 4,
/** Math Runner game lives */
MATH_RUNNER_LIVES: 6,
}
|
common app constants |
EMAIL_COLLATION_SETTINGS |
Type : object
|
Default value : { locale: 'en', strength: 2 }
|
email settings |
CurrentUser |
Default value : createParamDecorator(
(data: unknown, ctx: ExecutionContext) => {
const request = ctx.switchToHttp().getRequest();
return request.user;
},
)
|
ElasticApmTransaction |
Default value : (name: string) => {
const data: TransactionDecoratorData = {name};
return SetMetadata(APM_TRANSACTION_DECORATOR, {name})
}
|
EMPTY_GAME_TTL |
Default value : 20 * 60
|
FALLBACK_XP_WEIGHT |
Type : number
|
Default value : 0.2
|
default value for question weight calculation |
NEGATIVE_MULTIPLIER |
Type : number
|
Default value : 2
|
negative multiplier for question weight calculation |
QuestionWeightMap |
Type : object
|
Default value : {
TYPE_ADDITION: {
0: 0.2,
10: 0.4,
20: 1.5,
100: 2.2,
},
TYPE_SUBTRACTION: {
0: 0.3,
10: 0.5,
20: 1.7,
100: 2.4,
},
TYPE_MULTIPLICATION: {
0: 0.3,
20: 1,
150: 2,
},
TYPE_DIVIDING: {
0: 0.4,
20: 1.3,
150: 2,
},
TYPE_CONVERSION: [
{
unit1: 'km',
unit2: 'm',
weight: 0.4,
},
{
unit1: 'm',
unit2: 'cm',
weight: 0.4,
},
{
unit1: 'm',
unit2: 'dm',
weight: 0.4,
},
{
unit1: 'm',
unit2: 'mm',
weight: 0.4,
},
{
unit1: 'dm',
unit2: 'cm',
weight: 0.4,
},
{
unit1: 'dm',
unit2: 'mm',
weight: 0.4,
},
{
unit1: 'cm',
unit2: 'mm',
weight: 0.4,
},
{
unit1: 'ft',
unit2: 'in',
weight: 0.5,
},
{
unit1: 'yd',
unit2: 'ft',
weight: 0.5,
},
{
unit1: 'm^2',
unit2: 'dm^2',
weight: 0.5,
},
{
unit1: 'm^2',
unit2: 'cm^2',
weight: 0.5,
},
{
unit1: 'dm^2',
unit2: 'cm^2',
weight: 0.5,
},
{
unit1: 'cm^2',
unit2: 'mm^2',
weight: 0.5,
},
{
unit1: 'm^2',
unit2: 'ha',
weight: 0.5,
},
{
unit1: 'km^2',
unit2: 'ha',
weight: 0.5,
},
{
unit1: 'm^2',
unit2: 'a',
weight: 0.5,
},
{
unit1: 'm^3',
unit2: 'dm^3',
weight: 0.6,
},
{
unit1: 'dm^3',
unit2: 'cm^3',
weight: 0.6,
},
{
unit1: 'cm^3',
unit2: 'mm^3',
weight: 0.6,
},
{
unit1: 'dm^3',
unit2: 'l',
weight: 0.6,
},
{
unit1: 'l',
unit2: 'ml',
weight: 0.6,
},
{
unit1: 'gal',
unit2: 'qt',
weight: 0.8,
},
{
unit1: 'pt',
unit2: 'qt',
weight: 0.8,
},
{
unit1: 'c',
unit2: 'pt',
weight: 0.8,
},
{
unit1: 'floz',
unit2: 'c',
weight: 0.8,
},
{
unit1: 'c',
unit2: 'qt',
weight: 0.8,
},
{
unit1: 'c',
unit2: 'gal',
weight: 0.8,
},
{
unit1: 'gal',
unit2: 'pt',
weight: 0.8,
},
{
unit1: 't',
unit2: 'kg',
weight: 0.4,
},
{
unit1: 'kg',
unit2: 'g',
weight: 0.4,
},
{
unit1: 'g',
unit2: 'mg',
weight: 0.4,
},
{
unit1: 't',
unit2: 'ts',
weight: 0.4,
},
{
unit1: 'ts',
unit2: 'kg',
weight: 0.4,
},
{
unit1: 'lb',
unit2: 'oz',
weight: 0.4,
},
],
TYPE_PERCENTAGE: {
share: {
1: 0.5,
10: 0.5,
20: 1,
25: 1,
50: 1,
2: 1.5,
5: 1.5,
75: 1.5,
150: 1.5,
},
whole: {
1: 0.6,
10: 0.6,
20: 1,
25: 1,
50: 1,
2: 1.5,
5: 1.5,
75: 1.5,
150: 1.5,
},
relation: {
1: 0.8,
10: 0.8,
50: 1,
20: 1.5,
25: 1.5,
200: 1.5,
},
comparison: {
1: 1.5,
10: 1.5,
50: 1.5,
25: 2,
},
},
}
|
Initial static table of questions weights by types Weights are also divided by 4 in getAnswerWeight(). |
getInstance |
Default value : (): APM.Agent => {
if (!instance) {
throw new Error('APM Agent is not initialized (run initializeAPMAgent) ');
}
return instance;
}
|
initializeAPMAgent |
Default value : (config?: APM.AgentConfigOptions): void => {
if (instance) return;
instance = config ? APM.start(config) : APM.start();
}
|
instance |
Type : APM.Agent | undefined
|
LIVE_GAME_EMPTY_PLAYER_RESULT |
Type : ReadonlyLiveGameEmptyPlayerResult
|
Default value : {
score: 0,
correctAnswers: 0,
wrongAnswers: 0,
rounds: [],
}
|
empty player stats const |
module |
Type : any
|
module declaration for webpack hot reload (for dev) |
providers |
Type : Provider[]
|
Default value : [
ApmService,
{
provide: APM_INSTANCE,
useFactory: () => {
return getInstance();
},
},
ApmService,
ElasticAPMInterceptor,
]
|
redisAdapter |
Type : null
|
Default value : null
|
Default value : process.env
|