@yldmag/sdk-local
Advanced tools
Comparing version 1.0.7-alpha.1 to 1.0.7-alpha.2
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).TestPurrKittens=t()}(this,function(){"use strict";function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function c(o){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){var t,r,n;t=o,n=i[r=e],r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))})}return o}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function f(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r=require("node-fetch");module.exports=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),r.call(this,e,t)},e.fetch||(e.fetch=module.exports,e.Response=r.Response,e.Headers=r.Headers,e.Request=r.Request);function p(){u(this,p);var e=!0,t=!1,r=void 0;try{for(var n,o=Object.getOwnPropertyNames(this.constructor.prototype)[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){var i=n.value,s=this[i];"constructor"!==i&&"function"==typeof s&&(this[i]=s.bind(this))}}catch(e){t=!0,r=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw r}}}var l=!("undefined"!=typeof window&&window.document&&window.document.createElement),n=c({},{getAllPosts:function(e,t){return this.get("/posts",{params:{scope:"all",page:e,limit:t}})},getPost:function(e){return this.get("/posts/".concat(e))}},{},{getCategories:function(){return this.get("/categories",{params:{scope:"all"}})}},{},{getAuthors:function(){return this.get("/authors")},getAuthorById:function(e){return this.get("/authors/".concat(e))},getAuthorPosts:function(e,t){var r=(1<arguments.length&&void 0!==t?t:{}).sort,n={sort:void 0!==r&&r||"asc"};return this.get("/authors/".concat(e,"/posts"),{params:n})}},{},{getReactionsByURL:function(e){return console.log(":::::isServer:::::",l),this.get("/posts/".concat(e,"/reactions"))}}),h=function(){function r(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(u(this,r),e=f(this,i(r).call(this)),!Object.prototype.hasOwnProperty.call(t,"baseURL"))throw new TypeError("Cannot instance CuidateMorra client without baseURL property");return e.baseURL=t.baseURL.concat("/"),e.requestIp=t.requestIp||!1,e}var e,t,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(r,p),e=r,(t=[{key:"request",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=this.baseURL.concat(e),n=new Headers(t.headers||{});l&&(n.set("Is-server",!0),n.set("Request-ip",this.request)),"POST"!==t.method&&"UPDATE"!==t.method&&"PATCH"!==t.method||(t.body=JSON.stringify(t.body)||{},n.set("Content-Type","application/json"));var o=new Request(r,c({},t,{headers:n}));return fetch(o).then(function(e){if(300<=e.status||e.status<200)throw new Error(e.statusText);return e.json().then(function(e){return e})})}},{key:"get",value:function(e,t){var r,n=1<arguments.length&&void 0!==t?t:{},o=n.params,i=void 0===o?{}:o,s=a(n,["params"]),u=0<Object.keys(i).length?e.concat("?",(r=i,Object.entries(r).map(function(e){return e[0].concat("=",e[1])}).join("&"))):e;return this.request(u,c({method:"GET"},s))}},{key:"post",value:function(e,t){var r=1<arguments.length&&void 0!==t?t:{};return this.request(e,c({method:"POST",body:JSON.stringify(r.body)},r))}},{key:"patch",value:function(e,t){var r=1<arguments.length&&void 0!==t?t:{};return this.request(e,{method:"PATCH",params:r})}}])&&o(e.prototype,t),n&&o(e,n),r}();return Object.keys(n).forEach(function(e){h.prototype[e]=n[e]}),h}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).TestPurrKittens=t()}(this,function(){"use strict";function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function c(o){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){var t,r,n;t=o,n=i[r=e],r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))})}return o}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function f(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r=require("node-fetch");module.exports=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),r.call(this,e,t)},e.fetch||(e.fetch=module.exports,e.Response=r.Response,e.Headers=r.Headers,e.Request=r.Request);function p(){u(this,p);var e=!0,t=!1,r=void 0;try{for(var n,o=Object.getOwnPropertyNames(this.constructor.prototype)[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){var i=n.value,s=this[i];"constructor"!==i&&"function"==typeof s&&(this[i]=s.bind(this))}}catch(e){t=!0,r=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw r}}}var l=!("undefined"!=typeof window&&window.document&&window.document.createElement),n=c({},{getAllPosts:function(e,t){return this.get("/posts",{params:{scope:"all",page:e,limit:t}})},getPost:function(e){return this.get("/posts/".concat(e))}},{},{getCategories:function(){return this.get("/categories",{params:{scope:"all"}})}},{},{getAuthors:function(){return this.get("/authors")},getAuthorById:function(e){return this.get("/authors/".concat(e))},getAuthorPosts:function(e,t){var r=(1<arguments.length&&void 0!==t?t:{}).sort,n={sort:void 0!==r&&r||"asc"};return this.get("/authors/".concat(e,"/posts"),{params:n})}},{},{getReactionsByURL:function(e){return console.log(":::::isServer:::::",l),this.get("/posts/".concat(e,"/reactions"))}}),h=function(){function r(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(u(this,r),e=f(this,i(r).call(this)),!Object.prototype.hasOwnProperty.call(t,"baseURL"))throw new TypeError("Cannot instance CuidateMorra client without baseURL property");return e.baseURL=t.baseURL.concat("/"),e.requestIp=t.requestIp||!1,e}var e,t,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(r,p),e=r,(t=[{key:"request",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=this.baseURL.concat(e),n=new Headers(t.headers||{});l&&(n.set("Is-server",!0),n.set("Request-ip",this.requestIp)),"POST"!==t.method&&"UPDATE"!==t.method&&"PATCH"!==t.method||(t.body=JSON.stringify(t.body)||{},n.set("Content-Type","application/json"));var o=new Request(r,c({},t,{headers:n}));return fetch(o).then(function(e){if(300<=e.status||e.status<200)throw new Error(e.statusText);return e.json().then(function(e){return e})})}},{key:"get",value:function(e,t){var r,n=1<arguments.length&&void 0!==t?t:{},o=n.params,i=void 0===o?{}:o,s=a(n,["params"]),u=0<Object.keys(i).length?e.concat("?",(r=i,Object.entries(r).map(function(e){return e[0].concat("=",e[1])}).join("&"))):e;return this.request(u,c({method:"GET"},s))}},{key:"post",value:function(e,t){var r=1<arguments.length&&void 0!==t?t:{};return this.request(e,c({method:"POST",body:JSON.stringify(r.body)},r))}},{key:"patch",value:function(e,t){var r=1<arguments.length&&void 0!==t?t:{};return this.request(e,{method:"PATCH",params:r})}}])&&o(e.prototype,t),n&&o(e,n),r}();return Object.keys(n).forEach(function(e){h.prototype[e]=n[e]}),h}); | ||
//# sourceMappingURL=bundle.js.map |
{ | ||
"name": "@yldmag/sdk-local", | ||
"version": "1.0.7-alpha.1", | ||
"version": "1.0.7-alpha.2", | ||
"main": "build/bundle.js", | ||
@@ -5,0 +5,0 @@ "author": "elaineeeit@gmail.com", |
Sorry, the diff of this file is not supported yet
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
21623