Heracles.ts

@hydra-cg/heracles.ts > HydraClientFactory

Class: HydraClientFactory

Provides a factory of the IHydraClients.

Hierarchy

HydraClientFactory

Index

Properties

Methods


Properties

<Private> httpCall

● httpCall: HttpCallFacility = null

Defined in HydraClientFactory.ts:26


<Private> hypermediaProcessorFactories

● hypermediaProcessorFactories: HypermediaProcessorFactory[] = []

Defined in HydraClientFactory.ts:23


<Private> iriTemplateExpansionStrategy

● iriTemplateExpansionStrategy: IIriTemplateExpansionStrategy = null

Defined in HydraClientFactory.ts:24


<Private> linksPolicy

● linksPolicy: LinksPolicy = LinksPolicy.Strict

Defined in HydraClientFactory.ts:25


Methods

andCreate

▸ andCreate(): IHydraClient

Defined in HydraClientFactory.ts:158

Creates a new instance of the IHydraClient.

Returns: IHydraClient


with

▸ with(hypermediaProcessor: IHypermediaProcessor): HydraClientFactory

▸ with(iriTemplateExpansionStrategy: IIriTemplateExpansionStrategy): HydraClientFactory

▸ with(httpCall: HttpCallFacility): HydraClientFactory

Defined in HydraClientFactory.ts:122

Adds an another IHypermediaProcessor component.

Parameters:

Name Type Description
hypermediaProcessor IHypermediaProcessor Hypermedia processor to be passed to future HydraClient instances.

Returns: HydraClientFactory

Defined in HydraClientFactory.ts:131

Sets a IIriTemplateExpansionStrategy component.

Parameters:

Name Type Description
iriTemplateExpansionStrategy IIriTemplateExpansionStrategy IRI template expansion strategy to be used when an IRI template is encountered.

Returns: HydraClientFactory

Defined in HydraClientFactory.ts:139

Adds HTTP requests facility component.

Parameters:

Name Type Description
httpCall HttpCallFacility HTTP call facility to be used for remote server calls.

Returns: HydraClientFactory


▸ withAllHttpLinks(): HydraClientFactory

Defined in HydraClientFactory.ts:82

Configures a factory to create a client with all resources from HTTP/HTTPS considered links.

Returns: HydraClientFactory


▸ withAllLinks(): HydraClientFactory

Defined in HydraClientFactory.ts:91

Configures a factory to create a client with all resources considered links.

Returns: HydraClientFactory


withDefaults

▸ withDefaults(): HydraClientFactory

Defined in HydraClientFactory.ts:53

Configures a future IHydraClient with JsonLdHypermediaProcessor, BodyResourceBoundIriTemplateExpansionStrategy and fetch components.

Returns: HydraClientFactory


withFactory

▸ withFactory(hypermediaProcessorFactory: HypermediaProcessorFactory): HydraClientFactory

Defined in HydraClientFactory.ts:111

Adds an another IHypermediaProcessor component via it’s factory method.

Parameters:

Name Type Description
hypermediaProcessorFactory HypermediaProcessorFactory Hypermedia processor facvtory to be passed to future HydraClient instances.

Returns: HydraClientFactory


withJsonLd

▸ withJsonLd(): HydraClientFactory

Defined in HydraClientFactory.ts:100

Configures a factory with JSON-LD hypermedia processor.

Returns: HydraClientFactory


▸ withSameRootLinks(): HydraClientFactory

Defined in HydraClientFactory.ts:73

Configures a factory to create a client with links of resources from the same host and port.

Returns: HydraClientFactory


▸ withStrictLinks(): HydraClientFactory

Defined in HydraClientFactory.ts:64

Configures a factory to create a client with explicitly defined links.

Returns: HydraClientFactory


<Static> configure

▸ configure(): HydraClientFactory

Defined in HydraClientFactory.ts:32

Starts the factory configuration.

Returns: HydraClientFactory


<Static><Private> createJsonLdHypermediaProcessor

▸ createJsonLdHypermediaProcessor(httpCall: HttpCallFacility): JsonLdHypermediaProcessor

Defined in HydraClientFactory.ts:36

Parameters:

Name Type
httpCall HttpCallFacility

Returns: JsonLdHypermediaProcessor