@commercetools/sdk-client
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("querystring"),require("http")):"function"==typeof define&&define.amd?define(["exports","querystring","http"],r):r(e.CommercetoolsSdkClient={},e.qs,e.http)}(this,function(e,r,t){"use strict";function o(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{allowedMethods:t.METHODS};if(!r)throw new Error('The "'+e+'" function requires a "Request" object as an argument. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest');if("string"!=typeof r.uri)throw new Error('The "'+e+'" Request object requires a valid uri. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest');if(-1===o.allowedMethods.indexOf(r.method))throw new Error('The "'+e+'" Request object requires a valid method. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest')}function n(e){if(!e)throw new Error("Missing required options");if(e.middlewares&&!Array.isArray(e.middlewares))throw new Error("Middlewares should be an array");if(!e.middlewares||!Array.isArray(e.middlewares)||!e.middlewares.length)throw new Error("You need to provide at least one middleware");return{execute:function(r){return o("exec",r),new Promise(function(t,o){(function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return 1===(r=r.filter(function(e){return"function"==typeof e})).length?r[0]:r.reduce(function(e,r){return function(){return e(r.apply(void 0,arguments))}})}).apply(void 0,a(e.middlewares))(function(e,r){if(r.error)r.reject(r.error);else{var t={body:r.body||{},statusCode:r.statusCode};r.headers&&(t.headers=r.headers),r.request&&(t.request=r.request),r.resolve(t)}})(r,{resolve:t,reject:o,body:void 0,error:void 0})})},process:function(e,t,n){var a=this;if(o("process",e,{allowedMethods:["GET"]}),"function"!=typeof t)throw new Error('The "process" function accepts a "Function" as a second argument that returns a Promise. See https://commercetools.github.io/nodejs/sdk/api/sdkClient.html#processrequest-processfn-options');var u=i({total:Number.POSITIVE_INFINITY,accumulate:!0},n);return new Promise(function(o,n){var l=e.uri.split("?"),c=s(l,2),d=c[0],f=c[1],h=i({},r.parse(f)),y=i({limit:20},h),m=u.total;!function s(l){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],f=y.limit<m?y.limit:m,h=r.stringify(i({},y,{limit:f})),p=i({sort:"id asc",withTotal:!1},l?{where:'id > "'+l+'"'}:{}),w=r.stringify(p),v=i({},e,{uri:d+"?"+w+"&"+h});a.execute(v).then(function(e){t(e).then(function(r){var t=e.body.results.length,n=void 0;if(u.accumulate&&(n=c.concat(r||[])),m-=t,t<y.limit||!m)o(n||[]);else{var i=e.body.results[t-1],a=i&&i.id;s(a,n)}}).catch(n)}).catch(n)}()})}}}r=r&&r.hasOwnProperty("default")?r.default:r;var i=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},s=function(){return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var t=[],o=!0,n=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(o=(s=a.next()).done)&&(t.push(s.value),!r||t.length!==r);o=!0);}catch(e){n=!0,i=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw i}}return t}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)};e.createClient=n,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("querystring"),require("http")):"function"==typeof define&&define.amd?define(["exports","querystring","http"],r):r(e.CommercetoolsSdkClient={},e.qs,e.http)}(this,function(e,r,t){"use strict";function o(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{allowedMethods:t.METHODS};if(!r)throw new Error('The "'+e+'" function requires a "Request" object as an argument. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest');if("string"!=typeof r.uri)throw new Error('The "'+e+'" Request object requires a valid uri. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest');if(-1===o.allowedMethods.indexOf(r.method))throw new Error('The "'+e+'" Request object requires a valid method. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest')}r=r&&r.hasOwnProperty("default")?r.default:r;var n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},i=function(){return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var t=[],o=!0,n=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(o=(s=a.next()).done)&&(t.push(s.value),!r||t.length!==r);o=!0);}catch(e){n=!0,i=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw i}}return t}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)};e.createClient=function(e){if(!e)throw new Error("Missing required options");if(e.middlewares&&!Array.isArray(e.middlewares))throw new Error("Middlewares should be an array");if(!e.middlewares||!Array.isArray(e.middlewares)||!e.middlewares.length)throw new Error("You need to provide at least one middleware");return{execute:function(r){return o("exec",r),new Promise(function(t,o){(function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return 1===(r=r.filter(function(e){return"function"==typeof e})).length?r[0]:r.reduce(function(e,r){return function(){return e(r.apply(void 0,arguments))}})}).apply(void 0,s(e.middlewares))(function(e,r){if(r.error)r.reject(r.error);else{var t={body:r.body||{},statusCode:r.statusCode};r.headers&&(t.headers=r.headers),r.request&&(t.request=r.request),r.resolve(t)}})(r,{resolve:t,reject:o,body:void 0,error:void 0})})},process:function(e,t,s){var a=this;if(o("process",e,{allowedMethods:["GET"]}),"function"!=typeof t)throw new Error('The "process" function accepts a "Function" as a second argument that returns a Promise. See https://commercetools.github.io/nodejs/sdk/api/sdkClient.html#processrequest-processfn-options');var u=n({total:Number.POSITIVE_INFINITY,accumulate:!0},s);return new Promise(function(o,s){var l=e.uri.split("?"),c=i(l,2),d=c[0],f=c[1],h=n({},r.parse(f)),y=n({limit:20},h),m=u.total;!function i(l){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],f=y.limit<m?y.limit:m,h=r.stringify(n({},y,{limit:f})),p=n({sort:"id asc",withTotal:!1},l?{where:'id > "'+l+'"'}:{}),w=r.stringify(p),v=n({},e,{uri:d+"?"+w+"&"+h});a.execute(v).then(function(e){t(e).then(function(r){var t=e.body.results.length,n=void 0;if(u.accumulate&&(n=c.concat(r||[])),m-=t,t<y.limit||!m)o(n||[]);else{var s=e.body.results[t-1],a=s&&s.id;i(a,n)}}).catch(s)}).catch(s)}()})}}},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=commercetools-sdk-client.umd.min.js.map |
@@ -7,3 +7,3 @@ { | ||
"name": "@commercetools/sdk-client", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "SDK Client for usage of commercetools platform API", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
@@ -5,3 +5,3 @@ # commercetools-sdk-client | ||
https://commercetools.github.io/nodejs/docs/sdk/api/#sdk-client | ||
https://commercetools.github.io/nodejs/sdk/api/sdkClient.html | ||
@@ -8,0 +8,0 @@ ## Install |
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
38735