@sparted/shared-library 1.7.86 → 1.7.88
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/business/types/campaign.d.ts +1 -1
- package/business/types/campaign.js.map +1 -1
- package/chrono/get-approximated-session-time.d.ts +2 -0
- package/chrono/get-approximated-session-time.js +6 -1
- package/chrono/get-approximated-session-time.js.map +1 -1
- package/chrono/index.js +2 -0
- package/chrono/index.js.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -49,6 +49,7 @@ export type BaseCampaignCardDetails = {
|
|
|
49
49
|
utcStartDate: string;
|
|
50
50
|
utcEndDate: string;
|
|
51
51
|
contentCount: number;
|
|
52
|
+
sessionContentDistribution: number[];
|
|
52
53
|
isRandom: boolean;
|
|
53
54
|
playableDays?: Date[];
|
|
54
55
|
};
|
|
@@ -102,7 +103,6 @@ export type StreakSession = {
|
|
|
102
103
|
export type LiveCampaign = {
|
|
103
104
|
details: LiveCampaignDetails;
|
|
104
105
|
achievement: LiveCampaignAchievement;
|
|
105
|
-
sessionInsights: SessionInsight[];
|
|
106
106
|
leaderPlayer?: PlayerProfile;
|
|
107
107
|
streakSessions?: StreakSession[];
|
|
108
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaign.js","sources":["../../../src/business/types/campaign.ts"],"sourcesContent":["import type { CampaignStats } from './achievement';\nimport { ActivityStatus } from './activity';\nimport type { Content, GameType } from './content';\nimport type { Image } from './media';\nimport type { MultilingualLabel } from './multilingual';\nimport type { PlayerProfile, PlayerWithParticipation } from './player';\nimport type { Points, Stars, Streaks } from './score';\n\nexport type WithCampaignContentId<T> = T & { campaignContentId: number };\n\nexport type CampaignInformations = {\n coverImage: Image;\n name: MultilingualLabel;\n description: MultilingualLabel;\n disclaimer?: MultilingualLabel;\n lastSave: Date;\n};\n\nexport type BaseCampaignScheduling = {\n type: 'flexible' | 'intense';\n launchDate: string;\n endDate?: string;\n extraDays: number;\n enabledWeekDays: number[];\n disabledDates: string[];\n};\n\nexport type ManualCampaignScheduling = BaseCampaignScheduling & {\n mode: 'manual';\n orderedSessions: Content[][];\n};\n\nexport type RandomCampaignScheduling = BaseCampaignScheduling & {\n mode: 'random';\n nbSessions: number;\n contents: Content[];\n};\n\nexport type CampaignScheduling = ManualCampaignScheduling | RandomCampaignScheduling;\n\nexport type Campaign = {\n id: number;\n informations: CampaignInformations;\n scheduling: CampaignScheduling;\n type: 'campaign';\n};\n\nexport type BaseCampaignCardDetails = {\n id: number;\n status: ActivityStatus;\n cover: string;\n title: MultilingualLabel;\n description: MultilingualLabel;\n disclaimer?: MultilingualLabel;\n utcStartDate: string;\n utcEndDate: string;\n contentCount: number;\n isRandom: boolean;\n playableDays?: Date[];\n};\n\nexport type WikiCardDetails = BaseCampaignCardDetails;\n\nexport type WikiCardPlayerInteraction = {\n contentPlayedIds: number[];\n favorite: boolean;\n};\n\nexport type WikiCard = {\n details: WikiCardDetails;\n playerInteraction: WikiCardPlayerInteraction;\n};\n\nexport type WikiContentCardDetails = {\n id: number;\n campaignContentId: number;\n coverImage: string;\n title: MultilingualLabel;\n explanation?: MultilingualLabel;\n session: number;\n};\n\nexport type WikiContentCard = {\n contentDetails: WikiContentCardDetails;\n points: Points;\n};\n\nexport type LiveCampaignScheduling = {\n type: 'flexible' | 'intense';\n extraDays: number;\n enabledWeekDays: number[];\n disabledDates: string[];\n sessionCount: number;\n};\n\nexport type LiveCampaignDetails = BaseCampaignCardDetails & LiveCampaignScheduling;\n\nexport type LiveCampaignAchievement = {\n playedSessions: number[];\n playedSessionsCount: number;\n lastSessionPlayed: number;\n lastPlayedAt: string;\n stars: Stars;\n points: Points;\n streaks?: Streaks;\n};\n\nexport type SessionInsight = {\n sessionNumber: number;\n gameTypes: GameType[];\n};\n\nexport type StreakSession = {\n day: 1 | 2 | 3 | 4 | 5 | 6 | 7;\n status: CalendarStatus;\n streakCount?: number;\n};\n\nexport type LiveCampaign = {\n details: LiveCampaignDetails;\n achievement: LiveCampaignAchievement;\n
|
|
1
|
+
{"version":3,"file":"campaign.js","sources":["../../../src/business/types/campaign.ts"],"sourcesContent":["import type { CampaignStats } from './achievement';\nimport { ActivityStatus } from './activity';\nimport type { Content, GameType } from './content';\nimport type { Image } from './media';\nimport type { MultilingualLabel } from './multilingual';\nimport type { PlayerProfile, PlayerWithParticipation } from './player';\nimport type { Points, Stars, Streaks } from './score';\n\nexport type WithCampaignContentId<T> = T & { campaignContentId: number };\n\nexport type CampaignInformations = {\n coverImage: Image;\n name: MultilingualLabel;\n description: MultilingualLabel;\n disclaimer?: MultilingualLabel;\n lastSave: Date;\n};\n\nexport type BaseCampaignScheduling = {\n type: 'flexible' | 'intense';\n launchDate: string;\n endDate?: string;\n extraDays: number;\n enabledWeekDays: number[];\n disabledDates: string[];\n};\n\nexport type ManualCampaignScheduling = BaseCampaignScheduling & {\n mode: 'manual';\n orderedSessions: Content[][];\n};\n\nexport type RandomCampaignScheduling = BaseCampaignScheduling & {\n mode: 'random';\n nbSessions: number;\n contents: Content[];\n};\n\nexport type CampaignScheduling = ManualCampaignScheduling | RandomCampaignScheduling;\n\nexport type Campaign = {\n id: number;\n informations: CampaignInformations;\n scheduling: CampaignScheduling;\n type: 'campaign';\n};\n\nexport type BaseCampaignCardDetails = {\n id: number;\n status: ActivityStatus;\n cover: string;\n title: MultilingualLabel;\n description: MultilingualLabel;\n disclaimer?: MultilingualLabel;\n utcStartDate: string;\n utcEndDate: string;\n contentCount: number;\n sessionContentDistribution: number[];\n isRandom: boolean;\n playableDays?: Date[];\n};\n\nexport type WikiCardDetails = BaseCampaignCardDetails;\n\nexport type WikiCardPlayerInteraction = {\n contentPlayedIds: number[];\n favorite: boolean;\n};\n\nexport type WikiCard = {\n details: WikiCardDetails;\n playerInteraction: WikiCardPlayerInteraction;\n};\n\nexport type WikiContentCardDetails = {\n id: number;\n campaignContentId: number;\n coverImage: string;\n title: MultilingualLabel;\n explanation?: MultilingualLabel;\n session: number;\n};\n\nexport type WikiContentCard = {\n contentDetails: WikiContentCardDetails;\n points: Points;\n};\n\nexport type LiveCampaignScheduling = {\n type: 'flexible' | 'intense';\n extraDays: number;\n enabledWeekDays: number[];\n disabledDates: string[];\n sessionCount: number;\n};\n\nexport type LiveCampaignDetails = BaseCampaignCardDetails & LiveCampaignScheduling;\n\nexport type LiveCampaignAchievement = {\n playedSessions: number[];\n playedSessionsCount: number;\n lastSessionPlayed: number;\n lastPlayedAt: string;\n stars: Stars;\n points: Points;\n streaks?: Streaks;\n};\n\nexport type SessionInsight = {\n sessionNumber: number;\n gameTypes: GameType[];\n};\n\nexport type StreakSession = {\n day: 1 | 2 | 3 | 4 | 5 | 6 | 7;\n status: CalendarStatus;\n streakCount?: number;\n};\n\nexport type LiveCampaign = {\n details: LiveCampaignDetails;\n achievement: LiveCampaignAchievement;\n leaderPlayer?: PlayerProfile;\n streakSessions?: StreakSession[];\n};\n\nexport type CalendarStatus = 'played' | 'playable' | 'pending' | 'missed';\n\nexport type Calendar = {\n order: number;\n status: CalendarStatus;\n date: Date;\n};\n\nexport type CampaignDetails = {\n id: number;\n coverImage?: Image;\n name: MultilingualLabel;\n mode: 'manual' | 'random';\n launchDate: string;\n endDate: string;\n enabledWeekDays: number[];\n disabledDates: Date[];\n lastNotificationDate: Date;\n nbPlayers: number;\n nbSessions: number;\n nbQuestions: number;\n players: PlayerWithParticipation[];\n stats: CampaignStats;\n};\n\nexport const isCampaignSchedulingRandom = (scheduling: CampaignScheduling): scheduling is RandomCampaignScheduling =>\n scheduling.mode === 'random';\n\nexport const isCampaignSchedulingManual = (scheduling: CampaignScheduling): scheduling is ManualCampaignScheduling =>\n scheduling.mode === 'manual';\n\nexport const isWikiCard = (item: unknown): item is WikiCard =>\n typeof item === 'object' && item !== null && 'details' in item && 'playerInteraction' in item;\n"],"names":[],"mappings":";;;;AAuJO,MAAM,0BAA0B,GAAG,CAAC,UAA8B,KACvE,UAAU,CAAC,IAAI,KAAK,SAAS;AAExB,MAAM,0BAA0B,GAAG,CAAC,UAA8B,KACvE,UAAU,CAAC,IAAI,KAAK,SAAS;AAElB,MAAA,UAAU,GAAG,CAAC,IAAa,KACtC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,mBAAmB,IAAI;;;;;;"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { type GameType } from '../business/types';
|
|
2
|
+
export declare const DOLPHIN_AVERAGE_CHRONO_GAMEPLAY: number;
|
|
2
3
|
export declare const getApproximatedSessionTime: (gameTypes: GameType[]) => number;
|
|
4
|
+
export declare const getAverageSessionTime: (gameCount: number) => number;
|
|
@@ -11,13 +11,18 @@ const DOLPHIN_CHRONO_GAMEPLAY = {
|
|
|
11
11
|
'swiping-cards': 15 * 1000,
|
|
12
12
|
'ordering-cards': 20 * 1000 + 10000,
|
|
13
13
|
};
|
|
14
|
+
const DOLPHIN_AVERAGE_CHRONO_GAMEPLAY = Object.values(DOLPHIN_CHRONO_GAMEPLAY).reduce((sum, time) => sum + time, 0) /
|
|
15
|
+
Object.keys(DOLPHIN_CHRONO_GAMEPLAY).length;
|
|
14
16
|
const getApproximatedSessionTime = (gameTypes) => {
|
|
15
17
|
const time = gameTypes.reduce((sessionTime, gameType) => {
|
|
16
18
|
const gameplayTime = DOLPHIN_CHRONO_GAMEPLAY[gameType];
|
|
17
19
|
return sessionTime + gameplayTime;
|
|
18
20
|
}, 0);
|
|
19
21
|
return time;
|
|
20
|
-
};
|
|
22
|
+
};
|
|
23
|
+
const getAverageSessionTime = (gameCount) => gameCount * DOLPHIN_AVERAGE_CHRONO_GAMEPLAY;
|
|
21
24
|
|
|
25
|
+
exports.DOLPHIN_AVERAGE_CHRONO_GAMEPLAY = DOLPHIN_AVERAGE_CHRONO_GAMEPLAY;
|
|
22
26
|
exports.getApproximatedSessionTime = getApproximatedSessionTime;
|
|
27
|
+
exports.getAverageSessionTime = getAverageSessionTime;
|
|
23
28
|
//# sourceMappingURL=get-approximated-session-time.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-approximated-session-time.js","sources":["../../src/chrono/get-approximated-session-time.ts"],"sourcesContent":["import { type GameType } from '../business/types';\n\nconst DOLPHIN_CHRONO_GAMEPLAY = {\n mcq: 27 * 1000,\n 'error-text': 27 * 1000,\n 'no-interaction': 20000,\n 'picture-spot': 15 * 1000,\n 'open-question': 73 * 1000,\n 'swiping-cards': 15 * 1000,\n 'ordering-cards': 20 * 1000 + 10000,\n};\n\nexport const getApproximatedSessionTime = (gameTypes: GameType[]) => {\n const time = gameTypes.reduce<number>((sessionTime, gameType) => {\n const gameplayTime = DOLPHIN_CHRONO_GAMEPLAY[gameType];\n\n return sessionTime + gameplayTime;\n }, 0);\n\n return time;\n};\n"],"names":[],"mappings":";;;;AAEA,MAAM,uBAAuB,GAAG;IAC9B,GAAG,EAAE,EAAE,GAAG,IAAI;IACd,YAAY,EAAE,EAAE,GAAG,IAAI;AACvB,IAAA,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,EAAE,GAAG,IAAI;IACzB,eAAe,EAAE,EAAE,GAAG,IAAI;IAC1B,eAAe,EAAE,EAAE,GAAG,IAAI;AAC1B,IAAA,gBAAgB,EAAE,EAAE,GAAG,IAAI,GAAG,KAAK;CACpC,CAAC;AAEW,MAAA,0BAA0B,GAAG,CAAC,SAAqB,KAAI;IAClE,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAS,CAAC,WAAW,EAAE,QAAQ,KAAI;AAC9D,QAAA,MAAM,YAAY,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QAEvD,OAAO,WAAW,GAAG,YAAY,CAAC;KACnC,EAAE,CAAC,CAAC,CAAC;AAEN,IAAA,OAAO,IAAI,CAAC;AACd
|
|
1
|
+
{"version":3,"file":"get-approximated-session-time.js","sources":["../../src/chrono/get-approximated-session-time.ts"],"sourcesContent":["import { type GameType } from '../business/types';\n\nconst DOLPHIN_CHRONO_GAMEPLAY = {\n mcq: 27 * 1000,\n 'error-text': 27 * 1000,\n 'no-interaction': 20000,\n 'picture-spot': 15 * 1000,\n 'open-question': 73 * 1000,\n 'swiping-cards': 15 * 1000,\n 'ordering-cards': 20 * 1000 + 10000,\n};\n\nexport const DOLPHIN_AVERAGE_CHRONO_GAMEPLAY =\n Object.values(DOLPHIN_CHRONO_GAMEPLAY).reduce<number>((sum, time) => sum + time, 0) /\n Object.keys(DOLPHIN_CHRONO_GAMEPLAY).length;\n\nexport const getApproximatedSessionTime = (gameTypes: GameType[]) => {\n const time = gameTypes.reduce<number>((sessionTime, gameType) => {\n const gameplayTime = DOLPHIN_CHRONO_GAMEPLAY[gameType];\n\n return sessionTime + gameplayTime;\n }, 0);\n\n return time;\n};\n\nexport const getAverageSessionTime = (gameCount: number) => gameCount * DOLPHIN_AVERAGE_CHRONO_GAMEPLAY;\n"],"names":[],"mappings":";;;;AAEA,MAAM,uBAAuB,GAAG;IAC9B,GAAG,EAAE,EAAE,GAAG,IAAI;IACd,YAAY,EAAE,EAAE,GAAG,IAAI;AACvB,IAAA,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,EAAE,GAAG,IAAI;IACzB,eAAe,EAAE,EAAE,GAAG,IAAI;IAC1B,eAAe,EAAE,EAAE,GAAG,IAAI;AAC1B,IAAA,gBAAgB,EAAE,EAAE,GAAG,IAAI,GAAG,KAAK;CACpC,CAAC;AAEW,MAAA,+BAA+B,GAC1C,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAS,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,GAAG,IAAI,EAAE,CAAC,CAAC;AACnF,IAAA,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,OAAO;AAEjC,MAAA,0BAA0B,GAAG,CAAC,SAAqB,KAAI;IAClE,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAS,CAAC,WAAW,EAAE,QAAQ,KAAI;AAC9D,QAAA,MAAM,YAAY,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QAEvD,OAAO,WAAW,GAAG,YAAY,CAAC;KACnC,EAAE,CAAC,CAAC,CAAC;AAEN,IAAA,OAAO,IAAI,CAAC;AACd,EAAE;AAEK,MAAM,qBAAqB,GAAG,CAAC,SAAiB,KAAK,SAAS,GAAG;;;;;;"}
|
package/chrono/index.js
CHANGED
|
@@ -6,5 +6,7 @@ var getApproximatedSessionTime = require('./get-approximated-session-time.js');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
exports.DOLPHIN_AVERAGE_CHRONO_GAMEPLAY = getApproximatedSessionTime.DOLPHIN_AVERAGE_CHRONO_GAMEPLAY;
|
|
9
10
|
exports.getApproximatedSessionTime = getApproximatedSessionTime.getApproximatedSessionTime;
|
|
11
|
+
exports.getAverageSessionTime = getApproximatedSessionTime.getAverageSessionTime;
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
package/chrono/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
package/index.js
CHANGED
|
@@ -57,7 +57,9 @@ exports.valuesFromKeys = getValuesFromKeys.valuesFromKeys;
|
|
|
57
57
|
exports.leftOutterJoin = leftOutterJoin.leftOutterJoin;
|
|
58
58
|
exports.innerJoin = innerJoin.innerJoin;
|
|
59
59
|
exports.createCdn = cdn_factory.createCdn;
|
|
60
|
+
exports.DOLPHIN_AVERAGE_CHRONO_GAMEPLAY = getApproximatedSessionTime.DOLPHIN_AVERAGE_CHRONO_GAMEPLAY;
|
|
60
61
|
exports.getApproximatedSessionTime = getApproximatedSessionTime.getApproximatedSessionTime;
|
|
62
|
+
exports.getAverageSessionTime = getApproximatedSessionTime.getAverageSessionTime;
|
|
61
63
|
exports.MS_DAY = constants.MS_DAY;
|
|
62
64
|
exports.MS_HOUR = constants.MS_HOUR;
|
|
63
65
|
exports.MS_MINUTE = constants.MS_MINUTE;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|