mavenagi 1.2.23 → 1.2.25
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/api/resources/commons/types/InboxItemCustom.d.ts +14 -0
- package/api/resources/commons/types/UserEventName.d.ts +3 -0
- package/api/resources/commons/types/UserEventName.js +3 -0
- package/api/resources/inbox/client/Client.d.ts +45 -0
- package/api/resources/inbox/client/Client.js +125 -0
- package/api/resources/inbox/types/InboxItemCreateRequest.d.ts +59 -0
- package/api/resources/inbox/types/InboxItemCreateRequest.js +3 -0
- package/api/resources/inbox/types/index.d.ts +1 -0
- package/api/resources/inbox/types/index.js +1 -0
- package/api/resources/voice/client/Client.d.ts +2 -2
- package/api/resources/voice/client/Client.js +2 -2
- package/api/resources/voice/types/VoiceSessionTokenRequest.d.ts +8 -1
- package/dist/Client.js +2 -2
- package/dist/api/resources/commons/types/InboxItemCustom.d.ts +14 -0
- package/dist/api/resources/commons/types/UserEventName.d.ts +3 -0
- package/dist/api/resources/commons/types/UserEventName.js +3 -0
- package/dist/api/resources/inbox/client/Client.d.ts +45 -0
- package/dist/api/resources/inbox/client/Client.js +125 -0
- package/dist/api/resources/inbox/types/InboxItemCreateRequest.d.ts +59 -0
- package/dist/api/resources/inbox/types/InboxItemCreateRequest.js +3 -0
- package/dist/api/resources/inbox/types/index.d.ts +1 -0
- package/dist/api/resources/inbox/types/index.js +1 -0
- package/dist/api/resources/voice/client/Client.d.ts +2 -2
- package/dist/api/resources/voice/client/Client.js +2 -2
- package/dist/api/resources/voice/types/VoiceSessionTokenRequest.d.ts +8 -1
- package/dist/serialization/resources/commons/types/InboxItemCustom.d.ts +8 -0
- package/dist/serialization/resources/commons/types/InboxItemCustom.js +8 -0
- package/dist/serialization/resources/commons/types/UserEventName.d.ts +1 -1
- package/dist/serialization/resources/commons/types/UserEventName.js +8 -1
- package/dist/serialization/resources/inbox/types/InboxItemCreateRequest.d.ts +23 -0
- package/dist/serialization/resources/inbox/types/InboxItemCreateRequest.js +55 -0
- package/dist/serialization/resources/inbox/types/index.d.ts +1 -0
- package/dist/serialization/resources/inbox/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 +95 -2
- package/serialization/resources/commons/types/InboxItemCustom.d.ts +8 -0
- package/serialization/resources/commons/types/InboxItemCustom.js +8 -0
- package/serialization/resources/commons/types/UserEventName.d.ts +1 -1
- package/serialization/resources/commons/types/UserEventName.js +8 -1
- package/serialization/resources/inbox/types/InboxItemCreateRequest.d.ts +23 -0
- package/serialization/resources/inbox/types/InboxItemCreateRequest.js +55 -0
- package/serialization/resources/inbox/types/index.d.ts +1 -0
- package/serialization/resources/inbox/types/index.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/Client.js
CHANGED
|
@@ -62,8 +62,8 @@ class MavenAGIClient {
|
|
|
62
62
|
"X-Agent-Id": _options === null || _options === void 0 ? void 0 : _options.agentId,
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "mavenagi",
|
|
65
|
-
"X-Fern-SDK-Version": "1.2.
|
|
66
|
-
"User-Agent": "mavenagi/1.2.
|
|
65
|
+
"X-Fern-SDK-Version": "1.2.25",
|
|
66
|
+
"User-Agent": "mavenagi/1.2.25",
|
|
67
67
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
68
68
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
69
69
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -2,4 +2,18 @@ import type * as MavenAGI from "../../../index";
|
|
|
2
2
|
export interface InboxItemCustom extends MavenAGI.InboxItemBase {
|
|
3
3
|
/** Additional metadata associated with the inbox item. */
|
|
4
4
|
metadata: Record<string, string>;
|
|
5
|
+
/** Title of the inbox item. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Description of the inbox item. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** An optional URL that can be associated with the inbox item. */
|
|
10
|
+
externalUrl?: string;
|
|
11
|
+
/** An optional deadline for the inbox item. */
|
|
12
|
+
deadline?: Date;
|
|
13
|
+
/** An optional timestamp until which the inbox item is snoozed. */
|
|
14
|
+
snoozedUntil?: Date;
|
|
15
|
+
/** An optional assignee for the inbox item. */
|
|
16
|
+
assignee?: string;
|
|
17
|
+
/** An optional list of references to other entities that are related to this inbox item. */
|
|
18
|
+
references?: MavenAGI.ScopedEntity[];
|
|
5
19
|
}
|
|
@@ -14,5 +14,8 @@ export declare const UserEventName: {
|
|
|
14
14
|
/**
|
|
15
15
|
* A text was inserted into a field */
|
|
16
16
|
readonly TextInserted: "TEXT_INSERTED";
|
|
17
|
+
/**
|
|
18
|
+
* A CSAT rating was submitted */
|
|
19
|
+
readonly CsatSubmitted: "CSAT_SUBMITTED";
|
|
17
20
|
};
|
|
18
21
|
export type UserEventName = (typeof UserEventName)[keyof typeof UserEventName];
|
|
@@ -25,6 +25,51 @@ export declare class Inbox {
|
|
|
25
25
|
*/
|
|
26
26
|
search(request: MavenAGI.InboxSearchRequest, requestOptions?: Inbox.RequestOptions): core.HttpResponsePromise<MavenAGI.InboxSearchResponse>;
|
|
27
27
|
private __search;
|
|
28
|
+
/**
|
|
29
|
+
* Update an inbox item or create it if it doesn't exist.
|
|
30
|
+
*
|
|
31
|
+
* @param {MavenAGI.InboxItemCreateRequest} request
|
|
32
|
+
* @param {Inbox.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
|
+
*
|
|
34
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
35
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
36
|
+
* @throws {@link MavenAGI.ServerError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.inbox.createOrUpdate({
|
|
40
|
+
* inboxItemId: {
|
|
41
|
+
* referenceId: "todo-item-1"
|
|
42
|
+
* },
|
|
43
|
+
* status: "OPEN",
|
|
44
|
+
* severity: "HIGH",
|
|
45
|
+
* title: "Todo Item",
|
|
46
|
+
* description: "This is the first todo item.",
|
|
47
|
+
* metadata: {
|
|
48
|
+
* "key": "value"
|
|
49
|
+
* },
|
|
50
|
+
* externalUrl: "todo.com",
|
|
51
|
+
* deadline: new Date("2026-12-31T23:59:59.000Z"),
|
|
52
|
+
* snoozedUntil: new Date("2026-12-25T23:59:59.000Z"),
|
|
53
|
+
* references: [{
|
|
54
|
+
* entityId: {
|
|
55
|
+
* type: "CONVERSATION_MESSAGE",
|
|
56
|
+
* appId: "app1",
|
|
57
|
+
* referenceId: "msgRef1201",
|
|
58
|
+
* organizationId: "acme",
|
|
59
|
+
* agentId: "support"
|
|
60
|
+
* },
|
|
61
|
+
* scopeEntityId: {
|
|
62
|
+
* type: "CONVERSATION",
|
|
63
|
+
* appId: "app1",
|
|
64
|
+
* referenceId: "ref1200",
|
|
65
|
+
* organizationId: "acme",
|
|
66
|
+
* agentId: "support"
|
|
67
|
+
* }
|
|
68
|
+
* }]
|
|
69
|
+
* })
|
|
70
|
+
*/
|
|
71
|
+
createOrUpdate(request: MavenAGI.InboxItemCreateRequest, requestOptions?: Inbox.RequestOptions): core.HttpResponsePromise<MavenAGI.InboxItem>;
|
|
72
|
+
private __createOrUpdate;
|
|
28
73
|
/**
|
|
29
74
|
* Update inbox item tag fields. All tags provided will overwrite the existing tags on the inbox item.
|
|
30
75
|
*
|
|
@@ -149,6 +149,131 @@ class Inbox {
|
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Update an inbox item or create it if it doesn't exist.
|
|
154
|
+
*
|
|
155
|
+
* @param {MavenAGI.InboxItemCreateRequest} request
|
|
156
|
+
* @param {Inbox.RequestOptions} requestOptions - Request-specific configuration.
|
|
157
|
+
*
|
|
158
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
159
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
160
|
+
* @throws {@link MavenAGI.ServerError}
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* await client.inbox.createOrUpdate({
|
|
164
|
+
* inboxItemId: {
|
|
165
|
+
* referenceId: "todo-item-1"
|
|
166
|
+
* },
|
|
167
|
+
* status: "OPEN",
|
|
168
|
+
* severity: "HIGH",
|
|
169
|
+
* title: "Todo Item",
|
|
170
|
+
* description: "This is the first todo item.",
|
|
171
|
+
* metadata: {
|
|
172
|
+
* "key": "value"
|
|
173
|
+
* },
|
|
174
|
+
* externalUrl: "todo.com",
|
|
175
|
+
* deadline: new Date("2026-12-31T23:59:59.000Z"),
|
|
176
|
+
* snoozedUntil: new Date("2026-12-25T23:59:59.000Z"),
|
|
177
|
+
* references: [{
|
|
178
|
+
* entityId: {
|
|
179
|
+
* type: "CONVERSATION_MESSAGE",
|
|
180
|
+
* appId: "app1",
|
|
181
|
+
* referenceId: "msgRef1201",
|
|
182
|
+
* organizationId: "acme",
|
|
183
|
+
* agentId: "support"
|
|
184
|
+
* },
|
|
185
|
+
* scopeEntityId: {
|
|
186
|
+
* type: "CONVERSATION",
|
|
187
|
+
* appId: "app1",
|
|
188
|
+
* referenceId: "ref1200",
|
|
189
|
+
* organizationId: "acme",
|
|
190
|
+
* agentId: "support"
|
|
191
|
+
* }
|
|
192
|
+
* }]
|
|
193
|
+
* })
|
|
194
|
+
*/
|
|
195
|
+
createOrUpdate(request, requestOptions) {
|
|
196
|
+
return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions));
|
|
197
|
+
}
|
|
198
|
+
__createOrUpdate(request, requestOptions) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
201
|
+
const _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
202
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
203
|
+
"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,
|
|
204
|
+
"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,
|
|
205
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
206
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
207
|
+
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/inbox"),
|
|
208
|
+
method: "PUT",
|
|
209
|
+
headers: _headers,
|
|
210
|
+
contentType: "application/json",
|
|
211
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
212
|
+
requestType: "json",
|
|
213
|
+
body: serializers.InboxItemCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
214
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
215
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
216
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return {
|
|
220
|
+
data: serializers.InboxItem.parseOrThrow(_response.body, {
|
|
221
|
+
unrecognizedObjectKeys: "passthrough",
|
|
222
|
+
allowUnrecognizedUnionMembers: true,
|
|
223
|
+
allowUnrecognizedEnumValues: true,
|
|
224
|
+
breadcrumbsPrefix: ["response"],
|
|
225
|
+
}),
|
|
226
|
+
rawResponse: _response.rawResponse,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (_response.error.reason === "status-code") {
|
|
230
|
+
switch (_response.error.statusCode) {
|
|
231
|
+
case 404:
|
|
232
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
233
|
+
unrecognizedObjectKeys: "passthrough",
|
|
234
|
+
allowUnrecognizedUnionMembers: true,
|
|
235
|
+
allowUnrecognizedEnumValues: true,
|
|
236
|
+
breadcrumbsPrefix: ["response"],
|
|
237
|
+
}), _response.rawResponse);
|
|
238
|
+
case 400:
|
|
239
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
240
|
+
unrecognizedObjectKeys: "passthrough",
|
|
241
|
+
allowUnrecognizedUnionMembers: true,
|
|
242
|
+
allowUnrecognizedEnumValues: true,
|
|
243
|
+
breadcrumbsPrefix: ["response"],
|
|
244
|
+
}), _response.rawResponse);
|
|
245
|
+
case 500:
|
|
246
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
247
|
+
unrecognizedObjectKeys: "passthrough",
|
|
248
|
+
allowUnrecognizedUnionMembers: true,
|
|
249
|
+
allowUnrecognizedEnumValues: true,
|
|
250
|
+
breadcrumbsPrefix: ["response"],
|
|
251
|
+
}), _response.rawResponse);
|
|
252
|
+
default:
|
|
253
|
+
throw new errors.MavenAGIError({
|
|
254
|
+
statusCode: _response.error.statusCode,
|
|
255
|
+
body: _response.error.body,
|
|
256
|
+
rawResponse: _response.rawResponse,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
switch (_response.error.reason) {
|
|
261
|
+
case "non-json":
|
|
262
|
+
throw new errors.MavenAGIError({
|
|
263
|
+
statusCode: _response.error.statusCode,
|
|
264
|
+
body: _response.error.rawBody,
|
|
265
|
+
rawResponse: _response.rawResponse,
|
|
266
|
+
});
|
|
267
|
+
case "timeout":
|
|
268
|
+
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling PUT /v1/inbox.");
|
|
269
|
+
case "unknown":
|
|
270
|
+
throw new errors.MavenAGIError({
|
|
271
|
+
message: _response.error.errorMessage,
|
|
272
|
+
rawResponse: _response.rawResponse,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
152
277
|
/**
|
|
153
278
|
* Update inbox item tag fields. All tags provided will overwrite the existing tags on the inbox item.
|
|
154
279
|
*
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type * as MavenAGI from "../../../index";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* inboxItemId: {
|
|
6
|
+
* referenceId: "todo-item-1"
|
|
7
|
+
* },
|
|
8
|
+
* status: MavenAGI.InboxItemStatus.Open,
|
|
9
|
+
* severity: MavenAGI.InboxItemSeverity.High,
|
|
10
|
+
* title: "Todo Item",
|
|
11
|
+
* description: "This is the first todo item.",
|
|
12
|
+
* metadata: {
|
|
13
|
+
* "key": "value"
|
|
14
|
+
* },
|
|
15
|
+
* externalUrl: "todo.com",
|
|
16
|
+
* deadline: new Date("2026-12-31T23:59:59.000Z"),
|
|
17
|
+
* snoozedUntil: new Date("2026-12-25T23:59:59.000Z"),
|
|
18
|
+
* references: [{
|
|
19
|
+
* entityId: {
|
|
20
|
+
* type: MavenAGI.EntityType.ConversationMessage,
|
|
21
|
+
* appId: "app1",
|
|
22
|
+
* referenceId: "msgRef1201",
|
|
23
|
+
* organizationId: "acme",
|
|
24
|
+
* agentId: "support"
|
|
25
|
+
* },
|
|
26
|
+
* scopeEntityId: {
|
|
27
|
+
* type: MavenAGI.EntityType.Conversation,
|
|
28
|
+
* appId: "app1",
|
|
29
|
+
* referenceId: "ref1200",
|
|
30
|
+
* organizationId: "acme",
|
|
31
|
+
* agentId: "support"
|
|
32
|
+
* }
|
|
33
|
+
* }]
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
export interface InboxItemCreateRequest {
|
|
37
|
+
/** ID that uniquely identifies this inbox item */
|
|
38
|
+
inboxItemId: MavenAGI.EntityIdBase;
|
|
39
|
+
/** Status of the inbox item. */
|
|
40
|
+
status: MavenAGI.InboxItemStatus;
|
|
41
|
+
/** Severity of the inbox item. */
|
|
42
|
+
severity: MavenAGI.InboxItemSeverity;
|
|
43
|
+
/** Additional metadata associated with the inbox item. */
|
|
44
|
+
metadata: Record<string, string>;
|
|
45
|
+
/** Title of the inbox item. */
|
|
46
|
+
title?: string;
|
|
47
|
+
/** Description of the inbox item. */
|
|
48
|
+
description?: string;
|
|
49
|
+
/** An optional URL that can be associated with the inbox item. */
|
|
50
|
+
externalUrl?: string;
|
|
51
|
+
/** An optional deadline for the inbox item. */
|
|
52
|
+
deadline?: Date;
|
|
53
|
+
/** An optional timestamp until which the inbox item is snoozed. */
|
|
54
|
+
snoozedUntil?: Date;
|
|
55
|
+
/** An optional assignee for the inbox item. */
|
|
56
|
+
assignee?: string;
|
|
57
|
+
/** An optional list of references to other entities that are related to this inbox item. */
|
|
58
|
+
references?: MavenAGI.ScopedEntity[];
|
|
59
|
+
}
|
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./AddDocumentFixRequest"), exports);
|
|
18
18
|
__exportStar(require("./ApplyFixesRequest"), exports);
|
|
19
19
|
__exportStar(require("./InboxFilter"), exports);
|
|
20
|
+
__exportStar(require("./InboxItemCreateRequest"), exports);
|
|
20
21
|
__exportStar(require("./InboxSearchRequest"), exports);
|
|
21
22
|
__exportStar(require("./InboxSearchResponse"), exports);
|
|
@@ -15,7 +15,7 @@ export declare class Voice {
|
|
|
15
15
|
*
|
|
16
16
|
* Supports two token types:
|
|
17
17
|
* - **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
|
|
18
|
-
* - **websocket**: An
|
|
18
|
+
* - **websocket**: An ES256 JWT for direct WebSocket connections to /v1/voice/conversations
|
|
19
19
|
*
|
|
20
20
|
* Session tokens are required before establishing any voice connection.
|
|
21
21
|
*
|
|
@@ -28,7 +28,7 @@ export declare class Voice {
|
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* await client.voice.sessionToken({
|
|
31
|
-
* appUserId: "
|
|
31
|
+
* appUserId: "x",
|
|
32
32
|
* type: "webrtc"
|
|
33
33
|
* })
|
|
34
34
|
*/
|
|
@@ -59,7 +59,7 @@ class Voice {
|
|
|
59
59
|
*
|
|
60
60
|
* Supports two token types:
|
|
61
61
|
* - **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
|
|
62
|
-
* - **websocket**: An
|
|
62
|
+
* - **websocket**: An ES256 JWT for direct WebSocket connections to /v1/voice/conversations
|
|
63
63
|
*
|
|
64
64
|
* Session tokens are required before establishing any voice connection.
|
|
65
65
|
*
|
|
@@ -72,7 +72,7 @@ class Voice {
|
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* await client.voice.sessionToken({
|
|
75
|
-
* appUserId: "
|
|
75
|
+
* appUserId: "x",
|
|
76
76
|
* type: "webrtc"
|
|
77
77
|
* })
|
|
78
78
|
*/
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type * as MavenAGI from "../../../index";
|
|
2
2
|
export interface VoiceSessionTokenRequest {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The end user identity for the voice session.
|
|
5
|
+
* Must contain only alphanumeric characters, dots, hyphens, or underscores.
|
|
6
|
+
*/
|
|
4
7
|
appUserId: string;
|
|
5
8
|
/**
|
|
6
9
|
* The type of session token to generate.
|
|
@@ -9,6 +12,10 @@ export interface VoiceSessionTokenRequest {
|
|
|
9
12
|
type: MavenAGI.VoiceTokenType;
|
|
10
13
|
/**
|
|
11
14
|
* Arbitrary key-value metadata to associate with this session (e.g., conversationId, topic).
|
|
15
|
+
*
|
|
16
|
+
* **Constraints**: at most 50 keys, each key up to 256 characters, each value up to 4096 characters.
|
|
17
|
+
* Values are stored as-is — for small data, embed the value directly (e.g., `"callerName": "John Doe"`).
|
|
18
|
+
*
|
|
12
19
|
* For WebRTC tokens, this data is stored server-side and referenced by a secure ID
|
|
13
20
|
* encoded in the token identity, ensuring it cannot be tampered with by the client.
|
|
14
21
|
* For WebSocket tokens, clients can also pass data directly in the Config message.
|
package/dist/Client.js
CHANGED
|
@@ -62,8 +62,8 @@ class MavenAGIClient {
|
|
|
62
62
|
"X-Agent-Id": _options === null || _options === void 0 ? void 0 : _options.agentId,
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "mavenagi",
|
|
65
|
-
"X-Fern-SDK-Version": "1.2.
|
|
66
|
-
"User-Agent": "mavenagi/1.2.
|
|
65
|
+
"X-Fern-SDK-Version": "1.2.25",
|
|
66
|
+
"User-Agent": "mavenagi/1.2.25",
|
|
67
67
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
68
68
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
69
69
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -2,4 +2,18 @@ import type * as MavenAGI from "../../../index";
|
|
|
2
2
|
export interface InboxItemCustom extends MavenAGI.InboxItemBase {
|
|
3
3
|
/** Additional metadata associated with the inbox item. */
|
|
4
4
|
metadata: Record<string, string>;
|
|
5
|
+
/** Title of the inbox item. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Description of the inbox item. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** An optional URL that can be associated with the inbox item. */
|
|
10
|
+
externalUrl?: string;
|
|
11
|
+
/** An optional deadline for the inbox item. */
|
|
12
|
+
deadline?: Date;
|
|
13
|
+
/** An optional timestamp until which the inbox item is snoozed. */
|
|
14
|
+
snoozedUntil?: Date;
|
|
15
|
+
/** An optional assignee for the inbox item. */
|
|
16
|
+
assignee?: string;
|
|
17
|
+
/** An optional list of references to other entities that are related to this inbox item. */
|
|
18
|
+
references?: MavenAGI.ScopedEntity[];
|
|
5
19
|
}
|
|
@@ -14,5 +14,8 @@ export declare const UserEventName: {
|
|
|
14
14
|
/**
|
|
15
15
|
* A text was inserted into a field */
|
|
16
16
|
readonly TextInserted: "TEXT_INSERTED";
|
|
17
|
+
/**
|
|
18
|
+
* A CSAT rating was submitted */
|
|
19
|
+
readonly CsatSubmitted: "CSAT_SUBMITTED";
|
|
17
20
|
};
|
|
18
21
|
export type UserEventName = (typeof UserEventName)[keyof typeof UserEventName];
|
|
@@ -25,6 +25,51 @@ export declare class Inbox {
|
|
|
25
25
|
*/
|
|
26
26
|
search(request: MavenAGI.InboxSearchRequest, requestOptions?: Inbox.RequestOptions): core.HttpResponsePromise<MavenAGI.InboxSearchResponse>;
|
|
27
27
|
private __search;
|
|
28
|
+
/**
|
|
29
|
+
* Update an inbox item or create it if it doesn't exist.
|
|
30
|
+
*
|
|
31
|
+
* @param {MavenAGI.InboxItemCreateRequest} request
|
|
32
|
+
* @param {Inbox.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
|
+
*
|
|
34
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
35
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
36
|
+
* @throws {@link MavenAGI.ServerError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.inbox.createOrUpdate({
|
|
40
|
+
* inboxItemId: {
|
|
41
|
+
* referenceId: "todo-item-1"
|
|
42
|
+
* },
|
|
43
|
+
* status: "OPEN",
|
|
44
|
+
* severity: "HIGH",
|
|
45
|
+
* title: "Todo Item",
|
|
46
|
+
* description: "This is the first todo item.",
|
|
47
|
+
* metadata: {
|
|
48
|
+
* "key": "value"
|
|
49
|
+
* },
|
|
50
|
+
* externalUrl: "todo.com",
|
|
51
|
+
* deadline: new Date("2026-12-31T23:59:59.000Z"),
|
|
52
|
+
* snoozedUntil: new Date("2026-12-25T23:59:59.000Z"),
|
|
53
|
+
* references: [{
|
|
54
|
+
* entityId: {
|
|
55
|
+
* type: "CONVERSATION_MESSAGE",
|
|
56
|
+
* appId: "app1",
|
|
57
|
+
* referenceId: "msgRef1201",
|
|
58
|
+
* organizationId: "acme",
|
|
59
|
+
* agentId: "support"
|
|
60
|
+
* },
|
|
61
|
+
* scopeEntityId: {
|
|
62
|
+
* type: "CONVERSATION",
|
|
63
|
+
* appId: "app1",
|
|
64
|
+
* referenceId: "ref1200",
|
|
65
|
+
* organizationId: "acme",
|
|
66
|
+
* agentId: "support"
|
|
67
|
+
* }
|
|
68
|
+
* }]
|
|
69
|
+
* })
|
|
70
|
+
*/
|
|
71
|
+
createOrUpdate(request: MavenAGI.InboxItemCreateRequest, requestOptions?: Inbox.RequestOptions): core.HttpResponsePromise<MavenAGI.InboxItem>;
|
|
72
|
+
private __createOrUpdate;
|
|
28
73
|
/**
|
|
29
74
|
* Update inbox item tag fields. All tags provided will overwrite the existing tags on the inbox item.
|
|
30
75
|
*
|
|
@@ -149,6 +149,131 @@ class Inbox {
|
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Update an inbox item or create it if it doesn't exist.
|
|
154
|
+
*
|
|
155
|
+
* @param {MavenAGI.InboxItemCreateRequest} request
|
|
156
|
+
* @param {Inbox.RequestOptions} requestOptions - Request-specific configuration.
|
|
157
|
+
*
|
|
158
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
159
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
160
|
+
* @throws {@link MavenAGI.ServerError}
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* await client.inbox.createOrUpdate({
|
|
164
|
+
* inboxItemId: {
|
|
165
|
+
* referenceId: "todo-item-1"
|
|
166
|
+
* },
|
|
167
|
+
* status: "OPEN",
|
|
168
|
+
* severity: "HIGH",
|
|
169
|
+
* title: "Todo Item",
|
|
170
|
+
* description: "This is the first todo item.",
|
|
171
|
+
* metadata: {
|
|
172
|
+
* "key": "value"
|
|
173
|
+
* },
|
|
174
|
+
* externalUrl: "todo.com",
|
|
175
|
+
* deadline: new Date("2026-12-31T23:59:59.000Z"),
|
|
176
|
+
* snoozedUntil: new Date("2026-12-25T23:59:59.000Z"),
|
|
177
|
+
* references: [{
|
|
178
|
+
* entityId: {
|
|
179
|
+
* type: "CONVERSATION_MESSAGE",
|
|
180
|
+
* appId: "app1",
|
|
181
|
+
* referenceId: "msgRef1201",
|
|
182
|
+
* organizationId: "acme",
|
|
183
|
+
* agentId: "support"
|
|
184
|
+
* },
|
|
185
|
+
* scopeEntityId: {
|
|
186
|
+
* type: "CONVERSATION",
|
|
187
|
+
* appId: "app1",
|
|
188
|
+
* referenceId: "ref1200",
|
|
189
|
+
* organizationId: "acme",
|
|
190
|
+
* agentId: "support"
|
|
191
|
+
* }
|
|
192
|
+
* }]
|
|
193
|
+
* })
|
|
194
|
+
*/
|
|
195
|
+
createOrUpdate(request, requestOptions) {
|
|
196
|
+
return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions));
|
|
197
|
+
}
|
|
198
|
+
__createOrUpdate(request, requestOptions) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
201
|
+
const _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
202
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
203
|
+
"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,
|
|
204
|
+
"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,
|
|
205
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
206
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
207
|
+
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/inbox"),
|
|
208
|
+
method: "PUT",
|
|
209
|
+
headers: _headers,
|
|
210
|
+
contentType: "application/json",
|
|
211
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
212
|
+
requestType: "json",
|
|
213
|
+
body: serializers.InboxItemCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
214
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
215
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
216
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return {
|
|
220
|
+
data: serializers.InboxItem.parseOrThrow(_response.body, {
|
|
221
|
+
unrecognizedObjectKeys: "passthrough",
|
|
222
|
+
allowUnrecognizedUnionMembers: true,
|
|
223
|
+
allowUnrecognizedEnumValues: true,
|
|
224
|
+
breadcrumbsPrefix: ["response"],
|
|
225
|
+
}),
|
|
226
|
+
rawResponse: _response.rawResponse,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (_response.error.reason === "status-code") {
|
|
230
|
+
switch (_response.error.statusCode) {
|
|
231
|
+
case 404:
|
|
232
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
233
|
+
unrecognizedObjectKeys: "passthrough",
|
|
234
|
+
allowUnrecognizedUnionMembers: true,
|
|
235
|
+
allowUnrecognizedEnumValues: true,
|
|
236
|
+
breadcrumbsPrefix: ["response"],
|
|
237
|
+
}), _response.rawResponse);
|
|
238
|
+
case 400:
|
|
239
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
240
|
+
unrecognizedObjectKeys: "passthrough",
|
|
241
|
+
allowUnrecognizedUnionMembers: true,
|
|
242
|
+
allowUnrecognizedEnumValues: true,
|
|
243
|
+
breadcrumbsPrefix: ["response"],
|
|
244
|
+
}), _response.rawResponse);
|
|
245
|
+
case 500:
|
|
246
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
247
|
+
unrecognizedObjectKeys: "passthrough",
|
|
248
|
+
allowUnrecognizedUnionMembers: true,
|
|
249
|
+
allowUnrecognizedEnumValues: true,
|
|
250
|
+
breadcrumbsPrefix: ["response"],
|
|
251
|
+
}), _response.rawResponse);
|
|
252
|
+
default:
|
|
253
|
+
throw new errors.MavenAGIError({
|
|
254
|
+
statusCode: _response.error.statusCode,
|
|
255
|
+
body: _response.error.body,
|
|
256
|
+
rawResponse: _response.rawResponse,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
switch (_response.error.reason) {
|
|
261
|
+
case "non-json":
|
|
262
|
+
throw new errors.MavenAGIError({
|
|
263
|
+
statusCode: _response.error.statusCode,
|
|
264
|
+
body: _response.error.rawBody,
|
|
265
|
+
rawResponse: _response.rawResponse,
|
|
266
|
+
});
|
|
267
|
+
case "timeout":
|
|
268
|
+
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling PUT /v1/inbox.");
|
|
269
|
+
case "unknown":
|
|
270
|
+
throw new errors.MavenAGIError({
|
|
271
|
+
message: _response.error.errorMessage,
|
|
272
|
+
rawResponse: _response.rawResponse,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
152
277
|
/**
|
|
153
278
|
* Update inbox item tag fields. All tags provided will overwrite the existing tags on the inbox item.
|
|
154
279
|
*
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type * as MavenAGI from "../../../index";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* inboxItemId: {
|
|
6
|
+
* referenceId: "todo-item-1"
|
|
7
|
+
* },
|
|
8
|
+
* status: MavenAGI.InboxItemStatus.Open,
|
|
9
|
+
* severity: MavenAGI.InboxItemSeverity.High,
|
|
10
|
+
* title: "Todo Item",
|
|
11
|
+
* description: "This is the first todo item.",
|
|
12
|
+
* metadata: {
|
|
13
|
+
* "key": "value"
|
|
14
|
+
* },
|
|
15
|
+
* externalUrl: "todo.com",
|
|
16
|
+
* deadline: new Date("2026-12-31T23:59:59.000Z"),
|
|
17
|
+
* snoozedUntil: new Date("2026-12-25T23:59:59.000Z"),
|
|
18
|
+
* references: [{
|
|
19
|
+
* entityId: {
|
|
20
|
+
* type: MavenAGI.EntityType.ConversationMessage,
|
|
21
|
+
* appId: "app1",
|
|
22
|
+
* referenceId: "msgRef1201",
|
|
23
|
+
* organizationId: "acme",
|
|
24
|
+
* agentId: "support"
|
|
25
|
+
* },
|
|
26
|
+
* scopeEntityId: {
|
|
27
|
+
* type: MavenAGI.EntityType.Conversation,
|
|
28
|
+
* appId: "app1",
|
|
29
|
+
* referenceId: "ref1200",
|
|
30
|
+
* organizationId: "acme",
|
|
31
|
+
* agentId: "support"
|
|
32
|
+
* }
|
|
33
|
+
* }]
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
export interface InboxItemCreateRequest {
|
|
37
|
+
/** ID that uniquely identifies this inbox item */
|
|
38
|
+
inboxItemId: MavenAGI.EntityIdBase;
|
|
39
|
+
/** Status of the inbox item. */
|
|
40
|
+
status: MavenAGI.InboxItemStatus;
|
|
41
|
+
/** Severity of the inbox item. */
|
|
42
|
+
severity: MavenAGI.InboxItemSeverity;
|
|
43
|
+
/** Additional metadata associated with the inbox item. */
|
|
44
|
+
metadata: Record<string, string>;
|
|
45
|
+
/** Title of the inbox item. */
|
|
46
|
+
title?: string;
|
|
47
|
+
/** Description of the inbox item. */
|
|
48
|
+
description?: string;
|
|
49
|
+
/** An optional URL that can be associated with the inbox item. */
|
|
50
|
+
externalUrl?: string;
|
|
51
|
+
/** An optional deadline for the inbox item. */
|
|
52
|
+
deadline?: Date;
|
|
53
|
+
/** An optional timestamp until which the inbox item is snoozed. */
|
|
54
|
+
snoozedUntil?: Date;
|
|
55
|
+
/** An optional assignee for the inbox item. */
|
|
56
|
+
assignee?: string;
|
|
57
|
+
/** An optional list of references to other entities that are related to this inbox item. */
|
|
58
|
+
references?: MavenAGI.ScopedEntity[];
|
|
59
|
+
}
|
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./AddDocumentFixRequest"), exports);
|
|
18
18
|
__exportStar(require("./ApplyFixesRequest"), exports);
|
|
19
19
|
__exportStar(require("./InboxFilter"), exports);
|
|
20
|
+
__exportStar(require("./InboxItemCreateRequest"), exports);
|
|
20
21
|
__exportStar(require("./InboxSearchRequest"), exports);
|
|
21
22
|
__exportStar(require("./InboxSearchResponse"), exports);
|
|
@@ -15,7 +15,7 @@ export declare class Voice {
|
|
|
15
15
|
*
|
|
16
16
|
* Supports two token types:
|
|
17
17
|
* - **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
|
|
18
|
-
* - **websocket**: An
|
|
18
|
+
* - **websocket**: An ES256 JWT for direct WebSocket connections to /v1/voice/conversations
|
|
19
19
|
*
|
|
20
20
|
* Session tokens are required before establishing any voice connection.
|
|
21
21
|
*
|
|
@@ -28,7 +28,7 @@ export declare class Voice {
|
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* await client.voice.sessionToken({
|
|
31
|
-
* appUserId: "
|
|
31
|
+
* appUserId: "x",
|
|
32
32
|
* type: "webrtc"
|
|
33
33
|
* })
|
|
34
34
|
*/
|
|
@@ -59,7 +59,7 @@ class Voice {
|
|
|
59
59
|
*
|
|
60
60
|
* Supports two token types:
|
|
61
61
|
* - **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
|
|
62
|
-
* - **websocket**: An
|
|
62
|
+
* - **websocket**: An ES256 JWT for direct WebSocket connections to /v1/voice/conversations
|
|
63
63
|
*
|
|
64
64
|
* Session tokens are required before establishing any voice connection.
|
|
65
65
|
*
|
|
@@ -72,7 +72,7 @@ class Voice {
|
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* await client.voice.sessionToken({
|
|
75
|
-
* appUserId: "
|
|
75
|
+
* appUserId: "x",
|
|
76
76
|
* type: "webrtc"
|
|
77
77
|
* })
|
|
78
78
|
*/
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type * as MavenAGI from "../../../index";
|
|
2
2
|
export interface VoiceSessionTokenRequest {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The end user identity for the voice session.
|
|
5
|
+
* Must contain only alphanumeric characters, dots, hyphens, or underscores.
|
|
6
|
+
*/
|
|
4
7
|
appUserId: string;
|
|
5
8
|
/**
|
|
6
9
|
* The type of session token to generate.
|
|
@@ -9,6 +12,10 @@ export interface VoiceSessionTokenRequest {
|
|
|
9
12
|
type: MavenAGI.VoiceTokenType;
|
|
10
13
|
/**
|
|
11
14
|
* Arbitrary key-value metadata to associate with this session (e.g., conversationId, topic).
|
|
15
|
+
*
|
|
16
|
+
* **Constraints**: at most 50 keys, each key up to 256 characters, each value up to 4096 characters.
|
|
17
|
+
* Values are stored as-is — for small data, embed the value directly (e.g., `"callerName": "John Doe"`).
|
|
18
|
+
*
|
|
12
19
|
* For WebRTC tokens, this data is stored server-side and referenced by a secure ID
|
|
13
20
|
* encoded in the token identity, ensuring it cannot be tampered with by the client.
|
|
14
21
|
* For WebSocket tokens, clients can also pass data directly in the Config message.
|
|
@@ -2,9 +2,17 @@ import type * as MavenAGI from "../../../../api/index";
|
|
|
2
2
|
import * as core from "../../../../core";
|
|
3
3
|
import type * as serializers from "../../../index";
|
|
4
4
|
import { InboxItemBase } from "./InboxItemBase";
|
|
5
|
+
import { ScopedEntity } from "./ScopedEntity";
|
|
5
6
|
export declare const InboxItemCustom: core.serialization.ObjectSchema<serializers.InboxItemCustom.Raw, MavenAGI.InboxItemCustom>;
|
|
6
7
|
export declare namespace InboxItemCustom {
|
|
7
8
|
interface Raw extends InboxItemBase.Raw {
|
|
8
9
|
metadata: Record<string, string>;
|
|
10
|
+
title?: string | null;
|
|
11
|
+
description?: string | null;
|
|
12
|
+
externalUrl?: string | null;
|
|
13
|
+
deadline?: string | null;
|
|
14
|
+
snoozedUntil?: string | null;
|
|
15
|
+
assignee?: string | null;
|
|
16
|
+
references?: ScopedEntity.Raw[] | null;
|
|
9
17
|
}
|
|
10
18
|
}
|
|
@@ -37,8 +37,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
37
|
exports.InboxItemCustom = void 0;
|
|
38
38
|
const core = __importStar(require("../../../../core"));
|
|
39
39
|
const InboxItemBase_1 = require("./InboxItemBase");
|
|
40
|
+
const ScopedEntity_1 = require("./ScopedEntity");
|
|
40
41
|
exports.InboxItemCustom = core.serialization
|
|
41
42
|
.object({
|
|
42
43
|
metadata: core.serialization.record(core.serialization.string(), core.serialization.string()),
|
|
44
|
+
title: core.serialization.string().optional(),
|
|
45
|
+
description: core.serialization.string().optional(),
|
|
46
|
+
externalUrl: core.serialization.string().optional(),
|
|
47
|
+
deadline: core.serialization.date().optional(),
|
|
48
|
+
snoozedUntil: core.serialization.date().optional(),
|
|
49
|
+
assignee: core.serialization.string().optional(),
|
|
50
|
+
references: core.serialization.list(ScopedEntity_1.ScopedEntity).optional(),
|
|
43
51
|
})
|
|
44
52
|
.extend(InboxItemBase_1.InboxItemBase);
|
|
@@ -3,5 +3,5 @@ import * as core from "../../../../core";
|
|
|
3
3
|
import type * as serializers from "../../../index";
|
|
4
4
|
export declare const UserEventName: core.serialization.Schema<serializers.UserEventName.Raw, MavenAGI.UserEventName>;
|
|
5
5
|
export declare namespace UserEventName {
|
|
6
|
-
type Raw = "BUTTON_CLICKED" | "LINK_CLICKED" | "CHAT_OPENED" | "CHAT_CLOSED" | "TEXT_INSERTED";
|
|
6
|
+
type Raw = "BUTTON_CLICKED" | "LINK_CLICKED" | "CHAT_OPENED" | "CHAT_CLOSED" | "TEXT_INSERTED" | "CSAT_SUBMITTED";
|
|
7
7
|
}
|
|
@@ -36,4 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.UserEventName = void 0;
|
|
38
38
|
const core = __importStar(require("../../../../core"));
|
|
39
|
-
exports.UserEventName = core.serialization.enum_([
|
|
39
|
+
exports.UserEventName = core.serialization.enum_([
|
|
40
|
+
"BUTTON_CLICKED",
|
|
41
|
+
"LINK_CLICKED",
|
|
42
|
+
"CHAT_OPENED",
|
|
43
|
+
"CHAT_CLOSED",
|
|
44
|
+
"TEXT_INSERTED",
|
|
45
|
+
"CSAT_SUBMITTED",
|
|
46
|
+
]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as MavenAGI from "../../../../api/index";
|
|
2
|
+
import * as core from "../../../../core";
|
|
3
|
+
import type * as serializers from "../../../index";
|
|
4
|
+
import { EntityIdBase } from "../../commons/types/EntityIdBase";
|
|
5
|
+
import { InboxItemSeverity } from "../../commons/types/InboxItemSeverity";
|
|
6
|
+
import { InboxItemStatus } from "../../commons/types/InboxItemStatus";
|
|
7
|
+
import { ScopedEntity } from "../../commons/types/ScopedEntity";
|
|
8
|
+
export declare const InboxItemCreateRequest: core.serialization.ObjectSchema<serializers.InboxItemCreateRequest.Raw, MavenAGI.InboxItemCreateRequest>;
|
|
9
|
+
export declare namespace InboxItemCreateRequest {
|
|
10
|
+
interface Raw {
|
|
11
|
+
inboxItemId: EntityIdBase.Raw;
|
|
12
|
+
status: InboxItemStatus.Raw;
|
|
13
|
+
severity: InboxItemSeverity.Raw;
|
|
14
|
+
metadata: Record<string, string>;
|
|
15
|
+
title?: string | null;
|
|
16
|
+
description?: string | null;
|
|
17
|
+
externalUrl?: string | null;
|
|
18
|
+
deadline?: string | null;
|
|
19
|
+
snoozedUntil?: string | null;
|
|
20
|
+
assignee?: string | null;
|
|
21
|
+
references?: ScopedEntity.Raw[] | null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.InboxItemCreateRequest = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core"));
|
|
39
|
+
const EntityIdBase_1 = require("../../commons/types/EntityIdBase");
|
|
40
|
+
const InboxItemSeverity_1 = require("../../commons/types/InboxItemSeverity");
|
|
41
|
+
const InboxItemStatus_1 = require("../../commons/types/InboxItemStatus");
|
|
42
|
+
const ScopedEntity_1 = require("../../commons/types/ScopedEntity");
|
|
43
|
+
exports.InboxItemCreateRequest = core.serialization.object({
|
|
44
|
+
inboxItemId: EntityIdBase_1.EntityIdBase,
|
|
45
|
+
status: InboxItemStatus_1.InboxItemStatus,
|
|
46
|
+
severity: InboxItemSeverity_1.InboxItemSeverity,
|
|
47
|
+
metadata: core.serialization.record(core.serialization.string(), core.serialization.string()),
|
|
48
|
+
title: core.serialization.string().optional(),
|
|
49
|
+
description: core.serialization.string().optional(),
|
|
50
|
+
externalUrl: core.serialization.string().optional(),
|
|
51
|
+
deadline: core.serialization.date().optional(),
|
|
52
|
+
snoozedUntil: core.serialization.date().optional(),
|
|
53
|
+
assignee: core.serialization.string().optional(),
|
|
54
|
+
references: core.serialization.list(ScopedEntity_1.ScopedEntity).optional(),
|
|
55
|
+
});
|
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./AddDocumentFixRequest"), exports);
|
|
18
18
|
__exportStar(require("./ApplyFixesRequest"), exports);
|
|
19
19
|
__exportStar(require("./InboxFilter"), exports);
|
|
20
|
+
__exportStar(require("./InboxItemCreateRequest"), exports);
|
|
20
21
|
__exportStar(require("./InboxSearchRequest"), exports);
|
|
21
22
|
__exportStar(require("./InboxSearchResponse"), exports);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.2.
|
|
1
|
+
export declare const SDK_VERSION = "1.2.25";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -3486,6 +3486,99 @@ await client.inbox.search({});
|
|
|
3486
3486
|
</dl>
|
|
3487
3487
|
|
|
3488
3488
|
|
|
3489
|
+
</dd>
|
|
3490
|
+
</dl>
|
|
3491
|
+
</details>
|
|
3492
|
+
|
|
3493
|
+
<details><summary><code>client.inbox.<a href="/src/api/resources/inbox/client/Client.ts">createOrUpdate</a>({ ...params }) -> MavenAGI.InboxItem</code></summary>
|
|
3494
|
+
<dl>
|
|
3495
|
+
<dd>
|
|
3496
|
+
|
|
3497
|
+
#### 📝 Description
|
|
3498
|
+
|
|
3499
|
+
<dl>
|
|
3500
|
+
<dd>
|
|
3501
|
+
|
|
3502
|
+
<dl>
|
|
3503
|
+
<dd>
|
|
3504
|
+
|
|
3505
|
+
Update an inbox item or create it if it doesn't exist.
|
|
3506
|
+
</dd>
|
|
3507
|
+
</dl>
|
|
3508
|
+
</dd>
|
|
3509
|
+
</dl>
|
|
3510
|
+
|
|
3511
|
+
#### 🔌 Usage
|
|
3512
|
+
|
|
3513
|
+
<dl>
|
|
3514
|
+
<dd>
|
|
3515
|
+
|
|
3516
|
+
<dl>
|
|
3517
|
+
<dd>
|
|
3518
|
+
|
|
3519
|
+
```typescript
|
|
3520
|
+
await client.inbox.createOrUpdate({
|
|
3521
|
+
inboxItemId: {
|
|
3522
|
+
referenceId: "todo-item-1"
|
|
3523
|
+
},
|
|
3524
|
+
status: "OPEN",
|
|
3525
|
+
severity: "HIGH",
|
|
3526
|
+
title: "Todo Item",
|
|
3527
|
+
description: "This is the first todo item.",
|
|
3528
|
+
metadata: {
|
|
3529
|
+
"key": "value"
|
|
3530
|
+
},
|
|
3531
|
+
externalUrl: "todo.com",
|
|
3532
|
+
deadline: new Date("2026-12-31T23:59:59.000Z"),
|
|
3533
|
+
snoozedUntil: new Date("2026-12-25T23:59:59.000Z"),
|
|
3534
|
+
references: [{
|
|
3535
|
+
entityId: {
|
|
3536
|
+
type: "CONVERSATION_MESSAGE",
|
|
3537
|
+
appId: "app1",
|
|
3538
|
+
referenceId: "msgRef1201",
|
|
3539
|
+
organizationId: "acme",
|
|
3540
|
+
agentId: "support"
|
|
3541
|
+
},
|
|
3542
|
+
scopeEntityId: {
|
|
3543
|
+
type: "CONVERSATION",
|
|
3544
|
+
appId: "app1",
|
|
3545
|
+
referenceId: "ref1200",
|
|
3546
|
+
organizationId: "acme",
|
|
3547
|
+
agentId: "support"
|
|
3548
|
+
}
|
|
3549
|
+
}]
|
|
3550
|
+
});
|
|
3551
|
+
|
|
3552
|
+
```
|
|
3553
|
+
</dd>
|
|
3554
|
+
</dl>
|
|
3555
|
+
</dd>
|
|
3556
|
+
</dl>
|
|
3557
|
+
|
|
3558
|
+
#### ⚙️ Parameters
|
|
3559
|
+
|
|
3560
|
+
<dl>
|
|
3561
|
+
<dd>
|
|
3562
|
+
|
|
3563
|
+
<dl>
|
|
3564
|
+
<dd>
|
|
3565
|
+
|
|
3566
|
+
**request:** `MavenAGI.InboxItemCreateRequest`
|
|
3567
|
+
|
|
3568
|
+
</dd>
|
|
3569
|
+
</dl>
|
|
3570
|
+
|
|
3571
|
+
<dl>
|
|
3572
|
+
<dd>
|
|
3573
|
+
|
|
3574
|
+
**requestOptions:** `Inbox.RequestOptions`
|
|
3575
|
+
|
|
3576
|
+
</dd>
|
|
3577
|
+
</dl>
|
|
3578
|
+
</dd>
|
|
3579
|
+
</dl>
|
|
3580
|
+
|
|
3581
|
+
|
|
3489
3582
|
</dd>
|
|
3490
3583
|
</dl>
|
|
3491
3584
|
</details>
|
|
@@ -6496,7 +6589,7 @@ Creates a short-lived session token for authenticating voice connections.
|
|
|
6496
6589
|
|
|
6497
6590
|
Supports two token types:
|
|
6498
6591
|
- **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
|
|
6499
|
-
- **websocket**: An
|
|
6592
|
+
- **websocket**: An ES256 JWT for direct WebSocket connections to /v1/voice/conversations
|
|
6500
6593
|
|
|
6501
6594
|
Session tokens are required before establishing any voice connection.
|
|
6502
6595
|
</dd>
|
|
@@ -6514,7 +6607,7 @@ Session tokens are required before establishing any voice connection.
|
|
|
6514
6607
|
|
|
6515
6608
|
```typescript
|
|
6516
6609
|
await client.voice.sessionToken({
|
|
6517
|
-
appUserId: "
|
|
6610
|
+
appUserId: "x",
|
|
6518
6611
|
type: "webrtc"
|
|
6519
6612
|
});
|
|
6520
6613
|
|
|
@@ -2,9 +2,17 @@ import type * as MavenAGI from "../../../../api/index";
|
|
|
2
2
|
import * as core from "../../../../core";
|
|
3
3
|
import type * as serializers from "../../../index";
|
|
4
4
|
import { InboxItemBase } from "./InboxItemBase";
|
|
5
|
+
import { ScopedEntity } from "./ScopedEntity";
|
|
5
6
|
export declare const InboxItemCustom: core.serialization.ObjectSchema<serializers.InboxItemCustom.Raw, MavenAGI.InboxItemCustom>;
|
|
6
7
|
export declare namespace InboxItemCustom {
|
|
7
8
|
interface Raw extends InboxItemBase.Raw {
|
|
8
9
|
metadata: Record<string, string>;
|
|
10
|
+
title?: string | null;
|
|
11
|
+
description?: string | null;
|
|
12
|
+
externalUrl?: string | null;
|
|
13
|
+
deadline?: string | null;
|
|
14
|
+
snoozedUntil?: string | null;
|
|
15
|
+
assignee?: string | null;
|
|
16
|
+
references?: ScopedEntity.Raw[] | null;
|
|
9
17
|
}
|
|
10
18
|
}
|
|
@@ -37,8 +37,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
37
|
exports.InboxItemCustom = void 0;
|
|
38
38
|
const core = __importStar(require("../../../../core"));
|
|
39
39
|
const InboxItemBase_1 = require("./InboxItemBase");
|
|
40
|
+
const ScopedEntity_1 = require("./ScopedEntity");
|
|
40
41
|
exports.InboxItemCustom = core.serialization
|
|
41
42
|
.object({
|
|
42
43
|
metadata: core.serialization.record(core.serialization.string(), core.serialization.string()),
|
|
44
|
+
title: core.serialization.string().optional(),
|
|
45
|
+
description: core.serialization.string().optional(),
|
|
46
|
+
externalUrl: core.serialization.string().optional(),
|
|
47
|
+
deadline: core.serialization.date().optional(),
|
|
48
|
+
snoozedUntil: core.serialization.date().optional(),
|
|
49
|
+
assignee: core.serialization.string().optional(),
|
|
50
|
+
references: core.serialization.list(ScopedEntity_1.ScopedEntity).optional(),
|
|
43
51
|
})
|
|
44
52
|
.extend(InboxItemBase_1.InboxItemBase);
|
|
@@ -3,5 +3,5 @@ import * as core from "../../../../core";
|
|
|
3
3
|
import type * as serializers from "../../../index";
|
|
4
4
|
export declare const UserEventName: core.serialization.Schema<serializers.UserEventName.Raw, MavenAGI.UserEventName>;
|
|
5
5
|
export declare namespace UserEventName {
|
|
6
|
-
type Raw = "BUTTON_CLICKED" | "LINK_CLICKED" | "CHAT_OPENED" | "CHAT_CLOSED" | "TEXT_INSERTED";
|
|
6
|
+
type Raw = "BUTTON_CLICKED" | "LINK_CLICKED" | "CHAT_OPENED" | "CHAT_CLOSED" | "TEXT_INSERTED" | "CSAT_SUBMITTED";
|
|
7
7
|
}
|
|
@@ -36,4 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.UserEventName = void 0;
|
|
38
38
|
const core = __importStar(require("../../../../core"));
|
|
39
|
-
exports.UserEventName = core.serialization.enum_([
|
|
39
|
+
exports.UserEventName = core.serialization.enum_([
|
|
40
|
+
"BUTTON_CLICKED",
|
|
41
|
+
"LINK_CLICKED",
|
|
42
|
+
"CHAT_OPENED",
|
|
43
|
+
"CHAT_CLOSED",
|
|
44
|
+
"TEXT_INSERTED",
|
|
45
|
+
"CSAT_SUBMITTED",
|
|
46
|
+
]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as MavenAGI from "../../../../api/index";
|
|
2
|
+
import * as core from "../../../../core";
|
|
3
|
+
import type * as serializers from "../../../index";
|
|
4
|
+
import { EntityIdBase } from "../../commons/types/EntityIdBase";
|
|
5
|
+
import { InboxItemSeverity } from "../../commons/types/InboxItemSeverity";
|
|
6
|
+
import { InboxItemStatus } from "../../commons/types/InboxItemStatus";
|
|
7
|
+
import { ScopedEntity } from "../../commons/types/ScopedEntity";
|
|
8
|
+
export declare const InboxItemCreateRequest: core.serialization.ObjectSchema<serializers.InboxItemCreateRequest.Raw, MavenAGI.InboxItemCreateRequest>;
|
|
9
|
+
export declare namespace InboxItemCreateRequest {
|
|
10
|
+
interface Raw {
|
|
11
|
+
inboxItemId: EntityIdBase.Raw;
|
|
12
|
+
status: InboxItemStatus.Raw;
|
|
13
|
+
severity: InboxItemSeverity.Raw;
|
|
14
|
+
metadata: Record<string, string>;
|
|
15
|
+
title?: string | null;
|
|
16
|
+
description?: string | null;
|
|
17
|
+
externalUrl?: string | null;
|
|
18
|
+
deadline?: string | null;
|
|
19
|
+
snoozedUntil?: string | null;
|
|
20
|
+
assignee?: string | null;
|
|
21
|
+
references?: ScopedEntity.Raw[] | null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.InboxItemCreateRequest = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core"));
|
|
39
|
+
const EntityIdBase_1 = require("../../commons/types/EntityIdBase");
|
|
40
|
+
const InboxItemSeverity_1 = require("../../commons/types/InboxItemSeverity");
|
|
41
|
+
const InboxItemStatus_1 = require("../../commons/types/InboxItemStatus");
|
|
42
|
+
const ScopedEntity_1 = require("../../commons/types/ScopedEntity");
|
|
43
|
+
exports.InboxItemCreateRequest = core.serialization.object({
|
|
44
|
+
inboxItemId: EntityIdBase_1.EntityIdBase,
|
|
45
|
+
status: InboxItemStatus_1.InboxItemStatus,
|
|
46
|
+
severity: InboxItemSeverity_1.InboxItemSeverity,
|
|
47
|
+
metadata: core.serialization.record(core.serialization.string(), core.serialization.string()),
|
|
48
|
+
title: core.serialization.string().optional(),
|
|
49
|
+
description: core.serialization.string().optional(),
|
|
50
|
+
externalUrl: core.serialization.string().optional(),
|
|
51
|
+
deadline: core.serialization.date().optional(),
|
|
52
|
+
snoozedUntil: core.serialization.date().optional(),
|
|
53
|
+
assignee: core.serialization.string().optional(),
|
|
54
|
+
references: core.serialization.list(ScopedEntity_1.ScopedEntity).optional(),
|
|
55
|
+
});
|
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./AddDocumentFixRequest"), exports);
|
|
18
18
|
__exportStar(require("./ApplyFixesRequest"), exports);
|
|
19
19
|
__exportStar(require("./InboxFilter"), exports);
|
|
20
|
+
__exportStar(require("./InboxItemCreateRequest"), exports);
|
|
20
21
|
__exportStar(require("./InboxSearchRequest"), exports);
|
|
21
22
|
__exportStar(require("./InboxSearchResponse"), exports);
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.2.
|
|
1
|
+
export declare const SDK_VERSION = "1.2.25";
|
package/version.js
CHANGED