@sparted/shared-library 1.7.21 → 1.7.23
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.
|
@@ -24,6 +24,6 @@ export type SharedActivityMetadata = {
|
|
|
24
24
|
export type CampaignActivity = SharedActivityMetadata & Campaign;
|
|
25
25
|
export type Activity = CampaignActivity | BreakingNewsActivity;
|
|
26
26
|
export declare const ACTIVITY_STATUS: readonly ["draft", "inactive", "archived", "upcoming", "live", "finished"];
|
|
27
|
-
export declare const isActivityCampaign: (activity:
|
|
27
|
+
export declare const isActivityCampaign: (activity: unknown) => activity is CampaignActivity;
|
|
28
28
|
export declare const isActivityBreakingNews: (activity: CampaignActivity | BreakingNewsActivity) => activity is BreakingNewsActivity;
|
|
29
29
|
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const ACTIVITY_STATUS = ['draft', 'inactive', 'archived', 'upcoming', 'live', 'finished'];
|
|
6
|
-
const isActivityCampaign = (activity) => activity.type === 'campaign';
|
|
6
|
+
const isActivityCampaign = (activity) => typeof activity === 'object' && activity !== null && 'type' in activity && activity.type === 'campaign';
|
|
7
7
|
const isActivityBreakingNews = (activity) => activity.type === 'breaking-news';
|
|
8
8
|
|
|
9
9
|
exports.ACTIVITY_STATUS = ACTIVITY_STATUS;
|
|
@@ -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 = ['draft', 'inactive', 'archived', 'upcoming', 'live', 'finished'] as const;\n\nexport const isActivityCampaign = (activity:
|
|
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 = ['draft', 'inactive', 'archived', 'upcoming', 'live', 'finished'] 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,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAW;AAE7F,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;;;;;;"}
|