picosanity
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -23,4 +23,5 @@ 'use strict'; | ||
var host = cfg.useCdn ? cdnHost : apiHost; | ||
var opts = { credentials: cfg.withCredentials ? 'include' : 'omit' }; | ||
var qs = getQs(query, params); | ||
return this.fetcher('https://' + cfg.projectId + '.' + host + '/v1/data/query/' + cfg.dataset + qs).then(function (res) { | ||
return this.fetcher('https://' + cfg.projectId + '.' + host + '/v1/data/query/' + cfg.dataset + qs, opts).then(function (res) { | ||
return res.json(); | ||
@@ -27,0 +28,0 @@ }).then(function (res) { |
{ | ||
"name": "picosanity", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Tiny Sanity client alternative should you only need to do queries", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -32,4 +32,5 @@ const enc = encodeURIComponent | ||
const host = cfg.useCdn ? cdnHost : apiHost | ||
const opts = {credentials: cfg.withCredentials ? 'include' : 'omit'} | ||
const qs = getQs(query, params) | ||
return this.fetcher(`https://${cfg.projectId}.${host}/v1/data/query/${cfg.dataset}${qs}`) | ||
return this.fetcher(`https://${cfg.projectId}.${host}/v1/data/query/${cfg.dataset}${qs}`, opts) | ||
.then(res => res.json()) | ||
@@ -36,0 +37,0 @@ .then(res => res.result) |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PicoSanity=t():e.PicoSanity=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var r=encodeURIComponent;function o(e,t){if(!(this instanceof o))return new o(e);this.cfg=e,this.fetcher=t}["clone","config","create","createIfNotExists","createOrReplace","delete","listen","mutate","patch","transaction"].forEach(function(e){o.prototype[e]=function(e){return function(){throw new Error('Method "'+e+'" not implemented, use @sanity/client')}}(e)}),o.prototype.fetch=function(e,t){var n=this.cfg,o=n.useCdn?"apicdn.sanity.io":"api.sanity.io",i=function(e,t){var n="?query="+r(e);return Object.keys(t||{}).reduce(function(e,n){return e+"&"+r("$"+n)+"="+r(JSON.stringify(t[n]))},n)}(e,t);return this.fetcher("https://"+n.projectId+"."+o+"/v1/data/query/"+n.dataset+i).then(function(e){return e.json()}).then(function(e){return e.result})},e.exports=o},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){return new r(e,window.fetch)}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PicoSanity=t():e.PicoSanity=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var r=encodeURIComponent;function o(e,t){if(!(this instanceof o))return new o(e);this.cfg=e,this.fetcher=t}["clone","config","create","createIfNotExists","createOrReplace","delete","listen","mutate","patch","transaction"].forEach(function(e){o.prototype[e]=function(e){return function(){throw new Error('Method "'+e+'" not implemented, use @sanity/client')}}(e)}),o.prototype.fetch=function(e,t){var n=this.cfg,o=n.useCdn?"apicdn.sanity.io":"api.sanity.io",i={credentials:n.withCredentials?"include":"omit"},u=function(e,t){var n="?query="+r(e);return Object.keys(t||{}).reduce(function(e,n){return e+"&"+r("$"+n)+"="+r(JSON.stringify(t[n]))},n)}(e,t);return this.fetcher("https://"+n.projectId+"."+o+"/v1/data/query/"+n.dataset+u,i).then(function(e){return e.json()}).then(function(e){return e.result})},e.exports=o},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){return new r(e,window.fetch)}}])}); |
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
11117
147