{"version":3,"sources":["jsdelivr-header.js","/npm/resellerclub@1.0.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,MAAQ,QAAQ,SAChB,GAAK,QAAQ,MACb,aAAe,CAAC,EAEtB,aAAa,QAAU,EAAG,WAAU,kBAC3B,IAAI,SAAQ,CAAC,EAAS,KACtB,GACH,EAAO,2BAGJ,GAGH,KAAK,SAAW,EAChB,KAAK,aAAe,EACpB,EAAQ,2BAJR,EAAO,4BAKT,IAIJ,aAAa,aAAe,EAAG,aAAY,UAClC,IAAI,SAAQ,CAAC,EAAS,KAEtB,KAAK,UAEE,KAAK,aAGf,MACG,IAAI,6DAA8D,CACjE,OAAQ,CACN,cAAe,KAAK,SACpB,UAAW,KAAK,aAChB,cAAe,EACf,KAAM,GAER,iBAAkB,SAAS,GACzB,OAAO,GAAG,UAAU,EAAQ,CAAE,YAAa,UAC7C,IAED,MAAK,IACJ,EAAQ,EAAS,KAAK,IAEvB,OAAM,IACL,EAAO,EAAM,SAAS,IApB1B,EAAO,4BAsBT,IAIJ,OAAO,QAAU","file":"/npm/resellerclub@1.0.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/resellerclub@1.0.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const axios = require(\"axios\");\r\nconst Qs = require(\"qs\");\r\nconst resellerclub = {};\r\n\r\nresellerclub.connect = ({ clientID, clientSecret }) => {\r\n  return new Promise((resolve, reject) => {\r\n    if (!clientID) {\r\n      reject(\"`clientID` is mandatory\");\r\n    }\r\n\r\n    if (!clientSecret) {\r\n      reject(\"ClientSecret is mandatory\");\r\n    } else {\r\n      this.clientID = clientID;\r\n      this.clientSecret = clientSecret;\r\n      resolve(\"Connection Established\");\r\n    }\r\n  });\r\n};\r\n\r\nresellerclub.domainSearch = ({ domainname, tlds }) => {\r\n  return new Promise((resolve, reject) => {\r\n    // Optionally the request above could also be done as\r\n    if (!this.clientID) {\r\n      reject(\"connection not establised\");\r\n    } else if (!this.clientSecret) {\r\n      reject(\"connection not establised\");\r\n    } else {\r\n      axios\r\n        .get(`https://domaincheck.httpapi.com/api/domains/available.json`, {\r\n          params: {\r\n            \"auth-userid\": this.clientID,\r\n            \"api-key\": this.clientSecret,\r\n            \"domain-name\": domainname,\r\n            tlds: tlds\r\n          },\r\n          paramsSerializer: function(params) {\r\n            return Qs.stringify(params, { arrayFormat: \"repeat\" });\r\n          }\r\n        })\r\n        .then(response => {\r\n          resolve(response.data);\r\n        })\r\n        .catch(error => {\r\n          reject(error.response);\r\n        });\r\n    }\r\n  });\r\n};\r\n\r\nmodule.exports = resellerclub;\r\n"]}