mavenagi 0.0.0-alpha.7 → 0.0.0-alpha.8

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 (193) hide show
  1. package/api/resources/actions/client/Client.d.ts +12 -10
  2. package/api/resources/actions/client/Client.js +17 -15
  3. package/api/resources/actions/types/ActionBase.d.ts +7 -6
  4. package/api/resources/actions/types/ActionRequest.d.ts +5 -3
  5. package/api/resources/actions/types/ActionResponse.d.ts +5 -3
  6. package/api/resources/actions/types/Preconditions.d.ts +7 -0
  7. package/api/resources/actions/types/index.d.ts +1 -0
  8. package/api/resources/actions/types/index.js +1 -0
  9. package/api/resources/commons/types/AppUserIdentification.d.ts +2 -2
  10. package/api/resources/commons/types/{AppUserIdentifyingProperty.d.ts → AppUserIdentifier.d.ts} +1 -1
  11. package/api/resources/commons/types/AppUserRequest.d.ts +5 -0
  12. package/api/resources/commons/types/AppUserResponse.d.ts +5 -0
  13. package/api/resources/commons/types/index.d.ts +3 -1
  14. package/api/resources/commons/types/index.js +3 -1
  15. package/api/resources/conversation/client/Client.d.ts +2 -2
  16. package/api/resources/conversation/client/Client.js +12 -12
  17. package/api/resources/conversation/types/{ActionExecutionRequest.d.ts → SubmitActionFormRequest.d.ts} +1 -1
  18. package/api/resources/conversation/types/index.d.ts +1 -2
  19. package/api/resources/conversation/types/index.js +1 -2
  20. package/api/resources/knowledge/client/Client.d.ts +43 -52
  21. package/api/resources/knowledge/client/Client.js +60 -71
  22. package/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +2 -3
  23. package/{dist/api/resources/knowledge/types/KnowledgeBase.d.ts → api/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +2 -2
  24. package/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
  25. package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
  26. package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +6 -2
  27. package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +13 -0
  28. package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +16 -0
  29. package/api/resources/knowledge/types/index.d.ts +4 -4
  30. package/api/resources/knowledge/types/index.js +4 -4
  31. package/api/resources/triggers/client/Client.d.ts +10 -10
  32. package/api/resources/triggers/client/Client.js +15 -15
  33. package/api/resources/triggers/types/EventTriggerRequest.d.ts +2 -2
  34. package/api/resources/triggers/types/EventTriggerResponse.d.ts +2 -2
  35. package/api/resources/users/client/Client.d.ts +4 -4
  36. package/api/resources/users/client/Client.js +7 -7
  37. package/dist/api/resources/actions/client/Client.d.ts +12 -10
  38. package/dist/api/resources/actions/client/Client.js +17 -15
  39. package/dist/api/resources/actions/types/ActionBase.d.ts +7 -6
  40. package/dist/api/resources/actions/types/ActionRequest.d.ts +5 -3
  41. package/dist/api/resources/actions/types/ActionResponse.d.ts +5 -3
  42. package/dist/api/resources/actions/types/Preconditions.d.ts +7 -0
  43. package/dist/api/resources/actions/types/index.d.ts +1 -0
  44. package/dist/api/resources/actions/types/index.js +1 -0
  45. package/dist/api/resources/commons/types/AppUserIdentification.d.ts +2 -2
  46. package/dist/api/resources/commons/types/{AppUserIdentifyingProperty.d.ts → AppUserIdentifier.d.ts} +1 -1
  47. package/dist/api/resources/commons/types/AppUserRequest.d.ts +5 -0
  48. package/dist/api/resources/commons/types/AppUserResponse.d.ts +5 -0
  49. package/dist/api/resources/commons/types/index.d.ts +3 -1
  50. package/dist/api/resources/commons/types/index.js +3 -1
  51. package/dist/api/resources/conversation/client/Client.d.ts +2 -2
  52. package/dist/api/resources/conversation/client/Client.js +12 -12
  53. package/dist/api/resources/conversation/types/{ActionExecutionRequest.d.ts → SubmitActionFormRequest.d.ts} +1 -1
  54. package/dist/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
  55. package/dist/api/resources/conversation/types/index.d.ts +1 -2
  56. package/dist/api/resources/conversation/types/index.js +1 -2
  57. package/dist/api/resources/knowledge/client/Client.d.ts +43 -52
  58. package/dist/api/resources/knowledge/client/Client.js +60 -71
  59. package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +2 -3
  60. package/{api/resources/knowledge/types/KnowledgeBase.d.ts → dist/api/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +2 -2
  61. package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
  62. package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
  63. package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
  64. package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
  65. package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
  66. package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +6 -2
  67. package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +13 -0
  68. package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +16 -0
  69. package/dist/api/resources/knowledge/types/index.d.ts +4 -4
  70. package/dist/api/resources/knowledge/types/index.js +4 -4
  71. package/dist/api/resources/triggers/client/Client.d.ts +10 -10
  72. package/dist/api/resources/triggers/client/Client.js +15 -15
  73. package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +2 -2
  74. package/dist/api/resources/triggers/types/EventTriggerResponse.d.ts +2 -2
  75. package/dist/api/resources/users/client/Client.d.ts +4 -4
  76. package/dist/api/resources/users/client/Client.js +7 -7
  77. package/dist/serialization/resources/actions/types/ActionBase.d.ts +2 -1
  78. package/dist/serialization/resources/actions/types/ActionBase.js +2 -1
  79. package/dist/serialization/resources/actions/types/ActionRequest.d.ts +1 -1
  80. package/dist/serialization/resources/actions/types/ActionRequest.js +1 -1
  81. package/dist/serialization/resources/actions/types/ActionResponse.d.ts +1 -1
  82. package/dist/serialization/resources/actions/types/ActionResponse.js +1 -1
  83. package/{serialization/resources/knowledge/types/KnowledgeBaseId.d.ts → dist/serialization/resources/actions/types/Preconditions.d.ts} +3 -3
  84. package/dist/serialization/resources/actions/types/Preconditions.js +7 -0
  85. package/dist/serialization/resources/actions/types/index.d.ts +1 -0
  86. package/dist/serialization/resources/actions/types/index.js +1 -0
  87. package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +2 -2
  88. package/dist/serialization/resources/commons/types/AppUserIdentification.js +2 -2
  89. package/dist/serialization/resources/commons/types/{AppUserIdentifyingProperty.d.ts → AppUserIdentifier.d.ts} +2 -2
  90. package/{serialization/resources/commons/types/AppUserIdentifyingProperty.js → dist/serialization/resources/commons/types/AppUserIdentifier.js} +1 -1
  91. package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +11 -0
  92. package/dist/serialization/resources/commons/types/AppUserRequest.js +5 -0
  93. package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +11 -0
  94. package/dist/serialization/resources/commons/types/AppUserResponse.js +5 -0
  95. package/dist/serialization/resources/commons/types/index.d.ts +3 -1
  96. package/dist/serialization/resources/commons/types/index.js +3 -1
  97. package/{serialization/resources/conversation/types/ActionExecutionRequest.d.ts → dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts} +2 -2
  98. package/{serialization/resources/conversation/types/ActionExecutionRequest.js → dist/serialization/resources/conversation/types/SubmitActionFormRequest.js} +1 -1
  99. package/dist/serialization/resources/conversation/types/index.d.ts +1 -2
  100. package/dist/serialization/resources/conversation/types/index.js +1 -2
  101. package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +3 -4
  102. package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +4 -7
  103. package/{serialization/resources/knowledge/types/KnowledgeBase.d.ts → dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
  104. package/{serialization/resources/knowledge/types/KnowledgeBase.js → dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.js} +3 -6
  105. package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
  106. package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
  107. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
  108. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
  109. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
  110. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
  111. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +3 -1
  112. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +3 -1
  113. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +2 -0
  114. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +2 -0
  115. package/dist/serialization/resources/knowledge/types/index.d.ts +4 -4
  116. package/dist/serialization/resources/knowledge/types/index.js +4 -4
  117. package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
  118. package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
  119. package/dist/serialization/resources/triggers/types/EventTriggerResponse.d.ts +1 -1
  120. package/dist/serialization/resources/triggers/types/EventTriggerResponse.js +1 -1
  121. package/package.json +1 -1
  122. package/serialization/resources/actions/types/ActionBase.d.ts +2 -1
  123. package/serialization/resources/actions/types/ActionBase.js +2 -1
  124. package/serialization/resources/actions/types/ActionRequest.d.ts +1 -1
  125. package/serialization/resources/actions/types/ActionRequest.js +1 -1
  126. package/serialization/resources/actions/types/ActionResponse.d.ts +1 -1
  127. package/serialization/resources/actions/types/ActionResponse.js +1 -1
  128. package/{dist/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts → serialization/resources/actions/types/Preconditions.d.ts} +3 -3
  129. package/serialization/resources/actions/types/Preconditions.js +7 -0
  130. package/serialization/resources/actions/types/index.d.ts +1 -0
  131. package/serialization/resources/actions/types/index.js +1 -0
  132. package/serialization/resources/commons/types/AppUserIdentification.d.ts +2 -2
  133. package/serialization/resources/commons/types/AppUserIdentification.js +2 -2
  134. package/serialization/resources/commons/types/{AppUserIdentifyingProperty.d.ts → AppUserIdentifier.d.ts} +2 -2
  135. package/{dist/serialization/resources/commons/types/AppUserIdentifyingProperty.js → serialization/resources/commons/types/AppUserIdentifier.js} +1 -1
  136. package/serialization/resources/commons/types/AppUserRequest.d.ts +11 -0
  137. package/serialization/resources/commons/types/AppUserRequest.js +5 -0
  138. package/serialization/resources/commons/types/AppUserResponse.d.ts +11 -0
  139. package/serialization/resources/commons/types/AppUserResponse.js +5 -0
  140. package/serialization/resources/commons/types/index.d.ts +3 -1
  141. package/serialization/resources/commons/types/index.js +3 -1
  142. package/{dist/serialization/resources/conversation/types/ActionExecutionRequest.d.ts → serialization/resources/conversation/types/SubmitActionFormRequest.d.ts} +2 -2
  143. package/{dist/serialization/resources/conversation/types/ActionExecutionRequest.js → serialization/resources/conversation/types/SubmitActionFormRequest.js} +1 -1
  144. package/serialization/resources/conversation/types/index.d.ts +1 -2
  145. package/serialization/resources/conversation/types/index.js +1 -2
  146. package/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +3 -4
  147. package/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +4 -7
  148. package/{dist/serialization/resources/knowledge/types/KnowledgeBase.d.ts → serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
  149. package/{dist/serialization/resources/knowledge/types/KnowledgeBase.js → serialization/resources/knowledge/types/KnowledgeBaseProperties.js} +3 -6
  150. package/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
  151. package/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
  152. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
  153. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
  154. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
  155. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
  156. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +3 -1
  157. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +3 -1
  158. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +2 -0
  159. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +2 -0
  160. package/serialization/resources/knowledge/types/index.d.ts +4 -4
  161. package/serialization/resources/knowledge/types/index.js +4 -4
  162. package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
  163. package/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
  164. package/serialization/resources/triggers/types/EventTriggerResponse.d.ts +1 -1
  165. package/serialization/resources/triggers/types/EventTriggerResponse.js +1 -1
  166. package/api/resources/conversation/types/ActionExecutionResponse.d.ts +0 -7
  167. package/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
  168. package/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
  169. package/dist/api/resources/conversation/types/ActionExecutionResponse.d.ts +0 -7
  170. package/dist/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
  171. package/dist/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
  172. package/dist/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +0 -12
  173. package/dist/serialization/resources/conversation/types/ActionExecutionResponse.js +0 -7
  174. package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
  175. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
  176. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
  177. package/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +0 -12
  178. package/serialization/resources/conversation/types/ActionExecutionResponse.js +0 -7
  179. package/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
  180. package/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
  181. package/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
  182. /package/api/resources/{commons/types/AppUserIdentifyingProperty.js → actions/types/Preconditions.js} +0 -0
  183. /package/api/resources/{conversation/types/ActionExecutionRequest.js → commons/types/AppUserIdentifier.js} +0 -0
  184. /package/api/resources/{conversation/types/ActionExecutionResponse.js → commons/types/AppUserRequest.js} +0 -0
  185. /package/api/resources/{knowledge/types/KnowledgeBase.js → commons/types/AppUserResponse.js} +0 -0
  186. /package/api/resources/{knowledge/types/KnowledgeBaseId.js → conversation/types/SubmitActionFormRequest.js} +0 -0
  187. /package/api/resources/knowledge/types/{KnowledgeDocumentId.js → KnowledgeBaseProperties.js} +0 -0
  188. /package/{dist/api/resources/commons/types/AppUserIdentifyingProperty.js → api/resources/knowledge/types/KnowledgeBaseRequest.js} +0 -0
  189. /package/{dist/api/resources/conversation/types/ActionExecutionRequest.js → api/resources/knowledge/types/KnowledgeBaseResponse.js} +0 -0
  190. /package/dist/api/resources/{conversation/types/ActionExecutionResponse.js → actions/types/Preconditions.js} +0 -0
  191. /package/dist/api/resources/{knowledge/types/KnowledgeBase.js → commons/types/AppUserIdentifier.js} +0 -0
  192. /package/dist/api/resources/{knowledge/types/KnowledgeBaseId.js → commons/types/AppUserRequest.js} +0 -0
  193. /package/dist/api/resources/{knowledge/types/KnowledgeDocumentId.js → commons/types/AppUserResponse.js} +0 -0
@@ -23,9 +23,9 @@ export declare class Knowledge {
23
23
  protected readonly _options: Knowledge.Options;
24
24
  constructor(_options: Knowledge.Options);
25
25
  /**
26
- * Create a new knowledge base.
26
+ * Update a knowledge base or create it if it doesn't exist.
27
27
  *
28
- * @param {MavenAGI.KnowledgeBase} request
28
+ * @param {MavenAGI.KnowledgeBaseRequest} request
29
29
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
30
30
  *
31
31
  * @throws {@link MavenAGI.NotFoundError}
@@ -33,18 +33,19 @@ export declare class Knowledge {
33
33
  * @throws {@link MavenAGI.ServerError}
34
34
  *
35
35
  * @example
36
- * await client.knowledge.createKnowledgeBase({
37
- * displayName: "string",
38
- * type: MavenAGI.KnowledgeBaseType.Api,
39
- * url: "string",
40
- * knowledgeBaseId: "string"
36
+ * await client.knowledge.createOrUpdateKnowledgeBase({
37
+ * knowledgeBaseId: {
38
+ * referenceId: "help-center"
39
+ * },
40
+ * name: "Help center",
41
+ * type: MavenAGI.KnowledgeBaseType.Api
41
42
  * })
42
43
  */
43
- createKnowledgeBase(request: MavenAGI.KnowledgeBase, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeBase>;
44
+ createOrUpdateKnowledgeBase(request: MavenAGI.KnowledgeBaseRequest, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeBaseResponse>;
44
45
  /**
45
- * Get an existing knowledge base.
46
+ * Get an existing knowledge base by its supplied ID
46
47
  *
47
- * @param {string} knowledgeBaseId - The ID of the knowledge base to get
48
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to get. All other entity ID fields are inferred from the request.
48
49
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
49
50
  *
50
51
  * @throws {@link MavenAGI.NotFoundError}
@@ -52,12 +53,13 @@ export declare class Knowledge {
52
53
  * @throws {@link MavenAGI.ServerError}
53
54
  *
54
55
  * @example
55
- * await client.knowledge.getKnowledgeBase("string")
56
+ * await client.knowledge.getKnowledgeBase("help-center")
56
57
  */
57
- getKnowledgeBase(knowledgeBaseId: string, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeBase>;
58
+ getKnowledgeBase(knowledgeBaseReferenceId: string, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeBaseResponse>;
58
59
  /**
59
60
  * Create a new knowledge base version. Only supported on API knowledge bases. Will throw an exception if there is an existing version in progress.
60
61
  *
62
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a version for. All other entity ID fields are inferred from the request.
61
63
  * @param {MavenAGI.KnowledgeBaseVersion} request
62
64
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
63
65
  *
@@ -66,16 +68,15 @@ export declare class Knowledge {
66
68
  * @throws {@link MavenAGI.ServerError}
67
69
  *
68
70
  * @example
69
- * await client.knowledge.createKnowledgeBaseVersion({
70
- * knowledgeBaseId: "string",
71
+ * await client.knowledge.createKnowledgeBaseVersion("help-center", {
71
72
  * type: MavenAGI.KnowledgeBaseVersionType.Full
72
73
  * })
73
74
  */
74
- createKnowledgeBaseVersion(request: MavenAGI.KnowledgeBaseVersion, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeBaseVersion>;
75
+ createKnowledgeBaseVersion(knowledgeBaseReferenceId: string, request: MavenAGI.KnowledgeBaseVersion, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeBaseVersion>;
75
76
  /**
76
77
  * Finalize the latest knowledge base version. Required to indicate the version is complete. Will throw an exception if the latest version is not in progress.
77
78
  *
78
- * @param {MavenAGI.KnowledgeBaseId} request
79
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to finalize a version for. All other entity ID fields are inferred from the request.
79
80
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
80
81
  *
81
82
  * @throws {@link MavenAGI.NotFoundError}
@@ -83,14 +84,13 @@ export declare class Knowledge {
83
84
  * @throws {@link MavenAGI.ServerError}
84
85
  *
85
86
  * @example
86
- * await client.knowledge.finalizeKnowledgeBaseVersion({
87
- * knowledgeBaseId: "string"
88
- * })
87
+ * await client.knowledge.finalizeKnowledgeBaseVersion("help-center")
89
88
  */
90
- finalizeKnowledgeBaseVersion(request: MavenAGI.KnowledgeBaseId, requestOptions?: Knowledge.RequestOptions): Promise<void>;
89
+ finalizeKnowledgeBaseVersion(knowledgeBaseReferenceId: string, requestOptions?: Knowledge.RequestOptions): Promise<void>;
91
90
  /**
92
91
  * Create knowledge document. Requires an existing knowledge base with an in progress version. Will throw an exception if the latest version is not in progress.
93
92
  *
93
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a document for. All other entity ID fields are inferred from the request.
94
94
  * @param {MavenAGI.KnowledgeDocumentRequest} request
95
95
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
96
96
  *
@@ -99,23 +99,20 @@ export declare class Knowledge {
99
99
  * @throws {@link MavenAGI.ServerError}
100
100
  *
101
101
  * @example
102
- * await client.knowledge.createKnowledgeDocument({
103
- * contentType: MavenAGI.KnowledgeDocumentContentType.Html,
104
- * content: "string",
105
- * title: "string",
106
- * url: "string",
107
- * language: "string",
108
- * createdAt: new Date("2024-01-15T09:30:00.000Z"),
109
- * updatedAt: new Date("2024-01-15T09:30:00.000Z"),
110
- * author: "string",
111
- * knowledgeBaseId: "string",
112
- * documentId: "string"
102
+ * await client.knowledge.createKnowledgeDocument("help-center", {
103
+ * knowledgeDocumentId: {
104
+ * referenceId: "getting-started"
105
+ * },
106
+ * contentType: MavenAGI.KnowledgeDocumentContentType.Markdown,
107
+ * content: "## Getting started\\nThis is a getting started guide for the help center.",
108
+ * title: "Getting started"
113
109
  * })
114
110
  */
115
- createKnowledgeDocument(request: MavenAGI.KnowledgeDocumentRequest, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeDocumentResponse>;
111
+ createKnowledgeDocument(knowledgeBaseReferenceId: string, request: MavenAGI.KnowledgeDocumentRequest, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeDocumentResponse>;
116
112
  /**
117
- * Update knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
113
+ * Not yet implemented. Update knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
118
114
  *
115
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to update. All other entity ID fields are inferred from the request.
119
116
  * @param {MavenAGI.KnowledgeDocumentRequest} request
120
117
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
121
118
  *
@@ -124,24 +121,21 @@ export declare class Knowledge {
124
121
  * @throws {@link MavenAGI.ServerError}
125
122
  *
126
123
  * @example
127
- * await client.knowledge.updateKnowledgeDocument({
128
- * contentType: MavenAGI.KnowledgeDocumentContentType.Html,
129
- * content: "string",
130
- * title: "string",
131
- * url: "string",
132
- * language: "string",
133
- * createdAt: new Date("2024-01-15T09:30:00.000Z"),
134
- * updatedAt: new Date("2024-01-15T09:30:00.000Z"),
135
- * author: "string",
136
- * knowledgeBaseId: "string",
137
- * documentId: "string"
124
+ * await client.knowledge.updateKnowledgeDocument("help-center", {
125
+ * knowledgeDocumentId: {
126
+ * referenceId: "getting-started"
127
+ * },
128
+ * contentType: MavenAGI.KnowledgeDocumentContentType.Markdown,
129
+ * content: "## Getting started\\nThis is a getting started guide for the help center.",
130
+ * title: "Getting started"
138
131
  * })
139
132
  */
140
- updateKnowledgeDocument(request: MavenAGI.KnowledgeDocumentRequest, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeDocumentResponse>;
133
+ updateKnowledgeDocument(knowledgeBaseReferenceId: string, request: MavenAGI.KnowledgeDocumentRequest, requestOptions?: Knowledge.RequestOptions): Promise<MavenAGI.KnowledgeDocumentResponse>;
141
134
  /**
142
- * Delete knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
135
+ * Not yet implemented. Delete knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
143
136
  *
144
- * @param {MavenAGI.KnowledgeDocumentId} request
137
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to delete. All other entity ID fields are inferred from the request
138
+ * @param {string} knowledgeDocumentReferenceId - The reference ID of the knowledge document to delete. All other entity ID fields are inferred from the request.
145
139
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
146
140
  *
147
141
  * @throws {@link MavenAGI.NotFoundError}
@@ -149,11 +143,8 @@ export declare class Knowledge {
149
143
  * @throws {@link MavenAGI.ServerError}
150
144
  *
151
145
  * @example
152
- * await client.knowledge.deleteKnowledgeDocument({
153
- * knowledgeBaseId: "string",
154
- * documentId: "string"
155
- * })
146
+ * await client.knowledge.deleteKnowledgeDocument("help-center", "getting-started")
156
147
  */
157
- deleteKnowledgeDocument(request: MavenAGI.KnowledgeDocumentId, requestOptions?: Knowledge.RequestOptions): Promise<void>;
148
+ deleteKnowledgeDocument(knowledgeBaseReferenceId: string, knowledgeDocumentReferenceId: string, requestOptions?: Knowledge.RequestOptions): Promise<void>;
158
149
  protected _getAuthorizationHeader(): Promise<string | undefined>;
159
150
  }
@@ -21,9 +21,9 @@ export class Knowledge {
21
21
  this._options = _options;
22
22
  }
23
23
  /**
24
- * Create a new knowledge base.
24
+ * Update a knowledge base or create it if it doesn't exist.
25
25
  *
26
- * @param {MavenAGI.KnowledgeBase} request
26
+ * @param {MavenAGI.KnowledgeBaseRequest} request
27
27
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
29
  * @throws {@link MavenAGI.NotFoundError}
@@ -31,37 +31,38 @@ export class Knowledge {
31
31
  * @throws {@link MavenAGI.ServerError}
32
32
  *
33
33
  * @example
34
- * await client.knowledge.createKnowledgeBase({
35
- * displayName: "string",
36
- * type: MavenAGI.KnowledgeBaseType.Api,
37
- * url: "string",
38
- * knowledgeBaseId: "string"
34
+ * await client.knowledge.createOrUpdateKnowledgeBase({
35
+ * knowledgeBaseId: {
36
+ * referenceId: "help-center"
37
+ * },
38
+ * name: "Help center",
39
+ * type: MavenAGI.KnowledgeBaseType.Api
39
40
  * })
40
41
  */
41
- createKnowledgeBase(request, requestOptions) {
42
+ createOrUpdateKnowledgeBase(request, requestOptions) {
42
43
  var _a, _b;
43
44
  return __awaiter(this, void 0, void 0, function* () {
44
45
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
45
46
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge"),
46
- method: "POST",
47
+ method: "PUT",
47
48
  headers: {
48
49
  Authorization: yield this._getAuthorizationHeader(),
49
50
  "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
50
51
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
51
52
  "X-Fern-Language": "JavaScript",
52
53
  "X-Fern-SDK-Name": "mavenagi",
53
- "X-Fern-SDK-Version": "0.0.0-alpha.7",
54
+ "X-Fern-SDK-Version": "0.0.0-alpha.8",
54
55
  "X-Fern-Runtime": core.RUNTIME.type,
55
56
  "X-Fern-Runtime-Version": core.RUNTIME.version,
56
57
  },
57
58
  contentType: "application/json",
58
- body: yield serializers.KnowledgeBase.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
59
+ body: yield serializers.KnowledgeBaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
59
60
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
60
61
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
61
62
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
62
63
  });
63
64
  if (_response.ok) {
64
- return yield serializers.KnowledgeBase.parseOrThrow(_response.body, {
65
+ return yield serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
65
66
  unrecognizedObjectKeys: "passthrough",
66
67
  allowUnrecognizedUnionMembers: true,
67
68
  allowUnrecognizedEnumValues: true,
@@ -114,9 +115,9 @@ export class Knowledge {
114
115
  });
115
116
  }
116
117
  /**
117
- * Get an existing knowledge base.
118
+ * Get an existing knowledge base by its supplied ID
118
119
  *
119
- * @param {string} knowledgeBaseId - The ID of the knowledge base to get
120
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to get. All other entity ID fields are inferred from the request.
120
121
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
121
122
  *
122
123
  * @throws {@link MavenAGI.NotFoundError}
@@ -124,13 +125,13 @@ export class Knowledge {
124
125
  * @throws {@link MavenAGI.ServerError}
125
126
  *
126
127
  * @example
127
- * await client.knowledge.getKnowledgeBase("string")
128
+ * await client.knowledge.getKnowledgeBase("help-center")
128
129
  */
129
- getKnowledgeBase(knowledgeBaseId, requestOptions) {
130
+ getKnowledgeBase(knowledgeBaseReferenceId, requestOptions) {
130
131
  var _a, _b;
131
132
  return __awaiter(this, void 0, void 0, function* () {
132
133
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
133
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseId)}`),
134
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}`),
134
135
  method: "GET",
135
136
  headers: {
136
137
  Authorization: yield this._getAuthorizationHeader(),
@@ -138,7 +139,7 @@ export class Knowledge {
138
139
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
139
140
  "X-Fern-Language": "JavaScript",
140
141
  "X-Fern-SDK-Name": "mavenagi",
141
- "X-Fern-SDK-Version": "0.0.0-alpha.7",
142
+ "X-Fern-SDK-Version": "0.0.0-alpha.8",
142
143
  "X-Fern-Runtime": core.RUNTIME.type,
143
144
  "X-Fern-Runtime-Version": core.RUNTIME.version,
144
145
  },
@@ -148,7 +149,7 @@ export class Knowledge {
148
149
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
149
150
  });
150
151
  if (_response.ok) {
151
- return yield serializers.KnowledgeBase.parseOrThrow(_response.body, {
152
+ return yield serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
152
153
  unrecognizedObjectKeys: "passthrough",
153
154
  allowUnrecognizedUnionMembers: true,
154
155
  allowUnrecognizedEnumValues: true,
@@ -203,6 +204,7 @@ export class Knowledge {
203
204
  /**
204
205
  * Create a new knowledge base version. Only supported on API knowledge bases. Will throw an exception if there is an existing version in progress.
205
206
  *
207
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a version for. All other entity ID fields are inferred from the request.
206
208
  * @param {MavenAGI.KnowledgeBaseVersion} request
207
209
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
208
210
  *
@@ -211,16 +213,15 @@ export class Knowledge {
211
213
  * @throws {@link MavenAGI.ServerError}
212
214
  *
213
215
  * @example
214
- * await client.knowledge.createKnowledgeBaseVersion({
215
- * knowledgeBaseId: "string",
216
+ * await client.knowledge.createKnowledgeBaseVersion("help-center", {
216
217
  * type: MavenAGI.KnowledgeBaseVersionType.Full
217
218
  * })
218
219
  */
219
- createKnowledgeBaseVersion(request, requestOptions) {
220
+ createKnowledgeBaseVersion(knowledgeBaseReferenceId, request, requestOptions) {
220
221
  var _a, _b;
221
222
  return __awaiter(this, void 0, void 0, function* () {
222
223
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
223
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version"),
224
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/version`),
224
225
  method: "POST",
225
226
  headers: {
226
227
  Authorization: yield this._getAuthorizationHeader(),
@@ -228,7 +229,7 @@ export class Knowledge {
228
229
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
229
230
  "X-Fern-Language": "JavaScript",
230
231
  "X-Fern-SDK-Name": "mavenagi",
231
- "X-Fern-SDK-Version": "0.0.0-alpha.7",
232
+ "X-Fern-SDK-Version": "0.0.0-alpha.8",
232
233
  "X-Fern-Runtime": core.RUNTIME.type,
233
234
  "X-Fern-Runtime-Version": core.RUNTIME.version,
234
235
  },
@@ -294,7 +295,7 @@ export class Knowledge {
294
295
  /**
295
296
  * Finalize the latest knowledge base version. Required to indicate the version is complete. Will throw an exception if the latest version is not in progress.
296
297
  *
297
- * @param {MavenAGI.KnowledgeBaseId} request
298
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to finalize a version for. All other entity ID fields are inferred from the request.
298
299
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
299
300
  *
300
301
  * @throws {@link MavenAGI.NotFoundError}
@@ -302,15 +303,13 @@ export class Knowledge {
302
303
  * @throws {@link MavenAGI.ServerError}
303
304
  *
304
305
  * @example
305
- * await client.knowledge.finalizeKnowledgeBaseVersion({
306
- * knowledgeBaseId: "string"
307
- * })
306
+ * await client.knowledge.finalizeKnowledgeBaseVersion("help-center")
308
307
  */
309
- finalizeKnowledgeBaseVersion(request, requestOptions) {
308
+ finalizeKnowledgeBaseVersion(knowledgeBaseReferenceId, requestOptions) {
310
309
  var _a, _b;
311
310
  return __awaiter(this, void 0, void 0, function* () {
312
311
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
313
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version/finalize"),
312
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/version/finalize`),
314
313
  method: "POST",
315
314
  headers: {
316
315
  Authorization: yield this._getAuthorizationHeader(),
@@ -318,12 +317,11 @@ export class Knowledge {
318
317
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
319
318
  "X-Fern-Language": "JavaScript",
320
319
  "X-Fern-SDK-Name": "mavenagi",
321
- "X-Fern-SDK-Version": "0.0.0-alpha.7",
320
+ "X-Fern-SDK-Version": "0.0.0-alpha.8",
322
321
  "X-Fern-Runtime": core.RUNTIME.type,
323
322
  "X-Fern-Runtime-Version": core.RUNTIME.version,
324
323
  },
325
324
  contentType: "application/json",
326
- body: yield serializers.KnowledgeBaseId.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
327
325
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
328
326
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
329
327
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -379,6 +377,7 @@ export class Knowledge {
379
377
  /**
380
378
  * Create knowledge document. Requires an existing knowledge base with an in progress version. Will throw an exception if the latest version is not in progress.
381
379
  *
380
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a document for. All other entity ID fields are inferred from the request.
382
381
  * @param {MavenAGI.KnowledgeDocumentRequest} request
383
382
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
384
383
  *
@@ -387,24 +386,20 @@ export class Knowledge {
387
386
  * @throws {@link MavenAGI.ServerError}
388
387
  *
389
388
  * @example
390
- * await client.knowledge.createKnowledgeDocument({
391
- * contentType: MavenAGI.KnowledgeDocumentContentType.Html,
392
- * content: "string",
393
- * title: "string",
394
- * url: "string",
395
- * language: "string",
396
- * createdAt: new Date("2024-01-15T09:30:00.000Z"),
397
- * updatedAt: new Date("2024-01-15T09:30:00.000Z"),
398
- * author: "string",
399
- * knowledgeBaseId: "string",
400
- * documentId: "string"
389
+ * await client.knowledge.createKnowledgeDocument("help-center", {
390
+ * knowledgeDocumentId: {
391
+ * referenceId: "getting-started"
392
+ * },
393
+ * contentType: MavenAGI.KnowledgeDocumentContentType.Markdown,
394
+ * content: "## Getting started\\nThis is a getting started guide for the help center.",
395
+ * title: "Getting started"
401
396
  * })
402
397
  */
403
- createKnowledgeDocument(request, requestOptions) {
398
+ createKnowledgeDocument(knowledgeBaseReferenceId, request, requestOptions) {
404
399
  var _a, _b;
405
400
  return __awaiter(this, void 0, void 0, function* () {
406
401
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
407
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
402
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/document`),
408
403
  method: "POST",
409
404
  headers: {
410
405
  Authorization: yield this._getAuthorizationHeader(),
@@ -412,7 +407,7 @@ export class Knowledge {
412
407
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
413
408
  "X-Fern-Language": "JavaScript",
414
409
  "X-Fern-SDK-Name": "mavenagi",
415
- "X-Fern-SDK-Version": "0.0.0-alpha.7",
410
+ "X-Fern-SDK-Version": "0.0.0-alpha.8",
416
411
  "X-Fern-Runtime": core.RUNTIME.type,
417
412
  "X-Fern-Runtime-Version": core.RUNTIME.version,
418
413
  },
@@ -476,8 +471,9 @@ export class Knowledge {
476
471
  });
477
472
  }
478
473
  /**
479
- * Update knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
474
+ * Not yet implemented. Update knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
480
475
  *
476
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to update. All other entity ID fields are inferred from the request.
481
477
  * @param {MavenAGI.KnowledgeDocumentRequest} request
482
478
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
483
479
  *
@@ -486,24 +482,20 @@ export class Knowledge {
486
482
  * @throws {@link MavenAGI.ServerError}
487
483
  *
488
484
  * @example
489
- * await client.knowledge.updateKnowledgeDocument({
490
- * contentType: MavenAGI.KnowledgeDocumentContentType.Html,
491
- * content: "string",
492
- * title: "string",
493
- * url: "string",
494
- * language: "string",
495
- * createdAt: new Date("2024-01-15T09:30:00.000Z"),
496
- * updatedAt: new Date("2024-01-15T09:30:00.000Z"),
497
- * author: "string",
498
- * knowledgeBaseId: "string",
499
- * documentId: "string"
485
+ * await client.knowledge.updateKnowledgeDocument("help-center", {
486
+ * knowledgeDocumentId: {
487
+ * referenceId: "getting-started"
488
+ * },
489
+ * contentType: MavenAGI.KnowledgeDocumentContentType.Markdown,
490
+ * content: "## Getting started\\nThis is a getting started guide for the help center.",
491
+ * title: "Getting started"
500
492
  * })
501
493
  */
502
- updateKnowledgeDocument(request, requestOptions) {
494
+ updateKnowledgeDocument(knowledgeBaseReferenceId, request, requestOptions) {
503
495
  var _a, _b;
504
496
  return __awaiter(this, void 0, void 0, function* () {
505
497
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
506
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
498
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/document`),
507
499
  method: "PUT",
508
500
  headers: {
509
501
  Authorization: yield this._getAuthorizationHeader(),
@@ -511,7 +503,7 @@ export class Knowledge {
511
503
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
512
504
  "X-Fern-Language": "JavaScript",
513
505
  "X-Fern-SDK-Name": "mavenagi",
514
- "X-Fern-SDK-Version": "0.0.0-alpha.7",
506
+ "X-Fern-SDK-Version": "0.0.0-alpha.8",
515
507
  "X-Fern-Runtime": core.RUNTIME.type,
516
508
  "X-Fern-Runtime-Version": core.RUNTIME.version,
517
509
  },
@@ -575,9 +567,10 @@ export class Knowledge {
575
567
  });
576
568
  }
577
569
  /**
578
- * Delete knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
570
+ * Not yet implemented. Delete knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
579
571
  *
580
- * @param {MavenAGI.KnowledgeDocumentId} request
572
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to delete. All other entity ID fields are inferred from the request
573
+ * @param {string} knowledgeDocumentReferenceId - The reference ID of the knowledge document to delete. All other entity ID fields are inferred from the request.
581
574
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
582
575
  *
583
576
  * @throws {@link MavenAGI.NotFoundError}
@@ -585,16 +578,13 @@ export class Knowledge {
585
578
  * @throws {@link MavenAGI.ServerError}
586
579
  *
587
580
  * @example
588
- * await client.knowledge.deleteKnowledgeDocument({
589
- * knowledgeBaseId: "string",
590
- * documentId: "string"
591
- * })
581
+ * await client.knowledge.deleteKnowledgeDocument("help-center", "getting-started")
592
582
  */
593
- deleteKnowledgeDocument(request, requestOptions) {
583
+ deleteKnowledgeDocument(knowledgeBaseReferenceId, knowledgeDocumentReferenceId, requestOptions) {
594
584
  var _a, _b;
595
585
  return __awaiter(this, void 0, void 0, function* () {
596
586
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
597
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
587
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/${encodeURIComponent(knowledgeDocumentReferenceId)}/document`),
598
588
  method: "DELETE",
599
589
  headers: {
600
590
  Authorization: yield this._getAuthorizationHeader(),
@@ -602,12 +592,11 @@ export class Knowledge {
602
592
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
603
593
  "X-Fern-Language": "JavaScript",
604
594
  "X-Fern-SDK-Name": "mavenagi",
605
- "X-Fern-SDK-Version": "0.0.0-alpha.7",
595
+ "X-Fern-SDK-Version": "0.0.0-alpha.8",
606
596
  "X-Fern-Runtime": core.RUNTIME.type,
607
597
  "X-Fern-Runtime-Version": core.RUNTIME.version,
608
598
  },
609
599
  contentType: "application/json",
610
- body: yield serializers.KnowledgeDocumentId.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
611
600
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
612
601
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
613
602
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as MavenAGI from "../../../index";
5
- export interface BaseKnowledgeDocument extends MavenAGI.KnowledgeDocumentId {
4
+ export interface BaseKnowledgeDocument {
6
5
  /** The title of the document. Will be shown as part of answers. */
7
6
  title: string;
8
- /** The URL of the document. Should be visible to end users. Will be shown as part of answers. */
7
+ /** The URL of the document. Should be visible to end users. Will be shown as part of answers. Not used for crawling. */
9
8
  url?: string;
10
9
  /** The document language. Must be a valid ISO 639-1 language code. */
11
10
  language?: string;
@@ -2,9 +2,9 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as MavenAGI from "../../../index";
5
- export interface KnowledgeBase extends MavenAGI.KnowledgeBaseId {
5
+ export interface KnowledgeBaseProperties {
6
6
  /** The name of the knowledge base */
7
- displayName: string;
7
+ name: string;
8
8
  /** The type of the knowledge base. Can not be changed once created. */
9
9
  type: MavenAGI.KnowledgeBaseType;
10
10
  /** The URL to pull content from for RSS and URL knowledge bases. */
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * knowledgeBaseId: {
9
+ * referenceId: "help-center"
10
+ * },
11
+ * name: "Help center",
12
+ * type: MavenAGI.KnowledgeBaseType.Api
13
+ * }
14
+ */
15
+ export interface KnowledgeBaseRequest extends MavenAGI.KnowledgeBaseProperties {
16
+ /** ID that uniquely identifies this knowledge base */
17
+ knowledgeBaseId: MavenAGI.EntityIdBase;
18
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * knowledgeBaseId: {
9
+ * referenceId: "help-center",
10
+ * appId: "readme",
11
+ * organizationId: "acme",
12
+ * agentId: "support",
13
+ * type: MavenAGI.EntityType.KnowledgeBase
14
+ * },
15
+ * name: "Help center",
16
+ * type: MavenAGI.KnowledgeBaseType.Api
17
+ * }
18
+ */
19
+ export interface KnowledgeBaseResponse extends MavenAGI.KnowledgeBaseProperties {
20
+ /** ID that uniquely identifies this knowledge base */
21
+ knowledgeBaseId: MavenAGI.EntityId;
22
+ }
@@ -2,9 +2,13 @@
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
+ * type: MavenAGI.KnowledgeBaseVersionType.Full
9
+ * }
10
+ */
5
11
  export interface KnowledgeBaseVersion {
6
- /** External ID of the knowledge base used to create a new version */
7
- knowledgeBaseId: string;
8
12
  /** Indicates whether the completed version constitutes a full or partial refresh of the knowledge base. Deleting and updating documents is only supported for partial refreshes. */
9
13
  type: MavenAGI.KnowledgeBaseVersionType;
10
14
  }
@@ -2,7 +2,20 @@
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
+ * knowledgeDocumentId: {
9
+ * referenceId: "getting-started"
10
+ * },
11
+ * contentType: MavenAGI.KnowledgeDocumentContentType.Markdown,
12
+ * content: "## Getting started\\nThis is a getting started guide for the help center.",
13
+ * title: "Getting started"
14
+ * }
15
+ */
5
16
  export interface KnowledgeDocumentRequest extends MavenAGI.BaseKnowledgeDocument {
17
+ /** ID that uniquely identifies this knowledge document within its knowledge base */
18
+ knowledgeDocumentId: MavenAGI.EntityIdBase;
6
19
  contentType: MavenAGI.KnowledgeDocumentContentType;
7
20
  /** The content of the document. Not shown directly to users. May be provided in HTML or markdown. HTML will be converted to markdown automatically. Images are not currently supported and will be ignored. */
8
21
  content: string;