mavenagi 0.0.0-alpha.4 → 0.0.0-alpha.5
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/Client.d.ts +5 -5
- package/Client.js +3 -3
- package/README.md +15 -31
- package/api/resources/actions/client/Client.d.ts +19 -65
- package/api/resources/actions/client/Client.js +31 -292
- package/api/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +1 -7
- package/api/resources/actions/types/ActionParameter.d.ts +1 -0
- package/api/resources/actions/types/ActionRequest.d.ts +21 -0
- package/api/resources/actions/types/ActionResponse.d.ts +25 -0
- package/api/resources/actions/types/index.d.ts +3 -4
- package/api/resources/actions/types/index.js +3 -4
- package/api/resources/commons/types/EntityId.d.ts +14 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/api/resources/commons/types/EntityType.d.ts +14 -0
- package/api/resources/commons/types/EntityType.js +13 -0
- package/api/resources/commons/types/index.d.ts +3 -0
- package/api/resources/commons/types/index.js +3 -0
- package/api/resources/conversation/client/Client.d.ts +20 -3
- package/api/resources/conversation/client/Client.js +118 -25
- package/api/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/api/resources/index.d.ts +1 -1
- package/api/resources/index.js +1 -1
- package/api/resources/knowledge/client/Client.d.ts +2 -2
- package/api/resources/knowledge/client/Client.js +21 -21
- package/api/resources/knowledge/types/KnowledgeBase.d.ts +1 -1
- package/api/resources/triggers/client/Client.d.ts +14 -12
- package/api/resources/triggers/client/Client.js +25 -23
- package/{dist/api/resources/triggers/types/EventTrigger.d.ts → api/resources/triggers/types/EventTriggerBase.d.ts} +1 -3
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/api/resources/triggers/types/index.d.ts +3 -1
- package/api/resources/triggers/types/index.js +3 -1
- package/api/resources/{user → users}/client/Client.d.ts +12 -12
- package/api/resources/{user → users}/client/Client.js +11 -11
- package/dist/Client.d.ts +5 -5
- package/dist/Client.js +3 -3
- package/dist/api/resources/actions/client/Client.d.ts +19 -65
- package/dist/api/resources/actions/client/Client.js +31 -292
- package/dist/api/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +1 -7
- package/dist/api/resources/actions/types/ActionParameter.d.ts +1 -0
- package/dist/api/resources/actions/types/ActionRequest.d.ts +21 -0
- package/dist/api/resources/actions/types/ActionResponse.d.ts +25 -0
- package/dist/api/resources/actions/types/ActionResponse.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +3 -4
- package/dist/api/resources/actions/types/index.js +3 -4
- package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityId.js +4 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityType.js +13 -0
- package/dist/api/resources/commons/types/index.d.ts +3 -0
- package/dist/api/resources/commons/types/index.js +3 -0
- package/dist/api/resources/conversation/client/Client.d.ts +20 -3
- package/dist/api/resources/conversation/client/Client.js +118 -25
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/dist/api/resources/index.d.ts +1 -1
- package/dist/api/resources/index.js +1 -1
- package/dist/api/resources/knowledge/client/Client.d.ts +2 -2
- package/dist/api/resources/knowledge/client/Client.js +21 -21
- package/dist/api/resources/knowledge/types/KnowledgeBase.d.ts +1 -1
- package/dist/api/resources/triggers/client/Client.d.ts +14 -12
- package/dist/api/resources/triggers/client/Client.js +25 -23
- package/{api/resources/triggers/types/EventTrigger.d.ts → dist/api/resources/triggers/types/EventTriggerBase.d.ts} +1 -3
- package/dist/api/resources/triggers/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/triggers/types/index.d.ts +3 -1
- package/dist/api/resources/triggers/types/index.js +3 -1
- package/dist/api/resources/{user → users}/client/Client.d.ts +12 -12
- package/dist/api/resources/{user → users}/client/Client.js +11 -11
- package/dist/serialization/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +2 -5
- package/{serialization/resources/actions/types/Action.js → dist/serialization/resources/actions/types/ActionBase.js} +1 -4
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +1 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +1 -0
- package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/dist/serialization/resources/actions/types/index.d.ts +3 -4
- package/dist/serialization/resources/actions/types/index.js +3 -4
- package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/dist/serialization/resources/commons/types/EntityId.js +14 -0
- package/{serialization/resources/actions/types/ActionSetBase.d.ts → dist/serialization/resources/commons/types/EntityIdBase.d.ts} +3 -4
- package/dist/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EntityType.js +14 -0
- package/dist/serialization/resources/commons/types/index.d.ts +3 -0
- package/dist/serialization/resources/commons/types/index.js +3 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversation/client/index.js +1 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationBase.js +0 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +2 -0
- package/dist/serialization/resources/triggers/types/{EventTrigger.d.ts → EventTriggerBase.d.ts} +2 -3
- package/dist/serialization/resources/triggers/types/{EventTrigger.js → EventTriggerBase.js} +1 -2
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +3 -1
- package/dist/serialization/resources/triggers/types/index.js +3 -1
- package/package.json +1 -1
- package/serialization/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +2 -5
- package/{dist/serialization/resources/actions/types/Action.js → serialization/resources/actions/types/ActionBase.js} +1 -4
- package/serialization/resources/actions/types/ActionParameter.d.ts +1 -0
- package/serialization/resources/actions/types/ActionParameter.js +1 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/serialization/resources/actions/types/index.d.ts +3 -4
- package/serialization/resources/actions/types/index.js +3 -4
- package/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/serialization/resources/commons/types/EntityId.js +14 -0
- package/{dist/serialization/resources/actions/types/ActionSetBase.d.ts → serialization/resources/commons/types/EntityIdBase.d.ts} +3 -4
- package/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/serialization/resources/commons/types/EntityType.js +14 -0
- package/serialization/resources/commons/types/index.d.ts +3 -0
- package/serialization/resources/commons/types/index.js +3 -0
- package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/serialization/resources/conversation/client/index.d.ts +1 -0
- package/serialization/resources/conversation/client/index.js +1 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationBase.js +0 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +2 -0
- package/serialization/resources/triggers/types/{EventTrigger.d.ts → EventTriggerBase.d.ts} +2 -3
- package/serialization/resources/triggers/types/{EventTrigger.js → EventTriggerBase.js} +1 -2
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/serialization/resources/triggers/types/index.d.ts +3 -1
- package/serialization/resources/triggers/types/index.js +3 -1
- package/api/resources/actions/types/ActionSetBase.d.ts +0 -9
- package/api/resources/actions/types/ActionSetRequest.d.ts +0 -6
- package/api/resources/actions/types/ActionSetResponse.d.ts +0 -6
- package/dist/api/resources/actions/types/ActionSetBase.d.ts +0 -9
- package/dist/api/resources/actions/types/ActionSetRequest.d.ts +0 -6
- package/dist/api/resources/actions/types/ActionSetResponse.d.ts +0 -6
- package/dist/serialization/resources/actions/types/ActionSetBase.js +0 -8
- package/dist/serialization/resources/actions/types/ActionSetRequest.d.ts +0 -12
- package/dist/serialization/resources/actions/types/ActionSetRequest.js +0 -6
- package/dist/serialization/resources/actions/types/ActionSetResponse.d.ts +0 -12
- package/dist/serialization/resources/actions/types/ActionSetResponse.js +0 -6
- package/serialization/resources/actions/types/ActionSetBase.js +0 -8
- package/serialization/resources/actions/types/ActionSetRequest.d.ts +0 -12
- package/serialization/resources/actions/types/ActionSetRequest.js +0 -6
- package/serialization/resources/actions/types/ActionSetResponse.d.ts +0 -12
- package/serialization/resources/actions/types/ActionSetResponse.js +0 -6
- /package/api/resources/actions/types/{Action.js → ActionBase.js} +0 -0
- /package/api/resources/actions/types/{ActionSetBase.js → ActionRequest.js} +0 -0
- /package/api/resources/actions/types/{ActionSetRequest.js → ActionResponse.js} +0 -0
- /package/api/resources/{actions/types/ActionSetResponse.js → commons/types/EntityId.js} +0 -0
- /package/api/resources/{triggers/types/EventTrigger.js → commons/types/EntityIdBase.js} +0 -0
- /package/{dist/api/resources/actions/types/Action.js → api/resources/triggers/types/EventTriggerBase.js} +0 -0
- /package/{dist/api/resources/actions/types/ActionSetBase.js → api/resources/triggers/types/EventTriggerRequest.js} +0 -0
- /package/{dist/api/resources/actions/types/ActionSetRequest.js → api/resources/triggers/types/EventTriggerResponse.js} +0 -0
- /package/api/resources/{user → users}/client/index.d.ts +0 -0
- /package/api/resources/{user → users}/client/index.js +0 -0
- /package/api/resources/{user → users}/index.d.ts +0 -0
- /package/api/resources/{user → users}/index.js +0 -0
- /package/dist/api/resources/actions/types/{ActionSetResponse.js → ActionBase.js} +0 -0
- /package/dist/api/resources/{triggers/types/EventTrigger.js → actions/types/ActionRequest.js} +0 -0
- /package/dist/api/resources/{user → users}/client/index.d.ts +0 -0
- /package/dist/api/resources/{user → users}/client/index.js +0 -0
- /package/dist/api/resources/{user → users}/index.d.ts +0 -0
- /package/dist/api/resources/{user → users}/index.js +0 -0
|
@@ -33,8 +33,8 @@ export class Conversation {
|
|
|
33
33
|
* @example
|
|
34
34
|
* await client.conversation.initialize({
|
|
35
35
|
* messages: [{}],
|
|
36
|
-
* id: "string",
|
|
37
36
|
* context: {},
|
|
37
|
+
* id: "string",
|
|
38
38
|
* responseConfig: {
|
|
39
39
|
* capabilities: [MavenAGI.Capability.Markdown],
|
|
40
40
|
* isCopilot: true,
|
|
@@ -50,11 +50,11 @@ export class Conversation {
|
|
|
50
50
|
method: "POST",
|
|
51
51
|
headers: {
|
|
52
52
|
Authorization: yield this._getAuthorizationHeader(),
|
|
53
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
54
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
53
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
54
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
55
55
|
"X-Fern-Language": "JavaScript",
|
|
56
56
|
"X-Fern-SDK-Name": "mavenagi",
|
|
57
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
57
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
58
58
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
59
59
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
60
60
|
},
|
|
@@ -138,11 +138,11 @@ export class Conversation {
|
|
|
138
138
|
method: "GET",
|
|
139
139
|
headers: {
|
|
140
140
|
Authorization: yield this._getAuthorizationHeader(),
|
|
141
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
142
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
141
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
142
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
143
143
|
"X-Fern-Language": "JavaScript",
|
|
144
144
|
"X-Fern-SDK-Name": "mavenagi",
|
|
145
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
145
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
146
146
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
147
147
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
148
148
|
},
|
|
@@ -231,11 +231,11 @@ export class Conversation {
|
|
|
231
231
|
method: "POST",
|
|
232
232
|
headers: {
|
|
233
233
|
Authorization: yield this._getAuthorizationHeader(),
|
|
234
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
235
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
234
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
235
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
236
236
|
"X-Fern-Language": "JavaScript",
|
|
237
237
|
"X-Fern-SDK-Name": "mavenagi",
|
|
238
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
238
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
239
239
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
240
240
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
241
241
|
},
|
|
@@ -327,11 +327,11 @@ export class Conversation {
|
|
|
327
327
|
method: "POST",
|
|
328
328
|
headers: {
|
|
329
329
|
Authorization: yield this._getAuthorizationHeader(),
|
|
330
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
331
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
330
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
331
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
332
332
|
"X-Fern-Language": "JavaScript",
|
|
333
333
|
"X-Fern-SDK-Name": "mavenagi",
|
|
334
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
334
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
335
335
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
336
336
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
337
337
|
},
|
|
@@ -405,11 +405,11 @@ export class Conversation {
|
|
|
405
405
|
method: "POST",
|
|
406
406
|
headers: {
|
|
407
407
|
Authorization: yield this._getAuthorizationHeader(),
|
|
408
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
409
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
408
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
409
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
410
410
|
"X-Fern-Language": "JavaScript",
|
|
411
411
|
"X-Fern-SDK-Name": "mavenagi",
|
|
412
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
412
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
413
413
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
414
414
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
415
415
|
},
|
|
@@ -507,11 +507,11 @@ export class Conversation {
|
|
|
507
507
|
method: "POST",
|
|
508
508
|
headers: {
|
|
509
509
|
Authorization: yield this._getAuthorizationHeader(),
|
|
510
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
511
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
510
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
511
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
512
512
|
"X-Fern-Language": "JavaScript",
|
|
513
513
|
"X-Fern-SDK-Name": "mavenagi",
|
|
514
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
514
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
515
515
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
516
516
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
517
517
|
},
|
|
@@ -603,11 +603,11 @@ export class Conversation {
|
|
|
603
603
|
method: "POST",
|
|
604
604
|
headers: {
|
|
605
605
|
Authorization: yield this._getAuthorizationHeader(),
|
|
606
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
607
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
606
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
607
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
608
608
|
"X-Fern-Language": "JavaScript",
|
|
609
609
|
"X-Fern-SDK-Name": "mavenagi",
|
|
610
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
610
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
611
611
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
612
612
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
613
613
|
},
|
|
@@ -704,11 +704,11 @@ export class Conversation {
|
|
|
704
704
|
method: "POST",
|
|
705
705
|
headers: {
|
|
706
706
|
Authorization: yield this._getAuthorizationHeader(),
|
|
707
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
708
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
707
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
708
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
709
709
|
"X-Fern-Language": "JavaScript",
|
|
710
710
|
"X-Fern-SDK-Name": "mavenagi",
|
|
711
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
711
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
712
712
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
713
713
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
714
714
|
},
|
|
@@ -771,6 +771,99 @@ export class Conversation {
|
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
|
+
/**
|
|
775
|
+
* Add metadata to an existing conversation's Context. If a metadata field already exists, it will be overwritten.
|
|
776
|
+
*
|
|
777
|
+
* @param {string} conversationId - The ID of a conversation the metadata being added belongs to
|
|
778
|
+
* @param {Record<string, string>} request
|
|
779
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
780
|
+
*
|
|
781
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
782
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
783
|
+
* @throws {@link MavenAGI.ServerError}
|
|
784
|
+
*
|
|
785
|
+
* @example
|
|
786
|
+
* await client.conversation.addConversationMetadata("string", {
|
|
787
|
+
* "string": "string"
|
|
788
|
+
* })
|
|
789
|
+
*/
|
|
790
|
+
addConversationMetadata(conversationId, request, requestOptions) {
|
|
791
|
+
var _a, _b;
|
|
792
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
793
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
794
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/metadata`),
|
|
795
|
+
method: "POST",
|
|
796
|
+
headers: {
|
|
797
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
798
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
799
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
800
|
+
"X-Fern-Language": "JavaScript",
|
|
801
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
802
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
803
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
804
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
805
|
+
},
|
|
806
|
+
contentType: "application/json",
|
|
807
|
+
body: yield serializers.conversation.addConversationMetadata.Request.jsonOrThrow(request, {
|
|
808
|
+
unrecognizedObjectKeys: "strip",
|
|
809
|
+
}),
|
|
810
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
811
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
812
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
813
|
+
});
|
|
814
|
+
if (_response.ok) {
|
|
815
|
+
return yield serializers.conversation.addConversationMetadata.Response.parseOrThrow(_response.body, {
|
|
816
|
+
unrecognizedObjectKeys: "passthrough",
|
|
817
|
+
allowUnrecognizedUnionMembers: true,
|
|
818
|
+
allowUnrecognizedEnumValues: true,
|
|
819
|
+
breadcrumbsPrefix: ["response"],
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
if (_response.error.reason === "status-code") {
|
|
823
|
+
switch (_response.error.statusCode) {
|
|
824
|
+
case 404:
|
|
825
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
826
|
+
unrecognizedObjectKeys: "passthrough",
|
|
827
|
+
allowUnrecognizedUnionMembers: true,
|
|
828
|
+
allowUnrecognizedEnumValues: true,
|
|
829
|
+
breadcrumbsPrefix: ["response"],
|
|
830
|
+
}));
|
|
831
|
+
case 400:
|
|
832
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
833
|
+
unrecognizedObjectKeys: "passthrough",
|
|
834
|
+
allowUnrecognizedUnionMembers: true,
|
|
835
|
+
allowUnrecognizedEnumValues: true,
|
|
836
|
+
breadcrumbsPrefix: ["response"],
|
|
837
|
+
}));
|
|
838
|
+
case 500:
|
|
839
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
840
|
+
unrecognizedObjectKeys: "passthrough",
|
|
841
|
+
allowUnrecognizedUnionMembers: true,
|
|
842
|
+
allowUnrecognizedEnumValues: true,
|
|
843
|
+
breadcrumbsPrefix: ["response"],
|
|
844
|
+
}));
|
|
845
|
+
default:
|
|
846
|
+
throw new errors.MavenAGIError({
|
|
847
|
+
statusCode: _response.error.statusCode,
|
|
848
|
+
body: _response.error.body,
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
switch (_response.error.reason) {
|
|
853
|
+
case "non-json":
|
|
854
|
+
throw new errors.MavenAGIError({
|
|
855
|
+
statusCode: _response.error.statusCode,
|
|
856
|
+
body: _response.error.rawBody,
|
|
857
|
+
});
|
|
858
|
+
case "timeout":
|
|
859
|
+
throw new errors.MavenAGITimeoutError();
|
|
860
|
+
case "unknown":
|
|
861
|
+
throw new errors.MavenAGIError({
|
|
862
|
+
message: _response.error.errorMessage,
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
}
|
|
774
867
|
_getAuthorizationHeader() {
|
|
775
868
|
var _a, _b;
|
|
776
869
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5,8 +5,6 @@ import * as MavenAGI from "../../../index";
|
|
|
5
5
|
export interface ConversationBase {
|
|
6
6
|
/** Externally supplied ID to uniquely identify this conversation */
|
|
7
7
|
id: string;
|
|
8
|
-
/** The context of the conversation */
|
|
9
|
-
context?: MavenAGI.ConversationContext;
|
|
10
8
|
/** Optional configurations for responses to this conversation */
|
|
11
9
|
responseConfig?: MavenAGI.ResponseConfig;
|
|
12
10
|
}
|
|
@@ -5,4 +5,6 @@ import * as MavenAGI from "../../../index";
|
|
|
5
5
|
export interface ConversationRequest extends MavenAGI.ConversationBase {
|
|
6
6
|
/** The messages in the conversation */
|
|
7
7
|
messages: MavenAGI.ConversationMessageRequest[];
|
|
8
|
+
/** The context of the conversation */
|
|
9
|
+
context?: MavenAGI.ConversationContext;
|
|
8
10
|
}
|
|
@@ -5,4 +5,6 @@ import * as MavenAGI from "../../../index";
|
|
|
5
5
|
export interface ConversationResponse extends MavenAGI.ConversationBase {
|
|
6
6
|
/** The messages in the conversation */
|
|
7
7
|
messages: MavenAGI.ConversationMessageResponse[];
|
|
8
|
+
/** The context of the conversation */
|
|
9
|
+
context: MavenAGI.ConversationContext;
|
|
8
10
|
}
|
|
@@ -9,8 +9,8 @@ export declare namespace Knowledge {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
xOrganizationId: core.Supplier<string>;
|
|
13
|
+
xAgentId: core.Supplier<string>;
|
|
14
14
|
fetcher?: core.FetchFunction;
|
|
15
15
|
}
|
|
16
16
|
interface RequestOptions {
|
|
@@ -46,11 +46,11 @@ export class Knowledge {
|
|
|
46
46
|
method: "POST",
|
|
47
47
|
headers: {
|
|
48
48
|
Authorization: yield this._getAuthorizationHeader(),
|
|
49
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
50
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
49
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
50
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
51
51
|
"X-Fern-Language": "JavaScript",
|
|
52
52
|
"X-Fern-SDK-Name": "mavenagi",
|
|
53
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
53
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
54
54
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
55
55
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
56
56
|
},
|
|
@@ -134,11 +134,11 @@ export class Knowledge {
|
|
|
134
134
|
method: "GET",
|
|
135
135
|
headers: {
|
|
136
136
|
Authorization: yield this._getAuthorizationHeader(),
|
|
137
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
138
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
137
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
138
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
139
139
|
"X-Fern-Language": "JavaScript",
|
|
140
140
|
"X-Fern-SDK-Name": "mavenagi",
|
|
141
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
141
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
142
142
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
143
143
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
144
144
|
},
|
|
@@ -224,11 +224,11 @@ export class Knowledge {
|
|
|
224
224
|
method: "POST",
|
|
225
225
|
headers: {
|
|
226
226
|
Authorization: yield this._getAuthorizationHeader(),
|
|
227
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
228
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
227
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
228
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
229
229
|
"X-Fern-Language": "JavaScript",
|
|
230
230
|
"X-Fern-SDK-Name": "mavenagi",
|
|
231
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
231
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
232
232
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
233
233
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
234
234
|
},
|
|
@@ -314,11 +314,11 @@ export class Knowledge {
|
|
|
314
314
|
method: "POST",
|
|
315
315
|
headers: {
|
|
316
316
|
Authorization: yield this._getAuthorizationHeader(),
|
|
317
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
318
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
317
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
318
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
319
319
|
"X-Fern-Language": "JavaScript",
|
|
320
320
|
"X-Fern-SDK-Name": "mavenagi",
|
|
321
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
321
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
322
322
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
323
323
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
324
324
|
},
|
|
@@ -408,11 +408,11 @@ export class Knowledge {
|
|
|
408
408
|
method: "POST",
|
|
409
409
|
headers: {
|
|
410
410
|
Authorization: yield this._getAuthorizationHeader(),
|
|
411
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
412
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
411
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
412
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
413
413
|
"X-Fern-Language": "JavaScript",
|
|
414
414
|
"X-Fern-SDK-Name": "mavenagi",
|
|
415
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
415
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
416
416
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
417
417
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
418
418
|
},
|
|
@@ -507,11 +507,11 @@ export class Knowledge {
|
|
|
507
507
|
method: "PUT",
|
|
508
508
|
headers: {
|
|
509
509
|
Authorization: yield this._getAuthorizationHeader(),
|
|
510
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
511
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
510
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
511
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
512
512
|
"X-Fern-Language": "JavaScript",
|
|
513
513
|
"X-Fern-SDK-Name": "mavenagi",
|
|
514
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
514
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
515
515
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
516
516
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
517
517
|
},
|
|
@@ -598,11 +598,11 @@ export class Knowledge {
|
|
|
598
598
|
method: "DELETE",
|
|
599
599
|
headers: {
|
|
600
600
|
Authorization: yield this._getAuthorizationHeader(),
|
|
601
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
602
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
601
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
602
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
603
603
|
"X-Fern-Language": "JavaScript",
|
|
604
604
|
"X-Fern-SDK-Name": "mavenagi",
|
|
605
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
605
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
606
606
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
607
607
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
608
608
|
},
|
|
@@ -5,7 +5,7 @@ import * as MavenAGI from "../../../index";
|
|
|
5
5
|
export interface KnowledgeBase extends MavenAGI.KnowledgeBaseId {
|
|
6
6
|
/** The name of the knowledge base */
|
|
7
7
|
displayName: string;
|
|
8
|
-
/** The type of the knowledge base */
|
|
8
|
+
/** The type of the knowledge base. Can not be changed once created. */
|
|
9
9
|
type: MavenAGI.KnowledgeBaseType;
|
|
10
10
|
/** The URL to pull content from for RSS and URL knowledge bases. */
|
|
11
11
|
url?: string;
|
|
@@ -9,8 +9,8 @@ export declare namespace Triggers {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
xOrganizationId: core.Supplier<string>;
|
|
13
|
+
xAgentId: core.Supplier<string>;
|
|
14
14
|
fetcher?: core.FetchFunction;
|
|
15
15
|
}
|
|
16
16
|
interface RequestOptions {
|
|
@@ -25,7 +25,7 @@ export declare class Triggers {
|
|
|
25
25
|
/**
|
|
26
26
|
* Update an event trigger or create it if it doesn't exist.
|
|
27
27
|
*
|
|
28
|
-
* @param {MavenAGI.
|
|
28
|
+
* @param {MavenAGI.EventTriggerRequest} request
|
|
29
29
|
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
30
|
*
|
|
31
31
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -34,16 +34,18 @@ export declare class Triggers {
|
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* await client.triggers.registerTrigger({
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* entityId: {
|
|
38
|
+
* referenceId: "store-in-snowflake"
|
|
39
|
+
* },
|
|
40
|
+
* description: "Stores conversation data in Snowflake",
|
|
39
41
|
* type: MavenAGI.EventTriggerType.ConversationCreated
|
|
40
42
|
* })
|
|
41
43
|
*/
|
|
42
|
-
registerTrigger(request: MavenAGI.
|
|
44
|
+
registerTrigger(request: MavenAGI.EventTriggerRequest, requestOptions?: Triggers.RequestOptions): Promise<MavenAGI.EventTriggerResponse>;
|
|
43
45
|
/**
|
|
44
46
|
* Get an event trigger by its supplied ID
|
|
45
47
|
*
|
|
46
|
-
* @param {string}
|
|
48
|
+
* @param {string} referenceId - The reference ID of the event trigger to get. All other entity ID fields are inferred from the request.
|
|
47
49
|
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
50
|
*
|
|
49
51
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -51,13 +53,13 @@ export declare class Triggers {
|
|
|
51
53
|
* @throws {@link MavenAGI.ServerError}
|
|
52
54
|
*
|
|
53
55
|
* @example
|
|
54
|
-
* await client.triggers.getTrigger("
|
|
56
|
+
* await client.triggers.getTrigger("store-in-snowflake")
|
|
55
57
|
*/
|
|
56
|
-
getTrigger(
|
|
58
|
+
getTrigger(referenceId: string, requestOptions?: Triggers.RequestOptions): Promise<MavenAGI.EventTriggerResponse>;
|
|
57
59
|
/**
|
|
58
60
|
* Unregister an event trigger
|
|
59
61
|
*
|
|
60
|
-
* @param {string}
|
|
62
|
+
* @param {string} referenceId - The reference ID of the event trigger to unregister. All other entity ID fields are inferred from the request.
|
|
61
63
|
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
64
|
*
|
|
63
65
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -65,8 +67,8 @@ export declare class Triggers {
|
|
|
65
67
|
* @throws {@link MavenAGI.ServerError}
|
|
66
68
|
*
|
|
67
69
|
* @example
|
|
68
|
-
* await client.triggers.unregisterTrigger("
|
|
70
|
+
* await client.triggers.unregisterTrigger("store-in-snowflake")
|
|
69
71
|
*/
|
|
70
|
-
unregisterTrigger(
|
|
72
|
+
unregisterTrigger(referenceId: string, requestOptions?: Triggers.RequestOptions): Promise<void>;
|
|
71
73
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
72
74
|
}
|
|
@@ -23,7 +23,7 @@ export class Triggers {
|
|
|
23
23
|
/**
|
|
24
24
|
* Update an event trigger or create it if it doesn't exist.
|
|
25
25
|
*
|
|
26
|
-
* @param {MavenAGI.
|
|
26
|
+
* @param {MavenAGI.EventTriggerRequest} request
|
|
27
27
|
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
29
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -32,8 +32,10 @@ export class Triggers {
|
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* await client.triggers.registerTrigger({
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* entityId: {
|
|
36
|
+
* referenceId: "store-in-snowflake"
|
|
37
|
+
* },
|
|
38
|
+
* description: "Stores conversation data in Snowflake",
|
|
37
39
|
* type: MavenAGI.EventTriggerType.ConversationCreated
|
|
38
40
|
* })
|
|
39
41
|
*/
|
|
@@ -45,22 +47,22 @@ export class Triggers {
|
|
|
45
47
|
method: "PUT",
|
|
46
48
|
headers: {
|
|
47
49
|
Authorization: yield this._getAuthorizationHeader(),
|
|
48
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
49
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
50
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
51
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
50
52
|
"X-Fern-Language": "JavaScript",
|
|
51
53
|
"X-Fern-SDK-Name": "mavenagi",
|
|
52
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
54
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
53
55
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
54
56
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
55
57
|
},
|
|
56
58
|
contentType: "application/json",
|
|
57
|
-
body: yield serializers.
|
|
59
|
+
body: yield serializers.EventTriggerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
58
60
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
59
61
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
60
62
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
61
63
|
});
|
|
62
64
|
if (_response.ok) {
|
|
63
|
-
return yield serializers.
|
|
65
|
+
return yield serializers.EventTriggerResponse.parseOrThrow(_response.body, {
|
|
64
66
|
unrecognizedObjectKeys: "passthrough",
|
|
65
67
|
allowUnrecognizedUnionMembers: true,
|
|
66
68
|
allowUnrecognizedEnumValues: true,
|
|
@@ -115,7 +117,7 @@ export class Triggers {
|
|
|
115
117
|
/**
|
|
116
118
|
* Get an event trigger by its supplied ID
|
|
117
119
|
*
|
|
118
|
-
* @param {string}
|
|
120
|
+
* @param {string} referenceId - The reference ID of the event trigger to get. All other entity ID fields are inferred from the request.
|
|
119
121
|
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
122
|
*
|
|
121
123
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -123,21 +125,21 @@ export class Triggers {
|
|
|
123
125
|
* @throws {@link MavenAGI.ServerError}
|
|
124
126
|
*
|
|
125
127
|
* @example
|
|
126
|
-
* await client.triggers.getTrigger("
|
|
128
|
+
* await client.triggers.getTrigger("store-in-snowflake")
|
|
127
129
|
*/
|
|
128
|
-
getTrigger(
|
|
130
|
+
getTrigger(referenceId, requestOptions) {
|
|
129
131
|
var _a, _b;
|
|
130
132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
133
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
132
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/triggers/${encodeURIComponent(
|
|
134
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/triggers/${encodeURIComponent(referenceId)}`),
|
|
133
135
|
method: "GET",
|
|
134
136
|
headers: {
|
|
135
137
|
Authorization: yield this._getAuthorizationHeader(),
|
|
136
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
137
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
138
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
139
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
138
140
|
"X-Fern-Language": "JavaScript",
|
|
139
141
|
"X-Fern-SDK-Name": "mavenagi",
|
|
140
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
142
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
141
143
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
142
144
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
143
145
|
},
|
|
@@ -147,7 +149,7 @@ export class Triggers {
|
|
|
147
149
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
148
150
|
});
|
|
149
151
|
if (_response.ok) {
|
|
150
|
-
return yield serializers.
|
|
152
|
+
return yield serializers.EventTriggerResponse.parseOrThrow(_response.body, {
|
|
151
153
|
unrecognizedObjectKeys: "passthrough",
|
|
152
154
|
allowUnrecognizedUnionMembers: true,
|
|
153
155
|
allowUnrecognizedEnumValues: true,
|
|
@@ -202,7 +204,7 @@ export class Triggers {
|
|
|
202
204
|
/**
|
|
203
205
|
* Unregister an event trigger
|
|
204
206
|
*
|
|
205
|
-
* @param {string}
|
|
207
|
+
* @param {string} referenceId - The reference ID of the event trigger to unregister. All other entity ID fields are inferred from the request.
|
|
206
208
|
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
207
209
|
*
|
|
208
210
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -210,21 +212,21 @@ export class Triggers {
|
|
|
210
212
|
* @throws {@link MavenAGI.ServerError}
|
|
211
213
|
*
|
|
212
214
|
* @example
|
|
213
|
-
* await client.triggers.unregisterTrigger("
|
|
215
|
+
* await client.triggers.unregisterTrigger("store-in-snowflake")
|
|
214
216
|
*/
|
|
215
|
-
unregisterTrigger(
|
|
217
|
+
unregisterTrigger(referenceId, requestOptions) {
|
|
216
218
|
var _a, _b;
|
|
217
219
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
220
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
219
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/triggers/${encodeURIComponent(
|
|
221
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/triggers/${encodeURIComponent(referenceId)}`),
|
|
220
222
|
method: "DELETE",
|
|
221
223
|
headers: {
|
|
222
224
|
Authorization: yield this._getAuthorizationHeader(),
|
|
223
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
224
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
225
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
226
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
225
227
|
"X-Fern-Language": "JavaScript",
|
|
226
228
|
"X-Fern-SDK-Name": "mavenagi",
|
|
227
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
229
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
228
230
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
229
231
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
230
232
|
},
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as MavenAGI from "../../../index";
|
|
5
|
-
export interface
|
|
6
|
-
/** Externally supplied ID to uniquely identify this event trigger */
|
|
7
|
-
id: string;
|
|
5
|
+
export interface EventTriggerBase {
|
|
8
6
|
/** The description of what the event trigger does, shown in the Maven Dashboard */
|
|
9
7
|
description: string;
|
|
10
8
|
/** The type of event trigger this app wishes to handle */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* entityId: {
|
|
9
|
+
* referenceId: "store-in-snowflake"
|
|
10
|
+
* },
|
|
11
|
+
* description: "Stores conversation data in Snowflake",
|
|
12
|
+
* type: MavenAGI.EventTriggerType.ConversationCreated
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface EventTriggerRequest extends MavenAGI.EventTriggerBase {
|
|
16
|
+
/** ID that uniquely identifies this event trigger */
|
|
17
|
+
entityId: MavenAGI.EntityIdBase;
|
|
18
|
+
}
|