Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

HttpApiMiddleware

13 exports Since v1.0.0 Source

Guards

Signature

declare function isSecurity(u: TagClassAny): u is TagClassSecurityAny

Models

Since v1.0.0

Signature

interface HttpApiMiddleware<Provides, E> extends Effect<Provides, E, HttpRouter.HttpRouter.Provided> {}

Signature

type HttpApiMiddlewareSecurity<Security extends Record<string, HttpApiSecurity.HttpApiSecurity>, Provides, E> = { [K in keyof Security]: (_: HttpApiSecurity.HttpApiSecurity.Type<Security[K]>) => Effect.Effect<Provides, E, HttpRouter.HttpRouter.Provided> }
Since v1.0.0
Since v1.0.0

Signature

type TagClass<Self, Name extends string, Options> = Options extends {
readonly security: Record<string, HttpApiSecurity.HttpApiSecurity>;
} ? TagClass.BaseSecurity<Self, Name, Options, Simplify<HttpApiMiddlewareSecurity<Options["security"], TagClass.Service<Options>, TagClass.FailureService<Options>>>, Options["security"]> : TagClass.Base<Self, Name, Options, HttpApiMiddleware<TagClass.Service<Options>, TagClass.FailureService<Options>>>

TagClassAny

interface
Since v1.0.0

Signature

interface TagClassAny extends Tag<any, Any> {
readonly [TypeId]: typeof TypeId;
readonly failure: All;
readonly optional: boolean;
readonly provides?: any;
}
Since v1.0.0

Signature

interface TagClassSecurityAny extends TagClassAny {
readonly [SecurityTypeId]: typeof SecurityTypeId;
readonly security: Record<string, HttpApiSecurity.HttpApiSecurity>;
}

Tags

Since v1.0.0

Signature

declare function Tag<Self>(): <Name extends string, Options extends {
readonly failure?: any;
readonly optional?: boolean;
readonly provides?: any;
readonly security?: Record<string, HttpApiSecurity>;
}>(id: Name, options?: Options) => TagClass<Self, Name, Options>

Type Ids

Signature

declare const SecurityTypeId: unique symbol
Since v1.0.0

Signature

type SecurityTypeId = typeof SecurityTypeId
Since v1.0.0

Signature

declare const TypeId: unique symbol
Since v1.0.0

Signature

type TypeId = typeof TypeId