From bc5c79190a1f6667e6385e2c876c4ef33b7e0bdf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 13 Jul 2024 06:42:08 +0000 Subject: [PATCH] Version Packages --- .changeset/flat-bottles-work.md | 5 - .changeset/tough-queens-sin.md | 5 - CHANGELOG.md | 10 ++ docs/_config.yml | 9 ++ docs/index.md | 4 + docs/modules/Adapters/Fetch.ts.md | 30 ++++ docs/modules/Client.ts.md | 185 +++++++++++++++++++++++++ docs/modules/Error.ts.md | 63 +++++++++ docs/modules/Fetch.ts.md | 102 ++++++++++++++ docs/modules/Interceptor.ts.md | 161 +++++++++++++++++++++ docs/modules/Interceptors/Logger.ts.md | 30 ++++ docs/modules/Interceptors/Url.ts.md | 30 ++++ docs/modules/Request.ts.md | 116 ++++++++++++++++ docs/modules/Response.ts.md | 176 +++++++++++++++++++++++ docs/modules/index.md | 6 + docs/modules/index.ts.md | 110 +++++++++++++++ package.json | 2 +- 17 files changed, 1033 insertions(+), 11 deletions(-) delete mode 100644 .changeset/flat-bottles-work.md delete mode 100644 .changeset/tough-queens-sin.md create mode 100644 docs/_config.yml create mode 100644 docs/index.md create mode 100644 docs/modules/Adapters/Fetch.ts.md create mode 100644 docs/modules/Client.ts.md create mode 100644 docs/modules/Error.ts.md create mode 100644 docs/modules/Fetch.ts.md create mode 100644 docs/modules/Interceptor.ts.md create mode 100644 docs/modules/Interceptors/Logger.ts.md create mode 100644 docs/modules/Interceptors/Url.ts.md create mode 100644 docs/modules/Request.ts.md create mode 100644 docs/modules/Response.ts.md create mode 100644 docs/modules/index.md create mode 100644 docs/modules/index.ts.md diff --git a/.changeset/flat-bottles-work.md b/.changeset/flat-bottles-work.md deleted file mode 100644 index b13ae11..0000000 --- a/.changeset/flat-bottles-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"effect-fetch": minor ---- - -Provide client type simplifier diff --git a/.changeset/tough-queens-sin.md b/.changeset/tough-queens-sin.md deleted file mode 100644 index acd52eb..0000000 --- a/.changeset/tough-queens-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"effect-fetch": major ---- - -Upgrade effect diff --git a/CHANGELOG.md b/CHANGELOG.md index d164251..e50e841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # effect-fetch +## 2.0.0 + +### Major Changes + +- 7d0b6ae: Upgrade effect + +### Minor Changes + +- da12ae5: Provide client type simplifier + ## 1.4.0 ### Minor Changes diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..d44a39b --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,9 @@ +remote_theme: mikearnaldi/just-the-docs + +# Enable or disable the site search +search_enabled: true + +# Aux links for the upper right navigation +aux_links: +'effect-fetch on GitHub': + - 'https://github.com/joshamaju/effect-fetch' \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..d77a441 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,4 @@ +--- +title: Home +nav_order: 1 +--- diff --git a/docs/modules/Adapters/Fetch.ts.md b/docs/modules/Adapters/Fetch.ts.md new file mode 100644 index 0000000..2175786 --- /dev/null +++ b/docs/modules/Adapters/Fetch.ts.md @@ -0,0 +1,30 @@ +--- +title: Adapters/Fetch.ts +nav_order: 1 +parent: Modules +--- + +## Fetch overview + +Added in v1.0.0 + +--- + +

Table of contents

