phx-node
Version:
PHX NODE
70 lines (69 loc) • 1.74 kB
TypeScript
import { HttpService } from "@nestjs/axios";
import { ConfigService } from "@nestjs/config";
export interface IGroupRequestType {
group: string;
count?: number;
items?: {
label: string;
count: number;
}[];
}
export declare enum EmailType {
TRANSACTION_BASIC = "transaction-basic",
HRM_REMIND = "hrm-remind",
ORDER_SUCCESS = "order-success",
FREESTYLE_CAMPAIGN = "freestyle-campaign"
}
export declare enum NotificationType {
SYSTEM = "SYSTEM",
TO_ME = "TO_ME"
}
export interface Attachment {
filename: string;
pathname: string;
}
export interface PushNotiMobile {
title: string;
message: string;
module_code: string;
app: string;
payload: any;
related_id?: string;
preview_text?: string;
}
export interface SendEmailV3 {
emailType: EmailType;
to: string;
subject: string;
title: string;
previewText: string;
isValidEmail?: boolean;
callToActionURL?: string;
callToActionText?: string;
content?: string;
listRequests?: IGroupRequestType[];
description?: string;
schoolId?: number;
tag?: string;
attachments?: Attachment[];
}
export interface PushInappNoti {
user_id: number;
action_code: string;
hostname: string;
student_id?: number;
type?: NotificationType;
pushNotiMobile?: PushNotiMobile;
sendEmailV3?: SendEmailV3;
}
export declare class PHXPushNotificationService {
private readonly httpService;
private readonly configService;
private readonly logger;
constructor(httpService: HttpService, configService: ConfigService);
private pushNoti;
send(payload: PushInappNoti): Promise<{
status: string;
message: string;
}>;
}