@epilot/sdk 2.20.21 → 2.20.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/definitions/automation-runtime.json +1 -1
- package/definitions/automation.json +207 -2
- package/definitions/chat-runtime.json +1 -0
- package/definitions/chat.json +2909 -0
- package/dist/README-7F36AG5O.js +7 -0
- package/dist/README-I7JMAFA4.cjs +7 -0
- package/dist/{_index-D5TTZP5F.cjs → _index-655GNTWT.cjs} +4 -1
- package/dist/{_index-UY46ZN47.js → _index-6FK4PV6Y.js} +3 -0
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +8 -8
- package/dist/apis/automation.d.cts +2 -2
- package/dist/apis/automation.d.ts +2 -2
- package/dist/apis/automation.js +2 -2
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/chat.cjs +38 -0
- package/dist/apis/chat.d.cts +18 -0
- package/dist/apis/chat.d.ts +18 -0
- package/dist/apis/chat.js +38 -0
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/automation-CDMOEYVP.cjs +7 -0
- package/dist/automation-XFMSH7Y3.js +7 -0
- package/dist/{automation-runtime-RM5EOZH2.cjs → automation-runtime-KLCXZKEC.cjs} +2 -2
- package/dist/{automation-runtime-ORW5BVCD.js → automation-runtime-Y52HM57N.js} +1 -1
- package/dist/{automation.d-Bp45eKlU.d.cts → automation.d-2biAmiMc.d.cts} +214 -6
- package/dist/{automation.d-Bp45eKlU.d.ts → automation.d-2biAmiMc.d.ts} +214 -6
- package/dist/chat-5EOD2OPN.cjs +7 -0
- package/dist/chat-D5KXPRYY.js +7 -0
- package/dist/chat-runtime-MF35HI2U.js +5 -0
- package/dist/chat-runtime-MYMUFT3Y.cjs +5 -0
- package/dist/chat.d-CQ5eRtNU.d.cts +1544 -0
- package/dist/chat.d-CQ5eRtNU.d.ts +1544 -0
- package/dist/chunk-6ZTP7EQE.js +14 -0
- package/dist/chunk-A5THJ4SF.cjs +14 -0
- package/dist/{chunk-6LUOXPO4.js → chunk-KZXOYL5D.js} +6 -4
- package/dist/chunk-QW3ROE6H.js +14 -0
- package/dist/chunk-WOUASZJW.cjs +14 -0
- package/dist/{chunk-CKLXVVGF.cjs → chunk-YCTBOY3T.cjs} +6 -4
- package/dist/index.cjs +27 -19
- package/dist/index.d.cts +85 -83
- package/dist/index.d.ts +85 -83
- package/dist/index.js +22 -14
- package/docs/automation.md +99 -17
- package/docs/chat.md +695 -0
- package/package.json +10 -1
- package/dist/README-NBWAQWQS.js +0 -7
- package/dist/README-XCIDDEAE.cjs +0 -7
- package/dist/automation-FTFGFHT7.cjs +0 -7
- package/dist/automation-HJGT6QK5.js +0 -7
- package/dist/chunk-ADSWGLIV.cjs +0 -14
- package/dist/chunk-LCE7N4ZL.js +0 -14
package/docs/chat.md
ADDED
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
# epilot Chat API
|
|
2
|
+
|
|
3
|
+
- **Base URL:** `https://chat.sls.epilot.io`
|
|
4
|
+
- **Full API Docs:** [https://docs.epilot.io/api/chat](https://docs.epilot.io/api/chat)
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { epilot } from '@epilot/sdk'
|
|
10
|
+
|
|
11
|
+
epilot.authorize(() => '<token>')
|
|
12
|
+
const { data } = await epilot.chat.listChatWidgets(...)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Tree-shakeable import
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { getClient, authorize } from '@epilot/sdk/chat'
|
|
19
|
+
|
|
20
|
+
const chatClient = getClient()
|
|
21
|
+
authorize(chatClient, () => '<token>')
|
|
22
|
+
const { data } = await chatClient.listChatWidgets(...)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Operations
|
|
26
|
+
|
|
27
|
+
**Chat widgets**
|
|
28
|
+
- [`listChatWidgets`](#listchatwidgets)
|
|
29
|
+
- [`createChatWidget`](#createchatwidget)
|
|
30
|
+
- [`getChatWidget`](#getchatwidget)
|
|
31
|
+
- [`updateChatWidget`](#updatechatwidget)
|
|
32
|
+
- [`deleteChatWidget`](#deletechatwidget)
|
|
33
|
+
|
|
34
|
+
**Other**
|
|
35
|
+
- [`getPublicChatWidget`](#getpublicchatwidget)
|
|
36
|
+
- [`createPublicChatGrant`](#createpublicchatgrant)
|
|
37
|
+
- [`createAnonymousChatSession`](#createanonymouschatsession)
|
|
38
|
+
- [`sendAnonymousChatMessage`](#sendanonymouschatmessage)
|
|
39
|
+
|
|
40
|
+
**Schemas**
|
|
41
|
+
- [`ListChatWidgetsResponse`](#listchatwidgetsresponse)
|
|
42
|
+
- [`ChatWidget`](#chatwidget)
|
|
43
|
+
- [`WebsiteChatSettings`](#websitechatsettings)
|
|
44
|
+
- [`Error`](#error)
|
|
45
|
+
- [`CreateChatWidgetRequest`](#createchatwidgetrequest)
|
|
46
|
+
- [`UpdateChatWidgetRequest`](#updatechatwidgetrequest)
|
|
47
|
+
- [`Widget`](#widget)
|
|
48
|
+
- [`WidgetDesign`](#widgetdesign)
|
|
49
|
+
- [`PublicEvent`](#publicevent)
|
|
50
|
+
- [`PublicChatError`](#publicchaterror)
|
|
51
|
+
|
|
52
|
+
### `listChatWidgets`
|
|
53
|
+
|
|
54
|
+
`GET /v1/widgets`
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
const { data } = await client.listChatWidgets({
|
|
58
|
+
cursor: 'example',
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary>Response</summary>
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"widgets": [
|
|
68
|
+
{
|
|
69
|
+
"name": "string",
|
|
70
|
+
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
71
|
+
"website_chat": {
|
|
72
|
+
"allowed_origins": ["string"],
|
|
73
|
+
"organisation_name": "string",
|
|
74
|
+
"default_locale": "en",
|
|
75
|
+
"design_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
76
|
+
"authentication": {
|
|
77
|
+
"email_code": {
|
|
78
|
+
"email_template_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
83
|
+
"org_id": "string",
|
|
84
|
+
"binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
85
|
+
"version": 1,
|
|
86
|
+
"created_at": "1970-01-01T00:00:00.000Z",
|
|
87
|
+
"updated_at": "1970-01-01T00:00:00.000Z",
|
|
88
|
+
"website_chat_embed": {
|
|
89
|
+
"script_url": "https://example.com/path",
|
|
90
|
+
"chat_api_origin": "https://example.com/path",
|
|
91
|
+
"demo_url": "https://example.com/path"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"next_cursor": "string"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
</details>
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### `createChatWidget`
|
|
104
|
+
|
|
105
|
+
`POST /v1/widgets`
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
const { data } = await client.createChatWidget(
|
|
109
|
+
null,
|
|
110
|
+
{
|
|
111
|
+
name: 'string',
|
|
112
|
+
agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
113
|
+
website_chat: {
|
|
114
|
+
allowed_origins: ['string'],
|
|
115
|
+
organisation_name: 'string',
|
|
116
|
+
default_locale: 'en',
|
|
117
|
+
design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
118
|
+
authentication: {
|
|
119
|
+
email_code: {
|
|
120
|
+
email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
<details>
|
|
129
|
+
<summary>Response</summary>
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"name": "string",
|
|
134
|
+
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
135
|
+
"website_chat": {
|
|
136
|
+
"allowed_origins": ["string"],
|
|
137
|
+
"organisation_name": "string",
|
|
138
|
+
"default_locale": "en",
|
|
139
|
+
"design_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
140
|
+
"authentication": {
|
|
141
|
+
"email_code": {
|
|
142
|
+
"email_template_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
147
|
+
"org_id": "string",
|
|
148
|
+
"binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
149
|
+
"version": 1,
|
|
150
|
+
"created_at": "1970-01-01T00:00:00.000Z",
|
|
151
|
+
"updated_at": "1970-01-01T00:00:00.000Z",
|
|
152
|
+
"website_chat_embed": {
|
|
153
|
+
"script_url": "https://example.com/path",
|
|
154
|
+
"chat_api_origin": "https://example.com/path",
|
|
155
|
+
"demo_url": "https://example.com/path"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
</details>
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### `getChatWidget`
|
|
165
|
+
|
|
166
|
+
`GET /v1/widgets/{widget_id}`
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
const { data } = await client.getChatWidget({
|
|
170
|
+
widget_id: 'example',
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
<details>
|
|
175
|
+
<summary>Response</summary>
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"name": "string",
|
|
180
|
+
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
181
|
+
"website_chat": {
|
|
182
|
+
"allowed_origins": ["string"],
|
|
183
|
+
"organisation_name": "string",
|
|
184
|
+
"default_locale": "en",
|
|
185
|
+
"design_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
186
|
+
"authentication": {
|
|
187
|
+
"email_code": {
|
|
188
|
+
"email_template_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
193
|
+
"org_id": "string",
|
|
194
|
+
"binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
195
|
+
"version": 1,
|
|
196
|
+
"created_at": "1970-01-01T00:00:00.000Z",
|
|
197
|
+
"updated_at": "1970-01-01T00:00:00.000Z",
|
|
198
|
+
"website_chat_embed": {
|
|
199
|
+
"script_url": "https://example.com/path",
|
|
200
|
+
"chat_api_origin": "https://example.com/path",
|
|
201
|
+
"demo_url": "https://example.com/path"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
</details>
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### `updateChatWidget`
|
|
211
|
+
|
|
212
|
+
`PUT /v1/widgets/{widget_id}`
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
const { data } = await client.updateChatWidget(
|
|
216
|
+
{
|
|
217
|
+
widget_id: 'example',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'string',
|
|
221
|
+
agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
222
|
+
website_chat: {
|
|
223
|
+
allowed_origins: ['string'],
|
|
224
|
+
organisation_name: 'string',
|
|
225
|
+
default_locale: 'en',
|
|
226
|
+
design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
227
|
+
authentication: {
|
|
228
|
+
email_code: {
|
|
229
|
+
email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
version: 1
|
|
234
|
+
},
|
|
235
|
+
)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
<details>
|
|
239
|
+
<summary>Response</summary>
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"name": "string",
|
|
244
|
+
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
245
|
+
"website_chat": {
|
|
246
|
+
"allowed_origins": ["string"],
|
|
247
|
+
"organisation_name": "string",
|
|
248
|
+
"default_locale": "en",
|
|
249
|
+
"design_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
250
|
+
"authentication": {
|
|
251
|
+
"email_code": {
|
|
252
|
+
"email_template_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
257
|
+
"org_id": "string",
|
|
258
|
+
"binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
259
|
+
"version": 1,
|
|
260
|
+
"created_at": "1970-01-01T00:00:00.000Z",
|
|
261
|
+
"updated_at": "1970-01-01T00:00:00.000Z",
|
|
262
|
+
"website_chat_embed": {
|
|
263
|
+
"script_url": "https://example.com/path",
|
|
264
|
+
"chat_api_origin": "https://example.com/path",
|
|
265
|
+
"demo_url": "https://example.com/path"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
</details>
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
### `deleteChatWidget`
|
|
275
|
+
|
|
276
|
+
`DELETE /v1/widgets/{widget_id}`
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
const { data } = await client.deleteChatWidget({
|
|
280
|
+
widget_id: 'example',
|
|
281
|
+
version: 1,
|
|
282
|
+
})
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
### `getPublicChatWidget`
|
|
288
|
+
|
|
289
|
+
`GET /v1/widgets/{widget_id}/configuration`
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
const { data } = await client.getPublicChatWidget({
|
|
293
|
+
widget_id: 'example',
|
|
294
|
+
})
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
<details>
|
|
298
|
+
<summary>Response</summary>
|
|
299
|
+
|
|
300
|
+
```json
|
|
301
|
+
{
|
|
302
|
+
"key": "string",
|
|
303
|
+
"organisationName": "string",
|
|
304
|
+
"assistantName": "string",
|
|
305
|
+
"defaultLocale": "en",
|
|
306
|
+
"design": {
|
|
307
|
+
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
308
|
+
"last_modified_at": "string",
|
|
309
|
+
"style": {
|
|
310
|
+
"palette": {
|
|
311
|
+
"primary": "string",
|
|
312
|
+
"background": "string"
|
|
313
|
+
},
|
|
314
|
+
"typography": {
|
|
315
|
+
"font": {
|
|
316
|
+
"font_family": "string"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"shape": {
|
|
320
|
+
"border_radius": 0
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"spark_theme": {
|
|
324
|
+
"accentColor": "string",
|
|
325
|
+
"backgroundColor": "string",
|
|
326
|
+
"fontBody": "string",
|
|
327
|
+
"fontHeading": "string",
|
|
328
|
+
"radius": "string",
|
|
329
|
+
"scaling": "string",
|
|
330
|
+
"spacing": "string",
|
|
331
|
+
"appearance": "string",
|
|
332
|
+
"neutralColor": "string",
|
|
333
|
+
"styleVariant": "string",
|
|
334
|
+
"labelPosition": "string",
|
|
335
|
+
"inputStyle": "string",
|
|
336
|
+
"inputColor": "string",
|
|
337
|
+
"cardVariant": "string",
|
|
338
|
+
"cardColor": "string",
|
|
339
|
+
"highContrast": true
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
"locales": ["en"]
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
</details>
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
### `createPublicChatGrant`
|
|
351
|
+
|
|
352
|
+
`POST /v1/bootstrap`
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
const { data } = await client.createPublicChatGrant(
|
|
356
|
+
null,
|
|
357
|
+
{
|
|
358
|
+
widget_key: 'string'
|
|
359
|
+
},
|
|
360
|
+
)
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
<details>
|
|
364
|
+
<summary>Response</summary>
|
|
365
|
+
|
|
366
|
+
```json
|
|
367
|
+
{
|
|
368
|
+
"grant": "string",
|
|
369
|
+
"expires_in": 60,
|
|
370
|
+
"widget_origin": "https://example.com/path"
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
</details>
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
### `createAnonymousChatSession`
|
|
379
|
+
|
|
380
|
+
`POST /v1/sessions`
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
const { data } = await client.createAnonymousChatSession(
|
|
384
|
+
null,
|
|
385
|
+
{
|
|
386
|
+
grant: 'string'
|
|
387
|
+
},
|
|
388
|
+
)
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
<details>
|
|
392
|
+
<summary>Response</summary>
|
|
393
|
+
|
|
394
|
+
```json
|
|
395
|
+
{
|
|
396
|
+
"token": "string",
|
|
397
|
+
"conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
398
|
+
"expires_at": 0,
|
|
399
|
+
"widget": {
|
|
400
|
+
"key": "string",
|
|
401
|
+
"organisationName": "string",
|
|
402
|
+
"assistantName": "string",
|
|
403
|
+
"defaultLocale": "en",
|
|
404
|
+
"design": {
|
|
405
|
+
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
406
|
+
"last_modified_at": "string",
|
|
407
|
+
"style": {
|
|
408
|
+
"palette": {
|
|
409
|
+
"primary": "string",
|
|
410
|
+
"background": "string"
|
|
411
|
+
},
|
|
412
|
+
"typography": {
|
|
413
|
+
"font": {
|
|
414
|
+
"font_family": "string"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"shape": {
|
|
418
|
+
"border_radius": 0
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
"spark_theme": {
|
|
422
|
+
"accentColor": "string",
|
|
423
|
+
"backgroundColor": "string",
|
|
424
|
+
"fontBody": "string",
|
|
425
|
+
"fontHeading": "string",
|
|
426
|
+
"radius": "string",
|
|
427
|
+
"scaling": "string",
|
|
428
|
+
"spacing": "string",
|
|
429
|
+
"appearance": "string",
|
|
430
|
+
"neutralColor": "string",
|
|
431
|
+
"styleVariant": "string",
|
|
432
|
+
"labelPosition": "string",
|
|
433
|
+
"inputStyle": "string",
|
|
434
|
+
"inputColor": "string",
|
|
435
|
+
"cardVariant": "string",
|
|
436
|
+
"cardColor": "string",
|
|
437
|
+
"highContrast": true
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"locales": ["en"]
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
</details>
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
### `sendAnonymousChatMessage`
|
|
450
|
+
|
|
451
|
+
`POST /v1/messages`
|
|
452
|
+
|
|
453
|
+
```ts
|
|
454
|
+
const { data } = await client.sendAnonymousChatMessage(
|
|
455
|
+
null,
|
|
456
|
+
{
|
|
457
|
+
request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
458
|
+
message: 'string',
|
|
459
|
+
locale: 'en',
|
|
460
|
+
simple_language: true
|
|
461
|
+
},
|
|
462
|
+
)
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Schemas
|
|
468
|
+
|
|
469
|
+
### `ListChatWidgetsResponse`
|
|
470
|
+
|
|
471
|
+
```ts
|
|
472
|
+
type ListChatWidgetsResponse = {
|
|
473
|
+
widgets: Array<{
|
|
474
|
+
name: string
|
|
475
|
+
agent_id: string // uuid
|
|
476
|
+
website_chat: {
|
|
477
|
+
allowed_origins: { ... }
|
|
478
|
+
organisation_name: { ... }
|
|
479
|
+
default_locale: { ... }
|
|
480
|
+
design_id?: { ... }
|
|
481
|
+
authentication?: { ... }
|
|
482
|
+
}
|
|
483
|
+
widget_id: string // uuid
|
|
484
|
+
org_id: string
|
|
485
|
+
binding_id: string // uuid
|
|
486
|
+
version: number
|
|
487
|
+
created_at: string // date-time
|
|
488
|
+
updated_at: string // date-time
|
|
489
|
+
website_chat_embed: {
|
|
490
|
+
script_url: { ... }
|
|
491
|
+
chat_api_origin: { ... }
|
|
492
|
+
demo_url: { ... }
|
|
493
|
+
}
|
|
494
|
+
}>
|
|
495
|
+
next_cursor?: string
|
|
496
|
+
}
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### `ChatWidget`
|
|
500
|
+
|
|
501
|
+
```ts
|
|
502
|
+
type ChatWidget = {
|
|
503
|
+
name: string
|
|
504
|
+
agent_id: string // uuid
|
|
505
|
+
website_chat: {
|
|
506
|
+
allowed_origins: string[]
|
|
507
|
+
organisation_name: string
|
|
508
|
+
default_locale: "en" | "de"
|
|
509
|
+
design_id?: string // uuid
|
|
510
|
+
authentication?: {
|
|
511
|
+
email_code: { ... }
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
widget_id: string // uuid
|
|
515
|
+
org_id: string
|
|
516
|
+
binding_id: string // uuid
|
|
517
|
+
version: number
|
|
518
|
+
created_at: string // date-time
|
|
519
|
+
updated_at: string // date-time
|
|
520
|
+
website_chat_embed: {
|
|
521
|
+
script_url: string // uri
|
|
522
|
+
chat_api_origin: string // uri
|
|
523
|
+
demo_url: string // uri
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### `WebsiteChatSettings`
|
|
529
|
+
|
|
530
|
+
```ts
|
|
531
|
+
type WebsiteChatSettings = {
|
|
532
|
+
allowed_origins: string[]
|
|
533
|
+
organisation_name: string
|
|
534
|
+
default_locale: "en" | "de"
|
|
535
|
+
design_id?: string // uuid
|
|
536
|
+
authentication?: {
|
|
537
|
+
email_code: {
|
|
538
|
+
email_template_id?: { ... }
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### `Error`
|
|
545
|
+
|
|
546
|
+
```ts
|
|
547
|
+
type Error = {
|
|
548
|
+
error?: string
|
|
549
|
+
message?: string
|
|
550
|
+
details?: object
|
|
551
|
+
}
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### `CreateChatWidgetRequest`
|
|
555
|
+
|
|
556
|
+
```ts
|
|
557
|
+
type CreateChatWidgetRequest = {
|
|
558
|
+
name: string
|
|
559
|
+
agent_id: string // uuid
|
|
560
|
+
website_chat: {
|
|
561
|
+
allowed_origins: string[]
|
|
562
|
+
organisation_name: string
|
|
563
|
+
default_locale: "en" | "de"
|
|
564
|
+
design_id?: string // uuid
|
|
565
|
+
authentication?: {
|
|
566
|
+
email_code: { ... }
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### `UpdateChatWidgetRequest`
|
|
573
|
+
|
|
574
|
+
```ts
|
|
575
|
+
type UpdateChatWidgetRequest = {
|
|
576
|
+
name?: string
|
|
577
|
+
agent_id?: string // uuid
|
|
578
|
+
website_chat?: {
|
|
579
|
+
allowed_origins: string[]
|
|
580
|
+
organisation_name: string
|
|
581
|
+
default_locale: "en" | "de"
|
|
582
|
+
design_id?: string // uuid
|
|
583
|
+
authentication?: {
|
|
584
|
+
email_code: { ... }
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
version: number
|
|
588
|
+
}
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### `Widget`
|
|
592
|
+
|
|
593
|
+
```ts
|
|
594
|
+
type Widget = {
|
|
595
|
+
key: string
|
|
596
|
+
organisationName: string
|
|
597
|
+
assistantName: string
|
|
598
|
+
defaultLocale: "en" | "de"
|
|
599
|
+
design?: {
|
|
600
|
+
id: string // uuid
|
|
601
|
+
last_modified_at?: string
|
|
602
|
+
style?: {
|
|
603
|
+
palette?: { ... }
|
|
604
|
+
typography?: { ... }
|
|
605
|
+
shape?: { ... }
|
|
606
|
+
}
|
|
607
|
+
spark_theme?: {
|
|
608
|
+
accentColor?: { ... }
|
|
609
|
+
backgroundColor?: { ... }
|
|
610
|
+
fontBody?: { ... }
|
|
611
|
+
fontHeading?: { ... }
|
|
612
|
+
radius?: { ... }
|
|
613
|
+
scaling?: { ... }
|
|
614
|
+
spacing?: { ... }
|
|
615
|
+
appearance?: { ... }
|
|
616
|
+
neutralColor?: { ... }
|
|
617
|
+
styleVariant?: { ... }
|
|
618
|
+
labelPosition?: { ... }
|
|
619
|
+
inputStyle?: { ... }
|
|
620
|
+
inputColor?: { ... }
|
|
621
|
+
cardVariant?: { ... }
|
|
622
|
+
cardColor?: { ... }
|
|
623
|
+
highContrast?: { ... }
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
locales: "en" | "de"[]
|
|
627
|
+
}
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
### `WidgetDesign`
|
|
631
|
+
|
|
632
|
+
```ts
|
|
633
|
+
type WidgetDesign = {
|
|
634
|
+
id: string // uuid
|
|
635
|
+
last_modified_at?: string
|
|
636
|
+
style?: {
|
|
637
|
+
palette?: {
|
|
638
|
+
primary?: { ... }
|
|
639
|
+
background?: { ... }
|
|
640
|
+
}
|
|
641
|
+
typography?: {
|
|
642
|
+
font?: { ... }
|
|
643
|
+
}
|
|
644
|
+
shape?: {
|
|
645
|
+
border_radius?: { ... }
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
spark_theme?: {
|
|
649
|
+
accentColor?: string
|
|
650
|
+
backgroundColor?: string
|
|
651
|
+
fontBody?: string
|
|
652
|
+
fontHeading?: string
|
|
653
|
+
radius?: string
|
|
654
|
+
scaling?: string
|
|
655
|
+
spacing?: string
|
|
656
|
+
appearance?: string
|
|
657
|
+
neutralColor?: string
|
|
658
|
+
styleVariant?: string
|
|
659
|
+
labelPosition?: string
|
|
660
|
+
inputStyle?: string
|
|
661
|
+
inputColor?: string
|
|
662
|
+
cardVariant?: string
|
|
663
|
+
cardColor?: string
|
|
664
|
+
highContrast?: boolean
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
### `PublicEvent`
|
|
670
|
+
|
|
671
|
+
JSON payload of one SSE data frame from sendAnonymousChatMessage.
|
|
672
|
+
|
|
673
|
+
```ts
|
|
674
|
+
type PublicEvent = {
|
|
675
|
+
type: "delta"
|
|
676
|
+
text: string
|
|
677
|
+
request_id: string // uuid
|
|
678
|
+
} | {
|
|
679
|
+
type: "complete"
|
|
680
|
+
text: string
|
|
681
|
+
request_id: string // uuid
|
|
682
|
+
} | {
|
|
683
|
+
type: "error"
|
|
684
|
+
code: "UNAVAILABLE"
|
|
685
|
+
request_id: string // uuid
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
### `PublicChatError`
|
|
690
|
+
|
|
691
|
+
```ts
|
|
692
|
+
type PublicChatError = {
|
|
693
|
+
code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"
|
|
694
|
+
}
|
|
695
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/sdk",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.23",
|
|
4
4
|
"description": "JavaScript/TypeScript SDK for epilot APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -75,6 +75,12 @@
|
|
|
75
75
|
"require": "./dist/apis/calendar.cjs"
|
|
76
76
|
},
|
|
77
77
|
"./calendar/openapi.json": "./definitions/calendar.json",
|
|
78
|
+
"./chat": {
|
|
79
|
+
"types": "./dist/apis/chat.d.ts",
|
|
80
|
+
"import": "./dist/apis/chat.js",
|
|
81
|
+
"require": "./dist/apis/chat.cjs"
|
|
82
|
+
},
|
|
83
|
+
"./chat/openapi.json": "./definitions/chat.json",
|
|
78
84
|
"./configuration-hub": {
|
|
79
85
|
"types": "./dist/apis/configuration-hub.d.ts",
|
|
80
86
|
"import": "./dist/apis/configuration-hub.js",
|
|
@@ -391,6 +397,9 @@
|
|
|
391
397
|
"calendar": [
|
|
392
398
|
"./dist/apis/calendar.d.ts"
|
|
393
399
|
],
|
|
400
|
+
"chat": [
|
|
401
|
+
"./dist/apis/chat.d.ts"
|
|
402
|
+
],
|
|
394
403
|
"configuration-hub": [
|
|
395
404
|
"./dist/apis/configuration-hub.d.ts"
|
|
396
405
|
],
|