+ +- [adapter](#adapter) + - [fetch](#fetch) + +--- + +# adapter + +## fetch + +**Signature** + +```ts +export declare const fetch: Adapter +``` + +Added in v1.0.0 diff --git a/docs/modules/Client.ts.md b/docs/modules/Client.ts.md new file mode 100644 index 0000000..9ce2b18 --- /dev/null +++ b/docs/modules/Client.ts.md @@ -0,0 +1,185 @@ +--- +title: Client.ts +nav_order: 2 +parent: Modules +--- + +## Client overview + +Added in v1.3.0 + +--- + +

Table of contents

+ +- [constructor](#constructor) + - [create](#create) + - [delete](#delete) + - [get](#get) + - [head](#head) + - [layer](#layer) + - [make](#make) + - [options](#options) + - [patch](#patch) + - [post](#post) + - [put](#put) +- [model](#model) + - [Handlers (interface)](#handlers-interface) +- [tag](#tag) + - [Client (class)](#client-class) + +--- + +# constructor + +## create + +**Signature** + +```ts +export declare const create: ( + config: Config +) => Effect, Fetch>> +``` + +Added in v1.4.0 + +## delete + +**Signature** + +```ts +export declare const delete: (url: string | URL | HttpRequest, init?: RequestInit | undefined) => Effect +``` + +Added in v1.3.0 + +## get + +**Signature** + +```ts +export declare const get: ( + url: string | URL | HttpRequest, + init?: RequestInit | undefined +) => Effect +``` + +Added in v1.3.0 + +## head + +**Signature** + +```ts +export declare const head: ( + url: string | URL | HttpRequest, + init?: RequestInit | undefined +) => Effect +``` + +Added in v1.3.0 + +## layer + +**Signature** + +```ts +export declare const layer: Layer +``` + +Added in v1.3.0 + +## make + +**Signature** + +```ts +export declare const make: Effect +``` + +Added in v1.3.0 + +## options + +**Signature** + +```ts +export declare const options: ( + url: string | URL | HttpRequest, + init?: RequestInit | undefined +) => Effect +``` + +Added in v1.3.0 + +## patch + +**Signature** + +```ts +export declare const patch: ( + url: string | URL | HttpRequest, + init?: RequestInit | undefined +) => Effect +``` + +Added in v1.3.0 + +## post + +**Signature** + +```ts +export declare const post: ( + url: string | URL | HttpRequest, + init?: RequestInit | undefined +) => Effect +``` + +Added in v1.3.0 + +## put + +**Signature** + +```ts +export declare const put: ( + url: string | URL | HttpRequest, + init?: RequestInit | undefined +) => Effect +``` + +Added in v1.3.0 + +# model + +## Handlers (interface) + +**Signature** + +```ts +export interface Handlers { + put: Handler + get: Handler + head: Handler + post: Handler + patch: Handler + delete: Handler + options: Handler +} +``` + +Added in v1.3.0 + +# tag + +## Client (class) + +**Signature** + +```ts +export declare class Client +``` + +Added in v1.3.0 diff --git a/docs/modules/Error.ts.md b/docs/modules/Error.ts.md new file mode 100644 index 0000000..fd28ffb --- /dev/null +++ b/docs/modules/Error.ts.md @@ -0,0 +1,63 @@ +--- +title: Error.ts +nav_order: 3 +parent: Modules +--- + +## Error overview + +Added in v1.1.0 + +--- + +

Table of contents

+ +- [error](#error) + - [DecodeError](#decodeerror) + - [HttpError](#httperror) + - [StatusError](#statuserror) + - [StatusErrorT](#statuserrort) + +--- + +# error + +## DecodeError + +**Signature** + +```ts +export declare const DecodeError: typeof DecodeError +``` + +Added in v1.1.0 + +## HttpError + +**Signature** + +```ts +export declare const HttpError: typeof HttpError +``` + +Added in v1.1.0 + +## StatusError + +**Signature** + +```ts +export declare const StatusError: typeof StatusError +``` + +Added in v1.1.0 + +## StatusErrorT + +**Signature** + +```ts +export declare const StatusErrorT: any +``` + +Added in v1.1.0 diff --git a/docs/modules/Fetch.ts.md b/docs/modules/Fetch.ts.md new file mode 100644 index 0000000..eaa5a40 --- /dev/null +++ b/docs/modules/Fetch.ts.md @@ -0,0 +1,102 @@ +--- +title: Fetch.ts +nav_order: 4 +parent: Modules +--- + +## Fetch overview + +Added in v1.0.0 + +--- + +

Table of contents

+ +- [constructors](#constructors) + - [effect](#effect) + - [fetch](#fetch) + - [fetch\_](#fetch_) + - [make](#make) +- [model](#model) + - [Adapter (interface)](#adapter-interface) +- [tag](#tag) + - [Fetch (class)](#fetch-class) + +--- + +# constructors + +## effect + +Constructs a `Fetch` layer from the specified effect that produces the given platform adapter + +**Signature** + +```ts +export declare const effect: (fetch: Effect) => Layer +``` + +Added in v1.0.0 + +## fetch + +**Signature** + +```ts +export declare const fetch: (url: string | URL, init?: RequestInit | undefined) => Effect +``` + +Added in v1.0.0 + +## fetch\_ + +Constructs a request whose response is a `Response` wrapper with the decode methods replace with their `Effect` conterparts + +**Signature** + +```ts +export declare const fetch_: ( + url: string | URL, + init?: RequestInit | undefined +) => Effect +``` + +Added in v1.0.0 + +## make + +Constructs a `Fetch` layer using the given platform adapter + +**Signature** + +```ts +export declare const make: (fetch: Adapter) => Layer +``` + +Added in v1.0.0 + +# model + +## Adapter (interface) + +**Signature** + +```ts +export interface Adapter { + (url: string | URL | HttpRequest, init?: RequestInit): Effect +} +``` + +Added in v1.0.0 + +# tag + +## Fetch (class) + +**Signature** + +```ts +export declare class Fetch +``` + +Added in v1.0.0 diff --git a/docs/modules/Interceptor.ts.md b/docs/modules/Interceptor.ts.md new file mode 100644 index 0000000..a0c5f6b --- /dev/null +++ b/docs/modules/Interceptor.ts.md @@ -0,0 +1,161 @@ +--- +title: Interceptor.ts +nav_order: 6 +parent: Modules +--- + +## Interceptor overview + +Added in v1.0.0 + +--- + +

Table of contents

+ +- [combinators](#combinators) + - [add](#add) +- [constructor](#constructor) + - [copy](#copy) +- [constructors](#constructors) + - [empty](#empty) + - [make](#make) + - [of](#of) + - [provide](#provide) +- [model](#model) + - [Chain (interface)](#chain-interface) + - [Interceptor (interface)](#interceptor-interface) + - [Interceptors (type alias)](#interceptors-type-alias) +- [tag](#tag) + - [Context (class)](#context-class) + +--- + +# combinators + +## add + +**Signature** + +```ts +export declare const add: { + >( + interceptor: T + ): ( + interceptors: Interceptors + ) => T extends Interceptor ? Interceptors : never + , E, R>( + interceptors: Interceptors, + interceptor: T + ): T extends Interceptor ? Interceptors : never +} +``` + +Added in v1.0.0 + +# constructor + +## copy + +**Signature** + +```ts +export declare const copy: (interceptors: Interceptors) => Interceptors +``` + +Added in v1.4.0 + +# constructors + +## empty + +**Signature** + +```ts +export declare const empty: () => Interceptors +``` + +Added in v1.0.0 + +## make + +Creates the intercepting wrapper around the provided platform adapter + +**Signature** + +```ts +export declare const make: (interceptors: Interceptors) => Effect | Fetch> +``` + +Added in v2.0.0 + +## of + +**Signature** + +```ts +export declare const of: (interceptor: Interceptor) => Interceptors +``` + +Added in v1.2.0 + +## provide + +Provides the given platform adapter to the interceptor `Fetch` wrapper + +**Signature** + +```ts +export declare const provide: { + (fetch: Adapter): (interceptor: Effect) => Effect> + (interceptor: Effect, fetch: Adapter): Effect> +} +``` + +Added in v2.0.0 + +# model + +## Chain (interface) + +**Signature** + +```ts +export interface Chain { + request: HttpRequest + proceed(request: HttpRequest): Effect +} +``` + +Added in v1.0.0 + +## Interceptor (interface) + +**Signature** + +```ts +export interface Interceptor extends Effect {} +``` + +Added in v1.2.3 + +## Interceptors (type alias) + +**Signature** + +```ts +export type Interceptors = Chunk.Chunk> +``` + +Added in v1.2.3 + +# tag + +## Context (class) + +**Signature** + +```ts +export declare class Context +``` + +Added in v1.0.0 diff --git a/docs/modules/Interceptors/Logger.ts.md b/docs/modules/Interceptors/Logger.ts.md new file mode 100644 index 0000000..b0d929b --- /dev/null +++ b/docs/modules/Interceptors/Logger.ts.md @@ -0,0 +1,30 @@ +--- +title: Interceptors/Logger.ts +nav_order: 7 +parent: Modules +--- + +## Logger overview + +Added in v1.0.0 + +--- + +

Table of contents

+ +- [interceptor](#interceptor) + - [Logger](#logger) + +--- + +# interceptor + +## Logger + +**Signature** + +```ts +export declare const Logger: (level: Level, headersToRedact?: string[]) => Effect.Effect +``` + +Added in v1.0.0 diff --git a/docs/modules/Interceptors/Url.ts.md b/docs/modules/Interceptors/Url.ts.md new file mode 100644 index 0000000..f058df6 --- /dev/null +++ b/docs/modules/Interceptors/Url.ts.md @@ -0,0 +1,30 @@ +--- +title: Interceptors/Url.ts +nav_order: 8 +parent: Modules +--- + +## Url overview + +Added in v1.3.0 + +--- + +

Table of contents

+ +- [interceptor](#interceptor) + - [Url](#url) + +--- + +# interceptor + +## Url + +**Signature** + +```ts +export declare const Url: (base: string) => Effect.Effect +``` + +Added in v1.3.0 diff --git a/docs/modules/Request.ts.md b/docs/modules/Request.ts.md new file mode 100644 index 0000000..d58dfa6 --- /dev/null +++ b/docs/modules/Request.ts.md @@ -0,0 +1,116 @@ +--- +title: Request.ts +nav_order: 9 +parent: Modules +--- + +## Request overview + +Added in v1.0.0 + +--- + +

Table of contents

+ +- [combinators](#combinators) + - [arrayBuffer](#arraybuffer) + - [blob](#blob) + - [formData](#formdata) + - [json](#json) + - [text](#text) +- [constructors](#constructors) + - [make](#make) +- [mapping](#mapping) + - [appendBody](#appendbody) + - [map](#map) + +--- + +# combinators + +## arrayBuffer + +**Signature** + +```ts +export declare const arrayBuffer: (value: Request) => Effect +``` + +Added in v1.0.0 + +## blob + +**Signature** + +```ts +export declare const blob: (value: Request) => Effect +``` + +Added in v1.0.0 + +## formData + +**Signature** + +```ts +export declare const formData: (value: Request) => Effect +``` + +Added in v1.0.0 + +## json + +**Signature** + +```ts +export declare const json: (value: Request) => Effect +``` + +Added in v1.0.0 + +## text + +**Signature** + +```ts +export declare const text: (value: Request) => Effect +``` + +Added in v1.0.0 + +# constructors + +## make + +**Signature** + +```ts +export declare const make: (url: string | URL, init?: RequestInit) => HttpRequest +``` + +Added in v1.0.0 + +# mapping + +## appendBody + +**Signature** + +```ts +export declare const appendBody: (body: Body) => (request: HttpRequest) => Request +``` + +Added in v1.0.0 + +## map + +**Signature** + +```ts +export declare const map: { + (fn: (request: HttpRequest) => B): (request: HttpRequest) => B + (request: HttpRequest, fn: (request: HttpRequest) => B): B +} +``` + +Added in v1.0.0 diff --git a/docs/modules/Response.ts.md b/docs/modules/Response.ts.md new file mode 100644 index 0000000..b631e98 --- /dev/null +++ b/docs/modules/Response.ts.md @@ -0,0 +1,176 @@ +--- +title: Response.ts +nav_order: 10 +parent: Modules +--- + +## Response overview + +Added in v1.0.0 + +--- + +

Table of contents

+ +- [combinators](#combinators) + - [arrayBuffer](#arraybuffer) + - [blob](#blob) + - [formData](#formdata) + - [json](#json) + - [text](#text) +- [error](#error) + - [StatusError](#statuserror) + - [StatusErrorT](#statuserrort) +- [filtering](#filtering) + - [filterStatus](#filterstatus) + - [filterStatusOk](#filterstatusok) + - [filterStatusOkT](#filterstatusokt) +- [status code](#status-code) + - [NotOkStatusCode](#notokstatuscode) + - [OkStatusCode](#okstatuscode) + - [StatusCode](#statuscode) + +--- + +# combinators + +## arrayBuffer + +**Signature** + +```ts +export declare const arrayBuffer: (value: Response) => Effect +``` + +Added in v1.0.0 + +## blob + +**Signature** + +```ts +export declare const blob: (value: Response) => Effect +``` + +Added in v1.0.0 + +## formData + +**Signature** + +```ts +export declare const formData: (value: Response) => Effect +``` + +Added in v1.0.0 + +## json + +**Signature** + +```ts +export declare const json: (value: Response) => Effect +``` + +Added in v1.0.0 + +## text + +**Signature** + +```ts +export declare const text: (value: Response) => Effect +``` + +Added in v1.0.0 + +# error + +## StatusError + +**Signature** + +```ts +export declare const StatusError: typeof internal.StatusError +``` + +Added in v1.1.0 + +## StatusErrorT + +**Signature** + +```ts +export declare const StatusErrorT: any +``` + +Added in v1.1.0 + +# filtering + +## filterStatus + +**Signature** + +```ts +export declare const filterStatus: (( + fn: Predicate +) => (response: Response) => Effect) & + ((response: Response, fn: Predicate) => Effect) +``` + +Added in v1.0.0 + +## filterStatusOk + +**Signature** + +```ts +export declare const filterStatusOk: (response: Response) => Effect +``` + +Added in v1.0.0 + +## filterStatusOkT + +**Signature** + +```ts +export declare const filterStatusOkT: ( + response: Response +) => Effect, StatusErrorT, never> +``` + +Added in v1.0.0 + +# status code + +## NotOkStatusCode + +**Signature** + +```ts +export declare const NotOkStatusCode: any +``` + +Added in v1.1.0 + +## OkStatusCode + +**Signature** + +```ts +export declare const OkStatusCode: any +``` + +Added in v1.1.0 + +## StatusCode + +**Signature** + +```ts +export declare const StatusCode: any +``` + +Added in v1.1.0 diff --git a/docs/modules/index.md b/docs/modules/index.md new file mode 100644 index 0000000..d20a6b7 --- /dev/null +++ b/docs/modules/index.md @@ -0,0 +1,6 @@ +--- +title: Modules +has_children: true +permalink: /docs/modules +nav_order: 2 +--- diff --git a/docs/modules/index.ts.md b/docs/modules/index.ts.md new file mode 100644 index 0000000..f40f499 --- /dev/null +++ b/docs/modules/index.ts.md @@ -0,0 +1,110 @@ +--- +title: index.ts +nav_order: 5 +parent: Modules +--- + +## index overview + +Added in v1.2.4 + +--- + +

Table of contents

+ +- [exports](#exports) + - [From './Adapters/Fetch.js'](#from-adaptersfetchjs) + - [From './Error.js'](#from-errorjs) + - [From './Fetch.js'](#from-fetchjs) + - [From './Interceptor.js'](#from-interceptorjs) + - [From './Interceptors/Logger.js'](#from-interceptorsloggerjs) + - [From './Request.js'](#from-requestjs) + - [From './Response.js'](#from-responsejs) + +--- + +# exports + +## From './Adapters/Fetch.js' + +Re-exports all named exports from the './Adapters/Fetch.js' module as `PlatformFetch`. + +**Signature** + +```ts +export * as PlatformFetch from "./Adapters/Fetch.js" +``` + +Added in v1.2.4 + +## From './Error.js' + +Re-exports all named exports from the './Error.js' module as `Error`. + +**Signature** + +```ts +export * as Error from "./Error.js" +``` + +Added in v1.2.4 + +## From './Fetch.js' + +Re-exports all named exports from the './Fetch.js' module as `Fetch`. + +**Signature** + +```ts +export * as Fetch from "./Fetch.js" +``` + +Added in v1.2.4 + +## From './Interceptor.js' + +Re-exports all named exports from the './Interceptor.js' module as `Interceptor`. + +**Signature** + +```ts +export * as Interceptor from "./Interceptor.js" +``` + +Added in v1.2.4 + +## From './Interceptors/Logger.js' + +Re-exports all named exports from the './Interceptors/Logger.js' module as `Logger`. + +**Signature** + +```ts +export * as Logger from "./Interceptors/Logger.js" +``` + +Added in v1.2.4 + +## From './Request.js' + +Re-exports all named exports from the './Request.js' module as `Request`. + +**Signature** + +```ts +export * as Request from "./Request.js" +``` + +Added in v1.2.4 + +## From './Response.js' + +Re-exports all named exports from the './Response.js' module as `Response`. + +**Signature** + +```ts +export * as Response from "./Response.js" +``` + +Added in v1.2.4 diff --git a/package.json b/package.json index 89f315f..4a55a9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "effect-fetch", - "version": "1.4.0", + "version": "2.0.0", "description": "fetch + interceptors + strongly typed errors", "type": "module", "homepage": "https://github.com/joshamaju/effect-fetch",