mavenagi 0.0.0-alpha.2

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 (755) hide show
  1. package/Client.d.ts +30 -0
  2. package/Client.js +18 -0
  3. package/README.md +129 -0
  4. package/api/index.d.ts +1 -0
  5. package/api/index.js +1 -0
  6. package/api/resources/commons/errors/AgentNotFoundError.d.ts +8 -0
  7. package/api/resources/commons/errors/AgentNotFoundError.js +14 -0
  8. package/api/resources/commons/errors/index.d.ts +1 -0
  9. package/api/resources/commons/errors/index.js +1 -0
  10. package/api/resources/commons/index.d.ts +2 -0
  11. package/api/resources/commons/index.js +2 -0
  12. package/api/resources/commons/types/ErrorMessage.d.ts +6 -0
  13. package/api/resources/commons/types/ErrorMessage.js +4 -0
  14. package/api/resources/commons/types/User.d.ts +9 -0
  15. package/api/resources/commons/types/User.js +4 -0
  16. package/api/resources/commons/types/index.d.ts +2 -0
  17. package/api/resources/commons/types/index.js +2 -0
  18. package/api/resources/conversation/client/Client.d.ts +138 -0
  19. package/api/resources/conversation/client/Client.js +676 -0
  20. package/api/resources/conversation/client/index.d.ts +1 -0
  21. package/api/resources/conversation/client/index.js +1 -0
  22. package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +8 -0
  23. package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +14 -0
  24. package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +8 -0
  25. package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +14 -0
  26. package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +8 -0
  27. package/api/resources/conversation/errors/ConversationNotFoundError.js +14 -0
  28. package/api/resources/conversation/errors/EmptyConversationError.d.ts +8 -0
  29. package/api/resources/conversation/errors/EmptyConversationError.js +14 -0
  30. package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +8 -0
  31. package/api/resources/conversation/errors/InvalidConversationIdError.js +14 -0
  32. package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +8 -0
  33. package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +14 -0
  34. package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +8 -0
  35. package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +14 -0
  36. package/api/resources/conversation/errors/index.d.ts +7 -0
  37. package/api/resources/conversation/errors/index.js +7 -0
  38. package/api/resources/conversation/index.d.ts +3 -0
  39. package/api/resources/conversation/index.js +3 -0
  40. package/api/resources/conversation/types/ActionFormField.d.ts +9 -0
  41. package/api/resources/conversation/types/ActionFormField.js +4 -0
  42. package/api/resources/conversation/types/AskRequest.d.ts +12 -0
  43. package/api/resources/conversation/types/AskRequest.js +4 -0
  44. package/api/resources/conversation/types/AskStreamEndEvent.d.ts +7 -0
  45. package/api/resources/conversation/types/AskStreamEndEvent.js +4 -0
  46. package/api/resources/conversation/types/AskStreamMetadataEvent.d.ts +6 -0
  47. package/api/resources/conversation/types/AskStreamMetadataEvent.js +4 -0
  48. package/api/resources/conversation/types/AskStreamStartEvent.d.ts +6 -0
  49. package/api/resources/conversation/types/AskStreamStartEvent.js +4 -0
  50. package/api/resources/conversation/types/AskStreamTextEvent.d.ts +6 -0
  51. package/api/resources/conversation/types/AskStreamTextEvent.js +4 -0
  52. package/api/resources/conversation/types/BotActionFormResponse.d.ts +9 -0
  53. package/api/resources/conversation/types/BotActionFormResponse.js +4 -0
  54. package/api/resources/conversation/types/BotConversationMessageType.d.ts +9 -0
  55. package/api/resources/conversation/types/BotConversationMessageType.js +8 -0
  56. package/api/resources/conversation/types/BotMessage.d.ts +9 -0
  57. package/api/resources/conversation/types/BotMessage.js +4 -0
  58. package/api/resources/conversation/types/BotResponse.d.ts +13 -0
  59. package/api/resources/conversation/types/BotResponse.js +4 -0
  60. package/api/resources/conversation/types/BotResponseMetadata.d.ts +8 -0
  61. package/api/resources/conversation/types/BotResponseMetadata.js +4 -0
  62. package/api/resources/conversation/types/BotTextResponse.d.ts +6 -0
  63. package/api/resources/conversation/types/BotTextResponse.js +4 -0
  64. package/api/resources/conversation/types/ConversationBase.d.ts +10 -0
  65. package/api/resources/conversation/types/ConversationBase.js +4 -0
  66. package/api/resources/conversation/types/ConversationContext.d.ts +20 -0
  67. package/api/resources/conversation/types/ConversationContext.js +4 -0
  68. package/api/resources/conversation/types/ConversationMessageBase.d.ts +10 -0
  69. package/api/resources/conversation/types/ConversationMessageBase.js +4 -0
  70. package/api/resources/conversation/types/ConversationMessageContext.d.ts +12 -0
  71. package/api/resources/conversation/types/ConversationMessageContext.js +4 -0
  72. package/api/resources/conversation/types/ConversationMessageRequest.d.ts +6 -0
  73. package/api/resources/conversation/types/ConversationMessageRequest.js +4 -0
  74. package/api/resources/conversation/types/ConversationMessageResponse.d.ts +13 -0
  75. package/api/resources/conversation/types/ConversationMessageResponse.js +4 -0
  76. package/api/resources/conversation/types/ConversationRequest.d.ts +8 -0
  77. package/api/resources/conversation/types/ConversationRequest.js +4 -0
  78. package/api/resources/conversation/types/ConversationResponse.d.ts +8 -0
  79. package/api/resources/conversation/types/ConversationResponse.js +4 -0
  80. package/api/resources/conversation/types/FeedbackRequest.d.ts +12 -0
  81. package/api/resources/conversation/types/FeedbackRequest.js +4 -0
  82. package/api/resources/conversation/types/FeedbackType.d.ts +11 -0
  83. package/api/resources/conversation/types/FeedbackType.js +7 -0
  84. package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +7 -0
  85. package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.js +4 -0
  86. package/api/resources/conversation/types/Source.d.ts +7 -0
  87. package/api/resources/conversation/types/Source.js +4 -0
  88. package/api/resources/conversation/types/StreamResponse.d.ts +19 -0
  89. package/api/resources/conversation/types/StreamResponse.js +4 -0
  90. package/api/resources/conversation/types/UserConversationMessageType.d.ts +12 -0
  91. package/api/resources/conversation/types/UserConversationMessageType.js +8 -0
  92. package/api/resources/conversation/types/UserMessage.d.ts +8 -0
  93. package/api/resources/conversation/types/UserMessage.js +4 -0
  94. package/api/resources/conversation/types/index.d.ts +27 -0
  95. package/api/resources/conversation/types/index.js +27 -0
  96. package/api/resources/index.d.ts +9 -0
  97. package/api/resources/index.js +9 -0
  98. package/api/resources/knowledge/client/Client.d.ts +147 -0
  99. package/api/resources/knowledge/client/Client.js +615 -0
  100. package/api/resources/knowledge/client/index.d.ts +1 -0
  101. package/api/resources/knowledge/client/index.js +1 -0
  102. package/api/resources/knowledge/errors/DocumentCreationError.d.ts +7 -0
  103. package/api/resources/knowledge/errors/DocumentCreationError.js +13 -0
  104. package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +8 -0
  105. package/api/resources/knowledge/errors/DocumentNotFoundError.js +14 -0
  106. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +8 -0
  107. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +14 -0
  108. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +8 -0
  109. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +14 -0
  110. package/api/resources/knowledge/errors/VersionInProgressError.d.ts +8 -0
  111. package/api/resources/knowledge/errors/VersionInProgressError.js +14 -0
  112. package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +8 -0
  113. package/api/resources/knowledge/errors/VersionNotInProgressError.js +14 -0
  114. package/api/resources/knowledge/errors/index.d.ts +6 -0
  115. package/api/resources/knowledge/errors/index.js +6 -0
  116. package/api/resources/knowledge/index.d.ts +3 -0
  117. package/api/resources/knowledge/index.js +3 -0
  118. package/api/resources/knowledge/types/IdBody.d.ts +6 -0
  119. package/api/resources/knowledge/types/IdBody.js +4 -0
  120. package/api/resources/knowledge/types/KnowledgeBase.d.ts +12 -0
  121. package/api/resources/knowledge/types/KnowledgeBase.js +4 -0
  122. package/api/resources/knowledge/types/KnowledgeBaseId.d.ts +7 -0
  123. package/api/resources/knowledge/types/KnowledgeBaseId.js +4 -0
  124. package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +12 -0
  125. package/api/resources/knowledge/types/KnowledgeBaseType.js +8 -0
  126. package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +10 -0
  127. package/api/resources/knowledge/types/KnowledgeBaseVersion.js +4 -0
  128. package/api/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +11 -0
  129. package/api/resources/knowledge/types/KnowledgeBaseVersionType.js +7 -0
  130. package/api/resources/knowledge/types/KnowledgeDocument.d.ts +20 -0
  131. package/api/resources/knowledge/types/KnowledgeDocument.js +4 -0
  132. package/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +9 -0
  133. package/api/resources/knowledge/types/KnowledgeDocumentId.js +4 -0
  134. package/api/resources/knowledge/types/index.d.ts +8 -0
  135. package/api/resources/knowledge/types/index.js +8 -0
  136. package/core/auth/BasicAuth.d.ts +8 -0
  137. package/core/auth/BasicAuth.js +23 -0
  138. package/core/auth/BearerToken.d.ts +5 -0
  139. package/core/auth/BearerToken.js +12 -0
  140. package/core/auth/index.d.ts +2 -0
  141. package/core/auth/index.js +2 -0
  142. package/core/fetcher/APIResponse.d.ts +10 -0
  143. package/core/fetcher/APIResponse.js +1 -0
  144. package/core/fetcher/Fetcher.d.ts +36 -0
  145. package/core/fetcher/Fetcher.js +236 -0
  146. package/core/fetcher/Supplier.d.ts +4 -0
  147. package/core/fetcher/Supplier.js +19 -0
  148. package/core/fetcher/getHeader.d.ts +1 -0
  149. package/core/fetcher/getHeader.js +8 -0
  150. package/core/fetcher/index.d.ts +5 -0
  151. package/core/fetcher/index.js +3 -0
  152. package/core/index.d.ts +5 -0
  153. package/core/index.js +5 -0
  154. package/core/runtime/index.d.ts +1 -0
  155. package/core/runtime/index.js +1 -0
  156. package/core/runtime/runtime.d.ts +8 -0
  157. package/core/runtime/runtime.js +89 -0
  158. package/core/schemas/Schema.d.ts +81 -0
  159. package/core/schemas/Schema.js +18 -0
  160. package/core/schemas/builders/date/date.d.ts +2 -0
  161. package/core/schemas/builders/date/date.js +59 -0
  162. package/core/schemas/builders/date/index.d.ts +1 -0
  163. package/core/schemas/builders/date/index.js +1 -0
  164. package/core/schemas/builders/enum/enum.d.ts +2 -0
  165. package/core/schemas/builders/enum/enum.js +35 -0
  166. package/core/schemas/builders/enum/index.d.ts +1 -0
  167. package/core/schemas/builders/enum/index.js +1 -0
  168. package/core/schemas/builders/index.d.ts +13 -0
  169. package/core/schemas/builders/index.js +13 -0
  170. package/core/schemas/builders/lazy/index.d.ts +3 -0
  171. package/core/schemas/builders/lazy/index.js +2 -0
  172. package/core/schemas/builders/lazy/lazy.d.ts +5 -0
  173. package/core/schemas/builders/lazy/lazy.js +30 -0
  174. package/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
  175. package/core/schemas/builders/lazy/lazyObject.js +17 -0
  176. package/core/schemas/builders/list/index.d.ts +1 -0
  177. package/core/schemas/builders/list/index.js +1 -0
  178. package/core/schemas/builders/list/list.d.ts +2 -0
  179. package/core/schemas/builders/list/list.js +64 -0
  180. package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  181. package/core/schemas/builders/literals/booleanLiteral.js +25 -0
  182. package/core/schemas/builders/literals/index.d.ts +2 -0
  183. package/core/schemas/builders/literals/index.js +2 -0
  184. package/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
  185. package/core/schemas/builders/literals/stringLiteral.js +25 -0
  186. package/core/schemas/builders/object/index.d.ts +6 -0
  187. package/core/schemas/builders/object/index.js +3 -0
  188. package/core/schemas/builders/object/object.d.ts +3 -0
  189. package/core/schemas/builders/object/object.js +249 -0
  190. package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  191. package/core/schemas/builders/object/objectWithoutOptionalProperties.js +4 -0
  192. package/core/schemas/builders/object/property.d.ts +8 -0
  193. package/core/schemas/builders/object/property.js +11 -0
  194. package/core/schemas/builders/object/types.d.ts +26 -0
  195. package/core/schemas/builders/object/types.js +1 -0
  196. package/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
  197. package/core/schemas/builders/object-like/getObjectLikeUtils.js +58 -0
  198. package/core/schemas/builders/object-like/index.d.ts +2 -0
  199. package/core/schemas/builders/object-like/index.js +1 -0
  200. package/core/schemas/builders/object-like/types.d.ts +7 -0
  201. package/core/schemas/builders/object-like/types.js +1 -0
  202. package/core/schemas/builders/primitives/any.d.ts +1 -0
  203. package/core/schemas/builders/primitives/any.js +3 -0
  204. package/core/schemas/builders/primitives/boolean.d.ts +1 -0
  205. package/core/schemas/builders/primitives/boolean.js +22 -0
  206. package/core/schemas/builders/primitives/index.d.ts +5 -0
  207. package/core/schemas/builders/primitives/index.js +5 -0
  208. package/core/schemas/builders/primitives/number.d.ts +1 -0
  209. package/core/schemas/builders/primitives/number.js +22 -0
  210. package/core/schemas/builders/primitives/string.d.ts +1 -0
  211. package/core/schemas/builders/primitives/string.js +22 -0
  212. package/core/schemas/builders/primitives/unknown.d.ts +1 -0
  213. package/core/schemas/builders/primitives/unknown.js +3 -0
  214. package/core/schemas/builders/record/index.d.ts +2 -0
  215. package/core/schemas/builders/record/index.js +1 -0
  216. package/core/schemas/builders/record/record.d.ts +3 -0
  217. package/core/schemas/builders/record/record.js +102 -0
  218. package/core/schemas/builders/record/types.d.ts +4 -0
  219. package/core/schemas/builders/record/types.js +1 -0
  220. package/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
  221. package/core/schemas/builders/schema-utils/JsonError.js +8 -0
  222. package/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
  223. package/core/schemas/builders/schema-utils/ParseError.js +8 -0
  224. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
  225. package/core/schemas/builders/schema-utils/getSchemaUtils.js +79 -0
  226. package/core/schemas/builders/schema-utils/index.d.ts +4 -0
  227. package/core/schemas/builders/schema-utils/index.js +3 -0
  228. package/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
  229. package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +6 -0
  230. package/core/schemas/builders/set/index.d.ts +1 -0
  231. package/core/schemas/builders/set/index.js +1 -0
  232. package/core/schemas/builders/set/set.d.ts +2 -0
  233. package/core/schemas/builders/set/set.js +49 -0
  234. package/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
  235. package/core/schemas/builders/undiscriminated-union/index.js +1 -0
  236. package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
  237. package/core/schemas/builders/undiscriminated-union/types.js +1 -0
  238. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
  239. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +47 -0
  240. package/core/schemas/builders/union/discriminant.d.ts +5 -0
  241. package/core/schemas/builders/union/discriminant.js +6 -0
  242. package/core/schemas/builders/union/index.d.ts +4 -0
  243. package/core/schemas/builders/union/index.js +2 -0
  244. package/core/schemas/builders/union/types.d.ts +13 -0
  245. package/core/schemas/builders/union/types.js +1 -0
  246. package/core/schemas/builders/union/union.d.ts +4 -0
  247. package/core/schemas/builders/union/union.js +137 -0
  248. package/core/schemas/index.d.ts +2 -0
  249. package/core/schemas/index.js +1 -0
  250. package/core/schemas/utils/MaybePromise.d.ts +1 -0
  251. package/core/schemas/utils/MaybePromise.js +1 -0
  252. package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
  253. package/core/schemas/utils/addQuestionMarksToNullableProperties.js +1 -0
  254. package/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
  255. package/core/schemas/utils/createIdentitySchemaCreator.js +12 -0
  256. package/core/schemas/utils/entries.d.ts +1 -0
  257. package/core/schemas/utils/entries.js +3 -0
  258. package/core/schemas/utils/filterObject.d.ts +1 -0
  259. package/core/schemas/utils/filterObject.js +10 -0
  260. package/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
  261. package/core/schemas/utils/getErrorMessageForIncorrectType.js +20 -0
  262. package/core/schemas/utils/isPlainObject.d.ts +1 -0
  263. package/core/schemas/utils/isPlainObject.js +14 -0
  264. package/core/schemas/utils/keys.d.ts +1 -0
  265. package/core/schemas/utils/keys.js +3 -0
  266. package/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
  267. package/core/schemas/utils/maybeSkipValidation.js +33 -0
  268. package/core/schemas/utils/partition.d.ts +1 -0
  269. package/core/schemas/utils/partition.js +12 -0
  270. package/core/streaming-fetcher/Stream.d.ts +48 -0
  271. package/core/streaming-fetcher/Stream.js +165 -0
  272. package/core/streaming-fetcher/index.d.ts +1 -0
  273. package/core/streaming-fetcher/index.js +1 -0
  274. package/dist/Client.d.ts +30 -0
  275. package/dist/Client.js +18 -0
  276. package/dist/api/index.d.ts +1 -0
  277. package/dist/api/index.js +1 -0
  278. package/dist/api/resources/commons/errors/AgentNotFoundError.d.ts +8 -0
  279. package/dist/api/resources/commons/errors/AgentNotFoundError.js +14 -0
  280. package/dist/api/resources/commons/errors/index.d.ts +1 -0
  281. package/dist/api/resources/commons/errors/index.js +1 -0
  282. package/dist/api/resources/commons/index.d.ts +2 -0
  283. package/dist/api/resources/commons/index.js +2 -0
  284. package/dist/api/resources/commons/types/ErrorMessage.d.ts +6 -0
  285. package/dist/api/resources/commons/types/ErrorMessage.js +4 -0
  286. package/dist/api/resources/commons/types/User.d.ts +9 -0
  287. package/dist/api/resources/commons/types/User.js +4 -0
  288. package/dist/api/resources/commons/types/index.d.ts +2 -0
  289. package/dist/api/resources/commons/types/index.js +2 -0
  290. package/dist/api/resources/conversation/client/Client.d.ts +138 -0
  291. package/dist/api/resources/conversation/client/Client.js +676 -0
  292. package/dist/api/resources/conversation/client/index.d.ts +1 -0
  293. package/dist/api/resources/conversation/client/index.js +1 -0
  294. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +8 -0
  295. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +14 -0
  296. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +8 -0
  297. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +14 -0
  298. package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +8 -0
  299. package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +14 -0
  300. package/dist/api/resources/conversation/errors/EmptyConversationError.d.ts +8 -0
  301. package/dist/api/resources/conversation/errors/EmptyConversationError.js +14 -0
  302. package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +8 -0
  303. package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +14 -0
  304. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +8 -0
  305. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +14 -0
  306. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +8 -0
  307. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +14 -0
  308. package/dist/api/resources/conversation/errors/index.d.ts +7 -0
  309. package/dist/api/resources/conversation/errors/index.js +7 -0
  310. package/dist/api/resources/conversation/index.d.ts +3 -0
  311. package/dist/api/resources/conversation/index.js +3 -0
  312. package/dist/api/resources/conversation/types/ActionFormField.d.ts +9 -0
  313. package/dist/api/resources/conversation/types/ActionFormField.js +4 -0
  314. package/dist/api/resources/conversation/types/AskRequest.d.ts +12 -0
  315. package/dist/api/resources/conversation/types/AskRequest.js +4 -0
  316. package/dist/api/resources/conversation/types/AskStreamEndEvent.d.ts +7 -0
  317. package/dist/api/resources/conversation/types/AskStreamEndEvent.js +4 -0
  318. package/dist/api/resources/conversation/types/AskStreamMetadataEvent.d.ts +6 -0
  319. package/dist/api/resources/conversation/types/AskStreamMetadataEvent.js +4 -0
  320. package/dist/api/resources/conversation/types/AskStreamStartEvent.d.ts +6 -0
  321. package/dist/api/resources/conversation/types/AskStreamStartEvent.js +4 -0
  322. package/dist/api/resources/conversation/types/AskStreamTextEvent.d.ts +6 -0
  323. package/dist/api/resources/conversation/types/AskStreamTextEvent.js +4 -0
  324. package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +9 -0
  325. package/dist/api/resources/conversation/types/BotActionFormResponse.js +4 -0
  326. package/dist/api/resources/conversation/types/BotConversationMessageType.d.ts +9 -0
  327. package/dist/api/resources/conversation/types/BotConversationMessageType.js +8 -0
  328. package/dist/api/resources/conversation/types/BotMessage.d.ts +9 -0
  329. package/dist/api/resources/conversation/types/BotMessage.js +4 -0
  330. package/dist/api/resources/conversation/types/BotResponse.d.ts +13 -0
  331. package/dist/api/resources/conversation/types/BotResponse.js +4 -0
  332. package/dist/api/resources/conversation/types/BotResponseMetadata.d.ts +8 -0
  333. package/dist/api/resources/conversation/types/BotResponseMetadata.js +4 -0
  334. package/dist/api/resources/conversation/types/BotTextResponse.d.ts +6 -0
  335. package/dist/api/resources/conversation/types/BotTextResponse.js +4 -0
  336. package/dist/api/resources/conversation/types/ConversationBase.d.ts +10 -0
  337. package/dist/api/resources/conversation/types/ConversationBase.js +4 -0
  338. package/dist/api/resources/conversation/types/ConversationContext.d.ts +20 -0
  339. package/dist/api/resources/conversation/types/ConversationContext.js +4 -0
  340. package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +10 -0
  341. package/dist/api/resources/conversation/types/ConversationMessageBase.js +4 -0
  342. package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +12 -0
  343. package/dist/api/resources/conversation/types/ConversationMessageContext.js +4 -0
  344. package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +6 -0
  345. package/dist/api/resources/conversation/types/ConversationMessageRequest.js +4 -0
  346. package/dist/api/resources/conversation/types/ConversationMessageResponse.d.ts +13 -0
  347. package/dist/api/resources/conversation/types/ConversationMessageResponse.js +4 -0
  348. package/dist/api/resources/conversation/types/ConversationRequest.d.ts +8 -0
  349. package/dist/api/resources/conversation/types/ConversationRequest.js +4 -0
  350. package/dist/api/resources/conversation/types/ConversationResponse.d.ts +8 -0
  351. package/dist/api/resources/conversation/types/ConversationResponse.js +4 -0
  352. package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +12 -0
  353. package/dist/api/resources/conversation/types/FeedbackRequest.js +4 -0
  354. package/dist/api/resources/conversation/types/FeedbackType.d.ts +11 -0
  355. package/dist/api/resources/conversation/types/FeedbackType.js +7 -0
  356. package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +7 -0
  357. package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.js +4 -0
  358. package/dist/api/resources/conversation/types/Source.d.ts +7 -0
  359. package/dist/api/resources/conversation/types/Source.js +4 -0
  360. package/dist/api/resources/conversation/types/StreamResponse.d.ts +19 -0
  361. package/dist/api/resources/conversation/types/StreamResponse.js +4 -0
  362. package/dist/api/resources/conversation/types/UserConversationMessageType.d.ts +12 -0
  363. package/dist/api/resources/conversation/types/UserConversationMessageType.js +8 -0
  364. package/dist/api/resources/conversation/types/UserMessage.d.ts +8 -0
  365. package/dist/api/resources/conversation/types/UserMessage.js +4 -0
  366. package/dist/api/resources/conversation/types/index.d.ts +27 -0
  367. package/dist/api/resources/conversation/types/index.js +27 -0
  368. package/dist/api/resources/index.d.ts +9 -0
  369. package/dist/api/resources/index.js +9 -0
  370. package/dist/api/resources/knowledge/client/Client.d.ts +147 -0
  371. package/dist/api/resources/knowledge/client/Client.js +615 -0
  372. package/dist/api/resources/knowledge/client/index.d.ts +1 -0
  373. package/dist/api/resources/knowledge/client/index.js +1 -0
  374. package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +7 -0
  375. package/dist/api/resources/knowledge/errors/DocumentCreationError.js +13 -0
  376. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +8 -0
  377. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +14 -0
  378. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +8 -0
  379. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +14 -0
  380. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +8 -0
  381. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +14 -0
  382. package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +8 -0
  383. package/dist/api/resources/knowledge/errors/VersionInProgressError.js +14 -0
  384. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +8 -0
  385. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +14 -0
  386. package/dist/api/resources/knowledge/errors/index.d.ts +6 -0
  387. package/dist/api/resources/knowledge/errors/index.js +6 -0
  388. package/dist/api/resources/knowledge/index.d.ts +3 -0
  389. package/dist/api/resources/knowledge/index.js +3 -0
  390. package/dist/api/resources/knowledge/types/IdBody.d.ts +6 -0
  391. package/dist/api/resources/knowledge/types/IdBody.js +4 -0
  392. package/dist/api/resources/knowledge/types/KnowledgeBase.d.ts +12 -0
  393. package/dist/api/resources/knowledge/types/KnowledgeBase.js +4 -0
  394. package/dist/api/resources/knowledge/types/KnowledgeBaseId.d.ts +7 -0
  395. package/dist/api/resources/knowledge/types/KnowledgeBaseId.js +4 -0
  396. package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +12 -0
  397. package/dist/api/resources/knowledge/types/KnowledgeBaseType.js +8 -0
  398. package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +10 -0
  399. package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.js +4 -0
  400. package/dist/api/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +11 -0
  401. package/dist/api/resources/knowledge/types/KnowledgeBaseVersionType.js +7 -0
  402. package/dist/api/resources/knowledge/types/KnowledgeDocument.d.ts +20 -0
  403. package/dist/api/resources/knowledge/types/KnowledgeDocument.js +4 -0
  404. package/dist/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +9 -0
  405. package/dist/api/resources/knowledge/types/KnowledgeDocumentId.js +4 -0
  406. package/dist/api/resources/knowledge/types/index.d.ts +8 -0
  407. package/dist/api/resources/knowledge/types/index.js +8 -0
  408. package/dist/core/auth/BasicAuth.d.ts +8 -0
  409. package/dist/core/auth/BasicAuth.js +23 -0
  410. package/dist/core/auth/BearerToken.d.ts +5 -0
  411. package/dist/core/auth/BearerToken.js +12 -0
  412. package/dist/core/auth/index.d.ts +2 -0
  413. package/dist/core/auth/index.js +2 -0
  414. package/dist/core/fetcher/APIResponse.d.ts +10 -0
  415. package/dist/core/fetcher/APIResponse.js +1 -0
  416. package/dist/core/fetcher/Fetcher.d.ts +36 -0
  417. package/dist/core/fetcher/Fetcher.js +236 -0
  418. package/dist/core/fetcher/Supplier.d.ts +4 -0
  419. package/dist/core/fetcher/Supplier.js +19 -0
  420. package/dist/core/fetcher/getHeader.d.ts +1 -0
  421. package/dist/core/fetcher/getHeader.js +8 -0
  422. package/dist/core/fetcher/index.d.ts +5 -0
  423. package/dist/core/fetcher/index.js +3 -0
  424. package/dist/core/index.d.ts +5 -0
  425. package/dist/core/index.js +5 -0
  426. package/dist/core/runtime/index.d.ts +1 -0
  427. package/dist/core/runtime/index.js +1 -0
  428. package/dist/core/runtime/runtime.d.ts +8 -0
  429. package/dist/core/runtime/runtime.js +89 -0
  430. package/dist/core/schemas/Schema.d.ts +81 -0
  431. package/dist/core/schemas/Schema.js +18 -0
  432. package/dist/core/schemas/builders/date/date.d.ts +2 -0
  433. package/dist/core/schemas/builders/date/date.js +59 -0
  434. package/dist/core/schemas/builders/date/index.d.ts +1 -0
  435. package/dist/core/schemas/builders/date/index.js +1 -0
  436. package/dist/core/schemas/builders/enum/enum.d.ts +2 -0
  437. package/dist/core/schemas/builders/enum/enum.js +35 -0
  438. package/dist/core/schemas/builders/enum/index.d.ts +1 -0
  439. package/dist/core/schemas/builders/enum/index.js +1 -0
  440. package/dist/core/schemas/builders/index.d.ts +13 -0
  441. package/dist/core/schemas/builders/index.js +13 -0
  442. package/dist/core/schemas/builders/lazy/index.d.ts +3 -0
  443. package/dist/core/schemas/builders/lazy/index.js +2 -0
  444. package/dist/core/schemas/builders/lazy/lazy.d.ts +5 -0
  445. package/dist/core/schemas/builders/lazy/lazy.js +30 -0
  446. package/dist/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
  447. package/dist/core/schemas/builders/lazy/lazyObject.js +17 -0
  448. package/dist/core/schemas/builders/list/index.d.ts +1 -0
  449. package/dist/core/schemas/builders/list/index.js +1 -0
  450. package/dist/core/schemas/builders/list/list.d.ts +2 -0
  451. package/dist/core/schemas/builders/list/list.js +64 -0
  452. package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  453. package/dist/core/schemas/builders/literals/booleanLiteral.js +25 -0
  454. package/dist/core/schemas/builders/literals/index.d.ts +2 -0
  455. package/dist/core/schemas/builders/literals/index.js +2 -0
  456. package/dist/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
  457. package/dist/core/schemas/builders/literals/stringLiteral.js +25 -0
  458. package/dist/core/schemas/builders/object/index.d.ts +6 -0
  459. package/dist/core/schemas/builders/object/index.js +3 -0
  460. package/dist/core/schemas/builders/object/object.d.ts +3 -0
  461. package/dist/core/schemas/builders/object/object.js +249 -0
  462. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  463. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +4 -0
  464. package/dist/core/schemas/builders/object/property.d.ts +8 -0
  465. package/dist/core/schemas/builders/object/property.js +11 -0
  466. package/dist/core/schemas/builders/object/types.d.ts +26 -0
  467. package/dist/core/schemas/builders/object/types.js +1 -0
  468. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
  469. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +58 -0
  470. package/dist/core/schemas/builders/object-like/index.d.ts +2 -0
  471. package/dist/core/schemas/builders/object-like/index.js +1 -0
  472. package/dist/core/schemas/builders/object-like/types.d.ts +7 -0
  473. package/dist/core/schemas/builders/object-like/types.js +1 -0
  474. package/dist/core/schemas/builders/primitives/any.d.ts +1 -0
  475. package/dist/core/schemas/builders/primitives/any.js +3 -0
  476. package/dist/core/schemas/builders/primitives/boolean.d.ts +1 -0
  477. package/dist/core/schemas/builders/primitives/boolean.js +22 -0
  478. package/dist/core/schemas/builders/primitives/index.d.ts +5 -0
  479. package/dist/core/schemas/builders/primitives/index.js +5 -0
  480. package/dist/core/schemas/builders/primitives/number.d.ts +1 -0
  481. package/dist/core/schemas/builders/primitives/number.js +22 -0
  482. package/dist/core/schemas/builders/primitives/string.d.ts +1 -0
  483. package/dist/core/schemas/builders/primitives/string.js +22 -0
  484. package/dist/core/schemas/builders/primitives/unknown.d.ts +1 -0
  485. package/dist/core/schemas/builders/primitives/unknown.js +3 -0
  486. package/dist/core/schemas/builders/record/index.d.ts +2 -0
  487. package/dist/core/schemas/builders/record/index.js +1 -0
  488. package/dist/core/schemas/builders/record/record.d.ts +3 -0
  489. package/dist/core/schemas/builders/record/record.js +102 -0
  490. package/dist/core/schemas/builders/record/types.d.ts +4 -0
  491. package/dist/core/schemas/builders/record/types.js +1 -0
  492. package/dist/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
  493. package/dist/core/schemas/builders/schema-utils/JsonError.js +8 -0
  494. package/dist/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
  495. package/dist/core/schemas/builders/schema-utils/ParseError.js +8 -0
  496. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
  497. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +79 -0
  498. package/dist/core/schemas/builders/schema-utils/index.d.ts +4 -0
  499. package/dist/core/schemas/builders/schema-utils/index.js +3 -0
  500. package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
  501. package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +6 -0
  502. package/dist/core/schemas/builders/set/index.d.ts +1 -0
  503. package/dist/core/schemas/builders/set/index.js +1 -0
  504. package/dist/core/schemas/builders/set/set.d.ts +2 -0
  505. package/dist/core/schemas/builders/set/set.js +49 -0
  506. package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
  507. package/dist/core/schemas/builders/undiscriminated-union/index.js +1 -0
  508. package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
  509. package/dist/core/schemas/builders/undiscriminated-union/types.js +1 -0
  510. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
  511. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +47 -0
  512. package/dist/core/schemas/builders/union/discriminant.d.ts +5 -0
  513. package/dist/core/schemas/builders/union/discriminant.js +6 -0
  514. package/dist/core/schemas/builders/union/index.d.ts +4 -0
  515. package/dist/core/schemas/builders/union/index.js +2 -0
  516. package/dist/core/schemas/builders/union/types.d.ts +13 -0
  517. package/dist/core/schemas/builders/union/types.js +1 -0
  518. package/dist/core/schemas/builders/union/union.d.ts +4 -0
  519. package/dist/core/schemas/builders/union/union.js +137 -0
  520. package/dist/core/schemas/index.d.ts +2 -0
  521. package/dist/core/schemas/index.js +1 -0
  522. package/dist/core/schemas/utils/MaybePromise.d.ts +1 -0
  523. package/dist/core/schemas/utils/MaybePromise.js +1 -0
  524. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
  525. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +1 -0
  526. package/dist/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
  527. package/dist/core/schemas/utils/createIdentitySchemaCreator.js +12 -0
  528. package/dist/core/schemas/utils/entries.d.ts +1 -0
  529. package/dist/core/schemas/utils/entries.js +3 -0
  530. package/dist/core/schemas/utils/filterObject.d.ts +1 -0
  531. package/dist/core/schemas/utils/filterObject.js +10 -0
  532. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
  533. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +20 -0
  534. package/dist/core/schemas/utils/isPlainObject.d.ts +1 -0
  535. package/dist/core/schemas/utils/isPlainObject.js +14 -0
  536. package/dist/core/schemas/utils/keys.d.ts +1 -0
  537. package/dist/core/schemas/utils/keys.js +3 -0
  538. package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
  539. package/dist/core/schemas/utils/maybeSkipValidation.js +33 -0
  540. package/dist/core/schemas/utils/partition.d.ts +1 -0
  541. package/dist/core/schemas/utils/partition.js +12 -0
  542. package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
  543. package/dist/core/streaming-fetcher/Stream.js +165 -0
  544. package/dist/core/streaming-fetcher/index.d.ts +1 -0
  545. package/dist/core/streaming-fetcher/index.js +1 -0
  546. package/dist/environments.d.ts +8 -0
  547. package/dist/environments.js +7 -0
  548. package/dist/errors/MavenAGIError.d.ts +12 -0
  549. package/dist/errors/MavenAGIError.js +28 -0
  550. package/dist/errors/MavenAGITimeoutError.d.ts +6 -0
  551. package/dist/errors/MavenAGITimeoutError.js +9 -0
  552. package/dist/errors/index.d.ts +2 -0
  553. package/dist/errors/index.js +2 -0
  554. package/dist/index.d.ts +4 -0
  555. package/dist/index.js +4 -0
  556. package/dist/serialization/index.d.ts +1 -0
  557. package/dist/serialization/index.js +1 -0
  558. package/dist/serialization/resources/commons/index.d.ts +1 -0
  559. package/dist/serialization/resources/commons/index.js +1 -0
  560. package/dist/serialization/resources/commons/types/ErrorMessage.d.ts +12 -0
  561. package/dist/serialization/resources/commons/types/ErrorMessage.js +7 -0
  562. package/dist/serialization/resources/commons/types/User.d.ts +14 -0
  563. package/dist/serialization/resources/commons/types/User.js +9 -0
  564. package/dist/serialization/resources/commons/types/index.d.ts +2 -0
  565. package/dist/serialization/resources/commons/types/index.js +2 -0
  566. package/dist/serialization/resources/conversation/client/appendNewMessages.d.ts +11 -0
  567. package/dist/serialization/resources/conversation/client/appendNewMessages.js +6 -0
  568. package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
  569. package/dist/serialization/resources/conversation/client/index.js +1 -0
  570. package/dist/serialization/resources/conversation/index.d.ts +2 -0
  571. package/dist/serialization/resources/conversation/index.js +2 -0
  572. package/dist/serialization/resources/conversation/types/ActionFormField.d.ts +15 -0
  573. package/dist/serialization/resources/conversation/types/ActionFormField.js +10 -0
  574. package/dist/serialization/resources/conversation/types/AskRequest.d.ts +15 -0
  575. package/dist/serialization/resources/conversation/types/AskRequest.js +10 -0
  576. package/dist/serialization/resources/conversation/types/AskStreamEndEvent.d.ts +13 -0
  577. package/dist/serialization/resources/conversation/types/AskStreamEndEvent.js +8 -0
  578. package/dist/serialization/resources/conversation/types/AskStreamMetadataEvent.d.ts +12 -0
  579. package/dist/serialization/resources/conversation/types/AskStreamMetadataEvent.js +6 -0
  580. package/dist/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +12 -0
  581. package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +7 -0
  582. package/dist/serialization/resources/conversation/types/AskStreamTextEvent.d.ts +12 -0
  583. package/dist/serialization/resources/conversation/types/AskStreamTextEvent.js +7 -0
  584. package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +15 -0
  585. package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +10 -0
  586. package/dist/serialization/resources/conversation/types/BotConversationMessageType.d.ts +10 -0
  587. package/dist/serialization/resources/conversation/types/BotConversationMessageType.js +5 -0
  588. package/dist/serialization/resources/conversation/types/BotMessage.d.ts +18 -0
  589. package/dist/serialization/resources/conversation/types/BotMessage.js +15 -0
  590. package/dist/serialization/resources/conversation/types/BotResponse.d.ts +18 -0
  591. package/dist/serialization/resources/conversation/types/BotResponse.js +15 -0
  592. package/dist/serialization/resources/conversation/types/BotResponseMetadata.d.ts +14 -0
  593. package/dist/serialization/resources/conversation/types/BotResponseMetadata.js +9 -0
  594. package/dist/serialization/resources/conversation/types/BotTextResponse.d.ts +12 -0
  595. package/dist/serialization/resources/conversation/types/BotTextResponse.js +7 -0
  596. package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +14 -0
  597. package/dist/serialization/resources/conversation/types/ConversationBase.js +9 -0
  598. package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +20 -0
  599. package/dist/serialization/resources/conversation/types/ConversationContext.js +15 -0
  600. package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +14 -0
  601. package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +9 -0
  602. package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +16 -0
  603. package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +11 -0
  604. package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +12 -0
  605. package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +6 -0
  606. package/dist/serialization/resources/conversation/types/ConversationMessageResponse.d.ts +18 -0
  607. package/dist/serialization/resources/conversation/types/ConversationMessageResponse.js +15 -0
  608. package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +14 -0
  609. package/dist/serialization/resources/conversation/types/ConversationRequest.js +11 -0
  610. package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +14 -0
  611. package/dist/serialization/resources/conversation/types/ConversationResponse.js +11 -0
  612. package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +15 -0
  613. package/dist/serialization/resources/conversation/types/FeedbackRequest.js +10 -0
  614. package/dist/serialization/resources/conversation/types/FeedbackType.d.ts +10 -0
  615. package/dist/serialization/resources/conversation/types/FeedbackType.js +5 -0
  616. package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +12 -0
  617. package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +7 -0
  618. package/dist/serialization/resources/conversation/types/Source.d.ts +13 -0
  619. package/dist/serialization/resources/conversation/types/Source.js +8 -0
  620. package/dist/serialization/resources/conversation/types/StreamResponse.d.ts +26 -0
  621. package/dist/serialization/resources/conversation/types/StreamResponse.js +19 -0
  622. package/dist/serialization/resources/conversation/types/UserConversationMessageType.d.ts +10 -0
  623. package/dist/serialization/resources/conversation/types/UserConversationMessageType.js +5 -0
  624. package/dist/serialization/resources/conversation/types/UserMessage.d.ts +15 -0
  625. package/dist/serialization/resources/conversation/types/UserMessage.js +12 -0
  626. package/dist/serialization/resources/conversation/types/index.d.ts +27 -0
  627. package/dist/serialization/resources/conversation/types/index.js +27 -0
  628. package/dist/serialization/resources/index.d.ts +6 -0
  629. package/dist/serialization/resources/index.js +6 -0
  630. package/dist/serialization/resources/knowledge/index.d.ts +1 -0
  631. package/dist/serialization/resources/knowledge/index.js +1 -0
  632. package/dist/serialization/resources/knowledge/types/IdBody.d.ts +12 -0
  633. package/dist/serialization/resources/knowledge/types/IdBody.js +7 -0
  634. package/dist/serialization/resources/knowledge/types/KnowledgeBase.d.ts +16 -0
  635. package/dist/serialization/resources/knowledge/types/KnowledgeBase.js +13 -0
  636. package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +12 -0
  637. package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.js +7 -0
  638. package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +10 -0
  639. package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.js +5 -0
  640. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +14 -0
  641. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +9 -0
  642. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +10 -0
  643. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersionType.js +5 -0
  644. package/dist/serialization/resources/knowledge/types/KnowledgeDocument.d.ts +19 -0
  645. package/dist/serialization/resources/knowledge/types/KnowledgeDocument.js +16 -0
  646. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +13 -0
  647. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.js +8 -0
  648. package/dist/serialization/resources/knowledge/types/index.d.ts +8 -0
  649. package/dist/serialization/resources/knowledge/types/index.js +8 -0
  650. package/environments.d.ts +8 -0
  651. package/environments.js +7 -0
  652. package/errors/MavenAGIError.d.ts +12 -0
  653. package/errors/MavenAGIError.js +28 -0
  654. package/errors/MavenAGITimeoutError.d.ts +6 -0
  655. package/errors/MavenAGITimeoutError.js +9 -0
  656. package/errors/index.d.ts +2 -0
  657. package/errors/index.js +2 -0
  658. package/index.d.ts +4 -0
  659. package/index.js +4 -0
  660. package/jest.config.js +5 -0
  661. package/package.json +34 -0
  662. package/serialization/index.d.ts +1 -0
  663. package/serialization/index.js +1 -0
  664. package/serialization/resources/commons/index.d.ts +1 -0
  665. package/serialization/resources/commons/index.js +1 -0
  666. package/serialization/resources/commons/types/ErrorMessage.d.ts +12 -0
  667. package/serialization/resources/commons/types/ErrorMessage.js +7 -0
  668. package/serialization/resources/commons/types/User.d.ts +14 -0
  669. package/serialization/resources/commons/types/User.js +9 -0
  670. package/serialization/resources/commons/types/index.d.ts +2 -0
  671. package/serialization/resources/commons/types/index.js +2 -0
  672. package/serialization/resources/conversation/client/appendNewMessages.d.ts +11 -0
  673. package/serialization/resources/conversation/client/appendNewMessages.js +6 -0
  674. package/serialization/resources/conversation/client/index.d.ts +1 -0
  675. package/serialization/resources/conversation/client/index.js +1 -0
  676. package/serialization/resources/conversation/index.d.ts +2 -0
  677. package/serialization/resources/conversation/index.js +2 -0
  678. package/serialization/resources/conversation/types/ActionFormField.d.ts +15 -0
  679. package/serialization/resources/conversation/types/ActionFormField.js +10 -0
  680. package/serialization/resources/conversation/types/AskRequest.d.ts +15 -0
  681. package/serialization/resources/conversation/types/AskRequest.js +10 -0
  682. package/serialization/resources/conversation/types/AskStreamEndEvent.d.ts +13 -0
  683. package/serialization/resources/conversation/types/AskStreamEndEvent.js +8 -0
  684. package/serialization/resources/conversation/types/AskStreamMetadataEvent.d.ts +12 -0
  685. package/serialization/resources/conversation/types/AskStreamMetadataEvent.js +6 -0
  686. package/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +12 -0
  687. package/serialization/resources/conversation/types/AskStreamStartEvent.js +7 -0
  688. package/serialization/resources/conversation/types/AskStreamTextEvent.d.ts +12 -0
  689. package/serialization/resources/conversation/types/AskStreamTextEvent.js +7 -0
  690. package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +15 -0
  691. package/serialization/resources/conversation/types/BotActionFormResponse.js +10 -0
  692. package/serialization/resources/conversation/types/BotConversationMessageType.d.ts +10 -0
  693. package/serialization/resources/conversation/types/BotConversationMessageType.js +5 -0
  694. package/serialization/resources/conversation/types/BotMessage.d.ts +18 -0
  695. package/serialization/resources/conversation/types/BotMessage.js +15 -0
  696. package/serialization/resources/conversation/types/BotResponse.d.ts +18 -0
  697. package/serialization/resources/conversation/types/BotResponse.js +15 -0
  698. package/serialization/resources/conversation/types/BotResponseMetadata.d.ts +14 -0
  699. package/serialization/resources/conversation/types/BotResponseMetadata.js +9 -0
  700. package/serialization/resources/conversation/types/BotTextResponse.d.ts +12 -0
  701. package/serialization/resources/conversation/types/BotTextResponse.js +7 -0
  702. package/serialization/resources/conversation/types/ConversationBase.d.ts +14 -0
  703. package/serialization/resources/conversation/types/ConversationBase.js +9 -0
  704. package/serialization/resources/conversation/types/ConversationContext.d.ts +20 -0
  705. package/serialization/resources/conversation/types/ConversationContext.js +15 -0
  706. package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +14 -0
  707. package/serialization/resources/conversation/types/ConversationMessageBase.js +9 -0
  708. package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +16 -0
  709. package/serialization/resources/conversation/types/ConversationMessageContext.js +11 -0
  710. package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +12 -0
  711. package/serialization/resources/conversation/types/ConversationMessageRequest.js +6 -0
  712. package/serialization/resources/conversation/types/ConversationMessageResponse.d.ts +18 -0
  713. package/serialization/resources/conversation/types/ConversationMessageResponse.js +15 -0
  714. package/serialization/resources/conversation/types/ConversationRequest.d.ts +14 -0
  715. package/serialization/resources/conversation/types/ConversationRequest.js +11 -0
  716. package/serialization/resources/conversation/types/ConversationResponse.d.ts +14 -0
  717. package/serialization/resources/conversation/types/ConversationResponse.js +11 -0
  718. package/serialization/resources/conversation/types/FeedbackRequest.d.ts +15 -0
  719. package/serialization/resources/conversation/types/FeedbackRequest.js +10 -0
  720. package/serialization/resources/conversation/types/FeedbackType.d.ts +10 -0
  721. package/serialization/resources/conversation/types/FeedbackType.js +5 -0
  722. package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +12 -0
  723. package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +7 -0
  724. package/serialization/resources/conversation/types/Source.d.ts +13 -0
  725. package/serialization/resources/conversation/types/Source.js +8 -0
  726. package/serialization/resources/conversation/types/StreamResponse.d.ts +26 -0
  727. package/serialization/resources/conversation/types/StreamResponse.js +19 -0
  728. package/serialization/resources/conversation/types/UserConversationMessageType.d.ts +10 -0
  729. package/serialization/resources/conversation/types/UserConversationMessageType.js +5 -0
  730. package/serialization/resources/conversation/types/UserMessage.d.ts +15 -0
  731. package/serialization/resources/conversation/types/UserMessage.js +12 -0
  732. package/serialization/resources/conversation/types/index.d.ts +27 -0
  733. package/serialization/resources/conversation/types/index.js +27 -0
  734. package/serialization/resources/index.d.ts +6 -0
  735. package/serialization/resources/index.js +6 -0
  736. package/serialization/resources/knowledge/index.d.ts +1 -0
  737. package/serialization/resources/knowledge/index.js +1 -0
  738. package/serialization/resources/knowledge/types/IdBody.d.ts +12 -0
  739. package/serialization/resources/knowledge/types/IdBody.js +7 -0
  740. package/serialization/resources/knowledge/types/KnowledgeBase.d.ts +16 -0
  741. package/serialization/resources/knowledge/types/KnowledgeBase.js +13 -0
  742. package/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +12 -0
  743. package/serialization/resources/knowledge/types/KnowledgeBaseId.js +7 -0
  744. package/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +10 -0
  745. package/serialization/resources/knowledge/types/KnowledgeBaseType.js +5 -0
  746. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +14 -0
  747. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +9 -0
  748. package/serialization/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +10 -0
  749. package/serialization/resources/knowledge/types/KnowledgeBaseVersionType.js +5 -0
  750. package/serialization/resources/knowledge/types/KnowledgeDocument.d.ts +19 -0
  751. package/serialization/resources/knowledge/types/KnowledgeDocument.js +16 -0
  752. package/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +13 -0
  753. package/serialization/resources/knowledge/types/KnowledgeDocumentId.js +8 -0
  754. package/serialization/resources/knowledge/types/index.d.ts +8 -0
  755. package/serialization/resources/knowledge/types/index.js +8 -0
