@sparted/shared-library 1.7.33 → 1.7.34
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/picture-spot/index.d.ts +1 -36
- package/business/types/campaign.d.ts +42 -0
- package/business/types/campaign.js +3 -1
- package/business/types/campaign.js.map +1 -1
- package/business/types/index.d.ts +0 -1
- package/business/types/index.js +1 -2
- package/business/types/index.js.map +1 -1
- package/chrono/get-approximated-session-time.d.ts +2 -0
- package/chrono/get-approximated-session-time.js +23 -0
- package/chrono/get-approximated-session-time.js.map +1 -0
- package/chrono/index.d.ts +1 -0
- package/chrono/index.js +10 -0
- package/chrono/index.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/business/types/activity/wiki.d.ts +0 -29
- package/business/types/activity/wiki.js +0 -8
- package/business/types/activity/wiki.js.map +0 -1
|
@@ -1,37 +1,2 @@
|
|
|
1
1
|
import { PictureSpot } from '../types';
|
|
2
|
-
export declare const getQuestions: (content: PictureSpot) =>
|
|
3
|
-
sk: string;
|
|
4
|
-
sl: string;
|
|
5
|
-
ar: string;
|
|
6
|
-
lt: string;
|
|
7
|
-
"en-US": string;
|
|
8
|
-
"fr-FR": string;
|
|
9
|
-
"es-ES": string;
|
|
10
|
-
"it-IT": string;
|
|
11
|
-
"de-DE": string;
|
|
12
|
-
"ru-RU": string;
|
|
13
|
-
"nl-NL": string;
|
|
14
|
-
"pt-BR": string;
|
|
15
|
-
"zh-CN": string;
|
|
16
|
-
"he-IL": string;
|
|
17
|
-
"cs-CZ": string;
|
|
18
|
-
"ko-KR": string;
|
|
19
|
-
"ja-JP": string;
|
|
20
|
-
"zh-TW": string;
|
|
21
|
-
"bg-BG": string;
|
|
22
|
-
"hr-HR": string;
|
|
23
|
-
"da-DK": string;
|
|
24
|
-
"fi-FI": string;
|
|
25
|
-
"el-GR": string;
|
|
26
|
-
"hu-HU": string;
|
|
27
|
-
"nb-NO": string;
|
|
28
|
-
"pl-PL": string;
|
|
29
|
-
"pt-PT": string;
|
|
30
|
-
"ro-RO": string;
|
|
31
|
-
"sv-SE": string;
|
|
32
|
-
"tr-TR": string;
|
|
33
|
-
"et-EE": string;
|
|
34
|
-
"id-ID": string;
|
|
35
|
-
"lv-LV": string;
|
|
36
|
-
"th-TH": string;
|
|
37
|
-
}>[];
|
|
2
|
+
export declare const getQuestions: (content: PictureSpot) => import("../types").MultilingualLabel[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Content } from './content';
|
|
2
2
|
import type { Image } from './media';
|
|
3
3
|
import type { MultilingualLabel } from './multilingual';
|
|
4
|
+
import type { Points } from './score';
|
|
4
5
|
export type CampaignInformations = {
|
|
5
6
|
coverImage: Image;
|
|
6
7
|
name: MultilingualLabel;
|
|
@@ -32,5 +33,46 @@ export type Campaign = {
|
|
|
32
33
|
scheduling: CampaignScheduling;
|
|
33
34
|
type: 'campaign';
|
|
34
35
|
};
|
|
36
|
+
export type CampaignCardDetails = {
|
|
37
|
+
id: number;
|
|
38
|
+
coverImage: string;
|
|
39
|
+
title: MultilingualLabel;
|
|
40
|
+
utcStartDate: string;
|
|
41
|
+
utcEndDate: string;
|
|
42
|
+
contentCount: number;
|
|
43
|
+
};
|
|
44
|
+
export type WikiCardPlayerInteraction = {
|
|
45
|
+
contentPlayedCount: number;
|
|
46
|
+
favorite: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type WikiCard = {
|
|
49
|
+
activityDetails: CampaignCardDetails;
|
|
50
|
+
playerInteraction: WikiCardPlayerInteraction;
|
|
51
|
+
};
|
|
52
|
+
export type WikiContentCardDetails = {
|
|
53
|
+
id: number;
|
|
54
|
+
coverImage: string;
|
|
55
|
+
title: MultilingualLabel;
|
|
56
|
+
session: number;
|
|
57
|
+
};
|
|
58
|
+
export type WikiContentCard = {
|
|
59
|
+
contentDetails: WikiContentCardDetails;
|
|
60
|
+
points: Points;
|
|
61
|
+
};
|
|
62
|
+
export type CampaignCardAchievement = {
|
|
63
|
+
currentSession: number;
|
|
64
|
+
playable: boolean;
|
|
65
|
+
points: Points;
|
|
66
|
+
};
|
|
67
|
+
export type SessionInsight = {
|
|
68
|
+
earnablePoints: number;
|
|
69
|
+
timeSpent: number;
|
|
70
|
+
};
|
|
71
|
+
export type LiveCampaignCard = {
|
|
72
|
+
campaign: CampaignCardDetails;
|
|
73
|
+
achievement: CampaignCardAchievement;
|
|
74
|
+
sessionInsight: SessionInsight;
|
|
75
|
+
};
|
|
35
76
|
export declare const isCampaignSchedulingRandom: (scheduling: CampaignScheduling) => scheduling is RandomCampaignScheduling;
|
|
36
77
|
export declare const isCampaignSchedulingManual: (scheduling: CampaignScheduling) => scheduling is ManualCampaignScheduling;
|
|
78
|
+
export declare const isWikiCard: (item: unknown) => item is WikiCard;
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const isCampaignSchedulingRandom = (scheduling) => scheduling.mode === 'random';
|
|
6
|
-
const isCampaignSchedulingManual = (scheduling) => scheduling.mode === 'manual';
|
|
6
|
+
const isCampaignSchedulingManual = (scheduling) => scheduling.mode === 'manual';
|
|
7
|
+
const isWikiCard = (item) => typeof item === 'object' && item !== null && 'activityDetails' in item && 'playerInteraction' in item;
|
|
7
8
|
|
|
8
9
|
exports.isCampaignSchedulingManual = isCampaignSchedulingManual;
|
|
9
10
|
exports.isCampaignSchedulingRandom = isCampaignSchedulingRandom;
|
|
11
|
+
exports.isWikiCard = isWikiCard;
|
|
10
12
|
//# sourceMappingURL=campaign.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaign.js","sources":["../../../src/business/types/campaign.ts"],"sourcesContent":["import type { Content } from './content';\nimport type { Image } from './media';\nimport type { MultilingualLabel } from './multilingual';\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 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"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"campaign.js","sources":["../../../src/business/types/campaign.ts"],"sourcesContent":["import type { Content } from './content';\nimport type { Image } from './media';\nimport type { MultilingualLabel } from './multilingual';\nimport type { Points } 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 CampaignCardDetails = {\n id: number;\n coverImage: string;\n title: MultilingualLabel;\n utcStartDate: string;\n utcEndDate: string;\n contentCount: number;\n};\n\nexport type WikiCardPlayerInteraction = {\n contentPlayedCount: number;\n favorite: boolean;\n};\n\nexport type WikiCard = {\n activityDetails: CampaignCardDetails;\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 CampaignCardAchievement = {\n currentSession: number;\n playable: boolean;\n points: Points;\n};\n\nexport type SessionInsight = {\n earnablePoints: number;\n timeSpent: number;\n};\n\nexport type LiveCampaignCard = {\n campaign: CampaignCardDetails;\n achievement: CampaignCardAchievement;\n sessionInsight: 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"],"names":[],"mappings":";;;;AA0FO,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,iBAAiB,IAAI,IAAI,IAAI,mBAAmB,IAAI;;;;;;"}
|
package/business/types/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var activity = require('./activity.js');
|
|
6
|
-
var wiki = require('./activity/wiki.js');
|
|
7
6
|
var campaign = require('./campaign.js');
|
|
8
7
|
var content = require('./content.js');
|
|
9
8
|
var multilingual = require('./multilingual.js');
|
|
@@ -14,9 +13,9 @@ var score = require('./score.js');
|
|
|
14
13
|
exports.ACTIVITY_STATUS = activity.ACTIVITY_STATUS;
|
|
15
14
|
exports.isActivityBreakingNews = activity.isActivityBreakingNews;
|
|
16
15
|
exports.isActivityCampaign = activity.isActivityCampaign;
|
|
17
|
-
exports.isWikiCard = wiki.isWikiCard;
|
|
18
16
|
exports.isCampaignSchedulingManual = campaign.isCampaignSchedulingManual;
|
|
19
17
|
exports.isCampaignSchedulingRandom = campaign.isCampaignSchedulingRandom;
|
|
18
|
+
exports.isWikiCard = campaign.isWikiCard;
|
|
20
19
|
exports.GAME_TYPE = content.GAME_TYPE;
|
|
21
20
|
exports.extractExplanation = content.extractExplanation;
|
|
22
21
|
exports.extractGameExplanation = content.extractGameExplanation;
|
|
@@ -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,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const DOLPHIN_CHRONO_GAMEPLAY = {
|
|
6
|
+
mcq: 27 * 1000,
|
|
7
|
+
'error-text': 27 * 1000,
|
|
8
|
+
'no-interaction': 20000,
|
|
9
|
+
'picture-spot': 15 * 1000,
|
|
10
|
+
'open-question': 73 * 1000,
|
|
11
|
+
'swiping-cards': 15 * 1000,
|
|
12
|
+
'ordering-cards': 20 * 1000 + 10000,
|
|
13
|
+
};
|
|
14
|
+
const getApproximatedSessionTime = (gameTypes) => {
|
|
15
|
+
const time = gameTypes.reduce((sessionTime, gameType) => {
|
|
16
|
+
const gameplayTime = DOLPHIN_CHRONO_GAMEPLAY[gameType];
|
|
17
|
+
return sessionTime + gameplayTime;
|
|
18
|
+
}, 0);
|
|
19
|
+
return time;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.getApproximatedSessionTime = getApproximatedSessionTime;
|
|
23
|
+
//# sourceMappingURL=get-approximated-session-time.js.map
|
|
@@ -0,0 +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;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-approximated-session-time';
|
package/chrono/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var getApproximatedSessionTime = require('./get-approximated-session-time.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.getApproximatedSessionTime = getApproximatedSessionTime.getApproximatedSessionTime;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var getValuesFromKeys = require('./array/get-values-from-keys.js');
|
|
|
7
7
|
var leftOutterJoin = require('./array/left-outter-join.js');
|
|
8
8
|
var innerJoin = require('./array/inner-join.js');
|
|
9
9
|
var cdn_factory = require('./cdn/cdn.factory.js');
|
|
10
|
+
var getApproximatedSessionTime = require('./chrono/get-approximated-session-time.js');
|
|
10
11
|
var constants = require('./time/constants.js');
|
|
11
12
|
var convert = require('./time/convert.js');
|
|
12
13
|
var formatMinutes = require('./time/format-minutes.js');
|
|
@@ -49,6 +50,7 @@ exports.valuesFromKeys = getValuesFromKeys.valuesFromKeys;
|
|
|
49
50
|
exports.leftOutterJoin = leftOutterJoin.leftOutterJoin;
|
|
50
51
|
exports.innerJoin = innerJoin.innerJoin;
|
|
51
52
|
exports.createCdn = cdn_factory.createCdn;
|
|
53
|
+
exports.getApproximatedSessionTime = getApproximatedSessionTime.getApproximatedSessionTime;
|
|
52
54
|
exports.MS_DAY = constants.MS_DAY;
|
|
53
55
|
exports.MS_HOUR = constants.MS_HOUR;
|
|
54
56
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type MultilingualLabel } from '../multilingual';
|
|
2
|
-
import { type Points } from '../score';
|
|
3
|
-
export type WikiCardDetails = {
|
|
4
|
-
id: number;
|
|
5
|
-
coverImage: string;
|
|
6
|
-
title: MultilingualLabel;
|
|
7
|
-
utcStartDate: string;
|
|
8
|
-
utcEndDate: string;
|
|
9
|
-
contentCount: number;
|
|
10
|
-
};
|
|
11
|
-
export type WikiCardPlayerInteraction = {
|
|
12
|
-
contentPlayedCount: number;
|
|
13
|
-
favorite: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type WikiCard = {
|
|
16
|
-
activityDetails: WikiCardDetails;
|
|
17
|
-
playerInteraction: WikiCardPlayerInteraction;
|
|
18
|
-
};
|
|
19
|
-
export type WikiContentCardDetails = {
|
|
20
|
-
id: number;
|
|
21
|
-
coverImage: string;
|
|
22
|
-
title: MultilingualLabel;
|
|
23
|
-
session: number;
|
|
24
|
-
};
|
|
25
|
-
export type WikiContentCard = {
|
|
26
|
-
contentDetails: WikiContentCardDetails;
|
|
27
|
-
points: Points;
|
|
28
|
-
};
|
|
29
|
-
export declare const isWikiCard: (item: unknown) => item is WikiCard;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const isWikiCard = (item) => typeof item === 'object' && item !== null && 'activityDetails' in item && 'playerInteraction' in item;
|
|
6
|
-
|
|
7
|
-
exports.isWikiCard = isWikiCard;
|
|
8
|
-
//# sourceMappingURL=wiki.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wiki.js","sources":["../../../../src/business/types/activity/wiki.ts"],"sourcesContent":["import { type MultilingualLabel } from '../multilingual';\nimport { type Points } from '../score';\n\nexport type WikiCardDetails = {\n id: number;\n coverImage: string;\n title: MultilingualLabel;\n utcStartDate: string;\n utcEndDate: string;\n contentCount: number;\n};\n\nexport type WikiCardPlayerInteraction = {\n contentPlayedCount: number;\n favorite: boolean;\n};\n\nexport type WikiCard = {\n activityDetails: 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 const isWikiCard = (item: unknown): item is WikiCard =>\n typeof item === 'object' && item !== null && 'activityDetails' in item && 'playerInteraction' in item;\n"],"names":[],"mappings":";;;;AAkCa,MAAA,UAAU,GAAG,CAAC,IAAa,KACtC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,mBAAmB,IAAI;;;;"}
|