@salesforce/lds-adapters-sfap-einstein-copilot-bot 0.1.0-dev1
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/LICENSE.txt +82 -0
- package/dist/es/es2018/sfap-einstein-copilot-bot.js +1253 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getStatus.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/adapters/startSession.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +4 -0
- package/dist/es/es2018/types/src/generated/resources/getEinsteinBotsV1Status.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/postEinsteinBotsV1V5.3.0BotsSessionsByBotId.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/Error.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/ForceConfig.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/FormatTypeCapability.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/types/HyperLink.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/InitMessageEnvelope.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/Links.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/MessageTypeCapability.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/NormalizedEntity.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/NormalizedIntent.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/types/Referrer.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ResponseEnvelope.d.ts +59 -0
- package/dist/es/es2018/types/src/generated/types/ResponseOptions.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ResponseOptionsVariables.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/types/RichContentCapability.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/Status.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/TextInitMessage.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1290 -0
- package/src/raml/api.raml +369 -0
- package/src/raml/luvio.raml +25 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
#%RAML 1.0
|
|
2
|
+
title: Einstein Bots API
|
|
3
|
+
version: 5.3.0
|
|
4
|
+
baseUri: api.salesforce.com
|
|
5
|
+
types:
|
|
6
|
+
Status:
|
|
7
|
+
properties:
|
|
8
|
+
status:
|
|
9
|
+
description: Health status of Einstein Bots API.
|
|
10
|
+
enum:
|
|
11
|
+
- UP
|
|
12
|
+
- DOWN
|
|
13
|
+
type: string
|
|
14
|
+
required: true
|
|
15
|
+
Error:
|
|
16
|
+
properties:
|
|
17
|
+
status:
|
|
18
|
+
description: HTTP status.
|
|
19
|
+
type: number
|
|
20
|
+
required: true
|
|
21
|
+
path:
|
|
22
|
+
description: Request path.
|
|
23
|
+
type: string
|
|
24
|
+
required: true
|
|
25
|
+
requestId:
|
|
26
|
+
description: Request ID. A UUID in string format to help with request tracking.
|
|
27
|
+
type: string
|
|
28
|
+
required: true
|
|
29
|
+
error:
|
|
30
|
+
description: Error class name.
|
|
31
|
+
type: string
|
|
32
|
+
required: true
|
|
33
|
+
message:
|
|
34
|
+
description: Exception message.
|
|
35
|
+
type: string
|
|
36
|
+
required: true
|
|
37
|
+
timestamp:
|
|
38
|
+
description: Unix timestamp.
|
|
39
|
+
type: number
|
|
40
|
+
required: true
|
|
41
|
+
|
|
42
|
+
InitMessageEnvelope:
|
|
43
|
+
type: object
|
|
44
|
+
additionalProperties: false
|
|
45
|
+
properties:
|
|
46
|
+
externalSessionKey: string
|
|
47
|
+
message?: TextInitMessage
|
|
48
|
+
forceConfig: ForceConfig
|
|
49
|
+
responseOptions?: ResponseOptions
|
|
50
|
+
tz?:
|
|
51
|
+
example:
|
|
52
|
+
strict: false
|
|
53
|
+
value: America/Los_Angeles
|
|
54
|
+
(nullable): true
|
|
55
|
+
type: string | nil
|
|
56
|
+
variables?:
|
|
57
|
+
type: array
|
|
58
|
+
items:
|
|
59
|
+
type: any
|
|
60
|
+
richContentCapabilities: RichContentCapability
|
|
61
|
+
referrers?:
|
|
62
|
+
(nullable): true
|
|
63
|
+
type: array
|
|
64
|
+
items:
|
|
65
|
+
type: Referrer
|
|
66
|
+
TextInitMessage:
|
|
67
|
+
type: object
|
|
68
|
+
additionalProperties: false
|
|
69
|
+
properties:
|
|
70
|
+
text?:
|
|
71
|
+
description: Initial message from the customer to the bot to begin a session.
|
|
72
|
+
example:
|
|
73
|
+
strict: false
|
|
74
|
+
value: Hello
|
|
75
|
+
type: string
|
|
76
|
+
ForceConfig:
|
|
77
|
+
description: API configuration parameters.
|
|
78
|
+
type: object
|
|
79
|
+
additionalProperties: true
|
|
80
|
+
properties:
|
|
81
|
+
endpoint:
|
|
82
|
+
description: Instance URL of your Salesforce org. You can find the value in the **ForceConfig Endpoint** field of the **Add Connection** dialog when you add the connected app to the bot (see [Get Started with Einstein Bot API](https://developer.salesforce.com/docs/service/einstein-bot-api/guide/prerequisites.html)).
|
|
83
|
+
example:
|
|
84
|
+
strict: false
|
|
85
|
+
value: https://d5e000009s7bceah-dev-ed.my.salesforce.com/
|
|
86
|
+
type: string
|
|
87
|
+
required: true
|
|
88
|
+
ResponseOptions:
|
|
89
|
+
description: Configuration of additional information returned in the response payload.
|
|
90
|
+
type: object
|
|
91
|
+
additionalProperties: false
|
|
92
|
+
properties:
|
|
93
|
+
variables?: ResponseOptionsVariables
|
|
94
|
+
metrics?:
|
|
95
|
+
description: Indicates whether to include metrics in the response.
|
|
96
|
+
type: boolean
|
|
97
|
+
intents?:
|
|
98
|
+
description: Indicates whether to include all intents detected when processing the current request.
|
|
99
|
+
type: boolean
|
|
100
|
+
entities?:
|
|
101
|
+
description: Indicates whether to include all entities detected when processing the current request.
|
|
102
|
+
type: boolean
|
|
103
|
+
RichContentCapability:
|
|
104
|
+
type: object
|
|
105
|
+
properties:
|
|
106
|
+
messageTypes:
|
|
107
|
+
type: array
|
|
108
|
+
items: MessageTypeCapability
|
|
109
|
+
required: true
|
|
110
|
+
Referrer:
|
|
111
|
+
type: object
|
|
112
|
+
properties:
|
|
113
|
+
type:
|
|
114
|
+
description: Referrer type.
|
|
115
|
+
enum:
|
|
116
|
+
- Salesforce:Core:Bot:Id
|
|
117
|
+
- Salesforce:BotRuntime:Session:Id
|
|
118
|
+
example:
|
|
119
|
+
strict: false
|
|
120
|
+
value: Salesforce:Core:Bot:Id
|
|
121
|
+
type: string
|
|
122
|
+
required: true
|
|
123
|
+
value:
|
|
124
|
+
description: ID of referrer.
|
|
125
|
+
example:
|
|
126
|
+
strict: false
|
|
127
|
+
value: string
|
|
128
|
+
type: string
|
|
129
|
+
required: true
|
|
130
|
+
ResponseEnvelope:
|
|
131
|
+
type: object
|
|
132
|
+
additionalProperties: false
|
|
133
|
+
properties:
|
|
134
|
+
sessionId: string
|
|
135
|
+
botVersion: string
|
|
136
|
+
processedSequenceIds:
|
|
137
|
+
description: Sequence IDs of messages that the bot processed. Except for the initial request to start the session, all requests require a `sequenceId`.
|
|
138
|
+
type: array
|
|
139
|
+
items:
|
|
140
|
+
example:
|
|
141
|
+
strict: false
|
|
142
|
+
value: 1
|
|
143
|
+
type: number
|
|
144
|
+
required: true
|
|
145
|
+
messages:
|
|
146
|
+
description: Messages from the bot.
|
|
147
|
+
type: array
|
|
148
|
+
items:
|
|
149
|
+
(amf-xone):
|
|
150
|
+
- InquireResponseMessage
|
|
151
|
+
- ErrorResponseMessage
|
|
152
|
+
- ConfirmResponseMessage
|
|
153
|
+
- InformResponseMessage
|
|
154
|
+
- TextResponseMessage
|
|
155
|
+
- ChoicesResponseMessage
|
|
156
|
+
- EscalateResponseMessage
|
|
157
|
+
- SessionEndedResponseMessage
|
|
158
|
+
type: any
|
|
159
|
+
required: true
|
|
160
|
+
variables?:
|
|
161
|
+
type: array
|
|
162
|
+
items:
|
|
163
|
+
type: any
|
|
164
|
+
metrics?:
|
|
165
|
+
description: Session metrics.
|
|
166
|
+
type: object
|
|
167
|
+
additionalProperties: true
|
|
168
|
+
intents?:
|
|
169
|
+
type: array
|
|
170
|
+
items:
|
|
171
|
+
type: NormalizedIntent
|
|
172
|
+
entities?:
|
|
173
|
+
type: array
|
|
174
|
+
items:
|
|
175
|
+
type: NormalizedEntity
|
|
176
|
+
_links: Links
|
|
177
|
+
NormalizedEntity:
|
|
178
|
+
type: object
|
|
179
|
+
additionalProperties: false
|
|
180
|
+
properties:
|
|
181
|
+
confidenceScore:
|
|
182
|
+
description: Probability number that the AI assigns to this entity.
|
|
183
|
+
example:
|
|
184
|
+
strict: false
|
|
185
|
+
value: 0.40
|
|
186
|
+
type: number
|
|
187
|
+
required: true
|
|
188
|
+
value:
|
|
189
|
+
description: Value of the entity that the customer enters.
|
|
190
|
+
example:
|
|
191
|
+
strict: false
|
|
192
|
+
value: USD 30.0
|
|
193
|
+
type: string
|
|
194
|
+
required: true
|
|
195
|
+
type: string
|
|
196
|
+
entitySource?: string
|
|
197
|
+
Links:
|
|
198
|
+
description: List of Einstein Bots API endpoints for HATEOS compliancy.
|
|
199
|
+
type: object
|
|
200
|
+
additionalProperties: false
|
|
201
|
+
properties:
|
|
202
|
+
self: HyperLink
|
|
203
|
+
messages?: HyperLink
|
|
204
|
+
session?: HyperLink
|
|
205
|
+
feedback?: HyperLink
|
|
206
|
+
HyperLink:
|
|
207
|
+
description: Hyperlink object included in the Links schema
|
|
208
|
+
type: object
|
|
209
|
+
properties:
|
|
210
|
+
href?:
|
|
211
|
+
description: Link to the endpoint
|
|
212
|
+
example:
|
|
213
|
+
strict: false
|
|
214
|
+
value: https://runtime-api-ap-east.prod.chatbots.sfdc.sh/v5.0.0/sessions
|
|
215
|
+
type: string
|
|
216
|
+
NormalizedIntent:
|
|
217
|
+
type: object
|
|
218
|
+
additionalProperties: false
|
|
219
|
+
properties:
|
|
220
|
+
label:
|
|
221
|
+
description: Name or ID of the intent.
|
|
222
|
+
example:
|
|
223
|
+
strict: false
|
|
224
|
+
value: Password help
|
|
225
|
+
type: string
|
|
226
|
+
required: true
|
|
227
|
+
confidenceScore:
|
|
228
|
+
description: Probability number that the AI assigns to this intent.
|
|
229
|
+
example:
|
|
230
|
+
strict: false
|
|
231
|
+
value: 0.78
|
|
232
|
+
type: number
|
|
233
|
+
required: true
|
|
234
|
+
intentSource: string
|
|
235
|
+
ResponseOptionsVariables:
|
|
236
|
+
description: Variables returned in the response.
|
|
237
|
+
type: object
|
|
238
|
+
additionalProperties: false
|
|
239
|
+
properties:
|
|
240
|
+
include:
|
|
241
|
+
description: Indicates whether to include variables in the response.
|
|
242
|
+
example:
|
|
243
|
+
strict: false
|
|
244
|
+
value: true
|
|
245
|
+
type: boolean
|
|
246
|
+
required: true
|
|
247
|
+
filter?:
|
|
248
|
+
example:
|
|
249
|
+
strict: false
|
|
250
|
+
value:
|
|
251
|
+
- OrderQty
|
|
252
|
+
- OrderType
|
|
253
|
+
type: array
|
|
254
|
+
items:
|
|
255
|
+
type: string
|
|
256
|
+
onlyChanged:
|
|
257
|
+
description: Indicates whether the response contains only changed variables.
|
|
258
|
+
example:
|
|
259
|
+
strict: false
|
|
260
|
+
value: true
|
|
261
|
+
type: boolean
|
|
262
|
+
required: true
|
|
263
|
+
MessageTypeCapability:
|
|
264
|
+
type: object
|
|
265
|
+
properties:
|
|
266
|
+
messageType: string
|
|
267
|
+
formatTypes:
|
|
268
|
+
type: array
|
|
269
|
+
items: FormatTypeCapability
|
|
270
|
+
required: true
|
|
271
|
+
FormatTypeCapability:
|
|
272
|
+
type: object
|
|
273
|
+
properties:
|
|
274
|
+
formatType: string
|
|
275
|
+
/einstein/bots/v1/status:
|
|
276
|
+
get:
|
|
277
|
+
displayName: checkHealthStatus
|
|
278
|
+
description: Returns whether the status of Einstein Bots API is up or down.
|
|
279
|
+
(amf-summary): Check the health status
|
|
280
|
+
(amf-tags):
|
|
281
|
+
- health
|
|
282
|
+
responses:
|
|
283
|
+
'200':
|
|
284
|
+
description: OK
|
|
285
|
+
body:
|
|
286
|
+
application/json:
|
|
287
|
+
type: Status
|
|
288
|
+
'500':
|
|
289
|
+
description: Something went wrong
|
|
290
|
+
body:
|
|
291
|
+
application/json:
|
|
292
|
+
type: Error
|
|
293
|
+
/einstein/bots/v1/v5.3.0/bots/{botId}/sessions:
|
|
294
|
+
post:
|
|
295
|
+
displayName: startSession
|
|
296
|
+
description: Send a message to the bots API to start a new session.
|
|
297
|
+
headers:
|
|
298
|
+
X-Org-Id:
|
|
299
|
+
description: 18-character org ID of the Salesforce org associated with the bot.
|
|
300
|
+
required: true
|
|
301
|
+
example:
|
|
302
|
+
strict: false
|
|
303
|
+
value: 00Dx0000000ALskEAG
|
|
304
|
+
type: string
|
|
305
|
+
X-Request-ID:
|
|
306
|
+
description: Request ID. A UUID in string format created by you to help with request tracking.
|
|
307
|
+
required: false
|
|
308
|
+
example:
|
|
309
|
+
strict: false
|
|
310
|
+
value: 36a73651-a46d-4d16-9a8a-fd436ed62e1a
|
|
311
|
+
type: string
|
|
312
|
+
body:
|
|
313
|
+
application/json: InitMessageEnvelope
|
|
314
|
+
responses:
|
|
315
|
+
'200':
|
|
316
|
+
description: OK
|
|
317
|
+
body:
|
|
318
|
+
application/json:
|
|
319
|
+
type: ResponseEnvelope
|
|
320
|
+
'400':
|
|
321
|
+
description: Bad Request
|
|
322
|
+
body:
|
|
323
|
+
application/json:
|
|
324
|
+
type: Error
|
|
325
|
+
'401':
|
|
326
|
+
description: Access bearer token is missing or invalid
|
|
327
|
+
body:
|
|
328
|
+
application/json:
|
|
329
|
+
type: Error
|
|
330
|
+
'403':
|
|
331
|
+
description: User forbidden from accessing the resource
|
|
332
|
+
body:
|
|
333
|
+
application/json:
|
|
334
|
+
type: Error
|
|
335
|
+
'404':
|
|
336
|
+
description: Resource not found
|
|
337
|
+
body:
|
|
338
|
+
application/json:
|
|
339
|
+
type: Error
|
|
340
|
+
'422':
|
|
341
|
+
description: Any exception that occurred during the request execution
|
|
342
|
+
body:
|
|
343
|
+
application/json:
|
|
344
|
+
type: Error
|
|
345
|
+
'423':
|
|
346
|
+
description: Server is busy and cannot process the request at this time
|
|
347
|
+
body:
|
|
348
|
+
application/json:
|
|
349
|
+
type: Error
|
|
350
|
+
'429':
|
|
351
|
+
description: Too many requests for the server to handle
|
|
352
|
+
body:
|
|
353
|
+
application/json:
|
|
354
|
+
type: Error
|
|
355
|
+
'503':
|
|
356
|
+
description: Service is unavailable possibly because Apex or Flow calls timed out
|
|
357
|
+
body:
|
|
358
|
+
application/json:
|
|
359
|
+
type: Error
|
|
360
|
+
'500':
|
|
361
|
+
description: Something went wrong
|
|
362
|
+
body:
|
|
363
|
+
application/json:
|
|
364
|
+
type: Error
|
|
365
|
+
uriParameters:
|
|
366
|
+
botId:
|
|
367
|
+
description: ID of the Einstein Bot that you want to interact with.
|
|
368
|
+
type: string
|
|
369
|
+
required: true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#%RAML 1.0 Overlay
|
|
2
|
+
extends: ./api.raml
|
|
3
|
+
|
|
4
|
+
uses:
|
|
5
|
+
luvio: luvio://annotations.raml
|
|
6
|
+
|
|
7
|
+
(luvio.keyPrefix): 'einstein-copilot-bot'
|
|
8
|
+
|
|
9
|
+
# Almost no-cache
|
|
10
|
+
(luvio.ttl): 500
|
|
11
|
+
|
|
12
|
+
types:
|
|
13
|
+
ResponseEnvelope:
|
|
14
|
+
(luvio.ttl): 500
|
|
15
|
+
(luvio.key):
|
|
16
|
+
id: sessionId
|
|
17
|
+
|
|
18
|
+
/einstein/bots/v1/status:
|
|
19
|
+
get:
|
|
20
|
+
(luvio.adapter):
|
|
21
|
+
name: getStatus
|
|
22
|
+
/einstein/bots/v1/v5.3.0/bots/{botId}/sessions:
|
|
23
|
+
post:
|
|
24
|
+
(luvio.adapter):
|
|
25
|
+
name: startSession
|