mavenagi 1.2.4 → 1.2.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.js +2 -2
- package/README.md +390 -0
- package/api/resources/actions/client/Client.d.ts +11 -1
- package/api/resources/actions/client/Client.js +11 -1
- package/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
- package/api/resources/agents/client/Client.d.ts +2 -2
- package/api/resources/agents/client/Client.js +5 -5
- package/api/resources/agents/client/index.d.ts +1 -0
- package/api/resources/agents/client/index.js +15 -0
- package/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
- package/api/resources/agents/client/requests/index.d.ts +1 -0
- package/api/resources/agents/client/requests/index.js +2 -0
- package/api/resources/agents/types/Agent.d.ts +8 -0
- package/api/resources/agents/types/AgentPrompting.d.ts +23 -0
- package/api/resources/agents/types/index.d.ts +1 -1
- package/api/resources/agents/types/index.js +1 -1
- package/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
- package/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
- package/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
- package/api/resources/commons/types/ActionResponse.d.ts +7 -0
- package/api/resources/commons/types/SimulationContext.d.ts +6 -0
- package/api/resources/conversation/client/Client.d.ts +18 -1
- package/api/resources/conversation/client/Client.js +91 -1
- package/api/resources/events/client/Client.d.ts +10 -0
- package/api/resources/events/client/Client.js +83 -0
- package/api/resources/index.d.ts +1 -0
- package/api/resources/index.js +1 -0
- package/api/resources/knowledge/client/Client.d.ts +32 -1
- package/api/resources/knowledge/client/Client.js +104 -1
- package/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
- package/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
- package/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
- package/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
- package/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
- package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
- package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
- package/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
- package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
- package/api/resources/knowledge/types/index.d.ts +1 -0
- package/api/resources/knowledge/types/index.js +1 -0
- package/dist/Client.js +2 -2
- package/dist/api/resources/actions/client/Client.d.ts +11 -1
- package/dist/api/resources/actions/client/Client.js +11 -1
- package/dist/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
- package/dist/api/resources/agents/client/Client.d.ts +2 -2
- package/dist/api/resources/agents/client/Client.js +5 -5
- package/dist/api/resources/agents/client/index.d.ts +1 -0
- package/dist/api/resources/agents/client/index.js +15 -0
- package/dist/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
- package/dist/api/resources/agents/client/requests/AgentPatchRequest.js +3 -0
- package/dist/api/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/api/resources/agents/client/requests/index.js +2 -0
- package/dist/api/resources/agents/types/Agent.d.ts +8 -0
- package/dist/api/resources/agents/types/AgentPrompting.d.ts +23 -0
- package/dist/api/resources/agents/types/AgentPrompting.js +3 -0
- package/dist/api/resources/agents/types/index.d.ts +1 -1
- package/dist/api/resources/agents/types/index.js +1 -1
- package/dist/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
- package/dist/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
- package/dist/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
- package/dist/api/resources/commons/types/ActionResponse.d.ts +7 -0
- package/dist/api/resources/commons/types/SimulationContext.d.ts +6 -0
- package/dist/api/resources/conversation/client/Client.d.ts +18 -1
- package/dist/api/resources/conversation/client/Client.js +91 -1
- package/dist/api/resources/events/client/Client.d.ts +10 -0
- package/dist/api/resources/events/client/Client.js +83 -0
- package/dist/api/resources/index.d.ts +1 -0
- package/dist/api/resources/index.js +1 -0
- package/dist/api/resources/knowledge/client/Client.d.ts +32 -1
- package/dist/api/resources/knowledge/client/Client.js +104 -1
- package/dist/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
- package/dist/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
- package/dist/api/resources/knowledge/types/index.d.ts +1 -0
- package/dist/api/resources/knowledge/types/index.js +1 -0
- package/dist/serialization/resources/agents/client/index.d.ts +1 -0
- package/dist/serialization/resources/agents/client/index.js +4 -0
- package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
- package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
- package/dist/serialization/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/agents/client/requests/index.js +5 -0
- package/dist/serialization/resources/agents/types/Agent.d.ts +3 -0
- package/dist/serialization/resources/agents/types/Agent.js +3 -0
- package/dist/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
- package/dist/serialization/resources/agents/types/AgentPrompting.js +46 -0
- package/dist/serialization/resources/agents/types/index.d.ts +1 -1
- package/dist/serialization/resources/agents/types/index.js +1 -1
- package/dist/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
- package/dist/serialization/resources/commons/types/SimulationContext.js +1 -0
- package/dist/serialization/resources/index.d.ts +1 -0
- package/dist/serialization/resources/index.js +1 -0
- package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
- package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
- package/dist/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/index.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +237 -4
- package/serialization/resources/agents/client/index.d.ts +1 -0
- package/serialization/resources/agents/client/index.js +4 -0
- package/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
- package/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
- package/serialization/resources/agents/client/requests/index.d.ts +1 -0
- package/serialization/resources/agents/client/requests/index.js +5 -0
- package/serialization/resources/agents/types/Agent.d.ts +3 -0
- package/serialization/resources/agents/types/Agent.js +3 -0
- package/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
- package/serialization/resources/agents/types/AgentPrompting.js +46 -0
- package/serialization/resources/agents/types/index.d.ts +1 -1
- package/serialization/resources/agents/types/index.js +1 -1
- package/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
- package/serialization/resources/commons/types/SimulationContext.js +1 -0
- package/serialization/resources/index.d.ts +1 -0
- package/serialization/resources/index.js +1 -0
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
- package/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
- package/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/serialization/resources/knowledge/types/index.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
- package/dist/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
- package/dist/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
- package/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
- /package/api/resources/agents/{types → client/requests}/AgentPatchRequest.js +0 -0
- /package/{dist/api/resources/agents/types/AgentPatchRequest.js → api/resources/agents/types/AgentPrompting.js} +0 -0
|
@@ -24,6 +24,8 @@ export interface KnowledgeDocumentRequest extends MavenAGI.BaseKnowledgeDocument
|
|
|
24
24
|
/** ID that uniquely identifies which knowledge base version to create the document in. If not provided will use the most recent version of the knowledge base. */
|
|
25
25
|
versionId?: MavenAGI.EntityIdWithoutAgent;
|
|
26
26
|
contentType: MavenAGI.KnowledgeDocumentContentType;
|
|
27
|
+
/** The title of the document. Will be shown as part of answers. */
|
|
28
|
+
title: string;
|
|
27
29
|
/** The content of the document. Not shown directly to users. May be provided in HTML or markdown. HTML will be converted to markdown automatically. Images are not currently supported and will be ignored. */
|
|
28
30
|
content: string;
|
|
29
31
|
/** Metadata for the knowledge document. */
|
|
@@ -7,4 +7,6 @@ export interface KnowledgeDocumentSearchResponse extends MavenAGI.BaseKnowledgeD
|
|
|
7
7
|
* This may be missing on legacy documents.
|
|
8
8
|
*/
|
|
9
9
|
knowledgeBaseVersionId?: MavenAGI.EntityId;
|
|
10
|
+
/** The title of the document. Will be shown as part of answers. May be missing on legacy documents. */
|
|
11
|
+
title?: string;
|
|
10
12
|
}
|
|
@@ -40,3 +40,4 @@ __exportStar(require("./KnowledgeDocumentSearchRequest"), exports);
|
|
|
40
40
|
__exportStar(require("./KnowledgeDocumentSearchResponse"), exports);
|
|
41
41
|
__exportStar(require("./KnowledgeDocumentsResponse"), exports);
|
|
42
42
|
__exportStar(require("./KnowledgeBaseVersionsListResponse"), exports);
|
|
43
|
+
__exportStar(require("./KnowledgeBaseRefreshRequest"), exports);
|
package/dist/Client.js
CHANGED
|
@@ -59,8 +59,8 @@ class MavenAGIClient {
|
|
|
59
59
|
"X-Agent-Id": _options === null || _options === void 0 ? void 0 : _options.agentId,
|
|
60
60
|
"X-Fern-Language": "JavaScript",
|
|
61
61
|
"X-Fern-SDK-Name": "mavenagi",
|
|
62
|
-
"X-Fern-SDK-Version": "1.2.
|
|
63
|
-
"User-Agent": "mavenagi/1.2.
|
|
62
|
+
"X-Fern-SDK-Version": "1.2.5",
|
|
63
|
+
"User-Agent": "mavenagi/1.2.5",
|
|
64
64
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
65
65
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
66
66
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -115,7 +115,17 @@ export declare class Actions {
|
|
|
115
115
|
* @throws {@link MavenAGI.ServerError}
|
|
116
116
|
*
|
|
117
117
|
* @example
|
|
118
|
-
* await client.actions.patch("
|
|
118
|
+
* await client.actions.patch("get-balance", {
|
|
119
|
+
* instructions: "Use this action when the user asks about their account balance or remaining credits.",
|
|
120
|
+
* llmInclusionStatus: "WHEN_RELEVANT",
|
|
121
|
+
* segmentId: {
|
|
122
|
+
* referenceId: "premium-users",
|
|
123
|
+
* appId: "my-billing-system",
|
|
124
|
+
* organizationId: "acme",
|
|
125
|
+
* agentId: "support",
|
|
126
|
+
* type: "SEGMENT"
|
|
127
|
+
* }
|
|
128
|
+
* })
|
|
119
129
|
*/
|
|
120
130
|
patch(actionReferenceId: string, request?: MavenAGI.ActionPatchRequest, requestOptions?: Actions.RequestOptions): core.HttpResponsePromise<MavenAGI.ActionResponse>;
|
|
121
131
|
private __patch;
|
|
@@ -375,7 +375,17 @@ class Actions {
|
|
|
375
375
|
* @throws {@link MavenAGI.ServerError}
|
|
376
376
|
*
|
|
377
377
|
* @example
|
|
378
|
-
* await client.actions.patch("
|
|
378
|
+
* await client.actions.patch("get-balance", {
|
|
379
|
+
* instructions: "Use this action when the user asks about their account balance or remaining credits.",
|
|
380
|
+
* llmInclusionStatus: "WHEN_RELEVANT",
|
|
381
|
+
* segmentId: {
|
|
382
|
+
* referenceId: "premium-users",
|
|
383
|
+
* appId: "my-billing-system",
|
|
384
|
+
* organizationId: "acme",
|
|
385
|
+
* agentId: "support",
|
|
386
|
+
* type: "SEGMENT"
|
|
387
|
+
* }
|
|
388
|
+
* })
|
|
379
389
|
*/
|
|
380
390
|
patch(actionReferenceId, request = {}, requestOptions) {
|
|
381
391
|
return core.HttpResponsePromise.fromPromise(this.__patch(actionReferenceId, request, requestOptions));
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import * as MavenAGI from "../../../../index";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
|
-
* {
|
|
4
|
+
* {
|
|
5
|
+
* instructions: "Use this action when the user asks about their account balance or remaining credits.",
|
|
6
|
+
* llmInclusionStatus: "WHEN_RELEVANT",
|
|
7
|
+
* segmentId: {
|
|
8
|
+
* referenceId: "premium-users",
|
|
9
|
+
* appId: "my-billing-system",
|
|
10
|
+
* organizationId: "acme",
|
|
11
|
+
* agentId: "support",
|
|
12
|
+
* type: "SEGMENT"
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
5
15
|
*/
|
|
6
16
|
export interface ActionPatchRequest {
|
|
7
17
|
/** The App ID of the action to patch. If not provided the ID of the calling app will be used. */
|
|
@@ -128,9 +128,9 @@ export declare class Agents {
|
|
|
128
128
|
* @throws {@link MavenAGI.ServerError}
|
|
129
129
|
*
|
|
130
130
|
* @example
|
|
131
|
-
* await client.agents.patch("organizationReferenceId", "agentReferenceId"
|
|
131
|
+
* await client.agents.patch("organizationReferenceId", "agentReferenceId")
|
|
132
132
|
*/
|
|
133
|
-
patch(organizationReferenceId: string, agentReferenceId: string, request
|
|
133
|
+
patch(organizationReferenceId: string, agentReferenceId: string, request?: MavenAGI.AgentPatchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.Agent>;
|
|
134
134
|
private __patch;
|
|
135
135
|
/**
|
|
136
136
|
* Delete an agent.
|
|
@@ -460,13 +460,13 @@ class Agents {
|
|
|
460
460
|
* @throws {@link MavenAGI.ServerError}
|
|
461
461
|
*
|
|
462
462
|
* @example
|
|
463
|
-
* await client.agents.patch("organizationReferenceId", "agentReferenceId"
|
|
463
|
+
* await client.agents.patch("organizationReferenceId", "agentReferenceId")
|
|
464
464
|
*/
|
|
465
|
-
patch(organizationReferenceId, agentReferenceId, request, requestOptions) {
|
|
465
|
+
patch(organizationReferenceId, agentReferenceId, request = {}, requestOptions) {
|
|
466
466
|
return core.HttpResponsePromise.fromPromise(this.__patch(organizationReferenceId, agentReferenceId, request, requestOptions));
|
|
467
467
|
}
|
|
468
|
-
__patch(
|
|
469
|
-
return __awaiter(this,
|
|
468
|
+
__patch(organizationReferenceId_1, agentReferenceId_1) {
|
|
469
|
+
return __awaiter(this, arguments, void 0, function* (organizationReferenceId, agentReferenceId, request = {}, requestOptions) {
|
|
470
470
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
471
471
|
let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
472
472
|
Authorization: yield this._getAuthorizationHeader(),
|
|
@@ -477,7 +477,7 @@ class Agents {
|
|
|
477
477
|
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/organizations/${encodeURIComponent(organizationReferenceId)}/agents/${encodeURIComponent(agentReferenceId)}`),
|
|
478
478
|
method: "PATCH",
|
|
479
479
|
headers: _headers,
|
|
480
|
-
contentType: "application/json",
|
|
480
|
+
contentType: "application/merge-patch+json",
|
|
481
481
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
482
482
|
requestType: "json",
|
|
483
483
|
body: serializers.AgentPatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as MavenAGI from "../../../../index";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface AgentPatchRequest {
|
|
7
|
+
/** The name of the agent. */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** The environment of the agent. */
|
|
10
|
+
environment?: MavenAGI.AgentEnvironment;
|
|
11
|
+
/** The agent's default timezone. This is used when a timezone is not set on a conversation. */
|
|
12
|
+
defaultTimezone?: string;
|
|
13
|
+
/** The PII categories that are enabled for the agent. */
|
|
14
|
+
enabledPiiCategories?: Set<MavenAGI.PiiCategory>;
|
|
15
|
+
/** The system fallback message. */
|
|
16
|
+
systemFallbackMessage?: string | null;
|
|
17
|
+
/** The overall persona of the agent. */
|
|
18
|
+
persona?: MavenAGI.LlmPersona;
|
|
19
|
+
/** Additional text directly appended to the prompt. */
|
|
20
|
+
additionalPromptText?: string | null;
|
|
21
|
+
/** LLM prompt for category generation. */
|
|
22
|
+
categoryGenerationPromptText?: string | null;
|
|
23
|
+
/** LLM prompt for generating a response when the user's question has been detected as unsafe. */
|
|
24
|
+
contentSafetyViolationResponsePromptText?: string | null;
|
|
25
|
+
/** Return the system fallback message on all questions that have no relevant knowledge bases or actions. */
|
|
26
|
+
rejectQuestionsWithoutKnowledge?: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type AgentPatchRequest } from "./AgentPatchRequest";
|
|
@@ -20,4 +20,12 @@ export interface Agent {
|
|
|
20
20
|
* `UsUkPassportNumber`, `UsSocialSecurityNumber`.
|
|
21
21
|
*/
|
|
22
22
|
enabledPiiCategories: Set<MavenAGI.PiiCategory>;
|
|
23
|
+
/**
|
|
24
|
+
* Text shown to end users when the system encounters an error while generating a bot response message.
|
|
25
|
+
*
|
|
26
|
+
* This text is also used when a content safety violation is detected, unless `contentSafetyViolationPromptText` is set.
|
|
27
|
+
*/
|
|
28
|
+
systemFallbackMessage?: string;
|
|
29
|
+
/** Agent prompting settings. */
|
|
30
|
+
prompting: MavenAGI.AgentPrompting;
|
|
23
31
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as MavenAGI from "../../../index";
|
|
2
|
+
export interface AgentPrompting {
|
|
3
|
+
/** The overall persona of the agent. */
|
|
4
|
+
persona: MavenAGI.LlmPersona;
|
|
5
|
+
/** Additional text directly appended to the prompt. This field is replaced by Knowledge Documents with `llmInclusionsStatus` set to `ALWAYS`. */
|
|
6
|
+
additionalPromptText?: string;
|
|
7
|
+
/**
|
|
8
|
+
* LLM prompt for category generation.
|
|
9
|
+
*
|
|
10
|
+
* Use this to specify a fixed set of categories that an LLM should choose from when analyzing a conversation.
|
|
11
|
+
* When not set uses a default prompt which gives the LLM flexibility to determine appropriate categories on its own.
|
|
12
|
+
*/
|
|
13
|
+
categoryGenerationPromptText?: string;
|
|
14
|
+
/**
|
|
15
|
+
* LLM prompt for generating a response when the user's question has been detected as unsafe.
|
|
16
|
+
*
|
|
17
|
+
* Use this to provide custom LLM generated replies when dealing with content safety violations.
|
|
18
|
+
* When not set, the system fallback message will be used and replies will not be personalized by the LLM as it will not be involved.
|
|
19
|
+
*/
|
|
20
|
+
contentSafetyViolationResponsePromptText?: string;
|
|
21
|
+
/** Return the system fallback message on all questions that have no relevant knowledge bases or actions. */
|
|
22
|
+
rejectQuestionsWithoutKnowledge: boolean;
|
|
23
|
+
}
|
|
@@ -2,8 +2,8 @@ export * from "./PiiCategory";
|
|
|
2
2
|
export * from "./AgentEnvironment";
|
|
3
3
|
export * from "./Agent";
|
|
4
4
|
export * from "./CreateAgentRequest";
|
|
5
|
-
export * from "./AgentPatchRequest";
|
|
6
5
|
export * from "./AgentsSearchRequest";
|
|
7
6
|
export * from "./AgentField";
|
|
8
7
|
export * from "./AgentFilter";
|
|
9
8
|
export * from "./AgentsSearchResponse";
|
|
9
|
+
export * from "./AgentPrompting";
|
|
@@ -18,8 +18,8 @@ __exportStar(require("./PiiCategory"), exports);
|
|
|
18
18
|
__exportStar(require("./AgentEnvironment"), exports);
|
|
19
19
|
__exportStar(require("./Agent"), exports);
|
|
20
20
|
__exportStar(require("./CreateAgentRequest"), exports);
|
|
21
|
-
__exportStar(require("./AgentPatchRequest"), exports);
|
|
22
21
|
__exportStar(require("./AgentsSearchRequest"), exports);
|
|
23
22
|
__exportStar(require("./AgentField"), exports);
|
|
24
23
|
__exportStar(require("./AgentFilter"), exports);
|
|
25
24
|
__exportStar(require("./AgentsSearchResponse"), exports);
|
|
25
|
+
__exportStar(require("./AgentPrompting"), exports);
|
|
@@ -3,6 +3,16 @@ export interface ConversationBarChartRequest extends MavenAGI.ConversationAnalyt
|
|
|
3
3
|
/**
|
|
4
4
|
* Determines how data is grouped along the x-axis. Each unique value forms a separate bar.
|
|
5
5
|
* The name of the bar is derived from the grouping field's value or range.
|
|
6
|
+
*
|
|
7
|
+
* **Label Formats by Field:**
|
|
8
|
+
* - `Sources`: Document title (e.g., "Product Documentation")
|
|
9
|
+
* - `Actions`: "Action Name - App Name" (e.g., "Create Ticket - Freshdesk")
|
|
10
|
+
* - `IncompleteActions`: "Action Name - App Name" (e.g., "Search Documents - Zendesk")
|
|
11
|
+
* - `Users`: User identifier value (e.g., "user@example.com")
|
|
12
|
+
* - `InboxItems`: Inbox item title
|
|
13
|
+
* - `HumanAgents`: Human agent display name
|
|
14
|
+
* - `HumanAgentsWithInserts`: Human agent display name (for agents who made inserts)
|
|
15
|
+
* - Other fields: Field value as stored (e.g., "GOOD", "NEEDS_IMPROVEMENT" for Quality)
|
|
6
16
|
*/
|
|
7
17
|
barDefinition: MavenAGI.ConversationGroupBy;
|
|
8
18
|
/** Metric defining the y-axis values for the bar chart. */
|
|
@@ -10,6 +20,16 @@ export interface ConversationBarChartRequest extends MavenAGI.ConversationAnalyt
|
|
|
10
20
|
/**
|
|
11
21
|
* Optionally defines vertical grouping within each bar, producing multiple series.
|
|
12
22
|
* If omitted, a single series is generated.
|
|
23
|
+
*
|
|
24
|
+
* **Series Name Formats by Field:**
|
|
25
|
+
* - `Sources`: Document title (e.g., "Product Documentation")
|
|
26
|
+
* - `Actions`: "Action Name - App Name" (e.g., "Create Ticket - Freshdesk")
|
|
27
|
+
* - `IncompleteActions`: "Action Name - App Name" (e.g., "Search Documents - Zendesk")
|
|
28
|
+
* - `Users`: User identifier value (e.g., "user@example.com")
|
|
29
|
+
* - `InboxItems`: Inbox item title
|
|
30
|
+
* - `HumanAgents`: Human agent display name
|
|
31
|
+
* - `HumanAgentsWithInserts`: Human agent display name (for agents who made inserts)
|
|
32
|
+
* - Other fields: Field value as stored (e.g., "GOOD", "NEEDS_IMPROVEMENT" for Quality)
|
|
13
33
|
*/
|
|
14
34
|
verticalGrouping?: MavenAGI.ConversationGroupBy;
|
|
15
35
|
}
|
|
@@ -2,7 +2,19 @@ import * as MavenAGI from "../../../index";
|
|
|
2
2
|
export interface ConversationDateHistogramRequest extends MavenAGI.ConversationAnalyticsRequest {
|
|
3
3
|
/** Time-based grouping interval (e.g., HOUR, DAY, WEEK) for the date histogram. */
|
|
4
4
|
timeInterval: MavenAGI.TimeInterval;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Groups data before applying calculations, forming a separate time series for each group.
|
|
7
|
+
*
|
|
8
|
+
* **Series Name Formats by Field:**
|
|
9
|
+
* - `Sources`: Document title (e.g., "Product Documentation")
|
|
10
|
+
* - `Actions`: "Action Name - App Name" (e.g., "Create Ticket - Freshdesk")
|
|
11
|
+
* - `IncompleteActions`: "Action Name - App Name" (e.g., "Search Documents - Zendesk")
|
|
12
|
+
* - `Users`: User identifier value (e.g., "user@example.com")
|
|
13
|
+
* - `InboxItems`: Inbox item title
|
|
14
|
+
* - `HumanAgents`: Human agent display name
|
|
15
|
+
* - `HumanAgentsWithInserts`: Human agent display name (for agents who made inserts)
|
|
16
|
+
* - Other fields: Field value as stored (e.g., "GOOD", "NEEDS_IMPROVEMENT" for Quality)
|
|
17
|
+
*/
|
|
6
18
|
groupBy?: MavenAGI.ConversationGroupBy;
|
|
7
19
|
/** Defines the y-axis values for the date histogram. */
|
|
8
20
|
metric: MavenAGI.ConversationMetric;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import * as MavenAGI from "../../../index";
|
|
2
2
|
export interface ConversationPieChartRequest extends MavenAGI.ConversationAnalyticsRequest {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Field used to group data into slices for the pie chart.
|
|
5
|
+
*
|
|
6
|
+
* **Series Name Formats by Field:**
|
|
7
|
+
* - `Sources`: Document title (e.g., "Product Documentation")
|
|
8
|
+
* - `Actions`: "Action Name - App Name" (e.g., "Create Ticket - Freshdesk")
|
|
9
|
+
* - `IncompleteActions`: "Action Name - App Name" (e.g., "Search Documents - Zendesk")
|
|
10
|
+
* - `Users`: User identifier value (e.g., "user@example.com")
|
|
11
|
+
* - `InboxItems`: Inbox item title
|
|
12
|
+
* - `HumanAgents`: Human agent display name
|
|
13
|
+
* - `HumanAgentsWithInserts`: Human agent display name (for agents who made inserts)
|
|
14
|
+
* - Other fields: Field value as stored (e.g., "GOOD", "NEEDS_IMPROVEMENT" for Quality)
|
|
15
|
+
*/
|
|
4
16
|
groupBy: MavenAGI.ConversationGroupBy;
|
|
5
17
|
/** Metric defining the value for each pie slice, stored in the y-axis value. */
|
|
6
18
|
metric: MavenAGI.ConversationMetric;
|
|
@@ -26,6 +26,13 @@ import * as MavenAGI from "../../../index";
|
|
|
26
26
|
* key: "userKey2"
|
|
27
27
|
* }]
|
|
28
28
|
* },
|
|
29
|
+
* segmentId: {
|
|
30
|
+
* referenceId: "premium-users",
|
|
31
|
+
* appId: "my-billing-system",
|
|
32
|
+
* organizationId: "acme",
|
|
33
|
+
* agentId: "support",
|
|
34
|
+
* type: MavenAGI.EntityType.Segment
|
|
35
|
+
* },
|
|
29
36
|
* language: "en",
|
|
30
37
|
* deleted: false
|
|
31
38
|
* }
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as MavenAGI from "../../../index";
|
|
2
2
|
export interface SimulationContext {
|
|
3
|
+
/**
|
|
4
|
+
* If provided, overrides the agent's default additional prompt text during the simulation.
|
|
5
|
+
* Note that this field is provided for backwards compatibility and will be removed in a future release.
|
|
6
|
+
* Instead please use the `availableKnowledgeBases` field to include a knowledge base with a document `llmInclusionStatus` set to `ALWAYS`.
|
|
7
|
+
*/
|
|
8
|
+
additionalPromptText?: string;
|
|
3
9
|
/** The persona to use during the simulation. If not provided, the agent's default persona will be used. */
|
|
4
10
|
persona?: MavenAGI.LlmPersona;
|
|
5
11
|
/** If provided, knowledge search will be restricted to the provided list of knowledge bases. Otherwise, all active knowledge bases will be used. An empty list means no knowledge bases will be used. */
|
|
@@ -300,7 +300,11 @@ export declare class Conversation {
|
|
|
300
300
|
createFeedback(request: MavenAGI.FeedbackRequest, requestOptions?: Conversation.RequestOptions): core.HttpResponsePromise<MavenAGI.Feedback>;
|
|
301
301
|
private __createFeedback;
|
|
302
302
|
/**
|
|
303
|
-
* Submit a filled out action form
|
|
303
|
+
* Submit a filled out action form.
|
|
304
|
+
* Action forms can not be submitted more than once, attempting to do so will result in an error.
|
|
305
|
+
*
|
|
306
|
+
* Additionally, form submission is only allowed when the form is the last message in the conversation.
|
|
307
|
+
* Forms should be disabled in surface UI if a conversation continues and they remain unsubmitted.
|
|
304
308
|
*
|
|
305
309
|
* @param {string} conversationId - The ID of a conversation the form being submitted belongs to
|
|
306
310
|
* @param {MavenAGI.SubmitActionFormRequest} request
|
|
@@ -384,6 +388,19 @@ export declare class Conversation {
|
|
|
384
388
|
*/
|
|
385
389
|
search(request: MavenAGI.ConversationsSearchRequest, requestOptions?: Conversation.RequestOptions): core.HttpResponsePromise<MavenAGI.ConversationsResponse>;
|
|
386
390
|
private __search;
|
|
391
|
+
/**
|
|
392
|
+
* Export conversations to a CSV file.
|
|
393
|
+
*
|
|
394
|
+
* This will output a summary of each conversation that matches the supplied filter. A maximum of 10,000 conversations can be exported at a time.
|
|
395
|
+
*
|
|
396
|
+
* For most use cases it is recommended to use the `search` API instead and convert the JSON response to your desired format.
|
|
397
|
+
* The CSV format may change over time and should not be relied upon by code consumers.
|
|
398
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
399
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
400
|
+
* @throws {@link MavenAGI.ServerError}
|
|
401
|
+
*/
|
|
402
|
+
export(request: MavenAGI.ConversationsSearchRequest, requestOptions?: Conversation.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
403
|
+
private __export;
|
|
387
404
|
/**
|
|
388
405
|
* Deliver a message to a user or conversation.
|
|
389
406
|
*
|
|
@@ -1139,7 +1139,11 @@ class Conversation {
|
|
|
1139
1139
|
});
|
|
1140
1140
|
}
|
|
1141
1141
|
/**
|
|
1142
|
-
* Submit a filled out action form
|
|
1142
|
+
* Submit a filled out action form.
|
|
1143
|
+
* Action forms can not be submitted more than once, attempting to do so will result in an error.
|
|
1144
|
+
*
|
|
1145
|
+
* Additionally, form submission is only allowed when the form is the last message in the conversation.
|
|
1146
|
+
* Forms should be disabled in surface UI if a conversation continues and they remain unsubmitted.
|
|
1143
1147
|
*
|
|
1144
1148
|
* @param {string} conversationId - The ID of a conversation the form being submitted belongs to
|
|
1145
1149
|
* @param {MavenAGI.SubmitActionFormRequest} request
|
|
@@ -1545,6 +1549,92 @@ class Conversation {
|
|
|
1545
1549
|
}
|
|
1546
1550
|
});
|
|
1547
1551
|
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Export conversations to a CSV file.
|
|
1554
|
+
*
|
|
1555
|
+
* This will output a summary of each conversation that matches the supplied filter. A maximum of 10,000 conversations can be exported at a time.
|
|
1556
|
+
*
|
|
1557
|
+
* For most use cases it is recommended to use the `search` API instead and convert the JSON response to your desired format.
|
|
1558
|
+
* The CSV format may change over time and should not be relied upon by code consumers.
|
|
1559
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
1560
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
1561
|
+
* @throws {@link MavenAGI.ServerError}
|
|
1562
|
+
*/
|
|
1563
|
+
export(request, requestOptions) {
|
|
1564
|
+
return core.HttpResponsePromise.fromPromise(this.__export(request, requestOptions));
|
|
1565
|
+
}
|
|
1566
|
+
__export(request, requestOptions) {
|
|
1567
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1568
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1569
|
+
let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1570
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1571
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
1572
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
1573
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1574
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
1575
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, "/v1/conversations/export"),
|
|
1576
|
+
method: "POST",
|
|
1577
|
+
headers: _headers,
|
|
1578
|
+
contentType: "application/json",
|
|
1579
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1580
|
+
requestType: "json",
|
|
1581
|
+
body: serializers.ConversationsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1582
|
+
responseType: "binary-response",
|
|
1583
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1584
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1585
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1586
|
+
});
|
|
1587
|
+
if (_response.ok) {
|
|
1588
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1589
|
+
}
|
|
1590
|
+
if (_response.error.reason === "status-code") {
|
|
1591
|
+
switch (_response.error.statusCode) {
|
|
1592
|
+
case 404:
|
|
1593
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1594
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1595
|
+
allowUnrecognizedUnionMembers: true,
|
|
1596
|
+
allowUnrecognizedEnumValues: true,
|
|
1597
|
+
breadcrumbsPrefix: ["response"],
|
|
1598
|
+
}), _response.rawResponse);
|
|
1599
|
+
case 400:
|
|
1600
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1601
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1602
|
+
allowUnrecognizedUnionMembers: true,
|
|
1603
|
+
allowUnrecognizedEnumValues: true,
|
|
1604
|
+
breadcrumbsPrefix: ["response"],
|
|
1605
|
+
}), _response.rawResponse);
|
|
1606
|
+
case 500:
|
|
1607
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1608
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1609
|
+
allowUnrecognizedUnionMembers: true,
|
|
1610
|
+
allowUnrecognizedEnumValues: true,
|
|
1611
|
+
breadcrumbsPrefix: ["response"],
|
|
1612
|
+
}), _response.rawResponse);
|
|
1613
|
+
default:
|
|
1614
|
+
throw new errors.MavenAGIError({
|
|
1615
|
+
statusCode: _response.error.statusCode,
|
|
1616
|
+
body: _response.error.body,
|
|
1617
|
+
rawResponse: _response.rawResponse,
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
switch (_response.error.reason) {
|
|
1622
|
+
case "non-json":
|
|
1623
|
+
throw new errors.MavenAGIError({
|
|
1624
|
+
statusCode: _response.error.statusCode,
|
|
1625
|
+
body: _response.error.rawBody,
|
|
1626
|
+
rawResponse: _response.rawResponse,
|
|
1627
|
+
});
|
|
1628
|
+
case "timeout":
|
|
1629
|
+
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/export.");
|
|
1630
|
+
case "unknown":
|
|
1631
|
+
throw new errors.MavenAGIError({
|
|
1632
|
+
message: _response.error.errorMessage,
|
|
1633
|
+
rawResponse: _response.rawResponse,
|
|
1634
|
+
});
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1548
1638
|
/**
|
|
1549
1639
|
* Deliver a message to a user or conversation.
|
|
1550
1640
|
*
|
|
@@ -95,5 +95,15 @@ export declare class Events {
|
|
|
95
95
|
*/
|
|
96
96
|
get(eventId: string, request: MavenAGI.EventGetRequest, requestOptions?: Events.RequestOptions): core.HttpResponsePromise<MavenAGI.EventResponse>;
|
|
97
97
|
private __get;
|
|
98
|
+
/**
|
|
99
|
+
* Export events to a CSV file.
|
|
100
|
+
*
|
|
101
|
+
* This will output a summary of each event that matches the supplied filter. A maximum of 10,000 events can be exported at a time. For most use cases it is recommended to use the search API instead and convert the JSON response to your desired format. The CSV format may change over time and should not be relied upon by code consumers.
|
|
102
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
103
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
104
|
+
* @throws {@link MavenAGI.ServerError}
|
|
105
|
+
*/
|
|
106
|
+
export(request: MavenAGI.EventsSearchRequest, requestOptions?: Events.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
107
|
+
private __export;
|
|
98
108
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
99
109
|
}
|
|
@@ -353,6 +353,89 @@ class Events {
|
|
|
353
353
|
}
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Export events to a CSV file.
|
|
358
|
+
*
|
|
359
|
+
* This will output a summary of each event that matches the supplied filter. A maximum of 10,000 events can be exported at a time. For most use cases it is recommended to use the search API instead and convert the JSON response to your desired format. The CSV format may change over time and should not be relied upon by code consumers.
|
|
360
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
361
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
362
|
+
* @throws {@link MavenAGI.ServerError}
|
|
363
|
+
*/
|
|
364
|
+
export(request, requestOptions) {
|
|
365
|
+
return core.HttpResponsePromise.fromPromise(this.__export(request, requestOptions));
|
|
366
|
+
}
|
|
367
|
+
__export(request, requestOptions) {
|
|
368
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
369
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
370
|
+
let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
371
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
372
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
373
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
374
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
375
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
376
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, "/v1/events/export"),
|
|
377
|
+
method: "POST",
|
|
378
|
+
headers: _headers,
|
|
379
|
+
contentType: "application/json",
|
|
380
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
381
|
+
requestType: "json",
|
|
382
|
+
body: serializers.EventsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
383
|
+
responseType: "binary-response",
|
|
384
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
385
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
386
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
387
|
+
});
|
|
388
|
+
if (_response.ok) {
|
|
389
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
390
|
+
}
|
|
391
|
+
if (_response.error.reason === "status-code") {
|
|
392
|
+
switch (_response.error.statusCode) {
|
|
393
|
+
case 404:
|
|
394
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
395
|
+
unrecognizedObjectKeys: "passthrough",
|
|
396
|
+
allowUnrecognizedUnionMembers: true,
|
|
397
|
+
allowUnrecognizedEnumValues: true,
|
|
398
|
+
breadcrumbsPrefix: ["response"],
|
|
399
|
+
}), _response.rawResponse);
|
|
400
|
+
case 400:
|
|
401
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
402
|
+
unrecognizedObjectKeys: "passthrough",
|
|
403
|
+
allowUnrecognizedUnionMembers: true,
|
|
404
|
+
allowUnrecognizedEnumValues: true,
|
|
405
|
+
breadcrumbsPrefix: ["response"],
|
|
406
|
+
}), _response.rawResponse);
|
|
407
|
+
case 500:
|
|
408
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
409
|
+
unrecognizedObjectKeys: "passthrough",
|
|
410
|
+
allowUnrecognizedUnionMembers: true,
|
|
411
|
+
allowUnrecognizedEnumValues: true,
|
|
412
|
+
breadcrumbsPrefix: ["response"],
|
|
413
|
+
}), _response.rawResponse);
|
|
414
|
+
default:
|
|
415
|
+
throw new errors.MavenAGIError({
|
|
416
|
+
statusCode: _response.error.statusCode,
|
|
417
|
+
body: _response.error.body,
|
|
418
|
+
rawResponse: _response.rawResponse,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
switch (_response.error.reason) {
|
|
423
|
+
case "non-json":
|
|
424
|
+
throw new errors.MavenAGIError({
|
|
425
|
+
statusCode: _response.error.statusCode,
|
|
426
|
+
body: _response.error.rawBody,
|
|
427
|
+
rawResponse: _response.rawResponse,
|
|
428
|
+
});
|
|
429
|
+
case "timeout":
|
|
430
|
+
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/events/export.");
|
|
431
|
+
case "unknown":
|
|
432
|
+
throw new errors.MavenAGIError({
|
|
433
|
+
message: _response.error.errorMessage,
|
|
434
|
+
rawResponse: _response.rawResponse,
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
}
|
|
356
439
|
_getAuthorizationHeader() {
|
|
357
440
|
return __awaiter(this, void 0, void 0, function* () {
|
|
358
441
|
var _a, _b;
|