Class Client

Contains a fetch instance, provides methods to GET and POST several types

Hierarchy

  • Client

Constructors

  • Parameters

    • Optional fetchOverride: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>)
        • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
        • Parameters

          • input: RequestInfo | URL
          • Optional init: RequestInit

          Returns Promise<Response>

    Returns Client

Properties

__fetchOverride?: any

Accessors

  • get fetch(): any
  • Returns any

Methods

  • Fetches and Parses a Resource. Can fetch through another atomic server if you pass the from argument, which should be the baseURL of an Atomic Server. Returns a tuple of the requested resource and a list of all resources found in the response.

    Parameters

    Returns Promise<HTTPResourceResult>

  • Posts a Commit to some endpoint. Returns the Commit created by the server.

    Parameters

    Returns Promise<Commit>

  • Parameters

    • fetchOverride: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>)
        • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
        • Parameters

          • input: RequestInfo | URL
          • Optional init: RequestInit

          Returns Promise<Response>

    Returns void

  • Uploads files to the /upload endpoint of the Store. Signs the Headers using the given agent. Returns the newly created resources

    Parameters

    • files: File[]
    • serverUrl: string
    • agent: Agent
    • parent: string

    Returns Promise<Resource[]>

  • Returns true if the given subject is valid

    Parameters

    • subject: undefined | string

    Returns boolean

  • Removes query params from the URL if it can build a URL. Will return the normal URL if things go wrong.

    Parameters

    • subject: string

    Returns string

  • Throws an error if the subject is not valid

    Parameters

    • subject: undefined | string

    Returns void

Generated using TypeDoc