@caruuto/caruuto-js 0.9.0 → 0.9.1
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/index.js +1 -0
- package/lib/extensions/ai.js +10 -10
- package/lib/helpers.js +1 -1
- package/lib/terminators.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
package/lib/extensions/ai.js
CHANGED
|
@@ -28,7 +28,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
28
28
|
const body = buildRequestBody(opts, false)
|
|
29
29
|
const response = await doFetch(
|
|
30
30
|
this,
|
|
31
|
-
`${this.options.caruutoUrl}/
|
|
31
|
+
`${this.options.caruutoUrl}/ai/external`,
|
|
32
32
|
body
|
|
33
33
|
)
|
|
34
34
|
return response.status === 204 ? undefined : response.json()
|
|
@@ -49,7 +49,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
49
49
|
const body = buildRequestBody(opts, true)
|
|
50
50
|
const response = await doFetch(
|
|
51
51
|
this,
|
|
52
|
-
`${this.options.caruutoUrl}/
|
|
52
|
+
`${this.options.caruutoUrl}/ai/external`,
|
|
53
53
|
body
|
|
54
54
|
)
|
|
55
55
|
|
|
@@ -117,7 +117,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
117
117
|
throw new Error('projectId is required')
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
const url = `${this.options.caruutoUrl}/
|
|
120
|
+
const url = `${this.options.caruutoUrl}/ai/conversations/${conversationId}/end`
|
|
121
121
|
const response = await doFetch(this, url, { project_id: projectId })
|
|
122
122
|
return response.json()
|
|
123
123
|
}.bind(clientInstance),
|
|
@@ -167,7 +167,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
167
167
|
|
|
168
168
|
const response = await doFetch(
|
|
169
169
|
this,
|
|
170
|
-
`${this.options.caruutoUrl}/
|
|
170
|
+
`${this.options.caruutoUrl}/ai/context`,
|
|
171
171
|
body
|
|
172
172
|
)
|
|
173
173
|
return response.json()
|
|
@@ -228,7 +228,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
228
228
|
if (!sourceId) throw new Error('sourceId is required')
|
|
229
229
|
if (!projectId) throw new Error('projectId is required')
|
|
230
230
|
|
|
231
|
-
const url = `${this.options.caruutoUrl}/
|
|
231
|
+
const url = `${this.options.caruutoUrl}/ai/conversations/${sourceId}/fork`
|
|
232
232
|
const response = await doFetch(this, url, {
|
|
233
233
|
project_id: projectId,
|
|
234
234
|
source
|
|
@@ -244,7 +244,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
244
244
|
if (!conversationId) throw new Error('conversationId is required')
|
|
245
245
|
if (!projectId) throw new Error('projectId is required')
|
|
246
246
|
|
|
247
|
-
const url = `${this.options.caruutoUrl}/
|
|
247
|
+
const url = `${this.options.caruutoUrl}/ai/conversations/${conversationId}/share`
|
|
248
248
|
const response = await doFetch(this, url, {
|
|
249
249
|
project_id: projectId,
|
|
250
250
|
visibility
|
|
@@ -264,7 +264,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
264
264
|
if (!conversationId) throw new Error('conversationId is required')
|
|
265
265
|
|
|
266
266
|
const fetch = this.options.fetch || undici.fetch
|
|
267
|
-
const url = `${this.options.caruutoUrl}/
|
|
267
|
+
const url = `${this.options.caruutoUrl}/ai/conversations/${conversationId}/public`
|
|
268
268
|
|
|
269
269
|
const response = await fetch(url, { method: 'GET' })
|
|
270
270
|
|
|
@@ -292,7 +292,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
292
292
|
|
|
293
293
|
const url = `${
|
|
294
294
|
this.options.caruutoUrl
|
|
295
|
-
}/
|
|
295
|
+
}/ai/conversations/${conversationId}?project_id=${encodeURIComponent(
|
|
296
296
|
projectId
|
|
297
297
|
)}`
|
|
298
298
|
const response = await doGet(this, url)
|
|
@@ -334,7 +334,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
334
334
|
if (leadEmail) body.lead_email = leadEmail
|
|
335
335
|
if (leadName) body.lead_name = leadName
|
|
336
336
|
|
|
337
|
-
const url = `${this.options.caruutoUrl}/
|
|
337
|
+
const url = `${this.options.caruutoUrl}/ai/conversations/${conversationId}/turn`
|
|
338
338
|
const response = await doFetch(this, url, body)
|
|
339
339
|
return response.json()
|
|
340
340
|
}.bind(clientInstance),
|
|
@@ -377,7 +377,7 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
377
377
|
if (linkLabel) body.link_label = linkLabel
|
|
378
378
|
if (messageIndex !== undefined) body.message_index = messageIndex
|
|
379
379
|
|
|
380
|
-
const trackUrl = `${this.options.caruutoUrl}/
|
|
380
|
+
const trackUrl = `${this.options.caruutoUrl}/ai/conversations/${conversationId}/link-click`
|
|
381
381
|
const response = await doFetch(this, trackUrl, body)
|
|
382
382
|
return response.json()
|
|
383
383
|
}.bind(clientInstance)
|
package/lib/helpers.js
CHANGED
package/lib/terminators.js
CHANGED