mavenagi 0.0.0-alpha.12 → 0.0.0-alpha.15

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 (215) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +5 -0
  3. package/README.md +8 -1
  4. package/api/resources/actions/client/Client.js +3 -3
  5. package/api/resources/appSettings/client/Client.d.ts +47 -0
  6. package/api/resources/appSettings/client/Client.js +124 -0
  7. package/api/resources/appSettings/client/index.d.ts +1 -0
  8. package/api/resources/appSettings/client/index.js +1 -0
  9. package/api/resources/appSettings/index.d.ts +1 -0
  10. package/api/resources/appSettings/index.js +1 -0
  11. package/api/resources/commons/types/AppUser.d.ts +3 -2
  12. package/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
  13. package/api/resources/commons/types/AppUserRequest.d.ts +19 -1
  14. package/api/resources/commons/types/AppUserResponse.d.ts +34 -2
  15. package/api/resources/commons/types/Feedback.d.ts +12 -0
  16. package/api/resources/commons/types/UserData.d.ts +1 -1
  17. package/api/resources/commons/types/index.d.ts +4 -2
  18. package/api/resources/commons/types/index.js +4 -2
  19. package/api/resources/conversation/client/Client.d.ts +21 -19
  20. package/api/resources/conversation/client/Client.js +35 -28
  21. package/api/resources/conversation/types/AskRequest.d.ts +2 -4
  22. package/api/resources/conversation/types/ConversationBase.d.ts +12 -0
  23. package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -3
  24. package/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
  25. package/api/resources/conversation/types/ConversationResponse.d.ts +0 -2
  26. package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
  27. package/api/resources/conversation/types/UserMessageBase.d.ts +2 -0
  28. package/api/resources/conversation/types/index.d.ts +0 -2
  29. package/api/resources/conversation/types/index.js +0 -2
  30. package/api/resources/index.d.ts +1 -0
  31. package/api/resources/index.js +1 -0
  32. package/api/resources/knowledge/client/Client.js +7 -7
  33. package/api/resources/triggers/client/Client.js +3 -3
  34. package/api/resources/triggers/types/index.d.ts +0 -3
  35. package/api/resources/triggers/types/index.js +0 -3
  36. package/api/resources/users/client/Client.d.ts +18 -14
  37. package/api/resources/users/client/Client.js +21 -17
  38. package/dist/Client.d.ts +3 -0
  39. package/dist/Client.js +5 -0
  40. package/dist/api/resources/actions/client/Client.js +3 -3
  41. package/dist/api/resources/appSettings/client/Client.d.ts +47 -0
  42. package/dist/api/resources/appSettings/client/Client.js +124 -0
  43. package/dist/api/resources/appSettings/client/index.d.ts +1 -0
  44. package/dist/api/resources/appSettings/client/index.js +1 -0
  45. package/dist/api/resources/appSettings/index.d.ts +1 -0
  46. package/dist/api/resources/appSettings/index.js +1 -0
  47. package/dist/api/resources/commons/types/AppUser.d.ts +3 -2
  48. package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
  49. package/dist/api/resources/commons/types/AppUserRequest.d.ts +19 -1
  50. package/dist/api/resources/commons/types/AppUserResponse.d.ts +34 -2
  51. package/dist/api/resources/commons/types/Feedback.d.ts +12 -0
  52. package/dist/api/resources/commons/types/UserData.d.ts +1 -1
  53. package/dist/api/resources/commons/types/index.d.ts +4 -2
  54. package/dist/api/resources/commons/types/index.js +4 -2
  55. package/dist/api/resources/conversation/client/Client.d.ts +21 -19
  56. package/dist/api/resources/conversation/client/Client.js +35 -28
  57. package/dist/api/resources/conversation/types/AskRequest.d.ts +2 -4
  58. package/dist/api/resources/conversation/types/ConversationBase.d.ts +12 -0
  59. package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -3
  60. package/dist/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
  61. package/dist/api/resources/conversation/types/ConversationResponse.d.ts +0 -2
  62. package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
  63. package/dist/api/resources/conversation/types/UserMessageBase.d.ts +2 -0
  64. package/dist/api/resources/conversation/types/index.d.ts +0 -2
  65. package/dist/api/resources/conversation/types/index.js +0 -2
  66. package/dist/api/resources/index.d.ts +1 -0
  67. package/dist/api/resources/index.js +1 -0
  68. package/dist/api/resources/knowledge/client/Client.js +7 -7
  69. package/dist/api/resources/triggers/client/Client.js +3 -3
  70. package/dist/api/resources/triggers/types/index.d.ts +0 -3
  71. package/dist/api/resources/triggers/types/index.js +0 -3
  72. package/dist/api/resources/users/client/Client.d.ts +18 -14
  73. package/dist/api/resources/users/client/Client.js +21 -17
  74. package/dist/serialization/resources/appSettings/client/get.d.ts +9 -0
  75. package/dist/serialization/resources/appSettings/client/get.js +5 -0
  76. package/dist/serialization/resources/appSettings/client/index.d.ts +1 -0
  77. package/dist/serialization/resources/appSettings/client/index.js +1 -0
  78. package/dist/serialization/resources/appSettings/index.d.ts +1 -0
  79. package/dist/serialization/resources/appSettings/index.js +1 -0
  80. package/dist/serialization/resources/commons/types/AppUser.d.ts +3 -3
  81. package/dist/serialization/resources/commons/types/AppUser.js +3 -3
  82. package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
  83. package/dist/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
  84. package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +1 -1
  85. package/dist/serialization/resources/commons/types/AppUserRequest.js +1 -1
  86. package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +2 -1
  87. package/dist/serialization/resources/commons/types/AppUserResponse.js +2 -1
  88. package/{serialization/resources/triggers → dist/serialization/resources/commons}/types/EventTriggerResponse.d.ts +1 -1
  89. package/{serialization/resources/triggers → dist/serialization/resources/commons}/types/EventTriggerResponse.js +1 -1
  90. package/dist/serialization/resources/commons/types/Feedback.d.ts +16 -0
  91. package/dist/serialization/resources/commons/types/Feedback.js +13 -0
  92. package/dist/serialization/resources/commons/types/UserData.d.ts +1 -1
  93. package/dist/serialization/resources/commons/types/UserData.js +1 -1
  94. package/dist/serialization/resources/commons/types/index.d.ts +4 -2
  95. package/dist/serialization/resources/commons/types/index.js +4 -2
  96. package/dist/serialization/resources/conversation/types/AskRequest.d.ts +1 -4
  97. package/dist/serialization/resources/conversation/types/AskRequest.js +1 -4
  98. package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +6 -0
  99. package/dist/serialization/resources/conversation/types/ConversationBase.js +6 -0
  100. package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -2
  101. package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -2
  102. package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
  103. package/dist/serialization/resources/conversation/types/ConversationRequest.js +0 -2
  104. package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +0 -2
  105. package/dist/serialization/resources/conversation/types/ConversationResponse.js +0 -2
  106. package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
  107. package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
  108. package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +2 -0
  109. package/dist/serialization/resources/conversation/types/UserMessageBase.js +2 -0
  110. package/dist/serialization/resources/conversation/types/index.d.ts +0 -2
  111. package/dist/serialization/resources/conversation/types/index.js +0 -2
  112. package/dist/serialization/resources/index.d.ts +1 -0
  113. package/dist/serialization/resources/index.js +1 -0
  114. package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
  115. package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
  116. package/dist/serialization/resources/triggers/types/index.d.ts +0 -3
  117. package/dist/serialization/resources/triggers/types/index.js +0 -3
  118. package/package.json +1 -1
  119. package/reference.md +100 -34
  120. package/serialization/resources/appSettings/client/get.d.ts +9 -0
  121. package/serialization/resources/appSettings/client/get.js +5 -0
  122. package/serialization/resources/appSettings/client/index.d.ts +1 -0
  123. package/serialization/resources/appSettings/client/index.js +1 -0
  124. package/serialization/resources/appSettings/index.d.ts +1 -0
  125. package/serialization/resources/appSettings/index.js +1 -0
  126. package/serialization/resources/commons/types/AppUser.d.ts +3 -3
  127. package/serialization/resources/commons/types/AppUser.js +3 -3
  128. package/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
  129. package/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
  130. package/serialization/resources/commons/types/AppUserRequest.d.ts +1 -1
  131. package/serialization/resources/commons/types/AppUserRequest.js +1 -1
  132. package/serialization/resources/commons/types/AppUserResponse.d.ts +2 -1
  133. package/serialization/resources/commons/types/AppUserResponse.js +2 -1
  134. package/{dist/serialization/resources/triggers → serialization/resources/commons}/types/EventTriggerResponse.d.ts +1 -1
  135. package/{dist/serialization/resources/triggers → serialization/resources/commons}/types/EventTriggerResponse.js +1 -1
  136. package/serialization/resources/commons/types/Feedback.d.ts +16 -0
  137. package/serialization/resources/commons/types/Feedback.js +13 -0
  138. package/serialization/resources/commons/types/UserData.d.ts +1 -1
  139. package/serialization/resources/commons/types/UserData.js +1 -1
  140. package/serialization/resources/commons/types/index.d.ts +4 -2
  141. package/serialization/resources/commons/types/index.js +4 -2
  142. package/serialization/resources/conversation/types/AskRequest.d.ts +1 -4
  143. package/serialization/resources/conversation/types/AskRequest.js +1 -4
  144. package/serialization/resources/conversation/types/ConversationBase.d.ts +6 -0
  145. package/serialization/resources/conversation/types/ConversationBase.js +6 -0
  146. package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -2
  147. package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -2
  148. package/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
  149. package/serialization/resources/conversation/types/ConversationRequest.js +0 -2
  150. package/serialization/resources/conversation/types/ConversationResponse.d.ts +0 -2
  151. package/serialization/resources/conversation/types/ConversationResponse.js +0 -2
  152. package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
  153. package/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
  154. package/serialization/resources/conversation/types/UserMessageBase.d.ts +2 -0
  155. package/serialization/resources/conversation/types/UserMessageBase.js +2 -0
  156. package/serialization/resources/conversation/types/index.d.ts +0 -2
  157. package/serialization/resources/conversation/types/index.js +0 -2
  158. package/serialization/resources/index.d.ts +1 -0
  159. package/serialization/resources/index.js +1 -0
  160. package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
  161. package/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
  162. package/serialization/resources/triggers/types/index.d.ts +0 -3
  163. package/serialization/resources/triggers/types/index.js +0 -3
  164. package/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
  165. package/api/resources/commons/types/User.d.ts +0 -10
  166. package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
  167. package/api/resources/conversation/types/ConversationContext.js +0 -4
  168. package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
  169. package/api/resources/conversation/types/ConversationMessageContext.js +0 -4
  170. package/dist/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
  171. package/dist/api/resources/commons/types/AppUserIdentification.js +0 -4
  172. package/dist/api/resources/commons/types/User.d.ts +0 -10
  173. package/dist/api/resources/commons/types/User.js +0 -4
  174. package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
  175. package/dist/api/resources/conversation/types/ConversationContext.js +0 -4
  176. package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
  177. package/dist/api/resources/conversation/types/ConversationMessageContext.js +0 -4
  178. package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
  179. package/dist/serialization/resources/commons/types/AppUserIdentification.js +0 -8
  180. package/dist/serialization/resources/commons/types/User.d.ts +0 -15
  181. package/dist/serialization/resources/commons/types/User.js +0 -10
  182. package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
  183. package/dist/serialization/resources/conversation/types/ConversationContext.js +0 -15
  184. package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
  185. package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
  186. package/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
  187. package/serialization/resources/commons/types/AppUserIdentification.js +0 -8
  188. package/serialization/resources/commons/types/User.d.ts +0 -15
  189. package/serialization/resources/commons/types/User.js +0 -10
  190. package/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
  191. package/serialization/resources/conversation/types/ConversationContext.js +0 -15
  192. package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
  193. package/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
  194. /package/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
  195. /package/api/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
  196. /package/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
  197. /package/api/resources/{triggers → commons}/types/EventTriggerResponse.js +0 -0
  198. /package/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
  199. /package/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
  200. /package/api/resources/commons/types/{AppUserIdentification.js → Feedback.js} +0 -0
  201. /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
  202. /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
  203. /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
  204. /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.js +0 -0
  205. /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
  206. /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
  207. /package/{api/resources/commons/types/User.js → dist/api/resources/commons/types/Feedback.js} +0 -0
  208. /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
  209. /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
  210. /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
  211. /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
  212. /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
  213. /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
  214. /package/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
  215. /package/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
