467 lines
16 KiB
TypeScript
467 lines
16 KiB
TypeScript
import { UserRole } from '@prisma/client';
|
|
import type { CreateCampaignInput, UpdateCampaignInput, ListCampaignsInput, CreateUserCampaignInput, ModerateCampaignInput, ListModerationQueueInput } from './campaigns.schemas';
|
|
interface AuthUser {
|
|
id: string;
|
|
email: string;
|
|
role: UserRole;
|
|
}
|
|
export declare const campaignsService: {
|
|
findAll(filters: ListCampaignsInput, user?: AuthUser): Promise<{
|
|
campaigns: {
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}[];
|
|
pagination: {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
};
|
|
}>;
|
|
findById(id: string): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}>;
|
|
findBySlug(slug: string): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}>;
|
|
create(data: CreateCampaignInput, user: AuthUser): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}>;
|
|
update(id: string, data: UpdateCampaignInput): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}>;
|
|
findActiveCampaigns(): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
}[]>;
|
|
findBySlugPublic(slug: string): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
}>;
|
|
delete(id: string): Promise<void>;
|
|
createUserCampaign(data: CreateUserCampaignInput, user: AuthUser): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}>;
|
|
findUserCampaigns(userId: string): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}[]>;
|
|
updateUserCampaign(id: string, data: Partial<CreateUserCampaignInput>, user: AuthUser): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}>;
|
|
findModerationQueue(filters: ListModerationQueueInput): Promise<{
|
|
campaigns: {
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}[];
|
|
pagination: {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
};
|
|
}>;
|
|
getModerationStats(): Promise<{
|
|
total: number;
|
|
pending: number;
|
|
approved: number;
|
|
rejected: number;
|
|
changesRequested: number;
|
|
}>;
|
|
moderateCampaign(id: string, input: ModerateCampaignInput, reviewer: AuthUser): Promise<{
|
|
status: import(".prisma/client").$Enums.CampaignStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
_count: {
|
|
responses: number;
|
|
emails: number;
|
|
};
|
|
title: string;
|
|
description: string | null;
|
|
slug: string;
|
|
coverPhoto: string | null;
|
|
coverVideoId: number | null;
|
|
moderationNotes: string | null;
|
|
createdByUserId: string | null;
|
|
emailSubject: string;
|
|
emailBody: string;
|
|
callToAction: string | null;
|
|
allowSmtpEmail: boolean;
|
|
allowMailtoLink: boolean;
|
|
collectUserInfo: boolean;
|
|
showEmailCount: boolean;
|
|
showCallCount: boolean;
|
|
allowEmailEditing: boolean;
|
|
allowCustomRecipients: boolean;
|
|
showResponseWall: boolean;
|
|
highlightCampaign: boolean;
|
|
targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[];
|
|
createdByUserEmail: string | null;
|
|
createdByUserName: string | null;
|
|
isUserGenerated: boolean;
|
|
moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null;
|
|
reviewedByUserId: string | null;
|
|
reviewedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
}>;
|
|
};
|
|
export {};
|
|
//# sourceMappingURL=campaigns.service.d.ts.map
|