mavenagi 1.2.24 → 1.2.26

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.
Files changed (74) hide show
  1. package/Client.js +2 -2
  2. package/api/resources/commons/types/InboxItemCustom.d.ts +14 -0
  3. package/api/resources/commons/types/UserEventName.d.ts +3 -0
  4. package/api/resources/commons/types/UserEventName.js +3 -0
  5. package/api/resources/inbox/client/Client.d.ts +45 -0
  6. package/api/resources/inbox/client/Client.js +125 -0
  7. package/api/resources/inbox/types/InboxItemCreateRequest.d.ts +59 -0
  8. package/api/resources/inbox/types/InboxItemCreateRequest.js +3 -0
  9. package/api/resources/inbox/types/index.d.ts +1 -0
  10. package/api/resources/inbox/types/index.js +1 -0
  11. package/api/resources/knowledge/client/Client.d.ts +19 -0
  12. package/api/resources/knowledge/client/Client.js +93 -0
  13. package/api/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.d.ts +5 -0
  14. package/api/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.js +3 -0
  15. package/api/resources/knowledge/types/index.d.ts +1 -0
  16. package/api/resources/knowledge/types/index.js +1 -0
  17. package/api/resources/triggers/types/EventTriggerBase.d.ts +2 -0
  18. package/api/resources/voice/client/Client.d.ts +2 -2
  19. package/api/resources/voice/client/Client.js +2 -2
  20. package/api/resources/voice/types/VoiceSessionTokenRequest.d.ts +8 -1
  21. package/dist/Client.js +2 -2
  22. package/dist/api/resources/commons/types/InboxItemCustom.d.ts +14 -0
  23. package/dist/api/resources/commons/types/UserEventName.d.ts +3 -0
  24. package/dist/api/resources/commons/types/UserEventName.js +3 -0
  25. package/dist/api/resources/inbox/client/Client.d.ts +45 -0
  26. package/dist/api/resources/inbox/client/Client.js +125 -0
  27. package/dist/api/resources/inbox/types/InboxItemCreateRequest.d.ts +59 -0
  28. package/dist/api/resources/inbox/types/InboxItemCreateRequest.js +3 -0
  29. package/dist/api/resources/inbox/types/index.d.ts +1 -0
  30. package/dist/api/resources/inbox/types/index.js +1 -0
  31. package/dist/api/resources/knowledge/client/Client.d.ts +19 -0
  32. package/dist/api/resources/knowledge/client/Client.js +93 -0
  33. package/dist/api/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.d.ts +5 -0
  34. package/dist/api/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.js +3 -0
  35. package/dist/api/resources/knowledge/types/index.d.ts +1 -0
  36. package/dist/api/resources/knowledge/types/index.js +1 -0
  37. package/dist/api/resources/triggers/types/EventTriggerBase.d.ts +2 -0
  38. package/dist/api/resources/voice/client/Client.d.ts +2 -2
  39. package/dist/api/resources/voice/client/Client.js +2 -2
  40. package/dist/api/resources/voice/types/VoiceSessionTokenRequest.d.ts +8 -1
  41. package/dist/serialization/resources/commons/types/InboxItemCustom.d.ts +8 -0
  42. package/dist/serialization/resources/commons/types/InboxItemCustom.js +8 -0
  43. package/dist/serialization/resources/commons/types/UserEventName.d.ts +1 -1
  44. package/dist/serialization/resources/commons/types/UserEventName.js +8 -1
  45. package/dist/serialization/resources/inbox/types/InboxItemCreateRequest.d.ts +23 -0
  46. package/dist/serialization/resources/inbox/types/InboxItemCreateRequest.js +55 -0
  47. package/dist/serialization/resources/inbox/types/index.d.ts +1 -0
  48. package/dist/serialization/resources/inbox/types/index.js +1 -0
  49. package/dist/serialization/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.d.ts +10 -0
  50. package/dist/serialization/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.js +42 -0
  51. package/dist/serialization/resources/knowledge/types/index.d.ts +1 -0
  52. package/dist/serialization/resources/knowledge/types/index.js +1 -0
  53. package/dist/serialization/resources/triggers/types/EventTriggerBase.d.ts +1 -0
  54. package/dist/serialization/resources/triggers/types/EventTriggerBase.js +1 -0
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/package.json +1 -1
  58. package/reference.md +169 -2
  59. package/serialization/resources/commons/types/InboxItemCustom.d.ts +8 -0
  60. package/serialization/resources/commons/types/InboxItemCustom.js +8 -0
  61. package/serialization/resources/commons/types/UserEventName.d.ts +1 -1
  62. package/serialization/resources/commons/types/UserEventName.js +8 -1
  63. package/serialization/resources/inbox/types/InboxItemCreateRequest.d.ts +23 -0
  64. package/serialization/resources/inbox/types/InboxItemCreateRequest.js +55 -0
  65. package/serialization/resources/inbox/types/index.d.ts +1 -0
  66. package/serialization/resources/inbox/types/index.js +1 -0
  67. package/serialization/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.d.ts +10 -0
  68. package/serialization/resources/knowledge/types/CancelKnowledgeBaseVersionRequest.js +42 -0
  69. package/serialization/resources/knowledge/types/index.d.ts +1 -0
  70. package/serialization/resources/knowledge/types/index.js +1 -0
  71. package/serialization/resources/triggers/types/EventTriggerBase.d.ts +1 -0
  72. package/serialization/resources/triggers/types/EventTriggerBase.js +1 -0
  73. package/version.d.ts +1 -1
  74. 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.24",
