Constructor
new ServerClient(config)
Parameters:
Name | Type | Description |
---|---|---|
config |
ServerClientConfig | for the server client. |
- Source:
Methods
deleteRepository(id) → {Promise.<any>}
Delete repository with the provided id.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | of the repository which should be deleted. |
- Source:
Returns:
promise which resolves with the delete result.
- Type
- Promise.<any>
execute(requestBuilder) → {Promise.<(HttpResponse|Error)>}
Executes http request wrapped in provided request builder. If the server config provides username and password, then a logging attempt is made. Upon successful login the auth data is stored for later requests.
Parameters:
Name | Type | Description |
---|---|---|
requestBuilder |
HttpRequestBuilder |
- Source:
Returns:
a promise which resolves to response wrapper or rejects with error if thrown during execution.
- Type
- Promise.<(HttpResponse|Error)>
getLoggedUser() → {User}
Logged user getter.
- Source:
Returns:
user
- Type
- User
getRepository(id, config) → {Promise.<RDFRepositoryClient>}
Creates a repository client instance with the provided id and configuration.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | of the repository |
config |
RepositoryClientConfig | for the overridable repository configuration. |
- Source:
Returns:
promise which resolves with new RDFRepositoryClient instance.
- Type
- Promise.<RDFRepositoryClient>
getRepositoryIDs() → {Promise.<Array>}
Get an array of repository ids available in the server.
- Source:
Returns:
promise which resolves with an Array with repository ids.
- Type
- Promise.<Array>
hasRepository(id) → {Promise.<boolean>}
Check if repository with the provided id exists.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | of the repository which should be checked. |
- Source:
Returns:
promise which resolves with boolean value.
- Type
- Promise.<boolean>
initHttpClient()
Initializes the http client.
- Source:
initLogger()
Initializes the logger.
- Source:
setLoggedUser(user) → {ServerClient}
User setter
Parameters:
Name | Type | Description |
---|---|---|
user |
User |
- Source:
Returns:
- Type
- ServerClient