@hydra-cg/heracles.ts > IHydraClient
Provides an abstract description of the Hydra client.
interface:
IHydraClient
▸ getApiDocumentation(urlOrResource: string
| IResource): Promise
<IApiDocumentation>
Defined in IHydraClient.ts:25
Obtains an API documentation.
Parameters:
Name | Type | Description |
---|---|---|
urlOrResource | string | IResource |
URL or object with an iri property from which to obtain an API documentation. |
Returns: Promise
<IApiDocumentation>
▸ getHypermediaProcessor(response: Response
): IHypermediaProcessor
Defined in IHydraClient.ts:17
Gets a hypermedia provider suitable for a given response.
Parameters:
Name | Type | Description |
---|---|---|
response | Response |
Raw response to find hypermedia processor for. |
Returns: IHypermediaProcessor
▸ getResource(urlOrResource: string
| IResource | ILink): Promise
<IWebResource>
Defined in IHydraClient.ts:32
Obtains a representation of a resource.
Parameters:
Name | Type | Description |
---|---|---|
urlOrResource | string | IResource | ILink |
Either URL, IResource pr ILink carrying an IRI of the resource to be obtained. |
Returns: Promise
<IWebResource>
▸ invoke(operation: IOperation, body?: IWebResource, parameters?: object
): Promise
<Response
>
Defined in IHydraClient.ts:41
Invokes a given operation.
Parameters:
Name | Type | Description |
---|---|---|
operation | IOperation | Operation descriptor to be invoked. |
Optional body |
IWebResource | Optional resource to be used as a body of the operation. |
Optional parameters |
object |
Optional auxiliary parameters. |
Returns: Promise
<Response
>