Skip to content

HttpApiMiddleware

13 exports Added in v1.0.0 Source

Guards

isSecurity

Added in v1.0.0 Source

Signature

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

Models

HttpApiMiddleware interface

Added in v1.0.0 Source

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>;
};

TagClass

Added in v1.0.0 Source

TagClass type

Added in v1.0.0 Source

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

Added in v1.0.0 Source

Signature

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

TagClassSecurityAny interface

Added in v1.0.0 Source

Signature

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

Tags

Tag

Added in v1.0.0 Source

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;

SecurityTypeId type

Added in v1.0.0 Source

Signature

type SecurityTypeId = typeof SecurityTypeId;

TypeId

Added in v1.0.0 Source

Signature

declare const TypeId: unique symbol;

TypeId type

Added in v1.0.0 Source

Signature

type TypeId = typeof TypeId;