@sparted/shared-library 1.7.59 → 1.7.60

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,6 +1,7 @@
1
1
  import { BreakingNewsActivity } from './breaking-news';
2
2
  import type { Campaign } from './campaign';
3
- import type { LanguageCode } from './multilingual';
3
+ import { Media } from './media';
4
+ import type { LanguageCode, MultilingualLabel } from './multilingual';
4
5
  type Segment = {
5
6
  id: number;
6
7
  label: string;
@@ -23,6 +24,37 @@ export type SharedActivityMetadata = {
23
24
  };
24
25
  export type CampaignActivity = SharedActivityMetadata & Campaign;
25
26
  export type Activity = CampaignActivity | BreakingNewsActivity;
27
+ export type BoActivityCardDetails = {
28
+ identifier: string;
29
+ cover: Media;
30
+ title: MultilingualLabel;
31
+ utcStartDate: string;
32
+ utcEndDate?: string;
33
+ };
34
+ export type BoActivityCardEvents = {
35
+ viewCount: number;
36
+ likeCount: number;
37
+ };
38
+ export type BoActivityCardAudience = {
39
+ type: 'all';
40
+ } | {
41
+ type: 'segmentation';
42
+ segments: Segment[];
43
+ } | {
44
+ type: 'magic-code';
45
+ code: string;
46
+ } | {
47
+ type: 'email-list';
48
+ };
49
+ export type BoActivityCard = {
50
+ id: number;
51
+ type: 'campaign' | 'breaking-news';
52
+ status: ActivityStatus;
53
+ details: BoActivityCardDetails;
54
+ language: LanguageCode[];
55
+ events: BoActivityCardEvents;
56
+ audience: BoActivityCardAudience;
57
+ };
26
58
  export declare const ACTIVITY_STATUS: readonly ["draft", "inactive", "archived", "upcoming", "live", "celebration", "finished"];
27
59
  export declare const isActivityCampaign: (activity: unknown) => activity is CampaignActivity;
28
60
  export declare const isActivityBreakingNews: (activity: CampaignActivity | BreakingNewsActivity) => activity is BreakingNewsActivity;
@@ -1 +1 @@
1
- {"version":3,"file":"activity.js","sources":["../../../src/business/types/activity.ts"],"sourcesContent":["import { BreakingNewsActivity } from './breaking-news';\nimport type { Campaign } from './campaign';\nimport type { LanguageCode } from './multilingual';\n\ntype Segment = {\n id: number;\n label: string;\n dimensionId: number;\n};\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 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":";;;;AAgCa,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 { BreakingNewsActivity } from './breaking-news';\nimport type { Campaign } from './campaign';\nimport { Media } from './media';\nimport type { LanguageCode, MultilingualLabel } from './multilingual';\n\ntype Segment = {\n id: number;\n label: string;\n dimensionId: number;\n};\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 BoActivityCardAudience =\n | {\n type: 'all';\n }\n | {\n type: 'segmentation';\n segments: Segment[];\n }\n | {\n type: 'magic-code';\n code: string;\n }\n | {\n type: 'email-list';\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: BoActivityCardAudience;\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":";;;;AAwEa,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;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "1.7.59",
3
+ "version": "1.7.60",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": {
6
6
  "name": "Sparted",