File manager - Edit - /usr/local/cpanel/whostmgr/docroot/templates/mail_blocked_countries/services/countriesService.min.js
Back
define(["angular","lodash","cjt/io/whm-v1-request","cjt/modules","cjt/io/api","cjt/io/whm-v1","cjt/services/APICatcher"],(function(angular,_,APIRequest){"use strict";var MODULE_NAMESPACE="whm.eximBlockCountries.services.countries";var SERVICE_NAME="eximBlockCountries";var MODULE_REQUIREMENTS=["cjt2.services.apicatcher"];var SERVICE_INJECTABLES=["APICatcher","$q"];var SERVICE_FACTORY=function SERVICE_FACTORY(APICatcher,$q){var Service=function Service(){};Service.prototype=Object.create(APICatcher);_.assign(Service.prototype,{_apiCall:function _createApiCall(module,func,args){var apiCall=new APIRequest.Class;apiCall.initialize(module,func,args);return apiCall},listBlockedIncomingEmailCountries:function listBlockedIncomingEmailCountries(){if(_.isArray(PAGE.blocked_incoming_email_countries)){return $q.resolve(PAGE.blocked_incoming_email_countries)}var apiCall=this._apiCall("","list_blocked_incoming_email_countries");return this._promise(apiCall).then((function _parseBlockedCountries(result){return result&&result.data||[]}))},getCountriesWithKnownIPRanges:function getCountriesWithKnownIPRanges(){if(_.isArray(PAGE.countries_with_known_ip_ranges)){return $q.resolve(PAGE.countries_with_known_ip_ranges)}var apiCall=this._apiCall("","get_countries_with_known_ip_ranges");return this._promise(apiCall).then((function _parseCountries(result){return result&&result.data||[]}))},_verifyCountryCodesArray:function _verifyCountryCodesArray(countryCodes){if(!_.isArray(countryCodes)){throw"countryCodes must be an array"}var notStringIndex=_.findIndex(countryCodes,(function(countryCode){if(typeof countryCode!=="string"){return true}return false}));if(notStringIndex!==-1){var msg="";msg+="countryCodes must be an array of country code strings. ";msg+="“"+notStringIndex+"” is not a string ("+typeof countryCodes[notStringIndex]+")";throw msg}return true},blockIncomingEmailFromCountries:function blockIncomingEmailFromCountries(countryCodes){this._verifyCountryCodesArray(countryCodes);var apiCall=this._apiCall("","block_incoming_email_from_country",{country_code:countryCodes});return this._promise(apiCall)},unblockIncomingEmailFromCountries:function unblockIncomingEmailFromCountries(countryCodes){this._verifyCountryCodesArray(countryCodes);var apiCall=this._apiCall("","unblock_incoming_email_from_country",{country_code:countryCodes});return this._promise(apiCall)},_promise:function _promise(){return APICatcher.promise.apply(this,arguments)}});return new Service};SERVICE_INJECTABLES.push(SERVICE_FACTORY);var app=angular.module(MODULE_NAMESPACE,MODULE_REQUIREMENTS);app.factory(SERVICE_NAME,SERVICE_INJECTABLES);return{class:SERVICE_FACTORY,serviceName:SERVICE_NAME,namespace:MODULE_NAMESPACE}}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings