UNPKG

@netgsm/sms

Version:

Netgsm API Client for SMS sending and reporting

292 lines (291 loc) 12.9 kB
"use strict"; /** * @module Enums * @description Netgsm SMS API enumerations */ Object.defineProperty(exports, "__esModule", { value: true }); exports.OperatorCode = exports.BalanceType = exports.ApiErrorCode = exports.CancelErrorCode = exports.MsgHeaderErrorCode = exports.BalanceErrorCode = exports.StatsErrorCode = exports.ReportErrorCode = exports.InboxErrorCode = exports.SendOtpSmsErrorCode = exports.SendSmsErrorCode = exports.SmsStatus = void 0; /** * SMS status codes * @enum {number} */ var SmsStatus; (function (SmsStatus) { /** Message pending */ SmsStatus[SmsStatus["PENDING"] = 0] = "PENDING"; /** Message sent */ SmsStatus[SmsStatus["SENT"] = 1] = "SENT"; /** Message expired */ SmsStatus[SmsStatus["EXPIRED"] = 2] = "EXPIRED"; /** Invalid or restricted number */ SmsStatus[SmsStatus["INVALID_NUMBER"] = 3] = "INVALID_NUMBER"; /** Not sent to operator */ SmsStatus[SmsStatus["NOT_SENT"] = 4] = "NOT_SENT"; /** Message rejected */ SmsStatus[SmsStatus["REJECTED"] = 11] = "REJECTED"; /** Delivery error */ SmsStatus[SmsStatus["DELIVERY_ERROR"] = 12] = "DELIVERY_ERROR"; /** Duplicate message */ SmsStatus[SmsStatus["DUPLICATE"] = 13] = "DUPLICATE"; /** Insuficient credit */ SmsStatus[SmsStatus["INSUFFICIENT_BALANCE"] = 14] = "INSUFFICIENT_BALANCE"; /** Blacklisted number */ SmsStatus[SmsStatus["BLACKLISTED"] = 15] = "BLACKLISTED"; /** IYS rejected */ SmsStatus[SmsStatus["IYS_REJECTED"] = 16] = "IYS_REJECTED"; /** IYS error */ SmsStatus[SmsStatus["IYS_ERROR"] = 17] = "IYS_ERROR"; /** All messages */ SmsStatus[SmsStatus["ALL"] = 100] = "ALL"; })(SmsStatus || (exports.SmsStatus = SmsStatus = {})); /** * /sms/rest/v2/send API error codes * @enum {string} */ var SendSmsErrorCode; (function (SendSmsErrorCode) { /** Operation successful */ SendSmsErrorCode["SUCCESS"] = "00"; /** Could not be sent due to a problem in the message text or exceeded the standard maximum message character count */ SendSmsErrorCode["MESSAGE_TEXT_ERROR"] = "20"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ SendSmsErrorCode["INVALID_AUTH"] = "30"; /** Message header (sender name) is not defined in the system */ SendSmsErrorCode["INVALID_HEADER"] = "40"; /** IYS controlled submissions cannot be made with your subscriber account */ SendSmsErrorCode["IYS_CONTROLLED"] = "50"; /** No IYS Brand information found for your subscription */ SendSmsErrorCode["NO_IYS_BRAND"] = "51"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ SendSmsErrorCode["PARAMETER_ERROR"] = "70"; /** Sending rate limit exceeded */ SendSmsErrorCode["SENDING_RATE_LIMIT_EXCEEDED"] = "80"; /** Duplicate sending rate limit exceeded. Cannot create more than 20 tasks for the same number within 1 minute */ SendSmsErrorCode["DUPLICATE_RATE_LIMIT_EXCEEDED"] = "85"; /** System error */ SendSmsErrorCode["SYSTEM_ERROR_100"] = "100"; /** System error */ SendSmsErrorCode["SYSTEM_ERROR_101"] = "101"; /** Undefined error */ SendSmsErrorCode["UNDEFINED_ERROR"] = "5000"; })(SendSmsErrorCode || (exports.SendSmsErrorCode = SendSmsErrorCode = {})); /** * /sms/rest/v2/otp API error codes * @enum {string} */ var SendOtpSmsErrorCode; (function (SendOtpSmsErrorCode) { /** Operation successful */ SendOtpSmsErrorCode["SUCCESS"] = "00"; /** Could not be sent due to a problem in the message text or exceeded the standard maximum message character count */ SendOtpSmsErrorCode["MESSAGE_TEXT_ERROR"] = "20"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ SendOtpSmsErrorCode["INVALID_AUTH"] = "30"; /** Message header (sender name) is not defined in the system */ SendOtpSmsErrorCode["UNDEFINED_HEADER"] = "40"; /** Message header (sender name) is not valid in the system */ SendOtpSmsErrorCode["INVALID_HEADER"] = "41"; /** Check for Number */ SendOtpSmsErrorCode["CHECK_NUMBER_50"] = "50"; /** Check for Number */ SendOtpSmsErrorCode["CHECK_NUMBER_51"] = "51"; /** Check for Number */ SendOtpSmsErrorCode["CHECK_NUMBER_52"] = "52"; /** No Credit for OTP */ SendOtpSmsErrorCode["NO_CREDIT"] = "60"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ SendOtpSmsErrorCode["PARAMETER_ERROR"] = "70"; /** System error */ SendOtpSmsErrorCode["SYSTEM_ERROR_100"] = "100"; /** System error */ SendOtpSmsErrorCode["SYSTEM_ERROR_101"] = "101"; /** Undefined error */ SendOtpSmsErrorCode["UNDEFINED_ERROR"] = "5000"; })(SendOtpSmsErrorCode || (exports.SendOtpSmsErrorCode = SendOtpSmsErrorCode = {})); /** * /sms/rest/v2/inbox API error codes * @enum {string} */ var InboxErrorCode; (function (InboxErrorCode) { /** Operation successful */ InboxErrorCode["SUCCESS"] = "00"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ InboxErrorCode["INVALID_AUTH"] = "30"; /** Indicates that you have no messages to display. If you are not using the startdate and stopdate parameters, you can only list your messages once with the API. Listed messages will not appear in your other queries. */ InboxErrorCode["NO_MESSAGES"] = "40"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ InboxErrorCode["PARAMETER_ERROR"] = "70"; /** System error */ InboxErrorCode["SYSTEM_ERROR_100"] = "100"; /** System error */ InboxErrorCode["SYSTEM_ERROR_101"] = "101"; /** Undefined error */ InboxErrorCode["UNDEFINED_ERROR"] = "5000"; })(InboxErrorCode || (exports.InboxErrorCode = InboxErrorCode = {})); /** * /sms/rest/v2/report API error codes * @enum {string} */ var ReportErrorCode; (function (ReportErrorCode) { /** Operation successful */ ReportErrorCode["SUCCESS"] = "00"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ ReportErrorCode["INVALID_AUTH"] = "30"; /** Indicates that there are no records to be listed according to your search criteria. */ ReportErrorCode["NO_RECORDS"] = "60"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ ReportErrorCode["PARAMETER_ERROR"] = "70"; /** Limit exceeded, can be queried 10 times per minute. */ ReportErrorCode["RATE_LIMIT_EXCEEDED"] = "80"; /** System error */ ReportErrorCode["SYSTEM_ERROR_100"] = "100"; /** System error */ ReportErrorCode["SYSTEM_ERROR_110"] = "110"; /** Undefined error */ ReportErrorCode["UNDEFINED_ERROR"] = "5000"; })(ReportErrorCode || (exports.ReportErrorCode = ReportErrorCode = {})); /** * /sms/rest/v2/stats API error codes * @enum {string} */ var StatsErrorCode; (function (StatsErrorCode) { /** Operation successful */ StatsErrorCode["SUCCESS"] = "00"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ StatsErrorCode["INVALID_AUTH"] = "30"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ StatsErrorCode["PARAMETER_ERROR"] = "70"; /** Undefined error */ StatsErrorCode["UNDEFINED_ERROR"] = "5000"; })(StatsErrorCode || (exports.StatsErrorCode = StatsErrorCode = {})); /** * /sms/rest/v2/balance API error codes * @enum {string} */ var BalanceErrorCode; (function (BalanceErrorCode) { /** Operation successful */ BalanceErrorCode["SUCCESS"] = "00"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ BalanceErrorCode["INVALID_AUTH"] = "30"; /** Indicates that there are no records to be listed according to your search criteria. */ BalanceErrorCode["NO_RECORDS"] = "60"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ BalanceErrorCode["PARAMETER_ERROR"] = "70"; /** Undefined error */ BalanceErrorCode["UNDEFINED_ERROR"] = "5000"; })(BalanceErrorCode || (exports.BalanceErrorCode = BalanceErrorCode = {})); /** * /sms/rest/v2/msgheader API error codes * @enum {string} */ var MsgHeaderErrorCode; (function (MsgHeaderErrorCode) { /** Operation successful */ MsgHeaderErrorCode["SUCCESS"] = "00"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ MsgHeaderErrorCode["INVALID_AUTH"] = "30"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ MsgHeaderErrorCode["PARAMETER_ERROR"] = "70"; /** System error */ MsgHeaderErrorCode["SYSTEM_ERROR_100"] = "100"; /** System error */ MsgHeaderErrorCode["SYSTEM_ERROR_101"] = "101"; /** Undefined error */ MsgHeaderErrorCode["UNDEFINED_ERROR"] = "5000"; })(MsgHeaderErrorCode || (exports.MsgHeaderErrorCode = MsgHeaderErrorCode = {})); /** * /sms/rest/v2/cancel API error codes * @enum {string} */ var CancelErrorCode; (function (CancelErrorCode) { /** Operation successful */ CancelErrorCode["SUCCESS"] = "00"; /** Invalid username, password or no API access. If IP restriction exists, request may have been made from an unauthorized IP */ CancelErrorCode["INVALID_AUTH"] = "30"; /** Specified JobID not found */ CancelErrorCode["JOB_ID_NOT_FOUND"] = "60"; /** Invalid query. One of the parameters is incorrect or a required field is missing */ CancelErrorCode["PARAMETER_ERROR"] = "70"; /** System error */ CancelErrorCode["SYSTEM_ERROR_100"] = "100"; /** System error */ CancelErrorCode["SYSTEM_ERROR_101"] = "101"; /** Undefined error */ CancelErrorCode["UNDEFINED_ERROR"] = "5000"; })(CancelErrorCode || (exports.CancelErrorCode = CancelErrorCode = {})); /** * @deprecated Use SendSmsErrorCode, or other specific error code enums instead * Legacy API error codes enum - kept for backward compatibility */ var ApiErrorCode; (function (ApiErrorCode) { /** Success */ ApiErrorCode["SUCCESS"] = "00"; /** Invalid username, password or API access */ ApiErrorCode["INVALID_AUTH"] = "30"; /** Invalid header */ ApiErrorCode["INVALID_HEADER"] = "40"; /** Insufficient balance/credit */ ApiErrorCode["INSUFFICIENT_BALANCE"] = "50"; /** System error */ ApiErrorCode["SYSTEM_ERROR"] = "51"; /** Parameter error */ ApiErrorCode["PARAMETER_ERROR"] = "70"; /** Invalid date format */ ApiErrorCode["INVALID_DATE"] = "80"; /** Time error */ ApiErrorCode["TIME_ERROR"] = "85"; /** SMS cancellation error */ ApiErrorCode["CANCEL_ERROR"] = "60"; })(ApiErrorCode || (exports.ApiErrorCode = ApiErrorCode = {})); /** * Balance query type codes * @enum {number} */ var BalanceType; (function (BalanceType) { /** Package/campaign information */ BalanceType[BalanceType["PACKAGE"] = 1] = "PACKAGE"; /** Credit information */ BalanceType[BalanceType["CREDIT"] = 2] = "CREDIT"; /** Credit and Package/campaign informations */ BalanceType[BalanceType["ALLASSETS"] = 3] = "ALLASSETS"; })(BalanceType || (exports.BalanceType = BalanceType = {})); /** * Operator codes * @enum {number} */ var OperatorCode; (function (OperatorCode) { /** Vodafone */ OperatorCode[OperatorCode["VODAFONE"] = 10] = "VODAFONE"; /** Türk Telekom */ OperatorCode[OperatorCode["TURK_TELEKOM"] = 20] = "TURK_TELEKOM"; /** Turkcell */ OperatorCode[OperatorCode["TURKCELL"] = 30] = "TURKCELL"; /** Netgsm STH */ OperatorCode[OperatorCode["NETGSM_STH"] = 40] = "NETGSM_STH"; /** Netgsm Mobil */ OperatorCode[OperatorCode["NETGSM_MOBIL"] = 41] = "NETGSM_MOBIL"; /** Türktelekom Sabit */ OperatorCode[OperatorCode["TURKTELEKOM_SABIT"] = 60] = "TURKTELEKOM_SABIT"; /** Tanımsız Operator */ OperatorCode[OperatorCode["TANIMSIZ"] = 70] = "TANIMSIZ"; /** KKTC Vodafone */ OperatorCode[OperatorCode["KKTC_VODAFONE"] = 160] = "KKTC_VODAFONE"; /** Yurtdışı */ OperatorCode[OperatorCode["YURTDISI_1"] = 212] = "YURTDISI_1"; /** Yurtdışı */ OperatorCode[OperatorCode["YURTDISI_2"] = 213] = "YURTDISI_2"; /** Yurtdışı */ OperatorCode[OperatorCode["YURTDISI_3"] = 214] = "YURTDISI_3"; /** Yurtdışı */ OperatorCode[OperatorCode["YURTDISI_4"] = 215] = "YURTDISI_4"; /** KKTC Turkcell */ OperatorCode[OperatorCode["KKTC_TURKCELL"] = 880] = "KKTC_TURKCELL"; })(OperatorCode || (exports.OperatorCode = OperatorCode = {}));