text: var e,t=require("query-string"),r=(e=require("node-fetch"))&&"object"==typeof e&&"default"in e?e.default:e;"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var o=require("node-forge");exports.request=function(e,n,i,s){try{return Promise.resolve(function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){var a,u,y=(a=o.md.sha256.create(),u=o.random.getBytesSync(8),a.update(u),a.digest().toHex()),c=function(e,r,n){var i=t.parse(n),s=Object.assign({},i),a=Object.keys(s).sort().reduce(function(e,t){return e.push(t+"="+s[t]),e},[]).join(""),u=o.hmac.create();return u.start("sha256",e),u.update(a),u.digest().toHex()}(n,0,"?path_prefix=/apps/dimensionauth&seed="+y+"&shop="+e);return Promise.resolve(r("https://"+e+"/apps/dimensionauth/api"+i+"?"+t.stringify({seed:y,sig:c}),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).then(function(e){return Promise.resolve(e.json())})},function(e){return{success:!1,error:e}}))}catch(e){return Promise.reject(e)}},exports.shopifyDomainFrom=function(e){return e.indexOf("myshopify.com")>=0?e:-1===e.indexOf(".")?e+".myshopify.com":e};
  //# sourceMappingURL=helpers.ts.js.map
  