package/Client.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  import * as environments from "./environments";
5
5
  import * as core from "./core";
6
6
  import { Actions } from "./api/resources/actions/client/Client";
7
+ import { AppSettings } from "./api/resources/appSettings/client/Client";
7
8
  import { Conversation } from "./api/resources/conversation/client/Client";
8
9
  import { Knowledge } from "./api/resources/knowledge/client/Client";
9
10
  import { Triggers } from "./api/resources/triggers/client/Client";
@@ -37,6 +38,8 @@ export declare class MavenAGIClient {
37
38
  constructor(_options: MavenAGIClient.Options);
38
39
  protected _actions: Actions | undefined;
39
40
  get actions(): Actions;
41
+ protected _appSettings: AppSettings | undefined;
42
+ get appSettings(): AppSettings;
40
43
  protected _conversation: Conversation | undefined;
41
44
  get conversation(): Conversation;
42
45
  protected _knowledge: Knowledge | undefined;
package/Client.js CHANGED
@@ -2,6 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import { Actions } from "./api/resources/actions/client/Client";
5
+ import { AppSettings } from "./api/resources/appSettings/client/Client";
5
6
  import { Conversation } from "./api/resources/conversation/client/Client";
6
7
  import { Knowledge } from "./api/resources/knowledge/client/Client";
7
8
  import { Triggers } from "./api/resources/triggers/client/Client";
@@ -14,6 +15,10 @@ export class MavenAGIClient {
14
15
  var _a;
15
16
  return ((_a = this._actions) !== null && _a !== void 0 ? _a : (this._actions = new Actions(this._options)));
16
17
  }
18
+ get appSettings() {
19
+ var _a;
20
+ return ((_a = this._appSettings) !== null && _a !== void 0 ? _a : (this._appSettings = new AppSettings(this._options)));
21
+ }
17
22
  get conversation() {
18
23
  var _a;
19
24
  return ((_a = this._conversation) !== null && _a !== void 0 ? _a : (this._conversation = new Conversation(this._options)));
package/README.md CHANGED
@@ -29,12 +29,19 @@ await client.conversation.initialize({
29
29
  referenceId: "string",
30
30
  },
31
31
  messages: [{}],
32
- context: {},
33
32
  responseConfig: {
34
33
  capabilities: [MavenAGI.Capability.Markdown],
35
34
  isCopilot: true,
36
35
  responseLength: MavenAGI.ResponseLength.Short,
37
36
  },
37
+ subject: "string",
38
+ url: "string",
39
+ createdAt: new Date("2024-01-15T09:30:00.000Z"),
40
+ updatedAt: new Date("2024-01-15T09:30:00.000Z"),
41
+ tags: new Set(["string"]),
42
+ metadata: {
43
+ string: "string",
44
+ },
38
45
  });
39
46
  ```
40
47
 
@@ -56,7 +56,7 @@ export class Actions {
56
56
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
57
57
  "X-Fern-Language": "JavaScript",
58
58
  "X-Fern-SDK-Name": "mavenagi",
59
- "X-Fern-SDK-Version": "0.0.0-alpha.12",
59
+ "X-Fern-SDK-Version": "0.0.0-alpha.15",
60
60
  "X-Fern-Runtime": core.RUNTIME.type,
61
61
  "X-Fern-Runtime-Version": core.RUNTIME.version,
62
62
  },
@@ -145,7 +145,7 @@ export class Actions {
145
145
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
146
146
  "X-Fern-Language": "JavaScript",
147
147
  "X-Fern-SDK-Name": "mavenagi",
148
- "X-Fern-SDK-Version": "0.0.0-alpha.12",
148
+ "X-Fern-SDK-Version": "0.0.0-alpha.15",
149
149
  "X-Fern-Runtime": core.RUNTIME.type,
150
150
  "X-Fern-Runtime-Version": core.RUNTIME.version,
151
151
  },
@@ -233,7 +233,7 @@ export class Actions {
233
233
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
234
234
  "X-Fern-Language": "JavaScript",
235
235
  "X-Fern-SDK-Name": "mavenagi",
236
- "X-Fern-SDK-Version": "0.0.0-alpha.12",
236
+ "X-Fern-SDK-Version": "0.0.0-alpha.15",
237
237
  "X-Fern-Runtime": core.RUNTIME.type,
238
238
  "X-Fern-Runtime-Version": core.RUNTIME.version,
239
239
  },
@@ -0,0 +1,47 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ export declare namespace AppSettings {
7
+ interface Options {
8
+ environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
9
+ appId?: core.Supplier<string | undefined>;
10
+ appSecret?: core.Supplier<string | undefined>;
11
+ /** Override the X-Organization-Id header */
12
+ organizationId: core.Supplier<string>;
13
+ /** Override the X-Agent-Id header */
14
+ agentId: core.Supplier<string>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Override the X-Organization-Id header */
25
+ organizationId?: string;
26
+ /** Override the X-Agent-Id header */
27
+ agentId?: string;
28
+ }
29
+ }
30
+ export declare class AppSettings {
31
+ protected readonly _options: AppSettings.Options;
32
+ constructor(_options: AppSettings.Options);
33
+ /**
34
+ * Get app settings set during installation
35
+ *
36
+ * @param {AppSettings.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link MavenAGI.NotFoundError}
39
+ * @throws {@link MavenAGI.BadRequestError}
40
+ * @throws {@link MavenAGI.ServerError}
41
+ *
42
+ * @example
43
+ * await client.appSettings.get()
44
+ */
45
+ get(requestOptions?: AppSettings.RequestOptions): Promise<Record<string, unknown>>;
46
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
47
+ }
@@ -0,0 +1,124 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../environments";
14
+ import * as core from "../../../../core";
15
+ import * as MavenAGI from "../../../index";
16
+ import urlJoin from "url-join";
17
+ import * as serializers from "../../../../serialization/index";
18
+ import * as errors from "../../../../errors/index";
19
+ export class AppSettings {
20
+ constructor(_options) {
21
+ this._options = _options;
22
+ }
23
+ /**
24
+ * Get app settings set during installation
25
+ *
26
+ * @param {AppSettings.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link MavenAGI.NotFoundError}
29
+ * @throws {@link MavenAGI.BadRequestError}
30
+ * @throws {@link MavenAGI.ServerError}
31
+ *
32
+ * @example
33
+ * await client.appSettings.get()
34
+ */
35
+ get(requestOptions) {
36
+ var _a, _b;
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
39
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "v1/app-settings"),
40
+ method: "GET",
41
+ headers: {
42
+ Authorization: yield this._getAuthorizationHeader(),
43
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
44
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
45
+ "X-Fern-Language": "JavaScript",
46
+ "X-Fern-SDK-Name": "mavenagi",
47
+ "X-Fern-SDK-Version": "0.0.0-alpha.15",
48
+ "X-Fern-Runtime": core.RUNTIME.type,
49
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
50
+ },
51
+ contentType: "application/json",
52
+ requestType: "json",
53
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
54
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
55
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
56
+ });
57
+ if (_response.ok) {
58
+ return serializers.appSettings.get.Response.parseOrThrow(_response.body, {
59
+ unrecognizedObjectKeys: "passthrough",
60
+ allowUnrecognizedUnionMembers: true,
61
+ allowUnrecognizedEnumValues: true,
62
+ breadcrumbsPrefix: ["response"],
63
+ });
64
+ }
65
+ if (_response.error.reason === "status-code") {
66
+ switch (_response.error.statusCode) {
67
+ case 404:
68
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
69
+ unrecognizedObjectKeys: "passthrough",
70
+ allowUnrecognizedUnionMembers: true,
71
+ allowUnrecognizedEnumValues: true,
72
+ breadcrumbsPrefix: ["response"],
73
+ }));
74
+ case 400:
75
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
76
+ unrecognizedObjectKeys: "passthrough",
77
+ allowUnrecognizedUnionMembers: true,
78
+ allowUnrecognizedEnumValues: true,
79
+ breadcrumbsPrefix: ["response"],
80
+ }));
81
+ case 500:
82
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
83
+ unrecognizedObjectKeys: "passthrough",
84
+ allowUnrecognizedUnionMembers: true,
85
+ allowUnrecognizedEnumValues: true,
86
+ breadcrumbsPrefix: ["response"],
87
+ }));
88
+ default:
89
+ throw new errors.MavenAGIError({
90
+ statusCode: _response.error.statusCode,
91
+ body: _response.error.body,
92
+ });
93
+ }
94
+ }
95
+ switch (_response.error.reason) {
96
+ case "non-json":
97
+ throw new errors.MavenAGIError({
98
+ statusCode: _response.error.statusCode,
99
+ body: _response.error.rawBody,
100
+ });
101
+ case "timeout":
102
+ throw new errors.MavenAGITimeoutError();
103
+ case "unknown":
104
+ throw new errors.MavenAGIError({
105
+ message: _response.error.errorMessage,
106
+ });
107
+ }
108
+ });
109
+ }
110
+ _getAuthorizationHeader() {
111
+ var _a, _b;
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ const appId = (_a = (yield core.Supplier.get(this._options.appId))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_ID"];
114
+ const appSecret = (_b = (yield core.Supplier.get(this._options.appSecret))) !== null && _b !== void 0 ? _b : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_SECRET"];
115
+ if (appId != null && appSecret != null) {
116
+ return core.BasicAuth.toAuthorizationHeader({
117
+ username: appId,
118
+ password: appSecret,
119
+ });
120
+ }
121
+ return undefined;
122
+ });
123
+ }
124
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as MavenAGI from "../../../index";
5
5
  export interface AppUser {
6
- userIdentifiers?: MavenAGI.AppUserIdentification;
7
- metadata?: Record<string, MavenAGI.UserData>;
6
+ /** Used to determine whether two users from different apps are the same */
7
+ identifiers: MavenAGI.AppUserIdentifier[];
8
+ data: Record<string, MavenAGI.UserData>;
8
9
  }
@@ -5,5 +5,5 @@ import * as MavenAGI from "../../../index";
5
5
  export interface AppUserIdentifier {
6
6
  /** The identifying property text */
7
7
  value: string;
8
- userIdentifyingPropertyType: MavenAGI.AppUserIdentifyingPropertyType;
8
+ type: MavenAGI.AppUserIdentifyingPropertyType;
9
9
  }
@@ -2,7 +2,25 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as MavenAGI from "../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * userId: {
9
+ * referenceId: "user-0"
10
+ * },
11
+ * identifiers: new Set([{
12
+ * value: "joe@myapp.com",
13
+ * type: MavenAGI.AppUserIdentifyingPropertyType.Email
14
+ * }]),
15
+ * data: {
16
+ * "name": {
17
+ * value: "Joe",
18
+ * visibility: MavenAGI.VisibilityType.Visible
19
+ * }
20
+ * }
21
+ * }
22
+ */
5
23
  export interface AppUserRequest extends MavenAGI.AppUser {
6
24
  /** ID that uniquely identifies this app user */
7
- appUserId: MavenAGI.EntityIdBase;
25
+ userId: MavenAGI.EntityIdBase;
8
26
  }
@@ -2,7 +2,39 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as MavenAGI from "../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * userId: {
9
+ * referenceId: "user-0",
10
+ * appId: "myapp",
11
+ * organizationId: "acme",
12
+ * agentId: "support",
13
+ * type: MavenAGI.EntityType.UserProfile
14
+ * },
15
+ * identifiers: new Set([{
16
+ * value: "joe@myapp.com",
17
+ * type: MavenAGI.AppUserIdentifyingPropertyType.Email
18
+ * }]),
19
+ * data: {
20
+ * "name": {
21
+ * value: "Joe",
22
+ * visibility: MavenAGI.VisibilityType.Visible
23
+ * }
24
+ * },
25
+ * allUserData: {
26
+ * "myapp": {
27
+ * "name": "Joe"
28
+ * },
29
+ * "defaultUserData": {
30
+ * "name": "Joe"
31
+ * }
32
+ * }
33
+ * }
34
+ */
5
35
  export interface AppUserResponse extends MavenAGI.AppUser {
6
- /** ID that uniquely identifies this app user */
7
- appUserId: MavenAGI.EntityId;
36
+ /** ID that uniquely identifies this user */
37
+ userId: MavenAGI.EntityId;
38
+ /** Data from all apps */
39
+ allUserData: Record<string, Record<string, string>>;
8
40
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface Feedback extends MavenAGI.FeedbackBase {
6
+ /** The ID of the piece of feedback */
7
+ feedbackId: MavenAGI.EntityId;
8
+ /** The ID of the conversation the feedback is about */
9
+ conversationId: MavenAGI.EntityId;
10
+ /** The ID of the conversation message the feedback is about */
11
+ conversationMessageId: MavenAGI.EntityId;
12
+ }
@@ -6,5 +6,5 @@ export interface UserData {
6
6
  /** The value of the user metadata */
7
7
  value: string;
8
8
  /** The visibility of the user metadata */
9
- visibility?: MavenAGI.VisibilityType;
9
+ visibility: MavenAGI.VisibilityType;
10
10
  }
@@ -2,10 +2,9 @@ export * from "./ErrorMessage";
2
2
  export * from "./EntityType";
3
3
  export * from "./EntityIdBase";
4
4
  export * from "./EntityId";
5
- export * from "./User";
6
5
  export * from "./FeedbackBase";
7
6
  export * from "./FeedbackType";
8
- export * from "./AppUserIdentification";
7
+ export * from "./Feedback";
9
8
  export * from "./AppUserIdentifier";
10
9
  export * from "./AppUserIdentifyingPropertyType";
11
10
  export * from "./AppUser";
@@ -13,3 +12,6 @@ export * from "./UserData";
13
12
  export * from "./VisibilityType";
14
13
  export * from "./AppUserRequest";
15
14
  export * from "./AppUserResponse";
15
+ export * from "./EventTriggerBase";
16
+ export * from "./EventTriggerResponse";
17
+ export * from "./EventTriggerType";
@@ -2,10 +2,9 @@ export * from "./ErrorMessage";
2
2
  export * from "./EntityType";
3
3
  export * from "./EntityIdBase";
4
4
  export * from "./EntityId";
5
- export * from "./User";
6
5
  export * from "./FeedbackBase";
7
6
  export * from "./FeedbackType";
8
- export * from "./AppUserIdentification";
7
+ export * from "./Feedback";
9
8
  export * from "./AppUserIdentifier";
10
9
  export * from "./AppUserIdentifyingPropertyType";
11
10
  export * from "./AppUser";
@@ -13,3 +12,6 @@ export * from "./UserData";
13
12
  export * from "./VisibilityType";
14
13
  export * from "./AppUserRequest";
15
14
  export * from "./AppUserResponse";
15
+ export * from "./EventTriggerBase";
16
+ export * from "./EventTriggerResponse";
17
+ export * from "./EventTriggerType";
@@ -32,7 +32,7 @@ export declare class Conversation {
32
32
  protected readonly _options: Conversation.Options;
33
33
  constructor(_options: Conversation.Options);
34
34
  /**
35
- * Pre-populate a new conversation with messages
35
+ * Initialize a new conversation. Only required if the ask request wishes to supply conversation level data or when syncing to external systems.
36
36
  *
37
37
  * @param {MavenAGI.ConversationRequest} request
38
38
  * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
@@ -47,11 +47,18 @@ export declare class Conversation {
47
47
  * referenceId: "string"
48
48
  * },
49
49
  * messages: [{}],
50
- * context: {},
51
50
  * responseConfig: {
52
51
  * capabilities: [MavenAGI.Capability.Markdown],
53
52
  * isCopilot: true,
54
53
  * responseLength: MavenAGI.ResponseLength.Short
54
+ * },
55
+ * subject: "string",
56
+ * url: "string",
57
+ * createdAt: new Date("2024-01-15T09:30:00.000Z"),
58
+ * updatedAt: new Date("2024-01-15T09:30:00.000Z"),
59
+ * tags: new Set(["string"]),
60
+ * metadata: {
61
+ * "string": "string"
55
62
  * }
56
63
  * })
57
64
  */
@@ -86,14 +93,18 @@ export declare class Conversation {
86
93
  * conversationMessageId: {
87
94
  * referenceId: "string"
88
95
  * },
96
+ * userId: {
97
+ * referenceId: "string"
98
+ * },
89
99
  * text: "string",
90
100
  * userMessageType: MavenAGI.UserConversationMessageType.User,
91
- * context: {}
101
+ * createdAt: new Date("2024-01-15T09:30:00.000Z"),
102
+ * updatedAt: new Date("2024-01-15T09:30:00.000Z")
92
103
  * }])
93
104
  */
94
105
  appendNewMessages(conversationId: string, request: MavenAGI.ConversationMessageRequest[], requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.ConversationResponse>;
95
106
  /**
96
- * Ask a question in a conversation
107
+ * Ask a question
97
108
  *
98
109
  * @param {string} conversationId - The ID of a new or existing conversation to use as context for the question
99
110
  * @param {MavenAGI.AskRequest} request
@@ -108,9 +119,10 @@ export declare class Conversation {
108
119
  * conversationMessageId: {
109
120
  * referenceId: "string"
110
121
  * },
111
- * text: "string",
112
- * context: {},
113
- * responseConfig: {}
122
+ * userId: {
123
+ * referenceId: "string"
124
+ * },
125
+ * text: "string"
114
126
  * })
115
127
  */
116
128
  ask(conversationId: string, request: MavenAGI.AskRequest, requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.ConversationResponse>;
@@ -162,7 +174,7 @@ export declare class Conversation {
162
174
  * text: "string"
163
175
  * })
164
176
  */
165
- createFeedback(request: MavenAGI.FeedbackRequest, requestOptions?: Conversation.RequestOptions): Promise<void>;
177
+ createFeedback(request: MavenAGI.FeedbackRequest, requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.Feedback>;
166
178
  /**
167
179
  * Submit a filled out action form
168
180
  *
@@ -177,16 +189,6 @@ export declare class Conversation {
177
189
  * @example
178
190
  * await client.conversation.submitActionForm("string", {
179
191
  * actionFormId: "string",
180
- * userContext: {
181
- * name: "string",
182
- * id: {
183
- * "string": "string"
184
- * },
185
- * email: "string",
186
- * context: {
187
- * "string": "string"
188
- * }
189
- * },
190
192
  * parameters: {
191
193
  * "string": {
192
194
  * "key": "value"
@@ -196,7 +198,7 @@ export declare class Conversation {
196
198
  */
197
199
  submitActionForm(conversationId: string, request: MavenAGI.SubmitActionFormRequest, requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.ConversationResponse>;
198
200
  /**
199
- * Add metadata to an existing conversation's Context. If a metadata field already exists, it will be overwritten.
201
+ * Add metadata to an existing conversation. If a metadata field already exists, it will be overwritten.
200
202
  *
201
203
  * @param {string} conversationId - The ID of a conversation the metadata being added belongs to
202
204
  * @param {Record<string, string>} request