@sparted/shared-library 1.7.61 → 1.7.62

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.
@@ -1,8 +1,9 @@
1
- import type { ActivityAudienceInformation, Segment } from './audience';
1
+ import type { AudienceInformation, Segment } from './audience';
2
2
  import type { BreakingNewsActivity } from './breaking-news';
3
3
  import type { Campaign } from './campaign';
4
4
  import type { Media } from './media';
5
5
  import type { LanguageCode, MultilingualLabel } from './multilingual';
6
+ import type { EventSummary } from './user-engagement';
6
7
  export type ActivityAudience = {
7
8
  groupId: number;
8
9
  type: 'all' | 'segmentation' | 'magic-code' | 'email-list';
@@ -27,18 +28,14 @@ export type BoActivityCardDetails = {
27
28
  utcStartDate: string;
28
29
  utcEndDate?: string;
29
30
  };
30
- export type BoActivityCardEvents = {
31
- viewCount: number;
32
- likeCount: number;
33
- };
34
31
  export type BoActivityCard = {
35
32
  id: number;
36
33
  type: 'campaign' | 'breaking-news';
37
34
  status: ActivityStatus;
38
35
  details: BoActivityCardDetails;
39
36
  language: LanguageCode[];
40
- events: BoActivityCardEvents;
41
- audience: ActivityAudienceInformation;
37
+ eventSummary: EventSummary;
38
+ audience: AudienceInformation;
42
39
  };
43
40
  export declare const ACTIVITY_STATUS: readonly ["draft", "inactive", "archived", "upcoming", "live", "celebration", "finished"];
44
41
  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 { ActivityAudienceInformation, 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';\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 BoActivityCardEvents = {\n viewCount: number;\n likeCount: number;\n};\n\nexport type BoActivityCard = {\n id: number;\n type: 'campaign' | 'breaking-news';\n status: ActivityStatus;\n details: BoActivityCardDetails;\n language: LanguageCode[];\n events: BoActivityCardEvents;\n audience: ActivityAudienceInformation;\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":";;;;AAmDa,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 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;;;;;;"}
@@ -4,7 +4,7 @@ export type Segment = {
4
4
  dimensionId: number;
5
5
  };
6
6
  export type AudienceType = 'all' | 'segmentation' | 'magic-code' | 'email-list';
7
- export type ActivityAudienceInformation = {
7
+ export type AudienceInformation = {
8
8
  type: 'all';
9
9
  } | {
10
10
  type: 'segmentation';
@@ -4,3 +4,7 @@ export type UserEngagement = {
4
4
  isLiked: boolean;
5
5
  lastViewed: string | null;
6
6
  };
7
+ export type EventSummary = {
8
+ viewCount: number;
9
+ likeCount: number;
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "1.7.61",
3
+ "version": "1.7.62",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": {
6
6
  "name": "Sparted",