@hateoas-ts/resource - v1.4.3
    Preparing search index...

    @hateoas-ts/resource - v1.4.3

    @hateoas-ts/resource - A type-safe HATEOAS client for HAL-compliant REST APIs.

    This library provides:

    • Type-safe navigation: Follow HATEOAS links with full TypeScript support
    • Automatic caching: Intelligent state caching with invalidation
    • Middleware support: Intercept requests for auth, logging, etc.
    • HAL-Forms actions: Execute hypermedia-driven state transitions
    import { createClient, Entity, Collection } from '@hateoas-ts/resource';

    // Define entity types
    type User = Entity<
    { id: string; name: string },
    { self: User; posts: Collection<Post> }
    >;

    // Create client and navigate
    const client = createClient({ baseURL: 'https://api.example.com' });
    const user = await client.go<User>('/users/123').get();

    // Follow HATEOAS links
    const posts = await user.follow('posts').get();

    Classes - Resource

    ActionValidationError
    LinkNotFound
    Resource
    ResourceRelation

    Classes - Other

    ForeverCache
    HttpTransport
    NeverCache
    ShortCache

    Interfaces - Client

    Client

    Interfaces - Resource

    Action

    Interfaces - Entity Types

    Entity

    Interfaces - Other

    Cache
    SchemaPlugin
    Transport

    Type Aliases - Resource

    GetRequestOptions
    HeadRequestOptions
    HttpHeaders
    LinkVariables
    PatchRequestOptions
    PostRequestOptions
    PutRequestOptions
    RequestOptions

    Type Aliases - State

    State

    Type Aliases - Entity Types

    Collection

    Type Aliases - Middleware

    FetchMiddleware

    Type Aliases - Other

    ActionFormSchema
    ActionSchemaPlugin
    ExtractCollectionElement
    HeadState

    Variables

    defaultSchemaPlugin
    standardActionSchemaPlugin

    Functions - Client

    createClient

    Functions - Other

    basicAuth
    bearerAuth