@thisisagile/easy
Advanced tools
Comparing version 1.12.8 to 1.12.9
@@ -13,5 +13,5 @@ "use strict"; | ||
const toResult = (uri, verb, error) => utils_1.choose(error) | ||
.case(e => types_1.isDefined(e.response), e => types_1.result(e.response.statusText, verb.code, uri.toString())) | ||
.case(e => types_1.isDefined(e.request), e => types_1.result(e.request.statusText, verb.code, uri.toString())) | ||
.else(e => types_1.result(e.message, verb.code, uri.toString())); | ||
.case(e => types_1.isDefined(e.response), e => types_1.result(e.response.statusText, verb.toString(), uri.toString())) | ||
.case(e => types_1.isDefined(e.request), e => types_1.result(e.request.statusText, verb.toString(), uri.toString())) | ||
.else(e => types_1.result(e.message, verb.toString(), uri.toString())); | ||
class AxiosProvider { | ||
@@ -21,3 +21,3 @@ constructor() { | ||
url: uri.toString(), | ||
method: verb.code, | ||
method: verb.toString(), | ||
headers: options.headers, | ||
@@ -24,0 +24,0 @@ data: body |
@@ -8,2 +8,3 @@ import { Enum } from '../types'; | ||
static Delete: HttpVerb; | ||
constructor(name: string); | ||
} |
@@ -6,9 +6,10 @@ "use strict"; | ||
class HttpVerb extends types_1.Enum { | ||
constructor(name) { super(name, name.toLowerCase(), name.toUpperCase()); } | ||
} | ||
exports.HttpVerb = HttpVerb; | ||
HttpVerb.Get = new HttpVerb("Get", "GET", "get"); | ||
HttpVerb.Put = new HttpVerb("Put", "PUT", "put"); | ||
HttpVerb.Patch = new HttpVerb("Patch", "PATCH", "patch"); | ||
HttpVerb.Post = new HttpVerb("Post", "POST", "post"); | ||
HttpVerb.Delete = new HttpVerb("Delete", "DELETE", "delete"); | ||
HttpVerb.Get = new HttpVerb('Get'); | ||
HttpVerb.Put = new HttpVerb('Put'); | ||
HttpVerb.Patch = new HttpVerb('Patch'); | ||
HttpVerb.Post = new HttpVerb('Post'); | ||
HttpVerb.Delete = new HttpVerb('Delete'); | ||
//# sourceMappingURL=HttpVerb.js.map |
{ | ||
"name": "@thisisagile/easy", | ||
"version": "1.12.8", | ||
"version": "1.12.9", | ||
"description": "Straightforward library for building domain-driven microservice architectures", | ||
@@ -5,0 +5,0 @@ "author": "Sander Hoogendoorn", |
@@ -12,5 +12,5 @@ import axios, { AxiosError, Method } from 'axios'; | ||
choose<Result, AxiosError>(error) | ||
.case(e => isDefined(e.response), e => result(e.response.statusText, verb.code, uri.toString())) | ||
.case(e => isDefined(e.request), e => result(e.request.statusText, verb.code, uri.toString())) | ||
.else(e => result(e.message, verb.code, uri.toString())); | ||
.case(e => isDefined(e.response), e => result(e.response.statusText, verb.toString(), uri.toString())) | ||
.case(e => isDefined(e.request), e => result(e.request.statusText, verb.toString(), uri.toString())) | ||
.else(e => result(e.message, verb.toString(), uri.toString())); | ||
@@ -21,3 +21,3 @@ export class AxiosProvider implements RequestProvider { | ||
url: uri.toString(), | ||
method: verb.code as Method, | ||
method: verb.toString() as Method, | ||
headers: options.headers, | ||
@@ -24,0 +24,0 @@ data: body |
@@ -1,9 +0,11 @@ | ||
import {Enum} from '../types'; | ||
import { Enum } from '../types'; | ||
export class HttpVerb extends Enum { | ||
static Get = new HttpVerb("Get", "GET", "get"); | ||
static Put = new HttpVerb("Put", "PUT", "put"); | ||
static Patch = new HttpVerb("Patch", "PATCH", "patch"); | ||
static Post = new HttpVerb("Post", "POST", "post"); | ||
static Delete = new HttpVerb("Delete", "DELETE", "delete"); | ||
static Get = new HttpVerb('Get'); | ||
static Put = new HttpVerb('Put'); | ||
static Patch = new HttpVerb('Patch'); | ||
static Post = new HttpVerb('Post'); | ||
static Delete = new HttpVerb('Delete'); | ||
constructor(name: string) {super(name, name.toLowerCase(), name.toUpperCase()); } | ||
} |
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
138000
2012