@gitbeaker/requester-utils
Advanced tools
Comparing version 18.2.0 to 19.0.0
@@ -0,1 +1,13 @@ | ||
# v19.0.0 (Thu Apr 23 2020) | ||
#### 💥 Breaking Change | ||
- Adding CLI Integration Tests and Preferring named exports [#711](https://github.com/jdalrymple/gitbeaker/pull/711) ([@jdalrymple](https://github.com/jdalrymple)) | ||
#### Authors: 1 | ||
- Justin Dalrymple ([@jdalrymple](https://github.com/jdalrymple)) | ||
--- | ||
# v18.2.0 (Wed Apr 22 2020) | ||
@@ -2,0 +14,0 @@ |
@@ -15,2 +15,2 @@ import t from"form-data";import{decamelizeKeys as r}from"xcase";import{stringify as e}from"query-string"; | ||
and limitations under the License. | ||
***************************************************************************** */var o=function(){return(o=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}).apply(this,arguments)},n=["get","post","put","delete","stream"];function a(t){return e(r(t||{}),{arrayFormat:"bracket"})}function i(e,o){var n,i=void 0===o?{method:"get"}:o,u=i.body,c=i.query,f=i.sudo,s=i.method,m=e.headers;return f&&(m.sudo=f),"object"!=typeof u||u instanceof t?n=u:(n=JSON.stringify(r(u)),m["content-type"]="application/json"),{agent:void 0,headers:m,timeout:e.requestTimeout,method:s,searchParams:a(c),prefixUrl:e.url,body:n}}function u(t,r){var e={};return n.forEach((function(n){e[n]=function(e,a,i){var u=t(e,o(o({},i),{method:n}));return r(a,u)}})),e}export{u as createInstance,i as defaultRequest,a as formatQuery}; | ||
***************************************************************************** */var o=function(){return(o=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}).apply(this,arguments)};function n(t){return e(r(t||{}),{arrayFormat:"bracket"})}function a(e,o){var a,i=void 0===o?{method:"get"}:o,u=i.body,c=i.query,f=i.sudo,s=i.method,m=e.headers;return f&&(m.sudo=f),"object"!=typeof u||u instanceof t?a=u:(a=JSON.stringify(r(u)),m["content-type"]="application/json"),{agent:void 0,headers:m,timeout:e.requestTimeout,method:s,searchParams:n(c),prefixUrl:e.url,body:a}}function i(t,r){var e={};return["get","post","put","delete","stream"].forEach((function(n){e[n]=function(e,a,i){var u=t(e,o(o({},i),{method:n}));return r(a,u)}})),e}function u(t,r){var e={};return Object.keys(t).forEach((function(n){e[n]=function(e){return new t[n](o(o({},e),r))}})),e}export{i as createInstance,a as defaultRequest,n as formatQuery,u as modifyServices}; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("form-data"))&&"object"==typeof e&&"default"in e?e.default:e,r=require("xcase"),o=require("query-string"),n=function(){return(n=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},a=["get","post","put","delete","stream"];function u(e){return o.stringify(r.decamelizeKeys(e||{}),{arrayFormat:"bracket"})}exports.createInstance=function(e,t){var r={};return a.forEach((function(o){r[o]=function(r,a,u){var i=e(r,n(n({},u),{method:o}));return t(a,i)}})),r},exports.defaultRequest=function(e,o){var n,a=void 0===o?{method:"get"}:o,i=a.body,s=a.query,c=a.sudo,f=a.method,d=e.headers;return c&&(d.sudo=c),"object"!=typeof i||i instanceof t?n=i:(n=JSON.stringify(r.decamelizeKeys(i)),d["content-type"]="application/json"),{agent:void 0,headers:d,timeout:e.requestTimeout,method:f,searchParams:u(s),prefixUrl:e.url,body:n}},exports.formatQuery=u; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("form-data"))&&"object"==typeof e&&"default"in e?e.default:e,r=require("xcase"),o=require("query-string"),n=function(){return(n=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function a(e){return o.stringify(r.decamelizeKeys(e||{}),{arrayFormat:"bracket"})}exports.createInstance=function(e,t){var r={};return["get","post","put","delete","stream"].forEach((function(o){r[o]=function(r,a,u){var i=e(r,n(n({},u),{method:o}));return t(a,i)}})),r},exports.defaultRequest=function(e,o){var n,u=void 0===o?{method:"get"}:o,i=u.body,s=u.query,c=u.sudo,f=u.method,d=e.headers;return c&&(d.sudo=c),"object"!=typeof i||i instanceof t?n=i:(n=JSON.stringify(r.decamelizeKeys(i)),d["content-type"]="application/json"),{agent:void 0,headers:d,timeout:e.requestTimeout,method:f,searchParams:a(s),prefixUrl:e.url,body:n}},exports.formatQuery=a,exports.modifyServices=function(e,t){var r={};return Object.keys(e).forEach((function(o){r[o]=function(r){return new e[o](n(n({},r),t))}})),r}; |
@@ -21,4 +21,9 @@ import FormData from 'form-data'; | ||
}; | ||
export declare type Constructor<T = {}> = new (...args: any[]) => T; | ||
export declare type DictionaryOfConstructors<T> = { | ||
[K in keyof T]: Constructor<T[K]>; | ||
}; | ||
export declare function formatQuery(options: any): string; | ||
export declare function defaultRequest(service: Service, { body, query, sudo, method }?: DefaultRequestOptions): Record<string, string | number | FormData | Record<string, string | string[]>>; | ||
export declare function createInstance(optionsHandler: any, requestHandler: any): RequesterType; | ||
export declare function modifyServices<T>(services: DictionaryOfConstructors<T>, customConfig: object): DictionaryOfConstructors<T>; |
{ | ||
"name": "@gitbeaker/requester-utils", | ||
"description": "Utility functions for requester implementatons used in @gitbeaker", | ||
"version": "18.2.0", | ||
"version": "19.0.0", | ||
"author": { | ||
@@ -48,3 +48,3 @@ "name": "Justin Dalrymple" | ||
}, | ||
"gitHead": "c4c8f9543981958379444b90a718d5232e349bf6" | ||
"gitHead": "eb13b3498134fd07354bb77b786e176d69fe6463" | ||
} |
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
10143
50