@plasmicapp/data-sources
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -7,6 +7,6 @@ 'use strict'; | ||
var query = require('@plasmicapp/query'); | ||
var host = require('@plasmicapp/host'); | ||
var React = _interopDefault(require('react')); | ||
var dataSourcesContext = require('@plasmicapp/data-sources-context'); | ||
var query = require('@plasmicapp/query'); | ||
var fetch = _interopDefault(require('isomorphic-unfetch')); | ||
@@ -999,2 +999,8 @@ | ||
Object.defineProperty(exports, 'usePlasmicDataConfig', { | ||
enumerable: true, | ||
get: function () { | ||
return query.usePlasmicDataConfig; | ||
} | ||
}); | ||
exports.Fetcher = Fetcher; | ||
@@ -1001,0 +1007,0 @@ exports.executePlasmicDataOp = executePlasmicDataOp; |
@@ -1,2 +0,2 @@ | ||
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@plasmicapp/host"),r=t(require("react")),n=require("@plasmicapp/data-sources-context"),o=require("@plasmicapp/query"),i=t(require("isomorphic-unfetch"));function a(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)}))}}function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){return t(e={exports:{}},e.exports),e.exports}var l=s((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new E(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=x(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function h(){}function p(){}function f(){}var d={};u(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=f.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return p.prototype=f,u(g,"constructor",f),u(f,"constructor",p),p.displayName=u(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,u(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),u(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),u(g,a,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}));function h(t,e){return p.apply(this,arguments)}function p(){return(p=u(l.mark((function t(e,r){var n;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=v("__PLASMIC_EXECUTE_DATA_OP",f),t.next=3,n(e,r);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t,e){return d.apply(this,arguments)}function d(){return(d=u(l.mark((function t(e,r){var n,o,a,u;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=v("__PLASMIC_DATA_HOST","https://studio.plasmic.app"),a=o+"/api/v1/server-data/sources/"+e.sourceId+"/execute",t.next=4,i(a,{method:"POST",headers:c({"Content-Type":"application/json"},(null==r?void 0:r.userAuthToken)&&{"x-plasmic-data-user-auth-token":r.userAuthToken}),body:JSON.stringify({opId:e.opId,userArgs:null!=(n=e.userArgs)?n:{},includeSchema:null==r?void 0:r.includeSchema,paginate:null==r?void 0:r.paginate})});case 4:if(200===(u=t.sent).status){t.next=10;break}return t.next=8,u.text();case 8:throw new Error(t.sent);case 10:return t.next=12,u.json();case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t,e){return"undefined"==typeof globalThis?e:null!=(r=globalThis[t])?r:e;var r}function y(t,e){var r=n.usePlasmicDataSourceContext();return o.useMutablePlasmicQueryData((function(){return t?JSON.stringify({sourceId:t.sourceId,opId:t.opId,args:t.userArgs,userAuthToken:null==r?void 0:r.userAuthToken,includeSchema:null==e?void 0:e.includeSchema,paginate:null==e?void 0:e.paginate}):null}),u(l.mark((function n(){return l.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,h(t,{userAuthToken:null==r?void 0:r.userAuthToken,includeSchema:null==e?void 0:e.includeSchema,paginate:null==e?void 0:e.paginate});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)}))))}exports.Fetcher=function(t){var n,o=t.children,i=t.name,a=t.pageIndex,u=t.pageSize,s=y(t.dataOp,c({includeSchema:t.includeSchema},!!a&&!!u&&{paginate:{pageIndex:a,pageSize:u}})),l=s.data,h=s.error;return r.createElement(e.DataProvider,{name:null!=i?i:"data",data:l},h||null!=l&&l.error?r.createElement("div",null,"Error: ",(null==h?void 0:h.toString())||(null==l||null==(n=l.error)?void 0:n.message)):o)},exports.executePlasmicDataOp=h,exports.usePlasmicDataMutationOp=function(t,e){var o=null!=t?t:{},i=o.sourceId,a=o.opId,c=o.userArgs,s=n.usePlasmicDataSourceContext(),p=null==s?void 0:s.userAuthToken;return r.useCallback(u(l.mark((function t(){return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i&&a){t.next=2;break}return t.abrupt("return",void 0);case 2:return t.abrupt("return",h({sourceId:i,opId:a,userArgs:c},{userAuthToken:p,includeSchema:null==e?void 0:e.includeSchema}));case 3:case"end":return t.stop()}}),t)}))),[i,a,c,p])},exports.usePlasmicDataOp=y; | ||
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@plasmicapp/query"),r=require("@plasmicapp/host"),n=t(require("react")),o=require("@plasmicapp/data-sources-context"),i=t(require("isomorphic-unfetch"));function a(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)}))}}function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){return t(e={exports:{}},e.exports),e.exports}var l=s((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new E(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=x(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function h(){}function f(){}function p(){}var d={};u(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=p,u(g,"constructor",p),u(p,"constructor",f),f.displayName=u(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),u(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),u(g,a,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}));function h(t,e){return f.apply(this,arguments)}function f(){return(f=u(l.mark((function t(e,r){var n;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=v("__PLASMIC_EXECUTE_DATA_OP",p),t.next=3,n(e,r);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function p(t,e){return d.apply(this,arguments)}function d(){return(d=u(l.mark((function t(e,r){var n,o,a,u;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=v("__PLASMIC_DATA_HOST","https://studio.plasmic.app"),a=o+"/api/v1/server-data/sources/"+e.sourceId+"/execute",t.next=4,i(a,{method:"POST",headers:c({"Content-Type":"application/json"},(null==r?void 0:r.userAuthToken)&&{"x-plasmic-data-user-auth-token":r.userAuthToken}),body:JSON.stringify({opId:e.opId,userArgs:null!=(n=e.userArgs)?n:{},includeSchema:null==r?void 0:r.includeSchema,paginate:null==r?void 0:r.paginate})});case 4:if(200===(u=t.sent).status){t.next=10;break}return t.next=8,u.text();case 8:throw new Error(t.sent);case 10:return t.next=12,u.json();case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t,e){return"undefined"==typeof globalThis?e:null!=(r=globalThis[t])?r:e;var r}function y(t,r){var n=o.usePlasmicDataSourceContext();return e.useMutablePlasmicQueryData((function(){return t?JSON.stringify({sourceId:t.sourceId,opId:t.opId,args:t.userArgs,userAuthToken:null==n?void 0:n.userAuthToken,includeSchema:null==r?void 0:r.includeSchema,paginate:null==r?void 0:r.paginate}):null}),u(l.mark((function e(){return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h(t,{userAuthToken:null==n?void 0:n.userAuthToken,includeSchema:null==r?void 0:r.includeSchema,paginate:null==r?void 0:r.paginate});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))))}Object.defineProperty(exports,"usePlasmicDataConfig",{enumerable:!0,get:function(){return e.usePlasmicDataConfig}}),exports.Fetcher=function(t){var e,o=t.children,i=t.name,a=t.pageIndex,u=t.pageSize,s=y(t.dataOp,c({includeSchema:t.includeSchema},!!a&&!!u&&{paginate:{pageIndex:a,pageSize:u}})),l=s.data,h=s.error;return n.createElement(r.DataProvider,{name:null!=i?i:"data",data:l},h||null!=l&&l.error?n.createElement("div",null,"Error: ",(null==h?void 0:h.toString())||(null==l||null==(e=l.error)?void 0:e.message)):o)},exports.executePlasmicDataOp=h,exports.usePlasmicDataMutationOp=function(t,e){var r=null!=t?t:{},i=r.sourceId,a=r.opId,c=r.userArgs,s=o.usePlasmicDataSourceContext(),f=null==s?void 0:s.userAuthToken;return n.useCallback(u(l.mark((function t(){return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i&&a){t.next=2;break}return t.abrupt("return",void 0);case 2:return t.abrupt("return",h({sourceId:i,opId:a,userArgs:c},{userAuthToken:f,includeSchema:null==e?void 0:e.includeSchema}));case 3:case"end":return t.stop()}}),t)}))),[i,a,c,f])},exports.usePlasmicDataOp=y; | ||
//# sourceMappingURL=data-sources.cjs.production.min.js.map |
@@ -0,5 +1,6 @@ | ||
import { useMutablePlasmicQueryData } from '@plasmicapp/query'; | ||
export { usePlasmicDataConfig } from '@plasmicapp/query'; | ||
import { DataProvider } from '@plasmicapp/host'; | ||
import React from 'react'; | ||
import { usePlasmicDataSourceContext } from '@plasmicapp/data-sources-context'; | ||
import { useMutablePlasmicQueryData } from '@plasmicapp/query'; | ||
import fetch from 'isomorphic-unfetch'; | ||
@@ -6,0 +7,0 @@ |
@@ -0,1 +1,2 @@ | ||
export { usePlasmicDataConfig } from '@plasmicapp/query'; | ||
export { Fetcher } from './components/Fetcher'; | ||
@@ -2,0 +3,0 @@ export { DataOp, executePlasmicDataOp } from './executor'; |
{ | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"license": "MIT", | ||
@@ -63,3 +63,3 @@ "main": "dist/index.js", | ||
"@plasmicapp/host": "1.0.81", | ||
"@plasmicapp/query": "0.1.54", | ||
"@plasmicapp/query": "0.1.55", | ||
"isomorphic-unfetch": "^3.1.0" | ||
@@ -70,3 +70,3 @@ }, | ||
}, | ||
"gitHead": "6d5c0abfccad50013e564f2d2d240668feba6c54" | ||
"gitHead": "ea082f2241753ed103bfa3d971c0fed71b9f4d58" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
232551
1787
+ Added@plasmicapp/query@0.1.55(transitive)
- Removed@plasmicapp/query@0.1.54(transitive)
Updated@plasmicapp/query@0.1.55