@sparted/shared-library 1.7.41 → 1.7.43
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/achievement.d.ts +15 -1
- package/business/types/breaking-news.d.ts +20 -8
- package/business/types/campaign.d.ts +24 -0
- package/business/types/campaign.js.map +1 -1
- package/business/types/index.d.ts +1 -0
- package/business/types/player.d.ts +8 -0
- package/business/types/user-engagement.d.ts +6 -0
- package/date/index.d.ts +1 -0
- package/date/index.js +2 -0
- package/date/index.js.map +1 -1
- package/date/is-same-date.d.ts +1 -0
- package/date/is-same-date.js +12 -0
- package/date/is-same-date.js.map +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MultilingualLabel } from './multilingual';
|
|
2
|
+
import type { PlayerProfile } from './player';
|
|
2
3
|
export type CampaignRanking = {
|
|
3
4
|
activityId: number;
|
|
4
5
|
playerProfile: PlayerProfile;
|
|
@@ -8,3 +9,16 @@ export type CampaignRanking = {
|
|
|
8
9
|
lastPlayed: string;
|
|
9
10
|
favorite: boolean;
|
|
10
11
|
};
|
|
12
|
+
export type MostFailedQuestion = {
|
|
13
|
+
title: MultilingualLabel;
|
|
14
|
+
correctAnswerRate: number;
|
|
15
|
+
};
|
|
16
|
+
export type CampaignStats = {
|
|
17
|
+
participationRate: number;
|
|
18
|
+
exposureRate: number;
|
|
19
|
+
masteryRate: number;
|
|
20
|
+
correctAnswerRate: number;
|
|
21
|
+
mostFailed: MostFailedQuestion[];
|
|
22
|
+
nbQuestions: number;
|
|
23
|
+
nbActivePlayers: number;
|
|
24
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Media } from './media';
|
|
2
|
-
import { MultilingualLabel } from './multilingual';
|
|
1
|
+
import type { Media } from './media';
|
|
2
|
+
import type { MultilingualLabel } from './multilingual';
|
|
3
|
+
import type { UserEngagement } from './user-engagement';
|
|
3
4
|
export type BreakingNewsActivity = {
|
|
4
5
|
informations: {
|
|
5
6
|
name: MultilingualLabel;
|
|
@@ -17,12 +18,23 @@ export type BreakingNewsActivity = {
|
|
|
17
18
|
startDate: string;
|
|
18
19
|
endDate: string;
|
|
19
20
|
};
|
|
20
|
-
userEngagement:
|
|
21
|
-
isLiked: boolean;
|
|
22
|
-
lastViewed: string | null;
|
|
23
|
-
viewCount: number;
|
|
24
|
-
likeCount: number;
|
|
25
|
-
};
|
|
21
|
+
userEngagement: UserEngagement;
|
|
26
22
|
id: number;
|
|
27
23
|
type: 'breaking-news';
|
|
28
24
|
};
|
|
25
|
+
export type BreakingNewsCardDetails = {
|
|
26
|
+
id: number;
|
|
27
|
+
coverMedia?: {
|
|
28
|
+
type: 'image' | 'video';
|
|
29
|
+
url: string;
|
|
30
|
+
};
|
|
31
|
+
name: MultilingualLabel;
|
|
32
|
+
description: MultilingualLabel;
|
|
33
|
+
text?: MultilingualLabel;
|
|
34
|
+
utcStartDate: string;
|
|
35
|
+
isRecurringNotification: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type BreakingNewsCard = {
|
|
38
|
+
details: BreakingNewsCardDetails;
|
|
39
|
+
userEngagement: UserEngagement;
|
|
40
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { CampaignStats } from './achievement';
|
|
1
2
|
import type { Content, GameType } from './content';
|
|
2
3
|
import type { Image } from './media';
|
|
3
4
|
import type { MultilingualLabel } from './multilingual';
|
|
5
|
+
import type { PlayerWithParticipation } from './player';
|
|
4
6
|
import type { Points, Stars } from './score';
|
|
5
7
|
export type CampaignInformations = {
|
|
6
8
|
coverImage: Image;
|
|
@@ -85,6 +87,28 @@ export type LiveCampaign = {
|
|
|
85
87
|
achievement: LiveCampaignAchievement;
|
|
86
88
|
sessionInsights: SessionInsight[];
|
|
87
89
|
};
|
|
90
|
+
export type CalendarStatus = 'played' | 'playable' | 'pending' | 'missed';
|
|
91
|
+
export type Calendar = {
|
|
92
|
+
order: number;
|
|
93
|
+
status: CalendarStatus;
|
|
94
|
+
date: Date;
|
|
95
|
+
};
|
|
96
|
+
export type CampaignDetails = {
|
|
97
|
+
id: number;
|
|
98
|
+
coverImage?: Image;
|
|
99
|
+
name: MultilingualLabel;
|
|
100
|
+
mode: 'manual' | 'random';
|
|
101
|
+
launchDate: string;
|
|
102
|
+
endDate: string;
|
|
103
|
+
enabledWeekDays: number[];
|
|
104
|
+
disabledDates: Date[];
|
|
105
|
+
lastNotificationDate: Date;
|
|
106
|
+
nbPlayers: number;
|
|
107
|
+
nbSessions: number;
|
|
108
|
+
nbQuestions: number;
|
|
109
|
+
players: PlayerWithParticipation[];
|
|
110
|
+
stats: CampaignStats;
|
|
111
|
+
};
|
|
88
112
|
export declare const isCampaignSchedulingRandom: (scheduling: CampaignScheduling) => scheduling is RandomCampaignScheduling;
|
|
89
113
|
export declare const isCampaignSchedulingManual: (scheduling: CampaignScheduling) => scheduling is ManualCampaignScheduling;
|
|
90
114
|
export declare const isWikiCard: (item: unknown) => item is WikiCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaign.js","sources":["../../../src/business/types/campaign.ts"],"sourcesContent":["import type { Content, GameType } from './content';\nimport type { Image } from './media';\nimport type { MultilingualLabel } from './multilingual';\nimport type { Points, Stars } from './score';\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 cover: string;\n title: MultilingualLabel;\n description: MultilingualLabel;\n disclaimer?: MultilingualLabel;\n utcStartDate: string;\n utcEndDate: string;\n contentCount: number;\n};\n\nexport type WikiCardDetails = BaseCampaignCardDetails;\n\nexport type WikiCardPlayerInteraction = {\n contentPlayedCount: number;\n favorite: boolean;\n};\n\nexport type WikiCard = {\n details: WikiCardDetails;\n playerInteraction: WikiCardPlayerInteraction;\n};\n\nexport type WikiContentCardDetails = {\n id: number;\n coverImage: string;\n title: 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 lastSessionPlayed: number;\n lastPlayedAt: string;\n stars: Stars;\n points: Points;\n};\n\nexport type SessionInsight = {\n sessionNumber: number;\n gameTypes: GameType[];\n};\n\nexport type LiveCampaign = {\n details: LiveCampaignDetails;\n achievement: LiveCampaignAchievement;\n sessionInsights: SessionInsight[];\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 && 'activityDetails' in item && 'playerInteraction' in item;\n\nexport const computeIntenseCalendar = (card: LiveCampaign): Date[] => {\n const { details } = card;\n\n const startDate = new Date(details.utcStartDate);\n const endDate = new Date(details.utcEndDate);\n\n const calculateIntenseCalendarAux = (date: Date, calendar: Date[]): Date[] => {\n if (date > endDate) {\n return calendar;\n }\n\n const jsDay = date.getDay();\n const day = jsDay === 0 ? 7 : jsDay;\n\n if (details.enabledWeekDays.includes(day) && !details.disabledDates.includes(date.toISOString().slice(0, 10))) {\n calendar.push(new Date(date));\n }\n\n date.setDate(date.getDate() + 1);\n\n return calculateIntenseCalendarAux(date, calendar);\n };\n\n return calculateIntenseCalendarAux(startDate, []);\n};\n\nexport const computeCurrentSession = (card: LiveCampaign): number => {\n const { details, achievement } = card;\n\n if (details.type === 'flexible') {\n return Math.min(achievement.lastSessionPlayed + 1, details.sessionCount);\n }\n\n const today = new Date();\n\n if (today <= new Date(details.utcStartDate)) {\n return 1;\n }\n\n if (today >= new Date(details.utcEndDate)) {\n return details.sessionCount;\n }\n\n const calendar = computeIntenseCalendar(card);\n\n const currentSession = calendar.findIndex((date) => date >= today);\n\n if (currentSession === -1) {\n throw new Error('Current session not found');\n }\n\n return currentSession + 1;\n};\n\nexport const checkTodayPlayable = (card: LiveCampaign): boolean => {\n const today = new Date();\n\n const { details } = card;\n\n const startDate = new Date(details.utcStartDate);\n const endDate = new Date(details.utcEndDate);\n\n if (today < startDate || today > endDate) {\n return false;\n }\n\n const jsDay = today.getDay();\n const day = jsDay === 0 ? 7 : jsDay;\n\n if (!details.enabledWeekDays.includes(day)) {\n return false;\n }\n\n if (details.disabledDates.includes(today.toISOString().slice(0, 10))) {\n return false;\n }\n\n return true;\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"campaign.js","sources":["../../../src/business/types/campaign.ts"],"sourcesContent":["import type { CampaignStats } from './achievement';\nimport type { Content, GameType } from './content';\nimport type { Image } from './media';\nimport type { MultilingualLabel } from './multilingual';\nimport type { PlayerWithParticipation } from './player';\nimport type { Points, Stars } from './score';\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 cover: string;\n title: MultilingualLabel;\n description: MultilingualLabel;\n disclaimer?: MultilingualLabel;\n utcStartDate: string;\n utcEndDate: string;\n contentCount: number;\n};\n\nexport type WikiCardDetails = BaseCampaignCardDetails;\n\nexport type WikiCardPlayerInteraction = {\n contentPlayedCount: number;\n favorite: boolean;\n};\n\nexport type WikiCard = {\n details: WikiCardDetails;\n playerInteraction: WikiCardPlayerInteraction;\n};\n\nexport type WikiContentCardDetails = {\n id: number;\n coverImage: string;\n title: 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 lastSessionPlayed: number;\n lastPlayedAt: string;\n stars: Stars;\n points: Points;\n};\n\nexport type SessionInsight = {\n sessionNumber: number;\n gameTypes: GameType[];\n};\n\nexport type LiveCampaign = {\n details: LiveCampaignDetails;\n achievement: LiveCampaignAchievement;\n sessionInsights: SessionInsight[];\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 && 'activityDetails' in item && 'playerInteraction' in item;\n\nexport const computeIntenseCalendar = (card: LiveCampaign): Date[] => {\n const { details } = card;\n\n const startDate = new Date(details.utcStartDate);\n const endDate = new Date(details.utcEndDate);\n\n const calculateIntenseCalendarAux = (date: Date, calendar: Date[]): Date[] => {\n if (date > endDate) {\n return calendar;\n }\n\n const jsDay = date.getDay();\n const day = jsDay === 0 ? 7 : jsDay;\n\n if (details.enabledWeekDays.includes(day) && !details.disabledDates.includes(date.toISOString().slice(0, 10))) {\n calendar.push(new Date(date));\n }\n\n date.setDate(date.getDate() + 1);\n\n return calculateIntenseCalendarAux(date, calendar);\n };\n\n return calculateIntenseCalendarAux(startDate, []);\n};\n\nexport const computeCurrentSession = (card: LiveCampaign): number => {\n const { details, achievement } = card;\n\n if (details.type === 'flexible') {\n return Math.min(achievement.lastSessionPlayed + 1, details.sessionCount);\n }\n\n const today = new Date();\n\n if (today <= new Date(details.utcStartDate)) {\n return 1;\n }\n\n if (today >= new Date(details.utcEndDate)) {\n return details.sessionCount;\n }\n\n const calendar = computeIntenseCalendar(card);\n\n const currentSession = calendar.findIndex((date) => date >= today);\n\n if (currentSession === -1) {\n throw new Error('Current session not found');\n }\n\n return currentSession + 1;\n};\n\nexport const checkTodayPlayable = (card: LiveCampaign): boolean => {\n const today = new Date();\n\n const { details } = card;\n\n const startDate = new Date(details.utcStartDate);\n const endDate = new Date(details.utcEndDate);\n\n if (today < startDate || today > endDate) {\n return false;\n }\n\n const jsDay = today.getDay();\n const day = jsDay === 0 ? 7 : jsDay;\n\n if (!details.enabledWeekDays.includes(day)) {\n return false;\n }\n\n if (details.disabledDates.includes(today.toISOString().slice(0, 10))) {\n return false;\n }\n\n return true;\n};\n"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Calendar } from './campaign';
|
|
1
2
|
export type PlayerProfile = {
|
|
2
3
|
id: number;
|
|
3
4
|
firstName: string;
|
|
@@ -5,3 +6,10 @@ export type PlayerProfile = {
|
|
|
5
6
|
pseudo?: string;
|
|
6
7
|
profilePicture: string;
|
|
7
8
|
};
|
|
9
|
+
export type PlayerWithParticipation = PlayerProfile & {
|
|
10
|
+
calendar: Calendar[];
|
|
11
|
+
hasPlayedToday: boolean;
|
|
12
|
+
hasFinished: boolean;
|
|
13
|
+
lastPlayedDate?: Date;
|
|
14
|
+
nbPlayedSessions: number;
|
|
15
|
+
};
|
package/date/index.d.ts
CHANGED
package/date/index.js
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var isSameDate = require('./is-same-date.js');
|
|
5
6
|
var toPlainDateString = require('./to-plain-date-string.js');
|
|
6
7
|
var getNextDay = require('./get-next-day.js');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
11
|
+
exports.isSameDate = isSameDate.isSameDate;
|
|
10
12
|
exports.toPlainDateString = toPlainDateString.toPlainDateString;
|
|
11
13
|
exports.getNextDay = getNextDay.getNextDay;
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
package/date/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":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isSameDate: (date1: Date, date2: Date) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const isSameDate = (date1, date2) => {
|
|
6
|
+
return (date1.getUTCFullYear() === date2.getUTCFullYear() &&
|
|
7
|
+
date1.getUTCMonth() === date2.getUTCMonth() &&
|
|
8
|
+
date1.getUTCDate() === date2.getUTCDate());
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.isSameDate = isSameDate;
|
|
12
|
+
//# sourceMappingURL=is-same-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-same-date.js","sources":["../../src/date/is-same-date.ts"],"sourcesContent":["export const isSameDate = (date1: Date, date2: Date): boolean => {\n return (\n date1.getUTCFullYear() === date2.getUTCFullYear() &&\n date1.getUTCMonth() === date2.getUTCMonth() &&\n date1.getUTCDate() === date2.getUTCDate()\n );\n};\n"],"names":[],"mappings":";;;;MAAa,UAAU,GAAG,CAAC,KAAW,EAAE,KAAW,KAAa;IAC9D,QACE,KAAK,CAAC,cAAc,EAAE,KAAK,KAAK,CAAC,cAAc,EAAE;AACjD,QAAA,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE;QAC3C,KAAK,CAAC,UAAU,EAAE,KAAK,KAAK,CAAC,UAAU,EAAE,EACzC;AACJ;;;;"}
|
package/index.js
CHANGED
|
@@ -40,6 +40,7 @@ var replaceInTemplate = require('./string/replace-in-template.js');
|
|
|
40
40
|
var isStringLengthWithinRange = require('./string/is-string-length-within-range.js');
|
|
41
41
|
var getContrastColor = require('./color/get-contrast-color.js');
|
|
42
42
|
var aes256 = require('./crypto/aes256.js');
|
|
43
|
+
var isSameDate = require('./date/is-same-date.js');
|
|
43
44
|
var toPlainDateString = require('./date/to-plain-date-string.js');
|
|
44
45
|
var getNextDay = require('./date/get-next-day.js');
|
|
45
46
|
|
|
@@ -90,6 +91,7 @@ exports.replaceInTemplate = replaceInTemplate.replaceInTemplate;
|
|
|
90
91
|
exports.isStringLengthWithinRange = isStringLengthWithinRange.isStringLengthWithinRange;
|
|
91
92
|
exports.getContrastColor = getContrastColor.getContrastColor;
|
|
92
93
|
exports.encrypt = aes256.encrypt;
|
|
94
|
+
exports.isSameDate = isSameDate.isSameDate;
|
|
93
95
|
exports.toPlainDateString = toPlainDateString.toPlainDateString;
|
|
94
96
|
exports.getNextDay = getNextDay.getNextDay;
|
|
95
97
|
//# sourceMappingURL=index.js.map
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|