Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(function(){return(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>a});const o=e=>{try{return e?e.toLowerCase():e}catch(e){return console.log(e),null}},n=function(e,t,o){var n;function r(){if(4==n.readyState)if(n.status.toString().match(/^20[0-9]$/)){var e=function(){var e=n.getResponseHeader("Content-Type"),t=n.responseText;if(e){var o=e.split(";");try{switch(o[0]){case"application/json":return JSON.parse(t);default:return t}}catch(e){throw"Unable to convert response header"}}}();t.call(this,e,n)}else o.call(this,n.responseText,n)}function a(e,t){var o=[];for(var n in e)if(e.hasOwnProperty(n)){var r=t?t+"["+n+"]":n,i=e[n];o.push("object"==typeof i?a(i,r):encodeURIComponent(r)+"="+encodeURIComponent(i))}return o.join("&")}return window.XMLHttpRequest?n=new XMLHttpRequest:window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLHTTP")),{request:function(){if(window.XMLHttpRequest)n.onload=r;else{if(!window.ActiveXObject)throw"unable to process ajax";n.onreadystatechange=r}var t=a(e.params);if("get"==e.method.toLowerCase()&&"object"==typeof e.params){if(-1==e.url.indexOf("?"))e.url+="?";else{var o=e.url.split("?");o[1]&&o[1].split("=")[1]&&(e.url+="&")}e.url+=t}e.hasOwnProperty("async")||(e.async=!0),n.open(e.method,e.url,e.async),e.headers&&function(e){for(let t in e)n.setRequestHeader(t,e[t])}(e.headers),n.send(t)}}},r=e=>{const t="https://www.mockforme.com",r=`${t}/mockforme`,a=`${t}/gateway/op/getEnabledApisForSdk`,i="mockforme";let s=[];const c=window.location,l=c.protocol,p=c.host;if(c.port,!e)throw"mockforme token cannot be null";const u=(e,t="get")=>{let n=null;if(!Array.isArray(s))return n;for(let r=0;r<s.length;r++){const a=s[r];if(o(a.apiMethod)===o(t)&&a.apiEndpoint===e){n={url:a.apiEndpoint,method:a.apiMethod};break}}return n},d=()=>{(()=>{const t=window.fetch;window.fetch=function(o,n={}){n.method||(n.method="get");let a=arguments;const s=new URL(o),c=s&&s.pathname,l=u(c,n.method);return l&&(o=`${r}${l.url}`,a[0]=o,n.headers={[i]:e}),t.call(this,o,n)}})(),(()=>{let t=window.XMLHttpRequest.prototype.open;window.XMLHttpRequest.prototype.open=function(o,n,a,s,c){try{n.match(/https?[:]\/\//)||(n=`${l}//${p}${n}`);const a=new URL(n),s=a&&a.pathname;let c=arguments;const d=u(s,o);return d&&(c[1]=`${r}${d.url}`),this.onreadystatechange=function(){1==this.readyState&&this.setRequestHeader(i,e)},t.apply(this,c)}catch(e){return console.log("Error in mock api, could be invalid url",e),t.apply(this,arguments)}}})()};return{initialize:e=>{var t;d(),t=t=>{e&&e(t)},n({method:"get",url:a,async:!1},(e=>{var o;e&&(o=e,s=s.concat(o)),t(e)}),(()=>{console.log("Error in loading mocked apis")})).request()}}};window.mockforme=r;const a=r;return t})()})); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(function(){return(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>a});const o=e=>{try{return e?e.toLowerCase():e}catch(e){return console.log(e),null}},n=function(e,t,o){var n;function r(){if(4==n.readyState)if(n.status.toString().match(/^20[0-9]$/)){var e=function(){var e=n.getResponseHeader("Content-Type"),t=n.responseText;if(e){var o=e.split(";");try{switch(o[0]){case"application/json":return JSON.parse(t);default:return t}}catch(e){throw"Unable to convert response header"}}}();t.call(this,e,n)}else o.call(this,n.responseText,n)}function a(e,t){var o=[];for(var n in e)if(e.hasOwnProperty(n)){var r=t?t+"["+n+"]":n,i=e[n];o.push("object"==typeof i?a(i,r):encodeURIComponent(r)+"="+encodeURIComponent(i))}return o.join("&")}return window.XMLHttpRequest?n=new XMLHttpRequest:window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLHTTP")),{request:function(){if(window.XMLHttpRequest)n.onload=r;else{if(!window.ActiveXObject)throw"unable to process ajax";n.onreadystatechange=r}var t=a(e.params);if("get"==e.method.toLowerCase()&&"object"==typeof e.params){if(-1==e.url.indexOf("?"))e.url+="?";else{var o=e.url.split("?");o[1]&&o[1].split("=")[1]&&(e.url+="&")}e.url+=t}e.hasOwnProperty("async")||(e.async=!0),n.open(e.method,e.url,e.async),e.headers&&function(e){for(let t in e)n.setRequestHeader(t,e[t])}(e.headers),n.send(t)}}},r=e=>{const t="https://dashboard.mockforme.com",r=`${t}/mockforme`,a=`${t}/gateway/op/getEnabledApisForSdk`,i="mockforme";let s=[];const c=window.location,l=c.protocol,p=c.host;if(c.port,!e)throw"mockforme token cannot be null";const u=(e,t="get")=>{let n=null;if(!Array.isArray(s))return n;for(let r=0;r<s.length;r++){const a=s[r];if(o(a.apiMethod)===o(t)&&a.apiEndpoint===e){n={url:a.apiEndpoint,method:a.apiMethod};break}}return n},d=()=>{(()=>{const t=window.fetch;window.fetch=function(o,n={}){n.method||(n.method="get");let a=arguments;const s=new URL(o),c=s&&s.pathname,l=u(c,n.method);return l&&(o=`${r}${l.url}`,a[0]=o,n.headers={[i]:e}),t.call(this,o,n)}})(),(()=>{let t=window.XMLHttpRequest.prototype.open;window.XMLHttpRequest.prototype.open=function(o,n,a,s,c){try{n.match(/https?[:]\/\//)||(n=`${l}//${p}${n}`);const a=new URL(n),s=a&&a.pathname;let c=arguments;const d=u(s,o);return d&&(c[1]=`${r}${d.url}`),this.onreadystatechange=function(){1==this.readyState&&this.setRequestHeader(i,e)},t.apply(this,c)}catch(e){return console.log("Error in mock api, could be invalid url",e),t.apply(this,arguments)}}})()};return{initialize:e=>{var t;d(),t=t=>{e&&e(t)},n({method:"get",url:a,async:!1},(e=>{var o;e&&(o=e,s=s.concat(o)),t(e)}),(()=>{console.log("Error in loading mocked apis")})).request()}}};window.mockforme=r;const a=r;return t})()})); |
{ | ||
"name": "mockforme", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "mockforme client integration kit. Intercept APIs & get mock responses. Integrate mockforme SDK with your codebase in seconds", | ||
@@ -5,0 +5,0 @@ "main": "dist/mockforme.min.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5764