Skip to content

Commit

Permalink
[#2974] add client config endpoint (#3008)
Browse files Browse the repository at this point in the history
* client config docs

* tag config fix
  • Loading branch information
AudreyKj committed Apr 11, 2022
1 parent 8b5f126 commit d8268a4
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 7 deletions.
157 changes: 157 additions & 0 deletions docs/docs/api/endpoints/client-config.md
@@ -0,0 +1,157 @@
---
title: Client Config
sidebar_label: Client Config
---

The `config.client` endpoint responds with the configuration for an instance’s services, user profile, and tags.

The `services` property in the response gives the status of the instance’s components and reflects the [airy.yaml configuration file](/getting-started/installation/configuration). For example, [contacts](contacts) is an optional feature that can be enabled in the [airy.yaml configuration file](/getting-started/installation/configuration). If [contacts](contacts) is enabled (i.e. the `integration.contacts.enabled` field is marked as `true` in the [airy.yaml configuration file](/getting-started/installation/configuration)), the `config.client` endpoint will mark the component `api-contacts` as `enabled` in its response.

[Authentication is disabled by default in Airy Core](/api/introduction), thus the `user_profile` property in the response is by default `null`. If the instance features authentification, the `user_profile` property will include information about the user that is currently logged in.

The `tag_config` property in the response represents the configuration for [tags](/ui/tags). The [UI](/ui/introduction) uses these settings for the [tags](/ui/tags)' default styling.

`POST /client.config`

**Sample request**

```json5
{}
```

**Sample Response**

```json5
{
"services": {
"frontend-ui": {
"enabled": true,
"healthy": true,
"component": "frontend-ui"
},
"source-api": {
"enabled": true,
"healthy": true,
"component": "integration-source-api"
},
"sources-google-connector": {
"enabled": true,
"healthy": true,
"component": "sources-google"
},
"sources-viber-connector": {
"enabled": false,
"healthy": false,
"component": "sources-viber"
},
"webhook-publisher": {
"enabled": true,
"healthy": true,
"component": "integration-webhook"
},
"api-contacts": {
"enabled": true,
"healthy": true,
"component": "api-contacts"
},
"sources-google-events-router": {
"enabled": true,
"healthy": false,
"component": "sources-google"
},
"sources-viber-events-router": {
"enabled": false,
"healthy": false,
"component": "sources-viber"
},
"api-communication": {
"enabled": true,
"healthy": true,
"component": "api-communication"
},
"sources-facebook-events-router": {
"enabled": true,
"healthy": false,
"component": "sources-facebook"
},
"media-resolver": {
"enabled": true,
"healthy": true,
"component": "media-resolver"
},
"webhook-consumer": {
"enabled": true,
"healthy": true,
"component": "integration-webhook"
},
"sources-twilio-connector": {
"enabled": true,
"healthy": true,
"component": "sources-twilio"
},
"sources-chatplugin": {
"enabled": true,
"healthy": true,
"component": "sources-chat-plugin"
},
"sources-twilio-events-router": {
"enabled": true,
"healthy": false,
"component": "sources-twilio"
},
"api-admin": {
"enabled": true,
"healthy": false,
"component": "api-admin"
},
"api-websocket": {
"enabled": true,
"healthy": true,
"component": "api-websocket"
},
"frontend-chat-plugin": {
"enabled": true,
"healthy": true,
"component": "sources-chat-plugin"
},
"sources-facebook-connector": {
"enabled": true,
"healthy": true,
"component": "sources-facebook"
}
},
"user_profile": null,
"tag_config": {
"colors": {
"tag-green": {
"default": "0E764F",
"background": "F5FFFB",
"font": "0E764F",
"position": 3,
"border": "0E764F"
},
"tag-blue": {
"default": "1578D4",
"background": "F5FFFB",
"font": "1578D4",
"position": 1,
"border": "1578D4"
},
"tag-red": {
"default": "E0243A",
"background": "FFF7F9",
"font": "E0243A",
"position": 2,
"border": "E0243A"
},
"tag-purple": {
"default": "730A80",
"background": "FEF7FF",
"font": "730A80",
"position": 4,
"border": "730A80"
}
}
}
}
```
2 changes: 1 addition & 1 deletion docs/docs/ui/contacts.md
Expand Up @@ -12,7 +12,7 @@ import TLDR from "@site/src/components/TLDR";

This feature is disabled by default. To enable it you need to set the `integration.contacts.enabled` field in your [airy.yaml config](getting-started/installation/configuration.md) to `true`.

Viewing and editing contacts in the Airy UI is only possible when this feature is enabled.
The configuration served by the [client.config endpoint](/api/endpoints/client-config) is used for enabling this feature in the UI. Thus, viewing and editing contacts in the Airy UI is only possible when this feature is enabled in the [airy.yaml configuration file](getting-started/installation/configuration.md).

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/ui/introduction.md
Expand Up @@ -63,6 +63,6 @@ Get a glimpse of the Airy UI with screenshots of the Inbox, Tags, Contacts, and

<img alt="Demo Tags"src={useBaseUrl('img/ui/tags-ui.png')} />

<img alt="Demo suggested replies"src={useBaseUrl('img/ui/suggested-replies.png')} />

<img alt="Demo Contacts"src={useBaseUrl('img/ui/contactsEdit.png')} />

<img alt="Demo suggested replies"src={useBaseUrl('img/ui/suggested-replies.png')} />
2 changes: 2 additions & 0 deletions docs/docs/ui/tags.md
Expand Up @@ -16,6 +16,8 @@ Here are the ways you can create tags:
- Your users can create them manually directly in conversations
- They can be created in the Tag Manager

The tags configuration served by the [client.config endpoint](/api/endpoints/client-config) is used for the tags' default styling.

## Create

When you create a tag, you can choose a color to visually identify it better in the inbox.
Expand Down
1 change: 1 addition & 0 deletions docs/sidebars.js
Expand Up @@ -61,6 +61,7 @@ module.exports = {
'api/endpoints/templates',
'api/endpoints/users',
'api/endpoints/contacts',
'api/endpoints/client-config',
],
},
'api/httpClient',
Expand Down
6 changes: 2 additions & 4 deletions docs/static/icons/package.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d8268a4

Please sign in to comment.