@equinor/fusion-framework-module-http
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -6,2 +6,12 @@ # Change Log | ||
## [2.0.6](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.5...@equinor/fusion-framework-module-http@2.0.6) (2022-09-16) | ||
### Bug Fixes | ||
* **module-http:** fix export ([06a490d](https://github.com/equinor/fusion-framework/commit/06a490d40e34d2074ac102ac4fcd458cadd3538a)) | ||
* **module-http:** improve hierarchy ([3603347](https://github.com/equinor/fusion-framework/commit/36033474991288983490f250726a551f7ce3dcbd)) | ||
## [2.0.5](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.4...@equinor/fusion-framework-module-http@2.0.5) (2022-09-14) | ||
@@ -8,0 +18,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { HttpRequestHandler } from './client'; | ||
import { HttpRequestHandler } from './lib/operators'; | ||
export class HttpClientConfigurator { | ||
@@ -3,0 +3,0 @@ _clients = {}; |
@@ -1,8 +0,5 @@ | ||
export { HttpClient } from './client'; | ||
export { HttpClientMsal } from './client-msal'; | ||
export * from './configurator'; | ||
export * from './provider'; | ||
export * from './module'; | ||
export * from './selector'; | ||
export { default } from './module'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { HttpClientMsal } from './client-msal'; | ||
import { HttpClientMsal } from './lib/client'; | ||
import { HttpClientConfigurator } from './configurator'; | ||
@@ -3,0 +3,0 @@ import { HttpClientProvider } from './provider'; |
@@ -1,4 +0,6 @@ | ||
import { HttpRequestHandler, FetchRequest, IHttpClient, HttpResponseHandler } from './client'; | ||
import { HttpRequestHandler } from './lib/operators'; | ||
import type { FetchRequest, IHttpClient } from './lib/client'; | ||
import type { IHttpRequestHandler, IHttpResponseHandler } from './lib/operators'; | ||
interface HttpClientConstructorOptions<TInit extends FetchRequest> { | ||
requestHandler: HttpRequestHandler<TInit>; | ||
requestHandler: IHttpRequestHandler<TInit>; | ||
} | ||
@@ -13,4 +15,4 @@ interface HttpClientConstructor<TClient extends IHttpClient> { | ||
onCreate?: (client: TClient) => void; | ||
requestHandler?: HttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
responseHandler?: HttpResponseHandler<HttpClientRequestInitType<TClient>>; | ||
requestHandler?: IHttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
responseHandler?: IHttpResponseHandler<HttpClientRequestInitType<TClient>>; | ||
} | ||
@@ -21,5 +23,5 @@ export declare type HttpClientRequestInitType<T extends IHttpClient> = T extends IHttpClient<infer U> ? U : never; | ||
readonly defaultHttpClientCtor: HttpClientConstructor<TClient>; | ||
readonly defaultHttpRequestHandler: HttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
configureClient<T extends TClient>(name: string, args: HttpClientOptions<T>): HttpClientConfigurator<TClient>; | ||
configureClient(name: string, uri: string): HttpClientConfigurator<TClient>; | ||
readonly defaultHttpRequestHandler: IHttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
configureClient<T extends TClient>(name: string, args: HttpClientOptions<T>): IHttpClientConfigurator<TClient>; | ||
configureClient(name: string, uri: string): IHttpClientConfigurator<TClient>; | ||
configureClient<T extends TClient>(name: string, onCreate: (client: T) => void): HttpClientConfigurator<TClient>; | ||
@@ -26,0 +28,0 @@ hasClient(name: string): boolean; |
@@ -1,7 +0,5 @@ | ||
export { HttpClient, IHttpClient, FetchRequestInit, FetchRequest } from './client'; | ||
export { HttpClientMsal } from './client-msal'; | ||
export * from './configurator'; | ||
export * from './provider'; | ||
export * from './module'; | ||
export * from './selector'; | ||
export type { IHttpClient } from './lib/client'; | ||
export { default } from './module'; |
@@ -1,2 +0,2 @@ | ||
import { HttpClientMsal } from './client-msal'; | ||
import { HttpClientMsal } from './lib/client'; | ||
import { IHttpClientConfigurator, HttpClientOptions } from './configurator'; | ||
@@ -12,5 +12,5 @@ import { IHttpClientProvider } from './provider'; | ||
interface Modules { | ||
http: HttpModule; | ||
http: HttpMsalModule; | ||
} | ||
} | ||
export default module; |
@@ -1,3 +0,5 @@ | ||
import { HttpClient, HttpRequestHandler, IHttpClient } from './client'; | ||
import { HttpClient } from './lib/client'; | ||
import { HttpClientOptions, HttpClientRequestInitType, IHttpClientConfigurator } from './configurator'; | ||
import type { IHttpRequestHandler } from './lib/operators'; | ||
import type { IHttpClient } from './lib/client'; | ||
export declare class ClientNotFoundException extends Error { | ||
@@ -7,3 +9,3 @@ constructor(message: string); | ||
export interface IHttpClientProvider<TClient extends IHttpClient = IHttpClient> { | ||
readonly defaultHttpRequestHandler: HttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
readonly defaultHttpRequestHandler: IHttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
hasClient(key: string): boolean; | ||
@@ -16,3 +18,3 @@ createClient(key: string): TClient; | ||
protected config: IHttpClientConfigurator<TClient>; | ||
get defaultHttpRequestHandler(): HttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
get defaultHttpRequestHandler(): IHttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
constructor(config: IHttpClientConfigurator<TClient>); | ||
@@ -19,0 +21,0 @@ hasClient(key: string): boolean; |
{ | ||
"name": "@equinor/fusion-framework-module-http", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "", | ||
"main": "dist/esm/index.js", | ||
"types": "index.d.ts", | ||
"exports": { | ||
".": "./dist/esm/index.js" | ||
".": "./dist/esm/index.js", | ||
"./client": "./dist/esm/lib/client/index.js", | ||
"./operators": "./dist/esm/lib/operators/index.js", | ||
"./selectors": "./dist/esm/lib/selectors/index.js" | ||
}, | ||
"types": "dist/types/index.d.ts", | ||
"typesVersions": { | ||
">=4.2": { | ||
"*": [ | ||
"dist/types/*" | ||
], | ||
"client": [ | ||
"dist/types/lib/client/index.d.ts" | ||
], | ||
"operators": [ | ||
"dist/types/lib/operators/index.d.ts" | ||
], | ||
"selectors": [ | ||
"dist/types/lib/selectors/index.d.ts" | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
@@ -32,3 +51,3 @@ "build": "npm run build:typescript", | ||
}, | ||
"gitHead": "4e92ef5173981f4e43bad9a2a2e53fb3f71da7a1" | ||
"gitHead": "afbbc5036ce33357ea7f946a082282b72f86da30" | ||
} |
@@ -1,5 +0,8 @@ | ||
import { HttpRequestHandler, FetchRequest, IHttpClient, HttpResponseHandler } from './client'; | ||
import { HttpRequestHandler } from './lib/operators'; | ||
import type { FetchRequest, IHttpClient } from './lib/client'; | ||
import type { IHttpRequestHandler, IHttpResponseHandler } from './lib/operators'; | ||
interface HttpClientConstructorOptions<TInit extends FetchRequest> { | ||
requestHandler: HttpRequestHandler<TInit>; | ||
requestHandler: IHttpRequestHandler<TInit>; | ||
} | ||
@@ -19,4 +22,4 @@ | ||
onCreate?: (client: TClient) => void; | ||
requestHandler?: HttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
responseHandler?: HttpResponseHandler<HttpClientRequestInitType<TClient>>; | ||
requestHandler?: IHttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
responseHandler?: IHttpResponseHandler<HttpClientRequestInitType<TClient>>; | ||
} | ||
@@ -35,3 +38,3 @@ | ||
readonly defaultHttpClientCtor: HttpClientConstructor<TClient>; | ||
readonly defaultHttpRequestHandler: HttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
readonly defaultHttpRequestHandler: IHttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
@@ -53,3 +56,3 @@ /** | ||
args: HttpClientOptions<T> | ||
): HttpClientConfigurator<TClient>; | ||
): IHttpClientConfigurator<TClient>; | ||
@@ -61,3 +64,3 @@ /** | ||
*/ | ||
configureClient(name: string, uri: string): HttpClientConfigurator<TClient>; | ||
configureClient(name: string, uri: string): IHttpClientConfigurator<TClient>; | ||
@@ -64,0 +67,0 @@ /** |
@@ -6,10 +6,8 @@ /** | ||
export { HttpClient, IHttpClient, FetchRequestInit, FetchRequest } from './client'; | ||
export { HttpClientMsal } from './client-msal'; | ||
export * from './configurator'; | ||
export * from './provider'; | ||
export * from './module'; | ||
export * from './selector'; | ||
export type { IHttpClient } from './lib/client'; | ||
export { default } from './module'; |
@@ -1,2 +0,2 @@ | ||
import { HttpClientMsal } from './client-msal'; | ||
import { HttpClientMsal } from './lib/client'; | ||
import { IHttpClientConfigurator, HttpClientConfigurator, HttpClientOptions } from './configurator'; | ||
@@ -48,3 +48,3 @@ import { IHttpClientProvider, HttpClientProvider } from './provider'; | ||
interface Modules { | ||
http: HttpModule; | ||
http: HttpMsalModule; | ||
} | ||
@@ -51,0 +51,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { HttpClient, HttpRequestHandler, IHttpClient } from './client'; | ||
import { HttpClient } from './lib/client'; | ||
import { | ||
@@ -8,2 +8,5 @@ HttpClientOptions, | ||
import type { IHttpRequestHandler } from './lib/operators'; | ||
import type { IHttpClient } from './lib/client'; | ||
export class ClientNotFoundException extends Error { | ||
@@ -16,3 +19,3 @@ constructor(message: string) { | ||
export interface IHttpClientProvider<TClient extends IHttpClient = IHttpClient> { | ||
readonly defaultHttpRequestHandler: HttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
readonly defaultHttpRequestHandler: IHttpRequestHandler<HttpClientRequestInitType<TClient>>; | ||
/** check if a client is configured */ | ||
@@ -51,3 +54,3 @@ hasClient(key: string): boolean; | ||
{ | ||
get defaultHttpRequestHandler(): HttpRequestHandler<HttpClientRequestInitType<TClient>> { | ||
get defaultHttpRequestHandler(): IHttpRequestHandler<HttpClientRequestInitType<TClient>> { | ||
return this.config.defaultHttpRequestHandler; | ||
@@ -54,0 +57,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
137574
73
1153
1