@sparted/shared-library 1.7.5 → 1.7.7

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.
@@ -0,0 +1,24 @@
1
+ import type { Campaign } from './campaign';
2
+ import type { LanguageCode } from './multilingual';
3
+ type Segment = {
4
+ id: number;
5
+ label: string;
6
+ dimensionId: number;
7
+ };
8
+ export type ActivityAudience = {
9
+ groupId: number;
10
+ type: 'all' | 'segmentation' | 'magic-code' | 'email-list';
11
+ segments: Segment[];
12
+ };
13
+ export type ActivityStatus = 'inactive' | 'archived' | 'upcoming' | 'live' | 'finished';
14
+ export type SharedActivityMetadata = {
15
+ status: ActivityStatus;
16
+ languages?: LanguageCode[];
17
+ audiences?: ActivityAudience[];
18
+ userEngagement?: {
19
+ viewCount?: number;
20
+ likeCount?: number;
21
+ };
22
+ };
23
+ export type CampaignActivity = SharedActivityMetadata & Campaign;
24
+ export {};
@@ -1,21 +1,31 @@
1
- import { Image } from './media';
2
- import { MultilingualLabel } from './multilingual';
3
1
  import type { Content } from './content';
2
+ import type { Image } from './media';
3
+ import type { MultilingualLabel } from './multilingual';
4
4
  export type CampaignInformations = {
5
- coverImage?: Image;
5
+ coverImage: Image;
6
6
  name: MultilingualLabel;
7
- description?: MultilingualLabel;
7
+ description: MultilingualLabel;
8
8
  disclaimer?: MultilingualLabel;
9
+ lastSave: Date;
9
10
  };
10
- export type CampaignScheduling = {
11
- mode: 'manual' | 'random';
11
+ export type BaseCampaignScheduling = {
12
12
  type: 'flexible' | 'intense';
13
- launchDate?: string;
13
+ launchDate: string;
14
14
  endDate?: string;
15
- extraDays?: number;
16
- enabledWeekDays?: number[];
17
- orderedSessions?: Content[][];
15
+ extraDays: number;
16
+ enabledWeekDays: number[];
17
+ disabledDates: string[];
18
18
  };
19
+ export type ManualCampaignScheduling = BaseCampaignScheduling & {
20
+ mode: 'manual';
21
+ orderedSessions: Content[][];
22
+ };
23
+ export type RandomCampaignScheduling = BaseCampaignScheduling & {
24
+ mode: 'random';
25
+ nbSessions: number;
26
+ contents: Content[];
27
+ };
28
+ export type CampaignScheduling = ManualCampaignScheduling | RandomCampaignScheduling;
19
29
  export type Campaign = {
20
30
  id: number;
21
31
  informations: CampaignInformations;
@@ -1,3 +1,4 @@
1
+ export * from './activity';
1
2
  export * from './content';
2
3
  export * from './media';
3
4
  export * from './thematic';
@@ -8,6 +8,10 @@ export type ScoreTimer = {
8
8
  timeout: boolean;
9
9
  };
10
10
  export type Score = {
11
+ activity: {
12
+ type: 'battle' | 'campaign' | 'wiki';
13
+ id: number;
14
+ };
11
15
  contentId: number;
12
16
  points: ScorePoints;
13
17
  timer: ScoreTimer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": {
6
6
  "name": "Sparted",