diff --git a/packages/core-typings/src/cloud/Announcement.ts b/packages/core-typings/src/cloud/Announcement.ts new file mode 100644 index 000000000000..3d891daf132f --- /dev/null +++ b/packages/core-typings/src/cloud/Announcement.ts @@ -0,0 +1,28 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +import type { IRocketChatRecord } from '../IRocketChatRecord'; +import { type UiKitPayload } from '../UIKit'; + +type TargetPlatform = 'web' | 'mobile'; + +type Dictionary = { + [lng: string]: { + [key: string]: string; + }; +}; + +type Creator = 'cloud' | 'system'; + +export interface Announcement extends IRocketChatRecord { + selector?: { + roles?: string[]; + }; + platform: TargetPlatform[]; + expireAt: Date; + startAt: Date; + createdBy: Creator; + createdAt: Date; + dictionary?: Dictionary; + view: UiKitPayload; + surface: 'banner' | 'modal'; +} diff --git a/packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts b/packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts new file mode 100644 index 000000000000..fff1db8f1b99 --- /dev/null +++ b/packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts @@ -0,0 +1,7 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +export interface NpsSurveyAnnouncement { + id: string; + startAt: Date; + expireAt: Date; +} diff --git a/packages/core-typings/src/cloud/SyncPayload.ts b/packages/core-typings/src/cloud/SyncPayload.ts new file mode 100644 index 000000000000..44ce5bff3014 --- /dev/null +++ b/packages/core-typings/src/cloud/SyncPayload.ts @@ -0,0 +1,33 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +import type { IBanner } from '../IBanner'; +import type { Announcement } from './Announcement'; +import type { NpsSurveyAnnouncement } from './NpsSurveyAnnouncement'; + +export interface SyncPayload { + workspaceId: string; + publicKey?: string; + announcements?: { + create: Announcement[]; + delete: Announcement['id'][]; + }; + trial?: { + trialing: boolean; + trialId: string; + endDate: Date; + marketing: { + utmContent: string; + utmMedium: string; + utmSource: string; + utmCampaign: string; + }; + DowngradesToPlan: { + id: string; + }; + trialRequested: boolean; + }; + /** @deprecated */ + nps?: NpsSurveyAnnouncement; + /** @deprecated */ + banners?: IBanner[]; +} diff --git a/packages/core-typings/src/cloud/index.ts b/packages/core-typings/src/cloud/index.ts index beab2faad1d4..289e59e3c451 100644 --- a/packages/core-typings/src/cloud/index.ts +++ b/packages/core-typings/src/cloud/index.ts @@ -1,42 +1,3 @@ -/* eslint-disable @typescript-eslint/no-empty-interface */ -/* eslint-disable @typescript-eslint/naming-convention */ - -import type { IBanner } from '../IBanner'; - -export interface Announcement { - id: string; -} - -export interface NpsSurveyAnnouncement { - id: string; - startAt: Date; - expireAt: Date; -} - -export interface SyncPayload { - workspaceId: string; - publicKey?: string; - announcements?: { - create: Announcement[]; - delete: Announcement['id'][]; - }; - trial?: { - trialing: boolean; - trialId: string; - endDate: Date; - marketing: { - utmContent: string; - utmMedium: string; - utmSource: string; - utmCampaign: string; - }; - DowngradesToPlan: { - id: string; - }; - trialRequested: boolean; - }; - /** @deprecated */ - nps?: NpsSurveyAnnouncement; - /** @deprecated */ - banners?: IBanner[]; -} +export { Announcement } from './Announcement'; +export { NpsSurveyAnnouncement } from './NpsSurveyAnnouncement'; +export { SyncPayload } from './SyncPayload';