@effect/platform
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -36,5 +36,6 @@ /** | ||
* @since 1.0.0 | ||
* @category constructors | ||
* @category models | ||
*/ | ||
export declare const make: (method: Method) => (url: string, options?: { | ||
export interface Options { | ||
readonly method?: Method; | ||
readonly url?: string; | ||
@@ -46,14 +47,28 @@ readonly urlParams?: UrlParams.Input; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
export declare namespace Options { | ||
/** | ||
* @since 1.0.0 | ||
* @category models | ||
*/ | ||
interface NoBody extends Omit<Options, "method" | "url" | "body"> { | ||
} | ||
/** | ||
* @since 1.0.0 | ||
* @category models | ||
*/ | ||
interface NoUrl extends Omit<Options, "method" | "url"> { | ||
} | ||
} | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
export declare const get: (url: string, options?: { | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
export declare const make: { | ||
(method: "GET" | "HEAD"): (url: string, options?: Options.NoBody) => ClientRequest; | ||
(method: Exclude<Method, "GET" | "HEAD">): (url: string, options?: Options.NoUrl) => ClientRequest; | ||
}; | ||
/** | ||
@@ -63,10 +78,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const post: (url: string, options?: { | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly body?: Body.Body; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
export declare const get: (url: string, options?: Options.NoBody) => ClientRequest; | ||
/** | ||
@@ -76,10 +84,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const patch: (url: string, options?: { | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly body?: Body.Body; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
export declare const post: (url: string, options?: Options.NoUrl) => ClientRequest; | ||
/** | ||
@@ -89,10 +90,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const put: (url: string, options?: { | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly body?: Body.Body; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
export declare const patch: (url: string, options?: Options.NoUrl) => ClientRequest; | ||
/** | ||
@@ -102,9 +96,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const del: (url: string, options?: { | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
export declare const put: (url: string, options?: Options.NoUrl) => ClientRequest; | ||
/** | ||
@@ -114,9 +102,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const head: (url: string, options?: { | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
export declare const del: (url: string, options?: Options.NoUrl) => ClientRequest; | ||
/** | ||
@@ -126,32 +108,15 @@ * @since 1.0.0 | ||
*/ | ||
export declare const options: (url: string, options?: { | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}) => ClientRequest; | ||
export declare const head: (url: string, options?: Options.NoBody) => ClientRequest; | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
export declare const options: (url: string, options?: Options.NoUrl) => ClientRequest; | ||
/** | ||
* @since 1.0.0 | ||
* @category combinators | ||
*/ | ||
export declare const modify: { | ||
(options: { | ||
readonly method?: Method; | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly body?: Body.Body; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}): (self: ClientRequest) => ClientRequest; | ||
(self: ClientRequest, options: { | ||
readonly method?: Method; | ||
readonly url?: string; | ||
readonly urlParams?: UrlParams.Input; | ||
readonly headers?: Headers.Input; | ||
readonly body?: Body.Body; | ||
readonly accept?: string; | ||
readonly acceptJson?: boolean; | ||
}): ClientRequest; | ||
(options: Options): (self: ClientRequest) => ClientRequest; | ||
(self: ClientRequest, options: Options): ClientRequest; | ||
}; | ||
@@ -158,0 +123,0 @@ /** |
{ | ||
"name": "@effect/platform", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "Unified interfaces for common platform-specific services", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -41,17 +41,41 @@ /** | ||
* @since 1.0.0 | ||
* @category models | ||
*/ | ||
export interface Options { | ||
readonly method?: Method | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
export namespace Options { | ||
/** | ||
* @since 1.0.0 | ||
* @category models | ||
*/ | ||
export interface NoBody extends Omit<Options, "method" | "url" | "body"> {} | ||
/** | ||
* @since 1.0.0 | ||
* @category models | ||
*/ | ||
export interface NoUrl extends Omit<Options, "method" | "url"> {} | ||
} | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
export const make: ( | ||
method: Method | ||
) => ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.make | ||
export const make: { | ||
(method: "GET" | "HEAD"): (url: string, options?: Options.NoBody) => ClientRequest | ||
( | ||
method: Exclude<Method, "GET" | "HEAD"> | ||
): (url: string, options?: Options.NoUrl) => ClientRequest | ||
} = internal.make | ||
@@ -62,12 +86,3 @@ /** | ||
*/ | ||
export const get: ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.get | ||
export const get: (url: string, options?: Options.NoBody) => ClientRequest = internal.get | ||
@@ -78,13 +93,3 @@ /** | ||
*/ | ||
export const post: ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.post | ||
export const post: (url: string, options?: Options.NoUrl) => ClientRequest = internal.post | ||
@@ -95,13 +100,3 @@ /** | ||
*/ | ||
export const patch: ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.patch | ||
export const patch: (url: string, options?: Options.NoUrl) => ClientRequest = internal.patch | ||
@@ -112,13 +107,3 @@ /** | ||
*/ | ||
export const put: ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.put | ||
export const put: (url: string, options?: Options.NoUrl) => ClientRequest = internal.put | ||
@@ -129,12 +114,3 @@ /** | ||
*/ | ||
export const del: ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.del | ||
export const del: (url: string, options?: Options.NoUrl) => ClientRequest = internal.del | ||
@@ -145,12 +121,3 @@ /** | ||
*/ | ||
export const head: ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.head | ||
export const head: (url: string, options?: Options.NoBody) => ClientRequest = internal.head | ||
@@ -161,12 +128,3 @@ /** | ||
*/ | ||
export const options: ( | ||
url: string, | ||
options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
) => ClientRequest = internal.options | ||
export const options: (url: string, options?: Options.NoUrl) => ClientRequest = internal.options | ||
@@ -178,25 +136,4 @@ /** | ||
export const modify: { | ||
( | ||
options: { | ||
readonly method?: Method | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
): (self: ClientRequest) => ClientRequest | ||
( | ||
self: ClientRequest, | ||
options: { | ||
readonly method?: Method | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
} | ||
): ClientRequest | ||
(options: Options): (self: ClientRequest) => ClientRequest | ||
(self: ClientRequest, options: Options): ClientRequest | ||
} = internal.modify | ||
@@ -203,0 +140,0 @@ |
@@ -44,11 +44,8 @@ import { dual } from "@effect/data/Function" | ||
/** @internal */ | ||
export const make = (method: Method) => | ||
(url: string, options?: { | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
}) => | ||
export const make: { | ||
(method: "GET" | "HEAD"): (url: string, options?: ClientRequest.Options.NoBody) => ClientRequest.ClientRequest | ||
( | ||
method: Exclude<Method, "GET" | "HEAD"> | ||
): (url: string, options?: ClientRequest.Options.NoUrl) => ClientRequest.ClientRequest | ||
} = (method: Method) => (url: string, options?: ClientRequest.Options.NoUrl) => | ||
modify(empty, { | ||
@@ -83,20 +80,4 @@ method, | ||
export const modify = dual< | ||
(options: { | ||
readonly method?: Method | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
}) => (self: ClientRequest.ClientRequest) => ClientRequest.ClientRequest, | ||
(self: ClientRequest.ClientRequest, options: { | ||
readonly method?: Method | ||
readonly url?: string | ||
readonly urlParams?: UrlParams.Input | ||
readonly headers?: Headers.Input | ||
readonly body?: Body.Body | ||
readonly accept?: string | ||
readonly acceptJson?: boolean | ||
}) => ClientRequest.ClientRequest | ||
(options: ClientRequest.Options) => (self: ClientRequest.ClientRequest) => ClientRequest.ClientRequest, | ||
(self: ClientRequest.ClientRequest, options: ClientRequest.Options) => ClientRequest.ClientRequest | ||
>(2, (self, options) => { | ||
@@ -103,0 +84,0 @@ let result = self |
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
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
603770
10557