pswincom-gateway-typed
Version:
Send SMS messages through LINK Mobility / PSWinCom Gateway, TypeScript version.
94 lines (93 loc) • 2.04 kB
TypeScript
export type XmlRequestMessage = {
ID: number;
OP: number;
TEXT: string;
SND: string;
RCV: string;
DELIVERYTIME?: string;
};
export type XmlRequestModel = {
SESSION: {
CLIENT: string;
PW: string;
MSGLST: {
MSG: XmlRequestMessage[];
};
};
};
export declare enum XmlResponseMessageStatus {
OK = "OK",
FAIL = "FAIL"
}
export type XmlResponseMessage = {
ID: string;
STATUS: XmlResponseMessageStatus;
REF: string;
INFO?: string;
};
export declare enum XmlResponseLoginStatus {
OK = "OK",
FAIL = "FAIL"
}
export type XmlResponseModel = {
SESSION?: {
LOGON?: string;
REASON?: string;
MSGLST?: {
MSG?: XmlResponseMessage | XmlResponseMessage[];
};
};
};
export declare enum DeliveryMessageState {
DELIVRD = "DELIVRD",
EXPIRED = "EXPIRED",
DELETED = "DELETED",
UNDELIV = "UNDELIV",
UNKNOWN = "UNKNOWN",
REJECTD = "REJECTD",
FAILED = "FAILED",
NULL = "NULL",
BARRED = "BARRED",
BARREDA = "BARREDA",
ZEROBAL = "ZEROBAL"
}
export type XmlDeliveryMessage = {
ID: string;
REF: string;
RCV: string;
STATE: DeliveryMessageState;
DELIVERYTIME: string;
};
export type XmlDeliveryResponse = {
MSGLST?: {
MSG?: XmlDeliveryMessage | XmlDeliveryMessage[];
};
};
export type DeliveryResult = {
id: string;
ref: string;
receiver: string;
state: DeliveryMessageState;
deliveryTime: string;
};
export type DeliveryResults = DeliveryResult[];
export type SmsResult = {
logon?: string;
receivers: Record<string, XmlResponseMessageStatus>;
refs: Record<string, string>;
};
export declare enum MessageOperation {
PlainText = 1,
RawBinary = 8,
Unicode = 9
}
export type SmsOptions = {
username: string;
password: string;
sender: string;
receivers: string[];
message: string;
deliveryTime?: Date;
operation?: MessageOperation;
fetch?: typeof fetch;
};