### Hierarchy

- Client
  - ConnectorClient

## Index

### Constructors

- constructor

### Properties

- bulkRoute
- headers
- httpClient
- thingUpdateRoute
- url
- version

### Methods

- bulk
- feedback
- getThing
- handshake
- index
- invokeRoute
- multiSearch
- search
- searchNext
- update
- makeUUID
- nextWindow

## Constructors

### constructor

- new ConnectorClient(httpClient: HttpClientInterface, url: string, version?: undefined | string): ConnectorClient

- Inherited from Client.constructor

  - Defined in src/client.ts:89

  Instantiate a new StApps-API client to communicate with a StApps-backend.

  #### Parameters

  - ##### httpClient: HttpClientInterface

    HTTP client to use

  - ##### url: string

    URL of the backend

  - ##### Optional version: undefined | string

    App version to use when requesting data (only necessary if URL is ambiguous)

    TODO: remove headers/version

  #### Returns ConnectorClient

## Properties

### Private bulkRoute

bulkRoute: SCBulkRoute = new SCBulkRoute()

- Defined in src/connectorClient.ts:47

Instance of multi search request route

### Protected headers

headers: HttpClientHeaders

Inherited from Client.headers

- Defined in src/client.ts:66

Default headers

TODO: remove headers

### Protected httpClient

httpClient: HttpClientInterface

Inherited from Client.httpClient

- Defined in src/client.ts:100

HTTP client to use

### Private thingUpdateRoute

thingUpdateRoute: SCThingUpdateRoute = new SCThingUpdateRoute()

- Defined in src/connectorClient.ts:52

Instance of multi search request route

### Protected url

url: string

Inherited from Client.url

- Defined in src/client.ts:100

URL of the backend

### Protected Optional version

version: undefined | string

Inherited from Client.version

- Defined in src/client.ts:100

App version to use when requesting data (only necessary if URL is ambiguous)

TODO: remove headers/version

## Methods

### bulk

- bulk<T>(type: SCThingType, source: string, timeout?: undefined | number): Promise<Bulk<T>>

- - Defined in src/connectorClient.ts:81

  Request a bulk transfer to the backend

  This uses the Bulk API supplied by the backend and returns an object that can be used just like the client itself, while handling the information necessary in bulk transfers.

  #### Type parameters

  - #### T: SCThings

  #### Parameters

  - ##### type: SCThingType

    StAppsCore thing type

  - ##### source: string

    Source identifier (should be unique per actual data source)

  - ##### Optional timeout: undefined | number

    Timeout in seconds when the bulk should expire

  #### Returns Promise<Bulk<T>>

### feedback

- feedback(feedback: SCFeedbackRequest): Promise<SCFeedbackResponse>

- Inherited from Client.feedback

  - Defined in src/client.ts:117

  Send feedback

  #### Parameters

  - ##### feedback: SCFeedbackRequest

    Feedback to send

  #### Returns Promise<SCFeedbackResponse>

### getThing

- getThing(uid: string): Promise<SCThings>

- Inherited from Client.getThing

  - Defined in src/client.ts:126

  Get a thing by its UID

  #### Parameters

  - ##### uid: string

    UID of the thing to fetch

  #### Returns Promise<SCThings>

### handshake

- handshake(coreVersion: string): Promise<SCIndexResponse>

- Inherited from Client.handshake

  - Defined in src/client.ts:150

  Make a handshake with the backend and check StAppsCore version

  #### Parameters

  - ##### coreVersion: string

    StAppsCore version to check

  #### Returns Promise<SCIndexResponse>

### index

- index<T>(things: T[], source?: undefined | string, timeout?: undefined | number): Promise<void>

- - Defined in src/connectorClient.ts:107

  Index a list of things

  Note that source is optional but is set to `'stapps-api'` in that case. This will override any previous bulk that you indexed with that source.

  see

    ConnectorClient.bulk

  #### Type parameters

  - #### T: SCThings

  #### Parameters

  - ##### things: T[]

    List of things to index

  - ##### Optional source: undefined | string

    Source of the things

  - ##### Optional timeout: undefined | number

    Timeout of the bulk in seconds

  #### Returns Promise<void>

### invokeRoute

- invokeRoute<T>(route: SCAbstractRoute, parameters?: undefined | object, body?: SCRequests): Promise<T>

- Inherited from Client.invokeRoute

  - Defined in src/client.ts:169

  Invoke a route

  #### Type parameters

  - #### T

  #### Parameters

  - ##### route: SCAbstractRoute

    Route to invoke

  - ##### Optional parameters: undefined | object

    Parameters for the URL fragment

  - ##### Optional body: SCRequests

    Body for the request

  #### Returns Promise<T>

### multiSearch

- multiSearch(multiSearchRequest: SCMultiSearchRequest): Promise<SCMultiSearchResponse>

- Inherited from Client.multiSearch

  - Defined in src/client.ts:195

  Send a multi search request to the backend

  All results will be returned for requests where no size is set.

  #### Parameters

  - ##### multiSearchRequest: SCMultiSearchRequest

    Multi search request

  #### Returns Promise<SCMultiSearchResponse>

### search

- search(searchRequest: SCSearchRequest): Promise<SCSearchResponse>

- Inherited from Client.search

  - Defined in src/client.ts:242

  Send a search request to the backend

  All results will be returned if no size is set in the request.

  #### Parameters

  - ##### searchRequest: SCSearchRequest

    Search request

  #### Returns Promise<SCSearchResponse>

### searchNext

- searchNext(searchRequest: SCSearchRequest, searchResponse: SCSearchResponse): Promise<object>

- Inherited from Client.searchNext

  - Defined in src/client.ts:266

  Get the next search results

  #### Parameters

  - ##### searchRequest: SCSearchRequest

    Last search request

  - ##### searchResponse: SCSearchResponse

    Search response for supplied search request

  #### Returns Promise<object>

### update

- update(thing: SCThings): Promise<SCThingUpdateResponse>

- - Defined in src/connectorClient.ts:133

  Update an existing StAppsCore thing

  #### Parameters

  - ##### thing: SCThings

    StAppsCore thing to update

  #### Returns Promise<SCThingUpdateResponse>

### Static makeUUID

- makeUUID(uid: string, namespaceId: SCLicensePlate): string

- - Defined in src/connectorClient.ts:63

  Make a UUID from a UID and a namespace ID

  Note: valid namespace IDs are license plates of StApps universities. See documentation of `NAMESPACES` for valid namespace IDs.

  #### Parameters

  - ##### uid: string

    UID to make UUID from

  - ##### namespaceId: SCLicensePlate

    Namespace ID to use to make UUID

  #### Returns string

### Static nextWindow

- nextWindow(searchRequest: SCSearchRequest, searchResponse: SCSearchResponse): SCSearchRequest

- Inherited from Client.nextWindow

  - Defined in src/client.ts:75

  Create a new search request with altered pagination parameters to move to the next result window

  throws

    OutOfRangeError Throws an error if the next window is beyond the total number of results

  #### Parameters

  - ##### searchRequest: SCSearchRequest

    Last search request

  - ##### searchResponse: SCSearchResponse

    Search response for supplied search request

  #### Returns SCSearchRequest

Generated using TypeDoc