@mcma/client
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -1,3 +0,3 @@ | ||
import { AxiosRequestConfig, AxiosPromise } from "axios"; | ||
import { Resource, ResourceType, Service, ResourceEndpoint, ContextVariableProvider, JobBase } from "@mcma/core"; | ||
import { AxiosPromise, AxiosRequestConfig } from "axios"; | ||
import { ContextVariableProvider, JobBase, Resource, ResourceEndpoint, ResourceType, Service } from "@mcma/core"; | ||
@@ -15,3 +15,3 @@ export type HttpRequestConfig = AxiosRequestConfig; | ||
constructor(); | ||
add(authType: string, authenticatorFactory: AuthenticatorFactory): void; | ||
@@ -23,6 +23,11 @@ get(authType: string, authContext?: any): Authenticator; | ||
request(config: HttpRequestConfig): HttpResponsePromise; | ||
get(url: string, config?: HttpRequestConfig): HttpResponsePromise; | ||
post(url: string, data?: any, config?: HttpRequestConfig): HttpResponsePromise; | ||
put(url: string, data?: any, config?: HttpRequestConfig): HttpResponsePromise; | ||
patch(url: string, data?: any, config?: HttpRequestConfig): HttpResponsePromise; | ||
delete(url: string, config?: HttpRequestConfig): HttpResponsePromise; | ||
@@ -33,3 +38,3 @@ } | ||
constructor(authenticator?: Authenticator); | ||
authenticator: Authenticator; | ||
@@ -55,5 +60,5 @@ | ||
constructor(resourceEndpoint: ResourceEndpoint, authProvider?: AuthProvider, serviceAuthType?: string, serviceAuthContext?: any); | ||
httpEndpoint: string; | ||
request(config: HttpRequestConfig): HttpResponsePromise; | ||
@@ -97,2 +102,2 @@ get(url: string, config?: HttpRequestConfig): HttpResponsePromise; | ||
get(config?: ResourceManagerConfig): ResourceManager; | ||
} | ||
} |
@@ -0,0 +0,0 @@ const { HttpClient } = require("./lib/http-client"); |
@@ -20,3 +20,3 @@ class AuthProvider { | ||
authType = Object.keys(registeredAuthTypes).find(k => k.toLowerCase() === (authType || "").toLowerCase()); | ||
return authType && registeredAuthTypes[authType] && registeredAuthTypes[authType](authContext); | ||
@@ -29,2 +29,2 @@ }; | ||
AuthProvider | ||
}; | ||
}; |
@@ -9,2 +9,2 @@ const { ContextVariableProvider } = require("@mcma/core"); | ||
}; | ||
} | ||
}; |
@@ -42,3 +42,6 @@ //"use strict"; | ||
} catch (error) { | ||
throw new Exception("HttpClient: " + config.method + " request to " + config.url + " failed!", error, { config, response: error.response.data }); | ||
throw new Exception("HttpClient: " + config.method + " request to " + config.url + " failed!", error, { | ||
config, | ||
response: error.response.data | ||
}); | ||
} | ||
@@ -98,2 +101,2 @@ }; | ||
HttpClient | ||
}; | ||
}; |
@@ -27,3 +27,3 @@ const { Exception } = require("@mcma/core"); | ||
} | ||
} | ||
}; | ||
@@ -35,3 +35,3 @@ this.request = async (config) => { | ||
return await httpClient.request(config); | ||
} | ||
}; | ||
@@ -54,3 +54,3 @@ this.get = async (url, config) => { | ||
return await httpClient.get(url, config); | ||
} | ||
}; | ||
@@ -74,3 +74,3 @@ this.post = async (url, data, config) => { | ||
return await httpClient.post(url, data, config); | ||
} | ||
}; | ||
@@ -96,3 +96,3 @@ this.put = async (url, data, config) => { | ||
return await httpClient.put(url, data, config); | ||
} | ||
}; | ||
@@ -117,3 +117,3 @@ this.patch = async (url, data, config) => { | ||
return await httpClient.patch(url, data, config); | ||
} | ||
}; | ||
@@ -134,3 +134,3 @@ this.delete = async (url, config) => { | ||
return await httpClient.delete(url, config); | ||
} | ||
}; | ||
} | ||
@@ -141,2 +141,2 @@ } | ||
ResourceEndpointClient | ||
}; | ||
}; |
@@ -0,0 +0,0 @@ const { Exception, Service, ResourceEndpoint, Notification } = require("@mcma/core"); |
@@ -0,0 +0,0 @@ const { ResourceEndpointClient } = require("./resource-endpoint-client"); |
{ | ||
"name": "@mcma/client", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Node module with classes and functions used to access services in an MCMA environment", | ||
@@ -17,2 +17,3 @@ "engines": { | ||
"keywords": [ | ||
"ebu", | ||
"mcma" | ||
@@ -30,7 +31,8 @@ ], | ||
"peerDependencies": { | ||
"@mcma/core": "0.5.3" | ||
"@mcma/core": "0.5.4" | ||
}, | ||
"devDependencies": { | ||
"@mcma/core": "0.5.4", | ||
"jasmine": "^3.3.1" | ||
} | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
535
23976
2
1