@zthun/webigail-http 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Anthony Bonta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ import e from"axios";var t;!function(e){e.Get="get",e.Put="put",e.Post="post",e.Delete="delete",e.Patch="patch",e.Options="options",e.Head="head"}(t||(t={}));var r,o,n,i=/*#__PURE__*/function(){function e(){this._request=void 0,this.get=this._method.bind(this,t.Get),this.post=this._method.bind(this,t.Post),this.put=this._method.bind(this,t.Put),this.delete=this._method.bind(this,t.Delete),this.patch=this._method.bind(this,t.Patch),this.options=this._method.bind(this,t.Options),this.head=this._method.bind(this,t.Head),this._request={method:t.Get,url:""}}var r=e.prototype;return r._method=function(e,t){return this._request.method=e,this._request.body=t,void 0===this._request.body&&delete this._request.body,this},r.url=function(e){return this._request.url=e,this},r.timeout=function(e){return this._request.timeout=e,this},r.headers=function(e){return this._request.headers=e,this},r.header=function(e,t){return this._request.headers=this._request.headers||{},null==t?delete this._request.headers[e]:this._request.headers[e]=""+t,this},r.copy=function(e){return this._request=JSON.parse(JSON.stringify(e)),this},r.build=function(){return JSON.parse(JSON.stringify(this._request))},e}();!function(e){e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.LengthRequired=411]="LengthRequired",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.URITooLong=414]="URITooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.ImATeapot=418]="ImATeapot",e[e.MisdirectedRequest=421]="MisdirectedRequest",e[e.UnProcessableEntity=422]="UnProcessableEntity",e[e.Locked=423]="Locked",e[e.FailedDependency=424]="FailedDependency",e[e.UpgradeRequired=426]="UpgradeRequired",e[e.PreconditionRequired=428]="PreconditionRequired",e[e.TooManyRequests=429]="TooManyRequests",e[e.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",e[e.UnavailableForLegalReasons=451]="UnavailableForLegalReasons"}(n||(n={}));var s,a,d,u=((r={})[n.BadRequest]="Bad Request",r[n.Unauthorized]="Unauthorized",r[n.PaymentRequired]="Payment Required",r[n.Forbidden]="Forbidden",r[n.NotFound]="Not Found",r[n.MethodNotAllowed]="Method not Allowed",r[n.NotAcceptable]="Not Acceptable",r[n.ProxyAuthenticationRequired]="Proxy Authentication Required",r[n.RequestTimeout]="Request Timeout",r[n.Conflict]="Conflict",r[n.Gone]="Gone",r[n.LengthRequired]="Length Required",r[n.PreconditionFailed]="Precondition Failed",r[n.PayloadTooLarge]="Payload Too Large",r[n.URITooLong]="URI Too Long",r[n.UnsupportedMediaType]="Unsupported Media Type",r[n.RangeNotSatisfiable]="Range Not Satisfiable",r[n.ExpectationFailed]="Expectation Failed",r[n.ImATeapot]="I am a Teapot",r[n.MisdirectedRequest]="Misdirected Requested",r[n.UnProcessableEntity]="Entity Not Processable",r[n.Locked]="Locked",r[n.FailedDependency]="Failed Dependency",r[n.UpgradeRequired]="Upgrade Required",r[n.PreconditionRequired]="Precondition Required",r[n.TooManyRequests]="Too Many Requests",r[n.RequestHeaderFieldsTooLarge]="Request Header Fields Too Large",r[n.UnavailableForLegalReasons]="Unavailable for Legal Reasons",r),h=((o={})[n.BadRequest]="A bad request was sent.",o[n.Unauthorized]="You are not authenticated and cannot view this content.",o[n.PaymentRequired]="Payment is required",o[n.Forbidden]="You are not authorized to view this content.",o[n.NotFound]="The resource you are looking for could not be found.",o[n.MethodNotAllowed]="The requested operation was not allowed.",o[n.NotAcceptable]="The requested resource is not capable of generating the content for you.",o[n.ProxyAuthenticationRequired]="You must first authenticate your self with the proxy.",o[n.RequestTimeout]="The server timed out waiting for a request. Please try again.",o[n.Conflict]="There was a conflict with request. Try something else.",o[n.Gone]="The resource you requested is no longer available.",o[n.LengthRequired]="Your request did not specify the length of its content, which is required by the requested resource.",o[n.PreconditionFailed]="The server did not meet the requirements that was required to meet the request.",o[n.PayloadTooLarge]="The request is too large and the server cannot handle it.",o[n.URITooLong]="The URI provided was too long for the server to process.",o[n.UnsupportedMediaType]="The media type requested is not supported by the server.",o[n.RangeNotSatisfiable]="A portion of the file was requested by the server cannot supply said portion.",o[n.ExpectationFailed]="The server cannot meet the requirements of the expectation made of it.",o[n.ImATeapot]="Short and stout. Here is my handle, here is my spout. When I get all steamed up, hear me shout. Tip me over and pour me out!",o[n.MisdirectedRequest]="The request was directed at the server, but the server cannot produce a response.",o[n.UnProcessableEntity]="The request was well-formed but was unable to be followed due to semantic errors.",o[n.Locked]="The resource that is being accessed is locked.",o[n.FailedDependency]="The request failed because it depended on another request and that request failed.",o[n.UpgradeRequired]="The client needs to switch to a different protocol.",o[n.PreconditionRequired]="The origin server requires the request to be conditional.",o[n.TooManyRequests]="The user has sent too many requests in a given amount of time.",o[n.RequestHeaderFieldsTooLarge]="The request cannot be processed because the collective header fields are too large.",o[n.UnavailableForLegalReasons]="Call your lawyer!",o);!function(e){e[e.Continue=100]="Continue",e[e.SwitchingProtocols=101]="SwitchingProtocols",e[e.Processing=102]="Processing",e[e.EarlyHints=103]="EarlyHints"}(d||(d={}));var c,l,p,f=((s={})[d.Continue]="Continue",s[d.SwitchingProtocols]="Switching Protocols",s[d.Processing]="Processing",s[d.EarlyHints]="Early Hints",s),y=((a={})[d.Continue]="The client should continue to send the request body.",a[d.SwitchingProtocols]="The requestor has asked the server to switch protocols and the server has agreed to do so.",a[d.Processing]="The server has received and is processing the request, but a response is not available yet.",a[d.EarlyHints]="There are some early response headers available for you before the final message.",a);!function(e){e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.Found=302]="Found",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect"}(p||(p={}));var m,q,g,v=((c={})[p.MultipleChoices]="Multiple Choices",c[p.MovedPermanently]="Moved Permanently",c[p.Found]="Found",c[p.SeeOther]="See Other",c[p.NotModified]="Not Modified",c[p.UseProxy]="Use Proxy",c[p.SwitchProxy]="Switch Proxy",c[p.TemporaryRedirect]="Temporary Redirect",c[p.PermanentRedirect]="Permanent Redirect",c),b=((l={})[p.MultipleChoices]="Indicates multiple options for the resource from which the client may choose.",l[p.MovedPermanently]="This and all future requests should be directed to the given URI.",l[p.Found]="Tells the client to look at another url",l[p.SeeOther]="The response to the request can be found under another URI using the GET method.",l[p.NotModified]="Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.",l[p.UseProxy]="The requested resource is available only through a proxy, the address for which is provided in the response.",l[p.SwitchProxy]='No longer used. Originally meant "Subsequent requests should use the specified proxy.',l[p.TemporaryRedirect]="In this case, the request should be repeated with another URI; however, future requests should still use the original URI.",l[p.PermanentRedirect]="The request and all future requests should be repeated using another URI.",l);!function(e){e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HttpVersionNotSupported=505]="HttpVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.LoopDetected=508]="LoopDetected",e[e.NotExtended=510]="NotExtended",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(g||(g={}));var R,T,P,w=((m={})[g.InternalServerError]="Internal Server Error",m[g.NotImplemented]="Not Implemented",m[g.BadGateway]="Bad Gateway",m[g.ServiceUnavailable]="Service Unavailable",m[g.GatewayTimeout]="Gateway Timeout",m[g.HttpVersionNotSupported]="HTTP Version Not Supported",m[g.VariantAlsoNegotiates]="Variant Also Negotiates",m[g.InsufficientStorage]="Insufficient Storage",m[g.LoopDetected]="Loop Detected",m[g.NotExtended]="Not Extended",m[g.NetworkAuthenticationRequired]="Network Authentication Required",m),N=((q={})[g.InternalServerError]="An unexpected condition was encountered on the server.",q[g.NotImplemented]="The server either does not recognize the request method, or it lacks the ability to fulfil the request. Usually this implies future availability (e.g., a new feature of a web-service API).",q[g.BadGateway]=" The server was acting as a gateway or proxy and received an invalid response from the upstream server.",q[g.ServiceUnavailable]="The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.",q[g.GatewayTimeout]="The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.",q[g.HttpVersionNotSupported]="The server does not support the HTTP protocol version used in the request.",q[g.VariantAlsoNegotiates]=" Transparent content negotiation for the request results in a circular reference.",q[g.InsufficientStorage]="The server is unable to store the representation needed to complete the request.",q[g.LoopDetected]="The server detected an infinite loop while processing the request.",q[g.NotExtended]="Further extensions to the request are required for the server to fulfil it.",q[g.NetworkAuthenticationRequired]="The client needs to authenticate to gain network access.",q);!function(e){e[e.OK=200]="OK",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",e[e.NoContent=204]="NoContent",e[e.ResetContent=205]="ResetContent",e[e.PartialContent=206]="PartialContent",e[e.MultiStatus=207]="MultiStatus",e[e.AlreadyReported=208]="AlreadyReported",e[e.IMUsed=226]="IMUsed"}(P||(P={}));var S,I,U=((R={})[P.OK]="OK",R[P.Created]="Created",R[P.Accepted]="Accepted",R[P.NonAuthoritativeInformation]="Non-Authoritative Information",R[P.NoContent]="No Content",R[P.ResetContent]="Reset Content",R[P.PartialContent]="Partial Content",R[P.MultiStatus]="Multi Status",R[P.AlreadyReported]="Already Reported",R[P.IMUsed]="IM Used",R),A=((T={})[P.OK]="The request was successful.",T[P.Created]="The request has been fulfilled, resulting in the creation of a new resource.",T[P.Accepted]="The request has been accepted for processing, but the processing has not been completed.",T[P.NonAuthoritativeInformation]="The server is a transforming proxy that received an OK from its origin,but is returning a modified version of the response.",T[P.NoContent]="The server successfully processed the request and is not returning any content.",T[P.ResetContent]="The server successfully processed the request, but is not returning any content. The document view must be refreshed.",T[P.PartialContent]="he server is delivering only part of the resource due to a range header sent by the client.",T[P.MultiStatus]="The message body that follows is by default an XML message and can contain a number of separate response codes, depending on how many sub-requests were made.",T[P.AlreadyReported]="The members of a DAV binding have already been enumerated in a preceding part of the response, and are not being included again.",T[P.IMUsed]="The server has fulfilled a request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.",T);function M(e){return f[e]||U[e]||v[e]||u[e]||w[e]}function F(e){return y[e]||A[e]||b[e]||h[e]||N[e]}function C(e){return e>=200&&e<300?I.Success:e>=400&&e<500?I.Warning:e>=500?I.Error:I.Info}function x(e){return e>=100&&e<200?S.InformationalResponse:e>=200&&e<300?S.Success:e>=300&&e<400?S.Redirection:e>=400&&e<500?S.Client:S.Server}function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},L.apply(this,arguments)}!function(e){e.InformationalResponse="Informational Response",e.Success="Success",e.Redirection="Redirection",e.Client="Client Error",e.Server="Server Error"}(S||(S={})),function(e){e.Info="info",e.Success="success",e.Warning="warning",e.Error="error"}(I||(I={}));var _=/*#__PURE__*/function(){function e(e){this._result=void 0,this._result={status:P.OK,headers:{},data:e}}var t=e.prototype;return t.data=function(e){return this._result.data=e,this},t.status=function(e){return this._result.status=e,this},t.headers=function(e){return this._result.headers=e,this},t.build=function(){return L({},this._result)},e}(),E=/*#__PURE__*/function(){function t(){}return t.prototype.request=function(t){try{return Promise.resolve(function(r,o){try{var n=Promise.resolve(e({url:t.url,method:t.method,data:t.body,timeout:t.timeout,headers:t.headers})).then(function(e){return new _(e.data).headers(e.headers).status(e.status).build()})}catch(e){return o(e)}return n&&n.then?n.then(void 0,o):n}(0,function(e){var t=e,r=new _(null).headers({});return r=t.response?r.headers(t.response.headers).status(t.response.status).data(t.response.data):t.request?r.status(g.ServiceUnavailable).data("The target endpoint could not be reached. You may need to try again later."):r.status(g.InternalServerError).data(t.message||"An unexpected error occurred."),Promise.reject(r.build())}))}catch(e){return Promise.reject(e)}},t}(),O=/*#__PURE__*/function(){function e(){this._mapping={}}var t=e.prototype;return t.set=function(e,t,r){this._mapping[e]=this._mapping[e]||{},this._mapping[e][t]="function"==typeof r?r:function(){return r}},t.request=function(e){try{var t=this._mapping[e.url],r=null==t?void 0:t[e.method];if(null==r){var o=new _(null).status(n.NotFound).build();return Promise.reject(o)}return Promise.resolve(r(e)).then(function(e){return+e.status<400?Promise.resolve(e):Promise.reject(e)})}catch(e){return Promise.reject(e)}},e}();export{S as ZHttpCodeCategory,n as ZHttpCodeClient,h as ZHttpCodeClientDescriptions,u as ZHttpCodeClientNames,d as ZHttpCodeInformationalResponse,y as ZHttpCodeInformationalResponseDescriptions,f as ZHttpCodeInformationalResponseNames,p as ZHttpCodeRedirection,b as ZHttpCodeRedirectionDescriptions,v as ZHttpCodeRedirectionNames,g as ZHttpCodeServer,N as ZHttpCodeServerDescriptions,w as ZHttpCodeServerNames,I as ZHttpCodeSeverity,P as ZHttpCodeSuccess,A as ZHttpCodeSuccessDescriptions,U as ZHttpCodeSuccessNames,t as ZHttpMethod,i as ZHttpRequestBuilder,_ as ZHttpResultBuilder,E as ZHttpService,O as ZHttpServiceMock,x as getHttpCodeCategory,F as getHttpCodeDescription,M as getHttpCodeName,C as getHttpCodeSeverity};
@@ -0,0 +1 @@
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,o=/*#__PURE__*/e(require("axios"));exports.ZHttpMethod=void 0,(t=exports.ZHttpMethod||(exports.ZHttpMethod={})).Get="get",t.Put="put",t.Post="post",t.Delete="delete",t.Patch="patch",t.Options="options",t.Head="head";var r,s,n,i=/*#__PURE__*/function(){function e(){this._request=void 0,this.get=this._method.bind(this,exports.ZHttpMethod.Get),this.post=this._method.bind(this,exports.ZHttpMethod.Post),this.put=this._method.bind(this,exports.ZHttpMethod.Put),this.delete=this._method.bind(this,exports.ZHttpMethod.Delete),this.patch=this._method.bind(this,exports.ZHttpMethod.Patch),this.options=this._method.bind(this,exports.ZHttpMethod.Options),this.head=this._method.bind(this,exports.ZHttpMethod.Head),this._request={method:exports.ZHttpMethod.Get,url:""}}var t=e.prototype;return t._method=function(e,t){return this._request.method=e,this._request.body=t,void 0===this._request.body&&delete this._request.body,this},t.url=function(e){return this._request.url=e,this},t.timeout=function(e){return this._request.timeout=e,this},t.headers=function(e){return this._request.headers=e,this},t.header=function(e,t){return this._request.headers=this._request.headers||{},null==t?delete this._request.headers[e]:this._request.headers[e]=""+t,this},t.copy=function(e){return this._request=JSON.parse(JSON.stringify(e)),this},t.build=function(){return JSON.parse(JSON.stringify(this._request))},e}();exports.ZHttpCodeClient=void 0,(n=exports.ZHttpCodeClient||(exports.ZHttpCodeClient={}))[n.BadRequest=400]="BadRequest",n[n.Unauthorized=401]="Unauthorized",n[n.PaymentRequired=402]="PaymentRequired",n[n.Forbidden=403]="Forbidden",n[n.NotFound=404]="NotFound",n[n.MethodNotAllowed=405]="MethodNotAllowed",n[n.NotAcceptable=406]="NotAcceptable",n[n.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",n[n.RequestTimeout=408]="RequestTimeout",n[n.Conflict=409]="Conflict",n[n.Gone=410]="Gone",n[n.LengthRequired=411]="LengthRequired",n[n.PreconditionFailed=412]="PreconditionFailed",n[n.PayloadTooLarge=413]="PayloadTooLarge",n[n.URITooLong=414]="URITooLong",n[n.UnsupportedMediaType=415]="UnsupportedMediaType",n[n.RangeNotSatisfiable=416]="RangeNotSatisfiable",n[n.ExpectationFailed=417]="ExpectationFailed",n[n.ImATeapot=418]="ImATeapot",n[n.MisdirectedRequest=421]="MisdirectedRequest",n[n.UnProcessableEntity=422]="UnProcessableEntity",n[n.Locked=423]="Locked",n[n.FailedDependency=424]="FailedDependency",n[n.UpgradeRequired=426]="UpgradeRequired",n[n.PreconditionRequired=428]="PreconditionRequired",n[n.TooManyRequests=429]="TooManyRequests",n[n.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",n[n.UnavailableForLegalReasons=451]="UnavailableForLegalReasons";var d,a,p,u=((r={})[exports.ZHttpCodeClient.BadRequest]="Bad Request",r[exports.ZHttpCodeClient.Unauthorized]="Unauthorized",r[exports.ZHttpCodeClient.PaymentRequired]="Payment Required",r[exports.ZHttpCodeClient.Forbidden]="Forbidden",r[exports.ZHttpCodeClient.NotFound]="Not Found",r[exports.ZHttpCodeClient.MethodNotAllowed]="Method not Allowed",r[exports.ZHttpCodeClient.NotAcceptable]="Not Acceptable",r[exports.ZHttpCodeClient.ProxyAuthenticationRequired]="Proxy Authentication Required",r[exports.ZHttpCodeClient.RequestTimeout]="Request Timeout",r[exports.ZHttpCodeClient.Conflict]="Conflict",r[exports.ZHttpCodeClient.Gone]="Gone",r[exports.ZHttpCodeClient.LengthRequired]="Length Required",r[exports.ZHttpCodeClient.PreconditionFailed]="Precondition Failed",r[exports.ZHttpCodeClient.PayloadTooLarge]="Payload Too Large",r[exports.ZHttpCodeClient.URITooLong]="URI Too Long",r[exports.ZHttpCodeClient.UnsupportedMediaType]="Unsupported Media Type",r[exports.ZHttpCodeClient.RangeNotSatisfiable]="Range Not Satisfiable",r[exports.ZHttpCodeClient.ExpectationFailed]="Expectation Failed",r[exports.ZHttpCodeClient.ImATeapot]="I am a Teapot",r[exports.ZHttpCodeClient.MisdirectedRequest]="Misdirected Requested",r[exports.ZHttpCodeClient.UnProcessableEntity]="Entity Not Processable",r[exports.ZHttpCodeClient.Locked]="Locked",r[exports.ZHttpCodeClient.FailedDependency]="Failed Dependency",r[exports.ZHttpCodeClient.UpgradeRequired]="Upgrade Required",r[exports.ZHttpCodeClient.PreconditionRequired]="Precondition Required",r[exports.ZHttpCodeClient.TooManyRequests]="Too Many Requests",r[exports.ZHttpCodeClient.RequestHeaderFieldsTooLarge]="Request Header Fields Too Large",r[exports.ZHttpCodeClient.UnavailableForLegalReasons]="Unavailable for Legal Reasons",r),c=((s={})[exports.ZHttpCodeClient.BadRequest]="A bad request was sent.",s[exports.ZHttpCodeClient.Unauthorized]="You are not authenticated and cannot view this content.",s[exports.ZHttpCodeClient.PaymentRequired]="Payment is required",s[exports.ZHttpCodeClient.Forbidden]="You are not authorized to view this content.",s[exports.ZHttpCodeClient.NotFound]="The resource you are looking for could not be found.",s[exports.ZHttpCodeClient.MethodNotAllowed]="The requested operation was not allowed.",s[exports.ZHttpCodeClient.NotAcceptable]="The requested resource is not capable of generating the content for you.",s[exports.ZHttpCodeClient.ProxyAuthenticationRequired]="You must first authenticate your self with the proxy.",s[exports.ZHttpCodeClient.RequestTimeout]="The server timed out waiting for a request. Please try again.",s[exports.ZHttpCodeClient.Conflict]="There was a conflict with request. Try something else.",s[exports.ZHttpCodeClient.Gone]="The resource you requested is no longer available.",s[exports.ZHttpCodeClient.LengthRequired]="Your request did not specify the length of its content, which is required by the requested resource.",s[exports.ZHttpCodeClient.PreconditionFailed]="The server did not meet the requirements that was required to meet the request.",s[exports.ZHttpCodeClient.PayloadTooLarge]="The request is too large and the server cannot handle it.",s[exports.ZHttpCodeClient.URITooLong]="The URI provided was too long for the server to process.",s[exports.ZHttpCodeClient.UnsupportedMediaType]="The media type requested is not supported by the server.",s[exports.ZHttpCodeClient.RangeNotSatisfiable]="A portion of the file was requested by the server cannot supply said portion.",s[exports.ZHttpCodeClient.ExpectationFailed]="The server cannot meet the requirements of the expectation made of it.",s[exports.ZHttpCodeClient.ImATeapot]="Short and stout. Here is my handle, here is my spout. When I get all steamed up, hear me shout. Tip me over and pour me out!",s[exports.ZHttpCodeClient.MisdirectedRequest]="The request was directed at the server, but the server cannot produce a response.",s[exports.ZHttpCodeClient.UnProcessableEntity]="The request was well-formed but was unable to be followed due to semantic errors.",s[exports.ZHttpCodeClient.Locked]="The resource that is being accessed is locked.",s[exports.ZHttpCodeClient.FailedDependency]="The request failed because it depended on another request and that request failed.",s[exports.ZHttpCodeClient.UpgradeRequired]="The client needs to switch to a different protocol.",s[exports.ZHttpCodeClient.PreconditionRequired]="The origin server requires the request to be conditional.",s[exports.ZHttpCodeClient.TooManyRequests]="The user has sent too many requests in a given amount of time.",s[exports.ZHttpCodeClient.RequestHeaderFieldsTooLarge]="The request cannot be processed because the collective header fields are too large.",s[exports.ZHttpCodeClient.UnavailableForLegalReasons]="Call your lawyer!",s);exports.ZHttpCodeInformationalResponse=void 0,(p=exports.ZHttpCodeInformationalResponse||(exports.ZHttpCodeInformationalResponse={}))[p.Continue=100]="Continue",p[p.SwitchingProtocols=101]="SwitchingProtocols",p[p.Processing=102]="Processing",p[p.EarlyHints=103]="EarlyHints";var l,h,C,x=((d={})[exports.ZHttpCodeInformationalResponse.Continue]="Continue",d[exports.ZHttpCodeInformationalResponse.SwitchingProtocols]="Switching Protocols",d[exports.ZHttpCodeInformationalResponse.Processing]="Processing",d[exports.ZHttpCodeInformationalResponse.EarlyHints]="Early Hints",d),H=((a={})[exports.ZHttpCodeInformationalResponse.Continue]="The client should continue to send the request body.",a[exports.ZHttpCodeInformationalResponse.SwitchingProtocols]="The requestor has asked the server to switch protocols and the server has agreed to do so.",a[exports.ZHttpCodeInformationalResponse.Processing]="The server has received and is processing the request, but a response is not available yet.",a[exports.ZHttpCodeInformationalResponse.EarlyHints]="There are some early response headers available for you before the final message.",a);exports.ZHttpCodeRedirection=void 0,(C=exports.ZHttpCodeRedirection||(exports.ZHttpCodeRedirection={}))[C.MultipleChoices=300]="MultipleChoices",C[C.MovedPermanently=301]="MovedPermanently",C[C.Found=302]="Found",C[C.SeeOther=303]="SeeOther",C[C.NotModified=304]="NotModified",C[C.UseProxy=305]="UseProxy",C[C.SwitchProxy=306]="SwitchProxy",C[C.TemporaryRedirect=307]="TemporaryRedirect",C[C.PermanentRedirect=308]="PermanentRedirect";var Z,f,v,y=((l={})[exports.ZHttpCodeRedirection.MultipleChoices]="Multiple Choices",l[exports.ZHttpCodeRedirection.MovedPermanently]="Moved Permanently",l[exports.ZHttpCodeRedirection.Found]="Found",l[exports.ZHttpCodeRedirection.SeeOther]="See Other",l[exports.ZHttpCodeRedirection.NotModified]="Not Modified",l[exports.ZHttpCodeRedirection.UseProxy]="Use Proxy",l[exports.ZHttpCodeRedirection.SwitchProxy]="Switch Proxy",l[exports.ZHttpCodeRedirection.TemporaryRedirect]="Temporary Redirect",l[exports.ZHttpCodeRedirection.PermanentRedirect]="Permanent Redirect",l),m=((h={})[exports.ZHttpCodeRedirection.MultipleChoices]="Indicates multiple options for the resource from which the client may choose.",h[exports.ZHttpCodeRedirection.MovedPermanently]="This and all future requests should be directed to the given URI.",h[exports.ZHttpCodeRedirection.Found]="Tells the client to look at another url",h[exports.ZHttpCodeRedirection.SeeOther]="The response to the request can be found under another URI using the GET method.",h[exports.ZHttpCodeRedirection.NotModified]="Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.",h[exports.ZHttpCodeRedirection.UseProxy]="The requested resource is available only through a proxy, the address for which is provided in the response.",h[exports.ZHttpCodeRedirection.SwitchProxy]='No longer used. Originally meant "Subsequent requests should use the specified proxy.',h[exports.ZHttpCodeRedirection.TemporaryRedirect]="In this case, the request should be repeated with another URI; however, future requests should still use the original URI.",h[exports.ZHttpCodeRedirection.PermanentRedirect]="The request and all future requests should be repeated using another URI.",h);exports.ZHttpCodeServer=void 0,(v=exports.ZHttpCodeServer||(exports.ZHttpCodeServer={}))[v.InternalServerError=500]="InternalServerError",v[v.NotImplemented=501]="NotImplemented",v[v.BadGateway=502]="BadGateway",v[v.ServiceUnavailable=503]="ServiceUnavailable",v[v.GatewayTimeout=504]="GatewayTimeout",v[v.HttpVersionNotSupported=505]="HttpVersionNotSupported",v[v.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",v[v.InsufficientStorage=507]="InsufficientStorage",v[v.LoopDetected=508]="LoopDetected",v[v.NotExtended=510]="NotExtended",v[v.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired";var R,g,q,S=((Z={})[exports.ZHttpCodeServer.InternalServerError]="Internal Server Error",Z[exports.ZHttpCodeServer.NotImplemented]="Not Implemented",Z[exports.ZHttpCodeServer.BadGateway]="Bad Gateway",Z[exports.ZHttpCodeServer.ServiceUnavailable]="Service Unavailable",Z[exports.ZHttpCodeServer.GatewayTimeout]="Gateway Timeout",Z[exports.ZHttpCodeServer.HttpVersionNotSupported]="HTTP Version Not Supported",Z[exports.ZHttpCodeServer.VariantAlsoNegotiates]="Variant Also Negotiates",Z[exports.ZHttpCodeServer.InsufficientStorage]="Insufficient Storage",Z[exports.ZHttpCodeServer.LoopDetected]="Loop Detected",Z[exports.ZHttpCodeServer.NotExtended]="Not Extended",Z[exports.ZHttpCodeServer.NetworkAuthenticationRequired]="Network Authentication Required",Z),b=((f={})[exports.ZHttpCodeServer.InternalServerError]="An unexpected condition was encountered on the server.",f[exports.ZHttpCodeServer.NotImplemented]="The server either does not recognize the request method, or it lacks the ability to fulfil the request. Usually this implies future availability (e.g., a new feature of a web-service API).",f[exports.ZHttpCodeServer.BadGateway]=" The server was acting as a gateway or proxy and received an invalid response from the upstream server.",f[exports.ZHttpCodeServer.ServiceUnavailable]="The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.",f[exports.ZHttpCodeServer.GatewayTimeout]="The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.",f[exports.ZHttpCodeServer.HttpVersionNotSupported]="The server does not support the HTTP protocol version used in the request.",f[exports.ZHttpCodeServer.VariantAlsoNegotiates]=" Transparent content negotiation for the request results in a circular reference.",f[exports.ZHttpCodeServer.InsufficientStorage]="The server is unable to store the representation needed to complete the request.",f[exports.ZHttpCodeServer.LoopDetected]="The server detected an infinite loop while processing the request.",f[exports.ZHttpCodeServer.NotExtended]="Further extensions to the request are required for the server to fulfil it.",f[exports.ZHttpCodeServer.NetworkAuthenticationRequired]="The client needs to authenticate to gain network access.",f);exports.ZHttpCodeSuccess=void 0,(q=exports.ZHttpCodeSuccess||(exports.ZHttpCodeSuccess={}))[q.OK=200]="OK",q[q.Created=201]="Created",q[q.Accepted=202]="Accepted",q[q.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",q[q.NoContent=204]="NoContent",q[q.ResetContent=205]="ResetContent",q[q.PartialContent=206]="PartialContent",q[q.MultiStatus=207]="MultiStatus",q[q.AlreadyReported=208]="AlreadyReported",q[q.IMUsed=226]="IMUsed";var T,P,w=((R={})[exports.ZHttpCodeSuccess.OK]="OK",R[exports.ZHttpCodeSuccess.Created]="Created",R[exports.ZHttpCodeSuccess.Accepted]="Accepted",R[exports.ZHttpCodeSuccess.NonAuthoritativeInformation]="Non-Authoritative Information",R[exports.ZHttpCodeSuccess.NoContent]="No Content",R[exports.ZHttpCodeSuccess.ResetContent]="Reset Content",R[exports.ZHttpCodeSuccess.PartialContent]="Partial Content",R[exports.ZHttpCodeSuccess.MultiStatus]="Multi Status",R[exports.ZHttpCodeSuccess.AlreadyReported]="Already Reported",R[exports.ZHttpCodeSuccess.IMUsed]="IM Used",R),N=((g={})[exports.ZHttpCodeSuccess.OK]="The request was successful.",g[exports.ZHttpCodeSuccess.Created]="The request has been fulfilled, resulting in the creation of a new resource.",g[exports.ZHttpCodeSuccess.Accepted]="The request has been accepted for processing, but the processing has not been completed.",g[exports.ZHttpCodeSuccess.NonAuthoritativeInformation]="The server is a transforming proxy that received an OK from its origin,but is returning a modified version of the response.",g[exports.ZHttpCodeSuccess.NoContent]="The server successfully processed the request and is not returning any content.",g[exports.ZHttpCodeSuccess.ResetContent]="The server successfully processed the request, but is not returning any content. The document view must be refreshed.",g[exports.ZHttpCodeSuccess.PartialContent]="he server is delivering only part of the resource due to a range header sent by the client.",g[exports.ZHttpCodeSuccess.MultiStatus]="The message body that follows is by default an XML message and can contain a number of separate response codes, depending on how many sub-requests were made.",g[exports.ZHttpCodeSuccess.AlreadyReported]="The members of a DAV binding have already been enumerated in a preceding part of the response, and are not being included again.",g[exports.ZHttpCodeSuccess.IMUsed]="The server has fulfilled a request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.",g);function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},I.apply(this,arguments)}exports.ZHttpCodeCategory=void 0,(T=exports.ZHttpCodeCategory||(exports.ZHttpCodeCategory={})).InformationalResponse="Informational Response",T.Success="Success",T.Redirection="Redirection",T.Client="Client Error",T.Server="Server Error",exports.ZHttpCodeSeverity=void 0,(P=exports.ZHttpCodeSeverity||(exports.ZHttpCodeSeverity={})).Info="info",P.Success="success",P.Warning="warning",P.Error="error";var M=/*#__PURE__*/function(){function e(e){this._result=void 0,this._result={status:exports.ZHttpCodeSuccess.OK,headers:{},data:e}}var t=e.prototype;return t.data=function(e){return this._result.data=e,this},t.status=function(e){return this._result.status=e,this},t.headers=function(e){return this._result.headers=e,this},t.build=function(){return I({},this._result)},e}(),U=/*#__PURE__*/function(){function e(){}return e.prototype.request=function(e){try{return Promise.resolve(function(t,r){try{var s=Promise.resolve(o.default({url:e.url,method:e.method,data:e.body,timeout:e.timeout,headers:e.headers})).then(function(e){return new M(e.data).headers(e.headers).status(e.status).build()})}catch(e){return r(e)}return s&&s.then?s.then(void 0,r):s}(0,function(e){var t=e,o=new M(null).headers({});return o=t.response?o.headers(t.response.headers).status(t.response.status).data(t.response.data):t.request?o.status(exports.ZHttpCodeServer.ServiceUnavailable).data("The target endpoint could not be reached. You may need to try again later."):o.status(exports.ZHttpCodeServer.InternalServerError).data(t.message||"An unexpected error occurred."),Promise.reject(o.build())}))}catch(e){return Promise.reject(e)}},e}(),A=/*#__PURE__*/function(){function e(){this._mapping={}}var t=e.prototype;return t.set=function(e,t,o){this._mapping[e]=this._mapping[e]||{},this._mapping[e][t]="function"==typeof o?o:function(){return o}},t.request=function(e){try{var t=this._mapping[e.url],o=null==t?void 0:t[e.method];if(null==o){var r=new M(null).status(exports.ZHttpCodeClient.NotFound).build();return Promise.reject(r)}return Promise.resolve(o(e)).then(function(e){return+e.status<400?Promise.resolve(e):Promise.reject(e)})}catch(e){return Promise.reject(e)}},e}();exports.ZHttpCodeClientDescriptions=c,exports.ZHttpCodeClientNames=u,exports.ZHttpCodeInformationalResponseDescriptions=H,exports.ZHttpCodeInformationalResponseNames=x,exports.ZHttpCodeRedirectionDescriptions=m,exports.ZHttpCodeRedirectionNames=y,exports.ZHttpCodeServerDescriptions=b,exports.ZHttpCodeServerNames=S,exports.ZHttpCodeSuccessDescriptions=N,exports.ZHttpCodeSuccessNames=w,exports.ZHttpRequestBuilder=i,exports.ZHttpResultBuilder=M,exports.ZHttpService=U,exports.ZHttpServiceMock=A,exports.getHttpCodeCategory=function(e){return e>=100&&e<200?exports.ZHttpCodeCategory.InformationalResponse:e>=200&&e<300?exports.ZHttpCodeCategory.Success:e>=300&&e<400?exports.ZHttpCodeCategory.Redirection:e>=400&&e<500?exports.ZHttpCodeCategory.Client:exports.ZHttpCodeCategory.Server},exports.getHttpCodeDescription=function(e){return H[e]||N[e]||m[e]||c[e]||b[e]},exports.getHttpCodeName=function(e){return x[e]||w[e]||y[e]||u[e]||S[e]},exports.getHttpCodeSeverity=function(e){return e>=200&&e<300?exports.ZHttpCodeSeverity.Success:e>=400&&e<500?exports.ZHttpCodeSeverity.Warning:e>=500?exports.ZHttpCodeSeverity.Error:exports.ZHttpCodeSeverity.Info};
@@ -0,0 +1,10 @@
1
+ export * from './request/http-request';
2
+ export * from './result/http-code';
3
+ export * from './result/http-code-client';
4
+ export * from './result/http-code-informational-response';
5
+ export * from './result/http-code-redirection';
6
+ export * from './result/http-code-server';
7
+ export * from './result/http-code-success';
8
+ export * from './result/http-result';
9
+ export * from './service/http-service';
10
+ export * from './service/http-service-mock';
@@ -0,0 +1,34 @@
1
+ export declare enum ZHttpMethod {
2
+ Get = "get",
3
+ Put = "put",
4
+ Post = "post",
5
+ Delete = "delete",
6
+ Patch = "patch",
7
+ Options = "options",
8
+ Head = "head"
9
+ }
10
+ export interface IZHttpRequest<TBody = any> {
11
+ method: ZHttpMethod;
12
+ url: string;
13
+ body?: TBody;
14
+ headers?: Record<string, string>;
15
+ timeout?: number;
16
+ }
17
+ export declare class ZHttpRequestBuilder<TBody = any> {
18
+ private _request;
19
+ constructor();
20
+ private _method;
21
+ get: () => this;
22
+ post: (body?: TBody) => this;
23
+ put: (body?: TBody) => this;
24
+ delete: () => this;
25
+ patch: (body?: TBody) => this;
26
+ options: () => this;
27
+ head: () => this;
28
+ url(url: string): this;
29
+ timeout(ms: number): this;
30
+ headers(headers: Record<string, string>): this;
31
+ header(key: string, value: string | number | boolean | null): this;
32
+ copy(other: IZHttpRequest): this;
33
+ build(): IZHttpRequest;
34
+ }
@@ -0,0 +1,32 @@
1
+ export declare enum ZHttpCodeClient {
2
+ BadRequest = 400,
3
+ Unauthorized = 401,
4
+ PaymentRequired = 402,
5
+ Forbidden = 403,
6
+ NotFound = 404,
7
+ MethodNotAllowed = 405,
8
+ NotAcceptable = 406,
9
+ ProxyAuthenticationRequired = 407,
10
+ RequestTimeout = 408,
11
+ Conflict = 409,
12
+ Gone = 410,
13
+ LengthRequired = 411,
14
+ PreconditionFailed = 412,
15
+ PayloadTooLarge = 413,
16
+ URITooLong = 414,
17
+ UnsupportedMediaType = 415,
18
+ RangeNotSatisfiable = 416,
19
+ ExpectationFailed = 417,
20
+ ImATeapot = 418,
21
+ MisdirectedRequest = 421,
22
+ UnProcessableEntity = 422,
23
+ Locked = 423,
24
+ FailedDependency = 424,
25
+ UpgradeRequired = 426,
26
+ PreconditionRequired = 428,
27
+ TooManyRequests = 429,
28
+ RequestHeaderFieldsTooLarge = 431,
29
+ UnavailableForLegalReasons = 451
30
+ }
31
+ export declare const ZHttpCodeClientNames: Record<ZHttpCodeClient, string>;
32
+ export declare const ZHttpCodeClientDescriptions: Record<ZHttpCodeClient, string>;
@@ -0,0 +1,8 @@
1
+ export declare enum ZHttpCodeInformationalResponse {
2
+ Continue = 100,
3
+ SwitchingProtocols = 101,
4
+ Processing = 102,
5
+ EarlyHints = 103
6
+ }
7
+ export declare const ZHttpCodeInformationalResponseNames: Record<ZHttpCodeInformationalResponse, string>;
8
+ export declare const ZHttpCodeInformationalResponseDescriptions: Record<ZHttpCodeInformationalResponse, string>;
@@ -0,0 +1,13 @@
1
+ export declare enum ZHttpCodeRedirection {
2
+ MultipleChoices = 300,
3
+ MovedPermanently = 301,
4
+ Found = 302,
5
+ SeeOther = 303,
6
+ NotModified = 304,
7
+ UseProxy = 305,
8
+ SwitchProxy = 306,
9
+ TemporaryRedirect = 307,
10
+ PermanentRedirect = 308
11
+ }
12
+ export declare const ZHttpCodeRedirectionNames: Record<ZHttpCodeRedirection, string>;
13
+ export declare const ZHttpCodeRedirectionDescriptions: Record<ZHttpCodeRedirection, string>;
@@ -0,0 +1,15 @@
1
+ export declare enum ZHttpCodeServer {
2
+ InternalServerError = 500,
3
+ NotImplemented = 501,
4
+ BadGateway = 502,
5
+ ServiceUnavailable = 503,
6
+ GatewayTimeout = 504,
7
+ HttpVersionNotSupported = 505,
8
+ VariantAlsoNegotiates = 506,
9
+ InsufficientStorage = 507,
10
+ LoopDetected = 508,
11
+ NotExtended = 510,
12
+ NetworkAuthenticationRequired = 511
13
+ }
14
+ export declare const ZHttpCodeServerNames: Record<ZHttpCodeServer, string>;
15
+ export declare const ZHttpCodeServerDescriptions: Record<ZHttpCodeServer, string>;
@@ -0,0 +1,14 @@
1
+ export declare enum ZHttpCodeSuccess {
2
+ OK = 200,
3
+ Created = 201,
4
+ Accepted = 202,
5
+ NonAuthoritativeInformation = 203,
6
+ NoContent = 204,
7
+ ResetContent = 205,
8
+ PartialContent = 206,
9
+ MultiStatus = 207,
10
+ AlreadyReported = 208,
11
+ IMUsed = 226
12
+ }
13
+ export declare const ZHttpCodeSuccessNames: Record<ZHttpCodeSuccess, string>;
14
+ export declare const ZHttpCodeSuccessDescriptions: Record<ZHttpCodeSuccess, string>;
@@ -0,0 +1,23 @@
1
+ import { ZHttpCodeClient } from './http-code-client';
2
+ import { ZHttpCodeInformationalResponse } from './http-code-informational-response';
3
+ import { ZHttpCodeRedirection } from './http-code-redirection';
4
+ import { ZHttpCodeServer } from './http-code-server';
5
+ import { ZHttpCodeSuccess } from './http-code-success';
6
+ export type ZHttpCode = ZHttpCodeInformationalResponse | ZHttpCodeSuccess | ZHttpCodeRedirection | ZHttpCodeClient | ZHttpCodeServer;
7
+ export declare enum ZHttpCodeCategory {
8
+ InformationalResponse = "Informational Response",
9
+ Success = "Success",
10
+ Redirection = "Redirection",
11
+ Client = "Client Error",
12
+ Server = "Server Error"
13
+ }
14
+ export declare enum ZHttpCodeSeverity {
15
+ Info = "info",
16
+ Success = "success",
17
+ Warning = "warning",
18
+ Error = "error"
19
+ }
20
+ export declare function getHttpCodeName(code: ZHttpCode): string;
21
+ export declare function getHttpCodeDescription(code: ZHttpCode): any;
22
+ export declare function getHttpCodeSeverity(code: ZHttpCode): ZHttpCodeSeverity;
23
+ export declare function getHttpCodeCategory(code: ZHttpCode): ZHttpCodeCategory;
@@ -0,0 +1,14 @@
1
+ import { ZHttpCode } from './http-code';
2
+ export interface IZHttpResult<TResult = any> {
3
+ status: ZHttpCode;
4
+ headers: Record<string, any>;
5
+ data: TResult;
6
+ }
7
+ export declare class ZHttpResultBuilder<TData = any> {
8
+ private _result;
9
+ constructor(data: TData);
10
+ data(data: TData): this;
11
+ status(code: ZHttpCode): this;
12
+ headers(headers: Record<string, any>): this;
13
+ build(): IZHttpResult;
14
+ }
@@ -0,0 +1,8 @@
1
+ import { IZHttpRequest, ZHttpMethod } from '../request/http-request';
2
+ import { IZHttpResult } from '../result/http-result';
3
+ import { IZHttpService } from './http-service';
4
+ export declare class ZHttpServiceMock implements IZHttpService {
5
+ private _mapping;
6
+ set<TResult = any>(endpoint: string, verb: ZHttpMethod, invoke: IZHttpResult<TResult> | ((req: IZHttpRequest) => IZHttpResult<TResult> | Promise<IZHttpResult<TResult>>)): void;
7
+ request<TResult = any, TBody = any>(req: IZHttpRequest<TBody>): Promise<IZHttpResult<TResult>>;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { IZHttpRequest } from '../request/http-request';
2
+ import { IZHttpResult } from '../result/http-result';
3
+ export interface IZHttpService {
4
+ request<TResult = any, TBody = any>(req: IZHttpRequest<TBody>): Promise<IZHttpResult<TResult>>;
5
+ }
6
+ export declare class ZHttpService implements IZHttpService {
7
+ request<TResult = any, TBody = any>(req: IZHttpRequest<TBody>): Promise<IZHttpResult<TResult>>;
8
+ }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@zthun/webigail-http",
3
+ "version": "0.1.0",
4
+ "description": "Http service implementation with an equivalent mock for testing.",
5
+ "author": "Anthony Bonta",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/zthun/webigail",
10
+ "directory": "packages/webigail-http"
11
+ },
12
+ "main": "./dist/lib/index.js",
13
+ "module": "./dist/lib/index.esm.js",
14
+ "types": "./dist/types/index.d.ts",
15
+ "scripts": {
16
+ "build": "microbundle --format esm,cjs --tsconfig tsconfig.prod.json --no-sourcemap"
17
+ },
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "devDependencies": {
22
+ "microbundle": "^0.15.1",
23
+ "vite": "^4.1.4",
24
+ "vitest": "^0.29.1"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "sideEffects": false,
30
+ "dependencies": {
31
+ "axios": "^1.3.4"
32
+ },
33
+ "gitHead": "2477b018fe1ff07769d61264457b4c9198e642e6"
34
+ }