66
- "User-Agent": "mavenagi/1.2.24",
65
+ "X-Fern-SDK-Version": "1.2.26",
66
+ "User-Agent": "mavenagi/1.2.26",
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];
@@ -18,4 +18,7 @@ exports.UserEventName = {
18
18
  /**
19
19
  * A text was inserted into a field */
20
20
  TextInserted: "TEXT_INSERTED",
21
+ /**
22
+ * A CSAT rating was submitted */
23
+ CsatSubmitted: "CSAT_SUBMITTED",
21
24
  };
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  export * from "./AddDocumentFixRequest";
2
2
  export * from "./ApplyFixesRequest";
3
3
  export * from "./InboxFilter";
4
+ export * from "./InboxItemCreateRequest";
4
5
  export * from "./InboxSearchRequest";
5
6
  export * from "./InboxSearchResponse";
@@ -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);
@@ -82,6 +82,25 @@ export declare class Knowledge {
82
82
  */
83
83
  refreshKnowledgeBase(knowledgeBaseReferenceId: string, request: MavenAGI.KnowledgeBaseRefreshRequest, requestOptions?: Knowledge.RequestOptions): core.HttpResponsePromise<void>;
84
84
  private __refreshKnowledgeBase;
85
+ /**
86
+ * in-progress knowledge base version.
87
+ *
88
+ * If the knowledge base has a version that is currently being ingested,
89
+ * this will cancel the ingestion workflow and set the version status to FAILED.
90
+ *
91
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to cancel ingestion for. All other entity ID fields are inferred from the request.
92
+ * @param {MavenAGI.CancelKnowledgeBaseVersionRequest} request
93
+ * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
94
+ *
95
+ * @throws {@link MavenAGI.NotFoundError}
96
+ * @throws {@link MavenAGI.BadRequestError}
97
+ * @throws {@link MavenAGI.ServerError}
98
+ *
99
+ * @example
100
+ * await client.knowledge.cancelKnowledgeBaseVersion("knowledgeBaseReferenceId", {})
101
+ */
102
+ cancelKnowledgeBaseVersion(knowledgeBaseReferenceId: string, request: MavenAGI.CancelKnowledgeBaseVersionRequest, requestOptions?: Knowledge.RequestOptions): core.HttpResponsePromise<void>;
103
+ private __cancelKnowledgeBaseVersion;
85
104
  /**
86
105
  * Update mutable knowledge base fields
87
106
  *
@@ -440,6 +440,99 @@ class Knowledge {
440
440
  }
441
441
  });
442
442
  }
443
+ /**
444
+ * in-progress knowledge base version.
445
+ *
446
+ * If the knowledge base has a version that is currently being ingested,
447
+ * this will cancel the ingestion workflow and set the version status to FAILED.
448
+ *
449
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to cancel ingestion for. All other entity ID fields are inferred from the request.
450
+ * @param {MavenAGI.CancelKnowledgeBaseVersionRequest} request
451
+ * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
452
+ *
453
+ * @throws {@link MavenAGI.NotFoundError}
454
+ * @throws {@link MavenAGI.BadRequestError}
455
+ * @throws {@link MavenAGI.ServerError}
456
+ *
457
+ * @example
458
+ * await client.knowledge.cancelKnowledgeBaseVersion("knowledgeBaseReferenceId", {})
459
+ */
460
+ cancelKnowledgeBaseVersion(knowledgeBaseReferenceId, request, requestOptions) {
461
+ return core.HttpResponsePromise.fromPromise(this.__cancelKnowledgeBaseVersion(knowledgeBaseReferenceId, request, requestOptions));
462
+ }
463
+ __cancelKnowledgeBaseVersion(knowledgeBaseReferenceId, request, requestOptions) {
464
+ return __awaiter(this, void 0, void 0, function* () {
465
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
466
+ const _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
467
+ Authorization: yield this._getAuthorizationHeader(),
468
+ "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,
469
+ "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,
470
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
471
+ const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
472
+ 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/knowledge/${core.url.encodePathParam(knowledgeBaseReferenceId)}/cancel`),
473
+ method: "POST",
474
+ headers: _headers,
475
+ contentType: "application/json",
476
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
477
+ requestType: "json",
478
+ body: serializers.CancelKnowledgeBaseVersionRequest.jsonOrThrow(request, {
479
+ unrecognizedObjectKeys: "strip",
480
+ }),
481
+ 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,
482
+ 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,
483
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
484
+ });
485
+ if (_response.ok) {
486
+ return { data: undefined, rawResponse: _response.rawResponse };
487
+ }
488
+ if (_response.error.reason === "status-code") {
489
+ switch (_response.error.statusCode) {
490
+ case 404:
491
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
492
+ unrecognizedObjectKeys: "passthrough",
493
+ allowUnrecognizedUnionMembers: true,
494
+ allowUnrecognizedEnumValues: true,
495
+ breadcrumbsPrefix: ["response"],
496
+ }), _response.rawResponse);
497
+ case 400:
498
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
499
+ unrecognizedObjectKeys: "passthrough",
500
+ allowUnrecognizedUnionMembers: true,
501
+ allowUnrecognizedEnumValues: true,
502
+ breadcrumbsPrefix: ["response"],
503
+ }), _response.rawResponse);
504
+ case 500:
505
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
506
+ unrecognizedObjectKeys: "passthrough",
507
+ allowUnrecognizedUnionMembers: true,
508
+ allowUnrecognizedEnumValues: true,
509
+ breadcrumbsPrefix: ["response"],
510
+ }), _response.rawResponse);
511
+ default:
512
+ throw new errors.MavenAGIError({
513
+ statusCode: _response.error.statusCode,
514
+ body: _response.error.body,
515
+ rawResponse: _response.rawResponse,
516
+ });
517
+ }
518
+ }
519
+ switch (_response.error.reason) {
520
+ case "non-json":
521
+ throw new errors.MavenAGIError({
522
+ statusCode: _response.error.statusCode,
523
+ body: _response.error.rawBody,
524
+ rawResponse: _response.rawResponse,
525
+ });
526
+ case "timeout":
527
+ throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/knowledge/{knowledgeBaseReferenceId}/cancel.");
528
+ case "unknown":
529
+ throw new errors.MavenAGIError({
530
+ message: _response.error.errorMessage,
531
+ rawResponse: _response.rawResponse,
532
+ });
533
+ }
534
+ });
535
+ }
443
536
  /**
444
537
  * Update mutable knowledge base fields
445
538
  *
@@ -0,0 +1,5 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ export interface CancelKnowledgeBaseVersionRequest {
3
+ /** ID that uniquely identifies which knowledge base version to cancel. If not provided will use the most recent version of the knowledge base. */
4
+ versionId?: MavenAGI.EntityIdWithoutAgent;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,5 @@
1
1
  export * from "./BaseKnowledgeDocument";
2
+ export * from "./CancelKnowledgeBaseVersionRequest";
2
3
  export * from "./FinalizeKnowledgeBaseVersionRequest";
3
4
  export * from "./KnowledgeBaseField";
4
5
  export * from "./KnowledgeBaseFilter";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BaseKnowledgeDocument"), exports);
18
+ __exportStar(require("./CancelKnowledgeBaseVersionRequest"), exports);
18
19
  __exportStar(require("./FinalizeKnowledgeBaseVersionRequest"), exports);
19
20
  __exportStar(require("./KnowledgeBaseField"), exports);
20
21
  __exportStar(require("./KnowledgeBaseFilter"), exports);
@@ -1,5 +1,7 @@
1
1
  import type * as MavenAGI from "../../../index";
2
2
  export interface EventTriggerBase {
3
+ /** The name of the trigger, displayed to end users. If not set, a name is derived from the app ID and trigger type. */
4
+ name?: string;
3
5
  /** The description of what the event trigger does, shown in the Maven Dashboard */
4
6
  description: string;
5
7
  /**
@@ -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 RS256 JWT for direct WebSocket connections to /v1/voice/conversations
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: "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 RS256 JWT for direct WebSocket connections to /v1/voice/conversations
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: "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
- /** The end user identity for the voice session. */
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.24",
66
- "User-Agent": "mavenagi/1.2.24",
65
+ "X-Fern-SDK-Version": "1.2.26",
66
+ "User-Agent": "mavenagi/1.2.26",
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];
@@ -18,4 +18,7 @@ exports.UserEventName = {
18
18
  /**
19
19
  * A text was inserted into a field */
20
20
  TextInserted: "TEXT_INSERTED",
21
+ /**
22
+ * A CSAT rating was submitted */
23
+ CsatSubmitted: "CSAT_SUBMITTED",
21
24
  };
@@ -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
  *