@@ -0,0 +1,19 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ export const Supplier = {
11
+ get: (supplier) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (typeof supplier === "function") {
13
+ return supplier();
14
+ }
15
+ else {
16
+ return supplier;
17
+ }
18
+ }),
19
+ };
@@ -0,0 +1 @@
1
+ export declare function getHeader(headers: Record<string, any>, header: string): string | undefined;
@@ -0,0 +1,8 @@
1
+ export function getHeader(headers, header) {
2
+ for (const [headerKey, headerValue] of Object.entries(headers)) {
3
+ if (headerKey.toLowerCase() === header.toLowerCase()) {
4
+ return headerValue;
5
+ }
6
+ }
7
+ return undefined;
8
+ }
@@ -0,0 +1,5 @@
1
+ export type { APIResponse } from "./APIResponse";
2
+ export { fetcher } from "./Fetcher";
3
+ export type { Fetcher, FetchFunction } from "./Fetcher";
4
+ export { getHeader } from "./getHeader";
5
+ export { Supplier } from "./Supplier";
@@ -0,0 +1,3 @@
1
+ export { fetcher } from "./Fetcher";
2
+ export { getHeader } from "./getHeader";
3
+ export { Supplier } from "./Supplier";
@@ -0,0 +1,5 @@
1
+ export * from "./fetcher";
2
+ export * from "./runtime";
3
+ export * from "./streaming-fetcher";
4
+ export * from "./auth";
5
+ export * as serialization from "./schemas";
package/core/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./fetcher";
2
+ export * from "./runtime";
3
+ export * from "./streaming-fetcher";
4
+ export * from "./auth";
5
+ export * as serialization from "./schemas";
@@ -0,0 +1 @@
1
+ export { RUNTIME } from "./runtime";
@@ -0,0 +1 @@
1
+ export { RUNTIME } from "./runtime";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A constant that indicates which environment and version the SDK is running in.
3
+ */
4
+ export declare const RUNTIME: Runtime;
5
+ export interface Runtime {
6
+ type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd";
7
+ version?: string;
8
+ }
@@ -0,0 +1,89 @@
1
+ var _a, _b, _c, _d, _e;
2
+ /**
3
+ * A constant that indicates whether the environment the code is running is a Web Browser.
4
+ */
5
+ const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
6
+ /**
7
+ * A constant that indicates whether the environment the code is running is a Web Worker.
8
+ */
9
+ const isWebWorker = typeof self === "object" &&
10
+ // @ts-ignore
11
+ typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
12
+ (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" ||
13
+ ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" ||
14
+ ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope");
15
+ /**
16
+ * A constant that indicates whether the environment the code is running is Deno.
17
+ */
18
+ const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
19
+ /**
20
+ * A constant that indicates whether the environment the code is running is Bun.sh.
21
+ */
22
+ const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
23
+ /**
24
+ * A constant that indicates whether the environment the code is running is Node.JS.
25
+ */
26
+ const isNode = typeof process !== "undefined" &&
27
+ Boolean(process.version) &&
28
+ Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) &&
29
+ // Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
30
+ !isDeno &&
31
+ !isBun;
32
+ /**
33
+ * A constant that indicates whether the environment the code is running is in React-Native.
34
+ * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
35
+ */
36
+ const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
37
+ /**
38
+ * A constant that indicates whether the environment the code is running is Cloudflare.
39
+ * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
40
+ */
41
+ const isCloudflare = typeof globalThis !== "undefined" && ((_e = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _e === void 0 ? void 0 : _e.userAgent) === "Cloudflare-Workers";
42
+ /**
43
+ * A constant that indicates which environment and version the SDK is running in.
44
+ */
45
+ export const RUNTIME = evaluateRuntime();
46
+ function evaluateRuntime() {
47
+ if (isBrowser) {
48
+ return {
49
+ type: "browser",
50
+ version: window.navigator.userAgent,
51
+ };
52
+ }
53
+ if (isCloudflare) {
54
+ return {
55
+ type: "workerd",
56
+ };
57
+ }
58
+ if (isWebWorker) {
59
+ return {
60
+ type: "web-worker",
61
+ };
62
+ }
63
+ if (isDeno) {
64
+ return {
65
+ type: "deno",
66
+ version: Deno.version.deno,
67
+ };
68
+ }
69
+ if (isBun) {
70
+ return {
71
+ type: "bun",
72
+ version: Bun.version,
73
+ };
74
+ }
75
+ if (isNode) {
76
+ return {
77
+ type: "node",
78
+ version: process.versions.node,
79
+ };
80
+ }
81
+ if (isReactNative) {
82
+ return {
83
+ type: "react-native",
84
+ };
85
+ }
86
+ return {
87
+ type: "unknown",
88
+ };
89
+ }
@@ -0,0 +1,81 @@
1
+ import { SchemaUtils } from "./builders";
2
+ import { MaybePromise } from "./utils/MaybePromise";
3
+ export declare type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
4
+ export declare type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
5
+ export declare type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
6
+ export interface BaseSchema<Raw, Parsed> {
7
+ parse: (raw: unknown, opts?: SchemaOptions) => MaybePromise<MaybeValid<Parsed>>;
8
+ json: (parsed: unknown, opts?: SchemaOptions) => MaybePromise<MaybeValid<Raw>>;
9
+ getType: () => SchemaType | Promise<SchemaType>;
10
+ }
11
+ export declare const SchemaType: {
12
+ readonly DATE: "date";
13
+ readonly ENUM: "enum";
14
+ readonly LIST: "list";
15
+ readonly STRING_LITERAL: "stringLiteral";
16
+ readonly BOOLEAN_LITERAL: "booleanLiteral";
17
+ readonly OBJECT: "object";
18
+ readonly ANY: "any";
19
+ readonly BOOLEAN: "boolean";
20
+ readonly NUMBER: "number";
21
+ readonly STRING: "string";
22
+ readonly UNKNOWN: "unknown";
23
+ readonly RECORD: "record";
24
+ readonly SET: "set";
25
+ readonly UNION: "union";
26
+ readonly UNDISCRIMINATED_UNION: "undiscriminatedUnion";
27
+ readonly OPTIONAL: "optional";
28
+ };
29
+ export declare type SchemaType = typeof SchemaType[keyof typeof SchemaType];
30
+ export declare type MaybeValid<T> = Valid<T> | Invalid;
31
+ export interface Valid<T> {
32
+ ok: true;
33
+ value: T;
34
+ }
35
+ export interface Invalid {
36
+ ok: false;
37
+ errors: ValidationError[];
38
+ }
39
+ export interface ValidationError {
40
+ path: string[];
41
+ message: string;
42
+ }
43
+ export interface SchemaOptions {
44
+ /**
45
+ * how to handle unrecognized keys in objects
46
+ *
47
+ * @default "fail"
48
+ */
49
+ unrecognizedObjectKeys?: "fail" | "passthrough" | "strip";
50
+ /**
51
+ * whether to fail when an unrecognized discriminant value is
52
+ * encountered in a union
53
+ *
54
+ * @default false
55
+ */
56
+ allowUnrecognizedUnionMembers?: boolean;
57
+ /**
58
+ * whether to fail when an unrecognized enum value is encountered
59
+ *
60
+ * @default false
61
+ */
62
+ allowUnrecognizedEnumValues?: boolean;
63
+ /**
64
+ * whether to allow data that doesn't conform to the schema.
65
+ * invalid data is passed through without transformation.
66
+ *
67
+ * when this is enabled, .parse() and .json() will always
68
+ * return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()`
69
+ * will never fail.
70
+ *
71
+ * @default false
72
+ */
73
+ skipValidation?: boolean;
74
+ /**
75
+ * each validation failure contains a "path" property, which is
76
+ * the breadcrumbs to the offending node in the JSON. you can supply
77
+ * a prefix that is prepended to all the errors' paths. this can be
78
+ * helpful for zurg's internal debug logging.
79
+ */
80
+ breadcrumbsPrefix?: string[];
81
+ }
@@ -0,0 +1,18 @@
1
+ export const SchemaType = {
2
+ DATE: "date",
3
+ ENUM: "enum",
4
+ LIST: "list",
5
+ STRING_LITERAL: "stringLiteral",
6
+ BOOLEAN_LITERAL: "booleanLiteral",
7
+ OBJECT: "object",
8
+ ANY: "any",
9
+ BOOLEAN: "boolean",
10
+ NUMBER: "number",
11
+ STRING: "string",
12
+ UNKNOWN: "unknown",
13
+ RECORD: "record",
14
+ SET: "set",
15
+ UNION: "union",
16
+ UNDISCRIMINATED_UNION: "undiscriminatedUnion",
17
+ OPTIONAL: "optional",
18
+ };
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function date(): Schema<string, Date>;
@@ -0,0 +1,59 @@
1
+ import { SchemaType } from "../../Schema";
2
+ import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
3
+ import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
4
+ import { getSchemaUtils } from "../schema-utils";
5
+ // https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime
6
+ const ISO_8601_REGEX = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
7
+ export function date() {
8
+ const baseSchema = {
9
+ parse: (raw, { breadcrumbsPrefix = [] } = {}) => {
10
+ if (typeof raw !== "string") {
11
+ return {
12
+ ok: false,
13
+ errors: [
14
+ {
15
+ path: breadcrumbsPrefix,
16
+ message: getErrorMessageForIncorrectType(raw, "string"),
17
+ },
18
+ ],
19
+ };
20
+ }
21
+ if (!ISO_8601_REGEX.test(raw)) {
22
+ return {
23
+ ok: false,
24
+ errors: [
25
+ {
26
+ path: breadcrumbsPrefix,
27
+ message: getErrorMessageForIncorrectType(raw, "ISO 8601 date string"),
28
+ },
29
+ ],
30
+ };
31
+ }
32
+ return {
33
+ ok: true,
34
+ value: new Date(raw),
35
+ };
36
+ },
37
+ json: (date, { breadcrumbsPrefix = [] } = {}) => {
38
+ if (date instanceof Date) {
39
+ return {
40
+ ok: true,
41
+ value: date.toISOString(),
42
+ };
43
+ }
44
+ else {
45
+ return {
46
+ ok: false,
47
+ errors: [
48
+ {
49
+ path: breadcrumbsPrefix,
50
+ message: getErrorMessageForIncorrectType(date, "Date object"),
51
+ },
52
+ ],
53
+ };
54
+ }
55
+ },
56
+ getType: () => SchemaType.DATE,
57
+ };
58
+ return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
59
+ }
@@ -0,0 +1 @@
1
+ export { date } from "./date";
@@ -0,0 +1 @@
1
+ export { date } from "./date";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function enum_<U extends string, E extends U[]>(values: E): Schema<E[number], E[number]>;
@@ -0,0 +1,35 @@
1
+ import { SchemaType } from "../../Schema";
2
+ import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
3
+ import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
4
+ export function enum_(values) {
5
+ const validValues = new Set(values);
6
+ const schemaCreator = createIdentitySchemaCreator(SchemaType.ENUM, (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => {
7
+ if (typeof value !== "string") {
8
+ return {
9
+ ok: false,
10
+ errors: [
11
+ {
12
+ path: breadcrumbsPrefix,
13
+ message: getErrorMessageForIncorrectType(value, "string"),
14
+ },
15
+ ],
16
+ };
17
+ }
18
+ if (!validValues.has(value) && !allowUnrecognizedEnumValues) {
19
+ return {
20
+ ok: false,
21
+ errors: [
22
+ {
23
+ path: breadcrumbsPrefix,
24
+ message: getErrorMessageForIncorrectType(value, "enum"),
25
+ },
26
+ ],
27
+ };
28
+ }
29
+ return {
30
+ ok: true,
31
+ value: value,
32
+ };
33
+ });
34
+ return schemaCreator();
35
+ }
@@ -0,0 +1 @@
1
+ export { enum_ } from "./enum";
@@ -0,0 +1 @@
1
+ export { enum_ } from "./enum";
@@ -0,0 +1,13 @@
1
+ export * from "./date";
2
+ export * from "./enum";
3
+ export * from "./lazy";
4
+ export * from "./list";
5
+ export * from "./literals";
6
+ export * from "./object";
7
+ export * from "./object-like";
8
+ export * from "./primitives";
9
+ export * from "./record";
10
+ export * from "./schema-utils";
11
+ export * from "./set";
12
+ export * from "./undiscriminated-union";
13
+ export * from "./union";
@@ -0,0 +1,13 @@
1
+ export * from "./date";
2
+ export * from "./enum";
3
+ export * from "./lazy";
4
+ export * from "./list";
5
+ export * from "./literals";
6
+ export * from "./object";
7
+ export * from "./object-like";
8
+ export * from "./primitives";
9
+ export * from "./record";
10
+ export * from "./schema-utils";
11
+ export * from "./set";
12
+ export * from "./undiscriminated-union";
13
+ export * from "./union";
@@ -0,0 +1,3 @@
1
+ export { lazy } from "./lazy";
2
+ export type { SchemaGetter } from "./lazy";
3
+ export { lazyObject } from "./lazyObject";
@@ -0,0 +1,2 @@
1
+ export { lazy } from "./lazy";
2
+ export { lazyObject } from "./lazyObject";
@@ -0,0 +1,5 @@
1
+ import { BaseSchema, Schema } from "../../Schema";
2
+ export declare type SchemaGetter<SchemaType extends Schema<any, any>> = () => SchemaType | Promise<SchemaType>;
3
+ export declare function lazy<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): Schema<Raw, Parsed>;
4
+ export declare function constructLazyBaseSchema<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): BaseSchema<Raw, Parsed>;
5
+ export declare function getMemoizedSchema<SchemaType extends Schema<any, any>>(getter: SchemaGetter<SchemaType>): Promise<SchemaType>;
@@ -0,0 +1,30 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { getSchemaUtils } from "../schema-utils";
11
+ export function lazy(getter) {
12
+ const baseSchema = constructLazyBaseSchema(getter);
13
+ return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
14
+ }
15
+ export function constructLazyBaseSchema(getter) {
16
+ return {
17
+ parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter)).parse(raw, opts); }),
18
+ json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter)).json(parsed, opts); }),
19
+ getType: () => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter)).getType(); }),
20
+ };
21
+ }
22
+ export function getMemoizedSchema(getter) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const castedGetter = getter;
25
+ if (castedGetter.__zurg_memoized == null) {
26
+ castedGetter.__zurg_memoized = yield getter();
27
+ }
28
+ return castedGetter.__zurg_memoized;
29
+ });
30
+ }
@@ -0,0 +1,3 @@
1
+ import { ObjectSchema } from "../object/types";
2
+ import { SchemaGetter } from "./lazy";
3
+ export declare function lazyObject<Raw, Parsed>(getter: SchemaGetter<ObjectSchema<Raw, Parsed>>): ObjectSchema<Raw, Parsed>;
@@ -0,0 +1,17 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { getObjectUtils } from "../object";
11
+ import { getObjectLikeUtils } from "../object-like";
12
+ import { getSchemaUtils } from "../schema-utils";
13
+ import { constructLazyBaseSchema, getMemoizedSchema } from "./lazy";
14
+ export function lazyObject(getter) {
15
+ const baseSchema = Object.assign(Object.assign({}, constructLazyBaseSchema(getter)), { _getRawProperties: () => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter))._getRawProperties(); }), _getParsedProperties: () => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter))._getParsedProperties(); }) });
16
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema)), getObjectLikeUtils(baseSchema)), getObjectUtils(baseSchema));
17
+ }
@@ -0,0 +1 @@
1
+ export { list } from "./list";
@@ -0,0 +1 @@
1
+ export { list } from "./list";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function list<Raw, Parsed>(schema: Schema<Raw, Parsed>): Schema<Raw[], Parsed[]>;
@@ -0,0 +1,64 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { SchemaType } from "../../Schema";
11
+ import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
12
+ import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
13
+ import { getSchemaUtils } from "../schema-utils";
14
+ export function list(schema) {
15
+ const baseSchema = {
16
+ parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
17
+ return validateAndTransformArray(raw, (item, index) => {
18
+ var _a;
19
+ return schema.parse(item, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `[${index}]`] }));
20
+ });
21
+ }),
22
+ json: (parsed, opts) => validateAndTransformArray(parsed, (item, index) => {
23
+ var _a;
24
+ return schema.json(item, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `[${index}]`] }));
25
+ }),
26
+ getType: () => SchemaType.LIST,
27
+ };
28
+ return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
29
+ }
30
+ function validateAndTransformArray(value, transformItem) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ if (!Array.isArray(value)) {
33
+ return {
34
+ ok: false,
35
+ errors: [
36
+ {
37
+ message: getErrorMessageForIncorrectType(value, "list"),
38
+ path: [],
39
+ },
40
+ ],
41
+ };
42
+ }
43
+ const maybeValidItems = yield Promise.all(value.map((item, index) => transformItem(item, index)));
44
+ return maybeValidItems.reduce((acc, item) => {
45
+ if (acc.ok && item.ok) {
46
+ return {
47
+ ok: true,
48
+ value: [...acc.value, item.value],
49
+ };
50
+ }
51
+ const errors = [];
52
+ if (!acc.ok) {
53
+ errors.push(...acc.errors);
54
+ }
55
+ if (!item.ok) {
56
+ errors.push(...item.errors);
57
+ }
58
+ return {
59
+ ok: false,
60
+ errors,
61
+ };
62
+ }, { ok: true, value: [] });
63
+ });
64
+ }
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function booleanLiteral<V extends boolean>(literal: V): Schema<V, V>;
@@ -0,0 +1,25 @@
1
+ import { SchemaType } from "../../Schema";
2
+ import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
3
+ import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
4
+ export function booleanLiteral(literal) {
5
+ const schemaCreator = createIdentitySchemaCreator(SchemaType.BOOLEAN_LITERAL, (value, { breadcrumbsPrefix = [] } = {}) => {
6
+ if (value === literal) {
7
+ return {
8
+ ok: true,
9
+ value: literal,
10
+ };
11
+ }
12
+ else {
13
+ return {
14
+ ok: false,
15
+ errors: [
16
+ {
17
+ path: breadcrumbsPrefix,
18
+ message: getErrorMessageForIncorrectType(value, `${literal.toString()}`),
19
+ },
20
+ ],
21
+ };
22
+ }
23
+ });
24
+ return schemaCreator();
25
+ }
@@ -0,0 +1,2 @@
1
+ export { stringLiteral } from "./stringLiteral";
2
+ export { booleanLiteral } from "./booleanLiteral";
@@ -0,0 +1,2 @@
1
+ export { stringLiteral } from "./stringLiteral";
2
+ export { booleanLiteral } from "./booleanLiteral";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function stringLiteral<V extends string>(literal: V): Schema<V, V>;
@@ -0,0 +1,25 @@
1
+ import { SchemaType } from "../../Schema";
2
+ import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
3
+ import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
4
+ export function stringLiteral(literal) {
5
+ const schemaCreator = createIdentitySchemaCreator(SchemaType.STRING_LITERAL, (value, { breadcrumbsPrefix = [] } = {}) => {
6
+ if (value === literal) {
7
+ return {
8
+ ok: true,
9
+ value: literal,
10
+ };
11
+ }
12
+ else {
13
+ return {
14
+ ok: false,
15
+ errors: [
16
+ {
17
+ path: breadcrumbsPrefix,
18
+ message: getErrorMessageForIncorrectType(value, `"${literal}"`),
19
+ },
20
+ ],
21
+ };
22
+ }
23
+ });
24
+ return schemaCreator();
25
+ }
@@ -0,0 +1,6 @@
1
+ export { getObjectUtils, object } from "./object";
2
+ export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties";
3
+ export type { inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, } from "./objectWithoutOptionalProperties";
4
+ export { isProperty, property } from "./property";
5
+ export type { Property } from "./property";
6
+ export type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, inferParsedObject, inferParsedObjectFromPropertySchemas, inferParsedPropertySchema, inferRawKey, inferRawObject, inferRawObjectFromPropertySchemas, inferRawPropertySchema, ObjectSchema, ObjectUtils, PropertySchemas, } from "./types";
@@ -0,0 +1,3 @@
1
+ export { getObjectUtils, object } from "./object";
2
+ export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties";
3
+ export { isProperty, property } from "./property";