@sparted/shared-library 1.7.88 → 1.7.90

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.
@@ -28,6 +28,13 @@ export type BoActivityCardDetails = {
28
28
  utcStartDate: string;
29
29
  utcEndDate?: string;
30
30
  };
31
+ export type AudienceGroup = {
32
+ type: 'all' | 'segmentation' | 'magic-code' | 'email-list';
33
+ name: string;
34
+ description: string;
35
+ locked: boolean;
36
+ segments: Segment[];
37
+ };
31
38
  export type BoActivityCard = {
32
39
  id: number;
33
40
  type: 'campaign' | 'breaking-news';
@@ -36,6 +43,7 @@ export type BoActivityCard = {
36
43
  language: LanguageCode[];
37
44
  eventSummary: EventSummary;
38
45
  audience: AudienceInformation;
46
+ audienceGroups: AudienceGroup[];
39
47
  };
40
48
  export declare const ACTIVITY_STATUS: readonly ["draft", "inactive", "archived", "upcoming", "live", "celebration", "finished"];
41
49
  export declare const isActivityCampaign: (activity: unknown) => activity is CampaignActivity;
@@ -1 +1 @@
1
- {"version":3,"file":"activity.js","sources":["../../../src/business/types/activity.ts"],"sourcesContent":["import type { AudienceInformation, Segment } from './audience';\nimport type { BreakingNewsActivity } from './breaking-news';\nimport type { Campaign } from './campaign';\nimport type { Media } from './media';\nimport type { LanguageCode, MultilingualLabel } from './multilingual';\nimport type { EventSummary } from './user-engagement';\n\nexport type ActivityAudience = {\n groupId: number;\n type: 'all' | 'segmentation' | 'magic-code' | 'email-list';\n segments: Segment[];\n};\n\nexport type ActivityStatus = (typeof ACTIVITY_STATUS)[number];\n\nexport type SharedActivityMetadata = {\n status: ActivityStatus;\n languages?: LanguageCode[];\n audiences?: ActivityAudience[];\n userEngagement?: {\n viewCount?: number;\n likeCount?: number;\n };\n};\n\nexport type CampaignActivity = SharedActivityMetadata & Campaign;\n\nexport type Activity = CampaignActivity | BreakingNewsActivity;\n\nexport type BoActivityCardDetails = {\n identifier: string;\n cover: Media;\n title: MultilingualLabel;\n utcStartDate: string;\n utcEndDate?: string;\n};\n\nexport type BoActivityCard = {\n id: number;\n type: 'campaign' | 'breaking-news';\n status: ActivityStatus;\n details: BoActivityCardDetails;\n language: LanguageCode[];\n eventSummary: EventSummary;\n audience: AudienceInformation;\n};\n\nexport const ACTIVITY_STATUS = [\n 'draft',\n 'inactive',\n 'archived',\n 'upcoming',\n 'live',\n 'celebration',\n 'finished',\n] as const;\n\nexport const isActivityCampaign = (activity: unknown): activity is CampaignActivity =>\n typeof activity === 'object' && activity !== null && 'type' in activity && activity.type === 'campaign';\n\nexport const isActivityBreakingNews = (\n activity: CampaignActivity | BreakingNewsActivity,\n): activity is BreakingNewsActivity => activity.type === 'breaking-news';\n"],"names":[],"mappings":";;;;AA+Ca,MAAA,eAAe,GAAG;IAC7B,OAAO;IACP,UAAU;IACV,UAAU;IACV,UAAU;IACV,MAAM;IACN,aAAa;IACb,UAAU;EACD;AAEE,MAAA,kBAAkB,GAAG,CAAC,QAAiB,KAClD,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,IAAI,MAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW;AAEnG,MAAM,sBAAsB,GAAG,CACpC,QAAiD,KACZ,QAAQ,CAAC,IAAI,KAAK;;;;;;"}
1
+ {"version":3,"file":"activity.js","sources":["../../../src/business/types/activity.ts"],"sourcesContent":["import type { AudienceInformation, Segment } from './audience';\nimport type { BreakingNewsActivity } from './breaking-news';\nimport type { Campaign } from './campaign';\nimport type { Media } from './media';\nimport type { LanguageCode, MultilingualLabel } from './multilingual';\nimport type { EventSummary } from './user-engagement';\n\nexport type ActivityAudience = {\n groupId: number;\n type: 'all' | 'segmentation' | 'magic-code' | 'email-list';\n segments: Segment[];\n};\n\nexport type ActivityStatus = (typeof ACTIVITY_STATUS)[number];\n\nexport type SharedActivityMetadata = {\n status: ActivityStatus;\n languages?: LanguageCode[];\n audiences?: ActivityAudience[];\n userEngagement?: {\n viewCount?: number;\n likeCount?: number;\n };\n};\n\nexport type CampaignActivity = SharedActivityMetadata & Campaign;\n\nexport type Activity = CampaignActivity | BreakingNewsActivity;\n\nexport type BoActivityCardDetails = {\n identifier: string;\n cover: Media;\n title: MultilingualLabel;\n utcStartDate: string;\n utcEndDate?: string;\n};\n\nexport type AudienceGroup = {\n type: 'all' | 'segmentation' | 'magic-code' | 'email-list';\n name: string;\n description: string;\n locked: boolean;\n segments: Segment[];\n}\n\nexport type BoActivityCard = {\n id: number;\n type: 'campaign' | 'breaking-news';\n status: ActivityStatus;\n details: BoActivityCardDetails;\n language: LanguageCode[];\n eventSummary: EventSummary;\n audience: AudienceInformation;\n audienceGroups: AudienceGroup[];\n};\n\nexport const ACTIVITY_STATUS = [\n 'draft',\n 'inactive',\n 'archived',\n 'upcoming',\n 'live',\n 'celebration',\n 'finished',\n] as const;\n\nexport const isActivityCampaign = (activity: unknown): activity is CampaignActivity =>\n typeof activity === 'object' && activity !== null && 'type' in activity && activity.type === 'campaign';\n\nexport const isActivityBreakingNews = (\n activity: CampaignActivity | BreakingNewsActivity,\n): activity is BreakingNewsActivity => activity.type === 'breaking-news';\n"],"names":[],"mappings":";;;;AAwDa,MAAA,eAAe,GAAG;IAC7B,OAAO;IACP,UAAU;IACV,UAAU;IACV,UAAU;IACV,MAAM;IACN,aAAa;IACb,UAAU;EACD;AAEE,MAAA,kBAAkB,GAAG,CAAC,QAAiB,KAClD,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,IAAI,MAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW;AAEnG,MAAM,sBAAsB,GAAG,CACpC,QAAiD,KACZ,QAAQ,CAAC,IAAI,KAAK;;;;;;"}
@@ -103,6 +103,8 @@ export type StreakSession = {
103
103
  export type LiveCampaign = {
104
104
  details: LiveCampaignDetails;
105
105
  achievement: LiveCampaignAchievement;
106
+ /** @deprecated to avoid breaking changes */
107
+ sessionInsights: SessionInsight[];
106
108
  leaderPlayer?: PlayerProfile;
107
109
  streakSessions?: StreakSession[];
108
110
  };
@@ -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 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
+ {"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 /** @deprecated to avoid breaking changes */\n sessionInsights: SessionInsight[];\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":";;;;AAyJO,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;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "1.7.88",
3
+ "version": "1.7.90",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": {
6
6
  "name": "Sparted",